diff --git a/assets/Basic.vue_vue_type_script_setup_true_lang-CuYLN0Ir.js b/assets/Basic.vue_vue_type_script_setup_true_lang-Q6h2vVkt.js similarity index 81% rename from assets/Basic.vue_vue_type_script_setup_true_lang-CuYLN0Ir.js rename to assets/Basic.vue_vue_type_script_setup_true_lang-Q6h2vVkt.js index 8a90132a69ebfd1b556cf8c415e5c73049a20ccd..9faa2a1e156a278c14c7f224153536d623350351 100644 --- a/assets/Basic.vue_vue_type_script_setup_true_lang-CuYLN0Ir.js +++ b/assets/Basic.vue_vue_type_script_setup_true_lang-Q6h2vVkt.js @@ -1 +1 @@ -import{d as c,ce as d,cf as f,e as s,w as p,ae as v,cc as x,o as h,c as y,a3 as _}from"./index-CNH1g_GM.js";const g=c({__name:"Basic",props:{modelValue:{default:""},modelModifiers:{}},emits:d(["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 as c,ce as d,cf as f,e as s,w as p,bm as v,cc as x,o as h,c as y,a3 as _}from"./index-B06xwjXa.js";const g=c({__name:"Basic",props:{modelValue:{default:""},modelModifiers:{}},emits:d(["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-BPmKPIdN.js b/assets/CardDetailDialog-BPmKPIdN.js new file mode 100644 index 0000000000000000000000000000000000000000..c01162d0777fb812400669d4ebb91a38726779ab --- /dev/null +++ b/assets/CardDetailDialog-BPmKPIdN.js @@ -0,0 +1 @@ +import{_ as o}from"./CardDetailDialog.vue_vue_type_script_setup_true_lang-BW7EWJLR.js";import"./DeleteCardDialog.vue_vue_type_script_setup_true_lang-D73P_gUt.js";import"./index-B06xwjXa.js";import"./index-BVgMpW27.js";import"./floating-ui.core-CgBsuaUc.js";import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-Du5e5QRV.js";import"./three-vrm.module-CtuEk7GG.js";import"./emotions-DWNSb738.js";import"./mcp-BfXpaYZf.js";import"./airi-card-BqOg7f9m.js";import"./consciousness-D-_ZstxC.js";import"./providers-BCv4E6z9.js";import"./index-LHmcipjy.js";import"./speech-CLjA-Bq8.js";import"./Select.vue_vue_type_style_index_0_lang-CzS20kE7.js";export{o as default}; diff --git a/assets/CardDetailDialog-DURsENRS.js b/assets/CardDetailDialog-DURsENRS.js deleted file mode 100644 index a31de201464d337ac08eb0af9197ed307faa8c24..0000000000000000000000000000000000000000 --- a/assets/CardDetailDialog-DURsENRS.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as o}from"./CardDetailDialog.vue_vue_type_script_setup_true_lang-BGLSRcrK.js";import"./DeleteCardDialog.vue_vue_type_script_setup_true_lang-BuRPZrcj.js";import"./index-CNH1g_GM.js";import"./index-5YeHuuyL.js";import"./floating-ui.core-CgBsuaUc.js";import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-BQHOFrhO.js";import"./three-vrm-animation.module-B_hGdUpX.js";import"./mcp-B7-jaCfZ.js";import"./airi-card-JBK1Hzhm.js";import"./emotions-DWNSb738.js";import"./consciousness-DieQE4I6.js";import"./providers-DP46_3AG.js";import"./index-LHmcipjy.js";import"./speech-DpuUb2e9.js";import"./Select.vue_vue_type_style_index_0_lang-BIffysKh.js";export{o as default}; diff --git a/assets/CardDetailDialog.vue_vue_type_script_setup_true_lang-BGLSRcrK.js b/assets/CardDetailDialog.vue_vue_type_script_setup_true_lang-BGLSRcrK.js deleted file mode 100644 index 6b1873eb64cfb6e7c7c1bf0962feb40c627e0e53..0000000000000000000000000000000000000000 --- a/assets/CardDetailDialog.vue_vue_type_script_setup_true_lang-BGLSRcrK.js +++ /dev/null @@ -1 +0,0 @@ -import{a as O,_ as E}from"./DeleteCardDialog.vue_vue_type_script_setup_true_lang-BuRPZrcj.js";import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-BQHOFrhO.js";import{d as U,$ as q,a0 as F,f as x,e as $,c as l,o as n,c6 as b,b as m,u as o,ad as k,a as e,W as v,cg as u,Y as i,X as L,c7 as D}from"./index-CNH1g_GM.js";import"./three-vrm-animation.module-B_hGdUpX.js";import"./mcp-B7-jaCfZ.js";import{u as R}from"./airi-card-JBK1Hzhm.js";import"./Select.vue_vue_type_style_index_0_lang-BIffysKh.js";import"./emotions-DWNSb738.js";import{n as W,I as X,$ as Y,P as G,B as J}from"./index-5YeHuuyL.js";const K={key:0,class:"w-full flex flex-col gap-5"},Q={flex:"~ col","gap-3":""},Z={flex:"~ row","items-center":"","justify-between":""},ee={flex:"~ row","items-center":"","gap-2":""},te={key:0,class:"flex items-center gap-1 rounded-full bg-primary-100 px-2 py-0.5 text-xs text-primary-600 font-medium dark:bg-primary-900/40 dark:text-primary-400"},ae={"mt-1":"","text-sm":"","text-neutral-500":"","dark:text-neutral-400":""},re={"font-medium":""},se={flex:"~ row","gap-2":""},oe={class:"mt-4"},le={class:"border-b border-neutral-200 dark:border-neutral-700"},ne={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":""},fe={"text-lg":"","text-neutral-500":"","font-medium":"","dark:text-neutral-400":""},be=["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":""},$e={truncate:"","font-medium":""},Le={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"},Oe=U({__name:"CardDetailDialog",props:{modelValue:{type:Boolean},cardId:null},emits:["update:modelValue"],setup(B,{emit:A}){const f=B,M=A,{t:d}=q(),w=R(),{removeCard:N}=w,{activeCardId:S}=F(w),a=x(()=>{if(f.cardId)return w.getCard(f.cardId)}),y=x(()=>{var t,c,r,g,j;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:((j=s.speech)==null?void 0:j.voice_id)||""}}),C=x(()=>a.value?{personality:a.value.personality,scenario:a.value.scenario,systemPrompt:a.value.systemPrompt,postHistoryInstructions:a.value.postHistoryInstructions}:{}),h=x(()=>f.cardId===S.value),I=$(!1);function P(){I.value=!0,setTimeout(()=>{S.value=f.cardId,I.value=!1},300)}function T(s){return s==null?void 0:s.replace(/\{\{(.*?)\}\}/g,'{{ $1 }}').trim()}const _=$(!1);function z(){a.value&&(N(f.cardId),M("update:modelValue",!1)),_.value=!1}const V=$(""),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 n(),l(b,null,[m(o(W),{open:B.modelValue,"onUpdate:open":t[0]||(t[0]=r=>M("update:modelValue",r))},{default:k(()=>[m(o(X),null,{default:k(()=>[m(o(Y),{class:"data-[state=open]:animate-fadeIn data-[state=closed]:animate-fadeOut fixed inset-0 z-100 bg-black/50 backdrop-blur-sm"}),m(o(G),{class:"data-[state=open]:animate-contentShow data-[state=closed]:animate-contentHide fixed left-1/2 top-1/2 z-100 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?(n(),l("div",K,[e("div",Q,[e("div",Z,[e("div",null,[e("div",ee,[m(o(J),{"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?(n(),l("div",te,[t[3]||(t[3]=e("div",{"i-solar:check-circle-bold-duotone":"","text-xs":""},null,-1)),u(" "+i(o(d)("settings.pages.card.active_badge")),1)])):v("",!0)]),e("div",ae,[u(" v"+i(a.value.version)+" ",1),a.value.creator?(n(),l(b,{key:0},[u(" · "+i(o(d)("settings.pages.card.created_by"))+" ",1),e("span",re,i(a.value.creator),1)],64)):v("",!0)])]),e("div",se,[m(o(O),{variant:"primary",icon:h.value?"i-solar:check-circle-bold-duotone":"i-solar:play-circle-broken",label:h.value?o(d)("settings.pages.card.active"):o(d)("settings.pages.card.activate"),disabled:h.value,class:L({"animate-pulse":I.value}),onClick:P},null,8,["icon","label","disabled","class"])])]),e("div",oe,[e("div",le,[e("div",ne,[(n(!0),l(b,null,D(H.value,r=>(n(),l("button",{key:r.id,class:L(["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:L(r.icon)},null,2),u(" "+i(r.label),1)])],10,ie))),128))])])]),p.value==="notes"&&a.value.notes?(n(),l("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?(n(),l("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)?(n(),l("div",pe,[e("div",ge,[(n(!0),l(b,null,D(C.value,(r,g)=>(n(),l(b,{key:g},[r?(n(),l("div",xe,[e("h2",fe,i(o(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,be)])):v("",!0)],64))),128))])])):v("",!0),p.value==="modules"?(n(),l("div",he,[e("div",_e,[e("div",ke,[e("span",we,[t[4]||(t[4]=e("div",{"i-lucide:ghost":""},null,-1)),u(" "+i(o(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(o(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(o(d)("settings.pages.card.speech.voice")),1)]),e("div",$e,i(y.value.voice??"default"),1)])])])):v("",!0)])])):(n(),l("div",Le,[t[7]||(t[7]=e("div",{"i-solar:card-search-broken":"","mx-auto":"","mb-3":"","text-6xl":"","text-neutral-400":""},null,-1)),u(" "+i(o(d)("settings.pages.card.card_not_found")),1)]))]),_:1})]),_:1})]),_:1},8,["open"]),m(E,{modelValue:_.value,"onUpdate:modelValue":t[1]||(t[1]=r=>_.value=r),"card-name":(c=a.value)==null?void 0:c.name,onConfirm:z,onCancel:t[2]||(t[2]=r=>_.value=!1)},null,8,["modelValue","card-name"])],64)}}});export{Oe as _}; diff --git a/assets/CardDetailDialog.vue_vue_type_script_setup_true_lang-BW7EWJLR.js b/assets/CardDetailDialog.vue_vue_type_script_setup_true_lang-BW7EWJLR.js new file mode 100644 index 0000000000000000000000000000000000000000..38d94cd86fcf5b890be4e004c57ead0ea48dece5 --- /dev/null +++ b/assets/CardDetailDialog.vue_vue_type_script_setup_true_lang-BW7EWJLR.js @@ -0,0 +1 @@ +import{a as O,_ as E}from"./DeleteCardDialog.vue_vue_type_script_setup_true_lang-D73P_gUt.js";import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-Du5e5QRV.js";import{d as U,$ as q,a0 as F,f as x,e as $,c as l,o as n,c6 as f,b as m,u as o,bl as k,a as e,W as v,cg as u,Y as i,X as L,c7 as D}from"./index-B06xwjXa.js";import"./three-vrm.module-CtuEk7GG.js";import"./emotions-DWNSb738.js";import"./mcp-BfXpaYZf.js";import{u as R}from"./airi-card-BqOg7f9m.js";import"./Select.vue_vue_type_style_index_0_lang-CzS20kE7.js";import{n as W,I as X,$ as Y,P as G,B as J}from"./index-BVgMpW27.js";const K={key:0,class:"w-full flex flex-col gap-5"},Q={flex:"~ col","gap-3":""},Z={flex:"~ row","items-center":"","justify-between":""},ee={flex:"~ row","items-center":"","gap-2":""},te={key:0,class:"flex items-center gap-1 rounded-full bg-primary-100 px-2 py-0.5 text-xs text-primary-600 font-medium dark:bg-primary-900/40 dark:text-primary-400"},ae={"mt-1":"","text-sm":"","text-neutral-500":"","dark:text-neutral-400":""},re={"font-medium":""},se={flex:"~ row","gap-2":""},oe={class:"mt-4"},le={class:"border-b border-neutral-200 dark:border-neutral-700"},ne={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":""},$e={truncate:"","font-medium":""},Le={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"},Oe=U({__name:"CardDetailDialog",props:{modelValue:{type:Boolean},cardId:null},emits:["update:modelValue"],setup(B,{emit:A}){const b=B,M=A,{t:d}=q(),w=R(),{removeCard:N}=w,{activeCardId:S}=F(w),a=x(()=>{if(b.cardId)return w.getCard(b.cardId)}),y=x(()=>{var t,c,r,g,j;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:((j=s.speech)==null?void 0:j.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===S.value),I=$(!1);function P(){I.value=!0,setTimeout(()=>{S.value=b.cardId,I.value=!1},300)}function T(s){return s==null?void 0:s.replace(/\{\{(.*?)\}\}/g,'{{ $1 }}').trim()}const _=$(!1);function z(){a.value&&(N(b.cardId),M("update:modelValue",!1)),_.value=!1}const V=$(""),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 n(),l(f,null,[m(o(W),{open:B.modelValue,"onUpdate:open":t[0]||(t[0]=r=>M("update:modelValue",r))},{default:k(()=>[m(o(X),null,{default:k(()=>[m(o(Y),{class:"data-[state=open]:animate-fadeIn data-[state=closed]:animate-fadeOut fixed inset-0 z-100 bg-black/50 backdrop-blur-sm"}),m(o(G),{class:"data-[state=open]:animate-contentShow data-[state=closed]:animate-contentHide fixed left-1/2 top-1/2 z-100 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?(n(),l("div",K,[e("div",Q,[e("div",Z,[e("div",null,[e("div",ee,[m(o(J),{"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?(n(),l("div",te,[t[3]||(t[3]=e("div",{"i-solar:check-circle-bold-duotone":"","text-xs":""},null,-1)),u(" "+i(o(d)("settings.pages.card.active_badge")),1)])):v("",!0)]),e("div",ae,[u(" v"+i(a.value.version)+" ",1),a.value.creator?(n(),l(f,{key:0},[u(" · "+i(o(d)("settings.pages.card.created_by"))+" ",1),e("span",re,i(a.value.creator),1)],64)):v("",!0)])]),e("div",se,[m(o(O),{variant:"primary",icon:h.value?"i-solar:check-circle-bold-duotone":"i-solar:play-circle-broken",label:h.value?o(d)("settings.pages.card.active"):o(d)("settings.pages.card.activate"),disabled:h.value,class:L({"animate-pulse":I.value}),onClick:P},null,8,["icon","label","disabled","class"])])]),e("div",oe,[e("div",le,[e("div",ne,[(n(!0),l(f,null,D(H.value,r=>(n(),l("button",{key:r.id,class:L(["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:L(r.icon)},null,2),u(" "+i(r.label),1)])],10,ie))),128))])])]),p.value==="notes"&&a.value.notes?(n(),l("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?(n(),l("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)?(n(),l("div",pe,[e("div",ge,[(n(!0),l(f,null,D(C.value,(r,g)=>(n(),l(f,{key:g},[r?(n(),l("div",xe,[e("h2",be,i(o(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"?(n(),l("div",he,[e("div",_e,[e("div",ke,[e("span",we,[t[4]||(t[4]=e("div",{"i-lucide:ghost":""},null,-1)),u(" "+i(o(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(o(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(o(d)("settings.pages.card.speech.voice")),1)]),e("div",$e,i(y.value.voice??"default"),1)])])])):v("",!0)])])):(n(),l("div",Le,[t[7]||(t[7]=e("div",{"i-solar:card-search-broken":"","mx-auto":"","mb-3":"","text-6xl":"","text-neutral-400":""},null,-1)),u(" "+i(o(d)("settings.pages.card.card_not_found")),1)]))]),_:1})]),_:1})]),_:1},8,["open"]),m(E,{modelValue:_.value,"onUpdate:modelValue":t[1]||(t[1]=r=>_.value=r),"card-name":(c=a.value)==null?void 0:c.name,onConfirm:z,onCancel:t[2]||(t[2]=r=>_.value=!1)},null,8,["modelValue","card-name"])],64)}}});export{Oe as _}; diff --git a/assets/CardListItem-Bcn9cwvb.js b/assets/CardListItem-Bcn9cwvb.js new file mode 100644 index 0000000000000000000000000000000000000000..bbb87d3f0845fdf2a13b89ed3436c06a1eb15307 --- /dev/null +++ b/assets/CardListItem-Bcn9cwvb.js @@ -0,0 +1 @@ +import{_ as o}from"./CardListItem.vue_vue_type_script_setup_true_lang-DIzqmniR.js";import"./index-B06xwjXa.js";import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-Du5e5QRV.js";import"./three-vrm.module-CtuEk7GG.js";import"./emotions-DWNSb738.js";import"./mcp-BfXpaYZf.js";import"./Select.vue_vue_type_style_index_0_lang-CzS20kE7.js";import"./floating-ui.core-CgBsuaUc.js";export{o as default}; diff --git a/assets/CardListItem-PljhH-7U.js b/assets/CardListItem-PljhH-7U.js deleted file mode 100644 index 8b77792704900ce41b081c0e6a4b91d00074cb4c..0000000000000000000000000000000000000000 --- a/assets/CardListItem-PljhH-7U.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as o}from"./CardListItem.vue_vue_type_script_setup_true_lang-DAe8PabE.js";import"./index-CNH1g_GM.js";import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-BQHOFrhO.js";import"./three-vrm-animation.module-B_hGdUpX.js";import"./mcp-B7-jaCfZ.js";import"./emotions-DWNSb738.js";import"./Select.vue_vue_type_style_index_0_lang-BIffysKh.js";import"./floating-ui.core-CgBsuaUc.js";export{o as default}; diff --git a/assets/CardListItem.vue_vue_type_script_setup_true_lang-DAe8PabE.js b/assets/CardListItem.vue_vue_type_script_setup_true_lang-DAe8PabE.js deleted file mode 100644 index b1274c6839358c9473b5be1e8bd36a5fe9e021ef..0000000000000000000000000000000000000000 --- a/assets/CardListItem.vue_vue_type_script_setup_true_lang-DAe8PabE.js +++ /dev/null @@ -1 +0,0 @@ -import{d as M,e as s,T as R,c as p,o as d,a9 as W,a3 as F,bZ as H,ac as I,ad as N,a as t,W as v,Y as l,cj as k,X as h,u as V}from"./index-CNH1g_GM.js";import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-BQHOFrhO.js";import"./three-vrm-animation.module-B_hGdUpX.js";import"./mcp-B7-jaCfZ.js";import"./emotions-DWNSb738.js";import"./Select.vue_vue_type_style_index_0_lang-BIffysKh.js";const D=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 $(c){if(!o.value)return;const u=o.value,x=u.getBoundingClientRect(),_=c.clientX-x.left,C=c.clientY-x.top,z=u.offsetWidth,B=u.offsetHeight,f=Math.abs(Math.floor(100/z*_)-100),m=Math.abs(Math.floor(100/B*C)-100),g=50+(f-50)/1.5,b=50+(m-50)/1.5,X=50+(f-50)/7,Y=50+(m-50)/7,P=(g-50)/1.5*.2*n.intensity,S=(b-50)/2*-1*.2*n.intensity,j=50-f+(50-m),A=.5+Math.abs(j)*.008*n.intensity;a.value=`perspective(1200px) rotateX(${S}deg) rotateY(${P}deg) scale3d(${1+.015*n.intensity}, ${1+.015*n.intensity}, ${1+.015*n.intensity})`,e.value=`${g}% ${b}%`,i.value=`${X}% ${Y}%`,y.value=A}function w(){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:$,onMouseleave:w},[W(c.$slots,"default",{},void 0,!0)],36))}}),E=H(D,[["__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":""},T={"flex-1":"",truncate:"","text-lg":"","font-thin":""},Z={key:0,"shrink-0":"","rounded-md":"","p-1":"",bg:"primary-100 dark:primary-900/40",text:"primary-600 dark:primary-400"},q={key:0,"line-clamp-3":"","min-h-40px":"","flex-1":"","text-sm":"",text:"neutral-500 dark:neutral-400"},G={"z-1":"",flex:"","items-center":"","justify-between":"","text-xs":"",text:"neutral-500 dark:neutral-400"},J={flex:"","items-center":"","gap-1.5":""},K={flex:"","items-center":"","gap-0.5":""},Q={flex:"","items-center":"","gap-0.5":""},U={flex:"","items-center":"","justify-end":"","px-2":"","py-1.5":""},ee=["disabled"],se=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: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",T,l(r.name),1),r.isActive?(d(),p("div",Z,e[3]||(e[3]=[t("div",{"i-solar:check-circle-bold-duotone":"","text-sm":""},null,-1)]))):v("",!0)]),r.description?(d(),p("p",q,l(r.description),1)):v("",!0),t("div",G,[t("div",null,"v"+l(r.version),1),t("div",J,[t("div",K,[e[4]||(e[4]=t("div",{"i-lucide:ghost":"","text-xs":""},null,-1)),t("span",null,l(r.consciousnessModel),1)]),t("div",Q,[e[5]||(e[5]=t("div",{"i-lucide:mic":"","text-xs":""},null,-1)),t("span",null,l(r.voiceModel),1)])])])]),t("div",U,[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{se as _}; diff --git a/assets/CardListItem.vue_vue_type_script_setup_true_lang-DIzqmniR.js b/assets/CardListItem.vue_vue_type_script_setup_true_lang-DIzqmniR.js new file mode 100644 index 0000000000000000000000000000000000000000..bad6ab6334d354bc43c3933f0a6151ac64e898a4 --- /dev/null +++ b/assets/CardListItem.vue_vue_type_script_setup_true_lang-DIzqmniR.js @@ -0,0 +1 @@ +import{d as M,e as s,T as R,c as p,o as d,bh as W,a3 as F,c2 as H,bk as I,bl as N,a as t,W as v,Y as l,cj as k,X as h,u as V}from"./index-B06xwjXa.js";import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-Du5e5QRV.js";import"./three-vrm.module-CtuEk7GG.js";import"./emotions-DWNSb738.js";import"./mcp-BfXpaYZf.js";import"./Select.vue_vue_type_style_index_0_lang-CzS20kE7.js";const D=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 $(c){if(!o.value)return;const u=o.value,b=u.getBoundingClientRect(),_=c.clientX-b.left,C=c.clientY-b.top,z=u.offsetWidth,B=u.offsetHeight,f=Math.abs(Math.floor(100/z*_)-100),m=Math.abs(Math.floor(100/B*C)-100),x=50+(f-50)/1.5,g=50+(m-50)/1.5,X=50+(f-50)/7,Y=50+(m-50)/7,P=(x-50)/1.5*.2*n.intensity,S=(g-50)/2*-1*.2*n.intensity,j=50-f+(50-m),A=.5+Math.abs(j)*.008*n.intensity;a.value=`perspective(1200px) rotateX(${S}deg) rotateY(${P}deg) scale3d(${1+.015*n.intensity}, ${1+.015*n.intensity}, ${1+.015*n.intensity})`,e.value=`${x}% ${g}%`,i.value=`${X}% ${Y}%`,y.value=A}function w(){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:$,onMouseleave:w},[W(c.$slots,"default",{},void 0,!0)],36))}}),E=H(D,[["__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":""},T={"flex-1":"",truncate:"","text-lg":"","font-thin":""},q={key:0,"shrink-0":"","rounded-md":"","p-1":"",bg:"primary-100 dark:primary-900/40",text:"primary-600 dark:primary-400"},G={key:0,"line-clamp-3":"","min-h-40px":"","flex-1":"","text-sm":"",text:"neutral-500 dark:neutral-400"},J={"z-1":"",flex:"","items-center":"","justify-between":"","text-xs":"",text:"neutral-500 dark:neutral-400"},K={flex:"","items-center":"","gap-1.5":""},Q={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"],se=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: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",T,l(r.name),1),r.isActive?(d(),p("div",q,e[3]||(e[3]=[t("div",{"i-solar:check-circle-bold-duotone":"","text-sm":""},null,-1)]))):v("",!0)]),r.description?(d(),p("p",G,l(r.description),1)):v("",!0),t("div",J,[t("div",null,"v"+l(r.version),1),t("div",K,[t("div",Q,[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{se as _}; diff --git a/assets/Collapsable.vue_vue_type_script_setup_true_lang-dwKULsMl.js b/assets/Collapsable.vue_vue_type_script_setup_true_lang-BxFBRVXD.js similarity index 54% rename from assets/Collapsable.vue_vue_type_script_setup_true_lang-dwKULsMl.js rename to assets/Collapsable.vue_vue_type_script_setup_true_lang-BxFBRVXD.js index 474d69af4da936bb2944393fa463bbd358a741cc..6c56e517ce73cb4c686bf89ceb11cbfb01e86a79 100644 --- a/assets/Collapsable.vue_vue_type_script_setup_true_lang-dwKULsMl.js +++ b/assets/Collapsable.vue_vue_type_script_setup_true_lang-BxFBRVXD.js @@ -1 +1 @@ -import{_ as d}from"./TransitionVertical.vue_vue_type_script_setup_true_lang-DLt6RcnD.js";import"./Select.vue_vue_type_style_index_0_lang-BIffysKh.js";import{d as p,ce as m,cf as c,aR as f,c as b,o as v,a9 as r,b as V,a as s,cg as g,Y as u,ct as i,cu as y,u as k,ad as x,W as C,ch as B}from"./index-CNH1g_GM.js";const _={op50:""},P=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=c(o,"modelValue");f(()=>{t.default!=null&&(e.value=!!t.default)});function n(a){return e.value=a,a}return(a,l)=>(v(),b("div",null,[r(a.$slots,"trigger",i(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:l[0]||(l[0]=N=>e.value=!e.value)},[s("span",null,u(t.label??"Collapsable"),1),l[1]||(l[1]=g()),s("span",_,u(e.value?"▲":"▼"),1)])]),V(k(d),null,{default:x(()=>[e.value?r(a.$slots,"default",i(B({key:0},{visible:e.value,setVisible:n}))):C("",!0)]),_:3})]))}});export{P as _}; +import{_ as d}from"./TransitionVertical.vue_vue_type_script_setup_true_lang-CyZTJR0c.js";import"./Select.vue_vue_type_style_index_0_lang-CzS20kE7.js";import{d as p,ce as m,cf as c,bK as f,c as b,o as v,bh as r,b as V,a as s,cg as g,Y as u,ct as i,cu as y,u as k,bl as x,W as C,ch as B}from"./index-B06xwjXa.js";const _={op50:""},P=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=c(o,"modelValue");f(()=>{t.default!=null&&(e.value=!!t.default)});function n(l){return e.value=l,l}return(l,a)=>(v(),b("div",null,[r(l.$slots,"trigger",i(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]=N=>e.value=!e.value)},[s("span",null,u(t.label??"Collapsable"),1),a[1]||(a[1]=g()),s("span",_,u(e.value?"▲":"▼"),1)])]),V(k(d),null,{default:x(()=>[e.value?r(l.$slots,"default",i(B({key:0},{visible:e.value,setVisible:n}))):C("",!0)]),_:3})]))}});export{P as _}; diff --git a/assets/ColorPalette.vue_vue_type_script_setup_true_lang-V-fFti_u.js b/assets/ColorPalette.vue_vue_type_script_setup_true_lang-V-fFti_u.js new file mode 100644 index 0000000000000000000000000000000000000000..0f24ff9053d22c6dbac3b9a69a1eee452688aa97 --- /dev/null +++ b/assets/ColorPalette.vue_vue_type_script_setup_true_lang-V-fFti_u.js @@ -0,0 +1 @@ +import{_ as b}from"./Collapsable.vue_vue_type_script_setup_true_lang-BxFBRVXD.js";import{d,bk as m,o as i,bl as l,a as n,X as u,bh as k,cg as f,Y as g,bj as y,c,W as C,c6 as h,c7 as v,b as s,u as e,a3 as x,cr as w}from"./index-B06xwjXa.js";import"./three-vrm.module-CtuEk7GG.js";import"./emotions-DWNSb738.js";import"./mcp-BfXpaYZf.js";import{W as S,j as $,q as B,U as E,G as V,H as j}from"./index-BVgMpW27.js";const z=["onClick"],F={flex:"","gap-1.5":""},G=d({__name:"Section",props:{title:null,icon:null,innerClass:null,expand:{type:Boolean,default:!0}},setup(t){return(r,p)=>(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",F,[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,z)]),default:l(()=>[n("div",{grid:"","gap-4":"","p-4":"",class:u(t.innerClass)},[k(r.$slots,"default")],2)]),_:3},8,["default"]))}}),H={key:0,flex:"","gap-2":""},O=d({__name:"ColorPalette",props:{colors:null},setup(t){const r=y();return(p,o)=>t.colors.length?(i(),c("div",H,[(i(!0),c(h,null,v(t.colors,({hex:a,name:_})=>(i(),m(e(j),{key:a||"default"},{default:l(()=>[s(e(S),null,{default:l(()=>[s(e($),{transition:"all ease-in-out duration-250","size-6":"","cursor-pointer":"","rounded-full":"","bg-primary-500":"",style:x(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(B),null,{default:l(()=>[s(e(E),{bg:"white dark:neutral-800","rounded-lg":"","px-3":"","py-1.5":"","text-sm":"","shadow-md":""},{default:l(()=>[f(g(_)+" ",1),s(e(V),{"fill-white":"","dark:fill-neutral-800":""})]),_:2},1024)]),_:2},1024)]),_:2},1024)]),_:2},1024))),128))])):C("",!0)}});export{G as _,O as a}; diff --git a/assets/ColorPalette.vue_vue_type_script_setup_true_lang-YJhFyDzq.js b/assets/ColorPalette.vue_vue_type_script_setup_true_lang-YJhFyDzq.js deleted file mode 100644 index c4e0066c6072b46fa6976485e5c6431178027bb3..0000000000000000000000000000000000000000 --- a/assets/ColorPalette.vue_vue_type_script_setup_true_lang-YJhFyDzq.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as b}from"./Collapsable.vue_vue_type_script_setup_true_lang-dwKULsMl.js";import{d,ac as m,o as i,ad as l,a as n,X as u,a9 as k,cg as f,Y as g,ab as y,c,W as C,c6 as v,c7 as h,b as s,u as e,a3 as x,cr as w}from"./index-CNH1g_GM.js";import"./mcp-B7-jaCfZ.js";import"./emotions-DWNSb738.js";import{W as S,j as $,q as B,U as E,G as V,H as z}from"./index-5YeHuuyL.js";const F=["onClick"],H={flex:"","gap-1.5":""},D=d({__name:"Section",props:{title:null,icon:null,innerClass:null,expand:{type:Boolean,default:!0}},setup(a){return(r,_)=>(i(),m(b,{default:a.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:t=>o.setVisible(!o.visible)},[n("div",H,[n("div",{class:u(a.icon),"size-6":""},null,2),f(" "+g(a.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(a.innerClass)},[k(r.$slots,"default")],2)]),_:3},8,["default"]))}}),N={key:0,flex:"","gap-2":""},G=d({__name:"ColorPalette",props:{colors:null},setup(a){const r=y();return(_,o)=>a.colors.length?(i(),c("div",N,[(i(!0),c(v,null,h(a.colors,({hex:t,name:p})=>(i(),m(e(z),{key:t||"default"},{default:l(()=>[s(e(S),null,{default:l(()=>[s(e($),{transition:"all ease-in-out duration-250","size-6":"","cursor-pointer":"","rounded-full":"","bg-primary-500":"",style:x(t?{background:t}:{"--theme-colors-hue":e(w)}),class:u(e(r).isColorSelectedForPrimary(t)?"scale-150 mx-1":"hover:scale-110"),onClick:U=>e(r).applyPrimaryColorFrom(t)},null,8,["style","class","onClick"]),s(e(B),null,{default:l(()=>[s(e(E),{bg:"white dark:neutral-800","rounded-lg":"","px-3":"","py-1.5":"","text-sm":"","shadow-md":""},{default:l(()=>[f(g(p)+" ",1),s(e(V),{"fill-white":"","dark:fill-neutral-800":""})]),_:2},1024)]),_:2},1024)]),_:2},1024)]),_:2},1024))),128))])):C("",!0)}});export{D as _,G as a}; diff --git a/assets/DeleteCardDialog-BdJxoLU9.js b/assets/DeleteCardDialog-BdJxoLU9.js deleted file mode 100644 index 6a9664c99d7c58b94a935d839a48ce9d1e1cde8c..0000000000000000000000000000000000000000 --- a/assets/DeleteCardDialog-BdJxoLU9.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as o}from"./DeleteCardDialog.vue_vue_type_script_setup_true_lang-BuRPZrcj.js";import"./index-CNH1g_GM.js";import"./index-5YeHuuyL.js";import"./floating-ui.core-CgBsuaUc.js";export{o as default}; diff --git a/assets/DeleteCardDialog-DLYqCKGU.js b/assets/DeleteCardDialog-DLYqCKGU.js new file mode 100644 index 0000000000000000000000000000000000000000..98aa3aed72374ef2d00be2ef79eb8a5f18c9f767 --- /dev/null +++ b/assets/DeleteCardDialog-DLYqCKGU.js @@ -0,0 +1 @@ +import{_ as o}from"./DeleteCardDialog.vue_vue_type_script_setup_true_lang-D73P_gUt.js";import"./index-B06xwjXa.js";import"./index-BVgMpW27.js";import"./floating-ui.core-CgBsuaUc.js";export{o as default}; diff --git a/assets/DeleteCardDialog.vue_vue_type_script_setup_true_lang-BuRPZrcj.js b/assets/DeleteCardDialog.vue_vue_type_script_setup_true_lang-D73P_gUt.js similarity index 83% rename from assets/DeleteCardDialog.vue_vue_type_script_setup_true_lang-BuRPZrcj.js rename to assets/DeleteCardDialog.vue_vue_type_script_setup_true_lang-D73P_gUt.js index 5d73fb2b0da099be41e3e9e51bfa4e987c970f0e..ce30d358efe1d34a6e66b27212825bc7dc3b1841 100644 --- a/assets/DeleteCardDialog.vue_vue_type_script_setup_true_lang-BuRPZrcj.js +++ b/assets/DeleteCardDialog.vue_vue_type_script_setup_true_lang-D73P_gUt.js @@ -1 +1 @@ -import{d as v,f as p,c as r,o as d,X as g,a as m,W as h,a9 as _,Y as i,$ as w,ac as C,ad as n,b as t,u as e,cg as x}from"./index-CNH1g_GM.js";import{A as V,k as B,O as N,V as z,F as D,M as $,N as O,T as S}from"./index-5YeHuuyL.js";const T=["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,T))}}),I={class:"flex flex-row justify-end gap-3"},H=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(S),{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-100 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-100 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($),{"as-child":""},{default:n(()=>[t(e(y),{variant:"secondary",label:e(o)("settings.pages.card.cancel"),onClick:c},null,8,["label"])]),_:1}),t(e(O),{"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{H as _,y as a}; +import{d as k,f as p,c as r,o as d,X as g,a as m,W as h,bh as _,Y as i,$ as w,bk as C,bl as n,b as t,u as e,cg as x}from"./index-B06xwjXa.js";import{A as V,k as B,O as N,V as z,F as D,M as $,N as O,T as S}from"./index-BVgMpW27.js";const T=["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=k({__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,T))}}),I={class:"flex flex-row justify-end gap-3"},H=k({__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(S),{open:a.modelValue,"onUpdate:open":f[0]||(f[0]=v=>l("update:modelValue",v))},{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-100 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-100 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($),{"as-child":""},{default:n(()=>[t(e(y),{variant:"secondary",label:e(o)("settings.pages.card.cancel"),onClick:c},null,8,["label"])]),_:1}),t(e(O),{"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{H as _,y as a}; diff --git a/assets/FieldInput.vue_vue_type_script_setup_true_lang-tEOSPb7v.js b/assets/FieldInput.vue_vue_type_script_setup_true_lang-DM6oOIgU.js similarity index 87% rename from assets/FieldInput.vue_vue_type_script_setup_true_lang-tEOSPb7v.js rename to assets/FieldInput.vue_vue_type_script_setup_true_lang-DM6oOIgU.js index e8916098109686d73b851384a664fb785dd98b64..3b63f069e8c2a7b880bfb21be33862ea25386600 100644 --- a/assets/FieldInput.vue_vue_type_script_setup_true_lang-tEOSPb7v.js +++ b/assets/FieldInput.vue_vue_type_script_setup_true_lang-DM6oOIgU.js @@ -1 +1 @@ -import{_ as c}from"./Input.vue_vue_type_script_setup_true_lang-CvnY3pbX.js";import{d as u,ce as i,cf as p,c as o,o as d,a as l,b as m,cg as _,W as x,Y as n,X as f}from"./index-CNH1g_GM.js";const V={"max-w-full":""},h={flex:"~ col gap-4"},y={class:"flex items-center gap-1 text-sm font-medium"},v={key:0,class:"text-red-500"},g={class:"text-xs text-neutral-500 dark:text-neutral-400","text-nowrap":""},B=u({__name:"FieldInput",props:i({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",y,[_(n(e.label)+" ",1),e.required!==!1?(d(),o("span",v,"*")):x("",!0)]),l("div",g,n(e.description),1)]),m(c,{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 c}from"./Input.vue_vue_type_script_setup_true_lang-CqiG06sL.js";import{d as u,ce as i,cf as p,c as o,o as d,a as l,b as m,cg as _,W as x,Y as n,X as f}from"./index-B06xwjXa.js";const V={"max-w-full":""},h={flex:"~ col gap-4"},y={class:"flex items-center gap-1 text-sm font-medium"},v={key:0,class:"text-red-500"},g={class:"text-xs text-neutral-500 dark:text-neutral-400","text-nowrap":""},B=u({__name:"FieldInput",props:i({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",y,[_(n(e.label)+" ",1),e.required!==!1?(d(),o("span",v,"*")):x("",!0)]),l("div",g,n(e.description),1)]),m(c,{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-Dou4SIkT.js b/assets/FieldRange.vue_vue_type_script_setup_true_lang-4kHfmFIm.js similarity index 90% rename from assets/FieldRange.vue_vue_type_script_setup_true_lang-Dou4SIkT.js rename to assets/FieldRange.vue_vue_type_script_setup_true_lang-4kHfmFIm.js index 6601a0b60dfc8e0da69280eda6ebf3a226720ca3..9009ee7acab06f74fffcc9d8473fbc4d4623d054 100644 --- a/assets/FieldRange.vue_vue_type_script_setup_true_lang-Dou4SIkT.js +++ b/assets/FieldRange.vue_vue_type_script_setup_true_lang-4kHfmFIm.js @@ -1 +1 @@ -import{d as m,c as g,o as c,a3 as M,a9 as k,bZ as B,e as V,c1 as E,T as P,U as O,a as f,ac as b,ad as _,b as $,c6 as R,cD as D,ch as w,cE as N,cA as S,u as d,cz as z,cM as L,f as v,d0 as j,cw as U,d1 as H,w as K,c7 as Y,ai as W,d2 as G,W as X,cY as Z,cj as J,cf as C,ce as A,Y as x,ae as Q,cc as ee}from"./index-CNH1g_GM.js";import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-BQHOFrhO.js";import"./Select.vue_vue_type_style_index_0_lang-BIffysKh.js";const te=m({__name:"Volumed",props:{perspective:null,transform:null},setup(t){return(e,n)=>(c(),g("div",{class:"volumed",style:M({perspective:`${t.perspective}px`,transform:t.transform})},[k(e.$slots,"default",{},void 0,!0)],4))}}),ae=B(te,[["__scopeId","data-v-568551bc"]]),ne=m({__name:"CursorMomentum",props:{baseSpeed:{default:.1},friction:{default:.95},momentumFactor:{default:.005}},setup(t,{expose:e}){const n=t,o=V(1),l=V(0);let r=0;const a=E(()=>n.friction),u=E(()=>n.baseSpeed),p=E(()=>n.momentumFactor);function h(s){r||(r=s);const y=s-r;r=s,o.value=u.value+(o.value-u.value)*a.value,l.value+=o.value*y,requestAnimationFrame(h)}function i(s){const y=Math.sqrt(s.movementX**2+s.movementY**2);o.value+=y*p.value}return P(()=>{window.addEventListener("mousemove",i),requestAnimationFrame(h)}),O(()=>{window.removeEventListener("mousemove",i)}),e({momentum:o,currentValue:l}),(s,y)=>k(s.$slots,"default",{momentum:o.value,currentValue:l.value})}}),le=m({__name:"TestDummyMarkerFlat",props:{size:null},setup(t){return(e,n)=>(c(),g("div",{class:"test-dummy-flat",style:M({width:`${t.size}px`,height:`${t.size}px`})},n[0]||(n[0]=[f("div",{class:"marker"},null,-1)]),4))}}),oe=B(le,[["__scopeId","data-v-b4ef37ac"]]),Re=m({__name:"TestDummyMarker",setup(t){return(e,n)=>(c(),b(ne,{"base-speed":.1,friction:.95,"momentum-factor":5e-4},{default:_(({currentValue:o})=>[$(ae,{perspective:800,transform:"rotateX(45deg) translateY(3px)"},{default:_(()=>[$(oe,{size:24,style:M({transform:`rotate(${o}deg)`})},null,8,["style"])]),_:2},1024)]),_:1}))}});function T(t){return t?t.flatMap(e=>e.type===R?T(e.children):[e]):[]}const re=m({name:"PrimitiveSlot",inheritAttrs:!1,setup(t,{attrs:e,slots:n}){return()=>{var p,h;if(!n.default)return null;const o=T(n.default()),l=o.findIndex(i=>i.type!==D);if(l===-1)return o;const r=o[l];(p=r.props)==null||delete p.ref;const a=r.props?w(e,r.props):e;e.class&&((h=r.props)!=null&&h.class)&&delete r.props.class;const u=N(r,a);for(const i in a)i.startsWith("on")&&(u.props||(u.props={}),u.props[i]=a[i]);return o.length===1?u:(o[l]=u,o)}}}),se=["area","img","input"],q=m({name:"Primitive",inheritAttrs:!1,props:{asChild:{type:Boolean,default:!1},as:{type:[String,Object],default:"div"}},setup(t,{attrs:e,slots:n}){const o=t.asChild?"template":t.as;return typeof o=="string"&&se.includes(o)?()=>S(o,e):o!=="template"?()=>S(t.as,e,{default:n.default}):()=>S(re,e,{default:n.default})}}),ue=m({__name:"VisuallyHidden",props:{feature:{default:"focusable"},asChild:{type:Boolean},as:{default:"span"}},setup(t){return(e,n)=>(c(),b(d(q),{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:_(()=>[k(e.$slots,"default")]),_:3},8,["as","as-child","aria-hidden","data-hidden","tabindex"]))}});function ie(t,e){const n=`${t}Context`,o=Symbol(n);return[a=>{const u=z(o,a);if(u||u===null)return u;throw new Error(`Injection \`${o.toString()}\` not found. Component must be used within ${Array.isArray(t)?`one of the following components: ${t.join(", ")}`:`\`${t}\``}`)},a=>(L(o,a),a)]}function I(){const t=U(),e=V(),n=v(()=>{var a,u;return["#text","#comment"].includes((a=e.value)==null?void 0:a.$el.nodeName)?(u=e.value)==null?void 0:u.$el.nextElementSibling:j(e)}),o=Object.assign({},t.exposed),l={};for(const a in t.props)Object.defineProperty(l,a,{enumerable:!0,configurable:!0,get:()=>t.props[a]});if(Object.keys(o).length>0)for(const a in o)Object.defineProperty(l,a,{enumerable:!0,configurable:!0,get:()=>o[a]});Object.defineProperty(l,"$el",{enumerable:!0,configurable:!0,get:()=>t.vnode.el}),t.exposed=l;function r(a){e.value=a,a&&(Object.defineProperty(l,"$el",{enumerable:!0,configurable:!0,get:()=>a instanceof Element?a:a.$el}),t.exposed=l)}return{forwardRef:r,currentRef:e,currentElement:n}}function de(){const t=V(),e=v(()=>{var n,o;return["#text","#comment"].includes((n=t.value)==null?void 0:n.$el.nodeName)?(o=t.value)==null?void 0:o.$el.nextElementSibling:j(t)});return{primitiveElement:t,currentElement:e}}function ce(t){return v(()=>{var e;return H(t)?!!((e=j(t))!=null&&e.closest("form")):!0})}const F=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:n,currentElement:o}=de(),l=v(()=>e.checked??e.value);return K(l,(r,a)=>{if(!o.value)return;const u=o.value,p=window.HTMLInputElement.prototype,i=Object.getOwnPropertyDescriptor(p,"value").set;if(i&&r!==a){const s=new Event("input",{bubbles:!0}),y=new Event("change",{bubbles:!0});i.call(u,r),u.dispatchEvent(s),u.dispatchEvent(y)}}),(r,a)=>(c(),b(ue,w({ref_key:"primitiveElement",ref:n},{...e,...r.$attrs},{as:"input"}),null,16))}}),me=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,n=v(()=>typeof e.value=="object"&&Array.isArray(e.value)&&e.value.length===0&&e.required),o=v(()=>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((l,r)=>typeof l=="object"?Object.entries(l).map(([a,u])=>({name:`[${e.name}][${r}][${a}]`,value:u})):{name:`[${e.name}][${r}]`,value:l}):e.value!==null&&typeof e.value=="object"&&!Array.isArray(e.value)?Object.entries(e.value).map(([l,r])=>({name:`[${e.name}][${l}]`,value:r})):[]);return(l,r)=>n.value?(c(),b(F,w({key:l.name},{...e,...l.$attrs},{name:l.name,value:l.value}),null,16,["name","value"])):(c(!0),g(R,{key:1},Y(o.value,a=>(c(),b(F,w({key:a.name,ref_for:!0},{...e,...l.$attrs},{name:a.name,value:a.value}),null,16,["name","value"]))),128))}}),[pe,fe]=ie("SwitchRoot"),ve=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 n=t,o=e,{disabled:l}=W(n),r=G(n,"modelValue",o,{defaultValue:n.defaultValue,passive:n.modelValue===void 0});function a(){l.value||(r.value=!r.value)}const{forwardRef:u,currentElement:p}=I(),h=ce(p),i=v(()=>{var s;return n.id&&p.value?(s=document.querySelector(`[for="${n.id}"]`))==null?void 0:s.innerText:void 0});return fe({modelValue:r,toggleCheck:a,disabled:l}),(s,y)=>(c(),b(d(q),w(s.$attrs,{id:s.id,ref:d(u),role:"switch",type:s.as==="button"?"button":void 0,value:s.value,"aria-label":s.$attrs["aria-label"]||i.value,"aria-checked":d(r),"aria-required":s.required,"data-state":d(r)?"checked":"unchecked","data-disabled":d(l)?"":void 0,"as-child":s.asChild,as:s.as,disabled:d(l),onClick:a,onKeydown:Z(J(a,["prevent"]),["enter"])}),{default:_(()=>[k(s.$slots,"default",{modelValue:d(r)}),d(h)&&s.name?(c(),b(d(me),{key:0,type:"checkbox",name:s.name,disabled:d(l),required:s.required,value:s.value,checked:!!d(r)},null,8,["name","disabled","required","value","checked"])):X("",!0)]),_:3},16,["id","type","value","aria-label","aria-checked","aria-required","data-state","data-disabled","as-child","as","disabled","onKeydown"]))}}),he=m({__name:"SwitchThumb",props:{asChild:{type:Boolean},as:{default:"span"}},setup(t){const e=pe();return I(),(n,o)=>{var l;return c(),b(d(q),{"data-state":(l=d(e).modelValue)!=null&&l.value?"checked":"unchecked","data-disabled":d(e).disabled.value?"":void 0,"as-child":n.asChild,as:n.as},{default:_(()=>[k(n.$slots,"default")]),_:3},8,["data-state","data-disabled","as-child","as"])}}}),ye=m({__name:"Checkbox",props:{modelValue:{type:Boolean,required:!0},modelModifiers:{}},emits:["update:modelValue"],setup(t){const e=C(t,"modelValue");return(n,o)=>(c(),b(d(ve),{modelValue:e.value,"onUpdate:modelValue":o[0]||(o[0]=l=>e.value=l),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:_(()=>[$(d(he),{"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"]))}}),be={flex:"~ col gap-4"},_e={flex:"~ row","items-center":"","gap-2":""},ge={flex:"1"},xe={class:"flex items-center gap-1 text-sm font-medium"},Ve={class:"text-xs text-neutral-500 dark:text-neutral-400"},Te=m({__name:"FieldCheckbox",props:A({label:null,description:null},{modelValue:{type:Boolean,required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=t,n=C(t,"modelValue");return(o,l)=>(c(),g("label",be,[f("div",_e,[f("div",ge,[f("div",xe,x(e.label),1),f("div",Ve,x(e.description),1)]),$(ye,{modelValue:n.value,"onUpdate:modelValue":l[0]||(l[0]=r=>n.value=r)},null,8,["modelValue"])])]))}}),$e=["min","max","step"],we=m({__name:"Range",props:A({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 e=t,n=C(t,"modelValue"),o=v(()=>e.min*1e4),l=v(()=>e.max*1e4),r=v(()=>e.step*1e4),a=V(),u=v({get:()=>n.value*1e4,set:i=>{n.value=i/1e4,p()}});P(()=>{p()});function p(){a.value&&(a.value.style.setProperty("--value",a.value.value),a.value.style.setProperty("--min",a.value.min?a.value.min:e.min.toString()),a.value.style.setProperty("--max",a.value.max?a.value.max:e.max.toString()))}function h(i){const s=i.target;s.style.setProperty("--value",s.value)}return(i,s)=>Q((c(),g("input",{ref_key:"sliderRef",ref:a,"onUpdate:modelValue":s[0]||(s[0]=y=>u.value=y),type:"range",min:o.value,max:l.value,step:r.value,class:"slider-progress form_input-range",onInput:h},null,40,$e)),[[ee,u.value,void 0,{number:!0}]])}}),ke=B(we,[["__scopeId","data-v-d88ffd28"]]),Ce={flex:"~ col gap-4"},Ee={flex:"~ row","items-center":"","gap-2":""},Se={flex:"1"},Me={class:"flex items-center gap-1 text-sm font-medium"},Be={class:"text-xs text-neutral-500 dark:text-neutral-400"},je={"font-mono":""},Ae={flex:"~ row","items-center":"","gap-2":""},Ie=m({__name:"FieldRange",props:A({min:null,max:null,step:null,label:null,description:null,formatValue:{type:Function}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=t,n=C(t,"modelValue");return(o,l)=>{var r;return c(),g("label",Ce,[f("div",Ee,[f("div",Se,[f("div",Me,x(t.label),1),f("div",Be,x(t.description),1)]),f("span",je,x(((r=e.formatValue)==null?void 0:r.call(e,n.value))||n.value),1)]),f("div",Ae,[$(ke,{modelValue:n.value,"onUpdate:modelValue":l[0]||(l[0]=a=>n.value=a),min:t.min||0,max:t.max||1,step:t.step||.01,"w-full":""},null,8,["modelValue","min","max","step"])])])}}});export{Ie as _,Te as a,Re as b}; +import{d as m,c as g,o as c,a3 as M,bh as k,c2 as B,e as V,a8 as E,T as P,U as O,a as f,bk as b,bl as _,b as $,c6 as R,cD as D,ch as w,cE as N,cA as S,u as d,cz as z,cM as L,f as v,d0 as j,cw as U,d1 as H,w as K,c7 as W,bq as Y,d2 as G,W as X,cZ as Z,cj as J,cf as C,ce as q,Y as x,bm as Q,cc as ee}from"./index-B06xwjXa.js";import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-Du5e5QRV.js";import"./Select.vue_vue_type_style_index_0_lang-CzS20kE7.js";const te=m({__name:"Volumed",props:{perspective:null,transform:null},setup(t){return(e,n)=>(c(),g("div",{class:"volumed",style:M({perspective:`${t.perspective}px`,transform:t.transform})},[k(e.$slots,"default",{},void 0,!0)],4))}}),ae=B(te,[["__scopeId","data-v-568551bc"]]),ne=m({__name:"CursorMomentum",props:{baseSpeed:{default:.1},friction:{default:.95},momentumFactor:{default:.005}},setup(t,{expose:e}){const n=t,o=V(1),l=V(0);let r=0;const a=E(()=>n.friction),u=E(()=>n.baseSpeed),p=E(()=>n.momentumFactor);function h(s){r||(r=s);const y=s-r;r=s,o.value=u.value+(o.value-u.value)*a.value,l.value+=o.value*y,requestAnimationFrame(h)}function i(s){const y=Math.sqrt(s.movementX**2+s.movementY**2);o.value+=y*p.value}return P(()=>{window.addEventListener("mousemove",i),requestAnimationFrame(h)}),O(()=>{window.removeEventListener("mousemove",i)}),e({momentum:o,currentValue:l}),(s,y)=>k(s.$slots,"default",{momentum:o.value,currentValue:l.value})}}),le=m({__name:"TestDummyMarkerFlat",props:{size:null},setup(t){return(e,n)=>(c(),g("div",{class:"test-dummy-flat",style:M({width:`${t.size}px`,height:`${t.size}px`})},n[0]||(n[0]=[f("div",{class:"marker"},null,-1)]),4))}}),oe=B(le,[["__scopeId","data-v-b4ef37ac"]]),Re=m({__name:"TestDummyMarker",setup(t){return(e,n)=>(c(),b(ne,{"base-speed":.1,friction:.95,"momentum-factor":5e-4},{default:_(({currentValue:o})=>[$(ae,{perspective:800,transform:"rotateX(45deg) translateY(3px)"},{default:_(()=>[$(oe,{size:24,style:M({transform:`rotate(${o}deg)`})},null,8,["style"])]),_:2},1024)]),_:1}))}});function T(t){return t?t.flatMap(e=>e.type===R?T(e.children):[e]):[]}const re=m({name:"PrimitiveSlot",inheritAttrs:!1,setup(t,{attrs:e,slots:n}){return()=>{var p,h;if(!n.default)return null;const o=T(n.default()),l=o.findIndex(i=>i.type!==D);if(l===-1)return o;const r=o[l];(p=r.props)==null||delete p.ref;const a=r.props?w(e,r.props):e;e.class&&((h=r.props)!=null&&h.class)&&delete r.props.class;const u=N(r,a);for(const i in a)i.startsWith("on")&&(u.props||(u.props={}),u.props[i]=a[i]);return o.length===1?u:(o[l]=u,o)}}}),se=["area","img","input"],A=m({name:"Primitive",inheritAttrs:!1,props:{asChild:{type:Boolean,default:!1},as:{type:[String,Object],default:"div"}},setup(t,{attrs:e,slots:n}){const o=t.asChild?"template":t.as;return typeof o=="string"&&se.includes(o)?()=>S(o,e):o!=="template"?()=>S(t.as,e,{default:n.default}):()=>S(re,e,{default:n.default})}}),ue=m({__name:"VisuallyHidden",props:{feature:{default:"focusable"},asChild:{type:Boolean},as:{default:"span"}},setup(t){return(e,n)=>(c(),b(d(A),{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:_(()=>[k(e.$slots,"default")]),_:3},8,["as","as-child","aria-hidden","data-hidden","tabindex"]))}});function ie(t,e){const n=`${t}Context`,o=Symbol(n);return[a=>{const u=z(o,a);if(u||u===null)return u;throw new Error(`Injection \`${o.toString()}\` not found. Component must be used within ${Array.isArray(t)?`one of the following components: ${t.join(", ")}`:`\`${t}\``}`)},a=>(L(o,a),a)]}function I(){const t=U(),e=V(),n=v(()=>{var a,u;return["#text","#comment"].includes((a=e.value)==null?void 0:a.$el.nodeName)?(u=e.value)==null?void 0:u.$el.nextElementSibling:j(e)}),o=Object.assign({},t.exposed),l={};for(const a in t.props)Object.defineProperty(l,a,{enumerable:!0,configurable:!0,get:()=>t.props[a]});if(Object.keys(o).length>0)for(const a in o)Object.defineProperty(l,a,{enumerable:!0,configurable:!0,get:()=>o[a]});Object.defineProperty(l,"$el",{enumerable:!0,configurable:!0,get:()=>t.vnode.el}),t.exposed=l;function r(a){e.value=a,a&&(Object.defineProperty(l,"$el",{enumerable:!0,configurable:!0,get:()=>a instanceof Element?a:a.$el}),t.exposed=l)}return{forwardRef:r,currentRef:e,currentElement:n}}function de(){const t=V(),e=v(()=>{var n,o;return["#text","#comment"].includes((n=t.value)==null?void 0:n.$el.nodeName)?(o=t.value)==null?void 0:o.$el.nextElementSibling:j(t)});return{primitiveElement:t,currentElement:e}}function ce(t){return v(()=>{var e;return H(t)?!!((e=j(t))!=null&&e.closest("form")):!0})}const F=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:n,currentElement:o}=de(),l=v(()=>e.checked??e.value);return K(l,(r,a)=>{if(!o.value)return;const u=o.value,p=window.HTMLInputElement.prototype,i=Object.getOwnPropertyDescriptor(p,"value").set;if(i&&r!==a){const s=new Event("input",{bubbles:!0}),y=new Event("change",{bubbles:!0});i.call(u,r),u.dispatchEvent(s),u.dispatchEvent(y)}}),(r,a)=>(c(),b(ue,w({ref_key:"primitiveElement",ref:n},{...e,...r.$attrs},{as:"input"}),null,16))}}),me=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,n=v(()=>typeof e.value=="object"&&Array.isArray(e.value)&&e.value.length===0&&e.required),o=v(()=>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((l,r)=>typeof l=="object"?Object.entries(l).map(([a,u])=>({name:`[${e.name}][${r}][${a}]`,value:u})):{name:`[${e.name}][${r}]`,value:l}):e.value!==null&&typeof e.value=="object"&&!Array.isArray(e.value)?Object.entries(e.value).map(([l,r])=>({name:`[${e.name}][${l}]`,value:r})):[]);return(l,r)=>n.value?(c(),b(F,w({key:l.name},{...e,...l.$attrs},{name:l.name,value:l.value}),null,16,["name","value"])):(c(!0),g(R,{key:1},W(o.value,a=>(c(),b(F,w({key:a.name,ref_for:!0},{...e,...l.$attrs},{name:a.name,value:a.value}),null,16,["name","value"]))),128))}}),[pe,fe]=ie("SwitchRoot"),ve=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 n=t,o=e,{disabled:l}=Y(n),r=G(n,"modelValue",o,{defaultValue:n.defaultValue,passive:n.modelValue===void 0});function a(){l.value||(r.value=!r.value)}const{forwardRef:u,currentElement:p}=I(),h=ce(p),i=v(()=>{var s;return n.id&&p.value?(s=document.querySelector(`[for="${n.id}"]`))==null?void 0:s.innerText:void 0});return fe({modelValue:r,toggleCheck:a,disabled:l}),(s,y)=>(c(),b(d(A),w(s.$attrs,{id:s.id,ref:d(u),role:"switch",type:s.as==="button"?"button":void 0,value:s.value,"aria-label":s.$attrs["aria-label"]||i.value,"aria-checked":d(r),"aria-required":s.required,"data-state":d(r)?"checked":"unchecked","data-disabled":d(l)?"":void 0,"as-child":s.asChild,as:s.as,disabled:d(l),onClick:a,onKeydown:Z(J(a,["prevent"]),["enter"])}),{default:_(()=>[k(s.$slots,"default",{modelValue:d(r)}),d(h)&&s.name?(c(),b(d(me),{key:0,type:"checkbox",name:s.name,disabled:d(l),required:s.required,value:s.value,checked:!!d(r)},null,8,["name","disabled","required","value","checked"])):X("",!0)]),_:3},16,["id","type","value","aria-label","aria-checked","aria-required","data-state","data-disabled","as-child","as","disabled","onKeydown"]))}}),he=m({__name:"SwitchThumb",props:{asChild:{type:Boolean},as:{default:"span"}},setup(t){const e=pe();return I(),(n,o)=>{var l;return c(),b(d(A),{"data-state":(l=d(e).modelValue)!=null&&l.value?"checked":"unchecked","data-disabled":d(e).disabled.value?"":void 0,"as-child":n.asChild,as:n.as},{default:_(()=>[k(n.$slots,"default")]),_:3},8,["data-state","data-disabled","as-child","as"])}}}),ye=m({__name:"Checkbox",props:{modelValue:{type:Boolean,required:!0},modelModifiers:{}},emits:["update:modelValue"],setup(t){const e=C(t,"modelValue");return(n,o)=>(c(),b(d(ve),{modelValue:e.value,"onUpdate:modelValue":o[0]||(o[0]=l=>e.value=l),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:_(()=>[$(d(he),{"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"]))}}),be={flex:"~ col gap-4"},_e={flex:"~ row","items-center":"","gap-2":""},ge={flex:"1"},xe={class:"flex items-center gap-1 text-sm font-medium"},Ve={class:"text-xs text-neutral-500 dark:text-neutral-400"},Te=m({__name:"FieldCheckbox",props:q({label:null,description:null},{modelValue:{type:Boolean,required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=t,n=C(t,"modelValue");return(o,l)=>(c(),g("label",be,[f("div",_e,[f("div",ge,[f("div",xe,x(e.label),1),f("div",Ve,x(e.description),1)]),$(ye,{modelValue:n.value,"onUpdate:modelValue":l[0]||(l[0]=r=>n.value=r)},null,8,["modelValue"])])]))}}),$e=["min","max","step"],we=m({__name:"Range",props:q({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 e=t,n=C(t,"modelValue"),o=v(()=>e.min*1e4),l=v(()=>e.max*1e4),r=v(()=>e.step*1e4),a=V(),u=v({get:()=>n.value*1e4,set:i=>{n.value=i/1e4,p()}});P(()=>{p()});function p(){a.value&&(a.value.style.setProperty("--value",a.value.value),a.value.style.setProperty("--min",a.value.min?a.value.min:e.min.toString()),a.value.style.setProperty("--max",a.value.max?a.value.max:e.max.toString()))}function h(i){const s=i.target;s.style.setProperty("--value",s.value)}return(i,s)=>Q((c(),g("input",{ref_key:"sliderRef",ref:a,"onUpdate:modelValue":s[0]||(s[0]=y=>u.value=y),type:"range",min:o.value,max:l.value,step:r.value,class:"slider-progress form_input-range",onInput:h},null,40,$e)),[[ee,u.value,void 0,{number:!0}]])}}),ke=B(we,[["__scopeId","data-v-d88ffd28"]]),Ce={flex:"~ col gap-4"},Ee={flex:"~ row","items-center":"","gap-2":""},Se={flex:"1"},Me={class:"flex items-center gap-1 text-sm font-medium"},Be={class:"text-xs text-neutral-500 dark:text-neutral-400"},je={"font-mono":""},qe={flex:"~ row","items-center":"","gap-2":""},Ie=m({__name:"FieldRange",props:q({min:null,max:null,step:null,label:null,description:null,formatValue:{type:Function}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const e=t,n=C(t,"modelValue");return(o,l)=>{var r;return c(),g("label",Ce,[f("div",Ee,[f("div",Se,[f("div",Me,x(t.label),1),f("div",Be,x(t.description),1)]),f("span",je,x(((r=e.formatValue)==null?void 0:r.call(e,n.value))||n.value),1)]),f("div",qe,[$(ke,{modelValue:n.value,"onUpdate:modelValue":l[0]||(l[0]=a=>n.value=a),min:t.min||0,max:t.max||1,step:t.step||.01,"w-full":""},null,8,["modelValue","min","max","step"])])])}}});export{Ie as _,Te as a,Re as b}; diff --git a/assets/HeaderLink-LlW9hXo1.js b/assets/HeaderLink-OTe6TGtK.js similarity index 63% rename from assets/HeaderLink-LlW9hXo1.js rename to assets/HeaderLink-OTe6TGtK.js index 5addad049c73ec16cb28f2baefb0e21c99a942fc..2220da694a27acabbecb1e686b280cdaa732efa4 100644 --- a/assets/HeaderLink-LlW9hXo1.js +++ b/assets/HeaderLink-OTe6TGtK.js @@ -1 +1 @@ -import{d as c,ca as r,ac as l,u as e,b_ as _,o as s,ad as d,c as t,a,bZ as i}from"./index-CNH1g_GM.js";const k="/assets/logo-dark-CO0kwKsz.svg",p="/assets/logo-D6zeZTFl.svg",u=["src"],m=["src"],g=c({__name:"HeaderLink",setup(x){const n=r();return(f,o)=>(s(),l(e(_),{to:"/",flex:"~","items-center":"","gap-2":"","px-2":"","text-nowrap":"","text-2xl":"","outline-none":""},{default:d(()=>[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,__:[0]}))}}),w=i(g,[["__scopeId","data-v-496b6cde"]]);export{w as H}; +import{d as n,ca as r,bk as l,u as e,c3 as _,o as s,bl as d,c as t,a,c2 as i}from"./index-B06xwjXa.js";const k="/assets/logo-dark-CO0kwKsz.svg",p="/assets/logo-D6zeZTFl.svg",u=["src"],m=["src"],g=n({__name:"HeaderLink",setup(x){const c=r();return(f,o)=>(s(),l(e(_),{to:"/",flex:"~","items-center":"","gap-2":"","px-2":"","text-nowrap":"","text-2xl":"","outline-none":""},{default:d(()=>[e(c)?(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,__:[0]}))}}),w=i(g,[["__scopeId","data-v-496b6cde"]]);export{w as H}; diff --git a/assets/IconAnimation.vue_vue_type_script_setup_true_lang-DSobYOgR.js b/assets/IconAnimation.vue_vue_type_script_setup_true_lang-_yAijtHg.js similarity index 95% rename from assets/IconAnimation.vue_vue_type_script_setup_true_lang-DSobYOgR.js rename to assets/IconAnimation.vue_vue_type_script_setup_true_lang-_yAijtHg.js index 352caf5789bed65aae8b5c91bc7084844c0cbf3d..a53a45f6d68e19ef1e066191ee9e591a8bff6d18 100644 --- a/assets/IconAnimation.vue_vue_type_script_setup_true_lang-DSobYOgR.js +++ b/assets/IconAnimation.vue_vue_type_script_setup_true_lang-_yAijtHg.js @@ -1 +1 @@ -import{d as m,e as s,w as p,f,c as h,o as x,a3 as l,a as u,X as y}from"./index-CNH1g_GM.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=f(()=>({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(),h("div",{"pointer-events-none":"",fixed:"",w:"100dvw",h:"100dvh",style:l({zIndex:r.value?a.zIndex:void 0})},[u("div",{fixed:"","inset-0":"","bg-primary-500":"","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,e as s,w as p,f,c as h,o as x,a3 as l,a as u,X as y}from"./index-B06xwjXa.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=f(()=>({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(),h("div",{"pointer-events-none":"",fixed:"",w:"100dvw",h:"100dvh",style:l({zIndex:r.value?a.zIndex:void 0})},[u("div",{fixed:"","inset-0":"","bg-primary-500":"","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-Co6qJ9yZ.js b/assets/IconStatusItem-CntkxYB2.js similarity index 92% rename from assets/IconStatusItem-Co6qJ9yZ.js rename to assets/IconStatusItem-CntkxYB2.js index 02d247c1cac68b42b77612b13eeb60ed6eb59b9f..a0bacb811dd9484a37aeca0e33fc1b8b97b50c83 100644 --- a/assets/IconStatusItem-Co6qJ9yZ.js +++ b/assets/IconStatusItem-CntkxYB2.js @@ -1 +1 @@ -import{d as u,a2 as c,c as e,o as n,b as d,a as o,ad as m,W as a,Y as i,X as s,bZ as _}from"./index-CNH1g_GM.js";import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-BQHOFrhO.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-thin":"",class:"menu-icon-status-item-title",transition:"all ease-in-out duration-400"},f={text:"sm neutral-500 dark:neutral-400",class:"menu-icon-status-item-description",transition:"all ease-in-out duration-400"},k=["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(I,C)=>{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",f,[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,k)):a("",!0)]),_:1},8,["to"]),o("div",x,[t.configured?(n(),e("div",v)):(n(),e("div",y))])])}}}),B=_(b,[["__scopeId","data-v-f23cce59"]]);export{B as I}; +import{d as u,a2 as c,c as e,o as n,b as d,a as o,bl as m,W as a,Y as i,X as s,c2 as _}from"./index-B06xwjXa.js";import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-Du5e5QRV.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-thin":"",class:"menu-icon-status-item-title",transition:"all ease-in-out duration-400"},f={text:"sm neutral-500 dark:neutral-400",class:"menu-icon-status-item-description",transition:"all ease-in-out duration-400"},k=["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(I,C)=>{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",f,[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,k)):a("",!0)]),_:1},8,["to"]),o("div",x,[t.configured?(n(),e("div",v)):(n(),e("div",y))])])}}}),B=_(b,[["__scopeId","data-v-f23cce59"]]);export{B as I}; diff --git a/assets/Input.vue_vue_type_script_setup_true_lang-CvnY3pbX.js b/assets/Input.vue_vue_type_script_setup_true_lang-CqiG06sL.js similarity index 67% rename from assets/Input.vue_vue_type_script_setup_true_lang-CvnY3pbX.js rename to assets/Input.vue_vue_type_script_setup_true_lang-CqiG06sL.js index 7f5605dfd1ba20c5d96b49b3e7e0d870024a5596..b5adfcf0c97b8af53b9c6d88500a8df94327bdcf 100644 --- a/assets/Input.vue_vue_type_script_setup_true_lang-CvnY3pbX.js +++ b/assets/Input.vue_vue_type_script_setup_true_lang-CqiG06sL.js @@ -1 +1 @@ -import{d as r,ce as n,cf as u,ae as s,c$ as d,o as i,c as p}from"./index-CNH1g_GM.js";const m=["type"],y=r({__name:"Input",props:n({type:null},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const l=e,t=u(e,"modelValue");return(c,a)=>s((i(),p("input",{"onUpdate:modelValue":a[0]||(a[0]=o=>t.value=o),type:l.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,ce as n,cf as u,bm as s,c$ as d,o as i,c as m}from"./index-B06xwjXa.js";const p=["type"],y=r({__name:"Input",props:n({type:null},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const l=e,t=u(e,"modelValue");return(c,a)=>s((i(),m("input",{"onUpdate:modelValue":a[0]||(a[0]=o=>t.value=o),type:l.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,p)),[[d,t.value]])}});export{y as _}; diff --git a/assets/InputFile.vue_vue_type_script_setup_true_lang-bO5dM4_S.js b/assets/InputFile.vue_vue_type_script_setup_true_lang-B7xRsonQ.js similarity index 96% rename from assets/InputFile.vue_vue_type_script_setup_true_lang-bO5dM4_S.js rename to assets/InputFile.vue_vue_type_script_setup_true_lang-B7xRsonQ.js index 002b10369f3dbc83beab9bcda2602e567742cb20..fa9e11138b1c5f701ec0a7905a2eaf3032164776 100644 --- a/assets/InputFile.vue_vue_type_script_setup_true_lang-bO5dM4_S.js +++ b/assets/InputFile.vue_vue_type_script_setup_true_lang-B7xRsonQ.js @@ -1 +1 @@ -import{d as g,ce as b,cf as v,e as p,ci as y,c as s,o as n,X as m,u as t,a as l,a9 as x}from"./index-CNH1g_GM.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 c(i){const e=i.target;e.files&&e.files.length>0&&(u.value=e.files[0]),d.value=Array.from(e.files||[]),a.value=!1}return(i,e)=>(n(),s("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]=f=>a.value=!0),onDragleave:e[1]||(e[1]=f=>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:c},null,40,k),x(i.$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(),s("p",h," Release to upload ")):(n(),s("p",D," Click or drag and drop a file here "))],2)])],34))}});export{C as _}; +import{d as g,ce as b,cf as v,e as p,ci as y,c as s,o as n,X as m,u as t,a as l,bh as x}from"./index-B06xwjXa.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 c(i){const e=i.target;e.files&&e.files.length>0&&(u.value=e.files[0]),d.value=Array.from(e.files||[]),a.value=!1}return(i,e)=>(n(),s("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]=f=>a.value=!0),onDragleave:e[1]||(e[1]=f=>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:c},null,40,k),x(i.$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(),s("p",h," Release to upload ")):(n(),s("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-BVl3TxNh.js b/assets/Model.vue_vue_type_script_setup_true_lang-BVl3TxNh.js deleted file mode 100644 index 16e2c363899d9cb780562a3d54b339ffb7822fe1..0000000000000000000000000000000000000000 --- a/assets/Model.vue_vue_type_script_setup_true_lang-BVl3TxNh.js +++ /dev/null @@ -1 +0,0 @@ -import{e as P,T as Y,A as re,L as C,a as $,D as ue,I as se,l as T,M as de,b as R}from"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-BQHOFrhO.js";import{co as ce,d as q,e as f,w as p,T as N,U as X,c as j,o as G,a9 as U,c1 as z,f as O,ca as ve,a6 as pe,ak as fe,a0 as me,ab as he,cp as ge,cq as Me,c6 as we,a as ye,aa as be}from"./index-CNH1g_GM.js";import{r as Se}from"./three-vrm-animation.module-B_hGdUpX.js";import"./mcp-B7-jaCfZ.js";import"./emotions-DWNSb738.js";const xe=o=>Math.max(0,Math.min(1,o||0)),F=o=>Math.round(xe(o)*255),Be=ce("rgb"),Fe=o=>{if(o===void 0)return;let l=F(o.r),t=F(o.g),d=F(o.b);return"#"+(1<<24|l<<16|t<<8|d).toString(16).slice(1)},Pe=o=>Fe(Be(o)),Ee=q({__name:"Canvas",props:{width:null,height:null},setup(o,{expose:l}){const t=o,d=f(),e=f(),i=f();async function c(n){C.registerTicker($),P.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 B(){return new Promise(g=>{if(!i.value||!e.value)return g(null);e.value.render(),i.value.toBlob(g)})}return l({captureFrame:B}),(n,g)=>(G(),j("div",{ref_key:"containerRef",ref:d,"h-full":"","w-full":""},[U(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 Ce(){let o=-1,l,t=-1;function d(e,i){(i>=o||il.app),d=z(()=>l.paused),e=f(),i=f(0),c=f(0),y=O(()=>Math.max(0,Math.min(100,l.mouthOpenSize))),B=ve(),n=pe(be),g=O(()=>n.between("sm","md").value||n.smaller("sm").value),W=Ce(),I=fe(new ue({alpha:.2,blur:0,distance:20,rotation:45}));function J(){return e.value.internalModel.coreModel}function D(a){if(!a.value)return;let r=2.2;g.value&&(r=2.2);const m=l.height*.95/c.value*r,s=l.width*.95/i.value*r,h=Math.min(m,s);a.value.scale.set(h,h)}const{live2dModelFile:b,loadingLive2dModel:M,live2dCurrentMotion:K,availableLive2dMotions:Q,live2dLoadSource:S,live2dModelUrl:k,themeColorsHue:Z,themeColorsHueDynamic:_}=me(he()),ee=f({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 C;S.value==="file"?await R.setupLive2DModel(a,[b.value]):S.value==="url"&&await R.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,m=r.coreModel,s=r.motionManager;m.setParameterValueById("ParamMouthOpenY",y.value),Q.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 h=s.update;s.update=function(v,u){return h==null||h.call(this,v,u),s.state.currentGroup===s.groups.idle&&W.update(r,u),!0},s.on("motionStart",(v,u)=>{ee.value={group:v,index:u}}),b.value&&await T.setItem("live2dModel",b.value),M.value=!1}async function te(){if(!t.value)return;C.registerTicker($),P.add(Y),P.add(se);const a=await T.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,de.FORCE)}const oe=ge(()=>{e.value&&(e.value.x=l.width/2,e.value.y=l.height,D(e))},100),A=f(),w=f(0);function x(){if(e.value){const a=getComputedStyle(A.value).backgroundColor;I.value.color=Number(Pe(a).replace("#","0x")),e.value.filters=[I.value]}}p([()=>l.width,()=>l.height],()=>oe()),p(B,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=>J().setParameterValueById("ParamMouthOpenY",a)),p(t,te),p(K,a=>le(a.group,a.index)),p(d,a=>{var r,m;a?(r=t.value)==null||r.stop():(m=t.value)==null||m.start()}),Me(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)=>(G(),j(we,null,[ye("div",{ref_key:"dropShadowColorComputer",ref:A,hidden:"",bg:"primary-400 dark:primary-500"},null,512),U(a.$slots,"default")],64))}});export{Le as _,Ee as a,H as r}; diff --git a/assets/Model.vue_vue_type_script_setup_true_lang-CUcE9b2l.js b/assets/Model.vue_vue_type_script_setup_true_lang-CUcE9b2l.js new file mode 100644 index 0000000000000000000000000000000000000000..d198d82ff53098dc4ea920f9dc0e257dc0d733f1 --- /dev/null +++ b/assets/Model.vue_vue_type_script_setup_true_lang-CUcE9b2l.js @@ -0,0 +1 @@ +import{e as P,T as Y,A as re,L as C,a as $,D as ue,I as se,l as T,M as de,b as R}from"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-Du5e5QRV.js";import{co as ce,d as j,e as f,w as p,T as q,U as N,c as X,o as G,bh as U,a8 as z,f as O,ca as ve,be as pe,bs as fe,a0 as he,bj as me,cp as ge,cq as Me,c6 as we,a as ye,bi as be}from"./index-B06xwjXa.js";import{r as Se}from"./three-vrm.module-CtuEk7GG.js";import"./emotions-DWNSb738.js";import"./mcp-BfXpaYZf.js";const xe=o=>Math.max(0,Math.min(1,o||0)),F=o=>Math.round(xe(o)*255),Be=ce("rgb"),Fe=o=>{if(o===void 0)return;let l=F(o.r),t=F(o.g),d=F(o.b);return"#"+(1<<24|l<<16|t<<8|d).toString(16).slice(1)},Pe=o=>Fe(Be(o)),Ee=j({__name:"Canvas",props:{width:null,height:null},setup(o,{expose:l}){const t=o,d=f(),e=f(),i=f();async function c(n){C.registerTicker($),P.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()),q(async()=>d.value&&await c(d.value)),N(()=>{var n;return(n=e.value)==null?void 0:n.destroy()});async function B(){return new Promise(g=>{if(!i.value||!e.value)return g(null);e.value.render(),i.value.toBlob(g)})}return l({captureFrame:B}),(n,g)=>(G(),X("div",{ref_key:"containerRef",ref:d,"h-full":"","w-full":""},[U(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 Ce(){let o=-1,l,t=-1;function d(e,i){(i>=o||il.app),d=z(()=>l.paused),e=f(),i=f(0),c=f(0),y=O(()=>Math.max(0,Math.min(100,l.mouthOpenSize))),B=ve(),n=pe(be),g=O(()=>n.between("sm","md").value||n.smaller("sm").value),W=Ce(),I=fe(new ue({alpha:.2,blur:0,distance:20,rotation:45}));function J(){return e.value.internalModel.coreModel}function D(a){if(!a.value)return;let r=2.2;g.value&&(r=2.2);const h=l.height*.95/c.value*r,s=l.width*.95/i.value*r,m=Math.min(h,s);a.value.scale.set(m,m)}const{live2dModelFile:b,loadingLive2dModel:M,live2dCurrentMotion:K,availableLive2dMotions:Q,live2dLoadSource:S,live2dModelUrl:k,themeColorsHue:Z,themeColorsHueDynamic:_}=he(me()),ee=f({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 C;S.value==="file"?await R.setupLive2DModel(a,[b.value]):S.value==="url"&&await R.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,h=r.coreModel,s=r.motionManager;h.setParameterValueById("ParamMouthOpenY",y.value),Q.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&&W.update(r,u),!0},s.on("motionStart",(v,u)=>{ee.value={group:v,index:u}}),b.value&&await T.setItem("live2dModel",b.value),M.value=!1}async function te(){if(!t.value)return;C.registerTicker($),P.add(Y),P.add(se);const a=await T.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,de.FORCE)}const oe=ge(()=>{e.value&&(e.value.x=l.width/2,e.value.y=l.height,D(e))},100),A=f(),w=f(0);function x(){if(e.value){const a=getComputedStyle(A.value).backgroundColor;I.value.color=Number(Pe(a).replace("#","0x")),e.value.filters=[I.value]}}p([()=>l.width,()=>l.height],()=>oe()),p(B,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=>J().setParameterValueById("ParamMouthOpenY",a)),p(t,te),p(K,a=>le(a.group,a.index)),p(d,a=>{var r,h;a?(r=t.value)==null||r.stop():(h=t.value)==null||h.start()}),Me(M,a=>{a&&ae()},{debounce:1e3}),q(x),N(()=>{var a;cancelAnimationFrame(w.value),e.value&&((a=t.value)==null||a.stage.removeChild(e.value))}),(a,r)=>(G(),X(we,null,[ye("div",{ref_key:"dropShadowColorComputer",ref:A,hidden:"",bg:"primary-400 dark:primary-500"},null,512),U(a.$slots,"default")],64))}});export{Le as _,Ee as a,H as r}; diff --git a/assets/ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-CR2pR4yl.js b/assets/ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-DMARmtsp.js similarity index 71% rename from assets/ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-CR2pR4yl.js rename to assets/ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-DMARmtsp.js index 8728129ed1e873af600d5536d41958ec813caa65..4d9df4dbad7a0390f9b742d39ae369af41eeea7e 100644 --- a/assets/ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-CR2pR4yl.js +++ b/assets/ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-DMARmtsp.js @@ -1 +1 @@ -import{_ as t}from"./FieldInput.vue_vue_type_script_setup_true_lang-tEOSPb7v.js";import"./Select.vue_vue_type_style_index_0_lang-BIffysKh.js";import{d as u,ce as n,$ as p,cf as m,f as c,ac as f,o as v,u as a}from"./index-CNH1g_GM.js";const g=u({__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:d}=p(),o=m(e,"modelValue"),i=c(()=>l.description||`API Key for ${l.providerName}`);return(V,r)=>(v(),f(a(t),{modelValue:o.value,"onUpdate:modelValue":r[0]||(r[0]=s=>o.value=s),label:e.label||a(d)("settings.pages.providers.common.fields.field.api-key.label"),description:i.value,placeholder:e.placeholder,required:e.required,type:"password"},null,8,["modelValue","label","description","placeholder","required"]))}});export{g as _}; +import{_ as t}from"./FieldInput.vue_vue_type_script_setup_true_lang-DM6oOIgU.js";import"./Select.vue_vue_type_style_index_0_lang-CzS20kE7.js";import{d as u,ce as n,$ as p,cf as m,f as c,bk as f,o as v,u as a}from"./index-B06xwjXa.js";const k=u({__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:d}=p(),o=m(e,"modelValue"),i=c(()=>l.description||`API Key for ${l.providerName}`);return(V,r)=>(v(),f(a(t),{modelValue:o.value,"onUpdate:modelValue":r[0]||(r[0]=s=>o.value=s),label:e.label||a(d)("settings.pages.providers.common.fields.field.api-key.label"),description:i.value,placeholder:e.placeholder,required:e.required,type:"password"},null,8,["modelValue","label","description","placeholder","required"]))}});export{k as _}; diff --git a/assets/ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-C-ZUDDxT.js b/assets/ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-gnnCLEsG.js similarity index 67% rename from assets/ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-C-ZUDDxT.js rename to assets/ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-gnnCLEsG.js index cdd75f3b1708173faa695c298a875d718f946d75..6a29bf17229d5dd7fef7094aa78ea2fa4f140085 100644 --- a/assets/ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-C-ZUDDxT.js +++ b/assets/ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-gnnCLEsG.js @@ -1 +1 @@ -import{_ as p}from"./Collapsable.vue_vue_type_script_setup_true_lang-dwKULsMl.js";import{d,e as m,ac as u,o as c,ad as n,a as e,a9 as f,Y as _,X as v,ce as b,cf as V,u as g}from"./index-CNH1g_GM.js";import{_ as x}from"./FieldInput.vue_vue_type_script_setup_true_lang-tEOSPb7v.js";import"./Select.vue_vue_type_style_index_0_lang-BIffysKh.js";const h=["onClick"],B={class:"text-lg text-neutral-500 md:text-2xl dark:text-neutral-400"},y={"mt-4":""},U=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",B,[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,h)]),default:n(()=>[e("div",y,[f(o.$slots,"default")])]),_:3}))}}),$=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=V(l,"modelValue");return(r,o)=>(c(),u(g(x),{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{U as _,$ as a}; +import{_ as p}from"./Collapsable.vue_vue_type_script_setup_true_lang-BxFBRVXD.js";import{d,e as m,bk as u,o as c,bl as n,a as e,bh as f,Y as _,X as b,ce as v,cf as V,u as g}from"./index-B06xwjXa.js";import{_ as x}from"./FieldInput.vue_vue_type_script_setup_true_lang-DM6oOIgU.js";import"./Select.vue_vue_type_style_index_0_lang-CzS20kE7.js";const h=["onClick"],B={class:"text-lg text-neutral-500 md:text-2xl dark:text-neutral-400"},k={"mt-4":""},U=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",B,[e("span",null,_(l.title||"Advanced"),1)]),e("div",{transform:"",transition:"transform duration-250",class:b({"rotate-180":s.visible})},i[0]||(i[0]=[e("div",{"i-solar:alt-arrow-down-bold-duotone":""},null,-1)]),2)],8,h)]),default:n(()=>[e("div",k,[f(o.$slots,"default")])]),_:3}))}}),$=d({__name:"ProviderBaseUrlInput",props:v({placeholder:null,required:{type:Boolean},label:null,description:null},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const t=l,a=V(l,"modelValue");return(r,o)=>(c(),u(g(x),{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{U as _,$ as a}; diff --git a/assets/ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-BpJun8-8.js b/assets/ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-BoAZvnmm.js similarity index 69% rename from assets/ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-BpJun8-8.js rename to assets/ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-BoAZvnmm.js index b06f218799fdd2266fc6265beb44795d4f041b90..1d73a0eaa12a300946c3b4a74238c3ced7a24365 100644 --- a/assets/ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-BpJun8-8.js +++ b/assets/ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-BoAZvnmm.js @@ -1 +1 @@ -import{d as o,c as r,o as s,a as e,a9 as i,W as u,Y as l}from"./index-CNH1g_GM.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(a,n)=>(s(),r("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?(s(),r("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(a.$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(a,n)=>(s(),r("div",p,[i(a.$slots,"default")]))}});export{k as _,g as a}; +import{d as o,c as s,o as a,a as e,bh as i,W as u,Y as l}from"./index-B06xwjXa.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-DUl7ZNEY.js b/assets/ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-DYsKzYwL.js similarity index 62% rename from assets/ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-DUl7ZNEY.js rename to assets/ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-DYsKzYwL.js index 8fdadb873e8f67d04d4189c49e499c0a095d6cd6..c0f868e3fadfc85ae44c79531cbff2dd2e9d0415 100644 --- a/assets/ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-DUl7ZNEY.js +++ b/assets/ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-DYsKzYwL.js @@ -1 +1 @@ -import{d as a,c5 as i,c as o,o as t,a9 as s,ae as c,a as l,X as d,c6 as p}from"./index-CNH1g_GM.js";const u={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":""},_=a({__name:"ProviderSettingsLayout",props:{providerName:null,providerIcon:null,providerIconColor:null,onBack:{type:Function}},setup(e){return(n,v)=>{const r=i("motion");return t(),o(p,null,[s(n.$slots,"default"),c((t(),o("div",u,[l("div",{text:"60",class:d(e.providerIcon||e.providerIconColor)},null,2)])),[[r]])],64)}}});export{_}; +import{d as a,c5 as i,c as o,o as t,bh as s,bm as c,a as l,X as d,c6 as p}from"./index-B06xwjXa.js";const m={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":""},_=a({__name:"ProviderSettingsLayout",props:{providerName:null,providerIcon:null,providerIconColor:null,onBack:{type:Function}},setup(e){return(n,u)=>{const r=i("motion");return t(),o(p,null,[s(n.$slots,"default"),c((t(),o("div",m,[l("div",{text:"60",class:d(e.providerIcon||e.providerIconColor)},null,2)])),[[r]])],64)}}});export{_}; diff --git a/assets/RadioCardSimple-DMkL9ZMC.js b/assets/RadioCardSimple-DEecfDCY.js similarity index 89% rename from assets/RadioCardSimple-DMkL9ZMC.js rename to assets/RadioCardSimple-DEecfDCY.js index 27c48d391a51d37409dff83fa21cebc069d84c52..43133e09b9ca7ec6926e069631f1b11ba2245b79 100644 --- a/assets/RadioCardSimple-DMkL9ZMC.js +++ b/assets/RadioCardSimple-DEecfDCY.js @@ -1 +1 @@ -import{d as g,ce as b,cf as w,e as f,c as n,o as d,X as o,ae as V,a as t,c9 as I,W as v,Y as c,b as $,ad as S,cj as k,u as B,bZ as C,f as T,cc as z,c6 as E,c7 as N,ac as D}from"./index-CNH1g_GM.js";import{_ as P}from"./TransitionVertical.vue_vue_type_script_setup_true_lang-DLt6RcnD.js";import{_ as U}from"./Input.vue_vue_type_script_setup_true_lang-CvnY3pbX.js";import"./Select.vue_vue_type_style_index_0_lang-BIffysKh.js";import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-BQHOFrhO.js";const q=["checked","name","value"],L={class:"relative mr-3 mt-0.5 flex-shrink-0"},j={class:"w-full flex flex-col gap-2"},F={class:"flex items-center"},Q={key:0,class:"relative"},W=["title"],X={key:1,class:"mt-2"},Y=g({__name:"RadioCardDetail",props:b({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=f(!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,q),[[I,a.value]]),t("div",L,[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",j,[t("div",F,[t("span",{class:o(["line-clamp-1 font-thin",[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",Q,[$(B(P),null,{default:S(()=>[!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,W)):(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:"mt-0.5 inline-flex items-center text-xs text-primary-500 dark:text-primary-600",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",X,[$(B(U),{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))}}),Z=C(Y,[["__scopeId","data-v-01e1298e"]]),A={class:"radio-card-detail-many-select"},G={key:0,class:"relative","inline-flex":"~","w-full":"","items-center":""},H=["placeholder"],J={class:"mt-4 space-y-2"},K={key:0,class:"text-sm text-neutral-500 dark:text-neutral-400"},O={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"},_={class:"flex flex-col"},ee={class:"font-medium"},te={class:"text-sm text-amber-600 dark:text-amber-400"},ae={class:"relative"},le=g({__name:"RadioCardManySelect",props:b({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:b(["update:customValue"],["update:modelValue"]),setup(e,{emit:a}){const m=e,s=a,x=w(e,"modelValue"),r=f(""),i=f(!1),R=f(""),h=T(()=>{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 M(p){R.value=p,s("update:customValue",p)}return(p,l)=>(d(),n("div",A,[e.searchable?(d(),n("div",G,[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,H),[[z,r.value]])])):v("",!0),t("div",J,[r.value?(d(),n("div",K,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",O,[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",_,[t("span",ee,c(e.searchNoResultsTitle),1),t("span",te,c(e.searchNoResultsDescription.replace("{query}",r.value)),1)])])):v("",!0),t("div",ae,[t("div",{class:o(["grid auto-cols-[350px] grid-flow-col max-h-[calc(100dvh-7lh)] gap-4 overflow-x-auto pb-4 scrollbar-none",[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(E,null,N(h.value,u=>(d(),D(Z,{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=>M(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)])])]))}}),me=C(le,[["__scopeId","data-v-7ad6d626"]]),re=["checked","name","value"],oe={flex:"~ col","min-h-16":"","w-full":"","items-start":"","justify-center":"","pb-2":"","pl-5":"","pr-4":"","pt-2":""},de=g({__name:"RadioCardSimple",props:b({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:"absolute opacity-0 [&:checked+div]:border-primary-500 [&:checked+div_.radio-dot]:opacity-100 dark:[&:checked+div]:border-primary-400"},null,8,re),[[I,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",oe,[t("span",{class:o(["radio-item-name font-thin",[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))}}),ve=C(de,[["__scopeId","data-v-50bfb5e4"]]);export{me as R,ve as a}; +import{d as g,ce as b,cf as w,e as f,c as n,o as d,X as o,bm as V,a as t,c9 as I,W as v,Y as c,b as $,bl as S,cj as k,u as B,c2 as C,f as T,cc as z,c6 as E,c7 as N,bk as D}from"./index-B06xwjXa.js";import{_ as P}from"./TransitionVertical.vue_vue_type_script_setup_true_lang-CyZTJR0c.js";import{_ as U}from"./Input.vue_vue_type_script_setup_true_lang-CqiG06sL.js";import"./Select.vue_vue_type_style_index_0_lang-CzS20kE7.js";import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-Du5e5QRV.js";const q=["checked","name","value"],L={class:"relative mr-3 mt-0.5 flex-shrink-0"},j={class:"w-full flex flex-col gap-2"},F={class:"flex items-center"},Q={key:0,class:"relative"},W=["title"],X={key:1,class:"mt-2"},Y=g({__name:"RadioCardDetail",props:b({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=f(!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,q),[[I,a.value]]),t("div",L,[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",j,[t("div",F,[t("span",{class:o(["line-clamp-1 font-thin",[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",Q,[$(B(P),null,{default:S(()=>[!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,W)):(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:"mt-0.5 inline-flex items-center text-xs text-primary-500 dark:text-primary-600",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",X,[$(B(U),{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))}}),A=C(Y,[["__scopeId","data-v-01e1298e"]]),G={class:"radio-card-detail-many-select"},H={key:0,class:"relative","inline-flex":"~","w-full":"","items-center":""},J=["placeholder"],K={class:"mt-4 space-y-2"},O={key:0,class:"text-sm text-neutral-500 dark:text-neutral-400"},Z={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"},_={class:"flex flex-col"},ee={class:"font-medium"},te={class:"text-sm text-amber-600 dark:text-amber-400"},ae={class:"relative"},le=g({__name:"RadioCardManySelect",props:b({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:b(["update:customValue"],["update:modelValue"]),setup(e,{emit:a}){const m=e,s=a,x=w(e,"modelValue"),r=f(""),i=f(!1),R=f(""),h=T(()=>{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 M(p){R.value=p,s("update:customValue",p)}return(p,l)=>(d(),n("div",G,[e.searchable?(d(),n("div",H,[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,J),[[z,r.value]])])):v("",!0),t("div",K,[r.value?(d(),n("div",O,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",Z,[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",_,[t("span",ee,c(e.searchNoResultsTitle),1),t("span",te,c(e.searchNoResultsDescription.replace("{query}",r.value)),1)])])):v("",!0),t("div",ae,[t("div",{class:o(["grid auto-cols-[350px] grid-flow-col max-h-[calc(100dvh-7lh)] gap-4 overflow-x-auto pb-4 scrollbar-none",[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(E,null,N(h.value,u=>(d(),D(A,{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=>M(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)])])]))}}),me=C(le,[["__scopeId","data-v-7ad6d626"]]),re=["checked","name","value"],oe={flex:"~ col","min-h-16":"","w-full":"","items-start":"","justify-center":"","pb-2":"","pl-5":"","pr-4":"","pt-2":""},de=g({__name:"RadioCardSimple",props:b({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:"absolute opacity-0 [&:checked+div]:border-primary-500 [&:checked+div_.radio-dot]:opacity-100 dark:[&:checked+div]:border-primary-400"},null,8,re),[[I,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",oe,[t("span",{class:o(["radio-item-name font-thin",[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))}}),ve=C(de,[["__scopeId","data-v-50bfb5e4"]]);export{me as R,ve as a}; diff --git a/assets/Select.vue_vue_type_style_index_0_lang-BIffysKh.js b/assets/Select.vue_vue_type_style_index_0_lang-CzS20kE7.js similarity index 96% rename from assets/Select.vue_vue_type_style_index_0_lang-BIffysKh.js rename to assets/Select.vue_vue_type_style_index_0_lang-CzS20kE7.js index 0deeb6248f31a8781264e285bf4a7bf7b041df5d..2cc4963d89d619168df8aca181f9819e85b8ba79 100644 --- a/assets/Select.vue_vue_type_style_index_0_lang-BIffysKh.js +++ b/assets/Select.vue_vue_type_style_index_0_lang-CzS20kE7.js @@ -1 +1 @@ -import{d as X,cW as je,cX as Ve,a2 as te,c as ie,o as B,a as H,W as ce,c6 as qe,ac as le,a9 as V,a3 as Z,cY as Ge,X as ze,_ as Xe,cZ as Ue,ad as fe,b as Ye,ch as Ke,ct as Ze,cu as Qe}from"./index-CNH1g_GM.js";import{c as Je,r as Q,o as et,j as tt,s as it,f as ot,d as st,a as nt}from"./floating-ui.core-CgBsuaUc.js";function m(e){var t;return((t=e.ownerDocument)==null?void 0:t.defaultView)||window}function _(e){return m(e).getComputedStyle(e)}const ge=Math.min,k=Math.max,q=Math.round;function He(e){const t=_(e);let i=parseFloat(t.width),o=parseFloat(t.height);const s=e.offsetWidth,n=e.offsetHeight,r=q(i)!==s||q(o)!==n;return r&&(i=s,o=n),{width:i,height:o,fallback:r}}function N(e){return Be(e)?(e.nodeName||"").toLowerCase():""}let I;function Ae(){if(I)return I;const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?(I=e.brands.map(t=>t.brand+"/"+t.version).join(" "),I):navigator.userAgent}function b(e){return e instanceof m(e).HTMLElement}function C(e){return e instanceof m(e).Element}function Be(e){return e instanceof m(e).Node}function me(e){return typeof ShadowRoot>"u"?!1:e instanceof m(e).ShadowRoot||e instanceof ShadowRoot}function U(e){const{overflow:t,overflowX:i,overflowY:o,display:s}=_(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+i)&&!["inline","contents"].includes(s)}function rt(e){return["table","td","th"].includes(N(e))}function oe(e){const t=/firefox/i.test(Ae()),i=_(e),o=i.backdropFilter||i.WebkitBackdropFilter;return i.transform!=="none"||i.perspective!=="none"||!!o&&o!=="none"||t&&i.willChange==="filter"||t&&!!i.filter&&i.filter!=="none"||["transform","perspective"].some(s=>i.willChange.includes(s))||["paint","layout","strict","content"].some(s=>{const n=i.contain;return n!=null&&n.includes(s)})}function Oe(){return!/^((?!chrome|android).)*safari/i.test(Ae())}function de(e){return["html","body","#document"].includes(N(e))}function ke(e){return C(e)?e:e.contextElement}const Le={x:1,y:1};function O(e){const t=ke(e);if(!b(t))return Le;const i=t.getBoundingClientRect(),{width:o,height:s,fallback:n}=He(t);let r=(n?q(i.width):i.width)/o,a=(n?q(i.height):i.height)/s;return r&&Number.isFinite(r)||(r=1),a&&Number.isFinite(a)||(a=1),{x:r,y:a}}function R(e,t,i,o){var s,n;t===void 0&&(t=!1),i===void 0&&(i=!1);const r=e.getBoundingClientRect(),a=ke(e);let l=Le;t&&(o?C(o)&&(l=O(o)):l=O(e));const d=a?m(a):window,c=!Oe()&&i;let h=(r.left+(c&&((s=d.visualViewport)==null?void 0:s.offsetLeft)||0))/l.x,u=(r.top+(c&&((n=d.visualViewport)==null?void 0:n.offsetTop)||0))/l.y,y=r.width/l.x,v=r.height/l.y;if(a){const g=m(a),T=o&&C(o)?m(o):o;let f=g.frameElement;for(;f&&o&&T!==g;){const $=O(f),F=f.getBoundingClientRect(),ue=getComputedStyle(f);F.x+=(f.clientLeft+parseFloat(ue.paddingLeft))*$.x,F.y+=(f.clientTop+parseFloat(ue.paddingTop))*$.y,h*=$.x,u*=$.y,y*=$.x,v*=$.y,h+=F.x,u+=F.y,f=m(f).frameElement}}return{width:y,height:v,top:u,right:h+y,bottom:u+v,left:h,x:h,y:u}}function P(e){return((Be(e)?e.ownerDocument:e.document)||window.document).documentElement}function Y(e){return C(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Me(e){return R(P(e)).left+Y(e).scrollLeft}function D(e){if(N(e)==="html")return e;const t=e.assignedSlot||e.parentNode||me(e)&&e.host||P(e);return me(t)?t.host:t}function Re(e){const t=D(e);return de(t)?t.ownerDocument.body:b(t)&&U(t)?t:Re(t)}function G(e,t){var i;t===void 0&&(t=[]);const o=Re(e),s=o===((i=e.ownerDocument)==null?void 0:i.body),n=m(o);return s?t.concat(n,n.visualViewport||[],U(o)?o:[]):t.concat(o,G(o))}function we(e,t,i){return t==="viewport"?Q(function(o,s){const n=m(o),r=P(o),a=n.visualViewport;let l=r.clientWidth,d=r.clientHeight,c=0,h=0;if(a){l=a.width,d=a.height;const u=Oe();(u||!u&&s==="fixed")&&(c=a.offsetLeft,h=a.offsetTop)}return{width:l,height:d,x:c,y:h}}(e,i)):C(t)?Q(function(o,s){const n=R(o,!0,s==="fixed"),r=n.top+o.clientTop,a=n.left+o.clientLeft,l=b(o)?O(o):{x:1,y:1};return{width:o.clientWidth*l.x,height:o.clientHeight*l.y,x:a*l.x,y:r*l.y}}(t,i)):Q(function(o){const s=P(o),n=Y(o),r=o.ownerDocument.body,a=k(s.scrollWidth,s.clientWidth,r.scrollWidth,r.clientWidth),l=k(s.scrollHeight,s.clientHeight,r.scrollHeight,r.clientHeight);let d=-n.scrollLeft+Me(o);const c=-n.scrollTop;return _(r).direction==="rtl"&&(d+=k(s.clientWidth,r.clientWidth)-a),{width:a,height:l,x:d,y:c}}(P(e)))}function ye(e){return b(e)&&_(e).position!=="fixed"?e.offsetParent:null}function ve(e){const t=m(e);let i=ye(e);for(;i&&rt(i)&&_(i).position==="static";)i=ye(i);return i&&(N(i)==="html"||N(i)==="body"&&_(i).position==="static"&&!oe(i))?t:i||function(o){let s=D(o);for(;b(s)&&!de(s);){if(oe(s))return s;s=D(s)}return null}(e)||t}function at(e,t,i){const o=b(t),s=P(t),n=R(e,!0,i==="fixed",t);let r={scrollLeft:0,scrollTop:0};const a={x:0,y:0};if(o||!o&&i!=="fixed")if((N(t)!=="body"||U(s))&&(r=Y(t)),b(t)){const l=R(t,!0);a.x=l.x+t.clientLeft,a.y=l.y+t.clientTop}else s&&(a.x=Me(s));return{x:n.left+r.scrollLeft-a.x,y:n.top+r.scrollTop-a.y,width:n.width,height:n.height}}const lt={getClippingRect:function(e){let{element:t,boundary:i,rootBoundary:o,strategy:s}=e;const n=i==="clippingAncestors"?function(d,c){const h=c.get(d);if(h)return h;let u=G(d).filter(T=>C(T)&&N(T)!=="body"),y=null;const v=_(d).position==="fixed";let g=v?D(d):d;for(;C(g)&&!de(g);){const T=_(g),f=oe(g);(v?f||y:f||T.position!=="static"||!y||!["absolute","fixed"].includes(y.position))?y=T:u=u.filter($=>$!==g),g=D(g)}return c.set(d,u),u}(t,this._c):[].concat(i),r=[...n,o],a=r[0],l=r.reduce((d,c)=>{const h=we(t,c,s);return d.top=k(h.top,d.top),d.right=ge(h.right,d.right),d.bottom=ge(h.bottom,d.bottom),d.left=k(h.left,d.left),d},we(t,a,s));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:i,strategy:o}=e;const s=b(i),n=P(i);if(i===n)return t;let r={scrollLeft:0,scrollTop:0},a={x:1,y:1};const l={x:0,y:0};if((s||!s&&o!=="fixed")&&((N(i)!=="body"||U(n))&&(r=Y(i)),b(i))){const d=R(i);a=O(i),l.x=d.x+i.clientLeft,l.y=d.y+i.clientTop}return{width:t.width*a.x,height:t.height*a.y,x:t.x*a.x-r.scrollLeft*a.x+l.x,y:t.y*a.y-r.scrollTop*a.y+l.y}},isElement:C,getDimensions:function(e){return b(e)?He(e):e.getBoundingClientRect()},getOffsetParent:ve,getDocumentElement:P,getScale:O,async getElementRects(e){let{reference:t,floating:i,strategy:o}=e;const s=this.getOffsetParent||ve,n=this.getDimensions;return{reference:at(t,await s(i),o),floating:{x:0,y:0,...await n(i)}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>_(e).direction==="rtl"},dt=(e,t,i)=>{const o=new Map,s={platform:lt,...i},n={...s.platform,_c:o};return Je(e,t,{...s,platform:n})},A={disabled:!1,distance:5,skidding:0,container:"body",boundary:void 0,instantMove:!1,disposeTimeout:150,popperTriggers:[],strategy:"absolute",preventOverflow:!0,flip:!0,shift:!0,overflowPadding:0,arrowPadding:0,arrowOverflow:!0,autoHideOnMousedown:!1,themes:{tooltip:{placement:"top",triggers:["hover","focus","touch"],hideTriggers:e=>[...e,"click"],delay:{show:200,hide:0},handleResize:!1,html:!1,loadingContent:"..."},dropdown:{placement:"bottom",triggers:["click"],delay:0,handleResize:!0,autoHide:!0},menu:{$extend:"dropdown",triggers:["hover","focus"],popperTriggers:["hover"],delay:{show:0,hide:400}}}};function se(e,t){let i=A.themes[e]||{},o;do o=i[t],typeof o>"u"?i.$extend?i=A.themes[i.$extend]||{}:(i=null,o=A[t]):i=null;while(i);return o}function pt(e){const t=[e];let i=A.themes[e]||{};do i.$extend&&!i.$resetCss?(t.push(i.$extend),i=A.themes[i.$extend]||{}):i=null;while(i);return t.map(o=>`v-popper--theme-${o}`)}function $e(e){const t=[e];let i=A.themes[e]||{};do i.$extend?(t.push(i.$extend),i=A.themes[i.$extend]||{}):i=null;while(i);return t}let E=!1;if(typeof window<"u"){E=!1;try{const e=Object.defineProperty({},"passive",{get(){E=!0}});window.addEventListener("test",null,e)}catch{}}let De=!1;typeof window<"u"&&typeof navigator<"u"&&(De=/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream);const ht=["auto","top","bottom","left","right"].reduce((e,t)=>e.concat([t,`${t}-start`,`${t}-end`]),[]),_e={hover:"mouseenter",focus:"focus",click:"click",touch:"touchstart",pointer:"pointerdown"},be={hover:"mouseleave",focus:"blur",click:"click",touch:"touchend",pointer:"pointerup"};function Te(e,t){const i=e.indexOf(t);i!==-1&&e.splice(i,1)}function J(){return new Promise(e=>requestAnimationFrame(()=>{requestAnimationFrame(e)}))}const w=[];let z=null;const Se={};function xe(e){let t=Se[e];return t||(t=Se[e]=[]),t}let ne=function(){};typeof window<"u"&&(ne=window.Element);function p(e){return function(t){return se(t.theme,e)}}const ee="__floating-vue__popper",Ee=()=>X({name:"VPopper",provide(){return{[ee]:{parentPopper:this}}},inject:{[ee]:{default:null}},props:{theme:{type:String,required:!0},targetNodes:{type:Function,required:!0},referenceNode:{type:Function,default:null},popperNode:{type:Function,required:!0},shown:{type:Boolean,default:!1},showGroup:{type:String,default:null},ariaId:{default:null},disabled:{type:Boolean,default:p("disabled")},positioningDisabled:{type:Boolean,default:p("positioningDisabled")},placement:{type:String,default:p("placement"),validator:e=>ht.includes(e)},delay:{type:[String,Number,Object],default:p("delay")},distance:{type:[Number,String],default:p("distance")},skidding:{type:[Number,String],default:p("skidding")},triggers:{type:Array,default:p("triggers")},showTriggers:{type:[Array,Function],default:p("showTriggers")},hideTriggers:{type:[Array,Function],default:p("hideTriggers")},popperTriggers:{type:Array,default:p("popperTriggers")},popperShowTriggers:{type:[Array,Function],default:p("popperShowTriggers")},popperHideTriggers:{type:[Array,Function],default:p("popperHideTriggers")},container:{type:[String,Object,ne,Boolean],default:p("container")},boundary:{type:[String,ne],default:p("boundary")},strategy:{type:String,validator:e=>["absolute","fixed"].includes(e),default:p("strategy")},autoHide:{type:[Boolean,Function],default:p("autoHide")},handleResize:{type:Boolean,default:p("handleResize")},instantMove:{type:Boolean,default:p("instantMove")},eagerMount:{type:Boolean,default:p("eagerMount")},popperClass:{type:[String,Array,Object],default:p("popperClass")},computeTransformOrigin:{type:Boolean,default:p("computeTransformOrigin")},autoMinSize:{type:Boolean,default:p("autoMinSize")},autoSize:{type:[Boolean,String],default:p("autoSize")},autoMaxSize:{type:Boolean,default:p("autoMaxSize")},autoBoundaryMaxSize:{type:Boolean,default:p("autoBoundaryMaxSize")},preventOverflow:{type:Boolean,default:p("preventOverflow")},overflowPadding:{type:[Number,String],default:p("overflowPadding")},arrowPadding:{type:[Number,String],default:p("arrowPadding")},arrowOverflow:{type:Boolean,default:p("arrowOverflow")},flip:{type:Boolean,default:p("flip")},shift:{type:Boolean,default:p("shift")},shiftCrossAxis:{type:Boolean,default:p("shiftCrossAxis")},noAutoFocus:{type:Boolean,default:p("noAutoFocus")},disposeTimeout:{type:Number,default:p("disposeTimeout")}},emits:{show:()=>!0,hide:()=>!0,"update:shown":e=>!0,"apply-show":()=>!0,"apply-hide":()=>!0,"close-group":()=>!0,"close-directive":()=>!0,"auto-hide":()=>!0,resize:()=>!0},data(){return{isShown:!1,isMounted:!1,skipTransition:!1,classes:{showFrom:!1,showTo:!1,hideFrom:!1,hideTo:!0},result:{x:0,y:0,placement:"",strategy:this.strategy,arrow:{x:0,y:0,centerOffset:0},transformOrigin:null},randomId:`popper_${[Math.random(),Date.now()].map(e=>e.toString(36).substring(2,10)).join("_")}`,shownChildren:new Set,lastAutoHide:!0,pendingHide:!1,containsGlobalTarget:!1,isDisposed:!0,mouseDownContains:!1}},computed:{popperId(){return this.ariaId!=null?this.ariaId:this.randomId},shouldMountContent(){return this.eagerMount||this.isMounted},slotData(){return{popperId:this.popperId,isShown:this.isShown,shouldMountContent:this.shouldMountContent,skipTransition:this.skipTransition,autoHide:typeof this.autoHide=="function"?this.lastAutoHide:this.autoHide,show:this.show,hide:this.hide,handleResize:this.handleResize,onResize:this.onResize,classes:{...this.classes,popperClass:this.popperClass},result:this.positioningDisabled?null:this.result,attrs:this.$attrs}},parentPopper(){var e;return(e=this[ee])==null?void 0:e.parentPopper},hasPopperShowTriggerHover(){var e,t;return((e=this.popperTriggers)==null?void 0:e.includes("hover"))||((t=this.popperShowTriggers)==null?void 0:t.includes("hover"))}},watch:{shown:"$_autoShowHide",disabled(e){e?this.dispose():this.init()},async container(){this.isShown&&(this.$_ensureTeleport(),await this.$_computePosition())},triggers:{handler:"$_refreshListeners",deep:!0},positioningDisabled:"$_refreshListeners",...["placement","distance","skidding","boundary","strategy","overflowPadding","arrowPadding","preventOverflow","shift","shiftCrossAxis","flip"].reduce((e,t)=>(e[t]="$_computePosition",e),{})},created(){this.autoMinSize&&console.warn('[floating-vue] `autoMinSize` option is deprecated. Use `autoSize="min"` instead.'),this.autoMaxSize&&console.warn("[floating-vue] `autoMaxSize` option is deprecated. Use `autoBoundaryMaxSize` instead.")},mounted(){this.init(),this.$_detachPopperNode()},activated(){this.$_autoShowHide()},deactivated(){this.hide()},beforeUnmount(){this.dispose()},methods:{show({event:e=null,skipDelay:t=!1,force:i=!1}={}){var o,s;(o=this.parentPopper)!=null&&o.lockedChild&&this.parentPopper.lockedChild!==this||(this.pendingHide=!1,(i||!this.disabled)&&(((s=this.parentPopper)==null?void 0:s.lockedChild)===this&&(this.parentPopper.lockedChild=null),this.$_scheduleShow(e,t),this.$emit("show"),this.$_showFrameLocked=!0,requestAnimationFrame(()=>{this.$_showFrameLocked=!1})),this.$emit("update:shown",!0))},hide({event:e=null,skipDelay:t=!1}={}){var i;if(!this.$_hideInProgress){if(this.shownChildren.size>0){this.pendingHide=!0;return}if(this.hasPopperShowTriggerHover&&this.$_isAimingPopper()){this.parentPopper&&(this.parentPopper.lockedChild=this,clearTimeout(this.parentPopper.lockedChildTimer),this.parentPopper.lockedChildTimer=setTimeout(()=>{this.parentPopper.lockedChild===this&&(this.parentPopper.lockedChild.hide({skipDelay:t}),this.parentPopper.lockedChild=null)},1e3));return}((i=this.parentPopper)==null?void 0:i.lockedChild)===this&&(this.parentPopper.lockedChild=null),this.pendingHide=!1,this.$_scheduleHide(e,t),this.$emit("hide"),this.$emit("update:shown",!1)}},init(){var e;this.isDisposed&&(this.isDisposed=!1,this.isMounted=!1,this.$_events=[],this.$_preventShow=!1,this.$_referenceNode=((e=this.referenceNode)==null?void 0:e.call(this))??this.$el,this.$_targetNodes=this.targetNodes().filter(t=>t.nodeType===t.ELEMENT_NODE),this.$_popperNode=this.popperNode(),this.$_innerNode=this.$_popperNode.querySelector(".v-popper__inner"),this.$_arrowNode=this.$_popperNode.querySelector(".v-popper__arrow-container"),this.$_swapTargetAttrs("title","data-original-title"),this.$_detachPopperNode(),this.triggers.length&&this.$_addEventListeners(),this.shown&&this.show())},dispose(){this.isDisposed||(this.isDisposed=!0,this.$_removeEventListeners(),this.hide({skipDelay:!0}),this.$_detachPopperNode(),this.isMounted=!1,this.isShown=!1,this.$_updateParentShownChildren(!1),this.$_swapTargetAttrs("data-original-title","title"))},async onResize(){this.isShown&&(await this.$_computePosition(),this.$emit("resize"))},async $_computePosition(){if(this.isDisposed||this.positioningDisabled)return;const e={strategy:this.strategy,middleware:[]};(this.distance||this.skidding)&&e.middleware.push(et({mainAxis:this.distance,crossAxis:this.skidding}));const t=this.placement.startsWith("auto");if(t?e.middleware.push(tt({alignment:this.placement.split("-")[1]??""})):e.placement=this.placement,this.preventOverflow&&(this.shift&&e.middleware.push(it({padding:this.overflowPadding,boundary:this.boundary,crossAxis:this.shiftCrossAxis})),!t&&this.flip&&e.middleware.push(ot({padding:this.overflowPadding,boundary:this.boundary}))),e.middleware.push(st({element:this.$_arrowNode,padding:this.arrowPadding})),this.arrowOverflow&&e.middleware.push({name:"arrowOverflow",fn:({placement:o,rects:s,middlewareData:n})=>{let r;const{centerOffset:a}=n.arrow;return o.startsWith("top")||o.startsWith("bottom")?r=Math.abs(a)>s.reference.width/2:r=Math.abs(a)>s.reference.height/2,{data:{overflow:r}}}}),this.autoMinSize||this.autoSize){const o=this.autoSize?this.autoSize:this.autoMinSize?"min":null;e.middleware.push({name:"autoSize",fn:({rects:s,placement:n,middlewareData:r})=>{var a;if((a=r.autoSize)!=null&&a.skip)return{};let l,d;return n.startsWith("top")||n.startsWith("bottom")?l=s.reference.width:d=s.reference.height,this.$_innerNode.style[o==="min"?"minWidth":o==="max"?"maxWidth":"width"]=l!=null?`${l}px`:null,this.$_innerNode.style[o==="min"?"minHeight":o==="max"?"maxHeight":"height"]=d!=null?`${d}px`:null,{data:{skip:!0},reset:{rects:!0}}}})}(this.autoMaxSize||this.autoBoundaryMaxSize)&&(this.$_innerNode.style.maxWidth=null,this.$_innerNode.style.maxHeight=null,e.middleware.push(nt({boundary:this.boundary,padding:this.overflowPadding,apply:({availableWidth:o,availableHeight:s})=>{this.$_innerNode.style.maxWidth=o!=null?`${o}px`:null,this.$_innerNode.style.maxHeight=s!=null?`${s}px`:null}})));const i=await dt(this.$_referenceNode,this.$_popperNode,e);Object.assign(this.result,{x:i.x,y:i.y,placement:i.placement,strategy:i.strategy,arrow:{...i.middlewareData.arrow,...i.middlewareData.arrowOverflow}})},$_scheduleShow(e,t=!1){if(this.$_updateParentShownChildren(!0),this.$_hideInProgress=!1,clearTimeout(this.$_scheduleTimer),z&&this.instantMove&&z.instantMove&&z!==this.parentPopper){z.$_applyHide(!0),this.$_applyShow(!0);return}t?this.$_applyShow():this.$_scheduleTimer=setTimeout(this.$_applyShow.bind(this),this.$_computeDelay("show"))},$_scheduleHide(e,t=!1){if(this.shownChildren.size>0){this.pendingHide=!0;return}this.$_updateParentShownChildren(!1),this.$_hideInProgress=!0,clearTimeout(this.$_scheduleTimer),this.isShown&&(z=this),t?this.$_applyHide():this.$_scheduleTimer=setTimeout(this.$_applyHide.bind(this),this.$_computeDelay("hide"))},$_computeDelay(e){const t=this.delay;return parseInt(t&&t[e]||t||0)},async $_applyShow(e=!1){clearTimeout(this.$_disposeTimer),clearTimeout(this.$_scheduleTimer),this.skipTransition=e,!this.isShown&&(this.$_ensureTeleport(),await J(),await this.$_computePosition(),await this.$_applyShowEffect(),this.positioningDisabled||this.$_registerEventListeners([...G(this.$_referenceNode),...G(this.$_popperNode)],"scroll",()=>{this.$_computePosition()}))},async $_applyShowEffect(){if(this.$_hideInProgress)return;if(this.computeTransformOrigin){const t=this.$_referenceNode.getBoundingClientRect(),i=this.$_popperNode.querySelector(".v-popper__wrapper"),o=i.parentNode.getBoundingClientRect(),s=t.x+t.width/2-(o.left+i.offsetLeft),n=t.y+t.height/2-(o.top+i.offsetTop);this.result.transformOrigin=`${s}px ${n}px`}this.isShown=!0,this.$_applyAttrsToTarget({"aria-describedby":this.popperId,"data-popper-shown":""});const e=this.showGroup;if(e){let t;for(let i=0;i0){this.pendingHide=!0,this.$_hideInProgress=!1;return}if(clearTimeout(this.$_scheduleTimer),!this.isShown)return;this.skipTransition=e,Te(w,this),w.length===0&&document.body.classList.remove("v-popper--some-open");for(const i of $e(this.theme)){const o=xe(i);Te(o,this),o.length===0&&document.body.classList.remove(`v-popper--some-open--${i}`)}z===this&&(z=null),this.isShown=!1,this.$_applyAttrsToTarget({"aria-describedby":void 0,"data-popper-shown":void 0}),clearTimeout(this.$_disposeTimer);const t=this.disposeTimeout;t!==null&&(this.$_disposeTimer=setTimeout(()=>{this.$_popperNode&&(this.$_detachPopperNode(),this.isMounted=!1)},t)),this.$_removeEventListeners("scroll"),this.$emit("apply-hide"),this.classes.showFrom=!1,this.classes.showTo=!1,this.classes.hideFrom=!0,this.classes.hideTo=!1,await J(),this.classes.hideFrom=!1,this.classes.hideTo=!0},$_autoShowHide(){this.shown?this.show():this.hide()},$_ensureTeleport(){if(this.isDisposed)return;let e=this.container;if(typeof e=="string"?e=window.document.querySelector(e):e===!1&&(e=this.$_targetNodes[0].parentNode),!e)throw new Error("No container for popover: "+this.container);e.appendChild(this.$_popperNode),this.isMounted=!0},$_addEventListeners(){const e=i=>{this.isShown&&!this.$_hideInProgress||(i.usedByTooltip=!0,!this.$_preventShow&&this.show({event:i}))};this.$_registerTriggerListeners(this.$_targetNodes,_e,this.triggers,this.showTriggers,e),this.$_registerTriggerListeners([this.$_popperNode],_e,this.popperTriggers,this.popperShowTriggers,e);const t=i=>{i.usedByTooltip||this.hide({event:i})};this.$_registerTriggerListeners(this.$_targetNodes,be,this.triggers,this.hideTriggers,t),this.$_registerTriggerListeners([this.$_popperNode],be,this.popperTriggers,this.popperHideTriggers,t)},$_registerEventListeners(e,t,i){this.$_events.push({targetNodes:e,eventType:t,handler:i}),e.forEach(o=>o.addEventListener(t,i,E?{passive:!0}:void 0))},$_registerTriggerListeners(e,t,i,o,s){let n=i;o!=null&&(n=typeof o=="function"?o(n):o),n.forEach(r=>{const a=t[r];a&&this.$_registerEventListeners(e,a,s)})},$_removeEventListeners(e){const t=[];this.$_events.forEach(i=>{const{targetNodes:o,eventType:s,handler:n}=i;!e||e===s?o.forEach(r=>r.removeEventListener(s,n)):t.push(i)}),this.$_events=t},$_refreshListeners(){this.isDisposed||(this.$_removeEventListeners(),this.$_addEventListeners())},$_handleGlobalClose(e,t=!1){this.$_showFrameLocked||(this.hide({event:e}),e.closePopover?this.$emit("close-directive"):this.$emit("auto-hide"),t&&(this.$_preventShow=!0,setTimeout(()=>{this.$_preventShow=!1},300)))},$_detachPopperNode(){this.$_popperNode.parentNode&&this.$_popperNode.parentNode.removeChild(this.$_popperNode)},$_swapTargetAttrs(e,t){for(const i of this.$_targetNodes){const o=i.getAttribute(e);o&&(i.removeAttribute(e),i.setAttribute(t,o))}},$_applyAttrsToTarget(e){for(const t of this.$_targetNodes)for(const i in e){const o=e[i];o==null?t.removeAttribute(i):t.setAttribute(i,o)}},$_updateParentShownChildren(e){let t=this.parentPopper;for(;t;)e?t.shownChildren.add(this.randomId):(t.shownChildren.delete(this.randomId),t.pendingHide&&t.hide()),t=t.parentPopper},$_isAimingPopper(){const e=this.$_referenceNode.getBoundingClientRect();if(L>=e.left&&L<=e.right&&M>=e.top&&M<=e.bottom){const t=this.$_popperNode.getBoundingClientRect(),i=L-S,o=M-x,s=t.left+t.width/2-S+(t.top+t.height/2)-x+t.width+t.height,n=S+i*s,r=x+o*s;return W(S,x,n,r,t.left,t.top,t.left,t.bottom)||W(S,x,n,r,t.left,t.top,t.right,t.top)||W(S,x,n,r,t.right,t.top,t.right,t.bottom)||W(S,x,n,r,t.left,t.bottom,t.right,t.bottom)}return!1}},render(){return this.$slots.default(this.slotData)}});if(typeof document<"u"&&typeof window<"u"){if(De){const e=E?{passive:!0,capture:!0}:!0;document.addEventListener("touchstart",t=>Ce(t),e),document.addEventListener("touchend",t=>Pe(t,!0),e)}else window.addEventListener("mousedown",e=>Ce(e),!0),window.addEventListener("click",e=>Pe(e,!1),!0);window.addEventListener("resize",ft)}function Ce(e,t){for(let i=0;i=0;o--){const s=w[o];try{const n=s.containsGlobalTarget=s.mouseDownContains||s.popperNode().contains(e.target);s.pendingHide=!1,requestAnimationFrame(()=>{if(s.pendingHide=!1,!i[s.randomId]&&Ne(s,n,e)){if(s.$_handleGlobalClose(e,t),!e.closeAllPopover&&e.closePopover&&n){let a=s.parentPopper;for(;a;)i[a.randomId]=!0,a=a.parentPopper;return}let r=s.parentPopper;for(;r&&Ne(r,r.containsGlobalTarget,e);)r.$_handleGlobalClose(e,t),r=r.parentPopper}})}catch{}}}function Ne(e,t,i){return i.closeAllPopover||i.closePopover&&t||ct(e,i)&&!t}function ct(e,t){if(typeof e.autoHide=="function"){const i=e.autoHide(t);return e.lastAutoHide=i,i}return e.autoHide}function ft(){for(let e=0;e{S=L,x=M,L=e.clientX,M=e.clientY},E?{passive:!0}:void 0);function W(e,t,i,o,s,n,r,a){const l=((r-s)*(t-n)-(a-n)*(e-s))/((a-n)*(i-e)-(r-s)*(o-t)),d=((i-e)*(t-n)-(o-t)*(e-s))/((a-n)*(i-e)-(r-s)*(o-t));return l>=0&&l<=1&&d>=0&&d<=1}const gt={extends:Ee()},pe=(e,t)=>{const i=e.__vccOpts||e;for(const[o,s]of t)i[o]=s;return i};function mt(e,t,i,o,s,n){return B(),ie("div",{ref:"reference",class:ze(["v-popper",{"v-popper--shown":e.slotData.isShown}])},[V(e.$slots,"default",Ze(Qe(e.slotData)))],2)}const wt=pe(gt,[["render",mt]]);function yt(){var e=window.navigator.userAgent,t=e.indexOf("MSIE ");if(t>0)return parseInt(e.substring(t+5,e.indexOf(".",t)),10);var i=e.indexOf("Trident/");if(i>0){var o=e.indexOf("rv:");return parseInt(e.substring(o+3,e.indexOf(".",o)),10)}var s=e.indexOf("Edge/");return s>0?parseInt(e.substring(s+5,e.indexOf(".",s)),10):-1}let j;function re(){re.init||(re.init=!0,j=yt()!==-1)}var K={name:"ResizeObserver",props:{emitOnMount:{type:Boolean,default:!1},ignoreWidth:{type:Boolean,default:!1},ignoreHeight:{type:Boolean,default:!1}},emits:["notify"],mounted(){re(),Xe(()=>{this._w=this.$el.offsetWidth,this._h=this.$el.offsetHeight,this.emitOnMount&&this.emitSize()});const e=document.createElement("object");this._resizeObject=e,e.setAttribute("aria-hidden","true"),e.setAttribute("tabindex",-1),e.onload=this.addResizeHandlers,e.type="text/html",j&&this.$el.appendChild(e),e.data="about:blank",j||this.$el.appendChild(e)},beforeUnmount(){this.removeResizeHandlers()},methods:{compareAndNotify(){(!this.ignoreWidth&&this._w!==this.$el.offsetWidth||!this.ignoreHeight&&this._h!==this.$el.offsetHeight)&&(this._w=this.$el.offsetWidth,this._h=this.$el.offsetHeight,this.emitSize())},emitSize(){this.$emit("notify",{width:this._w,height:this._h})},addResizeHandlers(){this._resizeObject.contentDocument.defaultView.addEventListener("resize",this.compareAndNotify),this.compareAndNotify()},removeResizeHandlers(){this._resizeObject&&this._resizeObject.onload&&(!j&&this._resizeObject.contentDocument&&this._resizeObject.contentDocument.defaultView.removeEventListener("resize",this.compareAndNotify),this.$el.removeChild(this._resizeObject),this._resizeObject.onload=null,this._resizeObject=null)}}};const vt=Ue();je("data-v-b329ee4c");const $t={class:"resize-observer",tabindex:"-1"};Ve();const _t=vt((e,t,i,o,s,n)=>(B(),le("div",$t)));K.render=_t;K.__scopeId="data-v-b329ee4c";K.__file="src/components/ResizeObserver.vue";const Fe=(e="theme")=>({computed:{themeClass(){return pt(this[e])}}}),bt=X({name:"VPopperContent",components:{ResizeObserver:K},mixins:[Fe()],props:{popperId:String,theme:String,shown:Boolean,mounted:Boolean,skipTransition:Boolean,autoHide:Boolean,handleResize:Boolean,classes:Object,result:Object},emits:["hide","resize"],methods:{toPx(e){return e!=null&&!isNaN(e)?`${e}px`:null}}}),Tt=["id","aria-hidden","tabindex","data-popper-placement"],St={ref:"inner",class:"v-popper__inner"},xt=H("div",{class:"v-popper__arrow-outer"},null,-1),Ct=H("div",{class:"v-popper__arrow-inner"},null,-1),Pt=[xt,Ct];function Nt(e,t,i,o,s,n){const r=te("ResizeObserver");return B(),ie("div",{id:e.popperId,ref:"popover",class:ze(["v-popper__popper",[e.themeClass,e.classes.popperClass,{"v-popper__popper--shown":e.shown,"v-popper__popper--hidden":!e.shown,"v-popper__popper--show-from":e.classes.showFrom,"v-popper__popper--show-to":e.classes.showTo,"v-popper__popper--hide-from":e.classes.hideFrom,"v-popper__popper--hide-to":e.classes.hideTo,"v-popper__popper--skip-transition":e.skipTransition,"v-popper__popper--arrow-overflow":e.result&&e.result.arrow.overflow,"v-popper__popper--no-positioning":!e.result}]]),style:Z(e.result?{position:e.result.strategy,transform:`translate3d(${Math.round(e.result.x)}px,${Math.round(e.result.y)}px,0)`}:void 0),"aria-hidden":e.shown?"false":"true",tabindex:e.autoHide?0:void 0,"data-popper-placement":e.result?e.result.placement:void 0,onKeyup:t[2]||(t[2]=Ge(a=>e.autoHide&&e.$emit("hide"),["esc"]))},[H("div",{class:"v-popper__backdrop",onClick:t[0]||(t[0]=a=>e.autoHide&&e.$emit("hide"))}),H("div",{class:"v-popper__wrapper",style:Z(e.result?{transformOrigin:e.result.transformOrigin}:void 0)},[H("div",St,[e.mounted?(B(),ie(qe,{key:0},[H("div",null,[V(e.$slots,"default")]),e.handleResize?(B(),le(r,{key:0,onNotify:t[1]||(t[1]=a=>e.$emit("resize",a))})):ce("",!0)],64)):ce("",!0)],512),H("div",{ref:"arrow",class:"v-popper__arrow-container",style:Z(e.result?{left:e.toPx(e.result.arrow.x),top:e.toPx(e.result.arrow.y)}:void 0)},Pt,4)],4)],46,Tt)}const Ie=pe(bt,[["render",Nt]]),We={methods:{show(...e){return this.$refs.popper.show(...e)},hide(...e){return this.$refs.popper.hide(...e)},dispose(...e){return this.$refs.popper.dispose(...e)},onResize(...e){return this.$refs.popper.onResize(...e)}}};let ae=function(){};typeof window<"u"&&(ae=window.Element);const zt=X({name:"VPopperWrapper",components:{Popper:wt,PopperContent:Ie},mixins:[We,Fe("finalTheme")],props:{theme:{type:String,default:null},referenceNode:{type:Function,default:null},shown:{type:Boolean,default:!1},showGroup:{type:String,default:null},ariaId:{default:null},disabled:{type:Boolean,default:void 0},positioningDisabled:{type:Boolean,default:void 0},placement:{type:String,default:void 0},delay:{type:[String,Number,Object],default:void 0},distance:{type:[Number,String],default:void 0},skidding:{type:[Number,String],default:void 0},triggers:{type:Array,default:void 0},showTriggers:{type:[Array,Function],default:void 0},hideTriggers:{type:[Array,Function],default:void 0},popperTriggers:{type:Array,default:void 0},popperShowTriggers:{type:[Array,Function],default:void 0},popperHideTriggers:{type:[Array,Function],default:void 0},container:{type:[String,Object,ae,Boolean],default:void 0},boundary:{type:[String,ae],default:void 0},strategy:{type:String,default:void 0},autoHide:{type:[Boolean,Function],default:void 0},handleResize:{type:Boolean,default:void 0},instantMove:{type:Boolean,default:void 0},eagerMount:{type:Boolean,default:void 0},popperClass:{type:[String,Array,Object],default:void 0},computeTransformOrigin:{type:Boolean,default:void 0},autoMinSize:{type:Boolean,default:void 0},autoSize:{type:[Boolean,String],default:void 0},autoMaxSize:{type:Boolean,default:void 0},autoBoundaryMaxSize:{type:Boolean,default:void 0},preventOverflow:{type:Boolean,default:void 0},overflowPadding:{type:[Number,String],default:void 0},arrowPadding:{type:[Number,String],default:void 0},arrowOverflow:{type:Boolean,default:void 0},flip:{type:Boolean,default:void 0},shift:{type:Boolean,default:void 0},shiftCrossAxis:{type:Boolean,default:void 0},noAutoFocus:{type:Boolean,default:void 0},disposeTimeout:{type:Number,default:void 0}},emits:{show:()=>!0,hide:()=>!0,"update:shown":e=>!0,"apply-show":()=>!0,"apply-hide":()=>!0,"close-group":()=>!0,"close-directive":()=>!0,"auto-hide":()=>!0,resize:()=>!0},computed:{finalTheme(){return this.theme??this.$options.vPopperTheme}},methods:{getTargetNodes(){return Array.from(this.$el.children).filter(e=>e!==this.$refs.popperContent.$el)}}});function Ht(e,t,i,o,s,n){const r=te("PopperContent"),a=te("Popper");return B(),le(a,Ke({ref:"popper"},e.$props,{theme:e.finalTheme,"target-nodes":e.getTargetNodes,"popper-node":()=>e.$refs.popperContent.$el,class:[e.themeClass],onShow:t[0]||(t[0]=()=>e.$emit("show")),onHide:t[1]||(t[1]=()=>e.$emit("hide")),"onUpdate:shown":t[2]||(t[2]=l=>e.$emit("update:shown",l)),onApplyShow:t[3]||(t[3]=()=>e.$emit("apply-show")),onApplyHide:t[4]||(t[4]=()=>e.$emit("apply-hide")),onCloseGroup:t[5]||(t[5]=()=>e.$emit("close-group")),onCloseDirective:t[6]||(t[6]=()=>e.$emit("close-directive")),onAutoHide:t[7]||(t[7]=()=>e.$emit("auto-hide")),onResize:t[8]||(t[8]=()=>e.$emit("resize"))}),{default:fe(({popperId:l,isShown:d,shouldMountContent:c,skipTransition:h,autoHide:u,show:y,hide:v,handleResize:g,onResize:T,classes:f,result:$})=>[V(e.$slots,"default",{shown:d,show:y,hide:v}),Ye(r,{ref:"popperContent","popper-id":l,theme:e.finalTheme,shown:d,mounted:c,"skip-transition":h,"auto-hide":u,"handle-resize":g,classes:f,result:$,onHide:v,onResize:T},{default:fe(()=>[V(e.$slots,"popper",{shown:d,hide:v})]),_:2},1032,["popper-id","theme","shown","mounted","skip-transition","auto-hide","handle-resize","classes","result","onHide","onResize"])]),_:3},16,["theme","target-nodes","popper-node","class"])}const he=pe(zt,[["render",Ht]]),At={...he,name:"VDropdown",vPopperTheme:"dropdown"};({...he});({...he});X({name:"VTooltipDirective",components:{Popper:Ee(),PopperContent:Ie},mixins:[We],inheritAttrs:!1,props:{theme:{type:String,default:"tooltip"},html:{type:Boolean,default:e=>se(e.theme,"html")},content:{type:[String,Number,Function],default:null},loadingContent:{type:String,default:e=>se(e.theme,"loadingContent")},targetNodes:{type:Function,required:!0}},data(){return{asyncContent:null}},computed:{isContentAsync(){return typeof this.content=="function"},loading(){return this.isContentAsync&&this.asyncContent==null},finalContent(){return this.isContentAsync?this.loading?this.loadingContent:this.asyncContent:this.content}},watch:{content:{handler(){this.fetchContent(!0)},immediate:!0},async finalContent(){await this.$nextTick(),this.$refs.popper.onResize()}},created(){this.$_fetchId=0},methods:{fetchContent(e){if(typeof this.content=="function"&&this.$_isShown&&(e||!this.$_loading&&this.asyncContent==null)){this.asyncContent=null,this.$_loading=!0;const t=++this.$_fetchId,i=this.content(this);i.then?i.then(o=>this.onResult(t,o)):this.onResult(t,i)}},onResult(e,t){e===this.$_fetchId&&(this.$_loading=!1,this.asyncContent=t)},onShow(){this.$_isShown=!0,this.fetchContent()},onHide(){this.$_isShown=!1}}});const kt=At;export{kt as k}; +import{d as X,cX as je,cY as Ve,a2 as te,c as ie,o as B,a as H,W as ce,c6 as qe,bk as le,bh as V,a3 as Z,cZ as Ge,X as ze,_ as Xe,c_ as Ue,bl as fe,b as Ye,ch as Ke,ct as Ze,cu as Qe}from"./index-B06xwjXa.js";import{c as Je,r as Q,o as et,j as tt,s as it,f as ot,d as st,a as nt}from"./floating-ui.core-CgBsuaUc.js";function m(e){var t;return((t=e.ownerDocument)==null?void 0:t.defaultView)||window}function _(e){return m(e).getComputedStyle(e)}const ge=Math.min,O=Math.max,q=Math.round;function He(e){const t=_(e);let i=parseFloat(t.width),o=parseFloat(t.height);const s=e.offsetWidth,n=e.offsetHeight,r=q(i)!==s||q(o)!==n;return r&&(i=s,o=n),{width:i,height:o,fallback:r}}function N(e){return Be(e)?(e.nodeName||"").toLowerCase():""}let I;function Ae(){if(I)return I;const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?(I=e.brands.map(t=>t.brand+"/"+t.version).join(" "),I):navigator.userAgent}function b(e){return e instanceof m(e).HTMLElement}function C(e){return e instanceof m(e).Element}function Be(e){return e instanceof m(e).Node}function me(e){return typeof ShadowRoot>"u"?!1:e instanceof m(e).ShadowRoot||e instanceof ShadowRoot}function U(e){const{overflow:t,overflowX:i,overflowY:o,display:s}=_(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+i)&&!["inline","contents"].includes(s)}function rt(e){return["table","td","th"].includes(N(e))}function oe(e){const t=/firefox/i.test(Ae()),i=_(e),o=i.backdropFilter||i.WebkitBackdropFilter;return i.transform!=="none"||i.perspective!=="none"||!!o&&o!=="none"||t&&i.willChange==="filter"||t&&!!i.filter&&i.filter!=="none"||["transform","perspective"].some(s=>i.willChange.includes(s))||["paint","layout","strict","content"].some(s=>{const n=i.contain;return n!=null&&n.includes(s)})}function ke(){return!/^((?!chrome|android).)*safari/i.test(Ae())}function de(e){return["html","body","#document"].includes(N(e))}function Oe(e){return C(e)?e:e.contextElement}const Le={x:1,y:1};function k(e){const t=Oe(e);if(!b(t))return Le;const i=t.getBoundingClientRect(),{width:o,height:s,fallback:n}=He(t);let r=(n?q(i.width):i.width)/o,a=(n?q(i.height):i.height)/s;return r&&Number.isFinite(r)||(r=1),a&&Number.isFinite(a)||(a=1),{x:r,y:a}}function R(e,t,i,o){var s,n;t===void 0&&(t=!1),i===void 0&&(i=!1);const r=e.getBoundingClientRect(),a=Oe(e);let l=Le;t&&(o?C(o)&&(l=k(o)):l=k(e));const d=a?m(a):window,c=!ke()&&i;let h=(r.left+(c&&((s=d.visualViewport)==null?void 0:s.offsetLeft)||0))/l.x,u=(r.top+(c&&((n=d.visualViewport)==null?void 0:n.offsetTop)||0))/l.y,y=r.width/l.x,v=r.height/l.y;if(a){const g=m(a),T=o&&C(o)?m(o):o;let f=g.frameElement;for(;f&&o&&T!==g;){const $=k(f),F=f.getBoundingClientRect(),ue=getComputedStyle(f);F.x+=(f.clientLeft+parseFloat(ue.paddingLeft))*$.x,F.y+=(f.clientTop+parseFloat(ue.paddingTop))*$.y,h*=$.x,u*=$.y,y*=$.x,v*=$.y,h+=F.x,u+=F.y,f=m(f).frameElement}}return{width:y,height:v,top:u,right:h+y,bottom:u+v,left:h,x:h,y:u}}function P(e){return((Be(e)?e.ownerDocument:e.document)||window.document).documentElement}function Y(e){return C(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Me(e){return R(P(e)).left+Y(e).scrollLeft}function D(e){if(N(e)==="html")return e;const t=e.assignedSlot||e.parentNode||me(e)&&e.host||P(e);return me(t)?t.host:t}function Re(e){const t=D(e);return de(t)?t.ownerDocument.body:b(t)&&U(t)?t:Re(t)}function G(e,t){var i;t===void 0&&(t=[]);const o=Re(e),s=o===((i=e.ownerDocument)==null?void 0:i.body),n=m(o);return s?t.concat(n,n.visualViewport||[],U(o)?o:[]):t.concat(o,G(o))}function we(e,t,i){return t==="viewport"?Q(function(o,s){const n=m(o),r=P(o),a=n.visualViewport;let l=r.clientWidth,d=r.clientHeight,c=0,h=0;if(a){l=a.width,d=a.height;const u=ke();(u||!u&&s==="fixed")&&(c=a.offsetLeft,h=a.offsetTop)}return{width:l,height:d,x:c,y:h}}(e,i)):C(t)?Q(function(o,s){const n=R(o,!0,s==="fixed"),r=n.top+o.clientTop,a=n.left+o.clientLeft,l=b(o)?k(o):{x:1,y:1};return{width:o.clientWidth*l.x,height:o.clientHeight*l.y,x:a*l.x,y:r*l.y}}(t,i)):Q(function(o){const s=P(o),n=Y(o),r=o.ownerDocument.body,a=O(s.scrollWidth,s.clientWidth,r.scrollWidth,r.clientWidth),l=O(s.scrollHeight,s.clientHeight,r.scrollHeight,r.clientHeight);let d=-n.scrollLeft+Me(o);const c=-n.scrollTop;return _(r).direction==="rtl"&&(d+=O(s.clientWidth,r.clientWidth)-a),{width:a,height:l,x:d,y:c}}(P(e)))}function ye(e){return b(e)&&_(e).position!=="fixed"?e.offsetParent:null}function ve(e){const t=m(e);let i=ye(e);for(;i&&rt(i)&&_(i).position==="static";)i=ye(i);return i&&(N(i)==="html"||N(i)==="body"&&_(i).position==="static"&&!oe(i))?t:i||function(o){let s=D(o);for(;b(s)&&!de(s);){if(oe(s))return s;s=D(s)}return null}(e)||t}function at(e,t,i){const o=b(t),s=P(t),n=R(e,!0,i==="fixed",t);let r={scrollLeft:0,scrollTop:0};const a={x:0,y:0};if(o||!o&&i!=="fixed")if((N(t)!=="body"||U(s))&&(r=Y(t)),b(t)){const l=R(t,!0);a.x=l.x+t.clientLeft,a.y=l.y+t.clientTop}else s&&(a.x=Me(s));return{x:n.left+r.scrollLeft-a.x,y:n.top+r.scrollTop-a.y,width:n.width,height:n.height}}const lt={getClippingRect:function(e){let{element:t,boundary:i,rootBoundary:o,strategy:s}=e;const n=i==="clippingAncestors"?function(d,c){const h=c.get(d);if(h)return h;let u=G(d).filter(T=>C(T)&&N(T)!=="body"),y=null;const v=_(d).position==="fixed";let g=v?D(d):d;for(;C(g)&&!de(g);){const T=_(g),f=oe(g);(v?f||y:f||T.position!=="static"||!y||!["absolute","fixed"].includes(y.position))?y=T:u=u.filter($=>$!==g),g=D(g)}return c.set(d,u),u}(t,this._c):[].concat(i),r=[...n,o],a=r[0],l=r.reduce((d,c)=>{const h=we(t,c,s);return d.top=O(h.top,d.top),d.right=ge(h.right,d.right),d.bottom=ge(h.bottom,d.bottom),d.left=O(h.left,d.left),d},we(t,a,s));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:i,strategy:o}=e;const s=b(i),n=P(i);if(i===n)return t;let r={scrollLeft:0,scrollTop:0},a={x:1,y:1};const l={x:0,y:0};if((s||!s&&o!=="fixed")&&((N(i)!=="body"||U(n))&&(r=Y(i)),b(i))){const d=R(i);a=k(i),l.x=d.x+i.clientLeft,l.y=d.y+i.clientTop}return{width:t.width*a.x,height:t.height*a.y,x:t.x*a.x-r.scrollLeft*a.x+l.x,y:t.y*a.y-r.scrollTop*a.y+l.y}},isElement:C,getDimensions:function(e){return b(e)?He(e):e.getBoundingClientRect()},getOffsetParent:ve,getDocumentElement:P,getScale:k,async getElementRects(e){let{reference:t,floating:i,strategy:o}=e;const s=this.getOffsetParent||ve,n=this.getDimensions;return{reference:at(t,await s(i),o),floating:{x:0,y:0,...await n(i)}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>_(e).direction==="rtl"},dt=(e,t,i)=>{const o=new Map,s={platform:lt,...i},n={...s.platform,_c:o};return Je(e,t,{...s,platform:n})},A={disabled:!1,distance:5,skidding:0,container:"body",boundary:void 0,instantMove:!1,disposeTimeout:150,popperTriggers:[],strategy:"absolute",preventOverflow:!0,flip:!0,shift:!0,overflowPadding:0,arrowPadding:0,arrowOverflow:!0,autoHideOnMousedown:!1,themes:{tooltip:{placement:"top",triggers:["hover","focus","touch"],hideTriggers:e=>[...e,"click"],delay:{show:200,hide:0},handleResize:!1,html:!1,loadingContent:"..."},dropdown:{placement:"bottom",triggers:["click"],delay:0,handleResize:!0,autoHide:!0},menu:{$extend:"dropdown",triggers:["hover","focus"],popperTriggers:["hover"],delay:{show:0,hide:400}}}};function se(e,t){let i=A.themes[e]||{},o;do o=i[t],typeof o>"u"?i.$extend?i=A.themes[i.$extend]||{}:(i=null,o=A[t]):i=null;while(i);return o}function pt(e){const t=[e];let i=A.themes[e]||{};do i.$extend&&!i.$resetCss?(t.push(i.$extend),i=A.themes[i.$extend]||{}):i=null;while(i);return t.map(o=>`v-popper--theme-${o}`)}function $e(e){const t=[e];let i=A.themes[e]||{};do i.$extend?(t.push(i.$extend),i=A.themes[i.$extend]||{}):i=null;while(i);return t}let E=!1;if(typeof window<"u"){E=!1;try{const e=Object.defineProperty({},"passive",{get(){E=!0}});window.addEventListener("test",null,e)}catch{}}let De=!1;typeof window<"u"&&typeof navigator<"u"&&(De=/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream);const ht=["auto","top","bottom","left","right"].reduce((e,t)=>e.concat([t,`${t}-start`,`${t}-end`]),[]),_e={hover:"mouseenter",focus:"focus",click:"click",touch:"touchstart",pointer:"pointerdown"},be={hover:"mouseleave",focus:"blur",click:"click",touch:"touchend",pointer:"pointerup"};function Te(e,t){const i=e.indexOf(t);i!==-1&&e.splice(i,1)}function J(){return new Promise(e=>requestAnimationFrame(()=>{requestAnimationFrame(e)}))}const w=[];let z=null;const Se={};function xe(e){let t=Se[e];return t||(t=Se[e]=[]),t}let ne=function(){};typeof window<"u"&&(ne=window.Element);function p(e){return function(t){return se(t.theme,e)}}const ee="__floating-vue__popper",Ee=()=>X({name:"VPopper",provide(){return{[ee]:{parentPopper:this}}},inject:{[ee]:{default:null}},props:{theme:{type:String,required:!0},targetNodes:{type:Function,required:!0},referenceNode:{type:Function,default:null},popperNode:{type:Function,required:!0},shown:{type:Boolean,default:!1},showGroup:{type:String,default:null},ariaId:{default:null},disabled:{type:Boolean,default:p("disabled")},positioningDisabled:{type:Boolean,default:p("positioningDisabled")},placement:{type:String,default:p("placement"),validator:e=>ht.includes(e)},delay:{type:[String,Number,Object],default:p("delay")},distance:{type:[Number,String],default:p("distance")},skidding:{type:[Number,String],default:p("skidding")},triggers:{type:Array,default:p("triggers")},showTriggers:{type:[Array,Function],default:p("showTriggers")},hideTriggers:{type:[Array,Function],default:p("hideTriggers")},popperTriggers:{type:Array,default:p("popperTriggers")},popperShowTriggers:{type:[Array,Function],default:p("popperShowTriggers")},popperHideTriggers:{type:[Array,Function],default:p("popperHideTriggers")},container:{type:[String,Object,ne,Boolean],default:p("container")},boundary:{type:[String,ne],default:p("boundary")},strategy:{type:String,validator:e=>["absolute","fixed"].includes(e),default:p("strategy")},autoHide:{type:[Boolean,Function],default:p("autoHide")},handleResize:{type:Boolean,default:p("handleResize")},instantMove:{type:Boolean,default:p("instantMove")},eagerMount:{type:Boolean,default:p("eagerMount")},popperClass:{type:[String,Array,Object],default:p("popperClass")},computeTransformOrigin:{type:Boolean,default:p("computeTransformOrigin")},autoMinSize:{type:Boolean,default:p("autoMinSize")},autoSize:{type:[Boolean,String],default:p("autoSize")},autoMaxSize:{type:Boolean,default:p("autoMaxSize")},autoBoundaryMaxSize:{type:Boolean,default:p("autoBoundaryMaxSize")},preventOverflow:{type:Boolean,default:p("preventOverflow")},overflowPadding:{type:[Number,String],default:p("overflowPadding")},arrowPadding:{type:[Number,String],default:p("arrowPadding")},arrowOverflow:{type:Boolean,default:p("arrowOverflow")},flip:{type:Boolean,default:p("flip")},shift:{type:Boolean,default:p("shift")},shiftCrossAxis:{type:Boolean,default:p("shiftCrossAxis")},noAutoFocus:{type:Boolean,default:p("noAutoFocus")},disposeTimeout:{type:Number,default:p("disposeTimeout")}},emits:{show:()=>!0,hide:()=>!0,"update:shown":e=>!0,"apply-show":()=>!0,"apply-hide":()=>!0,"close-group":()=>!0,"close-directive":()=>!0,"auto-hide":()=>!0,resize:()=>!0},data(){return{isShown:!1,isMounted:!1,skipTransition:!1,classes:{showFrom:!1,showTo:!1,hideFrom:!1,hideTo:!0},result:{x:0,y:0,placement:"",strategy:this.strategy,arrow:{x:0,y:0,centerOffset:0},transformOrigin:null},randomId:`popper_${[Math.random(),Date.now()].map(e=>e.toString(36).substring(2,10)).join("_")}`,shownChildren:new Set,lastAutoHide:!0,pendingHide:!1,containsGlobalTarget:!1,isDisposed:!0,mouseDownContains:!1}},computed:{popperId(){return this.ariaId!=null?this.ariaId:this.randomId},shouldMountContent(){return this.eagerMount||this.isMounted},slotData(){return{popperId:this.popperId,isShown:this.isShown,shouldMountContent:this.shouldMountContent,skipTransition:this.skipTransition,autoHide:typeof this.autoHide=="function"?this.lastAutoHide:this.autoHide,show:this.show,hide:this.hide,handleResize:this.handleResize,onResize:this.onResize,classes:{...this.classes,popperClass:this.popperClass},result:this.positioningDisabled?null:this.result,attrs:this.$attrs}},parentPopper(){var e;return(e=this[ee])==null?void 0:e.parentPopper},hasPopperShowTriggerHover(){var e,t;return((e=this.popperTriggers)==null?void 0:e.includes("hover"))||((t=this.popperShowTriggers)==null?void 0:t.includes("hover"))}},watch:{shown:"$_autoShowHide",disabled(e){e?this.dispose():this.init()},async container(){this.isShown&&(this.$_ensureTeleport(),await this.$_computePosition())},triggers:{handler:"$_refreshListeners",deep:!0},positioningDisabled:"$_refreshListeners",...["placement","distance","skidding","boundary","strategy","overflowPadding","arrowPadding","preventOverflow","shift","shiftCrossAxis","flip"].reduce((e,t)=>(e[t]="$_computePosition",e),{})},created(){this.autoMinSize&&console.warn('[floating-vue] `autoMinSize` option is deprecated. Use `autoSize="min"` instead.'),this.autoMaxSize&&console.warn("[floating-vue] `autoMaxSize` option is deprecated. Use `autoBoundaryMaxSize` instead.")},mounted(){this.init(),this.$_detachPopperNode()},activated(){this.$_autoShowHide()},deactivated(){this.hide()},beforeUnmount(){this.dispose()},methods:{show({event:e=null,skipDelay:t=!1,force:i=!1}={}){var o,s;(o=this.parentPopper)!=null&&o.lockedChild&&this.parentPopper.lockedChild!==this||(this.pendingHide=!1,(i||!this.disabled)&&(((s=this.parentPopper)==null?void 0:s.lockedChild)===this&&(this.parentPopper.lockedChild=null),this.$_scheduleShow(e,t),this.$emit("show"),this.$_showFrameLocked=!0,requestAnimationFrame(()=>{this.$_showFrameLocked=!1})),this.$emit("update:shown",!0))},hide({event:e=null,skipDelay:t=!1}={}){var i;if(!this.$_hideInProgress){if(this.shownChildren.size>0){this.pendingHide=!0;return}if(this.hasPopperShowTriggerHover&&this.$_isAimingPopper()){this.parentPopper&&(this.parentPopper.lockedChild=this,clearTimeout(this.parentPopper.lockedChildTimer),this.parentPopper.lockedChildTimer=setTimeout(()=>{this.parentPopper.lockedChild===this&&(this.parentPopper.lockedChild.hide({skipDelay:t}),this.parentPopper.lockedChild=null)},1e3));return}((i=this.parentPopper)==null?void 0:i.lockedChild)===this&&(this.parentPopper.lockedChild=null),this.pendingHide=!1,this.$_scheduleHide(e,t),this.$emit("hide"),this.$emit("update:shown",!1)}},init(){var e;this.isDisposed&&(this.isDisposed=!1,this.isMounted=!1,this.$_events=[],this.$_preventShow=!1,this.$_referenceNode=((e=this.referenceNode)==null?void 0:e.call(this))??this.$el,this.$_targetNodes=this.targetNodes().filter(t=>t.nodeType===t.ELEMENT_NODE),this.$_popperNode=this.popperNode(),this.$_innerNode=this.$_popperNode.querySelector(".v-popper__inner"),this.$_arrowNode=this.$_popperNode.querySelector(".v-popper__arrow-container"),this.$_swapTargetAttrs("title","data-original-title"),this.$_detachPopperNode(),this.triggers.length&&this.$_addEventListeners(),this.shown&&this.show())},dispose(){this.isDisposed||(this.isDisposed=!0,this.$_removeEventListeners(),this.hide({skipDelay:!0}),this.$_detachPopperNode(),this.isMounted=!1,this.isShown=!1,this.$_updateParentShownChildren(!1),this.$_swapTargetAttrs("data-original-title","title"))},async onResize(){this.isShown&&(await this.$_computePosition(),this.$emit("resize"))},async $_computePosition(){if(this.isDisposed||this.positioningDisabled)return;const e={strategy:this.strategy,middleware:[]};(this.distance||this.skidding)&&e.middleware.push(et({mainAxis:this.distance,crossAxis:this.skidding}));const t=this.placement.startsWith("auto");if(t?e.middleware.push(tt({alignment:this.placement.split("-")[1]??""})):e.placement=this.placement,this.preventOverflow&&(this.shift&&e.middleware.push(it({padding:this.overflowPadding,boundary:this.boundary,crossAxis:this.shiftCrossAxis})),!t&&this.flip&&e.middleware.push(ot({padding:this.overflowPadding,boundary:this.boundary}))),e.middleware.push(st({element:this.$_arrowNode,padding:this.arrowPadding})),this.arrowOverflow&&e.middleware.push({name:"arrowOverflow",fn:({placement:o,rects:s,middlewareData:n})=>{let r;const{centerOffset:a}=n.arrow;return o.startsWith("top")||o.startsWith("bottom")?r=Math.abs(a)>s.reference.width/2:r=Math.abs(a)>s.reference.height/2,{data:{overflow:r}}}}),this.autoMinSize||this.autoSize){const o=this.autoSize?this.autoSize:this.autoMinSize?"min":null;e.middleware.push({name:"autoSize",fn:({rects:s,placement:n,middlewareData:r})=>{var a;if((a=r.autoSize)!=null&&a.skip)return{};let l,d;return n.startsWith("top")||n.startsWith("bottom")?l=s.reference.width:d=s.reference.height,this.$_innerNode.style[o==="min"?"minWidth":o==="max"?"maxWidth":"width"]=l!=null?`${l}px`:null,this.$_innerNode.style[o==="min"?"minHeight":o==="max"?"maxHeight":"height"]=d!=null?`${d}px`:null,{data:{skip:!0},reset:{rects:!0}}}})}(this.autoMaxSize||this.autoBoundaryMaxSize)&&(this.$_innerNode.style.maxWidth=null,this.$_innerNode.style.maxHeight=null,e.middleware.push(nt({boundary:this.boundary,padding:this.overflowPadding,apply:({availableWidth:o,availableHeight:s})=>{this.$_innerNode.style.maxWidth=o!=null?`${o}px`:null,this.$_innerNode.style.maxHeight=s!=null?`${s}px`:null}})));const i=await dt(this.$_referenceNode,this.$_popperNode,e);Object.assign(this.result,{x:i.x,y:i.y,placement:i.placement,strategy:i.strategy,arrow:{...i.middlewareData.arrow,...i.middlewareData.arrowOverflow}})},$_scheduleShow(e,t=!1){if(this.$_updateParentShownChildren(!0),this.$_hideInProgress=!1,clearTimeout(this.$_scheduleTimer),z&&this.instantMove&&z.instantMove&&z!==this.parentPopper){z.$_applyHide(!0),this.$_applyShow(!0);return}t?this.$_applyShow():this.$_scheduleTimer=setTimeout(this.$_applyShow.bind(this),this.$_computeDelay("show"))},$_scheduleHide(e,t=!1){if(this.shownChildren.size>0){this.pendingHide=!0;return}this.$_updateParentShownChildren(!1),this.$_hideInProgress=!0,clearTimeout(this.$_scheduleTimer),this.isShown&&(z=this),t?this.$_applyHide():this.$_scheduleTimer=setTimeout(this.$_applyHide.bind(this),this.$_computeDelay("hide"))},$_computeDelay(e){const t=this.delay;return parseInt(t&&t[e]||t||0)},async $_applyShow(e=!1){clearTimeout(this.$_disposeTimer),clearTimeout(this.$_scheduleTimer),this.skipTransition=e,!this.isShown&&(this.$_ensureTeleport(),await J(),await this.$_computePosition(),await this.$_applyShowEffect(),this.positioningDisabled||this.$_registerEventListeners([...G(this.$_referenceNode),...G(this.$_popperNode)],"scroll",()=>{this.$_computePosition()}))},async $_applyShowEffect(){if(this.$_hideInProgress)return;if(this.computeTransformOrigin){const t=this.$_referenceNode.getBoundingClientRect(),i=this.$_popperNode.querySelector(".v-popper__wrapper"),o=i.parentNode.getBoundingClientRect(),s=t.x+t.width/2-(o.left+i.offsetLeft),n=t.y+t.height/2-(o.top+i.offsetTop);this.result.transformOrigin=`${s}px ${n}px`}this.isShown=!0,this.$_applyAttrsToTarget({"aria-describedby":this.popperId,"data-popper-shown":""});const e=this.showGroup;if(e){let t;for(let i=0;i0){this.pendingHide=!0,this.$_hideInProgress=!1;return}if(clearTimeout(this.$_scheduleTimer),!this.isShown)return;this.skipTransition=e,Te(w,this),w.length===0&&document.body.classList.remove("v-popper--some-open");for(const i of $e(this.theme)){const o=xe(i);Te(o,this),o.length===0&&document.body.classList.remove(`v-popper--some-open--${i}`)}z===this&&(z=null),this.isShown=!1,this.$_applyAttrsToTarget({"aria-describedby":void 0,"data-popper-shown":void 0}),clearTimeout(this.$_disposeTimer);const t=this.disposeTimeout;t!==null&&(this.$_disposeTimer=setTimeout(()=>{this.$_popperNode&&(this.$_detachPopperNode(),this.isMounted=!1)},t)),this.$_removeEventListeners("scroll"),this.$emit("apply-hide"),this.classes.showFrom=!1,this.classes.showTo=!1,this.classes.hideFrom=!0,this.classes.hideTo=!1,await J(),this.classes.hideFrom=!1,this.classes.hideTo=!0},$_autoShowHide(){this.shown?this.show():this.hide()},$_ensureTeleport(){if(this.isDisposed)return;let e=this.container;if(typeof e=="string"?e=window.document.querySelector(e):e===!1&&(e=this.$_targetNodes[0].parentNode),!e)throw new Error("No container for popover: "+this.container);e.appendChild(this.$_popperNode),this.isMounted=!0},$_addEventListeners(){const e=i=>{this.isShown&&!this.$_hideInProgress||(i.usedByTooltip=!0,!this.$_preventShow&&this.show({event:i}))};this.$_registerTriggerListeners(this.$_targetNodes,_e,this.triggers,this.showTriggers,e),this.$_registerTriggerListeners([this.$_popperNode],_e,this.popperTriggers,this.popperShowTriggers,e);const t=i=>{i.usedByTooltip||this.hide({event:i})};this.$_registerTriggerListeners(this.$_targetNodes,be,this.triggers,this.hideTriggers,t),this.$_registerTriggerListeners([this.$_popperNode],be,this.popperTriggers,this.popperHideTriggers,t)},$_registerEventListeners(e,t,i){this.$_events.push({targetNodes:e,eventType:t,handler:i}),e.forEach(o=>o.addEventListener(t,i,E?{passive:!0}:void 0))},$_registerTriggerListeners(e,t,i,o,s){let n=i;o!=null&&(n=typeof o=="function"?o(n):o),n.forEach(r=>{const a=t[r];a&&this.$_registerEventListeners(e,a,s)})},$_removeEventListeners(e){const t=[];this.$_events.forEach(i=>{const{targetNodes:o,eventType:s,handler:n}=i;!e||e===s?o.forEach(r=>r.removeEventListener(s,n)):t.push(i)}),this.$_events=t},$_refreshListeners(){this.isDisposed||(this.$_removeEventListeners(),this.$_addEventListeners())},$_handleGlobalClose(e,t=!1){this.$_showFrameLocked||(this.hide({event:e}),e.closePopover?this.$emit("close-directive"):this.$emit("auto-hide"),t&&(this.$_preventShow=!0,setTimeout(()=>{this.$_preventShow=!1},300)))},$_detachPopperNode(){this.$_popperNode.parentNode&&this.$_popperNode.parentNode.removeChild(this.$_popperNode)},$_swapTargetAttrs(e,t){for(const i of this.$_targetNodes){const o=i.getAttribute(e);o&&(i.removeAttribute(e),i.setAttribute(t,o))}},$_applyAttrsToTarget(e){for(const t of this.$_targetNodes)for(const i in e){const o=e[i];o==null?t.removeAttribute(i):t.setAttribute(i,o)}},$_updateParentShownChildren(e){let t=this.parentPopper;for(;t;)e?t.shownChildren.add(this.randomId):(t.shownChildren.delete(this.randomId),t.pendingHide&&t.hide()),t=t.parentPopper},$_isAimingPopper(){const e=this.$_referenceNode.getBoundingClientRect();if(L>=e.left&&L<=e.right&&M>=e.top&&M<=e.bottom){const t=this.$_popperNode.getBoundingClientRect(),i=L-S,o=M-x,s=t.left+t.width/2-S+(t.top+t.height/2)-x+t.width+t.height,n=S+i*s,r=x+o*s;return W(S,x,n,r,t.left,t.top,t.left,t.bottom)||W(S,x,n,r,t.left,t.top,t.right,t.top)||W(S,x,n,r,t.right,t.top,t.right,t.bottom)||W(S,x,n,r,t.left,t.bottom,t.right,t.bottom)}return!1}},render(){return this.$slots.default(this.slotData)}});if(typeof document<"u"&&typeof window<"u"){if(De){const e=E?{passive:!0,capture:!0}:!0;document.addEventListener("touchstart",t=>Ce(t),e),document.addEventListener("touchend",t=>Pe(t,!0),e)}else window.addEventListener("mousedown",e=>Ce(e),!0),window.addEventListener("click",e=>Pe(e,!1),!0);window.addEventListener("resize",ft)}function Ce(e,t){for(let i=0;i=0;o--){const s=w[o];try{const n=s.containsGlobalTarget=s.mouseDownContains||s.popperNode().contains(e.target);s.pendingHide=!1,requestAnimationFrame(()=>{if(s.pendingHide=!1,!i[s.randomId]&&Ne(s,n,e)){if(s.$_handleGlobalClose(e,t),!e.closeAllPopover&&e.closePopover&&n){let a=s.parentPopper;for(;a;)i[a.randomId]=!0,a=a.parentPopper;return}let r=s.parentPopper;for(;r&&Ne(r,r.containsGlobalTarget,e);)r.$_handleGlobalClose(e,t),r=r.parentPopper}})}catch{}}}function Ne(e,t,i){return i.closeAllPopover||i.closePopover&&t||ct(e,i)&&!t}function ct(e,t){if(typeof e.autoHide=="function"){const i=e.autoHide(t);return e.lastAutoHide=i,i}return e.autoHide}function ft(){for(let e=0;e{S=L,x=M,L=e.clientX,M=e.clientY},E?{passive:!0}:void 0);function W(e,t,i,o,s,n,r,a){const l=((r-s)*(t-n)-(a-n)*(e-s))/((a-n)*(i-e)-(r-s)*(o-t)),d=((i-e)*(t-n)-(o-t)*(e-s))/((a-n)*(i-e)-(r-s)*(o-t));return l>=0&&l<=1&&d>=0&&d<=1}const gt={extends:Ee()},pe=(e,t)=>{const i=e.__vccOpts||e;for(const[o,s]of t)i[o]=s;return i};function mt(e,t,i,o,s,n){return B(),ie("div",{ref:"reference",class:ze(["v-popper",{"v-popper--shown":e.slotData.isShown}])},[V(e.$slots,"default",Ze(Qe(e.slotData)))],2)}const wt=pe(gt,[["render",mt]]);function yt(){var e=window.navigator.userAgent,t=e.indexOf("MSIE ");if(t>0)return parseInt(e.substring(t+5,e.indexOf(".",t)),10);var i=e.indexOf("Trident/");if(i>0){var o=e.indexOf("rv:");return parseInt(e.substring(o+3,e.indexOf(".",o)),10)}var s=e.indexOf("Edge/");return s>0?parseInt(e.substring(s+5,e.indexOf(".",s)),10):-1}let j;function re(){re.init||(re.init=!0,j=yt()!==-1)}var K={name:"ResizeObserver",props:{emitOnMount:{type:Boolean,default:!1},ignoreWidth:{type:Boolean,default:!1},ignoreHeight:{type:Boolean,default:!1}},emits:["notify"],mounted(){re(),Xe(()=>{this._w=this.$el.offsetWidth,this._h=this.$el.offsetHeight,this.emitOnMount&&this.emitSize()});const e=document.createElement("object");this._resizeObject=e,e.setAttribute("aria-hidden","true"),e.setAttribute("tabindex",-1),e.onload=this.addResizeHandlers,e.type="text/html",j&&this.$el.appendChild(e),e.data="about:blank",j||this.$el.appendChild(e)},beforeUnmount(){this.removeResizeHandlers()},methods:{compareAndNotify(){(!this.ignoreWidth&&this._w!==this.$el.offsetWidth||!this.ignoreHeight&&this._h!==this.$el.offsetHeight)&&(this._w=this.$el.offsetWidth,this._h=this.$el.offsetHeight,this.emitSize())},emitSize(){this.$emit("notify",{width:this._w,height:this._h})},addResizeHandlers(){this._resizeObject.contentDocument.defaultView.addEventListener("resize",this.compareAndNotify),this.compareAndNotify()},removeResizeHandlers(){this._resizeObject&&this._resizeObject.onload&&(!j&&this._resizeObject.contentDocument&&this._resizeObject.contentDocument.defaultView.removeEventListener("resize",this.compareAndNotify),this.$el.removeChild(this._resizeObject),this._resizeObject.onload=null,this._resizeObject=null)}}};const vt=Ue();je("data-v-b329ee4c");const $t={class:"resize-observer",tabindex:"-1"};Ve();const _t=vt((e,t,i,o,s,n)=>(B(),le("div",$t)));K.render=_t;K.__scopeId="data-v-b329ee4c";K.__file="src/components/ResizeObserver.vue";const Fe=(e="theme")=>({computed:{themeClass(){return pt(this[e])}}}),bt=X({name:"VPopperContent",components:{ResizeObserver:K},mixins:[Fe()],props:{popperId:String,theme:String,shown:Boolean,mounted:Boolean,skipTransition:Boolean,autoHide:Boolean,handleResize:Boolean,classes:Object,result:Object},emits:["hide","resize"],methods:{toPx(e){return e!=null&&!isNaN(e)?`${e}px`:null}}}),Tt=["id","aria-hidden","tabindex","data-popper-placement"],St={ref:"inner",class:"v-popper__inner"},xt=H("div",{class:"v-popper__arrow-outer"},null,-1),Ct=H("div",{class:"v-popper__arrow-inner"},null,-1),Pt=[xt,Ct];function Nt(e,t,i,o,s,n){const r=te("ResizeObserver");return B(),ie("div",{id:e.popperId,ref:"popover",class:ze(["v-popper__popper",[e.themeClass,e.classes.popperClass,{"v-popper__popper--shown":e.shown,"v-popper__popper--hidden":!e.shown,"v-popper__popper--show-from":e.classes.showFrom,"v-popper__popper--show-to":e.classes.showTo,"v-popper__popper--hide-from":e.classes.hideFrom,"v-popper__popper--hide-to":e.classes.hideTo,"v-popper__popper--skip-transition":e.skipTransition,"v-popper__popper--arrow-overflow":e.result&&e.result.arrow.overflow,"v-popper__popper--no-positioning":!e.result}]]),style:Z(e.result?{position:e.result.strategy,transform:`translate3d(${Math.round(e.result.x)}px,${Math.round(e.result.y)}px,0)`}:void 0),"aria-hidden":e.shown?"false":"true",tabindex:e.autoHide?0:void 0,"data-popper-placement":e.result?e.result.placement:void 0,onKeyup:t[2]||(t[2]=Ge(a=>e.autoHide&&e.$emit("hide"),["esc"]))},[H("div",{class:"v-popper__backdrop",onClick:t[0]||(t[0]=a=>e.autoHide&&e.$emit("hide"))}),H("div",{class:"v-popper__wrapper",style:Z(e.result?{transformOrigin:e.result.transformOrigin}:void 0)},[H("div",St,[e.mounted?(B(),ie(qe,{key:0},[H("div",null,[V(e.$slots,"default")]),e.handleResize?(B(),le(r,{key:0,onNotify:t[1]||(t[1]=a=>e.$emit("resize",a))})):ce("",!0)],64)):ce("",!0)],512),H("div",{ref:"arrow",class:"v-popper__arrow-container",style:Z(e.result?{left:e.toPx(e.result.arrow.x),top:e.toPx(e.result.arrow.y)}:void 0)},Pt,4)],4)],46,Tt)}const Ie=pe(bt,[["render",Nt]]),We={methods:{show(...e){return this.$refs.popper.show(...e)},hide(...e){return this.$refs.popper.hide(...e)},dispose(...e){return this.$refs.popper.dispose(...e)},onResize(...e){return this.$refs.popper.onResize(...e)}}};let ae=function(){};typeof window<"u"&&(ae=window.Element);const zt=X({name:"VPopperWrapper",components:{Popper:wt,PopperContent:Ie},mixins:[We,Fe("finalTheme")],props:{theme:{type:String,default:null},referenceNode:{type:Function,default:null},shown:{type:Boolean,default:!1},showGroup:{type:String,default:null},ariaId:{default:null},disabled:{type:Boolean,default:void 0},positioningDisabled:{type:Boolean,default:void 0},placement:{type:String,default:void 0},delay:{type:[String,Number,Object],default:void 0},distance:{type:[Number,String],default:void 0},skidding:{type:[Number,String],default:void 0},triggers:{type:Array,default:void 0},showTriggers:{type:[Array,Function],default:void 0},hideTriggers:{type:[Array,Function],default:void 0},popperTriggers:{type:Array,default:void 0},popperShowTriggers:{type:[Array,Function],default:void 0},popperHideTriggers:{type:[Array,Function],default:void 0},container:{type:[String,Object,ae,Boolean],default:void 0},boundary:{type:[String,ae],default:void 0},strategy:{type:String,default:void 0},autoHide:{type:[Boolean,Function],default:void 0},handleResize:{type:Boolean,default:void 0},instantMove:{type:Boolean,default:void 0},eagerMount:{type:Boolean,default:void 0},popperClass:{type:[String,Array,Object],default:void 0},computeTransformOrigin:{type:Boolean,default:void 0},autoMinSize:{type:Boolean,default:void 0},autoSize:{type:[Boolean,String],default:void 0},autoMaxSize:{type:Boolean,default:void 0},autoBoundaryMaxSize:{type:Boolean,default:void 0},preventOverflow:{type:Boolean,default:void 0},overflowPadding:{type:[Number,String],default:void 0},arrowPadding:{type:[Number,String],default:void 0},arrowOverflow:{type:Boolean,default:void 0},flip:{type:Boolean,default:void 0},shift:{type:Boolean,default:void 0},shiftCrossAxis:{type:Boolean,default:void 0},noAutoFocus:{type:Boolean,default:void 0},disposeTimeout:{type:Number,default:void 0}},emits:{show:()=>!0,hide:()=>!0,"update:shown":e=>!0,"apply-show":()=>!0,"apply-hide":()=>!0,"close-group":()=>!0,"close-directive":()=>!0,"auto-hide":()=>!0,resize:()=>!0},computed:{finalTheme(){return this.theme??this.$options.vPopperTheme}},methods:{getTargetNodes(){return Array.from(this.$el.children).filter(e=>e!==this.$refs.popperContent.$el)}}});function Ht(e,t,i,o,s,n){const r=te("PopperContent"),a=te("Popper");return B(),le(a,Ke({ref:"popper"},e.$props,{theme:e.finalTheme,"target-nodes":e.getTargetNodes,"popper-node":()=>e.$refs.popperContent.$el,class:[e.themeClass],onShow:t[0]||(t[0]=()=>e.$emit("show")),onHide:t[1]||(t[1]=()=>e.$emit("hide")),"onUpdate:shown":t[2]||(t[2]=l=>e.$emit("update:shown",l)),onApplyShow:t[3]||(t[3]=()=>e.$emit("apply-show")),onApplyHide:t[4]||(t[4]=()=>e.$emit("apply-hide")),onCloseGroup:t[5]||(t[5]=()=>e.$emit("close-group")),onCloseDirective:t[6]||(t[6]=()=>e.$emit("close-directive")),onAutoHide:t[7]||(t[7]=()=>e.$emit("auto-hide")),onResize:t[8]||(t[8]=()=>e.$emit("resize"))}),{default:fe(({popperId:l,isShown:d,shouldMountContent:c,skipTransition:h,autoHide:u,show:y,hide:v,handleResize:g,onResize:T,classes:f,result:$})=>[V(e.$slots,"default",{shown:d,show:y,hide:v}),Ye(r,{ref:"popperContent","popper-id":l,theme:e.finalTheme,shown:d,mounted:c,"skip-transition":h,"auto-hide":u,"handle-resize":g,classes:f,result:$,onHide:v,onResize:T},{default:fe(()=>[V(e.$slots,"popper",{shown:d,hide:v})]),_:2},1032,["popper-id","theme","shown","mounted","skip-transition","auto-hide","handle-resize","classes","result","onHide","onResize"])]),_:3},16,["theme","target-nodes","popper-node","class"])}const he=pe(zt,[["render",Ht]]),At={...he,name:"VDropdown",vPopperTheme:"dropdown"};({...he});({...he});X({name:"VTooltipDirective",components:{Popper:Ee(),PopperContent:Ie},mixins:[We],inheritAttrs:!1,props:{theme:{type:String,default:"tooltip"},html:{type:Boolean,default:e=>se(e.theme,"html")},content:{type:[String,Number,Function],default:null},loadingContent:{type:String,default:e=>se(e.theme,"loadingContent")},targetNodes:{type:Function,required:!0}},data(){return{asyncContent:null}},computed:{isContentAsync(){return typeof this.content=="function"},loading(){return this.isContentAsync&&this.asyncContent==null},finalContent(){return this.isContentAsync?this.loading?this.loadingContent:this.asyncContent:this.content}},watch:{content:{handler(){this.fetchContent(!0)},immediate:!0},async finalContent(){await this.$nextTick(),this.$refs.popper.onResize()}},created(){this.$_fetchId=0},methods:{fetchContent(e){if(typeof this.content=="function"&&this.$_isShown&&(e||!this.$_loading&&this.asyncContent==null)){this.asyncContent=null,this.$_loading=!0;const t=++this.$_fetchId,i=this.content(this);i.then?i.then(o=>this.onResult(t,o)):this.onResult(t,i)}},onResult(e,t){e===this.$_fetchId&&(this.$_loading=!1,this.asyncContent=t)},onShow(){this.$_isShown=!0,this.fetchContent()},onHide(){this.$_isShown=!1}}});const Ot=At;export{Ot as k}; diff --git a/assets/SpeechProviderSettings.vue_vue_type_script_setup_true_lang-BtrnMHoG.js b/assets/SpeechProviderSettings.vue_vue_type_script_setup_true_lang-BtrnMHoG.js new file mode 100644 index 0000000000000000000000000000000000000000..1809e8bb93dfe3d38436ecf73545d18eea9f04fb --- /dev/null +++ b/assets/SpeechProviderSettings.vue_vue_type_script_setup_true_lang-BtrnMHoG.js @@ -0,0 +1 @@ +import{d as B,c5 as ee,c as b,o as g,bh as $,bm as O,a,X as G,c6 as q,$ as H,e as u,w as K,U as W,b as T,u as s,Y as k,W as R,cc as D,cl as te,c7 as oe,V as ae,a0 as le,f as M,T as se,bk as re,bl as C,ct as E,cu as A,cp as ie}from"./index-B06xwjXa.js";import{b as ne,a as ue}from"./FieldRange.vue_vue_type_script_setup_true_lang-4kHfmFIm.js";import"./Select.vue_vue_type_style_index_0_lang-CzS20kE7.js";import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-Du5e5QRV.js";import"./three-vrm.module-CtuEk7GG.js";import"./emotions-DWNSb738.js";import"./mcp-BfXpaYZf.js";import{u as de,g as ce}from"./speech-CLjA-Bq8.js";import{u as ve}from"./providers-BCv4E6z9.js";import{_ as pe,a as me}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-gnnCLEsG.js";import{_ as fe}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-DMARmtsp.js";import{_ as ge,a as be}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-BoAZvnmm.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":""},_e=B({__name:"ProviderSettingsLayout2",props:{providerName:null,providerIcon:null,providerIconColor:null,onBack:{type:Function}},setup(x){return(o,S)=>{const d=ee("motion");return g(),b(q,null,[$(o.$slots,"default"),O((g(),b("div",he,[a("div",{text:"60",class:G(x.providerIcon||x.providerIconColor)},null,2)])),[[d]])],64)}}}),xe={"w-full":"","rounded-xl":""},ye={class:"mb-4 text-lg text-neutral-500 md:text-2xl dark:text-neutral-400","w-full":""},ke={class:"inline-flex items-center gap-4"},Se={flex:"~ col gap-4"},Ue=["placeholder"],we=["placeholder"],Ie={flex:"~ col gap-6"},Ve={grid:"~ cols-2 gap-4"},Te={class:"flex items-center gap-1 text-sm font-medium"},$e={class:"text-xs text-neutral-500 dark:text-neutral-400"},Le=["value"],Re={flex:"~ row","gap-4":""},Pe=["disabled"],Me={flex:"~ row","items-center":"","gap-2":""},Ce={flex:"~ row","items-center":"","gap-2":""},Oe={key:2,class:"mt-2 text-sm text-red-500"},ze={key:3,class:"mt-2 text-sm text-red-500"},Ke={key:4,class:"mt-2 text-sm text-red-500"},Be=["src"],at=B({__name:"SpeechPlayground",props:{defaultText:null,availableVoices:null,generateSpeech:{type:Function},apiKeyConfigured:{type:Boolean}},setup(x,{expose:o}){const S=x,{t:d}=H(),m=u(S.defaultText||"Hello! This is a test of the voice synthesis."),U=u(!1),t=u(""),v=u(""),f=u(null),i=u(!1),h=u(""),p=u("");K(()=>S.availableVoices,n=>{var r;n.length>0&&!p.value&&(p.value=((r=n[0])==null?void 0:r.id)||"")},{immediate:!0});async function _(){if(!(!m.value.trim()&&!i.value||i.value&&!h.value.trim()||!p.value)){U.value=!0,v.value="";try{t.value&&I();const n=i.value?h.value:m.value,r=await S.generateSpeech(n,p.value,i.value);t.value=URL.createObjectURL(new Blob([r])),setTimeout(()=>{f.value&&f.value.play()},100)}catch(n){console.error("Error generating speech:",n),v.value=n instanceof Error?n.message:"An unknown error occurred"}finally{U.value=!1}}}function I(){f.value&&(f.value.pause(),f.value.currentTime=0),t.value&&(URL.revokeObjectURL(t.value),t.value="")}return W(()=>{t.value&&URL.revokeObjectURL(t.value)}),o({testText:m,ssmlText:h,useSSML:i,selectedVoice:p,isGenerating:U,audioUrl:t,errorMessage:v,audioPlayer:f,generateTestSpeech:_,stopTestAudio:I}),(n,r)=>(g(),b("div",xe,[a("h2",ye,[a("div",ke,[T(s(ne)),a("div",null,k(s(d)("settings.pages.providers.provider.elevenlabs.playground.title")),1)])]),a("div",Se,[T(s(ue),{modelValue:i.value,"onUpdate:modelValue":r[0]||(r[0]=c=>i.value=c),label:s(d)("settings.pages.modules.speech.sections.section.voice-settings.use-ssml.label"),description:s(d)("settings.pages.modules.speech.sections.section.voice-settings.use-ssml.description")},null,8,["modelValue","label","description"]),i.value?O((g(),b("textarea",{key:1,"onUpdate:modelValue":r[2]||(r[2]=c=>h.value=c),placeholder:s(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,we)),[[D,h.value]]):O((g(),b("textarea",{key:0,"onUpdate:modelValue":r[1]||(r[1]=c=>m.value=c),placeholder:s(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,Ue)),[[D,m.value]]),a("div",Ie,[a("label",Ve,[a("div",null,[a("div",Te,k(s(d)("settings.pages.providers.provider.elevenlabs.playground.fields.field.voice.label")),1),a("div",$e,k(s(d)("settings.pages.providers.provider.elevenlabs.playground.fields.field.voice.description")),1)]),O(a("select",{"onUpdate:modelValue":r[3]||(r[3]=c=>p.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":""},[(g(!0),b(q,null,oe(x.availableVoices,c=>(g(),b("option",{key:c.id,value:c.id},k(c.name),9,Le))),128))],512),[[te,p.value]])])]),a("div",Re,[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||!m.value.trim()&&!i.value||i.value&&!h.value.trim()||!p.value||!x.apiKeyConfigured,class:G({"opacity-50 cursor-not-allowed":U.value||!m.value.trim()&&!i.value||i.value&&!h.value.trim()||!p.value||!x.apiKeyConfigured}),bg:"neutral-700 dark:neutral-300",onClick:_},[a("div",Me,[r[4]||(r[4]=a("div",{"i-solar:play-circle-bold-duotone":""},null,-1)),a("span",null,k(U.value?s(d)("settings.pages.providers.provider.elevenlabs.playground.buttons.button.test-voice.generating"):s(d)("settings.pages.providers.provider.elevenlabs.playground.buttons.button.test-voice.label")),1)])],10,Pe),t.value?(g(),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:I},[a("div",Ce,[r[5]||(r[5]=a("div",{"i-solar:stop-circle-bold-duotone":""},null,-1)),a("span",null,k(s(d)("settings.pages.modules.speech.sections.section.playground.buttons.stop.label")),1)])])):R("",!0)]),x.apiKeyConfigured?R("",!0):(g(),b("div",Oe,k(s(d)("settings.pages.providers.provider.elevenlabs.playground.validation.error-missing-api-key")),1)),p.value?R("",!0):(g(),b("div",ze,k(s(d)("settings.pages.modules.speech.sections.section.playground.select-voice.required")),1)),v.value?(g(),b("div",Ke,k(v.value),1)):R("",!0),t.value?(g(),b("audio",{key:5,ref_key:"audioPlayer",ref:f,src:t.value,controls:"",class:"mt-2 w-full"},null,8,Be)):R("",!0)]),$(n.$slots,"default")]))}}),Ne={flex:"~ col md:row gap-6"},je={flex:"~ col gap-6"},Fe={class:"text-lg text-neutral-500 md:text-2xl dark:text-neutral-400"},De={flex:"~ col gap-4"},Ee={flex:"~ col gap-6",class:"w-full md:w-[60%]"},Ae={"w-full":"","rounded-xl":""},lt=B({__name:"SpeechProviderSettings",props:{providerId:null,defaultModel:null,additionalSettings:null},setup(x){const o=x,{t:S}=H(),d=ae(),m=ve(),U=de(),{providers:t}=le(m),v=M(()=>m.getProviderMetadata(o.providerId)),f=M({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=M({get:()=>{var e,l,y;return((e=t.value[o.providerId])==null?void 0:e.baseUrl)||((y=(l=v.value)==null?void 0:l.defaultOptions)==null?void 0:y.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."),p=u(!1),_=u(""),I=u(""),n=u(null),r=u(!1),c=u(""),N=u(""),w=u({});function X(){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,l,y,V;m.initializeProvider(o.providerId),f.value=((e=t.value[o.providerId])==null?void 0:e.apiKey)||"",i.value=((l=t.value[o.providerId])==null?void 0:l.baseUrl)||((V=(y=v.value)==null?void 0:y.defaultOptions)==null?void 0:V.baseUrl)||"",X(),m.configuredProviders[o.providerId]&&U.loadVoicesForProvider(o.providerId)});const z=ie(()=>{var e,l;t.value[o.providerId]={...t.value[o.providerId],apiKey:f.value,baseUrl:i.value||((l=(e=v.value)==null?void 0:e.defaultOptions)==null?void 0:l.baseUrl)||"",voiceSettings:{...w.value}}},1e3);K([f,i],z),K(w,z,{deep:!0});async function Y(){if(!h.value.trim()&&!r.value||r.value&&!c.value.trim())return;const e=m.getProviderInstance(o.providerId);if(!e){console.error("Failed to initialize speech provider");return}if(!N.value){console.error("No active speech voice selected");return}p.value=!0,I.value="";try{_.value&&j();const l=o.defaultModel||"default",y=r.value?c.value:h.value,V=await ce({...e.speech(l,{voiceSettings:w.value}),input:y,voice:N.value});_.value=URL.createObjectURL(new Blob([V])),setTimeout(()=>{n.value&&n.value.play()},100)}catch(l){console.error("Error generating speech:",l),I.value=l instanceof Error?l.message:"An unknown error occurred"}finally{p.value=!1}}function j(){n.value&&(n.value.pause(),n.value.currentTime=0),_.value&&(URL.revokeObjectURL(_.value),_.value="")}W(()=>{_.value&&URL.revokeObjectURL(_.value)});function J(){var e,l;w.value={...((l=(e=v.value)==null?void 0:e.defaultOptions)==null?void 0:l.voiceSettings)||{}},z()}function Q(e,l){w.value[e]=l}const F=M(()=>({voiceSettings:w.value,updateVoiceSettings:Q,isGenerating:p.value,testText:h.value,useSSML:r.value,ssmlText:c.value,generateTestSpeech:Y,stopTestAudio:j,audioUrl:_.value,audioPlayer:n.value,errorMessage:I.value}));return(e,l)=>{var y,V;return g(),re(_e,{"provider-name":(y=v.value)==null?void 0:y.localizedName,"provider-icon":(V=v.value)==null?void 0:V.icon,"on-back":()=>s(d).back()},{default:C(()=>[a("div",Ne,[T(s(ge),{class:"w-full md:w-[40%]"},{default:C(()=>[T(s(be),{title:s(S)("settings.pages.providers.common.section.basic.title"),description:s(S)("settings.pages.providers.common.section.basic.description"),"on-reset":J},{default:C(()=>{var L;return[T(s(fe),{modelValue:f.value,"onUpdate:modelValue":l[0]||(l[0]=P=>f.value=P),"provider-name":(L=v.value)==null?void 0:L.localizedName,placeholder:"sk-"},null,8,["modelValue","provider-name"]),$(e.$slots,"basic-settings")]}),_:3},8,["title","description"]),a("div",je,[a("h2",Fe,k(s(S)("settings.pages.providers.common.section.voice.title")),1),a("div",De,[$(e.$slots,"voice-settings",E(A(F.value)))])]),T(s(pe),{title:s(S)("settings.pages.providers.common.section.advanced.title")},{default:C(()=>{var L,P;return[T(s(me),{modelValue:i.value,"onUpdate:modelValue":l[1]||(l[1]=Z=>i.value=Z),placeholder:((P=(L=v.value)==null?void 0:L.defaultOptions)==null?void 0:P.baseUrl)||"",required:""},null,8,["modelValue","placeholder"]),$(e.$slots,"advanced-settings")]}),_:3},8,["title"])]),_:3}),a("div",Ee,[a("div",Ae,[$(e.$slots,"playground",E(A(F.value)))])])])]),_:3},8,["provider-name","provider-icon","on-back"])}}});export{at as _,lt as a}; diff --git a/assets/SpeechProviderSettings.vue_vue_type_script_setup_true_lang-C4Rxa7-o.js b/assets/SpeechProviderSettings.vue_vue_type_script_setup_true_lang-C4Rxa7-o.js deleted file mode 100644 index 55837ad946480732d021b0ab7c1a8ab987b84023..0000000000000000000000000000000000000000 --- a/assets/SpeechProviderSettings.vue_vue_type_script_setup_true_lang-C4Rxa7-o.js +++ /dev/null @@ -1 +0,0 @@ -import{d as B,c5 as ee,c as b,o as g,a9 as $,ae as O,a,X as G,c6 as q,$ as H,e as u,w as K,U as W,b as T,u as s,Y as k,W as R,cc as D,cl as te,c7 as oe,V as ae,a0 as le,f as M,T as se,ac as re,ad as C,ct as E,cu as A,cp as ie}from"./index-CNH1g_GM.js";import{b as ne,a as ue}from"./FieldRange.vue_vue_type_script_setup_true_lang-Dou4SIkT.js";import"./Select.vue_vue_type_style_index_0_lang-BIffysKh.js";import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-BQHOFrhO.js";import"./three-vrm-animation.module-B_hGdUpX.js";import"./mcp-B7-jaCfZ.js";import"./emotions-DWNSb738.js";import{u as de,g as ce}from"./speech-DpuUb2e9.js";import{u as ve}from"./providers-DP46_3AG.js";import{_ as pe,a as me}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-C-ZUDDxT.js";import{_ as fe}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-CR2pR4yl.js";import{_ as ge,a as be}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-BpJun8-8.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":""},_e=B({__name:"ProviderSettingsLayout2",props:{providerName:null,providerIcon:null,providerIconColor:null,onBack:{type:Function}},setup(x){return(o,S)=>{const d=ee("motion");return g(),b(q,null,[$(o.$slots,"default"),O((g(),b("div",he,[a("div",{text:"60",class:G(x.providerIcon||x.providerIconColor)},null,2)])),[[d]])],64)}}}),xe={"w-full":"","rounded-xl":""},ye={class:"mb-4 text-lg text-neutral-500 md:text-2xl dark:text-neutral-400","w-full":""},ke={class:"inline-flex items-center gap-4"},Se={flex:"~ col gap-4"},Ue=["placeholder"],we=["placeholder"],Ie={flex:"~ col gap-6"},Ve={grid:"~ cols-2 gap-4"},Te={class:"flex items-center gap-1 text-sm font-medium"},$e={class:"text-xs text-neutral-500 dark:text-neutral-400"},Le=["value"],Re={flex:"~ row","gap-4":""},Pe=["disabled"],Me={flex:"~ row","items-center":"","gap-2":""},Ce={flex:"~ row","items-center":"","gap-2":""},Oe={key:2,class:"mt-2 text-sm text-red-500"},ze={key:3,class:"mt-2 text-sm text-red-500"},Ke={key:4,class:"mt-2 text-sm text-red-500"},Be=["src"],at=B({__name:"SpeechPlayground",props:{defaultText:null,availableVoices:null,generateSpeech:{type:Function},apiKeyConfigured:{type:Boolean}},setup(x,{expose:o}){const S=x,{t:d}=H(),m=u(S.defaultText||"Hello! This is a test of the voice synthesis."),U=u(!1),t=u(""),v=u(""),f=u(null),i=u(!1),h=u(""),p=u("");K(()=>S.availableVoices,n=>{var r;n.length>0&&!p.value&&(p.value=((r=n[0])==null?void 0:r.id)||"")},{immediate:!0});async function _(){if(!(!m.value.trim()&&!i.value||i.value&&!h.value.trim()||!p.value)){U.value=!0,v.value="";try{t.value&&I();const n=i.value?h.value:m.value,r=await S.generateSpeech(n,p.value,i.value);t.value=URL.createObjectURL(new Blob([r])),setTimeout(()=>{f.value&&f.value.play()},100)}catch(n){console.error("Error generating speech:",n),v.value=n instanceof Error?n.message:"An unknown error occurred"}finally{U.value=!1}}}function I(){f.value&&(f.value.pause(),f.value.currentTime=0),t.value&&(URL.revokeObjectURL(t.value),t.value="")}return W(()=>{t.value&&URL.revokeObjectURL(t.value)}),o({testText:m,ssmlText:h,useSSML:i,selectedVoice:p,isGenerating:U,audioUrl:t,errorMessage:v,audioPlayer:f,generateTestSpeech:_,stopTestAudio:I}),(n,r)=>(g(),b("div",xe,[a("h2",ye,[a("div",ke,[T(s(ne)),a("div",null,k(s(d)("settings.pages.providers.provider.elevenlabs.playground.title")),1)])]),a("div",Se,[T(s(ue),{modelValue:i.value,"onUpdate:modelValue":r[0]||(r[0]=c=>i.value=c),label:s(d)("settings.pages.modules.speech.sections.section.voice-settings.use-ssml.label"),description:s(d)("settings.pages.modules.speech.sections.section.voice-settings.use-ssml.description")},null,8,["modelValue","label","description"]),i.value?O((g(),b("textarea",{key:1,"onUpdate:modelValue":r[2]||(r[2]=c=>h.value=c),placeholder:s(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,we)),[[D,h.value]]):O((g(),b("textarea",{key:0,"onUpdate:modelValue":r[1]||(r[1]=c=>m.value=c),placeholder:s(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,Ue)),[[D,m.value]]),a("div",Ie,[a("label",Ve,[a("div",null,[a("div",Te,k(s(d)("settings.pages.providers.provider.elevenlabs.playground.fields.field.voice.label")),1),a("div",$e,k(s(d)("settings.pages.providers.provider.elevenlabs.playground.fields.field.voice.description")),1)]),O(a("select",{"onUpdate:modelValue":r[3]||(r[3]=c=>p.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":""},[(g(!0),b(q,null,oe(x.availableVoices,c=>(g(),b("option",{key:c.id,value:c.id},k(c.name),9,Le))),128))],512),[[te,p.value]])])]),a("div",Re,[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||!m.value.trim()&&!i.value||i.value&&!h.value.trim()||!p.value||!x.apiKeyConfigured,class:G({"opacity-50 cursor-not-allowed":U.value||!m.value.trim()&&!i.value||i.value&&!h.value.trim()||!p.value||!x.apiKeyConfigured}),bg:"neutral-700 dark:neutral-300",onClick:_},[a("div",Me,[r[4]||(r[4]=a("div",{"i-solar:play-circle-bold-duotone":""},null,-1)),a("span",null,k(U.value?s(d)("settings.pages.providers.provider.elevenlabs.playground.buttons.button.test-voice.generating"):s(d)("settings.pages.providers.provider.elevenlabs.playground.buttons.button.test-voice.label")),1)])],10,Pe),t.value?(g(),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:I},[a("div",Ce,[r[5]||(r[5]=a("div",{"i-solar:stop-circle-bold-duotone":""},null,-1)),a("span",null,k(s(d)("settings.pages.modules.speech.sections.section.playground.buttons.stop.label")),1)])])):R("",!0)]),x.apiKeyConfigured?R("",!0):(g(),b("div",Oe,k(s(d)("settings.pages.providers.provider.elevenlabs.playground.validation.error-missing-api-key")),1)),p.value?R("",!0):(g(),b("div",ze,k(s(d)("settings.pages.modules.speech.sections.section.playground.select-voice.required")),1)),v.value?(g(),b("div",Ke,k(v.value),1)):R("",!0),t.value?(g(),b("audio",{key:5,ref_key:"audioPlayer",ref:f,src:t.value,controls:"",class:"mt-2 w-full"},null,8,Be)):R("",!0)]),$(n.$slots,"default")]))}}),Ne={flex:"~ col md:row gap-6"},je={flex:"~ col gap-6"},Fe={class:"text-lg text-neutral-500 md:text-2xl dark:text-neutral-400"},De={flex:"~ col gap-4"},Ee={flex:"~ col gap-6",class:"w-full md:w-[60%]"},Ae={"w-full":"","rounded-xl":""},lt=B({__name:"SpeechProviderSettings",props:{providerId:null,defaultModel:null,additionalSettings:null},setup(x){const o=x,{t:S}=H(),d=ae(),m=ve(),U=de(),{providers:t}=le(m),v=M(()=>m.getProviderMetadata(o.providerId)),f=M({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=M({get:()=>{var e,l,y;return((e=t.value[o.providerId])==null?void 0:e.baseUrl)||((y=(l=v.value)==null?void 0:l.defaultOptions)==null?void 0:y.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."),p=u(!1),_=u(""),I=u(""),n=u(null),r=u(!1),c=u(""),N=u(""),w=u({});function X(){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,l,y,V;m.initializeProvider(o.providerId),f.value=((e=t.value[o.providerId])==null?void 0:e.apiKey)||"",i.value=((l=t.value[o.providerId])==null?void 0:l.baseUrl)||((V=(y=v.value)==null?void 0:y.defaultOptions)==null?void 0:V.baseUrl)||"",X(),m.configuredProviders[o.providerId]&&U.loadVoicesForProvider(o.providerId)});const z=ie(()=>{var e,l;t.value[o.providerId]={...t.value[o.providerId],apiKey:f.value,baseUrl:i.value||((l=(e=v.value)==null?void 0:e.defaultOptions)==null?void 0:l.baseUrl)||"",voiceSettings:{...w.value}}},1e3);K([f,i],z),K(w,z,{deep:!0});async function Y(){if(!h.value.trim()&&!r.value||r.value&&!c.value.trim())return;const e=m.getProviderInstance(o.providerId);if(!e){console.error("Failed to initialize speech provider");return}if(!N.value){console.error("No active speech voice selected");return}p.value=!0,I.value="";try{_.value&&j();const l=o.defaultModel||"default",y=r.value?c.value:h.value,V=await ce({...e.speech(l,{voiceSettings:w.value}),input:y,voice:N.value});_.value=URL.createObjectURL(new Blob([V])),setTimeout(()=>{n.value&&n.value.play()},100)}catch(l){console.error("Error generating speech:",l),I.value=l instanceof Error?l.message:"An unknown error occurred"}finally{p.value=!1}}function j(){n.value&&(n.value.pause(),n.value.currentTime=0),_.value&&(URL.revokeObjectURL(_.value),_.value="")}W(()=>{_.value&&URL.revokeObjectURL(_.value)});function J(){var e,l;w.value={...((l=(e=v.value)==null?void 0:e.defaultOptions)==null?void 0:l.voiceSettings)||{}},z()}function Q(e,l){w.value[e]=l}const F=M(()=>({voiceSettings:w.value,updateVoiceSettings:Q,isGenerating:p.value,testText:h.value,useSSML:r.value,ssmlText:c.value,generateTestSpeech:Y,stopTestAudio:j,audioUrl:_.value,audioPlayer:n.value,errorMessage:I.value}));return(e,l)=>{var y,V;return g(),re(_e,{"provider-name":(y=v.value)==null?void 0:y.localizedName,"provider-icon":(V=v.value)==null?void 0:V.icon,"on-back":()=>s(d).back()},{default:C(()=>[a("div",Ne,[T(s(ge),{class:"w-full md:w-[40%]"},{default:C(()=>[T(s(be),{title:s(S)("settings.pages.providers.common.section.basic.title"),description:s(S)("settings.pages.providers.common.section.basic.description"),"on-reset":J},{default:C(()=>{var L;return[T(s(fe),{modelValue:f.value,"onUpdate:modelValue":l[0]||(l[0]=P=>f.value=P),"provider-name":(L=v.value)==null?void 0:L.localizedName,placeholder:"sk-"},null,8,["modelValue","provider-name"]),$(e.$slots,"basic-settings")]}),_:3},8,["title","description"]),a("div",je,[a("h2",Fe,k(s(S)("settings.pages.providers.common.section.voice.title")),1),a("div",De,[$(e.$slots,"voice-settings",E(A(F.value)))])]),T(s(pe),{title:s(S)("settings.pages.providers.common.section.advanced.title")},{default:C(()=>{var L,P;return[T(s(me),{modelValue:i.value,"onUpdate:modelValue":l[1]||(l[1]=Z=>i.value=Z),placeholder:((P=(L=v.value)==null?void 0:L.defaultOptions)==null?void 0:P.baseUrl)||"",required:""},null,8,["modelValue","placeholder"]),$(e.$slots,"advanced-settings")]}),_:3},8,["title"])]),_:3}),a("div",Ee,[a("div",Ae,[$(e.$slots,"playground",E(A(F.value)))])])])]),_:3},8,["provider-name","provider-icon","on-back"])}}});export{at as _,lt as a}; diff --git a/assets/Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-BQHOFrhO.js b/assets/Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-Du5e5QRV.js similarity index 99% rename from assets/Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-BQHOFrhO.js rename to assets/Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-Du5e5QRV.js index 5ecbab3f213ec4757d701bec50161886e5d9f50a..39b979e99158854ef6cbcdda0325846c5175bc52 100644 --- a/assets/Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-BQHOFrhO.js +++ b/assets/Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-Du5e5QRV.js @@ -1,5 +1,5 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/default-node-CoUhZWYT.js","assets/index-CNH1g_GM.js","assets/index-Cgf1vKOZ.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 Ix=Object.defineProperty;var Ex=(r,t,e)=>t in r?Ix(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e;var $=(r,t,e)=>Ex(r,typeof t!="symbol"?t+"":t,e);import{bY as Nh,cN as gi,b$ as Cx,cO as ln}from"./index-CNH1g_GM.js";/*! +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/default-node-Bif61nM5.js","assets/index-B06xwjXa.js","assets/index-Cgf1vKOZ.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 Ix=Object.defineProperty;var Ex=(r,t,e)=>t in r?Ix(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e;var $=(r,t,e)=>Ex(r,typeof t!="symbol"?t+"":t,e);import{a5 as Nh,cN as gi,a6 as Cx,cO as ln}from"./index-B06xwjXa.js";/*! * @pixi/constants - v6.5.10 * Compiled Thu, 06 Jul 2023 15:25:11 UTC * @@ -3095,10 +3095,10 @@ https://github.com/nodeca/pako/blob/main/LICENSE \0`,et+=s(C,2),et+=F.magic,et+=s(S,2),et+=s(E,2),et+=s(k.crc32,4),et+=s(k.compressedSize,4),et+=s(k.uncompressedSize,4),et+=s(z.length,2),et+=s(it.length,2),{fileRecord:h.LOCAL_FILE_HEADER+et+z+it,dirRecord:h.CENTRAL_FILE_HEADER+s(V,2)+et+s(st.length,2)+"\0\0\0\0"+s(A,4)+s(d,4)+z+it+st}}var a=e("../utils"),l=e("../stream/GenericWorker"),u=e("../utf8"),c=e("../crc32"),h=e("../signature");function p(f,y,g,d){l.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=y,this.zipPlatform=g,this.encodeFileName=d,this.streamFiles=f,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}a.inherits(p,l),p.prototype.push=function(f){var y=f.meta.percent||0,g=this.entriesCount,d=this._sources.length;this.accumulate?this.contentBuffer.push(f):(this.bytesWritten+=f.data.length,l.prototype.push.call(this,{data:f.data,meta:{currentFile:this.currentFile,percent:g?(y+100*(g-d-1))/g:100}}))},p.prototype.openedSource=function(f){this.currentSourceOffset=this.bytesWritten,this.currentFile=f.file.name;var y=this.streamFiles&&!f.file.dir;if(y){var g=o(f,y,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:g.fileRecord,meta:{percent:0}})}else this.accumulate=!0},p.prototype.closedSource=function(f){this.accumulate=!1;var y=this.streamFiles&&!f.file.dir,g=o(f,y,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(g.dirRecord),y)this.push({data:function(d){return h.DATA_DESCRIPTOR+s(d.crc32,4)+s(d.compressedSize,4)+s(d.uncompressedSize,4)}(f),meta:{percent:100}});else for(this.push({data:g.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},p.prototype.flush=function(){for(var f=this.bytesWritten,y=0;y=this.index;l--)u=(u<<8)+this.byteAt(l);return this.index+=a,u},readString:function(a){return s.transformTo("string",this.readData(a))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var a=this.readInt(4);return new Date(Date.UTC(1980+(a>>25&127),(a>>21&15)-1,a>>16&31,a>>11&31,a>>5&63,(31&a)<<1))}},i.exports=o},{"../utils":32}],19:[function(e,i,n){var s=e("./Uint8ArrayReader");function o(a){s.call(this,a)}e("../utils").inherits(o,s),o.prototype.readData=function(a){this.checkOffset(a);var l=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},i.exports=o},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(e,i,n){var s=e("./DataReader");function o(a){s.call(this,a)}e("../utils").inherits(o,s),o.prototype.byteAt=function(a){return this.data.charCodeAt(this.zero+a)},o.prototype.lastIndexOfSignature=function(a){return this.data.lastIndexOf(a)-this.zero},o.prototype.readAndCheckSignature=function(a){return a===this.readData(4)},o.prototype.readData=function(a){this.checkOffset(a);var l=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},i.exports=o},{"../utils":32,"./DataReader":18}],21:[function(e,i,n){var s=e("./ArrayReader");function o(a){s.call(this,a)}e("../utils").inherits(o,s),o.prototype.readData=function(a){if(this.checkOffset(a),a===0)return new Uint8Array(0);var l=this.data.subarray(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},i.exports=o},{"../utils":32,"./ArrayReader":17}],22:[function(e,i,n){var s=e("../utils"),o=e("../support"),a=e("./ArrayReader"),l=e("./StringReader"),u=e("./NodeBufferReader"),c=e("./Uint8ArrayReader");i.exports=function(h){var p=s.getTypeOf(h);return s.checkSupport(p),p!=="string"||o.uint8array?p==="nodebuffer"?new u(h):o.uint8array?new c(s.transformTo("uint8array",h)):new a(s.transformTo("array",h)):new l(h)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(e,i,n){n.LOCAL_FILE_HEADER="PK",n.CENTRAL_FILE_HEADER="PK",n.CENTRAL_DIRECTORY_END="PK",n.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",n.ZIP64_CENTRAL_DIRECTORY_END="PK",n.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(e,i,n){var s=e("./GenericWorker"),o=e("../utils");function a(l){s.call(this,"ConvertWorker to "+l),this.destType=l}o.inherits(a,s),a.prototype.processChunk=function(l){this.push({data:o.transformTo(this.destType,l.data),meta:l.meta})},i.exports=a},{"../utils":32,"./GenericWorker":28}],25:[function(e,i,n){var s=e("./GenericWorker"),o=e("../crc32");function a(){s.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}e("../utils").inherits(a,s),a.prototype.processChunk=function(l){this.streamInfo.crc32=o(l.data,this.streamInfo.crc32||0),this.push(l)},i.exports=a},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(e,i,n){var s=e("../utils"),o=e("./GenericWorker");function a(l){o.call(this,"DataLengthProbe for "+l),this.propName=l,this.withStreamInfo(l,0)}s.inherits(a,o),a.prototype.processChunk=function(l){if(l){var u=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=u+l.data.length}o.prototype.processChunk.call(this,l)},i.exports=a},{"../utils":32,"./GenericWorker":28}],27:[function(e,i,n){var s=e("../utils"),o=e("./GenericWorker");function a(l){o.call(this,"DataWorker");var u=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,l.then(function(c){u.dataIsReady=!0,u.data=c,u.max=c&&c.length||0,u.type=s.getTypeOf(c),u.isPaused||u._tickAndRepeat()},function(c){u.error(c)})}s.inherits(a,o),a.prototype.cleanUp=function(){o.prototype.cleanUp.call(this),this.data=null},a.prototype.resume=function(){return!!o.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,s.delay(this._tickAndRepeat,[],this)),!0)},a.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(s.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},a.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var l=null,u=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":l=this.data.substring(this.index,u);break;case"uint8array":l=this.data.subarray(this.index,u);break;case"array":case"nodebuffer":l=this.data.slice(this.index,u)}return this.index=u,this.push({data:l,meta:{percent:this.max?this.index/this.max*100:0}})},i.exports=a},{"../utils":32,"./GenericWorker":28}],28:[function(e,i,n){function s(o){this.name=o||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}s.prototype={push:function(o){this.emit("data",o)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(o){this.emit("error",o)}return!0},error:function(o){return!this.isFinished&&(this.isPaused?this.generatedError=o:(this.isFinished=!0,this.emit("error",o),this.previous&&this.previous.error(o),this.cleanUp()),!0)},on:function(o,a){return this._listeners[o].push(a),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(o,a){if(this._listeners[o])for(var l=0;l "+o:o}},i.exports=s},{}],29:[function(e,i,n){var s=e("../utils"),o=e("./ConvertWorker"),a=e("./GenericWorker"),l=e("../base64"),u=e("../support"),c=e("../external"),h=null;if(u.nodestream)try{h=e("../nodejs/NodejsStreamOutputAdapter")}catch{}function p(y,g){return new c.Promise(function(d,m){var _=[],S=y._internalType,E=y._outputType,b=y._mimeType;y.on("data",function(F,x){_.push(F),g&&g(x)}).on("error",function(F){_=[],m(F)}).on("end",function(){try{var F=function(x,z,B){switch(x){case"blob":return s.newBlob(s.transformTo("arraybuffer",z),B);case"base64":return l.encode(z);default:return s.transformTo(x,z)}}(E,function(x,z){var B,tt=0,st=null,I=0;for(B=0;B"u")n.blob=!1;else{var s=new ArrayBuffer(0);try{n.blob=new Blob([s],{type:"application/zip"}).size===0}catch{try{var o=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);o.append(s),n.blob=o.getBlob("application/zip").size===0}catch{n.blob=!1}}}try{n.nodestream=!!e("readable-stream").Readable}catch{n.nodestream=!1}},{"readable-stream":16}],31:[function(e,i,n){for(var s=e("./utils"),o=e("./support"),a=e("./nodejsUtils"),l=e("./stream/GenericWorker"),u=new Array(256),c=0;c<256;c++)u[c]=252<=c?6:248<=c?5:240<=c?4:224<=c?3:192<=c?2:1;u[254]=u[254]=1;function h(){l.call(this,"utf-8 decode"),this.leftOver=null}function p(){l.call(this,"utf-8 encode")}n.utf8encode=function(f){return o.nodebuffer?a.newBufferFrom(f,"utf-8"):function(y){var g,d,m,_,S,E=y.length,b=0;for(_=0;_>>6:(d<65536?g[S++]=224|d>>>12:(g[S++]=240|d>>>18,g[S++]=128|d>>>12&63),g[S++]=128|d>>>6&63),g[S++]=128|63&d);return g}(f)},n.utf8decode=function(f){return o.nodebuffer?s.transformTo("nodebuffer",f).toString("utf-8"):function(y){var g,d,m,_,S=y.length,E=new Array(2*S);for(g=d=0;g>10&1023,E[d++]=56320|1023&m)}return E.length!==d&&(E.subarray?E=E.subarray(0,d):E.length=d),s.applyFromCharCode(E)}(f=s.transformTo(o.uint8array?"uint8array":"array",f))},s.inherits(h,l),h.prototype.processChunk=function(f){var y=s.transformTo(o.uint8array?"uint8array":"array",f.data);if(this.leftOver&&this.leftOver.length){if(o.uint8array){var g=y;(y=new Uint8Array(g.length+this.leftOver.length)).set(this.leftOver,0),y.set(g,this.leftOver.length)}else y=this.leftOver.concat(y);this.leftOver=null}var d=function(_,S){var E;for((S=S||_.length)>_.length&&(S=_.length),E=S-1;0<=E&&(192&_[E])==128;)E--;return E<0||E===0?S:E+u[_[E]]>S?E:S}(y),m=y;d!==y.length&&(o.uint8array?(m=y.subarray(0,d),this.leftOver=y.subarray(d,y.length)):(m=y.slice(0,d),this.leftOver=y.slice(d,y.length))),this.push({data:n.utf8decode(m),meta:f.meta})},h.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:n.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},n.Utf8DecodeWorker=h,s.inherits(p,l),p.prototype.processChunk=function(f){this.push({data:n.utf8encode(f.data),meta:f.meta})},n.Utf8EncodeWorker=p},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(e,i,n){var s=e("./support"),o=e("./base64"),a=e("./nodejsUtils"),l=e("./external");function u(g){return g}function c(g,d){for(var m=0;m>8;this.dir=!!(16&this.externalFileAttributes),f==0&&(this.dosPermissions=63&this.externalFileAttributes),f==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var f=s(this.extraFields[1].value);this.uncompressedSize===o.MAX_VALUE_32BITS&&(this.uncompressedSize=f.readInt(8)),this.compressedSize===o.MAX_VALUE_32BITS&&(this.compressedSize=f.readInt(8)),this.localHeaderOffset===o.MAX_VALUE_32BITS&&(this.localHeaderOffset=f.readInt(8)),this.diskNumberStart===o.MAX_VALUE_32BITS&&(this.diskNumberStart=f.readInt(4))}},readExtraFields:function(f){var y,g,d,m=f.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});f.index+4>>6:(f<65536?p[d++]=224|f>>>12:(p[d++]=240|f>>>18,p[d++]=128|f>>>12&63),p[d++]=128|f>>>6&63),p[d++]=128|63&f);return p},n.buf2binstring=function(h){return c(h,h.length)},n.binstring2buf=function(h){for(var p=new s.Buf8(h.length),f=0,y=p.length;f>10&1023,_[y++]=56320|1023&g)}return c(_,y)},n.utf8border=function(h,p){var f;for((p=p||h.length)>h.length&&(p=h.length),f=p-1;0<=f&&(192&h[f])==128;)f--;return f<0||f===0?p:f+l[h[f]]>p?f:p}},{"./common":41}],43:[function(e,i,n){i.exports=function(s,o,a,l){for(var u=65535&s|0,c=s>>>16&65535|0,h=0;a!==0;){for(a-=h=2e3>>1:o>>>1;a[l]=o}return a}();i.exports=function(o,a,l,u){var c=s,h=u+l;o^=-1;for(var p=u;p>>8^c[255&(o^a[p])];return-1^o}},{}],46:[function(e,i,n){var s,o=e("../utils/common"),a=e("./trees"),l=e("./adler32"),u=e("./crc32"),c=e("./messages"),h=0,p=4,f=0,y=-2,g=-1,d=4,m=2,_=8,S=9,E=286,b=30,F=19,x=2*E+1,z=15,B=3,tt=258,st=tt+B+1,I=42,Z=113,w=1,it=2,M=3,O=4;function D(v,K){return v.msg=c[K],K}function U(v){return(v<<1)-(4v.avail_out&&(q=v.avail_out),q!==0&&(o.arraySet(v.output,K.pending_buf,K.pending_out,q,v.next_out),v.next_out+=q,K.pending_out+=q,v.total_out+=q,v.avail_out-=q,K.pending-=q,K.pending===0&&(K.pending_out=0))}function A(v,K){a._tr_flush_block(v,0<=v.block_start?v.block_start:-1,v.strstart-v.block_start,K),v.block_start=v.strstart,C(v.strm)}function V(v,K){v.pending_buf[v.pending++]=K}function et(v,K){v.pending_buf[v.pending++]=K>>>8&255,v.pending_buf[v.pending++]=255&K}function J(v,K){var q,N,R=v.max_chain_length,Y=v.strstart,ot=v.prev_length,at=v.nice_match,rt=v.strstart>v.w_size-st?v.strstart-(v.w_size-st):0,ht=v.window,bt=v.w_mask,pt=v.prev,Ot=v.strstart+tt,ye=ht[Y+ot-1],oe=ht[Y+ot];v.prev_length>=v.good_match&&(R>>=2),at>v.lookahead&&(at=v.lookahead);do if(ht[(q=K)+ot]===oe&&ht[q+ot-1]===ye&&ht[q]===ht[Y]&&ht[++q]===ht[Y+1]){Y+=2,q++;do;while(ht[++Y]===ht[++q]&&ht[++Y]===ht[++q]&&ht[++Y]===ht[++q]&&ht[++Y]===ht[++q]&&ht[++Y]===ht[++q]&&ht[++Y]===ht[++q]&&ht[++Y]===ht[++q]&&ht[++Y]===ht[++q]&&Yrt&&--R!=0);return ot<=v.lookahead?ot:v.lookahead}function yt(v){var K,q,N,R,Y,ot,at,rt,ht,bt,pt=v.w_size;do{if(R=v.window_size-v.lookahead-v.strstart,v.strstart>=pt+(pt-st)){for(o.arraySet(v.window,v.window,pt,pt,0),v.match_start-=pt,v.strstart-=pt,v.block_start-=pt,K=q=v.hash_size;N=v.head[--K],v.head[K]=pt<=N?N-pt:0,--q;);for(K=q=pt;N=v.prev[--K],v.prev[K]=pt<=N?N-pt:0,--q;);R+=pt}if(v.strm.avail_in===0)break;if(ot=v.strm,at=v.window,rt=v.strstart+v.lookahead,ht=R,bt=void 0,bt=ot.avail_in,ht=B)for(Y=v.strstart-v.insert,v.ins_h=v.window[Y],v.ins_h=(v.ins_h<=B&&(v.ins_h=(v.ins_h<=B)if(N=a._tr_tally(v,v.strstart-v.match_start,v.match_length-B),v.lookahead-=v.match_length,v.match_length<=v.max_lazy_match&&v.lookahead>=B){for(v.match_length--;v.strstart++,v.ins_h=(v.ins_h<=B&&(v.ins_h=(v.ins_h<=B&&v.match_length<=v.prev_length){for(R=v.strstart+v.lookahead-B,N=a._tr_tally(v,v.strstart-1-v.prev_match,v.prev_length-B),v.lookahead-=v.prev_length-1,v.prev_length-=2;++v.strstart<=R&&(v.ins_h=(v.ins_h<v.pending_buf_size-5&&(q=v.pending_buf_size-5);;){if(v.lookahead<=1){if(yt(v),v.lookahead===0&&K===h)return w;if(v.lookahead===0)break}v.strstart+=v.lookahead,v.lookahead=0;var N=v.block_start+q;if((v.strstart===0||v.strstart>=N)&&(v.lookahead=v.strstart-N,v.strstart=N,A(v,!1),v.strm.avail_out===0)||v.strstart-v.block_start>=v.w_size-st&&(A(v,!1),v.strm.avail_out===0))return w}return v.insert=0,K===p?(A(v,!0),v.strm.avail_out===0?M:O):(v.strstart>v.block_start&&(A(v,!1),v.strm.avail_out),w)}),new _t(4,4,8,4,vt),new _t(4,5,16,8,vt),new _t(4,6,32,32,vt),new _t(4,4,16,16,dt),new _t(8,16,32,32,dt),new _t(8,16,128,128,dt),new _t(8,32,128,256,dt),new _t(32,128,258,1024,dt),new _t(32,258,258,4096,dt)],n.deflateInit=function(v,K){return he(v,K,_,15,8,0)},n.deflateInit2=he,n.deflateReset=ee,n.deflateResetKeep=Ct,n.deflateSetHeader=function(v,K){return v&&v.state?v.state.wrap!==2?y:(v.state.gzhead=K,f):y},n.deflate=function(v,K){var q,N,R,Y;if(!v||!v.state||5>8&255),V(N,N.gzhead.time>>16&255),V(N,N.gzhead.time>>24&255),V(N,N.level===9?2:2<=N.strategy||N.level<2?4:0),V(N,255&N.gzhead.os),N.gzhead.extra&&N.gzhead.extra.length&&(V(N,255&N.gzhead.extra.length),V(N,N.gzhead.extra.length>>8&255)),N.gzhead.hcrc&&(v.adler=u(v.adler,N.pending_buf,N.pending,0)),N.gzindex=0,N.status=69):(V(N,0),V(N,0),V(N,0),V(N,0),V(N,0),V(N,N.level===9?2:2<=N.strategy||N.level<2?4:0),V(N,3),N.status=Z);else{var ot=_+(N.w_bits-8<<4)<<8;ot|=(2<=N.strategy||N.level<2?0:N.level<6?1:N.level===6?2:3)<<6,N.strstart!==0&&(ot|=32),ot+=31-ot%31,N.status=Z,et(N,ot),N.strstart!==0&&(et(N,v.adler>>>16),et(N,65535&v.adler)),v.adler=1}if(N.status===69)if(N.gzhead.extra){for(R=N.pending;N.gzindex<(65535&N.gzhead.extra.length)&&(N.pending!==N.pending_buf_size||(N.gzhead.hcrc&&N.pending>R&&(v.adler=u(v.adler,N.pending_buf,N.pending-R,R)),C(v),R=N.pending,N.pending!==N.pending_buf_size));)V(N,255&N.gzhead.extra[N.gzindex]),N.gzindex++;N.gzhead.hcrc&&N.pending>R&&(v.adler=u(v.adler,N.pending_buf,N.pending-R,R)),N.gzindex===N.gzhead.extra.length&&(N.gzindex=0,N.status=73)}else N.status=73;if(N.status===73)if(N.gzhead.name){R=N.pending;do{if(N.pending===N.pending_buf_size&&(N.gzhead.hcrc&&N.pending>R&&(v.adler=u(v.adler,N.pending_buf,N.pending-R,R)),C(v),R=N.pending,N.pending===N.pending_buf_size)){Y=1;break}Y=N.gzindexR&&(v.adler=u(v.adler,N.pending_buf,N.pending-R,R)),Y===0&&(N.gzindex=0,N.status=91)}else N.status=91;if(N.status===91)if(N.gzhead.comment){R=N.pending;do{if(N.pending===N.pending_buf_size&&(N.gzhead.hcrc&&N.pending>R&&(v.adler=u(v.adler,N.pending_buf,N.pending-R,R)),C(v),R=N.pending,N.pending===N.pending_buf_size)){Y=1;break}Y=N.gzindexR&&(v.adler=u(v.adler,N.pending_buf,N.pending-R,R)),Y===0&&(N.status=103)}else N.status=103;if(N.status===103&&(N.gzhead.hcrc?(N.pending+2>N.pending_buf_size&&C(v),N.pending+2<=N.pending_buf_size&&(V(N,255&v.adler),V(N,v.adler>>8&255),v.adler=0,N.status=Z)):N.status=Z),N.pending!==0){if(C(v),v.avail_out===0)return N.last_flush=-1,f}else if(v.avail_in===0&&U(K)<=U(q)&&K!==p)return D(v,-5);if(N.status===666&&v.avail_in!==0)return D(v,-5);if(v.avail_in!==0||N.lookahead!==0||K!==h&&N.status!==666){var at=N.strategy===2?function(rt,ht){for(var bt;;){if(rt.lookahead===0&&(yt(rt),rt.lookahead===0)){if(ht===h)return w;break}if(rt.match_length=0,bt=a._tr_tally(rt,0,rt.window[rt.strstart]),rt.lookahead--,rt.strstart++,bt&&(A(rt,!1),rt.strm.avail_out===0))return w}return rt.insert=0,ht===p?(A(rt,!0),rt.strm.avail_out===0?M:O):rt.last_lit&&(A(rt,!1),rt.strm.avail_out===0)?w:it}(N,K):N.strategy===3?function(rt,ht){for(var bt,pt,Ot,ye,oe=rt.window;;){if(rt.lookahead<=tt){if(yt(rt),rt.lookahead<=tt&&ht===h)return w;if(rt.lookahead===0)break}if(rt.match_length=0,rt.lookahead>=B&&0rt.lookahead&&(rt.match_length=rt.lookahead)}if(rt.match_length>=B?(bt=a._tr_tally(rt,1,rt.match_length-B),rt.lookahead-=rt.match_length,rt.strstart+=rt.match_length,rt.match_length=0):(bt=a._tr_tally(rt,0,rt.window[rt.strstart]),rt.lookahead--,rt.strstart++),bt&&(A(rt,!1),rt.strm.avail_out===0))return w}return rt.insert=0,ht===p?(A(rt,!0),rt.strm.avail_out===0?M:O):rt.last_lit&&(A(rt,!1),rt.strm.avail_out===0)?w:it}(N,K):s[N.level].func(N,K);if(at!==M&&at!==O||(N.status=666),at===w||at===M)return v.avail_out===0&&(N.last_flush=-1),f;if(at===it&&(K===1?a._tr_align(N):K!==5&&(a._tr_stored_block(N,0,0,!1),K===3&&(k(N.head),N.lookahead===0&&(N.strstart=0,N.block_start=0,N.insert=0))),C(v),v.avail_out===0))return N.last_flush=-1,f}return K!==p?f:N.wrap<=0?1:(N.wrap===2?(V(N,255&v.adler),V(N,v.adler>>8&255),V(N,v.adler>>16&255),V(N,v.adler>>24&255),V(N,255&v.total_in),V(N,v.total_in>>8&255),V(N,v.total_in>>16&255),V(N,v.total_in>>24&255)):(et(N,v.adler>>>16),et(N,65535&v.adler)),C(v),0=q.w_size&&(Y===0&&(k(q.head),q.strstart=0,q.block_start=0,q.insert=0),ht=new o.Buf8(q.w_size),o.arraySet(ht,K,bt-q.w_size,q.w_size,0),K=ht,bt=q.w_size),ot=v.avail_in,at=v.next_in,rt=v.input,v.avail_in=bt,v.next_in=0,v.input=K,yt(q);q.lookahead>=B;){for(N=q.strstart,R=q.lookahead-(B-1);q.ins_h=(q.ins_h<>>=B=z>>>24,S-=B,(B=z>>>16&255)===0)it[c++]=65535&z;else{if(!(16&B)){if((64&B)==0){z=E[(65535&z)+(_&(1<>>=B,S-=B),S<15&&(_+=w[l++]<>>=B=z>>>24,S-=B,!(16&(B=z>>>16&255))){if((64&B)==0){z=b[(65535&z)+(_&(1<>>=B,S-=B,(B=c-h)>3,_&=(1<<(S-=tt<<3))-1,s.next_in=l,s.next_out=c,s.avail_in=l>>24&255)+(I>>>8&65280)+((65280&I)<<8)+((255&I)<<24)}function _(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new s.Buf16(320),this.work=new s.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function S(I){var Z;return I&&I.state?(Z=I.state,I.total_in=I.total_out=Z.total=0,I.msg="",Z.wrap&&(I.adler=1&Z.wrap),Z.mode=y,Z.last=0,Z.havedict=0,Z.dmax=32768,Z.head=null,Z.hold=0,Z.bits=0,Z.lencode=Z.lendyn=new s.Buf32(g),Z.distcode=Z.distdyn=new s.Buf32(d),Z.sane=1,Z.back=-1,p):f}function E(I){var Z;return I&&I.state?((Z=I.state).wsize=0,Z.whave=0,Z.wnext=0,S(I)):f}function b(I,Z){var w,it;return I&&I.state?(it=I.state,Z<0?(w=0,Z=-Z):(w=1+(Z>>4),Z<48&&(Z&=15)),Z&&(Z<8||15=O.wsize?(s.arraySet(O.window,Z,w-O.wsize,O.wsize,0),O.wnext=0,O.whave=O.wsize):(it<(M=O.wsize-O.wnext)&&(M=it),s.arraySet(O.window,Z,w-it,M,O.wnext),(it-=M)?(s.arraySet(O.window,Z,w-it,it,0),O.wnext=it,O.whave=O.wsize):(O.wnext+=M,O.wnext===O.wsize&&(O.wnext=0),O.whave>>8&255,w.check=a(w.check,Y,2,0),A=C=0,w.mode=2;break}if(w.flags=0,w.head&&(w.head.done=!1),!(1&w.wrap)||(((255&C)<<8)+(C>>8))%31){I.msg="incorrect header check",w.mode=30;break}if((15&C)!=8){I.msg="unknown compression method",w.mode=30;break}if(A-=4,v=8+(15&(C>>>=4)),w.wbits===0)w.wbits=v;else if(v>w.wbits){I.msg="invalid window size",w.mode=30;break}w.dmax=1<>8&1),512&w.flags&&(Y[0]=255&C,Y[1]=C>>>8&255,w.check=a(w.check,Y,2,0)),A=C=0,w.mode=3;case 3:for(;A<32;){if(U===0)break t;U--,C+=it[O++]<>>8&255,Y[2]=C>>>16&255,Y[3]=C>>>24&255,w.check=a(w.check,Y,4,0)),A=C=0,w.mode=4;case 4:for(;A<16;){if(U===0)break t;U--,C+=it[O++]<>8),512&w.flags&&(Y[0]=255&C,Y[1]=C>>>8&255,w.check=a(w.check,Y,2,0)),A=C=0,w.mode=5;case 5:if(1024&w.flags){for(;A<16;){if(U===0)break t;U--,C+=it[O++]<>>8&255,w.check=a(w.check,Y,2,0)),A=C=0}else w.head&&(w.head.extra=null);w.mode=6;case 6:if(1024&w.flags&&(U<(J=w.length)&&(J=U),J&&(w.head&&(v=w.head.extra_len-w.length,w.head.extra||(w.head.extra=new Array(w.head.extra_len)),s.arraySet(w.head.extra,it,O,J,v)),512&w.flags&&(w.check=a(w.check,it,J,O)),U-=J,O+=J,w.length-=J),w.length))break t;w.length=0,w.mode=7;case 7:if(2048&w.flags){if(U===0)break t;for(J=0;v=it[O+J++],w.head&&v&&w.length<65536&&(w.head.name+=String.fromCharCode(v)),v&&J>9&1,w.head.done=!0),I.adler=w.check=0,w.mode=12;break;case 10:for(;A<32;){if(U===0)break t;U--,C+=it[O++]<>>=7&A,A-=7&A,w.mode=27;break}for(;A<3;){if(U===0)break t;U--,C+=it[O++]<>>=1)){case 0:w.mode=14;break;case 1:if(tt(w),w.mode=20,Z!==6)break;C>>>=2,A-=2;break t;case 2:w.mode=17;break;case 3:I.msg="invalid block type",w.mode=30}C>>>=2,A-=2;break;case 14:for(C>>>=7&A,A-=7&A;A<32;){if(U===0)break t;U--,C+=it[O++]<>>16^65535)){I.msg="invalid stored block lengths",w.mode=30;break}if(w.length=65535&C,A=C=0,w.mode=15,Z===6)break t;case 15:w.mode=16;case 16:if(J=w.length){if(U>>=5,A-=5,w.ndist=1+(31&C),C>>>=5,A-=5,w.ncode=4+(15&C),C>>>=4,A-=4,286>>=3,A-=3}for(;w.have<19;)w.lens[ot[w.have++]]=0;if(w.lencode=w.lendyn,w.lenbits=7,q={bits:w.lenbits},K=u(0,w.lens,0,19,w.lencode,0,w.work,q),w.lenbits=q.bits,K){I.msg="invalid code lengths set",w.mode=30;break}w.have=0,w.mode=19;case 19:for(;w.have>>16&255,gt=65535&R,!((dt=R>>>24)<=A);){if(U===0)break t;U--,C+=it[O++]<>>=dt,A-=dt,w.lens[w.have++]=gt;else{if(gt===16){for(N=dt+2;A>>=dt,A-=dt,w.have===0){I.msg="invalid bit length repeat",w.mode=30;break}v=w.lens[w.have-1],J=3+(3&C),C>>>=2,A-=2}else if(gt===17){for(N=dt+3;A>>=dt)),C>>>=3,A-=3}else{for(N=dt+7;A>>=dt)),C>>>=7,A-=7}if(w.have+J>w.nlen+w.ndist){I.msg="invalid bit length repeat",w.mode=30;break}for(;J--;)w.lens[w.have++]=v}}if(w.mode===30)break;if(w.lens[256]===0){I.msg="invalid code -- missing end-of-block",w.mode=30;break}if(w.lenbits=9,q={bits:w.lenbits},K=u(c,w.lens,0,w.nlen,w.lencode,0,w.work,q),w.lenbits=q.bits,K){I.msg="invalid literal/lengths set",w.mode=30;break}if(w.distbits=6,w.distcode=w.distdyn,q={bits:w.distbits},K=u(h,w.lens,w.nlen,w.ndist,w.distcode,0,w.work,q),w.distbits=q.bits,K){I.msg="invalid distances set",w.mode=30;break}if(w.mode=20,Z===6)break t;case 20:w.mode=21;case 21:if(6<=U&&258<=k){I.next_out=D,I.avail_out=k,I.next_in=O,I.avail_in=U,w.hold=C,w.bits=A,l(I,et),D=I.next_out,M=I.output,k=I.avail_out,O=I.next_in,it=I.input,U=I.avail_in,C=w.hold,A=w.bits,w.mode===12&&(w.back=-1);break}for(w.back=0;_t=(R=w.lencode[C&(1<>>16&255,gt=65535&R,!((dt=R>>>24)<=A);){if(U===0)break t;U--,C+=it[O++]<>Ct)])>>>16&255,gt=65535&R,!(Ct+(dt=R>>>24)<=A);){if(U===0)break t;U--,C+=it[O++]<>>=Ct,A-=Ct,w.back+=Ct}if(C>>>=dt,A-=dt,w.back+=dt,w.length=gt,_t===0){w.mode=26;break}if(32&_t){w.back=-1,w.mode=12;break}if(64&_t){I.msg="invalid literal/length code",w.mode=30;break}w.extra=15&_t,w.mode=22;case 22:if(w.extra){for(N=w.extra;A>>=w.extra,A-=w.extra,w.back+=w.extra}w.was=w.length,w.mode=23;case 23:for(;_t=(R=w.distcode[C&(1<>>16&255,gt=65535&R,!((dt=R>>>24)<=A);){if(U===0)break t;U--,C+=it[O++]<>Ct)])>>>16&255,gt=65535&R,!(Ct+(dt=R>>>24)<=A);){if(U===0)break t;U--,C+=it[O++]<>>=Ct,A-=Ct,w.back+=Ct}if(C>>>=dt,A-=dt,w.back+=dt,64&_t){I.msg="invalid distance code",w.mode=30;break}w.offset=gt,w.extra=15&_t,w.mode=24;case 24:if(w.extra){for(N=w.extra;A>>=w.extra,A-=w.extra,w.back+=w.extra}if(w.offset>w.dmax){I.msg="invalid distance too far back",w.mode=30;break}w.mode=25;case 25:if(k===0)break t;if(J=et-k,w.offset>J){if((J=w.offset-J)>w.whave&&w.sane){I.msg="invalid distance too far back",w.mode=30;break}yt=J>w.wnext?(J-=w.wnext,w.wsize-J):w.wnext-J,J>w.length&&(J=w.length),vt=w.window}else vt=M,yt=D-w.offset,J=w.length;for(kx?(B=yt[vt+d[Z]],A[V+d[Z]]):(B=96,0),_=1<>D)+(S-=_)]=z<<24|B<<16|tt|0,S!==0;);for(_=1<>=1;if(_!==0?(C&=_-1,C+=_):C=0,Z++,--et[I]==0){if(I===it)break;I=h[p+d[Z]]}if(M>>7)]}function V(R,Y){R.pending_buf[R.pending++]=255&Y,R.pending_buf[R.pending++]=Y>>>8&255}function et(R,Y,ot){R.bi_valid>m-ot?(R.bi_buf|=Y<>m-R.bi_valid,R.bi_valid+=ot-m):(R.bi_buf|=Y<>>=1,ot<<=1,0<--Y;);return ot>>>1}function vt(R,Y,ot){var at,rt,ht=new Array(d+1),bt=0;for(at=1;at<=d;at++)ht[at]=bt=bt+ot[at-1]<<1;for(rt=0;rt<=Y;rt++){var pt=R[2*rt+1];pt!==0&&(R[2*rt]=yt(ht[pt]++,pt))}}function dt(R){var Y;for(Y=0;Y>1;1<=ot;ot--)Ct(R,ht,ot);for(rt=Ot;ot=R.heap[1],R.heap[1]=R.heap[R.heap_len--],Ct(R,ht,1),at=R.heap[1],R.heap[--R.heap_max]=ot,R.heap[--R.heap_max]=at,ht[2*rt]=ht[2*ot]+ht[2*at],R.depth[rt]=(R.depth[ot]>=R.depth[at]?R.depth[ot]:R.depth[at])+1,ht[2*ot+1]=ht[2*at+1]=rt,R.heap[1]=rt++,Ct(R,ht,1),2<=R.heap_len;);R.heap[--R.heap_max]=R.heap[1],function(oe,ir){var Ki,vr,Zi,Ae,Ji,ao,Qr=ir.dyn_tree,fs=ir.max_code,ma=ir.stat_desc.static_tree,hu=ir.stat_desc.has_stree,si=ir.stat_desc.extra_bits,ya=ir.stat_desc.extra_base,In=ir.stat_desc.max_length,En=0;for(Ae=0;Ae<=d;Ae++)oe.bl_count[Ae]=0;for(Qr[2*oe.heap[oe.heap_max]+1]=0,Ki=oe.heap_max+1;Ki>=7;rt>>=1)if(1&ye&&pt.dyn_ltree[2*Ot]!==0)return o;if(pt.dyn_ltree[18]!==0||pt.dyn_ltree[20]!==0||pt.dyn_ltree[26]!==0)return a;for(Ot=32;Ot>>3,(ht=R.static_len+3+7>>>3)<=rt&&(rt=ht)):rt=ht=ot+5,ot+4<=rt&&Y!==-1?N(R,Y,ot,at):R.strategy===4||ht===rt?(et(R,2+(at?1:0),3),ee(R,st,I)):(et(R,4+(at?1:0),3),function(pt,Ot,ye,oe){var ir;for(et(pt,Ot-257,5),et(pt,ye-1,5),et(pt,oe-4,4),ir=0;ir>>8&255,R.pending_buf[R.d_buf+2*R.last_lit+1]=255&Y,R.pending_buf[R.l_buf+R.last_lit]=255&ot,R.last_lit++,Y===0?R.dyn_ltree[2*ot]++:(R.matches++,Y--,R.dyn_ltree[2*(w[ot]+h+1)]++,R.dyn_dtree[2*A(Y)]++),R.last_lit===R.lit_bufsize-1},n._tr_align=function(R){et(R,2,3),J(R,S,st),function(Y){Y.bi_valid===16?(V(Y,Y.bi_buf),Y.bi_buf=0,Y.bi_valid=0):8<=Y.bi_valid&&(Y.pending_buf[Y.pending++]=255&Y.bi_buf,Y.bi_buf>>=8,Y.bi_valid-=8)}(R)}},{"../utils/common":41}],53:[function(e,i,n){i.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(e,i,n){(function(s){(function(o,a){if(!o.setImmediate){var l,u,c,h,p=1,f={},y=!1,g=o.document,d=Object.getPrototypeOf&&Object.getPrototypeOf(o);d=d&&d.setTimeout?d:o,l={}.toString.call(o.process)==="[object process]"?function(E){process.nextTick(function(){_(E)})}:function(){if(o.postMessage&&!o.importScripts){var E=!0,b=o.onmessage;return o.onmessage=function(){E=!1},o.postMessage("","*"),o.onmessage=b,E}}()?(h="setImmediate$"+Math.random()+"$",o.addEventListener?o.addEventListener("message",S,!1):o.attachEvent("onmessage",S),function(E){o.postMessage(h+E,"*")}):o.MessageChannel?((c=new MessageChannel).port1.onmessage=function(E){_(E.data)},function(E){c.port2.postMessage(E)}):g&&"onreadystatechange"in g.createElement("script")?(u=g.documentElement,function(E){var b=g.createElement("script");b.onreadystatechange=function(){_(E),b.onreadystatechange=null,u.removeChild(b),b=null},u.appendChild(b)}):function(E){setTimeout(_,0,E)},d.setImmediate=function(E){typeof E!="function"&&(E=new Function(""+E));for(var b=new Array(arguments.length-1),F=0;F"u"?s===void 0?this:s:self)}).call(this,typeof gi<"u"?gi:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})}(Gu)),Gu.exports}var dC=fC();const pC=Nh(dC);Ai.zipReader=(r,t)=>pC.loadAsync(r);const mC=Ai.createSettings;Ai.createSettings=async r=>{const t=Object.keys(r.files);return t.find(e=>yC(e))?mC(r):_C(t)};function yC(r){return r.endsWith("model3.json")}function gC(r){return r.endsWith(".moc3")}function vC(r){return r.split(/[\\/]/).pop()}function _C(r){const t=r.filter(u=>gC(u));if(t.length!==1){const u=t.length?`(${t.map(c=>`"${c}"`).join(",")})`:"";throw new Error(`Expected exactly one moc file, got ${t.length} ${u}`)}const e=t[0],i=vC(e).replace(/\.moc3?/,""),n=r.filter(u=>u.endsWith(".png"));if(!n.length)throw new Error("Textures not found");const s=r.filter(u=>u.endsWith(".mtn")||u.endsWith(".motion3.json")),o=r.find(u=>u.includes("physics")),a=r.find(u=>u.includes("pose")),l=new Jn({url:`${i}.model3.json`,Version:3,FileReferences:{Moc:e,Textures:n,Physics:o,Pose:a,Motions:s.length?{"":s.map(u=>({File:u}))}:void 0}});return l.name=i,l._objectURL=`example://${l.url}`,l}Ai.readText=(r,t)=>{const e=r.file(t);if(!e)throw new Error(`Cannot find file: ${t}`);return e.async("text")};Ai.getFilePaths=r=>{const t=[];return r.forEach(e=>t.push(e)),Promise.resolve(t)};Ai.getFiles=(r,t)=>Promise.all(t.map(async e=>{const i=e.slice(e.lastIndexOf("/")+1),n=await r.file(e).async("blob");return new File([n],i)}));function Zt(r,t,e,i){function n(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(i.next(c))}catch(h){o(h)}}function l(c){try{u(i.throw(c))}catch(h){o(h)}}function u(c){c.done?s(c.value):n(c.value).then(a,l)}u((i=i.apply(r,t||[])).next())})}function up(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],i=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&i>=r.length&&(r=void 0),{value:r&&r[i++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Pt(r){return this instanceof Pt?(this.v=r,this):new Pt(r)}function dr(r,t,e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=e.apply(r,t||[]),n,s=[];return n=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",o),n[Symbol.asyncIterator]=function(){return this},n;function o(f){return function(y){return Promise.resolve(y).then(f,h)}}function a(f,y){i[f]&&(n[f]=function(g){return new Promise(function(d,m){s.push([f,g,d,m])>1||l(f,g)})},y&&(n[f]=y(n[f])))}function l(f,y){try{u(i[f](y))}catch(g){p(s[0][3],g)}}function u(f){f.value instanceof Pt?Promise.resolve(f.value.v).then(c,h):p(s[0][2],f)}function c(f){l("next",f)}function h(f){l("throw",f)}function p(f,y){f(y),s.shift(),s.length&&l(s[0][0],s[0][1])}}function ts(r){var t,e;return t={},i("next"),i("throw",function(n){throw n}),i("return"),t[Symbol.iterator]=function(){return this},t;function i(n,s){t[n]=r[n]?function(o){return(e=!e)?{value:Pt(r[n](o)),done:!1}:s?s(o):o}:s}}function bi(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 up=="function"?up(r):r[Symbol.iterator](),e={},i("next"),i("throw"),i("return"),e[Symbol.asyncIterator]=function(){return this},e);function i(s){e[s]=r[s]&&function(o){return new Promise(function(a,l){o=r[s](o),n(a,l,o.done,o.value)})}}function n(s,o,a,l){Promise.resolve(l).then(function(u){s({value:u,done:a})},o)}}const bC=new TextDecoder("utf-8"),eh=r=>bC.decode(r),wC=new TextEncoder,ef=r=>wC.encode(r),xC=r=>typeof r=="number",_v=r=>typeof r=="boolean",Ge=r=>typeof r=="function",pr=r=>r!=null&&Object(r)===r,rs=r=>pr(r)&&Ge(r.then),oa=r=>pr(r)&&Ge(r[Symbol.iterator]),no=r=>pr(r)&&Ge(r[Symbol.asyncIterator]),rh=r=>pr(r)&&pr(r.schema),bv=r=>pr(r)&&"done"in r&&"value"in r,wv=r=>pr(r)&&Ge(r.stat)&&xC(r.fd),xv=r=>pr(r)&&rf(r.body),tu=r=>"_getDOMStream"in r&&"_getNodeStream"in r,SC=r=>pr(r)&&Ge(r.abort)&&Ge(r.getWriter)&&!tu(r),rf=r=>pr(r)&&Ge(r.cancel)&&Ge(r.getReader)&&!tu(r),TC=r=>pr(r)&&Ge(r.end)&&Ge(r.write)&&_v(r.writable)&&!tu(r),Sv=r=>pr(r)&&Ge(r.read)&&Ge(r.pipe)&&_v(r.readable)&&!tu(r),IC=r=>pr(r)&&Ge(r.clear)&&Ge(r.bytes)&&Ge(r.position)&&Ge(r.setPosition)&&Ge(r.capacity)&&Ge(r.getBufferIdentifier)&&Ge(r.createLong),nf=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:ArrayBuffer;function EC(r){const t=r[0]?[r[0]]:[];let e,i,n,s;for(let o,a,l=0,u=0,c=r.length;++lc+h.byteLength,0);let n,s,o,a=0,l=-1;const u=Math.min(t||Number.POSITIVE_INFINITY,i);for(const c=e.length;++l_e(Int32Array,r),hp=r=>_e(BigInt64Array,r),ae=r=>_e(Uint8Array,r),ih=r=>(r.next(),r);function*CC(r,t){const e=function*(n){yield n},i=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof nf?e(t):oa(t)?t:e(t);return yield*ih(function*(n){let s=null;do s=n.next(yield _e(r,s));while(!s.done)}(i[Symbol.iterator]())),new r}const AC=r=>CC(Uint8Array,r);function Tv(r,t){return dr(this,arguments,function*(){if(rs(t))return yield Pt(yield Pt(yield*ts(bi(Tv(r,yield Pt(t))))));const i=function(o){return dr(this,arguments,function*(){yield yield Pt(yield Pt(o))})},n=function(o){return dr(this,arguments,function*(){yield Pt(yield*ts(bi(ih(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 nf?i(t):oa(t)?n(t):no(t)?t:i(t);return yield Pt(yield*ts(bi(ih(function(o){return dr(this,arguments,function*(){let a=null;do a=yield Pt(o.next(yield yield Pt(_e(r,a))));while(!a.done)})}(s[Symbol.asyncIterator]()))))),yield Pt(new r)})}const OC=r=>Tv(Uint8Array,r);function Iv(r,t,e){if(r!==0){e=e.slice(0,t);for(let i=-1,n=e.length;++i0)do if(r[e]!==t[e])return!1;while(++e(r.next(),r);function*PC(r){let t,e=!1,i=[],n,s,o,a=0;function l(){return s==="peek"?xi(i,o)[0]:([n,i,a]=xi(i,o),n)}({cmd:s,size:o}=(yield null)||{cmd:"read",size:0});const u=AC(r)[Symbol.iterator]();try{do if({done:t,value:n}=Number.isNaN(o-a)?u.next():u.next(o-a),!t&&n.byteLength>0&&(i.push(n),a+=n.byteLength),t||o<=a)do({cmd:s,size:o}=yield l());while(o0&&(n.push(s),l+=s.byteLength),e||a<=l)do({cmd:o,size:a}=yield yield Pt(u()));while(a0&&(n.push(ae(s)),l+=s.byteLength),e||a<=l)do({cmd:o,size:a}=yield yield Pt(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 Zt(this,void 0,void 0,function*(){const{reader:e,source:i}=this;e&&(yield e.cancel(t).catch(()=>{})),i&&i.locked&&this.releaseLock()})}read(t){return Zt(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=ae(e)),e})}}const Wu=(r,t)=>{const e=n=>i([t,n]);let i;return[t,e,new Promise(n=>(i=n)&&r.once(t,e))]};function NC(r){return dr(this,arguments,function*(){const e=[];let i="error",n=!1,s=null,o,a,l=0,u=[],c;function h(){return o==="peek"?xi(u,a)[0]:([c,u,l]=xi(u,a),c)}if({cmd:o,size:a}=(yield yield Pt(null))||{cmd:"read",size:0},r.isTTY)return yield yield Pt(new Uint8Array(0)),yield Pt(null);try{e[0]=Wu(r,"end"),e[1]=Wu(r,"error");do{if(e[2]=Wu(r,"readable"),[i,s]=yield Pt(Promise.race(e.map(f=>f[2]))),i==="error")break;if((n=i==="end")||(Number.isFinite(a-l)?(c=ae(r.read(a-l)),c.byteLength0&&(u.push(c),l+=c.byteLength)),n||a<=l)do({cmd:o,size:a}=yield yield Pt(h()));while(a{for(const[m,_]of f)r.off(m,_);try{const m=r.destroy;m&&m.call(r,y),y=void 0}catch(m){y=m||y}finally{y!=null?d(y):g()}})}})}var ke;(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"})(ke||(ke={}));var er;(function(r){r[r.Sparse=0]="Sparse",r[r.Dense=1]="Dense"})(er||(er={}));var tr;(function(r){r[r.HALF=0]="HALF",r[r.SINGLE=1]="SINGLE",r[r.DOUBLE=2]="DOUBLE"})(tr||(tr={}));var Hr;(function(r){r[r.DAY=0]="DAY",r[r.MILLISECOND=1]="MILLISECOND"})(Hr||(Hr={}));var zt;(function(r){r[r.SECOND=0]="SECOND",r[r.MILLISECOND=1]="MILLISECOND",r[r.MICROSECOND=2]="MICROSECOND",r[r.NANOSECOND=3]="NANOSECOND"})(zt||(zt={}));var Si;(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"})(Si||(Si={}));const Hu=2,pi=4,ji=4,me=4,on=new Int32Array(2),fp=new Float32Array(on.buffer),dp=new Float64Array(on.buffer),Na=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1;var nh;(function(r){r[r.UTF8_BYTES=1]="UTF8_BYTES",r[r.UTF16_STRING=2]="UTF16_STRING"})(nh||(nh={}));let Qs=class Ev{constructor(t){this.bytes_=t,this.position_=0,this.text_decoder_=new TextDecoder}static allocate(t){return new Ev(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){fp[0]=e,this.writeInt32(t,on[0])}writeFloat64(t,e){dp[0]=e,this.writeInt32(t,on[Na?0:1]),this.writeInt32(t+4,on[Na?1:0])}getBufferIdentifier(){if(this.bytes_.lengththis.minalign&&(this.minalign=t);const i=~(this.bb.capacity()-this.space+e)+1&t-1;for(;this.space=0&&this.vtable[e]==0;e--);const i=e+1;for(;e>=0;e--)this.addInt16(this.vtable[e]!=0?t-this.vtable[e]:0);const n=2;this.addInt16(t-this.object_start);const s=(i+n)*Hu;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,pi+n),this.addOffset(t),n&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)}finishSizePrefixed(t,e){this.finish(t,e,!0)}requiredField(t,e){const i=this.bb.capacity()-t,n=i-this.bb.readInt32(i);if(!(e=0;i--)t.addInt32(e[i]);return t.endVector()}static startTypeIdsVector(t,e){t.startVector(4,e,4)}static endUnion(t){return t.endObject()}static createUnion(t,e,i){return hr.startUnion(t),hr.addMode(t,e),hr.addTypeIds(t,i),hr.endUnion(t)}}let bp=class Fo{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 Fo).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsUtf8(t,e){return t.setPosition(t.position()+me),(e||new Fo).__init(t.readInt32(t.position())+t.position(),t)}static startUtf8(t){t.startObject(0)}static endUtf8(t){return t.endObject()}static createUtf8(t){return Fo.startUtf8(t),Fo.endUtf8(t)}};var xe;(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"})(xe||(xe={}));let Nr=class Ga{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 Ga).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsField(t,e){return t.setPosition(t.position()+me),(e||new Ga).__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):xe.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 $i).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}children(t,e){const i=this.bb.__offset(this.bb_pos,14);return i?(e||new Ga).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+i)+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 i=this.bb.__offset(this.bb_pos,16);return i?(e||new We).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+i)+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,xe.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 i=e.length-1;i>=0;i--)t.addOffset(e[i]);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 i=e.length-1;i>=0;i--)t.addOffset(e[i]);return t.endVector()}static startCustomMetadataVector(t,e){t.startVector(4,e,4)}static endField(t){return t.endObject()}},ui=class Mi{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 Mi).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsSchema(t,e){return t.setPosition(t.position()+me),(e||new Mi).__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):Ks.Little}fields(t,e){const i=this.bb.__offset(this.bb_pos,6);return i?(e||new Nr).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+i)+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 i=this.bb.__offset(this.bb_pos,8);return i?(e||new We).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+i)+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,Ks.Little)}static addFields(t,e){t.addFieldOffset(1,e,0)}static createFieldsVector(t,e){t.startVector(4,e.length,4);for(let i=e.length-1;i>=0;i--)t.addOffset(e[i]);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 i=e.length-1;i>=0;i--)t.addOffset(e[i]);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 i=e.length-1;i>=0;i--)t.addInt64(e[i]);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,i,n,s){return Mi.startSchema(t),Mi.addEndianness(t,e),Mi.addFields(t,i),Mi.addCustomMetadata(t,n),Mi.addFeatures(t,s),Mi.endSchema(t)}};var fe;(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"})(fe||(fe={}));var L;(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"})(L||(L={}));var ki;(function(r){r[r.OFFSET=0]="OFFSET",r[r.DATA=1]="DATA",r[r.VALIDITY=2]="VALIDITY",r[r.TYPE=3]="TYPE"})(ki||(ki={}));const LC=void 0;function Xo(r){if(r===null)return"null";if(r===LC)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=>Xo(t))}]`:`[${r}]`:ArrayBuffer.isView(r)?`[${r}]`:JSON.stringify(r,(t,e)=>typeof e=="bigint"?`${e}`:e)}function we(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 Pv(r,t){return we(r/t)+we(r%t)/we(t)}const BC=Symbol.for("isArrowBigNum");function ri(r,...t){return t.length===0?Object.setPrototypeOf(_e(this.TypedArray,r),this.constructor.prototype):Object.setPrototypeOf(new this.TypedArray(r,...t),this.constructor.prototype)}ri.prototype[BC]=!0;ri.prototype.toJSON=function(){return`"${qo(this)}"`};ri.prototype.valueOf=function(r){return Mv(this,r)};ri.prototype.toString=function(){return qo(this)};ri.prototype[Symbol.toPrimitive]=function(r="default"){switch(r){case"number":return Mv(this);case"string":return qo(this);case"default":return zC(this)}return qo(this)};function zs(...r){return ri.apply(this,r)}function js(...r){return ri.apply(this,r)}function Yo(...r){return ri.apply(this,r)}Object.setPrototypeOf(zs.prototype,Object.create(Int32Array.prototype));Object.setPrototypeOf(js.prototype,Object.create(Uint32Array.prototype));Object.setPrototypeOf(Yo.prototype,Object.create(Uint32Array.prototype));Object.assign(zs.prototype,ri.prototype,{constructor:zs,signed:!0,TypedArray:Int32Array,BigIntArray:BigInt64Array});Object.assign(js.prototype,ri.prototype,{constructor:js,signed:!1,TypedArray:Uint32Array,BigIntArray:BigUint64Array});Object.assign(Yo.prototype,ri.prototype,{constructor:Yo,signed:!0,TypedArray:Uint32Array,BigIntArray:BigUint64Array});const kC=BigInt(4294967296)*BigInt(4294967296),UC=kC-BigInt(1);function Mv(r,t){const{buffer:e,byteOffset:i,byteLength:n,signed:s}=r,o=new BigUint64Array(e,i,n/8),a=s&&o.at(-1)&BigInt(1)<=0)return Xu(r);t=t.slice();let i=1;for(let s=0;s(r.children=null,r.ArrayType=Array,r.OffsetArrayType=Int32Array,r[Symbol.toStringTag]="DataType"))(At.prototype);let pn=class extends At{constructor(){super(L.Null)}toString(){return"Null"}};Nv=Symbol.toStringTag;pn[Nv]=(r=>r[Symbol.toStringTag]="Null")(pn.prototype);let is=class extends At{constructor(t,e){super(L.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}`}};Lv=Symbol.toStringTag;is[Lv]=(r=>(r.isSigned=null,r.bitWidth=null,r[Symbol.toStringTag]="Int"))(is.prototype);class Qo extends is{constructor(){super(!0,32)}get ArrayType(){return Int32Array}}Object.defineProperty(Qo.prototype,"ArrayType",{value:Int32Array});let cl=class extends At{constructor(t){super(L.Float),this.precision=t}get ArrayType(){switch(this.precision){case tr.HALF:return Uint16Array;case tr.SINGLE:return Float32Array;case tr.DOUBLE:return Float64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`Float${this.precision<<5||16}`}};Bv=Symbol.toStringTag;cl[Bv]=(r=>(r.precision=null,r[Symbol.toStringTag]="Float"))(cl.prototype);let hl=class extends At{constructor(){super(L.Binary)}toString(){return"Binary"}};kv=Symbol.toStringTag;hl[kv]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Binary"))(hl.prototype);let fl=class extends At{constructor(){super(L.LargeBinary)}toString(){return"LargeBinary"}};Uv=Symbol.toStringTag;fl[Uv]=(r=>(r.ArrayType=Uint8Array,r.OffsetArrayType=BigInt64Array,r[Symbol.toStringTag]="LargeBinary"))(fl.prototype);let dl=class extends At{constructor(){super(L.Utf8)}toString(){return"Utf8"}};zv=Symbol.toStringTag;dl[zv]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Utf8"))(dl.prototype);let pl=class extends At{constructor(){super(L.LargeUtf8)}toString(){return"LargeUtf8"}};jv=Symbol.toStringTag;pl[jv]=(r=>(r.ArrayType=Uint8Array,r.OffsetArrayType=BigInt64Array,r[Symbol.toStringTag]="LargeUtf8"))(pl.prototype);let ml=class extends At{constructor(){super(L.Bool)}toString(){return"Bool"}};$v=Symbol.toStringTag;ml[$v]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Bool"))(ml.prototype);let yl=class extends At{constructor(t,e,i=128){super(L.Decimal),this.scale=t,this.precision=e,this.bitWidth=i}toString(){return`Decimal[${this.precision}e${this.scale>0?"+":""}${this.scale}]`}};Vv=Symbol.toStringTag;yl[Vv]=(r=>(r.scale=null,r.precision=null,r.ArrayType=Uint32Array,r[Symbol.toStringTag]="Decimal"))(yl.prototype);let gl=class extends At{constructor(t){super(L.Date),this.unit=t}toString(){return`Date${(this.unit+1)*32}<${Hr[this.unit]}>`}get ArrayType(){return this.unit===Hr.DAY?Int32Array:BigInt64Array}};Gv=Symbol.toStringTag;gl[Gv]=(r=>(r.unit=null,r[Symbol.toStringTag]="Date"))(gl.prototype);let vl=class extends At{constructor(t,e){super(L.Time),this.unit=t,this.bitWidth=e}toString(){return`Time${this.bitWidth}<${zt[this.unit]}>`}get ArrayType(){switch(this.bitWidth){case 32:return Int32Array;case 64:return BigInt64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}};Wv=Symbol.toStringTag;vl[Wv]=(r=>(r.unit=null,r.bitWidth=null,r[Symbol.toStringTag]="Time"))(vl.prototype);let _l=class extends At{constructor(t,e){super(L.Timestamp),this.unit=t,this.timezone=e}toString(){return`Timestamp<${zt[this.unit]}${this.timezone?`, ${this.timezone}`:""}>`}};Hv=Symbol.toStringTag;_l[Hv]=(r=>(r.unit=null,r.timezone=null,r.ArrayType=BigInt64Array,r[Symbol.toStringTag]="Timestamp"))(_l.prototype);let bl=class extends At{constructor(t){super(L.Interval),this.unit=t}toString(){return`Interval<${Si[this.unit]}>`}};Xv=Symbol.toStringTag;bl[Xv]=(r=>(r.unit=null,r.ArrayType=Int32Array,r[Symbol.toStringTag]="Interval"))(bl.prototype);let wl=class extends At{constructor(t){super(L.Duration),this.unit=t}toString(){return`Duration<${zt[this.unit]}>`}};Yv=Symbol.toStringTag;wl[Yv]=(r=>(r.unit=null,r.ArrayType=BigInt64Array,r[Symbol.toStringTag]="Duration"))(wl.prototype);let xl=class extends At{constructor(t){super(L.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}};qv=Symbol.toStringTag;xl[qv]=(r=>(r.children=null,r[Symbol.toStringTag]="List"))(xl.prototype);let sr=class extends At{constructor(t){super(L.Struct),this.children=t}toString(){return`Struct<{${this.children.map(t=>`${t.name}:${t.type}`).join(", ")}}>`}};Qv=Symbol.toStringTag;sr[Qv]=(r=>(r.children=null,r[Symbol.toStringTag]="Struct"))(sr.prototype);let Sl=class extends At{constructor(t,e,i){super(L.Union),this.mode=t,this.children=i,this.typeIds=e=Int32Array.from(e),this.typeIdToChildIndex=e.reduce((n,s,o)=>(n[s]=o)&&n||n,Object.create(null))}toString(){return`${this[Symbol.toStringTag]}<${this.children.map(t=>`${t.type}`).join(" | ")}>`}};Kv=Symbol.toStringTag;Sl[Kv]=(r=>(r.mode=null,r.typeIds=null,r.children=null,r.typeIdToChildIndex=null,r.ArrayType=Int8Array,r[Symbol.toStringTag]="Union"))(Sl.prototype);let Tl=class extends At{constructor(t){super(L.FixedSizeBinary),this.byteWidth=t}toString(){return`FixedSizeBinary[${this.byteWidth}]`}};Zv=Symbol.toStringTag;Tl[Zv]=(r=>(r.byteWidth=null,r.ArrayType=Uint8Array,r[Symbol.toStringTag]="FixedSizeBinary"))(Tl.prototype);let Il=class extends At{constructor(t,e){super(L.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}>`}};Jv=Symbol.toStringTag;Il[Jv]=(r=>(r.children=null,r.listSize=null,r[Symbol.toStringTag]="FixedSizeList"))(Il.prototype);let El=class extends At{constructor(t,e=!1){var i,n,s;if(super(L.Map),this.children=[t],this.keysSorted=e,t&&(t.name="entries",!((i=t==null?void 0:t.type)===null||i===void 0)&&i.children)){const o=(n=t==null?void 0:t.type)===null||n===void 0?void 0:n.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(", ")}}>`}};t_=Symbol.toStringTag;El[t_]=(r=>(r.children=null,r.keysSorted=null,r[Symbol.toStringTag]="Map_"))(El.prototype);const $C=(r=>()=>++r)(-1);let Zs=class extends At{constructor(t,e,i,n){super(L.Dictionary),this.indices=e,this.dictionary=t,this.isOrdered=n||!1,this.id=i==null?$C():we(i)}get children(){return this.dictionary.children}get valueType(){return this.dictionary}get ArrayType(){return this.dictionary.ArrayType}toString(){return`Dictionary<${this.indices}, ${this.dictionary}>`}};e_=Symbol.toStringTag;Zs[e_]=(r=>(r.id=null,r.indices=null,r.isOrdered=null,r.dictionary=null,r[Symbol.toStringTag]="Dictionary"))(Zs.prototype);function Ui(r){const t=r;switch(r.typeId){case L.Decimal:return r.bitWidth/32;case L.Interval:return 1+t.unit;case L.FixedSizeList:return t.listSize;case L.FixedSizeBinary:return t.byteWidth;default:return 1}}let ie=class{visitMany(t,...e){return t.map((i,n)=>this.visit(i,...e.map(s=>s[n])))}visit(...t){return this.getVisitFn(t[0],!1).apply(this,t)}getVisitFn(t,e=!0){return VC(this,t,e)}getVisitFnByTypeId(t,e=!0){return As(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 VC(r,t,e=!0){return typeof t=="number"?As(r,t,e):typeof t=="string"&&t in L?As(r,L[t],e):t&&t instanceof At?As(r,wp(t),e):t!=null&&t.type&&t.type instanceof At?As(r,wp(t.type),e):As(r,L.NONE,e)}function As(r,t,e=!0){let i=null;switch(t){case L.Null:i=r.visitNull;break;case L.Bool:i=r.visitBool;break;case L.Int:i=r.visitInt;break;case L.Int8:i=r.visitInt8||r.visitInt;break;case L.Int16:i=r.visitInt16||r.visitInt;break;case L.Int32:i=r.visitInt32||r.visitInt;break;case L.Int64:i=r.visitInt64||r.visitInt;break;case L.Uint8:i=r.visitUint8||r.visitInt;break;case L.Uint16:i=r.visitUint16||r.visitInt;break;case L.Uint32:i=r.visitUint32||r.visitInt;break;case L.Uint64:i=r.visitUint64||r.visitInt;break;case L.Float:i=r.visitFloat;break;case L.Float16:i=r.visitFloat16||r.visitFloat;break;case L.Float32:i=r.visitFloat32||r.visitFloat;break;case L.Float64:i=r.visitFloat64||r.visitFloat;break;case L.Utf8:i=r.visitUtf8;break;case L.LargeUtf8:i=r.visitLargeUtf8;break;case L.Binary:i=r.visitBinary;break;case L.LargeBinary:i=r.visitLargeBinary;break;case L.FixedSizeBinary:i=r.visitFixedSizeBinary;break;case L.Date:i=r.visitDate;break;case L.DateDay:i=r.visitDateDay||r.visitDate;break;case L.DateMillisecond:i=r.visitDateMillisecond||r.visitDate;break;case L.Timestamp:i=r.visitTimestamp;break;case L.TimestampSecond:i=r.visitTimestampSecond||r.visitTimestamp;break;case L.TimestampMillisecond:i=r.visitTimestampMillisecond||r.visitTimestamp;break;case L.TimestampMicrosecond:i=r.visitTimestampMicrosecond||r.visitTimestamp;break;case L.TimestampNanosecond:i=r.visitTimestampNanosecond||r.visitTimestamp;break;case L.Time:i=r.visitTime;break;case L.TimeSecond:i=r.visitTimeSecond||r.visitTime;break;case L.TimeMillisecond:i=r.visitTimeMillisecond||r.visitTime;break;case L.TimeMicrosecond:i=r.visitTimeMicrosecond||r.visitTime;break;case L.TimeNanosecond:i=r.visitTimeNanosecond||r.visitTime;break;case L.Decimal:i=r.visitDecimal;break;case L.List:i=r.visitList;break;case L.Struct:i=r.visitStruct;break;case L.Union:i=r.visitUnion;break;case L.DenseUnion:i=r.visitDenseUnion||r.visitUnion;break;case L.SparseUnion:i=r.visitSparseUnion||r.visitUnion;break;case L.Dictionary:i=r.visitDictionary;break;case L.Interval:i=r.visitInterval;break;case L.IntervalDayTime:i=r.visitIntervalDayTime||r.visitInterval;break;case L.IntervalYearMonth:i=r.visitIntervalYearMonth||r.visitInterval;break;case L.Duration:i=r.visitDuration;break;case L.DurationSecond:i=r.visitDurationSecond||r.visitDuration;break;case L.DurationMillisecond:i=r.visitDurationMillisecond||r.visitDuration;break;case L.DurationMicrosecond:i=r.visitDurationMicrosecond||r.visitDuration;break;case L.DurationNanosecond:i=r.visitDurationNanosecond||r.visitDuration;break;case L.FixedSizeList:i=r.visitFixedSizeList;break;case L.Map:i=r.visitMap;break}if(typeof i=="function")return i;if(!e)return()=>null;throw new Error(`Unrecognized type '${L[t]}'`)}function wp(r){switch(r.typeId){case L.Null:return L.Null;case L.Int:{const{bitWidth:t,isSigned:e}=r;switch(t){case 8:return e?L.Int8:L.Uint8;case 16:return e?L.Int16:L.Uint16;case 32:return e?L.Int32:L.Uint32;case 64:return e?L.Int64:L.Uint64}return L.Int}case L.Float:switch(r.precision){case tr.HALF:return L.Float16;case tr.SINGLE:return L.Float32;case tr.DOUBLE:return L.Float64}return L.Float;case L.Binary:return L.Binary;case L.LargeBinary:return L.LargeBinary;case L.Utf8:return L.Utf8;case L.LargeUtf8:return L.LargeUtf8;case L.Bool:return L.Bool;case L.Decimal:return L.Decimal;case L.Time:switch(r.unit){case zt.SECOND:return L.TimeSecond;case zt.MILLISECOND:return L.TimeMillisecond;case zt.MICROSECOND:return L.TimeMicrosecond;case zt.NANOSECOND:return L.TimeNanosecond}return L.Time;case L.Timestamp:switch(r.unit){case zt.SECOND:return L.TimestampSecond;case zt.MILLISECOND:return L.TimestampMillisecond;case zt.MICROSECOND:return L.TimestampMicrosecond;case zt.NANOSECOND:return L.TimestampNanosecond}return L.Timestamp;case L.Date:switch(r.unit){case Hr.DAY:return L.DateDay;case Hr.MILLISECOND:return L.DateMillisecond}return L.Date;case L.Interval:switch(r.unit){case Si.DAY_TIME:return L.IntervalDayTime;case Si.YEAR_MONTH:return L.IntervalYearMonth}return L.Interval;case L.Duration:switch(r.unit){case zt.SECOND:return L.DurationSecond;case zt.MILLISECOND:return L.DurationMillisecond;case zt.MICROSECOND:return L.DurationMicrosecond;case zt.NANOSECOND:return L.DurationNanosecond}return L.Duration;case L.Map:return L.Map;case L.List:return L.List;case L.Struct:return L.Struct;case L.Union:switch(r.mode){case er.Dense:return L.DenseUnion;case er.Sparse:return L.SparseUnion}return L.Union;case L.FixedSizeBinary:return L.FixedSizeBinary;case L.FixedSizeList:return L.FixedSizeList;case L.Dictionary:return L.Dictionary}throw new Error(`Unrecognized type '${L[r.typeId]}'`)}ie.prototype.visitInt8=null;ie.prototype.visitInt16=null;ie.prototype.visitInt32=null;ie.prototype.visitInt64=null;ie.prototype.visitUint8=null;ie.prototype.visitUint16=null;ie.prototype.visitUint32=null;ie.prototype.visitUint64=null;ie.prototype.visitFloat16=null;ie.prototype.visitFloat32=null;ie.prototype.visitFloat64=null;ie.prototype.visitDateDay=null;ie.prototype.visitDateMillisecond=null;ie.prototype.visitTimestampSecond=null;ie.prototype.visitTimestampMillisecond=null;ie.prototype.visitTimestampMicrosecond=null;ie.prototype.visitTimestampNanosecond=null;ie.prototype.visitTimeSecond=null;ie.prototype.visitTimeMillisecond=null;ie.prototype.visitTimeMicrosecond=null;ie.prototype.visitTimeNanosecond=null;ie.prototype.visitDenseUnion=null;ie.prototype.visitSparseUnion=null;ie.prototype.visitIntervalDayTime=null;ie.prototype.visitIntervalYearMonth=null;ie.prototype.visitDuration=null;ie.prototype.visitDurationSecond=null;ie.prototype.visitDurationMillisecond=null;ie.prototype.visitDurationMicrosecond=null;ie.prototype.visitDurationNanosecond=null;const r_=new Float64Array(1),gs=new Uint32Array(r_.buffer);function i_(r){const t=(r&31744)>>10,e=(r&1023)/1024,i=Math.pow(-1,(r&32768)>>15);switch(t){case 31:return i*(e?Number.NaN:1/0);case 0:return i*(e?6103515625e-14*e:0)}return i*Math.pow(2,t-15)*(1+e)}function GC(r){if(r!==r)return 32256;r_[0]=r;const t=(gs[1]&2147483648)>>16&65535;let e=gs[1]&2146435072,i=0;return e>=1089470464?gs[0]>0?e=31744:(e=(e&2080374784)>>16,i=(gs[1]&1048575)>>10):e<=1056964608?(i=1048576+(gs[1]&1048575),i=1048576+(i<<(e>>20)-998)>>21,e=0):(e=e-1056964608>>10,i=(gs[1]&1048575)+512>>10),t|e|i&65535}let jt=class extends ie{};function Xt(r){return(t,e,i)=>{if(t.setValid(e,i!=null))return r(t,e,i)}}const WC=(r,t,e)=>{r[t]=Math.floor(e/864e5)},n_=(r,t,e,i)=>{if(e+1{const n=r+e;i?t[n>>3]|=1<>3]&=~(1<{r[t]=e},sf=({values:r},t,e)=>{r[t]=e},s_=({values:r},t,e)=>{r[t]=GC(e)},XC=(r,t,e)=>{switch(r.type.precision){case tr.HALF:return s_(r,t,e);case tr.SINGLE:case tr.DOUBLE:return sf(r,t,e)}},o_=({values:r},t,e)=>{WC(r,t,e.valueOf())},a_=({values:r},t,e)=>{r[t]=BigInt(e)},YC=({stride:r,values:t},e,i)=>{t.set(i.subarray(0,r),r*e)},l_=({values:r,valueOffsets:t},e,i)=>n_(r,t,e,i),u_=({values:r,valueOffsets:t},e,i)=>n_(r,t,e,ef(i)),qC=(r,t,e)=>{r.type.unit===Hr.DAY?o_(r,t,e):a_(r,t,e)},c_=({values:r},t,e)=>{r[t]=BigInt(e/1e3)},h_=({values:r},t,e)=>{r[t]=BigInt(e)},f_=({values:r},t,e)=>{r[t]=BigInt(e*1e3)},d_=({values:r},t,e)=>{r[t]=BigInt(e*1e6)},QC=(r,t,e)=>{switch(r.type.unit){case zt.SECOND:return c_(r,t,e);case zt.MILLISECOND:return h_(r,t,e);case zt.MICROSECOND:return f_(r,t,e);case zt.NANOSECOND:return d_(r,t,e)}},p_=({values:r},t,e)=>{r[t]=e},m_=({values:r},t,e)=>{r[t]=e},y_=({values:r},t,e)=>{r[t]=e},g_=({values:r},t,e)=>{r[t]=e},KC=(r,t,e)=>{switch(r.type.unit){case zt.SECOND:return p_(r,t,e);case zt.MILLISECOND:return m_(r,t,e);case zt.MICROSECOND:return y_(r,t,e);case zt.NANOSECOND:return g_(r,t,e)}},ZC=({values:r,stride:t},e,i)=>{r.set(i.subarray(0,t),t*e)},JC=(r,t,e)=>{const i=r.children[0],n=r.valueOffsets,s=Xr.getVisitFn(i);if(Array.isArray(e))for(let o=-1,a=n[t],l=n[t+1];a{const i=r.children[0],{valueOffsets:n}=r,s=Xr.getVisitFn(i);let{[t]:o,[t+1]:a}=n;const l=e instanceof Map?e.entries():Object.entries(e);for(const u of l)if(s(i,o,u),++o>=a)break},eA=(r,t)=>(e,i,n,s)=>i&&e(i,r,t[s]),rA=(r,t)=>(e,i,n,s)=>i&&e(i,r,t.get(s)),iA=(r,t)=>(e,i,n,s)=>i&&e(i,r,t.get(n.name)),nA=(r,t)=>(e,i,n,s)=>i&&e(i,r,t[n.name]),sA=(r,t,e)=>{const i=r.type.children.map(s=>Xr.getVisitFn(s.type)),n=e instanceof Map?iA(t,e):e instanceof Me?rA(t,e):Array.isArray(e)?eA(t,e):nA(t,e);r.type.children.forEach((s,o)=>n(i[o],r.children[o],s,o))},oA=(r,t,e)=>{r.type.mode===er.Dense?v_(r,t,e):__(r,t,e)},v_=(r,t,e)=>{const i=r.type.typeIdToChildIndex[r.typeIds[t]],n=r.children[i];Xr.visit(n,r.valueOffsets[t],e)},__=(r,t,e)=>{const i=r.type.typeIdToChildIndex[r.typeIds[t]],n=r.children[i];Xr.visit(n,t,e)},aA=(r,t,e)=>{var i;(i=r.dictionary)===null||i===void 0||i.set(r.values[t],e)},lA=(r,t,e)=>{r.type.unit===Si.DAY_TIME?b_(r,t,e):w_(r,t,e)},b_=({values:r},t,e)=>{r.set(e.subarray(0,2),2*t)},w_=({values:r},t,e)=>{r[t]=e[0]*12+e[1]%12},x_=({values:r},t,e)=>{r[t]=e},S_=({values:r},t,e)=>{r[t]=e},T_=({values:r},t,e)=>{r[t]=e},I_=({values:r},t,e)=>{r[t]=e},uA=(r,t,e)=>{switch(r.type.unit){case zt.SECOND:return x_(r,t,e);case zt.MILLISECOND:return S_(r,t,e);case zt.MICROSECOND:return T_(r,t,e);case zt.NANOSECOND:return I_(r,t,e)}},cA=(r,t,e)=>{const{stride:i}=r,n=r.children[0],s=Xr.getVisitFn(n);if(Array.isArray(e))for(let o=-1,a=t*i;++o`${Xo(t)}: ${Xo(e)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}[Symbol.iterator](){return new hA(this[Kr],this[$s])}},hA=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[Kr].type.children.findIndex(i=>i.name===e)!==-1}getOwnPropertyDescriptor(t,e){if(t[Kr].type.children.findIndex(i=>i.name===e)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(t,e){if(Reflect.has(t,e))return t[e];const i=t[Kr].type.children.findIndex(n=>n.name===e);if(i!==-1){const n=mr.visit(t[Kr].children[i],t[$s]);return Reflect.set(t,e,n),n}}set(t,e,i){const n=t[Kr].type.children.findIndex(s=>s.name===e);return n!==-1?(Xr.visit(t[Kr].children[n],t[$s],i),Reflect.set(t,e,i)):Reflect.has(t,e)||typeof e=="symbol"?Reflect.set(t,e,i):!1}},Mt=class extends ie{};function $t(r){return(t,e)=>t.getValid(e)?r(t,e):null}const dA=(r,t)=>864e5*r[t],pA=(r,t)=>null,E_=(r,t,e)=>{if(e+1>=t.length)return null;const i=we(t[e]),n=we(t[e+1]);return r.subarray(i,n)},mA=({offset:r,values:t},e)=>{const i=r+e;return(t[i>>3]&1<dA(r,t),A_=({values:r},t)=>we(r[t]),wn=({stride:r,values:t},e)=>t[r*e],yA=({stride:r,values:t},e)=>i_(t[r*e]),O_=({values:r},t)=>r[t],gA=({stride:r,values:t},e)=>t.subarray(r*e,r*(e+1)),F_=({values:r,valueOffsets:t},e)=>E_(r,t,e),P_=({values:r,valueOffsets:t},e)=>{const i=E_(r,t,e);return i!==null?eh(i):null},vA=({values:r},t)=>r[t],_A=({type:r,values:t},e)=>r.precision!==tr.HALF?t[e]:i_(t[e]),bA=(r,t)=>r.type.unit===Hr.DAY?C_(r,t):A_(r,t),M_=({values:r},t)=>1e3*we(r[t]),D_=({values:r},t)=>we(r[t]),R_=({values:r},t)=>Pv(r[t],BigInt(1e3)),N_=({values:r},t)=>Pv(r[t],BigInt(1e6)),wA=(r,t)=>{switch(r.type.unit){case zt.SECOND:return M_(r,t);case zt.MILLISECOND:return D_(r,t);case zt.MICROSECOND:return R_(r,t);case zt.NANOSECOND:return N_(r,t)}},L_=({values:r},t)=>r[t],B_=({values:r},t)=>r[t],k_=({values:r},t)=>r[t],U_=({values:r},t)=>r[t],xA=(r,t)=>{switch(r.type.unit){case zt.SECOND:return L_(r,t);case zt.MILLISECOND:return B_(r,t);case zt.MICROSECOND:return k_(r,t);case zt.NANOSECOND:return U_(r,t)}},SA=({values:r,stride:t},e)=>jC.decimal(r.subarray(t*e,t*(e+1))),TA=(r,t)=>{const{valueOffsets:e,stride:i,children:n}=r,{[t*i]:s,[t*i+1]:o}=e,l=n[0].slice(s,o-s);return new Me([l])},IA=(r,t)=>{const{valueOffsets:e,children:i}=r,{[t]:n,[t+1]:s}=e,o=i[0];return new af(o.slice(n,s-n))},EA=(r,t)=>new of(r,t),CA=(r,t)=>r.type.mode===er.Dense?z_(r,t):j_(r,t),z_=(r,t)=>{const e=r.type.typeIdToChildIndex[r.typeIds[t]],i=r.children[e];return mr.visit(i,r.valueOffsets[t])},j_=(r,t)=>{const e=r.type.typeIdToChildIndex[r.typeIds[t]],i=r.children[e];return mr.visit(i,t)},AA=(r,t)=>{var e;return(e=r.dictionary)===null||e===void 0?void 0:e.get(r.values[t])},OA=(r,t)=>r.type.unit===Si.DAY_TIME?$_(r,t):V_(r,t),$_=({values:r},t)=>r.subarray(2*t,2*(t+1)),V_=({values:r},t)=>{const e=r[t],i=new Int32Array(2);return i[0]=Math.trunc(e/12),i[1]=Math.trunc(e%12),i},G_=({values:r},t)=>r[t],W_=({values:r},t)=>r[t],H_=({values:r},t)=>r[t],X_=({values:r},t)=>r[t],FA=(r,t)=>{switch(r.type.unit){case zt.SECOND:return G_(r,t);case zt.MILLISECOND:return W_(r,t);case zt.MICROSECOND:return H_(r,t);case zt.NANOSECOND:return X_(r,t)}},PA=(r,t)=>{const{stride:e,children:i}=r,s=i[0].slice(t*e,e);return new Me([s])};Mt.prototype.visitNull=$t(pA);Mt.prototype.visitBool=$t(mA);Mt.prototype.visitInt=$t(vA);Mt.prototype.visitInt8=$t(wn);Mt.prototype.visitInt16=$t(wn);Mt.prototype.visitInt32=$t(wn);Mt.prototype.visitInt64=$t(O_);Mt.prototype.visitUint8=$t(wn);Mt.prototype.visitUint16=$t(wn);Mt.prototype.visitUint32=$t(wn);Mt.prototype.visitUint64=$t(O_);Mt.prototype.visitFloat=$t(_A);Mt.prototype.visitFloat16=$t(yA);Mt.prototype.visitFloat32=$t(wn);Mt.prototype.visitFloat64=$t(wn);Mt.prototype.visitUtf8=$t(P_);Mt.prototype.visitLargeUtf8=$t(P_);Mt.prototype.visitBinary=$t(F_);Mt.prototype.visitLargeBinary=$t(F_);Mt.prototype.visitFixedSizeBinary=$t(gA);Mt.prototype.visitDate=$t(bA);Mt.prototype.visitDateDay=$t(C_);Mt.prototype.visitDateMillisecond=$t(A_);Mt.prototype.visitTimestamp=$t(wA);Mt.prototype.visitTimestampSecond=$t(M_);Mt.prototype.visitTimestampMillisecond=$t(D_);Mt.prototype.visitTimestampMicrosecond=$t(R_);Mt.prototype.visitTimestampNanosecond=$t(N_);Mt.prototype.visitTime=$t(xA);Mt.prototype.visitTimeSecond=$t(L_);Mt.prototype.visitTimeMillisecond=$t(B_);Mt.prototype.visitTimeMicrosecond=$t(k_);Mt.prototype.visitTimeNanosecond=$t(U_);Mt.prototype.visitDecimal=$t(SA);Mt.prototype.visitList=$t(TA);Mt.prototype.visitStruct=$t(EA);Mt.prototype.visitUnion=$t(CA);Mt.prototype.visitDenseUnion=$t(z_);Mt.prototype.visitSparseUnion=$t(j_);Mt.prototype.visitDictionary=$t(AA);Mt.prototype.visitInterval=$t(OA);Mt.prototype.visitIntervalDayTime=$t($_);Mt.prototype.visitIntervalYearMonth=$t(V_);Mt.prototype.visitDuration=$t(FA);Mt.prototype.visitDurationSecond=$t(G_);Mt.prototype.visitDurationMillisecond=$t(W_);Mt.prototype.visitDurationMicrosecond=$t(H_);Mt.prototype.visitDurationNanosecond=$t(X_);Mt.prototype.visitFixedSizeList=$t(PA);Mt.prototype.visitMap=$t(IA);const mr=new Mt,Os=Symbol.for("keys"),Vs=Symbol.for("vals"),Fs=Symbol.for("kKeysAsStrings"),lh=Symbol.for("_kKeysAsStrings");let af=class{constructor(t){return this[Os]=new Me([t.children[0]]).memoize(),this[Vs]=t.children[1],new Proxy(this,new DA)}get[Fs](){return this[lh]||(this[lh]=Array.from(this[Os].toArray(),String))}[Symbol.iterator](){return new MA(this[Os],this[Vs])}get size(){return this[Os].length}toArray(){return Object.values(this.toJSON())}toJSON(){const t=this[Os],e=this[Vs],i={};for(let n=-1,s=t.length;++n`${Xo(t)}: ${Xo(e)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}},MA=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),mr.visit(this.vals,t)]})}},DA=class{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(t){return t[Fs]}has(t,e){return t[Fs].includes(e)}getOwnPropertyDescriptor(t,e){if(t[Fs].indexOf(e)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(t,e){if(Reflect.has(t,e))return t[e];const i=t[Fs].indexOf(e);if(i!==-1){const n=mr.visit(Reflect.get(t,Vs),i);return Reflect.set(t,e,n),n}}set(t,e,i){const n=t[Fs].indexOf(e);return n!==-1?(Xr.visit(Reflect.get(t,Vs),n,i),Reflect.set(t,e,i)):Reflect.has(t,e)?Reflect.set(t,e,i):!1}};Object.defineProperties(af.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[Os]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Vs]:{writable:!0,enumerable:!1,configurable:!1,value:null},[lh]:{writable:!0,enumerable:!1,configurable:!1,value:null}});let xp;function Y_(r,t,e,i){const{length:n=0}=r;let s=typeof t!="number"?0:t,o=typeof e!="number"?n:e;return s<0&&(s=(s%n+n)%n),o<0&&(o=(o%n+n)%n),on&&(o=n),i?i(r,s,o):[s,o]}const lf=(r,t)=>r<0?t+r:r,Sp=r=>r!==r;function so(r){if(typeof r!=="object"||r===null)return Sp(r)?Sp:e=>e===r;if(r instanceof Date){const e=r.valueOf();return i=>i instanceof Date?i.valueOf()===e:!1}return ArrayBuffer.isView(r)?e=>e?FC(r,e):!1:r instanceof Map?NA(r):Array.isArray(r)?RA(r):r instanceof Me?LA(r):BA(r,!0)}function RA(r){const t=[];for(let e=-1,i=r.length;++e!1;const i=[];for(let n=-1,s=e.length;++n{if(!e||typeof e!="object")return!1;switch(e.constructor){case Array:return kA(r,e);case Map:return Tp(r,e,e.keys());case af:case of:case Object:case void 0:return Tp(r,e,t||Object.keys(e))}return e instanceof Me?UA(r,e):!1}}function kA(r,t){const e=r.length;if(t.length!==e)return!1;for(let i=-1;++i>i}function Cl(r,t,e){const i=e.byteLength+7&-8;if(r>0||e.byteLength>3):Al(new uf(e,r,t,null,q_)).subarray(0,i)),n}return e}function Al(r){const t=[];let e=0,i=0,n=0;for(const o of r)o&&(n|=1<0)&&(t[e++]=n);const s=new Uint8Array(t.length+7&-8);return s.set(t),s}let uf=class{constructor(t,e,i,n,s){this.bytes=t,this.length=i,this.context=n,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,n=t+(t%8===0?0:8-t%8);return uh(r,t,n)+uh(r,i,e)+jA(r,n>>3,i-n>>3)}function jA(r,t,e){let i=0,n=Math.trunc(t);const s=new DataView(r.buffer,r.byteOffset,r.byteLength),o=e===void 0?r.byteLength:n+e;for(;o-n>=4;)i+=Yu(s.getUint32(n)),n+=4;for(;o-n>=2;)i+=Yu(s.getUint16(n)),n+=2;for(;o-n>=1;)i+=Yu(s.getUint8(n)),n+=1;return i}function Yu(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 $A=-1;let Se=class ch{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 At.isSparseUnion(t)?this.children.some(e=>e.nullable):At.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:i,nullBitmap:n,typeIds:s}=this;return e&&(t+=e.byteLength),i&&(t+=i.byteLength),n&&(t+=n.byteLength),s&&(t+=s.byteLength),this.children.reduce((o,a)=>o+a.byteLength,t)}get nullCount(){if(At.isUnion(this.type))return this.children.reduce((i,n)=>i+n.nullCount,0);let t=this._nullCount,e;return t<=$A&&(e=this.nullBitmap)&&(this._nullCount=t=e.length===0?0:this.length-uh(e,this.offset,this.offset+this.length)),t}constructor(t,e,i,n,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(i||0,0)),this._nullCount=Math.floor(Math.max(n||0,-1));let l;s instanceof ch?(this.stride=s.stride,this.values=s.values,this.typeIds=s.typeIds,this.nullBitmap=s.nullBitmap,this.valueOffsets=s.valueOffsets):(this.stride=Ui(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(At.isUnion(e)){const i=e,n=this.children[i.typeIdToChildIndex[this.typeIds[t]]],s=i.mode===er.Dense?this.valueOffsets[t]:t;return n.getValid(s)}if(this.nullable&&this.nullCount>0){const i=this.offset+t;return(this.nullBitmap[i>>3]&1<>3;(!s||s.byteLength<=c)&&(s=new Uint8Array((o+a+63&-64)>>3).fill(255),this.nullCount>0?(s.set(Cl(o,a,this.nullBitmap),0),Object.assign(this,{nullBitmap:s})):Object.assign(this,{nullBitmap:s,_nullCount:0}));const h=s[c];i=(h&u)!==0,s[c]=e?h|u:h&~u}return i!==!!e&&(this._nullCount=this.nullCount+(e?-1:1)),e}clone(t=this.type,e=this.offset,i=this.length,n=this._nullCount,s=this,o=this.children){return new ch(t,e,i,n,s,o,this.dictionary)}slice(t,e){const{stride:i,typeId:n,children:s}=this,o=+(this._nullCount===0)-1,a=n===16?i:1,l=this._sliceBuffers(t,e,i,n);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===L.Null)return this.clone(this.type,0,t,0);const{length:e,nullCount:i}=this,n=new Uint8Array((t+63&-64)>>3).fill(255,0,e>>3);n[e>>3]=(1<0&&n.set(Cl(this.offset,e,this.nullBitmap),0);const s=this.buffers;return s[ki.VALIDITY]=n,this.clone(this.type,0,t,i+(t-e),s)}_sliceBuffers(t,e,i,n){let s;const{buffers:o}=this;return(s=o[ki.TYPE])&&(o[ki.TYPE]=s.subarray(t,t+e)),(s=o[ki.OFFSET])&&(o[ki.OFFSET]=s.subarray(t,t+e+1))||(s=o[ki.DATA])&&(o[ki.DATA]=n===6?s:s.subarray(i*t,i*(t+e))),o}_sliceChildren(t,e,i){return t.map(n=>n.slice(e,i))}};Se.prototype.children=Object.freeze([]);class Ro extends ie{visit(t){return this.getVisitFn(t.type).call(this,t)}visitNull(t){const{["type"]:e,["offset"]:i=0,["length"]:n=0}=t;return new Se(e,i,n,n)}visitBool(t){const{["type"]:e,["offset"]:i=0}=t,n=ae(t.nullBitmap),s=_e(e.ArrayType,t.data),{["length"]:o=s.length>>3,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Se(e,i,o,a,[void 0,s,n])}visitInt(t){const{["type"]:e,["offset"]:i=0}=t,n=ae(t.nullBitmap),s=_e(e.ArrayType,t.data),{["length"]:o=s.length,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Se(e,i,o,a,[void 0,s,n])}visitFloat(t){const{["type"]:e,["offset"]:i=0}=t,n=ae(t.nullBitmap),s=_e(e.ArrayType,t.data),{["length"]:o=s.length,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Se(e,i,o,a,[void 0,s,n])}visitUtf8(t){const{["type"]:e,["offset"]:i=0}=t,n=ae(t.data),s=ae(t.nullBitmap),o=yo(t.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:l=t.nullBitmap?-1:0}=t;return new Se(e,i,a,l,[o,n,s])}visitLargeUtf8(t){const{["type"]:e,["offset"]:i=0}=t,n=ae(t.data),s=ae(t.nullBitmap),o=hp(t.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:l=t.nullBitmap?-1:0}=t;return new Se(e,i,a,l,[o,n,s])}visitBinary(t){const{["type"]:e,["offset"]:i=0}=t,n=ae(t.data),s=ae(t.nullBitmap),o=yo(t.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:l=t.nullBitmap?-1:0}=t;return new Se(e,i,a,l,[o,n,s])}visitLargeBinary(t){const{["type"]:e,["offset"]:i=0}=t,n=ae(t.data),s=ae(t.nullBitmap),o=hp(t.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:l=t.nullBitmap?-1:0}=t;return new Se(e,i,a,l,[o,n,s])}visitFixedSizeBinary(t){const{["type"]:e,["offset"]:i=0}=t,n=ae(t.nullBitmap),s=_e(e.ArrayType,t.data),{["length"]:o=s.length/Ui(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Se(e,i,o,a,[void 0,s,n])}visitDate(t){const{["type"]:e,["offset"]:i=0}=t,n=ae(t.nullBitmap),s=_e(e.ArrayType,t.data),{["length"]:o=s.length/Ui(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Se(e,i,o,a,[void 0,s,n])}visitTimestamp(t){const{["type"]:e,["offset"]:i=0}=t,n=ae(t.nullBitmap),s=_e(e.ArrayType,t.data),{["length"]:o=s.length/Ui(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Se(e,i,o,a,[void 0,s,n])}visitTime(t){const{["type"]:e,["offset"]:i=0}=t,n=ae(t.nullBitmap),s=_e(e.ArrayType,t.data),{["length"]:o=s.length/Ui(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Se(e,i,o,a,[void 0,s,n])}visitDecimal(t){const{["type"]:e,["offset"]:i=0}=t,n=ae(t.nullBitmap),s=_e(e.ArrayType,t.data),{["length"]:o=s.length/Ui(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Se(e,i,o,a,[void 0,s,n])}visitList(t){const{["type"]:e,["offset"]:i=0,["child"]:n}=t,s=ae(t.nullBitmap),o=yo(t.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:l=t.nullBitmap?-1:0}=t;return new Se(e,i,a,l,[o,void 0,s],[n])}visitStruct(t){const{["type"]:e,["offset"]:i=0,["children"]:n=[]}=t,s=ae(t.nullBitmap),{length:o=n.reduce((l,{length:u})=>Math.max(l,u),0),nullCount:a=t.nullBitmap?-1:0}=t;return new Se(e,i,o,a,[void 0,void 0,s],n)}visitUnion(t){const{["type"]:e,["offset"]:i=0,["children"]:n=[]}=t,s=_e(e.ArrayType,t.typeIds),{["length"]:o=s.length,["nullCount"]:a=-1}=t;if(At.isSparseUnion(e))return new Se(e,i,o,a,[void 0,void 0,void 0,s],n);const l=yo(t.valueOffsets);return new Se(e,i,o,a,[l,void 0,void 0,s],n)}visitDictionary(t){const{["type"]:e,["offset"]:i=0}=t,n=ae(t.nullBitmap),s=_e(e.indices.ArrayType,t.data),{["dictionary"]:o=new Me([new Ro().visit({type:e.dictionary})])}=t,{["length"]:a=s.length,["nullCount"]:l=t.nullBitmap?-1:0}=t;return new Se(e,i,a,l,[void 0,s,n],[],o)}visitInterval(t){const{["type"]:e,["offset"]:i=0}=t,n=ae(t.nullBitmap),s=_e(e.ArrayType,t.data),{["length"]:o=s.length/Ui(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Se(e,i,o,a,[void 0,s,n])}visitDuration(t){const{["type"]:e,["offset"]:i=0}=t,n=ae(t.nullBitmap),s=_e(e.ArrayType,t.data),{["length"]:o=s.length,["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Se(e,i,o,a,[void 0,s,n])}visitFixedSizeList(t){const{["type"]:e,["offset"]:i=0,["child"]:n=new Ro().visit({type:e.valueType})}=t,s=ae(t.nullBitmap),{["length"]:o=n.length/Ui(e),["nullCount"]:a=t.nullBitmap?-1:0}=t;return new Se(e,i,o,a,[void 0,void 0,s],[n])}visitMap(t){const{["type"]:e,["offset"]:i=0,["child"]:n=new Ro().visit({type:e.childType})}=t,s=ae(t.nullBitmap),o=yo(t.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:l=t.nullBitmap?-1:0}=t;return new Se(e,i,a,l,[o,void 0,s],[n])}}const VA=new Ro;function se(r){return VA.visit(r)}let Ip=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 Q_(r){return r.reduce((t,e)=>t+e.nullCount,0)}function K_(r){return r.reduce((t,e,i)=>(t[i+1]=t[i]+e.length,t),new Uint32Array(r.length+1))}function Z_(r,t,e,i){const n=[];for(let s=-1,o=r.length;++s=i)break;if(e>=l+u)continue;if(l>=e&&l+u<=i){n.push(a);continue}const c=Math.max(0,e-l),h=Math.min(i-l,u);n.push(a.slice(c,h-c))}return n.length===0&&n.push(r[0].slice(0,0)),n}function cf(r,t,e,i){let n=0,s=0,o=t.length-1;do{if(n>=o-1)return e0?0:-1}function HA(r,t){const{nullBitmap:e}=r;if(!e||r.nullCount<=0)return-1;let i=0;for(const n of new uf(e,r.offset+(t||0),r.length,e,q_)){if(!n)return i;++i}return-1}function Qt(r,t,e){if(t===void 0)return-1;if(t===null)switch(r.typeId){case L.Union:break;case L.Dictionary:break;default:return HA(r,e)}const i=mr.getVisitFn(r),n=so(t);for(let s=(e||0)-1,o=r.length;++s{const n=r.data[i];return n.values.subarray(0,n.length)[Symbol.iterator]()});let e=0;return new Ip(r.data.length,i=>{const s=r.data[i].length,o=r.slice(e,e+s);return e+=s,new XA(o)})}let XA=class{constructor(t){this.vector=t,this.index=0}next(){return this.indexa.data):t;if(s.length===0||s.some(a=>!(a instanceof Se)))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}=i0[o.typeId],c=s[0];this.isValid=h=>hf(c,h),this.get=h=>a(c,h),this.set=(h,p)=>l(c,h,p),this.indexOf=h=>u(c,h),this._offsets=[0,c.length];break}default:Object.setPrototypeOf(this,n0[o.typeId]),this._offsets=K_(s);break}this.data=s,this.type=o,this.stride=Ui(o),this.numChildren=(n=(i=o.children)===null||i===void 0?void 0:i.length)!==null&&n!==void 0?n:0,this.length=this._offsets.at(-1)}get byteLength(){return this.data.reduce((t,e)=>t+e.byteLength,0)}get nullable(){return GA(this.data)}get nullCount(){return Q_(this.data)}get ArrayType(){return this.type.ArrayType}get[Symbol.toStringTag](){return`${this.VectorName}<${this.type[Symbol.toStringTag]}>`}get VectorName(){return`${L[this.type.typeId]}Vector`}isValid(t){return!1}get(t){return null}at(t){return this.get(lf(t,this.length))}set(t,e){}indexOf(t,e){return-1}includes(t,e){return this.indexOf(t,e)>-1}[Symbol.iterator](){return ff.visit(this)}concat(...t){return new zn(this.data.concat(t.flatMap(e=>e.data).flat(Number.POSITIVE_INFINITY)))}slice(t,e){return new zn(Y_(this,t,e,({data:i,_offsets:n},s,o)=>Z_(i,n,s,o)))}toJSON(){return[...this]}toArray(){const{type:t,data:e,length:i,stride:n,ArrayType:s}=this;switch(t.typeId){case L.Int:case L.Float:case L.Decimal:case L.Time:case L.Timestamp:switch(e.length){case 0:return new s;case 1:return e[0].values.subarray(0,i*n);default:return e.reduce((o,{values:a,length:l})=>(o.array.set(a.subarray(0,l*n),o.offset),o.offset+=l*n,o),{array:new s(i*n),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(i=>i.name===t))}getChildAt(t){return t>-1&&te[t])):null}get isMemoized(){return At.isDictionary(this.type)?this.data[0].dictionary.isMemoized:!1}memoize(){if(At.isDictionary(this.type)){const t=new Ep(this.data[0].dictionary),e=this.data.map(i=>{const n=i.clone();return n.dictionary=t,n});return new zn(e)}return new Ep(this)}unmemoize(){if(At.isDictionary(this.type)&&this.isMemoized){const t=this.data[0].dictionary.unmemoize(),e=this.data.map(i=>{const n=i.clone();return n.dictionary=t,n});return new zn(e)}return this}};r0=Symbol.toStringTag;Me[r0]=(r=>{r.type=At.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(L).map(e=>L[e]).filter(e=>typeof e=="number"&&e!==L.NONE);for(const e of t){const i=mr.getVisitFnByTypeId(e),n=Xr.getVisitFnByTypeId(e),s=Fl.getVisitFnByTypeId(e);i0[e]={get:i,set:n,indexOf:s},n0[e]=Object.create(r,{isValid:{value:Ol(hf)},get:{value:Ol(mr.getVisitFnByTypeId(e))},set:{value:J_(Xr.getVisitFnByTypeId(e))},indexOf:{value:t0(Fl.getVisitFnByTypeId(e))}})}return"Vector"})(Me.prototype);let Ep=class s0 extends Me{constructor(t){super(t.data);const e=this.get,i=this.set,n=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){i.call(this,o,a),s[o]=a}}),Object.defineProperty(this,"slice",{value:(o,a)=>new s0(n.call(this,o,a))}),Object.defineProperty(this,"isMemoized",{value:!0}),Object.defineProperty(this,"unmemoize",{value:()=>new Me(this.data)}),Object.defineProperty(this,"memoize",{value:()=>this})}};class hh{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,i,n){return t.prep(8,24),t.writeInt64(BigInt(n??0)),t.pad(4),t.writeInt32(i),t.writeInt64(BigInt(e??0)),t.offset()}}class _r{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 _r).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsFooter(t,e){return t.setPosition(t.position()+me),(e||new _r).__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):ke.V1}schema(t){const e=this.bb.__offset(this.bb_pos,6);return e?(t||new ui).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}dictionaries(t,e){const i=this.bb.__offset(this.bb_pos,8);return i?(e||new hh).__init(this.bb.__vector(this.bb_pos+i)+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 i=this.bb.__offset(this.bb_pos,10);return i?(e||new hh).__init(this.bb.__vector(this.bb_pos+i)+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 i=this.bb.__offset(this.bb_pos,12);return i?(e||new We).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+i)+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,ke.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 i=e.length-1;i>=0;i--)t.addOffset(e[i]);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 Pe=class jn{constructor(t=[],e,i,n=ke.V5){this.fields=t||[],this.metadata=e||new Map,i||(i=fh(this.fields)),this.dictionaries=i,this.metadataVersion=n}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),i=this.fields.filter(n=>e.has(n.name));return new jn(i,this.metadata)}selectAt(t){const e=t.map(i=>this.fields[i]).filter(Boolean);return new jn(e,this.metadata)}assign(...t){const e=t[0]instanceof jn?t[0]:Array.isArray(t[0])?new jn(t[0]):new jn(t),i=[...this.fields],n=La(La(new Map,this.metadata),e.metadata),s=e.fields.filter(a=>{const l=i.findIndex(u=>u.name===a.name);return~l?(i[l]=a.clone({metadata:La(La(new Map,i[l].metadata),a.metadata)}))&&!1:!0}),o=fh(s,new Map);return new jn([...i,...s],n,new Map([...this.dictionaries,...o]))}};Pe.prototype.fields=null;Pe.prototype.metadata=null;Pe.prototype.dictionaries=null;class Ce{static new(...t){let[e,i,n,s]=t;return t[0]&&typeof t[0]=="object"&&({name:e}=t[0],i===void 0&&(i=t[0].type),n===void 0&&(n=t[0].nullable),s===void 0&&(s=t[0].metadata)),new Ce(`${e}`,i,n,s)}constructor(t,e,i=!1,n){this.name=t,this.type=e,this.nullable=i,this.metadata=n||new Map}get typeId(){return this.type.typeId}get[Symbol.toStringTag](){return"Field"}toString(){return`${this.name}: ${this.type}`}clone(...t){let[e,i,n,s]=t;return!t[0]||typeof t[0]!="object"?[e=this.name,i=this.type,n=this.nullable,s=this.metadata]=t:{name:e=this.name,type:i=this.type,nullable:n=this.nullable,metadata:s=this.metadata}=t[0],Ce.new(e,i,n,s)}}Ce.prototype.type=null;Ce.prototype.name=null;Ce.prototype.nullable=null;Ce.prototype.metadata=null;function La(r,t){return new Map([...r||new Map,...t||new Map])}function fh(r,t=new Map){for(let e=-1,i=r.length;++e0&&fh(s.children,t)}return t}var YA=Cv,qA=Qs;class Ko{static decode(t){t=new qA(ae(t));const e=_r.getRootAsFooter(t),i=Pe.decode(e.schema(),new Map,e.version());return new QA(i,e)}static encode(t){const e=new YA,i=Pe.encode(e,t.schema);_r.startRecordBatchesVector(e,t.numRecordBatches);for(const o of[...t.recordBatches()].slice().reverse())mn.encode(e,o);const n=e.endVector();_r.startDictionariesVector(e,t.numDictionaries);for(const o of[...t.dictionaryBatches()].slice().reverse())mn.encode(e,o);const s=e.endVector();return _r.startFooter(e),_r.addSchema(e,i),_r.addVersion(e,ke.V5),_r.addRecordBatches(e,n),_r.addDictionaries(e,s),_r.finishFooterBuffer(e,_r.endFooter(e)),e.asUint8Array()}get numRecordBatches(){return this._recordBatches.length}get numDictionaries(){return this._dictionaryBatches.length}constructor(t,e=ke.V5,i,n){this.schema=t,this.version=e,i&&(this._recordBatches=i),n&&(this._dictionaryBatches=n)}*recordBatches(){for(let t,e=-1,i=this.numRecordBatches;++e=0&&t=0&&t=0&&t=0&&tthis._closedPromiseResolve=t)}get closed(){return this._closedPromise}cancel(t){return Zt(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(De);this._closedPromiseResolve(),this._closedPromiseResolve=void 0}}[Symbol.asyncIterator](){return this}toDOMStream(t){return kr.toDOMStream(this._closedPromiseResolve||this._error?this:this._values,t)}toNodeStream(t){return kr.toNodeStream(this._closedPromiseResolve||this._error?this:this._values,t)}throw(t){return Zt(this,void 0,void 0,function*(){return yield this.abort(t),De})}return(t){return Zt(this,void 0,void 0,function*(){return yield this.close(),De})}read(t){return Zt(this,void 0,void 0,function*(){return(yield this.next(t,"read")).value})}peek(t){return Zt(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,i)=>{this.resolvers.push({resolve:e,reject:i})}):Promise.resolve(De)}_ensureOpen(){if(this._closedPromiseResolve)return!0;throw new Error("AsyncQueue is closed")}}class Wa extends KA{write(t){if((t=ae(t)).byteLength>0)return super.write(t)}toString(t=!1){return t?eh(this.toUint8Array(!0)):this.toUint8Array(!1).then(eh)}toUint8Array(t=!1){return t?xi(this._values)[0]:Zt(this,void 0,void 0,function*(){var e,i,n,s;const o=[];let a=0;try{for(var l=!0,u=bi(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){i={error:h}}finally{try{!l&&!e&&(n=u.return)&&(yield n.call(u))}finally{if(i)throw i.error}}return xi(o,a)[0]})}}class Pl{constructor(t){t&&(this.source=new ZA(kr.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 Js{constructor(t){t instanceof Js?this.source=t.source:t instanceof Wa?this.source=new Mn(kr.fromAsyncIterable(t)):Sv(t)?this.source=new Mn(kr.fromNodeStream(t)):rf(t)?this.source=new Mn(kr.fromDOMStream(t)):xv(t)?this.source=new Mn(kr.fromDOMStream(t.body)):oa(t)?this.source=new Mn(kr.fromIterable(t)):rs(t)?this.source=new Mn(kr.fromAsyncIterable(t)):no(t)&&(this.source=new Mn(kr.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 ZA{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)||De)}return(t){return Object.create(this.source.return&&this.source.return(t)||De)}}class Mn{constructor(t){this.source=t,this._closedPromise=new Promise(e=>this._closedPromiseResolve=e)}cancel(t){return Zt(this,void 0,void 0,function*(){yield this.return(t)})}get closed(){return this._closedPromise}read(t){return Zt(this,void 0,void 0,function*(){return(yield this.next(t,"read")).value})}peek(t){return Zt(this,void 0,void 0,function*(){return(yield this.next(t,"peek")).value})}next(t){return Zt(this,arguments,void 0,function*(e,i="read"){return yield this.source.next({cmd:i,size:e})})}throw(t){return Zt(this,void 0,void 0,function*(){const e=this.source.throw&&(yield this.source.throw(t))||De;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(e)})}return(t){return Zt(this,void 0,void 0,function*(){const e=this.source.return&&(yield this.source.return(t))||De;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(e)})}}class Ap extends Pl{constructor(t,e){super(),this.position=0,this.buffer=ae(t),this.size=e===void 0?this.buffer.byteLength:e}readInt32(t){const{buffer:e,byteOffset:i}=this.readAt(t,4);return new DataView(e,i).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]),i=new Uint32Array([t.buffer[1]>>>16,t.buffer[1]&65535,t.buffer[0]>>>16,t.buffer[0]&65535]);let n=e[3]*i[3];this.buffer[0]=n&65535;let s=n>>>16;return n=e[2]*i[3],s+=n,n=e[3]*i[2]>>>0,s+=n,this.buffer[0]+=s<<16,this.buffer[1]=s>>>0>>16,this.buffer[1]+=e[1]*i[3]+e[2]*i[2]+e[3]*i[1],this.buffer[1]+=e[0]*i[3]+e[1]*i[2]+e[2]*i[1]+e[3]*i[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`${Ns(this.buffer[3])} ${Ns(this.buffer[2])} ${Ns(this.buffer[1])} ${Ns(this.buffer[0])}`}static multiply(t,e){return new Ni(new Uint32Array(t.buffer)).times(e)}static add(t,e){return new Ni(new Uint32Array(t.buffer)).plus(e)}static from(t,e=new Uint32Array(4)){return Ni.fromString(typeof t=="string"?t:t.toString(),e)}static fromNumber(t,e=new Uint32Array(4)){return Ni.fromString(t.toString(),e)}static fromString(t,e=new Uint32Array(4)){const i=t.startsWith("-"),n=t.length,s=new Ni(e);for(let o=i?1:0;o0&&this.readData(t,i)||new Uint8Array(0)}readOffsets(t,e){return this.readData(t,e)}readTypeIds(t,e){return this.readData(t,e)}readData(t,{length:e,offset:i}=this.nextBufferRange()){return this.bytes.subarray(i,i+e)}readDictionary(t){return this.dictionaries.get(t.id)}}class eO extends a0{constructor(t,e,i,n,s){super(new Uint8Array(0),e,i,n,s),this.sources=t}readNullBitmap(t,e,{offset:i}=this.nextBufferRange()){return e<=0?new Uint8Array(0):Al(this.sources[i])}readOffsets(t,{offset:e}=this.nextBufferRange()){return _e(Uint8Array,_e(t.OffsetArrayType,this.sources[e]))}readTypeIds(t,{offset:e}=this.nextBufferRange()){return _e(Uint8Array,_e(t.ArrayType,this.sources[e]))}readData(t,{offset:e}=this.nextBufferRange()){const{sources:i}=this;return At.isTimestamp(t)||(At.isInt(t)||At.isTime(t))&&t.bitWidth===64||At.isDuration(t)||At.isDate(t)&&t.unit===Hr.MILLISECOND?_e(Uint8Array,No.convertArray(i[e])):At.isDecimal(t)?_e(Uint8Array,tO.convertArray(i[e])):At.isBinary(t)||At.isLargeBinary(t)||At.isFixedSizeBinary(t)?rO(i[e]):At.isBool(t)?Al(i[e]):At.isUtf8(t)||At.isLargeUtf8(t)?ef(i[e].join("")):_e(Uint8Array,_e(t.ArrayType,i[e].map(n=>+n)))}}function rO(r){const t=r.join(""),e=new Uint8Array(t.length/2);for(let i=0;i>1]=Number.parseInt(t.slice(i,i+2),16);return e}let Nt=class extends ie{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((i,n)=>this.compareFields(i,e[n]))}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 lr(r,t){return t instanceof r.constructor}function us(r,t){return r===t||lr(r,t)}function Xi(r,t){return r===t||lr(r,t)&&r.bitWidth===t.bitWidth&&r.isSigned===t.isSigned}function ru(r,t){return r===t||lr(r,t)&&r.precision===t.precision}function iO(r,t){return r===t||lr(r,t)&&r.byteWidth===t.byteWidth}function mf(r,t){return r===t||lr(r,t)&&r.unit===t.unit}function aa(r,t){return r===t||lr(r,t)&&r.unit===t.unit&&r.timezone===t.timezone}function la(r,t){return r===t||lr(r,t)&&r.unit===t.unit&&r.bitWidth===t.bitWidth}function nO(r,t){return r===t||lr(r,t)&&r.children.length===t.children.length&&yn.compareManyFields(r.children,t.children)}function sO(r,t){return r===t||lr(r,t)&&r.children.length===t.children.length&&yn.compareManyFields(r.children,t.children)}function yf(r,t){return r===t||lr(r,t)&&r.mode===t.mode&&r.typeIds.every((e,i)=>e===t.typeIds[i])&&yn.compareManyFields(r.children,t.children)}function oO(r,t){return r===t||lr(r,t)&&r.id===t.id&&r.isOrdered===t.isOrdered&&yn.visit(r.indices,t.indices)&&yn.visit(r.dictionary,t.dictionary)}function gf(r,t){return r===t||lr(r,t)&&r.unit===t.unit}function ua(r,t){return r===t||lr(r,t)&&r.unit===t.unit}function aO(r,t){return r===t||lr(r,t)&&r.listSize===t.listSize&&r.children.length===t.children.length&&yn.compareManyFields(r.children,t.children)}function lO(r,t){return r===t||lr(r,t)&&r.keysSorted===t.keysSorted&&r.children.length===t.children.length&&yn.compareManyFields(r.children,t.children)}Nt.prototype.visitNull=us;Nt.prototype.visitBool=us;Nt.prototype.visitInt=Xi;Nt.prototype.visitInt8=Xi;Nt.prototype.visitInt16=Xi;Nt.prototype.visitInt32=Xi;Nt.prototype.visitInt64=Xi;Nt.prototype.visitUint8=Xi;Nt.prototype.visitUint16=Xi;Nt.prototype.visitUint32=Xi;Nt.prototype.visitUint64=Xi;Nt.prototype.visitFloat=ru;Nt.prototype.visitFloat16=ru;Nt.prototype.visitFloat32=ru;Nt.prototype.visitFloat64=ru;Nt.prototype.visitUtf8=us;Nt.prototype.visitLargeUtf8=us;Nt.prototype.visitBinary=us;Nt.prototype.visitLargeBinary=us;Nt.prototype.visitFixedSizeBinary=iO;Nt.prototype.visitDate=mf;Nt.prototype.visitDateDay=mf;Nt.prototype.visitDateMillisecond=mf;Nt.prototype.visitTimestamp=aa;Nt.prototype.visitTimestampSecond=aa;Nt.prototype.visitTimestampMillisecond=aa;Nt.prototype.visitTimestampMicrosecond=aa;Nt.prototype.visitTimestampNanosecond=aa;Nt.prototype.visitTime=la;Nt.prototype.visitTimeSecond=la;Nt.prototype.visitTimeMillisecond=la;Nt.prototype.visitTimeMicrosecond=la;Nt.prototype.visitTimeNanosecond=la;Nt.prototype.visitDecimal=us;Nt.prototype.visitList=nO;Nt.prototype.visitStruct=sO;Nt.prototype.visitUnion=yf;Nt.prototype.visitDenseUnion=yf;Nt.prototype.visitSparseUnion=yf;Nt.prototype.visitDictionary=oO;Nt.prototype.visitInterval=gf;Nt.prototype.visitIntervalDayTime=gf;Nt.prototype.visitIntervalYearMonth=gf;Nt.prototype.visitDuration=ua;Nt.prototype.visitDurationSecond=ua;Nt.prototype.visitDurationMillisecond=ua;Nt.prototype.visitDurationMicrosecond=ua;Nt.prototype.visitDurationNanosecond=ua;Nt.prototype.visitFixedSizeList=aO;Nt.prototype.visitMap=lO;const yn=new Nt;function dh(r,t){return yn.compareSchemas(r,t)}function qu(r,t){return uO(r,t.map(e=>e.data.concat()))}function uO(r,t){const e=[...r.fields],i=[],n={numBatches:t.reduce((h,p)=>Math.max(h,p.length),0)};let s=0,o=0,a=-1;const l=t.length;let u,c=[];for(;n.numBatches-- >0;){for(o=Number.POSITIVE_INFINITY,a=-1;++a0&&(i[s++]=se({type:new sr(e),length:o,nullCount:0,children:c.slice()})))}return[r=r.assign(e),i.map(h=>new fr(r,h))]}function cO(r,t,e,i,n){var s;const o=(t+63&-64)>>3;for(let a=-1,l=i.length;++a=t)c===t?e[a]=u:(e[a]=u.slice(0,t),n.numBatches=Math.max(n.numBatches,i[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:se({type:h.type,length:t,nullCount:t,nullBitmap:new Uint8Array(o)})}}return e}var l0;let gn=class $n{constructor(...t){var e,i;if(t.length===0)return this.batches=[],this.schema=new Pe([]),this._offsets=[0],this;let n,s;t[0]instanceof Pe&&(n=t.shift()),t.at(-1)instanceof Uint32Array&&(s=t.pop());const o=l=>{if(l){if(l instanceof fr)return[l];if(l instanceof $n)return l.batches;if(l instanceof Se){if(l.type instanceof sr)return[new fr(new Pe(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(f=>new Me([l[f]])),h=n??new Pe(u.map((f,y)=>new Ce(String(f),c[y].type,c[y].nullable))),[,p]=qu(h,c);return p.length===0?[new fr(l)]:p}}}return[]},a=t.flatMap(l=>o(l));if(n=(i=n??((e=a[0])===null||e===void 0?void 0:e.schema))!==null&&i!==void 0?i:new Pe([]),!(n instanceof Pe))throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");for(const l of a){if(!(l instanceof fr))throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");if(!dh(n,l.schema))throw new TypeError("Table and inner RecordBatch schemas must be equivalent.")}this.schema=n,this.batches=a,this._offsets=s??K_(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=Q_(this.data)),this._nullCount}isValid(t){return!1}get(t){return null}at(t){return this.get(lf(t,this.numRows))}set(t,e){}indexOf(t,e){return-1}[Symbol.iterator](){return this.batches.length>0?ff.visit(new Me(this.data)):new Array(0)[Symbol.iterator]()}toArray(){return[...this]}toString(){return`[ ${this.toArray().join(`, `)} -]`}concat(...t){const e=this.schema,i=this.data.concat(t.flatMap(({data:n})=>n));return new $n(e,i.map(n=>new fr(e,n)))}slice(t,e){const i=this.schema;[t,e]=Y_({length:this.numRows},t,e);const n=Z_(this.data,this._offsets,t,e);return new $n(i,n.map(s=>new fr(i,s)))}getChild(t){return this.getChildAt(this.schema.fields.findIndex(e=>e.name===t))}getChildAt(t){if(t>-1&&ti.children[t]);if(e.length===0){const{type:i}=this.schema.fields[t],n=se({type:i,length:0,nullCount:0});e.push(n._changeLengthAndBackfillNullBitmap(this.numRows))}return new Me(e)}return null}setChild(t,e){var i;return this.setChildAt((i=this.schema.fields)===null||i===void 0?void 0:i.findIndex(n=>n.name===t),e)}setChildAt(t,e){let i=this.schema,n=[...this.batches];if(t>-1&&tthis.getChildAt(u));[s[t],a[t]]=[o,e],[i,n]=qu(i,a)}return new $n(i,n)}select(t){const e=this.schema.fields.reduce((i,n,s)=>i.set(n.name,s),new Map);return this.selectAt(t.map(i=>e.get(i)).filter(i=>i>-1))}selectAt(t){const e=this.schema.selectAt(t),i=this.batches.map(n=>n.selectAt(t));return new $n(e,i)}assign(t){const e=this.schema.fields,[i,n]=t.schema.fields.reduce((a,l,u)=>{const[c,h]=a,p=e.findIndex(f=>f.name===l.name);return~p?h[p]=u:c.push(u),a},[[],[]]),s=this.schema.assign(t.schema),o=[...e.map((a,l)=>[l,n[l]]).map(([a,l])=>l===void 0?this.getChildAt(a):t.getChildAt(l)),...i.map(a=>t.getChildAt(a))].filter(Boolean);return new $n(...qu(s,o))}};l0=Symbol.toStringTag;gn[l0]=(r=>(r.schema=null,r.batches=[],r._offsets=new Uint32Array([0]),r._nullCount=-1,r[Symbol.isConcatSpreadable]=!0,r.isValid=Ol(hf),r.get=Ol(mr.getVisitFn(L.Struct)),r.set=J_(Xr.getVisitFn(L.Struct)),r.indexOf=t0(Fl.getVisitFn(L.Struct)),"Table"))(gn.prototype);var u0;let fr=class Po{constructor(...t){switch(t.length){case 2:{if([this.schema]=t,!(this.schema instanceof Pe))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");if([,this.data=se({nullCount:0,type:new sr(this.schema.fields),children:this.schema.fields.map(e=>se({type:e.type,nullCount:0}))})]=t,!(this.data instanceof Se))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");[this.schema,this.data]=Op(this.schema,this.data.children);break}case 1:{const[e]=t,{fields:i,children:n,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]=Ce.new({name:u,type:e[u].type,nullable:!0}),l),{length:0,fields:new Array,children:new Array}),o=new Pe(i),a=se({type:new sr(i),length:s,children:n,nullCount:0});[this.schema,this.data]=Op(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=c0(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 mr.visit(this.data,t)}at(t){return this.get(lf(t,this.numRows))}set(t,e){return Xr.visit(this.data,t,e)}indexOf(t,e){return Fl.visit(this.data,t,e)}[Symbol.iterator](){return ff.visit(new Me([this.data]))}toArray(){return[...this]}concat(...t){return new gn(this.schema,[this,...t])}slice(t,e){const[i]=new Me([this.data]).slice(t,e).data;return new Po(this.schema,i)}getChild(t){var e;return this.getChildAt((e=this.schema.fields)===null||e===void 0?void 0:e.findIndex(i=>i.name===t))}getChildAt(t){return t>-1&&tn.name===t),e)}setChildAt(t,e){let i=this.schema,n=this.data;if(t>-1&&ta.name===s);~o&&(n[o]=this.data.children[o])}return new Po(e,se({type:i,length:this.numRows,children:n}))}selectAt(t){const e=this.schema.selectAt(t),i=t.map(s=>this.data.children[s]).filter(Boolean),n=se({type:new sr(e.fields),length:this.numRows,children:i});return new Po(e,n)}};u0=Symbol.toStringTag;fr[u0]=(r=>(r._nullCount=-1,r[Symbol.isConcatSpreadable]=!0,"RecordBatch"))(fr.prototype);function Op(r,t,e=t.reduce((i,n)=>Math.max(i,n.length),0)){var i;const n=[...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)&&(n[a]=l.clone({nullable:!0}),s[a]=(i=u==null?void 0:u._changeLengthAndBackfillNullBitmap(e))!==null&&i!==void 0?i:se({type:l.type,length:e,nullCount:e,nullBitmap:new Uint8Array(o)}))}return[r.assign(n),se({type:new sr(n),length:e,children:s})]}function c0(r,t,e=new Map){var i,n;if(((i=r==null?void 0:r.length)!==null&&i!==void 0?i:0)>0&&(r==null?void 0:r.length)===(t==null?void 0:t.length))for(let s=-1,o=r.length;++sse({type:n.type})),i=se({type:new sr(t.fields),nullCount:0,children:e});super(t,i)}}let en=class ai{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 ai).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsMessage(t,e){return t.setPosition(t.position()+me),(e||new ai).__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):ke.V1}headerType(){const t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readUint8(this.bb_pos+t):fe.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 i=this.bb.__offset(this.bb_pos,12);return i?(e||new We).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+i)+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,ke.V1)}static addHeaderType(t,e){t.addFieldInt8(1,e,fe.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 i=e.length-1;i>=0;i--)t.addOffset(e[i]);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,i,n,s,o){return ai.startMessage(t),ai.addVersion(t,e),ai.addHeaderType(t,i),ai.addHeader(t,n),ai.addBodyLength(t,s),ai.addCustomMetadata(t,o),ai.endMessage(t)}};class hO extends ie{visit(t,e){return t==null||e==null?void 0:super.visit(t,e)}visitNull(t,e){return _p.startNull(e),_p.endNull(e)}visitInt(t,e){return xr.startInt(e),xr.addBitWidth(e,t.bitWidth),xr.addIsSigned(e,t.isSigned),xr.endInt(e)}visitFloat(t,e){return mi.startFloatingPoint(e),mi.addPrecision(e,t.precision),mi.endFloatingPoint(e)}visitBinary(t,e){return pp.startBinary(e),pp.endBinary(e)}visitLargeBinary(t,e){return yp.startLargeBinary(e),yp.endLargeBinary(e)}visitBool(t,e){return mp.startBool(e),mp.endBool(e)}visitUtf8(t,e){return bp.startUtf8(e),bp.endUtf8(e)}visitLargeUtf8(t,e){return gp.startLargeUtf8(e),gp.endLargeUtf8(e)}visitDecimal(t,e){return Ss.startDecimal(e),Ss.addScale(e,t.scale),Ss.addPrecision(e,t.precision),Ss.addBitWidth(e,t.bitWidth),Ss.endDecimal(e)}visitDate(t,e){return Ua.startDate(e),Ua.addUnit(e,t.unit),Ua.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 i=t.timezone&&e.createString(t.timezone)||void 0;return jr.startTimestamp(e),jr.addUnit(e,t.unit),i!==void 0&&jr.addTimezone(e,i),jr.endTimestamp(e)}visitInterval(t,e){return yi.startInterval(e),yi.addUnit(e,t.unit),yi.endInterval(e)}visitDuration(t,e){return za.startDuration(e),za.addUnit(e,t.unit),za.endDuration(e)}visitList(t,e){return vp.startList(e),vp.endList(e)}visitStruct(t,e){return Yn.startStruct_(e),Yn.endStruct_(e)}visitUnion(t,e){hr.startTypeIdsVector(e,t.typeIds.length);const i=hr.createTypeIdsVector(e,t.typeIds);return hr.startUnion(e),hr.addMode(e,t.mode),hr.addTypeIds(e,i),hr.endUnion(e)}visitDictionary(t,e){const i=this.visit(t.indices,e);return $i.startDictionaryEncoding(e),$i.addId(e,BigInt(t.id)),$i.addIsOrdered(e,t.isOrdered),i!==void 0&&$i.addIndexType(e,i),$i.endDictionaryEncoding(e)}visitFixedSizeBinary(t,e){return ja.startFixedSizeBinary(e),ja.addByteWidth(e,t.byteWidth),ja.endFixedSizeBinary(e)}visitFixedSizeList(t,e){return $a.startFixedSizeList(e),$a.addListSize(e,t.listSize),$a.endFixedSizeList(e)}visitMap(t,e){return Va.startMap(e),Va.addKeysSorted(e,t.keysSorted),Va.endMap(e)}}const Qu=new hO;function fO(r,t=new Map){return new Pe(pO(r,t),Ha(r.metadata),t)}function h0(r){return new Fr(r.count,f0(r.columns),d0(r.columns))}function dO(r){return new Ti(h0(r.data),r.id,r.isDelta)}function pO(r,t){return(r.fields||[]).filter(Boolean).map(e=>Ce.fromJSON(e,t))}function Fp(r,t){return(r.children||[]).filter(Boolean).map(e=>Ce.fromJSON(e,t))}function f0(r){return(r||[]).reduce((t,e)=>[...t,new vn(e.count,mO(e.VALIDITY)),...f0(e.children)],[])}function d0(r,t=[]){for(let e=-1,i=(r||[]).length;++et+ +(e===0),0)}function yO(r,t){let e,i,n,s,o,a;return!t||!(s=r.dictionary)?(o=Mp(r,Fp(r,t)),n=new Ce(r.name,o,r.nullable,Ha(r.metadata))):t.has(e=s.id)?(i=(i=s.indexType)?Pp(i):new Qo,a=new Zs(t.get(e),i,e,s.isOrdered),n=new Ce(r.name,a,r.nullable,Ha(r.metadata))):(i=(i=s.indexType)?Pp(i):new Qo,t.set(e,o=Mp(r,Fp(r,t))),a=new Zs(o,i,e,s.isOrdered),n=new Ce(r.name,a,r.nullable,Ha(r.metadata))),n||null}function Ha(r=[]){return new Map(r.map(({key:t,value:e})=>[t,e]))}function Pp(r){return new is(r.isSigned,r.bitWidth)}function Mp(r,t){const e=r.type.name;switch(e){case"NONE":return new pn;case"null":return new pn;case"binary":return new hl;case"largebinary":return new fl;case"utf8":return new dl;case"largeutf8":return new pl;case"bool":return new ml;case"list":return new xl((t||[])[0]);case"struct":return new sr(t||[]);case"struct_":return new sr(t||[])}switch(e){case"int":{const i=r.type;return new is(i.isSigned,i.bitWidth)}case"floatingpoint":{const i=r.type;return new cl(tr[i.precision])}case"decimal":{const i=r.type;return new yl(i.scale,i.precision,i.bitWidth)}case"date":{const i=r.type;return new gl(Hr[i.unit])}case"time":{const i=r.type;return new vl(zt[i.unit],i.bitWidth)}case"timestamp":{const i=r.type;return new _l(zt[i.unit],i.timezone)}case"interval":{const i=r.type;return new bl(Si[i.unit])}case"duration":{const i=r.type;return new wl(zt[i.unit])}case"union":{const i=r.type,[n,...s]=(i.mode+"").toLowerCase(),o=n.toUpperCase()+s.join("");return new Sl(er[o],i.typeIds||[],t||[])}case"fixedsizebinary":{const i=r.type;return new Tl(i.byteWidth)}case"fixedsizelist":{const i=r.type;return new Il(i.listSize,(t||[])[0])}case"map":{const i=r.type;return new El((t||[])[0],i.keysSorted)}}throw new Error(`Unrecognized type: "${e}"`)}var gO=Cv,vO=Qs;class or{static fromJSON(t,e){const i=new or(0,ke.V5,e);return i._createHeader=_O(t,e),i}static decode(t){t=new vO(ae(t));const e=en.getRootAsMessage(t),i=e.bodyLength(),n=e.version(),s=e.headerType(),o=new or(i,n,s);return o._createHeader=bO(e,s),o}static encode(t){const e=new gO;let i=-1;return t.isSchema()?i=Pe.encode(e,t.header()):t.isRecordBatch()?i=Fr.encode(e,t.header()):t.isDictionaryBatch()&&(i=Ti.encode(e,t.header())),en.startMessage(e),en.addVersion(e,ke.V5),en.addHeader(e,i),en.addHeaderType(e,t.headerType),en.addBodyLength(e,BigInt(t.bodyLength)),en.finishMessageBuffer(e,en.endMessage(e)),e.asUint8Array()}static from(t,e=0){if(t instanceof Pe)return new or(0,ke.V5,fe.Schema,t);if(t instanceof Fr)return new or(e,ke.V5,fe.RecordBatch,t);if(t instanceof Ti)return new or(e,ke.V5,fe.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===fe.Schema}isRecordBatch(){return this.headerType===fe.RecordBatch}isDictionaryBatch(){return this.headerType===fe.DictionaryBatch}constructor(t,e,i,n){this._version=e,this._headerType=i,this.body=new Uint8Array(0),n&&(this._createHeader=()=>n),this._bodyLength=we(t)}}class Fr{get nodes(){return this._nodes}get length(){return this._length}get buffers(){return this._buffers}constructor(t,e,i){this._nodes=e,this._buffers=i,this._length=we(t)}}class Ti{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,i=!1){this._data=t,this._isDelta=i,this._id=we(e)}}class vi{constructor(t,e){this.offset=we(t),this.length=we(e)}}class vn{constructor(t,e){this.length=we(t),this.nullCount=we(e)}}function _O(r,t){return()=>{switch(t){case fe.Schema:return Pe.fromJSON(r);case fe.RecordBatch:return Fr.fromJSON(r);case fe.DictionaryBatch:return Ti.fromJSON(r)}throw new Error(`Unrecognized Message type: { name: ${fe[t]}, type: ${t} }`)}}function bO(r,t){return()=>{switch(t){case fe.Schema:return Pe.decode(r.header(new ui),new Map,r.version());case fe.RecordBatch:return Fr.decode(r.header(new Bi),r.version());case fe.DictionaryBatch:return Ti.decode(r.header(new ws),r.version())}throw new Error(`Unrecognized Message type: { name: ${fe[t]}, type: ${t} }`)}}Ce.encode=PO;Ce.decode=OO;Ce.fromJSON=yO;Pe.encode=FO;Pe.decode=wO;Pe.fromJSON=fO;Fr.encode=MO;Fr.decode=xO;Fr.fromJSON=h0;Ti.encode=DO;Ti.decode=SO;Ti.fromJSON=dO;vn.encode=RO;vn.decode=IO;vi.encode=NO;vi.decode=TO;function wO(r,t=new Map,e=ke.V5){const i=AO(r,t);return new Pe(i,Xa(r),t,e)}function xO(r,t=ke.V5){if(r.compression()!==null)throw new Error("Record batch compression not implemented");return new Fr(r.length(),EO(r),CO(r,t))}function SO(r,t=ke.V5){return new Ti(Fr.decode(r.data(),t),r.id(),r.isDelta())}function TO(r){return new vi(r.offset(),r.length())}function IO(r){return new vn(r.length(),r.nullCount())}function EO(r){const t=[];for(let e,i=-1,n=-1,s=r.nodesLength();++iCe.encode(r,s));ui.startFieldsVector(r,e.length);const i=ui.createFieldsVector(r,e),n=t.metadata&&t.metadata.size>0?ui.createCustomMetadataVector(r,[...t.metadata].map(([s,o])=>{const a=r.createString(`${s}`),l=r.createString(`${o}`);return We.startKeyValue(r),We.addKey(r,a),We.addValue(r,l),We.endKeyValue(r)})):-1;return ui.startSchema(r),ui.addFields(r,i),ui.addEndianness(r,LO?Ks.Little:Ks.Big),n!==-1&&ui.addCustomMetadata(r,n),ui.endSchema(r)}function PO(r,t){let e=-1,i=-1,n=-1;const s=t.type;let o=t.typeId;At.isDictionary(s)?(o=s.dictionary.typeId,n=Qu.visit(s,r),i=Qu.visit(s.dictionary,r)):i=Qu.visit(s,r);const a=(s.children||[]).map(c=>Ce.encode(r,c)),l=Nr.createChildrenVector(r,a),u=t.metadata&&t.metadata.size>0?Nr.createCustomMetadataVector(r,[...t.metadata].map(([c,h])=>{const p=r.createString(`${c}`),f=r.createString(`${h}`);return We.startKeyValue(r),We.addKey(r,p),We.addValue(r,f),We.endKeyValue(r)})):-1;return t.name&&(e=r.createString(t.name)),Nr.startField(r),Nr.addType(r,i),Nr.addTypeType(r,o),Nr.addChildren(r,l),Nr.addNullable(r,!!t.nullable),e!==-1&&Nr.addName(r,e),n!==-1&&Nr.addDictionary(r,n),u!==-1&&Nr.addCustomMetadata(r,u),Nr.endField(r)}function MO(r,t){const e=t.nodes||[],i=t.buffers||[];Bi.startNodesVector(r,e.length);for(const o of e.slice().reverse())vn.encode(r,o);const n=r.endVector();Bi.startBuffersVector(r,i.length);for(const o of i.slice().reverse())vi.encode(r,o);const s=r.endVector();return Bi.startRecordBatch(r),Bi.addLength(r,BigInt(t.length)),Bi.addNodes(r,n),Bi.addBuffers(r,s),Bi.endRecordBatch(r)}function DO(r,t){const e=Fr.encode(r,t.data);return ws.startDictionaryBatch(r),ws.addId(r,BigInt(t.id)),ws.addIsDelta(r,t.isDelta),ws.addData(r,e),ws.endDictionaryBatch(r)}function RO(r,t){return Fv.createFieldNode(r,BigInt(t.length),BigInt(t.nullCount))}function NO(r,t){return Ov.createBuffer(r,BigInt(t.offset),BigInt(t.length))}const LO=(()=>{const r=new ArrayBuffer(2);return new DataView(r).setInt16(0,256,!0),new Int16Array(r)[0]===256})(),_f=r=>`Expected ${fe[r]} Message in stream, but was null or length 0.`,bf=r=>`Header pointer of flatbuffer-encoded ${fe[r]} Message is null or length 0.`,p0=(r,t)=>`Expected to read ${r} metadata bytes, but only read ${t}.`,m0=(r,t)=>`Expected to read ${r} bytes for message body, but only read ${t}.`;class y0{constructor(t){this.source=t instanceof Pl?t:new Pl(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?De: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(_f(t));return e.value}readMessageBody(t){if(t<=0)return new Uint8Array(0);const e=ae(this.source.read(t));if(e.byteLength[...n,...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(_f(t));return e.value}readSchema(){const t=fe.Schema,e=this.readMessage(t),i=e==null?void 0:e.header();if(!e||!i)throw new Error(bf(t));return i}}const iu=4,ph="ARROW1",Zo=new Uint8Array(ph.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 kr.toDOMStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this})}toNodeStream(){return kr.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 Vr?t:rh(t)?VO(t):wv(t)?HO(t):rs(t)?Zt(this,void 0,void 0,function*(){return yield Vr.from(yield t)}):xv(t)||rf(t)||Sv(t)||no(t)?WO(new Js(t)):GO(new Pl(t))}static readAll(t){return t instanceof Vr?t.isSync()?Lp(t):Bp(t):rh(t)||ArrayBuffer.isView(t)||oa(t)||bv(t)?Lp(t):Bp(t)}}class Dl extends Vr{constructor(t){super(t),this._impl=t}readAll(){return[...this]}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return dr(this,arguments,function*(){yield Pt(yield*ts(bi(this[Symbol.iterator]())))})}}class Rl extends Vr{constructor(t){super(t),this._impl=t}readAll(){return Zt(this,void 0,void 0,function*(){var t,e,i,n;const s=new Array;try{for(var o=!0,a=bi(this),l;l=yield a.next(),t=l.done,!t;o=!0){n=l.value,o=!1;const u=n;s.push(u)}}catch(u){e={error:u}}finally{try{!o&&!t&&(i=a.return)&&(yield i.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 v0 extends Dl{constructor(t){super(t),this._impl=t}}class zO extends Rl{constructor(t){super(t),this._impl=t}}class _0{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 i=this._loadVectors(t,e,this.schema.fields),n=se({type:new sr(this.schema.fields),length:t.length,children:i});return new fr(this.schema,n)}_loadDictionaryBatch(t,e){const{id:i,isDelta:n}=t,{dictionaries:s,schema:o}=this,a=s.get(i),l=o.dictionaries.get(i),u=this._loadVectors(t.data,e,[l]);return(a&&n?a.concat(new Me(u)):new Me(u)).memoize()}_loadVectors(t,e,i){return new a0(e,t.nodes,t.buffers,this.dictionaries,this.schema.metadataVersion).visitMany(i)}}class Nl extends _0{constructor(t,e){super(e),this._reader=rh(t)?new kO(this._handle=t):new y0(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=w0(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):De}return(t){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.return(t):De}next(){if(this.closed)return De;let t;const{_reader:e}=this;for(;t=this._readNextMessageAndValidate();)if(t.isSchema())this.reset(t.header());else if(t.isRecordBatch()){this._recordBatchIndex++;const i=t.header(),n=e.readMessageBody(t.bodyLength);return{done:!1,value:this._loadRecordBatch(i,n)}}else if(t.isDictionaryBatch()){this._dictionaryIndex++;const i=t.header(),n=e.readMessageBody(t.bodyLength),s=this._loadDictionaryBatch(i,n);this.dictionaries.set(i.id,s)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new vf(this.schema)}):this.return()}_readNextMessageAndValidate(t){return this._reader.readMessage(t)}}class Ll extends _0{constructor(t,e){super(e),this._reader=new BO(this._handle=t)}isAsync(){return!0}isStream(){return!0}[Symbol.asyncIterator](){return this}cancel(){return Zt(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 Zt(this,void 0,void 0,function*(){return this.closed||(this.autoDestroy=w0(this,t),this.schema||(this.schema=yield this._reader.readSchema())||(yield this.cancel())),this})}throw(t){return Zt(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.throw(t):De})}return(t){return Zt(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.return(t):De})}next(){return Zt(this,void 0,void 0,function*(){if(this.closed)return De;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 i=t.header(),n=yield e.readMessageBody(t.bodyLength);return{done:!1,value:this._loadRecordBatch(i,n)}}else if(t.isDictionaryBatch()){this._dictionaryIndex++;const i=t.header(),n=yield e.readMessageBody(t.bodyLength),s=this._loadDictionaryBatch(i,n);this.dictionaries.set(i.id,s)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new vf(this.schema)}):yield this.return()})}_readNextMessageAndValidate(t){return Zt(this,void 0,void 0,function*(){return yield this._reader.readMessage(t)})}}class b0 extends Nl{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 Ap?t:new Ap(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 i=(e=this._footer)===null||e===void 0?void 0:e.getRecordBatch(t);if(i&&this._handle.seek(i.offset)){const n=this._reader.readMessage(fe.RecordBatch);if(n!=null&&n.isRecordBatch()){const s=n.header(),o=this._reader.readMessageBody(n.bodyLength);return this._loadRecordBatch(s,o)}}return null}_readDictionaryBatch(t){var e;const i=(e=this._footer)===null||e===void 0?void 0:e.getDictionaryBatch(t);if(i&&this._handle.seek(i.offset)){const n=this._reader.readMessage(fe.DictionaryBatch);if(n!=null&&n.isDictionaryBatch()){const s=n.header(),o=this._reader.readMessageBody(n.bodyLength),a=this._loadDictionaryBatch(s,o);this.dictionaries.set(s.id,a)}}}_readFooter(){const{_handle:t}=this,e=t.size-g0,i=t.readInt32(e),n=t.readAt(e-i,i);return Ko.decode(n)}_readNextMessageAndValidate(t){var e;if(this._footer||this.open(),this._footer&&this._recordBatchIndexsuper.open}});return Zt(this,void 0,void 0,function*(){if(!this.closed&&!this._footer){this.schema=(this._footer=yield this._readFooter()).schema;for(const i of this._footer.dictionaryBatches())i&&(yield this._readDictionaryBatch(this._dictionaryIndex++))}return yield e.open.call(this,t)})}readRecordBatch(t){return Zt(this,void 0,void 0,function*(){var e;if(this.closed)return null;this._footer||(yield this.open());const i=(e=this._footer)===null||e===void 0?void 0:e.getRecordBatch(t);if(i&&(yield this._handle.seek(i.offset))){const n=yield this._reader.readMessage(fe.RecordBatch);if(n!=null&&n.isRecordBatch()){const s=n.header(),o=yield this._reader.readMessageBody(n.bodyLength);return this._loadRecordBatch(s,o)}}return null})}_readDictionaryBatch(t){return Zt(this,void 0,void 0,function*(){var e;const i=(e=this._footer)===null||e===void 0?void 0:e.getDictionaryBatch(t);if(i&&(yield this._handle.seek(i.offset))){const n=yield this._reader.readMessage(fe.DictionaryBatch);if(n!=null&&n.isDictionaryBatch()){const s=n.header(),o=yield this._reader.readMessageBody(n.bodyLength),a=this._loadDictionaryBatch(s,o);this.dictionaries.set(s.id,a)}}})}_readFooter(){return Zt(this,void 0,void 0,function*(){const{_handle:t}=this;t._pending&&(yield t._pending);const e=t.size-g0,i=yield t.readInt32(e),n=yield t.readAt(e-i,i);return Ko.decode(n)})}_readNextMessageAndValidate(t){return Zt(this,void 0,void 0,function*(){if(this._footer||(yield this.open()),this._footer&&this._recordBatchIndex=4?wf(t)?new v0(new b0(r.read())):new Dl(new Nl(r)):new Dl(new Nl(function*(){}()))}function WO(r){return Zt(this,void 0,void 0,function*(){const t=yield r.peek(ca+7&-8);return t&&t.byteLength>=4?wf(t)?new v0(new b0(yield r.read())):new Rl(new Ll(r)):new Rl(new Ll(function(){return dr(this,arguments,function*(){})}()))})}function HO(r){return Zt(this,void 0,void 0,function*(){const{size:t}=yield r.stat(),e=new Ml(r,t);return t>=UO&&wf(yield e.readAt(0,ca+7&-8))?new zO(new jO(e)):new Rl(new Ll(e))})}class Ne extends ie{static assemble(...t){const e=n=>n.flatMap(s=>Array.isArray(s)?e(s):s instanceof fr?s.data.children:s.data),i=new Ne;return i.visitMany(e(t)),i}constructor(){super(),this._byteLength=0,this._nodes=[],this._buffers=[],this._bufferRegions=[]}visit(t){if(t instanceof Me)return this.visitMany(t.data),this;const{type:e}=t;if(!At.isDictionary(e)){const{length:i}=t;if(i>2147483647)throw new RangeError("Cannot write arrays larger than 2^31 - 1 in length");if(At.isUnion(e))this.nodes.push(new vn(i,0));else{const{nullCount:n}=t;At.isNull(e)||ti.call(this,n<=0?new Uint8Array(0):Cl(t.offset,i,t.nullBitmap)),this.nodes.push(new vn(i,n))}}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 ti(r){const t=r.byteLength+7&-8;return this.buffers.push(r),this.bufferRegions.push(new vi(this._byteLength,t)),this._byteLength+=t,this}function XO(r){var t;const{type:e,length:i,typeIds:n,valueOffsets:s}=r;if(ti.call(this,n),e.mode===er.Sparse)return mh.call(this,r);if(e.mode===er.Dense){if(r.offset<=0)return ti.call(this,s),mh.call(this,r);{const o=new Int32Array(i),a=Object.create(null),l=Object.create(null);for(let u,c,h=-1;++h{const h=e.typeIds[c],p=a[h],f=l[h];return u.slice(p,Math.min(i,f))}))}}return this}function YO(r){let t;return r.nullCount>=r.length?ti.call(this,new Uint8Array(0)):(t=r.values)instanceof Uint8Array?ti.call(this,Cl(r.offset,r.length,t)):ti.call(this,Al(r.values))}function Yi(r){return ti.call(this,r.values.subarray(0,r.length*r.stride))}function nu(r){const{length:t,values:e,valueOffsets:i}=r,n=we(i[0]),s=we(i[t]),o=Math.min(s-n,e.byteLength-n);return ti.call(this,Iv(-n,t+1,i)),ti.call(this,e.subarray(n,n+o)),this}function xf(r){const{length:t,valueOffsets:e}=r;if(e){const{[0]:i,[t]:n}=e;return ti.call(this,Iv(-i,t+1,e)),this.visit(r.children[0].slice(i,n-i))}return this.visit(r.children[0])}function mh(r){return this.visitMany(r.type.children.map((t,e)=>r.children[e]).filter(Boolean))[0]}Ne.prototype.visitBool=YO;Ne.prototype.visitInt=Yi;Ne.prototype.visitFloat=Yi;Ne.prototype.visitUtf8=nu;Ne.prototype.visitLargeUtf8=nu;Ne.prototype.visitBinary=nu;Ne.prototype.visitLargeBinary=nu;Ne.prototype.visitFixedSizeBinary=Yi;Ne.prototype.visitDate=Yi;Ne.prototype.visitTimestamp=Yi;Ne.prototype.visitTime=Yi;Ne.prototype.visitDecimal=Yi;Ne.prototype.visitList=xf;Ne.prototype.visitStruct=mh;Ne.prototype.visitUnion=XO;Ne.prototype.visitInterval=Yi;Ne.prototype.visitDuration=Yi;Ne.prototype.visitFixedSizeList=xf;Ne.prototype.visitMap=xf;class x0 extends df{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 Wa,this._schema=null,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._seenDictionaries=new Map,this._dictionaryDeltaOffsets=new Map,pr(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 rs(t)?t.then(e=>this.writeAll(e)):no(t)?Ef(this,t):If(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 Wa?this._sink=t:(this._sink=new Wa,t&&SC(t)?this.toDOMStream({type:"bytes"}).pipeTo(t):t&&TC(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||!dh(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 gn&&!(e=t.schema))return this.finish()&&void 0;if(t instanceof fr&&!(e=t.schema))return this.finish()&&void 0}else throw new Error("RecordBatchWriter is closed");if(e&&!dh(e,this._schema)){if(this._started&&this._autoDestroy)return this.close();this.reset(this._sink,e)}t instanceof fr?t instanceof vf||this._writeRecordBatch(t):t instanceof gn?this.writeAll(t.batches):oa(t)&&this.writeAll(t)}_writeMessage(t,e=8){const i=e-1,n=or.encode(t),s=n.byteLength,o=this._writeLegacyIpcFormat?4:8,a=s+o+i&~i,l=a-s-o;return t.headerType===fe.RecordBatch?this._recordBatchBlocks.push(new mn(a,t.bodyLength,this._position)):t.headerType===fe.DictionaryBatch&&this._dictionaryBlocks.push(new mn(a,t.bodyLength,this._position)),this._writeLegacyIpcFormat||this._write(Int32Array.of(-1)),this._write(Int32Array.of(a-o)),s>0&&this._write(n),this._writePadding(l)}_write(t){if(this._started){const e=ae(t);e&&e.byteLength>0&&(this._sink.write(e),this._position+=e.byteLength)}return this}_writeSchema(t){return this._writeMessage(or.from(t))}_writeFooter(t){return this._writeLegacyIpcFormat?this._write(Int32Array.of(0)):this._write(Int32Array.of(-1,0))}_writeMagic(){return this._write(Zo)}_writePadding(t){return t>0?this._write(new Uint8Array(t)):this}_writeRecordBatch(t){const{byteLength:e,nodes:i,bufferRegions:n,buffers:s}=Ne.assemble(t),o=new Fr(t.numRows,i,n),a=or.from(o,e);return this._writeDictionaries(t)._writeMessage(a)._writeBodyBuffers(s)}_writeDictionaryBatch(t,e,i=!1){const{byteLength:n,nodes:s,bufferRegions:o,buffers:a}=Ne.assemble(new Me([t])),l=new Fr(t.length,s,o),u=new Ti(l,e,i),c=or.from(u,n);return this._writeMessage(c)._writeBodyBuffers(a)}_writeBodyBuffers(t){let e,i,n;for(let s=-1,o=t.length;++s0&&(this._write(e),(n=(i+7&-8)-i)>0&&this._writePadding(n));return this}_writeDictionaries(t){var e,i;for(const[n,s]of t.dictionaries){const o=(e=s==null?void 0:s.data)!==null&&e!==void 0?e:[],a=this._seenDictionaries.get(n),l=(i=this._dictionaryDeltaOffsets.get(n))!==null&&i!==void 0?i:0;if(!a||a.data[0]!==o[0])for(const[u,c]of o.entries())this._writeDictionaryBatch(c,n,u>0);else if(li.writeAll(n)):no(t)?Ef(i,t):If(i,t)}}class Tf extends x0{static writeAll(t){const e=new Tf;return rs(t)?t.then(i=>e.writeAll(i)):no(t)?Ef(e,t):If(e,t)}constructor(){super(),this._autoDestroy=!0}_writeSchema(t){return this._writeMagic()._writePadding(2)}_writeDictionaryBatch(t,e,i=!1){if(!i&&this._seenDictionaries.has(e))throw new Error("The Arrow File format does not support replacement dictionaries. ");return super._writeDictionaryBatch(t,e,i)}_writeFooter(t){const e=Ko.encode(new Ko(t,ke.V5,this._recordBatchBlocks,this._dictionaryBlocks));return super._writeFooter(t)._write(e)._write(Int32Array.of(e.byteLength))._writeMagic()}}function If(r,t){let e=t;t instanceof gn&&(e=t.batches,r.reset(void 0,t.schema));for(const i of e)r.write(i);return r.finish()}function Ef(r,t){return Zt(this,void 0,void 0,function*(){var e,i,n,s,o,a,l;try{for(e=!0,i=bi(t);n=yield i.next(),s=n.done,!s;e=!0){l=n.value,e=!1;const u=l;r.write(u)}}catch(u){o={error:u}}finally{try{!e&&!s&&(a=i.return)&&(yield a.call(i))}finally{if(o)throw o.error}}return r.finish()})}function qO(r,t="stream"){return(t==="stream"?Sf:Tf).writeAll(r).toUint8Array(!0)}var QO=Object.create,S0=Object.defineProperty,KO=Object.getOwnPropertyDescriptor,ZO=Object.getOwnPropertyNames,JO=Object.getPrototypeOf,t2=Object.prototype.hasOwnProperty,e2=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports),r2=(r,t,e,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of ZO(t))!t2.call(r,n)&&n!==e&&S0(r,n,{get:()=>t[n],enumerable:!(i=KO(t,n))||i.enumerable});return r},i2=(r,t,e)=>(e=r!=null?QO(JO(r)):{},r2(!r||!r.__esModule?S0(e,"default",{value:r,enumerable:!0}):e,r)),n2=e2((r,t)=>{t.exports=Worker}),T0=(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))(T0||{}),s2=(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))(s2||{}),o2=(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))(o2||{}),a2=(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))(a2||{}),l2=(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))(l2||{}),u2=(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))(u2||{}),c2=class{log(r){}},I0=class{constructor(r=2){this.level=r}log(r){r.level>=this.level&&console.log(r)}},h2=(r=>(r[r.SUCCESS=0]="SUCCESS",r))(h2||{}),f2=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=Vr.from(t);return console.assert(e.isSync(),"Reader is not sync"),console.assert(e.isFile(),"Reader is not file"),new gn(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 i=new E0(this._bindings,this._conn,e),n=await Vr.from(i);return console.assert(n.isAsync()),console.assert(n.isStream()),n}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 d2(this._bindings,this._conn,t)}async insertArrowTable(r,t){let e=qO(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)}},E0=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}},d2=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=Vr.from(t);return console.assert(e.isSync()),console.assert(e.isFile()),new gn(e)}async send(...r){let t=await this.bindings.sendPrepared(this.connectionId,this.statementId,r),e=new E0(this.bindings,this.connectionId,t),i=await Vr.from(e);return console.assert(i.isAsync()),console.assert(i.isStream()),i}},p2=(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))(p2||{}),m2=(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))(m2||{}),ue=class{constructor(r,t){this.promiseResolver=()=>{},this.promiseRejecter=()=>{},this.type=r,this.data=t,this.promise=new Promise((e,i)=>{this.promiseResolver=e,this.promiseRejecter=i})}};function Ya(r){switch(r.typeId){case L.Binary:return{sqlType:"binary"};case L.Bool:return{sqlType:"bool"};case L.Date:return{sqlType:"date"};case L.DateDay:return{sqlType:"date32[d]"};case L.DateMillisecond:return{sqlType:"date64[ms]"};case L.Decimal:{let t=r;return{sqlType:"decimal",precision:t.precision,scale:t.scale}}case L.Float:return{sqlType:"float"};case L.Float16:return{sqlType:"float16"};case L.Float32:return{sqlType:"float32"};case L.Float64:return{sqlType:"float64"};case L.Int:return{sqlType:"int32"};case L.Int16:return{sqlType:"int16"};case L.Int32:return{sqlType:"int32"};case L.Int64:return{sqlType:"int64"};case L.Uint16:return{sqlType:"uint16"};case L.Uint32:return{sqlType:"uint32"};case L.Uint64:return{sqlType:"uint64"};case L.Uint8:return{sqlType:"uint8"};case L.IntervalDayTime:return{sqlType:"interval[dt]"};case L.IntervalYearMonth:return{sqlType:"interval[m]"};case L.List:return{sqlType:"list",valueType:Ya(r.valueType)};case L.FixedSizeBinary:return{sqlType:"fixedsizebinary",byteWidth:r.byteWidth};case L.Null:return{sqlType:"null"};case L.Utf8:return{sqlType:"utf8"};case L.Struct:return{sqlType:"struct",fields:r.children.map(t=>yh(t.name,t.type))};case L.Map:{let t=r;return{sqlType:"map",keyType:Ya(t.keyType),valueType:Ya(t.valueType)}}case L.Time:return{sqlType:"time[s]"};case L.TimeMicrosecond:return{sqlType:"time[us]"};case L.TimeMillisecond:return{sqlType:"time[ms]"};case L.TimeNanosecond:return{sqlType:"time[ns]"};case L.TimeSecond:return{sqlType:"time[s]"};case L.Timestamp:return{sqlType:"timestamp",timezone:r.timezone||void 0};case L.TimestampSecond:return{sqlType:"timestamp[s]",timezone:r.timezone||void 0};case L.TimestampMicrosecond:return{sqlType:"timestamp[us]",timezone:r.timezone||void 0};case L.TimestampNanosecond:return{sqlType:"timestamp[ns]",timezone:r.timezone||void 0};case L.TimestampMillisecond:return{sqlType:"timestamp[ms]",timezone:r.timezone||void 0}}throw new Error("unsupported arrow type: ".concat(r.toString()))}function yh(r,t){let e=Ya(t);return e.name=r,e}var y2=new TextEncoder,g2=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 n of this._onInstantiationProgress)n(e.data);return}}let i=this._pendingRequests.get(e.requestId);if(!i){console.warn("unassociated response: [".concat(e.requestId,", ").concat(e.type.toString(),"]"));return}if(this._pendingRequests.delete(e.requestId),e.type=="ERROR"){let n=new Error(e.data.message);n.name=e.data.name,(t=Object.getOwnPropertyDescriptor(n,"stack"))!=null&&t.writable&&(n.stack=e.data.stack),i.promiseRejecter(n);return}switch(i.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"){i.promiseResolver(e.data);return}break;case"INSTANTIATE":if(this._onInstantiationProgress=[],e.type=="OK"){i.promiseResolver(e.data);return}break;case"GLOB_FILE_INFOS":if(e.type=="FILE_INFOS"){i.promiseResolver(e.data);return}break;case"GET_VERSION":if(e.type=="VERSION_STRING"){i.promiseResolver(e.data);return}break;case"GET_FEATURE_FLAGS":if(e.type=="FEATURE_FLAGS"){i.promiseResolver(e.data);return}break;case"GET_TABLE_NAMES":if(e.type=="TABLE_NAMES"){i.promiseResolver(e.data);return}break;case"TOKENIZE":if(e.type=="SCRIPT_TOKENS"){i.promiseResolver(e.data);return}break;case"COPY_FILE_TO_BUFFER":if(e.type=="FILE_BUFFER"){i.promiseResolver(e.data);return}break;case"EXPORT_FILE_STATISTICS":if(e.type=="FILE_STATISTICS"){i.promiseResolver(e.data);return}break;case"CONNECT":if(e.type=="CONNECTION_INFO"){i.promiseResolver(e.data);return}break;case"RUN_PREPARED":case"RUN_QUERY":if(e.type=="QUERY_RESULT"){i.promiseResolver(e.data);return}break;case"SEND_PREPARED":if(e.type=="QUERY_RESULT_HEADER"){i.promiseResolver(e.data);return}break;case"START_PENDING_QUERY":if(e.type=="QUERY_RESULT_HEADER_OR_NULL"){i.promiseResolver(e.data);return}break;case"POLL_PENDING_QUERY":if(e.type=="QUERY_RESULT_HEADER_OR_NULL"){i.promiseResolver(e.data);return}break;case"CANCEL_PENDING_QUERY":if(this._onInstantiationProgress=[],e.type=="SUCCESS"){i.promiseResolver(e.data);return}break;case"FETCH_QUERY_RESULTS":if(e.type=="QUERY_RESULT_CHUNK"){i.promiseResolver(e.data);return}break;case"CREATE_PREPARED":if(e.type=="PREPARED_STATEMENT_ID"){i.promiseResolver(e.data);return}break}i.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 ue("RESET",null);return await this.postTask(r)}async ping(){let r=new ue("PING",null);await this.postTask(r)}async dropFile(r){let t=new ue("DROP_FILE",r);return await this.postTask(t)}async dropFiles(){let r=new ue("DROP_FILES",null);return await this.postTask(r)}async flushFiles(){let r=new ue("FLUSH_FILES",null);return await this.postTask(r)}async instantiate(r,t=null,e=i=>{}){this._onInstantiationProgress.push(e);let i=new ue("INSTANTIATE",[r,t]);return await this.postTask(i)}async getVersion(){let r=new ue("GET_VERSION",null);return await this.postTask(r)}async getFeatureFlags(){let r=new ue("GET_FEATURE_FLAGS",null);return await this.postTask(r)}async open(r){let t=new ue("OPEN",r);await this.postTask(t)}async tokenize(r){let t=new ue("TOKENIZE",r);return await this.postTask(t)}async connectInternal(){let r=new ue("CONNECT",null);return await this.postTask(r)}async connect(){let r=await this.connectInternal();return new f2(this,r)}async disconnect(r){let t=new ue("DISCONNECT",r);await this.postTask(t)}async runQuery(r,t){let e=new ue("RUN_QUERY",[r,t]);return await this.postTask(e)}async startPendingQuery(r,t,e=!1){let i=new ue("START_PENDING_QUERY",[r,t,e]);return await this.postTask(i)}async pollPendingQuery(r){let t=new ue("POLL_PENDING_QUERY",r);return await this.postTask(t)}async cancelPendingQuery(r){let t=new ue("CANCEL_PENDING_QUERY",r);return await this.postTask(t)}async fetchQueryResults(r){let t=new ue("FETCH_QUERY_RESULTS",r);return await this.postTask(t)}async getTableNames(r,t){let e=new ue("GET_TABLE_NAMES",[r,t]);return await this.postTask(e)}async createPrepared(r,t){let e=new ue("CREATE_PREPARED",[r,t]);return await this.postTask(e)}async closePrepared(r,t){let e=new ue("CLOSE_PREPARED",[r,t]);await this.postTask(e)}async runPrepared(r,t,e){let i=new ue("RUN_PREPARED",[r,t,e]);return await this.postTask(i)}async sendPrepared(r,t,e){let i=new ue("SEND_PREPARED",[r,t,e]);return await this.postTask(i)}async globFiles(r){let t=new ue("GLOB_FILE_INFOS",r);return await this.postTask(t)}async registerFileText(r,t){let e=y2.encode(t);await this.registerFileBuffer(r,e)}async registerFileURL(r,t,e,i){t===void 0&&(t=r);let n=new ue("REGISTER_FILE_URL",[r,t,e,i]);await this.postTask(n)}async registerEmptyFileBuffer(r){}async registerFileBuffer(r,t){let e=new ue("REGISTER_FILE_BUFFER",[r,t]);await this.postTask(e,[t.buffer])}async registerFileHandle(r,t,e,i){let n=new ue("REGISTER_FILE_HANDLE",[r,t,e,i]);await this.postTask(n,[])}async registerOPFSFileName(r){let t=new ue("REGISTER_OPFS_FILE_NAME",[r]);await this.postTask(t,[])}async collectFileStatistics(r,t){let e=new ue("COLLECT_FILE_STATISTICS",[r,t]);await this.postTask(e,[])}async exportFileStatistics(r){let t=new ue("EXPORT_FILE_STATISTICS",r);return await this.postTask(t,[])}async copyFileToBuffer(r){let t=new ue("COPY_FILE_TO_BUFFER",r);return await this.postTask(t)}async copyFileToPath(r,t){let e=new ue("COPY_FILE_TO_PATH",[r,t]);await this.postTask(e)}async insertArrowFromIPCStream(r,t,e){if(t.length==0)return;let i=new ue("INSERT_ARROW_FROM_IPC_STREAM",[r,t,e]);await this.postTask(i,[t.buffer])}async insertCSVFromPath(r,t,e){if(e.columns!==void 0){let n=[];for(let s in e.columns){let o=e.columns[s];n.push(yh(s,o))}e.columnsFlat=n,delete e.columns}let i=new ue("IMPORT_CSV_FROM_PATH",[r,t,e]);await this.postTask(i)}async insertJSONFromPath(r,t,e){if(e.columns!==void 0){let n=[];for(let s in e.columns){let o=e.columns[s];n.push(yh(s,o))}e.columnsFlat=n,delete e.columns}let i=new ue("IMPORT_JSON_FROM_PATH",[r,t,e]);await this.postTask(i)}};function v2(){let r=new TextDecoder;return t=>(typeof SharedArrayBuffer<"u"&&t.buffer instanceof SharedArrayBuffer&&(t=new Uint8Array(t)),r.decode(t))}v2();var _2=(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))(_2||{}),b2=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])),w2=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])),x2=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])),S2=()=>(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])),T2={version:"1.29.1-dev68.0"},Cf=T2.version.split(".");Cf[0];Cf[1];Cf[2];var I2=()=>typeof navigator>"u",Ku=null,Zu=null,Ju=null,tc=null,ec=null;async function E2(){return Ku==null&&(Ku=typeof BigInt64Array<"u"),Zu==null&&(Zu=await w2()),Ju==null&&(Ju=await S2()),tc==null&&(tc=await x2()),ec==null&&(ec=await b2()),{bigInt64Array:Ku,crossOriginIsolated:I2()||globalThis.crossOriginIsolated||!1,wasmExceptions:Zu,wasmSIMD:tc,wasmThreads:Ju,wasmBulkMemory:ec}}async function kp(r){let t=await E2();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}}i2(n2());const rc={},Mo={};function Lo(r,t){try{const i=(rc[r]||(rc[r]=new Intl.DateTimeFormat("en-GB",{timeZone:r,hour:"numeric",timeZoneName:"longOffset"}).format))(t).split("GMT")[1]||"";return i in Mo?Mo[i]:Up(i,i.split(":"))}catch{if(r in Mo)return Mo[r];const e=r==null?void 0:r.match(C2);return e?Up(r,e.slice(1)):NaN}}const C2=/([+-]\d\d):?(\d\d)?/;function Up(r,t){const e=+t[0],i=+(t[1]||0);return Mo[r]=e>0?e*60+i:e*60-i}class Er extends Date{constructor(...t){super(),t.length>1&&typeof t[t.length-1]=="string"&&(this.timeZone=t.pop()),this.internal=new Date,isNaN(Lo(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)),C0(this),gh(this)):this.setTime(Date.now())}static tz(t,...e){return e.length?new Er(...e,t):new Er(Date.now(),t)}withTimeZone(t){return new Er(+this,t)}getTimezoneOffset(){return-Lo(this.timeZone,this)}setTime(t){return Date.prototype.setTime.apply(this,arguments),gh(this),+this}[Symbol.for("constructDateFrom")](t){return new Er(+new Date(t),this.timeZone)}}const zp=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(r=>{if(!zp.test(r))return;const t=r.replace(zp,"$1UTC");Er.prototype[t]&&(r.startsWith("get")?Er.prototype[r]=function(){return this.internal[t]()}:(Er.prototype[r]=function(){return Date.prototype[t].apply(this.internal,arguments),A2(this),+this},Er.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),gh(this),+this}))});function gh(r){r.internal.setTime(+r),r.internal.setUTCMinutes(r.internal.getUTCMinutes()-r.getTimezoneOffset())}function A2(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()),C0(r)}function C0(r){const t=Lo(r.timeZone,r),e=new Date(+r);e.setUTCHours(e.getUTCHours()-1);const i=-new Date(+r).getTimezoneOffset(),n=-new Date(+e).getTimezoneOffset(),s=i-n,o=Date.prototype.getHours.apply(r)!==r.internal.getUTCHours();s&&o&&r.internal.setUTCMinutes(r.internal.getUTCMinutes()+s);const a=i-t;a&&Date.prototype.setUTCMinutes.call(r,Date.prototype.getUTCMinutes.call(r)+a);const l=Lo(r.timeZone,r),c=-new Date(+r).getTimezoneOffset()-l,h=l!==t,p=c-a;if(h&&p){Date.prototype.setUTCMinutes.call(r,Date.prototype.getUTCMinutes.call(r)+p);const f=Lo(r.timeZone,r),y=l-f;y&&(r.internal.setUTCMinutes(r.internal.getUTCMinutes()+y),Date.prototype.setUTCMinutes.call(r,Date.prototype.getUTCMinutes.call(r)+y))}}const O2=new TextDecoder("utf-8"),F2=r=>O2.decode(r),P2=new TextEncoder,A0=r=>P2.encode(r),hi=r=>typeof r=="function",ha=r=>r!=null&&Object(r)===r,M2=r=>ha(r)&&hi(r.then),O0=r=>ha(r)&&hi(r[Symbol.iterator]),D2=r=>ha(r)&&hi(r[Symbol.asyncIterator]),R2=r=>ha(r)&&"done"in r&&"value"in r,N2=r=>ha(r)&&hi(r.clear)&&hi(r.bytes)&&hi(r.position)&&hi(r.setPosition)&&hi(r.capacity)&&hi(r.getBufferIdentifier)&&hi(r.createLong),Af=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:ArrayBuffer;function L2(r){const t=r[0]?[r[0]]:[];let e,i,n,s;for(let o,a,l=0,u=0,c=r.length;++lc+h.byteLength,0);let n,s,o,a=0,l=-1;const u=Math.min(t||Number.POSITIVE_INFINITY,i);for(const c=e.length;++lrr(Int8Array,r),U2=r=>rr(Int16Array,r),z2=r=>rr(Int32Array,r),j2=r=>rr(BigInt64Array,r),$2=r=>rr(Uint8Array,r),V2=r=>rr(Uint16Array,r),G2=r=>rr(Uint32Array,r),W2=r=>rr(BigUint64Array,r),H2=r=>rr(Float32Array,r),X2=r=>rr(Float64Array,r),Y2=r=>rr(Uint8ClampedArray,r),_h=r=>(r.next(),r);function*Oi(r,t){const e=function*(n){yield n},i=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof Af?e(t):O0(t)?t:e(t);return yield*_h(function*(n){let s=null;do s=n.next(yield rr(r,s));while(!s.done)}(i[Symbol.iterator]())),new r}const q2=r=>Oi(Int8Array,r),Q2=r=>Oi(Int16Array,r),K2=r=>Oi(Int32Array,r),Z2=r=>Oi(Uint8Array,r),J2=r=>Oi(Uint16Array,r),tF=r=>Oi(Uint32Array,r),eF=r=>Oi(Float32Array,r),rF=r=>Oi(Float64Array,r),iF=r=>Oi(Uint8ClampedArray,r);function ii(r,t){return dr(this,arguments,function*(){if(M2(t))return yield Pt(yield Pt(yield*ts(bi(ii(r,yield Pt(t))))));const i=function(o){return dr(this,arguments,function*(){yield yield Pt(yield Pt(o))})},n=function(o){return dr(this,arguments,function*(){yield Pt(yield*ts(bi(_h(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 Af?i(t):O0(t)?n(t):D2(t)?t:i(t);return yield Pt(yield*ts(bi(_h(function(o){return dr(this,arguments,function*(){let a=null;do a=yield Pt(o.next(yield yield Pt(rr(r,a))));while(!a.done)})}(s[Symbol.asyncIterator]()))))),yield Pt(new r)})}const nF=r=>ii(Int8Array,r),sF=r=>ii(Int16Array,r),oF=r=>ii(Int32Array,r),aF=r=>ii(Uint8Array,r),lF=r=>ii(Uint16Array,r),uF=r=>ii(Uint32Array,r),cF=r=>ii(Float32Array,r),hF=r=>ii(Float64Array,r),fF=r=>ii(Uint8ClampedArray,r);function dF(r,t,e){if(r!==0){e=e.slice(0,t);for(let i=-1,n=e.length;++i0)do if(r[e]!==t[e])return!1;while(++eeo(t))}]`:`[${r}]`:ArrayBuffer.isView(r)?`[${r}]`:JSON.stringify(r,(t,e)=>typeof e=="bigint"?`${e}`:e)}const yF=Object.freeze(Object.defineProperty({__proto__:null,valueToString:eo},Symbol.toStringTag,{value:"Module"}));function ar(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 P0(r,t){return ar(r/t)+ar(r%t)/ar(t)}const M0=Symbol.for("isArrowBigNum");function ni(r,...t){return t.length===0?Object.setPrototypeOf(rr(this.TypedArray,r),this.constructor.prototype):Object.setPrototypeOf(new this.TypedArray(r,...t),this.constructor.prototype)}ni.prototype[M0]=!0;ni.prototype.toJSON=function(){return`"${ro(this)}"`};ni.prototype.valueOf=function(r){return Of(this,r)};ni.prototype.toString=function(){return ro(this)};ni.prototype[Symbol.toPrimitive]=function(r="default"){switch(r){case"number":return Of(this);case"string":return ro(this);case"default":return D0(this)}return ro(this)};function Gs(...r){return ni.apply(this,r)}function Ws(...r){return ni.apply(this,r)}function Jo(...r){return ni.apply(this,r)}Object.setPrototypeOf(Gs.prototype,Object.create(Int32Array.prototype));Object.setPrototypeOf(Ws.prototype,Object.create(Uint32Array.prototype));Object.setPrototypeOf(Jo.prototype,Object.create(Uint32Array.prototype));Object.assign(Gs.prototype,ni.prototype,{constructor:Gs,signed:!0,TypedArray:Int32Array,BigIntArray:BigInt64Array});Object.assign(Ws.prototype,ni.prototype,{constructor:Ws,signed:!1,TypedArray:Uint32Array,BigIntArray:BigUint64Array});Object.assign(Jo.prototype,ni.prototype,{constructor:Jo,signed:!0,TypedArray:Uint32Array,BigIntArray:BigUint64Array});const gF=BigInt(4294967296)*BigInt(4294967296),vF=gF-BigInt(1);function Of(r,t){const{buffer:e,byteOffset:i,byteLength:n,signed:s}=r,o=new BigUint64Array(e,i,n/8),a=s&&o.at(-1)&BigInt(1)<=0)return ic(r);t=t.slice();let i=1;for(let s=0;s(r.children=null,r.ArrayType=Array,r.OffsetArrayType=Int32Array,r[Symbol.toStringTag]="DataType"))(Et.prototype);class jp extends Et{constructor(){super(W.Null)}toString(){return"Null"}}N0=Symbol.toStringTag;jp[N0]=(r=>r[Symbol.toStringTag]="Null")(jp.prototype);class $p extends Et{constructor(t,e){super(W.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}`}}L0=Symbol.toStringTag;$p[L0]=(r=>(r.isSigned=null,r.bitWidth=null,r[Symbol.toStringTag]="Int"))($p.prototype);class Vp extends Et{constructor(t){super(W.Float),this.precision=t}get ArrayType(){switch(this.precision){case Cr.HALF:return Uint16Array;case Cr.SINGLE:return Float32Array;case Cr.DOUBLE:return Float64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`Float${this.precision<<5||16}`}}B0=Symbol.toStringTag;Vp[B0]=(r=>(r.precision=null,r[Symbol.toStringTag]="Float"))(Vp.prototype);class Gp extends Et{constructor(){super(W.Binary)}toString(){return"Binary"}}k0=Symbol.toStringTag;Gp[k0]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Binary"))(Gp.prototype);class Wp extends Et{constructor(){super(W.LargeBinary)}toString(){return"LargeBinary"}}U0=Symbol.toStringTag;Wp[U0]=(r=>(r.ArrayType=Uint8Array,r.OffsetArrayType=BigInt64Array,r[Symbol.toStringTag]="LargeBinary"))(Wp.prototype);class Hp extends Et{constructor(){super(W.Utf8)}toString(){return"Utf8"}}z0=Symbol.toStringTag;Hp[z0]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Utf8"))(Hp.prototype);class Xp extends Et{constructor(){super(W.LargeUtf8)}toString(){return"LargeUtf8"}}j0=Symbol.toStringTag;Xp[j0]=(r=>(r.ArrayType=Uint8Array,r.OffsetArrayType=BigInt64Array,r[Symbol.toStringTag]="LargeUtf8"))(Xp.prototype);class Yp extends Et{constructor(){super(W.Bool)}toString(){return"Bool"}}$0=Symbol.toStringTag;Yp[$0]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Bool"))(Yp.prototype);class qp extends Et{constructor(t,e,i=128){super(W.Decimal),this.scale=t,this.precision=e,this.bitWidth=i}toString(){return`Decimal[${this.precision}e${this.scale>0?"+":""}${this.scale}]`}}V0=Symbol.toStringTag;qp[V0]=(r=>(r.scale=null,r.precision=null,r.ArrayType=Uint32Array,r[Symbol.toStringTag]="Decimal"))(qp.prototype);class Qp extends Et{constructor(t){super(W.Date),this.unit=t}toString(){return`Date${(this.unit+1)*32}<${_n[this.unit]}>`}get ArrayType(){return this.unit===_n.DAY?Int32Array:BigInt64Array}}G0=Symbol.toStringTag;Qp[G0]=(r=>(r.unit=null,r[Symbol.toStringTag]="Date"))(Qp.prototype);class Kp extends Et{constructor(t,e){super(W.Time),this.unit=t,this.bitWidth=e}toString(){return`Time${this.bitWidth}<${Jt[this.unit]}>`}get ArrayType(){switch(this.bitWidth){case 32:return Int32Array;case 64:return BigInt64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}}W0=Symbol.toStringTag;Kp[W0]=(r=>(r.unit=null,r.bitWidth=null,r[Symbol.toStringTag]="Time"))(Kp.prototype);class Zp extends Et{constructor(t,e){super(W.Timestamp),this.unit=t,this.timezone=e}toString(){return`Timestamp<${Jt[this.unit]}${this.timezone?`, ${this.timezone}`:""}>`}}H0=Symbol.toStringTag;Zp[H0]=(r=>(r.unit=null,r.timezone=null,r.ArrayType=BigInt64Array,r[Symbol.toStringTag]="Timestamp"))(Zp.prototype);class Jp extends Et{constructor(t){super(W.Interval),this.unit=t}toString(){return`Interval<${ns[this.unit]}>`}}X0=Symbol.toStringTag;Jp[X0]=(r=>(r.unit=null,r.ArrayType=Int32Array,r[Symbol.toStringTag]="Interval"))(Jp.prototype);class tm extends Et{constructor(t){super(W.Duration),this.unit=t}toString(){return`Duration<${Jt[this.unit]}>`}}Y0=Symbol.toStringTag;tm[Y0]=(r=>(r.unit=null,r.ArrayType=BigInt64Array,r[Symbol.toStringTag]="Duration"))(tm.prototype);class em extends Et{constructor(t){super(W.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}}q0=Symbol.toStringTag;em[q0]=(r=>(r.children=null,r[Symbol.toStringTag]="List"))(em.prototype);class bh extends Et{constructor(t){super(W.Struct),this.children=t}toString(){return`Struct<{${this.children.map(t=>`${t.name}:${t.type}`).join(", ")}}>`}}Q0=Symbol.toStringTag;bh[Q0]=(r=>(r.children=null,r[Symbol.toStringTag]="Struct"))(bh.prototype);class rm extends Et{constructor(t,e,i){super(W.Union),this.mode=t,this.children=i,this.typeIds=e=Int32Array.from(e),this.typeIdToChildIndex=e.reduce((n,s,o)=>(n[s]=o)&&n||n,Object.create(null))}toString(){return`${this[Symbol.toStringTag]}<${this.children.map(t=>`${t.type}`).join(" | ")}>`}}K0=Symbol.toStringTag;rm[K0]=(r=>(r.mode=null,r.typeIds=null,r.children=null,r.typeIdToChildIndex=null,r.ArrayType=Int8Array,r[Symbol.toStringTag]="Union"))(rm.prototype);class im extends Et{constructor(t){super(W.FixedSizeBinary),this.byteWidth=t}toString(){return`FixedSizeBinary[${this.byteWidth}]`}}Z0=Symbol.toStringTag;im[Z0]=(r=>(r.byteWidth=null,r.ArrayType=Uint8Array,r[Symbol.toStringTag]="FixedSizeBinary"))(im.prototype);class nm extends Et{constructor(t,e){super(W.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}>`}}J0=Symbol.toStringTag;nm[J0]=(r=>(r.children=null,r.listSize=null,r[Symbol.toStringTag]="FixedSizeList"))(nm.prototype);class sm extends Et{constructor(t,e=!1){var i,n,s;if(super(W.Map),this.children=[t],this.keysSorted=e,t&&(t.name="entries",!((i=t==null?void 0:t.type)===null||i===void 0)&&i.children)){const o=(n=t==null?void 0:t.type)===null||n===void 0?void 0:n.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(", ")}}>`}}tb=Symbol.toStringTag;sm[tb]=(r=>(r.children=null,r.keysSorted=null,r[Symbol.toStringTag]="Map_"))(sm.prototype);const bF=(r=>()=>++r)(-1);class om extends Et{constructor(t,e,i,n){super(W.Dictionary),this.indices=e,this.dictionary=t,this.isOrdered=n||!1,this.id=i==null?bF():ar(i)}get children(){return this.dictionary.children}get valueType(){return this.dictionary}get ArrayType(){return this.dictionary.ArrayType}toString(){return`Dictionary<${this.indices}, ${this.dictionary}>`}}eb=Symbol.toStringTag;om[eb]=(r=>(r.id=null,r.indices=null,r.isOrdered=null,r.dictionary=null,r[Symbol.toStringTag]="Dictionary"))(om.prototype);function rb(r){const t=r;switch(r.typeId){case W.Decimal:return r.bitWidth/32;case W.Interval:return 1+t.unit;case W.FixedSizeList:return t.listSize;case W.FixedSizeBinary:return t.byteWidth;default:return 1}}class le{visitMany(t,...e){return t.map((i,n)=>this.visit(i,...e.map(s=>s[n])))}visit(...t){return this.getVisitFn(t[0],!1).apply(this,t)}getVisitFn(t,e=!0){return wF(this,t,e)}getVisitFnByTypeId(t,e=!0){return Ps(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 wF(r,t,e=!0){return typeof t=="number"?Ps(r,t,e):typeof t=="string"&&t in W?Ps(r,W[t],e):t&&t instanceof Et?Ps(r,am(t),e):t!=null&&t.type&&t.type instanceof Et?Ps(r,am(t.type),e):Ps(r,W.NONE,e)}function Ps(r,t,e=!0){let i=null;switch(t){case W.Null:i=r.visitNull;break;case W.Bool:i=r.visitBool;break;case W.Int:i=r.visitInt;break;case W.Int8:i=r.visitInt8||r.visitInt;break;case W.Int16:i=r.visitInt16||r.visitInt;break;case W.Int32:i=r.visitInt32||r.visitInt;break;case W.Int64:i=r.visitInt64||r.visitInt;break;case W.Uint8:i=r.visitUint8||r.visitInt;break;case W.Uint16:i=r.visitUint16||r.visitInt;break;case W.Uint32:i=r.visitUint32||r.visitInt;break;case W.Uint64:i=r.visitUint64||r.visitInt;break;case W.Float:i=r.visitFloat;break;case W.Float16:i=r.visitFloat16||r.visitFloat;break;case W.Float32:i=r.visitFloat32||r.visitFloat;break;case W.Float64:i=r.visitFloat64||r.visitFloat;break;case W.Utf8:i=r.visitUtf8;break;case W.LargeUtf8:i=r.visitLargeUtf8;break;case W.Binary:i=r.visitBinary;break;case W.LargeBinary:i=r.visitLargeBinary;break;case W.FixedSizeBinary:i=r.visitFixedSizeBinary;break;case W.Date:i=r.visitDate;break;case W.DateDay:i=r.visitDateDay||r.visitDate;break;case W.DateMillisecond:i=r.visitDateMillisecond||r.visitDate;break;case W.Timestamp:i=r.visitTimestamp;break;case W.TimestampSecond:i=r.visitTimestampSecond||r.visitTimestamp;break;case W.TimestampMillisecond:i=r.visitTimestampMillisecond||r.visitTimestamp;break;case W.TimestampMicrosecond:i=r.visitTimestampMicrosecond||r.visitTimestamp;break;case W.TimestampNanosecond:i=r.visitTimestampNanosecond||r.visitTimestamp;break;case W.Time:i=r.visitTime;break;case W.TimeSecond:i=r.visitTimeSecond||r.visitTime;break;case W.TimeMillisecond:i=r.visitTimeMillisecond||r.visitTime;break;case W.TimeMicrosecond:i=r.visitTimeMicrosecond||r.visitTime;break;case W.TimeNanosecond:i=r.visitTimeNanosecond||r.visitTime;break;case W.Decimal:i=r.visitDecimal;break;case W.List:i=r.visitList;break;case W.Struct:i=r.visitStruct;break;case W.Union:i=r.visitUnion;break;case W.DenseUnion:i=r.visitDenseUnion||r.visitUnion;break;case W.SparseUnion:i=r.visitSparseUnion||r.visitUnion;break;case W.Dictionary:i=r.visitDictionary;break;case W.Interval:i=r.visitInterval;break;case W.IntervalDayTime:i=r.visitIntervalDayTime||r.visitInterval;break;case W.IntervalYearMonth:i=r.visitIntervalYearMonth||r.visitInterval;break;case W.Duration:i=r.visitDuration;break;case W.DurationSecond:i=r.visitDurationSecond||r.visitDuration;break;case W.DurationMillisecond:i=r.visitDurationMillisecond||r.visitDuration;break;case W.DurationMicrosecond:i=r.visitDurationMicrosecond||r.visitDuration;break;case W.DurationNanosecond:i=r.visitDurationNanosecond||r.visitDuration;break;case W.FixedSizeList:i=r.visitFixedSizeList;break;case W.Map:i=r.visitMap;break}if(typeof i=="function")return i;if(!e)return()=>null;throw new Error(`Unrecognized type '${W[t]}'`)}function am(r){switch(r.typeId){case W.Null:return W.Null;case W.Int:{const{bitWidth:t,isSigned:e}=r;switch(t){case 8:return e?W.Int8:W.Uint8;case 16:return e?W.Int16:W.Uint16;case 32:return e?W.Int32:W.Uint32;case 64:return e?W.Int64:W.Uint64}return W.Int}case W.Float:switch(r.precision){case Cr.HALF:return W.Float16;case Cr.SINGLE:return W.Float32;case Cr.DOUBLE:return W.Float64}return W.Float;case W.Binary:return W.Binary;case W.LargeBinary:return W.LargeBinary;case W.Utf8:return W.Utf8;case W.LargeUtf8:return W.LargeUtf8;case W.Bool:return W.Bool;case W.Decimal:return W.Decimal;case W.Time:switch(r.unit){case Jt.SECOND:return W.TimeSecond;case Jt.MILLISECOND:return W.TimeMillisecond;case Jt.MICROSECOND:return W.TimeMicrosecond;case Jt.NANOSECOND:return W.TimeNanosecond}return W.Time;case W.Timestamp:switch(r.unit){case Jt.SECOND:return W.TimestampSecond;case Jt.MILLISECOND:return W.TimestampMillisecond;case Jt.MICROSECOND:return W.TimestampMicrosecond;case Jt.NANOSECOND:return W.TimestampNanosecond}return W.Timestamp;case W.Date:switch(r.unit){case _n.DAY:return W.DateDay;case _n.MILLISECOND:return W.DateMillisecond}return W.Date;case W.Interval:switch(r.unit){case ns.DAY_TIME:return W.IntervalDayTime;case ns.YEAR_MONTH:return W.IntervalYearMonth}return W.Interval;case W.Duration:switch(r.unit){case Jt.SECOND:return W.DurationSecond;case Jt.MILLISECOND:return W.DurationMillisecond;case Jt.MICROSECOND:return W.DurationMicrosecond;case Jt.NANOSECOND:return W.DurationNanosecond}return W.Duration;case W.Map:return W.Map;case W.List:return W.List;case W.Struct:return W.Struct;case W.Union:switch(r.mode){case Ii.Dense:return W.DenseUnion;case Ii.Sparse:return W.SparseUnion}return W.Union;case W.FixedSizeBinary:return W.FixedSizeBinary;case W.FixedSizeList:return W.FixedSizeList;case W.Dictionary:return W.Dictionary}throw new Error(`Unrecognized type '${W[r.typeId]}'`)}le.prototype.visitInt8=null;le.prototype.visitInt16=null;le.prototype.visitInt32=null;le.prototype.visitInt64=null;le.prototype.visitUint8=null;le.prototype.visitUint16=null;le.prototype.visitUint32=null;le.prototype.visitUint64=null;le.prototype.visitFloat16=null;le.prototype.visitFloat32=null;le.prototype.visitFloat64=null;le.prototype.visitDateDay=null;le.prototype.visitDateMillisecond=null;le.prototype.visitTimestampSecond=null;le.prototype.visitTimestampMillisecond=null;le.prototype.visitTimestampMicrosecond=null;le.prototype.visitTimestampNanosecond=null;le.prototype.visitTimeSecond=null;le.prototype.visitTimeMillisecond=null;le.prototype.visitTimeMicrosecond=null;le.prototype.visitTimeNanosecond=null;le.prototype.visitDenseUnion=null;le.prototype.visitSparseUnion=null;le.prototype.visitIntervalDayTime=null;le.prototype.visitIntervalYearMonth=null;le.prototype.visitDuration=null;le.prototype.visitDurationSecond=null;le.prototype.visitDurationMillisecond=null;le.prototype.visitDurationMicrosecond=null;le.prototype.visitDurationNanosecond=null;const ib=new Float64Array(1),vs=new Uint32Array(ib.buffer);function Ff(r){const t=(r&31744)>>10,e=(r&1023)/1024,i=Math.pow(-1,(r&32768)>>15);switch(t){case 31:return i*(e?Number.NaN:1/0);case 0:return i*(e?6103515625e-14*e:0)}return i*Math.pow(2,t-15)*(1+e)}function nb(r){if(r!==r)return 32256;ib[0]=r;const t=(vs[1]&2147483648)>>16&65535;let e=vs[1]&2146435072,i=0;return e>=1089470464?vs[0]>0?e=31744:(e=(e&2080374784)>>16,i=(vs[1]&1048575)>>10):e<=1056964608?(i=1048576+(vs[1]&1048575),i=1048576+(i<<(e>>20)-998)>>21,e=0):(e=e-1056964608>>10,i=(vs[1]&1048575)+512>>10),t|e|i&65535}const xF=Object.freeze(Object.defineProperty({__proto__:null,float64ToUint16:nb,uint16ToFloat64:Ff},Symbol.toStringTag,{value:"Module"}));class Gt extends le{}function Yt(r){return(t,e,i)=>{if(t.setValid(e,i!=null))return r(t,e,i)}}const SF=(r,t,e)=>{r[t]=Math.floor(e/864e5)},sb=(r,t,e,i)=>{if(e+1{const n=r+e;i?t[n>>3]|=1<>3]&=~(1<{r[t]=e},Pf=({values:r},t,e)=>{r[t]=e},ob=({values:r},t,e)=>{r[t]=nb(e)},IF=(r,t,e)=>{switch(r.type.precision){case Cr.HALF:return ob(r,t,e);case Cr.SINGLE:case Cr.DOUBLE:return Pf(r,t,e)}},ab=({values:r},t,e)=>{SF(r,t,e.valueOf())},lb=({values:r},t,e)=>{r[t]=BigInt(e)},EF=({stride:r,values:t},e,i)=>{t.set(i.subarray(0,r),r*e)},ub=({values:r,valueOffsets:t},e,i)=>sb(r,t,e,i),cb=({values:r,valueOffsets:t},e,i)=>sb(r,t,e,A0(i)),CF=(r,t,e)=>{r.type.unit===_n.DAY?ab(r,t,e):lb(r,t,e)},hb=({values:r},t,e)=>{r[t]=BigInt(e/1e3)},fb=({values:r},t,e)=>{r[t]=BigInt(e)},db=({values:r},t,e)=>{r[t]=BigInt(e*1e3)},pb=({values:r},t,e)=>{r[t]=BigInt(e*1e6)},AF=(r,t,e)=>{switch(r.type.unit){case Jt.SECOND:return hb(r,t,e);case Jt.MILLISECOND:return fb(r,t,e);case Jt.MICROSECOND:return db(r,t,e);case Jt.NANOSECOND:return pb(r,t,e)}},mb=({values:r},t,e)=>{r[t]=e},yb=({values:r},t,e)=>{r[t]=e},gb=({values:r},t,e)=>{r[t]=e},vb=({values:r},t,e)=>{r[t]=e},OF=(r,t,e)=>{switch(r.type.unit){case Jt.SECOND:return mb(r,t,e);case Jt.MILLISECOND:return yb(r,t,e);case Jt.MICROSECOND:return gb(r,t,e);case Jt.NANOSECOND:return vb(r,t,e)}},FF=({values:r,stride:t},e,i)=>{r.set(i.subarray(0,t),t*e)},PF=(r,t,e)=>{const i=r.children[0],n=r.valueOffsets,s=Ei.getVisitFn(i);if(Array.isArray(e))for(let o=-1,a=n[t],l=n[t+1];a{const i=r.children[0],{valueOffsets:n}=r,s=Ei.getVisitFn(i);let{[t]:o,[t+1]:a}=n;const l=e instanceof Map?e.entries():Object.entries(e);for(const u of l)if(s(i,o,u),++o>=a)break},DF=(r,t)=>(e,i,n,s)=>i&&e(i,r,t[s]),RF=(r,t)=>(e,i,n,s)=>i&&e(i,r,t.get(s)),NF=(r,t)=>(e,i,n,s)=>i&&e(i,r,t.get(n.name)),LF=(r,t)=>(e,i,n,s)=>i&&e(i,r,t[n.name]),BF=(r,t,e)=>{const i=r.type.children.map(s=>Ei.getVisitFn(s.type)),n=e instanceof Map?NF(t,e):e instanceof Qe?RF(t,e):Array.isArray(e)?DF(t,e):LF(t,e);r.type.children.forEach((s,o)=>n(i[o],r.children[o],s,o))},kF=(r,t,e)=>{r.type.mode===Ii.Dense?_b(r,t,e):bb(r,t,e)},_b=(r,t,e)=>{const i=r.type.typeIdToChildIndex[r.typeIds[t]],n=r.children[i];Ei.visit(n,r.valueOffsets[t],e)},bb=(r,t,e)=>{const i=r.type.typeIdToChildIndex[r.typeIds[t]],n=r.children[i];Ei.visit(n,t,e)},UF=(r,t,e)=>{var i;(i=r.dictionary)===null||i===void 0||i.set(r.values[t],e)},zF=(r,t,e)=>{r.type.unit===ns.DAY_TIME?wb(r,t,e):xb(r,t,e)},wb=({values:r},t,e)=>{r.set(e.subarray(0,2),2*t)},xb=({values:r},t,e)=>{r[t]=e[0]*12+e[1]%12},Sb=({values:r},t,e)=>{r[t]=e},Tb=({values:r},t,e)=>{r[t]=e},Ib=({values:r},t,e)=>{r[t]=e},Eb=({values:r},t,e)=>{r[t]=e},jF=(r,t,e)=>{switch(r.type.unit){case Jt.SECOND:return Sb(r,t,e);case Jt.MILLISECOND:return Tb(r,t,e);case Jt.MICROSECOND:return Ib(r,t,e);case Jt.NANOSECOND:return Eb(r,t,e)}},$F=(r,t,e)=>{const{stride:i}=r,n=r.children[0],s=Ei.getVisitFn(n);if(Array.isArray(e))for(let o=-1,a=t*i;++o`${eo(t)}: ${eo(e)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}[Symbol.iterator](){return new VF(this[Zr],this[Hs])}}class VF{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[Zr].type.children.some(i=>i.name===e)}getOwnPropertyDescriptor(t,e){if(t[Zr].type.children.some(i=>i.name===e))return{writable:!0,enumerable:!0,configurable:!0}}get(t,e){if(Reflect.has(t,e))return t[e];const i=t[Zr].type.children.findIndex(n=>n.name===e);if(i!==-1){const n=Yr.visit(t[Zr].children[i],t[Hs]);return Reflect.set(t,e,n),n}}set(t,e,i){const n=t[Zr].type.children.findIndex(s=>s.name===e);return n!==-1?(Ei.visit(t[Zr].children[n],t[Hs],i),Reflect.set(t,e,i)):Reflect.has(t,e)||typeof e=="symbol"?Reflect.set(t,e,i):!1}}const WF=new GF;class Lt extends le{}function Wt(r){return(t,e)=>t.getValid(e)?r(t,e):null}const HF=(r,t)=>864e5*r[t],XF=(r,t)=>null,Cb=(r,t,e)=>{if(e+1>=t.length)return null;const i=ar(t[e]),n=ar(t[e+1]);return r.subarray(i,n)},YF=({offset:r,values:t},e)=>{const i=r+e;return(t[i>>3]&1<HF(r,t),Ob=({values:r},t)=>ar(r[t]),xn=({stride:r,values:t},e)=>t[r*e],qF=({stride:r,values:t},e)=>Ff(t[r*e]),Fb=({values:r},t)=>r[t],QF=({stride:r,values:t},e)=>t.subarray(r*e,r*(e+1)),Pb=({values:r,valueOffsets:t},e)=>Cb(r,t,e),Mb=({values:r,valueOffsets:t},e)=>{const i=Cb(r,t,e);return i!==null?F2(i):null},KF=({values:r},t)=>r[t],ZF=({type:r,values:t},e)=>r.precision!==Cr.HALF?t[e]:Ff(t[e]),JF=(r,t)=>r.type.unit===_n.DAY?Ab(r,t):Ob(r,t),Db=({values:r},t)=>1e3*ar(r[t]),Rb=({values:r},t)=>ar(r[t]),Nb=({values:r},t)=>P0(r[t],BigInt(1e3)),Lb=({values:r},t)=>P0(r[t],BigInt(1e6)),tP=(r,t)=>{switch(r.type.unit){case Jt.SECOND:return Db(r,t);case Jt.MILLISECOND:return Rb(r,t);case Jt.MICROSECOND:return Nb(r,t);case Jt.NANOSECOND:return Lb(r,t)}},Bb=({values:r},t)=>r[t],kb=({values:r},t)=>r[t],Ub=({values:r},t)=>r[t],zb=({values:r},t)=>r[t],eP=(r,t)=>{switch(r.type.unit){case Jt.SECOND:return Bb(r,t);case Jt.MILLISECOND:return kb(r,t);case Jt.MICROSECOND:return Ub(r,t);case Jt.NANOSECOND:return zb(r,t)}},rP=({values:r,stride:t},e)=>su.decimal(r.subarray(t*e,t*(e+1))),iP=(r,t)=>{const{valueOffsets:e,stride:i,children:n}=r,{[t*i]:s,[t*i+1]:o}=e,l=n[0].slice(s,o-s);return new Qe([l])},nP=(r,t)=>{const{valueOffsets:e,children:i}=r,{[t]:n,[t+1]:s}=e,o=i[0];return new Df(o.slice(n,s-n))},sP=(r,t)=>new Mf(r,t),oP=(r,t)=>r.type.mode===Ii.Dense?jb(r,t):$b(r,t),jb=(r,t)=>{const e=r.type.typeIdToChildIndex[r.typeIds[t]],i=r.children[e];return Yr.visit(i,r.valueOffsets[t])},$b=(r,t)=>{const e=r.type.typeIdToChildIndex[r.typeIds[t]],i=r.children[e];return Yr.visit(i,t)},aP=(r,t)=>{var e;return(e=r.dictionary)===null||e===void 0?void 0:e.get(r.values[t])},lP=(r,t)=>r.type.unit===ns.DAY_TIME?Vb(r,t):Gb(r,t),Vb=({values:r},t)=>r.subarray(2*t,2*(t+1)),Gb=({values:r},t)=>{const e=r[t],i=new Int32Array(2);return i[0]=Math.trunc(e/12),i[1]=Math.trunc(e%12),i},Wb=({values:r},t)=>r[t],Hb=({values:r},t)=>r[t],Xb=({values:r},t)=>r[t],Yb=({values:r},t)=>r[t],uP=(r,t)=>{switch(r.type.unit){case Jt.SECOND:return Wb(r,t);case Jt.MILLISECOND:return Hb(r,t);case Jt.MICROSECOND:return Xb(r,t);case Jt.NANOSECOND:return Yb(r,t)}},cP=(r,t)=>{const{stride:e,children:i}=r,s=i[0].slice(t*e,e);return new Qe([s])};Lt.prototype.visitNull=Wt(XF);Lt.prototype.visitBool=Wt(YF);Lt.prototype.visitInt=Wt(KF);Lt.prototype.visitInt8=Wt(xn);Lt.prototype.visitInt16=Wt(xn);Lt.prototype.visitInt32=Wt(xn);Lt.prototype.visitInt64=Wt(Fb);Lt.prototype.visitUint8=Wt(xn);Lt.prototype.visitUint16=Wt(xn);Lt.prototype.visitUint32=Wt(xn);Lt.prototype.visitUint64=Wt(Fb);Lt.prototype.visitFloat=Wt(ZF);Lt.prototype.visitFloat16=Wt(qF);Lt.prototype.visitFloat32=Wt(xn);Lt.prototype.visitFloat64=Wt(xn);Lt.prototype.visitUtf8=Wt(Mb);Lt.prototype.visitLargeUtf8=Wt(Mb);Lt.prototype.visitBinary=Wt(Pb);Lt.prototype.visitLargeBinary=Wt(Pb);Lt.prototype.visitFixedSizeBinary=Wt(QF);Lt.prototype.visitDate=Wt(JF);Lt.prototype.visitDateDay=Wt(Ab);Lt.prototype.visitDateMillisecond=Wt(Ob);Lt.prototype.visitTimestamp=Wt(tP);Lt.prototype.visitTimestampSecond=Wt(Db);Lt.prototype.visitTimestampMillisecond=Wt(Rb);Lt.prototype.visitTimestampMicrosecond=Wt(Nb);Lt.prototype.visitTimestampNanosecond=Wt(Lb);Lt.prototype.visitTime=Wt(eP);Lt.prototype.visitTimeSecond=Wt(Bb);Lt.prototype.visitTimeMillisecond=Wt(kb);Lt.prototype.visitTimeMicrosecond=Wt(Ub);Lt.prototype.visitTimeNanosecond=Wt(zb);Lt.prototype.visitDecimal=Wt(rP);Lt.prototype.visitList=Wt(iP);Lt.prototype.visitStruct=Wt(sP);Lt.prototype.visitUnion=Wt(oP);Lt.prototype.visitDenseUnion=Wt(jb);Lt.prototype.visitSparseUnion=Wt($b);Lt.prototype.visitDictionary=Wt(aP);Lt.prototype.visitInterval=Wt(lP);Lt.prototype.visitIntervalDayTime=Wt(Vb);Lt.prototype.visitIntervalYearMonth=Wt(Gb);Lt.prototype.visitDuration=Wt(uP);Lt.prototype.visitDurationSecond=Wt(Wb);Lt.prototype.visitDurationMillisecond=Wt(Hb);Lt.prototype.visitDurationMicrosecond=Wt(Xb);Lt.prototype.visitDurationNanosecond=Wt(Yb);Lt.prototype.visitFixedSizeList=Wt(cP);Lt.prototype.visitMap=Wt(nP);const Yr=new Lt,Ms=Symbol.for("keys"),Xs=Symbol.for("vals"),Ds=Symbol.for("kKeysAsStrings"),wh=Symbol.for("_kKeysAsStrings");class Df{constructor(t){return this[Ms]=new Qe([t.children[0]]).memoize(),this[Xs]=t.children[1],new Proxy(this,new fP)}get[Ds](){return this[wh]||(this[wh]=Array.from(this[Ms].toArray(),String))}[Symbol.iterator](){return new hP(this[Ms],this[Xs])}get size(){return this[Ms].length}toArray(){return Object.values(this.toJSON())}toJSON(){const t=this[Ms],e=this[Xs],i={};for(let n=-1,s=t.length;++n`${eo(t)}: ${eo(e)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}}class hP{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),Yr.visit(this.vals,t)]})}}class fP{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(t){return t[Ds]}has(t,e){return t[Ds].includes(e)}getOwnPropertyDescriptor(t,e){if(t[Ds].indexOf(e)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(t,e){if(Reflect.has(t,e))return t[e];const i=t[Ds].indexOf(e);if(i!==-1){const n=Yr.visit(Reflect.get(t,Xs),i);return Reflect.set(t,e,n),n}}set(t,e,i){const n=t[Ds].indexOf(e);return n!==-1?(Ei.visit(Reflect.get(t,Xs),n,i),Reflect.set(t,e,i)):Reflect.has(t,e)?Reflect.set(t,e,i):!1}}Object.defineProperties(Df.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[Ms]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Xs]:{writable:!0,enumerable:!1,configurable:!1,value:null},[wh]:{writable:!0,enumerable:!1,configurable:!1,value:null}});let lm;function qb(r,t,e,i){const{length:n=0}=r;let s=typeof t!="number"?0:t,o=typeof e!="number"?n:e;return s<0&&(s=(s%n+n)%n),o<0&&(o=(o%n+n)%n),on&&(o=n),i?i(r,s,o):[s,o]}const Qb=(r,t)=>r<0?t+r:r,um=r=>r!==r;function cs(r){if(typeof r!=="object"||r===null)return um(r)?um:e=>e===r;if(r instanceof Date){const e=r.valueOf();return i=>i instanceof Date?i.valueOf()===e:!1}return ArrayBuffer.isView(r)?e=>e?F0(r,e):!1:r instanceof Map?pP(r):Array.isArray(r)?dP(r):r instanceof Qe?mP(r):yP(r,!0)}function dP(r){const t=[];for(let e=-1,i=r.length;++e!1;const i=[];for(let n=-1,s=e.length;++n{if(!e||typeof e!="object")return!1;switch(e.constructor){case Array:return gP(r,e);case Map:return cm(r,e,e.keys());case Df:case Mf:case Object:case void 0:return cm(r,e,t||Object.keys(e))}return e instanceof Qe?vP(r,e):!1}}function gP(r,t){const e=r.length;if(t.length!==e)return!1;for(let i=-1;++i>i}function bP(r,t,e){return e?!!(r[t>>3]|=1<>3]&=~(1<0||e.byteLength>3):Zb(new au(e,r,t,null,Rf)).subarray(0,i)),n}return e}function Zb(r){const t=[];let e=0,i=0,n=0;for(const o of r)o&&(n|=1<0)&&(t[e++]=n);const s=new Uint8Array(t.length+7&-8);return s.set(t),s}class au{constructor(t,e,i,n,s){this.bytes=t,this.length=i,this.context=n,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,n=t+(t%8===0?0:8-t%8);return Bl(r,t,n)+Bl(r,i,e)+Jb(r,n>>3,i-n>>3)}function Jb(r,t,e){let i=0,n=Math.trunc(t);const s=new DataView(r.buffer,r.byteOffset,r.byteLength),o=e===void 0?r.byteLength:n+e;for(;o-n>=4;)i+=qa(s.getUint32(n)),n+=4;for(;o-n>=2;)i+=qa(s.getUint16(n)),n+=2;for(;o-n>=1;)i+=qa(s.getUint8(n)),n+=1;return i}function qa(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 wP=Object.freeze(Object.defineProperty({__proto__:null,BitIterator:au,getBit:Kb,getBool:Rf,packBools:Zb,popcnt_array:Jb,popcnt_bit_range:Bl,popcnt_uint32:qa,setBool:bP,truncateBitmap:xh},Symbol.toStringTag,{value:"Module"})),xP=-1;class ta{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 Et.isSparseUnion(t)?this.children.some(e=>e.nullable):Et.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:i,nullBitmap:n,typeIds:s}=this;return e&&(t+=e.byteLength),i&&(t+=i.byteLength),n&&(t+=n.byteLength),s&&(t+=s.byteLength),this.children.reduce((o,a)=>o+a.byteLength,t)}get nullCount(){if(Et.isUnion(this.type))return this.children.reduce((i,n)=>i+n.nullCount,0);let t=this._nullCount,e;return t<=xP&&(e=this.nullBitmap)&&(this._nullCount=t=e.length===0?0:this.length-Bl(e,this.offset,this.offset+this.length)),t}constructor(t,e,i,n,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(i||0,0)),this._nullCount=Math.floor(Math.max(n||0,-1));let l;s instanceof ta?(this.stride=s.stride,this.values=s.values,this.typeIds=s.typeIds,this.nullBitmap=s.nullBitmap,this.valueOffsets=s.valueOffsets):(this.stride=rb(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(Et.isUnion(e)){const i=e,n=this.children[i.typeIdToChildIndex[this.typeIds[t]]],s=i.mode===Ii.Dense?this.valueOffsets[t]:t;return n.getValid(s)}if(this.nullable&&this.nullCount>0){const i=this.offset+t;return(this.nullBitmap[i>>3]&1<>3;(!s||s.byteLength<=c)&&(s=new Uint8Array((o+a+63&-64)>>3).fill(255),this.nullCount>0?(s.set(xh(o,a,this.nullBitmap),0),Object.assign(this,{nullBitmap:s})):Object.assign(this,{nullBitmap:s,_nullCount:0}));const h=s[c];i=(h&u)!==0,s[c]=e?h|u:h&~u}return i!==!!e&&(this._nullCount=this.nullCount+(e?-1:1)),e}clone(t=this.type,e=this.offset,i=this.length,n=this._nullCount,s=this,o=this.children){return new ta(t,e,i,n,s,o,this.dictionary)}slice(t,e){const{stride:i,typeId:n,children:s}=this,o=+(this._nullCount===0)-1,a=n===16?i:1,l=this._sliceBuffers(t,e,i,n);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===W.Null)return this.clone(this.type,0,t,0);const{length:e,nullCount:i}=this,n=new Uint8Array((t+63&-64)>>3).fill(255,0,e>>3);n[e>>3]=(1<0&&n.set(xh(this.offset,e,this.nullBitmap),0);const s=this.buffers;return s[zi.VALIDITY]=n,this.clone(this.type,0,t,i+(t-e),s)}_sliceBuffers(t,e,i,n){let s;const{buffers:o}=this;return(s=o[zi.TYPE])&&(o[zi.TYPE]=s.subarray(t,t+e)),(s=o[zi.OFFSET])&&(o[zi.OFFSET]=s.subarray(t,t+e+1))||(s=o[zi.DATA])&&(o[zi.DATA]=n===6?s:s.subarray(i*t,i*(t+e))),o}_sliceChildren(t,e,i){return t.map(n=>n.slice(e,i))}}ta.prototype.children=Object.freeze([]);class hm{constructor(t=0,e){this.numChunks=t,this.getChunkIterator=e,this.chunkIndex=0,this.chunkIterator=this.getChunkIterator(0)}next(){for(;this.chunkIndext.nullable)}function TP(r){return r.reduce((t,e)=>t+e.nullCount,0)}function IP(r){return r.reduce((t,e,i)=>(t[i+1]=t[i]+e.length,t),new Uint32Array(r.length+1))}function EP(r,t,e,i){const n=[];for(let s=-1,o=r.length;++s=i)break;if(e>=l+u)continue;if(l>=e&&l+u<=i){n.push(a);continue}const c=Math.max(0,e-l),h=Math.min(i-l,u);n.push(a.slice(c,h-c))}return n.length===0&&n.push(r[0].slice(0,0)),n}function Nf(r,t,e,i){let n=0,s=0,o=t.length-1;do{if(n>=o-1)return e0?0:-1}function FP(r,t){const{nullBitmap:e}=r;if(!e||r.nullCount<=0)return-1;let i=0;for(const n of new au(e,r.offset+(t||0),r.length,e,Rf)){if(!n)return i;++i}return-1}function Kt(r,t,e){if(t===void 0)return-1;if(t===null)switch(r.typeId){case W.Union:break;case W.Dictionary:break;default:return FP(r,e)}const i=Yr.getVisitFn(r),n=cs(t);for(let s=(e||0)-1,o=r.length;++s{const n=r.data[i];return n.values.subarray(0,n.length)[Symbol.iterator]()});let e=0;return new hm(r.data.length,i=>{const s=r.data[i].length,o=r.slice(e,e+s);return e+=s,new PP(o)})}class PP{constructor(t){this.vector=t,this.index=0}next(){return this.indexa.data):t;if(s.length===0||s.some(a=>!(a instanceof ta)))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}=iw[o.typeId],c=s[0];this.isValid=h=>tw(c,h),this.get=h=>a(c,h),this.set=(h,p)=>l(c,h,p),this.indexOf=h=>u(c,h),this._offsets=[0,c.length];break}default:Object.setPrototypeOf(this,nw[o.typeId]),this._offsets=IP(s);break}this.data=s,this.type=o,this.stride=rb(o),this.numChildren=(n=(i=o.children)===null||i===void 0?void 0:i.length)!==null&&n!==void 0?n:0,this.length=this._offsets.at(-1)}get byteLength(){return this.data.reduce((t,e)=>t+e.byteLength,0)}get nullable(){return SP(this.data)}get nullCount(){return TP(this.data)}get ArrayType(){return this.type.ArrayType}get[Symbol.toStringTag](){return`${this.VectorName}<${this.type[Symbol.toStringTag]}>`}get VectorName(){return`${W[this.type.typeId]}Vector`}isValid(t){return!1}get(t){return null}at(t){return this.get(Qb(t,this.length))}set(t,e){}indexOf(t,e){return-1}includes(t,e){return this.indexOf(t,e)>-1}[Symbol.iterator](){return MP.visit(this)}concat(...t){return new Qe(this.data.concat(t.flatMap(e=>e.data).flat(Number.POSITIVE_INFINITY)))}slice(t,e){return new Qe(qb(this,t,e,({data:i,_offsets:n},s,o)=>EP(i,n,s,o)))}toJSON(){return[...this]}toArray(){const{type:t,data:e,length:i,stride:n,ArrayType:s}=this;switch(t.typeId){case W.Int:case W.Float:case W.Decimal:case W.Time:case W.Timestamp:switch(e.length){case 0:return new s;case 1:return e[0].values.subarray(0,i*n);default:return e.reduce((o,{values:a,length:l})=>(o.array.set(a.subarray(0,l*n),o.offset),o.offset+=l*n,o),{array:new s(i*n),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(i=>i.name===t))}getChildAt(t){return t>-1&&te[t])):null}get isMemoized(){return Et.isDictionary(this.type)?this.data[0].dictionary.isMemoized:!1}memoize(){if(Et.isDictionary(this.type)){const t=new kl(this.data[0].dictionary),e=this.data.map(i=>{const n=i.clone();return n.dictionary=t,n});return new Qe(e)}return new kl(this)}unmemoize(){if(Et.isDictionary(this.type)&&this.isMemoized){const t=this.data[0].dictionary.unmemoize(),e=this.data.map(i=>{const n=i.clone();return n.dictionary=t,n});return new Qe(e)}return this}}rw=Symbol.toStringTag;Qe[rw]=(r=>{r.type=Et.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(W).map(e=>W[e]).filter(e=>typeof e=="number"&&e!==W.NONE);for(const e of t){const i=Yr.getVisitFnByTypeId(e),n=Ei.getVisitFnByTypeId(e),s=dm.getVisitFnByTypeId(e);iw[e]={get:i,set:n,indexOf:s},nw[e]=Object.create(r,{isValid:{value:fm(tw)},get:{value:fm(Yr.getVisitFnByTypeId(e))},set:{value:CP(Ei.getVisitFnByTypeId(e))},indexOf:{value:AP(dm.getVisitFnByTypeId(e))}})}return"Vector"})(Qe.prototype);class kl extends Qe{constructor(t){super(t.data);const e=this.get,i=this.set,n=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){i.call(this,o,a),s[o]=a}}),Object.defineProperty(this,"slice",{value:(o,a)=>new kl(n.call(this,o,a))}),Object.defineProperty(this,"isMemoized",{value:!0}),Object.defineProperty(this,"unmemoize",{value:()=>new Qe(this.data)}),Object.defineProperty(this,"memoize",{value:()=>this})}}const DP=65536;function Ls(r){return r<0&&(r=4294967295+r+1),`0x${r.toString(16)}`}const io=8,Lf=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8];class Bf{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]),i=new Uint32Array([t.buffer[1]>>>16,t.buffer[1]&65535,t.buffer[0]>>>16,t.buffer[0]&65535]);let n=e[3]*i[3];this.buffer[0]=n&65535;let s=n>>>16;return n=e[2]*i[3],s+=n,n=e[3]*i[2]>>>0,s+=n,this.buffer[0]+=s<<16,this.buffer[1]=s>>>0>>16,this.buffer[1]+=e[1]*i[3]+e[2]*i[2]+e[3]*i[1],this.buffer[1]+=e[0]*i[3]+e[1]*i[2]+e[2]*i[1]+e[3]*i[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`${Ls(this.buffer[3])} ${Ls(this.buffer[2])} ${Ls(this.buffer[1])} ${Ls(this.buffer[0])}`}static multiply(t,e){return new ci(new Uint32Array(t.buffer)).times(e)}static add(t,e){return new ci(new Uint32Array(t.buffer)).plus(e)}static from(t,e=new Uint32Array(4)){return ci.fromString(typeof t=="string"?t:t.toString(),e)}static fromNumber(t,e=new Uint32Array(4)){return ci.fromString(t.toString(),e)}static fromString(t,e=new Uint32Array(4)){const i=t.startsWith("-"),n=t.length,s=new ci(e);for(let o=i?1:0;othis.compareFields(i,e[n]))}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 ur(r,t){return t instanceof r.constructor}function hs(r,t){return r===t||ur(r,t)}function Qi(r,t){return r===t||ur(r,t)&&r.bitWidth===t.bitWidth&&r.isSigned===t.isSigned}function lu(r,t){return r===t||ur(r,t)&&r.precision===t.precision}function NP(r,t){return r===t||ur(r,t)&&r.byteWidth===t.byteWidth}function kf(r,t){return r===t||ur(r,t)&&r.unit===t.unit}function fa(r,t){return r===t||ur(r,t)&&r.unit===t.unit&&r.timezone===t.timezone}function da(r,t){return r===t||ur(r,t)&&r.unit===t.unit&&r.bitWidth===t.bitWidth}function LP(r,t){return r===t||ur(r,t)&&r.children.length===t.children.length&&Ci.compareManyFields(r.children,t.children)}function BP(r,t){return r===t||ur(r,t)&&r.children.length===t.children.length&&Ci.compareManyFields(r.children,t.children)}function Uf(r,t){return r===t||ur(r,t)&&r.mode===t.mode&&r.typeIds.every((e,i)=>e===t.typeIds[i])&&Ci.compareManyFields(r.children,t.children)}function kP(r,t){return r===t||ur(r,t)&&r.id===t.id&&r.isOrdered===t.isOrdered&&Ci.visit(r.indices,t.indices)&&Ci.visit(r.dictionary,t.dictionary)}function zf(r,t){return r===t||ur(r,t)&&r.unit===t.unit}function pa(r,t){return r===t||ur(r,t)&&r.unit===t.unit}function UP(r,t){return r===t||ur(r,t)&&r.listSize===t.listSize&&r.children.length===t.children.length&&Ci.compareManyFields(r.children,t.children)}function zP(r,t){return r===t||ur(r,t)&&r.keysSorted===t.keysSorted&&r.children.length===t.children.length&&Ci.compareManyFields(r.children,t.children)}Ut.prototype.visitNull=hs;Ut.prototype.visitBool=hs;Ut.prototype.visitInt=Qi;Ut.prototype.visitInt8=Qi;Ut.prototype.visitInt16=Qi;Ut.prototype.visitInt32=Qi;Ut.prototype.visitInt64=Qi;Ut.prototype.visitUint8=Qi;Ut.prototype.visitUint16=Qi;Ut.prototype.visitUint32=Qi;Ut.prototype.visitUint64=Qi;Ut.prototype.visitFloat=lu;Ut.prototype.visitFloat16=lu;Ut.prototype.visitFloat32=lu;Ut.prototype.visitFloat64=lu;Ut.prototype.visitUtf8=hs;Ut.prototype.visitLargeUtf8=hs;Ut.prototype.visitBinary=hs;Ut.prototype.visitLargeBinary=hs;Ut.prototype.visitFixedSizeBinary=NP;Ut.prototype.visitDate=kf;Ut.prototype.visitDateDay=kf;Ut.prototype.visitDateMillisecond=kf;Ut.prototype.visitTimestamp=fa;Ut.prototype.visitTimestampSecond=fa;Ut.prototype.visitTimestampMillisecond=fa;Ut.prototype.visitTimestampMicrosecond=fa;Ut.prototype.visitTimestampNanosecond=fa;Ut.prototype.visitTime=da;Ut.prototype.visitTimeSecond=da;Ut.prototype.visitTimeMillisecond=da;Ut.prototype.visitTimeMicrosecond=da;Ut.prototype.visitTimeNanosecond=da;Ut.prototype.visitDecimal=hs;Ut.prototype.visitList=LP;Ut.prototype.visitStruct=BP;Ut.prototype.visitUnion=Uf;Ut.prototype.visitDenseUnion=Uf;Ut.prototype.visitSparseUnion=Uf;Ut.prototype.visitDictionary=kP;Ut.prototype.visitInterval=zf;Ut.prototype.visitIntervalDayTime=zf;Ut.prototype.visitIntervalYearMonth=zf;Ut.prototype.visitDuration=pa;Ut.prototype.visitDurationSecond=pa;Ut.prototype.visitDurationMillisecond=pa;Ut.prototype.visitDurationMicrosecond=pa;Ut.prototype.visitDurationNanosecond=pa;Ut.prototype.visitFixedSizeList=UP;Ut.prototype.visitMap=zP;const Ci=new Ut;function jP(r,t){return Ci.compareSchemas(r,t)}function $P(r,t){return Ci.compareFields(r,t)}function VP(r,t){return Ci.visit(r,t)}const pm=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},_F),RP),wP),xF),pF),_P),yF),{compareSchemas:jP,compareFields:$P,compareTypes:VP}),sw=6048e5,GP=864e5,mm=Symbol.for("constructDateFrom");function Gi(r,t){return typeof r=="function"?r(t):r&&typeof r=="object"&&mm in r?r[mm](t):r instanceof Date?new r.constructor(t):new Date(t)}function qr(r,t){return Gi(t||r,r)}let WP={};function uu(){return WP}function ea(r,t){var a,l,u,c;const e=uu(),i=(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,n=qr(r,t==null?void 0:t.in),s=n.getDay(),o=(s=s.getTime()?i+1:e.getTime()>=a.getTime()?i:i-1}function ym(r){const t=qr(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 HP(r,...t){const e=Gi.bind(null,t.find(i=>typeof i=="object"));return t.map(e)}function gm(r,t){const e=qr(r,t==null?void 0:t.in);return e.setHours(0,0,0,0),e}function XP(r,t,e){const[i,n]=HP(e==null?void 0:e.in,r,t),s=gm(i),o=gm(n),a=+s-ym(s),l=+o-ym(o);return Math.round((a-l)/GP)}function YP(r,t){const e=ow(r,t),i=Gi(r,0);return i.setFullYear(e,0,4),i.setHours(0,0,0,0),Ul(i)}function qP(r){return r instanceof Date||typeof r=="object"&&Object.prototype.toString.call(r)==="[object Date]"}function QP(r){return!(!qP(r)&&typeof r!="number"||isNaN(+qr(r)))}function KP(r,t){const e=qr(r,t==null?void 0:t.in);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}const ZP={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"}},JP=(r,t,e)=>{let i;const n=ZP[r];return typeof n=="string"?i=n:t===1?i=n.one:i=n.other.replace("{{count}}",t.toString()),e!=null&&e.addSuffix?e.comparison&&e.comparison>0?"in "+i:i+" ago":i};function nc(r){return(t={})=>{const e=t.width?String(t.width):r.defaultWidth;return r.formats[e]||r.formats[r.defaultWidth]}}const tM={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},eM={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},rM={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},iM={date:nc({formats:tM,defaultWidth:"full"}),time:nc({formats:eM,defaultWidth:"full"}),dateTime:nc({formats:rM,defaultWidth:"full"})},nM={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},sM=(r,t,e,i)=>nM[r];function go(r){return(t,e)=>{const i=e!=null&&e.context?String(e.context):"standalone";let n;if(i==="formatting"&&r.formattingValues){const o=r.defaultFormattingWidth||r.defaultWidth,a=e!=null&&e.width?String(e.width):o;n=r.formattingValues[a]||r.formattingValues[o]}else{const o=r.defaultWidth,a=e!=null&&e.width?String(e.width):r.defaultWidth;n=r.values[a]||r.values[o]}const s=r.argumentCallback?r.argumentCallback(t):t;return n[s]}}const oM={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},aM={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},lM={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"]},uM={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"]},cM={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"}},hM={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"}},fM=(r,t)=>{const e=Number(r),i=e%100;if(i>20||i<10)switch(i%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},dM={ordinalNumber:fM,era:go({values:oM,defaultWidth:"wide"}),quarter:go({values:aM,defaultWidth:"wide",argumentCallback:r=>r-1}),month:go({values:lM,defaultWidth:"wide"}),day:go({values:uM,defaultWidth:"wide"}),dayPeriod:go({values:cM,defaultWidth:"wide",formattingValues:hM,defaultFormattingWidth:"wide"})};function vo(r){return(t,e={})=>{const i=e.width,n=i&&r.matchPatterns[i]||r.matchPatterns[r.defaultMatchWidth],s=t.match(n);if(!s)return null;const o=s[0],a=i&&r.parsePatterns[i]||r.parsePatterns[r.defaultParseWidth],l=Array.isArray(a)?mM(a,h=>h.test(o)):pM(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 pM(r,t){for(const e in r)if(Object.prototype.hasOwnProperty.call(r,e)&&t(r[e]))return e}function mM(r,t){for(let e=0;e{const i=t.match(r.matchPattern);if(!i)return null;const n=i[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(n.length);return{value:o,rest:a}}}const gM=/^(\d+)(th|st|nd|rd)?/i,vM=/\d+/i,_M={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},bM={any:[/^b/i,/^(a|c)/i]},wM={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},xM={any:[/1/i,/2/i,/3/i,/4/i]},SM={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},TM={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]},IM={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},EM={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]},CM={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},AM={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}},OM={ordinalNumber:yM({matchPattern:gM,parsePattern:vM,valueCallback:r=>parseInt(r,10)}),era:vo({matchPatterns:_M,defaultMatchWidth:"wide",parsePatterns:bM,defaultParseWidth:"any"}),quarter:vo({matchPatterns:wM,defaultMatchWidth:"wide",parsePatterns:xM,defaultParseWidth:"any",valueCallback:r=>r+1}),month:vo({matchPatterns:SM,defaultMatchWidth:"wide",parsePatterns:TM,defaultParseWidth:"any"}),day:vo({matchPatterns:IM,defaultMatchWidth:"wide",parsePatterns:EM,defaultParseWidth:"any"}),dayPeriod:vo({matchPatterns:CM,defaultMatchWidth:"any",parsePatterns:AM,defaultParseWidth:"any"})},FM={code:"en-US",formatDistance:JP,formatLong:iM,formatRelative:sM,localize:dM,match:OM,options:{weekStartsOn:0,firstWeekContainsDate:1}};function PM(r,t){const e=qr(r,t==null?void 0:t.in);return XP(e,KP(e))+1}function MM(r,t){const e=qr(r,t==null?void 0:t.in),i=+Ul(e)-+YP(e);return Math.round(i/sw)+1}function aw(r,t){var c,h,p,f;const e=qr(r,t==null?void 0:t.in),i=e.getFullYear(),n=uu(),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)??n.firstWeekContainsDate??((f=(p=n.locale)==null?void 0:p.options)==null?void 0:f.firstWeekContainsDate)??1,o=Gi((t==null?void 0:t.in)||r,0);o.setFullYear(i+1,0,s),o.setHours(0,0,0,0);const a=ea(o,t),l=Gi((t==null?void 0:t.in)||r,0);l.setFullYear(i,0,s),l.setHours(0,0,0,0);const u=ea(l,t);return+e>=+a?i+1:+e>=+u?i:i-1}function DM(r,t){var a,l,u,c;const e=uu(),i=(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,n=aw(r,t),s=Gi((t==null?void 0:t.in)||r,0);return s.setFullYear(n,0,i),s.setHours(0,0,0,0),ea(s,t)}function RM(r,t){const e=qr(r,t==null?void 0:t.in),i=+ea(e,t)-+DM(e,t);return Math.round(i/sw)+1}function ve(r,t){const e=r<0?"-":"",i=Math.abs(r).toString().padStart(t,"0");return e+i}const rn={y(r,t){const e=r.getFullYear(),i=e>0?e:1-e;return ve(t==="yy"?i%100:i,t.length)},M(r,t){const e=r.getMonth();return t==="M"?String(e+1):ve(e+1,2)},d(r,t){return ve(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 ve(r.getHours()%12||12,t.length)},H(r,t){return ve(r.getHours(),t.length)},m(r,t){return ve(r.getMinutes(),t.length)},s(r,t){return ve(r.getSeconds(),t.length)},S(r,t){const e=t.length,i=r.getMilliseconds(),n=Math.trunc(i*Math.pow(10,e-3));return ve(n,t.length)}},_s={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},vm={G:function(r,t,e){const i=r.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return e.era(i,{width:"abbreviated"});case"GGGGG":return e.era(i,{width:"narrow"});case"GGGG":default:return e.era(i,{width:"wide"})}},y:function(r,t,e){if(t==="yo"){const i=r.getFullYear(),n=i>0?i:1-i;return e.ordinalNumber(n,{unit:"year"})}return rn.y(r,t)},Y:function(r,t,e,i){const n=aw(r,i),s=n>0?n:1-n;if(t==="YY"){const o=s%100;return ve(o,2)}return t==="Yo"?e.ordinalNumber(s,{unit:"year"}):ve(s,t.length)},R:function(r,t){const e=ow(r);return ve(e,t.length)},u:function(r,t){const e=r.getFullYear();return ve(e,t.length)},Q:function(r,t,e){const i=Math.ceil((r.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return ve(i,2);case"Qo":return e.ordinalNumber(i,{unit:"quarter"});case"QQQ":return e.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return e.quarter(i,{width:"wide",context:"formatting"})}},q:function(r,t,e){const i=Math.ceil((r.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return ve(i,2);case"qo":return e.ordinalNumber(i,{unit:"quarter"});case"qqq":return e.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return e.quarter(i,{width:"wide",context:"standalone"})}},M:function(r,t,e){const i=r.getMonth();switch(t){case"M":case"MM":return rn.M(r,t);case"Mo":return e.ordinalNumber(i+1,{unit:"month"});case"MMM":return e.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return e.month(i,{width:"wide",context:"formatting"})}},L:function(r,t,e){const i=r.getMonth();switch(t){case"L":return String(i+1);case"LL":return ve(i+1,2);case"Lo":return e.ordinalNumber(i+1,{unit:"month"});case"LLL":return e.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return e.month(i,{width:"wide",context:"standalone"})}},w:function(r,t,e,i){const n=RM(r,i);return t==="wo"?e.ordinalNumber(n,{unit:"week"}):ve(n,t.length)},I:function(r,t,e){const i=MM(r);return t==="Io"?e.ordinalNumber(i,{unit:"week"}):ve(i,t.length)},d:function(r,t,e){return t==="do"?e.ordinalNumber(r.getDate(),{unit:"date"}):rn.d(r,t)},D:function(r,t,e){const i=PM(r);return t==="Do"?e.ordinalNumber(i,{unit:"dayOfYear"}):ve(i,t.length)},E:function(r,t,e){const i=r.getDay();switch(t){case"E":case"EE":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"})}},e:function(r,t,e,i){const n=r.getDay(),s=(n-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return ve(s,2);case"eo":return e.ordinalNumber(s,{unit:"day"});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"})}},c:function(r,t,e,i){const n=r.getDay(),s=(n-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return ve(s,t.length);case"co":return e.ordinalNumber(s,{unit:"day"});case"ccc":return e.day(n,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(n,{width:"narrow",context:"standalone"});case"cccccc":return e.day(n,{width:"short",context:"standalone"});case"cccc":default:return e.day(n,{width:"wide",context:"standalone"})}},i:function(r,t,e){const i=r.getDay(),n=i===0?7:i;switch(t){case"i":return String(n);case"ii":return ve(n,t.length);case"io":return e.ordinalNumber(n,{unit:"day"});case"iii":return e.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(i,{width:"short",context:"formatting"});case"iiii":default:return e.day(i,{width:"wide",context:"formatting"})}},a:function(r,t,e){const n=r.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"aaa":return e.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return e.dayPeriod(n,{width:"narrow",context:"formatting"});case"aaaa":default:return e.dayPeriod(n,{width:"wide",context:"formatting"})}},b:function(r,t,e){const i=r.getHours();let n;switch(i===12?n=_s.noon:i===0?n=_s.midnight:n=i/12>=1?"pm":"am",t){case"b":case"bb":return e.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(n,{width:"narrow",context:"formatting"});case"bbbb":default:return e.dayPeriod(n,{width:"wide",context:"formatting"})}},B:function(r,t,e){const i=r.getHours();let n;switch(i>=17?n=_s.evening:i>=12?n=_s.afternoon:i>=4?n=_s.morning:n=_s.night,t){case"B":case"BB":case"BBB":return e.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(n,{width:"narrow",context:"formatting"});case"BBBB":default:return e.dayPeriod(n,{width:"wide",context:"formatting"})}},h:function(r,t,e){if(t==="ho"){let i=r.getHours()%12;return i===0&&(i=12),e.ordinalNumber(i,{unit:"hour"})}return rn.h(r,t)},H:function(r,t,e){return t==="Ho"?e.ordinalNumber(r.getHours(),{unit:"hour"}):rn.H(r,t)},K:function(r,t,e){const i=r.getHours()%12;return t==="Ko"?e.ordinalNumber(i,{unit:"hour"}):ve(i,t.length)},k:function(r,t,e){let i=r.getHours();return i===0&&(i=24),t==="ko"?e.ordinalNumber(i,{unit:"hour"}):ve(i,t.length)},m:function(r,t,e){return t==="mo"?e.ordinalNumber(r.getMinutes(),{unit:"minute"}):rn.m(r,t)},s:function(r,t,e){return t==="so"?e.ordinalNumber(r.getSeconds(),{unit:"second"}):rn.s(r,t)},S:function(r,t){return rn.S(r,t)},X:function(r,t,e){const i=r.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return bm(i);case"XXXX":case"XX":return Vn(i);case"XXXXX":case"XXX":default:return Vn(i,":")}},x:function(r,t,e){const i=r.getTimezoneOffset();switch(t){case"x":return bm(i);case"xxxx":case"xx":return Vn(i);case"xxxxx":case"xxx":default:return Vn(i,":")}},O:function(r,t,e){const i=r.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+_m(i,":");case"OOOO":default:return"GMT"+Vn(i,":")}},z:function(r,t,e){const i=r.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+_m(i,":");case"zzzz":default:return"GMT"+Vn(i,":")}},t:function(r,t,e){const i=Math.trunc(+r/1e3);return ve(i,t.length)},T:function(r,t,e){return ve(+r,t.length)}};function _m(r,t=""){const e=r>0?"-":"+",i=Math.abs(r),n=Math.trunc(i/60),s=i%60;return s===0?e+String(n):e+String(n)+t+ve(s,2)}function bm(r,t){return r%60===0?(r>0?"-":"+")+ve(Math.abs(r)/60,2):Vn(r,t)}function Vn(r,t=""){const e=r>0?"-":"+",i=Math.abs(r),n=ve(Math.trunc(i/60),2),s=ve(i%60,2);return e+n+t+s}const wm=(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"})}},lw=(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"})}},NM=(r,t)=>{const e=r.match(/(P+)(p+)?/)||[],i=e[1],n=e[2];if(!n)return wm(r,t);let s;switch(i){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}}",wm(i,t)).replace("{{time}}",lw(n,t))},LM={p:lw,P:NM},BM=/^D+$/,kM=/^Y+$/,UM=["D","DD","YY","YYYY"];function zM(r){return BM.test(r)}function jM(r){return kM.test(r)}function $M(r,t,e){const i=VM(r,t,e);if(console.warn(i),UM.includes(r))throw new RangeError(i)}function VM(r,t,e){const i=r[0]==="Y"?"years":"days of the month";return`Use \`${r.toLowerCase()}\` instead of \`${r}\` (in \`${t}\`) for formatting ${i} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const GM=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,WM=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,HM=/^'([^]*?)'?$/,XM=/''/g,YM=/[a-zA-Z]/;function uw(r,t,e){var c,h,p,f;const i=uu(),n=i.locale??FM,s=i.firstWeekContainsDate??((h=(c=i.locale)==null?void 0:c.options)==null?void 0:h.firstWeekContainsDate)??1,o=i.weekStartsOn??((f=(p=i.locale)==null?void 0:p.options)==null?void 0:f.weekStartsOn)??0,a=qr(r,e==null?void 0:e.in);if(!QP(a))throw new RangeError("Invalid time value");let l=t.match(WM).map(y=>{const g=y[0];if(g==="p"||g==="P"){const d=LM[g];return d(y,n.formatLong)}return y}).join("").match(GM).map(y=>{if(y==="''")return{isToken:!1,value:"'"};const g=y[0];if(g==="'")return{isToken:!1,value:qM(y)};if(vm[g])return{isToken:!0,value:y};if(g.match(YM))throw new RangeError("Format string contains an unescaped latin alphabet character `"+g+"`");return{isToken:!1,value:y}});n.localize.preprocessor&&(l=n.localize.preprocessor(a,l));const u={firstWeekContainsDate:s,weekStartsOn:o,locale:n};return l.map(y=>{if(!y.isToken)return y.value;const g=y.value;(jM(g)||zM(g))&&$M(g,t,String(r));const d=vm[g[0]];return d(a,g,n.localize,u)}).join("")}function qM(r){const t=r.match(HM);return t?t[1].replace(XM,"'"):r}function QM(r,t){return qr(r*1e3,t==null?void 0:t.in)}function KM(r,t){const e=ZM(t)?new t(0):Gi(t,0);return e.setFullYear(r.getFullYear(),r.getMonth(),r.getDate()),e.setHours(r.getHours(),r.getMinutes(),r.getSeconds(),r.getMilliseconds()),e}function ZM(r){var t;return typeof r=="function"&&((t=r.prototype)==null?void 0:t.constructor)===r}function JM(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 gr(r){return r==null}function tD(r){return r!=null}async function Sh(){if(typeof window<"u"&&window!==null)return"browser";try{const r=await ln(()=>import("./__vite-browser-external-FmFgRqLi.js"),[]);return typeof r<"u"&&r.versions!=null&&r.versions.node!=null?"node":"unknown"}catch{return"unknown"}}function eD(r){return gr(r)?!1:Et.isInt(r.type)&&!cw(r)||rD(r)}function rD(r){return gr(r)?!1:Et.isInt(r.type)&&r.type.isSigned===!1}function iD(r){return gr(r)?!1:Et.isFloat(r.type)??!1}function nD(r){return gr(r)?!1:Et.isDecimal(r.type)}function sD(r){return gr(r)?!1:Et.isBool(r.type)}function oD(r){return gr(r)?!1:Et.isDuration(r.type)}function cw(r){return gr(r)?!1:Et.isInt(r.type)&&r.metadata.get("ARROW:extension:name")==="period"}function aD(r){return gr(r)?!1:Et.isTimestamp(r.type)}function lD(r){return gr(r)?!1:Et.isDate(r.type)}function uD(r){return gr(r)?!1:Et.isTime(r.type)}function cD(r){return gr(r)?!1:Et.isList(r.type)||Et.isFixedSizeList(r.type)}function hD(r){return gr(r)?!1:Et.isStruct(r.type)||Et.isMap(r.type)}function fD(r){return gr(r)?!1:Et.isStruct(r.type)&&r.metadata.get("ARROW:extension:name")==="interval"||Et.isInterval(r.type)}function dD(r,t){let e;if(t===Jt.MILLISECOND)e=1e3;else if(t===Jt.MICROSECOND)e=1e3*1e3;else if(t===Jt.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 pD(r,t){var i;const e=dD(r,((i=t==null?void 0:t.type)==null?void 0:i.unit)??Jt.SECOND);return QM(e)}function mD(r,t){const e=pD(r,t);return uw(e,e.getMilliseconds()===0?"HH:mm:ss":"HH:mm:ss.SSS")}function yD(r){const t="yyyy-MM-dd";return r instanceof Date||typeof r=="number"&&Number.isFinite(r)?uw(r,t):(console.warn(`Unsupported date value: ${r}`),String(r))}function gD(r,t){var n;if(!(r instanceof Date||typeof r=="number"&&Number.isFinite(r)))return console.warn(`Unsupported datetime value: ${r}`),null;let e;const i=(n=t==null?void 0:t.type)==null?void 0:n.timezone;return typeof r=="number"?i?e=new Er(r,i):e=new Er(r):i?e=new Er(r,i):e=new Er(r),KM(e,Date)}function vD(r,t){var a;const e=((a=t==null?void 0:t.type)==null?void 0:a.scale)||0;let i=pm.bigNumToString(new pm.BN(r)).padStart(e,"0");if(e===0)return i;let n="";i.startsWith("-")&&(n="-",i=i.slice(1));const s=i.slice(0,-e)||"0",o=JM(i.slice(-e),"0")||"";return`${n}${s}${o?`.${o}`:""}`}function _D(r){const t=r[0],e=r[1],i=[];return t!==0&&i.push(`${t} year${t>1?"s":""}`),e!==0&&i.push(`${e} month${e>1?"s":""}`),i.length?i.join(" "):"0 months"}function bD(r,t){var i,n,s,o;if(Et.isInterval(t==null?void 0:t.type))return _D(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"?"]":")",p=Th(u.left,(n=(i=t.type)==null?void 0:i.children)==null?void 0:n[0]),f=Th(u.right,(o=(s=t.type)==null?void 0:s.children)==null?void 0:o[1]);return`${c+p}, ${f+h}`}return String(r)}function wD(r,t){return(t==null?void 0:t.type)instanceof bh?JSON.parse(JSON.stringify(r,(e,i)=>{if(tD(i))return typeof i=="bigint"?Number(i):i})):JSON.parse(JSON.stringify(r,(e,i)=>typeof i=="bigint"?Number(i):i))}function Th(r,t){if(gr(r))return null;const e=r instanceof Date||Number.isFinite(r);if(e&&lD(t))return yD(r);if(typeof r=="bigint"&&uD(t))return mD(Number(r),t);if(e&&aD(t))return gD(r,t);if(cw(t))throw new Error("Period type is not supported yet");if(fD(t))return bD(r,t);if(oD(t))throw new Error("Duration type is not supported yet");return nD(t)?vD(r,t):iD(t)&&Number.isFinite(r)||eD(t)?r:hD(t)||cD(t)?wD(r,t):sD(t)?!!r:String(r)}function xm(r){return((r.toArray()||[]).map(i=>i.toJSON())||[]).map(i=>(r.schema.fields.forEach(n=>i[n.name]=Th(i[n.name],n)),i))}var ra=(r=>(r.ORIGIN_PRIVATE_FS="origin-private-fs",r.NODE_FS="node-fs",r))(ra||{});async function hw(r){const t=Cx(r,{logger:!1});let e,i;const n=await Sh();if(n==="browser"){if(typeof t.bundles>"u"){const{getBundles:l}=await ln(async()=>{const{getBundles:u}=await import("./default-browser-BrgSDbLD.js");return{getBundles:u}},[]);t.bundles=await l()}i=await kp(await t.bundles),e=new Worker(i.mainWorker)}else if(n==="node"){if(typeof t.bundles>"u"){const{getBundles:c}=await ln(async()=>{const{getBundles:h}=await import("./default-node-CoUhZWYT.js");return{getBundles:h}},__vite__mapDeps([0,1,2]));t.bundles=await c()}i=await kp(await t.bundles);let l=i.mainWorker;l.startsWith("/@fs/")&&(l=l.replace("/@fs/","file://"));const u=await ln(()=>import("./index-Cp8iQ_hy.js"),[]);e=new u.default(l,{type:"module"})}else throw new Error(`Unsupported environment: ${n}`);let s;t.logger===!0?s=new I0:t.logger===!1?s=new c2:s=t.logger;const o=new g2(s,e);if(await o.instantiate(i.mainModule,i.pthreadWorker),t.storage)switch(t.storage.type){case ra.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 ra.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 f=await a.query(l);return xm(f)}const c=await a.prepare(l),h=await c.query(...u),p=xm(h);return c.close(),p},close:async()=>{await a.close(),await o.terminate(),await e.terminate()}}}async function xD(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 SD(r,t,e){await(await r).conn.send(`SAVEPOINT ${t}`);try{const i=await e(r);return await(await r).conn.send(`RELEASE SAVEPOINT ${t}`),i}catch(i){throw await(await r).conn.send(`ROLLBACK TO SAVEPOINT ${t}`),i}}const xt=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,xt))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(xt in e&&e[xt]===t[xt])return!0;e=Object.getPrototypeOf(e)}return!1}var Mm;Mm=xt;class Ke{constructor(t,e){$(this,"name");$(this,"keyAsName");$(this,"primary");$(this,"notNull");$(this,"default");$(this,"defaultFn");$(this,"onUpdateFn");$(this,"hasDefault");$(this,"isUnique");$(this,"uniqueName");$(this,"uniqueType");$(this,"dataType");$(this,"columnType");$(this,"enumValues");$(this,"generated");$(this,"generatedIdentity");$(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"}}$(Ke,Mm,"Column");const Ys=Symbol.for("drizzle:Name");function TD(r,t){return`${r[Ys]}_${t.join("_")}_unique`}var Dm,Rm;class Ar extends(Rm=Ke,Dm=xt,Rm){constructor(t,e){e.uniqueName||(e.uniqueName=TD(t,[e.name])),super(t,e),this.table=t}}$(Ar,Dm,"PgColumn");const Sm=Symbol.for("drizzle:isPgEnum");function ID(r){return!!r&&typeof r=="function"&&Sm in r&&r[Sm]===!0}var Nm;Nm=xt;class Or{constructor(t,e,i,n=!1){this._={brand:"Subquery",sql:t,selectedFields:e,alias:i,isWith:n}}}$(Or,Nm,"Subquery");var Lm,Bm;class jf extends(Bm=Or,Lm=xt,Bm){}$(jf,Lm,"WithSubquery");const Pr={startActiveSpan(r,t){return t()}},He=Symbol.for("drizzle:ViewBaseConfig"),Qa=Symbol.for("drizzle:Schema"),Ih=Symbol.for("drizzle:Columns"),Tm=Symbol.for("drizzle:ExtraConfigColumns"),sc=Symbol.for("drizzle:OriginalName"),oc=Symbol.for("drizzle:BaseName"),zl=Symbol.for("drizzle:IsAlias"),Im=Symbol.for("drizzle:ExtraConfigBuilder"),ED=Symbol.for("drizzle:IsDrizzleTable");var km,Um,zm,jm,$m,Vm,Gm,Wm,Hm,Xm;Xm=xt,Hm=Ys,Wm=sc,Gm=Qa,Vm=Ih,$m=Tm,jm=oc,zm=zl,Um=ED,km=Im;class Tt{constructor(t,e,i){$(this,Hm);$(this,Wm);$(this,Gm);$(this,Vm);$(this,$m);$(this,jm);$(this,zm,!1);$(this,Um,!0);$(this,km);this[Ys]=this[sc]=t,this[Qa]=e,this[oc]=i}}$(Tt,Xm,"Table"),$(Tt,"Symbol",{Name:Ys,Schema:Qa,OriginalName:sc,Columns:Ih,ExtraConfigColumns:Tm,BaseName:oc,IsAlias:zl,ExtraConfigBuilder:Im});function qn(r){return r[Ys]}function ia(r){return`${r[Qa]??"public"}.${r[Ys]}`}function fw(r){return r!=null&&typeof r.getSQL=="function"}function CD(r){var e;const t={sql:"",params:[]};for(const i of r)t.sql+=i.sql,t.params.push(...i.params),(e=i.typings)!=null&&e.length&&(t.typings||(t.typings=[]),t.typings.push(...i.typings));return t}var Ym;Ym=xt;class Xe{constructor(t){$(this,"value");this.value=Array.isArray(t)?t:[t]}getSQL(){return new Ft([this])}}$(Xe,Ym,"StringChunk");var qm;qm=xt;const Hn=class Hn{constructor(t){$(this,"decoder",dw);$(this,"shouldInlineParams",!1);this.queryChunks=t}append(t){return this.queryChunks.push(...t.queryChunks),this}toQuery(t){return Pr.startActiveSpan("drizzle.buildSQL",e=>{const i=this.buildQueryFromSourceParams(this.queryChunks,t);return e==null||e.setAttributes({"drizzle.query.text":i.sql,"drizzle.query.params":JSON.stringify(i.params)}),i})}buildQueryFromSourceParams(t,e){const i=Object.assign({},e,{inlineParams:e.inlineParams||this.shouldInlineParams,paramStartIndex:e.paramStartIndex||{value:0}}),{casing:n,escapeName:s,escapeParam:o,prepareTyping:a,inlineParams:l,paramStartIndex:u}=i;return CD(t.map(c=>{var h;if(lt(c,Xe))return{sql:c.value.join(""),params:[]};if(lt(c,jl))return{sql:s(c.value),params:[]};if(c===void 0)return{sql:"",params:[]};if(Array.isArray(c)){const p=[new Xe("(")];for(const[f,y]of c.entries())p.push(y),fr},pw={mapToDriverValue:r=>r};({...dw,...pw});var Km;Km=xt;class Wi{constructor(t,e=pw){$(this,"brand");this.value=t,this.encoder=e}getSQL(){return new Ft([this])}}$(Wi,Km,"Param");function H(r,...t){const e=[];(t.length>0||r.length>0&&r[0]!=="")&&e.push(new Xe(r[0]));for(const[i,n]of t.entries())e.push(n,new Xe(r[i+1]));return new Ft(e)}(r=>{function t(){return new Ft([])}r.empty=t;function e(l){return new Ft(l)}r.fromList=e;function i(l){return new Ft([new Xe(l)])}r.raw=i;function n(l,u){const c=[];for(const[h,p]of l.entries())h>0&&u!==void 0&&c.push(u),c.push(p);return new Ft(c)}r.join=n;function s(l){return new jl(l)}r.identifier=s;function o(l){return new ss(l)}r.placeholder=o;function a(l,u){return new Wi(l,u)}r.param=a})(H||(H={}));(r=>{var e;e=xt;const i=class i{constructor(s,o){$(this,"isSelectionField",!1);this.sql=s,this.fieldAlias=o}getSQL(){return this.sql}clone(){return new i(this.sql,this.fieldAlias)}};$(i,e,"SQL.Aliased");let t=i;r.Aliased=t})(Ft||(Ft={}));var Zm;Zm=xt;class ss{constructor(t){this.name=t}getSQL(){return new Ft([this])}}$(ss,Zm,"Placeholder");function Em(r,t){return r.map(e=>{if(lt(e,ss)){if(!(e.name in t))throw new Error(`No value for placeholder "${e.name}" was provided`);return t[e.name]}if(lt(e,Wi)&<(e.value,ss)){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 OD=Symbol.for("drizzle:IsDrizzleView");var Jm,ty,ey;ey=xt,ty=He,Jm=OD;class Sn{constructor({name:t,schema:e,selectedFields:i,query:n}){$(this,ty);$(this,Jm,!0);this[He]={name:t,originalName:t,schema:e,selectedFields:i,query:n,isExisting:!n,isAlias:!1}}getSQL(){return new Ft([this])}}$(Sn,ey,"View");Ke.prototype.getSQL=function(){return new Ft([this])};Tt.prototype.getSQL=function(){return new Ft([this])};Or.prototype.getSQL=function(){return new Ft([this])};var ry;ry=xt;class na{constructor(t){this.table=t}get(t,e){return e==="table"?this.table:t[e]}}$(na,ry,"ColumnAliasProxyHandler");var iy;iy=xt;class cu{constructor(t,e){this.alias=t,this.replaceOriginalName=e}get(t,e){if(e===Tt.Symbol.IsAlias)return!0;if(e===Tt.Symbol.Name)return this.alias;if(this.replaceOriginalName&&e===Tt.Symbol.OriginalName)return this.alias;if(e===He)return{...t[He],name:this.alias,isAlias:!0};if(e===Tt.Symbol.Columns){const n=t[Tt.Symbol.Columns];if(!n)return n;const s={};return Object.keys(n).map(o=>{s[o]=new Proxy(n[o],new na(new Proxy(t,this)))}),s}const i=t[e];return lt(i,Ke)?new Proxy(i,new na(new Proxy(t,this))):i}}$(cu,iy,"TableAliasProxyHandler");function ac(r,t){return new Proxy(r,new cu(t,!1))}function Li(r,t){return new Proxy(r,new na(new Proxy(r.table,new cu(t,!1))))}function mw(r,t){return new Ft.Aliased($l(r.sql,t),r.fieldAlias)}function $l(r,t){return H.join(r.queryChunks.map(e=>lt(e,Ke)?Li(e,t):lt(e,Ft)?$l(e,t):lt(e,Ft.Aliased)?mw(e,t):e))}var ny,sy;class $f extends(sy=Error,ny=xt,sy){constructor({message:t,cause:e}){super(t),this.name="DrizzleError",this.cause=e}}$($f,ny,"DrizzleError");var oy,ay;class yw extends(ay=$f,oy=xt,ay){constructor(){super({message:"Rollback"})}}$(yw,oy,"TransactionRollbackError");var ly;ly=xt;class gw{write(t){console.log(t)}}$(gw,ly,"ConsoleLogWriter");var uy;uy=xt;class vw{constructor(t){$(this,"writer");this.writer=(t==null?void 0:t.writer)??new gw}logQuery(t,e){const i=e.map(s=>{try{return JSON.stringify(s)}catch{return String(s)}}),n=i.length?` -- params: [${i.join(", ")}]`:"";this.writer.write(`Query: ${t}${n}`)}}$(vw,uy,"DefaultLogger");var cy;cy=xt;class _w{logQuery(){}}$(_w,cy,"NoopLogger");var hy,fy;fy=xt,hy=Symbol.toStringTag;class Tn{constructor(){$(this,hy,"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)}}$(Tn,fy,"QueryPromise");function os(r,t){return Object.entries(r).reduce((e,[i,n])=>{if(typeof i!="string")return e;const s=t?[...t,i]:[i];return lt(n,Ke)||lt(n,Ft)||lt(n,Ft.Aliased)?e.push({path:s,field:n}):lt(n,Tt)?e.push(...os(n[Tt.Symbol.Columns],s)):e.push(...os(n,s)),e},[])}function Vf(r,t){const e=Object.keys(r),i=Object.keys(t);if(e.length!==i.length)return!1;for(const[n,s]of e.entries())if(s!==i[n])return!1;return!0}function bw(r,t){const e=Object.entries(t).filter(([,i])=>i!==void 0).map(([i,n])=>lt(n,Ft)||lt(n,Ke)?[i,n]:[i,new Wi(n,r[Tt.Symbol.Columns][i])]);if(e.length===0)throw new Error("No values to set");return Object.fromEntries(e)}function FD(r,t){for(const e of t)for(const i of Object.getOwnPropertyNames(e.prototype))i!=="constructor"&&Object.defineProperty(r.prototype,i,Object.getOwnPropertyDescriptor(e.prototype,i)||Object.create(null))}function PD(r){return r[Tt.Symbol.Columns]}function Wn(r){return lt(r,Or)?r._.alias:lt(r,Sn)?r[He].name:lt(r,Ft)?void 0:r[Tt.Symbol.IsAlias]?r[Tt.Symbol.Name]:r[Tt.Symbol.BaseName]}function MD(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 dy,py;class ww extends(py=Ar,dy=xt,py){getSQLType(){return"date"}mapFromDriverValue(t){return new Date(t)}mapToDriverValue(t){return t.toISOString()}}$(ww,dy,"PgDate");var my,yy;class xw extends(yy=Ar,my=xt,yy){getSQLType(){return"date"}}$(xw,my,"PgDateString");var gy,vy;class Sw extends(vy=Ar,gy=xt,vy){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}}$(Sw,gy,"PgJson");var _y,by;class Tw extends(by=Ar,_y=xt,by){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}}$(Tw,_y,"PgJsonb");var wy,xy;class Iw extends(xy=Ar,wy=xt,xy){constructor(e,i){super(e,i);$(this,"precision");$(this,"scale");this.precision=i.precision,this.scale=i.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})`}}$(Iw,wy,"PgNumeric");var Sy,Ty;class Ew extends(Ty=Ar,Sy=xt,Ty){constructor(e,i){super(e,i);$(this,"withTimezone");$(this,"precision");this.withTimezone=i.withTimezone,this.precision=i.precision}getSQLType(){return`time${this.precision===void 0?"":`(${this.precision})`}${this.withTimezone?" with time zone":""}`}}$(Ew,Sy,"PgTime");var Iy,Ey;class Cw extends(Ey=Ar,Iy=xt,Ey){constructor(e,i){super(e,i);$(this,"withTimezone");$(this,"precision");$(this,"mapFromDriverValue",e=>new Date(this.withTimezone?e:e+"+0000"));$(this,"mapToDriverValue",e=>e.toISOString());this.withTimezone=i.withTimezone,this.precision=i.precision}getSQLType(){return`timestamp${this.precision===void 0?"":` (${this.precision})`}${this.withTimezone?" with time zone":""}`}}$(Cw,Iy,"PgTimestamp");var Cy,Ay;class Aw extends(Ay=Ar,Cy=xt,Ay){constructor(e,i){super(e,i);$(this,"withTimezone");$(this,"precision");this.withTimezone=i.withTimezone,this.precision=i.precision}getSQLType(){return`timestamp${this.precision===void 0?"":`(${this.precision})`}${this.withTimezone?" with time zone":""}`}}$(Aw,Cy,"PgTimestampString");var Oy,Fy;class Ow extends(Fy=Ar,Oy=xt,Fy){getSQLType(){return"uuid"}}$(Ow,Oy,"PgUUID");const Cm=Symbol.for("drizzle:PgInlineForeignKeys"),Am=Symbol.for("drizzle:EnableRLS");var Py,My,Dy,Ry,Ny,Ly;class Br extends(Ly=Tt,Ny=xt,Ry=Cm,Dy=Am,My=Tt.Symbol.ExtraConfigBuilder,Py=Tt.Symbol.ExtraConfigColumns,Ly){constructor(){super(...arguments);$(this,Ry,[]);$(this,Dy,!1);$(this,My);$(this,Py,{})}}$(Br,Ny,"PgTable"),$(Br,"Symbol",Object.assign({},Tt.Symbol,{InlineForeignKeys:Cm,EnableRLS:Am}));var By;By=xt;class Fw{constructor(t,e){$(this,"columns");$(this,"name");this.columns=t,this.name=e}build(t){return new Pw(t,this.columns,this.name)}}$(Fw,By,"PgPrimaryKeyBuilder");var ky;ky=xt;class Pw{constructor(t,e,i){$(this,"columns");$(this,"name");this.table=t,this.columns=e,this.name=i}getName(){return this.name??`${this.table[Br.Symbol.Name]}_${this.columns.map(t=>t.name).join("_")}_pk`}}$(Pw,ky,"PgPrimaryKey");function yr(r,t){return AD(t)&&!fw(r)&&!lt(r,Wi)&&!lt(r,ss)&&!lt(r,Ke)&&!lt(r,Tt)&&!lt(r,Sn)?new Wi(r,t):r}const Mw=(r,t)=>H`${r} = ${yr(t,r)}`,DD=(r,t)=>H`${r} <> ${yr(t,r)}`;function Eh(...r){const t=r.filter(e=>e!==void 0);if(t.length!==0)return t.length===1?new Ft(t):new Ft([new Xe("("),H.join(t,new Xe(" and ")),new Xe(")")])}function RD(...r){const t=r.filter(e=>e!==void 0);if(t.length!==0)return t.length===1?new Ft(t):new Ft([new Xe("("),H.join(t,new Xe(" or ")),new Xe(")")])}function ND(r){return H`not ${r}`}const LD=(r,t)=>H`${r} > ${yr(t,r)}`,BD=(r,t)=>H`${r} >= ${yr(t,r)}`,kD=(r,t)=>H`${r} < ${yr(t,r)}`,UD=(r,t)=>H`${r} <= ${yr(t,r)}`;function zD(r,t){return Array.isArray(t)?t.length===0?H`false`:H`${r} in ${t.map(e=>yr(e,r))}`:H`${r} in ${yr(t,r)}`}function jD(r,t){return Array.isArray(t)?t.length===0?H`true`:H`${r} not in ${t.map(e=>yr(e,r))}`:H`${r} not in ${yr(t,r)}`}function $D(r){return H`${r} is null`}function VD(r){return H`${r} is not null`}function GD(r){return H`exists ${r}`}function WD(r){return H`not exists ${r}`}function HD(r,t,e){return H`${r} between ${yr(t,r)} and ${yr(e,r)}`}function XD(r,t,e){return H`${r} not between ${yr(t,r)} and ${yr(e,r)}`}function YD(r,t){return H`${r} like ${t}`}function qD(r,t){return H`${r} not like ${t}`}function QD(r,t){return H`${r} ilike ${t}`}function KD(r,t){return H`${r} not ilike ${t}`}function ZD(r){return H`${r} asc`}function JD(r){return H`${r} desc`}var Uy;Uy=xt;class Gf{constructor(t,e,i){$(this,"referencedTableName");$(this,"fieldName");this.sourceTable=t,this.referencedTable=e,this.relationName=i,this.referencedTableName=e[Tt.Symbol.Name]}}$(Gf,Uy,"Relation");var zy;zy=xt;class Dw{constructor(t,e){this.table=t,this.config=e}}$(Dw,zy,"Relations");var jy,$y;const Wl=class Wl extends($y=Gf,jy=xt,$y){constructor(t,e,i,n){super(t,e,i==null?void 0:i.relationName),this.config=i,this.isNullable=n}withFieldName(t){const e=new Wl(this.sourceTable,this.referencedTable,this.config,this.isNullable);return e.fieldName=t,e}};$(Wl,jy,"One");let as=Wl;var Vy,Gy;const Hl=class Hl extends(Gy=Gf,Vy=xt,Gy){constructor(t,e,i){super(t,e,i==null?void 0:i.relationName),this.config=i}withFieldName(t){const e=new Hl(this.sourceTable,this.referencedTable,this.config);return e.fieldName=t,e}};$(Hl,Vy,"Many");let Vl=Hl;function tR(){return{and:Eh,between:HD,eq:Mw,exists:GD,gt:LD,gte:BD,ilike:QD,inArray:zD,isNull:$D,isNotNull:VD,like:YD,lt:kD,lte:UD,ne:DD,not:ND,notBetween:XD,notExists:WD,notLike:qD,notIlike:KD,notInArray:jD,or:RD,sql:H}}function eR(){return{sql:H,asc:ZD,desc:JD}}function rR(r,t){var s;Object.keys(r).length===1&&"default"in r&&!lt(r.default,Tt)&&(r=r.default);const e={},i={},n={};for(const[o,a]of Object.entries(r))if(lt(a,Tt)){const l=ia(a),u=i[l];e[l]=o,n[o]={tsName:o,dbName:a[Tt.Symbol.Name],schema:a[Tt.Symbol.Schema],columns:a[Tt.Symbol.Columns],relations:(u==null?void 0:u.relations)??{},primaryKey:(u==null?void 0:u.primaryKey)??[]};for(const h of Object.values(a[Tt.Symbol.Columns]))h.primary&&n[o].primaryKey.push(h);const c=(s=a[Tt.Symbol.ExtraConfigBuilder])==null?void 0:s.call(a,a[Tt.Symbol.ExtraConfigColumns]);if(c)for(const h of Object.values(c))lt(h,Fw)&&n[o].primaryKey.push(...h.columns)}else if(lt(a,Dw)){const l=ia(a.table),u=e[l],c=a.config(t(a.table));let h;for(const[p,f]of Object.entries(c))if(u){const y=n[u];y.relations[p]=f}else l in i||(i[l]={relations:{},primaryKey:h}),i[l].relations[p]=f}return{tables:n,tableNamesMap:e}}function iR(r){return function(e,i){return new as(r,e,i,(i==null?void 0:i.fields.reduce((n,s)=>n&&s.notNull,!0))??!1)}}function nR(r){return function(e,i){return new Vl(r,e,i)}}function sR(r,t,e){if(lt(e,as)&&e.config)return{fields:e.config.fields,references:e.config.references};const i=t[ia(e.referencedTable)];if(!i)throw new Error(`Table "${e.referencedTable[Tt.Symbol.Name]}" not found in schema`);const n=r[i];if(!n)throw new Error(`Table "${i}" not found in schema`);const s=e.sourceTable,o=t[ia(s)];if(!o)throw new Error(`Table "${s[Tt.Symbol.Name]}" not found in schema`);const a=[];for(const l of Object.values(n.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 "${i}"`):new Error(`There are multiple relations between "${i}" and "${e.sourceTable[Tt.Symbol.Name]}". Please specify relation name`);if(a[0]&<(a[0],as)&&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 oR(r){return{one:iR(r),many:nR(r)}}function Ch(r,t,e,i,n=s=>s){const s={};for(const[o,a]of i.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,as)?c&&Ch(r,r[a.relationTableTsKey],c,a.selection,n):c.map(h=>Ch(r,r[a.relationTableTsKey],h,a.selection,n))}else{const l=n(e[o]),u=a.field;let c;lt(u,Ke)?c=u:lt(u,Ft)?c=u.decoder:c=u.sql.decoder,s[a.tsKey]=l===null?null:c.mapFromDriverValue(l)}return s}var Wy;Wy=xt;const Xl=class Xl{constructor(t){$(this,"config");this.config={...t}}get(t,e){if(e==="_")return{...t._,selectedFields:new Proxy(t._.selectedFields,this)};if(e===He)return{...t[He],selectedFields:new Proxy(t[He].selectedFields,this)};if(typeof e=="symbol")return t[e];const n=(lt(t,Or)?t._.selectedFields:lt(t,Sn)?t[He].selectedFields:t)[e];if(lt(n,Ft.Aliased)){if(this.config.sqlAliasedBehavior==="sql"&&!n.isSelectionField)return n.sql;const s=n.clone();return s.isSelectionField=!0,s}if(lt(n,Ft)){if(this.config.sqlBehavior==="sql")return n;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(n,Ke)?this.config.alias?new Proxy(n,new na(new Proxy(n.table,new cu(this.config.alias,this.config.replaceOriginalName??!1)))):n:typeof n!="object"||n===null?n:new Proxy(n,new Xl(this.config))}};$(Xl,Wy,"SelectionProxyHandler");let Je=Xl;var Hy,Xy;class Ah extends(Xy=Tn,Hy=xt,Xy){constructor(e,i,n,s){super();$(this,"config");$(this,"authToken");$(this,"execute",e=>Pr.startActiveSpan("drizzle.operation",()=>this._prepare().execute(e,this.authToken)));this.session=i,this.dialect=n,this.config={table:e,withList:s}}where(e){return this.config.where=e,this}returning(e=this.config.table[Tt.Symbol.Columns]){return this.config.returningFields=e,this.config.returning=os(e),this}getSQL(){return this.dialect.buildDeleteQuery(this.config)}toSQL(){const{typings:e,...i}=this.dialect.sqlToQuery(this.getSQL());return i}_prepare(e){return Pr.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 Je({alias:qn(this.config.table),sqlAliasedBehavior:"alias",sqlBehavior:"error"})):void 0}$dynamic(){return this}}$(Ah,Hy,"PgDelete");function aR(r){return(r.replace(/['\u2019]/g,"").match(/[\da-z]+|[A-Z]+(?![a-z])|[A-Z][\da-z]+/g)??[]).map(e=>e.toLowerCase()).join("_")}function lR(r){return(r.replace(/['\u2019]/g,"").match(/[\da-z]+|[A-Z]+(?![a-z])|[A-Z][\da-z]+/g)??[]).reduce((e,i,n)=>{const s=n===0?i.toLowerCase():`${i[0].toUpperCase()}${i.slice(1)}`;return e+s},"")}function uR(r){return r}var Yy;Yy=xt;class Rw{constructor(t){$(this,"cache",{});$(this,"cachedTables",{});$(this,"convert");this.convert=t==="snake_case"?aR:t==="camelCase"?lR:uR}getColumnCasing(t){if(!t.keyAsName)return t.name;const e=t.table[Tt.Symbol.Schema]??"public",i=t.table[Tt.Symbol.OriginalName],n=`${e}.${i}.${t.name}`;return this.cache[n]||this.cacheTable(t.table),this.cache[n]}cacheTable(t){const e=t[Tt.Symbol.Schema]??"public",i=t[Tt.Symbol.OriginalName],n=`${e}.${i}`;if(!this.cachedTables[n]){for(const s of Object.values(t[Tt.Symbol.Columns])){const o=`${n}.${s.name}`;this.cache[o]=this.convert(s.name)}this.cachedTables[n]=!0}}clearCache(){this.cache={},this.cachedTables={}}}$(Rw,Yy,"CasingCache");var qy,Qy;class Wf extends(Qy=Sn,qy=xt,Qy){}$(Wf,qy,"PgViewBase");var Ky;Ky=xt;class Bo{constructor(t){$(this,"casing");this.casing=new Rw(t==null?void 0:t.casing)}async migrate(t,e,i){const n=typeof i=="string"?"__drizzle_migrations":i.migrationsTable??"__drizzle_migrations",s=typeof i=="string"?"drizzle":i.migrationsSchema??"drizzle",o=H` +]`}concat(...t){const e=this.schema,i=this.data.concat(t.flatMap(({data:n})=>n));return new $n(e,i.map(n=>new fr(e,n)))}slice(t,e){const i=this.schema;[t,e]=Y_({length:this.numRows},t,e);const n=Z_(this.data,this._offsets,t,e);return new $n(i,n.map(s=>new fr(i,s)))}getChild(t){return this.getChildAt(this.schema.fields.findIndex(e=>e.name===t))}getChildAt(t){if(t>-1&&ti.children[t]);if(e.length===0){const{type:i}=this.schema.fields[t],n=se({type:i,length:0,nullCount:0});e.push(n._changeLengthAndBackfillNullBitmap(this.numRows))}return new Me(e)}return null}setChild(t,e){var i;return this.setChildAt((i=this.schema.fields)===null||i===void 0?void 0:i.findIndex(n=>n.name===t),e)}setChildAt(t,e){let i=this.schema,n=[...this.batches];if(t>-1&&tthis.getChildAt(u));[s[t],a[t]]=[o,e],[i,n]=qu(i,a)}return new $n(i,n)}select(t){const e=this.schema.fields.reduce((i,n,s)=>i.set(n.name,s),new Map);return this.selectAt(t.map(i=>e.get(i)).filter(i=>i>-1))}selectAt(t){const e=this.schema.selectAt(t),i=this.batches.map(n=>n.selectAt(t));return new $n(e,i)}assign(t){const e=this.schema.fields,[i,n]=t.schema.fields.reduce((a,l,u)=>{const[c,h]=a,p=e.findIndex(f=>f.name===l.name);return~p?h[p]=u:c.push(u),a},[[],[]]),s=this.schema.assign(t.schema),o=[...e.map((a,l)=>[l,n[l]]).map(([a,l])=>l===void 0?this.getChildAt(a):t.getChildAt(l)),...i.map(a=>t.getChildAt(a))].filter(Boolean);return new $n(...qu(s,o))}};l0=Symbol.toStringTag;gn[l0]=(r=>(r.schema=null,r.batches=[],r._offsets=new Uint32Array([0]),r._nullCount=-1,r[Symbol.isConcatSpreadable]=!0,r.isValid=Ol(hf),r.get=Ol(mr.getVisitFn(L.Struct)),r.set=J_(Xr.getVisitFn(L.Struct)),r.indexOf=t0(Fl.getVisitFn(L.Struct)),"Table"))(gn.prototype);var u0;let fr=class Po{constructor(...t){switch(t.length){case 2:{if([this.schema]=t,!(this.schema instanceof Pe))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");if([,this.data=se({nullCount:0,type:new sr(this.schema.fields),children:this.schema.fields.map(e=>se({type:e.type,nullCount:0}))})]=t,!(this.data instanceof Se))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");[this.schema,this.data]=Op(this.schema,this.data.children);break}case 1:{const[e]=t,{fields:i,children:n,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]=Ce.new({name:u,type:e[u].type,nullable:!0}),l),{length:0,fields:new Array,children:new Array}),o=new Pe(i),a=se({type:new sr(i),length:s,children:n,nullCount:0});[this.schema,this.data]=Op(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=c0(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 mr.visit(this.data,t)}at(t){return this.get(lf(t,this.numRows))}set(t,e){return Xr.visit(this.data,t,e)}indexOf(t,e){return Fl.visit(this.data,t,e)}[Symbol.iterator](){return ff.visit(new Me([this.data]))}toArray(){return[...this]}concat(...t){return new gn(this.schema,[this,...t])}slice(t,e){const[i]=new Me([this.data]).slice(t,e).data;return new Po(this.schema,i)}getChild(t){var e;return this.getChildAt((e=this.schema.fields)===null||e===void 0?void 0:e.findIndex(i=>i.name===t))}getChildAt(t){return t>-1&&tn.name===t),e)}setChildAt(t,e){let i=this.schema,n=this.data;if(t>-1&&ta.name===s);~o&&(n[o]=this.data.children[o])}return new Po(e,se({type:i,length:this.numRows,children:n}))}selectAt(t){const e=this.schema.selectAt(t),i=t.map(s=>this.data.children[s]).filter(Boolean),n=se({type:new sr(e.fields),length:this.numRows,children:i});return new Po(e,n)}};u0=Symbol.toStringTag;fr[u0]=(r=>(r._nullCount=-1,r[Symbol.isConcatSpreadable]=!0,"RecordBatch"))(fr.prototype);function Op(r,t,e=t.reduce((i,n)=>Math.max(i,n.length),0)){var i;const n=[...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)&&(n[a]=l.clone({nullable:!0}),s[a]=(i=u==null?void 0:u._changeLengthAndBackfillNullBitmap(e))!==null&&i!==void 0?i:se({type:l.type,length:e,nullCount:e,nullBitmap:new Uint8Array(o)}))}return[r.assign(n),se({type:new sr(n),length:e,children:s})]}function c0(r,t,e=new Map){var i,n;if(((i=r==null?void 0:r.length)!==null&&i!==void 0?i:0)>0&&(r==null?void 0:r.length)===(t==null?void 0:t.length))for(let s=-1,o=r.length;++sse({type:n.type})),i=se({type:new sr(t.fields),nullCount:0,children:e});super(t,i)}}let en=class ai{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 ai).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsMessage(t,e){return t.setPosition(t.position()+me),(e||new ai).__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):ke.V1}headerType(){const t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readUint8(this.bb_pos+t):fe.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 i=this.bb.__offset(this.bb_pos,12);return i?(e||new We).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+i)+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,ke.V1)}static addHeaderType(t,e){t.addFieldInt8(1,e,fe.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 i=e.length-1;i>=0;i--)t.addOffset(e[i]);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,i,n,s,o){return ai.startMessage(t),ai.addVersion(t,e),ai.addHeaderType(t,i),ai.addHeader(t,n),ai.addBodyLength(t,s),ai.addCustomMetadata(t,o),ai.endMessage(t)}};class hO extends ie{visit(t,e){return t==null||e==null?void 0:super.visit(t,e)}visitNull(t,e){return _p.startNull(e),_p.endNull(e)}visitInt(t,e){return xr.startInt(e),xr.addBitWidth(e,t.bitWidth),xr.addIsSigned(e,t.isSigned),xr.endInt(e)}visitFloat(t,e){return mi.startFloatingPoint(e),mi.addPrecision(e,t.precision),mi.endFloatingPoint(e)}visitBinary(t,e){return pp.startBinary(e),pp.endBinary(e)}visitLargeBinary(t,e){return yp.startLargeBinary(e),yp.endLargeBinary(e)}visitBool(t,e){return mp.startBool(e),mp.endBool(e)}visitUtf8(t,e){return bp.startUtf8(e),bp.endUtf8(e)}visitLargeUtf8(t,e){return gp.startLargeUtf8(e),gp.endLargeUtf8(e)}visitDecimal(t,e){return Ss.startDecimal(e),Ss.addScale(e,t.scale),Ss.addPrecision(e,t.precision),Ss.addBitWidth(e,t.bitWidth),Ss.endDecimal(e)}visitDate(t,e){return Ua.startDate(e),Ua.addUnit(e,t.unit),Ua.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 i=t.timezone&&e.createString(t.timezone)||void 0;return jr.startTimestamp(e),jr.addUnit(e,t.unit),i!==void 0&&jr.addTimezone(e,i),jr.endTimestamp(e)}visitInterval(t,e){return yi.startInterval(e),yi.addUnit(e,t.unit),yi.endInterval(e)}visitDuration(t,e){return za.startDuration(e),za.addUnit(e,t.unit),za.endDuration(e)}visitList(t,e){return vp.startList(e),vp.endList(e)}visitStruct(t,e){return Yn.startStruct_(e),Yn.endStruct_(e)}visitUnion(t,e){hr.startTypeIdsVector(e,t.typeIds.length);const i=hr.createTypeIdsVector(e,t.typeIds);return hr.startUnion(e),hr.addMode(e,t.mode),hr.addTypeIds(e,i),hr.endUnion(e)}visitDictionary(t,e){const i=this.visit(t.indices,e);return $i.startDictionaryEncoding(e),$i.addId(e,BigInt(t.id)),$i.addIsOrdered(e,t.isOrdered),i!==void 0&&$i.addIndexType(e,i),$i.endDictionaryEncoding(e)}visitFixedSizeBinary(t,e){return ja.startFixedSizeBinary(e),ja.addByteWidth(e,t.byteWidth),ja.endFixedSizeBinary(e)}visitFixedSizeList(t,e){return $a.startFixedSizeList(e),$a.addListSize(e,t.listSize),$a.endFixedSizeList(e)}visitMap(t,e){return Va.startMap(e),Va.addKeysSorted(e,t.keysSorted),Va.endMap(e)}}const Qu=new hO;function fO(r,t=new Map){return new Pe(pO(r,t),Ha(r.metadata),t)}function h0(r){return new Fr(r.count,f0(r.columns),d0(r.columns))}function dO(r){return new Ti(h0(r.data),r.id,r.isDelta)}function pO(r,t){return(r.fields||[]).filter(Boolean).map(e=>Ce.fromJSON(e,t))}function Fp(r,t){return(r.children||[]).filter(Boolean).map(e=>Ce.fromJSON(e,t))}function f0(r){return(r||[]).reduce((t,e)=>[...t,new vn(e.count,mO(e.VALIDITY)),...f0(e.children)],[])}function d0(r,t=[]){for(let e=-1,i=(r||[]).length;++et+ +(e===0),0)}function yO(r,t){let e,i,n,s,o,a;return!t||!(s=r.dictionary)?(o=Mp(r,Fp(r,t)),n=new Ce(r.name,o,r.nullable,Ha(r.metadata))):t.has(e=s.id)?(i=(i=s.indexType)?Pp(i):new Qo,a=new Zs(t.get(e),i,e,s.isOrdered),n=new Ce(r.name,a,r.nullable,Ha(r.metadata))):(i=(i=s.indexType)?Pp(i):new Qo,t.set(e,o=Mp(r,Fp(r,t))),a=new Zs(o,i,e,s.isOrdered),n=new Ce(r.name,a,r.nullable,Ha(r.metadata))),n||null}function Ha(r=[]){return new Map(r.map(({key:t,value:e})=>[t,e]))}function Pp(r){return new is(r.isSigned,r.bitWidth)}function Mp(r,t){const e=r.type.name;switch(e){case"NONE":return new pn;case"null":return new pn;case"binary":return new hl;case"largebinary":return new fl;case"utf8":return new dl;case"largeutf8":return new pl;case"bool":return new ml;case"list":return new xl((t||[])[0]);case"struct":return new sr(t||[]);case"struct_":return new sr(t||[])}switch(e){case"int":{const i=r.type;return new is(i.isSigned,i.bitWidth)}case"floatingpoint":{const i=r.type;return new cl(tr[i.precision])}case"decimal":{const i=r.type;return new yl(i.scale,i.precision,i.bitWidth)}case"date":{const i=r.type;return new gl(Hr[i.unit])}case"time":{const i=r.type;return new vl(zt[i.unit],i.bitWidth)}case"timestamp":{const i=r.type;return new _l(zt[i.unit],i.timezone)}case"interval":{const i=r.type;return new bl(Si[i.unit])}case"duration":{const i=r.type;return new wl(zt[i.unit])}case"union":{const i=r.type,[n,...s]=(i.mode+"").toLowerCase(),o=n.toUpperCase()+s.join("");return new Sl(er[o],i.typeIds||[],t||[])}case"fixedsizebinary":{const i=r.type;return new Tl(i.byteWidth)}case"fixedsizelist":{const i=r.type;return new Il(i.listSize,(t||[])[0])}case"map":{const i=r.type;return new El((t||[])[0],i.keysSorted)}}throw new Error(`Unrecognized type: "${e}"`)}var gO=Cv,vO=Qs;class or{static fromJSON(t,e){const i=new or(0,ke.V5,e);return i._createHeader=_O(t,e),i}static decode(t){t=new vO(ae(t));const e=en.getRootAsMessage(t),i=e.bodyLength(),n=e.version(),s=e.headerType(),o=new or(i,n,s);return o._createHeader=bO(e,s),o}static encode(t){const e=new gO;let i=-1;return t.isSchema()?i=Pe.encode(e,t.header()):t.isRecordBatch()?i=Fr.encode(e,t.header()):t.isDictionaryBatch()&&(i=Ti.encode(e,t.header())),en.startMessage(e),en.addVersion(e,ke.V5),en.addHeader(e,i),en.addHeaderType(e,t.headerType),en.addBodyLength(e,BigInt(t.bodyLength)),en.finishMessageBuffer(e,en.endMessage(e)),e.asUint8Array()}static from(t,e=0){if(t instanceof Pe)return new or(0,ke.V5,fe.Schema,t);if(t instanceof Fr)return new or(e,ke.V5,fe.RecordBatch,t);if(t instanceof Ti)return new or(e,ke.V5,fe.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===fe.Schema}isRecordBatch(){return this.headerType===fe.RecordBatch}isDictionaryBatch(){return this.headerType===fe.DictionaryBatch}constructor(t,e,i,n){this._version=e,this._headerType=i,this.body=new Uint8Array(0),n&&(this._createHeader=()=>n),this._bodyLength=we(t)}}class Fr{get nodes(){return this._nodes}get length(){return this._length}get buffers(){return this._buffers}constructor(t,e,i){this._nodes=e,this._buffers=i,this._length=we(t)}}class Ti{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,i=!1){this._data=t,this._isDelta=i,this._id=we(e)}}class vi{constructor(t,e){this.offset=we(t),this.length=we(e)}}class vn{constructor(t,e){this.length=we(t),this.nullCount=we(e)}}function _O(r,t){return()=>{switch(t){case fe.Schema:return Pe.fromJSON(r);case fe.RecordBatch:return Fr.fromJSON(r);case fe.DictionaryBatch:return Ti.fromJSON(r)}throw new Error(`Unrecognized Message type: { name: ${fe[t]}, type: ${t} }`)}}function bO(r,t){return()=>{switch(t){case fe.Schema:return Pe.decode(r.header(new ui),new Map,r.version());case fe.RecordBatch:return Fr.decode(r.header(new Bi),r.version());case fe.DictionaryBatch:return Ti.decode(r.header(new ws),r.version())}throw new Error(`Unrecognized Message type: { name: ${fe[t]}, type: ${t} }`)}}Ce.encode=PO;Ce.decode=OO;Ce.fromJSON=yO;Pe.encode=FO;Pe.decode=wO;Pe.fromJSON=fO;Fr.encode=MO;Fr.decode=xO;Fr.fromJSON=h0;Ti.encode=DO;Ti.decode=SO;Ti.fromJSON=dO;vn.encode=RO;vn.decode=IO;vi.encode=NO;vi.decode=TO;function wO(r,t=new Map,e=ke.V5){const i=AO(r,t);return new Pe(i,Xa(r),t,e)}function xO(r,t=ke.V5){if(r.compression()!==null)throw new Error("Record batch compression not implemented");return new Fr(r.length(),EO(r),CO(r,t))}function SO(r,t=ke.V5){return new Ti(Fr.decode(r.data(),t),r.id(),r.isDelta())}function TO(r){return new vi(r.offset(),r.length())}function IO(r){return new vn(r.length(),r.nullCount())}function EO(r){const t=[];for(let e,i=-1,n=-1,s=r.nodesLength();++iCe.encode(r,s));ui.startFieldsVector(r,e.length);const i=ui.createFieldsVector(r,e),n=t.metadata&&t.metadata.size>0?ui.createCustomMetadataVector(r,[...t.metadata].map(([s,o])=>{const a=r.createString(`${s}`),l=r.createString(`${o}`);return We.startKeyValue(r),We.addKey(r,a),We.addValue(r,l),We.endKeyValue(r)})):-1;return ui.startSchema(r),ui.addFields(r,i),ui.addEndianness(r,LO?Ks.Little:Ks.Big),n!==-1&&ui.addCustomMetadata(r,n),ui.endSchema(r)}function PO(r,t){let e=-1,i=-1,n=-1;const s=t.type;let o=t.typeId;At.isDictionary(s)?(o=s.dictionary.typeId,n=Qu.visit(s,r),i=Qu.visit(s.dictionary,r)):i=Qu.visit(s,r);const a=(s.children||[]).map(c=>Ce.encode(r,c)),l=Nr.createChildrenVector(r,a),u=t.metadata&&t.metadata.size>0?Nr.createCustomMetadataVector(r,[...t.metadata].map(([c,h])=>{const p=r.createString(`${c}`),f=r.createString(`${h}`);return We.startKeyValue(r),We.addKey(r,p),We.addValue(r,f),We.endKeyValue(r)})):-1;return t.name&&(e=r.createString(t.name)),Nr.startField(r),Nr.addType(r,i),Nr.addTypeType(r,o),Nr.addChildren(r,l),Nr.addNullable(r,!!t.nullable),e!==-1&&Nr.addName(r,e),n!==-1&&Nr.addDictionary(r,n),u!==-1&&Nr.addCustomMetadata(r,u),Nr.endField(r)}function MO(r,t){const e=t.nodes||[],i=t.buffers||[];Bi.startNodesVector(r,e.length);for(const o of e.slice().reverse())vn.encode(r,o);const n=r.endVector();Bi.startBuffersVector(r,i.length);for(const o of i.slice().reverse())vi.encode(r,o);const s=r.endVector();return Bi.startRecordBatch(r),Bi.addLength(r,BigInt(t.length)),Bi.addNodes(r,n),Bi.addBuffers(r,s),Bi.endRecordBatch(r)}function DO(r,t){const e=Fr.encode(r,t.data);return ws.startDictionaryBatch(r),ws.addId(r,BigInt(t.id)),ws.addIsDelta(r,t.isDelta),ws.addData(r,e),ws.endDictionaryBatch(r)}function RO(r,t){return Fv.createFieldNode(r,BigInt(t.length),BigInt(t.nullCount))}function NO(r,t){return Ov.createBuffer(r,BigInt(t.offset),BigInt(t.length))}const LO=(()=>{const r=new ArrayBuffer(2);return new DataView(r).setInt16(0,256,!0),new Int16Array(r)[0]===256})(),_f=r=>`Expected ${fe[r]} Message in stream, but was null or length 0.`,bf=r=>`Header pointer of flatbuffer-encoded ${fe[r]} Message is null or length 0.`,p0=(r,t)=>`Expected to read ${r} metadata bytes, but only read ${t}.`,m0=(r,t)=>`Expected to read ${r} bytes for message body, but only read ${t}.`;class y0{constructor(t){this.source=t instanceof Pl?t:new Pl(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?De: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(_f(t));return e.value}readMessageBody(t){if(t<=0)return new Uint8Array(0);const e=ae(this.source.read(t));if(e.byteLength[...n,...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(_f(t));return e.value}readSchema(){const t=fe.Schema,e=this.readMessage(t),i=e==null?void 0:e.header();if(!e||!i)throw new Error(bf(t));return i}}const iu=4,ph="ARROW1",Zo=new Uint8Array(ph.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 kr.toDOMStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this})}toNodeStream(){return kr.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 Vr?t:rh(t)?VO(t):wv(t)?HO(t):rs(t)?Zt(this,void 0,void 0,function*(){return yield Vr.from(yield t)}):xv(t)||rf(t)||Sv(t)||no(t)?WO(new Js(t)):GO(new Pl(t))}static readAll(t){return t instanceof Vr?t.isSync()?Lp(t):Bp(t):rh(t)||ArrayBuffer.isView(t)||oa(t)||bv(t)?Lp(t):Bp(t)}}class Dl extends Vr{constructor(t){super(t),this._impl=t}readAll(){return[...this]}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return dr(this,arguments,function*(){yield Pt(yield*ts(bi(this[Symbol.iterator]())))})}}class Rl extends Vr{constructor(t){super(t),this._impl=t}readAll(){return Zt(this,void 0,void 0,function*(){var t,e,i,n;const s=new Array;try{for(var o=!0,a=bi(this),l;l=yield a.next(),t=l.done,!t;o=!0){n=l.value,o=!1;const u=n;s.push(u)}}catch(u){e={error:u}}finally{try{!o&&!t&&(i=a.return)&&(yield i.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 v0 extends Dl{constructor(t){super(t),this._impl=t}}class zO extends Rl{constructor(t){super(t),this._impl=t}}class _0{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 i=this._loadVectors(t,e,this.schema.fields),n=se({type:new sr(this.schema.fields),length:t.length,children:i});return new fr(this.schema,n)}_loadDictionaryBatch(t,e){const{id:i,isDelta:n}=t,{dictionaries:s,schema:o}=this,a=s.get(i),l=o.dictionaries.get(i),u=this._loadVectors(t.data,e,[l]);return(a&&n?a.concat(new Me(u)):new Me(u)).memoize()}_loadVectors(t,e,i){return new a0(e,t.nodes,t.buffers,this.dictionaries,this.schema.metadataVersion).visitMany(i)}}class Nl extends _0{constructor(t,e){super(e),this._reader=rh(t)?new kO(this._handle=t):new y0(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=w0(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):De}return(t){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.return(t):De}next(){if(this.closed)return De;let t;const{_reader:e}=this;for(;t=this._readNextMessageAndValidate();)if(t.isSchema())this.reset(t.header());else if(t.isRecordBatch()){this._recordBatchIndex++;const i=t.header(),n=e.readMessageBody(t.bodyLength);return{done:!1,value:this._loadRecordBatch(i,n)}}else if(t.isDictionaryBatch()){this._dictionaryIndex++;const i=t.header(),n=e.readMessageBody(t.bodyLength),s=this._loadDictionaryBatch(i,n);this.dictionaries.set(i.id,s)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new vf(this.schema)}):this.return()}_readNextMessageAndValidate(t){return this._reader.readMessage(t)}}class Ll extends _0{constructor(t,e){super(e),this._reader=new BO(this._handle=t)}isAsync(){return!0}isStream(){return!0}[Symbol.asyncIterator](){return this}cancel(){return Zt(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 Zt(this,void 0,void 0,function*(){return this.closed||(this.autoDestroy=w0(this,t),this.schema||(this.schema=yield this._reader.readSchema())||(yield this.cancel())),this})}throw(t){return Zt(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.throw(t):De})}return(t){return Zt(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.return(t):De})}next(){return Zt(this,void 0,void 0,function*(){if(this.closed)return De;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 i=t.header(),n=yield e.readMessageBody(t.bodyLength);return{done:!1,value:this._loadRecordBatch(i,n)}}else if(t.isDictionaryBatch()){this._dictionaryIndex++;const i=t.header(),n=yield e.readMessageBody(t.bodyLength),s=this._loadDictionaryBatch(i,n);this.dictionaries.set(i.id,s)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new vf(this.schema)}):yield this.return()})}_readNextMessageAndValidate(t){return Zt(this,void 0,void 0,function*(){return yield this._reader.readMessage(t)})}}class b0 extends Nl{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 Ap?t:new Ap(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 i=(e=this._footer)===null||e===void 0?void 0:e.getRecordBatch(t);if(i&&this._handle.seek(i.offset)){const n=this._reader.readMessage(fe.RecordBatch);if(n!=null&&n.isRecordBatch()){const s=n.header(),o=this._reader.readMessageBody(n.bodyLength);return this._loadRecordBatch(s,o)}}return null}_readDictionaryBatch(t){var e;const i=(e=this._footer)===null||e===void 0?void 0:e.getDictionaryBatch(t);if(i&&this._handle.seek(i.offset)){const n=this._reader.readMessage(fe.DictionaryBatch);if(n!=null&&n.isDictionaryBatch()){const s=n.header(),o=this._reader.readMessageBody(n.bodyLength),a=this._loadDictionaryBatch(s,o);this.dictionaries.set(s.id,a)}}}_readFooter(){const{_handle:t}=this,e=t.size-g0,i=t.readInt32(e),n=t.readAt(e-i,i);return Ko.decode(n)}_readNextMessageAndValidate(t){var e;if(this._footer||this.open(),this._footer&&this._recordBatchIndexsuper.open}});return Zt(this,void 0,void 0,function*(){if(!this.closed&&!this._footer){this.schema=(this._footer=yield this._readFooter()).schema;for(const i of this._footer.dictionaryBatches())i&&(yield this._readDictionaryBatch(this._dictionaryIndex++))}return yield e.open.call(this,t)})}readRecordBatch(t){return Zt(this,void 0,void 0,function*(){var e;if(this.closed)return null;this._footer||(yield this.open());const i=(e=this._footer)===null||e===void 0?void 0:e.getRecordBatch(t);if(i&&(yield this._handle.seek(i.offset))){const n=yield this._reader.readMessage(fe.RecordBatch);if(n!=null&&n.isRecordBatch()){const s=n.header(),o=yield this._reader.readMessageBody(n.bodyLength);return this._loadRecordBatch(s,o)}}return null})}_readDictionaryBatch(t){return Zt(this,void 0,void 0,function*(){var e;const i=(e=this._footer)===null||e===void 0?void 0:e.getDictionaryBatch(t);if(i&&(yield this._handle.seek(i.offset))){const n=yield this._reader.readMessage(fe.DictionaryBatch);if(n!=null&&n.isDictionaryBatch()){const s=n.header(),o=yield this._reader.readMessageBody(n.bodyLength),a=this._loadDictionaryBatch(s,o);this.dictionaries.set(s.id,a)}}})}_readFooter(){return Zt(this,void 0,void 0,function*(){const{_handle:t}=this;t._pending&&(yield t._pending);const e=t.size-g0,i=yield t.readInt32(e),n=yield t.readAt(e-i,i);return Ko.decode(n)})}_readNextMessageAndValidate(t){return Zt(this,void 0,void 0,function*(){if(this._footer||(yield this.open()),this._footer&&this._recordBatchIndex=4?wf(t)?new v0(new b0(r.read())):new Dl(new Nl(r)):new Dl(new Nl(function*(){}()))}function WO(r){return Zt(this,void 0,void 0,function*(){const t=yield r.peek(ca+7&-8);return t&&t.byteLength>=4?wf(t)?new v0(new b0(yield r.read())):new Rl(new Ll(r)):new Rl(new Ll(function(){return dr(this,arguments,function*(){})}()))})}function HO(r){return Zt(this,void 0,void 0,function*(){const{size:t}=yield r.stat(),e=new Ml(r,t);return t>=UO&&wf(yield e.readAt(0,ca+7&-8))?new zO(new jO(e)):new Rl(new Ll(e))})}class Ne extends ie{static assemble(...t){const e=n=>n.flatMap(s=>Array.isArray(s)?e(s):s instanceof fr?s.data.children:s.data),i=new Ne;return i.visitMany(e(t)),i}constructor(){super(),this._byteLength=0,this._nodes=[],this._buffers=[],this._bufferRegions=[]}visit(t){if(t instanceof Me)return this.visitMany(t.data),this;const{type:e}=t;if(!At.isDictionary(e)){const{length:i}=t;if(i>2147483647)throw new RangeError("Cannot write arrays larger than 2^31 - 1 in length");if(At.isUnion(e))this.nodes.push(new vn(i,0));else{const{nullCount:n}=t;At.isNull(e)||ti.call(this,n<=0?new Uint8Array(0):Cl(t.offset,i,t.nullBitmap)),this.nodes.push(new vn(i,n))}}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 ti(r){const t=r.byteLength+7&-8;return this.buffers.push(r),this.bufferRegions.push(new vi(this._byteLength,t)),this._byteLength+=t,this}function XO(r){var t;const{type:e,length:i,typeIds:n,valueOffsets:s}=r;if(ti.call(this,n),e.mode===er.Sparse)return mh.call(this,r);if(e.mode===er.Dense){if(r.offset<=0)return ti.call(this,s),mh.call(this,r);{const o=new Int32Array(i),a=Object.create(null),l=Object.create(null);for(let u,c,h=-1;++h{const h=e.typeIds[c],p=a[h],f=l[h];return u.slice(p,Math.min(i,f))}))}}return this}function YO(r){let t;return r.nullCount>=r.length?ti.call(this,new Uint8Array(0)):(t=r.values)instanceof Uint8Array?ti.call(this,Cl(r.offset,r.length,t)):ti.call(this,Al(r.values))}function Yi(r){return ti.call(this,r.values.subarray(0,r.length*r.stride))}function nu(r){const{length:t,values:e,valueOffsets:i}=r,n=we(i[0]),s=we(i[t]),o=Math.min(s-n,e.byteLength-n);return ti.call(this,Iv(-n,t+1,i)),ti.call(this,e.subarray(n,n+o)),this}function xf(r){const{length:t,valueOffsets:e}=r;if(e){const{[0]:i,[t]:n}=e;return ti.call(this,Iv(-i,t+1,e)),this.visit(r.children[0].slice(i,n-i))}return this.visit(r.children[0])}function mh(r){return this.visitMany(r.type.children.map((t,e)=>r.children[e]).filter(Boolean))[0]}Ne.prototype.visitBool=YO;Ne.prototype.visitInt=Yi;Ne.prototype.visitFloat=Yi;Ne.prototype.visitUtf8=nu;Ne.prototype.visitLargeUtf8=nu;Ne.prototype.visitBinary=nu;Ne.prototype.visitLargeBinary=nu;Ne.prototype.visitFixedSizeBinary=Yi;Ne.prototype.visitDate=Yi;Ne.prototype.visitTimestamp=Yi;Ne.prototype.visitTime=Yi;Ne.prototype.visitDecimal=Yi;Ne.prototype.visitList=xf;Ne.prototype.visitStruct=mh;Ne.prototype.visitUnion=XO;Ne.prototype.visitInterval=Yi;Ne.prototype.visitDuration=Yi;Ne.prototype.visitFixedSizeList=xf;Ne.prototype.visitMap=xf;class x0 extends df{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 Wa,this._schema=null,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._seenDictionaries=new Map,this._dictionaryDeltaOffsets=new Map,pr(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 rs(t)?t.then(e=>this.writeAll(e)):no(t)?Ef(this,t):If(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 Wa?this._sink=t:(this._sink=new Wa,t&&SC(t)?this.toDOMStream({type:"bytes"}).pipeTo(t):t&&TC(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||!dh(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 gn&&!(e=t.schema))return this.finish()&&void 0;if(t instanceof fr&&!(e=t.schema))return this.finish()&&void 0}else throw new Error("RecordBatchWriter is closed");if(e&&!dh(e,this._schema)){if(this._started&&this._autoDestroy)return this.close();this.reset(this._sink,e)}t instanceof fr?t instanceof vf||this._writeRecordBatch(t):t instanceof gn?this.writeAll(t.batches):oa(t)&&this.writeAll(t)}_writeMessage(t,e=8){const i=e-1,n=or.encode(t),s=n.byteLength,o=this._writeLegacyIpcFormat?4:8,a=s+o+i&~i,l=a-s-o;return t.headerType===fe.RecordBatch?this._recordBatchBlocks.push(new mn(a,t.bodyLength,this._position)):t.headerType===fe.DictionaryBatch&&this._dictionaryBlocks.push(new mn(a,t.bodyLength,this._position)),this._writeLegacyIpcFormat||this._write(Int32Array.of(-1)),this._write(Int32Array.of(a-o)),s>0&&this._write(n),this._writePadding(l)}_write(t){if(this._started){const e=ae(t);e&&e.byteLength>0&&(this._sink.write(e),this._position+=e.byteLength)}return this}_writeSchema(t){return this._writeMessage(or.from(t))}_writeFooter(t){return this._writeLegacyIpcFormat?this._write(Int32Array.of(0)):this._write(Int32Array.of(-1,0))}_writeMagic(){return this._write(Zo)}_writePadding(t){return t>0?this._write(new Uint8Array(t)):this}_writeRecordBatch(t){const{byteLength:e,nodes:i,bufferRegions:n,buffers:s}=Ne.assemble(t),o=new Fr(t.numRows,i,n),a=or.from(o,e);return this._writeDictionaries(t)._writeMessage(a)._writeBodyBuffers(s)}_writeDictionaryBatch(t,e,i=!1){const{byteLength:n,nodes:s,bufferRegions:o,buffers:a}=Ne.assemble(new Me([t])),l=new Fr(t.length,s,o),u=new Ti(l,e,i),c=or.from(u,n);return this._writeMessage(c)._writeBodyBuffers(a)}_writeBodyBuffers(t){let e,i,n;for(let s=-1,o=t.length;++s0&&(this._write(e),(n=(i+7&-8)-i)>0&&this._writePadding(n));return this}_writeDictionaries(t){var e,i;for(const[n,s]of t.dictionaries){const o=(e=s==null?void 0:s.data)!==null&&e!==void 0?e:[],a=this._seenDictionaries.get(n),l=(i=this._dictionaryDeltaOffsets.get(n))!==null&&i!==void 0?i:0;if(!a||a.data[0]!==o[0])for(const[u,c]of o.entries())this._writeDictionaryBatch(c,n,u>0);else if(li.writeAll(n)):no(t)?Ef(i,t):If(i,t)}}class Tf extends x0{static writeAll(t){const e=new Tf;return rs(t)?t.then(i=>e.writeAll(i)):no(t)?Ef(e,t):If(e,t)}constructor(){super(),this._autoDestroy=!0}_writeSchema(t){return this._writeMagic()._writePadding(2)}_writeDictionaryBatch(t,e,i=!1){if(!i&&this._seenDictionaries.has(e))throw new Error("The Arrow File format does not support replacement dictionaries. ");return super._writeDictionaryBatch(t,e,i)}_writeFooter(t){const e=Ko.encode(new Ko(t,ke.V5,this._recordBatchBlocks,this._dictionaryBlocks));return super._writeFooter(t)._write(e)._write(Int32Array.of(e.byteLength))._writeMagic()}}function If(r,t){let e=t;t instanceof gn&&(e=t.batches,r.reset(void 0,t.schema));for(const i of e)r.write(i);return r.finish()}function Ef(r,t){return Zt(this,void 0,void 0,function*(){var e,i,n,s,o,a,l;try{for(e=!0,i=bi(t);n=yield i.next(),s=n.done,!s;e=!0){l=n.value,e=!1;const u=l;r.write(u)}}catch(u){o={error:u}}finally{try{!e&&!s&&(a=i.return)&&(yield a.call(i))}finally{if(o)throw o.error}}return r.finish()})}function qO(r,t="stream"){return(t==="stream"?Sf:Tf).writeAll(r).toUint8Array(!0)}var QO=Object.create,S0=Object.defineProperty,KO=Object.getOwnPropertyDescriptor,ZO=Object.getOwnPropertyNames,JO=Object.getPrototypeOf,t2=Object.prototype.hasOwnProperty,e2=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports),r2=(r,t,e,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of ZO(t))!t2.call(r,n)&&n!==e&&S0(r,n,{get:()=>t[n],enumerable:!(i=KO(t,n))||i.enumerable});return r},i2=(r,t,e)=>(e=r!=null?QO(JO(r)):{},r2(!r||!r.__esModule?S0(e,"default",{value:r,enumerable:!0}):e,r)),n2=e2((r,t)=>{t.exports=Worker}),T0=(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))(T0||{}),s2=(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))(s2||{}),o2=(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))(o2||{}),a2=(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))(a2||{}),l2=(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))(l2||{}),u2=(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))(u2||{}),c2=class{log(r){}},I0=class{constructor(r=2){this.level=r}log(r){r.level>=this.level&&console.log(r)}},h2=(r=>(r[r.SUCCESS=0]="SUCCESS",r))(h2||{}),f2=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=Vr.from(t);return console.assert(e.isSync(),"Reader is not sync"),console.assert(e.isFile(),"Reader is not file"),new gn(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 i=new E0(this._bindings,this._conn,e),n=await Vr.from(i);return console.assert(n.isAsync()),console.assert(n.isStream()),n}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 d2(this._bindings,this._conn,t)}async insertArrowTable(r,t){let e=qO(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)}},E0=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}},d2=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=Vr.from(t);return console.assert(e.isSync()),console.assert(e.isFile()),new gn(e)}async send(...r){let t=await this.bindings.sendPrepared(this.connectionId,this.statementId,r),e=new E0(this.bindings,this.connectionId,t),i=await Vr.from(e);return console.assert(i.isAsync()),console.assert(i.isStream()),i}},p2=(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))(p2||{}),m2=(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))(m2||{}),ue=class{constructor(r,t){this.promiseResolver=()=>{},this.promiseRejecter=()=>{},this.type=r,this.data=t,this.promise=new Promise((e,i)=>{this.promiseResolver=e,this.promiseRejecter=i})}};function Ya(r){switch(r.typeId){case L.Binary:return{sqlType:"binary"};case L.Bool:return{sqlType:"bool"};case L.Date:return{sqlType:"date"};case L.DateDay:return{sqlType:"date32[d]"};case L.DateMillisecond:return{sqlType:"date64[ms]"};case L.Decimal:{let t=r;return{sqlType:"decimal",precision:t.precision,scale:t.scale}}case L.Float:return{sqlType:"float"};case L.Float16:return{sqlType:"float16"};case L.Float32:return{sqlType:"float32"};case L.Float64:return{sqlType:"float64"};case L.Int:return{sqlType:"int32"};case L.Int16:return{sqlType:"int16"};case L.Int32:return{sqlType:"int32"};case L.Int64:return{sqlType:"int64"};case L.Uint16:return{sqlType:"uint16"};case L.Uint32:return{sqlType:"uint32"};case L.Uint64:return{sqlType:"uint64"};case L.Uint8:return{sqlType:"uint8"};case L.IntervalDayTime:return{sqlType:"interval[dt]"};case L.IntervalYearMonth:return{sqlType:"interval[m]"};case L.List:return{sqlType:"list",valueType:Ya(r.valueType)};case L.FixedSizeBinary:return{sqlType:"fixedsizebinary",byteWidth:r.byteWidth};case L.Null:return{sqlType:"null"};case L.Utf8:return{sqlType:"utf8"};case L.Struct:return{sqlType:"struct",fields:r.children.map(t=>yh(t.name,t.type))};case L.Map:{let t=r;return{sqlType:"map",keyType:Ya(t.keyType),valueType:Ya(t.valueType)}}case L.Time:return{sqlType:"time[s]"};case L.TimeMicrosecond:return{sqlType:"time[us]"};case L.TimeMillisecond:return{sqlType:"time[ms]"};case L.TimeNanosecond:return{sqlType:"time[ns]"};case L.TimeSecond:return{sqlType:"time[s]"};case L.Timestamp:return{sqlType:"timestamp",timezone:r.timezone||void 0};case L.TimestampSecond:return{sqlType:"timestamp[s]",timezone:r.timezone||void 0};case L.TimestampMicrosecond:return{sqlType:"timestamp[us]",timezone:r.timezone||void 0};case L.TimestampNanosecond:return{sqlType:"timestamp[ns]",timezone:r.timezone||void 0};case L.TimestampMillisecond:return{sqlType:"timestamp[ms]",timezone:r.timezone||void 0}}throw new Error("unsupported arrow type: ".concat(r.toString()))}function yh(r,t){let e=Ya(t);return e.name=r,e}var y2=new TextEncoder,g2=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 n of this._onInstantiationProgress)n(e.data);return}}let i=this._pendingRequests.get(e.requestId);if(!i){console.warn("unassociated response: [".concat(e.requestId,", ").concat(e.type.toString(),"]"));return}if(this._pendingRequests.delete(e.requestId),e.type=="ERROR"){let n=new Error(e.data.message);n.name=e.data.name,(t=Object.getOwnPropertyDescriptor(n,"stack"))!=null&&t.writable&&(n.stack=e.data.stack),i.promiseRejecter(n);return}switch(i.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"){i.promiseResolver(e.data);return}break;case"INSTANTIATE":if(this._onInstantiationProgress=[],e.type=="OK"){i.promiseResolver(e.data);return}break;case"GLOB_FILE_INFOS":if(e.type=="FILE_INFOS"){i.promiseResolver(e.data);return}break;case"GET_VERSION":if(e.type=="VERSION_STRING"){i.promiseResolver(e.data);return}break;case"GET_FEATURE_FLAGS":if(e.type=="FEATURE_FLAGS"){i.promiseResolver(e.data);return}break;case"GET_TABLE_NAMES":if(e.type=="TABLE_NAMES"){i.promiseResolver(e.data);return}break;case"TOKENIZE":if(e.type=="SCRIPT_TOKENS"){i.promiseResolver(e.data);return}break;case"COPY_FILE_TO_BUFFER":if(e.type=="FILE_BUFFER"){i.promiseResolver(e.data);return}break;case"EXPORT_FILE_STATISTICS":if(e.type=="FILE_STATISTICS"){i.promiseResolver(e.data);return}break;case"CONNECT":if(e.type=="CONNECTION_INFO"){i.promiseResolver(e.data);return}break;case"RUN_PREPARED":case"RUN_QUERY":if(e.type=="QUERY_RESULT"){i.promiseResolver(e.data);return}break;case"SEND_PREPARED":if(e.type=="QUERY_RESULT_HEADER"){i.promiseResolver(e.data);return}break;case"START_PENDING_QUERY":if(e.type=="QUERY_RESULT_HEADER_OR_NULL"){i.promiseResolver(e.data);return}break;case"POLL_PENDING_QUERY":if(e.type=="QUERY_RESULT_HEADER_OR_NULL"){i.promiseResolver(e.data);return}break;case"CANCEL_PENDING_QUERY":if(this._onInstantiationProgress=[],e.type=="SUCCESS"){i.promiseResolver(e.data);return}break;case"FETCH_QUERY_RESULTS":if(e.type=="QUERY_RESULT_CHUNK"){i.promiseResolver(e.data);return}break;case"CREATE_PREPARED":if(e.type=="PREPARED_STATEMENT_ID"){i.promiseResolver(e.data);return}break}i.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 ue("RESET",null);return await this.postTask(r)}async ping(){let r=new ue("PING",null);await this.postTask(r)}async dropFile(r){let t=new ue("DROP_FILE",r);return await this.postTask(t)}async dropFiles(){let r=new ue("DROP_FILES",null);return await this.postTask(r)}async flushFiles(){let r=new ue("FLUSH_FILES",null);return await this.postTask(r)}async instantiate(r,t=null,e=i=>{}){this._onInstantiationProgress.push(e);let i=new ue("INSTANTIATE",[r,t]);return await this.postTask(i)}async getVersion(){let r=new ue("GET_VERSION",null);return await this.postTask(r)}async getFeatureFlags(){let r=new ue("GET_FEATURE_FLAGS",null);return await this.postTask(r)}async open(r){let t=new ue("OPEN",r);await this.postTask(t)}async tokenize(r){let t=new ue("TOKENIZE",r);return await this.postTask(t)}async connectInternal(){let r=new ue("CONNECT",null);return await this.postTask(r)}async connect(){let r=await this.connectInternal();return new f2(this,r)}async disconnect(r){let t=new ue("DISCONNECT",r);await this.postTask(t)}async runQuery(r,t){let e=new ue("RUN_QUERY",[r,t]);return await this.postTask(e)}async startPendingQuery(r,t,e=!1){let i=new ue("START_PENDING_QUERY",[r,t,e]);return await this.postTask(i)}async pollPendingQuery(r){let t=new ue("POLL_PENDING_QUERY",r);return await this.postTask(t)}async cancelPendingQuery(r){let t=new ue("CANCEL_PENDING_QUERY",r);return await this.postTask(t)}async fetchQueryResults(r){let t=new ue("FETCH_QUERY_RESULTS",r);return await this.postTask(t)}async getTableNames(r,t){let e=new ue("GET_TABLE_NAMES",[r,t]);return await this.postTask(e)}async createPrepared(r,t){let e=new ue("CREATE_PREPARED",[r,t]);return await this.postTask(e)}async closePrepared(r,t){let e=new ue("CLOSE_PREPARED",[r,t]);await this.postTask(e)}async runPrepared(r,t,e){let i=new ue("RUN_PREPARED",[r,t,e]);return await this.postTask(i)}async sendPrepared(r,t,e){let i=new ue("SEND_PREPARED",[r,t,e]);return await this.postTask(i)}async globFiles(r){let t=new ue("GLOB_FILE_INFOS",r);return await this.postTask(t)}async registerFileText(r,t){let e=y2.encode(t);await this.registerFileBuffer(r,e)}async registerFileURL(r,t,e,i){t===void 0&&(t=r);let n=new ue("REGISTER_FILE_URL",[r,t,e,i]);await this.postTask(n)}async registerEmptyFileBuffer(r){}async registerFileBuffer(r,t){let e=new ue("REGISTER_FILE_BUFFER",[r,t]);await this.postTask(e,[t.buffer])}async registerFileHandle(r,t,e,i){let n=new ue("REGISTER_FILE_HANDLE",[r,t,e,i]);await this.postTask(n,[])}async registerOPFSFileName(r){let t=new ue("REGISTER_OPFS_FILE_NAME",[r]);await this.postTask(t,[])}async collectFileStatistics(r,t){let e=new ue("COLLECT_FILE_STATISTICS",[r,t]);await this.postTask(e,[])}async exportFileStatistics(r){let t=new ue("EXPORT_FILE_STATISTICS",r);return await this.postTask(t,[])}async copyFileToBuffer(r){let t=new ue("COPY_FILE_TO_BUFFER",r);return await this.postTask(t)}async copyFileToPath(r,t){let e=new ue("COPY_FILE_TO_PATH",[r,t]);await this.postTask(e)}async insertArrowFromIPCStream(r,t,e){if(t.length==0)return;let i=new ue("INSERT_ARROW_FROM_IPC_STREAM",[r,t,e]);await this.postTask(i,[t.buffer])}async insertCSVFromPath(r,t,e){if(e.columns!==void 0){let n=[];for(let s in e.columns){let o=e.columns[s];n.push(yh(s,o))}e.columnsFlat=n,delete e.columns}let i=new ue("IMPORT_CSV_FROM_PATH",[r,t,e]);await this.postTask(i)}async insertJSONFromPath(r,t,e){if(e.columns!==void 0){let n=[];for(let s in e.columns){let o=e.columns[s];n.push(yh(s,o))}e.columnsFlat=n,delete e.columns}let i=new ue("IMPORT_JSON_FROM_PATH",[r,t,e]);await this.postTask(i)}};function v2(){let r=new TextDecoder;return t=>(typeof SharedArrayBuffer<"u"&&t.buffer instanceof SharedArrayBuffer&&(t=new Uint8Array(t)),r.decode(t))}v2();var _2=(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))(_2||{}),b2=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])),w2=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])),x2=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])),S2=()=>(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])),T2={version:"1.29.1-dev68.0"},Cf=T2.version.split(".");Cf[0];Cf[1];Cf[2];var I2=()=>typeof navigator>"u",Ku=null,Zu=null,Ju=null,tc=null,ec=null;async function E2(){return Ku==null&&(Ku=typeof BigInt64Array<"u"),Zu==null&&(Zu=await w2()),Ju==null&&(Ju=await S2()),tc==null&&(tc=await x2()),ec==null&&(ec=await b2()),{bigInt64Array:Ku,crossOriginIsolated:I2()||globalThis.crossOriginIsolated||!1,wasmExceptions:Zu,wasmSIMD:tc,wasmThreads:Ju,wasmBulkMemory:ec}}async function kp(r){let t=await E2();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}}i2(n2());const rc={},Mo={};function Lo(r,t){try{const i=(rc[r]||(rc[r]=new Intl.DateTimeFormat("en-GB",{timeZone:r,hour:"numeric",timeZoneName:"longOffset"}).format))(t).split("GMT")[1]||"";return i in Mo?Mo[i]:Up(i,i.split(":"))}catch{if(r in Mo)return Mo[r];const e=r==null?void 0:r.match(C2);return e?Up(r,e.slice(1)):NaN}}const C2=/([+-]\d\d):?(\d\d)?/;function Up(r,t){const e=+t[0],i=+(t[1]||0);return Mo[r]=e>0?e*60+i:e*60-i}class Er extends Date{constructor(...t){super(),t.length>1&&typeof t[t.length-1]=="string"&&(this.timeZone=t.pop()),this.internal=new Date,isNaN(Lo(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)),C0(this),gh(this)):this.setTime(Date.now())}static tz(t,...e){return e.length?new Er(...e,t):new Er(Date.now(),t)}withTimeZone(t){return new Er(+this,t)}getTimezoneOffset(){return-Lo(this.timeZone,this)}setTime(t){return Date.prototype.setTime.apply(this,arguments),gh(this),+this}[Symbol.for("constructDateFrom")](t){return new Er(+new Date(t),this.timeZone)}}const zp=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(r=>{if(!zp.test(r))return;const t=r.replace(zp,"$1UTC");Er.prototype[t]&&(r.startsWith("get")?Er.prototype[r]=function(){return this.internal[t]()}:(Er.prototype[r]=function(){return Date.prototype[t].apply(this.internal,arguments),A2(this),+this},Er.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),gh(this),+this}))});function gh(r){r.internal.setTime(+r),r.internal.setUTCMinutes(r.internal.getUTCMinutes()-r.getTimezoneOffset())}function A2(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()),C0(r)}function C0(r){const t=Lo(r.timeZone,r),e=new Date(+r);e.setUTCHours(e.getUTCHours()-1);const i=-new Date(+r).getTimezoneOffset(),n=-new Date(+e).getTimezoneOffset(),s=i-n,o=Date.prototype.getHours.apply(r)!==r.internal.getUTCHours();s&&o&&r.internal.setUTCMinutes(r.internal.getUTCMinutes()+s);const a=i-t;a&&Date.prototype.setUTCMinutes.call(r,Date.prototype.getUTCMinutes.call(r)+a);const l=Lo(r.timeZone,r),c=-new Date(+r).getTimezoneOffset()-l,h=l!==t,p=c-a;if(h&&p){Date.prototype.setUTCMinutes.call(r,Date.prototype.getUTCMinutes.call(r)+p);const f=Lo(r.timeZone,r),y=l-f;y&&(r.internal.setUTCMinutes(r.internal.getUTCMinutes()+y),Date.prototype.setUTCMinutes.call(r,Date.prototype.getUTCMinutes.call(r)+y))}}const O2=new TextDecoder("utf-8"),F2=r=>O2.decode(r),P2=new TextEncoder,A0=r=>P2.encode(r),hi=r=>typeof r=="function",ha=r=>r!=null&&Object(r)===r,M2=r=>ha(r)&&hi(r.then),O0=r=>ha(r)&&hi(r[Symbol.iterator]),D2=r=>ha(r)&&hi(r[Symbol.asyncIterator]),R2=r=>ha(r)&&"done"in r&&"value"in r,N2=r=>ha(r)&&hi(r.clear)&&hi(r.bytes)&&hi(r.position)&&hi(r.setPosition)&&hi(r.capacity)&&hi(r.getBufferIdentifier)&&hi(r.createLong),Af=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:ArrayBuffer;function L2(r){const t=r[0]?[r[0]]:[];let e,i,n,s;for(let o,a,l=0,u=0,c=r.length;++lc+h.byteLength,0);let n,s,o,a=0,l=-1;const u=Math.min(t||Number.POSITIVE_INFINITY,i);for(const c=e.length;++lrr(Int8Array,r),U2=r=>rr(Int16Array,r),z2=r=>rr(Int32Array,r),j2=r=>rr(BigInt64Array,r),$2=r=>rr(Uint8Array,r),V2=r=>rr(Uint16Array,r),G2=r=>rr(Uint32Array,r),W2=r=>rr(BigUint64Array,r),H2=r=>rr(Float32Array,r),X2=r=>rr(Float64Array,r),Y2=r=>rr(Uint8ClampedArray,r),_h=r=>(r.next(),r);function*Oi(r,t){const e=function*(n){yield n},i=typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof Af?e(t):O0(t)?t:e(t);return yield*_h(function*(n){let s=null;do s=n.next(yield rr(r,s));while(!s.done)}(i[Symbol.iterator]())),new r}const q2=r=>Oi(Int8Array,r),Q2=r=>Oi(Int16Array,r),K2=r=>Oi(Int32Array,r),Z2=r=>Oi(Uint8Array,r),J2=r=>Oi(Uint16Array,r),tF=r=>Oi(Uint32Array,r),eF=r=>Oi(Float32Array,r),rF=r=>Oi(Float64Array,r),iF=r=>Oi(Uint8ClampedArray,r);function ii(r,t){return dr(this,arguments,function*(){if(M2(t))return yield Pt(yield Pt(yield*ts(bi(ii(r,yield Pt(t))))));const i=function(o){return dr(this,arguments,function*(){yield yield Pt(yield Pt(o))})},n=function(o){return dr(this,arguments,function*(){yield Pt(yield*ts(bi(_h(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 Af?i(t):O0(t)?n(t):D2(t)?t:i(t);return yield Pt(yield*ts(bi(_h(function(o){return dr(this,arguments,function*(){let a=null;do a=yield Pt(o.next(yield yield Pt(rr(r,a))));while(!a.done)})}(s[Symbol.asyncIterator]()))))),yield Pt(new r)})}const nF=r=>ii(Int8Array,r),sF=r=>ii(Int16Array,r),oF=r=>ii(Int32Array,r),aF=r=>ii(Uint8Array,r),lF=r=>ii(Uint16Array,r),uF=r=>ii(Uint32Array,r),cF=r=>ii(Float32Array,r),hF=r=>ii(Float64Array,r),fF=r=>ii(Uint8ClampedArray,r);function dF(r,t,e){if(r!==0){e=e.slice(0,t);for(let i=-1,n=e.length;++i0)do if(r[e]!==t[e])return!1;while(++eeo(t))}]`:`[${r}]`:ArrayBuffer.isView(r)?`[${r}]`:JSON.stringify(r,(t,e)=>typeof e=="bigint"?`${e}`:e)}const yF=Object.freeze(Object.defineProperty({__proto__:null,valueToString:eo},Symbol.toStringTag,{value:"Module"}));function ar(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 P0(r,t){return ar(r/t)+ar(r%t)/ar(t)}const M0=Symbol.for("isArrowBigNum");function ni(r,...t){return t.length===0?Object.setPrototypeOf(rr(this.TypedArray,r),this.constructor.prototype):Object.setPrototypeOf(new this.TypedArray(r,...t),this.constructor.prototype)}ni.prototype[M0]=!0;ni.prototype.toJSON=function(){return`"${ro(this)}"`};ni.prototype.valueOf=function(r){return Of(this,r)};ni.prototype.toString=function(){return ro(this)};ni.prototype[Symbol.toPrimitive]=function(r="default"){switch(r){case"number":return Of(this);case"string":return ro(this);case"default":return D0(this)}return ro(this)};function Gs(...r){return ni.apply(this,r)}function Ws(...r){return ni.apply(this,r)}function Jo(...r){return ni.apply(this,r)}Object.setPrototypeOf(Gs.prototype,Object.create(Int32Array.prototype));Object.setPrototypeOf(Ws.prototype,Object.create(Uint32Array.prototype));Object.setPrototypeOf(Jo.prototype,Object.create(Uint32Array.prototype));Object.assign(Gs.prototype,ni.prototype,{constructor:Gs,signed:!0,TypedArray:Int32Array,BigIntArray:BigInt64Array});Object.assign(Ws.prototype,ni.prototype,{constructor:Ws,signed:!1,TypedArray:Uint32Array,BigIntArray:BigUint64Array});Object.assign(Jo.prototype,ni.prototype,{constructor:Jo,signed:!0,TypedArray:Uint32Array,BigIntArray:BigUint64Array});const gF=BigInt(4294967296)*BigInt(4294967296),vF=gF-BigInt(1);function Of(r,t){const{buffer:e,byteOffset:i,byteLength:n,signed:s}=r,o=new BigUint64Array(e,i,n/8),a=s&&o.at(-1)&BigInt(1)<=0)return ic(r);t=t.slice();let i=1;for(let s=0;s(r.children=null,r.ArrayType=Array,r.OffsetArrayType=Int32Array,r[Symbol.toStringTag]="DataType"))(Et.prototype);class jp extends Et{constructor(){super(W.Null)}toString(){return"Null"}}N0=Symbol.toStringTag;jp[N0]=(r=>r[Symbol.toStringTag]="Null")(jp.prototype);class $p extends Et{constructor(t,e){super(W.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}`}}L0=Symbol.toStringTag;$p[L0]=(r=>(r.isSigned=null,r.bitWidth=null,r[Symbol.toStringTag]="Int"))($p.prototype);class Vp extends Et{constructor(t){super(W.Float),this.precision=t}get ArrayType(){switch(this.precision){case Cr.HALF:return Uint16Array;case Cr.SINGLE:return Float32Array;case Cr.DOUBLE:return Float64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`Float${this.precision<<5||16}`}}B0=Symbol.toStringTag;Vp[B0]=(r=>(r.precision=null,r[Symbol.toStringTag]="Float"))(Vp.prototype);class Gp extends Et{constructor(){super(W.Binary)}toString(){return"Binary"}}k0=Symbol.toStringTag;Gp[k0]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Binary"))(Gp.prototype);class Wp extends Et{constructor(){super(W.LargeBinary)}toString(){return"LargeBinary"}}U0=Symbol.toStringTag;Wp[U0]=(r=>(r.ArrayType=Uint8Array,r.OffsetArrayType=BigInt64Array,r[Symbol.toStringTag]="LargeBinary"))(Wp.prototype);class Hp extends Et{constructor(){super(W.Utf8)}toString(){return"Utf8"}}z0=Symbol.toStringTag;Hp[z0]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Utf8"))(Hp.prototype);class Xp extends Et{constructor(){super(W.LargeUtf8)}toString(){return"LargeUtf8"}}j0=Symbol.toStringTag;Xp[j0]=(r=>(r.ArrayType=Uint8Array,r.OffsetArrayType=BigInt64Array,r[Symbol.toStringTag]="LargeUtf8"))(Xp.prototype);class Yp extends Et{constructor(){super(W.Bool)}toString(){return"Bool"}}$0=Symbol.toStringTag;Yp[$0]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Bool"))(Yp.prototype);class qp extends Et{constructor(t,e,i=128){super(W.Decimal),this.scale=t,this.precision=e,this.bitWidth=i}toString(){return`Decimal[${this.precision}e${this.scale>0?"+":""}${this.scale}]`}}V0=Symbol.toStringTag;qp[V0]=(r=>(r.scale=null,r.precision=null,r.ArrayType=Uint32Array,r[Symbol.toStringTag]="Decimal"))(qp.prototype);class Qp extends Et{constructor(t){super(W.Date),this.unit=t}toString(){return`Date${(this.unit+1)*32}<${_n[this.unit]}>`}get ArrayType(){return this.unit===_n.DAY?Int32Array:BigInt64Array}}G0=Symbol.toStringTag;Qp[G0]=(r=>(r.unit=null,r[Symbol.toStringTag]="Date"))(Qp.prototype);class Kp extends Et{constructor(t,e){super(W.Time),this.unit=t,this.bitWidth=e}toString(){return`Time${this.bitWidth}<${Jt[this.unit]}>`}get ArrayType(){switch(this.bitWidth){case 32:return Int32Array;case 64:return BigInt64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}}W0=Symbol.toStringTag;Kp[W0]=(r=>(r.unit=null,r.bitWidth=null,r[Symbol.toStringTag]="Time"))(Kp.prototype);class Zp extends Et{constructor(t,e){super(W.Timestamp),this.unit=t,this.timezone=e}toString(){return`Timestamp<${Jt[this.unit]}${this.timezone?`, ${this.timezone}`:""}>`}}H0=Symbol.toStringTag;Zp[H0]=(r=>(r.unit=null,r.timezone=null,r.ArrayType=BigInt64Array,r[Symbol.toStringTag]="Timestamp"))(Zp.prototype);class Jp extends Et{constructor(t){super(W.Interval),this.unit=t}toString(){return`Interval<${ns[this.unit]}>`}}X0=Symbol.toStringTag;Jp[X0]=(r=>(r.unit=null,r.ArrayType=Int32Array,r[Symbol.toStringTag]="Interval"))(Jp.prototype);class tm extends Et{constructor(t){super(W.Duration),this.unit=t}toString(){return`Duration<${Jt[this.unit]}>`}}Y0=Symbol.toStringTag;tm[Y0]=(r=>(r.unit=null,r.ArrayType=BigInt64Array,r[Symbol.toStringTag]="Duration"))(tm.prototype);class em extends Et{constructor(t){super(W.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}}q0=Symbol.toStringTag;em[q0]=(r=>(r.children=null,r[Symbol.toStringTag]="List"))(em.prototype);class bh extends Et{constructor(t){super(W.Struct),this.children=t}toString(){return`Struct<{${this.children.map(t=>`${t.name}:${t.type}`).join(", ")}}>`}}Q0=Symbol.toStringTag;bh[Q0]=(r=>(r.children=null,r[Symbol.toStringTag]="Struct"))(bh.prototype);class rm extends Et{constructor(t,e,i){super(W.Union),this.mode=t,this.children=i,this.typeIds=e=Int32Array.from(e),this.typeIdToChildIndex=e.reduce((n,s,o)=>(n[s]=o)&&n||n,Object.create(null))}toString(){return`${this[Symbol.toStringTag]}<${this.children.map(t=>`${t.type}`).join(" | ")}>`}}K0=Symbol.toStringTag;rm[K0]=(r=>(r.mode=null,r.typeIds=null,r.children=null,r.typeIdToChildIndex=null,r.ArrayType=Int8Array,r[Symbol.toStringTag]="Union"))(rm.prototype);class im extends Et{constructor(t){super(W.FixedSizeBinary),this.byteWidth=t}toString(){return`FixedSizeBinary[${this.byteWidth}]`}}Z0=Symbol.toStringTag;im[Z0]=(r=>(r.byteWidth=null,r.ArrayType=Uint8Array,r[Symbol.toStringTag]="FixedSizeBinary"))(im.prototype);class nm extends Et{constructor(t,e){super(W.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}>`}}J0=Symbol.toStringTag;nm[J0]=(r=>(r.children=null,r.listSize=null,r[Symbol.toStringTag]="FixedSizeList"))(nm.prototype);class sm extends Et{constructor(t,e=!1){var i,n,s;if(super(W.Map),this.children=[t],this.keysSorted=e,t&&(t.name="entries",!((i=t==null?void 0:t.type)===null||i===void 0)&&i.children)){const o=(n=t==null?void 0:t.type)===null||n===void 0?void 0:n.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(", ")}}>`}}tb=Symbol.toStringTag;sm[tb]=(r=>(r.children=null,r.keysSorted=null,r[Symbol.toStringTag]="Map_"))(sm.prototype);const bF=(r=>()=>++r)(-1);class om extends Et{constructor(t,e,i,n){super(W.Dictionary),this.indices=e,this.dictionary=t,this.isOrdered=n||!1,this.id=i==null?bF():ar(i)}get children(){return this.dictionary.children}get valueType(){return this.dictionary}get ArrayType(){return this.dictionary.ArrayType}toString(){return`Dictionary<${this.indices}, ${this.dictionary}>`}}eb=Symbol.toStringTag;om[eb]=(r=>(r.id=null,r.indices=null,r.isOrdered=null,r.dictionary=null,r[Symbol.toStringTag]="Dictionary"))(om.prototype);function rb(r){const t=r;switch(r.typeId){case W.Decimal:return r.bitWidth/32;case W.Interval:return 1+t.unit;case W.FixedSizeList:return t.listSize;case W.FixedSizeBinary:return t.byteWidth;default:return 1}}class le{visitMany(t,...e){return t.map((i,n)=>this.visit(i,...e.map(s=>s[n])))}visit(...t){return this.getVisitFn(t[0],!1).apply(this,t)}getVisitFn(t,e=!0){return wF(this,t,e)}getVisitFnByTypeId(t,e=!0){return Ps(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 wF(r,t,e=!0){return typeof t=="number"?Ps(r,t,e):typeof t=="string"&&t in W?Ps(r,W[t],e):t&&t instanceof Et?Ps(r,am(t),e):t!=null&&t.type&&t.type instanceof Et?Ps(r,am(t.type),e):Ps(r,W.NONE,e)}function Ps(r,t,e=!0){let i=null;switch(t){case W.Null:i=r.visitNull;break;case W.Bool:i=r.visitBool;break;case W.Int:i=r.visitInt;break;case W.Int8:i=r.visitInt8||r.visitInt;break;case W.Int16:i=r.visitInt16||r.visitInt;break;case W.Int32:i=r.visitInt32||r.visitInt;break;case W.Int64:i=r.visitInt64||r.visitInt;break;case W.Uint8:i=r.visitUint8||r.visitInt;break;case W.Uint16:i=r.visitUint16||r.visitInt;break;case W.Uint32:i=r.visitUint32||r.visitInt;break;case W.Uint64:i=r.visitUint64||r.visitInt;break;case W.Float:i=r.visitFloat;break;case W.Float16:i=r.visitFloat16||r.visitFloat;break;case W.Float32:i=r.visitFloat32||r.visitFloat;break;case W.Float64:i=r.visitFloat64||r.visitFloat;break;case W.Utf8:i=r.visitUtf8;break;case W.LargeUtf8:i=r.visitLargeUtf8;break;case W.Binary:i=r.visitBinary;break;case W.LargeBinary:i=r.visitLargeBinary;break;case W.FixedSizeBinary:i=r.visitFixedSizeBinary;break;case W.Date:i=r.visitDate;break;case W.DateDay:i=r.visitDateDay||r.visitDate;break;case W.DateMillisecond:i=r.visitDateMillisecond||r.visitDate;break;case W.Timestamp:i=r.visitTimestamp;break;case W.TimestampSecond:i=r.visitTimestampSecond||r.visitTimestamp;break;case W.TimestampMillisecond:i=r.visitTimestampMillisecond||r.visitTimestamp;break;case W.TimestampMicrosecond:i=r.visitTimestampMicrosecond||r.visitTimestamp;break;case W.TimestampNanosecond:i=r.visitTimestampNanosecond||r.visitTimestamp;break;case W.Time:i=r.visitTime;break;case W.TimeSecond:i=r.visitTimeSecond||r.visitTime;break;case W.TimeMillisecond:i=r.visitTimeMillisecond||r.visitTime;break;case W.TimeMicrosecond:i=r.visitTimeMicrosecond||r.visitTime;break;case W.TimeNanosecond:i=r.visitTimeNanosecond||r.visitTime;break;case W.Decimal:i=r.visitDecimal;break;case W.List:i=r.visitList;break;case W.Struct:i=r.visitStruct;break;case W.Union:i=r.visitUnion;break;case W.DenseUnion:i=r.visitDenseUnion||r.visitUnion;break;case W.SparseUnion:i=r.visitSparseUnion||r.visitUnion;break;case W.Dictionary:i=r.visitDictionary;break;case W.Interval:i=r.visitInterval;break;case W.IntervalDayTime:i=r.visitIntervalDayTime||r.visitInterval;break;case W.IntervalYearMonth:i=r.visitIntervalYearMonth||r.visitInterval;break;case W.Duration:i=r.visitDuration;break;case W.DurationSecond:i=r.visitDurationSecond||r.visitDuration;break;case W.DurationMillisecond:i=r.visitDurationMillisecond||r.visitDuration;break;case W.DurationMicrosecond:i=r.visitDurationMicrosecond||r.visitDuration;break;case W.DurationNanosecond:i=r.visitDurationNanosecond||r.visitDuration;break;case W.FixedSizeList:i=r.visitFixedSizeList;break;case W.Map:i=r.visitMap;break}if(typeof i=="function")return i;if(!e)return()=>null;throw new Error(`Unrecognized type '${W[t]}'`)}function am(r){switch(r.typeId){case W.Null:return W.Null;case W.Int:{const{bitWidth:t,isSigned:e}=r;switch(t){case 8:return e?W.Int8:W.Uint8;case 16:return e?W.Int16:W.Uint16;case 32:return e?W.Int32:W.Uint32;case 64:return e?W.Int64:W.Uint64}return W.Int}case W.Float:switch(r.precision){case Cr.HALF:return W.Float16;case Cr.SINGLE:return W.Float32;case Cr.DOUBLE:return W.Float64}return W.Float;case W.Binary:return W.Binary;case W.LargeBinary:return W.LargeBinary;case W.Utf8:return W.Utf8;case W.LargeUtf8:return W.LargeUtf8;case W.Bool:return W.Bool;case W.Decimal:return W.Decimal;case W.Time:switch(r.unit){case Jt.SECOND:return W.TimeSecond;case Jt.MILLISECOND:return W.TimeMillisecond;case Jt.MICROSECOND:return W.TimeMicrosecond;case Jt.NANOSECOND:return W.TimeNanosecond}return W.Time;case W.Timestamp:switch(r.unit){case Jt.SECOND:return W.TimestampSecond;case Jt.MILLISECOND:return W.TimestampMillisecond;case Jt.MICROSECOND:return W.TimestampMicrosecond;case Jt.NANOSECOND:return W.TimestampNanosecond}return W.Timestamp;case W.Date:switch(r.unit){case _n.DAY:return W.DateDay;case _n.MILLISECOND:return W.DateMillisecond}return W.Date;case W.Interval:switch(r.unit){case ns.DAY_TIME:return W.IntervalDayTime;case ns.YEAR_MONTH:return W.IntervalYearMonth}return W.Interval;case W.Duration:switch(r.unit){case Jt.SECOND:return W.DurationSecond;case Jt.MILLISECOND:return W.DurationMillisecond;case Jt.MICROSECOND:return W.DurationMicrosecond;case Jt.NANOSECOND:return W.DurationNanosecond}return W.Duration;case W.Map:return W.Map;case W.List:return W.List;case W.Struct:return W.Struct;case W.Union:switch(r.mode){case Ii.Dense:return W.DenseUnion;case Ii.Sparse:return W.SparseUnion}return W.Union;case W.FixedSizeBinary:return W.FixedSizeBinary;case W.FixedSizeList:return W.FixedSizeList;case W.Dictionary:return W.Dictionary}throw new Error(`Unrecognized type '${W[r.typeId]}'`)}le.prototype.visitInt8=null;le.prototype.visitInt16=null;le.prototype.visitInt32=null;le.prototype.visitInt64=null;le.prototype.visitUint8=null;le.prototype.visitUint16=null;le.prototype.visitUint32=null;le.prototype.visitUint64=null;le.prototype.visitFloat16=null;le.prototype.visitFloat32=null;le.prototype.visitFloat64=null;le.prototype.visitDateDay=null;le.prototype.visitDateMillisecond=null;le.prototype.visitTimestampSecond=null;le.prototype.visitTimestampMillisecond=null;le.prototype.visitTimestampMicrosecond=null;le.prototype.visitTimestampNanosecond=null;le.prototype.visitTimeSecond=null;le.prototype.visitTimeMillisecond=null;le.prototype.visitTimeMicrosecond=null;le.prototype.visitTimeNanosecond=null;le.prototype.visitDenseUnion=null;le.prototype.visitSparseUnion=null;le.prototype.visitIntervalDayTime=null;le.prototype.visitIntervalYearMonth=null;le.prototype.visitDuration=null;le.prototype.visitDurationSecond=null;le.prototype.visitDurationMillisecond=null;le.prototype.visitDurationMicrosecond=null;le.prototype.visitDurationNanosecond=null;const ib=new Float64Array(1),vs=new Uint32Array(ib.buffer);function Ff(r){const t=(r&31744)>>10,e=(r&1023)/1024,i=Math.pow(-1,(r&32768)>>15);switch(t){case 31:return i*(e?Number.NaN:1/0);case 0:return i*(e?6103515625e-14*e:0)}return i*Math.pow(2,t-15)*(1+e)}function nb(r){if(r!==r)return 32256;ib[0]=r;const t=(vs[1]&2147483648)>>16&65535;let e=vs[1]&2146435072,i=0;return e>=1089470464?vs[0]>0?e=31744:(e=(e&2080374784)>>16,i=(vs[1]&1048575)>>10):e<=1056964608?(i=1048576+(vs[1]&1048575),i=1048576+(i<<(e>>20)-998)>>21,e=0):(e=e-1056964608>>10,i=(vs[1]&1048575)+512>>10),t|e|i&65535}const xF=Object.freeze(Object.defineProperty({__proto__:null,float64ToUint16:nb,uint16ToFloat64:Ff},Symbol.toStringTag,{value:"Module"}));class Gt extends le{}function Yt(r){return(t,e,i)=>{if(t.setValid(e,i!=null))return r(t,e,i)}}const SF=(r,t,e)=>{r[t]=Math.floor(e/864e5)},sb=(r,t,e,i)=>{if(e+1{const n=r+e;i?t[n>>3]|=1<>3]&=~(1<{r[t]=e},Pf=({values:r},t,e)=>{r[t]=e},ob=({values:r},t,e)=>{r[t]=nb(e)},IF=(r,t,e)=>{switch(r.type.precision){case Cr.HALF:return ob(r,t,e);case Cr.SINGLE:case Cr.DOUBLE:return Pf(r,t,e)}},ab=({values:r},t,e)=>{SF(r,t,e.valueOf())},lb=({values:r},t,e)=>{r[t]=BigInt(e)},EF=({stride:r,values:t},e,i)=>{t.set(i.subarray(0,r),r*e)},ub=({values:r,valueOffsets:t},e,i)=>sb(r,t,e,i),cb=({values:r,valueOffsets:t},e,i)=>sb(r,t,e,A0(i)),CF=(r,t,e)=>{r.type.unit===_n.DAY?ab(r,t,e):lb(r,t,e)},hb=({values:r},t,e)=>{r[t]=BigInt(e/1e3)},fb=({values:r},t,e)=>{r[t]=BigInt(e)},db=({values:r},t,e)=>{r[t]=BigInt(e*1e3)},pb=({values:r},t,e)=>{r[t]=BigInt(e*1e6)},AF=(r,t,e)=>{switch(r.type.unit){case Jt.SECOND:return hb(r,t,e);case Jt.MILLISECOND:return fb(r,t,e);case Jt.MICROSECOND:return db(r,t,e);case Jt.NANOSECOND:return pb(r,t,e)}},mb=({values:r},t,e)=>{r[t]=e},yb=({values:r},t,e)=>{r[t]=e},gb=({values:r},t,e)=>{r[t]=e},vb=({values:r},t,e)=>{r[t]=e},OF=(r,t,e)=>{switch(r.type.unit){case Jt.SECOND:return mb(r,t,e);case Jt.MILLISECOND:return yb(r,t,e);case Jt.MICROSECOND:return gb(r,t,e);case Jt.NANOSECOND:return vb(r,t,e)}},FF=({values:r,stride:t},e,i)=>{r.set(i.subarray(0,t),t*e)},PF=(r,t,e)=>{const i=r.children[0],n=r.valueOffsets,s=Ei.getVisitFn(i);if(Array.isArray(e))for(let o=-1,a=n[t],l=n[t+1];a{const i=r.children[0],{valueOffsets:n}=r,s=Ei.getVisitFn(i);let{[t]:o,[t+1]:a}=n;const l=e instanceof Map?e.entries():Object.entries(e);for(const u of l)if(s(i,o,u),++o>=a)break},DF=(r,t)=>(e,i,n,s)=>i&&e(i,r,t[s]),RF=(r,t)=>(e,i,n,s)=>i&&e(i,r,t.get(s)),NF=(r,t)=>(e,i,n,s)=>i&&e(i,r,t.get(n.name)),LF=(r,t)=>(e,i,n,s)=>i&&e(i,r,t[n.name]),BF=(r,t,e)=>{const i=r.type.children.map(s=>Ei.getVisitFn(s.type)),n=e instanceof Map?NF(t,e):e instanceof Qe?RF(t,e):Array.isArray(e)?DF(t,e):LF(t,e);r.type.children.forEach((s,o)=>n(i[o],r.children[o],s,o))},kF=(r,t,e)=>{r.type.mode===Ii.Dense?_b(r,t,e):bb(r,t,e)},_b=(r,t,e)=>{const i=r.type.typeIdToChildIndex[r.typeIds[t]],n=r.children[i];Ei.visit(n,r.valueOffsets[t],e)},bb=(r,t,e)=>{const i=r.type.typeIdToChildIndex[r.typeIds[t]],n=r.children[i];Ei.visit(n,t,e)},UF=(r,t,e)=>{var i;(i=r.dictionary)===null||i===void 0||i.set(r.values[t],e)},zF=(r,t,e)=>{r.type.unit===ns.DAY_TIME?wb(r,t,e):xb(r,t,e)},wb=({values:r},t,e)=>{r.set(e.subarray(0,2),2*t)},xb=({values:r},t,e)=>{r[t]=e[0]*12+e[1]%12},Sb=({values:r},t,e)=>{r[t]=e},Tb=({values:r},t,e)=>{r[t]=e},Ib=({values:r},t,e)=>{r[t]=e},Eb=({values:r},t,e)=>{r[t]=e},jF=(r,t,e)=>{switch(r.type.unit){case Jt.SECOND:return Sb(r,t,e);case Jt.MILLISECOND:return Tb(r,t,e);case Jt.MICROSECOND:return Ib(r,t,e);case Jt.NANOSECOND:return Eb(r,t,e)}},$F=(r,t,e)=>{const{stride:i}=r,n=r.children[0],s=Ei.getVisitFn(n);if(Array.isArray(e))for(let o=-1,a=t*i;++o`${eo(t)}: ${eo(e)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}[Symbol.iterator](){return new VF(this[Zr],this[Hs])}}class VF{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[Zr].type.children.some(i=>i.name===e)}getOwnPropertyDescriptor(t,e){if(t[Zr].type.children.some(i=>i.name===e))return{writable:!0,enumerable:!0,configurable:!0}}get(t,e){if(Reflect.has(t,e))return t[e];const i=t[Zr].type.children.findIndex(n=>n.name===e);if(i!==-1){const n=Yr.visit(t[Zr].children[i],t[Hs]);return Reflect.set(t,e,n),n}}set(t,e,i){const n=t[Zr].type.children.findIndex(s=>s.name===e);return n!==-1?(Ei.visit(t[Zr].children[n],t[Hs],i),Reflect.set(t,e,i)):Reflect.has(t,e)||typeof e=="symbol"?Reflect.set(t,e,i):!1}}const WF=new GF;class Lt extends le{}function Wt(r){return(t,e)=>t.getValid(e)?r(t,e):null}const HF=(r,t)=>864e5*r[t],XF=(r,t)=>null,Cb=(r,t,e)=>{if(e+1>=t.length)return null;const i=ar(t[e]),n=ar(t[e+1]);return r.subarray(i,n)},YF=({offset:r,values:t},e)=>{const i=r+e;return(t[i>>3]&1<HF(r,t),Ob=({values:r},t)=>ar(r[t]),xn=({stride:r,values:t},e)=>t[r*e],qF=({stride:r,values:t},e)=>Ff(t[r*e]),Fb=({values:r},t)=>r[t],QF=({stride:r,values:t},e)=>t.subarray(r*e,r*(e+1)),Pb=({values:r,valueOffsets:t},e)=>Cb(r,t,e),Mb=({values:r,valueOffsets:t},e)=>{const i=Cb(r,t,e);return i!==null?F2(i):null},KF=({values:r},t)=>r[t],ZF=({type:r,values:t},e)=>r.precision!==Cr.HALF?t[e]:Ff(t[e]),JF=(r,t)=>r.type.unit===_n.DAY?Ab(r,t):Ob(r,t),Db=({values:r},t)=>1e3*ar(r[t]),Rb=({values:r},t)=>ar(r[t]),Nb=({values:r},t)=>P0(r[t],BigInt(1e3)),Lb=({values:r},t)=>P0(r[t],BigInt(1e6)),tP=(r,t)=>{switch(r.type.unit){case Jt.SECOND:return Db(r,t);case Jt.MILLISECOND:return Rb(r,t);case Jt.MICROSECOND:return Nb(r,t);case Jt.NANOSECOND:return Lb(r,t)}},Bb=({values:r},t)=>r[t],kb=({values:r},t)=>r[t],Ub=({values:r},t)=>r[t],zb=({values:r},t)=>r[t],eP=(r,t)=>{switch(r.type.unit){case Jt.SECOND:return Bb(r,t);case Jt.MILLISECOND:return kb(r,t);case Jt.MICROSECOND:return Ub(r,t);case Jt.NANOSECOND:return zb(r,t)}},rP=({values:r,stride:t},e)=>su.decimal(r.subarray(t*e,t*(e+1))),iP=(r,t)=>{const{valueOffsets:e,stride:i,children:n}=r,{[t*i]:s,[t*i+1]:o}=e,l=n[0].slice(s,o-s);return new Qe([l])},nP=(r,t)=>{const{valueOffsets:e,children:i}=r,{[t]:n,[t+1]:s}=e,o=i[0];return new Df(o.slice(n,s-n))},sP=(r,t)=>new Mf(r,t),oP=(r,t)=>r.type.mode===Ii.Dense?jb(r,t):$b(r,t),jb=(r,t)=>{const e=r.type.typeIdToChildIndex[r.typeIds[t]],i=r.children[e];return Yr.visit(i,r.valueOffsets[t])},$b=(r,t)=>{const e=r.type.typeIdToChildIndex[r.typeIds[t]],i=r.children[e];return Yr.visit(i,t)},aP=(r,t)=>{var e;return(e=r.dictionary)===null||e===void 0?void 0:e.get(r.values[t])},lP=(r,t)=>r.type.unit===ns.DAY_TIME?Vb(r,t):Gb(r,t),Vb=({values:r},t)=>r.subarray(2*t,2*(t+1)),Gb=({values:r},t)=>{const e=r[t],i=new Int32Array(2);return i[0]=Math.trunc(e/12),i[1]=Math.trunc(e%12),i},Wb=({values:r},t)=>r[t],Hb=({values:r},t)=>r[t],Xb=({values:r},t)=>r[t],Yb=({values:r},t)=>r[t],uP=(r,t)=>{switch(r.type.unit){case Jt.SECOND:return Wb(r,t);case Jt.MILLISECOND:return Hb(r,t);case Jt.MICROSECOND:return Xb(r,t);case Jt.NANOSECOND:return Yb(r,t)}},cP=(r,t)=>{const{stride:e,children:i}=r,s=i[0].slice(t*e,e);return new Qe([s])};Lt.prototype.visitNull=Wt(XF);Lt.prototype.visitBool=Wt(YF);Lt.prototype.visitInt=Wt(KF);Lt.prototype.visitInt8=Wt(xn);Lt.prototype.visitInt16=Wt(xn);Lt.prototype.visitInt32=Wt(xn);Lt.prototype.visitInt64=Wt(Fb);Lt.prototype.visitUint8=Wt(xn);Lt.prototype.visitUint16=Wt(xn);Lt.prototype.visitUint32=Wt(xn);Lt.prototype.visitUint64=Wt(Fb);Lt.prototype.visitFloat=Wt(ZF);Lt.prototype.visitFloat16=Wt(qF);Lt.prototype.visitFloat32=Wt(xn);Lt.prototype.visitFloat64=Wt(xn);Lt.prototype.visitUtf8=Wt(Mb);Lt.prototype.visitLargeUtf8=Wt(Mb);Lt.prototype.visitBinary=Wt(Pb);Lt.prototype.visitLargeBinary=Wt(Pb);Lt.prototype.visitFixedSizeBinary=Wt(QF);Lt.prototype.visitDate=Wt(JF);Lt.prototype.visitDateDay=Wt(Ab);Lt.prototype.visitDateMillisecond=Wt(Ob);Lt.prototype.visitTimestamp=Wt(tP);Lt.prototype.visitTimestampSecond=Wt(Db);Lt.prototype.visitTimestampMillisecond=Wt(Rb);Lt.prototype.visitTimestampMicrosecond=Wt(Nb);Lt.prototype.visitTimestampNanosecond=Wt(Lb);Lt.prototype.visitTime=Wt(eP);Lt.prototype.visitTimeSecond=Wt(Bb);Lt.prototype.visitTimeMillisecond=Wt(kb);Lt.prototype.visitTimeMicrosecond=Wt(Ub);Lt.prototype.visitTimeNanosecond=Wt(zb);Lt.prototype.visitDecimal=Wt(rP);Lt.prototype.visitList=Wt(iP);Lt.prototype.visitStruct=Wt(sP);Lt.prototype.visitUnion=Wt(oP);Lt.prototype.visitDenseUnion=Wt(jb);Lt.prototype.visitSparseUnion=Wt($b);Lt.prototype.visitDictionary=Wt(aP);Lt.prototype.visitInterval=Wt(lP);Lt.prototype.visitIntervalDayTime=Wt(Vb);Lt.prototype.visitIntervalYearMonth=Wt(Gb);Lt.prototype.visitDuration=Wt(uP);Lt.prototype.visitDurationSecond=Wt(Wb);Lt.prototype.visitDurationMillisecond=Wt(Hb);Lt.prototype.visitDurationMicrosecond=Wt(Xb);Lt.prototype.visitDurationNanosecond=Wt(Yb);Lt.prototype.visitFixedSizeList=Wt(cP);Lt.prototype.visitMap=Wt(nP);const Yr=new Lt,Ms=Symbol.for("keys"),Xs=Symbol.for("vals"),Ds=Symbol.for("kKeysAsStrings"),wh=Symbol.for("_kKeysAsStrings");class Df{constructor(t){return this[Ms]=new Qe([t.children[0]]).memoize(),this[Xs]=t.children[1],new Proxy(this,new fP)}get[Ds](){return this[wh]||(this[wh]=Array.from(this[Ms].toArray(),String))}[Symbol.iterator](){return new hP(this[Ms],this[Xs])}get size(){return this[Ms].length}toArray(){return Object.values(this.toJSON())}toJSON(){const t=this[Ms],e=this[Xs],i={};for(let n=-1,s=t.length;++n`${eo(t)}: ${eo(e)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}}class hP{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),Yr.visit(this.vals,t)]})}}class fP{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(t){return t[Ds]}has(t,e){return t[Ds].includes(e)}getOwnPropertyDescriptor(t,e){if(t[Ds].indexOf(e)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(t,e){if(Reflect.has(t,e))return t[e];const i=t[Ds].indexOf(e);if(i!==-1){const n=Yr.visit(Reflect.get(t,Xs),i);return Reflect.set(t,e,n),n}}set(t,e,i){const n=t[Ds].indexOf(e);return n!==-1?(Ei.visit(Reflect.get(t,Xs),n,i),Reflect.set(t,e,i)):Reflect.has(t,e)?Reflect.set(t,e,i):!1}}Object.defineProperties(Df.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[Ms]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Xs]:{writable:!0,enumerable:!1,configurable:!1,value:null},[wh]:{writable:!0,enumerable:!1,configurable:!1,value:null}});let lm;function qb(r,t,e,i){const{length:n=0}=r;let s=typeof t!="number"?0:t,o=typeof e!="number"?n:e;return s<0&&(s=(s%n+n)%n),o<0&&(o=(o%n+n)%n),on&&(o=n),i?i(r,s,o):[s,o]}const Qb=(r,t)=>r<0?t+r:r,um=r=>r!==r;function cs(r){if(typeof r!=="object"||r===null)return um(r)?um:e=>e===r;if(r instanceof Date){const e=r.valueOf();return i=>i instanceof Date?i.valueOf()===e:!1}return ArrayBuffer.isView(r)?e=>e?F0(r,e):!1:r instanceof Map?pP(r):Array.isArray(r)?dP(r):r instanceof Qe?mP(r):yP(r,!0)}function dP(r){const t=[];for(let e=-1,i=r.length;++e!1;const i=[];for(let n=-1,s=e.length;++n{if(!e||typeof e!="object")return!1;switch(e.constructor){case Array:return gP(r,e);case Map:return cm(r,e,e.keys());case Df:case Mf:case Object:case void 0:return cm(r,e,t||Object.keys(e))}return e instanceof Qe?vP(r,e):!1}}function gP(r,t){const e=r.length;if(t.length!==e)return!1;for(let i=-1;++i>i}function bP(r,t,e){return e?!!(r[t>>3]|=1<>3]&=~(1<0||e.byteLength>3):Zb(new au(e,r,t,null,Rf)).subarray(0,i)),n}return e}function Zb(r){const t=[];let e=0,i=0,n=0;for(const o of r)o&&(n|=1<0)&&(t[e++]=n);const s=new Uint8Array(t.length+7&-8);return s.set(t),s}class au{constructor(t,e,i,n,s){this.bytes=t,this.length=i,this.context=n,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,n=t+(t%8===0?0:8-t%8);return Bl(r,t,n)+Bl(r,i,e)+Jb(r,n>>3,i-n>>3)}function Jb(r,t,e){let i=0,n=Math.trunc(t);const s=new DataView(r.buffer,r.byteOffset,r.byteLength),o=e===void 0?r.byteLength:n+e;for(;o-n>=4;)i+=qa(s.getUint32(n)),n+=4;for(;o-n>=2;)i+=qa(s.getUint16(n)),n+=2;for(;o-n>=1;)i+=qa(s.getUint8(n)),n+=1;return i}function qa(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 wP=Object.freeze(Object.defineProperty({__proto__:null,BitIterator:au,getBit:Kb,getBool:Rf,packBools:Zb,popcnt_array:Jb,popcnt_bit_range:Bl,popcnt_uint32:qa,setBool:bP,truncateBitmap:xh},Symbol.toStringTag,{value:"Module"})),xP=-1;class ta{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 Et.isSparseUnion(t)?this.children.some(e=>e.nullable):Et.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:i,nullBitmap:n,typeIds:s}=this;return e&&(t+=e.byteLength),i&&(t+=i.byteLength),n&&(t+=n.byteLength),s&&(t+=s.byteLength),this.children.reduce((o,a)=>o+a.byteLength,t)}get nullCount(){if(Et.isUnion(this.type))return this.children.reduce((i,n)=>i+n.nullCount,0);let t=this._nullCount,e;return t<=xP&&(e=this.nullBitmap)&&(this._nullCount=t=e.length===0?0:this.length-Bl(e,this.offset,this.offset+this.length)),t}constructor(t,e,i,n,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(i||0,0)),this._nullCount=Math.floor(Math.max(n||0,-1));let l;s instanceof ta?(this.stride=s.stride,this.values=s.values,this.typeIds=s.typeIds,this.nullBitmap=s.nullBitmap,this.valueOffsets=s.valueOffsets):(this.stride=rb(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(Et.isUnion(e)){const i=e,n=this.children[i.typeIdToChildIndex[this.typeIds[t]]],s=i.mode===Ii.Dense?this.valueOffsets[t]:t;return n.getValid(s)}if(this.nullable&&this.nullCount>0){const i=this.offset+t;return(this.nullBitmap[i>>3]&1<>3;(!s||s.byteLength<=c)&&(s=new Uint8Array((o+a+63&-64)>>3).fill(255),this.nullCount>0?(s.set(xh(o,a,this.nullBitmap),0),Object.assign(this,{nullBitmap:s})):Object.assign(this,{nullBitmap:s,_nullCount:0}));const h=s[c];i=(h&u)!==0,s[c]=e?h|u:h&~u}return i!==!!e&&(this._nullCount=this.nullCount+(e?-1:1)),e}clone(t=this.type,e=this.offset,i=this.length,n=this._nullCount,s=this,o=this.children){return new ta(t,e,i,n,s,o,this.dictionary)}slice(t,e){const{stride:i,typeId:n,children:s}=this,o=+(this._nullCount===0)-1,a=n===16?i:1,l=this._sliceBuffers(t,e,i,n);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===W.Null)return this.clone(this.type,0,t,0);const{length:e,nullCount:i}=this,n=new Uint8Array((t+63&-64)>>3).fill(255,0,e>>3);n[e>>3]=(1<0&&n.set(xh(this.offset,e,this.nullBitmap),0);const s=this.buffers;return s[zi.VALIDITY]=n,this.clone(this.type,0,t,i+(t-e),s)}_sliceBuffers(t,e,i,n){let s;const{buffers:o}=this;return(s=o[zi.TYPE])&&(o[zi.TYPE]=s.subarray(t,t+e)),(s=o[zi.OFFSET])&&(o[zi.OFFSET]=s.subarray(t,t+e+1))||(s=o[zi.DATA])&&(o[zi.DATA]=n===6?s:s.subarray(i*t,i*(t+e))),o}_sliceChildren(t,e,i){return t.map(n=>n.slice(e,i))}}ta.prototype.children=Object.freeze([]);class hm{constructor(t=0,e){this.numChunks=t,this.getChunkIterator=e,this.chunkIndex=0,this.chunkIterator=this.getChunkIterator(0)}next(){for(;this.chunkIndext.nullable)}function TP(r){return r.reduce((t,e)=>t+e.nullCount,0)}function IP(r){return r.reduce((t,e,i)=>(t[i+1]=t[i]+e.length,t),new Uint32Array(r.length+1))}function EP(r,t,e,i){const n=[];for(let s=-1,o=r.length;++s=i)break;if(e>=l+u)continue;if(l>=e&&l+u<=i){n.push(a);continue}const c=Math.max(0,e-l),h=Math.min(i-l,u);n.push(a.slice(c,h-c))}return n.length===0&&n.push(r[0].slice(0,0)),n}function Nf(r,t,e,i){let n=0,s=0,o=t.length-1;do{if(n>=o-1)return e0?0:-1}function FP(r,t){const{nullBitmap:e}=r;if(!e||r.nullCount<=0)return-1;let i=0;for(const n of new au(e,r.offset+(t||0),r.length,e,Rf)){if(!n)return i;++i}return-1}function Kt(r,t,e){if(t===void 0)return-1;if(t===null)switch(r.typeId){case W.Union:break;case W.Dictionary:break;default:return FP(r,e)}const i=Yr.getVisitFn(r),n=cs(t);for(let s=(e||0)-1,o=r.length;++s{const n=r.data[i];return n.values.subarray(0,n.length)[Symbol.iterator]()});let e=0;return new hm(r.data.length,i=>{const s=r.data[i].length,o=r.slice(e,e+s);return e+=s,new PP(o)})}class PP{constructor(t){this.vector=t,this.index=0}next(){return this.indexa.data):t;if(s.length===0||s.some(a=>!(a instanceof ta)))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}=iw[o.typeId],c=s[0];this.isValid=h=>tw(c,h),this.get=h=>a(c,h),this.set=(h,p)=>l(c,h,p),this.indexOf=h=>u(c,h),this._offsets=[0,c.length];break}default:Object.setPrototypeOf(this,nw[o.typeId]),this._offsets=IP(s);break}this.data=s,this.type=o,this.stride=rb(o),this.numChildren=(n=(i=o.children)===null||i===void 0?void 0:i.length)!==null&&n!==void 0?n:0,this.length=this._offsets.at(-1)}get byteLength(){return this.data.reduce((t,e)=>t+e.byteLength,0)}get nullable(){return SP(this.data)}get nullCount(){return TP(this.data)}get ArrayType(){return this.type.ArrayType}get[Symbol.toStringTag](){return`${this.VectorName}<${this.type[Symbol.toStringTag]}>`}get VectorName(){return`${W[this.type.typeId]}Vector`}isValid(t){return!1}get(t){return null}at(t){return this.get(Qb(t,this.length))}set(t,e){}indexOf(t,e){return-1}includes(t,e){return this.indexOf(t,e)>-1}[Symbol.iterator](){return MP.visit(this)}concat(...t){return new Qe(this.data.concat(t.flatMap(e=>e.data).flat(Number.POSITIVE_INFINITY)))}slice(t,e){return new Qe(qb(this,t,e,({data:i,_offsets:n},s,o)=>EP(i,n,s,o)))}toJSON(){return[...this]}toArray(){const{type:t,data:e,length:i,stride:n,ArrayType:s}=this;switch(t.typeId){case W.Int:case W.Float:case W.Decimal:case W.Time:case W.Timestamp:switch(e.length){case 0:return new s;case 1:return e[0].values.subarray(0,i*n);default:return e.reduce((o,{values:a,length:l})=>(o.array.set(a.subarray(0,l*n),o.offset),o.offset+=l*n,o),{array:new s(i*n),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(i=>i.name===t))}getChildAt(t){return t>-1&&te[t])):null}get isMemoized(){return Et.isDictionary(this.type)?this.data[0].dictionary.isMemoized:!1}memoize(){if(Et.isDictionary(this.type)){const t=new kl(this.data[0].dictionary),e=this.data.map(i=>{const n=i.clone();return n.dictionary=t,n});return new Qe(e)}return new kl(this)}unmemoize(){if(Et.isDictionary(this.type)&&this.isMemoized){const t=this.data[0].dictionary.unmemoize(),e=this.data.map(i=>{const n=i.clone();return n.dictionary=t,n});return new Qe(e)}return this}}rw=Symbol.toStringTag;Qe[rw]=(r=>{r.type=Et.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(W).map(e=>W[e]).filter(e=>typeof e=="number"&&e!==W.NONE);for(const e of t){const i=Yr.getVisitFnByTypeId(e),n=Ei.getVisitFnByTypeId(e),s=dm.getVisitFnByTypeId(e);iw[e]={get:i,set:n,indexOf:s},nw[e]=Object.create(r,{isValid:{value:fm(tw)},get:{value:fm(Yr.getVisitFnByTypeId(e))},set:{value:CP(Ei.getVisitFnByTypeId(e))},indexOf:{value:AP(dm.getVisitFnByTypeId(e))}})}return"Vector"})(Qe.prototype);class kl extends Qe{constructor(t){super(t.data);const e=this.get,i=this.set,n=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){i.call(this,o,a),s[o]=a}}),Object.defineProperty(this,"slice",{value:(o,a)=>new kl(n.call(this,o,a))}),Object.defineProperty(this,"isMemoized",{value:!0}),Object.defineProperty(this,"unmemoize",{value:()=>new Qe(this.data)}),Object.defineProperty(this,"memoize",{value:()=>this})}}const DP=65536;function Ls(r){return r<0&&(r=4294967295+r+1),`0x${r.toString(16)}`}const io=8,Lf=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8];class Bf{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]),i=new Uint32Array([t.buffer[1]>>>16,t.buffer[1]&65535,t.buffer[0]>>>16,t.buffer[0]&65535]);let n=e[3]*i[3];this.buffer[0]=n&65535;let s=n>>>16;return n=e[2]*i[3],s+=n,n=e[3]*i[2]>>>0,s+=n,this.buffer[0]+=s<<16,this.buffer[1]=s>>>0>>16,this.buffer[1]+=e[1]*i[3]+e[2]*i[2]+e[3]*i[1],this.buffer[1]+=e[0]*i[3]+e[1]*i[2]+e[2]*i[1]+e[3]*i[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`${Ls(this.buffer[3])} ${Ls(this.buffer[2])} ${Ls(this.buffer[1])} ${Ls(this.buffer[0])}`}static multiply(t,e){return new ci(new Uint32Array(t.buffer)).times(e)}static add(t,e){return new ci(new Uint32Array(t.buffer)).plus(e)}static from(t,e=new Uint32Array(4)){return ci.fromString(typeof t=="string"?t:t.toString(),e)}static fromNumber(t,e=new Uint32Array(4)){return ci.fromString(t.toString(),e)}static fromString(t,e=new Uint32Array(4)){const i=t.startsWith("-"),n=t.length,s=new ci(e);for(let o=i?1:0;othis.compareFields(i,e[n]))}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 ur(r,t){return t instanceof r.constructor}function hs(r,t){return r===t||ur(r,t)}function Qi(r,t){return r===t||ur(r,t)&&r.bitWidth===t.bitWidth&&r.isSigned===t.isSigned}function lu(r,t){return r===t||ur(r,t)&&r.precision===t.precision}function NP(r,t){return r===t||ur(r,t)&&r.byteWidth===t.byteWidth}function kf(r,t){return r===t||ur(r,t)&&r.unit===t.unit}function fa(r,t){return r===t||ur(r,t)&&r.unit===t.unit&&r.timezone===t.timezone}function da(r,t){return r===t||ur(r,t)&&r.unit===t.unit&&r.bitWidth===t.bitWidth}function LP(r,t){return r===t||ur(r,t)&&r.children.length===t.children.length&&Ci.compareManyFields(r.children,t.children)}function BP(r,t){return r===t||ur(r,t)&&r.children.length===t.children.length&&Ci.compareManyFields(r.children,t.children)}function Uf(r,t){return r===t||ur(r,t)&&r.mode===t.mode&&r.typeIds.every((e,i)=>e===t.typeIds[i])&&Ci.compareManyFields(r.children,t.children)}function kP(r,t){return r===t||ur(r,t)&&r.id===t.id&&r.isOrdered===t.isOrdered&&Ci.visit(r.indices,t.indices)&&Ci.visit(r.dictionary,t.dictionary)}function zf(r,t){return r===t||ur(r,t)&&r.unit===t.unit}function pa(r,t){return r===t||ur(r,t)&&r.unit===t.unit}function UP(r,t){return r===t||ur(r,t)&&r.listSize===t.listSize&&r.children.length===t.children.length&&Ci.compareManyFields(r.children,t.children)}function zP(r,t){return r===t||ur(r,t)&&r.keysSorted===t.keysSorted&&r.children.length===t.children.length&&Ci.compareManyFields(r.children,t.children)}Ut.prototype.visitNull=hs;Ut.prototype.visitBool=hs;Ut.prototype.visitInt=Qi;Ut.prototype.visitInt8=Qi;Ut.prototype.visitInt16=Qi;Ut.prototype.visitInt32=Qi;Ut.prototype.visitInt64=Qi;Ut.prototype.visitUint8=Qi;Ut.prototype.visitUint16=Qi;Ut.prototype.visitUint32=Qi;Ut.prototype.visitUint64=Qi;Ut.prototype.visitFloat=lu;Ut.prototype.visitFloat16=lu;Ut.prototype.visitFloat32=lu;Ut.prototype.visitFloat64=lu;Ut.prototype.visitUtf8=hs;Ut.prototype.visitLargeUtf8=hs;Ut.prototype.visitBinary=hs;Ut.prototype.visitLargeBinary=hs;Ut.prototype.visitFixedSizeBinary=NP;Ut.prototype.visitDate=kf;Ut.prototype.visitDateDay=kf;Ut.prototype.visitDateMillisecond=kf;Ut.prototype.visitTimestamp=fa;Ut.prototype.visitTimestampSecond=fa;Ut.prototype.visitTimestampMillisecond=fa;Ut.prototype.visitTimestampMicrosecond=fa;Ut.prototype.visitTimestampNanosecond=fa;Ut.prototype.visitTime=da;Ut.prototype.visitTimeSecond=da;Ut.prototype.visitTimeMillisecond=da;Ut.prototype.visitTimeMicrosecond=da;Ut.prototype.visitTimeNanosecond=da;Ut.prototype.visitDecimal=hs;Ut.prototype.visitList=LP;Ut.prototype.visitStruct=BP;Ut.prototype.visitUnion=Uf;Ut.prototype.visitDenseUnion=Uf;Ut.prototype.visitSparseUnion=Uf;Ut.prototype.visitDictionary=kP;Ut.prototype.visitInterval=zf;Ut.prototype.visitIntervalDayTime=zf;Ut.prototype.visitIntervalYearMonth=zf;Ut.prototype.visitDuration=pa;Ut.prototype.visitDurationSecond=pa;Ut.prototype.visitDurationMillisecond=pa;Ut.prototype.visitDurationMicrosecond=pa;Ut.prototype.visitDurationNanosecond=pa;Ut.prototype.visitFixedSizeList=UP;Ut.prototype.visitMap=zP;const Ci=new Ut;function jP(r,t){return Ci.compareSchemas(r,t)}function $P(r,t){return Ci.compareFields(r,t)}function VP(r,t){return Ci.visit(r,t)}const pm=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},_F),RP),wP),xF),pF),_P),yF),{compareSchemas:jP,compareFields:$P,compareTypes:VP}),sw=6048e5,GP=864e5,mm=Symbol.for("constructDateFrom");function Gi(r,t){return typeof r=="function"?r(t):r&&typeof r=="object"&&mm in r?r[mm](t):r instanceof Date?new r.constructor(t):new Date(t)}function qr(r,t){return Gi(t||r,r)}let WP={};function uu(){return WP}function ea(r,t){var a,l,u,c;const e=uu(),i=(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,n=qr(r,t==null?void 0:t.in),s=n.getDay(),o=(s=s.getTime()?i+1:e.getTime()>=a.getTime()?i:i-1}function ym(r){const t=qr(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 HP(r,...t){const e=Gi.bind(null,t.find(i=>typeof i=="object"));return t.map(e)}function gm(r,t){const e=qr(r,t==null?void 0:t.in);return e.setHours(0,0,0,0),e}function XP(r,t,e){const[i,n]=HP(e==null?void 0:e.in,r,t),s=gm(i),o=gm(n),a=+s-ym(s),l=+o-ym(o);return Math.round((a-l)/GP)}function YP(r,t){const e=ow(r,t),i=Gi(r,0);return i.setFullYear(e,0,4),i.setHours(0,0,0,0),Ul(i)}function qP(r){return r instanceof Date||typeof r=="object"&&Object.prototype.toString.call(r)==="[object Date]"}function QP(r){return!(!qP(r)&&typeof r!="number"||isNaN(+qr(r)))}function KP(r,t){const e=qr(r,t==null?void 0:t.in);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}const ZP={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"}},JP=(r,t,e)=>{let i;const n=ZP[r];return typeof n=="string"?i=n:t===1?i=n.one:i=n.other.replace("{{count}}",t.toString()),e!=null&&e.addSuffix?e.comparison&&e.comparison>0?"in "+i:i+" ago":i};function nc(r){return(t={})=>{const e=t.width?String(t.width):r.defaultWidth;return r.formats[e]||r.formats[r.defaultWidth]}}const tM={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},eM={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},rM={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},iM={date:nc({formats:tM,defaultWidth:"full"}),time:nc({formats:eM,defaultWidth:"full"}),dateTime:nc({formats:rM,defaultWidth:"full"})},nM={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},sM=(r,t,e,i)=>nM[r];function go(r){return(t,e)=>{const i=e!=null&&e.context?String(e.context):"standalone";let n;if(i==="formatting"&&r.formattingValues){const o=r.defaultFormattingWidth||r.defaultWidth,a=e!=null&&e.width?String(e.width):o;n=r.formattingValues[a]||r.formattingValues[o]}else{const o=r.defaultWidth,a=e!=null&&e.width?String(e.width):r.defaultWidth;n=r.values[a]||r.values[o]}const s=r.argumentCallback?r.argumentCallback(t):t;return n[s]}}const oM={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},aM={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},lM={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"]},uM={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"]},cM={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"}},hM={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"}},fM=(r,t)=>{const e=Number(r),i=e%100;if(i>20||i<10)switch(i%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},dM={ordinalNumber:fM,era:go({values:oM,defaultWidth:"wide"}),quarter:go({values:aM,defaultWidth:"wide",argumentCallback:r=>r-1}),month:go({values:lM,defaultWidth:"wide"}),day:go({values:uM,defaultWidth:"wide"}),dayPeriod:go({values:cM,defaultWidth:"wide",formattingValues:hM,defaultFormattingWidth:"wide"})};function vo(r){return(t,e={})=>{const i=e.width,n=i&&r.matchPatterns[i]||r.matchPatterns[r.defaultMatchWidth],s=t.match(n);if(!s)return null;const o=s[0],a=i&&r.parsePatterns[i]||r.parsePatterns[r.defaultParseWidth],l=Array.isArray(a)?mM(a,h=>h.test(o)):pM(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 pM(r,t){for(const e in r)if(Object.prototype.hasOwnProperty.call(r,e)&&t(r[e]))return e}function mM(r,t){for(let e=0;e{const i=t.match(r.matchPattern);if(!i)return null;const n=i[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(n.length);return{value:o,rest:a}}}const gM=/^(\d+)(th|st|nd|rd)?/i,vM=/\d+/i,_M={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},bM={any:[/^b/i,/^(a|c)/i]},wM={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},xM={any:[/1/i,/2/i,/3/i,/4/i]},SM={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},TM={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]},IM={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},EM={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]},CM={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},AM={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}},OM={ordinalNumber:yM({matchPattern:gM,parsePattern:vM,valueCallback:r=>parseInt(r,10)}),era:vo({matchPatterns:_M,defaultMatchWidth:"wide",parsePatterns:bM,defaultParseWidth:"any"}),quarter:vo({matchPatterns:wM,defaultMatchWidth:"wide",parsePatterns:xM,defaultParseWidth:"any",valueCallback:r=>r+1}),month:vo({matchPatterns:SM,defaultMatchWidth:"wide",parsePatterns:TM,defaultParseWidth:"any"}),day:vo({matchPatterns:IM,defaultMatchWidth:"wide",parsePatterns:EM,defaultParseWidth:"any"}),dayPeriod:vo({matchPatterns:CM,defaultMatchWidth:"any",parsePatterns:AM,defaultParseWidth:"any"})},FM={code:"en-US",formatDistance:JP,formatLong:iM,formatRelative:sM,localize:dM,match:OM,options:{weekStartsOn:0,firstWeekContainsDate:1}};function PM(r,t){const e=qr(r,t==null?void 0:t.in);return XP(e,KP(e))+1}function MM(r,t){const e=qr(r,t==null?void 0:t.in),i=+Ul(e)-+YP(e);return Math.round(i/sw)+1}function aw(r,t){var c,h,p,f;const e=qr(r,t==null?void 0:t.in),i=e.getFullYear(),n=uu(),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)??n.firstWeekContainsDate??((f=(p=n.locale)==null?void 0:p.options)==null?void 0:f.firstWeekContainsDate)??1,o=Gi((t==null?void 0:t.in)||r,0);o.setFullYear(i+1,0,s),o.setHours(0,0,0,0);const a=ea(o,t),l=Gi((t==null?void 0:t.in)||r,0);l.setFullYear(i,0,s),l.setHours(0,0,0,0);const u=ea(l,t);return+e>=+a?i+1:+e>=+u?i:i-1}function DM(r,t){var a,l,u,c;const e=uu(),i=(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,n=aw(r,t),s=Gi((t==null?void 0:t.in)||r,0);return s.setFullYear(n,0,i),s.setHours(0,0,0,0),ea(s,t)}function RM(r,t){const e=qr(r,t==null?void 0:t.in),i=+ea(e,t)-+DM(e,t);return Math.round(i/sw)+1}function ve(r,t){const e=r<0?"-":"",i=Math.abs(r).toString().padStart(t,"0");return e+i}const rn={y(r,t){const e=r.getFullYear(),i=e>0?e:1-e;return ve(t==="yy"?i%100:i,t.length)},M(r,t){const e=r.getMonth();return t==="M"?String(e+1):ve(e+1,2)},d(r,t){return ve(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 ve(r.getHours()%12||12,t.length)},H(r,t){return ve(r.getHours(),t.length)},m(r,t){return ve(r.getMinutes(),t.length)},s(r,t){return ve(r.getSeconds(),t.length)},S(r,t){const e=t.length,i=r.getMilliseconds(),n=Math.trunc(i*Math.pow(10,e-3));return ve(n,t.length)}},_s={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},vm={G:function(r,t,e){const i=r.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return e.era(i,{width:"abbreviated"});case"GGGGG":return e.era(i,{width:"narrow"});case"GGGG":default:return e.era(i,{width:"wide"})}},y:function(r,t,e){if(t==="yo"){const i=r.getFullYear(),n=i>0?i:1-i;return e.ordinalNumber(n,{unit:"year"})}return rn.y(r,t)},Y:function(r,t,e,i){const n=aw(r,i),s=n>0?n:1-n;if(t==="YY"){const o=s%100;return ve(o,2)}return t==="Yo"?e.ordinalNumber(s,{unit:"year"}):ve(s,t.length)},R:function(r,t){const e=ow(r);return ve(e,t.length)},u:function(r,t){const e=r.getFullYear();return ve(e,t.length)},Q:function(r,t,e){const i=Math.ceil((r.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return ve(i,2);case"Qo":return e.ordinalNumber(i,{unit:"quarter"});case"QQQ":return e.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return e.quarter(i,{width:"wide",context:"formatting"})}},q:function(r,t,e){const i=Math.ceil((r.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return ve(i,2);case"qo":return e.ordinalNumber(i,{unit:"quarter"});case"qqq":return e.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return e.quarter(i,{width:"wide",context:"standalone"})}},M:function(r,t,e){const i=r.getMonth();switch(t){case"M":case"MM":return rn.M(r,t);case"Mo":return e.ordinalNumber(i+1,{unit:"month"});case"MMM":return e.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return e.month(i,{width:"wide",context:"formatting"})}},L:function(r,t,e){const i=r.getMonth();switch(t){case"L":return String(i+1);case"LL":return ve(i+1,2);case"Lo":return e.ordinalNumber(i+1,{unit:"month"});case"LLL":return e.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return e.month(i,{width:"wide",context:"standalone"})}},w:function(r,t,e,i){const n=RM(r,i);return t==="wo"?e.ordinalNumber(n,{unit:"week"}):ve(n,t.length)},I:function(r,t,e){const i=MM(r);return t==="Io"?e.ordinalNumber(i,{unit:"week"}):ve(i,t.length)},d:function(r,t,e){return t==="do"?e.ordinalNumber(r.getDate(),{unit:"date"}):rn.d(r,t)},D:function(r,t,e){const i=PM(r);return t==="Do"?e.ordinalNumber(i,{unit:"dayOfYear"}):ve(i,t.length)},E:function(r,t,e){const i=r.getDay();switch(t){case"E":case"EE":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"})}},e:function(r,t,e,i){const n=r.getDay(),s=(n-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return ve(s,2);case"eo":return e.ordinalNumber(s,{unit:"day"});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"})}},c:function(r,t,e,i){const n=r.getDay(),s=(n-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return ve(s,t.length);case"co":return e.ordinalNumber(s,{unit:"day"});case"ccc":return e.day(n,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(n,{width:"narrow",context:"standalone"});case"cccccc":return e.day(n,{width:"short",context:"standalone"});case"cccc":default:return e.day(n,{width:"wide",context:"standalone"})}},i:function(r,t,e){const i=r.getDay(),n=i===0?7:i;switch(t){case"i":return String(n);case"ii":return ve(n,t.length);case"io":return e.ordinalNumber(n,{unit:"day"});case"iii":return e.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(i,{width:"short",context:"formatting"});case"iiii":default:return e.day(i,{width:"wide",context:"formatting"})}},a:function(r,t,e){const n=r.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"aaa":return e.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return e.dayPeriod(n,{width:"narrow",context:"formatting"});case"aaaa":default:return e.dayPeriod(n,{width:"wide",context:"formatting"})}},b:function(r,t,e){const i=r.getHours();let n;switch(i===12?n=_s.noon:i===0?n=_s.midnight:n=i/12>=1?"pm":"am",t){case"b":case"bb":return e.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(n,{width:"narrow",context:"formatting"});case"bbbb":default:return e.dayPeriod(n,{width:"wide",context:"formatting"})}},B:function(r,t,e){const i=r.getHours();let n;switch(i>=17?n=_s.evening:i>=12?n=_s.afternoon:i>=4?n=_s.morning:n=_s.night,t){case"B":case"BB":case"BBB":return e.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(n,{width:"narrow",context:"formatting"});case"BBBB":default:return e.dayPeriod(n,{width:"wide",context:"formatting"})}},h:function(r,t,e){if(t==="ho"){let i=r.getHours()%12;return i===0&&(i=12),e.ordinalNumber(i,{unit:"hour"})}return rn.h(r,t)},H:function(r,t,e){return t==="Ho"?e.ordinalNumber(r.getHours(),{unit:"hour"}):rn.H(r,t)},K:function(r,t,e){const i=r.getHours()%12;return t==="Ko"?e.ordinalNumber(i,{unit:"hour"}):ve(i,t.length)},k:function(r,t,e){let i=r.getHours();return i===0&&(i=24),t==="ko"?e.ordinalNumber(i,{unit:"hour"}):ve(i,t.length)},m:function(r,t,e){return t==="mo"?e.ordinalNumber(r.getMinutes(),{unit:"minute"}):rn.m(r,t)},s:function(r,t,e){return t==="so"?e.ordinalNumber(r.getSeconds(),{unit:"second"}):rn.s(r,t)},S:function(r,t){return rn.S(r,t)},X:function(r,t,e){const i=r.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return bm(i);case"XXXX":case"XX":return Vn(i);case"XXXXX":case"XXX":default:return Vn(i,":")}},x:function(r,t,e){const i=r.getTimezoneOffset();switch(t){case"x":return bm(i);case"xxxx":case"xx":return Vn(i);case"xxxxx":case"xxx":default:return Vn(i,":")}},O:function(r,t,e){const i=r.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+_m(i,":");case"OOOO":default:return"GMT"+Vn(i,":")}},z:function(r,t,e){const i=r.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+_m(i,":");case"zzzz":default:return"GMT"+Vn(i,":")}},t:function(r,t,e){const i=Math.trunc(+r/1e3);return ve(i,t.length)},T:function(r,t,e){return ve(+r,t.length)}};function _m(r,t=""){const e=r>0?"-":"+",i=Math.abs(r),n=Math.trunc(i/60),s=i%60;return s===0?e+String(n):e+String(n)+t+ve(s,2)}function bm(r,t){return r%60===0?(r>0?"-":"+")+ve(Math.abs(r)/60,2):Vn(r,t)}function Vn(r,t=""){const e=r>0?"-":"+",i=Math.abs(r),n=ve(Math.trunc(i/60),2),s=ve(i%60,2);return e+n+t+s}const wm=(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"})}},lw=(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"})}},NM=(r,t)=>{const e=r.match(/(P+)(p+)?/)||[],i=e[1],n=e[2];if(!n)return wm(r,t);let s;switch(i){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}}",wm(i,t)).replace("{{time}}",lw(n,t))},LM={p:lw,P:NM},BM=/^D+$/,kM=/^Y+$/,UM=["D","DD","YY","YYYY"];function zM(r){return BM.test(r)}function jM(r){return kM.test(r)}function $M(r,t,e){const i=VM(r,t,e);if(console.warn(i),UM.includes(r))throw new RangeError(i)}function VM(r,t,e){const i=r[0]==="Y"?"years":"days of the month";return`Use \`${r.toLowerCase()}\` instead of \`${r}\` (in \`${t}\`) for formatting ${i} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const GM=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,WM=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,HM=/^'([^]*?)'?$/,XM=/''/g,YM=/[a-zA-Z]/;function uw(r,t,e){var c,h,p,f;const i=uu(),n=i.locale??FM,s=i.firstWeekContainsDate??((h=(c=i.locale)==null?void 0:c.options)==null?void 0:h.firstWeekContainsDate)??1,o=i.weekStartsOn??((f=(p=i.locale)==null?void 0:p.options)==null?void 0:f.weekStartsOn)??0,a=qr(r,e==null?void 0:e.in);if(!QP(a))throw new RangeError("Invalid time value");let l=t.match(WM).map(y=>{const g=y[0];if(g==="p"||g==="P"){const d=LM[g];return d(y,n.formatLong)}return y}).join("").match(GM).map(y=>{if(y==="''")return{isToken:!1,value:"'"};const g=y[0];if(g==="'")return{isToken:!1,value:qM(y)};if(vm[g])return{isToken:!0,value:y};if(g.match(YM))throw new RangeError("Format string contains an unescaped latin alphabet character `"+g+"`");return{isToken:!1,value:y}});n.localize.preprocessor&&(l=n.localize.preprocessor(a,l));const u={firstWeekContainsDate:s,weekStartsOn:o,locale:n};return l.map(y=>{if(!y.isToken)return y.value;const g=y.value;(jM(g)||zM(g))&&$M(g,t,String(r));const d=vm[g[0]];return d(a,g,n.localize,u)}).join("")}function qM(r){const t=r.match(HM);return t?t[1].replace(XM,"'"):r}function QM(r,t){return qr(r*1e3,t==null?void 0:t.in)}function KM(r,t){const e=ZM(t)?new t(0):Gi(t,0);return e.setFullYear(r.getFullYear(),r.getMonth(),r.getDate()),e.setHours(r.getHours(),r.getMinutes(),r.getSeconds(),r.getMilliseconds()),e}function ZM(r){var t;return typeof r=="function"&&((t=r.prototype)==null?void 0:t.constructor)===r}function JM(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 gr(r){return r==null}function tD(r){return r!=null}async function Sh(){if(typeof window<"u"&&window!==null)return"browser";try{const r=await ln(()=>import("./__vite-browser-external-FmFgRqLi.js"),[]);return typeof r<"u"&&r.versions!=null&&r.versions.node!=null?"node":"unknown"}catch{return"unknown"}}function eD(r){return gr(r)?!1:Et.isInt(r.type)&&!cw(r)||rD(r)}function rD(r){return gr(r)?!1:Et.isInt(r.type)&&r.type.isSigned===!1}function iD(r){return gr(r)?!1:Et.isFloat(r.type)??!1}function nD(r){return gr(r)?!1:Et.isDecimal(r.type)}function sD(r){return gr(r)?!1:Et.isBool(r.type)}function oD(r){return gr(r)?!1:Et.isDuration(r.type)}function cw(r){return gr(r)?!1:Et.isInt(r.type)&&r.metadata.get("ARROW:extension:name")==="period"}function aD(r){return gr(r)?!1:Et.isTimestamp(r.type)}function lD(r){return gr(r)?!1:Et.isDate(r.type)}function uD(r){return gr(r)?!1:Et.isTime(r.type)}function cD(r){return gr(r)?!1:Et.isList(r.type)||Et.isFixedSizeList(r.type)}function hD(r){return gr(r)?!1:Et.isStruct(r.type)||Et.isMap(r.type)}function fD(r){return gr(r)?!1:Et.isStruct(r.type)&&r.metadata.get("ARROW:extension:name")==="interval"||Et.isInterval(r.type)}function dD(r,t){let e;if(t===Jt.MILLISECOND)e=1e3;else if(t===Jt.MICROSECOND)e=1e3*1e3;else if(t===Jt.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 pD(r,t){var i;const e=dD(r,((i=t==null?void 0:t.type)==null?void 0:i.unit)??Jt.SECOND);return QM(e)}function mD(r,t){const e=pD(r,t);return uw(e,e.getMilliseconds()===0?"HH:mm:ss":"HH:mm:ss.SSS")}function yD(r){const t="yyyy-MM-dd";return r instanceof Date||typeof r=="number"&&Number.isFinite(r)?uw(r,t):(console.warn(`Unsupported date value: ${r}`),String(r))}function gD(r,t){var n;if(!(r instanceof Date||typeof r=="number"&&Number.isFinite(r)))return console.warn(`Unsupported datetime value: ${r}`),null;let e;const i=(n=t==null?void 0:t.type)==null?void 0:n.timezone;return typeof r=="number"?i?e=new Er(r,i):e=new Er(r):i?e=new Er(r,i):e=new Er(r),KM(e,Date)}function vD(r,t){var a;const e=((a=t==null?void 0:t.type)==null?void 0:a.scale)||0;let i=pm.bigNumToString(new pm.BN(r)).padStart(e,"0");if(e===0)return i;let n="";i.startsWith("-")&&(n="-",i=i.slice(1));const s=i.slice(0,-e)||"0",o=JM(i.slice(-e),"0")||"";return`${n}${s}${o?`.${o}`:""}`}function _D(r){const t=r[0],e=r[1],i=[];return t!==0&&i.push(`${t} year${t>1?"s":""}`),e!==0&&i.push(`${e} month${e>1?"s":""}`),i.length?i.join(" "):"0 months"}function bD(r,t){var i,n,s,o;if(Et.isInterval(t==null?void 0:t.type))return _D(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"?"]":")",p=Th(u.left,(n=(i=t.type)==null?void 0:i.children)==null?void 0:n[0]),f=Th(u.right,(o=(s=t.type)==null?void 0:s.children)==null?void 0:o[1]);return`${c+p}, ${f+h}`}return String(r)}function wD(r,t){return(t==null?void 0:t.type)instanceof bh?JSON.parse(JSON.stringify(r,(e,i)=>{if(tD(i))return typeof i=="bigint"?Number(i):i})):JSON.parse(JSON.stringify(r,(e,i)=>typeof i=="bigint"?Number(i):i))}function Th(r,t){if(gr(r))return null;const e=r instanceof Date||Number.isFinite(r);if(e&&lD(t))return yD(r);if(typeof r=="bigint"&&uD(t))return mD(Number(r),t);if(e&&aD(t))return gD(r,t);if(cw(t))throw new Error("Period type is not supported yet");if(fD(t))return bD(r,t);if(oD(t))throw new Error("Duration type is not supported yet");return nD(t)?vD(r,t):iD(t)&&Number.isFinite(r)||eD(t)?r:hD(t)||cD(t)?wD(r,t):sD(t)?!!r:String(r)}function xm(r){return((r.toArray()||[]).map(i=>i.toJSON())||[]).map(i=>(r.schema.fields.forEach(n=>i[n.name]=Th(i[n.name],n)),i))}var ra=(r=>(r.ORIGIN_PRIVATE_FS="origin-private-fs",r.NODE_FS="node-fs",r))(ra||{});async function hw(r){const t=Cx(r,{logger:!1});let e,i;const n=await Sh();if(n==="browser"){if(typeof t.bundles>"u"){const{getBundles:l}=await ln(async()=>{const{getBundles:u}=await import("./default-browser-BrgSDbLD.js");return{getBundles:u}},[]);t.bundles=await l()}i=await kp(await t.bundles),e=new Worker(i.mainWorker)}else if(n==="node"){if(typeof t.bundles>"u"){const{getBundles:c}=await ln(async()=>{const{getBundles:h}=await import("./default-node-Bif61nM5.js");return{getBundles:h}},__vite__mapDeps([0,1,2]));t.bundles=await c()}i=await kp(await t.bundles);let l=i.mainWorker;l.startsWith("/@fs/")&&(l=l.replace("/@fs/","file://"));const u=await ln(()=>import("./index-Cp8iQ_hy.js"),[]);e=new u.default(l,{type:"module"})}else throw new Error(`Unsupported environment: ${n}`);let s;t.logger===!0?s=new I0:t.logger===!1?s=new c2:s=t.logger;const o=new g2(s,e);if(await o.instantiate(i.mainModule,i.pthreadWorker),t.storage)switch(t.storage.type){case ra.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 ra.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 f=await a.query(l);return xm(f)}const c=await a.prepare(l),h=await c.query(...u),p=xm(h);return c.close(),p},close:async()=>{await a.close(),await o.terminate(),await e.terminate()}}}async function xD(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 SD(r,t,e){await(await r).conn.send(`SAVEPOINT ${t}`);try{const i=await e(r);return await(await r).conn.send(`RELEASE SAVEPOINT ${t}`),i}catch(i){throw await(await r).conn.send(`ROLLBACK TO SAVEPOINT ${t}`),i}}const xt=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,xt))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(xt in e&&e[xt]===t[xt])return!0;e=Object.getPrototypeOf(e)}return!1}var Mm;Mm=xt;class Ke{constructor(t,e){$(this,"name");$(this,"keyAsName");$(this,"primary");$(this,"notNull");$(this,"default");$(this,"defaultFn");$(this,"onUpdateFn");$(this,"hasDefault");$(this,"isUnique");$(this,"uniqueName");$(this,"uniqueType");$(this,"dataType");$(this,"columnType");$(this,"enumValues");$(this,"generated");$(this,"generatedIdentity");$(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"}}$(Ke,Mm,"Column");const Ys=Symbol.for("drizzle:Name");function TD(r,t){return`${r[Ys]}_${t.join("_")}_unique`}var Dm,Rm;class Ar extends(Rm=Ke,Dm=xt,Rm){constructor(t,e){e.uniqueName||(e.uniqueName=TD(t,[e.name])),super(t,e),this.table=t}}$(Ar,Dm,"PgColumn");const Sm=Symbol.for("drizzle:isPgEnum");function ID(r){return!!r&&typeof r=="function"&&Sm in r&&r[Sm]===!0}var Nm;Nm=xt;class Or{constructor(t,e,i,n=!1){this._={brand:"Subquery",sql:t,selectedFields:e,alias:i,isWith:n}}}$(Or,Nm,"Subquery");var Lm,Bm;class jf extends(Bm=Or,Lm=xt,Bm){}$(jf,Lm,"WithSubquery");const Pr={startActiveSpan(r,t){return t()}},He=Symbol.for("drizzle:ViewBaseConfig"),Qa=Symbol.for("drizzle:Schema"),Ih=Symbol.for("drizzle:Columns"),Tm=Symbol.for("drizzle:ExtraConfigColumns"),sc=Symbol.for("drizzle:OriginalName"),oc=Symbol.for("drizzle:BaseName"),zl=Symbol.for("drizzle:IsAlias"),Im=Symbol.for("drizzle:ExtraConfigBuilder"),ED=Symbol.for("drizzle:IsDrizzleTable");var km,Um,zm,jm,$m,Vm,Gm,Wm,Hm,Xm;Xm=xt,Hm=Ys,Wm=sc,Gm=Qa,Vm=Ih,$m=Tm,jm=oc,zm=zl,Um=ED,km=Im;class Tt{constructor(t,e,i){$(this,Hm);$(this,Wm);$(this,Gm);$(this,Vm);$(this,$m);$(this,jm);$(this,zm,!1);$(this,Um,!0);$(this,km);this[Ys]=this[sc]=t,this[Qa]=e,this[oc]=i}}$(Tt,Xm,"Table"),$(Tt,"Symbol",{Name:Ys,Schema:Qa,OriginalName:sc,Columns:Ih,ExtraConfigColumns:Tm,BaseName:oc,IsAlias:zl,ExtraConfigBuilder:Im});function qn(r){return r[Ys]}function ia(r){return`${r[Qa]??"public"}.${r[Ys]}`}function fw(r){return r!=null&&typeof r.getSQL=="function"}function CD(r){var e;const t={sql:"",params:[]};for(const i of r)t.sql+=i.sql,t.params.push(...i.params),(e=i.typings)!=null&&e.length&&(t.typings||(t.typings=[]),t.typings.push(...i.typings));return t}var Ym;Ym=xt;class Xe{constructor(t){$(this,"value");this.value=Array.isArray(t)?t:[t]}getSQL(){return new Ft([this])}}$(Xe,Ym,"StringChunk");var qm;qm=xt;const Hn=class Hn{constructor(t){$(this,"decoder",dw);$(this,"shouldInlineParams",!1);this.queryChunks=t}append(t){return this.queryChunks.push(...t.queryChunks),this}toQuery(t){return Pr.startActiveSpan("drizzle.buildSQL",e=>{const i=this.buildQueryFromSourceParams(this.queryChunks,t);return e==null||e.setAttributes({"drizzle.query.text":i.sql,"drizzle.query.params":JSON.stringify(i.params)}),i})}buildQueryFromSourceParams(t,e){const i=Object.assign({},e,{inlineParams:e.inlineParams||this.shouldInlineParams,paramStartIndex:e.paramStartIndex||{value:0}}),{casing:n,escapeName:s,escapeParam:o,prepareTyping:a,inlineParams:l,paramStartIndex:u}=i;return CD(t.map(c=>{var h;if(lt(c,Xe))return{sql:c.value.join(""),params:[]};if(lt(c,jl))return{sql:s(c.value),params:[]};if(c===void 0)return{sql:"",params:[]};if(Array.isArray(c)){const p=[new Xe("(")];for(const[f,y]of c.entries())p.push(y),fr},pw={mapToDriverValue:r=>r};({...dw,...pw});var Km;Km=xt;class Wi{constructor(t,e=pw){$(this,"brand");this.value=t,this.encoder=e}getSQL(){return new Ft([this])}}$(Wi,Km,"Param");function H(r,...t){const e=[];(t.length>0||r.length>0&&r[0]!=="")&&e.push(new Xe(r[0]));for(const[i,n]of t.entries())e.push(n,new Xe(r[i+1]));return new Ft(e)}(r=>{function t(){return new Ft([])}r.empty=t;function e(l){return new Ft(l)}r.fromList=e;function i(l){return new Ft([new Xe(l)])}r.raw=i;function n(l,u){const c=[];for(const[h,p]of l.entries())h>0&&u!==void 0&&c.push(u),c.push(p);return new Ft(c)}r.join=n;function s(l){return new jl(l)}r.identifier=s;function o(l){return new ss(l)}r.placeholder=o;function a(l,u){return new Wi(l,u)}r.param=a})(H||(H={}));(r=>{var e;e=xt;const i=class i{constructor(s,o){$(this,"isSelectionField",!1);this.sql=s,this.fieldAlias=o}getSQL(){return this.sql}clone(){return new i(this.sql,this.fieldAlias)}};$(i,e,"SQL.Aliased");let t=i;r.Aliased=t})(Ft||(Ft={}));var Zm;Zm=xt;class ss{constructor(t){this.name=t}getSQL(){return new Ft([this])}}$(ss,Zm,"Placeholder");function Em(r,t){return r.map(e=>{if(lt(e,ss)){if(!(e.name in t))throw new Error(`No value for placeholder "${e.name}" was provided`);return t[e.name]}if(lt(e,Wi)&<(e.value,ss)){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 OD=Symbol.for("drizzle:IsDrizzleView");var Jm,ty,ey;ey=xt,ty=He,Jm=OD;class Sn{constructor({name:t,schema:e,selectedFields:i,query:n}){$(this,ty);$(this,Jm,!0);this[He]={name:t,originalName:t,schema:e,selectedFields:i,query:n,isExisting:!n,isAlias:!1}}getSQL(){return new Ft([this])}}$(Sn,ey,"View");Ke.prototype.getSQL=function(){return new Ft([this])};Tt.prototype.getSQL=function(){return new Ft([this])};Or.prototype.getSQL=function(){return new Ft([this])};var ry;ry=xt;class na{constructor(t){this.table=t}get(t,e){return e==="table"?this.table:t[e]}}$(na,ry,"ColumnAliasProxyHandler");var iy;iy=xt;class cu{constructor(t,e){this.alias=t,this.replaceOriginalName=e}get(t,e){if(e===Tt.Symbol.IsAlias)return!0;if(e===Tt.Symbol.Name)return this.alias;if(this.replaceOriginalName&&e===Tt.Symbol.OriginalName)return this.alias;if(e===He)return{...t[He],name:this.alias,isAlias:!0};if(e===Tt.Symbol.Columns){const n=t[Tt.Symbol.Columns];if(!n)return n;const s={};return Object.keys(n).map(o=>{s[o]=new Proxy(n[o],new na(new Proxy(t,this)))}),s}const i=t[e];return lt(i,Ke)?new Proxy(i,new na(new Proxy(t,this))):i}}$(cu,iy,"TableAliasProxyHandler");function ac(r,t){return new Proxy(r,new cu(t,!1))}function Li(r,t){return new Proxy(r,new na(new Proxy(r.table,new cu(t,!1))))}function mw(r,t){return new Ft.Aliased($l(r.sql,t),r.fieldAlias)}function $l(r,t){return H.join(r.queryChunks.map(e=>lt(e,Ke)?Li(e,t):lt(e,Ft)?$l(e,t):lt(e,Ft.Aliased)?mw(e,t):e))}var ny,sy;class $f extends(sy=Error,ny=xt,sy){constructor({message:t,cause:e}){super(t),this.name="DrizzleError",this.cause=e}}$($f,ny,"DrizzleError");var oy,ay;class yw extends(ay=$f,oy=xt,ay){constructor(){super({message:"Rollback"})}}$(yw,oy,"TransactionRollbackError");var ly;ly=xt;class gw{write(t){console.log(t)}}$(gw,ly,"ConsoleLogWriter");var uy;uy=xt;class vw{constructor(t){$(this,"writer");this.writer=(t==null?void 0:t.writer)??new gw}logQuery(t,e){const i=e.map(s=>{try{return JSON.stringify(s)}catch{return String(s)}}),n=i.length?` -- params: [${i.join(", ")}]`:"";this.writer.write(`Query: ${t}${n}`)}}$(vw,uy,"DefaultLogger");var cy;cy=xt;class _w{logQuery(){}}$(_w,cy,"NoopLogger");var hy,fy;fy=xt,hy=Symbol.toStringTag;class Tn{constructor(){$(this,hy,"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)}}$(Tn,fy,"QueryPromise");function os(r,t){return Object.entries(r).reduce((e,[i,n])=>{if(typeof i!="string")return e;const s=t?[...t,i]:[i];return lt(n,Ke)||lt(n,Ft)||lt(n,Ft.Aliased)?e.push({path:s,field:n}):lt(n,Tt)?e.push(...os(n[Tt.Symbol.Columns],s)):e.push(...os(n,s)),e},[])}function Vf(r,t){const e=Object.keys(r),i=Object.keys(t);if(e.length!==i.length)return!1;for(const[n,s]of e.entries())if(s!==i[n])return!1;return!0}function bw(r,t){const e=Object.entries(t).filter(([,i])=>i!==void 0).map(([i,n])=>lt(n,Ft)||lt(n,Ke)?[i,n]:[i,new Wi(n,r[Tt.Symbol.Columns][i])]);if(e.length===0)throw new Error("No values to set");return Object.fromEntries(e)}function FD(r,t){for(const e of t)for(const i of Object.getOwnPropertyNames(e.prototype))i!=="constructor"&&Object.defineProperty(r.prototype,i,Object.getOwnPropertyDescriptor(e.prototype,i)||Object.create(null))}function PD(r){return r[Tt.Symbol.Columns]}function Wn(r){return lt(r,Or)?r._.alias:lt(r,Sn)?r[He].name:lt(r,Ft)?void 0:r[Tt.Symbol.IsAlias]?r[Tt.Symbol.Name]:r[Tt.Symbol.BaseName]}function MD(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 dy,py;class ww extends(py=Ar,dy=xt,py){getSQLType(){return"date"}mapFromDriverValue(t){return new Date(t)}mapToDriverValue(t){return t.toISOString()}}$(ww,dy,"PgDate");var my,yy;class xw extends(yy=Ar,my=xt,yy){getSQLType(){return"date"}}$(xw,my,"PgDateString");var gy,vy;class Sw extends(vy=Ar,gy=xt,vy){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}}$(Sw,gy,"PgJson");var _y,by;class Tw extends(by=Ar,_y=xt,by){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}}$(Tw,_y,"PgJsonb");var wy,xy;class Iw extends(xy=Ar,wy=xt,xy){constructor(e,i){super(e,i);$(this,"precision");$(this,"scale");this.precision=i.precision,this.scale=i.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})`}}$(Iw,wy,"PgNumeric");var Sy,Ty;class Ew extends(Ty=Ar,Sy=xt,Ty){constructor(e,i){super(e,i);$(this,"withTimezone");$(this,"precision");this.withTimezone=i.withTimezone,this.precision=i.precision}getSQLType(){return`time${this.precision===void 0?"":`(${this.precision})`}${this.withTimezone?" with time zone":""}`}}$(Ew,Sy,"PgTime");var Iy,Ey;class Cw extends(Ey=Ar,Iy=xt,Ey){constructor(e,i){super(e,i);$(this,"withTimezone");$(this,"precision");$(this,"mapFromDriverValue",e=>new Date(this.withTimezone?e:e+"+0000"));$(this,"mapToDriverValue",e=>e.toISOString());this.withTimezone=i.withTimezone,this.precision=i.precision}getSQLType(){return`timestamp${this.precision===void 0?"":` (${this.precision})`}${this.withTimezone?" with time zone":""}`}}$(Cw,Iy,"PgTimestamp");var Cy,Ay;class Aw extends(Ay=Ar,Cy=xt,Ay){constructor(e,i){super(e,i);$(this,"withTimezone");$(this,"precision");this.withTimezone=i.withTimezone,this.precision=i.precision}getSQLType(){return`timestamp${this.precision===void 0?"":`(${this.precision})`}${this.withTimezone?" with time zone":""}`}}$(Aw,Cy,"PgTimestampString");var Oy,Fy;class Ow extends(Fy=Ar,Oy=xt,Fy){getSQLType(){return"uuid"}}$(Ow,Oy,"PgUUID");const Cm=Symbol.for("drizzle:PgInlineForeignKeys"),Am=Symbol.for("drizzle:EnableRLS");var Py,My,Dy,Ry,Ny,Ly;class Br extends(Ly=Tt,Ny=xt,Ry=Cm,Dy=Am,My=Tt.Symbol.ExtraConfigBuilder,Py=Tt.Symbol.ExtraConfigColumns,Ly){constructor(){super(...arguments);$(this,Ry,[]);$(this,Dy,!1);$(this,My);$(this,Py,{})}}$(Br,Ny,"PgTable"),$(Br,"Symbol",Object.assign({},Tt.Symbol,{InlineForeignKeys:Cm,EnableRLS:Am}));var By;By=xt;class Fw{constructor(t,e){$(this,"columns");$(this,"name");this.columns=t,this.name=e}build(t){return new Pw(t,this.columns,this.name)}}$(Fw,By,"PgPrimaryKeyBuilder");var ky;ky=xt;class Pw{constructor(t,e,i){$(this,"columns");$(this,"name");this.table=t,this.columns=e,this.name=i}getName(){return this.name??`${this.table[Br.Symbol.Name]}_${this.columns.map(t=>t.name).join("_")}_pk`}}$(Pw,ky,"PgPrimaryKey");function yr(r,t){return AD(t)&&!fw(r)&&!lt(r,Wi)&&!lt(r,ss)&&!lt(r,Ke)&&!lt(r,Tt)&&!lt(r,Sn)?new Wi(r,t):r}const Mw=(r,t)=>H`${r} = ${yr(t,r)}`,DD=(r,t)=>H`${r} <> ${yr(t,r)}`;function Eh(...r){const t=r.filter(e=>e!==void 0);if(t.length!==0)return t.length===1?new Ft(t):new Ft([new Xe("("),H.join(t,new Xe(" and ")),new Xe(")")])}function RD(...r){const t=r.filter(e=>e!==void 0);if(t.length!==0)return t.length===1?new Ft(t):new Ft([new Xe("("),H.join(t,new Xe(" or ")),new Xe(")")])}function ND(r){return H`not ${r}`}const LD=(r,t)=>H`${r} > ${yr(t,r)}`,BD=(r,t)=>H`${r} >= ${yr(t,r)}`,kD=(r,t)=>H`${r} < ${yr(t,r)}`,UD=(r,t)=>H`${r} <= ${yr(t,r)}`;function zD(r,t){return Array.isArray(t)?t.length===0?H`false`:H`${r} in ${t.map(e=>yr(e,r))}`:H`${r} in ${yr(t,r)}`}function jD(r,t){return Array.isArray(t)?t.length===0?H`true`:H`${r} not in ${t.map(e=>yr(e,r))}`:H`${r} not in ${yr(t,r)}`}function $D(r){return H`${r} is null`}function VD(r){return H`${r} is not null`}function GD(r){return H`exists ${r}`}function WD(r){return H`not exists ${r}`}function HD(r,t,e){return H`${r} between ${yr(t,r)} and ${yr(e,r)}`}function XD(r,t,e){return H`${r} not between ${yr(t,r)} and ${yr(e,r)}`}function YD(r,t){return H`${r} like ${t}`}function qD(r,t){return H`${r} not like ${t}`}function QD(r,t){return H`${r} ilike ${t}`}function KD(r,t){return H`${r} not ilike ${t}`}function ZD(r){return H`${r} asc`}function JD(r){return H`${r} desc`}var Uy;Uy=xt;class Gf{constructor(t,e,i){$(this,"referencedTableName");$(this,"fieldName");this.sourceTable=t,this.referencedTable=e,this.relationName=i,this.referencedTableName=e[Tt.Symbol.Name]}}$(Gf,Uy,"Relation");var zy;zy=xt;class Dw{constructor(t,e){this.table=t,this.config=e}}$(Dw,zy,"Relations");var jy,$y;const Wl=class Wl extends($y=Gf,jy=xt,$y){constructor(t,e,i,n){super(t,e,i==null?void 0:i.relationName),this.config=i,this.isNullable=n}withFieldName(t){const e=new Wl(this.sourceTable,this.referencedTable,this.config,this.isNullable);return e.fieldName=t,e}};$(Wl,jy,"One");let as=Wl;var Vy,Gy;const Hl=class Hl extends(Gy=Gf,Vy=xt,Gy){constructor(t,e,i){super(t,e,i==null?void 0:i.relationName),this.config=i}withFieldName(t){const e=new Hl(this.sourceTable,this.referencedTable,this.config);return e.fieldName=t,e}};$(Hl,Vy,"Many");let Vl=Hl;function tR(){return{and:Eh,between:HD,eq:Mw,exists:GD,gt:LD,gte:BD,ilike:QD,inArray:zD,isNull:$D,isNotNull:VD,like:YD,lt:kD,lte:UD,ne:DD,not:ND,notBetween:XD,notExists:WD,notLike:qD,notIlike:KD,notInArray:jD,or:RD,sql:H}}function eR(){return{sql:H,asc:ZD,desc:JD}}function rR(r,t){var s;Object.keys(r).length===1&&"default"in r&&!lt(r.default,Tt)&&(r=r.default);const e={},i={},n={};for(const[o,a]of Object.entries(r))if(lt(a,Tt)){const l=ia(a),u=i[l];e[l]=o,n[o]={tsName:o,dbName:a[Tt.Symbol.Name],schema:a[Tt.Symbol.Schema],columns:a[Tt.Symbol.Columns],relations:(u==null?void 0:u.relations)??{},primaryKey:(u==null?void 0:u.primaryKey)??[]};for(const h of Object.values(a[Tt.Symbol.Columns]))h.primary&&n[o].primaryKey.push(h);const c=(s=a[Tt.Symbol.ExtraConfigBuilder])==null?void 0:s.call(a,a[Tt.Symbol.ExtraConfigColumns]);if(c)for(const h of Object.values(c))lt(h,Fw)&&n[o].primaryKey.push(...h.columns)}else if(lt(a,Dw)){const l=ia(a.table),u=e[l],c=a.config(t(a.table));let h;for(const[p,f]of Object.entries(c))if(u){const y=n[u];y.relations[p]=f}else l in i||(i[l]={relations:{},primaryKey:h}),i[l].relations[p]=f}return{tables:n,tableNamesMap:e}}function iR(r){return function(e,i){return new as(r,e,i,(i==null?void 0:i.fields.reduce((n,s)=>n&&s.notNull,!0))??!1)}}function nR(r){return function(e,i){return new Vl(r,e,i)}}function sR(r,t,e){if(lt(e,as)&&e.config)return{fields:e.config.fields,references:e.config.references};const i=t[ia(e.referencedTable)];if(!i)throw new Error(`Table "${e.referencedTable[Tt.Symbol.Name]}" not found in schema`);const n=r[i];if(!n)throw new Error(`Table "${i}" not found in schema`);const s=e.sourceTable,o=t[ia(s)];if(!o)throw new Error(`Table "${s[Tt.Symbol.Name]}" not found in schema`);const a=[];for(const l of Object.values(n.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 "${i}"`):new Error(`There are multiple relations between "${i}" and "${e.sourceTable[Tt.Symbol.Name]}". Please specify relation name`);if(a[0]&<(a[0],as)&&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 oR(r){return{one:iR(r),many:nR(r)}}function Ch(r,t,e,i,n=s=>s){const s={};for(const[o,a]of i.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,as)?c&&Ch(r,r[a.relationTableTsKey],c,a.selection,n):c.map(h=>Ch(r,r[a.relationTableTsKey],h,a.selection,n))}else{const l=n(e[o]),u=a.field;let c;lt(u,Ke)?c=u:lt(u,Ft)?c=u.decoder:c=u.sql.decoder,s[a.tsKey]=l===null?null:c.mapFromDriverValue(l)}return s}var Wy;Wy=xt;const Xl=class Xl{constructor(t){$(this,"config");this.config={...t}}get(t,e){if(e==="_")return{...t._,selectedFields:new Proxy(t._.selectedFields,this)};if(e===He)return{...t[He],selectedFields:new Proxy(t[He].selectedFields,this)};if(typeof e=="symbol")return t[e];const n=(lt(t,Or)?t._.selectedFields:lt(t,Sn)?t[He].selectedFields:t)[e];if(lt(n,Ft.Aliased)){if(this.config.sqlAliasedBehavior==="sql"&&!n.isSelectionField)return n.sql;const s=n.clone();return s.isSelectionField=!0,s}if(lt(n,Ft)){if(this.config.sqlBehavior==="sql")return n;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(n,Ke)?this.config.alias?new Proxy(n,new na(new Proxy(n.table,new cu(this.config.alias,this.config.replaceOriginalName??!1)))):n:typeof n!="object"||n===null?n:new Proxy(n,new Xl(this.config))}};$(Xl,Wy,"SelectionProxyHandler");let Je=Xl;var Hy,Xy;class Ah extends(Xy=Tn,Hy=xt,Xy){constructor(e,i,n,s){super();$(this,"config");$(this,"authToken");$(this,"execute",e=>Pr.startActiveSpan("drizzle.operation",()=>this._prepare().execute(e,this.authToken)));this.session=i,this.dialect=n,this.config={table:e,withList:s}}where(e){return this.config.where=e,this}returning(e=this.config.table[Tt.Symbol.Columns]){return this.config.returningFields=e,this.config.returning=os(e),this}getSQL(){return this.dialect.buildDeleteQuery(this.config)}toSQL(){const{typings:e,...i}=this.dialect.sqlToQuery(this.getSQL());return i}_prepare(e){return Pr.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 Je({alias:qn(this.config.table),sqlAliasedBehavior:"alias",sqlBehavior:"error"})):void 0}$dynamic(){return this}}$(Ah,Hy,"PgDelete");function aR(r){return(r.replace(/['\u2019]/g,"").match(/[\da-z]+|[A-Z]+(?![a-z])|[A-Z][\da-z]+/g)??[]).map(e=>e.toLowerCase()).join("_")}function lR(r){return(r.replace(/['\u2019]/g,"").match(/[\da-z]+|[A-Z]+(?![a-z])|[A-Z][\da-z]+/g)??[]).reduce((e,i,n)=>{const s=n===0?i.toLowerCase():`${i[0].toUpperCase()}${i.slice(1)}`;return e+s},"")}function uR(r){return r}var Yy;Yy=xt;class Rw{constructor(t){$(this,"cache",{});$(this,"cachedTables",{});$(this,"convert");this.convert=t==="snake_case"?aR:t==="camelCase"?lR:uR}getColumnCasing(t){if(!t.keyAsName)return t.name;const e=t.table[Tt.Symbol.Schema]??"public",i=t.table[Tt.Symbol.OriginalName],n=`${e}.${i}.${t.name}`;return this.cache[n]||this.cacheTable(t.table),this.cache[n]}cacheTable(t){const e=t[Tt.Symbol.Schema]??"public",i=t[Tt.Symbol.OriginalName],n=`${e}.${i}`;if(!this.cachedTables[n]){for(const s of Object.values(t[Tt.Symbol.Columns])){const o=`${n}.${s.name}`;this.cache[o]=this.convert(s.name)}this.cachedTables[n]=!0}}clearCache(){this.cache={},this.cachedTables={}}}$(Rw,Yy,"CasingCache");var qy,Qy;class Wf extends(Qy=Sn,qy=xt,Qy){}$(Wf,qy,"PgViewBase");var Ky;Ky=xt;class Bo{constructor(t){$(this,"casing");this.casing=new Rw(t==null?void 0:t.casing)}async migrate(t,e,i){const n=typeof i=="string"?"__drizzle_migrations":i.migrationsTable??"__drizzle_migrations",s=typeof i=="string"?"drizzle":i.migrationsSchema??"drizzle",o=H` CREATE TABLE IF NOT EXISTS ${H.identifier(s)}.${H.identifier(n)} ( id SERIAL PRIMARY KEY, hash text NOT NULL, created_at bigint ) - `;await e.execute(H`CREATE SCHEMA IF NOT EXISTS ${H.identifier(s)}`),await e.execute(o);const l=(await e.all(H`select id, hash, created_at from ${H.identifier(s)}.${H.identifier(n)} 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=i[o])==null?void 0:a.onUpdateFn)!==void 0}),s=n.length;return H.join(n.flatMap((o,a)=>{const l=i[o],u=e[o]??H.param(l.onUpdateFn(),l),c=H`${H.identifier(this.casing.getColumnCasing(l))} = ${u}`;return a{const a=[];if(lt(s,Ft.Aliased)&&s.isSelectionField)a.push(H.identifier(s.fieldAlias));else if(lt(s,Ft.Aliased)||lt(s,Ft)){const l=lt(s,Ft.Aliased)?s.sql:s;e?a.push(new Ft(l.queryChunks.map(u=>lt(u,Ar)?H.identifier(this.casing.getColumnCasing(u)):u))):a.push(l),lt(s,Ft.Aliased)&&a.push(H` as ${H.identifier(s.fieldAlias)}`)}else lt(s,Ke)&&(e?a.push(H.identifier(this.casing.getColumnCasing(s))):a.push(s));return oa==null?void 0:a.some(({alias:M})=>M===(it[Tt.Symbol.IsAlias]?qn(it):it[Tt.Symbol.BaseName])))(w.field.table)){const it=qn(w.field.table);throw new Error(`Your "${w.path.join("->")}" field references a column "${it}"."${w.field.name}", but the table "${it}" is not part of the query! Did you forget to join it?`)}const d=!a||a.length===0,m=this.buildWithCTE(t);let _;f&&(_=f===!0?H` distinct`:H` distinct on (${H.join(f.on,H`, `)})`);const S=this.buildSelection(g,{isSingleTable:d}),E=this.buildFromTable(o),b=this.buildJoins(a),F=n?H` where ${n}`:void 0,x=s?H` having ${s}`:void 0;let z;l&&l.length>0&&(z=H` order by ${H.join(l,H`, `)}`);let B;u&&u.length>0&&(B=H` group by ${H.join(u,H`, `)}`);const tt=typeof c=="object"||typeof c=="number"&&c>=0?H` limit ${c}`:void 0,st=h?H` offset ${h}`:void 0,I=H.empty();if(p){const w=H` for ${H.raw(p.strength)}`;p.config.of&&w.append(H` of ${H.join(Array.isArray(p.config.of)?p.config.of:[p.config.of],H`, `)}`),p.config.noWait?w.append(H` nowait`):p.config.skipLocked&&w.append(H` skip locked`),I.append(w)}const Z=H`${m}select${_} ${S} from ${E}${b}${F}${B}${x}${z}${tt}${st}${I}`;return y.length>0?this.buildSetOperations(Z,y):Z}buildSetOperations(t,e){const[i,...n]=e;if(!i)throw new Error("Cannot pass undefined values to any set operator");return n.length===0?this.buildSetOperationQuery({leftSelect:t,setOperator:i}):this.buildSetOperations(this.buildSetOperationQuery({leftSelect:t,setOperator:i}),n)}buildSetOperationQuery({leftSelect:t,setOperator:{type:e,isAll:i,rightSelect:n,limit:s,orderBy:o,offset:a}}){const l=H`(${t.getSQL()}) `,u=H`(${n.getSQL()})`;let c;if(o&&o.length>0){const y=[];for(const g of o)if(lt(g,Ar))y.push(H.identifier(g.name));else if(lt(g,Ft)){for(let d=0;d=0?H` limit ${s}`:void 0,p=H.raw(`${e} ${i?"all ":""}`),f=a?H` offset ${a}`:void 0;return H`${l}${p}${u}${c}${h}${f}`}buildInsertQuery({table:t,values:e,onConflict:i,returning:n,withList:s,select:o,overridingSystemValue_:a}){const l=[],u=t[Tt.Symbol.Columns],c=Object.entries(u).filter(([m,_])=>!_.shouldDisableInsert()),h=c.map(([,m])=>H.identifier(this.casing.getColumnCasing(m)));if(o){const m=e;lt(m,Ft)?l.push(m):l.push(m.getSQL())}else{const m=e;l.push(H.raw("values "));for(const[_,S]of m.entries()){const E=[];for(const[b,F]of c){const x=S[b];if(x===void 0||lt(x,Wi)&&x.value===void 0)if(F.defaultFn!==void 0){const z=F.defaultFn(),B=lt(z,Ft)?z:H.param(z,F);E.push(B)}else if(!F.default&&F.onUpdateFn!==void 0){const z=F.onUpdateFn(),B=lt(z,Ft)?z:H.param(z,F);E.push(B)}else E.push(H`default`);else E.push(x)}l.push(E),_({dbKey:S.name,tsKey:_,field:Li(S,a),relationTableTsKey:void 0,isJson:!1,selection:[]}));else{const m=Object.fromEntries(Object.entries(s.columns).map(([x,z])=>[x,Li(z,a)]));if(o.where){const x=typeof o.where=="function"?o.where(m,tR()):o.where;y=x&&$l(x,a)}const _=[];let S=[];if(o.columns){let x=!1;for(const[z,B]of Object.entries(o.columns))B!==void 0&&z in s.columns&&(!x&&B===!0&&(x=!0),S.push(z));S.length>0&&(S=x?S.filter(z=>{var B;return((B=o.columns)==null?void 0:B[z])===!0}):Object.keys(s.columns).filter(z=>!S.includes(z)))}else S=Object.keys(s.columns);for(const x of S){const z=s.columns[x];_.push({tsKey:x,value:z})}let E=[];o.with&&(E=Object.entries(o.with).filter(x=>!!x[1]).map(([x,z])=>({tsKey:x,queryConfig:z,relation:s.relations[x]})));let b;if(o.extras){b=typeof o.extras=="function"?o.extras(m,{sql:H}):o.extras;for(const[x,z]of Object.entries(b))_.push({tsKey:x,value:mw(z,a)})}for(const{tsKey:x,value:z}of _)c.push({dbKey:lt(z,Ft.Aliased)?z.fieldAlias:s.columns[x].name,tsKey:x,field:lt(z,Ke)?Li(z,a):z,relationTableTsKey:void 0,isJson:!1,selection:[]});let F=typeof o.orderBy=="function"?o.orderBy(m,eR()):o.orderBy??[];Array.isArray(F)||(F=[F]),f=F.map(x=>lt(x,Ke)?Li(x,a):$l(x,a)),h=o.limit,p=o.offset;for(const{tsKey:x,queryConfig:z,relation:B}of E){const tt=sR(e,i,B),st=ia(B.referencedTable),I=i[st],Z=`${a}_${x}`,w=Eh(...tt.fields.map((O,D)=>Mw(Li(tt.references[D],Z),Li(O,a)))),it=this.buildRelationalQueryWithoutPK({fullSchema:t,schema:e,tableNamesMap:i,table:t[I],tableConfig:e[I],queryConfig:lt(B,as)?z===!0?{limit:1}:{...z,limit:1}:z,tableAlias:Z,joinOn:w,nestedQueryRelation:B}),M=H`${H.identifier(Z)}.${H.identifier("data")}`.as(x);g.push({on:H`true`,table:new Or(it.sql,{},Z),alias:Z,joinType:"left",lateral:!0}),c.push({dbKey:x,tsKey:x,field:M,relationTableTsKey:I,isJson:!0,selection:it.selection})}}if(c.length===0)throw new $f({message:`No fields selected for table "${s.tsName}" ("${a}")`});let d;if(y=Eh(u,y),l){let m=H`json_build_array(${H.join(c.map(({field:E,tsKey:b,isJson:F})=>F?H`${H.identifier(`${a}_${b}`)}.${H.identifier("data")}`:lt(E,Ft.Aliased)?E.sql:E),H`, `)})`;lt(l,Vl)&&(m=H`coalesce(json_agg(${m}${f.length>0?H` order by ${H.join(f,H`, `)}`:void 0}), '[]'::json)`);const _=[{dbKey:"data",tsKey:"data",field:m.as("data"),isJson:!0,relationTableTsKey:s.tsName,selection:c}];h!==void 0||p!==void 0||f.length>0?(d=this.buildSelectQuery({table:ac(n,a),fields:{},fieldsFlat:[{path:[],field:H.raw("*")}],where:y,limit:h,offset:p,orderBy:f,setOperators:[]}),y=void 0,h=void 0,p=void 0,f=[]):d=ac(n,a),d=this.buildSelectQuery({table:lt(d,Br)?d:new Or(d,{},a),fields:{},fieldsFlat:_.map(({field:E})=>({path:[],field:lt(E,Ke)?Li(E,a):E})),joins:g,where:y,limit:h,offset:p,orderBy:f,setOperators:[]})}else d=this.buildSelectQuery({table:ac(n,a),fields:{},fieldsFlat:c.map(({field:m})=>({path:[],field:lt(m,Ke)?Li(m,a):m})),joins:g,where:y,limit:h,offset:p,orderBy:f,setOperators:[]});return{tableTsKey:s.tsName,sql:d,selection:c}}}$(Bo,Ky,"PgDialect");var Zy;Zy=xt;class Nw{getSelectedFields(){return this._.selectedFields}}$(Nw,Zy,"TypedQueryBuilder");var Jy;Jy=xt;class Sr{constructor(t){$(this,"fields");$(this,"session");$(this,"dialect");$(this,"withList",[]);$(this,"distinct");$(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,i=t;let n;return this.fields?n=this.fields:lt(i,Or)?n=Object.fromEntries(Object.keys(i._.selectedFields).map(s=>[s,i[s]])):lt(i,Wf)?n=i[He].selectedFields:lt(i,Ft)?n={}:n=PD(i),new Hf({table:i,fields:n,isPartialSelect:e,session:this.session,dialect:this.dialect,withList:this.withList,distinct:this.distinct}).setToken(this.authToken)}}$(Sr,Jy,"PgSelectBuilder");var tg,eg;class Lw extends(eg=Nw,tg=xt,eg){constructor({table:e,fields:i,isPartialSelect:n,session:s,dialect:o,withList:a,distinct:l}){super();$(this,"_");$(this,"config");$(this,"joinsNotNullableMap");$(this,"tableName");$(this,"isPartialSelect");$(this,"session");$(this,"dialect");$(this,"leftJoin",this.createJoin("left",!1));$(this,"leftJoinLateral",this.createJoin("left",!0));$(this,"rightJoin",this.createJoin("right",!1));$(this,"innerJoin",this.createJoin("inner",!1));$(this,"innerJoinLateral",this.createJoin("inner",!0));$(this,"fullJoin",this.createJoin("full",!1));$(this,"crossJoin",this.createJoin("cross",!1));$(this,"crossJoinLateral",this.createJoin("cross",!0));$(this,"union",this.createSetOperator("union",!1));$(this,"unionAll",this.createSetOperator("union",!0));$(this,"intersect",this.createSetOperator("intersect",!1));$(this,"intersectAll",this.createSetOperator("intersect",!0));$(this,"except",this.createSetOperator("except",!1));$(this,"exceptAll",this.createSetOperator("except",!0));this.config={withList:a,table:e,fields:{...i},distinct:l,setOperators:[]},this.isPartialSelect=n,this.session=s,this.dialect=o,this._={selectedFields:i},this.tableName=Wn(e),this.joinsNotNullableMap=typeof this.tableName=="string"?{[this.tableName]:!0}:{}}createJoin(e,i){return(n,s)=>{var l;const o=this.tableName,a=Wn(n);if(typeof a=="string"&&((l=this.config.joins)!=null&&l.some(u=>u.alias===a)))throw new Error(`Alias "${a}" is already used in this query`);if(!this.isPartialSelect&&(Object.keys(this.joinsNotNullableMap).length===1&&typeof o=="string"&&(this.config.fields={[o]:this.config.fields}),typeof a=="string"&&!lt(n,Ft))){const u=lt(n,Or)?n._.selectedFields:lt(n,Sn)?n[He].selectedFields:n[Tt.Symbol.Columns];this.config.fields[a]=u}if(typeof s=="function"&&(s=s(new Proxy(this.config.fields,new Je({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})))),this.config.joins||(this.config.joins=[]),this.config.joins.push({on:s,table:n,joinType:e,alias:a,lateral:i}),typeof a=="string")switch(e){case"left":{this.joinsNotNullableMap[a]=!1;break}case"right":{this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([u])=>[u,!1])),this.joinsNotNullableMap[a]=!0;break}case"cross":case"inner":{this.joinsNotNullableMap[a]=!0;break}case"full":{this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([u])=>[u,!1])),this.joinsNotNullableMap[a]=!1;break}}return this}}createSetOperator(e,i){return n=>{const s=typeof n=="function"?n(cR()):n;if(!Vf(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:i,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 Je({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})))),this.config.where=e,this}having(e){return typeof e=="function"&&(e=e(new Proxy(this.config.fields,new Je({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})))),this.config.having=e,this}groupBy(...e){if(typeof e[0]=="function"){const i=e[0](new Proxy(this.config.fields,new Je({sqlAliasedBehavior:"alias",sqlBehavior:"sql"})));this.config.groupBy=Array.isArray(i)?i:[i]}else this.config.groupBy=e;return this}orderBy(...e){if(typeof e[0]=="function"){const i=e[0](new Proxy(this.config.fields,new Je({sqlAliasedBehavior:"alias",sqlBehavior:"sql"}))),n=Array.isArray(i)?i:[i];this.config.setOperators.length>0?this.config.setOperators.at(-1).orderBy=n:this.config.orderBy=n}else{const i=e;this.config.setOperators.length>0?this.config.setOperators.at(-1).orderBy=i:this.config.orderBy=i}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,i={}){return this.config.lockingClause={strength:e,config:i},this}getSQL(){return this.dialect.buildSelectQuery(this.config)}toSQL(){const{typings:e,...i}=this.dialect.sqlToQuery(this.getSQL());return i}as(e){return new Proxy(new Or(this.getSQL(),this.config.fields,e),new Je({alias:e,sqlAliasedBehavior:"alias",sqlBehavior:"error"}))}getSelectedFields(){return new Proxy(this.config.fields,new Je({alias:this.tableName,sqlAliasedBehavior:"alias",sqlBehavior:"error"}))}$dynamic(){return this}}$(Lw,tg,"PgSelectQueryBuilder");var rg,ig;class Hf extends(ig=Lw,rg=xt,ig){constructor(){super(...arguments);$(this,"authToken");$(this,"execute",e=>Pr.startActiveSpan("drizzle.operation",()=>this._prepare().execute(e,this.authToken)))}_prepare(e){const{session:i,config:n,dialect:s,joinsNotNullableMap:o,authToken:a}=this;if(!i)throw new Error("Cannot execute a query on a query builder. Please use a database instance instead.");return Pr.startActiveSpan("drizzle.prepareQuery",()=>{const l=os(n.fields),u=i.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}}$(Hf,rg,"PgSelect");FD(Hf,[Tn]);function oo(r,t){return(e,i,...n)=>{const s=[i,...n].map(o=>({type:r,isAll:t,rightSelect:o}));for(const o of s)if(!Vf(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 cR=()=>({union:hR,unionAll:fR,intersect:dR,intersectAll:pR,except:mR,exceptAll:yR}),hR=oo("union",!1),fR=oo("union",!0),dR=oo("intersect",!1),pR=oo("intersect",!0),mR=oo("except",!1),yR=oo("except",!0);var ng;ng=xt;class Xf{constructor(t){$(this,"dialect");$(this,"dialectConfig");$(this,"$with",(t,e)=>{const i=this;return{as:s=>(typeof s=="function"&&(s=s(i)),new Proxy(new jf(s.getSQL(),e??("getSelectedFields"in s?s.getSelectedFields()??{}:{}),t,!0),new Je({alias:t,sqlAliasedBehavior:"alias",sqlBehavior:"error"})))}});this.dialect=lt(t,Bo)?t:void 0,this.dialectConfig=lt(t,Bo)?void 0:t}with(...t){const e=this;function i(o){return new Sr({fields:o??void 0,session:void 0,dialect:e.getDialect(),withList:t})}function n(o){return new Sr({fields:o??void 0,session:void 0,dialect:e.getDialect(),distinct:!0})}function s(o,a){return new Sr({fields:a??void 0,session:void 0,dialect:e.getDialect(),distinct:{on:o}})}return{select:i,selectDistinct:n,selectDistinctOn:s}}select(t){return new Sr({fields:t??void 0,session:void 0,dialect:this.getDialect()})}selectDistinct(t){return new Sr({fields:t??void 0,session:void 0,dialect:this.getDialect(),distinct:!0})}selectDistinctOn(t,e){return new Sr({fields:e??void 0,session:void 0,dialect:this.getDialect(),distinct:{on:t}})}getDialect(){return this.dialect||(this.dialect=new Bo(this.dialectConfig)),this.dialect}}$(Xf,ng,"PgQueryBuilder");var sg;sg=xt;class Oh{constructor(t,e,i,n,s){$(this,"authToken");this.table=t,this.session=e,this.dialect=i,this.withList=n,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(i=>{const n={},s=this.table[Tt.Symbol.Columns];for(const o of Object.keys(i)){const a=i[o];n[o]=lt(a,Ft)?a:new Wi(a,s[o])}return n});return new Fh(this.table,e,this.session,this.dialect,this.withList,!1,this.overridingSystemValue_).setToken(this.authToken)}select(t){const e=typeof t=="function"?t(new Xf):t;if(!lt(e,Ft)&&!Vf(this.table[Ih],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 Fh(this.table,e,this.session,this.dialect,this.withList,!0)}}$(Oh,sg,"PgInsertBuilder");var og,ag;class Fh extends(ag=Tn,og=xt,ag){constructor(e,i,n,s,o,a,l){super();$(this,"config");$(this,"authToken");$(this,"execute",e=>Pr.startActiveSpan("drizzle.operation",()=>this._prepare().execute(e,this.authToken)));this.session=n,this.dialect=s,this.config={table:e,values:i,withList:o,select:a,overridingSystemValue_:l}}returning(e=this.config.table[Tt.Symbol.Columns]){return this.config.returningFields=e,this.config.returning=os(e),this}onConflictDoNothing(e={}){if(e.target===void 0)this.config.onConflict=H`do nothing`;else{let i="";i=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 n=e.where?H` where ${e.where}`:void 0;this.config.onConflict=H`(${H.raw(i)})${n} 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 i=e.where?H` where ${e.where}`:void 0,n=e.targetWhere?H` where ${e.targetWhere}`:void 0,s=e.setWhere?H` where ${e.setWhere}`:void 0,o=this.dialect.buildUpdateSet(this.config.table,bw(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=H`(${H.raw(a)})${n} do update set ${o}${i}${s}`,this}getSQL(){return this.dialect.buildInsertQuery(this.config)}toSQL(){const{typings:e,...i}=this.dialect.sqlToQuery(this.getSQL());return i}_prepare(e){return Pr.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 Je({alias:qn(this.config.table),sqlAliasedBehavior:"alias",sqlBehavior:"error"})):void 0}$dynamic(){return this}}$(Fh,og,"PgInsert");var lg,ug;class Bw extends(ug=Tn,lg=xt,ug){constructor(e,i,n){super();$(this,"config");$(this,"authToken");$(this,"execute",e=>Pr.startActiveSpan("drizzle.operation",()=>this._prepare().execute(e,this.authToken)));this.session=i,this.dialect=n,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,...i}=this.dialect.sqlToQuery(this.getSQL());return i}_prepare(e){return Pr.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}}$(Bw,lg,"PgRefreshMaterializedView");var cg;cg=xt;class Ph{constructor(t,e,i,n){$(this,"authToken");this.table=t,this.session=e,this.dialect=i,this.withList=n}setToken(t){return this.authToken=t,this}set(t){return new kw(this.table,bw(this.table,t),this.session,this.dialect,this.withList).setToken(this.authToken)}}$(Ph,cg,"PgUpdateBuilder");var hg,fg;class kw extends(fg=Tn,hg=xt,fg){constructor(e,i,n,s,o){super();$(this,"config");$(this,"tableName");$(this,"joinsNotNullableMap");$(this,"leftJoin",this.createJoin("left"));$(this,"rightJoin",this.createJoin("right"));$(this,"innerJoin",this.createJoin("inner"));$(this,"fullJoin",this.createJoin("full"));$(this,"authToken");$(this,"execute",e=>this._prepare().execute(e,this.authToken));this.session=n,this.dialect=s,this.config={set:i,table:e,withList:o,joins:[]},this.tableName=Wn(e),this.joinsNotNullableMap=typeof this.tableName=="string"?{[this.tableName]:!0}:{}}from(e){const i=e,n=Wn(i);return typeof n=="string"&&(this.joinsNotNullableMap[n]=!0),this.config.from=i,this}getTableLikeFields(e){return lt(e,Br)?e[Tt.Symbol.Columns]:lt(e,Or)?e._.selectedFields:e[He].selectedFields}createJoin(e){return(i,n)=>{const s=Wn(i);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 n=="function"){const o=this.config.from&&!lt(this.config.from,Ft)?this.getTableLikeFields(this.config.from):void 0;n=n(new Proxy(this.config.table[Tt.Symbol.Columns],new Je({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})),o&&new Proxy(o,new Je({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})))}if(this.config.joins.push({on:n,table:i,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[Tt.Symbol.Columns]),this.config.from)){const i=Wn(this.config.from);if(typeof i=="string"&&this.config.from&&!lt(this.config.from,Ft)){const n=this.getTableLikeFields(this.config.from);e[i]=n}for(const n of this.config.joins){const s=Wn(n.table);if(typeof s=="string"&&!lt(n.table,Ft)){const o=this.getTableLikeFields(n.table);e[s]=o}}}return this.config.returningFields=e,this.config.returning=os(e),this}getSQL(){return this.dialect.buildUpdateQuery(this.config)}toSQL(){const{typings:e,...i}=this.dialect.sqlToQuery(this.getSQL());return i}_prepare(e){const i=this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()),this.config.returning,e,!0);return i.joinsNotNullableMap=this.joinsNotNullableMap,i}prepare(e){return this._prepare(e)}setToken(e){return this.authToken=e,this}getSelectedFields(){return this.config.returningFields?new Proxy(this.config.returningFields,new Je({alias:qn(this.config.table),sqlAliasedBehavior:"alias",sqlBehavior:"error"})):void 0}$dynamic(){return this}}$(kw,hg,"PgUpdate");var dg,pg,mg;const Uo=class Uo extends(mg=Ft,pg=xt,dg=Symbol.toStringTag,mg){constructor(e){super(Uo.buildEmbeddedCount(e.source,e.filters).queryChunks);$(this,"sql");$(this,"token");$(this,dg,"PgCountBuilder");$(this,"session");this.params=e,this.mapWith(Number),this.session=e.session,this.sql=Uo.buildCount(e.source,e.filters)}static buildEmbeddedCount(e,i){return H`(select count(*) from ${e}${H.raw(" where ").if(i)}${i})`}static buildCount(e,i){return H`select count(*) as count from ${e}${H.raw(" where ").if(i)}${i};`}setToken(e){return this.token=e,this}then(e,i){return Promise.resolve(this.session.count(this.sql,this.token)).then(e,i)}catch(e){return this.then(void 0,e)}finally(e){return this.then(i=>(e==null||e(),i),i=>{throw e==null||e(),i})}};$(Uo,pg,"PgCountBuilder");let Mh=Uo;var yg;yg=xt;class Uw{constructor(t,e,i,n,s,o,a){this.fullSchema=t,this.schema=e,this.tableNamesMap=i,this.table=n,this.tableConfig=s,this.dialect=o,this.session=a}findMany(t){return new Dh(this.fullSchema,this.schema,this.tableNamesMap,this.table,this.tableConfig,this.dialect,this.session,t||{},"many")}findFirst(t){return new Dh(this.fullSchema,this.schema,this.tableNamesMap,this.table,this.tableConfig,this.dialect,this.session,t?{...t,limit:1}:{limit:1},"first")}}$(Uw,yg,"PgRelationalQueryBuilder");var gg,vg;class Dh extends(vg=Tn,gg=xt,vg){constructor(e,i,n,s,o,a,l,u,c){super();$(this,"authToken");this.fullSchema=e,this.schema=i,this.tableNamesMap=n,this.table=s,this.tableConfig=o,this.dialect=a,this.session=l,this.config=u,this.mode=c}_prepare(e){return Pr.startActiveSpan("drizzle.prepareQuery",()=>{const{query:i,builtQuery:n}=this._toSQL();return this.session.prepareQuery(n,void 0,e,!0,(s,o)=>{const a=s.map(l=>Ch(this.schema,this.tableConfig,l,i.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(),i=this.dialect.sqlToQuery(e.sql);return{query:e,builtQuery:i}}toSQL(){return this._toSQL().builtQuery}setToken(e){return this.authToken=e,this}execute(){return Pr.startActiveSpan("drizzle.operation",()=>this._prepare().execute(void 0,this.authToken))}}$(Dh,gg,"PgRelationalQuery");var _g,bg;class zw extends(bg=Tn,_g=xt,bg){constructor(t,e,i,n){super(),this.execute=t,this.sql=e,this.query=i,this.mapBatchResult=n}getSQL(){return this.sql}getQuery(){return this.query}mapResult(t,e){return e?this.mapBatchResult(t):t}_prepare(){return this}isResponseInArrayMode(){return!1}}$(zw,_g,"PgRaw");var wg;wg=xt;class Yf{constructor(t,e,i){$(this,"query");$(this,"$with",(t,e)=>{const i=this;return{as:s=>(typeof s=="function"&&(s=s(new Xf(i.dialect))),new Proxy(new jf(s.getSQL(),e??("getSelectedFields"in s?s.getSelectedFields()??{}:{}),t,!0),new Je({alias:t,sqlAliasedBehavior:"alias",sqlBehavior:"error"})))}});$(this,"authToken");if(this.dialect=t,this.session=e,this._=i?{schema:i.schema,fullSchema:i.fullSchema,tableNamesMap:i.tableNamesMap,session:e}:{schema:void 0,fullSchema:{},tableNamesMap:{},session:e},this.query={},this._.schema)for(const[n,s]of Object.entries(this._.schema))this.query[n]=new Uw(i.fullSchema,this._.schema,this._.tableNamesMap,i.fullSchema[n],s,t,e)}$count(t,e){return new Mh({source:t,filters:e,session:this.session})}with(...t){const e=this;function i(u){return new Sr({fields:u??void 0,session:e.session,dialect:e.dialect,withList:t})}function n(u){return new Sr({fields:u??void 0,session:e.session,dialect:e.dialect,withList:t,distinct:!0})}function s(u,c){return new Sr({fields:c??void 0,session:e.session,dialect:e.dialect,withList:t,distinct:{on:u}})}function o(u){return new Ph(u,e.session,e.dialect,t)}function a(u){return new Oh(u,e.session,e.dialect,t)}function l(u){return new Ah(u,e.session,e.dialect,t)}return{select:i,selectDistinct:n,selectDistinctOn:s,update:o,insert:a,delete:l}}select(t){return new Sr({fields:t??void 0,session:this.session,dialect:this.dialect})}selectDistinct(t){return new Sr({fields:t??void 0,session:this.session,dialect:this.dialect,distinct:!0})}selectDistinctOn(t,e){return new Sr({fields:e??void 0,session:this.session,dialect:this.dialect,distinct:{on:t}})}update(t){return new Ph(t,this.session,this.dialect)}insert(t){return new Oh(t,this.session,this.dialect)}delete(t){return new Ah(t,this.session,this.dialect)}refreshMaterializedView(t){return new Bw(t,this.session,this.dialect)}execute(t){const e=typeof t=="string"?H.raw(t):t.getSQL(),i=this.dialect.sqlToQuery(e),n=this.session.prepareQuery(i,void 0,void 0,!1);return new zw(()=>n.execute(void 0,this.authToken),e,i,s=>n.mapResult(s,!0))}transaction(t,e){return this.session.transaction(t,e)}}$(Yf,wg,"PgDatabase");var xg;xg=xt;class jw{constructor(t){$(this,"authToken");$(this,"joinsNotNullableMap");this.query=t}getQuery(){return this.query}mapResult(t,e){return t}setToken(t){return this.authToken=t,this}}$(jw,xg,"PgPreparedQuery");var Sg;Sg=xt;class $w{constructor(t){this.dialect=t}execute(t,e){return Pr.startActiveSpan("drizzle.operation",()=>Pr.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 i=await this.execute(t,e);return Number(i[0].count)}}$($w,Sg,"PgSession");var Tg,Ig;class Vw extends(Ig=Yf,Tg=xt,Ig){constructor(t,e,i,n=0){super(t,e,i),this.schema=i,this.nestedIndex=n}rollback(){throw new yw}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"),H.raw(e.join(" "))}setTransaction(t){return this.session.execute(H`set transaction ${this.getTransactionConfigSQL(t)}`)}}$(Vw,Tg,"PgTransaction");function Om(r){return typeof r=="string"&&/^true$/i.test(r)}function gR(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 i=e.searchParams.get("logger");i&&Om(i)&&(t.logger=!0);const n=e.searchParams.get("storage");switch(n){case ra.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:ra.ORIGIN_PRIVATE_FS,path:e.pathname.startsWith("/")?e.pathname.slice(1):e.pathname,...s&&Om(s)&&{accessMode:T0.READ_WRITE}};break}case null:break;default:console.warn(`Unknown storage type "${n}"`);break}return t}var Eg,Cg;class Gw extends(Cg=jw,Eg=xt,Cg){constructor(t,e,i,n,s,o){super({sql:e,params:i}),this.client=t,this.queryString=e,this.params=i,this.logger=n,this.fields=s,this.customResultMapper=o}async execute(t={}){const e=Em(this.params,t);this.logger.logQuery(this.queryString,e);const{fields:i,queryString:n,client:s,customResultMapper:o}=this,a=await s;return a.query(n,e)}async all(t={}){const e=Em(this.params,t);return this.logger.logQuery(this.queryString,e),(await this.client).query(this.queryString,e)}}$(Gw,Eg,"DuckDBWasmPreparedQuery");var Ag,Og;const Yl=class Yl extends(Og=$w,Ag=xt,Og){constructor(e,i,n,s={}){super(i);$(this,"logger");this.client=e,this.schema=n,this.options=s,this.logger=s.logger??new _w}prepareQuery(e,i,n,s,o){return new Gw(this.client,e.sql,e.params,this.logger,i,o)}async query(e,i){return this.logger.logQuery(e,i),(await this.client).query(e,i)}async queryObjects(e,i){return this.logger.logQuery(e,i),(await this.client).query(e,i)}transaction(e,i){return xD(this.client,async n=>{const s=new Yl(n,this.dialect,this.schema,this.options),o=new Rh(this.dialect,s,this.schema);return i&&await o.setTransaction(i),e(o)})}};$(Yl,Ag,"DuckDBWasmSession");let Gl=Yl;var Fg,Pg;const ql=class ql extends(Pg=Vw,Fg=xt,Pg){constructor(e,i,n,s=0){super(e,i,n,s);$(this,"dialect");$(this,"session");this.dialect=e,this.session=i}async transaction(e){return SD(this.session.client,"",async i=>{const n=new Gl(i,this.dialect,this.schema,this.session.options),s=new ql(this.dialect,n,this.schema);return e(s)})}};$(ql,Fg,"DuckDBWasmTransaction");let Rh=ql;var Mg,Dg;class Ww extends(Dg=Yf,Mg=xt,Dg){}$(Ww,Mg,"DuckDBWasmDatabase");function ko(r,t={}){const e=new Bo({casing:t.casing});let i;t.logger===!0?i=new vw:t.logger!==!1&&(i=t.logger);let n;if(t.schema){const a=rR(t.schema,oR);n={fullSchema:t.schema,schema:a.tables,tableNamesMap:a.tableNamesMap}}const s=new Gl(r,e,n,{logger:i}),o=new Ww(e,s,n);return o.$client=r,o}function Fm(r,t){const e=gR(r);let i;return e.bundles==="import-url"?i=(async()=>{const s=await Sh();switch(s){case"browser":return(await ln(async()=>{const{getImportUrlBundles:o}=await import("./import-url-browser-CPN8ipMD.js");return{getImportUrlBundles:o}},__vite__mapDeps([3,4]))).getImportUrlBundles();case"node":return await(await ln(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}"`)}})():i=(async()=>{const s=await Sh();switch(s){case"browser":return(await ln(async()=>{const{getBundles:o}=await import("./default-browser-BrgSDbLD.js");return{getBundles:o}},[])).getBundles();case"node":return await(await ln(async()=>{const{getBundles:o}=await import("./default-node-CoUhZWYT.js");return{getBundles:o}},__vite__mapDeps([0,1,2]))).getBundles();default:throw new Error(`Unsupported environment: "${s}"`)}})(),ko(hw({bundles:i,logger:e.logger?new I0:void 0,storage:e.storage}),t)}function Pm(...r){if(typeof r[0]=="string")return Fm(r[0],r[1]);if(MD(r[0])){const{connection:t,client:e,...i}=r[0];if(e)return ko(e,i);if(typeof t=="string")return Fm(t,i);if(typeof t>"u")throw new Error("connection option is required");return ko(hw({bundles:t.bundles,logger:t.logger,storage:t.storage}),i)}return ko(r[0],r[1])}(r=>{function t(e){return ko({options:{parsers:{},serializers:{}}},e)}r.mock=t})(Pm||(Pm={}));export{L1 as A,TR as D,xR as I,pC as J,eI as L,_c as M,wR as T,fi as a,Re as b,Pm as d,sa as e,SR as l}; + `;await e.execute(H`CREATE SCHEMA IF NOT EXISTS ${H.identifier(s)}`),await e.execute(o);const l=(await e.all(H`select id, hash, created_at from ${H.identifier(s)}.${H.identifier(n)} 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=i[o])==null?void 0:a.onUpdateFn)!==void 0}),s=n.length;return H.join(n.flatMap((o,a)=>{const l=i[o],u=e[o]??H.param(l.onUpdateFn(),l),c=H`${H.identifier(this.casing.getColumnCasing(l))} = ${u}`;return a{const a=[];if(lt(s,Ft.Aliased)&&s.isSelectionField)a.push(H.identifier(s.fieldAlias));else if(lt(s,Ft.Aliased)||lt(s,Ft)){const l=lt(s,Ft.Aliased)?s.sql:s;e?a.push(new Ft(l.queryChunks.map(u=>lt(u,Ar)?H.identifier(this.casing.getColumnCasing(u)):u))):a.push(l),lt(s,Ft.Aliased)&&a.push(H` as ${H.identifier(s.fieldAlias)}`)}else lt(s,Ke)&&(e?a.push(H.identifier(this.casing.getColumnCasing(s))):a.push(s));return oa==null?void 0:a.some(({alias:M})=>M===(it[Tt.Symbol.IsAlias]?qn(it):it[Tt.Symbol.BaseName])))(w.field.table)){const it=qn(w.field.table);throw new Error(`Your "${w.path.join("->")}" field references a column "${it}"."${w.field.name}", but the table "${it}" is not part of the query! Did you forget to join it?`)}const d=!a||a.length===0,m=this.buildWithCTE(t);let _;f&&(_=f===!0?H` distinct`:H` distinct on (${H.join(f.on,H`, `)})`);const S=this.buildSelection(g,{isSingleTable:d}),E=this.buildFromTable(o),b=this.buildJoins(a),F=n?H` where ${n}`:void 0,x=s?H` having ${s}`:void 0;let z;l&&l.length>0&&(z=H` order by ${H.join(l,H`, `)}`);let B;u&&u.length>0&&(B=H` group by ${H.join(u,H`, `)}`);const tt=typeof c=="object"||typeof c=="number"&&c>=0?H` limit ${c}`:void 0,st=h?H` offset ${h}`:void 0,I=H.empty();if(p){const w=H` for ${H.raw(p.strength)}`;p.config.of&&w.append(H` of ${H.join(Array.isArray(p.config.of)?p.config.of:[p.config.of],H`, `)}`),p.config.noWait?w.append(H` nowait`):p.config.skipLocked&&w.append(H` skip locked`),I.append(w)}const Z=H`${m}select${_} ${S} from ${E}${b}${F}${B}${x}${z}${tt}${st}${I}`;return y.length>0?this.buildSetOperations(Z,y):Z}buildSetOperations(t,e){const[i,...n]=e;if(!i)throw new Error("Cannot pass undefined values to any set operator");return n.length===0?this.buildSetOperationQuery({leftSelect:t,setOperator:i}):this.buildSetOperations(this.buildSetOperationQuery({leftSelect:t,setOperator:i}),n)}buildSetOperationQuery({leftSelect:t,setOperator:{type:e,isAll:i,rightSelect:n,limit:s,orderBy:o,offset:a}}){const l=H`(${t.getSQL()}) `,u=H`(${n.getSQL()})`;let c;if(o&&o.length>0){const y=[];for(const g of o)if(lt(g,Ar))y.push(H.identifier(g.name));else if(lt(g,Ft)){for(let d=0;d=0?H` limit ${s}`:void 0,p=H.raw(`${e} ${i?"all ":""}`),f=a?H` offset ${a}`:void 0;return H`${l}${p}${u}${c}${h}${f}`}buildInsertQuery({table:t,values:e,onConflict:i,returning:n,withList:s,select:o,overridingSystemValue_:a}){const l=[],u=t[Tt.Symbol.Columns],c=Object.entries(u).filter(([m,_])=>!_.shouldDisableInsert()),h=c.map(([,m])=>H.identifier(this.casing.getColumnCasing(m)));if(o){const m=e;lt(m,Ft)?l.push(m):l.push(m.getSQL())}else{const m=e;l.push(H.raw("values "));for(const[_,S]of m.entries()){const E=[];for(const[b,F]of c){const x=S[b];if(x===void 0||lt(x,Wi)&&x.value===void 0)if(F.defaultFn!==void 0){const z=F.defaultFn(),B=lt(z,Ft)?z:H.param(z,F);E.push(B)}else if(!F.default&&F.onUpdateFn!==void 0){const z=F.onUpdateFn(),B=lt(z,Ft)?z:H.param(z,F);E.push(B)}else E.push(H`default`);else E.push(x)}l.push(E),_({dbKey:S.name,tsKey:_,field:Li(S,a),relationTableTsKey:void 0,isJson:!1,selection:[]}));else{const m=Object.fromEntries(Object.entries(s.columns).map(([x,z])=>[x,Li(z,a)]));if(o.where){const x=typeof o.where=="function"?o.where(m,tR()):o.where;y=x&&$l(x,a)}const _=[];let S=[];if(o.columns){let x=!1;for(const[z,B]of Object.entries(o.columns))B!==void 0&&z in s.columns&&(!x&&B===!0&&(x=!0),S.push(z));S.length>0&&(S=x?S.filter(z=>{var B;return((B=o.columns)==null?void 0:B[z])===!0}):Object.keys(s.columns).filter(z=>!S.includes(z)))}else S=Object.keys(s.columns);for(const x of S){const z=s.columns[x];_.push({tsKey:x,value:z})}let E=[];o.with&&(E=Object.entries(o.with).filter(x=>!!x[1]).map(([x,z])=>({tsKey:x,queryConfig:z,relation:s.relations[x]})));let b;if(o.extras){b=typeof o.extras=="function"?o.extras(m,{sql:H}):o.extras;for(const[x,z]of Object.entries(b))_.push({tsKey:x,value:mw(z,a)})}for(const{tsKey:x,value:z}of _)c.push({dbKey:lt(z,Ft.Aliased)?z.fieldAlias:s.columns[x].name,tsKey:x,field:lt(z,Ke)?Li(z,a):z,relationTableTsKey:void 0,isJson:!1,selection:[]});let F=typeof o.orderBy=="function"?o.orderBy(m,eR()):o.orderBy??[];Array.isArray(F)||(F=[F]),f=F.map(x=>lt(x,Ke)?Li(x,a):$l(x,a)),h=o.limit,p=o.offset;for(const{tsKey:x,queryConfig:z,relation:B}of E){const tt=sR(e,i,B),st=ia(B.referencedTable),I=i[st],Z=`${a}_${x}`,w=Eh(...tt.fields.map((O,D)=>Mw(Li(tt.references[D],Z),Li(O,a)))),it=this.buildRelationalQueryWithoutPK({fullSchema:t,schema:e,tableNamesMap:i,table:t[I],tableConfig:e[I],queryConfig:lt(B,as)?z===!0?{limit:1}:{...z,limit:1}:z,tableAlias:Z,joinOn:w,nestedQueryRelation:B}),M=H`${H.identifier(Z)}.${H.identifier("data")}`.as(x);g.push({on:H`true`,table:new Or(it.sql,{},Z),alias:Z,joinType:"left",lateral:!0}),c.push({dbKey:x,tsKey:x,field:M,relationTableTsKey:I,isJson:!0,selection:it.selection})}}if(c.length===0)throw new $f({message:`No fields selected for table "${s.tsName}" ("${a}")`});let d;if(y=Eh(u,y),l){let m=H`json_build_array(${H.join(c.map(({field:E,tsKey:b,isJson:F})=>F?H`${H.identifier(`${a}_${b}`)}.${H.identifier("data")}`:lt(E,Ft.Aliased)?E.sql:E),H`, `)})`;lt(l,Vl)&&(m=H`coalesce(json_agg(${m}${f.length>0?H` order by ${H.join(f,H`, `)}`:void 0}), '[]'::json)`);const _=[{dbKey:"data",tsKey:"data",field:m.as("data"),isJson:!0,relationTableTsKey:s.tsName,selection:c}];h!==void 0||p!==void 0||f.length>0?(d=this.buildSelectQuery({table:ac(n,a),fields:{},fieldsFlat:[{path:[],field:H.raw("*")}],where:y,limit:h,offset:p,orderBy:f,setOperators:[]}),y=void 0,h=void 0,p=void 0,f=[]):d=ac(n,a),d=this.buildSelectQuery({table:lt(d,Br)?d:new Or(d,{},a),fields:{},fieldsFlat:_.map(({field:E})=>({path:[],field:lt(E,Ke)?Li(E,a):E})),joins:g,where:y,limit:h,offset:p,orderBy:f,setOperators:[]})}else d=this.buildSelectQuery({table:ac(n,a),fields:{},fieldsFlat:c.map(({field:m})=>({path:[],field:lt(m,Ke)?Li(m,a):m})),joins:g,where:y,limit:h,offset:p,orderBy:f,setOperators:[]});return{tableTsKey:s.tsName,sql:d,selection:c}}}$(Bo,Ky,"PgDialect");var Zy;Zy=xt;class Nw{getSelectedFields(){return this._.selectedFields}}$(Nw,Zy,"TypedQueryBuilder");var Jy;Jy=xt;class Sr{constructor(t){$(this,"fields");$(this,"session");$(this,"dialect");$(this,"withList",[]);$(this,"distinct");$(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,i=t;let n;return this.fields?n=this.fields:lt(i,Or)?n=Object.fromEntries(Object.keys(i._.selectedFields).map(s=>[s,i[s]])):lt(i,Wf)?n=i[He].selectedFields:lt(i,Ft)?n={}:n=PD(i),new Hf({table:i,fields:n,isPartialSelect:e,session:this.session,dialect:this.dialect,withList:this.withList,distinct:this.distinct}).setToken(this.authToken)}}$(Sr,Jy,"PgSelectBuilder");var tg,eg;class Lw extends(eg=Nw,tg=xt,eg){constructor({table:e,fields:i,isPartialSelect:n,session:s,dialect:o,withList:a,distinct:l}){super();$(this,"_");$(this,"config");$(this,"joinsNotNullableMap");$(this,"tableName");$(this,"isPartialSelect");$(this,"session");$(this,"dialect");$(this,"leftJoin",this.createJoin("left",!1));$(this,"leftJoinLateral",this.createJoin("left",!0));$(this,"rightJoin",this.createJoin("right",!1));$(this,"innerJoin",this.createJoin("inner",!1));$(this,"innerJoinLateral",this.createJoin("inner",!0));$(this,"fullJoin",this.createJoin("full",!1));$(this,"crossJoin",this.createJoin("cross",!1));$(this,"crossJoinLateral",this.createJoin("cross",!0));$(this,"union",this.createSetOperator("union",!1));$(this,"unionAll",this.createSetOperator("union",!0));$(this,"intersect",this.createSetOperator("intersect",!1));$(this,"intersectAll",this.createSetOperator("intersect",!0));$(this,"except",this.createSetOperator("except",!1));$(this,"exceptAll",this.createSetOperator("except",!0));this.config={withList:a,table:e,fields:{...i},distinct:l,setOperators:[]},this.isPartialSelect=n,this.session=s,this.dialect=o,this._={selectedFields:i},this.tableName=Wn(e),this.joinsNotNullableMap=typeof this.tableName=="string"?{[this.tableName]:!0}:{}}createJoin(e,i){return(n,s)=>{var l;const o=this.tableName,a=Wn(n);if(typeof a=="string"&&((l=this.config.joins)!=null&&l.some(u=>u.alias===a)))throw new Error(`Alias "${a}" is already used in this query`);if(!this.isPartialSelect&&(Object.keys(this.joinsNotNullableMap).length===1&&typeof o=="string"&&(this.config.fields={[o]:this.config.fields}),typeof a=="string"&&!lt(n,Ft))){const u=lt(n,Or)?n._.selectedFields:lt(n,Sn)?n[He].selectedFields:n[Tt.Symbol.Columns];this.config.fields[a]=u}if(typeof s=="function"&&(s=s(new Proxy(this.config.fields,new Je({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})))),this.config.joins||(this.config.joins=[]),this.config.joins.push({on:s,table:n,joinType:e,alias:a,lateral:i}),typeof a=="string")switch(e){case"left":{this.joinsNotNullableMap[a]=!1;break}case"right":{this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([u])=>[u,!1])),this.joinsNotNullableMap[a]=!0;break}case"cross":case"inner":{this.joinsNotNullableMap[a]=!0;break}case"full":{this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([u])=>[u,!1])),this.joinsNotNullableMap[a]=!1;break}}return this}}createSetOperator(e,i){return n=>{const s=typeof n=="function"?n(cR()):n;if(!Vf(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:i,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 Je({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})))),this.config.where=e,this}having(e){return typeof e=="function"&&(e=e(new Proxy(this.config.fields,new Je({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})))),this.config.having=e,this}groupBy(...e){if(typeof e[0]=="function"){const i=e[0](new Proxy(this.config.fields,new Je({sqlAliasedBehavior:"alias",sqlBehavior:"sql"})));this.config.groupBy=Array.isArray(i)?i:[i]}else this.config.groupBy=e;return this}orderBy(...e){if(typeof e[0]=="function"){const i=e[0](new Proxy(this.config.fields,new Je({sqlAliasedBehavior:"alias",sqlBehavior:"sql"}))),n=Array.isArray(i)?i:[i];this.config.setOperators.length>0?this.config.setOperators.at(-1).orderBy=n:this.config.orderBy=n}else{const i=e;this.config.setOperators.length>0?this.config.setOperators.at(-1).orderBy=i:this.config.orderBy=i}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,i={}){return this.config.lockingClause={strength:e,config:i},this}getSQL(){return this.dialect.buildSelectQuery(this.config)}toSQL(){const{typings:e,...i}=this.dialect.sqlToQuery(this.getSQL());return i}as(e){return new Proxy(new Or(this.getSQL(),this.config.fields,e),new Je({alias:e,sqlAliasedBehavior:"alias",sqlBehavior:"error"}))}getSelectedFields(){return new Proxy(this.config.fields,new Je({alias:this.tableName,sqlAliasedBehavior:"alias",sqlBehavior:"error"}))}$dynamic(){return this}}$(Lw,tg,"PgSelectQueryBuilder");var rg,ig;class Hf extends(ig=Lw,rg=xt,ig){constructor(){super(...arguments);$(this,"authToken");$(this,"execute",e=>Pr.startActiveSpan("drizzle.operation",()=>this._prepare().execute(e,this.authToken)))}_prepare(e){const{session:i,config:n,dialect:s,joinsNotNullableMap:o,authToken:a}=this;if(!i)throw new Error("Cannot execute a query on a query builder. Please use a database instance instead.");return Pr.startActiveSpan("drizzle.prepareQuery",()=>{const l=os(n.fields),u=i.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}}$(Hf,rg,"PgSelect");FD(Hf,[Tn]);function oo(r,t){return(e,i,...n)=>{const s=[i,...n].map(o=>({type:r,isAll:t,rightSelect:o}));for(const o of s)if(!Vf(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 cR=()=>({union:hR,unionAll:fR,intersect:dR,intersectAll:pR,except:mR,exceptAll:yR}),hR=oo("union",!1),fR=oo("union",!0),dR=oo("intersect",!1),pR=oo("intersect",!0),mR=oo("except",!1),yR=oo("except",!0);var ng;ng=xt;class Xf{constructor(t){$(this,"dialect");$(this,"dialectConfig");$(this,"$with",(t,e)=>{const i=this;return{as:s=>(typeof s=="function"&&(s=s(i)),new Proxy(new jf(s.getSQL(),e??("getSelectedFields"in s?s.getSelectedFields()??{}:{}),t,!0),new Je({alias:t,sqlAliasedBehavior:"alias",sqlBehavior:"error"})))}});this.dialect=lt(t,Bo)?t:void 0,this.dialectConfig=lt(t,Bo)?void 0:t}with(...t){const e=this;function i(o){return new Sr({fields:o??void 0,session:void 0,dialect:e.getDialect(),withList:t})}function n(o){return new Sr({fields:o??void 0,session:void 0,dialect:e.getDialect(),distinct:!0})}function s(o,a){return new Sr({fields:a??void 0,session:void 0,dialect:e.getDialect(),distinct:{on:o}})}return{select:i,selectDistinct:n,selectDistinctOn:s}}select(t){return new Sr({fields:t??void 0,session:void 0,dialect:this.getDialect()})}selectDistinct(t){return new Sr({fields:t??void 0,session:void 0,dialect:this.getDialect(),distinct:!0})}selectDistinctOn(t,e){return new Sr({fields:e??void 0,session:void 0,dialect:this.getDialect(),distinct:{on:t}})}getDialect(){return this.dialect||(this.dialect=new Bo(this.dialectConfig)),this.dialect}}$(Xf,ng,"PgQueryBuilder");var sg;sg=xt;class Oh{constructor(t,e,i,n,s){$(this,"authToken");this.table=t,this.session=e,this.dialect=i,this.withList=n,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(i=>{const n={},s=this.table[Tt.Symbol.Columns];for(const o of Object.keys(i)){const a=i[o];n[o]=lt(a,Ft)?a:new Wi(a,s[o])}return n});return new Fh(this.table,e,this.session,this.dialect,this.withList,!1,this.overridingSystemValue_).setToken(this.authToken)}select(t){const e=typeof t=="function"?t(new Xf):t;if(!lt(e,Ft)&&!Vf(this.table[Ih],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 Fh(this.table,e,this.session,this.dialect,this.withList,!0)}}$(Oh,sg,"PgInsertBuilder");var og,ag;class Fh extends(ag=Tn,og=xt,ag){constructor(e,i,n,s,o,a,l){super();$(this,"config");$(this,"authToken");$(this,"execute",e=>Pr.startActiveSpan("drizzle.operation",()=>this._prepare().execute(e,this.authToken)));this.session=n,this.dialect=s,this.config={table:e,values:i,withList:o,select:a,overridingSystemValue_:l}}returning(e=this.config.table[Tt.Symbol.Columns]){return this.config.returningFields=e,this.config.returning=os(e),this}onConflictDoNothing(e={}){if(e.target===void 0)this.config.onConflict=H`do nothing`;else{let i="";i=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 n=e.where?H` where ${e.where}`:void 0;this.config.onConflict=H`(${H.raw(i)})${n} 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 i=e.where?H` where ${e.where}`:void 0,n=e.targetWhere?H` where ${e.targetWhere}`:void 0,s=e.setWhere?H` where ${e.setWhere}`:void 0,o=this.dialect.buildUpdateSet(this.config.table,bw(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=H`(${H.raw(a)})${n} do update set ${o}${i}${s}`,this}getSQL(){return this.dialect.buildInsertQuery(this.config)}toSQL(){const{typings:e,...i}=this.dialect.sqlToQuery(this.getSQL());return i}_prepare(e){return Pr.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 Je({alias:qn(this.config.table),sqlAliasedBehavior:"alias",sqlBehavior:"error"})):void 0}$dynamic(){return this}}$(Fh,og,"PgInsert");var lg,ug;class Bw extends(ug=Tn,lg=xt,ug){constructor(e,i,n){super();$(this,"config");$(this,"authToken");$(this,"execute",e=>Pr.startActiveSpan("drizzle.operation",()=>this._prepare().execute(e,this.authToken)));this.session=i,this.dialect=n,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,...i}=this.dialect.sqlToQuery(this.getSQL());return i}_prepare(e){return Pr.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}}$(Bw,lg,"PgRefreshMaterializedView");var cg;cg=xt;class Ph{constructor(t,e,i,n){$(this,"authToken");this.table=t,this.session=e,this.dialect=i,this.withList=n}setToken(t){return this.authToken=t,this}set(t){return new kw(this.table,bw(this.table,t),this.session,this.dialect,this.withList).setToken(this.authToken)}}$(Ph,cg,"PgUpdateBuilder");var hg,fg;class kw extends(fg=Tn,hg=xt,fg){constructor(e,i,n,s,o){super();$(this,"config");$(this,"tableName");$(this,"joinsNotNullableMap");$(this,"leftJoin",this.createJoin("left"));$(this,"rightJoin",this.createJoin("right"));$(this,"innerJoin",this.createJoin("inner"));$(this,"fullJoin",this.createJoin("full"));$(this,"authToken");$(this,"execute",e=>this._prepare().execute(e,this.authToken));this.session=n,this.dialect=s,this.config={set:i,table:e,withList:o,joins:[]},this.tableName=Wn(e),this.joinsNotNullableMap=typeof this.tableName=="string"?{[this.tableName]:!0}:{}}from(e){const i=e,n=Wn(i);return typeof n=="string"&&(this.joinsNotNullableMap[n]=!0),this.config.from=i,this}getTableLikeFields(e){return lt(e,Br)?e[Tt.Symbol.Columns]:lt(e,Or)?e._.selectedFields:e[He].selectedFields}createJoin(e){return(i,n)=>{const s=Wn(i);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 n=="function"){const o=this.config.from&&!lt(this.config.from,Ft)?this.getTableLikeFields(this.config.from):void 0;n=n(new Proxy(this.config.table[Tt.Symbol.Columns],new Je({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})),o&&new Proxy(o,new Je({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})))}if(this.config.joins.push({on:n,table:i,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[Tt.Symbol.Columns]),this.config.from)){const i=Wn(this.config.from);if(typeof i=="string"&&this.config.from&&!lt(this.config.from,Ft)){const n=this.getTableLikeFields(this.config.from);e[i]=n}for(const n of this.config.joins){const s=Wn(n.table);if(typeof s=="string"&&!lt(n.table,Ft)){const o=this.getTableLikeFields(n.table);e[s]=o}}}return this.config.returningFields=e,this.config.returning=os(e),this}getSQL(){return this.dialect.buildUpdateQuery(this.config)}toSQL(){const{typings:e,...i}=this.dialect.sqlToQuery(this.getSQL());return i}_prepare(e){const i=this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()),this.config.returning,e,!0);return i.joinsNotNullableMap=this.joinsNotNullableMap,i}prepare(e){return this._prepare(e)}setToken(e){return this.authToken=e,this}getSelectedFields(){return this.config.returningFields?new Proxy(this.config.returningFields,new Je({alias:qn(this.config.table),sqlAliasedBehavior:"alias",sqlBehavior:"error"})):void 0}$dynamic(){return this}}$(kw,hg,"PgUpdate");var dg,pg,mg;const Uo=class Uo extends(mg=Ft,pg=xt,dg=Symbol.toStringTag,mg){constructor(e){super(Uo.buildEmbeddedCount(e.source,e.filters).queryChunks);$(this,"sql");$(this,"token");$(this,dg,"PgCountBuilder");$(this,"session");this.params=e,this.mapWith(Number),this.session=e.session,this.sql=Uo.buildCount(e.source,e.filters)}static buildEmbeddedCount(e,i){return H`(select count(*) from ${e}${H.raw(" where ").if(i)}${i})`}static buildCount(e,i){return H`select count(*) as count from ${e}${H.raw(" where ").if(i)}${i};`}setToken(e){return this.token=e,this}then(e,i){return Promise.resolve(this.session.count(this.sql,this.token)).then(e,i)}catch(e){return this.then(void 0,e)}finally(e){return this.then(i=>(e==null||e(),i),i=>{throw e==null||e(),i})}};$(Uo,pg,"PgCountBuilder");let Mh=Uo;var yg;yg=xt;class Uw{constructor(t,e,i,n,s,o,a){this.fullSchema=t,this.schema=e,this.tableNamesMap=i,this.table=n,this.tableConfig=s,this.dialect=o,this.session=a}findMany(t){return new Dh(this.fullSchema,this.schema,this.tableNamesMap,this.table,this.tableConfig,this.dialect,this.session,t||{},"many")}findFirst(t){return new Dh(this.fullSchema,this.schema,this.tableNamesMap,this.table,this.tableConfig,this.dialect,this.session,t?{...t,limit:1}:{limit:1},"first")}}$(Uw,yg,"PgRelationalQueryBuilder");var gg,vg;class Dh extends(vg=Tn,gg=xt,vg){constructor(e,i,n,s,o,a,l,u,c){super();$(this,"authToken");this.fullSchema=e,this.schema=i,this.tableNamesMap=n,this.table=s,this.tableConfig=o,this.dialect=a,this.session=l,this.config=u,this.mode=c}_prepare(e){return Pr.startActiveSpan("drizzle.prepareQuery",()=>{const{query:i,builtQuery:n}=this._toSQL();return this.session.prepareQuery(n,void 0,e,!0,(s,o)=>{const a=s.map(l=>Ch(this.schema,this.tableConfig,l,i.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(),i=this.dialect.sqlToQuery(e.sql);return{query:e,builtQuery:i}}toSQL(){return this._toSQL().builtQuery}setToken(e){return this.authToken=e,this}execute(){return Pr.startActiveSpan("drizzle.operation",()=>this._prepare().execute(void 0,this.authToken))}}$(Dh,gg,"PgRelationalQuery");var _g,bg;class zw extends(bg=Tn,_g=xt,bg){constructor(t,e,i,n){super(),this.execute=t,this.sql=e,this.query=i,this.mapBatchResult=n}getSQL(){return this.sql}getQuery(){return this.query}mapResult(t,e){return e?this.mapBatchResult(t):t}_prepare(){return this}isResponseInArrayMode(){return!1}}$(zw,_g,"PgRaw");var wg;wg=xt;class Yf{constructor(t,e,i){$(this,"query");$(this,"$with",(t,e)=>{const i=this;return{as:s=>(typeof s=="function"&&(s=s(new Xf(i.dialect))),new Proxy(new jf(s.getSQL(),e??("getSelectedFields"in s?s.getSelectedFields()??{}:{}),t,!0),new Je({alias:t,sqlAliasedBehavior:"alias",sqlBehavior:"error"})))}});$(this,"authToken");if(this.dialect=t,this.session=e,this._=i?{schema:i.schema,fullSchema:i.fullSchema,tableNamesMap:i.tableNamesMap,session:e}:{schema:void 0,fullSchema:{},tableNamesMap:{},session:e},this.query={},this._.schema)for(const[n,s]of Object.entries(this._.schema))this.query[n]=new Uw(i.fullSchema,this._.schema,this._.tableNamesMap,i.fullSchema[n],s,t,e)}$count(t,e){return new Mh({source:t,filters:e,session:this.session})}with(...t){const e=this;function i(u){return new Sr({fields:u??void 0,session:e.session,dialect:e.dialect,withList:t})}function n(u){return new Sr({fields:u??void 0,session:e.session,dialect:e.dialect,withList:t,distinct:!0})}function s(u,c){return new Sr({fields:c??void 0,session:e.session,dialect:e.dialect,withList:t,distinct:{on:u}})}function o(u){return new Ph(u,e.session,e.dialect,t)}function a(u){return new Oh(u,e.session,e.dialect,t)}function l(u){return new Ah(u,e.session,e.dialect,t)}return{select:i,selectDistinct:n,selectDistinctOn:s,update:o,insert:a,delete:l}}select(t){return new Sr({fields:t??void 0,session:this.session,dialect:this.dialect})}selectDistinct(t){return new Sr({fields:t??void 0,session:this.session,dialect:this.dialect,distinct:!0})}selectDistinctOn(t,e){return new Sr({fields:e??void 0,session:this.session,dialect:this.dialect,distinct:{on:t}})}update(t){return new Ph(t,this.session,this.dialect)}insert(t){return new Oh(t,this.session,this.dialect)}delete(t){return new Ah(t,this.session,this.dialect)}refreshMaterializedView(t){return new Bw(t,this.session,this.dialect)}execute(t){const e=typeof t=="string"?H.raw(t):t.getSQL(),i=this.dialect.sqlToQuery(e),n=this.session.prepareQuery(i,void 0,void 0,!1);return new zw(()=>n.execute(void 0,this.authToken),e,i,s=>n.mapResult(s,!0))}transaction(t,e){return this.session.transaction(t,e)}}$(Yf,wg,"PgDatabase");var xg;xg=xt;class jw{constructor(t){$(this,"authToken");$(this,"joinsNotNullableMap");this.query=t}getQuery(){return this.query}mapResult(t,e){return t}setToken(t){return this.authToken=t,this}}$(jw,xg,"PgPreparedQuery");var Sg;Sg=xt;class $w{constructor(t){this.dialect=t}execute(t,e){return Pr.startActiveSpan("drizzle.operation",()=>Pr.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 i=await this.execute(t,e);return Number(i[0].count)}}$($w,Sg,"PgSession");var Tg,Ig;class Vw extends(Ig=Yf,Tg=xt,Ig){constructor(t,e,i,n=0){super(t,e,i),this.schema=i,this.nestedIndex=n}rollback(){throw new yw}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"),H.raw(e.join(" "))}setTransaction(t){return this.session.execute(H`set transaction ${this.getTransactionConfigSQL(t)}`)}}$(Vw,Tg,"PgTransaction");function Om(r){return typeof r=="string"&&/^true$/i.test(r)}function gR(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 i=e.searchParams.get("logger");i&&Om(i)&&(t.logger=!0);const n=e.searchParams.get("storage");switch(n){case ra.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:ra.ORIGIN_PRIVATE_FS,path:e.pathname.startsWith("/")?e.pathname.slice(1):e.pathname,...s&&Om(s)&&{accessMode:T0.READ_WRITE}};break}case null:break;default:console.warn(`Unknown storage type "${n}"`);break}return t}var Eg,Cg;class Gw extends(Cg=jw,Eg=xt,Cg){constructor(t,e,i,n,s,o){super({sql:e,params:i}),this.client=t,this.queryString=e,this.params=i,this.logger=n,this.fields=s,this.customResultMapper=o}async execute(t={}){const e=Em(this.params,t);this.logger.logQuery(this.queryString,e);const{fields:i,queryString:n,client:s,customResultMapper:o}=this,a=await s;return a.query(n,e)}async all(t={}){const e=Em(this.params,t);return this.logger.logQuery(this.queryString,e),(await this.client).query(this.queryString,e)}}$(Gw,Eg,"DuckDBWasmPreparedQuery");var Ag,Og;const Yl=class Yl extends(Og=$w,Ag=xt,Og){constructor(e,i,n,s={}){super(i);$(this,"logger");this.client=e,this.schema=n,this.options=s,this.logger=s.logger??new _w}prepareQuery(e,i,n,s,o){return new Gw(this.client,e.sql,e.params,this.logger,i,o)}async query(e,i){return this.logger.logQuery(e,i),(await this.client).query(e,i)}async queryObjects(e,i){return this.logger.logQuery(e,i),(await this.client).query(e,i)}transaction(e,i){return xD(this.client,async n=>{const s=new Yl(n,this.dialect,this.schema,this.options),o=new Rh(this.dialect,s,this.schema);return i&&await o.setTransaction(i),e(o)})}};$(Yl,Ag,"DuckDBWasmSession");let Gl=Yl;var Fg,Pg;const ql=class ql extends(Pg=Vw,Fg=xt,Pg){constructor(e,i,n,s=0){super(e,i,n,s);$(this,"dialect");$(this,"session");this.dialect=e,this.session=i}async transaction(e){return SD(this.session.client,"",async i=>{const n=new Gl(i,this.dialect,this.schema,this.session.options),s=new ql(this.dialect,n,this.schema);return e(s)})}};$(ql,Fg,"DuckDBWasmTransaction");let Rh=ql;var Mg,Dg;class Ww extends(Dg=Yf,Mg=xt,Dg){}$(Ww,Mg,"DuckDBWasmDatabase");function ko(r,t={}){const e=new Bo({casing:t.casing});let i;t.logger===!0?i=new vw:t.logger!==!1&&(i=t.logger);let n;if(t.schema){const a=rR(t.schema,oR);n={fullSchema:t.schema,schema:a.tables,tableNamesMap:a.tableNamesMap}}const s=new Gl(r,e,n,{logger:i}),o=new Ww(e,s,n);return o.$client=r,o}function Fm(r,t){const e=gR(r);let i;return e.bundles==="import-url"?i=(async()=>{const s=await Sh();switch(s){case"browser":return(await ln(async()=>{const{getImportUrlBundles:o}=await import("./import-url-browser-CPN8ipMD.js");return{getImportUrlBundles:o}},__vite__mapDeps([3,4]))).getImportUrlBundles();case"node":return await(await ln(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}"`)}})():i=(async()=>{const s=await Sh();switch(s){case"browser":return(await ln(async()=>{const{getBundles:o}=await import("./default-browser-BrgSDbLD.js");return{getBundles:o}},[])).getBundles();case"node":return await(await ln(async()=>{const{getBundles:o}=await import("./default-node-Bif61nM5.js");return{getBundles:o}},__vite__mapDeps([0,1,2]))).getBundles();default:throw new Error(`Unsupported environment: "${s}"`)}})(),ko(hw({bundles:i,logger:e.logger?new I0:void 0,storage:e.storage}),t)}function Pm(...r){if(typeof r[0]=="string")return Fm(r[0],r[1]);if(MD(r[0])){const{connection:t,client:e,...i}=r[0];if(e)return ko(e,i);if(typeof t=="string")return Fm(t,i);if(typeof t>"u")throw new Error("connection option is required");return ko(hw({bundles:t.bundles,logger:t.logger,storage:t.storage}),i)}return ko(r[0],r[1])}(r=>{function t(e){return ko({options:{parsers:{},serializers:{}}},e)}r.mock=t})(Pm||(Pm={}));export{L1 as A,TR as D,xR as I,pC as J,eI as L,_c as M,wR as T,fi as a,Re as b,Pm as d,sa as e,SR as l}; diff --git a/assets/Textarea.vue_vue_type_script_setup_true_lang-CLcoVpDI.js b/assets/Textarea.vue_vue_type_script_setup_true_lang-CskDgflv.js similarity index 75% rename from assets/Textarea.vue_vue_type_script_setup_true_lang-CLcoVpDI.js rename to assets/Textarea.vue_vue_type_script_setup_true_lang-CskDgflv.js index 5808923aadaf602cc8eaac91f7eb3467f92a847b..173dcd9098b340d4919eae2194a40cbf0d165451 100644 --- a/assets/Textarea.vue_vue_type_script_setup_true_lang-CLcoVpDI.js +++ b/assets/Textarea.vue_vue_type_script_setup_true_lang-CskDgflv.js @@ -1 +1 @@ -import{_ as r}from"./Basic.vue_vue_type_script_setup_true_lang-CuYLN0Ir.js";import{d as t,cf as u,ac as d,o as n}from"./index-CNH1g_GM.js";const p=t({__name:"Textarea",props:{modelValue:{default:""},modelModifiers:{}},emits:["update:modelValue"],setup(l){const e=u(l,"modelValue");return(s,a)=>(n(),d(r,{modelValue:e.value,"onUpdate:modelValue":a[0]||(a[0]=o=>e.value=o),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-sm":"","outline-none":"",shadow:"sm",bg:"neutral-50 dark:neutral-950 focus:neutral-50 dark:focus:neutral-900"},null,8,["modelValue"]))}});export{p as _}; +import{_ as r}from"./Basic.vue_vue_type_script_setup_true_lang-Q6h2vVkt.js";import{d as t,cf as u,bk as d,o as n}from"./index-B06xwjXa.js";const p=t({__name:"Textarea",props:{modelValue:{default:""},modelModifiers:{}},emits:["update:modelValue"],setup(l){const e=u(l,"modelValue");return(s,a)=>(n(),d(r,{modelValue:e.value,"onUpdate:modelValue":a[0]||(a[0]=o=>e.value=o),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-sm":"","outline-none":"",shadow:"sm",bg:"neutral-50 dark:neutral-950 focus:neutral-50 dark:focus:neutral-900"},null,8,["modelValue"]))}});export{p as _}; diff --git a/assets/TransitionVertical.vue_vue_type_script_setup_true_lang-DLt6RcnD.js b/assets/TransitionVertical.vue_vue_type_script_setup_true_lang-CyZTJR0c.js similarity index 72% rename from assets/TransitionVertical.vue_vue_type_script_setup_true_lang-DLt6RcnD.js rename to assets/TransitionVertical.vue_vue_type_script_setup_true_lang-CyZTJR0c.js index d2b4e856ee53370d30d8fc7385033bcfde973d8b..6ef894aeb26c29509bc4917a97f759aa991747eb 100644 --- a/assets/TransitionVertical.vue_vue_type_script_setup_true_lang-DLt6RcnD.js +++ b/assets/TransitionVertical.vue_vue_type_script_setup_true_lang-CyZTJR0c.js @@ -1 +1 @@ -import{d as T,ac as l,o as m,ck as B,ad as b,a9 as v}from"./index-CNH1g_GM.js";const n="0px",W=T({__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 a=o.animate(s,d);o.style.height=t.height,a.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),a=g(d,s),e={duration:r.duration,easing:r.easingEnter};h(i,s,t,a,e)}function f(o,t){const i=o,s=p(i),{height:d}=getComputedStyle(i);i.style.height=d,i.style.overflow="hidden";const a=g(d,s).reverse(),e={duration:r.duration,easing:r.easingLeave};h(i,s,t,a,e)}return(o,t)=>(m(),l(B,{css:!1,onEnter:u,onLeave:f},{default:b(()=>[v(o.$slots,"default")]),_:3}))}});export{W as _}; +import{d as l,bk as T,o as m,ck as b,bl as B,bh as v}from"./index-B06xwjXa.js";const n="0px",W=l({__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)=>(m(),T(b,{css:!1,onEnter:u,onLeave:f},{default:B(()=>[v(o.$slots,"default")]),_:3}))}});export{W as _}; diff --git a/assets/_...all_-W_SPK8sN.js b/assets/_...all_--W64Thc1.js similarity index 63% rename from assets/_...all_-W_SPK8sN.js rename to assets/_...all_--W64Thc1.js index 9a773d66e68305c22bb08cfe079ef675d23bdf9e..8942e2c190eb865a758cdffe02a197c0f4eeab6d 100644 --- a/assets/_...all_-W_SPK8sN.js +++ b/assets/_...all_--W64Thc1.js @@ -1 +1 @@ -import{bZ as e,c,o as n}from"./index-CNH1g_GM.js";const o={};function _(t,r){return n(),c("div",null," 404 - Page not found ")}const s=e(o,[["render",_]]);export{s as default}; +import{c2 as e,c,o as n}from"./index-B06xwjXa.js";const o={};function _(t,r){return n(),c("div",null," 404 - Page not found ")}const s=e(o,[["render",_]]);export{s as default}; diff --git a/assets/airi-card-JBK1Hzhm.js b/assets/airi-card-BqOg7f9m.js similarity index 94% rename from assets/airi-card-JBK1Hzhm.js rename to assets/airi-card-BqOg7f9m.js index 82f2cb812ce8652e94a5e9e2e737a6470a4745de..d8309f5bc6314364042830eaddf025bd7cf7be61 100644 --- a/assets/airi-card-JBK1Hzhm.js +++ b/assets/airi-card-BqOg7f9m.js @@ -1,4 +1,4 @@ -import{a4 as W,cb as L,f as g,a0 as O,T as b,$ as D,w as G}from"./index-CNH1g_GM.js";import{c as H}from"./emotions-DWNSb738.js";import{u as N}from"./consciousness-DieQE4I6.js";import{u as k}from"./speech-DpuUb2e9.js";function q(a,u){return{role:"system",content:[a,H.map(n=>`- ${n}`).join(` +import{a4 as W,cb as L,f as g,a0 as O,T as b,$ as D,w as G}from"./index-B06xwjXa.js";import{c as H}from"./emotions-DWNSb738.js";import{u as N}from"./consciousness-D-_ZstxC.js";import{u as k}from"./speech-CLjA-Bq8.js";function q(a,u){return{role:"system",content:[a,H.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=N(),R=k(),{activeModel:l}=O(P),{activeSpeechVoiceId:m,activeSpeechModel:p}=O(R),$=s=>{const e=crypto.randomUUID();return a.value.set(e,f(s)),e},B=s=>{a.value.delete(s)},V=s=>a.value.get(s);function v(s){var t,r,i,c,d,h,_,y,S,x,C,M,I,w,E,A,T,U,j;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:((_=(h=e.modules)==null?void 0:h.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:(T=(A=e.modules)==null?void 0:A.speech)==null?void 0:T.language},vrm:(U=e.modules)==null?void 0:U.vrm,live2d:(j=e.modules)==null?void 0:j.live2d},agents:e.agents??{}}:{modules:o,agents:{}}}function f(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-10EiP3XX.js b/assets/alibaba-cloud-model-studio-10EiP3XX.js new file mode 100644 index 0000000000000000000000000000000000000000..c6630bf57a751f6bcc6bfe21e2497852fcc5d6ba --- /dev/null +++ b/assets/alibaba-cloud-model-studio-10EiP3XX.js @@ -0,0 +1 @@ +import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-Du5e5QRV.js";import{d as x,e as m,a0 as k,$,f as V,T as F,w as v,bk as B,o as I,bl as y,b as c,u as i,a as T}from"./index-B06xwjXa.js";import"./three-vrm.module-CtuEk7GG.js";import"./emotions-DWNSb738.js";import"./mcp-BfXpaYZf.js";import{u as U}from"./providers-BCv4E6z9.js";import{u as E}from"./speech-CLjA-Bq8.js";import{_ as f}from"./FieldRange.vue_vue_type_script_setup_true_lang-4kHfmFIm.js";import"./Select.vue_vue_type_style_index_0_lang-CzS20kE7.js";import{_ as K,a as L}from"./SpeechProviderSettings.vue_vue_type_script_setup_true_lang-BtrnMHoG.js";import{b as P}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./floating-ui.core-CgBsuaUc.js";import"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-gnnCLEsG.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-BxFBRVXD.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-CyZTJR0c.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-DM6oOIgU.js";import"./Input.vue_vue_type_script_setup_true_lang-CqiG06sL.js";import"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-DMARmtsp.js";import"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-BoAZvnmm.js";const N={flex:"~ col gap-4"},o="alibaba-cloud-model-studio",_="cosyvoice-v1",z=x({__name:"alibaba-cloud-model-studio",setup(G){const u={speed:1},d=m(0),l=m(1),n=m(0),p=E(),a=U(),{providers:g}=k(a),{t:s}=$(),h=V(()=>{var e;return!!((e=g.value[o])!=null&&e.apiKey)}),w=V(()=>p.availableVoices[o]||[]);async function M(e,r,t){const b=a.getProviderInstance(o);if(!b)throw new Error("Failed to initialize speech provider");const C=a.getProviderConfig(o),S=C.model||_;return await p.speech(b,S,e,r,{...C,...u})}return F(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)=>(I(),B(i(L),{"provider-id":o,"default-model":_,"additional-settings":u},{"voice-settings":y(()=>[T("div",N,[c(i(f),{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(f),{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(f),{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:y(()=>[c(i(K),{"available-voices":w.value,"generate-speech":M,"api-key-configured":h.value,"default-text":"Hello! This is a test of the ElevenLabs voice synthesis."},null,8,["available-voices","api-key-configured"])]),_:1}))}});typeof P=="function"&&P(z);export{z as default}; diff --git a/assets/alibaba-cloud-model-studio-DfaR_dR0.js b/assets/alibaba-cloud-model-studio-DfaR_dR0.js deleted file mode 100644 index 390dbafc360d67160b3879df973229dbe8b468bf..0000000000000000000000000000000000000000 --- a/assets/alibaba-cloud-model-studio-DfaR_dR0.js +++ /dev/null @@ -1 +0,0 @@ -import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-BQHOFrhO.js";import{d as x,e as m,a0 as $,$ as k,f as V,T as F,w as c,ac as B,o as I,ad as y,b as v,u as i,a as T}from"./index-CNH1g_GM.js";import"./three-vrm-animation.module-B_hGdUpX.js";import"./mcp-B7-jaCfZ.js";import"./emotions-DWNSb738.js";import{u as U}from"./providers-DP46_3AG.js";import{u as E}from"./speech-DpuUb2e9.js";import{_ as f}from"./FieldRange.vue_vue_type_script_setup_true_lang-Dou4SIkT.js";import"./Select.vue_vue_type_style_index_0_lang-BIffysKh.js";import{_ as K,a as L}from"./SpeechProviderSettings.vue_vue_type_script_setup_true_lang-C4Rxa7-o.js";import{b as P}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./floating-ui.core-CgBsuaUc.js";import"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-C-ZUDDxT.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-dwKULsMl.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-DLt6RcnD.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-tEOSPb7v.js";import"./Input.vue_vue_type_script_setup_true_lang-CvnY3pbX.js";import"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-CR2pR4yl.js";import"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-BpJun8-8.js";const N={flex:"~ col gap-4"},o="alibaba-cloud-model-studio",_="cosyvoice-v1",z=x({__name:"alibaba-cloud-model-studio",setup(G){const u={speed:1},d=m(0),l=m(1),n=m(0),p=E(),a=U(),{providers:g}=$(a),{t:s}=k(),h=V(()=>{var e;return!!((e=g.value[o])!=null&&e.apiKey)}),w=V(()=>p.availableVoices[o]||[]);async function M(e,r,t){const b=a.getProviderInstance(o);if(!b)throw new Error("Failed to initialize speech provider");const C=a.getProviderConfig(o),S=C.model||_;return await p.speech(b,S,e,r,{...C,...u})}return F(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)}),c(d,async()=>{const e=a.getProviderConfig(o);e.pitch=d.value}),c(l,async()=>{const e=a.getProviderConfig(o);e.speed=l.value}),c(n,async()=>{const e=a.getProviderConfig(o);e.volume=n.value}),c(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)=>(I(),B(i(L),{"provider-id":o,"default-model":_,"additional-settings":u},{"voice-settings":y(()=>[T("div",N,[v(i(f),{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"]),v(i(f),{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"]),v(i(f),{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:y(()=>[v(i(K),{"available-voices":w.value,"generate-speech":M,"api-key-configured":h.value,"default-text":"Hello! This is a test of the ElevenLabs voice synthesis."},null,8,["available-voices","api-key-configured"])]),_:1}))}});typeof P=="function"&&P(z);export{z as default}; diff --git a/assets/anthropic-DEAl6Zmk.js b/assets/anthropic-DEAl6Zmk.js deleted file mode 100644 index eae6d5d502ccc0ecbeaecd62ac5d70051751edca..0000000000000000000000000000000000000000 --- a/assets/anthropic-DEAl6Zmk.js +++ /dev/null @@ -1 +0,0 @@ -import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-BQHOFrhO.js";import{d as S,$ as x,V as U,a0 as V,f as v,T as w,w as C,ac as K,o as R,ad as c,a as i,b as l,cg as p,u as a}from"./index-CNH1g_GM.js";import"./three-vrm-animation.module-B_hGdUpX.js";import"./mcp-B7-jaCfZ.js";import"./emotions-DWNSb738.js";import{u as $}from"./providers-DP46_3AG.js";import"./Select.vue_vue_type_style_index_0_lang-BIffysKh.js";import{_ as O,a as A}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-C-ZUDDxT.js";import{_ as I}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-CR2pR4yl.js";import{_ as N,a as T}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-BpJun8-8.js";import{_ as B}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-DUl7ZNEY.js";import{b as _}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./floating-ui.core-CgBsuaUc.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-dwKULsMl.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-DLt6RcnD.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-tEOSPb7v.js";import"./Input.vue_vue_type_script_setup_true_lang-CvnY3pbX.js";const e="anthropic",z=S({__name:"anthropic",setup(M){const{t:u}=x(),g=U(),f=$(),{providers:o}=V(f),m=v(()=>f.getProviderMetadata(e)),s=v({get:()=>{var t;return((t=o.value[e])==null?void 0:t.apiKey)||""},set:t=>{o.value[e]||(o.value[e]={}),o.value[e].apiKey=t}}),n=v({get:()=>{var t;return((t=o.value[e])==null?void 0:t.baseUrl)||"https://api.anthropic.com/v1/"},set:t=>{o.value[e]||(o.value[e]={}),o.value[e].baseUrl=t}});w(()=>{var t,r;o.value[e]||(o.value[e]={baseUrl:"https://api.anthropic.com/v1/"}),s.value=((t=o.value[e])==null?void 0:t.apiKey)||"",n.value=((r=o.value[e])==null?void 0:r.baseUrl)||"https://api.anthropic.com/v1/"}),C([s,n],()=>{o.value[e]={...o.value[e],apiKey:s.value,baseUrl:n.value||"https://api.anthropic.com/v1/"}});function y(){o.value[e]={baseUrl:"https://api.anthropic.com/v1/"}}return(t,r)=>{var h,b;return R(),K(a(B),{"provider-name":((h=m.value)==null?void 0:h.localizedName)||"Anthropic | Claude","provider-icon":(b=m.value)==null?void 0:b.icon,"on-back":()=>a(g).back()},{default:c(()=>[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-semibold":"",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(a(N),null,{default:c(()=>[l(a(T),{title:a(u)("settings.pages.providers.common.section.basic.title"),description:a(u)("settings.pages.providers.common.section.basic.description"),"on-reset":y},{default:c(()=>{var d;return[l(a(I),{modelValue:s.value,"onUpdate:modelValue":r[0]||(r[0]=k=>s.value=k),"provider-name":((d=m.value)==null?void 0:d.localizedName)||"Anthropic",placeholder:"sk-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(a(O),{title:a(u)("settings.pages.providers.common.section.advanced.title")},{default:c(()=>[l(a(A),{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,__:[2]},8,["provider-name","provider-icon","on-back"])}}});typeof _=="function"&&_(z);export{z as default}; diff --git a/assets/anthropic-DSSAGod2.js b/assets/anthropic-DSSAGod2.js new file mode 100644 index 0000000000000000000000000000000000000000..784cbe486525c3097d0d570e82758d12368ca27f --- /dev/null +++ b/assets/anthropic-DSSAGod2.js @@ -0,0 +1 @@ +import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-Du5e5QRV.js";import{d as S,$ as x,V as U,a0 as V,f as v,T as w,w as C,bk as K,o as R,bl as c,a as i,b as l,cg as p,u as a}from"./index-B06xwjXa.js";import"./three-vrm.module-CtuEk7GG.js";import"./emotions-DWNSb738.js";import"./mcp-BfXpaYZf.js";import{u as $}from"./providers-BCv4E6z9.js";import"./Select.vue_vue_type_style_index_0_lang-CzS20kE7.js";import{_ as O,a as A}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-gnnCLEsG.js";import{_ as I}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-DMARmtsp.js";import{_ as N,a as T}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-BoAZvnmm.js";import{_ as B}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-DYsKzYwL.js";import{b as _}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./floating-ui.core-CgBsuaUc.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-BxFBRVXD.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-CyZTJR0c.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-DM6oOIgU.js";import"./Input.vue_vue_type_script_setup_true_lang-CqiG06sL.js";const e="anthropic",z=S({__name:"anthropic",setup(M){const{t:u}=x(),g=U(),f=$(),{providers:o}=V(f),m=v(()=>f.getProviderMetadata(e)),s=v({get:()=>{var t;return((t=o.value[e])==null?void 0:t.apiKey)||""},set:t=>{o.value[e]||(o.value[e]={}),o.value[e].apiKey=t}}),n=v({get:()=>{var t;return((t=o.value[e])==null?void 0:t.baseUrl)||"https://api.anthropic.com/v1/"},set:t=>{o.value[e]||(o.value[e]={}),o.value[e].baseUrl=t}});w(()=>{var t,r;o.value[e]||(o.value[e]={baseUrl:"https://api.anthropic.com/v1/"}),s.value=((t=o.value[e])==null?void 0:t.apiKey)||"",n.value=((r=o.value[e])==null?void 0:r.baseUrl)||"https://api.anthropic.com/v1/"}),C([s,n],()=>{o.value[e]={...o.value[e],apiKey:s.value,baseUrl:n.value||"https://api.anthropic.com/v1/"}});function y(){o.value[e]={baseUrl:"https://api.anthropic.com/v1/"}}return(t,r)=>{var h,b;return R(),K(a(B),{"provider-name":((h=m.value)==null?void 0:h.localizedName)||"Anthropic | Claude","provider-icon":(b=m.value)==null?void 0:b.icon,"on-back":()=>a(g).back()},{default:c(()=>[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-semibold":"",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(a(N),null,{default:c(()=>[l(a(T),{title:a(u)("settings.pages.providers.common.section.basic.title"),description:a(u)("settings.pages.providers.common.section.basic.description"),"on-reset":y},{default:c(()=>{var d;return[l(a(I),{modelValue:s.value,"onUpdate:modelValue":r[0]||(r[0]=k=>s.value=k),"provider-name":((d=m.value)==null?void 0:d.localizedName)||"Anthropic",placeholder:"sk-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(a(O),{title:a(u)("settings.pages.providers.common.section.advanced.title")},{default:c(()=>[l(a(A),{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,__:[2]},8,["provider-name","provider-icon","on-back"])}}});typeof _=="function"&&_(z);export{z as default}; diff --git a/assets/audio-CQiHFFsw.js b/assets/audio-IvjOg0zY.js similarity index 88% rename from assets/audio-CQiHFFsw.js rename to assets/audio-IvjOg0zY.js index db654bdf5ec290db57d75259b5a0407e186ec5e1..5f98e73efabef534e2efcc4b87f819365142c8a8 100644 --- a/assets/audio-CQiHFFsw.js +++ b/assets/audio-IvjOg0zY.js @@ -1 +1 @@ -import{d as s,e as f,c as d,o as p,a as t}from"./index-CNH1g_GM.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,e as f,c as d,o as p,a as t}from"./index-B06xwjXa.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-DYaqEJCO.js b/assets/background-remove-7t1fuPR2.js similarity index 99% rename from assets/background-remove-DYaqEJCO.js rename to assets/background-remove-7t1fuPR2.js index 1bc3eeb43a58f37d3a23c87da8e09f619d176e3a..aee6312520c2ad2007ebedec717c942a34cf0c53 100644 --- a/assets/background-remove-DYaqEJCO.js +++ b/assets/background-remove-7t1fuPR2.js @@ -1,4 +1,4 @@ -var _v=Object.defineProperty;var gv=(e,r,t)=>r in e?_v(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t;var Y=(e,r,t)=>gv(e,typeof r!="symbol"?r+"":r,t);import"./Select.vue_vue_type_style_index_0_lang-BIffysKh.js";import{_ as wv}from"./InputFile.vue_vue_type_script_setup_true_lang-bO5dM4_S.js";import{d as bv,e as zs,f as Mv,T as yv,c as Tn,o as En,a as Vr,b as vv,Y as Ef,c6 as Pf,c7 as Cf,W as Sf,a3 as xv,u as Tv}from"./index-CNH1g_GM.js";import"./floating-ui.core-CgBsuaUc.js";const la=new Map,kn=[],Ev=(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}}},Cv=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 Pv(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)})]},Sv="1.22.0";let $f="warning";const Ts={wasm:{},webgl:{},webgpu:{},versions:{common:Sv},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}`);$f=e}},get logLevel(){return $f}};Object.defineProperty(Ts,"logLevel",{enumerable:!0});const $v=Ts,kv=(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 c=0,d=p,_=p*2,f=-1;i==="RGBA"?(c=0,d=p,_=p*2,f=p*3):i==="RGB"?(c=0,d=p,_=p*2):i==="RBG"&&(c=0,_=p,d=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 c=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 d=4;let _=0,f=1,v=2,$=3,g=0,w=c,C=c*2,E=-1;a==="RGBA"?(g=0,w=c,C=c*2,E=c*3):a==="RGB"?(g=0,w=c,C=c*2):a==="RBG"&&(g=0,C=c,w=c*2),s=t.createImageData(o,n);for(let x=0;x{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 c=4,d=0,_=1,f=2,v=3,$=0,g=u,w=u*2,C=-1;a==="RGB"&&(c=3,d=0,_=1,f=2,v=-1),l==="RGBA"?C=u*3:l==="RBG"?($=0,w=u,g=u*2):l==="BGR"&&(w=0,g=u,$=u*2);for(let x=0;x{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 c=u(p);if(c!=null){let d=e.height,_=e.width;if(r!==void 0&&r.resizedHeight!==void 0&&r.resizedWidth!==void 0&&(d=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=d,a.width=_}else a.tensorFormat="RGBA",a.height=d,a.width=_;c.drawImage(e,0,0),i=c.getImageData(0,0,_,d).data}else throw new Error("Can not access image data")}else if(s){let p,c;if(r!==void 0&&r.resizedWidth!==void 0&&r.resizedHeight!==void 0?(p=r.resizedHeight,c=r.resizedWidth):(p=e.height,c=e.width),r!==void 0&&(a=r),a.format="RGBA",a.height=p,a.width=c,r!==void 0){const d=l();d.width=c,d.height=p;const _=u(d);if(_!=null)_.putImageData(e,0,0),i=_.getImageData(0,0,c,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 c=u(p);if(c!=null){const d=e.height,_=e.width;return c.drawImage(e,0,0,_,d),i=c.getImageData(0,0,_,d).data,a.height=d,a.width=_,Al(i,a)}else throw new Error("Can not access image data")}else{if(n)return new Promise((p,c)=>{const d=l(),_=u(d);if(!e||!_)return c();const f=new Image;f.crossOrigin="Anonymous",f.src=e,f.onload=()=>{d.width=f.width,d.height=f.height,_.drawImage(f,0,0,d.width,d.height);const v=_.getImageData(0,0,d.width,d.height);a.height=d.height,a.width=d.width,p(Al(v.data,a))}});throw new Error("Input data provided is not supported - aborted tensor creation")}if(i!==void 0)return Al(i,a);throw new Error("Input data provided is not supported - aborted tensor creation")},Fv=(e,r)=>{const{width:t,height:s,download:o,dispose:n}=r,i=[1,s,t,4];return new us({location:"texture",type:"float32",texture:e,dims:i,download:o,dispose:n})},Ov=(e,r)=>{const{dataType:t,dims:s,download:o,dispose:n}=r;return new us({location:"gpu-buffer",type:t??"float32",gpuBuffer:e,dims:s,download:o,dispose:n})},Dv=(e,r)=>{const{dataType:t,dims:s,download:o,dispose:n}=r;return new us({location:"ml-tensor",type:t??"float32",mlTensor:e,dims:s,download:o,dispose:n})},Lv=(e,r,t)=>new us({location:"cpu-pinned",type:e,data:r,dims:t??[r.length]}),ro=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 kf=!1;const zv=()=>{if(!kf){kf=!0;const e=typeof BigInt64Array<"u"&&BigInt64Array.from,r=typeof BigUint64Array<"u"&&BigUint64Array.from,t=globalThis.Float16Array,s=typeof t<"u"&&t.from;e&&(ro.set("int64",BigInt64Array),ua.set(BigInt64Array,"int64")),r&&(ro.set("uint64",BigUint64Array),ua.set(BigUint64Array,"uint64")),s?(ro.set("float16",t),ua.set(t,"float16")):ro.set("float16",Uint16Array)}},Bv=e=>{let r=1;for(let t=0;t{switch(e.location){case"cpu":return new us(e.type,e.data,r);case"cpu-pinned":return new us({location:"cpu-pinned",data:e.data,type:e.type,dims:r});case"texture":return new us({location:"texture",texture:e.texture,type:e.type,dims:r});case"gpu-buffer":return new us({location:"gpu-buffer",gpuBuffer:e.gpuBuffer,type:e.type,dims:r});case"ml-tensor":return new us({location:"ml-tensor",mlTensor:e.mlTensor,type:e.type,dims:r});default:throw new Error(`tensorReshape: tensor location ${e.location} is not supported`)}};let us=class{constructor(r,t,s){zv();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=ro.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=ro.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=Bv(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 Av(r,t)}static fromTexture(r,t){return Fv(r,t)}static fromGpuBuffer(r,t){return Ov(r,t)}static fromMLTensor(r,t){return Dv(r,t)}static fromPinnedBuffer(r,t,s){return Lv(r,t,s)}toDataURL(r){return kv(this,r)}toImageData(r){return Iv(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 Rv(this,r)}};const eo=us,db=(e,r)=>{(typeof Ts.trace>"u"?!Ts.wasm.trace:!Ts.trace)||console.timeStamp(`${e}::ORT::${r}`)},pb=(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 Ts.trace>"u"?!Ts.wasm.trace:!Ts.trace)||pb("BEGIN",e)},Fu=e=>{(typeof Ts.trace>"u"?!Ts.wasm.trace:!Ts.trace)||pb("END",e)};let jv=class hb{constructor(r){this.handler=r}async run(r,t,s){Au();const o={};let n={};if(typeof r!="object"||r===null||r instanceof eo||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 eo)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 c of this.outputNames)if(p.indexOf(c)!==-1){const d=t[c];(d===null||d instanceof eo)&&(u=!0,i=!1,o[c]=d)}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 eo?l[u]=p:l[u]=new eo(p.type,p.data,p.dims)}return Fu(),l}async release(){return this.handler.dispose()}static async create(r,t,s,o){Au();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 c=0,d=r.byteLength;if(typeof t=="object"&&t!==null)i=t;else if(typeof t=="number"){if(c=t,!Number.isSafeInteger(c))throw new RangeError("'byteOffset' must be an integer.");if(c<0||c>=p.byteLength)throw new RangeError(`'byteOffset' is out of range [0, ${p.byteLength}).`);if(d=r.byteLength-c,typeof s=="number"){if(d=s,!Number.isSafeInteger(d))throw new RangeError("'byteLength' must be an integer.");if(d<=0||c+d>p.byteLength)throw new RangeError(`'byteLength' is out of range (0, ${p.byteLength-c}].`);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,c,d)}else throw new TypeError("Unexpected argument[0]: must be 'path' or 'buffer'.");const[a,l]=await Cv(i),u=await a.createInferenceSessionHandler(n,l);return Fu(),new hb(u)}startProfiling(){this.handler.startProfiling()}endProfiling(){this.handler.endProfiling()}get inputNames(){return this.handler.inputNames}get outputNames(){return this.handler.outputNames}get inputMetadata(){return this.handler.inputMetadata}get outputMetadata(){return this.handler.outputMetadata}};const Nv=jv,Vv=Object.freeze(Object.defineProperty({__proto__:null,InferenceSession:Nv,TRACE:db,TRACE_FUNC_BEGIN:Au,TRACE_FUNC_END:Fu,Tensor:eo,env:$v,registerBackend:Ev},Symbol.toStringTag,{value:"Module"}));/*! +var _v=Object.defineProperty;var gv=(e,r,t)=>r in e?_v(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t;var Y=(e,r,t)=>gv(e,typeof r!="symbol"?r+"":r,t);import"./Select.vue_vue_type_style_index_0_lang-CzS20kE7.js";import{_ as wv}from"./InputFile.vue_vue_type_script_setup_true_lang-B7xRsonQ.js";import{d as bv,e as zs,f as Mv,T as yv,c as Tn,o as En,a as Vr,b as vv,Y as Ef,c6 as Pf,c7 as Cf,W as Sf,a3 as xv,u as Tv}from"./index-B06xwjXa.js";import"./floating-ui.core-CgBsuaUc.js";const la=new Map,kn=[],Ev=(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}}},Cv=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 Pv(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)})]},Sv="1.22.0";let $f="warning";const Ts={wasm:{},webgl:{},webgpu:{},versions:{common:Sv},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}`);$f=e}},get logLevel(){return $f}};Object.defineProperty(Ts,"logLevel",{enumerable:!0});const $v=Ts,kv=(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 c=0,d=p,_=p*2,f=-1;i==="RGBA"?(c=0,d=p,_=p*2,f=p*3):i==="RGB"?(c=0,d=p,_=p*2):i==="RBG"&&(c=0,_=p,d=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 c=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 d=4;let _=0,f=1,v=2,$=3,g=0,w=c,C=c*2,E=-1;a==="RGBA"?(g=0,w=c,C=c*2,E=c*3):a==="RGB"?(g=0,w=c,C=c*2):a==="RBG"&&(g=0,C=c,w=c*2),s=t.createImageData(o,n);for(let x=0;x{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 c=4,d=0,_=1,f=2,v=3,$=0,g=u,w=u*2,C=-1;a==="RGB"&&(c=3,d=0,_=1,f=2,v=-1),l==="RGBA"?C=u*3:l==="RBG"?($=0,w=u,g=u*2):l==="BGR"&&(w=0,g=u,$=u*2);for(let x=0;x{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 c=u(p);if(c!=null){let d=e.height,_=e.width;if(r!==void 0&&r.resizedHeight!==void 0&&r.resizedWidth!==void 0&&(d=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=d,a.width=_}else a.tensorFormat="RGBA",a.height=d,a.width=_;c.drawImage(e,0,0),i=c.getImageData(0,0,_,d).data}else throw new Error("Can not access image data")}else if(s){let p,c;if(r!==void 0&&r.resizedWidth!==void 0&&r.resizedHeight!==void 0?(p=r.resizedHeight,c=r.resizedWidth):(p=e.height,c=e.width),r!==void 0&&(a=r),a.format="RGBA",a.height=p,a.width=c,r!==void 0){const d=l();d.width=c,d.height=p;const _=u(d);if(_!=null)_.putImageData(e,0,0),i=_.getImageData(0,0,c,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 c=u(p);if(c!=null){const d=e.height,_=e.width;return c.drawImage(e,0,0,_,d),i=c.getImageData(0,0,_,d).data,a.height=d,a.width=_,Al(i,a)}else throw new Error("Can not access image data")}else{if(n)return new Promise((p,c)=>{const d=l(),_=u(d);if(!e||!_)return c();const f=new Image;f.crossOrigin="Anonymous",f.src=e,f.onload=()=>{d.width=f.width,d.height=f.height,_.drawImage(f,0,0,d.width,d.height);const v=_.getImageData(0,0,d.width,d.height);a.height=d.height,a.width=d.width,p(Al(v.data,a))}});throw new Error("Input data provided is not supported - aborted tensor creation")}if(i!==void 0)return Al(i,a);throw new Error("Input data provided is not supported - aborted tensor creation")},Fv=(e,r)=>{const{width:t,height:s,download:o,dispose:n}=r,i=[1,s,t,4];return new us({location:"texture",type:"float32",texture:e,dims:i,download:o,dispose:n})},Ov=(e,r)=>{const{dataType:t,dims:s,download:o,dispose:n}=r;return new us({location:"gpu-buffer",type:t??"float32",gpuBuffer:e,dims:s,download:o,dispose:n})},Dv=(e,r)=>{const{dataType:t,dims:s,download:o,dispose:n}=r;return new us({location:"ml-tensor",type:t??"float32",mlTensor:e,dims:s,download:o,dispose:n})},Lv=(e,r,t)=>new us({location:"cpu-pinned",type:e,data:r,dims:t??[r.length]}),ro=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 kf=!1;const zv=()=>{if(!kf){kf=!0;const e=typeof BigInt64Array<"u"&&BigInt64Array.from,r=typeof BigUint64Array<"u"&&BigUint64Array.from,t=globalThis.Float16Array,s=typeof t<"u"&&t.from;e&&(ro.set("int64",BigInt64Array),ua.set(BigInt64Array,"int64")),r&&(ro.set("uint64",BigUint64Array),ua.set(BigUint64Array,"uint64")),s?(ro.set("float16",t),ua.set(t,"float16")):ro.set("float16",Uint16Array)}},Bv=e=>{let r=1;for(let t=0;t{switch(e.location){case"cpu":return new us(e.type,e.data,r);case"cpu-pinned":return new us({location:"cpu-pinned",data:e.data,type:e.type,dims:r});case"texture":return new us({location:"texture",texture:e.texture,type:e.type,dims:r});case"gpu-buffer":return new us({location:"gpu-buffer",gpuBuffer:e.gpuBuffer,type:e.type,dims:r});case"ml-tensor":return new us({location:"ml-tensor",mlTensor:e.mlTensor,type:e.type,dims:r});default:throw new Error(`tensorReshape: tensor location ${e.location} is not supported`)}};let us=class{constructor(r,t,s){zv();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=ro.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=ro.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=Bv(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 Av(r,t)}static fromTexture(r,t){return Fv(r,t)}static fromGpuBuffer(r,t){return Ov(r,t)}static fromMLTensor(r,t){return Dv(r,t)}static fromPinnedBuffer(r,t,s){return Lv(r,t,s)}toDataURL(r){return kv(this,r)}toImageData(r){return Iv(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 Rv(this,r)}};const eo=us,db=(e,r)=>{(typeof Ts.trace>"u"?!Ts.wasm.trace:!Ts.trace)||console.timeStamp(`${e}::ORT::${r}`)},pb=(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 Ts.trace>"u"?!Ts.wasm.trace:!Ts.trace)||pb("BEGIN",e)},Fu=e=>{(typeof Ts.trace>"u"?!Ts.wasm.trace:!Ts.trace)||pb("END",e)};let jv=class hb{constructor(r){this.handler=r}async run(r,t,s){Au();const o={};let n={};if(typeof r!="object"||r===null||r instanceof eo||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 eo)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 c of this.outputNames)if(p.indexOf(c)!==-1){const d=t[c];(d===null||d instanceof eo)&&(u=!0,i=!1,o[c]=d)}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 eo?l[u]=p:l[u]=new eo(p.type,p.data,p.dims)}return Fu(),l}async release(){return this.handler.dispose()}static async create(r,t,s,o){Au();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 c=0,d=r.byteLength;if(typeof t=="object"&&t!==null)i=t;else if(typeof t=="number"){if(c=t,!Number.isSafeInteger(c))throw new RangeError("'byteOffset' must be an integer.");if(c<0||c>=p.byteLength)throw new RangeError(`'byteOffset' is out of range [0, ${p.byteLength}).`);if(d=r.byteLength-c,typeof s=="number"){if(d=s,!Number.isSafeInteger(d))throw new RangeError("'byteLength' must be an integer.");if(d<=0||c+d>p.byteLength)throw new RangeError(`'byteLength' is out of range (0, ${p.byteLength-c}].`);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,c,d)}else throw new TypeError("Unexpected argument[0]: must be 'path' or 'buffer'.");const[a,l]=await Cv(i),u=await a.createInferenceSessionHandler(n,l);return Fu(),new hb(u)}startProfiling(){this.handler.startProfiling()}endProfiling(){this.handler.endProfiling()}get inputNames(){return this.handler.inputNames}get outputNames(){return this.handler.outputNames}get inputMetadata(){return this.handler.inputMetadata}get outputMetadata(){return this.handler.outputMetadata}};const Nv=jv,Vv=Object.freeze(Object.defineProperty({__proto__:null,InferenceSession:Nv,TRACE:db,TRACE_FUNC_BEGIN:Au,TRACE_FUNC_END:Fu,Tensor:eo,env:$v,registerBackend:Ev},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-3-8NLufH.js b/assets/chat-Ch1uJ9j2.js similarity index 93% rename from assets/chat-3-8NLufH.js rename to assets/chat-Ch1uJ9j2.js index a737619fc176efb2c415db45a7e7a7233d163fd4..5de5964948e481974ef1cdb9fa519956fa9cbb04 100644 --- a/assets/chat-3-8NLufH.js +++ b/assets/chat-Ch1uJ9j2.js @@ -1 +1 @@ -import{d as N,cb as W,e as S,c as h,o as y,a as i,ae as C,cc as E,u as M,aP as A,c6 as q,c7 as z,a5 as D,W as U,Y as $}from"./index-CNH1g_GM.js";import{s as K}from"./index-YUUT4m-_.js";import"./index-LHmcipjy.js";var P=()=>{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);Y.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=O.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=>{O.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 Q(){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 G({listeners:e.steps})}}}async function X(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(Q(),[[[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=>D(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 X(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(q,null,z(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 P,cb as W,e as S,c as h,o as y,a as i,bm as C,cc as E,u as M,bI as A,c6 as q,c7 as z,bd as D,W as U,Y as $}from"./index-B06xwjXa.js";import{s as K}from"./index-YUUT4m-_.js";import"./index-LHmcipjy.js";var B=()=>{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);Y.run(g,()=>{const s=[...new Set([...x.__internal__call_context,...v.__internal__call_context])];N.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=O.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=>{O.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 Q(){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 G({listeners:e.steps})}}}async function X(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=P({__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(Q(),[[[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=>D(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 X(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(q,null,z(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-AqUagaNH.js b/assets/cloudflare-workers-ai-AqUagaNH.js deleted file mode 100644 index 82a1692265fc9cbdd534f1ef58d9ff99aed62257..0000000000000000000000000000000000000000 --- a/assets/cloudflare-workers-ai-AqUagaNH.js +++ /dev/null @@ -1 +0,0 @@ -import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-BQHOFrhO.js";import{d as k,ce as y,cf as $,ac as I,o as h,u as l,$ as M,V as q,a0 as x,f as v,T as K,w as P,ad as f,b as c}from"./index-CNH1g_GM.js";import"./three-vrm-animation.module-B_hGdUpX.js";import"./mcp-B7-jaCfZ.js";import"./emotions-DWNSb738.js";import{u as z}from"./providers-DP46_3AG.js";import"./Select.vue_vue_type_style_index_0_lang-BIffysKh.js";import{_ as A}from"./FieldInput.vue_vue_type_script_setup_true_lang-tEOSPb7v.js";import{_ as B}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-CR2pR4yl.js";import{_ as C,a as N}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-BpJun8-8.js";import{_ as R}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-DUl7ZNEY.js";import{b as V}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./floating-ui.core-CgBsuaUc.js";import"./Input.vue_vue_type_script_setup_true_lang-CvnY3pbX.js";const S=k({__name:"ProviderAccountIdInput",props:y({placeholder:null,required:{type:Boolean},label:null,description:null},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(p){const r=p,u=$(p,"modelValue");return(n,e)=>(h(),I(l(A),{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",U=k({__name:"cloudflare-workers-ai",setup(p){const{t:r}=M(),u=q(),n=z(),{providers:e}=x(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}});K(()=>{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)||""}),P([s,d],()=>{e.value[a]={...e.value[a],apiKey:s.value,accountId:d.value}});function w(){var o;e.value[a]={...(o=t.value)==null?void 0:o.defaultOptions}}return(o,i)=>{var _,g;return h(),I(l(R),{"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(C),null,{default:f(()=>[c(l(N),{title:l(r)("settings.pages.providers.common.section.basic.title"),description:l(r)("settings.pages.providers.common.section.basic.description"),"on-reset":w},{default:f(()=>{var b;return[c(l(B),{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(S),{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"])}}});typeof V=="function"&&V(U);export{U as default}; diff --git a/assets/cloudflare-workers-ai-DG_-Hn68.js b/assets/cloudflare-workers-ai-DG_-Hn68.js new file mode 100644 index 0000000000000000000000000000000000000000..d9682d0a4573177a3b95e4375ad7972127a07dc3 --- /dev/null +++ b/assets/cloudflare-workers-ai-DG_-Hn68.js @@ -0,0 +1 @@ +import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-Du5e5QRV.js";import{d as k,ce as y,cf as $,bk as I,o as h,u as l,$ as M,V as q,a0 as x,f as v,T as K,w as P,bl as f,b as c}from"./index-B06xwjXa.js";import"./three-vrm.module-CtuEk7GG.js";import"./emotions-DWNSb738.js";import"./mcp-BfXpaYZf.js";import{u as z}from"./providers-BCv4E6z9.js";import"./Select.vue_vue_type_style_index_0_lang-CzS20kE7.js";import{_ as A}from"./FieldInput.vue_vue_type_script_setup_true_lang-DM6oOIgU.js";import{_ as B}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-DMARmtsp.js";import{_ as C,a as N}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-BoAZvnmm.js";import{_ as R}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-DYsKzYwL.js";import{b as V}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./floating-ui.core-CgBsuaUc.js";import"./Input.vue_vue_type_script_setup_true_lang-CqiG06sL.js";const S=k({__name:"ProviderAccountIdInput",props:y({placeholder:null,required:{type:Boolean},label:null,description:null},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(p){const r=p,u=$(p,"modelValue");return(n,e)=>(h(),I(l(A),{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",U=k({__name:"cloudflare-workers-ai",setup(p){const{t:r}=M(),u=q(),n=z(),{providers:e}=x(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}});K(()=>{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)||""}),P([s,d],()=>{e.value[a]={...e.value[a],apiKey:s.value,accountId:d.value}});function w(){var o;e.value[a]={...(o=t.value)==null?void 0:o.defaultOptions}}return(o,i)=>{var _,b;return h(),I(l(R),{"provider-name":(_=t.value)==null?void 0:_.localizedName,"provider-icon-color":(b=t.value)==null?void 0:b.iconColor,"on-back":()=>l(u).back()},{default:f(()=>[c(l(C),null,{default:f(()=>[c(l(N),{title:l(r)("settings.pages.providers.common.section.basic.title"),description:l(r)("settings.pages.providers.common.section.basic.description"),"on-reset":w},{default:f(()=>{var g;return[c(l(B),{modelValue:s.value,"onUpdate:modelValue":i[0]||(i[0]=m=>s.value=m),"provider-name":(g=t.value)==null?void 0:g.localizedName,placeholder:l(r)("settings.pages.providers.provider.cloudflare-workers-ai.fields.field.api-key.placeholder")},null,8,["modelValue","provider-name","placeholder"]),c(l(S),{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"])}}});typeof V=="function"&&V(U);export{U as default}; diff --git a/assets/consciousness-03dOPB9r.js b/assets/consciousness-03dOPB9r.js deleted file mode 100644 index 4bc0ae40d07e4f678346d4b9eed748e0d7adc063..0000000000000000000000000000000000000000 --- a/assets/consciousness-03dOPB9r.js +++ /dev/null @@ -1 +0,0 @@ -import{d as R,a0 as h,$ as U,T as z,c5 as B,c as r,o as n,a as e,ae as b,W as f,Y as i,u as s,c6 as k,c7 as D,b as T,ad as q,b_ as j,ac as y,aP as u,cc as E}from"./index-CNH1g_GM.js";import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-BQHOFrhO.js";import"./three-vrm-animation.module-B_hGdUpX.js";import"./mcp-B7-jaCfZ.js";import"./emotions-DWNSb738.js";import{u as F}from"./consciousness-DieQE4I6.js";import{u as Q}from"./providers-DP46_3AG.js";import"./Select.vue_vue_type_style_index_0_lang-BIffysKh.js";import{R as A,a as G}from"./RadioCardSimple-DMkL9ZMC.js";import{b as M}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./floating-ui.core-CgBsuaUc.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-DLt6RcnD.js";import"./Input.vue_vue_type_script_setup_true_lang-CvnY3pbX.js";const I={bg:"neutral-50 dark:[rgba(0,0,0,0.3)]","rounded-xl":"","p-4":"",flex:"~ col gap-4"},W={flex:"~ col gap-4"},Y={class:"text-lg text-neutral-500 md:text-2xl dark:text-neutral-500"},$={text:"neutral-400 dark:neutral-400"},H={"max-w-full":""},J={key:0,flex:"~ row gap-4",style:{"scrollbar-width":"none"},"min-w-0":"","of-x-scroll":"","scroll-smooth":"",role:"radiogroup"},K={key:1},O={key:0},X={flex:"~ col gap-4"},Z={class:"text-lg md:text-2xl"},ee={text:"neutral-400 dark:neutral-400"},se={key:0,class:"flex items-center justify-center py-4"},te={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"},oe={class:"flex flex-col"},ie={class:"font-medium"},ne={class:"text-sm text-red-600 dark:text-red-400"},le={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"},re={class:"flex flex-col"},de={class:"font-medium"},ae={class:"text-sm text-amber-600 dark:text-amber-400"},ce={key:1},ue={flex:"~ col gap-4"},pe={class:"text-lg text-neutral-500 md:text-2xl dark:text-neutral-400"},me={text:"neutral-400 dark:neutral-500"},xe={class:"flex items-center gap-3 border border-primary-200 rounded-lg bg-primary-50 p-4 dark:border-primary-800 dark:bg-primary-900/20"},ve={class:"flex flex-col"},ge={class:"font-medium"},_e={class:"text-sm text-primary-600 dark:text-primary-400"},he={class:"mt-2"},be={class:"mb-1 block text-sm font-medium"},fe=["placeholder"],ke={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":""},ye=R({__name:"consciousness",setup(Me){const w=Q(),m=F(),{availableProviders:V,availableTextGenerationsProvidersMetadata:C}=h(w),{activeProvider:d,activeModel:a,customModelName:P,modelSearchQuery:c,supportsModelListing:x,providerModels:p,isLoadingActiveProviderModels:v,activeProviderModelError:g}=h(m),{t}=U();z(async()=>{await m.loadModelsForProvider(d.value)});function S(_){P.value=_}return(_,o)=>{const N=B("motion");return n(),r(k,null,[e("div",I,[e("div",null,[e("div",W,[e("div",null,[e("h2",Y,i(s(t)("settings.pages.providers.title")),1),e("div",$,[e("span",null,i(s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.description")),1)])]),e("div",H,[s(V).length>0?(n(),r("fieldset",J,[(n(!0),r(k,null,D(s(C),l=>(n(),y(s(G),{id:l.id,key:l.id,modelValue:s(d),"onUpdate:modelValue":o[0]||(o[0]=L=>u(d)?d.value=L:null),name:"provider",value:l.id,title:l.localizedName,description:l.localizedDescription},null,8,["id","modelValue","value","title","description"]))),128))])):(n(),r("div",K,[T(s(j),{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:q(()=>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,__:[4]})]))])])]),s(d)&&s(x)?(n(),r("div",O,[e("div",X,[e("div",null,[e("h2",Z,i(s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.title")),1),e("div",ee,[e("span",null,i(s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.subtitle")),1)])]),s(v)?(n(),r("div",se,[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(g)?(n(),r("div",te,[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",oe,[e("span",ie,i(s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.error")),1),e("span",ne,i(s(g)),1)])])):s(p).length===0&&!s(v)?(n(),r("div",le,[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",re,[e("span",de,i(s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.no_models")),1),e("span",ae,i(s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.no_models_description")),1)])])):s(p).length>0?(n(),y(s(A),{key:3,modelValue:s(a),"onUpdate:modelValue":o[1]||(o[1]=l=>u(a)?a.value=l:null),"search-query":s(c),"onUpdate:searchQuery":o[2]||(o[2]=l=>u(c)?c.value=l:null),items:s(p),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":S},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"])):f("",!0)])])):s(d)&&!s(x)?(n(),r("div",ce,[e("div",ue,[e("div",null,[e("h2",pe,i(s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.title")),1),e("div",me,[e("span",null,i(s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.subtitle")),1)])]),e("div",xe,[o[8]||(o[8]=e("div",{"i-solar:info-circle-line-duotone":"",class:"text-2xl text-primary-500 dark:text-primary-400"},null,-1)),e("div",ve,[e("span",ge,i(s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.not_supported")),1),e("span",_e,i(s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.not_supported_description")),1)])]),e("div",he,[e("label",be,i(s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.manual_model_name")),1),b(e("input",{"onUpdate:modelValue":o[3]||(o[3]=l=>u(a)?a.value=l: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,fe),[[E,s(a)]])])])])):f("",!0)]),b((n(),r("div",ke,o[9]||(o[9]=[e("div",{text:"60","i-solar:ghost-bold-duotone":""},null,-1)]))),[[N]])],64)}}});typeof M=="function"&&M(ye);export{ye as default}; diff --git a/assets/consciousness-DieQE4I6.js b/assets/consciousness-D-_ZstxC.js similarity index 90% rename from assets/consciousness-DieQE4I6.js rename to assets/consciousness-D-_ZstxC.js index 6ca98a93e85fe176c59574c959294a1654867654..d2ee4a49629ce0f2001544daf0d0b118fde76363 100644 --- a/assets/consciousness-DieQE4I6.js +++ b/assets/consciousness-D-_ZstxC.js @@ -1 +1 @@ -import{a4 as P,cb as n,e as M,f as r,w as L}from"./index-CNH1g_GM.js";import{u as w}from"./providers-DP46_3AG.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),p=r(()=>o.modelLoadError[s.value]||null),g=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:p,filteredModels:g,resetModelSelection:u,loadModelsForProvider:v}});export{h as u}; +import{a4 as P,cb as n,e as M,f as r,w as L}from"./index-B06xwjXa.js";import{u as w}from"./providers-BCv4E6z9.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),p=r(()=>o.modelLoadError[s.value]||null),g=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:p,filteredModels:g,resetModelSelection:u,loadModelsForProvider:v}});export{h as u}; diff --git a/assets/consciousness-D135g0Zv.js b/assets/consciousness-D135g0Zv.js new file mode 100644 index 0000000000000000000000000000000000000000..c0c6e00b8b617e166a8f6c911c478b92d7f326a5 --- /dev/null +++ b/assets/consciousness-D135g0Zv.js @@ -0,0 +1 @@ +import{d as R,a0 as b,$ as U,T as z,c5 as B,c as r,o as n,a as e,bm as h,W as f,Y as i,u as s,c6 as k,c7 as D,b as T,bl as q,c3 as j,bk as y,bI as u,cc as E}from"./index-B06xwjXa.js";import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-Du5e5QRV.js";import"./three-vrm.module-CtuEk7GG.js";import"./emotions-DWNSb738.js";import"./mcp-BfXpaYZf.js";import{u as F}from"./consciousness-D-_ZstxC.js";import{u as I}from"./providers-BCv4E6z9.js";import"./Select.vue_vue_type_style_index_0_lang-CzS20kE7.js";import{R as Q,a as A}from"./RadioCardSimple-DEecfDCY.js";import{b as M}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./floating-ui.core-CgBsuaUc.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-CyZTJR0c.js";import"./Input.vue_vue_type_script_setup_true_lang-CqiG06sL.js";const G={bg:"neutral-50 dark:[rgba(0,0,0,0.3)]","rounded-xl":"","p-4":"",flex:"~ col gap-4"},W={flex:"~ col gap-4"},Y={class:"text-lg text-neutral-500 md:text-2xl dark:text-neutral-500"},$={text:"neutral-400 dark:neutral-400"},H={"max-w-full":""},J={key:0,flex:"~ row gap-4",style:{"scrollbar-width":"none"},"min-w-0":"","of-x-scroll":"","scroll-smooth":"",role:"radiogroup"},K={key:1},O={key:0},X={flex:"~ col gap-4"},Z={class:"text-lg md:text-2xl"},ee={text:"neutral-400 dark:neutral-400"},se={key:0,class:"flex items-center justify-center py-4"},te={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"},oe={class:"flex flex-col"},ie={class:"font-medium"},ne={class:"text-sm text-red-600 dark:text-red-400"},le={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"},re={class:"flex flex-col"},de={class:"font-medium"},ae={class:"text-sm text-amber-600 dark:text-amber-400"},ce={key:1},ue={flex:"~ col gap-4"},pe={class:"text-lg text-neutral-500 md:text-2xl dark:text-neutral-400"},me={text:"neutral-400 dark:neutral-500"},xe={class:"flex items-center gap-3 border border-primary-200 rounded-lg bg-primary-50 p-4 dark:border-primary-800 dark:bg-primary-900/20"},ve={class:"flex flex-col"},ge={class:"font-medium"},_e={class:"text-sm text-primary-600 dark:text-primary-400"},be={class:"mt-2"},he={class:"mb-1 block text-sm font-medium"},fe=["placeholder"],ke={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":""},ye=R({__name:"consciousness",setup(Me){const w=I(),m=F(),{availableProviders:V,availableTextGenerationsProvidersMetadata:C}=b(w),{activeProvider:d,activeModel:a,customModelName:P,modelSearchQuery:c,supportsModelListing:x,providerModels:p,isLoadingActiveProviderModels:v,activeProviderModelError:g}=b(m),{t}=U();z(async()=>{await m.loadModelsForProvider(d.value)});function S(_){P.value=_}return(_,o)=>{const N=B("motion");return n(),r(k,null,[e("div",G,[e("div",null,[e("div",W,[e("div",null,[e("h2",Y,i(s(t)("settings.pages.providers.title")),1),e("div",$,[e("span",null,i(s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.description")),1)])]),e("div",H,[s(V).length>0?(n(),r("fieldset",J,[(n(!0),r(k,null,D(s(C),l=>(n(),y(s(A),{id:l.id,key:l.id,modelValue:s(d),"onUpdate:modelValue":o[0]||(o[0]=L=>u(d)?d.value=L:null),name:"provider",value:l.id,title:l.localizedName,description:l.localizedDescription},null,8,["id","modelValue","value","title","description"]))),128))])):(n(),r("div",K,[T(s(j),{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:q(()=>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,__:[4]})]))])])]),s(d)&&s(x)?(n(),r("div",O,[e("div",X,[e("div",null,[e("h2",Z,i(s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.title")),1),e("div",ee,[e("span",null,i(s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.subtitle")),1)])]),s(v)?(n(),r("div",se,[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(g)?(n(),r("div",te,[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",oe,[e("span",ie,i(s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.error")),1),e("span",ne,i(s(g)),1)])])):s(p).length===0&&!s(v)?(n(),r("div",le,[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",re,[e("span",de,i(s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.no_models")),1),e("span",ae,i(s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.no_models_description")),1)])])):s(p).length>0?(n(),y(s(Q),{key:3,modelValue:s(a),"onUpdate:modelValue":o[1]||(o[1]=l=>u(a)?a.value=l:null),"search-query":s(c),"onUpdate:searchQuery":o[2]||(o[2]=l=>u(c)?c.value=l:null),items:s(p),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":S},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"])):f("",!0)])])):s(d)&&!s(x)?(n(),r("div",ce,[e("div",ue,[e("div",null,[e("h2",pe,i(s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.title")),1),e("div",me,[e("span",null,i(s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.subtitle")),1)])]),e("div",xe,[o[8]||(o[8]=e("div",{"i-solar:info-circle-line-duotone":"",class:"text-2xl text-primary-500 dark:text-primary-400"},null,-1)),e("div",ve,[e("span",ge,i(s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.not_supported")),1),e("span",_e,i(s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.not_supported_description")),1)])]),e("div",be,[e("label",he,i(s(t)("settings.pages.modules.consciousness.sections.section.provider-model-selection.manual_model_name")),1),h(e("input",{"onUpdate:modelValue":o[3]||(o[3]=l=>u(a)?a.value=l: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,fe),[[E,s(a)]])])])])):f("",!0)]),h((n(),r("div",ke,o[9]||(o[9]=[e("div",{text:"60","i-solar:ghost-bold-duotone":""},null,-1)]))),[[N]])],64)}}});typeof M=="function"&&M(ye);export{ye as default}; diff --git a/assets/deepseek-B53p4ZBr.js b/assets/deepseek-B53p4ZBr.js deleted file mode 100644 index 388da2ed940fe8e8f520bc130812994fc3901d7c..0000000000000000000000000000000000000000 --- a/assets/deepseek-B53p4ZBr.js +++ /dev/null @@ -1 +0,0 @@ -import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-BQHOFrhO.js";import{d as V,$ as U,V as $,a0 as y,f as c,T as K,w as h,ac as w,o as x,ad as u,b as l,u as t}from"./index-CNH1g_GM.js";import"./three-vrm-animation.module-B_hGdUpX.js";import"./mcp-B7-jaCfZ.js";import"./emotions-DWNSb738.js";import{u as z}from"./providers-DP46_3AG.js";import"./Select.vue_vue_type_style_index_0_lang-BIffysKh.js";import{_ as C,a as M}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-C-ZUDDxT.js";import{_ as N}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-CR2pR4yl.js";import{_ as P,a as R}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-BpJun8-8.js";import{_ as S}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-DUl7ZNEY.js";import{b as _}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./floating-ui.core-CgBsuaUc.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-dwKULsMl.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-DLt6RcnD.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-tEOSPb7v.js";import"./Input.vue_vue_type_script_setup_true_lang-CvnY3pbX.js";const a="deepseek",B=V({__name:"deepseek",setup(I){const{t:m}=U(),b=$(),d=z(),{providers:o}=y(d),n=c(()=>d.getProviderMetadata(a)),i=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}}),s=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}});K(()=>{var e,r;d.initializeProvider(a),i.value=((e=o.value[a])==null?void 0:e.apiKey)||"",s.value=((r=o.value[a])==null?void 0:r.baseUrl)||""}),h([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 v,f;return x(),w(t(S),{"provider-name":(v=n.value)==null?void 0:v.localizedName,"provider-icon-color":(f=n.value)==null?void 0:f.iconColor,"on-back":()=>t(b).back()},{default:u(()=>[l(t(P),null,{default:u(()=>[l(t(R),{title:t(m)("settings.pages.providers.common.section.basic.title"),description:t(m)("settings.pages.providers.common.section.basic.description"),"on-reset":g},{default:u(()=>{var p;return[l(t(N),{modelValue:i.value,"onUpdate:modelValue":r[0]||(r[0]=k=>i.value=k),"provider-name":(p=n.value)==null?void 0:p.localizedName,placeholder:"sk-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(t(C),{title:t(m)("settings.pages.providers.common.section.advanced.title")},{default:u(()=>[l(t(M),{modelValue:s.value,"onUpdate:modelValue":r[1]||(r[1]=p=>s.value=p),placeholder:"https://api.deepseek.com/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon-color","on-back"])}}});typeof _=="function"&&_(B);export{B as default}; diff --git a/assets/deepseek-CLW0ElgW.js b/assets/deepseek-CLW0ElgW.js new file mode 100644 index 0000000000000000000000000000000000000000..6bb8938bbd2d02f8fa1d8605b9374c6e973f44a7 --- /dev/null +++ b/assets/deepseek-CLW0ElgW.js @@ -0,0 +1 @@ +import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-Du5e5QRV.js";import{d as V,$ as U,V as $,a0 as y,f as c,T as K,w as h,bk as w,o as x,bl as u,b as l,u as t}from"./index-B06xwjXa.js";import"./three-vrm.module-CtuEk7GG.js";import"./emotions-DWNSb738.js";import"./mcp-BfXpaYZf.js";import{u as z}from"./providers-BCv4E6z9.js";import"./Select.vue_vue_type_style_index_0_lang-CzS20kE7.js";import{_ as C,a as M}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-gnnCLEsG.js";import{_ as N}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-DMARmtsp.js";import{_ as P,a as R}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-BoAZvnmm.js";import{_ as S}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-DYsKzYwL.js";import{b as _}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./floating-ui.core-CgBsuaUc.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-BxFBRVXD.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-CyZTJR0c.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-DM6oOIgU.js";import"./Input.vue_vue_type_script_setup_true_lang-CqiG06sL.js";const a="deepseek",B=V({__name:"deepseek",setup(I){const{t:m}=U(),b=$(),d=z(),{providers:o}=y(d),n=c(()=>d.getProviderMetadata(a)),i=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}}),s=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}});K(()=>{var e,r;d.initializeProvider(a),i.value=((e=o.value[a])==null?void 0:e.apiKey)||"",s.value=((r=o.value[a])==null?void 0:r.baseUrl)||""}),h([i,s],()=>{o.value[a]={...o.value[a],apiKey:i.value,baseUrl:s.value||""}});function k(){var e;o.value[a]={...(e=n.value)==null?void 0:e.defaultOptions}}return(e,r)=>{var v,f;return x(),w(t(S),{"provider-name":(v=n.value)==null?void 0:v.localizedName,"provider-icon-color":(f=n.value)==null?void 0:f.iconColor,"on-back":()=>t(b).back()},{default:u(()=>[l(t(P),null,{default:u(()=>[l(t(R),{title:t(m)("settings.pages.providers.common.section.basic.title"),description:t(m)("settings.pages.providers.common.section.basic.description"),"on-reset":k},{default:u(()=>{var p;return[l(t(N),{modelValue:i.value,"onUpdate:modelValue":r[0]||(r[0]=g=>i.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(C),{title:t(m)("settings.pages.providers.common.section.advanced.title")},{default:u(()=>[l(t(M),{modelValue:s.value,"onUpdate:modelValue":r[1]||(r[1]=p=>s.value=p),placeholder:"https://api.deepseek.com/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon-color","on-back"])}}});typeof _=="function"&&_(B);export{B as default}; diff --git a/assets/default-Jn9n3nXn.js b/assets/default-DlVYj8BF.js similarity index 89% rename from assets/default-Jn9n3nXn.js rename to assets/default-DlVYj8BF.js index fd28d37b251548b5b7aa1ec1d731ac77fd6440a5..aca3259be15c6c4cb48e2129d742b1176616662f 100644 --- a/assets/default-Jn9n3nXn.js +++ b/assets/default-DlVYj8BF.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-CNH1g_GM.js";import{H as d}from"./HeaderLink-LlW9hXo1.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-B06xwjXa.js";import{H as d}from"./HeaderLink-OTe6TGtK.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-CoUhZWYT.js b/assets/default-node-Bif61nM5.js similarity index 89% rename from assets/default-node-CoUhZWYT.js rename to assets/default-node-Bif61nM5.js index 6dc575afe6b9b0ee30c6e7ebfef961ed2ee2def1..27a9a100eb076ce8d15cbcdede083226410c2d90 100644 --- a/assets/default-node-CoUhZWYT.js +++ b/assets/default-node-Bif61nM5.js @@ -1 +1 @@ -import{cO as t}from"./index-CNH1g_GM.js";async function s(){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{s as getBundles}; +import{cO as t}from"./index-B06xwjXa.js";async function s(){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{s as getBundles}; diff --git a/assets/delays-DC8esD_g.js b/assets/delays-DC8esD_g.js deleted file mode 100644 index 47aa1bd30c838bfd1ea0451437c9fd64b4b46083..0000000000000000000000000000000000000000 --- a/assets/delays-DC8esD_g.js +++ /dev/null @@ -1 +0,0 @@ -import"./index-CHjdc0dt.js";import{b as g,l as _}from"./queues-BGJT-GZq.js";import"./three-vrm-animation.module-B_hGdUpX.js";import"./Select.vue_vue_type_style_index_0_lang-BIffysKh.js";import{_ as k}from"./Textarea.vue_vue_type_script_setup_true_lang-CLcoVpDI.js";import{d as b,e as r,c as n,o as t,a as e,b as y,u as x,Y as i,c6 as f,c7 as m}from"./index-CNH1g_GM.js";import"./emotions-DWNSb738.js";import"./queue-C-8apo-4.js";import"./floating-ui.core-CgBsuaUc.js";import"./Basic.vue_vue_type_script_setup_true_lang-CuYLN0Ir.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":""},E={"w-full":"","rounded-lg":"",bg:"neutral-100 dark:neutral-700","p-2":""},S={"w-full":"","rounded-lg":"",bg:"neutral-100 dark:neutral-700","p-2":""},U=b({__name:"delays",setup(B){const s=r(""),c=r([]),p=r([]),u=r(!1),d=g();d.onHandlerEvent("delay",a=>{p.value.push(a)});function v(){u.value=!0;const a=s.value.split("");for(const o of a)d.add(o);d.add(_),s.value="",u.value=!1}return(a,o)=>(t(),n("div",w,[e("div",h,[y(x(k),{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:v},null,8,["modelValue"]),e("button",M,i(u.value?"Processing...":"Send"),1)]),e("div",V,[e("div",E,[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",S,[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{U as default}; diff --git a/assets/delays-DGxINOtn.js b/assets/delays-DGxINOtn.js new file mode 100644 index 0000000000000000000000000000000000000000..7a64dd9da7064bbc865bce0e66cfadd8650257b9 --- /dev/null +++ b/assets/delays-DGxINOtn.js @@ -0,0 +1 @@ +import"./three-vrm.module-CtuEk7GG.js";import{b as g,l as _}from"./queues-DTl9VJAZ.js";import"./Select.vue_vue_type_style_index_0_lang-CzS20kE7.js";import{_ as k}from"./Textarea.vue_vue_type_script_setup_true_lang-CskDgflv.js";import{d as b,e as r,c as n,o as t,a as e,b as y,u as x,Y as i,c6 as f,c7 as m}from"./index-B06xwjXa.js";import"./emotions-DWNSb738.js";import"./queue-BXXXc1r6.js";import"./floating-ui.core-CgBsuaUc.js";import"./Basic.vue_vue_type_script_setup_true_lang-Q6h2vVkt.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":""},E={"w-full":"","rounded-lg":"",bg:"neutral-100 dark:neutral-700","p-2":""},S={"w-full":"","rounded-lg":"",bg:"neutral-100 dark:neutral-700","p-2":""},T=b({__name:"delays",setup(B){const s=r(""),c=r([]),p=r([]),u=r(!1),d=g();d.onHandlerEvent("delay",a=>{p.value.push(a)});function v(){u.value=!0;const a=s.value.split("");for(const o of a)d.add(o);d.add(_),s.value="",u.value=!1}return(a,o)=>(t(),n("div",w,[e("div",h,[y(x(k),{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:v},null,8,["modelValue"]),e("button",M,i(u.value?"Processing...":"Send"),1)]),e("div",V,[e("div",E,[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",S,[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{T as default}; diff --git a/assets/effect-WSjEuzC9-C605Q5Vk.js b/assets/effect-WSjEuzC9-BZ1U5vd8.js similarity index 51% rename from assets/effect-WSjEuzC9-C605Q5Vk.js rename to assets/effect-WSjEuzC9-BZ1U5vd8.js index f68d6e013eb1e9fb58e37f722e7c6da3612ba614..87627cfe828fa412c803710bddff5d68f68a5231 100644 --- a/assets/effect-WSjEuzC9-C605Q5Vk.js +++ b/assets/effect-WSjEuzC9-BZ1U5vd8.js @@ -1 +1 @@ -import{cO as r}from"./index-CNH1g_GM.js";import{t as e}from"./mcp-B7-jaCfZ.js";const c=async()=>{const{JSONSchema:t}=await e(r(()=>import("./__vite-optional-peer-dep_effect_xsschema-BIHI7g3E.js"),[]),"effect");return o=>t.make(o)};export{c as getToJsonSchemaFn}; +import{cO as r}from"./index-B06xwjXa.js";import{t as e}from"./mcp-BfXpaYZf.js";const c=async()=>{const{JSONSchema:t}=await e(r(()=>import("./__vite-optional-peer-dep_effect_xsschema-BIHI7g3E.js"),[]),"effect");return o=>t.make(o)};export{c as getToJsonSchemaFn}; diff --git a/assets/elevenlabs-BCW3nqCx.js b/assets/elevenlabs-BCW3nqCx.js new file mode 100644 index 0000000000000000000000000000000000000000..36d120c1a449d9fabddfad020f1979ef6cc78ca9 --- /dev/null +++ b/assets/elevenlabs-BCW3nqCx.js @@ -0,0 +1 @@ +import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-Du5e5QRV.js";import{d as h,e as n,a0 as F,$ as I,f as k,T,w as r,bk as E,o as K,bl as x,b as d,u as o,a as L}from"./index-B06xwjXa.js";import"./three-vrm.module-CtuEk7GG.js";import"./emotions-DWNSb738.js";import"./mcp-BfXpaYZf.js";import{u as N}from"./providers-BCv4E6z9.js";import{u as z}from"./speech-CLjA-Bq8.js";import{_ as p,a as G}from"./FieldRange.vue_vue_type_script_setup_true_lang-4kHfmFIm.js";import"./Select.vue_vue_type_style_index_0_lang-CzS20kE7.js";import{_ as H,a as R}from"./SpeechProviderSettings.vue_vue_type_script_setup_true_lang-BtrnMHoG.js";import{b as w}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./floating-ui.core-CgBsuaUc.js";import"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-gnnCLEsG.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-BxFBRVXD.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-CyZTJR0c.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-DM6oOIgU.js";import"./Input.vue_vue_type_script_setup_true_lang-CqiG06sL.js";import"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-DMARmtsp.js";import"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-BoAZvnmm.js";const j={flex:"~ col gap-4"},l="elevenlabs",_="eleven_multilingual_v2",q=h({__name:"elevenlabs",setup(A){const V={similarityBoost:.75,stability:.5,speed:1,style:0,useSpeakerBoost:!0},v=n(0),m=n(1),u=n(0),f=n(0),c=n(.5),g=n(.75),b=n(!1),y=z(),t=N(),{providers:C}=F(t),{t:a}=I(),B=k(()=>{var e;return!!((e=C.value[l])!=null&&e.apiKey)}),M=k(()=>y.availableVoices[l]||[]);async function U(e,i,s){const P=t.getProviderInstance(l);if(!P)throw new Error("Failed to initialize speech provider");const S=t.getProviderConfig(l),$=S.model||_;return await y.speech(P,$,e,i,{...S,...V})}return T(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(m,async()=>{const e=t.getProviderConfig(l);e.speed=m.value}),r(u,async()=>{const e=t.getProviderConfig(l);e.volume=u.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)=>(K(),E(o(R),{"provider-id":l,"default-model":_,"additional-settings":V},{"voice-settings":x(()=>[L("div",j,[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:m.value,"onUpdate:modelValue":i[1]||(i[1]=s=>m.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:u.value,"onUpdate:modelValue":i[2]||(i[2]=s=>u.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(G),{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:x(()=>[d(o(H),{"available-voices":M.value,"generate-speech":U,"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}))}});typeof w=="function"&&w(q);export{q as default}; diff --git a/assets/elevenlabs-u8BehsUo.js b/assets/elevenlabs-u8BehsUo.js deleted file mode 100644 index d65ba7874d0facb59175aa68fe6692d031e5be17..0000000000000000000000000000000000000000 --- a/assets/elevenlabs-u8BehsUo.js +++ /dev/null @@ -1 +0,0 @@ -import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-BQHOFrhO.js";import{d as h,e as n,a0 as F,$ as I,f as x,T,w as r,ac as E,o as K,ad as k,b as d,u as o,a as L}from"./index-CNH1g_GM.js";import"./three-vrm-animation.module-B_hGdUpX.js";import"./mcp-B7-jaCfZ.js";import"./emotions-DWNSb738.js";import{u as N}from"./providers-DP46_3AG.js";import{u as z}from"./speech-DpuUb2e9.js";import{_ as p,a as G}from"./FieldRange.vue_vue_type_script_setup_true_lang-Dou4SIkT.js";import"./Select.vue_vue_type_style_index_0_lang-BIffysKh.js";import{_ as H,a as R}from"./SpeechProviderSettings.vue_vue_type_script_setup_true_lang-C4Rxa7-o.js";import{b as w}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./floating-ui.core-CgBsuaUc.js";import"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-C-ZUDDxT.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-dwKULsMl.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-DLt6RcnD.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-tEOSPb7v.js";import"./Input.vue_vue_type_script_setup_true_lang-CvnY3pbX.js";import"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-CR2pR4yl.js";import"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-BpJun8-8.js";const j={flex:"~ col gap-4"},l="elevenlabs",_="eleven_multilingual_v2",q=h({__name:"elevenlabs",setup(A){const V={similarityBoost:.75,stability:.5,speed:1,style:0,useSpeakerBoost:!0},v=n(0),m=n(1),u=n(0),f=n(0),c=n(.5),g=n(.75),b=n(!1),y=z(),t=N(),{providers:C}=F(t),{t:a}=I(),B=x(()=>{var e;return!!((e=C.value[l])!=null&&e.apiKey)}),M=x(()=>y.availableVoices[l]||[]);async function U(e,i,s){const P=t.getProviderInstance(l);if(!P)throw new Error("Failed to initialize speech provider");const S=t.getProviderConfig(l),$=S.model||_;return await y.speech(P,$,e,i,{...S,...V})}return T(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(m,async()=>{const e=t.getProviderConfig(l);e.speed=m.value}),r(u,async()=>{const e=t.getProviderConfig(l);e.volume=u.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)=>(K(),E(o(R),{"provider-id":l,"default-model":_,"additional-settings":V},{"voice-settings":k(()=>[L("div",j,[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:m.value,"onUpdate:modelValue":i[1]||(i[1]=s=>m.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:u.value,"onUpdate:modelValue":i[2]||(i[2]=s=>u.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(G),{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:k(()=>[d(o(H),{"available-voices":M.value,"generate-speech":U,"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}))}});typeof w=="function"&&w(q);export{q as default}; diff --git a/assets/emotions-BWYozuhn.js b/assets/emotions-Cff7mf_x.js similarity index 77% rename from assets/emotions-BWYozuhn.js rename to assets/emotions-Cff7mf_x.js index 842c977b0cf5d10a43f9cd76146a1a991af7bd68..35cac39d8743dd3c119620f30de344d8a8da1d1c 100644 --- a/assets/emotions-BWYozuhn.js +++ b/assets/emotions-Cff7mf_x.js @@ -1 +1 @@ -import{u as _}from"./queue-C-8apo-4.js";import{a as k,l as b}from"./queues-BGJT-GZq.js";import"./Select.vue_vue_type_style_index_0_lang-BIffysKh.js";import{_ as x}from"./Textarea.vue_vue_type_script_setup_true_lang-CLcoVpDI.js";import{d as h,e as u,c as s,o as t,a as e,b as w,u as M,Y as d,c6 as p,c7 as f}from"./index-CNH1g_GM.js";import"./emotions-DWNSb738.js";import"./floating-ui.core-CgBsuaUc.js";import"./Basic.vue_vue_type_script_setup_true_lang-CuYLN0Ir.js";const V={flex:"","flex-col":"","gap-2":"","p-2":""},y={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":""},Y=h({__name:"emotions",setup(P){const l=u(""),c=u([]),i=u([]),r=u(!1),g=_({handlers:[async a=>{i.value.push(a.data)}]}),m=k(g);function v(){r.value=!0;const a=l.value.split("");for(const o of a)m.add(o);m.add(b),l.value="",r.value=!1}return(a,o)=>(t(),s("div",V,[e("div",y,[w(M(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(p,null,f(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(p,null,f(i.value,n=>(t(),s("div",{key:n},[e("div",null,d(n),1)]))),128))])])]))}});export{Y as default}; +import{u as _}from"./queue-BXXXc1r6.js";import{a as k,l as b}from"./queues-DTl9VJAZ.js";import"./Select.vue_vue_type_style_index_0_lang-CzS20kE7.js";import{_ as x}from"./Textarea.vue_vue_type_script_setup_true_lang-CskDgflv.js";import{d as h,e as u,c as s,o as t,a as e,b as w,u as M,Y as d,c6 as p,c7 as f}from"./index-B06xwjXa.js";import"./emotions-DWNSb738.js";import"./floating-ui.core-CgBsuaUc.js";import"./Basic.vue_vue_type_script_setup_true_lang-Q6h2vVkt.js";const V={flex:"","flex-col":"","gap-2":"","p-2":""},y={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":""},Y=h({__name:"emotions",setup(P){const l=u(""),c=u([]),i=u([]),r=u(!1),g=_({handlers:[async a=>{i.value.push(a.data)}]}),m=k(g);function v(){r.value=!0;const a=l.value.split("");for(const o of a)m.add(o);m.add(b),l.value="",r.value=!1}return(a,o)=>(t(),s("div",V,[e("div",y,[w(M(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(p,null,f(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(p,null,f(i.value,n=>(t(),s("div",{key:n},[e("div",null,d(n),1)]))),128))])])]))}});export{Y as default}; diff --git a/assets/featherless-ai-M-otpVYV.js b/assets/featherless-ai-M-otpVYV.js new file mode 100644 index 0000000000000000000000000000000000000000..29e713570fa8ac9681a9f260e547d6624cfa72a2 --- /dev/null +++ b/assets/featherless-ai-M-otpVYV.js @@ -0,0 +1 @@ +import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-Du5e5QRV.js";import{d as k,$ as U,V as $,a0 as h,f as v,T as y,w as K,bk as w,o as x,bl as u,b as l,u as t}from"./index-B06xwjXa.js";import"./three-vrm.module-CtuEk7GG.js";import"./emotions-DWNSb738.js";import"./mcp-BfXpaYZf.js";import{u as z}from"./providers-BCv4E6z9.js";import"./Select.vue_vue_type_style_index_0_lang-CzS20kE7.js";import{_ as M,a as N}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-gnnCLEsG.js";import{_ as P}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-DMARmtsp.js";import{_ as R,a as S}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-BoAZvnmm.js";import{_ as B}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-DYsKzYwL.js";import{b as _}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./floating-ui.core-CgBsuaUc.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-BxFBRVXD.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-CyZTJR0c.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-DM6oOIgU.js";import"./Input.vue_vue_type_script_setup_true_lang-CqiG06sL.js";const a="featherless-ai",C=k({__name:"featherless-ai",setup(I){const{t:m}=U(),b=$(),d=z(),{providers:o}=h(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}});y(()=>{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 g(){var e;o.value[a]={...(e=n.value)==null?void 0:e.defaultOptions}}return(e,i)=>{var c,f;return x(),w(t(B),{"provider-name":(c=n.value)==null?void 0:c.localizedName,"provider-icon":(f=n.value)==null?void 0:f.icon,"on-back":()=>t(b).back()},{default:u(()=>[l(t(R),null,{default:u(()=>[l(t(S),{title:t(m)("settings.pages.providers.common.section.basic.title"),description:t(m)("settings.pages.providers.common.section.basic.description"),"on-reset":g},{default:u(()=>{var p;return[l(t(P),{modelValue:r.value,"onUpdate:modelValue":i[0]||(i[0]=V=>r.value=V),"provider-name":(p=n.value)==null?void 0:p.localizedName,placeholder:"fw-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(t(M),{title:t(m)("settings.pages.providers.common.section.advanced.title")},{default:u(()=>[l(t(N),{modelValue:s.value,"onUpdate:modelValue":i[1]||(i[1]=p=>s.value=p),placeholder:"https://api.featherless.ai/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon","on-back"])}}});typeof _=="function"&&_(C);export{C as default}; diff --git a/assets/featherless-ai-d4ZFWdyE.js b/assets/featherless-ai-d4ZFWdyE.js deleted file mode 100644 index 70b5432dad8c6f7ad93a0bc51edf0672559e8ffe..0000000000000000000000000000000000000000 --- a/assets/featherless-ai-d4ZFWdyE.js +++ /dev/null @@ -1 +0,0 @@ -import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-BQHOFrhO.js";import{d as U,$,V as h,a0 as k,f as c,T as y,w as K,ac as w,o as x,ad as u,b as l,u as t}from"./index-CNH1g_GM.js";import"./three-vrm-animation.module-B_hGdUpX.js";import"./mcp-B7-jaCfZ.js";import"./emotions-DWNSb738.js";import{u as z}from"./providers-DP46_3AG.js";import"./Select.vue_vue_type_style_index_0_lang-BIffysKh.js";import{_ as M,a as N}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-C-ZUDDxT.js";import{_ as P}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-CR2pR4yl.js";import{_ as R,a as S}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-BpJun8-8.js";import{_ as B}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-DUl7ZNEY.js";import{b as _}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./floating-ui.core-CgBsuaUc.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-dwKULsMl.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-DLt6RcnD.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-tEOSPb7v.js";import"./Input.vue_vue_type_script_setup_true_lang-CvnY3pbX.js";const a="featherless-ai",C=U({__name:"featherless-ai",setup(I){const{t:m}=$(),b=h(),d=z(),{providers:o}=k(d),n=c(()=>d.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}}),s=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}});y(()=>{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 g(){var e;o.value[a]={...(e=n.value)==null?void 0:e.defaultOptions}}return(e,i)=>{var v,f;return x(),w(t(B),{"provider-name":(v=n.value)==null?void 0:v.localizedName,"provider-icon":(f=n.value)==null?void 0:f.icon,"on-back":()=>t(b).back()},{default:u(()=>[l(t(R),null,{default:u(()=>[l(t(S),{title:t(m)("settings.pages.providers.common.section.basic.title"),description:t(m)("settings.pages.providers.common.section.basic.description"),"on-reset":g},{default:u(()=>{var p;return[l(t(P),{modelValue:r.value,"onUpdate:modelValue":i[0]||(i[0]=V=>r.value=V),"provider-name":(p=n.value)==null?void 0:p.localizedName,placeholder:"fw-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(t(M),{title:t(m)("settings.pages.providers.common.section.advanced.title")},{default:u(()=>[l(t(N),{modelValue:s.value,"onUpdate:modelValue":i[1]||(i[1]=p=>s.value=p),placeholder:"https://api.featherless.ai/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon","on-back"])}}});typeof _=="function"&&_(C);export{C as default}; diff --git a/assets/filter-message-BGb1DSTp.js b/assets/filter-message-C5yjB2Mx.js similarity index 79% rename from assets/filter-message-BGb1DSTp.js rename to assets/filter-message-C5yjB2Mx.js index c3d2f9dfda7eb1711949a5498c176fc2eb48c53b..973390708521c4073ff77a4a9895bd1c829e9bd9 100644 --- a/assets/filter-message-BGb1DSTp.js +++ b/assets/filter-message-C5yjB2Mx.js @@ -1 +1 @@ -import"./Select.vue_vue_type_style_index_0_lang-BIffysKh.js";import{_ as m}from"./Textarea.vue_vue_type_script_setup_true_lang-CLcoVpDI.js";import{d as g,e as c,c as v,o as _,a as o,b,u as x,Y as d}from"./index-CNH1g_GM.js";import"./floating-ui.core-CgBsuaUc.js";import"./Basic.vue_vue_type_script_setup_true_lang-CuYLN0Ir.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":""},C=g({__name:"filter-message",setup(M){const s=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=s.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),s.value="",u.value=!1}return(i,e)=>(_(),v("div",S,[o("div",k,[b(x(m),{modelValue:s.value,"onUpdate:modelValue":e[0]||(e[0]=t=>s.value=t),placeholder:"Message",p:"2",bg:"neutral-100 dark:neutral-700","w-full":"","rounded-lg":"","outline-none":"",onSubmit:p},null,8,["modelValue"]),o("button",w,d(u.value?"Processing...":"Send"),1)]),o("div",V,[e[1]||(e[1]=o("h3",{"font-semibold":""}," Streaming Message ",-1)),o("div",null,d(r.value.content),1)])]))}});export{C as default}; +import"./Select.vue_vue_type_style_index_0_lang-CzS20kE7.js";import{_ as m}from"./Textarea.vue_vue_type_script_setup_true_lang-CskDgflv.js";import{d as g,e as c,c as v,o as _,a as o,b,u as x,Y as d}from"./index-B06xwjXa.js";import"./floating-ui.core-CgBsuaUc.js";import"./Basic.vue_vue_type_script_setup_true_lang-Q6h2vVkt.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":""},C=g({__name:"filter-message",setup(M){const s=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=s.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),s.value="",u.value=!1}return(i,e)=>(_(),v("div",S,[o("div",k,[b(x(m),{modelValue:s.value,"onUpdate:modelValue":e[0]||(e[0]=t=>s.value=t),placeholder:"Message",p:"2",bg:"neutral-100 dark:neutral-700","w-full":"","rounded-lg":"","outline-none":"",onSubmit:p},null,8,["modelValue"]),o("button",w,d(u.value?"Processing...":"Send"),1)]),o("div",V,[e[1]||(e[1]=o("h3",{"font-semibold":""}," Streaming Message ",-1)),o("div",null,d(r.value.content),1)])]))}});export{C as default}; diff --git a/assets/fireworks-ai-DXxpOmDK.js b/assets/fireworks-ai-DXxpOmDK.js deleted file mode 100644 index a5b2a54ac0e5e18354571edab4441f2d54aa8730..0000000000000000000000000000000000000000 --- a/assets/fireworks-ai-DXxpOmDK.js +++ /dev/null @@ -1 +0,0 @@ -import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-BQHOFrhO.js";import{d as V,$ as w,V as U,a0 as $,f as c,T as y,w as K,ac as h,o as x,ad as u,b as l,u as t}from"./index-CNH1g_GM.js";import"./three-vrm-animation.module-B_hGdUpX.js";import"./mcp-B7-jaCfZ.js";import"./emotions-DWNSb738.js";import{u as z}from"./providers-DP46_3AG.js";import"./Select.vue_vue_type_style_index_0_lang-BIffysKh.js";import{_ as M,a as N}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-C-ZUDDxT.js";import{_ as P}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-CR2pR4yl.js";import{_ as R,a as S}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-BpJun8-8.js";import{_ as B}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-DUl7ZNEY.js";import{b as _}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./floating-ui.core-CgBsuaUc.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-dwKULsMl.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-DLt6RcnD.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-tEOSPb7v.js";import"./Input.vue_vue_type_script_setup_true_lang-CvnY3pbX.js";const a="fireworks-ai",C=V({__name:"fireworks-ai",setup(I){const{t:m}=w(),b=U(),d=z(),{providers:o}=$(d),n=c(()=>d.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}}),s=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}});y(()=>{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 g(){var e;o.value[a]={...(e=n.value)==null?void 0:e.defaultOptions}}return(e,i)=>{var v,f;return x(),h(t(B),{"provider-name":(v=n.value)==null?void 0:v.localizedName,"provider-icon":(f=n.value)==null?void 0:f.icon,"on-back":()=>t(b).back()},{default:u(()=>[l(t(R),null,{default:u(()=>[l(t(S),{title:t(m)("settings.pages.providers.common.section.basic.title"),description:t(m)("settings.pages.providers.common.section.basic.description"),"on-reset":g},{default:u(()=>{var p;return[l(t(P),{modelValue:r.value,"onUpdate:modelValue":i[0]||(i[0]=k=>r.value=k),"provider-name":(p=n.value)==null?void 0:p.localizedName,placeholder:"fw-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(t(M),{title:t(m)("settings.pages.providers.common.section.advanced.title")},{default:u(()=>[l(t(N),{modelValue:s.value,"onUpdate:modelValue":i[1]||(i[1]=p=>s.value=p),placeholder:"https://api.fireworks.ai/inference/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon","on-back"])}}});typeof _=="function"&&_(C);export{C as default}; diff --git a/assets/fireworks-ai-mT2y5pvw.js b/assets/fireworks-ai-mT2y5pvw.js new file mode 100644 index 0000000000000000000000000000000000000000..3e22ca1540efa7ccc09f3d28339aa02ec784ee22 --- /dev/null +++ b/assets/fireworks-ai-mT2y5pvw.js @@ -0,0 +1 @@ +import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-Du5e5QRV.js";import{d as V,$ as w,V as U,a0 as $,f as c,T as y,w as K,bk as h,o as x,bl as u,b as l,u as t}from"./index-B06xwjXa.js";import"./three-vrm.module-CtuEk7GG.js";import"./emotions-DWNSb738.js";import"./mcp-BfXpaYZf.js";import{u as z}from"./providers-BCv4E6z9.js";import"./Select.vue_vue_type_style_index_0_lang-CzS20kE7.js";import{_ as M,a as N}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-gnnCLEsG.js";import{_ as P}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-DMARmtsp.js";import{_ as R,a as S}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-BoAZvnmm.js";import{_ as B}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-DYsKzYwL.js";import{b as _}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./floating-ui.core-CgBsuaUc.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-BxFBRVXD.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-CyZTJR0c.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-DM6oOIgU.js";import"./Input.vue_vue_type_script_setup_true_lang-CqiG06sL.js";const a="fireworks-ai",C=V({__name:"fireworks-ai",setup(I){const{t:m}=w(),b=U(),d=z(),{providers:o}=$(d),n=c(()=>d.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}}),s=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}});y(()=>{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 g(){var e;o.value[a]={...(e=n.value)==null?void 0:e.defaultOptions}}return(e,i)=>{var v,f;return x(),h(t(B),{"provider-name":(v=n.value)==null?void 0:v.localizedName,"provider-icon":(f=n.value)==null?void 0:f.icon,"on-back":()=>t(b).back()},{default:u(()=>[l(t(R),null,{default:u(()=>[l(t(S),{title:t(m)("settings.pages.providers.common.section.basic.title"),description:t(m)("settings.pages.providers.common.section.basic.description"),"on-reset":g},{default:u(()=>{var p;return[l(t(P),{modelValue:r.value,"onUpdate:modelValue":i[0]||(i[0]=k=>r.value=k),"provider-name":(p=n.value)==null?void 0:p.localizedName,placeholder:"fw-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(t(M),{title:t(m)("settings.pages.providers.common.section.advanced.title")},{default:u(()=>[l(t(N),{modelValue:s.value,"onUpdate:modelValue":i[1]||(i[1]=p=>s.value=p),placeholder:"https://api.fireworks.ai/inference/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon","on-back"])}}});typeof _=="function"&&_(C);export{C as default}; diff --git a/assets/google-generative-ai-CV9mFE5-.js b/assets/google-generative-ai-CV9mFE5-.js new file mode 100644 index 0000000000000000000000000000000000000000..27402d3bf0afbce06d21094352e36ca715450d90 --- /dev/null +++ b/assets/google-generative-ai-CV9mFE5-.js @@ -0,0 +1 @@ +import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-Du5e5QRV.js";import{d as U,$ as V,V as k,a0 as $,f as v,T as y,w as K,bk as I,o as G,bl as p,b as l,u as t}from"./index-B06xwjXa.js";import"./three-vrm.module-CtuEk7GG.js";import"./emotions-DWNSb738.js";import"./mcp-BfXpaYZf.js";import{u as M}from"./providers-BCv4E6z9.js";import"./Select.vue_vue_type_style_index_0_lang-CzS20kE7.js";import{_ as N,a as w}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-gnnCLEsG.js";import{_ as x}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-DMARmtsp.js";import{_ as P,a as R}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-BoAZvnmm.js";import{_ as S}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-DYsKzYwL.js";import{b as f}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./floating-ui.core-CgBsuaUc.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-BxFBRVXD.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-CyZTJR0c.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-DM6oOIgU.js";import"./Input.vue_vue_type_script_setup_true_lang-CqiG06sL.js";const e="google-generative-ai",z=U({__name:"google-generative-ai",setup(B){const{t:m}=V(),_=k(),c=M(),{providers:a}=$(c),u=v(()=>c.getProviderMetadata(e)),r=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}}),s=v({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/"}),r.value=((o=a.value[e])==null?void 0:o.apiKey)||"",s.value=((i=a.value[e])==null?void 0:i.baseUrl)||"https://generativelanguage.googleapis.com/v1beta/openai/"}),K([r,s],()=>{a.value[e]={...a.value[e],apiKey:r.value,baseUrl:s.value||"https://generativelanguage.googleapis.com/v1beta/openai/"}});function b(){a.value[e]={baseUrl:"https://generativelanguage.googleapis.com/v1beta/openai/"}}return(o,i)=>{var d,g;return G(),I(t(S),{"provider-name":((d=u.value)==null?void 0:d.localizedName)||"Google | Gemini","provider-icon":(g=u.value)==null?void 0:g.icon,"on-back":()=>t(_).back()},{default:p(()=>[l(t(P),null,{default:p(()=>[l(t(R),{title:t(m)("settings.pages.providers.common.section.basic.title"),description:t(m)("settings.pages.providers.common.section.basic.description"),"on-reset":b},{default:p(()=>{var n;return[l(t(x),{modelValue:r.value,"onUpdate:modelValue":i[0]||(i[0]=h=>r.value=h),"provider-name":((n=u.value)==null?void 0:n.localizedName)||"Google",placeholder:"GEMINI_API_KEY"},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(t(N),{title:t(m)("settings.pages.providers.common.section.advanced.title")},{default:p(()=>[l(t(w),{modelValue:s.value,"onUpdate:modelValue":i[1]||(i[1]=n=>s.value=n),placeholder:"https://generativelanguage.googleapis.com/v1beta/openai/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon","on-back"])}}});typeof f=="function"&&f(z);export{z as default}; diff --git a/assets/google-generative-ai-tkGWQeXX.js b/assets/google-generative-ai-tkGWQeXX.js deleted file mode 100644 index 3e070d119cda6925846f27edfabf6d6703bb49ee..0000000000000000000000000000000000000000 --- a/assets/google-generative-ai-tkGWQeXX.js +++ /dev/null @@ -1 +0,0 @@ -import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-BQHOFrhO.js";import{d as U,$ as V,V as $,a0 as k,f as v,T as y,w as K,ac as I,o as G,ad as p,b as l,u as t}from"./index-CNH1g_GM.js";import"./three-vrm-animation.module-B_hGdUpX.js";import"./mcp-B7-jaCfZ.js";import"./emotions-DWNSb738.js";import{u as M}from"./providers-DP46_3AG.js";import"./Select.vue_vue_type_style_index_0_lang-BIffysKh.js";import{_ as N,a as w}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-C-ZUDDxT.js";import{_ as x}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-CR2pR4yl.js";import{_ as P,a as R}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-BpJun8-8.js";import{_ as S}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-DUl7ZNEY.js";import{b as f}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./floating-ui.core-CgBsuaUc.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-dwKULsMl.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-DLt6RcnD.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-tEOSPb7v.js";import"./Input.vue_vue_type_script_setup_true_lang-CvnY3pbX.js";const e="google-generative-ai",z=U({__name:"google-generative-ai",setup(B){const{t:m}=V(),_=$(),c=M(),{providers:a}=k(c),u=v(()=>c.getProviderMetadata(e)),r=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}}),s=v({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/"}),r.value=((o=a.value[e])==null?void 0:o.apiKey)||"",s.value=((i=a.value[e])==null?void 0:i.baseUrl)||"https://generativelanguage.googleapis.com/v1beta/openai/"}),K([r,s],()=>{a.value[e]={...a.value[e],apiKey:r.value,baseUrl:s.value||"https://generativelanguage.googleapis.com/v1beta/openai/"}});function b(){a.value[e]={baseUrl:"https://generativelanguage.googleapis.com/v1beta/openai/"}}return(o,i)=>{var d,g;return G(),I(t(S),{"provider-name":((d=u.value)==null?void 0:d.localizedName)||"Google | Gemini","provider-icon":(g=u.value)==null?void 0:g.icon,"on-back":()=>t(_).back()},{default:p(()=>[l(t(P),null,{default:p(()=>[l(t(R),{title:t(m)("settings.pages.providers.common.section.basic.title"),description:t(m)("settings.pages.providers.common.section.basic.description"),"on-reset":b},{default:p(()=>{var n;return[l(t(x),{modelValue:r.value,"onUpdate:modelValue":i[0]||(i[0]=h=>r.value=h),"provider-name":((n=u.value)==null?void 0:n.localizedName)||"Google",placeholder:"GEMINI_API_KEY"},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(t(N),{title:t(m)("settings.pages.providers.common.section.advanced.title")},{default:p(()=>[l(t(w),{modelValue:s.value,"onUpdate:modelValue":i[1]||(i[1]=n=>s.value=n),placeholder:"https://generativelanguage.googleapis.com/v1beta/openai/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon","on-back"])}}});typeof f=="function"&&f(z);export{z as default}; diff --git a/assets/image-DPk0KHrt.js b/assets/image-BC5zfrbv.js similarity index 65% rename from assets/image-DPk0KHrt.js rename to assets/image-BC5zfrbv.js index 9cb258f9fadab1533558470efa42a662a163a9ee..b10580351fd6ea8db158bd6544f1112490ad706a 100644 --- a/assets/image-DPk0KHrt.js +++ b/assets/image-BC5zfrbv.js @@ -1,2 +1,2 @@ -import{d as _,e as c,cd as y,c as d,o as u,a,W as x,Y as v,u as b,bZ as w}from"./index-CNH1g_GM.js";const h={bg:"neutral-100",flex:"~ col","items-center":"","justify-center":"","rounded-lg":"","px-4":"","py-3":""},C={key:0},U=["src"],R={bg:"neutral-100",class:"text-wrap-any","max-h":"100","overflow-scroll":"","rounded-lg":"","text-wrap":"","text-black":"","font-mono":""},k=_({__name:"image",setup(D){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",h,[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",C,[a("img",{src:n.value,alt:"Uploaded Image","w-100":""},null,8,U),a("pre",R," "+v(n.value)+` - `,1),a("button",{bg:"primary-500",text:"white","mt-4":"","rounded-lg":"","px-4":"","py-2":"",onClick:e[0]||(e[0]=()=>b(g)())}," Copy Data URL ")])):x("",!0)]))}}),B=w(k,[["__scopeId","data-v-7edd53e6"]]);export{B as default}; +import{d as _,e as i,cd as y,c as d,o as u,a,W as x,Y as v,u as w,c2 as b}from"./index-B06xwjXa.js";const h={bg:"neutral-100",flex:"~ col","items-center":"","justify-center":"","rounded-lg":"","px-4":"","py-3":""},C={key:0},U=["src"],R={bg:"neutral-100",class:"text-wrap-any","max-h":"100","overflow-scroll":"","rounded-lg":"","text-wrap":"","text-black":"","font-mono":""},k=_({__name:"image",setup(D){const p=i(),n=i(""),{copy:g}=y({source:n});async function m(r){return new Promise((e,o)=>{const t=new FileReader;t.onload=s=>{var l,c;e(((c=(l=s.target)==null?void 0:l.result)==null?void 0:c.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",h,[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",C,[a("img",{src:n.value,alt:"Uploaded Image","w-100":""},null,8,U),a("pre",R," "+v(n.value)+` + `,1),a("button",{bg:"primary-500",text:"white","mt-4":"","rounded-lg":"","px-4":"","py-2":"",onClick:e[0]||(e[0]=()=>w(g)())}," Copy Data URL ")])):x("",!0)]))}}),B=b(k,[["__scopeId","data-v-7edd53e6"]]);export{B as default}; diff --git a/assets/index-3ucwneIT.js b/assets/index-3ucwneIT.js new file mode 100644 index 0000000000000000000000000000000000000000..60e29503944986f0a045850d45de47cb0450cc30 --- /dev/null +++ b/assets/index-3ucwneIT.js @@ -0,0 +1 @@ +import{d as q,ce as X,cf as Y,f as C,bk as T,o as i,bl as z,a,X as E,bh as G,cg as H,Y as u,c,c6 as A,c7 as F,ch as K,u as r,$ as Z,a0 as ee,e as x,w as te,c5 as ae,b as h,bm as O,cc as le,W as S}from"./index-B06xwjXa.js";import"./three-vrm.module-CtuEk7GG.js";import"./emotions-DWNSb738.js";import"./mcp-BfXpaYZf.js";import{u as re}from"./airi-card-BqOg7f9m.js";import{k as se}from"./Select.vue_vue_type_style_index_0_lang-CzS20kE7.js";import{_ as oe}from"./InputFile.vue_vue_type_script_setup_true_lang-B7xRsonQ.js";import{_ as ne}from"./CardDetailDialog.vue_vue_type_script_setup_true_lang-BW7EWJLR.js";import{_ as ie}from"./CardListItem.vue_vue_type_script_setup_true_lang-DIzqmniR.js";import{_ as de}from"./DeleteCardDialog.vue_vue_type_script_setup_true_lang-D73P_gUt.js";import{b as U}from"./route-block-B_A1xBdJ.js";import"./consciousness-D-_ZstxC.js";import"./providers-BCv4E6z9.js";import"./index-LHmcipjy.js";import"./speech-CLjA-Bq8.js";import"./floating-ui.core-CgBsuaUc.js";import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-Du5e5QRV.js";import"./index-BVgMpW27.js";const ue={class:"flex-1 truncate"},ce={class:"min-w-[160px] flex flex-col gap-0.5 border border-neutral-200 rounded-lg bg-white p-1 shadow-lg dark:border-neutral-800 dark:bg-neutral-900"},me=["onClick"],pe=q({__name:"Select",props:X({options:null,placeholder:null,disabled:{type:Boolean},title:null},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(V){const s=V,p=Y(V,"modelValue"),y=C(()=>{const n=s.options.find(f=>f.value===p.value);return n?n.label:s.placeholder});function $(n){p.value=n}return(n,f)=>(i(),T(r(se),{"auto-size":"","auto-boundary-max-size":""},{popper:z(({hide:g})=>[a("div",ce,[(i(!0),c(A,null,F(s.options,d=>(i(),c("div",K({ref_for:!0},{...n.$attrs,class:null,style:null},{key:d.value,class:["cursor-pointer rounded px-2 py-1.5 text-sm text-neutral-700 hover:bg-neutral-100 dark:text-neutral-200 dark:hover:bg-neutral-800",{"bg-neutral-100 dark:bg-neutral-800":p.value===d.value}],onClick:b=>{$(d.value),g()}}),u(d.label),17,me))),128))])]),default:z(()=>[a("div",{class:E(["min-w-[160px] flex cursor-pointer items-center justify-between gap-2 border rounded-lg bg-white p-2.5 text-xs text-neutral-700 shadow-sm outline-none transition-colors disabled:cursor-not-allowed dark:border-neutral-800 dark:bg-neutral-900 disabled:bg-neutral-100 hover:bg-neutral-50 dark:text-neutral-200 disabled:text-neutral-400 focus:ring-2 focus:ring-black/10 dark:disabled:bg-neutral-800 dark:hover:bg-neutral-800 dark:disabled:text-neutral-600",{"pointer-events-none":s.disabled}])},[a("div",ue,[G(n.$slots,"default",{label:y.value},()=>[H(u(y.value),1)])]),f[0]||(f[0]=a("div",{"i-solar:alt-arrow-down-bold-duotone":"",class:"h-3.5 w-3.5 text-neutral-500 dark:text-neutral-400"},null,-1))],2)]),_:3}))}}),fe={"rounded-xl":"","p-4":"",flex:"~ col gap-4"},ve={flex:"~ row","flex-wrap":"","items-center":"","justify-between":"","gap-4":""},xe={class:"relative min-w-[200px] flex-1","inline-flex":"~","w-full":"","items-center":""},ge=["placeholder"],be={class:"relative flex flex-row justify-start gap-2 lg:flex-col"},_e={class:"top-[-32px] whitespace-nowrap text-sm text-neutral-500 leading-10 lg:absolute dark:text-neutral-400"},ke={key:0,flex:"","flex-col":"","items-center":""},ye={"font-medium":"",text:"neutral-600 dark:neutral-300"},we={text:"neutral-500 dark:neutral-400","mt-2":"","text-sm":""},he={key:1,flex:"","flex-col":"","items-center":""},Ce={"font-medium":"",text:"primary-600 dark:primary-300"},Ve={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"},$e={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"},De={class:"flex flex-col"},Se={class:"font-medium"},ze={class:"text-sm text-amber-600 dark:text-amber-400"},Ae={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":""},Ne=q({__name:"index",setup(V){const{t:s}=Z(),p=re(),{addCard:y,removeCard:$}=p,{cards:n,activeCardId:f}=ee(p),g=x(""),d=x(!1),b=x(""),_=x("nameAsc"),D=x([]);te(D,async l=>{const e=l[0];if(e)try{const o=await e.text(),m=JSON.parse(o);g.value=y(m),d.value=!0}catch(o){console.error("Error processing card file:",o)}});const N=C(()=>Array.from(n.value.entries()).map(([l,e])=>({id:l,name:e.name,description:e.description}))),I=C(()=>{if(!b.value)return N.value;const l=b.value.toLowerCase();return N.value.filter(e=>e.name.toLowerCase().includes(l)||e.description&&e.description.toLowerCase().includes(l))}),j=C(()=>{const l=[...I.value];return _.value==="nameAsc"?l.sort((e,o)=>e.name.localeCompare(o.name)):_.value==="nameDesc"?l.sort((e,o)=>o.name.localeCompare(e.name)):_.value==="recent"?l.sort((e,o)=>o.id.localeCompare(e.id)):l}),w=x(!1),v=x(null);function J(){v.value&&($(v.value),v.value=null,w.value=!1)}function P(l){v.value=l,w.value=!0}function Q(l){g.value=l,d.value=!0}function R(l){f.value=l}function W(l){const e=n.value.get(l);return(e==null?void 0:e.version)||"1.0.0"}function B(l,e){var t,k,L,M;const o=n.value.get(l);if(!o||!((k=(t=o.extensions)==null?void 0:t.airi)!=null&&k.modules))return"default";const m=o.extensions.airi.modules;return e==="consciousness"?(L=m.consciousness)!=null&&L.model&&m.consciousness.model.split("-").pop()||"default":e==="voice"&&((M=m.speech)==null?void 0:M.voice_id)||"default"}return(l,e)=>{var m;const o=ae("motion");return i(),c(A,null,[a("div",fe,[a("div",ve,[a("div",xe,[e[6]||(e[6]=a("div",{class:"pointer-events-none absolute inset-y-0 left-0 flex items-center pl-3"},[a("div",{"i-solar:magnifer-line-duotone":"",class:"text-neutral-500 dark:text-neutral-400"})],-1)),O(a("input",{"onUpdate:modelValue":e[0]||(e[0]=t=>b.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(s)("settings.pages.card.search")},null,8,ge),[[le,b.value]])]),a("div",be,[a("div",_e,u(r(s)("settings.pages.card.sort_by"))+": ",1),h(pe,{modelValue:_.value,"onUpdate:modelValue":e[1]||(e[1]=t=>_.value=t),options:[{value:"nameAsc",label:r(s)("settings.pages.card.name_asc")},{value:"nameDesc",label:r(s)("settings.pages.card.name_desc")},{value:"recent",label:r(s)("settings.pages.card.recent")}],placeholder:"Select sort option",class:"min-w-[150px]"},null,8,["modelValue","options"])])]),a("div",{class:E(["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(n).size>0}])},[h(r(oe),{modelValue:D.value,"onUpdate:modelValue":e[2]||(e[2]=t=>D.value=t),accept:"*.json"},{default:z(({isDragging:t})=>[t?(i(),c("div",he,[e[8]||(e[8]=a("div",{"i-solar:upload-minimalistic-bold":"",class:"mb-2 text-5xl text-primary-500 dark:text-primary-400"},null,-1)),a("p",Ce,u(r(s)("settings.pages.card.drop_here")),1)])):(i(),c("div",ke,[e[7]||(e[7]=a("div",{"i-solar:upload-square-line-duotone":"","mb-4":"","text-5xl":"",text:"neutral-400 dark:neutral-500"},null,-1)),a("p",ye,u(r(s)("settings.pages.card.upload")),1),a("p",we,u(r(s)("settings.pages.card.upload_desc")),1)]))]),_:1},8,["modelValue"]),r(n).size>0?(i(!0),c(A,{key:0},F(j.value,t=>(i(),T(ie,{id:t.id,key:t.id,name:t.name,description:t.description,"is-active":t.id===r(f),"is-selected":t.id===g.value&&d.value,version:W(t.id),"consciousness-model":B(t.id,"consciousness"),"voice-model":B(t.id,"voice"),onSelect:k=>Q(t.id),onActivate:k=>R(t.id),onDelete:k=>P(t.id)},null,8,["id","name","description","is-active","is-selected","version","consciousness-model","voice-model","onSelect","onActivate","onDelete"]))),128)):S("",!0),r(n).size===0?(i(),c("div",Ve,[e[9]||(e[9]=a("div",{"i-solar:card-search-broken":"","mx-auto":"","mb-3":"","text-6xl":"","text-neutral-400":""},null,-1)),a("p",null,u(r(s)("settings.pages.card.no_cards")),1)])):S("",!0),b.value&&j.value.length===0?(i(),c("div",$e,[e[10]||(e[10]=a("div",{"i-solar:info-circle-line-duotone":"",class:"text-2xl text-amber-500 dark:text-amber-400"},null,-1)),a("div",De,[a("span",Se,u(r(s)("settings.pages.card.no_results")),1),a("span",ze,u(r(s)("settings.pages.card.try_different_search")),1)])])):S("",!0)],2)]),h(de,{modelValue:w.value,"onUpdate:modelValue":e[3]||(e[3]=t=>w.value=t),"card-name":v.value?(m=r(p).getCard(v.value))==null?void 0:m.name:"",onConfirm:J,onCancel:e[4]||(e[4]=t=>v.value=null)},null,8,["modelValue","card-name"]),h(ne,{modelValue:d.value,"onUpdate:modelValue":e[5]||(e[5]=t=>d.value=t),"card-id":g.value},null,8,["modelValue","card-id"]),O((i(),c("div",Ae,e[11]||(e[11]=[a("div",{text:"60","i-solar:emoji-funny-square-bold-duotone":""},null,-1)]))),[[o]])],64)}}});typeof U=="function"&&U(Ne);export{Ne as default}; diff --git a/assets/index-CNH1g_GM.js b/assets/index-B06xwjXa.js similarity index 98% rename from assets/index-CNH1g_GM.js rename to assets/index-B06xwjXa.js index 033113c51f6acf037abeab1f78dc022ccf20decb..ba6e9cf2d38c7f02b21eccaaf330d14332b6a2d0 100644 --- a/assets/index-CNH1g_GM.js +++ b/assets/index-B06xwjXa.js @@ -1,4 +1,4 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/default-Jn9n3nXn.js","assets/HeaderLink-LlW9hXo1.js","assets/HeaderLink-DsxHr3rn.css","assets/settings-ANs_Jv0A.js","assets/Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-BQHOFrhO.js","assets/Stage-Btkvlizu.css","assets/three-vrm-animation.module-B_hGdUpX.js","assets/mcp-B7-jaCfZ.js","assets/emotions-DWNSb738.js","assets/providers-DP46_3AG.js","assets/index-LHmcipjy.js","assets/Select.vue_vue_type_style_index_0_lang-BIffysKh.js","assets/floating-ui.core-CgBsuaUc.js","assets/Select-X4vGC3oO.css","assets/index-CSK7uqHy.js","assets/import-url-browser-CPN8ipMD.js","assets/duckdb-mvp-CaaD-olE.js","assets/speech-DpuUb2e9.js","assets/queue-C-8apo-4.js","assets/queues-BGJT-GZq.js","assets/index-YUUT4m-_.js","assets/airi-card-JBK1Hzhm.js","assets/consciousness-DieQE4I6.js","assets/TransitionVertical.vue_vue_type_script_setup_true_lang-DLt6RcnD.js","assets/Model.vue_vue_type_script_setup_true_lang-BVl3TxNh.js","assets/Collapsable.vue_vue_type_script_setup_true_lang-dwKULsMl.js","assets/index-CHjdc0dt.js","assets/Basic.vue_vue_type_script_setup_true_lang-CuYLN0Ir.js","assets/route-block-B_A1xBdJ.js","assets/index-gTqmS2cP.css","assets/background-remove-DYaqEJCO.js","assets/InputFile.vue_vue_type_script_setup_true_lang-bO5dM4_S.js","assets/chat-3-8NLufH.js","assets/image-DPk0KHrt.js","assets/image-BhuwcwI9.css","assets/vibrant-DyMOQuK8.js","assets/browser-CkchkNbv.js","assets/queue-B_aWwf6M.js","assets/index-Dt5Zr-vu.js","assets/IconAnimation.vue_vue_type_script_setup_true_lang-DSobYOgR.js","assets/index-DCp9eCXO.js","assets/CardDetailDialog.vue_vue_type_script_setup_true_lang-BGLSRcrK.js","assets/DeleteCardDialog.vue_vue_type_script_setup_true_lang-BuRPZrcj.js","assets/index-5YeHuuyL.js","assets/CardListItem.vue_vue_type_script_setup_true_lang-DAe8PabE.js","assets/CardDetailDialog-DURsENRS.js","assets/CardListItem-PljhH-7U.js","assets/DeleteCardDialog-BdJxoLU9.js","assets/index-R-df0ppj.js","assets/ColorPalette.vue_vue_type_script_setup_true_lang-YJhFyDzq.js","assets/index-BVitw2V7.css","assets/index-CcwV4B8o.js","assets/index-CfvQILkm.js","assets/useIconAnimation-Df247suB.js","assets/index-rlpEp8ML.css","assets/index-DfQN29KQ.js","assets/IconStatusItem-Co6qJ9yZ.js","assets/consciousness-03dOPB9r.js","assets/RadioCardSimple-DMkL9ZMC.js","assets/Input.vue_vue_type_script_setup_true_lang-CvnY3pbX.js","assets/memory-long-term-CdegH93Z.js","assets/memory-short-term-CkxLWbON.js","assets/speech-B67Uvg4K.js","assets/FieldRange.vue_vue_type_script_setup_true_lang-Dou4SIkT.js","assets/FieldInput.vue_vue_type_script_setup_true_lang-tEOSPb7v.js","assets/Textarea.vue_vue_type_script_setup_true_lang-CLcoVpDI.js","assets/index-B3D27Cgx.js","assets/alibaba-cloud-model-studio-DfaR_dR0.js","assets/SpeechProviderSettings.vue_vue_type_script_setup_true_lang-C4Rxa7-o.js","assets/ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-C-ZUDDxT.js","assets/ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-CR2pR4yl.js","assets/ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-BpJun8-8.js","assets/anthropic-DEAl6Zmk.js","assets/ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-DUl7ZNEY.js","assets/cloudflare-workers-ai-AqUagaNH.js","assets/deepseek-B53p4ZBr.js","assets/elevenlabs-u8BehsUo.js","assets/featherless-ai-d4ZFWdyE.js","assets/fireworks-ai-DXxpOmDK.js","assets/google-generative-ai-tkGWQeXX.js","assets/microsoft-speech-ChkGjf75.js","assets/mistral-ai-n7T6D5lD.js","assets/moonshot-ai-DmoJa9kd.js","assets/novita-ai-BGUP6I0O.js","assets/ollama-CGevjPsb.js","assets/openai-Bljxgvr0.js","assets/openrouter-ai-DLii68h7.js","assets/together-ai-Wdg-uXlv.js","assets/volcengine-Cu9s47NY.js","assets/xai-BHmWt46x.js","assets/index-dMGu9uSt.js","assets/filter-message-BGb1DSTp.js","assets/delays-DC8esD_g.js","assets/emotions-BWYozuhn.js","assets/messages-VneqjxaE.js"])))=>i.map(i=>d[i]); +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/default-DlVYj8BF.js","assets/HeaderLink-OTe6TGtK.js","assets/HeaderLink-DsxHr3rn.css","assets/settings-CynJw7x4.js","assets/Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-Du5e5QRV.js","assets/Stage-Btkvlizu.css","assets/three-vrm.module-CtuEk7GG.js","assets/emotions-DWNSb738.js","assets/mcp-BfXpaYZf.js","assets/providers-BCv4E6z9.js","assets/index-LHmcipjy.js","assets/Select.vue_vue_type_style_index_0_lang-CzS20kE7.js","assets/floating-ui.core-CgBsuaUc.js","assets/Select-X4vGC3oO.css","assets/index-CqXdqLaZ.js","assets/import-url-browser-CPN8ipMD.js","assets/duckdb-mvp-CaaD-olE.js","assets/speech-CLjA-Bq8.js","assets/queue-BXXXc1r6.js","assets/queues-DTl9VJAZ.js","assets/index-YUUT4m-_.js","assets/airi-card-BqOg7f9m.js","assets/consciousness-D-_ZstxC.js","assets/TransitionVertical.vue_vue_type_script_setup_true_lang-CyZTJR0c.js","assets/Model.vue_vue_type_script_setup_true_lang-CUcE9b2l.js","assets/Collapsable.vue_vue_type_script_setup_true_lang-BxFBRVXD.js","assets/Basic.vue_vue_type_script_setup_true_lang-Q6h2vVkt.js","assets/route-block-B_A1xBdJ.js","assets/index-gTqmS2cP.css","assets/background-remove-7t1fuPR2.js","assets/InputFile.vue_vue_type_script_setup_true_lang-B7xRsonQ.js","assets/chat-Ch1uJ9j2.js","assets/image-BC5zfrbv.js","assets/image-BhuwcwI9.css","assets/vibrant-DwwXKvjx.js","assets/browser-CkchkNbv.js","assets/queue-BjPeTqlQ.js","assets/index-BqxwSAta.js","assets/IconAnimation.vue_vue_type_script_setup_true_lang-_yAijtHg.js","assets/index-3ucwneIT.js","assets/CardDetailDialog.vue_vue_type_script_setup_true_lang-BW7EWJLR.js","assets/DeleteCardDialog.vue_vue_type_script_setup_true_lang-D73P_gUt.js","assets/index-BVgMpW27.js","assets/CardListItem.vue_vue_type_script_setup_true_lang-DIzqmniR.js","assets/CardDetailDialog-BPmKPIdN.js","assets/CardListItem-Bcn9cwvb.js","assets/DeleteCardDialog-DLYqCKGU.js","assets/index-CHXm7BsK.js","assets/ColorPalette.vue_vue_type_script_setup_true_lang-V-fFti_u.js","assets/index-BVitw2V7.css","assets/index-DfgZBT6L.js","assets/index-YGbSHw2g.js","assets/useIconAnimation-BxWVl-bV.js","assets/index-rlpEp8ML.css","assets/index-J0h9UsXc.js","assets/IconStatusItem-CntkxYB2.js","assets/consciousness-D135g0Zv.js","assets/RadioCardSimple-DEecfDCY.js","assets/Input.vue_vue_type_script_setup_true_lang-CqiG06sL.js","assets/memory-long-term-DdtSjryl.js","assets/memory-short-term-CYEPVxPq.js","assets/speech-B8WOC72M.js","assets/FieldRange.vue_vue_type_script_setup_true_lang-4kHfmFIm.js","assets/FieldInput.vue_vue_type_script_setup_true_lang-DM6oOIgU.js","assets/Textarea.vue_vue_type_script_setup_true_lang-CskDgflv.js","assets/index-BUz8WLVD.js","assets/alibaba-cloud-model-studio-10EiP3XX.js","assets/SpeechProviderSettings.vue_vue_type_script_setup_true_lang-BtrnMHoG.js","assets/ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-gnnCLEsG.js","assets/ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-DMARmtsp.js","assets/ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-BoAZvnmm.js","assets/anthropic-DSSAGod2.js","assets/ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-DYsKzYwL.js","assets/cloudflare-workers-ai-DG_-Hn68.js","assets/deepseek-CLW0ElgW.js","assets/elevenlabs-BCW3nqCx.js","assets/featherless-ai-M-otpVYV.js","assets/fireworks-ai-mT2y5pvw.js","assets/google-generative-ai-CV9mFE5-.js","assets/microsoft-speech-W8B1RmtI.js","assets/mistral-ai-Du-J0Q1l.js","assets/moonshot-ai-D9LhCXTR.js","assets/novita-ai-D_6dOaRN.js","assets/ollama-CJhkg7aY.js","assets/openai-BwSo75Ba.js","assets/openrouter-ai-DaZqHxnI.js","assets/together-ai-dB0eRXqL.js","assets/volcengine-C4ShKUYr.js","assets/xai-BHu8lsjK.js","assets/index-DvJoTzhu.js","assets/filter-message-C5yjB2Mx.js","assets/delays-DGxINOtn.js","assets/emotions-Cff7mf_x.js","assets/messages-CRABX2eS.js"])))=>i.map(i=>d[i]); var sC=Object.defineProperty;var rC=(n,e,t)=>e in n?sC(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var fi=(n,e,t)=>rC(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 oC="modulepreload",aC=function(n){return"/"+n},mv={},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=aC(c),c in mv)return;mv[c]=!0;const u=c.endsWith(".css"),f=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${f}`))return;const h=document.createElement("link");if(h.rel=u?"stylesheet":oC,u||(h.as="script"),h.crossOrigin="",h.href=c,l&&h.setAttribute("nonce",l),document.head.appendChild(h),u)return new Promise((d,p)=>{h.addEventListener("load",d),h.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.14 * (c) 2018-present Yuxi (Evan) You and Vue contributors @@ -3846,11 +3846,11 @@ void main() { * pinia v3.0.2 * (c) 2025 Eduardo San Martin Morote * @license MIT - */let Dw;const Xd=n=>Dw=n,Ow=Symbol();function $g(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 zz(){const n=b0(!0),e=n.run(()=>et({}));let t=[],i=[];const s=w0({install(r){Xd(s),s._a=r,r.provide(Ow,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 Nw=()=>{};function bx(n,e,t,i=Nw){n.push(e);const s=()=>{const r=n.indexOf(e);r>-1&&(n.splice(r,1),i())};return!t&&qh()&&x0(s),s}function ta(n,...e){n.slice().forEach(t=>{t(...e)})}const Vz=n=>n(),xx=Symbol(),xm=Symbol();function qg(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];$g(s)&&$g(i)&&n.hasOwnProperty(t)&&!Pt(i)&&!Ls(i)?n[t]=qg(s,i):n[t]=i}return n}const Hz=Symbol();function Gz(n){return!$g(n)||!Object.prototype.hasOwnProperty.call(n,Hz)}const{assign:rr}=Object;function Wz(n){return!!(Pt(n)&&n.effect)}function Xz(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=mS(t.state.value[n]);return rr(u,r,Object.keys(o||{}).reduce((f,h)=>(f[h]=w0(Me(()=>{Xd(t);const d=t._s.get(n);return o[h].call(d,d)})),f),{}))}return l=Uw(n,c,e,t,i,!0),l}function Uw(n,e,t={},i,s,r){let o;const a=rr({actions:{}},t),l={deep:!0};let c,u,f=[],h=[],d;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:d}):(qg(i.state.value[n],P),x={type:zl.patchObject,payload:P,storeId:n,events:d});const M=_=Symbol();Ar().then(()=>{_===M&&(c=!0)}),u=!0,ta(f,x,i.state.value[n])}const m=r?function(){const{state:x}=t,M=x?x():{};this.$patch(D=>{rr(D,M)})}:Nw;function v(){o.stop(),f=[],h=[],i._s.delete(n)}const b=(P,x="")=>{if(xx in P)return P[xm]=x,P;const M=function(){Xd(i);const D=Array.from(arguments),z=[],H=[];function G(te){z.push(te)}function ee(te){H.push(te)}ta(h,{args:D,name:M[xm],store:E,after:G,onError:ee});let j;try{j=P.apply(this&&this.$id===n?this:E,D)}catch(te){throw ta(H,te),te}return j instanceof Promise?j.then(te=>(ta(z,te),te)).catch(te=>(ta(H,te),Promise.reject(te))):(ta(z,j),j)};return M[xx]=!0,M[xm]=x,M},y={_p:i,$id:n,$onAction:bx.bind(null,h),$patch:g,$reset:m,$subscribe(P,x={}){const M=bx(f,P,x.detached,()=>D()),D=o.run(()=>Xe(()=>i.state.value[n],z=>{(x.flush==="sync"?u:c)&&P({storeId:n,type:zl.direct,events:d},z)},rr({},l,x)));return M},$dispose:v},E=xi(y);i._s.set(n,E);const S=(i._a&&i._a.runWithContext||Vz)(()=>i._e.run(()=>(o=b0()).run(()=>e({action:b}))));for(const P in S){const x=S[P];if(Pt(x)&&!Wz(x)||Ls(x))r||(p&&Gz(x)&&(Pt(x)?x.value=p[P]:qg(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 rr(E,S),rr(ut(E),S),Object.defineProperty(E,"$state",{get:()=>i.state.value[n],set:P=>{g(x=>{rr(x,P)})}}),i._p.forEach(P=>{rr(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 $z(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?gn(Ow,null):null),o&&Xd(o),o=Dw,o._s.has(n)||(s?Uw(n,e,i,o):Xz(n,i,o)),o._s.get(n)}return r.$id=n,r}function qz(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)||Ls(s))&&(t[i]=gS(n,i))}return t}const Yz=n=>{const e={};Object.entries(Object.assign({"/src/layouts/default.vue":()=>je(()=>import("./default-Jn9n3nXn.js"),__vite__mapDeps([0,1,2])),"/src/layouts/settings.vue":()=>je(()=>import("./settings-ANs_Jv0A.js"),__vite__mapDeps([3,4,5,6,7,8,9,10,11,12,13,1,2])),"/src/layouts/stage.vue":()=>je(()=>import("./stage-DTB_g_kC.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,h;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[(h=o.meta)==null?void 0:h.layout],children:[{...o,path:""}],meta:{isLayout:!0}}:o})}return i(n)};/*! + */let Dw;const Xd=n=>Dw=n,Ow=Symbol();function $g(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 zz(){const n=b0(!0),e=n.run(()=>et({}));let t=[],i=[];const s=w0({install(r){Xd(s),s._a=r,r.provide(Ow,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 Nw=()=>{};function bx(n,e,t,i=Nw){n.push(e);const s=()=>{const r=n.indexOf(e);r>-1&&(n.splice(r,1),i())};return!t&&qh()&&x0(s),s}function ta(n,...e){n.slice().forEach(t=>{t(...e)})}const Vz=n=>n(),xx=Symbol(),xm=Symbol();function qg(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];$g(s)&&$g(i)&&n.hasOwnProperty(t)&&!Pt(i)&&!Ls(i)?n[t]=qg(s,i):n[t]=i}return n}const Hz=Symbol();function Gz(n){return!$g(n)||!Object.prototype.hasOwnProperty.call(n,Hz)}const{assign:rr}=Object;function Wz(n){return!!(Pt(n)&&n.effect)}function Xz(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=mS(t.state.value[n]);return rr(u,r,Object.keys(o||{}).reduce((f,h)=>(f[h]=w0(Me(()=>{Xd(t);const d=t._s.get(n);return o[h].call(d,d)})),f),{}))}return l=Uw(n,c,e,t,i,!0),l}function Uw(n,e,t={},i,s,r){let o;const a=rr({actions:{}},t),l={deep:!0};let c,u,f=[],h=[],d;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:d}):(qg(i.state.value[n],P),x={type:zl.patchObject,payload:P,storeId:n,events:d});const M=_=Symbol();Ar().then(()=>{_===M&&(c=!0)}),u=!0,ta(f,x,i.state.value[n])}const m=r?function(){const{state:x}=t,M=x?x():{};this.$patch(D=>{rr(D,M)})}:Nw;function v(){o.stop(),f=[],h=[],i._s.delete(n)}const b=(P,x="")=>{if(xx in P)return P[xm]=x,P;const M=function(){Xd(i);const D=Array.from(arguments),z=[],H=[];function G(te){z.push(te)}function ee(te){H.push(te)}ta(h,{args:D,name:M[xm],store:E,after:G,onError:ee});let j;try{j=P.apply(this&&this.$id===n?this:E,D)}catch(te){throw ta(H,te),te}return j instanceof Promise?j.then(te=>(ta(z,te),te)).catch(te=>(ta(H,te),Promise.reject(te))):(ta(z,j),j)};return M[xx]=!0,M[xm]=x,M},y={_p:i,$id:n,$onAction:bx.bind(null,h),$patch:g,$reset:m,$subscribe(P,x={}){const M=bx(f,P,x.detached,()=>D()),D=o.run(()=>Xe(()=>i.state.value[n],z=>{(x.flush==="sync"?u:c)&&P({storeId:n,type:zl.direct,events:d},z)},rr({},l,x)));return M},$dispose:v},E=xi(y);i._s.set(n,E);const S=(i._a&&i._a.runWithContext||Vz)(()=>i._e.run(()=>(o=b0()).run(()=>e({action:b}))));for(const P in S){const x=S[P];if(Pt(x)&&!Wz(x)||Ls(x))r||(p&&Gz(x)&&(Pt(x)?x.value=p[P]:qg(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 rr(E,S),rr(ut(E),S),Object.defineProperty(E,"$state",{get:()=>i.state.value[n],set:P=>{g(x=>{rr(x,P)})}}),i._p.forEach(P=>{rr(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 $z(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?gn(Ow,null):null),o&&Xd(o),o=Dw,o._s.has(n)||(s?Uw(n,e,i,o):Xz(n,i,o)),o._s.get(n)}return r.$id=n,r}function qz(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)||Ls(s))&&(t[i]=gS(n,i))}return t}const Yz=n=>{const e={};Object.entries(Object.assign({"/src/layouts/default.vue":()=>je(()=>import("./default-DlVYj8BF.js"),__vite__mapDeps([0,1,2])),"/src/layouts/settings.vue":()=>je(()=>import("./settings-CynJw7x4.js"),__vite__mapDeps([3,4,5,6,7,8,9,10,11,12,13,1,2])),"/src/layouts/stage.vue":()=>je(()=>import("./stage-VygCK4j1.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,h;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[(h=o.meta)==null?void 0:h.layout],children:[{...o,path:""}],meta:{isLayout:!0}}:o})}return i(n)};/*! * vue-router v4.5.1 * (c) 2025 Eduardo San Martin Morote * @license MIT - */const ia=typeof document<"u";function Fw(n){return typeof n=="object"||"displayName"in n||"props"in n||"__vccOpts"in n}function jz(n){return n.__esModule||n[Symbol.toStringTag]==="Module"||n.default&&Fw(n.default)}const Mt=Object.assign;function Mm(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,kw=/#/g,Kz=/&/g,Zz=/\//g,Jz=/=/g,Qz=/\?/g,Bw=/\+/g,eV=/%5B/g,tV=/%5D/g,zw=/%5E/g,nV=/%60/g,Vw=/%7B/g,iV=/%7C/g,Hw=/%7D/g,sV=/%20/g;function W_(n){return encodeURI(""+n).replace(iV,"|").replace(eV,"[").replace(tV,"]")}function rV(n){return W_(n).replace(Vw,"{").replace(Hw,"}").replace(zw,"^")}function Yg(n){return W_(n).replace(Bw,"%2B").replace(sV,"+").replace(kw,"%23").replace(Kz,"%26").replace(nV,"`").replace(Vw,"{").replace(Hw,"}").replace(zw,"^")}function oV(n){return Yg(n).replace(Jz,"%3D")}function aV(n){return W_(n).replace(kw,"%23").replace(Qz,"%3F")}function lV(n){return n==null?"":aV(n).replace(Zz,"%2F")}function xc(n){try{return decodeURIComponent(""+n)}catch{}return""+n}const cV=/\/$/,uV=n=>n.replace(cV,"");function Sm(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=pV(i??e,t),{fullPath:i+(r&&"?")+r+o,path:i,query:s,hash:xc(o)}}function fV(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 hV(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])&&Gw(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 Gw(n,e){if(Object.keys(n).length!==Object.keys(e).length)return!1;for(const t in n)if(!dV(n[t],e[t]))return!1;return!0}function dV(n,e){return Vi(n)?Sx(n,e):Vi(e)?Sx(e,n):n===e}function Sx(n,e){return Vi(e)?n.length===e.length&&n.every((t,i)=>t===e[i]):n.length===1&&n[0]===e}function pV(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 ir={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 mV(n){if(!n)if(ia){const e=document.querySelector("base");n=e&&e.getAttribute("href")||"/",n=n.replace(/^\w+:\/\/[^\/]+/,"")}else n="/";return n[0]!=="/"&&n[0]!=="#"&&(n="/"+n),uV(n)}const gV=/^[^#]+#/;function _V(n,e){return n.replace(gV,"#")+e}function vV(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 $d=()=>({left:window.scrollX,top:window.scrollY});function yV(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=vV(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 Ex(n,e){return(history.state?history.state.position-e:-1)+n}const jg=new Map;function bV(n,e){jg.set(n,e)}function xV(n){const e=jg.get(n);return jg.delete(n),e}let MV=()=>location.protocol+"//"+location.host;function Ww(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 SV(n,e,t,i){let s=[],r=[],o=null;const a=({state:h})=>{const d=Ww(n,location),p=t.value,_=e.value;let g=0;if(h){if(t.value=d,e.value=h,o&&o===p){o=null;return}g=_?h.position-_.position:0}else i(d);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(h){s.push(h);const d=()=>{const p=s.indexOf(h);p>-1&&s.splice(p,1)};return r.push(d),d}function u(){const{history:h}=window;h.state&&h.replaceState(Mt({},h.state,{scroll:$d()}),"")}function f(){for(const h of r)h();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 Tx(n,e,t,i=!1,s=!1){return{back:n,current:e,forward:t,replaced:i,position:window.history.length,scroll:s?$d():null}}function EV(n){const{history:e,location:t}=window,i={value:Ww(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("#"),h=f>-1?(t.host&&document.querySelector("base")?n:n.slice(f))+l:MV()+n+l;try{e[u?"replaceState":"pushState"](c,"",h),s.value=c}catch(d){console.error(d),t[u?"replace":"assign"](h)}}function o(l,c){const u=Mt({},e.state,Tx(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:$d()});r(u.current,u,!0);const f=Mt({},Tx(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 TV(n){n=mV(n);const e=EV(n),t=SV(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:_V.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 wV(n){return n=location.host?n||location.pathname+location.search:"",n.includes("#")||(n+="#"),TV(n)}function AV(n){return typeof n=="string"||n&&typeof n=="object"}function Xw(n){return typeof n=="string"||typeof n=="symbol"}const $w=Symbol("");var wx;(function(n){n[n.aborted=4]="aborted",n[n.cancelled=8]="cancelled",n[n.duplicated=16]="duplicated"})(wx||(wx={}));function La(n,e){return Mt(new Error,{type:n,[$w]:!0},e)}function bs(n,e){return n instanceof Error&&$w in n&&(e==null||!!(n.type&e))}const Ax="[^/]+?",CV={sensitive:!1,strict:!1,start:!0,end:!0},RV=/[.+*?^${}()[\]/\\]/g;function PV(n,e){const t=Mt({},CV,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 qw(n,e){let t=0;const i=n.score,s=e.score;for(;t0&&e[e.length-1]<0}const LV={type:0,value:""},DV=/[a-zA-Z0-9_]/;function OV(n){if(!n)return[[]];if(n==="/")return[[LV]];if(!n.startsWith("/"))throw new Error(`Invalid path "${n}"`);function e(d){throw new Error(`ERR (${t})/"${c}": ${d}`)}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 h(){c+=l}for(;a{o(b)}:Vl}function o(f){if(Xw(f)){const h=i.get(f);h&&(i.delete(f),t.splice(t.indexOf(h),1),h.children.forEach(o),h.alias.forEach(o))}else{const h=t.indexOf(f);h>-1&&(t.splice(h,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 h=BV(f,t);t.splice(h,0,f),f.record.name&&!Ix(f)&&i.set(f.record.name,f)}function c(f,h){let d,p={},_,g;if("name"in f&&f.name){if(d=i.get(f.name),!d)throw La(1,{location:f});g=d.record.name,p=Mt(Rx(h.params,d.keys.filter(b=>!b.optional).concat(d.parent?d.parent.keys.filter(b=>b.optional):[]).map(b=>b.name)),f.params&&Rx(f.params,d.keys.map(b=>b.name))),_=d.stringify(p)}else if(f.path!=null)_=f.path,d=t.find(b=>b.re.test(_)),d&&(p=d.parse(_),g=d.record.name);else{if(d=h.name?i.get(h.name):t.find(b=>b.re.test(h.path)),!d)throw La(1,{location:f,currentLocation:h});g=d.record.name,p=Mt({},h.params,f.params),_=d.stringify(p)}const m=[];let v=d;for(;v;)m.unshift(v.record),v=v.parent;return{name:g,path:_,params:p,matched:m,meta:kV(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 Rx(n,e){const t={};for(const i of e)i in n&&(t[i]=n[i]);return t}function Px(n){const e={path:n.path,redirect:n.redirect,name:n.name,meta:n.meta||{},aliasOf:n.aliasOf,beforeEnter:n.beforeEnter,props:FV(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 FV(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 Ix(n){for(;n;){if(n.record.aliasOf)return!0;n=n.parent}return!1}function kV(n){return n.reduce((e,t)=>Mt(e,t.meta),{})}function Lx(n,e){const t={};for(const i in n)t[i]=i in e?e[i]:n[i];return t}function BV(n,e){let t=0,i=e.length;for(;t!==i;){const r=t+i>>1;qw(n,e[r])<0?i=r:t=r+1}const s=zV(n);return s&&(i=e.lastIndexOf(s,i-1)),i}function zV(n){let e=n;for(;e=e.parent;)if(Yw(e)&&qw(n,e)===0)return e}function Yw({record:n}){return!!(n.name||n.components&&Object.keys(n.components).length||n.redirect)}function VV(n){const e={};if(n===""||n==="?")return e;const i=(n[0]==="?"?n.slice(1):n).split("&");for(let s=0;sr&&Yg(r)):[i&&Yg(i)]).forEach(r=>{r!==void 0&&(e+=(e.length?"&":"")+t,r!=null&&(e+="="+r))})}return e}function HV(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 GV=Symbol(""),Ox=Symbol(""),qd=Symbol(""),X_=Symbol(""),Kg=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 fr(n,e,t,i,s,r=o=>o()){const o=i&&(i.enterCallbacks[s]=i.enterCallbacks[s]||[]);return()=>new Promise((a,l)=>{const c=h=>{h===!1?l(La(4,{from:t,to:e})):h instanceof Error?l(h):AV(h)?l(La(2,{from:e,to:h})):(o&&i.enterCallbacks[s]===o&&typeof h=="function"&&o.push(h),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(h=>l(h))})}function Em(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(Fw(l)){const u=(l.__vccOpts||l)[e];u&&r.push(fr(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=jz(u)?u.default:u;o.mods[a]=u,o.components[a]=f;const d=(f.__vccOpts||f)[e];return d&&fr(d,t,i,o,a,s)()}))}}return r}function Nx(n){const e=gn(qd),t=gn(X_),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 h=f.findIndex(Ia.bind(null,u));if(h>-1)return h;const d=Ux(l[c-2]);return c>1&&Ux(u)===d&&f[f.length-1].path!==d?f.findIndex(Ia.bind(null,l[c-2])):h}),r=Me(()=>s.value>-1&&YV(t.params,i.value.params)),o=Me(()=>s.value>-1&&s.value===t.matched.length-1&&Gw(t.params,i.value.params));function a(l={}){if(qV(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 WV(n){return n.length===1?n[0]:n}const XV=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"},viewTransition:Boolean},useLink:Nx,setup(n,{slots:e}){const t=xi(Nx(n)),{options:i}=gn(qd),s=Me(()=>({[Fx(n.activeClass,i.linkActiveClass,"router-link-active")]:t.isActive,[Fx(n.exactActiveClass,i.linkExactActiveClass,"router-link-exact-active")]:t.isExactActive}));return()=>{const r=e.default&&WV(e.default(t));return n.custom?r:ks("a",{"aria-current":t.isExactActive?n.ariaCurrentValue:null,href:t.href,onClick:t.navigate,class:s.value},r)}}}),$V=XV;function qV(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 YV(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 Ux(n){return n?n.aliasOf?n.aliasOf.path:n.path:""}const Fx=(n,e,t)=>n??e??t,jV=fn({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(n,{attrs:e,slots:t}){const i=gn(Kg),s=Me(()=>n.route||i.value),r=gn(Ox,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]);gr(Ox,Me(()=>o.value+1)),gr(GV,a),gr(Kg,s);const l=et();return Xe(()=>[l.value,a.value,n.name],([c,u,f],[h,d,p])=>{u&&(u.instances[f]=c,d&&d!==u&&c&&c===h&&(u.leaveGuards.size||(u.leaveGuards=d.leaveGuards),u.updateGuards.size||(u.updateGuards=d.updateGuards))),c&&u&&(!d||!Ia(u,d)||!h)&&(u.enterCallbacks[f]||[]).forEach(_=>_(c))},{flush:"post"}),()=>{const c=s.value,u=n.name,f=a.value,h=f&&f.components[u];if(!h)return kx(t.default,{Component:h,route:c});const d=f.props[u],p=d?d===!0?c.params:typeof d=="function"?d(c):d:null,g=ks(h,Mt({},p,e,{onVnodeUnmounted:m=>{m.component.isUnmounted&&(f.instances[u]=null)},ref:l}));return kx(t.default,{Component:g,route:c})||g}}});function kx(n,e){if(!n)return null;const t=n(e);return t.length===1?t[0]:t}const jw=jV;function KV(n){const e=UV(n.routes,n),t=n.parseQuery||VV,i=n.stringifyQuery||Dx,s=n.history,r=ul(),o=ul(),a=ul(),l=Oe(ir);let c=ir;ia&&n.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const u=Mm.bind(null,q=>""+q),f=Mm.bind(null,lV),h=Mm.bind(null,xc);function d(q,ae){let le,ce;return Xw(q)?(le=e.getRecordMatcher(q),ce=ae):ce=q,e.addRoute(ce,le)}function p(q){const ae=e.getRecordMatcher(q);ae&&e.removeRoute(ae)}function _(){return e.getRoutes().map(q=>q.record)}function g(q){return!!e.getRecordMatcher(q)}function m(q,ae){if(ae=Mt({},ae||l.value),typeof q=="string"){const w=Sm(t,q,ae.path),$=e.resolve({path:w.path},ae),W=s.createHref(w.fullPath);return Mt(w,$,{params:h($.params),hash:xc(w.hash),redirectedFrom:void 0,href:W})}let le;if(q.path!=null)le=Mt({},q,{path:Sm(t,q.path,ae.path).path});else{const w=Mt({},q.params);for(const $ in w)w[$]==null&&delete w[$];le=Mt({},q,{params:f(w)}),ae.params=f(ae.params)}const ce=e.resolve(le,ae),He=q.hash||"";ce.params=u(h(ce.params));const U=fV(i,Mt({},q,{hash:rV(He),path:ce.path})),F=s.createHref(U);return Mt({fullPath:U,hash:He,query:i===Dx?HV(q.query):q.query||{}},ce,{redirectedFrom:void 0,href:F})}function v(q){return typeof q=="string"?Sm(t,q,l.value.path):Mt({},q)}function b(q,ae){if(c!==q)return La(8,{from:ae,to:q})}function y(q){return S(q)}function E(q){return y(Mt(v(q),{replace:!0}))}function T(q){const ae=q.matched[q.matched.length-1];if(ae&&ae.redirect){const{redirect:le}=ae;let ce=typeof le=="function"?le(q):le;return typeof ce=="string"&&(ce=ce.includes("?")||ce.includes("#")?ce=v(ce):{path:ce},ce.params={}),Mt({query:q.query,hash:q.hash,params:ce.path!=null?{}:q.params},ce)}}function S(q,ae){const le=c=m(q),ce=l.value,He=q.state,U=q.force,F=q.replace===!0,w=T(le);if(w)return S(Mt(v(w),{state:typeof w=="object"?Mt({},He,w.state):He,force:U,replace:F}),ae||le);const $=le;$.redirectedFrom=ae;let W;return!U&&hV(i,ce,le)&&(W=La(16,{to:$,from:ce}),se(ce,ce,!0,!1)),(W?Promise.resolve(W):M($,ce)).catch(X=>bs(X)?bs(X,2)?X:be(X):J(X,$,ce)).then(X=>{if(X){if(bs(X,2))return S(Mt({replace:F},v(X.to),{state:typeof X.to=="object"?Mt({},He,X.to.state):He,force:U}),ae||$)}else X=z($,ce,!0,F,He);return D($,ce,X),X})}function P(q,ae){const le=b(q,ae);return le?Promise.reject(le):Promise.resolve()}function x(q){const ae=re.values().next().value;return ae&&typeof ae.runWithContext=="function"?ae.runWithContext(q):q()}function M(q,ae){let le;const[ce,He,U]=ZV(q,ae);le=Em(ce.reverse(),"beforeRouteLeave",q,ae);for(const w of ce)w.leaveGuards.forEach($=>{le.push(fr($,q,ae))});const F=P.bind(null,q,ae);return le.push(F),xe(le).then(()=>{le=[];for(const w of r.list())le.push(fr(w,q,ae));return le.push(F),xe(le)}).then(()=>{le=Em(He,"beforeRouteUpdate",q,ae);for(const w of He)w.updateGuards.forEach($=>{le.push(fr($,q,ae))});return le.push(F),xe(le)}).then(()=>{le=[];for(const w of U)if(w.beforeEnter)if(Vi(w.beforeEnter))for(const $ of w.beforeEnter)le.push(fr($,q,ae));else le.push(fr(w.beforeEnter,q,ae));return le.push(F),xe(le)}).then(()=>(q.matched.forEach(w=>w.enterCallbacks={}),le=Em(U,"beforeRouteEnter",q,ae,x),le.push(F),xe(le))).then(()=>{le=[];for(const w of o.list())le.push(fr(w,q,ae));return le.push(F),xe(le)}).catch(w=>bs(w,8)?w:Promise.reject(w))}function D(q,ae,le){a.list().forEach(ce=>x(()=>ce(q,ae,le)))}function z(q,ae,le,ce,He){const U=b(q,ae);if(U)return U;const F=ae===ir,w=ia?history.state:{};le&&(ce||F?s.replace(q.fullPath,Mt({scroll:F&&w&&w.scroll},He)):s.push(q.fullPath,He)),l.value=q,se(q,ae,le,F),be()}let H;function G(){H||(H=s.listen((q,ae,le)=>{if(!ge.listening)return;const ce=m(q),He=T(ce);if(He){S(Mt(He,{replace:!0,force:!0}),ce).catch(Vl);return}c=ce;const U=l.value;ia&&bV(Ex(U.fullPath,le.delta),$d()),M(ce,U).catch(F=>bs(F,12)?F:bs(F,2)?(S(Mt(v(F.to),{force:!0}),ce).then(w=>{bs(w,20)&&!le.delta&&le.type===Mc.pop&&s.go(-1,!1)}).catch(Vl),Promise.reject()):(le.delta&&s.go(-le.delta,!1),J(F,ce,U))).then(F=>{F=F||z(ce,U,!1),F&&(le.delta&&!bs(F,8)?s.go(-le.delta,!1):le.type===Mc.pop&&bs(F,20)&&s.go(-1,!1)),D(ce,U,F)}).catch(Vl)}))}let ee=ul(),j=ul(),te;function J(q,ae,le){be(q);const ce=j.list();return ce.length?ce.forEach(He=>He(q,ae,le)):console.error(q),Promise.reject(q)}function de(){return te&&l.value!==ir?Promise.resolve():new Promise((q,ae)=>{ee.add([q,ae])})}function be(q){return te||(te=!q,G(),ee.list().forEach(([ae,le])=>q?le(q):ae()),ee.reset()),q}function se(q,ae,le,ce){const{scrollBehavior:He}=n;if(!ia||!He)return Promise.resolve();const U=!le&&xV(Ex(q.fullPath,0))||(ce||!le)&&history.state&&history.state.scroll||null;return Ar().then(()=>He(q,ae,U)).then(F=>F&&yV(F)).catch(F=>J(F,q,ae))}const ye=q=>s.go(q);let Be;const re=new Set,ge={currentRoute:l,listening:!0,addRoute:d,removeRoute:p,clearRoutes:e.clearRoutes,hasRoute:g,getRoutes:_,resolve:m,options:n,push:y,replace:E,go:ye,back:()=>ye(-1),forward:()=>ye(1),beforeEach:r.add,beforeResolve:o.add,afterEach:a.add,onError:j.add,isReady:de,install(q){const ae=this;q.component("RouterLink",$V),q.component("RouterView",jw),q.config.globalProperties.$router=ae,Object.defineProperty(q.config.globalProperties,"$route",{enumerable:!0,get:()=>Ot(l)}),ia&&!Be&&l.value===ir&&(Be=!0,y(s.location).catch(He=>{}));const le={};for(const He in ir)Object.defineProperty(le,He,{get:()=>l.value[He],enumerable:!0});q.provide(qd,ae),q.provide(X_,fS(le)),q.provide(Kg,l);const ce=q.unmount;re.add(q),q.unmount=function(){re.delete(q),re.size<1&&(c=ir,H&&H(),H=null,l.value=ir,Be=!1,te=!1),ce()}}};function xe(q){return q.reduce((ae,le)=>ae.then(()=>x(le)),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;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 JV(){return gn(qd)}function GG(n){return gn(X_)}const QV=[{path:"/",name:"/",component:()=>je(()=>import("./index-CSK7uqHy.js"),__vite__mapDeps([14,4,5,6,7,8,11,12,13,15,16,17,10,9,18,19,20,21,22,23,24,25,1,2,26,27,28,29])),meta:{layout:"stage",stageTransition:{name:"bubble-wave-out"}}},{path:"/:all(.*)",name:"/[...all]",component:()=>je(()=>import("./_...all_-W_SPK8sN.js"),[])},{path:"/audio",name:"/audio",component:()=>je(()=>import("./audio-CQiHFFsw.js"),[])},{path:"/devtools",children:[{path:"background-remove",name:"/devtools/background-remove",component:()=>je(()=>import("./background-remove-DYaqEJCO.js"),__vite__mapDeps([30,11,12,13,31]))},{path:"chat",name:"/devtools/chat",component:()=>je(()=>import("./chat-3-8NLufH.js"),__vite__mapDeps([32,20,10]))},{path:"image",name:"/devtools/image",component:()=>je(()=>import("./image-DPk0KHrt.js"),__vite__mapDeps([33,34]))},{path:"vibrant",name:"/devtools/vibrant",component:()=>je(()=>import("./vibrant-DyMOQuK8.js"),__vite__mapDeps([35,11,12,13,31,36]))}]},{path:"/queue",name:"/queue",component:()=>je(()=>import("./queue-B_aWwf6M.js"),__vite__mapDeps([37,18]))},{path:"/settings",children:[{path:"",name:"/settings/",component:()=>je(()=>import("./index-Dt5Zr-vu.js"),__vite__mapDeps([38,4,5,6,7,8,11,12,13,39,28])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"airi-card",children:[{path:"",name:"/settings/airi-card/",component:()=>je(()=>import("./index-DCp9eCXO.js"),__vite__mapDeps([40,7,21,8,22,9,10,17,11,12,13,31,41,42,43,4,5,6,44,28])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"components",children:[{path:"CardDetailDialog",name:"/settings/airi-card/components/CardDetailDialog",component:()=>je(()=>import("./CardDetailDialog-DURsENRS.js"),__vite__mapDeps([45,41,42,43,12,4,5,6,7,21,8,22,9,10,17,11,13]))},{path:"CardListItem",name:"/settings/airi-card/components/CardListItem",component:()=>je(()=>import("./CardListItem-PljhH-7U.js"),__vite__mapDeps([46,44,4,5,6,7,8,11,12,13]))},{path:"DeleteCardDialog",name:"/settings/airi-card/components/DeleteCardDialog",component:()=>je(()=>import("./DeleteCardDialog-BdJxoLU9.js"),__vite__mapDeps([47,42,43,12]))}]}]},{path:"appearance",children:[{path:"",name:"/settings/appearance/",component:()=>je(()=>import("./index-R-df0ppj.js"),__vite__mapDeps([48,4,5,6,7,8,11,12,13,49,25,23,43,28,50])),meta:{layout:"settings",stageTransition:{name:"slide",pageSpecificAvailable:!0}}}]},{path:"memory",children:[{path:"",name:"/settings/memory/",component:()=>je(()=>import("./index-CcwV4B8o.js"),__vite__mapDeps([51,28])),meta:{layout:"settings",stageTransition:{name:"slide"}}}]},{path:"models",children:[{path:"",name:"/settings/models/",component:()=>je(()=>import("./index-CfvQILkm.js"),__vite__mapDeps([52,4,5,24,6,7,8,11,12,13,36,49,25,23,43,53,28,54])),meta:{layout:"settings",stageTransition:{name:"slide",pageSpecificAvailable:!0}}}]},{path:"modules",children:[{path:"",name:"/settings/modules/",component:()=>je(()=>import("./index-DfQN29KQ.js"),__vite__mapDeps([55,4,5,6,7,8,56,11,12,13,39,53,28])),meta:{layout:"settings",stageTransition:{name:"slide",pageSpecificAvailable:!0}}},{path:"consciousness",name:"/settings/modules/consciousness",component:()=>je(()=>import("./consciousness-03dOPB9r.js"),__vite__mapDeps([57,4,5,6,7,8,22,9,10,11,12,13,58,23,59,28])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"memory-long-term",name:"/settings/modules/memory-long-term",component:()=>je(()=>import("./memory-long-term-CdegH93Z.js"),__vite__mapDeps([60,28])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"memory-short-term",name:"/settings/modules/memory-short-term",component:()=>je(()=>import("./memory-short-term-CkxLWbON.js"),__vite__mapDeps([61,28])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"speech",name:"/settings/modules/speech",component:()=>je(()=>import("./speech-B67Uvg4K.js"),__vite__mapDeps([62,63,4,5,11,12,13,6,7,8,9,10,17,64,59,65,27,58,23,28])),meta:{layout:"settings",stageTransition:{name:"slide"}}}]},{path:"providers",children:[{path:"",name:"/settings/providers/",component:()=>je(()=>import("./index-B3D27Cgx.js"),__vite__mapDeps([66,4,5,6,7,8,9,10,56,11,12,13,53,28])),meta:{layout:"settings",stageTransition:{name:"slide",pageSpecificAvailable:!0}}},{path:"alibaba-cloud-model-studio",name:"/settings/providers/alibaba-cloud-model-studio",component:()=>je(()=>import("./alibaba-cloud-model-studio-DfaR_dR0.js"),__vite__mapDeps([67,4,5,6,7,8,9,10,17,63,11,12,13,68,69,25,23,64,59,70,71,28])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"anthropic",name:"/settings/providers/anthropic",component:()=>je(()=>import("./anthropic-DEAl6Zmk.js"),__vite__mapDeps([72,4,5,6,7,8,9,10,11,12,13,69,25,23,64,59,70,71,73,28])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"cloudflare-workers-ai",name:"/settings/providers/cloudflare-workers-ai",component:()=>je(()=>import("./cloudflare-workers-ai-AqUagaNH.js"),__vite__mapDeps([74,4,5,6,7,8,9,10,11,12,13,64,59,70,71,73,28])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"deepseek",name:"/settings/providers/deepseek",component:()=>je(()=>import("./deepseek-B53p4ZBr.js"),__vite__mapDeps([75,4,5,6,7,8,9,10,11,12,13,69,25,23,64,59,70,71,73,28])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"elevenlabs",name:"/settings/providers/elevenlabs",component:()=>je(()=>import("./elevenlabs-u8BehsUo.js"),__vite__mapDeps([76,4,5,6,7,8,9,10,17,63,11,12,13,68,69,25,23,64,59,70,71,28])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"featherless-ai",name:"/settings/providers/featherless-ai",component:()=>je(()=>import("./featherless-ai-d4ZFWdyE.js"),__vite__mapDeps([77,4,5,6,7,8,9,10,11,12,13,69,25,23,64,59,70,71,73,28])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"fireworks-ai",name:"/settings/providers/fireworks-ai",component:()=>je(()=>import("./fireworks-ai-DXxpOmDK.js"),__vite__mapDeps([78,4,5,6,7,8,9,10,11,12,13,69,25,23,64,59,70,71,73,28])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"google-generative-ai",name:"/settings/providers/google-generative-ai",component:()=>je(()=>import("./google-generative-ai-tkGWQeXX.js"),__vite__mapDeps([79,4,5,6,7,8,9,10,11,12,13,69,25,23,64,59,70,71,73,28])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"microsoft-speech",name:"/settings/providers/microsoft-speech",component:()=>je(()=>import("./microsoft-speech-ChkGjf75.js"),__vite__mapDeps([80,4,5,6,7,8,9,10,17,64,59,63,11,12,13,68,69,25,23,70,71,28])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"mistral-ai",name:"/settings/providers/mistral-ai",component:()=>je(()=>import("./mistral-ai-n7T6D5lD.js"),__vite__mapDeps([81,4,5,6,7,8,9,10,11,12,13,69,25,23,64,59,70,71,73,28])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"moonshot-ai",name:"/settings/providers/moonshot-ai",component:()=>je(()=>import("./moonshot-ai-DmoJa9kd.js"),__vite__mapDeps([82,4,5,6,7,8,9,10,11,12,13,69,25,23,64,59,70,71,73,28])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"novita-ai",name:"/settings/providers/novita-ai",component:()=>je(()=>import("./novita-ai-BGUP6I0O.js"),__vite__mapDeps([83,4,5,6,7,8,9,10,11,12,13,69,25,23,64,59,70,71,73,28])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"ollama",name:"/settings/providers/ollama",component:()=>je(()=>import("./ollama-CGevjPsb.js"),__vite__mapDeps([84,4,5,6,7,8,9,10,59,11,12,13,69,25,23,64,71,73,28])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"openai",name:"/settings/providers/openai",component:()=>je(()=>import("./openai-Bljxgvr0.js"),__vite__mapDeps([85,4,5,6,7,8,9,10,11,12,13,69,25,23,64,59,70,71,73,28])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"openrouter-ai",name:"/settings/providers/openrouter-ai",component:()=>je(()=>import("./openrouter-ai-DLii68h7.js"),__vite__mapDeps([86,4,5,6,7,8,9,10,11,12,13,69,25,23,64,59,70,71,73,28])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"together-ai",name:"/settings/providers/together-ai",component:()=>je(()=>import("./together-ai-Wdg-uXlv.js"),__vite__mapDeps([87,4,5,6,7,8,9,10,11,12,13,69,25,23,64,59,70,71,73,28])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"volcengine",name:"/settings/providers/volcengine",component:()=>je(()=>import("./volcengine-Cu9s47NY.js"),__vite__mapDeps([88,4,5,6,7,8,9,10,17,64,59,63,11,12,13,68,69,25,23,70,71,28])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"xai",name:"/settings/providers/xai",component:()=>je(()=>import("./xai-BHmWt46x.js"),__vite__mapDeps([89,4,5,6,7,8,9,10,11,12,13,69,25,23,64,59,70,71,73,28])),meta:{layout:"settings",stageTransition:{name:"slide"}}}]},{path:"scene",children:[{path:"",name:"/settings/scene/",component:()=>je(()=>import("./index-dMGu9uSt.js"),__vite__mapDeps([90,53,7,8,28])),meta:{layout:"settings",stageTransition:{name:"slide",pageSpecificAvailable:!0}}}]}]},{path:"/test",children:[{path:"filter-message",name:"/test/filter-message",component:()=>je(()=>import("./filter-message-BGb1DSTp.js"),__vite__mapDeps([91,11,12,13,65,27]))},{path:"queues",children:[{path:"delays",name:"/test/queues/delays",component:()=>je(()=>import("./delays-DC8esD_g.js"),__vite__mapDeps([92,26,19,8,18,6,11,12,13,65,27]))},{path:"emotions",name:"/test/queues/emotions",component:()=>je(()=>import("./emotions-BWYozuhn.js"),__vite__mapDeps([93,18,19,8,11,12,13,65,27]))},{path:"messages",name:"/test/queues/messages",component:()=>je(()=>import("./messages-VneqjxaE.js"),__vite__mapDeps([94,18,19,8,11,12,13,65,27]))}]}]}],Kw=(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}}},e6={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},t6=n=>Kw(e6[n.toLowerCase()],6),n6=/^#?([0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{4}|[0-9a-f]{3})$/i,i6=n=>{let e;return(e=n.match(n6))?Kw(parseInt(e[1],16),e[1].length):void 0},_r="([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)",Gl=`${_r}%`,$_=`(?:${_r}%|${_r})`,s6=`(?:${_r}(deg|grad|rad|turn)|${_r})`,Da="\\s*,\\s*",r6=new RegExp(`^rgba?\\(\\s*${_r}${Da}${_r}${Da}${_r}\\s*(?:,\\s*${$_}\\s*)?\\)$`),o6=new RegExp(`^rgba?\\(\\s*${Gl}${Da}${Gl}${Da}${Gl}\\s*(?:,\\s*${$_}\\s*)?\\)$`),a6=n=>{let e={mode:"rgb"},t;if(t=n.match(r6))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(o6))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},l6=(n,e)=>n===void 0?void 0:typeof n!="object"?v6(n):n.mode!==void 0?n:e?{...n,mode:e}:void 0,Zw=(n="rgb")=>e=>(e=l6(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={},Oh=[],Qw={},c6=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=c6)}),Jw[n.mode]=n,(n.parse||[]).forEach(e=>{f6(e,n.mode)}),Zw(n.mode)),u6=n=>Jw[n],f6=(n,e)=>{if(typeof n=="string"){if(!e)throw new Error("'mode' required when 'parser' is a string");Qw[n]=e}else typeof n=="function"&&Oh.indexOf(n)<0&&Oh.push(n)},Zg=/[^\x00-\x7F]|[a-zA-Z_]/,h6=/[^\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 Jg(n){if($e>=n.length)return!1;let e=n[$e];if(Zg.test(e))return!0;if(e==="-"){if(n.length-$e<2)return!1;let t=n[$e+1];return!!(t==="-"||Zg.test(t))}return!1}const d6={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))),Jg(n)){let t=Nh(n);return t==="deg"||t==="rad"||t==="turn"||t==="grad"?{type:_e.Hue,value:e*d6[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 Nh(n){let e="";for(;$e{},Vi=Array.isArray,kw=/#/g,Kz=/&/g,Zz=/\//g,Jz=/=/g,Qz=/\?/g,Bw=/\+/g,eV=/%5B/g,tV=/%5D/g,zw=/%5E/g,nV=/%60/g,Vw=/%7B/g,iV=/%7C/g,Hw=/%7D/g,sV=/%20/g;function W_(n){return encodeURI(""+n).replace(iV,"|").replace(eV,"[").replace(tV,"]")}function rV(n){return W_(n).replace(Vw,"{").replace(Hw,"}").replace(zw,"^")}function Yg(n){return W_(n).replace(Bw,"%2B").replace(sV,"+").replace(kw,"%23").replace(Kz,"%26").replace(nV,"`").replace(Vw,"{").replace(Hw,"}").replace(zw,"^")}function oV(n){return Yg(n).replace(Jz,"%3D")}function aV(n){return W_(n).replace(kw,"%23").replace(Qz,"%3F")}function lV(n){return n==null?"":aV(n).replace(Zz,"%2F")}function xc(n){try{return decodeURIComponent(""+n)}catch{}return""+n}const cV=/\/$/,uV=n=>n.replace(cV,"");function Sm(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=pV(i??e,t),{fullPath:i+(r&&"?")+r+o,path:i,query:s,hash:xc(o)}}function fV(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 hV(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])&&Gw(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 Gw(n,e){if(Object.keys(n).length!==Object.keys(e).length)return!1;for(const t in n)if(!dV(n[t],e[t]))return!1;return!0}function dV(n,e){return Vi(n)?Sx(n,e):Vi(e)?Sx(e,n):n===e}function Sx(n,e){return Vi(e)?n.length===e.length&&n.every((t,i)=>t===e[i]):n.length===1&&n[0]===e}function pV(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 ir={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 mV(n){if(!n)if(ia){const e=document.querySelector("base");n=e&&e.getAttribute("href")||"/",n=n.replace(/^\w+:\/\/[^\/]+/,"")}else n="/";return n[0]!=="/"&&n[0]!=="#"&&(n="/"+n),uV(n)}const gV=/^[^#]+#/;function _V(n,e){return n.replace(gV,"#")+e}function vV(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 $d=()=>({left:window.scrollX,top:window.scrollY});function yV(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=vV(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 Ex(n,e){return(history.state?history.state.position-e:-1)+n}const jg=new Map;function bV(n,e){jg.set(n,e)}function xV(n){const e=jg.get(n);return jg.delete(n),e}let MV=()=>location.protocol+"//"+location.host;function Ww(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 SV(n,e,t,i){let s=[],r=[],o=null;const a=({state:h})=>{const d=Ww(n,location),p=t.value,_=e.value;let g=0;if(h){if(t.value=d,e.value=h,o&&o===p){o=null;return}g=_?h.position-_.position:0}else i(d);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(h){s.push(h);const d=()=>{const p=s.indexOf(h);p>-1&&s.splice(p,1)};return r.push(d),d}function u(){const{history:h}=window;h.state&&h.replaceState(Mt({},h.state,{scroll:$d()}),"")}function f(){for(const h of r)h();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 Tx(n,e,t,i=!1,s=!1){return{back:n,current:e,forward:t,replaced:i,position:window.history.length,scroll:s?$d():null}}function EV(n){const{history:e,location:t}=window,i={value:Ww(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("#"),h=f>-1?(t.host&&document.querySelector("base")?n:n.slice(f))+l:MV()+n+l;try{e[u?"replaceState":"pushState"](c,"",h),s.value=c}catch(d){console.error(d),t[u?"replace":"assign"](h)}}function o(l,c){const u=Mt({},e.state,Tx(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:$d()});r(u.current,u,!0);const f=Mt({},Tx(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 TV(n){n=mV(n);const e=EV(n),t=SV(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:_V.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 wV(n){return n=location.host?n||location.pathname+location.search:"",n.includes("#")||(n+="#"),TV(n)}function AV(n){return typeof n=="string"||n&&typeof n=="object"}function Xw(n){return typeof n=="string"||typeof n=="symbol"}const $w=Symbol("");var wx;(function(n){n[n.aborted=4]="aborted",n[n.cancelled=8]="cancelled",n[n.duplicated=16]="duplicated"})(wx||(wx={}));function La(n,e){return Mt(new Error,{type:n,[$w]:!0},e)}function bs(n,e){return n instanceof Error&&$w in n&&(e==null||!!(n.type&e))}const Ax="[^/]+?",CV={sensitive:!1,strict:!1,start:!0,end:!0},RV=/[.+*?^${}()[\]/\\]/g;function PV(n,e){const t=Mt({},CV,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 qw(n,e){let t=0;const i=n.score,s=e.score;for(;t0&&e[e.length-1]<0}const LV={type:0,value:""},DV=/[a-zA-Z0-9_]/;function OV(n){if(!n)return[[]];if(n==="/")return[[LV]];if(!n.startsWith("/"))throw new Error(`Invalid path "${n}"`);function e(d){throw new Error(`ERR (${t})/"${c}": ${d}`)}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 h(){c+=l}for(;a{o(b)}:Vl}function o(f){if(Xw(f)){const h=i.get(f);h&&(i.delete(f),t.splice(t.indexOf(h),1),h.children.forEach(o),h.alias.forEach(o))}else{const h=t.indexOf(f);h>-1&&(t.splice(h,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 h=BV(f,t);t.splice(h,0,f),f.record.name&&!Ix(f)&&i.set(f.record.name,f)}function c(f,h){let d,p={},_,g;if("name"in f&&f.name){if(d=i.get(f.name),!d)throw La(1,{location:f});g=d.record.name,p=Mt(Rx(h.params,d.keys.filter(b=>!b.optional).concat(d.parent?d.parent.keys.filter(b=>b.optional):[]).map(b=>b.name)),f.params&&Rx(f.params,d.keys.map(b=>b.name))),_=d.stringify(p)}else if(f.path!=null)_=f.path,d=t.find(b=>b.re.test(_)),d&&(p=d.parse(_),g=d.record.name);else{if(d=h.name?i.get(h.name):t.find(b=>b.re.test(h.path)),!d)throw La(1,{location:f,currentLocation:h});g=d.record.name,p=Mt({},h.params,f.params),_=d.stringify(p)}const m=[];let v=d;for(;v;)m.unshift(v.record),v=v.parent;return{name:g,path:_,params:p,matched:m,meta:kV(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 Rx(n,e){const t={};for(const i of e)i in n&&(t[i]=n[i]);return t}function Px(n){const e={path:n.path,redirect:n.redirect,name:n.name,meta:n.meta||{},aliasOf:n.aliasOf,beforeEnter:n.beforeEnter,props:FV(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 FV(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 Ix(n){for(;n;){if(n.record.aliasOf)return!0;n=n.parent}return!1}function kV(n){return n.reduce((e,t)=>Mt(e,t.meta),{})}function Lx(n,e){const t={};for(const i in n)t[i]=i in e?e[i]:n[i];return t}function BV(n,e){let t=0,i=e.length;for(;t!==i;){const r=t+i>>1;qw(n,e[r])<0?i=r:t=r+1}const s=zV(n);return s&&(i=e.lastIndexOf(s,i-1)),i}function zV(n){let e=n;for(;e=e.parent;)if(Yw(e)&&qw(n,e)===0)return e}function Yw({record:n}){return!!(n.name||n.components&&Object.keys(n.components).length||n.redirect)}function VV(n){const e={};if(n===""||n==="?")return e;const i=(n[0]==="?"?n.slice(1):n).split("&");for(let s=0;sr&&Yg(r)):[i&&Yg(i)]).forEach(r=>{r!==void 0&&(e+=(e.length?"&":"")+t,r!=null&&(e+="="+r))})}return e}function HV(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 GV=Symbol(""),Ox=Symbol(""),qd=Symbol(""),X_=Symbol(""),Kg=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 fr(n,e,t,i,s,r=o=>o()){const o=i&&(i.enterCallbacks[s]=i.enterCallbacks[s]||[]);return()=>new Promise((a,l)=>{const c=h=>{h===!1?l(La(4,{from:t,to:e})):h instanceof Error?l(h):AV(h)?l(La(2,{from:e,to:h})):(o&&i.enterCallbacks[s]===o&&typeof h=="function"&&o.push(h),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(h=>l(h))})}function Em(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(Fw(l)){const u=(l.__vccOpts||l)[e];u&&r.push(fr(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=jz(u)?u.default:u;o.mods[a]=u,o.components[a]=f;const d=(f.__vccOpts||f)[e];return d&&fr(d,t,i,o,a,s)()}))}}return r}function Nx(n){const e=gn(qd),t=gn(X_),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 h=f.findIndex(Ia.bind(null,u));if(h>-1)return h;const d=Ux(l[c-2]);return c>1&&Ux(u)===d&&f[f.length-1].path!==d?f.findIndex(Ia.bind(null,l[c-2])):h}),r=Me(()=>s.value>-1&&YV(t.params,i.value.params)),o=Me(()=>s.value>-1&&s.value===t.matched.length-1&&Gw(t.params,i.value.params));function a(l={}){if(qV(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 WV(n){return n.length===1?n[0]:n}const XV=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"},viewTransition:Boolean},useLink:Nx,setup(n,{slots:e}){const t=xi(Nx(n)),{options:i}=gn(qd),s=Me(()=>({[Fx(n.activeClass,i.linkActiveClass,"router-link-active")]:t.isActive,[Fx(n.exactActiveClass,i.linkExactActiveClass,"router-link-exact-active")]:t.isExactActive}));return()=>{const r=e.default&&WV(e.default(t));return n.custom?r:ks("a",{"aria-current":t.isExactActive?n.ariaCurrentValue:null,href:t.href,onClick:t.navigate,class:s.value},r)}}}),$V=XV;function qV(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 YV(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 Ux(n){return n?n.aliasOf?n.aliasOf.path:n.path:""}const Fx=(n,e,t)=>n??e??t,jV=fn({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(n,{attrs:e,slots:t}){const i=gn(Kg),s=Me(()=>n.route||i.value),r=gn(Ox,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]);gr(Ox,Me(()=>o.value+1)),gr(GV,a),gr(Kg,s);const l=et();return Xe(()=>[l.value,a.value,n.name],([c,u,f],[h,d,p])=>{u&&(u.instances[f]=c,d&&d!==u&&c&&c===h&&(u.leaveGuards.size||(u.leaveGuards=d.leaveGuards),u.updateGuards.size||(u.updateGuards=d.updateGuards))),c&&u&&(!d||!Ia(u,d)||!h)&&(u.enterCallbacks[f]||[]).forEach(_=>_(c))},{flush:"post"}),()=>{const c=s.value,u=n.name,f=a.value,h=f&&f.components[u];if(!h)return kx(t.default,{Component:h,route:c});const d=f.props[u],p=d?d===!0?c.params:typeof d=="function"?d(c):d:null,g=ks(h,Mt({},p,e,{onVnodeUnmounted:m=>{m.component.isUnmounted&&(f.instances[u]=null)},ref:l}));return kx(t.default,{Component:g,route:c})||g}}});function kx(n,e){if(!n)return null;const t=n(e);return t.length===1?t[0]:t}const jw=jV;function KV(n){const e=UV(n.routes,n),t=n.parseQuery||VV,i=n.stringifyQuery||Dx,s=n.history,r=ul(),o=ul(),a=ul(),l=Oe(ir);let c=ir;ia&&n.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const u=Mm.bind(null,q=>""+q),f=Mm.bind(null,lV),h=Mm.bind(null,xc);function d(q,ae){let le,ce;return Xw(q)?(le=e.getRecordMatcher(q),ce=ae):ce=q,e.addRoute(ce,le)}function p(q){const ae=e.getRecordMatcher(q);ae&&e.removeRoute(ae)}function _(){return e.getRoutes().map(q=>q.record)}function g(q){return!!e.getRecordMatcher(q)}function m(q,ae){if(ae=Mt({},ae||l.value),typeof q=="string"){const w=Sm(t,q,ae.path),$=e.resolve({path:w.path},ae),W=s.createHref(w.fullPath);return Mt(w,$,{params:h($.params),hash:xc(w.hash),redirectedFrom:void 0,href:W})}let le;if(q.path!=null)le=Mt({},q,{path:Sm(t,q.path,ae.path).path});else{const w=Mt({},q.params);for(const $ in w)w[$]==null&&delete w[$];le=Mt({},q,{params:f(w)}),ae.params=f(ae.params)}const ce=e.resolve(le,ae),He=q.hash||"";ce.params=u(h(ce.params));const U=fV(i,Mt({},q,{hash:rV(He),path:ce.path})),F=s.createHref(U);return Mt({fullPath:U,hash:He,query:i===Dx?HV(q.query):q.query||{}},ce,{redirectedFrom:void 0,href:F})}function v(q){return typeof q=="string"?Sm(t,q,l.value.path):Mt({},q)}function b(q,ae){if(c!==q)return La(8,{from:ae,to:q})}function y(q){return S(q)}function E(q){return y(Mt(v(q),{replace:!0}))}function T(q){const ae=q.matched[q.matched.length-1];if(ae&&ae.redirect){const{redirect:le}=ae;let ce=typeof le=="function"?le(q):le;return typeof ce=="string"&&(ce=ce.includes("?")||ce.includes("#")?ce=v(ce):{path:ce},ce.params={}),Mt({query:q.query,hash:q.hash,params:ce.path!=null?{}:q.params},ce)}}function S(q,ae){const le=c=m(q),ce=l.value,He=q.state,U=q.force,F=q.replace===!0,w=T(le);if(w)return S(Mt(v(w),{state:typeof w=="object"?Mt({},He,w.state):He,force:U,replace:F}),ae||le);const $=le;$.redirectedFrom=ae;let W;return!U&&hV(i,ce,le)&&(W=La(16,{to:$,from:ce}),se(ce,ce,!0,!1)),(W?Promise.resolve(W):M($,ce)).catch(X=>bs(X)?bs(X,2)?X:be(X):J(X,$,ce)).then(X=>{if(X){if(bs(X,2))return S(Mt({replace:F},v(X.to),{state:typeof X.to=="object"?Mt({},He,X.to.state):He,force:U}),ae||$)}else X=z($,ce,!0,F,He);return D($,ce,X),X})}function P(q,ae){const le=b(q,ae);return le?Promise.reject(le):Promise.resolve()}function x(q){const ae=re.values().next().value;return ae&&typeof ae.runWithContext=="function"?ae.runWithContext(q):q()}function M(q,ae){let le;const[ce,He,U]=ZV(q,ae);le=Em(ce.reverse(),"beforeRouteLeave",q,ae);for(const w of ce)w.leaveGuards.forEach($=>{le.push(fr($,q,ae))});const F=P.bind(null,q,ae);return le.push(F),xe(le).then(()=>{le=[];for(const w of r.list())le.push(fr(w,q,ae));return le.push(F),xe(le)}).then(()=>{le=Em(He,"beforeRouteUpdate",q,ae);for(const w of He)w.updateGuards.forEach($=>{le.push(fr($,q,ae))});return le.push(F),xe(le)}).then(()=>{le=[];for(const w of U)if(w.beforeEnter)if(Vi(w.beforeEnter))for(const $ of w.beforeEnter)le.push(fr($,q,ae));else le.push(fr(w.beforeEnter,q,ae));return le.push(F),xe(le)}).then(()=>(q.matched.forEach(w=>w.enterCallbacks={}),le=Em(U,"beforeRouteEnter",q,ae,x),le.push(F),xe(le))).then(()=>{le=[];for(const w of o.list())le.push(fr(w,q,ae));return le.push(F),xe(le)}).catch(w=>bs(w,8)?w:Promise.reject(w))}function D(q,ae,le){a.list().forEach(ce=>x(()=>ce(q,ae,le)))}function z(q,ae,le,ce,He){const U=b(q,ae);if(U)return U;const F=ae===ir,w=ia?history.state:{};le&&(ce||F?s.replace(q.fullPath,Mt({scroll:F&&w&&w.scroll},He)):s.push(q.fullPath,He)),l.value=q,se(q,ae,le,F),be()}let H;function G(){H||(H=s.listen((q,ae,le)=>{if(!ge.listening)return;const ce=m(q),He=T(ce);if(He){S(Mt(He,{replace:!0,force:!0}),ce).catch(Vl);return}c=ce;const U=l.value;ia&&bV(Ex(U.fullPath,le.delta),$d()),M(ce,U).catch(F=>bs(F,12)?F:bs(F,2)?(S(Mt(v(F.to),{force:!0}),ce).then(w=>{bs(w,20)&&!le.delta&&le.type===Mc.pop&&s.go(-1,!1)}).catch(Vl),Promise.reject()):(le.delta&&s.go(-le.delta,!1),J(F,ce,U))).then(F=>{F=F||z(ce,U,!1),F&&(le.delta&&!bs(F,8)?s.go(-le.delta,!1):le.type===Mc.pop&&bs(F,20)&&s.go(-1,!1)),D(ce,U,F)}).catch(Vl)}))}let ee=ul(),j=ul(),te;function J(q,ae,le){be(q);const ce=j.list();return ce.length?ce.forEach(He=>He(q,ae,le)):console.error(q),Promise.reject(q)}function de(){return te&&l.value!==ir?Promise.resolve():new Promise((q,ae)=>{ee.add([q,ae])})}function be(q){return te||(te=!q,G(),ee.list().forEach(([ae,le])=>q?le(q):ae()),ee.reset()),q}function se(q,ae,le,ce){const{scrollBehavior:He}=n;if(!ia||!He)return Promise.resolve();const U=!le&&xV(Ex(q.fullPath,0))||(ce||!le)&&history.state&&history.state.scroll||null;return Ar().then(()=>He(q,ae,U)).then(F=>F&&yV(F)).catch(F=>J(F,q,ae))}const ye=q=>s.go(q);let Be;const re=new Set,ge={currentRoute:l,listening:!0,addRoute:d,removeRoute:p,clearRoutes:e.clearRoutes,hasRoute:g,getRoutes:_,resolve:m,options:n,push:y,replace:E,go:ye,back:()=>ye(-1),forward:()=>ye(1),beforeEach:r.add,beforeResolve:o.add,afterEach:a.add,onError:j.add,isReady:de,install(q){const ae=this;q.component("RouterLink",$V),q.component("RouterView",jw),q.config.globalProperties.$router=ae,Object.defineProperty(q.config.globalProperties,"$route",{enumerable:!0,get:()=>Ot(l)}),ia&&!Be&&l.value===ir&&(Be=!0,y(s.location).catch(He=>{}));const le={};for(const He in ir)Object.defineProperty(le,He,{get:()=>l.value[He],enumerable:!0});q.provide(qd,ae),q.provide(X_,fS(le)),q.provide(Kg,l);const ce=q.unmount;re.add(q),q.unmount=function(){re.delete(q),re.size<1&&(c=ir,H&&H(),H=null,l.value=ir,Be=!1,te=!1),ce()}}};function xe(q){return q.reduce((ae,le)=>ae.then(()=>x(le)),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;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 JV(){return gn(qd)}function GG(n){return gn(X_)}const QV=[{path:"/",name:"/",component:()=>je(()=>import("./index-CqXdqLaZ.js"),__vite__mapDeps([14,4,5,6,7,8,11,12,13,15,16,17,10,9,18,19,20,21,22,23,24,25,1,2,26,27,28])),meta:{layout:"stage",stageTransition:{name:"bubble-wave-out"}}},{path:"/:all(.*)",name:"/[...all]",component:()=>je(()=>import("./_...all_--W64Thc1.js"),[])},{path:"/audio",name:"/audio",component:()=>je(()=>import("./audio-IvjOg0zY.js"),[])},{path:"/devtools",children:[{path:"background-remove",name:"/devtools/background-remove",component:()=>je(()=>import("./background-remove-7t1fuPR2.js"),__vite__mapDeps([29,11,12,13,30]))},{path:"chat",name:"/devtools/chat",component:()=>je(()=>import("./chat-Ch1uJ9j2.js"),__vite__mapDeps([31,20,10]))},{path:"image",name:"/devtools/image",component:()=>je(()=>import("./image-BC5zfrbv.js"),__vite__mapDeps([32,33]))},{path:"vibrant",name:"/devtools/vibrant",component:()=>je(()=>import("./vibrant-DwwXKvjx.js"),__vite__mapDeps([34,11,12,13,30,35]))}]},{path:"/queue",name:"/queue",component:()=>je(()=>import("./queue-BjPeTqlQ.js"),__vite__mapDeps([36,18]))},{path:"/settings",children:[{path:"",name:"/settings/",component:()=>je(()=>import("./index-BqxwSAta.js"),__vite__mapDeps([37,4,5,6,7,8,11,12,13,38,27])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"airi-card",children:[{path:"",name:"/settings/airi-card/",component:()=>je(()=>import("./index-3ucwneIT.js"),__vite__mapDeps([39,6,7,8,21,22,9,10,17,11,12,13,30,40,41,42,4,5,43,27])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"components",children:[{path:"CardDetailDialog",name:"/settings/airi-card/components/CardDetailDialog",component:()=>je(()=>import("./CardDetailDialog-BPmKPIdN.js"),__vite__mapDeps([44,40,41,42,12,4,5,6,7,8,21,22,9,10,17,11,13]))},{path:"CardListItem",name:"/settings/airi-card/components/CardListItem",component:()=>je(()=>import("./CardListItem-Bcn9cwvb.js"),__vite__mapDeps([45,43,4,5,6,7,8,11,12,13]))},{path:"DeleteCardDialog",name:"/settings/airi-card/components/DeleteCardDialog",component:()=>je(()=>import("./DeleteCardDialog-DLYqCKGU.js"),__vite__mapDeps([46,41,42,12]))}]}]},{path:"appearance",children:[{path:"",name:"/settings/appearance/",component:()=>je(()=>import("./index-CHXm7BsK.js"),__vite__mapDeps([47,4,5,6,7,8,11,12,13,48,25,23,42,27,49])),meta:{layout:"settings",stageTransition:{name:"slide",pageSpecificAvailable:!0}}}]},{path:"memory",children:[{path:"",name:"/settings/memory/",component:()=>je(()=>import("./index-DfgZBT6L.js"),__vite__mapDeps([50,27])),meta:{layout:"settings",stageTransition:{name:"slide"}}}]},{path:"models",children:[{path:"",name:"/settings/models/",component:()=>je(()=>import("./index-YGbSHw2g.js"),__vite__mapDeps([51,4,5,24,6,7,8,11,12,13,35,48,25,23,42,52,27,53])),meta:{layout:"settings",stageTransition:{name:"slide",pageSpecificAvailable:!0}}}]},{path:"modules",children:[{path:"",name:"/settings/modules/",component:()=>je(()=>import("./index-J0h9UsXc.js"),__vite__mapDeps([54,4,5,6,7,8,55,11,12,13,38,52,27])),meta:{layout:"settings",stageTransition:{name:"slide",pageSpecificAvailable:!0}}},{path:"consciousness",name:"/settings/modules/consciousness",component:()=>je(()=>import("./consciousness-D135g0Zv.js"),__vite__mapDeps([56,4,5,6,7,8,22,9,10,11,12,13,57,23,58,27])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"memory-long-term",name:"/settings/modules/memory-long-term",component:()=>je(()=>import("./memory-long-term-DdtSjryl.js"),__vite__mapDeps([59,27])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"memory-short-term",name:"/settings/modules/memory-short-term",component:()=>je(()=>import("./memory-short-term-CYEPVxPq.js"),__vite__mapDeps([60,27])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"speech",name:"/settings/modules/speech",component:()=>je(()=>import("./speech-B8WOC72M.js"),__vite__mapDeps([61,62,4,5,11,12,13,6,7,8,9,10,17,63,58,64,26,57,23,27])),meta:{layout:"settings",stageTransition:{name:"slide"}}}]},{path:"providers",children:[{path:"",name:"/settings/providers/",component:()=>je(()=>import("./index-BUz8WLVD.js"),__vite__mapDeps([65,4,5,6,7,8,9,10,55,11,12,13,52,27])),meta:{layout:"settings",stageTransition:{name:"slide",pageSpecificAvailable:!0}}},{path:"alibaba-cloud-model-studio",name:"/settings/providers/alibaba-cloud-model-studio",component:()=>je(()=>import("./alibaba-cloud-model-studio-10EiP3XX.js"),__vite__mapDeps([66,4,5,6,7,8,9,10,17,62,11,12,13,67,68,25,23,63,58,69,70,27])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"anthropic",name:"/settings/providers/anthropic",component:()=>je(()=>import("./anthropic-DSSAGod2.js"),__vite__mapDeps([71,4,5,6,7,8,9,10,11,12,13,68,25,23,63,58,69,70,72,27])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"cloudflare-workers-ai",name:"/settings/providers/cloudflare-workers-ai",component:()=>je(()=>import("./cloudflare-workers-ai-DG_-Hn68.js"),__vite__mapDeps([73,4,5,6,7,8,9,10,11,12,13,63,58,69,70,72,27])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"deepseek",name:"/settings/providers/deepseek",component:()=>je(()=>import("./deepseek-CLW0ElgW.js"),__vite__mapDeps([74,4,5,6,7,8,9,10,11,12,13,68,25,23,63,58,69,70,72,27])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"elevenlabs",name:"/settings/providers/elevenlabs",component:()=>je(()=>import("./elevenlabs-BCW3nqCx.js"),__vite__mapDeps([75,4,5,6,7,8,9,10,17,62,11,12,13,67,68,25,23,63,58,69,70,27])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"featherless-ai",name:"/settings/providers/featherless-ai",component:()=>je(()=>import("./featherless-ai-M-otpVYV.js"),__vite__mapDeps([76,4,5,6,7,8,9,10,11,12,13,68,25,23,63,58,69,70,72,27])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"fireworks-ai",name:"/settings/providers/fireworks-ai",component:()=>je(()=>import("./fireworks-ai-mT2y5pvw.js"),__vite__mapDeps([77,4,5,6,7,8,9,10,11,12,13,68,25,23,63,58,69,70,72,27])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"google-generative-ai",name:"/settings/providers/google-generative-ai",component:()=>je(()=>import("./google-generative-ai-CV9mFE5-.js"),__vite__mapDeps([78,4,5,6,7,8,9,10,11,12,13,68,25,23,63,58,69,70,72,27])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"microsoft-speech",name:"/settings/providers/microsoft-speech",component:()=>je(()=>import("./microsoft-speech-W8B1RmtI.js"),__vite__mapDeps([79,4,5,6,7,8,9,10,17,63,58,62,11,12,13,67,68,25,23,69,70,27])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"mistral-ai",name:"/settings/providers/mistral-ai",component:()=>je(()=>import("./mistral-ai-Du-J0Q1l.js"),__vite__mapDeps([80,4,5,6,7,8,9,10,11,12,13,68,25,23,63,58,69,70,72,27])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"moonshot-ai",name:"/settings/providers/moonshot-ai",component:()=>je(()=>import("./moonshot-ai-D9LhCXTR.js"),__vite__mapDeps([81,4,5,6,7,8,9,10,11,12,13,68,25,23,63,58,69,70,72,27])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"novita-ai",name:"/settings/providers/novita-ai",component:()=>je(()=>import("./novita-ai-D_6dOaRN.js"),__vite__mapDeps([82,4,5,6,7,8,9,10,11,12,13,68,25,23,63,58,69,70,72,27])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"ollama",name:"/settings/providers/ollama",component:()=>je(()=>import("./ollama-CJhkg7aY.js"),__vite__mapDeps([83,4,5,6,7,8,9,10,58,11,12,13,68,25,23,63,70,72,27])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"openai",name:"/settings/providers/openai",component:()=>je(()=>import("./openai-BwSo75Ba.js"),__vite__mapDeps([84,4,5,6,7,8,9,10,11,12,13,68,25,23,63,58,69,70,72,27])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"openrouter-ai",name:"/settings/providers/openrouter-ai",component:()=>je(()=>import("./openrouter-ai-DaZqHxnI.js"),__vite__mapDeps([85,4,5,6,7,8,9,10,11,12,13,68,25,23,63,58,69,70,72,27])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"together-ai",name:"/settings/providers/together-ai",component:()=>je(()=>import("./together-ai-dB0eRXqL.js"),__vite__mapDeps([86,4,5,6,7,8,9,10,11,12,13,68,25,23,63,58,69,70,72,27])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"volcengine",name:"/settings/providers/volcengine",component:()=>je(()=>import("./volcengine-C4ShKUYr.js"),__vite__mapDeps([87,4,5,6,7,8,9,10,17,63,58,62,11,12,13,67,68,25,23,69,70,27])),meta:{layout:"settings",stageTransition:{name:"slide"}}},{path:"xai",name:"/settings/providers/xai",component:()=>je(()=>import("./xai-BHu8lsjK.js"),__vite__mapDeps([88,4,5,6,7,8,9,10,11,12,13,68,25,23,63,58,69,70,72,27])),meta:{layout:"settings",stageTransition:{name:"slide"}}}]},{path:"scene",children:[{path:"",name:"/settings/scene/",component:()=>je(()=>import("./index-DvJoTzhu.js"),__vite__mapDeps([89,52,6,7,8,27])),meta:{layout:"settings",stageTransition:{name:"slide",pageSpecificAvailable:!0}}}]}]},{path:"/test",children:[{path:"filter-message",name:"/test/filter-message",component:()=>je(()=>import("./filter-message-C5yjB2Mx.js"),__vite__mapDeps([90,11,12,13,64,26]))},{path:"queues",children:[{path:"delays",name:"/test/queues/delays",component:()=>je(()=>import("./delays-DGxINOtn.js"),__vite__mapDeps([91,6,19,7,18,11,12,13,64,26]))},{path:"emotions",name:"/test/queues/emotions",component:()=>je(()=>import("./emotions-Cff7mf_x.js"),__vite__mapDeps([92,18,19,7,11,12,13,64,26]))},{path:"messages",name:"/test/queues/messages",component:()=>je(()=>import("./messages-CRABX2eS.js"),__vite__mapDeps([93,18,19,7,11,12,13,64,26]))}]}]}],Kw=(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}}},e6={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},t6=n=>Kw(e6[n.toLowerCase()],6),n6=/^#?([0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{4}|[0-9a-f]{3})$/i,i6=n=>{let e;return(e=n.match(n6))?Kw(parseInt(e[1],16),e[1].length):void 0},_r="([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)",Gl=`${_r}%`,$_=`(?:${_r}%|${_r})`,s6=`(?:${_r}(deg|grad|rad|turn)|${_r})`,Da="\\s*,\\s*",r6=new RegExp(`^rgba?\\(\\s*${_r}${Da}${_r}${Da}${_r}\\s*(?:,\\s*${$_}\\s*)?\\)$`),o6=new RegExp(`^rgba?\\(\\s*${Gl}${Da}${Gl}${Da}${Gl}\\s*(?:,\\s*${$_}\\s*)?\\)$`),a6=n=>{let e={mode:"rgb"},t;if(t=n.match(r6))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(o6))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},l6=(n,e)=>n===void 0?void 0:typeof n!="object"?v6(n):n.mode!==void 0?n:e?{...n,mode:e}:void 0,Zw=(n="rgb")=>e=>(e=l6(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={},Oh=[],Qw={},c6=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=c6)}),Jw[n.mode]=n,(n.parse||[]).forEach(e=>{f6(e,n.mode)}),Zw(n.mode)),u6=n=>Jw[n],f6=(n,e)=>{if(typeof n=="string"){if(!e)throw new Error("'mode' required when 'parser' is a string");Qw[n]=e}else typeof n=="function"&&Oh.indexOf(n)<0&&Oh.push(n)},Zg=/[^\x00-\x7F]|[a-zA-Z_]/,h6=/[^\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 Jg(n){if($e>=n.length)return!1;let e=n[$e];if(Zg.test(e))return!0;if(e==="-"){if(n.length-$e<2)return!1;let t=n[$e+1];return!!(t==="-"||Zg.test(t))}return!1}const d6={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))),Jg(n)){let t=Nh(n);return t==="deg"||t==="rad"||t==="turn"||t==="grad"?{type:_e.Hue,value:e*d6[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 Nh(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 _6(n,e){n._i=0;let t=n[n._i++];if(!t||t.type!==_e.Function)return;let i=eA(n,e);if(i)return i.unshift(t.value),i}const v6=n=>{if(typeof n!="string")return;const e=m6(n),t=e?_6(e,!0):void 0;let i,s=0,r=Oh.length;for(;sn==="transparent"?{mode:"rgb",r:0,g:0,b:0,alpha:0}:void 0,x6=(n,e,t)=>n+t*(e-n),M6=n=>{let e=[];for(let t=0;te=>{let t=M6(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=S6(x6),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:[y6,i6,a6,t6,b6,"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}},Tm=(n=0)=>Math.pow(Math.abs(n),563/256)*Math.sign(n),Bx=n=>{let e=Tm(n.r),t=Tm(n.g),i=Tm(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},wm=n=>Math.pow(Math.abs(n),256/563)*Math.sign(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:"a98",r:wm(n*2.0415879038107465-e*.5650069742788597-.3447313507783297*t),g:wm(n*-.9692436362808798+e*1.8759675015077206+.0415550574071756*t),b:wm(n*.0134442806320312-e*.1183623922310184+1.0151749943912058*t)};return i!==void 0&&(s.alpha=i),s},Am=(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:Am(n),g:Am(e),b:Am(t)};return i!==void 0&&(s.alpha=i),s},Lo=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},Cm=(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:Cm(n),g:Cm(e),b:Cm(t)};return i!==void 0&&(r.alpha=i),r},Do=({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},E6={...Wa,mode:"a98",parse:["a98-rgb"],serialize:"a98-rgb",fromMode:{rgb:n=>zx(Lo(n)),xyz65:zx},toMode:{rgb:n=>Do(Bx(n)),xyz65:Bx}},bn=n=>(n=n%360)<0?n+360:n,T6=(n,e)=>n.map((t,i,s)=>{if(t===void 0)return t;let r=bn(t);return i===0||n[i-1]===void 0?r:e(r-bn(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),[]),qs=n=>T6(n,e=>Math.abs(e)<=180?e:e-360*Math.sign(e)),ln=[-.14861,1.78277,-.29227,-.90649,1.97294,0],w6=Math.PI/180,A6=180/Math.PI;let Vx=ln[3]*ln[4],Hx=ln[1]*ln[4],Gx=ln[1]*ln[2]-ln[0]*ln[3];const C6=({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=(Gx*t+n*Vx-e*Hx)/(Gx+Vx-Hx),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)*A6-120),i!==void 0&&(a.alpha=i),a},R6=({h:n,s:e,l:t,alpha:i})=>{let s={mode:"rgb"};n=(n===void 0?0:n+120)*w6,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},Yd=(n,e)=>{if(n.h===void 0||e.h===void 0||!n.s||!e.s)return 0;let t=bn(n.h),i=bn(e.h),s=Math.sin((i-t+360)/2*Math.PI/180);return 2*Math.sqrt(n.s*e.s)*s},P6=(n,e)=>{if(n.h===void 0||e.h===void 0)return 0;let t=bn(n.h),i=bn(e.h);return Math.abs(i-t)>180?t-(i-360*Math.sign(i-t)):i-t},jd=(n,e)=>{if(n.h===void 0||e.h===void 0||!n.c||!e.c)return 0;let t=bn(n.h),i=bn(e.h),s=Math.sin((i-t+360)/2*Math.PI/180);return 2*Math.sqrt(n.c*e.c)*s},Ys=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},I6={mode:"cubehelix",channels:["h","s","l","alpha"],parse:["--cubehelix"],serialize:"--cubehelix",ranges:{h:[0,360],s:[0,4.614],l:[0,1]},fromMode:{rgb:C6},toMode:{rgb:R6},interpolate:{h:{use:we,fixup:qs},s:we,l:we,alpha:{use:we,fixup:on}},difference:{h:Yd},average:{h:Ys}},Tr=({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=bn(Math.atan2(t,e)*180/Math.PI)),i!==void 0&&(o.alpha=i),o},wr=({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},tA=Math.pow(29,3)/Math.pow(3,3),nA=Math.pow(6,3)/Math.pow(29,3),Qt={X:.3457/.3585,Y:1,Z:(1-.3457-.3585)/.3585},_a={X:.3127/.329,Y:1,Z:(1-.3127-.329)/.329};let Rm=n=>Math.pow(n,3)>nA?Math.pow(n,3):(116*n-16)/tA;const iA=({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:Rm(r)*_a.X,y:Rm(s)*_a.Y,z:Rm(o)*_a.Z};return i!==void 0&&(a.alpha=i),a},Kd=n=>Do(iA(n)),Pm=n=>n>nA?Math.cbrt(n):(tA*n+16)/116,sA=({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=Pm(n/_a.X),r=Pm(e/_a.Y),o=Pm(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},Zd=n=>{let e=sA(Lo(n));return n.r===n.b&&n.b===n.g&&(e.a=e.b=0),e},Uh=1,rA=1,Sc=26/180*Math.PI,Fh=Math.cos(Sc),kh=Math.sin(Sc),oA=100/Math.log(139/100),Qg=({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*Uh/oA)-1)/.0039},r=(Math.exp(.0435*e*rA*Uh)-1)/.075,o=r*Math.cos(t/180*Math.PI-Sc),a=r*Math.sin(t/180*Math.PI-Sc);return s.a=o*Fh-a/.83*kh,s.b=o*kh+a/.83*Fh,i!==void 0&&(s.alpha=i),s},e0=({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*Fh+t*kh,r=.83*(t*Fh-e*kh),o=Math.sqrt(s*s+r*r),a={mode:"dlch",l:oA/Uh*Math.log(1+.0039*n),c:Math.log(1+.075*o)/(.0435*rA*Uh)};return a.c&&(a.h=bn((Math.atan2(r,s)+Sc)/Math.PI*180)),i!==void 0&&(a.alpha=i),a},Wx=n=>Qg(Tr(n,"dlch")),Xx=n=>wr(e0(n),"dlab"),L6={mode:"dlab",parse:["--din99o-lab"],serialize:"--din99o-lab",toMode:{lab65:Wx,rgb:n=>Kd(Wx(n))},fromMode:{lab65:Xx,rgb:n=>Xx(Zd(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}}},D6={mode:"dlch",parse:["--din99o-lch"],serialize:"--din99o-lch",toMode:{lab65:Qg,dlab:n=>wr(n,"dlab"),rgb:n=>Kd(Qg(n))},fromMode:{lab65:e0,dlab:n=>Tr(n,"dlch"),rgb:n=>e0(Zd(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:qs},alpha:{use:we,fixup:on}},difference:{h:jd},average:{h:Ys}};function O6({h:n,s:e,i:t,alpha:i}){n=bn(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 N6({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}},z6=new RegExp(`^hsla?\\(\\s*${s6}${Da}${Gl}${Da}${Gl}\\s*(?:,\\s*${$_}\\s*)?\\)$`),V6=n=>{let e=n.match(z6);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=B6(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 H6(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 aA={mode:"hsl",toMode:{rgb:F6},fromMode:{rgb:k6},channels:["h","s","l","alpha"],ranges:{h:[0,360]},gamut:"rgb",parse:[H6,V6],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:qs},s:we,l:we,alpha:{use:we,fixup:on}},difference:{h:Yd},average:{h:Ys}};function lA({h:n,s:e,v:t,alpha:i}){n=bn(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 cA({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 lA({h:n,s:t===1?1:1-e/(1-t),v:1-t,alpha:i})}function W6(n){let e=cA(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 X6(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 $6={mode:"hwb",toMode:{rgb:G6},fromMode:{rgb:W6},channels:["h","w","b","alpha"],ranges:{h:[0,360]},gamut:"rgb",parse:[X6],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:qs},w:we,b:we,alpha:{use:we,fixup:on}},difference:{h:P6},average:{h:Ys}},fA=203,Jd=.1593017578125,hA=78.84375,Qd=.8359375,ep=18.8515625,tp=18.6875;function Im(n){if(n<0)return 0;const e=Math.pow(n,1/hA);return 1e4*Math.pow(Math.max(0,e-Qd)/(ep-tp*e),1/Jd)}function Lm(n){if(n<0)return 0;const e=Math.pow(n/1e4,Jd);return Math.pow((Qd+ep*e)/(1+tp*e),hA)}const Dm=n=>Math.max(n/fA,0),$x=({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=Im(n+.008609037037932761*e+.11102962500302593*t),r=Im(n-.00860903703793275*e-.11102962500302599*t),o=Im(n+.5600313357106791*e-.32062717498731885*t),a={mode:"xyz65",x:Dm(2.070152218389422*s-1.3263473389671556*r+.2066510476294051*o),y:Dm(.3647385209748074*s+.680566024947227*r-.0453045459220346*o),z:Dm(-.049747207535812*s-.0492609666966138*r+1.1880659249923042*o)};return i!==void 0&&(a.alpha=i),a},Om=(n=0)=>Math.max(n*fA,0),qx=({x:n,y:e,z:t,alpha:i})=>{const s=Om(n),r=Om(e),o=Om(t),a=Lm(.3592832590121217*s+.6976051147779502*r-.0358915932320289*o),l=Lm(-.1920808463704995*s+1.1004767970374323*r+.0753748658519118*o),c=Lm(.0070797844607477*s+.0748396662186366*r+.8433265453898765*o),u=.5*a+.5*l,f=1.61376953125*a-3.323486328125*l+1.709716796875*c,h=4.378173828125*a-4.24560546875*l-.132568359375*c,d={mode:"itp",i:u,t:f,p:h};return i!==void 0&&(d.alpha=i),d},q6={mode:"itp",channels:["i","t","p","alpha"],parse:["--ictcp"],serialize:"--ictcp",toMode:{xyz65:$x,rgb:n=>Do($x(n))},fromMode:{xyz65:qx,rgb:n=>qx(Lo(n))},ranges:{i:[0,.581],t:[-.369,.272],p:[-.164,.331]},interpolate:{i:we,t:we,p:we,alpha:{use:we,fixup:on}}},Y6=134.03437499999998,j6=16295499532821565e-27,Nm=n=>{if(n<0)return 0;let e=Math.pow(n/1e4,Jd);return Math.pow((Qd+ep*e)/(1+tp*e),Y6)},Um=(n=0)=>Math.max(n*203,0),dA=({x:n,y:e,z:t,alpha:i})=>{n=Um(n),e=Um(e),t=Um(t);let s=1.15*n-.15*t,r=.66*e+.34*n,o=Nm(.41478972*s+.579999*r+.014648*t),a=Nm(-.20151*s+1.120649*r+.0531008*t),l=Nm(-.0166008*s+.2648*r+.6684799*t),c=(o+a)/2,u={mode:"jab",j:.44*c/(1-.56*c)-j6,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},K6=134.03437499999998,Yx=16295499532821565e-27,Fm=n=>{if(n<0)return 0;let e=Math.pow(n,1/K6);return 1e4*Math.pow((Qd-e)/(tp*e-ep),1/Jd)},km=n=>n/203,pA=({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+Yx)/(.44+.56*(n+Yx)),r=Fm(s+.13860504*e+.058047316*t),o=Fm(s-.13860504*e-.058047316*t),a=Fm(s-.096019242*e-.8118919*t),l={mode:"xyz65",x:km(1.661373024652174*r-.914523081304348*o+.23136208173913045*a),y:km(-.3250758611844533*r+1.571847026732543*o-.21825383453227928*a),z:km(-.090982811*r-.31272829*o+1.5227666*a)};return i!==void 0&&(l.alpha=i),l},mA=n=>{let e=dA(Lo(n));return n.r===n.b&&n.b===n.g&&(e.a=e.b=0),e},gA=n=>Do(pA(n)),Z6={mode:"jab",channels:["j","a","b","alpha"],parse:["--jzazbz"],serialize:"--jzazbz",fromMode:{rgb:mA,xyz65:dA},toMode:{rgb:gA,xyz65:pA},ranges:{j:[0,.222],a:[-.109,.129],b:[-.185,.134]},interpolate:{j:we,a:we,b:we,alpha:{use:we,fixup:on}}},jx=({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=bn(Math.atan2(t,e)*180/Math.PI)),i!==void 0&&(r.alpha=i),r},Kx=({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},J6={mode:"jch",parse:["--jzczhz"],serialize:"--jzczhz",toMode:{jab:Kx,rgb:n=>gA(Kx(n))},fromMode:{rgb:n=>jx(mA(n)),jab:jx},channels:["j","c","h","alpha"],ranges:{j:[0,.221],c:[0,.19],h:[0,360]},interpolate:{h:{use:we,fixup:qs},c:we,j:we,alpha:{use:we,fixup:on}},difference:{h:jd},average:{h:Ys}},np=Math.pow(29,3)/Math.pow(3,3),q_=Math.pow(6,3)/Math.pow(29,3);let Bm=n=>Math.pow(n,3)>q_?Math.pow(n,3):(116*n-16)/np;const Y_=({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:Bm(r)*Qt.X,y:Bm(s)*Qt.Y,z:Bm(o)*Qt.Z};return i!==void 0&&(a.alpha=i),a},Jc=({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},_A=n=>Jc(Y_(n)),Qc=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},zm=n=>n>q_?Math.cbrt(n):(np*n+16)/116,j_=({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=zm(n/Qt.X),r=zm(e/Qt.Y),o=zm(t/Qt.Z),a={mode:"lab",l:116*r-16,a:500*(s-r),b:200*(r-o)};return i!==void 0&&(a.alpha=i),a},vA=n=>{let e=j_(Qc(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 K_={mode:"lab",toMode:{xyz50:Y_,rgb:_A},fromMode:{xyz50:j_,rgb:vA},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}}},eH={...K_,mode:"lab65",parse:["--lab-d65"],serialize:"--lab-d65",toMode:{xyz65:iA,rgb:Kd},fromMode:{xyz65:sA,rgb:Zd},ranges:{l:[0,100],a:[-86.182,98.234],b:[-107.86,94.477]}};function tH(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 Z_={mode:"lch",toMode:{lab:wr,rgb:n=>_A(wr(n))},fromMode:{rgb:n=>Tr(vA(n)),lab:Tr},channels:["l","c","h","alpha"],ranges:{l:[0,100],c:[0,150],h:[0,360]},parse:[tH],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:qs},c:we,l:we,alpha:{use:we,fixup:on}},difference:{h:jd},average:{h:Ys}},nH={...Z_,mode:"lch65",parse:["--lch-d65"],serialize:"--lch-d65",toMode:{lab65:n=>wr(n,"lab65"),rgb:n=>Kd(wr(n,"lab65"))},fromMode:{rgb:n=>Tr(Zd(n),"lch65"),lab65:n=>Tr(n,"lch65")},ranges:{l:[0,100],c:[0,133.807],h:[0,360]}},yA=({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=bn(Math.atan2(t,e)*180/Math.PI)),i!==void 0&&(r.alpha=i),r},bA=({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},xA=(n,e,t)=>4*n/(n+15*e+3*t),MA=(n,e,t)=>9*e/(n+15*e+3*t),iH=xA(Qt.X,Qt.Y,Qt.Z),sH=MA(Qt.X,Qt.Y,Qt.Z),rH=n=>n<=q_?np*n:116*Math.cbrt(n)-16,t0=({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=rH(e/Qt.Y),r=xA(n,e,t),o=MA(n,e,t);!isFinite(r)||!isFinite(o)?s=r=o=0:(r=13*s*(r-iH),o=13*s*(o-sH));let a={mode:"luv",l:s,u:r,v:o};return i!==void 0&&(a.alpha=i),a},oH=(n,e,t)=>4*n/(n+15*e+3*t),aH=(n,e,t)=>9*e/(n+15*e+3*t),lH=oH(Qt.X,Qt.Y,Qt.Z),cH=aH(Qt.X,Qt.Y,Qt.Z),n0=({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)+lH,r=t/(13*n)+cH,o=Qt.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},uH=n=>yA(t0(Qc(n))),fH=n=>Jc(n0(bA(n))),hH={mode:"lchuv",toMode:{luv:bA,rgb:fH},fromMode:{rgb:uH,luv:yA},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:qs},c:we,l:we,alpha:{use:we,fixup:on}},difference:{h:jd},average:{h:Ys}},dH={...Wa,mode:"lrgb",toMode:{rgb:$a},fromMode:{rgb:Xa},parse:["srgb-linear"],serialize:"srgb-linear"},pH={mode:"luv",toMode:{xyz50:n0,rgb:n=>Jc(n0(n))},fromMode:{xyz50:t0,rgb:n=>t0(Qc(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}}},SA=({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=SA(Xa(n));return n.r===n.b&&n.b===n.g&&(e.a=e.b=0),e},eu=({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(eu(n));function i0(n){const i=1.170873786407767;return .5*(i*n-.206+Math.sqrt((i*n-.206)*(i*n-.206)+4*.03*i*n))}function Bh(n){return(n*n+.206*n)/(1.170873786407767*(n+.03))}function mH(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,h=-.1055613458*n-.0638541728*e,d=-.0894841775*n-1.291485548*e;{let p=1+u*f,_=1+u*h,g=1+u*d,m=p*p*p,v=_*_*_,b=g*g*g,y=3*f*p*p,E=3*h*_*_,T=3*d*g*g,S=6*f*f*p,P=6*h*h*_,x=6*d*d*g,M=a*m+l*v+c*b,D=a*y+l*E+c*T,z=a*S+l*P+c*x;u=u-M*D/(D*D-.5*M*z)}return u}function J_(n,e){let t=mH(n,e),i=eu({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 gH(n,e,t,i,s,r=null){r||(r=J_(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,h=a+l*c,d=a+l*u,p=a+l*f;{let _=s*(1-o)+o*t,g=o*i,m=_+g*c,v=_+g*u,b=_+g*f,y=m*m*m,E=v*v*v,T=b*b*b,S=3*h*m*m,P=3*d*v*v,x=3*p*b*b,M=6*h*h*m,D=6*d*d*v,z=6*p*p*b,H=4.0767416621*y-3.3077115913*E+.2309699292*T-1,G=4.0767416621*S-3.3077115913*P+.2309699292*x,ee=4.0767416621*M-3.3077115913*D+.2309699292*z,j=G/(G*G-.5*H*ee),te=-H*j,J=-1.2684380046*y+2.6097574011*E-.3413193965*T-1,de=-1.2684380046*S+2.6097574011*P-.3413193965*x,be=-1.2684380046*M+2.6097574011*D-.3413193965*z,se=de/(de*de-.5*J*be),ye=-J*se,Be=-.0041960863*y-.7034186147*E+1.707614701*T-1,re=-.0041960863*S-.7034186147*P+1.707614701*x,ge=-.0041960863*M-.7034186147*D+1.707614701*z,xe=re/(re*re-.5*Be*ge),q=-Be*xe;te=j>=0?te:1e6,ye=se>=0?ye:1e6,q=xe>=0?q:1e6,o+=Math.min(te,Math.min(ye,q))}}}return o}function Q_(n,e,t=null){t||(t=J_(n,e));let i=t[0],s=t[1];return[s/i,s/(1-i)]}function EA(n,e,t){let i=J_(e,t),s=gH(e,t,n,1,n,i),r=Q_(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 Zx(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:i0(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]=EA(e,t/r,i/r),c;if(rZx(ip(n))},toMode:{oklab:Jx,rgb:n=>sp(Jx(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]=Q_(r,o),c=.5,u=1-c/a,f=l/(s+e*l),h=f*e,d=f*s,p=Bh(h),_=d*p/h,g=eu({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*i0(e)/e,e=i0(e);const v={mode:"okhsv",s:s?(c+l)*d/(l*c+l*u*d):0,v:e?e/h:0};return v.s&&(v.h=bn(Math.atan2(i,t)*180/Math.PI)),n.alpha!==void 0&&(v.alpha=n.alpha),v}function eM(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]=Q_(r,o),c=.5,u=1-c/a,f=1-i*c/(c+l-l*u*i),h=i*l*c/(c+l-l*u*i),d=Bh(f),p=h*d/f,_=eu({l:d,a:r*p,b:o*p}),g=Math.cbrt(1/Math.max(_.r,_.g,_.b,0)),m=Bh(s*f),v=h*m/f;return e.l=m*g,e.a=v*r*g,e.b=v*o*g,e}const vH={...uA,mode:"okhsv",channels:["h","s","v","alpha"],parse:["--okhsv"],serialize:"--okhsv",fromMode:{oklab:Qx,rgb:n=>Qx(ip(n))},toMode:{oklab:eM,rgb:n=>sp(eM(n))}};function yH(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 bH={...K_,mode:"oklab",toMode:{lrgb:eu,rgb:sp},fromMode:{lrgb:SA,rgb:ip},ranges:{l:[0,1],a:[-.4,.4],b:[-.4,.4]},parse:[yH],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 xH(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 MH={...Z_,mode:"oklch",toMode:{oklab:n=>wr(n,"oklab"),rgb:n=>sp(wr(n,"oklab"))},fromMode:{rgb:n=>Tr(ip(n),"oklch"),oklab:n=>Tr(n,"oklch")},parse:[xH],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]}},tM=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},nM=({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},SH={...Wa,mode:"p3",parse:["display-p3"],serialize:"display-p3",fromMode:{rgb:n=>nM(Lo(n)),xyz65:nM},toMode:{rgb:n=>Do(tM(n)),xyz65:tM}},Vm=n=>{let e=Math.abs(n);return e>=1/512?Math.sign(n)*Math.pow(e,1/1.8):16*n},iM=({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:Vm(n*1.3457868816471585-e*.2555720873797946-.0511018649755453*t),g:Vm(n*-.5446307051249019+e*1.5082477428451466+.0205274474364214*t),b:Vm(n*0+e*0+1.2119675456389452*t)};return i!==void 0&&(s.alpha=i),s},Hm=(n=0)=>{let e=Math.abs(n);return e>=16/512?Math.sign(n)*Math.pow(e,1.8):n/16},sM=n=>{let e=Hm(n.r),t=Hm(n.g),i=Hm(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},EH={...Wa,mode:"prophoto",parse:["prophoto-rgb"],serialize:"prophoto-rgb",fromMode:{xyz50:iM,rgb:n=>iM(Qc(n))},toMode:{xyz50:sM,rgb:n=>Jc(sM(n))}},rM=1.09929682680944,TH=.018053968510807,Gm=n=>{const e=Math.abs(n);return e>TH?(Math.sign(n)||1)*(rM*Math.pow(e,.45)-(rM-1)):4.5*n},oM=({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:Gm(n*1.7166511879712683-e*.3556707837763925-.2533662813736599*t),g:Gm(n*-.6666843518324893+e*1.6164812366349395+.0157685458139111*t),b:Gm(n*.0176398574453108-e*.0427706132578085+.9421031212354739*t)};return i!==void 0&&(s.alpha=i),s},aM=1.09929682680944,wH=.018053968510807,Wm=(n=0)=>{let e=Math.abs(n);return e{let e=Wm(n.r),t=Wm(n.g),i=Wm(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},AH={...Wa,mode:"rec2020",fromMode:{xyz65:oM,rgb:n=>oM(Lo(n))},toMode:{xyz65:lM,rgb:n=>Do(lM(n))},parse:["rec2020"],serialize:"rec2020"},yo=.0037930732552754493,TA=Math.cbrt(yo),Xm=n=>Math.cbrt(n)-TA,CH=n=>{const{r:e,g:t,b:i,alpha:s}=Xa(n),r=Xm(.3*e+.622*t+.078*i+yo),o=Xm(.23*e+.692*t+.078*i+yo),a=Xm(.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},$m=n=>Math.pow(n+TA,3),RH=({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=$m(n+e)-yo,r=$m(e-n)-yo,o=$m(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},PH={mode:"xyb",channels:["x","y","b","alpha"],parse:["--xyb"],serialize:"--xyb",toMode:{rgb:RH},fromMode:{rgb:CH},ranges:{x:[-.0154,.0281],y:[0,.8453],b:[-.2778,.388]},interpolate:{x:we,y:we,b:we,alpha:{use:we,fixup:on}}},IH={mode:"xyz50",parse:["xyz-d50"],serialize:"xyz-d50",toMode:{rgb:Jc,lab:j_},fromMode:{rgb:Qc,lab:Y_},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}}},LH=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},DH=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},OH={mode:"xyz65",toMode:{rgb:Do,xyz50:LH},fromMode:{rgb:Lo,xyz50:DH},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}}},NH=({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},UH=({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},FH={mode:"yiq",toMode:{rgb:UH},fromMode:{rgb:NH},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(E6);Et(I6);Et(L6);Et(D6);Et(U6);Et(aA);Et(uA);Et($6);Et(q6);Et(Z6);Et(J6);Et(K_);Et(eH);Et(Z_);Et(nH);Et(hH);Et(dH);Et(pH);Et(_H);Et(vH);Et(bH);Et(MH);Et(SH);Et(EH);Et(AH);Et(Wa);Et(PH);Et(IH);Et(OH);Et(FH);const s0=220.44,kH=Zw("oklch"),cM=n=>{var e;return n?(e=kH(n))==null?void 0:e.h:s0},BH=$z("settings",()=>{const n=et(),e=ys("settings/language","en-US"),t=ys("settings/stage/view/model-renderer","2d"),i=ys("settings/audio/input","false"),s=Me(()=>{var T;return(T=n.value)==null?void 0:T.deviceId}),{audioInputs:r,ensurePermissions:o}=KB({constraints:{audio:!0}}),a=et(),l=et("/assets/live2d/models/hiyori_pro_zh.zip"),c=et("url"),u=et(!1),f=ys("settings/live2d/position",{x:0,y:0}),h=et({group:"Idle",index:0}),d=et([]),p=ys("settings/live2d/motion-map",{}),_=ys("settings/disable-transitions",!0),g=ys("settings/use-page-specific-transitions",!0),m=ys("settings/theme/colors/hue",s0),v=ys("settings/theme/colors/hue-dynamic",!1);function b(T=s0){m.value=T,v.value=!1}function y(T){b(cM(T))}function E(T){if(v.value)return!1;const S=cM(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:h,live2dPosition:f,availableLive2dMotions:d,live2dMotionMap:p,loadingLive2dModel:u,disableTransitions:_,usePageSpecificTransitions:g,language:e,stageView:t,themeColorsHue:m,themeColorsHueDynamic:v,isAudioInputOn:i,selectedAudioDevice:n,selectedAudioDeviceId:s,setThemeColorsHue:b,applyPrimaryColorFrom:y,isColorSelectedForPrimary:E}}),zH=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)=>(_n(),yi("div",{class:"stage-transition-3",style:Si({zIndex:t.value.zIndex||100})},null,4))}}),Oo=(n,e)=>{const t=n.__vccOpts||n;for(const[i,s]of e)t[i]=s;return t},VH=Oo(zH,[["__scopeId","data-v-df576df0"]]),HH=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 _n(),yi("div",{class:"circle-expansion-transition",style:Si({zIndex:((r=n.stageTransition)==null?void 0:r.zIndex)||100})},[(_n(!0),yi(Kt,null,m2(t.value,(o,a)=>(_n(),yi("div",{key:a}))),128))],4)}}}),GH=Oo(HH,[["__scopeId","data-v-0c29056c"]]),WH=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,h;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",`${((h=(f=e.stageTransition)==null?void 0:f.borderRadius)==null?void 0:h.lg)||"50%"}`)}),(s,r)=>{var o;return _n(),yi("div",{class:Ua(["fantasy-fall-transition",i.value]),style:Si({zIndex:((o=n.stageTransition)==null?void 0:o.zIndex)??100})},null,6)}}}),XH=Oo(WH,[["__scopeId","data-v-e62bf496"]]),$H=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 _n(),yi("div",{class:"stage-transition-4",style:Si({zIndex:((a=t.value)==null?void 0:a.zIndex)??100})},o[0]||(o[0]=[Y2('
',5)]),4)}}}),qH=Oo($H,[["__scopeId","data-v-6d1179fc"]]),YH=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 _n(),yi("div",{class:"stage-transition-1",style:Si({zIndex:((a=t.value)==null?void 0:a.zIndex)??100})},null,4)}}}),jH=Oo(YH,[["__scopeId","data-v-bf1d1566"]]),KH=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 _n(),yi("div",{class:"stage-transition-2",style:Si({zIndex:((a=t.value)==null?void 0:a.zIndex)??100})},null,4)}}}),ZH=Oo(KH,[["__scopeId","data-v-8ff7120f"]]),JH=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 _n(),yi("div",{class:"rectangle-rotate-transition",style:Si({zIndex:((s=n.stageTransition)==null?void 0:s.zIndex)??100})},i[0]||(i[0]=[lr("div",{class:"rectangle rectangle-rotate-1"},[lr("div")],-1),lr("div",{class:"rectangle rectangle-rotate-2"},[lr("div")],-1),lr("div",{class:"rectangle rectangle-rotate-3"},[lr("div")],-1)]),4)}}}),QH=Oo(JH,[["__scopeId","data-v-f4b1dc64"]]),e8=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=JV(),i=et(!1),s=et(),r=et(""),o=et(),a=Oe({slide:{component:jH,duration:2700},"slope-slide":{component:ZH,duration:2700},arrow:{component:VH,duration:2700},"multiple-blocks-reveal":{component:qH,duration:2800},"fantasy-fall":{component:XH,duration:2700},"rectangles-rotate":{component:QH,duration:2700},"bubble-wave-out":{component:GH,duration:1e3}}),l=et([]);function c(d){return l.value.push(d),()=>{const p=l.value.indexOf(d);p>=0&&l.value.splice(p,1)}}async function u(d,p={}){s.value=d;for(const _ of l.value)try{await Promise.resolve(_(d,p))}catch(g){console.error(`Error in transition hook at stage "${d}":`,g)}}async function f(d,p,_){if(d.name==="none"||!d.name){p(),_();return}const g=a.value[d.name];if(!g){console.error(`Transition ${d.name} not found`),p(),_();return}const m=g.nextDelay!==void 0?g.nextDelay:g.duration/3;let v=!1;const y=c(E=>{E==="navigation"&&!v&&(v=!0,p())});try{await u("before-enter",{transitionName:d.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=d.name,o.value=d,i.value=!0,await u("enter-active",{transitionName:name}),setTimeout(async()=>{await u("navigation",{transitionName:d.name,config:g}),v||(v=!0,p())},m),setTimeout(async()=>{await u("after-enter",{transitionName:d.name})},g.duration),setTimeout(async()=>{await u("before-leave",{transitionName:d.name})},g.duration+10),setTimeout(async()=>{await u("leave-active",{transitionName:d.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:d.name}),_()},g.duration+E)}catch(E){console.error(E)}finally{y(),setTimeout(()=>{v||(v=!0,p())},g.duration*2)}}function h(d,p){return new Promise(_=>{f(d,p,_)})}return t.beforeEach((d,p,_)=>{if(e.disableTransitions){_();return}if(typeof d.meta.stageTransition!="object"){_();return}const g=d.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),h(g,_)}),(d,p)=>(_n(),yi(Kt,null,[g2(d.$slots,"default"),i.value?(_n(),yi(Kt,{key:0},[a.value[r.value]?(_n(),Kl(p2(a.value[r.value].component),{key:0,"stage-transition":o.value},null,8,["stage-transition"])):Ov("",!0)],64)):Ov("",!0)],64))}});/*! @@ -3903,4 +3903,4 @@ And the last, do what ever you want! - <|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:"消息"}},"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:"等待中"}}}}}),nG=W9({locale:iG(),fallbackLocale:"en",messages:ZA});function iG(){const n=localStorage.getItem("settings/language"),e=Object.keys(ZA);return n&&e.includes(n)?n:"en"}const sG=zz(),rG=Yz(QV);let tu;tu=KV({routes:rG,history:wV()});tu.beforeEach((n,e)=>{n.path!==e.path&&Lw.start()});tu.afterEach(()=>{Lw.done()});tu.isReady().then(async()=>{}).catch(()=>{});kR(tG).use(Nz).use(s3).use(tu).use(sG).use(nG).use(TB).mount("#app");export{lp as $,mw as A,h5 as B,Ih as C,K4 as D,j4 as E,X4 as F,G4 as G,W4 as H,B_ as I,hw as J,H4 as K,fw as L,V4 as M,uw as N,k_ as O,cw as P,UB as Q,jw as R,Qn as S,Hn as T,rs as U,JV as V,Ov as W,Ua as X,xC as Y,GG as Z,Ar as _,lr as a,Md as a$,qz as a0,kG as a1,pG as a2,Si as a3,$z as a4,ut as a5,LG as a6,zG as a7,OG as a8,g2 as a9,Eo as aA,zi as aB,Vn as aC,aE as aD,jn as aE,li as aF,qe as aG,Cn as aH,gt as aI,ML as aJ,yn as aK,e_ as aL,Va as aM,L0 as aN,_G as aO,Pt as aP,wG as aQ,Pc as aR,Ii as aS,qh as aT,x0 as aU,Oc as aV,qt as aW,Co as aX,os as aY,ka as aZ,ts as a_,IG as aa,BH as ab,Kl as ac,R0 as ad,fG as ae,PR as af,r3 as ag,o3 as ah,mS as ai,wT as aj,Oe as ak,CG as al,as as am,B as an,yL as ao,Jn as ap,Fd as aq,he as ar,Zt as as,Ba as at,ur as au,mt as av,Eh as aw,Ae as ax,ot as ay,yd as az,mn as b,IT as b$,Wt as b0,zn as b1,Ct as b2,oc as b3,vd as b4,Xs as b5,ns as b6,vn as b7,gi as b8,IE as b9,dt as bA,VI as bB,qI as bC,r_ as bD,Pn as bE,Gn as bF,h_ as bG,dE as bH,ls as bI,Sr as bJ,gE as bK,_E as bL,la as bM,bd as bN,_c as bO,s_ as bP,gc as bQ,mc as bR,$c as bS,ft as bT,Bs as bU,Xc as bV,hL as bW,EB as bX,Uz as bY,Oo as bZ,$V as b_,fg as ba,xL as bb,S_ as bc,Tf as bd,G0 as be,oa as bf,tn as bg,El as bh,Qi as bi,sc as bj,rc as bk,FL as bl,p3 as bm,g3 as bn,m3 as bo,ti as bp,xg as bq,Hs as br,LE as bs,So as bt,Fn as bu,$E as bv,qE as bw,YE as bx,pE as by,Ca as bz,yi as c,SG as c$,Ng as c0,gS as c1,Ga as c2,BG as c3,UG as c4,mG as c5,Kt as c6,m2 as c7,KB as c8,IR as c9,ks as cA,gG as cB,p2 as cC,An as cD,yr as cE,Fi as cF,dG as cG,b0 as cH,DS as cI,vG as cJ,bG as cK,A0 as cL,gr as cM,VG as cN,je as cO,st as cP,vc as cQ,Cr as cR,Te as cS,D3 as cT,vL as cU,UL as cV,lG as cW,cG as cX,TG as cY,uG as cZ,HG as c_,jB as ca,ys as cb,ty as cc,DG as cd,yG as ce,xG as cf,q2 as cg,j2 as ch,RG as ci,EG as cj,MG as ck,LR as cl,NG as cm,FG as cn,Zw as co,I_ as cp,PG as cq,s0 as cr,hS as cs,aG as ct,$2 as cu,hG as cv,Rn as cw,mf as cx,ai as cy,gn as cz,fn as d,Di as d0,dn as d1,AG as d2,et as e,Me as f,JB as g,Ft as h,Ph as i,Zc as j,kl as k,Gg as l,cx as m,Kc as n,_n as o,lt as p,eo as q,xi as r,lf as s,qn as t,Ot as u,r5 as v,Xe as w,pw as x,XT as y,kg as z}; +`}}},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:"消息"}},"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:"等待中"}}}}}),nG=W9({locale:iG(),fallbackLocale:"en",messages:ZA});function iG(){const n=localStorage.getItem("settings/language"),e=Object.keys(ZA);return n&&e.includes(n)?n:"en"}const sG=zz(),rG=Yz(QV);let tu;tu=KV({routes:rG,history:wV()});tu.beforeEach((n,e)=>{n.path!==e.path&&Lw.start()});tu.afterEach(()=>{Lw.done()});tu.isReady().then(async()=>{}).catch(()=>{});kR(tG).use(Nz).use(s3).use(tu).use(sG).use(nG).use(TB).mount("#app");export{lp as $,mw as A,h5 as B,Ih as C,K4 as D,j4 as E,X4 as F,G4 as G,W4 as H,B_ as I,hw as J,H4 as K,fw as L,V4 as M,uw as N,k_ as O,cw as P,UB as Q,jw as R,Qn as S,Hn as T,rs as U,JV as V,Ov as W,Ua as X,xC as Y,GG as Z,Ar as _,lr as a,s_ as a$,qz as a0,kG as a1,pG as a2,Si as a3,$z as a4,Uz as a5,IT as a6,Ng as a7,gS as a8,Ga as a9,El as aA,G0 as aB,tn as aC,vn as aD,sc as aE,rc as aF,gi as aG,r_ as aH,Pn as aI,Gn as aJ,h_ as aK,Ii as aL,Xs as aM,mt as aN,ot as aO,dE as aP,qt as aQ,ls as aR,Sr as aS,gE as aT,_E as aU,la as aV,Zt as aW,e_ as aX,Fd as aY,bd as aZ,_c as a_,p3 as aa,g3 as ab,m3 as ac,ti as ad,xg as ae,Hs as af,LE as ag,he as ah,Ae as ai,So as aj,Fn as ak,$E as al,qE as am,YE as an,qe as ao,B as ap,pE as aq,Jn as ar,Ca as as,dt as at,VI as au,qI as av,Ct as aw,yd as ax,Qi as ay,oa as az,mn as b,FL as b$,oc as b0,Eh as b1,Eo as b2,Wt as b3,gc as b4,mc as b5,$c as b6,ft as b7,Bs as b8,Xc as b9,aE as bA,jn as bB,li as bC,gt as bD,ML as bE,Va as bF,L0 as bG,_G as bH,Pt as bI,wG as bJ,Pc as bK,qh as bL,x0 as bM,Oc as bN,Co as bO,os as bP,ka as bQ,ts as bR,Md as bS,zn as bT,vd as bU,ns as bV,IE as bW,fg as bX,xL as bY,S_ as bZ,Tf as b_,Cn as ba,yn as bb,BG as bc,ut as bd,LG as be,zG as bf,OG as bg,g2 as bh,IG as bi,BH as bj,Kl as bk,R0 as bl,fG as bm,PR as bn,r3 as bo,o3 as bp,mS as bq,wT as br,Oe as bs,CG as bt,as as bu,yL as bv,Ba as bw,ur as bx,zi as by,Vn as bz,yi as c,SG as c$,hL as c0,EB as c1,Oo as c2,$V as c3,UG as c4,mG as c5,Kt as c6,m2 as c7,KB as c8,IR as c9,ks as cA,gG as cB,p2 as cC,An as cD,yr as cE,Fi as cF,dG as cG,b0 as cH,DS as cI,vG as cJ,bG as cK,A0 as cL,gr as cM,VG as cN,je as cO,HG as cP,st as cQ,vc as cR,Cr as cS,Te as cT,D3 as cU,vL as cV,UL as cW,lG as cX,cG as cY,TG as cZ,uG as c_,jB as ca,ys as cb,ty as cc,DG as cd,yG as ce,xG as cf,q2 as cg,j2 as ch,RG as ci,EG as cj,MG as ck,LR as cl,NG as cm,FG as cn,Zw as co,I_ as cp,PG as cq,s0 as cr,hS as cs,aG as ct,$2 as cu,hG as cv,Rn as cw,mf as cx,ai as cy,gn as cz,fn as d,Di as d0,dn as d1,AG as d2,et as e,Me as f,JB as g,Ft as h,Ph as i,Zc as j,kl as k,Gg as l,cx as m,Kc as n,_n as o,lt as p,eo as q,xi as r,lf as s,qn as t,Ot as u,r5 as v,Xe as w,pw as x,XT as y,kg as z}; diff --git a/assets/index-B3D27Cgx.js b/assets/index-B3D27Cgx.js deleted file mode 100644 index 6679e873c2e5909664d73e1337c78c9641cb0c6f..0000000000000000000000000000000000000000 --- a/assets/index-B3D27Cgx.js +++ /dev/null @@ -1 +0,0 @@ -import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-BQHOFrhO.js";import{d as g,a0 as v,a2 as k,c5 as I,c as i,o as t,a as c,ac as s,ae as l,c6 as m,c7 as b,u as e}from"./index-CNH1g_GM.js";import"./three-vrm-animation.module-B_hGdUpX.js";import"./mcp-B7-jaCfZ.js";import"./emotions-DWNSb738.js";import{u as h}from"./providers-DP46_3AG.js";import{I as z}from"./IconStatusItem-Co6qJ9yZ.js";import"./Select.vue_vue_type_style_index_0_lang-BIffysKh.js";import{u as A}from"./useIconAnimation-Df247suB.js";import{b as d}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./floating-ui.core-CgBsuaUc.js";const B={grid:"~ cols-2 gap-4"},S={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":""},w=g({__name:"index",setup(C){const u=h(),{allProvidersMetadata:p}=v(u),{iconAnimationStarted:f,showIconAnimation:y,animationIcon:_}=A("i-solar:box-minimalistic-bold-duotone");return(D,n)=>{const x=k("IconAnimation"),a=I("motion");return t(),i(m,null,[c("div",B,[(t(!0),i(m,null,b(e(p),(o,r)=>l((t(),s(e(z),{key:o.id,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+r*10,delay:r*50,title:o.localizedName,description:o.localizedDescription,icon:o.icon,"icon-color":o.iconColor,"icon-image":o.iconImage,to:`/settings/providers/${o.id}`,configured:o.configured},null,8,["duration","delay","title","description","icon","icon-color","icon-image","to","configured"])),[[a]])),128))]),e(y)?(t(),s(x,{key:0,"z-index":-1,icon:e(_),"icon-size":12,duration:1e3,started:e(f),"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"])):l((t(),i("div",S,n[0]||(n[0]=[c("div",{text:"60","i-solar:box-minimalistic-bold-duotone":""},null,-1)]))),[[a]])],64)}}});typeof d=="function"&&d(w);export{w as default}; diff --git a/assets/index-BUz8WLVD.js b/assets/index-BUz8WLVD.js new file mode 100644 index 0000000000000000000000000000000000000000..1cf401816d7c98d15bfecf91945fbb5b1ef88533 --- /dev/null +++ b/assets/index-BUz8WLVD.js @@ -0,0 +1 @@ +import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-Du5e5QRV.js";import{d as g,a0 as k,a2 as v,c5 as b,c as i,o as t,a as c,bk as s,bm as l,c6 as m,c7 as I,u as e}from"./index-B06xwjXa.js";import"./three-vrm.module-CtuEk7GG.js";import"./emotions-DWNSb738.js";import"./mcp-BfXpaYZf.js";import{u as h}from"./providers-BCv4E6z9.js";import{I as z}from"./IconStatusItem-CntkxYB2.js";import"./Select.vue_vue_type_style_index_0_lang-CzS20kE7.js";import{u as A}from"./useIconAnimation-BxWVl-bV.js";import{b as d}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./floating-ui.core-CgBsuaUc.js";const B={grid:"~ cols-2 gap-4"},S={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":""},w=g({__name:"index",setup(C){const u=h(),{allProvidersMetadata:p}=k(u),{iconAnimationStarted:f,showIconAnimation:y,animationIcon:_}=A("i-solar:box-minimalistic-bold-duotone");return(D,n)=>{const x=v("IconAnimation"),a=b("motion");return t(),i(m,null,[c("div",B,[(t(!0),i(m,null,I(e(p),(o,r)=>l((t(),s(e(z),{key:o.id,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+r*10,delay:r*50,title:o.localizedName,description:o.localizedDescription,icon:o.icon,"icon-color":o.iconColor,"icon-image":o.iconImage,to:`/settings/providers/${o.id}`,configured:o.configured},null,8,["duration","delay","title","description","icon","icon-color","icon-image","to","configured"])),[[a]])),128))]),e(y)?(t(),s(x,{key:0,"z-index":-1,icon:e(_),"icon-size":12,duration:1e3,started:e(f),"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"])):l((t(),i("div",S,n[0]||(n[0]=[c("div",{text:"60","i-solar:box-minimalistic-bold-duotone":""},null,-1)]))),[[a]])],64)}}});typeof d=="function"&&d(w);export{w as default}; diff --git a/assets/index-5YeHuuyL.js b/assets/index-BVgMpW27.js similarity index 89% rename from assets/index-5YeHuuyL.js rename to assets/index-BVgMpW27.js index 2835b11bd4abe3675183fc80c6a6924401a33356..1a275c82c8e91f07f0bd16299ce68e7fab4f08a8 100644 --- a/assets/index-5YeHuuyL.js +++ b/assets/index-BVgMpW27.js @@ -1,3 +1,3 @@ -import{f as w,e as C,ak as ht,w as F,aT as mt,aU as yt,cs as ie,u as f,d as O,ac as D,o as _,ad as x,a9 as E,ct as G,cu as J,ch as P,cj as ke,_ as ne,T as fe,ai as Ue,W as gt,b as ee,cv as Qt,cw as oe,cx as Zt,cy as wt,cz as en,cA as Be,cB as tn,cC as nn,c1 as on,U as bt,c6 as rn,cD as xt,cE as ln,cF as Ct,cG as lt,aR as M,aN as an,cg as sn,Y as un,c as Ot,a3 as Ye,cH as Et,cI as dn,r as _t,cJ as cn,cK as fn,a as pn,cL as vn,cM as hn}from"./index-CNH1g_GM.js";import{o as mn,f as yn,s as gn,a as wn,h as bn,l as xn,c as Cn,b as j,r as Dt,d as On,e as Ae,m as ue,g as We,i as Oe}from"./floating-ui.core-CgBsuaUc.js";function Pe(){return typeof window<"u"}function re(e){return Xe(e)?(e.nodeName||"").toLowerCase():"#document"}function S(e){var n;return(e==null||(n=e.ownerDocument)==null?void 0:n.defaultView)||window}function K(e){var n;return(n=(Xe(e)?e.ownerDocument:e.document)||window.document)==null?void 0:n.documentElement}function Xe(e){return Pe()?e instanceof Node||e instanceof S(e).Node:!1}function I(e){return Pe()?e instanceof Element||e instanceof S(e).Element:!1}function V(e){return Pe()?e instanceof HTMLElement||e instanceof S(e).HTMLElement:!1}function it(e){return!Pe()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof S(e).ShadowRoot}function ve(e){const{overflow:n,overflowX:t,overflowY:o,display:r}=k(e);return/auto|scroll|overlay|hidden|clip/.test(n+o+t)&&!["inline","contents"].includes(r)}function En(e){return["table","td","th"].includes(re(e))}function $e(e){return[":popover-open",":modal"].some(n=>{try{return e.matches(n)}catch{return!1}})}function qe(e){const n=Ge(),t=I(e)?k(e):e;return["transform","translate","scale","rotate","perspective"].some(o=>t[o]?t[o]!=="none":!1)||(t.containerType?t.containerType!=="normal":!1)||!n&&(t.backdropFilter?t.backdropFilter!=="none":!1)||!n&&(t.filter?t.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(o=>(t.willChange||"").includes(o))||["paint","layout","strict","content"].some(o=>(t.contain||"").includes(o))}function _n(e){let n=q(e);for(;V(n)&&!ce(n);){if(qe(n))return n;if($e(n))return null;n=q(n)}return null}function Ge(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function ce(e){return["html","body","#document"].includes(re(e))}function k(e){return S(e).getComputedStyle(e)}function Re(e){return I(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function q(e){if(re(e)==="html")return e;const n=e.assignedSlot||e.parentNode||it(e)&&e.host||K(e);return it(n)?n.host:n}function Bt(e){const n=q(e);return ce(n)?e.ownerDocument?e.ownerDocument.body:e.body:V(n)&&ve(n)?n:Bt(n)}function pe(e,n,t){var o;n===void 0&&(n=[]),t===void 0&&(t=!0);const r=Bt(e),i=r===((o=e.ownerDocument)==null?void 0:o.body),l=S(r);if(i){const a=He(l);return n.concat(l,l.visualViewport||[],ve(r)?r:[],a&&t?pe(a):[])}return n.concat(r,pe(r,[],t))}function He(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function At(e){const n=k(e);let t=parseFloat(n.width)||0,o=parseFloat(n.height)||0;const r=V(e),i=r?e.offsetWidth:t,l=r?e.offsetHeight:o,a=Ae(t)!==i||Ae(o)!==l;return a&&(t=i,o=l),{width:t,height:o,$:a}}function Je(e){return I(e)?e:e.contextElement}function de(e){const n=Je(e);if(!V(n))return j(1);const t=n.getBoundingClientRect(),{width:o,height:r,$:i}=At(n);let l=(i?Ae(t.width):t.width)/o,a=(i?Ae(t.height):t.height)/r;return(!l||!Number.isFinite(l))&&(l=1),(!a||!Number.isFinite(a))&&(a=1),{x:l,y:a}}const Dn=j(0);function Tt(e){const n=S(e);return!Ge()||!n.visualViewport?Dn:{x:n.visualViewport.offsetLeft,y:n.visualViewport.offsetTop}}function Bn(e,n,t){return n===void 0&&(n=!1),!t||n&&t!==S(e)?!1:n}function te(e,n,t,o){n===void 0&&(n=!1),t===void 0&&(t=!1);const r=e.getBoundingClientRect(),i=Je(e);let l=j(1);n&&(o?I(o)&&(l=de(o)):l=de(e));const a=Bn(i,t,o)?Tt(i):j(0);let c=(r.left+a.x)/l.x,d=(r.top+a.y)/l.y,s=r.width/l.x,u=r.height/l.y;if(i){const p=S(i),v=o&&I(o)?S(o):o;let h=p,g=He(h);for(;g&&o&&v!==h;){const m=de(g),y=g.getBoundingClientRect(),B=k(g),b=y.left+(g.clientLeft+parseFloat(B.paddingLeft))*m.x,$=y.top+(g.clientTop+parseFloat(B.paddingTop))*m.y;c*=m.x,d*=m.y,s*=m.x,u*=m.y,c+=b,d+=$,h=S(g),g=He(h)}}return Dt({width:s,height:u,x:c,y:d})}function Qe(e,n){const t=Re(e).scrollLeft;return n?n.left+t:te(K(e)).left+t}function Pt(e,n,t){t===void 0&&(t=!1);const o=e.getBoundingClientRect(),r=o.left+n.scrollLeft-(t?0:Qe(e,o)),i=o.top+n.scrollTop;return{x:r,y:i}}function An(e){let{elements:n,rect:t,offsetParent:o,strategy:r}=e;const i=r==="fixed",l=K(o),a=n?$e(n.floating):!1;if(o===l||a&&i)return t;let c={scrollLeft:0,scrollTop:0},d=j(1);const s=j(0),u=V(o);if((u||!u&&!i)&&((re(o)!=="body"||ve(l))&&(c=Re(o)),V(o))){const v=te(o);d=de(o),s.x=v.x+o.clientLeft,s.y=v.y+o.clientTop}const p=l&&!u&&!i?Pt(l,c,!0):j(0);return{width:t.width*d.x,height:t.height*d.y,x:t.x*d.x-c.scrollLeft*d.x+s.x+p.x,y:t.y*d.y-c.scrollTop*d.y+s.y+p.y}}function Tn(e){return Array.from(e.getClientRects())}function Pn(e){const n=K(e),t=Re(e),o=e.ownerDocument.body,r=ue(n.scrollWidth,n.clientWidth,o.scrollWidth,o.clientWidth),i=ue(n.scrollHeight,n.clientHeight,o.scrollHeight,o.clientHeight);let l=-t.scrollLeft+Qe(e);const a=-t.scrollTop;return k(o).direction==="rtl"&&(l+=ue(n.clientWidth,o.clientWidth)-r),{width:r,height:i,x:l,y:a}}function $n(e,n){const t=S(e),o=K(e),r=t.visualViewport;let i=o.clientWidth,l=o.clientHeight,a=0,c=0;if(r){i=r.width,l=r.height;const d=Ge();(!d||d&&n==="fixed")&&(a=r.offsetLeft,c=r.offsetTop)}return{width:i,height:l,x:a,y:c}}function Rn(e,n){const t=te(e,!0,n==="fixed"),o=t.top+e.clientTop,r=t.left+e.clientLeft,i=V(e)?de(e):j(1),l=e.clientWidth*i.x,a=e.clientHeight*i.y,c=r*i.x,d=o*i.y;return{width:l,height:a,x:c,y:d}}function at(e,n,t){let o;if(n==="viewport")o=$n(e,t);else if(n==="document")o=Pn(K(e));else if(I(n))o=Rn(n,t);else{const r=Tt(e);o={x:n.x-r.x,y:n.y-r.y,width:n.width,height:n.height}}return Dt(o)}function $t(e,n){const t=q(e);return t===n||!I(t)||ce(t)?!1:k(t).position==="fixed"||$t(t,n)}function Nn(e,n){const t=n.get(e);if(t)return t;let o=pe(e,[],!1).filter(a=>I(a)&&re(a)!=="body"),r=null;const i=k(e).position==="fixed";let l=i?q(e):e;for(;I(l)&&!ce(l);){const a=k(l),c=qe(l);!c&&a.position==="fixed"&&(r=null),(i?!c&&!r:!c&&a.position==="static"&&!!r&&["absolute","fixed"].includes(r.position)||ve(l)&&!c&&$t(e,l))?o=o.filter(s=>s!==l):r=a,l=q(l)}return n.set(e,o),o}function Sn(e){let{element:n,boundary:t,rootBoundary:o,strategy:r}=e;const l=[...t==="clippingAncestors"?$e(n)?[]:Nn(n,this._c):[].concat(t),o],a=l[0],c=l.reduce((d,s)=>{const u=at(n,s,r);return d.top=ue(u.top,d.top),d.right=We(u.right,d.right),d.bottom=We(u.bottom,d.bottom),d.left=ue(u.left,d.left),d},at(n,a,r));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function Fn(e){const{width:n,height:t}=At(e);return{width:n,height:t}}function Ln(e,n,t){const o=V(n),r=K(n),i=t==="fixed",l=te(e,!0,i,n);let a={scrollLeft:0,scrollTop:0};const c=j(0);if(o||!o&&!i)if((re(n)!=="body"||ve(r))&&(a=Re(n)),o){const p=te(n,!0,i,n);c.x=p.x+n.clientLeft,c.y=p.y+n.clientTop}else r&&(c.x=Qe(r));const d=r&&!o&&!i?Pt(r,a):j(0),s=l.left+a.scrollLeft-c.x-d.x,u=l.top+a.scrollTop-c.y-d.y;return{x:s,y:u,width:l.width,height:l.height}}function Se(e){return k(e).position==="static"}function st(e,n){if(!V(e)||k(e).position==="fixed")return null;if(n)return n(e);let t=e.offsetParent;return K(e)===t&&(t=t.ownerDocument.body),t}function Rt(e,n){const t=S(e);if($e(e))return t;if(!V(e)){let r=q(e);for(;r&&!ce(r);){if(I(r)&&!Se(r))return r;r=q(r)}return t}let o=st(e,n);for(;o&&En(o)&&Se(o);)o=st(o,n);return o&&ce(o)&&Se(o)&&!qe(o)?t:o||_n(e)||t}const Mn=async function(e){const n=this.getOffsetParent||Rt,t=this.getDimensions,o=await t(e.floating);return{reference:Ln(e.reference,await n(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function In(e){return k(e).direction==="rtl"}const kn={convertOffsetParentRelativeRectToViewportRelativeRect:An,getDocumentElement:K,getClippingRect:Sn,getOffsetParent:Rt,getElementRects:Mn,getClientRects:Tn,getDimensions:Fn,getScale:de,isElement:I,isRTL:In};function Nt(e,n){return e.x===n.x&&e.y===n.y&&e.width===n.width&&e.height===n.height}function Wn(e,n){let t=null,o;const r=K(e);function i(){var a;clearTimeout(o),(a=t)==null||a.disconnect(),t=null}function l(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),i();const d=e.getBoundingClientRect(),{left:s,top:u,width:p,height:v}=d;if(a||n(),!p||!v)return;const h=Oe(u),g=Oe(r.clientWidth-(s+p)),m=Oe(r.clientHeight-(u+v)),y=Oe(s),b={rootMargin:-h+"px "+-g+"px "+-m+"px "+-y+"px",threshold:ue(0,We(1,c))||1};let $=!0;function R(L){const T=L[0].intersectionRatio;if(T!==c){if(!$)return l();T?l(!1,T):o=setTimeout(()=>{l(!1,1e-7)},1e3)}T===1&&!Nt(d,e.getBoundingClientRect())&&l(),$=!1}try{t=new IntersectionObserver(R,{...b,root:r.ownerDocument})}catch{t=new IntersectionObserver(R,b)}t.observe(e)}return l(!0),i}function Hn(e,n,t,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=o,d=Je(e),s=r||i?[...d?pe(d):[],...pe(n)]:[];s.forEach(y=>{r&&y.addEventListener("scroll",t,{passive:!0}),i&&y.addEventListener("resize",t)});const u=d&&a?Wn(d,t):null;let p=-1,v=null;l&&(v=new ResizeObserver(y=>{let[B]=y;B&&B.target===d&&v&&(v.unobserve(n),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var b;(b=v)==null||b.observe(n)})),t()}),d&&!c&&v.observe(d),v.observe(n));let h,g=c?te(e):null;c&&m();function m(){const y=te(e);g&&!Nt(g,y)&&t(),g=y,h=requestAnimationFrame(m)}return t(),()=>{var y;s.forEach(B=>{r&&B.removeEventListener("scroll",t),i&&B.removeEventListener("resize",t)}),u==null||u(),(y=v)==null||y.disconnect(),v=null,c&&cancelAnimationFrame(h)}}const jn=mn,Vn=gn,ut=yn,Kn=wn,zn=bn,Un=On,Yn=xn,Xn=(e,n,t)=>{const o=new Map,r={platform:kn,...t},i={...r.platform,_c:o};return Cn(e,n,{...r,platform:i})};function qn(e){return e!=null&&typeof e=="object"&&"$el"in e}function je(e){if(qn(e)){const n=e.$el;return Xe(n)&&re(n)==="#comment"?null:n}return e}function se(e){return typeof e=="function"?e():f(e)}function Gn(e){return{name:"arrow",options:e,fn(n){const t=je(se(e.element));return t==null?{}:Un({element:t,padding:e.padding}).fn(n)}}}function St(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function dt(e,n){const t=St(e);return Math.round(n*t)/t}function Jn(e,n,t){t===void 0&&(t={});const o=t.whileElementsMounted,r=w(()=>{var T;return(T=se(t.open))!=null?T:!0}),i=w(()=>se(t.middleware)),l=w(()=>{var T;return(T=se(t.placement))!=null?T:"bottom"}),a=w(()=>{var T;return(T=se(t.strategy))!=null?T:"absolute"}),c=w(()=>{var T;return(T=se(t.transform))!=null?T:!0}),d=w(()=>je(e.value)),s=w(()=>je(n.value)),u=C(0),p=C(0),v=C(a.value),h=C(l.value),g=ht({}),m=C(!1),y=w(()=>{const T={position:v.value,left:"0",top:"0"};if(!s.value)return T;const H=dt(s.value,u.value),ge=dt(s.value,p.value);return c.value?{...T,transform:"translate("+H+"px, "+ge+"px)",...St(s.value)>=1.5&&{willChange:"transform"}}:{position:v.value,left:H+"px",top:ge+"px"}});let B;function b(){if(d.value==null||s.value==null)return;const T=r.value;Xn(d.value,s.value,{middleware:i.value,placement:l.value,strategy:a.value}).then(H=>{u.value=H.x,p.value=H.y,v.value=H.strategy,h.value=H.placement,g.value=H.middlewareData,m.value=T!==!1})}function $(){typeof B=="function"&&(B(),B=void 0)}function R(){if($(),o===void 0){b();return}if(d.value!=null&&s.value!=null){B=o(d.value,s.value,b);return}}function L(){r.value||(m.value=!1)}return F([i,l,a,r],b,{flush:"sync"}),F([d,s],R,{flush:"sync"}),F(r,L,{flush:"sync"}),mt()&&yt($),{x:ie(u),y:ie(p),strategy:ie(v),placement:ie(h),middlewareData:ie(g),isPositioned:ie(m),floatingStyles:y,update:b}}function le(e,n){const t=typeof e=="string"&&!n?`${e}Context`:n,o=Symbol(t);return[r=>{const i=en(o,r);if(i||i===null)return i;throw new Error(`Injection \`${o.toString()}\` not found. Component must be used within ${Array.isArray(e)?`one of the following components: ${e.join(", ")}`:`\`${e}\``}`)},r=>(hn(o,r),r)]}function Ft(e,n,t){const o=t.originalEvent.target,r=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:t});n&&o.addEventListener(e,n,{once:!0}),o.dispatchEvent(r)}function Qn(e,n){var t;const o=ht();return M(()=>{o.value=e()},{...n,flush:(t=void 0)!=null?t:"sync"}),Ct(o)}function he(e){return mt()?(yt(e),!0):!1}function Zn(){const e=new Set,n=t=>{e.delete(t)};return{on:t=>{e.add(t);const o=()=>n(t);return he(o),{off:o}},off:n,trigger:(...t)=>Promise.all(Array.from(e).map(o=>o(...t)))}}function eo(e){let n=!1,t;const o=Et(!0);return(...r)=>(n||(t=o.run(()=>e(...r)),n=!0),t)}function to(e){let n=0,t,o;const r=()=>{n-=1,o&&n<=0&&(o.stop(),t=void 0,o=void 0)};return(...i)=>(n+=1,t||(o=Et(!0),t=o.run(()=>e(...i))),he(r),t)}function Z(e){return typeof e=="function"?e():f(e)}const Q=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const no=e=>typeof e<"u",oo=Object.prototype.toString,ro=e=>oo.call(e)==="[object Object]",lo=()=>{},ct=io();function io(){var e,n;return Q&&((e=window==null?void 0:window.navigator)==null?void 0:e.userAgent)&&(/iP(?:ad|hone|od)/.test(window.navigator.userAgent)||((n=window==null?void 0:window.navigator)==null?void 0:n.maxTouchPoints)>2&&/iPad|Macintosh/.test(window==null?void 0:window.navigator.userAgent))}function ao(e){return oe()}function so(e,n=1e4){return vn((t,o)=>{let r=Z(e),i;const l=()=>setTimeout(()=>{r=Z(e),o()},Z(n));return he(()=>{clearTimeout(i)}),{get(){return t(),r},set(a){r=a,o(),clearTimeout(i),i=l()}}})}function uo(e,n){ao()&&dn(e,n)}function Lt(e,n,t={}){const{immediate:o=!0}=t,r=C(!1);let i=null;function l(){i&&(clearTimeout(i),i=null)}function a(){r.value=!1,l()}function c(...d){l(),r.value=!0,i=setTimeout(()=>{r.value=!1,i=null,e(...d)},Z(n))}return o&&(r.value=!0,Q&&c()),he(a),{isPending:Ct(r),start:c,stop:a}}function me(e){var n;const t=Z(e);return(n=t==null?void 0:t.$el)!=null?n:t}const Ze=Q?window:void 0;function Te(...e){let n,t,o,r;if(typeof e[0]=="string"||Array.isArray(e[0])?([t,o,r]=e,n=Ze):[n,t,o,r]=e,!n)return lo;Array.isArray(t)||(t=[t]),Array.isArray(o)||(o=[o]);const i=[],l=()=>{i.forEach(s=>s()),i.length=0},a=(s,u,p,v)=>(s.addEventListener(u,p,v),()=>s.removeEventListener(u,p,v)),c=F(()=>[me(n),Z(r)],([s,u])=>{if(l(),!s)return;const p=ro(u)?{...u}:u;i.push(...t.flatMap(v=>o.map(h=>a(s,v,h,p))))},{immediate:!0,flush:"post"}),d=()=>{c(),l()};return he(d),d}function co(e){return typeof e=="function"?e:typeof e=="string"?n=>n.key===e:Array.isArray(e)?n=>e.includes(n.key):()=>!0}function fo(...e){let n,t,o={};e.length===3?(n=e[0],t=e[1],o=e[2]):e.length===2?typeof e[1]=="object"?(n=!0,t=e[0],o=e[1]):(n=e[0],t=e[1]):(n=!0,t=e[0]);const{target:r=Ze,eventName:i="keydown",passive:l=!1,dedupe:a=!1}=o,c=co(n);return Te(r,i,d=>{d.repeat&&Z(a)||c(d)&&t(d)},l)}function po(){const e=C(!1),n=oe();return n&&fe(()=>{e.value=!0},n),e}function vo(e){return JSON.parse(JSON.stringify(e))}function Mt(e,n,t,o={}){var r,i,l;const{clone:a=!1,passive:c=!1,eventName:d,deep:s=!1,defaultValue:u,shouldEmit:p}=o,v=oe(),h=t||(v==null?void 0:v.emit)||((r=v==null?void 0:v.$emit)==null?void 0:r.bind(v))||((l=(i=v==null?void 0:v.proxy)==null?void 0:i.$emit)==null?void 0:l.bind(v==null?void 0:v.proxy));let g=d;g=g||`update:${n.toString()}`;const m=b=>a?typeof a=="function"?a(b):vo(b):b,y=()=>no(e[n])?m(e[n]):u,B=b=>{p?p(b)&&h(g,b):h(g,b)};if(c){const b=y(),$=C(b);let R=!1;return F(()=>e[n],L=>{R||(R=!0,$.value=m(L),ne(()=>R=!1))}),F($,L=>{!R&&(L!==e[n]||s)&&B(L)},{deep:s}),$}else return w({get(){return y()},set(b){B(b)}})}function et(e){return e?e.flatMap(n=>n.type===rn?et(n.children):[n]):[]}function X(){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 Fe(e){if(e===null||typeof e!="object")return!1;const n=Object.getPrototypeOf(e);return n!==null&&n!==Object.prototype&&Object.getPrototypeOf(n)!==null||Symbol.iterator in e?!1:Symbol.toStringTag in e?Object.prototype.toString.call(e)==="[object Module]":!0}function Ve(e,n,t=".",o){if(!Fe(n))return Ve(e,{},t);const r=Object.assign({},n);for(const i in e){if(i==="__proto__"||i==="constructor")continue;const l=e[i];l!=null&&(Array.isArray(l)&&Array.isArray(r[i])?r[i]=[...l,...r[i]]:Fe(l)&&Fe(r[i])?r[i]=Ve(l,r[i],(t?`${t}.`:"")+i.toString()):r[i]=l)}return r}function ho(e){return(...n)=>n.reduce((t,o)=>Ve(t,o,""),{})}const mo=ho(),[It,Tr]=le("ConfigProvider");let yo="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",go=(e=21)=>{let n="",t=e;for(;t--;)n+=yo[Math.random()*64|0];return n};const wo=to(()=>{const e=C(new Map),n=C(),t=w(()=>{for(const l of e.value.values())if(l)return!0;return!1}),o=It({scrollBody:C(!0)});let r=null;const i=()=>{document.body.style.paddingRight="",document.body.style.marginRight="",document.body.style.pointerEvents="",document.body.style.removeProperty("--scrollbar-width"),document.body.style.overflow=n.value??"",ct&&(r==null||r()),n.value=void 0};return F(t,(l,a)=>{var c;if(!Q)return;if(!l){a&&i();return}n.value===void 0&&(n.value=document.body.style.overflow);const d=window.innerWidth-document.documentElement.clientWidth,s={padding:d,margin:0},u=(c=o.scrollBody)!=null&&c.value?typeof o.scrollBody.value=="object"?mo({padding:o.scrollBody.value.padding===!0?d:o.scrollBody.value.padding,margin:o.scrollBody.value.margin===!0?d:o.scrollBody.value.margin},s):s:{padding:0,margin:0};d>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",`${d}px`),document.body.style.overflow="hidden"),ct&&(r=Te(document,"touchmove",p=>xo(p),{passive:!1})),ne(()=>{document.body.style.pointerEvents="none",document.body.style.overflow="hidden"})},{immediate:!0,flush:"sync"}),e});function bo(e){const n=go(6),t=wo();t.value.set(n,e);const o=w({get:()=>t.value.get(n)??!1,set:r=>t.value.set(n,r)});return uo(()=>{t.value.delete(n)}),o}function kt(e){const n=window.getComputedStyle(e);if(n.overflowX==="scroll"||n.overflowY==="scroll"||n.overflowX==="auto"&&e.clientWidth1?!0:(n.preventDefault&&n.cancelable&&n.preventDefault(),!1)}function ye(e){const n=oe(),t=n==null?void 0:n.type.emits,o={};return t!=null&&t.length||console.warn(`No emitted event found. Please check component: ${n==null?void 0:n.type.__name}`),t==null||t.forEach(r=>{o[Zt(wt(r))]=(...i)=>e(r,...i)}),o}function Wt(e){const n=oe(),t=Object.keys((n==null?void 0:n.type.props)??{}).reduce((r,i)=>{const l=(n==null?void 0:n.type.props[i]).default;return l!==void 0&&(r[i]=l),r},{}),o=on(e);return w(()=>{const r={},i=(n==null?void 0:n.vnode.props)??{};return Object.keys(i).forEach(l=>{r[wt(l)]=i[l]}),Object.keys({...t,...r}).reduce((l,a)=>(o.value[a]!==void 0&&(l[a]=o.value[a]),l),{})})}function Ht(e,n){const t=Wt(e),o=n?ye(n):{};return w(()=>({...t.value,...o}))}function A(){const e=oe(),n=C(),t=w(()=>{var l,a;return["#text","#comment"].includes((l=n.value)==null?void 0:l.$el.nodeName)?(a=n.value)==null?void 0:a.$el.nextElementSibling:me(n)}),o=Object.assign({},e.exposed),r={};for(const l in e.props)Object.defineProperty(r,l,{enumerable:!0,configurable:!0,get:()=>e.props[l]});if(Object.keys(o).length>0)for(const l in o)Object.defineProperty(r,l,{enumerable:!0,configurable:!0,get:()=>o[l]});Object.defineProperty(r,"$el",{enumerable:!0,configurable:!0,get:()=>e.vnode.el}),e.exposed=r;function i(l){n.value=l,l&&(Object.defineProperty(r,"$el",{enumerable:!0,configurable:!0,get:()=>l instanceof Element?l:l.$el}),e.exposed=r)}return{forwardRef:i,currentRef:n,currentElement:t}}function Co(e,n){const t=so(!1,300),o=C(null),r=Zn();function i(){o.value=null,t.value=!1}function l(a,c){const d=a.currentTarget,s={x:a.clientX,y:a.clientY},u=Oo(s,d.getBoundingClientRect()),p=Eo(s,u),v=_o(c.getBoundingClientRect()),h=Bo([...p,...v]);o.value=h,t.value=!0}return M(a=>{if(e.value&&n.value){const c=s=>l(s,n.value),d=s=>l(s,e.value);e.value.addEventListener("pointerleave",c),n.value.addEventListener("pointerleave",d),a(()=>{var s,u;(s=e.value)==null||s.removeEventListener("pointerleave",c),(u=n.value)==null||u.removeEventListener("pointerleave",d)})}}),M(a=>{var c;if(o.value){const d=s=>{var u,p;if(!o.value)return;const v=s.target,h={x:s.clientX,y:s.clientY},g=((u=e.value)==null?void 0:u.contains(v))||((p=n.value)==null?void 0:p.contains(v)),m=!Do(h,o.value),y=!!v.closest("[data-grace-area-trigger]");g?i():(m||y)&&(i(),r.trigger())};(c=e.value)==null||c.ownerDocument.addEventListener("pointermove",d),a(()=>{var s;return(s=e.value)==null?void 0:s.ownerDocument.removeEventListener("pointermove",d)})}}),{isPointerInTransit:t,onPointerExit:r.on}}function Oo(e,n){const t=Math.abs(n.top-e.y),o=Math.abs(n.bottom-e.y),r=Math.abs(n.right-e.x),i=Math.abs(n.left-e.x);switch(Math.min(t,o,r,i)){case i:return"left";case r:return"right";case t:return"top";case o:return"bottom";default:throw new Error("unreachable")}}function Eo(e,n,t=5){const o=[];switch(n){case"top":o.push({x:e.x-t,y:e.y+t},{x:e.x+t,y:e.y+t});break;case"bottom":o.push({x:e.x-t,y:e.y-t},{x:e.x+t,y:e.y-t});break;case"left":o.push({x:e.x+t,y:e.y-t},{x:e.x+t,y:e.y+t});break;case"right":o.push({x:e.x-t,y:e.y-t},{x:e.x-t,y:e.y+t});break}return o}function _o(e){const{top:n,right:t,bottom:o,left:r}=e;return[{x:r,y:n},{x:t,y:n},{x:t,y:o},{x:r,y:o}]}function Do(e,n){const{x:t,y:o}=e;let r=!1;for(let i=0,l=n.length-1;io!=s>o&&t<(d-a)*(o-c)/(s-c)+a&&(r=!r)}return r}function Bo(e){const n=e.slice();return n.sort((t,o)=>t.xo.x?1:t.yo.y?1:0),Ao(n)}function Ao(e){if(e.length<=1)return e.slice();const n=[];for(let o=0;o=2;){const i=n[n.length-1],l=n[n.length-2];if((i.x-l.x)*(r.y-l.y)>=(i.y-l.y)*(r.x-l.x))n.pop();else break}n.push(r)}n.pop();const t=[];for(let o=e.length-1;o>=0;o--){const r=e[o];for(;t.length>=2;){const i=t[t.length-1],l=t[t.length-2];if((i.x-l.x)*(r.y-l.y)>=(i.y-l.y)*(r.x-l.x))t.pop();else break}t.push(r)}return t.pop(),n.length===1&&t.length===1&&n[0].x===t[0].x&&n[0].y===t[0].y?n:n.concat(t)}var To=function(e){if(typeof document>"u")return null;var n=Array.isArray(e)?e[0]:e;return n.ownerDocument.body},ae=new WeakMap,Ee=new WeakMap,_e={},Le=0,jt=function(e){return e&&(e.host||jt(e.parentNode))},Po=function(e,n){return n.map(function(t){if(e.contains(t))return t;var o=jt(t);return o&&e.contains(o)?o:(console.error("aria-hidden",t,"in not contained inside",e,". Doing nothing"),null)}).filter(function(t){return!!t})},$o=function(e,n,t,o){var r=Po(n,Array.isArray(e)?e:[e]);_e[t]||(_e[t]=new WeakMap);var i=_e[t],l=[],a=new Set,c=new Set(r),d=function(u){!u||a.has(u)||(a.add(u),d(u.parentNode))};r.forEach(d);var s=function(u){!u||c.has(u)||Array.prototype.forEach.call(u.children,function(p){if(a.has(p))s(p);else try{var v=p.getAttribute(o),h=v!==null&&v!=="false",g=(ae.get(p)||0)+1,m=(i.get(p)||0)+1;ae.set(p,g),i.set(p,m),l.push(p),g===1&&h&&Ee.set(p,!0),m===1&&p.setAttribute(t,"true"),h||p.setAttribute(o,"true")}catch(y){console.error("aria-hidden: cannot operate on ",p,y)}})};return s(n),a.clear(),Le++,function(){l.forEach(function(u){var p=ae.get(u)-1,v=i.get(u)-1;ae.set(u,p),i.set(u,v),p||(Ee.has(u)||u.removeAttribute(o),Ee.delete(u)),v||u.removeAttribute(t)}),Le--,Le||(ae=new WeakMap,ae=new WeakMap,Ee=new WeakMap,_e={})}},Ro=function(e,n,t){t===void 0&&(t="data-aria-hidden");var o=Array.from(Array.isArray(e)?e:[e]),r=To(e);return r?(o.push.apply(o,Array.from(r.querySelectorAll("[aria-live]"))),$o(o,r,t,"aria-hidden")):function(){return null}};function No(e){let n;F(()=>me(e),t=>{t?n=Ro(t):n&&n()}),bt(()=>{n&&n()})}let So=0;function Ke(e,n="radix"){const t=It({useId:void 0});return lt?`${n}-${lt()}`:t.useId?`${n}-${t.useId()}`:`${n}-${++So}`}function Fo(e){const n=C(),t=w(()=>{var r;return((r=n.value)==null?void 0:r.width)??0}),o=w(()=>{var r;return((r=n.value)==null?void 0:r.height)??0});return fe(()=>{const r=me(e);if(r){n.value={width:r.offsetWidth,height:r.offsetHeight};const i=new ResizeObserver(l=>{if(!Array.isArray(l)||!l.length)return;const a=l[0];let c,d;if("borderBoxSize"in a){const s=a.borderBoxSize,u=Array.isArray(s)?s[0]:s;c=u.inlineSize,d=u.blockSize}else c=r.offsetWidth,d=r.offsetHeight;n.value={width:c,height:d}});return i.observe(r,{box:"border-box"}),()=>i.unobserve(r)}else n.value=void 0}),{width:t,height:o}}function Lo(e,n){const t=C(e);function o(r){return n[t.value][r]??t.value}return{state:t,dispatch:r=>{t.value=o(r)}}}const Mo=O({name:"PrimitiveSlot",inheritAttrs:!1,setup(e,{attrs:n,slots:t}){return()=>{var o,r;if(!t.default)return null;const i=et(t.default()),l=i.findIndex(s=>s.type!==xt);if(l===-1)return i;const a=i[l];(o=a.props)==null||delete o.ref;const c=a.props?P(n,a.props):n;n.class&&(r=a.props)!=null&&r.class&&delete a.props.class;const d=ln(a,c);for(const s in c)s.startsWith("on")&&(d.props||(d.props={}),d.props[s]=c[s]);return i.length===1?d:(i[l]=d,i)}}}),W=O({name:"Primitive",inheritAttrs:!1,props:{asChild:{type:Boolean,default:!1},as:{type:[String,Object],default:"div"}},setup(e,{attrs:n,slots:t}){const o=e.asChild?"template":e.as;return typeof o=="string"&&["area","img","input"].includes(o)?()=>Be(o,n):o!=="template"?()=>Be(e.as,n,{default:t.default}):()=>Be(Mo,n,{default:t.default})}});function Io(e,n){var t;const o=C({}),r=C("none"),i=C(e),l=e.value?"mounted":"unmounted";let a;const c=((t=n.value)==null?void 0:t.ownerDocument.defaultView)??Ze,{state:d,dispatch:s}=Lo(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}}),u=m=>{var y;if(Q){const B=new CustomEvent(m,{bubbles:!1,cancelable:!1});(y=n.value)==null||y.dispatchEvent(B)}};F(e,async(m,y)=>{var B;const b=y!==m;if(await ne(),b){const $=r.value,R=De(n.value);m?(s("MOUNT"),u("enter"),R==="none"&&u("after-enter")):R==="none"||((B=o.value)==null?void 0:B.display)==="none"?(s("UNMOUNT"),u("leave"),u("after-leave")):y&&$!==R?(s("ANIMATION_OUT"),u("leave")):(s("UNMOUNT"),u("after-leave"))}},{immediate:!0});const p=m=>{const y=De(n.value),B=y.includes(m.animationName),b=d.value==="mounted"?"enter":"leave";if(m.target===n.value&&B&&(u(`after-${b}`),s("ANIMATION_END"),!i.value)){const $=n.value.style.animationFillMode;n.value.style.animationFillMode="forwards",a=c==null?void 0:c.setTimeout(()=>{var R;((R=n.value)==null?void 0:R.style.animationFillMode)==="forwards"&&(n.value.style.animationFillMode=$)})}m.target===n.value&&y==="none"&&s("ANIMATION_END")},v=m=>{m.target===n.value&&(r.value=De(n.value))},h=F(n,(m,y)=>{m?(o.value=getComputedStyle(m),m.addEventListener("animationstart",v),m.addEventListener("animationcancel",p),m.addEventListener("animationend",p)):(s("ANIMATION_END"),a!==void 0&&(c==null||c.clearTimeout(a)),y==null||y.removeEventListener("animationstart",v),y==null||y.removeEventListener("animationcancel",p),y==null||y.removeEventListener("animationend",p))},{immediate:!0}),g=F(d,()=>{const m=De(n.value);r.value=d.value==="mounted"?m:"none"});return bt(()=>{h(),g()}),{isPresent:w(()=>["mounted","unmountSuspended"].includes(d.value))}}function De(e){return e&&getComputedStyle(e).animationName||"none"}const tt=O({name:"Presence",props:{present:{type:Boolean,required:!0},forceMount:{type:Boolean}},slots:{},setup(e,{slots:n,expose:t}){var o;const{present:r,forceMount:i}=Ue(e),l=C(),{isPresent:a}=Io(r,l);t({present:a});let c=n.default({present:a});c=et(c||[]);const d=oe();if(c&&(c==null?void 0:c.length)>1){const s=(o=d==null?void 0:d.parent)!=null&&o.type.name?`<${d.parent.type.name} />`:"component";throw new Error([`Detected an invalid children for \`${s}\` 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{f as w,e as C,bs as ht,w as F,bL as mt,bM as yt,cs as ie,u as f,d as O,bk as D,o as _,bl as x,bh as E,ct as G,cu as J,ch as P,cj as ke,_ as ne,T as fe,bq as Ue,W as gt,b as ee,cv as Qt,cw as oe,cx as Zt,cy as wt,cz as en,cA as Be,cB as tn,cC as nn,a8 as on,U as bt,c6 as rn,cD as xt,cE as ln,cF as Ct,cG as lt,bK as M,bG as an,cg as sn,Y as un,c as Ot,a3 as Ye,cH as Et,cI as dn,r as _t,cJ as cn,cK as fn,a as pn,cL as vn,cM as hn}from"./index-B06xwjXa.js";import{o as mn,f as yn,s as gn,a as wn,h as bn,l as xn,c as Cn,b as j,r as Dt,d as On,e as Ae,m as ue,g as We,i as Oe}from"./floating-ui.core-CgBsuaUc.js";function Pe(){return typeof window<"u"}function re(e){return Xe(e)?(e.nodeName||"").toLowerCase():"#document"}function N(e){var n;return(e==null||(n=e.ownerDocument)==null?void 0:n.defaultView)||window}function V(e){var n;return(n=(Xe(e)?e.ownerDocument:e.document)||window.document)==null?void 0:n.documentElement}function Xe(e){return Pe()?e instanceof Node||e instanceof N(e).Node:!1}function I(e){return Pe()?e instanceof Element||e instanceof N(e).Element:!1}function K(e){return Pe()?e instanceof HTMLElement||e instanceof N(e).HTMLElement:!1}function it(e){return!Pe()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof N(e).ShadowRoot}function ve(e){const{overflow:n,overflowX:t,overflowY:o,display:r}=k(e);return/auto|scroll|overlay|hidden|clip/.test(n+o+t)&&!["inline","contents"].includes(r)}function En(e){return["table","td","th"].includes(re(e))}function $e(e){return[":popover-open",":modal"].some(n=>{try{return e.matches(n)}catch{return!1}})}function qe(e){const n=Ge(),t=I(e)?k(e):e;return["transform","translate","scale","rotate","perspective"].some(o=>t[o]?t[o]!=="none":!1)||(t.containerType?t.containerType!=="normal":!1)||!n&&(t.backdropFilter?t.backdropFilter!=="none":!1)||!n&&(t.filter?t.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(o=>(t.willChange||"").includes(o))||["paint","layout","strict","content"].some(o=>(t.contain||"").includes(o))}function _n(e){let n=q(e);for(;K(n)&&!ce(n);){if(qe(n))return n;if($e(n))return null;n=q(n)}return null}function Ge(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function ce(e){return["html","body","#document"].includes(re(e))}function k(e){return N(e).getComputedStyle(e)}function Re(e){return I(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function q(e){if(re(e)==="html")return e;const n=e.assignedSlot||e.parentNode||it(e)&&e.host||V(e);return it(n)?n.host:n}function Bt(e){const n=q(e);return ce(n)?e.ownerDocument?e.ownerDocument.body:e.body:K(n)&&ve(n)?n:Bt(n)}function pe(e,n,t){var o;n===void 0&&(n=[]),t===void 0&&(t=!0);const r=Bt(e),i=r===((o=e.ownerDocument)==null?void 0:o.body),l=N(r);if(i){const a=He(l);return n.concat(l,l.visualViewport||[],ve(r)?r:[],a&&t?pe(a):[])}return n.concat(r,pe(r,[],t))}function He(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function At(e){const n=k(e);let t=parseFloat(n.width)||0,o=parseFloat(n.height)||0;const r=K(e),i=r?e.offsetWidth:t,l=r?e.offsetHeight:o,a=Ae(t)!==i||Ae(o)!==l;return a&&(t=i,o=l),{width:t,height:o,$:a}}function Je(e){return I(e)?e:e.contextElement}function de(e){const n=Je(e);if(!K(n))return j(1);const t=n.getBoundingClientRect(),{width:o,height:r,$:i}=At(n);let l=(i?Ae(t.width):t.width)/o,a=(i?Ae(t.height):t.height)/r;return(!l||!Number.isFinite(l))&&(l=1),(!a||!Number.isFinite(a))&&(a=1),{x:l,y:a}}const Dn=j(0);function Tt(e){const n=N(e);return!Ge()||!n.visualViewport?Dn:{x:n.visualViewport.offsetLeft,y:n.visualViewport.offsetTop}}function Bn(e,n,t){return n===void 0&&(n=!1),!t||n&&t!==N(e)?!1:n}function te(e,n,t,o){n===void 0&&(n=!1),t===void 0&&(t=!1);const r=e.getBoundingClientRect(),i=Je(e);let l=j(1);n&&(o?I(o)&&(l=de(o)):l=de(e));const a=Bn(i,t,o)?Tt(i):j(0);let c=(r.left+a.x)/l.x,d=(r.top+a.y)/l.y,s=r.width/l.x,u=r.height/l.y;if(i){const p=N(i),v=o&&I(o)?N(o):o;let h=p,g=He(h);for(;g&&o&&v!==h;){const m=de(g),y=g.getBoundingClientRect(),B=k(g),b=y.left+(g.clientLeft+parseFloat(B.paddingLeft))*m.x,$=y.top+(g.clientTop+parseFloat(B.paddingTop))*m.y;c*=m.x,d*=m.y,s*=m.x,u*=m.y,c+=b,d+=$,h=N(g),g=He(h)}}return Dt({width:s,height:u,x:c,y:d})}function Qe(e,n){const t=Re(e).scrollLeft;return n?n.left+t:te(V(e)).left+t}function Pt(e,n,t){t===void 0&&(t=!1);const o=e.getBoundingClientRect(),r=o.left+n.scrollLeft-(t?0:Qe(e,o)),i=o.top+n.scrollTop;return{x:r,y:i}}function An(e){let{elements:n,rect:t,offsetParent:o,strategy:r}=e;const i=r==="fixed",l=V(o),a=n?$e(n.floating):!1;if(o===l||a&&i)return t;let c={scrollLeft:0,scrollTop:0},d=j(1);const s=j(0),u=K(o);if((u||!u&&!i)&&((re(o)!=="body"||ve(l))&&(c=Re(o)),K(o))){const v=te(o);d=de(o),s.x=v.x+o.clientLeft,s.y=v.y+o.clientTop}const p=l&&!u&&!i?Pt(l,c,!0):j(0);return{width:t.width*d.x,height:t.height*d.y,x:t.x*d.x-c.scrollLeft*d.x+s.x+p.x,y:t.y*d.y-c.scrollTop*d.y+s.y+p.y}}function Tn(e){return Array.from(e.getClientRects())}function Pn(e){const n=V(e),t=Re(e),o=e.ownerDocument.body,r=ue(n.scrollWidth,n.clientWidth,o.scrollWidth,o.clientWidth),i=ue(n.scrollHeight,n.clientHeight,o.scrollHeight,o.clientHeight);let l=-t.scrollLeft+Qe(e);const a=-t.scrollTop;return k(o).direction==="rtl"&&(l+=ue(n.clientWidth,o.clientWidth)-r),{width:r,height:i,x:l,y:a}}function $n(e,n){const t=N(e),o=V(e),r=t.visualViewport;let i=o.clientWidth,l=o.clientHeight,a=0,c=0;if(r){i=r.width,l=r.height;const d=Ge();(!d||d&&n==="fixed")&&(a=r.offsetLeft,c=r.offsetTop)}return{width:i,height:l,x:a,y:c}}function Rn(e,n){const t=te(e,!0,n==="fixed"),o=t.top+e.clientTop,r=t.left+e.clientLeft,i=K(e)?de(e):j(1),l=e.clientWidth*i.x,a=e.clientHeight*i.y,c=r*i.x,d=o*i.y;return{width:l,height:a,x:c,y:d}}function at(e,n,t){let o;if(n==="viewport")o=$n(e,t);else if(n==="document")o=Pn(V(e));else if(I(n))o=Rn(n,t);else{const r=Tt(e);o={x:n.x-r.x,y:n.y-r.y,width:n.width,height:n.height}}return Dt(o)}function $t(e,n){const t=q(e);return t===n||!I(t)||ce(t)?!1:k(t).position==="fixed"||$t(t,n)}function Sn(e,n){const t=n.get(e);if(t)return t;let o=pe(e,[],!1).filter(a=>I(a)&&re(a)!=="body"),r=null;const i=k(e).position==="fixed";let l=i?q(e):e;for(;I(l)&&!ce(l);){const a=k(l),c=qe(l);!c&&a.position==="fixed"&&(r=null),(i?!c&&!r:!c&&a.position==="static"&&!!r&&["absolute","fixed"].includes(r.position)||ve(l)&&!c&&$t(e,l))?o=o.filter(s=>s!==l):r=a,l=q(l)}return n.set(e,o),o}function Nn(e){let{element:n,boundary:t,rootBoundary:o,strategy:r}=e;const l=[...t==="clippingAncestors"?$e(n)?[]:Sn(n,this._c):[].concat(t),o],a=l[0],c=l.reduce((d,s)=>{const u=at(n,s,r);return d.top=ue(u.top,d.top),d.right=We(u.right,d.right),d.bottom=We(u.bottom,d.bottom),d.left=ue(u.left,d.left),d},at(n,a,r));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function Fn(e){const{width:n,height:t}=At(e);return{width:n,height:t}}function Ln(e,n,t){const o=K(n),r=V(n),i=t==="fixed",l=te(e,!0,i,n);let a={scrollLeft:0,scrollTop:0};const c=j(0);if(o||!o&&!i)if((re(n)!=="body"||ve(r))&&(a=Re(n)),o){const p=te(n,!0,i,n);c.x=p.x+n.clientLeft,c.y=p.y+n.clientTop}else r&&(c.x=Qe(r));const d=r&&!o&&!i?Pt(r,a):j(0),s=l.left+a.scrollLeft-c.x-d.x,u=l.top+a.scrollTop-c.y-d.y;return{x:s,y:u,width:l.width,height:l.height}}function Ne(e){return k(e).position==="static"}function st(e,n){if(!K(e)||k(e).position==="fixed")return null;if(n)return n(e);let t=e.offsetParent;return V(e)===t&&(t=t.ownerDocument.body),t}function Rt(e,n){const t=N(e);if($e(e))return t;if(!K(e)){let r=q(e);for(;r&&!ce(r);){if(I(r)&&!Ne(r))return r;r=q(r)}return t}let o=st(e,n);for(;o&&En(o)&&Ne(o);)o=st(o,n);return o&&ce(o)&&Ne(o)&&!qe(o)?t:o||_n(e)||t}const Mn=async function(e){const n=this.getOffsetParent||Rt,t=this.getDimensions,o=await t(e.floating);return{reference:Ln(e.reference,await n(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function In(e){return k(e).direction==="rtl"}const kn={convertOffsetParentRelativeRectToViewportRelativeRect:An,getDocumentElement:V,getClippingRect:Nn,getOffsetParent:Rt,getElementRects:Mn,getClientRects:Tn,getDimensions:Fn,getScale:de,isElement:I,isRTL:In};function St(e,n){return e.x===n.x&&e.y===n.y&&e.width===n.width&&e.height===n.height}function Wn(e,n){let t=null,o;const r=V(e);function i(){var a;clearTimeout(o),(a=t)==null||a.disconnect(),t=null}function l(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),i();const d=e.getBoundingClientRect(),{left:s,top:u,width:p,height:v}=d;if(a||n(),!p||!v)return;const h=Oe(u),g=Oe(r.clientWidth-(s+p)),m=Oe(r.clientHeight-(u+v)),y=Oe(s),b={rootMargin:-h+"px "+-g+"px "+-m+"px "+-y+"px",threshold:ue(0,We(1,c))||1};let $=!0;function R(L){const T=L[0].intersectionRatio;if(T!==c){if(!$)return l();T?l(!1,T):o=setTimeout(()=>{l(!1,1e-7)},1e3)}T===1&&!St(d,e.getBoundingClientRect())&&l(),$=!1}try{t=new IntersectionObserver(R,{...b,root:r.ownerDocument})}catch{t=new IntersectionObserver(R,b)}t.observe(e)}return l(!0),i}function Hn(e,n,t,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=o,d=Je(e),s=r||i?[...d?pe(d):[],...pe(n)]:[];s.forEach(y=>{r&&y.addEventListener("scroll",t,{passive:!0}),i&&y.addEventListener("resize",t)});const u=d&&a?Wn(d,t):null;let p=-1,v=null;l&&(v=new ResizeObserver(y=>{let[B]=y;B&&B.target===d&&v&&(v.unobserve(n),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var b;(b=v)==null||b.observe(n)})),t()}),d&&!c&&v.observe(d),v.observe(n));let h,g=c?te(e):null;c&&m();function m(){const y=te(e);g&&!St(g,y)&&t(),g=y,h=requestAnimationFrame(m)}return t(),()=>{var y;s.forEach(B=>{r&&B.removeEventListener("scroll",t),i&&B.removeEventListener("resize",t)}),u==null||u(),(y=v)==null||y.disconnect(),v=null,c&&cancelAnimationFrame(h)}}const jn=mn,Kn=gn,ut=yn,Vn=wn,zn=bn,Un=On,Yn=xn,Xn=(e,n,t)=>{const o=new Map,r={platform:kn,...t},i={...r.platform,_c:o};return Cn(e,n,{...r,platform:i})};function qn(e){return e!=null&&typeof e=="object"&&"$el"in e}function je(e){if(qn(e)){const n=e.$el;return Xe(n)&&re(n)==="#comment"?null:n}return e}function se(e){return typeof e=="function"?e():f(e)}function Gn(e){return{name:"arrow",options:e,fn(n){const t=je(se(e.element));return t==null?{}:Un({element:t,padding:e.padding}).fn(n)}}}function Nt(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function dt(e,n){const t=Nt(e);return Math.round(n*t)/t}function Jn(e,n,t){t===void 0&&(t={});const o=t.whileElementsMounted,r=w(()=>{var T;return(T=se(t.open))!=null?T:!0}),i=w(()=>se(t.middleware)),l=w(()=>{var T;return(T=se(t.placement))!=null?T:"bottom"}),a=w(()=>{var T;return(T=se(t.strategy))!=null?T:"absolute"}),c=w(()=>{var T;return(T=se(t.transform))!=null?T:!0}),d=w(()=>je(e.value)),s=w(()=>je(n.value)),u=C(0),p=C(0),v=C(a.value),h=C(l.value),g=ht({}),m=C(!1),y=w(()=>{const T={position:v.value,left:"0",top:"0"};if(!s.value)return T;const H=dt(s.value,u.value),ge=dt(s.value,p.value);return c.value?{...T,transform:"translate("+H+"px, "+ge+"px)",...Nt(s.value)>=1.5&&{willChange:"transform"}}:{position:v.value,left:H+"px",top:ge+"px"}});let B;function b(){if(d.value==null||s.value==null)return;const T=r.value;Xn(d.value,s.value,{middleware:i.value,placement:l.value,strategy:a.value}).then(H=>{u.value=H.x,p.value=H.y,v.value=H.strategy,h.value=H.placement,g.value=H.middlewareData,m.value=T!==!1})}function $(){typeof B=="function"&&(B(),B=void 0)}function R(){if($(),o===void 0){b();return}if(d.value!=null&&s.value!=null){B=o(d.value,s.value,b);return}}function L(){r.value||(m.value=!1)}return F([i,l,a,r],b,{flush:"sync"}),F([d,s],R,{flush:"sync"}),F(r,L,{flush:"sync"}),mt()&&yt($),{x:ie(u),y:ie(p),strategy:ie(v),placement:ie(h),middlewareData:ie(g),isPositioned:ie(m),floatingStyles:y,update:b}}function le(e,n){const t=typeof e=="string"&&!n?`${e}Context`:n,o=Symbol(t);return[r=>{const i=en(o,r);if(i||i===null)return i;throw new Error(`Injection \`${o.toString()}\` not found. Component must be used within ${Array.isArray(e)?`one of the following components: ${e.join(", ")}`:`\`${e}\``}`)},r=>(hn(o,r),r)]}function Ft(e,n,t){const o=t.originalEvent.target,r=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:t});n&&o.addEventListener(e,n,{once:!0}),o.dispatchEvent(r)}function Qn(e,n){var t;const o=ht();return M(()=>{o.value=e()},{...n,flush:(t=void 0)!=null?t:"sync"}),Ct(o)}function he(e){return mt()?(yt(e),!0):!1}function Zn(){const e=new Set,n=t=>{e.delete(t)};return{on:t=>{e.add(t);const o=()=>n(t);return he(o),{off:o}},off:n,trigger:(...t)=>Promise.all(Array.from(e).map(o=>o(...t)))}}function eo(e){let n=!1,t;const o=Et(!0);return(...r)=>(n||(t=o.run(()=>e(...r)),n=!0),t)}function to(e){let n=0,t,o;const r=()=>{n-=1,o&&n<=0&&(o.stop(),t=void 0,o=void 0)};return(...i)=>(n+=1,t||(o=Et(!0),t=o.run(()=>e(...i))),he(r),t)}function Z(e){return typeof e=="function"?e():f(e)}const Q=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const no=e=>typeof e<"u",oo=Object.prototype.toString,ro=e=>oo.call(e)==="[object Object]",lo=()=>{},ct=io();function io(){var e,n;return Q&&((e=window==null?void 0:window.navigator)==null?void 0:e.userAgent)&&(/iP(?:ad|hone|od)/.test(window.navigator.userAgent)||((n=window==null?void 0:window.navigator)==null?void 0:n.maxTouchPoints)>2&&/iPad|Macintosh/.test(window==null?void 0:window.navigator.userAgent))}function ao(e){return oe()}function so(e,n=1e4){return vn((t,o)=>{let r=Z(e),i;const l=()=>setTimeout(()=>{r=Z(e),o()},Z(n));return he(()=>{clearTimeout(i)}),{get(){return t(),r},set(a){r=a,o(),clearTimeout(i),i=l()}}})}function uo(e,n){ao()&&dn(e,n)}function Lt(e,n,t={}){const{immediate:o=!0}=t,r=C(!1);let i=null;function l(){i&&(clearTimeout(i),i=null)}function a(){r.value=!1,l()}function c(...d){l(),r.value=!0,i=setTimeout(()=>{r.value=!1,i=null,e(...d)},Z(n))}return o&&(r.value=!0,Q&&c()),he(a),{isPending:Ct(r),start:c,stop:a}}function me(e){var n;const t=Z(e);return(n=t==null?void 0:t.$el)!=null?n:t}const Ze=Q?window:void 0;function Te(...e){let n,t,o,r;if(typeof e[0]=="string"||Array.isArray(e[0])?([t,o,r]=e,n=Ze):[n,t,o,r]=e,!n)return lo;Array.isArray(t)||(t=[t]),Array.isArray(o)||(o=[o]);const i=[],l=()=>{i.forEach(s=>s()),i.length=0},a=(s,u,p,v)=>(s.addEventListener(u,p,v),()=>s.removeEventListener(u,p,v)),c=F(()=>[me(n),Z(r)],([s,u])=>{if(l(),!s)return;const p=ro(u)?{...u}:u;i.push(...t.flatMap(v=>o.map(h=>a(s,v,h,p))))},{immediate:!0,flush:"post"}),d=()=>{c(),l()};return he(d),d}function co(e){return typeof e=="function"?e:typeof e=="string"?n=>n.key===e:Array.isArray(e)?n=>e.includes(n.key):()=>!0}function fo(...e){let n,t,o={};e.length===3?(n=e[0],t=e[1],o=e[2]):e.length===2?typeof e[1]=="object"?(n=!0,t=e[0],o=e[1]):(n=e[0],t=e[1]):(n=!0,t=e[0]);const{target:r=Ze,eventName:i="keydown",passive:l=!1,dedupe:a=!1}=o,c=co(n);return Te(r,i,d=>{d.repeat&&Z(a)||c(d)&&t(d)},l)}function po(){const e=C(!1),n=oe();return n&&fe(()=>{e.value=!0},n),e}function vo(e){return JSON.parse(JSON.stringify(e))}function Mt(e,n,t,o={}){var r,i,l;const{clone:a=!1,passive:c=!1,eventName:d,deep:s=!1,defaultValue:u,shouldEmit:p}=o,v=oe(),h=t||(v==null?void 0:v.emit)||((r=v==null?void 0:v.$emit)==null?void 0:r.bind(v))||((l=(i=v==null?void 0:v.proxy)==null?void 0:i.$emit)==null?void 0:l.bind(v==null?void 0:v.proxy));let g=d;g=g||`update:${n.toString()}`;const m=b=>a?typeof a=="function"?a(b):vo(b):b,y=()=>no(e[n])?m(e[n]):u,B=b=>{p?p(b)&&h(g,b):h(g,b)};if(c){const b=y(),$=C(b);let R=!1;return F(()=>e[n],L=>{R||(R=!0,$.value=m(L),ne(()=>R=!1))}),F($,L=>{!R&&(L!==e[n]||s)&&B(L)},{deep:s}),$}else return w({get(){return y()},set(b){B(b)}})}function et(e){return e?e.flatMap(n=>n.type===rn?et(n.children):[n]):[]}function X(){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 Fe(e){if(e===null||typeof e!="object")return!1;const n=Object.getPrototypeOf(e);return n!==null&&n!==Object.prototype&&Object.getPrototypeOf(n)!==null||Symbol.iterator in e?!1:Symbol.toStringTag in e?Object.prototype.toString.call(e)==="[object Module]":!0}function Ke(e,n,t=".",o){if(!Fe(n))return Ke(e,{},t);const r=Object.assign({},n);for(const i in e){if(i==="__proto__"||i==="constructor")continue;const l=e[i];l!=null&&(Array.isArray(l)&&Array.isArray(r[i])?r[i]=[...l,...r[i]]:Fe(l)&&Fe(r[i])?r[i]=Ke(l,r[i],(t?`${t}.`:"")+i.toString()):r[i]=l)}return r}function ho(e){return(...n)=>n.reduce((t,o)=>Ke(t,o,""),{})}const mo=ho(),[It,Tr]=le("ConfigProvider");let yo="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",go=(e=21)=>{let n="",t=e;for(;t--;)n+=yo[Math.random()*64|0];return n};const wo=to(()=>{const e=C(new Map),n=C(),t=w(()=>{for(const l of e.value.values())if(l)return!0;return!1}),o=It({scrollBody:C(!0)});let r=null;const i=()=>{document.body.style.paddingRight="",document.body.style.marginRight="",document.body.style.pointerEvents="",document.body.style.removeProperty("--scrollbar-width"),document.body.style.overflow=n.value??"",ct&&(r==null||r()),n.value=void 0};return F(t,(l,a)=>{var c;if(!Q)return;if(!l){a&&i();return}n.value===void 0&&(n.value=document.body.style.overflow);const d=window.innerWidth-document.documentElement.clientWidth,s={padding:d,margin:0},u=(c=o.scrollBody)!=null&&c.value?typeof o.scrollBody.value=="object"?mo({padding:o.scrollBody.value.padding===!0?d:o.scrollBody.value.padding,margin:o.scrollBody.value.margin===!0?d:o.scrollBody.value.margin},s):s:{padding:0,margin:0};d>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",`${d}px`),document.body.style.overflow="hidden"),ct&&(r=Te(document,"touchmove",p=>xo(p),{passive:!1})),ne(()=>{document.body.style.pointerEvents="none",document.body.style.overflow="hidden"})},{immediate:!0,flush:"sync"}),e});function bo(e){const n=go(6),t=wo();t.value.set(n,e);const o=w({get:()=>t.value.get(n)??!1,set:r=>t.value.set(n,r)});return uo(()=>{t.value.delete(n)}),o}function kt(e){const n=window.getComputedStyle(e);if(n.overflowX==="scroll"||n.overflowY==="scroll"||n.overflowX==="auto"&&e.clientWidth1?!0:(n.preventDefault&&n.cancelable&&n.preventDefault(),!1)}function ye(e){const n=oe(),t=n==null?void 0:n.type.emits,o={};return t!=null&&t.length||console.warn(`No emitted event found. Please check component: ${n==null?void 0:n.type.__name}`),t==null||t.forEach(r=>{o[Zt(wt(r))]=(...i)=>e(r,...i)}),o}function Wt(e){const n=oe(),t=Object.keys((n==null?void 0:n.type.props)??{}).reduce((r,i)=>{const l=(n==null?void 0:n.type.props[i]).default;return l!==void 0&&(r[i]=l),r},{}),o=on(e);return w(()=>{const r={},i=(n==null?void 0:n.vnode.props)??{};return Object.keys(i).forEach(l=>{r[wt(l)]=i[l]}),Object.keys({...t,...r}).reduce((l,a)=>(o.value[a]!==void 0&&(l[a]=o.value[a]),l),{})})}function Ht(e,n){const t=Wt(e),o=n?ye(n):{};return w(()=>({...t.value,...o}))}function A(){const e=oe(),n=C(),t=w(()=>{var l,a;return["#text","#comment"].includes((l=n.value)==null?void 0:l.$el.nodeName)?(a=n.value)==null?void 0:a.$el.nextElementSibling:me(n)}),o=Object.assign({},e.exposed),r={};for(const l in e.props)Object.defineProperty(r,l,{enumerable:!0,configurable:!0,get:()=>e.props[l]});if(Object.keys(o).length>0)for(const l in o)Object.defineProperty(r,l,{enumerable:!0,configurable:!0,get:()=>o[l]});Object.defineProperty(r,"$el",{enumerable:!0,configurable:!0,get:()=>e.vnode.el}),e.exposed=r;function i(l){n.value=l,l&&(Object.defineProperty(r,"$el",{enumerable:!0,configurable:!0,get:()=>l instanceof Element?l:l.$el}),e.exposed=r)}return{forwardRef:i,currentRef:n,currentElement:t}}function Co(e,n){const t=so(!1,300),o=C(null),r=Zn();function i(){o.value=null,t.value=!1}function l(a,c){const d=a.currentTarget,s={x:a.clientX,y:a.clientY},u=Oo(s,d.getBoundingClientRect()),p=Eo(s,u),v=_o(c.getBoundingClientRect()),h=Bo([...p,...v]);o.value=h,t.value=!0}return M(a=>{if(e.value&&n.value){const c=s=>l(s,n.value),d=s=>l(s,e.value);e.value.addEventListener("pointerleave",c),n.value.addEventListener("pointerleave",d),a(()=>{var s,u;(s=e.value)==null||s.removeEventListener("pointerleave",c),(u=n.value)==null||u.removeEventListener("pointerleave",d)})}}),M(a=>{var c;if(o.value){const d=s=>{var u,p;if(!o.value)return;const v=s.target,h={x:s.clientX,y:s.clientY},g=((u=e.value)==null?void 0:u.contains(v))||((p=n.value)==null?void 0:p.contains(v)),m=!Do(h,o.value),y=!!v.closest("[data-grace-area-trigger]");g?i():(m||y)&&(i(),r.trigger())};(c=e.value)==null||c.ownerDocument.addEventListener("pointermove",d),a(()=>{var s;return(s=e.value)==null?void 0:s.ownerDocument.removeEventListener("pointermove",d)})}}),{isPointerInTransit:t,onPointerExit:r.on}}function Oo(e,n){const t=Math.abs(n.top-e.y),o=Math.abs(n.bottom-e.y),r=Math.abs(n.right-e.x),i=Math.abs(n.left-e.x);switch(Math.min(t,o,r,i)){case i:return"left";case r:return"right";case t:return"top";case o:return"bottom";default:throw new Error("unreachable")}}function Eo(e,n,t=5){const o=[];switch(n){case"top":o.push({x:e.x-t,y:e.y+t},{x:e.x+t,y:e.y+t});break;case"bottom":o.push({x:e.x-t,y:e.y-t},{x:e.x+t,y:e.y-t});break;case"left":o.push({x:e.x+t,y:e.y-t},{x:e.x+t,y:e.y+t});break;case"right":o.push({x:e.x-t,y:e.y-t},{x:e.x-t,y:e.y+t});break}return o}function _o(e){const{top:n,right:t,bottom:o,left:r}=e;return[{x:r,y:n},{x:t,y:n},{x:t,y:o},{x:r,y:o}]}function Do(e,n){const{x:t,y:o}=e;let r=!1;for(let i=0,l=n.length-1;io!=s>o&&t<(d-a)*(o-c)/(s-c)+a&&(r=!r)}return r}function Bo(e){const n=e.slice();return n.sort((t,o)=>t.xo.x?1:t.yo.y?1:0),Ao(n)}function Ao(e){if(e.length<=1)return e.slice();const n=[];for(let o=0;o=2;){const i=n[n.length-1],l=n[n.length-2];if((i.x-l.x)*(r.y-l.y)>=(i.y-l.y)*(r.x-l.x))n.pop();else break}n.push(r)}n.pop();const t=[];for(let o=e.length-1;o>=0;o--){const r=e[o];for(;t.length>=2;){const i=t[t.length-1],l=t[t.length-2];if((i.x-l.x)*(r.y-l.y)>=(i.y-l.y)*(r.x-l.x))t.pop();else break}t.push(r)}return t.pop(),n.length===1&&t.length===1&&n[0].x===t[0].x&&n[0].y===t[0].y?n:n.concat(t)}var To=function(e){if(typeof document>"u")return null;var n=Array.isArray(e)?e[0]:e;return n.ownerDocument.body},ae=new WeakMap,Ee=new WeakMap,_e={},Le=0,jt=function(e){return e&&(e.host||jt(e.parentNode))},Po=function(e,n){return n.map(function(t){if(e.contains(t))return t;var o=jt(t);return o&&e.contains(o)?o:(console.error("aria-hidden",t,"in not contained inside",e,". Doing nothing"),null)}).filter(function(t){return!!t})},$o=function(e,n,t,o){var r=Po(n,Array.isArray(e)?e:[e]);_e[t]||(_e[t]=new WeakMap);var i=_e[t],l=[],a=new Set,c=new Set(r),d=function(u){!u||a.has(u)||(a.add(u),d(u.parentNode))};r.forEach(d);var s=function(u){!u||c.has(u)||Array.prototype.forEach.call(u.children,function(p){if(a.has(p))s(p);else try{var v=p.getAttribute(o),h=v!==null&&v!=="false",g=(ae.get(p)||0)+1,m=(i.get(p)||0)+1;ae.set(p,g),i.set(p,m),l.push(p),g===1&&h&&Ee.set(p,!0),m===1&&p.setAttribute(t,"true"),h||p.setAttribute(o,"true")}catch(y){console.error("aria-hidden: cannot operate on ",p,y)}})};return s(n),a.clear(),Le++,function(){l.forEach(function(u){var p=ae.get(u)-1,v=i.get(u)-1;ae.set(u,p),i.set(u,v),p||(Ee.has(u)||u.removeAttribute(o),Ee.delete(u)),v||u.removeAttribute(t)}),Le--,Le||(ae=new WeakMap,ae=new WeakMap,Ee=new WeakMap,_e={})}},Ro=function(e,n,t){t===void 0&&(t="data-aria-hidden");var o=Array.from(Array.isArray(e)?e:[e]),r=To(e);return r?(o.push.apply(o,Array.from(r.querySelectorAll("[aria-live]"))),$o(o,r,t,"aria-hidden")):function(){return null}};function So(e){let n;F(()=>me(e),t=>{t?n=Ro(t):n&&n()}),bt(()=>{n&&n()})}let No=0;function Ve(e,n="radix"){const t=It({useId:void 0});return lt?`${n}-${lt()}`:t.useId?`${n}-${t.useId()}`:`${n}-${++No}`}function Fo(e){const n=C(),t=w(()=>{var r;return((r=n.value)==null?void 0:r.width)??0}),o=w(()=>{var r;return((r=n.value)==null?void 0:r.height)??0});return fe(()=>{const r=me(e);if(r){n.value={width:r.offsetWidth,height:r.offsetHeight};const i=new ResizeObserver(l=>{if(!Array.isArray(l)||!l.length)return;const a=l[0];let c,d;if("borderBoxSize"in a){const s=a.borderBoxSize,u=Array.isArray(s)?s[0]:s;c=u.inlineSize,d=u.blockSize}else c=r.offsetWidth,d=r.offsetHeight;n.value={width:c,height:d}});return i.observe(r,{box:"border-box"}),()=>i.unobserve(r)}else n.value=void 0}),{width:t,height:o}}function Lo(e,n){const t=C(e);function o(r){return n[t.value][r]??t.value}return{state:t,dispatch:r=>{t.value=o(r)}}}const Mo=O({name:"PrimitiveSlot",inheritAttrs:!1,setup(e,{attrs:n,slots:t}){return()=>{var o,r;if(!t.default)return null;const i=et(t.default()),l=i.findIndex(s=>s.type!==xt);if(l===-1)return i;const a=i[l];(o=a.props)==null||delete o.ref;const c=a.props?P(n,a.props):n;n.class&&(r=a.props)!=null&&r.class&&delete a.props.class;const d=ln(a,c);for(const s in c)s.startsWith("on")&&(d.props||(d.props={}),d.props[s]=c[s]);return i.length===1?d:(i[l]=d,i)}}}),W=O({name:"Primitive",inheritAttrs:!1,props:{asChild:{type:Boolean,default:!1},as:{type:[String,Object],default:"div"}},setup(e,{attrs:n,slots:t}){const o=e.asChild?"template":e.as;return typeof o=="string"&&["area","img","input"].includes(o)?()=>Be(o,n):o!=="template"?()=>Be(e.as,n,{default:t.default}):()=>Be(Mo,n,{default:t.default})}});function Io(e,n){var t;const o=C({}),r=C("none"),i=C(e),l=e.value?"mounted":"unmounted";let a;const c=((t=n.value)==null?void 0:t.ownerDocument.defaultView)??Ze,{state:d,dispatch:s}=Lo(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}}),u=m=>{var y;if(Q){const B=new CustomEvent(m,{bubbles:!1,cancelable:!1});(y=n.value)==null||y.dispatchEvent(B)}};F(e,async(m,y)=>{var B;const b=y!==m;if(await ne(),b){const $=r.value,R=De(n.value);m?(s("MOUNT"),u("enter"),R==="none"&&u("after-enter")):R==="none"||((B=o.value)==null?void 0:B.display)==="none"?(s("UNMOUNT"),u("leave"),u("after-leave")):y&&$!==R?(s("ANIMATION_OUT"),u("leave")):(s("UNMOUNT"),u("after-leave"))}},{immediate:!0});const p=m=>{const y=De(n.value),B=y.includes(m.animationName),b=d.value==="mounted"?"enter":"leave";if(m.target===n.value&&B&&(u(`after-${b}`),s("ANIMATION_END"),!i.value)){const $=n.value.style.animationFillMode;n.value.style.animationFillMode="forwards",a=c==null?void 0:c.setTimeout(()=>{var R;((R=n.value)==null?void 0:R.style.animationFillMode)==="forwards"&&(n.value.style.animationFillMode=$)})}m.target===n.value&&y==="none"&&s("ANIMATION_END")},v=m=>{m.target===n.value&&(r.value=De(n.value))},h=F(n,(m,y)=>{m?(o.value=getComputedStyle(m),m.addEventListener("animationstart",v),m.addEventListener("animationcancel",p),m.addEventListener("animationend",p)):(s("ANIMATION_END"),a!==void 0&&(c==null||c.clearTimeout(a)),y==null||y.removeEventListener("animationstart",v),y==null||y.removeEventListener("animationcancel",p),y==null||y.removeEventListener("animationend",p))},{immediate:!0}),g=F(d,()=>{const m=De(n.value);r.value=d.value==="mounted"?m:"none"});return bt(()=>{h(),g()}),{isPresent:w(()=>["mounted","unmountSuspended"].includes(d.value))}}function De(e){return e&&getComputedStyle(e).animationName||"none"}const tt=O({name:"Presence",props:{present:{type:Boolean,required:!0},forceMount:{type:Boolean}},slots:{},setup(e,{slots:n,expose:t}){var o;const{present:r,forceMount:i}=Ue(e),l=C(),{isPresent:a}=Io(r,l);t({present:a});let c=n.default({present:a});c=et(c||[]);const d=oe();if(c&&(c==null?void 0:c.length)>1){const s=(o=d==null?void 0:d.parent)!=null&&o.type.name?`<${d.parent.type.name} />`:"component";throw new Error([`Detected an invalid children for \`${s}\` 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()=>i.value||r.value||a.value?Be(n.default({present:a})[0],{ref:s=>{const u=me(s);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}}),[U,ko]=le("DialogRoot"),Wo=O({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:n}){const t=e,o=Mt(t,"open",n,{defaultValue:t.defaultOpen,passive:t.open===void 0}),r=C(),i=C(),{modal:l}=Ue(t);return ko({open:o,modal:l,openModal:()=>{o.value=!0},onOpenChange:a=>{o.value=a},onOpenToggle:()=>{o.value=!o.value},contentId:"",titleId:"",descriptionId:"",triggerElement:r,contentElement:i}),(a,c)=>E(a.$slots,"default",{open:f(o)})}}),nt=O({__name:"Teleport",props:{to:{default:"body"},disabled:{type:Boolean},forceMount:{type:Boolean}},setup(e){const n=po();return(t,o)=>f(n)||t.forceMount?(_(),D(Qt,{key:0,to:t.to,disabled:t.disabled},[E(t.$slots,"default")],8,["to","disabled"])):gt("",!0)}}),Pr=O({__name:"DialogPortal",props:{to:{},disabled:{type:Boolean},forceMount:{type:Boolean}},setup(e){const n=e;return(t,o)=>(_(),D(f(nt),G(J(n)),{default:x(()=>[E(t.$slots,"default")]),_:3},16))}}),Ho="dismissableLayer.pointerDownOutside",jo="dismissableLayer.focusOutside";function Vt(e,n){const t=n.closest("[data-dismissable-layer]"),o=e.dataset.dismissableLayer===""?e:e.querySelector("[data-dismissable-layer]"),r=Array.from(e.ownerDocument.querySelectorAll("[data-dismissable-layer]"));return!!(t&&o===t||r.indexOf(o){});return M(l=>{if(!Q)return;const a=async d=>{const s=d.target;if(n!=null&&n.value){if(Vt(n.value,s)){r.value=!1;return}if(d.target&&!r.value){let u=function(){Ft(Ho,e,p)};const p={originalEvent:d};d.pointerType==="touch"?(o.removeEventListener("click",i.value),i.value=u,o.addEventListener("click",i.value,{once:!0})):u()}else o.removeEventListener("click",i.value);r.value=!1}},c=window.setTimeout(()=>{o.addEventListener("pointerdown",a)},0);l(()=>{window.clearTimeout(c),o.removeEventListener("pointerdown",a),o.removeEventListener("click",i.value)})}),{onPointerDownCapture:()=>r.value=!0}}function Ko(e,n){var t;const o=((t=n==null?void 0:n.value)==null?void 0:t.ownerDocument)??(globalThis==null?void 0:globalThis.document),r=C(!1);return M(i=>{if(!Q)return;const l=async a=>{n!=null&&n.value&&(await ne(),!(!n.value||Vt(n.value,a.target))&&a.target&&!r.value&&Ft(jo,e,{originalEvent:a}))};o.addEventListener("focusin",l),i(()=>o.removeEventListener("focusin",l))}),{onFocusCapture:()=>r.value=!0,onBlurCapture:()=>r.value=!1}}const z=_t({layersRoot:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Kt=O({__name:"DismissableLayer",props:{disableOutsidePointerEvents:{type:Boolean,default:!1},asChild:{type:Boolean},as:{}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","dismiss"],setup(e,{emit:n}){const t=e,o=n,{forwardRef:r,currentElement:i}=A(),l=w(()=>{var h;return((h=i.value)==null?void 0:h.ownerDocument)??globalThis.document}),a=w(()=>z.layersRoot),c=w(()=>i.value?Array.from(a.value).indexOf(i.value):-1),d=w(()=>z.layersWithOutsidePointerEventsDisabled.size>0),s=w(()=>{const h=Array.from(a.value),[g]=[...z.layersWithOutsidePointerEventsDisabled].slice(-1),m=h.indexOf(g);return c.value>=m}),u=Vo(async h=>{const g=[...z.branches].some(m=>m==null?void 0:m.contains(h.target));!s.value||g||(o("pointerDownOutside",h),o("interactOutside",h),await ne(),h.defaultPrevented||o("dismiss"))},i),p=Ko(h=>{[...z.branches].some(g=>g==null?void 0:g.contains(h.target))||(o("focusOutside",h),o("interactOutside",h),h.defaultPrevented||o("dismiss"))},i);fo("Escape",h=>{c.value===a.value.size-1&&(o("escapeKeyDown",h),h.defaultPrevented||o("dismiss"))});let v;return M(h=>{i.value&&(t.disableOutsidePointerEvents&&(z.layersWithOutsidePointerEventsDisabled.size===0&&(v=l.value.body.style.pointerEvents,l.value.body.style.pointerEvents="none"),z.layersWithOutsidePointerEventsDisabled.add(i.value)),a.value.add(i.value),h(()=>{t.disableOutsidePointerEvents&&z.layersWithOutsidePointerEventsDisabled.size===1&&(l.value.body.style.pointerEvents=v)}))}),M(h=>{h(()=>{i.value&&(a.value.delete(i.value),z.layersWithOutsidePointerEventsDisabled.delete(i.value))})}),(h,g)=>(_(),D(f(W),{ref:f(r),"as-child":h.asChild,as:h.as,"data-dismissable-layer":"",style:Ye({pointerEvents:d.value?s.value?"auto":"none":void 0}),onFocusCapture:f(p).onFocusCapture,onBlurCapture:f(p).onBlurCapture,onPointerdownCapture:f(u).onPointerDownCapture},{default:x(()=>[E(h.$slots,"default")]),_:3},8,["as-child","as","style","onFocusCapture","onBlurCapture","onPointerdownCapture"]))}}),Me="focusScope.autoFocusOnMount",Ie="focusScope.autoFocusOnUnmount",ft={bubbles:!1,cancelable:!0};function zo(e,{select:n=!1}={}){const t=X();for(const o of e)if(Y(o,{select:n}),X()!==t)return!0}function Uo(e){const n=zt(e),t=pt(n,e),o=pt(n.reverse(),e);return[t,o]}function zt(e){const n=[],t=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const r=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||r?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;t.nextNode();)n.push(t.currentNode);return n}function pt(e,n){for(const t of e)if(!Yo(t,{upTo:n}))return t}function Yo(e,{upTo:n}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(n!==void 0&&e===n)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Xo(e){return e instanceof HTMLInputElement&&"select"in e}function Y(e,{select:n=!1}={}){if(e&&e.focus){const t=X();e.focus({preventScroll:!0}),e!==t&&Xo(e)&&n&&e.select()}}const qo=eo(()=>C([]));function Go(){const e=qo();return{add(n){const t=e.value[0];n!==t&&(t==null||t.pause()),e.value=vt(e.value,n),e.value.unshift(n)},remove(n){var t;e.value=vt(e.value,n),(t=e.value[0])==null||t.resume()}}}function vt(e,n){const t=[...e],o=t.indexOf(n);return o!==-1&&t.splice(o,1),t}function Jo(e){return e.filter(n=>n.tagName!=="A")}const Qo=O({__name:"FocusScope",props:{loop:{type:Boolean,default:!1},trapped:{type:Boolean,default:!1},asChild:{type:Boolean},as:{}},emits:["mountAutoFocus","unmountAutoFocus"],setup(e,{emit:n}){const t=e,o=n,{currentRef:r,currentElement:i}=A(),l=C(null),a=Go(),c=_t({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}});M(s=>{if(!Q)return;const u=i.value;if(!t.trapped)return;function p(m){if(c.paused||!u)return;const y=m.target;u.contains(y)?l.value=y:Y(l.value,{select:!0})}function v(m){if(c.paused||!u)return;const y=m.relatedTarget;y!==null&&(u.contains(y)||Y(l.value,{select:!0}))}function h(m){u.contains(l.value)||Y(u)}document.addEventListener("focusin",p),document.addEventListener("focusout",v);const g=new MutationObserver(h);u&&g.observe(u,{childList:!0,subtree:!0}),s(()=>{document.removeEventListener("focusin",p),document.removeEventListener("focusout",v),g.disconnect()})}),M(async s=>{const u=i.value;if(await ne(),!u)return;a.add(c);const p=X();if(!u.contains(p)){const v=new CustomEvent(Me,ft);u.addEventListener(Me,h=>o("mountAutoFocus",h)),u.dispatchEvent(v),v.defaultPrevented||(zo(Jo(zt(u)),{select:!0}),X()===p&&Y(u))}s(()=>{u.removeEventListener(Me,g=>o("mountAutoFocus",g));const v=new CustomEvent(Ie,ft),h=g=>{o("unmountAutoFocus",g)};u.addEventListener(Ie,h),u.dispatchEvent(v),setTimeout(()=>{v.defaultPrevented||Y(p??document.body,{select:!0}),u.removeEventListener(Ie,h),a.remove(c)},0)})});function d(s){if(!t.loop&&!t.trapped||c.paused)return;const u=s.key==="Tab"&&!s.altKey&&!s.ctrlKey&&!s.metaKey,p=X();if(u&&p){const v=s.currentTarget,[h,g]=Uo(v);h&&g?!s.shiftKey&&p===g?(s.preventDefault(),t.loop&&Y(h,{select:!0})):s.shiftKey&&p===h&&(s.preventDefault(),t.loop&&Y(g,{select:!0})):p===v&&s.preventDefault()}}return(s,u)=>(_(),D(f(W),{ref_key:"currentRef",ref:r,tabindex:"-1","as-child":s.asChild,as:s.as,onKeydown:d},{default:x(()=>[E(s.$slots,"default")]),_:3},8,["as-child","as"]))}});function Zo(e){return e?"open":"closed"}const Ut=O({__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:n}){const t=e,o=n,r=U(),{forwardRef:i,currentElement:l}=A();return r.titleId||(r.titleId=Ke(void 0,"radix-vue-dialog-title")),r.descriptionId||(r.descriptionId=Ke(void 0,"radix-vue-dialog-description")),fe(()=>{r.contentElement=l,X()!==document.body&&(r.triggerElement.value=X())}),(a,c)=>(_(),D(f(Qo),{"as-child":"",loop:"",trapped:t.trapFocus,onMountAutoFocus:c[5]||(c[5]=d=>o("openAutoFocus",d)),onUnmountAutoFocus:c[6]||(c[6]=d=>o("closeAutoFocus",d))},{default:x(()=>[ee(f(Kt),P({id:f(r).contentId,ref:f(i),as:a.as,"as-child":a.asChild,"disable-outside-pointer-events":a.disableOutsidePointerEvents,role:"dialog","aria-describedby":f(r).descriptionId,"aria-labelledby":f(r).titleId,"data-state":f(Zo)(f(r).open.value)},a.$attrs,{onDismiss:c[0]||(c[0]=d=>f(r).onOpenChange(!1)),onEscapeKeyDown:c[1]||(c[1]=d=>o("escapeKeyDown",d)),onFocusOutside:c[2]||(c[2]=d=>o("focusOutside",d)),onInteractOutside:c[3]||(c[3]=d=>o("interactOutside",d)),onPointerDownOutside:c[4]||(c[4]=d=>o("pointerDownOutside",d))}),{default:x(()=>[E(a.$slots,"default")]),_:3},16,["id","as","as-child","disable-outside-pointer-events","aria-describedby","aria-labelledby","data-state"])]),_:3},8,["trapped"]))}}),er=O({__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:n}){const t=e,o=n,r=U(),i=ye(o),{forwardRef:l,currentElement:a}=A();return No(a),(c,d)=>(_(),D(Ut,P({...t,...f(i)},{ref:f(l),"trap-focus":f(r).open.value,"disable-outside-pointer-events":!0,onCloseAutoFocus:d[0]||(d[0]=s=>{var u;s.defaultPrevented||(s.preventDefault(),(u=f(r).triggerElement.value)==null||u.focus())}),onPointerDownOutside:d[1]||(d[1]=s=>{const u=s.detail.originalEvent,p=u.button===0&&u.ctrlKey===!0;(u.button===2||p)&&s.preventDefault()}),onFocusOutside:d[2]||(d[2]=s=>{s.preventDefault()})}),{default:x(()=>[E(c.$slots,"default")]),_:3},16,["trap-focus"]))}}),tr=O({__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:n}){const t=e,o=ye(n);A();const r=U(),i=C(!1),l=C(!1);return(a,c)=>(_(),D(Ut,P({...t,...f(o)},{"trap-focus":!1,"disable-outside-pointer-events":!1,onCloseAutoFocus:c[0]||(c[0]=d=>{var s;d.defaultPrevented||(i.value||(s=f(r).triggerElement.value)==null||s.focus(),d.preventDefault()),i.value=!1,l.value=!1}),onInteractOutside:c[1]||(c[1]=d=>{var s;d.defaultPrevented||(i.value=!0,d.detail.originalEvent.type==="pointerdown"&&(l.value=!0));const u=d.target;(s=f(r).triggerElement.value)!=null&&s.contains(u)&&d.preventDefault(),d.detail.originalEvent.type==="focusin"&&l.value&&d.preventDefault()})}),{default:x(()=>[E(a.$slots,"default")]),_:3},16))}}),nr=O({__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:n}){const t=e,o=n,r=U(),i=ye(o),{forwardRef:l}=A();return(a,c)=>(_(),D(f(tt),{present:a.forceMount||f(r).open.value},{default:x(()=>[f(r).modal.value?(_(),D(er,P({key:0,ref:f(l)},{...t,...f(i),...a.$attrs}),{default:x(()=>[E(a.$slots,"default")]),_:3},16)):(_(),D(tr,P({key:1,ref:f(l)},{...t,...f(i),...a.$attrs}),{default:x(()=>[E(a.$slots,"default")]),_:3},16))]),_:3},8,["present"]))}}),or=O({__name:"DialogOverlayImpl",props:{asChild:{type:Boolean},as:{}},setup(e){const n=U();return bo(!0),A(),(t,o)=>(_(),D(f(W),{as:t.as,"as-child":t.asChild,"data-state":f(n).open.value?"open":"closed",style:{"pointer-events":"auto"}},{default:x(()=>[E(t.$slots,"default")]),_:3},8,["as","as-child","data-state"]))}}),rr=O({__name:"DialogOverlay",props:{forceMount:{type:Boolean},asChild:{type:Boolean},as:{}},setup(e){const n=U(),{forwardRef:t}=A();return(o,r)=>{var i;return(i=f(n))!=null&&i.modal.value?(_(),D(f(tt),{key:0,present:o.forceMount||f(n).open.value},{default:x(()=>[ee(or,P(o.$attrs,{ref:f(t),as:o.as,"as-child":o.asChild}),{default:x(()=>[E(o.$slots,"default")]),_:3},16,["as","as-child"])]),_:3},8,["present"])):gt("",!0)}}}),Yt=O({__name:"DialogClose",props:{asChild:{type:Boolean},as:{default:"button"}},setup(e){const n=e;A();const t=U();return(o,r)=>(_(),D(f(W),P(n,{type:o.as==="button"?"button":void 0,onClick:r[0]||(r[0]=i=>f(t).onOpenChange(!1))}),{default:x(()=>[E(o.$slots,"default")]),_:3},16,["type"]))}}),lr=O({__name:"DialogTitle",props:{asChild:{type:Boolean},as:{default:"h2"}},setup(e){const n=e,t=U();return A(),(o,r)=>(_(),D(f(W),P(n,{id:f(t).titleId}),{default:x(()=>[E(o.$slots,"default")]),_:3},16,["id"]))}}),ir=O({__name:"DialogDescription",props:{asChild:{type:Boolean},as:{default:"p"}},setup(e){const n=e;A();const t=U();return(o,r)=>(_(),D(f(W),P(n,{id:f(t).descriptionId}),{default:x(()=>[E(o.$slots,"default")]),_:3},16,["id"]))}}),$r=O({__name:"AlertDialogRoot",props:{open:{type:Boolean},defaultOpen:{type:Boolean}},emits:["update:open"],setup(e,{emit:n}){const t=Ht(e,n);return A(),(o,r)=>(_(),D(f(Wo),P(f(t),{modal:!0}),{default:x(()=>[E(o.$slots,"default")]),_:3},16))}}),Rr=O({__name:"AlertDialogPortal",props:{to:{},disabled:{type:Boolean},forceMount:{type:Boolean}},setup(e){const n=e;return(t,o)=>(_(),D(f(nt),G(J(n)),{default:x(()=>[E(t.$slots,"default")]),_:3},16))}}),[ar,sr]=le("AlertDialogContent"),Nr=O({__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:n}){const t=e,o=ye(n);A();const r=C();return sr({onCancelElementChange:i=>{r.value=i}}),(i,l)=>(_(),D(f(nr),P({...t,...f(o)},{role:"alertdialog",onPointerDownOutside:l[0]||(l[0]=ke(()=>{},["prevent"])),onInteractOutside:l[1]||(l[1]=ke(()=>{},["prevent"])),onOpenAutoFocus:l[2]||(l[2]=()=>{ne(()=>{var a;(a=r.value)==null||a.focus({preventScroll:!0})})})}),{default:x(()=>[E(i.$slots,"default")]),_:3},16))}}),Sr=O({__name:"AlertDialogOverlay",props:{forceMount:{type:Boolean},asChild:{type:Boolean},as:{}},setup(e){const n=e;return A(),(t,o)=>(_(),D(f(rr),G(J(n)),{default:x(()=>[E(t.$slots,"default")]),_:3},16))}}),Fr=O({__name:"AlertDialogCancel",props:{asChild:{type:Boolean},as:{default:"button"}},setup(e){const n=e,t=ar(),{forwardRef:o,currentElement:r}=A();return fe(()=>{t.onCancelElementChange(r.value)}),(i,l)=>(_(),D(f(Yt),P(n,{ref:f(o)}),{default:x(()=>[E(i.$slots,"default")]),_:3},16))}}),Lr=O({__name:"AlertDialogTitle",props:{asChild:{type:Boolean},as:{default:"h2"}},setup(e){const n=e;return A(),(t,o)=>(_(),D(f(lr),G(J(n)),{default:x(()=>[E(t.$slots,"default")]),_:3},16))}}),Mr=O({__name:"AlertDialogDescription",props:{asChild:{type:Boolean},as:{default:"p"}},setup(e){const n=e;return A(),(t,o)=>(_(),D(f(ir),G(J(n)),{default:x(()=>[E(t.$slots,"default")]),_:3},16))}}),Ir=O({__name:"AlertDialogAction",props:{asChild:{type:Boolean},as:{default:"button"}},setup(e){const n=e;return A(),(t,o)=>(_(),D(f(Yt),G(J(n)),{default:x(()=>[E(t.$slots,"default")]),_:3},16))}}),[Xt,ur]=le("PopperRoot"),dr=O({inheritAttrs:!1,__name:"PopperRoot",setup(e){const n=C();return ur({anchor:n,onAnchorChange:t=>n.value=t}),(t,o)=>E(t.$slots,"default")}}),cr=O({__name:"PopperAnchor",props:{element:{},asChild:{type:Boolean},as:{}},setup(e){const n=e,{forwardRef:t,currentElement:o}=A(),r=Xt();return M(()=>{r.onAnchorChange(n.element??o.value)}),(i,l)=>(_(),D(f(W),{ref:f(t),as:i.as,"as-child":i.asChild},{default:x(()=>[E(i.$slots,"default")]),_:3},8,["as","as-child"]))}});function fr(e){return e!==null}function pr(e){return{name:"transformOrigin",options:e,fn(n){var t,o,r;const{placement:i,rects:l,middlewareData:a}=n,c=((t=a.arrow)==null?void 0:t.centerOffset)!==0,d=c?0:e.arrowWidth,s=c?0:e.arrowHeight,[u,p]=ze(i),v={start:"0%",center:"50%",end:"100%"}[p],h=(((o=a.arrow)==null?void 0:o.x)??0)+d/2,g=(((r=a.arrow)==null?void 0:r.y)??0)+s/2;let m="",y="";return u==="bottom"?(m=c?v:`${h}px`,y=`${-s}px`):u==="top"?(m=c?v:`${h}px`,y=`${l.floating.height+s}px`):u==="right"?(m=`${-s}px`,y=c?v:`${g}px`):u==="left"&&(m=`${l.floating.width+s}px`,y=c?v:`${g}px`),{data:{x:m,y}}}}}function ze(e){const[n,t="center"]=e.split("-");return[n,t]}const vr={side:"bottom",sideOffset:0,align:"center",alignOffset:0,arrowPadding:0,avoidCollisions:!0,collisionBoundary:()=>[],collisionPadding:0,sticky:"partial",hideWhenDetached:!1,updatePositionStrategy:"optimized",prioritizePosition:!1},[hr,mr]=le("PopperContent"),yr=O({inheritAttrs:!1,__name:"PopperContent",props:cn({side:{},sideOffset:{},align:{},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean},updatePositionStrategy:{},prioritizePosition:{type:Boolean},asChild:{type:Boolean},as:{}},{...vr}),emits:["placed"],setup(e,{emit:n}){const t=e,o=n,r=Xt(),{forwardRef:i,currentElement:l}=A(),a=C(),c=C(),{width:d,height:s}=Fo(c),u=w(()=>t.side+(t.align!=="center"?`-${t.align}`:"")),p=w(()=>typeof t.collisionPadding=="number"?t.collisionPadding:{top:0,right:0,bottom:0,left:0,...t.collisionPadding}),v=w(()=>Array.isArray(t.collisionBoundary)?t.collisionBoundary:[t.collisionBoundary]),h=w(()=>({padding:p.value,boundary:v.value.filter(fr),altBoundary:v.value.length>0})),g=Qn(()=>[jn({mainAxis:t.sideOffset+s.value,alignmentAxis:t.alignOffset}),t.prioritizePosition&&t.avoidCollisions&&ut({...h.value}),t.avoidCollisions&&Vn({mainAxis:!0,crossAxis:!!t.prioritizePosition,limiter:t.sticky==="partial"?Yn():void 0,...h.value}),!t.prioritizePosition&&t.avoidCollisions&&ut({...h.value}),Kn({...h.value,apply:({elements:N,rects:rt,availableWidth:we,availableHeight:be})=>{const{width:xe,height:Jt}=rt.reference,Ce=N.floating.style;Ce.setProperty("--radix-popper-available-width",`${we}px`),Ce.setProperty("--radix-popper-available-height",`${be}px`),Ce.setProperty("--radix-popper-anchor-width",`${xe}px`),Ce.setProperty("--radix-popper-anchor-height",`${Jt}px`)}}),c.value&&Gn({element:c.value,padding:t.arrowPadding}),pr({arrowWidth:d.value,arrowHeight:s.value}),t.hideWhenDetached&&zn({strategy:"referenceHidden",...h.value})]),{floatingStyles:m,placement:y,isPositioned:B,middlewareData:b}=Jn(r.anchor,a,{strategy:"fixed",placement:u,whileElementsMounted:(...N)=>Hn(...N,{animationFrame:t.updatePositionStrategy==="always"}),middleware:g}),$=w(()=>ze(y.value)[0]),R=w(()=>ze(y.value)[1]);fn(()=>{B.value&&o("placed")});const L=w(()=>{var N;return((N=b.value.arrow)==null?void 0:N.centerOffset)!==0}),T=C("");M(()=>{l.value&&(T.value=window.getComputedStyle(l.value).zIndex)});const H=w(()=>{var N;return((N=b.value.arrow)==null?void 0:N.x)??0}),ge=w(()=>{var N;return((N=b.value.arrow)==null?void 0:N.y)??0});return mr({placedSide:$,onArrowChange:N=>c.value=N,arrowX:H,arrowY:ge,shouldHideArrow:L}),(N,rt)=>{var we,be,xe;return _(),Ot("div",{ref_key:"floatingRef",ref:a,"data-radix-popper-content-wrapper":"",style:Ye({...f(m),transform:f(B)?f(m).transform:"translate(0, -200%)",minWidth:"max-content",zIndex:T.value,"--radix-popper-transform-origin":[(we=f(b).transformOrigin)==null?void 0:we.x,(be=f(b).transformOrigin)==null?void 0:be.y].join(" "),...((xe=f(b).hide)==null?void 0:xe.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}})},[ee(f(W),P({ref:f(i)},N.$attrs,{"as-child":t.asChild,as:N.as,"data-side":$.value,"data-align":R.value,style:{animation:f(B)?void 0:"none"}}),{default:x(()=>[E(N.$slots,"default")]),_:3},16,["as-child","as","data-side","data-align","style"])],4)}}}),gr=pn("polygon",{points:"0,0 30,0 15,10"},null,-1),wr=O({__name:"Arrow",props:{width:{default:10},height:{default:5},asChild:{type:Boolean},as:{default:"svg"}},setup(e){const n=e;return A(),(t,o)=>(_(),D(f(W),P(n,{width:t.width,height:t.height,viewBox:t.asChild?void 0:"0 0 30 10",preserveAspectRatio:t.asChild?void 0:"none"}),{default:x(()=>[E(t.$slots,"default",{},()=>[gr])]),_:3},16,["width","height","viewBox","preserveAspectRatio"]))}}),br={top:"bottom",right:"left",bottom:"top",left:"right"},xr=O({inheritAttrs:!1,__name:"PopperArrow",props:{width:{},height:{},asChild:{type:Boolean},as:{default:"svg"}},setup(e){const{forwardRef:n}=A(),t=hr(),o=w(()=>br[t.placedSide.value]);return(r,i)=>{var l,a,c,d;return _(),Ot("span",{ref:s=>{f(t).onArrowChange(s)},style:Ye({position:"absolute",left:(l=f(t).arrowX)!=null&&l.value?`${(a=f(t).arrowX)==null?void 0:a.value}px`:void 0,top:(c=f(t).arrowY)!=null&&c.value?`${(d=f(t).arrowY)==null?void 0:d.value}px`:void 0,[o.value]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[f(t).placedSide.value],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[f(t).placedSide.value],visibility:f(t).shouldHideArrow.value?"hidden":void 0})},[ee(wr,P(r.$attrs,{ref:f(n),style:{display:"block"},as:r.as,"as-child":r.asChild,width:r.width,height:r.height}),{default:x(()=>[E(r.$slots,"default")]),_:3},16,["as","as-child","width","height"])],4)}}}),Cr=O({__name:"VisuallyHidden",props:{asChild:{type:Boolean},as:{default:"span"}},setup(e){return A(),(n,t)=>(_(),D(f(W),{as:n.as,"as-child":n.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:x(()=>[E(n.$slots,"default")]),_:3},8,["as","as-child"]))}});function Or(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}Or();const qt="tooltip.open",[ot,Er]=le("TooltipProvider"),kr=O({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 n=e,{delayDuration:t,skipDelayDuration:o,disableHoverableContent:r,disableClosingTrigger:i,ignoreNonKeyboardFocus:l,disabled:a}=Ue(n);A();const c=C(!0),d=C(!1),{start:s,stop:u}=Lt(()=>{c.value=!0},o,{immediate:!1});return Er({isOpenDelayed:c,delayDuration:t,onOpen(){u(),c.value=!1},onClose(){s()},isPointerInTransitRef:d,disableHoverableContent:r,disableClosingTrigger:i,disabled:a,ignoreNonKeyboardFocus:l}),(p,v)=>E(p.$slots,"default")}}),[Ne,_r]=le("TooltipRoot"),Wr=O({__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:n}){const t=e,o=n;A();const r=ot(),i=w(()=>t.disableHoverableContent??r.disableHoverableContent.value),l=w(()=>t.disableClosingTrigger??r.disableClosingTrigger.value),a=w(()=>t.disabled??r.disabled.value),c=w(()=>t.delayDuration??r.delayDuration.value),d=w(()=>t.ignoreNonKeyboardFocus??r.ignoreNonKeyboardFocus.value),s=Mt(t,"open",o,{defaultValue:t.defaultOpen,passive:t.open===void 0});F(s,b=>{r.onClose&&(b?(r.onOpen(),document.dispatchEvent(new CustomEvent(qt))):r.onClose())});const u=C(!1),p=C(),v=w(()=>s.value?u.value?"delayed-open":"instant-open":"closed"),{start:h,stop:g}=Lt(()=>{u.value=!0,s.value=!0},c,{immediate:!1});function m(){g(),u.value=!1,s.value=!0}function y(){g(),s.value=!1}function B(){h()}return _r({contentId:"",open:s,stateAttribute:v,trigger:p,onTriggerChange(b){p.value=b},onTriggerEnter(){r.isOpenDelayed.value?B():m()},onTriggerLeave(){i.value?y():g()},onOpen:m,onClose:y,disableHoverableContent:i,disableClosingTrigger:l,disabled:a,ignoreNonKeyboardFocus:d}),(b,$)=>(_(),D(f(dr),null,{default:x(()=>[E(b.$slots,"default",{open:f(s)})]),_:3}))}}),Hr=O({__name:"TooltipTrigger",props:{asChild:{type:Boolean},as:{default:"button"}},setup(e){const n=e,t=Ne(),o=ot();t.contentId||(t.contentId=Ke(void 0,"radix-vue-tooltip-content"));const{forwardRef:r,currentElement:i}=A(),l=C(!1),a=C(!1),c=w(()=>t.disabled.value?{}:{click:g,focus:v,pointermove:u,pointerleave:p,pointerdown:s,blur:h});fe(()=>{t.onTriggerChange(i.value)});function d(){setTimeout(()=>{l.value=!1},1)}function s(){l.value=!0,document.addEventListener("pointerup",d,{once:!0})}function u(m){m.pointerType!=="touch"&&!a.value&&!o.isPointerInTransitRef.value&&(t.onTriggerEnter(),a.value=!0)}function p(){t.onTriggerLeave(),a.value=!1}function v(m){var y,B;l.value||t.ignoreNonKeyboardFocus.value&&!((B=(y=m.target).matches)!=null&&B.call(y,":focus-visible"))||t.onOpen()}function h(){t.onClose()}function g(){t.disableClosingTrigger.value||t.onClose()}return(m,y)=>(_(),D(f(cr),{"as-child":""},{default:x(()=>[ee(f(W),P({ref:f(r),"aria-describedby":f(t).open.value?f(t).contentId:void 0,"data-state":f(t).stateAttribute.value,as:m.as,"as-child":n.asChild,"data-grace-area-trigger":""},tn(c.value)),{default:x(()=>[E(m.$slots,"default")]),_:3},16,["aria-describedby","data-state","as","as-child"])]),_:3}))}}),Gt=O({__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:n}){const t=e,o=n,r=Ne(),{forwardRef:i}=A(),l=an(),a=w(()=>{var s;return(s=l.default)==null?void 0:s.call(l)}),c=w(()=>{var s;if(t.ariaLabel)return t.ariaLabel;let u="";function p(v){typeof v.children=="string"&&v.type!==xt?u+=v.children:Array.isArray(v.children)&&v.children.forEach(h=>p(h))}return(s=a.value)==null||s.forEach(v=>p(v)),u}),d=w(()=>{const{ariaLabel:s,...u}=t;return u});return fe(()=>{Te(window,"scroll",s=>{const u=s.target;u!=null&&u.contains(r.trigger.value)&&r.onClose()}),Te(window,qt,r.onClose)}),(s,u)=>(_(),D(f(Kt),{"as-child":"","disable-outside-pointer-events":!1,onEscapeKeyDown:u[0]||(u[0]=p=>o("escapeKeyDown",p)),onPointerDownOutside:u[1]||(u[1]=p=>{var v;f(r).disableClosingTrigger.value&&(v=f(r).trigger.value)!=null&&v.contains(p.target)&&p.preventDefault(),o("pointerDownOutside",p)}),onFocusOutside:u[2]||(u[2]=ke(()=>{},["prevent"])),onDismiss:u[3]||(u[3]=p=>f(r).onClose())},{default:x(()=>[ee(f(yr),P({ref:f(i),"data-state":f(r).stateAttribute.value},{...s.$attrs,...d.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:x(()=>[E(s.$slots,"default"),ee(f(Cr),{id:f(r).contentId,role:"tooltip"},{default:x(()=>[sn(un(c.value),1)]),_:1},8,["id"])]),_:3},16,["data-state"])]),_:3}))}}),Dr=O({__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 n=Wt(e),{forwardRef:t,currentElement:o}=A(),{trigger:r,onClose:i}=Ne(),l=ot(),{isPointerInTransit:a,onPointerExit:c}=Co(r,o);return l.isPointerInTransitRef=a,c(()=>{i()}),(d,s)=>(_(),D(Gt,P({ref:f(t)},f(n)),{default:x(()=>[E(d.$slots,"default")]),_:3},16))}}),jr=O({__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:n}){const t=e,o=n,r=Ne(),i=Ht(t,o),{forwardRef:l}=A();return(a,c)=>(_(),D(f(tt),{present:a.forceMount||f(r).open.value},{default:x(()=>[(_(),D(nn(f(r).disableHoverableContent.value?Gt:Dr),P({ref:f(l)},f(i)),{default:x(()=>[E(a.$slots,"default")]),_:3},16))]),_:3},8,["present"]))}}),Vr=O({__name:"TooltipArrow",props:{width:{default:10},height:{default:5},asChild:{type:Boolean},as:{default:"svg"}},setup(e){const n=e;return A(),(t,o)=>(_(),D(f(xr),G(J(n)),{default:x(()=>[E(t.$slots,"default")]),_:3},16))}}),Kr=O({__name:"TooltipPortal",props:{to:{},disabled:{type:Boolean},forceMount:{type:Boolean}},setup(e){const n=e;return(t,o)=>(_(),D(f(nt),G(J(n)),{default:x(()=>[E(t.$slots,"default")]),_:3},16))}});export{rr as $,Rr as A,lr as B,Mr as F,Vr as G,kr as H,Pr as I,Fr as M,Ir as N,Nr as O,nr as P,$r as T,jr as U,Lr as V,Wr as W,Hr as j,Sr as k,Wo as n,Kr as q}; +`))}return()=>i.value||r.value||a.value?Be(n.default({present:a})[0],{ref:s=>{const u=me(s);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}}),[U,ko]=le("DialogRoot"),Wo=O({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:n}){const t=e,o=Mt(t,"open",n,{defaultValue:t.defaultOpen,passive:t.open===void 0}),r=C(),i=C(),{modal:l}=Ue(t);return ko({open:o,modal:l,openModal:()=>{o.value=!0},onOpenChange:a=>{o.value=a},onOpenToggle:()=>{o.value=!o.value},contentId:"",titleId:"",descriptionId:"",triggerElement:r,contentElement:i}),(a,c)=>E(a.$slots,"default",{open:f(o)})}}),nt=O({__name:"Teleport",props:{to:{default:"body"},disabled:{type:Boolean},forceMount:{type:Boolean}},setup(e){const n=po();return(t,o)=>f(n)||t.forceMount?(_(),D(Qt,{key:0,to:t.to,disabled:t.disabled},[E(t.$slots,"default")],8,["to","disabled"])):gt("",!0)}}),Pr=O({__name:"DialogPortal",props:{to:{},disabled:{type:Boolean},forceMount:{type:Boolean}},setup(e){const n=e;return(t,o)=>(_(),D(f(nt),G(J(n)),{default:x(()=>[E(t.$slots,"default")]),_:3},16))}}),Ho="dismissableLayer.pointerDownOutside",jo="dismissableLayer.focusOutside";function Kt(e,n){const t=n.closest("[data-dismissable-layer]"),o=e.dataset.dismissableLayer===""?e:e.querySelector("[data-dismissable-layer]"),r=Array.from(e.ownerDocument.querySelectorAll("[data-dismissable-layer]"));return!!(t&&o===t||r.indexOf(o){});return M(l=>{if(!Q)return;const a=async d=>{const s=d.target;if(n!=null&&n.value){if(Kt(n.value,s)){r.value=!1;return}if(d.target&&!r.value){let u=function(){Ft(Ho,e,p)};const p={originalEvent:d};d.pointerType==="touch"?(o.removeEventListener("click",i.value),i.value=u,o.addEventListener("click",i.value,{once:!0})):u()}else o.removeEventListener("click",i.value);r.value=!1}},c=window.setTimeout(()=>{o.addEventListener("pointerdown",a)},0);l(()=>{window.clearTimeout(c),o.removeEventListener("pointerdown",a),o.removeEventListener("click",i.value)})}),{onPointerDownCapture:()=>r.value=!0}}function Vo(e,n){var t;const o=((t=n==null?void 0:n.value)==null?void 0:t.ownerDocument)??(globalThis==null?void 0:globalThis.document),r=C(!1);return M(i=>{if(!Q)return;const l=async a=>{n!=null&&n.value&&(await ne(),!(!n.value||Kt(n.value,a.target))&&a.target&&!r.value&&Ft(jo,e,{originalEvent:a}))};o.addEventListener("focusin",l),i(()=>o.removeEventListener("focusin",l))}),{onFocusCapture:()=>r.value=!0,onBlurCapture:()=>r.value=!1}}const z=_t({layersRoot:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Vt=O({__name:"DismissableLayer",props:{disableOutsidePointerEvents:{type:Boolean,default:!1},asChild:{type:Boolean},as:{}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","dismiss"],setup(e,{emit:n}){const t=e,o=n,{forwardRef:r,currentElement:i}=A(),l=w(()=>{var h;return((h=i.value)==null?void 0:h.ownerDocument)??globalThis.document}),a=w(()=>z.layersRoot),c=w(()=>i.value?Array.from(a.value).indexOf(i.value):-1),d=w(()=>z.layersWithOutsidePointerEventsDisabled.size>0),s=w(()=>{const h=Array.from(a.value),[g]=[...z.layersWithOutsidePointerEventsDisabled].slice(-1),m=h.indexOf(g);return c.value>=m}),u=Ko(async h=>{const g=[...z.branches].some(m=>m==null?void 0:m.contains(h.target));!s.value||g||(o("pointerDownOutside",h),o("interactOutside",h),await ne(),h.defaultPrevented||o("dismiss"))},i),p=Vo(h=>{[...z.branches].some(g=>g==null?void 0:g.contains(h.target))||(o("focusOutside",h),o("interactOutside",h),h.defaultPrevented||o("dismiss"))},i);fo("Escape",h=>{c.value===a.value.size-1&&(o("escapeKeyDown",h),h.defaultPrevented||o("dismiss"))});let v;return M(h=>{i.value&&(t.disableOutsidePointerEvents&&(z.layersWithOutsidePointerEventsDisabled.size===0&&(v=l.value.body.style.pointerEvents,l.value.body.style.pointerEvents="none"),z.layersWithOutsidePointerEventsDisabled.add(i.value)),a.value.add(i.value),h(()=>{t.disableOutsidePointerEvents&&z.layersWithOutsidePointerEventsDisabled.size===1&&(l.value.body.style.pointerEvents=v)}))}),M(h=>{h(()=>{i.value&&(a.value.delete(i.value),z.layersWithOutsidePointerEventsDisabled.delete(i.value))})}),(h,g)=>(_(),D(f(W),{ref:f(r),"as-child":h.asChild,as:h.as,"data-dismissable-layer":"",style:Ye({pointerEvents:d.value?s.value?"auto":"none":void 0}),onFocusCapture:f(p).onFocusCapture,onBlurCapture:f(p).onBlurCapture,onPointerdownCapture:f(u).onPointerDownCapture},{default:x(()=>[E(h.$slots,"default")]),_:3},8,["as-child","as","style","onFocusCapture","onBlurCapture","onPointerdownCapture"]))}}),Me="focusScope.autoFocusOnMount",Ie="focusScope.autoFocusOnUnmount",ft={bubbles:!1,cancelable:!0};function zo(e,{select:n=!1}={}){const t=X();for(const o of e)if(Y(o,{select:n}),X()!==t)return!0}function Uo(e){const n=zt(e),t=pt(n,e),o=pt(n.reverse(),e);return[t,o]}function zt(e){const n=[],t=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const r=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||r?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;t.nextNode();)n.push(t.currentNode);return n}function pt(e,n){for(const t of e)if(!Yo(t,{upTo:n}))return t}function Yo(e,{upTo:n}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(n!==void 0&&e===n)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Xo(e){return e instanceof HTMLInputElement&&"select"in e}function Y(e,{select:n=!1}={}){if(e&&e.focus){const t=X();e.focus({preventScroll:!0}),e!==t&&Xo(e)&&n&&e.select()}}const qo=eo(()=>C([]));function Go(){const e=qo();return{add(n){const t=e.value[0];n!==t&&(t==null||t.pause()),e.value=vt(e.value,n),e.value.unshift(n)},remove(n){var t;e.value=vt(e.value,n),(t=e.value[0])==null||t.resume()}}}function vt(e,n){const t=[...e],o=t.indexOf(n);return o!==-1&&t.splice(o,1),t}function Jo(e){return e.filter(n=>n.tagName!=="A")}const Qo=O({__name:"FocusScope",props:{loop:{type:Boolean,default:!1},trapped:{type:Boolean,default:!1},asChild:{type:Boolean},as:{}},emits:["mountAutoFocus","unmountAutoFocus"],setup(e,{emit:n}){const t=e,o=n,{currentRef:r,currentElement:i}=A(),l=C(null),a=Go(),c=_t({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}});M(s=>{if(!Q)return;const u=i.value;if(!t.trapped)return;function p(m){if(c.paused||!u)return;const y=m.target;u.contains(y)?l.value=y:Y(l.value,{select:!0})}function v(m){if(c.paused||!u)return;const y=m.relatedTarget;y!==null&&(u.contains(y)||Y(l.value,{select:!0}))}function h(m){u.contains(l.value)||Y(u)}document.addEventListener("focusin",p),document.addEventListener("focusout",v);const g=new MutationObserver(h);u&&g.observe(u,{childList:!0,subtree:!0}),s(()=>{document.removeEventListener("focusin",p),document.removeEventListener("focusout",v),g.disconnect()})}),M(async s=>{const u=i.value;if(await ne(),!u)return;a.add(c);const p=X();if(!u.contains(p)){const v=new CustomEvent(Me,ft);u.addEventListener(Me,h=>o("mountAutoFocus",h)),u.dispatchEvent(v),v.defaultPrevented||(zo(Jo(zt(u)),{select:!0}),X()===p&&Y(u))}s(()=>{u.removeEventListener(Me,g=>o("mountAutoFocus",g));const v=new CustomEvent(Ie,ft),h=g=>{o("unmountAutoFocus",g)};u.addEventListener(Ie,h),u.dispatchEvent(v),setTimeout(()=>{v.defaultPrevented||Y(p??document.body,{select:!0}),u.removeEventListener(Ie,h),a.remove(c)},0)})});function d(s){if(!t.loop&&!t.trapped||c.paused)return;const u=s.key==="Tab"&&!s.altKey&&!s.ctrlKey&&!s.metaKey,p=X();if(u&&p){const v=s.currentTarget,[h,g]=Uo(v);h&&g?!s.shiftKey&&p===g?(s.preventDefault(),t.loop&&Y(h,{select:!0})):s.shiftKey&&p===h&&(s.preventDefault(),t.loop&&Y(g,{select:!0})):p===v&&s.preventDefault()}}return(s,u)=>(_(),D(f(W),{ref_key:"currentRef",ref:r,tabindex:"-1","as-child":s.asChild,as:s.as,onKeydown:d},{default:x(()=>[E(s.$slots,"default")]),_:3},8,["as-child","as"]))}});function Zo(e){return e?"open":"closed"}const Ut=O({__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:n}){const t=e,o=n,r=U(),{forwardRef:i,currentElement:l}=A();return r.titleId||(r.titleId=Ve(void 0,"radix-vue-dialog-title")),r.descriptionId||(r.descriptionId=Ve(void 0,"radix-vue-dialog-description")),fe(()=>{r.contentElement=l,X()!==document.body&&(r.triggerElement.value=X())}),(a,c)=>(_(),D(f(Qo),{"as-child":"",loop:"",trapped:t.trapFocus,onMountAutoFocus:c[5]||(c[5]=d=>o("openAutoFocus",d)),onUnmountAutoFocus:c[6]||(c[6]=d=>o("closeAutoFocus",d))},{default:x(()=>[ee(f(Vt),P({id:f(r).contentId,ref:f(i),as:a.as,"as-child":a.asChild,"disable-outside-pointer-events":a.disableOutsidePointerEvents,role:"dialog","aria-describedby":f(r).descriptionId,"aria-labelledby":f(r).titleId,"data-state":f(Zo)(f(r).open.value)},a.$attrs,{onDismiss:c[0]||(c[0]=d=>f(r).onOpenChange(!1)),onEscapeKeyDown:c[1]||(c[1]=d=>o("escapeKeyDown",d)),onFocusOutside:c[2]||(c[2]=d=>o("focusOutside",d)),onInteractOutside:c[3]||(c[3]=d=>o("interactOutside",d)),onPointerDownOutside:c[4]||(c[4]=d=>o("pointerDownOutside",d))}),{default:x(()=>[E(a.$slots,"default")]),_:3},16,["id","as","as-child","disable-outside-pointer-events","aria-describedby","aria-labelledby","data-state"])]),_:3},8,["trapped"]))}}),er=O({__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:n}){const t=e,o=n,r=U(),i=ye(o),{forwardRef:l,currentElement:a}=A();return So(a),(c,d)=>(_(),D(Ut,P({...t,...f(i)},{ref:f(l),"trap-focus":f(r).open.value,"disable-outside-pointer-events":!0,onCloseAutoFocus:d[0]||(d[0]=s=>{var u;s.defaultPrevented||(s.preventDefault(),(u=f(r).triggerElement.value)==null||u.focus())}),onPointerDownOutside:d[1]||(d[1]=s=>{const u=s.detail.originalEvent,p=u.button===0&&u.ctrlKey===!0;(u.button===2||p)&&s.preventDefault()}),onFocusOutside:d[2]||(d[2]=s=>{s.preventDefault()})}),{default:x(()=>[E(c.$slots,"default")]),_:3},16,["trap-focus"]))}}),tr=O({__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:n}){const t=e,o=ye(n);A();const r=U(),i=C(!1),l=C(!1);return(a,c)=>(_(),D(Ut,P({...t,...f(o)},{"trap-focus":!1,"disable-outside-pointer-events":!1,onCloseAutoFocus:c[0]||(c[0]=d=>{var s;d.defaultPrevented||(i.value||(s=f(r).triggerElement.value)==null||s.focus(),d.preventDefault()),i.value=!1,l.value=!1}),onInteractOutside:c[1]||(c[1]=d=>{var s;d.defaultPrevented||(i.value=!0,d.detail.originalEvent.type==="pointerdown"&&(l.value=!0));const u=d.target;(s=f(r).triggerElement.value)!=null&&s.contains(u)&&d.preventDefault(),d.detail.originalEvent.type==="focusin"&&l.value&&d.preventDefault()})}),{default:x(()=>[E(a.$slots,"default")]),_:3},16))}}),nr=O({__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:n}){const t=e,o=n,r=U(),i=ye(o),{forwardRef:l}=A();return(a,c)=>(_(),D(f(tt),{present:a.forceMount||f(r).open.value},{default:x(()=>[f(r).modal.value?(_(),D(er,P({key:0,ref:f(l)},{...t,...f(i),...a.$attrs}),{default:x(()=>[E(a.$slots,"default")]),_:3},16)):(_(),D(tr,P({key:1,ref:f(l)},{...t,...f(i),...a.$attrs}),{default:x(()=>[E(a.$slots,"default")]),_:3},16))]),_:3},8,["present"]))}}),or=O({__name:"DialogOverlayImpl",props:{asChild:{type:Boolean},as:{}},setup(e){const n=U();return bo(!0),A(),(t,o)=>(_(),D(f(W),{as:t.as,"as-child":t.asChild,"data-state":f(n).open.value?"open":"closed",style:{"pointer-events":"auto"}},{default:x(()=>[E(t.$slots,"default")]),_:3},8,["as","as-child","data-state"]))}}),rr=O({__name:"DialogOverlay",props:{forceMount:{type:Boolean},asChild:{type:Boolean},as:{}},setup(e){const n=U(),{forwardRef:t}=A();return(o,r)=>{var i;return(i=f(n))!=null&&i.modal.value?(_(),D(f(tt),{key:0,present:o.forceMount||f(n).open.value},{default:x(()=>[ee(or,P(o.$attrs,{ref:f(t),as:o.as,"as-child":o.asChild}),{default:x(()=>[E(o.$slots,"default")]),_:3},16,["as","as-child"])]),_:3},8,["present"])):gt("",!0)}}}),Yt=O({__name:"DialogClose",props:{asChild:{type:Boolean},as:{default:"button"}},setup(e){const n=e;A();const t=U();return(o,r)=>(_(),D(f(W),P(n,{type:o.as==="button"?"button":void 0,onClick:r[0]||(r[0]=i=>f(t).onOpenChange(!1))}),{default:x(()=>[E(o.$slots,"default")]),_:3},16,["type"]))}}),lr=O({__name:"DialogTitle",props:{asChild:{type:Boolean},as:{default:"h2"}},setup(e){const n=e,t=U();return A(),(o,r)=>(_(),D(f(W),P(n,{id:f(t).titleId}),{default:x(()=>[E(o.$slots,"default")]),_:3},16,["id"]))}}),ir=O({__name:"DialogDescription",props:{asChild:{type:Boolean},as:{default:"p"}},setup(e){const n=e;A();const t=U();return(o,r)=>(_(),D(f(W),P(n,{id:f(t).descriptionId}),{default:x(()=>[E(o.$slots,"default")]),_:3},16,["id"]))}}),$r=O({__name:"AlertDialogRoot",props:{open:{type:Boolean},defaultOpen:{type:Boolean}},emits:["update:open"],setup(e,{emit:n}){const t=Ht(e,n);return A(),(o,r)=>(_(),D(f(Wo),P(f(t),{modal:!0}),{default:x(()=>[E(o.$slots,"default")]),_:3},16))}}),Rr=O({__name:"AlertDialogPortal",props:{to:{},disabled:{type:Boolean},forceMount:{type:Boolean}},setup(e){const n=e;return(t,o)=>(_(),D(f(nt),G(J(n)),{default:x(()=>[E(t.$slots,"default")]),_:3},16))}}),[ar,sr]=le("AlertDialogContent"),Sr=O({__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:n}){const t=e,o=ye(n);A();const r=C();return sr({onCancelElementChange:i=>{r.value=i}}),(i,l)=>(_(),D(f(nr),P({...t,...f(o)},{role:"alertdialog",onPointerDownOutside:l[0]||(l[0]=ke(()=>{},["prevent"])),onInteractOutside:l[1]||(l[1]=ke(()=>{},["prevent"])),onOpenAutoFocus:l[2]||(l[2]=()=>{ne(()=>{var a;(a=r.value)==null||a.focus({preventScroll:!0})})})}),{default:x(()=>[E(i.$slots,"default")]),_:3},16))}}),Nr=O({__name:"AlertDialogOverlay",props:{forceMount:{type:Boolean},asChild:{type:Boolean},as:{}},setup(e){const n=e;return A(),(t,o)=>(_(),D(f(rr),G(J(n)),{default:x(()=>[E(t.$slots,"default")]),_:3},16))}}),Fr=O({__name:"AlertDialogCancel",props:{asChild:{type:Boolean},as:{default:"button"}},setup(e){const n=e,t=ar(),{forwardRef:o,currentElement:r}=A();return fe(()=>{t.onCancelElementChange(r.value)}),(i,l)=>(_(),D(f(Yt),P(n,{ref:f(o)}),{default:x(()=>[E(i.$slots,"default")]),_:3},16))}}),Lr=O({__name:"AlertDialogTitle",props:{asChild:{type:Boolean},as:{default:"h2"}},setup(e){const n=e;return A(),(t,o)=>(_(),D(f(lr),G(J(n)),{default:x(()=>[E(t.$slots,"default")]),_:3},16))}}),Mr=O({__name:"AlertDialogDescription",props:{asChild:{type:Boolean},as:{default:"p"}},setup(e){const n=e;return A(),(t,o)=>(_(),D(f(ir),G(J(n)),{default:x(()=>[E(t.$slots,"default")]),_:3},16))}}),Ir=O({__name:"AlertDialogAction",props:{asChild:{type:Boolean},as:{default:"button"}},setup(e){const n=e;return A(),(t,o)=>(_(),D(f(Yt),G(J(n)),{default:x(()=>[E(t.$slots,"default")]),_:3},16))}}),[Xt,ur]=le("PopperRoot"),dr=O({inheritAttrs:!1,__name:"PopperRoot",setup(e){const n=C();return ur({anchor:n,onAnchorChange:t=>n.value=t}),(t,o)=>E(t.$slots,"default")}}),cr=O({__name:"PopperAnchor",props:{element:{},asChild:{type:Boolean},as:{}},setup(e){const n=e,{forwardRef:t,currentElement:o}=A(),r=Xt();return M(()=>{r.onAnchorChange(n.element??o.value)}),(i,l)=>(_(),D(f(W),{ref:f(t),as:i.as,"as-child":i.asChild},{default:x(()=>[E(i.$slots,"default")]),_:3},8,["as","as-child"]))}});function fr(e){return e!==null}function pr(e){return{name:"transformOrigin",options:e,fn(n){var t,o,r;const{placement:i,rects:l,middlewareData:a}=n,c=((t=a.arrow)==null?void 0:t.centerOffset)!==0,d=c?0:e.arrowWidth,s=c?0:e.arrowHeight,[u,p]=ze(i),v={start:"0%",center:"50%",end:"100%"}[p],h=(((o=a.arrow)==null?void 0:o.x)??0)+d/2,g=(((r=a.arrow)==null?void 0:r.y)??0)+s/2;let m="",y="";return u==="bottom"?(m=c?v:`${h}px`,y=`${-s}px`):u==="top"?(m=c?v:`${h}px`,y=`${l.floating.height+s}px`):u==="right"?(m=`${-s}px`,y=c?v:`${g}px`):u==="left"&&(m=`${l.floating.width+s}px`,y=c?v:`${g}px`),{data:{x:m,y}}}}}function ze(e){const[n,t="center"]=e.split("-");return[n,t]}const vr={side:"bottom",sideOffset:0,align:"center",alignOffset:0,arrowPadding:0,avoidCollisions:!0,collisionBoundary:()=>[],collisionPadding:0,sticky:"partial",hideWhenDetached:!1,updatePositionStrategy:"optimized",prioritizePosition:!1},[hr,mr]=le("PopperContent"),yr=O({inheritAttrs:!1,__name:"PopperContent",props:cn({side:{},sideOffset:{},align:{},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean},updatePositionStrategy:{},prioritizePosition:{type:Boolean},asChild:{type:Boolean},as:{}},{...vr}),emits:["placed"],setup(e,{emit:n}){const t=e,o=n,r=Xt(),{forwardRef:i,currentElement:l}=A(),a=C(),c=C(),{width:d,height:s}=Fo(c),u=w(()=>t.side+(t.align!=="center"?`-${t.align}`:"")),p=w(()=>typeof t.collisionPadding=="number"?t.collisionPadding:{top:0,right:0,bottom:0,left:0,...t.collisionPadding}),v=w(()=>Array.isArray(t.collisionBoundary)?t.collisionBoundary:[t.collisionBoundary]),h=w(()=>({padding:p.value,boundary:v.value.filter(fr),altBoundary:v.value.length>0})),g=Qn(()=>[jn({mainAxis:t.sideOffset+s.value,alignmentAxis:t.alignOffset}),t.prioritizePosition&&t.avoidCollisions&&ut({...h.value}),t.avoidCollisions&&Kn({mainAxis:!0,crossAxis:!!t.prioritizePosition,limiter:t.sticky==="partial"?Yn():void 0,...h.value}),!t.prioritizePosition&&t.avoidCollisions&&ut({...h.value}),Vn({...h.value,apply:({elements:S,rects:rt,availableWidth:we,availableHeight:be})=>{const{width:xe,height:Jt}=rt.reference,Ce=S.floating.style;Ce.setProperty("--radix-popper-available-width",`${we}px`),Ce.setProperty("--radix-popper-available-height",`${be}px`),Ce.setProperty("--radix-popper-anchor-width",`${xe}px`),Ce.setProperty("--radix-popper-anchor-height",`${Jt}px`)}}),c.value&&Gn({element:c.value,padding:t.arrowPadding}),pr({arrowWidth:d.value,arrowHeight:s.value}),t.hideWhenDetached&&zn({strategy:"referenceHidden",...h.value})]),{floatingStyles:m,placement:y,isPositioned:B,middlewareData:b}=Jn(r.anchor,a,{strategy:"fixed",placement:u,whileElementsMounted:(...S)=>Hn(...S,{animationFrame:t.updatePositionStrategy==="always"}),middleware:g}),$=w(()=>ze(y.value)[0]),R=w(()=>ze(y.value)[1]);fn(()=>{B.value&&o("placed")});const L=w(()=>{var S;return((S=b.value.arrow)==null?void 0:S.centerOffset)!==0}),T=C("");M(()=>{l.value&&(T.value=window.getComputedStyle(l.value).zIndex)});const H=w(()=>{var S;return((S=b.value.arrow)==null?void 0:S.x)??0}),ge=w(()=>{var S;return((S=b.value.arrow)==null?void 0:S.y)??0});return mr({placedSide:$,onArrowChange:S=>c.value=S,arrowX:H,arrowY:ge,shouldHideArrow:L}),(S,rt)=>{var we,be,xe;return _(),Ot("div",{ref_key:"floatingRef",ref:a,"data-radix-popper-content-wrapper":"",style:Ye({...f(m),transform:f(B)?f(m).transform:"translate(0, -200%)",minWidth:"max-content",zIndex:T.value,"--radix-popper-transform-origin":[(we=f(b).transformOrigin)==null?void 0:we.x,(be=f(b).transformOrigin)==null?void 0:be.y].join(" "),...((xe=f(b).hide)==null?void 0:xe.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}})},[ee(f(W),P({ref:f(i)},S.$attrs,{"as-child":t.asChild,as:S.as,"data-side":$.value,"data-align":R.value,style:{animation:f(B)?void 0:"none"}}),{default:x(()=>[E(S.$slots,"default")]),_:3},16,["as-child","as","data-side","data-align","style"])],4)}}}),gr=pn("polygon",{points:"0,0 30,0 15,10"},null,-1),wr=O({__name:"Arrow",props:{width:{default:10},height:{default:5},asChild:{type:Boolean},as:{default:"svg"}},setup(e){const n=e;return A(),(t,o)=>(_(),D(f(W),P(n,{width:t.width,height:t.height,viewBox:t.asChild?void 0:"0 0 30 10",preserveAspectRatio:t.asChild?void 0:"none"}),{default:x(()=>[E(t.$slots,"default",{},()=>[gr])]),_:3},16,["width","height","viewBox","preserveAspectRatio"]))}}),br={top:"bottom",right:"left",bottom:"top",left:"right"},xr=O({inheritAttrs:!1,__name:"PopperArrow",props:{width:{},height:{},asChild:{type:Boolean},as:{default:"svg"}},setup(e){const{forwardRef:n}=A(),t=hr(),o=w(()=>br[t.placedSide.value]);return(r,i)=>{var l,a,c,d;return _(),Ot("span",{ref:s=>{f(t).onArrowChange(s)},style:Ye({position:"absolute",left:(l=f(t).arrowX)!=null&&l.value?`${(a=f(t).arrowX)==null?void 0:a.value}px`:void 0,top:(c=f(t).arrowY)!=null&&c.value?`${(d=f(t).arrowY)==null?void 0:d.value}px`:void 0,[o.value]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[f(t).placedSide.value],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[f(t).placedSide.value],visibility:f(t).shouldHideArrow.value?"hidden":void 0})},[ee(wr,P(r.$attrs,{ref:f(n),style:{display:"block"},as:r.as,"as-child":r.asChild,width:r.width,height:r.height}),{default:x(()=>[E(r.$slots,"default")]),_:3},16,["as","as-child","width","height"])],4)}}}),Cr=O({__name:"VisuallyHidden",props:{asChild:{type:Boolean},as:{default:"span"}},setup(e){return A(),(n,t)=>(_(),D(f(W),{as:n.as,"as-child":n.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:x(()=>[E(n.$slots,"default")]),_:3},8,["as","as-child"]))}});function Or(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}Or();const qt="tooltip.open",[ot,Er]=le("TooltipProvider"),kr=O({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 n=e,{delayDuration:t,skipDelayDuration:o,disableHoverableContent:r,disableClosingTrigger:i,ignoreNonKeyboardFocus:l,disabled:a}=Ue(n);A();const c=C(!0),d=C(!1),{start:s,stop:u}=Lt(()=>{c.value=!0},o,{immediate:!1});return Er({isOpenDelayed:c,delayDuration:t,onOpen(){u(),c.value=!1},onClose(){s()},isPointerInTransitRef:d,disableHoverableContent:r,disableClosingTrigger:i,disabled:a,ignoreNonKeyboardFocus:l}),(p,v)=>E(p.$slots,"default")}}),[Se,_r]=le("TooltipRoot"),Wr=O({__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:n}){const t=e,o=n;A();const r=ot(),i=w(()=>t.disableHoverableContent??r.disableHoverableContent.value),l=w(()=>t.disableClosingTrigger??r.disableClosingTrigger.value),a=w(()=>t.disabled??r.disabled.value),c=w(()=>t.delayDuration??r.delayDuration.value),d=w(()=>t.ignoreNonKeyboardFocus??r.ignoreNonKeyboardFocus.value),s=Mt(t,"open",o,{defaultValue:t.defaultOpen,passive:t.open===void 0});F(s,b=>{r.onClose&&(b?(r.onOpen(),document.dispatchEvent(new CustomEvent(qt))):r.onClose())});const u=C(!1),p=C(),v=w(()=>s.value?u.value?"delayed-open":"instant-open":"closed"),{start:h,stop:g}=Lt(()=>{u.value=!0,s.value=!0},c,{immediate:!1});function m(){g(),u.value=!1,s.value=!0}function y(){g(),s.value=!1}function B(){h()}return _r({contentId:"",open:s,stateAttribute:v,trigger:p,onTriggerChange(b){p.value=b},onTriggerEnter(){r.isOpenDelayed.value?B():m()},onTriggerLeave(){i.value?y():g()},onOpen:m,onClose:y,disableHoverableContent:i,disableClosingTrigger:l,disabled:a,ignoreNonKeyboardFocus:d}),(b,$)=>(_(),D(f(dr),null,{default:x(()=>[E(b.$slots,"default",{open:f(s)})]),_:3}))}}),Hr=O({__name:"TooltipTrigger",props:{asChild:{type:Boolean},as:{default:"button"}},setup(e){const n=e,t=Se(),o=ot();t.contentId||(t.contentId=Ve(void 0,"radix-vue-tooltip-content"));const{forwardRef:r,currentElement:i}=A(),l=C(!1),a=C(!1),c=w(()=>t.disabled.value?{}:{click:g,focus:v,pointermove:u,pointerleave:p,pointerdown:s,blur:h});fe(()=>{t.onTriggerChange(i.value)});function d(){setTimeout(()=>{l.value=!1},1)}function s(){l.value=!0,document.addEventListener("pointerup",d,{once:!0})}function u(m){m.pointerType!=="touch"&&!a.value&&!o.isPointerInTransitRef.value&&(t.onTriggerEnter(),a.value=!0)}function p(){t.onTriggerLeave(),a.value=!1}function v(m){var y,B;l.value||t.ignoreNonKeyboardFocus.value&&!((B=(y=m.target).matches)!=null&&B.call(y,":focus-visible"))||t.onOpen()}function h(){t.onClose()}function g(){t.disableClosingTrigger.value||t.onClose()}return(m,y)=>(_(),D(f(cr),{"as-child":""},{default:x(()=>[ee(f(W),P({ref:f(r),"aria-describedby":f(t).open.value?f(t).contentId:void 0,"data-state":f(t).stateAttribute.value,as:m.as,"as-child":n.asChild,"data-grace-area-trigger":""},tn(c.value)),{default:x(()=>[E(m.$slots,"default")]),_:3},16,["aria-describedby","data-state","as","as-child"])]),_:3}))}}),Gt=O({__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:n}){const t=e,o=n,r=Se(),{forwardRef:i}=A(),l=an(),a=w(()=>{var s;return(s=l.default)==null?void 0:s.call(l)}),c=w(()=>{var s;if(t.ariaLabel)return t.ariaLabel;let u="";function p(v){typeof v.children=="string"&&v.type!==xt?u+=v.children:Array.isArray(v.children)&&v.children.forEach(h=>p(h))}return(s=a.value)==null||s.forEach(v=>p(v)),u}),d=w(()=>{const{ariaLabel:s,...u}=t;return u});return fe(()=>{Te(window,"scroll",s=>{const u=s.target;u!=null&&u.contains(r.trigger.value)&&r.onClose()}),Te(window,qt,r.onClose)}),(s,u)=>(_(),D(f(Vt),{"as-child":"","disable-outside-pointer-events":!1,onEscapeKeyDown:u[0]||(u[0]=p=>o("escapeKeyDown",p)),onPointerDownOutside:u[1]||(u[1]=p=>{var v;f(r).disableClosingTrigger.value&&(v=f(r).trigger.value)!=null&&v.contains(p.target)&&p.preventDefault(),o("pointerDownOutside",p)}),onFocusOutside:u[2]||(u[2]=ke(()=>{},["prevent"])),onDismiss:u[3]||(u[3]=p=>f(r).onClose())},{default:x(()=>[ee(f(yr),P({ref:f(i),"data-state":f(r).stateAttribute.value},{...s.$attrs,...d.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:x(()=>[E(s.$slots,"default"),ee(f(Cr),{id:f(r).contentId,role:"tooltip"},{default:x(()=>[sn(un(c.value),1)]),_:1},8,["id"])]),_:3},16,["data-state"])]),_:3}))}}),Dr=O({__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 n=Wt(e),{forwardRef:t,currentElement:o}=A(),{trigger:r,onClose:i}=Se(),l=ot(),{isPointerInTransit:a,onPointerExit:c}=Co(r,o);return l.isPointerInTransitRef=a,c(()=>{i()}),(d,s)=>(_(),D(Gt,P({ref:f(t)},f(n)),{default:x(()=>[E(d.$slots,"default")]),_:3},16))}}),jr=O({__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:n}){const t=e,o=n,r=Se(),i=Ht(t,o),{forwardRef:l}=A();return(a,c)=>(_(),D(f(tt),{present:a.forceMount||f(r).open.value},{default:x(()=>[(_(),D(nn(f(r).disableHoverableContent.value?Gt:Dr),P({ref:f(l)},f(i)),{default:x(()=>[E(a.$slots,"default")]),_:3},16))]),_:3},8,["present"]))}}),Kr=O({__name:"TooltipArrow",props:{width:{default:10},height:{default:5},asChild:{type:Boolean},as:{default:"svg"}},setup(e){const n=e;return A(),(t,o)=>(_(),D(f(xr),G(J(n)),{default:x(()=>[E(t.$slots,"default")]),_:3},16))}}),Vr=O({__name:"TooltipPortal",props:{to:{},disabled:{type:Boolean},forceMount:{type:Boolean}},setup(e){const n=e;return(t,o)=>(_(),D(f(nt),G(J(n)),{default:x(()=>[E(t.$slots,"default")]),_:3},16))}});export{rr as $,Rr as A,lr as B,Mr as F,Kr as G,kr as H,Pr as I,Fr as M,Ir as N,Sr as O,nr as P,$r as T,jr as U,Lr as V,Wr as W,Hr as j,Nr as k,Wo as n,Vr as q}; diff --git a/assets/index-BqxwSAta.js b/assets/index-BqxwSAta.js new file mode 100644 index 0000000000000000000000000000000000000000..7c10e2851df5dd287621868fd90275e731a412ca --- /dev/null +++ b/assets/index-BqxwSAta.js @@ -0,0 +1 @@ +import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-Du5e5QRV.js";import{d as I,a2 as E,bk as x,o as n,bl as A,a as s,c as p,W as w,bh as D,Y as C,X as P,c2 as R,V as j,e as r,$ as L,bj as V,f as q,c5 as N,bm as _,c6 as F,c7 as O,u as y,a3 as W,_ as X}from"./index-B06xwjXa.js";import"./three-vrm.module-CtuEk7GG.js";import"./emotions-DWNSb738.js";import"./mcp-BfXpaYZf.js";import"./Select.vue_vue_type_style_index_0_lang-CzS20kE7.js";import{_ as Y}from"./IconAnimation.vue_vue_type_script_setup_true_lang-_yAijtHg.js";import{b as $}from"./route-block-B_A1xBdJ.js";import"./floating-ui.core-CgBsuaUc.js";const G={"z-1":"","flex-1":""},H={"text-lg":"","font-thin":"",class:"menu-icon-item-title",transition:"all ease-in-out duration-400"},J={text:"sm neutral-500 dark:neutral-400",class:"menu-icon-item-description",transition:"all ease-in-out duration-400"},K=I({__name:"IconItem",props:{title:null,description:null,icon:null,iconTemplate:{type:Boolean},to:null},setup(i){return(m,g)=>{const f=E("RouterLink");return n(),x(f,{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:i.to},{default:A(()=>[s("div",G,[s("div",H,C(i.title),1),s("div",J,[s("span",null,C(i.description),1)])]),typeof i.icon=="string"?(n(),p("div",{key:0,class:P(["menu-icon-item-icon",[i.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),i.iconTemplate?D(m.$slots,"icon",{key:1},void 0,!0):w("",!0)]),_:3},8,["to"])}}}),M=R(K,[["__scopeId","data-v-b1037d36"]]),Q={flex:"~ col gap-4","font-thin":""},U={flex:"~ col gap-4"},Z={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":""},tt={text:"60","i-solar:settings-bold-duotone":""},et=I({__name:"index",setup(i){const m=j(),g=r(!1),f=r(),c=r(),{t}=L(),b=r(""),h=r(""),k=r(!1),d=V();function S(){var a;(a=c.value)==null||a.call(c)}async function T(a,l){const e=a.currentTarget.querySelector(".menu-icon-item-icon");if(!e)return;const u=e.getBoundingClientRect(),v=`${u.left}px, ${u.top}px`;b.value=l.icon,h.value=v,k.value=!0,await X(),g.value=!0}const z=m.beforeEach(async(a,l,o)=>{if(!d.usePageSpecificTransitions||d.disableTransitions){o();return}await new Promise(e=>{c.value=e}),z(),o()}),B=q(()=>[{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(a,l)=>{const o=N("motion");return n(),p("div",Q,[l[0]||(l[0]=s("div",null,null,-1)),s("div",U,[(n(!0),p(F,null,O(B.value,(e,u)=>_((n(),x(y(M),{key:e.to,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250,style:W({transitionDelay:`${u*50}ms`}),title:e.title,description:e.description,icon:e.icon,to:e.to,onClick:v=>T(v,e)},null,8,["style","title","description","icon","to","onClick"])),[[o]])),128))]),k.value&&!y(d).disableTransitions&&y(d).usePageSpecificTransitions?(n(),x(Y,{key:0,ref_key:"iconAnimation",ref:f,icon:b.value,"icon-size":6*1.2,position:h.value,duration:1e3,"text-color":"text-neutral-400/50 dark:text-neutral-600/20",started:g.value,onAnimationEndedOnce:S},null,8,["icon","position","started"])):_((n(),p("div",Z,[_(s("div",tt,null,512),[[o]])])),[[o]])])}}});typeof $=="function"&&$(et);export{et as default}; diff --git a/assets/index-DtBLsHNZ.js b/assets/index-CAY2gJLP.js similarity index 99% rename from assets/index-DtBLsHNZ.js rename to assets/index-CAY2gJLP.js index 242dc1ccc382c3386707dfe991edae2e15adb087..f07fc53c9c7cacff11173ac5f351b60bded3ed66 100644 --- a/assets/index-DtBLsHNZ.js +++ b/assets/index-CAY2gJLP.js @@ -1,4 +1,4 @@ -import{Z as s,b as x}from"./mcp-B7-jaCfZ.js";import"./index-CNH1g_GM.js";const M=Symbol("Let zodToJsonSchema decide on which parser to use"),P={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",target:"jsonSchema7",strictUnions:!1,definitions:{},errorMessages:!1,markdownDescription:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref"},D=t=>typeof t=="string"?{...P,name:t}:{...P,...t},T=t=>{const e=D(t),a=e.name!==void 0?[...e.basePath,e.definitionPath,e.name]:e.basePath;return{...e,currentPath:a,propertyPath:void 0,seen:new Map(Object.entries(e.definitions).map(([n,r])=>[r._def,{def:r._def,path:[...e.basePath,e.definitionPath,n],jsonSchema:void 0}]))}};function _(t,e,a,n){n!=null&&n.errorMessages&&a&&(t.errorMessage={...t.errorMessage,[e]:a})}function l(t,e,a,n,r){t[e]=a,_(t,e,n,r)}function N(){return{}}function $(t,e){var n,r,i;const a={type:"array"};return(n=t.type)!=null&&n._def&&((i=(r=t.type)==null?void 0:r._def)==null?void 0:i.typeName)!==s.ZodAny&&(a.items=c(t.type._def,{...e,currentPath:[...e.currentPath,"items"]})),t.minLength&&l(a,"minItems",t.minLength.value,t.minLength.message,e),t.maxLength&&l(a,"maxItems",t.maxLength.value,t.maxLength.message,e),t.exactLength&&(l(a,"minItems",t.exactLength.value,t.exactLength.message,e),l(a,"maxItems",t.exactLength.value,t.exactLength.message,e)),a}function w(t,e){const a={type:"integer",format:"int64"};if(!t.checks)return a;for(const n of t.checks)switch(n.kind){case"min":e.target==="jsonSchema7"?n.inclusive?l(a,"minimum",n.value,n.message,e):l(a,"exclusiveMinimum",n.value,n.message,e):(n.inclusive||(a.exclusiveMinimum=!0),l(a,"minimum",n.value,n.message,e));break;case"max":e.target==="jsonSchema7"?n.inclusive?l(a,"maximum",n.value,n.message,e):l(a,"exclusiveMaximum",n.value,n.message,e):(n.inclusive||(a.exclusiveMaximum=!0),l(a,"maximum",n.value,n.message,e));break;case"multipleOf":l(a,"multipleOf",n.value,n.message,e);break}return a}function z(){return{type:"boolean"}}function Z(t,e){return c(t.type._def,e)}const L=(t,e)=>c(t.innerType._def,e);function S(t,e,a){const n=a??e.dateStrategy;if(Array.isArray(n))return{anyOf:n.map((r,i)=>S(t,e,r))};switch(n){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return F(t,e)}}const F=(t,e)=>{const a={type:"integer",format:"unix-time"};if(e.target==="openApi3")return a;for(const n of t.checks)switch(n.kind){case"min":l(a,"minimum",n.value,n.message,e);break;case"max":l(a,"maximum",n.value,n.message,e);break}return a};function I(t,e){return{...c(t.innerType._def,e),default:t.defaultValue()}}function E(t,e){return e.effectStrategy==="input"?c(t.schema._def,e):{}}function R(t){return{type:"string",enum:Array.from(t.values)}}const C=t=>"type"in t&&t.type==="string"?!1:"allOf"in t;function U(t,e){const a=[c(t.left._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),c(t.right._def,{...e,currentPath:[...e.currentPath,"allOf","1"]})].filter(i=>!!i);let n=e.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0;const r=[];return a.forEach(i=>{if(C(i))r.push(...i.allOf),i.unevaluatedProperties===void 0&&(n=void 0);else{let o=i;if("additionalProperties"in i&&i.additionalProperties===!1){const{additionalProperties:m,...p}=i;o=p}else n=void 0;r.push(o)}}),r.length?{allOf:r,...n}:void 0}function B(t,e){const a=typeof t.value;return a!=="bigint"&&a!=="number"&&a!=="boolean"&&a!=="string"?{type:Array.isArray(t.value)?"array":"object"}:e.target==="openApi3"?{type:a==="bigint"?"integer":a,enum:[t.value]}:{type:a==="bigint"?"integer":a,const:t.value}}let b;const f={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(b===void 0&&(b=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),b),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function O(t,e){const a={type:"string"};if(t.checks)for(const n of t.checks)switch(n.kind){case"min":l(a,"minLength",typeof a.minLength=="number"?Math.max(a.minLength,n.value):n.value,n.message,e);break;case"max":l(a,"maxLength",typeof a.maxLength=="number"?Math.min(a.maxLength,n.value):n.value,n.message,e);break;case"email":switch(e.emailStrategy){case"format:email":y(a,"email",n.message,e);break;case"format:idn-email":y(a,"idn-email",n.message,e);break;case"pattern:zod":d(a,f.email,n.message,e);break}break;case"url":y(a,"uri",n.message,e);break;case"uuid":y(a,"uuid",n.message,e);break;case"regex":d(a,n.regex,n.message,e);break;case"cuid":d(a,f.cuid,n.message,e);break;case"cuid2":d(a,f.cuid2,n.message,e);break;case"startsWith":d(a,RegExp(`^${v(n.value,e)}`),n.message,e);break;case"endsWith":d(a,RegExp(`${v(n.value,e)}$`),n.message,e);break;case"datetime":y(a,"date-time",n.message,e);break;case"date":y(a,"date",n.message,e);break;case"time":y(a,"time",n.message,e);break;case"duration":y(a,"duration",n.message,e);break;case"length":l(a,"minLength",typeof a.minLength=="number"?Math.max(a.minLength,n.value):n.value,n.message,e),l(a,"maxLength",typeof a.maxLength=="number"?Math.min(a.maxLength,n.value):n.value,n.message,e);break;case"includes":{d(a,RegExp(v(n.value,e)),n.message,e);break}case"ip":{n.version!=="v6"&&y(a,"ipv4",n.message,e),n.version!=="v4"&&y(a,"ipv6",n.message,e);break}case"base64url":d(a,f.base64url,n.message,e);break;case"jwt":d(a,f.jwt,n.message,e);break;case"cidr":{n.version!=="v6"&&d(a,f.ipv4Cidr,n.message,e),n.version!=="v4"&&d(a,f.ipv6Cidr,n.message,e);break}case"emoji":d(a,f.emoji(),n.message,e);break;case"ulid":{d(a,f.ulid,n.message,e);break}case"base64":{switch(e.base64Strategy){case"format:binary":{y(a,"binary",n.message,e);break}case"contentEncoding:base64":{l(a,"contentEncoding","base64",n.message,e);break}case"pattern:zod":{d(a,f.base64,n.message,e);break}}break}case"nanoid":d(a,f.nanoid,n.message,e)}return a}function v(t,e){return e.patternStrategy==="escape"?q(t):t}const V=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function q(t){let e="";for(let a=0;ai.format)?(t.anyOf||(t.anyOf=[]),t.format&&(t.anyOf.push({format:t.format,...t.errorMessage&&n.errorMessages&&{errorMessage:{format:t.errorMessage.format}}}),delete t.format,t.errorMessage&&(delete t.errorMessage.format,Object.keys(t.errorMessage).length===0&&delete t.errorMessage)),t.anyOf.push({format:e,...a&&n.errorMessages&&{errorMessage:{format:a}}})):l(t,"format",e,a,n)}function d(t,e,a,n){var r;t.pattern||(r=t.allOf)!=null&&r.some(i=>i.pattern)?(t.allOf||(t.allOf=[]),t.pattern&&(t.allOf.push({pattern:t.pattern,...t.errorMessage&&n.errorMessages&&{errorMessage:{pattern:t.errorMessage.pattern}}}),delete t.pattern,t.errorMessage&&(delete t.errorMessage.pattern,Object.keys(t.errorMessage).length===0&&delete t.errorMessage)),t.allOf.push({pattern:k(e,n),...a&&n.errorMessages&&{errorMessage:{pattern:a}}})):l(t,"pattern",k(e,n),a,n)}function k(t,e){var p;if(!e.applyRegexFlags||!t.flags)return t.source;const a={i:t.flags.includes("i"),m:t.flags.includes("m"),s:t.flags.includes("s")},n=a.i?t.source.toLowerCase():t.source;let r="",i=!1,o=!1,m=!1;for(let u=0;utypeof t=="string"?{...P,name:t}:{...P,...t},T=t=>{const e=D(t),a=e.name!==void 0?[...e.basePath,e.definitionPath,e.name]:e.basePath;return{...e,currentPath:a,propertyPath:void 0,seen:new Map(Object.entries(e.definitions).map(([n,r])=>[r._def,{def:r._def,path:[...e.basePath,e.definitionPath,n],jsonSchema:void 0}]))}};function _(t,e,a,n){n!=null&&n.errorMessages&&a&&(t.errorMessage={...t.errorMessage,[e]:a})}function l(t,e,a,n,r){t[e]=a,_(t,e,n,r)}function N(){return{}}function $(t,e){var n,r,i;const a={type:"array"};return(n=t.type)!=null&&n._def&&((i=(r=t.type)==null?void 0:r._def)==null?void 0:i.typeName)!==s.ZodAny&&(a.items=c(t.type._def,{...e,currentPath:[...e.currentPath,"items"]})),t.minLength&&l(a,"minItems",t.minLength.value,t.minLength.message,e),t.maxLength&&l(a,"maxItems",t.maxLength.value,t.maxLength.message,e),t.exactLength&&(l(a,"minItems",t.exactLength.value,t.exactLength.message,e),l(a,"maxItems",t.exactLength.value,t.exactLength.message,e)),a}function w(t,e){const a={type:"integer",format:"int64"};if(!t.checks)return a;for(const n of t.checks)switch(n.kind){case"min":e.target==="jsonSchema7"?n.inclusive?l(a,"minimum",n.value,n.message,e):l(a,"exclusiveMinimum",n.value,n.message,e):(n.inclusive||(a.exclusiveMinimum=!0),l(a,"minimum",n.value,n.message,e));break;case"max":e.target==="jsonSchema7"?n.inclusive?l(a,"maximum",n.value,n.message,e):l(a,"exclusiveMaximum",n.value,n.message,e):(n.inclusive||(a.exclusiveMaximum=!0),l(a,"maximum",n.value,n.message,e));break;case"multipleOf":l(a,"multipleOf",n.value,n.message,e);break}return a}function z(){return{type:"boolean"}}function Z(t,e){return c(t.type._def,e)}const L=(t,e)=>c(t.innerType._def,e);function S(t,e,a){const n=a??e.dateStrategy;if(Array.isArray(n))return{anyOf:n.map((r,i)=>S(t,e,r))};switch(n){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return F(t,e)}}const F=(t,e)=>{const a={type:"integer",format:"unix-time"};if(e.target==="openApi3")return a;for(const n of t.checks)switch(n.kind){case"min":l(a,"minimum",n.value,n.message,e);break;case"max":l(a,"maximum",n.value,n.message,e);break}return a};function I(t,e){return{...c(t.innerType._def,e),default:t.defaultValue()}}function E(t,e){return e.effectStrategy==="input"?c(t.schema._def,e):{}}function R(t){return{type:"string",enum:Array.from(t.values)}}const C=t=>"type"in t&&t.type==="string"?!1:"allOf"in t;function U(t,e){const a=[c(t.left._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),c(t.right._def,{...e,currentPath:[...e.currentPath,"allOf","1"]})].filter(i=>!!i);let n=e.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0;const r=[];return a.forEach(i=>{if(C(i))r.push(...i.allOf),i.unevaluatedProperties===void 0&&(n=void 0);else{let o=i;if("additionalProperties"in i&&i.additionalProperties===!1){const{additionalProperties:m,...p}=i;o=p}else n=void 0;r.push(o)}}),r.length?{allOf:r,...n}:void 0}function B(t,e){const a=typeof t.value;return a!=="bigint"&&a!=="number"&&a!=="boolean"&&a!=="string"?{type:Array.isArray(t.value)?"array":"object"}:e.target==="openApi3"?{type:a==="bigint"?"integer":a,enum:[t.value]}:{type:a==="bigint"?"integer":a,const:t.value}}let b;const f={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(b===void 0&&(b=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),b),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function O(t,e){const a={type:"string"};if(t.checks)for(const n of t.checks)switch(n.kind){case"min":l(a,"minLength",typeof a.minLength=="number"?Math.max(a.minLength,n.value):n.value,n.message,e);break;case"max":l(a,"maxLength",typeof a.maxLength=="number"?Math.min(a.maxLength,n.value):n.value,n.message,e);break;case"email":switch(e.emailStrategy){case"format:email":y(a,"email",n.message,e);break;case"format:idn-email":y(a,"idn-email",n.message,e);break;case"pattern:zod":d(a,f.email,n.message,e);break}break;case"url":y(a,"uri",n.message,e);break;case"uuid":y(a,"uuid",n.message,e);break;case"regex":d(a,n.regex,n.message,e);break;case"cuid":d(a,f.cuid,n.message,e);break;case"cuid2":d(a,f.cuid2,n.message,e);break;case"startsWith":d(a,RegExp(`^${v(n.value,e)}`),n.message,e);break;case"endsWith":d(a,RegExp(`${v(n.value,e)}$`),n.message,e);break;case"datetime":y(a,"date-time",n.message,e);break;case"date":y(a,"date",n.message,e);break;case"time":y(a,"time",n.message,e);break;case"duration":y(a,"duration",n.message,e);break;case"length":l(a,"minLength",typeof a.minLength=="number"?Math.max(a.minLength,n.value):n.value,n.message,e),l(a,"maxLength",typeof a.maxLength=="number"?Math.min(a.maxLength,n.value):n.value,n.message,e);break;case"includes":{d(a,RegExp(v(n.value,e)),n.message,e);break}case"ip":{n.version!=="v6"&&y(a,"ipv4",n.message,e),n.version!=="v4"&&y(a,"ipv6",n.message,e);break}case"base64url":d(a,f.base64url,n.message,e);break;case"jwt":d(a,f.jwt,n.message,e);break;case"cidr":{n.version!=="v6"&&d(a,f.ipv4Cidr,n.message,e),n.version!=="v4"&&d(a,f.ipv6Cidr,n.message,e);break}case"emoji":d(a,f.emoji(),n.message,e);break;case"ulid":{d(a,f.ulid,n.message,e);break}case"base64":{switch(e.base64Strategy){case"format:binary":{y(a,"binary",n.message,e);break}case"contentEncoding:base64":{l(a,"contentEncoding","base64",n.message,e);break}case"pattern:zod":{d(a,f.base64,n.message,e);break}}break}case"nanoid":d(a,f.nanoid,n.message,e)}return a}function v(t,e){return e.patternStrategy==="escape"?q(t):t}const V=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function q(t){let e="";for(let a=0;ai.format)?(t.anyOf||(t.anyOf=[]),t.format&&(t.anyOf.push({format:t.format,...t.errorMessage&&n.errorMessages&&{errorMessage:{format:t.errorMessage.format}}}),delete t.format,t.errorMessage&&(delete t.errorMessage.format,Object.keys(t.errorMessage).length===0&&delete t.errorMessage)),t.anyOf.push({format:e,...a&&n.errorMessages&&{errorMessage:{format:a}}})):l(t,"format",e,a,n)}function d(t,e,a,n){var r;t.pattern||(r=t.allOf)!=null&&r.some(i=>i.pattern)?(t.allOf||(t.allOf=[]),t.pattern&&(t.allOf.push({pattern:t.pattern,...t.errorMessage&&n.errorMessages&&{errorMessage:{pattern:t.errorMessage.pattern}}}),delete t.pattern,t.errorMessage&&(delete t.errorMessage.pattern,Object.keys(t.errorMessage).length===0&&delete t.errorMessage)),t.allOf.push({pattern:k(e,n),...a&&n.errorMessages&&{errorMessage:{pattern:a}}})):l(t,"pattern",k(e,n),a,n)}function k(t,e){var p;if(!e.applyRegexFlags||!t.flags)return t.source;const a={i:t.flags.includes("i"),m:t.flags.includes("m"),s:t.flags.includes("s")},n=a.i?t.source.toLowerCase():t.source;let r="",i=!1,o=!1,m=!1;for(let u=0;u(o(),r("label",q,[a(e("input",{"onUpdate:modelValue":y[0]||(y[0]=v=>n.value=v),"aria-checked":n.value,type:"checkbox",hidden:""},null,8,G),[[V,n.value]]),e("div",null,[h(u(c.$t(p.text))+" ",1),p.description?(o(),r("div",J,u(c.$t(p.description)),1)):U("",!0)]),m(j,{name:"slide-away",mode:"out-in"},{default:g(()=>[n.value?(o(),r("div",{key:0,class:k(p.iconOn),transition:"all ease-in-out duration-250"},null,2)):(o(),r("div",{key:1,class:k(p.iconOff),transition:"all ease-in-out duration-250"},null,2))]),_:1})]))}}),K=[[],["#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"]],Q={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"},Z={value:"en-US"},ee={value:"zh-CN"},te={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"},ie={"text-lg":"","font-semibold":""},ne={relative:"",flex:"","cursor-pointer":"","items-center":"","gap-2":""},ae=["disabled"],oe={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"},se={"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"},le={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"},re=["duration","delay"],de={"font-medium":""},ue={text:"sm neutral-500"},pe={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":""},w=A({__name:"index",setup(p){const n=H(),c=M(),{t:y}=O(),v=N(!1);return P(()=>[n.usePageSpecificTransitions,n.disableTransitions],()=>{v.value=!0}),(d,t)=>{const s=z("motion");return o(),r(x,null,[a((o(),f(i(C),{title:i(y)("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(c),"onUpdate:modelValue":t[0]||(t[0]=l=>I(c)?c.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",Q,[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",Z,u(d.$t("settings.language.english")),1),e("option",ee,u(d.$t("settings.language.chinese")),1)],512),[[R,i(n).language]])])),[[s]])]),_:1},8,["title"])),[[s]]),a((o(),f(i(C),{title:i(y)("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",te,[e("span",ie,u(d.$t("settings.pages.themes.sections.section.custom-color.fields.field.primary-color.label")),1),e("label",ne,[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:"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 peer-checked:bg-primary-500 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:k(["theme-hue-slider",i(n).themeColorsHueDynamic?"opacity-25 cursor-not-allowed":"cursor-pointer"]),disabled:i(n).themeColorsHueDynamic},null,10,ae),[[L,i(n).themeColorsHue],[s]]),a((o(),r("div",oe,[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",se,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",le,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(x,null,W(d.$tm("settings.pages.themes.sections.section.theme-presets.presets"),({title:l,description:$,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",de,u(d.$rt(l)),1),e("div",ue,u(d.$rt($)),1)]),m(Y,{colors:E.map((T,S)=>({hex:i(K)[b][S],name:d.$rt(T)}))},null,8,["colors"])],8,re)),[[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",pe,t[15]||(t[15]=[e("div",{text:"60","i-solar:filters-bold-duotone":""},null,-1)]))),[[s]])],64)}}});typeof D=="function"&&D(w);const De=X(w,[["__scopeId","data-v-aa1dd799"]]);export{De as default}; diff --git a/assets/index-CHjdc0dt.js b/assets/index-CHjdc0dt.js deleted file mode 100644 index 376ad5b78fdb6b25b5d1fce9d9468fac6207f9fa..0000000000000000000000000000000000000000 --- a/assets/index-CHjdc0dt.js +++ /dev/null @@ -1,1790 +0,0 @@ -import{c_ as getAugmentedNamespace}from"./index-CNH1g_GM.js";var dist={},assetPath={},hasRequiredAssetPath;function requireAssetPath(){if(hasRequiredAssetPath)return assetPath;hasRequiredAssetPath=1,Object.defineProperty(assetPath,"__esModule",{value:!0}),assetPath.baseAssetPath=void 0;const u=typeof window<"u"&&typeof window.document<"u"?window.document.currentScript:null;let b="/";return u&&(b=u.src.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/")),assetPath.baseAssetPath=b,assetPath}var defaultModelFetcher={},hasRequiredDefaultModelFetcher;function requireDefaultModelFetcher(){if(hasRequiredDefaultModelFetcher)return defaultModelFetcher;hasRequiredDefaultModelFetcher=1,Object.defineProperty(defaultModelFetcher,"__esModule",{value:!0}),defaultModelFetcher.defaultModelFetcher=void 0;const D=u=>fetch(u).then(b=>b.arrayBuffer());return defaultModelFetcher.defaultModelFetcher=D,defaultModelFetcher}var frameProcessor={},logging={},hasRequiredLogging;function requireLogging(){return hasRequiredLogging||(hasRequiredLogging=1,function(D){Object.defineProperty(D,"__esModule",{value:!0}),D.log=D.LOG_PREFIX=void 0,D.LOG_PREFIX="[VAD]";const u=["error","debug","warn"];function b(p){return(...h)=>{console[p](D.LOG_PREFIX,...h)}}const g=u.reduce((p,h)=>(p[h]=b(h),p),{});D.log=g}(logging)),logging}var messages={},hasRequiredMessages;function requireMessages(){if(hasRequiredMessages)return messages;hasRequiredMessages=1,Object.defineProperty(messages,"__esModule",{value:!0}),messages.Message=void 0;var D;return function(u){u.AudioFrame="AUDIO_FRAME",u.SpeechStart="SPEECH_START",u.VADMisfire="VAD_MISFIRE",u.SpeechEnd="SPEECH_END",u.SpeechStop="SPEECH_STOP",u.SpeechRealStart="SPEECH_REAL_START",u.FrameProcessed="FRAME_PROCESSED"}(D||(messages.Message=D={})),messages}var hasRequiredFrameProcessor;function requireFrameProcessor(){if(hasRequiredFrameProcessor)return frameProcessor;hasRequiredFrameProcessor=1,Object.defineProperty(frameProcessor,"__esModule",{value:!0}),frameProcessor.FrameProcessor=frameProcessor.validateOptions=frameProcessor.defaultV5FrameProcessorOptions=frameProcessor.defaultLegacyFrameProcessorOptions=void 0;const D=requireLogging(),u=requireMessages(),b=[512,1024,1536];frameProcessor.defaultLegacyFrameProcessorOptions={positiveSpeechThreshold:.5,negativeSpeechThreshold:.5-.15,preSpeechPadFrames:1,redemptionFrames:8,frameSamples:1536,minSpeechFrames:3,submitUserSpeechOnPause:!1},frameProcessor.defaultV5FrameProcessorOptions={positiveSpeechThreshold:.5,negativeSpeechThreshold:.5-.15,preSpeechPadFrames:3,redemptionFrames:24,frameSamples:512,minSpeechFrames:9,submitUserSpeechOnPause:!1};function g(o){b.includes(o.frameSamples)||D.log.warn("You are using an unusual frame size"),(o.positiveSpeechThreshold<0||o.positiveSpeechThreshold>1)&&D.log.error("positiveSpeechThreshold should be a number between 0 and 1"),(o.negativeSpeechThreshold<0||o.negativeSpeechThreshold>o.positiveSpeechThreshold)&&D.log.error("negativeSpeechThreshold should be between 0 and positiveSpeechThreshold"),o.preSpeechPadFrames<0&&D.log.error("preSpeechPadFrames should be positive"),o.redemptionFrames<0&&D.log.error("redemptionFrames should be positive")}frameProcessor.validateOptions=g;const p=o=>{const c=o.reduce((s,i)=>(s.push(s.at(-1)+i.length),s),[0]),f=new Float32Array(c.at(-1));return o.forEach((s,i)=>{const t=c[i];f.set(s,t)}),f};class h{constructor(c,f,s){this.modelProcessFunc=c,this.modelResetFunc=f,this.options=s,this.speaking=!1,this.redemptionCounter=0,this.speechFrameCount=0,this.active=!1,this.speechRealStartFired=!1,this.reset=()=>{this.speaking=!1,this.speechRealStartFired=!1,this.audioBuffer=[],this.modelResetFunc(),this.redemptionCounter=0,this.speechFrameCount=0},this.pause=i=>{this.active=!1,this.options.submitUserSpeechOnPause?this.endSegment(i):this.reset()},this.resume=()=>{this.active=!0},this.endSegment=i=>{const t=this.audioBuffer;this.audioBuffer=[];const e=this.speaking;if(this.reset(),e)if(t.reduce((r,a)=>a.isSpeech?r+1:r,0)>=this.options.minSpeechFrames){const r=p(t.map(a=>a.frame));i({msg:u.Message.SpeechEnd,audio:r})}else i({msg:u.Message.VADMisfire});return{}},this.process=async(i,t)=>{if(!this.active)return;const e=await this.modelProcessFunc(i),n=e.isSpeech>=this.options.positiveSpeechThreshold;if(t({probs:e,msg:u.Message.FrameProcessed,frame:i}),this.audioBuffer.push({frame:i,isSpeech:n}),n&&(this.speechFrameCount++,this.redemptionCounter=0),n&&!this.speaking&&(this.speaking=!0,t({msg:u.Message.SpeechStart})),this.speaking&&this.speechFrameCount===this.options.minSpeechFrames&&!this.speechRealStartFired&&(this.speechRealStartFired=!0,t({msg:u.Message.SpeechRealStart})),e.isSpeech=this.options.redemptionFrames){this.redemptionCounter=0,this.speechFrameCount=0,this.speaking=!1,this.speechRealStartFired=!1;const r=this.audioBuffer;if(this.audioBuffer=[],r.reduce((l,d)=>d.isSpeech?l+1:l,0)>=this.options.minSpeechFrames){const l=p(r.map(d=>d.frame));t({msg:u.Message.SpeechEnd,audio:l})}else t({msg:u.Message.VADMisfire})}if(!this.speaking){for(;this.audioBuffer.length>this.options.preSpeechPadFrames;)this.audioBuffer.shift();this.speechFrameCount=0}},this.audioBuffer=[],this.reset()}}return frameProcessor.FrameProcessor=h,frameProcessor}var nonRealTimeVad={},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,_=e*2,v=-1;s==="RGBA"?(m=0,y=e,_=e*2,v=e*3):s==="RGB"?(m=0,y=e,_=e*2):s==="RBG"&&(m=0,_=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. -*/var hasRequiredOrtWeb_min;function requireOrtWeb_min(){return hasRequiredOrtWeb_min||(hasRequiredOrtWeb_min=1,function(module,exports){(function(D,u){module.exports=u(require$$0)})(self,__WEBPACK_EXTERNAL_MODULE__1670__=>(()=>{var __webpack_modules__={3474:(D,u,b)=>{var g,p=(g=(g=typeof document<"u"&&document.currentScript?document.currentScript.src:void 0)||"/index.js",function(h){function o(){return Y.buffer!=ne&&Ee(Y.buffer),me}function c(){return Y.buffer!=ne&&Ee(Y.buffer),Pe}function f(){return Y.buffer!=ne&&Ee(Y.buffer),Oe}function s(){return Y.buffer!=ne&&Ee(Y.buffer),le}function i(){return Y.buffer!=ne&&Ee(Y.buffer),xe}var t,e,n;h=h||{},t||(t=h!==void 0?h:{}),t.ready=new Promise(function(x,A){e=x,n=A});var r,a,l,d,m,y,_=Object.assign({},t),v="./this.program",T=(x,A)=>{throw A},S=typeof window=="object",O=typeof importScripts=="function",w=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",I=t.ENVIRONMENT_IS_PTHREAD||!1,R="";function B(x){return t.locateFile?t.locateFile(x,R):R+x}if(w){let x;R=O?b(908).dirname(R)+"/":"//",y=()=>{m||(d=b(1384),m=b(908))},r=function(A,P){return y(),A=m.normalize(A),d.readFileSync(A,P?void 0:"utf8")},l=A=>((A=r(A,!0)).buffer||(A=new Uint8Array(A)),A),a=(A,P,F)=>{y(),A=m.normalize(A),d.readFile(A,function(L,z){L?F(L):P(z.buffer)})},1{if(ze())throw process.exitCode=A,P;P instanceof Ze||V("exiting due to exception: "+P),process.exit(A)},t.inspect=function(){return"[Emscripten Module object]"};try{x=b(9925)}catch(A){throw console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?'),A}b.g.Worker=x.Worker}else(S||O)&&(O?R=self.location.href:typeof document<"u"&&document.currentScript&&(R=document.currentScript.src),g&&(R=g),R=R.indexOf("blob:")!==0?R.substr(0,R.replace(/[?#].*/,"").lastIndexOf("/")+1):"",w||(r=x=>{var A=new XMLHttpRequest;return A.open("GET",x,!1),A.send(null),A.responseText},O&&(l=x=>{var A=new XMLHttpRequest;return A.open("GET",x,!1),A.responseType="arraybuffer",A.send(null),new Uint8Array(A.response)}),a=(x,A,P)=>{var F=new XMLHttpRequest;F.open("GET",x,!0),F.responseType="arraybuffer",F.onload=()=>{F.status==200||F.status==0&&F.response?A(F.response):P()},F.onerror=P,F.send(null)}));w&&typeof performance>"u"&&(b.g.performance=b(6953).performance);var j=console.log.bind(console),N=console.warn.bind(console);w&&(y(),j=x=>d.writeSync(1,x+` -`),N=x=>d.writeSync(2,x+` -`));var W,k=t.print||j,V=t.printErr||N;Object.assign(t,_),_=null,t.thisProgram&&(v=t.thisProgram),t.quit&&(T=t.quit),t.wasmBinary&&(W=t.wasmBinary);var J=t.noExitRuntime||!1;typeof WebAssembly!="object"&&pe("no native wasm support detected");var Y,te,ne,me,Pe,Oe,le,xe,_e=!1,Ne=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function He(x,A,P){var F=(A>>>=0)+P;for(P=A;x[P]&&!(P>=F);)++P;if(16(L=(240&L)==224?(15&L)<<12|z<<6|K:(7&L)<<18|z<<12|K<<6|63&x[A++])?F+=String.fromCharCode(L):(L-=65536,F+=String.fromCharCode(55296|L>>10,56320|1023&L))}}else F+=String.fromCharCode(L)}return F}function Ae(x,A){return(x>>>=0)?He(c(),x,A):""}function Ce(x,A,P,F){if(!(0>>=0;F=P+F-1;for(var z=0;z=K&&(K=65536+((1023&K)<<10)|1023&x.charCodeAt(++z)),127>=K){if(P>=F)break;A[P++>>>0]=K}else{if(2047>=K){if(P+1>=F)break;A[P++>>>0]=192|K>>6}else{if(65535>=K){if(P+2>=F)break;A[P++>>>0]=224|K>>12}else{if(P+3>=F)break;A[P++>>>0]=240|K>>18,A[P++>>>0]=128|K>>12&63}A[P++>>>0]=128|K>>6&63}A[P++>>>0]=128|63&K}}return A[P>>>0]=0,P-L}function Fe(x){for(var A=0,P=0;P=F?A++:2047>=F?A+=2:55296<=F&&57343>=F?(A+=4,++P):A+=3}return A}function Ee(x){ne=x,t.HEAP8=me=new Int8Array(x),t.HEAP16=new Int16Array(x),t.HEAP32=Oe=new Int32Array(x),t.HEAPU8=Pe=new Uint8Array(x),t.HEAPU16=new Uint16Array(x),t.HEAPU32=le=new Uint32Array(x),t.HEAPF32=new Float32Array(x),t.HEAPF64=xe=new Float64Array(x)}I&&(ne=t.buffer);var we=t.INITIAL_MEMORY||16777216;if(I)Y=t.wasmMemory,ne=t.buffer;else if(t.wasmMemory)Y=t.wasmMemory;else if(!((Y=new WebAssembly.Memory({initial:we/65536,maximum:65536,shared:!0})).buffer instanceof SharedArrayBuffer))throw V("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag"),w&&console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)"),Error("bad memory");Y&&(ne=Y.buffer),we=ne.byteLength,Ee(ne);var je,Ue=[],Be=[],We=[],Ke=[];function ze(){return J||!1}function Ve(){var x=t.preRun.shift();Ue.unshift(x)}var Se,Me=0,Ye=null;function pe(x){throw I?postMessage({cmd:"onAbort",arg:x}):t.onAbort&&t.onAbort(x),V(x="Aborted("+x+")"),_e=!0,x=new WebAssembly.RuntimeError(x+". Build with -sASSERTIONS for more info."),n(x),x}function ft(){return Se.startsWith("data:application/octet-stream;base64,")}function st(){var x=Se;try{if(x==Se&&W)return new Uint8Array(W);if(l)return l(x);throw"both async and sync fetching of the wasm failed"}catch(A){pe(A)}}Se="ort-wasm-threaded.wasm",ft()||(Se=B(Se));var At={};function Ze(x){this.name="ExitStatus",this.message="Program terminated with exit("+x+")",this.status=x}function ut(x){(x=re.Vb[x])||pe(),re.mc(x)}function ct(x){var A=re.Cc();if(!A)return 6;re.ac.push(A),re.Vb[x.Ub]=A,A.Ub=x.Ub;var P={cmd:"run",start_routine:x.Ic,arg:x.zc,pthread_ptr:x.Ub};return A.$b=()=>{P.time=performance.now(),A.postMessage(P,x.Nc)},A.loaded&&(A.$b(),delete A.$b),0}function Re(x){if(I)return Z(1,1,x);ze()||(re.oc(),t.onExit&&t.onExit(x),_e=!0),T(x,new Ze(x))}function nt(x,A){if(!A&&I)throw It(x),"unwind";ze()||I||(Gt(),tt(We),zt(0),kt[1].length&&Ct(1,10),kt[2].length&&Ct(2,10),re.oc()),Re(x)}var re={Yb:[],ac:[],qc:[],Vb:{},fc:function(){I&&re.Ec()},Pc:function(){},Ec:function(){re.receiveObjectTransfer=re.Gc,re.threadInitTLS=re.pc,re.setExitStatus=re.nc,J=!1},nc:function(){},oc:function(){for(var x of Object.values(re.Vb))re.mc(x);for(x of re.Yb)x.terminate();re.Yb=[]},mc:function(x){var A=x.Ub;delete re.Vb[A],re.Yb.push(x),re.ac.splice(re.ac.indexOf(x),1),x.Ub=0,Nt(A)},Gc:function(){},pc:function(){re.qc.forEach(x=>x())},Fc:function(x,A){x.onmessage=P=>{var F=(P=P.data).cmd;if(x.Ub&&(re.Bc=x.Ub),P.targetThread&&P.targetThread!=Dt()){var L=re.Vb[P.Qc];L?L.postMessage(P,P.transferList):V('Internal error! Worker sent a message "'+F+'" to target pthread '+P.targetThread+", but that thread no longer exists!")}else F==="processProxyingQueue"?C(P.queue):F==="spawnThread"?ct(P):F==="cleanupThread"?ut(P.thread):F==="killThread"?(P=P.thread,F=re.Vb[P],delete re.Vb[P],F.terminate(),Nt(P),re.ac.splice(re.ac.indexOf(F),1),F.Ub=0):F==="cancelThread"?re.Vb[P.thread].postMessage({cmd:"cancel"}):F==="loaded"?(x.loaded=!0,A&&A(x),x.$b&&(x.$b(),delete x.$b)):F==="print"?k("Thread "+P.threadId+": "+P.text):F==="printErr"?V("Thread "+P.threadId+": "+P.text):F==="alert"?alert("Thread "+P.threadId+": "+P.text):P.target==="setimmediate"?x.postMessage(P):F==="onAbort"?t.onAbort&&t.onAbort(P.arg):F&&V("worker sent an unknown command "+F);re.Bc=void 0},x.onerror=P=>{throw V("worker sent an error! "+P.filename+":"+P.lineno+": "+P.message),P},w&&(x.on("message",function(P){x.onmessage({data:P})}),x.on("error",function(P){x.onerror(P)}),x.on("detachedExit",function(){})),x.postMessage({cmd:"load",urlOrBlob:t.mainScriptUrlOrBlob||g,wasmMemory:Y,wasmModule:te})},yc:function(){var x=B("ort-wasm-threaded.worker.js");re.Yb.push(new Worker(x))},Cc:function(){return re.Yb.length==0&&(re.yc(),re.Fc(re.Yb[0])),re.Yb.pop()}};function tt(x){for(;0>2>>>0];x=f()[x+48>>2>>>0],Xt(A,A-x),ue(A)};var Je=[];function ye(x){var A=Je[x];return A||(x>=Je.length&&(Je.length=x+1),Je[x]=A=je.get(x)),A}t.invokeEntryPoint=function(x,A){x=ye(x)(A),ze()?re.nc(x):Yt(x)};var rt,dt,it=[],ae=0,ie=0;function oe(x){this.Zb=x,this.Sb=x-24,this.xc=function(A){s()[this.Sb+4>>2>>>0]=A},this.bc=function(){return s()[this.Sb+4>>2>>>0]},this.wc=function(A){s()[this.Sb+8>>2>>>0]=A},this.Dc=function(){return s()[this.Sb+8>>2>>>0]},this.rc=function(){f()[this.Sb>>2>>>0]=0},this.hc=function(A){A=A?1:0,o()[this.Sb+12>>0>>>0]=A},this.uc=function(){return o()[this.Sb+12>>0>>>0]!=0},this.ic=function(A){A=A?1:0,o()[this.Sb+13>>0>>>0]=A},this.kc=function(){return o()[this.Sb+13>>0>>>0]!=0},this.fc=function(A,P){this.cc(0),this.xc(A),this.wc(P),this.rc(),this.hc(!1),this.ic(!1)},this.sc=function(){Atomics.add(f(),this.Sb>>2,1)},this.Hc=function(){return Atomics.sub(f(),this.Sb>>2,1)===1},this.cc=function(A){s()[this.Sb+16>>2>>>0]=A},this.tc=function(){return s()[this.Sb+16>>2>>>0]},this.vc=function(){if(Kt(this.bc()))return s()[this.Zb>>2>>>0];var A=this.tc();return A!==0?A:this.Zb}}function pt(x){return Bt(new oe(x).Sb)}function ot(x,A,P,F){return I?Z(3,1,x,A,P,F):ht(x,A,P,F)}function ht(x,A,P,F){if(typeof SharedArrayBuffer>"u")return V("Current environment does not support SharedArrayBuffer, pthreads are not available!"),6;var L=[];return I&&L.length===0?ot(x,A,P,F):(x={Ic:P,Ub:x,zc:F,Nc:L},I?(x.Oc="spawnThread",postMessage(x,L),0):ct(x))}function gt(x,A,P){return I?Z(4,1,x,A,P):0}function mt(x,A){if(I)return Z(5,1,x,A)}function bt(x,A){if(I)return Z(6,1,x,A)}function yt(x,A,P){if(I)return Z(7,1,x,A,P)}function _t(x,A,P){return I?Z(8,1,x,A,P):0}function vt(x,A){if(I)return Z(9,1,x,A)}function wt(x,A,P){if(I)return Z(10,1,x,A,P)}function xt(x,A,P,F){if(I)return Z(11,1,x,A,P,F)}function Tt(x,A,P,F){if(I)return Z(12,1,x,A,P,F)}function St(x,A,P,F){if(I)return Z(13,1,x,A,P,F)}function Ot(x){if(I)return Z(14,1,x)}function E(x,A){if(I)return Z(15,1,x,A)}function $(x,A,P){if(I)return Z(16,1,x,A,P)}function C(x){Atomics.store(f(),x>>2,1),Dt()&&Wt(x),Atomics.compareExchange(f(),x>>2,1,0)}function M(x){return s()[x>>>2]+4294967296*f()[x+4>>>2]}function U(x,A,P,F,L,z){return I?Z(17,1,x,A,P,F,L,z):-52}function H(x,A,P,F,L,z){if(I)return Z(18,1,x,A,P,F,L,z)}function X(x){var A=Fe(x)+1,P=Rt(A);return P&&Ce(x,o(),P,A),P}function Q(x,A,P){function F(he){return(he=he.toTimeString().match(/\(([A-Za-z ]+)\)$/))?he[1]:"GMT"}if(I)return Z(19,1,x,A,P);var L=new Date().getFullYear(),z=new Date(L,0,1),K=new Date(L,6,1);L=z.getTimezoneOffset();var ee=K.getTimezoneOffset(),de=Math.max(L,ee);f()[x>>2>>>0]=60*de,f()[A>>2>>>0]=+(L!=ee),x=F(z),A=F(K),x=X(x),A=X(A),ee>2>>>0]=x,s()[P+4>>2>>>0]=A):(s()[P>>2>>>0]=A,s()[P+4>>2>>>0]=x)}function Z(x,A){var P=arguments.length-2,F=arguments;return Et(()=>{for(var L=Mt(8*P),z=L>>3,K=0;K>>0]=ee}return Ht(x,P,L,A)})}t.executeNotifiedProxyingQueue=C,dt=w?()=>{var x=process.hrtime();return 1e3*x[0]+x[1]/1e6}:I?()=>performance.now()-t.__performance_now_clock_drift:()=>performance.now();var se,ve=[],ke={};function $e(){if(!se){var x,A={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:v||"./this.program"};for(x in ke)ke[x]===void 0?delete A[x]:A[x]=ke[x];var P=[];for(x in A)P.push(x+"="+A[x]);se=P}return se}function G(x,A){if(I)return Z(20,1,x,A);var P=0;return $e().forEach(function(F,L){var z=A+P;for(L=s()[x+4*L>>2>>>0]=z,z=0;z>0>>>0]=F.charCodeAt(z);o()[L>>0>>>0]=0,P+=F.length+1}),0}function ge(x,A){if(I)return Z(21,1,x,A);var P=$e();s()[x>>2>>>0]=P.length;var F=0;return P.forEach(function(L){F+=L.length+1}),s()[A>>2>>>0]=F,0}function Te(x){return I?Z(22,1,x):52}function Ge(x,A,P,F){return I?Z(23,1,x,A,P,F):52}function Qe(x,A,P,F,L){return I?Z(24,1,x,A,P,F,L):70}var kt=[null,[],[]];function Ct(x,A){var P=kt[x];A===0||A===10?((x===1?k:V)(He(P,0)),P.length=0):P.push(A)}function Lt(x,A,P,F){if(I)return Z(25,1,x,A,P,F);for(var L=0,z=0;z>2>>>0],ee=s()[A+4>>2>>>0];A+=8;for(var de=0;de>>0]);L+=ee}return s()[F>>2>>>0]=L,0}var Le=0;function Pt(x){return x%4==0&&(x%100!=0||x%400==0)}var jt=[31,29,31,30,31,30,31,31,30,31,30,31],Vt=[31,28,31,30,31,30,31,31,30,31,30,31];function Ut(x,A,P,F){function L(q,be,Ie){for(q=typeof q=="number"?q.toString():q||"";q.lengthlt?-1:0et-q.getDate())){q.setDate(q.getDate()+be);break}be-=et-q.getDate()+1,q.setDate(1),11>Ie?q.setMonth(Ie+1):(q.setMonth(0),q.setFullYear(q.getFullYear()+1))}return Ie=new Date(q.getFullYear()+1,0,4),be=ee(new Date(q.getFullYear(),0,4)),Ie=ee(Ie),0>=K(be,q)?0>=K(Ie,q)?q.getFullYear()+1:q.getFullYear():q.getFullYear()-1}var he=f()[F+40>>2>>>0];for(var De in F={Lc:f()[F>>2>>>0],Kc:f()[F+4>>2>>>0],dc:f()[F+8>>2>>>0],jc:f()[F+12>>2>>>0],ec:f()[F+16>>2>>>0],Xb:f()[F+20>>2>>>0],Tb:f()[F+24>>2>>>0],Wb:f()[F+28>>2>>>0],Rc:f()[F+32>>2>>>0],Jc:f()[F+36>>2>>>0],Mc:he?Ae(he):""},P=Ae(P),he={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"})P=P.replace(new RegExp(De,"g"),he[De]);var Xe="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),qe="January February March April May June July August September October November December".split(" ");for(De in he={"%a":function(q){return Xe[q.Tb].substring(0,3)},"%A":function(q){return Xe[q.Tb]},"%b":function(q){return qe[q.ec].substring(0,3)},"%B":function(q){return qe[q.ec]},"%C":function(q){return z((q.Xb+1900)/100|0,2)},"%d":function(q){return z(q.jc,2)},"%e":function(q){return L(q.jc,2," ")},"%g":function(q){return de(q).toString().substring(2)},"%G":function(q){return de(q)},"%H":function(q){return z(q.dc,2)},"%I":function(q){return(q=q.dc)==0?q=12:12q.dc?"AM":"PM"},"%S":function(q){return z(q.Lc,2)},"%t":function(){return" "},"%u":function(q){return q.Tb||7},"%U":function(q){return z(Math.floor((q.Wb+7-q.Tb)/7),2)},"%V":function(q){var be=Math.floor((q.Wb+7-(q.Tb+6)%7)/7);if(2>=(q.Tb+371-q.Wb-2)%7&&be++,be)be==53&&((Ie=(q.Tb+371-q.Wb)%7)==4||Ie==3&&Pt(q.Xb)||(be=1));else{be=52;var Ie=(q.Tb+7-q.Wb-1)%7;(Ie==4||Ie==5&&Pt(q.Xb%400-1))&&be++}return z(be,2)},"%w":function(q){return q.Tb},"%W":function(q){return z(Math.floor((q.Wb+7-(q.Tb+6)%7)/7),2)},"%y":function(q){return(q.Xb+1900).toString().substring(2)},"%Y":function(q){return q.Xb+1900},"%z":function(q){var be=0<=(q=q.Jc);return q=Math.abs(q)/60,(be?"+":"-")+("0000"+(q/60*100+q%60)).slice(-4)},"%Z":function(q){return q.Mc},"%%":function(){return"%"}},P=P.replace(/%%/g,"\0\0"),he)P.includes(De)&&(P=P.replace(new RegExp(De,"g"),he[De](F)));return De=function(q){var be=Array(Fe(q)+1);return Ce(q,be,0,be.length),be}(P=P.replace(/\0\0/g,"%")),De.length>A?0:(function(q,be){o().set(q,be>>>0)}(De,x),De.length-1)}re.fc();var ln=[null,Re,It,ot,gt,mt,bt,yt,_t,vt,wt,xt,Tt,St,Ot,E,$,U,H,Q,G,ge,Te,Ge,Qe,Lt],fn={b:function(x){return Rt(x+24)+24},n:function(x){return(x=new oe(x)).uc()||(x.hc(!0),ae--),x.ic(!1),it.push(x),x.sc(),x.vc()},ma:function(x){throw V("Unexpected exception thrown, this is not properly supported - aborting"),_e=!0,x},x:function(){fe(0);var x=it.pop();if(x.Hc()&&!x.kc()){var A=x.Dc();A&&ye(A)(x.Zb),pt(x.Zb)}ie=0},e:function(){var x=ie;if(!x)return Le=0;var A=new oe(x);A.cc(x);var P=A.bc();if(!P)return Le=0,x;for(var F=Array.prototype.slice.call(arguments),L=0;LC(F));else if(I)postMessage({targetThread:x,cmd:"processProxyingQueue",queue:F});else{if(!(x=re.Vb[x]))return;x.postMessage({cmd:"processProxyingQueue",queue:F})}return 1},Ea:function(){return-1},Pa:function(x,A){x=new Date(1e3*M(x)),f()[A>>2>>>0]=x.getUTCSeconds(),f()[A+4>>2>>>0]=x.getUTCMinutes(),f()[A+8>>2>>>0]=x.getUTCHours(),f()[A+12>>2>>>0]=x.getUTCDate(),f()[A+16>>2>>>0]=x.getUTCMonth(),f()[A+20>>2>>>0]=x.getUTCFullYear()-1900,f()[A+24>>2>>>0]=x.getUTCDay(),x=(x.getTime()-Date.UTC(x.getUTCFullYear(),0,1,0,0,0,0))/864e5|0,f()[A+28>>2>>>0]=x},Qa:function(x,A){x=new Date(1e3*M(x)),f()[A>>2>>>0]=x.getSeconds(),f()[A+4>>2>>>0]=x.getMinutes(),f()[A+8>>2>>>0]=x.getHours(),f()[A+12>>2>>>0]=x.getDate(),f()[A+16>>2>>>0]=x.getMonth(),f()[A+20>>2>>>0]=x.getFullYear()-1900,f()[A+24>>2>>>0]=x.getDay();var P=new Date(x.getFullYear(),0,1),F=(x.getTime()-P.getTime())/864e5|0;f()[A+28>>2>>>0]=F,f()[A+36>>2>>>0]=-60*x.getTimezoneOffset(),F=new Date(x.getFullYear(),6,1).getTimezoneOffset(),x=0|(F!=(P=P.getTimezoneOffset())&&x.getTimezoneOffset()==Math.min(P,F)),f()[A+32>>2>>>0]=x},Ra:function(x){var A=new Date(f()[x+20>>2>>>0]+1900,f()[x+16>>2>>>0],f()[x+12>>2>>>0],f()[x+8>>2>>>0],f()[x+4>>2>>>0],f()[x>>2>>>0],0),P=f()[x+32>>2>>>0],F=A.getTimezoneOffset(),L=new Date(A.getFullYear(),0,1),z=new Date(A.getFullYear(),6,1).getTimezoneOffset(),K=L.getTimezoneOffset(),ee=Math.min(K,z);return 0>P?f()[x+32>>2>>>0]=+(z!=K&&ee==F):0>2>>>0]=A.getDay(),P=(A.getTime()-L.getTime())/864e5|0,f()[x+28>>2>>>0]=P,f()[x>>2>>>0]=A.getSeconds(),f()[x+4>>2>>>0]=A.getMinutes(),f()[x+8>>2>>>0]=A.getHours(),f()[x+12>>2>>>0]=A.getDate(),f()[x+16>>2>>>0]=A.getMonth(),A.getTime()/1e3|0},Aa:U,Ba:H,Sa:function x(A,P,F){x.Ac||(x.Ac=!0,Q(A,P,F))},y:function(){pe("")},U:function(){if(!w&&!O){var x="Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread";rt||(rt={}),rt[x]||(rt[x]=1,w&&(x="warning: "+x),V(x))}},ra:function(){return 4294901760},B:dt,Ia:function(x,A,P){c().copyWithin(x>>>0,A>>>0,A+P>>>0)},F:function(){return w?b(3993).cpus().length:navigator.hardwareConcurrency},Da:function(x,A,P){ve.length=A,P>>=3;for(var F=0;F>>0];return(0>x?At[-x-1]:ln[x]).apply(null,ve)},qa:function(x){var A=c().length;if((x>>>=0)<=A||4294901760=P;P*=2){var F=A*(1+.2/P);F=Math.min(F,x+100663296);var L=Math;F=Math.max(x,F),L=L.min.call(L,4294901760,F+(65536-F%65536)%65536);e:{try{Y.grow(L-ne.byteLength+65535>>>16),Ee(Y.buffer);var z=1;break e}catch{}z=void 0}if(z)return!0}return!1},Na:function(){throw"unwind"},Ga:G,Ha:ge,J:nt,I:Te,S:Ge,ga:Qe,R:Lt,d:function(){return Le},na:function x(A,P){x.lc||(x.lc=function(){if(typeof crypto=="object"&&typeof crypto.getRandomValues=="function"){var L=new Uint8Array(1);return()=>(crypto.getRandomValues(L),L[0])}if(w)try{var z=b(Object(function(){var K=new Error("Cannot find module 'crypto'");throw K.code="MODULE_NOT_FOUND",K}()));return()=>z.randomBytes(1)[0]}catch{}return()=>pe("randomDevice")}());for(var F=0;F>0>>>0]=x.lc();return 0},ia:function(x,A,P){var F=ce();try{return ye(x)(A,P)}catch(L){if(ue(F),L!==L+0)throw L;fe(1,0)}},ja:function(x,A,P){var F=ce();try{return ye(x)(A,P)}catch(L){if(ue(F),L!==L+0)throw L;fe(1,0)}},K:function(x){var A=ce();try{return ye(x)()}catch(P){if(ue(A),P!==P+0)throw P;fe(1,0)}},f:function(x,A){var P=ce();try{return ye(x)(A)}catch(F){if(ue(P),F!==F+0)throw F;fe(1,0)}},P:function(x,A,P){var F=ce();try{return ye(x)(A,P)}catch(L){if(ue(F),L!==L+0)throw L;fe(1,0)}},Q:function(x,A,P){var F=ce();try{return ye(x)(A,P)}catch(L){if(ue(F),L!==L+0)throw L;fe(1,0)}},k:function(x,A,P){var F=ce();try{return ye(x)(A,P)}catch(L){if(ue(F),L!==L+0)throw L;fe(1,0)}},p:function(x,A,P,F){var L=ce();try{return ye(x)(A,P,F)}catch(z){if(ue(L),z!==z+0)throw z;fe(1,0)}},q:function(x,A,P,F,L){var z=ce();try{return ye(x)(A,P,F,L)}catch(K){if(ue(z),K!==K+0)throw K;fe(1,0)}},N:function(x,A,P,F,L,z){var K=ce();try{return ye(x)(A,P,F,L,z)}catch(ee){if(ue(K),ee!==ee+0)throw ee;fe(1,0)}},s:function(x,A,P,F,L,z){var K=ce();try{return ye(x)(A,P,F,L,z)}catch(ee){if(ue(K),ee!==ee+0)throw ee;fe(1,0)}},w:function(x,A,P,F,L,z,K){var ee=ce();try{return ye(x)(A,P,F,L,z,K)}catch(de){if(ue(ee),de!==de+0)throw de;fe(1,0)}},L:function(x,A,P,F,L,z,K,ee){var de=ce();try{return ye(x)(A,P,F,L,z,K,ee)}catch(he){if(ue(de),he!==he+0)throw he;fe(1,0)}},E:function(x,A,P,F,L,z,K,ee,de,he,De,Xe){var qe=ce();try{return ye(x)(A,P,F,L,z,K,ee,de,he,De,Xe)}catch(q){if(ue(qe),q!==q+0)throw q;fe(1,0)}},aa:function(x,A,P,F,L,z,K,ee){var de=ce();try{return an(x,A,P,F,L,z,K,ee)}catch(he){if(ue(de),he!==he+0)throw he;fe(1,0)}},_:function(x,A,P,F,L,z,K){var ee=ce();try{return Jt(x,A,P,F,L,z,K)}catch(de){if(ue(ee),de!==de+0)throw de;fe(1,0)}},Z:function(x,A,P,F,L){var z=ce();try{return sn(x,A,P,F,L)}catch(K){if(ue(z),K!==K+0)throw K;fe(1,0)}},ca:function(x,A,P,F){var L=ce();try{return rn(x,A,P,F)}catch(z){if(ue(L),z!==z+0)throw z;fe(1,0)}},$:function(x){var A=ce();try{return Zt(x)}catch(P){if(ue(A),P!==P+0)throw P;fe(1,0)}},ba:function(x,A){var P=ce();try{return on(x,A)}catch(F){if(ue(P),F!==F+0)throw F;fe(1,0)}},Y:function(x,A,P){var F=ce();try{return Qt(x,A,P)}catch(L){if(ue(F),L!==L+0)throw L;fe(1,0)}},g:function(x){var A=ce();try{ye(x)()}catch(P){if(ue(A),P!==P+0)throw P;fe(1,0)}},r:function(x,A){var P=ce();try{ye(x)(A)}catch(F){if(ue(P),F!==F+0)throw F;fe(1,0)}},i:function(x,A,P){var F=ce();try{ye(x)(A,P)}catch(L){if(ue(F),L!==L+0)throw L;fe(1,0)}},ha:function(x,A,P,F){var L=ce();try{ye(x)(A,P,F)}catch(z){if(ue(L),z!==z+0)throw z;fe(1,0)}},m:function(x,A,P,F){var L=ce();try{ye(x)(A,P,F)}catch(z){if(ue(L),z!==z+0)throw z;fe(1,0)}},v:function(x,A,P,F,L){var z=ce();try{ye(x)(A,P,F,L)}catch(K){if(ue(z),K!==K+0)throw K;fe(1,0)}},u:function(x,A,P,F,L,z){var K=ce();try{ye(x)(A,P,F,L,z)}catch(ee){if(ue(K),ee!==ee+0)throw ee;fe(1,0)}},O:function(x,A,P,F,L,z,K){var ee=ce();try{ye(x)(A,P,F,L,z,K)}catch(de){if(ue(ee),de!==de+0)throw de;fe(1,0)}},A:function(x,A,P,F,L,z,K,ee){var de=ce();try{ye(x)(A,P,F,L,z,K,ee)}catch(he){if(ue(de),he!==he+0)throw he;fe(1,0)}},ka:function(x,A,P,F,L,z,K,ee,de){var he=ce();try{ye(x)(A,P,F,L,z,K,ee,de)}catch(De){if(ue(he),De!==De+0)throw De;fe(1,0)}},C:function(x,A,P,F,L,z,K,ee,de,he,De){var Xe=ce();try{ye(x)(A,P,F,L,z,K,ee,de,he,De)}catch(qe){if(ue(Xe),qe!==qe+0)throw qe;fe(1,0)}},D:function(x,A,P,F,L,z,K,ee,de,he,De,Xe,qe,q,be,Ie){var et=ce();try{ye(x)(A,P,F,L,z,K,ee,de,he,De,Xe,qe,q,be,Ie)}catch(lt){if(ue(et),lt!==lt+0)throw lt;fe(1,0)}},fa:function(x,A,P,F,L,z,K,ee){var de=ce();try{en(x,A,P,F,L,z,K,ee)}catch(he){if(ue(de),he!==he+0)throw he;fe(1,0)}},da:function(x,A,P,F,L,z,K,ee,de,he,De,Xe){var qe=ce();try{nn(x,A,P,F,L,z,K,ee,de,he,De,Xe)}catch(q){if(ue(qe),q!==q+0)throw q;fe(1,0)}},ea:function(x,A,P,F,L,z){var K=ce();try{tn(x,A,P,F,L,z)}catch(ee){if(ue(K),ee!==ee+0)throw ee;fe(1,0)}},o:function(x){return x},a:Y||t.wasmMemory,G:function(x){Le=x},la:Ut,z:function(x,A,P,F){return Ut(x,A,P,F)}};(function(){function x(L,z){t.asm=L.exports,re.qc.push(t.asm.sb),je=t.asm.ub,Be.unshift(t.asm.Va),te=z,I||(Me--,t.monitorRunDependencies&&t.monitorRunDependencies(Me),Me==0&&Ye&&(L=Ye,Ye=null,L()))}function A(L){x(L.instance,L.module)}function P(L){return function(){if(!W&&(S||O)){if(typeof fetch=="function"&&!Se.startsWith("file://"))return fetch(Se,{credentials:"same-origin"}).then(function(z){if(!z.ok)throw"failed to load wasm binary file at '"+Se+"'";return z.arrayBuffer()}).catch(function(){return st()});if(a)return new Promise(function(z,K){a(Se,function(ee){z(new Uint8Array(ee))},K)})}return Promise.resolve().then(function(){return st()})}().then(function(z){return WebAssembly.instantiate(z,F)}).then(function(z){return z}).then(L,function(z){V("failed to asynchronously prepare wasm: "+z),pe(z)})}var F={a:fn};if(I||(Me++,t.monitorRunDependencies&&t.monitorRunDependencies(Me)),t.instantiateWasm)try{return t.instantiateWasm(F,x)}catch(L){return V("Module.instantiateWasm callback failed with error: "+L),!1}(W||typeof WebAssembly.instantiateStreaming!="function"||ft()||Se.startsWith("file://")||w||typeof fetch!="function"?P(A):fetch(Se,{credentials:"same-origin"}).then(function(L){return WebAssembly.instantiateStreaming(L,F).then(A,function(z){return V("wasm streaming compile failed: "+z),V("falling back to ArrayBuffer instantiation"),P(A)})})).catch(n)})(),t.___wasm_call_ctors=function(){return(t.___wasm_call_ctors=t.asm.Va).apply(null,arguments)},t._OrtInit=function(){return(t._OrtInit=t.asm.Wa).apply(null,arguments)},t._OrtCreateSessionOptions=function(){return(t._OrtCreateSessionOptions=t.asm.Xa).apply(null,arguments)},t._OrtAppendExecutionProvider=function(){return(t._OrtAppendExecutionProvider=t.asm.Ya).apply(null,arguments)},t._OrtAddSessionConfigEntry=function(){return(t._OrtAddSessionConfigEntry=t.asm.Za).apply(null,arguments)},t._OrtReleaseSessionOptions=function(){return(t._OrtReleaseSessionOptions=t.asm._a).apply(null,arguments)},t._OrtCreateSession=function(){return(t._OrtCreateSession=t.asm.$a).apply(null,arguments)},t._OrtReleaseSession=function(){return(t._OrtReleaseSession=t.asm.ab).apply(null,arguments)},t._OrtGetInputCount=function(){return(t._OrtGetInputCount=t.asm.bb).apply(null,arguments)},t._OrtGetOutputCount=function(){return(t._OrtGetOutputCount=t.asm.cb).apply(null,arguments)},t._OrtGetInputName=function(){return(t._OrtGetInputName=t.asm.db).apply(null,arguments)},t._OrtGetOutputName=function(){return(t._OrtGetOutputName=t.asm.eb).apply(null,arguments)},t._OrtFree=function(){return(t._OrtFree=t.asm.fb).apply(null,arguments)},t._OrtCreateTensor=function(){return(t._OrtCreateTensor=t.asm.gb).apply(null,arguments)},t._OrtGetTensorData=function(){return(t._OrtGetTensorData=t.asm.hb).apply(null,arguments)},t._OrtReleaseTensor=function(){return(t._OrtReleaseTensor=t.asm.ib).apply(null,arguments)},t._OrtCreateRunOptions=function(){return(t._OrtCreateRunOptions=t.asm.jb).apply(null,arguments)},t._OrtAddRunConfigEntry=function(){return(t._OrtAddRunConfigEntry=t.asm.kb).apply(null,arguments)},t._OrtReleaseRunOptions=function(){return(t._OrtReleaseRunOptions=t.asm.lb).apply(null,arguments)},t._OrtRun=function(){return(t._OrtRun=t.asm.mb).apply(null,arguments)},t._OrtEndProfiling=function(){return(t._OrtEndProfiling=t.asm.nb).apply(null,arguments)};var Dt=t._pthread_self=function(){return(Dt=t._pthread_self=t.asm.ob).apply(null,arguments)},Rt=t._malloc=function(){return(Rt=t._malloc=t.asm.pb).apply(null,arguments)},Bt=t._free=function(){return(Bt=t._free=t.asm.qb).apply(null,arguments)},zt=t._fflush=function(){return(zt=t._fflush=t.asm.rb).apply(null,arguments)};t.__emscripten_tls_init=function(){return(t.__emscripten_tls_init=t.asm.sb).apply(null,arguments)};var Gt=t.___funcs_on_exit=function(){return(Gt=t.___funcs_on_exit=t.asm.tb).apply(null,arguments)},qt=t.__emscripten_thread_init=function(){return(qt=t.__emscripten_thread_init=t.asm.vb).apply(null,arguments)};t.__emscripten_thread_crashed=function(){return(t.__emscripten_thread_crashed=t.asm.wb).apply(null,arguments)};var $t,Ht=t._emscripten_run_in_main_runtime_thread_js=function(){return(Ht=t._emscripten_run_in_main_runtime_thread_js=t.asm.xb).apply(null,arguments)},Wt=t.__emscripten_proxy_execute_task_queue=function(){return(Wt=t.__emscripten_proxy_execute_task_queue=t.asm.yb).apply(null,arguments)},Nt=t.__emscripten_thread_free_data=function(){return(Nt=t.__emscripten_thread_free_data=t.asm.zb).apply(null,arguments)},Yt=t.__emscripten_thread_exit=function(){return(Yt=t.__emscripten_thread_exit=t.asm.Ab).apply(null,arguments)},fe=t._setThrew=function(){return(fe=t._setThrew=t.asm.Bb).apply(null,arguments)},Xt=t._emscripten_stack_set_limits=function(){return(Xt=t._emscripten_stack_set_limits=t.asm.Cb).apply(null,arguments)},ce=t.stackSave=function(){return(ce=t.stackSave=t.asm.Db).apply(null,arguments)},ue=t.stackRestore=function(){return(ue=t.stackRestore=t.asm.Eb).apply(null,arguments)},Mt=t.stackAlloc=function(){return(Mt=t.stackAlloc=t.asm.Fb).apply(null,arguments)},Ft=t.___cxa_can_catch=function(){return(Ft=t.___cxa_can_catch=t.asm.Gb).apply(null,arguments)},Kt=t.___cxa_is_pointer_type=function(){return(Kt=t.___cxa_is_pointer_type=t.asm.Hb).apply(null,arguments)},Zt=t.dynCall_j=function(){return(Zt=t.dynCall_j=t.asm.Ib).apply(null,arguments)},Jt=t.dynCall_iiiiij=function(){return(Jt=t.dynCall_iiiiij=t.asm.Jb).apply(null,arguments)},Qt=t.dynCall_jii=function(){return(Qt=t.dynCall_jii=t.asm.Kb).apply(null,arguments)},en=t.dynCall_viiiiij=function(){return(en=t.dynCall_viiiiij=t.asm.Lb).apply(null,arguments)},tn=t.dynCall_vjji=function(){return(tn=t.dynCall_vjji=t.asm.Mb).apply(null,arguments)},nn=t.dynCall_viiijjjii=function(){return(nn=t.dynCall_viiijjjii=t.asm.Nb).apply(null,arguments)},rn=t.dynCall_iij=function(){return(rn=t.dynCall_iij=t.asm.Ob).apply(null,arguments)},on=t.dynCall_ji=function(){return(on=t.dynCall_ji=t.asm.Pb).apply(null,arguments)},an=t.dynCall_iiiiiij=function(){return(an=t.dynCall_iiiiiij=t.asm.Qb).apply(null,arguments)},sn=t.dynCall_iiij=function(){return(sn=t.dynCall_iiij=t.asm.Rb).apply(null,arguments)};function un(){function x(){if(!$t&&($t=!0,t.calledRun=!0,!_e)&&(I||tt(Be),e(t),t.onRuntimeInitialized&&t.onRuntimeInitialized(),!I)){if(t.postRun)for(typeof t.postRun=="function"&&(t.postRun=[t.postRun]);t.postRun.length;){var A=t.postRun.shift();Ke.unshift(A)}tt(Ke)}}if(!(0{var g,p=(g=(g=typeof document<"u"&&document.currentScript?document.currentScript.src:void 0)||"/index.js",function(h){var o,c,f;h=h||{},o||(o=h!==void 0?h:{}),o.ready=new Promise(function(E,$){c=E,f=$});var s,i,t,e,n,r,a=Object.assign({},o),l="./this.program",d=(E,$)=>{throw $},m=typeof window=="object",y=typeof importScripts=="function",_=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",v="";_?(v=y?b(908).dirname(v)+"/":"//",r=()=>{n||(e=b(1384),n=b(908))},s=function(E,$){return r(),E=n.normalize(E),e.readFileSync(E,$?void 0:"utf8")},t=E=>((E=s(E,!0)).buffer||(E=new Uint8Array(E)),E),i=(E,$,C)=>{r(),E=n.normalize(E),e.readFile(E,function(M,U){M?C(M):$(U.buffer)})},1{if(w||0{var $=new XMLHttpRequest;return $.open("GET",E,!1),$.send(null),$.responseText},y&&(t=E=>{var $=new XMLHttpRequest;return $.open("GET",E,!1),$.responseType="arraybuffer",$.send(null),new Uint8Array($.response)}),i=(E,$,C)=>{var M=new XMLHttpRequest;M.open("GET",E,!0),M.responseType="arraybuffer",M.onload=()=>{M.status==200||M.status==0&&M.response?$(M.response):C()},M.onerror=C,M.send(null)});var T,S=o.print||console.log.bind(console),O=o.printErr||console.warn.bind(console);Object.assign(o,a),a=null,o.thisProgram&&(l=o.thisProgram),o.quit&&(d=o.quit),o.wasmBinary&&(T=o.wasmBinary);var w=o.noExitRuntime||!1;typeof WebAssembly!="object"&&Ee("no native wasm support detected");var I,R,B,j,N,W,k=!1,V=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function J(E,$,C){var M=($>>>=0)+C;for(C=$;E[C]&&!(C>=M);)++C;if(16(U=(240&U)==224?(15&U)<<12|H<<6|X:(7&U)<<18|H<<12|X<<6|63&E[$++])?M+=String.fromCharCode(U):(U-=65536,M+=String.fromCharCode(55296|U>>10,56320|1023&U))}}else M+=String.fromCharCode(U)}return M}function Y(E,$){return(E>>>=0)?J(j,E,$):""}function te(E,$,C,M){if(!(0>>=0;M=C+M-1;for(var H=0;H=X&&(X=65536+((1023&X)<<10)|1023&E.charCodeAt(++H)),127>=X){if(C>=M)break;$[C++>>>0]=X}else{if(2047>=X){if(C+1>=M)break;$[C++>>>0]=192|X>>6}else{if(65535>=X){if(C+2>=M)break;$[C++>>>0]=224|X>>12}else{if(C+3>=M)break;$[C++>>>0]=240|X>>18,$[C++>>>0]=128|X>>12&63}$[C++>>>0]=128|X>>6&63}$[C++>>>0]=128|63&X}}return $[C>>>0]=0,C-U}function ne(E){for(var $=0,C=0;C=M?$++:2047>=M?$+=2:55296<=M&&57343>=M?($+=4,++C):$+=3}return $}function me(){var E=I.buffer;R=E,o.HEAP8=B=new Int8Array(E),o.HEAP16=new Int16Array(E),o.HEAP32=N=new Int32Array(E),o.HEAPU8=j=new Uint8Array(E),o.HEAPU16=new Uint16Array(E),o.HEAPU32=W=new Uint32Array(E),o.HEAPF32=new Float32Array(E),o.HEAPF64=new Float64Array(E)}var Pe,Oe=[],le=[],xe=[],_e=[],Ne=0;function He(){var E=o.preRun.shift();Oe.unshift(E)}var Ae,Ce=0,Fe=null;function Ee(E){throw o.onAbort&&o.onAbort(E),O(E="Aborted("+E+")"),k=!0,E=new WebAssembly.RuntimeError(E+". Build with -sASSERTIONS for more info."),f(E),E}function we(){return Ae.startsWith("data:application/octet-stream;base64,")}if(Ae="ort-wasm.wasm",!we()){var je=Ae;Ae=o.locateFile?o.locateFile(je,v):v+je}function Ue(){var E=Ae;try{if(E==Ae&&T)return new Uint8Array(T);if(t)return t(E);throw"both async and sync fetching of the wasm failed"}catch($){Ee($)}}function Be(E){this.name="ExitStatus",this.message="Program terminated with exit("+E+")",this.status=E}function We(E){for(;0>2>>>0]=$},this.Eb=function(){return W[this.zb+4>>2>>>0]},this.Sb=function($){W[this.zb+8>>2>>>0]=$},this.Wb=function(){return W[this.zb+8>>2>>>0]},this.Tb=function(){N[this.zb>>2>>>0]=0},this.Ib=function($){B[this.zb+12>>0>>>0]=$?1:0},this.Pb=function(){return B[this.zb+12>>0>>>0]!=0},this.Jb=function($){B[this.zb+13>>0>>>0]=$?1:0},this.Lb=function(){return B[this.zb+13>>0>>>0]!=0},this.Rb=function($,C){this.Fb(0),this.Ub($),this.Sb(C),this.Tb(),this.Ib(!1),this.Jb(!1)},this.Nb=function(){N[this.zb>>2>>>0]+=1},this.Xb=function(){var $=N[this.zb>>2>>>0];return N[this.zb>>2>>>0]=$-1,$===1},this.Fb=function($){W[this.zb+16>>2>>>0]=$},this.Ob=function(){return W[this.zb+16>>2>>>0]},this.Qb=function(){if(ht(this.Eb()))return W[this.Db>>2>>>0];var $=this.Ob();return $!==0?$:this.Db}}function Me(E){return rt(new Se(E).zb)}var Ye=[];function pe(E){var $=Ye[E];return $||(E>=Ye.length&&(Ye.length=E+1),Ye[E]=$=Pe.get(E)),$}function ft(E){var $=ne(E)+1,C=ye($);return C&&te(E,B,C,$),C}var st={};function At(){if(!Ze){var E,$={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:l||"./this.program"};for(E in st)st[E]===void 0?delete $[E]:$[E]=st[E];var C=[];for(E in $)C.push(E+"="+$[E]);Ze=C}return Ze}var Ze,ut=[null,[],[]];function ct(E,$){var C=ut[E];$===0||$===10?((E===1?S:O)(J(C,0)),C.length=0):C.push($)}var Re=0;function nt(E){return E%4==0&&(E%100!=0||E%400==0)}var re=[31,29,31,30,31,30,31,31,30,31,30,31],tt=[31,28,31,30,31,30,31,31,30,31,30,31];function Et(E,$,C,M){function U(G,ge,Te){for(G=typeof G=="number"?G.toString():G||"";G.lengthQe?-1:0Ge-G.getDate())){G.setDate(G.getDate()+ge);break}ge-=Ge-G.getDate()+1,G.setDate(1),11>Te?G.setMonth(Te+1):(G.setMonth(0),G.setFullYear(G.getFullYear()+1))}return Te=new Date(G.getFullYear()+1,0,4),ge=Q(new Date(G.getFullYear(),0,4)),Te=Q(Te),0>=X(ge,G)?0>=X(Te,G)?G.getFullYear()+1:G.getFullYear():G.getFullYear()-1}var se=N[M+40>>2>>>0];for(var ve in M={$b:N[M>>2>>>0],Zb:N[M+4>>2>>>0],Gb:N[M+8>>2>>>0],Kb:N[M+12>>2>>>0],Hb:N[M+16>>2>>>0],Cb:N[M+20>>2>>>0],Ab:N[M+24>>2>>>0],Bb:N[M+28>>2>>>0],bc:N[M+32>>2>>>0],Yb:N[M+36>>2>>>0],ac:se?Y(se):""},C=Y(C),se={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"})C=C.replace(new RegExp(ve,"g"),se[ve]);var ke="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),$e="January February March April May June July August September October November December".split(" ");for(ve in se={"%a":function(G){return ke[G.Ab].substring(0,3)},"%A":function(G){return ke[G.Ab]},"%b":function(G){return $e[G.Hb].substring(0,3)},"%B":function(G){return $e[G.Hb]},"%C":function(G){return H((G.Cb+1900)/100|0,2)},"%d":function(G){return H(G.Kb,2)},"%e":function(G){return U(G.Kb,2," ")},"%g":function(G){return Z(G).toString().substring(2)},"%G":function(G){return Z(G)},"%H":function(G){return H(G.Gb,2)},"%I":function(G){return(G=G.Gb)==0?G=12:12G.Gb?"AM":"PM"},"%S":function(G){return H(G.$b,2)},"%t":function(){return" "},"%u":function(G){return G.Ab||7},"%U":function(G){return H(Math.floor((G.Bb+7-G.Ab)/7),2)},"%V":function(G){var ge=Math.floor((G.Bb+7-(G.Ab+6)%7)/7);if(2>=(G.Ab+371-G.Bb-2)%7&&ge++,ge)ge==53&&((Te=(G.Ab+371-G.Bb)%7)==4||Te==3&&nt(G.Cb)||(ge=1));else{ge=52;var Te=(G.Ab+7-G.Bb-1)%7;(Te==4||Te==5&&nt(G.Cb%400-1))&&ge++}return H(ge,2)},"%w":function(G){return G.Ab},"%W":function(G){return H(Math.floor((G.Bb+7-(G.Ab+6)%7)/7),2)},"%y":function(G){return(G.Cb+1900).toString().substring(2)},"%Y":function(G){return G.Cb+1900},"%z":function(G){var ge=0<=(G=G.Yb);return G=Math.abs(G)/60,(ge?"+":"-")+("0000"+(G/60*100+G%60)).slice(-4)},"%Z":function(G){return G.ac},"%%":function(){return"%"}},C=C.replace(/%%/g,"\0\0"),se)C.includes(ve)&&(C=C.replace(new RegExp(ve,"g"),se[ve](M)));return ve=function(G){var ge=Array(ne(G)+1);return te(G,ge,0,ge.length),ge}(C=C.replace(/\0\0/g,"%")),ve.length>$?0:(B.set(ve,E>>>0),ve.length-1)}var It={a:function(E){return ye(E+24)+24},m:function(E){return(E=new Se(E)).Pb()||(E.Ib(!0),ze--),E.Jb(!1),Ke.push(E),E.Nb(),E.Qb()},ia:function(E){throw O("Unexpected exception thrown, this is not properly supported - aborting"),k=!0,E},w:function(){ae(0);var E=Ke.pop();if(E.Xb()&&!E.Lb()){var $=E.Wb();$&&pe($)(E.Db),Me(E.Db)}Ve=0},d:function(){var E=Ve;if(!E)return Re=0;var $=new Se(E);$.Fb(E);var C=$.Eb();if(!C)return Re=0,E;for(var M=Array.prototype.slice.call(arguments),U=0;U>>2]+4294967296*N[E+4>>>2])),N[$>>2>>>0]=E.getUTCSeconds(),N[$+4>>2>>>0]=E.getUTCMinutes(),N[$+8>>2>>>0]=E.getUTCHours(),N[$+12>>2>>>0]=E.getUTCDate(),N[$+16>>2>>>0]=E.getUTCMonth(),N[$+20>>2>>>0]=E.getUTCFullYear()-1900,N[$+24>>2>>>0]=E.getUTCDay(),N[$+28>>2>>>0]=(E.getTime()-Date.UTC(E.getUTCFullYear(),0,1,0,0,0,0))/864e5|0},Ea:function(E,$){E=new Date(1e3*(W[E>>>2]+4294967296*N[E+4>>>2])),N[$>>2>>>0]=E.getSeconds(),N[$+4>>2>>>0]=E.getMinutes(),N[$+8>>2>>>0]=E.getHours(),N[$+12>>2>>>0]=E.getDate(),N[$+16>>2>>>0]=E.getMonth(),N[$+20>>2>>>0]=E.getFullYear()-1900,N[$+24>>2>>>0]=E.getDay();var C=new Date(E.getFullYear(),0,1);N[$+28>>2>>>0]=(E.getTime()-C.getTime())/864e5|0,N[$+36>>2>>>0]=-60*E.getTimezoneOffset();var M=new Date(E.getFullYear(),6,1).getTimezoneOffset();C=C.getTimezoneOffset(),N[$+32>>2>>>0]=0|(M!=C&&E.getTimezoneOffset()==Math.min(C,M))},Fa:function(E){var $=new Date(N[E+20>>2>>>0]+1900,N[E+16>>2>>>0],N[E+12>>2>>>0],N[E+8>>2>>>0],N[E+4>>2>>>0],N[E>>2>>>0],0),C=N[E+32>>2>>>0],M=$.getTimezoneOffset(),U=new Date($.getFullYear(),0,1),H=new Date($.getFullYear(),6,1).getTimezoneOffset(),X=U.getTimezoneOffset(),Q=Math.min(X,H);return 0>C?N[E+32>>2>>>0]=+(H!=X&&Q==M):0>2>>>0]=$.getDay(),N[E+28>>2>>>0]=($.getTime()-U.getTime())/864e5|0,N[E>>2>>>0]=$.getSeconds(),N[E+4>>2>>>0]=$.getMinutes(),N[E+8>>2>>>0]=$.getHours(),N[E+12>>2>>>0]=$.getDate(),N[E+16>>2>>>0]=$.getMonth(),$.getTime()/1e3|0},sa:function(){return-52},ta:function(){},Ga:function E($,C,M){E.Vb||(E.Vb=!0,function(U,H,X){function Q($e){return($e=$e.toTimeString().match(/\(([A-Za-z ]+)\)$/))?$e[1]:"GMT"}var Z=new Date().getFullYear(),se=new Date(Z,0,1),ve=new Date(Z,6,1);Z=se.getTimezoneOffset();var ke=ve.getTimezoneOffset();N[U>>2>>>0]=60*Math.max(Z,ke),N[H>>2>>>0]=+(Z!=ke),U=Q(se),H=Q(ve),U=ft(U),H=ft(H),ke>2>>>0]=U,W[X+4>>2>>>0]=H):(W[X>>2>>>0]=H,W[X+4>>2>>>0]=U)}($,C,M))},B:function(){Ee("")},ma:function(){return 4294901760},I:_?()=>{var E=process.hrtime();return 1e3*E[0]+E[1]/1e6}:()=>performance.now(),xa:function(E,$,C){j.copyWithin(E>>>0,$>>>0,$+C>>>0)},G:function(E){var $=j.length;if(4294901760<(E>>>=0))return!1;for(var C=1;4>=C;C*=2){var M=$*(1+.2/C);M=Math.min(M,E+100663296);var U=Math;M=Math.max(E,M),U=U.min.call(U,4294901760,M+(65536-M%65536)%65536);e:{try{I.grow(U-R.byteLength+65535>>>16),me();var H=1;break e}catch{}H=void 0}if(H)return!0}return!1},va:function(E,$){var C=0;return At().forEach(function(M,U){var H=$+C;for(U=W[E+4*U>>2>>>0]=H,H=0;H>0>>>0]=M.charCodeAt(H);B[U>>0>>>0]=0,C+=M.length+1}),0},wa:function(E,$){var C=At();W[E>>2>>>0]=C.length;var M=0;return C.forEach(function(U){M+=U.length+1}),W[$>>2>>>0]=M,0},ba:function(E){w||0>2>>>0],Q=W[$+4>>2>>>0];$+=8;for(var Z=0;Z>>0]);U+=Q}return W[M>>2>>>0]=U,0},c:function(){return Re},ja:function E($,C){E.Mb||(E.Mb=function(){if(typeof crypto=="object"&&typeof crypto.getRandomValues=="function"){var U=new Uint8Array(1);return()=>(crypto.getRandomValues(U),U[0])}if(_)try{var H=b(Object(function(){var X=new Error("Cannot find module 'crypto'");throw X.code="MODULE_NOT_FOUND",X}()));return()=>H.randomBytes(1)[0]}catch{}return()=>Ee("randomDevice")}());for(var M=0;M>0>>>0]=E.Mb();return 0},ea:function(E,$,C){var M=ie();try{return pe(E)($,C)}catch(U){if(oe(M),U!==U+0)throw U;ae(1,0)}},fa:function(E,$,C){var M=ie();try{return pe(E)($,C)}catch(U){if(oe(M),U!==U+0)throw U;ae(1,0)}},J:function(E){var $=ie();try{return pe(E)()}catch(C){if(oe($),C!==C+0)throw C;ae(1,0)}},e:function(E,$){var C=ie();try{return pe(E)($)}catch(M){if(oe(C),M!==M+0)throw M;ae(1,0)}},N:function(E,$,C){var M=ie();try{return pe(E)($,C)}catch(U){if(oe(M),U!==U+0)throw U;ae(1,0)}},O:function(E,$,C){var M=ie();try{return pe(E)($,C)}catch(U){if(oe(M),U!==U+0)throw U;ae(1,0)}},j:function(E,$,C){var M=ie();try{return pe(E)($,C)}catch(U){if(oe(M),U!==U+0)throw U;ae(1,0)}},o:function(E,$,C,M){var U=ie();try{return pe(E)($,C,M)}catch(H){if(oe(U),H!==H+0)throw H;ae(1,0)}},p:function(E,$,C,M,U){var H=ie();try{return pe(E)($,C,M,U)}catch(X){if(oe(H),X!==X+0)throw X;ae(1,0)}},M:function(E,$,C,M,U,H){var X=ie();try{return pe(E)($,C,M,U,H)}catch(Q){if(oe(X),Q!==Q+0)throw Q;ae(1,0)}},r:function(E,$,C,M,U,H){var X=ie();try{return pe(E)($,C,M,U,H)}catch(Q){if(oe(X),Q!==Q+0)throw Q;ae(1,0)}},v:function(E,$,C,M,U,H,X){var Q=ie();try{return pe(E)($,C,M,U,H,X)}catch(Z){if(oe(Q),Z!==Z+0)throw Z;ae(1,0)}},K:function(E,$,C,M,U,H,X,Q){var Z=ie();try{return pe(E)($,C,M,U,H,X,Q)}catch(se){if(oe(Z),se!==se+0)throw se;ae(1,0)}},D:function(E,$,C,M,U,H,X,Q,Z,se,ve,ke){var $e=ie();try{return pe(E)($,C,M,U,H,X,Q,Z,se,ve,ke)}catch(G){if(oe($e),G!==G+0)throw G;ae(1,0)}},X:function(E,$,C,M,U,H,X,Q){var Z=ie();try{return Tt(E,$,C,M,U,H,X,Q)}catch(se){if(oe(Z),se!==se+0)throw se;ae(1,0)}},V:function(E,$,C,M,U,H,X){var Q=ie();try{return mt(E,$,C,M,U,H,X)}catch(Z){if(oe(Q),Z!==Z+0)throw Z;ae(1,0)}},U:function(E,$,C,M,U){var H=ie();try{return St(E,$,C,M,U)}catch(X){if(oe(H),X!==X+0)throw X;ae(1,0)}},Z:function(E,$,C,M){var U=ie();try{return wt(E,$,C,M)}catch(H){if(oe(U),H!==H+0)throw H;ae(1,0)}},W:function(E){var $=ie();try{return gt(E)}catch(C){if(oe($),C!==C+0)throw C;ae(1,0)}},Y:function(E,$){var C=ie();try{return xt(E,$)}catch(M){if(oe(C),M!==M+0)throw M;ae(1,0)}},T:function(E,$,C){var M=ie();try{return bt(E,$,C)}catch(U){if(oe(M),U!==U+0)throw U;ae(1,0)}},f:function(E){var $=ie();try{pe(E)()}catch(C){if(oe($),C!==C+0)throw C;ae(1,0)}},q:function(E,$){var C=ie();try{pe(E)($)}catch(M){if(oe(C),M!==M+0)throw M;ae(1,0)}},h:function(E,$,C){var M=ie();try{pe(E)($,C)}catch(U){if(oe(M),U!==U+0)throw U;ae(1,0)}},da:function(E,$,C,M){var U=ie();try{pe(E)($,C,M)}catch(H){if(oe(U),H!==H+0)throw H;ae(1,0)}},l:function(E,$,C,M){var U=ie();try{pe(E)($,C,M)}catch(H){if(oe(U),H!==H+0)throw H;ae(1,0)}},t:function(E,$,C,M,U){var H=ie();try{pe(E)($,C,M,U)}catch(X){if(oe(H),X!==X+0)throw X;ae(1,0)}},u:function(E,$,C,M,U,H){var X=ie();try{pe(E)($,C,M,U,H)}catch(Q){if(oe(X),Q!==Q+0)throw Q;ae(1,0)}},x:function(E,$,C,M,U,H,X){var Q=ie();try{pe(E)($,C,M,U,H,X)}catch(Z){if(oe(Q),Z!==Z+0)throw Z;ae(1,0)}},z:function(E,$,C,M,U,H,X,Q){var Z=ie();try{pe(E)($,C,M,U,H,X,Q)}catch(se){if(oe(Z),se!==se+0)throw se;ae(1,0)}},ga:function(E,$,C,M,U,H,X,Q,Z){var se=ie();try{pe(E)($,C,M,U,H,X,Q,Z)}catch(ve){if(oe(se),ve!==ve+0)throw ve;ae(1,0)}},A:function(E,$,C,M,U,H,X,Q,Z,se,ve){var ke=ie();try{pe(E)($,C,M,U,H,X,Q,Z,se,ve)}catch($e){if(oe(ke),$e!==$e+0)throw $e;ae(1,0)}},C:function(E,$,C,M,U,H,X,Q,Z,se,ve,ke,$e,G,ge,Te){var Ge=ie();try{pe(E)($,C,M,U,H,X,Q,Z,se,ve,ke,$e,G,ge,Te)}catch(Qe){if(oe(Ge),Qe!==Qe+0)throw Qe;ae(1,0)}},aa:function(E,$,C,M,U,H,X,Q){var Z=ie();try{yt(E,$,C,M,U,H,X,Q)}catch(se){if(oe(Z),se!==se+0)throw se;ae(1,0)}},_:function(E,$,C,M,U,H,X,Q,Z,se,ve,ke){var $e=ie();try{vt(E,$,C,M,U,H,X,Q,Z,se,ve,ke)}catch(G){if(oe($e),G!==G+0)throw G;ae(1,0)}},$:function(E,$,C,M,U,H){var X=ie();try{_t(E,$,C,M,U,H)}catch(Q){if(oe(X),Q!==Q+0)throw Q;ae(1,0)}},n:function(E){return E},F:function(E){Re=E},ha:Et,y:function(E,$,C,M){return Et(E,$,C,M)}};(function(){function E(U){o.asm=U.exports,I=o.asm.Ka,me(),Pe=o.asm.ib,le.unshift(o.asm.La),Ce--,o.monitorRunDependencies&&o.monitorRunDependencies(Ce),Ce==0&&Fe&&(U=Fe,Fe=null,U())}function $(U){E(U.instance)}function C(U){return function(){if(!T&&(m||y)){if(typeof fetch=="function"&&!Ae.startsWith("file://"))return fetch(Ae,{credentials:"same-origin"}).then(function(H){if(!H.ok)throw"failed to load wasm binary file at '"+Ae+"'";return H.arrayBuffer()}).catch(function(){return Ue()});if(i)return new Promise(function(H,X){i(Ae,function(Q){H(new Uint8Array(Q))},X)})}return Promise.resolve().then(function(){return Ue()})}().then(function(H){return WebAssembly.instantiate(H,M)}).then(function(H){return H}).then(U,function(H){O("failed to asynchronously prepare wasm: "+H),Ee(H)})}var M={a:It};if(Ce++,o.monitorRunDependencies&&o.monitorRunDependencies(Ce),o.instantiateWasm)try{return o.instantiateWasm(M,E)}catch(U){return O("Module.instantiateWasm callback failed with error: "+U),!1}(T||typeof WebAssembly.instantiateStreaming!="function"||we()||Ae.startsWith("file://")||_||typeof fetch!="function"?C($):fetch(Ae,{credentials:"same-origin"}).then(function(U){return WebAssembly.instantiateStreaming(U,M).then($,function(H){return O("wasm streaming compile failed: "+H),O("falling back to ArrayBuffer instantiation"),C($)})})).catch(f)})(),o.___wasm_call_ctors=function(){return(o.___wasm_call_ctors=o.asm.La).apply(null,arguments)},o._OrtInit=function(){return(o._OrtInit=o.asm.Ma).apply(null,arguments)},o._OrtCreateSessionOptions=function(){return(o._OrtCreateSessionOptions=o.asm.Na).apply(null,arguments)},o._OrtAppendExecutionProvider=function(){return(o._OrtAppendExecutionProvider=o.asm.Oa).apply(null,arguments)},o._OrtAddSessionConfigEntry=function(){return(o._OrtAddSessionConfigEntry=o.asm.Pa).apply(null,arguments)},o._OrtReleaseSessionOptions=function(){return(o._OrtReleaseSessionOptions=o.asm.Qa).apply(null,arguments)},o._OrtCreateSession=function(){return(o._OrtCreateSession=o.asm.Ra).apply(null,arguments)},o._OrtReleaseSession=function(){return(o._OrtReleaseSession=o.asm.Sa).apply(null,arguments)},o._OrtGetInputCount=function(){return(o._OrtGetInputCount=o.asm.Ta).apply(null,arguments)},o._OrtGetOutputCount=function(){return(o._OrtGetOutputCount=o.asm.Ua).apply(null,arguments)},o._OrtGetInputName=function(){return(o._OrtGetInputName=o.asm.Va).apply(null,arguments)},o._OrtGetOutputName=function(){return(o._OrtGetOutputName=o.asm.Wa).apply(null,arguments)},o._OrtFree=function(){return(o._OrtFree=o.asm.Xa).apply(null,arguments)},o._OrtCreateTensor=function(){return(o._OrtCreateTensor=o.asm.Ya).apply(null,arguments)},o._OrtGetTensorData=function(){return(o._OrtGetTensorData=o.asm.Za).apply(null,arguments)},o._OrtReleaseTensor=function(){return(o._OrtReleaseTensor=o.asm._a).apply(null,arguments)},o._OrtCreateRunOptions=function(){return(o._OrtCreateRunOptions=o.asm.$a).apply(null,arguments)},o._OrtAddRunConfigEntry=function(){return(o._OrtAddRunConfigEntry=o.asm.ab).apply(null,arguments)},o._OrtReleaseRunOptions=function(){return(o._OrtReleaseRunOptions=o.asm.bb).apply(null,arguments)},o._OrtRun=function(){return(o._OrtRun=o.asm.cb).apply(null,arguments)},o._OrtEndProfiling=function(){return(o._OrtEndProfiling=o.asm.db).apply(null,arguments)};var Je,ye=o._malloc=function(){return(ye=o._malloc=o.asm.eb).apply(null,arguments)},rt=o._free=function(){return(rt=o._free=o.asm.fb).apply(null,arguments)},dt=o._fflush=function(){return(dt=o._fflush=o.asm.gb).apply(null,arguments)},it=o.___funcs_on_exit=function(){return(it=o.___funcs_on_exit=o.asm.hb).apply(null,arguments)},ae=o._setThrew=function(){return(ae=o._setThrew=o.asm.jb).apply(null,arguments)},ie=o.stackSave=function(){return(ie=o.stackSave=o.asm.kb).apply(null,arguments)},oe=o.stackRestore=function(){return(oe=o.stackRestore=o.asm.lb).apply(null,arguments)},pt=o.stackAlloc=function(){return(pt=o.stackAlloc=o.asm.mb).apply(null,arguments)},ot=o.___cxa_can_catch=function(){return(ot=o.___cxa_can_catch=o.asm.nb).apply(null,arguments)},ht=o.___cxa_is_pointer_type=function(){return(ht=o.___cxa_is_pointer_type=o.asm.ob).apply(null,arguments)},gt=o.dynCall_j=function(){return(gt=o.dynCall_j=o.asm.pb).apply(null,arguments)},mt=o.dynCall_iiiiij=function(){return(mt=o.dynCall_iiiiij=o.asm.qb).apply(null,arguments)},bt=o.dynCall_jii=function(){return(bt=o.dynCall_jii=o.asm.rb).apply(null,arguments)},yt=o.dynCall_viiiiij=function(){return(yt=o.dynCall_viiiiij=o.asm.sb).apply(null,arguments)},_t=o.dynCall_vjji=function(){return(_t=o.dynCall_vjji=o.asm.tb).apply(null,arguments)},vt=o.dynCall_viiijjjii=function(){return(vt=o.dynCall_viiijjjii=o.asm.ub).apply(null,arguments)},wt=o.dynCall_iij=function(){return(wt=o.dynCall_iij=o.asm.vb).apply(null,arguments)},xt=o.dynCall_ji=function(){return(xt=o.dynCall_ji=o.asm.wb).apply(null,arguments)},Tt=o.dynCall_iiiiiij=function(){return(Tt=o.dynCall_iiiiiij=o.asm.xb).apply(null,arguments)},St=o.dynCall_iiij=function(){return(St=o.dynCall_iiij=o.asm.yb).apply(null,arguments)};function Ot(){function E(){if(!Je&&(Je=!0,o.calledRun=!0,!k)){if(We(le),c(o),o.onRuntimeInitialized&&o.onRuntimeInitialized(),o.postRun)for(typeof o.postRun=="function"&&(o.postRun=[o.postRun]);o.postRun.length;){var $=o.postRun.shift();_e.unshift($)}We(_e)}}if(!(0{D.exports=function(u,b){for(var g=new Array(arguments.length-1),p=0,h=2,o=!0;h{var b=u;b.length=function(c){var f=c.length;if(!f)return 0;for(var s=0;--f%4>1&&c.charAt(f)==="=";)++s;return Math.ceil(3*c.length)/4-s};for(var g=new Array(64),p=new Array(123),h=0;h<64;)p[g[h]=h<26?h+65:h<52?h+71:h<62?h-4:h-59|43]=h++;b.encode=function(c,f,s){for(var i,t=null,e=[],n=0,r=0;f>2],i=(3&a)<<4,r=1;break;case 1:e[n++]=g[i|a>>4],i=(15&a)<<2,r=2;break;case 2:e[n++]=g[i|a>>6],e[n++]=g[63&a],r=0}n>8191&&((t||(t=[])).push(String.fromCharCode.apply(String,e)),n=0)}return r&&(e[n++]=g[i],e[n++]=61,r===1&&(e[n++]=61)),t?(n&&t.push(String.fromCharCode.apply(String,e.slice(0,n))),t.join("")):String.fromCharCode.apply(String,e.slice(0,n))};var o="invalid encoding";b.decode=function(c,f,s){for(var i,t=s,e=0,n=0;n1)break;if((r=p[r])===void 0)throw Error(o);switch(e){case 0:i=r,e=1;break;case 1:f[s++]=i<<2|(48&r)>>4,i=r,e=2;break;case 2:f[s++]=(15&i)<<4|(60&r)>>2,i=r,e=3;break;case 3:f[s++]=(3&i)<<6|r,e=0}}if(e===1)throw Error(o);return s-t},b.test=function(c){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(c)}},9211:D=>{function u(){this._listeners={}}D.exports=u,u.prototype.on=function(b,g,p){return(this._listeners[b]||(this._listeners[b]=[])).push({fn:g,ctx:p||this}),this},u.prototype.off=function(b,g){if(b===void 0)this._listeners={};else if(g===void 0)this._listeners[b]=[];else for(var p=this._listeners[b],h=0;h{function u(o){return typeof Float32Array<"u"?function(){var c=new Float32Array([-0]),f=new Uint8Array(c.buffer),s=f[3]===128;function i(r,a,l){c[0]=r,a[l]=f[0],a[l+1]=f[1],a[l+2]=f[2],a[l+3]=f[3]}function t(r,a,l){c[0]=r,a[l]=f[3],a[l+1]=f[2],a[l+2]=f[1],a[l+3]=f[0]}function e(r,a){return f[0]=r[a],f[1]=r[a+1],f[2]=r[a+2],f[3]=r[a+3],c[0]}function n(r,a){return f[3]=r[a],f[2]=r[a+1],f[1]=r[a+2],f[0]=r[a+3],c[0]}o.writeFloatLE=s?i:t,o.writeFloatBE=s?t:i,o.readFloatLE=s?e:n,o.readFloatBE=s?n:e}():function(){function c(s,i,t,e){var n=i<0?1:0;if(n&&(i=-i),i===0)s(1/i>0?0:2147483648,t,e);else if(isNaN(i))s(2143289344,t,e);else if(i>34028234663852886e22)s((n<<31|2139095040)>>>0,t,e);else if(i<11754943508222875e-54)s((n<<31|Math.round(i/1401298464324817e-60))>>>0,t,e);else{var r=Math.floor(Math.log(i)/Math.LN2);s((n<<31|r+127<<23|8388607&Math.round(i*Math.pow(2,-r)*8388608))>>>0,t,e)}}function f(s,i,t){var e=s(i,t),n=2*(e>>31)+1,r=e>>>23&255,a=8388607&e;return r===255?a?NaN:n*(1/0):r===0?1401298464324817e-60*n*a:n*Math.pow(2,r-150)*(a+8388608)}o.writeFloatLE=c.bind(null,b),o.writeFloatBE=c.bind(null,g),o.readFloatLE=f.bind(null,p),o.readFloatBE=f.bind(null,h)}(),typeof Float64Array<"u"?function(){var c=new Float64Array([-0]),f=new Uint8Array(c.buffer),s=f[7]===128;function i(r,a,l){c[0]=r,a[l]=f[0],a[l+1]=f[1],a[l+2]=f[2],a[l+3]=f[3],a[l+4]=f[4],a[l+5]=f[5],a[l+6]=f[6],a[l+7]=f[7]}function t(r,a,l){c[0]=r,a[l]=f[7],a[l+1]=f[6],a[l+2]=f[5],a[l+3]=f[4],a[l+4]=f[3],a[l+5]=f[2],a[l+6]=f[1],a[l+7]=f[0]}function e(r,a){return f[0]=r[a],f[1]=r[a+1],f[2]=r[a+2],f[3]=r[a+3],f[4]=r[a+4],f[5]=r[a+5],f[6]=r[a+6],f[7]=r[a+7],c[0]}function n(r,a){return f[7]=r[a],f[6]=r[a+1],f[5]=r[a+2],f[4]=r[a+3],f[3]=r[a+4],f[2]=r[a+5],f[1]=r[a+6],f[0]=r[a+7],c[0]}o.writeDoubleLE=s?i:t,o.writeDoubleBE=s?t:i,o.readDoubleLE=s?e:n,o.readDoubleBE=s?n:e}():function(){function c(s,i,t,e,n,r){var a=e<0?1:0;if(a&&(e=-e),e===0)s(0,n,r+i),s(1/e>0?0:2147483648,n,r+t);else if(isNaN(e))s(0,n,r+i),s(2146959360,n,r+t);else if(e>17976931348623157e292)s(0,n,r+i),s((a<<31|2146435072)>>>0,n,r+t);else{var l;if(e<22250738585072014e-324)s((l=e/5e-324)>>>0,n,r+i),s((a<<31|l/4294967296)>>>0,n,r+t);else{var d=Math.floor(Math.log(e)/Math.LN2);d===1024&&(d=1023),s(4503599627370496*(l=e*Math.pow(2,-d))>>>0,n,r+i),s((a<<31|d+1023<<20|1048576*l&1048575)>>>0,n,r+t)}}}function f(s,i,t,e,n){var r=s(e,n+i),a=s(e,n+t),l=2*(a>>31)+1,d=a>>>20&2047,m=4294967296*(1048575&a)+r;return d===2047?m?NaN:l*(1/0):d===0?5e-324*l*m:l*Math.pow(2,d-1075)*(m+4503599627370496)}o.writeDoubleLE=c.bind(null,b,0,4),o.writeDoubleBE=c.bind(null,g,4,0),o.readDoubleLE=f.bind(null,p,0,4),o.readDoubleBE=f.bind(null,h,4,0)}(),o}function b(o,c,f){c[f]=255&o,c[f+1]=o>>>8&255,c[f+2]=o>>>16&255,c[f+3]=o>>>24}function g(o,c,f){c[f]=o>>>24,c[f+1]=o>>>16&255,c[f+2]=o>>>8&255,c[f+3]=255&o}function p(o,c){return(o[c]|o[c+1]<<8|o[c+2]<<16|o[c+3]<<24)>>>0}function h(o,c){return(o[c]<<24|o[c+1]<<16|o[c+2]<<8|o[c+3])>>>0}D.exports=u(u)},7199:module=>{function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(D){}return null}module.exports=inquire},6662:D=>{D.exports=function(u,b,g){var p=g||8192,h=p>>>1,o=null,c=p;return function(f){if(f<1||f>h)return u(f);c+f>p&&(o=u(p),c=0);var s=b.call(o,c,c+=f);return 7&c&&(c=1+(7|c)),s}}},4997:(D,u)=>{var b=u;b.length=function(g){for(var p=0,h=0,o=0;o191&&o<224?f[s++]=(31&o)<<6|63&g[p++]:o>239&&o<365?(o=((7&o)<<18|(63&g[p++])<<12|(63&g[p++])<<6|63&g[p++])-65536,f[s++]=55296+(o>>10),f[s++]=56320+(1023&o)):f[s++]=(15&o)<<12|(63&g[p++])<<6|63&g[p++],s>8191&&((c||(c=[])).push(String.fromCharCode.apply(String,f)),s=0);return c?(s&&c.push(String.fromCharCode.apply(String,f.slice(0,s))),c.join("")):String.fromCharCode.apply(String,f.slice(0,s))},b.write=function(g,p,h){for(var o,c,f=h,s=0;s>6|192,p[h++]=63&o|128):(64512&o)==55296&&(64512&(c=g.charCodeAt(s+1)))==56320?(o=65536+((1023&o)<<10)+(1023&c),++s,p[h++]=o>>18|240,p[h++]=o>>12&63|128,p[h++]=o>>6&63|128,p[h++]=63&o|128):(p[h++]=o>>12|224,p[h++]=o>>6&63|128,p[h++]=63&o|128);return h-f}},3442:(D,u)=>{u.__esModule=!0;var b=function(){function g(p){if(!p)throw new TypeError("Invalid argument; `value` has no value.");this.value=g.EMPTY,p&&g.isGuid(p)&&(this.value=p)}return g.isGuid=function(p){var h=p.toString();return p&&(p instanceof g||g.validator.test(h))},g.create=function(){return new g([g.gen(2),g.gen(1),g.gen(1),g.gen(1),g.gen(3)].join("-"))},g.createEmpty=function(){return new g("emptyguid")},g.parse=function(p){return new g(p)},g.raw=function(){return[g.gen(2),g.gen(1),g.gen(1),g.gen(1),g.gen(3)].join("-")},g.gen=function(p){for(var h="",o=0;o{D.exports=b;var u=null;try{u=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}function b(w,I,R){this.low=0|w,this.high=0|I,this.unsigned=!!R}function g(w){return(w&&w.__isLong__)===!0}b.prototype.__isLong__,Object.defineProperty(b.prototype,"__isLong__",{value:!0}),b.isLong=g;var p={},h={};function o(w,I){var R,B,j;return I?(j=0<=(w>>>=0)&&w<256)&&(B=h[w])?B:(R=f(w,(0|w)<0?-1:0,!0),j&&(h[w]=R),R):(j=-128<=(w|=0)&&w<128)&&(B=p[w])?B:(R=f(w,w<0?-1:0,!1),j&&(p[w]=R),R)}function c(w,I){if(isNaN(w))return I?d:l;if(I){if(w<0)return d;if(w>=n)return T}else{if(w<=-9223372036854776e3)return S;if(w+1>=r)return v}return w<0?c(-w,I).neg():f(w%e|0,w/e|0,I)}function f(w,I,R){return new b(w,I,R)}b.fromInt=o,b.fromNumber=c,b.fromBits=f;var s=Math.pow;function i(w,I,R){if(w.length===0)throw Error("empty string");if(w==="NaN"||w==="Infinity"||w==="+Infinity"||w==="-Infinity")return l;if(typeof I=="number"?(R=I,I=!1):I=!!I,(R=R||10)<2||360)throw Error("interior hyphen");if(B===0)return i(w.substring(1),I,R).neg();for(var j=c(s(R,8)),N=l,W=0;W>>0:this.low},O.toNumber=function(){return this.unsigned?(this.high>>>0)*e+(this.low>>>0):this.high*e+(this.low>>>0)},O.toString=function(w){if((w=w||10)<2||36>>0).toString(w);if((N=k).isZero())return V+W;for(;V.length<6;)V="0"+V;W=""+V+W}},O.getHighBits=function(){return this.high},O.getHighBitsUnsigned=function(){return this.high>>>0},O.getLowBits=function(){return this.low},O.getLowBitsUnsigned=function(){return this.low>>>0},O.getNumBitsAbs=function(){if(this.isNegative())return this.eq(S)?64:this.neg().getNumBitsAbs();for(var w=this.high!=0?this.high:this.low,I=31;I>0&&(w&1<=0},O.isOdd=function(){return(1&this.low)==1},O.isEven=function(){return(1&this.low)==0},O.equals=function(w){return g(w)||(w=t(w)),(this.unsigned===w.unsigned||this.high>>>31!=1||w.high>>>31!=1)&&this.high===w.high&&this.low===w.low},O.eq=O.equals,O.notEquals=function(w){return!this.eq(w)},O.neq=O.notEquals,O.ne=O.notEquals,O.lessThan=function(w){return this.comp(w)<0},O.lt=O.lessThan,O.lessThanOrEqual=function(w){return this.comp(w)<=0},O.lte=O.lessThanOrEqual,O.le=O.lessThanOrEqual,O.greaterThan=function(w){return this.comp(w)>0},O.gt=O.greaterThan,O.greaterThanOrEqual=function(w){return this.comp(w)>=0},O.gte=O.greaterThanOrEqual,O.ge=O.greaterThanOrEqual,O.compare=function(w){if(g(w)||(w=t(w)),this.eq(w))return 0;var I=this.isNegative(),R=w.isNegative();return I&&!R?-1:!I&&R?1:this.unsigned?w.high>>>0>this.high>>>0||w.high===this.high&&w.low>>>0>this.low>>>0?-1:1:this.sub(w).isNegative()?-1:1},O.comp=O.compare,O.negate=function(){return!this.unsigned&&this.eq(S)?S:this.not().add(m)},O.neg=O.negate,O.add=function(w){g(w)||(w=t(w));var I=this.high>>>16,R=65535&this.high,B=this.low>>>16,j=65535&this.low,N=w.high>>>16,W=65535&w.high,k=w.low>>>16,V=0,J=0,Y=0,te=0;return Y+=(te+=j+(65535&w.low))>>>16,J+=(Y+=B+k)>>>16,V+=(J+=R+W)>>>16,V+=I+N,f((Y&=65535)<<16|(te&=65535),(V&=65535)<<16|(J&=65535),this.unsigned)},O.subtract=function(w){return g(w)||(w=t(w)),this.add(w.neg())},O.sub=O.subtract,O.multiply=function(w){if(this.isZero())return l;if(g(w)||(w=t(w)),u)return f(u.mul(this.low,this.high,w.low,w.high),u.get_high(),this.unsigned);if(w.isZero())return l;if(this.eq(S))return w.isOdd()?S:l;if(w.eq(S))return this.isOdd()?S:l;if(this.isNegative())return w.isNegative()?this.neg().mul(w.neg()):this.neg().mul(w).neg();if(w.isNegative())return this.mul(w.neg()).neg();if(this.lt(a)&&w.lt(a))return c(this.toNumber()*w.toNumber(),this.unsigned);var I=this.high>>>16,R=65535&this.high,B=this.low>>>16,j=65535&this.low,N=w.high>>>16,W=65535&w.high,k=w.low>>>16,V=65535&w.low,J=0,Y=0,te=0,ne=0;return te+=(ne+=j*V)>>>16,Y+=(te+=B*V)>>>16,te&=65535,Y+=(te+=j*k)>>>16,J+=(Y+=R*V)>>>16,Y&=65535,J+=(Y+=B*k)>>>16,Y&=65535,J+=(Y+=j*W)>>>16,J+=I*V+R*k+B*W+j*N,f((te&=65535)<<16|(ne&=65535),(J&=65535)<<16|(Y&=65535),this.unsigned)},O.mul=O.multiply,O.divide=function(w){if(g(w)||(w=t(w)),w.isZero())throw Error("division by zero");var I,R,B;if(u)return this.unsigned||this.high!==-2147483648||w.low!==-1||w.high!==-1?f((this.unsigned?u.div_u:u.div_s)(this.low,this.high,w.low,w.high),u.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?d:l;if(this.unsigned){if(w.unsigned||(w=w.toUnsigned()),w.gt(this))return d;if(w.gt(this.shru(1)))return y;B=d}else{if(this.eq(S))return w.eq(m)||w.eq(_)?S:w.eq(S)?m:(I=this.shr(1).div(w).shl(1)).eq(l)?w.isNegative()?m:_:(R=this.sub(w.mul(I)),B=I.add(R.div(w)));if(w.eq(S))return this.unsigned?d:l;if(this.isNegative())return w.isNegative()?this.neg().div(w.neg()):this.neg().div(w).neg();if(w.isNegative())return this.div(w.neg()).neg();B=l}for(R=this;R.gte(w);){I=Math.max(1,Math.floor(R.toNumber()/w.toNumber()));for(var j=Math.ceil(Math.log(I)/Math.LN2),N=j<=48?1:s(2,j-48),W=c(I),k=W.mul(w);k.isNegative()||k.gt(R);)k=(W=c(I-=N,this.unsigned)).mul(w);W.isZero()&&(W=m),B=B.add(W),R=R.sub(k)}return B},O.div=O.divide,O.modulo=function(w){return g(w)||(w=t(w)),u?f((this.unsigned?u.rem_u:u.rem_s)(this.low,this.high,w.low,w.high),u.get_high(),this.unsigned):this.sub(this.div(w).mul(w))},O.mod=O.modulo,O.rem=O.modulo,O.not=function(){return f(~this.low,~this.high,this.unsigned)},O.and=function(w){return g(w)||(w=t(w)),f(this.low&w.low,this.high&w.high,this.unsigned)},O.or=function(w){return g(w)||(w=t(w)),f(this.low|w.low,this.high|w.high,this.unsigned)},O.xor=function(w){return g(w)||(w=t(w)),f(this.low^w.low,this.high^w.high,this.unsigned)},O.shiftLeft=function(w){return g(w)&&(w=w.toInt()),(w&=63)==0?this:w<32?f(this.low<>>32-w,this.unsigned):f(0,this.low<>>w|this.high<<32-w,this.high>>w,this.unsigned):f(this.high>>w-32,this.high>=0?0:-1,this.unsigned)},O.shr=O.shiftRight,O.shiftRightUnsigned=function(w){if(g(w)&&(w=w.toInt()),(w&=63)==0)return this;var I=this.high;return w<32?f(this.low>>>w|I<<32-w,I>>>w,this.unsigned):f(w===32?I:I>>>w-32,0,this.unsigned)},O.shru=O.shiftRightUnsigned,O.shr_u=O.shiftRightUnsigned,O.toSigned=function(){return this.unsigned?f(this.low,this.high,!1):this},O.toUnsigned=function(){return this.unsigned?this:f(this.low,this.high,!0)},O.toBytes=function(w){return w?this.toBytesLE():this.toBytesBE()},O.toBytesLE=function(){var w=this.high,I=this.low;return[255&I,I>>>8&255,I>>>16&255,I>>>24,255&w,w>>>8&255,w>>>16&255,w>>>24]},O.toBytesBE=function(){var w=this.high,I=this.low;return[w>>>24,w>>>16&255,w>>>8&255,255&w,I>>>24,I>>>16&255,I>>>8&255,255&I]},b.fromBytes=function(w,I,R){return R?b.fromBytesLE(w,I):b.fromBytesBE(w,I)},b.fromBytesLE=function(w,I){return new b(w[0]|w[1]<<8|w[2]<<16|w[3]<<24,w[4]|w[5]<<8|w[6]<<16|w[7]<<24,I)},b.fromBytesBE=function(w,I){return new b(w[4]<<24|w[5]<<16|w[6]<<8|w[7],w[0]<<24|w[1]<<16|w[2]<<8|w[3],I)}},1446:(D,u,b)=>{var g,p,h,o=b(2100),c=o.Reader,f=o.Writer,s=o.util,i=o.roots.default||(o.roots.default={});i.onnx=((h={}).Version=(g={},(p=Object.create(g))[g[0]="_START_VERSION"]=0,p[g[1]="IR_VERSION_2017_10_10"]=1,p[g[2]="IR_VERSION_2017_10_30"]=2,p[g[3]="IR_VERSION_2017_11_3"]=3,p[g[4]="IR_VERSION_2019_1_22"]=4,p[g[5]="IR_VERSION"]=5,p),h.AttributeProto=function(){function t(e){if(this.floats=[],this.ints=[],this.strings=[],this.tensors=[],this.graphs=[],e)for(var n=Object.keys(e),r=0;r>>3){case 1:a.name=e.string();break;case 21:a.refAttrName=e.string();break;case 13:a.docString=e.string();break;case 20:a.type=e.int32();break;case 2:a.f=e.float();break;case 3:a.i=e.int64();break;case 4:a.s=e.bytes();break;case 5:a.t=i.onnx.TensorProto.decode(e,e.uint32());break;case 6:a.g=i.onnx.GraphProto.decode(e,e.uint32());break;case 7:if(a.floats&&a.floats.length||(a.floats=[]),(7&l)==2)for(var d=e.uint32()+e.pos;e.pos>>0,e.i.high>>>0).toNumber())),e.s!=null&&(typeof e.s=="string"?s.base64.decode(e.s,n.s=s.newBuffer(s.base64.length(e.s)),0):e.s.length&&(n.s=e.s)),e.t!=null){if(typeof e.t!="object")throw TypeError(".onnx.AttributeProto.t: object expected");n.t=i.onnx.TensorProto.fromObject(e.t)}if(e.g!=null){if(typeof e.g!="object")throw TypeError(".onnx.AttributeProto.g: object expected");n.g=i.onnx.GraphProto.fromObject(e.g)}if(e.floats){if(!Array.isArray(e.floats))throw TypeError(".onnx.AttributeProto.floats: array expected");n.floats=[];for(var r=0;r>>0,e.ints[r].high>>>0).toNumber())}if(e.strings){if(!Array.isArray(e.strings))throw TypeError(".onnx.AttributeProto.strings: array expected");for(n.strings=[],r=0;r>>0,e.i.high>>>0).toNumber():e.i),e.s!=null&&e.hasOwnProperty("s")&&(r.s=n.bytes===String?s.base64.encode(e.s,0,e.s.length):n.bytes===Array?Array.prototype.slice.call(e.s):e.s),e.t!=null&&e.hasOwnProperty("t")&&(r.t=i.onnx.TensorProto.toObject(e.t,n)),e.g!=null&&e.hasOwnProperty("g")&&(r.g=i.onnx.GraphProto.toObject(e.g,n)),e.floats&&e.floats.length){r.floats=[];for(var l=0;l>>0,e.ints[l].high>>>0).toNumber():e.ints[l];if(e.strings&&e.strings.length)for(r.strings=[],l=0;l>>3){case 1:a.name=e.string();break;case 2:a.type=i.onnx.TypeProto.decode(e,e.uint32());break;case 3:a.docString=e.string();break;default:e.skipType(7&l)}}return a},t.decodeDelimited=function(e){return e instanceof c||(e=new c(e)),this.decode(e,e.uint32())},t.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.name!=null&&e.hasOwnProperty("name")&&!s.isString(e.name))return"name: string expected";if(e.type!=null&&e.hasOwnProperty("type")){var n=i.onnx.TypeProto.verify(e.type);if(n)return"type."+n}return e.docString!=null&&e.hasOwnProperty("docString")&&!s.isString(e.docString)?"docString: string expected":null},t.fromObject=function(e){if(e instanceof i.onnx.ValueInfoProto)return e;var n=new i.onnx.ValueInfoProto;if(e.name!=null&&(n.name=String(e.name)),e.type!=null){if(typeof e.type!="object")throw TypeError(".onnx.ValueInfoProto.type: object expected");n.type=i.onnx.TypeProto.fromObject(e.type)}return e.docString!=null&&(n.docString=String(e.docString)),n},t.toObject=function(e,n){n||(n={});var r={};return n.defaults&&(r.name="",r.type=null,r.docString=""),e.name!=null&&e.hasOwnProperty("name")&&(r.name=e.name),e.type!=null&&e.hasOwnProperty("type")&&(r.type=i.onnx.TypeProto.toObject(e.type,n)),e.docString!=null&&e.hasOwnProperty("docString")&&(r.docString=e.docString),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,o.util.toJSONOptions)},t}(),h.NodeProto=function(){function t(e){if(this.input=[],this.output=[],this.attribute=[],e)for(var n=Object.keys(e),r=0;r>>3){case 1:a.input&&a.input.length||(a.input=[]),a.input.push(e.string());break;case 2:a.output&&a.output.length||(a.output=[]),a.output.push(e.string());break;case 3:a.name=e.string();break;case 4:a.opType=e.string();break;case 7:a.domain=e.string();break;case 5:a.attribute&&a.attribute.length||(a.attribute=[]),a.attribute.push(i.onnx.AttributeProto.decode(e,e.uint32()));break;case 6:a.docString=e.string();break;default:e.skipType(7&l)}}return a},t.decodeDelimited=function(e){return e instanceof c||(e=new c(e)),this.decode(e,e.uint32())},t.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.input!=null&&e.hasOwnProperty("input")){if(!Array.isArray(e.input))return"input: array expected";for(var n=0;n>>3){case 1:a.irVersion=e.int64();break;case 8:a.opsetImport&&a.opsetImport.length||(a.opsetImport=[]),a.opsetImport.push(i.onnx.OperatorSetIdProto.decode(e,e.uint32()));break;case 2:a.producerName=e.string();break;case 3:a.producerVersion=e.string();break;case 4:a.domain=e.string();break;case 5:a.modelVersion=e.int64();break;case 6:a.docString=e.string();break;case 7:a.graph=i.onnx.GraphProto.decode(e,e.uint32());break;case 14:a.metadataProps&&a.metadataProps.length||(a.metadataProps=[]),a.metadataProps.push(i.onnx.StringStringEntryProto.decode(e,e.uint32()));break;default:e.skipType(7&l)}}return a},t.decodeDelimited=function(e){return e instanceof c||(e=new c(e)),this.decode(e,e.uint32())},t.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.irVersion!=null&&e.hasOwnProperty("irVersion")&&!(s.isInteger(e.irVersion)||e.irVersion&&s.isInteger(e.irVersion.low)&&s.isInteger(e.irVersion.high)))return"irVersion: integer|Long expected";if(e.opsetImport!=null&&e.hasOwnProperty("opsetImport")){if(!Array.isArray(e.opsetImport))return"opsetImport: array expected";for(var n=0;n>>0,e.irVersion.high>>>0).toNumber())),e.opsetImport){if(!Array.isArray(e.opsetImport))throw TypeError(".onnx.ModelProto.opsetImport: array expected");n.opsetImport=[];for(var r=0;r>>0,e.modelVersion.high>>>0).toNumber())),e.docString!=null&&(n.docString=String(e.docString)),e.graph!=null){if(typeof e.graph!="object")throw TypeError(".onnx.ModelProto.graph: object expected");n.graph=i.onnx.GraphProto.fromObject(e.graph)}if(e.metadataProps){if(!Array.isArray(e.metadataProps))throw TypeError(".onnx.ModelProto.metadataProps: array expected");for(n.metadataProps=[],r=0;r>>0,e.irVersion.high>>>0).toNumber():e.irVersion),e.producerName!=null&&e.hasOwnProperty("producerName")&&(r.producerName=e.producerName),e.producerVersion!=null&&e.hasOwnProperty("producerVersion")&&(r.producerVersion=e.producerVersion),e.domain!=null&&e.hasOwnProperty("domain")&&(r.domain=e.domain),e.modelVersion!=null&&e.hasOwnProperty("modelVersion")&&(typeof e.modelVersion=="number"?r.modelVersion=n.longs===String?String(e.modelVersion):e.modelVersion:r.modelVersion=n.longs===String?s.Long.prototype.toString.call(e.modelVersion):n.longs===Number?new s.LongBits(e.modelVersion.low>>>0,e.modelVersion.high>>>0).toNumber():e.modelVersion),e.docString!=null&&e.hasOwnProperty("docString")&&(r.docString=e.docString),e.graph!=null&&e.hasOwnProperty("graph")&&(r.graph=i.onnx.GraphProto.toObject(e.graph,n)),e.opsetImport&&e.opsetImport.length){r.opsetImport=[];for(var l=0;l>>3){case 1:a.key=e.string();break;case 2:a.value=e.string();break;default:e.skipType(7&l)}}return a},t.decodeDelimited=function(e){return e instanceof c||(e=new c(e)),this.decode(e,e.uint32())},t.verify=function(e){return typeof e!="object"||e===null?"object expected":e.key!=null&&e.hasOwnProperty("key")&&!s.isString(e.key)?"key: string expected":e.value!=null&&e.hasOwnProperty("value")&&!s.isString(e.value)?"value: string expected":null},t.fromObject=function(e){if(e instanceof i.onnx.StringStringEntryProto)return e;var n=new i.onnx.StringStringEntryProto;return e.key!=null&&(n.key=String(e.key)),e.value!=null&&(n.value=String(e.value)),n},t.toObject=function(e,n){n||(n={});var r={};return n.defaults&&(r.key="",r.value=""),e.key!=null&&e.hasOwnProperty("key")&&(r.key=e.key),e.value!=null&&e.hasOwnProperty("value")&&(r.value=e.value),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,o.util.toJSONOptions)},t}(),h.TensorAnnotation=function(){function t(e){if(this.quantParameterTensorNames=[],e)for(var n=Object.keys(e),r=0;r>>3){case 1:a.tensorName=e.string();break;case 2:a.quantParameterTensorNames&&a.quantParameterTensorNames.length||(a.quantParameterTensorNames=[]),a.quantParameterTensorNames.push(i.onnx.StringStringEntryProto.decode(e,e.uint32()));break;default:e.skipType(7&l)}}return a},t.decodeDelimited=function(e){return e instanceof c||(e=new c(e)),this.decode(e,e.uint32())},t.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.tensorName!=null&&e.hasOwnProperty("tensorName")&&!s.isString(e.tensorName))return"tensorName: string expected";if(e.quantParameterTensorNames!=null&&e.hasOwnProperty("quantParameterTensorNames")){if(!Array.isArray(e.quantParameterTensorNames))return"quantParameterTensorNames: array expected";for(var n=0;n>>3){case 1:a.node&&a.node.length||(a.node=[]),a.node.push(i.onnx.NodeProto.decode(e,e.uint32()));break;case 2:a.name=e.string();break;case 5:a.initializer&&a.initializer.length||(a.initializer=[]),a.initializer.push(i.onnx.TensorProto.decode(e,e.uint32()));break;case 10:a.docString=e.string();break;case 11:a.input&&a.input.length||(a.input=[]),a.input.push(i.onnx.ValueInfoProto.decode(e,e.uint32()));break;case 12:a.output&&a.output.length||(a.output=[]),a.output.push(i.onnx.ValueInfoProto.decode(e,e.uint32()));break;case 13:a.valueInfo&&a.valueInfo.length||(a.valueInfo=[]),a.valueInfo.push(i.onnx.ValueInfoProto.decode(e,e.uint32()));break;case 14:a.quantizationAnnotation&&a.quantizationAnnotation.length||(a.quantizationAnnotation=[]),a.quantizationAnnotation.push(i.onnx.TensorAnnotation.decode(e,e.uint32()));break;default:e.skipType(7&l)}}return a},t.decodeDelimited=function(e){return e instanceof c||(e=new c(e)),this.decode(e,e.uint32())},t.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.node!=null&&e.hasOwnProperty("node")){if(!Array.isArray(e.node))return"node: array expected";for(var n=0;n>>3){case 1:if(a.dims&&a.dims.length||(a.dims=[]),(7&l)==2)for(var d=e.uint32()+e.pos;e.pos>>0,e.dims[r].high>>>0).toNumber())}if(e.dataType!=null&&(n.dataType=0|e.dataType),e.segment!=null){if(typeof e.segment!="object")throw TypeError(".onnx.TensorProto.segment: object expected");n.segment=i.onnx.TensorProto.Segment.fromObject(e.segment)}if(e.floatData){if(!Array.isArray(e.floatData))throw TypeError(".onnx.TensorProto.floatData: array expected");for(n.floatData=[],r=0;r>>0,e.int64Data[r].high>>>0).toNumber())}if(e.name!=null&&(n.name=String(e.name)),e.docString!=null&&(n.docString=String(e.docString)),e.rawData!=null&&(typeof e.rawData=="string"?s.base64.decode(e.rawData,n.rawData=s.newBuffer(s.base64.length(e.rawData)),0):e.rawData.length&&(n.rawData=e.rawData)),e.externalData){if(!Array.isArray(e.externalData))throw TypeError(".onnx.TensorProto.externalData: array expected");for(n.externalData=[],r=0;r>>0,e.uint64Data[r].high>>>0).toNumber(!0))}return n},t.toObject=function(e,n){n||(n={});var r={};if((n.arrays||n.defaults)&&(r.dims=[],r.floatData=[],r.int32Data=[],r.stringData=[],r.int64Data=[],r.doubleData=[],r.uint64Data=[],r.externalData=[]),n.defaults&&(r.dataType=0,r.segment=null,r.name="",n.bytes===String?r.rawData="":(r.rawData=[],n.bytes!==Array&&(r.rawData=s.newBuffer(r.rawData))),r.docString="",r.dataLocation=n.enums===String?"DEFAULT":0),e.dims&&e.dims.length){r.dims=[];for(var a=0;a>>0,e.dims[a].high>>>0).toNumber():e.dims[a]}if(e.dataType!=null&&e.hasOwnProperty("dataType")&&(r.dataType=e.dataType),e.segment!=null&&e.hasOwnProperty("segment")&&(r.segment=i.onnx.TensorProto.Segment.toObject(e.segment,n)),e.floatData&&e.floatData.length)for(r.floatData=[],a=0;a>>0,e.int64Data[a].high>>>0).toNumber():e.int64Data[a];if(e.name!=null&&e.hasOwnProperty("name")&&(r.name=e.name),e.rawData!=null&&e.hasOwnProperty("rawData")&&(r.rawData=n.bytes===String?s.base64.encode(e.rawData,0,e.rawData.length):n.bytes===Array?Array.prototype.slice.call(e.rawData):e.rawData),e.doubleData&&e.doubleData.length)for(r.doubleData=[],a=0;a>>0,e.uint64Data[a].high>>>0).toNumber(!0):e.uint64Data[a];if(e.docString!=null&&e.hasOwnProperty("docString")&&(r.docString=e.docString),e.externalData&&e.externalData.length)for(r.externalData=[],a=0;a>>3){case 1:l.begin=n.int64();break;case 2:l.end=n.int64();break;default:n.skipType(7&d)}}return l},e.decodeDelimited=function(n){return n instanceof c||(n=new c(n)),this.decode(n,n.uint32())},e.verify=function(n){return typeof n!="object"||n===null?"object expected":n.begin!=null&&n.hasOwnProperty("begin")&&!(s.isInteger(n.begin)||n.begin&&s.isInteger(n.begin.low)&&s.isInteger(n.begin.high))?"begin: integer|Long expected":n.end!=null&&n.hasOwnProperty("end")&&!(s.isInteger(n.end)||n.end&&s.isInteger(n.end.low)&&s.isInteger(n.end.high))?"end: integer|Long expected":null},e.fromObject=function(n){if(n instanceof i.onnx.TensorProto.Segment)return n;var r=new i.onnx.TensorProto.Segment;return n.begin!=null&&(s.Long?(r.begin=s.Long.fromValue(n.begin)).unsigned=!1:typeof n.begin=="string"?r.begin=parseInt(n.begin,10):typeof n.begin=="number"?r.begin=n.begin:typeof n.begin=="object"&&(r.begin=new s.LongBits(n.begin.low>>>0,n.begin.high>>>0).toNumber())),n.end!=null&&(s.Long?(r.end=s.Long.fromValue(n.end)).unsigned=!1:typeof n.end=="string"?r.end=parseInt(n.end,10):typeof n.end=="number"?r.end=n.end:typeof n.end=="object"&&(r.end=new s.LongBits(n.end.low>>>0,n.end.high>>>0).toNumber())),r},e.toObject=function(n,r){r||(r={});var a={};if(r.defaults){if(s.Long){var l=new s.Long(0,0,!1);a.begin=r.longs===String?l.toString():r.longs===Number?l.toNumber():l}else a.begin=r.longs===String?"0":0;s.Long?(l=new s.Long(0,0,!1),a.end=r.longs===String?l.toString():r.longs===Number?l.toNumber():l):a.end=r.longs===String?"0":0}return n.begin!=null&&n.hasOwnProperty("begin")&&(typeof n.begin=="number"?a.begin=r.longs===String?String(n.begin):n.begin:a.begin=r.longs===String?s.Long.prototype.toString.call(n.begin):r.longs===Number?new s.LongBits(n.begin.low>>>0,n.begin.high>>>0).toNumber():n.begin),n.end!=null&&n.hasOwnProperty("end")&&(typeof n.end=="number"?a.end=r.longs===String?String(n.end):n.end:a.end=r.longs===String?s.Long.prototype.toString.call(n.end):r.longs===Number?new s.LongBits(n.end.low>>>0,n.end.high>>>0).toNumber():n.end),a},e.prototype.toJSON=function(){return this.constructor.toObject(this,o.util.toJSONOptions)},e}(),t.DataLocation=function(){var e={},n=Object.create(e);return n[e[0]="DEFAULT"]=0,n[e[1]="EXTERNAL"]=1,n}(),t}(),h.TensorShapeProto=function(){function t(e){if(this.dim=[],e)for(var n=Object.keys(e),r=0;r>>3==1?(a.dim&&a.dim.length||(a.dim=[]),a.dim.push(i.onnx.TensorShapeProto.Dimension.decode(e,e.uint32()))):e.skipType(7&l)}return a},t.decodeDelimited=function(e){return e instanceof c||(e=new c(e)),this.decode(e,e.uint32())},t.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.dim!=null&&e.hasOwnProperty("dim")){if(!Array.isArray(e.dim))return"dim: array expected";for(var n=0;n>>3){case 1:d.dimValue=r.int64();break;case 2:d.dimParam=r.string();break;case 3:d.denotation=r.string();break;default:r.skipType(7&m)}}return d},e.decodeDelimited=function(r){return r instanceof c||(r=new c(r)),this.decode(r,r.uint32())},e.verify=function(r){if(typeof r!="object"||r===null)return"object expected";var a={};if(r.dimValue!=null&&r.hasOwnProperty("dimValue")&&(a.value=1,!(s.isInteger(r.dimValue)||r.dimValue&&s.isInteger(r.dimValue.low)&&s.isInteger(r.dimValue.high))))return"dimValue: integer|Long expected";if(r.dimParam!=null&&r.hasOwnProperty("dimParam")){if(a.value===1)return"value: multiple values";if(a.value=1,!s.isString(r.dimParam))return"dimParam: string expected"}return r.denotation!=null&&r.hasOwnProperty("denotation")&&!s.isString(r.denotation)?"denotation: string expected":null},e.fromObject=function(r){if(r instanceof i.onnx.TensorShapeProto.Dimension)return r;var a=new i.onnx.TensorShapeProto.Dimension;return r.dimValue!=null&&(s.Long?(a.dimValue=s.Long.fromValue(r.dimValue)).unsigned=!1:typeof r.dimValue=="string"?a.dimValue=parseInt(r.dimValue,10):typeof r.dimValue=="number"?a.dimValue=r.dimValue:typeof r.dimValue=="object"&&(a.dimValue=new s.LongBits(r.dimValue.low>>>0,r.dimValue.high>>>0).toNumber())),r.dimParam!=null&&(a.dimParam=String(r.dimParam)),r.denotation!=null&&(a.denotation=String(r.denotation)),a},e.toObject=function(r,a){a||(a={});var l={};return a.defaults&&(l.denotation=""),r.dimValue!=null&&r.hasOwnProperty("dimValue")&&(typeof r.dimValue=="number"?l.dimValue=a.longs===String?String(r.dimValue):r.dimValue:l.dimValue=a.longs===String?s.Long.prototype.toString.call(r.dimValue):a.longs===Number?new s.LongBits(r.dimValue.low>>>0,r.dimValue.high>>>0).toNumber():r.dimValue,a.oneofs&&(l.value="dimValue")),r.dimParam!=null&&r.hasOwnProperty("dimParam")&&(l.dimParam=r.dimParam,a.oneofs&&(l.value="dimParam")),r.denotation!=null&&r.hasOwnProperty("denotation")&&(l.denotation=r.denotation),l},e.prototype.toJSON=function(){return this.constructor.toObject(this,o.util.toJSONOptions)},e}(),t}(),h.TypeProto=function(){function t(n){if(n)for(var r=Object.keys(n),a=0;a>>3){case 1:l.tensorType=i.onnx.TypeProto.Tensor.decode(n,n.uint32());break;case 6:l.denotation=n.string();break;default:n.skipType(7&d)}}return l},t.decodeDelimited=function(n){return n instanceof c||(n=new c(n)),this.decode(n,n.uint32())},t.verify=function(n){if(typeof n!="object"||n===null)return"object expected";if(n.tensorType!=null&&n.hasOwnProperty("tensorType")){var r=i.onnx.TypeProto.Tensor.verify(n.tensorType);if(r)return"tensorType."+r}return n.denotation!=null&&n.hasOwnProperty("denotation")&&!s.isString(n.denotation)?"denotation: string expected":null},t.fromObject=function(n){if(n instanceof i.onnx.TypeProto)return n;var r=new i.onnx.TypeProto;if(n.tensorType!=null){if(typeof n.tensorType!="object")throw TypeError(".onnx.TypeProto.tensorType: object expected");r.tensorType=i.onnx.TypeProto.Tensor.fromObject(n.tensorType)}return n.denotation!=null&&(r.denotation=String(n.denotation)),r},t.toObject=function(n,r){r||(r={});var a={};return r.defaults&&(a.denotation=""),n.tensorType!=null&&n.hasOwnProperty("tensorType")&&(a.tensorType=i.onnx.TypeProto.Tensor.toObject(n.tensorType,r),r.oneofs&&(a.value="tensorType")),n.denotation!=null&&n.hasOwnProperty("denotation")&&(a.denotation=n.denotation),a},t.prototype.toJSON=function(){return this.constructor.toObject(this,o.util.toJSONOptions)},t.Tensor=function(){function n(r){if(r)for(var a=Object.keys(r),l=0;l>>3){case 1:d.elemType=r.int32();break;case 2:d.shape=i.onnx.TensorShapeProto.decode(r,r.uint32());break;default:r.skipType(7&m)}}return d},n.decodeDelimited=function(r){return r instanceof c||(r=new c(r)),this.decode(r,r.uint32())},n.verify=function(r){if(typeof r!="object"||r===null)return"object expected";if(r.elemType!=null&&r.hasOwnProperty("elemType")&&!s.isInteger(r.elemType))return"elemType: integer expected";if(r.shape!=null&&r.hasOwnProperty("shape")){var a=i.onnx.TensorShapeProto.verify(r.shape);if(a)return"shape."+a}return null},n.fromObject=function(r){if(r instanceof i.onnx.TypeProto.Tensor)return r;var a=new i.onnx.TypeProto.Tensor;if(r.elemType!=null&&(a.elemType=0|r.elemType),r.shape!=null){if(typeof r.shape!="object")throw TypeError(".onnx.TypeProto.Tensor.shape: object expected");a.shape=i.onnx.TensorShapeProto.fromObject(r.shape)}return a},n.toObject=function(r,a){a||(a={});var l={};return a.defaults&&(l.elemType=0,l.shape=null),r.elemType!=null&&r.hasOwnProperty("elemType")&&(l.elemType=r.elemType),r.shape!=null&&r.hasOwnProperty("shape")&&(l.shape=i.onnx.TensorShapeProto.toObject(r.shape,a)),l},n.prototype.toJSON=function(){return this.constructor.toObject(this,o.util.toJSONOptions)},n}(),t}(),h.OperatorSetIdProto=function(){function t(e){if(e)for(var n=Object.keys(e),r=0;r>>3){case 1:a.domain=e.string();break;case 2:a.version=e.int64();break;default:e.skipType(7&l)}}return a},t.decodeDelimited=function(e){return e instanceof c||(e=new c(e)),this.decode(e,e.uint32())},t.verify=function(e){return typeof e!="object"||e===null?"object expected":e.domain!=null&&e.hasOwnProperty("domain")&&!s.isString(e.domain)?"domain: string expected":e.version!=null&&e.hasOwnProperty("version")&&!(s.isInteger(e.version)||e.version&&s.isInteger(e.version.low)&&s.isInteger(e.version.high))?"version: integer|Long expected":null},t.fromObject=function(e){if(e instanceof i.onnx.OperatorSetIdProto)return e;var n=new i.onnx.OperatorSetIdProto;return e.domain!=null&&(n.domain=String(e.domain)),e.version!=null&&(s.Long?(n.version=s.Long.fromValue(e.version)).unsigned=!1:typeof e.version=="string"?n.version=parseInt(e.version,10):typeof e.version=="number"?n.version=e.version:typeof e.version=="object"&&(n.version=new s.LongBits(e.version.low>>>0,e.version.high>>>0).toNumber())),n},t.toObject=function(e,n){n||(n={});var r={};if(n.defaults)if(r.domain="",s.Long){var a=new s.Long(0,0,!1);r.version=n.longs===String?a.toString():n.longs===Number?a.toNumber():a}else r.version=n.longs===String?"0":0;return e.domain!=null&&e.hasOwnProperty("domain")&&(r.domain=e.domain),e.version!=null&&e.hasOwnProperty("version")&&(typeof e.version=="number"?r.version=n.longs===String?String(e.version):e.version:r.version=n.longs===String?s.Long.prototype.toString.call(e.version):n.longs===Number?new s.LongBits(e.version.low>>>0,e.version.high>>>0).toNumber():e.version),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,o.util.toJSONOptions)},t}(),h),D.exports=i},2100:(D,u,b)=>{D.exports=b(9482)},9482:(D,u,b)=>{var g=u;function p(){g.util._configure(),g.Writer._configure(g.BufferWriter),g.Reader._configure(g.BufferReader)}g.build="minimal",g.Writer=b(1173),g.BufferWriter=b(3155),g.Reader=b(1408),g.BufferReader=b(593),g.util=b(9693),g.rpc=b(5994),g.roots=b(5054),g.configure=p,p()},1408:(D,u,b)=>{D.exports=f;var g,p=b(9693),h=p.LongBits,o=p.utf8;function c(a,l){return RangeError("index out of range: "+a.pos+" + "+(l||1)+" > "+a.len)}function f(a){this.buf=a,this.pos=0,this.len=a.length}var s,i=typeof Uint8Array<"u"?function(a){if(a instanceof Uint8Array||Array.isArray(a))return new f(a);throw Error("illegal buffer")}:function(a){if(Array.isArray(a))return new f(a);throw Error("illegal buffer")},t=function(){return p.Buffer?function(a){return(f.create=function(l){return p.Buffer.isBuffer(l)?new g(l):i(l)})(a)}:i};function e(){var a=new h(0,0),l=0;if(!(this.len-this.pos>4)){for(;l<3;++l){if(this.pos>=this.len)throw c(this);if(a.lo=(a.lo|(127&this.buf[this.pos])<<7*l)>>>0,this.buf[this.pos++]<128)return a}return a.lo=(a.lo|(127&this.buf[this.pos++])<<7*l)>>>0,a}for(;l<4;++l)if(a.lo=(a.lo|(127&this.buf[this.pos])<<7*l)>>>0,this.buf[this.pos++]<128)return a;if(a.lo=(a.lo|(127&this.buf[this.pos])<<28)>>>0,a.hi=(a.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return a;if(l=0,this.len-this.pos>4){for(;l<5;++l)if(a.hi=(a.hi|(127&this.buf[this.pos])<<7*l+3)>>>0,this.buf[this.pos++]<128)return a}else for(;l<5;++l){if(this.pos>=this.len)throw c(this);if(a.hi=(a.hi|(127&this.buf[this.pos])<<7*l+3)>>>0,this.buf[this.pos++]<128)return a}throw Error("invalid varint encoding")}function n(a,l){return(a[l-4]|a[l-3]<<8|a[l-2]<<16|a[l-1]<<24)>>>0}function r(){if(this.pos+8>this.len)throw c(this,8);return new h(n(this.buf,this.pos+=4),n(this.buf,this.pos+=4))}f.create=t(),f.prototype._slice=p.Array.prototype.subarray||p.Array.prototype.slice,f.prototype.uint32=(s=4294967295,function(){if(s=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128||(s=(s|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)||(s=(s|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)||(s=(s|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)||(s=(s|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128))return s;if((this.pos+=5)>this.len)throw this.pos=this.len,c(this,10);return s}),f.prototype.int32=function(){return 0|this.uint32()},f.prototype.sint32=function(){var a=this.uint32();return a>>>1^-(1&a)|0},f.prototype.bool=function(){return this.uint32()!==0},f.prototype.fixed32=function(){if(this.pos+4>this.len)throw c(this,4);return n(this.buf,this.pos+=4)},f.prototype.sfixed32=function(){if(this.pos+4>this.len)throw c(this,4);return 0|n(this.buf,this.pos+=4)},f.prototype.float=function(){if(this.pos+4>this.len)throw c(this,4);var a=p.float.readFloatLE(this.buf,this.pos);return this.pos+=4,a},f.prototype.double=function(){if(this.pos+8>this.len)throw c(this,4);var a=p.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,a},f.prototype.bytes=function(){var a=this.uint32(),l=this.pos,d=this.pos+a;if(d>this.len)throw c(this,a);return this.pos+=a,Array.isArray(this.buf)?this.buf.slice(l,d):l===d?new this.buf.constructor(0):this._slice.call(this.buf,l,d)},f.prototype.string=function(){var a=this.bytes();return o.read(a,0,a.length)},f.prototype.skip=function(a){if(typeof a=="number"){if(this.pos+a>this.len)throw c(this,a);this.pos+=a}else do if(this.pos>=this.len)throw c(this);while(128&this.buf[this.pos++]);return this},f.prototype.skipType=function(a){switch(a){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(a=7&this.uint32())!=4;)this.skipType(a);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+a+" at offset "+this.pos)}return this},f._configure=function(a){g=a,f.create=t(),g._configure();var l=p.Long?"toLong":"toNumber";p.merge(f.prototype,{int64:function(){return e.call(this)[l](!1)},uint64:function(){return e.call(this)[l](!0)},sint64:function(){return e.call(this).zzDecode()[l](!1)},fixed64:function(){return r.call(this)[l](!0)},sfixed64:function(){return r.call(this)[l](!1)}})}},593:(D,u,b)=>{D.exports=h;var g=b(1408);(h.prototype=Object.create(g.prototype)).constructor=h;var p=b(9693);function h(o){g.call(this,o)}h._configure=function(){p.Buffer&&(h.prototype._slice=p.Buffer.prototype.slice)},h.prototype.string=function(){var o=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+o,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+o,this.len))},h._configure()},5054:D=>{D.exports={}},5994:(D,u,b)=>{u.Service=b(7948)},7948:(D,u,b)=>{D.exports=p;var g=b(9693);function p(h,o,c){if(typeof h!="function")throw TypeError("rpcImpl must be a function");g.EventEmitter.call(this),this.rpcImpl=h,this.requestDelimited=!!o,this.responseDelimited=!!c}(p.prototype=Object.create(g.EventEmitter.prototype)).constructor=p,p.prototype.rpcCall=function h(o,c,f,s,i){if(!s)throw TypeError("request must be specified");var t=this;if(!i)return g.asPromise(h,t,o,c,f,s);if(t.rpcImpl)try{return t.rpcImpl(o,c[t.requestDelimited?"encodeDelimited":"encode"](s).finish(),function(e,n){if(e)return t.emit("error",e,o),i(e);if(n!==null){if(!(n instanceof f))try{n=f[t.responseDelimited?"decodeDelimited":"decode"](n)}catch(r){return t.emit("error",r,o),i(r)}return t.emit("data",n,o),i(null,n)}t.end(!0)})}catch(e){return t.emit("error",e,o),void setTimeout(function(){i(e)},0)}else setTimeout(function(){i(Error("already ended"))},0)},p.prototype.end=function(h){return this.rpcImpl&&(h||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},1945:(D,u,b)=>{D.exports=p;var g=b(9693);function p(f,s){this.lo=f>>>0,this.hi=s>>>0}var h=p.zero=new p(0,0);h.toNumber=function(){return 0},h.zzEncode=h.zzDecode=function(){return this},h.length=function(){return 1};var o=p.zeroHash="\0\0\0\0\0\0\0\0";p.fromNumber=function(f){if(f===0)return h;var s=f<0;s&&(f=-f);var i=f>>>0,t=(f-i)/4294967296>>>0;return s&&(t=~t>>>0,i=~i>>>0,++i>4294967295&&(i=0,++t>4294967295&&(t=0))),new p(i,t)},p.from=function(f){if(typeof f=="number")return p.fromNumber(f);if(g.isString(f)){if(!g.Long)return p.fromNumber(parseInt(f,10));f=g.Long.fromString(f)}return f.low||f.high?new p(f.low>>>0,f.high>>>0):h},p.prototype.toNumber=function(f){if(!f&&this.hi>>>31){var s=1+~this.lo>>>0,i=~this.hi>>>0;return s||(i=i+1>>>0),-(s+4294967296*i)}return this.lo+4294967296*this.hi},p.prototype.toLong=function(f){return g.Long?new g.Long(0|this.lo,0|this.hi,!!f):{low:0|this.lo,high:0|this.hi,unsigned:!!f}};var c=String.prototype.charCodeAt;p.fromHash=function(f){return f===o?h:new p((c.call(f,0)|c.call(f,1)<<8|c.call(f,2)<<16|c.call(f,3)<<24)>>>0,(c.call(f,4)|c.call(f,5)<<8|c.call(f,6)<<16|c.call(f,7)<<24)>>>0)},p.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},p.prototype.zzEncode=function(){var f=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^f)>>>0,this.lo=(this.lo<<1^f)>>>0,this},p.prototype.zzDecode=function(){var f=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^f)>>>0,this.hi=(this.hi>>>1^f)>>>0,this},p.prototype.length=function(){var f=this.lo,s=(this.lo>>>28|this.hi<<4)>>>0,i=this.hi>>>24;return i===0?s===0?f<16384?f<128?1:2:f<2097152?3:4:s<16384?s<128?5:6:s<2097152?7:8:i<128?9:10}},9693:function(D,u,b){var g=u;function p(o,c,f){for(var s=Object.keys(c),i=0;i0)},g.Buffer=function(){try{var o=g.inquire("buffer").Buffer;return o.prototype.utf8Write?o:null}catch{return null}}(),g._Buffer_from=null,g._Buffer_allocUnsafe=null,g.newBuffer=function(o){return typeof o=="number"?g.Buffer?g._Buffer_allocUnsafe(o):new g.Array(o):g.Buffer?g._Buffer_from(o):typeof Uint8Array>"u"?o:new Uint8Array(o)},g.Array=typeof Uint8Array<"u"?Uint8Array:Array,g.Long=g.global.dcodeIO&&g.global.dcodeIO.Long||g.global.Long||g.inquire("long"),g.key2Re=/^true|false|0|1$/,g.key32Re=/^-?(?:0|[1-9][0-9]*)$/,g.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,g.longToHash=function(o){return o?g.LongBits.from(o).toHash():g.LongBits.zeroHash},g.longFromHash=function(o,c){var f=g.LongBits.fromHash(o);return g.Long?g.Long.fromBits(f.lo,f.hi,c):f.toNumber(!!c)},g.merge=p,g.lcFirst=function(o){return o.charAt(0).toLowerCase()+o.substring(1)},g.newError=h,g.ProtocolError=h("ProtocolError"),g.oneOfGetter=function(o){for(var c={},f=0;f-1;--i)if(c[s[i]]===1&&this[s[i]]!==void 0&&this[s[i]]!==null)return s[i]}},g.oneOfSetter=function(o){return function(c){for(var f=0;f{D.exports=t;var g,p=b(9693),h=p.LongBits,o=p.base64,c=p.utf8;function f(m,y,_){this.fn=m,this.len=y,this.next=void 0,this.val=_}function s(){}function i(m){this.head=m.head,this.tail=m.tail,this.len=m.len,this.next=m.states}function t(){this.len=0,this.head=new f(s,0,0),this.tail=this.head,this.states=null}var e=function(){return p.Buffer?function(){return(t.create=function(){return new g})()}:function(){return new t}};function n(m,y,_){y[_]=255&m}function r(m,y){this.len=m,this.next=void 0,this.val=y}function a(m,y,_){for(;m.hi;)y[_++]=127&m.lo|128,m.lo=(m.lo>>>7|m.hi<<25)>>>0,m.hi>>>=7;for(;m.lo>127;)y[_++]=127&m.lo|128,m.lo=m.lo>>>7;y[_++]=m.lo}function l(m,y,_){y[_]=255&m,y[_+1]=m>>>8&255,y[_+2]=m>>>16&255,y[_+3]=m>>>24}t.create=e(),t.alloc=function(m){return new p.Array(m)},p.Array!==Array&&(t.alloc=p.pool(t.alloc,p.Array.prototype.subarray)),t.prototype._push=function(m,y,_){return this.tail=this.tail.next=new f(m,y,_),this.len+=y,this},r.prototype=Object.create(f.prototype),r.prototype.fn=function(m,y,_){for(;m>127;)y[_++]=127&m|128,m>>>=7;y[_]=m},t.prototype.uint32=function(m){return this.len+=(this.tail=this.tail.next=new r((m>>>=0)<128?1:m<16384?2:m<2097152?3:m<268435456?4:5,m)).len,this},t.prototype.int32=function(m){return m<0?this._push(a,10,h.fromNumber(m)):this.uint32(m)},t.prototype.sint32=function(m){return this.uint32((m<<1^m>>31)>>>0)},t.prototype.uint64=function(m){var y=h.from(m);return this._push(a,y.length(),y)},t.prototype.int64=t.prototype.uint64,t.prototype.sint64=function(m){var y=h.from(m).zzEncode();return this._push(a,y.length(),y)},t.prototype.bool=function(m){return this._push(n,1,m?1:0)},t.prototype.fixed32=function(m){return this._push(l,4,m>>>0)},t.prototype.sfixed32=t.prototype.fixed32,t.prototype.fixed64=function(m){var y=h.from(m);return this._push(l,4,y.lo)._push(l,4,y.hi)},t.prototype.sfixed64=t.prototype.fixed64,t.prototype.float=function(m){return this._push(p.float.writeFloatLE,4,m)},t.prototype.double=function(m){return this._push(p.float.writeDoubleLE,8,m)};var d=p.Array.prototype.set?function(m,y,_){y.set(m,_)}:function(m,y,_){for(var v=0;v>>0;if(!y)return this._push(n,1,0);if(p.isString(m)){var _=t.alloc(y=o.length(m));o.decode(m,_,0),m=_}return this.uint32(y)._push(d,y,m)},t.prototype.string=function(m){var y=c.length(m);return y?this.uint32(y)._push(c.write,y,m):this._push(n,1,0)},t.prototype.fork=function(){return this.states=new i(this),this.head=this.tail=new f(s,0,0),this.len=0,this},t.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new f(s,0,0),this.len=0),this},t.prototype.ldelim=function(){var m=this.head,y=this.tail,_=this.len;return this.reset().uint32(_),_&&(this.tail.next=m.next,this.tail=y,this.len+=_),this},t.prototype.finish=function(){for(var m=this.head.next,y=this.constructor.alloc(this.len),_=0;m;)m.fn(m.val,y,_),_+=m.len,m=m.next;return y},t._configure=function(m){g=m,t.create=e(),g._configure()}},3155:(D,u,b)=>{D.exports=h;var g=b(1173);(h.prototype=Object.create(g.prototype)).constructor=h;var p=b(9693);function h(){g.call(this)}function o(c,f,s){c.length<40?p.utf8.write(c,f,s):f.utf8Write?f.utf8Write(c,s):f.write(c,s)}h._configure=function(){h.alloc=p._Buffer_allocUnsafe,h.writeBytesBuffer=p.Buffer&&p.Buffer.prototype instanceof Uint8Array&&p.Buffer.prototype.set.name==="set"?function(c,f,s){f.set(c,s)}:function(c,f,s){if(c.copy)c.copy(f,s,0,c.length);else for(var i=0;i>>0;return this.uint32(f),f&&this._push(h.writeBytesBuffer,f,c),this},h.prototype.string=function(c){var f=p.Buffer.byteLength(c);return this.uint32(f),f&&this._push(o,f,c),this},h._configure()},7714:(D,u,b)=>{u.R=void 0;const g=b(6919),p=b(7448);u.R=new class{async init(){}async createSessionHandler(h,o){const c=new g.Session(o);return await c.loadModel(h),new p.OnnxjsSessionHandler(c)}}},4200:(D,u,b)=>{u.c8=u.rX=void 0;const g=b(1670),p=b(5381),h=b(2157),o=b(2306);u.rX=()=>{if((typeof g.env.wasm.initTimeout!="number"||g.env.wasm.initTimeout<0)&&(g.env.wasm.initTimeout=0),typeof g.env.wasm.simd!="boolean"&&(g.env.wasm.simd=!0),typeof g.env.wasm.proxy!="boolean"&&(g.env.wasm.proxy=!1),typeof g.env.wasm.numThreads!="number"||!Number.isInteger(g.env.wasm.numThreads)||g.env.wasm.numThreads<=0){const c=typeof navigator>"u"?(0,p.cpus)().length:navigator.hardwareConcurrency;g.env.wasm.numThreads=Math.min(4,Math.ceil((c||1)/2))}},u.c8=new class{async init(){(0,u.rX)(),await(0,h.initWasm)()}async createSessionHandler(c,f){const s=new o.OnnxruntimeWebAssemblySessionHandler;return await s.loadModel(c,f),Promise.resolve(s)}}},6018:function(D,u,b){var g=this&&this.__createBinding||(Object.create?function(o,c,f,s){s===void 0&&(s=f);var i=Object.getOwnPropertyDescriptor(c,f);i&&!("get"in i?!c.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return c[f]}}),Object.defineProperty(o,s,i)}:function(o,c,f,s){s===void 0&&(s=f),o[s]=c[f]}),p=this&&this.__exportStar||function(o,c){for(var f in o)f==="default"||Object.prototype.hasOwnProperty.call(c,f)||g(c,o,f)};Object.defineProperty(u,"__esModule",{value:!0}),p(b(1670),u);const h=b(1670);{const o=b(7714).R;(0,h.registerBackend)("webgl",o,-10)}{const o=b(4200).c8;(0,h.registerBackend)("cpu",o,10),(0,h.registerBackend)("wasm",o,10),(0,h.registerBackend)("xnnpack",o,9)}},246:(D,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.createAttributeWithCacheKey=void 0;class b{constructor(p){Object.assign(this,p)}get cacheKey(){return this._cacheKey||(this._cacheKey=Object.getOwnPropertyNames(this).sort().map(p=>`${this[p]}`).join(";")),this._cacheKey}}u.createAttributeWithCacheKey=g=>new b(g)},7778:(D,u,b)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.Attribute=void 0;const g=b(1446),p=b(9395),h=b(9162),o=b(2517);var c=p.onnxruntime.experimental.fbs;class f{constructor(i){if(this._attributes=new Map,i!=null){for(const t of i)t instanceof g.onnx.AttributeProto?this._attributes.set(t.name,[f.getValue(t),f.getType(t)]):t instanceof c.Attribute&&this._attributes.set(t.name(),[f.getValue(t),f.getType(t)]);if(this._attributes.sizeh.Tensor.fromProto(n));if(i instanceof c.Attribute)return e.map(n=>h.Tensor.fromOrtTensor(n))}if(t===g.onnx.AttributeProto.AttributeType.STRING&&i instanceof g.onnx.AttributeProto){const n=e;return(0,o.decodeUtf8String)(n)}return t===g.onnx.AttributeProto.AttributeType.STRINGS&&i instanceof g.onnx.AttributeProto?e.map(o.decodeUtf8String):e}static getValueNoCheck(i){return i instanceof g.onnx.AttributeProto?this.getValueNoCheckFromOnnxFormat(i):this.getValueNoCheckFromOrtFormat(i)}static getValueNoCheckFromOnnxFormat(i){switch(i.type){case g.onnx.AttributeProto.AttributeType.FLOAT:return i.f;case g.onnx.AttributeProto.AttributeType.INT:return i.i;case g.onnx.AttributeProto.AttributeType.STRING:return i.s;case g.onnx.AttributeProto.AttributeType.TENSOR:return i.t;case g.onnx.AttributeProto.AttributeType.GRAPH:return i.g;case g.onnx.AttributeProto.AttributeType.FLOATS:return i.floats;case g.onnx.AttributeProto.AttributeType.INTS:return i.ints;case g.onnx.AttributeProto.AttributeType.STRINGS:return i.strings;case g.onnx.AttributeProto.AttributeType.TENSORS:return i.tensors;case g.onnx.AttributeProto.AttributeType.GRAPHS:return i.graphs;default:throw new Error(`unsupported attribute type: ${g.onnx.AttributeProto.AttributeType[i.type]}`)}}static getValueNoCheckFromOrtFormat(i){switch(i.type()){case c.AttributeType.FLOAT:return i.f();case c.AttributeType.INT:return i.i();case c.AttributeType.STRING:return i.s();case c.AttributeType.TENSOR:return i.t();case c.AttributeType.GRAPH:return i.g();case c.AttributeType.FLOATS:return i.floatsArray();case c.AttributeType.INTS:{const t=[];for(let e=0;e{Object.defineProperty(u,"__esModule",{value:!0}),u.resolveBackend=u.backend=void 0;const g=b(5038),p=new Map;async function h(o){const c=u.backend;if(c[o]!==void 0&&function(f){const s=f;return"initialize"in s&&typeof s.initialize=="function"&&"createSessionHandler"in s&&typeof s.createSessionHandler=="function"&&"dispose"in s&&typeof s.dispose=="function"}(c[o])){const f=c[o];let s=f.initialize();if(typeof s=="object"&&"then"in s&&(s=await s),s)return p.set(o,f),f}}u.backend={webgl:new g.WebGLBackend},u.resolveBackend=async function o(c){if(!c)return o(["webgl"]);{const f=typeof c=="string"?[c]:c;for(const s of f){const i=p.get(s);if(i)return i;const t=await h(s);if(t)return t}}throw new Error("no available backend to use")}},5038:(D,u,b)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.WebGLBackend=void 0;const g=b(1670),p=b(6231),h=b(6416),o=b(7305);u.WebGLBackend=class{get contextId(){return g.env.webgl.contextId}set contextId(c){g.env.webgl.contextId=c}get matmulMaxBatchSize(){return g.env.webgl.matmulMaxBatchSize}set matmulMaxBatchSize(c){g.env.webgl.matmulMaxBatchSize=c}get textureCacheMode(){return g.env.webgl.textureCacheMode}set textureCacheMode(c){g.env.webgl.textureCacheMode=c}get pack(){return g.env.webgl.pack}set pack(c){g.env.webgl.pack=c}get async(){return g.env.webgl.async}set async(c){g.env.webgl.async=c}initialize(){try{return this.glContext=(0,o.createWebGLContext)(this.contextId),typeof this.matmulMaxBatchSize!="number"&&(this.matmulMaxBatchSize=16),typeof this.textureCacheMode!="string"&&(this.textureCacheMode="full"),typeof this.pack!="boolean"&&(this.pack=!1),typeof this.async!="boolean"&&(this.async=!1),p.Logger.setWithEnv(g.env),p.Logger.verbose("WebGLBackend",`Created WebGLContext: ${typeof this.glContext} with matmulMaxBatchSize: ${this.matmulMaxBatchSize}; textureCacheMode: ${this.textureCacheMode}; pack: ${this.pack}; async: ${this.async}.`),!0}catch(c){return p.Logger.warning("WebGLBackend",`Unable to initialize WebGLBackend. ${c}`),!1}}createSessionHandler(c){return new h.WebGLSessionHandler(this,c)}dispose(){this.glContext.dispose()}}},5107:(D,u,b)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.CoordsGlslLib=void 0;const g=b(2517),p=b(8520),h=b(5060),o=b(7859),c=b(9390);class f extends p.GlslLib{constructor(i){super(i)}getFunctions(){return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},this.offsetToCoords()),this.coordsToOffset()),this.toVec()),this.valueFrom()),this.getCommonUtilFuncs()),this.getInputsSamplingSnippets()),this.getOutputSamplingSnippet())}getCustomTypes(){return{}}offsetToCoords(){return{offsetToCoords:new p.GlslLibRoutine(` - vec2 offsetToCoords(int offset, int width, int height) { - int t = offset / width; - int s = offset - t*width; - vec2 coords = (vec2(s,t) + vec2(0.5,0.5)) / vec2(width, height); - return coords; - } - `)}}coordsToOffset(){return{coordsToOffset:new p.GlslLibRoutine(` - int coordsToOffset(vec2 coords, int width, int height) { - float s = coords.s * float(width); - float t = coords.t * float(height); - int offset = int(t) * width + int(s); - return offset; - } - `)}}getOutputSamplingSnippet(){const i=this.context.outputTextureLayout;return i.isPacked?this.getPackedOutputSamplingSnippet(i):this.getUnpackedOutputSamplingSnippet(i)}getPackedOutputSamplingSnippet(i){const t=i.unpackedShape,e=[i.width,i.height],n={},r="getOutputCoords";switch(t.length){case 0:n[r]=this.getOutputScalarCoords();break;case 1:n[r]=this.getOutputPacked1DCoords(t,e);break;case 2:n[r]=this.getOutputPacked2DCoords(t,e);break;case 3:n[r]=this.getOutputPacked3DCoords(t,e);break;default:n[r]=this.getOutputPackedNDCoords(t,e)}const a=` - void setOutput(vec4 val) { - ${(0,h.getGlsl)(this.context.glContext.version).output} = val; - } - `;return n.floatTextureSetRGBA=new p.GlslLibRoutine(a),n}getUnpackedOutputSamplingSnippet(i){const t=i.unpackedShape,e=[i.width,i.height],n={},r="getOutputCoords";switch(t.length){case 0:n[r]=this.getOutputScalarCoords();break;case 1:n[r]=this.getOutputUnpacked1DCoords(t,e);break;case 2:n[r]=this.getOutputUnpacked2DCoords(t,e);break;case 3:n[r]=this.getOutputUnpacked3DCoords(t,e);break;case 4:n[r]=this.getOutputUnpacked4DCoords(t,e);break;case 5:n[r]=this.getOutputUnpacked5DCoords(t,e);break;case 6:n[r]=this.getOutputUnpacked6DCoords(t,e);break;default:throw new Error(`Unsupported output dimensionality: ${t.length}`)}const a=` - void setOutput(float val) { - ${(0,h.getGlsl)(this.context.glContext.version).output} = vec4(val, 0, 0, 0); - } - `;return n.floatTextureSetR=new p.GlslLibRoutine(a),n}getOutputScalarCoords(){return new p.GlslLibRoutine(` - int getOutputCoords() { - return 0; - } - `)}getOutputPacked1DCoords(i,t){const e=t;let n="";return e[0]===1?(n=` - int getOutputCoords() { - return 2 * int(TexCoords.y * ${e[1]}.0); - } - `,new p.GlslLibRoutine(n)):e[1]===1?(n=` - int getOutputCoords() { - return 2 * int(TexCoords.x * ${e[0]}.0); - } - `,new p.GlslLibRoutine(n)):(n=` - int getOutputCoords() { - ivec2 resTexRC = ivec2(TexCoords.xy * - vec2(${e[0]}, ${e[1]})); - return 2 * (resTexRC.y * ${e[0]} + resTexRC.x); - } - `,new p.GlslLibRoutine(n))}getOutputPacked2DCoords(i,t){let e="";if(g.ArrayUtil.arraysEqual(i,t))return e=` - ivec2 getOutputCoords() { - return 2 * ivec2(TexCoords.xy * vec2(${t[0]}, ${t[1]})); - } - `,new p.GlslLibRoutine(e);const n=t,r=Math.ceil(i[1]/2);return e=` - ivec2 getOutputCoords() { - ivec2 resTexRC = ivec2(TexCoords.xy * - vec2(${n[0]}, ${n[1]})); - - int index = resTexRC.y * ${n[0]} + resTexRC.x; - - // reverse r and c order for packed texture - int r = imod(index, ${r}) * 2; - int c = 2 * (index / ${r}); - - return ivec2(r, c); - } - `,new p.GlslLibRoutine(e)}getOutputPacked3DCoords(i,t){const e=[t[0],t[1]],n=Math.ceil(i[2]/2),r=n*Math.ceil(i[1]/2),a=` - ivec3 getOutputCoords() { - ivec2 resTexRC = ivec2(TexCoords.xy * - vec2(${e[0]}, ${e[1]})); - int index = resTexRC.y * ${e[0]} + resTexRC.x; - - int b = index / ${r}; - index -= b * ${r}; - - // reverse r and c order for packed texture - int r = imod(index, ${n}) * 2; - int c = 2 * (index / ${n}); - - return ivec3(b, r, c); - } - `;return new p.GlslLibRoutine(a)}getOutputPackedNDCoords(i,t){const e=[t[0],t[1]],n=Math.ceil(i[i.length-1]/2),r=n*Math.ceil(i[i.length-2]/2);let a=r,l="",d="b, r, c";for(let y=2;y=0;--d)r[d]=r[d+1]*i[d+1];const a=["r","c","d"],l=r.map((d,m)=>`int ${a[m]} = index / ${d}; ${m===r.length-1?`int ${a[m+1]} = index - ${a[m]} * ${d}`:`index -= ${a[m]} * ${d}`};`).join("");return e=` - ivec3 getOutputCoords() { - ivec2 resTexRC = ivec2(TexCoords.xy * - vec2(${t[0]}, ${t[1]})); - int index = resTexRC.y * ${t[0]} + resTexRC.x; - ${l} - return ivec3(r, c, d); - } - `,new p.GlslLibRoutine(e)}getOutputUnpacked4DCoords(i,t){let e="";const n=i.length;let r=null;n<2&&(r=[]),r=new Array(n-1),r[n-2]=i[n-1];for(let d=n-3;d>=0;--d)r[d]=r[d+1]*i[d+1];const a=["r","c","d","d2"],l=r.map((d,m)=>`int ${a[m]} = index / ${d}; ${m===r.length-1?`int ${a[m+1]} = index - ${a[m]} * ${d}`:`index -= ${a[m]} * ${d}`};`).join("");return e=` - ivec4 getOutputCoords() { - ivec2 resTexRC = ivec2(TexCoords.xy * - vec2(${t[0]}, ${t[1]})); - int index = resTexRC.y * ${t[0]} + resTexRC.x; - ${l} - return ivec4(r, c, d, d2); - } - `,new p.GlslLibRoutine(e)}getOutputUnpacked5DCoords(i,t){let e="";const n=i.length;let r=null;n<2&&(r=[]),r=new Array(n-1),r[n-2]=i[n-1];for(let d=n-3;d>=0;--d)r[d]=r[d+1]*i[d+1];const a=["r","c","d","d2","d3"],l=r.map((d,m)=>`int ${a[m]} = index / ${d}; ${m===r.length-1?`int ${a[m+1]} = index - ${a[m]} * ${d}`:`index -= ${a[m]} * ${d}`};`).join("");return e=` - ivec5 getOutputCoords() { - ivec2 resTexRC = ivec2(TexCoords.xy * - vec2(${t[0]}, ${t[1]})); - int index = resTexRC.y * ${t[0]} + resTexRC.x; - ${l} - return ivec5(r, c, d, d2, d3); - } - `,new p.GlslLibRoutine(e)}getOutputUnpacked6DCoords(i,t){let e="";const n=i.length;let r=null;n<2&&(r=[]),r=new Array(n-1),r[n-2]=i[n-1];for(let d=n-3;d>=0;--d)r[d]=r[d+1]*i[d+1];const a=["r","c","d","d2","d3","d4"],l=r.map((d,m)=>`int ${a[m]} = index / ${d}; ${m===r.length-1?`int ${a[m+1]} = index - ${a[m]} * ${d}`:`index -= ${a[m]} * ${d}`};`).join("");return e=` - ivec6 getOutputCoords() { - ivec2 resTexRC = ivec2(TexCoords.xy * - vec2(${t[0]}, ${t[1]})); - int index = resTexRC.y * ${t[0]} + resTexRC.x; - ${l} - return ivec6(r, c, d, d2, d3, d4); - } - `,new p.GlslLibRoutine(e)}getCommonUtilFuncs(){const i={};let t="uvFromFlat";i[t]=new p.GlslLibRoutine(` - vec2 uvFromFlat(int texNumR, int texNumC, int index) { - int texC = index / texNumR; - int texR = index - texC * texNumR; - // TODO: swap texR, texC order in following function so row is corresponding to u and column is corresponding to - // v. - return (vec2(texR, texC) + halfCR) / vec2(texNumR, texNumC); - } - `),t="packedUVfrom1D",i[t]=new p.GlslLibRoutine(` - vec2 packedUVfrom1D(int texNumR, int texNumC, int index) { - int texelIndex = index / 2; - int texR = texelIndex / texNumC; - int texC = texelIndex - texR * texNumC; - return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR); - } - `),t="packedUVfrom2D",i[t]=new p.GlslLibRoutine(` - vec2 packedUVfrom2D(int texNumR, int texNumC, int texelsInLogicalRow, int row, int col) { - int texelIndex = (row / 2) * texelsInLogicalRow + (col / 2); - int texR = texelIndex / texNumC; - int texC = texelIndex - texR * texNumC; - return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR); - } - `),t="packedUVfrom3D",i[t]=new p.GlslLibRoutine(` - vec2 packedUVfrom3D(int texNumR, int texNumC, - int texelsInBatch, int texelsInLogicalRow, int b, - int row, int col) { - int index = b * texelsInBatch + (row / 2) * texelsInLogicalRow + (col / 2); - int texR = index / texNumC; - int texC = index - texR * texNumC; - return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR); - } - `),t="sampleTexture";const e=(0,h.getGlsl)(this.context.glContext.version);return i[t]=new p.GlslLibRoutine(` - float sampleTexture(sampler2D textureSampler, vec2 uv) { - return ${e.texture2D}(textureSampler, uv).r; - }`),i}getInputsSamplingSnippets(){const i={},t=this.context.outputTextureLayout;return this.context.programInfo.inputNames.forEach((e,n)=>{const r=this.context.inputTextureLayouts[n],a=(0,c.generateShaderFuncNameFromInputSamplerName)(e);r.isPacked?i[a]=this.getPackedSamplerFromInput(a,e,r):i[a]=this.getUnpackedSamplerFromInput(a,e,r);const l=(0,c.generateShaderFuncNameFromInputSamplerNameAtOutCoords)(e);r.unpackedShape.length<=t.unpackedShape.length&&(r.isPacked?i[l]=this.getPackedSamplerAtOutputCoords(l,r,t,e):i[l]=this.getUnpackedSamplerAtOutputCoords(l,r,t,e))}),i}getPackedSamplerAtOutputCoords(i,t,e,n){const r=t.unpackedShape,a=e.unpackedShape,l=n,d=(0,c.generateShaderFuncNameFromInputSamplerName)(l),m=r.length,y=a.length,_=g.BroadcastUtil.getBroadcastDims(r,a),v=(0,c.getCoordsDataType)(y),T=y-m;let S;const O=(0,c.getGlChannels)();S=m===0?"":y<2&&_.length>=1?"coords = 0;":_.map(N=>`coords.${O[N+T]} = 0;`).join(` -`);let w="";w=y<2&&m>0?"coords":r.map((N,W)=>`coords.${O[W+T]}`).join(", ");let I="return outputValue;";const R=g.ShapeUtil.size(r)===1,B=g.ShapeUtil.size(a)===1;if(m!==1||R||B){if(R&&!B)I=y===1?` - return vec4(outputValue.x, outputValue.x, 0., 0.); - `:` - return vec4(outputValue.x); - `;else if(_.length){const N=m-2,W=m-1;_.indexOf(N)>-1&&_.indexOf(W)>-1?I="return vec4(outputValue.x);":_.indexOf(N)>-1?I="return vec4(outputValue.x, outputValue.y, outputValue.x, outputValue.y);":_.indexOf(W)>-1&&(I="return vec4(outputValue.xx, outputValue.zz);")}}else I=` - return vec4(outputValue.xy, outputValue.xy); - `;const j=` - vec4 ${i}() { - ${v} coords = getOutputCoords(); - - int lastDim = coords.${O[y-1]}; - coords.${O[y-1]} = coords.${O[y-2]}; - coords.${O[y-2]} = lastDim; - - ${S} - vec4 outputValue = ${d}(${w}); - ${I} - } - `;return new p.GlslLibRoutine(j,["coordinates.getOutputCoords"])}getUnpackedSamplerAtOutputCoords(i,t,e,n){const r=[e.width,e.height],a=[t.width,t.height],l=t.unpackedShape.length,d=e.unpackedShape.length,m=t.unpackedShape,y=e.unpackedShape,_=(0,c.generateShaderFuncNameFromInputSamplerName)(n);if(l===d&&g.ArrayUtil.arraysEqual(a,r)){const B=` - float ${i}() { - return sampleTexture(${n}, TexCoords); - } - `;return new p.GlslLibRoutine(B,["coordinates.sampleTexture"])}const v=(0,c.getCoordsDataType)(d),T=g.BroadcastUtil.getBroadcastDims(m,y),S=d-l;let O;const w=(0,c.getGlChannels)();O=l===0?"":d<2&&T.length>=1?"coords = 0;":T.map(B=>`coords.${w[B+S]} = 0;`).join(` -`);let I="";I=d<2&&l>0?"coords":t.unpackedShape.map((B,j)=>`coords.${w[j+S]}`).join(", ");const R=` - float ${i}() { - ${v} coords = getOutputCoords(); - ${O} - return ${_}(${I}); - } - `;return new p.GlslLibRoutine(R,["coordinates.getOutputCoords"])}getPackedSamplerFromInput(i,t,e){switch(e.unpackedShape.length){case 0:return this.getPackedSamplerScalar(i,t);case 1:return this.getPackedSampler1D(i,t,e);case 2:return this.getPackedSampler2D(i,t,e);case 3:return this.getPackedSampler3D(i,t,e);default:return this.getPackedSamplerND(i,t,e)}}getUnpackedSamplerFromInput(i,t,e){const n=e.unpackedShape;switch(n.length){case 0:return this.getUnpackedSamplerScalar(i,t,e);case 1:return this.getUnpackedSampler1D(i,t,e);case 2:return this.getUnpackedSampler2D(i,t,e);case 3:return this.getUnpackedSampler3D(i,t,e);case 4:return this.getUnpackedSampler4D(i,t,e);case 5:return this.getUnpackedSampler5D(i,t,e);case 6:return this.getUnpackedSampler6D(i,t,e);default:throw new Error(`Unsupported dimension ${n.length}-D`)}}getPackedSamplerScalar(i,t){const e=` - vec4 ${i}() { - return ${(0,h.getGlsl)(this.context.glContext.version).texture2D}(${t}, halfCR); - } - `;return new p.GlslLibRoutine(e)}getPackedSampler1D(i,t,e){const n=[e.width,e.height],r=[n[1],n[0]],a=(0,h.getGlsl)(this.context.glContext.version),l=`vec4 ${i}(int index) { - vec2 uv = packedUVfrom1D( - ${r[0]}, ${r[1]}, index); - return ${a.texture2D}(${t}, uv); - }`;return new p.GlslLibRoutine(l,["coordinates.packedUVfrom1D"])}getPackedSampler2D(i,t,e){const n=e.unpackedShape,r=[e.width,e.height],a=(0,h.getGlsl)(this.context.glContext.version),l=r[0],d=r[1];if(r!=null&&g.ArrayUtil.arraysEqual(n,r)){const v=`vec4 ${i}(int row, int col) { - vec2 uv = (vec2(col, row) + halfCR) / vec2(${d}.0, ${l}.0); - return ${a.texture2D}(${t}, uv); - }`;return new p.GlslLibRoutine(v)}const m=r,y=Math.ceil(n[1]/2),_=`vec4 ${i}(int row, int col) { - vec2 uv = packedUVfrom2D(${m[1]}, ${m[0]}, ${y}, row, col); - return ${a.texture2D}(${t}, uv); - }`;return new p.GlslLibRoutine(_,["coordinates.packedUVfrom2D"])}getPackedSampler3D(i,t,e){const n=e.unpackedShape,r=[e.width,e.height],a=[r[0],r[1]],l=(0,h.getGlsl)(this.context.glContext.version);if(n[0]===1){const v=n.slice(1),T=[1,2],S=(0,c.squeezeInputShape)(n,v),O=["b","row","col"],w=JSON.parse(JSON.stringify(e));w.unpackedShape=S;const I=this.getPackedSamplerFromInput(i,t,w),R=`${I.routineBody} - vec4 ${i}(int b, int row, int col) { - return ${i}(${(0,c.getSqueezedParams)(O,T)}); - } `;return new p.GlslLibRoutine(R,I.dependencies)}const d=a[0],m=a[1],y=Math.ceil(n[2]/2),_=`vec4 ${i}(int b, int row, int col) { - vec2 uv = packedUVfrom3D( - ${m}, ${d}, ${y*Math.ceil(n[1]/2)}, ${y}, b, row, col); - return ${l.texture2D}(${t}, uv);}`;return new p.GlslLibRoutine(_,["coordinates.packedUVfrom3D"])}getPackedSamplerND(i,t,e){const n=e.unpackedShape,r=n.length,a=[e.width,e.height],l=(0,h.getGlsl)(this.context.glContext.version),d=[a[0],a[1]],m=d[1],y=d[0],_=Math.ceil(n[r-1]/2);let v=_*Math.ceil(n[r-2]/2),T="int b, int row, int col",S=`b * ${v} + (row / 2) * ${_} + (col / 2)`;for(let w=2;w{const n=this.context.inputTextureLayouts[e],r=(n.unpackedShape.length>0?n.unpackedShape:n.shape).length;let a=`_${t}`;i[a]=new p.GlslLibRoutine(this.getValueFromSingle(t,r,n.width,n.height,!1),[`shapeUtils.indicesToOffset${a}`,"coordinates.offsetToCoords","fragcolor.getColorAsFloat"]),a+="_T",i[a]=new p.GlslLibRoutine(this.getValueFromSingle(t,r,n.width,n.height,!0),[`shapeUtils.indicesToOffset${a}`,"coordinates.offsetToCoords","fragcolor.getColorAsFloat"])}),i}getValueFromSingle(i,t,e,n,r){let a=`_${i}`;return r&&(a+="_T"),` - float ${a}(int m[${t}]) { - int offset = indicesToOffset${a}(m); - vec2 coords = offsetToCoords(offset, ${e}, ${n}); - float value = getColorAsFloat(${(0,h.getGlsl)(this.context.glContext.version).texture2D}(${i}, coords)); - return value; - } - `}getPackedValueFrom(i,t,e,n,r){let a=`_${i}_Pack`;return r&&(a+="_T"),` - vec4 ${a}(int m[${t}]) { - int offset = indicesToOffset_${i}(m); - vec2 coords = offsetToCoords(offset, ${e}, ${n}); - return ${(0,h.getGlsl)(this.context.glContext.version).texture2D}(${i}, coords); - } - `}}u.CoordsGlslLib=f},8520:(D,u)=>{var b;Object.defineProperty(u,"__esModule",{value:!0}),u.TopologicalSortGlslRoutines=u.GlslLibRoutineNode=u.GlslLibRoutine=u.GlslLib=u.GlslContext=u.FunctionType=void 0,(b=u.FunctionType||(u.FunctionType={}))[b.ValueBased=0]="ValueBased",b[b.Positional=1]="Positional",u.GlslContext=class{constructor(g,p,h,o){this.glContext=g,this.programInfo=p,this.inputTextureLayouts=h,this.outputTextureLayout=o}},u.GlslLib=class{constructor(g){this.context=g}},u.GlslLibRoutine=class{constructor(g,p){this.routineBody=g,this.dependencies=p}},u.GlslLibRoutineNode=class{constructor(g,p,h){this.name=g,this.dependencies=h||[],p&&(this.routineBody=p)}addDependency(g){g&&this.dependencies.push(g)}},u.TopologicalSortGlslRoutines=class{static returnOrderedNodes(g){if(!g||g.length===0)return[];if(g.length===1)return g;const p=new Set,h=new Set,o=new Array;return this.createOrderedNodes(g,p,h,o),o}static createOrderedNodes(g,p,h,o){for(let c=0;c0)for(let f=0;f{Object.defineProperty(u,"__esModule",{value:!0}),u.EncodingGlslLib=void 0;const g=b(8520);class p extends g.GlslLib{constructor(o){super(o)}getFunctions(){return Object.assign(Object.assign({},this.encodeFloat32()),this.decodeFloat32())}getCustomTypes(){return{}}encodeFloat32(){return{encode:new g.GlslLibRoutine(`highp vec4 encode(highp float f) { - return vec4(f, 0.0, 0.0, 0.0); - } - `)}}decodeFloat32(){return{decode:new g.GlslLibRoutine(`highp float decode(highp vec4 rgba) { - return rgba.r; - } - `)}}encodeUint8(){const o=p.isLittleEndian()?"rgba.rgba=rgba.abgr;":"";return{encode:new g.GlslLibRoutine(` - highp vec4 encode(highp float f) { - highp float F = abs(f); - highp float Sign = step(0.0,-f); - highp float Exponent = floor(log2(F)); - highp float Mantissa = (exp2(- Exponent) * F); - Exponent = floor(log2(F) + 127.0) + floor(log2(Mantissa)); - highp vec4 rgba; - rgba[0] = 128.0 * Sign + floor(Exponent*exp2(-1.0)); - rgba[1] = 128.0 * mod(Exponent,2.0) + mod(floor(Mantissa*128.0),128.0); - rgba[2] = floor(mod(floor(Mantissa*exp2(23.0 -8.0)),exp2(8.0))); - rgba[3] = floor(exp2(23.0)*mod(Mantissa,exp2(-15.0))); - ${o} - rgba = rgba / 255.0; // values need to be normalized to [0,1] - return rgba; - } - `)}}decodeUint8(){const o=p.isLittleEndian()?"rgba.rgba=rgba.abgr;":"";return{decode:new g.GlslLibRoutine(` - highp float decode(highp vec4 rgba) { - rgba = rgba * 255.0; // values need to be de-normalized from [0,1] to [0,255] - ${o} - highp float Sign = 1.0 - step(128.0,rgba[0])*2.0; - highp float Exponent = 2.0 * mod(rgba[0],128.0) + step(128.0,rgba[1]) - 127.0; - highp float Mantissa = mod(rgba[1],128.0)*65536.0 + rgba[2]*256.0 +rgba[3] + float(0x800000); - highp float Result = Sign * exp2(Exponent) * (Mantissa * exp2(-23.0 )); - return Result; - } - `)}}static isLittleEndian(){const o=new ArrayBuffer(4),c=new Uint32Array(o),f=new Uint8Array(o);if(c[0]=3735928559,f[0]===239)return!0;if(f[0]===222)return!1;throw new Error("unknown endianness")}}u.EncodingGlslLib=p},9894:(D,u,b)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.FragColorGlslLib=void 0;const g=b(8520),p=b(5060);class h extends g.GlslLib{constructor(c){super(c)}getFunctions(){return Object.assign(Object.assign({},this.setFragColor()),this.getColorAsFloat())}getCustomTypes(){return{}}setFragColor(){const c=(0,p.getGlsl)(this.context.glContext.version);return{setFragColor:new g.GlslLibRoutine(` - void setFragColor(float value) { - ${c.output} = encode(value); - } - `,["encoding.encode"])}}getColorAsFloat(){return{getColorAsFloat:new g.GlslLibRoutine(` - float getColorAsFloat(vec4 color) { - return decode(color); - } - `,["encoding.decode"])}}}u.FragColorGlslLib=h},2848:(D,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.replaceInlines=void 0;const b=/@inline[\s\n\r]+(\w+)[\s\n\r]+([0-9a-zA-Z_]+)\s*\(([^)]*)\)\s*{(([^}]|[\n\r])*)}/gm;u.replaceInlines=function(g){const p={};let h;for(;(h=b.exec(g))!==null;){const o=h[3].split(",").map(c=>{const f=c.trim().split(" ");return f&&f.length===2?{type:f[0],name:f[1]}:null}).filter(c=>c!==null);p[h[2]]={params:o,body:h[4]}}for(const o in p){const c="(\\w+)?\\s+([_0-9a-zA-Z]+)\\s+=\\s+__FUNC__\\((.*)\\)\\s*;".replace("__FUNC__",o),f=new RegExp(c,"gm");for(;(h=f.exec(g))!==null;){const s=h[1],i=h[2],t=h[3].split(","),e=s?`${s} ${i};`:"";let n=p[o].body,r="";p[o].params.forEach((l,d)=>{l&&(r+=`${l.type} ${l.name} = ${t[d]}; -`)}),n=`${r} - ${n}`,n=n.replace("return",`${i} = `);const a=` - ${e} - { - ${n} - } - `;g=g.replace(h[0],a)}}return g.replace(b,"")}},8879:(D,u,b)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.GlslPreprocessor=void 0;const g=b(8520),p=b(2848),h=b(5483),o=b(5060);u.GlslPreprocessor=class{constructor(c,f,s,i){this.libs={},this.glslLibRoutineDependencyGraph={},this.context=new g.GlslContext(c,f,s,i),Object.keys(h.glslRegistry).forEach(e=>{const n=new h.glslRegistry[e](this.context);this.libs[e]=n});const t=this.glslLibRoutineDependencyGraph;for(const e in this.libs){const n=this.libs[e].getFunctions();for(const r in n){const a=e+"."+r;let l;t[a]?(l=t[a],l.routineBody=n[r].routineBody):(l=new g.GlslLibRoutineNode(a,n[r].routineBody),t[a]=l);const d=n[r].dependencies;if(d)for(let m=0;m{const i=s.split(".")[1];c.indexOf(i)!==-1&&f.push(this.glslLibRoutineDependencyGraph[s])}),g.TopologicalSortGlslRoutines.returnOrderedNodes(f)}getUniforms(c,f){const s=[];if(c)for(const i of c)s.push(`uniform sampler2D ${i};`);if(f)for(const i of f)s.push(`uniform ${i.type} ${i.name}${i.arrayLength?`[${i.arrayLength}]`:""};`);return s.join(` -`)}}},5483:(D,u,b)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.glslRegistry=void 0;const g=b(5107),p=b(7341),h=b(9894),o=b(2655),c=b(3891);u.glslRegistry={encoding:p.EncodingGlslLib,fragcolor:h.FragColorGlslLib,vec:c.VecGlslLib,shapeUtils:o.ShapeUtilsGlslLib,coordinates:g.CoordsGlslLib}},2655:(D,u,b)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.ShapeUtilsGlslLib=void 0;const g=b(8520);class p extends g.GlslLib{constructor(o){super(o)}getFunctions(){return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},this.bcastIndex()),this.bcastMatmulIndex()),this.offsetToIndices()),this.indicesToOffset()),this.incrementIndices())}getCustomTypes(){return{}}bcastIndex(){const o=this.context.outputTextureLayout.shape.length,c={};return this.context.programInfo.inputNames.forEach((f,s)=>{const i=this.context.inputTextureLayouts[s].unpackedShape;if(i.length<=o){const t=i.length,e=o-t,n=`bcastIndices_${f}`;let r="";for(let l=0;l{const i=this.context.inputTextureLayouts[s].shape;if(!(i.length<2||i.length>o)){const t=i.length,e=o-t,n=`bcastMatmulIndices_${f}`;let r="";for(let l=0;l{const s=this.context.inputTextureLayouts[f].shape,i=this.context.inputTextureLayouts[f].strides,t=s.length;let e=`indicesToOffset_${c}`;o[e]=new g.GlslLibRoutine(p.indexToOffsetSingle(e,t,i)),e=`indicesToOffset_${c}_T`,o[e]=new g.GlslLibRoutine(p.indexToOffsetSingle(e,t,i.slice().reverse()))}),o}static indexToOffsetSingle(o,c,f){let s="";for(let i=c-1;i>=0;--i)s+=` - offset += indices[${i}] * ${f[i]}; - `;return` - int ${o}(int indices[${c}]) { - int offset = 0; - ${s} - return offset; - } - `}offsetToIndices(){const o={};return this.context.programInfo.inputNames.forEach((c,f)=>{const s=this.context.inputTextureLayouts[f].shape,i=this.context.inputTextureLayouts[f].strides,t=s.length;let e=`offsetToIndices_${c}`;o[e]=new g.GlslLibRoutine(p.offsetToIndicesSingle(e,t,i)),e=`offsetToIndices_${c}_T`,o[e]=new g.GlslLibRoutine(p.offsetToIndicesSingle(e,t,i.slice().reverse()))}),o}static offsetToIndicesSingle(o,c,f){const s=[];for(let i=0;i{const s=this.context.inputTextureLayouts[f].shape,i=s.length,t=`incrementIndices_${c}`;let e="";for(let r=0;r= 0; --i) { - if(i > axis) continue; - indices[i] += 1; - if(indices[i] < shape[i]) { - break; - } - indices[i] = 0; - } - } - `;o[t]=new g.GlslLibRoutine(n)}),o}}u.ShapeUtilsGlslLib=p},5060:(D,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.getDefaultFragShaderMain=u.getFragShaderPreamble=u.getVertexShaderSource=u.getGlsl=void 0;const b={version:"",attribute:"attribute",varyingVertex:"varying",varyingFrag:"varying",texture2D:"texture2D",output:"gl_FragColor",outputDeclaration:""},g={version:"#version 300 es",attribute:"in",varyingVertex:"out",varyingFrag:"in",texture2D:"texture",output:"outputColor",outputDeclaration:"out vec4 outputColor;"};function p(h){return h===1?b:g}u.getGlsl=p,u.getVertexShaderSource=function(h){const o=p(h);return`${o.version} - precision highp float; - ${o.attribute} vec3 position; - ${o.attribute} vec2 textureCoord; - - ${o.varyingVertex} vec2 TexCoords; - - void main() - { - gl_Position = vec4(position, 1.0); - TexCoords = textureCoord; - }`},u.getFragShaderPreamble=function(h){const o=p(h);return`${o.version} - precision highp float; - precision highp int; - precision highp sampler2D; - ${o.varyingFrag} vec2 TexCoords; - ${o.outputDeclaration} - const vec2 halfCR = vec2(0.5, 0.5); - - // Custom vector types to handle higher dimenalities. - struct ivec5 - { - int x; - int y; - int z; - int w; - int u; - }; - - struct ivec6 - { - int x; - int y; - int z; - int w; - int u; - int v; - }; - - int imod(int x, int y) { - return x - y * (x / y); - } - - `},u.getDefaultFragShaderMain=function(h,o){return` - void main() { - int indices[${o}]; - toVec(TexCoords, indices); - vec4 result = vec4(process(indices)); - ${p(h).output} = result; - } - `}},3891:(D,u,b)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.VecGlslLib=void 0;const g=b(8520);class p extends g.GlslLib{constructor(o){super(o)}getCustomTypes(){return{}}getFunctions(){return Object.assign(Object.assign(Object.assign(Object.assign({},this.binaryVecFunctions()),this.copyVec()),this.setVecItem()),this.getVecItem())}binaryVecFunctions(){const o=this.context.outputTextureLayout.shape.length,c={add:"+=",sub:"-=",mul:"*=",div:"/="},f={};for(const s in c){const i=`${s}Vec`;let t="";for(let n=0;n{Object.defineProperty(u,"__esModule",{value:!0}),u.WebGLInferenceHandler=void 0;const g=b(6231),p=b(9162),h=b(2517),o=b(2403),c=b(7019),f=b(8710),s=b(5611),i=b(4057),t=b(2039);u.WebGLInferenceHandler=class{constructor(e){this.session=e,this.packedTextureDataCache=new Map,this.unpackedTextureDataCache=new Map}calculateTextureWidthAndHeight(e,n){return(0,i.calculateTextureWidthAndHeight)(this.session.layoutStrategy,e,n)}executeProgram(e,n){if(n.length{const T=v.map(O=>`${O.unpackedShape.join(",")};${O.width}x${O.height}`).join("_");let S=_.name;return _.cacheHint&&(S+="["+_.cacheHint+"]"),S+=":"+T,S})(e,r);let l=this.session.programManager.getArtifact(a);const d=l?l.programInfo:typeof e.get=="function"?e.get():e,m=(0,i.createTextureLayoutFromTextureType)(this.session.layoutStrategy,d.output.dims,d.output.textureType),y=this.createTextureData(m,d.output.type);return l||(l=this.session.programManager.build(d,r,y),this.session.programManager.setArtifact(a,l)),this.runProgram(l,r,y),y}run(e,n){return this.executeProgram(e,n).tensor}runProgram(e,n,r){for(let a=0;athis.readTexture(d),async m=>this.readTextureAsync(d),void 0,l),texture:r});return this.setTextureData(d.tensor.dataId,d,e.isPacked),d}getTextureData(e,n=!1){return this.session.isInitializer(e)?this.session.getTextureData(e,n):n?this.packedTextureDataCache.get(e):this.unpackedTextureDataCache.get(e)}setTextureData(e,n,r=!1){this.session.isInitializer(e)?this.session.setTextureData(e,n,r):(r?this.packedTextureDataCache:this.unpackedTextureDataCache).set(e,n)}isTextureLayoutCached(e,n=!1){return!!this.getTextureData(e.dataId,n)}dispose(){this.session.textureManager.clearActiveTextures(),this.packedTextureDataCache.forEach(e=>this.session.textureManager.releaseTexture(e)),this.packedTextureDataCache=new Map,this.unpackedTextureDataCache.forEach(e=>this.session.textureManager.releaseTexture(e)),this.unpackedTextureDataCache=new Map}readTexture(e){return e.isPacked?this.readTexture(this.unpack(e)):this.session.backend.glContext.isFloat32DownloadSupported?this.session.textureManager.readTexture(e,e.tensor.type,e.channels):this.session.textureManager.readUint8TextureAsFloat((0,f.encodeAsUint8)(this,e))}async readTextureAsync(e){return e.isPacked?this.readTextureAsync(this.unpack(e)):this.session.backend.glContext.isFloat32DownloadSupported?this.session.textureManager.readTextureAsync(e,e.tensor.type,e.channels):this.session.textureManager.readUint8TextureAsFloat((0,f.encodeAsUint8)(this,e))}pack(e){return this.executeProgram((0,o.createPackProgramInfoLoader)(this,e.tensor),[e.tensor])}unpack(e){return this.executeProgram((0,s.createUnpackProgramInfoLoader)(this,e.tensor),[e.tensor])}}},1640:function(D,u,b){var g=this&&this.__createBinding||(Object.create?function(Y,te,ne,me){me===void 0&&(me=ne);var Pe=Object.getOwnPropertyDescriptor(te,ne);Pe&&!("get"in Pe?!te.__esModule:Pe.writable||Pe.configurable)||(Pe={enumerable:!0,get:function(){return te[ne]}}),Object.defineProperty(Y,me,Pe)}:function(Y,te,ne,me){me===void 0&&(me=ne),Y[me]=te[ne]}),p=this&&this.__setModuleDefault||(Object.create?function(Y,te){Object.defineProperty(Y,"default",{enumerable:!0,value:te})}:function(Y,te){Y.default=te}),h=this&&this.__importStar||function(Y){if(Y&&Y.__esModule)return Y;var te={};if(Y!=null)for(var ne in Y)ne!=="default"&&Object.prototype.hasOwnProperty.call(Y,ne)&&g(te,Y,ne);return p(te,Y),te};Object.defineProperty(u,"__esModule",{value:!0}),u.WEBGL_OP_RESOLVE_RULES=void 0;const o=b(2898),c=h(b(7839)),f=b(4196),s=b(2069),i=b(8138),t=b(9663),e=b(5193),n=b(7992),r=b(1253),a=b(4776),l=b(6572),d=b(3346),m=b(5623),y=b(2870),_=b(2143),v=b(4939),T=b(718),S=b(2268),O=b(8117),w=b(2278),I=b(5524),R=b(5975),B=b(3933),j=b(6558),N=b(5723),W=b(3738),k=h(b(4909)),V=b(8428),J=b(9793);u.WEBGL_OP_RESOLVE_RULES=[["Abs","","6+",k.abs],["Acos","","7+",k.acos],["Add","","7+",c.add],["And","","7+",c.and],["Asin","","7+",k.asin],["Atan","","7+",k.atan],["AveragePool","","7+",_.averagePool,_.parseAveragePoolAttributes],["BatchNormalization","","7+",o.batchNormalization,o.parseBatchNormalizationAttributes],["Cast","","6+",f.cast,f.parseCastAttributes],["Ceil","","6+",k.ceil],["Clip","","6-10",k.clip,k.parseClipAttributes],["Clip","","11+",k.clipV11],["Concat","","4+",s.concat,s.parseConcatAttributes],["Conv","","1+",i.conv,i.parseConvAttributes],["ConvTranspose","","1+",t.convTranspose,t.parseConvTransposeAttributes],["Cos","","7+",k.cos],["Div","","7+",c.div],["Dropout","","7+",k.identity],["DepthToSpace","","1+",e.depthToSpace,e.parseDepthToSpaceAttributes],["Equal","","7+",c.equal],["Elu","","6+",k.elu,k.parseEluAttributes],["Exp","","6+",k.exp],["Flatten","","1+",n.flatten,n.parseFlattenAttributes],["Floor","","6+",k.floor],["FusedConv","com.microsoft","1+",i.conv,i.parseConvAttributes],["Gather","","1+",r.gather,r.parseGatherAttributes],["Gemm","","7-10",a.gemm,a.parseGemmAttributesV7],["Gemm","","11+",a.gemm,a.parseGemmAttributesV11],["GlobalAveragePool","","1+",_.globalAveragePool,_.parseGlobalAveragePoolAttributes],["GlobalMaxPool","","1+",_.globalMaxPool],["Greater","","7+",c.greater],["Identity","","1+",k.identity],["ImageScaler","","1+",l.imageScaler,l.parseImageScalerAttributes],["InstanceNormalization","","6+",d.instanceNormalization,d.parseInstanceNormalizationAttributes],["LeakyRelu","","6+",k.leakyRelu,k.parseLeakyReluAttributes],["Less","","7+",c.less],["Log","","6+",k.log],["MatMul","","1+",m.matMul,m.parseMatMulAttributes],["MaxPool","","1+",_.maxPool,_.parseMaxPoolAttributes],["Mul","","7+",c.mul],["Neg","","6+",k.neg],["Not","","1+",k.not],["Or","","7+",c.or],["Pad","","2-10",y.padV2,y.parsePadAttributesV2],["Pad","","11+",y.padV11,y.parsePadAttributesV11],["Pow","","7+",c.pow],["PRelu","","7+",c.pRelu],["ReduceLogSum","","1+",v.reduceLogSum,v.parseReduceAttributes],["ReduceMax","","1+",v.reduceMax,v.parseReduceAttributes],["ReduceMean","","1+",v.reduceMean,v.parseReduceAttributes],["ReduceMin","","1+",v.reduceMin,v.parseReduceAttributes],["ReduceProd","","1+",v.reduceProd,v.parseReduceAttributes],["ReduceSum","","1-12",v.reduceSum,v.parseReduceAttributes],["ReduceSumSquare","","1+",v.reduceLogSumSquare,v.parseReduceAttributes],["Relu","","6+",k.relu],["Reshape","","5+",T.reshape],["Resize","","10",S.resize,S.parseResizeAttributesV10],["Resize","","11+",S.resize,S.parseResizeAttributesV11],["Shape","","1+",O.shape],["Sigmoid","","6+",k.sigmoid],["Sin","","7+",k.sin],["Slice","","10+",w.sliceV10],["Slice","","1-9",w.slice,w.parseSliceAttributes],["Softmax","","1-12",I.softmax,I.parseSoftmaxAttributes],["Softmax","","13+",I.softmaxV13,I.parseSoftmaxAttributesV13],["Split","","2-12",R.split,R.parseSplitAttributes],["Sqrt","","6+",k.sqrt],["Squeeze","","1-12",B.squeeze,B.parseSqueezeAttributes],["Squeeze","","13+",B.squeezeV13],["Sub","","7+",c.sub],["Sum","","6+",j.sum],["Tan","","7+",k.tan],["Tanh","","6+",k.tanh],["Tile","","6+",N.tile],["Transpose","","1+",W.transpose,W.parseTransposeAttributes],["Upsample","","7-8",J.upsample,J.parseUpsampleAttributesV7],["Upsample","","9",J.upsample,J.parseUpsampleAttributesV9],["Unsqueeze","","1-12",V.unsqueeze,V.parseUnsqueezeAttributes],["Unsqueeze","","13+",V.unsqueezeV13],["Xor","","7+",c.xor]]},2898:(D,u,b)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.parseBatchNormalizationAttributes=u.batchNormalization=void 0;const g=b(246),p=b(5060),h=b(2039),o={name:"BatchNormalization",inputNames:["A","Scale","B","Mean","Variance"],inputTypes:[h.TextureType.unpacked,h.TextureType.unpacked,h.TextureType.unpacked,h.TextureType.unpacked,h.TextureType.unpacked]};u.batchNormalization=(s,i,t)=>(f(i),[s.run(Object.assign(Object.assign({},o),{cacheHint:t.cacheKey,get:()=>c(s,i,t)}),i)]),u.parseBatchNormalizationAttributes=s=>{const i=s.attributes.getFloat("epsilon",1e-5),t=s.attributes.getFloat("momentum",.9),e=s.attributes.getInt("spatial",1);return(0,g.createAttributeWithCacheKey)({epsilon:i,momentum:t,spatial:e})};const c=(s,i,t)=>{const e=(0,p.getGlsl)(s.session.backend.glContext.version),n=i[0].dims.length,[r,a]=s.calculateTextureWidthAndHeight(i[1].dims,h.TextureType.unpacked),l=` - float process(int[${n}] indices) { - vec2 position = offsetToCoords(indices[1], ${r}, ${a}); - float scale = getColorAsFloat(${e.texture2D}(Scale, position)); - float mean = getColorAsFloat(${e.texture2D}(Mean, position)); - float variance = getColorAsFloat(${e.texture2D}(Variance, position)); - float b = getColorAsFloat(${e.texture2D}(B, position)); - - return scale * ( (_A(indices) - mean) / sqrt(variance + float(${t.epsilon})) ) + b; - }`;return Object.assign(Object.assign({},o),{output:{dims:i[0].dims,type:i[0].type,textureType:h.TextureType.unpacked},shaderSource:l})},f=s=>{if(!s||s.length!==5)throw new Error("BatchNormalization requires 5 inputs.");const i=s[0],t=s[1],e=s[2],n=s[3],r=s[4];if(i.dims.length<3||t.dims.length!==1||e.dims.length!==1||n.dims.length!==1||r.dims.length!==1)throw new Error("invalid input shape.");if(t.dims[0]!==i.dims[1]||e.dims[0]!==i.dims[1]||n.dims[0]!==i.dims[1]||r.dims[0]!==i.dims[1])throw new Error("invalid input shape.");if(i.type!=="float32"&&i.type!=="float64"||t.type!=="float32"&&t.type!=="float64"||e.type!=="float32"&&e.type!=="float64"||n.type!=="float32"&&n.type!=="float64"||r.type!=="float32"&&r.type!=="float64")throw new Error("invalid input tensor types.")}},7839:(D,u,b)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.xor=u.sub=u.pRelu=u.pow=u.or=u.mul=u.less=u.greater=u.equal=u.div=u.and=u.add=u.glslPRelu=u.glslPow=u.glslXor=u.glslOr=u.glslAnd=u.glslLess=u.glslGreater=u.glslEqual=u.glslSub=u.glslMul=u.glslDiv=u.glslAdd=void 0;const g=b(2517),p=b(8520),h=b(5060),o=b(2039);function c(){const v="add_";return{body:` - float ${v}(float a, float b) { - return a + b; - } - vec4 ${v}(vec4 v1, vec4 v2) { - return v1 + v2; - } - `,name:v,type:p.FunctionType.ValueBased}}function f(){const v="div_";return{body:` - float ${v}(float a, float b) { - return a / b; - } - vec4 ${v}(vec4 v1, vec4 v2) { - return v1 / v2; - } - `,name:v,type:p.FunctionType.ValueBased}}function s(){const v="mul_";return{body:` - float ${v}(float a, float b) { - return a * b; - } - vec4 ${v}(vec4 v1, vec4 v2) { - return v1 * v2; - } - `,name:v,type:p.FunctionType.ValueBased}}function i(){const v="sub_";return{body:` - float ${v}(float a, float b) { - return a - b; - } - vec4 ${v}(vec4 v1, vec4 v2) { - return v1 - v2; - } - `,name:v,type:p.FunctionType.ValueBased}}function t(){const v="equal_";return{body:` - float ${v}(float a, float b) { - return float(a == b); - } - vec4 ${v}(vec4 v1, vec4 v2) { - return vec4(equal(v1, v2)); - } - `,name:v,type:p.FunctionType.ValueBased}}function e(){const v="greater_";return{body:` - float ${v}(float a, float b) { - return float(a > b); - } - vec4 ${v}(vec4 v1, vec4 v2) { - return vec4( v1.r > v2.r , - v1.g > v2.g, - v1.b > v2.b, - v1.a > v2.a ); - } - `,name:v,type:p.FunctionType.ValueBased}}function n(){const v="less_";return{body:` - float ${v}(float a, float b) { - return float(a < b); - } - vec4 ${v}(vec4 v1, vec4 v2) { - return vec4( v1.r < v2.r , - v1.g < v2.g, - v1.b < v2.b, - v1.a < v2.a ); - } - `,name:v,type:p.FunctionType.ValueBased}}function r(){const v="and_";return{body:` - float ${v}(float a, float b) { - return float( bool(a) && bool(b) ); - } - vec4 ${v}(vec4 v1, vec4 v2) { - bvec4 b1 = bvec4(v1); - bvec4 b2 = bvec4(v2); - return vec4( b1.r && b2.r , - b1.g && b2.g, - b1.b && b2.b, - b1.a && b2.a ); - } - `,name:v,type:p.FunctionType.ValueBased}}function a(){const v="or_";return{body:` - float ${v}(float a, float b) { - return float( bool(a) || bool(b) ); - } - vec4 ${v}(vec4 v1, vec4 v2) { - bvec4 b1 = bvec4(v1); - bvec4 b2 = bvec4(v2); - return vec4( b1.r || b2.r , - b1.g || b2.g, - b1.b || b2.b, - b1.a || b2.a ); - } - `,name:v,type:p.FunctionType.ValueBased}}function l(){const v="xor_";return{body:` - float ${v}(float a, float b) { - return float( bool(a) ^^ bool(b) ); - } - vec4 ${v}(vec4 v1, vec4 v2) { - bvec4 b1 = bvec4(v1); - bvec4 b2 = bvec4(v2); - return vec4( b1.r ^^ b2.r , - b1.g ^^ b2.g, - b1.b ^^ b2.b, - b1.a ^^ b2.a ); - } - `,name:v,type:p.FunctionType.ValueBased}}function d(){return function(v){const T=`${v}_`;return{body:` - float ${T}(float a, float b) { - return ${v}(a, b); - } - vec4 ${T}(vec4 v1, vec4 v2) { - return ${v}(v1, v2); - } - `,name:T,type:p.FunctionType.ValueBased}}("pow")}function m(){const v="prelu_";return{body:` - float ${v}(float a, float b) { - return a < 0.0 ? a * b: a; - } - vec4 ${v}(vec4 v1, vec4 v2) { - return vec4( - v1.r < 0.0 ? v1.r * v2.r: v1.r, - v1.g < 0.0 ? v1.g * v2.g: v1.g, - v1.b < 0.0 ? v1.b * v2.b: v1.b, - v1.a < 0.0 ? v1.a * v2.a: v1.a - ); - } - `,name:v,type:p.FunctionType.ValueBased}}u.glslAdd=c,u.glslDiv=f,u.glslMul=s,u.glslSub=i,u.glslEqual=t,u.glslGreater=e,u.glslLess=n,u.glslAnd=r,u.glslOr=a,u.glslXor=l,u.glslPow=d,u.glslPRelu=m;const y=(v,T,S,O=T[0].type,w)=>{const I=v.session.pack?o.TextureType.packed:o.TextureType.unpacked;return{name:S.name,inputNames:["A","B"],inputTypes:[I,I],cacheHint:w,get:()=>_(v,T,S,O)}},_=(v,T,S,O=T[0].type)=>{const w=v.session.pack?o.TextureType.packed:o.TextureType.unpacked,I=!g.ShapeUtil.areEqual(T[0].dims,T[1].dims);let R=T[0].dims;const B=v.session.pack;if(I){const W=g.BroadcastUtil.calcShape(T[0].dims,T[1].dims,!1);if(!W)throw new Error("Can't perform binary op on the given tensors");R=W;const k=R.length,V=T[0].dims.length!==0?T[0].dims.length:1,J=T[1].dims.length!==0?T[1].dims.length:1,Y=T[0].dims.length!==0?"bcastIndices_A(indices, aindices);":"aindices[0] = 0;",te=T[1].dims.length!==0?"bcastIndices_B(indices, bindices);":"bindices[0] = 0;",ne=(0,h.getGlsl)(v.session.backend.glContext.version),me=B?` - ${S.body} - void main() { - vec4 a = getAAtOutCoords(); - vec4 b = getBAtOutCoords(); - vec4 result = ${S.name}(a, b); - ${ne.output} = result; - }`:` - ${S.body} - float process(int indices[${k}]) { - int aindices[${V}]; - int bindices[${J}]; - ${Y} - ${te} - return ${S.name}(_A(aindices), _B(bindices)); - }`;return{name:S.name,inputNames:["A","B"],inputTypes:[w,w],output:{dims:R,type:O,textureType:w},shaderSource:me,hasMain:B}}const j=(0,h.getGlsl)(v.session.backend.glContext.version),N=` - ${S.body} - void main() { - vec4 v1 = ${j.texture2D}(A, TexCoords); - vec4 v2 = ${j.texture2D}(B, TexCoords); - vec4 result = ${S.name}(v1, v2); - ${j.output} = result; - } - `;return{name:S.name,inputNames:["A","B"],inputTypes:[w,w],output:{dims:T[0].dims,type:O,textureType:w},shaderSource:N,hasMain:!0}};u.add=(v,T)=>[v.run(y(v,T,c()),T)],u.and=(v,T)=>[v.run(y(v,T,r(),"bool"),T)],u.div=(v,T)=>[v.run(y(v,T,f()),T)],u.equal=(v,T)=>[v.run(y(v,T,t(),"bool"),T)],u.greater=(v,T)=>[v.run(y(v,T,e(),"bool"),T)],u.less=(v,T)=>[v.run(y(v,T,n(),"bool"),T)],u.mul=(v,T)=>[v.run(y(v,T,s()),T)],u.or=(v,T)=>[v.run(y(v,T,a(),"bool"),T)],u.pow=(v,T)=>[v.run(y(v,T,d()),T)],u.pRelu=(v,T)=>[v.run(y(v,T,m()),T)],u.sub=(v,T)=>[v.run(y(v,T,i()),T)],u.xor=(v,T)=>[v.run(y(v,T,l(),"bool"),T)]},4196:(D,u,b)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.parseCastAttributes=u.cast=void 0;const g=b(2517);u.cast=(h,o,c)=>(p(o),[h.cast(o[0],c)]),u.parseCastAttributes=h=>g.ProtoUtil.tensorDataTypeFromProto(h.attributes.getInt("to"));const p=h=>{if(!h||h.length!==1)throw new Error("Cast requires 1 input.");if(h[0].type==="string")throw new Error("Invalid input type.")}},1163:(D,u,b)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.createPackedConcatProgramInfoLoader=void 0;const g=b(5060),p=b(2039),h=b(9390),o=b(2827);u.createPackedConcatProgramInfoLoader=(f,s,i)=>{const t=(e=s.length,n=i.cacheKey,{name:"Concat (packed)",inputNames:Array.from({length:e},(r,a)=>`X${a}`),inputTypes:Array(e).fill(p.TextureType.packed),cacheHint:n});var e,n;return Object.assign(Object.assign({},t),{get:()=>((r,a,l,d)=>{const m=l[0].dims.slice();if(d>=m.length||d<-1*m.length)throw new Error("axis specified for concat doesn't match input dimensionality");d<0&&(d=m.length+d);const y=m.slice(0);for(let Y=1;YY.dims),w=(0,h.getGlChannels)(_),I=new Array(O.length-1);I[0]=O[0][d];for(let Y=1;Y= ${I[Y-1]}) { - return getChannel( - getX${Y}(${c(w,R,te)}), - vec2(${c(B,R,te)})); - }`}const W=I.length,k=I[I.length-1];N+=` - return getChannel( - getX${W}(${c(w,R,k)}), - vec2(${c(B,R,k)}));`;const V=(0,g.getGlsl)(r.session.backend.glContext.version),J=` - ${S} - float getValue(${w.map(Y=>"int "+Y)}) { - ${N} - } - - void main() { - ${T} coords = getOutputCoords(); - int lastDim = coords.${w[_-1]}; - coords.${w[_-1]} = coords.${w[_-2]}; - coords.${w[_-2]} = lastDim; - - vec4 result = vec4(getValue(${v}), 0., 0., 0.); - - ${v[_-1]} = ${v[_-1]} + 1; - if (${v[_-1]} < ${y[_-1]}) { - result.g = getValue(${v}); - } - - ${v[_-2]} = ${v[_-2]} + 1; - if (${v[_-2]} < ${y[_-2]}) { - result.a = getValue(${v}); - } - - ${v[_-1]} = ${v[_-1]} - 1; - if (${v[_-2]} < ${y[_-2]} && - ${v[_-1]} < ${y[_-1]}) { - result.b = getValue(${v}); - } - ${V.output} = result; - } - `;return Object.assign(Object.assign({},a),{output:{dims:y,type:l[0].type,textureType:p.TextureType.packed},shaderSource:J,hasMain:!0})})(f,t,s,i.axis)})};const c=(f,s,i)=>{const t=f.indexOf(s);return f.map((e,n)=>n===t?`${e} - ${i}`:e).join()}},2069:(D,u,b)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.parseConcatAttributes=u.concat=void 0;const g=b(246),p=b(2039),h=b(1163);u.concat=(e,n,r)=>(t(n),e.session.pack&&n[0].dims.length>1?[e.run((0,h.createPackedConcatProgramInfoLoader)(e,n,r),n)]:[e.run(o(e,n,r),n)]);const o=(e,n,r)=>{const a=(l=n.length,d=r.cacheKey,{name:"Concat",inputNames:Array.from({length:l},(m,y)=>`X${y}`),inputTypes:Array(l).fill(p.TextureType.unpacked),cacheHint:d});var l,d;return Object.assign(Object.assign({},a),{get:()=>((m,y,_,v)=>{const T=_[0].dims.slice();if(v>=T.length||v<-1*T.length)throw new Error("axis specified for concat doesn't match input dimensionality");v<0&&(v=T.length+v);const S=T.slice(0);for(let j=1;j<_.length;j++){const N=_[j].dims.slice();for(let W=0;W`int getTextureWhereDataResides(int index) { - ${e.map((n,r)=>`if(index<${n}) {return ${r};} -`).join("")} - }`,f=e=>c(e),s=(e,n)=>{const r=[`float fetchDataFromCorrectTexture(int textureIndex, int indices[${n}]) {`];for(let a=0;a{const n=["int getSizeInConcatAxisValueFromIndex(int index) {"];for(let r=0;r(0,g.createAttributeWithCacheKey)({axis:e.attributes.getInt("axis")});const t=e=>{if(!e||e.length<1)throw new Error("too few inputs");const n=e[0].type,r=e[0].dims.length;if(n==="string")throw new Error("string tensor is not supported yet");for(const a of e){if(a.type!==n)throw new Error("input tensors should be one type");if(a.dims.length!==r)throw new Error("input tensors should have the same shape")}}},4770:(D,u,b)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.createUnpackedGroupedConvProgramInfoLoader=void 0;const g=b(6231),p=b(5060),h=b(2039),o=b(8138),c=b(2823);u.createUnpackedGroupedConvProgramInfoLoader=(f,s,i)=>{const t=(e=s.length>2,n=i.cacheKey,{name:"GroupedConv",inputNames:e?["X","W","Bias"]:["X","W"],inputTypes:e?[h.TextureType.unpacked,h.TextureType.unpacked,h.TextureType.unpacked]:[h.TextureType.unpacked,h.TextureType.unpacked],cacheHint:n});var e,n;return Object.assign(Object.assign({},t),{get:()=>((r,a,l,d)=>{const m=a.length>2?"value += getBias(output_channel);":"",y=a[0].dims.slice(),_=a[1].dims.slice(),v=_[0]/d.group;g.Logger.verbose("GroupedConv",`autpPad:${d.autoPad}, dilations:${d.dilations}, group:${d.group}, kernelShape:${d.kernelShape}, pads:${d.pads}, strides:${d.strides}`);const T=(0,o.calculateOutputShape)(y,_,d.dilations,d.pads,d.strides),S=(0,p.getGlsl)(r.session.backend.glContext.version),{activationFunction:O,applyActivation:w}=(0,c.getActivationSnippet)(d),I=` - const ivec2 strides = ivec2(${d.strides[0]}, ${d.strides[1]}); - const ivec2 pads = ivec2(${d.pads[0]}, ${d.pads[1]}); - ${O} - void main() { - ivec4 coords = getOutputCoords(); - int batch = coords.x; - int output_channel = coords.y; - ivec2 xRCCorner = coords.zw * strides - pads; - int group_id = output_channel / ${v}; - - float value = 0.0; - for (int wInChannel = 0; wInChannel < ${_[1]}; wInChannel++) { - int input_channel = group_id * ${_[1]} + wInChannel; - for (int wHeight = 0; wHeight < ${_[2]}; wHeight++) { - int xHeight = xRCCorner.x + wHeight * ${d.dilations[0]}; - - if (xHeight < 0 || xHeight >= ${y[2]}) { - continue; - } - - for (int wWidth = 0; wWidth < ${_[3]}; wWidth++) { - int xWidth = xRCCorner.y + wWidth * ${d.dilations[1]}; - if (xWidth < 0 || xWidth >= ${y[3]}) { - continue; - } - - float xVal = getX(batch, input_channel, xWidth, xHeight); - float wVal = getW(output_channel, wInChannel, wWidth, wHeight); - value += xVal*wVal; - } - } - } - ${m} - ${w} - ${S.output} = vec4(value, .0, .0, .0); - } -`;return Object.assign(Object.assign({},l),{output:{dims:T,type:a[0].type,textureType:h.TextureType.unpacked},shaderSource:I,hasMain:!0})})(f,s,t,i)})}},1386:(D,u,b)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.conv2DPacked=u.conv2DPackedPointwise=void 0;const g=b(8138),p=b(8555),h=b(708);u.conv2DPackedPointwise=(o,c,f)=>{const s=c[0].dims,i=c[1].dims,t=(0,g.calculateOutputShape)(s,i,f.dilations,f.pads,f.strides),e=o.reshapePacked(c[0],[s[1],s[2]*s[3]]),n=o.reshapePacked(c[1],[i[0],i[1]]),r=c.length>2?[n,e,c[2]]:[n,e],a=o.run((0,h.createPackedMatmulProgramInfoLoader)(o,r,f),r);return o.reshapePacked(a,t)},u.conv2DPacked=(o,c,f)=>{const s=c[0].dims,i=c[1].dims,t=(0,g.calculateOutputShape)(s,i,f.dilations,f.pads,f.strides),e=o.run((0,p.createPackedIm2ColProgramInfoLoader)(o,c[0],c[1],t,f),[c[0]]),n=o.reshapePacked(c[1],[i[0],i[1]*i[2]*i[3]]),r=c.length===3?[n,e,c[2]]:[n,e],a=o.run((0,h.createPackedMatmulProgramInfoLoader)(o,r,f),r);return o.reshapePacked(a,t)}},9663:(D,u,b)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.parseConvTransposeAttributes=u.convTranspose=void 0;const g=b(246),p=b(5060),h=b(2039),o=b(2823),c=(n,r,a,l,d,m)=>(n-1)*r+a+(l-1)*d+1-m,f=(n,r,a,l,d)=>{const m=Math.floor(n/2);r==="SAME_UPPER"?(a[l]=m,a[d]=n-m):r==="SAME_LOWER"&&(a[l]=n-m,a[d]=m)};u.convTranspose=(n,r,a)=>(e(r,a),s(n,r,a));const s=(n,r,a)=>{const l=t(a,r);return[i(n,r,l)]},i=(n,r,a)=>n.run(((l,d,m)=>{const y=(_=d.length>2,v=m.cacheKey,{name:"ConvTranspose",inputNames:_?["X","W","B"]:["X","W"],inputTypes:_?[h.TextureType.unpacked,h.TextureType.unpacked,h.TextureType.unpacked]:[h.TextureType.unpacked,h.TextureType.unpacked],cacheHint:v});var _,v;return Object.assign(Object.assign({},y),{get:()=>((T,S,O,w)=>{const I=S.length>2?"getB(output_channel)":"0.0",R=S[0].dims,B=S[1].dims,j=B[1],N=B[0]/w.group,W=[S[0].dims[0],S[1].dims[1]*w.group,...w.outputShape],k=(0,p.getGlsl)(T.session.backend.glContext.version),{activationFunction:V,applyActivation:J}=(0,o.getActivationSnippet)(w),Y=` - const ivec2 strides = ivec2(${w.strides[0]}, ${w.strides[1]}); - const ivec2 pads = ivec2(${w.pads[0]}, ${w.pads[1]}); - ${V} - void main() { - ivec4 coords = getOutputCoords(); - int batch = coords.x; - int output_channel = coords.y; - - ivec2 loc = coords.zw + pads; - - int group_id = output_channel / ${j}; - int wOutChannel = output_channel - group_id * ${j}; - - float value = ${I}; - for (int inChannelOffset = 0; inChannelOffset < ${N}; inChannelOffset++) { - int input_channel = group_id * ${N} + inChannelOffset; - for (int wWOff = 0; wWOff < ${B[2]}; wWOff++) { - for (int wHOff = 0; wHOff < ${B[3]}; wHOff++) { - ivec2 wOff = ivec2(wWOff * ${w.dilations[0]}, wHOff * ${w.dilations[1]}); - ivec2 wLoc = loc - wOff; - ivec2 wLocIn = wLoc / strides; - if ( - wLocIn * strides == wLoc && - wLocIn.x >= 0 && wLocIn.x < ${R[2]} && - wLocIn.y >= 0 && wLocIn.y < ${R[3]} - ) { - float xVal = getX(batch, input_channel, wLocIn.y, wLocIn.x); - float wVal = getW(input_channel, wOutChannel, wHOff, wWOff); - value += xVal * wVal; - } - } - } - } - ${J} - ${k.output} = vec4(value, .0, .0, .0); - } -`;return Object.assign(Object.assign({},O),{output:{dims:W,type:S[0].type,textureType:h.TextureType.unpacked},shaderSource:Y,hasMain:!0})})(l,d,y,m)})})(n,r,a),r),t=(n,r)=>{const a=n.kernelShape.slice();if(n.kernelShape.length===0)for(let y=2;y{const R=y.length-2,B=I.length===0;for(let j=0;j{const r=n.attributes,a=(0,o.parseInternalActivationAttributes)(r),l=r.getString("auto_pad","NOTSET"),d=r.getInts("dilations",[1,1]),m=r.getInt("group",1),y=r.getInts("kernel_shape",[]),_=r.getInts("output_padding",[0,0]),v=r.getInts("output_shape",[]),T=r.getInts("pads",[0,0,0,0]),S=r.getInts("strides",[1,1]);return(0,g.createAttributeWithCacheKey)(Object.assign({autoPad:l,dilations:d,group:m,kernelShape:y,outputPadding:_,outputShape:v,pads:T,strides:S},a))};const e=(n,r)=>{if(!n||n.length!==2&&n.length!==3)throw new Error("Conv requires 2 or 3 inputs");if(n[0].dims.length!==4||n[1].dims.length!==4)throw new Error("currently only support 2-dimensional conv");if(n[0].dims[1]!==n[1].dims[0])throw new Error("FILTER_IN_CHANNEL should be equal to DATA_CHANNEL");const a=n[1].dims[1]*r.group;if(n.length===3&&(n[2].dims.length!==1||n[2].dims[0]!==a))throw new Error("invalid bias");const l=n[0].dims.length-2;if(r.dilations.length!==l)throw new Error(`dilations should be ${l}D`);if(r.strides.length!==l)throw new Error(`strides should be ${l}D`);if(r.pads.length!==2*l)throw new Error(`pads should be ${2*l}D`);if(r.outputPadding.length!==l)throw new Error(`output_padding should be ${l}D`);if(r.kernelShape.length!==0&&r.kernelShape.length!==n[1].dims.length-2)throw new Error("invalid kernel shape");if(r.outputShape.length!==0&&r.outputShape.length!==n[0].dims.length-2)throw new Error("invalid output shape");if(n[0].type!=="float32"||n[1].type!=="float32")throw new Error("ConvTranspose input(X,W) should be float tensor");if(n.length===3&&n[2].type!=="float32")throw new Error("ConvTranspose input(bias) should be float tensor")}},8138:(D,u,b)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.parseConvAttributes=u.conv=u.calculateOutputShape=void 0;const g=b(246),p=b(2517),h=b(4770),o=b(1386),c=b(9828),f=b(2823),s=b(3248),i=b(5623);u.calculateOutputShape=(l,d,m,y,_)=>{const v=l[0],T=l.slice(2),S=T.length,O=d[0],w=d.slice(2).map((R,B)=>R+(R-1)*(m[B]-1)),I=T.map((R,B)=>R+y[B]+y[B+S]).map((R,B)=>Math.floor((R-w[B]+_[B])/_[B]));return[v,O].concat(...I)},u.conv=(l,d,m)=>(a(d,m),t(l,d,m));const t=(l,d,m)=>{const y=r(m,d),_=l.session.pack,v=y.kernelShape[0]===1&&y.kernelShape[1]===1;return y.group>1?[l.run((0,h.createUnpackedGroupedConvProgramInfoLoader)(l,d,y),d)]:v&&_?[e(l,d,y)]:_&&d[0].dims.length===4&&d[0].dims[0]===1&&!v?[(0,o.conv2DPacked)(l,d,y)]:[n(l,d,y)]},e=(l,d,m)=>{const y=d[0].dims,_=d[1].dims,v=(0,u.calculateOutputShape)(y,_,m.dilations,m.pads,m.strides),T=l.reshapeUnpacked(d[0],[y[1],y[2]*y[3]]),S=l.reshapeUnpacked(d[1],[_[0],_[1]]),O=d.length>2?[S,T,d[2]]:[S,T],w=l.run((0,i.createMatmulProgramInfoLoader)(O,m),O);return l.reshapeUnpacked(w,v)},n=(l,d,m)=>{const y=d[0].dims,_=d[1].dims,v=(0,u.calculateOutputShape)(y,_,m.dilations,m.pads,m.strides),T=l.run((0,s.createIm2ColProgramInfoLoader)(l,d[0],d[1],v,m),[d[0]]),S=d.length===3?[T,d[1],d[2]]:[T,d[1]];return l.run((0,c.createDotProductProgramInfoLoader)(l,d,v,m),S)},r=(l,d)=>{const m=l.kernelShape.slice();if(l.kernelShape.length===0)for(let v=2;v{const d=l.attributes,m=(0,f.parseInternalActivationAttributes)(d),y=d.getString("auto_pad","NOTSET"),_=d.getInts("dilations",[1,1]),v=d.getInt("group",1),T=d.getInts("kernel_shape",[]),S=d.getInts("pads",[0,0,0,0]),O=d.getInts("strides",[1,1]);return(0,g.createAttributeWithCacheKey)(Object.assign({autoPad:y,dilations:_,group:v,kernelShape:T,pads:S,strides:O},m))};const a=(l,d)=>{if(!l||l.length!==2&&l.length!==3)throw new Error("Conv requires 2 or 3 inputs");if(l[0].dims.length!==4||l[1].dims.length!==4)throw new Error("currently only support 2-dimensional conv");if(l[0].dims[1]!==l[1].dims[1]*d.group)throw new Error("FILTER_IN_CHANNEL should be equal to DATA_CHANNEL");if(l.length===3&&(l[2].dims.length!==1||l[1].dims[0]!==l[2].dims[0]))throw new Error("invalid bias");const m=l[0].dims.length-2;if(d.dilations.length!==m)throw new Error(`dilations should be ${m}D`);if(d.strides.length!==m)throw new Error(`strides should be ${m}D`);if(d.pads.length!==2*m)throw new Error(`pads should be ${2*m}D`);if(d.kernelShape.length!==0&&d.kernelShape.length!==l[1].dims.length-2)throw new Error("invalid kernel shape");if(l[0].type!=="float32"||l[1].type!=="float32")throw new Error("Conv input(X,W) should be float tensor");if(l.length===3&&l[2].type!=="float32")throw new Error("Conv input(bias) should be float tensor")}},5193:(D,u,b)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.parseDepthToSpaceAttributes=u.depthToSpace=void 0;const g=b(3738);u.depthToSpace=(h,o,c)=>{p(o);const f=c.blocksize,s=f*f,i=c.mode==="DCR"?[0,3,4,1,5,2]:[0,1,4,2,5,3],t=c.mode==="DCR"?[o[0].dims[0],f,f,o[0].dims[1]/s,o[0].dims[2],o[0].dims[3]]:[o[0].dims[0],o[0].dims[1]/s,f,f,o[0].dims[2],o[0].dims[3]],e=h.reshapeUnpacked(o[0],t),n={perm:i,cacheKey:`${i}`},[r]=(0,g.transpose)(h,[e],n),a=[o[0].dims[0],o[0].dims[1]/s,o[0].dims[2]*f,o[0].dims[3]*f];return[h.reshapeUnpacked(r,a)]},u.parseDepthToSpaceAttributes=h=>{const o=h.attributes.getInt("blocksize");if(o<1)throw new Error(`blocksize must be >= 1, but got : ${o} for DepthToSpace`);const c=h.attributes.getString("mode","DCR");if(c!=="DCR"&&c!=="CRD")throw new Error(`unrecognized mode: ${c} for DepthToSpace`);return{mode:c,blocksize:o}};const p=h=>{if(h.length!==1)throw new Error(`DepthToSpace expect 1 inputs, but got ${h.length}`);if(h[0].type==="string"||h[0].dims.length!==4)throw new TypeError("DepthToSpace input should be a 4-D numeric tensor")}},9828:(D,u,b)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.createDotProductProgramInfoLoader=void 0;const g=b(2517),p=b(5060),h=b(2039),o=b(2823),c=b(3248);u.createDotProductProgramInfoLoader=(f,s,i,t)=>{const e=((n,r)=>({name:"ConvDotProduct",inputNames:n?["Im2Col","K","B"]:["Im2Col","K"],inputTypes:n?[h.TextureType.unpacked,h.TextureType.packedLastDimension,h.TextureType.unpacked]:[h.TextureType.unpacked,h.TextureType.packedLastDimension],cacheKey:r.activationCacheKey}))(s.length>2,t);return Object.assign(Object.assign({},e),{get:()=>((n,r,a,l,d)=>{const m=a[0].dims,y=a[1].dims,_=[y[0],Math.ceil(m[1]*y[2]*y[3]/4)],v=(0,c.calculateIm2ColDims)(m,y,l),[T,S]=n.calculateTextureWidthAndHeight(_,h.TextureType.packedLastDimension),O=g.ShapeUtil.computeStrides(v),[w,I]=n.calculateTextureWidthAndHeight(v,h.TextureType.packedLastDimension),R=l.length,B=a.length<3?"0.0":"_B(b)",j=Math.ceil(m[1]*y[2]*y[3]/4),{activationFunction:N,applyActivation:W}=(0,o.getActivationSnippet)(d),k=(0,p.getGlsl)(n.session.backend.glContext.version),V=` -${N} -float process(int indices[${R}]) { - int b[1]; - b[0] = indices[1]; - int im2col[4]; - im2col[0] = indices[0]; - im2col[1] = indices[2]; - im2col[2] = indices[3]; - int im2colOffset = im2col[0] * ${O[0]} + im2col[1] * ${O[1]} + im2col[2] * ${O[2]}; - int kernelOffset = indices[1] * ${_[1]}; - float value = ${B}; - for (int i = 0; i < ${j}; ++i) { - vec2 im2colCoords = offsetToCoords(im2colOffset, ${w}, ${I}); - vec2 kernelCoords = offsetToCoords(kernelOffset, ${T}, ${S}); - value += dot(${k.texture2D}(Im2Col, im2colCoords), ${k.texture2D}(K, kernelCoords)); - ++im2colOffset; - ++kernelOffset; - } - ${W} - return value; -}`;return Object.assign(Object.assign({},r),{output:{dims:l,type:a[0].type,textureType:h.TextureType.unpacked},shaderSource:V})})(f,e,s,i,t)})}},7992:(D,u,b)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.parseFlattenAttributes=u.flatten=void 0;const g=b(2517);u.flatten=(h,o,c)=>{p(o,c);const f=g.ShapeUtil.flattenShape(o[0].dims,c);return[h.reshapeUnpacked(o[0],f)]},u.parseFlattenAttributes=h=>h.attributes.getInt("axis",1);const p=(h,o)=>{if(!h||h.length!==1)throw new Error("Flatten requires 1 input.");const c=h[0].dims.length;if(c===0)throw new Error("scalar tensor is not supported.");if(o<-c||o>c)throw new Error("Invalid axis");if(h[0].type==="string")throw new Error("string tensor is not supported.")}},2823:(D,u,b)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.parseInternalActivationAttributes=u.getActivationSnippet=void 0;const g=b(2517),p=b(4909);u.getActivationSnippet=function(h){let o;switch(h.activation){case"Relu":o=(0,p.glslRelu)();break;case"Sigmoid":o=(0,p.glslSigmoid)();break;case"Clip":o=(0,p.glslClip)(h.clipMin,h.clipMax);break;default:return{activationFunction:"",applyActivation:""}}const c=o.name;return{activationFunction:o.body,applyActivation:`value = ${c}_(value);`}},u.parseInternalActivationAttributes=h=>{const o=h.getString("activation","");if(o==="Clip"){const[c,f]=h.getFloats("activation_params",[g.MIN_CLIP,g.MAX_CLIP]);return{activation:o,clipMax:f,clipMin:c,activationCacheKey:`${o}:${c},${f}`}}return{activation:o,activationCacheKey:o}}},1253:(D,u,b)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.parseGatherAttributes=u.gather=void 0;const g=b(246),p=b(782),h=b(2517),o=b(2039);u.gather=(i,t,e)=>(s(t,e.axis),[i.run(f(i,t,e),t)]),u.parseGatherAttributes=i=>(0,g.createAttributeWithCacheKey)({axis:i.attributes.getInt("axis",0)});const c={name:"Gather",inputNames:["A","B"],inputTypes:[o.TextureType.unpacked,o.TextureType.unpacked]},f=(i,t,e)=>{const n=Object.assign(Object.assign({},c),{cacheHint:e.cacheKey});return Object.assign(Object.assign({},n),{get:()=>((r,a,l,d)=>{const m=l[0].dims.slice(),y=l[1].dims.slice(),_=new Array(m.length+y.length-1);d=h.ShapeUtil.normalizeAxis(d,m.length);const v=[];for(let S=0;S<_.length;S++)S{if(!i||i.length!==2)throw new Error("Gather requires 2 inputs.");const e=i[0].dims.length;if(e<1)throw new Error("Invalid input shape.");if(t<-e||t>e-1)throw new Error("Invalid axis.");if(p.NUMBER_TYPES.indexOf(i[0].type)===-1)throw new Error("Invaid input type.");if(i[1].type!=="int32"&&i[1].type!=="int16")throw new Error("Invaid input type.")}},4776:(D,u,b)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.parseGemmAttributesV11=u.parseGemmAttributesV7=u.gemm=void 0;const g=b(246),p=b(2517),h=b(2039);u.gemm=(i,t,e)=>(s(t,e),[i.run(c(t,e),t)]);const o=(i,t)=>{const e=i.attributes.getInt("transA",0)!==0,n=i.attributes.getInt("transB",0)!==0,r=i.attributes.getFloat("alpha",1),a=i.attributes.getFloat("beta",1);return(0,g.createAttributeWithCacheKey)({transA:e,transB:n,alpha:r,beta:a,isOptionalC:t})};u.parseGemmAttributesV7=i=>o(i,!1),u.parseGemmAttributesV11=i=>o(i,!0);const c=(i,t)=>{const e={name:"Gemm",inputNames:i.length===3?["A","B","C"]:["A","B"],inputTypes:i.length===3?[h.TextureType.unpacked,h.TextureType.unpacked,h.TextureType.unpacked]:[h.TextureType.unpacked,h.TextureType.unpacked],key:t.cacheKey};return Object.assign(Object.assign({},e),{get:()=>f(e,i,t)})},f=(i,t,e)=>{const n=t[0].dims.slice(),r=t[1].dims.slice(),[a,l]=p.GemmUtil.getShapeOfGemmResult(n,e.transA,r,e.transB,t.length===3?t[2].dims:void 0),d=[a,l];if(!d)throw new Error("Can't use gemm on the given tensors");let m=n[n.length-1],y="";e.transA&&(m=n[0]),e.transA&&e.transB?y="value += _A_T(a) * _B_T(b);":e.transA&&!e.transB?y="value += _A_T(a) * _B(b);":!e.transA&&e.transB?y="value += _A(a) * _B_T(b);":e.transA||e.transB||(y="value += _A(a) * _B(b);");const _=d.length,v=` - float process(int indices[${_}]) { - int a[${_}]; - int b[${_}]; - ${t.length===3?`int c[${t[2].dims.length}];`:""} - - copyVec(indices, a); - copyVec(indices, b); - ${t.length===3?"bcastIndices_C(indices, c);":""} - - float value = 0.0; - for (int k=0; k<${m}; ++k) { - a[${_-1}] = k; - b[${_-2}] = k; - ${y} - } - - value = value * alpha; - ${t.length===3?"value += beta * _C(c);":""} - return value; - }`;return Object.assign(Object.assign({},i),{output:{dims:d,type:t[0].type,textureType:h.TextureType.unpacked},variables:[{name:"alpha",type:"float",data:e.alpha},{name:"beta",type:"float",data:e.beta}],shaderSource:v})},s=(i,t)=>{if(!i)throw new Error("Input is missing");if(t.isOptionalC&&(i.length<2||i.length>3))throw new Error("Invaid input shape.");if(!t.isOptionalC&&i.length!==3)throw new Error("Gemm requires 3 inputs");if(i.length===3&&i[2].dims.length!==1&&i[2].dims.length!==2)throw new Error("Invalid input shape of C");if(i[0].type!=="float32"&&i[0].type!=="float64"||i[1].type!=="float32"&&i[1].type!=="float64"||i.length===3&&i[2].type!=="float32"&&i[2].type!=="float64")throw new Error("Invalid input type.");if(i[0].type!==i[1].type||i.length===3&&i[0].type!==i[2].type)throw new Error("Input types are mismatched")}},8555:(D,u,b)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.createPackedIm2ColProgramInfoLoader=void 0;const g=b(5060),p=b(2039),h=b(2827);u.createPackedIm2ColProgramInfoLoader=(o,c,f,s,i)=>{const t=(e=i.cacheKey,{name:"Im2Col (packed)",inputNames:["A"],inputTypes:[p.TextureType.packed],cacheHint:e});var e;return Object.assign(Object.assign({},t),{get:()=>((n,r,a,l,d,m)=>{const y=a.dims,_=l.dims,v=d.length,T=[_[1]*_[2]*_[3],d[2]*d[3]],S=_[2]*_[3],O=(0,h.unpackFromChannel)(),w=(0,g.getGlsl)(n.session.backend.glContext.version);let I="";for(let B=0;B<=1;B++)for(let j=0;j<=1;j++)I+=` - blockIndex = rc.x + ${j}; - pos = rc.y + ${B}; - - if(blockIndex < ${T[1]} && pos < ${T[0]}) { - offsetY = int(blockIndex / (${d[v-1]})) * ${m.strides[0]} - - ${m.pads[0]}; - d0 = offsetY + ${m.dilations[0]} * (imod(pos, ${S}) / ${_[2]}); - - if(d0 < ${y[2]} && d0 >= 0) { - offsetX = imod(blockIndex, ${d[v-1]}) * ${m.strides[1]} - - ${m.pads[1]}; - d1 = offsetX + ${m.dilations[1]} * imod(imod(pos, ${S}), ${_[2]}); - - if(d1 < ${y[3]} && d1 >= 0) { - - ch = int(float(pos)/ ${S}.); - innerDims = vec2(d0, d1); - result[${2*B+j}] = getChannel( - getA(0, ch, int(innerDims.x), - int(innerDims.y)), innerDims); - } - } - } - - `;const R=` - ${O} - - void main() { - ivec2 rc = getOutputCoords(); - vec4 result = vec4(0.0); - int blockIndex, pos, offsetY, d0, offsetX, d1, ch; - vec2 innerDims; - ${I} - ${w.output} = result; - } - `;return Object.assign(Object.assign({},r),{output:{dims:T,type:a.type,textureType:p.TextureType.packed},shaderSource:R,hasMain:!0})})(o,t,c,f,s,i)})}},3248:(D,u,b)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.calculateIm2ColDims=u.createIm2ColProgramInfoLoader=void 0;const g=b(2039);u.createIm2ColProgramInfoLoader=(p,h,o,c,f)=>{const s=(i=f.cacheKey,{name:"Im2Col",inputNames:["X"],inputTypes:[g.TextureType.unpacked],cacheHint:i});var i;return Object.assign(Object.assign({},s),{get:()=>((t,e,n,r,a,l)=>{const d=n.dims,m=r.dims,y=a.length,_=(0,u.calculateIm2ColDims)(d,m,a,4),v=` - const int XC = ${d[1]}; - const int XH = ${d[2]}; - const int XW = ${d[3]}; - const int KH = ${l.kernelShape[0]}; - const int KW = ${l.kernelShape[1]}; - const int dilationH = ${l.dilations[0]}; - const int dilationW = ${l.dilations[1]}; - const int strideH = ${l.strides[0]}; - const int strideW = ${l.strides[1]}; - const int padH = ${l.pads[0]}; - const int padW = ${l.pads[1]}; - const int KHKW = KH*KW; - const int XCKHKW = XC * KHKW; - const int outputChannels = 4; - vec4 process(int indices[${y}]) { - int b = indices[0]; // batch size - int oh = indices[1] * strideH - padH; //output height - int ow = indices[2] * strideW - padW; //output width - int p = indices[3] * outputChannels; //patch - vec4 value = vec4(0.0); - for(int i=0; i < outputChannels; ++i) { - if(p < XCKHKW) { - int patchC = p / KHKW; - int patchH = (p - patchC*KHKW) / KW; - int patchW = (p - patchC*KHKW) - patchH * KW; - int xh2 = oh + patchH * dilationH; - int xw2 = ow + patchW * dilationW; - int x[${d.length}]; - x[0] = b; - x[1] = patchC; - x[2] = xh2; - x[3] = xw2; - if(xh2 >= 0 && - xh2 < XH && - xw2 >= 0 && - xw2 < XW) { - value[i] = _X(x); - } - } - ++p; - } - return value; - } - `;return Object.assign(Object.assign({},e),{output:{dims:_,type:n.type,textureType:g.TextureType.packedLastDimension},shaderSource:v})})(0,s,h,o,c,f)})},u.calculateIm2ColDims=(p,h,o,c=4)=>[o[0],o[2],o[3],Math.ceil(p[1]*h[2]*h[3]/c)]},6572:(D,u,b)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.parseImageScalerAttributes=u.imageScaler=void 0;const g=b(246),p=b(2039);u.imageScaler=(s,i,t)=>(f(i),[s.run(o(s,i,t),i)]),u.parseImageScalerAttributes=s=>{const i=s.attributes.getFloat("scale"),t=s.attributes.getFloats("bias");return(0,g.createAttributeWithCacheKey)({scale:i,bias:t})};const h={name:"ImageScaler",inputNames:["X"],inputTypes:[p.TextureType.unpacked]},o=(s,i,t)=>{const e=Object.assign(Object.assign({},h),{cacheHint:t.cacheKey});return Object.assign(Object.assign({},e),{get:()=>((n,r,a,l)=>{const d=a[0].dims.slice(),m=d.length,y=` - ${c(l.bias.length)} - float process(int indices[${m}]) { - return _X(indices) * scale + getBias(bias, indices[1]); - }`;return Object.assign(Object.assign({},r),{output:{dims:d,type:a[0].type,textureType:p.TextureType.unpacked},variables:[{name:"bias",type:"float",arrayLength:l.bias.length,data:l.bias},{name:"scale",type:"float",data:l.scale}],shaderSource:y})})(0,e,i,t)})},c=s=>{const i=[`float getBias(float bias[${s}], int channel) {`];for(let t=0;t{if(!s||s.length!==1)throw new Error("ImageScaler requires 1 input.");if(s[0].dims.length!==4)throw new Error("Invalid input shape.");if(s[0].type!=="float32"&&s[0].type!=="float64")throw new Error("Invalid input type.")}},3346:(D,u,b)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.parseInstanceNormalizationAttributes=u.instanceNormalization=void 0;const g=b(5060),p=b(2039);u.instanceNormalization=(i,t,e)=>{s(t);const n=i.run(o(t[0]),t);return[i.run(f(i,t[0],e,n.dims),[t[0],n,t[1],t[2]])]},u.parseInstanceNormalizationAttributes=i=>i.attributes.getFloat("epsilon",1e-5);const h={name:"InstanceNormalization_MeanAndVariance",inputNames:["X"],inputTypes:[p.TextureType.unpacked]},o=i=>Object.assign(Object.assign({},h),{get:()=>((t,e)=>{const n=e.dims.slice(),r=n[1],a=n[2]*n[3],l=[n[0],r],d=` - vec4 process(int[2] indices) { - vec4 v = vec4(0.0); - int a[4]; - a[0] = indices[0]; - a[1] = indices[1]; - float temp = 0.0; - for(int a2=0; a2<${n[2]}; a2++) { - a[2] = a2; - for(int a3=0; a3<${n[3]}; a3++) { - a[3] = a3; - float x = _X(a); - temp += x; - } - } - float mean = temp / float(${a}); - temp = 0.0; - for(int a2=0; a2<${n[2]}; a2++) { - a[2] = a2; - for(int a3=0; a3<${n[3]}; a3++) { - a[3] = a3; - float x = _X(a); - temp += (x - mean) * (x - mean); - } - } - v.r = mean; - v.g = temp / float(${a}); - - return v; - }`;return Object.assign(Object.assign({},t),{output:{dims:l,type:e.type,textureType:p.TextureType.packedLastDimension},shaderSource:d})})(h,i)}),c={name:"InstanceNormalization_ComputeOutput",inputNames:["X","MeanAndVariance","Scale","B"],inputTypes:[p.TextureType.unpacked,p.TextureType.packedLastDimension,p.TextureType.unpacked,p.TextureType.unpacked]},f=(i,t,e,n)=>{const r=Object.assign(Object.assign({},c),{cacheHint:`${e}`});return Object.assign(Object.assign({},r),{get:()=>((a,l,d,m,y)=>{const _=(0,g.getGlsl)(a.session.backend.glContext.version),[v,T]=a.calculateTextureWidthAndHeight(y,p.TextureType.packedLastDimension),[S,O]=[v/4,T],w=` - vec4 get_MeanAndVariance(int[2] mv) { - int offset = indicesToOffset_MeanAndVariance(mv); - vec2 coords = offsetToCoords(offset, ${S}, ${O}); - return ${_.texture2D}(MeanAndVariance, coords); - } - - float process(int[4] indices) { - int mv[2]; - mv[0] = indices[0]; - mv[1] = indices[1]; - vec4 mean_and_variance = get_MeanAndVariance(mv); - float mean = mean_and_variance.r; - float variance = mean_and_variance.g; - - int sb[1]; - sb[0] = indices[1]; - float scale = _Scale(sb); - float b = _B(sb); - - return scale * (_X(indices) - mean) / sqrt(variance + epsilon) + b; - }`;return Object.assign(Object.assign({},l),{output:{dims:d.dims,type:d.type,textureType:p.TextureType.unpacked},variables:[{name:"epsilon",type:"float",data:m}],shaderSource:w})})(i,r,t,e,n)})},s=i=>{if(!i||i.length!==3)throw new Error("InstanceNormalization requires 3 inputs.");const t=i[0],e=i[1],n=i[2];if(t.dims.length<3||e.dims.length!==1||n.dims.length!==1)throw new Error("Invalid input shape.");if(e.dims[0]!==t.dims[1]||n.dims[0]!==t.dims[1])throw new Error("Input shapes are mismatched.");if(t.type!=="float32"&&t.type!=="float64"||e.type!=="float32"&&e.type!=="float64"||n.type!=="float32"&&n.type!=="float64")throw new Error("Invalid input type.");if(i[0].dims.length!==4)throw new Error("Only support 4-D input shape.")}},708:(D,u,b)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.createPackedMatmulProgramInfoLoader=void 0;const g=b(2517),p=b(5060),h=b(2039),o=b(9390),c=b(2823),f=b(5623);u.createPackedMatmulProgramInfoLoader=(s,i,t)=>{const e=(n=i.length>2,r=t.activationCacheKey,{name:"MatMul (packed)",inputNames:n?["A","B","Bias"]:["A","B"],inputTypes:n?[h.TextureType.packed,h.TextureType.packed,h.TextureType.packed]:[h.TextureType.packed,h.TextureType.packed],cacheHint:r});var n,r;return Object.assign(Object.assign({},e),{get:()=>((a,l,d,m)=>{const y=d.length>2,_=y?"value += getBiasForMatmul();":"",v=d[0].dims,T=d[1].dims,S=g.BroadcastUtil.calcShape(v,T,!0),O=!g.ShapeUtil.areEqual(d[0].dims,d[1].dims);if(!S)throw new Error("Can't use matmul on the given tensors");const w=v[v.length-1],I=Math.ceil(w/2),R=v.length,B=T.length,j=(0,p.getGlsl)(a.session.backend.glContext.version),N=(0,o.getCoordsDataType)(S.length),W=S.length,k=(0,o.getGlChannels)(),{activationFunction:V,applyActivation:J}=(0,c.getActivationSnippet)(m),Y=y?`${(0,f.getBiasForMatmul)(N,k,d[2].dims,S,!0)}`:"",te=O?`${function(Oe,le,xe,_e){let Ne=[],He=[];const Ae=xe[0].dims,Ce=xe[1].dims,Fe=Ae.length,Ee=Ce.length,we=_e.length,je=we-Fe,Ue=we-Ee;Ne=Ae.map((Se,Me)=>`coords.${le[Me+je]}`),Ne[Fe-1]="i*2",Ne.join(", "),He=Ce.map((Se,Me)=>`coords.${le[Me+Ue]}`),He[Ee-2]="i*2",He.join(", ");const Be=g.BroadcastUtil.getBroadcastDims(Ae,_e),We=g.BroadcastUtil.getBroadcastDims(Ce,_e),Ke=Be.map(Se=>`coords.${le[Se+je]} = 0;`).join(` -`),ze=We.map(Se=>`coords.${le[Se+Ue]} = 0;`).join(` -`),Ve=`int lastDim = coords.${le[we-1]}; - coords.${le[we-1]} = coords.${le[we-2]}; - coords.${le[we-2]} = lastDim;`;return` -vec4 getAAtOutCoordsMatmul(int i) { - ${Oe} coords = getOutputCoords(); - ${Ve} - ${Ke} - vec4 outputValue = getA(${Ne}); - return outputValue; -} - -vec4 getBAtOutCoordsMatmul(int i) { - ${Oe} coords = getOutputCoords(); - ${Ve} - ${ze} - vec4 outputValue = getB(${He}); - return outputValue; -}`}(N,k,d,S)}`:"",ne=O?"getAAtOutCoordsMatmul(i)":`getA(${function(Oe,le){let xe="";for(let _e=0;_e{Object.defineProperty(u,"__esModule",{value:!0}),u.getBiasForMatmul=u.createMatmulProgramInfoLoader=u.parseMatMulAttributes=u.matMul=void 0;const g=b(2517),p=b(2039),h=b(9390),o=b(2823),c=b(708);function f(t,e){const n=(r=t.length>2,a=e.activationCacheKey,{name:"MatMul",inputNames:r?["A","B","Bias"]:["A","B"],inputTypes:r?[p.TextureType.unpacked,p.TextureType.unpacked,p.TextureType.unpacked]:[p.TextureType.unpacked,p.TextureType.unpacked],cacheHint:a});var r,a;return Object.assign(Object.assign({},n),{get:()=>function(l,d,m){const y=d[0].dims,_=d[1].dims,v=g.BroadcastUtil.calcShape(y,_,!0);if(!v)throw new Error("Can't use matmul on the given tensors");const T=(0,h.getCoordsDataType)(v.length),S=(0,h.getGlChannels)(),{activationFunction:O,applyActivation:w}=(0,o.getActivationSnippet)(m),I=d.length>2,R=I?"value += getBiasForMatmul();":"",B=I?`${i(T,S,d[2].dims,v,!1)}`:"",j=v.length,N=y.length,W=_.length,k=` - ${O} - ${B} - float process(int indices[${j}]) { - int a[${N}]; - int b[${W}]; - bcastMatmulIndices_A(indices, a); - bcastMatmulIndices_B(indices, b); - - float value; - for (int k=0; k<${y[y.length-1]}; ++k) { - a[${N-1}] = k; - b[${W-2}] = k; - value += _A(a) * _B(b); - } - ${R} - ${w} - return value; - }`;return Object.assign(Object.assign({},l),{output:{dims:v,type:d[0].type,textureType:p.TextureType.unpacked},shaderSource:k})}(n,t,e)})}u.matMul=(t,e,n)=>(s(e),t.session.pack?[t.run((0,c.createPackedMatmulProgramInfoLoader)(t,e,n),e)]:[t.run(f(e,n),e)]),u.parseMatMulAttributes=t=>(0,o.parseInternalActivationAttributes)(t.attributes),u.createMatmulProgramInfoLoader=f;const s=t=>{if(!t||t.length!==2)throw new Error("MatMul requires 2 inputs.");if(t[0].dims[t[0].dims.length-1]!==t[1].dims[t[1].dims.length-2])throw new Error("shared dimension does not match.");if(t[0].type!=="float32"&&t[0].type!=="float64"||t[1].type!=="float32"&&t[1].type!=="float64")throw new Error("inputs should be float type");if(t[0].type!==t[1].type)throw new Error("inputs types should match")};function i(t,e,n,r,a){let l="";const d=n.length,m=r.length,y=m-d;l=m<2&&d>0?"coords":n.map((T,S)=>`coords.${e[S+y]}`).join(", ");const _=g.BroadcastUtil.getBroadcastDims(n,r).map(T=>`coords.${e[T+y]} = 0;`).join(` -`);let v="vec4(outputValue.xx, outputValue.yy)";return g.ShapeUtil.size(n)===1&&(v="vec4(outputValue.x)"),a?` -vec4 getBiasForMatmul() { - ${t} coords = getOutputCoords(); - ${_} - vec4 outputValue = getBias(${l}); - return ${v}; -}`:` -float getBiasForMatmul() { - ${t} coords = getOutputCoords(); - ${_} - return getBias(coords.x); -}`}u.getBiasForMatmul=i},2403:(D,u,b)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.createPackProgramInfoLoader=void 0;const g=b(5060),p=b(2039),h=b(9390),o=b(2827),c={name:"pack",inputNames:["A"],inputTypes:[p.TextureType.unpackedReversed]};u.createPackProgramInfoLoader=(f,s)=>Object.assign(Object.assign({},c),{get:()=>((i,t)=>{const e=(0,g.getGlsl)(i.session.backend.glContext.version),n=t.dims,r=n.length,a=t.dims.length,l=(0,h.getCoordsDataType)(a),d=(0,o.getChannels)("rc",a),m=(y=a,_=d,v=n[n.length-2],T=n[n.length-1],y===0||y===1?"":` - int r = ${_[y-2]}; - int c = ${_[y-1]}; - int rp1 = ${_[y-2]} + 1; - int cp1 = ${_[y-1]} + 1; - bool rEdge = rp1 >= ${T}; - bool cEdge = cp1 >= ${v}; - `);var y,_,v,T;let S;S=r===0?[1,1]:r===1?[n[0],1]:[n[a-1],n[a-2]];const O=function(R,B,j){if(R===0)return"false";if(R===1)return`rc > ${B[0]}`;let N="";for(let W=R-2;W= ${B[W-R+2]}`,W= ${R[0]} ? 0. : getA(rc + 1), - 0, 0`;let N="";if(j>2)for(let W=0;W{Object.defineProperty(u,"__esModule",{value:!0}),u.unpackFromChannel=u.getChannels=u.getVecChannels=void 0;const g=b(9390);function p(h,o){return(0,g.getGlChannels)(o).map(c=>`${h}.${c}`)}u.getVecChannels=p,u.getChannels=function(h,o){return o===1?[h]:p(h,o)},u.unpackFromChannel=function(){return` - float getChannel(vec4 frag, int dim) { - int modCoord = imod(dim, 2); - return modCoord == 0 ? frag.r : frag.g; - } - - float getChannel(vec4 frag, vec2 innerDims) { - vec2 modCoord = mod(innerDims, 2.); - return modCoord.x == 0. ? - (modCoord.y == 0. ? frag.r : frag.g) : - (modCoord.y == 0. ? frag.b : frag.a); - } - `}},2870:(D,u,b)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.parsePadAttributesV11=u.padV11=u.parsePadAttributesV2=u.padV2=void 0;const g=b(246),p=b(2517),h=b(5060),o=b(2039),c={name:"Pad",inputNames:["A"],inputTypes:[o.TextureType.unpacked]};u.padV2=(l,d,m)=>(i(d),[l.run(Object.assign(Object.assign({},c),{cacheHint:m.cacheKey,get:()=>s(l,d[0],m)}),d)]),u.parsePadAttributesV2=l=>{const d=l.attributes.getString("mode","constant"),m=l.attributes.getFloat("value",0),y=l.attributes.getInts("pads");return(0,g.createAttributeWithCacheKey)({mode:d,value:m,pads:y})},u.padV11=(l,d,m)=>{t(d);const y=f(l,d,m);return(0,u.padV2)(l,[d[0]],y)},u.parsePadAttributesV11=l=>l.attributes.getString("mode","constant");const f=(l,d,m)=>{if(!l.session.isInitializer(d[1].dataId)||d.length>=3&&!l.session.isInitializer(d[2].dataId))throw new Error("dynamic pad attributes are not allowed");const y=Array.from(d[1].integerData),_=d.length>=3?d[2].floatData[0]:0;return(0,g.createAttributeWithCacheKey)({mode:m,pads:y,value:_})},s=(l,d,m)=>{const y=p.ShapeUtil.padShape(d.dims.slice(),m.pads),_=y.length,v=` - ${e(l,d,m)} - float process(int[${_}] indices) { - return padA(indices); - }`;return{name:"Pad",inputNames:["A"],inputTypes:[o.TextureType.unpacked],output:{dims:y,type:d.type,textureType:o.TextureType.unpacked},shaderSource:v}},i=l=>{if(!l||l.length!==1)throw new Error("Pad requires 1 input");if(l[0].type!=="float32"&&l[0].type!=="float64")throw new Error("Invalid input type.")},t=l=>{if(!l||l.length!==2&&l.length!==3)throw new Error("Pad requires 2 or 3 inputs");if(l[1].type!=="int32")throw new Error("Invalid input type.");if(l.length>=3&&l[2].type==="string")throw new Error("Invalid input type.")},e=(l,d,m)=>{const y=(0,h.getGlsl)(l.session.backend.glContext.version),[_,v]=l.calculateTextureWidthAndHeight(d.dims,o.TextureType.unpacked),T=p.ShapeUtil.computeStrides(d.dims);switch(m.mode){case"constant":return n(y,d.dims,T,_,v,m.pads,m.value);case"reflect":return r(y,d.dims,T,_,v,m.pads);case"edge":return a(y,d.dims,T,_,v,m.pads);default:throw new Error("Invalid mode")}},n=(l,d,m,y,_,v,T)=>{const S=d.length;let O="";for(let w=S-1;w>=0;--w)O+=` - k = m[${w}] - ${v[w]}; - if (k < 0) return constant; - if (k >= ${d[w]}) return constant; - offset += k * ${m[w]}; - `;return` - float padA(int m[${S}]) { - const float constant = float(${T}); - int offset = 0; - int k = 0; - ${O} - vec2 coords = offsetToCoords(offset, ${y}, ${_}); - float value = getColorAsFloat(${l.texture2D}(A, coords)); - return value; - } - `},r=(l,d,m,y,_,v)=>{const T=d.length;let S="";for(let O=T-1;O>=0;--O)S+=` - k = m[${O}] - ${v[O]}; - if (k < 0) { k = -k; } - { - const int _2n_1 = ${2*(d[O]-1)}; - k = int( mod( float(k), float(_2n_1) ) ) ; - if(k >= ${d[O]}) { k = _2n_1 - k; } - } - offset += k * ${m[O]}; - `;return` - float padA(int m[${T}]) { - int offset = 0; - int k = 0; - ${S} - vec2 coords = offsetToCoords(offset, ${y}, ${_}); - float value = getColorAsFloat(${l.texture2D}(A, coords)); - return value; - } - `},a=(l,d,m,y,_,v)=>{const T=d.length;let S="";for(let O=T-1;O>=0;--O)S+=` - k = m[${O}] - ${v[O]}; - if (k < 0) k = 0; - if (k >= ${d[O]}) k = ${d[O]-1}; - offset += k * ${m[O]}; - `;return` - float padA(int m[${T}]) { - int offset = 0; - int k = 0; - ${S} - vec2 coords = offsetToCoords(offset, ${y}, ${_}); - float value = getColorAsFloat(${l.texture2D}(A, coords)); - return value; - } - `}},2143:(D,u,b)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.globalMaxPool=u.parseMaxPoolAttributes=u.maxPool=u.parseGlobalAveragePoolAttributes=u.globalAveragePool=u.parseAveragePoolAttributes=u.averagePool=void 0;const g=b(246),p=b(2517),h=b(2039);u.averagePool=(a,l,d)=>{t(l);const m={name:"AveragePool",inputNames:["X"],inputTypes:[h.TextureType.unpacked],cacheHint:d.cacheKey};return[a.run(Object.assign(Object.assign({},m),{get:()=>o(l,m,!1,d)}),l)]},u.parseAveragePoolAttributes=a=>{const l=a.attributes.getString("auto_pad","NOTSET"),d=a.attributes.getInt("ceil_mode",0),m=a.attributes.getInt("count_include_pad",0)!==0,y=a.attributes.getInts("kernel_shape"),_=a.attributes.getInts("strides",[]),v=a.attributes.getInts("pads",[]);if(d!==0)throw new Error("using ceil() in shape computation is not yet supported for AveragePool");return(0,g.createAttributeWithCacheKey)({autoPad:l,ceilMode:d,countIncludePad:m,kernelShape:y,strides:_,pads:v})};const o=(a,l,d,m)=>{const[y,_]=f(a,m,d),v=p.ShapeUtil.size(y.kernelShape);let T="";y.countIncludePad?T+=`value /= float(${v});`:T+=`value /= float(${v} - pad);`;const S=` - ${e(a[0].dims,y,"value += _X(x);",T,"0.0")} - `;return Object.assign(Object.assign({},l),{output:{dims:_,type:a[0].type,textureType:h.TextureType.unpacked},shaderSource:S})};u.globalAveragePool=(a,l,d)=>{t(l);const m={name:"GlobalAveragePool",inputNames:["X"],inputTypes:[h.TextureType.unpacked],cacheHint:`${d.countIncludePad}`};return[a.run(Object.assign(Object.assign({},m),{get:()=>o(l,m,!0,d)}),l)]},u.parseGlobalAveragePoolAttributes=a=>{const l=a.attributes.getInt("count_include_pad",0)!==0;return(0,g.createAttributeWithCacheKey)({autoPad:"",ceilMode:0,countIncludePad:l,kernelShape:[],strides:[],pads:[]})},u.maxPool=(a,l,d)=>{t(l);const m={name:"MaxPool",inputNames:["X"],inputTypes:[h.TextureType.unpacked],cacheHint:d.cacheKey};return[a.run(Object.assign(Object.assign({},m),{get:()=>c(l,m,!1,d)}),l)]},u.parseMaxPoolAttributes=a=>{const l=a.attributes.getString("auto_pad","NOTSET"),d=a.attributes.getInt("ceil_mode",0),m=a.attributes.getInts("kernel_shape"),y=a.attributes.getInts("strides",[]),_=a.attributes.getInts("pads",[]),v=a.attributes.getInt("storage_order",0),T=a.attributes.getInts("dilations",[]);if(v!==0)throw new Error("column major storage order is not yet supported for MaxPool");if(d!==0)throw new Error("using ceil() in shape computation is not yet supported for MaxPool");return(0,g.createAttributeWithCacheKey)({autoPad:l,ceilMode:d,countIncludePad:!1,kernelShape:m,strides:y,pads:_,storageOrder:v,dilations:T})};const c=(a,l,d,m)=>{const[y,_]=f(a,m,d),v=` - ${e(a[0].dims,y,` - value = max(_X(x), value); - `,"","-1e5")} - `;return Object.assign(Object.assign({},l),{output:{dims:_,type:a[0].type,textureType:h.TextureType.unpacked},shaderSource:v})},f=(a,l,d)=>{const m=a[0].dims.slice(),y=Object.hasOwnProperty.call(l,"dilations"),_=l.kernelShape.slice(),v=l.strides.slice(),T=y?l.dilations.slice():[],S=l.pads.slice();p.PoolConvUtil.adjustPoolAttributes(d,m,_,v,T,S);const O=p.PoolConvUtil.computePoolOutputShape(d,m,v,T,_,S,l.autoPad),w=Object.assign({},l);return y?Object.assign(w,{kernelShape:_,strides:v,pads:S,dilations:T,cacheKey:l.cacheKey}):Object.assign(w,{kernelShape:_,strides:v,pads:S,cacheKey:l.cacheKey}),[w,O]},s={autoPad:"",ceilMode:0,countIncludePad:!1,kernelShape:[],strides:[],pads:[],storageOrder:0,dilations:[],cacheKey:""},i={name:"GlobalMaxPool",inputNames:["X"],inputTypes:[h.TextureType.unpacked]};u.globalMaxPool=(a,l)=>(t(l),[a.run(Object.assign(Object.assign({},i),{get:()=>c(l,i,!0,s)}),l)]);const t=a=>{if(!a||a.length!==1)throw new Error("Pool ops requires 1 input.");if(a[0].type!=="float32"&&a[0].type!=="float64")throw new Error("Invalid input type.")},e=(a,l,d,m,y)=>{const _=a.length;if(l.kernelShape.length<=2){const v=l.kernelShape[l.kernelShape.length-1],T=l.strides[l.strides.length-1],S=l.pads[l.pads.length/2-1],O=l.pads[l.pads.length-1],w=a[_-1];let I="",R="",B="";if(I=S+O!==0?` - for (int i = 0; i < ${v}; i++) { - x[${_} - 1] = indices[${_} - 1] * ${T} - ${S} + i; - if (x[${_} - 1] < 0 || x[${_} - 1] >= ${w}) { - pad++; - continue; - } - ${d} - }`:` - for (int i = 0; i < ${v}; i++) { - x[${_} - 1] = indices[${_} - 1] * ${T} - ${S} + i; - ${d} - }`,l.kernelShape.length===2){const j=l.kernelShape[l.kernelShape.length-2],N=l.strides[l.strides.length-2],W=l.pads[l.pads.length/2-2],k=l.pads[l.pads.length-2],V=a[_-2];R=W+k!==0?` - for (int j = 0; j < ${j}; j++) { - x[${_} - 2] = indices[${_} - 2] * ${N} - ${W} + j; - if (x[${_} - 2] < 0 || x[${_} - 2] >= ${V}) { - pad+= ${v}; - continue; - } - `:` - for (int j = 0; j < ${j}; j++) { - x[${_} - 2] = indices[${_} - 2] * ${N} - ${W} + j; - `,B=` - } - `}return` - float process(int indices[${_}]) { - int x[${_}]; - copyVec(indices, x); - - float value = ${y}; - int pad = 0; - ${R} - ${I} - ${B} - ${m} - return value; - } - `}{const v=p.ShapeUtil.size(l.kernelShape),T=p.ShapeUtil.computeStrides(l.kernelShape),S=T.length,O=l.pads.length,w=r(S),I=n(a,"inputDims"),R=n(l.pads,"pads"),B=n(T,"kernelStrides"),j=n(l.strides,"strides");let N="";return N=l.pads.reduce((W,k)=>W+k)?` - if (x[j] >= inputDims[j] || x[j] < 0) { - pad++; - isPad = true; - break; - } - } - if (!isPad) { - ${d} - }`:` - } - ${d} - `,` - ${w} - float process(int indices[${_}]) { - int x[${_}]; - copyVec(indices, x); - int offset[${S}]; - int pads[${O}]; - int inputDims[${_}]; - int kernelStrides[${S}]; - int strides[${S}]; - ${R} - ${I} - ${j} - ${B} - - float value = ${y}; - int pad = 0; - bool isPad = false; - for (int i = 0; i < ${v}; i++) { - offsetToIndices(i, kernelStrides, offset); - isPad = false; - for (int j = ${_} - ${S}; j < ${_}; j++) { - x[j] = indices[j] * strides[j - ${_} + ${S}] - + offset[j - ${_} + ${S}] - pads[j - 2]; - ${N} - } - ${m} - - return value; - } - `}},n=(a,l)=>{let d="";for(let m=0;m` - void offsetToIndices(int offset, int[${a}] strides, out int[${a}] indices) { - if (${a} == 0) { - return; - } - for (int i = 0; i < ${a} - 1; ++i) { - indices[i] = offset / strides[i]; - offset -= indices[i] * strides[i]; - } - indices[${a} - 1] = offset; - }`},4939:(D,u,b)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.reduceLogSumSquare=u.reduceLogSum=u.reduceProd=u.reduceMin=u.reduceMax=u.reduceMean=u.reduceSum=u.parseReduceAttributes=void 0;const g=b(246),p=b(782),h=b(2517),o=b(2039),c=(i,t,e,n,r)=>{s(t);const a={name:n,inputNames:["A"],inputTypes:[o.TextureType.unpacked]};return[i.run(Object.assign(Object.assign({},a),{cacheHint:e.cacheKey,get:()=>f(i,t,e,n,r,a)}),t)]};u.parseReduceAttributes=i=>{const t=i.attributes.getInts("axes",[]),e=i.attributes.getInt("keepdims",1)===1;return(0,g.createAttributeWithCacheKey)({axes:t,keepDims:e})};const f=(i,t,e,n,r,a)=>{const l=[],d=t[0].dims.length||1,m=[],y=h.ShapeUtil.normalizeAxes(e.axes,t[0].dims.length),_=r(t,y);let v=_[1];for(let S=0;S=0||y.length===0?(e.keepDims&&l.push(1),v=` - for(int j${S} = 0; j${S} < ${t[0].dims[S]}; j${S}++) { - inputIdx[${S}] = j${S}; - ${v} - }`):(m.push(`inputIdx[${S}] = outputIdx[${l.length}];`),l.push(t[0].dims[S]));const T=` - float process(int outputIdx[${l.length||1}]) { - float value; // final result - int inputIdx[${d}]; // addressing input data - ${m.join(` -`)} - ${_[0]} // init ops for reduce max/min - ${v} - ${_[2]} // final computation for reduce mean - return value; - }`;return Object.assign(Object.assign({},a),{output:{dims:l,type:t[0].type,textureType:o.TextureType.unpacked},shaderSource:T})},s=i=>{if(!i||i.length!==1)throw new Error("Reduce op requires 1 input.");if(p.NUMBER_TYPES.indexOf(i[0].type)===-1)throw new Error("Invalid input type.")};u.reduceSum=(i,t,e)=>c(i,t,e,"ReduceSum",()=>["value = 0.0;","value += _A(inputIdx);",""]),u.reduceMean=(i,t,e)=>c(i,t,e,"ReduceMean",(n,r)=>{let a=1;for(let l=0;l=0||r.length===0)&&(a*=n[0].dims[l]);return["value = 0.0;","value += _A(inputIdx);",`value /= ${a}.;`]}),u.reduceMax=(i,t,e)=>c(i,t,e,"ReduceMax",(n,r)=>{const a=[];for(let l=0;l=0||r.length===0)&&a.push(`inputIdx[${l}] = 0;`);return[`${a.join(` -`)} -value = _A(inputIdx);`,"value = max(value, _A(inputIdx));",""]}),u.reduceMin=(i,t,e)=>c(i,t,e,"ReduceMin",(n,r)=>{const a=[];for(let l=0;l=0||r.length===0)&&a.push(`inputIdx[${l}] = 0;`);return[`${a.join(` -`)} -value = _A(inputIdx);`,"value = min(value, _A(inputIdx));",""]}),u.reduceProd=(i,t,e)=>c(i,t,e,"ReduceProd",()=>["value = 1.0;","value *= _A(inputIdx);",""]),u.reduceLogSum=(i,t,e)=>c(i,t,e,"ReduceLogSum",()=>["value = 0.0;","value += _A(inputIdx);","value = log(value);"]),u.reduceLogSumSquare=(i,t,e)=>c(i,t,e,"ReduceLogSumSquare",()=>["float t; value = 0.0;","t = _A(inputIdx); value += t * t;",""])},7019:(D,u,b)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.isReshapeCheap=u.processDims3D=u.createPackedReshape3DProgramInfoLoader=void 0;const g=b(2517),p=b(5060),h=b(2039),o=b(2827);u.createPackedReshape3DProgramInfoLoader=(c,f,s)=>{const i=(t=>({name:"Reshape (packed)",inputTypes:[h.TextureType.packed],inputNames:["A"],cacheHint:`${t}`}))(s);return Object.assign(Object.assign({},i),{get:()=>((t,e,n,r)=>{const a=e.dims,l=r;let d="";for(let _=0;_<4;_++){let v="";switch(_){case 0:v="outputCoords = rc;";break;case 1:v="outputCoords = ivec3(rc.x, rc.y+1, rc.z);";break;case 2:v="outputCoords = ivec3(rc.x, rc.y, rc.z+1);";break;case 3:v="outputCoords = ivec3(rc.x, rc.y+1, rc.z+1);";break;default:throw new Error}d+=` - ${v} - ${_>0?"if(outputCoords.y < rows && outputCoords.z < cols){":""} - int flattenedIndex = getFlattenedIndex(outputCoords); - - ivec3 inputRC = inputCoordsFromReshapedOutCoords(flattenedIndex); - vec2 innerDims = vec2(float(inputRC.y),float(inputRC.z)); - - result[${_}] = getChannel(getA(inputRC.x, inputRC.y, inputRC.z), innerDims); - - ${_>0?"}":""} - `}const m=(0,p.getGlsl)(t.session.backend.glContext.version),y=` - ${function(_){const v=g.ShapeUtil.computeStrides(_),T=["b","r","c"],S="index";return` - ivec3 inputCoordsFromReshapedOutCoords(int index) { - ${v.map((O,w)=>`int ${T[w]} = ${S} / ${O}; ${w===v.length-1?`int ${T[w+1]} = ${S} - ${T[w]} * ${O}`:`index -= ${T[w]} * ${O}`};`).join("")} - return ivec3(b, r, c); - } - `}(a)} - ${function(_){const v=g.ShapeUtil.computeStrides(_);return` - int getFlattenedIndex(ivec3 coords) { - // reverse y, z order - return coords.x * ${v[0]} + coords.z * ${v[1]} + coords.y; - } -`}(l)} - ${(0,o.unpackFromChannel)()} - - void main() { - ivec3 rc = getOutputCoords(); - - vec4 result = vec4(0.0); - - ivec3 outputCoords; - int rows = ${l[2]}; - int cols = ${l[1]}; - - ${d} - ${m.output} = result; - } - `;return Object.assign(Object.assign({},n),{output:{dims:l,type:e.type,textureType:h.TextureType.packed},shaderSource:y,hasMain:!0})})(c,f,i,s)})},u.processDims3D=function(c){if(c.length===0)return[1,1,1];let f=1;for(let s=0;s1?c[c.length-2]:1,c[c.length-1]]},u.isReshapeCheap=function(c,f){let s=!1;return s=c.length===0||f.length===0||(c.length<2||f.length<2?c[c.length-1]===f[f.length-1]:c[c.length-1]===f[f.length-1]&&c[c.length-2]===f[f.length-2]),s}},718:(D,u,b)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.reshape=void 0;const g=b(2517);u.reshape=(p,h)=>{const o=g.ShapeUtil.calculateReshapedDims(h[0].dims,h[1].integerData);return p.session.pack?[p.reshapePacked(h[0],o)]:[p.reshapeUnpacked(h[0],o)]}},2268:(D,u,b)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.parseResizeAttributesV11=u.parseResizeAttributesV10=u.resize=void 0;const g=b(5060),p=b(2039),h=b(9390),o=b(2827),c=b(9793),f={name:"Resize",inputNames:["A"],inputTypes:[p.TextureType.packed]};u.resize=(n,r,a)=>((0,c.validateInputs)(r,a),[n.run(Object.assign(Object.assign({},f),{cacheHint:a.cacheKey,get:()=>s(n,r,a)}),r)]),u.parseResizeAttributesV10=n=>(0,c.parseUpsampleAttributes)(n,10),u.parseResizeAttributesV11=n=>(0,c.parseUpsampleAttributes)(n,11);const s=(n,r,a)=>{const l=(0,g.getGlsl)(n.session.backend.glContext.version),[d,m]=i(r,a);if(d.every(N=>N===1)&&a.coordinateTransformMode!=="tf_crop_and_resize")return Object.assign(Object.assign({},f),{output:{dims:m,type:r[0].type,textureType:p.TextureType.packed},hasMain:!0,shaderSource:`void main() { - vec4 v = ${l.texture2D}(X, TexCoords); - ${l.output} = v; - }`});const y=m.length;if(y<2)throw new Error(`output dimension should be at least 2, but got ${y}`);const _=m[y-2],v=m[y-1],T=r[0].dims;if(y!==T.length)throw new Error(`output dimension should match input ${T.length}, but got ${y}`);const S=T[y-2],O=T[y-1],w=d[y-2],I=d[y-1];let R="";if(a.mode!=="linear")throw new Error(`resize (packed) does not support mode: '${a.mode}'`);switch(a.coordinateTransformMode){case"asymmetric":R=` - vec4 getSourceFracIndex(ivec4 coords) { - return vec4(coords) / scaleWHWH; - } - `;break;case"half_pixel":R=` - vec4 getSourceFracIndex(ivec4 coords) { - return (vec4(coords) + 0.5) / scaleWHWH - 0.5; - } - `;break;case"pytorch_half_pixel":R=` - vec4 getSourceFracIndex(ivec4 coords) { - vec4 fcoords = vec4(coords); - return vec4( - ${v}.0 > 1.0 ? (fcoords.x + 0.5) / scaleWHWH.x - 0.5 : 0.0, - ${_}.0 > 1.0 ? (fcoords.y + 0.5) / scaleWHWH.y - 0.5 : 0.0, - ${v}.0 > 1.0 ? (fcoords.z + 0.5) / scaleWHWH.z - 0.5 : 0.0, - ${_}.0 > 1.0 ? (fcoords.w + 0.5) / scaleWHWH.w - 0.5 : 0.0 - ); - } - `;break;case"align_corners":R=` - vec4 getSourceFracIndex(ivec4 coords) { - vec4 resized = vec4(${v}.0 - 1.0, ${_}.0 - 1.0, ${v}.0 - 1.0, - ${_}.0 - 1.0); - vec4 original = vec4(${O}.0 - 1.0, ${S}.0 - 1.0, ${O}.0 - 1.0, - ${S}.0 - 1.0); - vec4 new_scale = original / resized; - return vec4(coords) * new_scale; - } - `;break;default:throw new Error(`resize (packed) does not support coordinateTransformMode: '${a.coordinateTransformMode}'`)}const B=(0,h.getCoordsDataType)(y),j=` - const vec2 inputWH = vec2(${S}.0, ${O}.0); - const vec4 scaleWHWH = vec4(float(${w}), float(${I}), float(${w}), float(${I})); - ${(0,o.unpackFromChannel)()} - ${R} - float getAValue(int x10, int r, int c, int d) { - return getChannel(getA(x10, r, c, d), vec2(c, d)); - } - void main() { - ${B} rc = getOutputCoords(); - - int batch = rc[0]; - int depth = rc[1]; - - // retrieve the 4 coordinates that is used in the 4 packed output values. - ivec4 coords = ivec4(rc.wz, rc.w + 1, rc.z + 1); - - // calculate the source index in fraction - vec4 sourceFrac = getSourceFracIndex(coords); - - // get the lower and upper bound of the 4 values that will be packed into one texel. - ivec4 x00 = ivec4(max(sourceFrac.xy, vec2(0.0)), min(inputWH - 1.0, ceil(sourceFrac.xy))); - ivec4 x01 = ivec4(max(sourceFrac.xw, vec2(0.0)), min(inputWH - 1.0, ceil(sourceFrac.xw))); - ivec4 x10 = ivec4(max(sourceFrac.zy, vec2(0.0)), min(inputWH - 1.0, ceil(sourceFrac.zy))); - ivec4 x11 = ivec4(max(sourceFrac.zw, vec2(0.0)), min(inputWH - 1.0, ceil(sourceFrac.zw))); - - bool hasNextRow = rc.w < ${_-1}; - bool hasNextCol = rc.z < ${v-1}; - - // pack x00, x01, x10, x11's top-left corner into one vec4 structure - vec4 topLeft = vec4( - getAValue(batch, depth, x00.x, x00.y), - hasNextCol ? getAValue(batch, depth, x01.x, x01.y) : 0.0, - hasNextRow ? getAValue(batch, depth, x10.x, x10.y) : 0.0, - (hasNextRow && hasNextCol) ? getAValue(batch, depth, x11.x, x11.y) : 0.0); - - // pack x00, x01, x10, x11's top-right corner into one vec4 structure - vec4 topRight = vec4( - getAValue(batch, depth, x00.x, x00.w), - hasNextCol ? getAValue(batch, depth, x01.x, x01.w) : 0.0, - hasNextRow ? getAValue(batch, depth, x10.x, x10.w) : 0.0, - (hasNextRow && hasNextCol) ? getAValue(batch, depth, x11.x, x11.w) : 0.0); - - // pack x00, x01, x10, x11's bottom-left corner into one vec4 structure - vec4 bottomLeft = vec4( - getAValue(batch, depth, x00.z, x00.y), - hasNextCol ? getAValue(batch, depth, x01.z, x01.y) : 0.0, - hasNextRow ? getAValue(batch, depth, x10.z, x10.y) : 0.0, - (hasNextRow && hasNextCol) ? getAValue(batch, depth, x11.z, x11.y) : 0.0); - - // pack x00, x01, x10, x11's bottom-right corner into one vec4 structure - vec4 bottomRight = vec4( - getAValue(batch, depth, x00.z, x00.w), - hasNextCol ? getAValue(batch, depth, x01.z, x01.w) : 0.0, - hasNextRow ? getAValue(batch, depth, x10.z, x10.w) : 0.0, - (hasNextRow && hasNextCol) ? getAValue(batch, depth, x11.z, x11.w) : 0.0); - - // calculate the interpolation fraction on u and v direction - vec4 frac = vec4(sourceFrac) - floor(sourceFrac); - vec4 clampFrac = clamp(frac, vec4(0.0), vec4(1.0)); - - vec4 top = mix(topLeft, topRight, clampFrac.ywyw); - vec4 bottom = mix(bottomLeft, bottomRight, clampFrac.ywyw); - vec4 newValue = mix(top, bottom, clampFrac.xxzz); - - ${l.output} = vec4(newValue); - } - `;return Object.assign(Object.assign({},f),{output:{dims:m,type:r[0].type,textureType:p.TextureType.packed},hasMain:!0,shaderSource:j})},i=(n,r)=>{const a=n[0].dims;let l,d=r.scales;if(d.length===0){const y=n[r.scalesInputIdx];if(y&&y.size!==0){if(n[r.sizesInputIdx])throw new Error("Only one of scales or sizes must be provided as input.");d=t(y,r.mode,r.isResize)}else{const _=n[r.sizesInputIdx];if(!_||_.size===0)throw new Error("Either scales or sizes MUST be provided as input.");l=Array.from(_.integerData),d=e(l,a,r.mode,r.isResize)}}else if(n[r.sizesInputIdx])throw new Error("Only one of scales or sizes must be provided as input.");const m=l||a.map((y,_)=>Math.floor(y*d[_]));return[d,m]},t=(n,r,a)=>{const l=Array.from(n.floatData);return(0,c.scalesValidation)(l,r,a),l},e=(n,r,a,l)=>{const d=r.length,m=new Array(d);for(let y=0,_=d;y<_;y++)if(r[y]===0){if(n[y]!==0)throw new Error("Input dim is zero but required output dim is non-zero.");m[y]=1}else m[y]=n[y]/r[y];return(0,c.scalesValidation)(m,a,l),m}},8117:(D,u,b)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.shape=void 0;const g=b(9162);u.shape=(h,o)=>(p(o),[new g.Tensor([o[0].dims.length],"int32",void 0,void 0,new Int32Array(o[0].dims))]);const p=h=>{if(!h||h.length!==1)throw new Error("Shape requires 1 input.")}},2278:(D,u,b)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.sliceV10=u.parseSliceAttributes=u.slice=void 0;const g=b(246),p=b(782),h=b(2517),o=b(2039),c={name:"Slice",inputNames:["A"],inputTypes:[o.TextureType.unpacked]};u.slice=(e,n,r)=>(s(n),[e.run(Object.assign(Object.assign({},c),{cacheHint:r.cacheKey,get:()=>f(e,n[0],r)}),n)]),u.parseSliceAttributes=e=>{const n=e.attributes.getInts("starts"),r=e.attributes.getInts("ends"),a=e.attributes.getInts("axes",[]);return(0,g.createAttributeWithCacheKey)({starts:n,ends:r,axes:a})};const f=(e,n,r)=>{const a=r.axes.length===0?n.dims.slice(0).map((T,S)=>S):r.axes,l=h.ShapeUtil.normalizeAxes(a,n.dims.length),d=r.starts.map((T,S)=>T>n.dims[l[S]]-1?n.dims[l[S]]:h.ShapeUtil.normalizeAxis(T,n.dims[l[S]])),m=r.ends.map((T,S)=>T>n.dims[l[S]]-1?n.dims[l[S]]:h.ShapeUtil.normalizeAxis(T,n.dims[l[S]])),y=n.dims.slice(),_=[];for(let T=0;T0&&_.push(`outputIdx[${l[T]}] += ${d[T]};`);const v=` - float process(int outputIdx[${y.length}]) { - ${_.join(` - `)} - return _A(outputIdx); - }`;return Object.assign(Object.assign({},c),{output:{dims:y,type:n.type,textureType:o.TextureType.unpacked},shaderSource:v})},s=e=>{if(!e||e.length!==1)throw new Error("Slice requires 1 input.");if(p.NUMBER_TYPES.indexOf(e[0].type)===-1)throw new Error("Invalid input type.")};u.sliceV10=(e,n)=>{t(n);const r=i(e,n);return[e.run(Object.assign(Object.assign({},c),{cacheHint:r.cacheKey,get:()=>f(e,n[0],r)}),[n[0]])]};const i=(e,n)=>{if(!e.session.isInitializer(n[1].dataId)||!e.session.isInitializer(n[2].dataId)||n.length>=4&&!e.session.isInitializer(n[3].dataId)||n.length>=5&&!e.session.isInitializer(n[4].dataId))throw new Error("dynamic slice attributes are not allowed");if(n.length>=5&&n[4].integerData.some(d=>d!==1))throw new Error("currently non-1 steps is not supported for Slice");const r=Array.from(n[1].integerData),a=Array.from(n[2].integerData),l=n.length>=4?Array.from(n[3].integerData):[];return{starts:r,ends:a,axes:l,cacheKey:`${l};${r};${a}`}},t=e=>{if(!e||e.length<3||e.length>5)throw new Error("Invalid input number.");if(e[1].type!=="int32"||e[1].dims.length!==1)throw new Error("Invalid input type.");if(e[2].type!=="int32"||e[2].dims.length!==1)throw new Error("Invalid input type.");if(e.length>=4&&(e[3].type!=="int32"||e[3].dims.length!==1))throw new Error("Invalid input type.");if(e.length>=5&&(e[4].type!=="int32"||e[4].dims.length!==1))throw new Error("Invalid input type.")}},5524:(D,u,b)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.softmaxV13=u.parseSoftmaxAttributesV13=u.parseSoftmaxAttributes=u.softmax=void 0;const g=b(246),p=b(2517),h=b(5060),o=b(2039),c=b(3738),f={name:"SoftmaxComputeMax",inputNames:["A"],inputTypes:[o.TextureType.unpacked]},s={name:"SoftmaxComputeScale",inputNames:["A","Max"],inputTypes:[o.TextureType.unpacked,o.TextureType.unpacked]},i={name:"SoftMax",inputNames:["A","Max","Norm"],inputTypes:[o.TextureType.unpacked,o.TextureType.unpacked,o.TextureType.unpacked]};u.softmax=(l,d,m)=>{a(d);const y=d[0].dims.slice(),_=p.ShapeUtil.normalizeAxis(m.axis,y.length),v=p.ShapeUtil.sizeToDimension(y,_),T=p.ShapeUtil.sizeFromDimension(y,_);return t(l,d,m,v,T)},u.parseSoftmaxAttributes=l=>(0,g.createAttributeWithCacheKey)({axis:l.attributes.getInt("axis",1)}),u.parseSoftmaxAttributesV13=l=>(0,g.createAttributeWithCacheKey)({axis:l.attributes.getInt("axis",-1)}),u.softmaxV13=(l,d,m)=>{a(d);const y=d[0].dims.slice(),_=p.ShapeUtil.normalizeAxis(m.axis,y.length),v=y.length,T=_!==v-1,S=[];let O,w=[],I=[];T&&(w=Array.from({length:v}).map((N,W)=>W),w[_]=v-1,w[v-1]=_,w.map(N=>S.push(y[N])),O=(0,g.createAttributeWithCacheKey)({perm:w}),I=(0,c.transpose)(l,d,O));const R=T?p.ShapeUtil.sizeToDimension(S,v-1):p.ShapeUtil.sizeToDimension(y,v-1),B=T?p.ShapeUtil.sizeFromDimension(S,v-1):p.ShapeUtil.sizeFromDimension(y,v-1),j=t(l,T?I:d,m,R,B);return T?(0,c.transpose)(l,j,O):j};const t=(l,d,m,y,_)=>{const v=e(l,d[0],y,_,[y]),T=l.run(Object.assign(Object.assign({},f),{cacheHint:m.cacheKey,get:()=>v}),d),S=n(l,d[0],y,_,v.output.dims,[y]),O=l.run(Object.assign(Object.assign({},s),{cacheHint:m.cacheKey,get:()=>S}),[d[0],T]),w=r(l,d[0],y,_,v.output.dims,S.output.dims);return[l.run(Object.assign(Object.assign({},i),{cacheHint:m.cacheKey,get:()=>w}),[d[0],T,O])]},e=(l,d,m,y,_)=>{const[v,T]=l.calculateTextureWidthAndHeight(d.dims,o.TextureType.unpacked),S=_.length;if(m<1||y<1)throw new Error("Logical row count N and feature count D must be greater than or equal to 1");if(_.length!==1)throw new Error("Dimensionality of the output should be 1");if(_[0]!==m)throw new Error("Shape of the output should be equal to logical row count");const O=(0,h.getGlsl)(l.session.backend.glContext.version),w=` - float process(int[${S}] indices) { - int logical_row_start_offset = indices[0] * ${y}; - - float max = getColorAsFloat(${O.texture2D}(A, offsetToCoords(logical_row_start_offset, ${v}, - ${T} ))); - for(int i=1; i<${y}; ++i) - { - float current = getColorAsFloat(${O.texture2D}(A, offsetToCoords(logical_row_start_offset + i, - ${v}, ${T}))); - if(current > max) - max = current; - } - - return max; - }`;return Object.assign(Object.assign({},f),{output:{dims:_,type:d.type,textureType:o.TextureType.unpacked},shaderSource:w})},n=(l,d,m,y,_,v)=>{const[T,S]=l.calculateTextureWidthAndHeight(d.dims,o.TextureType.unpacked),O=v.length;if(m<1||y<1)throw new Error("Logical row count N and feature count D must be greater than or equal to 1");if(v.length!==1)throw new Error("Dimensionality of the output should be 1");if(v[0]!==m)throw new Error("Shape of the output should be equal to logical row count");if(_.length!==1)throw new Error("Dimensionality of the intermediate results should be 1");if(_[0]!==m)throw new Error("Shape of the intermediate results should be equal to logical row count");const w=` - float process(int[${O}] indices) { - int logical_row_start_offset = indices[0] * ${y}; - - float norm_factor = 0.0; - float max = _Max(indices); - for(int i=0; i<${y}; ++i) - { - norm_factor += exp(getColorAsFloat(${(0,h.getGlsl)(l.session.backend.glContext.version).texture2D}(A, offsetToCoords(logical_row_start_offset + i, - ${T}, ${S}))) - max); - } - - return norm_factor; - }`;return Object.assign(Object.assign({},s),{output:{dims:v,type:d.type,textureType:o.TextureType.unpacked},shaderSource:w})},r=(l,d,m,y,_,v)=>{const[T,S]=l.calculateTextureWidthAndHeight(d.dims,o.TextureType.unpacked),O=d.dims.length;if(m<1||y<1)throw new Error("Logical row count N and feature count D must be greater than or equal to 1");if(_.length!==1||v.length!==1)throw new Error("Dimensionality of the intermediate results should be 1");if(_[0]!==m||v[0]!==m)throw new Error("Shape of the intermediate results should be equal to logical row count");const w=` - float process(int[${O}] indices) { - - // get offset of current logical tensor index from the 2-D texture coordinates (TexCoords) - int offset = coordsToOffset(TexCoords, ${T}, ${S}); - - //determine the logical row for this index - int logical_row_index[1]; - logical_row_index[0] = offset / ${y}; - - float norm_factor = _Norm(logical_row_index); - - // avoid possible division by 0 - // if norm_facor is 0, all elements are zero - // if so, return 0 - if(norm_factor == 0.0) - return 0.0; - - return exp(_A(indices) - _Max(logical_row_index)) / norm_factor; - }`;return Object.assign(Object.assign({},i),{output:{dims:d.dims,type:d.type,textureType:o.TextureType.unpacked},shaderSource:w})},a=l=>{if(!l||l.length!==1)throw new Error("Softmax requires 1 input.");if(l[0].type!=="float32"&&l[0].type!=="float64")throw new Error("Invalid input type")}},5975:(D,u,b)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.parseSplitAttributes=u.split=void 0;const g=b(246),p=b(2517),h=b(2039),o={name:"Split",inputNames:["A"],inputTypes:[h.TextureType.unpacked]};u.split=(i,t,e)=>{s(t);const n=p.ShapeUtil.normalizeAxis(e.axis,t[0].dims.length),r=c(i,t,n,e),a=[];for(let l=0;lf(i,t[0],e,n,l)}),t));return a},u.parseSplitAttributes=i=>{const t=i.attributes.getInt("axis",0),e=i.attributes.getInts("split",[]),n=i.outputs.length;return(0,g.createAttributeWithCacheKey)({axis:t,split:e,numOutputs:n})};const c=(i,t,e,n)=>{const[,r]=p.SplitUtil.splitShape(t[0].dims,e,n.split,n.numOutputs);return r.length},f=(i,t,e,n,r)=>{const[a,l]=p.SplitUtil.splitShape(t.dims,n,e.split,e.numOutputs),d=l[r],m=a[r],y=` - float process(int indices[${m.length}]) { - indices[${n}] += ${d}; - return _A(indices); - } - `;return Object.assign(Object.assign({},o),{cacheHint:`${e.cacheKey}:${r}`,output:{dims:m,type:t.type,textureType:h.TextureType.unpacked},shaderSource:y})},s=i=>{if(!i||i.length!==1)throw new Error("Split requires one input.");if(i[0].type!=="int8"&&i[0].type!=="uint8"&&i[0].type!=="int16"&&i[0].type!=="uint16"&&i[0].type!=="int32"&&i[0].type!=="uint32"&&i[0].type!=="float32"&&i[0].type!=="float64"&&i[0].type!=="bool")throw new Error("Invalid input type.")}},3933:(D,u,b)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.parseSqueezeAttributes=u.squeezeV13=u.squeeze=void 0;const g=b(2517);u.squeeze=(o,c,f)=>{p(c);const s=g.ShapeUtil.squeezeShape(c[0].dims,f);return[o.reshapeUnpacked(c[0],s)]},u.squeezeV13=(o,c)=>(h(c),(0,u.squeeze)(o,[c[0]],Array.from(c[1].integerData))),u.parseSqueezeAttributes=o=>o.attributes.getInts("axes");const p=o=>{if(!o||o.length!==1)throw new Error("Squeeze requires 1 input.");if(o[0].type==="string")throw new Error("invalid input tensor types.")},h=o=>{if(!o||o.length!==2)throw new Error("Squeeze requires 2 inputs.");if(o[1].type!=="int32")throw new Error("Invalid input type.")}},6558:(D,u,b)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.sum=void 0;const g=b(5060),p=b(2039);u.sum=(c,f)=>{o(f);const s={name:"Sum",inputNames:f.map((i,t)=>`X${t}`),inputTypes:new Array(f.length).fill(p.TextureType.unpacked)};return[c.run(Object.assign(Object.assign({},s),{get:()=>h(c,f,s)}),f)]};const h=(c,f,s)=>{const i=(0,g.getGlsl)(c.session.backend.glContext.version),t=f[0].dims.slice(),e=` - void main() { - vec4 result = ${f.map((n,r)=>`${i.texture2D}(X${r},TexCoords)`).join(" + ")}; - ${i.output} = result; - } - `;return Object.assign(Object.assign({},s),{output:{dims:t,type:f[0].type,textureType:p.TextureType.unpacked},hasMain:!0,shaderSource:e})},o=c=>{if(!c||c.length===0)throw new Error("Sum requires inputs.");const f=c[0].dims.length;for(let s=1;s{Object.defineProperty(u,"__esModule",{value:!0}),u.tile=void 0;const g=b(782),p=b(2039);u.tile=(c,f)=>{o(f);const s={name:"Tile",inputNames:["A"],inputTypes:[p.TextureType.unpacked]};return[c.run(Object.assign(Object.assign({},s),{get:()=>h(c,f,s)}),f)]};const h=(c,f,s)=>{const i=f[0].dims.slice(),t=new Array(i.length),e=[];for(let a=0;a{if(!c||c.length!==2)throw new Error("Tile requires 2 input.");if(c[1].dims.length!==1)throw new Error("The second input shape must 1 dimension.");if(c[1].dims[0]!==c[0].dims.length)throw new Error("Invalid input shape.");if(g.NUMBER_TYPES.indexOf(c[0].type)===-1)throw new Error("Invalid input type.");if(c[1].type!=="int32"&&c[1].type!=="int16")throw new Error("Invalid repeat type.")}},3738:(D,u,b)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.parseTransposeAttributes=u.transpose=void 0;const g=b(246),p=b(2517),h=b(2039),o={name:"Transpose",inputNames:["A"],inputTypes:[h.TextureType.unpacked]};u.transpose=(e,n,r)=>(t(n),[e.run(Object.assign(Object.assign({},o),{cacheHint:r.cacheKey,get:()=>c(e,n[0],r.perm)}),n)]),u.parseTransposeAttributes=e=>(0,g.createAttributeWithCacheKey)({perm:e.attributes.getInts("perm",[])});const c=(e,n,r)=>{const a=n.dims;r=f(a,r);const l=s(a,r),d=a.length,m=` - ${i("perm",r,d)} - float process(int indices[${d}]) { - int a[${d}]; - perm(a, indices); - return _A(a); - }`;return Object.assign(Object.assign({},o),{output:{dims:l,type:n.type,textureType:h.TextureType.unpacked},shaderSource:m})},f=(e,n)=>(n&&n.length!==e.length&&(n=[...e.keys()].reverse()),n),s=(e,n)=>(n=f(e,n),p.ShapeUtil.sortBasedOnPerm(e,n)),i=(e,n,r)=>{const a=[];a.push(`void ${e}(out int a[${r}], int src[${r}]) {`);for(let l=0;l{if(!e||e.length!==1)throw new Error("Transpose requires 1 input.");if(e[0].type!=="float32"&&e[0].type!=="float64")throw new Error("input should be float tensor")}},8710:(D,u,b)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.encodeAsUint8=void 0;const g=b(5060),p=b(2039);u.encodeAsUint8=(h,o)=>{const c=o.shape,f=(0,g.getGlsl)(h.session.backend.glContext.version),s=` - const float FLOAT_MAX = 1.70141184e38; - const float FLOAT_MIN = 1.17549435e-38; - - bool isNaN(float val) { - return (val < 1.0 || 0.0 < val || val == 0.0) ? false : true; - } - - highp vec4 encodeAsUint8(highp float v) { - if (isNaN(v)) { - return vec4(255, 255, 255, 255); - } - - highp float av = abs(v); - - if(av < FLOAT_MIN) { - return vec4(0.0, 0.0, 0.0, 0.0); - } else if(v > FLOAT_MAX) { - return vec4(0.0, 0.0, 128.0, 127.0) / 255.0; - } else if(v < -FLOAT_MAX) { - return vec4(0.0, 0.0, 128.0, 255.0) / 255.0; - } - - highp vec4 c = vec4(0,0,0,0); - - highp float e = floor(log2(av)); - highp float m = exp2(fract(log2(av))) - 1.0; - - c[2] = floor(128.0 * m); - m -= c[2] / 128.0; - c[1] = floor(32768.0 * m); - m -= c[1] / 32768.0; - c[0] = floor(8388608.0 * m); - - highp float ebias = e + 127.0; - c[3] = floor(ebias / 2.0); - ebias -= c[3] * 2.0; - c[2] += floor(ebias) * 128.0; - - c[3] += 128.0 * step(0.0, -v); - - return c / 255.0; - } - - void main() { - float value = ${f.texture2D}(X,TexCoords).r; - ${f.output} = encodeAsUint8(value); - }`,i={name:"Uint8Encode",inputTypes:[p.TextureType.unpacked],inputNames:["X"],output:{dims:c,type:o.tensor.type,textureType:p.TextureType.downloadUint8AsFloat},shaderSource:s,hasMain:!0};return h.executeProgram(i,[o.tensor])}},4909:(D,u,b)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.tanh=u.tan=u.sqrt=u.sin=u.sigmoid=u.relu=u.not=u.neg=u.log=u.parseLeakyReluAttributes=u.leakyRelu=u.identity=u.floor=u.exp=u.parseEluAttributes=u.elu=u.cos=u.ceil=u.clipV11=u.parseClipAttributes=u.clip=u.atan=u.asin=u.acos=u.abs=u.glslTanh=u.glslTan=u.glslSqrt=u.glslSigmoid=u.glslRelu=u.glslSin=u.glslNot=u.glslNeg=u.glslLog=u.glslLeakyRelu=u.glslIdentity=u.glslClip=u.glslFloor=u.glslExp=u.glslElu=u.glslCos=u.glslCeil=u.glslAtan=u.glslAsin=u.glslAcos=u.glslAbs=void 0;const g=b(246),p=b(2517),h=b(8520),o=b(5060),c=b(2039);function f(){return j("abs")}function s(){return j("acos")}function i(){return j("asin")}function t(){return j("atan")}function e(){return j("ceil")}function n(){return j("cos")}function r(k){const V="elu";return{body:` - const float alpha = float(${k}); - - float ${V}_(float a) { - return a >= 0.0 ? a: (exp(a) - 1.0) * alpha; - } - vec4 ${V}_(vec4 v) { - return vec4(${V}_(v.x), ${V}_(v.y), ${V}_(v.z), ${V}_(v.w)); - } - `,name:V,type:h.FunctionType.ValueBased}}function a(){return j("exp")}function l(){return j("floor")}function d(k,V){const J="clip";return{body:` - const float min = float(${k}); - const float max = float(${V}); - - float ${J}_(float a) { - return clamp(a, min, max); - } - vec4 ${J}_(vec4 v) { - return clamp(v, min, max); - } - `,name:J,type:h.FunctionType.ValueBased}}function m(){const k="indentity";return{body:` - float ${k}_(float a) { - return a; - } - vec4 ${k}_(vec4 v) { - return v; - } - `,name:k,type:h.FunctionType.ValueBased}}function y(k){const V="leakyRelu";return{body:` - const float alpha = float(${k}); - - float ${V}_(float a) { - return a < 0.0 ? a * alpha : a; - } - vec4 ${V}_(vec4 v) { - return vec4(${V}_(v.x), ${V}_(v.y), ${V}_(v.z), ${V}_(v.w)); - } - `,name:V,type:h.FunctionType.ValueBased}}function _(){return j("log")}function v(){const k="neg";return{body:` - float ${k}_(float a) { - return -a; - } - vec4 ${k}_(vec4 v) { - return -v; - } - `,name:k,type:h.FunctionType.ValueBased}}function T(){const k="not";return{body:` - float ${k}_(float a) { - return float( ! bool(a) ); - } - bool ${k}_(bool a) { - return !a; - } - vec4 ${k}_(vec4 v) { - return vec4(!bool(v.x), !bool(v.y), !bool(v.z), !bool(v.w)); - } - bvec4 ${k}_(bvec4 v) { - return bvec4(!v.x, !v.y, !v.z, !v.w); - } - `,name:k,type:h.FunctionType.ValueBased}}function S(){return j("sin")}function O(){const k="relu";return{body:` - float ${k}_(float a) { - return max( a, 0.0 ); - } - vec4 ${k}_(vec4 v) { - return max( v, 0.0 ); - } - `,name:k,type:h.FunctionType.ValueBased}}function w(){const k="sigmoid";return{body:` - float ${k}_(float a) { - return 1.0 / (1.0 + exp(-a)); - } - vec4 ${k}_(vec4 v) { - return 1.0 / (1.0 + exp(-v)); - } - `,name:k,type:h.FunctionType.ValueBased}}function I(){return j("sqrt")}function R(){return j("tan")}function B(){const k="tanh";return{body:` - float ${k}_(float a) { - a = clamp(a, -10., 10.); - a = exp(2.*a); - return (a - 1.) / (a + 1.); - } - vec4 ${k}_(vec4 v) { - v = clamp(v, -10., 10.); - v = exp(2.*v); - return (v - 1.) / (v + 1.); - } - `,name:k,type:h.FunctionType.ValueBased}}function j(k){return{body:` - float ${k}_(float a) { - return ${k}(a); - } - vec4 ${k}_(vec4 v) { - return ${k}(v); - } - `,name:k,type:h.FunctionType.ValueBased}}u.glslAbs=f,u.glslAcos=s,u.glslAsin=i,u.glslAtan=t,u.glslCeil=e,u.glslCos=n,u.glslElu=r,u.glslExp=a,u.glslFloor=l,u.glslClip=d,u.glslIdentity=m,u.glslLeakyRelu=y,u.glslLog=_,u.glslNeg=v,u.glslNot=T,u.glslSin=S,u.glslRelu=O,u.glslSigmoid=w,u.glslSqrt=I,u.glslTan=R,u.glslTanh=B;const N=(k,V,J,Y)=>{const te=k.session.pack?c.TextureType.packed:c.TextureType.unpacked,ne={name:J.name,inputTypes:[te],inputNames:["A"],cacheHint:Y};return Object.assign(Object.assign({},ne),{get:()=>((me,Pe,Oe,le)=>{const xe=me.session.pack?c.TextureType.packed:c.TextureType.unpacked,_e=(0,o.getGlsl)(me.session.backend.glContext.version);return Object.assign(Object.assign({},Pe),{output:{dims:Oe.dims,type:Oe.type,textureType:xe},shaderSource:` - ${le.body} - void main() { - vec4 v = ${_e.texture2D}(A, TexCoords); - v = ${le.name}_(v); - ${_e.output} = v; - } - `,hasMain:!0})})(k,ne,V,J)})};u.abs=(k,V)=>[k.run(N(k,V[0],f()),V)],u.acos=(k,V)=>[k.run(N(k,V[0],s()),V)],u.asin=(k,V)=>[k.run(N(k,V[0],i()),V)],u.atan=(k,V)=>[k.run(N(k,V[0],t()),V)],u.clip=(k,V,J)=>[k.run(N(k,V[0],d(J.min,J.max),J.cacheKey),V)],u.parseClipAttributes=k=>(0,g.createAttributeWithCacheKey)({min:k.attributes.getFloat("min",p.MIN_CLIP),max:k.attributes.getFloat("max",p.MAX_CLIP)}),u.clipV11=(k,V)=>{const J=W(k,V);return(0,u.clip)(k,[V[0]],J)};const W=(k,V)=>{if(V.length>=3&&(!k.session.isInitializer(V[1].dataId)||!k.session.isInitializer(V[2].dataId)))throw new Error("dynamic clip attributes are not allowed");const J=V.length>=3?V[1].numberData[0]:p.MIN_CLIP,Y=V.length>=3?V[2].numberData[0]:p.MAX_CLIP;return(0,g.createAttributeWithCacheKey)({min:J,max:Y})};u.ceil=(k,V)=>[k.run(N(k,V[0],e()),V)],u.cos=(k,V)=>[k.run(N(k,V[0],n()),V)],u.elu=(k,V,J)=>[k.run(N(k,V[0],r(J.alpha),J.cacheKey),V)],u.parseEluAttributes=k=>(0,g.createAttributeWithCacheKey)({alpha:k.attributes.getFloat("alpha",1)}),u.exp=(k,V)=>[k.run(N(k,V[0],a()),V)],u.floor=(k,V)=>[k.run(N(k,V[0],l()),V)],u.identity=(k,V)=>[k.run(N(k,V[0],m()),V)],u.leakyRelu=(k,V,J)=>[k.run(N(k,V[0],y(J.alpha),J.cacheKey),V)],u.parseLeakyReluAttributes=k=>(0,g.createAttributeWithCacheKey)({alpha:k.attributes.getFloat("alpha",.01)}),u.log=(k,V)=>[k.run(N(k,V[0],_()),V)],u.neg=(k,V)=>[k.run(N(k,V[0],v()),V)],u.not=(k,V)=>[k.run(N(k,V[0],T()),V)],u.relu=(k,V)=>[k.run(N(k,V[0],O()),V)],u.sigmoid=(k,V)=>[k.run(N(k,V[0],w()),V)],u.sin=(k,V)=>[k.run(N(k,V[0],S()),V)],u.sqrt=(k,V)=>[k.run(N(k,V[0],I()),V)],u.tan=(k,V)=>[k.run(N(k,V[0],R()),V)],u.tanh=(k,V)=>[k.run(N(k,V[0],B()),V)]},5611:(D,u,b)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.createUnpackProgramInfoLoader=u.createUnpackProgramInfo=void 0;const g=b(5060),p=b(2039),h=b(9390),o=b(2827),c={name:"unpack",inputNames:["A"],inputTypes:[p.TextureType.packed]};u.createUnpackProgramInfo=(f,s)=>{const i=s.dims.length,t=(0,o.getChannels)("rc",i),e=t.slice(-2),n=(0,h.getCoordsDataType)(i),r=(0,o.unpackFromChannel)(),a=s.dims.length===0?"":function(m,y){if(m===1)return"rc";let _="";for(let v=0;vObject.assign(Object.assign({},c),{get:()=>(0,u.createUnpackProgramInfo)(f,s)})},8428:(D,u,b)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.parseUnsqueezeAttributes=u.unsqueezeV13=u.unsqueeze=void 0;const g=b(2517);u.unsqueeze=(o,c,f)=>{p(c);const s=g.ShapeUtil.unsqueezeShape(c[0].dims,f);return[o.reshapeUnpacked(c[0],s)]},u.unsqueezeV13=(o,c)=>(h(c),(0,u.unsqueeze)(o,[c[0]],Array.from(c[1].integerData))),u.parseUnsqueezeAttributes=o=>o.attributes.getInts("axes");const p=o=>{if(!o||o.length!==1)throw new Error("Unsqueeze requires 1 input.");if(o[0].type==="string")throw new Error("invalid input tensor types.")},h=o=>{if(!o||o.length!==2)throw new Error("Unsqueeze requires 2 inputs.");if(o[1].type!=="int32")throw new Error("Invalid input type.")}},9793:(D,u,b)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.scalesValidation=u.validateInputs=u.parseUpsampleAttributes=u.parseUpsampleAttributesV9=u.parseUpsampleAttributesV7=u.upsample=void 0;const g=b(246),p=b(5060),h=b(2039),o={name:"Upsample",inputNames:["X"],inputTypes:[h.TextureType.unpacked]};u.upsample=(f,s,i)=>((0,u.validateInputs)(s,i),[f.run(Object.assign(Object.assign({},o),{cacheHint:i.cacheKey,get:()=>c(f,s,i)}),s)]),u.parseUpsampleAttributesV7=f=>(0,u.parseUpsampleAttributes)(f,7),u.parseUpsampleAttributesV9=f=>(0,u.parseUpsampleAttributes)(f,9),u.parseUpsampleAttributes=(f,s)=>{const i=s>=10,t=f.attributes.getString("mode","nearest");if(t!=="nearest"&&t!=="linear"&&(s<11||t!=="cubic"))throw new Error(`unrecognized mode: ${t}`);let e=[];s<9&&(e=f.attributes.getFloats("scales"),(0,u.scalesValidation)(e,t,i));const n=f.attributes.getFloat("extrapolation_value",0),r=s>10?f.attributes.getString("coordinate_transformation_mode","half_pixel"):"asymmetric";if(["asymmetric","pytorch_half_pixel","tf_half_pixel_for_nn","align_corners","tf_crop_and_resize","half_pixel"].indexOf(r)===-1)throw new Error(`coordinate_transform_mode '${r}' is not supported`);const a=r==="tf_crop_and_resize",l=a,d=t==="nearest"&&s>=11?f.attributes.getString("nearest_mode","round_prefer_floor"):"";if(["round_prefer_floor","round_prefer_ceil","floor","ceil",""].indexOf(d)===-1)throw new Error(`nearest_mode '${d}' is not supported`);const m=f.attributes.getFloat("cubic_coeff_a",-.75),y=f.attributes.getInt("exclude_outside",0)!==0;if(y&&t!=="cubic")throw new Error("exclude_outside can be set to 1 only when mode is CUBIC.");const _=s<11||t==="nearest"&&r==="asymmetric"&&d==="floor";let v=0,T=0,S=0;return s>10?f.inputs.length>2?(v=1,T=2,S=3):(T=1,S=2):s===9&&(T=1),(0,g.createAttributeWithCacheKey)({opset:s,isResize:i,mode:t,scales:e,extrapolationValue:n,coordinateTransformMode:r,useExtrapolation:l,needRoiInput:a,nearestMode:d,cubicCoefficientA:m,excludeOutside:y,useNearest2xOptimization:_,roiInputIdx:v,scalesInputIdx:T,sizesInputIdx:S})};const c=(f,s,i)=>{const t=(0,p.getGlsl)(f.session.backend.glContext.version),[e,n]=f.calculateTextureWidthAndHeight(s[0].dims,h.TextureType.unpacked),r=s[0].dims.map((S,O)=>Math.floor(S*i.scales[O])),[a,l]=f.calculateTextureWidthAndHeight(r,h.TextureType.unpacked),d=r.length,m=new Array(d),y=new Array(d);let _=` - int output_pitches[${d}]; - int input_pitches[${d}]; - `;for(let S=d-1;S>=0;S--)m[S]=S===d-1?1:m[S+1]*r[S+1],y[S]=S===d-1?1:y[S+1]*s[0].dims[S+1],_+=` - output_pitches[${S}] = ${m[S]}; - input_pitches[${S}] = ${y[S]}; - `;const v=` - float getInputFloat(int index) { - vec2 coords = offsetToCoords(index, ${e}, ${n}); - float value = getColorAsFloat(${t.texture2D}(X, coords)); - return value; - } - `,T=i.mode==="nearest"?` - ${v} - float process(int indices[${d}]) { - int input_index = 0; - int output_index = coordsToOffset(TexCoords, ${a}, ${l}); - - ${_} - - int d, m; - for (int dim = 0; dim < ${d}; ++dim) { - d = output_index / output_pitches[dim]; - m = output_index - d * output_pitches[dim]; - output_index = m; - - if (scales[dim] != 1 && d > 0) { - int d2 = d / scales[dim]; - m = d - d2 * scales[dim]; - d = d2; - } - input_index += input_pitches[dim] * d; - } - - return getInputFloat(input_index); - }`:d===4?` - ${v} - float process(int indices[4]) { - int input_index = 0; - int output_index = coordsToOffset(TexCoords, ${a}, ${l}); - - ${_} - - int m; - int index_of_dim0, index_of_dim1, index_of_dim2, index_of_dim3; - index_of_dim0 = output_index / output_pitches[0]; - m = output_index - index_of_dim0 * output_pitches[0]; - index_of_dim1 = m / output_pitches[1]; - m = m - index_of_dim1 * output_pitches[1]; - index_of_dim2 = m / output_pitches[2]; - m = m - index_of_dim2 * output_pitches[2]; - index_of_dim3 = m; - - int index_of_input_dim2, index_of_input_dim3, x_offset, y_offset; - index_of_input_dim2 = index_of_dim2 / scales[2]; - y_offset = index_of_dim2 - index_of_input_dim2 * scales[2]; - index_of_input_dim3 = index_of_dim3 / scales[3]; - x_offset = index_of_dim3 - index_of_input_dim3 * scales[3]; - - input_index = index_of_dim0 * input_pitches[0] + - index_of_dim1 * input_pitches[1] + - index_of_input_dim2 * input_pitches[2] + - index_of_input_dim3; - - float x00 = getInputFloat(input_index); - float x10, x01, x11; - - bool end_of_dim2 = false; - if (index_of_input_dim2 == (${s[0].dims[2]} - 1)) { - // It's the end in dimension 2 - x01 = x00; - end_of_dim2 = true; - } else { - x01 = getInputFloat(input_index + input_pitches[2]); - } - - if (index_of_input_dim3 == (input_pitches[2] - 1)) { - // It's the end in dimension 3 - x10 = x00; - x11 = x01; - } - else { - x10 = getInputFloat(input_index + 1); - x11 = end_of_dim2 ? x10 : getInputFloat(input_index + input_pitches[2] + 1); - } - - float y0 = x00 + float(y_offset) * (x01 - x00) / float(scales[2]); - float y1 = x10 + float(y_offset) * (x11 - x10) / float(scales[2]); - return y0 + float(x_offset) * (y1 - y0) / float(scales[3]); - }`:` - ${v} - float process(int indices[2]) { - int input_index = 0; - int output_index = coordsToOffset(TexCoords, ${a}, ${l}); - - ${_} - - int m; - int index_of_dim0, index_of_dim1; - index_of_dim0 = output_index / output_pitches[0]; - m = output_index - index_of_dim0 * output_pitches[0]; - index_of_dim1 = m; - - int index_of_input_dim0, index_of_input_dim1, x_offset, y_offset; - index_of_input_dim0 = index_of_dim0 / scales[0]; - y_offset = index_of_dim0 - index_of_input_dim0 * scales[0]; - index_of_input_dim1 = index_of_dim1 / scales[1]; - x_offset = index_of_dim1 - index_of_input_dim1 * scales[1]; - - input_index = index_of_input_dim0 * input_pitches[0] + index_of_input_dim1; - - float x00 = getInputFloat(input_index); - float x10, x01, x11; - - bool end_of_dim0 = false; - if (index_of_input_dim0 == (${s[0].dims[0]} - 1)) { - // It's the end in dimension 0 - x01 = x00; - end_of_dim0 = true; - } else { - x01 = getInputFloat(input_index + input_pitches[0]); - } - - if (index_of_input_dim1 == (input_pitches[0] - 1)) { - // It's the end in dimension 1 - x10 = x00; - x11 = x01; - } - else { - x10 = getInputFloat(input_index + 1); - x11 = end_of_dim0 ? x10 : getInputFloat(input_index + input_pitches[0] + 1); - } - - float y0 = x00 + float(y_offset) * (x01 - x00) / float(scales[0]); - float y1 = x10 + float(y_offset) * (x11 - x10) / float(scales[0]); - return y0 + float(x_offset) * (y1 - y0) / float(scales[1]); - }`;return Object.assign(Object.assign({},o),{output:{dims:r,type:s[0].type,textureType:h.TextureType.unpacked},shaderSource:T,variables:[{name:"scales",type:"int",arrayLength:i.scales.length,data:i.scales.map(S=>Math.ceil(S))}]})};u.validateInputs=(f,s)=>{if(!f||s.opset<9&&f.length!==1||s.opset>=9&&s.opset<11&&f.length!==2||s.opset>=11&&f.length<2)throw new Error("invalid inputs.");if(s.scales.length>0&&f[0].dims.length!==s.scales.length)throw new Error("Invalid input shape.");if(f[0].type==="string")throw new Error("Invalid input tensor types.")},u.scalesValidation=(f,s,i)=>{if(i){for(const t of f)if(t<=0)throw new Error("Scale value should be greater than 0.")}else for(const t of f)if(t<1)throw new Error("Scale value should be greater than or equal to 1.");if(!(s!=="linear"&&s!=="cubic"||f.length===2||f.length===4&&f[0]===1&&f[1]===1))throw new Error(`'Linear' mode and 'Cubic' mode only support 2-D inputs ('Bilinear', 'Bicubic') or 4-D inputs with the corresponding outermost 2 scale values being 1 in the ${i?"Resize":"Upsample"} opeartor.`)}},1958:(D,u,b)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.ProgramManager=void 0;const g=b(1670),p=b(6231),h=b(8879),o=b(5060);u.ProgramManager=class{constructor(c,f,s){this.profiler=c,this.glContext=f,this.textureLayoutStrategy=s,this.repo=new Map,this.attributesBound=!1}getArtifact(c){return this.repo.get(c)}setArtifact(c,f){this.repo.set(c,f)}run(c,f,s){var i;this.profiler.event("op",`ProgramManager.run ${(i=c.programInfo.name)!==null&&i!==void 0?i:"unknown kernel"}`,()=>{var t;const e=this.glContext.gl,n=c.program;e.useProgram(n);try{this.bindOutput(s),this.attributesBound||this.bindAttributes(c.attribLocations),this.bindUniforms(c.uniformLocations,(t=c.programInfo.variables)!==null&&t!==void 0?t:[],f)}catch(r){throw p.Logger.error("ProgramManager",c.programInfo.shaderSource),r}this.profiler.event("backend","GlContext.draw()",()=>{this.glContext.draw()})},this.glContext)}dispose(){this.vertexShader&&this.glContext.deleteShader(this.vertexShader),this.repo.forEach(c=>this.glContext.deleteProgram(c.program))}build(c,f,s){return this.profiler.event("backend","ProgramManager.build",()=>{const i=new h.GlslPreprocessor(this.glContext,c,f,s),t=i.preprocess(),e=this.compile(t);return{programInfo:c,program:e,uniformLocations:this.getUniformLocations(e,i.context.programInfo.inputNames,i.context.programInfo.variables),attribLocations:this.getAttribLocations(e)}})}compile(c){if(!this.vertexShader){p.Logger.verbose("ProrgramManager","Compiling and caching Vertex shader for the first time");const i=(0,o.getVertexShaderSource)(this.glContext.version);this.vertexShader=this.glContext.compileShader(i,this.glContext.gl.VERTEX_SHADER)}g.env.debug&&p.Logger.verbose("ProrgramManager",`FragShader: -${c} -`);const f=this.glContext.compileShader(c,this.glContext.gl.FRAGMENT_SHADER),s=this.glContext.createProgram(this.vertexShader,f);return this.glContext.deleteShader(f),s}bindOutput(c){const f=c.width,s=c.height;p.Logger.verbose("ProrgramManager",`Binding output texture to Framebuffer: w/h=${f}/${s}, shape=${c.shape}, type=${c.tensor.type}`),this.glContext.attachFramebuffer(c.texture,f,s)}bindAttributes(c){const f=c.position,s=c.textureCoord;this.glContext.setVertexAttributes(f,s),this.attributesBound=!0}bindUniforms(c,f,s){var i;const t=this.glContext.gl;let e=0;for(const{name:n,type:r,location:a,arrayLength:l}of c){const d=(i=f.find(m=>m.name===n))===null||i===void 0?void 0:i.data;if(r!=="sampler2D"&&!d)throw new Error(`variable '${n}' does not have data defined in program info`);switch(r){case"sampler2D":this.bindTexture(s[e],a,e),e++;break;case"float":l?t.uniform1fv(a,d):t.uniform1f(a,d);break;case"int":l?t.uniform1iv(a,d):t.uniform1i(a,d);break;default:throw new Error(`Uniform not implemented: ${r}`)}}}bindTexture(c,f,s){this.glContext.bindTextureToUniform(c.texture,s,f)}getAttribLocations(c){return{position:this.getAttribLocation(c,"position"),textureCoord:this.getAttribLocation(c,"textureCoord")}}getUniformLocations(c,f,s){const i=[];if(f)for(const t of f)i.push({name:t,type:"sampler2D",location:this.getUniformLocation(c,t)});if(s)for(const t of s)i.push(Object.assign(Object.assign({},t),{location:this.getUniformLocation(c,t.name)}));return i}getUniformLocation(c,f){const s=this.glContext.gl.getUniformLocation(c,f);if(s===null)throw new Error(`Uniform ${f} not found.`);return s}getAttribLocation(c,f){return this.glContext.gl.getAttribLocation(c,f)}}},6416:(D,u,b)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.WebGLSessionHandler=void 0;const g=b(6231),p=b(1047),h=b(8316),o=b(1640),c=b(1958),f=b(7859),s=b(5702);u.WebGLSessionHandler=class{constructor(i,t){this.backend=i,this.context=t,this.layoutStrategy=new f.PreferLogicalStrategy(i.glContext.maxTextureSize),this.programManager=new c.ProgramManager(this.context.profiler,i.glContext,this.layoutStrategy),this.textureManager=new s.TextureManager(i.glContext,this.layoutStrategy,this.context.profiler,{reuseTextures:i.textureCacheMode==="full"}),this.packedTextureDataCache=new Map,this.unpackedTextureDataCache=new Map,this.pack=i.pack,this.pack2unpackMap=new Map,this.unpack2packMap=new Map}createInferenceHandler(){return new h.WebGLInferenceHandler(this)}onGraphInitialized(i){const t=i.getValues().filter(e=>e.from===-1&&e.tensor).map(e=>e.tensor.dataId);this.initializers=new Set(t)}isInitializer(i){return!!this.initializers&&this.initializers.has(i)}addInitializer(i){this.initializers.add(i)}getTextureData(i,t){return t?this.packedTextureDataCache.get(i):this.unpackedTextureDataCache.get(i)}setTextureData(i,t,e=!1){g.Logger.verbose("WebGLSessionHandler","Storing Texture data in cache"),e?this.packedTextureDataCache.set(i,t):this.unpackedTextureDataCache.set(i,t)}dispose(){this.programManager.dispose(),this.textureManager.clearActiveTextures(),this.packedTextureDataCache.forEach(i=>this.textureManager.releaseTexture(i,!0)),this.packedTextureDataCache=new Map,this.unpackedTextureDataCache.forEach(i=>this.textureManager.releaseTexture(i,!0)),this.unpackedTextureDataCache=new Map}resolve(i,t,e){const n=(0,p.resolveOperator)(i,t,o.WEBGL_OP_RESOLVE_RULES);return{impl:n.opImpl,context:n.opInit?n.opInit(i,e):i}}}},7769:(D,u,b)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.Uint8DataEncoder=u.RGBAFloatDataEncoder=u.RedFloat32DataEncoder=void 0;const g=b(6231);u.RedFloat32DataEncoder=class{constructor(p,h=1){if(h===1)this.internalFormat=p.R32F,this.format=p.RED,this.textureType=p.FLOAT,this.channelSize=h;else{if(h!==4)throw new Error(`Invalid number of channels: ${h}`);this.internalFormat=p.RGBA32F,this.format=p.RGBA,this.textureType=p.FLOAT,this.channelSize=h}}encode(p,h){let o,c;return p.constructor!==Float32Array&&(g.Logger.warning("Encoder","data was not of type Float32; creating new Float32Array"),c=new Float32Array(p)),h*this.channelSize>p.length?(g.Logger.warning("Encoder","Source data too small. Allocating larger array"),c=p,o=this.allocate(h*this.channelSize),c.forEach((f,s)=>o[s]=f)):(c=p,o=c),o}allocate(p){return new Float32Array(4*p)}decode(p,h){return this.channelSize===1?p.filter((o,c)=>c%4==0).subarray(0,h):p.subarray(0,h)}},u.RGBAFloatDataEncoder=class{constructor(p,h=1,o){if(h!==1&&h!==4)throw new Error(`Invalid number of channels: ${h}`);this.internalFormat=p.RGBA,this.format=p.RGBA,this.channelSize=h,this.textureType=o||p.FLOAT}encode(p,h){let o=p;return this.channelSize===1&&(g.Logger.verbose("Encoder","Exploding into a larger array"),o=this.allocate(h),p.forEach((c,f)=>o[4*f]=c)),o}allocate(p){return new Float32Array(4*p)}decode(p,h){return this.channelSize===1?p.filter((o,c)=>c%4==0).subarray(0,h):p.subarray(0,h)}},u.Uint8DataEncoder=class{constructor(p,h=1){if(this.channelSize=4,h===1)this.internalFormat=p.ALPHA,this.format=p.ALPHA,this.textureType=p.UNSIGNED_BYTE,this.channelSize=h;else{if(h!==4)throw new Error(`Invalid number of channels: ${h}`);this.internalFormat=p.RGBA,this.format=p.RGBA,this.textureType=p.UNSIGNED_BYTE,this.channelSize=h}}encode(p,h){return new Uint8Array(p.buffer,p.byteOffset,p.byteLength)}allocate(p){return new Uint8Array(p*this.channelSize)}decode(p,h){if(p instanceof Uint8Array)return p.subarray(0,h);throw new Error(`Invalid array type: ${p.constructor}`)}}},7859:(D,u,b)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.getBatchDim=u.sizeToSquarishShape=u.getRowsCols=u.sizeFromShape=u.isInt=u.parseAxisParam=u.squeezeShape=u.PreferLogicalStrategy=u.AlwaysKeepOriginalSizeStrategy=void 0;const g=b(6231),p=b(2517);function h(i,t){const e=[],n=[],r=t!=null&&Array.isArray(t)&&t.length===0,a=t==null||r?null:o(t,i).sort();let l=0;for(let d=0;dd)&&i[d]===1&&(e.push(i[d]),n.push(d)),a[l]<=d&&l++}i[d]!==1&&(e.push(i[d]),n.push(d))}return{newShape:e,keptDims:n}}function o(i,t){const e=t.length;return i=i==null?t.map((n,r)=>r):[].concat(i),(0,p.assert)(i.every(n=>n>=-e&&n`All values in axis param must be in range [-${e}, ${e}) but got axis ${i}`),(0,p.assert)(i.every(c),()=>`All values in axis param must be integers but got axis ${i}`),i.map(n=>n<0?e+n:n)}function c(i){return i%1==0}function f(i){if(i.length===0)return 1;let t=i[0];for(let e=1;e=i.length?1:i.slice(t.breakAxis).reduce((d,m)=>d*m),l=t.breakAxis<=0?1:i.slice(0,t.breakAxis).reduce((d,m)=>d*m);if(!(a>e||l>e))return[a,l];g.Logger.verbose("TextureLayout",`Given width/height preferences were unattainable: shape:${i}, breakAxis:${t.breakAxis}`)}const n=i.reduce((a,l)=>a*l);let r=Math.floor(Math.sqrt(n));for(;r=e||n%r!=0)throw new Error(`The given dimensions are outside this GPU's boundaries: ${i}`);return[r,n/r]}},u.PreferLogicalStrategy=class{constructor(i){this.maxTextureSize=i}computeTextureWH(i,t){const e=this.computeTexture(i,t);return t&&t.isPacked&&(e[0]/=2,e[1]/=2),t&&t.reverseWH?[e[1],e[0]]:e}computeTexture(i,t){const e=t&&t.isPacked;if(i.length===0)return e?[2,2]:[1,1];let n=this.maxTextureSize;if(t&&t.breakAxis!==void 0){const l=t.breakAxis>=i.length?1:i.slice(t.breakAxis).reduce((m,y)=>m*y),d=t.breakAxis<=0?1:i.slice(0,t.breakAxis).reduce((m,y)=>m*y);if(!(l>n||d>n))return[l,d];g.Logger.verbose("TextureLayout",`Given width/height preferences were unattainable: shape:${i}, breakAxis:${t.breakAxis}`)}let r=i.slice(0);e&&(n*=2,r=r.map((l,d)=>d>=r.length-2?r[d]%2==0?r[d]:r[d]+1:r[d]),r.length===1&&(r=[2,r[0]])),r.length!==2&&(r=h(r).newShape);const a=f(r);return r.length<=1&&a<=n?[1,a]:r.length===2&&r[0]<=n&&r[1]<=n?r:r.length===3&&r[0]*r[1]<=n&&r[2]<=n?[r[0]*r[1],r[2]]:r.length===3&&r[0]<=n&&r[1]*r[2]<=n?[r[0],r[1]*r[2]]:r.length===4&&r[0]*r[1]*r[2]<=n&&r[3]<=n?[r[0]*r[1]*r[2],r[3]]:r.length===4&&r[0]<=n&&r[1]*r[2]*r[3]<=n?[r[0],r[1]*r[2]*r[3]]:e?s(a/4).map(l=>2*l):s(a)}},u.squeezeShape=h,u.parseAxisParam=o,u.isInt=c,u.sizeFromShape=f,u.getRowsCols=function(i){if(i.length===0)throw Error("Cannot get rows and columns of an empty shape array.");return[i.length>1?i[i.length-2]:1,i[i.length-1]]},u.sizeToSquarishShape=s,u.getBatchDim=function(i,t=2){return f(i.slice(0,i.length-t))}},4057:(D,u,b)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.createTextureLayoutFromShape=u.calculateTextureWidthAndHeight=u.createTextureLayoutFromTextureType=void 0;const g=b(2517),p=b(2039);u.createTextureLayoutFromTextureType=(h,o,c)=>{const f=c===p.TextureType.unpacked||c===p.TextureType.unpackedReversed?1:4,s=c===p.TextureType.packed,i=c===p.TextureType.unpackedReversed||c===p.TextureType.packed,t=c===p.TextureType.packedLastDimension?o.length-1:void 0,e=c===p.TextureType.packedLastDimension?o.map((n,r)=>r===o.length-1?4*n:n):void 0;return(0,u.createTextureLayoutFromShape)(h,o,f,e,{isPacked:s,reverseWH:i,breakAxis:t})},u.calculateTextureWidthAndHeight=(h,o,c)=>{const f=(0,u.createTextureLayoutFromTextureType)(h,o,c);return[f.width,f.height]},u.createTextureLayoutFromShape=(h,o,c=1,f,s)=>{const i=!(!s||!s.isPacked),[t,e]=h.computeTextureWH(i&&f||o,s),n=o.length;let r=o.slice(0);if(n===0&&(r=[1]),c===1)f=o;else if(i){if(c!==4)throw new Error("a packed texture must be 4-channel");f=o,n>0&&(r[n-1]=Math.ceil(r[n-1]/2)),n>1&&(r[n-2]=Math.ceil(r[n-2]/2))}else if(!f)throw new Error("Unpacked shape is needed when using channels > 1");return{width:t,height:e,channels:c,isPacked:i,shape:r,strides:g.ShapeUtil.computeStrides(r),unpackedShape:f,reversedWH:s&&s.reverseWH}}},5702:(D,u,b)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.TextureManager=void 0;const g=b(6231);u.TextureManager=class{constructor(p,h,o,c){this.glContext=p,this.layoutStrategy=h,this.profiler=o,this.config=c,this.pendingRead=new Map,c.reuseTextures&&(this.inUseTextures=new Map,this.idleTextures=new Map,this.textureLookup=new Map)}createTextureFromLayout(p,h,o,c){const f=this.toEncoderType(p),s=this.glContext.getEncoder(f,h.channels||1,c);if(h.isPacked&&c===1)throw new Error("not implemented");const i=h.width,t=h.height;let e,n;if(this.config.reuseTextures){e=`${i}x${t}_${s.format}_${s.internalFormat}_${s.textureType}`,n=this.inUseTextures.get(e),n||(n=[],this.inUseTextures.set(e,n));const a=this.idleTextures.get(e);if(a&&a.length>0){const l=a.pop();return n.push(l),c===1&&this.glContext.updateTexture(l,i,t,s,this.toTextureData(p,o)),l}}g.Logger.verbose("TextureManager",`Creating new texture of size ${h.width}x${h.height}`);const r=this.glContext.allocateTexture(i,t,s,this.toTextureData(p,o));return this.config.reuseTextures&&(n.push(r),this.textureLookup.set(r,e)),r}readTexture(p,h,o){return o||(o=1),this.profiler.event("backend","TextureManager.readTexture",()=>{const c=p.shape.reduce((s,i)=>s*i)*o,f=this.glContext.readTexture(p.texture,p.width,p.height,c,this.toEncoderType(h),o);return this.toTensorData(h,f)})}async readTextureAsync(p,h,o){const c=p.tensor.dataId;if(o||(o=1),this.pendingRead.has(c)){const f=this.pendingRead.get(c);return new Promise(s=>f==null?void 0:f.push(s))}return this.profiler.event("backend","TextureManager.readTextureAsync",async()=>{this.pendingRead.set(c,[]);const f=p.shape.reduce((e,n)=>e*n)*o;await this.glContext.createAndWaitForFence();const s=this.glContext.readTexture(p.texture,p.width,p.height,f,this.toEncoderType(h),o),i=this.toTensorData(h,s),t=this.pendingRead.get(c);return this.pendingRead.delete(c),t==null||t.forEach(e=>e(i)),i})}readUint8TextureAsFloat(p){return this.profiler.event("backend","TextureManager.readUint8TextureAsFloat",()=>{const h=p.shape.reduce((c,f)=>c*f),o=this.glContext.readTexture(p.texture,p.width,p.height,4*h,"byte",4);return new Float32Array(o.buffer,o.byteOffset,h)})}releaseTexture(p,h){let o;if(this.config.reuseTextures&&(o=this.textureLookup.get(p.texture),o)){h&&this.textureLookup.delete(o);const c=this.inUseTextures.get(o);if(c){const f=c.indexOf(p.texture);if(f!==-1){c.splice(f,1);let s=this.idleTextures.get(o);s||(s=[],this.idleTextures.set(o,s)),s.push(p.texture)}}}o&&!h||(g.Logger.verbose("TextureManager",`Deleting texture of size ${p.width}x${p.height}`),this.glContext.deleteTexture(p.texture))}toTensorData(p,h){switch(p){case"int16":return h instanceof Int16Array?h:Int16Array.from(h);case"int32":return h instanceof Int32Array?h:Int32Array.from(h);case"int8":return h instanceof Int8Array?h:Int8Array.from(h);case"uint16":return h instanceof Uint16Array?h:Uint16Array.from(h);case"uint32":return h instanceof Uint32Array?h:Uint32Array.from(h);case"uint8":case"bool":return h instanceof Uint8Array?h:Uint8Array.from(h);case"float32":return h instanceof Float32Array?h:Float32Array.from(h);case"float64":return h instanceof Float64Array?h:Float64Array.from(h);default:throw new Error(`TensorData type ${p} is not supported`)}}toTextureData(p,h){if(h)return h instanceof Float32Array?h:new Float32Array(h)}toEncoderType(p){return"float"}clearActiveTextures(){this.glContext.clearActiveTextures()}}},2039:(D,u)=>{var b;Object.defineProperty(u,"__esModule",{value:!0}),u.TextureType=void 0,(b=u.TextureType||(u.TextureType={}))[b.unpacked=0]="unpacked",b[b.unpackedReversed=1]="unpackedReversed",b[b.packed=2]="packed",b[b.downloadUint8AsFloat=3]="downloadUint8AsFloat",b[b.packedLastDimension=4]="packedLastDimension"},9390:(D,u,b)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.getGlChannels=u.getCoordsDataType=u.getSqueezedParams=u.squeezeInputShape=u.generateShaderFuncNameFromInputSamplerNameAtOutCoords=u.generateShaderFuncNameFromInputSamplerName=u.repeatedTry=u.getPackedShape=void 0;const g=b(2517);u.getPackedShape=function(p){const h=p.length;return p.slice(0,h-1).concat(p[h-1]/4)},u.repeatedTry=async function(p,h=c=>0,o){return new Promise((c,f)=>{let s=0;const i=()=>{if(p())return void c();s++;const t=h(s);o!=null&&s>=o?f():setTimeout(i,t)};i()})},u.generateShaderFuncNameFromInputSamplerName=function(p){return(0,g.assert)(p!==void 0&&p.length!==0,()=>"empty string found for sampler name"),"get"+p.charAt(0).toUpperCase()+p.slice(1)},u.generateShaderFuncNameFromInputSamplerNameAtOutCoords=function(p){return(0,g.assert)(p!==void 0&&p.length!==0,()=>"empty string found for sampler name"),"get"+p.charAt(0).toUpperCase()+p.slice(1)+"AtOutCoords"},u.squeezeInputShape=function(p,h){let o=JSON.parse(JSON.stringify(p));return o=h,o},u.getSqueezedParams=function(p,h){return h.map(o=>p[o]).join(", ")},u.getCoordsDataType=function(p){if(p<=1)return"int";if(p===2)return"ivec2";if(p===3)return"ivec3";if(p===4)return"ivec4";if(p===5)return"ivec5";if(p===6)return"ivec6";throw Error(`GPU for rank ${p} is not yet supported`)},u.getGlChannels=function(p=6){return["x","y","z","w","u","v"].slice(0,p)}},7305:(D,u,b)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.createNewWebGLContext=u.createWebGLContext=void 0;const g=b(6231),p=b(1713),h={};function o(c){const f=function(){if(typeof document>"u"){if(typeof OffscreenCanvas>"u")throw new TypeError("failed to create canvas: OffscreenCanvas is not supported");return new OffscreenCanvas(1,1)}const t=document.createElement("canvas");return t.width=1,t.height=1,t}();let s;const i={alpha:!1,depth:!1,antialias:!1,stencil:!1,preserveDrawingBuffer:!1,premultipliedAlpha:!1,failIfMajorPerformanceCaveat:!1};if((!c||c==="webgl2")&&(s=f.getContext("webgl2",i),s))try{return new p.WebGLContext(s,2)}catch(t){g.Logger.warning("GlContextFactory",`failed to create WebGLContext using contextId 'webgl2'. Error: ${t}`)}if((!c||c==="webgl")&&(s=f.getContext("webgl",i)||f.getContext("experimental-webgl",i),s))try{return new p.WebGLContext(s,1)}catch(t){g.Logger.warning("GlContextFactory",`failed to create WebGLContext using contextId 'webgl' or 'experimental-webgl'. Error: ${t}`)}throw new Error("WebGL is not supported")}u.createWebGLContext=function c(f){let s;f&&f!=="webgl2"||!("webgl2"in h)?f&&f!=="webgl"||!("webgl"in h)||(s=h.webgl):s=h.webgl2,s=s||o(f),f=f||s.version===1?"webgl":"webgl2";const i=s.gl;return h[f]=s,i.isContextLost()?(delete h[f],c(f)):(i.disable(i.DEPTH_TEST),i.disable(i.STENCIL_TEST),i.disable(i.BLEND),i.disable(i.DITHER),i.disable(i.POLYGON_OFFSET_FILL),i.disable(i.SAMPLE_COVERAGE),i.enable(i.SCISSOR_TEST),i.enable(i.CULL_FACE),i.cullFace(i.BACK),s)},u.createNewWebGLContext=o},1713:function(D,u,b){var g=this&&this.__createBinding||(Object.create?function(i,t,e,n){n===void 0&&(n=e);var r=Object.getOwnPropertyDescriptor(t,e);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[e]}}),Object.defineProperty(i,n,r)}:function(i,t,e,n){n===void 0&&(n=e),i[n]=t[e]}),p=this&&this.__setModuleDefault||(Object.create?function(i,t){Object.defineProperty(i,"default",{enumerable:!0,value:t})}:function(i,t){i.default=t}),h=this&&this.__importStar||function(i){if(i&&i.__esModule)return i;var t={};if(i!=null)for(var e in i)e!=="default"&&Object.prototype.hasOwnProperty.call(i,e)&&g(t,i,e);return p(t,i),t};Object.defineProperty(u,"__esModule",{value:!0}),u.WebGLContext=u.linearSearchLastTrue=void 0;const o=b(1670),c=h(b(7769)),f=b(9390);function s(i){let t=0;for(;tthis.isTimerResultAvailable(i)),this.getTimerResult(i)}async createAndWaitForFence(){const i=this.createFence(this.gl);return this.pollFence(i)}createFence(i){let t;const e=i,n=e.fenceSync(e.SYNC_GPU_COMMANDS_COMPLETE,0);return i.flush(),t=n===null?()=>!0:()=>{const r=e.clientWaitSync(n,0,0);return r===e.ALREADY_SIGNALED||r===e.CONDITION_SATISFIED},{query:n,isFencePassed:t}}async pollFence(i){return new Promise(t=>{this.addItemToPoll(()=>i.isFencePassed(),()=>t())})}pollItems(){const i=s(this.itemsToPoll.map(t=>t.isDoneFn));for(let t=0;t<=i;++t){const{resolveFn:e}=this.itemsToPoll[t];e()}this.itemsToPoll=this.itemsToPoll.slice(i+1)}async addItemToPoll(i,t){this.itemsToPoll.push({isDoneFn:i,resolveFn:t}),this.itemsToPoll.length>1||await(0,f.repeatedTry)(()=>(this.pollItems(),this.itemsToPoll.length===0))}}},1036:(D,u,b)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.ExecutionPlan=void 0;const g=b(6231);class p{constructor(o,c){this.op=o,this.node=c}}u.ExecutionPlan=class{constructor(h,o,c){this.graph=h,this.profiler=c,this.initialize(o)}initialize(h){this.profiler.event("session","ExecutionPlan.initialize",()=>{const o=this.graph.getNodes();if(o.length!==h.length)throw new Error("The size of nodes and OPs do not match.");this._ops=h.map((c,f)=>new p(c,o[f])),this.reset(),this._starter=[],this._ops.forEach((c,f)=>{let s=!0;for(const i of c.node.inputs)if(!this._values[i]&&this.graph.getInputIndices().indexOf(i)===-1){s=!1;break}s&&this._starter.push(f)})})}reset(){this._values=this.graph.getValues().map(h=>h.tensor)}async execute(h,o){return this.profiler.event("session","ExecutionPlan.execute",async()=>{this.reset();const c=h.createInferenceHandler(),f=this.graph.getInputIndices();if(o.length!==f.length)throw new Error(`number of input tensors don't match the number of inputs to the model: actual: ${o.length} expected: ${f.length}`);o.forEach((r,a)=>{const l=f[a];this._values[l]=r});const s=this._starter.slice(0),i=this.graph.getValues(),t=this.graph.getNodes();let e=0;for(;ethis._values[_]);if(l.indexOf(void 0)!==-1)throw new Error(`unresolved input detected: op: ${a.node}`);const d=l;g.Logger.verbose("ExecPlan",`Runing op:${a.node.name} (${d.map((_,v)=>`'${a.node.inputs[v]}': ${_.type}[${_.dims.join(",")}]`).join(", ")})`);const m=await this.profiler.event("node",a.node.name,async()=>a.op.impl(c,d,a.op.context));if(m.length!==a.node.outputs.length)throw new Error("the size of output does not match model definition.");m.forEach((_,v)=>{const T=a.node.outputs[v];if(this._values[T])throw new Error(`output [${T}] already has value: op:${a.node.name}`);this._values[T]=_});const y=new Set;m.forEach((_,v)=>{const T=a.node.outputs[v];for(const S of i[T].to){const O=t[S];let w=!0;for(const I of O.inputs)if(!this._values[I]){w=!1;break}w&&y.add(S)}}),s.push(...y)}const n=[];for(let r=0;r{Object.defineProperty(u,"__esModule",{value:!0}),u.Graph=void 0;const g=b(1446),p=b(7778),h=b(9395),o=b(9162),c=b(2517);var f=h.onnxruntime.experimental.fbs;u.Graph={from:(e,n)=>new t(e,n)};class s{constructor(n){this._from=void 0,this._to=[],this.tensor=void 0,this.type=void 0,n&&(this.type=c.ProtoUtil.tensorValueTypeFromProto(n.type.tensorType))}get from(){return this._from}get to(){return this._to}}class i{constructor(n,r){n instanceof g.onnx.NodeProto?(this.name=n.name,this.opType=n.opType,this.attributes=new p.Attribute(n.attribute)):n instanceof f.Node&&(this.name=r??n.name(),this.opType=n.opType(),this.attributes=new p.Attribute(c.ProtoUtil.tensorAttributesFromORTFormat(n))),this.inputs=[],this.outputs=[],this.executeNode=!0}}class t{constructor(n,r){if(!n)throw new TypeError("graph is empty");this.buildGraph(n),this.transformGraph(r),this.checkIsAcyclic()}getInputIndices(){return this._allInputIndices}getInputNames(){return this._allInputNames}getOutputIndices(){return this._allOutputIndices}getOutputNames(){return this._allOutputNames}getValues(){return this._allData}getNodes(){return this._nodes}buildGraph(n){if(n instanceof g.onnx.GraphProto)this.buildGraphFromOnnxFormat(n);else{if(!(n instanceof f.Graph))throw new TypeError("Graph type is not supported.");this.buildGraphFromOrtFormat(n)}}buildGraphFromOnnxFormat(n){const r=new Map;this._allData=[],this._allInputIndices=[],this._allInputNames=[],this._allOutputIndices=[],this._allOutputNames=[],this._nodes=[];const a=new Map;if(!n.input)throw new Error("missing information in graph: input");const l=[];for(const d of n.input){if(r.has(d.name))throw new Error(`duplicated input name: ${d.name}`);const m=this._allData.push(new s(d))-1;r.set(d.name,m),l.push(d.name)}if(!n.initializer)throw new Error("missing information in graph: initializer");for(const d of n.initializer){let m=r.get(d.name);if(m===void 0){const y=new s;y.type={shape:{dims:c.ProtoUtil.tensorDimsFromProto(d.dims)},tensorType:c.ProtoUtil.tensorDataTypeFromProto(d.dataType)},m=this._allData.push(y)-1,r.set(d.name,m)}this._allData[m]._from=-1,this._allData[m].tensor=o.Tensor.fromProto(d)}for(let d=0;d{this._allData[l]._to.forEach(d=>{n.add(d)})});const r=Array.from(n),a=new Array(this._nodes.length).fill("white");for(;r.length>0;){const l=r.pop();a[l]==="gray"?a[l]="black":(r.push(l),a[l]="gray",this._nodes[l].outputs.forEach(d=>{const m=this._allData[d];if(m.tensor!==void 0)throw new Error("node outputs should not be initialized");if(m._from!==l)throw new Error("from property of the Value object doesn't match index of Node being processed");m._to.forEach(y=>{if(a[y]==="gray")throw new Error("model graph is cyclic");a[y]==="white"&&r.push(y)})}))}}transformGraph(n){this.removeAllIdentityNodes(),this.removeAllDropoutNodes(),this.fuseConvActivationNodes(),n&&n.transformGraph(this),this.finalizeGraph()}finalizeGraph(){let n=0;for(let r=0;r0&&(this._nodes[r].inputs.forEach(a=>{const l=this._allData[a]._to.indexOf(r+n);l!==-1&&(this._allData[a]._to[l]=r)}),this._nodes[r].outputs.forEach(a=>{this._allData[a]._from&&this._allData[a]._from===r+n&&(this._allData[a]._from=r)})):(n++,this._nodes[r].outputs.forEach(a=>{this._allData[a]._from=-2}),this._nodes.splice(r,1),r--);n=0;for(let r=0;r0){let a=-1;this._allData[r].from!==void 0&&this._allData[r].from!==-1?(a=this._nodes[this._allData[r].from].outputs.indexOf(r+n),a!==-1&&(this._nodes[this._allData[r].from].outputs[a]=r)):(a=this._allInputIndices.indexOf(r+n),a!==-1&&(this._allInputIndices[a]=r)),this._allData[r].to.forEach(l=>{a=this._nodes[l].inputs.indexOf(r+n),a!==-1&&(this._nodes[l].inputs[a]=r)}),this._allData[r].to.length===0&&(a=this._allOutputIndices.indexOf(r+n),a!==-1&&(this._allOutputIndices[a]=r))}}else n++,this._allData.splice(r,1),r--}deleteNode(n){const r=this._nodes[n];if(r.outputs.length>1){for(let _=1;_0)throw new Error("Node deletion with more than one output connected to other nodes is not supported. ")}r.executeNode=!1;const a=r.inputs[0],l=r.outputs[0],d=this._allData[l].to,m=this._allData[a].to.indexOf(n);if(m===-1)throw new Error("The Value object doesn't have the current Node in it's 'to' property ");this._allData[a].to.splice(m,1),this._allData[l]._to=[];const y=this._allOutputIndices.indexOf(l);if(y!==-1&&(this._allOutputIndices[y]=a),d&&d.length>0)for(const _ of d){const v=this._nodes[_].inputs.indexOf(l);if(v===-1)throw new Error("The Node object doesn't have the output Value in it's 'inputs' property ");this._nodes[_].inputs[v]=a,this._allData[a].to.push(_)}}removeAllDropoutNodes(){let n=0;for(const r of this._nodes){if(r.opType==="Dropout"){if(r.inputs.length!==1)throw new Error("Dropout nodes should only contain one input. ");if(r.outputs.length!==1&&r.outputs.length!==2)throw new Error("Dropout nodes should contain either 1 or 2 output(s)");if(r.outputs.length===2&&this._allData[r.outputs[1]]._to.length!==0)throw new Error("Dropout nodes's second output should not be referenced by other nodes");this.deleteNode(n)}n++}}removeAllIdentityNodes(){let n=0;for(const r of this._nodes)r.opType==="Identity"&&this.deleteNode(n),n++}isActivation(n){switch(n.opType){case"Relu":case"Sigmoid":case"Clip":return!0;default:return!1}}fuseConvActivationNodes(){for(const n of this._nodes)if(n.opType==="Conv"){const r=this._allData[n.outputs[0]]._to;if(r.length===1&&this.isActivation(this._nodes[r[0]])){const a=this._nodes[r[0]];if(a.opType==="Clip")if(a.inputs.length===1)try{n.attributes.set("activation_params","floats",[a.attributes.getFloat("min"),a.attributes.getFloat("max")])}catch{n.attributes.set("activation_params","floats",[c.MIN_CLIP,c.MAX_CLIP])}else{if(!(a.inputs.length>=3&&this._allData[a.inputs[1]].tensor!==void 0&&this._allData[a.inputs[2]].tensor!==void 0))continue;n.attributes.set("activation_params","floats",[this._allData[a.inputs[1]].tensor.floatData[0],this._allData[a.inputs[2]].tensor.floatData[0]])}n.attributes.set("activation","string",a.opType),this.deleteNode(r[0])}}}}},6231:(D,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.now=u.Profiler=u.Logger=void 0;const b={verbose:1e3,info:2e3,warning:4e3,error:5e3,fatal:6e3},g={none:new class{log(i,t,e){}},console:new class{log(i,t,e){console.log(`${this.color(i)} ${e?"\x1B[35m"+e+"\x1B[0m ":""}${t}`)}color(i){switch(i){case"verbose":return"\x1B[34;40mv\x1B[0m";case"info":return"\x1B[32mi\x1B[0m";case"warning":return"\x1B[30;43mw\x1B[0m";case"error":return"\x1B[31;40me\x1B[0m";case"fatal":return"\x1B[101mf\x1B[0m";default:throw new Error(`unsupported severity: ${i}`)}}}},p={provider:"console",minimalSeverity:"warning",logDateTime:!0,logSourceLocation:!1};let h={"":p};function o(i,t,e,n){if(t===void 0)return r=i,{verbose:o.verbose.bind(null,r),info:o.info.bind(null,r),warning:o.warning.bind(null,r),error:o.error.bind(null,r),fatal:o.fatal.bind(null,r)};if(e===void 0)c(i,t);else if(typeof e=="number"&&n===void 0)c(i,t);else if(typeof e=="string"&&n===void 0)c(i,e,0,t);else{if(typeof e!="string"||typeof n!="number")throw new TypeError("input is valid");c(i,e,0,t)}var r}function c(i,t,e,n){const r=h[n||""]||h[""];b[i]{l.then(async y=>{r&&await r.end(),d(y)},async y=>{r&&await r.end(),m(y)})});if(!a&&r){const d=r.end();if(d&&typeof d.then=="function")return new Promise((m,y)=>{d.then(()=>{m(l)},_=>{y(_)})})}return l}begin(i,t,e){if(!this._started)throw new Error("profiler is not started yet");if(e===void 0){const n=(0,u.now)();return this.flush(n),new f(i,t,n,r=>this.endSync(r))}{const n=e.beginTimer();return new f(i,t,0,async r=>this.end(r),n,e)}}async end(i){const t=await i.checkTimer();this._timingEvents.length=this._flushBatchSize||i-this._flushTime>=this._flushIntervalInMilliseconds){for(const t=this._flushPointer;this._flushPointerperformance.now():Date.now},2644:(D,u,b)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.Model=void 0;const g=b(5686),p=b(1446),h=b(7070),o=b(9395),c=b(2517);var f=o.onnxruntime.experimental.fbs;u.Model=class{constructor(){}load(s,i,t){if(!t)try{return void this.loadFromOnnxFormat(s,i)}catch(e){if(t!==void 0)throw e}this.loadFromOrtFormat(s,i)}loadFromOnnxFormat(s,i){const t=p.onnx.ModelProto.decode(s);if(c.LongUtil.longToNumber(t.irVersion)<3)throw new Error("only support ONNX model with IR_VERSION>=3");this._opsets=t.opsetImport.map(e=>({domain:e.domain,version:c.LongUtil.longToNumber(e.version)})),this._graph=h.Graph.from(t.graph,i)}loadFromOrtFormat(s,i){const t=new g.flatbuffers.ByteBuffer(s),e=f.InferenceSession.getRootAsInferenceSession(t).model();if(c.LongUtil.longToNumber(e.irVersion())<3)throw new Error("only support ONNX model with IR_VERSION>=3");this._opsets=[];for(let n=0;n{Object.defineProperty(u,"__esModule",{value:!0}),u.FLOAT_TYPES=u.INT_TYPES=u.NUMBER_TYPES=void 0,u.NUMBER_TYPES=["float32","float64","int32","int16","int8","uint16","uint32","uint8"],u.INT_TYPES=["int32","int16","int8","uint16","uint32","uint8"],u.FLOAT_TYPES=["float32","float64"]},1047:(D,u)=>{function b(g,p){if(p.endsWith("+")){const h=Number.parseInt(p.substring(0,p.length-1),10);return!isNaN(h)&&h<=g}if(p.split("-").length===2){const h=p.split("-"),o=Number.parseInt(h[0],10),c=Number.parseInt(h[1],10);return!isNaN(o)&&!isNaN(c)&&o<=g&&g<=c}return Number.parseInt(p,10)===g}Object.defineProperty(u,"__esModule",{value:!0}),u.resolveOperator=void 0,u.resolveOperator=function(g,p,h){for(const o of h){const c=o[0],f=o[1],s=o[2],i=o[3],t=o[4];if(g.opType===c){for(const e of p)if((e.domain===f||e.domain==="ai.onnx"&&f==="")&&b(e.version,s))return{opImpl:i,opInit:t}}}throw new TypeError(`cannot resolve operator '${g.opType}' with opsets: ${p.map(o=>`${o.domain||"ai.onnx"} v${o.version}`).join(", ")}`)}},9395:(D,u,b)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.onnxruntime=void 0;const g=b(5686);var p,h;p=u.onnxruntime||(u.onnxruntime={}),function(o){(function(c){c[c.UNDEFINED=0]="UNDEFINED",c[c.FLOAT=1]="FLOAT",c[c.INT=2]="INT",c[c.STRING=3]="STRING",c[c.TENSOR=4]="TENSOR",c[c.GRAPH=5]="GRAPH",c[c.FLOATS=6]="FLOATS",c[c.INTS=7]="INTS",c[c.STRINGS=8]="STRINGS",c[c.TENSORS=9]="TENSORS",c[c.GRAPHS=10]="GRAPHS",c[c.SPARSE_TENSOR=11]="SPARSE_TENSOR",c[c.SPARSE_TENSORS=12]="SPARSE_TENSORS"})(o.AttributeType||(o.AttributeType={}))}((h=p.experimental||(p.experimental={})).fbs||(h.fbs={})),function(o){(function(c){(function(f){(function(s){s[s.UNKNOWN=0]="UNKNOWN",s[s.VALUE=1]="VALUE",s[s.PARAM=2]="PARAM"})(f.DimensionValueType||(f.DimensionValueType={}))})(c.fbs||(c.fbs={}))})(o.experimental||(o.experimental={}))}(u.onnxruntime||(u.onnxruntime={})),function(o){(function(c){(function(f){(function(s){s[s.UNDEFINED=0]="UNDEFINED",s[s.FLOAT=1]="FLOAT",s[s.UINT8=2]="UINT8",s[s.INT8=3]="INT8",s[s.UINT16=4]="UINT16",s[s.INT16=5]="INT16",s[s.INT32=6]="INT32",s[s.INT64=7]="INT64",s[s.STRING=8]="STRING",s[s.BOOL=9]="BOOL",s[s.FLOAT16=10]="FLOAT16",s[s.DOUBLE=11]="DOUBLE",s[s.UINT32=12]="UINT32",s[s.UINT64=13]="UINT64",s[s.COMPLEX64=14]="COMPLEX64",s[s.COMPLEX128=15]="COMPLEX128",s[s.BFLOAT16=16]="BFLOAT16"})(f.TensorDataType||(f.TensorDataType={}))})(c.fbs||(c.fbs={}))})(o.experimental||(o.experimental={}))}(u.onnxruntime||(u.onnxruntime={})),function(o){(function(c){(function(f){(function(s){s[s.Primitive=0]="Primitive",s[s.Fused=1]="Fused"})(f.NodeType||(f.NodeType={}))})(c.fbs||(c.fbs={}))})(o.experimental||(o.experimental={}))}(u.onnxruntime||(u.onnxruntime={})),function(o){(function(c){(function(f){(function(s){s[s.NONE=0]="NONE",s[s.tensor_type=1]="tensor_type",s[s.sequence_type=2]="sequence_type",s[s.map_type=3]="map_type"})(f.TypeInfoValue||(f.TypeInfoValue={}))})(c.fbs||(c.fbs={}))})(o.experimental||(o.experimental={}))}(u.onnxruntime||(u.onnxruntime={})),function(o){(function(c){(function(f){class s{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsShape(t,e){return(e||new s).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsShape(t,e){return t.setPosition(t.position()+g.flatbuffers.SIZE_PREFIX_LENGTH),(e||new s).__init(t.readInt32(t.position())+t.position(),t)}dim(t,e){let n=this.bb.__offset(this.bb_pos,4);return n?(e||new o.experimental.fbs.Dimension).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+4*t),this.bb):null}dimLength(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__vector_len(this.bb_pos+t):0}static startShape(t){t.startObject(1)}static addDim(t,e){t.addFieldOffset(0,e,0)}static createDimVector(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 startDimVector(t,e){t.startVector(4,e,4)}static endShape(t){return t.endObject()}static createShape(t,e){return s.startShape(t),s.addDim(t,e),s.endShape(t)}}f.Shape=s})(c.fbs||(c.fbs={}))})(o.experimental||(o.experimental={}))}(u.onnxruntime||(u.onnxruntime={})),function(o){(function(c){(function(f){class s{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsDimension(t,e){return(e||new s).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDimension(t,e){return t.setPosition(t.position()+g.flatbuffers.SIZE_PREFIX_LENGTH),(e||new s).__init(t.readInt32(t.position())+t.position(),t)}value(t){let e=this.bb.__offset(this.bb_pos,4);return e?(t||new o.experimental.fbs.DimensionValue).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}denotation(t){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__string(this.bb_pos+e,t):null}static startDimension(t){t.startObject(2)}static addValue(t,e){t.addFieldOffset(0,e,0)}static addDenotation(t,e){t.addFieldOffset(1,e,0)}static endDimension(t){return t.endObject()}static createDimension(t,e,n){return s.startDimension(t),s.addValue(t,e),s.addDenotation(t,n),s.endDimension(t)}}f.Dimension=s})(c.fbs||(c.fbs={}))})(o.experimental||(o.experimental={}))}(u.onnxruntime||(u.onnxruntime={})),function(o){(function(c){(function(f){class s{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsDimensionValue(t,e){return(e||new s).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDimensionValue(t,e){return t.setPosition(t.position()+g.flatbuffers.SIZE_PREFIX_LENGTH),(e||new s).__init(t.readInt32(t.position())+t.position(),t)}dimType(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt8(this.bb_pos+t):o.experimental.fbs.DimensionValueType.UNKNOWN}dimValue(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt64(this.bb_pos+t):this.bb.createLong(0,0)}dimParam(t){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__string(this.bb_pos+e,t):null}static startDimensionValue(t){t.startObject(3)}static addDimType(t,e){t.addFieldInt8(0,e,o.experimental.fbs.DimensionValueType.UNKNOWN)}static addDimValue(t,e){t.addFieldInt64(1,e,t.createLong(0,0))}static addDimParam(t,e){t.addFieldOffset(2,e,0)}static endDimensionValue(t){return t.endObject()}static createDimensionValue(t,e,n,r){return s.startDimensionValue(t),s.addDimType(t,e),s.addDimValue(t,n),s.addDimParam(t,r),s.endDimensionValue(t)}}f.DimensionValue=s})(c.fbs||(c.fbs={}))})(o.experimental||(o.experimental={}))}(u.onnxruntime||(u.onnxruntime={})),function(o){(function(c){(function(f){class s{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsTensorTypeAndShape(t,e){return(e||new s).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsTensorTypeAndShape(t,e){return t.setPosition(t.position()+g.flatbuffers.SIZE_PREFIX_LENGTH),(e||new s).__init(t.readInt32(t.position())+t.position(),t)}elemType(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt32(this.bb_pos+t):o.experimental.fbs.TensorDataType.UNDEFINED}shape(t){let e=this.bb.__offset(this.bb_pos,6);return e?(t||new o.experimental.fbs.Shape).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}static startTensorTypeAndShape(t){t.startObject(2)}static addElemType(t,e){t.addFieldInt32(0,e,o.experimental.fbs.TensorDataType.UNDEFINED)}static addShape(t,e){t.addFieldOffset(1,e,0)}static endTensorTypeAndShape(t){return t.endObject()}static createTensorTypeAndShape(t,e,n){return s.startTensorTypeAndShape(t),s.addElemType(t,e),s.addShape(t,n),s.endTensorTypeAndShape(t)}}f.TensorTypeAndShape=s})(c.fbs||(c.fbs={}))})(o.experimental||(o.experimental={}))}(u.onnxruntime||(u.onnxruntime={})),function(o){(function(c){(function(f){class s{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsMapType(t,e){return(e||new s).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsMapType(t,e){return t.setPosition(t.position()+g.flatbuffers.SIZE_PREFIX_LENGTH),(e||new s).__init(t.readInt32(t.position())+t.position(),t)}keyType(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt32(this.bb_pos+t):o.experimental.fbs.TensorDataType.UNDEFINED}valueType(t){let e=this.bb.__offset(this.bb_pos,6);return e?(t||new o.experimental.fbs.TypeInfo).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}static startMapType(t){t.startObject(2)}static addKeyType(t,e){t.addFieldInt32(0,e,o.experimental.fbs.TensorDataType.UNDEFINED)}static addValueType(t,e){t.addFieldOffset(1,e,0)}static endMapType(t){return t.endObject()}static createMapType(t,e,n){return s.startMapType(t),s.addKeyType(t,e),s.addValueType(t,n),s.endMapType(t)}}f.MapType=s})(c.fbs||(c.fbs={}))})(o.experimental||(o.experimental={}))}(u.onnxruntime||(u.onnxruntime={})),function(o){(function(c){(function(f){class s{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsSequenceType(t,e){return(e||new s).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsSequenceType(t,e){return t.setPosition(t.position()+g.flatbuffers.SIZE_PREFIX_LENGTH),(e||new s).__init(t.readInt32(t.position())+t.position(),t)}elemType(t){let e=this.bb.__offset(this.bb_pos,4);return e?(t||new o.experimental.fbs.TypeInfo).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}static startSequenceType(t){t.startObject(1)}static addElemType(t,e){t.addFieldOffset(0,e,0)}static endSequenceType(t){return t.endObject()}static createSequenceType(t,e){return s.startSequenceType(t),s.addElemType(t,e),s.endSequenceType(t)}}f.SequenceType=s})(c.fbs||(c.fbs={}))})(o.experimental||(o.experimental={}))}(u.onnxruntime||(u.onnxruntime={})),function(o){(function(c){(c.fbs||(c.fbs={})).EdgeEnd=class{constructor(){this.bb=null,this.bb_pos=0}__init(f,s){return this.bb_pos=f,this.bb=s,this}nodeIndex(){return this.bb.readUint32(this.bb_pos)}srcArgIndex(){return this.bb.readInt32(this.bb_pos+4)}dstArgIndex(){return this.bb.readInt32(this.bb_pos+8)}static createEdgeEnd(f,s,i,t){return f.prep(4,12),f.writeInt32(t),f.writeInt32(i),f.writeInt32(s),f.offset()}}})(o.experimental||(o.experimental={}))}(u.onnxruntime||(u.onnxruntime={})),function(o){(function(c){(function(f){class s{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsNodeEdge(t,e){return(e||new s).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsNodeEdge(t,e){return t.setPosition(t.position()+g.flatbuffers.SIZE_PREFIX_LENGTH),(e||new s).__init(t.readInt32(t.position())+t.position(),t)}nodeIndex(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readUint32(this.bb_pos+t):0}inputEdges(t,e){let n=this.bb.__offset(this.bb_pos,6);return n?(e||new o.experimental.fbs.EdgeEnd).__init(this.bb.__vector(this.bb_pos+n)+12*t,this.bb):null}inputEdgesLength(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}outputEdges(t,e){let n=this.bb.__offset(this.bb_pos,8);return n?(e||new o.experimental.fbs.EdgeEnd).__init(this.bb.__vector(this.bb_pos+n)+12*t,this.bb):null}outputEdgesLength(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}static startNodeEdge(t){t.startObject(3)}static addNodeIndex(t,e){t.addFieldInt32(0,e,0)}static addInputEdges(t,e){t.addFieldOffset(1,e,0)}static startInputEdgesVector(t,e){t.startVector(12,e,4)}static addOutputEdges(t,e){t.addFieldOffset(2,e,0)}static startOutputEdgesVector(t,e){t.startVector(12,e,4)}static endNodeEdge(t){return t.endObject()}static createNodeEdge(t,e,n,r){return s.startNodeEdge(t),s.addNodeIndex(t,e),s.addInputEdges(t,n),s.addOutputEdges(t,r),s.endNodeEdge(t)}}f.NodeEdge=s})(c.fbs||(c.fbs={}))})(o.experimental||(o.experimental={}))}(u.onnxruntime||(u.onnxruntime={})),function(o){(function(c){(function(f){class s{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsNode(t,e){return(e||new s).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsNode(t,e){return t.setPosition(t.position()+g.flatbuffers.SIZE_PREFIX_LENGTH),(e||new s).__init(t.readInt32(t.position())+t.position(),t)}name(t){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}docString(t){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__string(this.bb_pos+e,t):null}domain(t){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__string(this.bb_pos+e,t):null}sinceVersion(){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readInt32(this.bb_pos+t):0}index(){let t=this.bb.__offset(this.bb_pos,12);return t?this.bb.readUint32(this.bb_pos+t):0}opType(t){let e=this.bb.__offset(this.bb_pos,14);return e?this.bb.__string(this.bb_pos+e,t):null}type(){let t=this.bb.__offset(this.bb_pos,16);return t?this.bb.readInt32(this.bb_pos+t):o.experimental.fbs.NodeType.Primitive}executionProviderType(t){let e=this.bb.__offset(this.bb_pos,18);return e?this.bb.__string(this.bb_pos+e,t):null}inputs(t,e){let n=this.bb.__offset(this.bb_pos,20);return n?this.bb.__string(this.bb.__vector(this.bb_pos+n)+4*t,e):null}inputsLength(){let t=this.bb.__offset(this.bb_pos,20);return t?this.bb.__vector_len(this.bb_pos+t):0}outputs(t,e){let n=this.bb.__offset(this.bb_pos,22);return n?this.bb.__string(this.bb.__vector(this.bb_pos+n)+4*t,e):null}outputsLength(){let t=this.bb.__offset(this.bb_pos,22);return t?this.bb.__vector_len(this.bb_pos+t):0}attributes(t,e){let n=this.bb.__offset(this.bb_pos,24);return n?(e||new o.experimental.fbs.Attribute).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+4*t),this.bb):null}attributesLength(){let t=this.bb.__offset(this.bb_pos,24);return t?this.bb.__vector_len(this.bb_pos+t):0}inputArgCounts(t){let e=this.bb.__offset(this.bb_pos,26);return e?this.bb.readInt32(this.bb.__vector(this.bb_pos+e)+4*t):0}inputArgCountsLength(){let t=this.bb.__offset(this.bb_pos,26);return t?this.bb.__vector_len(this.bb_pos+t):0}inputArgCountsArray(){let t=this.bb.__offset(this.bb_pos,26);return t?new Int32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}implicitInputs(t,e){let n=this.bb.__offset(this.bb_pos,28);return n?this.bb.__string(this.bb.__vector(this.bb_pos+n)+4*t,e):null}implicitInputsLength(){let t=this.bb.__offset(this.bb_pos,28);return t?this.bb.__vector_len(this.bb_pos+t):0}static startNode(t){t.startObject(13)}static addName(t,e){t.addFieldOffset(0,e,0)}static addDocString(t,e){t.addFieldOffset(1,e,0)}static addDomain(t,e){t.addFieldOffset(2,e,0)}static addSinceVersion(t,e){t.addFieldInt32(3,e,0)}static addIndex(t,e){t.addFieldInt32(4,e,0)}static addOpType(t,e){t.addFieldOffset(5,e,0)}static addType(t,e){t.addFieldInt32(6,e,o.experimental.fbs.NodeType.Primitive)}static addExecutionProviderType(t,e){t.addFieldOffset(7,e,0)}static addInputs(t,e){t.addFieldOffset(8,e,0)}static createInputsVector(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 startInputsVector(t,e){t.startVector(4,e,4)}static addOutputs(t,e){t.addFieldOffset(9,e,0)}static createOutputsVector(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 startOutputsVector(t,e){t.startVector(4,e,4)}static addAttributes(t,e){t.addFieldOffset(10,e,0)}static createAttributesVector(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 startAttributesVector(t,e){t.startVector(4,e,4)}static addInputArgCounts(t,e){t.addFieldOffset(11,e,0)}static createInputArgCountsVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addInt32(e[n]);return t.endVector()}static startInputArgCountsVector(t,e){t.startVector(4,e,4)}static addImplicitInputs(t,e){t.addFieldOffset(12,e,0)}static createImplicitInputsVector(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 startImplicitInputsVector(t,e){t.startVector(4,e,4)}static endNode(t){return t.endObject()}static createNode(t,e,n,r,a,l,d,m,y,_,v,T,S,O){return s.startNode(t),s.addName(t,e),s.addDocString(t,n),s.addDomain(t,r),s.addSinceVersion(t,a),s.addIndex(t,l),s.addOpType(t,d),s.addType(t,m),s.addExecutionProviderType(t,y),s.addInputs(t,_),s.addOutputs(t,v),s.addAttributes(t,T),s.addInputArgCounts(t,S),s.addImplicitInputs(t,O),s.endNode(t)}}f.Node=s})(c.fbs||(c.fbs={}))})(o.experimental||(o.experimental={}))}(u.onnxruntime||(u.onnxruntime={})),function(o){(function(c){(function(f){class s{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsValueInfo(t,e){return(e||new s).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsValueInfo(t,e){return t.setPosition(t.position()+g.flatbuffers.SIZE_PREFIX_LENGTH),(e||new s).__init(t.readInt32(t.position())+t.position(),t)}name(t){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}docString(t){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__string(this.bb_pos+e,t):null}type(t){let e=this.bb.__offset(this.bb_pos,8);return e?(t||new o.experimental.fbs.TypeInfo).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}static startValueInfo(t){t.startObject(3)}static addName(t,e){t.addFieldOffset(0,e,0)}static addDocString(t,e){t.addFieldOffset(1,e,0)}static addType(t,e){t.addFieldOffset(2,e,0)}static endValueInfo(t){return t.endObject()}static createValueInfo(t,e,n,r){return s.startValueInfo(t),s.addName(t,e),s.addDocString(t,n),s.addType(t,r),s.endValueInfo(t)}}f.ValueInfo=s})(c.fbs||(c.fbs={}))})(o.experimental||(o.experimental={}))}(u.onnxruntime||(u.onnxruntime={})),function(o){(function(c){(function(f){class s{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsTypeInfo(t,e){return(e||new s).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsTypeInfo(t,e){return t.setPosition(t.position()+g.flatbuffers.SIZE_PREFIX_LENGTH),(e||new s).__init(t.readInt32(t.position())+t.position(),t)}denotation(t){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}valueType(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readUint8(this.bb_pos+t):o.experimental.fbs.TypeInfoValue.NONE}value(t){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__union(t,this.bb_pos+e):null}static startTypeInfo(t){t.startObject(3)}static addDenotation(t,e){t.addFieldOffset(0,e,0)}static addValueType(t,e){t.addFieldInt8(1,e,o.experimental.fbs.TypeInfoValue.NONE)}static addValue(t,e){t.addFieldOffset(2,e,0)}static endTypeInfo(t){return t.endObject()}static createTypeInfo(t,e,n,r){return s.startTypeInfo(t),s.addDenotation(t,e),s.addValueType(t,n),s.addValue(t,r),s.endTypeInfo(t)}}f.TypeInfo=s})(c.fbs||(c.fbs={}))})(o.experimental||(o.experimental={}))}(u.onnxruntime||(u.onnxruntime={})),function(o){(function(c){(function(f){class s{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsOperatorSetId(t,e){return(e||new s).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsOperatorSetId(t,e){return t.setPosition(t.position()+g.flatbuffers.SIZE_PREFIX_LENGTH),(e||new s).__init(t.readInt32(t.position())+t.position(),t)}domain(t){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}version(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt64(this.bb_pos+t):this.bb.createLong(0,0)}static startOperatorSetId(t){t.startObject(2)}static addDomain(t,e){t.addFieldOffset(0,e,0)}static addVersion(t,e){t.addFieldInt64(1,e,t.createLong(0,0))}static endOperatorSetId(t){return t.endObject()}static createOperatorSetId(t,e,n){return s.startOperatorSetId(t),s.addDomain(t,e),s.addVersion(t,n),s.endOperatorSetId(t)}}f.OperatorSetId=s})(c.fbs||(c.fbs={}))})(o.experimental||(o.experimental={}))}(u.onnxruntime||(u.onnxruntime={})),function(o){(function(c){(function(f){class s{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsTensor(t,e){return(e||new s).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsTensor(t,e){return t.setPosition(t.position()+g.flatbuffers.SIZE_PREFIX_LENGTH),(e||new s).__init(t.readInt32(t.position())+t.position(),t)}name(t){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}docString(t){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__string(this.bb_pos+e,t):null}dims(t){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.readInt64(this.bb.__vector(this.bb_pos+e)+8*t):this.bb.createLong(0,0)}dimsLength(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}dataType(){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readInt32(this.bb_pos+t):o.experimental.fbs.TensorDataType.UNDEFINED}rawData(t){let e=this.bb.__offset(this.bb_pos,12);return e?this.bb.readUint8(this.bb.__vector(this.bb_pos+e)+t):0}rawDataLength(){let t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__vector_len(this.bb_pos+t):0}rawDataArray(){let t=this.bb.__offset(this.bb_pos,12);return t?new Uint8Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}stringData(t,e){let n=this.bb.__offset(this.bb_pos,14);return n?this.bb.__string(this.bb.__vector(this.bb_pos+n)+4*t,e):null}stringDataLength(){let t=this.bb.__offset(this.bb_pos,14);return t?this.bb.__vector_len(this.bb_pos+t):0}static startTensor(t){t.startObject(6)}static addName(t,e){t.addFieldOffset(0,e,0)}static addDocString(t,e){t.addFieldOffset(1,e,0)}static addDims(t,e){t.addFieldOffset(2,e,0)}static createDimsVector(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 startDimsVector(t,e){t.startVector(8,e,8)}static addDataType(t,e){t.addFieldInt32(3,e,o.experimental.fbs.TensorDataType.UNDEFINED)}static addRawData(t,e){t.addFieldOffset(4,e,0)}static createRawDataVector(t,e){t.startVector(1,e.length,1);for(let n=e.length-1;n>=0;n--)t.addInt8(e[n]);return t.endVector()}static startRawDataVector(t,e){t.startVector(1,e,1)}static addStringData(t,e){t.addFieldOffset(5,e,0)}static createStringDataVector(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 startStringDataVector(t,e){t.startVector(4,e,4)}static endTensor(t){return t.endObject()}static createTensor(t,e,n,r,a,l,d){return s.startTensor(t),s.addName(t,e),s.addDocString(t,n),s.addDims(t,r),s.addDataType(t,a),s.addRawData(t,l),s.addStringData(t,d),s.endTensor(t)}}f.Tensor=s})(c.fbs||(c.fbs={}))})(o.experimental||(o.experimental={}))}(u.onnxruntime||(u.onnxruntime={})),function(o){(function(c){(function(f){class s{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsSparseTensor(t,e){return(e||new s).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsSparseTensor(t,e){return t.setPosition(t.position()+g.flatbuffers.SIZE_PREFIX_LENGTH),(e||new s).__init(t.readInt32(t.position())+t.position(),t)}values(t){let e=this.bb.__offset(this.bb_pos,4);return e?(t||new o.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}indices(t){let e=this.bb.__offset(this.bb_pos,6);return e?(t||new o.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}dims(t){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.readInt64(this.bb.__vector(this.bb_pos+e)+8*t):this.bb.createLong(0,0)}dimsLength(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}static startSparseTensor(t){t.startObject(3)}static addValues(t,e){t.addFieldOffset(0,e,0)}static addIndices(t,e){t.addFieldOffset(1,e,0)}static addDims(t,e){t.addFieldOffset(2,e,0)}static createDimsVector(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 startDimsVector(t,e){t.startVector(8,e,8)}static endSparseTensor(t){return t.endObject()}static createSparseTensor(t,e,n,r){return s.startSparseTensor(t),s.addValues(t,e),s.addIndices(t,n),s.addDims(t,r),s.endSparseTensor(t)}}f.SparseTensor=s})(c.fbs||(c.fbs={}))})(o.experimental||(o.experimental={}))}(u.onnxruntime||(u.onnxruntime={})),function(o){(function(c){(function(f){class s{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsAttribute(t,e){return(e||new s).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsAttribute(t,e){return t.setPosition(t.position()+g.flatbuffers.SIZE_PREFIX_LENGTH),(e||new s).__init(t.readInt32(t.position())+t.position(),t)}name(t){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}docString(t){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__string(this.bb_pos+e,t):null}type(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.readInt32(this.bb_pos+t):o.experimental.fbs.AttributeType.UNDEFINED}f(){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readFloat32(this.bb_pos+t):0}i(){let t=this.bb.__offset(this.bb_pos,12);return t?this.bb.readInt64(this.bb_pos+t):this.bb.createLong(0,0)}s(t){let e=this.bb.__offset(this.bb_pos,14);return e?this.bb.__string(this.bb_pos+e,t):null}t(t){let e=this.bb.__offset(this.bb_pos,16);return e?(t||new o.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}g(t){let e=this.bb.__offset(this.bb_pos,18);return e?(t||new o.experimental.fbs.Graph).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}floats(t){let e=this.bb.__offset(this.bb_pos,20);return e?this.bb.readFloat32(this.bb.__vector(this.bb_pos+e)+4*t):0}floatsLength(){let t=this.bb.__offset(this.bb_pos,20);return t?this.bb.__vector_len(this.bb_pos+t):0}floatsArray(){let t=this.bb.__offset(this.bb_pos,20);return t?new Float32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}ints(t){let e=this.bb.__offset(this.bb_pos,22);return e?this.bb.readInt64(this.bb.__vector(this.bb_pos+e)+8*t):this.bb.createLong(0,0)}intsLength(){let t=this.bb.__offset(this.bb_pos,22);return t?this.bb.__vector_len(this.bb_pos+t):0}strings(t,e){let n=this.bb.__offset(this.bb_pos,24);return n?this.bb.__string(this.bb.__vector(this.bb_pos+n)+4*t,e):null}stringsLength(){let t=this.bb.__offset(this.bb_pos,24);return t?this.bb.__vector_len(this.bb_pos+t):0}tensors(t,e){let n=this.bb.__offset(this.bb_pos,26);return n?(e||new o.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+4*t),this.bb):null}tensorsLength(){let t=this.bb.__offset(this.bb_pos,26);return t?this.bb.__vector_len(this.bb_pos+t):0}graphs(t,e){let n=this.bb.__offset(this.bb_pos,28);return n?(e||new o.experimental.fbs.Graph).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+4*t),this.bb):null}graphsLength(){let t=this.bb.__offset(this.bb_pos,28);return t?this.bb.__vector_len(this.bb_pos+t):0}static startAttribute(t){t.startObject(13)}static addName(t,e){t.addFieldOffset(0,e,0)}static addDocString(t,e){t.addFieldOffset(1,e,0)}static addType(t,e){t.addFieldInt32(2,e,o.experimental.fbs.AttributeType.UNDEFINED)}static addF(t,e){t.addFieldFloat32(3,e,0)}static addI(t,e){t.addFieldInt64(4,e,t.createLong(0,0))}static addS(t,e){t.addFieldOffset(5,e,0)}static addT(t,e){t.addFieldOffset(6,e,0)}static addG(t,e){t.addFieldOffset(7,e,0)}static addFloats(t,e){t.addFieldOffset(8,e,0)}static createFloatsVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addFloat32(e[n]);return t.endVector()}static startFloatsVector(t,e){t.startVector(4,e,4)}static addInts(t,e){t.addFieldOffset(9,e,0)}static createIntsVector(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 startIntsVector(t,e){t.startVector(8,e,8)}static addStrings(t,e){t.addFieldOffset(10,e,0)}static createStringsVector(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 startStringsVector(t,e){t.startVector(4,e,4)}static addTensors(t,e){t.addFieldOffset(11,e,0)}static createTensorsVector(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 startTensorsVector(t,e){t.startVector(4,e,4)}static addGraphs(t,e){t.addFieldOffset(12,e,0)}static createGraphsVector(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 startGraphsVector(t,e){t.startVector(4,e,4)}static endAttribute(t){return t.endObject()}static createAttribute(t,e,n,r,a,l,d,m,y,_,v,T,S,O){return s.startAttribute(t),s.addName(t,e),s.addDocString(t,n),s.addType(t,r),s.addF(t,a),s.addI(t,l),s.addS(t,d),s.addT(t,m),s.addG(t,y),s.addFloats(t,_),s.addInts(t,v),s.addStrings(t,T),s.addTensors(t,S),s.addGraphs(t,O),s.endAttribute(t)}}f.Attribute=s})(c.fbs||(c.fbs={}))})(o.experimental||(o.experimental={}))}(u.onnxruntime||(u.onnxruntime={})),function(o){(function(c){(function(f){class s{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsGraph(t,e){return(e||new s).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsGraph(t,e){return t.setPosition(t.position()+g.flatbuffers.SIZE_PREFIX_LENGTH),(e||new s).__init(t.readInt32(t.position())+t.position(),t)}initializers(t,e){let n=this.bb.__offset(this.bb_pos,4);return n?(e||new o.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+4*t),this.bb):null}initializersLength(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__vector_len(this.bb_pos+t):0}nodeArgs(t,e){let n=this.bb.__offset(this.bb_pos,6);return n?(e||new o.experimental.fbs.ValueInfo).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+4*t),this.bb):null}nodeArgsLength(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}nodes(t,e){let n=this.bb.__offset(this.bb_pos,8);return n?(e||new o.experimental.fbs.Node).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+4*t),this.bb):null}nodesLength(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}maxNodeIndex(){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readUint32(this.bb_pos+t):0}nodeEdges(t,e){let n=this.bb.__offset(this.bb_pos,12);return n?(e||new o.experimental.fbs.NodeEdge).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+4*t),this.bb):null}nodeEdgesLength(){let t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__vector_len(this.bb_pos+t):0}inputs(t,e){let n=this.bb.__offset(this.bb_pos,14);return n?this.bb.__string(this.bb.__vector(this.bb_pos+n)+4*t,e):null}inputsLength(){let t=this.bb.__offset(this.bb_pos,14);return t?this.bb.__vector_len(this.bb_pos+t):0}outputs(t,e){let n=this.bb.__offset(this.bb_pos,16);return n?this.bb.__string(this.bb.__vector(this.bb_pos+n)+4*t,e):null}outputsLength(){let t=this.bb.__offset(this.bb_pos,16);return t?this.bb.__vector_len(this.bb_pos+t):0}sparseInitializers(t,e){let n=this.bb.__offset(this.bb_pos,18);return n?(e||new o.experimental.fbs.SparseTensor).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+4*t),this.bb):null}sparseInitializersLength(){let t=this.bb.__offset(this.bb_pos,18);return t?this.bb.__vector_len(this.bb_pos+t):0}static startGraph(t){t.startObject(8)}static addInitializers(t,e){t.addFieldOffset(0,e,0)}static createInitializersVector(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 startInitializersVector(t,e){t.startVector(4,e,4)}static addNodeArgs(t,e){t.addFieldOffset(1,e,0)}static createNodeArgsVector(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 startNodeArgsVector(t,e){t.startVector(4,e,4)}static addNodes(t,e){t.addFieldOffset(2,e,0)}static createNodesVector(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 startNodesVector(t,e){t.startVector(4,e,4)}static addMaxNodeIndex(t,e){t.addFieldInt32(3,e,0)}static addNodeEdges(t,e){t.addFieldOffset(4,e,0)}static createNodeEdgesVector(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 startNodeEdgesVector(t,e){t.startVector(4,e,4)}static addInputs(t,e){t.addFieldOffset(5,e,0)}static createInputsVector(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 startInputsVector(t,e){t.startVector(4,e,4)}static addOutputs(t,e){t.addFieldOffset(6,e,0)}static createOutputsVector(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 startOutputsVector(t,e){t.startVector(4,e,4)}static addSparseInitializers(t,e){t.addFieldOffset(7,e,0)}static createSparseInitializersVector(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 startSparseInitializersVector(t,e){t.startVector(4,e,4)}static endGraph(t){return t.endObject()}static createGraph(t,e,n,r,a,l,d,m,y){return s.startGraph(t),s.addInitializers(t,e),s.addNodeArgs(t,n),s.addNodes(t,r),s.addMaxNodeIndex(t,a),s.addNodeEdges(t,l),s.addInputs(t,d),s.addOutputs(t,m),s.addSparseInitializers(t,y),s.endGraph(t)}}f.Graph=s})(c.fbs||(c.fbs={}))})(o.experimental||(o.experimental={}))}(u.onnxruntime||(u.onnxruntime={})),function(o){(function(c){(function(f){class s{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsModel(t,e){return(e||new s).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsModel(t,e){return t.setPosition(t.position()+g.flatbuffers.SIZE_PREFIX_LENGTH),(e||new s).__init(t.readInt32(t.position())+t.position(),t)}irVersion(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt64(this.bb_pos+t):this.bb.createLong(0,0)}opsetImport(t,e){let n=this.bb.__offset(this.bb_pos,6);return n?(e||new o.experimental.fbs.OperatorSetId).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+4*t),this.bb):null}opsetImportLength(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}producerName(t){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__string(this.bb_pos+e,t):null}producerVersion(t){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.__string(this.bb_pos+e,t):null}domain(t){let e=this.bb.__offset(this.bb_pos,12);return e?this.bb.__string(this.bb_pos+e,t):null}modelVersion(){let t=this.bb.__offset(this.bb_pos,14);return t?this.bb.readInt64(this.bb_pos+t):this.bb.createLong(0,0)}docString(t){let e=this.bb.__offset(this.bb_pos,16);return e?this.bb.__string(this.bb_pos+e,t):null}graph(t){let e=this.bb.__offset(this.bb_pos,18);return e?(t||new o.experimental.fbs.Graph).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}graphDocString(t){let e=this.bb.__offset(this.bb_pos,20);return e?this.bb.__string(this.bb_pos+e,t):null}static startModel(t){t.startObject(9)}static addIrVersion(t,e){t.addFieldInt64(0,e,t.createLong(0,0))}static addOpsetImport(t,e){t.addFieldOffset(1,e,0)}static createOpsetImportVector(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 startOpsetImportVector(t,e){t.startVector(4,e,4)}static addProducerName(t,e){t.addFieldOffset(2,e,0)}static addProducerVersion(t,e){t.addFieldOffset(3,e,0)}static addDomain(t,e){t.addFieldOffset(4,e,0)}static addModelVersion(t,e){t.addFieldInt64(5,e,t.createLong(0,0))}static addDocString(t,e){t.addFieldOffset(6,e,0)}static addGraph(t,e){t.addFieldOffset(7,e,0)}static addGraphDocString(t,e){t.addFieldOffset(8,e,0)}static endModel(t){return t.endObject()}static createModel(t,e,n,r,a,l,d,m,y,_){return s.startModel(t),s.addIrVersion(t,e),s.addOpsetImport(t,n),s.addProducerName(t,r),s.addProducerVersion(t,a),s.addDomain(t,l),s.addModelVersion(t,d),s.addDocString(t,m),s.addGraph(t,y),s.addGraphDocString(t,_),s.endModel(t)}}f.Model=s})(c.fbs||(c.fbs={}))})(o.experimental||(o.experimental={}))}(u.onnxruntime||(u.onnxruntime={})),function(o){(function(c){(function(f){class s{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsKernelCreateInfos(t,e){return(e||new s).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsKernelCreateInfos(t,e){return t.setPosition(t.position()+g.flatbuffers.SIZE_PREFIX_LENGTH),(e||new s).__init(t.readInt32(t.position())+t.position(),t)}nodeIndices(t){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readUint32(this.bb.__vector(this.bb_pos+e)+4*t):0}nodeIndicesLength(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__vector_len(this.bb_pos+t):0}nodeIndicesArray(){let t=this.bb.__offset(this.bb_pos,4);return t?new Uint32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}kernelDefHashes(t){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readUint64(this.bb.__vector(this.bb_pos+e)+8*t):this.bb.createLong(0,0)}kernelDefHashesLength(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}static startKernelCreateInfos(t){t.startObject(2)}static addNodeIndices(t,e){t.addFieldOffset(0,e,0)}static createNodeIndicesVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addInt32(e[n]);return t.endVector()}static startNodeIndicesVector(t,e){t.startVector(4,e,4)}static addKernelDefHashes(t,e){t.addFieldOffset(1,e,0)}static createKernelDefHashesVector(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 startKernelDefHashesVector(t,e){t.startVector(8,e,8)}static endKernelCreateInfos(t){return t.endObject()}static createKernelCreateInfos(t,e,n){return s.startKernelCreateInfos(t),s.addNodeIndices(t,e),s.addKernelDefHashes(t,n),s.endKernelCreateInfos(t)}}f.KernelCreateInfos=s})(c.fbs||(c.fbs={}))})(o.experimental||(o.experimental={}))}(u.onnxruntime||(u.onnxruntime={})),function(o){(function(c){(function(f){class s{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsSubGraphSessionState(t,e){return(e||new s).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsSubGraphSessionState(t,e){return t.setPosition(t.position()+g.flatbuffers.SIZE_PREFIX_LENGTH),(e||new s).__init(t.readInt32(t.position())+t.position(),t)}graphId(t){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}sessionState(t){let e=this.bb.__offset(this.bb_pos,6);return e?(t||new o.experimental.fbs.SessionState).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}static startSubGraphSessionState(t){t.startObject(2)}static addGraphId(t,e){t.addFieldOffset(0,e,0)}static addSessionState(t,e){t.addFieldOffset(1,e,0)}static endSubGraphSessionState(t){let e=t.endObject();return t.requiredField(e,4),e}static createSubGraphSessionState(t,e,n){return s.startSubGraphSessionState(t),s.addGraphId(t,e),s.addSessionState(t,n),s.endSubGraphSessionState(t)}}f.SubGraphSessionState=s})(c.fbs||(c.fbs={}))})(o.experimental||(o.experimental={}))}(u.onnxruntime||(u.onnxruntime={})),function(o){(function(c){(function(f){class s{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsSessionState(t,e){return(e||new s).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsSessionState(t,e){return t.setPosition(t.position()+g.flatbuffers.SIZE_PREFIX_LENGTH),(e||new s).__init(t.readInt32(t.position())+t.position(),t)}kernels(t){let e=this.bb.__offset(this.bb_pos,4);return e?(t||new o.experimental.fbs.KernelCreateInfos).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}subGraphSessionStates(t,e){let n=this.bb.__offset(this.bb_pos,6);return n?(e||new o.experimental.fbs.SubGraphSessionState).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+4*t),this.bb):null}subGraphSessionStatesLength(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}static startSessionState(t){t.startObject(2)}static addKernels(t,e){t.addFieldOffset(0,e,0)}static addSubGraphSessionStates(t,e){t.addFieldOffset(1,e,0)}static createSubGraphSessionStatesVector(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 startSubGraphSessionStatesVector(t,e){t.startVector(4,e,4)}static endSessionState(t){return t.endObject()}static createSessionState(t,e,n){return s.startSessionState(t),s.addKernels(t,e),s.addSubGraphSessionStates(t,n),s.endSessionState(t)}}f.SessionState=s})(c.fbs||(c.fbs={}))})(o.experimental||(o.experimental={}))}(u.onnxruntime||(u.onnxruntime={})),function(o){(function(c){(function(f){class s{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsInferenceSession(t,e){return(e||new s).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsInferenceSession(t,e){return t.setPosition(t.position()+g.flatbuffers.SIZE_PREFIX_LENGTH),(e||new s).__init(t.readInt32(t.position())+t.position(),t)}static bufferHasIdentifier(t){return t.__has_identifier("ORTM")}ortVersion(t){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}model(t){let e=this.bb.__offset(this.bb_pos,6);return e?(t||new o.experimental.fbs.Model).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}sessionState(t){let e=this.bb.__offset(this.bb_pos,8);return e?(t||new o.experimental.fbs.SessionState).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}static startInferenceSession(t){t.startObject(3)}static addOrtVersion(t,e){t.addFieldOffset(0,e,0)}static addModel(t,e){t.addFieldOffset(1,e,0)}static addSessionState(t,e){t.addFieldOffset(2,e,0)}static endInferenceSession(t){return t.endObject()}static finishInferenceSessionBuffer(t,e){t.finish(e,"ORTM")}static finishSizePrefixedInferenceSessionBuffer(t,e){t.finish(e,"ORTM",!0)}static createInferenceSession(t,e,n,r){return s.startInferenceSession(t),s.addOrtVersion(t,e),s.addModel(t,n),s.addSessionState(t,r),s.endInferenceSession(t)}}f.InferenceSession=s})(c.fbs||(c.fbs={}))})(o.experimental||(o.experimental={}))}(u.onnxruntime||(u.onnxruntime={}))},7448:(D,u,b)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.OnnxjsSessionHandler=void 0;const g=b(1670),p=b(9162);u.OnnxjsSessionHandler=class{constructor(h){this.session=h,this.inputNames=this.session.inputNames,this.outputNames=this.session.outputNames}async dispose(){}async run(h,o,c){const f=new Map;for(const t in h)if(Object.hasOwnProperty.call(h,t)){const e=h[t];f.set(t,new p.Tensor(e.dims,e.type,void 0,void 0,e.data))}const s=await this.session.run(f),i={};return s.forEach((t,e)=>{i[e]=new g.Tensor(t.type,t.data,t.dims)}),i}startProfiling(){this.session.startProfiling()}endProfiling(){this.session.endProfiling()}}},6919:(D,u,b)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.Session=void 0;const g=b(7067),p=b(1296),h=b(7091),o=b(1036),c=b(6231),f=b(2644);u.Session=class{constructor(s={}){this._initialized=!1,this.backendHint=s.backendHint,this.profiler=c.Profiler.create(s.profiler),this.context={profiler:this.profiler,graphInputTypes:[],graphInputDims:[]}}get inputNames(){return this._model.graph.getInputNames()}get outputNames(){return this._model.graph.getOutputNames()}startProfiling(){this.profiler.start()}endProfiling(){this.profiler.stop()}async loadModel(s,i,t){await this.profiler.event("session","Session.loadModel",async()=>{const e=await(0,h.resolveBackend)(this.backendHint);if(this.sessionHandler=e.createSessionHandler(this.context),this._model=new f.Model,typeof s=="string"){const n=s.endsWith(".ort");if(typeof fetch>"u"){const r=await(0,p.promisify)(g.readFile)(s);this.initialize(r,n)}else{const r=await fetch(s),a=await r.arrayBuffer();this.initialize(new Uint8Array(a),n)}}else if(ArrayBuffer.isView(s))this.initialize(s);else{const n=new Uint8Array(s,i||0,t||s.byteLength);this.initialize(n)}})}initialize(s,i){if(this._initialized)throw new Error("already initialized");this.profiler.event("session","Session.initialize",()=>{const t=this.sessionHandler.transformGraph?this.sessionHandler:void 0;this._model.load(s,t,i),this.sessionHandler.onGraphInitialized&&this.sessionHandler.onGraphInitialized(this._model.graph),this.initializeOps(this._model.graph),this._executionPlan=new o.ExecutionPlan(this._model.graph,this._ops,this.profiler)}),this._initialized=!0}async run(s){if(!this._initialized)throw new Error("session not initialized yet");return this.profiler.event("session","Session.run",async()=>{const i=this.normalizeAndValidateInputs(s),t=await this._executionPlan.execute(this.sessionHandler,i);return this.createOutput(t)})}normalizeAndValidateInputs(s){const i=this._model.graph.getInputNames();if(Array.isArray(s)){if(s.length!==i.length)throw new Error(`incorrect input array length: expected ${i.length} but got ${s.length}`)}else{if(s.size!==i.length)throw new Error(`incorrect input map size: expected ${i.length} but got ${s.size}`);const t=new Array(s.size);let e=0;for(let n=0;ntypeof O=="string")))throw new TypeError("cache should be a string array");S&&(this.cache=new Array(T))}else{if(_!==void 0){const O=e(d);if(!(_ instanceof O))throw new TypeError(`cache should be type ${O.name}`)}if(S){const O=new ArrayBuffer(T*function(w){switch(w){case"bool":case"int8":case"uint8":return 1;case"int16":case"uint16":return 2;case"int32":case"uint32":case"float32":return 4;case"float64":return 8;default:throw new Error(`cannot calculate sizeof() on type ${w}`)}}(d));this.cache=function(w,I){return new(e(I))(w)}(O,d)}}}static fromProto(l){if(!l)throw new Error("cannot construct Value from an empty tensor");const d=f.ProtoUtil.tensorDataTypeFromProto(l.dataType),m=f.ProtoUtil.tensorDimsFromProto(l.dims),y=new i(m,d);if(d==="string")l.stringData.forEach((_,v)=>{y.data[v]=(0,f.decodeUtf8String)(_)});else if(l.rawData&&typeof l.rawData.byteLength=="number"&&l.rawData.byteLength>0){const _=y.data,v=new DataView(l.rawData.buffer,l.rawData.byteOffset,l.rawData.byteLength),T=t(l.dataType),S=l.rawData.byteLength/T;if(l.rawData.byteLength%T!=0)throw new Error("invalid buffer length");if(_.length!==S)throw new Error("buffer length mismatch");for(let O=0;O0){const _=y.data,v=new DataView(l.rawDataArray().buffer,l.rawDataArray().byteOffset,l.rawDataLength()),T=t(l.dataType()),S=l.rawDataLength()/T;if(l.rawDataLength()%T!=0)throw new Error("invalid buffer length");if(_.length!==S)throw new Error("buffer length mismatch");for(let O=0;O1&&I>1)return;S[T-O]=Math.max(w,I)}return S}static index(d,m){const y=new Array(m.length);return s.fillIndex(d,m,y),y}static fillIndex(d,m,y){const _=d.length-m.length;for(let v=0;v=0;J--)w[J]=B%T[J],B=Math.floor(B/T[J]);W||(s.fillIndex(w,d.dims,I),j=d.get(I)),k||(s.fillIndex(w,m.dims,R),N=m.get(R)),O.set(w,y(j,N))}}return O}}static isValidBroadcast(d,m){const y=d.length,_=m.length;if(y>_)return!1;for(let v=1;v<=y;v++)if(d[y-v]!==1&&d[y-v]!==m[_-v])return!1;return!0}static getBroadcastDims(d,m){const y=d.length,_=[];for(let v=0;v1&&S===1&&_.unshift(T)}return _}}u.BroadcastUtil=s,u.arrayCopyHelper=function(l,d,m,y,_){if(y<0||y>=d.length)throw new Error("sourceIndex out of bounds");if(m<0||m>=l.length)throw new Error("targetIndex out of bounds");if(y+_>d.length)throw new Error("source indices to be copied are outside bounds");if(m+_>l.length)throw new Error("target array is too small to hold result");for(let v=0;v<_;v++)l[m+v]=d[y+v]},u.GemmUtil=class{static getShapeOfGemmResult(l,d,m,y,_){if(l.length!==2||m.length!==2)throw new Error("shape need to be of size 2");let v,T,S;d?(v=l[1],T=l[0]):(v=l[0],T=l[1]);let O=-1;if(y?(S=m[0],O=1):(S=m[1],O=0),m[O]!==T)throw new Error("dimension mismatch");if(v<=0||S<=0||T<=0)throw new Error("invalid shape specified");if(_&&!s.isValidBroadcast(_,[v,S]))throw new Error("gemm: invalid bias shape for broadcast");return[v,S,T]}};class i{static tensorDataTypeFromProto(d){switch(d){case o.onnx.TensorProto.DataType.INT8:return"int8";case o.onnx.TensorProto.DataType.UINT8:return"uint8";case o.onnx.TensorProto.DataType.BOOL:return"bool";case o.onnx.TensorProto.DataType.INT16:return"int16";case o.onnx.TensorProto.DataType.UINT16:return"uint16";case o.onnx.TensorProto.DataType.INT32:return"int32";case o.onnx.TensorProto.DataType.UINT32:return"uint32";case o.onnx.TensorProto.DataType.FLOAT:return"float32";case o.onnx.TensorProto.DataType.DOUBLE:return"float64";case o.onnx.TensorProto.DataType.STRING:return"string";case o.onnx.TensorProto.DataType.INT64:return"int32";case o.onnx.TensorProto.DataType.UINT64:return"uint32";default:throw new Error(`unsupported data type: ${o.onnx.TensorProto.DataType[d]}`)}}static tensorDataTypeStringToEnum(d){switch(d){case"int8":return o.onnx.TensorProto.DataType.INT8;case"uint8":return o.onnx.TensorProto.DataType.UINT8;case"bool":return o.onnx.TensorProto.DataType.BOOL;case"int16":return o.onnx.TensorProto.DataType.INT16;case"uint16":return o.onnx.TensorProto.DataType.UINT16;case"int32":return o.onnx.TensorProto.DataType.INT32;case"uint32":return o.onnx.TensorProto.DataType.UINT32;case"float32":return o.onnx.TensorProto.DataType.FLOAT;case"float64":return o.onnx.TensorProto.DataType.DOUBLE;case"string":return o.onnx.TensorProto.DataType.STRING;case"int64":return o.onnx.TensorProto.DataType.INT64;case"uint64":return o.onnx.TensorProto.DataType.UINT64;default:throw new Error(`unsupported data type: ${d}`)}}static tensorDimsFromProto(d){return d.map(m=>h.default.isLong(m)?m.toNumber():m)}static tensorValueTypeFromProto(d){return{tensorType:i.tensorDataTypeFromProto(d.elemType),shape:{dims:i.tensorDimsFromProto(d.shape.dim.map(m=>m.dimValue))}}}static tensorDimsFromORTFormat(d){const m=[];for(let y=0;yd.length)throw new Error(`invalid dimension of ${m} for sizeFromDimension as Tensor has ${d.length} dimensions.`);return e.getSizeFromDimensionRange(d,m,d.length)}static sizeToDimension(d,m){if(m<0||m>d.length)throw new Error(`invalid dimension of ${m} for sizeToDimension as Tensor has ${d.length} dimensions.`);return e.getSizeFromDimensionRange(d,0,m)}static getSizeFromDimensionRange(d,m,y){let _=1;for(let v=m;v=0;--_)y[_]=y[_+1]*d[_+1];return y}static transpose(d){return d.slice().reverse()}static indicesToOffset(d,m,y){y===void 0&&(y=d.length);let _=0;for(let v=0;v=m)throw new Error("unsupported axis for this operation.");return d<0?d+m:d}static normalizeAxes(d,m){return d.map(y=>this.normalizeAxis(y,m))}static incrementIndex(d,m,y){if(m.length===0||d.length===0)throw new Error("Index incrementing unsupported for scalar Tensor");if(y===void 0)y=m.length;else if(y<=0||y>m.length)throw new Error("Incorrect axis to increment on");for(let _=y-1;_>=0&&(d[_]++,!(d[_]=d.length)throw new Error("the dimension with value zero exceeds the dimension size of the input tensor");_[O]=d[O]}else _[O]=m[O];T*=_[O]}}const S=e.size(d);if(v!==-1){if(S%T!=0)throw new Error(`the input tensor cannot be reshaped to the requested shape. Input shape: [${d}] Output shape: [${m}]`);_[v]=S/T}else if(T!==S)throw new Error("reshapedDims and originalDims don't have matching sizes");return _}static sortBasedOnPerm(d,m){return m?m.map(y=>d[y]):d.slice().reverse()}static padShape(d,m){const y=d.length;return d.map((_,v)=>_+m[v]+m[v+y])}static areEqual(d,m){return d.length===m.length&&d.every((y,_)=>y===m[_])}static validateDimsAndCalcSize(d){if(d.length>6)throw new TypeError("Only rank 0 to 6 is supported for tensor shape.");let m=1;for(const y of d){if(!Number.isInteger(y))throw new TypeError(`Invalid shape: ${y} is not an integer`);if(y<0||y>2147483647)throw new TypeError(`Invalid shape: length ${y} is not allowed`);m*=y}return m}static flattenShape(d,m){m<0&&(m+=d.length);const y=d.reduce((v,T)=>v*T,1),_=d.slice(m).reduce((v,T)=>v*T,1);return[y/_,_]}static squeezeShape(d,m){const y=new Array;m=e.normalizeAxes(m,d.length);for(let _=0;_=0;if(v&&d[_]!==1)throw new Error("squeeze an axis of size different than 1");(m.length===0&&d[_]>1||m.length>0&&!v)&&y.push(d[_])}return y}static unsqueezeShape(d,m){const y=new Array(d.length+m.length);y.fill(0);for(let v=0;v=y.length)throw new Error("'axes' has an out of range axis");if(y[T]!==0)throw new Error("'axes' has a duplicate axis");y[T]=1}let _=0;for(let v=0;v=d.length)throw new Error("sourceIndex out of bounds");if(m<0||m>=l.length)throw new Error("targetIndex out of bounds");if(y+_>d.length)throw new Error("source indices to be copied are outside bounds");if(m+_>l.length)throw new Error("target array is too small to hold result");for(let v=0;v<_;v++)l[m+v]+=Math.pow(d[y+v],2)}static axpy(l,d,m,y,_,v){if(y<0||y>=d.length)throw new Error("sourceIndex out of bounds");if(m<0||m>=l.length)throw new Error("targetIndex out of bounds");if(y+_>d.length)throw new Error("source indices to be copied are outside bounds");if(m+_>l.length)throw new Error("target array is too small to hold result");for(let T=0;T<_;T++)l[m+T]+=v*d[y+T]}static powx(l,d,m,y,_,v){if(y<0||y>=d.length)throw new Error("sourceIndex out of bounds");if(m<0||m>=l.length)throw new Error("targetIndex out of bounds");if(y+_>d.length)throw new Error("source indices to be copied are outside bounds");if(m+_>l.length)throw new Error("target array is too small to hold result");for(let T=0;T<_;T++)l[m+T]=Math.pow(d[y+T],v)}static mul(l,d,m,y,_){if(y<0||y>=d.length)throw new Error("sourceIndex out of bounds");if(m<0||m>=l.length)throw new Error("targetIndex out of bounds");if(y+_>d.length)throw new Error("source indices to be copied are outside bounds");if(m+_>l.length)throw new Error("target array is too small to hold result");for(let v=0;v<_;v++)l[m+v]=d[y+v]*l[m+v]}};class n{static splitShape(d,m,y,_){if(y.length===0){if(!_)throw new Error("need to know number of outputs when the 'split' attribute is not specified");n.determineSplit(d[m],_,y)}const v=[],T=[0];for(let S=0;Sm.push(N));const S=r.calcReduceShape(T,m,!0),O=e.size(S),w=new c.Tensor(S,d.type),I=e.computeStrides(S),R=e.computeStrides(T),B=new Array(T.length);for(let j=0;j=m.length)return T(d[v]);const w=m[_],I=w>=y.length?1:e.size(y.slice(w+1));for(let R=0;Rv!==0)}}u.ReduceUtil=r;class a{static adjustPoolAttributes(d,m,y,_,v,T){if(!d&&y.length!==m.length-2)throw new Error("length of specified kernel shapes should be 2 less than length of input dimensions");if(d)for(let S=0;S=y.length?y.push(m[S+2]):y[S]=m[S+2];for(let S=0;S=y[S]||T[S+y.length]>=y[S])throw new Error("pads should be smaller than kernel")}}static adjustPadsBasedOnAutoPad(d,m,y,_,v,T){if(T){if(v.length!==2*(d.length-2))throw new Error("length of pads should be twice the length of data dimensions");if(m.length!==d.length-2)throw new Error("length of strides should be the length of data dimensions");if(_.length!==d.length-2)throw new Error("length of kernel shapes should be the length of data dimensions");for(let S=0;S{Object.defineProperty(u,"__esModule",{value:!0}),u.iterateExtraOptions=void 0,u.iterateExtraOptions=(b,g,p,h)=>{if(typeof b=="object"&&b!==null){if(p.has(b))throw new Error("Circular reference in options");p.add(b)}Object.entries(b).forEach(([o,c])=>{const f=g?g+o:o;if(typeof c=="object")(0,u.iterateExtraOptions)(c,f+".",p,h);else if(typeof c=="string"||typeof c=="number")h(f,c.toString());else{if(typeof c!="boolean")throw new Error("Can't handle extra config type: "+typeof c);h(f,c?"1":"0")}})}},2157:function(D,u,b){var g,p=this&&this.__createBinding||(Object.create?function(I,R,B,j){j===void 0&&(j=B);var N=Object.getOwnPropertyDescriptor(R,B);N&&!("get"in N?!R.__esModule:N.writable||N.configurable)||(N={enumerable:!0,get:function(){return R[B]}}),Object.defineProperty(I,j,N)}:function(I,R,B,j){j===void 0&&(j=B),I[j]=R[B]}),h=this&&this.__setModuleDefault||(Object.create?function(I,R){Object.defineProperty(I,"default",{enumerable:!0,value:R})}:function(I,R){I.default=R}),o=this&&this.__importStar||function(I){if(I&&I.__esModule)return I;var R={};if(I!=null)for(var B in I)B!=="default"&&Object.prototype.hasOwnProperty.call(I,B)&&p(R,I,B);return h(R,I),R};Object.defineProperty(u,"__esModule",{value:!0}),u.endProfiling=u.run=u.releaseSession=u.createSession=u.createSessionFinalize=u.createSessionAllocate=u.initOrt=u.initWasm=void 0;const c=b(1670),f=o(b(349)),s=b(6361),i=()=>!!c.env.wasm.proxy&&typeof document<"u";let t,e,n,r=!1,a=!1,l=!1;const d=[],m=[],y=[],_=[],v=[],T=[],S=()=>{if(r||!a||l||!t)throw new Error("worker not ready")},O=I=>{switch(I.data.type){case"init-wasm":r=!1,I.data.err?(l=!0,e[1](I.data.err)):(a=!0,e[0]());break;case"init-ort":I.data.err?n[1](I.data.err):n[0]();break;case"create_allocate":I.data.err?d.shift()[1](I.data.err):d.shift()[0](I.data.out);break;case"create_finalize":I.data.err?m.shift()[1](I.data.err):m.shift()[0](I.data.out);break;case"create":I.data.err?y.shift()[1](I.data.err):y.shift()[0](I.data.out);break;case"release":I.data.err?_.shift()[1](I.data.err):_.shift()[0]();break;case"run":I.data.err?v.shift()[1](I.data.err):v.shift()[0](I.data.out);break;case"end-profiling":I.data.err?T.shift()[1](I.data.err):T.shift()[0]()}},w=typeof document<"u"?(g=document==null?void 0:document.currentScript)===null||g===void 0?void 0:g.src:void 0;u.initWasm=async()=>{if(i()){if(a)return;if(r)throw new Error("multiple calls to 'initWasm()' detected.");if(l)throw new Error("previous call to 'initWasm()' failed.");return r=!0,c.env.wasm.wasmPaths===void 0&&w&&w.indexOf("blob:")!==0&&(c.env.wasm.wasmPaths=w.substr(0,+w.lastIndexOf("/")+1)),new Promise((I,R)=>{t==null||t.terminate(),t=b(9710).Z(),t.onmessage=O,e=[I,R];const B={type:"init-wasm",in:c.env.wasm};t.postMessage(B)})}return(0,s.initializeWebAssembly)(c.env.wasm)},u.initOrt=async(I,R)=>{if(i())return S(),new Promise((B,j)=>{n=[B,j];const N={type:"init-ort",in:{numThreads:I,loggingLevel:R}};t.postMessage(N)});f.initOrt(I,R)},u.createSessionAllocate=async I=>i()?(S(),new Promise((R,B)=>{d.push([R,B]);const j={type:"create_allocate",in:{model:I}};t.postMessage(j,[I.buffer])})):f.createSessionAllocate(I),u.createSessionFinalize=async(I,R)=>i()?(S(),new Promise((B,j)=>{m.push([B,j]);const N={type:"create_finalize",in:{modeldata:I,options:R}};t.postMessage(N)})):f.createSessionFinalize(I,R),u.createSession=async(I,R)=>i()?(S(),new Promise((B,j)=>{y.push([B,j]);const N={type:"create",in:{model:I,options:R}};t.postMessage(N,[I.buffer])})):f.createSession(I,R),u.releaseSession=async I=>{if(i())return S(),new Promise((R,B)=>{_.push([R,B]);const j={type:"release",in:I};t.postMessage(j)});f.releaseSession(I)},u.run=async(I,R,B,j,N)=>i()?(S(),new Promise((W,k)=>{v.push([W,k]);const V={type:"run",in:{sessionId:I,inputIndices:R,inputs:B,outputIndices:j,options:N}};t.postMessage(V,f.extractTransferableBuffers(B))})):f.run(I,R,B,j,N),u.endProfiling=async I=>{if(i())return S(),new Promise((R,B)=>{T.push([R,B]);const j={type:"end-profiling",in:I};t.postMessage(j)});f.endProfiling(I)}},586:(D,u,b)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.setRunOptions=void 0;const g=b(7967),p=b(4983),h=b(6361);u.setRunOptions=o=>{const c=(0,h.getInstance)();let f=0;const s=[],i=o||{};try{if((o==null?void 0:o.logSeverityLevel)===void 0)i.logSeverityLevel=2;else if(typeof o.logSeverityLevel!="number"||!Number.isInteger(o.logSeverityLevel)||o.logSeverityLevel<0||o.logSeverityLevel>4)throw new Error(`log serverity level is not valid: ${o.logSeverityLevel}`);if((o==null?void 0:o.logVerbosityLevel)===void 0)i.logVerbosityLevel=0;else if(typeof o.logVerbosityLevel!="number"||!Number.isInteger(o.logVerbosityLevel))throw new Error(`log verbosity level is not valid: ${o.logVerbosityLevel}`);(o==null?void 0:o.terminate)===void 0&&(i.terminate=!1);let t=0;if((o==null?void 0:o.tag)!==void 0&&(t=(0,p.allocWasmString)(o.tag,s)),f=c._OrtCreateRunOptions(i.logSeverityLevel,i.logVerbosityLevel,!!i.terminate,t),f===0)throw new Error("Can't create run options");return(o==null?void 0:o.extra)!==void 0&&(0,g.iterateExtraOptions)(o.extra,"",new WeakSet,(e,n)=>{const r=(0,p.allocWasmString)(e,s),a=(0,p.allocWasmString)(n,s);if(c._OrtAddRunConfigEntry(f,r,a)!==0)throw new Error(`Can't set a run config entry: ${e} - ${n}`)}),[f,s]}catch(t){throw f!==0&&c._OrtReleaseRunOptions(f),s.forEach(c._free),t}}},2306:(D,u,b)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.OnnxruntimeWebAssemblySessionHandler=void 0;const g=b(2806),p=b(1670),h=b(2850),o=b(2157);let c;u.OnnxruntimeWebAssemblySessionHandler=class{async createSessionAllocate(f){const s=await fetch(f),i=await s.arrayBuffer();return(0,o.createSessionAllocate)(new Uint8Array(i))}async loadModel(f,s){if(c||(await(0,o.initOrt)(p.env.wasm.numThreads,(i=>{switch(i){case"verbose":return 0;case"info":return 1;case"warning":return 2;case"error":return 3;case"fatal":return 4;default:throw new Error(`unsupported logging level: ${i}`)}})(p.env.logLevel)),c=!0),typeof f=="string")if(typeof fetch>"u"){const i=await(0,h.promisify)(g.readFile)(f);[this.sessionId,this.inputNames,this.outputNames]=await(0,o.createSession)(i,s)}else{const i=await this.createSessionAllocate(f);[this.sessionId,this.inputNames,this.outputNames]=await(0,o.createSessionFinalize)(i,s)}else[this.sessionId,this.inputNames,this.outputNames]=await(0,o.createSession)(f,s)}async dispose(){return(0,o.releaseSession)(this.sessionId)}async run(f,s,i){const t=[],e=[];Object.entries(f).forEach(l=>{const d=l[0],m=l[1],y=this.inputNames.indexOf(d);if(y===-1)throw new Error(`invalid input '${d}'`);t.push(m),e.push(y)});const n=[];Object.entries(s).forEach(l=>{const d=l[0],m=this.outputNames.indexOf(d);if(m===-1)throw new Error(`invalid output '${d}'`);n.push(m)});const r=await(0,o.run)(this.sessionId,e,t.map(l=>[l.type,l.dims,l.data]),n,i),a={};for(let l=0;l{Object.defineProperty(u,"__esModule",{value:!0}),u.setSessionOptions=void 0;const g=b(7967),p=b(4983),h=b(6361);u.setSessionOptions=o=>{const c=(0,h.getInstance)();let f=0;const s=[],i=o||{};(t=>{t.extra||(t.extra={}),t.extra.session||(t.extra.session={});const e=t.extra.session;e.use_ort_model_bytes_directly||(e.use_ort_model_bytes_directly="1")})(i);try{(o==null?void 0:o.graphOptimizationLevel)===void 0&&(i.graphOptimizationLevel="all");const t=(r=>{switch(r){case"disabled":return 0;case"basic":return 1;case"extended":return 2;case"all":return 99;default:throw new Error(`unsupported graph optimization level: ${r}`)}})(i.graphOptimizationLevel);(o==null?void 0:o.enableCpuMemArena)===void 0&&(i.enableCpuMemArena=!0),(o==null?void 0:o.enableMemPattern)===void 0&&(i.enableMemPattern=!0),(o==null?void 0:o.executionMode)===void 0&&(i.executionMode="sequential");const e=(r=>{switch(r){case"sequential":return 0;case"parallel":return 1;default:throw new Error(`unsupported execution mode: ${r}`)}})(i.executionMode);let n=0;if((o==null?void 0:o.logId)!==void 0&&(n=(0,p.allocWasmString)(o.logId,s)),(o==null?void 0:o.logSeverityLevel)===void 0)i.logSeverityLevel=2;else if(typeof o.logSeverityLevel!="number"||!Number.isInteger(o.logSeverityLevel)||o.logSeverityLevel<0||o.logSeverityLevel>4)throw new Error(`log serverity level is not valid: ${o.logSeverityLevel}`);if((o==null?void 0:o.logVerbosityLevel)===void 0)i.logVerbosityLevel=0;else if(typeof o.logVerbosityLevel!="number"||!Number.isInteger(o.logVerbosityLevel))throw new Error(`log verbosity level is not valid: ${o.logVerbosityLevel}`);if((o==null?void 0:o.enableProfiling)===void 0&&(i.enableProfiling=!1),f=c._OrtCreateSessionOptions(t,!!i.enableCpuMemArena,!!i.enableMemPattern,e,!!i.enableProfiling,0,n,i.logSeverityLevel,i.logVerbosityLevel),f===0)throw new Error("Can't create session options");return o!=null&&o.executionProviders&&((r,a,l)=>{for(const d of a){let m=typeof d=="string"?d:d.name;switch(m){case"xnnpack":m="XNNPACK";break;case"wasm":case"cpu":continue;default:throw new Error(`not supported EP: ${m}`)}const y=(0,p.allocWasmString)(m,l);if((0,h.getInstance)()._OrtAppendExecutionProvider(r,y)!==0)throw new Error(`Can't append execution provider: ${m}`)}})(f,o.executionProviders,s),(o==null?void 0:o.extra)!==void 0&&(0,g.iterateExtraOptions)(o.extra,"",new WeakSet,(r,a)=>{const l=(0,p.allocWasmString)(r,s),d=(0,p.allocWasmString)(a,s);if(c._OrtAddSessionConfigEntry(f,l,d)!==0)throw new Error(`Can't set a session config entry: ${r} - ${a}`)}),[f,s]}catch(t){throw f!==0&&c._OrtReleaseSessionOptions(f),s.forEach(c._free),t}}},4983:(D,u,b)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.allocWasmString=void 0;const g=b(6361);u.allocWasmString=(p,h)=>{const o=(0,g.getInstance)(),c=o.lengthBytesUTF8(p)+1,f=o._malloc(c);return o.stringToUTF8(p,f,c),h.push(f),f}},349:(D,u,b)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.extractTransferableBuffers=u.endProfiling=u.run=u.releaseSession=u.createSession=u.createSessionFinalize=u.createSessionAllocate=u.initOrt=void 0;const g=b(586),p=b(4919),h=b(4983),o=b(6361);u.initOrt=(t,e)=>{const n=(0,o.getInstance)()._OrtInit(t,e);if(n!==0)throw new Error(`Can't initialize onnxruntime. error code = ${n}`)};const c=new Map;u.createSessionAllocate=t=>{const e=(0,o.getInstance)(),n=e._malloc(t.byteLength);return e.HEAPU8.set(t,n),[n,t.byteLength]},u.createSessionFinalize=(t,e)=>{const n=(0,o.getInstance)();let r=0,a=0,l=[];try{if([a,l]=(0,p.setSessionOptions)(e),r=n._OrtCreateSession(t[0],t[1],a),r===0)throw new Error("Can't create a session")}finally{n._free(t[0]),n._OrtReleaseSessionOptions(a),l.forEach(n._free)}const d=n._OrtGetInputCount(r),m=n._OrtGetOutputCount(r),y=[],_=[],v=[],T=[];for(let S=0;S{const n=(0,u.createSessionAllocate)(t);return(0,u.createSessionFinalize)(n,e)},u.releaseSession=t=>{const e=(0,o.getInstance)(),n=c.get(t);if(!n)throw new Error("invalid session id");const r=n[0],a=n[1],l=n[2];a.forEach(e._OrtFree),l.forEach(e._OrtFree),e._OrtReleaseSession(r),c.delete(t)};const f=t=>{switch(t){case"int8":return 3;case"uint8":return 2;case"bool":return 9;case"int16":return 5;case"uint16":return 4;case"int32":return 6;case"uint32":return 12;case"float32":return 1;case"float64":return 11;case"string":return 8;case"int64":return 7;case"uint64":return 13;default:throw new Error(`unsupported data type: ${t}`)}},s=t=>{switch(t){case 3:return"int8";case 2:return"uint8";case 9:return"bool";case 5:return"int16";case 4:return"uint16";case 6:return"int32";case 12:return"uint32";case 1:return"float32";case 11:return"float64";case 8:return"string";case 7:return"int64";case 13:return"uint64";default:throw new Error(`unsupported data type: ${t}`)}},i=t=>{switch(t){case"float32":return Float32Array;case"uint8":case"bool":return Uint8Array;case"int8":return Int8Array;case"uint16":return Uint16Array;case"int16":return Int16Array;case"int32":return Int32Array;case"float64":return Float64Array;case"uint32":return Uint32Array;case"int64":return BigInt64Array;case"uint64":return BigUint64Array;default:throw new Error(`unsupported type: ${t}`)}};u.run=(t,e,n,r,a)=>{const l=(0,o.getInstance)(),d=c.get(t);if(!d)throw new Error("invalid session id");const m=d[0],y=d[1],_=d[2],v=e.length,T=r.length;let S=0,O=[];const w=[],I=[];try{[S,O]=(0,g.setRunOptions)(a);for(let k=0;kl.HEAP32[Oe++]=xe);const le=l._OrtCreateTensor(f(V),te,ne,Pe,J.length);if(le===0)throw new Error("Can't create a tensor");w.push(le)}finally{l.stackRestore(me)}}const R=l.stackSave(),B=l.stackAlloc(4*v),j=l.stackAlloc(4*v),N=l.stackAlloc(4*T),W=l.stackAlloc(4*T);try{let k=B/4,V=j/4,J=N/4,Y=W/4;for(let me=0;mewe*je);if(xe=s(He),xe==="string"){const we=[];let je=_e/4;for(let Ue=0;Ue{const e=(0,o.getInstance)(),n=c.get(t);if(!n)throw new Error("invalid session id");const r=n[0],a=e._OrtEndProfiling(r);if(a===0)throw new Error("Can't get an profile file name");e._OrtFree(a)},u.extractTransferableBuffers=t=>{const e=[];for(const n of t){const r=n[2];!Array.isArray(r)&&r.buffer&&e.push(r.buffer)}return e}},6361:function(D,u,b){var g=this&&this.__createBinding||(Object.create?function(a,l,d,m){m===void 0&&(m=d);var y=Object.getOwnPropertyDescriptor(l,d);y&&!("get"in y?!l.__esModule:y.writable||y.configurable)||(y={enumerable:!0,get:function(){return l[d]}}),Object.defineProperty(a,m,y)}:function(a,l,d,m){m===void 0&&(m=d),a[m]=l[d]}),p=this&&this.__setModuleDefault||(Object.create?function(a,l){Object.defineProperty(a,"default",{enumerable:!0,value:l})}:function(a,l){a.default=l}),h=this&&this.__importStar||function(a){if(a&&a.__esModule)return a;var l={};if(a!=null)for(var d in a)d!=="default"&&Object.prototype.hasOwnProperty.call(a,d)&&g(l,a,d);return p(l,a),l},o=this&&this.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(u,"__esModule",{value:!0}),u.dispose=u.getInstance=u.initializeWebAssembly=void 0;const c=h(b(6449)),f=o(b(932)),s=b(3474);let i,t=!1,e=!1,n=!1;const r=(a,l)=>l?a?"ort-wasm-simd-threaded.wasm":"ort-wasm-threaded.wasm":a?"ort-wasm-simd.wasm":"ort-wasm.wasm";u.initializeWebAssembly=async a=>{if(t)return Promise.resolve();if(e)throw new Error("multiple calls to 'initializeWebAssembly()' detected.");if(n)throw new Error("previous call to 'initializeWebAssembly()' failed.");e=!0;const l=a.initTimeout,d=a.numThreads,m=a.simd,y=d>1&&(()=>{try{return typeof SharedArrayBuffer<"u"&&(typeof MessageChannel<"u"&&new MessageChannel().port1.postMessage(new SharedArrayBuffer(1)),WebAssembly.validate(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])))}catch{return!1}})(),_=m&&(()=>{try{return WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,30,1,28,0,65,0,253,15,253,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,253,186,1,26,11]))}catch{return!1}})(),v=typeof a.wasmPaths=="string"?a.wasmPaths:void 0,T=r(!1,y),S=r(_,y),O=typeof a.wasmPaths=="object"?a.wasmPaths[S]:void 0;let w=!1;const I=[];if(l>0&&I.push(new Promise(R=>{setTimeout(()=>{w=!0,R()},l)})),I.push(new Promise((R,B)=>{const j=y?s:f.default,N={locateFile:(W,k)=>y&&W.endsWith(".worker.js")&&typeof Blob<"u"?URL.createObjectURL(new Blob([b(4154)],{type:"text/javascript"})):W===T?O??(v??k)+S:k+W};if(y)if(typeof Blob>"u")N.mainScriptUrlOrBlob=c.join("/","ort-wasm-threaded.js");else{const W=`var ortWasmThreaded=(function(){var _scriptDir;return ${j.toString()}})();`;N.mainScriptUrlOrBlob=new Blob([W],{type:"text/javascript"})}j(N).then(W=>{e=!1,t=!0,i=W,R()},W=>{e=!1,n=!0,B(W)})})),await Promise.race(I),w)throw new Error(`WebAssembly backend initializing failed due to timeout: ${l}ms`)},u.getInstance=()=>{if(t&&i)return i;throw new Error("WebAssembly is not initialized yet.")},u.dispose=()=>{var a;!t||e||n||(e=!0,(a=i.PThread)===null||a===void 0||a.terminateAllThreads(),i=void 0,e=!1,t=!1,n=!0)}},9710:(D,u,b)=>{b.d(u,{Z:()=>h});var g=b(477),p=b.n(g);function h(){return p()('/*!\n* ONNX Runtime Web v1.14.0\n* Copyright (c) Microsoft Corporation. All rights reserved.\n* Licensed under the MIT License.\n*/\n(()=>{var t={474:(t,e,n)=>{var _scriptDir,r=(_scriptDir=(_scriptDir="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0)||"/index.js",function(t){function e(){return j.buffer!=D&&N(j.buffer),P}function r(){return j.buffer!=D&&N(j.buffer),U}function a(){return j.buffer!=D&&N(j.buffer),F}function i(){return j.buffer!=D&&N(j.buffer),I}function o(){return j.buffer!=D&&N(j.buffer),W}var u,c,s;t=t||{},u||(u=void 0!==t?t:{}),u.ready=new Promise((function(t,e){c=t,s=e}));var l,f,p,h,d,y,b=Object.assign({},u),m="./this.program",g=(t,e)=>{throw e},v="object"==typeof window,w="function"==typeof importScripts,_="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,O=u.ENVIRONMENT_IS_PTHREAD||!1,A="";function S(t){return u.locateFile?u.locateFile(t,A):A+t}if(_){let e;A=w?n(908).dirname(A)+"/":"//",y=()=>{d||(h=n(384),d=n(908))},l=function(t,e){return y(),t=d.normalize(t),h.readFileSync(t,e?void 0:"utf8")},p=t=>((t=l(t,!0)).buffer||(t=new Uint8Array(t)),t),f=(t,e,n)=>{y(),t=d.normalize(t),h.readFile(t,(function(t,r){t?n(t):e(r.buffer)}))},1{if(Q())throw process.exitCode=t,e;e instanceof ct||x("exiting due to exception: "+e),process.exit(t)},u.inspect=function(){return"[Emscripten Module object]"};try{e=n(925)}catch(t){throw console.error(\'The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?\'),t}n.g.Worker=e.Worker}else(v||w)&&(w?A=self.location.href:"undefined"!=typeof document&&document.currentScript&&(A=document.currentScript.src),_scriptDir&&(A=_scriptDir),A=0!==A.indexOf("blob:")?A.substr(0,A.replace(/[?#].*/,"").lastIndexOf("/")+1):"",_||(l=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.send(null),e.responseText},w&&(p=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}),f=(t,e,n)=>{var r=new XMLHttpRequest;r.open("GET",t,!0),r.responseType="arraybuffer",r.onload=()=>{200==r.status||0==r.status&&r.response?e(r.response):n()},r.onerror=n,r.send(null)}));_&&"undefined"==typeof performance&&(n.g.performance=n(953).performance);var T=console.log.bind(console),E=console.warn.bind(console);_&&(y(),T=t=>h.writeSync(1,t+"\\n"),E=t=>h.writeSync(2,t+"\\n"));var M,C=u.print||T,x=u.printErr||E;Object.assign(u,b),b=null,u.thisProgram&&(m=u.thisProgram),u.quit&&(g=u.quit),u.wasmBinary&&(M=u.wasmBinary);var R=u.noExitRuntime||!1;"object"!=typeof WebAssembly&&at("no native wasm support detected");var j,k,D,P,U,F,I,W,H=!1,L="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function z(t,e,n){var r=(e>>>=0)+n;for(n=e;t[n]&&!(n>=r);)++n;if(16(a=224==(240&a)?(15&a)<<12|i<<6|o:(7&a)<<18|i<<12|o<<6|63&t[e++])?r+=String.fromCharCode(a):(a-=65536,r+=String.fromCharCode(55296|a>>10,56320|1023&a))}}else r+=String.fromCharCode(a)}return r}function Y(t,e){return(t>>>=0)?z(r(),t,e):""}function B(t,e,n,r){if(!(0>>=0;r=n+r-1;for(var i=0;i=o&&(o=65536+((1023&o)<<10)|1023&t.charCodeAt(++i)),127>=o){if(n>=r)break;e[n++>>>0]=o}else{if(2047>=o){if(n+1>=r)break;e[n++>>>0]=192|o>>6}else{if(65535>=o){if(n+2>=r)break;e[n++>>>0]=224|o>>12}else{if(n+3>=r)break;e[n++>>>0]=240|o>>18,e[n++>>>0]=128|o>>12&63}e[n++>>>0]=128|o>>6&63}e[n++>>>0]=128|63&o}}return e[n>>>0]=0,n-a}function G(t){for(var e=0,n=0;n=r?e++:2047>=r?e+=2:55296<=r&&57343>=r?(e+=4,++n):e+=3}return e}function N(t){D=t,u.HEAP8=P=new Int8Array(t),u.HEAP16=new Int16Array(t),u.HEAP32=F=new Int32Array(t),u.HEAPU8=U=new Uint8Array(t),u.HEAPU16=new Uint16Array(t),u.HEAPU32=I=new Uint32Array(t),u.HEAPF32=new Float32Array(t),u.HEAPF64=W=new Float64Array(t)}O&&(D=u.buffer);var V=u.INITIAL_MEMORY||16777216;if(O)j=u.wasmMemory,D=u.buffer;else if(u.wasmMemory)j=u.wasmMemory;else if(!((j=new WebAssembly.Memory({initial:V/65536,maximum:65536,shared:!0})).buffer instanceof SharedArrayBuffer))throw x("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag"),_&&console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)"),Error("bad memory");j&&(D=j.buffer),V=D.byteLength,N(D);var $,q=[],X=[],J=[],Z=[];function Q(){return R||!1}function K(){var t=u.preRun.shift();q.unshift(t)}var tt,et=0,nt=null,rt=null;function at(t){throw O?postMessage({cmd:"onAbort",arg:t}):u.onAbort&&u.onAbort(t),x(t="Aborted("+t+")"),H=!0,t=new WebAssembly.RuntimeError(t+". Build with -sASSERTIONS for more info."),s(t),t}function it(){return tt.startsWith("data:application/octet-stream;base64,")}function ot(){var t=tt;try{if(t==tt&&M)return new Uint8Array(M);if(p)return p(t);throw"both async and sync fetching of the wasm failed"}catch(t){at(t)}}tt="ort-wasm-threaded.wasm",it()||(tt=S(tt));var ut={};function ct(t){this.name="ExitStatus",this.message="Program terminated with exit("+t+")",this.status=t}function st(t){(t=ht.Vb[t])||at(),ht.mc(t)}function lt(t){var e=ht.Cc();if(!e)return 6;ht.ac.push(e),ht.Vb[t.Ub]=e,e.Ub=t.Ub;var n={cmd:"run",start_routine:t.Ic,arg:t.zc,pthread_ptr:t.Ub};return e.$b=()=>{n.time=performance.now(),e.postMessage(n,t.Nc)},e.loaded&&(e.$b(),delete e.$b),0}function ft(t){if(O)return $t(1,1,t);Q()||(ht.oc(),u.onExit&&u.onExit(t),H=!0),g(t,new ct(t))}function pt(t,e){if(!e&&O)throw bt(t),"unwind";Q()||O||(me(),dt(J),be(0),re[1].length&&ae(1,10),re[2].length&&ae(2,10),ht.oc()),ft(t)}var ht={Yb:[],ac:[],qc:[],Vb:{},fc:function(){O&&ht.Ec()},Pc:function(){},Ec:function(){ht.receiveObjectTransfer=ht.Gc,ht.threadInitTLS=ht.pc,ht.setExitStatus=ht.nc,R=!1},nc:function(){},oc:function(){for(var t of Object.values(ht.Vb))ht.mc(t);for(t of ht.Yb)t.terminate();ht.Yb=[]},mc:function(t){var e=t.Ub;delete ht.Vb[e],ht.Yb.push(t),ht.ac.splice(ht.ac.indexOf(t),1),t.Ub=0,Oe(e)},Gc:function(){},pc:function(){ht.qc.forEach((t=>t()))},Fc:function(t,e){t.onmessage=n=>{var r=(n=n.data).cmd;if(t.Ub&&(ht.Bc=t.Ub),n.targetThread&&n.targetThread!=he()){var a=ht.Vb[n.Qc];a?a.postMessage(n,n.transferList):x(\'Internal error! Worker sent a message "\'+r+\'" to target pthread \'+n.targetThread+", but that thread no longer exists!")}else"processProxyingQueue"===r?zt(n.queue):"spawnThread"===r?lt(n):"cleanupThread"===r?st(n.thread):"killThread"===r?(n=n.thread,r=ht.Vb[n],delete ht.Vb[n],r.terminate(),Oe(n),ht.ac.splice(ht.ac.indexOf(r),1),r.Ub=0):"cancelThread"===r?ht.Vb[n.thread].postMessage({cmd:"cancel"}):"loaded"===r?(t.loaded=!0,e&&e(t),t.$b&&(t.$b(),delete t.$b)):"print"===r?C("Thread "+n.threadId+": "+n.text):"printErr"===r?x("Thread "+n.threadId+": "+n.text):"alert"===r?alert("Thread "+n.threadId+": "+n.text):"setimmediate"===n.target?t.postMessage(n):"onAbort"===r?u.onAbort&&u.onAbort(n.arg):r&&x("worker sent an unknown command "+r);ht.Bc=void 0},t.onerror=t=>{throw x("worker sent an error! "+t.filename+":"+t.lineno+": "+t.message),t},_&&(t.on("message",(function(e){t.onmessage({data:e})})),t.on("error",(function(e){t.onerror(e)})),t.on("detachedExit",(function(){}))),t.postMessage({cmd:"load",urlOrBlob:u.mainScriptUrlOrBlob||_scriptDir,wasmMemory:j,wasmModule:k})},yc:function(){var t=S("ort-wasm-threaded.worker.js");ht.Yb.push(new Worker(t))},Cc:function(){return 0==ht.Yb.length&&(ht.yc(),ht.Fc(ht.Yb[0])),ht.Yb.pop()}};function dt(t){for(;0>2>>>0];t=a()[t+48>>2>>>0],Te(e,e-t),Me(e)};var mt=[];function gt(t){var e=mt[t];return e||(t>=mt.length&&(mt.length=t+1),mt[t]=e=$.get(t)),e}u.invokeEntryPoint=function(t,e){t=gt(t)(e),Q()?ht.nc(t):Ae(t)};var vt,wt,_t=[],Ot=0,At=0;function St(t){this.Zb=t,this.Sb=t-24,this.xc=function(t){i()[this.Sb+4>>2>>>0]=t},this.bc=function(){return i()[this.Sb+4>>2>>>0]},this.wc=function(t){i()[this.Sb+8>>2>>>0]=t},this.Dc=function(){return i()[this.Sb+8>>2>>>0]},this.rc=function(){a()[this.Sb>>2>>>0]=0},this.hc=function(t){t=t?1:0,e()[this.Sb+12>>0>>>0]=t},this.uc=function(){return 0!=e()[this.Sb+12>>0>>>0]},this.ic=function(t){t=t?1:0,e()[this.Sb+13>>0>>>0]=t},this.kc=function(){return 0!=e()[this.Sb+13>>0>>>0]},this.fc=function(t,e){this.cc(0),this.xc(t),this.wc(e),this.rc(),this.hc(!1),this.ic(!1)},this.sc=function(){Atomics.add(a(),this.Sb>>2,1)},this.Hc=function(){return 1===Atomics.sub(a(),this.Sb>>2,1)},this.cc=function(t){i()[this.Sb+16>>2>>>0]=t},this.tc=function(){return i()[this.Sb+16>>2>>>0]},this.vc=function(){if(Re(this.bc()))return i()[this.Zb>>2>>>0];var t=this.tc();return 0!==t?t:this.Zb}}function Tt(t){return ye(new St(t).Sb)}function Et(t,e,n,r){return O?$t(3,1,t,e,n,r):Mt(t,e,n,r)}function Mt(t,e,n,r){if("undefined"==typeof SharedArrayBuffer)return x("Current environment does not support SharedArrayBuffer, pthreads are not available!"),6;var a=[];return O&&0===a.length?Et(t,e,n,r):(t={Ic:n,Ub:t,zc:r,Nc:a},O?(t.Oc="spawnThread",postMessage(t,a),0):lt(t))}function Ct(t,e,n){return O?$t(4,1,t,e,n):0}function xt(t,e){if(O)return $t(5,1,t,e)}function Rt(t,e){if(O)return $t(6,1,t,e)}function jt(t,e,n){if(O)return $t(7,1,t,e,n)}function kt(t,e,n){return O?$t(8,1,t,e,n):0}function Dt(t,e){if(O)return $t(9,1,t,e)}function Pt(t,e,n){if(O)return $t(10,1,t,e,n)}function Ut(t,e,n,r){if(O)return $t(11,1,t,e,n,r)}function Ft(t,e,n,r){if(O)return $t(12,1,t,e,n,r)}function It(t,e,n,r){if(O)return $t(13,1,t,e,n,r)}function Wt(t){if(O)return $t(14,1,t)}function Ht(t,e){if(O)return $t(15,1,t,e)}function Lt(t,e,n){if(O)return $t(16,1,t,e,n)}function zt(t){Atomics.store(a(),t>>2,1),he()&&_e(t),Atomics.compareExchange(a(),t>>2,1,0)}function Yt(t){return i()[t>>>2]+4294967296*a()[t+4>>>2]}function Bt(t,e,n,r,a,i){return O?$t(17,1,t,e,n,r,a,i):-52}function Gt(t,e,n,r,a,i){if(O)return $t(18,1,t,e,n,r,a,i)}function Nt(t){var n=G(t)+1,r=de(n);return r&&B(t,e(),r,n),r}function Vt(t,e,n){function r(t){return(t=t.toTimeString().match(/\\(([A-Za-z ]+)\\)$/))?t[1]:"GMT"}if(O)return $t(19,1,t,e,n);var o=(new Date).getFullYear(),u=new Date(o,0,1),c=new Date(o,6,1);o=u.getTimezoneOffset();var s=c.getTimezoneOffset(),l=Math.max(o,s);a()[t>>2>>>0]=60*l,a()[e>>2>>>0]=Number(o!=s),t=r(u),e=r(c),t=Nt(t),e=Nt(e),s>2>>>0]=t,i()[n+4>>2>>>0]=e):(i()[n>>2>>>0]=e,i()[n+4>>2>>>0]=t)}function $t(t,e){var n=arguments.length-2,r=arguments;return yt((()=>{for(var a=Ce(8*n),i=a>>3,u=0;u>>0]=c}return we(t,n,a,e)}))}u.executeNotifiedProxyingQueue=zt,wt=_?()=>{var t=process.hrtime();return 1e3*t[0]+t[1]/1e6}:O?()=>performance.now()-u.__performance_now_clock_drift:()=>performance.now();var qt,Xt=[],Jt={};function Zt(){if(!qt){var t,e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:m||"./this.program"};for(t in Jt)void 0===Jt[t]?delete e[t]:e[t]=Jt[t];var n=[];for(t in e)n.push(t+"="+e[t]);qt=n}return qt}function Qt(t,n){if(O)return $t(20,1,t,n);var r=0;return Zt().forEach((function(a,o){var u=n+r;for(o=i()[t+4*o>>2>>>0]=u,u=0;u>0>>>0]=a.charCodeAt(u);e()[o>>0>>>0]=0,r+=a.length+1})),0}function Kt(t,e){if(O)return $t(21,1,t,e);var n=Zt();i()[t>>2>>>0]=n.length;var r=0;return n.forEach((function(t){r+=t.length+1})),i()[e>>2>>>0]=r,0}function te(t){return O?$t(22,1,t):52}function ee(t,e,n,r){return O?$t(23,1,t,e,n,r):52}function ne(t,e,n,r,a){return O?$t(24,1,t,e,n,r,a):70}var re=[null,[],[]];function ae(t,e){var n=re[t];0===e||10===e?((1===t?C:x)(z(n,0)),n.length=0):n.push(e)}function ie(t,e,n,a){if(O)return $t(25,1,t,e,n,a);for(var o=0,u=0;u>2>>>0],s=i()[e+4>>2>>>0];e+=8;for(var l=0;l>>0]);o+=s}return i()[a>>2>>>0]=o,0}var oe=0;function ue(t){return 0==t%4&&(0!=t%100||0==t%400)}var ce=[31,29,31,30,31,30,31,31,30,31,30,31],se=[31,28,31,30,31,30,31,31,30,31,30,31];function le(t,n,r,i){function o(t,e,n){for(t="number"==typeof t?t.toString():t||"";t.lengtht?-1:0r-t.getDate())){t.setDate(t.getDate()+e);break}e-=r-t.getDate()+1,t.setDate(1),11>n?t.setMonth(n+1):(t.setMonth(0),t.setFullYear(t.getFullYear()+1))}return n=new Date(t.getFullYear()+1,0,4),e=s(new Date(t.getFullYear(),0,4)),n=s(n),0>=c(e,t)?0>=c(n,t)?t.getFullYear()+1:t.getFullYear():t.getFullYear()-1}var f=a()[i+40>>2>>>0];for(var p in i={Lc:a()[i>>2>>>0],Kc:a()[i+4>>2>>>0],dc:a()[i+8>>2>>>0],jc:a()[i+12>>2>>>0],ec:a()[i+16>>2>>>0],Xb:a()[i+20>>2>>>0],Tb:a()[i+24>>2>>>0],Wb:a()[i+28>>2>>>0],Rc:a()[i+32>>2>>>0],Jc:a()[i+36>>2>>>0],Mc:f?Y(f):""},r=Y(r),f={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"})r=r.replace(new RegExp(p,"g"),f[p]);var h="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),d="January February March April May June July August September October November December".split(" ");for(p in f={"%a":function(t){return h[t.Tb].substring(0,3)},"%A":function(t){return h[t.Tb]},"%b":function(t){return d[t.ec].substring(0,3)},"%B":function(t){return d[t.ec]},"%C":function(t){return u((t.Xb+1900)/100|0,2)},"%d":function(t){return u(t.jc,2)},"%e":function(t){return o(t.jc,2," ")},"%g":function(t){return l(t).toString().substring(2)},"%G":function(t){return l(t)},"%H":function(t){return u(t.dc,2)},"%I":function(t){return 0==(t=t.dc)?t=12:12t.dc?"AM":"PM"},"%S":function(t){return u(t.Lc,2)},"%t":function(){return"\\t"},"%u":function(t){return t.Tb||7},"%U":function(t){return u(Math.floor((t.Wb+7-t.Tb)/7),2)},"%V":function(t){var e=Math.floor((t.Wb+7-(t.Tb+6)%7)/7);if(2>=(t.Tb+371-t.Wb-2)%7&&e++,e)53==e&&(4==(n=(t.Tb+371-t.Wb)%7)||3==n&&ue(t.Xb)||(e=1));else{e=52;var n=(t.Tb+7-t.Wb-1)%7;(4==n||5==n&&ue(t.Xb%400-1))&&e++}return u(e,2)},"%w":function(t){return t.Tb},"%W":function(t){return u(Math.floor((t.Wb+7-(t.Tb+6)%7)/7),2)},"%y":function(t){return(t.Xb+1900).toString().substring(2)},"%Y":function(t){return t.Xb+1900},"%z":function(t){var e=0<=(t=t.Jc);return t=Math.abs(t)/60,(e?"+":"-")+String("0000"+(t/60*100+t%60)).slice(-4)},"%Z":function(t){return t.Mc},"%%":function(){return"%"}},r=r.replace(/%%/g,"\\0\\0"),f)r.includes(p)&&(r=r.replace(new RegExp(p,"g"),f[p](i)));return p=function(t){var e=Array(G(t)+1);return B(t,e,0,e.length),e}(r=r.replace(/\\0\\0/g,"%")),p.length>n?0:(function(t,n){e().set(t,n>>>0)}(p,t),p.length-1)}ht.fc();var fe=[null,ft,bt,Et,Ct,xt,Rt,jt,kt,Dt,Pt,Ut,Ft,It,Wt,Ht,Lt,Bt,Gt,Vt,Qt,Kt,te,ee,ne,ie],pe={b:function(t){return de(t+24)+24},n:function(t){return(t=new St(t)).uc()||(t.hc(!0),Ot--),t.ic(!1),_t.push(t),t.sc(),t.vc()},ma:function(t){throw x("Unexpected exception thrown, this is not properly supported - aborting"),H=!0,t},x:function(){Se(0);var t=_t.pop();if(t.Hc()&&!t.kc()){var e=t.Dc();e&>(e)(t.Zb),Tt(t.Zb)}At=0},e:function(){var t=At;if(!t)return oe=0;var e=new St(t);e.cc(t);var n=e.bc();if(!n)return oe=0,t;for(var r=Array.prototype.slice.call(arguments),a=0;azt(r)));else if(O)postMessage({targetThread:t,cmd:"processProxyingQueue",queue:r});else{if(!(t=ht.Vb[t]))return;t.postMessage({cmd:"processProxyingQueue",queue:r})}return 1},Ea:function(){return-1},Pa:function(t,e){t=new Date(1e3*Yt(t)),a()[e>>2>>>0]=t.getUTCSeconds(),a()[e+4>>2>>>0]=t.getUTCMinutes(),a()[e+8>>2>>>0]=t.getUTCHours(),a()[e+12>>2>>>0]=t.getUTCDate(),a()[e+16>>2>>>0]=t.getUTCMonth(),a()[e+20>>2>>>0]=t.getUTCFullYear()-1900,a()[e+24>>2>>>0]=t.getUTCDay(),t=(t.getTime()-Date.UTC(t.getUTCFullYear(),0,1,0,0,0,0))/864e5|0,a()[e+28>>2>>>0]=t},Qa:function(t,e){t=new Date(1e3*Yt(t)),a()[e>>2>>>0]=t.getSeconds(),a()[e+4>>2>>>0]=t.getMinutes(),a()[e+8>>2>>>0]=t.getHours(),a()[e+12>>2>>>0]=t.getDate(),a()[e+16>>2>>>0]=t.getMonth(),a()[e+20>>2>>>0]=t.getFullYear()-1900,a()[e+24>>2>>>0]=t.getDay();var n=new Date(t.getFullYear(),0,1),r=(t.getTime()-n.getTime())/864e5|0;a()[e+28>>2>>>0]=r,a()[e+36>>2>>>0]=-60*t.getTimezoneOffset(),r=new Date(t.getFullYear(),6,1).getTimezoneOffset(),t=0|(r!=(n=n.getTimezoneOffset())&&t.getTimezoneOffset()==Math.min(n,r)),a()[e+32>>2>>>0]=t},Ra:function(t){var e=new Date(a()[t+20>>2>>>0]+1900,a()[t+16>>2>>>0],a()[t+12>>2>>>0],a()[t+8>>2>>>0],a()[t+4>>2>>>0],a()[t>>2>>>0],0),n=a()[t+32>>2>>>0],r=e.getTimezoneOffset(),i=new Date(e.getFullYear(),0,1),o=new Date(e.getFullYear(),6,1).getTimezoneOffset(),u=i.getTimezoneOffset(),c=Math.min(u,o);return 0>n?a()[t+32>>2>>>0]=Number(o!=u&&c==r):0>2>>>0]=e.getDay(),n=(e.getTime()-i.getTime())/864e5|0,a()[t+28>>2>>>0]=n,a()[t>>2>>>0]=e.getSeconds(),a()[t+4>>2>>>0]=e.getMinutes(),a()[t+8>>2>>>0]=e.getHours(),a()[t+12>>2>>>0]=e.getDate(),a()[t+16>>2>>>0]=e.getMonth(),e.getTime()/1e3|0},Aa:Bt,Ba:Gt,Sa:function t(e,n,r){t.Ac||(t.Ac=!0,Vt(e,n,r))},y:function(){at("")},U:function(){if(!_&&!w){var t="Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread";vt||(vt={}),vt[t]||(vt[t]=1,_&&(t="warning: "+t),x(t))}},ra:function(){return 4294901760},B:wt,Ia:function(t,e,n){r().copyWithin(t>>>0,e>>>0,e+n>>>0)},F:function(){return _?n(993).cpus().length:navigator.hardwareConcurrency},Da:function(t,e,n){Xt.length=e,n>>=3;for(var r=0;r>>0];return(0>t?ut[-t-1]:fe[t]).apply(null,Xt)},qa:function(t){var e=r().length;if((t>>>=0)<=e||4294901760=n;n*=2){var a=e*(1+.2/n);a=Math.min(a,t+100663296);var i=Math;a=Math.max(t,a),i=i.min.call(i,4294901760,a+(65536-a%65536)%65536);t:{try{j.grow(i-D.byteLength+65535>>>16),N(j.buffer);var o=1;break t}catch(t){}o=void 0}if(o)return!0}return!1},Na:function(){throw"unwind"},Ga:Qt,Ha:Kt,J:pt,I:te,S:ee,ga:ne,R:ie,d:function(){return oe},na:function t(r,a){t.lc||(t.lc=function(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var t=new Uint8Array(1);return()=>(crypto.getRandomValues(t),t[0])}if(_)try{var e=n(Object(function(){var t=new Error("Cannot find module \'crypto\'");throw t.code="MODULE_NOT_FOUND",t}()));return()=>e.randomBytes(1)[0]}catch(t){}return()=>at("randomDevice")}());for(var i=0;i>0>>>0]=t.lc();return 0},ia:function(t,e,n){var r=Ee();try{return gt(t)(e,n)}catch(t){if(Me(r),t!==t+0)throw t;Se(1,0)}},ja:function(t,e,n){var r=Ee();try{return gt(t)(e,n)}catch(t){if(Me(r),t!==t+0)throw t;Se(1,0)}},K:function(t){var e=Ee();try{return gt(t)()}catch(t){if(Me(e),t!==t+0)throw t;Se(1,0)}},f:function(t,e){var n=Ee();try{return gt(t)(e)}catch(t){if(Me(n),t!==t+0)throw t;Se(1,0)}},P:function(t,e,n){var r=Ee();try{return gt(t)(e,n)}catch(t){if(Me(r),t!==t+0)throw t;Se(1,0)}},Q:function(t,e,n){var r=Ee();try{return gt(t)(e,n)}catch(t){if(Me(r),t!==t+0)throw t;Se(1,0)}},k:function(t,e,n){var r=Ee();try{return gt(t)(e,n)}catch(t){if(Me(r),t!==t+0)throw t;Se(1,0)}},p:function(t,e,n,r){var a=Ee();try{return gt(t)(e,n,r)}catch(t){if(Me(a),t!==t+0)throw t;Se(1,0)}},q:function(t,e,n,r,a){var i=Ee();try{return gt(t)(e,n,r,a)}catch(t){if(Me(i),t!==t+0)throw t;Se(1,0)}},N:function(t,e,n,r,a,i){var o=Ee();try{return gt(t)(e,n,r,a,i)}catch(t){if(Me(o),t!==t+0)throw t;Se(1,0)}},s:function(t,e,n,r,a,i){var o=Ee();try{return gt(t)(e,n,r,a,i)}catch(t){if(Me(o),t!==t+0)throw t;Se(1,0)}},w:function(t,e,n,r,a,i,o){var u=Ee();try{return gt(t)(e,n,r,a,i,o)}catch(t){if(Me(u),t!==t+0)throw t;Se(1,0)}},L:function(t,e,n,r,a,i,o,u){var c=Ee();try{return gt(t)(e,n,r,a,i,o,u)}catch(t){if(Me(c),t!==t+0)throw t;Se(1,0)}},E:function(t,e,n,r,a,i,o,u,c,s,l,f){var p=Ee();try{return gt(t)(e,n,r,a,i,o,u,c,s,l,f)}catch(t){if(Me(p),t!==t+0)throw t;Se(1,0)}},aa:function(t,e,n,r,a,i,o,u){var c=Ee();try{return He(t,e,n,r,a,i,o,u)}catch(t){if(Me(c),t!==t+0)throw t;Se(1,0)}},_:function(t,e,n,r,a,i,o){var u=Ee();try{return ke(t,e,n,r,a,i,o)}catch(t){if(Me(u),t!==t+0)throw t;Se(1,0)}},Z:function(t,e,n,r,a){var i=Ee();try{return Le(t,e,n,r,a)}catch(t){if(Me(i),t!==t+0)throw t;Se(1,0)}},ca:function(t,e,n,r){var a=Ee();try{return Ie(t,e,n,r)}catch(t){if(Me(a),t!==t+0)throw t;Se(1,0)}},$:function(t){var e=Ee();try{return je(t)}catch(t){if(Me(e),t!==t+0)throw t;Se(1,0)}},ba:function(t,e){var n=Ee();try{return We(t,e)}catch(t){if(Me(n),t!==t+0)throw t;Se(1,0)}},Y:function(t,e,n){var r=Ee();try{return De(t,e,n)}catch(t){if(Me(r),t!==t+0)throw t;Se(1,0)}},g:function(t){var e=Ee();try{gt(t)()}catch(t){if(Me(e),t!==t+0)throw t;Se(1,0)}},r:function(t,e){var n=Ee();try{gt(t)(e)}catch(t){if(Me(n),t!==t+0)throw t;Se(1,0)}},i:function(t,e,n){var r=Ee();try{gt(t)(e,n)}catch(t){if(Me(r),t!==t+0)throw t;Se(1,0)}},ha:function(t,e,n,r){var a=Ee();try{gt(t)(e,n,r)}catch(t){if(Me(a),t!==t+0)throw t;Se(1,0)}},m:function(t,e,n,r){var a=Ee();try{gt(t)(e,n,r)}catch(t){if(Me(a),t!==t+0)throw t;Se(1,0)}},v:function(t,e,n,r,a){var i=Ee();try{gt(t)(e,n,r,a)}catch(t){if(Me(i),t!==t+0)throw t;Se(1,0)}},u:function(t,e,n,r,a,i){var o=Ee();try{gt(t)(e,n,r,a,i)}catch(t){if(Me(o),t!==t+0)throw t;Se(1,0)}},O:function(t,e,n,r,a,i,o){var u=Ee();try{gt(t)(e,n,r,a,i,o)}catch(t){if(Me(u),t!==t+0)throw t;Se(1,0)}},A:function(t,e,n,r,a,i,o,u){var c=Ee();try{gt(t)(e,n,r,a,i,o,u)}catch(t){if(Me(c),t!==t+0)throw t;Se(1,0)}},ka:function(t,e,n,r,a,i,o,u,c){var s=Ee();try{gt(t)(e,n,r,a,i,o,u,c)}catch(t){if(Me(s),t!==t+0)throw t;Se(1,0)}},C:function(t,e,n,r,a,i,o,u,c,s,l){var f=Ee();try{gt(t)(e,n,r,a,i,o,u,c,s,l)}catch(t){if(Me(f),t!==t+0)throw t;Se(1,0)}},D:function(t,e,n,r,a,i,o,u,c,s,l,f,p,h,d,y){var b=Ee();try{gt(t)(e,n,r,a,i,o,u,c,s,l,f,p,h,d,y)}catch(t){if(Me(b),t!==t+0)throw t;Se(1,0)}},fa:function(t,e,n,r,a,i,o,u){var c=Ee();try{Pe(t,e,n,r,a,i,o,u)}catch(t){if(Me(c),t!==t+0)throw t;Se(1,0)}},da:function(t,e,n,r,a,i,o,u,c,s,l,f){var p=Ee();try{Fe(t,e,n,r,a,i,o,u,c,s,l,f)}catch(t){if(Me(p),t!==t+0)throw t;Se(1,0)}},ea:function(t,e,n,r,a,i){var o=Ee();try{Ue(t,e,n,r,a,i)}catch(t){if(Me(o),t!==t+0)throw t;Se(1,0)}},o:function(t){return t},a:j||u.wasmMemory,G:function(t){oe=t},la:le,z:function(t,e,n,r){return le(t,e,n,r)}};!function(){function t(t,e){u.asm=t.exports,ht.qc.push(u.asm.sb),$=u.asm.ub,X.unshift(u.asm.Va),k=e,O||(et--,u.monitorRunDependencies&&u.monitorRunDependencies(et),0==et&&(null!==nt&&(clearInterval(nt),nt=null),rt&&(t=rt,rt=null,t())))}function e(e){t(e.instance,e.module)}function n(t){return function(){if(!M&&(v||w)){if("function"==typeof fetch&&!tt.startsWith("file://"))return fetch(tt,{credentials:"same-origin"}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at \'"+tt+"\'";return t.arrayBuffer()})).catch((function(){return ot()}));if(f)return new Promise((function(t,e){f(tt,(function(e){t(new Uint8Array(e))}),e)}))}return Promise.resolve().then((function(){return ot()}))}().then((function(t){return WebAssembly.instantiate(t,r)})).then((function(t){return t})).then(t,(function(t){x("failed to asynchronously prepare wasm: "+t),at(t)}))}var r={a:pe};if(O||(et++,u.monitorRunDependencies&&u.monitorRunDependencies(et)),u.instantiateWasm)try{return u.instantiateWasm(r,t)}catch(t){return x("Module.instantiateWasm callback failed with error: "+t),!1}(M||"function"!=typeof WebAssembly.instantiateStreaming||it()||tt.startsWith("file://")||_||"function"!=typeof fetch?n(e):fetch(tt,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,r).then(e,(function(t){return x("wasm streaming compile failed: "+t),x("falling back to ArrayBuffer instantiation"),n(e)}))}))).catch(s)}(),u.___wasm_call_ctors=function(){return(u.___wasm_call_ctors=u.asm.Va).apply(null,arguments)},u._OrtInit=function(){return(u._OrtInit=u.asm.Wa).apply(null,arguments)},u._OrtCreateSessionOptions=function(){return(u._OrtCreateSessionOptions=u.asm.Xa).apply(null,arguments)},u._OrtAppendExecutionProvider=function(){return(u._OrtAppendExecutionProvider=u.asm.Ya).apply(null,arguments)},u._OrtAddSessionConfigEntry=function(){return(u._OrtAddSessionConfigEntry=u.asm.Za).apply(null,arguments)},u._OrtReleaseSessionOptions=function(){return(u._OrtReleaseSessionOptions=u.asm._a).apply(null,arguments)},u._OrtCreateSession=function(){return(u._OrtCreateSession=u.asm.$a).apply(null,arguments)},u._OrtReleaseSession=function(){return(u._OrtReleaseSession=u.asm.ab).apply(null,arguments)},u._OrtGetInputCount=function(){return(u._OrtGetInputCount=u.asm.bb).apply(null,arguments)},u._OrtGetOutputCount=function(){return(u._OrtGetOutputCount=u.asm.cb).apply(null,arguments)},u._OrtGetInputName=function(){return(u._OrtGetInputName=u.asm.db).apply(null,arguments)},u._OrtGetOutputName=function(){return(u._OrtGetOutputName=u.asm.eb).apply(null,arguments)},u._OrtFree=function(){return(u._OrtFree=u.asm.fb).apply(null,arguments)},u._OrtCreateTensor=function(){return(u._OrtCreateTensor=u.asm.gb).apply(null,arguments)},u._OrtGetTensorData=function(){return(u._OrtGetTensorData=u.asm.hb).apply(null,arguments)},u._OrtReleaseTensor=function(){return(u._OrtReleaseTensor=u.asm.ib).apply(null,arguments)},u._OrtCreateRunOptions=function(){return(u._OrtCreateRunOptions=u.asm.jb).apply(null,arguments)},u._OrtAddRunConfigEntry=function(){return(u._OrtAddRunConfigEntry=u.asm.kb).apply(null,arguments)},u._OrtReleaseRunOptions=function(){return(u._OrtReleaseRunOptions=u.asm.lb).apply(null,arguments)},u._OrtRun=function(){return(u._OrtRun=u.asm.mb).apply(null,arguments)},u._OrtEndProfiling=function(){return(u._OrtEndProfiling=u.asm.nb).apply(null,arguments)};var he=u._pthread_self=function(){return(he=u._pthread_self=u.asm.ob).apply(null,arguments)},de=u._malloc=function(){return(de=u._malloc=u.asm.pb).apply(null,arguments)},ye=u._free=function(){return(ye=u._free=u.asm.qb).apply(null,arguments)},be=u._fflush=function(){return(be=u._fflush=u.asm.rb).apply(null,arguments)};u.__emscripten_tls_init=function(){return(u.__emscripten_tls_init=u.asm.sb).apply(null,arguments)};var me=u.___funcs_on_exit=function(){return(me=u.___funcs_on_exit=u.asm.tb).apply(null,arguments)},ge=u.__emscripten_thread_init=function(){return(ge=u.__emscripten_thread_init=u.asm.vb).apply(null,arguments)};u.__emscripten_thread_crashed=function(){return(u.__emscripten_thread_crashed=u.asm.wb).apply(null,arguments)};var ve,we=u._emscripten_run_in_main_runtime_thread_js=function(){return(we=u._emscripten_run_in_main_runtime_thread_js=u.asm.xb).apply(null,arguments)},_e=u.__emscripten_proxy_execute_task_queue=function(){return(_e=u.__emscripten_proxy_execute_task_queue=u.asm.yb).apply(null,arguments)},Oe=u.__emscripten_thread_free_data=function(){return(Oe=u.__emscripten_thread_free_data=u.asm.zb).apply(null,arguments)},Ae=u.__emscripten_thread_exit=function(){return(Ae=u.__emscripten_thread_exit=u.asm.Ab).apply(null,arguments)},Se=u._setThrew=function(){return(Se=u._setThrew=u.asm.Bb).apply(null,arguments)},Te=u._emscripten_stack_set_limits=function(){return(Te=u._emscripten_stack_set_limits=u.asm.Cb).apply(null,arguments)},Ee=u.stackSave=function(){return(Ee=u.stackSave=u.asm.Db).apply(null,arguments)},Me=u.stackRestore=function(){return(Me=u.stackRestore=u.asm.Eb).apply(null,arguments)},Ce=u.stackAlloc=function(){return(Ce=u.stackAlloc=u.asm.Fb).apply(null,arguments)},xe=u.___cxa_can_catch=function(){return(xe=u.___cxa_can_catch=u.asm.Gb).apply(null,arguments)},Re=u.___cxa_is_pointer_type=function(){return(Re=u.___cxa_is_pointer_type=u.asm.Hb).apply(null,arguments)},je=u.dynCall_j=function(){return(je=u.dynCall_j=u.asm.Ib).apply(null,arguments)},ke=u.dynCall_iiiiij=function(){return(ke=u.dynCall_iiiiij=u.asm.Jb).apply(null,arguments)},De=u.dynCall_jii=function(){return(De=u.dynCall_jii=u.asm.Kb).apply(null,arguments)},Pe=u.dynCall_viiiiij=function(){return(Pe=u.dynCall_viiiiij=u.asm.Lb).apply(null,arguments)},Ue=u.dynCall_vjji=function(){return(Ue=u.dynCall_vjji=u.asm.Mb).apply(null,arguments)},Fe=u.dynCall_viiijjjii=function(){return(Fe=u.dynCall_viiijjjii=u.asm.Nb).apply(null,arguments)},Ie=u.dynCall_iij=function(){return(Ie=u.dynCall_iij=u.asm.Ob).apply(null,arguments)},We=u.dynCall_ji=function(){return(We=u.dynCall_ji=u.asm.Pb).apply(null,arguments)},He=u.dynCall_iiiiiij=function(){return(He=u.dynCall_iiiiiij=u.asm.Qb).apply(null,arguments)},Le=u.dynCall_iiij=function(){return(Le=u.dynCall_iiij=u.asm.Rb).apply(null,arguments)};function ze(){function t(){if(!ve&&(ve=!0,u.calledRun=!0,!H)&&(O||dt(X),c(u),u.onRuntimeInitialized&&u.onRuntimeInitialized(),!O)){if(u.postRun)for("function"==typeof u.postRun&&(u.postRun=[u.postRun]);u.postRun.length;){var t=u.postRun.shift();Z.unshift(t)}dt(Z)}}if(!(0{var _scriptDir,r=(_scriptDir=(_scriptDir="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0)||"/index.js",function(t){var e,r,a;t=t||{},e||(e=void 0!==t?t:{}),e.ready=new Promise((function(t,e){r=t,a=e}));var i,o,u,c,s,l,f=Object.assign({},e),p="./this.program",h=(t,e)=>{throw e},d="object"==typeof window,y="function"==typeof importScripts,b="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,m="";b?(m=y?n(908).dirname(m)+"/":"//",l=()=>{s||(c=n(384),s=n(908))},i=function(t,e){return l(),t=s.normalize(t),c.readFileSync(t,e?void 0:"utf8")},u=t=>((t=i(t,!0)).buffer||(t=new Uint8Array(t)),t),o=(t,e,n)=>{l(),t=s.normalize(t),c.readFile(t,(function(t,r){t?n(t):e(r.buffer)}))},1{if(_||0{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.send(null),e.responseText},y&&(u=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}),o=(t,e,n)=>{var r=new XMLHttpRequest;r.open("GET",t,!0),r.responseType="arraybuffer",r.onload=()=>{200==r.status||0==r.status&&r.response?e(r.response):n()},r.onerror=n,r.send(null)});var g,v=e.print||console.log.bind(console),w=e.printErr||console.warn.bind(console);Object.assign(e,f),f=null,e.thisProgram&&(p=e.thisProgram),e.quit&&(h=e.quit),e.wasmBinary&&(g=e.wasmBinary);var _=e.noExitRuntime||!1;"object"!=typeof WebAssembly&&V("no native wasm support detected");var O,A,S,T,E,M,C=!1,x="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function R(t,e,n){var r=(e>>>=0)+n;for(n=e;t[n]&&!(n>=r);)++n;if(16(a=224==(240&a)?(15&a)<<12|i<<6|o:(7&a)<<18|i<<12|o<<6|63&t[e++])?r+=String.fromCharCode(a):(a-=65536,r+=String.fromCharCode(55296|a>>10,56320|1023&a))}}else r+=String.fromCharCode(a)}return r}function j(t,e){return(t>>>=0)?R(T,t,e):""}function k(t,e,n,r){if(!(0>>=0;r=n+r-1;for(var i=0;i=o&&(o=65536+((1023&o)<<10)|1023&t.charCodeAt(++i)),127>=o){if(n>=r)break;e[n++>>>0]=o}else{if(2047>=o){if(n+1>=r)break;e[n++>>>0]=192|o>>6}else{if(65535>=o){if(n+2>=r)break;e[n++>>>0]=224|o>>12}else{if(n+3>=r)break;e[n++>>>0]=240|o>>18,e[n++>>>0]=128|o>>12&63}e[n++>>>0]=128|o>>6&63}e[n++>>>0]=128|63&o}}return e[n>>>0]=0,n-a}function D(t){for(var e=0,n=0;n=r?e++:2047>=r?e+=2:55296<=r&&57343>=r?(e+=4,++n):e+=3}return e}function P(){var t=O.buffer;A=t,e.HEAP8=S=new Int8Array(t),e.HEAP16=new Int16Array(t),e.HEAP32=E=new Int32Array(t),e.HEAPU8=T=new Uint8Array(t),e.HEAPU16=new Uint16Array(t),e.HEAPU32=M=new Uint32Array(t),e.HEAPF32=new Float32Array(t),e.HEAPF64=new Float64Array(t)}var U,F=[],I=[],W=[],H=[],L=0;function z(){var t=e.preRun.shift();F.unshift(t)}var Y,B=0,G=null,N=null;function V(t){throw e.onAbort&&e.onAbort(t),w(t="Aborted("+t+")"),C=!0,t=new WebAssembly.RuntimeError(t+". Build with -sASSERTIONS for more info."),a(t),t}function $(){return Y.startsWith("data:application/octet-stream;base64,")}if(Y="ort-wasm.wasm",!$()){var q=Y;Y=e.locateFile?e.locateFile(q,m):m+q}function X(){var t=Y;try{if(t==Y&&g)return new Uint8Array(g);if(u)return u(t);throw"both async and sync fetching of the wasm failed"}catch(t){V(t)}}function J(t){this.name="ExitStatus",this.message="Program terminated with exit("+t+")",this.status=t}function Z(t){for(;0>2>>>0]=t},this.Eb=function(){return M[this.zb+4>>2>>>0]},this.Sb=function(t){M[this.zb+8>>2>>>0]=t},this.Wb=function(){return M[this.zb+8>>2>>>0]},this.Tb=function(){E[this.zb>>2>>>0]=0},this.Ib=function(t){S[this.zb+12>>0>>>0]=t?1:0},this.Pb=function(){return 0!=S[this.zb+12>>0>>>0]},this.Jb=function(t){S[this.zb+13>>0>>>0]=t?1:0},this.Lb=function(){return 0!=S[this.zb+13>>0>>>0]},this.Rb=function(t,e){this.Fb(0),this.Ub(t),this.Sb(e),this.Tb(),this.Ib(!1),this.Jb(!1)},this.Nb=function(){E[this.zb>>2>>>0]+=1},this.Xb=function(){var t=E[this.zb>>2>>>0];return E[this.zb>>2>>>0]=t-1,1===t},this.Fb=function(t){M[this.zb+16>>2>>>0]=t},this.Ob=function(){return M[this.zb+16>>2>>>0]},this.Qb=function(){if(Mt(this.Eb()))return M[this.Db>>2>>>0];var t=this.Ob();return 0!==t?t:this.Db}}function nt(t){return vt(new et(t).zb)}var rt=[];function at(t){var e=rt[t];return e||(t>=rt.length&&(rt.length=t+1),rt[t]=e=U.get(t)),e}function it(t){var e=D(t)+1,n=gt(e);return n&&k(t,S,n,e),n}var ot={};function ut(){if(!ct){var t,e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:p||"./this.program"};for(t in ot)void 0===ot[t]?delete e[t]:e[t]=ot[t];var n=[];for(t in e)n.push(t+"="+e[t]);ct=n}return ct}var ct,st=[null,[],[]];function lt(t,e){var n=st[t];0===e||10===e?((1===t?v:w)(R(n,0)),n.length=0):n.push(e)}var ft=0;function pt(t){return 0==t%4&&(0!=t%100||0==t%400)}var ht=[31,29,31,30,31,30,31,31,30,31,30,31],dt=[31,28,31,30,31,30,31,31,30,31,30,31];function yt(t,e,n,r){function a(t,e,n){for(t="number"==typeof t?t.toString():t||"";t.lengtht?-1:0r-t.getDate())){t.setDate(t.getDate()+e);break}e-=r-t.getDate()+1,t.setDate(1),11>n?t.setMonth(n+1):(t.setMonth(0),t.setFullYear(t.getFullYear()+1))}return n=new Date(t.getFullYear()+1,0,4),e=u(new Date(t.getFullYear(),0,4)),n=u(n),0>=o(e,t)?0>=o(n,t)?t.getFullYear()+1:t.getFullYear():t.getFullYear()-1}var s=E[r+40>>2>>>0];for(var l in r={$b:E[r>>2>>>0],Zb:E[r+4>>2>>>0],Gb:E[r+8>>2>>>0],Kb:E[r+12>>2>>>0],Hb:E[r+16>>2>>>0],Cb:E[r+20>>2>>>0],Ab:E[r+24>>2>>>0],Bb:E[r+28>>2>>>0],bc:E[r+32>>2>>>0],Yb:E[r+36>>2>>>0],ac:s?j(s):""},n=j(n),s={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"})n=n.replace(new RegExp(l,"g"),s[l]);var f="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),p="January February March April May June July August September October November December".split(" ");for(l in s={"%a":function(t){return f[t.Ab].substring(0,3)},"%A":function(t){return f[t.Ab]},"%b":function(t){return p[t.Hb].substring(0,3)},"%B":function(t){return p[t.Hb]},"%C":function(t){return i((t.Cb+1900)/100|0,2)},"%d":function(t){return i(t.Kb,2)},"%e":function(t){return a(t.Kb,2," ")},"%g":function(t){return c(t).toString().substring(2)},"%G":function(t){return c(t)},"%H":function(t){return i(t.Gb,2)},"%I":function(t){return 0==(t=t.Gb)?t=12:12t.Gb?"AM":"PM"},"%S":function(t){return i(t.$b,2)},"%t":function(){return"\\t"},"%u":function(t){return t.Ab||7},"%U":function(t){return i(Math.floor((t.Bb+7-t.Ab)/7),2)},"%V":function(t){var e=Math.floor((t.Bb+7-(t.Ab+6)%7)/7);if(2>=(t.Ab+371-t.Bb-2)%7&&e++,e)53==e&&(4==(n=(t.Ab+371-t.Bb)%7)||3==n&&pt(t.Cb)||(e=1));else{e=52;var n=(t.Ab+7-t.Bb-1)%7;(4==n||5==n&&pt(t.Cb%400-1))&&e++}return i(e,2)},"%w":function(t){return t.Ab},"%W":function(t){return i(Math.floor((t.Bb+7-(t.Ab+6)%7)/7),2)},"%y":function(t){return(t.Cb+1900).toString().substring(2)},"%Y":function(t){return t.Cb+1900},"%z":function(t){var e=0<=(t=t.Yb);return t=Math.abs(t)/60,(e?"+":"-")+String("0000"+(t/60*100+t%60)).slice(-4)},"%Z":function(t){return t.ac},"%%":function(){return"%"}},n=n.replace(/%%/g,"\\0\\0"),s)n.includes(l)&&(n=n.replace(new RegExp(l,"g"),s[l](r)));return l=function(t){var e=Array(D(t)+1);return k(t,e,0,e.length),e}(n=n.replace(/\\0\\0/g,"%")),l.length>e?0:(S.set(l,t>>>0),l.length-1)}var bt={a:function(t){return gt(t+24)+24},m:function(t){return(t=new et(t)).Pb()||(t.Ib(!0),K--),t.Jb(!1),Q.push(t),t.Nb(),t.Qb()},ia:function(t){throw w("Unexpected exception thrown, this is not properly supported - aborting"),C=!0,t},w:function(){Ot(0);var t=Q.pop();if(t.Xb()&&!t.Lb()){var e=t.Wb();e&&at(e)(t.Db),nt(t.Db)}tt=0},d:function(){var t=tt;if(!t)return ft=0;var e=new et(t);e.Fb(t);var n=e.Eb();if(!n)return ft=0,t;for(var r=Array.prototype.slice.call(arguments),a=0;a>>2]+4294967296*E[t+4>>>2])),E[e>>2>>>0]=t.getUTCSeconds(),E[e+4>>2>>>0]=t.getUTCMinutes(),E[e+8>>2>>>0]=t.getUTCHours(),E[e+12>>2>>>0]=t.getUTCDate(),E[e+16>>2>>>0]=t.getUTCMonth(),E[e+20>>2>>>0]=t.getUTCFullYear()-1900,E[e+24>>2>>>0]=t.getUTCDay(),E[e+28>>2>>>0]=(t.getTime()-Date.UTC(t.getUTCFullYear(),0,1,0,0,0,0))/864e5|0},Ea:function(t,e){t=new Date(1e3*(M[t>>>2]+4294967296*E[t+4>>>2])),E[e>>2>>>0]=t.getSeconds(),E[e+4>>2>>>0]=t.getMinutes(),E[e+8>>2>>>0]=t.getHours(),E[e+12>>2>>>0]=t.getDate(),E[e+16>>2>>>0]=t.getMonth(),E[e+20>>2>>>0]=t.getFullYear()-1900,E[e+24>>2>>>0]=t.getDay();var n=new Date(t.getFullYear(),0,1);E[e+28>>2>>>0]=(t.getTime()-n.getTime())/864e5|0,E[e+36>>2>>>0]=-60*t.getTimezoneOffset();var r=new Date(t.getFullYear(),6,1).getTimezoneOffset();n=n.getTimezoneOffset(),E[e+32>>2>>>0]=0|(r!=n&&t.getTimezoneOffset()==Math.min(n,r))},Fa:function(t){var e=new Date(E[t+20>>2>>>0]+1900,E[t+16>>2>>>0],E[t+12>>2>>>0],E[t+8>>2>>>0],E[t+4>>2>>>0],E[t>>2>>>0],0),n=E[t+32>>2>>>0],r=e.getTimezoneOffset(),a=new Date(e.getFullYear(),0,1),i=new Date(e.getFullYear(),6,1).getTimezoneOffset(),o=a.getTimezoneOffset(),u=Math.min(o,i);return 0>n?E[t+32>>2>>>0]=Number(i!=o&&u==r):0>2>>>0]=e.getDay(),E[t+28>>2>>>0]=(e.getTime()-a.getTime())/864e5|0,E[t>>2>>>0]=e.getSeconds(),E[t+4>>2>>>0]=e.getMinutes(),E[t+8>>2>>>0]=e.getHours(),E[t+12>>2>>>0]=e.getDate(),E[t+16>>2>>>0]=e.getMonth(),e.getTime()/1e3|0},sa:function(){return-52},ta:function(){},Ga:function t(e,n,r){t.Vb||(t.Vb=!0,function(t,e,n){function r(t){return(t=t.toTimeString().match(/\\(([A-Za-z ]+)\\)$/))?t[1]:"GMT"}var a=(new Date).getFullYear(),i=new Date(a,0,1),o=new Date(a,6,1);a=i.getTimezoneOffset();var u=o.getTimezoneOffset();E[t>>2>>>0]=60*Math.max(a,u),E[e>>2>>>0]=Number(a!=u),t=r(i),e=r(o),t=it(t),e=it(e),u>2>>>0]=t,M[n+4>>2>>>0]=e):(M[n>>2>>>0]=e,M[n+4>>2>>>0]=t)}(e,n,r))},B:function(){V("")},ma:function(){return 4294901760},I:b?()=>{var t=process.hrtime();return 1e3*t[0]+t[1]/1e6}:()=>performance.now(),xa:function(t,e,n){T.copyWithin(t>>>0,e>>>0,e+n>>>0)},G:function(t){var e=T.length;if(4294901760<(t>>>=0))return!1;for(var n=1;4>=n;n*=2){var r=e*(1+.2/n);r=Math.min(r,t+100663296);var a=Math;r=Math.max(t,r),a=a.min.call(a,4294901760,r+(65536-r%65536)%65536);t:{try{O.grow(a-A.byteLength+65535>>>16),P();var i=1;break t}catch(t){}i=void 0}if(i)return!0}return!1},va:function(t,e){var n=0;return ut().forEach((function(r,a){var i=e+n;for(a=M[t+4*a>>2>>>0]=i,i=0;i>0>>>0]=r.charCodeAt(i);S[a>>0>>>0]=0,n+=r.length+1})),0},wa:function(t,e){var n=ut();M[t>>2>>>0]=n.length;var r=0;return n.forEach((function(t){r+=t.length+1})),M[e>>2>>>0]=r,0},ba:function(t){_||0>2>>>0],u=M[e+4>>2>>>0];e+=8;for(var c=0;c>>0]);a+=u}return M[r>>2>>>0]=a,0},c:function(){return ft},ja:function t(e,r){t.Mb||(t.Mb=function(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var t=new Uint8Array(1);return()=>(crypto.getRandomValues(t),t[0])}if(b)try{var e=n(Object(function(){var t=new Error("Cannot find module \'crypto\'");throw t.code="MODULE_NOT_FOUND",t}()));return()=>e.randomBytes(1)[0]}catch(t){}return()=>V("randomDevice")}());for(var a=0;a>0>>>0]=t.Mb();return 0},ea:function(t,e,n){var r=At();try{return at(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;Ot(1,0)}},fa:function(t,e,n){var r=At();try{return at(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;Ot(1,0)}},J:function(t){var e=At();try{return at(t)()}catch(t){if(St(e),t!==t+0)throw t;Ot(1,0)}},e:function(t,e){var n=At();try{return at(t)(e)}catch(t){if(St(n),t!==t+0)throw t;Ot(1,0)}},N:function(t,e,n){var r=At();try{return at(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;Ot(1,0)}},O:function(t,e,n){var r=At();try{return at(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;Ot(1,0)}},j:function(t,e,n){var r=At();try{return at(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;Ot(1,0)}},o:function(t,e,n,r){var a=At();try{return at(t)(e,n,r)}catch(t){if(St(a),t!==t+0)throw t;Ot(1,0)}},p:function(t,e,n,r,a){var i=At();try{return at(t)(e,n,r,a)}catch(t){if(St(i),t!==t+0)throw t;Ot(1,0)}},M:function(t,e,n,r,a,i){var o=At();try{return at(t)(e,n,r,a,i)}catch(t){if(St(o),t!==t+0)throw t;Ot(1,0)}},r:function(t,e,n,r,a,i){var o=At();try{return at(t)(e,n,r,a,i)}catch(t){if(St(o),t!==t+0)throw t;Ot(1,0)}},v:function(t,e,n,r,a,i,o){var u=At();try{return at(t)(e,n,r,a,i,o)}catch(t){if(St(u),t!==t+0)throw t;Ot(1,0)}},K:function(t,e,n,r,a,i,o,u){var c=At();try{return at(t)(e,n,r,a,i,o,u)}catch(t){if(St(c),t!==t+0)throw t;Ot(1,0)}},D:function(t,e,n,r,a,i,o,u,c,s,l,f){var p=At();try{return at(t)(e,n,r,a,i,o,u,c,s,l,f)}catch(t){if(St(p),t!==t+0)throw t;Ot(1,0)}},X:function(t,e,n,r,a,i,o,u){var c=At();try{return Ft(t,e,n,r,a,i,o,u)}catch(t){if(St(c),t!==t+0)throw t;Ot(1,0)}},V:function(t,e,n,r,a,i,o){var u=At();try{return xt(t,e,n,r,a,i,o)}catch(t){if(St(u),t!==t+0)throw t;Ot(1,0)}},U:function(t,e,n,r,a){var i=At();try{return It(t,e,n,r,a)}catch(t){if(St(i),t!==t+0)throw t;Ot(1,0)}},Z:function(t,e,n,r){var a=At();try{return Pt(t,e,n,r)}catch(t){if(St(a),t!==t+0)throw t;Ot(1,0)}},W:function(t){var e=At();try{return Ct(t)}catch(t){if(St(e),t!==t+0)throw t;Ot(1,0)}},Y:function(t,e){var n=At();try{return Ut(t,e)}catch(t){if(St(n),t!==t+0)throw t;Ot(1,0)}},T:function(t,e,n){var r=At();try{return Rt(t,e,n)}catch(t){if(St(r),t!==t+0)throw t;Ot(1,0)}},f:function(t){var e=At();try{at(t)()}catch(t){if(St(e),t!==t+0)throw t;Ot(1,0)}},q:function(t,e){var n=At();try{at(t)(e)}catch(t){if(St(n),t!==t+0)throw t;Ot(1,0)}},h:function(t,e,n){var r=At();try{at(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;Ot(1,0)}},da:function(t,e,n,r){var a=At();try{at(t)(e,n,r)}catch(t){if(St(a),t!==t+0)throw t;Ot(1,0)}},l:function(t,e,n,r){var a=At();try{at(t)(e,n,r)}catch(t){if(St(a),t!==t+0)throw t;Ot(1,0)}},t:function(t,e,n,r,a){var i=At();try{at(t)(e,n,r,a)}catch(t){if(St(i),t!==t+0)throw t;Ot(1,0)}},u:function(t,e,n,r,a,i){var o=At();try{at(t)(e,n,r,a,i)}catch(t){if(St(o),t!==t+0)throw t;Ot(1,0)}},x:function(t,e,n,r,a,i,o){var u=At();try{at(t)(e,n,r,a,i,o)}catch(t){if(St(u),t!==t+0)throw t;Ot(1,0)}},z:function(t,e,n,r,a,i,o,u){var c=At();try{at(t)(e,n,r,a,i,o,u)}catch(t){if(St(c),t!==t+0)throw t;Ot(1,0)}},ga:function(t,e,n,r,a,i,o,u,c){var s=At();try{at(t)(e,n,r,a,i,o,u,c)}catch(t){if(St(s),t!==t+0)throw t;Ot(1,0)}},A:function(t,e,n,r,a,i,o,u,c,s,l){var f=At();try{at(t)(e,n,r,a,i,o,u,c,s,l)}catch(t){if(St(f),t!==t+0)throw t;Ot(1,0)}},C:function(t,e,n,r,a,i,o,u,c,s,l,f,p,h,d,y){var b=At();try{at(t)(e,n,r,a,i,o,u,c,s,l,f,p,h,d,y)}catch(t){if(St(b),t!==t+0)throw t;Ot(1,0)}},aa:function(t,e,n,r,a,i,o,u){var c=At();try{jt(t,e,n,r,a,i,o,u)}catch(t){if(St(c),t!==t+0)throw t;Ot(1,0)}},_:function(t,e,n,r,a,i,o,u,c,s,l,f){var p=At();try{Dt(t,e,n,r,a,i,o,u,c,s,l,f)}catch(t){if(St(p),t!==t+0)throw t;Ot(1,0)}},$:function(t,e,n,r,a,i){var o=At();try{kt(t,e,n,r,a,i)}catch(t){if(St(o),t!==t+0)throw t;Ot(1,0)}},n:function(t){return t},F:function(t){ft=t},ha:yt,y:function(t,e,n,r){return yt(t,e,n,r)}};!function(){function t(t){e.asm=t.exports,O=e.asm.Ka,P(),U=e.asm.ib,I.unshift(e.asm.La),B--,e.monitorRunDependencies&&e.monitorRunDependencies(B),0==B&&(null!==G&&(clearInterval(G),G=null),N&&(t=N,N=null,t()))}function n(e){t(e.instance)}function r(t){return function(){if(!g&&(d||y)){if("function"==typeof fetch&&!Y.startsWith("file://"))return fetch(Y,{credentials:"same-origin"}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at \'"+Y+"\'";return t.arrayBuffer()})).catch((function(){return X()}));if(o)return new Promise((function(t,e){o(Y,(function(e){t(new Uint8Array(e))}),e)}))}return Promise.resolve().then((function(){return X()}))}().then((function(t){return WebAssembly.instantiate(t,i)})).then((function(t){return t})).then(t,(function(t){w("failed to asynchronously prepare wasm: "+t),V(t)}))}var i={a:bt};if(B++,e.monitorRunDependencies&&e.monitorRunDependencies(B),e.instantiateWasm)try{return e.instantiateWasm(i,t)}catch(t){return w("Module.instantiateWasm callback failed with error: "+t),!1}(g||"function"!=typeof WebAssembly.instantiateStreaming||$()||Y.startsWith("file://")||b||"function"!=typeof fetch?r(n):fetch(Y,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,i).then(n,(function(t){return w("wasm streaming compile failed: "+t),w("falling back to ArrayBuffer instantiation"),r(n)}))}))).catch(a)}(),e.___wasm_call_ctors=function(){return(e.___wasm_call_ctors=e.asm.La).apply(null,arguments)},e._OrtInit=function(){return(e._OrtInit=e.asm.Ma).apply(null,arguments)},e._OrtCreateSessionOptions=function(){return(e._OrtCreateSessionOptions=e.asm.Na).apply(null,arguments)},e._OrtAppendExecutionProvider=function(){return(e._OrtAppendExecutionProvider=e.asm.Oa).apply(null,arguments)},e._OrtAddSessionConfigEntry=function(){return(e._OrtAddSessionConfigEntry=e.asm.Pa).apply(null,arguments)},e._OrtReleaseSessionOptions=function(){return(e._OrtReleaseSessionOptions=e.asm.Qa).apply(null,arguments)},e._OrtCreateSession=function(){return(e._OrtCreateSession=e.asm.Ra).apply(null,arguments)},e._OrtReleaseSession=function(){return(e._OrtReleaseSession=e.asm.Sa).apply(null,arguments)},e._OrtGetInputCount=function(){return(e._OrtGetInputCount=e.asm.Ta).apply(null,arguments)},e._OrtGetOutputCount=function(){return(e._OrtGetOutputCount=e.asm.Ua).apply(null,arguments)},e._OrtGetInputName=function(){return(e._OrtGetInputName=e.asm.Va).apply(null,arguments)},e._OrtGetOutputName=function(){return(e._OrtGetOutputName=e.asm.Wa).apply(null,arguments)},e._OrtFree=function(){return(e._OrtFree=e.asm.Xa).apply(null,arguments)},e._OrtCreateTensor=function(){return(e._OrtCreateTensor=e.asm.Ya).apply(null,arguments)},e._OrtGetTensorData=function(){return(e._OrtGetTensorData=e.asm.Za).apply(null,arguments)},e._OrtReleaseTensor=function(){return(e._OrtReleaseTensor=e.asm._a).apply(null,arguments)},e._OrtCreateRunOptions=function(){return(e._OrtCreateRunOptions=e.asm.$a).apply(null,arguments)},e._OrtAddRunConfigEntry=function(){return(e._OrtAddRunConfigEntry=e.asm.ab).apply(null,arguments)},e._OrtReleaseRunOptions=function(){return(e._OrtReleaseRunOptions=e.asm.bb).apply(null,arguments)},e._OrtRun=function(){return(e._OrtRun=e.asm.cb).apply(null,arguments)},e._OrtEndProfiling=function(){return(e._OrtEndProfiling=e.asm.db).apply(null,arguments)};var mt,gt=e._malloc=function(){return(gt=e._malloc=e.asm.eb).apply(null,arguments)},vt=e._free=function(){return(vt=e._free=e.asm.fb).apply(null,arguments)},wt=e._fflush=function(){return(wt=e._fflush=e.asm.gb).apply(null,arguments)},_t=e.___funcs_on_exit=function(){return(_t=e.___funcs_on_exit=e.asm.hb).apply(null,arguments)},Ot=e._setThrew=function(){return(Ot=e._setThrew=e.asm.jb).apply(null,arguments)},At=e.stackSave=function(){return(At=e.stackSave=e.asm.kb).apply(null,arguments)},St=e.stackRestore=function(){return(St=e.stackRestore=e.asm.lb).apply(null,arguments)},Tt=e.stackAlloc=function(){return(Tt=e.stackAlloc=e.asm.mb).apply(null,arguments)},Et=e.___cxa_can_catch=function(){return(Et=e.___cxa_can_catch=e.asm.nb).apply(null,arguments)},Mt=e.___cxa_is_pointer_type=function(){return(Mt=e.___cxa_is_pointer_type=e.asm.ob).apply(null,arguments)},Ct=e.dynCall_j=function(){return(Ct=e.dynCall_j=e.asm.pb).apply(null,arguments)},xt=e.dynCall_iiiiij=function(){return(xt=e.dynCall_iiiiij=e.asm.qb).apply(null,arguments)},Rt=e.dynCall_jii=function(){return(Rt=e.dynCall_jii=e.asm.rb).apply(null,arguments)},jt=e.dynCall_viiiiij=function(){return(jt=e.dynCall_viiiiij=e.asm.sb).apply(null,arguments)},kt=e.dynCall_vjji=function(){return(kt=e.dynCall_vjji=e.asm.tb).apply(null,arguments)},Dt=e.dynCall_viiijjjii=function(){return(Dt=e.dynCall_viiijjjii=e.asm.ub).apply(null,arguments)},Pt=e.dynCall_iij=function(){return(Pt=e.dynCall_iij=e.asm.vb).apply(null,arguments)},Ut=e.dynCall_ji=function(){return(Ut=e.dynCall_ji=e.asm.wb).apply(null,arguments)},Ft=e.dynCall_iiiiiij=function(){return(Ft=e.dynCall_iiiiiij=e.asm.xb).apply(null,arguments)},It=e.dynCall_iiij=function(){return(It=e.dynCall_iiij=e.asm.yb).apply(null,arguments)};function Wt(){function t(){if(!mt&&(mt=!0,e.calledRun=!0,!C)){if(Z(I),r(e),e.onRuntimeInitialized&&e.onRuntimeInitialized(),e.postRun)for("function"==typeof e.postRun&&(e.postRun=[e.postRun]);e.postRun.length;){var t=e.postRun.shift();H.unshift(t)}Z(H)}}if(!(0{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.iterateExtraOptions=void 0,e.iterateExtraOptions=(t,n,r,a)=>{if("object"==typeof t&&null!==t){if(r.has(t))throw new Error("Circular reference in options");r.add(t)}Object.entries(t).forEach((([t,i])=>{const o=n?n+t:t;if("object"==typeof i)(0,e.iterateExtraOptions)(i,o+".",r,a);else if("string"==typeof i||"number"==typeof i)a(o,i.toString());else{if("boolean"!=typeof i)throw new Error("Can\'t handle extra config type: "+typeof i);a(o,i?"1":"0")}}))}},586:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.setRunOptions=void 0;const r=n(967),a=n(983),i=n(361);e.setRunOptions=t=>{const e=(0,i.getInstance)();let n=0;const o=[],u=t||{};try{if(void 0===(null==t?void 0:t.logSeverityLevel))u.logSeverityLevel=2;else if("number"!=typeof t.logSeverityLevel||!Number.isInteger(t.logSeverityLevel)||t.logSeverityLevel<0||t.logSeverityLevel>4)throw new Error(`log serverity level is not valid: ${t.logSeverityLevel}`);if(void 0===(null==t?void 0:t.logVerbosityLevel))u.logVerbosityLevel=0;else if("number"!=typeof t.logVerbosityLevel||!Number.isInteger(t.logVerbosityLevel))throw new Error(`log verbosity level is not valid: ${t.logVerbosityLevel}`);void 0===(null==t?void 0:t.terminate)&&(u.terminate=!1);let i=0;if(void 0!==(null==t?void 0:t.tag)&&(i=(0,a.allocWasmString)(t.tag,o)),n=e._OrtCreateRunOptions(u.logSeverityLevel,u.logVerbosityLevel,!!u.terminate,i),0===n)throw new Error("Can\'t create run options");return void 0!==(null==t?void 0:t.extra)&&(0,r.iterateExtraOptions)(t.extra,"",new WeakSet,((t,r)=>{const i=(0,a.allocWasmString)(t,o),u=(0,a.allocWasmString)(r,o);if(0!==e._OrtAddRunConfigEntry(n,i,u))throw new Error(`Can\'t set a run config entry: ${t} - ${r}`)})),[n,o]}catch(t){throw 0!==n&&e._OrtReleaseRunOptions(n),o.forEach(e._free),t}}},919:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.setSessionOptions=void 0;const r=n(967),a=n(983),i=n(361);e.setSessionOptions=t=>{const e=(0,i.getInstance)();let n=0;const o=[],u=t||{};(t=>{t.extra||(t.extra={}),t.extra.session||(t.extra.session={});const e=t.extra.session;e.use_ort_model_bytes_directly||(e.use_ort_model_bytes_directly="1")})(u);try{void 0===(null==t?void 0:t.graphOptimizationLevel)&&(u.graphOptimizationLevel="all");const c=(t=>{switch(t){case"disabled":return 0;case"basic":return 1;case"extended":return 2;case"all":return 99;default:throw new Error(`unsupported graph optimization level: ${t}`)}})(u.graphOptimizationLevel);void 0===(null==t?void 0:t.enableCpuMemArena)&&(u.enableCpuMemArena=!0),void 0===(null==t?void 0:t.enableMemPattern)&&(u.enableMemPattern=!0),void 0===(null==t?void 0:t.executionMode)&&(u.executionMode="sequential");const s=(t=>{switch(t){case"sequential":return 0;case"parallel":return 1;default:throw new Error(`unsupported execution mode: ${t}`)}})(u.executionMode);let l=0;if(void 0!==(null==t?void 0:t.logId)&&(l=(0,a.allocWasmString)(t.logId,o)),void 0===(null==t?void 0:t.logSeverityLevel))u.logSeverityLevel=2;else if("number"!=typeof t.logSeverityLevel||!Number.isInteger(t.logSeverityLevel)||t.logSeverityLevel<0||t.logSeverityLevel>4)throw new Error(`log serverity level is not valid: ${t.logSeverityLevel}`);if(void 0===(null==t?void 0:t.logVerbosityLevel))u.logVerbosityLevel=0;else if("number"!=typeof t.logVerbosityLevel||!Number.isInteger(t.logVerbosityLevel))throw new Error(`log verbosity level is not valid: ${t.logVerbosityLevel}`);if(void 0===(null==t?void 0:t.enableProfiling)&&(u.enableProfiling=!1),n=e._OrtCreateSessionOptions(c,!!u.enableCpuMemArena,!!u.enableMemPattern,s,!!u.enableProfiling,0,l,u.logSeverityLevel,u.logVerbosityLevel),0===n)throw new Error("Can\'t create session options");return(null==t?void 0:t.executionProviders)&&((t,e,n)=>{for(const r of e){let e="string"==typeof r?r:r.name;switch(e){case"xnnpack":e="XNNPACK";break;case"wasm":case"cpu":continue;default:throw new Error(`not supported EP: ${e}`)}const o=(0,a.allocWasmString)(e,n);if(0!==(0,i.getInstance)()._OrtAppendExecutionProvider(t,o))throw new Error(`Can\'t append execution provider: ${e}`)}})(n,t.executionProviders,o),void 0!==(null==t?void 0:t.extra)&&(0,r.iterateExtraOptions)(t.extra,"",new WeakSet,((t,r)=>{const i=(0,a.allocWasmString)(t,o),u=(0,a.allocWasmString)(r,o);if(0!==e._OrtAddSessionConfigEntry(n,i,u))throw new Error(`Can\'t set a session config entry: ${t} - ${r}`)})),[n,o]}catch(t){throw 0!==n&&e._OrtReleaseSessionOptions(n),o.forEach(e._free),t}}},983:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.allocWasmString=void 0;const r=n(361);e.allocWasmString=(t,e)=>{const n=(0,r.getInstance)(),a=n.lengthBytesUTF8(t)+1,i=n._malloc(a);return n.stringToUTF8(t,i,a),e.push(i),i}},349:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.extractTransferableBuffers=e.endProfiling=e.run=e.releaseSession=e.createSession=e.createSessionFinalize=e.createSessionAllocate=e.initOrt=void 0;const r=n(586),a=n(919),i=n(983),o=n(361);e.initOrt=(t,e)=>{const n=(0,o.getInstance)()._OrtInit(t,e);if(0!==n)throw new Error(`Can\'t initialize onnxruntime. error code = ${n}`)};const u=new Map;e.createSessionAllocate=t=>{const e=(0,o.getInstance)(),n=e._malloc(t.byteLength);return e.HEAPU8.set(t,n),[n,t.byteLength]},e.createSessionFinalize=(t,e)=>{const n=(0,o.getInstance)();let r=0,i=0,c=[];try{if([i,c]=(0,a.setSessionOptions)(e),r=n._OrtCreateSession(t[0],t[1],i),0===r)throw new Error("Can\'t create a session")}finally{n._free(t[0]),n._OrtReleaseSessionOptions(i),c.forEach(n._free)}const s=n._OrtGetInputCount(r),l=n._OrtGetOutputCount(r),f=[],p=[],h=[],d=[];for(let t=0;t{const r=(0,e.createSessionAllocate)(t);return(0,e.createSessionFinalize)(r,n)},e.releaseSession=t=>{const e=(0,o.getInstance)(),n=u.get(t);if(!n)throw new Error("invalid session id");const r=n[0],a=n[1],i=n[2];a.forEach(e._OrtFree),i.forEach(e._OrtFree),e._OrtReleaseSession(r),u.delete(t)};const c=t=>{switch(t){case"int8":return 3;case"uint8":return 2;case"bool":return 9;case"int16":return 5;case"uint16":return 4;case"int32":return 6;case"uint32":return 12;case"float32":return 1;case"float64":return 11;case"string":return 8;case"int64":return 7;case"uint64":return 13;default:throw new Error(`unsupported data type: ${t}`)}},s=t=>{switch(t){case 3:return"int8";case 2:return"uint8";case 9:return"bool";case 5:return"int16";case 4:return"uint16";case 6:return"int32";case 12:return"uint32";case 1:return"float32";case 11:return"float64";case 8:return"string";case 7:return"int64";case 13:return"uint64";default:throw new Error(`unsupported data type: ${t}`)}},l=t=>{switch(t){case"float32":return Float32Array;case"uint8":case"bool":return Uint8Array;case"int8":return Int8Array;case"uint16":return Uint16Array;case"int16":return Int16Array;case"int32":return Int32Array;case"float64":return Float64Array;case"uint32":return Uint32Array;case"int64":return BigInt64Array;case"uint64":return BigUint64Array;default:throw new Error(`unsupported type: ${t}`)}};e.run=(t,e,n,a,f)=>{const p=(0,o.getInstance)(),h=u.get(t);if(!h)throw new Error("invalid session id");const d=h[0],y=h[1],b=h[2],m=e.length,g=a.length;let v=0,w=[];const _=[],O=[];try{[v,w]=(0,r.setRunOptions)(f);for(let t=0;tp.HEAP32[t++]=e));const n=p._OrtCreateTensor(c(e),o,u,l,r.length);if(0===n)throw new Error("Can\'t create a tensor");_.push(n)}finally{p.stackRestore(s)}}const t=p.stackSave(),o=p.stackAlloc(4*m),u=p.stackAlloc(4*m),h=p.stackAlloc(4*g),A=p.stackAlloc(4*g);try{let n=o/4,r=u/4,i=h/4,c=A/4;for(let t=0;tt*e));if(a=s(o),"string"===a){const t=[];let e=i/4;for(let n=0;n{const e=(0,o.getInstance)(),n=u.get(t);if(!n)throw new Error("invalid session id");const r=n[0],a=e._OrtEndProfiling(r);if(0===a)throw new Error("Can\'t get an profile file name");e._OrtFree(a)},e.extractTransferableBuffers=t=>{const e=[];for(const n of t){const t=n[2];!Array.isArray(t)&&t.buffer&&e.push(t.buffer)}return e}},361:function(t,e,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n);var a=Object.getOwnPropertyDescriptor(e,n);a&&!("get"in a?!e.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,a)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),a=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&r(e,t,n);return a(e,t),e},o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.dispose=e.getInstance=e.initializeWebAssembly=void 0;const u=i(n(449)),c=o(n(932)),s=n(474);let l,f=!1,p=!1,h=!1;const d=(t,e)=>e?t?"ort-wasm-simd-threaded.wasm":"ort-wasm-threaded.wasm":t?"ort-wasm-simd.wasm":"ort-wasm.wasm";e.initializeWebAssembly=async t=>{if(f)return Promise.resolve();if(p)throw new Error("multiple calls to \'initializeWebAssembly()\' detected.");if(h)throw new Error("previous call to \'initializeWebAssembly()\' failed.");p=!0;const e=t.initTimeout,r=t.numThreads,a=t.simd,i=r>1&&(()=>{try{return"undefined"!=typeof SharedArrayBuffer&&("undefined"!=typeof MessageChannel&&(new MessageChannel).port1.postMessage(new SharedArrayBuffer(1)),WebAssembly.validate(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])))}catch(t){return!1}})(),o=a&&(()=>{try{return WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,30,1,28,0,65,0,253,15,253,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,253,186,1,26,11]))}catch(t){return!1}})(),y="string"==typeof t.wasmPaths?t.wasmPaths:void 0,b=d(!1,i),m=d(o,i),g="object"==typeof t.wasmPaths?t.wasmPaths[m]:void 0;let v=!1;const w=[];if(e>0&&w.push(new Promise((t=>{setTimeout((()=>{v=!0,t()}),e)}))),w.push(new Promise(((t,e)=>{const r=i?s:c.default,a={locateFile:(t,e)=>i&&t.endsWith(".worker.js")&&"undefined"!=typeof Blob?URL.createObjectURL(new Blob([n(154)],{type:"text/javascript"})):t===b?null!=g?g:(null!=y?y:e)+m:e+t};if(i)if("undefined"==typeof Blob)a.mainScriptUrlOrBlob=u.join("/","ort-wasm-threaded.js");else{const t=`var ortWasmThreaded=(function(){var _scriptDir;return ${r.toString()}})();`;a.mainScriptUrlOrBlob=new Blob([t],{type:"text/javascript"})}r(a).then((e=>{p=!1,f=!0,l=e,t()}),(t=>{p=!1,h=!0,e(t)}))}))),await Promise.race(w),v)throw new Error(`WebAssembly backend initializing failed due to timeout: ${e}ms`)},e.getInstance=()=>{if(f&&l)return l;throw new Error("WebAssembly is not initialized yet.")},e.dispose=()=>{var t;!f||p||h||(p=!0,null===(t=l.PThread)||void 0===t||t.terminateAllThreads(),l=void 0,p=!1,f=!1,h=!0)}},154:t=>{"use strict";t.exports=\'"use strict";var e={},t="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node;if(t){var r=require("worker_threads"),a=r.parentPort;a.on("message",(e=>onmessage({data:e})));var o=require("fs");Object.assign(global,{self:global,require:require,Module:e,location:{href:__filename},Worker:r.Worker,importScripts:function(e){(0,eval)(o.readFileSync(e,"utf8"))},postMessage:function(e){a.postMessage(e)},performance:global.performance||{now:function(){return Date.now()}}})}var s=!1,n=[],i=function(){var e=Array.prototype.slice.call(arguments).join(" ");t?o.writeSync(2,e+"\\\\n"):console.error(e)};self.alert=function(){var t=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:t,threadId:e._pthread_self()})},e.instantiateWasm=(t,r)=>{var a=new WebAssembly.Instance(e.wasmModule,t);return r(a),e.wasmModule=null,a.exports},self.onunhandledrejection=e=>{throw e.reason??e},self.onmessage=t=>{try{if("load"===t.data.cmd){if(e.wasmModule=t.data.wasmModule,e.wasmMemory=t.data.wasmMemory,e.buffer=e.wasmMemory.buffer,e.ENVIRONMENT_IS_PTHREAD=!0,"string"==typeof t.data.urlOrBlob)importScripts(t.data.urlOrBlob);else{var r=URL.createObjectURL(t.data.urlOrBlob);importScripts(r),URL.revokeObjectURL(r)}ortWasmThreaded(e).then((function(t){e=t}))}else if("run"===t.data.cmd){e.__performance_now_clock_drift=performance.now()-t.data.time,e.__emscripten_thread_init(t.data.pthread_ptr,0,0,1),e.establishStackSpace(),e.PThread.receiveObjectTransfer(t.data),e.PThread.threadInitTLS(),s||(n.forEach((t=>{e.executeNotifiedProxyingQueue(t)})),n=[],s=!0);try{e.invokeEntryPoint(t.data.start_routine,t.data.arg)}catch(t){if("unwind"!=t){if(!(t instanceof e.ExitStatus))throw t;e.keepRuntimeAlive()||e.__emscripten_thread_exit(t.status)}}}else"cancel"===t.data.cmd?e._pthread_self()&&e.__emscripten_thread_exit(-1):"setimmediate"===t.data.target||("processProxyingQueue"===t.data.cmd?s?e.executeNotifiedProxyingQueue(t.data.queue):n.push(t.data.queue):(i("worker.js received unknown command "+t.data.cmd),i(t.data)))}catch(t){throw i("worker.js onmessage() captured an uncaught exception: "+t),t&&t.stack&&i(t.stack),e.__emscripten_thread_crashed&&e.__emscripten_thread_crashed(),t}};\\n\'},384:()=>{},993:()=>{},908:()=>{},953:()=>{},925:()=>{},449:()=>{}},e={};function n(r){var a=e[r];if(void 0!==a)return a.exports;var i=e[r]={exports:{}};return t[r].call(i.exports,i,i.exports,n),i.exports}n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),(()=>{"use strict";const t=n(349),e=n(361);self.onmessage=n=>{switch(n.data.type){case"init-wasm":(0,e.initializeWebAssembly)(n.data.in).then((()=>postMessage({type:"init-wasm"})),(t=>postMessage({type:"init-wasm",err:t})));break;case"init-ort":try{const{numThreads:e,loggingLevel:r}=n.data.in;(0,t.initOrt)(e,r),postMessage({type:"init-ort"})}catch(t){postMessage({type:"init-ort",err:t})}break;case"create_allocate":try{const{model:e}=n.data.in,r=(0,t.createSessionAllocate)(e);postMessage({type:"create_allocate",out:r})}catch(t){postMessage({type:"create_allocate",err:t})}break;case"create_finalize":try{const{modeldata:e,options:r}=n.data.in,a=(0,t.createSessionFinalize)(e,r);postMessage({type:"create_finalize",out:a})}catch(t){postMessage({type:"create_finalize",err:t})}break;case"create":try{const{model:e,options:r}=n.data.in,a=(0,t.createSession)(e,r);postMessage({type:"create",out:a})}catch(t){postMessage({type:"create",err:t})}break;case"release":try{const e=n.data.in;(0,t.releaseSession)(e),postMessage({type:"release"})}catch(t){postMessage({type:"release",err:t})}break;case"run":try{const{sessionId:e,inputIndices:r,inputs:a,outputIndices:i,options:o}=n.data.in,u=(0,t.run)(e,r,a,i,o);postMessage({type:"run",out:u},(0,t.extractTransferableBuffers)(u))}catch(t){postMessage({type:"run",err:t})}break;case"end-profiling":try{const e=n.data.in;(0,t.endProfiling)(e),postMessage({type:"end-profiling"})}catch(t){postMessage({type:"end-profiling",err:t})}}}})()})();\n',"Worker",void 0,void 0)}},477:D=>{D.exports=function(u,b,g,p){var h=self||window;try{try{var o;try{o=new h.Blob([u])}catch{(o=new(h.BlobBuilder||h.WebKitBlobBuilder||h.MozBlobBuilder||h.MSBlobBuilder)).append(u),o=o.getBlob()}var c=h.URL||h.webkitURL,f=c.createObjectURL(o),s=new h[b](f,g);return c.revokeObjectURL(f),s}catch{return new h[b]("data:application/javascript,".concat(encodeURIComponent(u)),g)}}catch{if(!p)throw Error("Inline worker is not supported");return new h[b](p,g)}}},4154:D=>{D.exports=`"use strict";var e={},t="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node;if(t){var r=require("worker_threads"),a=r.parentPort;a.on("message",(e=>onmessage({data:e})));var o=require("fs");Object.assign(global,{self:global,require:require,Module:e,location:{href:__filename},Worker:r.Worker,importScripts:function(e){(0,eval)(o.readFileSync(e,"utf8"))},postMessage:function(e){a.postMessage(e)},performance:global.performance||{now:function(){return Date.now()}}})}var s=!1,n=[],i=function(){var e=Array.prototype.slice.call(arguments).join(" ");t?o.writeSync(2,e+"\\n"):console.error(e)};self.alert=function(){var t=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:t,threadId:e._pthread_self()})},e.instantiateWasm=(t,r)=>{var a=new WebAssembly.Instance(e.wasmModule,t);return r(a),e.wasmModule=null,a.exports},self.onunhandledrejection=e=>{throw e.reason??e},self.onmessage=t=>{try{if("load"===t.data.cmd){if(e.wasmModule=t.data.wasmModule,e.wasmMemory=t.data.wasmMemory,e.buffer=e.wasmMemory.buffer,e.ENVIRONMENT_IS_PTHREAD=!0,"string"==typeof t.data.urlOrBlob)importScripts(t.data.urlOrBlob);else{var r=URL.createObjectURL(t.data.urlOrBlob);importScripts(r),URL.revokeObjectURL(r)}ortWasmThreaded(e).then((function(t){e=t}))}else if("run"===t.data.cmd){e.__performance_now_clock_drift=performance.now()-t.data.time,e.__emscripten_thread_init(t.data.pthread_ptr,0,0,1),e.establishStackSpace(),e.PThread.receiveObjectTransfer(t.data),e.PThread.threadInitTLS(),s||(n.forEach((t=>{e.executeNotifiedProxyingQueue(t)})),n=[],s=!0);try{e.invokeEntryPoint(t.data.start_routine,t.data.arg)}catch(t){if("unwind"!=t){if(!(t instanceof e.ExitStatus))throw t;e.keepRuntimeAlive()||e.__emscripten_thread_exit(t.status)}}}else"cancel"===t.data.cmd?e._pthread_self()&&e.__emscripten_thread_exit(-1):"setimmediate"===t.data.target||("processProxyingQueue"===t.data.cmd?s?e.executeNotifiedProxyingQueue(t.data.queue):n.push(t.data.queue):(i("worker.js received unknown command "+t.data.cmd),i(t.data)))}catch(t){throw i("worker.js onmessage() captured an uncaught exception: "+t),t&&t.stack&&i(t.stack),e.__emscripten_thread_crashed&&e.__emscripten_thread_crashed(),t}}; -`},1670:D=>{D.exports=__WEBPACK_EXTERNAL_MODULE__1670__},7067:()=>{},1296:()=>{},1384:()=>{},3993:()=>{},908:()=>{},6953:()=>{},9925:()=>{},2806:()=>{},6449:()=>{},2850:()=>{},5381:()=>{},5686:(D,u,b)=>{b.r(u),b.d(u,{flatbuffers:()=>g});var g={};g.Offset,g.Table,g.SIZEOF_SHORT=2,g.SIZEOF_INT=4,g.FILE_IDENTIFIER_LENGTH=4,g.SIZE_PREFIX_LENGTH=4,g.Encoding={UTF8_BYTES:1,UTF16_STRING:2},g.int32=new Int32Array(2),g.float32=new Float32Array(g.int32.buffer),g.float64=new Float64Array(g.int32.buffer),g.isLittleEndian=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1,g.Long=function(p,h){this.low=0|p,this.high=0|h},g.Long.create=function(p,h){return p==0&&h==0?g.Long.ZERO:new g.Long(p,h)},g.Long.prototype.toFloat64=function(){return(this.low>>>0)+4294967296*this.high},g.Long.prototype.equals=function(p){return this.low==p.low&&this.high==p.high},g.Long.ZERO=new g.Long(0,0),g.Builder=function(p){if(p)h=p;else var h=1024;this.bb=g.ByteBuffer.allocate(h),this.space=h,this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1},g.Builder.prototype.clear=function(){this.bb.clear(),this.space=this.bb.capacity(),this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1},g.Builder.prototype.forceDefaults=function(p){this.force_defaults=p},g.Builder.prototype.dataBuffer=function(){return this.bb},g.Builder.prototype.asUint8Array=function(){return this.bb.bytes().subarray(this.bb.position(),this.bb.position()+this.offset())},g.Builder.prototype.prep=function(p,h){p>this.minalign&&(this.minalign=p);for(var o=1+~(this.bb.capacity()-this.space+h)&p-1;this.space=0&&this.vtable[h]==0;h--);for(var o=h+1;h>=0;h--)this.addInt16(this.vtable[h]!=0?p-this.vtable[h]:0);this.addInt16(p-this.object_start);var c=(o+2)*g.SIZEOF_SHORT;this.addInt16(c);var f=0,s=this.space;e:for(h=0;h=0;s--)this.writeInt8(f.charCodeAt(s))}this.prep(this.minalign,g.SIZEOF_INT+c),this.addOffset(p),c&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)},g.Builder.prototype.finishSizePrefixed=function(p,h){this.finish(p,h,!0)},g.Builder.prototype.requiredField=function(p,h){var o=this.bb.capacity()-p,c=o-this.bb.readInt32(o);if(this.bb.readInt16(c+h)==0)throw new Error("FlatBuffers: field "+h+" must be set")},g.Builder.prototype.startVector=function(p,h,o){this.notNested(),this.vector_num_elems=h,this.prep(g.SIZEOF_INT,p*h),this.prep(o,p*h)},g.Builder.prototype.endVector=function(){return this.writeInt32(this.vector_num_elems),this.offset()},g.Builder.prototype.createString=function(p){if(p instanceof Uint8Array)var h=p;else{h=[];for(var o=0;o=56320?f:(f<<10)+p.charCodeAt(o++)+-56613888)<128?h.push(c):(c<2048?h.push(c>>6&31|192):(c<65536?h.push(c>>12&15|224):h.push(c>>18&7|240,c>>12&63|128),h.push(c>>6&63|128)),h.push(63&c|128))}}this.addInt8(0),this.startVector(1,h.length,1),this.bb.setPosition(this.space-=h.length),o=0;for(var s=this.space,i=this.bb.bytes();o>24},g.ByteBuffer.prototype.readUint8=function(p){return this.bytes_[p]},g.ByteBuffer.prototype.readInt16=function(p){return this.readUint16(p)<<16>>16},g.ByteBuffer.prototype.readUint16=function(p){return this.bytes_[p]|this.bytes_[p+1]<<8},g.ByteBuffer.prototype.readInt32=function(p){return this.bytes_[p]|this.bytes_[p+1]<<8|this.bytes_[p+2]<<16|this.bytes_[p+3]<<24},g.ByteBuffer.prototype.readUint32=function(p){return this.readInt32(p)>>>0},g.ByteBuffer.prototype.readInt64=function(p){return new g.Long(this.readInt32(p),this.readInt32(p+4))},g.ByteBuffer.prototype.readUint64=function(p){return new g.Long(this.readUint32(p),this.readUint32(p+4))},g.ByteBuffer.prototype.readFloat32=function(p){return g.int32[0]=this.readInt32(p),g.float32[0]},g.ByteBuffer.prototype.readFloat64=function(p){return g.int32[g.isLittleEndian?0:1]=this.readInt32(p),g.int32[g.isLittleEndian?1:0]=this.readInt32(p+4),g.float64[0]},g.ByteBuffer.prototype.writeInt8=function(p,h){this.bytes_[p]=h},g.ByteBuffer.prototype.writeUint8=function(p,h){this.bytes_[p]=h},g.ByteBuffer.prototype.writeInt16=function(p,h){this.bytes_[p]=h,this.bytes_[p+1]=h>>8},g.ByteBuffer.prototype.writeUint16=function(p,h){this.bytes_[p]=h,this.bytes_[p+1]=h>>8},g.ByteBuffer.prototype.writeInt32=function(p,h){this.bytes_[p]=h,this.bytes_[p+1]=h>>8,this.bytes_[p+2]=h>>16,this.bytes_[p+3]=h>>24},g.ByteBuffer.prototype.writeUint32=function(p,h){this.bytes_[p]=h,this.bytes_[p+1]=h>>8,this.bytes_[p+2]=h>>16,this.bytes_[p+3]=h>>24},g.ByteBuffer.prototype.writeInt64=function(p,h){this.writeInt32(p,h.low),this.writeInt32(p+4,h.high)},g.ByteBuffer.prototype.writeUint64=function(p,h){this.writeUint32(p,h.low),this.writeUint32(p+4,h.high)},g.ByteBuffer.prototype.writeFloat32=function(p,h){g.float32[0]=h,this.writeInt32(p,g.int32[0])},g.ByteBuffer.prototype.writeFloat64=function(p,h){g.float64[0]=h,this.writeInt32(p,g.int32[g.isLittleEndian?0:1]),this.writeInt32(p+4,g.int32[g.isLittleEndian?1:0])},g.ByteBuffer.prototype.getBufferIdentifier=function(){if(this.bytes_.length>10),56320+(1023&s)))}return c},g.ByteBuffer.prototype.__indirect=function(p){return p+this.readInt32(p)},g.ByteBuffer.prototype.__vector=function(p){return p+this.readInt32(p)+g.SIZEOF_INT},g.ByteBuffer.prototype.__vector_len=function(p){return this.readInt32(p+this.readInt32(p))},g.ByteBuffer.prototype.__has_identifier=function(p){if(p.length!=g.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: file identifier must be length "+g.FILE_IDENTIFIER_LENGTH);for(var h=0;h{var u=D&&D.__esModule?()=>D.default:()=>D;return __webpack_require__.d(u,{a:u}),u},__webpack_require__.d=(D,u)=>{for(var b in u)__webpack_require__.o(u,b)&&!__webpack_require__.o(D,b)&&Object.defineProperty(D,b,{enumerable:!0,get:u[b]})},__webpack_require__.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}(),__webpack_require__.o=(D,u)=>Object.prototype.hasOwnProperty.call(D,u),__webpack_require__.r=D=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(D,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(D,"__esModule",{value:!0})};var __webpack_exports__=__webpack_require__(6018);return __webpack_exports__})())}(ortWeb_min)),ortWeb_min.exports}var models={},common={},hasRequiredCommon;function requireCommon(){return hasRequiredCommon||(hasRequiredCommon=1,Object.defineProperty(common,"__esModule",{value:!0})),common}var legacy={},hasRequiredLegacy;function requireLegacy(){if(hasRequiredLegacy)return legacy;hasRequiredLegacy=1;var D;Object.defineProperty(legacy,"__esModule",{value:!0}),legacy.SileroLegacy=void 0;const u=requireLogging();class b{constructor(p,h,o,c,f){this.ortInstance=p,this._session=h,this._h=o,this._c=c,this._sr=f,this.reset_state=()=>{const s=Array(128).fill(0);this._h=new this.ortInstance.Tensor("float32",s,[2,1,64]),this._c=new this.ortInstance.Tensor("float32",s,[2,1,64])},this.process=async s=>{var a;const t={input:new this.ortInstance.Tensor("float32",s,[1,s.length]),h:this._h,c:this._c,sr:this._sr},e=await this._session.run(t);this._h=e.hn,this._c=e.cn;const[n]=(a=e.output)==null?void 0:a.data;return{notSpeech:1-n,isSpeech:n}}}}return legacy.SileroLegacy=b,D=b,b.new=async(g,p)=>{u.log.debug("initializing vad");const h=await p(),o=await g.InferenceSession.create(h),c=new g.Tensor("int64",[16000n]),f=Array(2*64).fill(0),s=new g.Tensor("float32",f,[2,1,64]),i=new g.Tensor("float32",f,[2,1,64]);return u.log.debug("vad is initialized"),new D(g,o,s,i,c)},legacy}var v5={},hasRequiredV5;function requireV5(){if(hasRequiredV5)return v5;hasRequiredV5=1;var D;Object.defineProperty(v5,"__esModule",{value:!0}),v5.SileroV5=void 0;const u=requireLogging();function b(p){const h=Array(256).fill(0);return new p.Tensor("float32",h,[2,1,128])}class g{constructor(h,o,c,f){this._session=h,this._state=o,this._sr=c,this.ortInstance=f,this.reset_state=()=>{this._state=b(this.ortInstance)},this.process=async s=>{var a;const t={input:new this.ortInstance.Tensor("float32",s,[1,s.length]),state:this._state,sr:this._sr},e=await this._session.run(t);this._state=e.stateN;const[n]=(a=e.output)==null?void 0:a.data;return{notSpeech:1-n,isSpeech:n}}}}return v5.SileroV5=g,D=g,g.new=async(p,h)=>{u.log.debug("Loading VAD...");const o=await h(),c=await p.InferenceSession.create(o),f=new p.Tensor("int64",[16000n]),s=b(p);return u.log.debug("...finished loading VAD"),new D(c,s,f,p)},v5}var hasRequiredModels;function requireModels(){return hasRequiredModels||(hasRequiredModels=1,function(D){var u=models&&models.__createBinding||(Object.create?function(h,o,c,f){f===void 0&&(f=c);var s=Object.getOwnPropertyDescriptor(o,c);(!s||("get"in s?!o.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return o[c]}}),Object.defineProperty(h,f,s)}:function(h,o,c,f){f===void 0&&(f=c),h[f]=o[c]}),b=models&&models.__exportStar||function(h,o){for(var c in h)c!=="default"&&!Object.prototype.hasOwnProperty.call(o,c)&&u(o,h,c)};Object.defineProperty(D,"__esModule",{value:!0}),D.SileroV5=D.SileroLegacy=void 0,b(requireCommon(),D);var g=requireLegacy();Object.defineProperty(D,"SileroLegacy",{enumerable:!0,get:function(){return g.SileroLegacy}});var p=requireV5();Object.defineProperty(D,"SileroV5",{enumerable:!0,get:function(){return p.SileroV5}})}(models)),models}var resampler={},hasRequiredResampler;function requireResampler(){if(hasRequiredResampler)return resampler;hasRequiredResampler=1,Object.defineProperty(resampler,"__esModule",{value:!0}),resampler.Resampler=void 0;const D=requireLogging();class u{constructor(g){this.options=g,this.process=p=>{const h=[];for(const o of p)for(this.inputBuffer.push(o);this.hasEnoughDataForFrame();){const c=this.generateOutputFrame();h.push(c)}return h},g.nativeSampleRate<16e3&&D.log.error("nativeSampleRate is too low. Should have 16000 = targetSampleRate <= nativeSampleRate"),this.inputBuffer=[]}async*stream(g){for(const p of g)for(this.inputBuffer.push(p);this.hasEnoughDataForFrame();)yield this.generateOutputFrame()}hasEnoughDataForFrame(){return this.inputBuffer.length*this.options.targetSampleRate/this.options.nativeSampleRate>=this.options.targetFrameSize}generateOutputFrame(){const g=new Float32Array(this.options.targetFrameSize);let p=0,h=0;for(;pr.modelFetcher(r.modelURL),l=await s.SileroLegacy.new(p,a),d=new c.FrameProcessor(l.process,l.reset_state,{frameSamples:r.frameSamples,positiveSpeechThreshold:r.positiveSpeechThreshold,negativeSpeechThreshold:r.negativeSpeechThreshold,redemptionFrames:r.redemptionFrames,preSpeechPadFrames:r.preSpeechPadFrames,minSpeechFrames:r.minSpeechFrames,submitUserSpeechOnPause:r.submitUserSpeechOnPause});return d.resume(),new this(a,p,r,d)}constructor(n,r,a,l){this.modelFetcher=n,this.ort=r,this.options=a,this.frameProcessor=l}async*run(n,r){const a={nativeSampleRate:r,targetSampleRate:16e3,targetFrameSize:this.options.frameSamples},l=new i.Resampler(a);let d=0,m=0,y=0,_=[];for await(const S of l.stream(n)){await this.frameProcessor.process(S,O=>{_.push(O)});for(const O of _)switch(O.msg){case f.Message.SpeechStart:d=y*this.options.frameSamples/16;break;case f.Message.SpeechEnd:m=(y+1)*this.options.frameSamples/16,yield{audio:O.audio,start:d,end:m};break}y++}const{msg:v,audio:T}=this.frameProcessor.endSegment(S=>{_.push(S)});for(const S of _)switch(S.msg){case f.Message.SpeechEnd:yield{audio:S.audio,start:d,end:y*this.options.frameSamples/16}}}}D.NonRealTimeVAD=t}(nonRealTimeVad)),nonRealTimeVad}var utils={},hasRequiredUtils;function requireUtils(){if(hasRequiredUtils)return utils;hasRequiredUtils=1,Object.defineProperty(utils,"__esModule",{value:!0}),utils.audioFileToArray=utils.encodeWAV=utils.arrayBufferToBase64=utils.minFramesForTargetMS=void 0;function D(c,f,s=16e3){return Math.ceil(c*s/1e3/f)}utils.minFramesForTargetMS=D;function u(c){const f=new Uint8Array(c),s=f.byteLength,i=new Array(s);for(var t=0;t{s.addEventListener("loadend",r=>{const a=s.result;f.decodeAudioData(a,l=>{i=l,f.startRendering().then(d=>{console.log("Rendering completed successfully"),n()}).catch(d=>{console.error(`Rendering failed: ${d}`)})},l=>{console.log(`Error with decoding audio data: ${l}`)})}),s.readAsArrayBuffer(c)}),i===null)throw Error("some shit");let t=i,e=new Float32Array(t.length);for(let n=0;n({...d==="v5"?o.defaultV5FrameProcessorOptions:o.defaultLegacyFrameProcessorOptions,onFrameProcessed:(y,_)=>{},onVADMisfire:()=>{c.log.debug("VAD misfire")},onSpeechStart:()=>{c.log.debug("Detected speech start")},onSpeechEnd:()=>{c.log.debug("Detected speech end")},onSpeechRealStart:()=>{c.log.debug("Detected real speech start")},baseAssetPath:"https://cdn.jsdelivr.net/npm/@ricky0123/vad-web@latest/dist/",onnxWASMBasePath:"https://cdn.jsdelivr.net/npm/onnxruntime-web@1.14.0/dist/",stream:void 0,ortConfig:void 0,model:d,workletOptions:{}});D.getDefaultRealTimeVADOptions=r;class a{static async new(m={}){const y={...(0,D.getDefaultRealTimeVADOptions)(m.model??D.DEFAULT_MODEL),...m};(0,o.validateOptions)(y);let _;y.stream===void 0?_=await navigator.mediaDevices.getUserMedia({audio:{...y.additionalAudioConstraints,channelCount:1,echoCancellation:!0,autoGainControl:!0,noiseSuppression:!0}}):_=y.stream;const v=new AudioContext,T=new MediaStreamAudioSourceNode(v,{mediaStream:_}),S=await l.new(v,y);return S.receive(T),new a(y,v,_,S,T)}constructor(m,y,_,v,T,S=!1){this.options=m,this.audioContext=y,this.stream=_,this.audioNodeVAD=v,this.sourceNode=T,this.listening=S,this.pause=()=>{this.audioNodeVAD.pause(),this.listening=!1},this.start=()=>{this.audioNodeVAD.start(),this.listening=!0},this.destroy=()=>{this.listening&&this.pause(),this.options.stream===void 0&&this.stream.getTracks().forEach(O=>O.stop()),this.sourceNode.disconnect(),this.audioNodeVAD.destroy(),this.audioContext.close()},this.setOptions=O=>{this.audioNodeVAD.setFrameProcessorOptions(O)}}}D.MicVAD=a;class l{static async new(m,y={}){const _={...(0,D.getDefaultRealTimeVADOptions)(y.model??D.DEFAULT_MODEL),...y};(0,o.validateOptions)(_),D.ort.env.wasm.wasmPaths=_.onnxWASMBasePath,_.ortConfig!==void 0&&_.ortConfig(D.ort);const v=_.model==="v5"?e:n,T=_.baseAssetPath+v,S=_.model==="v5"?s.SileroV5.new:s.SileroLegacy.new;let O;try{O=await S(D.ort,()=>(0,h.defaultModelFetcher)(T))}catch(R){throw console.error(`Encountered an error while loading model file ${T}`),R}const w=new o.FrameProcessor(O.process,O.reset_state,{frameSamples:_.frameSamples,positiveSpeechThreshold:_.positiveSpeechThreshold,negativeSpeechThreshold:_.negativeSpeechThreshold,redemptionFrames:_.redemptionFrames,preSpeechPadFrames:_.preSpeechPadFrames,minSpeechFrames:_.minSpeechFrames,submitUserSpeechOnPause:_.submitUserSpeechOnPause}),I=new l(m,_,w);return await I.setupAudioNode(),I}constructor(m,y,_){this.ctx=m,this.options=y,this.bufferIndex=0,this.pause=()=>{this.frameProcessor.pause(this.handleFrameProcessorEvent)},this.start=()=>{this.frameProcessor.resume()},this.receive=v=>{v.connect(this.audioNode)},this.processFrame=async v=>{await this.frameProcessor.process(v,this.handleFrameProcessorEvent)},this.handleFrameProcessorEvent=v=>{switch(v.msg){case f.Message.FrameProcessed:this.options.onFrameProcessed(v.probs,v.frame);break;case f.Message.SpeechStart:this.options.onSpeechStart();break;case f.Message.SpeechRealStart:this.options.onSpeechRealStart();break;case f.Message.VADMisfire:this.options.onVADMisfire();break;case f.Message.SpeechEnd:this.options.onSpeechEnd(v.audio);break}},this.destroy=()=>{var v;this.audioNode instanceof AudioWorkletNode&&this.audioNode.port.postMessage({message:f.Message.SpeechStop}),this.audioNode.disconnect(),(v=this.gainNode)==null||v.disconnect()},this.setFrameProcessorOptions=v=>{this.frameProcessor.options={...this.frameProcessor.options,...v}},this.frameProcessor=_}async setupAudioNode(){if("audioWorklet"in this.ctx&&typeof AudioWorkletNode=="function")try{const v=this.options.baseAssetPath+t;await this.ctx.audioWorklet.addModule(v);const T=this.options.workletOptions??{};T.processorOptions={...T.processorOptions??{},frameSamples:this.options.frameSamples},this.audioNode=new AudioWorkletNode(this.ctx,"vad-helper-worklet",T),this.audioNode.port.onmessage=async S=>{var O;switch((O=S.data)==null?void 0:O.message){case f.Message.AudioFrame:let w=S.data.data;w instanceof ArrayBuffer||(w=new ArrayBuffer(S.data.data.byteLength),new Uint8Array(w).set(new Uint8Array(S.data.data)));const I=new Float32Array(w);await this.processFrame(I);break}};return}catch(v){console.log("AudioWorklet setup failed, falling back to ScriptProcessor",v)}this.resampler=new i.Resampler({nativeSampleRate:this.ctx.sampleRate,targetSampleRate:16e3,targetFrameSize:this.options.frameSamples??480});const y=4096;this.audioNode=this.ctx.createScriptProcessor(y,1,1),this.gainNode=this.ctx.createGain(),this.gainNode.gain.value=0;let _=!1;this.audioNode.onaudioprocess=async v=>{if(!_){_=!0;try{const T=v.inputBuffer.getChannelData(0);if(v.outputBuffer.getChannelData(0).fill(0),this.resampler){const O=this.resampler.process(T);for(const w of O)await this.processFrame(w)}}catch(T){console.error("Error processing audio:",T)}finally{_=!1}}},this.audioNode.connect(this.gainNode),this.gainNode.connect(this.ctx.destination)}}D.AudioNodeVAD=l}(realTimeVad)),realTimeVad}var hasRequiredDist;function requireDist(){return hasRequiredDist||(hasRequiredDist=1,function(D){Object.defineProperty(D,"__esModule",{value:!0}),D.getDefaultRealTimeVADOptions=D.MicVAD=D.DEFAULT_MODEL=D.AudioNodeVAD=D.utils=D.NonRealTimeVAD=D.Message=D.FrameProcessor=D.defaultModelFetcher=D.baseAssetPath=void 0;var u=requireAssetPath();Object.defineProperty(D,"baseAssetPath",{enumerable:!0,get:function(){return u.baseAssetPath}});var b=requireDefaultModelFetcher();Object.defineProperty(D,"defaultModelFetcher",{enumerable:!0,get:function(){return b.defaultModelFetcher}});var g=requireFrameProcessor();Object.defineProperty(D,"FrameProcessor",{enumerable:!0,get:function(){return g.FrameProcessor}});var p=requireMessages();Object.defineProperty(D,"Message",{enumerable:!0,get:function(){return p.Message}});var h=requireNonRealTimeVad();Object.defineProperty(D,"NonRealTimeVAD",{enumerable:!0,get:function(){return h.NonRealTimeVAD}});const o=requireUtils();D.utils={audioFileToArray:o.audioFileToArray,minFramesForTargetMS:o.minFramesForTargetMS,arrayBufferToBase64:o.arrayBufferToBase64,encodeWAV:o.encodeWAV};var c=requireRealTimeVad();Object.defineProperty(D,"AudioNodeVAD",{enumerable:!0,get:function(){return c.AudioNodeVAD}}),Object.defineProperty(D,"DEFAULT_MODEL",{enumerable:!0,get:function(){return c.DEFAULT_MODEL}}),Object.defineProperty(D,"MicVAD",{enumerable:!0,get:function(){return c.MicVAD}}),Object.defineProperty(D,"getDefaultRealTimeVADOptions",{enumerable:!0,get:function(){return c.getDefaultRealTimeVADOptions}})}(dist)),dist}var distExports=requireDist();export{distExports as d}; diff --git a/assets/index-CSK7uqHy.js b/assets/index-CSK7uqHy.js deleted file mode 100644 index a04c35ca0d508537cadf6aad48eb818bf89daf27..0000000000000000000000000000000000000000 --- a/assets/index-CSK7uqHy.js +++ /dev/null @@ -1,532 +0,0 @@ -import{d as xs}from"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-BQHOFrhO.js";import{a4 as Yn,e as W,f as Ue,a0 as Ke,a5 as vs,d as Fe,a6 as bs,a7 as ws,a8 as Zr,w as Be,T as mn,c as ie,o as J,a9 as gn,aa as ks,$ as Zt,ab as Wt,ac as Xt,ad as Ye,b as Te,a as D,X as lt,ae as Et,af as Qr,W as at,Y as ve,u as H,ag as yt,ah as _t,ai as Jr,aj as Kn,ak as Go,al as Fn,U as Ot,am as Ts,an as ae,ao as Mi,ap as Bn,aq as $t,ar as Pe,as as Mt,at as _s,au as Yo,av as pn,aw as ei,ax as ze,ay as Ko,az as qo,aA as ti,aB as yn,aC as Es,aD as ni,aE as Ms,aF as Wo,aG as xt,aH as ri,aI as At,aJ as As,aK as Xo,aL as Dt,aM as Zo,aN as Ss,aO as Is,aP as Rs,aQ as Cs,aR as Qo,aS as qn,aT as Ns,aU as Ls,aV as Ps,aW as Pt,aX as Ds,aY as Os,aZ as Fs,a_ as Bs,a$ as er,b0 as zn,b1 as Cr,b2 as Nt,b3 as Jo,b4 as Nr,b5 as Vt,b6 as Ai,b7 as Lt,b8 as Ht,b9 as tr,ba as zs,bb as Us,bc as js,bd as Vs,be as ea,bf as ta,bg as Un,bh as na,bi as ii,bj as jn,bk as ra,bl as Hs,a3 as Lr,bm as $s,bn as Pr,bo as ia,bp as Gs,bq as cn,br as oa,bs as ft,bt as vt,bu as hn,bv as Ys,bw as Ks,bx as qs,by as Ws,bz as Xs,bA as oi,bB as Zs,bC as Qs,bD as Js,bE as nr,bF as el,bG as aa,bH as tl,bI as nl,bJ as rl,bK as il,bL as ol,bM as rr,bN as al,bO as sl,bP as ll,bQ as Si,bR as Ii,bS as Ri,bT as Ci,bU as ul,bV as cl,bW as fl,bX as dl,bY as pl,bZ as xn,b_ as hl,b$ as sa,c0 as ml,c1 as gl,c2 as yl,c3 as xl,c4 as la,_ as Vn,c5 as ua,c6 as ai,c7 as si,c8 as vl,c9 as ir,ca as bl}from"./index-CNH1g_GM.js";import{V as wl,a as kl,c as Tl,r as _l,b as Dr,d as El}from"./three-vrm-animation.module-B_hGdUpX.js";import{m as Ml}from"./mcp-B7-jaCfZ.js";import{E as Al,a as Sl,b as Il}from"./emotions-DWNSb738.js";import"./Select.vue_vue_type_style_index_0_lang-BIffysKh.js";import{getImportUrlBundles as Rl}from"./import-url-browser-CPN8ipMD.js";import{s as Gt,c as Ni,u as Cl,g as Nl}from"./speech-DpuUb2e9.js";import{u as or}from"./queue-C-8apo-4.js";import{u as Ll,a as Pl,b as Dl,l as Ol}from"./queues-BGJT-GZq.js";import{l as Fl,u as li}from"./providers-DP46_3AG.js";import{s as Bl}from"./index-YUUT4m-_.js";import{u as zl}from"./airi-card-JBK1Hzhm.js";import{_ as ui}from"./TransitionVertical.vue_vue_type_script_setup_true_lang-DLt6RcnD.js";import{_ as Ul,a as jl,r as on}from"./Model.vue_vue_type_script_setup_true_lang-BVl3TxNh.js";import{_ as Li}from"./Collapsable.vue_vue_type_script_setup_true_lang-dwKULsMl.js";import{H as Vl}from"./HeaderLink-LlW9hXo1.js";import{d as Pi}from"./index-CHjdc0dt.js";import{u as ca}from"./consciousness-DieQE4I6.js";import{_ as fa}from"./Basic.vue_vue_type_script_setup_true_lang-CuYLN0Ir.js";import{b as Di}from"./route-block-B_A1xBdJ.js";import"./floating-ui.core-CgBsuaUc.js";import"./duckdb-mvp-CaaD-olE.js";import"./index-LHmcipjy.js";async function*Hl(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 $l(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 Gl(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 Yl(t,e="linear"){switch(e){case"linear":return $l(t);case"minmax":return Gl(t)}}const da=Yn("AudioContext",()=>({audioContext:new AudioContext,calculateVolume:Yl})),Kl=Yn("SpeakingStore",()=>{const n=W(0),r=W(!1),i=Ue(()=>r.value?(30+70*n.value)/100:30);return{mouthOpenSize:n,nowSpeaking:r,nowSpeakingAvatarBorderOpacity:i}});function En(t,e,n){return e+n<0||e+n>=t.length-1?"":t[e+n]}function ql(t){let e="literal",n="";return{async consume(r){var i,o,a;for(let s=0;s"?(l+=En(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 Wl=Yn("llm",()=>{async function t(n,r,i,o){const a=o==null?void 0:o.headers;return await Bl({...r.chat(n),maxSteps:10,messages:i,headers:a,tools:[...await Ml()]})}async function e(n,r){if(n==="")return[];try{return await Fl({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=Yn("chat",()=>{const{stream:t}=Wl(),{systemPrompt:e}=Ke(zl()),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 w(h){l.value.push(h)}function k(h){u.value.push(h)}function S(h){c.value.push(h)}const _=W([{role:"system",content:e.value}]),R=W({role:"assistant",content:""});async function P(h,I){var v;try{if(n.value=!0,!h)return;for(const O of r.value)await O(h);R.value={role:"assistant",content:""},_.value.push({role:"user",content:h}),_.value.push(R.value);const g=_.value.slice(0,_.value.length-1).map(O=>vs(O));for(const O of i.value)await O(h);for(const O of o.value)await O(h);const m=((v=I.providerConfig)==null?void 0:v.headers)||{},T=await t(I.model,I.chatProvider,g,{headers:m});for(const O of a.value)await O(h);let M="";const F=ql({onLiteral:async O=>{for(const U of s.value)await U(O);R.value.content+=O},onSpecial:async O=>{for(const U of l.value)await U(O)}});for await(const O of Hl(T.textStream,async U=>U))M+=O,await F.consume(O);await F.end();for(const O of u.value)await O();for(const O of c.value)await O(M);console.debug("LLM output:",M)}catch(g){throw console.error("Error sending message:",g),g}finally{n.value=!1}}return{sending:n,messages:_,streamingMessage:R,send:P,onBeforeMessageComposed:f,onAfterMessageComposed:p,onBeforeSend:d,onAfterSend:y,onTokenLiteral:x,onTokenSpecial:w,onStreamEnd:k,onAssistantResponseEnd:S}}),pa=Fe({__name:"Screen",setup(t){const e=W(),n=bs(ks),{width:r,height:i}=ws(),o=Zr(e,{immediate:!0,windowResize:!0,reset:!0}),a=Ue(()=>n.between("sm","md").value||n.smaller("sm").value),s=Ue(()=>n.between("md","lg").value),l=Ue(()=>n.greaterOrEqual("lg").value),u=Ue(()=>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}),mn(async()=>{e.value&&o.update()}),(f,p)=>(J(),ie("div",{ref_key:"containerRef",ref:e,"h-full":"","w-full":""},[gn(f.$slots,"default",{width:u.value,height:c.value})],512))}}),Xl={absolute:"",bottom:"3",right:"3"},Zl={flex:"~ row","cursor-pointer":""},Ql=["checked","aria-checked"],Jl={key:0,"min-w":"50vw",z:"(J(),Xt(pa,{relative:""},{default:Ye(({width:a,height:s})=>[Te(jl,{width:a,height:s},{default:Ye(({app:l})=>[Te(Ul,{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"]),D("div",Xl,[D("div",Zl,[D("label",{class:lt([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(D("input",{"onUpdate:modelValue":o[0]||(o[0]=l=>n.value=l),checked:n.value,"aria-checked":n.value,name:"showLive2DViewerInspector",type:"checkbox","appearance-none":"","outline-none":"",hidden:""},null,8,Ql),[[Qr,n.value]]),o[8]||(o[8]=D("div",{"select-none":""},[D("div",{"i-solar:bug-bold-duotone":""})],-1))],2)]),Te(H(ui),null,{default:Ye(()=>[n.value?(J(),ie("div",Jl,[D("div",eu,[D("div",tu,[D("span",null,ve(H(e)("stage.viewers.debug-menu.emotions")),1)]),D("div",nu,[D("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})},ve(H(e)("stage.viewers.debug-menu.emotions-btn.surprised")),1),D("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})},ve(H(e)("stage.viewers.debug-menu.emotions-btn.sad")),1),D("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})},ve(H(e)("stage.viewers.debug-menu.emotions-btn.angry")),1),D("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})},ve(H(e)("stage.viewers.debug-menu.emotions-btn.happy")),1),D("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})},ve(H(e)("stage.viewers.debug-menu.emotions-btn.awkward")),1),D("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})},ve(H(e)("stage.viewers.debug-menu.emotions-btn.question")),1),D("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})},ve(H(e)("stage.viewers.debug-menu.emotions-btn.think")),1)])])])):at("",!0)]),_:1})])]),_:1}))}});var iu=Object.defineProperty,ou=(t,e,n)=>e in t?iu(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,au=(t,e,n)=>ou(t,e+"",n);function su(t){return Ns()?(Ls(t),!0):!1}function ha(t){return typeof t=="function"?t():H(t)}const lu=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const uu=Object.prototype.toString,cu=t=>uu.call(t)==="[object Object]",fu=()=>{},du=lu?window:void 0;function pu(t){var e;const n=ha(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=du):[e,n,r,i]=t,!e)return fu;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(()=>[pu(e),ha(i)],([c,f])=>{if(a(),!c)return;const p=cu(f)?{...f}:f;o.push(...n.flatMap(d=>r.map(y=>s(c,d,y,p))))},{immediate:!0,flush:"post"}),u=()=>{l(),a()};return su(u),u}function ma(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}),au(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}ma({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() { - gl_Position = projectionMatrix * viewMatrix * modelMatrix * vec4(position, 1.); - vUv = uv; - vPos = position.xy; - } - `,` - // mostly from https://gist.github.com/statico/df64c5d167362ecf7b34fca0b1459a44 - varying vec2 vUv; - varying vec2 vPos; - uniform vec2 scale; - uniform vec2 imageBounds; - uniform float resolution; - uniform vec3 color; - uniform sampler2D map; - uniform float radius; - uniform float zoom; - uniform float grayscale; - uniform float opacity; - const vec3 luma = vec3(.299, 0.587, 0.114); - vec4 toGrayscale(vec4 color, float intensity) { - return vec4(mix(color.rgb, vec3(dot(color.rgb, luma)), intensity), color.a); - } - vec2 aspect(vec2 size) { - return size / min(size.x, size.y); - } - - const float PI = 3.14159265; - - // from https://iquilezles.org/articles/distfunctions - float udRoundBox( vec2 p, vec2 b, float r ) { - return length(max(abs(p)-b+r,0.0))-r; - } - - void main() { - vec2 s = aspect(scale); - vec2 i = aspect(imageBounds); - float rs = s.x / s.y; - float ri = i.x / i.y; - vec2 new = rs < ri ? vec2(i.x * s.y / i.y, s.y) : vec2(s.x, i.y * s.x / i.x); - vec2 offset = (rs < ri ? vec2((new.x - s.x) / 2.0, 0.0) : vec2(0.0, (new.y - s.y) / 2.0)) / new; - vec2 uv = vUv * s / new + offset; - vec2 zUv = (uv - vec2(0.5, 0.5)) / zoom + vec2(0.5, 0.5); - - vec2 res = vec2(scale * resolution); - vec2 halfRes = 0.5 * res; - float b = udRoundBox(vUv.xy * res - halfRes, halfRes, resolution * radius); - vec3 a = mix(vec3(1.0,0.0,0.0), vec3(0.0,0.0,0.0), smoothstep(0.0, 1.0, b)); - gl_FragColor = toGrayscale(texture2D(map, zUv) * vec4(color, opacity * a), grayscale); - - #include - #include - } - `);const ci=parseInt(Ps.replace(/\D+/g,""));var hu=Object.defineProperty,mu=(t,e,n)=>e in t?hu(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,gu=(t,e,n)=>(mu(t,e+"",n),n);async function Oi(t){const e=await t.arrayBuffer(),n=btoa(String.fromCharCode(...new Uint8Array(e)));return`data:${t.type||""};base64,${n}`}let Mn,sr,Bt,An;function lr(t,e=1/0,n=null){sr||(sr=new Zo(2,2,1,1)),Bt||(Bt=new yn({uniforms:{blitTexture:new js(t)},vertexShader:` - varying vec2 vUv; - void main(){ - vUv = uv; - gl_Position = vec4(position.xy * 1.0,0.,.999999); - } - `,fragmentShader:` - uniform sampler2D blitTexture; - varying vec2 vUv; - - void main(){ - gl_FragColor = vec4(vUv.xy, 0, 1); - - #ifdef IS_SRGB - gl_FragColor = LinearTosRGB( texture2D( blitTexture, vUv) ); - #else - gl_FragColor = texture2D( blitTexture, vUv); - #endif - } - `})),Bt.uniforms.blitTexture.value=t,Bt.defines.IS_SRGB="colorSpace"in t?t.colorSpace==="srgb":t.encoding===3001,Bt.needsUpdate=!0,An||(An=new Pt(sr,Bt),An.frustrumCulled=!1);const r=new Mt,i=new Nr;i.add(An),n||(n=Mn=new Vs({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 zn(n.domElement);return o.minFilter=t.minFilter,o.magFilter=t.magFilter,o.wrapS=t.wrapS,o.wrapT=t.wrapT,o.name=t.name,Mn&&(Mn.dispose(),Mn=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 ga{constructor(){this.pluginCallbacks=[],this.register(function(e){return new Mu(e)}),this.register(function(e){return new Au(e)}),this.register(function(e){return new Ru(e)}),this.register(function(e){return new Cu(e)}),this.register(function(e){return new Nu(e)}),this.register(function(e){return new Lu(e)}),this.register(function(e){return new Su(e)}),this.register(function(e){return new Iu(e)}),this.register(function(e){return new Pu(e)}),this.register(function(e){return new Du(e)}),this.register(function(e){return new Ou(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 Eu,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 ya(t){return Math.ceil(t/4)*4}function cr(t,e=0){const n=ya(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 Vi(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 Eu{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(Ui));y.setUint32(0,d.byteLength,!0),y.setUint32(4,wu,!0);const x=cr(ku(JSON.stringify(a)),32),w=new DataView(new ArrayBuffer(Ui));w.setUint32(0,x.byteLength,!0),w.setUint32(4,bu,!0);const k=new ArrayBuffer(zi),S=new DataView(k);S.setUint32(0,xu,!0),S.setUint32(4,vu,!0);const _=zi+w.byteLength+x.byteLength+y.byteLength+d.byteLength;S.setUint32(8,_,!0),new Blob([k,w,x,y,d],{type:"application/octet-stream"}).arrayBuffer().then(n)}):a.buffers&&a.buffers.length>0?Oi(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=_u(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=ji();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!==Cr&&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 w=new Uint8ClampedArray(e.height*e.width*4);for(let k=0;ko.processBufferViewImage(w)).then(w=>{p.bufferView=w})):d.toDataURL!==void 0?p.uri=d.toDataURL(i):u.push(Vi(d,i).then(Oi).then(w=>{p.uri=w}));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 _=0,R=e.material.length;_=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 _ in a.attributes){if(_.slice(0,5)==="morph")continue;const R=a.attributes[_];if(_=p[_]||_.toUpperCase(),/^(POSITION|NORMAL|TANGENT|TEXCOORD_\d+|COLOR_\d+|JOINTS_\d+|WEIGHTS_\d+)$/.test(_)||(_="_"+_),n.attributes.has(this.getUID(R))){u[_]=n.attributes.get(this.getUID(R));continue}y=null;const P=R.array;_==="JOINTS_0"&&!(P instanceof Uint16Array)&&!(P instanceof Uint8Array)&&(console.warn('GLTFExporter: Attribute "skinIndex" converted to type UNSIGNED_SHORT.'),y=new Nt(new Uint16Array(P),R.itemSize,R.normalized));const h=this.processAccessor(y||R,a);h!==null&&(_.startsWith("_")||this.detectMeshQuantization(_,R),u[_]=h,n.attributes.set(this.getUID(R),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 _=[],R=[],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=R)}const x=Array.isArray(e.material);if(x&&a.groups.length===0)return null;const w=x?e.material:[e.material],k=x?a.groups:[{materialIndex:0,start:void 0,count:void 0}];for(let _=0,R=k.length;_0&&(P.targets=f),a.index!==null){let I=this.getUID(a.index);(k[_].start!==void 0||k[_].count!==void 0)&&(I+=":"+k[_].start+":"+k[_].count),n.attributes.has(I)?P.indices=n.attributes.get(I):(P.indices=this.processAccessor(a.index,a,k[_].start,k[_].count),n.attributes.set(I,P.indices)),P.indices===null&&delete P.indices}const h=this.processMaterial(w[k[_].materialIndex]);h!==null&&(P.material=h),c.push(P)}l.primitives=c,r.meshes||(r.meshes=[]),this._invokeAll(function(_){_.writeMesh&&_.writeMesh(e,l)});const S=r.meshes.push(l)-1;return n.meshes.set(o,S),S}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=ga.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 Nr;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 Au=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}},Su=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}},Iu=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}},Ru=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}},Cu=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}},Nu=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}},Lu=class{constructor(t){this.writer=t,this.name="KHR_materials_specular"}writeMaterial(t,e){if(!t.isMeshPhysicalMaterial||t.specularIntensity===1&&t.specularColor.equals(yu)&&!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}},Pu=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}},Du=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}},Ou=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 vn=Uint8Array,xa=Uint16Array,Fu=Uint32Array,Bu=new vn([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]),zu=new vn([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]),va=function(t,e){for(var n=new xa(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,Vu[Ne]=((wt&65280)>>>8|(wt&255)<<8)>>>1}var Wn=new vn(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 Hu=new vn(32);for(var Ne=0;Ne<32;++Ne)Hu[Ne]=5;var $u=new vn(0),Gu=typeof TextDecoder<"u"&&new TextDecoder,Yu=0;try{Gu.decode($u,{stream:!0}),Yu=1}catch{}var Ku=Object.defineProperty,qu=(t,e,n)=>e in t?Ku(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Wu=(t,e,n)=>(qu(t,e+"",n),n);const wa=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||wa.ReflectorShader,l=e.multisample!==void 0?e.multisample:4,u=new Yo,c=new ae,f=new ae,p=new ae,d=new xt,y=new ae(0,0,-1),x=new At,w=new ae,k=new ae,S=new At,_=new xt,R=this.camera,P=new Os(i,o,{samples:l,type:Fs}),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=_,this.material=h,this.onBeforeRender=function(I,v,g){if(f.setFromMatrixPosition(n.matrixWorld),p.setFromMatrixPosition(g.matrixWorld),d.extractRotation(n.matrixWorld),c.set(0,0,1),c.applyMatrix4(d),w.subVectors(f,p),w.dot(c)>0)return;w.reflect(c).negate(),w.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),R.position.copy(w),R.up.set(0,1,0),R.up.applyMatrix4(d),R.up.reflect(c),R.lookAt(k),R.far=g.far,R.updateMatrixWorld(),R.projectionMatrix.copy(g.projectionMatrix),_.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),_.multiply(R.projectionMatrix),_.multiply(R.matrixWorldInverse),_.multiply(n.matrixWorld),u.setFromNormalAndCoplanarPoint(c,f),u.applyMatrix4(R.matrixWorldInverse),x.set(u.normal.x,u.normal.y,u.normal.z,u.constant);const m=R.projectionMatrix;S.x=(Math.sign(x.x)+m.elements[8])/m.elements[0],S.y=(Math.sign(x.y)+m.elements[9])/m.elements[5],S.z=-1,S.w=(1+m.elements[10])/m.elements[14],x.multiplyScalar(2/x.dot(S)),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(),M=I.xr.enabled,F=I.shadowMap.autoUpdate,O=I.toneMapping;let U=!1;"outputColorSpace"in I?U=I.outputColorSpace==="srgb":U=I.outputEncoding===3001,I.xr.enabled=!1,I.shadowMap.autoUpdate=!1,"outputColorSpace"in I?I.outputColorSpace="srgb-linear":I.outputEncoding=3e3,I.toneMapping=Bs,I.setRenderTarget(P),I.state.buffers.depth.setMask(!0),I.autoClear===!1&&I.clear(),I.render(v,R),I.xr.enabled=M,I.shadowMap.autoUpdate=F,I.toneMapping=O,"outputColorSpace"in I?I.outputColorSpace=U?"srgb":"srgb-linear":I.outputEncoding=U?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=wa;Wu(Or,"ReflectorShader",{uniforms:{color:{value:null},tDiffuse:{value:null},textureMatrix:{value:null}},vertexShader:` - uniform mat4 textureMatrix; - varying vec4 vUv; - - #include - #include - - void main() { - - vUv = textureMatrix * vec4( position, 1.0 ); - - gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 ); - - #include - - }`,fragmentShader:` - uniform vec3 color; - uniform sampler2D tDiffuse; - varying vec4 vUv; - - #include - - float blendOverlay( float base, float blend ) { - - return( base < 0.5 ? ( 2.0 * base * blend ) : ( 1.0 - 2.0 * ( 1.0 - base ) * ( 1.0 - blend ) ) ); - - } - - vec3 blendOverlay( vec3 base, vec3 blend ) { - - return vec3( blendOverlay( base.r, blend.r ), blendOverlay( base.g, blend.g ), blendOverlay( base.b, blend.b ) ); - - } - - void main() { - - #include - - vec4 base = texture2DProj( tDiffuse, vUv ); - gl_FragColor = vec4( blendOverlay( base.rgb, color ), 1.0 ); - - #include - #include <${ci>=154?"colorspace_fragment":"encodings_fragment"}> - - }`});var Xu=Object.defineProperty,Zu=(t,e,n)=>e in t?Xu(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,ka=(t,e,n)=>(Zu(t,typeof e!="symbol"?e+"":e,n),n);const Xn=new Ko,Qu=new Float32Array([-1,-1,0,0,0,1,-1,0,1,0,1,1,0,1,1,-1,1,0,0,1]),Ta=new qo(Qu,5);Xn.setIndex([0,1,2,0,2,3]);Xn.setAttribute("position",new ti(Ta,3,0,!1));Xn.setAttribute("uv",new ti(Ta,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 Ai(new Uint8Array(16*16*3),16,16,Cr);n.minFilter=Lt,n.magFilter=Lt,n.wrapS=Ht,n.wrapT=Ht;const r=new Ai(new Uint8Array(16*16*3),16,16,Cr);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; - - uniform vec3 screenPosition; - uniform vec2 scale; - - attribute vec3 position; - - void main() { - - gl_Position = vec4( position.xy * scale + screenPosition.xy, screenPosition.z, 1.0 ); - - }`,fragmentShader:` - - precision highp float; - - void main() { - - gl_FragColor = vec4( 1.0, 0.0, 1.0, 1.0 ); - - }`,depthTest:!0,depthWrite:!1,transparent:!1}),a=new tr({uniforms:{map:{value:n},scale:{value:null},screenPosition:{value:null}},vertexShader:` - - precision highp float; - - uniform vec3 screenPosition; - uniform vec2 scale; - - attribute vec3 position; - attribute vec2 uv; - - varying vec2 vUV; - - void main() { - - vUV = uv; - - gl_Position = vec4( position.xy * scale + screenPosition.xy, screenPosition.z, 1.0 ); - - }`,fragmentShader:` - - precision highp float; - - uniform sampler2D map; - - varying vec2 vUV; - - void main() { - - gl_FragColor = texture2D( map, vUV ); - - }`,depthTest:!1,depthWrite:!1,transparent:!1}),s=new Pt(i,o),l=[],u=_a.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:zs,transparent:!0,depthWrite:!1}),f=new Pt(i,c);this.addElement=function(w){l.push(w)};const p=new Pe,d=new Pe,y=new Us,x=new At;this.onBeforeRender=function(w,k,S){w.getCurrentViewport(x);const _=x.w/x.z,R=x.z/2,P=x.w/2;let h=16/x.w;if(p.set(h*_,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(S.matrixWorldInverse),!(e.z>0)&&(t.copy(e).applyMatrix4(S.projectionMatrix),d.x=x.x+t.x*R+R-8,d.y=x.y+t.y*P+P-8,y.containsPoint(d))){w.copyFramebufferToTexture(d,n);let I=o.uniforms;I.scale.value=p,I.screenPosition.value=t,w.renderBufferDirect(S,null,i,o,s,null),w.copyFramebufferToTexture(d,r),I=a.uniforms,I.scale.value=p,I.screenPosition.value=t,w.renderBufferDirect(S,null,i,a,s,null);const v=-t.x*2,g=-t.y*2;for(let m=0,T=l.length;me in t?ec(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Ea=(t,e,n)=>(tc(t,typeof e!="symbol"?e+"":e,n),n);const Dn={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; - uniform float mieCoefficient; - uniform vec3 up; - - varying vec3 vWorldPosition; - varying vec3 vSunDirection; - varying float vSunfade; - varying vec3 vBetaR; - varying vec3 vBetaM; - varying float vSunE; - - // constants for atmospheric scattering - const float e = 2.71828182845904523536028747135266249775724709369995957; - const float pi = 3.141592653589793238462643383279502884197169; - - // wavelength of used primaries, according to preetham - const vec3 lambda = vec3( 680E-9, 550E-9, 450E-9 ); - // this pre-calcuation replaces older TotalRayleigh(vec3 lambda) function: - // (8.0 * pow(pi, 3.0) * pow(pow(n, 2.0) - 1.0, 2.0) * (6.0 + 3.0 * pn)) / (3.0 * N * pow(lambda, vec3(4.0)) * (6.0 - 7.0 * pn)) - const vec3 totalRayleigh = vec3( 5.804542996261093E-6, 1.3562911419845635E-5, 3.0265902468824876E-5 ); - - // mie stuff - // K coefficient for the primaries - const float v = 4.0; - const vec3 K = vec3( 0.686, 0.678, 0.666 ); - // MieConst = pi * pow( ( 2.0 * pi ) / lambda, vec3( v - 2.0 ) ) * K - const vec3 MieConst = vec3( 1.8399918514433978E14, 2.7798023919660528E14, 4.0790479543861094E14 ); - - // earth shadow hack - // cutoffAngle = pi / 1.95; - const float cutoffAngle = 1.6110731556870734; - const float steepness = 1.5; - const float EE = 1000.0; - - float sunIntensity( float zenithAngleCos ) { - zenithAngleCos = clamp( zenithAngleCos, -1.0, 1.0 ); - return EE * max( 0.0, 1.0 - pow( e, -( ( cutoffAngle - acos( zenithAngleCos ) ) / steepness ) ) ); - } - - vec3 totalMie( float T ) { - float c = ( 0.2 * T ) * 10E-18; - return 0.434 * c * MieConst; - } - - void main() { - - vec4 worldPosition = modelMatrix * vec4( position, 1.0 ); - vWorldPosition = worldPosition.xyz; - - gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 ); - gl_Position.z = gl_Position.w; // set z to camera.far - - vSunDirection = normalize( sunPosition ); - - vSunE = sunIntensity( dot( vSunDirection, up ) ); - - vSunfade = 1.0 - clamp( 1.0 - exp( ( sunPosition.y / 450000.0 ) ), 0.0, 1.0 ); - - float rayleighCoefficient = rayleigh - ( 1.0 * ( 1.0 - vSunfade ) ); - - // extinction (absorbtion + out scattering) - // rayleigh coefficients - vBetaR = totalRayleigh * rayleighCoefficient; - - // mie coefficients - vBetaM = totalMie( turbidity ) * mieCoefficient; - - } - `,fragmentShader:` - varying vec3 vWorldPosition; - varying vec3 vSunDirection; - varying float vSunfade; - varying vec3 vBetaR; - varying vec3 vBetaM; - varying float vSunE; - - uniform float mieDirectionalG; - uniform vec3 up; - - const vec3 cameraPos = vec3( 0.0, 0.0, 0.0 ); - - // constants for atmospheric scattering - const float pi = 3.141592653589793238462643383279502884197169; - - const float n = 1.0003; // refractive index of air - const float N = 2.545E25; // number of molecules per unit volume for air at 288.15K and 1013mb (sea level -45 celsius) - - // optical length at zenith for molecules - const float rayleighZenithLength = 8.4E3; - const float mieZenithLength = 1.25E3; - // 66 arc seconds -> degrees, and the cosine of that - const float sunAngularDiameterCos = 0.999956676946448443553574619906976478926848692873900859324; - - // 3.0 / ( 16.0 * pi ) - const float THREE_OVER_SIXTEENPI = 0.05968310365946075; - // 1.0 / ( 4.0 * pi ) - const float ONE_OVER_FOURPI = 0.07957747154594767; - - float rayleighPhase( float cosTheta ) { - return THREE_OVER_SIXTEENPI * ( 1.0 + pow( cosTheta, 2.0 ) ); - } - - float hgPhase( float cosTheta, float g ) { - float g2 = pow( g, 2.0 ); - float inverse = 1.0 / pow( 1.0 - 2.0 * g * cosTheta + g2, 1.5 ); - return ONE_OVER_FOURPI * ( ( 1.0 - g2 ) * inverse ); - } - - void main() { - - vec3 direction = normalize( vWorldPosition - cameraPos ); - - // optical length - // cutoff angle at 90 to avoid singularity in next formula. - float zenithAngle = acos( max( 0.0, dot( up, direction ) ) ); - float inverse = 1.0 / ( cos( zenithAngle ) + 0.15 * pow( 93.885 - ( ( zenithAngle * 180.0 ) / pi ), -1.253 ) ); - float sR = rayleighZenithLength * inverse; - float sM = mieZenithLength * inverse; - - // combined extinction factor - vec3 Fex = exp( -( vBetaR * sR + vBetaM * sM ) ); - - // in scattering - float cosTheta = dot( direction, vSunDirection ); - - float rPhase = rayleighPhase( cosTheta * 0.5 + 0.5 ); - vec3 betaRTheta = vBetaR * rPhase; - - float mPhase = hgPhase( cosTheta, mieDirectionalG ); - vec3 betaMTheta = vBetaM * mPhase; - - vec3 Lin = pow( vSunE * ( ( betaRTheta + betaMTheta ) / ( vBetaR + vBetaM ) ) * ( 1.0 - Fex ), vec3( 1.5 ) ); - Lin *= mix( vec3( 1.0 ), pow( vSunE * ( ( betaRTheta + betaMTheta ) / ( vBetaR + vBetaM ) ) * Fex, vec3( 1.0 / 2.0 ) ), clamp( pow( 1.0 - dot( up, vSunDirection ), 5.0 ), 0.0, 1.0 ) ); - - // nightsky - float theta = acos( direction.y ); // elevation --> y-axis, [-pi/2, pi/2] - float phi = atan( direction.z, direction.x ); // azimuth --> x-axis [-pi/2, pi/2] - vec2 uv = vec2( phi, theta ) / vec2( 2.0 * pi, pi ) + vec2( 0.5, 0.0 ); - vec3 L0 = vec3( 0.1 ) * Fex; - - // composition + solar disc - float sundisk = smoothstep( sunAngularDiameterCos, sunAngularDiameterCos + 0.00002, cosTheta ); - L0 += ( vSunE * 19000.0 * Fex ) * sundisk; - - vec3 texColor = ( Lin + L0 ) * 0.04 + vec3( 0.0, 0.0003, 0.00075 ); - - vec3 retColor = pow( texColor, vec3( 1.0 / ( 1.2 + ( 1.2 * vSunfade ) ) ) ); - - gl_FragColor = vec4( retColor, 1.0 ); - - #include - #include <${ci>=154?"colorspace_fragment":"encodings_fragment"}> - - } - `},Ma=new yn({name:"SkyShader",fragmentShader:Dn.fragmentShader,vertexShader:Dn.vertexShader,uniforms:ni.clone(Dn.uniforms),side:Es,depthWrite:!1});class Aa extends Pt{constructor(){super(new Ds(1,1,1),Ma)}}Ea(Aa,"SkyShader",Dn);Ea(Aa,"material",Ma);new Ms;new ae;new Wo(0,0,0,"YXZ");new ae;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,te=(t,e,n)=>(rc(t,typeof e!="symbol"?e+"":e,n),n);const Sn=new _s,Hi=new Yo,ic=Math.cos(70*(Math.PI/180)),$i=(t,e)=>(t%e+e)%e;class oc extends Ts{constructor(e,n){super(),te(this,"object"),te(this,"domElement"),te(this,"enabled",!0),te(this,"target",new ae),te(this,"minDistance",0),te(this,"maxDistance",1/0),te(this,"minZoom",0),te(this,"maxZoom",1/0),te(this,"minPolarAngle",0),te(this,"maxPolarAngle",Math.PI),te(this,"minAzimuthAngle",-1/0),te(this,"maxAzimuthAngle",1/0),te(this,"enableDamping",!1),te(this,"dampingFactor",.05),te(this,"enableZoom",!0),te(this,"zoomSpeed",1),te(this,"enableRotate",!0),te(this,"rotateSpeed",1),te(this,"enablePan",!0),te(this,"panSpeed",1),te(this,"screenSpacePanning",!0),te(this,"keyPanSpeed",7),te(this,"zoomToCursor",!1),te(this,"autoRotate",!1),te(this,"autoRotateSpeed",2),te(this,"reverseOrbit",!1),te(this,"reverseHorizontalOrbit",!1),te(this,"reverseVerticalOrbit",!1),te(this,"keys",{LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"}),te(this,"mouseButtons",{LEFT:yt.ROTATE,MIDDLE:yt.DOLLY,RIGHT:yt.PAN}),te(this,"touches",{ONE:_t.ROTATE,TWO:_t.DOLLY_PAN}),te(this,"target0"),te(this,"position0"),te(this,"zoom0"),te(this,"_domElementKeyEvents",null),te(this,"getPolarAngle"),te(this,"getAzimuthalAngle"),te(this,"setPolarAngle"),te(this,"setAzimuthalAngle"),te(this,"getDistance"),te(this,"getZoomScale"),te(this,"listenToKeyEvents"),te(this,"stopListenToKeyEvents"),te(this,"saveState"),te(this,"reset"),te(this,"update"),te(this,"connect"),te(this,"dispose"),te(this,"dollyIn"),te(this,"dollyOut"),te(this,"getScale"),te(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",ne),this._domElementKeyEvents=L},this.stopListenToKeyEvents=()=>{this._domElementKeyEvents.removeEventListener("keydown",ne),this._domElementKeyEvents=null},this.saveState=()=>{r.target0.copy(r.target),r.position0.copy(r.object.position),r.zoom0=r.object.zoom},this.reset=()=>{r.target.copy(r.target0),r.object.position.copy(r.position0),r.object.zoom=r.zoom0,r.object.updateProjectionMatrix(),r.dispatchEvent(i),r.update(),l=s.NONE},this.update=(()=>{const L=new ae,Y=new ae(0,1,0),X=new Bn().setFromUnitVectors(e.up,Y),Ee=X.clone().invert(),Ze=new ae,ot=new Bn,Tn=2*Math.PI;return function(){const Ei=r.object.position;X.setFromUnitVectors(e.up,Y),Ee.copy(X).invert(),L.copy(Ei).sub(r.target),L.applyQuaternion(X),c.setFromVector3(L),r.autoRotate&&l===s.NONE&&O(M()),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+=Tn:ht>Math.PI&&(ht-=Tn),mt<-Math.PI?mt+=Tn:mt>Math.PI&&(mt-=Tn),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=C(c.radius):c.radius=C(c.radius*p),L.setFromSpherical(c),L.applyQuaternion(Ee),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=C(rn*p);const _n=rn-nn;r.object.position.addScaledVector(I,_n),r.object.updateMatrixWorld()}else if(r.object.isOrthographicCamera){const rn=new ae(v.x,v.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 _n=new ae(v.x,v.y,0);_n.unproject(r.object),r.object.position.sub(_n).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):(Sn.origin.copy(r.object.position),Sn.direction.set(0,0,-1).transformDirection(r.object.matrix),Math.abs(r.object.up.dot(Sn.direction))u||8*(1-ot.dot(r.object.quaternion))>u?(r.dispatchEvent(i),Ze.copy(r.object.position),ot.copy(r.object.quaternion),tn=!1,!0):!1}})(),this.connect=L=>{r.domElement=L,r.domElement.style.touchAction="none",r.domElement.addEventListener("contextmenu",Ve),r.domElement.addEventListener("pointerdown",Ae),r.domElement.addEventListener("pointercancel",tt),r.domElement.addEventListener("wheel",q)},this.dispose=()=>{var L,Y,X,Ee,Ze,ot;r.domElement&&(r.domElement.style.touchAction="auto"),(L=r.domElement)==null||L.removeEventListener("contextmenu",Ve),(Y=r.domElement)==null||Y.removeEventListener("pointerdown",Ae),(X=r.domElement)==null||X.removeEventListener("pointercancel",tt),(Ee=r.domElement)==null||Ee.removeEventListener("wheel",q),(Ze=r.domElement)==null||Ze.ownerDocument.removeEventListener("pointermove",je),(ot=r.domElement)==null||ot.ownerDocument.removeEventListener("pointerup",tt),r._domElementKeyEvents!==null&&r._domElementKeyEvents.removeEventListener("keydown",ne)};const r=this,i={type:"change"},o={type:"start"},a={type:"end"},s={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let l=s.NONE;const u=1e-6,c=new Mi,f=new Mi;let p=1;const d=new ae,y=new Pe,x=new Pe,w=new Pe,k=new Pe,S=new Pe,_=new Pe,R=new Pe,P=new Pe,h=new Pe,I=new ae,v=new Pe;let g=!1;const m=[],T={};function M(){return 2*Math.PI/60/60*r.autoRotateSpeed}function F(){return Math.pow(.95,r.zoomSpeed)}function O(L){r.reverseOrbit||r.reverseHorizontalOrbit?f.theta+=L:f.theta-=L}function U(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)}})(),Q=(()=>{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)}})(),re=(()=>{const L=new ae;return function(Y,X){const Ee=r.domElement;if(Ee&&r.object instanceof Mt&&r.object.isPerspectiveCamera){const Ze=r.object.position;L.copy(Ze).sub(r.target);let ot=L.length();ot*=Math.tan(r.object.fov/2*Math.PI/180),j(2*Y*ot/Ee.clientHeight,r.object.matrix),Q(2*X*ot/Ee.clientHeight,r.object.matrix)}else Ee&&r.object instanceof $t&&r.object.isOrthographicCamera?(j(Y*(r.object.right-r.object.left)/r.object.zoom/Ee.clientWidth,r.object.matrix),Q(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 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 E(L){Z(p/L)}function oe(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,Ze=Y.width,ot=Y.height;v.x=X/Ze*2-1,v.y=-(Ee/ot)*2+1,I.set(v.x,v.y,1).unproject(r.object).sub(r.object.position).normalize()}function C(L){return Math.max(r.minDistance,Math.min(r.maxDistance,L))}function he(L){y.set(L.clientX,L.clientY)}function we(L){Me(L),R.set(L.clientX,L.clientY)}function me(L){k.set(L.clientX,L.clientY)}function Oe(L){x.set(L.clientX,L.clientY),w.subVectors(x,y).multiplyScalar(r.rotateSpeed);const Y=r.domElement;Y&&(O(2*Math.PI*w.x/Y.clientHeight),U(2*Math.PI*w.y/Y.clientHeight)),y.copy(x),r.update()}function $(L){P.set(L.clientX,L.clientY),h.subVectors(P,R),h.y>0?E(F()):h.y<0&&oe(F()),R.copy(P),r.update()}function b(L){S.set(L.clientX,L.clientY),_.subVectors(S,k).multiplyScalar(r.panSpeed),re(_.x,_.y),k.copy(S),r.update()}function A(L){Me(L),L.deltaY<0?oe(F()):L.deltaY>0&&E(F()),r.update()}function N(L){let Y=!1;switch(L.code){case r.keys.UP:re(0,r.keyPanSpeed),Y=!0;break;case r.keys.BOTTOM:re(0,-r.keyPanSpeed),Y=!0;break;case r.keys.LEFT:re(r.keyPanSpeed,0),Y=!0;break;case r.keys.RIGHT:re(-r.keyPanSpeed,0),Y=!0;break}Y&&(L.preventDefault(),r.update())}function V(){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 B(){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);R.set(0,X)}function ee(){r.enableZoom&&K(),r.enablePan&&B()}function ge(){r.enableZoom&&K(),r.enableRotate&&V()}function ke(L){if(m.length==1)x.set(L.pageX,L.pageY);else{const X=pt(L),Ee=.5*(L.pageX+X.x),Ze=.5*(L.pageY+X.y);x.set(Ee,Ze)}w.subVectors(x,y).multiplyScalar(r.rotateSpeed);const Y=r.domElement;Y&&(O(2*Math.PI*w.x/Y.clientHeight),U(2*Math.PI*w.y/Y.clientHeight)),y.copy(x)}function fe(L){if(m.length==1)S.set(L.pageX,L.pageY);else{const Y=pt(L),X=.5*(L.pageX+Y.x),Ee=.5*(L.pageY+Y.y);S.set(X,Ee)}_.subVectors(S,k).multiplyScalar(r.panSpeed),re(_.x,_.y),k.copy(S)}function ye(L){const Y=pt(L),X=L.pageX-Y.x,Ee=L.pageY-Y.y,Ze=Math.sqrt(X*X+Ee*Ee);P.set(0,Ze),h.set(0,Math.pow(P.y/R.y,r.zoomSpeed)),E(h.y),R.copy(P)}function Ie(L){r.enableZoom&&ye(L),r.enablePan&&fe(L)}function be(L){r.enableZoom&&ye(L),r.enableRotate&&ke(L)}function Ae(L){var Y,X;r.enabled!==!1&&(m.length===0&&((Y=r.domElement)==null||Y.ownerDocument.addEventListener("pointermove",je),(X=r.domElement)==null||X.ownerDocument.addEventListener("pointerup",tt)),dt(L),L.pointerType==="touch"?ue(L):en(L))}function je(L){r.enabled!==!1&&(L.pointerType==="touch"?xe(L):z(L))}function tt(L){var Y,X,Ee;it(L),m.length===0&&((Y=r.domElement)==null||Y.releasePointerCapture(L.pointerId),(X=r.domElement)==null||X.ownerDocument.removeEventListener("pointermove",je),(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;we(L),l=s.DOLLY;break;case yt.ROTATE:if(L.ctrlKey||L.metaKey||L.shiftKey){if(r.enablePan===!1)return;me(L),l=s.PAN}else{if(r.enableRotate===!1)return;he(L),l=s.ROTATE}break;case yt.PAN:if(L.ctrlKey||L.metaKey||L.shiftKey){if(r.enableRotate===!1)return;he(L),l=s.ROTATE}else{if(r.enablePan===!1)return;me(L),l=s.PAN}break;default:l=s.NONE}l!==s.NONE&&r.dispatchEvent(o)}function z(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;b(L);break}}function q(L){r.enabled===!1||r.enableZoom===!1||l!==s.NONE&&l!==s.ROTATE||(L.preventDefault(),r.dispatchEvent(o),A(L),r.dispatchEvent(a))}function ne(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;V(),l=s.TOUCH_ROTATE;break;case _t.PAN:if(r.enablePan===!1)return;B(),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;ee(),l=s.TOUCH_DOLLY_PAN;break;case _t.DOLLY_ROTATE:if(r.enableZoom===!1&&r.enableRotate===!1)return;ge(),l=s.TOUCH_DOLLY_ROTATE;break;default:l=s.NONE}break;default:l=s.NONE}l!==s.NONE&&r.dispatchEvent(o)}function xe(L){switch(bt(L),l){case s.TOUCH_ROTATE:if(r.enableRotate===!1)return;ke(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;be(L),r.update();break;default:l=s.NONE}}function Ve(L){r.enabled!==!1&&L.preventDefault()}function dt(L){m.push(L)}function it(L){delete T[L.pointerId];for(let Y=0;Y{oe(L),r.update()},this.dollyOut=(L=F())=>{E(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 Wo;new ae;var ac=Object.defineProperty,sc=(t,e,n)=>e in t?ac(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,fi=(t,e,n)=>(sc(t,typeof e!="symbol"?e+"":e,n),n);class Sa{constructor(e){fi(this,"data"),this.data=e}generateShapes(e,n=100,r){const i=[],o={letterSpacing:0,lineHeight:1,...r},a=lc(e,n,this.data,o);for(let s=0,l=a.length;s - #include - #include - uniform float thickness; - uniform bool screenspace; - uniform vec2 size; - void main() { - #if defined (USE_SKINNING) - #include - #include - #include - #include - #include - #endif - #include - #include - #include - #include - vec4 tNormal = vec4(normal, 0.0); - vec4 tPosition = vec4(transformed, 1.0); - #ifdef USE_INSTANCING - tNormal = instanceMatrix * tNormal; - tPosition = instanceMatrix * tPosition; - #endif - if (screenspace) { - vec3 newPosition = tPosition.xyz + tNormal.xyz * thickness; - gl_Position = projectionMatrix * modelViewMatrix * vec4(newPosition, 1.0); - } else { - vec4 clipPosition = projectionMatrix * modelViewMatrix * tPosition; - vec4 clipNormal = projectionMatrix * modelViewMatrix * tNormal; - vec2 offset = normalize(clipNormal.xy) * thickness / size * clipPosition.w * 2.0; - clipPosition.xy += offset; - gl_Position = clipPosition; - } - }`,`uniform vec3 color; - uniform float opacity; - void main(){ - gl_FragColor = vec4(color, opacity); - #include - #include - }`);const cc=["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 fc=["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"],dc=Fe({__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:w,maxDistance:k,minZoom:S,maxZoom:_,enableZoom:R,zoomSpeed:P,enableRotate:h,touches:I,rotateSpeed:v,target:g,mouseButtons:m}=Jr(r),{camera:T,renderer:M,extend:F,controls:O,invalidate:U}=Kn(),j=Go(null);F({OrbitControls:oc}),Be(j,Z=>{Q(),Z&&o.value?O.value=Z:O.value=null});function Q(){ar(j.value,"change",()=>{i("change",j.value),U()}),ar(j.value,"start",()=>i("start",j.value)),ar(j.value,"end",()=>i("end",j.value))}const{onBeforeRender:re}=Fn();return re(({invalidate:Z})=>{j.value&&(l.value||a.value)&&(j.value.update(),a.value&&Z())}),Ot(()=>{j.value&&j.value.dispose()}),e({instance:j}),(Z,E)=>(Z.camera||H(T))&&(Z.domElement||H(M))?(J(),ie("TresOrbitControls",{key:0,ref_key:"controlsRef",ref:j,target:H(g),"auto-rotate":H(a),"auto-rotate-speed":H(s),"enable-damping":H(l),"damping-factor":H(u),"enable-pan":H(c),"key-pan-speed":H(f),keys:Z.keys,"max-azimuth-angle":H(p),"min-azimuth-angle":H(d),"max-polar-angle":H(y),"min-polar-angle":H(x),"min-distance":H(w),"max-distance":H(k),"min-zoom":H(S),"max-zoom":H(_),touches:H(I),"enable-zoom":H(R),"zoom-speed":H(P),"enable-rotate":H(h),"rotate-speed":H(v),"mouse-buttons":H(m),args:[Z.camera||H(T),Z.domElement||H(M).domElement]},null,8,fc)):at("",!0)}});function In(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 Gi={exports:{}},Yi;function pc(){return Yi||(Yi=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 In=="function"&&In;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 In=="function"&&In,l=0;l>16),U((65280&m)>>8),U(255&m);return T==2?U(255&(m=I(v.charAt(g))<<2|I(v.charAt(g+1))>>4)):T==1&&(U((m=I(v.charAt(g))<<10|I(v.charAt(g+1))<<4|I(v.charAt(g+2))>>2)>>8&255),U(255&m)),M},y.fromByteArray=function(v){var g,m,T,M,F=v.length%3,O="";function U(j){return"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(j)}for(g=0,T=v.length-F;g>18&63)+U(M>>12&63)+U(M>>6&63)+U(63&M);switch(F){case 1:O=(O+=U((m=v[v.length-1])>>2))+U(m<<4&63)+"==";break;case 2:O=(O=(O+=U((m=(v[v.length-2]<<8)+v[v.length-1])>>10))+U(m>>4&63))+U(m<<2&63)+"="}return O}})(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,w,l,u,c,f,p,d){var y=n("base64-js"),x=n("ieee754");function w(b,A,N){if(!(this instanceof w))return new w(b,A,N);var V,B,K,ee,ge=typeof b;if(A==="base64"&&ge=="string")for(b=(ee=b).trim?ee.trim():ee.replace(/^\s+|\s+$/g,"");b.length%4!=0;)b+="=";if(ge=="number")V=re(b);else if(ge=="string")V=w.byteLength(b,A);else{if(ge!="object")throw new Error("First argument needs to be a number, array or string.");V=re(b.length)}if(w._useTypedArrays?B=w._augment(new Uint8Array(V)):((B=this).length=V,B._isBuffer=!0),w._useTypedArrays&&typeof b.byteLength=="number")B._set(b);else if(Z(ee=b)||w.isBuffer(ee)||ee&&typeof ee=="object"&&typeof ee.length=="number")for(K=0;K>8,ee=ee%256,ge.push(ee),ge.push(K);return ge}(A),b,N,V)}function _(b,A,N){var V="";N=Math.min(b.length,N);for(var B=A;B>>0)):(A+1>>0),B}function h(b,A,N,V){if(V||($(typeof N=="boolean","missing or invalid endian"),$(A!=null,"missing offset"),$(A+1>>8*(V?K:1-K)}function T(b,A,N,V,B){if(B||($(A!=null,"missing value"),$(typeof V=="boolean","missing or invalid endian"),$(N!=null,"missing offset"),$(N+3>>8*(V?K:3-K)&255}function M(b,A,N,V,B){B||($(A!=null,"missing value"),$(typeof V=="boolean","missing or invalid endian"),$(N!=null,"missing offset"),$(N+1this.length&&(V=this.length);var B=(V=b.length-A=this.length))return this[b]},w.prototype.readUInt16LE=function(b,A){return R(this,b,!0,A)},w.prototype.readUInt16BE=function(b,A){return R(this,b,!1,A)},w.prototype.readUInt32LE=function(b,A){return P(this,b,!0,A)},w.prototype.readUInt32BE=function(b,A){return P(this,b,!1,A)},w.prototype.readInt8=function(b,A){if(A||($(b!=null,"missing offset"),$(b=this.length))return 128&this[b]?-1*(255-this[b]+1):this[b]},w.prototype.readInt16LE=function(b,A){return h(this,b,!0,A)},w.prototype.readInt16BE=function(b,A){return h(this,b,!1,A)},w.prototype.readInt32LE=function(b,A){return I(this,b,!0,A)},w.prototype.readInt32BE=function(b,A){return I(this,b,!1,A)},w.prototype.readFloatLE=function(b,A){return v(this,b,!0,A)},w.prototype.readFloatBE=function(b,A){return v(this,b,!1,A)},w.prototype.readDoubleLE=function(b,A){return g(this,b,!0,A)},w.prototype.readDoubleBE=function(b,A){return g(this,b,!1,A)},w.prototype.writeUInt8=function(b,A,N){N||($(b!=null,"missing value"),$(A!=null,"missing offset"),$(A=this.length||(this[A]=b)},w.prototype.writeUInt16LE=function(b,A,N){m(this,b,A,!0,N)},w.prototype.writeUInt16BE=function(b,A,N){m(this,b,A,!1,N)},w.prototype.writeUInt32LE=function(b,A,N){T(this,b,A,!0,N)},w.prototype.writeUInt32BE=function(b,A,N){T(this,b,A,!1,N)},w.prototype.writeInt8=function(b,A,N){N||($(b!=null,"missing value"),$(A!=null,"missing offset"),$(A=this.length||(0<=b?this.writeUInt8(b,A,N):this.writeUInt8(255+b+1,A,N))},w.prototype.writeInt16LE=function(b,A,N){M(this,b,A,!0,N)},w.prototype.writeInt16BE=function(b,A,N){M(this,b,A,!1,N)},w.prototype.writeInt32LE=function(b,A,N){F(this,b,A,!0,N)},w.prototype.writeInt32BE=function(b,A,N){F(this,b,A,!1,N)},w.prototype.writeFloatLE=function(b,A,N){O(this,b,A,!0,N)},w.prototype.writeFloatBE=function(b,A,N){O(this,b,A,!1,N)},w.prototype.writeDoubleLE=function(b,A,N){U(this,b,A,!0,N)},w.prototype.writeDoubleBE=function(b,A,N){U(this,b,A,!1,N)},w.prototype.fill=function(b,A,N){if(A=A||0,N=N||this.length,$(typeof(b=typeof(b=b||0)=="string"?b.charCodeAt(0):b)=="number"&&!isNaN(b),"value is not a number"),$(A<=N,"end < start"),N!==A&&this.length!==0){$(0<=A&&A"},w.prototype.toArrayBuffer=function(){if(typeof Uint8Array>"u")throw new Error("Buffer.toArrayBuffer not supported in this browser");if(w._useTypedArrays)return new w(this).buffer;for(var b=new Uint8Array(this.length),A=0,N=b.length;A=A.length||B>=b.length);B++)A[B+N]=b[B];return B}function he(b){try{return decodeURIComponent(b)}catch{return"�"}}function we(b,A){$(typeof b=="number","cannot write a non-number as a number"),$(0<=b,"specified a negative value for writing an unsigned value"),$(b<=A,"value is larger than maximum value for type"),$(Math.floor(b)===b,"value has a fractional component")}function me(b,A,N){$(typeof b=="number","cannot write a non-number as a number"),$(b<=A,"value larger than maximum allowed value"),$(N<=b,"value smaller than minimum allowed value"),$(Math.floor(b)===b,"value has a fractional component")}function Oe(b,A,N){$(typeof b=="number","cannot write a non-number as a number"),$(b<=A,"value larger than maximum allowed value"),$(N<=b,"value smaller than minimum allowed value")}function $(b,A){if(!b)throw new Error(A||"Failed assertion")}w._augment=function(b){return b._isBuffer=!0,b._get=b.get,b._set=b.set,b.get=j.get,b.set=j.set,b.write=j.write,b.toString=j.toString,b.toLocaleString=j.toString,b.toJSON=j.toJSON,b.copy=j.copy,b.slice=j.slice,b.readUInt8=j.readUInt8,b.readUInt16LE=j.readUInt16LE,b.readUInt16BE=j.readUInt16BE,b.readUInt32LE=j.readUInt32LE,b.readUInt32BE=j.readUInt32BE,b.readInt8=j.readInt8,b.readInt16LE=j.readInt16LE,b.readInt16BE=j.readInt16BE,b.readInt32LE=j.readInt32LE,b.readInt32BE=j.readInt32BE,b.readFloatLE=j.readFloatLE,b.readFloatBE=j.readFloatBE,b.readDoubleLE=j.readDoubleLE,b.readDoubleBE=j.readDoubleBE,b.writeUInt8=j.writeUInt8,b.writeUInt16LE=j.writeUInt16LE,b.writeUInt16BE=j.writeUInt16BE,b.writeUInt32LE=j.writeUInt32LE,b.writeUInt32BE=j.writeUInt32BE,b.writeInt8=j.writeInt8,b.writeInt16LE=j.writeInt16LE,b.writeInt16BE=j.writeInt16BE,b.writeInt32LE=j.writeInt32LE,b.writeInt32BE=j.writeInt32BE,b.writeFloatLE=j.writeFloatLE,b.writeFloatBE=j.writeFloatBE,b.writeDoubleLE=j.writeDoubleLE,b.writeDoubleBE=j.writeDoubleBE,b.fill=j.fill,b.inspect=j.inspect,b.toArrayBuffer=j.toArrayBuffer,b}}).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,w=new y(x);w.fill(0),r.exports={hash:function(k,S,_,R){for(var P=S(function(m,T){m.length%x!=0&&(M=m.length+(x-m.length%x),m=y.concat([m,w],M));for(var M,F=[],O=T?m.readInt32BE:m.readInt32LE,U=0;U_?Q=j(Q):Q.length<_&&(Q=y.concat([Q,R],_));for(var Z=new y(_),E=new y(_),oe=0;oe<_;oe++)Z[oe]=54^Q[oe],E[oe]=92^Q[oe];return re=j(y.concat([Z,re])),j(y.concat([E,re]))}(M,T,U):M(U);return F=null,O?U.toString(O):U}}}function h(){var m=[].slice.call(arguments).join(" ");throw new Error([m,"we accept pull requests","http://github.com/dominictarr/crypto-browserify"].join(` -`))}R.fill(0),i.createHash=function(m){return P(m)},i.createHmac=P,i.randomBytes=function(m,T){if(!T||!T.call)return new y(k(m));try{T.call(this,void 0,new y(k(m)))}catch(M){T(M)}};var I,v=["createCredentials","createCipher","createCipheriv","createDecipher","createDecipheriv","createSign","createVerify","createDiffieHellman","pbkdf2"],g=function(m){i[m]=function(){h("sorry,",m,"is not implemented yet")}};for(I in v)g(v[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/crypto-browserify/index.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./md5":6,"./rng":7,"./sha":8,"./sha256":9,buffer:3,lYpoI2:11}],6:[function(n,r,i){(function(o,a,s,l,u,c,f,p,d){var y=n("./helpers");function x(h,I){h[I>>5]|=128<>>9<<4)]=I;for(var v=1732584193,g=-271733879,m=-1732584194,T=271733878,M=0;M>>32-m,v)}function k(h,I,v,g,m,T,M){return w(I&v|~I&g,h,I,m,T,M)}function S(h,I,v,g,m,T,M){return w(I&g|v&~g,h,I,m,T,M)}function _(h,I,v,g,m,T,M){return w(I^v^g,h,I,m,T,M)}function R(h,I,v,g,m,T,M){return w(v^(I|~g),h,I,m,T,M)}function P(h,I){var v=(65535&h)+(65535&I);return(h>>16)+(I>>16)+(v>>16)<<16|65535&v}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,w=new Array(y),k=0;k>>((3&k)<<3)&255;return 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/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(S,_){S[_>>5]|=128<<24-_%32,S[15+(_+64>>9<<4)]=_;for(var R,P,h,I=Array(80),v=1732584193,g=-271733879,m=-1732584194,T=271733878,M=-1009589776,F=0;F>16)+(_>>16)+(R>>16)<<16|65535&R}function k(S,_){return S<<_|S>>>32-_}r.exports=function(S){return y.hash(S,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(_,R){var P=(65535&_)+(65535&R);return(_>>16)+(R>>16)+(P>>16)<<16|65535&P}function x(_,R){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),v=new Array(64);_[R>>5]|=128<<24-R%32,_[15+(R+64>>9<<4)]=R;for(var g,m,T=0;T<_.length;T+=16){for(var M=I[0],F=I[1],O=I[2],U=I[3],j=I[4],Q=I[5],re=I[6],Z=I[7],E=0;E<64;E++)v[E]=E<16?_[E+T]:y(y(y((m=v[E-2],k(m,17)^k(m,19)^S(m,10)),v[E-7]),(m=v[E-15],k(m,7)^k(m,18)^S(m,3))),v[E-16]),P=y(y(y(y(Z,k(m=j,6)^k(m,11)^k(m,25)),j&Q^~j&re),h[E]),v[E]),g=y(k(g=M,2)^k(g,13)^k(g,22),M&F^M&O^F&O),Z=re,re=Q,Q=j,j=y(U,P),U=O,O=F,F=M,M=y(P,g);I[0]=y(M,I[0]),I[1]=y(F,I[1]),I[2]=y(O,I[2]),I[3]=y(U,I[3]),I[4]=y(j,I[4]),I[5]=y(Q,I[5]),I[6]=y(re,I[6]),I[7]=y(Z,I[7])}return I}var w=n("./helpers"),k=function(_,R){return _>>>R|_<<32-R},S=function(_,R){return _>>>R};r.exports=function(_){return w.hash(_,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,w,k,T){var _,R,P=8*T-k-1,h=(1<>1,v=-7,g=w?T-1:0,m=w?-1:1,T=y[x+g];for(g+=m,_=T&(1<<-v)-1,T>>=-v,v+=P;0>=-v,v+=k;0>1,g=S===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=k?0:M-1,T=k?1:-1,M=x<0||x===0&&1/x<0?1:0;for(x=Math.abs(x),isNaN(x)||x===1/0?(P=isNaN(x)?1:0,R=I):(R=Math.floor(Math.log(x)/Math.LN2),x*(k=Math.pow(2,-R))<1&&(R--,k*=2),2<=(x+=1<=R+v?g/k:g*Math.pow(2,1-v))*k&&(R++,k/=2),I<=R+v?(P=0,R=I):1<=R+v?(P=(x*k-1)*Math.pow(2,S),R+=v):(P=x*Math.pow(2,v-1)*Math.pow(2,S),R=0));8<=S;y[w+m]=255&P,m+=T,P/=256,S-=8);for(R=R<>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"]),Wi}var Zi,Qi;function Ra(){return Qi||(Qi=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,Ji;function mc(){if(Ji)return dr;Ji=1;var t=Ia();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,eo;function gc(){if(eo)return pr;eo=1;var t=Ra();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,to;function yc(){if(to)return hr;to=1,hr=R;var t=Ia(),e=hc(),n=Ra(),r=mc(),i=gc(),o=999,a=9999,s=0,l=1,u=2,c=3,f=4,p=5,d=6,y=7,x=8,w=9,k=10,S=11,_=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"];function R(P){var h=0,I=0,v=o,g,m,T=[],M=[],F=1,O=0,U=0,j=!1,Q=!1,re="",Z;P=P||{};var E=n,oe=t;P.version==="300 es"&&(E=i,oe=r);for(var Me={},C={},h=0;h0)continue;be=fe.slice(0,1).join("")}return he(be),U+=be.length,T=T.slice(be.length),T.length}while(!0)}function K(){return/[^a-fA-F0-9]/.test(g)?(he(T.join("")),v=o,h):(T.push(g),m=g,h+1)}function ee(){return g==="."||/[eE]/.test(g)?(T.push(g),v=p,m=g,h+1):g==="x"&&T.length===1&&T[0]==="0"?(v=S,T.push(g),m=g,h+1):/[^\d]/.test(g)?(he(T.join("")),v=o,h):(T.push(g),m=g,h+1)}function ge(){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)?(he(T.join("")),v=o,h):(T.push(g),m=g,h+1)}function ke(){if(/[^\d\w_]/.test(g)){var fe=T.join("");return C[fe]?v=x:Me[fe]?v=y:v=d,he(T.join("")),v=o,h}return T.push(g),m=g,h+1}}return hr}var mr,no;function xc(){if(no)return mr;no=1;var t=yc();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}xc();function vc(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 bc(t){var e=vc(t,"string");return typeof e=="symbol"?e:String(e)}function Se(t,e,n){return e=bc(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"},He,zt;He={},Se(He,"".concat(le.normal),{"#include ":` - vec3 objectNormal = `.concat(le.normal,`; - #ifdef USE_TANGENT - vec3 objectTangent = vec3( tangent.xyz ); - #endif - `)}),Se(He,"".concat(le.position),{"#include ":` - vec3 transformed = `.concat(le.position,`; - `)}),Se(He,"".concat(le.positionRaw),{"#include ":` - vec4 csm_internal_positionUnprojected = `.concat(le.positionRaw,`; - mat4x4 csm_internal_unprojectMatrix = projectionMatrix * modelViewMatrix; - #ifdef USE_INSTANCING - csm_internal_unprojectMatrix = csm_internal_unprojectMatrix * instanceMatrix; - #endif - csm_internal_positionUnprojected = inverse(csm_internal_unprojectMatrix) * csm_internal_positionUnprojected; - vec3 transformed = csm_internal_positionUnprojected.xyz; - `)}),Se(He,"".concat(le.pointSize),{"gl_PointSize = size;":` - gl_PointSize = `.concat(le.pointSize,`; - `)}),Se(He,"".concat(le.diffuseColor),{"#include ":` - #include - diffuseColor = `.concat(le.diffuseColor,`; - `)}),Se(He,"".concat(le.fragColor),{"#include ":` - #include - gl_FragColor = `.concat(le.fragColor,`; - `)}),Se(He,"".concat(le.emissive),{"vec3 totalEmissiveRadiance = emissive;":` - vec3 totalEmissiveRadiance = `.concat(le.emissive,`; - `)}),Se(He,"".concat(le.roughness),{"#include ":` - #include - roughnessFactor = `.concat(le.roughness,`; - `)}),Se(He,"".concat(le.metalness),{"#include ":` - #include - metalnessFactor = `.concat(le.metalness,`; - `)}),Se(He,"".concat(le.ao),{"#include ":` - #include - reflectedLight.indirectDiffuse *= 1. - `.concat(le.ao,`; - `)}),Se(He,"".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(He,"".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 ); - gl_FragColor.a *= `.concat(le.depthAlpha,`; - `)});zt={},Se(zt,"".concat(le.position),{"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );":` - gl_Position = projectionMatrix * modelViewMatrix * vec4( `.concat(le.position,`, 1.0 ); - `)}),Se(zt,"".concat(le.positionRaw),{"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );":` - gl_Position = `.concat(le.position,`; - `)}),Se(zt,"".concat(le.diffuseColor),{"gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );":` - 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 wc=`void main() { - gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0); -}`,kc=`#include - -void main() { - vec2 center = vec2(0., 1.); - float rotation = 0.0; - - - - float size = 0.03; - - vec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 ); - vec2 scale; - scale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) ); - scale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) ); - - bool isPerspective = isPerspectiveMatrix( projectionMatrix ); - if ( isPerspective ) scale *= - mvPosition.z; - - vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale * size; - vec2 rotatedPosition; - rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y; - rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y; - mvPosition.xy += rotatedPosition; - - gl_Position = projectionMatrix * mvPosition; -}`;const bn=new ae(0,0,0),di=new ae(0,0,0),Tc=new ae(0,0,0);function ro(t,e,n){const r=bn.setFromMatrixPosition(t.matrixWorld);r.project(e);const i=n.width/2,o=n.height/2;return[(Number.isNaN(r.x)?0:r.x)*i+i,-(r.y*o)+o,r.z]}function _c(t,e){const n=bn.setFromMatrixPosition(t.matrixWorld),r=di.setFromMatrixPosition(e.matrixWorld),i=n.sub(r),o=e.getWorldDirection(Tc);return i.angleTo(o)>Math.PI/2}function Ec(t,e,n,r){const i=bn.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 Ca(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 Sc=(t=>e=>Ca(e,t))([1,-1,1,1,1,-1,1,1,1,-1,1,1,1,-1,1,1]),Ic=(t=>(e,n)=>Ca(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]),Rc=["geometry","material"];new Zo;var zr={exports:{}},Cc=zr.exports,io;function Nc(){return io||(io=1,function(t,e){(function(n,r){t.exports=r()})(Cc,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,w=74*u,k=30*u,S=document.createElement("canvas");S.width=c,S.height=f,S.style.cssText="width:80px;height:48px";var _=S.getContext("2d");return _.font="bold "+9*u+"px Helvetica,Arial,sans-serif",_.textBaseline="top",_.fillStyle=o,_.fillRect(0,0,c,f),_.fillStyle=i,_.fillText(r,p,d),_.fillRect(y,x,w,k),_.fillStyle=o,_.globalAlpha=.9,_.fillRect(y,x,w,k),{dom:S,update:function(R,P){a=Math.min(a,R),s=Math.max(s,R),_.fillStyle=o,_.globalAlpha=1,_.fillRect(0,0,c,x),_.fillStyle=i,_.fillText(l(R)+" "+r+" ("+l(a)+"-"+l(s)+")",p,d),_.drawImage(S,y+u,x,w-u,k,y,x,w-u,k),_.fillRect(y+w-u,x,u,k),_.fillStyle=o,_.globalAlpha=.9,_.fillRect(y+w-u,x,u,l((1-R/P)*k))}}},n})}(zr)),zr.exports}Nc();const Lc={key:0,args:[0,1,64]},Pc={key:1,args:[.5,1,64]},Dc={key:2},Oc=["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,w){return Math.min(Math.max(y,x),w)}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 w=a(x),k=10**(w+3);return Number.parseFloat((y*k/k).toFixed(w))}const l=Ue(()=>s(o(n.modelValue,n.min,n.max),n.step)),u=Ue(()=>{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,S=n.max-n.min,_=n.min+S*k,R=Math.round(_/n.step)*n.step;return Math.min(Math.max(R,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)=>(J(),ie("span",{ref_key:"sliderRef",ref:i,class:lt(["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},[D("span",{style:Lr(u.value),bg:"[#cabeff] dark:[#4e34b9]",relative:"",block:"","rounded-sm":"",h:"[14px]"},null,4),D("span",{role:"slider",class:"slider-thumb",style:Lr({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 oo(t,e){if(e===$s)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),t;if(e===Pr||e===ia){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 yf(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 Bc(){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 zc{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 Jc{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 ef{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 tf{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 nf{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,w=new ae,k=new Bn,S=new ae(1,1,1),_=new Ws(y.geometry,y.material,p);for(let R=0;R0||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 gf=new xt;class yf{constructor(e={},n={}){this.json=e,this.extensions={},this.plugins={},this.options=n,this.cache=new Bc,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 Zs(this.options.manager):this.textureLoader=new Qs(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new oa(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&&w.setY(g,h[I*l+1]),l>=3&&w.setZ(g,h[I*l+2]),l>=4&&w.setW(g,h[I*l+3]),l>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}w.normalized=y}return w})}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=so[p.magFilter]||Un,c.minFilter=so[p.minFilter]||ii,c.wrapS=lo[p.wrapS]||jn,c.wrapT=lo[p.wrapT]||jn,c.generateMipmaps=!c.isCompressedTexture&&c.minFilter!==Lt&&c.minFilter!==Un,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 w=new zn(x);w.needsUpdate=!0,p(w)}),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||mf(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 Js,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 el,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 aa}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,hn)),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,hn)),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=pn.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 uo(l,s,n)})}const a=[];for(let s=0,l=e.length;s0&&pf(k,o),k.name=n.createUniqueName(o.name||"mesh_"+e),gt(k,o),w.extensions&&Rt(i,k,w),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 zn)&&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=Ii;break;case kt.rotation:u=Ri;break;case kt.translation:case kt.scale:u=Si;break;default:switch(r.itemSize){case 1:u=Ii;break;case 2:case 3:default:u=Si;break}break}const c=i.interpolation!==void 0?cf[i.interpolation]:ei,f=this._getArrayFromAccessor(r);for(let p=0,d=l.length;pnew wl(t)),Ct.register(t=>new kl(t)),Ct)}async function vf(t){const r=(await Pa().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 bf(t,e){if(!t){console.warn("No VRM found");return}if(e)return Tl(e,t)}function wf(){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 kf(){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=_l()/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 Tf(t,e){const i=(await Pa().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(Dr.removeUnnecessaryVertices(o.scene),Dr.combineSkeletons(o.scene),o.scene.traverse(a=>{a.frustumCulled=!1}),o.lookAt){const a=new El(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 _f(t){const e=W(null),n=W(!1),r=W(0),i=W(new Map),o=W(new Map),a=W(),s=(k,S,_)=>k+(S-k)*_,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 _;if(c(),!u.has(k)){console.warn(`Emotion ${k} not found`);return}const S=u.get(k);if(e.value=k,n.value=!0,r.value=0,t.expressionManager){const R=Object.keys(t.expressionManager.expressionMap);for(const P of R)t.expressionManager.setValue(P,0)}i.value.clear(),o.value.clear();for(const R of S.expression||[]){const P=((_=t.expressionManager)==null?void 0:_.getValue(R.name))||0;i.value.set(R.name,P),o.value.set(R.name,R.value)}};return{currentEmotion:e,isTransitioning:n,setEmotion:f,setEmotionWithResetAfter:(k,S)=>{c(),f(k),a.value=setTimeout(()=>{f("neutral"),a.value=void 0},S)},update:k=>{var R;if(!n.value||!e.value)return;const _=u.get(e.value).blendDuration||.3;r.value+=k/_,r.value>=1&&(r.value=1,n.value=!1);for(const[P,h]of o.value){const I=i.value.get(P)||0,v=s(I,h,l(r.value));(R=t.expressionManager)==null||R.setValue(P,v)}},addEmotionState:(k,S)=>{u.set(k,S)},removeEmotionState:k=>{u.delete(k)},dispose:()=>{c()}}}const Ef=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}=Kn(),{onBeforeRender:u}=Fn(),c=wf(),f=kf(),p=W();Be(()=>r.position,([x,w,k])=>{a.value&&a.value.scene.position.set(x,w,k)}),mn(async()=>{if(l.value)try{const x=await Tf(r.model,{scene:l.value,lookAt:!0,position:r.position,onProgress:S=>i("loadModelProgress",Number.parseFloat((100*(S.loaded/S.total)).toFixed(2)))});if(!x){console.warn("No VRM model loaded");return}const w=await vf(r.idleAnimation),k=await bf(x,w);if(!k){console.warn("No VRM animation loaded");return}s.value=new fl(x.scene),s.value.clipAction(k).play(),p.value=_f(x),a.value=x,o=u(({delta:S})=>{var _,R,P;(_=s.value)==null||_.update(S),(R=a.value)==null||R.update(S),c.update(a.value,S),f.update(a.value,S),(P=p.value)==null||P.update(S)}).off}catch(x){i("error",x)}}),Ot(()=>{o==null||o(),a.value&&(a.value.scene.removeFromParent(),Dr.deepDispose(a.value.scene))}),e({setExpression(x){var w;(w=p.value)==null||w.setEmotionWithResetAfter(x,1e3)}});const{pause:d,resume:y}=Fn();return Be(()=>r.paused,x=>{x?d():y()}),(x,w)=>gn(x.$slots,"default")}}),Mf=["position"],Af={absolute:"",bottom:"3",right:"3"},Sf={flex:"~ row","cursor-pointer":""},If=["checked","aria-checked"],Rf={key:0,"min-w":"50vw",z:"{var x;(x=p.value)==null||x.setExpression(y)}}),(y,x)=>(J(),Xt(pa,{relative:""},{default:Ye(({height:w,width:k})=>[Te(H(dl),{alpha:!0,antialias:!0,width:k,height:w},{default:Ye(()=>[Te(H(dc)),D("TresPerspectiveCamera",{position:[a.value,s.value,l.value]},null,8,Mf),x[14]||(x[14]=D("TresDirectionalLight",{color:16777215,intensity:1.2,position:[1,1,1]},null,-1)),x[15]||(x[15]=D("TresAmbientLight",{color:16777215,intensity:1.5},null,-1)),Te(Ef,{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]=S=>i("loadModelProgress",S)),onError:x[1]||(x[1]=S=>i("error",S))},null,8,["model","idle-animation","position","paused"])]),_:2,__:[14,15]},1032,["width","height"]),D("div",Af,[D("div",Sf,[D("label",{class:lt([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(D("input",{"onUpdate:modelValue":x[2]||(x[2]=S=>o.value=S),checked:o.value,"aria-checked":o.value,name:"showLive2DViewerInspector",type:"checkbox","appearance-none":"","outline-none":"",hidden:""},null,8,If),[[Qr,o.value]]),x[16]||(x[16]=D("div",{"select-none":""},[D("div",{"i-solar:bug-bold-duotone":""})],-1))],2)]),Te(H(ui),null,{default:Ye(()=>[o.value?(J(),ie("div",Rf,[D("div",Cf,[D("div",Nf,[D("span",null,ve(H(d)("stage.viewers.debug-menu.vrm.model.title")),1)]),Te(Li,{"h-fit":"","w-full":"",flex:"~ col",border:"~ gray/25 rounded-lg",divide:"y dashed gray/25","of-clip":"","shadow-sm":""},{label:Ye(()=>[D("span",Lf,ve(H(d)("stage.viewers.debug-menu.vrm.camera")),1)]),default:Ye(()=>[D("div",Pf,[x[17]||(x[17]=D("div",{text:"neutral-400 dark:neutral-500"},[D("span",null,"X")],-1)),D("label",Df,[Te(Ut,{modelValue:a.value,"onUpdate:modelValue":x[3]||(x[3]=S=>a.value=S),min:-10,max:10,step:.01},null,8,["modelValue"])]),D("div",Of,[D("span",null,ve(a.value),1)]),x[18]||(x[18]=D("div",{text:"neutral-400 dark:neutral-500"},[D("span",null,"Y")],-1)),D("label",Ff,[Te(Ut,{modelValue:s.value,"onUpdate:modelValue":x[4]||(x[4]=S=>s.value=S),min:-10,max:10,step:.01},null,8,["modelValue"])]),D("div",Bf,[D("span",null,ve(s.value),1)]),x[19]||(x[19]=D("div",{text:"neutral-400 dark:neutral-500"},[D("span",null,"Z")],-1)),D("label",zf,[Te(Ut,{modelValue:l.value,"onUpdate:modelValue":x[5]||(x[5]=S=>l.value=S),min:-10,max:10,step:.01},null,8,["modelValue"])]),D("div",Uf,[D("span",null,ve(l.value),1)])])]),_:1}),Te(Li,{"h-fit":"","w-full":"",flex:"~ col",border:"~ gray/25 rounded-lg",divide:"y dashed gray/25","of-clip":"","shadow-sm":""},{label:Ye(()=>[D("span",jf,ve(H(d)("stage.viewers.debug-menu.vrm.model.title")),1)]),default:Ye(()=>[D("div",Vf,[x[20]||(x[20]=D("div",{text:"neutral-400 dark:neutral-500"},[D("span",null,"X")],-1)),D("label",Hf,[Te(Ut,{modelValue:u.value,"onUpdate:modelValue":x[6]||(x[6]=S=>u.value=S),min:-10,max:10,step:.01},null,8,["modelValue"])]),D("div",$f,[D("span",null,ve(u.value),1)]),x[21]||(x[21]=D("div",{text:"neutral-400 dark:neutral-500"},[D("span",null,"Y")],-1)),D("label",Gf,[Te(Ut,{modelValue:c.value,"onUpdate:modelValue":x[7]||(x[7]=S=>c.value=S),min:-10,max:10,step:.01},null,8,["modelValue"])]),D("div",Yf,[D("span",null,ve(c.value),1)]),x[22]||(x[22]=D("div",{text:"neutral-400 dark:neutral-500"},[D("span",null,"Z")],-1)),D("label",Kf,[Te(Ut,{modelValue:f.value,"onUpdate:modelValue":x[8]||(x[8]=S=>f.value=S),min:-10,max:10,step:.01},null,8,["modelValue"])]),D("div",qf,[D("span",null,ve(f.value),1)])])]),_:1}),D("div",Wf,[D("span",null,ve(H(d)("stage.viewers.debug-menu.emotions")),1)]),D("div",Xf,[D("button",{"rounded-lg":"",bg:"neutral-100/70 dark:neutral-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:x[9]||(x[9]=S=>{var _;return(_=p.value)==null?void 0:_.setExpression("neutral")})},ve(H(d)("stage.viewers.debug-menu.emotions-btn.neutral")),1),D("button",{"rounded-lg":"",bg:"neutral-100/70 dark:neutral-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:x[10]||(x[10]=S=>{var _;return(_=p.value)==null?void 0:_.setExpression("surprised")})},ve(H(d)("stage.viewers.debug-menu.emotions-btn.surprised")),1),D("button",{"rounded-lg":"",bg:"neutral-100/70 dark:neutral-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:x[11]||(x[11]=S=>{var _;return(_=p.value)==null?void 0:_.setExpression("sad")})},ve(H(d)("stage.viewers.debug-menu.emotions-btn.sad")),1),D("button",{"rounded-lg":"",bg:"neutral-100/70 dark:neutral-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:x[12]||(x[12]=S=>{var _;return(_=p.value)==null?void 0:_.setExpression("angry")})},ve(H(d)("stage.viewers.debug-menu.emotions-btn.angry")),1),D("button",{"rounded-lg":"",bg:"neutral-100/70 dark:neutral-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:x[13]||(x[13]=S=>{var _;return(_=p.value)==null?void 0:_.setExpression("happy")})},ve(H(d)("stage.viewers.debug-menu.emotions-btn.happy")),1)])])])):at("",!0)]),_:1})])]),_:1}))}}),Qf=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];class wn{constructor(e,n,r){this.normal=n,this.property=e,r&&(this.space=r)}}wn.prototype.normal={};wn.prototype.property={};wn.prototype.space=void 0;function Da(t,e){const n={},r={};for(const i of t)Object.assign(n,i.property),Object.assign(r,i.normal);return new wn(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 Jf=0;const ce=Ft(),Le=Ft(),Oa=Ft(),G=Ft(),Re=Ft(),Kt=Ft(),Qe=Ft();function Ft(){return 2**++Jf}const Hr=Object.freeze(Object.defineProperty({__proto__:null,boolean:ce,booleanish:Le,commaOrSpaceSeparated:Qe,commaSeparated:Kt,number:G,overloadedBoolean:Oa,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),co(this,"space",i),typeof r=="number")for(;++o4&&n.slice(0,4)==="data"&&rd.test(e)){if(e.charAt(4)==="-"){const o=e.slice(5).replace(fo,ad);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=e.slice(4);if(!fo.test(o)){let a=o.replace(nd,od);a.charAt(0)!=="-"&&(a="-"+a),e="data"+a}}i=pi}return new i(r,e)}function od(t){return"-"+t.toLowerCase()}function ad(t){return t.charAt(1).toUpperCase()}const sd=Da([Fa,ed,Ua,ja,Va],"html"),Ha=Da([Fa,td,Ua,ja,Va],"svg"),po={}.hasOwnProperty;function ld(t,e){const n=e||{};function r(i,...o){let a=r.invalid;const s=r.handlers;if(i&&po.call(i,t)){const l=String(i[t]);a=po.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 ud=/^>|^->||--!>|"],fd=["<",">"];function dd(t,e,n,r){return r.settings.bogusComments?"":"";function i(o){return Gt(o,Object.assign({},r.settings.characterReferences,{subset:fd}))}}function pd(t,e,n,r){return""}function hd(t,e){const n=e||{};return(t[t.length-1]===""?[...t,""]:t).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}function md(t){return t.join(" ").trim()}const gd=/[ \t\n\f\r]/g;function hi(t){return typeof t=="object"?t.type==="text"?ho(t.value):!1:ho(t)}function ho(t){return t.replace(gd,"")===""}const De=Ga(1),$a=Ga(-1),yd=[];function Ga(t){return e;function e(n,r,i){const o=n?n.children:yd;let a=(r||0)+t,s=o[a];if(!i)for(;s&&hi(s);)a+=t,s=o[a];return s}}const xd={}.hasOwnProperty;function Ya(t){return e;function e(n,r,i){return xd.call(t,n.tagName)&&t[n.tagName](n,r,i)}}const mi=Ya({body:bd,caption:br,colgroup:br,dd:_d,dt:Td,head:br,html:vd,li:kd,optgroup:Ed,option:Md,p:wd,rp:mo,rt:mo,tbody:Sd,td:go,tfoot:Id,th:go,thead:Ad,tr:Rd});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 vd(t,e,n){const r=De(n,e);return!r||r.type!=="comment"}function bd(t,e,n){const r=De(n,e);return!r||r.type!=="comment"}function wd(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 kd(t,e,n){const r=De(n,e);return!r||r.type==="element"&&r.tagName==="li"}function Td(t,e,n){const r=De(n,e);return!!(r&&r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd"))}function _d(t,e,n){const r=De(n,e);return!r||r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd")}function mo(t,e,n){const r=De(n,e);return!r||r.type==="element"&&(r.tagName==="rp"||r.tagName==="rt")}function Ed(t,e,n){const r=De(n,e);return!r||r.type==="element"&&r.tagName==="optgroup"}function Md(t,e,n){const r=De(n,e);return!r||r.type==="element"&&(r.tagName==="option"||r.tagName==="optgroup")}function Ad(t,e,n){const r=De(n,e);return!!(r&&r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot"))}function Sd(t,e,n){const r=De(n,e);return!r||r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot")}function Id(t,e,n){return!De(n,e)}function Rd(t,e,n){const r=De(n,e);return!r||r.type==="element"&&r.tagName==="tr"}function go(t,e,n){const r=De(n,e);return!r||r.type==="element"&&(r.tagName==="td"||r.tagName==="th")}const Cd=Ya({body:Pd,colgroup:Dd,head:Ld,html:Nd,tbody:Od});function Nd(t){const e=De(t,-1);return!e||e.type!=="comment"}function Ld(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 Pd(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 Dd(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 Od(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 Rn={name:[[` -\f\r &/=>`.split(""),` -\f\r "&'/=>\``.split("")],[`\0 -\f\r "&'/<=>`.split(""),`\0 -\f\r "&'/<=>\``.split("")]],unquoted:[[` -\f\r &>`.split(""),`\0 -\f\r "&'<=>\``.split("")],[`\0 -\f\r "&'<=>\``.split(""),`\0 -\f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function Fd(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=Ha);const u=Bd(r,t.properties),c=r.all(i.space==="html"&&t.tagName==="template"?t.content:t);return r.schema=i,c&&(a=!1),(u||!o||!Cd(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 Bd(t,e){const n=[];let r=-1,i;if(e){for(i in e)if(e[i]!==null&&e[i]!==void 0){const o=zd(t,i,e[i]);o&&n.push(o)}}for(;++rNi(n,t.alternative)&&(a=t.alternative),s=a+Gt(n,Object.assign({},t.settings.characterReferences,{subset:(a==="'"?Rn.single:Rn.double)[i][o],attribute:!0}))+a),l+(s&&"="+s))}const Ud=["<","&"];function Ka(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:Ud}))}function jd(t,e,n,r){return r.settings.allowDangerousHtml?t.value:Ka(t,e,n,r)}function Vd(t,e,n,r){return r.all(t)}const Hd=ld("type",{invalid:$d,unknown:Gd,handlers:{comment:dd,doctype:pd,element:Fd,raw:jd,root:Vd,text:Ka}});function $d(t){throw new Error("Expected node, not `"+t+"`")}function Gd(t){const e=t;throw new Error("Cannot compile unknown node `"+e.type+"`")}const Yd={},Kd={},qd=[];function Wd(t,e){const n=e||Yd,r=n.quote||'"',i=r==='"'?"'":'"';if(r!=='"'&&r!=="'")throw new Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:Xd,all:Zd,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||Qf,characterReferences:n.characterReferences||Kd,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space==="svg"?Ha:sd,quote:r,alternative:i}.one(Array.isArray(t)?{type:"root",children:t}:t,void 0,void 0)}function Xd(t,e,n){return Hd(t,e,n,this)}function Zd(t){const e=[],n=t&&t.children||qd;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 vo={}.hasOwnProperty;function np(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]/),op=It(/[#-'*+\--9=?A-Z^-~]/);function $r(t){return t!==null&&(t<32||t===127)}const Gr=It(/\d/),ap=It(/[\dA-Fa-f]/),sp=It(/[!-/:-@[-`{-~]/);function se(t){return t!==null&&t<-2}function qe(t){return t!==null&&(t<0||t===32)}function _e(t){return t===-2||t===-1||t===32}const lp=It(new RegExp("\\p{P}|\\p{S}","u")),up=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 _e(l)?(t.enter(n),s(l)):e(l)}function s(l){return _e(l)&&o++a))return;const I=e.events.length;let v=I,g,m;for(;v--;)if(e.events[v][0]==="exit"&&e.events[v][1].type==="chunkFlow"){if(g){m=e.events[v][1].end;break}g=!0}for(k(r),h=I;h_;){const P=n[R];e.containerState=P[1],P[0].exit.call(e,t)}n.length=_}function S(){i.write([null]),o=void 0,i=void 0,e.containerState._closeFlow=void 0}}function hp(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 wo(t){if(t===null||qe(t)||up(t))return 1;if(lp(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};ko(f,-l),ko(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&&_e(h)?Ce(t,S,"linePrefix",o+1)(h):S(h)}function S(h){return h===null||se(h)?t.check(To,x,R)(h):(t.enter("codeFlowValue"),_(h))}function _(h){return h===null||se(h)?(t.exit("codeFlowValue"),S(h)):(t.consume(h),_)}function R(h){return t.exit("codeFenced"),e(h)}function P(h,I,v){let g=0;return m;function m(U){return h.enter("lineEnding"),h.consume(U),h.exit("lineEnding"),T}function T(U){return h.enter("codeFencedFence"),_e(U)?Ce(h,M,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(U):M(U)}function M(U){return U===s?(h.enter("codeFencedFenceSequence"),F(U)):v(U)}function F(U){return U===s?(g++,h.consume(U),F):g>=a?(h.exit("codeFencedFenceSequence"),_e(U)?Ce(h,O,"whitespace")(U):O(U)):v(U)}function O(U){return U===null||se(U)?(h.exit("codeFencedFence"),I(U)):v(U)}}}function Mp(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:Sp},Ap={partial:!0,tokenize:Ip};function Sp(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(Ap,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 Ip(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 Rp={name:"codeText",previous:Np,resolve:Cp,tokenize:Lp};function Cp(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 es(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=!_e(d)),d===92?p:f)}function p(d){return d===91||d===92||d===93?(t.consume(d),s++,f):f(d)}}function ns(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):_e(i)?Ce(t,r,n?"linePrefix":"lineSuffix")(i):e(i)}}const jp={name:"definition",tokenize:Hp},Vp={partial:!0,tokenize:$p};function Hp(t,e,n){const r=this;let i;return o;function o(d){return t.enter("definition"),a(d)}function a(d){return ts.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 es(t,c,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(d)}function c(d){return t.attempt(Vp,f,f)(d)}function f(d){return _e(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 $p(t,e,n){return r;function r(s){return qe(s)?fn(t,i)(s):n(s)}function i(s){return ns(t,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(s)}function o(s){return _e(s)?Ce(t,a,"whitespace")(s):a(s)}function a(s){return s===null||se(s)?e(s):n(s)}}const Gp={name:"hardBreakEscape",tokenize:Yp};function Yp(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 Kp={name:"headingAtx",resolve:qp,tokenize:Wp};function qp(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 Wp(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)):_e(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 Xp=["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"],Zp={concrete:!0,name:"htmlFlow",resolveTo:eh,tokenize:th},Qp={partial:!0,tokenize:rh},Jp={partial:!0,tokenize:nh};function eh(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 th(t,e,n){const r=this;let i,o,a,s,l;return u;function u(C){return c(C)}function c(C){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(C),f}function f(C){return C===33?(t.consume(C),p):C===47?(t.consume(C),o=!0,x):C===63?(t.consume(C),i=3,r.interrupt?e:E):ut(C)?(t.consume(C),a=String.fromCharCode(C),w):n(C)}function p(C){return C===45?(t.consume(C),i=2,d):C===91?(t.consume(C),i=5,s=0,y):ut(C)?(t.consume(C),i=4,r.interrupt?e:E):n(C)}function d(C){return C===45?(t.consume(C),r.interrupt?e:E):n(C)}function y(C){const he="CDATA[";return C===he.charCodeAt(s++)?(t.consume(C),s===he.length?r.interrupt?e:M:y):n(C)}function x(C){return ut(C)?(t.consume(C),a=String.fromCharCode(C),w):n(C)}function w(C){if(C===null||C===47||C===62||qe(C)){const he=C===47,we=a.toLowerCase();return!he&&!o&&Eo.includes(we)?(i=1,r.interrupt?e(C):M(C)):Xp.includes(a.toLowerCase())?(i=6,he?(t.consume(C),k):r.interrupt?e(C):M(C)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(C):o?S(C):_(C))}return C===45||et(C)?(t.consume(C),a+=String.fromCharCode(C),w):n(C)}function k(C){return C===62?(t.consume(C),r.interrupt?e:M):n(C)}function S(C){return _e(C)?(t.consume(C),S):m(C)}function _(C){return C===47?(t.consume(C),m):C===58||C===95||ut(C)?(t.consume(C),R):_e(C)?(t.consume(C),_):m(C)}function R(C){return C===45||C===46||C===58||C===95||et(C)?(t.consume(C),R):P(C)}function P(C){return C===61?(t.consume(C),h):_e(C)?(t.consume(C),P):_(C)}function h(C){return C===null||C===60||C===61||C===62||C===96?n(C):C===34||C===39?(t.consume(C),l=C,I):_e(C)?(t.consume(C),h):v(C)}function I(C){return C===l?(t.consume(C),l=null,g):C===null||se(C)?n(C):(t.consume(C),I)}function v(C){return C===null||C===34||C===39||C===47||C===60||C===61||C===62||C===96||qe(C)?P(C):(t.consume(C),v)}function g(C){return C===47||C===62||_e(C)?_(C):n(C)}function m(C){return C===62?(t.consume(C),T):n(C)}function T(C){return C===null||se(C)?M(C):_e(C)?(t.consume(C),T):n(C)}function M(C){return C===45&&i===2?(t.consume(C),j):C===60&&i===1?(t.consume(C),Q):C===62&&i===4?(t.consume(C),oe):C===63&&i===3?(t.consume(C),E):C===93&&i===5?(t.consume(C),Z):se(C)&&(i===6||i===7)?(t.exit("htmlFlowData"),t.check(Qp,Me,F)(C)):C===null||se(C)?(t.exit("htmlFlowData"),F(C)):(t.consume(C),M)}function F(C){return t.check(Jp,O,Me)(C)}function O(C){return t.enter("lineEnding"),t.consume(C),t.exit("lineEnding"),U}function U(C){return C===null||se(C)?F(C):(t.enter("htmlFlowData"),M(C))}function j(C){return C===45?(t.consume(C),E):M(C)}function Q(C){return C===47?(t.consume(C),a="",re):M(C)}function re(C){if(C===62){const he=a.toLowerCase();return Eo.includes(he)?(t.consume(C),oe):M(C)}return ut(C)&&a.length<8?(t.consume(C),a+=String.fromCharCode(C),re):M(C)}function Z(C){return C===93?(t.consume(C),E):M(C)}function E(C){return C===62?(t.consume(C),oe):C===45&&i===2?(t.consume(C),E):M(C)}function oe(C){return C===null||se(C)?(t.exit("htmlFlowData"),Me(C)):(t.consume(C),oe)}function Me(C){return t.exit("htmlFlow"),e(C)}}function nh(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 rh(t,e,n){return r;function r(i){return t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),t.attempt(Zn,e,n)}}const ih={name:"htmlText",tokenize:oh};function oh(t,e,n){const r=this;let i,o,a;return s;function s(E){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(E),l}function l(E){return E===33?(t.consume(E),u):E===47?(t.consume(E),P):E===63?(t.consume(E),_):ut(E)?(t.consume(E),v):n(E)}function u(E){return E===45?(t.consume(E),c):E===91?(t.consume(E),o=0,y):ut(E)?(t.consume(E),S):n(E)}function c(E){return E===45?(t.consume(E),d):n(E)}function f(E){return E===null?n(E):E===45?(t.consume(E),p):se(E)?(a=f,Q(E)):(t.consume(E),f)}function p(E){return E===45?(t.consume(E),d):f(E)}function d(E){return E===62?j(E):E===45?p(E):f(E)}function y(E){const oe="CDATA[";return E===oe.charCodeAt(o++)?(t.consume(E),o===oe.length?x:y):n(E)}function x(E){return E===null?n(E):E===93?(t.consume(E),w):se(E)?(a=x,Q(E)):(t.consume(E),x)}function w(E){return E===93?(t.consume(E),k):x(E)}function k(E){return E===62?j(E):E===93?(t.consume(E),k):x(E)}function S(E){return E===null||E===62?j(E):se(E)?(a=S,Q(E)):(t.consume(E),S)}function _(E){return E===null?n(E):E===63?(t.consume(E),R):se(E)?(a=_,Q(E)):(t.consume(E),_)}function R(E){return E===62?j(E):_(E)}function P(E){return ut(E)?(t.consume(E),h):n(E)}function h(E){return E===45||et(E)?(t.consume(E),h):I(E)}function I(E){return se(E)?(a=I,Q(E)):_e(E)?(t.consume(E),I):j(E)}function v(E){return E===45||et(E)?(t.consume(E),v):E===47||E===62||qe(E)?g(E):n(E)}function g(E){return E===47?(t.consume(E),j):E===58||E===95||ut(E)?(t.consume(E),m):se(E)?(a=g,Q(E)):_e(E)?(t.consume(E),g):j(E)}function m(E){return E===45||E===46||E===58||E===95||et(E)?(t.consume(E),m):T(E)}function T(E){return E===61?(t.consume(E),M):se(E)?(a=T,Q(E)):_e(E)?(t.consume(E),T):g(E)}function M(E){return E===null||E===60||E===61||E===62||E===96?n(E):E===34||E===39?(t.consume(E),i=E,F):se(E)?(a=M,Q(E)):_e(E)?(t.consume(E),M):(t.consume(E),O)}function F(E){return E===i?(t.consume(E),i=void 0,U):E===null?n(E):se(E)?(a=F,Q(E)):(t.consume(E),F)}function O(E){return E===null||E===34||E===39||E===60||E===61||E===96?n(E):E===47||E===62||qe(E)?g(E):(t.consume(E),O)}function U(E){return E===47||E===62||qe(E)?g(E):n(E)}function j(E){return E===62?(t.consume(E),t.exit("htmlTextData"),t.exit("htmlText"),e):n(E)}function Q(E){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(E),t.exit("lineEnding"),re}function re(E){return _e(E)?Ce(t,Z,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(E):Z(E)}function Z(E){return t.enter("htmlTextData"),a(E)}}const xi={name:"labelEnd",resolveAll:uh,resolveTo:ch,tokenize:fh},ah={tokenize:dh},sh={tokenize:ph},lh={tokenize:hh};function uh(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"),_e(u)?Ce(t,s,"whitespace")(u):s(u))}}const Ge={continuation:{tokenize:_h},exit:Mh,name:"list",tokenize:Th},wh={partial:!0,tokenize:Ah},kh={partial:!0,tokenize:Eh};function Th(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(On,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(wh,p,f))}function c(d){return r.containerState.initialBlankLine=!0,o++,p(d)}function f(d){return _e(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 _h(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||!_e(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(kh,e,a)(s))}function a(s){return r.containerState._closeFlow=!0,r.interrupt=void 0,Ce(t,t.attempt(Ge,e,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s)}}function Eh(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 Mh(t){t.exit(this.containerState.type)}function Ah(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!_e(o)&&a&&a[1].type==="listItemPrefixWhitespace"?e(o):n(o)}}const Mo={name:"setextUnderline",resolveTo:Sh,tokenize:Ih};function Sh(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 Ih(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"),_e(u)?Ce(t,l,"lineSuffix")(u):l(u))}function l(u){return u===null||se(u)?(t.exit("setextHeadingLine"),e(u)):n(u)}}const Rh={tokenize:Ch};function Ch(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(Op,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 Nh={resolveAll:is()},Lh=rs("string"),Ph=rs("text");function rs(t){return{resolveAll:is(t==="text"?Dh: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 qh(t,e){let n=-1;const r=[];let i;for(;++n0){const Ve=ne.tokenStack[ne.tokenStack.length-1];(Ve[1]||Ro).call(ne,void 0,Ve[0])}for(q.position={start:Tt(z.length>0?z[0][1].start:{line:1,column:1,offset:0}),end:Tt(z.length>0?z[z.length-2][1].end:{line:1,column:1,offset:0})},xe=-1;++xe1?"-"+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 fm(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 dm(t,e){if(t.options.allowDangerousHtml){const n={type:"raw",value:e.value};return t.patch(e,n),t.applyData(e,n)}}function ss(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 pm(t,e){const n=String(e.identifier).toUpperCase(),r=t.definitionById.get(n);if(!r)return ss(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 hm(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 mm(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 gm(t,e){const n=String(e.identifier).toUpperCase(),r=t.definitionById.get(n);if(!r)return ss(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 ym(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 xm(t,e,n){const r=t.all(e),i=n?vm(n):ls(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 bm(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 _m(t){const e=cs(t),n=us(t);if(e&&n)return{start:e,end:n}}function Em(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=cs(e.children[1]),l=us(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 Mm(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(Lo(e.slice(i),i>0,!1)),o.join("")}function Lo(t,e,n){let r=0,i=t.length;if(e){let o=t.codePointAt(r);for(;o===Co||o===No;)r++,o=t.codePointAt(r)}if(n){let o=t.codePointAt(i-1);for(;o===Co||o===No;)i--,o=t.codePointAt(i-1)}return i>r?t.slice(r,i):""}function Im(t,e){const n={type:"text",value:Sm(String(e.value))};return t.patch(e,n),t.applyData(e,n)}function Rm(t,e){const n={type:"element",tagName:"hr",properties:{},children:[]};return t.patch(e,n),t.applyData(e,n)}const Cm={blockquote:om,break:am,code:sm,delete:lm,emphasis:um,footnoteReference:cm,heading:fm,html:dm,imageReference:pm,image:hm,inlineCode:mm,linkReference:gm,link:ym,listItem:xm,list:bm,paragraph:wm,root:km,strong:Tm,table:Em,tableCell:Am,tableRow:Mm,text:Im,thematicBreak:Rm,toml:Cn,yaml:Cn,definition:Cn,footnoteDefinition:Cn};function Cn(){}const ds=-1,Qn=0,Hn=1,$n=2,vi=3,bi=4,wi=5,ki=6,ps=7,hs=8,Po=typeof self=="object"?self:globalThis,Nm=(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 ds:return n(a,i);case Hn:{const s=n([],i);for(const l of a)s.push(r(l));return s}case $n:{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 ps:{const{name:s,message:l}=a;return n(new Po[s](l),i)}case hs:return n(BigInt(a),i);case"BigInt":return n(Object(BigInt(a)),i)}return n(new Po[o](a),i)};return r},Do=t=>Nm(new Map,t)(0),jt="",{toString:Lm}={},{keys:Pm}=Object,ln=t=>{const e=typeof t;if(e!=="object"||!t)return[Qn,e];const n=Lm.call(t).slice(8,-1);switch(n){case"Array":return[Hn,jt];case"Object":return[$n,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")?[Hn,n]:n.includes("Error")?[ps,n]:[$n,n]},Nn=([t,e])=>t===Qn&&(e==="function"||e==="symbol"),Dm=(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=hs,c=a.toString();break;case"function":case"symbol":if(t)throw new TypeError("unable to serialize "+l);c=null;break;case"undefined":return i([ds],a)}return i([s,c],a)}case Hn:{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 $n:{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 Pm(a))(t||!Nn(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||!(Nn(ln(p))||Nn(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||!Nn(ln(p)))&&c.push(o(p));return f}}const{message:u}=a;return i([s,{name:l,message:u}],a)};return o},Oo=(t,{json:e,lossy:n}={})=>{const r=[];return Dm(!(e||n),!!e,new Map,r)(t),r},Gn=typeof structuredClone=="function"?(t,e)=>e&&("json"in e||"lossy"in e)?Do(Oo(t,e)):structuredClone(t):(t,e)=>Do(Oo(t,e));function Om(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 Fm(t,e){return"Back to reference "+(t+1)+(e>1?"-"+e:"")}function Bm(t){const e=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",n=t.options.footnoteBackContent||Om,r=t.options.footnoteBackLabel||Fm,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 S=typeof n=="string"?n:n(l,d);typeof S=="string"&&(S={type:"text",value:S}),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(S)?S:[S]})}const w=c[c.length-1];if(w&&w.type==="element"&&w.tagName==="p"){const S=w.children[w.children.length-1];S&&S.type==="text"?S.value+=" ":w.children.push({type:"text",value:" "}),w.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:` -`},{type:"element",tagName:"ol",properties:{},children:t.wrap(s,!0)},{type:"text",value:` -`}]}}const ms=function(t){if(t==null)return Vm;if(typeof t=="function")return Jn(t);if(typeof t=="object")return Array.isArray(t)?zm(t):Um(t);if(typeof t=="string")return jm(t);throw new Error("Expected function, string, or object as test")};function zm(t){const e=[];let n=-1;for(;++n":""))+")"})}return p;function p(){let d=gs,y,x,w;if((!e||o(l,u,c[c.length-1]||void 0))&&(d=Km(n(l,c)),d[0]===Fo))return d;if("children"in l&&l.children){const k=l;if(k.children&&d[0]!==Gm)for(x=(r?k.children.length:-1)+a,w=c.concat(k);x>-1&&x0&&n.push({type:"text",value:` -`}),n}function Bo(t){let e=0,n=t.charCodeAt(e);for(;n===9||n===32;)e++,n=t.charCodeAt(e);return t.slice(e)}function zo(t,e){const n=Xm(t,e),r=n.one(t,void 0),i=Bm(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&o.children.push({type:"text",value:` -`},i),o}function tg(t,e){return t&&"run"in t?async function(n,r){const i=zo(n,{file:r,...e});await t.run(i,r)}:function(n,r){return zo(n,{file:r,...t||e})}}function Uo(t){if(t)throw t}var Tr,jo;function ng(){if(jo)return Tr;jo=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],w=1,k=arguments.length,S=!1;for(typeof x=="boolean"&&(S=x,x=arguments[1]||{},w=2),(x==null||typeof x!="object"&&typeof x!="function")&&(x={});wa.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 st={basename:ag,dirname:sg,extname:lg,join:ug,sep:"/"};function ag(t,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');kn(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 sg(t){if(kn(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 lg(t){kn(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 ug(...t){let e=-1,n;for(;++e0&&t.codePointAt(t.length-1)===47&&(n+="/"),e?"/"+n:n}function fg(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 kn(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}const dg={cwd:pg};function pg(){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 hg(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 mg(t)}function mg(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 bg=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 Ho(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 Ln(t){return wg(t)?t:new gg(t)}function wg(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function kg(t){return typeof t=="string"||Tg(t)}function Tg(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}function _i(){const t=bg().use(im).use(tg).use(Qd);return{process:e=>t.processSync(e).toString()}}const _g={relative:""},Eg={"h-full":"","w-full":""},Mg={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"},Ag={bg:"primary-50","rounded-xl":"","px-10":"","py-6":""},Sg=["innerHTML"],Ig=Fe({__name:"Stage",props:{paused:{type:Boolean,default:!1}},setup(t){const e=W(),n=W(),{stageView:r}=Ke(Wt()),{mouthOpenSize:i}=Ke(Kl()),{audioContext:o,calculateVolume:a}=da(),{onBeforeMessageComposed:s,onBeforeSend:l,onTokenLiteral:u,onTokenSpecial:c,onStreamEnd:f,streamingMessage:p,onAssistantResponseEnd:d}=St(),{process:y}=_i(),x=li(),w=W(),k=W(!1),S=W(!1),_=or({handlers:[E=>new Promise(oe=>{const Me=o.createBufferSource();Me.buffer=E.data.audioBuffer,Me.connect(o.destination),Me.connect(w.value),k.value=!0,Me.start(0),Me.onended=()=>{k.value=!1,oe()}})]}),R=Cl(),{ssmlEnabled:P,activeSpeechProvider:h,activeSpeechModel:I,activeSpeechVoice:v,pitch:g}=Ke(R);async function m(E){try{if(!h.value){console.warn("No active speech provider configured");return}if(!v.value){console.warn("No active speech voice configured");return}const oe=x.getProviderInstance(h.value);if(!oe){console.error("Failed to initialize speech provider");return}const Me=x.getProviderConfig(h.value),C=P.value?R.generateSSML(E.data,v.value,{...Me,pitch:g.value}):E.data,he=await Nl({...oe.speech(I.value,Me),input:C,voice:v.value.id}),we=await o.decodeAudioData(he);await _.add({audioBuffer:we,text:E.data})}catch(oe){console.error("Speech generation failed:",oe)}}const T=or({handlers:[m]});T.on("add",E=>{console.debug("ttsQueue added",E)});const M=Ll(T),{live2dCurrentMotion:F}=Ke(Wt()),O=or({handlers:[async E=>{if(r.value==="3d"){const oe=Sl[E.data];if(!oe)return;await n.value.setExpression(oe)}else r.value==="2d"&&(F.value={group:Il[E.data]})}]}),U=Pl(O);U.onHandlerEvent("emotion",E=>{console.debug("emotion detected",E)});const j=Dl();j.onHandlerEvent("delay",E=>{console.debug("delay detected",E)});function Q(){requestAnimationFrame(Q),k.value&&(i.value=a(w.value,"linear"))}function re(){S.value||(Q(),o.resume(),S.value=!0)}function Z(){w.value||(w.value=o.createAnalyser())}return s(async()=>{Z(),re()}),l(async()=>{F.value={group:Al}}),u(async E=>{await M.add(E)}),c(async E=>{await j.add(E),await U.add(E)}),f(async()=>{await j.add(Ol)}),d(async E=>{}),Ot(()=>{S.value=!1}),mn(async()=>{e.value=xs({connection:{bundles:Rl()}}),await e.value.execute("CREATE TABLE memory_test (vec FLOAT[768]);")}),(E,oe)=>(J(),ie("div",_g,[D("div",Eg,[H(r)==="2d"?(J(),Xt(ru,{key:0,"mouth-open-size":H(i),"min-w":"50% (J(),ie("header",Dg,[D("div",Og,[Te(Vl)]),Te(H(hl),{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:Ye(()=>n[0]||(n[0]=[D("div",{"i-solar:settings-minimalistic-bold-duotone":""},null,-1)])),_:1,__:[0]})]))}});function ys(t,e){const n=sa(e??{},{...Pi.getDefaultRealTimeVADOptions("v5"),preSpeechPadFrames:30,positiveSpeechThreshold:.5,negativeSpeechThreshold:.35,minSpeechFrames:30,auto:!0}),r=W(),i=ml("microphone");async function o(){if(r.value&&(r.value.destroy(),r.value=void 0,console.warn("existing MicVAD destroyed")),!i.value)return;const a=H(t);if(!a)return;const s=await navigator.mediaDevices.getUserMedia({audio:{deviceId:a}});r.value=await Pi.MicVAD.new({...n,stream:s}),n.auto&&r.value.start()}return Be(i,o,{immediate:!0}),Be(gl(t),o,{immediate:!0}),yl(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 Bg(t,e){const n=sa(e,{onLoading:()=>{},onInitiate:()=>{},onProgress:()=>{},onDone:()=>{},onReady:()=>{},onStart:()=>{},onUpdate:()=>{},onComplete:()=>{}}),{post:r,data:i,terminate:o}=xl(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,w,k,S,_,R;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),(w=n.onDone)==null||w.call(n,p);break;case"ready":a.value="ready",(k=n.onReady)==null||k.call(n);break;case"start":u.value=!0,(S=n.onStart)==null||S.call(n);break;case"update":c.value=p.tps,(_=n.onUpdate)==null||_.call(n,p.tps);break;case"complete":u.value=!1,f.value=p.output[0]||"",console.debug("Whisper result:",f.value),(R=n.onComplete)==null||R.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 zg="/assets/worker-BA42UcYE.js";async function Ug(t,e){const n=new ArrayBuffer(44+t.length*2),r=new DataView(n);Pn(r,0,"RIFF"),r.setUint32(4,36+t.length*2,!0),Pn(r,8,"WAVE"),Pn(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),Pn(r,36,"data"),r.setUint32(40,t.length*2,!0),jg(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 Pn(t,e,n){for(let r=0;r{Vn().then(()=>{i.update(),o.value=i.height.value})}),u(async()=>{Vn().then(()=>{i.update(),o.value=i.height.value})}),(c,f)=>{const p=ua("auto-animate");return J(),ie("div",Vg,[f[2]||(f[2]=D("div",{"flex-1":""},null,-1)),Et((J(),ie("div",{ref_key:"chatHistoryRef",ref:e,"h-full":"","w-full":"",flex:"~ col","overflow-scroll":""},[f[1]||(f[1]=D("div",{"flex-1":""},null,-1)),(J(!0),ie(ai,null,si(H(n),(d,y)=>(J(),ie("div",{key:y,"mb-2":""},[d.role==="error"?(J(),ie("div",Hg,[D("div",$g,[D("div",Gg,[D("div",Yg,[D("span",Kg,ve(H(a)("stage.chat.message.character-name.core-system")),1)]),f[0]||(f[0]=D("div",{"i-solar:danger-triangle-bold-duotone":"","text-violet-500":""},null,-1))]),H(r)&&y===H(n).length-1?(J(),ie("div",qg)):(J(),ie("div",{key:1,class:"markdown-content break-words text-violet-500",text:"base {if(!T||!T.trim())return;const M=a.getProviderConfig(s.value);await x(T,{chatProvider:a.getProviderInstance(s.value),model:l.value,providerConfig:M})}});async function h(){if(!(!e.value.trim()||o.value))try{const T=a.getProviderConfig(s.value);await x(e.value,{chatProvider:a.getProviderInstance(s.value),model:l.value,providerConfig:T})}catch(T){k.value.pop(),k.value.push({role:"error",content:T.message})}}const{destroy:I,start:v}=ys(y,{onSpeechStart:()=>{n.value=!0},onVADMisfire:()=>{n.value=!1},onSpeechEnd:T=>{n.value=!1,g(T)},auto:!1});async function g(T){await S.resume();const M=await Ug(T,S.sampleRate);R({type:"generate",data:{audio:M,language:"en"}})}async function m(T){const M=T.target,F=c.value.find(O=>O.deviceId===M.value);if(!F){p.value=void 0;return}p.value=F}return Be(d,async T=>{T==="false"&&(I(),P())}),Be(i,async T=>{T&&await f()}),mn(()=>{v()}),w(async()=>{e.value=""}),(T,M)=>(J(),ie("div",sy,[D("fieldset",ly,[D("label",{class:lt([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 ":H(u)}]),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(D("input",{"onUpdate:modelValue":M[0]||(M[0]=F=>r.value=F),type:"radio",name:"tab",value:"chat",hidden:""},null,512),[[ir,r.value]]),M[7]||(M[7]=D("div",{"i-solar:dialog-2-bold-duotone":"",text:"2xl",transform:"translate-y--2"},null,-1)),D("div",cy,[D("span",fy,ve(H(_)("stage.chat.tabs.chat")),1)])],10,uy),D("label",{class:lt([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 ":H(u)}]),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(D("input",{"onUpdate:modelValue":M[1]||(M[1]=F=>r.value=F),type:"radio",name:"tab",value:"custom",hidden:""},null,512),[[ir,r.value]]),M[8]||(M[8]=D("div",{"i-solar:star-fall-2-bold-duotone":"",text:"2xl",transform:"translate-y--2"},null,-1)),D("div",py,[D("span",null,ve(H(_)("stage.chat.tabs.custom")),1)])],10,dy),D("label",{class:lt([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 ":H(u)}]),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(D("input",{"onUpdate:modelValue":M[2]||(M[2]=F=>r.value=F),type:"radio",name:"tab",value:"clothes",hidden:""},null,512),[[ir,r.value]]),M[9]||(M[9]=D("div",{"i-solar:magic-stick-3-bold-duotone":"",text:"2xl",transform:"translate-y--2"},null,-1)),D("div",my,[D("span",null,ve(H(_)("stage.chat.tabs.clothes")),1)])],10,hy)]),D("div",gy,[D("div",yy,[Te(ay,{"h-full":"","flex-1":"","p-4":"",w:"full","max-h":"e.value=F),placeholder:H(_)("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:lt({"transition-colors-none placeholder:transition-colors-none":H(u)}),onSubmit:h,onCompositionstart:M[4]||(M[4]=F=>o.value=!0),onCompositionend:M[5]||(M[5]=F=>o.value=!1)},null,8,["modelValue","placeholder","class"])])])]),D("div",vy,[D("div",by,[Te(H(ui),null,{default:Ye(()=>[i.value?(J(),ie("fieldset",wy,[(J(!0),ie(ai,null,si(H(c),(F,O)=>(J(),ie("label",{key:O,class:"[&_div_span]:dark:hover:bg-cyan-300 [&_div_span]:dark:hover:bg-cyan-900"},[D("input",{type:"radio",name:"audioInput",value:F.deviceId,hidden:"",onChange:m},null,40,ky),D("div",Ty,[D("div",_y,[F.deviceId===H(y)?(J(),ie("div",Ey)):at("",!0)]),D("span",{"inline-block":"",class:lt([F.deviceId===H(y)?"cyan-400 dark:text-white":"cyan-400/50 dark:text-white/50"]),transition:"all duration-250 ease-in-out"},ve(F.label),3)])]))),128))])):at("",!0)]),_:1}),D("label",{bg:"complementary-100 hover:complementary-200 dark:complementary-800 dark:hover:complementary-700",transition:"all duration-250 ease-in-out",class:lt({"transition-colors-none":H(u)}),text:"complementary-400","h-fit":"",flex:"","cursor-pointer":"","items-center":"","justify-center":"","gap-2":"","rounded-full":"","px-4":"","py-2":""},[Et(D("input",{"onUpdate:modelValue":M[6]||(M[6]=F=>i.value=F),type:"checkbox",hidden:""},null,512),[[Qr,i.value]]),M[10]||(M[10]=D("div",{"i-solar:microphone-2-bold-duotone":""},null,-1)),D("div",null,[n.value?(J(),ie("span",Ay,"Listening...")):(J(),ie("span",My,ve(H(_)("settings.microphone")),1))])],2)])])]))}}),Iy=xn(Sy,[["__scopeId","data-v-5b585ca8"]]),Ry={py:"1",flex:"~ col",rounded:"lg","overflow-hidden":""},Cy={key:0,flex:"",mr:"12"},Ny={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":"","backdrop-blur-sm":"",h:"unset {Vn().then(()=>{i.update(),o.value=i.height.value})}),l(async()=>{Vn().then(()=>{i.update(),o.value=i.height.value})}),(u,c)=>{const f=ua("auto-animate");return J(),ie("div",Ry,[c[1]||(c[1]=D("div",{"flex-1":""},null,-1)),Et((J(),ie("div",{ref_key:"chatHistoryRef",ref:e,"h-full":"","w-full":"","max-h":"30vh",flex:"~ col","overflow-scroll":"",class:"chat-history"},[c[0]||(c[0]=D("div",{"flex-1":""},null,-1)),(J(!0),ie(ai,null,si(H(r),(p,d)=>(J(),ie("div",{key:d,"mb-2":""},[p.role==="assistant"?(J(),ie("div",Cy,[D("div",Ny,[D("div",null,[D("span",Ly,ve(H(n)("stage.chat.message.character-name.airi")),1)]),p.content?(J(),ie("div",{key:0,class:"markdown-content",text:"base {n.value=!0},onVADMisfire:()=>{n.value=!1},onSpeechEnd:k=>{n.value=!1,w()},auto:!1});function w(k){alert("Transcription is not implemented yet")}return Be(s,async k=>{k==="false"&&y()}),f(async()=>{e.value=""}),mn(()=>{x()}),(k,S)=>(J(),ie("div",null,[D("div",Hy,[Te(Vy,{absolute:"","left-0":"","top-0":"",transform:"translate-y-[-100%]","w-full":""}),D("div",$y,[Te(H(fa),{modelValue:e.value,"onUpdate:modelValue":S[0]||(S[0]=_=>e.value=_),placeholder:H(p)("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:lt({"transition-colors-none placeholder:transition-colors-none":H(u)}),onSubmit:d,onCompositionstart:S[1]||(S[1]=_=>r.value=!0),onCompositionend:S[2]||(S[2]=_=>r.value=!1)},null,8,["modelValue","placeholder","class"])])])]))}}),Yy={class:"relative"},Ky={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 w=[],S=Math.ceil(f/y)*y,_=1,R=x==="up"?d:p-d;w.push(`M 0 ${R}`);const P=Math.PI*2/y;for(let I=0;I<=S;I+=_){const v=d*Math.sin(P*I),g=x==="up"?R-v:R+v;w.push(`L ${I} ${g}`)}const h=x==="up"?p:0;return w.push(`L ${S} ${h}`),w.push(`L 0 ${h} Z`),w.join(" ")}const u=Ue(()=>n.value+r.value*2),c=Ue(()=>{const f=` - - `;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)=>(J(),ie("div",Yy,[gn(f.$slots,"default",{},void 0,!0),D("div",Ky,[D("div",{class:"wave",style:Lr({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)])]))}}),Wy=xn(qy,[["__scopeId","data-v-d4cf94d8"]]),Xy={relative:"",flex:"~ col","z-2":"","h-100dvh":"","w-100vw":"","of-hidden":""},Zy={relative:"",flex:"~ 1 row gap-y-0 gap-x-2 (J(),Xt(Pg,null,{default:Ye(()=>[Te(Wy,{"fill-color":H(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:Ye(()=>[D("div",Xy,[D("div",null,[Te(Fg,{class:"flex",p2:""})]),D("div",Zy,[Te(H(Rg),{"flex-1":"","min-w":"1/2",paused:n.value},null,8,["paused"]),Te(Iy,{class:"flex (s(),f("button",{disabled:t(m).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]=p=>r.$emit("click"))},[q(r.$slots,"default")],8,ue))}}),me={flex:"~ col gap-4"},fe={flex:"","items-center":"","gap-2":""},pe=["disabled","placeholder"],ve={"font-medium":""},_e={flex:"","gap-2":""},ge=["onUpdate:modelValue"],be=["href","download"],he=E({__name:"Live2DSettings",props:{palette:null},emits:["extractColorsFromModel"],setup(j){const{t:m}=G(),r=H({accept:"application/zip"}),n=D(),{live2dModelFile:p,live2dMotionMap:v,live2dLoadSource:y,loadingLive2dModel:M,availableLive2dMotions:L,live2dModelUrl:k}=K(n),_=F(k.value);r.onChange(o=>{o&&o.length>0&&(v.value={},p.value=o[0],y.value="file",M.value=!0)}),Q(()=>n.loadingLive2dModel,o=>{o||y.value==="file"&&L.value.forEach(e=>{e.motionName in V?v.value[e.fileName]=e.motionName:v.value[e.fileName]=se})});async function g(o,e){if(!Object.keys(e).length)return o;const i=await new P().loadAsync(o),d=Object.keys(i.files).find(N=>N.endsWith("model3.json"));if(!d)throw new Error("model3.json not found");const J=await i.file(d).async("string"),I=JSON.parse(J),C={};Object.entries(e).forEach(([N,S])=>{if(C[S]){C[S].push({File:N});return}C[S]=[{File:N}]}),I.FileReferences.Motions=C,i.file(d,JSON.stringify(I,null,2));const Z=await i.generateAsync({type:"blob"});return new File([Z],o.name,{type:o.type,lastModified:o.lastModified})}async function w(){const o=await T.getItem("live2dModel");if(!o)return;const e=await g(o,v.value);p.value=e,y.value="file",M.value=!0}const x=X(p);return(o,e)=>(s(),f("div",me,[l(t(z),{title:"settings.live2d.change-model.title",icon:"i-solar:magic-stick-3-bold-duotone","inner-class":"text-sm"},{default:c(()=>[u("div",fe,[O(u("input",{"onUpdate:modelValue":e[0]||(e[0]=a=>_.value=a),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(m)("settings.live2d.change-model.from-url-placeholder")},null,8,pe),[[te,_.value]]),l(h,{class:"form-control",onClick:e[1]||(e[1]=a=>k.value=_.value)},{default:c(()=>[b($(t(m)("settings.live2d.change-model.from-url")),1)]),_:1})]),l(h,{class:"form-control place-self-end",onClick:e[2]||(e[2]=a=>t(r).open())},{default:c(()=>[b($(t(m)("settings.live2d.change-model.from-file"))+"... ",1)]),_:1}),l(h,{class:"form-control",onClick:e[3]||(e[3]=a=>o.$emit("extractColorsFromModel"))},{default:c(()=>e[4]||(e[4]=[b(" Extract colors from model ")])),_:1,__:[4]}),l(de,{colors:j.palette.map(a=>({hex:a,name:a}))},null,8,["colors"])]),_:1}),t(n).live2dLoadSource==="file"?(s(),A(t(z),{key:0,title:"settings.live2d.edit-motion-map.title",icon:"i-solar:face-scan-circle-bold-duotone"},{default:c(()=>{var a;return[(s(!0),f(U,null,R(t(n).availableLive2dMotions,i=>(s(),f("div",{key:i.fileName,flex:"","items-center":"","justify-between":"","text-sm":""},[u("span",ve,$(i.fileName),1),u("div",_e,[O(u("select",{"onUpdate:modelValue":d=>t(n).live2dMotionMap[i.fileName]=d},[(s(!0),f(U,null,R(Object.keys(t(V)),d=>(s(),f("option",{key:d},$(d),1))),128))],8,ge),[[oe,t(n).live2dMotionMap[i.fileName]]]),l(h,{class:"form-control",onClick:d=>t(n).live2dCurrentMotion={group:i.motionName,index:i.motionIndex}},{default:c(()=>e[5]||(e[5]=[b(" Play ")])),_:2,__:[5]},1032,["onClick"])])]))),128)),l(h,{onClick:w},{default:c(()=>e[6]||(e[6]=[b(" Save and patch ")])),_:1,__:[6]}),u("a",{"mt-2":"",block:"",href:t(x),download:`${((a=t(n).live2dModelFile)==null?void 0:a.name)||"live2d"}-motion-edited.zip`},[l(h,{"w-full":""},{default:c(()=>e[7]||(e[7]=[b("Export")])),_:1,__:[7]})],8,be)]}),_:1})):ee("",!0)]))}}),ye=ne(he,[["__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":""},ke=E({__name:"index",setup(j){const m=F(),r=F(),{width:n,height:p}=ae(m),v=F([]);async function y(){if(!r.value)return;const _=await r.value.captureFrame();if(!_){console.error("No frame captured");return}const g=URL.createObjectURL(_);try{const x=await new re(g).getPalette();v.value=Object.values(x).map(o=>o==null?void 0:o.hex).filter(o=>typeof o=="string")}finally{URL.revokeObjectURL(g)}}const{iconAnimationStarted:M,showIconAnimation:L,animationIcon:k}=ce("i-solar:people-nearby-bold-duotone");return(_,g)=>{const w=ie("IconAnimation"),x=le("motion");return s(),f(U,null,[u("div",xe,[u("div",{ref_key:"live2dContainerRef",ref:m,w:"50%",h:"80vh"},[l(t(Y),{ref_key:"live2dCanvasRef",ref:r,width:t(n),height:t(p)},{default:c(({app:o})=>[l(t(W),{app:o,"mouth-open-size":0,width:t(n),height:t(p),paused:!1},null,8,["app","width","height"])]),_:1},8,["width","height"])],512),l(ye,{w:"50%",h:"80vh",palette:v.value,onExtractColorsFromModel:y},null,8,["palette"])]),t(L)?(s(),A(w,{key:0,"z-index":-1,icon:t(k),"icon-size":12,duration:1e3,started:t(M),"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"])):O((s(),f("div",Me,g[0]||(g[0]=[u("div",{text:"60","i-solar:people-nearby-bold-duotone":""},null,-1)]))),[[x]])],64)}}});typeof B=="function"&&B(ke);export{ke as default}; diff --git a/assets/index-CqXdqLaZ.js b/assets/index-CqXdqLaZ.js new file mode 100644 index 0000000000000000000000000000000000000000..4e565985d8da88e52bbf6e38affbbbe2b46615e5 --- /dev/null +++ b/assets/index-CqXdqLaZ.js @@ -0,0 +1,532 @@ +import{d as vs}from"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-Du5e5QRV.js";import{a4 as Kn,e as W,f as Ue,a5 as bs,a6 as Yo,a7 as ws,w as Be,a8 as ks,a9 as Ts,U as Ot,u as H,aa as _s,ab as Cr,ac as Ko,ad as Es,ae as cn,af as qo,ag as ft,ah as Pe,ai as ze,aj as xt,ak as pn,al as Ms,am as As,an as Ss,ao as vt,ap as ae,aq as Is,ar as Bn,as as Rs,at as Zr,au as Cs,av as Ns,aw as Nt,ax as Wo,ay as Qr,az as Xo,aA as Zo,aB as Qo,aC as zn,aD as Lt,aE as Un,aF as Jo,aG as Vt,aH as Ls,aI as tr,aJ as Ps,aK as ea,aL as qn,aM as Ht,aN as hn,aO as ta,aP as Ds,aQ as Pt,aR as Os,aS as Fs,aT as Bs,aU as zs,aV as nr,aW as Mt,aX as Dt,aY as $t,aZ as Us,a_ as js,a$ as Vs,b0 as na,b1 as Jr,b2 as ei,b3 as jn,b4 as Mi,b5 as Ai,b6 as Si,b7 as Ii,b8 as Hs,b9 as $s,ba as ti,bb as ra,bc as Gs,a0 as Ke,bd as Ri,d as Fe,be as Ys,bf as Ks,bg as ni,T as mn,c as ie,o as J,bh as gn,bi as qs,$ as Zt,bj as Wt,bk as Xt,bl as Ye,b as Te,a as O,X as lt,bm as Et,bn as ri,W as at,Y as ve,bo as yt,bp as _t,bq as ii,br as Wn,bs as ia,bt as Vn,bu as Ws,bv as Ci,bw as Xs,bx as oa,by as yn,bz as Zs,bA as oi,bB as Qs,bC as aa,bD as At,bE as Js,bF as sa,bG as el,bH as tl,bI as nl,bJ as rl,bK as la,bL as il,bM as ol,bN as al,bO as sl,bP as ll,bQ as ul,bR as cl,bS as rr,bT as Nr,bU as Lr,bV as Ni,bW as ir,bX as fl,bY as dl,bZ as pl,b_ as hl,b$ as ml,a3 as Pr,c0 as gl,c1 as yl,c2 as xn,c3 as xl,c4 as ua,_ as Hn,c5 as ca,c6 as ai,c7 as si,c8 as vl,c9 as or,ca as bl}from"./index-B06xwjXa.js";import{d as Li,V as wl,a as kl,c as Tl,r as _l,b as Dr,e as El}from"./three-vrm.module-CtuEk7GG.js";import{E as Ml,a as Al,b as Sl}from"./emotions-DWNSb738.js";import{m as Il,d as Rl}from"./mcp-BfXpaYZf.js";import"./Select.vue_vue_type_style_index_0_lang-CzS20kE7.js";import{getImportUrlBundles as Cl}from"./import-url-browser-CPN8ipMD.js";import{s as Gt,c as Pi,u as Nl,g as Ll}from"./speech-CLjA-Bq8.js";import{u as Dn}from"./queue-BXXXc1r6.js";import{u as Pl,a as Dl,b as Ol,l as Fl}from"./queues-DTl9VJAZ.js";import{l as Bl,u as li}from"./providers-BCv4E6z9.js";import{s as zl}from"./index-YUUT4m-_.js";import{u as Ul}from"./airi-card-BqOg7f9m.js";import{_ as ui}from"./TransitionVertical.vue_vue_type_script_setup_true_lang-CyZTJR0c.js";import{r as on,_ as jl,a as Vl}from"./Model.vue_vue_type_script_setup_true_lang-CUcE9b2l.js";import{_ as Di}from"./Collapsable.vue_vue_type_script_setup_true_lang-BxFBRVXD.js";import{H as Hl}from"./HeaderLink-OTe6TGtK.js";import{u as fa}from"./consciousness-D-_ZstxC.js";import{_ as da}from"./Basic.vue_vue_type_script_setup_true_lang-Q6h2vVkt.js";import{b as Oi}from"./route-block-B_A1xBdJ.js";import"./floating-ui.core-CgBsuaUc.js";import"./duckdb-mvp-CaaD-olE.js";import"./index-LHmcipjy.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 Gl(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 Yl(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 Gl(t);case"minmax":return Yl(t)}}const pa=Kn("AudioContext",()=>({audioContext:new AudioContext,calculateVolume:Kl})),ql=Kn("SpeakingStore",()=>{const n=W(0),r=W(!1),i=Ue(()=>r.value?(30+70*n.value)/100:30);return{mouthOpenSize:n,nowSpeaking:r,nowSpeakingAvatarBorderOpacity:i}});function En(t,e,n){return e+n<0||e+n>=t.length-1?"":t[e+n]}function Wl(t){let e="literal",n="";return{async consume(r){var i,o,a;for(let s=0;s"?(l+=En(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 Xl=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];class vn{constructor(e,n,r){this.normal=n,this.property=e,r&&(this.space=r)}}vn.prototype.normal={};vn.prototype.property={};vn.prototype.space=void 0;function ha(t,e){const n={},r={};for(const i of t)Object.assign(n,i.property),Object.assign(r,i.normal);return new vn(n,r,e)}function Or(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 Zl=0;const ce=Ft(),Le=Ft(),ma=Ft(),G=Ft(),Re=Ft(),Yt=Ft(),Qe=Ft();function Ft(){return 2**++Zl}const Fr=Object.freeze(Object.defineProperty({__proto__:null,boolean:ce,booleanish:Le,commaOrSpaceSeparated:Qe,commaSeparated:Yt,number:G,overloadedBoolean:ma,spaceSeparated:Re},Symbol.toStringTag,{value:"Module"})),ar=Object.keys(Fr);class ci extends We{constructor(e,n,r,i){let o=-1;if(super(e,n),Fi(this,"space",i),typeof r=="number")for(;++o4&&n.slice(0,4)==="data"&&tu.test(e)){if(e.charAt(4)==="-"){const o=e.slice(5).replace(Bi,iu);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=e.slice(4);if(!Bi.test(o)){let a=o.replace(eu,ru);a.charAt(0)!=="-"&&(a="-"+a),e="data"+a}}i=ci}return new i(r,e)}function ru(t){return"-"+t.toLowerCase()}function iu(t){return t.charAt(1).toUpperCase()}const ou=ha([ga,Ql,va,ba,wa],"html"),ka=ha([ga,Jl,va,ba,wa],"svg"),zi={}.hasOwnProperty;function au(t,e){const n=e||{};function r(i,...o){let a=r.invalid;const s=r.handlers;if(i&&zi.call(i,t)){const l=String(i[t]);a=zi.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 su=/^>|^->||--!>|"],uu=["<",">"];function cu(t,e,n,r){return r.settings.bogusComments?"":"";function i(o){return Gt(o,Object.assign({},r.settings.characterReferences,{subset:uu}))}}function fu(t,e,n,r){return""}function du(t,e){const n=e||{};return(t[t.length-1]===""?[...t,""]:t).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}function pu(t){return t.join(" ").trim()}const hu=/[ \t\n\f\r]/g;function fi(t){return typeof t=="object"?t.type==="text"?Ui(t.value):!1:Ui(t)}function Ui(t){return t.replace(hu,"")===""}const De=_a(1),Ta=_a(-1),mu=[];function _a(t){return e;function e(n,r,i){const o=n?n.children:mu;let a=(r||0)+t,s=o[a];if(!i)for(;s&&fi(s);)a+=t,s=o[a];return s}}const gu={}.hasOwnProperty;function Ea(t){return e;function e(n,r,i){return gu.call(t,n.tagName)&&t[n.tagName](n,r,i)}}const di=Ea({body:xu,caption:sr,colgroup:sr,dd:ku,dt:wu,head:sr,html:yu,li:bu,optgroup:Tu,option:_u,p:vu,rp:ji,rt:ji,tbody:Mu,td:Vi,tfoot:Au,th:Vi,thead:Eu,tr:Su});function sr(t,e,n){const r=De(n,e,!0);return!r||r.type!=="comment"&&!(r.type==="text"&&fi(r.value.charAt(0)))}function yu(t,e,n){const r=De(n,e);return!r||r.type!=="comment"}function xu(t,e,n){const r=De(n,e);return!r||r.type!=="comment"}function vu(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 bu(t,e,n){const r=De(n,e);return!r||r.type==="element"&&r.tagName==="li"}function wu(t,e,n){const r=De(n,e);return!!(r&&r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd"))}function ku(t,e,n){const r=De(n,e);return!r||r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd")}function ji(t,e,n){const r=De(n,e);return!r||r.type==="element"&&(r.tagName==="rp"||r.tagName==="rt")}function Tu(t,e,n){const r=De(n,e);return!r||r.type==="element"&&r.tagName==="optgroup"}function _u(t,e,n){const r=De(n,e);return!r||r.type==="element"&&(r.tagName==="option"||r.tagName==="optgroup")}function Eu(t,e,n){const r=De(n,e);return!!(r&&r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot"))}function Mu(t,e,n){const r=De(n,e);return!r||r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot")}function Au(t,e,n){return!De(n,e)}function Su(t,e,n){const r=De(n,e);return!r||r.type==="element"&&r.tagName==="tr"}function Vi(t,e,n){const r=De(n,e);return!r||r.type==="element"&&(r.tagName==="td"||r.tagName==="th")}const Iu=Ea({body:Nu,colgroup:Lu,head:Cu,html:Ru,tbody:Pu});function Ru(t){const e=De(t,-1);return!e||e.type!=="comment"}function Cu(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 Nu(t){const e=De(t,-1,!0);return!e||e.type!=="comment"&&!(e.type==="text"&&fi(e.value.charAt(0)))&&!(e.type==="element"&&(e.tagName==="meta"||e.tagName==="link"||e.tagName==="script"||e.tagName==="style"||e.tagName==="template"))}function Lu(t,e,n){const r=Ta(n,e),i=De(t,-1,!0);return n&&r&&r.type==="element"&&r.tagName==="colgroup"&&di(r,n.children.indexOf(r),n)?!1:!!(i&&i.type==="element"&&i.tagName==="col")}function Pu(t,e,n){const r=Ta(n,e),i=De(t,-1);return n&&r&&r.type==="element"&&(r.tagName==="thead"||r.tagName==="tbody")&&di(r,n.children.indexOf(r),n)?!1:!!(i&&i.type==="element"&&i.tagName==="tr")}const Mn={name:[[` +\f\r &/=>`.split(""),` +\f\r "&'/=>\``.split("")],[`\0 +\f\r "&'/<=>`.split(""),`\0 +\f\r "&'/<=>\``.split("")]],unquoted:[[` +\f\r &>`.split(""),`\0 +\f\r "&'<=>\``.split("")],[`\0 +\f\r "&'<=>\``.split(""),`\0 +\f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function Du(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=ka);const u=Ou(r,t.properties),c=r.all(i.space==="html"&&t.tagName==="template"?t.content:t);return r.schema=i,c&&(a=!1),(u||!o||!Iu(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||!di(t,e,n))&&s.push(""),s.join("")}function Ou(t,e){const n=[];let r=-1,i;if(e){for(i in e)if(e[i]!==null&&e[i]!==void 0){const o=Fu(t,i,e[i]);o&&n.push(o)}}for(;++rPi(n,t.alternative)&&(a=t.alternative),s=a+Gt(n,Object.assign({},t.settings.characterReferences,{subset:(a==="'"?Mn.single:Mn.double)[i][o],attribute:!0}))+a),l+(s&&"="+s))}const Bu=["<","&"];function Ma(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:Bu}))}function zu(t,e,n,r){return r.settings.allowDangerousHtml?t.value:Ma(t,e,n,r)}function Uu(t,e,n,r){return r.all(t)}const ju=au("type",{invalid:Vu,unknown:Hu,handlers:{comment:cu,doctype:fu,element:Du,raw:zu,root:Uu,text:Ma}});function Vu(t){throw new Error("Expected node, not `"+t+"`")}function Hu(t){const e=t;throw new Error("Cannot compile unknown node `"+e.type+"`")}const $u={},Gu={},Yu=[];function Ku(t,e){const n=e||$u,r=n.quote||'"',i=r==='"'?"'":'"';if(r!=='"'&&r!=="'")throw new Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:qu,all:Wu,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||Xl,characterReferences:n.characterReferences||Gu,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space==="svg"?ka:ou,quote:r,alternative:i}.one(Array.isArray(t)?{type:"root",children:t}:t,void 0,void 0)}function qu(t,e,n){return ju(t,e,n,this)}function Wu(t){const e=[],n=t&&t.children||Yu;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 Gi={}.hasOwnProperty;function ec(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]/),Je=It(/[\dA-Za-z]/),rc=It(/[#-'*+\--9=?A-Z^-~]/);function Br(t){return t!==null&&(t<32||t===127)}const zr=It(/\d/),ic=It(/[\dA-Fa-f]/),oc=It(/[!-/:-@[-`{-~]/);function se(t){return t!==null&&t<-2}function qe(t){return t!==null&&(t<0||t===32)}function _e(t){return t===-2||t===-1||t===32}const ac=It(new RegExp("\\p{P}|\\p{S}","u")),sc=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 _e(l)?(t.enter(n),s(l)):e(l)}function s(l){return _e(l)&&o++a))return;const I=e.events.length;let v=I,g,m;for(;v--;)if(e.events[v][0]==="exit"&&e.events[v][1].type==="chunkFlow"){if(g){m=e.events[v][1].end;break}g=!0}for(k(r),h=I;h_;){const P=n[R];e.containerState=P[1],P[0].exit.call(e,t)}n.length=_}function S(){i.write([null]),o=void 0,i=void 0,e.containerState._closeFlow=void 0}}function dc(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 Ki(t){if(t===null||qe(t)||sc(t))return 1;if(ac(t))return 2}function hi(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};qi(f,-l),qi(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,hi(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&&_e(h)?Ce(t,S,"linePrefix",o+1)(h):S(h)}function S(h){return h===null||se(h)?t.check(Wi,x,R)(h):(t.enter("codeFlowValue"),_(h))}function _(h){return h===null||se(h)?(t.exit("codeFlowValue"),S(h)):(t.consume(h),_)}function R(h){return t.exit("codeFenced"),e(h)}function P(h,I,v){let g=0;return m;function m(D){return h.enter("lineEnding"),h.consume(D),h.exit("lineEnding"),T}function T(D){return h.enter("codeFencedFence"),_e(D)?Ce(h,M,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(D):M(D)}function M(D){return D===s?(h.enter("codeFencedFenceSequence"),F(D)):v(D)}function F(D){return D===s?(g++,h.consume(D),F):g>=a?(h.exit("codeFencedFenceSequence"),_e(D)?Ce(h,j,"whitespace")(D):j(D)):v(D)}function j(D){return D===null||se(D)?(h.exit("codeFencedFence"),I(D)):v(D)}}}function _c(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 lr={name:"codeIndented",tokenize:Mc},Ec={partial:!0,tokenize:Ac};function Mc(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(Ec,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 Ac(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 Sc={name:"codeText",previous:Rc,resolve:Ic,tokenize:Cc};function Ic(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&&an(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),an(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),an(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 La(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||Br(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=!_e(d)),d===92?p:f)}function p(d){return d===91||d===92||d===93?(t.consume(d),s++,f):f(d)}}function Da(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):_e(i)?Ce(t,r,n?"linePrefix":"lineSuffix")(i):e(i)}}const zc={name:"definition",tokenize:jc},Uc={partial:!0,tokenize:Vc};function jc(t,e,n){const r=this;let i;return o;function o(d){return t.enter("definition"),a(d)}function a(d){return Pa.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 qe(d)?fn(t,u)(d):u(d)}function u(d){return La(t,c,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(d)}function c(d){return t.attempt(Uc,f,f)(d)}function f(d){return _e(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 Vc(t,e,n){return r;function r(s){return qe(s)?fn(t,i)(s):n(s)}function i(s){return Da(t,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(s)}function o(s){return _e(s)?Ce(t,a,"whitespace")(s):a(s)}function a(s){return s===null||se(s)?e(s):n(s)}}const Hc={name:"hardBreakEscape",tokenize:$c};function $c(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 Gc={name:"headingAtx",resolve:Yc,tokenize:Kc};function Yc(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 Kc(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)):_e(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 qc=["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"],Zi=["pre","script","style","textarea"],Wc={concrete:!0,name:"htmlFlow",resolveTo:Qc,tokenize:Jc},Xc={partial:!0,tokenize:tf},Zc={partial:!0,tokenize:ef};function Qc(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 Jc(t,e,n){const r=this;let i,o,a,s,l;return u;function u(C){return c(C)}function c(C){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(C),f}function f(C){return C===33?(t.consume(C),p):C===47?(t.consume(C),o=!0,x):C===63?(t.consume(C),i=3,r.interrupt?e:E):ut(C)?(t.consume(C),a=String.fromCharCode(C),w):n(C)}function p(C){return C===45?(t.consume(C),i=2,d):C===91?(t.consume(C),i=5,s=0,y):ut(C)?(t.consume(C),i=4,r.interrupt?e:E):n(C)}function d(C){return C===45?(t.consume(C),r.interrupt?e:E):n(C)}function y(C){const he="CDATA[";return C===he.charCodeAt(s++)?(t.consume(C),s===he.length?r.interrupt?e:M:y):n(C)}function x(C){return ut(C)?(t.consume(C),a=String.fromCharCode(C),w):n(C)}function w(C){if(C===null||C===47||C===62||qe(C)){const he=C===47,we=a.toLowerCase();return!he&&!o&&Zi.includes(we)?(i=1,r.interrupt?e(C):M(C)):qc.includes(a.toLowerCase())?(i=6,he?(t.consume(C),k):r.interrupt?e(C):M(C)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(C):o?S(C):_(C))}return C===45||Je(C)?(t.consume(C),a+=String.fromCharCode(C),w):n(C)}function k(C){return C===62?(t.consume(C),r.interrupt?e:M):n(C)}function S(C){return _e(C)?(t.consume(C),S):m(C)}function _(C){return C===47?(t.consume(C),m):C===58||C===95||ut(C)?(t.consume(C),R):_e(C)?(t.consume(C),_):m(C)}function R(C){return C===45||C===46||C===58||C===95||Je(C)?(t.consume(C),R):P(C)}function P(C){return C===61?(t.consume(C),h):_e(C)?(t.consume(C),P):_(C)}function h(C){return C===null||C===60||C===61||C===62||C===96?n(C):C===34||C===39?(t.consume(C),l=C,I):_e(C)?(t.consume(C),h):v(C)}function I(C){return C===l?(t.consume(C),l=null,g):C===null||se(C)?n(C):(t.consume(C),I)}function v(C){return C===null||C===34||C===39||C===47||C===60||C===61||C===62||C===96||qe(C)?P(C):(t.consume(C),v)}function g(C){return C===47||C===62||_e(C)?_(C):n(C)}function m(C){return C===62?(t.consume(C),T):n(C)}function T(C){return C===null||se(C)?M(C):_e(C)?(t.consume(C),T):n(C)}function M(C){return C===45&&i===2?(t.consume(C),B):C===60&&i===1?(t.consume(C),X):C===62&&i===4?(t.consume(C),oe):C===63&&i===3?(t.consume(C),E):C===93&&i===5?(t.consume(C),Q):se(C)&&(i===6||i===7)?(t.exit("htmlFlowData"),t.check(Xc,Me,F)(C)):C===null||se(C)?(t.exit("htmlFlowData"),F(C)):(t.consume(C),M)}function F(C){return t.check(Zc,j,Me)(C)}function j(C){return t.enter("lineEnding"),t.consume(C),t.exit("lineEnding"),D}function D(C){return C===null||se(C)?F(C):(t.enter("htmlFlowData"),M(C))}function B(C){return C===45?(t.consume(C),E):M(C)}function X(C){return C===47?(t.consume(C),a="",re):M(C)}function re(C){if(C===62){const he=a.toLowerCase();return Zi.includes(he)?(t.consume(C),oe):M(C)}return ut(C)&&a.length<8?(t.consume(C),a+=String.fromCharCode(C),re):M(C)}function Q(C){return C===93?(t.consume(C),E):M(C)}function E(C){return C===62?(t.consume(C),oe):C===45&&i===2?(t.consume(C),E):M(C)}function oe(C){return C===null||se(C)?(t.exit("htmlFlowData"),Me(C)):(t.consume(C),oe)}function Me(C){return t.exit("htmlFlow"),e(C)}}function ef(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 tf(t,e,n){return r;function r(i){return t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),t.attempt(Xn,e,n)}}const nf={name:"htmlText",tokenize:rf};function rf(t,e,n){const r=this;let i,o,a;return s;function s(E){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(E),l}function l(E){return E===33?(t.consume(E),u):E===47?(t.consume(E),P):E===63?(t.consume(E),_):ut(E)?(t.consume(E),v):n(E)}function u(E){return E===45?(t.consume(E),c):E===91?(t.consume(E),o=0,y):ut(E)?(t.consume(E),S):n(E)}function c(E){return E===45?(t.consume(E),d):n(E)}function f(E){return E===null?n(E):E===45?(t.consume(E),p):se(E)?(a=f,X(E)):(t.consume(E),f)}function p(E){return E===45?(t.consume(E),d):f(E)}function d(E){return E===62?B(E):E===45?p(E):f(E)}function y(E){const oe="CDATA[";return E===oe.charCodeAt(o++)?(t.consume(E),o===oe.length?x:y):n(E)}function x(E){return E===null?n(E):E===93?(t.consume(E),w):se(E)?(a=x,X(E)):(t.consume(E),x)}function w(E){return E===93?(t.consume(E),k):x(E)}function k(E){return E===62?B(E):E===93?(t.consume(E),k):x(E)}function S(E){return E===null||E===62?B(E):se(E)?(a=S,X(E)):(t.consume(E),S)}function _(E){return E===null?n(E):E===63?(t.consume(E),R):se(E)?(a=_,X(E)):(t.consume(E),_)}function R(E){return E===62?B(E):_(E)}function P(E){return ut(E)?(t.consume(E),h):n(E)}function h(E){return E===45||Je(E)?(t.consume(E),h):I(E)}function I(E){return se(E)?(a=I,X(E)):_e(E)?(t.consume(E),I):B(E)}function v(E){return E===45||Je(E)?(t.consume(E),v):E===47||E===62||qe(E)?g(E):n(E)}function g(E){return E===47?(t.consume(E),B):E===58||E===95||ut(E)?(t.consume(E),m):se(E)?(a=g,X(E)):_e(E)?(t.consume(E),g):B(E)}function m(E){return E===45||E===46||E===58||E===95||Je(E)?(t.consume(E),m):T(E)}function T(E){return E===61?(t.consume(E),M):se(E)?(a=T,X(E)):_e(E)?(t.consume(E),T):g(E)}function M(E){return E===null||E===60||E===61||E===62||E===96?n(E):E===34||E===39?(t.consume(E),i=E,F):se(E)?(a=M,X(E)):_e(E)?(t.consume(E),M):(t.consume(E),j)}function F(E){return E===i?(t.consume(E),i=void 0,D):E===null?n(E):se(E)?(a=F,X(E)):(t.consume(E),F)}function j(E){return E===null||E===34||E===39||E===60||E===61||E===96?n(E):E===47||E===62||qe(E)?g(E):(t.consume(E),j)}function D(E){return E===47||E===62||qe(E)?g(E):n(E)}function B(E){return E===62?(t.consume(E),t.exit("htmlTextData"),t.exit("htmlText"),e):n(E)}function X(E){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(E),t.exit("lineEnding"),re}function re(E){return _e(E)?Ce(t,Q,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(E):Q(E)}function Q(E){return t.enter("htmlTextData"),a(E)}}const mi={name:"labelEnd",resolveAll:lf,resolveTo:uf,tokenize:cf},of={tokenize:ff},af={tokenize:df},sf={tokenize:pf};function lf(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"),_e(u)?Ce(t,s,"whitespace")(u):s(u))}}const Ge={continuation:{tokenize:Tf},exit:Ef,name:"list",tokenize:kf},bf={partial:!0,tokenize:Mf},wf={partial:!0,tokenize:_f};function kf(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:zr(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(On,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 zr(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(Xn,r.interrupt?n:c,t.attempt(bf,p,f))}function c(d){return r.containerState.initialBlankLine=!0,o++,p(d)}function f(d){return _e(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 Tf(t,e,n){const r=this;return r.containerState._closeFlow=void 0,t.check(Xn,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||!_e(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(wf,e,a)(s))}function a(s){return r.containerState._closeFlow=!0,r.interrupt=void 0,Ce(t,t.attempt(Ge,e,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s)}}function _f(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 Ef(t){t.exit(this.containerState.type)}function Mf(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!_e(o)&&a&&a[1].type==="listItemPrefixWhitespace"?e(o):n(o)}}const Qi={name:"setextUnderline",resolveTo:Af,tokenize:Sf};function Af(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 Sf(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"),_e(u)?Ce(t,l,"lineSuffix")(u):l(u))}function l(u){return u===null||se(u)?(t.exit("setextHeadingLine"),e(u)):n(u)}}const If={tokenize:Rf};function Rf(t){const e=this,n=t.attempt(Xn,r,t.attempt(this.parser.constructs.flowInitial,i,Ce(t,t.attempt(this.parser.constructs.flow,i,t.attempt(Pc,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 Cf={resolveAll:Fa()},Nf=Oa("string"),Lf=Oa("text");function Oa(t){return{resolveAll:Fa(t==="text"?Pf: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 Kf(t,e){let n=-1;const r=[];let i;for(;++n0){const Ve=ne.tokenStack[ne.tokenStack.length-1];(Ve[1]||no).call(ne,void 0,Ve[0])}for(q.position={start:wt(U.length>0?U[0][1].start:{line:1,column:1,offset:0}),end:wt(U.length>0?U[U.length-2][1].end:{line:1,column:1,offset:0})},xe=-1;++xe1?"-"+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 cd(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 fd(t,e){if(t.options.allowDangerousHtml){const n={type:"raw",value:e.value};return t.patch(e,n),t.applyData(e,n)}}function Ua(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 dd(t,e){const n=String(e.identifier).toUpperCase(),r=t.definitionById.get(n);if(!r)return Ua(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 pd(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 hd(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 md(t,e){const n=String(e.identifier).toUpperCase(),r=t.definitionById.get(n);if(!r)return Ua(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 gd(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 yd(t,e,n){const r=t.all(e),i=n?xd(n):ja(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 vd(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 Td(t){const e=Ha(t),n=Va(t);if(e&&n)return{start:e,end:n}}function _d(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=Ha(e.children[1]),l=Va(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 Ed(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(oo(e.slice(i),i>0,!1)),o.join("")}function oo(t,e,n){let r=0,i=t.length;if(e){let o=t.codePointAt(r);for(;o===ro||o===io;)r++,o=t.codePointAt(r)}if(n){let o=t.codePointAt(i-1);for(;o===ro||o===io;)i--,o=t.codePointAt(i-1)}return i>r?t.slice(r,i):""}function Sd(t,e){const n={type:"text",value:Ad(String(e.value))};return t.patch(e,n),t.applyData(e,n)}function Id(t,e){const n={type:"element",tagName:"hr",properties:{},children:[]};return t.patch(e,n),t.applyData(e,n)}const Rd={blockquote:id,break:od,code:ad,delete:sd,emphasis:ld,footnoteReference:ud,heading:cd,html:fd,imageReference:dd,image:pd,inlineCode:hd,linkReference:md,link:gd,listItem:yd,list:vd,paragraph:bd,root:wd,strong:kd,table:_d,tableCell:Md,tableRow:Ed,text:Sd,thematicBreak:Id,toml:An,yaml:An,definition:An,footnoteDefinition:An};function An(){}const Ga=-1,Zn=0,$n=1,Gn=2,gi=3,yi=4,xi=5,vi=6,Ya=7,Ka=8,ao=typeof self=="object"?self:globalThis,Cd=(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 Ga:return n(a,i);case $n:{const s=n([],i);for(const l of a)s.push(r(l));return s}case Gn:{const s=n({},i);for(const[l,u]of a)s[r(l)]=r(u);return s}case gi:return n(new Date(a),i);case yi:{const{source:s,flags:l}=a;return n(new RegExp(s,l),i)}case xi:{const s=n(new Map,i);for(const[l,u]of a)s.set(r(l),r(u));return s}case vi:{const s=n(new Set,i);for(const l of a)s.add(r(l));return s}case Ya:{const{name:s,message:l}=a;return n(new ao[s](l),i)}case Ka:return n(BigInt(a),i);case"BigInt":return n(Object(BigInt(a)),i)}return n(new ao[o](a),i)};return r},so=t=>Cd(new Map,t)(0),Bt="",{toString:Nd}={},{keys:Ld}=Object,sn=t=>{const e=typeof t;if(e!=="object"||!t)return[Zn,e];const n=Nd.call(t).slice(8,-1);switch(n){case"Array":return[$n,Bt];case"Object":return[Gn,Bt];case"Date":return[gi,Bt];case"RegExp":return[yi,Bt];case"Map":return[xi,Bt];case"Set":return[vi,Bt]}return n.includes("Array")?[$n,n]:n.includes("Error")?[Ya,n]:[Gn,n]},Sn=([t,e])=>t===Zn&&(e==="function"||e==="symbol"),Pd=(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]=sn(a);switch(s){case Zn:{let c=a;switch(l){case"bigint":s=Ka,c=a.toString();break;case"function":case"symbol":if(t)throw new TypeError("unable to serialize "+l);c=null;break;case"undefined":return i([Ga],a)}return i([s,c],a)}case $n:{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 Gn:{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 Ld(a))(t||!Sn(sn(a[p])))&&c.push([o(p),o(a[p])]);return f}case gi:return i([s,a.toISOString()],a);case yi:{const{source:c,flags:f}=a;return i([s,{source:c,flags:f}],a)}case xi:{const c=[],f=i([s,c],a);for(const[p,d]of a)(t||!(Sn(sn(p))||Sn(sn(d))))&&c.push([o(p),o(d)]);return f}case vi:{const c=[],f=i([s,c],a);for(const p of a)(t||!Sn(sn(p)))&&c.push(o(p));return f}}const{message:u}=a;return i([s,{name:l,message:u}],a)};return o},lo=(t,{json:e,lossy:n}={})=>{const r=[];return Pd(!(e||n),!!e,new Map,r)(t),r},Yn=typeof structuredClone=="function"?(t,e)=>e&&("json"in e||"lossy"in e)?so(lo(t,e)):structuredClone(t):(t,e)=>so(lo(t,e));function Dd(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 Od(t,e){return"Back to reference "+(t+1)+(e>1?"-"+e:"")}function Fd(t){const e=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",n=t.options.footnoteBackContent||Dd,r=t.options.footnoteBackLabel||Od,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 S=typeof n=="string"?n:n(l,d);typeof S=="string"&&(S={type:"text",value:S}),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(S)?S:[S]})}const w=c[c.length-1];if(w&&w.type==="element"&&w.tagName==="p"){const S=w.children[w.children.length-1];S&&S.type==="text"?S.value+=" ":w.children.push({type:"text",value:" "}),w.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:{...Yn(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 qa=function(t){if(t==null)return jd;if(typeof t=="function")return Qn(t);if(typeof t=="object")return Array.isArray(t)?Bd(t):zd(t);if(typeof t=="string")return Ud(t);throw new Error("Expected function, string, or object as test")};function Bd(t){const e=[];let n=-1;for(;++n":""))+")"})}return p;function p(){let d=Wa,y,x,w;if((!e||o(l,u,c[c.length-1]||void 0))&&(d=Yd(n(l,c)),d[0]===uo))return d;if("children"in l&&l.children){const k=l;if(k.children&&d[0]!==$d)for(x=(r?k.children.length:-1)+a,w=c.concat(k);x>-1&&x0&&n.push({type:"text",value:` +`}),n}function co(t){let e=0,n=t.charCodeAt(e);for(;n===9||n===32;)e++,n=t.charCodeAt(e);return t.slice(e)}function fo(t,e){const n=Wd(t,e),r=n.one(t,void 0),i=Fd(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&o.children.push({type:"text",value:` +`},i),o}function ep(t,e){return t&&"run"in t?async function(n,r){const i=fo(n,{file:r,...e});await t.run(i,r)}:function(n,r){return fo(n,{file:r,...t||e})}}function po(t){if(t)throw t}var cr,ho;function tp(){if(ho)return cr;ho=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 cr=function l(){var u,c,f,p,d,y,x=arguments[0],w=1,k=arguments.length,S=!1;for(typeof x=="boolean"&&(S=x,x=arguments[1]||{},w=2),(x==null||typeof x!="object"&&typeof x!="function")&&(x={});wa.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 st={basename:op,dirname:ap,extname:sp,join:lp,sep:"/"};function op(t,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');bn(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 ap(t){if(bn(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 sp(t){bn(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 lp(...t){let e=-1,n;for(;++e0&&t.codePointAt(t.length-1)===47&&(n+="/"),e?"/"+n:n}function cp(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 bn(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}const fp={cwd:dp};function dp(){return"/"}function $r(t){return!!(t!==null&&typeof t=="object"&&"href"in t&&t.href&&"protocol"in t&&t.protocol&&t.auth===void 0)}function pp(t){if(typeof t=="string")t=new URL(t);else if(!$r(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 hp(t)}function hp(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];Hr(x)&&Hr(d)&&(d=fr(!0,x,d)),r[p]=[u,d,...y]}}}}const vp=new bi().freeze();function mr(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `parser`")}function gr(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `compiler`")}function yr(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(!Hr(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function yo(t,e,n){if(!n)throw new Error("`"+t+"` finished async. Use `"+e+"` instead")}function In(t){return bp(t)?t:new mp(t)}function bp(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function wp(t){return typeof t=="string"||kp(t)}function kp(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}function wi(){const t=vp().use(rd).use(ep).use(Xu);return{process:e=>t.processSync(e).toString()}}function Xa(t,e){const n=Yo(e??{},{...Li.getDefaultRealTimeVADOptions("v5"),preSpeechPadFrames:30,positiveSpeechThreshold:.5,negativeSpeechThreshold:.35,minSpeechFrames:30,auto:!0}),r=W(),i=ws("microphone");async function o(){if(r.value&&(r.value.destroy(),r.value=void 0,console.warn("existing MicVAD destroyed")),!i.value)return;const a=H(t);if(!a)return;const s=await navigator.mediaDevices.getUserMedia({audio:{deviceId:a}});r.value=await Li.MicVAD.new({...n,stream:s}),n.auto&&r.value.start()}return Be(i,o,{immediate:!0}),Be(ks(t),o,{immediate:!0}),Ts(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 xo(t,e){if(e===_s)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),t;if(e===Cr||e===Ko){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 nh(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 _p(){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 Ep{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 zp{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 Up{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 jp{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 Vp{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 vt,w=new ae,k=new Bn,S=new ae(1,1,1),_=new Is(y.geometry,y.material,p);for(let R=0;R0||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 th=new vt;class nh{constructor(e={},n={}){this.json=e,this.extensions={},this.plugins={},this.options=n,this.cache=new _p,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 Cs(this.options.manager):this.textureLoader=new Ns(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new qo(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&&w.setY(g,h[I*l+1]),l>=3&&w.setZ(g,h[I*l+2]),l>=4&&w.setW(g,h[I*l+3]),l>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}w.normalized=y}return w})}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=bo[p.magFilter]||zn,c.minFilter=bo[p.minFilter]||Qr,c.wrapS=wo[p.wrapS]||Un,c.wrapT=wo[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 w=new jn(x);w.needsUpdate=!0,p(w)}),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||eh(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 Ls,tr.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 Ps,tr.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 ea}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],xt),s.opacity=p[3]}f.baseColorTexture!==void 0&&u.push(n.assignTexture(s,"map",f.baseColorTexture,pn)),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||vr.OPAQUE;if(c===vr.BLEND?(s.transparent=!0,s.depthWrite=!1):(s.transparent=!1,c===vr.MASK&&(s.alphaTest=o.alphaCutoff!==void 0?o.alphaCutoff:.5)),o.normalTexture!==void 0&&a!==Ht&&(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!==Ht&&(u.push(n.assignTexture(s,"aoMap",o.occlusionTexture)),o.occlusionTexture.strength!==void 0&&(s.aoMapIntensity=o.occlusionTexture.strength)),o.emissiveFactor!==void 0&&a!==Ht){const f=o.emissiveFactor;s.emissive=new ze().setRGB(f[0],f[1],f[2],xt)}return o.emissiveTexture!==void 0&&a!==Ht&&u.push(n.assignTexture(s,"emissiveMap",o.emissiveTexture,pn)),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 ko(l,s,n)})}const a=[];for(let s=0,l=e.length;s0&&Qp(k,o),k.name=n.createUniqueName(o.name||"mesh_"+e),gt(k,o),w.extensions&&Rt(i,k,w),n.assignFinalMaterial(k),f.push(k)}for(let d=0,y=f.length;d1?c=new nr:u.length===1?c=u[0]:c=new Zr,c!==u[0])for(let f=0,p=u.length;f{const f=new Map;for(const[p,d]of i.associations)(p instanceof tr||p instanceof jn)&&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=Ai;break;case kt.rotation:u=Si;break;case kt.translation:case kt.scale:u=Mi;break;default:switch(r.itemSize){case 1:u=Ai;break;case 2:case 3:default:u=Mi;break}break}const c=i.interpolation!==void 0?Wp[i.interpolation]:Jr,f=this._getArrayFromAccessor(r);for(let p=0,d=l.length;pnew wl(t)),Ct.register(t=>new kl(t)),Ct)}async function ih(t){const r=(await Ja().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 oh(t,e){if(!t){console.warn("No VRM found");return}if(e)return Tl(e,t)}function ah(){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 sh(){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=_l()/1e3):e||r(),o.lookAt.target||(o.lookAt.target=new Zr),o.lookAt.target.position.lerp(e,on(.2,.5)),(s=o.lookAt)==null||s.update(a),n+=a)}return{update:i}}async function lh(t,e){const i=(await Ja().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(Dr.removeUnnecessaryVertices(o.scene),Dr.combineSkeletons(o.scene),o.scene.traverse(a=>{a.frustumCulled=!1}),o.lookAt){const a=new El(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 uh(t){const e=W(null),n=W(!1),r=W(0),i=W(new Map),o=W(new Map),a=W(),s=(k,S,_)=>k+(S-k)*_,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 _;if(c(),!u.has(k)){console.warn(`Emotion ${k} not found`);return}const S=u.get(k);if(e.value=k,n.value=!0,r.value=0,t.expressionManager){const R=Object.keys(t.expressionManager.expressionMap);for(const P of R)t.expressionManager.setValue(P,0)}i.value.clear(),o.value.clear();for(const R of S.expression||[]){const P=((_=t.expressionManager)==null?void 0:_.getValue(R.name))||0;i.value.set(R.name,P),o.value.set(R.name,R.value)}};return{currentEmotion:e,isTransitioning:n,setEmotion:f,setEmotionWithResetAfter:(k,S)=>{c(),f(k),a.value=setTimeout(()=>{f("neutral"),a.value=void 0},S)},update:k=>{var R;if(!n.value||!e.value)return;const _=u.get(e.value).blendDuration||.3;r.value+=k/_,r.value>=1&&(r.value=1,n.value=!1);for(const[P,h]of o.value){const I=i.value.get(P)||0,v=s(I,h,l(r.value));(R=t.expressionManager)==null||R.setValue(P,v)}},addEmotionState:(k,S)=>{u.set(k,S)},removeEmotionState:k=>{u.delete(k)},dispose:()=>{c()}}}function ch(t,e){const n=Yo(e,{onLoading:()=>{},onInitiate:()=>{},onProgress:()=>{},onDone:()=>{},onReady:()=>{},onStart:()=>{},onUpdate:()=>{},onComplete:()=>{}}),{post:r,data:i,terminate:o}=Gs(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,w,k,S,_,R;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),(w=n.onDone)==null||w.call(n,p);break;case"ready":a.value="ready",(k=n.onReady)==null||k.call(n);break;case"start":u.value=!0,(S=n.onStart)==null||S.call(n);break;case"update":c.value=p.tps,(_=n.onUpdate)==null||_.call(n,p.tps);break;case"complete":u.value=!1,f.value=p.output[0]||"",console.debug("Whisper result:",f.value),(R=n.onComplete)==null||R.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 fh=Kn("llm",()=>{async function t(n,r,i,o){const a=o==null?void 0:o.headers;return await zl({...r.chat(n),maxSteps:10,messages:i,headers:a,tools:[...await Il(),...await Rl()],onEvent(s){var l,u;s.type==="tool-call"?(l=o==null?void 0:o.onToolCall)==null||l.call(o,s.toolCall):s.type==="tool-call-result"&&((u=o==null?void 0:o.onToolCallResult)==null||u.call(o,{id:s.id,result:s.result}))}})}async function e(n,r){if(n==="")return[];try{return await Bl({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=Kn("chat",()=>{const{stream:t}=fh(),{systemPrompt:e}=Ke(Ul()),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 w(h){l.value.push(h)}function k(h){u.value.push(h)}function S(h){c.value.push(h)}const _=W([{role:"system",content:e.value}]),R=W({role:"assistant",content:"",slices:[],tool_results:[]});async function P(h,I){var v;try{if(n.value=!0,!h)return;for(const D of r.value)await D(h);const g=Wl({onLiteral:async D=>{for(const X of s.value)await X(D);R.value.content+=D;const B=R.value.slices.at(-1);if((B==null?void 0:B.type)==="text"){B.text+=D;return}R.value.slices.push({type:"text",text:D})},onSpecial:async D=>{for(const B of l.value)await B(D)}}),m=Dn({handlers:[async D=>{if(D.data.type==="text"){await g.consume(D.data.text);return}if(D.data.type==="tool-call"){R.value.slices.push(D.data);return}D.data.type==="tool-call-result"&&R.value.tool_results.push(D.data)}]});R.value={role:"assistant",content:"",slices:[],tool_results:[]},_.value.push({role:"user",content:h}),_.value.push(R.value);const T=_.value.slice(0,_.value.length-1).map(D=>{if(D.role==="assistant"){const{slices:B,...X}=D;return Ri(X)}return Ri(D)});for(const D of i.value)await D(h);for(const D of o.value)await D(h);const M=((v=I.providerConfig)==null?void 0:v.headers)||{},F=await t(I.model,I.chatProvider,T,{headers:M,onToolCall(D){m.add({type:"tool-call",toolCall:D})},onToolCallResult(D){m.add({type:"tool-call-result",id:D.id,result:D.result})}});for(const D of a.value)await D(h);let j="";for await(const D of $l(F.textStream,async B=>B))m.add({type:"text",text:D}),j+=D;await g.end();for(const D of u.value)await D();for(const D of c.value)await D(j);console.debug("LLM output:",j)}catch(g){throw console.error("Error sending message:",g),g}finally{n.value=!1}}return{sending:n,messages:_,streamingMessage:R,send:P,onBeforeMessageComposed:f,onAfterMessageComposed:p,onBeforeSend:d,onAfterSend:y,onTokenLiteral:x,onTokenSpecial:w,onStreamEnd:k,onAssistantResponseEnd:S}}),es=Fe({__name:"Screen",setup(t){const e=W(),n=Ys(qs),{width:r,height:i}=Ks(),o=ni(e,{immediate:!0,windowResize:!0,reset:!0}),a=Ue(()=>n.between("sm","md").value||n.smaller("sm").value),s=Ue(()=>n.between("md","lg").value),l=Ue(()=>n.greaterOrEqual("lg").value),u=Ue(()=>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}),mn(async()=>{e.value&&o.update()}),(f,p)=>(J(),ie("div",{ref_key:"containerRef",ref:e,"h-full":"","w-full":""},[gn(f.$slots,"default",{width:u.value,height:c.value})],512))}}),dh={absolute:"",bottom:"3",right:"3"},ph={flex:"~ row","cursor-pointer":""},hh=["checked","aria-checked"],mh={key:0,"min-w":"50vw",z:"(J(),Xt(es,{relative:""},{default:Ye(({width:a,height:s})=>[Te(Vl,{width:a,height:s},{default:Ye(({app:l})=>[Te(jl,{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",dh,[O("div",ph,[O("label",{class:lt([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","appearance-none":"","outline-none":"",hidden:""},null,8,hh),[[ri,n.value]]),o[8]||(o[8]=O("div",{"select-none":""},[O("div",{"i-solar:bug-bold-duotone":""})],-1))],2)]),Te(H(ui),null,{default:Ye(()=>[n.value?(J(),ie("div",mh,[O("div",gh,[O("div",yh,[O("span",null,ve(H(e)("stage.viewers.debug-menu.emotions")),1)]),O("div",xh,[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})},ve(H(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})},ve(H(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})},ve(H(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})},ve(H(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})},ve(H(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})},ve(H(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})},ve(H(e)("stage.viewers.debug-menu.emotions-btn.think")),1)])])])):at("",!0)]),_:1})])]),_:1}))}});var bh=Object.defineProperty,wh=(t,e,n)=>e in t?bh(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,kh=(t,e,n)=>wh(t,e+"",n);function Th(t){return il()?(ol(t),!0):!1}function ts(t){return typeof t=="function"?t():H(t)}const _h=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Eh=Object.prototype.toString,Mh=t=>Eh.call(t)==="[object Object]",Ah=()=>{},Sh=_h?window:void 0;function Ih(t){var e;const n=ts(t);return(e=n==null?void 0:n.$el)!=null?e:n}function wr(...t){let e,n,r,i;if(typeof t[0]=="string"||Array.isArray(t[0])?([n,r,i]=t,e=Sh):[e,n,r,i]=t,!e)return Ah;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(()=>[Ih(e),ts(i)],([c,f])=>{if(a(),!c)return;const p=Mh(f)?{...f}:f;o.push(...n.flatMap(d=>r.map(y=>s(c,d,y,p))))},{immediate:!0,flush:"post"}),u=()=>{l(),a()};return Th(u),u}function ns(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=oi.clone({[l]:{value:u}});return{...s,...c}},{}),vertexShader:e,fragmentShader:n}),kh(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}ns({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() { + gl_Position = projectionMatrix * viewMatrix * modelMatrix * vec4(position, 1.); + vUv = uv; + vPos = position.xy; + } + `,` + // mostly from https://gist.github.com/statico/df64c5d167362ecf7b34fca0b1459a44 + varying vec2 vUv; + varying vec2 vPos; + uniform vec2 scale; + uniform vec2 imageBounds; + uniform float resolution; + uniform vec3 color; + uniform sampler2D map; + uniform float radius; + uniform float zoom; + uniform float grayscale; + uniform float opacity; + const vec3 luma = vec3(.299, 0.587, 0.114); + vec4 toGrayscale(vec4 color, float intensity) { + return vec4(mix(color.rgb, vec3(dot(color.rgb, luma)), intensity), color.a); + } + vec2 aspect(vec2 size) { + return size / min(size.x, size.y); + } + + const float PI = 3.14159265; + + // from https://iquilezles.org/articles/distfunctions + float udRoundBox( vec2 p, vec2 b, float r ) { + return length(max(abs(p)-b+r,0.0))-r; + } + + void main() { + vec2 s = aspect(scale); + vec2 i = aspect(imageBounds); + float rs = s.x / s.y; + float ri = i.x / i.y; + vec2 new = rs < ri ? vec2(i.x * s.y / i.y, s.y) : vec2(s.x, i.y * s.x / i.x); + vec2 offset = (rs < ri ? vec2((new.x - s.x) / 2.0, 0.0) : vec2(0.0, (new.y - s.y) / 2.0)) / new; + vec2 uv = vUv * s / new + offset; + vec2 zUv = (uv - vec2(0.5, 0.5)) / zoom + vec2(0.5, 0.5); + + vec2 res = vec2(scale * resolution); + vec2 halfRes = 0.5 * res; + float b = udRoundBox(vUv.xy * res - halfRes, halfRes, resolution * radius); + vec3 a = mix(vec3(1.0,0.0,0.0), vec3(0.0,0.0,0.0), smoothstep(0.0, 1.0, b)); + gl_FragColor = toGrayscale(texture2D(map, zUv) * vec4(color, opacity * a), grayscale); + + #include + #include + } + `);const ki=parseInt(al.replace(/\D+/g,""));var Rh=Object.defineProperty,Ch=(t,e,n)=>e in t?Rh(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Nh=(t,e,n)=>(Ch(t,e+"",n),n);async function To(t){const e=await t.arrayBuffer(),n=btoa(String.fromCharCode(...new Uint8Array(e)));return`data:${t.type||""};base64,${n}`}let Rn,kr,zt,Cn;function Tr(t,e=1/0,n=null){kr||(kr=new sa(2,2,1,1)),zt||(zt=new yn({uniforms:{blitTexture:new pl(t)},vertexShader:` + varying vec2 vUv; + void main(){ + vUv = uv; + gl_Position = vec4(position.xy * 1.0,0.,.999999); + } + `,fragmentShader:` + uniform sampler2D blitTexture; + varying vec2 vUv; + + void main(){ + gl_FragColor = vec4(vUv.xy, 0, 1); + + #ifdef IS_SRGB + gl_FragColor = LinearTosRGB( texture2D( blitTexture, vUv) ); + #else + gl_FragColor = texture2D( blitTexture, vUv); + #endif + } + `})),zt.uniforms.blitTexture.value=t,zt.defines.IS_SRGB="colorSpace"in t?t.colorSpace==="srgb":t.encoding===3001,zt.needsUpdate=!0,Cn||(Cn=new Pt(kr,zt),Cn.frustrumCulled=!1);const r=new Mt,i=new Lr;i.add(Cn),n||(n=Rn=new hl({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 jn(n.domElement);return o.minFilter=t.minFilter,o.magFilter=t.magFilter,o.wrapS=t.wrapS,o.wrapT=t.wrapT,o.name=t.name,Rn&&(Rn.dispose(),Rn=null),o}const _o={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 rs{constructor(){this.pluginCallbacks=[],this.register(function(e){return new Vh(e)}),this.register(function(e){return new Hh(e)}),this.register(function(e){return new Yh(e)}),this.register(function(e){return new Kh(e)}),this.register(function(e){return new qh(e)}),this.register(function(e){return new Wh(e)}),this.register(function(e){return new $h(e)}),this.register(function(e){return new Gh(e)}),this.register(function(e){return new Xh(e)}),this.register(function(e){return new Zh(e)}),this.register(function(e){return new Qh(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 jh,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 is(t){return Math.ceil(t/4)*4}function Er(t,e=0){const n=is(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 Io(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 jh{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=Er(p),y=new DataView(new ArrayBuffer(Ao));y.setUint32(0,d.byteLength,!0),y.setUint32(4,Fh,!0);const x=Er(Bh(JSON.stringify(a)),32),w=new DataView(new ArrayBuffer(Ao));w.setUint32(0,x.byteLength,!0),w.setUint32(4,Oh,!0);const k=new ArrayBuffer(Mo),S=new DataView(k);S.setUint32(0,Ph,!0),S.setUint32(4,Dh,!0);const _=Mo+w.byteLength+x.byteLength+y.byteLength+d.byteLength;S.setUint32(8,_,!0),new Blob([k,w,x,y,d],{type:"application/octet-stream"}).arrayBuffer().then(n)}):a.buffers&&a.buffers.length>0?To(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=Er(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=Uh(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=So();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 w=new Uint8ClampedArray(e.height*e.width*4);for(let k=0;ko.processBufferViewImage(w)).then(w=>{p.bufferView=w})):d.toDataURL!==void 0?p.uri=d.toDataURL(i):u.push(Io(d,i).then(To).then(w=>{p.uri=w}));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:et[e.magFilter],minFilter:et[e.minFilter],wrapS:et[e.wrapS],wrapT:et[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 rr&&(e=Tr(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 _=0,R=e.material.length;_=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 _ in a.attributes){if(_.slice(0,5)==="morph")continue;const R=a.attributes[_];if(_=p[_]||_.toUpperCase(),/^(POSITION|NORMAL|TANGENT|TEXCOORD_\d+|COLOR_\d+|JOINTS_\d+|WEIGHTS_\d+)$/.test(_)||(_="_"+_),n.attributes.has(this.getUID(R))){u[_]=n.attributes.get(this.getUID(R));continue}y=null;const P=R.array;_==="JOINTS_0"&&!(P instanceof Uint16Array)&&!(P instanceof Uint8Array)&&(console.warn('GLTFExporter: Attribute "skinIndex" converted to type UNSIGNED_SHORT.'),y=new Nt(new Uint16Array(P),R.itemSize,R.normalized));const h=this.processAccessor(y||R,a);h!==null&&(_.startsWith("_")||this.detectMeshQuantization(_,R),u[_]=h,n.attributes.set(this.getUID(R),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 _=[],R=[],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=R)}const x=Array.isArray(e.material);if(x&&a.groups.length===0)return null;const w=x?e.material:[e.material],k=x?a.groups:[{materialIndex:0,start:void 0,count:void 0}];for(let _=0,R=k.length;_0&&(P.targets=f),a.index!==null){let I=this.getUID(a.index);(k[_].start!==void 0||k[_].count!==void 0)&&(I+=":"+k[_].start+":"+k[_].count),n.attributes.has(I)?P.indices=n.attributes.get(I):(P.indices=this.processAccessor(a.index,a,k[_].start,k[_].count),n.attributes.set(I,P.indices)),P.indices===null&&delete P.indices}const h=this.processMaterial(w[k[_].materialIndex]);h!==null&&(P.material=h),c.push(P)}l.primitives=c,r.meshes||(r.meshes=[]),this._invokeAll(function(_){_.writeMesh&&_.writeMesh(e,l)});const S=r.meshes.push(l)-1;return n.meshes.set(o,S),S}detectMeshQuantization(e,n){if(this.extensionsUsed[_r])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];_o[i]&&_o[i].includes(r)&&(this.extensionsUsed[_r]=!0,this.extensionsRequired[_r]=!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=rs.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 Hh=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}},$h=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}},Gh=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}},Yh=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}},Kh=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}},qh=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}},Wh=class{constructor(t){this.writer=t,this.name="KHR_materials_specular"}writeMaterial(t,e){if(!t.isMeshPhysicalMaterial||t.specularIntensity===1&&t.specularColor.equals(Lh)&&!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}},Xh=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}},Zh=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}},Qh=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 wn=Uint8Array,os=Uint16Array,Jh=Uint32Array,em=new wn([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]),tm=new wn([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]),as=function(t,e){for(var n=new os(31),r=0;r<31;++r)n[r]=e+=1<>>1|(Ne&21845)<<1;Tt=(Tt&52428)>>>2|(Tt&13107)<<2,Tt=(Tt&61680)>>>4|(Tt&3855)<<4,im[Ne]=((Tt&65280)>>>8|(Tt&255)<<8)>>>1}var Jn=new wn(288);for(var Ne=0;Ne<144;++Ne)Jn[Ne]=8;for(var Ne=144;Ne<256;++Ne)Jn[Ne]=9;for(var Ne=256;Ne<280;++Ne)Jn[Ne]=7;for(var Ne=280;Ne<288;++Ne)Jn[Ne]=8;var om=new wn(32);for(var Ne=0;Ne<32;++Ne)om[Ne]=5;var am=new wn(0),sm=typeof TextDecoder<"u"&&new TextDecoder,lm=0;try{sm.decode(am,{stream:!0}),lm=1}catch{}var um=Object.defineProperty,cm=(t,e,n)=>e in t?um(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,fm=(t,e,n)=>(cm(t,e+"",n),n);const ls=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||ls.ReflectorShader,l=e.multisample!==void 0?e.multisample:4,u=new oa,c=new ae,f=new ae,p=new ae,d=new vt,y=new ae(0,0,-1),x=new At,w=new ae,k=new ae,S=new At,_=new vt,R=this.camera,P=new ll(i,o,{samples:l,type:ul}),h=new yn({uniforms:oi.clone(s.uniforms),fragmentShader:s.fragmentShader,vertexShader:s.vertexShader});h.uniforms.tDiffuse.value=P.texture,h.uniforms.color.value=r,h.uniforms.textureMatrix.value=_,this.material=h,this.onBeforeRender=function(I,v,g){if(f.setFromMatrixPosition(n.matrixWorld),p.setFromMatrixPosition(g.matrixWorld),d.extractRotation(n.matrixWorld),c.set(0,0,1),c.applyMatrix4(d),w.subVectors(f,p),w.dot(c)>0)return;w.reflect(c).negate(),w.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),R.position.copy(w),R.up.set(0,1,0),R.up.applyMatrix4(d),R.up.reflect(c),R.lookAt(k),R.far=g.far,R.updateMatrixWorld(),R.projectionMatrix.copy(g.projectionMatrix),_.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),_.multiply(R.projectionMatrix),_.multiply(R.matrixWorldInverse),_.multiply(n.matrixWorld),u.setFromNormalAndCoplanarPoint(c,f),u.applyMatrix4(R.matrixWorldInverse),x.set(u.normal.x,u.normal.y,u.normal.z,u.constant);const m=R.projectionMatrix;S.x=(Math.sign(x.x)+m.elements[8])/m.elements[0],S.y=(Math.sign(x.y)+m.elements[9])/m.elements[5],S.z=-1,S.w=(1+m.elements[10])/m.elements[14],x.multiplyScalar(2/x.dot(S)),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(),M=I.xr.enabled,F=I.shadowMap.autoUpdate,j=I.toneMapping;let D=!1;"outputColorSpace"in I?D=I.outputColorSpace==="srgb":D=I.outputEncoding===3001,I.xr.enabled=!1,I.shadowMap.autoUpdate=!1,"outputColorSpace"in I?I.outputColorSpace="srgb-linear":I.outputEncoding=3e3,I.toneMapping=cl,I.setRenderTarget(P),I.state.buffers.depth.setMask(!0),I.autoClear===!1&&I.clear(),I.render(v,R),I.xr.enabled=M,I.shadowMap.autoUpdate=F,I.toneMapping=j,"outputColorSpace"in I?I.outputColorSpace=D?"srgb":"srgb-linear":I.outputEncoding=D?3001:3e3,I.setRenderTarget(T);const B=g.viewport;B!==void 0&&I.state.viewport(B),n.visible=!0},this.getRenderTarget=function(){return P},this.dispose=function(){P.dispose(),n.material.dispose()}}};let Kr=ls;fm(Kr,"ReflectorShader",{uniforms:{color:{value:null},tDiffuse:{value:null},textureMatrix:{value:null}},vertexShader:` + uniform mat4 textureMatrix; + varying vec4 vUv; + + #include + #include + + void main() { + + vUv = textureMatrix * vec4( position, 1.0 ); + + gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 ); + + #include + + }`,fragmentShader:` + uniform vec3 color; + uniform sampler2D tDiffuse; + varying vec4 vUv; + + #include + + float blendOverlay( float base, float blend ) { + + return( base < 0.5 ? ( 2.0 * base * blend ) : ( 1.0 - 2.0 * ( 1.0 - base ) * ( 1.0 - blend ) ) ); + + } + + vec3 blendOverlay( vec3 base, vec3 blend ) { + + return vec3( blendOverlay( base.r, blend.r ), blendOverlay( base.g, blend.g ), blendOverlay( base.b, blend.b ) ); + + } + + void main() { + + #include + + vec4 base = texture2DProj( tDiffuse, vUv ); + gl_FragColor = vec4( blendOverlay( base.rgb, color ), 1.0 ); + + #include + #include <${ki>=154?"colorspace_fragment":"encodings_fragment"}> + + }`});var dm=Object.defineProperty,pm=(t,e,n)=>e in t?dm(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,us=(t,e,n)=>(pm(t,typeof e!="symbol"?e+"":e,n),n);const er=new ta,hm=new Float32Array([-1,-1,0,0,0,1,-1,0,1,0,1,1,0,1,1,-1,1,0,0,1]),cs=new Wo(hm,5);er.setIndex([0,1,2,0,2,3]);er.setAttribute("position",new ei(cs,3,0,!1));er.setAttribute("uv",new ei(cs,2,3,!1));const qr=class extends Pt{constructor(){super(qr.Geometry,new Ht({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 Ni(new Uint8Array(16*16*3),16,16,Nr);n.minFilter=Lt,n.magFilter=Lt,n.wrapS=Vt,n.wrapT=Vt;const r=new Ni(new Uint8Array(16*16*3),16,16,Nr);r.minFilter=Lt,r.magFilter=Lt,r.wrapS=Vt,r.wrapT=Vt;const i=qr.Geometry,o=new ir({uniforms:{scale:{value:null},screenPosition:{value:null}},vertexShader:` + + precision highp float; + + uniform vec3 screenPosition; + uniform vec2 scale; + + attribute vec3 position; + + void main() { + + gl_Position = vec4( position.xy * scale + screenPosition.xy, screenPosition.z, 1.0 ); + + }`,fragmentShader:` + + precision highp float; + + void main() { + + gl_FragColor = vec4( 1.0, 0.0, 1.0, 1.0 ); + + }`,depthTest:!0,depthWrite:!1,transparent:!1}),a=new ir({uniforms:{map:{value:n},scale:{value:null},screenPosition:{value:null}},vertexShader:` + + precision highp float; + + uniform vec3 screenPosition; + uniform vec2 scale; + + attribute vec3 position; + attribute vec2 uv; + + varying vec2 vUV; + + void main() { + + vUV = uv; + + gl_Position = vec4( position.xy * scale + screenPosition.xy, screenPosition.z, 1.0 ); + + }`,fragmentShader:` + + precision highp float; + + uniform sampler2D map; + + varying vec2 vUV; + + void main() { + + gl_FragColor = texture2D( map, vUV ); + + }`,depthTest:!1,depthWrite:!1,transparent:!1}),s=new Pt(i,o),l=[],u=fs.Shader,c=new ir({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:fl,transparent:!0,depthWrite:!1}),f=new Pt(i,c);this.addElement=function(w){l.push(w)};const p=new Pe,d=new Pe,y=new dl,x=new At;this.onBeforeRender=function(w,k,S){w.getCurrentViewport(x);const _=x.w/x.z,R=x.z/2,P=x.w/2;let h=16/x.w;if(p.set(h*_,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(S.matrixWorldInverse),!(e.z>0)&&(t.copy(e).applyMatrix4(S.projectionMatrix),d.x=x.x+t.x*R+R-8,d.y=x.y+t.y*P+P-8,y.containsPoint(d))){w.copyFramebufferToTexture(d,n);let I=o.uniforms;I.scale.value=p,I.screenPosition.value=t,w.renderBufferDirect(S,null,i,o,s,null),w.copyFramebufferToTexture(d,r),I=a.uniforms,I.scale.value=p,I.screenPosition.value=t,w.renderBufferDirect(S,null,i,a,s,null);const v=-t.x*2,g=-t.y*2;for(let m=0,T=l.length;me in t?gm(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,ds=(t,e,n)=>(ym(t,typeof e!="symbol"?e+"":e,n),n);const Fn={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; + uniform float mieCoefficient; + uniform vec3 up; + + varying vec3 vWorldPosition; + varying vec3 vSunDirection; + varying float vSunfade; + varying vec3 vBetaR; + varying vec3 vBetaM; + varying float vSunE; + + // constants for atmospheric scattering + const float e = 2.71828182845904523536028747135266249775724709369995957; + const float pi = 3.141592653589793238462643383279502884197169; + + // wavelength of used primaries, according to preetham + const vec3 lambda = vec3( 680E-9, 550E-9, 450E-9 ); + // this pre-calcuation replaces older TotalRayleigh(vec3 lambda) function: + // (8.0 * pow(pi, 3.0) * pow(pow(n, 2.0) - 1.0, 2.0) * (6.0 + 3.0 * pn)) / (3.0 * N * pow(lambda, vec3(4.0)) * (6.0 - 7.0 * pn)) + const vec3 totalRayleigh = vec3( 5.804542996261093E-6, 1.3562911419845635E-5, 3.0265902468824876E-5 ); + + // mie stuff + // K coefficient for the primaries + const float v = 4.0; + const vec3 K = vec3( 0.686, 0.678, 0.666 ); + // MieConst = pi * pow( ( 2.0 * pi ) / lambda, vec3( v - 2.0 ) ) * K + const vec3 MieConst = vec3( 1.8399918514433978E14, 2.7798023919660528E14, 4.0790479543861094E14 ); + + // earth shadow hack + // cutoffAngle = pi / 1.95; + const float cutoffAngle = 1.6110731556870734; + const float steepness = 1.5; + const float EE = 1000.0; + + float sunIntensity( float zenithAngleCos ) { + zenithAngleCos = clamp( zenithAngleCos, -1.0, 1.0 ); + return EE * max( 0.0, 1.0 - pow( e, -( ( cutoffAngle - acos( zenithAngleCos ) ) / steepness ) ) ); + } + + vec3 totalMie( float T ) { + float c = ( 0.2 * T ) * 10E-18; + return 0.434 * c * MieConst; + } + + void main() { + + vec4 worldPosition = modelMatrix * vec4( position, 1.0 ); + vWorldPosition = worldPosition.xyz; + + gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 ); + gl_Position.z = gl_Position.w; // set z to camera.far + + vSunDirection = normalize( sunPosition ); + + vSunE = sunIntensity( dot( vSunDirection, up ) ); + + vSunfade = 1.0 - clamp( 1.0 - exp( ( sunPosition.y / 450000.0 ) ), 0.0, 1.0 ); + + float rayleighCoefficient = rayleigh - ( 1.0 * ( 1.0 - vSunfade ) ); + + // extinction (absorbtion + out scattering) + // rayleigh coefficients + vBetaR = totalRayleigh * rayleighCoefficient; + + // mie coefficients + vBetaM = totalMie( turbidity ) * mieCoefficient; + + } + `,fragmentShader:` + varying vec3 vWorldPosition; + varying vec3 vSunDirection; + varying float vSunfade; + varying vec3 vBetaR; + varying vec3 vBetaM; + varying float vSunE; + + uniform float mieDirectionalG; + uniform vec3 up; + + const vec3 cameraPos = vec3( 0.0, 0.0, 0.0 ); + + // constants for atmospheric scattering + const float pi = 3.141592653589793238462643383279502884197169; + + const float n = 1.0003; // refractive index of air + const float N = 2.545E25; // number of molecules per unit volume for air at 288.15K and 1013mb (sea level -45 celsius) + + // optical length at zenith for molecules + const float rayleighZenithLength = 8.4E3; + const float mieZenithLength = 1.25E3; + // 66 arc seconds -> degrees, and the cosine of that + const float sunAngularDiameterCos = 0.999956676946448443553574619906976478926848692873900859324; + + // 3.0 / ( 16.0 * pi ) + const float THREE_OVER_SIXTEENPI = 0.05968310365946075; + // 1.0 / ( 4.0 * pi ) + const float ONE_OVER_FOURPI = 0.07957747154594767; + + float rayleighPhase( float cosTheta ) { + return THREE_OVER_SIXTEENPI * ( 1.0 + pow( cosTheta, 2.0 ) ); + } + + float hgPhase( float cosTheta, float g ) { + float g2 = pow( g, 2.0 ); + float inverse = 1.0 / pow( 1.0 - 2.0 * g * cosTheta + g2, 1.5 ); + return ONE_OVER_FOURPI * ( ( 1.0 - g2 ) * inverse ); + } + + void main() { + + vec3 direction = normalize( vWorldPosition - cameraPos ); + + // optical length + // cutoff angle at 90 to avoid singularity in next formula. + float zenithAngle = acos( max( 0.0, dot( up, direction ) ) ); + float inverse = 1.0 / ( cos( zenithAngle ) + 0.15 * pow( 93.885 - ( ( zenithAngle * 180.0 ) / pi ), -1.253 ) ); + float sR = rayleighZenithLength * inverse; + float sM = mieZenithLength * inverse; + + // combined extinction factor + vec3 Fex = exp( -( vBetaR * sR + vBetaM * sM ) ); + + // in scattering + float cosTheta = dot( direction, vSunDirection ); + + float rPhase = rayleighPhase( cosTheta * 0.5 + 0.5 ); + vec3 betaRTheta = vBetaR * rPhase; + + float mPhase = hgPhase( cosTheta, mieDirectionalG ); + vec3 betaMTheta = vBetaM * mPhase; + + vec3 Lin = pow( vSunE * ( ( betaRTheta + betaMTheta ) / ( vBetaR + vBetaM ) ) * ( 1.0 - Fex ), vec3( 1.5 ) ); + Lin *= mix( vec3( 1.0 ), pow( vSunE * ( ( betaRTheta + betaMTheta ) / ( vBetaR + vBetaM ) ) * Fex, vec3( 1.0 / 2.0 ) ), clamp( pow( 1.0 - dot( up, vSunDirection ), 5.0 ), 0.0, 1.0 ) ); + + // nightsky + float theta = acos( direction.y ); // elevation --> y-axis, [-pi/2, pi/2] + float phi = atan( direction.z, direction.x ); // azimuth --> x-axis [-pi/2, pi/2] + vec2 uv = vec2( phi, theta ) / vec2( 2.0 * pi, pi ) + vec2( 0.5, 0.0 ); + vec3 L0 = vec3( 0.1 ) * Fex; + + // composition + solar disc + float sundisk = smoothstep( sunAngularDiameterCos, sunAngularDiameterCos + 0.00002, cosTheta ); + L0 += ( vSunE * 19000.0 * Fex ) * sundisk; + + vec3 texColor = ( Lin + L0 ) * 0.04 + vec3( 0.0, 0.0003, 0.00075 ); + + vec3 retColor = pow( texColor, vec3( 1.0 / ( 1.2 + ( 1.2 * vSunfade ) ) ) ); + + gl_FragColor = vec4( retColor, 1.0 ); + + #include + #include <${ki>=154?"colorspace_fragment":"encodings_fragment"}> + + } + `},ps=new yn({name:"SkyShader",fragmentShader:Fn.fragmentShader,vertexShader:Fn.vertexShader,uniforms:oi.clone(Fn.uniforms),side:Zs,depthWrite:!1});class hs extends Pt{constructor(){super(new sl(1,1,1),ps)}}ds(hs,"SkyShader",Fn);ds(hs,"material",ps);new Qs;new ae;new aa(0,0,0,"YXZ");new ae;var xm=Object.defineProperty,vm=(t,e,n)=>e in t?xm(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,te=(t,e,n)=>(vm(t,typeof e!="symbol"?e+"":e,n),n);const Nn=new Xs,Ro=new oa,bm=Math.cos(70*(Math.PI/180)),Co=(t,e)=>(t%e+e)%e;class wm extends Ws{constructor(e,n){super(),te(this,"object"),te(this,"domElement"),te(this,"enabled",!0),te(this,"target",new ae),te(this,"minDistance",0),te(this,"maxDistance",1/0),te(this,"minZoom",0),te(this,"maxZoom",1/0),te(this,"minPolarAngle",0),te(this,"maxPolarAngle",Math.PI),te(this,"minAzimuthAngle",-1/0),te(this,"maxAzimuthAngle",1/0),te(this,"enableDamping",!1),te(this,"dampingFactor",.05),te(this,"enableZoom",!0),te(this,"zoomSpeed",1),te(this,"enableRotate",!0),te(this,"rotateSpeed",1),te(this,"enablePan",!0),te(this,"panSpeed",1),te(this,"screenSpacePanning",!0),te(this,"keyPanSpeed",7),te(this,"zoomToCursor",!1),te(this,"autoRotate",!1),te(this,"autoRotateSpeed",2),te(this,"reverseOrbit",!1),te(this,"reverseHorizontalOrbit",!1),te(this,"reverseVerticalOrbit",!1),te(this,"keys",{LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"}),te(this,"mouseButtons",{LEFT:yt.ROTATE,MIDDLE:yt.DOLLY,RIGHT:yt.PAN}),te(this,"touches",{ONE:_t.ROTATE,TWO:_t.DOLLY_PAN}),te(this,"target0"),te(this,"position0"),te(this,"zoom0"),te(this,"_domElementKeyEvents",null),te(this,"getPolarAngle"),te(this,"getAzimuthalAngle"),te(this,"setPolarAngle"),te(this,"setAzimuthalAngle"),te(this,"getDistance"),te(this,"getZoomScale"),te(this,"listenToKeyEvents"),te(this,"stopListenToKeyEvents"),te(this,"saveState"),te(this,"reset"),te(this,"update"),te(this,"connect"),te(this,"dispose"),te(this,"dollyIn"),te(this,"dollyOut"),te(this,"getScale"),te(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=Co(L,2*Math.PI),Z=c.phi;Z<0&&(Z+=2*Math.PI),Y<0&&(Y+=2*Math.PI);let Ee=Math.abs(Y-Z);2*Math.PI-Ee{let Y=Co(L,2*Math.PI),Z=c.theta;Z<0&&(Z+=2*Math.PI),Y<0&&(Y+=2*Math.PI);let Ee=Math.abs(Y-Z);2*Math.PI-Eer.object.position.distanceTo(r.target),this.listenToKeyEvents=L=>{L.addEventListener("keydown",ne),this._domElementKeyEvents=L},this.stopListenToKeyEvents=()=>{this._domElementKeyEvents.removeEventListener("keydown",ne),this._domElementKeyEvents=null},this.saveState=()=>{r.target0.copy(r.target),r.position0.copy(r.object.position),r.zoom0=r.object.zoom},this.reset=()=>{r.target.copy(r.target0),r.object.position.copy(r.position0),r.object.zoom=r.zoom0,r.object.updateProjectionMatrix(),r.dispatchEvent(i),r.update(),l=s.NONE},this.update=(()=>{const L=new ae,Y=new ae(0,1,0),Z=new Bn().setFromUnitVectors(e.up,Y),Ee=Z.clone().invert(),Ze=new ae,ot=new Bn,Tn=2*Math.PI;return function(){const Ei=r.object.position;Z.setFromUnitVectors(e.up,Y),Ee.copy(Z).invert(),L.copy(Ei).sub(r.target),L.applyQuaternion(Z),c.setFromVector3(L),r.autoRotate&&l===s.NONE&&j(M()),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+=Tn:ht>Math.PI&&(ht-=Tn),mt<-Math.PI?mt+=Tn:mt>Math.PI&&(mt-=Tn),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=C(c.radius):c.radius=C(c.radius*p),L.setFromSpherical(c),L.applyQuaternion(Ee),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=C(rn*p);const _n=rn-nn;r.object.position.addScaledVector(I,_n),r.object.updateMatrixWorld()}else if(r.object.isOrthographicCamera){const rn=new ae(v.x,v.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 _n=new ae(v.x,v.y,0);_n.unproject(r.object),r.object.position.sub(_n).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):(Nn.origin.copy(r.object.position),Nn.direction.set(0,0,-1).transformDirection(r.object.matrix),Math.abs(r.object.up.dot(Nn.direction))u||8*(1-ot.dot(r.object.quaternion))>u?(r.dispatchEvent(i),Ze.copy(r.object.position),ot.copy(r.object.quaternion),tn=!1,!0):!1}})(),this.connect=L=>{r.domElement=L,r.domElement.style.touchAction="none",r.domElement.addEventListener("contextmenu",Ve),r.domElement.addEventListener("pointerdown",Ae),r.domElement.addEventListener("pointercancel",tt),r.domElement.addEventListener("wheel",q)},this.dispose=()=>{var L,Y,Z,Ee,Ze,ot;r.domElement&&(r.domElement.style.touchAction="auto"),(L=r.domElement)==null||L.removeEventListener("contextmenu",Ve),(Y=r.domElement)==null||Y.removeEventListener("pointerdown",Ae),(Z=r.domElement)==null||Z.removeEventListener("pointercancel",tt),(Ee=r.domElement)==null||Ee.removeEventListener("wheel",q),(Ze=r.domElement)==null||Ze.ownerDocument.removeEventListener("pointermove",je),(ot=r.domElement)==null||ot.ownerDocument.removeEventListener("pointerup",tt),r._domElementKeyEvents!==null&&r._domElementKeyEvents.removeEventListener("keydown",ne)};const r=this,i={type:"change"},o={type:"start"},a={type:"end"},s={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let l=s.NONE;const u=1e-6,c=new Ci,f=new Ci;let p=1;const d=new ae,y=new Pe,x=new Pe,w=new Pe,k=new Pe,S=new Pe,_=new Pe,R=new Pe,P=new Pe,h=new Pe,I=new ae,v=new Pe;let g=!1;const m=[],T={};function M(){return 2*Math.PI/60/60*r.autoRotateSpeed}function F(){return Math.pow(.95,r.zoomSpeed)}function j(L){r.reverseOrbit||r.reverseHorizontalOrbit?f.theta+=L:f.theta-=L}function D(L){r.reverseOrbit||r.reverseVerticalOrbit?f.phi+=L:f.phi-=L}const B=(()=>{const L=new ae;return function(Y,Z){L.setFromMatrixColumn(Z,0),L.multiplyScalar(-Y),d.add(L)}})(),X=(()=>{const L=new ae;return function(Y,Z){r.screenSpacePanning===!0?L.setFromMatrixColumn(Z,1):(L.setFromMatrixColumn(Z,0),L.crossVectors(r.object.up,L)),L.multiplyScalar(Y),d.add(L)}})(),re=(()=>{const L=new ae;return function(Y,Z){const Ee=r.domElement;if(Ee&&r.object instanceof Mt&&r.object.isPerspectiveCamera){const Ze=r.object.position;L.copy(Ze).sub(r.target);let ot=L.length();ot*=Math.tan(r.object.fov/2*Math.PI/180),B(2*Y*ot/Ee.clientHeight,r.object.matrix),X(2*Z*ot/Ee.clientHeight,r.object.matrix)}else Ee&&r.object instanceof $t&&r.object.isOrthographicCamera?(B(Y*(r.object.right-r.object.left)/r.object.zoom/Ee.clientWidth,r.object.matrix),X(Z*(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 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 E(L){Q(p/L)}function oe(L){Q(p*L)}function Me(L){if(!r.zoomToCursor||!r.domElement)return;g=!0;const Y=r.domElement.getBoundingClientRect(),Z=L.clientX-Y.left,Ee=L.clientY-Y.top,Ze=Y.width,ot=Y.height;v.x=Z/Ze*2-1,v.y=-(Ee/ot)*2+1,I.set(v.x,v.y,1).unproject(r.object).sub(r.object.position).normalize()}function C(L){return Math.max(r.minDistance,Math.min(r.maxDistance,L))}function he(L){y.set(L.clientX,L.clientY)}function we(L){Me(L),R.set(L.clientX,L.clientY)}function me(L){k.set(L.clientX,L.clientY)}function Oe(L){x.set(L.clientX,L.clientY),w.subVectors(x,y).multiplyScalar(r.rotateSpeed);const Y=r.domElement;Y&&(j(2*Math.PI*w.x/Y.clientHeight),D(2*Math.PI*w.y/Y.clientHeight)),y.copy(x),r.update()}function $(L){P.set(L.clientX,L.clientY),h.subVectors(P,R),h.y>0?E(F()):h.y<0&&oe(F()),R.copy(P),r.update()}function b(L){S.set(L.clientX,L.clientY),_.subVectors(S,k).multiplyScalar(r.panSpeed),re(_.x,_.y),k.copy(S),r.update()}function A(L){Me(L),L.deltaY<0?oe(F()):L.deltaY>0&&E(F()),r.update()}function N(L){let Y=!1;switch(L.code){case r.keys.UP:re(0,r.keyPanSpeed),Y=!0;break;case r.keys.BOTTOM:re(0,-r.keyPanSpeed),Y=!0;break;case r.keys.LEFT:re(r.keyPanSpeed,0),Y=!0;break;case r.keys.RIGHT:re(-r.keyPanSpeed,0),Y=!0;break}Y&&(L.preventDefault(),r.update())}function V(){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,Z=Math.sqrt(L*L+Y*Y);R.set(0,Z)}function ee(){r.enableZoom&&K(),r.enablePan&&z()}function ge(){r.enableZoom&&K(),r.enableRotate&&V()}function ke(L){if(m.length==1)x.set(L.pageX,L.pageY);else{const Z=pt(L),Ee=.5*(L.pageX+Z.x),Ze=.5*(L.pageY+Z.y);x.set(Ee,Ze)}w.subVectors(x,y).multiplyScalar(r.rotateSpeed);const Y=r.domElement;Y&&(j(2*Math.PI*w.x/Y.clientHeight),D(2*Math.PI*w.y/Y.clientHeight)),y.copy(x)}function fe(L){if(m.length==1)S.set(L.pageX,L.pageY);else{const Y=pt(L),Z=.5*(L.pageX+Y.x),Ee=.5*(L.pageY+Y.y);S.set(Z,Ee)}_.subVectors(S,k).multiplyScalar(r.panSpeed),re(_.x,_.y),k.copy(S)}function ye(L){const Y=pt(L),Z=L.pageX-Y.x,Ee=L.pageY-Y.y,Ze=Math.sqrt(Z*Z+Ee*Ee);P.set(0,Ze),h.set(0,Math.pow(P.y/R.y,r.zoomSpeed)),E(h.y),R.copy(P)}function Ie(L){r.enableZoom&&ye(L),r.enablePan&&fe(L)}function be(L){r.enableZoom&&ye(L),r.enableRotate&&ke(L)}function Ae(L){var Y,Z;r.enabled!==!1&&(m.length===0&&((Y=r.domElement)==null||Y.ownerDocument.addEventListener("pointermove",je),(Z=r.domElement)==null||Z.ownerDocument.addEventListener("pointerup",tt)),dt(L),L.pointerType==="touch"?ue(L):en(L))}function je(L){r.enabled!==!1&&(L.pointerType==="touch"?xe(L):U(L))}function tt(L){var Y,Z,Ee;it(L),m.length===0&&((Y=r.domElement)==null||Y.releasePointerCapture(L.pointerId),(Z=r.domElement)==null||Z.ownerDocument.removeEventListener("pointermove",je),(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;we(L),l=s.DOLLY;break;case yt.ROTATE:if(L.ctrlKey||L.metaKey||L.shiftKey){if(r.enablePan===!1)return;me(L),l=s.PAN}else{if(r.enableRotate===!1)return;he(L),l=s.ROTATE}break;case yt.PAN:if(L.ctrlKey||L.metaKey||L.shiftKey){if(r.enableRotate===!1)return;he(L),l=s.ROTATE}else{if(r.enablePan===!1)return;me(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;b(L);break}}function q(L){r.enabled===!1||r.enableZoom===!1||l!==s.NONE&&l!==s.ROTATE||(L.preventDefault(),r.dispatchEvent(o),A(L),r.dispatchEvent(a))}function ne(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;V(),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;ee(),l=s.TOUCH_DOLLY_PAN;break;case _t.DOLLY_ROTATE:if(r.enableZoom===!1&&r.enableRotate===!1)return;ge(),l=s.TOUCH_DOLLY_ROTATE;break;default:l=s.NONE}break;default:l=s.NONE}l!==s.NONE&&r.dispatchEvent(o)}function xe(L){switch(bt(L),l){case s.TOUCH_ROTATE:if(r.enableRotate===!1)return;ke(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;be(L),r.update();break;default:l=s.NONE}}function Ve(L){r.enabled!==!1&&L.preventDefault()}function dt(L){m.push(L)}function it(L){delete T[L.pointerId];for(let Y=0;Y{oe(L),r.update()},this.dollyOut=(L=F())=>{E(L),r.update()},this.getScale=()=>p,this.setScale=L=>{Q(L),r.update()},this.getZoomScale=()=>F(),n!==void 0&&this.connect(n),this.update()}}new vt;new ae;new aa;new ae;var km=Object.defineProperty,Tm=(t,e,n)=>e in t?km(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Ti=(t,e,n)=>(Tm(t,typeof e!="symbol"?e+"":e,n),n);class ms{constructor(e){Ti(this,"data"),this.data=e}generateShapes(e,n=100,r){const i=[],o={letterSpacing:0,lineHeight:1,...r},a=_m(e,n,this.data,o);for(let s=0,l=a.length;s + #include + #include + uniform float thickness; + uniform bool screenspace; + uniform vec2 size; + void main() { + #if defined (USE_SKINNING) + #include + #include + #include + #include + #include + #endif + #include + #include + #include + #include + vec4 tNormal = vec4(normal, 0.0); + vec4 tPosition = vec4(transformed, 1.0); + #ifdef USE_INSTANCING + tNormal = instanceMatrix * tNormal; + tPosition = instanceMatrix * tPosition; + #endif + if (screenspace) { + vec3 newPosition = tPosition.xyz + tNormal.xyz * thickness; + gl_Position = projectionMatrix * modelViewMatrix * vec4(newPosition, 1.0); + } else { + vec4 clipPosition = projectionMatrix * modelViewMatrix * tPosition; + vec4 clipNormal = projectionMatrix * modelViewMatrix * tNormal; + vec2 offset = normalize(clipNormal.xy) * thickness / size * clipPosition.w * 2.0; + clipPosition.xy += offset; + gl_Position = clipPosition; + } + }`,`uniform vec3 color; + uniform float opacity; + void main(){ + gl_FragColor = vec4(color, opacity); + #include + #include + }`);const Mm=["args","material-uniforms-color-value"];Kr.ReflectorShader;new ae;new ae;new ae;var Mr;/Mac/.test((Mr=globalThis==null?void 0:globalThis.navigator)===null||Mr===void 0?void 0:Mr.platform);const Am=["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"],Sm=Fe({__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:w,maxDistance:k,minZoom:S,maxZoom:_,enableZoom:R,zoomSpeed:P,enableRotate:h,touches:I,rotateSpeed:v,target:g,mouseButtons:m}=ii(r),{camera:T,renderer:M,extend:F,controls:j,invalidate:D}=Wn(),B=ia(null);F({OrbitControls:wm}),Be(B,Q=>{X(),Q&&o.value?j.value=Q:j.value=null});function X(){wr(B.value,"change",()=>{i("change",B.value),D()}),wr(B.value,"start",()=>i("start",B.value)),wr(B.value,"end",()=>i("end",B.value))}const{onBeforeRender:re}=Vn();return re(({invalidate:Q})=>{B.value&&(l.value||a.value)&&(B.value.update(),a.value&&Q())}),Ot(()=>{B.value&&B.value.dispose()}),e({instance:B}),(Q,E)=>(Q.camera||H(T))&&(Q.domElement||H(M))?(J(),ie("TresOrbitControls",{key:0,ref_key:"controlsRef",ref:B,target:H(g),"auto-rotate":H(a),"auto-rotate-speed":H(s),"enable-damping":H(l),"damping-factor":H(u),"enable-pan":H(c),"key-pan-speed":H(f),keys:Q.keys,"max-azimuth-angle":H(p),"min-azimuth-angle":H(d),"max-polar-angle":H(y),"min-polar-angle":H(x),"min-distance":H(w),"max-distance":H(k),"min-zoom":H(S),"max-zoom":H(_),touches:H(I),"enable-zoom":H(R),"zoom-speed":H(P),"enable-rotate":H(h),"rotate-speed":H(v),"mouse-buttons":H(m),args:[Q.camera||H(T),Q.domElement||H(M).domElement]},null,8,Am)):at("",!0)}});function Ln(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 No={exports:{}},Lo;function Im(){return Lo||(Lo=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 Ln=="function"&&Ln;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 Ln=="function"&&Ln,l=0;l>16),D((65280&m)>>8),D(255&m);return T==2?D(255&(m=I(v.charAt(g))<<2|I(v.charAt(g+1))>>4)):T==1&&(D((m=I(v.charAt(g))<<10|I(v.charAt(g+1))<<4|I(v.charAt(g+2))>>2)>>8&255),D(255&m)),M},y.fromByteArray=function(v){var g,m,T,M,F=v.length%3,j="";function D(B){return"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(B)}for(g=0,T=v.length-F;g>18&63)+D(M>>12&63)+D(M>>6&63)+D(63&M);switch(F){case 1:j=(j+=D((m=v[v.length-1])>>2))+D(m<<4&63)+"==";break;case 2:j=(j=(j+=D((m=(v[v.length-2]<<8)+v[v.length-1])>>10))+D(m>>4&63))+D(m<<2&63)+"="}return j}})(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,w,l,u,c,f,p,d){var y=n("base64-js"),x=n("ieee754");function w(b,A,N){if(!(this instanceof w))return new w(b,A,N);var V,z,K,ee,ge=typeof b;if(A==="base64"&&ge=="string")for(b=(ee=b).trim?ee.trim():ee.replace(/^\s+|\s+$/g,"");b.length%4!=0;)b+="=";if(ge=="number")V=re(b);else if(ge=="string")V=w.byteLength(b,A);else{if(ge!="object")throw new Error("First argument needs to be a number, array or string.");V=re(b.length)}if(w._useTypedArrays?z=w._augment(new Uint8Array(V)):((z=this).length=V,z._isBuffer=!0),w._useTypedArrays&&typeof b.byteLength=="number")z._set(b);else if(Q(ee=b)||w.isBuffer(ee)||ee&&typeof ee=="object"&&typeof ee.length=="number")for(K=0;K>8,ee=ee%256,ge.push(ee),ge.push(K);return ge}(A),b,N,V)}function _(b,A,N){var V="";N=Math.min(b.length,N);for(var z=A;z>>0)):(A+1>>0),z}function h(b,A,N,V){if(V||($(typeof N=="boolean","missing or invalid endian"),$(A!=null,"missing offset"),$(A+1>>8*(V?K:1-K)}function T(b,A,N,V,z){if(z||($(A!=null,"missing value"),$(typeof V=="boolean","missing or invalid endian"),$(N!=null,"missing offset"),$(N+3>>8*(V?K:3-K)&255}function M(b,A,N,V,z){z||($(A!=null,"missing value"),$(typeof V=="boolean","missing or invalid endian"),$(N!=null,"missing offset"),$(N+1this.length&&(V=this.length);var z=(V=b.length-A=this.length))return this[b]},w.prototype.readUInt16LE=function(b,A){return R(this,b,!0,A)},w.prototype.readUInt16BE=function(b,A){return R(this,b,!1,A)},w.prototype.readUInt32LE=function(b,A){return P(this,b,!0,A)},w.prototype.readUInt32BE=function(b,A){return P(this,b,!1,A)},w.prototype.readInt8=function(b,A){if(A||($(b!=null,"missing offset"),$(b=this.length))return 128&this[b]?-1*(255-this[b]+1):this[b]},w.prototype.readInt16LE=function(b,A){return h(this,b,!0,A)},w.prototype.readInt16BE=function(b,A){return h(this,b,!1,A)},w.prototype.readInt32LE=function(b,A){return I(this,b,!0,A)},w.prototype.readInt32BE=function(b,A){return I(this,b,!1,A)},w.prototype.readFloatLE=function(b,A){return v(this,b,!0,A)},w.prototype.readFloatBE=function(b,A){return v(this,b,!1,A)},w.prototype.readDoubleLE=function(b,A){return g(this,b,!0,A)},w.prototype.readDoubleBE=function(b,A){return g(this,b,!1,A)},w.prototype.writeUInt8=function(b,A,N){N||($(b!=null,"missing value"),$(A!=null,"missing offset"),$(A=this.length||(this[A]=b)},w.prototype.writeUInt16LE=function(b,A,N){m(this,b,A,!0,N)},w.prototype.writeUInt16BE=function(b,A,N){m(this,b,A,!1,N)},w.prototype.writeUInt32LE=function(b,A,N){T(this,b,A,!0,N)},w.prototype.writeUInt32BE=function(b,A,N){T(this,b,A,!1,N)},w.prototype.writeInt8=function(b,A,N){N||($(b!=null,"missing value"),$(A!=null,"missing offset"),$(A=this.length||(0<=b?this.writeUInt8(b,A,N):this.writeUInt8(255+b+1,A,N))},w.prototype.writeInt16LE=function(b,A,N){M(this,b,A,!0,N)},w.prototype.writeInt16BE=function(b,A,N){M(this,b,A,!1,N)},w.prototype.writeInt32LE=function(b,A,N){F(this,b,A,!0,N)},w.prototype.writeInt32BE=function(b,A,N){F(this,b,A,!1,N)},w.prototype.writeFloatLE=function(b,A,N){j(this,b,A,!0,N)},w.prototype.writeFloatBE=function(b,A,N){j(this,b,A,!1,N)},w.prototype.writeDoubleLE=function(b,A,N){D(this,b,A,!0,N)},w.prototype.writeDoubleBE=function(b,A,N){D(this,b,A,!1,N)},w.prototype.fill=function(b,A,N){if(A=A||0,N=N||this.length,$(typeof(b=typeof(b=b||0)=="string"?b.charCodeAt(0):b)=="number"&&!isNaN(b),"value is not a number"),$(A<=N,"end < start"),N!==A&&this.length!==0){$(0<=A&&A"},w.prototype.toArrayBuffer=function(){if(typeof Uint8Array>"u")throw new Error("Buffer.toArrayBuffer not supported in this browser");if(w._useTypedArrays)return new w(this).buffer;for(var b=new Uint8Array(this.length),A=0,N=b.length;A=A.length||z>=b.length);z++)A[z+N]=b[z];return z}function he(b){try{return decodeURIComponent(b)}catch{return"�"}}function we(b,A){$(typeof b=="number","cannot write a non-number as a number"),$(0<=b,"specified a negative value for writing an unsigned value"),$(b<=A,"value is larger than maximum value for type"),$(Math.floor(b)===b,"value has a fractional component")}function me(b,A,N){$(typeof b=="number","cannot write a non-number as a number"),$(b<=A,"value larger than maximum allowed value"),$(N<=b,"value smaller than minimum allowed value"),$(Math.floor(b)===b,"value has a fractional component")}function Oe(b,A,N){$(typeof b=="number","cannot write a non-number as a number"),$(b<=A,"value larger than maximum allowed value"),$(N<=b,"value smaller than minimum allowed value")}function $(b,A){if(!b)throw new Error(A||"Failed assertion")}w._augment=function(b){return b._isBuffer=!0,b._get=b.get,b._set=b.set,b.get=B.get,b.set=B.set,b.write=B.write,b.toString=B.toString,b.toLocaleString=B.toString,b.toJSON=B.toJSON,b.copy=B.copy,b.slice=B.slice,b.readUInt8=B.readUInt8,b.readUInt16LE=B.readUInt16LE,b.readUInt16BE=B.readUInt16BE,b.readUInt32LE=B.readUInt32LE,b.readUInt32BE=B.readUInt32BE,b.readInt8=B.readInt8,b.readInt16LE=B.readInt16LE,b.readInt16BE=B.readInt16BE,b.readInt32LE=B.readInt32LE,b.readInt32BE=B.readInt32BE,b.readFloatLE=B.readFloatLE,b.readFloatBE=B.readFloatBE,b.readDoubleLE=B.readDoubleLE,b.readDoubleBE=B.readDoubleBE,b.writeUInt8=B.writeUInt8,b.writeUInt16LE=B.writeUInt16LE,b.writeUInt16BE=B.writeUInt16BE,b.writeUInt32LE=B.writeUInt32LE,b.writeUInt32BE=B.writeUInt32BE,b.writeInt8=B.writeInt8,b.writeInt16LE=B.writeInt16LE,b.writeInt16BE=B.writeInt16BE,b.writeInt32LE=B.writeInt32LE,b.writeInt32BE=B.writeInt32BE,b.writeFloatLE=B.writeFloatLE,b.writeFloatBE=B.writeFloatBE,b.writeDoubleLE=B.writeDoubleLE,b.writeDoubleBE=B.writeDoubleBE,b.fill=B.fill,b.inspect=B.inspect,b.toArrayBuffer=B.toArrayBuffer,b}}).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,w=new y(x);w.fill(0),r.exports={hash:function(k,S,_,R){for(var P=S(function(m,T){m.length%x!=0&&(M=m.length+(x-m.length%x),m=y.concat([m,w],M));for(var M,F=[],j=T?m.readInt32BE:m.readInt32LE,D=0;D_?X=B(X):X.length<_&&(X=y.concat([X,R],_));for(var Q=new y(_),E=new y(_),oe=0;oe<_;oe++)Q[oe]=54^X[oe],E[oe]=92^X[oe];return re=B(y.concat([Q,re])),B(y.concat([E,re]))}(M,T,D):M(D);return F=null,j?D.toString(j):D}}}function h(){var m=[].slice.call(arguments).join(" ");throw new Error([m,"we accept pull requests","http://github.com/dominictarr/crypto-browserify"].join(` +`))}R.fill(0),i.createHash=function(m){return P(m)},i.createHmac=P,i.randomBytes=function(m,T){if(!T||!T.call)return new y(k(m));try{T.call(this,void 0,new y(k(m)))}catch(M){T(M)}};var I,v=["createCredentials","createCipher","createCipheriv","createDecipher","createDecipheriv","createSign","createVerify","createDiffieHellman","pbkdf2"],g=function(m){i[m]=function(){h("sorry,",m,"is not implemented yet")}};for(I in v)g(v[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/crypto-browserify/index.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./md5":6,"./rng":7,"./sha":8,"./sha256":9,buffer:3,lYpoI2:11}],6:[function(n,r,i){(function(o,a,s,l,u,c,f,p,d){var y=n("./helpers");function x(h,I){h[I>>5]|=128<>>9<<4)]=I;for(var v=1732584193,g=-271733879,m=-1732584194,T=271733878,M=0;M>>32-m,v)}function k(h,I,v,g,m,T,M){return w(I&v|~I&g,h,I,m,T,M)}function S(h,I,v,g,m,T,M){return w(I&g|v&~g,h,I,m,T,M)}function _(h,I,v,g,m,T,M){return w(I^v^g,h,I,m,T,M)}function R(h,I,v,g,m,T,M){return w(v^(I|~g),h,I,m,T,M)}function P(h,I){var v=(65535&h)+(65535&I);return(h>>16)+(I>>16)+(v>>16)<<16|65535&v}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,w=new Array(y),k=0;k>>((3&k)<<3)&255;return 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/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(S,_){S[_>>5]|=128<<24-_%32,S[15+(_+64>>9<<4)]=_;for(var R,P,h,I=Array(80),v=1732584193,g=-271733879,m=-1732584194,T=271733878,M=-1009589776,F=0;F>16)+(_>>16)+(R>>16)<<16|65535&R}function k(S,_){return S<<_|S>>>32-_}r.exports=function(S){return y.hash(S,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(_,R){var P=(65535&_)+(65535&R);return(_>>16)+(R>>16)+(P>>16)<<16|65535&P}function x(_,R){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),v=new Array(64);_[R>>5]|=128<<24-R%32,_[15+(R+64>>9<<4)]=R;for(var g,m,T=0;T<_.length;T+=16){for(var M=I[0],F=I[1],j=I[2],D=I[3],B=I[4],X=I[5],re=I[6],Q=I[7],E=0;E<64;E++)v[E]=E<16?_[E+T]:y(y(y((m=v[E-2],k(m,17)^k(m,19)^S(m,10)),v[E-7]),(m=v[E-15],k(m,7)^k(m,18)^S(m,3))),v[E-16]),P=y(y(y(y(Q,k(m=B,6)^k(m,11)^k(m,25)),B&X^~B&re),h[E]),v[E]),g=y(k(g=M,2)^k(g,13)^k(g,22),M&F^M&j^F&j),Q=re,re=X,X=B,B=y(D,P),D=j,j=F,F=M,M=y(P,g);I[0]=y(M,I[0]),I[1]=y(F,I[1]),I[2]=y(j,I[2]),I[3]=y(D,I[3]),I[4]=y(B,I[4]),I[5]=y(X,I[5]),I[6]=y(re,I[6]),I[7]=y(Q,I[7])}return I}var w=n("./helpers"),k=function(_,R){return _>>>R|_<<32-R},S=function(_,R){return _>>>R};r.exports=function(_){return w.hash(_,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,w,k,T){var _,R,P=8*T-k-1,h=(1<>1,v=-7,g=w?T-1:0,m=w?-1:1,T=y[x+g];for(g+=m,_=T&(1<<-v)-1,T>>=-v,v+=P;0>=-v,v+=k;0>1,g=S===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=k?0:M-1,T=k?1:-1,M=x<0||x===0&&1/x<0?1:0;for(x=Math.abs(x),isNaN(x)||x===1/0?(P=isNaN(x)?1:0,R=I):(R=Math.floor(Math.log(x)/Math.LN2),x*(k=Math.pow(2,-R))<1&&(R--,k*=2),2<=(x+=1<=R+v?g/k:g*Math.pow(2,1-v))*k&&(R++,k/=2),I<=R+v?(P=0,R=I):1<=R+v?(P=(x*k-1)*Math.pow(2,S),R+=v):(P=x*Math.pow(2,v-1)*Math.pow(2,S),R=0));8<=S;y[w+m]=255&P,m+=T,P/=256,S-=8);for(R=R<>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"]),Oo}var Bo,zo;function ys(){return zo||(zo=1,Bo=["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"]),Bo}var Ar,Uo;function Cm(){if(Uo)return Ar;Uo=1;var t=gs();return Ar=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"]),Ar}var Sr,jo;function Nm(){if(jo)return Sr;jo=1;var t=ys();return t=t.slice().filter(function(e){return!/^(gl\_|texture)/.test(e)}),Sr=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"]),Sr}var Ir,Vo;function Lm(){if(Vo)return Ir;Vo=1,Ir=R;var t=gs(),e=Rm(),n=ys(),r=Cm(),i=Nm(),o=999,a=9999,s=0,l=1,u=2,c=3,f=4,p=5,d=6,y=7,x=8,w=9,k=10,S=11,_=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"];function R(P){var h=0,I=0,v=o,g,m,T=[],M=[],F=1,j=0,D=0,B=!1,X=!1,re="",Q;P=P||{};var E=n,oe=t;P.version==="300 es"&&(E=i,oe=r);for(var Me={},C={},h=0;h0)continue;be=fe.slice(0,1).join("")}return he(be),D+=be.length,T=T.slice(be.length),T.length}while(!0)}function K(){return/[^a-fA-F0-9]/.test(g)?(he(T.join("")),v=o,h):(T.push(g),m=g,h+1)}function ee(){return g==="."||/[eE]/.test(g)?(T.push(g),v=p,m=g,h+1):g==="x"&&T.length===1&&T[0]==="0"?(v=S,T.push(g),m=g,h+1):/[^\d]/.test(g)?(he(T.join("")),v=o,h):(T.push(g),m=g,h+1)}function ge(){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)?(he(T.join("")),v=o,h):(T.push(g),m=g,h+1)}function ke(){if(/[^\d\w_]/.test(g)){var fe=T.join("");return C[fe]?v=x:Me[fe]?v=y:v=d,he(T.join("")),v=o,h}return T.push(g),m=g,h+1}}return Ir}var Rr,Ho;function Pm(){if(Ho)return Rr;Ho=1;var t=Lm();Rr=e;function e(n,r){var i=t(r),o=[];return o=o.concat(i(n)),o=o.concat(i(null)),o}return Rr}Pm();function Dm(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 Om(t){var e=Dm(t,"string");return typeof e=="symbol"?e:String(e)}function Se(t,e,n){return e=Om(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"},He,Ut;He={},Se(He,"".concat(le.normal),{"#include ":` + vec3 objectNormal = `.concat(le.normal,`; + #ifdef USE_TANGENT + vec3 objectTangent = vec3( tangent.xyz ); + #endif + `)}),Se(He,"".concat(le.position),{"#include ":` + vec3 transformed = `.concat(le.position,`; + `)}),Se(He,"".concat(le.positionRaw),{"#include ":` + vec4 csm_internal_positionUnprojected = `.concat(le.positionRaw,`; + mat4x4 csm_internal_unprojectMatrix = projectionMatrix * modelViewMatrix; + #ifdef USE_INSTANCING + csm_internal_unprojectMatrix = csm_internal_unprojectMatrix * instanceMatrix; + #endif + csm_internal_positionUnprojected = inverse(csm_internal_unprojectMatrix) * csm_internal_positionUnprojected; + vec3 transformed = csm_internal_positionUnprojected.xyz; + `)}),Se(He,"".concat(le.pointSize),{"gl_PointSize = size;":` + gl_PointSize = `.concat(le.pointSize,`; + `)}),Se(He,"".concat(le.diffuseColor),{"#include ":` + #include + diffuseColor = `.concat(le.diffuseColor,`; + `)}),Se(He,"".concat(le.fragColor),{"#include ":` + #include + gl_FragColor = `.concat(le.fragColor,`; + `)}),Se(He,"".concat(le.emissive),{"vec3 totalEmissiveRadiance = emissive;":` + vec3 totalEmissiveRadiance = `.concat(le.emissive,`; + `)}),Se(He,"".concat(le.roughness),{"#include ":` + #include + roughnessFactor = `.concat(le.roughness,`; + `)}),Se(He,"".concat(le.metalness),{"#include ":` + #include + metalnessFactor = `.concat(le.metalness,`; + `)}),Se(He,"".concat(le.ao),{"#include ":` + #include + reflectedLight.indirectDiffuse *= 1. - `.concat(le.ao,`; + `)}),Se(He,"".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(He,"".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 ); + gl_FragColor.a *= `.concat(le.depthAlpha,`; + `)});Ut={},Se(Ut,"".concat(le.position),{"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );":` + gl_Position = projectionMatrix * modelViewMatrix * vec4( `.concat(le.position,`, 1.0 ); + `)}),Se(Ut,"".concat(le.positionRaw),{"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );":` + gl_Position = `.concat(le.position,`; + `)}),Se(Ut,"".concat(le.diffuseColor),{"gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );":` + gl_FragColor = `.concat(le.diffuseColor,`; + `)}),Se(Ut,"".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 Fm=`void main() { + gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0); +}`,Bm=`#include + +void main() { + vec2 center = vec2(0., 1.); + float rotation = 0.0; + + + + float size = 0.03; + + vec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 ); + vec2 scale; + scale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) ); + scale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) ); + + bool isPerspective = isPerspectiveMatrix( projectionMatrix ); + if ( isPerspective ) scale *= - mvPosition.z; + + vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale * size; + vec2 rotatedPosition; + rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y; + rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y; + mvPosition.xy += rotatedPosition; + + gl_Position = projectionMatrix * mvPosition; +}`;const kn=new ae(0,0,0),_i=new ae(0,0,0),zm=new ae(0,0,0);function $o(t,e,n){const r=kn.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 Um(t,e){const n=kn.setFromMatrixPosition(t.matrixWorld),r=_i.setFromMatrixPosition(e.matrixWorld),i=n.sub(r),o=e.getWorldDirection(zm);return i.angleTo(o)>Math.PI/2}function jm(t,e,n,r){const i=kn.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 xs(t,e,n=""){let r="matrix3d(";for(let i=0;i!==16;i++)r+=Wr(e[i]*t.elements[i])+(i!==15?",":")");return n+r}const $m=(t=>e=>xs(e,t))([1,-1,1,1,1,-1,1,1,1,-1,1,1,1,-1,1,1]),Gm=(t=>(e,n)=>xs(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]),Ym=["geometry","material"];new sa;var Xr={exports:{}},Km=Xr.exports,Go;function qm(){return Go||(Go=1,function(t,e){(function(n,r){t.exports=r()})(Km,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,w=74*u,k=30*u,S=document.createElement("canvas");S.width=c,S.height=f,S.style.cssText="width:80px;height:48px";var _=S.getContext("2d");return _.font="bold "+9*u+"px Helvetica,Arial,sans-serif",_.textBaseline="top",_.fillStyle=o,_.fillRect(0,0,c,f),_.fillStyle=i,_.fillText(r,p,d),_.fillRect(y,x,w,k),_.fillStyle=o,_.globalAlpha=.9,_.fillRect(y,x,w,k),{dom:S,update:function(R,P){a=Math.min(a,R),s=Math.max(s,R),_.fillStyle=o,_.globalAlpha=1,_.fillRect(0,0,c,x),_.fillStyle=i,_.fillText(l(R)+" "+r+" ("+l(a)+"-"+l(s)+")",p,d),_.drawImage(S,y+u,x,w-u,k,y,x,w-u,k),_.fillRect(y+w-u,x,u,k),_.fillStyle=o,_.globalAlpha=.9,_.fillRect(y+w-u,x,u,l((1-R/P)*k))}}},n})}(Xr)),Xr.exports}qm();const Wm={key:0,args:[0,1,64]},Xm={key:1,args:[.5,1,64]},Zm={key:2},Qm=["tone-mapped","map","side","color"];new ze(16777215);const jt=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,w){return Math.min(Math.max(y,x),w)}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 w=a(x),k=10**(w+3);return Number.parseFloat((y*k/k).toFixed(w))}const l=Ue(()=>s(o(n.modelValue,n.min,n.max),n.step)),u=Ue(()=>{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,S=n.max-n.min,_=n.min+S*k,R=Math.round(_/n.step)*n.step;return Math.min(Math.max(R,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)=>(J(),ie("span",{ref_key:"sliderRef",ref:i,class:lt(["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))}}),Jm=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}=Wn(),{onBeforeRender:u}=Vn(),c=ah(),f=sh(),p=W();Be(()=>r.position,([x,w,k])=>{a.value&&a.value.scene.position.set(x,w,k)}),mn(async()=>{if(l.value)try{const x=await lh(r.model,{scene:l.value,lookAt:!0,position:r.position,onProgress:S=>i("loadModelProgress",Number.parseFloat((100*(S.loaded/S.total)).toFixed(2)))});if(!x){console.warn("No VRM model loaded");return}const w=await ih(r.idleAnimation),k=await oh(x,w);if(!k){console.warn("No VRM animation loaded");return}s.value=new gl(x.scene),s.value.clipAction(k).play(),p.value=uh(x),a.value=x,o=u(({delta:S})=>{var _,R,P;(_=s.value)==null||_.update(S),(R=a.value)==null||R.update(S),c.update(a.value,S),f.update(a.value,S),(P=p.value)==null||P.update(S)}).off}catch(x){i("error",x)}}),Ot(()=>{o==null||o(),a.value&&(a.value.scene.removeFromParent(),Dr.deepDispose(a.value.scene))}),e({setExpression(x){var w;(w=p.value)==null||w.setEmotionWithResetAfter(x,1e3)}});const{pause:d,resume:y}=Vn();return Be(()=>r.paused,x=>{x?d():y()}),(x,w)=>gn(x.$slots,"default")}}),eg=["position"],tg={absolute:"",bottom:"3",right:"3"},ng={flex:"~ row","cursor-pointer":""},rg=["checked","aria-checked"],ig={key:0,"min-w":"50vw",z:"{var x;(x=p.value)==null||x.setExpression(y)}}),(y,x)=>(J(),Xt(es,{relative:""},{default:Ye(({height:w,width:k})=>[Te(H(yl),{alpha:!0,antialias:!0,width:k,height:w},{default:Ye(()=>[Te(H(Sm)),O("TresPerspectiveCamera",{position:[a.value,s.value,l.value]},null,8,eg),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)),Te(Jm,{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]=S=>i("loadModelProgress",S)),onError:x[1]||(x[1]=S=>i("error",S))},null,8,["model","idle-animation","position","paused"])]),_:2,__:[14,15]},1032,["width","height"]),O("div",tg,[O("div",ng,[O("label",{class:lt([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]=S=>o.value=S),checked:o.value,"aria-checked":o.value,name:"showLive2DViewerInspector",type:"checkbox","appearance-none":"","outline-none":"",hidden:""},null,8,rg),[[ri,o.value]]),x[16]||(x[16]=O("div",{"select-none":""},[O("div",{"i-solar:bug-bold-duotone":""})],-1))],2)]),Te(H(ui),null,{default:Ye(()=>[o.value?(J(),ie("div",ig,[O("div",og,[O("div",ag,[O("span",null,ve(H(d)("stage.viewers.debug-menu.vrm.model.title")),1)]),Te(Di,{"h-fit":"","w-full":"",flex:"~ col",border:"~ gray/25 rounded-lg",divide:"y dashed gray/25","of-clip":"","shadow-sm":""},{label:Ye(()=>[O("span",sg,ve(H(d)("stage.viewers.debug-menu.vrm.camera")),1)]),default:Ye(()=>[O("div",lg,[x[17]||(x[17]=O("div",{text:"neutral-400 dark:neutral-500"},[O("span",null,"X")],-1)),O("label",ug,[Te(jt,{modelValue:a.value,"onUpdate:modelValue":x[3]||(x[3]=S=>a.value=S),min:-10,max:10,step:.01},null,8,["modelValue"])]),O("div",cg,[O("span",null,ve(a.value),1)]),x[18]||(x[18]=O("div",{text:"neutral-400 dark:neutral-500"},[O("span",null,"Y")],-1)),O("label",fg,[Te(jt,{modelValue:s.value,"onUpdate:modelValue":x[4]||(x[4]=S=>s.value=S),min:-10,max:10,step:.01},null,8,["modelValue"])]),O("div",dg,[O("span",null,ve(s.value),1)]),x[19]||(x[19]=O("div",{text:"neutral-400 dark:neutral-500"},[O("span",null,"Z")],-1)),O("label",pg,[Te(jt,{modelValue:l.value,"onUpdate:modelValue":x[5]||(x[5]=S=>l.value=S),min:-10,max:10,step:.01},null,8,["modelValue"])]),O("div",hg,[O("span",null,ve(l.value),1)])])]),_:1}),Te(Di,{"h-fit":"","w-full":"",flex:"~ col",border:"~ gray/25 rounded-lg",divide:"y dashed gray/25","of-clip":"","shadow-sm":""},{label:Ye(()=>[O("span",mg,ve(H(d)("stage.viewers.debug-menu.vrm.model.title")),1)]),default:Ye(()=>[O("div",gg,[x[20]||(x[20]=O("div",{text:"neutral-400 dark:neutral-500"},[O("span",null,"X")],-1)),O("label",yg,[Te(jt,{modelValue:u.value,"onUpdate:modelValue":x[6]||(x[6]=S=>u.value=S),min:-10,max:10,step:.01},null,8,["modelValue"])]),O("div",xg,[O("span",null,ve(u.value),1)]),x[21]||(x[21]=O("div",{text:"neutral-400 dark:neutral-500"},[O("span",null,"Y")],-1)),O("label",vg,[Te(jt,{modelValue:c.value,"onUpdate:modelValue":x[7]||(x[7]=S=>c.value=S),min:-10,max:10,step:.01},null,8,["modelValue"])]),O("div",bg,[O("span",null,ve(c.value),1)]),x[22]||(x[22]=O("div",{text:"neutral-400 dark:neutral-500"},[O("span",null,"Z")],-1)),O("label",wg,[Te(jt,{modelValue:f.value,"onUpdate:modelValue":x[8]||(x[8]=S=>f.value=S),min:-10,max:10,step:.01},null,8,["modelValue"])]),O("div",kg,[O("span",null,ve(f.value),1)])])]),_:1}),O("div",Tg,[O("span",null,ve(H(d)("stage.viewers.debug-menu.emotions")),1)]),O("div",_g,[O("button",{"rounded-lg":"",bg:"neutral-100/70 dark:neutral-800/50","px-2":"","py-1":"","backdrop-blur-sm":"",onClick:x[9]||(x[9]=S=>{var _;return(_=p.value)==null?void 0:_.setExpression("neutral")})},ve(H(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]=S=>{var _;return(_=p.value)==null?void 0:_.setExpression("surprised")})},ve(H(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]=S=>{var _;return(_=p.value)==null?void 0:_.setExpression("sad")})},ve(H(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]=S=>{var _;return(_=p.value)==null?void 0:_.setExpression("angry")})},ve(H(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]=S=>{var _;return(_=p.value)==null?void 0:_.setExpression("happy")})},ve(H(d)("stage.viewers.debug-menu.emotions-btn.happy")),1)])])])):at("",!0)]),_:1})])]),_:1}))}}),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(ql()),{audioContext:o,calculateVolume:a}=pa(),{onBeforeMessageComposed:s,onBeforeSend:l,onTokenLiteral:u,onTokenSpecial:c,onStreamEnd:f,streamingMessage:p,onAssistantResponseEnd:d}=St(),{process:y}=wi(),x=li(),w=W(),k=W(!1),S=W(!1),_=Dn({handlers:[E=>new Promise(oe=>{const Me=o.createBufferSource();Me.buffer=E.data.audioBuffer,Me.connect(o.destination),Me.connect(w.value),k.value=!0,Me.start(0),Me.onended=()=>{k.value=!1,oe()}})]}),R=Nl(),{ssmlEnabled:P,activeSpeechProvider:h,activeSpeechModel:I,activeSpeechVoice:v,pitch:g}=Ke(R);async function m(E){try{if(!h.value){console.warn("No active speech provider configured");return}if(!v.value){console.warn("No active speech voice configured");return}const oe=x.getProviderInstance(h.value);if(!oe){console.error("Failed to initialize speech provider");return}const Me=x.getProviderConfig(h.value),C=P.value?R.generateSSML(E.data,v.value,{...Me,pitch:g.value}):E.data,he=await Ll({...oe.speech(I.value,Me),input:C,voice:v.value.id}),we=await o.decodeAudioData(he);await _.add({audioBuffer:we,text:E.data})}catch(oe){console.error("Speech generation failed:",oe)}}const T=Dn({handlers:[m]});T.on("add",E=>{console.debug("ttsQueue added",E)});const M=Pl(T),{live2dCurrentMotion:F}=Ke(Wt()),j=Dn({handlers:[async E=>{if(r.value==="3d"){const oe=Al[E.data];if(!oe)return;await n.value.setExpression(oe)}else r.value==="2d"&&(F.value={group:Sl[E.data]})}]}),D=Dl(j);D.onHandlerEvent("emotion",E=>{console.debug("emotion detected",E)});const B=Ol();B.onHandlerEvent("delay",E=>{console.debug("delay detected",E)});function X(){requestAnimationFrame(X),k.value&&(i.value=a(w.value,"linear"))}function re(){S.value||(X(),o.resume(),S.value=!0)}function Q(){w.value||(w.value=o.createAnalyser())}return s(async()=>{Q(),re()}),l(async()=>{F.value={group:Ml}}),u(async E=>{await M.add(E)}),c(async E=>{await B.add(E),await D.add(E)}),f(async()=>{await B.add(Fl)}),d(async E=>{}),Ot(()=>{S.value=!1}),mn(async()=>{e.value=vs({connection:{bundles:Cl()}}),await e.value.execute("CREATE TABLE memory_test (vec FLOAT[768]);")}),(E,oe)=>(J(),ie("div",Mg,[O("div",Ag,[H(r)==="2d"?(J(),Xt(vh,{key:0,"mouth-open-size":H(i),"min-w":"50% (J(),ie("header",Fg,[O("div",Bg,[Te(Hl)]),Te(H(xl),{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:Ye(()=>n[0]||(n[0]=[O("div",{"i-solar:settings-minimalistic-bold-duotone":""},null,-1)])),_:1,__:[0]})]))}}),Ug="/assets/worker-BA42UcYE.js";async function jg(t,e){const n=new ArrayBuffer(44+t.length*2),r=new DataView(n);Pn(r,0,"RIFF"),r.setUint32(4,36+t.length*2,!0),Pn(r,8,"WAVE"),Pn(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),Pn(r,36,"data"),r.setUint32(40,t.length*2,!0),Vg(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 Pn(t,e,n){for(let r=0;r{Hn().then(()=>{i.update(),o.value=i.height.value})}),u(async()=>{Hn().then(()=>{i.update(),o.value=i.height.value})}),(c,f)=>{const p=ca("auto-animate");return J(),ie("div",Hg,[f[2]||(f[2]=O("div",{"flex-1":""},null,-1)),Et((J(),ie("div",{ref_key:"chatHistoryRef",ref:e,"h-full":"","w-full":"",flex:"~ col","overflow-scroll":""},[f[1]||(f[1]=O("div",{"flex-1":""},null,-1)),(J(!0),ie(ai,null,si(H(n),(d,y)=>(J(),ie("div",{key:y,"mb-2":""},[d.role==="error"?(J(),ie("div",$g,[O("div",Gg,[O("div",Yg,[O("div",Kg,[O("span",qg,ve(H(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))]),H(r)&&y===H(n).length-1?(J(),ie("div",Wg)):(J(),ie("div",{key:1,class:"markdown-content break-words text-violet-500",text:"base {if(!T||!T.trim())return;const M=a.getProviderConfig(s.value);await x(T,{chatProvider:a.getProviderInstance(s.value),model:l.value,providerConfig:M})}});async function h(){if(!(!e.value.trim()||o.value))try{const T=a.getProviderConfig(s.value);await x(e.value,{chatProvider:a.getProviderInstance(s.value),model:l.value,providerConfig:T})}catch(T){k.value.pop(),k.value.push({role:"error",content:T.message})}}const{destroy:I,start:v}=Xa(y,{onSpeechStart:()=>{n.value=!0},onVADMisfire:()=>{n.value=!1},onSpeechEnd:T=>{n.value=!1,g(T)},auto:!1});async function g(T){await S.resume();const M=await jg(T,S.sampleRate);R({type:"generate",data:{audio:M,language:"en"}})}async function m(T){const M=T.target,F=c.value.find(j=>j.deviceId===M.value);if(!F){p.value=void 0;return}p.value=F}return Be(d,async T=>{T==="false"&&(I(),P())}),Be(i,async T=>{T&&await f()}),mn(()=>{v()}),w(async()=>{e.value=""}),(T,M)=>(J(),ie("div",ly,[O("fieldset",uy,[O("label",{class:lt([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 ":H(u)}]),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":M[0]||(M[0]=F=>r.value=F),type:"radio",name:"tab",value:"chat",hidden:""},null,512),[[or,r.value]]),M[7]||(M[7]=O("div",{"i-solar:dialog-2-bold-duotone":"",text:"2xl",transform:"translate-y--2"},null,-1)),O("div",fy,[O("span",dy,ve(H(_)("stage.chat.tabs.chat")),1)])],10,cy),O("label",{class:lt([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 ":H(u)}]),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":M[1]||(M[1]=F=>r.value=F),type:"radio",name:"tab",value:"custom",hidden:""},null,512),[[or,r.value]]),M[8]||(M[8]=O("div",{"i-solar:star-fall-2-bold-duotone":"",text:"2xl",transform:"translate-y--2"},null,-1)),O("div",hy,[O("span",null,ve(H(_)("stage.chat.tabs.custom")),1)])],10,py),O("label",{class:lt([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 ":H(u)}]),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":M[2]||(M[2]=F=>r.value=F),type:"radio",name:"tab",value:"clothes",hidden:""},null,512),[[or,r.value]]),M[9]||(M[9]=O("div",{"i-solar:magic-stick-3-bold-duotone":"",text:"2xl",transform:"translate-y--2"},null,-1)),O("div",gy,[O("span",null,ve(H(_)("stage.chat.tabs.clothes")),1)])],10,my)]),O("div",yy,[O("div",xy,[Te(sy,{"h-full":"","flex-1":"","p-4":"",w:"full","max-h":"e.value=F),placeholder:H(_)("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:lt({"transition-colors-none placeholder:transition-colors-none":H(u)}),onSubmit:h,onCompositionstart:M[4]||(M[4]=F=>o.value=!0),onCompositionend:M[5]||(M[5]=F=>o.value=!1)},null,8,["modelValue","placeholder","class"])])])]),O("div",by,[O("div",wy,[Te(H(ui),null,{default:Ye(()=>[i.value?(J(),ie("fieldset",ky,[(J(!0),ie(ai,null,si(H(c),(F,j)=>(J(),ie("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:m},null,40,Ty),O("div",_y,[O("div",Ey,[F.deviceId===H(y)?(J(),ie("div",My)):at("",!0)]),O("span",{"inline-block":"",class:lt([F.deviceId===H(y)?"cyan-400 dark:text-white":"cyan-400/50 dark:text-white/50"]),transition:"all duration-250 ease-in-out"},ve(F.label),3)])]))),128))])):at("",!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:lt({"transition-colors-none":H(u)}),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":M[6]||(M[6]=F=>i.value=F),type:"checkbox",hidden:""},null,512),[[ri,i.value]]),M[10]||(M[10]=O("div",{"i-solar:microphone-2-bold-duotone":""},null,-1)),O("div",null,[n.value?(J(),ie("span",Sy,"Listening...")):(J(),ie("span",Ay,ve(H(_)("settings.microphone")),1))])],2)])])]))}}),Ry=xn(Iy,[["__scopeId","data-v-5b585ca8"]]),Cy={py:"1",flex:"~ col",rounded:"lg","overflow-hidden":""},Ny={key:0,flex:"",mr:"12"},Ly={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":"","backdrop-blur-sm":"",h:"unset {Hn().then(()=>{i.update(),o.value=i.height.value})}),l(async()=>{Hn().then(()=>{i.update(),o.value=i.height.value})}),(u,c)=>{const f=ca("auto-animate");return J(),ie("div",Cy,[c[1]||(c[1]=O("div",{"flex-1":""},null,-1)),Et((J(),ie("div",{ref_key:"chatHistoryRef",ref:e,"h-full":"","w-full":"","max-h":"30vh",flex:"~ col","overflow-scroll":"",class:"chat-history"},[c[0]||(c[0]=O("div",{"flex-1":""},null,-1)),(J(!0),ie(ai,null,si(H(r),(p,d)=>(J(),ie("div",{key:d,"mb-2":""},[p.role==="assistant"?(J(),ie("div",Ny,[O("div",Ly,[O("div",null,[O("span",Py,ve(H(n)("stage.chat.message.character-name.airi")),1)]),p.content?(J(),ie("div",{key:0,class:"markdown-content",text:"base {n.value=!0},onVADMisfire:()=>{n.value=!1},onSpeechEnd:k=>{n.value=!1,w()},auto:!1});function w(k){alert("Transcription is not implemented yet")}return Be(s,async k=>{k==="false"&&y()}),f(async()=>{e.value=""}),mn(()=>{x()}),(k,S)=>(J(),ie("div",null,[O("div",$y,[Te(Hy,{absolute:"","left-0":"","top-0":"",transform:"translate-y-[-100%]","w-full":""}),O("div",Gy,[Te(H(da),{modelValue:e.value,"onUpdate:modelValue":S[0]||(S[0]=_=>e.value=_),placeholder:H(p)("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:lt({"transition-colors-none placeholder:transition-colors-none":H(u)}),onSubmit:d,onCompositionstart:S[1]||(S[1]=_=>r.value=!0),onCompositionend:S[2]||(S[2]=_=>r.value=!1)},null,8,["modelValue","placeholder","class"])])])]))}}),Ky={class:"relative"},qy={absolute:"","left-0":"","right-0":"","top-0":"","w-full":"","overflow-hidden":""},Wy=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 w=[],S=Math.ceil(f/y)*y,_=1,R=x==="up"?d:p-d;w.push(`M 0 ${R}`);const P=Math.PI*2/y;for(let I=0;I<=S;I+=_){const v=d*Math.sin(P*I),g=x==="up"?R-v:R+v;w.push(`L ${I} ${g}`)}const h=x==="up"?p:0;return w.push(`L ${S} ${h}`),w.push(`L 0 ${h} Z`),w.join(" ")}const u=Ue(()=>n.value+r.value*2),c=Ue(()=>{const f=` + + `;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)=>(J(),ie("div",Ky,[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)])]))}}),Xy=xn(Wy,[["__scopeId","data-v-d4cf94d8"]]),Zy={relative:"",flex:"~ col","z-2":"","h-100dvh":"","w-100vw":"","of-hidden":""},Qy={relative:"",flex:"~ 1 row gap-y-0 gap-x-2 (J(),Xt(Og,null,{default:Ye(()=>[Te(Xy,{"fill-color":H(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:Ye(()=>[O("div",Zy,[O("div",null,[Te(zg,{class:"flex",p2:""})]),O("div",Qy,[Te(H(Ng),{"flex-1":"","min-w":"1/2",paused:n.value},null,8,["paused"]),Te(Ry,{class:"flex {const n=s.options.find(f=>f.value===p.value);return n?n.label:s.placeholder});function $(n){p.value=n}return(n,f)=>(i(),T(r(se),{"auto-size":"","auto-boundary-max-size":""},{popper:z(({hide:g})=>[a("div",ce,[(i(!0),c(A,null,F(s.options,d=>(i(),c("div",K({ref_for:!0},{...n.$attrs,class:null,style:null},{key:d.value,class:["cursor-pointer rounded px-2 py-1.5 text-sm text-neutral-700 hover:bg-neutral-100 dark:text-neutral-200 dark:hover:bg-neutral-800",{"bg-neutral-100 dark:bg-neutral-800":p.value===d.value}],onClick:b=>{$(d.value),g()}}),u(d.label),17,me))),128))])]),default:z(()=>[a("div",{class:E(["min-w-[160px] flex cursor-pointer items-center justify-between gap-2 border rounded-lg bg-white p-2.5 text-xs text-neutral-700 shadow-sm outline-none transition-colors disabled:cursor-not-allowed dark:border-neutral-800 dark:bg-neutral-900 disabled:bg-neutral-100 hover:bg-neutral-50 dark:text-neutral-200 disabled:text-neutral-400 focus:ring-2 focus:ring-black/10 dark:disabled:bg-neutral-800 dark:hover:bg-neutral-800 dark:disabled:text-neutral-600",{"pointer-events-none":s.disabled}])},[a("div",ue,[G(n.$slots,"default",{label:y.value},()=>[H(u(y.value),1)])]),f[0]||(f[0]=a("div",{"i-solar:alt-arrow-down-bold-duotone":"",class:"h-3.5 w-3.5 text-neutral-500 dark:text-neutral-400"},null,-1))],2)]),_:3}))}}),fe={"rounded-xl":"","p-4":"",flex:"~ col gap-4"},ve={flex:"~ row","flex-wrap":"","items-center":"","justify-between":"","gap-4":""},xe={class:"relative min-w-[200px] flex-1","inline-flex":"~","w-full":"","items-center":""},ge=["placeholder"],be={class:"relative flex flex-row justify-start gap-2 lg:flex-col"},_e={class:"top-[-32px] whitespace-nowrap text-sm text-neutral-500 leading-10 lg:absolute dark:text-neutral-400"},ke={key:0,flex:"","flex-col":"","items-center":""},ye={"font-medium":"",text:"neutral-600 dark:neutral-300"},we={text:"neutral-500 dark:neutral-400","mt-2":"","text-sm":""},he={key:1,flex:"","flex-col":"","items-center":""},Ce={"font-medium":"",text:"primary-600 dark:primary-300"},Ve={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"},$e={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"},De={class:"flex flex-col"},Se={class:"font-medium"},ze={class:"text-sm text-amber-600 dark:text-amber-400"},Ae={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":""},Ne=q({__name:"index",setup(V){const{t:s}=Z(),p=re(),{addCard:y,removeCard:$}=p,{cards:n,activeCardId:f}=ee(p),g=x(""),d=x(!1),b=x(""),_=x("nameAsc"),D=x([]);te(D,async l=>{const e=l[0];if(e)try{const o=await e.text(),m=JSON.parse(o);g.value=y(m),d.value=!0}catch(o){console.error("Error processing card file:",o)}});const N=C(()=>Array.from(n.value.entries()).map(([l,e])=>({id:l,name:e.name,description:e.description}))),I=C(()=>{if(!b.value)return N.value;const l=b.value.toLowerCase();return N.value.filter(e=>e.name.toLowerCase().includes(l)||e.description&&e.description.toLowerCase().includes(l))}),j=C(()=>{const l=[...I.value];return _.value==="nameAsc"?l.sort((e,o)=>e.name.localeCompare(o.name)):_.value==="nameDesc"?l.sort((e,o)=>o.name.localeCompare(e.name)):_.value==="recent"?l.sort((e,o)=>o.id.localeCompare(e.id)):l}),w=x(!1),v=x(null);function J(){v.value&&($(v.value),v.value=null,w.value=!1)}function P(l){v.value=l,w.value=!0}function Q(l){g.value=l,d.value=!0}function R(l){f.value=l}function W(l){const e=n.value.get(l);return(e==null?void 0:e.version)||"1.0.0"}function B(l,e){var t,k,L,M;const o=n.value.get(l);if(!o||!((k=(t=o.extensions)==null?void 0:t.airi)!=null&&k.modules))return"default";const m=o.extensions.airi.modules;return e==="consciousness"?(L=m.consciousness)!=null&&L.model&&m.consciousness.model.split("-").pop()||"default":e==="voice"&&((M=m.speech)==null?void 0:M.voice_id)||"default"}return(l,e)=>{var m;const o=ae("motion");return i(),c(A,null,[a("div",fe,[a("div",ve,[a("div",xe,[e[6]||(e[6]=a("div",{class:"pointer-events-none absolute inset-y-0 left-0 flex items-center pl-3"},[a("div",{"i-solar:magnifer-line-duotone":"",class:"text-neutral-500 dark:text-neutral-400"})],-1)),O(a("input",{"onUpdate:modelValue":e[0]||(e[0]=t=>b.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(s)("settings.pages.card.search")},null,8,ge),[[le,b.value]])]),a("div",be,[a("div",_e,u(r(s)("settings.pages.card.sort_by"))+": ",1),h(pe,{modelValue:_.value,"onUpdate:modelValue":e[1]||(e[1]=t=>_.value=t),options:[{value:"nameAsc",label:r(s)("settings.pages.card.name_asc")},{value:"nameDesc",label:r(s)("settings.pages.card.name_desc")},{value:"recent",label:r(s)("settings.pages.card.recent")}],placeholder:"Select sort option",class:"min-w-[150px]"},null,8,["modelValue","options"])])]),a("div",{class:E(["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(n).size>0}])},[h(r(oe),{modelValue:D.value,"onUpdate:modelValue":e[2]||(e[2]=t=>D.value=t),accept:"*.json"},{default:z(({isDragging:t})=>[t?(i(),c("div",he,[e[8]||(e[8]=a("div",{"i-solar:upload-minimalistic-bold":"",class:"mb-2 text-5xl text-primary-500 dark:text-primary-400"},null,-1)),a("p",Ce,u(r(s)("settings.pages.card.drop_here")),1)])):(i(),c("div",ke,[e[7]||(e[7]=a("div",{"i-solar:upload-square-line-duotone":"","mb-4":"","text-5xl":"",text:"neutral-400 dark:neutral-500"},null,-1)),a("p",ye,u(r(s)("settings.pages.card.upload")),1),a("p",we,u(r(s)("settings.pages.card.upload_desc")),1)]))]),_:1},8,["modelValue"]),r(n).size>0?(i(!0),c(A,{key:0},F(j.value,t=>(i(),T(ie,{id:t.id,key:t.id,name:t.name,description:t.description,"is-active":t.id===r(f),"is-selected":t.id===g.value&&d.value,version:W(t.id),"consciousness-model":B(t.id,"consciousness"),"voice-model":B(t.id,"voice"),onSelect:k=>Q(t.id),onActivate:k=>R(t.id),onDelete:k=>P(t.id)},null,8,["id","name","description","is-active","is-selected","version","consciousness-model","voice-model","onSelect","onActivate","onDelete"]))),128)):S("",!0),r(n).size===0?(i(),c("div",Ve,[e[9]||(e[9]=a("div",{"i-solar:card-search-broken":"","mx-auto":"","mb-3":"","text-6xl":"","text-neutral-400":""},null,-1)),a("p",null,u(r(s)("settings.pages.card.no_cards")),1)])):S("",!0),b.value&&j.value.length===0?(i(),c("div",$e,[e[10]||(e[10]=a("div",{"i-solar:info-circle-line-duotone":"",class:"text-2xl text-amber-500 dark:text-amber-400"},null,-1)),a("div",De,[a("span",Se,u(r(s)("settings.pages.card.no_results")),1),a("span",ze,u(r(s)("settings.pages.card.try_different_search")),1)])])):S("",!0)],2)]),h(de,{modelValue:w.value,"onUpdate:modelValue":e[3]||(e[3]=t=>w.value=t),"card-name":v.value?(m=r(p).getCard(v.value))==null?void 0:m.name:"",onConfirm:J,onCancel:e[4]||(e[4]=t=>v.value=null)},null,8,["modelValue","card-name"]),h(ne,{modelValue:d.value,"onUpdate:modelValue":e[5]||(e[5]=t=>d.value=t),"card-id":g.value},null,8,["modelValue","card-id"]),O((i(),c("div",Ae,e[11]||(e[11]=[a("div",{text:"60","i-solar:emoji-funny-square-bold-duotone":""},null,-1)]))),[[o]])],64)}}});typeof U=="function"&&U(Ne);export{Ne as default}; diff --git a/assets/index-DfQN29KQ.js b/assets/index-DfQN29KQ.js deleted file mode 100644 index 3d807ea4a6c6521988364fd67a1959a8c9356806..0000000000000000000000000000000000000000 --- a/assets/index-DfQN29KQ.js +++ /dev/null @@ -1 +0,0 @@ -import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-BQHOFrhO.js";import{d as h,$ as v,f as k,c5 as _,c as t,o as i,a as c,ac as d,ae as m,c6 as l,c7 as b,u as s}from"./index-CNH1g_GM.js";import"./three-vrm-animation.module-B_hGdUpX.js";import"./mcp-B7-jaCfZ.js";import"./emotions-DWNSb738.js";import{I as x}from"./IconStatusItem-Co6qJ9yZ.js";import"./Select.vue_vue_type_style_index_0_lang-BIffysKh.js";import{_ as I}from"./IconAnimation.vue_vue_type_script_setup_true_lang-DSobYOgR.js";import{u as z}from"./useIconAnimation-Df247suB.js";import{b as g}from"./route-block-B_A1xBdJ.js";import"./floating-ui.core-CgBsuaUc.js";const B={grid:"~ cols-1 sm:cols-2 gap-4"},w={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":""},A=h({__name:"index",setup(C){const{t:e}=v(),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:u,showIconAnimation:f,animationIcon:y}=z("i-solar:layers-bold-duotone");return(D,n)=>{const r=_("motion");return i(),t(l,null,[c("div",B,[(i(!0),t(l,null,b(p.value,(o,a)=>m((i(),d(s(x),{key:o.id,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+a*10,delay:a*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"])),[[r]])),128))]),s(f)?(i(),d(I,{key:0,icon:s(y),"icon-size":12,duration:1e3,started:s(u),"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",w,n[0]||(n[0]=[c("div",{text:"60","i-solar:layers-bold-duotone":""},null,-1)]))),[[r]])],64)}}});typeof g=="function"&&g(A);export{A as default}; diff --git a/assets/index-CcwV4B8o.js b/assets/index-DfgZBT6L.js similarity index 69% rename from assets/index-CcwV4B8o.js rename to assets/index-DfgZBT6L.js index 88578725efdde6b47b5cdc1ad47c8aec79f1842c..ee317a9c6aba6fb3459035f31a77f28d3b18b273 100644 --- a/assets/index-CcwV4B8o.js +++ b/assets/index-DfgZBT6L.js @@ -1 +1 @@ -import{d as i,c5 as n,ae as a,o as r,c as s,a as c}from"./index-CNH1g_GM.js";import{b as t}from"./route-block-B_A1xBdJ.js";const l={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":""},d=i({__name:"index",setup(m){return(p,e)=>{const o=n("motion");return a((r(),s("div",l,e[0]||(e[0]=[c("div",{text:"60","i-solar:leaf-bold-duotone":""},null,-1)]))),[[o]])}}});typeof t=="function"&&t(d);export{d as default}; +import{d as i,c5 as n,bm as r,o as a,c as s,a as c}from"./index-B06xwjXa.js";import{b as t}from"./route-block-B_A1xBdJ.js";const l={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":""},d=i({__name:"index",setup(m){return(p,e)=>{const o=n("motion");return r((a(),s("div",l,e[0]||(e[0]=[c("div",{text:"60","i-solar:leaf-bold-duotone":""},null,-1)]))),[[o]])}}});typeof t=="function"&&t(d);export{d as default}; diff --git a/assets/index-Dt5Zr-vu.js b/assets/index-Dt5Zr-vu.js deleted file mode 100644 index e0588a93f667c833929a5a01710ea50b702d5f11..0000000000000000000000000000000000000000 --- a/assets/index-Dt5Zr-vu.js +++ /dev/null @@ -1 +0,0 @@ -import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-BQHOFrhO.js";import{d as I,a2 as E,ac as x,o as n,ad as A,a as s,c as p,W as w,a9 as D,Y as C,X as P,bZ as R,V as L,e as r,$ as V,ab as j,f as q,c5 as N,ae as _,c6 as F,c7 as O,u as y,a3 as W,_ as X}from"./index-CNH1g_GM.js";import"./three-vrm-animation.module-B_hGdUpX.js";import"./mcp-B7-jaCfZ.js";import"./emotions-DWNSb738.js";import"./Select.vue_vue_type_style_index_0_lang-BIffysKh.js";import{_ as Y}from"./IconAnimation.vue_vue_type_script_setup_true_lang-DSobYOgR.js";import{b as $}from"./route-block-B_A1xBdJ.js";import"./floating-ui.core-CgBsuaUc.js";const Z={"z-1":"","flex-1":""},G={"text-lg":"","font-thin":"",class:"menu-icon-item-title",transition:"all ease-in-out duration-400"},H={text:"sm neutral-500 dark:neutral-400",class:"menu-icon-item-description",transition:"all ease-in-out duration-400"},J=I({__name:"IconItem",props:{title:null,description:null,icon:null,iconTemplate:{type:Boolean},to:null},setup(i){return(m,g)=>{const f=E("RouterLink");return n(),x(f,{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:i.to},{default:A(()=>[s("div",Z,[s("div",G,C(i.title),1),s("div",H,[s("span",null,C(i.description),1)])]),typeof i.icon=="string"?(n(),p("div",{key:0,class:P(["menu-icon-item-icon",[i.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),i.iconTemplate?D(m.$slots,"icon",{key:1},void 0,!0):w("",!0)]),_:3},8,["to"])}}}),K=R(J,[["__scopeId","data-v-b1037d36"]]),M={flex:"~ col gap-4","font-thin":""},Q={flex:"~ col gap-4"},U={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":""},tt={text:"60","i-solar:settings-bold-duotone":""},et=I({__name:"index",setup(i){const m=L(),g=r(!1),f=r(),c=r(),{t}=V(),h=r(""),b=r(""),k=r(!1),d=j();function S(){var a;(a=c.value)==null||a.call(c)}async function T(a,l){const e=a.currentTarget.querySelector(".menu-icon-item-icon");if(!e)return;const u=e.getBoundingClientRect(),v=`${u.left}px, ${u.top}px`;h.value=l.icon,b.value=v,k.value=!0,await X(),g.value=!0}const z=m.beforeEach(async(a,l,o)=>{if(!d.usePageSpecificTransitions||d.disableTransitions){o();return}await new Promise(e=>{c.value=e}),z(),o()}),B=q(()=>[{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(a,l)=>{const o=N("motion");return n(),p("div",M,[l[0]||(l[0]=s("div",null,null,-1)),s("div",Q,[(n(!0),p(F,null,O(B.value,(e,u)=>_((n(),x(y(K),{key:e.to,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250,style:W({transitionDelay:`${u*50}ms`}),title:e.title,description:e.description,icon:e.icon,to:e.to,onClick:v=>T(v,e)},null,8,["style","title","description","icon","to","onClick"])),[[o]])),128))]),k.value&&!y(d).disableTransitions&&y(d).usePageSpecificTransitions?(n(),x(Y,{key:0,ref_key:"iconAnimation",ref:f,icon:h.value,"icon-size":6*1.2,position:b.value,duration:1e3,"text-color":"text-neutral-400/50 dark:text-neutral-600/20",started:g.value,onAnimationEndedOnce:S},null,8,["icon","position","started"])):_((n(),p("div",U,[_(s("div",tt,null,512),[[o]])])),[[o]])])}}});typeof $=="function"&&$(et);export{et as default}; diff --git a/assets/index-DvJoTzhu.js b/assets/index-DvJoTzhu.js new file mode 100644 index 0000000000000000000000000000000000000000..51154f62fe8175ef7e8deef4644a60b955c4d359 --- /dev/null +++ b/assets/index-DvJoTzhu.js @@ -0,0 +1 @@ +import{u as d}from"./useIconAnimation-BxWVl-bV.js";import{d as u,a2 as p,c5 as f,c as n,o as e,a as i,bk as v,bm as x,u as o,c6 as _}from"./index-B06xwjXa.js";import{b as r}from"./route-block-B_A1xBdJ.js";import"./three-vrm.module-CtuEk7GG.js";import"./emotions-DWNSb738.js";import"./mcp-BfXpaYZf.js";const k={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":""},y=u({__name:"index",setup(b){const{iconAnimationStarted:a,showIconAnimation:s,animationIcon:c}=d("i-solar:armchair-2-bold-duotone");return(h,t)=>{const l=p("IconAnimation"),m=f("motion");return e(),n(_,null,[t[1]||(t[1]=i("div",null," Scene ",-1)),o(s)?(e(),v(l,{key:0,"z-index":-1,icon:o(c),"icon-size":12,duration:1e3,started:o(a),"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"])):x((e(),n("div",k,t[0]||(t[0]=[i("div",{text:"60","i-solar:armchair-2-bold-duotone":""},null,-1)]))),[[m]])],64)}}});typeof r=="function"&&r(y);export{y as default}; diff --git a/assets/index-J0h9UsXc.js b/assets/index-J0h9UsXc.js new file mode 100644 index 0000000000000000000000000000000000000000..5cb8e4a93bbdba4b73c16424279db77c0bc7b906 --- /dev/null +++ b/assets/index-J0h9UsXc.js @@ -0,0 +1 @@ +import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-Du5e5QRV.js";import{d as h,$ as v,f as b,c5 as k,c as t,o as i,a as c,bk as d,bm as m,c6 as l,c7 as _,u as s}from"./index-B06xwjXa.js";import"./three-vrm.module-CtuEk7GG.js";import"./emotions-DWNSb738.js";import"./mcp-BfXpaYZf.js";import{I as x}from"./IconStatusItem-CntkxYB2.js";import"./Select.vue_vue_type_style_index_0_lang-CzS20kE7.js";import{_ as I}from"./IconAnimation.vue_vue_type_script_setup_true_lang-_yAijtHg.js";import{u as z}from"./useIconAnimation-BxWVl-bV.js";import{b as g}from"./route-block-B_A1xBdJ.js";import"./floating-ui.core-CgBsuaUc.js";const B={grid:"~ cols-1 sm:cols-2 gap-4"},w={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":""},A=h({__name:"index",setup(C){const{t:e}=v(),p=b(()=>[{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:u,showIconAnimation:f,animationIcon:y}=z("i-solar:layers-bold-duotone");return(D,n)=>{const r=k("motion");return i(),t(l,null,[c("div",B,[(i(!0),t(l,null,_(p.value,(o,a)=>m((i(),d(s(x),{key:o.id,initial:{opacity:0,y:10},enter:{opacity:1,y:0},duration:250+a*10,delay:a*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"])),[[r]])),128))]),s(f)?(i(),d(I,{key:0,icon:s(y),"icon-size":12,duration:1e3,started:s(u),"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",w,n[0]||(n[0]=[c("div",{text:"60","i-solar:layers-bold-duotone":""},null,-1)]))),[[r]])],64)}}});typeof g=="function"&&g(A);export{A as default}; diff --git a/assets/index-R-df0ppj.js b/assets/index-R-df0ppj.js deleted file mode 100644 index 713342bded0c70bb8f36c5955a4d3561ae6366c6..0000000000000000000000000000000000000000 --- a/assets/index-R-df0ppj.js +++ /dev/null @@ -1 +0,0 @@ -import{d as A,ce as _,cf as F,c as r,o,ae as a,a as e,b as m,af as V,cg as h,W as U,Y as u,ad as g,X as x,ck as H,ab as M,ca as O,$ as P,e as j,w as N,c5 as z,ac as b,aP as R,u as i,cl as I,cc as L,c6 as k,c7 as W,bZ as X}from"./index-CNH1g_GM.js";import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-BQHOFrhO.js";import"./three-vrm-animation.module-B_hGdUpX.js";import"./mcp-B7-jaCfZ.js";import"./emotions-DWNSb738.js";import"./Select.vue_vue_type_style_index_0_lang-BIffysKh.js";import{_ as C,a as Y}from"./ColorPalette.vue_vue_type_script_setup_true_lang-YJhFyDzq.js";import{b as D}from"./route-block-B_A1xBdJ.js";import"./floating-ui.core-CgBsuaUc.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-dwKULsMl.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-DLt6RcnD.js";import"./index-5YeHuuyL.js";const Z={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"},q=["aria-checked"],G={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(c,y)=>(o(),r("label",Z,[a(e("input",{"onUpdate:modelValue":y[0]||(y[0]=v=>n.value=v),"aria-checked":n.value,type:"checkbox",hidden:""},null,8,q),[[V,n.value]]),e("div",null,[h(u(c.$t(p.text))+" ",1),p.description?(o(),r("div",G,u(c.$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})]))}}),J=[[],["#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"]],K={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"},Q={value:"en-US"},ee={value:"zh-CN"},te={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"},ie={"text-lg":"","font-semibold":""},ne={relative:"",flex:"","cursor-pointer":"","items-center":"","gap-2":""},ae=["disabled"],oe={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"},se={"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"},le={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"},re=["duration","delay"],de={"font-medium":""},ue={text:"sm neutral-500"},pe={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":""},w=A({__name:"index",setup(p){const n=M(),c=O(),{t:y}=P(),v=j(!1);return N(()=>[n.usePageSpecificTransitions,n.disableTransitions],()=>{v.value=!0}),(d,t)=>{const s=z("motion");return o(),r(k,null,[a((o(),b(i(C),{title:i(y)("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(c),"onUpdate:modelValue":t[0]||(t[0]=l=>R(c)?c.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",K,[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",Q,u(d.$t("settings.language.english")),1),e("option",ee,u(d.$t("settings.language.chinese")),1)],512),[[I,i(n).language]])])),[[s]])]),_:1},8,["title"])),[[s]]),a((o(),b(i(C),{title:i(y)("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",te,[e("span",ie,u(d.$t("settings.pages.themes.sections.section.custom-color.fields.field.primary-color.label")),1),e("label",ne,[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:"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 peer-checked:bg-primary-500 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,ae),[[L,i(n).themeColorsHue],[s]]),a((o(),r("div",oe,[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",se,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",le,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(),b(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(k,null,W(d.$tm("settings.pages.themes.sections.section.theme-presets.presets"),({title:l,description:$,colors:E},f)=>a((o(),r("div",{key:f,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+f*10,delay:11*50+f*50,transition:"all ease-in-out duration-250"},[e("div",null,[e("span",de,u(d.$rt(l)),1),e("div",ue,u(d.$rt($)),1)]),m(Y,{colors:E.map((T,S)=>({hex:i(J)[f][S],name:d.$rt(T)}))},null,8,["colors"])],8,re)),[[s]])),128))]),_:1})),[[s]]),a((o(),b(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",pe,t[15]||(t[15]=[e("div",{text:"60","i-solar:filters-bold-duotone":""},null,-1)]))),[[s]])],64)}}});typeof D=="function"&&D(w);const De=X(w,[["__scopeId","data-v-aa1dd799"]]);export{De as default}; diff --git a/assets/index-YGbSHw2g.js b/assets/index-YGbSHw2g.js new file mode 100644 index 0000000000000000000000000000000000000000..ea236711eba3d52dee4355a99884e616e06e6213 --- /dev/null +++ b/assets/index-YGbSHw2g.js @@ -0,0 +1 @@ +import{l as Z,J as P}from"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-Du5e5QRV.js";import{_ as W,a as Y}from"./Model.vue_vue_type_script_setup_true_lang-CUcE9b2l.js";import{d as E,bj as D,c as f,o as s,u as t,bh as q,$ as G,cm as H,a0 as K,e as j,w as Q,cn as X,b as l,bk as A,W as ee,bl as c,a as u,bm as O,cc as te,cg as g,Y as $,c6 as U,c7 as R,cl as oe,c2 as ne,bg as ie,a2 as ae,c5 as le}from"./index-B06xwjXa.js";import"./Select.vue_vue_type_style_index_0_lang-CzS20kE7.js";import"./three-vrm.module-CtuEk7GG.js";import{d as V,e as se}from"./emotions-DWNSb738.js";import"./mcp-BfXpaYZf.js";import{V as re}from"./browser-CkchkNbv.js";import{_ as z,a as de}from"./ColorPalette.vue_vue_type_script_setup_true_lang-V-fFti_u.js";import{u as ce}from"./useIconAnimation-BxWVl-bV.js";import{b as B}from"./route-block-B_A1xBdJ.js";import"./floating-ui.core-CgBsuaUc.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-BxFBRVXD.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-CyZTJR0c.js";import"./index-BVgMpW27.js";const ue=["disabled"],h=E({__name:"Live2DModelControlButton",emits:["click"],setup(F){const m=D();return(r,n)=>(s(),f("button",{disabled:t(m).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]=p=>r.$emit("click"))},[q(r.$slots,"default")],8,ue))}}),me={flex:"~ col gap-4"},fe={flex:"","items-center":"","gap-2":""},pe=["disabled","placeholder"],ve={"font-medium":""},_e={flex:"","gap-2":""},be=["onUpdate:modelValue"],ge=["href","download"],he=E({__name:"Live2DSettings",props:{palette:null},emits:["extractColorsFromModel"],setup(F){const{t:m}=G(),r=H({accept:"application/zip"}),n=D(),{live2dModelFile:p,live2dMotionMap:v,live2dLoadSource:y,loadingLive2dModel:x,availableLive2dMotions:L,live2dModelUrl:M}=K(n),_=j(M.value);r.onChange(o=>{o&&o.length>0&&(v.value={},p.value=o[0],y.value="file",x.value=!0)}),Q(()=>n.loadingLive2dModel,o=>{o||y.value==="file"&&L.value.forEach(e=>{e.motionName in V?v.value[e.fileName]=e.motionName:v.value[e.fileName]=se})});async function b(o,e){if(!Object.keys(e).length)return o;const a=await new P().loadAsync(o),d=Object.keys(a.files).find(N=>N.endsWith("model3.json"));if(!d)throw new Error("model3.json not found");const J=await a.file(d).async("string"),I=JSON.parse(J),C={};Object.entries(e).forEach(([N,S])=>{if(C[S]){C[S].push({File:N});return}C[S]=[{File:N}]}),I.FileReferences.Motions=C,a.file(d,JSON.stringify(I,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 Z.getItem("live2dModel");if(!o)return;const e=await b(o,v.value);p.value=e,y.value="file",x.value=!0}const k=X(p);return(o,e)=>(s(),f("div",me,[l(t(z),{title:"settings.live2d.change-model.title",icon:"i-solar:magic-stick-3-bold-duotone","inner-class":"text-sm"},{default:c(()=>[u("div",fe,[O(u("input",{"onUpdate:modelValue":e[0]||(e[0]=i=>_.value=i),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(m)("settings.live2d.change-model.from-url-placeholder")},null,8,pe),[[te,_.value]]),l(h,{class:"form-control",onClick:e[1]||(e[1]=i=>M.value=_.value)},{default:c(()=>[g($(t(m)("settings.live2d.change-model.from-url")),1)]),_:1})]),l(h,{class:"form-control place-self-end",onClick:e[2]||(e[2]=i=>t(r).open())},{default:c(()=>[g($(t(m)("settings.live2d.change-model.from-file"))+"... ",1)]),_:1}),l(h,{class:"form-control",onClick:e[3]||(e[3]=i=>o.$emit("extractColorsFromModel"))},{default:c(()=>e[4]||(e[4]=[g(" Extract colors from model ")])),_:1,__:[4]}),l(de,{colors:F.palette.map(i=>({hex:i,name:i}))},null,8,["colors"])]),_:1}),t(n).live2dLoadSource==="file"?(s(),A(t(z),{key:0,title:"settings.live2d.edit-motion-map.title",icon:"i-solar:face-scan-circle-bold-duotone"},{default:c(()=>{var i;return[(s(!0),f(U,null,R(t(n).availableLive2dMotions,a=>(s(),f("div",{key:a.fileName,flex:"","items-center":"","justify-between":"","text-sm":""},[u("span",ve,$(a.fileName),1),u("div",_e,[O(u("select",{"onUpdate:modelValue":d=>t(n).live2dMotionMap[a.fileName]=d},[(s(!0),f(U,null,R(Object.keys(t(V)),d=>(s(),f("option",{key:d},$(d),1))),128))],8,be),[[oe,t(n).live2dMotionMap[a.fileName]]]),l(h,{class:"form-control",onClick:d=>t(n).live2dCurrentMotion={group:a.motionName,index:a.motionIndex}},{default:c(()=>e[5]||(e[5]=[g(" Play ")])),_:2,__:[5]},1032,["onClick"])])]))),128)),l(h,{onClick:w},{default:c(()=>e[6]||(e[6]=[g(" Save and patch ")])),_:1,__:[6]}),u("a",{"mt-2":"",block:"",href:t(k),download:`${((i=t(n).live2dModelFile)==null?void 0:i.name)||"live2d"}-motion-edited.zip`},[l(h,{"w-full":""},{default:c(()=>e[7]||(e[7]=[g("Export")])),_:1,__:[7]})],8,ge)]}),_:1})):ee("",!0)]))}}),ye=ne(he,[["__scopeId","data-v-b2e16668"]]),ke={flex:""},xe={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":""},Me=E({__name:"index",setup(F){const m=j(),r=j(),{width:n,height:p}=ie(m),v=j([]);async function y(){if(!r.value)return;const _=await r.value.captureFrame();if(!_){console.error("No frame captured");return}const b=URL.createObjectURL(_);try{const k=await new re(b).getPalette();v.value=Object.values(k).map(o=>o==null?void 0:o.hex).filter(o=>typeof o=="string")}finally{URL.revokeObjectURL(b)}}const{iconAnimationStarted:x,showIconAnimation:L,animationIcon:M}=ce("i-solar:people-nearby-bold-duotone");return(_,b)=>{const w=ae("IconAnimation"),k=le("motion");return s(),f(U,null,[u("div",ke,[u("div",{ref_key:"live2dContainerRef",ref:m,w:"50%",h:"80vh"},[l(t(Y),{ref_key:"live2dCanvasRef",ref:r,width:t(n),height:t(p)},{default:c(({app:o})=>[l(t(W),{app:o,"mouth-open-size":0,width:t(n),height:t(p),paused:!1},null,8,["app","width","height"])]),_:1},8,["width","height"])],512),l(ye,{w:"50%",h:"80vh",palette:v.value,onExtractColorsFromModel:y},null,8,["palette"])]),t(L)?(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"])):O((s(),f("div",xe,b[0]||(b[0]=[u("div",{text:"60","i-solar:people-nearby-bold-duotone":""},null,-1)]))),[[k]])],64)}}});typeof B=="function"&&B(Me);export{Me as default}; diff --git a/assets/index-dMGu9uSt.js b/assets/index-dMGu9uSt.js deleted file mode 100644 index 95a2de8aa86a7a6c8c987efd4ff408d1741b2130..0000000000000000000000000000000000000000 --- a/assets/index-dMGu9uSt.js +++ /dev/null @@ -1 +0,0 @@ -import{u as d}from"./useIconAnimation-Df247suB.js";import{d as u,a2 as p,c5 as f,c as n,o as t,a as i,ac as v,ae as x,u as o,c6 as _}from"./index-CNH1g_GM.js";import{b as a}from"./route-block-B_A1xBdJ.js";import"./mcp-B7-jaCfZ.js";import"./emotions-DWNSb738.js";const k={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":""},y=u({__name:"index",setup(b){const{iconAnimationStarted:r,showIconAnimation:c,animationIcon:s}=d("i-solar:armchair-2-bold-duotone");return(h,e)=>{const l=p("IconAnimation"),m=f("motion");return t(),n(_,null,[e[1]||(e[1]=i("div",null," Scene ",-1)),o(c)?(t(),v(l,{key:0,"z-index":-1,icon:o(s),"icon-size":12,duration:1e3,started:o(r),"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"])):x((t(),n("div",k,e[0]||(e[0]=[i("div",{text:"60","i-solar:armchair-2-bold-duotone":""},null,-1)]))),[[m]])],64)}}});typeof a=="function"&&a(y);export{y as default}; diff --git a/assets/mcp-B7-jaCfZ.js b/assets/mcp-B7-jaCfZ.js deleted file mode 100644 index 42d8296913d2b140ddbef75e73bb7400c9fe64b3..0000000000000000000000000000000000000000 --- a/assets/mcp-B7-jaCfZ.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/effect-WSjEuzC9-C605Q5Vk.js","assets/index-CNH1g_GM.js","assets/index-Cgf1vKOZ.css","assets/sury-DmrZ3_Oj-DbIZBXwJ.js","assets/valibot-CQk-M5rL-B1E8htDM.js","assets/zod-Db63SLXj-mFRszzY4.js"])))=>i.map(i=>d[i]); -import{cO as L}from"./index-CNH1g_GM.js";async function K(s,e={},t){return window.__TAURI_INTERNALS__.invoke(s,e,t)}async function Ne(s,e){await K("plugin:mcp|connect_server",{command:s,args:e})}async function Ze(){await K("plugin:mcp|disconnect_server")}async function Ee(){return await K("plugin:mcp|list_tools")}async function Re(s,e){return await K("plugin:mcp|call_tool",{name:s,args:e})}const Ie="https://xsai.js.org/docs/packages-top/xsschema#missing-dependencies",ft=async(s,e)=>{try{return await s}catch{throw new Error(`xsschema: Missing dependencies "${e}". see ${Ie}`)}},je=async s=>{switch(s){case"arktype":return L(()=>import("./arktype-C-GObzDh-1xlRyYUo.js"),[]).then(async({getToJsonSchemaFn:e})=>e());case"effect":return L(()=>import("./effect-WSjEuzC9-C605Q5Vk.js"),__vite__mapDeps([0,1,2])).then(async({getToJsonSchemaFn:e})=>e());case"sury":return L(()=>import("./sury-DmrZ3_Oj-DbIZBXwJ.js"),__vite__mapDeps([3,1,2])).then(async({getToJsonSchemaFn:e})=>e());case"valibot":return L(()=>import("./valibot-CQk-M5rL-B1E8htDM.js"),__vite__mapDeps([4,1,2])).then(async({getToJsonSchemaFn:e})=>e());case"zod":return L(()=>import("./zod-Db63SLXj-mFRszzY4.js"),__vite__mapDeps([5,1,2])).then(async({getToJsonSchemaFn:e})=>e());default:throw new Error(`xsschema: Unsupported schema vendor "${s}". see https://xsai.js.org/docs/packages-top/xsschema#unsupported-schema-vendor`)}},$e=async s=>je(s["~standard"].vendor).then(async e=>e(s)),q=async s=>{const e=await $e(s.parameters);return{execute:s.execute,function:{description:s.description,name:s.name,parameters:{...e,additionalProperties:!1},strict:!0},type:"function"}};var g;(function(s){s.assertEqual=n=>{};function e(n){}s.assertIs=e;function t(n){throw new Error}s.assertNever=t,s.arrayToEnum=n=>{const a={};for(const i of n)a[i]=i;return a},s.getValidEnumValues=n=>{const a=s.objectKeys(n).filter(o=>typeof n[n[o]]!="number"),i={};for(const o of a)i[o]=n[o];return s.objectValues(i)},s.objectValues=n=>s.objectKeys(n).map(function(a){return n[a]}),s.objectKeys=typeof Object.keys=="function"?n=>Object.keys(n):n=>{const a=[];for(const i in n)Object.prototype.hasOwnProperty.call(n,i)&&a.push(i);return a},s.find=(n,a)=>{for(const i of n)if(a(i))return i},s.isInteger=typeof Number.isInteger=="function"?n=>Number.isInteger(n):n=>typeof n=="number"&&Number.isFinite(n)&&Math.floor(n)===n;function r(n,a=" | "){return n.map(i=>typeof i=="string"?`'${i}'`:i).join(a)}s.joinValues=r,s.jsonStringifyReplacer=(n,a)=>typeof a=="bigint"?a.toString():a})(g||(g={}));var de;(function(s){s.mergeShapes=(e,t)=>({...e,...t})})(de||(de={}));const u=g.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),C=s=>{switch(typeof s){case"undefined":return u.undefined;case"string":return u.string;case"number":return Number.isNaN(s)?u.nan:u.number;case"boolean":return u.boolean;case"function":return u.function;case"bigint":return u.bigint;case"symbol":return u.symbol;case"object":return Array.isArray(s)?u.array:s===null?u.null:s.then&&typeof s.then=="function"&&s.catch&&typeof s.catch=="function"?u.promise:typeof Map<"u"&&s instanceof Map?u.map:typeof Set<"u"&&s instanceof Set?u.set:typeof Date<"u"&&s instanceof Date?u.date:u.object;default:return u.unknown}},d=g.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class T extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(a){return a.message},r={_errors:[]},n=a=>{for(const i of a.issues)if(i.code==="invalid_union")i.unionErrors.map(n);else if(i.code==="invalid_return_type")n(i.returnTypeError);else if(i.code==="invalid_arguments")n(i.argumentsError);else if(i.path.length===0)r._errors.push(t(i));else{let o=r,h=0;for(;ht.message){const t={},r=[];for(const n of this.issues)n.path.length>0?(t[n.path[0]]=t[n.path[0]]||[],t[n.path[0]].push(e(n))):r.push(e(n));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}}T.create=s=>new T(s);const te=(s,e)=>{let t;switch(s.code){case d.invalid_type:s.received===u.undefined?t="Required":t=`Expected ${s.expected}, received ${s.received}`;break;case d.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(s.expected,g.jsonStringifyReplacer)}`;break;case d.unrecognized_keys:t=`Unrecognized key(s) in object: ${g.joinValues(s.keys,", ")}`;break;case d.invalid_union:t="Invalid input";break;case d.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${g.joinValues(s.options)}`;break;case d.invalid_enum_value:t=`Invalid enum value. Expected ${g.joinValues(s.options)}, received '${s.received}'`;break;case d.invalid_arguments:t="Invalid function arguments";break;case d.invalid_return_type:t="Invalid function return type";break;case d.invalid_date:t="Invalid date";break;case d.invalid_string:typeof s.validation=="object"?"includes"in s.validation?(t=`Invalid input: must include "${s.validation.includes}"`,typeof s.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${s.validation.position}`)):"startsWith"in s.validation?t=`Invalid input: must start with "${s.validation.startsWith}"`:"endsWith"in s.validation?t=`Invalid input: must end with "${s.validation.endsWith}"`:g.assertNever(s.validation):s.validation!=="regex"?t=`Invalid ${s.validation}`:t="Invalid";break;case d.too_small:s.type==="array"?t=`Array must contain ${s.exact?"exactly":s.inclusive?"at least":"more than"} ${s.minimum} element(s)`:s.type==="string"?t=`String must contain ${s.exact?"exactly":s.inclusive?"at least":"over"} ${s.minimum} character(s)`:s.type==="number"?t=`Number must be ${s.exact?"exactly equal to ":s.inclusive?"greater than or equal to ":"greater than "}${s.minimum}`:s.type==="date"?t=`Date must be ${s.exact?"exactly equal to ":s.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(s.minimum))}`:t="Invalid input";break;case d.too_big:s.type==="array"?t=`Array must contain ${s.exact?"exactly":s.inclusive?"at most":"less than"} ${s.maximum} element(s)`:s.type==="string"?t=`String must contain ${s.exact?"exactly":s.inclusive?"at most":"under"} ${s.maximum} character(s)`:s.type==="number"?t=`Number must be ${s.exact?"exactly":s.inclusive?"less than or equal to":"less than"} ${s.maximum}`:s.type==="bigint"?t=`BigInt must be ${s.exact?"exactly":s.inclusive?"less than or equal to":"less than"} ${s.maximum}`:s.type==="date"?t=`Date must be ${s.exact?"exactly":s.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(s.maximum))}`:t="Invalid input";break;case d.custom:t="Invalid input";break;case d.invalid_intersection_types:t="Intersection results could not be merged";break;case d.not_multiple_of:t=`Number must be a multiple of ${s.multipleOf}`;break;case d.not_finite:t="Number must be finite";break;default:t=e.defaultError,g.assertNever(s)}return{message:t}};let Pe=te;function Me(){return Pe}const Ve=s=>{const{data:e,path:t,errorMaps:r,issueData:n}=s,a=[...t,...n.path||[]],i={...n,path:a};if(n.message!==void 0)return{...n,path:a,message:n.message};let o="";const h=r.filter(f=>!!f).slice().reverse();for(const f of h)o=f(i,{data:e,defaultError:o}).message;return{...n,path:a,message:o}};function c(s,e){const t=Me(),r=Ve({issueData:e,data:s.data,path:s.path,errorMaps:[s.common.contextualErrorMap,s.schemaErrorMap,t,t===te?void 0:te].filter(n=>!!n)});s.common.issues.push(r)}class k{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const r=[];for(const n of t){if(n.status==="aborted")return p;n.status==="dirty"&&e.dirty(),r.push(n.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,t){const r=[];for(const n of t){const a=await n.key,i=await n.value;r.push({key:a,value:i})}return k.mergeObjectSync(e,r)}static mergeObjectSync(e,t){const r={};for(const n of t){const{key:a,value:i}=n;if(a.status==="aborted"||i.status==="aborted")return p;a.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),a.value!=="__proto__"&&(typeof i.value<"u"||n.alwaysSet)&&(r[a.value]=i.value)}return{status:e.value,value:r}}}const p=Object.freeze({status:"aborted"}),D=s=>({status:"dirty",value:s}),b=s=>({status:"valid",value:s}),ce=s=>s.status==="aborted",ue=s=>s.status==="dirty",I=s=>s.status==="valid",J=s=>typeof Promise<"u"&&s instanceof Promise;var l;(function(s){s.errToObj=e=>typeof e=="string"?{message:e}:e||{},s.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(l||(l={}));var G=function(s,e,t,r){if(t==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?s!==e||!r:!e.has(s))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?r:t==="a"?r.call(s):r?r.value:e.get(s)},Te=function(s,e,t,r,n){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?s!==e||!n:!e.has(s))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?n.call(s,t):n?n.value=t:e.set(s,t),t},U,F;class A{constructor(e,t,r,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=n}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const le=(s,e)=>{if(I(e))return{success:!0,data:e.value};if(!s.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new T(s.common.issues);return this._error=t,this._error}}};function _(s){if(!s)return{};const{errorMap:e,invalid_type_error:t,required_error:r,description:n}=s;if(e&&(t||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:n}:{errorMap:(i,o)=>{const{message:h}=s;return i.code==="invalid_enum_value"?{message:h??o.defaultError}:typeof o.data>"u"?{message:h??r??o.defaultError}:i.code!=="invalid_type"?{message:o.defaultError}:{message:h??t??o.defaultError}},description:n}}class y{get description(){return this._def.description}_getType(e){return C(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:C(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new k,ctx:{common:e.parent.common,data:e.data,parsedType:C(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(J(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){const r={common:{issues:[],async:(t==null?void 0:t.async)??!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:C(e)},n=this._parseSync({data:e,path:r.path,parent:r});return le(r,n)}"~validate"(e){var r,n;const t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:C(e)};if(!this["~standard"].async)try{const a=this._parseSync({data:e,path:[],parent:t});return I(a)?{value:a.value}:{issues:t.common.issues}}catch(a){(n=(r=a==null?void 0:a.message)==null?void 0:r.toLowerCase())!=null&&n.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(a=>I(a)?{value:a.value}:{issues:t.common.issues})}async parseAsync(e,t){const r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){const r={common:{issues:[],contextualErrorMap:t==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:C(e)},n=this._parse({data:e,path:r.path,parent:r}),a=await(J(n)?n:Promise.resolve(n));return le(r,a)}refine(e,t){const r=n=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(n):t;return this._refinement((n,a)=>{const i=e(n),o=()=>a.addIssue({code:d.custom,...r(n)});return typeof Promise<"u"&&i instanceof Promise?i.then(h=>h?!0:(o(),!1)):i?!0:(o(),!1)})}refinement(e,t){return this._refinement((r,n)=>e(r)?!0:(n.addIssue(typeof t=="function"?t(r,n):t),!1))}_refinement(e){return new P({schema:this,typeName:m.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:t=>this["~validate"](t)}}optional(){return O.create(this,this._def)}nullable(){return M.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return w.create(this)}promise(){return X.create(this,this._def)}or(e){return H.create([this,e],this._def)}and(e){return Q.create(this,e,this._def)}transform(e){return new P({..._(this._def),schema:this,typeName:m.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new ne({..._(this._def),innerType:this,defaultValue:t,typeName:m.ZodDefault})}brand(){return new ot({typeName:m.ZodBranded,type:this,..._(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new ae({..._(this._def),innerType:this,catchValue:t,typeName:m.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return oe.create(this,e)}readonly(){return ie.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Le=/^c[^\s-]{8,}$/i,ze=/^[0-9a-z]+$/,De=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Ue=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Fe=/^[a-z0-9_-]{21}$/i,Be=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,We=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,qe=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Je="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let ee;const Ge=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Ye=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,He=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Qe=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Xe=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Ke=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Ce="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",et=new RegExp(`^${Ce}$`);function Se(s){let e="[0-5]\\d";s.precision?e=`${e}\\.\\d{${s.precision}}`:s.precision==null&&(e=`${e}(\\.\\d+)?`);const t=s.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${t}`}function tt(s){return new RegExp(`^${Se(s)}$`)}function st(s){let e=`${Ce}T${Se(s)}`;const t=[];return t.push(s.local?"Z?":"Z"),s.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function rt(s,e){return!!((e==="v4"||!e)&&Ge.test(s)||(e==="v6"||!e)&&He.test(s))}function nt(s,e){if(!Be.test(s))return!1;try{const[t]=s.split("."),r=t.replace(/-/g,"+").replace(/_/g,"/").padEnd(t.length+(4-t.length%4)%4,"="),n=JSON.parse(atob(r));return!(typeof n!="object"||n===null||"typ"in n&&(n==null?void 0:n.typ)!=="JWT"||!n.alg||e&&n.alg!==e)}catch{return!1}}function at(s,e){return!!((e==="v4"||!e)&&Ye.test(s)||(e==="v6"||!e)&&Qe.test(s))}class S extends y{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==u.string){const a=this._getOrReturnCtx(e);return c(a,{code:d.invalid_type,expected:u.string,received:a.parsedType}),p}const r=new k;let n;for(const a of this._def.checks)if(a.kind==="min")e.data.lengtha.value&&(n=this._getOrReturnCtx(e,n),c(n,{code:d.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),r.dirty());else if(a.kind==="length"){const i=e.data.length>a.value,o=e.data.lengthe.test(n),{validation:t,code:d.invalid_string,...l.errToObj(r)})}_addCheck(e){return new S({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...l.errToObj(e)})}url(e){return this._addCheck({kind:"url",...l.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...l.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...l.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...l.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...l.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...l.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...l.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...l.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...l.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...l.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...l.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...l.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(e==null?void 0:e.offset)??!1,local:(e==null?void 0:e.local)??!1,...l.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...l.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...l.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...l.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t==null?void 0:t.position,...l.errToObj(t==null?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...l.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...l.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...l.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...l.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...l.errToObj(t)})}nonempty(e){return this.min(1,l.errToObj(e))}trim(){return new S({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new S({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new S({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.valuenew S({checks:[],typeName:m.ZodString,coerce:(s==null?void 0:s.coerce)??!1,..._(s)});function it(s,e){const t=(s.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,n=t>r?t:r,a=Number.parseInt(s.toFixed(n).replace(".","")),i=Number.parseInt(e.toFixed(n).replace(".",""));return a%i/10**n}class j extends y{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==u.number){const a=this._getOrReturnCtx(e);return c(a,{code:d.invalid_type,expected:u.number,received:a.parsedType}),p}let r;const n=new k;for(const a of this._def.checks)a.kind==="int"?g.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),c(r,{code:d.invalid_type,expected:"integer",received:"float",message:a.message}),n.dirty()):a.kind==="min"?(a.inclusive?e.dataa.value:e.data>=a.value)&&(r=this._getOrReturnCtx(e,r),c(r,{code:d.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),n.dirty()):a.kind==="multipleOf"?it(e.data,a.value)!==0&&(r=this._getOrReturnCtx(e,r),c(r,{code:d.not_multiple_of,multipleOf:a.value,message:a.message}),n.dirty()):a.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),c(r,{code:d.not_finite,message:a.message}),n.dirty()):g.assertNever(a);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,l.toString(t))}gt(e,t){return this.setLimit("min",e,!1,l.toString(t))}lte(e,t){return this.setLimit("max",e,!0,l.toString(t))}lt(e,t){return this.setLimit("max",e,!1,l.toString(t))}setLimit(e,t,r,n){return new j({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:l.toString(n)}]})}_addCheck(e){return new j({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:l.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:l.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:l.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:l.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:l.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:l.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:l.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:l.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:l.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.valuee.kind==="int"||e.kind==="multipleOf"&&g.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(t===null||r.value>t)&&(t=r.value):r.kind==="max"&&(e===null||r.valuenew j({checks:[],typeName:m.ZodNumber,coerce:(s==null?void 0:s.coerce)||!1,..._(s)});class B extends y{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==u.bigint)return this._getInvalidInput(e);let r;const n=new k;for(const a of this._def.checks)a.kind==="min"?(a.inclusive?e.dataa.value:e.data>=a.value)&&(r=this._getOrReturnCtx(e,r),c(r,{code:d.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),n.dirty()):a.kind==="multipleOf"?e.data%a.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),c(r,{code:d.not_multiple_of,multipleOf:a.value,message:a.message}),n.dirty()):g.assertNever(a);return{status:n.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return c(t,{code:d.invalid_type,expected:u.bigint,received:t.parsedType}),p}gte(e,t){return this.setLimit("min",e,!0,l.toString(t))}gt(e,t){return this.setLimit("min",e,!1,l.toString(t))}lte(e,t){return this.setLimit("max",e,!0,l.toString(t))}lt(e,t){return this.setLimit("max",e,!1,l.toString(t))}setLimit(e,t,r,n){return new B({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:l.toString(n)}]})}_addCheck(e){return new B({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:l.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:l.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:l.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:l.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:l.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.valuenew B({checks:[],typeName:m.ZodBigInt,coerce:(s==null?void 0:s.coerce)??!1,..._(s)});class se extends y{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==u.boolean){const r=this._getOrReturnCtx(e);return c(r,{code:d.invalid_type,expected:u.boolean,received:r.parsedType}),p}return b(e.data)}}se.create=s=>new se({typeName:m.ZodBoolean,coerce:(s==null?void 0:s.coerce)||!1,..._(s)});class Y extends y{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==u.date){const a=this._getOrReturnCtx(e);return c(a,{code:d.invalid_type,expected:u.date,received:a.parsedType}),p}if(Number.isNaN(e.data.getTime())){const a=this._getOrReturnCtx(e);return c(a,{code:d.invalid_date}),p}const r=new k;let n;for(const a of this._def.checks)a.kind==="min"?e.data.getTime()a.value&&(n=this._getOrReturnCtx(e,n),c(n,{code:d.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),r.dirty()):g.assertNever(a);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Y({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:l.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:l.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.valuenew Y({checks:[],coerce:(s==null?void 0:s.coerce)||!1,typeName:m.ZodDate,..._(s)});class he extends y{_parse(e){if(this._getType(e)!==u.symbol){const r=this._getOrReturnCtx(e);return c(r,{code:d.invalid_type,expected:u.symbol,received:r.parsedType}),p}return b(e.data)}}he.create=s=>new he({typeName:m.ZodSymbol,..._(s)});class fe extends y{_parse(e){if(this._getType(e)!==u.undefined){const r=this._getOrReturnCtx(e);return c(r,{code:d.invalid_type,expected:u.undefined,received:r.parsedType}),p}return b(e.data)}}fe.create=s=>new fe({typeName:m.ZodUndefined,..._(s)});class me extends y{_parse(e){if(this._getType(e)!==u.null){const r=this._getOrReturnCtx(e);return c(r,{code:d.invalid_type,expected:u.null,received:r.parsedType}),p}return b(e.data)}}me.create=s=>new me({typeName:m.ZodNull,..._(s)});class pe extends y{constructor(){super(...arguments),this._any=!0}_parse(e){return b(e.data)}}pe.create=s=>new pe({typeName:m.ZodAny,..._(s)});class _e extends y{constructor(){super(...arguments),this._unknown=!0}_parse(e){return b(e.data)}}_e.create=s=>new _e({typeName:m.ZodUnknown,..._(s)});class N extends y{_parse(e){const t=this._getOrReturnCtx(e);return c(t,{code:d.invalid_type,expected:u.never,received:t.parsedType}),p}}N.create=s=>new N({typeName:m.ZodNever,..._(s)});class ye extends y{_parse(e){if(this._getType(e)!==u.undefined){const r=this._getOrReturnCtx(e);return c(r,{code:d.invalid_type,expected:u.void,received:r.parsedType}),p}return b(e.data)}}ye.create=s=>new ye({typeName:m.ZodVoid,..._(s)});class w extends y{_parse(e){const{ctx:t,status:r}=this._processInputParams(e),n=this._def;if(t.parsedType!==u.array)return c(t,{code:d.invalid_type,expected:u.array,received:t.parsedType}),p;if(n.exactLength!==null){const i=t.data.length>n.exactLength.value,o=t.data.lengthn.maxLength.value&&(c(t,{code:d.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),r.dirty()),t.common.async)return Promise.all([...t.data].map((i,o)=>n.type._parseAsync(new A(t,i,t.path,o)))).then(i=>k.mergeArray(r,i));const a=[...t.data].map((i,o)=>n.type._parseSync(new A(t,i,t.path,o)));return k.mergeArray(r,a)}get element(){return this._def.type}min(e,t){return new w({...this._def,minLength:{value:e,message:l.toString(t)}})}max(e,t){return new w({...this._def,maxLength:{value:e,message:l.toString(t)}})}length(e,t){return new w({...this._def,exactLength:{value:e,message:l.toString(t)}})}nonempty(e){return this.min(1,e)}}w.create=(s,e)=>new w({type:s,minLength:null,maxLength:null,exactLength:null,typeName:m.ZodArray,..._(e)});function R(s){if(s instanceof x){const e={};for(const t in s.shape){const r=s.shape[t];e[t]=O.create(R(r))}return new x({...s._def,shape:()=>e})}else return s instanceof w?new w({...s._def,type:R(s.element)}):s instanceof O?O.create(R(s.unwrap())):s instanceof M?M.create(R(s.unwrap())):s instanceof Z?Z.create(s.items.map(e=>R(e))):s}class x extends y{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),t=g.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==u.object){const f=this._getOrReturnCtx(e);return c(f,{code:d.invalid_type,expected:u.object,received:f.parsedType}),p}const{status:r,ctx:n}=this._processInputParams(e),{shape:a,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof N&&this._def.unknownKeys==="strip"))for(const f in n.data)i.includes(f)||o.push(f);const h=[];for(const f of i){const v=a[f],V=n.data[f];h.push({key:{status:"valid",value:f},value:v._parse(new A(n,V,n.path,f)),alwaysSet:f in n.data})}if(this._def.catchall instanceof N){const f=this._def.unknownKeys;if(f==="passthrough")for(const v of o)h.push({key:{status:"valid",value:v},value:{status:"valid",value:n.data[v]}});else if(f==="strict")o.length>0&&(c(n,{code:d.unrecognized_keys,keys:o}),r.dirty());else if(f!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const f=this._def.catchall;for(const v of o){const V=n.data[v];h.push({key:{status:"valid",value:v},value:f._parse(new A(n,V,n.path,v)),alwaysSet:v in n.data})}}return n.common.async?Promise.resolve().then(async()=>{const f=[];for(const v of h){const V=await v.key,Ae=await v.value;f.push({key:V,value:Ae,alwaysSet:v.alwaysSet})}return f}).then(f=>k.mergeObjectSync(r,f)):k.mergeObjectSync(r,h)}get shape(){return this._def.shape()}strict(e){return l.errToObj,new x({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,r)=>{var a,i;const n=((i=(a=this._def).errorMap)==null?void 0:i.call(a,t,r).message)??r.defaultError;return t.code==="unrecognized_keys"?{message:l.errToObj(e).message??n}:{message:n}}}:{}})}strip(){return new x({...this._def,unknownKeys:"strip"})}passthrough(){return new x({...this._def,unknownKeys:"passthrough"})}extend(e){return new x({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new x({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:m.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new x({...this._def,catchall:e})}pick(e){const t={};for(const r of g.objectKeys(e))e[r]&&this.shape[r]&&(t[r]=this.shape[r]);return new x({...this._def,shape:()=>t})}omit(e){const t={};for(const r of g.objectKeys(this.shape))e[r]||(t[r]=this.shape[r]);return new x({...this._def,shape:()=>t})}deepPartial(){return R(this)}partial(e){const t={};for(const r of g.objectKeys(this.shape)){const n=this.shape[r];e&&!e[r]?t[r]=n:t[r]=n.optional()}return new x({...this._def,shape:()=>t})}required(e){const t={};for(const r of g.objectKeys(this.shape))if(e&&!e[r])t[r]=this.shape[r];else{let a=this.shape[r];for(;a instanceof O;)a=a._def.innerType;t[r]=a}return new x({...this._def,shape:()=>t})}keyof(){return Oe(g.objectKeys(this.shape))}}x.create=(s,e)=>new x({shape:()=>s,unknownKeys:"strip",catchall:N.create(),typeName:m.ZodObject,..._(e)});x.strictCreate=(s,e)=>new x({shape:()=>s,unknownKeys:"strict",catchall:N.create(),typeName:m.ZodObject,..._(e)});x.lazycreate=(s,e)=>new x({shape:s,unknownKeys:"strip",catchall:N.create(),typeName:m.ZodObject,..._(e)});class H extends y{_parse(e){const{ctx:t}=this._processInputParams(e),r=this._def.options;function n(a){for(const o of a)if(o.result.status==="valid")return o.result;for(const o of a)if(o.result.status==="dirty")return t.common.issues.push(...o.ctx.common.issues),o.result;const i=a.map(o=>new T(o.ctx.common.issues));return c(t,{code:d.invalid_union,unionErrors:i}),p}if(t.common.async)return Promise.all(r.map(async a=>{const i={...t,common:{...t.common,issues:[]},parent:null};return{result:await a._parseAsync({data:t.data,path:t.path,parent:i}),ctx:i}})).then(n);{let a;const i=[];for(const h of r){const f={...t,common:{...t.common,issues:[]},parent:null},v=h._parseSync({data:t.data,path:t.path,parent:f});if(v.status==="valid")return v;v.status==="dirty"&&!a&&(a={result:v,ctx:f}),f.common.issues.length&&i.push(f.common.issues)}if(a)return t.common.issues.push(...a.ctx.common.issues),a.result;const o=i.map(h=>new T(h));return c(t,{code:d.invalid_union,unionErrors:o}),p}}get options(){return this._def.options}}H.create=(s,e)=>new H({options:s,typeName:m.ZodUnion,..._(e)});function re(s,e){const t=C(s),r=C(e);if(s===e)return{valid:!0,data:s};if(t===u.object&&r===u.object){const n=g.objectKeys(e),a=g.objectKeys(s).filter(o=>n.indexOf(o)!==-1),i={...s,...e};for(const o of a){const h=re(s[o],e[o]);if(!h.valid)return{valid:!1};i[o]=h.data}return{valid:!0,data:i}}else if(t===u.array&&r===u.array){if(s.length!==e.length)return{valid:!1};const n=[];for(let a=0;a{if(ce(a)||ce(i))return p;const o=re(a.value,i.value);return o.valid?((ue(a)||ue(i))&&t.dirty(),{status:t.value,value:o.data}):(c(r,{code:d.invalid_intersection_types}),p)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([a,i])=>n(a,i)):n(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}Q.create=(s,e,t)=>new Q({left:s,right:e,typeName:m.ZodIntersection,..._(t)});class Z extends y{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==u.array)return c(r,{code:d.invalid_type,expected:u.array,received:r.parsedType}),p;if(r.data.lengththis._def.items.length&&(c(r,{code:d.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const a=[...r.data].map((i,o)=>{const h=this._def.items[o]||this._def.rest;return h?h._parse(new A(r,i,r.path,o)):null}).filter(i=>!!i);return r.common.async?Promise.all(a).then(i=>k.mergeArray(t,i)):k.mergeArray(t,a)}get items(){return this._def.items}rest(e){return new Z({...this._def,rest:e})}}Z.create=(s,e)=>{if(!Array.isArray(s))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Z({items:s,typeName:m.ZodTuple,rest:null,..._(e)})};class ge extends y{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==u.map)return c(r,{code:d.invalid_type,expected:u.map,received:r.parsedType}),p;const n=this._def.keyType,a=this._def.valueType,i=[...r.data.entries()].map(([o,h],f)=>({key:n._parse(new A(r,o,r.path,[f,"key"])),value:a._parse(new A(r,h,r.path,[f,"value"]))}));if(r.common.async){const o=new Map;return Promise.resolve().then(async()=>{for(const h of i){const f=await h.key,v=await h.value;if(f.status==="aborted"||v.status==="aborted")return p;(f.status==="dirty"||v.status==="dirty")&&t.dirty(),o.set(f.value,v.value)}return{status:t.value,value:o}})}else{const o=new Map;for(const h of i){const f=h.key,v=h.value;if(f.status==="aborted"||v.status==="aborted")return p;(f.status==="dirty"||v.status==="dirty")&&t.dirty(),o.set(f.value,v.value)}return{status:t.value,value:o}}}}ge.create=(s,e,t)=>new ge({valueType:e,keyType:s,typeName:m.ZodMap,..._(t)});class W extends y{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==u.set)return c(r,{code:d.invalid_type,expected:u.set,received:r.parsedType}),p;const n=this._def;n.minSize!==null&&r.data.sizen.maxSize.value&&(c(r,{code:d.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),t.dirty());const a=this._def.valueType;function i(h){const f=new Set;for(const v of h){if(v.status==="aborted")return p;v.status==="dirty"&&t.dirty(),f.add(v.value)}return{status:t.value,value:f}}const o=[...r.data.values()].map((h,f)=>a._parse(new A(r,h,r.path,f)));return r.common.async?Promise.all(o).then(h=>i(h)):i(o)}min(e,t){return new W({...this._def,minSize:{value:e,message:l.toString(t)}})}max(e,t){return new W({...this._def,maxSize:{value:e,message:l.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}W.create=(s,e)=>new W({valueType:s,minSize:null,maxSize:null,typeName:m.ZodSet,..._(e)});class ve extends y{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}ve.create=(s,e)=>new ve({getter:s,typeName:m.ZodLazy,..._(e)});class xe extends y{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return c(t,{received:t.data,code:d.invalid_literal,expected:this._def.value}),p}return{status:"valid",value:e.data}}get value(){return this._def.value}}xe.create=(s,e)=>new xe({value:s,typeName:m.ZodLiteral,..._(e)});function Oe(s,e){return new $({values:s,typeName:m.ZodEnum,..._(e)})}class $ extends y{constructor(){super(...arguments),U.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),r=this._def.values;return c(t,{expected:g.joinValues(r),received:t.parsedType,code:d.invalid_type}),p}if(G(this,U,"f")||Te(this,U,new Set(this._def.values),"f"),!G(this,U,"f").has(e.data)){const t=this._getOrReturnCtx(e),r=this._def.values;return c(t,{received:t.data,code:d.invalid_enum_value,options:r}),p}return b(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return $.create(e,{...this._def,...t})}exclude(e,t=this._def){return $.create(this.options.filter(r=>!e.includes(r)),{...this._def,...t})}}U=new WeakMap;$.create=Oe;class ke extends y{constructor(){super(...arguments),F.set(this,void 0)}_parse(e){const t=g.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==u.string&&r.parsedType!==u.number){const n=g.objectValues(t);return c(r,{expected:g.joinValues(n),received:r.parsedType,code:d.invalid_type}),p}if(G(this,F,"f")||Te(this,F,new Set(g.getValidEnumValues(this._def.values)),"f"),!G(this,F,"f").has(e.data)){const n=g.objectValues(t);return c(r,{received:r.data,code:d.invalid_enum_value,options:n}),p}return b(e.data)}get enum(){return this._def.values}}F=new WeakMap;ke.create=(s,e)=>new ke({values:s,typeName:m.ZodNativeEnum,..._(e)});class X extends y{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==u.promise&&t.common.async===!1)return c(t,{code:d.invalid_type,expected:u.promise,received:t.parsedType}),p;const r=t.parsedType===u.promise?t.data:Promise.resolve(t.data);return b(r.then(n=>this._def.type.parseAsync(n,{path:t.path,errorMap:t.common.contextualErrorMap})))}}X.create=(s,e)=>new X({type:s,typeName:m.ZodPromise,..._(e)});class P extends y{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===m.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:r}=this._processInputParams(e),n=this._def.effect||null,a={addIssue:i=>{c(r,i),i.fatal?t.abort():t.dirty()},get path(){return r.path}};if(a.addIssue=a.addIssue.bind(a),n.type==="preprocess"){const i=n.transform(r.data,a);if(r.common.async)return Promise.resolve(i).then(async o=>{if(t.value==="aborted")return p;const h=await this._def.schema._parseAsync({data:o,path:r.path,parent:r});return h.status==="aborted"?p:h.status==="dirty"||t.value==="dirty"?D(h.value):h});{if(t.value==="aborted")return p;const o=this._def.schema._parseSync({data:i,path:r.path,parent:r});return o.status==="aborted"?p:o.status==="dirty"||t.value==="dirty"?D(o.value):o}}if(n.type==="refinement"){const i=o=>{const h=n.refinement(o,a);if(r.common.async)return Promise.resolve(h);if(h instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(r.common.async===!1){const o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?p:(o.status==="dirty"&&t.dirty(),i(o.value),{status:t.value,value:o.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>o.status==="aborted"?p:(o.status==="dirty"&&t.dirty(),i(o.value).then(()=>({status:t.value,value:o.value}))))}if(n.type==="transform")if(r.common.async===!1){const i=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!I(i))return i;const o=n.transform(i.value,a);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:o}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(i=>I(i)?Promise.resolve(n.transform(i.value,a)).then(o=>({status:t.value,value:o})):i);g.assertNever(n)}}P.create=(s,e,t)=>new P({schema:s,typeName:m.ZodEffects,effect:e,..._(t)});P.createWithPreprocess=(s,e,t)=>new P({schema:e,effect:{type:"preprocess",transform:s},typeName:m.ZodEffects,..._(t)});class O extends y{_parse(e){return this._getType(e)===u.undefined?b(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}O.create=(s,e)=>new O({innerType:s,typeName:m.ZodOptional,..._(e)});class M extends y{_parse(e){return this._getType(e)===u.null?b(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}M.create=(s,e)=>new M({innerType:s,typeName:m.ZodNullable,..._(e)});class ne extends y{_parse(e){const{ctx:t}=this._processInputParams(e);let r=t.data;return t.parsedType===u.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}ne.create=(s,e)=>new ne({innerType:s,typeName:m.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,..._(e)});class ae extends y{_parse(e){const{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return J(n)?n.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new T(r.common.issues)},input:r.data})})):{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new T(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}ae.create=(s,e)=>new ae({innerType:s,typeName:m.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,..._(e)});class be extends y{_parse(e){if(this._getType(e)!==u.nan){const r=this._getOrReturnCtx(e);return c(r,{code:d.invalid_type,expected:u.nan,received:r.parsedType}),p}return{status:"valid",value:e.data}}}be.create=s=>new be({typeName:m.ZodNaN,..._(s)});class ot extends y{_parse(e){const{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}}class oe extends y{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const a=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?p:a.status==="dirty"?(t.dirty(),D(a.value)):this._def.out._parseAsync({data:a.value,path:r.path,parent:r})})();{const n=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return n.status==="aborted"?p:n.status==="dirty"?(t.dirty(),{status:"dirty",value:n.value}):this._def.out._parseSync({data:n.value,path:r.path,parent:r})}}static create(e,t){return new oe({in:e,out:t,typeName:m.ZodPipeline})}}class ie extends y{_parse(e){const t=this._def.innerType._parse(e),r=n=>(I(n)&&(n.value=Object.freeze(n.value)),n);return J(t)?t.then(n=>r(n)):r(t)}unwrap(){return this._def.innerType}}ie.create=(s,e)=>new ie({innerType:s,typeName:m.ZodReadonly,..._(e)});var m;(function(s){s.ZodString="ZodString",s.ZodNumber="ZodNumber",s.ZodNaN="ZodNaN",s.ZodBigInt="ZodBigInt",s.ZodBoolean="ZodBoolean",s.ZodDate="ZodDate",s.ZodSymbol="ZodSymbol",s.ZodUndefined="ZodUndefined",s.ZodNull="ZodNull",s.ZodAny="ZodAny",s.ZodUnknown="ZodUnknown",s.ZodNever="ZodNever",s.ZodVoid="ZodVoid",s.ZodArray="ZodArray",s.ZodObject="ZodObject",s.ZodUnion="ZodUnion",s.ZodDiscriminatedUnion="ZodDiscriminatedUnion",s.ZodIntersection="ZodIntersection",s.ZodTuple="ZodTuple",s.ZodRecord="ZodRecord",s.ZodMap="ZodMap",s.ZodSet="ZodSet",s.ZodFunction="ZodFunction",s.ZodLazy="ZodLazy",s.ZodLiteral="ZodLiteral",s.ZodEnum="ZodEnum",s.ZodEffects="ZodEffects",s.ZodNativeEnum="ZodNativeEnum",s.ZodOptional="ZodOptional",s.ZodNullable="ZodNullable",s.ZodDefault="ZodDefault",s.ZodCatch="ZodCatch",s.ZodPromise="ZodPromise",s.ZodBranded="ZodBranded",s.ZodPipeline="ZodPipeline",s.ZodReadonly="ZodReadonly"})(m||(m={}));const z=S.create,dt=j.create,ct=se.create;N.create;const we=w.create,E=x.create,ut=H.create;Q.create;Z.create;$.create;X.create;O.create;M.create;const lt=[q({name:"mcp_list_tools",description:"List all tools available on the MCP server",execute:async(s,e)=>await Ee(),parameters:E({})}),q({name:"mcp_connect_server",description:'Connect to the MCP server. If "success", the connection to the MCP server is successful. Otherwise, the connection fails.',execute:async({command:s,args:e})=>(await Ne(s,e),"success"),parameters:E({command:z().describe("The command to connect to the MCP server"),args:we(z()).describe("The arguments to pass to the MCP server")})}),q({name:"mcp_disconnect_server",description:'Disconnect from the MCP server. If "success", the disconnection from the MCP server is successful. Otherwise, the disconnection fails.',execute:async()=>(await Ze(),"success"),parameters:E({})}),q({name:"mcp_call_tool",description:"Call a tool on the MCP server. The result is a list of content and a boolean indicating whether the tool call is an error.",execute:async({name:s,parameters:e})=>{const t=Object.fromEntries(e.map(({name:n,value:a})=>[n,a]));return await Re(s,t)},parameters:E({name:z().describe("The name of the tool to call"),parameters:we(E({name:z().describe("The name of the parameter"),value:ut([z(),dt(),ct(),E({})]).describe("The value of the parameter, it can be a string, a number, a boolean, or an object")})).describe("The parameters to pass to the tool")})})],mt=async()=>Promise.all(lt);export{m as Z,Ie as a,O as b,mt as m,ft as t}; diff --git a/assets/mcp-BfXpaYZf.js b/assets/mcp-BfXpaYZf.js new file mode 100644 index 0000000000000000000000000000000000000000..f8a8660ba7a83e84902969268b2537492840abd5 --- /dev/null +++ b/assets/mcp-BfXpaYZf.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/effect-WSjEuzC9-BZ1U5vd8.js","assets/index-B06xwjXa.js","assets/index-Cgf1vKOZ.css","assets/sury-DmrZ3_Oj-BFTxMXpP.js","assets/valibot-CQk-M5rL-Ba6sRWRU.js","assets/zod-Db63SLXj-uoU3L6WI.js"])))=>i.map(i=>d[i]); +import{cO as L}from"./index-B06xwjXa.js";const Ne="https://xsai.js.org/docs/packages-top/xsschema#missing-dependencies",mt=async(s,e)=>{try{return await s}catch{throw new Error(`xsschema: Missing dependencies "${e}". see ${Ne}`)}},Ze=async s=>{switch(s){case"arktype":return L(()=>import("./arktype-C-GObzDh-1xlRyYUo.js"),[]).then(async({getToJsonSchemaFn:e})=>e());case"effect":return L(()=>import("./effect-WSjEuzC9-BZ1U5vd8.js"),__vite__mapDeps([0,1,2])).then(async({getToJsonSchemaFn:e})=>e());case"sury":return L(()=>import("./sury-DmrZ3_Oj-BFTxMXpP.js"),__vite__mapDeps([3,1,2])).then(async({getToJsonSchemaFn:e})=>e());case"valibot":return L(()=>import("./valibot-CQk-M5rL-Ba6sRWRU.js"),__vite__mapDeps([4,1,2])).then(async({getToJsonSchemaFn:e})=>e());case"zod":return L(()=>import("./zod-Db63SLXj-uoU3L6WI.js"),__vite__mapDeps([5,1,2])).then(async({getToJsonSchemaFn:e})=>e());default:throw new Error(`xsschema: Unsupported schema vendor "${s}". see https://xsai.js.org/docs/packages-top/xsschema#unsupported-schema-vendor`)}},Ee=async s=>Ze(s["~standard"].vendor).then(async e=>e(s)),D=async s=>{const e=await Ee(s.parameters);return{execute:s.execute,function:{description:s.description,name:s.name,parameters:{...e,additionalProperties:!1},strict:!0},type:"function"}};var g;(function(s){s.assertEqual=n=>{};function e(n){}s.assertIs=e;function t(n){throw new Error}s.assertNever=t,s.arrayToEnum=n=>{const a={};for(const i of n)a[i]=i;return a},s.getValidEnumValues=n=>{const a=s.objectKeys(n).filter(o=>typeof n[n[o]]!="number"),i={};for(const o of a)i[o]=n[o];return s.objectValues(i)},s.objectValues=n=>s.objectKeys(n).map(function(a){return n[a]}),s.objectKeys=typeof Object.keys=="function"?n=>Object.keys(n):n=>{const a=[];for(const i in n)Object.prototype.hasOwnProperty.call(n,i)&&a.push(i);return a},s.find=(n,a)=>{for(const i of n)if(a(i))return i},s.isInteger=typeof Number.isInteger=="function"?n=>Number.isInteger(n):n=>typeof n=="number"&&Number.isFinite(n)&&Math.floor(n)===n;function r(n,a=" | "){return n.map(i=>typeof i=="string"?`'${i}'`:i).join(a)}s.joinValues=r,s.jsonStringifyReplacer=(n,a)=>typeof a=="bigint"?a.toString():a})(g||(g={}));var de;(function(s){s.mergeShapes=(e,t)=>({...e,...t})})(de||(de={}));const u=g.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),C=s=>{switch(typeof s){case"undefined":return u.undefined;case"string":return u.string;case"number":return Number.isNaN(s)?u.nan:u.number;case"boolean":return u.boolean;case"function":return u.function;case"bigint":return u.bigint;case"symbol":return u.symbol;case"object":return Array.isArray(s)?u.array:s===null?u.null:s.then&&typeof s.then=="function"&&s.catch&&typeof s.catch=="function"?u.promise:typeof Map<"u"&&s instanceof Map?u.map:typeof Set<"u"&&s instanceof Set?u.set:typeof Date<"u"&&s instanceof Date?u.date:u.object;default:return u.unknown}},d=g.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class T extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(a){return a.message},r={_errors:[]},n=a=>{for(const i of a.issues)if(i.code==="invalid_union")i.unionErrors.map(n);else if(i.code==="invalid_return_type")n(i.returnTypeError);else if(i.code==="invalid_arguments")n(i.argumentsError);else if(i.path.length===0)r._errors.push(t(i));else{let o=r,h=0;for(;ht.message){const t={},r=[];for(const n of this.issues)n.path.length>0?(t[n.path[0]]=t[n.path[0]]||[],t[n.path[0]].push(e(n))):r.push(e(n));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}}T.create=s=>new T(s);const te=(s,e)=>{let t;switch(s.code){case d.invalid_type:s.received===u.undefined?t="Required":t=`Expected ${s.expected}, received ${s.received}`;break;case d.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(s.expected,g.jsonStringifyReplacer)}`;break;case d.unrecognized_keys:t=`Unrecognized key(s) in object: ${g.joinValues(s.keys,", ")}`;break;case d.invalid_union:t="Invalid input";break;case d.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${g.joinValues(s.options)}`;break;case d.invalid_enum_value:t=`Invalid enum value. Expected ${g.joinValues(s.options)}, received '${s.received}'`;break;case d.invalid_arguments:t="Invalid function arguments";break;case d.invalid_return_type:t="Invalid function return type";break;case d.invalid_date:t="Invalid date";break;case d.invalid_string:typeof s.validation=="object"?"includes"in s.validation?(t=`Invalid input: must include "${s.validation.includes}"`,typeof s.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${s.validation.position}`)):"startsWith"in s.validation?t=`Invalid input: must start with "${s.validation.startsWith}"`:"endsWith"in s.validation?t=`Invalid input: must end with "${s.validation.endsWith}"`:g.assertNever(s.validation):s.validation!=="regex"?t=`Invalid ${s.validation}`:t="Invalid";break;case d.too_small:s.type==="array"?t=`Array must contain ${s.exact?"exactly":s.inclusive?"at least":"more than"} ${s.minimum} element(s)`:s.type==="string"?t=`String must contain ${s.exact?"exactly":s.inclusive?"at least":"over"} ${s.minimum} character(s)`:s.type==="number"?t=`Number must be ${s.exact?"exactly equal to ":s.inclusive?"greater than or equal to ":"greater than "}${s.minimum}`:s.type==="date"?t=`Date must be ${s.exact?"exactly equal to ":s.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(s.minimum))}`:t="Invalid input";break;case d.too_big:s.type==="array"?t=`Array must contain ${s.exact?"exactly":s.inclusive?"at most":"less than"} ${s.maximum} element(s)`:s.type==="string"?t=`String must contain ${s.exact?"exactly":s.inclusive?"at most":"under"} ${s.maximum} character(s)`:s.type==="number"?t=`Number must be ${s.exact?"exactly":s.inclusive?"less than or equal to":"less than"} ${s.maximum}`:s.type==="bigint"?t=`BigInt must be ${s.exact?"exactly":s.inclusive?"less than or equal to":"less than"} ${s.maximum}`:s.type==="date"?t=`Date must be ${s.exact?"exactly":s.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(s.maximum))}`:t="Invalid input";break;case d.custom:t="Invalid input";break;case d.invalid_intersection_types:t="Intersection results could not be merged";break;case d.not_multiple_of:t=`Number must be a multiple of ${s.multipleOf}`;break;case d.not_finite:t="Number must be finite";break;default:t=e.defaultError,g.assertNever(s)}return{message:t}};let Re=te;function Ie(){return Re}const je=s=>{const{data:e,path:t,errorMaps:r,issueData:n}=s,a=[...t,...n.path||[]],i={...n,path:a};if(n.message!==void 0)return{...n,path:a,message:n.message};let o="";const h=r.filter(f=>!!f).slice().reverse();for(const f of h)o=f(i,{data:e,defaultError:o}).message;return{...n,path:a,message:o}};function c(s,e){const t=Ie(),r=je({issueData:e,data:s.data,path:s.path,errorMaps:[s.common.contextualErrorMap,s.schemaErrorMap,t,t===te?void 0:te].filter(n=>!!n)});s.common.issues.push(r)}class k{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const r=[];for(const n of t){if(n.status==="aborted")return p;n.status==="dirty"&&e.dirty(),r.push(n.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,t){const r=[];for(const n of t){const a=await n.key,i=await n.value;r.push({key:a,value:i})}return k.mergeObjectSync(e,r)}static mergeObjectSync(e,t){const r={};for(const n of t){const{key:a,value:i}=n;if(a.status==="aborted"||i.status==="aborted")return p;a.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),a.value!=="__proto__"&&(typeof i.value<"u"||n.alwaysSet)&&(r[a.value]=i.value)}return{status:e.value,value:r}}}const p=Object.freeze({status:"aborted"}),U=s=>({status:"dirty",value:s}),b=s=>({status:"valid",value:s}),ce=s=>s.status==="aborted",ue=s=>s.status==="dirty",I=s=>s.status==="valid",J=s=>typeof Promise<"u"&&s instanceof Promise;var l;(function(s){s.errToObj=e=>typeof e=="string"?{message:e}:e||{},s.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(l||(l={}));var G=function(s,e,t,r){if(t==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?s!==e||!r:!e.has(s))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?r:t==="a"?r.call(s):r?r.value:e.get(s)},Te=function(s,e,t,r,n){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?s!==e||!n:!e.has(s))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?n.call(s,t):n?n.value=t:e.set(s,t),t},F,B;class A{constructor(e,t,r,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=n}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const le=(s,e)=>{if(I(e))return{success:!0,data:e.value};if(!s.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new T(s.common.issues);return this._error=t,this._error}}};function _(s){if(!s)return{};const{errorMap:e,invalid_type_error:t,required_error:r,description:n}=s;if(e&&(t||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:n}:{errorMap:(i,o)=>{const{message:h}=s;return i.code==="invalid_enum_value"?{message:h??o.defaultError}:typeof o.data>"u"?{message:h??r??o.defaultError}:i.code!=="invalid_type"?{message:o.defaultError}:{message:h??t??o.defaultError}},description:n}}class y{get description(){return this._def.description}_getType(e){return C(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:C(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new k,ctx:{common:e.parent.common,data:e.data,parsedType:C(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(J(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){const r={common:{issues:[],async:(t==null?void 0:t.async)??!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:C(e)},n=this._parseSync({data:e,path:r.path,parent:r});return le(r,n)}"~validate"(e){var r,n;const t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:C(e)};if(!this["~standard"].async)try{const a=this._parseSync({data:e,path:[],parent:t});return I(a)?{value:a.value}:{issues:t.common.issues}}catch(a){(n=(r=a==null?void 0:a.message)==null?void 0:r.toLowerCase())!=null&&n.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(a=>I(a)?{value:a.value}:{issues:t.common.issues})}async parseAsync(e,t){const r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){const r={common:{issues:[],contextualErrorMap:t==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:C(e)},n=this._parse({data:e,path:r.path,parent:r}),a=await(J(n)?n:Promise.resolve(n));return le(r,a)}refine(e,t){const r=n=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(n):t;return this._refinement((n,a)=>{const i=e(n),o=()=>a.addIssue({code:d.custom,...r(n)});return typeof Promise<"u"&&i instanceof Promise?i.then(h=>h?!0:(o(),!1)):i?!0:(o(),!1)})}refinement(e,t){return this._refinement((r,n)=>e(r)?!0:(n.addIssue(typeof t=="function"?t(r,n):t),!1))}_refinement(e){return new P({schema:this,typeName:m.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:t=>this["~validate"](t)}}optional(){return O.create(this,this._def)}nullable(){return M.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return w.create(this)}promise(){return X.create(this,this._def)}or(e){return H.create([this,e],this._def)}and(e){return Q.create(this,e,this._def)}transform(e){return new P({..._(this._def),schema:this,typeName:m.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new ne({..._(this._def),innerType:this,defaultValue:t,typeName:m.ZodDefault})}brand(){return new rt({typeName:m.ZodBranded,type:this,..._(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new ae({..._(this._def),innerType:this,catchValue:t,typeName:m.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return oe.create(this,e)}readonly(){return ie.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const $e=/^c[^\s-]{8,}$/i,Pe=/^[0-9a-z]+$/,Me=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Ve=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Le=/^[a-z0-9_-]{21}$/i,ze=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,De=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Ue=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Fe="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let ee;const Be=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,We=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,qe=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Je=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Ge=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Ye=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Ce="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",He=new RegExp(`^${Ce}$`);function Se(s){let e="[0-5]\\d";s.precision?e=`${e}\\.\\d{${s.precision}}`:s.precision==null&&(e=`${e}(\\.\\d+)?`);const t=s.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${t}`}function Qe(s){return new RegExp(`^${Se(s)}$`)}function Xe(s){let e=`${Ce}T${Se(s)}`;const t=[];return t.push(s.local?"Z?":"Z"),s.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function Ke(s,e){return!!((e==="v4"||!e)&&Be.test(s)||(e==="v6"||!e)&&qe.test(s))}function et(s,e){if(!ze.test(s))return!1;try{const[t]=s.split("."),r=t.replace(/-/g,"+").replace(/_/g,"/").padEnd(t.length+(4-t.length%4)%4,"="),n=JSON.parse(atob(r));return!(typeof n!="object"||n===null||"typ"in n&&(n==null?void 0:n.typ)!=="JWT"||!n.alg||e&&n.alg!==e)}catch{return!1}}function tt(s,e){return!!((e==="v4"||!e)&&We.test(s)||(e==="v6"||!e)&&Je.test(s))}class S extends y{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==u.string){const a=this._getOrReturnCtx(e);return c(a,{code:d.invalid_type,expected:u.string,received:a.parsedType}),p}const r=new k;let n;for(const a of this._def.checks)if(a.kind==="min")e.data.lengtha.value&&(n=this._getOrReturnCtx(e,n),c(n,{code:d.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),r.dirty());else if(a.kind==="length"){const i=e.data.length>a.value,o=e.data.lengthe.test(n),{validation:t,code:d.invalid_string,...l.errToObj(r)})}_addCheck(e){return new S({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...l.errToObj(e)})}url(e){return this._addCheck({kind:"url",...l.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...l.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...l.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...l.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...l.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...l.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...l.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...l.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...l.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...l.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...l.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...l.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(e==null?void 0:e.offset)??!1,local:(e==null?void 0:e.local)??!1,...l.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...l.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...l.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...l.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t==null?void 0:t.position,...l.errToObj(t==null?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...l.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...l.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...l.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...l.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...l.errToObj(t)})}nonempty(e){return this.min(1,l.errToObj(e))}trim(){return new S({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new S({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new S({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.valuenew S({checks:[],typeName:m.ZodString,coerce:(s==null?void 0:s.coerce)??!1,..._(s)});function st(s,e){const t=(s.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,n=t>r?t:r,a=Number.parseInt(s.toFixed(n).replace(".","")),i=Number.parseInt(e.toFixed(n).replace(".",""));return a%i/10**n}class j extends y{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==u.number){const a=this._getOrReturnCtx(e);return c(a,{code:d.invalid_type,expected:u.number,received:a.parsedType}),p}let r;const n=new k;for(const a of this._def.checks)a.kind==="int"?g.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),c(r,{code:d.invalid_type,expected:"integer",received:"float",message:a.message}),n.dirty()):a.kind==="min"?(a.inclusive?e.dataa.value:e.data>=a.value)&&(r=this._getOrReturnCtx(e,r),c(r,{code:d.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),n.dirty()):a.kind==="multipleOf"?st(e.data,a.value)!==0&&(r=this._getOrReturnCtx(e,r),c(r,{code:d.not_multiple_of,multipleOf:a.value,message:a.message}),n.dirty()):a.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),c(r,{code:d.not_finite,message:a.message}),n.dirty()):g.assertNever(a);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,l.toString(t))}gt(e,t){return this.setLimit("min",e,!1,l.toString(t))}lte(e,t){return this.setLimit("max",e,!0,l.toString(t))}lt(e,t){return this.setLimit("max",e,!1,l.toString(t))}setLimit(e,t,r,n){return new j({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:l.toString(n)}]})}_addCheck(e){return new j({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:l.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:l.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:l.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:l.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:l.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:l.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:l.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:l.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:l.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.valuee.kind==="int"||e.kind==="multipleOf"&&g.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(t===null||r.value>t)&&(t=r.value):r.kind==="max"&&(e===null||r.valuenew j({checks:[],typeName:m.ZodNumber,coerce:(s==null?void 0:s.coerce)||!1,..._(s)});class W extends y{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==u.bigint)return this._getInvalidInput(e);let r;const n=new k;for(const a of this._def.checks)a.kind==="min"?(a.inclusive?e.dataa.value:e.data>=a.value)&&(r=this._getOrReturnCtx(e,r),c(r,{code:d.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),n.dirty()):a.kind==="multipleOf"?e.data%a.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),c(r,{code:d.not_multiple_of,multipleOf:a.value,message:a.message}),n.dirty()):g.assertNever(a);return{status:n.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return c(t,{code:d.invalid_type,expected:u.bigint,received:t.parsedType}),p}gte(e,t){return this.setLimit("min",e,!0,l.toString(t))}gt(e,t){return this.setLimit("min",e,!1,l.toString(t))}lte(e,t){return this.setLimit("max",e,!0,l.toString(t))}lt(e,t){return this.setLimit("max",e,!1,l.toString(t))}setLimit(e,t,r,n){return new W({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:l.toString(n)}]})}_addCheck(e){return new W({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:l.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:l.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:l.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:l.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:l.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.valuenew W({checks:[],typeName:m.ZodBigInt,coerce:(s==null?void 0:s.coerce)??!1,..._(s)});class se extends y{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==u.boolean){const r=this._getOrReturnCtx(e);return c(r,{code:d.invalid_type,expected:u.boolean,received:r.parsedType}),p}return b(e.data)}}se.create=s=>new se({typeName:m.ZodBoolean,coerce:(s==null?void 0:s.coerce)||!1,..._(s)});class Y extends y{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==u.date){const a=this._getOrReturnCtx(e);return c(a,{code:d.invalid_type,expected:u.date,received:a.parsedType}),p}if(Number.isNaN(e.data.getTime())){const a=this._getOrReturnCtx(e);return c(a,{code:d.invalid_date}),p}const r=new k;let n;for(const a of this._def.checks)a.kind==="min"?e.data.getTime()a.value&&(n=this._getOrReturnCtx(e,n),c(n,{code:d.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),r.dirty()):g.assertNever(a);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Y({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:l.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:l.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.valuenew Y({checks:[],coerce:(s==null?void 0:s.coerce)||!1,typeName:m.ZodDate,..._(s)});class he extends y{_parse(e){if(this._getType(e)!==u.symbol){const r=this._getOrReturnCtx(e);return c(r,{code:d.invalid_type,expected:u.symbol,received:r.parsedType}),p}return b(e.data)}}he.create=s=>new he({typeName:m.ZodSymbol,..._(s)});class fe extends y{_parse(e){if(this._getType(e)!==u.undefined){const r=this._getOrReturnCtx(e);return c(r,{code:d.invalid_type,expected:u.undefined,received:r.parsedType}),p}return b(e.data)}}fe.create=s=>new fe({typeName:m.ZodUndefined,..._(s)});class me extends y{_parse(e){if(this._getType(e)!==u.null){const r=this._getOrReturnCtx(e);return c(r,{code:d.invalid_type,expected:u.null,received:r.parsedType}),p}return b(e.data)}}me.create=s=>new me({typeName:m.ZodNull,..._(s)});class pe extends y{constructor(){super(...arguments),this._any=!0}_parse(e){return b(e.data)}}pe.create=s=>new pe({typeName:m.ZodAny,..._(s)});class _e extends y{constructor(){super(...arguments),this._unknown=!0}_parse(e){return b(e.data)}}_e.create=s=>new _e({typeName:m.ZodUnknown,..._(s)});class N extends y{_parse(e){const t=this._getOrReturnCtx(e);return c(t,{code:d.invalid_type,expected:u.never,received:t.parsedType}),p}}N.create=s=>new N({typeName:m.ZodNever,..._(s)});class ye extends y{_parse(e){if(this._getType(e)!==u.undefined){const r=this._getOrReturnCtx(e);return c(r,{code:d.invalid_type,expected:u.void,received:r.parsedType}),p}return b(e.data)}}ye.create=s=>new ye({typeName:m.ZodVoid,..._(s)});class w extends y{_parse(e){const{ctx:t,status:r}=this._processInputParams(e),n=this._def;if(t.parsedType!==u.array)return c(t,{code:d.invalid_type,expected:u.array,received:t.parsedType}),p;if(n.exactLength!==null){const i=t.data.length>n.exactLength.value,o=t.data.lengthn.maxLength.value&&(c(t,{code:d.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),r.dirty()),t.common.async)return Promise.all([...t.data].map((i,o)=>n.type._parseAsync(new A(t,i,t.path,o)))).then(i=>k.mergeArray(r,i));const a=[...t.data].map((i,o)=>n.type._parseSync(new A(t,i,t.path,o)));return k.mergeArray(r,a)}get element(){return this._def.type}min(e,t){return new w({...this._def,minLength:{value:e,message:l.toString(t)}})}max(e,t){return new w({...this._def,maxLength:{value:e,message:l.toString(t)}})}length(e,t){return new w({...this._def,exactLength:{value:e,message:l.toString(t)}})}nonempty(e){return this.min(1,e)}}w.create=(s,e)=>new w({type:s,minLength:null,maxLength:null,exactLength:null,typeName:m.ZodArray,..._(e)});function R(s){if(s instanceof x){const e={};for(const t in s.shape){const r=s.shape[t];e[t]=O.create(R(r))}return new x({...s._def,shape:()=>e})}else return s instanceof w?new w({...s._def,type:R(s.element)}):s instanceof O?O.create(R(s.unwrap())):s instanceof M?M.create(R(s.unwrap())):s instanceof E?E.create(s.items.map(e=>R(e))):s}class x extends y{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),t=g.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==u.object){const f=this._getOrReturnCtx(e);return c(f,{code:d.invalid_type,expected:u.object,received:f.parsedType}),p}const{status:r,ctx:n}=this._processInputParams(e),{shape:a,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof N&&this._def.unknownKeys==="strip"))for(const f in n.data)i.includes(f)||o.push(f);const h=[];for(const f of i){const v=a[f],V=n.data[f];h.push({key:{status:"valid",value:f},value:v._parse(new A(n,V,n.path,f)),alwaysSet:f in n.data})}if(this._def.catchall instanceof N){const f=this._def.unknownKeys;if(f==="passthrough")for(const v of o)h.push({key:{status:"valid",value:v},value:{status:"valid",value:n.data[v]}});else if(f==="strict")o.length>0&&(c(n,{code:d.unrecognized_keys,keys:o}),r.dirty());else if(f!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const f=this._def.catchall;for(const v of o){const V=n.data[v];h.push({key:{status:"valid",value:v},value:f._parse(new A(n,V,n.path,v)),alwaysSet:v in n.data})}}return n.common.async?Promise.resolve().then(async()=>{const f=[];for(const v of h){const V=await v.key,Ae=await v.value;f.push({key:V,value:Ae,alwaysSet:v.alwaysSet})}return f}).then(f=>k.mergeObjectSync(r,f)):k.mergeObjectSync(r,h)}get shape(){return this._def.shape()}strict(e){return l.errToObj,new x({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,r)=>{var a,i;const n=((i=(a=this._def).errorMap)==null?void 0:i.call(a,t,r).message)??r.defaultError;return t.code==="unrecognized_keys"?{message:l.errToObj(e).message??n}:{message:n}}}:{}})}strip(){return new x({...this._def,unknownKeys:"strip"})}passthrough(){return new x({...this._def,unknownKeys:"passthrough"})}extend(e){return new x({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new x({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:m.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new x({...this._def,catchall:e})}pick(e){const t={};for(const r of g.objectKeys(e))e[r]&&this.shape[r]&&(t[r]=this.shape[r]);return new x({...this._def,shape:()=>t})}omit(e){const t={};for(const r of g.objectKeys(this.shape))e[r]||(t[r]=this.shape[r]);return new x({...this._def,shape:()=>t})}deepPartial(){return R(this)}partial(e){const t={};for(const r of g.objectKeys(this.shape)){const n=this.shape[r];e&&!e[r]?t[r]=n:t[r]=n.optional()}return new x({...this._def,shape:()=>t})}required(e){const t={};for(const r of g.objectKeys(this.shape))if(e&&!e[r])t[r]=this.shape[r];else{let a=this.shape[r];for(;a instanceof O;)a=a._def.innerType;t[r]=a}return new x({...this._def,shape:()=>t})}keyof(){return Oe(g.objectKeys(this.shape))}}x.create=(s,e)=>new x({shape:()=>s,unknownKeys:"strip",catchall:N.create(),typeName:m.ZodObject,..._(e)});x.strictCreate=(s,e)=>new x({shape:()=>s,unknownKeys:"strict",catchall:N.create(),typeName:m.ZodObject,..._(e)});x.lazycreate=(s,e)=>new x({shape:s,unknownKeys:"strip",catchall:N.create(),typeName:m.ZodObject,..._(e)});class H extends y{_parse(e){const{ctx:t}=this._processInputParams(e),r=this._def.options;function n(a){for(const o of a)if(o.result.status==="valid")return o.result;for(const o of a)if(o.result.status==="dirty")return t.common.issues.push(...o.ctx.common.issues),o.result;const i=a.map(o=>new T(o.ctx.common.issues));return c(t,{code:d.invalid_union,unionErrors:i}),p}if(t.common.async)return Promise.all(r.map(async a=>{const i={...t,common:{...t.common,issues:[]},parent:null};return{result:await a._parseAsync({data:t.data,path:t.path,parent:i}),ctx:i}})).then(n);{let a;const i=[];for(const h of r){const f={...t,common:{...t.common,issues:[]},parent:null},v=h._parseSync({data:t.data,path:t.path,parent:f});if(v.status==="valid")return v;v.status==="dirty"&&!a&&(a={result:v,ctx:f}),f.common.issues.length&&i.push(f.common.issues)}if(a)return t.common.issues.push(...a.ctx.common.issues),a.result;const o=i.map(h=>new T(h));return c(t,{code:d.invalid_union,unionErrors:o}),p}}get options(){return this._def.options}}H.create=(s,e)=>new H({options:s,typeName:m.ZodUnion,..._(e)});function re(s,e){const t=C(s),r=C(e);if(s===e)return{valid:!0,data:s};if(t===u.object&&r===u.object){const n=g.objectKeys(e),a=g.objectKeys(s).filter(o=>n.indexOf(o)!==-1),i={...s,...e};for(const o of a){const h=re(s[o],e[o]);if(!h.valid)return{valid:!1};i[o]=h.data}return{valid:!0,data:i}}else if(t===u.array&&r===u.array){if(s.length!==e.length)return{valid:!1};const n=[];for(let a=0;a{if(ce(a)||ce(i))return p;const o=re(a.value,i.value);return o.valid?((ue(a)||ue(i))&&t.dirty(),{status:t.value,value:o.data}):(c(r,{code:d.invalid_intersection_types}),p)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([a,i])=>n(a,i)):n(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}Q.create=(s,e,t)=>new Q({left:s,right:e,typeName:m.ZodIntersection,..._(t)});class E extends y{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==u.array)return c(r,{code:d.invalid_type,expected:u.array,received:r.parsedType}),p;if(r.data.lengththis._def.items.length&&(c(r,{code:d.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const a=[...r.data].map((i,o)=>{const h=this._def.items[o]||this._def.rest;return h?h._parse(new A(r,i,r.path,o)):null}).filter(i=>!!i);return r.common.async?Promise.all(a).then(i=>k.mergeArray(t,i)):k.mergeArray(t,a)}get items(){return this._def.items}rest(e){return new E({...this._def,rest:e})}}E.create=(s,e)=>{if(!Array.isArray(s))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new E({items:s,typeName:m.ZodTuple,rest:null,..._(e)})};class ge extends y{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==u.map)return c(r,{code:d.invalid_type,expected:u.map,received:r.parsedType}),p;const n=this._def.keyType,a=this._def.valueType,i=[...r.data.entries()].map(([o,h],f)=>({key:n._parse(new A(r,o,r.path,[f,"key"])),value:a._parse(new A(r,h,r.path,[f,"value"]))}));if(r.common.async){const o=new Map;return Promise.resolve().then(async()=>{for(const h of i){const f=await h.key,v=await h.value;if(f.status==="aborted"||v.status==="aborted")return p;(f.status==="dirty"||v.status==="dirty")&&t.dirty(),o.set(f.value,v.value)}return{status:t.value,value:o}})}else{const o=new Map;for(const h of i){const f=h.key,v=h.value;if(f.status==="aborted"||v.status==="aborted")return p;(f.status==="dirty"||v.status==="dirty")&&t.dirty(),o.set(f.value,v.value)}return{status:t.value,value:o}}}}ge.create=(s,e,t)=>new ge({valueType:e,keyType:s,typeName:m.ZodMap,..._(t)});class q extends y{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==u.set)return c(r,{code:d.invalid_type,expected:u.set,received:r.parsedType}),p;const n=this._def;n.minSize!==null&&r.data.sizen.maxSize.value&&(c(r,{code:d.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),t.dirty());const a=this._def.valueType;function i(h){const f=new Set;for(const v of h){if(v.status==="aborted")return p;v.status==="dirty"&&t.dirty(),f.add(v.value)}return{status:t.value,value:f}}const o=[...r.data.values()].map((h,f)=>a._parse(new A(r,h,r.path,f)));return r.common.async?Promise.all(o).then(h=>i(h)):i(o)}min(e,t){return new q({...this._def,minSize:{value:e,message:l.toString(t)}})}max(e,t){return new q({...this._def,maxSize:{value:e,message:l.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}q.create=(s,e)=>new q({valueType:s,minSize:null,maxSize:null,typeName:m.ZodSet,..._(e)});class ve extends y{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}ve.create=(s,e)=>new ve({getter:s,typeName:m.ZodLazy,..._(e)});class xe extends y{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return c(t,{received:t.data,code:d.invalid_literal,expected:this._def.value}),p}return{status:"valid",value:e.data}}get value(){return this._def.value}}xe.create=(s,e)=>new xe({value:s,typeName:m.ZodLiteral,..._(e)});function Oe(s,e){return new $({values:s,typeName:m.ZodEnum,..._(e)})}class $ extends y{constructor(){super(...arguments),F.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),r=this._def.values;return c(t,{expected:g.joinValues(r),received:t.parsedType,code:d.invalid_type}),p}if(G(this,F,"f")||Te(this,F,new Set(this._def.values),"f"),!G(this,F,"f").has(e.data)){const t=this._getOrReturnCtx(e),r=this._def.values;return c(t,{received:t.data,code:d.invalid_enum_value,options:r}),p}return b(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return $.create(e,{...this._def,...t})}exclude(e,t=this._def){return $.create(this.options.filter(r=>!e.includes(r)),{...this._def,...t})}}F=new WeakMap;$.create=Oe;class ke extends y{constructor(){super(...arguments),B.set(this,void 0)}_parse(e){const t=g.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==u.string&&r.parsedType!==u.number){const n=g.objectValues(t);return c(r,{expected:g.joinValues(n),received:r.parsedType,code:d.invalid_type}),p}if(G(this,B,"f")||Te(this,B,new Set(g.getValidEnumValues(this._def.values)),"f"),!G(this,B,"f").has(e.data)){const n=g.objectValues(t);return c(r,{received:r.data,code:d.invalid_enum_value,options:n}),p}return b(e.data)}get enum(){return this._def.values}}B=new WeakMap;ke.create=(s,e)=>new ke({values:s,typeName:m.ZodNativeEnum,..._(e)});class X extends y{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==u.promise&&t.common.async===!1)return c(t,{code:d.invalid_type,expected:u.promise,received:t.parsedType}),p;const r=t.parsedType===u.promise?t.data:Promise.resolve(t.data);return b(r.then(n=>this._def.type.parseAsync(n,{path:t.path,errorMap:t.common.contextualErrorMap})))}}X.create=(s,e)=>new X({type:s,typeName:m.ZodPromise,..._(e)});class P extends y{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===m.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:r}=this._processInputParams(e),n=this._def.effect||null,a={addIssue:i=>{c(r,i),i.fatal?t.abort():t.dirty()},get path(){return r.path}};if(a.addIssue=a.addIssue.bind(a),n.type==="preprocess"){const i=n.transform(r.data,a);if(r.common.async)return Promise.resolve(i).then(async o=>{if(t.value==="aborted")return p;const h=await this._def.schema._parseAsync({data:o,path:r.path,parent:r});return h.status==="aborted"?p:h.status==="dirty"||t.value==="dirty"?U(h.value):h});{if(t.value==="aborted")return p;const o=this._def.schema._parseSync({data:i,path:r.path,parent:r});return o.status==="aborted"?p:o.status==="dirty"||t.value==="dirty"?U(o.value):o}}if(n.type==="refinement"){const i=o=>{const h=n.refinement(o,a);if(r.common.async)return Promise.resolve(h);if(h instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(r.common.async===!1){const o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?p:(o.status==="dirty"&&t.dirty(),i(o.value),{status:t.value,value:o.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>o.status==="aborted"?p:(o.status==="dirty"&&t.dirty(),i(o.value).then(()=>({status:t.value,value:o.value}))))}if(n.type==="transform")if(r.common.async===!1){const i=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!I(i))return i;const o=n.transform(i.value,a);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:o}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(i=>I(i)?Promise.resolve(n.transform(i.value,a)).then(o=>({status:t.value,value:o})):i);g.assertNever(n)}}P.create=(s,e,t)=>new P({schema:s,typeName:m.ZodEffects,effect:e,..._(t)});P.createWithPreprocess=(s,e,t)=>new P({schema:e,effect:{type:"preprocess",transform:s},typeName:m.ZodEffects,..._(t)});class O extends y{_parse(e){return this._getType(e)===u.undefined?b(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}O.create=(s,e)=>new O({innerType:s,typeName:m.ZodOptional,..._(e)});class M extends y{_parse(e){return this._getType(e)===u.null?b(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}M.create=(s,e)=>new M({innerType:s,typeName:m.ZodNullable,..._(e)});class ne extends y{_parse(e){const{ctx:t}=this._processInputParams(e);let r=t.data;return t.parsedType===u.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}ne.create=(s,e)=>new ne({innerType:s,typeName:m.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,..._(e)});class ae extends y{_parse(e){const{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return J(n)?n.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new T(r.common.issues)},input:r.data})})):{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new T(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}ae.create=(s,e)=>new ae({innerType:s,typeName:m.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,..._(e)});class be extends y{_parse(e){if(this._getType(e)!==u.nan){const r=this._getOrReturnCtx(e);return c(r,{code:d.invalid_type,expected:u.nan,received:r.parsedType}),p}return{status:"valid",value:e.data}}}be.create=s=>new be({typeName:m.ZodNaN,..._(s)});class rt extends y{_parse(e){const{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}}class oe extends y{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const a=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?p:a.status==="dirty"?(t.dirty(),U(a.value)):this._def.out._parseAsync({data:a.value,path:r.path,parent:r})})();{const n=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return n.status==="aborted"?p:n.status==="dirty"?(t.dirty(),{status:"dirty",value:n.value}):this._def.out._parseSync({data:n.value,path:r.path,parent:r})}}static create(e,t){return new oe({in:e,out:t,typeName:m.ZodPipeline})}}class ie extends y{_parse(e){const t=this._def.innerType._parse(e),r=n=>(I(n)&&(n.value=Object.freeze(n.value)),n);return J(t)?t.then(n=>r(n)):r(t)}unwrap(){return this._def.innerType}}ie.create=(s,e)=>new ie({innerType:s,typeName:m.ZodReadonly,..._(e)});var m;(function(s){s.ZodString="ZodString",s.ZodNumber="ZodNumber",s.ZodNaN="ZodNaN",s.ZodBigInt="ZodBigInt",s.ZodBoolean="ZodBoolean",s.ZodDate="ZodDate",s.ZodSymbol="ZodSymbol",s.ZodUndefined="ZodUndefined",s.ZodNull="ZodNull",s.ZodAny="ZodAny",s.ZodUnknown="ZodUnknown",s.ZodNever="ZodNever",s.ZodVoid="ZodVoid",s.ZodArray="ZodArray",s.ZodObject="ZodObject",s.ZodUnion="ZodUnion",s.ZodDiscriminatedUnion="ZodDiscriminatedUnion",s.ZodIntersection="ZodIntersection",s.ZodTuple="ZodTuple",s.ZodRecord="ZodRecord",s.ZodMap="ZodMap",s.ZodSet="ZodSet",s.ZodFunction="ZodFunction",s.ZodLazy="ZodLazy",s.ZodLiteral="ZodLiteral",s.ZodEnum="ZodEnum",s.ZodEffects="ZodEffects",s.ZodNativeEnum="ZodNativeEnum",s.ZodOptional="ZodOptional",s.ZodNullable="ZodNullable",s.ZodDefault="ZodDefault",s.ZodCatch="ZodCatch",s.ZodPromise="ZodPromise",s.ZodBranded="ZodBranded",s.ZodPipeline="ZodPipeline",s.ZodReadonly="ZodReadonly"})(m||(m={}));const z=S.create,nt=j.create,at=se.create;N.create;const we=w.create,Z=x.create,it=H.create;Q.create;E.create;$.create;X.create;O.create;M.create;const ot=[D({name:"debug_random_number",description:"Generate a random number between 0 and 1",execute:async()=>new Promise(s=>{setTimeout(()=>{s(Math.random().toString())},1e3)}),parameters:Z({})})],pt=async()=>Promise.all(ot);async function K(s,e={},t){return window.__TAURI_INTERNALS__.invoke(s,e,t)}async function dt(s,e){await K("plugin:mcp|connect_server",{command:s,args:e})}async function ct(){await K("plugin:mcp|disconnect_server")}async function ut(){return await K("plugin:mcp|list_tools")}async function lt(s,e){return await K("plugin:mcp|call_tool",{name:s,args:e})}const ht=[D({name:"mcp_list_tools",description:"List all tools available on the MCP server",execute:async(s,e)=>await ut(),parameters:Z({})}),D({name:"mcp_connect_server",description:'Connect to the MCP server. If "success", the connection to the MCP server is successful. Otherwise, the connection fails.',execute:async({command:s,args:e})=>(await dt(s,e),"success"),parameters:Z({command:z().describe("The command to connect to the MCP server"),args:we(z()).describe("The arguments to pass to the MCP server")})}),D({name:"mcp_disconnect_server",description:'Disconnect from the MCP server. If "success", the disconnection from the MCP server is successful. Otherwise, the disconnection fails.',execute:async()=>(await ct(),"success"),parameters:Z({})}),D({name:"mcp_call_tool",description:"Call a tool on the MCP server. The result is a list of content and a boolean indicating whether the tool call is an error.",execute:async({name:s,parameters:e})=>{const t=Object.fromEntries(e.map(({name:n,value:a})=>[n,a]));return await lt(s,t)},parameters:Z({name:z().describe("The name of the tool to call"),parameters:we(Z({name:z().describe("The name of the parameter"),value:it([z(),nt(),at(),Z({})]).describe("The value of the parameter, it can be a string, a number, a boolean, or an object")})).describe("The parameters to pass to the tool")})})],_t=async()=>Promise.all(ht);export{m as Z,Ne as a,O as b,pt as d,_t as m,mt as t}; diff --git a/assets/memory-long-term-CdegH93Z.js b/assets/memory-long-term-DdtSjryl.js similarity index 71% rename from assets/memory-long-term-CdegH93Z.js rename to assets/memory-long-term-DdtSjryl.js index 57ac4d9aba8853ecacc71aa27ff6c5492dc1115b..b24585cd796780d2c1c749cbb522568f2c9de84b 100644 --- a/assets/memory-long-term-CdegH93Z.js +++ b/assets/memory-long-term-DdtSjryl.js @@ -1 +1 @@ -import{d as o,c as t,o as n}from"./index-CNH1g_GM.js";import{b as e}from"./route-block-B_A1xBdJ.js";const r=o({__name:"memory-long-term",setup(c){return(m,a)=>(n(),t("div"))}});typeof e=="function"&&e(r);export{r as default}; +import{d as o,c as t,o as n}from"./index-B06xwjXa.js";import{b as e}from"./route-block-B_A1xBdJ.js";const r=o({__name:"memory-long-term",setup(c){return(m,a)=>(n(),t("div"))}});typeof e=="function"&&e(r);export{r as default}; diff --git a/assets/memory-short-term-CkxLWbON.js b/assets/memory-short-term-CYEPVxPq.js similarity index 71% rename from assets/memory-short-term-CkxLWbON.js rename to assets/memory-short-term-CYEPVxPq.js index 6450ff3049a44f345deea3d76aaeae07cc4a7734..f512c04e17e88b4bf17039f2b2e5f7deb94887ea 100644 --- a/assets/memory-short-term-CkxLWbON.js +++ b/assets/memory-short-term-CYEPVxPq.js @@ -1 +1 @@ -import{d as o,c as t,o as r}from"./index-CNH1g_GM.js";import{b as e}from"./route-block-B_A1xBdJ.js";const n=o({__name:"memory-short-term",setup(c){return(m,a)=>(r(),t("div"))}});typeof e=="function"&&e(n);export{n as default}; +import{d as o,c as t,o as r}from"./index-B06xwjXa.js";import{b as e}from"./route-block-B_A1xBdJ.js";const n=o({__name:"memory-short-term",setup(c){return(m,a)=>(r(),t("div"))}});typeof e=="function"&&e(n);export{n as default}; diff --git a/assets/messages-VneqjxaE.js b/assets/messages-CRABX2eS.js similarity index 68% rename from assets/messages-VneqjxaE.js rename to assets/messages-CRABX2eS.js index cbb87900303e7ccf7e8bb2f3f01bba83a1597c88..72b3014897a13a6571b3c040a11fcd12b7f86374 100644 --- a/assets/messages-VneqjxaE.js +++ b/assets/messages-CRABX2eS.js @@ -1 +1 @@ -import{u as f}from"./queue-C-8apo-4.js";import{u as g,l as _}from"./queues-BGJT-GZq.js";import"./Select.vue_vue_type_style_index_0_lang-BIffysKh.js";import{_ as v}from"./Textarea.vue_vue_type_script_setup_true_lang-CLcoVpDI.js";import{d as x,e as o,c as l,o as u,a as e,b,u as k,Y as p,c6 as h,c7 as w}from"./index-CNH1g_GM.js";import"./emotions-DWNSb738.js";import"./floating-ui.core-CgBsuaUc.js";import"./Basic.vue_vue_type_script_setup_true_lang-CuYLN0Ir.js";const S={flex:"","flex-col":"","gap-2":"","p-2":""},V={flex:"","flex-row":"","gap-2":""},y={"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":""},L=x({__name:"messages",setup(B){const s=o(""),r=o([]),n=o(!1),m=f({handlers:[async i=>{r.value.push(i.data)}]}),d=g(m);async function c(){n.value=!0,d.add(s.value),d.add(_),s.value="",n.value=!1}return(i,t)=>(u(),l("div",S,[e("div",V,[b(k(v),{modelValue:s.value,"onUpdate:modelValue":t[0]||(t[0]=a=>s.value=a),placeholder:"Message",p:"2",bg:"neutral-100 dark:neutral-700","w-full":"","rounded-lg":"","outline-none":"",onSubmit:c},null,8,["modelValue"]),e("button",y,p(n.value?"Processing...":"Send"),1)]),e("div",M,[e("div",Q,[t[1]||(t[1]=e("h3",{"font-semibold":""}," TTS Message ",-1)),(u(!0),l(h,null,w(r.value,a=>(u(),l("div",{key:a},[e("div",null,p(a),1)]))),128))])])]))}});export{L as default}; +import{u as f}from"./queue-BXXXc1r6.js";import{u as g,l as _}from"./queues-DTl9VJAZ.js";import"./Select.vue_vue_type_style_index_0_lang-CzS20kE7.js";import{_ as v}from"./Textarea.vue_vue_type_script_setup_true_lang-CskDgflv.js";import{d as x,e as o,c as l,o as u,a as e,b,u as k,Y as p,c6 as h,c7 as w}from"./index-B06xwjXa.js";import"./emotions-DWNSb738.js";import"./floating-ui.core-CgBsuaUc.js";import"./Basic.vue_vue_type_script_setup_true_lang-Q6h2vVkt.js";const S={flex:"","flex-col":"","gap-2":"","p-2":""},V={flex:"","flex-row":"","gap-2":""},y={"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":""},L=x({__name:"messages",setup(B){const s=o(""),r=o([]),n=o(!1),m=f({handlers:[async i=>{r.value.push(i.data)}]}),d=g(m);async function c(){n.value=!0,d.add(s.value),d.add(_),s.value="",n.value=!1}return(i,t)=>(u(),l("div",S,[e("div",V,[b(k(v),{modelValue:s.value,"onUpdate:modelValue":t[0]||(t[0]=a=>s.value=a),placeholder:"Message",p:"2",bg:"neutral-100 dark:neutral-700","w-full":"","rounded-lg":"","outline-none":"",onSubmit:c},null,8,["modelValue"]),e("button",y,p(n.value?"Processing...":"Send"),1)]),e("div",M,[e("div",Q,[t[1]||(t[1]=e("h3",{"font-semibold":""}," TTS Message ",-1)),(u(!0),l(h,null,w(r.value,a=>(u(),l("div",{key:a},[e("div",null,p(a),1)]))),128))])])]))}});export{L as default}; diff --git a/assets/microsoft-speech-ChkGjf75.js b/assets/microsoft-speech-ChkGjf75.js deleted file mode 100644 index ce2dd81723a2f389eff28e4bb5b807b41ffcd0b6..0000000000000000000000000000000000000000 --- a/assets/microsoft-speech-ChkGjf75.js +++ /dev/null @@ -1 +0,0 @@ -import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-BQHOFrhO.js";import{d as B,$ as F,a0 as M,e as v,f as g,T,w as K,ac as N,o as q,ad as b,b as n,u as o,a as z}from"./index-CNH1g_GM.js";import"./three-vrm-animation.module-B_hGdUpX.js";import"./mcp-B7-jaCfZ.js";import"./emotions-DWNSb738.js";import{u as E}from"./providers-DP46_3AG.js";import{u as G}from"./speech-DpuUb2e9.js";import{_ as H}from"./FieldInput.vue_vue_type_script_setup_true_lang-tEOSPb7v.js";import{_ as h}from"./FieldRange.vue_vue_type_script_setup_true_lang-Dou4SIkT.js";import"./Select.vue_vue_type_style_index_0_lang-BIffysKh.js";import{_ as R,a as j}from"./SpeechProviderSettings.vue_vue_type_script_setup_true_lang-C4Rxa7-o.js";import{b as k}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./Input.vue_vue_type_script_setup_true_lang-CvnY3pbX.js";import"./floating-ui.core-CgBsuaUc.js";import"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-C-ZUDDxT.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-dwKULsMl.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-DLt6RcnD.js";import"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-CR2pR4yl.js";import"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-BpJun8-8.js";const A={flex:"~ col gap-4"},t="microsoft-speech",C="v1",D=B({__name:"microsoft-speech",setup(I){const{t:a}=F(),P={pitch:0,speed:1,volume:0},r=G(),p=E(),{providers:l}=M(p),m=v(0),V=v(1),_=v(0),d=g({get:()=>{var s;return((s=l.value[t])==null?void 0:s.region)||"eastasia"},set:s=>{l.value[t]||(l.value[t]={region:"eastasia"}),l.value[t].region=s}}),y=g(()=>{var s;return!!((s=l.value[t])!=null&&s.apiKey)}),w=g(()=>r.availableVoices[t]||[]);T(async()=>{await r.loadVoicesForProvider(t)}),K([y,d],async()=>{await r.loadVoicesForProvider(t)});async function U(s,i,e){const c=p.getProviderInstance(t);if(!c)throw new Error("Failed to initialize speech provider");const u=p.getProviderConfig(t),x=u.model||C,S={...u,region:d.value,disableSsml:!e};if(!e&&i){const $=w.value.find(f=>f.id===i);if($){const f=r.generateSSML(s,$,{...u,pitch:m.value});return await r.speech(c,x,f,i,S)}}return await r.speech(c,x,s,i,S)}return(s,i)=>(q(),N(o(j),{"provider-id":t,"default-model":C,"additional-settings":P},{"basic-settings":b(()=>[n(o(H),{modelValue:d.value,"onUpdate:modelValue":i[0]||(i[0]=e=>d.value=e),label:o(a)("settings.pages.providers.provider.microsoft-speech.fields.field.region.label"),description:o(a)("settings.pages.providers.provider.microsoft-speech.fields.field.region.description"),placeholder:"eastasia",required:"",type:"text"},null,8,["modelValue","label","description"])]),"voice-settings":b(()=>[z("div",A,[n(o(h),{modelValue:m.value,"onUpdate:modelValue":i[1]||(i[1]=e=>m.value=e),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":e=>`${e}%`},null,8,["modelValue","label","description","format-value"]),n(o(h),{modelValue:V.value,"onUpdate:modelValue":i[2]||(i[2]=e=>V.value=e),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"]),n(o(h),{modelValue:_.value,"onUpdate:modelValue":i[3]||(i[3]=e=>_.value=e),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":e=>`${e}%`},null,8,["modelValue","label","description","format-value"])])]),playground:b(()=>[n(o(R),{"available-voices":w.value,"generate-speech":U,"api-key-configured":y.value,"default-text":"Hello! This is a test of the Microsoft Speech synthesis."},null,8,["available-voices","api-key-configured"])]),_:1}))}});typeof k=="function"&&k(D);export{D as default}; diff --git a/assets/microsoft-speech-W8B1RmtI.js b/assets/microsoft-speech-W8B1RmtI.js new file mode 100644 index 0000000000000000000000000000000000000000..3a1b98e7230b3f84eb4336412acc6e413eb224fb --- /dev/null +++ b/assets/microsoft-speech-W8B1RmtI.js @@ -0,0 +1 @@ +import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-Du5e5QRV.js";import{d as B,$ as F,a0 as M,e as v,f as g,T,w as K,bk as N,o as q,bl as b,b as n,u as o,a as z}from"./index-B06xwjXa.js";import"./three-vrm.module-CtuEk7GG.js";import"./emotions-DWNSb738.js";import"./mcp-BfXpaYZf.js";import{u as E}from"./providers-BCv4E6z9.js";import{u as G}from"./speech-CLjA-Bq8.js";import{_ as H}from"./FieldInput.vue_vue_type_script_setup_true_lang-DM6oOIgU.js";import{_ as h}from"./FieldRange.vue_vue_type_script_setup_true_lang-4kHfmFIm.js";import"./Select.vue_vue_type_style_index_0_lang-CzS20kE7.js";import{_ as R,a as j}from"./SpeechProviderSettings.vue_vue_type_script_setup_true_lang-BtrnMHoG.js";import{b as k}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./Input.vue_vue_type_script_setup_true_lang-CqiG06sL.js";import"./floating-ui.core-CgBsuaUc.js";import"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-gnnCLEsG.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-BxFBRVXD.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-CyZTJR0c.js";import"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-DMARmtsp.js";import"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-BoAZvnmm.js";const A={flex:"~ col gap-4"},t="microsoft-speech",C="v1",D=B({__name:"microsoft-speech",setup(I){const{t:a}=F(),P={pitch:0,speed:1,volume:0},r=G(),p=E(),{providers:l}=M(p),m=v(0),V=v(1),_=v(0),d=g({get:()=>{var s;return((s=l.value[t])==null?void 0:s.region)||"eastasia"},set:s=>{l.value[t]||(l.value[t]={region:"eastasia"}),l.value[t].region=s}}),y=g(()=>{var s;return!!((s=l.value[t])!=null&&s.apiKey)}),w=g(()=>r.availableVoices[t]||[]);T(async()=>{await r.loadVoicesForProvider(t)}),K([y,d],async()=>{await r.loadVoicesForProvider(t)});async function U(s,i,e){const c=p.getProviderInstance(t);if(!c)throw new Error("Failed to initialize speech provider");const u=p.getProviderConfig(t),x=u.model||C,S={...u,region:d.value,disableSsml:!e};if(!e&&i){const $=w.value.find(f=>f.id===i);if($){const f=r.generateSSML(s,$,{...u,pitch:m.value});return await r.speech(c,x,f,i,S)}}return await r.speech(c,x,s,i,S)}return(s,i)=>(q(),N(o(j),{"provider-id":t,"default-model":C,"additional-settings":P},{"basic-settings":b(()=>[n(o(H),{modelValue:d.value,"onUpdate:modelValue":i[0]||(i[0]=e=>d.value=e),label:o(a)("settings.pages.providers.provider.microsoft-speech.fields.field.region.label"),description:o(a)("settings.pages.providers.provider.microsoft-speech.fields.field.region.description"),placeholder:"eastasia",required:"",type:"text"},null,8,["modelValue","label","description"])]),"voice-settings":b(()=>[z("div",A,[n(o(h),{modelValue:m.value,"onUpdate:modelValue":i[1]||(i[1]=e=>m.value=e),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":e=>`${e}%`},null,8,["modelValue","label","description","format-value"]),n(o(h),{modelValue:V.value,"onUpdate:modelValue":i[2]||(i[2]=e=>V.value=e),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"]),n(o(h),{modelValue:_.value,"onUpdate:modelValue":i[3]||(i[3]=e=>_.value=e),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":e=>`${e}%`},null,8,["modelValue","label","description","format-value"])])]),playground:b(()=>[n(o(R),{"available-voices":w.value,"generate-speech":U,"api-key-configured":y.value,"default-text":"Hello! This is a test of the Microsoft Speech synthesis."},null,8,["available-voices","api-key-configured"])]),_:1}))}});typeof k=="function"&&k(D);export{D as default}; diff --git a/assets/mistral-ai-Du-J0Q1l.js b/assets/mistral-ai-Du-J0Q1l.js new file mode 100644 index 0000000000000000000000000000000000000000..5f4c5308a6e10b375cbcf640cff9b5284ed51b69 --- /dev/null +++ b/assets/mistral-ai-Du-J0Q1l.js @@ -0,0 +1 @@ +import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-Du5e5QRV.js";import{d as k,$ as U,V as $,a0 as y,f as c,T as K,w as h,bk as w,o as x,bl as p,b as l,u as t}from"./index-B06xwjXa.js";import"./three-vrm.module-CtuEk7GG.js";import"./emotions-DWNSb738.js";import"./mcp-BfXpaYZf.js";import{u as z}from"./providers-BCv4E6z9.js";import"./Select.vue_vue_type_style_index_0_lang-CzS20kE7.js";import{_ as C,a as M}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-gnnCLEsG.js";import{_ as N}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-DMARmtsp.js";import{_ as P,a as R}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-BoAZvnmm.js";import{_ as S}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-DYsKzYwL.js";import{b as _}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./floating-ui.core-CgBsuaUc.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-BxFBRVXD.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-CyZTJR0c.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-DM6oOIgU.js";import"./Input.vue_vue_type_script_setup_true_lang-CqiG06sL.js";const a="mistral-ai",B=k({__name:"mistral-ai",setup(I){const{t:u}=U(),b=$(),d=z(),{providers:o}=y(d),n=c(()=>d.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}}),s=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}});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)||""}),h([r,s],()=>{o.value[a]={...o.value[a],apiKey:r.value,baseUrl:s.value||""}});function g(){var e;o.value[a]={...(e=n.value)==null?void 0:e.defaultOptions}}return(e,i)=>{var v,f;return x(),w(t(S),{"provider-name":(v=n.value)==null?void 0:v.localizedName,"provider-icon-color":(f=n.value)==null?void 0:f.iconColor,"on-back":()=>t(b).back()},{default:p(()=>[l(t(P),null,{default:p(()=>[l(t(R),{title:t(u)("settings.pages.providers.common.section.basic.title"),description:t(u)("settings.pages.providers.common.section.basic.description"),"on-reset":g},{default:p(()=>{var m;return[l(t(N),{modelValue:r.value,"onUpdate:modelValue":i[0]||(i[0]=V=>r.value=V),"provider-name":(m=n.value)==null?void 0:m.localizedName,placeholder:"mis-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(t(C),{title:t(u)("settings.pages.providers.common.section.advanced.title")},{default:p(()=>[l(t(M),{modelValue:s.value,"onUpdate:modelValue":i[1]||(i[1]=m=>s.value=m),placeholder:"https://api.mistral.ai/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon-color","on-back"])}}});typeof _=="function"&&_(B);export{B as default}; diff --git a/assets/mistral-ai-n7T6D5lD.js b/assets/mistral-ai-n7T6D5lD.js deleted file mode 100644 index c7b68a319dbc8fec19905745c346ba853296aa76..0000000000000000000000000000000000000000 --- a/assets/mistral-ai-n7T6D5lD.js +++ /dev/null @@ -1 +0,0 @@ -import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-BQHOFrhO.js";import{d as U,$,V as k,a0 as y,f as c,T as K,w as h,ac as w,o as x,ad as p,b as l,u as t}from"./index-CNH1g_GM.js";import"./three-vrm-animation.module-B_hGdUpX.js";import"./mcp-B7-jaCfZ.js";import"./emotions-DWNSb738.js";import{u as z}from"./providers-DP46_3AG.js";import"./Select.vue_vue_type_style_index_0_lang-BIffysKh.js";import{_ as C,a as M}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-C-ZUDDxT.js";import{_ as N}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-CR2pR4yl.js";import{_ as P,a as R}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-BpJun8-8.js";import{_ as S}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-DUl7ZNEY.js";import{b as _}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./floating-ui.core-CgBsuaUc.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-dwKULsMl.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-DLt6RcnD.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-tEOSPb7v.js";import"./Input.vue_vue_type_script_setup_true_lang-CvnY3pbX.js";const a="mistral-ai",B=U({__name:"mistral-ai",setup(I){const{t:u}=$(),b=k(),d=z(),{providers:o}=y(d),n=c(()=>d.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}}),s=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}});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)||""}),h([r,s],()=>{o.value[a]={...o.value[a],apiKey:r.value,baseUrl:s.value||""}});function g(){var e;o.value[a]={...(e=n.value)==null?void 0:e.defaultOptions}}return(e,i)=>{var v,f;return x(),w(t(S),{"provider-name":(v=n.value)==null?void 0:v.localizedName,"provider-icon-color":(f=n.value)==null?void 0:f.iconColor,"on-back":()=>t(b).back()},{default:p(()=>[l(t(P),null,{default:p(()=>[l(t(R),{title:t(u)("settings.pages.providers.common.section.basic.title"),description:t(u)("settings.pages.providers.common.section.basic.description"),"on-reset":g},{default:p(()=>{var m;return[l(t(N),{modelValue:r.value,"onUpdate:modelValue":i[0]||(i[0]=V=>r.value=V),"provider-name":(m=n.value)==null?void 0:m.localizedName,placeholder:"mis-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(t(C),{title:t(u)("settings.pages.providers.common.section.advanced.title")},{default:p(()=>[l(t(M),{modelValue:s.value,"onUpdate:modelValue":i[1]||(i[1]=m=>s.value=m),placeholder:"https://api.mistral.ai/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon-color","on-back"])}}});typeof _=="function"&&_(B);export{B as default}; diff --git a/assets/moonshot-ai-D9LhCXTR.js b/assets/moonshot-ai-D9LhCXTR.js new file mode 100644 index 0000000000000000000000000000000000000000..7998aaf3368f66fb2e165460d3f7e55abc7f917e --- /dev/null +++ b/assets/moonshot-ai-D9LhCXTR.js @@ -0,0 +1 @@ +import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-Du5e5QRV.js";import{d as k,$ as U,V as $,a0 as h,f as c,T as y,w as K,bk as w,o as x,bl as p,b as l,u as t}from"./index-B06xwjXa.js";import"./three-vrm.module-CtuEk7GG.js";import"./emotions-DWNSb738.js";import"./mcp-BfXpaYZf.js";import{u as z}from"./providers-BCv4E6z9.js";import"./Select.vue_vue_type_style_index_0_lang-CzS20kE7.js";import{_ as M,a as N}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-gnnCLEsG.js";import{_ as P}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-DMARmtsp.js";import{_ as R,a as S}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-BoAZvnmm.js";import{_ as B}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-DYsKzYwL.js";import{b as _}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./floating-ui.core-CgBsuaUc.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-BxFBRVXD.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-CyZTJR0c.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-DM6oOIgU.js";import"./Input.vue_vue_type_script_setup_true_lang-CqiG06sL.js";const a="moonshot-ai",C=k({__name:"moonshot-ai",setup(I){const{t:u}=U(),b=$(),d=z(),{providers:o}=h(d),n=c(()=>d.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}}),s=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}});y(()=>{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 g(){var e;o.value[a]={...(e=n.value)==null?void 0:e.defaultOptions}}return(e,i)=>{var v,f;return x(),w(t(B),{"provider-name":(v=n.value)==null?void 0:v.localizedName,"provider-icon":(f=n.value)==null?void 0:f.icon,"on-back":()=>t(b).back()},{default:p(()=>[l(t(R),null,{default:p(()=>[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":g},{default:p(()=>{var m;return[l(t(P),{modelValue:r.value,"onUpdate:modelValue":i[0]||(i[0]=V=>r.value=V),"provider-name":(m=n.value)==null?void 0:m.localizedName,placeholder:"ms-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(t(M),{title:t(u)("settings.pages.providers.common.section.advanced.title")},{default:p(()=>[l(t(N),{modelValue:s.value,"onUpdate:modelValue":i[1]||(i[1]=m=>s.value=m),placeholder:"https://api.moonshot.cn/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon","on-back"])}}});typeof _=="function"&&_(C);export{C as default}; diff --git a/assets/moonshot-ai-DmoJa9kd.js b/assets/moonshot-ai-DmoJa9kd.js deleted file mode 100644 index f9f5366a2bfe316b5446ae3467cbe86f7382ddd0..0000000000000000000000000000000000000000 --- a/assets/moonshot-ai-DmoJa9kd.js +++ /dev/null @@ -1 +0,0 @@ -import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-BQHOFrhO.js";import{d as U,$,V as h,a0 as k,f as c,T as y,w as K,ac as w,o as x,ad as p,b as l,u as t}from"./index-CNH1g_GM.js";import"./three-vrm-animation.module-B_hGdUpX.js";import"./mcp-B7-jaCfZ.js";import"./emotions-DWNSb738.js";import{u as z}from"./providers-DP46_3AG.js";import"./Select.vue_vue_type_style_index_0_lang-BIffysKh.js";import{_ as M,a as N}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-C-ZUDDxT.js";import{_ as P}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-CR2pR4yl.js";import{_ as R,a as S}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-BpJun8-8.js";import{_ as B}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-DUl7ZNEY.js";import{b as _}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./floating-ui.core-CgBsuaUc.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-dwKULsMl.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-DLt6RcnD.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-tEOSPb7v.js";import"./Input.vue_vue_type_script_setup_true_lang-CvnY3pbX.js";const a="moonshot-ai",C=U({__name:"moonshot-ai",setup(I){const{t:u}=$(),b=h(),d=z(),{providers:o}=k(d),n=c(()=>d.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}}),s=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}});y(()=>{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 g(){var e;o.value[a]={...(e=n.value)==null?void 0:e.defaultOptions}}return(e,i)=>{var v,f;return x(),w(t(B),{"provider-name":(v=n.value)==null?void 0:v.localizedName,"provider-icon":(f=n.value)==null?void 0:f.icon,"on-back":()=>t(b).back()},{default:p(()=>[l(t(R),null,{default:p(()=>[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":g},{default:p(()=>{var m;return[l(t(P),{modelValue:r.value,"onUpdate:modelValue":i[0]||(i[0]=V=>r.value=V),"provider-name":(m=n.value)==null?void 0:m.localizedName,placeholder:"ms-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(t(M),{title:t(u)("settings.pages.providers.common.section.advanced.title")},{default:p(()=>[l(t(N),{modelValue:s.value,"onUpdate:modelValue":i[1]||(i[1]=m=>s.value=m),placeholder:"https://api.moonshot.cn/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon","on-back"])}}});typeof _=="function"&&_(C);export{C as default}; diff --git a/assets/novita-ai-BGUP6I0O.js b/assets/novita-ai-BGUP6I0O.js deleted file mode 100644 index dcb16dc16f2a408b4987a682df01bc51f3c004a7..0000000000000000000000000000000000000000 --- a/assets/novita-ai-BGUP6I0O.js +++ /dev/null @@ -1 +0,0 @@ -import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-BQHOFrhO.js";import{d as U,$,V as k,a0 as y,f as v,T as K,w as h,ac as w,o as x,ad as u,b as l,u as t}from"./index-CNH1g_GM.js";import"./three-vrm-animation.module-B_hGdUpX.js";import"./mcp-B7-jaCfZ.js";import"./emotions-DWNSb738.js";import{u as z}from"./providers-DP46_3AG.js";import"./Select.vue_vue_type_style_index_0_lang-BIffysKh.js";import{_ as C,a as M}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-C-ZUDDxT.js";import{_ as N}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-CR2pR4yl.js";import{_ as P,a as R}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-BpJun8-8.js";import{_ as S}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-DUl7ZNEY.js";import{b as _}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./floating-ui.core-CgBsuaUc.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-dwKULsMl.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-DLt6RcnD.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-tEOSPb7v.js";import"./Input.vue_vue_type_script_setup_true_lang-CvnY3pbX.js";const a="novita-ai",B=U({__name:"novita-ai",setup(I){const{t:m}=$(),b=k(),d=z(),{providers:o}=y(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)||""}),h([r,s],()=>{o.value[a]={...o.value[a],apiKey:r.value,baseUrl:s.value||""}});function g(){var e;o.value[a]={...(e=n.value)==null?void 0:e.defaultOptions}}return(e,i)=>{var c,f;return x(),w(t(S),{"provider-name":(c=n.value)==null?void 0:c.localizedName,"provider-icon-color":(f=n.value)==null?void 0:f.iconColor,"on-back":()=>t(b).back()},{default:u(()=>[l(t(P),null,{default:u(()=>[l(t(R),{title:t(m)("settings.pages.providers.common.section.basic.title"),description:t(m)("settings.pages.providers.common.section.basic.description"),"on-reset":g},{default:u(()=>{var p;return[l(t(N),{modelValue:r.value,"onUpdate:modelValue":i[0]||(i[0]=V=>r.value=V),"provider-name":(p=n.value)==null?void 0:p.localizedName,placeholder:"nvt-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(t(C),{title:t(m)("settings.pages.providers.common.section.advanced.title")},{default:u(()=>[l(t(M),{modelValue:s.value,"onUpdate:modelValue":i[1]||(i[1]=p=>s.value=p),placeholder:"https://api.novita.ai/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon-color","on-back"])}}});typeof _=="function"&&_(B);export{B as default}; diff --git a/assets/novita-ai-D_6dOaRN.js b/assets/novita-ai-D_6dOaRN.js new file mode 100644 index 0000000000000000000000000000000000000000..9e8d73adeed4a82fc590d34738ee4c7c7fc86562 --- /dev/null +++ b/assets/novita-ai-D_6dOaRN.js @@ -0,0 +1 @@ +import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-Du5e5QRV.js";import{d as k,$ as U,V as $,a0 as y,f as v,T as K,w as h,bk as w,o as x,bl as u,b as l,u as t}from"./index-B06xwjXa.js";import"./three-vrm.module-CtuEk7GG.js";import"./emotions-DWNSb738.js";import"./mcp-BfXpaYZf.js";import{u as z}from"./providers-BCv4E6z9.js";import"./Select.vue_vue_type_style_index_0_lang-CzS20kE7.js";import{_ as C,a as M}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-gnnCLEsG.js";import{_ as N}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-DMARmtsp.js";import{_ as P,a as R}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-BoAZvnmm.js";import{_ as S}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-DYsKzYwL.js";import{b as _}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./floating-ui.core-CgBsuaUc.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-BxFBRVXD.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-CyZTJR0c.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-DM6oOIgU.js";import"./Input.vue_vue_type_script_setup_true_lang-CqiG06sL.js";const a="novita-ai",B=k({__name:"novita-ai",setup(I){const{t:m}=U(),b=$(),d=z(),{providers:o}=y(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)||""}),h([r,s],()=>{o.value[a]={...o.value[a],apiKey:r.value,baseUrl:s.value||""}});function g(){var e;o.value[a]={...(e=n.value)==null?void 0:e.defaultOptions}}return(e,i)=>{var c,f;return x(),w(t(S),{"provider-name":(c=n.value)==null?void 0:c.localizedName,"provider-icon-color":(f=n.value)==null?void 0:f.iconColor,"on-back":()=>t(b).back()},{default:u(()=>[l(t(P),null,{default:u(()=>[l(t(R),{title:t(m)("settings.pages.providers.common.section.basic.title"),description:t(m)("settings.pages.providers.common.section.basic.description"),"on-reset":g},{default:u(()=>{var p;return[l(t(N),{modelValue:r.value,"onUpdate:modelValue":i[0]||(i[0]=V=>r.value=V),"provider-name":(p=n.value)==null?void 0:p.localizedName,placeholder:"nvt-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(t(C),{title:t(m)("settings.pages.providers.common.section.advanced.title")},{default:u(()=>[l(t(M),{modelValue:s.value,"onUpdate:modelValue":i[1]||(i[1]=p=>s.value=p),placeholder:"https://api.novita.ai/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon-color","on-back"])}}});typeof _=="function"&&_(B);export{B as default}; diff --git a/assets/ollama-CGevjPsb.js b/assets/ollama-CGevjPsb.js deleted file mode 100644 index d545f547487c25a3bb0b50b12bd8473a51fec629..0000000000000000000000000000000000000000 --- a/assets/ollama-CGevjPsb.js +++ /dev/null @@ -1 +0,0 @@ -import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-BQHOFrhO.js";import{d as K,ce as x,cf as U,c as g,o as f,b as m,e as $,w as B,c5 as O,a as _,ae as R,cg as S,W as z,Y as w,c6 as D,c7 as I,$ as T,V as F,a0 as A,f as M,T as E,r as L,ac as W,ad as k,u as a}from"./index-CNH1g_GM.js";import"./three-vrm-animation.module-B_hGdUpX.js";import"./mcp-B7-jaCfZ.js";import"./emotions-DWNSb738.js";import{u as Y}from"./providers-DP46_3AG.js";import{_ as q}from"./Input.vue_vue_type_script_setup_true_lang-CvnY3pbX.js";import"./Select.vue_vue_type_style_index_0_lang-BIffysKh.js";import{a as j,_ as G}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-C-ZUDDxT.js";import{_ as H,a as J}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-BpJun8-8.js";import{_ as Q}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-DUl7ZNEY.js";import{b as C}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./floating-ui.core-CgBsuaUc.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-dwKULsMl.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-DLt6RcnD.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-tEOSPb7v.js";const X={flex:"~ gap-2"},Z=K({__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,t)=>(f(),g("div",X,[m(q,{modelValue:s.value,"onUpdate:modelValue":t[0]||(t[0]=i=>s.value=i),placeholder:o.keyPlaceholder,class:"w-1/2"},null,8,["modelValue","placeholder"]),m(q,{modelValue:u.value,"onUpdate:modelValue":t[1]||(t[1]=i=>u.value=i),placeholder:o.valuePlaceholder,class:"w-1/2"},null,8,["modelValue","placeholder"])]))}}),ee={"max-w-full":""},le={flex:"~ col gap-2"},te={class:"flex items-center gap-1 text-sm font-medium"},ae={key:0,class:"text-red-500"},oe={class:"text-xs text-neutral-500 dark:text-neutral-400","text-nowrap":""},re={flex:"~ col gap-2"},se=["onClick"],ie=K({__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"),t=$(""),i=$("");return B([t,i],()=>{u("add",t.value,i.value)}),(P,p)=>{const b=O("auto-animate");return f(),g("div",ee,[_("label",le,[_("div",null,[_("div",te,[S(w(s.label)+" ",1),s.required!==!1?(f(),g("span",ae,"*")):z("",!0)]),_("div",oe,w(s.description),1)]),R((f(),g("div",re,[(f(!0),g(D,null,I(r.value,(y,l)=>(f(),g("div",{key:l,"w-full":"",flex:"","items-center":"","gap-2":""},[m(Z,{"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,se)]))),128))])),[[b]])])])}}}),d="ollama",ne=K({__name:"ollama",setup(v){const{t:o}=T(),s=F(),u=Y(),{providers:r}=A(u),t=M(()=>u.getProviderMetadata(d)),i=M({get:()=>{var l,e,n;return((l=r.value[d])==null?void 0:l.baseUrl)||((n=(e=t.value)==null?void 0:e.defaultOptions)==null?void 0:n.baseUrl)||""},set:l=>{r.value[d]||(r.value[d]={}),r.value[d].baseUrl=l}});E(()=>{var l,e,n,V;u.initializeProvider(d),i.value=((l=r.value[d])==null?void 0:l.baseUrl)||((n=(e=t.value)==null?void 0:e.defaultOptions)==null?void 0:n.baseUrl)||"",(V=r.value[d])!=null&&V.headers||(r.value[d].headers={})});function P(){var l;r.value[d]={...(l=t.value)==null?void 0:l.defaultOptions}}const p=L([{key:"",value:""}]);function b(l,e,n){l&&l.push({key:e,value:n})}function y(l,e){e&&(e.length===1?(e[0].key="",e[0].value=""):e.splice(l,1))}return B(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 n,V;return f(),W(a(Q),{"provider-name":(n=t.value)==null?void 0:n.localizedName,"provider-icon":(V=t.value)==null?void 0:V.icon,"on-back":()=>a(s).back()},{default:k(()=>[m(a(H),null,{default:k(()=>[m(a(J),{title:a(o)("settings.pages.providers.common.section.basic.title"),description:a(o)("settings.pages.providers.common.section.basic.description"),"on-reset":P},{default:k(()=>{var c,h;return[m(a(j),{modelValue:i.value,"onUpdate:modelValue":e[0]||(e[0]=N=>i.value=N),placeholder:((h=(c=t.value)==null?void 0:c.defaultOptions)==null?void 0:h.baseUrl)||"",required:""},null,8,["modelValue","placeholder"])]}),_:1},8,["title","description"]),m(a(G),{title:a(o)("settings.pages.providers.common.section.advanced.title")},{default:k(()=>[m(a(ie),{modelValue:p,"onUpdate:modelValue":e[1]||(e[1]=c=>p=c),label:a(o)("settings.pages.providers.common.section.advanced.fields.field.headers.label"),description:a(o)("settings.pages.providers.common.section.advanced.fields.field.headers.description"),"key-placeholder":a(o)("settings.pages.providers.common.section.advanced.fields.field.headers.key.placeholder"),"value-placeholder":a(o)("settings.pages.providers.common.section.advanced.fields.field.headers.value.placeholder"),onAdd:e[2]||(e[2]=(c,h)=>b(p,c,h)),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"])}}});typeof C=="function"&&C(ne);export{ne as default}; diff --git a/assets/ollama-CJhkg7aY.js b/assets/ollama-CJhkg7aY.js new file mode 100644 index 0000000000000000000000000000000000000000..73f21d53edb3ffc27d787f619c625d13ace48748 --- /dev/null +++ b/assets/ollama-CJhkg7aY.js @@ -0,0 +1 @@ +import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-Du5e5QRV.js";import{d as K,ce as x,cf as U,c as g,o as f,b as m,e as $,w as B,c5 as O,a as _,bm as R,cg as S,W as z,Y as w,c6 as D,c7 as I,$ as T,V as F,a0 as A,f as M,T as E,r as L,bk as W,bl as h,u as o}from"./index-B06xwjXa.js";import"./three-vrm.module-CtuEk7GG.js";import"./emotions-DWNSb738.js";import"./mcp-BfXpaYZf.js";import{u as Y}from"./providers-BCv4E6z9.js";import{_ as q}from"./Input.vue_vue_type_script_setup_true_lang-CqiG06sL.js";import"./Select.vue_vue_type_style_index_0_lang-CzS20kE7.js";import{a as j,_ as G}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-gnnCLEsG.js";import{_ as H,a as J}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-BoAZvnmm.js";import{_ as Q}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-DYsKzYwL.js";import{b as C}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./floating-ui.core-CgBsuaUc.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-BxFBRVXD.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-CyZTJR0c.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-DM6oOIgU.js";const X={flex:"~ gap-2"},Z=K({__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 a=v,s=U(v,"propertyKey"),u=U(v,"propertyValue");return(r,t)=>(f(),g("div",X,[m(q,{modelValue:s.value,"onUpdate:modelValue":t[0]||(t[0]=i=>s.value=i),placeholder:a.keyPlaceholder,class:"w-1/2"},null,8,["modelValue","placeholder"]),m(q,{modelValue:u.value,"onUpdate:modelValue":t[1]||(t[1]=i=>u.value=i),placeholder:a.valuePlaceholder,class:"w-1/2"},null,8,["modelValue","placeholder"])]))}}),ee={"max-w-full":""},le={flex:"~ col gap-2"},te={class:"flex items-center gap-1 text-sm font-medium"},oe={key:0,class:"text-red-500"},ae={class:"text-xs text-neutral-500 dark:text-neutral-400","text-nowrap":""},re={flex:"~ col gap-2"},se=["onClick"],ie=K({__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:a}){const s=v,u=a,r=U(v,"modelValue"),t=$(""),i=$("");return B([t,i],()=>{u("add",t.value,i.value)}),(P,p)=>{const b=O("auto-animate");return f(),g("div",ee,[_("label",le,[_("div",null,[_("div",te,[S(w(s.label)+" ",1),s.required!==!1?(f(),g("span",oe,"*")):z("",!0)]),_("div",ae,w(s.description),1)]),R((f(),g("div",re,[(f(!0),g(D,null,I(r.value,(y,l)=>(f(),g("div",{key:l,"w-full":"",flex:"","items-center":"","gap-2":""},[m(Z,{"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,se)]))),128))])),[[b]])])])}}}),d="ollama",ne=K({__name:"ollama",setup(v){const{t:a}=T(),s=F(),u=Y(),{providers:r}=A(u),t=M(()=>u.getProviderMetadata(d)),i=M({get:()=>{var l,e,n;return((l=r.value[d])==null?void 0:l.baseUrl)||((n=(e=t.value)==null?void 0:e.defaultOptions)==null?void 0:n.baseUrl)||""},set:l=>{r.value[d]||(r.value[d]={}),r.value[d].baseUrl=l}});E(()=>{var l,e,n,k;u.initializeProvider(d),i.value=((l=r.value[d])==null?void 0:l.baseUrl)||((n=(e=t.value)==null?void 0:e.defaultOptions)==null?void 0:n.baseUrl)||"",(k=r.value[d])!=null&&k.headers||(r.value[d].headers={})});function P(){var l;r.value[d]={...(l=t.value)==null?void 0:l.defaultOptions}}const p=L([{key:"",value:""}]);function b(l,e,n){l&&l.push({key:e,value:n})}function y(l,e){e&&(e.length===1?(e[0].key="",e[0].value=""):e.splice(l,1))}return B(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 n,k;return f(),W(o(Q),{"provider-name":(n=t.value)==null?void 0:n.localizedName,"provider-icon":(k=t.value)==null?void 0:k.icon,"on-back":()=>o(s).back()},{default:h(()=>[m(o(H),null,{default:h(()=>[m(o(J),{title:o(a)("settings.pages.providers.common.section.basic.title"),description:o(a)("settings.pages.providers.common.section.basic.description"),"on-reset":P},{default:h(()=>{var c,V;return[m(o(j),{modelValue:i.value,"onUpdate:modelValue":e[0]||(e[0]=N=>i.value=N),placeholder:((V=(c=t.value)==null?void 0:c.defaultOptions)==null?void 0:V.baseUrl)||"",required:""},null,8,["modelValue","placeholder"])]}),_:1},8,["title","description"]),m(o(G),{title:o(a)("settings.pages.providers.common.section.advanced.title")},{default:h(()=>[m(o(ie),{modelValue:p,"onUpdate:modelValue":e[1]||(e[1]=c=>p=c),label:o(a)("settings.pages.providers.common.section.advanced.fields.field.headers.label"),description:o(a)("settings.pages.providers.common.section.advanced.fields.field.headers.description"),"key-placeholder":o(a)("settings.pages.providers.common.section.advanced.fields.field.headers.key.placeholder"),"value-placeholder":o(a)("settings.pages.providers.common.section.advanced.fields.field.headers.value.placeholder"),onAdd:e[2]||(e[2]=(c,V)=>b(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"])}}});typeof C=="function"&&C(ne);export{ne as default}; diff --git a/assets/openai-Bljxgvr0.js b/assets/openai-Bljxgvr0.js deleted file mode 100644 index c3657433e706427aa7705a8993b34e914e2f5c96..0000000000000000000000000000000000000000 --- a/assets/openai-Bljxgvr0.js +++ /dev/null @@ -1 +0,0 @@ -import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-BQHOFrhO.js";import{d as h,$ as V,V as k,a0 as $,f as c,T as y,w as K,ac as I,o as w,ad as n,b as p,u as t}from"./index-CNH1g_GM.js";import"./three-vrm-animation.module-B_hGdUpX.js";import"./mcp-B7-jaCfZ.js";import"./emotions-DWNSb738.js";import{u as x}from"./providers-DP46_3AG.js";import"./Select.vue_vue_type_style_index_0_lang-BIffysKh.js";import{_ as M,a as N}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-C-ZUDDxT.js";import{_ as R}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-CR2pR4yl.js";import{_ as S,a as z}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-BpJun8-8.js";import{_ as A}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-DUl7ZNEY.js";import{b as _}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./floating-ui.core-CgBsuaUc.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-dwKULsMl.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-DLt6RcnD.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-tEOSPb7v.js";import"./Input.vue_vue_type_script_setup_true_lang-CvnY3pbX.js";const e="openai",B=h({__name:"openai",setup(C){const{t:m}=V(),b=k(),v=x(),{providers:a}=$(v),u=c(()=>v.getProviderMetadata(e)),s=c({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=c({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/"}),K([s,r],()=>{a.value[e]={...a.value[e],apiKey:s.value,baseUrl:r.value||"https://api.openai.com/v1/"}});function g(){a.value[e]={baseUrl:"https://api.openai.com/v1/"}}return(o,i)=>{var d,f;return w(),I(t(A),{"provider-name":((d=u.value)==null?void 0:d.localizedName)||"OpenAI","provider-icon":(f=u.value)==null?void 0:f.icon,"on-back":()=>t(b).back()},{default:n(()=>[p(t(S),null,{default:n(()=>[p(t(z),{title:t(m)("settings.pages.providers.common.section.basic.title"),description:t(m)("settings.pages.providers.common.section.basic.description"),"on-reset":g},{default:n(()=>{var l;return[p(t(R),{modelValue:s.value,"onUpdate:modelValue":i[0]||(i[0]=U=>s.value=U),"provider-name":((l=u.value)==null?void 0:l.localizedName)||"OpenAI",placeholder:"sk-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),p(t(M),{title:t(m)("settings.pages.providers.common.section.advanced.title")},{default:n(()=>[p(t(N),{modelValue:r.value,"onUpdate:modelValue":i[1]||(i[1]=l=>r.value=l),placeholder:"https://api.openai.com/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon","on-back"])}}});typeof _=="function"&&_(B);export{B as default}; diff --git a/assets/openai-BwSo75Ba.js b/assets/openai-BwSo75Ba.js new file mode 100644 index 0000000000000000000000000000000000000000..2f5e42d612ccf24ca230d0be3d7f6d8dfa73c08c --- /dev/null +++ b/assets/openai-BwSo75Ba.js @@ -0,0 +1 @@ +import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-Du5e5QRV.js";import{d as h,$ as k,V,a0 as $,f as c,T as y,w as K,bk as I,o as w,bl as n,b as p,u as t}from"./index-B06xwjXa.js";import"./three-vrm.module-CtuEk7GG.js";import"./emotions-DWNSb738.js";import"./mcp-BfXpaYZf.js";import{u as x}from"./providers-BCv4E6z9.js";import"./Select.vue_vue_type_style_index_0_lang-CzS20kE7.js";import{_ as M,a as N}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-gnnCLEsG.js";import{_ as R}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-DMARmtsp.js";import{_ as S,a as z}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-BoAZvnmm.js";import{_ as A}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-DYsKzYwL.js";import{b as _}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./floating-ui.core-CgBsuaUc.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-BxFBRVXD.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-CyZTJR0c.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-DM6oOIgU.js";import"./Input.vue_vue_type_script_setup_true_lang-CqiG06sL.js";const e="openai",B=h({__name:"openai",setup(C){const{t:m}=k(),b=V(),v=x(),{providers:a}=$(v),u=c(()=>v.getProviderMetadata(e)),s=c({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=c({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/"}),K([s,r],()=>{a.value[e]={...a.value[e],apiKey:s.value,baseUrl:r.value||"https://api.openai.com/v1/"}});function g(){a.value[e]={baseUrl:"https://api.openai.com/v1/"}}return(o,i)=>{var d,f;return w(),I(t(A),{"provider-name":((d=u.value)==null?void 0:d.localizedName)||"OpenAI","provider-icon":(f=u.value)==null?void 0:f.icon,"on-back":()=>t(b).back()},{default:n(()=>[p(t(S),null,{default:n(()=>[p(t(z),{title:t(m)("settings.pages.providers.common.section.basic.title"),description:t(m)("settings.pages.providers.common.section.basic.description"),"on-reset":g},{default:n(()=>{var l;return[p(t(R),{modelValue:s.value,"onUpdate:modelValue":i[0]||(i[0]=U=>s.value=U),"provider-name":((l=u.value)==null?void 0:l.localizedName)||"OpenAI",placeholder:"sk-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),p(t(M),{title:t(m)("settings.pages.providers.common.section.advanced.title")},{default:n(()=>[p(t(N),{modelValue:r.value,"onUpdate:modelValue":i[1]||(i[1]=l=>r.value=l),placeholder:"https://api.openai.com/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon","on-back"])}}});typeof _=="function"&&_(B);export{B as default}; diff --git a/assets/openrouter-ai-DLii68h7.js b/assets/openrouter-ai-DLii68h7.js deleted file mode 100644 index bd39ea80dc8d9f34ab751ef27a3d3d910aa3adee..0000000000000000000000000000000000000000 --- a/assets/openrouter-ai-DLii68h7.js +++ /dev/null @@ -1 +0,0 @@ -import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-BQHOFrhO.js";import{d as k,$,V as y,a0 as K,f as _,T as O,w as h,ac as w,o as x,ad as v,b as d,u as r}from"./index-CNH1g_GM.js";import"./three-vrm-animation.module-B_hGdUpX.js";import"./mcp-B7-jaCfZ.js";import"./emotions-DWNSb738.js";import{u as z}from"./providers-DP46_3AG.js";import"./Select.vue_vue_type_style_index_0_lang-BIffysKh.js";import{_ as M,a as N}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-C-ZUDDxT.js";import{_ as P}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-CR2pR4yl.js";import{_ as R,a as S}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-BpJun8-8.js";import{_ as B}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-DUl7ZNEY.js";import{b}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./floating-ui.core-CgBsuaUc.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-dwKULsMl.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-DLt6RcnD.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-tEOSPb7v.js";import"./Input.vue_vue_type_script_setup_true_lang-CvnY3pbX.js";const a="openrouter-ai",C=k({__name:"openrouter-ai",setup(I){const{t:c}=$(),U=y(),f=z(),{providers:o}=K(f),i=_(()=>f.getProviderMetadata(a)),s=_({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,l;return((e=o.value[a])==null?void 0:e.baseUrl)||((l=(t=i.value)==null?void 0:t.defaultOptions)==null?void 0:l.baseUrl)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].baseUrl=e}});O(()=>{var e,t,l,u;f.initializeProvider(a),s.value=((e=o.value[a])==null?void 0:e.apiKey)||"",n.value=((t=o.value[a])==null?void 0:t.baseUrl)||((u=(l=i.value)==null?void 0:l.defaultOptions)==null?void 0:u.baseUrl)||""}),h([s,n],()=>{var e,t;o.value[a]={...o.value[a],apiKey:s.value,baseUrl:n.value||((t=(e=i.value)==null?void 0:e.defaultOptions)==null?void 0:t.baseUrl)||""}});function g(){var e;o.value[a]={...(e=i.value)==null?void 0:e.defaultOptions}}return(e,t)=>{var l,u;return x(),w(r(B),{"provider-name":(l=i.value)==null?void 0:l.localizedName,"provider-icon":(u=i.value)==null?void 0:u.icon,"on-back":()=>r(U).back()},{default:v(()=>[d(r(R),null,{default:v(()=>[d(r(S),{title:r(c)("settings.pages.providers.common.section.basic.title"),description:r(c)("settings.pages.providers.common.section.basic.description"),"on-reset":g},{default:v(()=>{var p;return[d(r(P),{modelValue:s.value,"onUpdate:modelValue":t[0]||(t[0]=m=>s.value=m),"provider-name":(p=i.value)==null?void 0:p.localizedName,placeholder:"sk-or-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),d(r(M),{title:r(c)("settings.pages.providers.common.section.advanced.title")},{default:v(()=>{var p,m;return[d(r(N),{modelValue:n.value,"onUpdate:modelValue":t[1]||(t[1]=V=>n.value=V),placeholder:((m=(p=i.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"])}}});typeof b=="function"&&b(C);export{C as default}; diff --git a/assets/openrouter-ai-DaZqHxnI.js b/assets/openrouter-ai-DaZqHxnI.js new file mode 100644 index 0000000000000000000000000000000000000000..68bd19cb6ec0dcb5859bdba55c9a65c7cdf4c519 --- /dev/null +++ b/assets/openrouter-ai-DaZqHxnI.js @@ -0,0 +1 @@ +import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-Du5e5QRV.js";import{d as V,$,V as y,a0 as K,f as _,T as O,w as h,bk as w,o as x,bl as v,b as d,u as r}from"./index-B06xwjXa.js";import"./three-vrm.module-CtuEk7GG.js";import"./emotions-DWNSb738.js";import"./mcp-BfXpaYZf.js";import{u as z}from"./providers-BCv4E6z9.js";import"./Select.vue_vue_type_style_index_0_lang-CzS20kE7.js";import{_ as M,a as N}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-gnnCLEsG.js";import{_ as P}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-DMARmtsp.js";import{_ as R,a as S}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-BoAZvnmm.js";import{_ as B}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-DYsKzYwL.js";import{b}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./floating-ui.core-CgBsuaUc.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-BxFBRVXD.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-CyZTJR0c.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-DM6oOIgU.js";import"./Input.vue_vue_type_script_setup_true_lang-CqiG06sL.js";const a="openrouter-ai",C=V({__name:"openrouter-ai",setup(I){const{t:c}=$(),U=y(),f=z(),{providers:o}=K(f),i=_(()=>f.getProviderMetadata(a)),s=_({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,l;return((e=o.value[a])==null?void 0:e.baseUrl)||((l=(t=i.value)==null?void 0:t.defaultOptions)==null?void 0:l.baseUrl)||""},set:e=>{o.value[a]||(o.value[a]={}),o.value[a].baseUrl=e}});O(()=>{var e,t,l,u;f.initializeProvider(a),s.value=((e=o.value[a])==null?void 0:e.apiKey)||"",n.value=((t=o.value[a])==null?void 0:t.baseUrl)||((u=(l=i.value)==null?void 0:l.defaultOptions)==null?void 0:u.baseUrl)||""}),h([s,n],()=>{var e,t;o.value[a]={...o.value[a],apiKey:s.value,baseUrl:n.value||((t=(e=i.value)==null?void 0:e.defaultOptions)==null?void 0:t.baseUrl)||""}});function g(){var e;o.value[a]={...(e=i.value)==null?void 0:e.defaultOptions}}return(e,t)=>{var l,u;return x(),w(r(B),{"provider-name":(l=i.value)==null?void 0:l.localizedName,"provider-icon":(u=i.value)==null?void 0:u.icon,"on-back":()=>r(U).back()},{default:v(()=>[d(r(R),null,{default:v(()=>[d(r(S),{title:r(c)("settings.pages.providers.common.section.basic.title"),description:r(c)("settings.pages.providers.common.section.basic.description"),"on-reset":g},{default:v(()=>{var p;return[d(r(P),{modelValue:s.value,"onUpdate:modelValue":t[0]||(t[0]=m=>s.value=m),"provider-name":(p=i.value)==null?void 0:p.localizedName,placeholder:"sk-or-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),d(r(M),{title:r(c)("settings.pages.providers.common.section.advanced.title")},{default:v(()=>{var p,m;return[d(r(N),{modelValue:n.value,"onUpdate:modelValue":t[1]||(t[1]=k=>n.value=k),placeholder:((m=(p=i.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"])}}});typeof b=="function"&&b(C);export{C as default}; diff --git a/assets/providers-DP46_3AG.js b/assets/providers-BCv4E6z9.js similarity index 99% rename from assets/providers-DP46_3AG.js rename to assets/providers-BCv4E6z9.js index b836734e8d2f1e9623db2909003d6e2db68a7750..5ba82884947865ad15ca99515aa5eb727060f2b9 100644 --- a/assets/providers-DP46_3AG.js +++ b/assets/providers-BCv4E6z9.js @@ -1 +1 @@ -var le=Object.defineProperty;var de=(a,i,n)=>i in a?le(a,i,{enumerable:!0,configurable:!0,writable:!0,value:n}):a[i]=n;var G=(a,i,n)=>de(a,typeof i!="symbol"?i+"":i,n);import{a4 as ce,cb as pe,$ as ue,e as U,w as ge,f as k}from"./index-CNH1g_GM.js";import{r as me,a as ve,e as _e,o as N}from"./index-LHmcipjy.js";const b=async a=>(a.fetch??globalThis.fetch)(me("models",a.baseURL),{headers:ve(a.headers,a.apiKey),signal:a.abortSignal}).then(_e).then(({data:i})=>i),_=a=>({chat:i=>Object.assign(a,{model:i})}),w=a=>({embed:i=>Object.assign(a,{model:i})}),he=a=>({image:i=>Object.assign(a,{model:i})}),f=a=>({model:()=>a}),fe=a=>({speech:i=>Object.assign(a,{model:i})}),be=a=>({transcription:i=>Object.assign(a,{model:i})}),g=(a,i)=>({metadata:{id:a,...i}}),m=(...a)=>Object.assign(a[0],...a.slice(1)),ye=(a,i="https://api.anthropic.com/v1/")=>m(g("anthropic"),_({apiKey:a,baseURL:i}),f({apiKey:a,baseURL:i})),D=(a,i="https://api.deepseek.com/")=>m(g("deepseek"),_({apiKey:a,baseURL:i}),f({apiKey:a,baseURL:i})),V=(a,i="https://api.fireworks.ai/inference/v1/")=>m(g("fireworks"),_({apiKey:a,baseURL:i}),w({apiKey:a,baseURL:i}),f({apiKey:a,baseURL:i})),W=(a,i="https://generativelanguage.googleapis.com/v1beta/openai/")=>m(g("google-generative-ai"),_({apiKey:a,baseURL:i}),w({apiKey:a,baseURL:i}),f({apiKey:a,baseURL:i})),H=(a,i="https://api.mistral.ai/v1/")=>m(g("mistral"),_({apiKey:a,baseURL:i}),w({apiKey:a,baseURL:i}),f({apiKey:a,baseURL:i})),J=(a,i="https://api.moonshot.cn/v1/")=>m(g("moonshot"),_({apiKey:a,baseURL:i}),f({apiKey:a,baseURL:i})),X=(a,i="https://api.novita.ai/v3/openai/")=>m(g("novita"),_({apiKey:a,baseURL:i}),f({apiKey:a,baseURL:i})),E=(a,i="https://api.openai.com/v1/")=>m(g("openai"),_({apiKey:a,baseURL:i}),w({apiKey:a,baseURL:i}),he({apiKey:a,baseURL:i}),f({apiKey:a,baseURL:i}),fe({apiKey:a,baseURL:i}),be({apiKey:a,baseURL:i})),xe=(a,i="")=>m(g("openrouter"),{chat:(n,l)=>{const h={apiKey:a,baseURL:i,model:n};return{...l?(({extraHeaders:s,models:v,provider:u})=>{s!=null&&(h.headers??(h.headers={}),Object.assign(h.headers,s));let c;return u!=null&&(c=N(u)),N({models:v,provider:c})})(l):{},...h}}},f({apiKey:a,baseURL:i})),Pe=(a,i="https://api.perplexity.ai/")=>m(g("perplexity"),_({apiKey:a,baseURL:i})),Z=(a,i="https://api.together.xyz/v1/")=>m(g("together-ai"),_({apiKey:a,baseURL:i}),w({apiKey:a,baseURL:i}),f({apiKey:a,baseURL:i,fetch:async(...n)=>globalThis.fetch(...n).then(async l=>l.json()).then(l=>Response.json({data:l,object:"list"}))})),ke=(a,i)=>{const n=`https://api.cloudflare.com/client/v4/accounts/${i}/ai/v1/`;return m(g("workers-ai"),_({apiKey:a,baseURL:n}),w({apiKey:a,baseURL:n}))},Q=(a,i="https://api.x.ai/v1/")=>m(g("xai"),_({apiKey:a,baseURL:i}),f({apiKey:a,baseURL:i})),j=(a="http://localhost:11434/v1/")=>m(g("ollama"),_({baseURL:a}),w({baseURL:a}),f({baseURL:a})),A=(...a)=>Object.assign(a[0],...a.slice(1));class T extends Error{constructor(n,l){super(n);G(this,"response");this.name="XSAIError",this.response=l}}const we=a=>a.replace(/[A-Z]/g,i=>`_${i.toLowerCase()}`),K=a=>Object.fromEntries(Object.entries(a).map(([i,n])=>[we(i),n])),Ke=a=>Object.fromEntries(Object.entries(a).filter(([,i])=>i!==void 0)),Me=(a,i)=>Ke({Authorization:i!==void 0?`Bearer ${i}`:void 0,...a}),Ce=(a,i)=>{const n=i.toString();return new URL(a,n.endsWith("/")?n:`${n}/`)},Oe=async a=>{if(!a.ok)throw new T(`Remote sent ${a.status} response: ${await a.text()}`,a);if(!a.body)throw new T("Response body is empty from remote server",a);if(!(a.body instanceof ReadableStream))throw new T(`Expected Response body to be a ReadableStream, but got ${String(a.body)}; Content Type is ${a.headers.get("Content-Type")}`,a);return a},Se=async a=>Oe(a).then(async i=>{const n=await i.text();try{return JSON.parse(n)}catch{throw new Error(`Failed to parse response, response body: ${n}`)}});var Y=(a,i="http://localhost:5933/v1/")=>{const n=({applyTextNormalization:t,languageCode:s,nextRequestIds:v,nextText:u,previousRequestIds:c,previousText:y,pronunciationDictionaryLocators:x,seed:M,voiceSettings:C})=>({extraBody:K({applyTextNormalization:t,languageCode:s,nextRequestIds:v,nextText:u,previousRequestIds:c,previousText:y,pronunciationDictionaryLocators:x?x.map(B=>K(B)):void 0,seed:M,voiceSettings:K(C??{similarityBoost:.75,stability:.5})})});return A({speech:(t,s)=>({...s?n(s):{},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?n(t):{},apiKey:a,baseURL:i})})},R=(a,i="http://localhost:5933/v1/")=>{const n=t=>{const{deploymentId:s,region:v,sampleRate:u}=t,c={deploymentId:s,region:v,sampleRate:u};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 A({speech:(t,s)=>({...s?n(s):{},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?n(t):{},apiKey:a,baseURL:i})})},ee=(a,i="http://localhost:5933/v1/")=>{const n=t=>{var v,u;const s={app:{appid:(v=t.app)==null?void 0:v.appId,token:a}};return typeof t.app<"u"&&(s.app={...t.app,appid:(u=t.app)==null?void 0:u.appId,token:a}),typeof t.user<"u"&&(s.user=t.user),typeof t.audio<"u"&&(s.audio=t.audio),{extraBody:K(s)}};return A({speech:(t,s)=>({...s?n(s):{},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?n(t):{},apiKey:a,baseURL:i})})},ae=(a,i="http://localhost:5933/v1/")=>{const n=t=>{const{sampleRate:s,volume:v,rate:u,pitch:c}=t,y={sampleRate:s,volume:v,rate:u,pitch:c};return Object.keys(y).forEach(x=>y[x]===void 0&&delete y[x]),{extraBody:K(y)}};return A({speech:(t,s)=>({...s?n(s):{},apiKey:a,baseURL:i,model:`alibaba/${t}`})},{voice:t=>{let s=i;return s.endsWith("v1/")?s=s.slice(0,-3):s.endsWith("v1")&&(s=s.slice(0,-2)),{query:"provider=alibaba",...t?n(t):{},apiKey:a,baseURL:s}}})},q=async a=>(a.fetch??globalThis.fetch)(Ce(a.query?`api/voices?${a.query}`:"api/voices",a.baseURL),{headers:Me({...a.headers},a.apiKey),method:"GET",signal:a.abortSignal}).then(Se).then(({voices:i})=>i);const Ue=[{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"}],je=ce("providers",()=>{const a=pe("settings/credentials/providers",{}),{t:i}=ue();async function n(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(o=>({id:o.id,name:o.name||o.id,provider:"openrouter-ai",description:o.description||"",contextLength:o.context_length,deprecated:!1}))}catch(r){throw console.error("Error fetching OpenRouter models:",r),r}}const l={"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=>xe(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>n(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=>j(e.baseUrl.trim()),capabilities:{listModels:async e=>(await b({...j(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=>j(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=>E(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await b({...E(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=>ye(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=>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:"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=>Q(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await b({...Q(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=>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:"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=>Y(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async()=>Ue.map(e=>({id:e.model_id,name:e.name,provider:"elevenlabs",description:e.description,contextLength:0,deprecated:!1})),listVoices:async e=>{const r=Y(e.apiKey.trim(),e.baseUrl.trim()),d=await q({...r.voice()}),o=d.findIndex(P=>P.name.includes("Aria")),p=d.findIndex(P=>P.name.includes("Bill")),I=o!==-1?o:0,F=p!==-1?p:d.length-1,z=Math.min(I,F),L=Math.max(I,F);return[...d.slice(0,z),...d.slice(L+1),...d.slice(z,L+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=>R(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=R(e.apiKey.trim(),e.baseUrl.trim());return(await q({...r.voice({region:e.region})})).map(o=>{var p;return{id:o.id,name:o.name,provider:"microsoft-speech",previewURL:o.preview_audio_url,languages:o.languages,gender:(p=o.labels)==null?void 0:p.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=>ae(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listVoices:async e=>{const r=ae(e.apiKey.trim(),e.baseUrl.trim());return(await q({...r.voice()})).map(o=>{var p;return{id:o.id,name:o.name,provider:"alibaba-cloud-model-studio",previewURL:o.preview_audio_url,languages:o.languages,gender:(p=o.labels)==null?void 0:p.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=>ee(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listVoices:async e=>{const r=ee(e.apiKey.trim(),e.baseUrl.trim());return(await q({...r.voice()})).map(o=>{var p;return{id:o.id,name:o.name,provider:"volcano-engine",previewURL:o.preview_audio_url,languages:o.languages,gender:(p=o.labels)==null?void 0:p.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=>Z(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await b({...Z(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=>X(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await b({...X(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=>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:"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=>E(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await b({...E(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=>ke(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=>Pe(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=>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:"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=>J(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await b({...J(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 d=l[e];return d?await d.validators.validateProviderConfig(r):!1}const t=U({});function s(e){var r;if(!a.value[e]){const d=l[e];a.value[e]={baseUrl:((r=d.defaultOptions)==null?void 0:r.baseUrl)||""}}}Object.keys(l).forEach(s);async function v(){await Promise.all(Object.keys(l).map(async e=>{t.value[e]=await h(e)}))}v(),ge(a,v,{deep:!0});const u=k(()=>Object.keys(l).filter(e=>t.value[e])),c=U({}),y=U({}),x=U({});async function M(e){const r=a.value[e];if(!r)return[];const d=l[e];if(!d)return[];y.value[e]=!0,x.value[e]=null;try{const o=d.capabilities.listModels?await d.capabilities.listModels(r):[];return c.value[e]=o.map(p=>({id:p.id,name:p.name,description:p.description,contextLength:p.contextLength,deprecated:p.deprecated,provider:e})),c.value[e]}catch(o){return console.error(`Error fetching models for ${e}:`,o),x.value[e]=o instanceof Error?o.message:"Unknown error",[]}finally{y.value[e]=!1}}function C(e){return c.value[e]||[]}const B=k(()=>{const e=[];for(const r of u.value)e.push(...c.value[r]||[]);return e});async function ie(){for(const e of u.value)l[e].capabilities.listModels&&await M(e)}function $(e){const r=l[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 re=k(()=>Object.values(l).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 d=l[e];if(!d)throw new Error(`Provider metadata for ${e} not found`);try{return d.createProvider(r)}catch(o){throw console.error(`Error creating provider instance for ${e}:`,o),o}}const S=k(()=>u.value.map(e=>$(e))),te=k(()=>S.value.filter(e=>{const r=O(e.id);return"chat"in r&&typeof r.chat=="function"})),ne=k(()=>S.value.filter(e=>{const r=O(e.id);return"transcription"in r&&typeof r.transcription=="function"})),se=k(()=>S.value.filter(e=>{const r=O(e.id);return"speech"in r&&typeof r.speech=="function"}));function oe(e){return a.value[e]}return{providers:a,getProviderConfig:oe,availableProviders:u,configuredProviders:t,providerMetadata:l,getProviderMetadata:$,allProvidersMetadata:re,initializeProvider:s,validateProvider:h,availableModels:c,isLoadingModels:y,modelLoadError:x,fetchModelsForProvider:M,getModelsForProvider:C,allAvailableModels:B,loadModelsForConfiguredProviders:ie,getProviderInstance:O,availableProvidersMetadata:S,availableTextGenerationsProvidersMetadata:te,availableAudioSpeechProvidersMetadata:se,availableAudioTranscriptionProvidersMetadata:ne}});export{b as l,je as u}; +var le=Object.defineProperty;var de=(a,i,n)=>i in a?le(a,i,{enumerable:!0,configurable:!0,writable:!0,value:n}):a[i]=n;var G=(a,i,n)=>de(a,typeof i!="symbol"?i+"":i,n);import{a4 as ce,cb as pe,$ as ue,e as U,w as ge,f as k}from"./index-B06xwjXa.js";import{r as me,a as ve,e as _e,o as N}from"./index-LHmcipjy.js";const b=async a=>(a.fetch??globalThis.fetch)(me("models",a.baseURL),{headers:ve(a.headers,a.apiKey),signal:a.abortSignal}).then(_e).then(({data:i})=>i),_=a=>({chat:i=>Object.assign(a,{model:i})}),w=a=>({embed:i=>Object.assign(a,{model:i})}),he=a=>({image:i=>Object.assign(a,{model:i})}),f=a=>({model:()=>a}),fe=a=>({speech:i=>Object.assign(a,{model:i})}),be=a=>({transcription:i=>Object.assign(a,{model:i})}),g=(a,i)=>({metadata:{id:a,...i}}),m=(...a)=>Object.assign(a[0],...a.slice(1)),ye=(a,i="https://api.anthropic.com/v1/")=>m(g("anthropic"),_({apiKey:a,baseURL:i}),f({apiKey:a,baseURL:i})),D=(a,i="https://api.deepseek.com/")=>m(g("deepseek"),_({apiKey:a,baseURL:i}),f({apiKey:a,baseURL:i})),V=(a,i="https://api.fireworks.ai/inference/v1/")=>m(g("fireworks"),_({apiKey:a,baseURL:i}),w({apiKey:a,baseURL:i}),f({apiKey:a,baseURL:i})),W=(a,i="https://generativelanguage.googleapis.com/v1beta/openai/")=>m(g("google-generative-ai"),_({apiKey:a,baseURL:i}),w({apiKey:a,baseURL:i}),f({apiKey:a,baseURL:i})),H=(a,i="https://api.mistral.ai/v1/")=>m(g("mistral"),_({apiKey:a,baseURL:i}),w({apiKey:a,baseURL:i}),f({apiKey:a,baseURL:i})),J=(a,i="https://api.moonshot.cn/v1/")=>m(g("moonshot"),_({apiKey:a,baseURL:i}),f({apiKey:a,baseURL:i})),X=(a,i="https://api.novita.ai/v3/openai/")=>m(g("novita"),_({apiKey:a,baseURL:i}),f({apiKey:a,baseURL:i})),E=(a,i="https://api.openai.com/v1/")=>m(g("openai"),_({apiKey:a,baseURL:i}),w({apiKey:a,baseURL:i}),he({apiKey:a,baseURL:i}),f({apiKey:a,baseURL:i}),fe({apiKey:a,baseURL:i}),be({apiKey:a,baseURL:i})),xe=(a,i="")=>m(g("openrouter"),{chat:(n,l)=>{const h={apiKey:a,baseURL:i,model:n};return{...l?(({extraHeaders:s,models:v,provider:u})=>{s!=null&&(h.headers??(h.headers={}),Object.assign(h.headers,s));let c;return u!=null&&(c=N(u)),N({models:v,provider:c})})(l):{},...h}}},f({apiKey:a,baseURL:i})),Pe=(a,i="https://api.perplexity.ai/")=>m(g("perplexity"),_({apiKey:a,baseURL:i})),Z=(a,i="https://api.together.xyz/v1/")=>m(g("together-ai"),_({apiKey:a,baseURL:i}),w({apiKey:a,baseURL:i}),f({apiKey:a,baseURL:i,fetch:async(...n)=>globalThis.fetch(...n).then(async l=>l.json()).then(l=>Response.json({data:l,object:"list"}))})),ke=(a,i)=>{const n=`https://api.cloudflare.com/client/v4/accounts/${i}/ai/v1/`;return m(g("workers-ai"),_({apiKey:a,baseURL:n}),w({apiKey:a,baseURL:n}))},Q=(a,i="https://api.x.ai/v1/")=>m(g("xai"),_({apiKey:a,baseURL:i}),f({apiKey:a,baseURL:i})),j=(a="http://localhost:11434/v1/")=>m(g("ollama"),_({baseURL:a}),w({baseURL:a}),f({baseURL:a})),A=(...a)=>Object.assign(a[0],...a.slice(1));class T extends Error{constructor(n,l){super(n);G(this,"response");this.name="XSAIError",this.response=l}}const we=a=>a.replace(/[A-Z]/g,i=>`_${i.toLowerCase()}`),K=a=>Object.fromEntries(Object.entries(a).map(([i,n])=>[we(i),n])),Ke=a=>Object.fromEntries(Object.entries(a).filter(([,i])=>i!==void 0)),Me=(a,i)=>Ke({Authorization:i!==void 0?`Bearer ${i}`:void 0,...a}),Ce=(a,i)=>{const n=i.toString();return new URL(a,n.endsWith("/")?n:`${n}/`)},Oe=async a=>{if(!a.ok)throw new T(`Remote sent ${a.status} response: ${await a.text()}`,a);if(!a.body)throw new T("Response body is empty from remote server",a);if(!(a.body instanceof ReadableStream))throw new T(`Expected Response body to be a ReadableStream, but got ${String(a.body)}; Content Type is ${a.headers.get("Content-Type")}`,a);return a},Se=async a=>Oe(a).then(async i=>{const n=await i.text();try{return JSON.parse(n)}catch{throw new Error(`Failed to parse response, response body: ${n}`)}});var Y=(a,i="http://localhost:5933/v1/")=>{const n=({applyTextNormalization:t,languageCode:s,nextRequestIds:v,nextText:u,previousRequestIds:c,previousText:y,pronunciationDictionaryLocators:x,seed:M,voiceSettings:C})=>({extraBody:K({applyTextNormalization:t,languageCode:s,nextRequestIds:v,nextText:u,previousRequestIds:c,previousText:y,pronunciationDictionaryLocators:x?x.map(B=>K(B)):void 0,seed:M,voiceSettings:K(C??{similarityBoost:.75,stability:.5})})});return A({speech:(t,s)=>({...s?n(s):{},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?n(t):{},apiKey:a,baseURL:i})})},R=(a,i="http://localhost:5933/v1/")=>{const n=t=>{const{deploymentId:s,region:v,sampleRate:u}=t,c={deploymentId:s,region:v,sampleRate:u};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 A({speech:(t,s)=>({...s?n(s):{},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?n(t):{},apiKey:a,baseURL:i})})},ee=(a,i="http://localhost:5933/v1/")=>{const n=t=>{var v,u;const s={app:{appid:(v=t.app)==null?void 0:v.appId,token:a}};return typeof t.app<"u"&&(s.app={...t.app,appid:(u=t.app)==null?void 0:u.appId,token:a}),typeof t.user<"u"&&(s.user=t.user),typeof t.audio<"u"&&(s.audio=t.audio),{extraBody:K(s)}};return A({speech:(t,s)=>({...s?n(s):{},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?n(t):{},apiKey:a,baseURL:i})})},ae=(a,i="http://localhost:5933/v1/")=>{const n=t=>{const{sampleRate:s,volume:v,rate:u,pitch:c}=t,y={sampleRate:s,volume:v,rate:u,pitch:c};return Object.keys(y).forEach(x=>y[x]===void 0&&delete y[x]),{extraBody:K(y)}};return A({speech:(t,s)=>({...s?n(s):{},apiKey:a,baseURL:i,model:`alibaba/${t}`})},{voice:t=>{let s=i;return s.endsWith("v1/")?s=s.slice(0,-3):s.endsWith("v1")&&(s=s.slice(0,-2)),{query:"provider=alibaba",...t?n(t):{},apiKey:a,baseURL:s}}})},q=async a=>(a.fetch??globalThis.fetch)(Ce(a.query?`api/voices?${a.query}`:"api/voices",a.baseURL),{headers:Me({...a.headers},a.apiKey),method:"GET",signal:a.abortSignal}).then(Se).then(({voices:i})=>i);const Ue=[{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"}],je=ce("providers",()=>{const a=pe("settings/credentials/providers",{}),{t:i}=ue();async function n(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(o=>({id:o.id,name:o.name||o.id,provider:"openrouter-ai",description:o.description||"",contextLength:o.context_length,deprecated:!1}))}catch(r){throw console.error("Error fetching OpenRouter models:",r),r}}const l={"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=>xe(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>n(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=>j(e.baseUrl.trim()),capabilities:{listModels:async e=>(await b({...j(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=>j(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=>E(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await b({...E(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=>ye(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=>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:"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=>Q(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await b({...Q(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=>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:"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=>Y(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async()=>Ue.map(e=>({id:e.model_id,name:e.name,provider:"elevenlabs",description:e.description,contextLength:0,deprecated:!1})),listVoices:async e=>{const r=Y(e.apiKey.trim(),e.baseUrl.trim()),d=await q({...r.voice()}),o=d.findIndex(P=>P.name.includes("Aria")),p=d.findIndex(P=>P.name.includes("Bill")),I=o!==-1?o:0,F=p!==-1?p:d.length-1,z=Math.min(I,F),L=Math.max(I,F);return[...d.slice(0,z),...d.slice(L+1),...d.slice(z,L+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=>R(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=R(e.apiKey.trim(),e.baseUrl.trim());return(await q({...r.voice({region:e.region})})).map(o=>{var p;return{id:o.id,name:o.name,provider:"microsoft-speech",previewURL:o.preview_audio_url,languages:o.languages,gender:(p=o.labels)==null?void 0:p.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=>ae(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listVoices:async e=>{const r=ae(e.apiKey.trim(),e.baseUrl.trim());return(await q({...r.voice()})).map(o=>{var p;return{id:o.id,name:o.name,provider:"alibaba-cloud-model-studio",previewURL:o.preview_audio_url,languages:o.languages,gender:(p=o.labels)==null?void 0:p.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=>ee(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listVoices:async e=>{const r=ee(e.apiKey.trim(),e.baseUrl.trim());return(await q({...r.voice()})).map(o=>{var p;return{id:o.id,name:o.name,provider:"volcano-engine",previewURL:o.preview_audio_url,languages:o.languages,gender:(p=o.labels)==null?void 0:p.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=>Z(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await b({...Z(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=>X(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await b({...X(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=>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:"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=>E(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await b({...E(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=>ke(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=>Pe(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=>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:"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=>J(e.apiKey.trim(),e.baseUrl.trim()),capabilities:{listModels:async e=>(await b({...J(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 d=l[e];return d?await d.validators.validateProviderConfig(r):!1}const t=U({});function s(e){var r;if(!a.value[e]){const d=l[e];a.value[e]={baseUrl:((r=d.defaultOptions)==null?void 0:r.baseUrl)||""}}}Object.keys(l).forEach(s);async function v(){await Promise.all(Object.keys(l).map(async e=>{t.value[e]=await h(e)}))}v(),ge(a,v,{deep:!0});const u=k(()=>Object.keys(l).filter(e=>t.value[e])),c=U({}),y=U({}),x=U({});async function M(e){const r=a.value[e];if(!r)return[];const d=l[e];if(!d)return[];y.value[e]=!0,x.value[e]=null;try{const o=d.capabilities.listModels?await d.capabilities.listModels(r):[];return c.value[e]=o.map(p=>({id:p.id,name:p.name,description:p.description,contextLength:p.contextLength,deprecated:p.deprecated,provider:e})),c.value[e]}catch(o){return console.error(`Error fetching models for ${e}:`,o),x.value[e]=o instanceof Error?o.message:"Unknown error",[]}finally{y.value[e]=!1}}function C(e){return c.value[e]||[]}const B=k(()=>{const e=[];for(const r of u.value)e.push(...c.value[r]||[]);return e});async function ie(){for(const e of u.value)l[e].capabilities.listModels&&await M(e)}function $(e){const r=l[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 re=k(()=>Object.values(l).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 d=l[e];if(!d)throw new Error(`Provider metadata for ${e} not found`);try{return d.createProvider(r)}catch(o){throw console.error(`Error creating provider instance for ${e}:`,o),o}}const S=k(()=>u.value.map(e=>$(e))),te=k(()=>S.value.filter(e=>{const r=O(e.id);return"chat"in r&&typeof r.chat=="function"})),ne=k(()=>S.value.filter(e=>{const r=O(e.id);return"transcription"in r&&typeof r.transcription=="function"})),se=k(()=>S.value.filter(e=>{const r=O(e.id);return"speech"in r&&typeof r.speech=="function"}));function oe(e){return a.value[e]}return{providers:a,getProviderConfig:oe,availableProviders:u,configuredProviders:t,providerMetadata:l,getProviderMetadata:$,allProvidersMetadata:re,initializeProvider:s,validateProvider:h,availableModels:c,isLoadingModels:y,modelLoadError:x,fetchModelsForProvider:M,getModelsForProvider:C,allAvailableModels:B,loadModelsForConfiguredProviders:ie,getProviderInstance:O,availableProvidersMetadata:S,availableTextGenerationsProvidersMetadata:te,availableAudioSpeechProvidersMetadata:se,availableAudioTranscriptionProvidersMetadata:ne}});export{b as l,je as u}; diff --git a/assets/queue-C-8apo-4.js b/assets/queue-BXXXc1r6.js similarity index 91% rename from assets/queue-C-8apo-4.js rename to assets/queue-BXXXc1r6.js index ce848be8226c2c8894ec94b7704c575d428b5c03..44cae875c6f3e354dcebae0fe6cfe1f72f16183e 100644 --- a/assets/queue-C-8apo-4.js +++ b/assets/queue-BXXXc1r6.js @@ -1 +1 @@ -import{e as l}from"./index-CNH1g_GM.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 E(){const n=t.value.shift();if(n)return r("pick",n),n}async function u(){if(a.value)return;const n=E();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{e as l}from"./index-B06xwjXa.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 E(){const n=t.value.shift();if(n)return r("pick",n),n}async function u(){if(a.value)return;const n=E();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/queue-B_aWwf6M.js b/assets/queue-BjPeTqlQ.js similarity index 90% rename from assets/queue-B_aWwf6M.js rename to assets/queue-BjPeTqlQ.js index 0a31eb1c683cf3fecfc3c7ec9eb27855a84c4c84..f3a4476e61e10d41be4552fe09727ed6d3249f24 100644 --- a/assets/queue-B_aWwf6M.js +++ b/assets/queue-BjPeTqlQ.js @@ -1 +1 @@ -import{u as o}from"./queue-C-8apo-4.js";import{d as v,e as h,T as k,c as w,o as g,a as I}from"./index-CNH1g_GM.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)}]}),c=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)}]}),l=["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 l)await i(100),c.add(e)}async function m(){f()}return k(()=>{m()}),(e,a)=>(g(),w("div",null,a[0]||(a[0]=[I("div",null,null,-1)])))}});export{Q as default}; +import{u as o}from"./queue-BXXXc1r6.js";import{d as v,e as h,T as k,c as w,o as g,a as I}from"./index-B06xwjXa.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)}]}),c=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)}]}),l=["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 l)await i(100),c.add(e)}async function m(){f()}return k(()=>{m()}),(e,a)=>(g(),w("div",null,a[0]||(a[0]=[I("div",null,null,-1)])))}});export{Q as default}; diff --git a/assets/queues-BGJT-GZq.js b/assets/queues-DTl9VJAZ.js similarity index 94% rename from assets/queues-BGJT-GZq.js rename to assets/queues-DTl9VJAZ.js index 6f6959564cbf3de1ba4c954e094fb4926295cebf..eca2518024200f51e48f8375f2538ba76610e3f7 100644 --- a/assets/queues-BGJT-GZq.js +++ b/assets/queues-DTl9VJAZ.js @@ -1 +1 @@ -import{c as i}from"./emotions-DWNSb738.js";import{u as s}from"./queue-C-8apo-4.js";import{e as d}from"./index-CNH1g_GM.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{c as i}from"./emotions-DWNSb738.js";import{u as s}from"./queue-BXXXc1r6.js";import{e as d}from"./index-B06xwjXa.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/settings-ANs_Jv0A.js b/assets/settings-ANs_Jv0A.js deleted file mode 100644 index c1da8a929c49dce87f0bd446a5211c4466986899..0000000000000000000000000000000000000000 --- a/assets/settings-ANs_Jv0A.js +++ /dev/null @@ -1 +0,0 @@ -var rt=Object.defineProperty;var ot=(t,s,e)=>s in t?rt(t,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[s]=e;var m=(t,s,e)=>ot(t,typeof s!="symbol"?s+"":s,e);import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-BQHOFrhO.js";import{r as D,w as y,u as A,e as g,f as B,i as at,g as ut,h as b,j as J,n as lt,k as V,l as M,p as u,m as $,q as O,s as S,t as v,v as ct,x as ft,y as pt,z as U,A as dt,B as mt,C as gt,D as ht,E as yt,F as bt,G as vt,H as xt,I as Tt,J as At,K as Ot,L as wt,M as kt,N as Bt,O as Et,P as St,Q as jt,S as Pt,d as Q,T as Vt,U as Ct,c as j,a as k,V as Nt,W,X as Rt,Y as X,o as P,Z as _,_ as Y,$ as Mt,a0 as zt,b as C,R as Dt}from"./index-CNH1g_GM.js";import"./three-vrm-animation.module-B_hGdUpX.js";import"./mcp-B7-jaCfZ.js";import"./emotions-DWNSb738.js";import{u as Lt}from"./providers-DP46_3AG.js";import"./Select.vue_vue_type_style_index_0_lang-BIffysKh.js";import{H as Ft}from"./HeaderLink-LlW9hXo1.js";import"./index-LHmcipjy.js";import"./floating-ui.core-CgBsuaUc.js";const T={};class Ht{constructor(){m(this,"subscriptions",new Set)}add(s){return this.subscriptions.add(s),()=>this.subscriptions.delete(s)}notify(s,e,n){if(this.subscriptions.size)for(const i of this.subscriptions)i(s,e,n)}clear(){this.subscriptions.clear()}}function Z(t){return!Number.isNaN(Number.parseFloat(t))}class $t{constructor(s){m(this,"current");m(this,"prev");m(this,"timeDelta",0);m(this,"lastUpdated",0);m(this,"updateSubscribers",new Ht);m(this,"stopAnimation");m(this,"canTrackVelocity",!1);m(this,"updateAndNotify",s=>{this.prev=this.current,this.current=s;const{delta:e,timestamp:n}=pt();this.lastUpdated!==n&&(this.timeDelta=e,this.lastUpdated=n),U.postRender(this.scheduleVelocityCheck),this.updateSubscribers.notify(this.current)});m(this,"scheduleVelocityCheck",()=>U.postRender(this.velocityCheck));m(this,"velocityCheck",({timestamp:s})=>{this.canTrackVelocity||(this.canTrackVelocity=Z(this.current)),s!==this.lastUpdated&&(this.prev=this.current)});this.prev=this.current=s,this.canTrackVelocity=Z(this.current)}onChange(s){return this.updateSubscribers.add(s)}clearListeners(){this.updateSubscribers.clear()}set(s){this.updateAndNotify(s)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?dt(Number.parseFloat(this.current)-Number.parseFloat(this.prev),this.timeDelta):0}start(s){return this.stop(),new Promise(e=>{const{stop:n}=s(e);this.stopAnimation=n}).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 Ut(t){return new $t(t)}const{isArray:Wt}=Array;function Xt(){const t=g({}),s=n=>{const i=r=>{t.value[r]&&(t.value[r].stop(),t.value[r].destroy(),delete t.value[r])};n?Wt(n)?n.forEach(i):i(n):Object.keys(t.value).forEach(i)},e=(n,i,r)=>{if(t.value[n])return t.value[n];const o=Ut(i);return o.onChange(a=>r[n]=a),t.value[n]=o,o};return jt(s),{motionValues:t,get:e,stop:s}}function Yt(t){return Array.isArray(t)}function w(){return{type:"spring",stiffness:500,damping:25,restDelta:.5,restSpeed:10}}function N(t){return{type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restDelta:.01,restSpeed:10}}function Zt(t){return{type:"spring",stiffness:550,damping:t===0?100:30,restDelta:.01,restSpeed:10}}function R(){return{type:"keyframes",ease:"linear",duration:300}}function It(t){return{type:"keyframes",duration:800,values:t}}const I={default:Zt,x:w,y:w,z:w,rotate:w,rotateX:w,rotateY:w,rotateZ:w,scaleX:N,scaleY:N,scale:N,backgroundColor:R,color:R,opacity:R};function tt(t,s){let e;return Yt(s)?e=It:e=I[t]||I.default,{to:s,...e(s)}}const K={...lt,transform:Math.round},et={color:v,backgroundColor:v,outlineColor:v,fill:v,stroke:v,borderColor:v,borderTopColor:v,borderRightColor:v,borderBottomColor:v,borderLeftColor:v,borderWidth:u,borderTopWidth:u,borderRightWidth:u,borderBottomWidth:u,borderLeftWidth:u,borderRadius:u,radius:u,borderTopLeftRadius:u,borderTopRightRadius:u,borderBottomRightRadius:u,borderBottomLeftRadius:u,width:u,maxWidth:u,height:u,maxHeight:u,size:u,top:u,right:u,bottom:u,left:u,padding:u,paddingTop:u,paddingRight:u,paddingBottom:u,paddingLeft:u,margin:u,marginTop:u,marginRight:u,marginBottom:u,marginLeft:u,rotate:O,rotateX:O,rotateY:O,rotateZ:O,scale:S,scaleX:S,scaleY:S,scaleZ:S,skew:O,skewX:O,skewY:O,distance:u,translateX:u,translateY:u,translateZ:u,x:u,y:u,z:u,perspective:u,transformPerspective:u,opacity:V,originX:$,originY:$,originZ:u,zIndex:K,filter:M,WebkitFilter:M,fillOpacity:V,strokeOpacity:V,numOctaves:K},L=t=>et[t];function z(t,s){return s&&typeof t=="number"&&s.transform?s.transform(t):t}function Kt(t,s){let e=L(t);return e!==M&&(e=J),e.getAnimatableNone?e.getAnimatableNone(s):void 0}const qt={linear:St,easeIn:Et,easeInOut:Bt,easeOut:kt,circIn:wt,circInOut:Ot,circOut:At,backIn:Tt,backInOut:xt,backOut:vt,anticipate:bt,bounceIn:yt,bounceInOut:ht,bounceOut:gt};function q(t){if(Array.isArray(t)){const[s,e,n,i]=t;return mt(s,e,n,i)}else if(typeof t=="string")return qt[t];return t}function Gt(t){return Array.isArray(t)&&typeof t[0]!="number"}function G(t,s){return t==="zIndex"?!1:!!(typeof s=="number"||Array.isArray(s)||typeof s=="string"&&J.test(s)&&!s.startsWith("url("))}function Jt(t){return Array.isArray(t.to)&&t.to[0]===null&&(t.to=[...t.to],t.to[0]=t.from),t}function Qt({ease:t,times:s,delay:e,...n}){const i={...n};return s&&(i.offset=s),t&&(i.ease=Gt(t)?t.map(q):q(t)),e&&(i.elapsed=-e),i}function _t(t,s,e){return Array.isArray(s.to)&&(t.duration||(t.duration=800)),Jt(s),te(t)||(t={...t,...tt(e,s.to)}),{...s,...Qt(t)}}function te({delay:t,repeat:s,repeatType:e,repeatDelay:n,from:i,...r}){return!!Object.keys(r).length}function ee(t,s){return t[s]||t.default||t}function se(t,s,e,n,i){const r=ee(n,t);let o=r.from===null||r.from===void 0?s.get():r.from;const a=G(t,e);o==="none"&&a&&typeof e=="string"&&(o=Kt(t,e));const c=G(t,o);function p(f){const d={from:o,to:e,velocity:n.velocity?n.velocity:s.getVelocity(),onUpdate:x=>s.set(x)};return r.type==="inertia"||r.type==="decay"?ct({...d,...r}):ft({..._t(r,d,t),onUpdate:x=>{d.onUpdate(x),r.onUpdate&&r.onUpdate(x)},onComplete:()=>{i&&i(),f&&f()}})}function l(f){return s.set(e),i&&i(),f&&f(),{stop:()=>{}}}return!c||!a||r.type===!1?l:p}function ie(){const{motionValues:t,stop:s,get:e}=Xt();return{motionValues:t,stop:s,push:(i,r,o,a={},c)=>{const p=o[i],l=e(i,p,o);if(a&&a.immediate){l.set(r);return}const f=se(i,l,r,a,c);l.start(f)}}}function ne(t,s={},{motionValues:e,push:n,stop:i}=ie()){const r=A(s),o=g(!1);y(e,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]},c=f=>{typeof f=="string"&&(f=a(f));const d=Object.entries(f).map(([h,E])=>{if(h!=="transition")return new Promise(nt=>n(h,E,t,f.transition||tt(h,f[h]),nt))}).filter(Boolean);async function x(){var h,E;await Promise.all(d),(E=(h=f.transition)==null?void 0:h.onComplete)==null||E.call(h)}return Promise.all([x()])};return{isAnimating:o,apply:c,set:f=>{const d=at(f)?f:a(f);Object.entries(d).forEach(([x,h])=>{x!=="transition"&&n(x,h,t,{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 c(d),f()},stop:i}}const F=typeof window<"u",re=()=>F&&(window.onpointerdown===null||(T==null?void 0:T.TEST)),oe=()=>F&&(window.ontouchstart===null||(T==null?void 0:T.TEST)),ae=()=>F&&(window.onmousedown===null||(T==null?void 0:T.TEST));function ue({target:t,state:s,variants:e,apply:n}){const i=A(e),r=g(!1),o=g(!1),a=g(!1),c=B(()=>{let l=[...Object.keys(s.value||{})];return i&&(i.hovered&&(l=[...l,...Object.keys(i.hovered)]),i.tapped&&(l=[...l,...Object.keys(i.tapped)]),i.focused&&(l=[...l,...Object.keys(i.focused)])),l}),p=B(()=>{const l={};Object.assign(l,s.value),r.value&&i.hovered&&Object.assign(l,i.hovered),o.value&&i.tapped&&Object.assign(l,i.tapped),a.value&&i.focused&&Object.assign(l,i.focused);for(const f in l)c.value.includes(f)||delete l[f];return l});i.hovered&&(b(t,"mouseenter",()=>r.value=!0),b(t,"mouseleave",()=>{r.value=!1,o.value=!1})),i.tapped&&(ae()&&(b(t,"mousedown",()=>o.value=!0),b(t,"mouseup",()=>o.value=!1)),re()&&(b(t,"pointerdown",()=>o.value=!0),b(t,"pointerup",()=>o.value=!1)),oe()&&(b(t,"touchstart",()=>o.value=!0),b(t,"touchend",()=>o.value=!1))),i.focused&&(b(t,"focus",()=>a.value=!0),b(t,"blur",()=>a.value=!1)),y([r,o,a],()=>{n(p.value)})}function le({set:t,target:s,variants:e,variant:n}){const i=A(e);y(()=>s,()=>{i&&(i.initial&&(t("initial"),n.value="initial"),i.enter&&(n.value="enter"))},{immediate:!0,flush:"pre"})}function ce({state:t,apply:s}){y(t,e=>{e&&s(e)},{immediate:!0})}function fe({target:t,variants:s,variant:e}){const n=A(s);n&&(n.visible||n.visibleOnce)&&ut(t,([{isIntersecting:i}])=>{n.visible?i?e.value="visible":e.value="initial":n.visibleOnce&&(i&&e.value!=="visibleOnce"?e.value="visibleOnce":e.value||(e.value="initial"))})}function pe(t,s={syncVariants:!0,lifeCycleHooks:!0,visibilityHooks:!0,eventListeners:!0}){s.lifeCycleHooks&&le(t),s.syncVariants&&ce(t),s.visibilityHooks&&fe(t),s.eventListeners&&ue(t)}function de(t={}){const s=D({...t}),e=g({});return y(s,()=>{const n={};for(const[i,r]of Object.entries(s)){const o=L(i),a=z(r,o);n[i]=a}e.value=n},{immediate:!0,deep:!0}),{state:s,style:e}}function H(t,s){y(()=>Pt(t),e=>{e&&s(e)},{immediate:!0})}const me={x:"translateX",y:"translateY",z:"translateZ"};function ge(t={},s=!0){const e=D({...t}),n=g("");return y(e,i=>{let r="",o=!1;if(s&&(i.x||i.y||i.z)){const a=[i.x||0,i.y||0,i.z||0].map(c=>z(c,u)).join(",");r+=`translate3d(${a}) `,o=!0}for(const[a,c]of Object.entries(i)){if(s&&(a==="x"||a==="y"||a==="z"))continue;const p=L(a),l=z(c,p);r+=`${me[a]||a}(${l}) `}s&&!o&&(r+="translateZ(0px) "),n.value=r.trim()},{immediate:!0,deep:!0}),{state:e,transform:n}}const he=["","X","Y","Z"],ye=["perspective","translate","scale","rotate","skew"],st=["transformPerspective","x","y","z"];ye.forEach(t=>{he.forEach(s=>{const e=t+s;st.push(e)})});const be=new Set(st);function it(t){return be.has(t)}const ve=new Set(["originX","originY","originZ"]);function xe(t){return ve.has(t)}function Te(t,s){let e,n;const{state:i,style:r}=de();return H(t,o=>{n=o;for(const a of Object.keys(et))o.style[a]===null||o.style[a]===""||it(a)||xe(a)||(i[a]=o.style[a]);e&&Object.entries(e).forEach(([a,c])=>o.style[a]=c),s&&s(i)}),y(r,o=>{if(!n){e=o;return}for(const a in o)n.style[a]=o[a]},{immediate:!0}),{style:i}}function Ae(t){const s=t.trim().split(/\) |\)/);if(s.length===1)return{};const e=n=>n.endsWith("px")||n.endsWith("deg")?Number.parseFloat(n):Number.isNaN(Number(n))?Number(n):n;return s.reduce((n,i)=>{if(!i)return n;const[r,o]=i.split("("),c=o.split(",").map(l=>e(l.endsWith(")")?l.replace(")",""):l.trim())),p=c.length===1?c[0]:c;return{...n,[r]:p}},{})}function Oe(t,s){Object.entries(Ae(s)).forEach(([e,n])=>{const i=["x","y","z"];if(e==="translate3d"){if(n===0){i.forEach(r=>t[r]=0);return}n.forEach((r,o)=>t[i[o]]=r);return}if(n=Number.parseFloat(`${n}`),e==="translateX"){t.x=n;return}if(e==="translateY"){t.y=n;return}if(e==="translateZ"){t.z=n;return}t[e]=n})}function we(t,s){let e,n;const{state:i,transform:r}=ge();return H(t,o=>{n=o,o.style.transform&&Oe(i,o.style.transform),e&&(o.style.transform=e),s&&s(i)}),y(r,o=>{if(!n){e=o;return}n.style.transform=o},{immediate:!0}),{transform:i}}function ke(t){return Object.entries(t)}function Be(t,s){const e=D({}),n=o=>Object.entries(o).forEach(([a,c])=>e[a]=c),{style:i}=Te(t,n),{transform:r}=we(t,n);return y(e,o=>{ke(o).forEach(([a,c])=>{const p=it(a)?r:i;p[a]&&p[a]===c||(p[a]=c)})},{immediate:!0,deep:!0}),H(t,()=>s),{motionProperties:e,style:i,transform:r}}function Ee(t={}){const s=A(t),e=g();return{state:B(()=>{if(e.value)return s[e.value]}),variant:e}}function Se(t,s={},e){const{motionProperties:n}=Be(t),{variant:i,state:r}=Ee(s),o=ne(n,s),a={target:t,variant:i,variants:s,state:r,motionProperties:n,...o};return pe(a,e),a}const je={relative:""},Pe={key:0,absolute:"","left-0":"","top-0":"","translate-y":"[-80%]"},Ve={text:"neutral-300 dark:neutral-500","text-nowrap":""},Ce={"text-nowrap":"","text-3xl":"","font-semibold":""},Ne=Q({__name:"PageHeader",props:{title:null,subtitle:null,showBackButton:{type:Boolean,default:!0},disableBackButton:{type:Boolean,default:!1}},setup(t){const s=t,e=Nt(),n=_(),i=g(),r=g(s.title),o=g(s.subtitle),a=g(s.disableBackButton),{apply:c}=Se(i,{initial:{opacity:0,x:10,transition:{duration:250}},enter:{opacity:1,x:0,transition:{duration:250}},leave:{opacity:0,x:-5,transition:{duration:100}}});return Vt(async()=>{await c("initial"),await c("enter")}),Ct(async()=>{await c("leave"),a.value=!0}),y([()=>s.title,()=>s.subtitle,n],async()=>{await c("leave"),await Y(),a.value=s.disableBackButton,r.value=s.title,o.value=s.subtitle,await Y(),await c("initial"),await c("enter")}),(p,l)=>(P(),j("div",{ref_key:"pageHeaderRef",ref:i,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"},[k("button",{onClick:l[0]||(l[0]=f=>A(e).back())},[a.value?W("",!0):(P(),j("div",{key:0,"i-solar:alt-arrow-left-line-duotone":"","text-2xl":"",class:Rt({"pointer-events-none op-0":!t.showBackButton})},null,2))]),k("h1",je,[o.value?(P(),j("div",Pe,[k("span",Ve,X(o.value),1)])):W("",!0),k("div",Ce,X(r.value),1)])],512))}}),Re={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)"}},Me={class:"px-0 py-1 md:px-3 md:py-3","w-full":"","gap-2":"",bg:"$bg-color"},ze={class:"px-3 py-2 md:px-5 md:py-5",flex:"~ col","mx-auto":"","max-w-screen-xl":""},Ke=Q({__name:"settings",setup(t){const s=_(),{t:e}=Mt(),n=Lt(),{allProvidersMetadata:i}=zt(n),r=B(()=>{const a={"/settings/airi-card":{subtitle:e("settings.title"),title:e("settings.pages.card.title")},"/settings/appearance":{subtitle:e("settings.title"),title:e("settings.pages.themes.title")},"/settings/memory":{subtitle:e("settings.title"),title:e("settings.pages.memory.title")},"/settings/models":{subtitle:e("settings.title"),title:e("settings.pages.models.title")},"/settings/modules":{subtitle:e("settings.title"),title:e("settings.pages.modules.title")},"/settings/modules/consciousness":{subtitle:e("settings.title"),title:e("settings.pages.modules.consciousness.title")},"/settings/modules/speech":{subtitle:e("settings.title"),title:e("settings.pages.modules.speech.title")},"/settings/modules/hearing":{subtitle:e("settings.title"),title:e("settings.pages.modules.hearing.title")},"/settings/modules/memory-short-term":{subtitle:e("settings.title"),title:e("settings.pages.modules.memory-short-term.title")},"/settings/modules/memory-long-term":{subtitle:e("settings.title"),title:e("settings.pages.modules.memory-long-term.title")},"/settings/modules/messaging-discord":{subtitle:e("settings.title"),title:e("settings.pages.modules.messaging-discord.title")},"/settings/modules/x":{subtitle:e("settings.title"),title:e("settings.pages.modules.x.title")},"/settings/modules/gaming-minecraft":{subtitle:e("settings.title"),title:e("settings.pages.modules.gaming-minecraft.title")},"/settings/modules/gaming-factorio":{subtitle:e("settings.title"),title:e("settings.pages.modules.gaming-factorio.title")},"/settings/providers":{subtitle:e("settings.title"),title:e("settings.pages.providers.title")},"/settings/scene":{subtitle:e("settings.title"),title:e("settings.pages.scene.title")},"/settings":{title:e("settings.title")}};for(const c of i.value)a[`/settings/providers/${c.id}`]={subtitle:e("settings.title"),title:e(c.nameKey)};return a}),o=B(()=>r.value[s.path]);return(a,c)=>{var p,l;return P(),j("div",Re,[k("div",Me,[C(Ft)]),k("div",ze,[C(A(Ne),{title:(p=o.value)==null?void 0:p.title,subtitle:(l=o.value)==null?void 0:l.subtitle},null,8,["title","subtitle"]),C(A(Dt))])])}}});export{Ke as default}; diff --git a/assets/settings-CynJw7x4.js b/assets/settings-CynJw7x4.js new file mode 100644 index 0000000000000000000000000000000000000000..96ea165a44a0c3b0fa9c58d6d0f2db82d2cf6d6d --- /dev/null +++ b/assets/settings-CynJw7x4.js @@ -0,0 +1 @@ +var rt=Object.defineProperty;var ot=(t,s,e)=>s in t?rt(t,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[s]=e;var m=(t,s,e)=>ot(t,typeof s!="symbol"?s+"":s,e);import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-Du5e5QRV.js";import{r as D,w as y,u as A,e as g,f as B,i as at,g as ut,h as b,j as J,n as lt,k as V,l as M,p as u,m as $,q as O,s as S,t as v,v as ct,x as ft,y as pt,z as U,A as dt,B as mt,C as gt,D as ht,E as yt,F as bt,G as vt,H as xt,I as Tt,J as At,K as Ot,L as wt,M as kt,N as Bt,O as Et,P as St,Q as jt,S as Pt,d as Q,T as Vt,U as Ct,c as j,a as k,V as Nt,W,X as Rt,Y as X,o as P,Z as _,_ as Y,$ as Mt,a0 as zt,b as C,R as Dt}from"./index-B06xwjXa.js";import"./three-vrm.module-CtuEk7GG.js";import"./emotions-DWNSb738.js";import"./mcp-BfXpaYZf.js";import{u as Lt}from"./providers-BCv4E6z9.js";import"./Select.vue_vue_type_style_index_0_lang-CzS20kE7.js";import{H as Ft}from"./HeaderLink-OTe6TGtK.js";import"./index-LHmcipjy.js";import"./floating-ui.core-CgBsuaUc.js";const T={};class Ht{constructor(){m(this,"subscriptions",new Set)}add(s){return this.subscriptions.add(s),()=>this.subscriptions.delete(s)}notify(s,e,n){if(this.subscriptions.size)for(const i of this.subscriptions)i(s,e,n)}clear(){this.subscriptions.clear()}}function Z(t){return!Number.isNaN(Number.parseFloat(t))}class $t{constructor(s){m(this,"current");m(this,"prev");m(this,"timeDelta",0);m(this,"lastUpdated",0);m(this,"updateSubscribers",new Ht);m(this,"stopAnimation");m(this,"canTrackVelocity",!1);m(this,"updateAndNotify",s=>{this.prev=this.current,this.current=s;const{delta:e,timestamp:n}=pt();this.lastUpdated!==n&&(this.timeDelta=e,this.lastUpdated=n),U.postRender(this.scheduleVelocityCheck),this.updateSubscribers.notify(this.current)});m(this,"scheduleVelocityCheck",()=>U.postRender(this.velocityCheck));m(this,"velocityCheck",({timestamp:s})=>{this.canTrackVelocity||(this.canTrackVelocity=Z(this.current)),s!==this.lastUpdated&&(this.prev=this.current)});this.prev=this.current=s,this.canTrackVelocity=Z(this.current)}onChange(s){return this.updateSubscribers.add(s)}clearListeners(){this.updateSubscribers.clear()}set(s){this.updateAndNotify(s)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?dt(Number.parseFloat(this.current)-Number.parseFloat(this.prev),this.timeDelta):0}start(s){return this.stop(),new Promise(e=>{const{stop:n}=s(e);this.stopAnimation=n}).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 Ut(t){return new $t(t)}const{isArray:Wt}=Array;function Xt(){const t=g({}),s=n=>{const i=r=>{t.value[r]&&(t.value[r].stop(),t.value[r].destroy(),delete t.value[r])};n?Wt(n)?n.forEach(i):i(n):Object.keys(t.value).forEach(i)},e=(n,i,r)=>{if(t.value[n])return t.value[n];const o=Ut(i);return o.onChange(a=>r[n]=a),t.value[n]=o,o};return jt(s),{motionValues:t,get:e,stop:s}}function Yt(t){return Array.isArray(t)}function w(){return{type:"spring",stiffness:500,damping:25,restDelta:.5,restSpeed:10}}function N(t){return{type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restDelta:.01,restSpeed:10}}function Zt(t){return{type:"spring",stiffness:550,damping:t===0?100:30,restDelta:.01,restSpeed:10}}function R(){return{type:"keyframes",ease:"linear",duration:300}}function It(t){return{type:"keyframes",duration:800,values:t}}const I={default:Zt,x:w,y:w,z:w,rotate:w,rotateX:w,rotateY:w,rotateZ:w,scaleX:N,scaleY:N,scale:N,backgroundColor:R,color:R,opacity:R};function tt(t,s){let e;return Yt(s)?e=It:e=I[t]||I.default,{to:s,...e(s)}}const K={...lt,transform:Math.round},et={color:v,backgroundColor:v,outlineColor:v,fill:v,stroke:v,borderColor:v,borderTopColor:v,borderRightColor:v,borderBottomColor:v,borderLeftColor:v,borderWidth:u,borderTopWidth:u,borderRightWidth:u,borderBottomWidth:u,borderLeftWidth:u,borderRadius:u,radius:u,borderTopLeftRadius:u,borderTopRightRadius:u,borderBottomRightRadius:u,borderBottomLeftRadius:u,width:u,maxWidth:u,height:u,maxHeight:u,size:u,top:u,right:u,bottom:u,left:u,padding:u,paddingTop:u,paddingRight:u,paddingBottom:u,paddingLeft:u,margin:u,marginTop:u,marginRight:u,marginBottom:u,marginLeft:u,rotate:O,rotateX:O,rotateY:O,rotateZ:O,scale:S,scaleX:S,scaleY:S,scaleZ:S,skew:O,skewX:O,skewY:O,distance:u,translateX:u,translateY:u,translateZ:u,x:u,y:u,z:u,perspective:u,transformPerspective:u,opacity:V,originX:$,originY:$,originZ:u,zIndex:K,filter:M,WebkitFilter:M,fillOpacity:V,strokeOpacity:V,numOctaves:K},L=t=>et[t];function z(t,s){return s&&typeof t=="number"&&s.transform?s.transform(t):t}function Kt(t,s){let e=L(t);return e!==M&&(e=J),e.getAnimatableNone?e.getAnimatableNone(s):void 0}const qt={linear:St,easeIn:Et,easeInOut:Bt,easeOut:kt,circIn:wt,circInOut:Ot,circOut:At,backIn:Tt,backInOut:xt,backOut:vt,anticipate:bt,bounceIn:yt,bounceInOut:ht,bounceOut:gt};function q(t){if(Array.isArray(t)){const[s,e,n,i]=t;return mt(s,e,n,i)}else if(typeof t=="string")return qt[t];return t}function Gt(t){return Array.isArray(t)&&typeof t[0]!="number"}function G(t,s){return t==="zIndex"?!1:!!(typeof s=="number"||Array.isArray(s)||typeof s=="string"&&J.test(s)&&!s.startsWith("url("))}function Jt(t){return Array.isArray(t.to)&&t.to[0]===null&&(t.to=[...t.to],t.to[0]=t.from),t}function Qt({ease:t,times:s,delay:e,...n}){const i={...n};return s&&(i.offset=s),t&&(i.ease=Gt(t)?t.map(q):q(t)),e&&(i.elapsed=-e),i}function _t(t,s,e){return Array.isArray(s.to)&&(t.duration||(t.duration=800)),Jt(s),te(t)||(t={...t,...tt(e,s.to)}),{...s,...Qt(t)}}function te({delay:t,repeat:s,repeatType:e,repeatDelay:n,from:i,...r}){return!!Object.keys(r).length}function ee(t,s){return t[s]||t.default||t}function se(t,s,e,n,i){const r=ee(n,t);let o=r.from===null||r.from===void 0?s.get():r.from;const a=G(t,e);o==="none"&&a&&typeof e=="string"&&(o=Kt(t,e));const c=G(t,o);function p(f){const d={from:o,to:e,velocity:n.velocity?n.velocity:s.getVelocity(),onUpdate:x=>s.set(x)};return r.type==="inertia"||r.type==="decay"?ct({...d,...r}):ft({..._t(r,d,t),onUpdate:x=>{d.onUpdate(x),r.onUpdate&&r.onUpdate(x)},onComplete:()=>{i&&i(),f&&f()}})}function l(f){return s.set(e),i&&i(),f&&f(),{stop:()=>{}}}return!c||!a||r.type===!1?l:p}function ie(){const{motionValues:t,stop:s,get:e}=Xt();return{motionValues:t,stop:s,push:(i,r,o,a={},c)=>{const p=o[i],l=e(i,p,o);if(a&&a.immediate){l.set(r);return}const f=se(i,l,r,a,c);l.start(f)}}}function ne(t,s={},{motionValues:e,push:n,stop:i}=ie()){const r=A(s),o=g(!1);y(e,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]},c=f=>{typeof f=="string"&&(f=a(f));const d=Object.entries(f).map(([h,E])=>{if(h!=="transition")return new Promise(nt=>n(h,E,t,f.transition||tt(h,f[h]),nt))}).filter(Boolean);async function x(){var h,E;await Promise.all(d),(E=(h=f.transition)==null?void 0:h.onComplete)==null||E.call(h)}return Promise.all([x()])};return{isAnimating:o,apply:c,set:f=>{const d=at(f)?f:a(f);Object.entries(d).forEach(([x,h])=>{x!=="transition"&&n(x,h,t,{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 c(d),f()},stop:i}}const F=typeof window<"u",re=()=>F&&(window.onpointerdown===null||(T==null?void 0:T.TEST)),oe=()=>F&&(window.ontouchstart===null||(T==null?void 0:T.TEST)),ae=()=>F&&(window.onmousedown===null||(T==null?void 0:T.TEST));function ue({target:t,state:s,variants:e,apply:n}){const i=A(e),r=g(!1),o=g(!1),a=g(!1),c=B(()=>{let l=[...Object.keys(s.value||{})];return i&&(i.hovered&&(l=[...l,...Object.keys(i.hovered)]),i.tapped&&(l=[...l,...Object.keys(i.tapped)]),i.focused&&(l=[...l,...Object.keys(i.focused)])),l}),p=B(()=>{const l={};Object.assign(l,s.value),r.value&&i.hovered&&Object.assign(l,i.hovered),o.value&&i.tapped&&Object.assign(l,i.tapped),a.value&&i.focused&&Object.assign(l,i.focused);for(const f in l)c.value.includes(f)||delete l[f];return l});i.hovered&&(b(t,"mouseenter",()=>r.value=!0),b(t,"mouseleave",()=>{r.value=!1,o.value=!1})),i.tapped&&(ae()&&(b(t,"mousedown",()=>o.value=!0),b(t,"mouseup",()=>o.value=!1)),re()&&(b(t,"pointerdown",()=>o.value=!0),b(t,"pointerup",()=>o.value=!1)),oe()&&(b(t,"touchstart",()=>o.value=!0),b(t,"touchend",()=>o.value=!1))),i.focused&&(b(t,"focus",()=>a.value=!0),b(t,"blur",()=>a.value=!1)),y([r,o,a],()=>{n(p.value)})}function le({set:t,target:s,variants:e,variant:n}){const i=A(e);y(()=>s,()=>{i&&(i.initial&&(t("initial"),n.value="initial"),i.enter&&(n.value="enter"))},{immediate:!0,flush:"pre"})}function ce({state:t,apply:s}){y(t,e=>{e&&s(e)},{immediate:!0})}function fe({target:t,variants:s,variant:e}){const n=A(s);n&&(n.visible||n.visibleOnce)&&ut(t,([{isIntersecting:i}])=>{n.visible?i?e.value="visible":e.value="initial":n.visibleOnce&&(i&&e.value!=="visibleOnce"?e.value="visibleOnce":e.value||(e.value="initial"))})}function pe(t,s={syncVariants:!0,lifeCycleHooks:!0,visibilityHooks:!0,eventListeners:!0}){s.lifeCycleHooks&&le(t),s.syncVariants&&ce(t),s.visibilityHooks&&fe(t),s.eventListeners&&ue(t)}function de(t={}){const s=D({...t}),e=g({});return y(s,()=>{const n={};for(const[i,r]of Object.entries(s)){const o=L(i),a=z(r,o);n[i]=a}e.value=n},{immediate:!0,deep:!0}),{state:s,style:e}}function H(t,s){y(()=>Pt(t),e=>{e&&s(e)},{immediate:!0})}const me={x:"translateX",y:"translateY",z:"translateZ"};function ge(t={},s=!0){const e=D({...t}),n=g("");return y(e,i=>{let r="",o=!1;if(s&&(i.x||i.y||i.z)){const a=[i.x||0,i.y||0,i.z||0].map(c=>z(c,u)).join(",");r+=`translate3d(${a}) `,o=!0}for(const[a,c]of Object.entries(i)){if(s&&(a==="x"||a==="y"||a==="z"))continue;const p=L(a),l=z(c,p);r+=`${me[a]||a}(${l}) `}s&&!o&&(r+="translateZ(0px) "),n.value=r.trim()},{immediate:!0,deep:!0}),{state:e,transform:n}}const he=["","X","Y","Z"],ye=["perspective","translate","scale","rotate","skew"],st=["transformPerspective","x","y","z"];ye.forEach(t=>{he.forEach(s=>{const e=t+s;st.push(e)})});const be=new Set(st);function it(t){return be.has(t)}const ve=new Set(["originX","originY","originZ"]);function xe(t){return ve.has(t)}function Te(t,s){let e,n;const{state:i,style:r}=de();return H(t,o=>{n=o;for(const a of Object.keys(et))o.style[a]===null||o.style[a]===""||it(a)||xe(a)||(i[a]=o.style[a]);e&&Object.entries(e).forEach(([a,c])=>o.style[a]=c),s&&s(i)}),y(r,o=>{if(!n){e=o;return}for(const a in o)n.style[a]=o[a]},{immediate:!0}),{style:i}}function Ae(t){const s=t.trim().split(/\) |\)/);if(s.length===1)return{};const e=n=>n.endsWith("px")||n.endsWith("deg")?Number.parseFloat(n):Number.isNaN(Number(n))?Number(n):n;return s.reduce((n,i)=>{if(!i)return n;const[r,o]=i.split("("),c=o.split(",").map(l=>e(l.endsWith(")")?l.replace(")",""):l.trim())),p=c.length===1?c[0]:c;return{...n,[r]:p}},{})}function Oe(t,s){Object.entries(Ae(s)).forEach(([e,n])=>{const i=["x","y","z"];if(e==="translate3d"){if(n===0){i.forEach(r=>t[r]=0);return}n.forEach((r,o)=>t[i[o]]=r);return}if(n=Number.parseFloat(`${n}`),e==="translateX"){t.x=n;return}if(e==="translateY"){t.y=n;return}if(e==="translateZ"){t.z=n;return}t[e]=n})}function we(t,s){let e,n;const{state:i,transform:r}=ge();return H(t,o=>{n=o,o.style.transform&&Oe(i,o.style.transform),e&&(o.style.transform=e),s&&s(i)}),y(r,o=>{if(!n){e=o;return}n.style.transform=o},{immediate:!0}),{transform:i}}function ke(t){return Object.entries(t)}function Be(t,s){const e=D({}),n=o=>Object.entries(o).forEach(([a,c])=>e[a]=c),{style:i}=Te(t,n),{transform:r}=we(t,n);return y(e,o=>{ke(o).forEach(([a,c])=>{const p=it(a)?r:i;p[a]&&p[a]===c||(p[a]=c)})},{immediate:!0,deep:!0}),H(t,()=>s),{motionProperties:e,style:i,transform:r}}function Ee(t={}){const s=A(t),e=g();return{state:B(()=>{if(e.value)return s[e.value]}),variant:e}}function Se(t,s={},e){const{motionProperties:n}=Be(t),{variant:i,state:r}=Ee(s),o=ne(n,s),a={target:t,variant:i,variants:s,state:r,motionProperties:n,...o};return pe(a,e),a}const je={relative:""},Pe={key:0,absolute:"","left-0":"","top-0":"","translate-y":"[-80%]"},Ve={text:"neutral-300 dark:neutral-500","text-nowrap":""},Ce={"text-nowrap":"","text-3xl":"","font-semibold":""},Ne=Q({__name:"PageHeader",props:{title:null,subtitle:null,showBackButton:{type:Boolean,default:!0},disableBackButton:{type:Boolean,default:!1}},setup(t){const s=t,e=Nt(),n=_(),i=g(),r=g(s.title),o=g(s.subtitle),a=g(s.disableBackButton),{apply:c}=Se(i,{initial:{opacity:0,x:10,transition:{duration:250}},enter:{opacity:1,x:0,transition:{duration:250}},leave:{opacity:0,x:-5,transition:{duration:100}}});return Vt(async()=>{await c("initial"),await c("enter")}),Ct(async()=>{await c("leave"),a.value=!0}),y([()=>s.title,()=>s.subtitle,n],async()=>{await c("leave"),await Y(),a.value=s.disableBackButton,r.value=s.title,o.value=s.subtitle,await Y(),await c("initial"),await c("enter")}),(p,l)=>(P(),j("div",{ref_key:"pageHeaderRef",ref:i,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"},[k("button",{onClick:l[0]||(l[0]=f=>A(e).back())},[a.value?W("",!0):(P(),j("div",{key:0,"i-solar:alt-arrow-left-line-duotone":"","text-2xl":"",class:Rt({"pointer-events-none op-0":!t.showBackButton})},null,2))]),k("h1",je,[o.value?(P(),j("div",Pe,[k("span",Ve,X(o.value),1)])):W("",!0),k("div",Ce,X(r.value),1)])],512))}}),Re={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)"}},Me={class:"px-0 py-1 md:px-3 md:py-3","w-full":"","gap-2":"",bg:"$bg-color"},ze={class:"px-3 py-2 md:px-5 md:py-5",flex:"~ col","mx-auto":"","max-w-screen-xl":""},Ke=Q({__name:"settings",setup(t){const s=_(),{t:e}=Mt(),n=Lt(),{allProvidersMetadata:i}=zt(n),r=B(()=>{const a={"/settings/airi-card":{subtitle:e("settings.title"),title:e("settings.pages.card.title")},"/settings/appearance":{subtitle:e("settings.title"),title:e("settings.pages.themes.title")},"/settings/memory":{subtitle:e("settings.title"),title:e("settings.pages.memory.title")},"/settings/models":{subtitle:e("settings.title"),title:e("settings.pages.models.title")},"/settings/modules":{subtitle:e("settings.title"),title:e("settings.pages.modules.title")},"/settings/modules/consciousness":{subtitle:e("settings.title"),title:e("settings.pages.modules.consciousness.title")},"/settings/modules/speech":{subtitle:e("settings.title"),title:e("settings.pages.modules.speech.title")},"/settings/modules/hearing":{subtitle:e("settings.title"),title:e("settings.pages.modules.hearing.title")},"/settings/modules/memory-short-term":{subtitle:e("settings.title"),title:e("settings.pages.modules.memory-short-term.title")},"/settings/modules/memory-long-term":{subtitle:e("settings.title"),title:e("settings.pages.modules.memory-long-term.title")},"/settings/modules/messaging-discord":{subtitle:e("settings.title"),title:e("settings.pages.modules.messaging-discord.title")},"/settings/modules/x":{subtitle:e("settings.title"),title:e("settings.pages.modules.x.title")},"/settings/modules/gaming-minecraft":{subtitle:e("settings.title"),title:e("settings.pages.modules.gaming-minecraft.title")},"/settings/modules/gaming-factorio":{subtitle:e("settings.title"),title:e("settings.pages.modules.gaming-factorio.title")},"/settings/providers":{subtitle:e("settings.title"),title:e("settings.pages.providers.title")},"/settings/scene":{subtitle:e("settings.title"),title:e("settings.pages.scene.title")},"/settings":{title:e("settings.title")}};for(const c of i.value)a[`/settings/providers/${c.id}`]={subtitle:e("settings.title"),title:e(c.nameKey)};return a}),o=B(()=>r.value[s.path]);return(a,c)=>{var p,l;return P(),j("div",Re,[k("div",Me,[C(Ft)]),k("div",ze,[C(A(Ne),{title:(p=o.value)==null?void 0:p.title,subtitle:(l=o.value)==null?void 0:l.subtitle},null,8,["title","subtitle"]),C(A(Dt))])])}}});export{Ke as default}; diff --git a/assets/speech-B67Uvg4K.js b/assets/speech-B67Uvg4K.js deleted file mode 100644 index 47a947b1909bd0e797bee4573f6b6f7992ab3a6b..0000000000000000000000000000000000000000 --- a/assets/speech-B67Uvg4K.js +++ /dev/null @@ -1 +0,0 @@ -import{d as D,e as V,T as ae,w as Z,a9 as re,c as u,o as i,c6 as H,c7 as W,a as e,a3 as ve,X as $,ce as X,cf as J,ae as Q,c9 as me,W as P,Y as y,b as S,u as t,ad as I,bZ as K,f as pe,cI as fe,cc as ne,ac as G,$ as ge,a0 as te,U as xe,c5 as he,b_ as be,aP as F,cl as ye}from"./index-CNH1g_GM.js";import{_ as se,a as le,b as ke}from"./FieldRange.vue_vue_type_script_setup_true_lang-Dou4SIkT.js";import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-BQHOFrhO.js";import"./three-vrm-animation.module-B_hGdUpX.js";import"./mcp-B7-jaCfZ.js";import"./emotions-DWNSb738.js";import{u as we}from"./providers-DP46_3AG.js";import{u as _e,g as Se}from"./speech-DpuUb2e9.js";import{_ as Ve}from"./FieldInput.vue_vue_type_script_setup_true_lang-tEOSPb7v.js";import"./Select.vue_vue_type_style_index_0_lang-BIffysKh.js";import{_ as Me}from"./Textarea.vue_vue_type_script_setup_true_lang-CLcoVpDI.js";import{R as Ce,a as $e}from"./RadioCardSimple-DMkL9ZMC.js";import{_ as Pe}from"./TransitionVertical.vue_vue_type_script_setup_true_lang-DLt6RcnD.js";import{_ as Ue}from"./Input.vue_vue_type_script_setup_true_lang-CvnY3pbX.js";import{b as oe}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./floating-ui.core-CgBsuaUc.js";import"./Basic.vue_vue_type_script_setup_true_lang-CuYLN0Ir.js";const Le=D({__name:"AudioSpectrum",props:{stream:null,bars:{default:32},minFreq:{default:60},maxFreq:{default:4e3}},setup(l){const o=l,g=V(Array.from({length:o.bars}).fill(0));ae(()=>{m()}),Z(()=>o.stream,()=>{m()});function m(){if(!o.stream)return;const c=new(window.AudioContext||window.webkitAudioContext),f=c.createMediaStreamSource(o.stream),v=c.createAnalyser();v.fftSize=2048,f.connect(v);const h=v.frequencyBinCount,M=new Uint8Array(h),p=c.sampleRate/v.fftSize,k=Math.floor(o.minFreq/p),U=Math.floor(o.maxFreq/p),q=U-k,T=Math.floor(q/o.bars),E=()=>{try{requestAnimationFrame(E),v.getByteFrequencyData(M);const R=Array.from({length:o.bars}).fill(0);for(let z=0;zre(c.$slots,"default",{frequencies:g.value})}}),qe={"h-full":"",flex:"","items-center":"","gap-1":""},Re=5,Te=D({__name:"AudioSpectrumVisualizer",props:{frequencies:null,barsClass:null},setup(l){const o=l;function g(c,f){return .1+(1-.1)*(c/f)}function m(c,f){const v=g(f,o.frequencies.length);return Math.min(100,Math.max(10,c*100*Re*v))}return(c,f)=>(i(),u("div",qe,[(i(!0),u(H,null,W(l.frequencies,(v,h)=>(i(),u("div",{key:h,"h-full":"",flex:"","flex-1":"","items-end":""},[e("div",{transition:"all 100 ease-in-out","mx-auto":"","my-0":"","w-full":"","rounded-full":"",class:$(l.barsClass),style:ve({height:`${m(v,h)}%`})},null,6)]))),128))]))}}),Ae={class:"p-3"},Ee={class:"flex items-start"},ze=["checked","name","value"],Be={class:"relative mr-3 mt-0.5 flex-shrink-0"},Fe={key:0,class:"i-solar:pause-circle-bold-duotone text-xl text-neutral-400 dark:text-neutral-500"},Ie={key:1,class:"i-solar:play-circle-bold-duotone text-xl text-neutral-400 dark:text-neutral-500"},Ne={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"},De={class:"flex-1 cursor-pointer"},je={class:"flex items-center"},Oe={key:0,class:"mt-1 flex flex-wrap gap-1"},Qe={key:1,class:"mt-3"},He={relative:""},Ye={key:0,class:"h-16 px-3 pb-2"},Ge=D({__name:"VoiceCard",props:X({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:X(["togglePlayback"],["update:voice-id","update:custom-voice-name"]),setup(l,{emit:o}){const g=l,m=o,c=J(l,"voice-id"),f=J(l,"custom-voice-name");function v(b){return b.previewURL||b.preview_audio_url}function h(b){var k,U,q;const p=[];if((k=b.labels)!=null&&k.gender&&p.push(b.labels.gender),(U=b.labels)!=null&&U.age&&p.push(b.labels.age),(q=b.labels)!=null&&q.accent&&p.push(b.labels.accent),b.languages&&b.languages.length>0){const T=b.languages.map(E=>E.name).join(", ");p.push(T)}return p}function M(){m("togglePlayback",g.voice)}return(b,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",Ae,[e("div",Ee,[Q(e("input",{"onUpdate:modelValue":p[0]||(p[0]=k=>c.value=k),checked:c.value===g.voice.id,type:"radio",name:l.name,value:g.voice.id,class:"absolute cursor-pointer opacity-0"},null,8,ze),[[me,c.value]]),e("div",Be,[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(l.voice)?(i(),u("button",{key:0,absolute:"","right-0":"",top:"0","z-3":"",class:$(["translate-x-[-50%] translate-y-[50%]",[l.currentlyPlayingId===l.voice.id?"text-white dark:text-white":""]]),onClick:M},[l.currentlyPlayingId===l.voice.id?(i(),u("div",Fe)):(i(),u("div",Ie))],2)):(i(),u("div",Ne," No preview available ")),e("div",De,[e("div",je,[e("span",{class:$(["line-clamp-1 font-medium",[c.value===l.voice.id?"text-neutral-700 dark:text-neutral-300":"text-neutral-700 dark:text-neutral-400"]])},y(l.voice.name),3)]),h(l.voice).length>0?(i(),u("div",Oe,[(i(!0),u(H,null,W(h(l.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===l.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),l.voice.customizable&&c.value===l.voice.id?(i(),u("div",Qe,[S(t(Ue),{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:l.customInputPlaceholder},null,8,["modelValue","placeholder"])])):P("",!0),l.voice.description?(i(),u("div",{key:2,class:$(["line-clamp-2 mt-1 text-xs",[c.value===l.voice.id?"text-neutral-600 dark:text-neutral-400":"text-neutral-500 dark:text-neutral-500"]])},y(l.voice.description),3)):P("",!0)])])]),e("div",He,[S(t(Pe),null,{default:I(()=>[l.showVisualizer&&l.currentlyPlayingId===l.voice.id&&l.audioStream?(i(),u("div",Ye,[S(t(Le),{stream:l.audioStream,bars:24,"min-freq":60,"max-freq":4e3},{default:I(({frequencies:k})=>[S(t(Te),{frequencies:k,"bars-class":c.value===l.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))}}),Je=K(Ge,[["__scopeId","data-v-a5ae8da9"]]),We={class:"voice-preview-player"},Xe={key:0,class:"relative","inline-flex":"~","w-full":"","items-center":""},Ze=["placeholder"],Ke={class:"mt-4 space-y-2"},et={key:0,class:"text-sm text-neutral-500 dark:text-neutral-400"},tt={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"},st={class:"flex flex-col"},lt={class:"font-medium"},ot={class:"text-sm text-amber-600 dark:text-amber-400"},at={class:"relative"},rt=D({__name:"VoiceCardManySelect",props:X({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(l){const o=l,g=V(!1),m=V(),c=V(new Map),f=V(new Map),v=V(new Map),h=V(new Map),M=V(null);function b(){return M.value||(M.value=new(window.AudioContext||window.webkitAudioContext)),M.value}const p=J(l,"search-query"),k=J(l,"voice-id"),U=pe(()=>{if(!p.value)return o.voices;const a=p.value.toLowerCase();return o.voices.filter(r=>{const n=r.name.toLowerCase().includes(a),x=r.description&&r.description.toLowerCase().includes(a),w=r.tags&&r.tags.some(_=>_.toLowerCase().includes(a)),L=r.labels&&Object.values(r.labels).some(_=>typeof _=="string"&&_.toLowerCase().includes(a)),C=r.languages&&r.languages.some(_=>_.name.toLowerCase().includes(a)||_.code.toLowerCase().includes(a));return n||x||w||L||C})});function q(a){return a.previewURL||a.preview_audio_url}function T(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 E(a,r){try{if(f.value.has(r))return f.value.get(r)||null;const n=b();if(h.value.has(r)){const C=h.value.get(r),_=n.createMediaStreamDestination();C.connect(_);const j=_.stream;return f.value.set(r,j),j}const x=n.createMediaElementSource(a);h.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 R(a){try{if(!q(a))return;const n=T(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))}o.showVisualizer&&!f.value.has(a.id)&&E(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(),h.value.clear(),m.value=void 0}Z(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,[l.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:l.searchPlaceholder},null,8,Ze),[[ne,p.value]])])):P("",!0),e("div",Ke,[p.value?(i(),u("div",et,y(l.searchResultsText.replace("{count}",U.value.length.toString()).replace("{total}",l.voices.length.toString())),1)):P("",!0),p.value&&U.value.length===0?(i(),u("div",tt,[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",st,[e("span",lt,y(l.searchNoResultsTitle),1),e("span",ot,y(l.searchNoResultsDescription.replace("{query}",p.value)),1)])])):P("",!0),e("div",at,[e("div",{class:$(["grid auto-cols-[350px] grid-flow-col max-h-[calc(100dvh-7lh)] gap-4 overflow-x-auto scrollbar-none",[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,W(U.value,n=>(i(),G(Je,{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":l.customInputPlaceholder,"show-visualizer":l.showVisualizer,"audio-stream":f.value.get(n.id),onTogglePlayback:R},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?l.collapseButtonText:l.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)])])]))}}),nt=K(rt,[["__scopeId","data-v-4dd3b9e2"]]),it=D({__name:"Skeleton",props:{animation:{default:"pulse"}},setup(l){const o=l;return(g,m)=>(i(),u("div",{class:$(["skeleton",o.animation!=="none"?`skeleton-${o.animation}`:""]),bg:"neutral-200 dark:neutral-800",overflow:"hidden"},[re(g.$slots,"default",{},void 0,!0)],2))}}),O=K(it,[["__scopeId","data-v-f404da2a"]]),ut={flex:"~ col md:row gap-6"},dt={bg:"neutral-100 dark:[rgba(0,0,0,0.3)]","rounded-xl":"","p-4":"",flex:"~ col gap-4",class:"w-full md:w-[40%]"},ct={flex:"~ col gap-4"},vt={class:"text-lg text-neutral-500 md:text-2xl dark:text-neutral-400"},mt={text:"neutral-400 dark:neutral-500"},pt={"max-w-full":""},ft={key:0,flex:"~ row gap-4",style:{"scrollbar-width":"none"},"min-w-0":"","of-x-scroll":"","scroll-smooth":"",role:"radiogroup"},gt={key:1},xt={key:0},ht={flex:"~ col gap-4"},bt={class:"text-lg md:text-2xl"},yt={text:"neutral-400 dark:neutral-400"},kt={key:0,class:"flex items-center justify-center py-4"},wt={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"},_t={class:"flex flex-col"},St={class:"font-medium"},Vt={class:"text-sm text-red-600 dark:text-red-400"},Mt={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"},Ct={class:"flex flex-col"},$t={class:"font-medium"},Pt={class:"text-sm text-amber-600 dark:text-amber-400"},Ut={key:0},Lt={flex:"~ col gap-4"},qt={key:0},Rt={class:"flex flex-col gap-4"},Tt={flex:"~ row gap-4"},At={key:1,class:"space-y-6"},Et={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"},zt={class:"flex flex-col"},Bt={class:"text-sm text-red-600 dark:text-red-400"},Ft={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"},It={flex:"~ col gap-4"},Nt={key:4,class:"mt-2 space-y-6"},Dt={key:0},jt={flex:"~ col gap-4"},Ot={flex:"~ col gap-6",class:"w-full md:w-[60%]"},Qt={"w-full":"","rounded-xl":""},Ht={class:"mb-4 text-lg text-neutral-500 md:text-2xl dark:text-neutral-400","w-full":""},Yt={class:"inline-flex items-center gap-4"},Gt={flex:"~ col gap-4"},Jt={flex:"~ row","gap-4":""},Wt=["disabled"],Xt={flex:"~ row","items-center":"","gap-2":""},Zt=["src"],Kt={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":""},es=D({__name:"speech",setup(l){const{t:o}=ge(),g=we(),m=_e(),{availableProviders:c,availableAudioSpeechProvidersMetadata:f}=te(g),{activeSpeechProvider:v,activeSpeechModel:h,activeSpeechVoice:M,activeSpeechVoiceId:b,pitch:p,isLoadingSpeechProviderVoices:k,supportsModelListing:U,providerModels:q,isLoadingActiveProviderModels:T,activeProviderModelError:E,modelSearchQuery:R,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(""),_=V(null),j=V("");ae(async()=>{await g.loadModelsForConfiguredProviders(),await m.loadVoicesForProvider(v.value)}),Z(v,async()=>{await g.loadModelsForConfiguredProviders(),await m.loadVoicesForProvider(v.value)});async function ie(){if(!x.value.trim()&&!n.value||n.value&&!w.value.trim())return;if(!h.value){console.error("No model selected");return}if(!M.value){console.error("No voice selected");return}const A=g.getProviderInstance(v.value);if(!A){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}),Y=await Se({...A.speech(h.value,s),input:N,voice:M.value.id});C.value=URL.createObjectURL(new Blob([Y])),setTimeout(()=>{_.value&&_.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(){_.value&&(_.value.pause(),_.value.currentTime=0),C.value&&(URL.revokeObjectURL(C.value),C.value="")}xe(()=>{C.value&&URL.revokeObjectURL(C.value)});function ue(A){M.value={id:A,name:A,description:A,previewURL:A,languages:[{code:"en",title:"English"}],provider:v.value,gender:"male"}}function de(A){h.value=A}return(A,s)=>{var Y;const N=he("motion");return i(),u(H,null,[e("div",ut,[e("div",dt,[e("div",null,[e("div",ct,[e("div",null,[e("h2",vt,y(t(o)("settings.pages.modules.speech.sections.section.provider-voice-selection.title")),1),e("div",mt,[e("span",null,y(t(o)("settings.pages.modules.speech.sections.section.provider-voice-selection.description")),1)])]),e("div",pt,[t(c).length>0?(i(),u("fieldset",ft,[(i(!0),u(H,null,W(t(f),d=>(i(),G(t($e),{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",gt,[S(t(be),{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,__:[13]})]))])]),e("div",null,[t(v)&&t(U)?(i(),u("div",xt,[e("div",ht,[e("div",null,[e("h2",bt,y(t(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.title")),1),e("div",yt,[e("span",null,y(t(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.subtitle")),1)])]),t(T)?(i(),u("div",kt,[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(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.loading")),1)])):t(E)?(i(),u("div",wt,[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",_t,[e("span",St,y(t(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.error")),1),e("span",Vt,y(t(E)),1)])])):t(q).length===0&&!t(T)?(i(),u("div",Mt,[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",Ct,[e("span",$t,y(t(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.no_models")),1),e("span",Pt,y(t(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.no_models_description")),1)])])):t(q).length>0?(i(),G(t(Ce),{key:3,modelValue:t(h),"onUpdate:modelValue":s[1]||(s[1]=d=>F(h)?h.value=d:null),"search-query":t(R),"onUpdate:searchQuery":s[2]||(s[2]=d=>F(R)?R.value=d:null),items:t(q),searchable:!0,"search-placeholder":t(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.search_placeholder"),"search-no-results-title":t(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.no_search_results"),"search-no-results-description":t(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.no_search_results_description",{query:t(R)}),"search-results-text":t(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.search_results",{count:"{count}",total:"{total}"}),"custom-input-placeholder":t(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.custom_model_placeholder"),"expand-button-text":t(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.expand"),"collapse-button-text":t(o)("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",Ut,[e("div",Lt,[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",qt,[e("div",Rt,[S(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,__:[17]}),e("div",Tt,[S(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,__:[18]}),S(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,__:[19]}),S(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,__:[20]})]),S(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,__:[21]})])])):t(a)[t(v)]&&t(a)[t(v)].length>0?(i(),u("div",At,[S(t(nt),{"search-query":r.value,"onUpdate:searchQuery":s[3]||(s[3]=d=>r.value=d),"voice-id":t(b),"onUpdate:voiceId":s[4]||(s[4]=d=>F(b)?b.value=d:null),voices:(Y=t(a)[t(v)])==null?void 0:Y.map(d=>({id:d.id,name:d.name,description:d.description,previewURL:d.previewURL,customizable:!1})),searchable:!0,"search-placeholder":t(o)("settings.pages.modules.speech.sections.section.provider-voice-selection.search_voices_placeholder"),"search-no-results-title":t(o)("settings.pages.modules.speech.sections.section.provider-voice-selection.no_voices"),"search-no-results-description":t(o)("settings.pages.modules.speech.sections.section.provider-voice-selection.no_voices_description"),"search-results-text":t(o)("settings.pages.modules.speech.sections.section.provider-voice-selection.search_voices_results",{count:0,total:0}),"custom-input-placeholder":t(o)("settings.pages.modules.speech.sections.section.provider-voice-selection.custom_voice_placeholder"),"expand-button-text":t(o)("settings.pages.modules.speech.sections.section.provider-voice-selection.show_more"),"collapse-button-text":t(o)("settings.pages.modules.speech.sections.section.provider-voice-selection.show_less"),"play-button-text":t(o)("settings.pages.modules.speech.sections.section.provider-voice-selection.play_sample"),"pause-button-text":t(o)("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",Et,[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",zt,[s[22]||(s[22]=e("span",{class:"font-medium"},"Error loading voices",-1)),e("span",Bt,y(t(z)),1)])])):(i(),u("div",Ft,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",It,[S(t(se),{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"]),S(t(le),{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",Nt,[S(t(Ve),{modelValue:t(b),"onUpdate:modelValue":s[7]||(s[7]=d=>F(b)?b.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",Dt,[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(h)?h.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(h)]])])):P("",!0),e("div",jt,[S(t(se),{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",Ot,[e("div",Qt,[e("h2",Ht,[e("div",Yt,[S(t(ke)),e("div",null,y(t(o)("settings.pages.providers.provider.elevenlabs.playground.title")),1)])]),e("div",Gt,[S(t(le),{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(Me),{key:0,modelValue:x.value,"onUpdate:modelValue":s[11]||(s[11]=d=>x.value=d),"h-24":"","w-full":"",placeholder:t(o)("settings.pages.providers.provider.elevenlabs.playground.fields.field.input.placeholder")},null,8,["modelValue","placeholder"])),e("div",Jt,[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(o)("settings.pages.providers.provider.elevenlabs.playground.buttons.button.test-voice.generating"):t(o)("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:_,src:C.value,controls:"",class:"mt-2 w-full"},null,8,Zt)):P("",!0)])])])]),Q((i(),u("div",Kt,s[30]||(s[30]=[e("div",{text:"60","i-solar:user-speak-rounded-bold-duotone":""},null,-1)]))),[[N]])],64)}}});typeof oe=="function"&&oe(es);export{es as default}; diff --git a/assets/speech-B8WOC72M.js b/assets/speech-B8WOC72M.js new file mode 100644 index 0000000000000000000000000000000000000000..ed2d5892994b431261fa37e12f308f0eba7cf895 --- /dev/null +++ b/assets/speech-B8WOC72M.js @@ -0,0 +1 @@ +import{d as D,e as V,T as ae,w as K,bh as re,c as u,o as i,c6 as H,c7 as W,a as e,a3 as ve,X as $,ce as X,cf as J,bm as Q,c9 as me,W as U,Y as y,b as S,u as t,bl as F,c2 as Z,f as pe,cI as fe,cc as ne,bk as G,$ as ge,a0 as te,U as xe,c5 as he,c3 as be,bI as I,cl as ye}from"./index-B06xwjXa.js";import{_ as se,a as le,b as ke}from"./FieldRange.vue_vue_type_script_setup_true_lang-4kHfmFIm.js";import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-Du5e5QRV.js";import"./three-vrm.module-CtuEk7GG.js";import"./emotions-DWNSb738.js";import"./mcp-BfXpaYZf.js";import{u as we}from"./providers-BCv4E6z9.js";import{u as _e,g as Se}from"./speech-CLjA-Bq8.js";import{_ as Ve}from"./FieldInput.vue_vue_type_script_setup_true_lang-DM6oOIgU.js";import"./Select.vue_vue_type_style_index_0_lang-CzS20kE7.js";import{_ as Me}from"./Textarea.vue_vue_type_script_setup_true_lang-CskDgflv.js";import{R as Ce,a as $e}from"./RadioCardSimple-DEecfDCY.js";import{_ as Ue}from"./TransitionVertical.vue_vue_type_script_setup_true_lang-CyZTJR0c.js";import{_ as Pe}from"./Input.vue_vue_type_script_setup_true_lang-CqiG06sL.js";import{b as oe}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./floating-ui.core-CgBsuaUc.js";import"./Basic.vue_vue_type_script_setup_true_lang-Q6h2vVkt.js";const Le=D({__name:"AudioSpectrum",props:{stream:null,bars:{default:32},minFreq:{default:60},maxFreq:{default:4e3}},setup(l){const o=l,g=V(Array.from({length:o.bars}).fill(0));ae(()=>{m()}),K(()=>o.stream,()=>{m()});function m(){if(!o.stream)return;const c=new(window.AudioContext||window.webkitAudioContext),f=c.createMediaStreamSource(o.stream),v=c.createAnalyser();v.fftSize=2048,f.connect(v);const h=v.frequencyBinCount,M=new Uint8Array(h),p=c.sampleRate/v.fftSize,k=Math.floor(o.minFreq/p),P=Math.floor(o.maxFreq/p),q=P-k,T=Math.floor(q/o.bars),E=()=>{try{requestAnimationFrame(E),v.getByteFrequencyData(M);const R=Array.from({length:o.bars}).fill(0);for(let z=0;zre(c.$slots,"default",{frequencies:g.value})}}),qe={"h-full":"",flex:"","items-center":"","gap-1":""},Re=5,Te=D({__name:"AudioSpectrumVisualizer",props:{frequencies:null,barsClass:null},setup(l){const o=l;function g(c,f){return .1+(1-.1)*(c/f)}function m(c,f){const v=g(f,o.frequencies.length);return Math.min(100,Math.max(10,c*100*Re*v))}return(c,f)=>(i(),u("div",qe,[(i(!0),u(H,null,W(l.frequencies,(v,h)=>(i(),u("div",{key:h,"h-full":"",flex:"","flex-1":"","items-end":""},[e("div",{transition:"all 100 ease-in-out","mx-auto":"","my-0":"","w-full":"","rounded-full":"",class:$(l.barsClass),style:ve({height:`${m(v,h)}%`})},null,6)]))),128))]))}}),Ae={class:"p-3"},Ee={class:"flex items-start"},ze=["checked","name","value"],Be={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"},Fe={key:1,class:"i-solar:play-circle-bold-duotone text-xl text-neutral-400 dark:text-neutral-500"},Ne={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"},De={class:"flex-1 cursor-pointer"},je={class:"flex items-center"},Oe={key:0,class:"mt-1 flex flex-wrap gap-1"},Qe={key:1,class:"mt-3"},He={relative:""},Ye={key:0,class:"h-16 px-3 pb-2"},Ge=D({__name:"VoiceCard",props:X({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:X(["togglePlayback"],["update:voice-id","update:custom-voice-name"]),setup(l,{emit:o}){const g=l,m=o,c=J(l,"voice-id"),f=J(l,"custom-voice-name");function v(b){return b.previewURL||b.preview_audio_url}function h(b){var k,P,q;const p=[];if((k=b.labels)!=null&&k.gender&&p.push(b.labels.gender),(P=b.labels)!=null&&P.age&&p.push(b.labels.age),(q=b.labels)!=null&&q.accent&&p.push(b.labels.accent),b.languages&&b.languages.length>0){const T=b.languages.map(E=>E.name).join(", ");p.push(T)}return p}function M(){m("togglePlayback",g.voice)}return(b,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",Ae,[e("div",Ee,[Q(e("input",{"onUpdate:modelValue":p[0]||(p[0]=k=>c.value=k),checked:c.value===g.voice.id,type:"radio",name:l.name,value:g.voice.id,class:"absolute cursor-pointer opacity-0"},null,8,ze),[[me,c.value]]),e("div",Be,[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(l.voice)?(i(),u("button",{key:0,absolute:"","right-0":"",top:"0","z-3":"",class:$(["translate-x-[-50%] translate-y-[50%]",[l.currentlyPlayingId===l.voice.id?"text-white dark:text-white":""]]),onClick:M},[l.currentlyPlayingId===l.voice.id?(i(),u("div",Ie)):(i(),u("div",Fe))],2)):(i(),u("div",Ne," No preview available ")),e("div",De,[e("div",je,[e("span",{class:$(["line-clamp-1 font-medium",[c.value===l.voice.id?"text-neutral-700 dark:text-neutral-300":"text-neutral-700 dark:text-neutral-400"]])},y(l.voice.name),3)]),h(l.voice).length>0?(i(),u("div",Oe,[(i(!0),u(H,null,W(h(l.voice),(k,P)=>(i(),u("span",{key:P,class:$(["inline-flex items-center rounded-md px-1.5 py-0.5 text-xs",[c.value===l.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))])):U("",!0),l.voice.customizable&&c.value===l.voice.id?(i(),u("div",Qe,[S(t(Pe),{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:l.customInputPlaceholder},null,8,["modelValue","placeholder"])])):U("",!0),l.voice.description?(i(),u("div",{key:2,class:$(["line-clamp-2 mt-1 text-xs",[c.value===l.voice.id?"text-neutral-600 dark:text-neutral-400":"text-neutral-500 dark:text-neutral-500"]])},y(l.voice.description),3)):U("",!0)])])]),e("div",He,[S(t(Ue),null,{default:F(()=>[l.showVisualizer&&l.currentlyPlayingId===l.voice.id&&l.audioStream?(i(),u("div",Ye,[S(t(Le),{stream:l.audioStream,bars:24,"min-freq":60,"max-freq":4e3},{default:F(({frequencies:k})=>[S(t(Te),{frequencies:k,"bars-class":c.value===l.voice.id?"bg-primary-500 dark:bg-primary-400":"bg-neutral-400 dark:bg-neutral-600"},null,8,["frequencies","bars-class"])]),_:1},8,["stream"])])):U("",!0)]),_:1})])],2))}}),Je=Z(Ge,[["__scopeId","data-v-a5ae8da9"]]),We={class:"voice-preview-player"},Xe={key:0,class:"relative","inline-flex":"~","w-full":"","items-center":""},Ke=["placeholder"],Ze={class:"mt-4 space-y-2"},et={key:0,class:"text-sm text-neutral-500 dark:text-neutral-400"},tt={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"},st={class:"flex flex-col"},lt={class:"font-medium"},ot={class:"text-sm text-amber-600 dark:text-amber-400"},at={class:"relative"},rt=D({__name:"VoiceCardManySelect",props:X({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(l){const o=l,g=V(!1),m=V(),c=V(new Map),f=V(new Map),v=V(new Map),h=V(new Map),M=V(null);function b(){return M.value||(M.value=new(window.AudioContext||window.webkitAudioContext)),M.value}const p=J(l,"search-query"),k=J(l,"voice-id"),P=pe(()=>{if(!p.value)return o.voices;const a=p.value.toLowerCase();return o.voices.filter(r=>{const n=r.name.toLowerCase().includes(a),x=r.description&&r.description.toLowerCase().includes(a),w=r.tags&&r.tags.some(_=>_.toLowerCase().includes(a)),L=r.labels&&Object.values(r.labels).some(_=>typeof _=="string"&&_.toLowerCase().includes(a)),C=r.languages&&r.languages.some(_=>_.name.toLowerCase().includes(a)||_.code.toLowerCase().includes(a));return n||x||w||L||C})});function q(a){return a.previewURL||a.preview_audio_url}function T(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 E(a,r){try{if(f.value.has(r))return f.value.get(r)||null;const n=b();if(h.value.has(r)){const C=h.value.get(r),_=n.createMediaStreamDestination();C.connect(_);const j=_.stream;return f.value.set(r,j),j}const x=n.createMediaElementSource(a);h.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 R(a){try{if(!q(a))return;const n=T(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))}o.showVisualizer&&!f.value.has(a.id)&&E(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(),h.value.clear(),m.value=void 0}K(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,[l.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:l.searchPlaceholder},null,8,Ke),[[ne,p.value]])])):U("",!0),e("div",Ze,[p.value?(i(),u("div",et,y(l.searchResultsText.replace("{count}",P.value.length.toString()).replace("{total}",l.voices.length.toString())),1)):U("",!0),p.value&&P.value.length===0?(i(),u("div",tt,[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",st,[e("span",lt,y(l.searchNoResultsTitle),1),e("span",ot,y(l.searchNoResultsDescription.replace("{query}",p.value)),1)])])):U("",!0),e("div",at,[e("div",{class:$(["grid auto-cols-[350px] grid-flow-col max-h-[calc(100dvh-7lh)] gap-4 overflow-x-auto scrollbar-none",[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,W(P.value,n=>(i(),G(Je,{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":l.customInputPlaceholder,"show-visualizer":l.showVisualizer,"audio-stream":f.value.get(n.id),onTogglePlayback:R},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?l.collapseButtonText:l.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)])])]))}}),nt=Z(rt,[["__scopeId","data-v-4dd3b9e2"]]),it=D({__name:"Skeleton",props:{animation:{default:"pulse"}},setup(l){const o=l;return(g,m)=>(i(),u("div",{class:$(["skeleton",o.animation!=="none"?`skeleton-${o.animation}`:""]),bg:"neutral-200 dark:neutral-800",overflow:"hidden"},[re(g.$slots,"default",{},void 0,!0)],2))}}),O=Z(it,[["__scopeId","data-v-f404da2a"]]),ut={flex:"~ col md:row gap-6"},dt={bg:"neutral-100 dark:[rgba(0,0,0,0.3)]","rounded-xl":"","p-4":"",flex:"~ col gap-4",class:"w-full md:w-[40%]"},ct={flex:"~ col gap-4"},vt={class:"text-lg text-neutral-500 md:text-2xl dark:text-neutral-400"},mt={text:"neutral-400 dark:neutral-500"},pt={"max-w-full":""},ft={key:0,flex:"~ row gap-4",style:{"scrollbar-width":"none"},"min-w-0":"","of-x-scroll":"","scroll-smooth":"",role:"radiogroup"},gt={key:1},xt={key:0},ht={flex:"~ col gap-4"},bt={class:"text-lg md:text-2xl"},yt={text:"neutral-400 dark:neutral-400"},kt={key:0,class:"flex items-center justify-center py-4"},wt={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"},_t={class:"flex flex-col"},St={class:"font-medium"},Vt={class:"text-sm text-red-600 dark:text-red-400"},Mt={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"},Ct={class:"flex flex-col"},$t={class:"font-medium"},Ut={class:"text-sm text-amber-600 dark:text-amber-400"},Pt={key:0},Lt={flex:"~ col gap-4"},qt={key:0},Rt={class:"flex flex-col gap-4"},Tt={flex:"~ row gap-4"},At={key:1,class:"space-y-6"},Et={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"},zt={class:"flex flex-col"},Bt={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"},Ft={flex:"~ col gap-4"},Nt={key:4,class:"mt-2 space-y-6"},Dt={key:0},jt={flex:"~ col gap-4"},Ot={flex:"~ col gap-6",class:"w-full md:w-[60%]"},Qt={"w-full":"","rounded-xl":""},Ht={class:"mb-4 text-lg text-neutral-500 md:text-2xl dark:text-neutral-400","w-full":""},Yt={class:"inline-flex items-center gap-4"},Gt={flex:"~ col gap-4"},Jt={flex:"~ row","gap-4":""},Wt=["disabled"],Xt={flex:"~ row","items-center":"","gap-2":""},Kt=["src"],Zt={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":""},es=D({__name:"speech",setup(l){const{t:o}=ge(),g=we(),m=_e(),{availableProviders:c,availableAudioSpeechProvidersMetadata:f}=te(g),{activeSpeechProvider:v,activeSpeechModel:h,activeSpeechVoice:M,activeSpeechVoiceId:b,pitch:p,isLoadingSpeechProviderVoices:k,supportsModelListing:P,providerModels:q,isLoadingActiveProviderModels:T,activeProviderModelError:E,modelSearchQuery:R,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(""),_=V(null),j=V("");ae(async()=>{await g.loadModelsForConfiguredProviders(),await m.loadVoicesForProvider(v.value)}),K(v,async()=>{await g.loadModelsForConfiguredProviders(),await m.loadVoicesForProvider(v.value)});async function ie(){if(!x.value.trim()&&!n.value||n.value&&!w.value.trim())return;if(!h.value){console.error("No model selected");return}if(!M.value){console.error("No voice selected");return}const A=g.getProviderInstance(v.value);if(!A){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}),Y=await Se({...A.speech(h.value,s),input:N,voice:M.value.id});C.value=URL.createObjectURL(new Blob([Y])),setTimeout(()=>{_.value&&_.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(){_.value&&(_.value.pause(),_.value.currentTime=0),C.value&&(URL.revokeObjectURL(C.value),C.value="")}xe(()=>{C.value&&URL.revokeObjectURL(C.value)});function ue(A){M.value={id:A,name:A,description:A,previewURL:A,languages:[{code:"en",title:"English"}],provider:v.value,gender:"male"}}function de(A){h.value=A}return(A,s)=>{var Y;const N=he("motion");return i(),u(H,null,[e("div",ut,[e("div",dt,[e("div",null,[e("div",ct,[e("div",null,[e("h2",vt,y(t(o)("settings.pages.modules.speech.sections.section.provider-voice-selection.title")),1),e("div",mt,[e("span",null,y(t(o)("settings.pages.modules.speech.sections.section.provider-voice-selection.description")),1)])]),e("div",pt,[t(c).length>0?(i(),u("fieldset",ft,[(i(!0),u(H,null,W(t(f),d=>(i(),G(t($e),{id:d.id,key:d.id,modelValue:t(v),"onUpdate:modelValue":s[0]||(s[0]=ce=>I(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",gt,[S(t(be),{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:F(()=>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,__:[13]})]))])]),e("div",null,[t(v)&&t(P)?(i(),u("div",xt,[e("div",ht,[e("div",null,[e("h2",bt,y(t(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.title")),1),e("div",yt,[e("span",null,y(t(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.subtitle")),1)])]),t(T)?(i(),u("div",kt,[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(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.loading")),1)])):t(E)?(i(),u("div",wt,[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",_t,[e("span",St,y(t(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.error")),1),e("span",Vt,y(t(E)),1)])])):t(q).length===0&&!t(T)?(i(),u("div",Mt,[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",Ct,[e("span",$t,y(t(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.no_models")),1),e("span",Ut,y(t(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.no_models_description")),1)])])):t(q).length>0?(i(),G(t(Ce),{key:3,modelValue:t(h),"onUpdate:modelValue":s[1]||(s[1]=d=>I(h)?h.value=d:null),"search-query":t(R),"onUpdate:searchQuery":s[2]||(s[2]=d=>I(R)?R.value=d:null),items:t(q),searchable:!0,"search-placeholder":t(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.search_placeholder"),"search-no-results-title":t(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.no_search_results"),"search-no-results-description":t(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.no_search_results_description",{query:t(R)}),"search-results-text":t(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.search_results",{count:"{count}",total:"{total}"}),"custom-input-placeholder":t(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.custom_model_placeholder"),"expand-button-text":t(o)("settings.pages.modules.consciousness.sections.section.provider-model-selection.expand"),"collapse-button-text":t(o)("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"])):U("",!0)])])):U("",!0)])]),t(v)?(i(),u("div",Pt,[e("div",Lt,[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",qt,[e("div",Rt,[S(t(O),{class:"w-full rounded-lg p-2.5 text-sm"},{default:F(()=>s[17]||(s[17]=[e("div",{class:"h-1lh"},null,-1)])),_:1,__:[17]}),e("div",Tt,[S(t(O),{class:"w-full rounded-lg p-4 text-sm"},{default:F(()=>s[18]||(s[18]=[e("div",{class:"h-1lh"},null,-1)])),_:1,__:[18]}),S(t(O),{class:"w-full rounded-lg p-4 text-sm"},{default:F(()=>s[19]||(s[19]=[e("div",{class:"h-1lh"},null,-1)])),_:1,__:[19]}),S(t(O),{class:"w-full rounded-lg p-4 text-sm"},{default:F(()=>s[20]||(s[20]=[e("div",{class:"h-1lh"},null,-1)])),_:1,__:[20]})]),S(t(O),{class:"w-full rounded-lg p-3 text-sm"},{default:F(()=>s[21]||(s[21]=[e("div",{class:"h-1lh"},null,-1)])),_:1,__:[21]})])])):t(a)[t(v)]&&t(a)[t(v)].length>0?(i(),u("div",At,[S(t(nt),{"search-query":r.value,"onUpdate:searchQuery":s[3]||(s[3]=d=>r.value=d),"voice-id":t(b),"onUpdate:voiceId":s[4]||(s[4]=d=>I(b)?b.value=d:null),voices:(Y=t(a)[t(v)])==null?void 0:Y.map(d=>({id:d.id,name:d.name,description:d.description,previewURL:d.previewURL,customizable:!1})),searchable:!0,"search-placeholder":t(o)("settings.pages.modules.speech.sections.section.provider-voice-selection.search_voices_placeholder"),"search-no-results-title":t(o)("settings.pages.modules.speech.sections.section.provider-voice-selection.no_voices"),"search-no-results-description":t(o)("settings.pages.modules.speech.sections.section.provider-voice-selection.no_voices_description"),"search-results-text":t(o)("settings.pages.modules.speech.sections.section.provider-voice-selection.search_voices_results",{count:0,total:0}),"custom-input-placeholder":t(o)("settings.pages.modules.speech.sections.section.provider-voice-selection.custom_voice_placeholder"),"expand-button-text":t(o)("settings.pages.modules.speech.sections.section.provider-voice-selection.show_more"),"collapse-button-text":t(o)("settings.pages.modules.speech.sections.section.provider-voice-selection.show_less"),"play-button-text":t(o)("settings.pages.modules.speech.sections.section.provider-voice-selection.play_sample"),"pause-button-text":t(o)("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",Et,[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",zt,[s[22]||(s[22]=e("span",{class:"font-medium"},"Error loading voices",-1)),e("span",Bt,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",Ft,[S(t(se),{modelValue:t(p),"onUpdate:modelValue":s[5]||(s[5]=d=>I(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"]),S(t(le),{modelValue:t(B),"onUpdate:modelValue":s[6]||(s[6]=d=>I(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",Nt,[S(t(Ve),{modelValue:t(b),"onUpdate:modelValue":s[7]||(s[7]=d=>I(b)?b.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",Dt,[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=>I(h)?h.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(h)]])])):U("",!0),e("div",jt,[S(t(se),{modelValue:t(p),"onUpdate:modelValue":s[9]||(s[9]=d=>I(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"])])])):U("",!0)])])):U("",!0)]),e("div",Ot,[e("div",Qt,[e("h2",Ht,[e("div",Yt,[S(t(ke)),e("div",null,y(t(o)("settings.pages.providers.provider.elevenlabs.playground.title")),1)])]),e("div",Gt,[S(t(le),{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(Me),{key:0,modelValue:x.value,"onUpdate:modelValue":s[11]||(s[11]=d=>x.value=d),"h-24":"","w-full":"",placeholder:t(o)("settings.pages.providers.provider.elevenlabs.playground.fields.field.input.placeholder")},null,8,["modelValue","placeholder"])),e("div",Jt,[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(o)("settings.pages.providers.provider.elevenlabs.playground.buttons.button.test-voice.generating"):t(o)("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)]))):U("",!0)]),C.value?(i(),u("audio",{key:2,ref_key:"audioPlayer",ref:_,src:C.value,controls:"",class:"mt-2 w-full"},null,8,Kt)):U("",!0)])])])]),Q((i(),u("div",Zt,s[30]||(s[30]=[e("div",{text:"60","i-solar:user-speak-rounded-bold-duotone":""},null,-1)]))),[[N]])],64)}}});typeof oe=="function"&&oe(es);export{es as default}; diff --git a/assets/speech-CLjA-Bq8.js b/assets/speech-CLjA-Bq8.js new file mode 100644 index 0000000000000000000000000000000000000000..048868e94da740c0d5fca147b2e636249df28f32 --- /dev/null +++ b/assets/speech-CLjA-Bq8.js @@ -0,0 +1,2 @@ +import{a4 as te,cb as g,e as b,f as p,w as P,T as re}from"./index-B06xwjXa.js";import{r as ne,a as ae,b as oe,d as se}from"./index-LHmcipjy.js";import{u as ce}from"./providers-BCv4E6z9.js";const ie=/["&'<>`]/g,ue=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,le=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,de=/[|\\{}()[\]^$+*?.]/g,U=new WeakMap;function D(e,t){if(e=e.replace(t.subset?me(t.subset):ie,n),t.subset||t.escapeOnly)return e;return e.replace(ue,r).replace(le,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 me(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:"€"},be=["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 Se=/[^\dA-Za-z]/;function xe(e,t,r,n){const a=String.fromCharCode(e);if(j.call(L,a)){const s=L[a],l="&"+s;return r&&ye.includes(s)&&!be.includes(s)&&(!n||t&&t!==61&&Se.test(String.fromCharCode(t)))?l:l+";"}return""}function Ee(e,t,r){let n=pe(e,t,r.omitOptionalSemicolons),a;if((r.useNamedReferences||r.useShortestReferences)&&(a=xe(e,t,r.omitOptionalSemicolons,r.attribute)),(r.useShortestReferences||!a)&&r.useShortestReferences){const s=ve(e,t,r.omitOptionalSemicolons);s.length(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()),qe=/[\u0000-\u0008\u000B\u000C\u000E-\u001F]/g;function y(e,t,r){const n=Pe(e);return r?n.replace(r,a):a(n);function a(s){return Ae(s,{subset:t})}}function Pe(e){return String(e||"").replace(qe,"")}const Ce=/]]>/g,Te=[">"];function Le(e){return""}function Me(e){return""}const Re=[" ",` +`," ",'"',"&","'","/","<","=",">"];function x(e){return y(e,Re)}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 f=a[h];f!=null&&l.push(x(h)+"="+M(f,t))}return"<"+r+(l.length===0?"":" "+l.join(" "))+(s?(t.options.tightClose?"":" ")+"/":"")+">"+n+(s?"":"")}const Ne=/\?>/g,De=[">"];function je(e){const t=x(e.name)||"x",r=y(e.value,De,Ne);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,N={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(N,r))throw new Error("Cannot compile unknown node `"+r+"`");const n=N[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=g("settings/speech/active-provider",""),r=g("settings/speech/active-model","eleven_multilingual_v2"),n=g("settings/speech/voice",""),a=b(),s=g("settings/speech/pitch",0),l=g("settings/speech/rate",1),h=g("settings/speech/ssml-enabled",!1),f=b(!1),E=b(null),v=b({}),B=g("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[];f.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{f.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 Oe({...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:f,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,Oe as g,_e as s,Ke as u}; diff --git a/assets/speech-DpuUb2e9.js b/assets/speech-DpuUb2e9.js deleted file mode 100644 index 318313f9e92c0b4efa96549c3d13a05802e0962a..0000000000000000000000000000000000000000 --- a/assets/speech-DpuUb2e9.js +++ /dev/null @@ -1,2 +0,0 @@ -import{a4 as te,cb as g,e as b,f as p,w as P,T as re}from"./index-CNH1g_GM.js";import{r as ne,a as ae,b as oe,d as se}from"./index-LHmcipjy.js";import{u as ce}from"./providers-DP46_3AG.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 D(e,t){if(e=e.replace(t.subset?fe(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 fe(e){let t=U.get(e);return t||(t=ge(e),U.set(e,t)),t}function ge(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 f=a[h];f!=null&&l.push(x(h)+"="+M(f,t))}return"<"+r+(l.length===0?"":" "+l.join(" "))+(s?(t.options.tightClose?"":" ")+"/":"")+">"+n+(s?"":"")}const Ne=/\?>/g,De=[">"];function je(e){const t=x(e.name)||"x",r=y(e.value,De,Ne);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,N={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(N,r))throw new Error("Cannot compile unknown node `"+r+"`");const n=N[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=g("settings/speech/active-provider",""),r=g("settings/speech/active-model","eleven_multilingual_v2"),n=g("settings/speech/voice",""),a=b(),s=g("settings/speech/pitch",0),l=g("settings/speech/rate",1),h=g("settings/speech/ssml-enabled",!1),f=b(!1),E=b(null),v=b({}),B=g("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[];f.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{f.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:f,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/stage-DTB_g_kC.js b/assets/stage-VygCK4j1.js similarity index 85% rename from assets/stage-DTB_g_kC.js rename to assets/stage-VygCK4j1.js index 4730679bb0d5fa2ea6747c7ae7ee5de9d4de8621..444daff7cba9340e20ab8b90b8d95925d2a13226 100644 --- a/assets/stage-DTB_g_kC.js +++ b/assets/stage-VygCK4j1.js @@ -1 +1 @@ -import{d as p,a1 as s,c,b as d,a2 as i,a3 as m,u as e,o as l}from"./index-CNH1g_GM.js";const x=p({__name:"stage",setup(u){const{top:t,right:a,bottom:o,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(a)}px`,paddingBottom:`${e(o)}px`,paddingLeft:`${e(n)}px`})},[d(r)],4)}}});export{x as default}; +import{d as p,a1 as s,c,b as d,a2 as i,a3 as m,u as e,o as l}from"./index-B06xwjXa.js";const x=p({__name:"stage",setup(u){const{top:t,right:a,bottom:o,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(a)}px`,paddingBottom:`${e(o)}px`,paddingLeft:`${e(n)}px`})},[d(r)],4)}}});export{x as default}; diff --git a/assets/sury-DmrZ3_Oj-DbIZBXwJ.js b/assets/sury-DmrZ3_Oj-BFTxMXpP.js similarity index 50% rename from assets/sury-DmrZ3_Oj-DbIZBXwJ.js rename to assets/sury-DmrZ3_Oj-BFTxMXpP.js index c51ae519f423d5342b19712a23fed12b242bde9f..76e5dcf55d48604cb33e104b89bd1818dbbec456 100644 --- a/assets/sury-DmrZ3_Oj-DbIZBXwJ.js +++ b/assets/sury-DmrZ3_Oj-BFTxMXpP.js @@ -1 +1 @@ -import{cO as r}from"./index-CNH1g_GM.js";import{t as a}from"./mcp-B7-jaCfZ.js";const s=async()=>{const{toJSONSchema:t}=await a(r(()=>import("./__vite-optional-peer-dep_sury_xsschema-BIHI7g3E.js"),[]),"sury");return o=>t(o)};export{s as getToJsonSchemaFn}; +import{cO as r}from"./index-B06xwjXa.js";import{t as a}from"./mcp-BfXpaYZf.js";const s=async()=>{const{toJSONSchema:t}=await a(r(()=>import("./__vite-optional-peer-dep_sury_xsschema-BIHI7g3E.js"),[]),"sury");return o=>t(o)};export{s as getToJsonSchemaFn}; diff --git a/assets/three-vrm-animation.module-B_hGdUpX.js b/assets/three-vrm-animation.module-B_hGdUpX.js deleted file mode 100644 index 7fb80114ef6f953a4a6a1a631b36ad16d3db3cd0..0000000000000000000000000000000000000000 --- a/assets/three-vrm-animation.module-B_hGdUpX.js +++ /dev/null @@ -1,986 +0,0 @@ -import{ax as N,ar as ae,an as _,cP as z,aG as X,bE as Bi,aC as ki,aL as C,ap as T,aF as ee,bM as le,b5 as zt,aS as jt,aW as Xt,bF as Oe,bI as at,cQ as Fi,aB as Hi,cR as Wi,aD as zi,cS as ce,bA as xe,b2 as U,cT as ji,ay as Y,bJ as Xi,bH as qi,cU as qt,bN as lt,cV as Yi,aV as Ie,bO as Gi,bR as Qi,bS as $i}from"./index-CNH1g_GM.js";const et=400,j=[[.075,800],[.11,0],[.125,0],[.14,0],[.125,0],[.05,0],[.04,0],[.03,0],[.02,0],[1,0]];for(let e=1;enew Promise((i,r)=>{var o=s=>{try{l(n.next(s))}catch(u){r(u)}},a=s=>{try{l(n.throw(s))}catch(u){r(u)}},l=s=>s.done?i(s.value):Promise.resolve(s.value).then(o,a);l((n=n.apply(e,t)).next())}),A=(e,t,n)=>new Promise((i,r)=>{var o=s=>{try{l(n.next(s))}catch(u){r(u)}},a=s=>{try{l(n.throw(s))}catch(u){r(u)}},l=s=>s.done?i(s.value):Promise.resolve(s.value).then(o,a);l((n=n.apply(e,t)).next())}),Yt=class extends xe{constructor(e){super(),this.weight=0,this.isBinary=!1,this.overrideBlink="none",this.overrideLookAt="none",this.overrideMouth="none",this._binds=[],this.name=`VRMExpression_${e}`,this.expressionName=e,this.type="VRMExpression",this.visible=!1}get binds(){return this._binds}get overrideBlinkAmount(){return this.overrideBlink==="block"?0.5?1:0:this.weight}addBind(e){this._binds.push(e)}deleteBind(e){const t=this._binds.indexOf(e);t>=0&&this._binds.splice(t,1)}applyWeight(e){var t;let n=this.outputWeight;n*=(t=e==null?void 0:e.multiplier)!=null?t:1,this.isBinary&&n<1&&(n=0),this._binds.forEach(i=>i.applyWeight(n))}clearAppliedWeight(){this._binds.forEach(e=>e.clearAppliedWeight())}};function kn(e,t,n){var i,r;const o=e.parser.json,a=(i=o.nodes)==null?void 0:i[t];if(a==null)return console.warn(`extractPrimitivesInternal: Attempt to use nodes[${t}] of glTF but the node doesn't exist`),null;const l=a.mesh;if(l==null)return null;const s=(r=o.meshes)==null?void 0:r[l];if(s==null)return console.warn(`extractPrimitivesInternal: Attempt to use meshes[${l}] of glTF but the mesh doesn't exist`),null;const u=s.primitives.length,h=[];return n.traverse(d=>{h.length{const o=kn(e,r,i);o!=null&&n.set(r,o)}),n})}var tt={Aa:"aa",Ih:"ih",Ou:"ou",Ee:"ee",Oh:"oh",Blink:"blink",Happy:"happy",Angry:"angry",Sad:"sad",Relaxed:"relaxed",LookUp:"lookUp",Surprised:"surprised",LookDown:"lookDown",LookLeft:"lookLeft",LookRight:"lookRight",BlinkLeft:"blinkLeft",BlinkRight:"blinkRight",Neutral:"neutral"};function Fn(e){return Math.max(Math.min(e,1),0)}var $t=class Hn{constructor(){this.blinkExpressionNames=["blink","blinkLeft","blinkRight"],this.lookAtExpressionNames=["lookLeft","lookRight","lookUp","lookDown"],this.mouthExpressionNames=["aa","ee","ih","oh","ou"],this._expressions=[],this._expressionMap={}}get expressions(){return this._expressions.concat()}get expressionMap(){return Object.assign({},this._expressionMap)}get presetExpressionMap(){const t={},n=new Set(Object.values(tt));return Object.entries(this._expressionMap).forEach(([i,r])=>{n.has(i)&&(t[i]=r)}),t}get customExpressionMap(){const t={},n=new Set(Object.values(tt));return Object.entries(this._expressionMap).forEach(([i,r])=>{n.has(i)||(t[i]=r)}),t}copy(t){return this._expressions.concat().forEach(i=>{this.unregisterExpression(i)}),t._expressions.forEach(i=>{this.registerExpression(i)}),this.blinkExpressionNames=t.blinkExpressionNames.concat(),this.lookAtExpressionNames=t.lookAtExpressionNames.concat(),this.mouthExpressionNames=t.mouthExpressionNames.concat(),this}clone(){return new Hn().copy(this)}getExpression(t){var n;return(n=this._expressionMap[t])!=null?n:null}registerExpression(t){this._expressions.push(t),this._expressionMap[t.expressionName]=t}unregisterExpression(t){const n=this._expressions.indexOf(t);n===-1&&console.warn("VRMExpressionManager: The specified expressions is not registered"),this._expressions.splice(n,1),delete this._expressionMap[t.expressionName]}getValue(t){var n;const i=this.getExpression(t);return(n=i==null?void 0:i.weight)!=null?n:null}setValue(t,n){const i=this.getExpression(t);i&&(i.weight=Fn(n))}resetValues(){this._expressions.forEach(t=>{t.weight=0})}getExpressionTrackName(t){const n=this.getExpression(t);return n?`${n.name}.weight`:null}update(){const t=this._calculateWeightMultipliers();this._expressions.forEach(n=>{n.clearAppliedWeight()}),this._expressions.forEach(n=>{let i=1;const r=n.expressionName;this.blinkExpressionNames.indexOf(r)!==-1&&(i*=t.blink),this.lookAtExpressionNames.indexOf(r)!==-1&&(i*=t.lookAt),this.mouthExpressionNames.indexOf(r)!==-1&&(i*=t.mouth),n.applyWeight({multiplier:i})})}_calculateWeightMultipliers(){let t=1,n=1,i=1;return this._expressions.forEach(r=>{t-=r.overrideBlinkAmount,n-=r.overrideLookAtAmount,i-=r.overrideMouthAmount}),t=Math.max(0,t),n=Math.max(0,n),i=Math.max(0,i),{blink:t,lookAt:n,mouth:i}}},pe={Color:"color",EmissionColor:"emissionColor",ShadeColor:"shadeColor",RimColor:"rimColor",OutlineColor:"outlineColor"},Zi={_Color:pe.Color,_EmissionColor:pe.EmissionColor,_ShadeColor:pe.ShadeColor,_RimColor:pe.RimColor,_OutlineColor:pe.OutlineColor},Ji=new N,Wn=class zn{constructor({material:t,type:n,targetValue:i,targetAlpha:r}){this.material=t,this.type=n,this.targetValue=i,this.targetAlpha=r??1;const o=this._initColorBindState(),a=this._initAlphaBindState();this._state={color:o,alpha:a}}applyWeight(t){const{color:n,alpha:i}=this._state;if(n!=null){const{propertyName:r,deltaValue:o}=n,a=this.material[r];a!=null&&a.add(Ji.copy(o).multiplyScalar(t))}if(i!=null){const{propertyName:r,deltaValue:o}=i;this.material[r]!=null&&(this.material[r]+=o*t)}}clearAppliedWeight(){const{color:t,alpha:n}=this._state;if(t!=null){const{propertyName:i,initialValue:r}=t,o=this.material[i];o!=null&&o.copy(r)}if(n!=null){const{propertyName:i,initialValue:r}=n;this.material[i]!=null&&(this.material[i]=r)}}_initColorBindState(){var t,n,i;const{material:r,type:o,targetValue:a}=this,l=this._getPropertyNameMap(),s=(n=(t=l==null?void 0:l[o])==null?void 0:t[0])!=null?n:null;if(s==null)return console.warn(`Tried to add a material color bind to the material ${(i=r.name)!=null?i:"(no name)"}, the type ${o} but the material or the type is not supported.`),null;const h=r[s].clone(),d=new N(a.r-h.r,a.g-h.g,a.b-h.b);return{propertyName:s,initialValue:h,deltaValue:d}}_initAlphaBindState(){var t,n,i;const{material:r,type:o,targetAlpha:a}=this,l=this._getPropertyNameMap(),s=(n=(t=l==null?void 0:l[o])==null?void 0:t[1])!=null?n:null;if(s==null&&a!==1)return console.warn(`Tried to add a material alpha bind to the material ${(i=r.name)!=null?i:"(no name)"}, the type ${o} but the material or the type does not support alpha.`),null;if(s==null)return null;const u=r[s],h=a-u;return{propertyName:s,initialValue:u,deltaValue:h}}_getPropertyNameMap(){var t,n;return(n=(t=Object.entries(zn._propertyNameMapMap).find(([i])=>this.material[i]===!0))==null?void 0:t[1])!=null?n:null}};Wn._propertyNameMapMap={isMeshStandardMaterial:{color:["color","opacity"],emissionColor:["emissive",null]},isMeshBasicMaterial:{color:["color","opacity"]},isMToonMaterial:{color:["color","opacity"],emissionColor:["emissive",null],outlineColor:["outlineColorFactor",null],matcapColor:["matcapFactor",null],rimColor:["parametricRimColorFactor",null],shadeColor:["shadeColorFactor",null]}};var Zt=Wn,Ce=class{constructor({primitives:e,index:t,weight:n}){this.primitives=e,this.index=t,this.weight=n}applyWeight(e){this.primitives.forEach(t=>{var n;((n=t.morphTargetInfluences)==null?void 0:n[this.index])!=null&&(t.morphTargetInfluences[this.index]+=this.weight*e)})}clearAppliedWeight(){this.primitives.forEach(e=>{var t;((t=e.morphTargetInfluences)==null?void 0:t[this.index])!=null&&(e.morphTargetInfluences[this.index]=0)})}},Jt=new ae,jn=class Xn{constructor({material:t,scale:n,offset:i}){var r,o;this.material=t,this.scale=n,this.offset=i;const a=(r=Object.entries(Xn._propertyNamesMap).find(([l])=>t[l]===!0))==null?void 0:r[1];a==null?(console.warn(`Tried to add a texture transform bind to the material ${(o=t.name)!=null?o:"(no name)"} but the material is not supported.`),this._properties=[]):(this._properties=[],a.forEach(l=>{var s;const u=(s=t[l])==null?void 0:s.clone();if(!u)return null;t[l]=u;const h=u.offset.clone(),d=u.repeat.clone(),c=i.clone().sub(h),p=n.clone().sub(d);this._properties.push({name:l,initialOffset:h,deltaOffset:c,initialScale:d,deltaScale:p})}))}applyWeight(t){this._properties.forEach(n=>{const i=this.material[n.name];i!==void 0&&(i.offset.add(Jt.copy(n.deltaOffset).multiplyScalar(t)),i.repeat.add(Jt.copy(n.deltaScale).multiplyScalar(t)))})}clearAppliedWeight(){this._properties.forEach(t=>{const n=this.material[t.name];n!==void 0&&(n.offset.copy(t.initialOffset),n.repeat.copy(t.initialScale))})}};jn._propertyNamesMap={isMeshStandardMaterial:["map","emissiveMap","bumpMap","normalMap","displacementMap","roughnessMap","metalnessMap","alphaMap"],isMeshBasicMaterial:["map","specularMap","alphaMap"],isMToonMaterial:["map","normalMap","emissiveMap","shadeMultiplyTexture","rimMultiplyTexture","outlineWidthMultiplyTexture","uvAnimationMaskTexture"]};var Kt=jn,Ki=new Set(["1.0","1.0-beta"]),qn=class Yn{get name(){return"VRMExpressionLoaderPlugin"}constructor(t){this.parser=t}afterRoot(t){return A(this,null,function*(){t.userData.vrmExpressionManager=yield this._import(t)})}_import(t){return A(this,null,function*(){const n=yield this._v1Import(t);if(n)return n;const i=yield this._v0Import(t);return i||null})}_v1Import(t){return A(this,null,function*(){var n,i;const r=this.parser.json;if(!(((n=r.extensionsUsed)==null?void 0:n.indexOf("VRMC_vrm"))!==-1))return null;const a=(i=r.extensions)==null?void 0:i.VRMC_vrm;if(!a)return null;const l=a.specVersion;if(!Ki.has(l))return console.warn(`VRMExpressionLoaderPlugin: Unknown VRMC_vrm specVersion "${l}"`),null;const s=a.expressions;if(!s)return null;const u=new Set(Object.values(tt)),h=new Map;s.preset!=null&&Object.entries(s.preset).forEach(([c,p])=>{if(p!=null){if(!u.has(c)){console.warn(`VRMExpressionLoaderPlugin: Unknown preset name "${c}" detected. Ignoring the expression`);return}h.set(c,p)}}),s.custom!=null&&Object.entries(s.custom).forEach(([c,p])=>{if(u.has(c)){console.warn(`VRMExpressionLoaderPlugin: Custom expression cannot have preset name "${c}". Ignoring the expression`);return}h.set(c,p)});const d=new $t;return yield Promise.all(Array.from(h.entries()).map(c=>A(this,[c],function*([p,m]){var f,g,v,y,E,M,x;const w=new Yt(p);if(t.scene.add(w),w.isBinary=(f=m.isBinary)!=null?f:!1,w.overrideBlink=(g=m.overrideBlink)!=null?g:"none",w.overrideLookAt=(v=m.overrideLookAt)!=null?v:"none",w.overrideMouth=(y=m.overrideMouth)!=null?y:"none",(E=m.morphTargetBinds)==null||E.forEach(R=>A(this,null,function*(){var S;if(R.node===void 0||R.index===void 0)return;const L=yield Gt(t,R.node),b=R.index;if(!L.every(P=>Array.isArray(P.morphTargetInfluences)&&b{const L=S.material;L&&(Array.isArray(L)?R.push(...L):R.push(L))}),(M=m.materialColorBinds)==null||M.forEach(S=>A(this,null,function*(){R.filter(b=>{var P;const I=(P=this.parser.associations.get(b))==null?void 0:P.materials;return S.material===I}).forEach(b=>{w.addBind(new Zt({material:b,type:S.type,targetValue:new N().fromArray(S.targetValue),targetAlpha:S.targetValue[3]}))})})),(x=m.textureTransformBinds)==null||x.forEach(S=>A(this,null,function*(){R.filter(b=>{var P;const I=(P=this.parser.associations.get(b))==null?void 0:P.materials;return S.material===I}).forEach(b=>{var P,I;w.addBind(new Kt({material:b,offset:new ae().fromArray((P=S.offset)!=null?P:[0,0]),scale:new ae().fromArray((I=S.scale)!=null?I:[1,1])}))})}))}d.registerExpression(w)}))),d})}_v0Import(t){return A(this,null,function*(){var n;const i=this.parser.json,r=(n=i.extensions)==null?void 0:n.VRM;if(!r)return null;const o=r.blendShapeMaster;if(!o)return null;const a=new $t,l=o.blendShapeGroups;if(!l)return a;const s=new Set;return yield Promise.all(l.map(u=>A(this,null,function*(){var h;const d=u.presetName,c=d!=null&&Yn.v0v1PresetNameMap[d]||null,p=c??u.name;if(p==null){console.warn("VRMExpressionLoaderPlugin: One of custom expressions has no name. Ignoring the expression");return}if(s.has(p)){console.warn(`VRMExpressionLoaderPlugin: An expression preset ${d} has duplicated entries. Ignoring the expression`);return}s.add(p);const m=new Yt(p);t.scene.add(m),m.isBinary=(h=u.isBinary)!=null?h:!1,u.binds&&u.binds.forEach(g=>A(this,null,function*(){var v;if(g.mesh===void 0||g.index===void 0)return;const y=[];(v=i.nodes)==null||v.forEach((M,x)=>{M.mesh===g.mesh&&y.push(x)});const E=g.index;yield Promise.all(y.map(M=>A(this,null,function*(){var x;const w=yield Gt(t,M);if(!w.every(R=>Array.isArray(R.morphTargetInfluences)&&E{if(g.materialName===void 0||g.propertyName===void 0||g.targetValue===void 0)return;const v=[];t.scene.traverse(E=>{if(E.material){const M=E.material;Array.isArray(M)?v.push(...M.filter(x=>(x.name===g.materialName||x.name===g.materialName+" (Outline)")&&v.indexOf(x)===-1)):M.name===g.materialName&&v.indexOf(M)===-1&&v.push(M)}});const y=g.propertyName;v.forEach(E=>{if(y==="_MainTex_ST"){const x=new ae(g.targetValue[0],g.targetValue[1]),w=new ae(g.targetValue[2],g.targetValue[3]);w.y=1-w.y-x.y,m.addBind(new Kt({material:E,scale:x,offset:w}));return}const M=Zi[y];if(M){m.addBind(new Zt({material:E,type:M,targetValue:new N().fromArray(g.targetValue),targetAlpha:g.targetValue[3]}));return}console.warn(y+" is not supported")})}),a.registerExpression(m)}))),a})}};qn.v0v1PresetNameMap={a:"aa",e:"ee",i:"ih",o:"oh",u:"ou",blink:"blink",joy:"happy",angry:"angry",sorrow:"sad",fun:"relaxed",lookup:"lookUp",lookdown:"lookDown",lookleft:"lookLeft",lookright:"lookRight",blink_l:"blinkLeft",blink_r:"blinkRight",neutral:"neutral"};var er=qn,ut=class oe{constructor(t,n){this._firstPersonOnlyLayer=oe.DEFAULT_FIRSTPERSON_ONLY_LAYER,this._thirdPersonOnlyLayer=oe.DEFAULT_THIRDPERSON_ONLY_LAYER,this._initializedLayers=!1,this.humanoid=t,this.meshAnnotations=n}copy(t){if(this.humanoid!==t.humanoid)throw new Error("VRMFirstPerson: humanoid must be same in order to copy");return this.meshAnnotations=t.meshAnnotations.map(n=>({meshes:n.meshes.concat(),type:n.type})),this}clone(){return new oe(this.humanoid,this.meshAnnotations).copy(this)}get firstPersonOnlyLayer(){return this._firstPersonOnlyLayer}get thirdPersonOnlyLayer(){return this._thirdPersonOnlyLayer}setup({firstPersonOnlyLayer:t=oe.DEFAULT_FIRSTPERSON_ONLY_LAYER,thirdPersonOnlyLayer:n=oe.DEFAULT_THIRDPERSON_ONLY_LAYER}={}){this._initializedLayers||(this._firstPersonOnlyLayer=t,this._thirdPersonOnlyLayer=n,this.meshAnnotations.forEach(i=>{i.meshes.forEach(r=>{i.type==="firstPersonOnly"?(r.layers.set(this._firstPersonOnlyLayer),r.traverse(o=>o.layers.set(this._firstPersonOnlyLayer))):i.type==="thirdPersonOnly"?(r.layers.set(this._thirdPersonOnlyLayer),r.traverse(o=>o.layers.set(this._thirdPersonOnlyLayer))):i.type==="auto"&&this._createHeadlessModel(r)})}),this._initializedLayers=!0)}_excludeTriangles(t,n,i,r){let o=0;if(n!=null&&n.length>0)for(let a=0;a0&&r.includes(d[0])||h[1]>0&&r.includes(d[1])||h[2]>0&&r.includes(d[2])||h[3]>0&&r.includes(d[3]))continue;const c=n[s],p=i[s];if(c[0]>0&&r.includes(p[0])||c[1]>0&&r.includes(p[1])||c[2]>0&&r.includes(p[2])||c[3]>0&&r.includes(p[3]))continue;const m=n[u],f=i[u];m[0]>0&&r.includes(f[0])||m[1]>0&&r.includes(f[1])||m[2]>0&&r.includes(f[2])||m[3]>0&&r.includes(f[3])||(t[o++]=l,t[o++]=s,t[o++]=u)}return o}_createErasedMesh(t,n){const i=new qi(t.geometry.clone(),t.material);i.name=`${t.name}(erase)`,i.frustumCulled=t.frustumCulled,i.layers.set(this._firstPersonOnlyLayer);const r=i.geometry,o=r.getAttribute("skinIndex"),a=o instanceof qt?[]:o.array,l=[];for(let f=0;f{this._isEraseTarget(o)&&i.push(a)}),!i.length){n.layers.enable(this._thirdPersonOnlyLayer),n.layers.enable(this._firstPersonOnlyLayer);return}n.layers.set(this._thirdPersonOnlyLayer);const r=this._createErasedMesh(n,i);t.add(r)}_createHeadlessModel(t){if(t.type==="Group")if(t.layers.set(this._thirdPersonOnlyLayer),this._isEraseTarget(t))t.traverse(n=>n.layers.set(this._thirdPersonOnlyLayer));else{const n=new le;n.name=`_headless_${t.name}`,n.layers.set(this._firstPersonOnlyLayer),t.parent.add(n),t.children.filter(i=>i.type==="SkinnedMesh").forEach(i=>{const r=i;this._createHeadlessModelForSkinnedMesh(n,r)})}else if(t.type==="SkinnedMesh"){const n=t;this._createHeadlessModelForSkinnedMesh(t.parent,n)}else this._isEraseTarget(t)&&(t.layers.set(this._thirdPersonOnlyLayer),t.traverse(n=>n.layers.set(this._thirdPersonOnlyLayer)))}_isEraseTarget(t){return t===this.humanoid.getRawBoneNode("head")?!0:t.parent?this._isEraseTarget(t.parent):!1}};ut.DEFAULT_FIRSTPERSON_ONLY_LAYER=9;ut.DEFAULT_THIRDPERSON_ONLY_LAYER=10;var en=ut,tr=new Set(["1.0","1.0-beta"]),nr=class{get name(){return"VRMFirstPersonLoaderPlugin"}constructor(e){this.parser=e}afterRoot(e){return A(this,null,function*(){const t=e.userData.vrmHumanoid;if(t!==null){if(t===void 0)throw new Error("VRMFirstPersonLoaderPlugin: vrmHumanoid is undefined. VRMHumanoidLoaderPlugin have to be used first");e.userData.vrmFirstPerson=yield this._import(e,t)}})}_import(e,t){return A(this,null,function*(){if(t==null)return null;const n=yield this._v1Import(e,t);if(n)return n;const i=yield this._v0Import(e,t);return i||null})}_v1Import(e,t){return A(this,null,function*(){var n,i;const r=this.parser.json;if(!(((n=r.extensionsUsed)==null?void 0:n.indexOf("VRMC_vrm"))!==-1))return null;const a=(i=r.extensions)==null?void 0:i.VRMC_vrm;if(!a)return null;const l=a.specVersion;if(!tr.has(l))return console.warn(`VRMFirstPersonLoaderPlugin: Unknown VRMC_vrm specVersion "${l}"`),null;const s=a.firstPerson,u=[],h=yield Qt(e);return Array.from(h.entries()).forEach(([d,c])=>{var p,m;const f=(p=s==null?void 0:s.meshAnnotations)==null?void 0:p.find(g=>g.node===d);u.push({meshes:c,type:(m=f==null?void 0:f.type)!=null?m:"auto"})}),new en(t,u)})}_v0Import(e,t){return A(this,null,function*(){var n;const i=this.parser.json,r=(n=i.extensions)==null?void 0:n.VRM;if(!r)return null;const o=r.firstPerson;if(!o)return null;const a=[],l=yield Qt(e);return Array.from(l.entries()).forEach(([s,u])=>{const h=i.nodes[s],d=o.meshAnnotations?o.meshAnnotations.find(c=>c.mesh===h.mesh):void 0;a.push({meshes:u,type:this._convertV0FlagToV1Type(d==null?void 0:d.firstPersonFlag)})}),new en(t,a)})}_convertV0FlagToV1Type(e){return e==="FirstPersonOnly"?"firstPersonOnly":e==="ThirdPersonOnly"?"thirdPersonOnly":e==="Both"?"both":"auto"}},tn=new _,nn=new _,ir=new T,rn=class extends le{constructor(e){super(),this.vrmHumanoid=e,this._boneAxesMap=new Map,Object.values(e.humanBones).forEach(t=>{const n=new Yi(1);n.matrixAutoUpdate=!1,n.material.depthTest=!1,n.material.depthWrite=!1,this.add(n),this._boneAxesMap.set(t,n)})}dispose(){Array.from(this._boneAxesMap.values()).forEach(e=>{e.geometry.dispose(),e.material.dispose()})}updateMatrixWorld(e){Array.from(this._boneAxesMap.entries()).forEach(([t,n])=>{t.node.updateWorldMatrix(!0,!1),t.node.matrixWorld.decompose(tn,ir,nn);const i=tn.set(.1,.1,.1).divide(nn);n.matrix.copy(t.node.matrixWorld).scale(i)}),super.updateMatrixWorld(e)}},De=["hips","spine","chest","upperChest","neck","head","leftEye","rightEye","jaw","leftUpperLeg","leftLowerLeg","leftFoot","leftToes","rightUpperLeg","rightLowerLeg","rightFoot","rightToes","leftShoulder","leftUpperArm","leftLowerArm","leftHand","rightShoulder","rightUpperArm","rightLowerArm","rightHand","leftThumbMetacarpal","leftThumbProximal","leftThumbDistal","leftIndexProximal","leftIndexIntermediate","leftIndexDistal","leftMiddleProximal","leftMiddleIntermediate","leftMiddleDistal","leftRingProximal","leftRingIntermediate","leftRingDistal","leftLittleProximal","leftLittleIntermediate","leftLittleDistal","rightThumbMetacarpal","rightThumbProximal","rightThumbDistal","rightIndexProximal","rightIndexIntermediate","rightIndexDistal","rightMiddleProximal","rightMiddleIntermediate","rightMiddleDistal","rightRingProximal","rightRingIntermediate","rightRingDistal","rightLittleProximal","rightLittleIntermediate","rightLittleDistal"],rr={hips:null,spine:"hips",chest:"spine",upperChest:"chest",neck:"upperChest",head:"neck",leftEye:"head",rightEye:"head",jaw:"head",leftUpperLeg:"hips",leftLowerLeg:"leftUpperLeg",leftFoot:"leftLowerLeg",leftToes:"leftFoot",rightUpperLeg:"hips",rightLowerLeg:"rightUpperLeg",rightFoot:"rightLowerLeg",rightToes:"rightFoot",leftShoulder:"upperChest",leftUpperArm:"leftShoulder",leftLowerArm:"leftUpperArm",leftHand:"leftLowerArm",rightShoulder:"upperChest",rightUpperArm:"rightShoulder",rightLowerArm:"rightUpperArm",rightHand:"rightLowerArm",leftThumbMetacarpal:"leftHand",leftThumbProximal:"leftThumbMetacarpal",leftThumbDistal:"leftThumbProximal",leftIndexProximal:"leftHand",leftIndexIntermediate:"leftIndexProximal",leftIndexDistal:"leftIndexIntermediate",leftMiddleProximal:"leftHand",leftMiddleIntermediate:"leftMiddleProximal",leftMiddleDistal:"leftMiddleIntermediate",leftRingProximal:"leftHand",leftRingIntermediate:"leftRingProximal",leftRingDistal:"leftRingIntermediate",leftLittleProximal:"leftHand",leftLittleIntermediate:"leftLittleProximal",leftLittleDistal:"leftLittleIntermediate",rightThumbMetacarpal:"rightHand",rightThumbProximal:"rightThumbMetacarpal",rightThumbDistal:"rightThumbProximal",rightIndexProximal:"rightHand",rightIndexIntermediate:"rightIndexProximal",rightIndexDistal:"rightIndexIntermediate",rightMiddleProximal:"rightHand",rightMiddleIntermediate:"rightMiddleProximal",rightMiddleDistal:"rightMiddleIntermediate",rightRingProximal:"rightHand",rightRingIntermediate:"rightRingProximal",rightRingDistal:"rightRingIntermediate",rightLittleProximal:"rightHand",rightLittleIntermediate:"rightLittleProximal",rightLittleDistal:"rightLittleIntermediate"};function Gn(e){return e.invert?e.invert():e.inverse(),e}var $=new _,Z=new T,nt=class{constructor(e){this.humanBones=e,this.restPose=this.getAbsolutePose()}getAbsolutePose(){const e={};return Object.keys(this.humanBones).forEach(t=>{const n=t,i=this.getBoneNode(n);i&&($.copy(i.position),Z.copy(i.quaternion),e[n]={position:$.toArray(),rotation:Z.toArray()})}),e}getPose(){const e={};return Object.keys(this.humanBones).forEach(t=>{const n=t,i=this.getBoneNode(n);if(!i)return;$.set(0,0,0),Z.identity();const r=this.restPose[n];r!=null&&r.position&&$.fromArray(r.position).negate(),r!=null&&r.rotation&&Gn(Z.fromArray(r.rotation)),$.add(i.position),Z.premultiply(i.quaternion),e[n]={position:$.toArray(),rotation:Z.toArray()}}),e}setPose(e){Object.entries(e).forEach(([t,n])=>{const i=t,r=this.getBoneNode(i);if(!r)return;const o=this.restPose[i];o&&(n!=null&&n.position&&(r.position.fromArray(n.position),o.position&&r.position.add($.fromArray(o.position))),n!=null&&n.rotation&&(r.quaternion.fromArray(n.rotation),o.rotation&&r.quaternion.multiply(Z.fromArray(o.rotation))))})}resetPose(){Object.entries(this.restPose).forEach(([e,t])=>{const n=this.getBoneNode(e);n&&(t!=null&&t.position&&n.position.fromArray(t.position),t!=null&&t.rotation&&n.quaternion.fromArray(t.rotation))})}getBone(e){var t;return(t=this.humanBones[e])!=null?t:void 0}getBoneNode(e){var t,n;return(n=(t=this.humanBones[e])==null?void 0:t.node)!=null?n:null}},Be=new _,or=new T,sr=new _,on=class Qn extends nt{static _setupTransforms(t){const n=new xe;n.name="VRMHumanoidRig";const i={},r={},o={};De.forEach(l=>{var s;const u=t.getBoneNode(l);if(u){const h=new _,d=new T;u.updateWorldMatrix(!0,!1),u.matrixWorld.decompose(h,d,Be),i[l]=h,r[l]=u.quaternion.clone();const c=new T;(s=u.parent)==null||s.matrixWorld.decompose(Be,c,Be),o[l]=c}});const a={};return De.forEach(l=>{var s;const u=t.getBoneNode(l);if(u){const h=i[l];let d=l,c;for(;c==null&&(d=rr[d],d!=null);)c=i[d];const p=new xe;p.name="Normalized_"+u.name,(d?(s=a[d])==null?void 0:s.node:n).add(p),p.position.copy(h),c&&p.position.sub(c),a[l]={node:p}}}),{rigBones:a,root:n,parentWorldRotations:o,boneRotations:r}}constructor(t){const{rigBones:n,root:i,parentWorldRotations:r,boneRotations:o}=Qn._setupTransforms(t);super(n),this.original=t,this.root=i,this._parentWorldRotations=r,this._boneRotations=o}update(){De.forEach(t=>{const n=this.original.getBoneNode(t);if(n!=null){const i=this.getBoneNode(t),r=this._parentWorldRotations[t],o=or.copy(r).invert(),a=this._boneRotations[t];if(n.quaternion.copy(i.quaternion).multiply(r).premultiply(o).multiply(a),t==="hips"){const l=i.getWorldPosition(sr);n.parent.updateWorldMatrix(!0,!1);const s=n.parent.matrixWorld,u=l.applyMatrix4(s.invert());n.position.copy(u)}}})}},sn=class $n{get restPose(){return console.warn("VRMHumanoid: restPose is deprecated. Use either rawRestPose or normalizedRestPose instead."),this.rawRestPose}get rawRestPose(){return this._rawHumanBones.restPose}get normalizedRestPose(){return this._normalizedHumanBones.restPose}get humanBones(){return this._rawHumanBones.humanBones}get rawHumanBones(){return this._rawHumanBones.humanBones}get normalizedHumanBones(){return this._normalizedHumanBones.humanBones}get normalizedHumanBonesRoot(){return this._normalizedHumanBones.root}constructor(t,n){var i;this.autoUpdateHumanBones=(i=n==null?void 0:n.autoUpdateHumanBones)!=null?i:!0,this._rawHumanBones=new nt(t),this._normalizedHumanBones=new on(this._rawHumanBones)}copy(t){return this.autoUpdateHumanBones=t.autoUpdateHumanBones,this._rawHumanBones=new nt(t.humanBones),this._normalizedHumanBones=new on(this._rawHumanBones),this}clone(){return new $n(this.humanBones,{autoUpdateHumanBones:this.autoUpdateHumanBones}).copy(this)}getAbsolutePose(){return console.warn("VRMHumanoid: getAbsolutePose() is deprecated. Use either getRawAbsolutePose() or getNormalizedAbsolutePose() instead."),this.getRawAbsolutePose()}getRawAbsolutePose(){return this._rawHumanBones.getAbsolutePose()}getNormalizedAbsolutePose(){return this._normalizedHumanBones.getAbsolutePose()}getPose(){return console.warn("VRMHumanoid: getPose() is deprecated. Use either getRawPose() or getNormalizedPose() instead."),this.getRawPose()}getRawPose(){return this._rawHumanBones.getPose()}getNormalizedPose(){return this._normalizedHumanBones.getPose()}setPose(t){return console.warn("VRMHumanoid: setPose() is deprecated. Use either setRawPose() or setNormalizedPose() instead."),this.setRawPose(t)}setRawPose(t){return this._rawHumanBones.setPose(t)}setNormalizedPose(t){return this._normalizedHumanBones.setPose(t)}resetPose(){return console.warn("VRMHumanoid: resetPose() is deprecated. Use either resetRawPose() or resetNormalizedPose() instead."),this.resetRawPose()}resetRawPose(){return this._rawHumanBones.resetPose()}resetNormalizedPose(){return this._normalizedHumanBones.resetPose()}getBone(t){return console.warn("VRMHumanoid: getBone() is deprecated. Use either getRawBone() or getNormalizedBone() instead."),this.getRawBone(t)}getRawBone(t){return this._rawHumanBones.getBone(t)}getNormalizedBone(t){return this._normalizedHumanBones.getBone(t)}getBoneNode(t){return console.warn("VRMHumanoid: getBoneNode() is deprecated. Use either getRawBoneNode() or getNormalizedBoneNode() instead."),this.getRawBoneNode(t)}getRawBoneNode(t){return this._rawHumanBones.getBoneNode(t)}getNormalizedBoneNode(t){return this._normalizedHumanBones.getBoneNode(t)}update(){this.autoUpdateHumanBones&&this._normalizedHumanBones.update()}},ar={Hips:"hips",Spine:"spine",Head:"head",LeftUpperLeg:"leftUpperLeg",LeftLowerLeg:"leftLowerLeg",LeftFoot:"leftFoot",RightUpperLeg:"rightUpperLeg",RightLowerLeg:"rightLowerLeg",RightFoot:"rightFoot",LeftUpperArm:"leftUpperArm",LeftLowerArm:"leftLowerArm",LeftHand:"leftHand",RightUpperArm:"rightUpperArm",RightLowerArm:"rightLowerArm",RightHand:"rightHand"},lr=new Set(["1.0","1.0-beta"]),an={leftThumbProximal:"leftThumbMetacarpal",leftThumbIntermediate:"leftThumbProximal",rightThumbProximal:"rightThumbMetacarpal",rightThumbIntermediate:"rightThumbProximal"},ur=class{get name(){return"VRMHumanoidLoaderPlugin"}constructor(e,t){this.parser=e,this.helperRoot=t==null?void 0:t.helperRoot,this.autoUpdateHumanBones=t==null?void 0:t.autoUpdateHumanBones}afterRoot(e){return A(this,null,function*(){e.userData.vrmHumanoid=yield this._import(e)})}_import(e){return A(this,null,function*(){const t=yield this._v1Import(e);if(t)return t;const n=yield this._v0Import(e);return n||null})}_v1Import(e){return A(this,null,function*(){var t,n;const i=this.parser.json;if(!(((t=i.extensionsUsed)==null?void 0:t.indexOf("VRMC_vrm"))!==-1))return null;const o=(n=i.extensions)==null?void 0:n.VRMC_vrm;if(!o)return null;const a=o.specVersion;if(!lr.has(a))return console.warn(`VRMHumanoidLoaderPlugin: Unknown VRMC_vrm specVersion "${a}"`),null;const l=o.humanoid;if(!l)return null;const s=l.humanBones.leftThumbIntermediate!=null||l.humanBones.rightThumbIntermediate!=null,u={};l.humanBones!=null&&(yield Promise.all(Object.entries(l.humanBones).map(d=>A(this,[d],function*([c,p]){let m=c;const f=p.node;if(s){const v=an[m];v!=null&&(m=v)}const g=yield this.parser.getDependency("node",f);if(g==null){console.warn(`A glTF node bound to the humanoid bone ${m} (index = ${f}) does not exist`);return}u[m]={node:g}}))));const h=new sn(this._ensureRequiredBonesExist(u),{autoUpdateHumanBones:this.autoUpdateHumanBones});if(e.scene.add(h.normalizedHumanBonesRoot),this.helperRoot){const d=new rn(h);this.helperRoot.add(d),d.renderOrder=this.helperRoot.renderOrder}return h})}_v0Import(e){return A(this,null,function*(){var t;const i=(t=this.parser.json.extensions)==null?void 0:t.VRM;if(!i)return null;const r=i.humanoid;if(!r)return null;const o={};r.humanBones!=null&&(yield Promise.all(r.humanBones.map(l=>A(this,null,function*(){const s=l.bone,u=l.node;if(s==null||u==null)return;const h=yield this.parser.getDependency("node",u);if(h==null){console.warn(`A glTF node bound to the humanoid bone ${s} (index = ${u}) does not exist`);return}const d=an[s],c=d??s;if(o[c]!=null){console.warn(`Multiple bone entries for ${c} detected (index = ${u}), ignoring duplicated entries.`);return}o[c]={node:h}}))));const a=new sn(this._ensureRequiredBonesExist(o),{autoUpdateHumanBones:this.autoUpdateHumanBones});if(e.scene.add(a.normalizedHumanBonesRoot),this.helperRoot){const l=new rn(a);this.helperRoot.add(l),l.renderOrder=this.helperRoot.renderOrder}return a})}_ensureRequiredBonesExist(e){const t=Object.values(ar).filter(n=>e[n]==null);if(t.length>0)throw new Error(`VRMHumanoidLoaderPlugin: These humanoid bones are required but not exist: ${t.join(", ")}`);return e}},ln=class extends Y{constructor(){super(),this._currentTheta=0,this._currentRadius=0,this.theta=0,this.radius=0,this._currentTheta=0,this._currentRadius=0,this._attrPos=new U(new Float32Array(65*3),3),this.setAttribute("position",this._attrPos),this._attrIndex=new U(new Uint16Array(3*63),1),this.setIndex(this._attrIndex),this._buildIndex(),this.update()}update(){let e=!1;this._currentTheta!==this.theta&&(this._currentTheta=this.theta,e=!0),this._currentRadius!==this.radius&&(this._currentRadius=this.radius,e=!0),e&&this._buildPosition()}_buildPosition(){this._attrPos.setXYZ(0,0,0,0);for(let e=0;e<64;e++){const t=e/63*this._currentTheta;this._attrPos.setXYZ(e+1,this._currentRadius*Math.sin(t),0,this._currentRadius*Math.cos(t))}this._attrPos.needsUpdate=!0}_buildIndex(){for(let e=0;e<63;e++)this._attrIndex.setXYZ(e*3,0,e+1,e+2);this._attrIndex.needsUpdate=!0}},dr=class extends Y{constructor(){super(),this.radius=0,this._currentRadius=0,this.tail=new _,this._currentTail=new _,this._attrPos=new U(new Float32Array(294),3),this.setAttribute("position",this._attrPos),this._attrIndex=new U(new Uint16Array(194),1),this.setIndex(this._attrIndex),this._buildIndex(),this.update()}update(){let e=!1;this._currentRadius!==this.radius&&(this._currentRadius=this.radius,e=!0),this._currentTail.equals(this.tail)||(this._currentTail.copy(this.tail),e=!0),e&&this._buildPosition()}_buildPosition(){for(let e=0;e<32;e++){const t=e/16*Math.PI;this._attrPos.setXYZ(e,Math.cos(t),Math.sin(t),0),this._attrPos.setXYZ(32+e,0,Math.cos(t),Math.sin(t)),this._attrPos.setXYZ(64+e,Math.sin(t),0,Math.cos(t))}this.scale(this._currentRadius,this._currentRadius,this._currentRadius),this.translate(this._currentTail.x,this._currentTail.y,this._currentTail.z),this._attrPos.setXYZ(96,0,0,0),this._attrPos.setXYZ(97,this._currentTail.x,this._currentTail.y,this._currentTail.z),this._attrPos.needsUpdate=!0}_buildIndex(){for(let e=0;e<32;e++){const t=(e+1)%32;this._attrIndex.setXY(e*2,e,t),this._attrIndex.setXY(64+e*2,32+e,32+t),this._attrIndex.setXY(128+e*2,64+e,64+t)}this._attrIndex.setXY(192,96,97),this._attrIndex.needsUpdate=!0}},Ee=new T,un=new T,me=new _,dn=new _,hn=Math.sqrt(2)/2,hr=new T(0,0,-hn,hn),cr=new _(0,1,0),pr=class extends le{constructor(e){super(),this.matrixAutoUpdate=!1,this.vrmLookAt=e;{const t=new ln;t.radius=.5;const n=new zt({color:65280,transparent:!0,opacity:.5,side:jt,depthTest:!1,depthWrite:!1});this._meshPitch=new Xt(t,n),this.add(this._meshPitch)}{const t=new ln;t.radius=.5;const n=new zt({color:16711680,transparent:!0,opacity:.5,side:jt,depthTest:!1,depthWrite:!1});this._meshYaw=new Xt(t,n),this.add(this._meshYaw)}{const t=new dr;t.radius=.1;const n=new Oe({color:16777215,depthTest:!1,depthWrite:!1});this._lineTarget=new at(t,n),this._lineTarget.frustumCulled=!1,this.add(this._lineTarget)}}dispose(){this._meshYaw.geometry.dispose(),this._meshYaw.material.dispose(),this._meshPitch.geometry.dispose(),this._meshPitch.material.dispose(),this._lineTarget.geometry.dispose(),this._lineTarget.material.dispose()}updateMatrixWorld(e){const t=C.DEG2RAD*this.vrmLookAt.yaw;this._meshYaw.geometry.theta=t,this._meshYaw.geometry.update();const n=C.DEG2RAD*this.vrmLookAt.pitch;this._meshPitch.geometry.theta=n,this._meshPitch.geometry.update(),this.vrmLookAt.getLookAtWorldPosition(me),this.vrmLookAt.getLookAtWorldQuaternion(Ee),Ee.multiply(this.vrmLookAt.getFaceFrontQuaternion(un)),this._meshYaw.position.copy(me),this._meshYaw.quaternion.copy(Ee),this._meshPitch.position.copy(me),this._meshPitch.quaternion.copy(Ee),this._meshPitch.quaternion.multiply(un.setFromAxisAngle(cr,t)),this._meshPitch.quaternion.multiply(hr);const{target:i,autoUpdate:r}=this.vrmLookAt;i!=null&&r&&(i.getWorldPosition(dn).sub(me),this._lineTarget.geometry.tail.copy(dn),this._lineTarget.geometry.update(),this._lineTarget.position.copy(me)),super.updateMatrixWorld(e)}},mr=new _,fr=new _;function it(e,t){return e.matrixWorld.decompose(mr,t,fr),t}function Pe(e){return[Math.atan2(-e.z,e.x),Math.atan2(e.y,Math.sqrt(e.x*e.x+e.z*e.z))]}function cn(e){const t=Math.round(e/2/Math.PI);return e-2*Math.PI*t}var pn=new _(0,0,1),_r=new _,gr=new _,vr=new _,Mr=new T,ke=new T,mn=new T,xr=new T,Fe=new ee,Zn=class Jn{constructor(t,n){this.offsetFromHeadBone=new _,this.autoUpdate=!0,this.faceFront=new _(0,0,1),this.humanoid=t,this.applier=n,this._yaw=0,this._pitch=0,this._needsUpdate=!0,this._restHeadWorldQuaternion=this.getLookAtWorldQuaternion(new T)}get yaw(){return this._yaw}set yaw(t){this._yaw=t,this._needsUpdate=!0}get pitch(){return this._pitch}set pitch(t){this._pitch=t,this._needsUpdate=!0}get euler(){return console.warn("VRMLookAt: euler is deprecated. use getEuler() instead."),this.getEuler(new ee)}getEuler(t){return t.set(C.DEG2RAD*this._pitch,C.DEG2RAD*this._yaw,0,"YXZ")}copy(t){if(this.humanoid!==t.humanoid)throw new Error("VRMLookAt: humanoid must be same in order to copy");return this.offsetFromHeadBone.copy(t.offsetFromHeadBone),this.applier=t.applier,this.autoUpdate=t.autoUpdate,this.target=t.target,this.faceFront.copy(t.faceFront),this}clone(){return new Jn(this.humanoid,this.applier).copy(this)}reset(){this._yaw=0,this._pitch=0,this._needsUpdate=!0}getLookAtWorldPosition(t){const n=this.humanoid.getRawBoneNode("head");return t.copy(this.offsetFromHeadBone).applyMatrix4(n.matrixWorld)}getLookAtWorldQuaternion(t){const n=this.humanoid.getRawBoneNode("head");return it(n,t)}getFaceFrontQuaternion(t){if(this.faceFront.distanceToSquared(pn)<.01)return t.copy(this._restHeadWorldQuaternion).invert();const[n,i]=Pe(this.faceFront);return Fe.set(0,.5*Math.PI+n,i,"YZX"),t.setFromEuler(Fe).premultiply(xr.copy(this._restHeadWorldQuaternion).invert())}getLookAtWorldDirection(t){return this.getLookAtWorldQuaternion(ke),this.getFaceFrontQuaternion(mn),t.copy(pn).applyQuaternion(ke).applyQuaternion(mn).applyEuler(this.getEuler(Fe))}lookAt(t){const n=Mr.copy(this._restHeadWorldQuaternion).multiply(Gn(this.getLookAtWorldQuaternion(ke))),i=this.getLookAtWorldPosition(gr),r=vr.copy(t).sub(i).applyQuaternion(n).normalize(),[o,a]=Pe(this.faceFront),[l,s]=Pe(r),u=cn(l-o),h=cn(a-s);this._yaw=C.RAD2DEG*u,this._pitch=C.RAD2DEG*h,this._needsUpdate=!0}update(t){this.target!=null&&this.autoUpdate&&this.lookAt(this.target.getWorldPosition(_r)),this._needsUpdate&&(this._needsUpdate=!1,this.applier.applyYawPitch(this._yaw,this._pitch))}};Zn.EULER_ORDER="YXZ";var yr=Zn,wr=new _(0,0,1),F=new T,ne=new T,V=new ee(0,0,0,"YXZ"),Le=class{constructor(e,t,n,i,r){this.humanoid=e,this.rangeMapHorizontalInner=t,this.rangeMapHorizontalOuter=n,this.rangeMapVerticalDown=i,this.rangeMapVerticalUp=r,this.faceFront=new _(0,0,1),this._restQuatLeftEye=new T,this._restQuatRightEye=new T,this._restLeftEyeParentWorldQuat=new T,this._restRightEyeParentWorldQuat=new T;const o=this.humanoid.getRawBoneNode("leftEye"),a=this.humanoid.getRawBoneNode("rightEye");o&&(this._restQuatLeftEye.copy(o.quaternion),it(o.parent,this._restLeftEyeParentWorldQuat)),a&&(this._restQuatRightEye.copy(a.quaternion),it(a.parent,this._restRightEyeParentWorldQuat))}applyYawPitch(e,t){const n=this.humanoid.getRawBoneNode("leftEye"),i=this.humanoid.getRawBoneNode("rightEye"),r=this.humanoid.getNormalizedBoneNode("leftEye"),o=this.humanoid.getNormalizedBoneNode("rightEye");n&&(t<0?V.x=-C.DEG2RAD*this.rangeMapVerticalDown.map(-t):V.x=C.DEG2RAD*this.rangeMapVerticalUp.map(t),e<0?V.y=-C.DEG2RAD*this.rangeMapHorizontalInner.map(-e):V.y=C.DEG2RAD*this.rangeMapHorizontalOuter.map(e),F.setFromEuler(V),this._getWorldFaceFrontQuat(ne),r.quaternion.copy(ne).multiply(F).multiply(ne.invert()),F.copy(this._restLeftEyeParentWorldQuat),n.quaternion.copy(r.quaternion).multiply(F).premultiply(F.invert()).multiply(this._restQuatLeftEye)),i&&(t<0?V.x=-C.DEG2RAD*this.rangeMapVerticalDown.map(-t):V.x=C.DEG2RAD*this.rangeMapVerticalUp.map(t),e<0?V.y=-C.DEG2RAD*this.rangeMapHorizontalOuter.map(-e):V.y=C.DEG2RAD*this.rangeMapHorizontalInner.map(e),F.setFromEuler(V),this._getWorldFaceFrontQuat(ne),o.quaternion.copy(ne).multiply(F).multiply(ne.invert()),F.copy(this._restRightEyeParentWorldQuat),i.quaternion.copy(o.quaternion).multiply(F).premultiply(F.invert()).multiply(this._restQuatRightEye))}lookAt(e){console.warn("VRMLookAtBoneApplier: lookAt() is deprecated. use apply() instead.");const t=C.RAD2DEG*e.y,n=C.RAD2DEG*e.x;this.applyYawPitch(t,n)}_getWorldFaceFrontQuat(e){if(this.faceFront.distanceToSquared(wr)<.01)return e.identity();const[t,n]=Pe(this.faceFront);return V.set(0,.5*Math.PI+t,n,"YZX"),e.setFromEuler(V)}};Le.type="bone";var rt=class{constructor(e,t,n,i,r){this.expressions=e,this.rangeMapHorizontalInner=t,this.rangeMapHorizontalOuter=n,this.rangeMapVerticalDown=i,this.rangeMapVerticalUp=r}applyYawPitch(e,t){t<0?(this.expressions.setValue("lookDown",0),this.expressions.setValue("lookUp",this.rangeMapVerticalUp.map(-t))):(this.expressions.setValue("lookUp",0),this.expressions.setValue("lookDown",this.rangeMapVerticalDown.map(t))),e<0?(this.expressions.setValue("lookLeft",0),this.expressions.setValue("lookRight",this.rangeMapHorizontalOuter.map(-e))):(this.expressions.setValue("lookRight",0),this.expressions.setValue("lookLeft",this.rangeMapHorizontalOuter.map(e)))}lookAt(e){console.warn("VRMLookAtBoneApplier: lookAt() is deprecated. use apply() instead.");const t=C.RAD2DEG*e.y,n=C.RAD2DEG*e.x;this.applyYawPitch(t,n)}};rt.type="expression";var fn=class{constructor(e,t){this.inputMaxValue=e,this.outputScale=t}map(e){return this.outputScale*Fn(e/this.inputMaxValue)}},Rr=new Set(["1.0","1.0-beta"]),Se=.01,Tr=class{get name(){return"VRMLookAtLoaderPlugin"}constructor(e,t){this.parser=e,this.helperRoot=t==null?void 0:t.helperRoot}afterRoot(e){return A(this,null,function*(){const t=e.userData.vrmHumanoid;if(t===null)return;if(t===void 0)throw new Error("VRMLookAtLoaderPlugin: vrmHumanoid is undefined. VRMHumanoidLoaderPlugin have to be used first");const n=e.userData.vrmExpressionManager;if(n!==null){if(n===void 0)throw new Error("VRMLookAtLoaderPlugin: vrmExpressionManager is undefined. VRMExpressionLoaderPlugin have to be used first");e.userData.vrmLookAt=yield this._import(e,t,n)}})}_import(e,t,n){return A(this,null,function*(){if(t==null||n==null)return null;const i=yield this._v1Import(e,t,n);if(i)return i;const r=yield this._v0Import(e,t,n);return r||null})}_v1Import(e,t,n){return A(this,null,function*(){var i,r,o;const a=this.parser.json;if(!(((i=a.extensionsUsed)==null?void 0:i.indexOf("VRMC_vrm"))!==-1))return null;const s=(r=a.extensions)==null?void 0:r.VRMC_vrm;if(!s)return null;const u=s.specVersion;if(!Rr.has(u))return console.warn(`VRMLookAtLoaderPlugin: Unknown VRMC_vrm specVersion "${u}"`),null;const h=s.lookAt;if(!h)return null;const d=h.type==="expression"?1:10,c=this._v1ImportRangeMap(h.rangeMapHorizontalInner,d),p=this._v1ImportRangeMap(h.rangeMapHorizontalOuter,d),m=this._v1ImportRangeMap(h.rangeMapVerticalDown,d),f=this._v1ImportRangeMap(h.rangeMapVerticalUp,d);let g;h.type==="expression"?g=new rt(n,c,p,m,f):g=new Le(t,c,p,m,f);const v=this._importLookAt(t,g);return v.offsetFromHeadBone.fromArray((o=h.offsetFromHeadBone)!=null?o:[0,.06,0]),v})}_v1ImportRangeMap(e,t){var n,i;let r=(n=e==null?void 0:e.inputMaxValue)!=null?n:90;const o=(i=e==null?void 0:e.outputScale)!=null?i:t;return r(console.error(a),console.warn("VRMMetaLoaderPlugin: Failed to load a thumbnail image"),null))})}},Pr=class{constructor(e){this.scene=e.scene,this.meta=e.meta,this.humanoid=e.humanoid,this.expressionManager=e.expressionManager,this.firstPerson=e.firstPerson,this.lookAt=e.lookAt}update(e){this.humanoid.update(),this.lookAt&&this.lookAt.update(e),this.expressionManager&&this.expressionManager.update()}},Lr=class extends Pr{constructor(e){super(e),this.materials=e.materials,this.springBoneManager=e.springBoneManager,this.nodeConstraintManager=e.nodeConstraintManager}update(e){super.update(e),this.nodeConstraintManager&&this.nodeConstraintManager.update(),this.springBoneManager&&this.springBoneManager.update(e),this.materials&&this.materials.forEach(t=>{t.update&&t.update(e)})}},br=Object.defineProperty,_n=Object.getOwnPropertySymbols,Ir=Object.prototype.hasOwnProperty,Cr=Object.prototype.propertyIsEnumerable,gn=(e,t,n)=>t in e?br(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,vn=(e,t)=>{for(var n in t||(t={}))Ir.call(t,n)&&gn(e,n,t[n]);if(_n)for(var n of _n(t))Cr.call(t,n)&&gn(e,n,t[n]);return e},K=(e,t,n)=>new Promise((i,r)=>{var o=s=>{try{l(n.next(s))}catch(u){r(u)}},a=s=>{try{l(n.throw(s))}catch(u){r(u)}},l=s=>s.done?i(s.value):Promise.resolve(s.value).then(o,a);l((n=n.apply(e,t)).next())}),Ur={"":3e3,srgb:3001};function Or(e,t){parseInt(Ie,10)>=152?e.colorSpace=t:e.encoding=Ur[t]}var Vr=class{get pending(){return Promise.all(this._pendings)}constructor(e,t){this._parser=e,this._materialParams=t,this._pendings=[]}assignPrimitive(e,t){t!=null&&(this._materialParams[e]=t)}assignColor(e,t,n){t!=null&&(this._materialParams[e]=new N().fromArray(t),n&&this._materialParams[e].convertSRGBToLinear())}assignTexture(e,t,n){return K(this,null,function*(){const i=K(this,null,function*(){t!=null&&(yield this._parser.assignTexture(this._materialParams,e,t),n&&Or(this._materialParams[e],"srgb"))});return this._pendings.push(i),i})}assignTextureByIndex(e,t,n){return K(this,null,function*(){return this.assignTexture(e,t!=null?{index:t}:void 0,n)})}},Nr=`// #define PHONG - -varying vec3 vViewPosition; - -#ifndef FLAT_SHADED - varying vec3 vNormal; -#endif - -#include - -// #include -#ifdef MTOON_USE_UV - varying vec2 vUv; - - // COMPAT: pre-r151 uses a common uvTransform - #if THREE_VRM_THREE_REVISION < 151 - uniform mat3 uvTransform; - #endif -#endif - -// #include -// COMAPT: pre-r151 uses uv2 for lightMap and aoMap -#if THREE_VRM_THREE_REVISION < 151 - #if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) - attribute vec2 uv2; - varying vec2 vUv2; - uniform mat3 uv2Transform; - #endif -#endif - -// #include -// #include -#include -#include -#include -#include -#include -#include -#include - -#ifdef USE_OUTLINEWIDTHMULTIPLYTEXTURE - uniform sampler2D outlineWidthMultiplyTexture; - uniform mat3 outlineWidthMultiplyTextureUvTransform; -#endif - -uniform float outlineWidthFactor; - -void main() { - - // #include - #ifdef MTOON_USE_UV - // COMPAT: pre-r151 uses a common uvTransform - #if THREE_VRM_THREE_REVISION >= 151 - vUv = uv; - #else - vUv = ( uvTransform * vec3( uv, 1 ) ).xy; - #endif - #endif - - // #include - // COMAPT: pre-r151 uses uv2 for lightMap and aoMap - #if THREE_VRM_THREE_REVISION < 151 - #if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) - vUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy; - #endif - #endif - - #include - - #include - #include - #include - #include - - // we need this to compute the outline properly - objectNormal = normalize( objectNormal ); - - #include - - #ifndef FLAT_SHADED // Normal computed with derivatives when FLAT_SHADED - vNormal = normalize( transformedNormal ); - #endif - - #include - - #include - #include - // #include - #include - #include - #include - - vViewPosition = - mvPosition.xyz; - - #ifdef OUTLINE - float worldNormalLength = length( transformedNormal ); - vec3 outlineOffset = outlineWidthFactor * worldNormalLength * objectNormal; - - #ifdef USE_OUTLINEWIDTHMULTIPLYTEXTURE - vec2 outlineWidthMultiplyTextureUv = ( outlineWidthMultiplyTextureUvTransform * vec3( vUv, 1 ) ).xy; - float outlineTex = texture2D( outlineWidthMultiplyTexture, outlineWidthMultiplyTextureUv ).g; - outlineOffset *= outlineTex; - #endif - - #ifdef OUTLINE_WIDTH_SCREEN - outlineOffset *= vViewPosition.z / projectionMatrix[ 1 ].y; - #endif - - gl_Position = projectionMatrix * modelViewMatrix * vec4( outlineOffset + transformed, 1.0 ); - - gl_Position.z += 1E-6 * gl_Position.w; // anti-artifact magic - #endif - - #include - // #include - #include - #include - -}`,Dr=`// #define PHONG - -uniform vec3 litFactor; - -uniform float opacity; - -uniform vec3 shadeColorFactor; -#ifdef USE_SHADEMULTIPLYTEXTURE - uniform sampler2D shadeMultiplyTexture; - uniform mat3 shadeMultiplyTextureUvTransform; -#endif - -uniform float shadingShiftFactor; -uniform float shadingToonyFactor; - -#ifdef USE_SHADINGSHIFTTEXTURE - uniform sampler2D shadingShiftTexture; - uniform mat3 shadingShiftTextureUvTransform; - uniform float shadingShiftTextureScale; -#endif - -uniform float giEqualizationFactor; - -uniform vec3 parametricRimColorFactor; -#ifdef USE_RIMMULTIPLYTEXTURE - uniform sampler2D rimMultiplyTexture; - uniform mat3 rimMultiplyTextureUvTransform; -#endif -uniform float rimLightingMixFactor; -uniform float parametricRimFresnelPowerFactor; -uniform float parametricRimLiftFactor; - -#ifdef USE_MATCAPTEXTURE - uniform vec3 matcapFactor; - uniform sampler2D matcapTexture; - uniform mat3 matcapTextureUvTransform; -#endif - -uniform vec3 emissive; -uniform float emissiveIntensity; - -uniform vec3 outlineColorFactor; -uniform float outlineLightingMixFactor; - -#ifdef USE_UVANIMATIONMASKTEXTURE - uniform sampler2D uvAnimationMaskTexture; - uniform mat3 uvAnimationMaskTextureUvTransform; -#endif - -uniform float uvAnimationScrollXOffset; -uniform float uvAnimationScrollYOffset; -uniform float uvAnimationRotationPhase; - -#include -#include -#include -#include - -// #include -#if ( defined( MTOON_USE_UV ) && !defined( MTOON_UVS_VERTEX_ONLY ) ) - varying vec2 vUv; -#endif - -// #include -// COMAPT: pre-r151 uses uv2 for lightMap and aoMap -#if THREE_VRM_THREE_REVISION < 151 - #if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) - varying vec2 vUv2; - #endif -#endif - -#include - -#ifdef USE_MAP - uniform mat3 mapUvTransform; -#endif - -// #include - -#include - -#include -// #include -#include - -#ifdef USE_EMISSIVEMAP - uniform mat3 emissiveMapUvTransform; -#endif - -// #include -// #include -// #include -#include - -// #include -// COMPAT: pre-r151 doesn't have BRDF_Lambert in -#if THREE_VRM_THREE_REVISION < 151 - vec3 BRDF_Lambert( const in vec3 diffuseColor ) { - return RECIPROCAL_PI * diffuseColor; - } -#endif - -#include - -#include - -// #include -varying vec3 vViewPosition; - -struct MToonMaterial { - vec3 diffuseColor; - vec3 shadeColor; - float shadingShift; -}; - -float linearstep( float a, float b, float t ) { - return clamp( ( t - a ) / ( b - a ), 0.0, 1.0 ); -} - -/** - * Convert NdotL into toon shading factor using shadingShift and shadingToony - */ -float getShading( - const in float dotNL, - const in float shadow, - const in float shadingShift -) { - float shading = dotNL; - shading = shading + shadingShift; - shading = linearstep( -1.0 + shadingToonyFactor, 1.0 - shadingToonyFactor, shading ); - shading *= shadow; - return shading; -} - -/** - * Mix diffuseColor and shadeColor using shading factor and light color - */ -vec3 getDiffuse( - const in MToonMaterial material, - const in float shading, - in vec3 lightColor -) { - #ifdef DEBUG_LITSHADERATE - return vec3( BRDF_Lambert( shading * lightColor ) ); - #endif - - vec3 col = lightColor * BRDF_Lambert( mix( material.shadeColor, material.diffuseColor, shading ) ); - - // The "comment out if you want to PBR absolutely" line - #ifdef V0_COMPAT_SHADE - col = min( col, material.diffuseColor ); - #endif - - return col; -} - -// COMPAT: pre-r156 uses a struct GeometricContext -#if THREE_VRM_THREE_REVISION >= 157 - void RE_Direct_MToon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in MToonMaterial material, const in float shadow, inout ReflectedLight reflectedLight ) { - float dotNL = clamp( dot( geometryNormal, directLight.direction ), -1.0, 1.0 ); - vec3 irradiance = directLight.color; - - // directSpecular will be used for rim lighting, not an actual specular - reflectedLight.directSpecular += irradiance; - - irradiance *= dotNL; - - float shading = getShading( dotNL, shadow, material.shadingShift ); - - // toon shaded diffuse - reflectedLight.directDiffuse += getDiffuse( material, shading, directLight.color ); - } - - void RE_IndirectDiffuse_MToon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in MToonMaterial material, inout ReflectedLight reflectedLight ) { - // indirect diffuse will use diffuseColor, no shadeColor involved - reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); - - // directSpecular will be used for rim lighting, not an actual specular - reflectedLight.directSpecular += irradiance; - } -#else - void RE_Direct_MToon( const in IncidentLight directLight, const in GeometricContext geometry, const in MToonMaterial material, const in float shadow, inout ReflectedLight reflectedLight ) { - float dotNL = clamp( dot( geometry.normal, directLight.direction ), -1.0, 1.0 ); - vec3 irradiance = directLight.color; - - // directSpecular will be used for rim lighting, not an actual specular - reflectedLight.directSpecular += irradiance; - - irradiance *= dotNL; - - float shading = getShading( dotNL, shadow, material.shadingShift ); - - // toon shaded diffuse - reflectedLight.directDiffuse += getDiffuse( material, shading, directLight.color ); - } - - void RE_IndirectDiffuse_MToon( const in vec3 irradiance, const in GeometricContext geometry, const in MToonMaterial material, inout ReflectedLight reflectedLight ) { - // indirect diffuse will use diffuseColor, no shadeColor involved - reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); - - // directSpecular will be used for rim lighting, not an actual specular - reflectedLight.directSpecular += irradiance; - } -#endif - -#define RE_Direct RE_Direct_MToon -#define RE_IndirectDiffuse RE_IndirectDiffuse_MToon -#define Material_LightProbeLOD( material ) (0) - -#include -// #include - -// #include -#ifdef USE_NORMALMAP - - uniform sampler2D normalMap; - uniform mat3 normalMapUvTransform; - uniform vec2 normalScale; - -#endif - -// COMPAT: pre-r151 -// USE_NORMALMAP_OBJECTSPACE used to be OBJECTSPACE_NORMALMAP in pre-r151 -#if defined( USE_NORMALMAP_OBJECTSPACE ) || defined( OBJECTSPACE_NORMALMAP ) - - uniform mat3 normalMatrix; - -#endif - -// COMPAT: pre-r151 -// USE_NORMALMAP_TANGENTSPACE used to be TANGENTSPACE_NORMALMAP in pre-r151 -#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( TANGENTSPACE_NORMALMAP ) ) - - // Per-Pixel Tangent Space Normal Mapping - // http://hacksoflife.blogspot.ch/2009/11/per-pixel-tangent-space-normal-mapping.html - - // three-vrm specific change: it requires \`uv\` as an input in order to support uv scrolls - - // Temporary compat against shader change @ Three.js r126, r151 - #if THREE_VRM_THREE_REVISION >= 151 - - 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 ); - - } - - #else - - vec3 perturbNormal2Arb( vec2 uv, vec3 eye_pos, vec3 surf_norm, vec3 mapN, float faceDirection ) { - - vec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) ); - vec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) ); - vec2 st0 = dFdx( uv.st ); - vec2 st1 = dFdy( uv.st ); - - vec3 N = normalize( 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; - - // three-vrm specific change: Workaround for the issue that happens when delta of uv = 0.0 - // TODO: Is this still required? Or shall I make a PR about it? - if ( length( T ) == 0.0 || length( B ) == 0.0 ) { - return surf_norm; - } - - float det = max( dot( T, T ), dot( B, B ) ); - float scale = ( det == 0.0 ) ? 0.0 : faceDirection * inversesqrt( det ); - - return normalize( T * ( mapN.x * scale ) + B * ( mapN.y * scale ) + N * mapN.z ); - - } - - #endif - -#endif - -// #include -#include -#include - -// == post correction ========================================================== -void postCorrection() { - #include - #include - #include - #include - #include -} - -// == main procedure =========================================================== -void main() { - #include - - vec2 uv = vec2(0.5, 0.5); - - #if ( defined( MTOON_USE_UV ) && !defined( MTOON_UVS_VERTEX_ONLY ) ) - uv = vUv; - - float uvAnimMask = 1.0; - #ifdef USE_UVANIMATIONMASKTEXTURE - vec2 uvAnimationMaskTextureUv = ( uvAnimationMaskTextureUvTransform * vec3( uv, 1 ) ).xy; - uvAnimMask = texture2D( uvAnimationMaskTexture, uvAnimationMaskTextureUv ).b; - #endif - - float uvRotCos = cos( uvAnimationRotationPhase * uvAnimMask ); - float uvRotSin = sin( uvAnimationRotationPhase * uvAnimMask ); - uv = mat2( uvRotCos, -uvRotSin, uvRotSin, uvRotCos ) * ( uv - 0.5 ) + 0.5; - uv = uv + vec2( uvAnimationScrollXOffset, uvAnimationScrollYOffset ) * uvAnimMask; - #endif - - #ifdef DEBUG_UV - gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); - #if ( defined( MTOON_USE_UV ) && !defined( MTOON_UVS_VERTEX_ONLY ) ) - gl_FragColor = vec4( uv, 0.0, 1.0 ); - #endif - return; - #endif - - vec4 diffuseColor = vec4( litFactor, opacity ); - ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); - vec3 totalEmissiveRadiance = emissive * emissiveIntensity; - - #include - - // #include - #ifdef USE_MAP - vec2 mapUv = ( mapUvTransform * vec3( uv, 1 ) ).xy; - vec4 sampledDiffuseColor = texture2D( map, mapUv ); - #ifdef DECODE_VIDEO_TEXTURE - sampledDiffuseColor = vec4( mix( pow( sampledDiffuseColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), sampledDiffuseColor.rgb * 0.0773993808, vec3( lessThanEqual( sampledDiffuseColor.rgb, vec3( 0.04045 ) ) ) ), sampledDiffuseColor.w ); - #endif - diffuseColor *= sampledDiffuseColor; - #endif - - // #include - #if ( defined( USE_COLOR ) && !defined( IGNORE_VERTEX_COLOR ) ) - diffuseColor.rgb *= vColor; - #endif - - // #include - - #include - - // #include - - // #include - 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 - - #ifdef USE_NORMALMAP - - vec2 normalMapUv = ( normalMapUvTransform * vec3( uv, 1 ) ).xy; - - #endif - - #ifdef USE_NORMALMAP_TANGENTSPACE - - #ifdef USE_TANGENT - - mat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); - - #else - - mat3 tbn = getTangentFrame( - vViewPosition, normal, normalMapUv ); - - #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 - - // non perturbed normal for clearcoat among others - - vec3 nonPerturbedNormal = normal; - - #ifdef OUTLINE - normal *= -1.0; - #endif - - // #include - - // COMPAT: pre-r151 - // USE_NORMALMAP_OBJECTSPACE used to be OBJECTSPACE_NORMALMAP in pre-r151 - #if defined( USE_NORMALMAP_OBJECTSPACE ) || defined( OBJECTSPACE_NORMALMAP ) - - normal = texture2D( normalMap, normalMapUv ).xyz * 2.0 - 1.0; // overrides both flatShading and attribute normals - - #ifdef FLIP_SIDED - - normal = - normal; - - #endif - - #ifdef DOUBLE_SIDED - - normal = normal * faceDirection; - - #endif - - normal = normalize( normalMatrix * normal ); - - // COMPAT: pre-r151 - // USE_NORMALMAP_TANGENTSPACE used to be TANGENTSPACE_NORMALMAP in pre-r151 - #elif defined( USE_NORMALMAP_TANGENTSPACE ) || defined( TANGENTSPACE_NORMALMAP ) - - vec3 mapN = texture2D( normalMap, normalMapUv ).xyz * 2.0 - 1.0; - mapN.xy *= normalScale; - - // COMPAT: pre-r151 - #if THREE_VRM_THREE_REVISION >= 151 || defined( USE_TANGENT ) - - normal = normalize( tbn * mapN ); - - #else - - normal = perturbNormal2Arb( uv, -vViewPosition, normal, mapN, faceDirection ); - - #endif - - #endif - - // #include - #ifdef USE_EMISSIVEMAP - vec2 emissiveMapUv = ( emissiveMapUvTransform * vec3( uv, 1 ) ).xy; - totalEmissiveRadiance *= texture2D( emissiveMap, emissiveMapUv ).rgb; - #endif - - #ifdef DEBUG_NORMAL - gl_FragColor = vec4( 0.5 + 0.5 * normal, 1.0 ); - return; - #endif - - // -- MToon: lighting -------------------------------------------------------- - // accumulation - // #include - MToonMaterial material; - - material.diffuseColor = diffuseColor.rgb; - - material.shadeColor = shadeColorFactor; - #ifdef USE_SHADEMULTIPLYTEXTURE - vec2 shadeMultiplyTextureUv = ( shadeMultiplyTextureUvTransform * vec3( uv, 1 ) ).xy; - material.shadeColor *= texture2D( shadeMultiplyTexture, shadeMultiplyTextureUv ).rgb; - #endif - - #if ( defined( USE_COLOR ) && !defined( IGNORE_VERTEX_COLOR ) ) - material.shadeColor.rgb *= vColor; - #endif - - material.shadingShift = shadingShiftFactor; - #ifdef USE_SHADINGSHIFTTEXTURE - vec2 shadingShiftTextureUv = ( shadingShiftTextureUvTransform * vec3( uv, 1 ) ).xy; - material.shadingShift += texture2D( shadingShiftTexture, shadingShiftTextureUv ).r * shadingShiftTextureScale; - #endif - - // #include - - // MToon Specific changes: - // Since we want to take shadows into account of shading instead of irradiance, - // we had to modify the codes that multiplies the results of shadowmap into color of direct lights. - - // COMPAT: pre-r156 uses a struct GeometricContext - #if THREE_VRM_THREE_REVISION >= 157 - vec3 geometryPosition = - vViewPosition; - vec3 geometryNormal = normal; - vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition ); - - vec3 geometryClearcoatNormal; - - #ifdef USE_CLEARCOAT - - geometryClearcoatNormal = clearcoatNormal; - - #endif - #else - GeometricContext geometry; - - geometry.position = - vViewPosition; - geometry.normal = normal; - geometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition ); - - #ifdef USE_CLEARCOAT - - geometry.clearcoatNormal = clearcoatNormal; - - #endif - #endif - - IncidentLight directLight; - - // since these variables will be used in unrolled loop, we have to define in prior - float shadow; - - #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 ]; - - // COMPAT: pre-r156 uses a struct GeometricContext - #if THREE_VRM_THREE_REVISION >= 157 - getPointLightInfo( pointLight, geometryPosition, directLight ); - #else - getPointLightInfo( pointLight, geometry, directLight ); - #endif - - shadow = 1.0; - #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS ) - pointLightShadow = pointLightShadows[ i ]; - // COMPAT: pre-r166 - // r166 introduced shadowIntensity - #if THREE_VRM_THREE_REVISION >= 166 - shadow = all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowIntensity, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0; - #else - shadow = all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0; - #endif - #endif - - // COMPAT: pre-r156 uses a struct GeometricContext - #if THREE_VRM_THREE_REVISION >= 157 - RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, shadow, reflectedLight ); - #else - RE_Direct( directLight, geometry, material, shadow, reflectedLight ); - #endif - - } - #pragma unroll_loop_end - - #endif - - #if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct ) - - SpotLight spotLight; - #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 ]; - - // COMPAT: pre-r156 uses a struct GeometricContext - #if THREE_VRM_THREE_REVISION >= 157 - getSpotLightInfo( spotLight, geometryPosition, directLight ); - #else - getSpotLightInfo( spotLight, geometry, directLight ); - #endif - - shadow = 1.0; - #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) - spotLightShadow = spotLightShadows[ i ]; - // COMPAT: pre-r166 - // r166 introduced shadowIntensity - #if THREE_VRM_THREE_REVISION >= 166 - shadow = all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowIntensity, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0; - #else - shadow = all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0; - #endif - #endif - - // COMPAT: pre-r156 uses a struct GeometricContext - #if THREE_VRM_THREE_REVISION >= 157 - RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, shadow, reflectedLight ); - #else - RE_Direct( directLight, geometry, material, shadow, reflectedLight ); - #endif - - } - #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 ]; - - // COMPAT: pre-r156 uses a struct GeometricContext - #if THREE_VRM_THREE_REVISION >= 157 - getDirectionalLightInfo( directionalLight, directLight ); - #else - getDirectionalLightInfo( directionalLight, geometry, directLight ); - #endif - - shadow = 1.0; - #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS ) - directionalLightShadow = directionalLightShadows[ i ]; - // COMPAT: pre-r166 - // r166 introduced shadowIntensity - #if THREE_VRM_THREE_REVISION >= 166 - shadow = all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; - #else - shadow = all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; - #endif - #endif - - // COMPAT: pre-r156 uses a struct GeometricContext - #if THREE_VRM_THREE_REVISION >= 157 - RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, shadow, reflectedLight ); - #else - RE_Direct( directLight, geometry, material, shadow, reflectedLight ); - #endif - - } - #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, geometry, material, reflectedLight ); - - // } - // #pragma unroll_loop_end - - // #endif - - #if defined( RE_IndirectDiffuse ) - - vec3 iblIrradiance = vec3( 0.0 ); - - vec3 irradiance = getAmbientLightIrradiance( ambientLightColor ); - - // COMPAT: pre-r156 uses a struct GeometricContext - // COMPAT: pre-r156 doesn't have a define USE_LIGHT_PROBES - #if THREE_VRM_THREE_REVISION >= 157 - #if defined( USE_LIGHT_PROBES ) - irradiance += getLightProbeIrradiance( lightProbe, geometryNormal ); - #endif - #else - irradiance += getLightProbeIrradiance( lightProbe, geometry.normal ); - #endif - - #if ( NUM_HEMI_LIGHTS > 0 ) - - #pragma unroll_loop_start - for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { - - // COMPAT: pre-r156 uses a struct GeometricContext - #if THREE_VRM_THREE_REVISION >= 157 - irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal ); - #else - irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry.normal ); - #endif - - } - #pragma unroll_loop_end - - #endif - - #endif - - // #if defined( RE_IndirectSpecular ) - - // vec3 radiance = vec3( 0.0 ); - // vec3 clearcoatRadiance = vec3( 0.0 ); - - // #endif - - #include - #include - - // modulation - #include - - vec3 col = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse; - - #ifdef DEBUG_LITSHADERATE - gl_FragColor = vec4( col, diffuseColor.a ); - postCorrection(); - return; - #endif - - // -- MToon: rim lighting ----------------------------------------- - vec3 viewDir = normalize( vViewPosition ); - - #ifndef PHYSICALLY_CORRECT_LIGHTS - reflectedLight.directSpecular /= PI; - #endif - vec3 rimMix = mix( vec3( 1.0 ), reflectedLight.directSpecular, 1.0 ); - - vec3 rim = parametricRimColorFactor * pow( saturate( 1.0 - dot( viewDir, normal ) + parametricRimLiftFactor ), parametricRimFresnelPowerFactor ); - - #ifdef USE_MATCAPTEXTURE - { - vec3 x = normalize( vec3( viewDir.z, 0.0, -viewDir.x ) ); - vec3 y = cross( viewDir, x ); // guaranteed to be normalized - vec2 sphereUv = 0.5 + 0.5 * vec2( dot( x, normal ), -dot( y, normal ) ); - sphereUv = ( matcapTextureUvTransform * vec3( sphereUv, 1 ) ).xy; - vec3 matcap = texture2D( matcapTexture, sphereUv ).rgb; - rim += matcapFactor * matcap; - } - #endif - - #ifdef USE_RIMMULTIPLYTEXTURE - vec2 rimMultiplyTextureUv = ( rimMultiplyTextureUvTransform * vec3( uv, 1 ) ).xy; - rim *= texture2D( rimMultiplyTexture, rimMultiplyTextureUv ).rgb; - #endif - - col += rimMix * rim; - - // -- MToon: Emission -------------------------------------------------------- - col += totalEmissiveRadiance; - - // #include - - // -- Almost done! ----------------------------------------------------------- - #if defined( OUTLINE ) - col = outlineColorFactor.rgb * mix( vec3( 1.0 ), col, outlineLightingMixFactor ); - #endif - - #ifdef OPAQUE - diffuseColor.a = 1.0; - #endif - - gl_FragColor = vec4( col, diffuseColor.a ); - postCorrection(); -} -`,Br={None:"none"},Mn={None:"none",ScreenCoordinates:"screenCoordinates"},kr={3e3:"",3001:"srgb"};function He(e){return parseInt(Ie,10)>=152?e.colorSpace:kr[e.encoding]}var Fr=class extends Hi{constructor(e={}){var t;super({vertexShader:Nr,fragmentShader:Dr}),this.uvAnimationScrollXSpeedFactor=0,this.uvAnimationScrollYSpeedFactor=0,this.uvAnimationRotationSpeedFactor=0,this.fog=!0,this.normalMapType=Wi,this._ignoreVertexColor=!0,this._v0CompatShade=!1,this._debugMode=Br.None,this._outlineWidthMode=Mn.None,this._isOutline=!1,e.transparentWithZWrite&&(e.depthWrite=!0),delete e.transparentWithZWrite,e.fog=!0,e.lights=!0,e.clipping=!0,this.uniforms=zi.merge([ce.common,ce.normalmap,ce.emissivemap,ce.fog,ce.lights,{litFactor:{value:new N(1,1,1)},mapUvTransform:{value:new z},colorAlpha:{value:1},normalMapUvTransform:{value:new z},shadeColorFactor:{value:new N(0,0,0)},shadeMultiplyTexture:{value:null},shadeMultiplyTextureUvTransform:{value:new z},shadingShiftFactor:{value:0},shadingShiftTexture:{value:null},shadingShiftTextureUvTransform:{value:new z},shadingShiftTextureScale:{value:1},shadingToonyFactor:{value:.9},giEqualizationFactor:{value:.9},matcapFactor:{value:new N(1,1,1)},matcapTexture:{value:null},matcapTextureUvTransform:{value:new z},parametricRimColorFactor:{value:new N(0,0,0)},rimMultiplyTexture:{value:null},rimMultiplyTextureUvTransform:{value:new z},rimLightingMixFactor:{value:1},parametricRimFresnelPowerFactor:{value:5},parametricRimLiftFactor:{value:0},emissive:{value:new N(0,0,0)},emissiveIntensity:{value:1},emissiveMapUvTransform:{value:new z},outlineWidthMultiplyTexture:{value:null},outlineWidthMultiplyTextureUvTransform:{value:new z},outlineWidthFactor:{value:0},outlineColorFactor:{value:new N(0,0,0)},outlineLightingMixFactor:{value:1},uvAnimationMaskTexture:{value:null},uvAnimationMaskTextureUvTransform:{value:new z},uvAnimationScrollXOffset:{value:0},uvAnimationScrollYOffset:{value:0},uvAnimationRotationPhase:{value:0}},(t=e.uniforms)!=null?t:{}]),this.setValues(e),this._uploadUniformsWorkaround(),this.customProgramCacheKey=()=>[...Object.entries(this._generateDefines()).map(([n,i])=>`${n}:${i}`),this.matcapTexture?`matcapTextureColorSpace:${He(this.matcapTexture)}`:"",this.shadeMultiplyTexture?`shadeMultiplyTextureColorSpace:${He(this.shadeMultiplyTexture)}`:"",this.rimMultiplyTexture?`rimMultiplyTextureColorSpace:${He(this.rimMultiplyTexture)}`:""].join(","),this.onBeforeCompile=n=>{const i=parseInt(Ie,10),r=Object.entries(vn(vn({},this._generateDefines()),this.defines)).filter(([o,a])=>!!a).map(([o,a])=>`#define ${o} ${a}`).join(` -`)+` -`;n.vertexShader=r+n.vertexShader,n.fragmentShader=r+n.fragmentShader,i<154&&(n.fragmentShader=n.fragmentShader.replace("#include ","#include "))}}get color(){return this.uniforms.litFactor.value}set color(e){this.uniforms.litFactor.value=e}get map(){return this.uniforms.map.value}set map(e){this.uniforms.map.value=e}get normalMap(){return this.uniforms.normalMap.value}set normalMap(e){this.uniforms.normalMap.value=e}get normalScale(){return this.uniforms.normalScale.value}set normalScale(e){this.uniforms.normalScale.value=e}get emissive(){return this.uniforms.emissive.value}set emissive(e){this.uniforms.emissive.value=e}get emissiveIntensity(){return this.uniforms.emissiveIntensity.value}set emissiveIntensity(e){this.uniforms.emissiveIntensity.value=e}get emissiveMap(){return this.uniforms.emissiveMap.value}set emissiveMap(e){this.uniforms.emissiveMap.value=e}get shadeColorFactor(){return this.uniforms.shadeColorFactor.value}set shadeColorFactor(e){this.uniforms.shadeColorFactor.value=e}get shadeMultiplyTexture(){return this.uniforms.shadeMultiplyTexture.value}set shadeMultiplyTexture(e){this.uniforms.shadeMultiplyTexture.value=e}get shadingShiftFactor(){return this.uniforms.shadingShiftFactor.value}set shadingShiftFactor(e){this.uniforms.shadingShiftFactor.value=e}get shadingShiftTexture(){return this.uniforms.shadingShiftTexture.value}set shadingShiftTexture(e){this.uniforms.shadingShiftTexture.value=e}get shadingShiftTextureScale(){return this.uniforms.shadingShiftTextureScale.value}set shadingShiftTextureScale(e){this.uniforms.shadingShiftTextureScale.value=e}get shadingToonyFactor(){return this.uniforms.shadingToonyFactor.value}set shadingToonyFactor(e){this.uniforms.shadingToonyFactor.value=e}get giEqualizationFactor(){return this.uniforms.giEqualizationFactor.value}set giEqualizationFactor(e){this.uniforms.giEqualizationFactor.value=e}get matcapFactor(){return this.uniforms.matcapFactor.value}set matcapFactor(e){this.uniforms.matcapFactor.value=e}get matcapTexture(){return this.uniforms.matcapTexture.value}set matcapTexture(e){this.uniforms.matcapTexture.value=e}get parametricRimColorFactor(){return this.uniforms.parametricRimColorFactor.value}set parametricRimColorFactor(e){this.uniforms.parametricRimColorFactor.value=e}get rimMultiplyTexture(){return this.uniforms.rimMultiplyTexture.value}set rimMultiplyTexture(e){this.uniforms.rimMultiplyTexture.value=e}get rimLightingMixFactor(){return this.uniforms.rimLightingMixFactor.value}set rimLightingMixFactor(e){this.uniforms.rimLightingMixFactor.value=e}get parametricRimFresnelPowerFactor(){return this.uniforms.parametricRimFresnelPowerFactor.value}set parametricRimFresnelPowerFactor(e){this.uniforms.parametricRimFresnelPowerFactor.value=e}get parametricRimLiftFactor(){return this.uniforms.parametricRimLiftFactor.value}set parametricRimLiftFactor(e){this.uniforms.parametricRimLiftFactor.value=e}get outlineWidthMultiplyTexture(){return this.uniforms.outlineWidthMultiplyTexture.value}set outlineWidthMultiplyTexture(e){this.uniforms.outlineWidthMultiplyTexture.value=e}get outlineWidthFactor(){return this.uniforms.outlineWidthFactor.value}set outlineWidthFactor(e){this.uniforms.outlineWidthFactor.value=e}get outlineColorFactor(){return this.uniforms.outlineColorFactor.value}set outlineColorFactor(e){this.uniforms.outlineColorFactor.value=e}get outlineLightingMixFactor(){return this.uniforms.outlineLightingMixFactor.value}set outlineLightingMixFactor(e){this.uniforms.outlineLightingMixFactor.value=e}get uvAnimationMaskTexture(){return this.uniforms.uvAnimationMaskTexture.value}set uvAnimationMaskTexture(e){this.uniforms.uvAnimationMaskTexture.value=e}get uvAnimationScrollXOffset(){return this.uniforms.uvAnimationScrollXOffset.value}set uvAnimationScrollXOffset(e){this.uniforms.uvAnimationScrollXOffset.value=e}get uvAnimationScrollYOffset(){return this.uniforms.uvAnimationScrollYOffset.value}set uvAnimationScrollYOffset(e){this.uniforms.uvAnimationScrollYOffset.value=e}get uvAnimationRotationPhase(){return this.uniforms.uvAnimationRotationPhase.value}set uvAnimationRotationPhase(e){this.uniforms.uvAnimationRotationPhase.value=e}get ignoreVertexColor(){return this._ignoreVertexColor}set ignoreVertexColor(e){this._ignoreVertexColor=e,this.needsUpdate=!0}get v0CompatShade(){return this._v0CompatShade}set v0CompatShade(e){this._v0CompatShade=e,this.needsUpdate=!0}get debugMode(){return this._debugMode}set debugMode(e){this._debugMode=e,this.needsUpdate=!0}get outlineWidthMode(){return this._outlineWidthMode}set outlineWidthMode(e){this._outlineWidthMode=e,this.needsUpdate=!0}get isOutline(){return this._isOutline}set isOutline(e){this._isOutline=e,this.needsUpdate=!0}get isMToonMaterial(){return!0}update(e){this._uploadUniformsWorkaround(),this._updateUVAnimation(e)}copy(e){return super.copy(e),this.map=e.map,this.normalMap=e.normalMap,this.emissiveMap=e.emissiveMap,this.shadeMultiplyTexture=e.shadeMultiplyTexture,this.shadingShiftTexture=e.shadingShiftTexture,this.matcapTexture=e.matcapTexture,this.rimMultiplyTexture=e.rimMultiplyTexture,this.outlineWidthMultiplyTexture=e.outlineWidthMultiplyTexture,this.uvAnimationMaskTexture=e.uvAnimationMaskTexture,this.normalMapType=e.normalMapType,this.uvAnimationScrollXSpeedFactor=e.uvAnimationScrollXSpeedFactor,this.uvAnimationScrollYSpeedFactor=e.uvAnimationScrollYSpeedFactor,this.uvAnimationRotationSpeedFactor=e.uvAnimationRotationSpeedFactor,this.ignoreVertexColor=e.ignoreVertexColor,this.v0CompatShade=e.v0CompatShade,this.debugMode=e.debugMode,this.outlineWidthMode=e.outlineWidthMode,this.isOutline=e.isOutline,this.needsUpdate=!0,this}_updateUVAnimation(e){this.uniforms.uvAnimationScrollXOffset.value+=e*this.uvAnimationScrollXSpeedFactor,this.uniforms.uvAnimationScrollYOffset.value+=e*this.uvAnimationScrollYSpeedFactor,this.uniforms.uvAnimationRotationPhase.value+=e*this.uvAnimationRotationSpeedFactor,this.uniforms.alphaTest.value=this.alphaTest,this.uniformsNeedUpdate=!0}_uploadUniformsWorkaround(){this.uniforms.opacity.value=this.opacity,this._updateTextureMatrix(this.uniforms.map,this.uniforms.mapUvTransform),this._updateTextureMatrix(this.uniforms.normalMap,this.uniforms.normalMapUvTransform),this._updateTextureMatrix(this.uniforms.emissiveMap,this.uniforms.emissiveMapUvTransform),this._updateTextureMatrix(this.uniforms.shadeMultiplyTexture,this.uniforms.shadeMultiplyTextureUvTransform),this._updateTextureMatrix(this.uniforms.shadingShiftTexture,this.uniforms.shadingShiftTextureUvTransform),this._updateTextureMatrix(this.uniforms.matcapTexture,this.uniforms.matcapTextureUvTransform),this._updateTextureMatrix(this.uniforms.rimMultiplyTexture,this.uniforms.rimMultiplyTextureUvTransform),this._updateTextureMatrix(this.uniforms.outlineWidthMultiplyTexture,this.uniforms.outlineWidthMultiplyTextureUvTransform),this._updateTextureMatrix(this.uniforms.uvAnimationMaskTexture,this.uniforms.uvAnimationMaskTextureUvTransform),this.uniformsNeedUpdate=!0}_generateDefines(){const e=parseInt(Ie,10),t=this.outlineWidthMultiplyTexture!==null,n=this.map!==null||this.normalMap!==null||this.emissiveMap!==null||this.shadeMultiplyTexture!==null||this.shadingShiftTexture!==null||this.rimMultiplyTexture!==null||this.uvAnimationMaskTexture!==null;return{THREE_VRM_THREE_REVISION:e,OUTLINE:this._isOutline,MTOON_USE_UV:t||n,MTOON_UVS_VERTEX_ONLY:t&&!n,V0_COMPAT_SHADE:this._v0CompatShade,USE_SHADEMULTIPLYTEXTURE:this.shadeMultiplyTexture!==null,USE_SHADINGSHIFTTEXTURE:this.shadingShiftTexture!==null,USE_MATCAPTEXTURE:this.matcapTexture!==null,USE_RIMMULTIPLYTEXTURE:this.rimMultiplyTexture!==null,USE_OUTLINEWIDTHMULTIPLYTEXTURE:this._isOutline&&this.outlineWidthMultiplyTexture!==null,USE_UVANIMATIONMASKTEXTURE:this.uvAnimationMaskTexture!==null,IGNORE_VERTEX_COLOR:this._ignoreVertexColor===!0,DEBUG_NORMAL:this._debugMode==="normal",DEBUG_LITSHADERATE:this._debugMode==="litShadeRate",DEBUG_UV:this._debugMode==="uv",OUTLINE_WIDTH_SCREEN:this._isOutline&&this._outlineWidthMode===Mn.ScreenCoordinates}}_updateTextureMatrix(e,t){e.value&&(e.value.matrixAutoUpdate&&e.value.updateMatrix(),t.value.copy(e.value.matrix))}},Hr=new Set(["1.0","1.0-beta"]),Kn=class be{get name(){return be.EXTENSION_NAME}constructor(t,n={}){var i,r,o,a;this.parser=t,this.materialType=(i=n.materialType)!=null?i:Fr,this.renderOrderOffset=(r=n.renderOrderOffset)!=null?r:0,this.v0CompatShade=(o=n.v0CompatShade)!=null?o:!1,this.debugMode=(a=n.debugMode)!=null?a:"none",this._mToonMaterialSet=new Set}beforeRoot(){return K(this,null,function*(){this._removeUnlitExtensionIfMToonExists()})}afterRoot(t){return K(this,null,function*(){t.userData.vrmMToonMaterials=Array.from(this._mToonMaterialSet)})}getMaterialType(t){return this._getMToonExtension(t)?this.materialType:null}extendMaterialParams(t,n){const i=this._getMToonExtension(t);return i?this._extendMaterialParams(i,n):null}loadMesh(t){return K(this,null,function*(){var n;const i=this.parser,o=(n=i.json.meshes)==null?void 0:n[t];if(o==null)throw new Error(`MToonMaterialLoaderPlugin: Attempt to use meshes[${t}] of glTF but the mesh doesn't exist`);const a=o.primitives,l=yield i.loadMesh(t);if(a.length===1){const s=l,u=a[0].material;u!=null&&this._setupPrimitive(s,u)}else{const s=l;for(let u=0;u{var a;this._getMToonExtension(o)&&((a=r.extensions)!=null&&a.KHR_materials_unlit)&&delete r.extensions.KHR_materials_unlit})}_getMToonExtension(t){var n,i;const a=(n=this.parser.json.materials)==null?void 0:n[t];if(a==null){console.warn(`MToonMaterialLoaderPlugin: Attempt to use materials[${t}] of glTF but the material doesn't exist`);return}const l=(i=a.extensions)==null?void 0:i[be.EXTENSION_NAME];if(l==null)return;const s=l.specVersion;if(!Hr.has(s)){console.warn(`MToonMaterialLoaderPlugin: Unknown ${be.EXTENSION_NAME} specVersion "${s}"`);return}return l}_extendMaterialParams(t,n){return K(this,null,function*(){var i;delete n.metalness,delete n.roughness;const r=new Vr(this.parser,n);r.assignPrimitive("transparentWithZWrite",t.transparentWithZWrite),r.assignColor("shadeColorFactor",t.shadeColorFactor),r.assignTexture("shadeMultiplyTexture",t.shadeMultiplyTexture,!0),r.assignPrimitive("shadingShiftFactor",t.shadingShiftFactor),r.assignTexture("shadingShiftTexture",t.shadingShiftTexture,!0),r.assignPrimitive("shadingShiftTextureScale",(i=t.shadingShiftTexture)==null?void 0:i.scale),r.assignPrimitive("shadingToonyFactor",t.shadingToonyFactor),r.assignPrimitive("giEqualizationFactor",t.giEqualizationFactor),r.assignColor("matcapFactor",t.matcapFactor),r.assignTexture("matcapTexture",t.matcapTexture,!0),r.assignColor("parametricRimColorFactor",t.parametricRimColorFactor),r.assignTexture("rimMultiplyTexture",t.rimMultiplyTexture,!0),r.assignPrimitive("rimLightingMixFactor",t.rimLightingMixFactor),r.assignPrimitive("parametricRimFresnelPowerFactor",t.parametricRimFresnelPowerFactor),r.assignPrimitive("parametricRimLiftFactor",t.parametricRimLiftFactor),r.assignPrimitive("outlineWidthMode",t.outlineWidthMode),r.assignPrimitive("outlineWidthFactor",t.outlineWidthFactor),r.assignTexture("outlineWidthMultiplyTexture",t.outlineWidthMultiplyTexture,!1),r.assignColor("outlineColorFactor",t.outlineColorFactor),r.assignPrimitive("outlineLightingMixFactor",t.outlineLightingMixFactor),r.assignTexture("uvAnimationMaskTexture",t.uvAnimationMaskTexture,!1),r.assignPrimitive("uvAnimationScrollXSpeedFactor",t.uvAnimationScrollXSpeedFactor),r.assignPrimitive("uvAnimationScrollYSpeedFactor",t.uvAnimationScrollYSpeedFactor),r.assignPrimitive("uvAnimationRotationSpeedFactor",t.uvAnimationRotationSpeedFactor),r.assignPrimitive("v0CompatShade",this.v0CompatShade),r.assignPrimitive("debugMode",this.debugMode),yield r.pending})}_setupPrimitive(t,n){const i=this._getMToonExtension(n);if(i){const r=this._parseRenderOrder(i);t.renderOrder=r+this.renderOrderOffset,this._generateOutline(t),this._addToMaterialSet(t);return}}_shouldGenerateOutline(t){return typeof t.outlineWidthMode=="string"&&t.outlineWidthMode!=="none"&&typeof t.outlineWidthFactor=="number"&&t.outlineWidthFactor>0}_generateOutline(t){const n=t.material;if(!(n instanceof Bi)||!this._shouldGenerateOutline(n))return;t.material=[n];const i=n.clone();i.name+=" (Outline)",i.isOutline=!0,i.side=ki,t.material.push(i);const r=t.geometry,o=r.index?r.index.count:r.attributes.position.count/3;r.addGroup(0,o,0),r.addGroup(0,o,1)}_addToMaterialSet(t){const n=t.material,i=new Set;Array.isArray(n)?n.forEach(r=>i.add(r)):i.add(n);for(const r of i)this._mToonMaterialSet.add(r)}_parseRenderOrder(t){var n;return(t.transparentWithZWrite?0:19)+((n=t.renderQueueOffsetNumber)!=null?n:0)}};Kn.EXTENSION_NAME="VRMC_materials_mtoon";var Wr=Kn,zr=(e,t,n)=>new Promise((i,r)=>{var o=s=>{try{l(n.next(s))}catch(u){r(u)}},a=s=>{try{l(n.throw(s))}catch(u){r(u)}},l=s=>s.done?i(s.value):Promise.resolve(s.value).then(o,a);l((n=n.apply(e,t)).next())}),ei=class ot{get name(){return ot.EXTENSION_NAME}constructor(t){this.parser=t}extendMaterialParams(t,n){return zr(this,null,function*(){const i=this._getHDREmissiveMultiplierExtension(t);if(i==null)return;console.warn("VRMMaterialsHDREmissiveMultiplierLoaderPlugin: `VRMC_materials_hdr_emissiveMultiplier` is archived. Use `KHR_materials_emissive_strength` instead.");const r=i.emissiveMultiplier;n.emissiveIntensity=r})}_getHDREmissiveMultiplierExtension(t){var n,i;const a=(n=this.parser.json.materials)==null?void 0:n[t];if(a==null){console.warn(`VRMMaterialsHDREmissiveMultiplierLoaderPlugin: Attempt to use materials[${t}] of glTF but the material doesn't exist`);return}const l=(i=a.extensions)==null?void 0:i[ot.EXTENSION_NAME];if(l!=null)return l}};ei.EXTENSION_NAME="VRMC_materials_hdr_emissiveMultiplier";var jr=ei,Xr=Object.defineProperty,qr=Object.defineProperties,Yr=Object.getOwnPropertyDescriptors,xn=Object.getOwnPropertySymbols,Gr=Object.prototype.hasOwnProperty,Qr=Object.prototype.propertyIsEnumerable,yn=(e,t,n)=>t in e?Xr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,H=(e,t)=>{for(var n in t||(t={}))Gr.call(t,n)&&yn(e,n,t[n]);if(xn)for(var n of xn(t))Qr.call(t,n)&&yn(e,n,t[n]);return e},wn=(e,t)=>qr(e,Yr(t)),$r=(e,t,n)=>new Promise((i,r)=>{var o=s=>{try{l(n.next(s))}catch(u){r(u)}},a=s=>{try{l(n.throw(s))}catch(u){r(u)}},l=s=>s.done?i(s.value):Promise.resolve(s.value).then(o,a);l((n=n.apply(e,t)).next())});function ie(e){return Math.pow(e,2.2)}var Zr=class{get name(){return"VRMMaterialsV0CompatPlugin"}constructor(e){var t;this.parser=e,this._renderQueueMapTransparent=new Map,this._renderQueueMapTransparentZWrite=new Map;const n=this.parser.json;n.extensionsUsed=(t=n.extensionsUsed)!=null?t:[],n.extensionsUsed.indexOf("KHR_texture_transform")===-1&&n.extensionsUsed.push("KHR_texture_transform")}beforeRoot(){return $r(this,null,function*(){var e;const t=this.parser.json,n=(e=t.extensions)==null?void 0:e.VRM,i=n==null?void 0:n.materialProperties;i&&(this._populateRenderQueueMap(i),i.forEach((r,o)=>{var a,l;const s=(a=t.materials)==null?void 0:a[o];if(s==null){console.warn(`VRMMaterialsV0CompatPlugin: Attempt to use materials[${o}] of glTF but the material doesn't exist`);return}if(r.shader==="VRM/MToon"){const u=this._parseV0MToonProperties(r,s);t.materials[o]=u}else if((l=r.shader)!=null&&l.startsWith("VRM/Unlit")){const u=this._parseV0UnlitProperties(r,s);t.materials[o]=u}else r.shader==="VRM_USE_GLTFSHADER"||console.warn(`VRMMaterialsV0CompatPlugin: Unknown shader: ${r.shader}`)}))})}_parseV0MToonProperties(e,t){var n,i,r,o,a,l,s,u,h,d,c,p,m,f,g,v,y,E,M,x,w,R,S,L,b,P,I,D,B,de,q,k,te,he,O,ct,pt,mt,ft,_t,gt,vt,Mt,xt,yt,wt,Rt,Tt,Et,St,At,Pt,Lt,bt,It;const Ct=(i=(n=e.keywordMap)==null?void 0:n._ALPHABLEND_ON)!=null?i:!1,li=((r=e.floatProperties)==null?void 0:r._ZWrite)===1&&Ct,ui=this._v0ParseRenderQueue(e),Ut=(a=(o=e.keywordMap)==null?void 0:o._ALPHATEST_ON)!=null?a:!1,di=Ct?"BLEND":Ut?"MASK":"OPAQUE",hi=Ut?(s=(l=e.floatProperties)==null?void 0:l._Cutoff)!=null?s:.5:void 0,ci=((h=(u=e.floatProperties)==null?void 0:u._CullMode)!=null?h:2)===0,Q=this._portTextureTransform(e),pi=((c=(d=e.vectorProperties)==null?void 0:d._Color)!=null?c:[1,1,1,1]).map((Wt,Di)=>Di===3?Wt:ie(Wt)),Ot=(p=e.textureProperties)==null?void 0:p._MainTex,mi=Ot!=null?{index:Ot,extensions:H({},Q)}:void 0,fi=(f=(m=e.floatProperties)==null?void 0:m._BumpScale)!=null?f:1,Vt=(g=e.textureProperties)==null?void 0:g._BumpMap,_i=Vt!=null?{index:Vt,scale:fi,extensions:H({},Q)}:void 0,gi=((y=(v=e.vectorProperties)==null?void 0:v._EmissionColor)!=null?y:[0,0,0,1]).map(ie),Nt=(E=e.textureProperties)==null?void 0:E._EmissionMap,vi=Nt!=null?{index:Nt,extensions:H({},Q)}:void 0,Mi=((x=(M=e.vectorProperties)==null?void 0:M._ShadeColor)!=null?x:[.97,.81,.86,1]).map(ie),Dt=(w=e.textureProperties)==null?void 0:w._ShadeTexture,xi=Dt!=null?{index:Dt,extensions:H({},Q)}:void 0;let ye=(S=(R=e.floatProperties)==null?void 0:R._ShadeShift)!=null?S:0,we=(b=(L=e.floatProperties)==null?void 0:L._ShadeToony)!=null?b:.9;we=C.lerp(we,1,.5+.5*ye),ye=-ye-(1-we);const Bt=(I=(P=e.floatProperties)==null?void 0:P._IndirectLightIntensity)!=null?I:.1,yi=Bt?1-Bt:void 0,Ve=(D=e.textureProperties)==null?void 0:D._SphereAdd,wi=Ve!=null?[1,1,1]:void 0,Ri=Ve!=null?{index:Ve}:void 0,Ti=(de=(B=e.floatProperties)==null?void 0:B._RimLightingMix)!=null?de:0,kt=(q=e.textureProperties)==null?void 0:q._RimTexture,Ei=kt!=null?{index:kt,extensions:H({},Q)}:void 0,Si=((te=(k=e.vectorProperties)==null?void 0:k._RimColor)!=null?te:[0,0,0,1]).map(ie),Ai=(O=(he=e.floatProperties)==null?void 0:he._RimFresnelPower)!=null?O:1,Pi=(pt=(ct=e.floatProperties)==null?void 0:ct._RimLift)!=null?pt:0,Li=["none","worldCoordinates","screenCoordinates"][(ft=(mt=e.floatProperties)==null?void 0:mt._OutlineWidthMode)!=null?ft:0];let Ne=(gt=(_t=e.floatProperties)==null?void 0:_t._OutlineWidth)!=null?gt:0;Ne=.01*Ne;const Ft=(vt=e.textureProperties)==null?void 0:vt._OutlineWidthTexture,bi=Ft!=null?{index:Ft,extensions:H({},Q)}:void 0,Ii=((xt=(Mt=e.vectorProperties)==null?void 0:Mt._OutlineColor)!=null?xt:[0,0,0]).map(ie),Ci=((wt=(yt=e.floatProperties)==null?void 0:yt._OutlineColorMode)!=null?wt:0)===1?(Tt=(Rt=e.floatProperties)==null?void 0:Rt._OutlineLightingMix)!=null?Tt:1:0,Ht=(Et=e.textureProperties)==null?void 0:Et._UvAnimMaskTexture,Ui=Ht!=null?{index:Ht,extensions:H({},Q)}:void 0,Oi=(At=(St=e.floatProperties)==null?void 0:St._UvAnimScrollX)!=null?At:0;let Re=(Lt=(Pt=e.floatProperties)==null?void 0:Pt._UvAnimScrollY)!=null?Lt:0;Re!=null&&(Re=-Re);const Vi=(It=(bt=e.floatProperties)==null?void 0:bt._UvAnimRotation)!=null?It:0,Ni={specVersion:"1.0",transparentWithZWrite:li,renderQueueOffsetNumber:ui,shadeColorFactor:Mi,shadeMultiplyTexture:xi,shadingShiftFactor:ye,shadingToonyFactor:we,giEqualizationFactor:yi,matcapFactor:wi,matcapTexture:Ri,rimLightingMixFactor:Ti,rimMultiplyTexture:Ei,parametricRimColorFactor:Si,parametricRimFresnelPowerFactor:Ai,parametricRimLiftFactor:Pi,outlineWidthMode:Li,outlineWidthFactor:Ne,outlineWidthMultiplyTexture:bi,outlineColorFactor:Ii,outlineLightingMixFactor:Ci,uvAnimationMaskTexture:Ui,uvAnimationScrollXSpeedFactor:Oi,uvAnimationScrollYSpeedFactor:Re,uvAnimationRotationSpeedFactor:Vi};return wn(H({},t),{pbrMetallicRoughness:{baseColorFactor:pi,baseColorTexture:mi},normalTexture:_i,emissiveTexture:vi,emissiveFactor:gi,alphaMode:di,alphaCutoff:hi,doubleSided:ci,extensions:{VRMC_materials_mtoon:Ni}})}_parseV0UnlitProperties(e,t){var n,i,r,o,a;const l=e.shader==="VRM/UnlitTransparentZWrite",s=e.shader==="VRM/UnlitTransparent"||l,u=this._v0ParseRenderQueue(e),h=e.shader==="VRM/UnlitCutout",d=s?"BLEND":h?"MASK":"OPAQUE",c=h?(i=(n=e.floatProperties)==null?void 0:n._Cutoff)!=null?i:.5:void 0,p=this._portTextureTransform(e),m=((o=(r=e.vectorProperties)==null?void 0:r._Color)!=null?o:[1,1,1,1]).map(ie),f=(a=e.textureProperties)==null?void 0:a._MainTex,g=f!=null?{index:f,extensions:H({},p)}:void 0,v={specVersion:"1.0",transparentWithZWrite:l,renderQueueOffsetNumber:u,shadeColorFactor:m,shadeMultiplyTexture:g};return wn(H({},t),{pbrMetallicRoughness:{baseColorFactor:m,baseColorTexture:g},alphaMode:d,alphaCutoff:c,extensions:{VRMC_materials_mtoon:v}})}_portTextureTransform(e){var t,n,i,r,o;const a=(t=e.vectorProperties)==null?void 0:t._MainTex;if(a==null)return{};const l=[(n=a==null?void 0:a[0])!=null?n:0,(i=a==null?void 0:a[1])!=null?i:0],s=[(r=a==null?void 0:a[2])!=null?r:1,(o=a==null?void 0:a[3])!=null?o:1];return l[1]=1-s[1]-l[1],{KHR_texture_transform:{offset:l,scale:s}}}_v0ParseRenderQueue(e){var t,n;const i=e.shader==="VRM/UnlitTransparentZWrite",r=((t=e.keywordMap)==null?void 0:t._ALPHABLEND_ON)!=null||e.shader==="VRM/UnlitTransparent"||i,o=((n=e.floatProperties)==null?void 0:n._ZWrite)===1||i;let a=0;if(r){const l=e.renderQueue;l!=null&&(o?a=this._renderQueueMapTransparentZWrite.get(l):a=this._renderQueueMapTransparent.get(l))}return a}_populateRenderQueueMap(e){const t=new Set,n=new Set;e.forEach(i=>{var r,o;const a=i.shader==="VRM/UnlitTransparentZWrite",l=((r=i.keywordMap)==null?void 0:r._ALPHABLEND_ON)!=null||i.shader==="VRM/UnlitTransparent"||a,s=((o=i.floatProperties)==null?void 0:o._ZWrite)===1||a;if(l){const u=i.renderQueue;u!=null&&(s?n.add(u):t.add(u))}}),t.size>10&&console.warn(`VRMMaterialsV0CompatPlugin: This VRM uses ${t.size} render queues for Transparent materials while VRM 1.0 only supports up to 10 render queues. The model might not be rendered correctly.`),n.size>10&&console.warn(`VRMMaterialsV0CompatPlugin: This VRM uses ${n.size} render queues for TransparentZWrite materials while VRM 1.0 only supports up to 10 render queues. The model might not be rendered correctly.`),Array.from(t).sort().forEach((i,r)=>{const o=Math.min(Math.max(r-t.size+1,-9),0);this._renderQueueMapTransparent.set(i,o)}),Array.from(n).sort().forEach((i,r)=>{const o=Math.min(Math.max(r,0),9);this._renderQueueMapTransparentZWrite.set(i,o)})}},Rn=(e,t,n)=>new Promise((i,r)=>{var o=s=>{try{l(n.next(s))}catch(u){r(u)}},a=s=>{try{l(n.throw(s))}catch(u){r(u)}},l=s=>s.done?i(s.value):Promise.resolve(s.value).then(o,a);l((n=n.apply(e,t)).next())}),G=new _,We=class extends le{constructor(e){super(),this._attrPosition=new U(new Float32Array([0,0,0,0,0,0]),3),this._attrPosition.setUsage(ji);const t=new Y;t.setAttribute("position",this._attrPosition);const n=new Oe({color:16711935,depthTest:!1,depthWrite:!1});this._line=new Xi(t,n),this.add(this._line),this.constraint=e}updateMatrixWorld(e){G.setFromMatrixPosition(this.constraint.destination.matrixWorld),this._attrPosition.setXYZ(0,G.x,G.y,G.z),this.constraint.source&&G.setFromMatrixPosition(this.constraint.source.matrixWorld),this._attrPosition.setXYZ(1,G.x,G.y,G.z),this._attrPosition.needsUpdate=!0,super.updateMatrixWorld(e)}};function Tn(e,t){return t.set(e.elements[12],e.elements[13],e.elements[14])}var Jr=new _,Kr=new _;function eo(e,t){return e.decompose(Jr,t,Kr),t}function Ue(e){return e.invert?e.invert():e.inverse(),e}var dt=class{constructor(e,t){this.destination=e,this.source=t,this.weight=1}},to=new _,no=new _,io=new _,ro=new T,oo=new T,so=new T,ao=class extends dt{get aimAxis(){return this._aimAxis}set aimAxis(e){this._aimAxis=e,this._v3AimAxis.set(e==="PositiveX"?1:e==="NegativeX"?-1:0,e==="PositiveY"?1:e==="NegativeY"?-1:0,e==="PositiveZ"?1:e==="NegativeZ"?-1:0)}get dependencies(){const e=new Set([this.source]);return this.destination.parent&&e.add(this.destination.parent),e}constructor(e,t){super(e,t),this._aimAxis="PositiveX",this._v3AimAxis=new _(1,0,0),this._dstRestQuat=new T}setInitState(){this._dstRestQuat.copy(this.destination.quaternion)}update(){this.destination.updateWorldMatrix(!0,!1),this.source.updateWorldMatrix(!0,!1);const e=ro.identity(),t=oo.identity();this.destination.parent&&(eo(this.destination.parent.matrixWorld,e),Ue(t.copy(e)));const n=to.copy(this._v3AimAxis).applyQuaternion(this._dstRestQuat).applyQuaternion(e),i=Tn(this.source.matrixWorld,no).sub(Tn(this.destination.matrixWorld,io)).normalize(),r=so.setFromUnitVectors(n,i).premultiply(t).multiply(e).multiply(this._dstRestQuat);this.destination.quaternion.copy(this._dstRestQuat).slerp(r,this.weight)}};function lo(e,t){const n=[e];let i=e.parent;for(;i!==null;)n.unshift(i),i=i.parent;n.forEach(r=>{t(r)})}var uo=class{constructor(){this._constraints=new Set,this._objectConstraintsMap=new Map}get constraints(){return this._constraints}addConstraint(e){this._constraints.add(e);let t=this._objectConstraintsMap.get(e.destination);t==null&&(t=new Set,this._objectConstraintsMap.set(e.destination,t)),t.add(e)}deleteConstraint(e){this._constraints.delete(e),this._objectConstraintsMap.get(e.destination).delete(e)}setInitState(){const e=new Set,t=new Set;for(const n of this._constraints)this._processConstraint(n,e,t,i=>i.setInitState())}update(){const e=new Set,t=new Set;for(const n of this._constraints)this._processConstraint(n,e,t,i=>i.update())}_processConstraint(e,t,n,i){if(n.has(e))return;if(t.has(e))throw new Error("VRMNodeConstraintManager: Circular dependency detected while updating constraints");t.add(e);const r=e.dependencies;for(const o of r)lo(o,a=>{const l=this._objectConstraintsMap.get(a);if(l)for(const s of l)this._processConstraint(s,t,n,i)});i(e),n.add(e)}},ho=new T,co=new T,po=class extends dt{get dependencies(){return new Set([this.source])}constructor(e,t){super(e,t),this._dstRestQuat=new T,this._invSrcRestQuat=new T}setInitState(){this._dstRestQuat.copy(this.destination.quaternion),Ue(this._invSrcRestQuat.copy(this.source.quaternion))}update(){const e=ho.copy(this._invSrcRestQuat).multiply(this.source.quaternion),t=co.copy(this._dstRestQuat).multiply(e);this.destination.quaternion.copy(this._dstRestQuat).slerp(t,this.weight)}},mo=new _,fo=new T,_o=new T,go=class extends dt{get rollAxis(){return this._rollAxis}set rollAxis(e){this._rollAxis=e,this._v3RollAxis.set(e==="X"?1:0,e==="Y"?1:0,e==="Z"?1:0)}get dependencies(){return new Set([this.source])}constructor(e,t){super(e,t),this._rollAxis="X",this._v3RollAxis=new _(1,0,0),this._dstRestQuat=new T,this._invDstRestQuat=new T,this._invSrcRestQuatMulDstRestQuat=new T}setInitState(){this._dstRestQuat.copy(this.destination.quaternion),Ue(this._invDstRestQuat.copy(this._dstRestQuat)),Ue(this._invSrcRestQuatMulDstRestQuat.copy(this.source.quaternion)).multiply(this._dstRestQuat)}update(){const e=fo.copy(this._invDstRestQuat).multiply(this.source.quaternion).multiply(this._invSrcRestQuatMulDstRestQuat),t=mo.copy(this._v3RollAxis).applyQuaternion(e),i=_o.setFromUnitVectors(t,this._v3RollAxis).premultiply(this._dstRestQuat).multiply(e);this.destination.quaternion.copy(this._dstRestQuat).slerp(i,this.weight)}},vo=new Set(["1.0","1.0-beta"]),ti=class Me{get name(){return Me.EXTENSION_NAME}constructor(t,n){this.parser=t,this.helperRoot=n==null?void 0:n.helperRoot}afterRoot(t){return Rn(this,null,function*(){t.userData.vrmNodeConstraintManager=yield this._import(t)})}_import(t){return Rn(this,null,function*(){var n;const i=this.parser.json;if(!(((n=i.extensionsUsed)==null?void 0:n.indexOf(Me.EXTENSION_NAME))!==-1))return null;const o=new uo,a=yield this.parser.getDependencies("node");return a.forEach((l,s)=>{var u;const h=i.nodes[s],d=(u=h==null?void 0:h.extensions)==null?void 0:u[Me.EXTENSION_NAME];if(d==null)return;const c=d.specVersion;if(!vo.has(c)){console.warn(`VRMNodeConstraintLoaderPlugin: Unknown ${Me.EXTENSION_NAME} specVersion "${c}"`);return}const p=d.constraint;if(p.roll!=null){const m=this._importRollConstraint(l,a,p.roll);o.addConstraint(m)}else if(p.aim!=null){const m=this._importAimConstraint(l,a,p.aim);o.addConstraint(m)}else if(p.rotation!=null){const m=this._importRotationConstraint(l,a,p.rotation);o.addConstraint(m)}}),t.scene.updateMatrixWorld(),o.setInitState(),o})}_importRollConstraint(t,n,i){const{source:r,rollAxis:o,weight:a}=i,l=n[r],s=new go(t,l);if(o!=null&&(s.rollAxis=o),a!=null&&(s.weight=a),this.helperRoot){const u=new We(s);this.helperRoot.add(u)}return s}_importAimConstraint(t,n,i){const{source:r,aimAxis:o,weight:a}=i,l=n[r],s=new ao(t,l);if(o!=null&&(s.aimAxis=o),a!=null&&(s.weight=a),this.helperRoot){const u=new We(s);this.helperRoot.add(u)}return s}_importRotationConstraint(t,n,i){const{source:r,weight:o}=i,a=n[r],l=new po(t,a);if(o!=null&&(l.weight=o),this.helperRoot){const s=new We(l);this.helperRoot.add(s)}return l}};ti.EXTENSION_NAME="VRMC_node_constraint";var Mo=ti,Ae=(e,t,n)=>new Promise((i,r)=>{var o=s=>{try{l(n.next(s))}catch(u){r(u)}},a=s=>{try{l(n.throw(s))}catch(u){r(u)}},l=s=>s.done?i(s.value):Promise.resolve(s.value).then(o,a);l((n=n.apply(e,t)).next())}),ht=class{},ze=new _,J=new _,ni=class extends ht{get type(){return"capsule"}constructor(e){var t,n,i,r;super(),this.offset=(t=e==null?void 0:e.offset)!=null?t:new _(0,0,0),this.tail=(n=e==null?void 0:e.tail)!=null?n:new _(0,0,0),this.radius=(i=e==null?void 0:e.radius)!=null?i:0,this.inside=(r=e==null?void 0:e.inside)!=null?r:!1}calculateCollision(e,t,n,i){ze.setFromMatrixPosition(e),J.subVectors(this.tail,this.offset).applyMatrix4(e),J.sub(ze);const r=J.lengthSq();i.copy(t).sub(ze);const o=J.dot(i);o<=0||(r<=o||J.multiplyScalar(o/r),i.sub(J));const a=i.length(),l=this.inside?this.radius-n-a:a-n-this.radius;return l<0&&(i.multiplyScalar(1/a),this.inside&&i.negate()),l}},je=new _,En=new z,ii=class extends ht{get type(){return"plane"}constructor(e){var t,n;super(),this.offset=(t=e==null?void 0:e.offset)!=null?t:new _(0,0,0),this.normal=(n=e==null?void 0:e.normal)!=null?n:new _(0,0,1)}calculateCollision(e,t,n,i){i.setFromMatrixPosition(e),i.negate().add(t),En.getNormalMatrix(e),je.copy(this.normal).applyNormalMatrix(En).normalize();const r=i.dot(je)-n;return i.copy(je),r}},xo=new _,ri=class extends ht{get type(){return"sphere"}constructor(e){var t,n,i;super(),this.offset=(t=e==null?void 0:e.offset)!=null?t:new _(0,0,0),this.radius=(n=e==null?void 0:e.radius)!=null?n:0,this.inside=(i=e==null?void 0:e.inside)!=null?i:!1}calculateCollision(e,t,n,i){i.subVectors(t,xo.setFromMatrixPosition(e));const r=i.length(),o=this.inside?this.radius-n-r:r-n-this.radius;return o<0&&(i.multiplyScalar(1/r),this.inside&&i.negate()),o}},W=new _,yo=class extends Y{constructor(e){super(),this.worldScale=1,this._currentRadius=0,this._currentOffset=new _,this._currentTail=new _,this._shape=e,this._attrPos=new U(new Float32Array(396),3),this.setAttribute("position",this._attrPos),this._attrIndex=new U(new Uint16Array(264),1),this.setIndex(this._attrIndex),this._buildIndex(),this.update()}update(){let e=!1;const t=this._shape.radius/this.worldScale;this._currentRadius!==t&&(this._currentRadius=t,e=!0),this._currentOffset.equals(this._shape.offset)||(this._currentOffset.copy(this._shape.offset),e=!0);const n=W.copy(this._shape.tail).divideScalar(this.worldScale);this._currentTail.distanceToSquared(n)>1e-10&&(this._currentTail.copy(n),e=!0),e&&this._buildPosition()}_buildPosition(){W.copy(this._currentTail).sub(this._currentOffset);const e=W.length()/this._currentRadius;for(let i=0;i<=16;i++){const r=i/16*Math.PI;this._attrPos.setXYZ(i,-Math.sin(r),-Math.cos(r),0),this._attrPos.setXYZ(17+i,e+Math.sin(r),Math.cos(r),0),this._attrPos.setXYZ(34+i,-Math.sin(r),0,-Math.cos(r)),this._attrPos.setXYZ(51+i,e+Math.sin(r),0,Math.cos(r))}for(let i=0;i<32;i++){const r=i/16*Math.PI;this._attrPos.setXYZ(68+i,0,Math.sin(r),Math.cos(r)),this._attrPos.setXYZ(100+i,e,Math.sin(r),Math.cos(r))}const t=Math.atan2(W.y,Math.sqrt(W.x*W.x+W.z*W.z)),n=-Math.atan2(W.z,W.x);this.rotateZ(t),this.rotateY(n),this.scale(this._currentRadius,this._currentRadius,this._currentRadius),this.translate(this._currentOffset.x,this._currentOffset.y,this._currentOffset.z),this._attrPos.needsUpdate=!0}_buildIndex(){for(let e=0;e<34;e++){const t=(e+1)%34;this._attrIndex.setXY(e*2,e,t),this._attrIndex.setXY(68+e*2,34+e,34+t)}for(let e=0;e<32;e++){const t=(e+1)%32;this._attrIndex.setXY(136+e*2,68+e,68+t),this._attrIndex.setXY(200+e*2,100+e,100+t)}this._attrIndex.needsUpdate=!0}},wo=class extends Y{constructor(e){super(),this.worldScale=1,this._currentOffset=new _,this._currentNormal=new _,this._shape=e,this._attrPos=new U(new Float32Array(6*3),3),this.setAttribute("position",this._attrPos),this._attrIndex=new U(new Uint16Array(10),1),this.setIndex(this._attrIndex),this._buildIndex(),this.update()}update(){let e=!1;this._currentOffset.equals(this._shape.offset)||(this._currentOffset.copy(this._shape.offset),e=!0),this._currentNormal.equals(this._shape.normal)||(this._currentNormal.copy(this._shape.normal),e=!0),e&&this._buildPosition()}_buildPosition(){this._attrPos.setXYZ(0,-.5,-.5,0),this._attrPos.setXYZ(1,.5,-.5,0),this._attrPos.setXYZ(2,.5,.5,0),this._attrPos.setXYZ(3,-.5,.5,0),this._attrPos.setXYZ(4,0,0,0),this._attrPos.setXYZ(5,0,0,.25),this.translate(this._currentOffset.x,this._currentOffset.y,this._currentOffset.z),this.lookAt(this._currentNormal),this._attrPos.needsUpdate=!0}_buildIndex(){this._attrIndex.setXY(0,0,1),this._attrIndex.setXY(2,1,2),this._attrIndex.setXY(4,2,3),this._attrIndex.setXY(6,3,0),this._attrIndex.setXY(8,4,5),this._attrIndex.needsUpdate=!0}},Ro=class extends Y{constructor(e){super(),this.worldScale=1,this._currentRadius=0,this._currentOffset=new _,this._shape=e,this._attrPos=new U(new Float32Array(32*3*3),3),this.setAttribute("position",this._attrPos),this._attrIndex=new U(new Uint16Array(64*3),1),this.setIndex(this._attrIndex),this._buildIndex(),this.update()}update(){let e=!1;const t=this._shape.radius/this.worldScale;this._currentRadius!==t&&(this._currentRadius=t,e=!0),this._currentOffset.equals(this._shape.offset)||(this._currentOffset.copy(this._shape.offset),e=!0),e&&this._buildPosition()}_buildPosition(){for(let e=0;e<32;e++){const t=e/16*Math.PI;this._attrPos.setXYZ(e,Math.cos(t),Math.sin(t),0),this._attrPos.setXYZ(32+e,0,Math.cos(t),Math.sin(t)),this._attrPos.setXYZ(64+e,Math.sin(t),0,Math.cos(t))}this.scale(this._currentRadius,this._currentRadius,this._currentRadius),this.translate(this._currentOffset.x,this._currentOffset.y,this._currentOffset.z),this._attrPos.needsUpdate=!0}_buildIndex(){for(let e=0;e<32;e++){const t=(e+1)%32;this._attrIndex.setXY(e*2,e,t),this._attrIndex.setXY(64+e*2,32+e,32+t),this._attrIndex.setXY(128+e*2,64+e,64+t)}this._attrIndex.needsUpdate=!0}},To=new _,Xe=class extends le{constructor(e){if(super(),this.matrixAutoUpdate=!1,this.collider=e,this.collider.shape instanceof ri)this._geometry=new Ro(this.collider.shape);else if(this.collider.shape instanceof ni)this._geometry=new yo(this.collider.shape);else if(this.collider.shape instanceof ii)this._geometry=new wo(this.collider.shape);else throw new Error("VRMSpringBoneColliderHelper: Unknown collider shape type detected");const t=new Oe({color:16711935,depthTest:!1,depthWrite:!1});this._line=new at(this._geometry,t),this.add(this._line)}dispose(){this._geometry.dispose()}updateMatrixWorld(e){this.collider.updateWorldMatrix(!0,!1),this.matrix.copy(this.collider.matrixWorld);const t=this.matrix.elements;this._geometry.worldScale=To.set(t[0],t[1],t[2]).length(),this._geometry.update(),super.updateMatrixWorld(e)}},Eo=class extends Y{constructor(e){super(),this.worldScale=1,this._currentRadius=0,this._currentTail=new _,this._springBone=e,this._attrPos=new U(new Float32Array(294),3),this.setAttribute("position",this._attrPos),this._attrIndex=new U(new Uint16Array(194),1),this.setIndex(this._attrIndex),this._buildIndex(),this.update()}update(){let e=!1;const t=this._springBone.settings.hitRadius/this.worldScale;this._currentRadius!==t&&(this._currentRadius=t,e=!0),this._currentTail.equals(this._springBone.initialLocalChildPosition)||(this._currentTail.copy(this._springBone.initialLocalChildPosition),e=!0),e&&this._buildPosition()}_buildPosition(){for(let e=0;e<32;e++){const t=e/16*Math.PI;this._attrPos.setXYZ(e,Math.cos(t),Math.sin(t),0),this._attrPos.setXYZ(32+e,0,Math.cos(t),Math.sin(t)),this._attrPos.setXYZ(64+e,Math.sin(t),0,Math.cos(t))}this.scale(this._currentRadius,this._currentRadius,this._currentRadius),this.translate(this._currentTail.x,this._currentTail.y,this._currentTail.z),this._attrPos.setXYZ(96,0,0,0),this._attrPos.setXYZ(97,this._currentTail.x,this._currentTail.y,this._currentTail.z),this._attrPos.needsUpdate=!0}_buildIndex(){for(let e=0;e<32;e++){const t=(e+1)%32;this._attrIndex.setXY(e*2,e,t),this._attrIndex.setXY(64+e*2,32+e,32+t),this._attrIndex.setXY(128+e*2,64+e,64+t)}this._attrIndex.setXY(192,96,97),this._attrIndex.needsUpdate=!0}},So=new _,Ao=class extends le{constructor(e){super(),this.matrixAutoUpdate=!1,this.springBone=e,this._geometry=new Eo(this.springBone);const t=new Oe({color:16776960,depthTest:!1,depthWrite:!1});this._line=new at(this._geometry,t),this.add(this._line)}dispose(){this._geometry.dispose()}updateMatrixWorld(e){this.springBone.bone.updateWorldMatrix(!0,!1),this.matrix.copy(this.springBone.bone.matrixWorld);const t=this.matrix.elements;this._geometry.worldScale=So.set(t[0],t[1],t[2]).length(),this._geometry.update(),super.updateMatrixWorld(e)}},qe=class extends xe{constructor(e){super(),this.colliderMatrix=new X,this.shape=e}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),Po(this.colliderMatrix,this.matrixWorld,this.shape.offset)}};function Po(e,t,n){const i=t.elements;e.copy(t),n&&(e.elements[12]=i[0]*n.x+i[4]*n.y+i[8]*n.z+i[12],e.elements[13]=i[1]*n.x+i[5]*n.y+i[9]*n.z+i[13],e.elements[14]=i[2]*n.x+i[6]*n.y+i[10]*n.z+i[14])}var Lo=new X;function bo(e){return e.invert?e.invert():e.getInverse(Lo.copy(e)),e}var Io=class{constructor(e){this._inverseCache=new X,this._shouldUpdateInverse=!0,this.matrix=e;const t={set:(n,i,r)=>(this._shouldUpdateInverse=!0,n[i]=r,!0)};this._originalElements=e.elements,e.elements=new Proxy(e.elements,t)}get inverse(){return this._shouldUpdateInverse&&(bo(this._inverseCache.copy(this.matrix)),this._shouldUpdateInverse=!1),this._inverseCache}revert(){this.matrix.elements=this._originalElements}},Ye=new X,re=new _,fe=new _,_e=new _,ge=new _,Co=new X,Uo=class{constructor(e,t,n={},i=[]){this._currentTail=new _,this._prevTail=new _,this._boneAxis=new _,this._worldSpaceBoneLength=0,this._center=null,this._initialLocalMatrix=new X,this._initialLocalRotation=new T,this._initialLocalChildPosition=new _;var r,o,a,l,s,u;this.bone=e,this.bone.matrixAutoUpdate=!1,this.child=t,this.settings={hitRadius:(r=n.hitRadius)!=null?r:0,stiffness:(o=n.stiffness)!=null?o:1,gravityPower:(a=n.gravityPower)!=null?a:0,gravityDir:(s=(l=n.gravityDir)==null?void 0:l.clone())!=null?s:new _(0,-1,0),dragForce:(u=n.dragForce)!=null?u:.4},this.colliderGroups=i}get dependencies(){const e=new Set,t=this.bone.parent;t&&e.add(t);for(let n=0;n{t(r)})}function st(e,t){e.children.forEach(n=>{t(n)||st(n,t)})}function Vo(e){var t;const n=new Map;for(const i of e){let r=i;do{const o=((t=n.get(r))!=null?t:0)+1;if(o===e.size)return r;n.set(r,o),r=r.parent}while(r!==null)}return null}var Sn=class{constructor(){this._joints=new Set,this._sortedJoints=[],this._hasWarnedCircularDependency=!1,this._ancestors=[],this._objectSpringBonesMap=new Map,this._isSortedJointsDirty=!1,this._relevantChildrenUpdated=this._relevantChildrenUpdated.bind(this)}get joints(){return this._joints}get springBones(){return console.warn("VRMSpringBoneManager: springBones is deprecated. use joints instead."),this._joints}get colliderGroups(){const e=new Set;return this._joints.forEach(t=>{t.colliderGroups.forEach(n=>{e.add(n)})}),Array.from(e)}get colliders(){const e=new Set;return this.colliderGroups.forEach(t=>{t.colliders.forEach(n=>{e.add(n)})}),Array.from(e)}addJoint(e){this._joints.add(e);let t=this._objectSpringBonesMap.get(e.bone);t==null&&(t=new Set,this._objectSpringBonesMap.set(e.bone,t)),t.add(e),this._isSortedJointsDirty=!0}addSpringBone(e){console.warn("VRMSpringBoneManager: addSpringBone() is deprecated. use addJoint() instead."),this.addJoint(e)}deleteJoint(e){this._joints.delete(e),this._objectSpringBonesMap.get(e.bone).delete(e),this._isSortedJointsDirty=!0}deleteSpringBone(e){console.warn("VRMSpringBoneManager: deleteSpringBone() is deprecated. use deleteJoint() instead."),this.deleteJoint(e)}setInitState(){this._sortJoints();for(let e=0;e{var a,l;return((l=(a=this._objectSpringBonesMap.get(o))==null?void 0:a.size)!=null?l:0)>0?!0:(this._ancestors.push(o),!1)})),this._isSortedJointsDirty=!1}_insertJointSort(e,t,n,i,r){if(n.has(e))return;if(t.has(e)){this._hasWarnedCircularDependency||(console.warn("VRMSpringBoneManager: Circular dependency detected"),this._hasWarnedCircularDependency=!0);return}t.add(e);const o=e.dependencies;for(const a of o){let l=!1,s=null;Oo(a,u=>{const h=this._objectSpringBonesMap.get(u);if(h)for(const d of h)l=!0,this._insertJointSort(d,t,n,i,r);else l||(s=u)}),s&&r.add(s)}i.push(e),n.add(e)}_relevantChildrenUpdated(e){var t,n;return((n=(t=this._objectSpringBonesMap.get(e))==null?void 0:t.size)!=null?n:0)>0?!0:(e.updateWorldMatrix(!1,!1),!1)}},An="VRMC_springBone_extended_collider",No=new Set(["1.0","1.0-beta"]),Do=new Set(["1.0"]),oi=class se{get name(){return se.EXTENSION_NAME}constructor(t,n){var i;this.parser=t,this.jointHelperRoot=n==null?void 0:n.jointHelperRoot,this.colliderHelperRoot=n==null?void 0:n.colliderHelperRoot,this.useExtendedColliders=(i=n==null?void 0:n.useExtendedColliders)!=null?i:!0}afterRoot(t){return Ae(this,null,function*(){t.userData.vrmSpringBoneManager=yield this._import(t)})}_import(t){return Ae(this,null,function*(){const n=yield this._v1Import(t);if(n!=null)return n;const i=yield this._v0Import(t);return i??null})}_v1Import(t){return Ae(this,null,function*(){var n,i,r,o,a;const l=t.parser.json;if(!(((n=l.extensionsUsed)==null?void 0:n.indexOf(se.EXTENSION_NAME))!==-1))return null;const u=new Sn,h=yield t.parser.getDependencies("node"),d=(i=l.extensions)==null?void 0:i[se.EXTENSION_NAME];if(!d)return null;const c=d.specVersion;if(!No.has(c))return console.warn(`VRMSpringBoneLoaderPlugin: Unknown ${se.EXTENSION_NAME} specVersion "${c}"`),null;const p=(r=d.colliders)==null?void 0:r.map((f,g)=>{var v,y,E,M,x,w,R,S,L,b,P,I,D,B,de;const q=h[f.node];if(q==null)return console.warn(`VRMSpringBoneLoaderPlugin: The collider #${g} attempted to use the node #${f.node} but not found`),null;const k=f.shape,te=(v=f.extensions)==null?void 0:v[An];if(this.useExtendedColliders&&te!=null){const he=te.specVersion;if(!Do.has(he))console.warn(`VRMSpringBoneLoaderPlugin: Unknown ${An} specVersion "${he}". Fallbacking to the ${se.EXTENSION_NAME} definition`);else{const O=te.shape;if(O.sphere)return this._importSphereCollider(q,{offset:new _().fromArray((y=O.sphere.offset)!=null?y:[0,0,0]),radius:(E=O.sphere.radius)!=null?E:0,inside:(M=O.sphere.inside)!=null?M:!1});if(O.capsule)return this._importCapsuleCollider(q,{offset:new _().fromArray((x=O.capsule.offset)!=null?x:[0,0,0]),radius:(w=O.capsule.radius)!=null?w:0,tail:new _().fromArray((R=O.capsule.tail)!=null?R:[0,0,0]),inside:(S=O.capsule.inside)!=null?S:!1});if(O.plane)return this._importPlaneCollider(q,{offset:new _().fromArray((L=O.plane.offset)!=null?L:[0,0,0]),normal:new _().fromArray((b=O.plane.normal)!=null?b:[0,0,1])})}}if(k.sphere)return this._importSphereCollider(q,{offset:new _().fromArray((P=k.sphere.offset)!=null?P:[0,0,0]),radius:(I=k.sphere.radius)!=null?I:0,inside:!1});if(k.capsule)return this._importCapsuleCollider(q,{offset:new _().fromArray((D=k.capsule.offset)!=null?D:[0,0,0]),radius:(B=k.capsule.radius)!=null?B:0,tail:new _().fromArray((de=k.capsule.tail)!=null?de:[0,0,0]),inside:!1});throw new Error(`VRMSpringBoneLoaderPlugin: The collider #${g} has no valid shape`)}),m=(o=d.colliderGroups)==null?void 0:o.map((f,g)=>{var v;return{colliders:((v=f.colliders)!=null?v:[]).flatMap(E=>{const M=p==null?void 0:p[E];return M??(console.warn(`VRMSpringBoneLoaderPlugin: The colliderGroup #${g} attempted to use a collider #${E} but not found`),[])}),name:f.name}});return(a=d.springs)==null||a.forEach((f,g)=>{var v;const y=f.joints,E=(v=f.colliderGroups)==null?void 0:v.map(w=>{const R=m==null?void 0:m[w];if(R==null)throw new Error(`VRMSpringBoneLoaderPlugin: The spring #${g} attempted to use a colliderGroup ${w} but not found`);return R}),M=f.center!=null?h[f.center]:void 0;let x;y.forEach(w=>{if(x){const R=x.node,S=h[R],L=w.node,b=h[L],P={hitRadius:x.hitRadius,dragForce:x.dragForce,gravityPower:x.gravityPower,stiffness:x.stiffness,gravityDir:x.gravityDir!=null?new _().fromArray(x.gravityDir):void 0},I=this._importJoint(S,b,P,E);M&&(I.center=M),u.addJoint(I)}x=w})}),u.setInitState(),u})}_v0Import(t){return Ae(this,null,function*(){var n,i,r;const o=t.parser.json;if(!(((n=o.extensionsUsed)==null?void 0:n.indexOf("VRM"))!==-1))return null;const l=(i=o.extensions)==null?void 0:i.VRM,s=l==null?void 0:l.secondaryAnimation;if(!s)return null;const u=s==null?void 0:s.boneGroups;if(!u)return null;const h=new Sn,d=yield t.parser.getDependencies("node"),c=(r=s.colliderGroups)==null?void 0:r.map(p=>{var m;const f=d[p.node];return{colliders:((m=p.colliders)!=null?m:[]).map((v,y)=>{var E,M,x;const w=new _(0,0,0);return v.offset&&w.set((E=v.offset.x)!=null?E:0,(M=v.offset.y)!=null?M:0,v.offset.z?-v.offset.z:0),this._importSphereCollider(f,{offset:w,radius:(x=v.radius)!=null?x:0,inside:!1})})}});return u==null||u.forEach((p,m)=>{const f=p.bones;f&&f.forEach(g=>{var v,y,E,M;const x=d[g],w=new _;p.gravityDir?w.set((v=p.gravityDir.x)!=null?v:0,(y=p.gravityDir.y)!=null?y:0,(E=p.gravityDir.z)!=null?E:0):w.set(0,-1,0);const R=p.center!=null?d[p.center]:void 0,S={hitRadius:p.hitRadius,dragForce:p.dragForce,gravityPower:p.gravityPower,stiffness:p.stiffiness,gravityDir:w},L=(M=p.colliderGroups)==null?void 0:M.map(b=>{const P=c==null?void 0:c[b];if(P==null)throw new Error(`VRMSpringBoneLoaderPlugin: The spring #${m} attempted to use a colliderGroup ${b} but not found`);return P});x.traverse(b=>{var P;const I=(P=b.children[0])!=null?P:null,D=this._importJoint(b,I,S,L);R&&(D.center=R),h.addJoint(D)})})}),t.scene.updateMatrixWorld(),h.setInitState(),h})}_importJoint(t,n,i,r){const o=new Uo(t,n,i,r);if(this.jointHelperRoot){const a=new Ao(o);this.jointHelperRoot.add(a),a.renderOrder=this.jointHelperRoot.renderOrder}return o}_importSphereCollider(t,n){const i=new ri(n),r=new qe(i);if(t.add(r),this.colliderHelperRoot){const o=new Xe(r);this.colliderHelperRoot.add(o),o.renderOrder=this.colliderHelperRoot.renderOrder}return r}_importCapsuleCollider(t,n){const i=new ni(n),r=new qe(i);if(t.add(r),this.colliderHelperRoot){const o=new Xe(r);this.colliderHelperRoot.add(o),o.renderOrder=this.colliderHelperRoot.renderOrder}return r}_importPlaneCollider(t,n){const i=new ii(n),r=new qe(i);if(t.add(r),this.colliderHelperRoot){const o=new Xe(r);this.colliderHelperRoot.add(o),o.renderOrder=this.colliderHelperRoot.renderOrder}return r}};oi.EXTENSION_NAME="VRMC_springBone";var Bo=oi,Ts=class{get name(){return"VRMLoaderPlugin"}constructor(e,t){var n,i,r,o,a,l,s,u,h,d;this.parser=e;const c=t==null?void 0:t.helperRoot,p=t==null?void 0:t.autoUpdateHumanBones;this.expressionPlugin=(n=t==null?void 0:t.expressionPlugin)!=null?n:new er(e),this.firstPersonPlugin=(i=t==null?void 0:t.firstPersonPlugin)!=null?i:new nr(e),this.humanoidPlugin=(r=t==null?void 0:t.humanoidPlugin)!=null?r:new ur(e,{helperRoot:c,autoUpdateHumanBones:p}),this.lookAtPlugin=(o=t==null?void 0:t.lookAtPlugin)!=null?o:new Tr(e,{helperRoot:c}),this.metaPlugin=(a=t==null?void 0:t.metaPlugin)!=null?a:new Ar(e),this.mtoonMaterialPlugin=(l=t==null?void 0:t.mtoonMaterialPlugin)!=null?l:new Wr(e),this.materialsHDREmissiveMultiplierPlugin=(s=t==null?void 0:t.materialsHDREmissiveMultiplierPlugin)!=null?s:new jr(e),this.materialsV0CompatPlugin=(u=t==null?void 0:t.materialsV0CompatPlugin)!=null?u:new Zr(e),this.springBonePlugin=(h=t==null?void 0:t.springBonePlugin)!=null?h:new Bo(e,{colliderHelperRoot:c,jointHelperRoot:c}),this.nodeConstraintPlugin=(d=t==null?void 0:t.nodeConstraintPlugin)!=null?d:new Mo(e,{helperRoot:c})}beforeRoot(){return Te(this,null,function*(){yield this.materialsV0CompatPlugin.beforeRoot(),yield this.mtoonMaterialPlugin.beforeRoot()})}loadMesh(e){return Te(this,null,function*(){return yield this.mtoonMaterialPlugin.loadMesh(e)})}getMaterialType(e){const t=this.mtoonMaterialPlugin.getMaterialType(e);return t??null}extendMaterialParams(e,t){return Te(this,null,function*(){yield this.materialsHDREmissiveMultiplierPlugin.extendMaterialParams(e,t),yield this.mtoonMaterialPlugin.extendMaterialParams(e,t)})}afterRoot(e){return Te(this,null,function*(){yield this.metaPlugin.afterRoot(e),yield this.humanoidPlugin.afterRoot(e),yield this.expressionPlugin.afterRoot(e),yield this.lookAtPlugin.afterRoot(e),yield this.firstPersonPlugin.afterRoot(e),yield this.springBonePlugin.afterRoot(e),yield this.nodeConstraintPlugin.afterRoot(e),yield this.mtoonMaterialPlugin.afterRoot(e);const t=e.userData.vrmMeta,n=e.userData.vrmHumanoid;if(t&&n){const i=new Lr({scene:e.scene,expressionManager:e.userData.vrmExpressionManager,firstPerson:e.userData.vrmFirstPerson,humanoid:n,lookAt:e.userData.vrmLookAt,meta:t,materials:e.userData.vrmMToonMaterials,springBoneManager:e.userData.vrmSpringBoneManager,nodeConstraintManager:e.userData.vrmNodeConstraintManager});e.userData.vrm=i}})}};function ko(e){const t=new Set;return e.traverse(n=>{if(!n.isMesh)return;const i=n;t.add(i)}),t}function Pn(e,t,n){if(t.size===1){const a=t.values().next().value;if(a.weight===1)return e[a.index]}const i=new Float32Array(e[0].count*3);let r=0;if(n)r=1;else for(const a of t)r+=a.weight;for(const a of t){const l=e[a.index],s=a.weight/r;for(let u=0;uh.getOrCreate(L)).join(","),R=`${M};${v};${w}`;let S=l.get(R);S==null&&(S=E.clone(),qo(S,x,m),l.set(R,S)),y.geometry.setAttribute("skinIndex",S)}for(const y of p)y.bind(g,new X)}}function Wo(e){const t=new Set;return e.traverse(n=>{if(!n.isSkinnedMesh)return;const i=n;t.add(i)}),t}function zo(e,t){const n=new Set;for(let i=0;in)return!1;return!0}var Ge=class{constructor(){this._objectIndexMap=new Map,this._index=0}get(e){return this._objectIndexMap.get(e)}getOrCreate(e){let t=this._objectIndexMap.get(e);return t==null&&(t=this._index,this._objectIndexMap.set(e,t),this._index++),t}};function Go(e){var t,n,i,r;const o=new Y;o.name=e.name,o.setIndex(e.index);for(const[a,l]of Object.entries(e.attributes))o.setAttribute(a,l);for(const[a,l]of Object.entries(e.morphAttributes))o.morphAttributes[a]=l.concat();o.morphTargetsRelative=e.morphTargetsRelative,o.groups=[];for(const a of e.groups)o.addGroup(a.start,a.count,a.materialIndex);return o.boundingSphere=(n=(t=e.boundingSphere)==null?void 0:t.clone())!=null?n:null,o.boundingBox=(r=(i=e.boundingBox)==null?void 0:i.clone())!=null?r:null,o.drawRange.start=e.drawRange.start,o.drawRange.count=e.drawRange.count,o.userData=e.userData,o}function Ln(e){if(Object.values(e).forEach(t=>{t!=null&&t.isTexture&&t.dispose()}),e.isShaderMaterial){const t=e.uniforms;t&&Object.values(t).forEach(n=>{const i=n.value;i!=null&&i.isTexture&&i.dispose()})}e.dispose()}function Qo(e){const t=e.geometry;t&&t.dispose();const n=e.skeleton;n&&n.dispose();const i=e.material;i&&(Array.isArray(i)?i.forEach(r=>Ln(r)):i&&Ln(i))}function $o(e){e.traverse(Qo)}function Zo(e,t){var n,i;console.warn("VRMUtils.removeUnnecessaryJoints: removeUnnecessaryJoints is deprecated. Use combineSkeletons instead. combineSkeletons contributes more to the performance improvement. This function will be removed in the next major version.");const r=(n=t==null?void 0:t.experimentalSameBoneCounts)!=null?n:!1,o=[];e.traverse(s=>{s.type==="SkinnedMesh"&&o.push(s)});const a=new Map;let l=0;for(const s of o){const h=s.geometry.getAttribute("skinIndex");if(a.has(h))continue;const d=new Map,c=new Map;for(let p=0;p{var i,r,o,a;if(!n.isMesh)return;const l=n,s=l.geometry,u=s.index;if(u==null)return;const h=t.get(s);if(h!=null){l.geometry=h;return}const d=Object.values(s.attributes)[0].count,c=new Array(d);let p=0;const m=u.array;for(let M=0;M{y.addGroup(M.start,M.count,M.materialIndex)}),y.boundingBox=(r=(i=s.boundingBox)==null?void 0:i.clone())!=null?r:null,y.boundingSphere=(a=(o=s.boundingSphere)==null?void 0:o.clone())!=null?a:null,y.setDrawRange(s.drawRange.start,s.drawRange.count),y.userData=s.userData,t.set(s,y);{const M=u.array,x=new M.constructor(M.length);for(let w=0;w{const x=s.attributes[M];if(x.isInterleavedBufferAttribute)throw new Error("removeUnnecessaryVertices: InterleavedBufferAttribute is not supported");const w=x.array,{itemSize:R,normalized:S}=x,L=new w.constructor(g.length*R);g.forEach((b,P)=>{for(let I=0;I{y.morphAttributes[M]=[];const x=s.morphAttributes[M];for(let w=0;w{for(let B=0;BI===0),y.morphAttributes[M][w]=new U(P,L,b)}}),E&&(y.morphAttributes={}),l.geometry=y}),Array.from(t.keys()).forEach(n=>{n.dispose()})}function Ko(e){var t;((t=e.meta)==null?void 0:t.metaVersion)==="0"&&(e.scene.rotation.y=Math.PI)}var ue=class{constructor(){}};ue.combineMorphs=Fo;ue.combineSkeletons=Ho;ue.deepDispose=$o;ue.removeUnnecessaryJoints=Zo;ue.removeUnnecessaryVertices=Jo;ue.rotateVRM0=Ko;/*! - * @pixiv/three-vrm-core v3.4.0 - * The implementation of core features of VRM, for @pixiv/three-vrm - * - * Copyright (c) 2019-2025 pixiv Inc. - * @pixiv/three-vrm-core is distributed under MIT License - * https://github.com/pixiv/three-vrm/blob/release/LICENSE - *//*! - * @pixiv/three-vrm-materials-mtoon v3.4.0 - * MToon (toon material) module for @pixiv/three-vrm - * - * Copyright (c) 2019-2025 pixiv Inc. - * @pixiv/three-vrm-materials-mtoon is distributed under MIT License - * https://github.com/pixiv/three-vrm/blob/release/LICENSE - *//*! - * @pixiv/three-vrm-materials-hdr-emissive-multiplier v3.4.0 - * Support VRMC_hdr_emissiveMultiplier for @pixiv/three-vrm - * - * Copyright (c) 2019-2025 pixiv Inc. - * @pixiv/three-vrm-materials-hdr-emissive-multiplier is distributed under MIT License - * https://github.com/pixiv/three-vrm/blob/release/LICENSE - *//*! - * @pixiv/three-vrm-materials-v0compat v3.4.0 - * VRM0.0 materials compatibility layer plugin for @pixiv/three-vrm - * - * Copyright (c) 2019-2025 pixiv Inc. - * @pixiv/three-vrm-materials-v0compat is distributed under MIT License - * https://github.com/pixiv/three-vrm/blob/release/LICENSE - *//*! - * @pixiv/three-vrm-node-constraint v3.4.0 - * Node constraint module for @pixiv/three-vrm - * - * Copyright (c) 2019-2025 pixiv Inc. - * @pixiv/three-vrm-node-constraint is distributed under MIT License - * https://github.com/pixiv/three-vrm/blob/release/LICENSE - *//*! - * @pixiv/three-vrm-springbone v3.4.0 - * Spring bone module for @pixiv/three-vrm - * - * Copyright (c) 2019-2025 pixiv Inc. - * @pixiv/three-vrm-springbone is distributed under MIT License - * https://github.com/pixiv/three-vrm/blob/release/LICENSE - *//*! - * @pixiv/three-vrm-animation v3.4.0 - * The implementation of VRM Animation - * - * Copyright (c) 2019-2025 pixiv Inc. - * @pixiv/three-vrm-animation is distributed under MIT License - * https://github.com/pixiv/three-vrm/blob/release/LICENSE - */var bn=(e,t,n)=>new Promise((i,r)=>{var o=s=>{try{l(n.next(s))}catch(u){r(u)}},a=s=>{try{l(n.throw(s))}catch(u){r(u)}},l=s=>s.done?i(s.value):Promise.resolve(s.value).then(o,a);l((n=n.apply(e,t)).next())}),es={Aa:"aa",Ih:"ih",Ou:"ou",Ee:"ee",Oh:"oh",Blink:"blink",Happy:"happy",Angry:"angry",Sad:"sad",Relaxed:"relaxed",LookUp:"lookUp",Surprised:"surprised",LookDown:"lookDown",LookLeft:"lookLeft",LookRight:"lookRight",BlinkLeft:"blinkLeft",BlinkRight:"blinkRight",Neutral:"neutral"};new N;new ae;new _;new _;var In={hips:null,spine:"hips",chest:"spine",upperChest:"chest",neck:"upperChest",head:"neck",leftEye:"head",rightEye:"head",jaw:"head",leftUpperLeg:"hips",leftLowerLeg:"leftUpperLeg",leftFoot:"leftLowerLeg",leftToes:"leftFoot",rightUpperLeg:"hips",rightLowerLeg:"rightUpperLeg",rightFoot:"rightLowerLeg",rightToes:"rightFoot",leftShoulder:"upperChest",leftUpperArm:"leftShoulder",leftLowerArm:"leftUpperArm",leftHand:"leftLowerArm",rightShoulder:"upperChest",rightUpperArm:"rightShoulder",rightLowerArm:"rightUpperArm",rightHand:"rightLowerArm",leftThumbMetacarpal:"leftHand",leftThumbProximal:"leftThumbMetacarpal",leftThumbDistal:"leftThumbProximal",leftIndexProximal:"leftHand",leftIndexIntermediate:"leftIndexProximal",leftIndexDistal:"leftIndexIntermediate",leftMiddleProximal:"leftHand",leftMiddleIntermediate:"leftMiddleProximal",leftMiddleDistal:"leftMiddleIntermediate",leftRingProximal:"leftHand",leftRingIntermediate:"leftRingProximal",leftRingDistal:"leftRingIntermediate",leftLittleProximal:"leftHand",leftLittleIntermediate:"leftLittleProximal",leftLittleDistal:"leftLittleIntermediate",rightThumbMetacarpal:"rightHand",rightThumbProximal:"rightThumbMetacarpal",rightThumbDistal:"rightThumbProximal",rightIndexProximal:"rightHand",rightIndexIntermediate:"rightIndexProximal",rightIndexDistal:"rightIndexIntermediate",rightMiddleProximal:"rightHand",rightMiddleIntermediate:"rightMiddleProximal",rightMiddleDistal:"rightMiddleIntermediate",rightRingProximal:"rightHand",rightRingIntermediate:"rightRingProximal",rightRingDistal:"rightRingIntermediate",rightLittleProximal:"rightHand",rightLittleIntermediate:"rightLittleProximal",rightLittleDistal:"rightLittleIntermediate"};function ts(e){return e.invert?e.invert():e.inverse(),e}new _;new _;new _;new _;new _;new _(0,1,0);var ns=new _,is=new _;function rs(e,t){return e.matrixWorld.decompose(ns,t,is),t}function Qe(e){return[Math.atan2(-e.z,e.x),Math.atan2(e.y,Math.sqrt(e.x*e.x+e.z*e.z))]}function Cn(e){const t=Math.round(e/2/Math.PI);return e-2*Math.PI*t}var Un=new _(0,0,1),os=new _,ss=new _,as=new _,ls=new T,$e=new T,On=new T,us=new T,Ze=new ee,si=class ai{constructor(t,n){this.offsetFromHeadBone=new _,this.autoUpdate=!0,this.faceFront=new _(0,0,1),this.humanoid=t,this.applier=n,this._yaw=0,this._pitch=0,this._needsUpdate=!0,this._restHeadWorldQuaternion=this.getLookAtWorldQuaternion(new T)}get yaw(){return this._yaw}set yaw(t){this._yaw=t,this._needsUpdate=!0}get pitch(){return this._pitch}set pitch(t){this._pitch=t,this._needsUpdate=!0}get euler(){return console.warn("VRMLookAt: euler is deprecated. use getEuler() instead."),this.getEuler(new ee)}getEuler(t){return t.set(C.DEG2RAD*this._pitch,C.DEG2RAD*this._yaw,0,"YXZ")}copy(t){if(this.humanoid!==t.humanoid)throw new Error("VRMLookAt: humanoid must be same in order to copy");return this.offsetFromHeadBone.copy(t.offsetFromHeadBone),this.applier=t.applier,this.autoUpdate=t.autoUpdate,this.target=t.target,this.faceFront.copy(t.faceFront),this}clone(){return new ai(this.humanoid,this.applier).copy(this)}reset(){this._yaw=0,this._pitch=0,this._needsUpdate=!0}getLookAtWorldPosition(t){const n=this.humanoid.getRawBoneNode("head");return t.copy(this.offsetFromHeadBone).applyMatrix4(n.matrixWorld)}getLookAtWorldQuaternion(t){const n=this.humanoid.getRawBoneNode("head");return rs(n,t)}getFaceFrontQuaternion(t){if(this.faceFront.distanceToSquared(Un)<.01)return t.copy(this._restHeadWorldQuaternion).invert();const[n,i]=Qe(this.faceFront);return Ze.set(0,.5*Math.PI+n,i,"YZX"),t.setFromEuler(Ze).premultiply(us.copy(this._restHeadWorldQuaternion).invert())}getLookAtWorldDirection(t){return this.getLookAtWorldQuaternion($e),this.getFaceFrontQuaternion(On),t.copy(Un).applyQuaternion($e).applyQuaternion(On).applyEuler(this.getEuler(Ze))}lookAt(t){const n=ls.copy(this._restHeadWorldQuaternion).multiply(ts(this.getLookAtWorldQuaternion($e))),i=this.getLookAtWorldPosition(ss),r=as.copy(t).sub(i).applyQuaternion(n).normalize(),[o,a]=Qe(this.faceFront),[l,s]=Qe(r),u=Cn(l-o),h=Cn(a-s);this._yaw=C.RAD2DEG*u,this._pitch=C.RAD2DEG*h,this._needsUpdate=!0}update(t){this.target!=null&&this.autoUpdate&&this.lookAt(this.target.getWorldPosition(os)),this._needsUpdate&&(this._needsUpdate=!1,this.applier.applyYawPitch(this._yaw,this._pitch))}};si.EULER_ORDER="YXZ";var ds=si;new _(0,0,1);new ee(0,0,0,"YXZ");var Vn=180/Math.PI,Je=new ee,Nn=class extends xe{constructor(e){super(),this.vrmLookAt=e,this.type="VRMLookAtQuaternionProxy";const t=this.rotation._onChangeCallback;this.rotation._onChange(()=>{t(),this._applyToLookAt()});const n=this.quaternion._onChangeCallback;this.quaternion._onChange(()=>{n(),this._applyToLookAt()})}_applyToLookAt(){Je.setFromQuaternion(this.quaternion,ds.EULER_ORDER),this.vrmLookAt.yaw=Vn*Je.y,this.vrmLookAt.pitch=Vn*Je.x}};function hs(e,t,n){var i,r;const o=new Map,a=new Map;for(const[l,s]of e.humanoidTracks.rotation.entries()){const u=(i=t.getNormalizedBoneNode(l))==null?void 0:i.name;if(u!=null){const h=new $i(`${u}.quaternion`,s.times,s.values.map((d,c)=>n==="0"&&c%2===0?-d:d));a.set(l,h)}}for(const[l,s]of e.humanoidTracks.translation.entries()){const u=(r=t.getNormalizedBoneNode(l))==null?void 0:r.name;if(u!=null){const h=e.restHipsPosition.y,c=t.normalizedRestPose.hips.position[1]/h,p=s.clone();p.values=p.values.map((m,f)=>(n==="0"&&f%3!==1?-m:m)*c),p.name=`${u}.position`,o.set(l,p)}}return{translation:o,rotation:a}}function cs(e,t){const n=new Map,i=new Map;for(const[r,o]of e.expressionTracks.preset.entries()){const a=t.getExpressionTrackName(r);if(a!=null){const l=o.clone();l.name=a,n.set(r,l)}}for(const[r,o]of e.expressionTracks.custom.entries()){const a=t.getExpressionTrackName(r);if(a!=null){const l=o.clone();l.name=a,i.set(r,l)}}return{preset:n,custom:i}}function ps(e,t){if(e.lookAtTrack==null)return null;const n=e.lookAtTrack.clone();return n.name=t,n}function Es(e,t){const n=[],i=hs(e,t.humanoid,t.meta.metaVersion);if(n.push(...i.translation.values()),n.push(...i.rotation.values()),t.expressionManager!=null){const r=cs(e,t.expressionManager);n.push(...r.preset.values()),n.push(...r.custom.values())}if(t.lookAt!=null){let r=t.scene.children.find(a=>a instanceof Nn);r==null?(console.warn("createVRMAnimationClip: VRMLookAtQuaternionProxy is not found. Creating a new one automatically. To suppress this warning, create a VRMLookAtQuaternionProxy manually"),r=new Nn(t.lookAt),r.name="VRMLookAtQuaternionProxy",t.scene.add(r)):r.name==null&&(console.warn("createVRMAnimationClip: VRMLookAtQuaternionProxy is found but its name is not set. Setting the name automatically. To suppress this warning, set the name manually"),r.name="VRMLookAtQuaternionProxy");const o=ps(e,`${r.name}.quaternion`);o!=null&&n.push(o)}return new Gi("Clip",e.duration,n)}var ms=class{constructor(){this.duration=0,this.restHipsPosition=new _,this.humanoidTracks={translation:new Map,rotation:new Map},this.expressionTracks={preset:new Map,custom:new Map},this.lookAtTrack=null}};function Dn(e,t){const n=e.length,i=[];let r=[],o=0;for(let a=0;a{const v=r.animations[g],y=this._parseAnimation(f,v,s,u);return y.restHipsPosition=c,y});e.userData.vrmAnimations=m})}_createNodeMap(e){var t,n,i,r,o;const a=new Map,l=new Map,s=(t=e.humanoid)==null?void 0:t.humanBones;s&&Object.entries(s).forEach(([c,p])=>{const m=p==null?void 0:p.node;m!=null&&a.set(m,c)});const u=(n=e.expressions)==null?void 0:n.preset;u&&Object.entries(u).forEach(([c,p])=>{const m=p==null?void 0:p.node;m!=null&&l.set(m,c)});const h=(i=e.expressions)==null?void 0:i.custom;h&&Object.entries(h).forEach(([c,p])=>{const{node:m}=p;l.set(m,c)});const d=(o=(r=e.lookAt)==null?void 0:r.node)!=null?o:null;return{humanoidIndexToName:a,expressionsIndexToName:l,lookAtIndex:d}}_createBoneWorldMatrixMap(e,t){return bn(this,null,function*(){var n,i;e.scene.updateWorldMatrix(!1,!0);const r=yield e.parser.getDependencies("node"),o=new Map;if(t.humanoid==null)return o;for(const[a,l]of Object.entries(t.humanoid.humanBones)){const s=l==null?void 0:l.node;if(s!=null){const u=r[s];o.set(a,u.matrixWorld),a==="hips"&&o.set("hipsParent",(i=(n=u.parent)==null?void 0:n.matrixWorld)!=null?i:fs)}}return o})}_parseAnimation(e,t,n,i){const r=e.tracks,o=t.channels,a=new ms;return a.duration=e.duration,o.forEach((l,s)=>{const{node:u,path:h}=l.target,d=r[s];if(u==null)return;const c=n.humanoidIndexToName.get(u);if(c!=null){let m=In[c];for(;m!=null&&i.get(m)==null;)m=In[m];if(m==null&&(m="hipsParent"),h==="translation")if(c!=="hips")console.warn(`The loading animation contains a translation track for ${c}, which is not permitted in the VRMC_vrm_animation spec. ignoring the track`);else{const f=i.get("hipsParent"),g=Dn(d.values,3).flatMap(y=>ve.fromArray(y).applyMatrix4(f).toArray()),v=d.clone();v.values=new Float32Array(g),a.humanoidTracks.translation.set(c,v)}else if(h==="rotation"){const f=i.get(c),g=i.get(m);f.decompose(ve,Ke,ve),Ke.invert(),g.decompose(ve,Bn,ve);const v=Dn(d.values,4).flatMap(E=>_s.fromArray(E).premultiply(Bn).multiply(Ke).toArray()),y=d.clone();y.values=new Float32Array(v),a.humanoidTracks.rotation.set(c,y)}else throw new Error(`Invalid path "${h}"`);return}const p=n.expressionsIndexToName.get(u);if(p!=null){if(h==="translation"){const m=d.times,f=new Float32Array(d.values.length/3);for(let v=0;vfetch(r).then(c=>c.arrayBuffer());return defaultModelFetcher.defaultModelFetcher=f,defaultModelFetcher}var frameProcessor={},logging={},hasRequiredLogging;function requireLogging(){return hasRequiredLogging||(hasRequiredLogging=1,function(f){Object.defineProperty(f,"__esModule",{value:!0}),f.log=f.LOG_PREFIX=void 0,f.LOG_PREFIX="[VAD]";const r=["error","debug","warn"];function c(l){return(...m)=>{console[l](f.LOG_PREFIX,...m)}}const d=r.reduce((l,m)=>(l[m]=c(m),l),{});f.log=d}(logging)),logging}var messages={},hasRequiredMessages;function requireMessages(){if(hasRequiredMessages)return messages;hasRequiredMessages=1,Object.defineProperty(messages,"__esModule",{value:!0}),messages.Message=void 0;var f;return function(r){r.AudioFrame="AUDIO_FRAME",r.SpeechStart="SPEECH_START",r.VADMisfire="VAD_MISFIRE",r.SpeechEnd="SPEECH_END",r.SpeechStop="SPEECH_STOP",r.SpeechRealStart="SPEECH_REAL_START",r.FrameProcessed="FRAME_PROCESSED"}(f||(messages.Message=f={})),messages}var hasRequiredFrameProcessor;function requireFrameProcessor(){if(hasRequiredFrameProcessor)return frameProcessor;hasRequiredFrameProcessor=1,Object.defineProperty(frameProcessor,"__esModule",{value:!0}),frameProcessor.FrameProcessor=frameProcessor.validateOptions=frameProcessor.defaultV5FrameProcessorOptions=frameProcessor.defaultLegacyFrameProcessorOptions=void 0;const f=requireLogging(),r=requireMessages(),c=[512,1024,1536];frameProcessor.defaultLegacyFrameProcessorOptions={positiveSpeechThreshold:.5,negativeSpeechThreshold:.5-.15,preSpeechPadFrames:1,redemptionFrames:8,frameSamples:1536,minSpeechFrames:3,submitUserSpeechOnPause:!1},frameProcessor.defaultV5FrameProcessorOptions={positiveSpeechThreshold:.5,negativeSpeechThreshold:.5-.15,preSpeechPadFrames:3,redemptionFrames:24,frameSamples:512,minSpeechFrames:9,submitUserSpeechOnPause:!1};function d(s){c.includes(s.frameSamples)||f.log.warn("You are using an unusual frame size"),(s.positiveSpeechThreshold<0||s.positiveSpeechThreshold>1)&&f.log.error("positiveSpeechThreshold should be a number between 0 and 1"),(s.negativeSpeechThreshold<0||s.negativeSpeechThreshold>s.positiveSpeechThreshold)&&f.log.error("negativeSpeechThreshold should be between 0 and positiveSpeechThreshold"),s.preSpeechPadFrames<0&&f.log.error("preSpeechPadFrames should be positive"),s.redemptionFrames<0&&f.log.error("redemptionFrames should be positive")}frameProcessor.validateOptions=d;const l=s=>{const h=s.reduce((a,o)=>(a.push(a.at(-1)+o.length),a),[0]),p=new Float32Array(h.at(-1));return s.forEach((a,o)=>{const t=h[o];p.set(a,t)}),p};class m{constructor(h,p,a){this.modelProcessFunc=h,this.modelResetFunc=p,this.options=a,this.speaking=!1,this.redemptionCounter=0,this.speechFrameCount=0,this.active=!1,this.speechRealStartFired=!1,this.reset=()=>{this.speaking=!1,this.speechRealStartFired=!1,this.audioBuffer=[],this.modelResetFunc(),this.redemptionCounter=0,this.speechFrameCount=0},this.pause=o=>{this.active=!1,this.options.submitUserSpeechOnPause?this.endSegment(o):this.reset()},this.resume=()=>{this.active=!0},this.endSegment=o=>{const t=this.audioBuffer;this.audioBuffer=[];const e=this.speaking;if(this.reset(),e)if(t.reduce((i,u)=>u.isSpeech?i+1:i,0)>=this.options.minSpeechFrames){const i=l(t.map(u=>u.frame));o({msg:r.Message.SpeechEnd,audio:i})}else o({msg:r.Message.VADMisfire});return{}},this.process=async(o,t)=>{if(!this.active)return;const e=await this.modelProcessFunc(o),n=e.isSpeech>=this.options.positiveSpeechThreshold;if(t({probs:e,msg:r.Message.FrameProcessed,frame:o}),this.audioBuffer.push({frame:o,isSpeech:n}),n&&(this.speechFrameCount++,this.redemptionCounter=0),n&&!this.speaking&&(this.speaking=!0,t({msg:r.Message.SpeechStart})),this.speaking&&this.speechFrameCount===this.options.minSpeechFrames&&!this.speechRealStartFired&&(this.speechRealStartFired=!0,t({msg:r.Message.SpeechRealStart})),e.isSpeech=this.options.redemptionFrames){this.redemptionCounter=0,this.speechFrameCount=0,this.speaking=!1,this.speechRealStartFired=!1;const i=this.audioBuffer;if(this.audioBuffer=[],i.reduce((g,b)=>b.isSpeech?g+1:g,0)>=this.options.minSpeechFrames){const g=l(i.map(b=>b.frame));t({msg:r.Message.SpeechEnd,audio:g})}else t({msg:r.Message.VADMisfire})}if(!this.speaking){for(;this.audioBuffer.length>this.options.preSpeechPadFrames;)this.audioBuffer.shift();this.speechFrameCount=0}},this.audioBuffer=[],this.reset()}}return frameProcessor.FrameProcessor=m,frameProcessor}var nonRealTimeVad={},ortWeb_min={exports:{}};const backends={},backendsSortedByPriority=[],registerBackend=(f,r,c)=>{if(r&&typeof r.init=="function"&&typeof r.createSessionHandler=="function"){const d=backends[f];if(d===void 0)backends[f]={backend:r,priority:c};else{if(d.priority>c)return;if(d.priority===c&&d.backend!==r)throw new Error(`cannot register backend "${f}" using priority ${c}`)}if(c>=0){const l=backendsSortedByPriority.indexOf(f);l!==-1&&backendsSortedByPriority.splice(l,1);for(let m=0;m{const r=f.length===0?backendsSortedByPriority:f,c=[];for(const d of r){const l=backends[d];if(l){if(l.initialized)return l.backend;if(l.aborted)continue;const m=!!l.initPromise;try{return m||(l.initPromise=l.backend.init()),await l.initPromise,l.initialized=!0,l.backend}catch(s){m||c.push({name:d,err:s}),l.aborted=!0}finally{delete l.initPromise}}}throw new Error(`no available backend found. ERR: ${c.map(d=>`[${d.name}] ${d.err}`).join(", ")}`)};class EnvImpl{constructor(){this.wasm={},this.webgl={},this.logLevelInternal="warning"}set logLevel(r){if(r!==void 0){if(typeof r!="string"||["verbose","info","warning","error","fatal"].indexOf(r)===-1)throw new Error(`Unsupported logging level: ${r}`);this.logLevelInternal=r}}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=f=>{let r=1;for(let c=0;c{const t=document.createElement("canvas"),e=t.getContext("2d");if(!r||!e)return o();const n=new Image;n.crossOrigin="Anonymous",n.src=r,n.onload=()=>{t.width=n.width,t.height=n.height,e.drawImage(n,0,0,t.width,t.height);const i=e.getImageData(0,0,t.width,t.height);if(c!==void 0){if(c.height!==void 0&&c.height!==t.height)throw new Error("Image input config height doesn't match ImageBitmap height");if(p.height=t.height,c.width!==void 0&&c.width!==t.width)throw new Error("Image input config width doesn't match ImageBitmap width");p.width=t.width}else p.height=t.height,p.width=t.width;a(St.bufferToTensor(i.data,p))}});throw new Error("Input data provided is not supported - aborted tensor creation")}if(h!==void 0)return St.bufferToTensor(h,p);throw new Error("Input data provided is not supported - aborted tensor creation")}toImageData(r){var c,d;const l=document.createElement("canvas").getContext("2d");let m;if(l!=null){const s=this.dims[3],h=this.dims[2],p=this.dims[1],a=r!==void 0&&r.format!==void 0?r.format:"RGB",o=r!==void 0&&((c=r.norm)===null||c===void 0?void 0:c.mean)!==void 0?r.norm.mean:255,t=r!==void 0&&((d=r.norm)===null||d===void 0?void 0:d.bias)!==void 0?r.norm.bias:0,e=h*s;if(r!==void 0){if(r.height!==void 0&&r.height!==h)throw new Error("Image output config height doesn't match tensor height");if(r.width!==void 0&&r.width!==s)throw new Error("Image output config width doesn't match tensor width");if(r.format!==void 0&&p===4&&r.format!=="RGBA"||p===3&&r.format!=="RGB"&&r.format!=="BGR")throw new Error("Tensor format doesn't match input tensor dims")}const n=4;let i=0,u=1,g=2,b=3,y=0,_=e,v=e*2,w=-1;a==="RGBA"?(y=0,_=e,v=e*2,w=e*3):a==="RGB"?(y=0,_=e,v=e*2):a==="RBG"&&(y=0,v=e,_=e*2),m=l.createImageData(s,h);for(let T=0;T"u")throw new Error(`input '${a}' is missing in 'feeds'.`);if(s)for(const a of this.outputNames)l[a]=null;const h=await this.handler.run(r,l,m),p={};for(const a in h)Object.hasOwnProperty.call(h,a)&&(p[a]=new Tensor(h[a].type,h[a].data,h[a].dims));return p}static async create(r,c,d,l){let m,s={};if(typeof r=="string"){if(m=r,typeof c=="object"&&c!==null)s=c;else if(typeof c<"u")throw new TypeError("'options' must be an object.")}else if(r instanceof Uint8Array){if(m=r,typeof c=="object"&&c!==null)s=c;else if(typeof c<"u")throw new TypeError("'options' must be an object.")}else if(r instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&r instanceof SharedArrayBuffer){const t=r;let e=0,n=r.byteLength;if(typeof c=="object"&&c!==null)s=c;else if(typeof c=="number"){if(e=c,!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=r.byteLength-e,typeof d=="number"){if(n=d,!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 l=="object"&&l!==null)s=l;else if(typeof l<"u")throw new TypeError("'options' must be an object.")}else if(typeof d<"u")throw new TypeError("'byteLength' must be a number.")}else if(typeof c<"u")throw new TypeError("'options' must be an object.");m=new Uint8Array(t,e,n)}else throw new TypeError("Unexpected argument[0]: must be 'path' or 'buffer'.");const p=(s.executionProviders||[]).map(t=>typeof t=="string"?t:t.name),o=await(await resolveBackend(p)).createSessionHandler(m,s);return new fn(o)}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. +*/var hasRequiredOrtWeb_min;function requireOrtWeb_min(){return hasRequiredOrtWeb_min||(hasRequiredOrtWeb_min=1,function(module,exports){(function(f,r){module.exports=r(require$$0)})(self,__WEBPACK_EXTERNAL_MODULE__1670__=>(()=>{var __webpack_modules__={3474:(f,r,c)=>{var d,l=(d=(d=typeof document<"u"&&document.currentScript?document.currentScript.src:void 0)||"/index.js",function(m){function s(){return Y.buffer!=te&&Ae(Y.buffer),he}function h(){return Y.buffer!=te&&Ae(Y.buffer),Me}function p(){return Y.buffer!=te&&Ae(Y.buffer),Te}function a(){return Y.buffer!=te&&Ae(Y.buffer),ue}function o(){return Y.buffer!=te&&Ae(Y.buffer),xe}var t,e,n;m=m||{},t||(t=m!==void 0?m:{}),t.ready=new Promise(function(S,O){e=S,n=O});var i,u,g,b,y,_,v=Object.assign({},t),w="./this.program",T=(S,O)=>{throw O},A=typeof window=="object",E=typeof importScripts=="function",x=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",P=t.ENVIRONMENT_IS_PTHREAD||!1,C="";function k(S){return t.locateFile?t.locateFile(S,C):C+S}if(x){let S;C=E?c(908).dirname(C)+"/":"//",_=()=>{y||(b=c(1384),y=c(908))},i=function(O,I){return _(),O=y.normalize(O),b.readFileSync(O,I?void 0:"utf8")},g=O=>((O=i(O,!0)).buffer||(O=new Uint8Array(O)),O),u=(O,I,L)=>{_(),O=y.normalize(O),b.readFile(O,function(B,z){B?L(B):I(z.buffer)})},1{if(je())throw process.exitCode=O,I;I instanceof Ke||U("exiting due to exception: "+I),process.exit(O)},t.inspect=function(){return"[Emscripten Module object]"};try{S=c(9925)}catch(O){throw console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?'),O}c.g.Worker=S.Worker}else(A||E)&&(E?C=self.location.href:typeof document<"u"&&document.currentScript&&(C=document.currentScript.src),d&&(C=d),C=C.indexOf("blob:")!==0?C.substr(0,C.replace(/[?#].*/,"").lastIndexOf("/")+1):"",x||(i=S=>{var O=new XMLHttpRequest;return O.open("GET",S,!1),O.send(null),O.responseText},E&&(g=S=>{var O=new XMLHttpRequest;return O.open("GET",S,!1),O.responseType="arraybuffer",O.send(null),new Uint8Array(O.response)}),u=(S,O,I)=>{var L=new XMLHttpRequest;L.open("GET",S,!0),L.responseType="arraybuffer",L.onload=()=>{L.status==200||L.status==0&&L.response?O(L.response):I()},L.onerror=I,L.send(null)}));x&&typeof performance>"u"&&(c.g.performance=c(6953).performance);var $=console.log.bind(console),F=console.warn.bind(console);x&&(_(),$=S=>b.writeSync(1,S+` +`),F=S=>b.writeSync(2,S+` +`));var q,D=t.print||$,U=t.printErr||F;Object.assign(t,v),v=null,t.thisProgram&&(w=t.thisProgram),t.quit&&(T=t.quit),t.wasmBinary&&(q=t.wasmBinary);var J=t.noExitRuntime||!1;typeof WebAssembly!="object"&&le("no native wasm support detected");var Y,Z,te,he,Me,Te,ue,xe,_e=!1,Le=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function ze(S,O,I){var L=(O>>>=0)+I;for(I=O;S[I]&&!(I>=L);)++I;if(16(B=(240&B)==224?(15&B)<<12|z<<6|Q:(7&B)<<18|z<<12|Q<<6|63&S[O++])?L+=String.fromCharCode(B):(B-=65536,L+=String.fromCharCode(55296|B>>10,56320|1023&B))}}else L+=String.fromCharCode(B)}return L}function Se(S,O){return(S>>>=0)?ze(h(),S,O):""}function De(S,O,I,L){if(!(0>>=0;L=I+L-1;for(var z=0;z=Q&&(Q=65536+((1023&Q)<<10)|1023&S.charCodeAt(++z)),127>=Q){if(I>=L)break;O[I++>>>0]=Q}else{if(2047>=Q){if(I+1>=L)break;O[I++>>>0]=192|Q>>6}else{if(65535>=Q){if(I+2>=L)break;O[I++>>>0]=224|Q>>12}else{if(I+3>=L)break;O[I++>>>0]=240|Q>>18,O[I++>>>0]=128|Q>>12&63}O[I++>>>0]=128|Q>>6&63}O[I++>>>0]=128|63&Q}}return O[I>>>0]=0,I-B}function Re(S){for(var O=0,I=0;I=L?O++:2047>=L?O+=2:55296<=L&&57343>=L?(O+=4,++I):O+=3}return O}function Ae(S){te=S,t.HEAP8=he=new Int8Array(S),t.HEAP16=new Int16Array(S),t.HEAP32=Te=new Int32Array(S),t.HEAPU8=Me=new Uint8Array(S),t.HEAPU16=new Uint16Array(S),t.HEAPU32=ue=new Uint32Array(S),t.HEAPF32=new Float32Array(S),t.HEAPF64=xe=new Float64Array(S)}P&&(te=t.buffer);var we=t.INITIAL_MEMORY||16777216;if(P)Y=t.wasmMemory,te=t.buffer;else if(t.wasmMemory)Y=t.wasmMemory;else if(!((Y=new WebAssembly.Memory({initial:we/65536,maximum:65536,shared:!0})).buffer instanceof SharedArrayBuffer))throw U("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag"),x&&console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)"),Error("bad memory");Y&&(te=Y.buffer),we=te.byteLength,Ae(te);var ke,Ue=[],Be=[],We=[],qe=[];function je(){return J||!1}function Ve(){var S=t.preRun.shift();Ue.unshift(S)}var Ee,$e=0,Ye=null;function le(S){throw P?postMessage({cmd:"onAbort",arg:S}):t.onAbort&&t.onAbort(S),U(S="Aborted("+S+")"),_e=!0,S=new WebAssembly.RuntimeError(S+". Build with -sASSERTIONS for more info."),n(S),S}function pt(){return Ee.startsWith("data:application/octet-stream;base64,")}function ut(){var S=Ee;try{if(S==Ee&&q)return new Uint8Array(q);if(g)return g(S);throw"both async and sync fetching of the wasm failed"}catch(O){le(O)}}Ee="ort-wasm-threaded.wasm",pt()||(Ee=k(Ee));var It={};function Ke(S){this.name="ExitStatus",this.message="Program terminated with exit("+S+")",this.status=S}function He(S){(S=ie.Vb[S])||le(),ie.mc(S)}function lt(S){var O=ie.Cc();if(!O)return 6;ie.ac.push(O),ie.Vb[S.Ub]=O,O.Ub=S.Ub;var I={cmd:"run",start_routine:S.Ic,arg:S.zc,pthread_ptr:S.Ub};return O.$b=()=>{I.time=performance.now(),O.postMessage(I,S.Nc)},O.loaded&&(O.$b(),delete O.$b),0}function Ce(S){if(P)return K(1,1,S);je()||(ie.oc(),t.onExit&&t.onExit(S),_e=!0),T(S,new Ke(S))}function nt(S,O){if(!O&&P)throw Et(S),"unwind";je()||P||(Xt(),Je(We),Yt(0),kt[1].length&&Vt(1,10),kt[2].length&&Vt(2,10),ie.oc()),Ce(S)}var ie={Yb:[],ac:[],qc:[],Vb:{},fc:function(){P&&ie.Ec()},Pc:function(){},Ec:function(){ie.receiveObjectTransfer=ie.Gc,ie.threadInitTLS=ie.pc,ie.setExitStatus=ie.nc,J=!1},nc:function(){},oc:function(){for(var S of Object.values(ie.Vb))ie.mc(S);for(S of ie.Yb)S.terminate();ie.Yb=[]},mc:function(S){var O=S.Ub;delete ie.Vb[O],ie.Yb.push(S),ie.ac.splice(ie.ac.indexOf(S),1),S.Ub=0,Ut(O)},Gc:function(){},pc:function(){ie.qc.forEach(S=>S())},Fc:function(S,O){S.onmessage=I=>{var L=(I=I.data).cmd;if(S.Ub&&(ie.Bc=S.Ub),I.targetThread&&I.targetThread!=Ct()){var B=ie.Vb[I.Qc];B?B.postMessage(I,I.transferList):U('Internal error! Worker sent a message "'+L+'" to target pthread '+I.targetThread+", but that thread no longer exists!")}else L==="processProxyingQueue"?N(I.queue):L==="spawnThread"?lt(I):L==="cleanupThread"?He(I.thread):L==="killThread"?(I=I.thread,L=ie.Vb[I],delete ie.Vb[I],L.terminate(),Ut(I),ie.ac.splice(ie.ac.indexOf(L),1),L.Ub=0):L==="cancelThread"?ie.Vb[I.thread].postMessage({cmd:"cancel"}):L==="loaded"?(S.loaded=!0,O&&O(S),S.$b&&(S.$b(),delete S.$b)):L==="print"?D("Thread "+I.threadId+": "+I.text):L==="printErr"?U("Thread "+I.threadId+": "+I.text):L==="alert"?alert("Thread "+I.threadId+": "+I.text):I.target==="setimmediate"?S.postMessage(I):L==="onAbort"?t.onAbort&&t.onAbort(I.arg):L&&U("worker sent an unknown command "+L);ie.Bc=void 0},S.onerror=I=>{throw U("worker sent an error! "+I.filename+":"+I.lineno+": "+I.message),I},x&&(S.on("message",function(I){S.onmessage({data:I})}),S.on("error",function(I){S.onerror(I)}),S.on("detachedExit",function(){})),S.postMessage({cmd:"load",urlOrBlob:t.mainScriptUrlOrBlob||d,wasmMemory:Y,wasmModule:Z})},yc:function(){var S=k("ort-wasm-threaded.worker.js");ie.Yb.push(new Worker(S))},Cc:function(){return ie.Yb.length==0&&(ie.yc(),ie.Fc(ie.Yb[0])),ie.Yb.pop()}};function Je(S){for(;0>2>>>0];S=p()[S+48>>2>>>0],en(O,O-S),ce(O)};var Xe=[];function ye(S){var O=Xe[S];return O||(S>=Xe.length&&(Xe.length=S+1),Xe[S]=O=ke.get(S)),O}t.invokeEntryPoint=function(S,O){S=ye(S)(O),je()?ie.nc(S):Jt(S)};var rt,ct,it=[],oe=0,re=0;function se(S){this.Zb=S,this.Sb=S-24,this.xc=function(O){a()[this.Sb+4>>2>>>0]=O},this.bc=function(){return a()[this.Sb+4>>2>>>0]},this.wc=function(O){a()[this.Sb+8>>2>>>0]=O},this.Dc=function(){return a()[this.Sb+8>>2>>>0]},this.rc=function(){p()[this.Sb>>2>>>0]=0},this.hc=function(O){O=O?1:0,s()[this.Sb+12>>0>>>0]=O},this.uc=function(){return s()[this.Sb+12>>0>>>0]!=0},this.ic=function(O){O=O?1:0,s()[this.Sb+13>>0>>>0]=O},this.kc=function(){return s()[this.Sb+13>>0>>>0]!=0},this.fc=function(O,I){this.cc(0),this.xc(O),this.wc(I),this.rc(),this.hc(!1),this.ic(!1)},this.sc=function(){Atomics.add(p(),this.Sb>>2,1)},this.Hc=function(){return Atomics.sub(p(),this.Sb>>2,1)===1},this.cc=function(O){a()[this.Sb+16>>2>>>0]=O},this.tc=function(){return a()[this.Sb+16>>2>>>0]},this.vc=function(){if(tn(this.bc()))return a()[this.Zb>>2>>>0];var O=this.tc();return O!==0?O:this.Zb}}function ft(S){return qt(new se(S).Sb)}function et(S,O,I,L){return P?K(3,1,S,O,I,L):mt(S,O,I,L)}function mt(S,O,I,L){if(typeof SharedArrayBuffer>"u")return U("Current environment does not support SharedArrayBuffer, pthreads are not available!"),6;var B=[];return P&&B.length===0?et(S,O,I,L):(S={Ic:I,Ub:S,zc:L,Nc:B},P?(S.Oc="spawnThread",postMessage(S,B),0):lt(S))}function gt(S,O,I){return P?K(4,1,S,O,I):0}function bt(S,O){if(P)return K(5,1,S,O)}function dt(S,O){if(P)return K(6,1,S,O)}function yt(S,O,I){if(P)return K(7,1,S,O,I)}function _t(S,O,I){return P?K(8,1,S,O,I):0}function vt(S,O){if(P)return K(9,1,S,O)}function wt(S,O,I){if(P)return K(10,1,S,O,I)}function xt(S,O,I,L){if(P)return K(11,1,S,O,I,L)}function ot(S,O,I,L){if(P)return K(12,1,S,O,I,L)}function ht(S,O,I,L){if(P)return K(13,1,S,O,I,L)}function Tt(S){if(P)return K(14,1,S)}function M(S,O){if(P)return K(15,1,S,O)}function R(S,O,I){if(P)return K(16,1,S,O,I)}function N(S){Atomics.store(p(),S>>2,1),Ct()&&Kt(S),Atomics.compareExchange(p(),S>>2,1,0)}function V(S){return a()[S>>>2]+4294967296*p()[S+4>>>2]}function j(S,O,I,L,B,z){return P?K(17,1,S,O,I,L,B,z):-52}function H(S,O,I,L,B,z){if(P)return K(18,1,S,O,I,L,B,z)}function X(S){var O=Re(S)+1,I=$t(O);return I&&De(S,s(),I,O),I}function ee(S,O,I){function L(me){return(me=me.toTimeString().match(/\(([A-Za-z ]+)\)$/))?me[1]:"GMT"}if(P)return K(19,1,S,O,I);var B=new Date().getFullYear(),z=new Date(B,0,1),Q=new Date(B,6,1);B=z.getTimezoneOffset();var ne=Q.getTimezoneOffset(),fe=Math.max(B,ne);p()[S>>2>>>0]=60*fe,p()[O>>2>>>0]=+(B!=ne),S=L(z),O=L(Q),S=X(S),O=X(O),ne>2>>>0]=S,a()[I+4>>2>>>0]=O):(a()[I>>2>>>0]=O,a()[I+4>>2>>>0]=S)}function K(S,O){var I=arguments.length-2,L=arguments;return At(()=>{for(var B=Bt(8*I),z=B>>3,Q=0;Q>>0]=ne}return Zt(S,I,B,O)})}t.executeNotifiedProxyingQueue=N,ct=x?()=>{var S=process.hrtime();return 1e3*S[0]+S[1]/1e6}:P?()=>performance.now()-t.__performance_now_clock_drift:()=>performance.now();var ae,ve=[],Fe={};function Ne(){if(!ae){var S,O={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:w||"./this.program"};for(S in Fe)Fe[S]===void 0?delete O[S]:O[S]=Fe[S];var I=[];for(S in O)I.push(S+"="+O[S]);ae=I}return ae}function G(S,O){if(P)return K(20,1,S,O);var I=0;return Ne().forEach(function(L,B){var z=O+I;for(B=a()[S+4*B>>2>>>0]=z,z=0;z>0>>>0]=L.charCodeAt(z);s()[B>>0>>>0]=0,I+=L.length+1}),0}function ge(S,O){if(P)return K(21,1,S,O);var I=Ne();a()[S>>2>>>0]=I.length;var L=0;return I.forEach(function(B){L+=B.length+1}),a()[O>>2>>>0]=L,0}function Oe(S){return P?K(22,1,S):52}function Qe(S,O,I,L){return P?K(23,1,S,O,I,L):52}function st(S,O,I,L,B){return P?K(24,1,S,O,I,L,B):70}var kt=[null,[],[]];function Vt(S,O){var I=kt[S];O===0||O===10?((S===1?D:U)(ze(I,0)),I.length=0):I.push(O)}function zt(S,O,I,L){if(P)return K(25,1,S,O,I,L);for(var B=0,z=0;z>2>>>0],ne=a()[O+4>>2>>>0];O+=8;for(var fe=0;fe>>0]);B+=ne}return a()[L>>2>>>0]=B,0}var Ge=0;function Dt(S){return S%4==0&&(S%100!=0||S%400==0)}var Ht=[31,29,31,30,31,30,31,31,30,31,30,31],Gt=[31,28,31,30,31,30,31,31,30,31,30,31];function Wt(S,O,I,L){function B(W,be,Pe){for(W=typeof W=="number"?W.toString():W||"";W.lengthOt?-1:0at-W.getDate())){W.setDate(W.getDate()+be);break}be-=at-W.getDate()+1,W.setDate(1),11>Pe?W.setMonth(Pe+1):(W.setMonth(0),W.setFullYear(W.getFullYear()+1))}return Pe=new Date(W.getFullYear()+1,0,4),be=ne(new Date(W.getFullYear(),0,4)),Pe=ne(Pe),0>=Q(be,W)?0>=Q(Pe,W)?W.getFullYear()+1:W.getFullYear():W.getFullYear()-1}var me=p()[L+40>>2>>>0];for(var Ie in L={Lc:p()[L>>2>>>0],Kc:p()[L+4>>2>>>0],dc:p()[L+8>>2>>>0],jc:p()[L+12>>2>>>0],ec:p()[L+16>>2>>>0],Xb:p()[L+20>>2>>>0],Tb:p()[L+24>>2>>>0],Wb:p()[L+28>>2>>>0],Rc:p()[L+32>>2>>>0],Jc:p()[L+36>>2>>>0],Mc:me?Se(me):""},I=Se(I),me={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"})I=I.replace(new RegExp(Ie,"g"),me[Ie]);var tt="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),Ze="January February March April May June July August September October November December".split(" ");for(Ie in me={"%a":function(W){return tt[W.Tb].substring(0,3)},"%A":function(W){return tt[W.Tb]},"%b":function(W){return Ze[W.ec].substring(0,3)},"%B":function(W){return Ze[W.ec]},"%C":function(W){return z((W.Xb+1900)/100|0,2)},"%d":function(W){return z(W.jc,2)},"%e":function(W){return B(W.jc,2," ")},"%g":function(W){return fe(W).toString().substring(2)},"%G":function(W){return fe(W)},"%H":function(W){return z(W.dc,2)},"%I":function(W){return(W=W.dc)==0?W=12:12W.dc?"AM":"PM"},"%S":function(W){return z(W.Lc,2)},"%t":function(){return" "},"%u":function(W){return W.Tb||7},"%U":function(W){return z(Math.floor((W.Wb+7-W.Tb)/7),2)},"%V":function(W){var be=Math.floor((W.Wb+7-(W.Tb+6)%7)/7);if(2>=(W.Tb+371-W.Wb-2)%7&&be++,be)be==53&&((Pe=(W.Tb+371-W.Wb)%7)==4||Pe==3&&Dt(W.Xb)||(be=1));else{be=52;var Pe=(W.Tb+7-W.Wb-1)%7;(Pe==4||Pe==5&&Dt(W.Xb%400-1))&&be++}return z(be,2)},"%w":function(W){return W.Tb},"%W":function(W){return z(Math.floor((W.Wb+7-(W.Tb+6)%7)/7),2)},"%y":function(W){return(W.Xb+1900).toString().substring(2)},"%Y":function(W){return W.Xb+1900},"%z":function(W){var be=0<=(W=W.Jc);return W=Math.abs(W)/60,(be?"+":"-")+("0000"+(W/60*100+W%60)).slice(-4)},"%Z":function(W){return W.Mc},"%%":function(){return"%"}},I=I.replace(/%%/g,"\0\0"),me)I.includes(Ie)&&(I=I.replace(new RegExp(Ie,"g"),me[Ie](L)));return Ie=function(W){var be=Array(Re(W)+1);return De(W,be,0,be.length),be}(I=I.replace(/\0\0/g,"%")),Ie.length>O?0:(function(W,be){s().set(W,be>>>0)}(Ie,S),Ie.length-1)}ie.fc();var Tn=[null,Ce,Et,et,gt,bt,dt,yt,_t,vt,wt,xt,ot,ht,Tt,M,R,j,H,ee,G,ge,Oe,Qe,st,zt],Sn={b:function(S){return $t(S+24)+24},n:function(S){return(S=new se(S)).uc()||(S.hc(!0),oe--),S.ic(!1),it.push(S),S.sc(),S.vc()},ma:function(S){throw U("Unexpected exception thrown, this is not properly supported - aborting"),_e=!0,S},x:function(){pe(0);var S=it.pop();if(S.Hc()&&!S.kc()){var O=S.Dc();O&&ye(O)(S.Zb),ft(S.Zb)}re=0},e:function(){var S=re;if(!S)return Ge=0;var O=new se(S);O.cc(S);var I=O.bc();if(!I)return Ge=0,S;for(var L=Array.prototype.slice.call(arguments),B=0;BN(L));else if(P)postMessage({targetThread:S,cmd:"processProxyingQueue",queue:L});else{if(!(S=ie.Vb[S]))return;S.postMessage({cmd:"processProxyingQueue",queue:L})}return 1},Ea:function(){return-1},Pa:function(S,O){S=new Date(1e3*V(S)),p()[O>>2>>>0]=S.getUTCSeconds(),p()[O+4>>2>>>0]=S.getUTCMinutes(),p()[O+8>>2>>>0]=S.getUTCHours(),p()[O+12>>2>>>0]=S.getUTCDate(),p()[O+16>>2>>>0]=S.getUTCMonth(),p()[O+20>>2>>>0]=S.getUTCFullYear()-1900,p()[O+24>>2>>>0]=S.getUTCDay(),S=(S.getTime()-Date.UTC(S.getUTCFullYear(),0,1,0,0,0,0))/864e5|0,p()[O+28>>2>>>0]=S},Qa:function(S,O){S=new Date(1e3*V(S)),p()[O>>2>>>0]=S.getSeconds(),p()[O+4>>2>>>0]=S.getMinutes(),p()[O+8>>2>>>0]=S.getHours(),p()[O+12>>2>>>0]=S.getDate(),p()[O+16>>2>>>0]=S.getMonth(),p()[O+20>>2>>>0]=S.getFullYear()-1900,p()[O+24>>2>>>0]=S.getDay();var I=new Date(S.getFullYear(),0,1),L=(S.getTime()-I.getTime())/864e5|0;p()[O+28>>2>>>0]=L,p()[O+36>>2>>>0]=-60*S.getTimezoneOffset(),L=new Date(S.getFullYear(),6,1).getTimezoneOffset(),S=0|(L!=(I=I.getTimezoneOffset())&&S.getTimezoneOffset()==Math.min(I,L)),p()[O+32>>2>>>0]=S},Ra:function(S){var O=new Date(p()[S+20>>2>>>0]+1900,p()[S+16>>2>>>0],p()[S+12>>2>>>0],p()[S+8>>2>>>0],p()[S+4>>2>>>0],p()[S>>2>>>0],0),I=p()[S+32>>2>>>0],L=O.getTimezoneOffset(),B=new Date(O.getFullYear(),0,1),z=new Date(O.getFullYear(),6,1).getTimezoneOffset(),Q=B.getTimezoneOffset(),ne=Math.min(Q,z);return 0>I?p()[S+32>>2>>>0]=+(z!=Q&&ne==L):0>2>>>0]=O.getDay(),I=(O.getTime()-B.getTime())/864e5|0,p()[S+28>>2>>>0]=I,p()[S>>2>>>0]=O.getSeconds(),p()[S+4>>2>>>0]=O.getMinutes(),p()[S+8>>2>>>0]=O.getHours(),p()[S+12>>2>>>0]=O.getDate(),p()[S+16>>2>>>0]=O.getMonth(),O.getTime()/1e3|0},Aa:j,Ba:H,Sa:function S(O,I,L){S.Ac||(S.Ac=!0,ee(O,I,L))},y:function(){le("")},U:function(){if(!x&&!E){var S="Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread";rt||(rt={}),rt[S]||(rt[S]=1,x&&(S="warning: "+S),U(S))}},ra:function(){return 4294901760},B:ct,Ia:function(S,O,I){h().copyWithin(S>>>0,O>>>0,O+I>>>0)},F:function(){return x?c(3993).cpus().length:navigator.hardwareConcurrency},Da:function(S,O,I){ve.length=O,I>>=3;for(var L=0;L>>0];return(0>S?It[-S-1]:Tn[S]).apply(null,ve)},qa:function(S){var O=h().length;if((S>>>=0)<=O||4294901760=I;I*=2){var L=O*(1+.2/I);L=Math.min(L,S+100663296);var B=Math;L=Math.max(S,L),B=B.min.call(B,4294901760,L+(65536-L%65536)%65536);e:{try{Y.grow(B-te.byteLength+65535>>>16),Ae(Y.buffer);var z=1;break e}catch{}z=void 0}if(z)return!0}return!1},Na:function(){throw"unwind"},Ga:G,Ha:ge,J:nt,I:Oe,S:Qe,ga:st,R:zt,d:function(){return Ge},na:function S(O,I){S.lc||(S.lc=function(){if(typeof crypto=="object"&&typeof crypto.getRandomValues=="function"){var B=new Uint8Array(1);return()=>(crypto.getRandomValues(B),B[0])}if(x)try{var z=c(Object(function(){var Q=new Error("Cannot find module 'crypto'");throw Q.code="MODULE_NOT_FOUND",Q}()));return()=>z.randomBytes(1)[0]}catch{}return()=>le("randomDevice")}());for(var L=0;L>0>>>0]=S.lc();return 0},ia:function(S,O,I){var L=de();try{return ye(S)(O,I)}catch(B){if(ce(L),B!==B+0)throw B;pe(1,0)}},ja:function(S,O,I){var L=de();try{return ye(S)(O,I)}catch(B){if(ce(L),B!==B+0)throw B;pe(1,0)}},K:function(S){var O=de();try{return ye(S)()}catch(I){if(ce(O),I!==I+0)throw I;pe(1,0)}},f:function(S,O){var I=de();try{return ye(S)(O)}catch(L){if(ce(I),L!==L+0)throw L;pe(1,0)}},P:function(S,O,I){var L=de();try{return ye(S)(O,I)}catch(B){if(ce(L),B!==B+0)throw B;pe(1,0)}},Q:function(S,O,I){var L=de();try{return ye(S)(O,I)}catch(B){if(ce(L),B!==B+0)throw B;pe(1,0)}},k:function(S,O,I){var L=de();try{return ye(S)(O,I)}catch(B){if(ce(L),B!==B+0)throw B;pe(1,0)}},p:function(S,O,I,L){var B=de();try{return ye(S)(O,I,L)}catch(z){if(ce(B),z!==z+0)throw z;pe(1,0)}},q:function(S,O,I,L,B){var z=de();try{return ye(S)(O,I,L,B)}catch(Q){if(ce(z),Q!==Q+0)throw Q;pe(1,0)}},N:function(S,O,I,L,B,z){var Q=de();try{return ye(S)(O,I,L,B,z)}catch(ne){if(ce(Q),ne!==ne+0)throw ne;pe(1,0)}},s:function(S,O,I,L,B,z){var Q=de();try{return ye(S)(O,I,L,B,z)}catch(ne){if(ce(Q),ne!==ne+0)throw ne;pe(1,0)}},w:function(S,O,I,L,B,z,Q){var ne=de();try{return ye(S)(O,I,L,B,z,Q)}catch(fe){if(ce(ne),fe!==fe+0)throw fe;pe(1,0)}},L:function(S,O,I,L,B,z,Q,ne){var fe=de();try{return ye(S)(O,I,L,B,z,Q,ne)}catch(me){if(ce(fe),me!==me+0)throw me;pe(1,0)}},E:function(S,O,I,L,B,z,Q,ne,fe,me,Ie,tt){var Ze=de();try{return ye(S)(O,I,L,B,z,Q,ne,fe,me,Ie,tt)}catch(W){if(ce(Ze),W!==W+0)throw W;pe(1,0)}},aa:function(S,O,I,L,B,z,Q,ne){var fe=de();try{return dn(S,O,I,L,B,z,Q,ne)}catch(me){if(ce(fe),me!==me+0)throw me;pe(1,0)}},_:function(S,O,I,L,B,z,Q){var ne=de();try{return rn(S,O,I,L,B,z,Q)}catch(fe){if(ce(ne),fe!==fe+0)throw fe;pe(1,0)}},Z:function(S,O,I,L,B){var z=de();try{return hn(S,O,I,L,B)}catch(Q){if(ce(z),Q!==Q+0)throw Q;pe(1,0)}},ca:function(S,O,I,L){var B=de();try{return ln(S,O,I,L)}catch(z){if(ce(B),z!==z+0)throw z;pe(1,0)}},$:function(S){var O=de();try{return nn(S)}catch(I){if(ce(O),I!==I+0)throw I;pe(1,0)}},ba:function(S,O){var I=de();try{return cn(S,O)}catch(L){if(ce(I),L!==L+0)throw L;pe(1,0)}},Y:function(S,O,I){var L=de();try{return on(S,O,I)}catch(B){if(ce(L),B!==B+0)throw B;pe(1,0)}},g:function(S){var O=de();try{ye(S)()}catch(I){if(ce(O),I!==I+0)throw I;pe(1,0)}},r:function(S,O){var I=de();try{ye(S)(O)}catch(L){if(ce(I),L!==L+0)throw L;pe(1,0)}},i:function(S,O,I){var L=de();try{ye(S)(O,I)}catch(B){if(ce(L),B!==B+0)throw B;pe(1,0)}},ha:function(S,O,I,L){var B=de();try{ye(S)(O,I,L)}catch(z){if(ce(B),z!==z+0)throw z;pe(1,0)}},m:function(S,O,I,L){var B=de();try{ye(S)(O,I,L)}catch(z){if(ce(B),z!==z+0)throw z;pe(1,0)}},v:function(S,O,I,L,B){var z=de();try{ye(S)(O,I,L,B)}catch(Q){if(ce(z),Q!==Q+0)throw Q;pe(1,0)}},u:function(S,O,I,L,B,z){var Q=de();try{ye(S)(O,I,L,B,z)}catch(ne){if(ce(Q),ne!==ne+0)throw ne;pe(1,0)}},O:function(S,O,I,L,B,z,Q){var ne=de();try{ye(S)(O,I,L,B,z,Q)}catch(fe){if(ce(ne),fe!==fe+0)throw fe;pe(1,0)}},A:function(S,O,I,L,B,z,Q,ne){var fe=de();try{ye(S)(O,I,L,B,z,Q,ne)}catch(me){if(ce(fe),me!==me+0)throw me;pe(1,0)}},ka:function(S,O,I,L,B,z,Q,ne,fe){var me=de();try{ye(S)(O,I,L,B,z,Q,ne,fe)}catch(Ie){if(ce(me),Ie!==Ie+0)throw Ie;pe(1,0)}},C:function(S,O,I,L,B,z,Q,ne,fe,me,Ie){var tt=de();try{ye(S)(O,I,L,B,z,Q,ne,fe,me,Ie)}catch(Ze){if(ce(tt),Ze!==Ze+0)throw Ze;pe(1,0)}},D:function(S,O,I,L,B,z,Q,ne,fe,me,Ie,tt,Ze,W,be,Pe){var at=de();try{ye(S)(O,I,L,B,z,Q,ne,fe,me,Ie,tt,Ze,W,be,Pe)}catch(Ot){if(ce(at),Ot!==Ot+0)throw Ot;pe(1,0)}},fa:function(S,O,I,L,B,z,Q,ne){var fe=de();try{sn(S,O,I,L,B,z,Q,ne)}catch(me){if(ce(fe),me!==me+0)throw me;pe(1,0)}},da:function(S,O,I,L,B,z,Q,ne,fe,me,Ie,tt){var Ze=de();try{un(S,O,I,L,B,z,Q,ne,fe,me,Ie,tt)}catch(W){if(ce(Ze),W!==W+0)throw W;pe(1,0)}},ea:function(S,O,I,L,B,z){var Q=de();try{an(S,O,I,L,B,z)}catch(ne){if(ce(Q),ne!==ne+0)throw ne;pe(1,0)}},o:function(S){return S},a:Y||t.wasmMemory,G:function(S){Ge=S},la:Wt,z:function(S,O,I,L){return Wt(S,O,I,L)}};(function(){function S(B,z){t.asm=B.exports,ie.qc.push(t.asm.sb),ke=t.asm.ub,Be.unshift(t.asm.Va),Z=z,P||($e--,t.monitorRunDependencies&&t.monitorRunDependencies($e),$e==0&&Ye&&(B=Ye,Ye=null,B()))}function O(B){S(B.instance,B.module)}function I(B){return function(){if(!q&&(A||E)){if(typeof fetch=="function"&&!Ee.startsWith("file://"))return fetch(Ee,{credentials:"same-origin"}).then(function(z){if(!z.ok)throw"failed to load wasm binary file at '"+Ee+"'";return z.arrayBuffer()}).catch(function(){return ut()});if(u)return new Promise(function(z,Q){u(Ee,function(ne){z(new Uint8Array(ne))},Q)})}return Promise.resolve().then(function(){return ut()})}().then(function(z){return WebAssembly.instantiate(z,L)}).then(function(z){return z}).then(B,function(z){U("failed to asynchronously prepare wasm: "+z),le(z)})}var L={a:Sn};if(P||($e++,t.monitorRunDependencies&&t.monitorRunDependencies($e)),t.instantiateWasm)try{return t.instantiateWasm(L,S)}catch(B){return U("Module.instantiateWasm callback failed with error: "+B),!1}(q||typeof WebAssembly.instantiateStreaming!="function"||pt()||Ee.startsWith("file://")||x||typeof fetch!="function"?I(O):fetch(Ee,{credentials:"same-origin"}).then(function(B){return WebAssembly.instantiateStreaming(B,L).then(O,function(z){return U("wasm streaming compile failed: "+z),U("falling back to ArrayBuffer instantiation"),I(O)})})).catch(n)})(),t.___wasm_call_ctors=function(){return(t.___wasm_call_ctors=t.asm.Va).apply(null,arguments)},t._OrtInit=function(){return(t._OrtInit=t.asm.Wa).apply(null,arguments)},t._OrtCreateSessionOptions=function(){return(t._OrtCreateSessionOptions=t.asm.Xa).apply(null,arguments)},t._OrtAppendExecutionProvider=function(){return(t._OrtAppendExecutionProvider=t.asm.Ya).apply(null,arguments)},t._OrtAddSessionConfigEntry=function(){return(t._OrtAddSessionConfigEntry=t.asm.Za).apply(null,arguments)},t._OrtReleaseSessionOptions=function(){return(t._OrtReleaseSessionOptions=t.asm._a).apply(null,arguments)},t._OrtCreateSession=function(){return(t._OrtCreateSession=t.asm.$a).apply(null,arguments)},t._OrtReleaseSession=function(){return(t._OrtReleaseSession=t.asm.ab).apply(null,arguments)},t._OrtGetInputCount=function(){return(t._OrtGetInputCount=t.asm.bb).apply(null,arguments)},t._OrtGetOutputCount=function(){return(t._OrtGetOutputCount=t.asm.cb).apply(null,arguments)},t._OrtGetInputName=function(){return(t._OrtGetInputName=t.asm.db).apply(null,arguments)},t._OrtGetOutputName=function(){return(t._OrtGetOutputName=t.asm.eb).apply(null,arguments)},t._OrtFree=function(){return(t._OrtFree=t.asm.fb).apply(null,arguments)},t._OrtCreateTensor=function(){return(t._OrtCreateTensor=t.asm.gb).apply(null,arguments)},t._OrtGetTensorData=function(){return(t._OrtGetTensorData=t.asm.hb).apply(null,arguments)},t._OrtReleaseTensor=function(){return(t._OrtReleaseTensor=t.asm.ib).apply(null,arguments)},t._OrtCreateRunOptions=function(){return(t._OrtCreateRunOptions=t.asm.jb).apply(null,arguments)},t._OrtAddRunConfigEntry=function(){return(t._OrtAddRunConfigEntry=t.asm.kb).apply(null,arguments)},t._OrtReleaseRunOptions=function(){return(t._OrtReleaseRunOptions=t.asm.lb).apply(null,arguments)},t._OrtRun=function(){return(t._OrtRun=t.asm.mb).apply(null,arguments)},t._OrtEndProfiling=function(){return(t._OrtEndProfiling=t.asm.nb).apply(null,arguments)};var Ct=t._pthread_self=function(){return(Ct=t._pthread_self=t.asm.ob).apply(null,arguments)},$t=t._malloc=function(){return($t=t._malloc=t.asm.pb).apply(null,arguments)},qt=t._free=function(){return(qt=t._free=t.asm.qb).apply(null,arguments)},Yt=t._fflush=function(){return(Yt=t._fflush=t.asm.rb).apply(null,arguments)};t.__emscripten_tls_init=function(){return(t.__emscripten_tls_init=t.asm.sb).apply(null,arguments)};var Xt=t.___funcs_on_exit=function(){return(Xt=t.___funcs_on_exit=t.asm.tb).apply(null,arguments)},Qt=t.__emscripten_thread_init=function(){return(Qt=t.__emscripten_thread_init=t.asm.vb).apply(null,arguments)};t.__emscripten_thread_crashed=function(){return(t.__emscripten_thread_crashed=t.asm.wb).apply(null,arguments)};var Lt,Zt=t._emscripten_run_in_main_runtime_thread_js=function(){return(Zt=t._emscripten_run_in_main_runtime_thread_js=t.asm.xb).apply(null,arguments)},Kt=t.__emscripten_proxy_execute_task_queue=function(){return(Kt=t.__emscripten_proxy_execute_task_queue=t.asm.yb).apply(null,arguments)},Ut=t.__emscripten_thread_free_data=function(){return(Ut=t.__emscripten_thread_free_data=t.asm.zb).apply(null,arguments)},Jt=t.__emscripten_thread_exit=function(){return(Jt=t.__emscripten_thread_exit=t.asm.Ab).apply(null,arguments)},pe=t._setThrew=function(){return(pe=t._setThrew=t.asm.Bb).apply(null,arguments)},en=t._emscripten_stack_set_limits=function(){return(en=t._emscripten_stack_set_limits=t.asm.Cb).apply(null,arguments)},de=t.stackSave=function(){return(de=t.stackSave=t.asm.Db).apply(null,arguments)},ce=t.stackRestore=function(){return(ce=t.stackRestore=t.asm.Eb).apply(null,arguments)},Bt=t.stackAlloc=function(){return(Bt=t.stackAlloc=t.asm.Fb).apply(null,arguments)},Nt=t.___cxa_can_catch=function(){return(Nt=t.___cxa_can_catch=t.asm.Gb).apply(null,arguments)},tn=t.___cxa_is_pointer_type=function(){return(tn=t.___cxa_is_pointer_type=t.asm.Hb).apply(null,arguments)},nn=t.dynCall_j=function(){return(nn=t.dynCall_j=t.asm.Ib).apply(null,arguments)},rn=t.dynCall_iiiiij=function(){return(rn=t.dynCall_iiiiij=t.asm.Jb).apply(null,arguments)},on=t.dynCall_jii=function(){return(on=t.dynCall_jii=t.asm.Kb).apply(null,arguments)},sn=t.dynCall_viiiiij=function(){return(sn=t.dynCall_viiiiij=t.asm.Lb).apply(null,arguments)},an=t.dynCall_vjji=function(){return(an=t.dynCall_vjji=t.asm.Mb).apply(null,arguments)},un=t.dynCall_viiijjjii=function(){return(un=t.dynCall_viiijjjii=t.asm.Nb).apply(null,arguments)},ln=t.dynCall_iij=function(){return(ln=t.dynCall_iij=t.asm.Ob).apply(null,arguments)},cn=t.dynCall_ji=function(){return(cn=t.dynCall_ji=t.asm.Pb).apply(null,arguments)},dn=t.dynCall_iiiiiij=function(){return(dn=t.dynCall_iiiiiij=t.asm.Qb).apply(null,arguments)},hn=t.dynCall_iiij=function(){return(hn=t.dynCall_iiij=t.asm.Rb).apply(null,arguments)};function pn(){function S(){if(!Lt&&(Lt=!0,t.calledRun=!0,!_e)&&(P||Je(Be),e(t),t.onRuntimeInitialized&&t.onRuntimeInitialized(),!P)){if(t.postRun)for(typeof t.postRun=="function"&&(t.postRun=[t.postRun]);t.postRun.length;){var O=t.postRun.shift();qe.unshift(O)}Je(qe)}}if(!(0<$e))if(P)e(t),P||Je(Be),postMessage({cmd:"loaded"});else{if(t.preRun)for(typeof t.preRun=="function"&&(t.preRun=[t.preRun]);t.preRun.length;)Ve();Je(Ue),0<$e||(t.setStatus?(t.setStatus("Running..."),setTimeout(function(){setTimeout(function(){t.setStatus("")},1),S()},1)):S())}}if(t.UTF8ToString=Se,t.stringToUTF8=function(S,O,I){return De(S,h(),O,I)},t.lengthBytesUTF8=Re,t.keepRuntimeAlive=je,t.wasmMemory=Y,t.stackSave=de,t.stackRestore=ce,t.stackAlloc=Bt,t.ExitStatus=Ke,t.PThread=ie,Ye=function S(){Lt||pn(),Lt||(Ye=S)},t.preInit)for(typeof t.preInit=="function"&&(t.preInit=[t.preInit]);0{var d,l=(d=(d=typeof document<"u"&&document.currentScript?document.currentScript.src:void 0)||"/index.js",function(m){var s,h,p;m=m||{},s||(s=m!==void 0?m:{}),s.ready=new Promise(function(M,R){h=M,p=R});var a,o,t,e,n,i,u=Object.assign({},s),g="./this.program",b=(M,R)=>{throw R},y=typeof window=="object",_=typeof importScripts=="function",v=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",w="";v?(w=_?c(908).dirname(w)+"/":"//",i=()=>{n||(e=c(1384),n=c(908))},a=function(M,R){return i(),M=n.normalize(M),e.readFileSync(M,R?void 0:"utf8")},t=M=>((M=a(M,!0)).buffer||(M=new Uint8Array(M)),M),o=(M,R,N)=>{i(),M=n.normalize(M),e.readFile(M,function(V,j){V?N(V):R(j.buffer)})},1{if(x||0{var R=new XMLHttpRequest;return R.open("GET",M,!1),R.send(null),R.responseText},_&&(t=M=>{var R=new XMLHttpRequest;return R.open("GET",M,!1),R.responseType="arraybuffer",R.send(null),new Uint8Array(R.response)}),o=(M,R,N)=>{var V=new XMLHttpRequest;V.open("GET",M,!0),V.responseType="arraybuffer",V.onload=()=>{V.status==200||V.status==0&&V.response?R(V.response):N()},V.onerror=N,V.send(null)});var T,A=s.print||console.log.bind(console),E=s.printErr||console.warn.bind(console);Object.assign(s,u),u=null,s.thisProgram&&(g=s.thisProgram),s.quit&&(b=s.quit),s.wasmBinary&&(T=s.wasmBinary);var x=s.noExitRuntime||!1;typeof WebAssembly!="object"&&Ae("no native wasm support detected");var P,C,k,$,F,q,D=!1,U=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function J(M,R,N){var V=(R>>>=0)+N;for(N=R;M[N]&&!(N>=V);)++N;if(16(j=(240&j)==224?(15&j)<<12|H<<6|X:(7&j)<<18|H<<12|X<<6|63&M[R++])?V+=String.fromCharCode(j):(j-=65536,V+=String.fromCharCode(55296|j>>10,56320|1023&j))}}else V+=String.fromCharCode(j)}return V}function Y(M,R){return(M>>>=0)?J($,M,R):""}function Z(M,R,N,V){if(!(0>>=0;V=N+V-1;for(var H=0;H=X&&(X=65536+((1023&X)<<10)|1023&M.charCodeAt(++H)),127>=X){if(N>=V)break;R[N++>>>0]=X}else{if(2047>=X){if(N+1>=V)break;R[N++>>>0]=192|X>>6}else{if(65535>=X){if(N+2>=V)break;R[N++>>>0]=224|X>>12}else{if(N+3>=V)break;R[N++>>>0]=240|X>>18,R[N++>>>0]=128|X>>12&63}R[N++>>>0]=128|X>>6&63}R[N++>>>0]=128|63&X}}return R[N>>>0]=0,N-j}function te(M){for(var R=0,N=0;N=V?R++:2047>=V?R+=2:55296<=V&&57343>=V?(R+=4,++N):R+=3}return R}function he(){var M=P.buffer;C=M,s.HEAP8=k=new Int8Array(M),s.HEAP16=new Int16Array(M),s.HEAP32=F=new Int32Array(M),s.HEAPU8=$=new Uint8Array(M),s.HEAPU16=new Uint16Array(M),s.HEAPU32=q=new Uint32Array(M),s.HEAPF32=new Float32Array(M),s.HEAPF64=new Float64Array(M)}var Me,Te=[],ue=[],xe=[],_e=[],Le=0;function ze(){var M=s.preRun.shift();Te.unshift(M)}var Se,De=0,Re=null;function Ae(M){throw s.onAbort&&s.onAbort(M),E(M="Aborted("+M+")"),D=!0,M=new WebAssembly.RuntimeError(M+". Build with -sASSERTIONS for more info."),p(M),M}function we(){return Se.startsWith("data:application/octet-stream;base64,")}if(Se="ort-wasm.wasm",!we()){var ke=Se;Se=s.locateFile?s.locateFile(ke,w):w+ke}function Ue(){var M=Se;try{if(M==Se&&T)return new Uint8Array(T);if(t)return t(M);throw"both async and sync fetching of the wasm failed"}catch(R){Ae(R)}}function Be(M){this.name="ExitStatus",this.message="Program terminated with exit("+M+")",this.status=M}function We(M){for(;0>2>>>0]=R},this.Eb=function(){return q[this.zb+4>>2>>>0]},this.Sb=function(R){q[this.zb+8>>2>>>0]=R},this.Wb=function(){return q[this.zb+8>>2>>>0]},this.Tb=function(){F[this.zb>>2>>>0]=0},this.Ib=function(R){k[this.zb+12>>0>>>0]=R?1:0},this.Pb=function(){return k[this.zb+12>>0>>>0]!=0},this.Jb=function(R){k[this.zb+13>>0>>>0]=R?1:0},this.Lb=function(){return k[this.zb+13>>0>>>0]!=0},this.Rb=function(R,N){this.Fb(0),this.Ub(R),this.Sb(N),this.Tb(),this.Ib(!1),this.Jb(!1)},this.Nb=function(){F[this.zb>>2>>>0]+=1},this.Xb=function(){var R=F[this.zb>>2>>>0];return F[this.zb>>2>>>0]=R-1,R===1},this.Fb=function(R){q[this.zb+16>>2>>>0]=R},this.Ob=function(){return q[this.zb+16>>2>>>0]},this.Qb=function(){if(mt(this.Eb()))return q[this.Db>>2>>>0];var R=this.Ob();return R!==0?R:this.Db}}function $e(M){return rt(new Ee(M).zb)}var Ye=[];function le(M){var R=Ye[M];return R||(M>=Ye.length&&(Ye.length=M+1),Ye[M]=R=Me.get(M)),R}function pt(M){var R=te(M)+1,N=ye(R);return N&&Z(M,k,N,R),N}var ut={};function It(){if(!Ke){var M,R={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:g||"./this.program"};for(M in ut)ut[M]===void 0?delete R[M]:R[M]=ut[M];var N=[];for(M in R)N.push(M+"="+R[M]);Ke=N}return Ke}var Ke,He=[null,[],[]];function lt(M,R){var N=He[M];R===0||R===10?((M===1?A:E)(J(N,0)),N.length=0):N.push(R)}var Ce=0;function nt(M){return M%4==0&&(M%100!=0||M%400==0)}var ie=[31,29,31,30,31,30,31,31,30,31,30,31],Je=[31,28,31,30,31,30,31,31,30,31,30,31];function At(M,R,N,V){function j(G,ge,Oe){for(G=typeof G=="number"?G.toString():G||"";G.lengthst?-1:0Qe-G.getDate())){G.setDate(G.getDate()+ge);break}ge-=Qe-G.getDate()+1,G.setDate(1),11>Oe?G.setMonth(Oe+1):(G.setMonth(0),G.setFullYear(G.getFullYear()+1))}return Oe=new Date(G.getFullYear()+1,0,4),ge=ee(new Date(G.getFullYear(),0,4)),Oe=ee(Oe),0>=X(ge,G)?0>=X(Oe,G)?G.getFullYear()+1:G.getFullYear():G.getFullYear()-1}var ae=F[V+40>>2>>>0];for(var ve in V={$b:F[V>>2>>>0],Zb:F[V+4>>2>>>0],Gb:F[V+8>>2>>>0],Kb:F[V+12>>2>>>0],Hb:F[V+16>>2>>>0],Cb:F[V+20>>2>>>0],Ab:F[V+24>>2>>>0],Bb:F[V+28>>2>>>0],bc:F[V+32>>2>>>0],Yb:F[V+36>>2>>>0],ac:ae?Y(ae):""},N=Y(N),ae={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"})N=N.replace(new RegExp(ve,"g"),ae[ve]);var Fe="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),Ne="January February March April May June July August September October November December".split(" ");for(ve in ae={"%a":function(G){return Fe[G.Ab].substring(0,3)},"%A":function(G){return Fe[G.Ab]},"%b":function(G){return Ne[G.Hb].substring(0,3)},"%B":function(G){return Ne[G.Hb]},"%C":function(G){return H((G.Cb+1900)/100|0,2)},"%d":function(G){return H(G.Kb,2)},"%e":function(G){return j(G.Kb,2," ")},"%g":function(G){return K(G).toString().substring(2)},"%G":function(G){return K(G)},"%H":function(G){return H(G.Gb,2)},"%I":function(G){return(G=G.Gb)==0?G=12:12G.Gb?"AM":"PM"},"%S":function(G){return H(G.$b,2)},"%t":function(){return" "},"%u":function(G){return G.Ab||7},"%U":function(G){return H(Math.floor((G.Bb+7-G.Ab)/7),2)},"%V":function(G){var ge=Math.floor((G.Bb+7-(G.Ab+6)%7)/7);if(2>=(G.Ab+371-G.Bb-2)%7&&ge++,ge)ge==53&&((Oe=(G.Ab+371-G.Bb)%7)==4||Oe==3&&nt(G.Cb)||(ge=1));else{ge=52;var Oe=(G.Ab+7-G.Bb-1)%7;(Oe==4||Oe==5&&nt(G.Cb%400-1))&&ge++}return H(ge,2)},"%w":function(G){return G.Ab},"%W":function(G){return H(Math.floor((G.Bb+7-(G.Ab+6)%7)/7),2)},"%y":function(G){return(G.Cb+1900).toString().substring(2)},"%Y":function(G){return G.Cb+1900},"%z":function(G){var ge=0<=(G=G.Yb);return G=Math.abs(G)/60,(ge?"+":"-")+("0000"+(G/60*100+G%60)).slice(-4)},"%Z":function(G){return G.ac},"%%":function(){return"%"}},N=N.replace(/%%/g,"\0\0"),ae)N.includes(ve)&&(N=N.replace(new RegExp(ve,"g"),ae[ve](V)));return ve=function(G){var ge=Array(te(G)+1);return Z(G,ge,0,ge.length),ge}(N=N.replace(/\0\0/g,"%")),ve.length>R?0:(k.set(ve,M>>>0),ve.length-1)}var Et={a:function(M){return ye(M+24)+24},m:function(M){return(M=new Ee(M)).Pb()||(M.Ib(!0),je--),M.Jb(!1),qe.push(M),M.Nb(),M.Qb()},ia:function(M){throw E("Unexpected exception thrown, this is not properly supported - aborting"),D=!0,M},w:function(){oe(0);var M=qe.pop();if(M.Xb()&&!M.Lb()){var R=M.Wb();R&&le(R)(M.Db),$e(M.Db)}Ve=0},d:function(){var M=Ve;if(!M)return Ce=0;var R=new Ee(M);R.Fb(M);var N=R.Eb();if(!N)return Ce=0,M;for(var V=Array.prototype.slice.call(arguments),j=0;j>>2]+4294967296*F[M+4>>>2])),F[R>>2>>>0]=M.getUTCSeconds(),F[R+4>>2>>>0]=M.getUTCMinutes(),F[R+8>>2>>>0]=M.getUTCHours(),F[R+12>>2>>>0]=M.getUTCDate(),F[R+16>>2>>>0]=M.getUTCMonth(),F[R+20>>2>>>0]=M.getUTCFullYear()-1900,F[R+24>>2>>>0]=M.getUTCDay(),F[R+28>>2>>>0]=(M.getTime()-Date.UTC(M.getUTCFullYear(),0,1,0,0,0,0))/864e5|0},Ea:function(M,R){M=new Date(1e3*(q[M>>>2]+4294967296*F[M+4>>>2])),F[R>>2>>>0]=M.getSeconds(),F[R+4>>2>>>0]=M.getMinutes(),F[R+8>>2>>>0]=M.getHours(),F[R+12>>2>>>0]=M.getDate(),F[R+16>>2>>>0]=M.getMonth(),F[R+20>>2>>>0]=M.getFullYear()-1900,F[R+24>>2>>>0]=M.getDay();var N=new Date(M.getFullYear(),0,1);F[R+28>>2>>>0]=(M.getTime()-N.getTime())/864e5|0,F[R+36>>2>>>0]=-60*M.getTimezoneOffset();var V=new Date(M.getFullYear(),6,1).getTimezoneOffset();N=N.getTimezoneOffset(),F[R+32>>2>>>0]=0|(V!=N&&M.getTimezoneOffset()==Math.min(N,V))},Fa:function(M){var R=new Date(F[M+20>>2>>>0]+1900,F[M+16>>2>>>0],F[M+12>>2>>>0],F[M+8>>2>>>0],F[M+4>>2>>>0],F[M>>2>>>0],0),N=F[M+32>>2>>>0],V=R.getTimezoneOffset(),j=new Date(R.getFullYear(),0,1),H=new Date(R.getFullYear(),6,1).getTimezoneOffset(),X=j.getTimezoneOffset(),ee=Math.min(X,H);return 0>N?F[M+32>>2>>>0]=+(H!=X&&ee==V):0>2>>>0]=R.getDay(),F[M+28>>2>>>0]=(R.getTime()-j.getTime())/864e5|0,F[M>>2>>>0]=R.getSeconds(),F[M+4>>2>>>0]=R.getMinutes(),F[M+8>>2>>>0]=R.getHours(),F[M+12>>2>>>0]=R.getDate(),F[M+16>>2>>>0]=R.getMonth(),R.getTime()/1e3|0},sa:function(){return-52},ta:function(){},Ga:function M(R,N,V){M.Vb||(M.Vb=!0,function(j,H,X){function ee(Ne){return(Ne=Ne.toTimeString().match(/\(([A-Za-z ]+)\)$/))?Ne[1]:"GMT"}var K=new Date().getFullYear(),ae=new Date(K,0,1),ve=new Date(K,6,1);K=ae.getTimezoneOffset();var Fe=ve.getTimezoneOffset();F[j>>2>>>0]=60*Math.max(K,Fe),F[H>>2>>>0]=+(K!=Fe),j=ee(ae),H=ee(ve),j=pt(j),H=pt(H),Fe>2>>>0]=j,q[X+4>>2>>>0]=H):(q[X>>2>>>0]=H,q[X+4>>2>>>0]=j)}(R,N,V))},B:function(){Ae("")},ma:function(){return 4294901760},I:v?()=>{var M=process.hrtime();return 1e3*M[0]+M[1]/1e6}:()=>performance.now(),xa:function(M,R,N){$.copyWithin(M>>>0,R>>>0,R+N>>>0)},G:function(M){var R=$.length;if(4294901760<(M>>>=0))return!1;for(var N=1;4>=N;N*=2){var V=R*(1+.2/N);V=Math.min(V,M+100663296);var j=Math;V=Math.max(M,V),j=j.min.call(j,4294901760,V+(65536-V%65536)%65536);e:{try{P.grow(j-C.byteLength+65535>>>16),he();var H=1;break e}catch{}H=void 0}if(H)return!0}return!1},va:function(M,R){var N=0;return It().forEach(function(V,j){var H=R+N;for(j=q[M+4*j>>2>>>0]=H,H=0;H>0>>>0]=V.charCodeAt(H);k[j>>0>>>0]=0,N+=V.length+1}),0},wa:function(M,R){var N=It();q[M>>2>>>0]=N.length;var V=0;return N.forEach(function(j){V+=j.length+1}),q[R>>2>>>0]=V,0},ba:function(M){x||0>2>>>0],ee=q[R+4>>2>>>0];R+=8;for(var K=0;K>>0]);j+=ee}return q[V>>2>>>0]=j,0},c:function(){return Ce},ja:function M(R,N){M.Mb||(M.Mb=function(){if(typeof crypto=="object"&&typeof crypto.getRandomValues=="function"){var j=new Uint8Array(1);return()=>(crypto.getRandomValues(j),j[0])}if(v)try{var H=c(Object(function(){var X=new Error("Cannot find module 'crypto'");throw X.code="MODULE_NOT_FOUND",X}()));return()=>H.randomBytes(1)[0]}catch{}return()=>Ae("randomDevice")}());for(var V=0;V>0>>>0]=M.Mb();return 0},ea:function(M,R,N){var V=re();try{return le(M)(R,N)}catch(j){if(se(V),j!==j+0)throw j;oe(1,0)}},fa:function(M,R,N){var V=re();try{return le(M)(R,N)}catch(j){if(se(V),j!==j+0)throw j;oe(1,0)}},J:function(M){var R=re();try{return le(M)()}catch(N){if(se(R),N!==N+0)throw N;oe(1,0)}},e:function(M,R){var N=re();try{return le(M)(R)}catch(V){if(se(N),V!==V+0)throw V;oe(1,0)}},N:function(M,R,N){var V=re();try{return le(M)(R,N)}catch(j){if(se(V),j!==j+0)throw j;oe(1,0)}},O:function(M,R,N){var V=re();try{return le(M)(R,N)}catch(j){if(se(V),j!==j+0)throw j;oe(1,0)}},j:function(M,R,N){var V=re();try{return le(M)(R,N)}catch(j){if(se(V),j!==j+0)throw j;oe(1,0)}},o:function(M,R,N,V){var j=re();try{return le(M)(R,N,V)}catch(H){if(se(j),H!==H+0)throw H;oe(1,0)}},p:function(M,R,N,V,j){var H=re();try{return le(M)(R,N,V,j)}catch(X){if(se(H),X!==X+0)throw X;oe(1,0)}},M:function(M,R,N,V,j,H){var X=re();try{return le(M)(R,N,V,j,H)}catch(ee){if(se(X),ee!==ee+0)throw ee;oe(1,0)}},r:function(M,R,N,V,j,H){var X=re();try{return le(M)(R,N,V,j,H)}catch(ee){if(se(X),ee!==ee+0)throw ee;oe(1,0)}},v:function(M,R,N,V,j,H,X){var ee=re();try{return le(M)(R,N,V,j,H,X)}catch(K){if(se(ee),K!==K+0)throw K;oe(1,0)}},K:function(M,R,N,V,j,H,X,ee){var K=re();try{return le(M)(R,N,V,j,H,X,ee)}catch(ae){if(se(K),ae!==ae+0)throw ae;oe(1,0)}},D:function(M,R,N,V,j,H,X,ee,K,ae,ve,Fe){var Ne=re();try{return le(M)(R,N,V,j,H,X,ee,K,ae,ve,Fe)}catch(G){if(se(Ne),G!==G+0)throw G;oe(1,0)}},X:function(M,R,N,V,j,H,X,ee){var K=re();try{return ot(M,R,N,V,j,H,X,ee)}catch(ae){if(se(K),ae!==ae+0)throw ae;oe(1,0)}},V:function(M,R,N,V,j,H,X){var ee=re();try{return bt(M,R,N,V,j,H,X)}catch(K){if(se(ee),K!==K+0)throw K;oe(1,0)}},U:function(M,R,N,V,j){var H=re();try{return ht(M,R,N,V,j)}catch(X){if(se(H),X!==X+0)throw X;oe(1,0)}},Z:function(M,R,N,V){var j=re();try{return wt(M,R,N,V)}catch(H){if(se(j),H!==H+0)throw H;oe(1,0)}},W:function(M){var R=re();try{return gt(M)}catch(N){if(se(R),N!==N+0)throw N;oe(1,0)}},Y:function(M,R){var N=re();try{return xt(M,R)}catch(V){if(se(N),V!==V+0)throw V;oe(1,0)}},T:function(M,R,N){var V=re();try{return dt(M,R,N)}catch(j){if(se(V),j!==j+0)throw j;oe(1,0)}},f:function(M){var R=re();try{le(M)()}catch(N){if(se(R),N!==N+0)throw N;oe(1,0)}},q:function(M,R){var N=re();try{le(M)(R)}catch(V){if(se(N),V!==V+0)throw V;oe(1,0)}},h:function(M,R,N){var V=re();try{le(M)(R,N)}catch(j){if(se(V),j!==j+0)throw j;oe(1,0)}},da:function(M,R,N,V){var j=re();try{le(M)(R,N,V)}catch(H){if(se(j),H!==H+0)throw H;oe(1,0)}},l:function(M,R,N,V){var j=re();try{le(M)(R,N,V)}catch(H){if(se(j),H!==H+0)throw H;oe(1,0)}},t:function(M,R,N,V,j){var H=re();try{le(M)(R,N,V,j)}catch(X){if(se(H),X!==X+0)throw X;oe(1,0)}},u:function(M,R,N,V,j,H){var X=re();try{le(M)(R,N,V,j,H)}catch(ee){if(se(X),ee!==ee+0)throw ee;oe(1,0)}},x:function(M,R,N,V,j,H,X){var ee=re();try{le(M)(R,N,V,j,H,X)}catch(K){if(se(ee),K!==K+0)throw K;oe(1,0)}},z:function(M,R,N,V,j,H,X,ee){var K=re();try{le(M)(R,N,V,j,H,X,ee)}catch(ae){if(se(K),ae!==ae+0)throw ae;oe(1,0)}},ga:function(M,R,N,V,j,H,X,ee,K){var ae=re();try{le(M)(R,N,V,j,H,X,ee,K)}catch(ve){if(se(ae),ve!==ve+0)throw ve;oe(1,0)}},A:function(M,R,N,V,j,H,X,ee,K,ae,ve){var Fe=re();try{le(M)(R,N,V,j,H,X,ee,K,ae,ve)}catch(Ne){if(se(Fe),Ne!==Ne+0)throw Ne;oe(1,0)}},C:function(M,R,N,V,j,H,X,ee,K,ae,ve,Fe,Ne,G,ge,Oe){var Qe=re();try{le(M)(R,N,V,j,H,X,ee,K,ae,ve,Fe,Ne,G,ge,Oe)}catch(st){if(se(Qe),st!==st+0)throw st;oe(1,0)}},aa:function(M,R,N,V,j,H,X,ee){var K=re();try{yt(M,R,N,V,j,H,X,ee)}catch(ae){if(se(K),ae!==ae+0)throw ae;oe(1,0)}},_:function(M,R,N,V,j,H,X,ee,K,ae,ve,Fe){var Ne=re();try{vt(M,R,N,V,j,H,X,ee,K,ae,ve,Fe)}catch(G){if(se(Ne),G!==G+0)throw G;oe(1,0)}},$:function(M,R,N,V,j,H){var X=re();try{_t(M,R,N,V,j,H)}catch(ee){if(se(X),ee!==ee+0)throw ee;oe(1,0)}},n:function(M){return M},F:function(M){Ce=M},ha:At,y:function(M,R,N,V){return At(M,R,N,V)}};(function(){function M(j){s.asm=j.exports,P=s.asm.Ka,he(),Me=s.asm.ib,ue.unshift(s.asm.La),De--,s.monitorRunDependencies&&s.monitorRunDependencies(De),De==0&&Re&&(j=Re,Re=null,j())}function R(j){M(j.instance)}function N(j){return function(){if(!T&&(y||_)){if(typeof fetch=="function"&&!Se.startsWith("file://"))return fetch(Se,{credentials:"same-origin"}).then(function(H){if(!H.ok)throw"failed to load wasm binary file at '"+Se+"'";return H.arrayBuffer()}).catch(function(){return Ue()});if(o)return new Promise(function(H,X){o(Se,function(ee){H(new Uint8Array(ee))},X)})}return Promise.resolve().then(function(){return Ue()})}().then(function(H){return WebAssembly.instantiate(H,V)}).then(function(H){return H}).then(j,function(H){E("failed to asynchronously prepare wasm: "+H),Ae(H)})}var V={a:Et};if(De++,s.monitorRunDependencies&&s.monitorRunDependencies(De),s.instantiateWasm)try{return s.instantiateWasm(V,M)}catch(j){return E("Module.instantiateWasm callback failed with error: "+j),!1}(T||typeof WebAssembly.instantiateStreaming!="function"||we()||Se.startsWith("file://")||v||typeof fetch!="function"?N(R):fetch(Se,{credentials:"same-origin"}).then(function(j){return WebAssembly.instantiateStreaming(j,V).then(R,function(H){return E("wasm streaming compile failed: "+H),E("falling back to ArrayBuffer instantiation"),N(R)})})).catch(p)})(),s.___wasm_call_ctors=function(){return(s.___wasm_call_ctors=s.asm.La).apply(null,arguments)},s._OrtInit=function(){return(s._OrtInit=s.asm.Ma).apply(null,arguments)},s._OrtCreateSessionOptions=function(){return(s._OrtCreateSessionOptions=s.asm.Na).apply(null,arguments)},s._OrtAppendExecutionProvider=function(){return(s._OrtAppendExecutionProvider=s.asm.Oa).apply(null,arguments)},s._OrtAddSessionConfigEntry=function(){return(s._OrtAddSessionConfigEntry=s.asm.Pa).apply(null,arguments)},s._OrtReleaseSessionOptions=function(){return(s._OrtReleaseSessionOptions=s.asm.Qa).apply(null,arguments)},s._OrtCreateSession=function(){return(s._OrtCreateSession=s.asm.Ra).apply(null,arguments)},s._OrtReleaseSession=function(){return(s._OrtReleaseSession=s.asm.Sa).apply(null,arguments)},s._OrtGetInputCount=function(){return(s._OrtGetInputCount=s.asm.Ta).apply(null,arguments)},s._OrtGetOutputCount=function(){return(s._OrtGetOutputCount=s.asm.Ua).apply(null,arguments)},s._OrtGetInputName=function(){return(s._OrtGetInputName=s.asm.Va).apply(null,arguments)},s._OrtGetOutputName=function(){return(s._OrtGetOutputName=s.asm.Wa).apply(null,arguments)},s._OrtFree=function(){return(s._OrtFree=s.asm.Xa).apply(null,arguments)},s._OrtCreateTensor=function(){return(s._OrtCreateTensor=s.asm.Ya).apply(null,arguments)},s._OrtGetTensorData=function(){return(s._OrtGetTensorData=s.asm.Za).apply(null,arguments)},s._OrtReleaseTensor=function(){return(s._OrtReleaseTensor=s.asm._a).apply(null,arguments)},s._OrtCreateRunOptions=function(){return(s._OrtCreateRunOptions=s.asm.$a).apply(null,arguments)},s._OrtAddRunConfigEntry=function(){return(s._OrtAddRunConfigEntry=s.asm.ab).apply(null,arguments)},s._OrtReleaseRunOptions=function(){return(s._OrtReleaseRunOptions=s.asm.bb).apply(null,arguments)},s._OrtRun=function(){return(s._OrtRun=s.asm.cb).apply(null,arguments)},s._OrtEndProfiling=function(){return(s._OrtEndProfiling=s.asm.db).apply(null,arguments)};var Xe,ye=s._malloc=function(){return(ye=s._malloc=s.asm.eb).apply(null,arguments)},rt=s._free=function(){return(rt=s._free=s.asm.fb).apply(null,arguments)},ct=s._fflush=function(){return(ct=s._fflush=s.asm.gb).apply(null,arguments)},it=s.___funcs_on_exit=function(){return(it=s.___funcs_on_exit=s.asm.hb).apply(null,arguments)},oe=s._setThrew=function(){return(oe=s._setThrew=s.asm.jb).apply(null,arguments)},re=s.stackSave=function(){return(re=s.stackSave=s.asm.kb).apply(null,arguments)},se=s.stackRestore=function(){return(se=s.stackRestore=s.asm.lb).apply(null,arguments)},ft=s.stackAlloc=function(){return(ft=s.stackAlloc=s.asm.mb).apply(null,arguments)},et=s.___cxa_can_catch=function(){return(et=s.___cxa_can_catch=s.asm.nb).apply(null,arguments)},mt=s.___cxa_is_pointer_type=function(){return(mt=s.___cxa_is_pointer_type=s.asm.ob).apply(null,arguments)},gt=s.dynCall_j=function(){return(gt=s.dynCall_j=s.asm.pb).apply(null,arguments)},bt=s.dynCall_iiiiij=function(){return(bt=s.dynCall_iiiiij=s.asm.qb).apply(null,arguments)},dt=s.dynCall_jii=function(){return(dt=s.dynCall_jii=s.asm.rb).apply(null,arguments)},yt=s.dynCall_viiiiij=function(){return(yt=s.dynCall_viiiiij=s.asm.sb).apply(null,arguments)},_t=s.dynCall_vjji=function(){return(_t=s.dynCall_vjji=s.asm.tb).apply(null,arguments)},vt=s.dynCall_viiijjjii=function(){return(vt=s.dynCall_viiijjjii=s.asm.ub).apply(null,arguments)},wt=s.dynCall_iij=function(){return(wt=s.dynCall_iij=s.asm.vb).apply(null,arguments)},xt=s.dynCall_ji=function(){return(xt=s.dynCall_ji=s.asm.wb).apply(null,arguments)},ot=s.dynCall_iiiiiij=function(){return(ot=s.dynCall_iiiiiij=s.asm.xb).apply(null,arguments)},ht=s.dynCall_iiij=function(){return(ht=s.dynCall_iiij=s.asm.yb).apply(null,arguments)};function Tt(){function M(){if(!Xe&&(Xe=!0,s.calledRun=!0,!D)){if(We(ue),h(s),s.onRuntimeInitialized&&s.onRuntimeInitialized(),s.postRun)for(typeof s.postRun=="function"&&(s.postRun=[s.postRun]);s.postRun.length;){var R=s.postRun.shift();_e.unshift(R)}We(_e)}}if(!(0{f.exports=function(r,c){for(var d=new Array(arguments.length-1),l=0,m=2,s=!0;m{var c=r;c.length=function(h){var p=h.length;if(!p)return 0;for(var a=0;--p%4>1&&h.charAt(p)==="=";)++a;return Math.ceil(3*h.length)/4-a};for(var d=new Array(64),l=new Array(123),m=0;m<64;)l[d[m]=m<26?m+65:m<52?m+71:m<62?m-4:m-59|43]=m++;c.encode=function(h,p,a){for(var o,t=null,e=[],n=0,i=0;p>2],o=(3&u)<<4,i=1;break;case 1:e[n++]=d[o|u>>4],o=(15&u)<<2,i=2;break;case 2:e[n++]=d[o|u>>6],e[n++]=d[63&u],i=0}n>8191&&((t||(t=[])).push(String.fromCharCode.apply(String,e)),n=0)}return i&&(e[n++]=d[o],e[n++]=61,i===1&&(e[n++]=61)),t?(n&&t.push(String.fromCharCode.apply(String,e.slice(0,n))),t.join("")):String.fromCharCode.apply(String,e.slice(0,n))};var s="invalid encoding";c.decode=function(h,p,a){for(var o,t=a,e=0,n=0;n1)break;if((i=l[i])===void 0)throw Error(s);switch(e){case 0:o=i,e=1;break;case 1:p[a++]=o<<2|(48&i)>>4,o=i,e=2;break;case 2:p[a++]=(15&o)<<4|(60&i)>>2,o=i,e=3;break;case 3:p[a++]=(3&o)<<6|i,e=0}}if(e===1)throw Error(s);return a-t},c.test=function(h){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(h)}},9211:f=>{function r(){this._listeners={}}f.exports=r,r.prototype.on=function(c,d,l){return(this._listeners[c]||(this._listeners[c]=[])).push({fn:d,ctx:l||this}),this},r.prototype.off=function(c,d){if(c===void 0)this._listeners={};else if(d===void 0)this._listeners[c]=[];else for(var l=this._listeners[c],m=0;m{function r(s){return typeof Float32Array<"u"?function(){var h=new Float32Array([-0]),p=new Uint8Array(h.buffer),a=p[3]===128;function o(i,u,g){h[0]=i,u[g]=p[0],u[g+1]=p[1],u[g+2]=p[2],u[g+3]=p[3]}function t(i,u,g){h[0]=i,u[g]=p[3],u[g+1]=p[2],u[g+2]=p[1],u[g+3]=p[0]}function e(i,u){return p[0]=i[u],p[1]=i[u+1],p[2]=i[u+2],p[3]=i[u+3],h[0]}function n(i,u){return p[3]=i[u],p[2]=i[u+1],p[1]=i[u+2],p[0]=i[u+3],h[0]}s.writeFloatLE=a?o:t,s.writeFloatBE=a?t:o,s.readFloatLE=a?e:n,s.readFloatBE=a?n:e}():function(){function h(a,o,t,e){var n=o<0?1:0;if(n&&(o=-o),o===0)a(1/o>0?0:2147483648,t,e);else if(isNaN(o))a(2143289344,t,e);else if(o>34028234663852886e22)a((n<<31|2139095040)>>>0,t,e);else if(o<11754943508222875e-54)a((n<<31|Math.round(o/1401298464324817e-60))>>>0,t,e);else{var i=Math.floor(Math.log(o)/Math.LN2);a((n<<31|i+127<<23|8388607&Math.round(o*Math.pow(2,-i)*8388608))>>>0,t,e)}}function p(a,o,t){var e=a(o,t),n=2*(e>>31)+1,i=e>>>23&255,u=8388607&e;return i===255?u?NaN:n*(1/0):i===0?1401298464324817e-60*n*u:n*Math.pow(2,i-150)*(u+8388608)}s.writeFloatLE=h.bind(null,c),s.writeFloatBE=h.bind(null,d),s.readFloatLE=p.bind(null,l),s.readFloatBE=p.bind(null,m)}(),typeof Float64Array<"u"?function(){var h=new Float64Array([-0]),p=new Uint8Array(h.buffer),a=p[7]===128;function o(i,u,g){h[0]=i,u[g]=p[0],u[g+1]=p[1],u[g+2]=p[2],u[g+3]=p[3],u[g+4]=p[4],u[g+5]=p[5],u[g+6]=p[6],u[g+7]=p[7]}function t(i,u,g){h[0]=i,u[g]=p[7],u[g+1]=p[6],u[g+2]=p[5],u[g+3]=p[4],u[g+4]=p[3],u[g+5]=p[2],u[g+6]=p[1],u[g+7]=p[0]}function e(i,u){return p[0]=i[u],p[1]=i[u+1],p[2]=i[u+2],p[3]=i[u+3],p[4]=i[u+4],p[5]=i[u+5],p[6]=i[u+6],p[7]=i[u+7],h[0]}function n(i,u){return p[7]=i[u],p[6]=i[u+1],p[5]=i[u+2],p[4]=i[u+3],p[3]=i[u+4],p[2]=i[u+5],p[1]=i[u+6],p[0]=i[u+7],h[0]}s.writeDoubleLE=a?o:t,s.writeDoubleBE=a?t:o,s.readDoubleLE=a?e:n,s.readDoubleBE=a?n:e}():function(){function h(a,o,t,e,n,i){var u=e<0?1:0;if(u&&(e=-e),e===0)a(0,n,i+o),a(1/e>0?0:2147483648,n,i+t);else if(isNaN(e))a(0,n,i+o),a(2146959360,n,i+t);else if(e>17976931348623157e292)a(0,n,i+o),a((u<<31|2146435072)>>>0,n,i+t);else{var g;if(e<22250738585072014e-324)a((g=e/5e-324)>>>0,n,i+o),a((u<<31|g/4294967296)>>>0,n,i+t);else{var b=Math.floor(Math.log(e)/Math.LN2);b===1024&&(b=1023),a(4503599627370496*(g=e*Math.pow(2,-b))>>>0,n,i+o),a((u<<31|b+1023<<20|1048576*g&1048575)>>>0,n,i+t)}}}function p(a,o,t,e,n){var i=a(e,n+o),u=a(e,n+t),g=2*(u>>31)+1,b=u>>>20&2047,y=4294967296*(1048575&u)+i;return b===2047?y?NaN:g*(1/0):b===0?5e-324*g*y:g*Math.pow(2,b-1075)*(y+4503599627370496)}s.writeDoubleLE=h.bind(null,c,0,4),s.writeDoubleBE=h.bind(null,d,4,0),s.readDoubleLE=p.bind(null,l,0,4),s.readDoubleBE=p.bind(null,m,4,0)}(),s}function c(s,h,p){h[p]=255&s,h[p+1]=s>>>8&255,h[p+2]=s>>>16&255,h[p+3]=s>>>24}function d(s,h,p){h[p]=s>>>24,h[p+1]=s>>>16&255,h[p+2]=s>>>8&255,h[p+3]=255&s}function l(s,h){return(s[h]|s[h+1]<<8|s[h+2]<<16|s[h+3]<<24)>>>0}function m(s,h){return(s[h]<<24|s[h+1]<<16|s[h+2]<<8|s[h+3])>>>0}f.exports=r(r)},7199:module=>{function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(f){}return null}module.exports=inquire},6662:f=>{f.exports=function(r,c,d){var l=d||8192,m=l>>>1,s=null,h=l;return function(p){if(p<1||p>m)return r(p);h+p>l&&(s=r(l),h=0);var a=c.call(s,h,h+=p);return 7&h&&(h=1+(7|h)),a}}},4997:(f,r)=>{var c=r;c.length=function(d){for(var l=0,m=0,s=0;s191&&s<224?p[a++]=(31&s)<<6|63&d[l++]:s>239&&s<365?(s=((7&s)<<18|(63&d[l++])<<12|(63&d[l++])<<6|63&d[l++])-65536,p[a++]=55296+(s>>10),p[a++]=56320+(1023&s)):p[a++]=(15&s)<<12|(63&d[l++])<<6|63&d[l++],a>8191&&((h||(h=[])).push(String.fromCharCode.apply(String,p)),a=0);return h?(a&&h.push(String.fromCharCode.apply(String,p.slice(0,a))),h.join("")):String.fromCharCode.apply(String,p.slice(0,a))},c.write=function(d,l,m){for(var s,h,p=m,a=0;a>6|192,l[m++]=63&s|128):(64512&s)==55296&&(64512&(h=d.charCodeAt(a+1)))==56320?(s=65536+((1023&s)<<10)+(1023&h),++a,l[m++]=s>>18|240,l[m++]=s>>12&63|128,l[m++]=s>>6&63|128,l[m++]=63&s|128):(l[m++]=s>>12|224,l[m++]=s>>6&63|128,l[m++]=63&s|128);return m-p}},3442:(f,r)=>{r.__esModule=!0;var c=function(){function d(l){if(!l)throw new TypeError("Invalid argument; `value` has no value.");this.value=d.EMPTY,l&&d.isGuid(l)&&(this.value=l)}return d.isGuid=function(l){var m=l.toString();return l&&(l instanceof d||d.validator.test(m))},d.create=function(){return new d([d.gen(2),d.gen(1),d.gen(1),d.gen(1),d.gen(3)].join("-"))},d.createEmpty=function(){return new d("emptyguid")},d.parse=function(l){return new d(l)},d.raw=function(){return[d.gen(2),d.gen(1),d.gen(1),d.gen(1),d.gen(3)].join("-")},d.gen=function(l){for(var m="",s=0;s{f.exports=c;var r=null;try{r=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}function c(x,P,C){this.low=0|x,this.high=0|P,this.unsigned=!!C}function d(x){return(x&&x.__isLong__)===!0}c.prototype.__isLong__,Object.defineProperty(c.prototype,"__isLong__",{value:!0}),c.isLong=d;var l={},m={};function s(x,P){var C,k,$;return P?($=0<=(x>>>=0)&&x<256)&&(k=m[x])?k:(C=p(x,(0|x)<0?-1:0,!0),$&&(m[x]=C),C):($=-128<=(x|=0)&&x<128)&&(k=l[x])?k:(C=p(x,x<0?-1:0,!1),$&&(l[x]=C),C)}function h(x,P){if(isNaN(x))return P?b:g;if(P){if(x<0)return b;if(x>=n)return T}else{if(x<=-9223372036854776e3)return A;if(x+1>=i)return w}return x<0?h(-x,P).neg():p(x%e|0,x/e|0,P)}function p(x,P,C){return new c(x,P,C)}c.fromInt=s,c.fromNumber=h,c.fromBits=p;var a=Math.pow;function o(x,P,C){if(x.length===0)throw Error("empty string");if(x==="NaN"||x==="Infinity"||x==="+Infinity"||x==="-Infinity")return g;if(typeof P=="number"?(C=P,P=!1):P=!!P,(C=C||10)<2||360)throw Error("interior hyphen");if(k===0)return o(x.substring(1),P,C).neg();for(var $=h(a(C,8)),F=g,q=0;q>>0:this.low},E.toNumber=function(){return this.unsigned?(this.high>>>0)*e+(this.low>>>0):this.high*e+(this.low>>>0)},E.toString=function(x){if((x=x||10)<2||36>>0).toString(x);if((F=D).isZero())return U+q;for(;U.length<6;)U="0"+U;q=""+U+q}},E.getHighBits=function(){return this.high},E.getHighBitsUnsigned=function(){return this.high>>>0},E.getLowBits=function(){return this.low},E.getLowBitsUnsigned=function(){return this.low>>>0},E.getNumBitsAbs=function(){if(this.isNegative())return this.eq(A)?64:this.neg().getNumBitsAbs();for(var x=this.high!=0?this.high:this.low,P=31;P>0&&(x&1<=0},E.isOdd=function(){return(1&this.low)==1},E.isEven=function(){return(1&this.low)==0},E.equals=function(x){return d(x)||(x=t(x)),(this.unsigned===x.unsigned||this.high>>>31!=1||x.high>>>31!=1)&&this.high===x.high&&this.low===x.low},E.eq=E.equals,E.notEquals=function(x){return!this.eq(x)},E.neq=E.notEquals,E.ne=E.notEquals,E.lessThan=function(x){return this.comp(x)<0},E.lt=E.lessThan,E.lessThanOrEqual=function(x){return this.comp(x)<=0},E.lte=E.lessThanOrEqual,E.le=E.lessThanOrEqual,E.greaterThan=function(x){return this.comp(x)>0},E.gt=E.greaterThan,E.greaterThanOrEqual=function(x){return this.comp(x)>=0},E.gte=E.greaterThanOrEqual,E.ge=E.greaterThanOrEqual,E.compare=function(x){if(d(x)||(x=t(x)),this.eq(x))return 0;var P=this.isNegative(),C=x.isNegative();return P&&!C?-1:!P&&C?1:this.unsigned?x.high>>>0>this.high>>>0||x.high===this.high&&x.low>>>0>this.low>>>0?-1:1:this.sub(x).isNegative()?-1:1},E.comp=E.compare,E.negate=function(){return!this.unsigned&&this.eq(A)?A:this.not().add(y)},E.neg=E.negate,E.add=function(x){d(x)||(x=t(x));var P=this.high>>>16,C=65535&this.high,k=this.low>>>16,$=65535&this.low,F=x.high>>>16,q=65535&x.high,D=x.low>>>16,U=0,J=0,Y=0,Z=0;return Y+=(Z+=$+(65535&x.low))>>>16,J+=(Y+=k+D)>>>16,U+=(J+=C+q)>>>16,U+=P+F,p((Y&=65535)<<16|(Z&=65535),(U&=65535)<<16|(J&=65535),this.unsigned)},E.subtract=function(x){return d(x)||(x=t(x)),this.add(x.neg())},E.sub=E.subtract,E.multiply=function(x){if(this.isZero())return g;if(d(x)||(x=t(x)),r)return p(r.mul(this.low,this.high,x.low,x.high),r.get_high(),this.unsigned);if(x.isZero())return g;if(this.eq(A))return x.isOdd()?A:g;if(x.eq(A))return this.isOdd()?A:g;if(this.isNegative())return x.isNegative()?this.neg().mul(x.neg()):this.neg().mul(x).neg();if(x.isNegative())return this.mul(x.neg()).neg();if(this.lt(u)&&x.lt(u))return h(this.toNumber()*x.toNumber(),this.unsigned);var P=this.high>>>16,C=65535&this.high,k=this.low>>>16,$=65535&this.low,F=x.high>>>16,q=65535&x.high,D=x.low>>>16,U=65535&x.low,J=0,Y=0,Z=0,te=0;return Z+=(te+=$*U)>>>16,Y+=(Z+=k*U)>>>16,Z&=65535,Y+=(Z+=$*D)>>>16,J+=(Y+=C*U)>>>16,Y&=65535,J+=(Y+=k*D)>>>16,Y&=65535,J+=(Y+=$*q)>>>16,J+=P*U+C*D+k*q+$*F,p((Z&=65535)<<16|(te&=65535),(J&=65535)<<16|(Y&=65535),this.unsigned)},E.mul=E.multiply,E.divide=function(x){if(d(x)||(x=t(x)),x.isZero())throw Error("division by zero");var P,C,k;if(r)return this.unsigned||this.high!==-2147483648||x.low!==-1||x.high!==-1?p((this.unsigned?r.div_u:r.div_s)(this.low,this.high,x.low,x.high),r.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?b:g;if(this.unsigned){if(x.unsigned||(x=x.toUnsigned()),x.gt(this))return b;if(x.gt(this.shru(1)))return _;k=b}else{if(this.eq(A))return x.eq(y)||x.eq(v)?A:x.eq(A)?y:(P=this.shr(1).div(x).shl(1)).eq(g)?x.isNegative()?y:v:(C=this.sub(x.mul(P)),k=P.add(C.div(x)));if(x.eq(A))return this.unsigned?b:g;if(this.isNegative())return x.isNegative()?this.neg().div(x.neg()):this.neg().div(x).neg();if(x.isNegative())return this.div(x.neg()).neg();k=g}for(C=this;C.gte(x);){P=Math.max(1,Math.floor(C.toNumber()/x.toNumber()));for(var $=Math.ceil(Math.log(P)/Math.LN2),F=$<=48?1:a(2,$-48),q=h(P),D=q.mul(x);D.isNegative()||D.gt(C);)D=(q=h(P-=F,this.unsigned)).mul(x);q.isZero()&&(q=y),k=k.add(q),C=C.sub(D)}return k},E.div=E.divide,E.modulo=function(x){return d(x)||(x=t(x)),r?p((this.unsigned?r.rem_u:r.rem_s)(this.low,this.high,x.low,x.high),r.get_high(),this.unsigned):this.sub(this.div(x).mul(x))},E.mod=E.modulo,E.rem=E.modulo,E.not=function(){return p(~this.low,~this.high,this.unsigned)},E.and=function(x){return d(x)||(x=t(x)),p(this.low&x.low,this.high&x.high,this.unsigned)},E.or=function(x){return d(x)||(x=t(x)),p(this.low|x.low,this.high|x.high,this.unsigned)},E.xor=function(x){return d(x)||(x=t(x)),p(this.low^x.low,this.high^x.high,this.unsigned)},E.shiftLeft=function(x){return d(x)&&(x=x.toInt()),(x&=63)==0?this:x<32?p(this.low<>>32-x,this.unsigned):p(0,this.low<>>x|this.high<<32-x,this.high>>x,this.unsigned):p(this.high>>x-32,this.high>=0?0:-1,this.unsigned)},E.shr=E.shiftRight,E.shiftRightUnsigned=function(x){if(d(x)&&(x=x.toInt()),(x&=63)==0)return this;var P=this.high;return x<32?p(this.low>>>x|P<<32-x,P>>>x,this.unsigned):p(x===32?P:P>>>x-32,0,this.unsigned)},E.shru=E.shiftRightUnsigned,E.shr_u=E.shiftRightUnsigned,E.toSigned=function(){return this.unsigned?p(this.low,this.high,!1):this},E.toUnsigned=function(){return this.unsigned?this:p(this.low,this.high,!0)},E.toBytes=function(x){return x?this.toBytesLE():this.toBytesBE()},E.toBytesLE=function(){var x=this.high,P=this.low;return[255&P,P>>>8&255,P>>>16&255,P>>>24,255&x,x>>>8&255,x>>>16&255,x>>>24]},E.toBytesBE=function(){var x=this.high,P=this.low;return[x>>>24,x>>>16&255,x>>>8&255,255&x,P>>>24,P>>>16&255,P>>>8&255,255&P]},c.fromBytes=function(x,P,C){return C?c.fromBytesLE(x,P):c.fromBytesBE(x,P)},c.fromBytesLE=function(x,P){return new c(x[0]|x[1]<<8|x[2]<<16|x[3]<<24,x[4]|x[5]<<8|x[6]<<16|x[7]<<24,P)},c.fromBytesBE=function(x,P){return new c(x[4]<<24|x[5]<<16|x[6]<<8|x[7],x[0]<<24|x[1]<<16|x[2]<<8|x[3],P)}},1446:(f,r,c)=>{var d,l,m,s=c(2100),h=s.Reader,p=s.Writer,a=s.util,o=s.roots.default||(s.roots.default={});o.onnx=((m={}).Version=(d={},(l=Object.create(d))[d[0]="_START_VERSION"]=0,l[d[1]="IR_VERSION_2017_10_10"]=1,l[d[2]="IR_VERSION_2017_10_30"]=2,l[d[3]="IR_VERSION_2017_11_3"]=3,l[d[4]="IR_VERSION_2019_1_22"]=4,l[d[5]="IR_VERSION"]=5,l),m.AttributeProto=function(){function t(e){if(this.floats=[],this.ints=[],this.strings=[],this.tensors=[],this.graphs=[],e)for(var n=Object.keys(e),i=0;i>>3){case 1:u.name=e.string();break;case 21:u.refAttrName=e.string();break;case 13:u.docString=e.string();break;case 20:u.type=e.int32();break;case 2:u.f=e.float();break;case 3:u.i=e.int64();break;case 4:u.s=e.bytes();break;case 5:u.t=o.onnx.TensorProto.decode(e,e.uint32());break;case 6:u.g=o.onnx.GraphProto.decode(e,e.uint32());break;case 7:if(u.floats&&u.floats.length||(u.floats=[]),(7&g)==2)for(var b=e.uint32()+e.pos;e.pos>>0,e.i.high>>>0).toNumber())),e.s!=null&&(typeof e.s=="string"?a.base64.decode(e.s,n.s=a.newBuffer(a.base64.length(e.s)),0):e.s.length&&(n.s=e.s)),e.t!=null){if(typeof e.t!="object")throw TypeError(".onnx.AttributeProto.t: object expected");n.t=o.onnx.TensorProto.fromObject(e.t)}if(e.g!=null){if(typeof e.g!="object")throw TypeError(".onnx.AttributeProto.g: object expected");n.g=o.onnx.GraphProto.fromObject(e.g)}if(e.floats){if(!Array.isArray(e.floats))throw TypeError(".onnx.AttributeProto.floats: array expected");n.floats=[];for(var i=0;i>>0,e.ints[i].high>>>0).toNumber())}if(e.strings){if(!Array.isArray(e.strings))throw TypeError(".onnx.AttributeProto.strings: array expected");for(n.strings=[],i=0;i>>0,e.i.high>>>0).toNumber():e.i),e.s!=null&&e.hasOwnProperty("s")&&(i.s=n.bytes===String?a.base64.encode(e.s,0,e.s.length):n.bytes===Array?Array.prototype.slice.call(e.s):e.s),e.t!=null&&e.hasOwnProperty("t")&&(i.t=o.onnx.TensorProto.toObject(e.t,n)),e.g!=null&&e.hasOwnProperty("g")&&(i.g=o.onnx.GraphProto.toObject(e.g,n)),e.floats&&e.floats.length){i.floats=[];for(var g=0;g>>0,e.ints[g].high>>>0).toNumber():e.ints[g];if(e.strings&&e.strings.length)for(i.strings=[],g=0;g>>3){case 1:u.name=e.string();break;case 2:u.type=o.onnx.TypeProto.decode(e,e.uint32());break;case 3:u.docString=e.string();break;default:e.skipType(7&g)}}return u},t.decodeDelimited=function(e){return e instanceof h||(e=new h(e)),this.decode(e,e.uint32())},t.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.name!=null&&e.hasOwnProperty("name")&&!a.isString(e.name))return"name: string expected";if(e.type!=null&&e.hasOwnProperty("type")){var n=o.onnx.TypeProto.verify(e.type);if(n)return"type."+n}return e.docString!=null&&e.hasOwnProperty("docString")&&!a.isString(e.docString)?"docString: string expected":null},t.fromObject=function(e){if(e instanceof o.onnx.ValueInfoProto)return e;var n=new o.onnx.ValueInfoProto;if(e.name!=null&&(n.name=String(e.name)),e.type!=null){if(typeof e.type!="object")throw TypeError(".onnx.ValueInfoProto.type: object expected");n.type=o.onnx.TypeProto.fromObject(e.type)}return e.docString!=null&&(n.docString=String(e.docString)),n},t.toObject=function(e,n){n||(n={});var i={};return n.defaults&&(i.name="",i.type=null,i.docString=""),e.name!=null&&e.hasOwnProperty("name")&&(i.name=e.name),e.type!=null&&e.hasOwnProperty("type")&&(i.type=o.onnx.TypeProto.toObject(e.type,n)),e.docString!=null&&e.hasOwnProperty("docString")&&(i.docString=e.docString),i},t.prototype.toJSON=function(){return this.constructor.toObject(this,s.util.toJSONOptions)},t}(),m.NodeProto=function(){function t(e){if(this.input=[],this.output=[],this.attribute=[],e)for(var n=Object.keys(e),i=0;i>>3){case 1:u.input&&u.input.length||(u.input=[]),u.input.push(e.string());break;case 2:u.output&&u.output.length||(u.output=[]),u.output.push(e.string());break;case 3:u.name=e.string();break;case 4:u.opType=e.string();break;case 7:u.domain=e.string();break;case 5:u.attribute&&u.attribute.length||(u.attribute=[]),u.attribute.push(o.onnx.AttributeProto.decode(e,e.uint32()));break;case 6:u.docString=e.string();break;default:e.skipType(7&g)}}return u},t.decodeDelimited=function(e){return e instanceof h||(e=new h(e)),this.decode(e,e.uint32())},t.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.input!=null&&e.hasOwnProperty("input")){if(!Array.isArray(e.input))return"input: array expected";for(var n=0;n>>3){case 1:u.irVersion=e.int64();break;case 8:u.opsetImport&&u.opsetImport.length||(u.opsetImport=[]),u.opsetImport.push(o.onnx.OperatorSetIdProto.decode(e,e.uint32()));break;case 2:u.producerName=e.string();break;case 3:u.producerVersion=e.string();break;case 4:u.domain=e.string();break;case 5:u.modelVersion=e.int64();break;case 6:u.docString=e.string();break;case 7:u.graph=o.onnx.GraphProto.decode(e,e.uint32());break;case 14:u.metadataProps&&u.metadataProps.length||(u.metadataProps=[]),u.metadataProps.push(o.onnx.StringStringEntryProto.decode(e,e.uint32()));break;default:e.skipType(7&g)}}return u},t.decodeDelimited=function(e){return e instanceof h||(e=new h(e)),this.decode(e,e.uint32())},t.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.irVersion!=null&&e.hasOwnProperty("irVersion")&&!(a.isInteger(e.irVersion)||e.irVersion&&a.isInteger(e.irVersion.low)&&a.isInteger(e.irVersion.high)))return"irVersion: integer|Long expected";if(e.opsetImport!=null&&e.hasOwnProperty("opsetImport")){if(!Array.isArray(e.opsetImport))return"opsetImport: array expected";for(var n=0;n>>0,e.irVersion.high>>>0).toNumber())),e.opsetImport){if(!Array.isArray(e.opsetImport))throw TypeError(".onnx.ModelProto.opsetImport: array expected");n.opsetImport=[];for(var i=0;i>>0,e.modelVersion.high>>>0).toNumber())),e.docString!=null&&(n.docString=String(e.docString)),e.graph!=null){if(typeof e.graph!="object")throw TypeError(".onnx.ModelProto.graph: object expected");n.graph=o.onnx.GraphProto.fromObject(e.graph)}if(e.metadataProps){if(!Array.isArray(e.metadataProps))throw TypeError(".onnx.ModelProto.metadataProps: array expected");for(n.metadataProps=[],i=0;i>>0,e.irVersion.high>>>0).toNumber():e.irVersion),e.producerName!=null&&e.hasOwnProperty("producerName")&&(i.producerName=e.producerName),e.producerVersion!=null&&e.hasOwnProperty("producerVersion")&&(i.producerVersion=e.producerVersion),e.domain!=null&&e.hasOwnProperty("domain")&&(i.domain=e.domain),e.modelVersion!=null&&e.hasOwnProperty("modelVersion")&&(typeof e.modelVersion=="number"?i.modelVersion=n.longs===String?String(e.modelVersion):e.modelVersion:i.modelVersion=n.longs===String?a.Long.prototype.toString.call(e.modelVersion):n.longs===Number?new a.LongBits(e.modelVersion.low>>>0,e.modelVersion.high>>>0).toNumber():e.modelVersion),e.docString!=null&&e.hasOwnProperty("docString")&&(i.docString=e.docString),e.graph!=null&&e.hasOwnProperty("graph")&&(i.graph=o.onnx.GraphProto.toObject(e.graph,n)),e.opsetImport&&e.opsetImport.length){i.opsetImport=[];for(var g=0;g>>3){case 1:u.key=e.string();break;case 2:u.value=e.string();break;default:e.skipType(7&g)}}return u},t.decodeDelimited=function(e){return e instanceof h||(e=new h(e)),this.decode(e,e.uint32())},t.verify=function(e){return typeof e!="object"||e===null?"object expected":e.key!=null&&e.hasOwnProperty("key")&&!a.isString(e.key)?"key: string expected":e.value!=null&&e.hasOwnProperty("value")&&!a.isString(e.value)?"value: string expected":null},t.fromObject=function(e){if(e instanceof o.onnx.StringStringEntryProto)return e;var n=new o.onnx.StringStringEntryProto;return e.key!=null&&(n.key=String(e.key)),e.value!=null&&(n.value=String(e.value)),n},t.toObject=function(e,n){n||(n={});var i={};return n.defaults&&(i.key="",i.value=""),e.key!=null&&e.hasOwnProperty("key")&&(i.key=e.key),e.value!=null&&e.hasOwnProperty("value")&&(i.value=e.value),i},t.prototype.toJSON=function(){return this.constructor.toObject(this,s.util.toJSONOptions)},t}(),m.TensorAnnotation=function(){function t(e){if(this.quantParameterTensorNames=[],e)for(var n=Object.keys(e),i=0;i>>3){case 1:u.tensorName=e.string();break;case 2:u.quantParameterTensorNames&&u.quantParameterTensorNames.length||(u.quantParameterTensorNames=[]),u.quantParameterTensorNames.push(o.onnx.StringStringEntryProto.decode(e,e.uint32()));break;default:e.skipType(7&g)}}return u},t.decodeDelimited=function(e){return e instanceof h||(e=new h(e)),this.decode(e,e.uint32())},t.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.tensorName!=null&&e.hasOwnProperty("tensorName")&&!a.isString(e.tensorName))return"tensorName: string expected";if(e.quantParameterTensorNames!=null&&e.hasOwnProperty("quantParameterTensorNames")){if(!Array.isArray(e.quantParameterTensorNames))return"quantParameterTensorNames: array expected";for(var n=0;n>>3){case 1:u.node&&u.node.length||(u.node=[]),u.node.push(o.onnx.NodeProto.decode(e,e.uint32()));break;case 2:u.name=e.string();break;case 5:u.initializer&&u.initializer.length||(u.initializer=[]),u.initializer.push(o.onnx.TensorProto.decode(e,e.uint32()));break;case 10:u.docString=e.string();break;case 11:u.input&&u.input.length||(u.input=[]),u.input.push(o.onnx.ValueInfoProto.decode(e,e.uint32()));break;case 12:u.output&&u.output.length||(u.output=[]),u.output.push(o.onnx.ValueInfoProto.decode(e,e.uint32()));break;case 13:u.valueInfo&&u.valueInfo.length||(u.valueInfo=[]),u.valueInfo.push(o.onnx.ValueInfoProto.decode(e,e.uint32()));break;case 14:u.quantizationAnnotation&&u.quantizationAnnotation.length||(u.quantizationAnnotation=[]),u.quantizationAnnotation.push(o.onnx.TensorAnnotation.decode(e,e.uint32()));break;default:e.skipType(7&g)}}return u},t.decodeDelimited=function(e){return e instanceof h||(e=new h(e)),this.decode(e,e.uint32())},t.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.node!=null&&e.hasOwnProperty("node")){if(!Array.isArray(e.node))return"node: array expected";for(var n=0;n>>3){case 1:if(u.dims&&u.dims.length||(u.dims=[]),(7&g)==2)for(var b=e.uint32()+e.pos;e.pos>>0,e.dims[i].high>>>0).toNumber())}if(e.dataType!=null&&(n.dataType=0|e.dataType),e.segment!=null){if(typeof e.segment!="object")throw TypeError(".onnx.TensorProto.segment: object expected");n.segment=o.onnx.TensorProto.Segment.fromObject(e.segment)}if(e.floatData){if(!Array.isArray(e.floatData))throw TypeError(".onnx.TensorProto.floatData: array expected");for(n.floatData=[],i=0;i>>0,e.int64Data[i].high>>>0).toNumber())}if(e.name!=null&&(n.name=String(e.name)),e.docString!=null&&(n.docString=String(e.docString)),e.rawData!=null&&(typeof e.rawData=="string"?a.base64.decode(e.rawData,n.rawData=a.newBuffer(a.base64.length(e.rawData)),0):e.rawData.length&&(n.rawData=e.rawData)),e.externalData){if(!Array.isArray(e.externalData))throw TypeError(".onnx.TensorProto.externalData: array expected");for(n.externalData=[],i=0;i>>0,e.uint64Data[i].high>>>0).toNumber(!0))}return n},t.toObject=function(e,n){n||(n={});var i={};if((n.arrays||n.defaults)&&(i.dims=[],i.floatData=[],i.int32Data=[],i.stringData=[],i.int64Data=[],i.doubleData=[],i.uint64Data=[],i.externalData=[]),n.defaults&&(i.dataType=0,i.segment=null,i.name="",n.bytes===String?i.rawData="":(i.rawData=[],n.bytes!==Array&&(i.rawData=a.newBuffer(i.rawData))),i.docString="",i.dataLocation=n.enums===String?"DEFAULT":0),e.dims&&e.dims.length){i.dims=[];for(var u=0;u>>0,e.dims[u].high>>>0).toNumber():e.dims[u]}if(e.dataType!=null&&e.hasOwnProperty("dataType")&&(i.dataType=e.dataType),e.segment!=null&&e.hasOwnProperty("segment")&&(i.segment=o.onnx.TensorProto.Segment.toObject(e.segment,n)),e.floatData&&e.floatData.length)for(i.floatData=[],u=0;u>>0,e.int64Data[u].high>>>0).toNumber():e.int64Data[u];if(e.name!=null&&e.hasOwnProperty("name")&&(i.name=e.name),e.rawData!=null&&e.hasOwnProperty("rawData")&&(i.rawData=n.bytes===String?a.base64.encode(e.rawData,0,e.rawData.length):n.bytes===Array?Array.prototype.slice.call(e.rawData):e.rawData),e.doubleData&&e.doubleData.length)for(i.doubleData=[],u=0;u>>0,e.uint64Data[u].high>>>0).toNumber(!0):e.uint64Data[u];if(e.docString!=null&&e.hasOwnProperty("docString")&&(i.docString=e.docString),e.externalData&&e.externalData.length)for(i.externalData=[],u=0;u>>3){case 1:g.begin=n.int64();break;case 2:g.end=n.int64();break;default:n.skipType(7&b)}}return g},e.decodeDelimited=function(n){return n instanceof h||(n=new h(n)),this.decode(n,n.uint32())},e.verify=function(n){return typeof n!="object"||n===null?"object expected":n.begin!=null&&n.hasOwnProperty("begin")&&!(a.isInteger(n.begin)||n.begin&&a.isInteger(n.begin.low)&&a.isInteger(n.begin.high))?"begin: integer|Long expected":n.end!=null&&n.hasOwnProperty("end")&&!(a.isInteger(n.end)||n.end&&a.isInteger(n.end.low)&&a.isInteger(n.end.high))?"end: integer|Long expected":null},e.fromObject=function(n){if(n instanceof o.onnx.TensorProto.Segment)return n;var i=new o.onnx.TensorProto.Segment;return n.begin!=null&&(a.Long?(i.begin=a.Long.fromValue(n.begin)).unsigned=!1:typeof n.begin=="string"?i.begin=parseInt(n.begin,10):typeof n.begin=="number"?i.begin=n.begin:typeof n.begin=="object"&&(i.begin=new a.LongBits(n.begin.low>>>0,n.begin.high>>>0).toNumber())),n.end!=null&&(a.Long?(i.end=a.Long.fromValue(n.end)).unsigned=!1:typeof n.end=="string"?i.end=parseInt(n.end,10):typeof n.end=="number"?i.end=n.end:typeof n.end=="object"&&(i.end=new a.LongBits(n.end.low>>>0,n.end.high>>>0).toNumber())),i},e.toObject=function(n,i){i||(i={});var u={};if(i.defaults){if(a.Long){var g=new a.Long(0,0,!1);u.begin=i.longs===String?g.toString():i.longs===Number?g.toNumber():g}else u.begin=i.longs===String?"0":0;a.Long?(g=new a.Long(0,0,!1),u.end=i.longs===String?g.toString():i.longs===Number?g.toNumber():g):u.end=i.longs===String?"0":0}return n.begin!=null&&n.hasOwnProperty("begin")&&(typeof n.begin=="number"?u.begin=i.longs===String?String(n.begin):n.begin:u.begin=i.longs===String?a.Long.prototype.toString.call(n.begin):i.longs===Number?new a.LongBits(n.begin.low>>>0,n.begin.high>>>0).toNumber():n.begin),n.end!=null&&n.hasOwnProperty("end")&&(typeof n.end=="number"?u.end=i.longs===String?String(n.end):n.end:u.end=i.longs===String?a.Long.prototype.toString.call(n.end):i.longs===Number?new a.LongBits(n.end.low>>>0,n.end.high>>>0).toNumber():n.end),u},e.prototype.toJSON=function(){return this.constructor.toObject(this,s.util.toJSONOptions)},e}(),t.DataLocation=function(){var e={},n=Object.create(e);return n[e[0]="DEFAULT"]=0,n[e[1]="EXTERNAL"]=1,n}(),t}(),m.TensorShapeProto=function(){function t(e){if(this.dim=[],e)for(var n=Object.keys(e),i=0;i>>3==1?(u.dim&&u.dim.length||(u.dim=[]),u.dim.push(o.onnx.TensorShapeProto.Dimension.decode(e,e.uint32()))):e.skipType(7&g)}return u},t.decodeDelimited=function(e){return e instanceof h||(e=new h(e)),this.decode(e,e.uint32())},t.verify=function(e){if(typeof e!="object"||e===null)return"object expected";if(e.dim!=null&&e.hasOwnProperty("dim")){if(!Array.isArray(e.dim))return"dim: array expected";for(var n=0;n>>3){case 1:b.dimValue=i.int64();break;case 2:b.dimParam=i.string();break;case 3:b.denotation=i.string();break;default:i.skipType(7&y)}}return b},e.decodeDelimited=function(i){return i instanceof h||(i=new h(i)),this.decode(i,i.uint32())},e.verify=function(i){if(typeof i!="object"||i===null)return"object expected";var u={};if(i.dimValue!=null&&i.hasOwnProperty("dimValue")&&(u.value=1,!(a.isInteger(i.dimValue)||i.dimValue&&a.isInteger(i.dimValue.low)&&a.isInteger(i.dimValue.high))))return"dimValue: integer|Long expected";if(i.dimParam!=null&&i.hasOwnProperty("dimParam")){if(u.value===1)return"value: multiple values";if(u.value=1,!a.isString(i.dimParam))return"dimParam: string expected"}return i.denotation!=null&&i.hasOwnProperty("denotation")&&!a.isString(i.denotation)?"denotation: string expected":null},e.fromObject=function(i){if(i instanceof o.onnx.TensorShapeProto.Dimension)return i;var u=new o.onnx.TensorShapeProto.Dimension;return i.dimValue!=null&&(a.Long?(u.dimValue=a.Long.fromValue(i.dimValue)).unsigned=!1:typeof i.dimValue=="string"?u.dimValue=parseInt(i.dimValue,10):typeof i.dimValue=="number"?u.dimValue=i.dimValue:typeof i.dimValue=="object"&&(u.dimValue=new a.LongBits(i.dimValue.low>>>0,i.dimValue.high>>>0).toNumber())),i.dimParam!=null&&(u.dimParam=String(i.dimParam)),i.denotation!=null&&(u.denotation=String(i.denotation)),u},e.toObject=function(i,u){u||(u={});var g={};return u.defaults&&(g.denotation=""),i.dimValue!=null&&i.hasOwnProperty("dimValue")&&(typeof i.dimValue=="number"?g.dimValue=u.longs===String?String(i.dimValue):i.dimValue:g.dimValue=u.longs===String?a.Long.prototype.toString.call(i.dimValue):u.longs===Number?new a.LongBits(i.dimValue.low>>>0,i.dimValue.high>>>0).toNumber():i.dimValue,u.oneofs&&(g.value="dimValue")),i.dimParam!=null&&i.hasOwnProperty("dimParam")&&(g.dimParam=i.dimParam,u.oneofs&&(g.value="dimParam")),i.denotation!=null&&i.hasOwnProperty("denotation")&&(g.denotation=i.denotation),g},e.prototype.toJSON=function(){return this.constructor.toObject(this,s.util.toJSONOptions)},e}(),t}(),m.TypeProto=function(){function t(n){if(n)for(var i=Object.keys(n),u=0;u>>3){case 1:g.tensorType=o.onnx.TypeProto.Tensor.decode(n,n.uint32());break;case 6:g.denotation=n.string();break;default:n.skipType(7&b)}}return g},t.decodeDelimited=function(n){return n instanceof h||(n=new h(n)),this.decode(n,n.uint32())},t.verify=function(n){if(typeof n!="object"||n===null)return"object expected";if(n.tensorType!=null&&n.hasOwnProperty("tensorType")){var i=o.onnx.TypeProto.Tensor.verify(n.tensorType);if(i)return"tensorType."+i}return n.denotation!=null&&n.hasOwnProperty("denotation")&&!a.isString(n.denotation)?"denotation: string expected":null},t.fromObject=function(n){if(n instanceof o.onnx.TypeProto)return n;var i=new o.onnx.TypeProto;if(n.tensorType!=null){if(typeof n.tensorType!="object")throw TypeError(".onnx.TypeProto.tensorType: object expected");i.tensorType=o.onnx.TypeProto.Tensor.fromObject(n.tensorType)}return n.denotation!=null&&(i.denotation=String(n.denotation)),i},t.toObject=function(n,i){i||(i={});var u={};return i.defaults&&(u.denotation=""),n.tensorType!=null&&n.hasOwnProperty("tensorType")&&(u.tensorType=o.onnx.TypeProto.Tensor.toObject(n.tensorType,i),i.oneofs&&(u.value="tensorType")),n.denotation!=null&&n.hasOwnProperty("denotation")&&(u.denotation=n.denotation),u},t.prototype.toJSON=function(){return this.constructor.toObject(this,s.util.toJSONOptions)},t.Tensor=function(){function n(i){if(i)for(var u=Object.keys(i),g=0;g>>3){case 1:b.elemType=i.int32();break;case 2:b.shape=o.onnx.TensorShapeProto.decode(i,i.uint32());break;default:i.skipType(7&y)}}return b},n.decodeDelimited=function(i){return i instanceof h||(i=new h(i)),this.decode(i,i.uint32())},n.verify=function(i){if(typeof i!="object"||i===null)return"object expected";if(i.elemType!=null&&i.hasOwnProperty("elemType")&&!a.isInteger(i.elemType))return"elemType: integer expected";if(i.shape!=null&&i.hasOwnProperty("shape")){var u=o.onnx.TensorShapeProto.verify(i.shape);if(u)return"shape."+u}return null},n.fromObject=function(i){if(i instanceof o.onnx.TypeProto.Tensor)return i;var u=new o.onnx.TypeProto.Tensor;if(i.elemType!=null&&(u.elemType=0|i.elemType),i.shape!=null){if(typeof i.shape!="object")throw TypeError(".onnx.TypeProto.Tensor.shape: object expected");u.shape=o.onnx.TensorShapeProto.fromObject(i.shape)}return u},n.toObject=function(i,u){u||(u={});var g={};return u.defaults&&(g.elemType=0,g.shape=null),i.elemType!=null&&i.hasOwnProperty("elemType")&&(g.elemType=i.elemType),i.shape!=null&&i.hasOwnProperty("shape")&&(g.shape=o.onnx.TensorShapeProto.toObject(i.shape,u)),g},n.prototype.toJSON=function(){return this.constructor.toObject(this,s.util.toJSONOptions)},n}(),t}(),m.OperatorSetIdProto=function(){function t(e){if(e)for(var n=Object.keys(e),i=0;i>>3){case 1:u.domain=e.string();break;case 2:u.version=e.int64();break;default:e.skipType(7&g)}}return u},t.decodeDelimited=function(e){return e instanceof h||(e=new h(e)),this.decode(e,e.uint32())},t.verify=function(e){return typeof e!="object"||e===null?"object expected":e.domain!=null&&e.hasOwnProperty("domain")&&!a.isString(e.domain)?"domain: string expected":e.version!=null&&e.hasOwnProperty("version")&&!(a.isInteger(e.version)||e.version&&a.isInteger(e.version.low)&&a.isInteger(e.version.high))?"version: integer|Long expected":null},t.fromObject=function(e){if(e instanceof o.onnx.OperatorSetIdProto)return e;var n=new o.onnx.OperatorSetIdProto;return e.domain!=null&&(n.domain=String(e.domain)),e.version!=null&&(a.Long?(n.version=a.Long.fromValue(e.version)).unsigned=!1:typeof e.version=="string"?n.version=parseInt(e.version,10):typeof e.version=="number"?n.version=e.version:typeof e.version=="object"&&(n.version=new a.LongBits(e.version.low>>>0,e.version.high>>>0).toNumber())),n},t.toObject=function(e,n){n||(n={});var i={};if(n.defaults)if(i.domain="",a.Long){var u=new a.Long(0,0,!1);i.version=n.longs===String?u.toString():n.longs===Number?u.toNumber():u}else i.version=n.longs===String?"0":0;return e.domain!=null&&e.hasOwnProperty("domain")&&(i.domain=e.domain),e.version!=null&&e.hasOwnProperty("version")&&(typeof e.version=="number"?i.version=n.longs===String?String(e.version):e.version:i.version=n.longs===String?a.Long.prototype.toString.call(e.version):n.longs===Number?new a.LongBits(e.version.low>>>0,e.version.high>>>0).toNumber():e.version),i},t.prototype.toJSON=function(){return this.constructor.toObject(this,s.util.toJSONOptions)},t}(),m),f.exports=o},2100:(f,r,c)=>{f.exports=c(9482)},9482:(f,r,c)=>{var d=r;function l(){d.util._configure(),d.Writer._configure(d.BufferWriter),d.Reader._configure(d.BufferReader)}d.build="minimal",d.Writer=c(1173),d.BufferWriter=c(3155),d.Reader=c(1408),d.BufferReader=c(593),d.util=c(9693),d.rpc=c(5994),d.roots=c(5054),d.configure=l,l()},1408:(f,r,c)=>{f.exports=p;var d,l=c(9693),m=l.LongBits,s=l.utf8;function h(u,g){return RangeError("index out of range: "+u.pos+" + "+(g||1)+" > "+u.len)}function p(u){this.buf=u,this.pos=0,this.len=u.length}var a,o=typeof Uint8Array<"u"?function(u){if(u instanceof Uint8Array||Array.isArray(u))return new p(u);throw Error("illegal buffer")}:function(u){if(Array.isArray(u))return new p(u);throw Error("illegal buffer")},t=function(){return l.Buffer?function(u){return(p.create=function(g){return l.Buffer.isBuffer(g)?new d(g):o(g)})(u)}:o};function e(){var u=new m(0,0),g=0;if(!(this.len-this.pos>4)){for(;g<3;++g){if(this.pos>=this.len)throw h(this);if(u.lo=(u.lo|(127&this.buf[this.pos])<<7*g)>>>0,this.buf[this.pos++]<128)return u}return u.lo=(u.lo|(127&this.buf[this.pos++])<<7*g)>>>0,u}for(;g<4;++g)if(u.lo=(u.lo|(127&this.buf[this.pos])<<7*g)>>>0,this.buf[this.pos++]<128)return u;if(u.lo=(u.lo|(127&this.buf[this.pos])<<28)>>>0,u.hi=(u.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return u;if(g=0,this.len-this.pos>4){for(;g<5;++g)if(u.hi=(u.hi|(127&this.buf[this.pos])<<7*g+3)>>>0,this.buf[this.pos++]<128)return u}else for(;g<5;++g){if(this.pos>=this.len)throw h(this);if(u.hi=(u.hi|(127&this.buf[this.pos])<<7*g+3)>>>0,this.buf[this.pos++]<128)return u}throw Error("invalid varint encoding")}function n(u,g){return(u[g-4]|u[g-3]<<8|u[g-2]<<16|u[g-1]<<24)>>>0}function i(){if(this.pos+8>this.len)throw h(this,8);return new m(n(this.buf,this.pos+=4),n(this.buf,this.pos+=4))}p.create=t(),p.prototype._slice=l.Array.prototype.subarray||l.Array.prototype.slice,p.prototype.uint32=(a=4294967295,function(){if(a=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128||(a=(a|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)||(a=(a|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)||(a=(a|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)||(a=(a|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128))return a;if((this.pos+=5)>this.len)throw this.pos=this.len,h(this,10);return a}),p.prototype.int32=function(){return 0|this.uint32()},p.prototype.sint32=function(){var u=this.uint32();return u>>>1^-(1&u)|0},p.prototype.bool=function(){return this.uint32()!==0},p.prototype.fixed32=function(){if(this.pos+4>this.len)throw h(this,4);return n(this.buf,this.pos+=4)},p.prototype.sfixed32=function(){if(this.pos+4>this.len)throw h(this,4);return 0|n(this.buf,this.pos+=4)},p.prototype.float=function(){if(this.pos+4>this.len)throw h(this,4);var u=l.float.readFloatLE(this.buf,this.pos);return this.pos+=4,u},p.prototype.double=function(){if(this.pos+8>this.len)throw h(this,4);var u=l.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,u},p.prototype.bytes=function(){var u=this.uint32(),g=this.pos,b=this.pos+u;if(b>this.len)throw h(this,u);return this.pos+=u,Array.isArray(this.buf)?this.buf.slice(g,b):g===b?new this.buf.constructor(0):this._slice.call(this.buf,g,b)},p.prototype.string=function(){var u=this.bytes();return s.read(u,0,u.length)},p.prototype.skip=function(u){if(typeof u=="number"){if(this.pos+u>this.len)throw h(this,u);this.pos+=u}else do if(this.pos>=this.len)throw h(this);while(128&this.buf[this.pos++]);return this},p.prototype.skipType=function(u){switch(u){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(u=7&this.uint32())!=4;)this.skipType(u);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+u+" at offset "+this.pos)}return this},p._configure=function(u){d=u,p.create=t(),d._configure();var g=l.Long?"toLong":"toNumber";l.merge(p.prototype,{int64:function(){return e.call(this)[g](!1)},uint64:function(){return e.call(this)[g](!0)},sint64:function(){return e.call(this).zzDecode()[g](!1)},fixed64:function(){return i.call(this)[g](!0)},sfixed64:function(){return i.call(this)[g](!1)}})}},593:(f,r,c)=>{f.exports=m;var d=c(1408);(m.prototype=Object.create(d.prototype)).constructor=m;var l=c(9693);function m(s){d.call(this,s)}m._configure=function(){l.Buffer&&(m.prototype._slice=l.Buffer.prototype.slice)},m.prototype.string=function(){var s=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+s,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+s,this.len))},m._configure()},5054:f=>{f.exports={}},5994:(f,r,c)=>{r.Service=c(7948)},7948:(f,r,c)=>{f.exports=l;var d=c(9693);function l(m,s,h){if(typeof m!="function")throw TypeError("rpcImpl must be a function");d.EventEmitter.call(this),this.rpcImpl=m,this.requestDelimited=!!s,this.responseDelimited=!!h}(l.prototype=Object.create(d.EventEmitter.prototype)).constructor=l,l.prototype.rpcCall=function m(s,h,p,a,o){if(!a)throw TypeError("request must be specified");var t=this;if(!o)return d.asPromise(m,t,s,h,p,a);if(t.rpcImpl)try{return t.rpcImpl(s,h[t.requestDelimited?"encodeDelimited":"encode"](a).finish(),function(e,n){if(e)return t.emit("error",e,s),o(e);if(n!==null){if(!(n instanceof p))try{n=p[t.responseDelimited?"decodeDelimited":"decode"](n)}catch(i){return t.emit("error",i,s),o(i)}return t.emit("data",n,s),o(null,n)}t.end(!0)})}catch(e){return t.emit("error",e,s),void setTimeout(function(){o(e)},0)}else setTimeout(function(){o(Error("already ended"))},0)},l.prototype.end=function(m){return this.rpcImpl&&(m||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},1945:(f,r,c)=>{f.exports=l;var d=c(9693);function l(p,a){this.lo=p>>>0,this.hi=a>>>0}var m=l.zero=new l(0,0);m.toNumber=function(){return 0},m.zzEncode=m.zzDecode=function(){return this},m.length=function(){return 1};var s=l.zeroHash="\0\0\0\0\0\0\0\0";l.fromNumber=function(p){if(p===0)return m;var a=p<0;a&&(p=-p);var o=p>>>0,t=(p-o)/4294967296>>>0;return a&&(t=~t>>>0,o=~o>>>0,++o>4294967295&&(o=0,++t>4294967295&&(t=0))),new l(o,t)},l.from=function(p){if(typeof p=="number")return l.fromNumber(p);if(d.isString(p)){if(!d.Long)return l.fromNumber(parseInt(p,10));p=d.Long.fromString(p)}return p.low||p.high?new l(p.low>>>0,p.high>>>0):m},l.prototype.toNumber=function(p){if(!p&&this.hi>>>31){var a=1+~this.lo>>>0,o=~this.hi>>>0;return a||(o=o+1>>>0),-(a+4294967296*o)}return this.lo+4294967296*this.hi},l.prototype.toLong=function(p){return d.Long?new d.Long(0|this.lo,0|this.hi,!!p):{low:0|this.lo,high:0|this.hi,unsigned:!!p}};var h=String.prototype.charCodeAt;l.fromHash=function(p){return p===s?m:new l((h.call(p,0)|h.call(p,1)<<8|h.call(p,2)<<16|h.call(p,3)<<24)>>>0,(h.call(p,4)|h.call(p,5)<<8|h.call(p,6)<<16|h.call(p,7)<<24)>>>0)},l.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},l.prototype.zzEncode=function(){var p=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^p)>>>0,this.lo=(this.lo<<1^p)>>>0,this},l.prototype.zzDecode=function(){var p=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^p)>>>0,this.hi=(this.hi>>>1^p)>>>0,this},l.prototype.length=function(){var p=this.lo,a=(this.lo>>>28|this.hi<<4)>>>0,o=this.hi>>>24;return o===0?a===0?p<16384?p<128?1:2:p<2097152?3:4:a<16384?a<128?5:6:a<2097152?7:8:o<128?9:10}},9693:function(f,r,c){var d=r;function l(s,h,p){for(var a=Object.keys(h),o=0;o0)},d.Buffer=function(){try{var s=d.inquire("buffer").Buffer;return s.prototype.utf8Write?s:null}catch{return null}}(),d._Buffer_from=null,d._Buffer_allocUnsafe=null,d.newBuffer=function(s){return typeof s=="number"?d.Buffer?d._Buffer_allocUnsafe(s):new d.Array(s):d.Buffer?d._Buffer_from(s):typeof Uint8Array>"u"?s:new Uint8Array(s)},d.Array=typeof Uint8Array<"u"?Uint8Array:Array,d.Long=d.global.dcodeIO&&d.global.dcodeIO.Long||d.global.Long||d.inquire("long"),d.key2Re=/^true|false|0|1$/,d.key32Re=/^-?(?:0|[1-9][0-9]*)$/,d.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,d.longToHash=function(s){return s?d.LongBits.from(s).toHash():d.LongBits.zeroHash},d.longFromHash=function(s,h){var p=d.LongBits.fromHash(s);return d.Long?d.Long.fromBits(p.lo,p.hi,h):p.toNumber(!!h)},d.merge=l,d.lcFirst=function(s){return s.charAt(0).toLowerCase()+s.substring(1)},d.newError=m,d.ProtocolError=m("ProtocolError"),d.oneOfGetter=function(s){for(var h={},p=0;p-1;--o)if(h[a[o]]===1&&this[a[o]]!==void 0&&this[a[o]]!==null)return a[o]}},d.oneOfSetter=function(s){return function(h){for(var p=0;p{f.exports=t;var d,l=c(9693),m=l.LongBits,s=l.base64,h=l.utf8;function p(y,_,v){this.fn=y,this.len=_,this.next=void 0,this.val=v}function a(){}function o(y){this.head=y.head,this.tail=y.tail,this.len=y.len,this.next=y.states}function t(){this.len=0,this.head=new p(a,0,0),this.tail=this.head,this.states=null}var e=function(){return l.Buffer?function(){return(t.create=function(){return new d})()}:function(){return new t}};function n(y,_,v){_[v]=255&y}function i(y,_){this.len=y,this.next=void 0,this.val=_}function u(y,_,v){for(;y.hi;)_[v++]=127&y.lo|128,y.lo=(y.lo>>>7|y.hi<<25)>>>0,y.hi>>>=7;for(;y.lo>127;)_[v++]=127&y.lo|128,y.lo=y.lo>>>7;_[v++]=y.lo}function g(y,_,v){_[v]=255&y,_[v+1]=y>>>8&255,_[v+2]=y>>>16&255,_[v+3]=y>>>24}t.create=e(),t.alloc=function(y){return new l.Array(y)},l.Array!==Array&&(t.alloc=l.pool(t.alloc,l.Array.prototype.subarray)),t.prototype._push=function(y,_,v){return this.tail=this.tail.next=new p(y,_,v),this.len+=_,this},i.prototype=Object.create(p.prototype),i.prototype.fn=function(y,_,v){for(;y>127;)_[v++]=127&y|128,y>>>=7;_[v]=y},t.prototype.uint32=function(y){return this.len+=(this.tail=this.tail.next=new i((y>>>=0)<128?1:y<16384?2:y<2097152?3:y<268435456?4:5,y)).len,this},t.prototype.int32=function(y){return y<0?this._push(u,10,m.fromNumber(y)):this.uint32(y)},t.prototype.sint32=function(y){return this.uint32((y<<1^y>>31)>>>0)},t.prototype.uint64=function(y){var _=m.from(y);return this._push(u,_.length(),_)},t.prototype.int64=t.prototype.uint64,t.prototype.sint64=function(y){var _=m.from(y).zzEncode();return this._push(u,_.length(),_)},t.prototype.bool=function(y){return this._push(n,1,y?1:0)},t.prototype.fixed32=function(y){return this._push(g,4,y>>>0)},t.prototype.sfixed32=t.prototype.fixed32,t.prototype.fixed64=function(y){var _=m.from(y);return this._push(g,4,_.lo)._push(g,4,_.hi)},t.prototype.sfixed64=t.prototype.fixed64,t.prototype.float=function(y){return this._push(l.float.writeFloatLE,4,y)},t.prototype.double=function(y){return this._push(l.float.writeDoubleLE,8,y)};var b=l.Array.prototype.set?function(y,_,v){_.set(y,v)}:function(y,_,v){for(var w=0;w>>0;if(!_)return this._push(n,1,0);if(l.isString(y)){var v=t.alloc(_=s.length(y));s.decode(y,v,0),y=v}return this.uint32(_)._push(b,_,y)},t.prototype.string=function(y){var _=h.length(y);return _?this.uint32(_)._push(h.write,_,y):this._push(n,1,0)},t.prototype.fork=function(){return this.states=new o(this),this.head=this.tail=new p(a,0,0),this.len=0,this},t.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new p(a,0,0),this.len=0),this},t.prototype.ldelim=function(){var y=this.head,_=this.tail,v=this.len;return this.reset().uint32(v),v&&(this.tail.next=y.next,this.tail=_,this.len+=v),this},t.prototype.finish=function(){for(var y=this.head.next,_=this.constructor.alloc(this.len),v=0;y;)y.fn(y.val,_,v),v+=y.len,y=y.next;return _},t._configure=function(y){d=y,t.create=e(),d._configure()}},3155:(f,r,c)=>{f.exports=m;var d=c(1173);(m.prototype=Object.create(d.prototype)).constructor=m;var l=c(9693);function m(){d.call(this)}function s(h,p,a){h.length<40?l.utf8.write(h,p,a):p.utf8Write?p.utf8Write(h,a):p.write(h,a)}m._configure=function(){m.alloc=l._Buffer_allocUnsafe,m.writeBytesBuffer=l.Buffer&&l.Buffer.prototype instanceof Uint8Array&&l.Buffer.prototype.set.name==="set"?function(h,p,a){p.set(h,a)}:function(h,p,a){if(h.copy)h.copy(p,a,0,h.length);else for(var o=0;o>>0;return this.uint32(p),p&&this._push(m.writeBytesBuffer,p,h),this},m.prototype.string=function(h){var p=l.Buffer.byteLength(h);return this.uint32(p),p&&this._push(s,p,h),this},m._configure()},7714:(f,r,c)=>{r.R=void 0;const d=c(6919),l=c(7448);r.R=new class{async init(){}async createSessionHandler(m,s){const h=new d.Session(s);return await h.loadModel(m),new l.OnnxjsSessionHandler(h)}}},4200:(f,r,c)=>{r.c8=r.rX=void 0;const d=c(1670),l=c(5381),m=c(2157),s=c(2306);r.rX=()=>{if((typeof d.env.wasm.initTimeout!="number"||d.env.wasm.initTimeout<0)&&(d.env.wasm.initTimeout=0),typeof d.env.wasm.simd!="boolean"&&(d.env.wasm.simd=!0),typeof d.env.wasm.proxy!="boolean"&&(d.env.wasm.proxy=!1),typeof d.env.wasm.numThreads!="number"||!Number.isInteger(d.env.wasm.numThreads)||d.env.wasm.numThreads<=0){const h=typeof navigator>"u"?(0,l.cpus)().length:navigator.hardwareConcurrency;d.env.wasm.numThreads=Math.min(4,Math.ceil((h||1)/2))}},r.c8=new class{async init(){(0,r.rX)(),await(0,m.initWasm)()}async createSessionHandler(h,p){const a=new s.OnnxruntimeWebAssemblySessionHandler;return await a.loadModel(h,p),Promise.resolve(a)}}},6018:function(f,r,c){var d=this&&this.__createBinding||(Object.create?function(s,h,p,a){a===void 0&&(a=p);var o=Object.getOwnPropertyDescriptor(h,p);o&&!("get"in o?!h.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return h[p]}}),Object.defineProperty(s,a,o)}:function(s,h,p,a){a===void 0&&(a=p),s[a]=h[p]}),l=this&&this.__exportStar||function(s,h){for(var p in s)p==="default"||Object.prototype.hasOwnProperty.call(h,p)||d(h,s,p)};Object.defineProperty(r,"__esModule",{value:!0}),l(c(1670),r);const m=c(1670);{const s=c(7714).R;(0,m.registerBackend)("webgl",s,-10)}{const s=c(4200).c8;(0,m.registerBackend)("cpu",s,10),(0,m.registerBackend)("wasm",s,10),(0,m.registerBackend)("xnnpack",s,9)}},246:(f,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.createAttributeWithCacheKey=void 0;class c{constructor(l){Object.assign(this,l)}get cacheKey(){return this._cacheKey||(this._cacheKey=Object.getOwnPropertyNames(this).sort().map(l=>`${this[l]}`).join(";")),this._cacheKey}}r.createAttributeWithCacheKey=d=>new c(d)},7778:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Attribute=void 0;const d=c(1446),l=c(9395),m=c(9162),s=c(2517);var h=l.onnxruntime.experimental.fbs;class p{constructor(o){if(this._attributes=new Map,o!=null){for(const t of o)t instanceof d.onnx.AttributeProto?this._attributes.set(t.name,[p.getValue(t),p.getType(t)]):t instanceof h.Attribute&&this._attributes.set(t.name(),[p.getValue(t),p.getType(t)]);if(this._attributes.sizem.Tensor.fromProto(n));if(o instanceof h.Attribute)return e.map(n=>m.Tensor.fromOrtTensor(n))}if(t===d.onnx.AttributeProto.AttributeType.STRING&&o instanceof d.onnx.AttributeProto){const n=e;return(0,s.decodeUtf8String)(n)}return t===d.onnx.AttributeProto.AttributeType.STRINGS&&o instanceof d.onnx.AttributeProto?e.map(s.decodeUtf8String):e}static getValueNoCheck(o){return o instanceof d.onnx.AttributeProto?this.getValueNoCheckFromOnnxFormat(o):this.getValueNoCheckFromOrtFormat(o)}static getValueNoCheckFromOnnxFormat(o){switch(o.type){case d.onnx.AttributeProto.AttributeType.FLOAT:return o.f;case d.onnx.AttributeProto.AttributeType.INT:return o.i;case d.onnx.AttributeProto.AttributeType.STRING:return o.s;case d.onnx.AttributeProto.AttributeType.TENSOR:return o.t;case d.onnx.AttributeProto.AttributeType.GRAPH:return o.g;case d.onnx.AttributeProto.AttributeType.FLOATS:return o.floats;case d.onnx.AttributeProto.AttributeType.INTS:return o.ints;case d.onnx.AttributeProto.AttributeType.STRINGS:return o.strings;case d.onnx.AttributeProto.AttributeType.TENSORS:return o.tensors;case d.onnx.AttributeProto.AttributeType.GRAPHS:return o.graphs;default:throw new Error(`unsupported attribute type: ${d.onnx.AttributeProto.AttributeType[o.type]}`)}}static getValueNoCheckFromOrtFormat(o){switch(o.type()){case h.AttributeType.FLOAT:return o.f();case h.AttributeType.INT:return o.i();case h.AttributeType.STRING:return o.s();case h.AttributeType.TENSOR:return o.t();case h.AttributeType.GRAPH:return o.g();case h.AttributeType.FLOATS:return o.floatsArray();case h.AttributeType.INTS:{const t=[];for(let e=0;e{Object.defineProperty(r,"__esModule",{value:!0}),r.resolveBackend=r.backend=void 0;const d=c(5038),l=new Map;async function m(s){const h=r.backend;if(h[s]!==void 0&&function(p){const a=p;return"initialize"in a&&typeof a.initialize=="function"&&"createSessionHandler"in a&&typeof a.createSessionHandler=="function"&&"dispose"in a&&typeof a.dispose=="function"}(h[s])){const p=h[s];let a=p.initialize();if(typeof a=="object"&&"then"in a&&(a=await a),a)return l.set(s,p),p}}r.backend={webgl:new d.WebGLBackend},r.resolveBackend=async function s(h){if(!h)return s(["webgl"]);{const p=typeof h=="string"?[h]:h;for(const a of p){const o=l.get(a);if(o)return o;const t=await m(a);if(t)return t}}throw new Error("no available backend to use")}},5038:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.WebGLBackend=void 0;const d=c(1670),l=c(6231),m=c(6416),s=c(7305);r.WebGLBackend=class{get contextId(){return d.env.webgl.contextId}set contextId(h){d.env.webgl.contextId=h}get matmulMaxBatchSize(){return d.env.webgl.matmulMaxBatchSize}set matmulMaxBatchSize(h){d.env.webgl.matmulMaxBatchSize=h}get textureCacheMode(){return d.env.webgl.textureCacheMode}set textureCacheMode(h){d.env.webgl.textureCacheMode=h}get pack(){return d.env.webgl.pack}set pack(h){d.env.webgl.pack=h}get async(){return d.env.webgl.async}set async(h){d.env.webgl.async=h}initialize(){try{return this.glContext=(0,s.createWebGLContext)(this.contextId),typeof this.matmulMaxBatchSize!="number"&&(this.matmulMaxBatchSize=16),typeof this.textureCacheMode!="string"&&(this.textureCacheMode="full"),typeof this.pack!="boolean"&&(this.pack=!1),typeof this.async!="boolean"&&(this.async=!1),l.Logger.setWithEnv(d.env),l.Logger.verbose("WebGLBackend",`Created WebGLContext: ${typeof this.glContext} with matmulMaxBatchSize: ${this.matmulMaxBatchSize}; textureCacheMode: ${this.textureCacheMode}; pack: ${this.pack}; async: ${this.async}.`),!0}catch(h){return l.Logger.warning("WebGLBackend",`Unable to initialize WebGLBackend. ${h}`),!1}}createSessionHandler(h){return new m.WebGLSessionHandler(this,h)}dispose(){this.glContext.dispose()}}},5107:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CoordsGlslLib=void 0;const d=c(2517),l=c(8520),m=c(5060),s=c(7859),h=c(9390);class p extends l.GlslLib{constructor(o){super(o)}getFunctions(){return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},this.offsetToCoords()),this.coordsToOffset()),this.toVec()),this.valueFrom()),this.getCommonUtilFuncs()),this.getInputsSamplingSnippets()),this.getOutputSamplingSnippet())}getCustomTypes(){return{}}offsetToCoords(){return{offsetToCoords:new l.GlslLibRoutine(` + vec2 offsetToCoords(int offset, int width, int height) { + int t = offset / width; + int s = offset - t*width; + vec2 coords = (vec2(s,t) + vec2(0.5,0.5)) / vec2(width, height); + return coords; + } + `)}}coordsToOffset(){return{coordsToOffset:new l.GlslLibRoutine(` + int coordsToOffset(vec2 coords, int width, int height) { + float s = coords.s * float(width); + float t = coords.t * float(height); + int offset = int(t) * width + int(s); + return offset; + } + `)}}getOutputSamplingSnippet(){const o=this.context.outputTextureLayout;return o.isPacked?this.getPackedOutputSamplingSnippet(o):this.getUnpackedOutputSamplingSnippet(o)}getPackedOutputSamplingSnippet(o){const t=o.unpackedShape,e=[o.width,o.height],n={},i="getOutputCoords";switch(t.length){case 0:n[i]=this.getOutputScalarCoords();break;case 1:n[i]=this.getOutputPacked1DCoords(t,e);break;case 2:n[i]=this.getOutputPacked2DCoords(t,e);break;case 3:n[i]=this.getOutputPacked3DCoords(t,e);break;default:n[i]=this.getOutputPackedNDCoords(t,e)}const u=` + void setOutput(vec4 val) { + ${(0,m.getGlsl)(this.context.glContext.version).output} = val; + } + `;return n.floatTextureSetRGBA=new l.GlslLibRoutine(u),n}getUnpackedOutputSamplingSnippet(o){const t=o.unpackedShape,e=[o.width,o.height],n={},i="getOutputCoords";switch(t.length){case 0:n[i]=this.getOutputScalarCoords();break;case 1:n[i]=this.getOutputUnpacked1DCoords(t,e);break;case 2:n[i]=this.getOutputUnpacked2DCoords(t,e);break;case 3:n[i]=this.getOutputUnpacked3DCoords(t,e);break;case 4:n[i]=this.getOutputUnpacked4DCoords(t,e);break;case 5:n[i]=this.getOutputUnpacked5DCoords(t,e);break;case 6:n[i]=this.getOutputUnpacked6DCoords(t,e);break;default:throw new Error(`Unsupported output dimensionality: ${t.length}`)}const u=` + void setOutput(float val) { + ${(0,m.getGlsl)(this.context.glContext.version).output} = vec4(val, 0, 0, 0); + } + `;return n.floatTextureSetR=new l.GlslLibRoutine(u),n}getOutputScalarCoords(){return new l.GlslLibRoutine(` + int getOutputCoords() { + return 0; + } + `)}getOutputPacked1DCoords(o,t){const e=t;let n="";return e[0]===1?(n=` + int getOutputCoords() { + return 2 * int(TexCoords.y * ${e[1]}.0); + } + `,new l.GlslLibRoutine(n)):e[1]===1?(n=` + int getOutputCoords() { + return 2 * int(TexCoords.x * ${e[0]}.0); + } + `,new l.GlslLibRoutine(n)):(n=` + int getOutputCoords() { + ivec2 resTexRC = ivec2(TexCoords.xy * + vec2(${e[0]}, ${e[1]})); + return 2 * (resTexRC.y * ${e[0]} + resTexRC.x); + } + `,new l.GlslLibRoutine(n))}getOutputPacked2DCoords(o,t){let e="";if(d.ArrayUtil.arraysEqual(o,t))return e=` + ivec2 getOutputCoords() { + return 2 * ivec2(TexCoords.xy * vec2(${t[0]}, ${t[1]})); + } + `,new l.GlslLibRoutine(e);const n=t,i=Math.ceil(o[1]/2);return e=` + ivec2 getOutputCoords() { + ivec2 resTexRC = ivec2(TexCoords.xy * + vec2(${n[0]}, ${n[1]})); + + int index = resTexRC.y * ${n[0]} + resTexRC.x; + + // reverse r and c order for packed texture + int r = imod(index, ${i}) * 2; + int c = 2 * (index / ${i}); + + return ivec2(r, c); + } + `,new l.GlslLibRoutine(e)}getOutputPacked3DCoords(o,t){const e=[t[0],t[1]],n=Math.ceil(o[2]/2),i=n*Math.ceil(o[1]/2),u=` + ivec3 getOutputCoords() { + ivec2 resTexRC = ivec2(TexCoords.xy * + vec2(${e[0]}, ${e[1]})); + int index = resTexRC.y * ${e[0]} + resTexRC.x; + + int b = index / ${i}; + index -= b * ${i}; + + // reverse r and c order for packed texture + int r = imod(index, ${n}) * 2; + int c = 2 * (index / ${n}); + + return ivec3(b, r, c); + } + `;return new l.GlslLibRoutine(u)}getOutputPackedNDCoords(o,t){const e=[t[0],t[1]],n=Math.ceil(o[o.length-1]/2),i=n*Math.ceil(o[o.length-2]/2);let u=i,g="",b="b, r, c";for(let _=2;_=0;--b)i[b]=i[b+1]*o[b+1];const u=["r","c","d"],g=i.map((b,y)=>`int ${u[y]} = index / ${b}; ${y===i.length-1?`int ${u[y+1]} = index - ${u[y]} * ${b}`:`index -= ${u[y]} * ${b}`};`).join("");return e=` + ivec3 getOutputCoords() { + ivec2 resTexRC = ivec2(TexCoords.xy * + vec2(${t[0]}, ${t[1]})); + int index = resTexRC.y * ${t[0]} + resTexRC.x; + ${g} + return ivec3(r, c, d); + } + `,new l.GlslLibRoutine(e)}getOutputUnpacked4DCoords(o,t){let e="";const n=o.length;let i=null;n<2&&(i=[]),i=new Array(n-1),i[n-2]=o[n-1];for(let b=n-3;b>=0;--b)i[b]=i[b+1]*o[b+1];const u=["r","c","d","d2"],g=i.map((b,y)=>`int ${u[y]} = index / ${b}; ${y===i.length-1?`int ${u[y+1]} = index - ${u[y]} * ${b}`:`index -= ${u[y]} * ${b}`};`).join("");return e=` + ivec4 getOutputCoords() { + ivec2 resTexRC = ivec2(TexCoords.xy * + vec2(${t[0]}, ${t[1]})); + int index = resTexRC.y * ${t[0]} + resTexRC.x; + ${g} + return ivec4(r, c, d, d2); + } + `,new l.GlslLibRoutine(e)}getOutputUnpacked5DCoords(o,t){let e="";const n=o.length;let i=null;n<2&&(i=[]),i=new Array(n-1),i[n-2]=o[n-1];for(let b=n-3;b>=0;--b)i[b]=i[b+1]*o[b+1];const u=["r","c","d","d2","d3"],g=i.map((b,y)=>`int ${u[y]} = index / ${b}; ${y===i.length-1?`int ${u[y+1]} = index - ${u[y]} * ${b}`:`index -= ${u[y]} * ${b}`};`).join("");return e=` + ivec5 getOutputCoords() { + ivec2 resTexRC = ivec2(TexCoords.xy * + vec2(${t[0]}, ${t[1]})); + int index = resTexRC.y * ${t[0]} + resTexRC.x; + ${g} + return ivec5(r, c, d, d2, d3); + } + `,new l.GlslLibRoutine(e)}getOutputUnpacked6DCoords(o,t){let e="";const n=o.length;let i=null;n<2&&(i=[]),i=new Array(n-1),i[n-2]=o[n-1];for(let b=n-3;b>=0;--b)i[b]=i[b+1]*o[b+1];const u=["r","c","d","d2","d3","d4"],g=i.map((b,y)=>`int ${u[y]} = index / ${b}; ${y===i.length-1?`int ${u[y+1]} = index - ${u[y]} * ${b}`:`index -= ${u[y]} * ${b}`};`).join("");return e=` + ivec6 getOutputCoords() { + ivec2 resTexRC = ivec2(TexCoords.xy * + vec2(${t[0]}, ${t[1]})); + int index = resTexRC.y * ${t[0]} + resTexRC.x; + ${g} + return ivec6(r, c, d, d2, d3, d4); + } + `,new l.GlslLibRoutine(e)}getCommonUtilFuncs(){const o={};let t="uvFromFlat";o[t]=new l.GlslLibRoutine(` + vec2 uvFromFlat(int texNumR, int texNumC, int index) { + int texC = index / texNumR; + int texR = index - texC * texNumR; + // TODO: swap texR, texC order in following function so row is corresponding to u and column is corresponding to + // v. + return (vec2(texR, texC) + halfCR) / vec2(texNumR, texNumC); + } + `),t="packedUVfrom1D",o[t]=new l.GlslLibRoutine(` + vec2 packedUVfrom1D(int texNumR, int texNumC, int index) { + int texelIndex = index / 2; + int texR = texelIndex / texNumC; + int texC = texelIndex - texR * texNumC; + return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR); + } + `),t="packedUVfrom2D",o[t]=new l.GlslLibRoutine(` + vec2 packedUVfrom2D(int texNumR, int texNumC, int texelsInLogicalRow, int row, int col) { + int texelIndex = (row / 2) * texelsInLogicalRow + (col / 2); + int texR = texelIndex / texNumC; + int texC = texelIndex - texR * texNumC; + return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR); + } + `),t="packedUVfrom3D",o[t]=new l.GlslLibRoutine(` + vec2 packedUVfrom3D(int texNumR, int texNumC, + int texelsInBatch, int texelsInLogicalRow, int b, + int row, int col) { + int index = b * texelsInBatch + (row / 2) * texelsInLogicalRow + (col / 2); + int texR = index / texNumC; + int texC = index - texR * texNumC; + return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR); + } + `),t="sampleTexture";const e=(0,m.getGlsl)(this.context.glContext.version);return o[t]=new l.GlslLibRoutine(` + float sampleTexture(sampler2D textureSampler, vec2 uv) { + return ${e.texture2D}(textureSampler, uv).r; + }`),o}getInputsSamplingSnippets(){const o={},t=this.context.outputTextureLayout;return this.context.programInfo.inputNames.forEach((e,n)=>{const i=this.context.inputTextureLayouts[n],u=(0,h.generateShaderFuncNameFromInputSamplerName)(e);i.isPacked?o[u]=this.getPackedSamplerFromInput(u,e,i):o[u]=this.getUnpackedSamplerFromInput(u,e,i);const g=(0,h.generateShaderFuncNameFromInputSamplerNameAtOutCoords)(e);i.unpackedShape.length<=t.unpackedShape.length&&(i.isPacked?o[g]=this.getPackedSamplerAtOutputCoords(g,i,t,e):o[g]=this.getUnpackedSamplerAtOutputCoords(g,i,t,e))}),o}getPackedSamplerAtOutputCoords(o,t,e,n){const i=t.unpackedShape,u=e.unpackedShape,g=n,b=(0,h.generateShaderFuncNameFromInputSamplerName)(g),y=i.length,_=u.length,v=d.BroadcastUtil.getBroadcastDims(i,u),w=(0,h.getCoordsDataType)(_),T=_-y;let A;const E=(0,h.getGlChannels)();A=y===0?"":_<2&&v.length>=1?"coords = 0;":v.map(F=>`coords.${E[F+T]} = 0;`).join(` +`);let x="";x=_<2&&y>0?"coords":i.map((F,q)=>`coords.${E[q+T]}`).join(", ");let P="return outputValue;";const C=d.ShapeUtil.size(i)===1,k=d.ShapeUtil.size(u)===1;if(y!==1||C||k){if(C&&!k)P=_===1?` + return vec4(outputValue.x, outputValue.x, 0., 0.); + `:` + return vec4(outputValue.x); + `;else if(v.length){const F=y-2,q=y-1;v.indexOf(F)>-1&&v.indexOf(q)>-1?P="return vec4(outputValue.x);":v.indexOf(F)>-1?P="return vec4(outputValue.x, outputValue.y, outputValue.x, outputValue.y);":v.indexOf(q)>-1&&(P="return vec4(outputValue.xx, outputValue.zz);")}}else P=` + return vec4(outputValue.xy, outputValue.xy); + `;const $=` + vec4 ${o}() { + ${w} coords = getOutputCoords(); + + int lastDim = coords.${E[_-1]}; + coords.${E[_-1]} = coords.${E[_-2]}; + coords.${E[_-2]} = lastDim; + + ${A} + vec4 outputValue = ${b}(${x}); + ${P} + } + `;return new l.GlslLibRoutine($,["coordinates.getOutputCoords"])}getUnpackedSamplerAtOutputCoords(o,t,e,n){const i=[e.width,e.height],u=[t.width,t.height],g=t.unpackedShape.length,b=e.unpackedShape.length,y=t.unpackedShape,_=e.unpackedShape,v=(0,h.generateShaderFuncNameFromInputSamplerName)(n);if(g===b&&d.ArrayUtil.arraysEqual(u,i)){const k=` + float ${o}() { + return sampleTexture(${n}, TexCoords); + } + `;return new l.GlslLibRoutine(k,["coordinates.sampleTexture"])}const w=(0,h.getCoordsDataType)(b),T=d.BroadcastUtil.getBroadcastDims(y,_),A=b-g;let E;const x=(0,h.getGlChannels)();E=g===0?"":b<2&&T.length>=1?"coords = 0;":T.map(k=>`coords.${x[k+A]} = 0;`).join(` +`);let P="";P=b<2&&g>0?"coords":t.unpackedShape.map((k,$)=>`coords.${x[$+A]}`).join(", ");const C=` + float ${o}() { + ${w} coords = getOutputCoords(); + ${E} + return ${v}(${P}); + } + `;return new l.GlslLibRoutine(C,["coordinates.getOutputCoords"])}getPackedSamplerFromInput(o,t,e){switch(e.unpackedShape.length){case 0:return this.getPackedSamplerScalar(o,t);case 1:return this.getPackedSampler1D(o,t,e);case 2:return this.getPackedSampler2D(o,t,e);case 3:return this.getPackedSampler3D(o,t,e);default:return this.getPackedSamplerND(o,t,e)}}getUnpackedSamplerFromInput(o,t,e){const n=e.unpackedShape;switch(n.length){case 0:return this.getUnpackedSamplerScalar(o,t,e);case 1:return this.getUnpackedSampler1D(o,t,e);case 2:return this.getUnpackedSampler2D(o,t,e);case 3:return this.getUnpackedSampler3D(o,t,e);case 4:return this.getUnpackedSampler4D(o,t,e);case 5:return this.getUnpackedSampler5D(o,t,e);case 6:return this.getUnpackedSampler6D(o,t,e);default:throw new Error(`Unsupported dimension ${n.length}-D`)}}getPackedSamplerScalar(o,t){const e=` + vec4 ${o}() { + return ${(0,m.getGlsl)(this.context.glContext.version).texture2D}(${t}, halfCR); + } + `;return new l.GlslLibRoutine(e)}getPackedSampler1D(o,t,e){const n=[e.width,e.height],i=[n[1],n[0]],u=(0,m.getGlsl)(this.context.glContext.version),g=`vec4 ${o}(int index) { + vec2 uv = packedUVfrom1D( + ${i[0]}, ${i[1]}, index); + return ${u.texture2D}(${t}, uv); + }`;return new l.GlslLibRoutine(g,["coordinates.packedUVfrom1D"])}getPackedSampler2D(o,t,e){const n=e.unpackedShape,i=[e.width,e.height],u=(0,m.getGlsl)(this.context.glContext.version),g=i[0],b=i[1];if(i!=null&&d.ArrayUtil.arraysEqual(n,i)){const w=`vec4 ${o}(int row, int col) { + vec2 uv = (vec2(col, row) + halfCR) / vec2(${b}.0, ${g}.0); + return ${u.texture2D}(${t}, uv); + }`;return new l.GlslLibRoutine(w)}const y=i,_=Math.ceil(n[1]/2),v=`vec4 ${o}(int row, int col) { + vec2 uv = packedUVfrom2D(${y[1]}, ${y[0]}, ${_}, row, col); + return ${u.texture2D}(${t}, uv); + }`;return new l.GlslLibRoutine(v,["coordinates.packedUVfrom2D"])}getPackedSampler3D(o,t,e){const n=e.unpackedShape,i=[e.width,e.height],u=[i[0],i[1]],g=(0,m.getGlsl)(this.context.glContext.version);if(n[0]===1){const w=n.slice(1),T=[1,2],A=(0,h.squeezeInputShape)(n,w),E=["b","row","col"],x=JSON.parse(JSON.stringify(e));x.unpackedShape=A;const P=this.getPackedSamplerFromInput(o,t,x),C=`${P.routineBody} + vec4 ${o}(int b, int row, int col) { + return ${o}(${(0,h.getSqueezedParams)(E,T)}); + } `;return new l.GlslLibRoutine(C,P.dependencies)}const b=u[0],y=u[1],_=Math.ceil(n[2]/2),v=`vec4 ${o}(int b, int row, int col) { + vec2 uv = packedUVfrom3D( + ${y}, ${b}, ${_*Math.ceil(n[1]/2)}, ${_}, b, row, col); + return ${g.texture2D}(${t}, uv);}`;return new l.GlslLibRoutine(v,["coordinates.packedUVfrom3D"])}getPackedSamplerND(o,t,e){const n=e.unpackedShape,i=n.length,u=[e.width,e.height],g=(0,m.getGlsl)(this.context.glContext.version),b=[u[0],u[1]],y=b[1],_=b[0],v=Math.ceil(n[i-1]/2);let w=v*Math.ceil(n[i-2]/2),T="int b, int row, int col",A=`b * ${w} + (row / 2) * ${v} + (col / 2)`;for(let x=2;x{const n=this.context.inputTextureLayouts[e],i=(n.unpackedShape.length>0?n.unpackedShape:n.shape).length;let u=`_${t}`;o[u]=new l.GlslLibRoutine(this.getValueFromSingle(t,i,n.width,n.height,!1),[`shapeUtils.indicesToOffset${u}`,"coordinates.offsetToCoords","fragcolor.getColorAsFloat"]),u+="_T",o[u]=new l.GlslLibRoutine(this.getValueFromSingle(t,i,n.width,n.height,!0),[`shapeUtils.indicesToOffset${u}`,"coordinates.offsetToCoords","fragcolor.getColorAsFloat"])}),o}getValueFromSingle(o,t,e,n,i){let u=`_${o}`;return i&&(u+="_T"),` + float ${u}(int m[${t}]) { + int offset = indicesToOffset${u}(m); + vec2 coords = offsetToCoords(offset, ${e}, ${n}); + float value = getColorAsFloat(${(0,m.getGlsl)(this.context.glContext.version).texture2D}(${o}, coords)); + return value; + } + `}getPackedValueFrom(o,t,e,n,i){let u=`_${o}_Pack`;return i&&(u+="_T"),` + vec4 ${u}(int m[${t}]) { + int offset = indicesToOffset_${o}(m); + vec2 coords = offsetToCoords(offset, ${e}, ${n}); + return ${(0,m.getGlsl)(this.context.glContext.version).texture2D}(${o}, coords); + } + `}}r.CoordsGlslLib=p},8520:(f,r)=>{var c;Object.defineProperty(r,"__esModule",{value:!0}),r.TopologicalSortGlslRoutines=r.GlslLibRoutineNode=r.GlslLibRoutine=r.GlslLib=r.GlslContext=r.FunctionType=void 0,(c=r.FunctionType||(r.FunctionType={}))[c.ValueBased=0]="ValueBased",c[c.Positional=1]="Positional",r.GlslContext=class{constructor(d,l,m,s){this.glContext=d,this.programInfo=l,this.inputTextureLayouts=m,this.outputTextureLayout=s}},r.GlslLib=class{constructor(d){this.context=d}},r.GlslLibRoutine=class{constructor(d,l){this.routineBody=d,this.dependencies=l}},r.GlslLibRoutineNode=class{constructor(d,l,m){this.name=d,this.dependencies=m||[],l&&(this.routineBody=l)}addDependency(d){d&&this.dependencies.push(d)}},r.TopologicalSortGlslRoutines=class{static returnOrderedNodes(d){if(!d||d.length===0)return[];if(d.length===1)return d;const l=new Set,m=new Set,s=new Array;return this.createOrderedNodes(d,l,m,s),s}static createOrderedNodes(d,l,m,s){for(let h=0;h0)for(let p=0;p{Object.defineProperty(r,"__esModule",{value:!0}),r.EncodingGlslLib=void 0;const d=c(8520);class l extends d.GlslLib{constructor(s){super(s)}getFunctions(){return Object.assign(Object.assign({},this.encodeFloat32()),this.decodeFloat32())}getCustomTypes(){return{}}encodeFloat32(){return{encode:new d.GlslLibRoutine(`highp vec4 encode(highp float f) { + return vec4(f, 0.0, 0.0, 0.0); + } + `)}}decodeFloat32(){return{decode:new d.GlslLibRoutine(`highp float decode(highp vec4 rgba) { + return rgba.r; + } + `)}}encodeUint8(){const s=l.isLittleEndian()?"rgba.rgba=rgba.abgr;":"";return{encode:new d.GlslLibRoutine(` + highp vec4 encode(highp float f) { + highp float F = abs(f); + highp float Sign = step(0.0,-f); + highp float Exponent = floor(log2(F)); + highp float Mantissa = (exp2(- Exponent) * F); + Exponent = floor(log2(F) + 127.0) + floor(log2(Mantissa)); + highp vec4 rgba; + rgba[0] = 128.0 * Sign + floor(Exponent*exp2(-1.0)); + rgba[1] = 128.0 * mod(Exponent,2.0) + mod(floor(Mantissa*128.0),128.0); + rgba[2] = floor(mod(floor(Mantissa*exp2(23.0 -8.0)),exp2(8.0))); + rgba[3] = floor(exp2(23.0)*mod(Mantissa,exp2(-15.0))); + ${s} + rgba = rgba / 255.0; // values need to be normalized to [0,1] + return rgba; + } + `)}}decodeUint8(){const s=l.isLittleEndian()?"rgba.rgba=rgba.abgr;":"";return{decode:new d.GlslLibRoutine(` + highp float decode(highp vec4 rgba) { + rgba = rgba * 255.0; // values need to be de-normalized from [0,1] to [0,255] + ${s} + highp float Sign = 1.0 - step(128.0,rgba[0])*2.0; + highp float Exponent = 2.0 * mod(rgba[0],128.0) + step(128.0,rgba[1]) - 127.0; + highp float Mantissa = mod(rgba[1],128.0)*65536.0 + rgba[2]*256.0 +rgba[3] + float(0x800000); + highp float Result = Sign * exp2(Exponent) * (Mantissa * exp2(-23.0 )); + return Result; + } + `)}}static isLittleEndian(){const s=new ArrayBuffer(4),h=new Uint32Array(s),p=new Uint8Array(s);if(h[0]=3735928559,p[0]===239)return!0;if(p[0]===222)return!1;throw new Error("unknown endianness")}}r.EncodingGlslLib=l},9894:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.FragColorGlslLib=void 0;const d=c(8520),l=c(5060);class m extends d.GlslLib{constructor(h){super(h)}getFunctions(){return Object.assign(Object.assign({},this.setFragColor()),this.getColorAsFloat())}getCustomTypes(){return{}}setFragColor(){const h=(0,l.getGlsl)(this.context.glContext.version);return{setFragColor:new d.GlslLibRoutine(` + void setFragColor(float value) { + ${h.output} = encode(value); + } + `,["encoding.encode"])}}getColorAsFloat(){return{getColorAsFloat:new d.GlslLibRoutine(` + float getColorAsFloat(vec4 color) { + return decode(color); + } + `,["encoding.decode"])}}}r.FragColorGlslLib=m},2848:(f,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.replaceInlines=void 0;const c=/@inline[\s\n\r]+(\w+)[\s\n\r]+([0-9a-zA-Z_]+)\s*\(([^)]*)\)\s*{(([^}]|[\n\r])*)}/gm;r.replaceInlines=function(d){const l={};let m;for(;(m=c.exec(d))!==null;){const s=m[3].split(",").map(h=>{const p=h.trim().split(" ");return p&&p.length===2?{type:p[0],name:p[1]}:null}).filter(h=>h!==null);l[m[2]]={params:s,body:m[4]}}for(const s in l){const h="(\\w+)?\\s+([_0-9a-zA-Z]+)\\s+=\\s+__FUNC__\\((.*)\\)\\s*;".replace("__FUNC__",s),p=new RegExp(h,"gm");for(;(m=p.exec(d))!==null;){const a=m[1],o=m[2],t=m[3].split(","),e=a?`${a} ${o};`:"";let n=l[s].body,i="";l[s].params.forEach((g,b)=>{g&&(i+=`${g.type} ${g.name} = ${t[b]}; +`)}),n=`${i} + ${n}`,n=n.replace("return",`${o} = `);const u=` + ${e} + { + ${n} + } + `;d=d.replace(m[0],u)}}return d.replace(c,"")}},8879:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.GlslPreprocessor=void 0;const d=c(8520),l=c(2848),m=c(5483),s=c(5060);r.GlslPreprocessor=class{constructor(h,p,a,o){this.libs={},this.glslLibRoutineDependencyGraph={},this.context=new d.GlslContext(h,p,a,o),Object.keys(m.glslRegistry).forEach(e=>{const n=new m.glslRegistry[e](this.context);this.libs[e]=n});const t=this.glslLibRoutineDependencyGraph;for(const e in this.libs){const n=this.libs[e].getFunctions();for(const i in n){const u=e+"."+i;let g;t[u]?(g=t[u],g.routineBody=n[i].routineBody):(g=new d.GlslLibRoutineNode(u,n[i].routineBody),t[u]=g);const b=n[i].dependencies;if(b)for(let y=0;y{const o=a.split(".")[1];h.indexOf(o)!==-1&&p.push(this.glslLibRoutineDependencyGraph[a])}),d.TopologicalSortGlslRoutines.returnOrderedNodes(p)}getUniforms(h,p){const a=[];if(h)for(const o of h)a.push(`uniform sampler2D ${o};`);if(p)for(const o of p)a.push(`uniform ${o.type} ${o.name}${o.arrayLength?`[${o.arrayLength}]`:""};`);return a.join(` +`)}}},5483:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.glslRegistry=void 0;const d=c(5107),l=c(7341),m=c(9894),s=c(2655),h=c(3891);r.glslRegistry={encoding:l.EncodingGlslLib,fragcolor:m.FragColorGlslLib,vec:h.VecGlslLib,shapeUtils:s.ShapeUtilsGlslLib,coordinates:d.CoordsGlslLib}},2655:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ShapeUtilsGlslLib=void 0;const d=c(8520);class l extends d.GlslLib{constructor(s){super(s)}getFunctions(){return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},this.bcastIndex()),this.bcastMatmulIndex()),this.offsetToIndices()),this.indicesToOffset()),this.incrementIndices())}getCustomTypes(){return{}}bcastIndex(){const s=this.context.outputTextureLayout.shape.length,h={};return this.context.programInfo.inputNames.forEach((p,a)=>{const o=this.context.inputTextureLayouts[a].unpackedShape;if(o.length<=s){const t=o.length,e=s-t,n=`bcastIndices_${p}`;let i="";for(let g=0;g{const o=this.context.inputTextureLayouts[a].shape;if(!(o.length<2||o.length>s)){const t=o.length,e=s-t,n=`bcastMatmulIndices_${p}`;let i="";for(let g=0;g{const a=this.context.inputTextureLayouts[p].shape,o=this.context.inputTextureLayouts[p].strides,t=a.length;let e=`indicesToOffset_${h}`;s[e]=new d.GlslLibRoutine(l.indexToOffsetSingle(e,t,o)),e=`indicesToOffset_${h}_T`,s[e]=new d.GlslLibRoutine(l.indexToOffsetSingle(e,t,o.slice().reverse()))}),s}static indexToOffsetSingle(s,h,p){let a="";for(let o=h-1;o>=0;--o)a+=` + offset += indices[${o}] * ${p[o]}; + `;return` + int ${s}(int indices[${h}]) { + int offset = 0; + ${a} + return offset; + } + `}offsetToIndices(){const s={};return this.context.programInfo.inputNames.forEach((h,p)=>{const a=this.context.inputTextureLayouts[p].shape,o=this.context.inputTextureLayouts[p].strides,t=a.length;let e=`offsetToIndices_${h}`;s[e]=new d.GlslLibRoutine(l.offsetToIndicesSingle(e,t,o)),e=`offsetToIndices_${h}_T`,s[e]=new d.GlslLibRoutine(l.offsetToIndicesSingle(e,t,o.slice().reverse()))}),s}static offsetToIndicesSingle(s,h,p){const a=[];for(let o=0;o{const a=this.context.inputTextureLayouts[p].shape,o=a.length,t=`incrementIndices_${h}`;let e="";for(let i=0;i= 0; --i) { + if(i > axis) continue; + indices[i] += 1; + if(indices[i] < shape[i]) { + break; + } + indices[i] = 0; + } + } + `;s[t]=new d.GlslLibRoutine(n)}),s}}r.ShapeUtilsGlslLib=l},5060:(f,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.getDefaultFragShaderMain=r.getFragShaderPreamble=r.getVertexShaderSource=r.getGlsl=void 0;const c={version:"",attribute:"attribute",varyingVertex:"varying",varyingFrag:"varying",texture2D:"texture2D",output:"gl_FragColor",outputDeclaration:""},d={version:"#version 300 es",attribute:"in",varyingVertex:"out",varyingFrag:"in",texture2D:"texture",output:"outputColor",outputDeclaration:"out vec4 outputColor;"};function l(m){return m===1?c:d}r.getGlsl=l,r.getVertexShaderSource=function(m){const s=l(m);return`${s.version} + precision highp float; + ${s.attribute} vec3 position; + ${s.attribute} vec2 textureCoord; + + ${s.varyingVertex} vec2 TexCoords; + + void main() + { + gl_Position = vec4(position, 1.0); + TexCoords = textureCoord; + }`},r.getFragShaderPreamble=function(m){const s=l(m);return`${s.version} + precision highp float; + precision highp int; + precision highp sampler2D; + ${s.varyingFrag} vec2 TexCoords; + ${s.outputDeclaration} + const vec2 halfCR = vec2(0.5, 0.5); + + // Custom vector types to handle higher dimenalities. + struct ivec5 + { + int x; + int y; + int z; + int w; + int u; + }; + + struct ivec6 + { + int x; + int y; + int z; + int w; + int u; + int v; + }; + + int imod(int x, int y) { + return x - y * (x / y); + } + + `},r.getDefaultFragShaderMain=function(m,s){return` + void main() { + int indices[${s}]; + toVec(TexCoords, indices); + vec4 result = vec4(process(indices)); + ${l(m).output} = result; + } + `}},3891:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.VecGlslLib=void 0;const d=c(8520);class l extends d.GlslLib{constructor(s){super(s)}getCustomTypes(){return{}}getFunctions(){return Object.assign(Object.assign(Object.assign(Object.assign({},this.binaryVecFunctions()),this.copyVec()),this.setVecItem()),this.getVecItem())}binaryVecFunctions(){const s=this.context.outputTextureLayout.shape.length,h={add:"+=",sub:"-=",mul:"*=",div:"/="},p={};for(const a in h){const o=`${a}Vec`;let t="";for(let n=0;n{Object.defineProperty(r,"__esModule",{value:!0}),r.WebGLInferenceHandler=void 0;const d=c(6231),l=c(9162),m=c(2517),s=c(2403),h=c(7019),p=c(8710),a=c(5611),o=c(4057),t=c(2039);r.WebGLInferenceHandler=class{constructor(e){this.session=e,this.packedTextureDataCache=new Map,this.unpackedTextureDataCache=new Map}calculateTextureWidthAndHeight(e,n){return(0,o.calculateTextureWidthAndHeight)(this.session.layoutStrategy,e,n)}executeProgram(e,n){if(n.length{const T=w.map(E=>`${E.unpackedShape.join(",")};${E.width}x${E.height}`).join("_");let A=v.name;return v.cacheHint&&(A+="["+v.cacheHint+"]"),A+=":"+T,A})(e,i);let g=this.session.programManager.getArtifact(u);const b=g?g.programInfo:typeof e.get=="function"?e.get():e,y=(0,o.createTextureLayoutFromTextureType)(this.session.layoutStrategy,b.output.dims,b.output.textureType),_=this.createTextureData(y,b.output.type);return g||(g=this.session.programManager.build(b,i,_),this.session.programManager.setArtifact(u,g)),this.runProgram(g,i,_),_}run(e,n){return this.executeProgram(e,n).tensor}runProgram(e,n,i){for(let u=0;uthis.readTexture(b),async y=>this.readTextureAsync(b),void 0,g),texture:i});return this.setTextureData(b.tensor.dataId,b,e.isPacked),b}getTextureData(e,n=!1){return this.session.isInitializer(e)?this.session.getTextureData(e,n):n?this.packedTextureDataCache.get(e):this.unpackedTextureDataCache.get(e)}setTextureData(e,n,i=!1){this.session.isInitializer(e)?this.session.setTextureData(e,n,i):(i?this.packedTextureDataCache:this.unpackedTextureDataCache).set(e,n)}isTextureLayoutCached(e,n=!1){return!!this.getTextureData(e.dataId,n)}dispose(){this.session.textureManager.clearActiveTextures(),this.packedTextureDataCache.forEach(e=>this.session.textureManager.releaseTexture(e)),this.packedTextureDataCache=new Map,this.unpackedTextureDataCache.forEach(e=>this.session.textureManager.releaseTexture(e)),this.unpackedTextureDataCache=new Map}readTexture(e){return e.isPacked?this.readTexture(this.unpack(e)):this.session.backend.glContext.isFloat32DownloadSupported?this.session.textureManager.readTexture(e,e.tensor.type,e.channels):this.session.textureManager.readUint8TextureAsFloat((0,p.encodeAsUint8)(this,e))}async readTextureAsync(e){return e.isPacked?this.readTextureAsync(this.unpack(e)):this.session.backend.glContext.isFloat32DownloadSupported?this.session.textureManager.readTextureAsync(e,e.tensor.type,e.channels):this.session.textureManager.readUint8TextureAsFloat((0,p.encodeAsUint8)(this,e))}pack(e){return this.executeProgram((0,s.createPackProgramInfoLoader)(this,e.tensor),[e.tensor])}unpack(e){return this.executeProgram((0,a.createUnpackProgramInfoLoader)(this,e.tensor),[e.tensor])}}},1640:function(f,r,c){var d=this&&this.__createBinding||(Object.create?function(Y,Z,te,he){he===void 0&&(he=te);var Me=Object.getOwnPropertyDescriptor(Z,te);Me&&!("get"in Me?!Z.__esModule:Me.writable||Me.configurable)||(Me={enumerable:!0,get:function(){return Z[te]}}),Object.defineProperty(Y,he,Me)}:function(Y,Z,te,he){he===void 0&&(he=te),Y[he]=Z[te]}),l=this&&this.__setModuleDefault||(Object.create?function(Y,Z){Object.defineProperty(Y,"default",{enumerable:!0,value:Z})}:function(Y,Z){Y.default=Z}),m=this&&this.__importStar||function(Y){if(Y&&Y.__esModule)return Y;var Z={};if(Y!=null)for(var te in Y)te!=="default"&&Object.prototype.hasOwnProperty.call(Y,te)&&d(Z,Y,te);return l(Z,Y),Z};Object.defineProperty(r,"__esModule",{value:!0}),r.WEBGL_OP_RESOLVE_RULES=void 0;const s=c(2898),h=m(c(7839)),p=c(4196),a=c(2069),o=c(8138),t=c(9663),e=c(5193),n=c(7992),i=c(1253),u=c(4776),g=c(6572),b=c(3346),y=c(5623),_=c(2870),v=c(2143),w=c(4939),T=c(718),A=c(2268),E=c(8117),x=c(2278),P=c(5524),C=c(5975),k=c(3933),$=c(6558),F=c(5723),q=c(3738),D=m(c(4909)),U=c(8428),J=c(9793);r.WEBGL_OP_RESOLVE_RULES=[["Abs","","6+",D.abs],["Acos","","7+",D.acos],["Add","","7+",h.add],["And","","7+",h.and],["Asin","","7+",D.asin],["Atan","","7+",D.atan],["AveragePool","","7+",v.averagePool,v.parseAveragePoolAttributes],["BatchNormalization","","7+",s.batchNormalization,s.parseBatchNormalizationAttributes],["Cast","","6+",p.cast,p.parseCastAttributes],["Ceil","","6+",D.ceil],["Clip","","6-10",D.clip,D.parseClipAttributes],["Clip","","11+",D.clipV11],["Concat","","4+",a.concat,a.parseConcatAttributes],["Conv","","1+",o.conv,o.parseConvAttributes],["ConvTranspose","","1+",t.convTranspose,t.parseConvTransposeAttributes],["Cos","","7+",D.cos],["Div","","7+",h.div],["Dropout","","7+",D.identity],["DepthToSpace","","1+",e.depthToSpace,e.parseDepthToSpaceAttributes],["Equal","","7+",h.equal],["Elu","","6+",D.elu,D.parseEluAttributes],["Exp","","6+",D.exp],["Flatten","","1+",n.flatten,n.parseFlattenAttributes],["Floor","","6+",D.floor],["FusedConv","com.microsoft","1+",o.conv,o.parseConvAttributes],["Gather","","1+",i.gather,i.parseGatherAttributes],["Gemm","","7-10",u.gemm,u.parseGemmAttributesV7],["Gemm","","11+",u.gemm,u.parseGemmAttributesV11],["GlobalAveragePool","","1+",v.globalAveragePool,v.parseGlobalAveragePoolAttributes],["GlobalMaxPool","","1+",v.globalMaxPool],["Greater","","7+",h.greater],["Identity","","1+",D.identity],["ImageScaler","","1+",g.imageScaler,g.parseImageScalerAttributes],["InstanceNormalization","","6+",b.instanceNormalization,b.parseInstanceNormalizationAttributes],["LeakyRelu","","6+",D.leakyRelu,D.parseLeakyReluAttributes],["Less","","7+",h.less],["Log","","6+",D.log],["MatMul","","1+",y.matMul,y.parseMatMulAttributes],["MaxPool","","1+",v.maxPool,v.parseMaxPoolAttributes],["Mul","","7+",h.mul],["Neg","","6+",D.neg],["Not","","1+",D.not],["Or","","7+",h.or],["Pad","","2-10",_.padV2,_.parsePadAttributesV2],["Pad","","11+",_.padV11,_.parsePadAttributesV11],["Pow","","7+",h.pow],["PRelu","","7+",h.pRelu],["ReduceLogSum","","1+",w.reduceLogSum,w.parseReduceAttributes],["ReduceMax","","1+",w.reduceMax,w.parseReduceAttributes],["ReduceMean","","1+",w.reduceMean,w.parseReduceAttributes],["ReduceMin","","1+",w.reduceMin,w.parseReduceAttributes],["ReduceProd","","1+",w.reduceProd,w.parseReduceAttributes],["ReduceSum","","1-12",w.reduceSum,w.parseReduceAttributes],["ReduceSumSquare","","1+",w.reduceLogSumSquare,w.parseReduceAttributes],["Relu","","6+",D.relu],["Reshape","","5+",T.reshape],["Resize","","10",A.resize,A.parseResizeAttributesV10],["Resize","","11+",A.resize,A.parseResizeAttributesV11],["Shape","","1+",E.shape],["Sigmoid","","6+",D.sigmoid],["Sin","","7+",D.sin],["Slice","","10+",x.sliceV10],["Slice","","1-9",x.slice,x.parseSliceAttributes],["Softmax","","1-12",P.softmax,P.parseSoftmaxAttributes],["Softmax","","13+",P.softmaxV13,P.parseSoftmaxAttributesV13],["Split","","2-12",C.split,C.parseSplitAttributes],["Sqrt","","6+",D.sqrt],["Squeeze","","1-12",k.squeeze,k.parseSqueezeAttributes],["Squeeze","","13+",k.squeezeV13],["Sub","","7+",h.sub],["Sum","","6+",$.sum],["Tan","","7+",D.tan],["Tanh","","6+",D.tanh],["Tile","","6+",F.tile],["Transpose","","1+",q.transpose,q.parseTransposeAttributes],["Upsample","","7-8",J.upsample,J.parseUpsampleAttributesV7],["Upsample","","9",J.upsample,J.parseUpsampleAttributesV9],["Unsqueeze","","1-12",U.unsqueeze,U.parseUnsqueezeAttributes],["Unsqueeze","","13+",U.unsqueezeV13],["Xor","","7+",h.xor]]},2898:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.parseBatchNormalizationAttributes=r.batchNormalization=void 0;const d=c(246),l=c(5060),m=c(2039),s={name:"BatchNormalization",inputNames:["A","Scale","B","Mean","Variance"],inputTypes:[m.TextureType.unpacked,m.TextureType.unpacked,m.TextureType.unpacked,m.TextureType.unpacked,m.TextureType.unpacked]};r.batchNormalization=(a,o,t)=>(p(o),[a.run(Object.assign(Object.assign({},s),{cacheHint:t.cacheKey,get:()=>h(a,o,t)}),o)]),r.parseBatchNormalizationAttributes=a=>{const o=a.attributes.getFloat("epsilon",1e-5),t=a.attributes.getFloat("momentum",.9),e=a.attributes.getInt("spatial",1);return(0,d.createAttributeWithCacheKey)({epsilon:o,momentum:t,spatial:e})};const h=(a,o,t)=>{const e=(0,l.getGlsl)(a.session.backend.glContext.version),n=o[0].dims.length,[i,u]=a.calculateTextureWidthAndHeight(o[1].dims,m.TextureType.unpacked),g=` + float process(int[${n}] indices) { + vec2 position = offsetToCoords(indices[1], ${i}, ${u}); + float scale = getColorAsFloat(${e.texture2D}(Scale, position)); + float mean = getColorAsFloat(${e.texture2D}(Mean, position)); + float variance = getColorAsFloat(${e.texture2D}(Variance, position)); + float b = getColorAsFloat(${e.texture2D}(B, position)); + + return scale * ( (_A(indices) - mean) / sqrt(variance + float(${t.epsilon})) ) + b; + }`;return Object.assign(Object.assign({},s),{output:{dims:o[0].dims,type:o[0].type,textureType:m.TextureType.unpacked},shaderSource:g})},p=a=>{if(!a||a.length!==5)throw new Error("BatchNormalization requires 5 inputs.");const o=a[0],t=a[1],e=a[2],n=a[3],i=a[4];if(o.dims.length<3||t.dims.length!==1||e.dims.length!==1||n.dims.length!==1||i.dims.length!==1)throw new Error("invalid input shape.");if(t.dims[0]!==o.dims[1]||e.dims[0]!==o.dims[1]||n.dims[0]!==o.dims[1]||i.dims[0]!==o.dims[1])throw new Error("invalid input shape.");if(o.type!=="float32"&&o.type!=="float64"||t.type!=="float32"&&t.type!=="float64"||e.type!=="float32"&&e.type!=="float64"||n.type!=="float32"&&n.type!=="float64"||i.type!=="float32"&&i.type!=="float64")throw new Error("invalid input tensor types.")}},7839:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.xor=r.sub=r.pRelu=r.pow=r.or=r.mul=r.less=r.greater=r.equal=r.div=r.and=r.add=r.glslPRelu=r.glslPow=r.glslXor=r.glslOr=r.glslAnd=r.glslLess=r.glslGreater=r.glslEqual=r.glslSub=r.glslMul=r.glslDiv=r.glslAdd=void 0;const d=c(2517),l=c(8520),m=c(5060),s=c(2039);function h(){const w="add_";return{body:` + float ${w}(float a, float b) { + return a + b; + } + vec4 ${w}(vec4 v1, vec4 v2) { + return v1 + v2; + } + `,name:w,type:l.FunctionType.ValueBased}}function p(){const w="div_";return{body:` + float ${w}(float a, float b) { + return a / b; + } + vec4 ${w}(vec4 v1, vec4 v2) { + return v1 / v2; + } + `,name:w,type:l.FunctionType.ValueBased}}function a(){const w="mul_";return{body:` + float ${w}(float a, float b) { + return a * b; + } + vec4 ${w}(vec4 v1, vec4 v2) { + return v1 * v2; + } + `,name:w,type:l.FunctionType.ValueBased}}function o(){const w="sub_";return{body:` + float ${w}(float a, float b) { + return a - b; + } + vec4 ${w}(vec4 v1, vec4 v2) { + return v1 - v2; + } + `,name:w,type:l.FunctionType.ValueBased}}function t(){const w="equal_";return{body:` + float ${w}(float a, float b) { + return float(a == b); + } + vec4 ${w}(vec4 v1, vec4 v2) { + return vec4(equal(v1, v2)); + } + `,name:w,type:l.FunctionType.ValueBased}}function e(){const w="greater_";return{body:` + float ${w}(float a, float b) { + return float(a > b); + } + vec4 ${w}(vec4 v1, vec4 v2) { + return vec4( v1.r > v2.r , + v1.g > v2.g, + v1.b > v2.b, + v1.a > v2.a ); + } + `,name:w,type:l.FunctionType.ValueBased}}function n(){const w="less_";return{body:` + float ${w}(float a, float b) { + return float(a < b); + } + vec4 ${w}(vec4 v1, vec4 v2) { + return vec4( v1.r < v2.r , + v1.g < v2.g, + v1.b < v2.b, + v1.a < v2.a ); + } + `,name:w,type:l.FunctionType.ValueBased}}function i(){const w="and_";return{body:` + float ${w}(float a, float b) { + return float( bool(a) && bool(b) ); + } + vec4 ${w}(vec4 v1, vec4 v2) { + bvec4 b1 = bvec4(v1); + bvec4 b2 = bvec4(v2); + return vec4( b1.r && b2.r , + b1.g && b2.g, + b1.b && b2.b, + b1.a && b2.a ); + } + `,name:w,type:l.FunctionType.ValueBased}}function u(){const w="or_";return{body:` + float ${w}(float a, float b) { + return float( bool(a) || bool(b) ); + } + vec4 ${w}(vec4 v1, vec4 v2) { + bvec4 b1 = bvec4(v1); + bvec4 b2 = bvec4(v2); + return vec4( b1.r || b2.r , + b1.g || b2.g, + b1.b || b2.b, + b1.a || b2.a ); + } + `,name:w,type:l.FunctionType.ValueBased}}function g(){const w="xor_";return{body:` + float ${w}(float a, float b) { + return float( bool(a) ^^ bool(b) ); + } + vec4 ${w}(vec4 v1, vec4 v2) { + bvec4 b1 = bvec4(v1); + bvec4 b2 = bvec4(v2); + return vec4( b1.r ^^ b2.r , + b1.g ^^ b2.g, + b1.b ^^ b2.b, + b1.a ^^ b2.a ); + } + `,name:w,type:l.FunctionType.ValueBased}}function b(){return function(w){const T=`${w}_`;return{body:` + float ${T}(float a, float b) { + return ${w}(a, b); + } + vec4 ${T}(vec4 v1, vec4 v2) { + return ${w}(v1, v2); + } + `,name:T,type:l.FunctionType.ValueBased}}("pow")}function y(){const w="prelu_";return{body:` + float ${w}(float a, float b) { + return a < 0.0 ? a * b: a; + } + vec4 ${w}(vec4 v1, vec4 v2) { + return vec4( + v1.r < 0.0 ? v1.r * v2.r: v1.r, + v1.g < 0.0 ? v1.g * v2.g: v1.g, + v1.b < 0.0 ? v1.b * v2.b: v1.b, + v1.a < 0.0 ? v1.a * v2.a: v1.a + ); + } + `,name:w,type:l.FunctionType.ValueBased}}r.glslAdd=h,r.glslDiv=p,r.glslMul=a,r.glslSub=o,r.glslEqual=t,r.glslGreater=e,r.glslLess=n,r.glslAnd=i,r.glslOr=u,r.glslXor=g,r.glslPow=b,r.glslPRelu=y;const _=(w,T,A,E=T[0].type,x)=>{const P=w.session.pack?s.TextureType.packed:s.TextureType.unpacked;return{name:A.name,inputNames:["A","B"],inputTypes:[P,P],cacheHint:x,get:()=>v(w,T,A,E)}},v=(w,T,A,E=T[0].type)=>{const x=w.session.pack?s.TextureType.packed:s.TextureType.unpacked,P=!d.ShapeUtil.areEqual(T[0].dims,T[1].dims);let C=T[0].dims;const k=w.session.pack;if(P){const q=d.BroadcastUtil.calcShape(T[0].dims,T[1].dims,!1);if(!q)throw new Error("Can't perform binary op on the given tensors");C=q;const D=C.length,U=T[0].dims.length!==0?T[0].dims.length:1,J=T[1].dims.length!==0?T[1].dims.length:1,Y=T[0].dims.length!==0?"bcastIndices_A(indices, aindices);":"aindices[0] = 0;",Z=T[1].dims.length!==0?"bcastIndices_B(indices, bindices);":"bindices[0] = 0;",te=(0,m.getGlsl)(w.session.backend.glContext.version),he=k?` + ${A.body} + void main() { + vec4 a = getAAtOutCoords(); + vec4 b = getBAtOutCoords(); + vec4 result = ${A.name}(a, b); + ${te.output} = result; + }`:` + ${A.body} + float process(int indices[${D}]) { + int aindices[${U}]; + int bindices[${J}]; + ${Y} + ${Z} + return ${A.name}(_A(aindices), _B(bindices)); + }`;return{name:A.name,inputNames:["A","B"],inputTypes:[x,x],output:{dims:C,type:E,textureType:x},shaderSource:he,hasMain:k}}const $=(0,m.getGlsl)(w.session.backend.glContext.version),F=` + ${A.body} + void main() { + vec4 v1 = ${$.texture2D}(A, TexCoords); + vec4 v2 = ${$.texture2D}(B, TexCoords); + vec4 result = ${A.name}(v1, v2); + ${$.output} = result; + } + `;return{name:A.name,inputNames:["A","B"],inputTypes:[x,x],output:{dims:T[0].dims,type:E,textureType:x},shaderSource:F,hasMain:!0}};r.add=(w,T)=>[w.run(_(w,T,h()),T)],r.and=(w,T)=>[w.run(_(w,T,i(),"bool"),T)],r.div=(w,T)=>[w.run(_(w,T,p()),T)],r.equal=(w,T)=>[w.run(_(w,T,t(),"bool"),T)],r.greater=(w,T)=>[w.run(_(w,T,e(),"bool"),T)],r.less=(w,T)=>[w.run(_(w,T,n(),"bool"),T)],r.mul=(w,T)=>[w.run(_(w,T,a()),T)],r.or=(w,T)=>[w.run(_(w,T,u(),"bool"),T)],r.pow=(w,T)=>[w.run(_(w,T,b()),T)],r.pRelu=(w,T)=>[w.run(_(w,T,y()),T)],r.sub=(w,T)=>[w.run(_(w,T,o()),T)],r.xor=(w,T)=>[w.run(_(w,T,g(),"bool"),T)]},4196:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.parseCastAttributes=r.cast=void 0;const d=c(2517);r.cast=(m,s,h)=>(l(s),[m.cast(s[0],h)]),r.parseCastAttributes=m=>d.ProtoUtil.tensorDataTypeFromProto(m.attributes.getInt("to"));const l=m=>{if(!m||m.length!==1)throw new Error("Cast requires 1 input.");if(m[0].type==="string")throw new Error("Invalid input type.")}},1163:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.createPackedConcatProgramInfoLoader=void 0;const d=c(5060),l=c(2039),m=c(9390),s=c(2827);r.createPackedConcatProgramInfoLoader=(p,a,o)=>{const t=(e=a.length,n=o.cacheKey,{name:"Concat (packed)",inputNames:Array.from({length:e},(i,u)=>`X${u}`),inputTypes:Array(e).fill(l.TextureType.packed),cacheHint:n});var e,n;return Object.assign(Object.assign({},t),{get:()=>((i,u,g,b)=>{const y=g[0].dims.slice();if(b>=y.length||b<-1*y.length)throw new Error("axis specified for concat doesn't match input dimensionality");b<0&&(b=y.length+b);const _=y.slice(0);for(let Y=1;YY.dims),x=(0,m.getGlChannels)(v),P=new Array(E.length-1);P[0]=E[0][b];for(let Y=1;Y= ${P[Y-1]}) { + return getChannel( + getX${Y}(${h(x,C,Z)}), + vec2(${h(k,C,Z)})); + }`}const q=P.length,D=P[P.length-1];F+=` + return getChannel( + getX${q}(${h(x,C,D)}), + vec2(${h(k,C,D)}));`;const U=(0,d.getGlsl)(i.session.backend.glContext.version),J=` + ${A} + float getValue(${x.map(Y=>"int "+Y)}) { + ${F} + } + + void main() { + ${T} coords = getOutputCoords(); + int lastDim = coords.${x[v-1]}; + coords.${x[v-1]} = coords.${x[v-2]}; + coords.${x[v-2]} = lastDim; + + vec4 result = vec4(getValue(${w}), 0., 0., 0.); + + ${w[v-1]} = ${w[v-1]} + 1; + if (${w[v-1]} < ${_[v-1]}) { + result.g = getValue(${w}); + } + + ${w[v-2]} = ${w[v-2]} + 1; + if (${w[v-2]} < ${_[v-2]}) { + result.a = getValue(${w}); + } + + ${w[v-1]} = ${w[v-1]} - 1; + if (${w[v-2]} < ${_[v-2]} && + ${w[v-1]} < ${_[v-1]}) { + result.b = getValue(${w}); + } + ${U.output} = result; + } + `;return Object.assign(Object.assign({},u),{output:{dims:_,type:g[0].type,textureType:l.TextureType.packed},shaderSource:J,hasMain:!0})})(p,t,a,o.axis)})};const h=(p,a,o)=>{const t=p.indexOf(a);return p.map((e,n)=>n===t?`${e} - ${o}`:e).join()}},2069:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.parseConcatAttributes=r.concat=void 0;const d=c(246),l=c(2039),m=c(1163);r.concat=(e,n,i)=>(t(n),e.session.pack&&n[0].dims.length>1?[e.run((0,m.createPackedConcatProgramInfoLoader)(e,n,i),n)]:[e.run(s(e,n,i),n)]);const s=(e,n,i)=>{const u=(g=n.length,b=i.cacheKey,{name:"Concat",inputNames:Array.from({length:g},(y,_)=>`X${_}`),inputTypes:Array(g).fill(l.TextureType.unpacked),cacheHint:b});var g,b;return Object.assign(Object.assign({},u),{get:()=>((y,_,v,w)=>{const T=v[0].dims.slice();if(w>=T.length||w<-1*T.length)throw new Error("axis specified for concat doesn't match input dimensionality");w<0&&(w=T.length+w);const A=T.slice(0);for(let $=1;$`int getTextureWhereDataResides(int index) { + ${e.map((n,i)=>`if(index<${n}) {return ${i};} +`).join("")} + }`,p=e=>h(e),a=(e,n)=>{const i=[`float fetchDataFromCorrectTexture(int textureIndex, int indices[${n}]) {`];for(let u=0;u{const n=["int getSizeInConcatAxisValueFromIndex(int index) {"];for(let i=0;i(0,d.createAttributeWithCacheKey)({axis:e.attributes.getInt("axis")});const t=e=>{if(!e||e.length<1)throw new Error("too few inputs");const n=e[0].type,i=e[0].dims.length;if(n==="string")throw new Error("string tensor is not supported yet");for(const u of e){if(u.type!==n)throw new Error("input tensors should be one type");if(u.dims.length!==i)throw new Error("input tensors should have the same shape")}}},4770:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.createUnpackedGroupedConvProgramInfoLoader=void 0;const d=c(6231),l=c(5060),m=c(2039),s=c(8138),h=c(2823);r.createUnpackedGroupedConvProgramInfoLoader=(p,a,o)=>{const t=(e=a.length>2,n=o.cacheKey,{name:"GroupedConv",inputNames:e?["X","W","Bias"]:["X","W"],inputTypes:e?[m.TextureType.unpacked,m.TextureType.unpacked,m.TextureType.unpacked]:[m.TextureType.unpacked,m.TextureType.unpacked],cacheHint:n});var e,n;return Object.assign(Object.assign({},t),{get:()=>((i,u,g,b)=>{const y=u.length>2?"value += getBias(output_channel);":"",_=u[0].dims.slice(),v=u[1].dims.slice(),w=v[0]/b.group;d.Logger.verbose("GroupedConv",`autpPad:${b.autoPad}, dilations:${b.dilations}, group:${b.group}, kernelShape:${b.kernelShape}, pads:${b.pads}, strides:${b.strides}`);const T=(0,s.calculateOutputShape)(_,v,b.dilations,b.pads,b.strides),A=(0,l.getGlsl)(i.session.backend.glContext.version),{activationFunction:E,applyActivation:x}=(0,h.getActivationSnippet)(b),P=` + const ivec2 strides = ivec2(${b.strides[0]}, ${b.strides[1]}); + const ivec2 pads = ivec2(${b.pads[0]}, ${b.pads[1]}); + ${E} + void main() { + ivec4 coords = getOutputCoords(); + int batch = coords.x; + int output_channel = coords.y; + ivec2 xRCCorner = coords.zw * strides - pads; + int group_id = output_channel / ${w}; + + float value = 0.0; + for (int wInChannel = 0; wInChannel < ${v[1]}; wInChannel++) { + int input_channel = group_id * ${v[1]} + wInChannel; + for (int wHeight = 0; wHeight < ${v[2]}; wHeight++) { + int xHeight = xRCCorner.x + wHeight * ${b.dilations[0]}; + + if (xHeight < 0 || xHeight >= ${_[2]}) { + continue; + } + + for (int wWidth = 0; wWidth < ${v[3]}; wWidth++) { + int xWidth = xRCCorner.y + wWidth * ${b.dilations[1]}; + if (xWidth < 0 || xWidth >= ${_[3]}) { + continue; + } + + float xVal = getX(batch, input_channel, xWidth, xHeight); + float wVal = getW(output_channel, wInChannel, wWidth, wHeight); + value += xVal*wVal; + } + } + } + ${y} + ${x} + ${A.output} = vec4(value, .0, .0, .0); + } +`;return Object.assign(Object.assign({},g),{output:{dims:T,type:u[0].type,textureType:m.TextureType.unpacked},shaderSource:P,hasMain:!0})})(p,a,t,o)})}},1386:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.conv2DPacked=r.conv2DPackedPointwise=void 0;const d=c(8138),l=c(8555),m=c(708);r.conv2DPackedPointwise=(s,h,p)=>{const a=h[0].dims,o=h[1].dims,t=(0,d.calculateOutputShape)(a,o,p.dilations,p.pads,p.strides),e=s.reshapePacked(h[0],[a[1],a[2]*a[3]]),n=s.reshapePacked(h[1],[o[0],o[1]]),i=h.length>2?[n,e,h[2]]:[n,e],u=s.run((0,m.createPackedMatmulProgramInfoLoader)(s,i,p),i);return s.reshapePacked(u,t)},r.conv2DPacked=(s,h,p)=>{const a=h[0].dims,o=h[1].dims,t=(0,d.calculateOutputShape)(a,o,p.dilations,p.pads,p.strides),e=s.run((0,l.createPackedIm2ColProgramInfoLoader)(s,h[0],h[1],t,p),[h[0]]),n=s.reshapePacked(h[1],[o[0],o[1]*o[2]*o[3]]),i=h.length===3?[n,e,h[2]]:[n,e],u=s.run((0,m.createPackedMatmulProgramInfoLoader)(s,i,p),i);return s.reshapePacked(u,t)}},9663:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.parseConvTransposeAttributes=r.convTranspose=void 0;const d=c(246),l=c(5060),m=c(2039),s=c(2823),h=(n,i,u,g,b,y)=>(n-1)*i+u+(g-1)*b+1-y,p=(n,i,u,g,b)=>{const y=Math.floor(n/2);i==="SAME_UPPER"?(u[g]=y,u[b]=n-y):i==="SAME_LOWER"&&(u[g]=n-y,u[b]=y)};r.convTranspose=(n,i,u)=>(e(i,u),a(n,i,u));const a=(n,i,u)=>{const g=t(u,i);return[o(n,i,g)]},o=(n,i,u)=>n.run(((g,b,y)=>{const _=(v=b.length>2,w=y.cacheKey,{name:"ConvTranspose",inputNames:v?["X","W","B"]:["X","W"],inputTypes:v?[m.TextureType.unpacked,m.TextureType.unpacked,m.TextureType.unpacked]:[m.TextureType.unpacked,m.TextureType.unpacked],cacheHint:w});var v,w;return Object.assign(Object.assign({},_),{get:()=>((T,A,E,x)=>{const P=A.length>2?"getB(output_channel)":"0.0",C=A[0].dims,k=A[1].dims,$=k[1],F=k[0]/x.group,q=[A[0].dims[0],A[1].dims[1]*x.group,...x.outputShape],D=(0,l.getGlsl)(T.session.backend.glContext.version),{activationFunction:U,applyActivation:J}=(0,s.getActivationSnippet)(x),Y=` + const ivec2 strides = ivec2(${x.strides[0]}, ${x.strides[1]}); + const ivec2 pads = ivec2(${x.pads[0]}, ${x.pads[1]}); + ${U} + void main() { + ivec4 coords = getOutputCoords(); + int batch = coords.x; + int output_channel = coords.y; + + ivec2 loc = coords.zw + pads; + + int group_id = output_channel / ${$}; + int wOutChannel = output_channel - group_id * ${$}; + + float value = ${P}; + for (int inChannelOffset = 0; inChannelOffset < ${F}; inChannelOffset++) { + int input_channel = group_id * ${F} + inChannelOffset; + for (int wWOff = 0; wWOff < ${k[2]}; wWOff++) { + for (int wHOff = 0; wHOff < ${k[3]}; wHOff++) { + ivec2 wOff = ivec2(wWOff * ${x.dilations[0]}, wHOff * ${x.dilations[1]}); + ivec2 wLoc = loc - wOff; + ivec2 wLocIn = wLoc / strides; + if ( + wLocIn * strides == wLoc && + wLocIn.x >= 0 && wLocIn.x < ${C[2]} && + wLocIn.y >= 0 && wLocIn.y < ${C[3]} + ) { + float xVal = getX(batch, input_channel, wLocIn.y, wLocIn.x); + float wVal = getW(input_channel, wOutChannel, wHOff, wWOff); + value += xVal * wVal; + } + } + } + } + ${J} + ${D.output} = vec4(value, .0, .0, .0); + } +`;return Object.assign(Object.assign({},E),{output:{dims:q,type:A[0].type,textureType:m.TextureType.unpacked},shaderSource:Y,hasMain:!0})})(g,b,_,y)})})(n,i,u),i),t=(n,i)=>{const u=n.kernelShape.slice();if(n.kernelShape.length===0)for(let _=2;_{const C=_.length-2,k=P.length===0;for(let $=0;${const i=n.attributes,u=(0,s.parseInternalActivationAttributes)(i),g=i.getString("auto_pad","NOTSET"),b=i.getInts("dilations",[1,1]),y=i.getInt("group",1),_=i.getInts("kernel_shape",[]),v=i.getInts("output_padding",[0,0]),w=i.getInts("output_shape",[]),T=i.getInts("pads",[0,0,0,0]),A=i.getInts("strides",[1,1]);return(0,d.createAttributeWithCacheKey)(Object.assign({autoPad:g,dilations:b,group:y,kernelShape:_,outputPadding:v,outputShape:w,pads:T,strides:A},u))};const e=(n,i)=>{if(!n||n.length!==2&&n.length!==3)throw new Error("Conv requires 2 or 3 inputs");if(n[0].dims.length!==4||n[1].dims.length!==4)throw new Error("currently only support 2-dimensional conv");if(n[0].dims[1]!==n[1].dims[0])throw new Error("FILTER_IN_CHANNEL should be equal to DATA_CHANNEL");const u=n[1].dims[1]*i.group;if(n.length===3&&(n[2].dims.length!==1||n[2].dims[0]!==u))throw new Error("invalid bias");const g=n[0].dims.length-2;if(i.dilations.length!==g)throw new Error(`dilations should be ${g}D`);if(i.strides.length!==g)throw new Error(`strides should be ${g}D`);if(i.pads.length!==2*g)throw new Error(`pads should be ${2*g}D`);if(i.outputPadding.length!==g)throw new Error(`output_padding should be ${g}D`);if(i.kernelShape.length!==0&&i.kernelShape.length!==n[1].dims.length-2)throw new Error("invalid kernel shape");if(i.outputShape.length!==0&&i.outputShape.length!==n[0].dims.length-2)throw new Error("invalid output shape");if(n[0].type!=="float32"||n[1].type!=="float32")throw new Error("ConvTranspose input(X,W) should be float tensor");if(n.length===3&&n[2].type!=="float32")throw new Error("ConvTranspose input(bias) should be float tensor")}},8138:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.parseConvAttributes=r.conv=r.calculateOutputShape=void 0;const d=c(246),l=c(2517),m=c(4770),s=c(1386),h=c(9828),p=c(2823),a=c(3248),o=c(5623);r.calculateOutputShape=(g,b,y,_,v)=>{const w=g[0],T=g.slice(2),A=T.length,E=b[0],x=b.slice(2).map((C,k)=>C+(C-1)*(y[k]-1)),P=T.map((C,k)=>C+_[k]+_[k+A]).map((C,k)=>Math.floor((C-x[k]+v[k])/v[k]));return[w,E].concat(...P)},r.conv=(g,b,y)=>(u(b,y),t(g,b,y));const t=(g,b,y)=>{const _=i(y,b),v=g.session.pack,w=_.kernelShape[0]===1&&_.kernelShape[1]===1;return _.group>1?[g.run((0,m.createUnpackedGroupedConvProgramInfoLoader)(g,b,_),b)]:w&&v?[e(g,b,_)]:v&&b[0].dims.length===4&&b[0].dims[0]===1&&!w?[(0,s.conv2DPacked)(g,b,_)]:[n(g,b,_)]},e=(g,b,y)=>{const _=b[0].dims,v=b[1].dims,w=(0,r.calculateOutputShape)(_,v,y.dilations,y.pads,y.strides),T=g.reshapeUnpacked(b[0],[_[1],_[2]*_[3]]),A=g.reshapeUnpacked(b[1],[v[0],v[1]]),E=b.length>2?[A,T,b[2]]:[A,T],x=g.run((0,o.createMatmulProgramInfoLoader)(E,y),E);return g.reshapeUnpacked(x,w)},n=(g,b,y)=>{const _=b[0].dims,v=b[1].dims,w=(0,r.calculateOutputShape)(_,v,y.dilations,y.pads,y.strides),T=g.run((0,a.createIm2ColProgramInfoLoader)(g,b[0],b[1],w,y),[b[0]]),A=b.length===3?[T,b[1],b[2]]:[T,b[1]];return g.run((0,h.createDotProductProgramInfoLoader)(g,b,w,y),A)},i=(g,b)=>{const y=g.kernelShape.slice();if(g.kernelShape.length===0)for(let w=2;w{const b=g.attributes,y=(0,p.parseInternalActivationAttributes)(b),_=b.getString("auto_pad","NOTSET"),v=b.getInts("dilations",[1,1]),w=b.getInt("group",1),T=b.getInts("kernel_shape",[]),A=b.getInts("pads",[0,0,0,0]),E=b.getInts("strides",[1,1]);return(0,d.createAttributeWithCacheKey)(Object.assign({autoPad:_,dilations:v,group:w,kernelShape:T,pads:A,strides:E},y))};const u=(g,b)=>{if(!g||g.length!==2&&g.length!==3)throw new Error("Conv requires 2 or 3 inputs");if(g[0].dims.length!==4||g[1].dims.length!==4)throw new Error("currently only support 2-dimensional conv");if(g[0].dims[1]!==g[1].dims[1]*b.group)throw new Error("FILTER_IN_CHANNEL should be equal to DATA_CHANNEL");if(g.length===3&&(g[2].dims.length!==1||g[1].dims[0]!==g[2].dims[0]))throw new Error("invalid bias");const y=g[0].dims.length-2;if(b.dilations.length!==y)throw new Error(`dilations should be ${y}D`);if(b.strides.length!==y)throw new Error(`strides should be ${y}D`);if(b.pads.length!==2*y)throw new Error(`pads should be ${2*y}D`);if(b.kernelShape.length!==0&&b.kernelShape.length!==g[1].dims.length-2)throw new Error("invalid kernel shape");if(g[0].type!=="float32"||g[1].type!=="float32")throw new Error("Conv input(X,W) should be float tensor");if(g.length===3&&g[2].type!=="float32")throw new Error("Conv input(bias) should be float tensor")}},5193:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.parseDepthToSpaceAttributes=r.depthToSpace=void 0;const d=c(3738);r.depthToSpace=(m,s,h)=>{l(s);const p=h.blocksize,a=p*p,o=h.mode==="DCR"?[0,3,4,1,5,2]:[0,1,4,2,5,3],t=h.mode==="DCR"?[s[0].dims[0],p,p,s[0].dims[1]/a,s[0].dims[2],s[0].dims[3]]:[s[0].dims[0],s[0].dims[1]/a,p,p,s[0].dims[2],s[0].dims[3]],e=m.reshapeUnpacked(s[0],t),n={perm:o,cacheKey:`${o}`},[i]=(0,d.transpose)(m,[e],n),u=[s[0].dims[0],s[0].dims[1]/a,s[0].dims[2]*p,s[0].dims[3]*p];return[m.reshapeUnpacked(i,u)]},r.parseDepthToSpaceAttributes=m=>{const s=m.attributes.getInt("blocksize");if(s<1)throw new Error(`blocksize must be >= 1, but got : ${s} for DepthToSpace`);const h=m.attributes.getString("mode","DCR");if(h!=="DCR"&&h!=="CRD")throw new Error(`unrecognized mode: ${h} for DepthToSpace`);return{mode:h,blocksize:s}};const l=m=>{if(m.length!==1)throw new Error(`DepthToSpace expect 1 inputs, but got ${m.length}`);if(m[0].type==="string"||m[0].dims.length!==4)throw new TypeError("DepthToSpace input should be a 4-D numeric tensor")}},9828:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.createDotProductProgramInfoLoader=void 0;const d=c(2517),l=c(5060),m=c(2039),s=c(2823),h=c(3248);r.createDotProductProgramInfoLoader=(p,a,o,t)=>{const e=((n,i)=>({name:"ConvDotProduct",inputNames:n?["Im2Col","K","B"]:["Im2Col","K"],inputTypes:n?[m.TextureType.unpacked,m.TextureType.packedLastDimension,m.TextureType.unpacked]:[m.TextureType.unpacked,m.TextureType.packedLastDimension],cacheKey:i.activationCacheKey}))(a.length>2,t);return Object.assign(Object.assign({},e),{get:()=>((n,i,u,g,b)=>{const y=u[0].dims,_=u[1].dims,v=[_[0],Math.ceil(y[1]*_[2]*_[3]/4)],w=(0,h.calculateIm2ColDims)(y,_,g),[T,A]=n.calculateTextureWidthAndHeight(v,m.TextureType.packedLastDimension),E=d.ShapeUtil.computeStrides(w),[x,P]=n.calculateTextureWidthAndHeight(w,m.TextureType.packedLastDimension),C=g.length,k=u.length<3?"0.0":"_B(b)",$=Math.ceil(y[1]*_[2]*_[3]/4),{activationFunction:F,applyActivation:q}=(0,s.getActivationSnippet)(b),D=(0,l.getGlsl)(n.session.backend.glContext.version),U=` +${F} +float process(int indices[${C}]) { + int b[1]; + b[0] = indices[1]; + int im2col[4]; + im2col[0] = indices[0]; + im2col[1] = indices[2]; + im2col[2] = indices[3]; + int im2colOffset = im2col[0] * ${E[0]} + im2col[1] * ${E[1]} + im2col[2] * ${E[2]}; + int kernelOffset = indices[1] * ${v[1]}; + float value = ${k}; + for (int i = 0; i < ${$}; ++i) { + vec2 im2colCoords = offsetToCoords(im2colOffset, ${x}, ${P}); + vec2 kernelCoords = offsetToCoords(kernelOffset, ${T}, ${A}); + value += dot(${D.texture2D}(Im2Col, im2colCoords), ${D.texture2D}(K, kernelCoords)); + ++im2colOffset; + ++kernelOffset; + } + ${q} + return value; +}`;return Object.assign(Object.assign({},i),{output:{dims:g,type:u[0].type,textureType:m.TextureType.unpacked},shaderSource:U})})(p,e,a,o,t)})}},7992:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.parseFlattenAttributes=r.flatten=void 0;const d=c(2517);r.flatten=(m,s,h)=>{l(s,h);const p=d.ShapeUtil.flattenShape(s[0].dims,h);return[m.reshapeUnpacked(s[0],p)]},r.parseFlattenAttributes=m=>m.attributes.getInt("axis",1);const l=(m,s)=>{if(!m||m.length!==1)throw new Error("Flatten requires 1 input.");const h=m[0].dims.length;if(h===0)throw new Error("scalar tensor is not supported.");if(s<-h||s>h)throw new Error("Invalid axis");if(m[0].type==="string")throw new Error("string tensor is not supported.")}},2823:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.parseInternalActivationAttributes=r.getActivationSnippet=void 0;const d=c(2517),l=c(4909);r.getActivationSnippet=function(m){let s;switch(m.activation){case"Relu":s=(0,l.glslRelu)();break;case"Sigmoid":s=(0,l.glslSigmoid)();break;case"Clip":s=(0,l.glslClip)(m.clipMin,m.clipMax);break;default:return{activationFunction:"",applyActivation:""}}const h=s.name;return{activationFunction:s.body,applyActivation:`value = ${h}_(value);`}},r.parseInternalActivationAttributes=m=>{const s=m.getString("activation","");if(s==="Clip"){const[h,p]=m.getFloats("activation_params",[d.MIN_CLIP,d.MAX_CLIP]);return{activation:s,clipMax:p,clipMin:h,activationCacheKey:`${s}:${h},${p}`}}return{activation:s,activationCacheKey:s}}},1253:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.parseGatherAttributes=r.gather=void 0;const d=c(246),l=c(782),m=c(2517),s=c(2039);r.gather=(o,t,e)=>(a(t,e.axis),[o.run(p(o,t,e),t)]),r.parseGatherAttributes=o=>(0,d.createAttributeWithCacheKey)({axis:o.attributes.getInt("axis",0)});const h={name:"Gather",inputNames:["A","B"],inputTypes:[s.TextureType.unpacked,s.TextureType.unpacked]},p=(o,t,e)=>{const n=Object.assign(Object.assign({},h),{cacheHint:e.cacheKey});return Object.assign(Object.assign({},n),{get:()=>((i,u,g,b)=>{const y=g[0].dims.slice(),_=g[1].dims.slice(),v=new Array(y.length+_.length-1);b=m.ShapeUtil.normalizeAxis(b,y.length);const w=[];for(let A=0;A{if(!o||o.length!==2)throw new Error("Gather requires 2 inputs.");const e=o[0].dims.length;if(e<1)throw new Error("Invalid input shape.");if(t<-e||t>e-1)throw new Error("Invalid axis.");if(l.NUMBER_TYPES.indexOf(o[0].type)===-1)throw new Error("Invaid input type.");if(o[1].type!=="int32"&&o[1].type!=="int16")throw new Error("Invaid input type.")}},4776:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.parseGemmAttributesV11=r.parseGemmAttributesV7=r.gemm=void 0;const d=c(246),l=c(2517),m=c(2039);r.gemm=(o,t,e)=>(a(t,e),[o.run(h(t,e),t)]);const s=(o,t)=>{const e=o.attributes.getInt("transA",0)!==0,n=o.attributes.getInt("transB",0)!==0,i=o.attributes.getFloat("alpha",1),u=o.attributes.getFloat("beta",1);return(0,d.createAttributeWithCacheKey)({transA:e,transB:n,alpha:i,beta:u,isOptionalC:t})};r.parseGemmAttributesV7=o=>s(o,!1),r.parseGemmAttributesV11=o=>s(o,!0);const h=(o,t)=>{const e={name:"Gemm",inputNames:o.length===3?["A","B","C"]:["A","B"],inputTypes:o.length===3?[m.TextureType.unpacked,m.TextureType.unpacked,m.TextureType.unpacked]:[m.TextureType.unpacked,m.TextureType.unpacked],key:t.cacheKey};return Object.assign(Object.assign({},e),{get:()=>p(e,o,t)})},p=(o,t,e)=>{const n=t[0].dims.slice(),i=t[1].dims.slice(),[u,g]=l.GemmUtil.getShapeOfGemmResult(n,e.transA,i,e.transB,t.length===3?t[2].dims:void 0),b=[u,g];if(!b)throw new Error("Can't use gemm on the given tensors");let y=n[n.length-1],_="";e.transA&&(y=n[0]),e.transA&&e.transB?_="value += _A_T(a) * _B_T(b);":e.transA&&!e.transB?_="value += _A_T(a) * _B(b);":!e.transA&&e.transB?_="value += _A(a) * _B_T(b);":e.transA||e.transB||(_="value += _A(a) * _B(b);");const v=b.length,w=` + float process(int indices[${v}]) { + int a[${v}]; + int b[${v}]; + ${t.length===3?`int c[${t[2].dims.length}];`:""} + + copyVec(indices, a); + copyVec(indices, b); + ${t.length===3?"bcastIndices_C(indices, c);":""} + + float value = 0.0; + for (int k=0; k<${y}; ++k) { + a[${v-1}] = k; + b[${v-2}] = k; + ${_} + } + + value = value * alpha; + ${t.length===3?"value += beta * _C(c);":""} + return value; + }`;return Object.assign(Object.assign({},o),{output:{dims:b,type:t[0].type,textureType:m.TextureType.unpacked},variables:[{name:"alpha",type:"float",data:e.alpha},{name:"beta",type:"float",data:e.beta}],shaderSource:w})},a=(o,t)=>{if(!o)throw new Error("Input is missing");if(t.isOptionalC&&(o.length<2||o.length>3))throw new Error("Invaid input shape.");if(!t.isOptionalC&&o.length!==3)throw new Error("Gemm requires 3 inputs");if(o.length===3&&o[2].dims.length!==1&&o[2].dims.length!==2)throw new Error("Invalid input shape of C");if(o[0].type!=="float32"&&o[0].type!=="float64"||o[1].type!=="float32"&&o[1].type!=="float64"||o.length===3&&o[2].type!=="float32"&&o[2].type!=="float64")throw new Error("Invalid input type.");if(o[0].type!==o[1].type||o.length===3&&o[0].type!==o[2].type)throw new Error("Input types are mismatched")}},8555:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.createPackedIm2ColProgramInfoLoader=void 0;const d=c(5060),l=c(2039),m=c(2827);r.createPackedIm2ColProgramInfoLoader=(s,h,p,a,o)=>{const t=(e=o.cacheKey,{name:"Im2Col (packed)",inputNames:["A"],inputTypes:[l.TextureType.packed],cacheHint:e});var e;return Object.assign(Object.assign({},t),{get:()=>((n,i,u,g,b,y)=>{const _=u.dims,v=g.dims,w=b.length,T=[v[1]*v[2]*v[3],b[2]*b[3]],A=v[2]*v[3],E=(0,m.unpackFromChannel)(),x=(0,d.getGlsl)(n.session.backend.glContext.version);let P="";for(let k=0;k<=1;k++)for(let $=0;$<=1;$++)P+=` + blockIndex = rc.x + ${$}; + pos = rc.y + ${k}; + + if(blockIndex < ${T[1]} && pos < ${T[0]}) { + offsetY = int(blockIndex / (${b[w-1]})) * ${y.strides[0]} - + ${y.pads[0]}; + d0 = offsetY + ${y.dilations[0]} * (imod(pos, ${A}) / ${v[2]}); + + if(d0 < ${_[2]} && d0 >= 0) { + offsetX = imod(blockIndex, ${b[w-1]}) * ${y.strides[1]} - + ${y.pads[1]}; + d1 = offsetX + ${y.dilations[1]} * imod(imod(pos, ${A}), ${v[2]}); + + if(d1 < ${_[3]} && d1 >= 0) { + + ch = int(float(pos)/ ${A}.); + innerDims = vec2(d0, d1); + result[${2*k+$}] = getChannel( + getA(0, ch, int(innerDims.x), + int(innerDims.y)), innerDims); + } + } + } + + `;const C=` + ${E} + + void main() { + ivec2 rc = getOutputCoords(); + vec4 result = vec4(0.0); + int blockIndex, pos, offsetY, d0, offsetX, d1, ch; + vec2 innerDims; + ${P} + ${x.output} = result; + } + `;return Object.assign(Object.assign({},i),{output:{dims:T,type:u.type,textureType:l.TextureType.packed},shaderSource:C,hasMain:!0})})(s,t,h,p,a,o)})}},3248:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.calculateIm2ColDims=r.createIm2ColProgramInfoLoader=void 0;const d=c(2039);r.createIm2ColProgramInfoLoader=(l,m,s,h,p)=>{const a=(o=p.cacheKey,{name:"Im2Col",inputNames:["X"],inputTypes:[d.TextureType.unpacked],cacheHint:o});var o;return Object.assign(Object.assign({},a),{get:()=>((t,e,n,i,u,g)=>{const b=n.dims,y=i.dims,_=u.length,v=(0,r.calculateIm2ColDims)(b,y,u,4),w=` + const int XC = ${b[1]}; + const int XH = ${b[2]}; + const int XW = ${b[3]}; + const int KH = ${g.kernelShape[0]}; + const int KW = ${g.kernelShape[1]}; + const int dilationH = ${g.dilations[0]}; + const int dilationW = ${g.dilations[1]}; + const int strideH = ${g.strides[0]}; + const int strideW = ${g.strides[1]}; + const int padH = ${g.pads[0]}; + const int padW = ${g.pads[1]}; + const int KHKW = KH*KW; + const int XCKHKW = XC * KHKW; + const int outputChannels = 4; + vec4 process(int indices[${_}]) { + int b = indices[0]; // batch size + int oh = indices[1] * strideH - padH; //output height + int ow = indices[2] * strideW - padW; //output width + int p = indices[3] * outputChannels; //patch + vec4 value = vec4(0.0); + for(int i=0; i < outputChannels; ++i) { + if(p < XCKHKW) { + int patchC = p / KHKW; + int patchH = (p - patchC*KHKW) / KW; + int patchW = (p - patchC*KHKW) - patchH * KW; + int xh2 = oh + patchH * dilationH; + int xw2 = ow + patchW * dilationW; + int x[${b.length}]; + x[0] = b; + x[1] = patchC; + x[2] = xh2; + x[3] = xw2; + if(xh2 >= 0 && + xh2 < XH && + xw2 >= 0 && + xw2 < XW) { + value[i] = _X(x); + } + } + ++p; + } + return value; + } + `;return Object.assign(Object.assign({},e),{output:{dims:v,type:n.type,textureType:d.TextureType.packedLastDimension},shaderSource:w})})(0,a,m,s,h,p)})},r.calculateIm2ColDims=(l,m,s,h=4)=>[s[0],s[2],s[3],Math.ceil(l[1]*m[2]*m[3]/h)]},6572:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.parseImageScalerAttributes=r.imageScaler=void 0;const d=c(246),l=c(2039);r.imageScaler=(a,o,t)=>(p(o),[a.run(s(a,o,t),o)]),r.parseImageScalerAttributes=a=>{const o=a.attributes.getFloat("scale"),t=a.attributes.getFloats("bias");return(0,d.createAttributeWithCacheKey)({scale:o,bias:t})};const m={name:"ImageScaler",inputNames:["X"],inputTypes:[l.TextureType.unpacked]},s=(a,o,t)=>{const e=Object.assign(Object.assign({},m),{cacheHint:t.cacheKey});return Object.assign(Object.assign({},e),{get:()=>((n,i,u,g)=>{const b=u[0].dims.slice(),y=b.length,_=` + ${h(g.bias.length)} + float process(int indices[${y}]) { + return _X(indices) * scale + getBias(bias, indices[1]); + }`;return Object.assign(Object.assign({},i),{output:{dims:b,type:u[0].type,textureType:l.TextureType.unpacked},variables:[{name:"bias",type:"float",arrayLength:g.bias.length,data:g.bias},{name:"scale",type:"float",data:g.scale}],shaderSource:_})})(0,e,o,t)})},h=a=>{const o=[`float getBias(float bias[${a}], int channel) {`];for(let t=0;t{if(!a||a.length!==1)throw new Error("ImageScaler requires 1 input.");if(a[0].dims.length!==4)throw new Error("Invalid input shape.");if(a[0].type!=="float32"&&a[0].type!=="float64")throw new Error("Invalid input type.")}},3346:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.parseInstanceNormalizationAttributes=r.instanceNormalization=void 0;const d=c(5060),l=c(2039);r.instanceNormalization=(o,t,e)=>{a(t);const n=o.run(s(t[0]),t);return[o.run(p(o,t[0],e,n.dims),[t[0],n,t[1],t[2]])]},r.parseInstanceNormalizationAttributes=o=>o.attributes.getFloat("epsilon",1e-5);const m={name:"InstanceNormalization_MeanAndVariance",inputNames:["X"],inputTypes:[l.TextureType.unpacked]},s=o=>Object.assign(Object.assign({},m),{get:()=>((t,e)=>{const n=e.dims.slice(),i=n[1],u=n[2]*n[3],g=[n[0],i],b=` + vec4 process(int[2] indices) { + vec4 v = vec4(0.0); + int a[4]; + a[0] = indices[0]; + a[1] = indices[1]; + float temp = 0.0; + for(int a2=0; a2<${n[2]}; a2++) { + a[2] = a2; + for(int a3=0; a3<${n[3]}; a3++) { + a[3] = a3; + float x = _X(a); + temp += x; + } + } + float mean = temp / float(${u}); + temp = 0.0; + for(int a2=0; a2<${n[2]}; a2++) { + a[2] = a2; + for(int a3=0; a3<${n[3]}; a3++) { + a[3] = a3; + float x = _X(a); + temp += (x - mean) * (x - mean); + } + } + v.r = mean; + v.g = temp / float(${u}); + + return v; + }`;return Object.assign(Object.assign({},t),{output:{dims:g,type:e.type,textureType:l.TextureType.packedLastDimension},shaderSource:b})})(m,o)}),h={name:"InstanceNormalization_ComputeOutput",inputNames:["X","MeanAndVariance","Scale","B"],inputTypes:[l.TextureType.unpacked,l.TextureType.packedLastDimension,l.TextureType.unpacked,l.TextureType.unpacked]},p=(o,t,e,n)=>{const i=Object.assign(Object.assign({},h),{cacheHint:`${e}`});return Object.assign(Object.assign({},i),{get:()=>((u,g,b,y,_)=>{const v=(0,d.getGlsl)(u.session.backend.glContext.version),[w,T]=u.calculateTextureWidthAndHeight(_,l.TextureType.packedLastDimension),[A,E]=[w/4,T],x=` + vec4 get_MeanAndVariance(int[2] mv) { + int offset = indicesToOffset_MeanAndVariance(mv); + vec2 coords = offsetToCoords(offset, ${A}, ${E}); + return ${v.texture2D}(MeanAndVariance, coords); + } + + float process(int[4] indices) { + int mv[2]; + mv[0] = indices[0]; + mv[1] = indices[1]; + vec4 mean_and_variance = get_MeanAndVariance(mv); + float mean = mean_and_variance.r; + float variance = mean_and_variance.g; + + int sb[1]; + sb[0] = indices[1]; + float scale = _Scale(sb); + float b = _B(sb); + + return scale * (_X(indices) - mean) / sqrt(variance + epsilon) + b; + }`;return Object.assign(Object.assign({},g),{output:{dims:b.dims,type:b.type,textureType:l.TextureType.unpacked},variables:[{name:"epsilon",type:"float",data:y}],shaderSource:x})})(o,i,t,e,n)})},a=o=>{if(!o||o.length!==3)throw new Error("InstanceNormalization requires 3 inputs.");const t=o[0],e=o[1],n=o[2];if(t.dims.length<3||e.dims.length!==1||n.dims.length!==1)throw new Error("Invalid input shape.");if(e.dims[0]!==t.dims[1]||n.dims[0]!==t.dims[1])throw new Error("Input shapes are mismatched.");if(t.type!=="float32"&&t.type!=="float64"||e.type!=="float32"&&e.type!=="float64"||n.type!=="float32"&&n.type!=="float64")throw new Error("Invalid input type.");if(o[0].dims.length!==4)throw new Error("Only support 4-D input shape.")}},708:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.createPackedMatmulProgramInfoLoader=void 0;const d=c(2517),l=c(5060),m=c(2039),s=c(9390),h=c(2823),p=c(5623);r.createPackedMatmulProgramInfoLoader=(a,o,t)=>{const e=(n=o.length>2,i=t.activationCacheKey,{name:"MatMul (packed)",inputNames:n?["A","B","Bias"]:["A","B"],inputTypes:n?[m.TextureType.packed,m.TextureType.packed,m.TextureType.packed]:[m.TextureType.packed,m.TextureType.packed],cacheHint:i});var n,i;return Object.assign(Object.assign({},e),{get:()=>((u,g,b,y)=>{const _=b.length>2,v=_?"value += getBiasForMatmul();":"",w=b[0].dims,T=b[1].dims,A=d.BroadcastUtil.calcShape(w,T,!0),E=!d.ShapeUtil.areEqual(b[0].dims,b[1].dims);if(!A)throw new Error("Can't use matmul on the given tensors");const x=w[w.length-1],P=Math.ceil(x/2),C=w.length,k=T.length,$=(0,l.getGlsl)(u.session.backend.glContext.version),F=(0,s.getCoordsDataType)(A.length),q=A.length,D=(0,s.getGlChannels)(),{activationFunction:U,applyActivation:J}=(0,h.getActivationSnippet)(y),Y=_?`${(0,p.getBiasForMatmul)(F,D,b[2].dims,A,!0)}`:"",Z=E?`${function(Te,ue,xe,_e){let Le=[],ze=[];const Se=xe[0].dims,De=xe[1].dims,Re=Se.length,Ae=De.length,we=_e.length,ke=we-Re,Ue=we-Ae;Le=Se.map((Ee,$e)=>`coords.${ue[$e+ke]}`),Le[Re-1]="i*2",Le.join(", "),ze=De.map((Ee,$e)=>`coords.${ue[$e+Ue]}`),ze[Ae-2]="i*2",ze.join(", ");const Be=d.BroadcastUtil.getBroadcastDims(Se,_e),We=d.BroadcastUtil.getBroadcastDims(De,_e),qe=Be.map(Ee=>`coords.${ue[Ee+ke]} = 0;`).join(` +`),je=We.map(Ee=>`coords.${ue[Ee+Ue]} = 0;`).join(` +`),Ve=`int lastDim = coords.${ue[we-1]}; + coords.${ue[we-1]} = coords.${ue[we-2]}; + coords.${ue[we-2]} = lastDim;`;return` +vec4 getAAtOutCoordsMatmul(int i) { + ${Te} coords = getOutputCoords(); + ${Ve} + ${qe} + vec4 outputValue = getA(${Le}); + return outputValue; +} + +vec4 getBAtOutCoordsMatmul(int i) { + ${Te} coords = getOutputCoords(); + ${Ve} + ${je} + vec4 outputValue = getB(${ze}); + return outputValue; +}`}(F,D,b,A)}`:"",te=E?"getAAtOutCoordsMatmul(i)":`getA(${function(Te,ue){let xe="";for(let _e=0;_e{Object.defineProperty(r,"__esModule",{value:!0}),r.getBiasForMatmul=r.createMatmulProgramInfoLoader=r.parseMatMulAttributes=r.matMul=void 0;const d=c(2517),l=c(2039),m=c(9390),s=c(2823),h=c(708);function p(t,e){const n=(i=t.length>2,u=e.activationCacheKey,{name:"MatMul",inputNames:i?["A","B","Bias"]:["A","B"],inputTypes:i?[l.TextureType.unpacked,l.TextureType.unpacked,l.TextureType.unpacked]:[l.TextureType.unpacked,l.TextureType.unpacked],cacheHint:u});var i,u;return Object.assign(Object.assign({},n),{get:()=>function(g,b,y){const _=b[0].dims,v=b[1].dims,w=d.BroadcastUtil.calcShape(_,v,!0);if(!w)throw new Error("Can't use matmul on the given tensors");const T=(0,m.getCoordsDataType)(w.length),A=(0,m.getGlChannels)(),{activationFunction:E,applyActivation:x}=(0,s.getActivationSnippet)(y),P=b.length>2,C=P?"value += getBiasForMatmul();":"",k=P?`${o(T,A,b[2].dims,w,!1)}`:"",$=w.length,F=_.length,q=v.length,D=` + ${E} + ${k} + float process(int indices[${$}]) { + int a[${F}]; + int b[${q}]; + bcastMatmulIndices_A(indices, a); + bcastMatmulIndices_B(indices, b); + + float value; + for (int k=0; k<${_[_.length-1]}; ++k) { + a[${F-1}] = k; + b[${q-2}] = k; + value += _A(a) * _B(b); + } + ${C} + ${x} + return value; + }`;return Object.assign(Object.assign({},g),{output:{dims:w,type:b[0].type,textureType:l.TextureType.unpacked},shaderSource:D})}(n,t,e)})}r.matMul=(t,e,n)=>(a(e),t.session.pack?[t.run((0,h.createPackedMatmulProgramInfoLoader)(t,e,n),e)]:[t.run(p(e,n),e)]),r.parseMatMulAttributes=t=>(0,s.parseInternalActivationAttributes)(t.attributes),r.createMatmulProgramInfoLoader=p;const a=t=>{if(!t||t.length!==2)throw new Error("MatMul requires 2 inputs.");if(t[0].dims[t[0].dims.length-1]!==t[1].dims[t[1].dims.length-2])throw new Error("shared dimension does not match.");if(t[0].type!=="float32"&&t[0].type!=="float64"||t[1].type!=="float32"&&t[1].type!=="float64")throw new Error("inputs should be float type");if(t[0].type!==t[1].type)throw new Error("inputs types should match")};function o(t,e,n,i,u){let g="";const b=n.length,y=i.length,_=y-b;g=y<2&&b>0?"coords":n.map((T,A)=>`coords.${e[A+_]}`).join(", ");const v=d.BroadcastUtil.getBroadcastDims(n,i).map(T=>`coords.${e[T+_]} = 0;`).join(` +`);let w="vec4(outputValue.xx, outputValue.yy)";return d.ShapeUtil.size(n)===1&&(w="vec4(outputValue.x)"),u?` +vec4 getBiasForMatmul() { + ${t} coords = getOutputCoords(); + ${v} + vec4 outputValue = getBias(${g}); + return ${w}; +}`:` +float getBiasForMatmul() { + ${t} coords = getOutputCoords(); + ${v} + return getBias(coords.x); +}`}r.getBiasForMatmul=o},2403:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.createPackProgramInfoLoader=void 0;const d=c(5060),l=c(2039),m=c(9390),s=c(2827),h={name:"pack",inputNames:["A"],inputTypes:[l.TextureType.unpackedReversed]};r.createPackProgramInfoLoader=(p,a)=>Object.assign(Object.assign({},h),{get:()=>((o,t)=>{const e=(0,d.getGlsl)(o.session.backend.glContext.version),n=t.dims,i=n.length,u=t.dims.length,g=(0,m.getCoordsDataType)(u),b=(0,s.getChannels)("rc",u),y=(_=u,v=b,w=n[n.length-2],T=n[n.length-1],_===0||_===1?"":` + int r = ${v[_-2]}; + int c = ${v[_-1]}; + int rp1 = ${v[_-2]} + 1; + int cp1 = ${v[_-1]} + 1; + bool rEdge = rp1 >= ${T}; + bool cEdge = cp1 >= ${w}; + `);var _,v,w,T;let A;A=i===0?[1,1]:i===1?[n[0],1]:[n[u-1],n[u-2]];const E=function(C,k,$){if(C===0)return"false";if(C===1)return`rc > ${k[0]}`;let F="";for(let q=C-2;q= ${k[q-C+2]}`,q= ${C[0]} ? 0. : getA(rc + 1), + 0, 0`;let F="";if($>2)for(let q=0;q<$-2;++q)F+=`${k[q]},`;return`getA(${F}r, c), + rEdge ? 0. : getA(${F}rp1, c), + cEdge ? 0. : getA(${F}r, cp1), + rEdge || cEdge ? 0. : getA(${F}rp1, cp1)`}(n,b),P=` + void main() { + ${g} rc = getOutputCoords(); + + if(${E}) { + ${e.output} = vec4(0); + } else { + ${y} + + ${e.output} = vec4(${x}); + } + } + `;return Object.assign(Object.assign({},h),{hasMain:!0,output:{dims:t.dims,type:t.type,textureType:l.TextureType.packed},shaderSource:P})})(p,a)})},2827:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.unpackFromChannel=r.getChannels=r.getVecChannels=void 0;const d=c(9390);function l(m,s){return(0,d.getGlChannels)(s).map(h=>`${m}.${h}`)}r.getVecChannels=l,r.getChannels=function(m,s){return s===1?[m]:l(m,s)},r.unpackFromChannel=function(){return` + float getChannel(vec4 frag, int dim) { + int modCoord = imod(dim, 2); + return modCoord == 0 ? frag.r : frag.g; + } + + float getChannel(vec4 frag, vec2 innerDims) { + vec2 modCoord = mod(innerDims, 2.); + return modCoord.x == 0. ? + (modCoord.y == 0. ? frag.r : frag.g) : + (modCoord.y == 0. ? frag.b : frag.a); + } + `}},2870:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.parsePadAttributesV11=r.padV11=r.parsePadAttributesV2=r.padV2=void 0;const d=c(246),l=c(2517),m=c(5060),s=c(2039),h={name:"Pad",inputNames:["A"],inputTypes:[s.TextureType.unpacked]};r.padV2=(g,b,y)=>(o(b),[g.run(Object.assign(Object.assign({},h),{cacheHint:y.cacheKey,get:()=>a(g,b[0],y)}),b)]),r.parsePadAttributesV2=g=>{const b=g.attributes.getString("mode","constant"),y=g.attributes.getFloat("value",0),_=g.attributes.getInts("pads");return(0,d.createAttributeWithCacheKey)({mode:b,value:y,pads:_})},r.padV11=(g,b,y)=>{t(b);const _=p(g,b,y);return(0,r.padV2)(g,[b[0]],_)},r.parsePadAttributesV11=g=>g.attributes.getString("mode","constant");const p=(g,b,y)=>{if(!g.session.isInitializer(b[1].dataId)||b.length>=3&&!g.session.isInitializer(b[2].dataId))throw new Error("dynamic pad attributes are not allowed");const _=Array.from(b[1].integerData),v=b.length>=3?b[2].floatData[0]:0;return(0,d.createAttributeWithCacheKey)({mode:y,pads:_,value:v})},a=(g,b,y)=>{const _=l.ShapeUtil.padShape(b.dims.slice(),y.pads),v=_.length,w=` + ${e(g,b,y)} + float process(int[${v}] indices) { + return padA(indices); + }`;return{name:"Pad",inputNames:["A"],inputTypes:[s.TextureType.unpacked],output:{dims:_,type:b.type,textureType:s.TextureType.unpacked},shaderSource:w}},o=g=>{if(!g||g.length!==1)throw new Error("Pad requires 1 input");if(g[0].type!=="float32"&&g[0].type!=="float64")throw new Error("Invalid input type.")},t=g=>{if(!g||g.length!==2&&g.length!==3)throw new Error("Pad requires 2 or 3 inputs");if(g[1].type!=="int32")throw new Error("Invalid input type.");if(g.length>=3&&g[2].type==="string")throw new Error("Invalid input type.")},e=(g,b,y)=>{const _=(0,m.getGlsl)(g.session.backend.glContext.version),[v,w]=g.calculateTextureWidthAndHeight(b.dims,s.TextureType.unpacked),T=l.ShapeUtil.computeStrides(b.dims);switch(y.mode){case"constant":return n(_,b.dims,T,v,w,y.pads,y.value);case"reflect":return i(_,b.dims,T,v,w,y.pads);case"edge":return u(_,b.dims,T,v,w,y.pads);default:throw new Error("Invalid mode")}},n=(g,b,y,_,v,w,T)=>{const A=b.length;let E="";for(let x=A-1;x>=0;--x)E+=` + k = m[${x}] - ${w[x]}; + if (k < 0) return constant; + if (k >= ${b[x]}) return constant; + offset += k * ${y[x]}; + `;return` + float padA(int m[${A}]) { + const float constant = float(${T}); + int offset = 0; + int k = 0; + ${E} + vec2 coords = offsetToCoords(offset, ${_}, ${v}); + float value = getColorAsFloat(${g.texture2D}(A, coords)); + return value; + } + `},i=(g,b,y,_,v,w)=>{const T=b.length;let A="";for(let E=T-1;E>=0;--E)A+=` + k = m[${E}] - ${w[E]}; + if (k < 0) { k = -k; } + { + const int _2n_1 = ${2*(b[E]-1)}; + k = int( mod( float(k), float(_2n_1) ) ) ; + if(k >= ${b[E]}) { k = _2n_1 - k; } + } + offset += k * ${y[E]}; + `;return` + float padA(int m[${T}]) { + int offset = 0; + int k = 0; + ${A} + vec2 coords = offsetToCoords(offset, ${_}, ${v}); + float value = getColorAsFloat(${g.texture2D}(A, coords)); + return value; + } + `},u=(g,b,y,_,v,w)=>{const T=b.length;let A="";for(let E=T-1;E>=0;--E)A+=` + k = m[${E}] - ${w[E]}; + if (k < 0) k = 0; + if (k >= ${b[E]}) k = ${b[E]-1}; + offset += k * ${y[E]}; + `;return` + float padA(int m[${T}]) { + int offset = 0; + int k = 0; + ${A} + vec2 coords = offsetToCoords(offset, ${_}, ${v}); + float value = getColorAsFloat(${g.texture2D}(A, coords)); + return value; + } + `}},2143:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.globalMaxPool=r.parseMaxPoolAttributes=r.maxPool=r.parseGlobalAveragePoolAttributes=r.globalAveragePool=r.parseAveragePoolAttributes=r.averagePool=void 0;const d=c(246),l=c(2517),m=c(2039);r.averagePool=(u,g,b)=>{t(g);const y={name:"AveragePool",inputNames:["X"],inputTypes:[m.TextureType.unpacked],cacheHint:b.cacheKey};return[u.run(Object.assign(Object.assign({},y),{get:()=>s(g,y,!1,b)}),g)]},r.parseAveragePoolAttributes=u=>{const g=u.attributes.getString("auto_pad","NOTSET"),b=u.attributes.getInt("ceil_mode",0),y=u.attributes.getInt("count_include_pad",0)!==0,_=u.attributes.getInts("kernel_shape"),v=u.attributes.getInts("strides",[]),w=u.attributes.getInts("pads",[]);if(b!==0)throw new Error("using ceil() in shape computation is not yet supported for AveragePool");return(0,d.createAttributeWithCacheKey)({autoPad:g,ceilMode:b,countIncludePad:y,kernelShape:_,strides:v,pads:w})};const s=(u,g,b,y)=>{const[_,v]=p(u,y,b),w=l.ShapeUtil.size(_.kernelShape);let T="";_.countIncludePad?T+=`value /= float(${w});`:T+=`value /= float(${w} - pad);`;const A=` + ${e(u[0].dims,_,"value += _X(x);",T,"0.0")} + `;return Object.assign(Object.assign({},g),{output:{dims:v,type:u[0].type,textureType:m.TextureType.unpacked},shaderSource:A})};r.globalAveragePool=(u,g,b)=>{t(g);const y={name:"GlobalAveragePool",inputNames:["X"],inputTypes:[m.TextureType.unpacked],cacheHint:`${b.countIncludePad}`};return[u.run(Object.assign(Object.assign({},y),{get:()=>s(g,y,!0,b)}),g)]},r.parseGlobalAveragePoolAttributes=u=>{const g=u.attributes.getInt("count_include_pad",0)!==0;return(0,d.createAttributeWithCacheKey)({autoPad:"",ceilMode:0,countIncludePad:g,kernelShape:[],strides:[],pads:[]})},r.maxPool=(u,g,b)=>{t(g);const y={name:"MaxPool",inputNames:["X"],inputTypes:[m.TextureType.unpacked],cacheHint:b.cacheKey};return[u.run(Object.assign(Object.assign({},y),{get:()=>h(g,y,!1,b)}),g)]},r.parseMaxPoolAttributes=u=>{const g=u.attributes.getString("auto_pad","NOTSET"),b=u.attributes.getInt("ceil_mode",0),y=u.attributes.getInts("kernel_shape"),_=u.attributes.getInts("strides",[]),v=u.attributes.getInts("pads",[]),w=u.attributes.getInt("storage_order",0),T=u.attributes.getInts("dilations",[]);if(w!==0)throw new Error("column major storage order is not yet supported for MaxPool");if(b!==0)throw new Error("using ceil() in shape computation is not yet supported for MaxPool");return(0,d.createAttributeWithCacheKey)({autoPad:g,ceilMode:b,countIncludePad:!1,kernelShape:y,strides:_,pads:v,storageOrder:w,dilations:T})};const h=(u,g,b,y)=>{const[_,v]=p(u,y,b),w=` + ${e(u[0].dims,_,` + value = max(_X(x), value); + `,"","-1e5")} + `;return Object.assign(Object.assign({},g),{output:{dims:v,type:u[0].type,textureType:m.TextureType.unpacked},shaderSource:w})},p=(u,g,b)=>{const y=u[0].dims.slice(),_=Object.hasOwnProperty.call(g,"dilations"),v=g.kernelShape.slice(),w=g.strides.slice(),T=_?g.dilations.slice():[],A=g.pads.slice();l.PoolConvUtil.adjustPoolAttributes(b,y,v,w,T,A);const E=l.PoolConvUtil.computePoolOutputShape(b,y,w,T,v,A,g.autoPad),x=Object.assign({},g);return _?Object.assign(x,{kernelShape:v,strides:w,pads:A,dilations:T,cacheKey:g.cacheKey}):Object.assign(x,{kernelShape:v,strides:w,pads:A,cacheKey:g.cacheKey}),[x,E]},a={autoPad:"",ceilMode:0,countIncludePad:!1,kernelShape:[],strides:[],pads:[],storageOrder:0,dilations:[],cacheKey:""},o={name:"GlobalMaxPool",inputNames:["X"],inputTypes:[m.TextureType.unpacked]};r.globalMaxPool=(u,g)=>(t(g),[u.run(Object.assign(Object.assign({},o),{get:()=>h(g,o,!0,a)}),g)]);const t=u=>{if(!u||u.length!==1)throw new Error("Pool ops requires 1 input.");if(u[0].type!=="float32"&&u[0].type!=="float64")throw new Error("Invalid input type.")},e=(u,g,b,y,_)=>{const v=u.length;if(g.kernelShape.length<=2){const w=g.kernelShape[g.kernelShape.length-1],T=g.strides[g.strides.length-1],A=g.pads[g.pads.length/2-1],E=g.pads[g.pads.length-1],x=u[v-1];let P="",C="",k="";if(P=A+E!==0?` + for (int i = 0; i < ${w}; i++) { + x[${v} - 1] = indices[${v} - 1] * ${T} - ${A} + i; + if (x[${v} - 1] < 0 || x[${v} - 1] >= ${x}) { + pad++; + continue; + } + ${b} + }`:` + for (int i = 0; i < ${w}; i++) { + x[${v} - 1] = indices[${v} - 1] * ${T} - ${A} + i; + ${b} + }`,g.kernelShape.length===2){const $=g.kernelShape[g.kernelShape.length-2],F=g.strides[g.strides.length-2],q=g.pads[g.pads.length/2-2],D=g.pads[g.pads.length-2],U=u[v-2];C=q+D!==0?` + for (int j = 0; j < ${$}; j++) { + x[${v} - 2] = indices[${v} - 2] * ${F} - ${q} + j; + if (x[${v} - 2] < 0 || x[${v} - 2] >= ${U}) { + pad+= ${w}; + continue; + } + `:` + for (int j = 0; j < ${$}; j++) { + x[${v} - 2] = indices[${v} - 2] * ${F} - ${q} + j; + `,k=` + } + `}return` + float process(int indices[${v}]) { + int x[${v}]; + copyVec(indices, x); + + float value = ${_}; + int pad = 0; + ${C} + ${P} + ${k} + ${y} + return value; + } + `}{const w=l.ShapeUtil.size(g.kernelShape),T=l.ShapeUtil.computeStrides(g.kernelShape),A=T.length,E=g.pads.length,x=i(A),P=n(u,"inputDims"),C=n(g.pads,"pads"),k=n(T,"kernelStrides"),$=n(g.strides,"strides");let F="";return F=g.pads.reduce((q,D)=>q+D)?` + if (x[j] >= inputDims[j] || x[j] < 0) { + pad++; + isPad = true; + break; + } + } + if (!isPad) { + ${b} + }`:` + } + ${b} + `,` + ${x} + float process(int indices[${v}]) { + int x[${v}]; + copyVec(indices, x); + int offset[${A}]; + int pads[${E}]; + int inputDims[${v}]; + int kernelStrides[${A}]; + int strides[${A}]; + ${C} + ${P} + ${$} + ${k} + + float value = ${_}; + int pad = 0; + bool isPad = false; + for (int i = 0; i < ${w}; i++) { + offsetToIndices(i, kernelStrides, offset); + isPad = false; + for (int j = ${v} - ${A}; j < ${v}; j++) { + x[j] = indices[j] * strides[j - ${v} + ${A}] + + offset[j - ${v} + ${A}] - pads[j - 2]; + ${F} + } + ${y} + + return value; + } + `}},n=(u,g)=>{let b="";for(let y=0;y` + void offsetToIndices(int offset, int[${u}] strides, out int[${u}] indices) { + if (${u} == 0) { + return; + } + for (int i = 0; i < ${u} - 1; ++i) { + indices[i] = offset / strides[i]; + offset -= indices[i] * strides[i]; + } + indices[${u} - 1] = offset; + }`},4939:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.reduceLogSumSquare=r.reduceLogSum=r.reduceProd=r.reduceMin=r.reduceMax=r.reduceMean=r.reduceSum=r.parseReduceAttributes=void 0;const d=c(246),l=c(782),m=c(2517),s=c(2039),h=(o,t,e,n,i)=>{a(t);const u={name:n,inputNames:["A"],inputTypes:[s.TextureType.unpacked]};return[o.run(Object.assign(Object.assign({},u),{cacheHint:e.cacheKey,get:()=>p(o,t,e,n,i,u)}),t)]};r.parseReduceAttributes=o=>{const t=o.attributes.getInts("axes",[]),e=o.attributes.getInt("keepdims",1)===1;return(0,d.createAttributeWithCacheKey)({axes:t,keepDims:e})};const p=(o,t,e,n,i,u)=>{const g=[],b=t[0].dims.length||1,y=[],_=m.ShapeUtil.normalizeAxes(e.axes,t[0].dims.length),v=i(t,_);let w=v[1];for(let A=0;A=0||_.length===0?(e.keepDims&&g.push(1),w=` + for(int j${A} = 0; j${A} < ${t[0].dims[A]}; j${A}++) { + inputIdx[${A}] = j${A}; + ${w} + }`):(y.push(`inputIdx[${A}] = outputIdx[${g.length}];`),g.push(t[0].dims[A]));const T=` + float process(int outputIdx[${g.length||1}]) { + float value; // final result + int inputIdx[${b}]; // addressing input data + ${y.join(` +`)} + ${v[0]} // init ops for reduce max/min + ${w} + ${v[2]} // final computation for reduce mean + return value; + }`;return Object.assign(Object.assign({},u),{output:{dims:g,type:t[0].type,textureType:s.TextureType.unpacked},shaderSource:T})},a=o=>{if(!o||o.length!==1)throw new Error("Reduce op requires 1 input.");if(l.NUMBER_TYPES.indexOf(o[0].type)===-1)throw new Error("Invalid input type.")};r.reduceSum=(o,t,e)=>h(o,t,e,"ReduceSum",()=>["value = 0.0;","value += _A(inputIdx);",""]),r.reduceMean=(o,t,e)=>h(o,t,e,"ReduceMean",(n,i)=>{let u=1;for(let g=0;g=0||i.length===0)&&(u*=n[0].dims[g]);return["value = 0.0;","value += _A(inputIdx);",`value /= ${u}.;`]}),r.reduceMax=(o,t,e)=>h(o,t,e,"ReduceMax",(n,i)=>{const u=[];for(let g=0;g=0||i.length===0)&&u.push(`inputIdx[${g}] = 0;`);return[`${u.join(` +`)} +value = _A(inputIdx);`,"value = max(value, _A(inputIdx));",""]}),r.reduceMin=(o,t,e)=>h(o,t,e,"ReduceMin",(n,i)=>{const u=[];for(let g=0;g=0||i.length===0)&&u.push(`inputIdx[${g}] = 0;`);return[`${u.join(` +`)} +value = _A(inputIdx);`,"value = min(value, _A(inputIdx));",""]}),r.reduceProd=(o,t,e)=>h(o,t,e,"ReduceProd",()=>["value = 1.0;","value *= _A(inputIdx);",""]),r.reduceLogSum=(o,t,e)=>h(o,t,e,"ReduceLogSum",()=>["value = 0.0;","value += _A(inputIdx);","value = log(value);"]),r.reduceLogSumSquare=(o,t,e)=>h(o,t,e,"ReduceLogSumSquare",()=>["float t; value = 0.0;","t = _A(inputIdx); value += t * t;",""])},7019:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.isReshapeCheap=r.processDims3D=r.createPackedReshape3DProgramInfoLoader=void 0;const d=c(2517),l=c(5060),m=c(2039),s=c(2827);r.createPackedReshape3DProgramInfoLoader=(h,p,a)=>{const o=(t=>({name:"Reshape (packed)",inputTypes:[m.TextureType.packed],inputNames:["A"],cacheHint:`${t}`}))(a);return Object.assign(Object.assign({},o),{get:()=>((t,e,n,i)=>{const u=e.dims,g=i;let b="";for(let v=0;v<4;v++){let w="";switch(v){case 0:w="outputCoords = rc;";break;case 1:w="outputCoords = ivec3(rc.x, rc.y+1, rc.z);";break;case 2:w="outputCoords = ivec3(rc.x, rc.y, rc.z+1);";break;case 3:w="outputCoords = ivec3(rc.x, rc.y+1, rc.z+1);";break;default:throw new Error}b+=` + ${w} + ${v>0?"if(outputCoords.y < rows && outputCoords.z < cols){":""} + int flattenedIndex = getFlattenedIndex(outputCoords); + + ivec3 inputRC = inputCoordsFromReshapedOutCoords(flattenedIndex); + vec2 innerDims = vec2(float(inputRC.y),float(inputRC.z)); + + result[${v}] = getChannel(getA(inputRC.x, inputRC.y, inputRC.z), innerDims); + + ${v>0?"}":""} + `}const y=(0,l.getGlsl)(t.session.backend.glContext.version),_=` + ${function(v){const w=d.ShapeUtil.computeStrides(v),T=["b","r","c"],A="index";return` + ivec3 inputCoordsFromReshapedOutCoords(int index) { + ${w.map((E,x)=>`int ${T[x]} = ${A} / ${E}; ${x===w.length-1?`int ${T[x+1]} = ${A} - ${T[x]} * ${E}`:`index -= ${T[x]} * ${E}`};`).join("")} + return ivec3(b, r, c); + } + `}(u)} + ${function(v){const w=d.ShapeUtil.computeStrides(v);return` + int getFlattenedIndex(ivec3 coords) { + // reverse y, z order + return coords.x * ${w[0]} + coords.z * ${w[1]} + coords.y; + } +`}(g)} + ${(0,s.unpackFromChannel)()} + + void main() { + ivec3 rc = getOutputCoords(); + + vec4 result = vec4(0.0); + + ivec3 outputCoords; + int rows = ${g[2]}; + int cols = ${g[1]}; + + ${b} + ${y.output} = result; + } + `;return Object.assign(Object.assign({},n),{output:{dims:g,type:e.type,textureType:m.TextureType.packed},shaderSource:_,hasMain:!0})})(h,p,o,a)})},r.processDims3D=function(h){if(h.length===0)return[1,1,1];let p=1;for(let a=0;a1?h[h.length-2]:1,h[h.length-1]]},r.isReshapeCheap=function(h,p){let a=!1;return a=h.length===0||p.length===0||(h.length<2||p.length<2?h[h.length-1]===p[p.length-1]:h[h.length-1]===p[p.length-1]&&h[h.length-2]===p[p.length-2]),a}},718:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.reshape=void 0;const d=c(2517);r.reshape=(l,m)=>{const s=d.ShapeUtil.calculateReshapedDims(m[0].dims,m[1].integerData);return l.session.pack?[l.reshapePacked(m[0],s)]:[l.reshapeUnpacked(m[0],s)]}},2268:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.parseResizeAttributesV11=r.parseResizeAttributesV10=r.resize=void 0;const d=c(5060),l=c(2039),m=c(9390),s=c(2827),h=c(9793),p={name:"Resize",inputNames:["A"],inputTypes:[l.TextureType.packed]};r.resize=(n,i,u)=>((0,h.validateInputs)(i,u),[n.run(Object.assign(Object.assign({},p),{cacheHint:u.cacheKey,get:()=>a(n,i,u)}),i)]),r.parseResizeAttributesV10=n=>(0,h.parseUpsampleAttributes)(n,10),r.parseResizeAttributesV11=n=>(0,h.parseUpsampleAttributes)(n,11);const a=(n,i,u)=>{const g=(0,d.getGlsl)(n.session.backend.glContext.version),[b,y]=o(i,u);if(b.every(F=>F===1)&&u.coordinateTransformMode!=="tf_crop_and_resize")return Object.assign(Object.assign({},p),{output:{dims:y,type:i[0].type,textureType:l.TextureType.packed},hasMain:!0,shaderSource:`void main() { + vec4 v = ${g.texture2D}(X, TexCoords); + ${g.output} = v; + }`});const _=y.length;if(_<2)throw new Error(`output dimension should be at least 2, but got ${_}`);const v=y[_-2],w=y[_-1],T=i[0].dims;if(_!==T.length)throw new Error(`output dimension should match input ${T.length}, but got ${_}`);const A=T[_-2],E=T[_-1],x=b[_-2],P=b[_-1];let C="";if(u.mode!=="linear")throw new Error(`resize (packed) does not support mode: '${u.mode}'`);switch(u.coordinateTransformMode){case"asymmetric":C=` + vec4 getSourceFracIndex(ivec4 coords) { + return vec4(coords) / scaleWHWH; + } + `;break;case"half_pixel":C=` + vec4 getSourceFracIndex(ivec4 coords) { + return (vec4(coords) + 0.5) / scaleWHWH - 0.5; + } + `;break;case"pytorch_half_pixel":C=` + vec4 getSourceFracIndex(ivec4 coords) { + vec4 fcoords = vec4(coords); + return vec4( + ${w}.0 > 1.0 ? (fcoords.x + 0.5) / scaleWHWH.x - 0.5 : 0.0, + ${v}.0 > 1.0 ? (fcoords.y + 0.5) / scaleWHWH.y - 0.5 : 0.0, + ${w}.0 > 1.0 ? (fcoords.z + 0.5) / scaleWHWH.z - 0.5 : 0.0, + ${v}.0 > 1.0 ? (fcoords.w + 0.5) / scaleWHWH.w - 0.5 : 0.0 + ); + } + `;break;case"align_corners":C=` + vec4 getSourceFracIndex(ivec4 coords) { + vec4 resized = vec4(${w}.0 - 1.0, ${v}.0 - 1.0, ${w}.0 - 1.0, + ${v}.0 - 1.0); + vec4 original = vec4(${E}.0 - 1.0, ${A}.0 - 1.0, ${E}.0 - 1.0, + ${A}.0 - 1.0); + vec4 new_scale = original / resized; + return vec4(coords) * new_scale; + } + `;break;default:throw new Error(`resize (packed) does not support coordinateTransformMode: '${u.coordinateTransformMode}'`)}const k=(0,m.getCoordsDataType)(_),$=` + const vec2 inputWH = vec2(${A}.0, ${E}.0); + const vec4 scaleWHWH = vec4(float(${x}), float(${P}), float(${x}), float(${P})); + ${(0,s.unpackFromChannel)()} + ${C} + float getAValue(int x10, int r, int c, int d) { + return getChannel(getA(x10, r, c, d), vec2(c, d)); + } + void main() { + ${k} rc = getOutputCoords(); + + int batch = rc[0]; + int depth = rc[1]; + + // retrieve the 4 coordinates that is used in the 4 packed output values. + ivec4 coords = ivec4(rc.wz, rc.w + 1, rc.z + 1); + + // calculate the source index in fraction + vec4 sourceFrac = getSourceFracIndex(coords); + + // get the lower and upper bound of the 4 values that will be packed into one texel. + ivec4 x00 = ivec4(max(sourceFrac.xy, vec2(0.0)), min(inputWH - 1.0, ceil(sourceFrac.xy))); + ivec4 x01 = ivec4(max(sourceFrac.xw, vec2(0.0)), min(inputWH - 1.0, ceil(sourceFrac.xw))); + ivec4 x10 = ivec4(max(sourceFrac.zy, vec2(0.0)), min(inputWH - 1.0, ceil(sourceFrac.zy))); + ivec4 x11 = ivec4(max(sourceFrac.zw, vec2(0.0)), min(inputWH - 1.0, ceil(sourceFrac.zw))); + + bool hasNextRow = rc.w < ${v-1}; + bool hasNextCol = rc.z < ${w-1}; + + // pack x00, x01, x10, x11's top-left corner into one vec4 structure + vec4 topLeft = vec4( + getAValue(batch, depth, x00.x, x00.y), + hasNextCol ? getAValue(batch, depth, x01.x, x01.y) : 0.0, + hasNextRow ? getAValue(batch, depth, x10.x, x10.y) : 0.0, + (hasNextRow && hasNextCol) ? getAValue(batch, depth, x11.x, x11.y) : 0.0); + + // pack x00, x01, x10, x11's top-right corner into one vec4 structure + vec4 topRight = vec4( + getAValue(batch, depth, x00.x, x00.w), + hasNextCol ? getAValue(batch, depth, x01.x, x01.w) : 0.0, + hasNextRow ? getAValue(batch, depth, x10.x, x10.w) : 0.0, + (hasNextRow && hasNextCol) ? getAValue(batch, depth, x11.x, x11.w) : 0.0); + + // pack x00, x01, x10, x11's bottom-left corner into one vec4 structure + vec4 bottomLeft = vec4( + getAValue(batch, depth, x00.z, x00.y), + hasNextCol ? getAValue(batch, depth, x01.z, x01.y) : 0.0, + hasNextRow ? getAValue(batch, depth, x10.z, x10.y) : 0.0, + (hasNextRow && hasNextCol) ? getAValue(batch, depth, x11.z, x11.y) : 0.0); + + // pack x00, x01, x10, x11's bottom-right corner into one vec4 structure + vec4 bottomRight = vec4( + getAValue(batch, depth, x00.z, x00.w), + hasNextCol ? getAValue(batch, depth, x01.z, x01.w) : 0.0, + hasNextRow ? getAValue(batch, depth, x10.z, x10.w) : 0.0, + (hasNextRow && hasNextCol) ? getAValue(batch, depth, x11.z, x11.w) : 0.0); + + // calculate the interpolation fraction on u and v direction + vec4 frac = vec4(sourceFrac) - floor(sourceFrac); + vec4 clampFrac = clamp(frac, vec4(0.0), vec4(1.0)); + + vec4 top = mix(topLeft, topRight, clampFrac.ywyw); + vec4 bottom = mix(bottomLeft, bottomRight, clampFrac.ywyw); + vec4 newValue = mix(top, bottom, clampFrac.xxzz); + + ${g.output} = vec4(newValue); + } + `;return Object.assign(Object.assign({},p),{output:{dims:y,type:i[0].type,textureType:l.TextureType.packed},hasMain:!0,shaderSource:$})},o=(n,i)=>{const u=n[0].dims;let g,b=i.scales;if(b.length===0){const _=n[i.scalesInputIdx];if(_&&_.size!==0){if(n[i.sizesInputIdx])throw new Error("Only one of scales or sizes must be provided as input.");b=t(_,i.mode,i.isResize)}else{const v=n[i.sizesInputIdx];if(!v||v.size===0)throw new Error("Either scales or sizes MUST be provided as input.");g=Array.from(v.integerData),b=e(g,u,i.mode,i.isResize)}}else if(n[i.sizesInputIdx])throw new Error("Only one of scales or sizes must be provided as input.");const y=g||u.map((_,v)=>Math.floor(_*b[v]));return[b,y]},t=(n,i,u)=>{const g=Array.from(n.floatData);return(0,h.scalesValidation)(g,i,u),g},e=(n,i,u,g)=>{const b=i.length,y=new Array(b);for(let _=0,v=b;_{Object.defineProperty(r,"__esModule",{value:!0}),r.shape=void 0;const d=c(9162);r.shape=(m,s)=>(l(s),[new d.Tensor([s[0].dims.length],"int32",void 0,void 0,new Int32Array(s[0].dims))]);const l=m=>{if(!m||m.length!==1)throw new Error("Shape requires 1 input.")}},2278:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.sliceV10=r.parseSliceAttributes=r.slice=void 0;const d=c(246),l=c(782),m=c(2517),s=c(2039),h={name:"Slice",inputNames:["A"],inputTypes:[s.TextureType.unpacked]};r.slice=(e,n,i)=>(a(n),[e.run(Object.assign(Object.assign({},h),{cacheHint:i.cacheKey,get:()=>p(e,n[0],i)}),n)]),r.parseSliceAttributes=e=>{const n=e.attributes.getInts("starts"),i=e.attributes.getInts("ends"),u=e.attributes.getInts("axes",[]);return(0,d.createAttributeWithCacheKey)({starts:n,ends:i,axes:u})};const p=(e,n,i)=>{const u=i.axes.length===0?n.dims.slice(0).map((T,A)=>A):i.axes,g=m.ShapeUtil.normalizeAxes(u,n.dims.length),b=i.starts.map((T,A)=>T>n.dims[g[A]]-1?n.dims[g[A]]:m.ShapeUtil.normalizeAxis(T,n.dims[g[A]])),y=i.ends.map((T,A)=>T>n.dims[g[A]]-1?n.dims[g[A]]:m.ShapeUtil.normalizeAxis(T,n.dims[g[A]])),_=n.dims.slice(),v=[];for(let T=0;T0&&v.push(`outputIdx[${g[T]}] += ${b[T]};`);const w=` + float process(int outputIdx[${_.length}]) { + ${v.join(` + `)} + return _A(outputIdx); + }`;return Object.assign(Object.assign({},h),{output:{dims:_,type:n.type,textureType:s.TextureType.unpacked},shaderSource:w})},a=e=>{if(!e||e.length!==1)throw new Error("Slice requires 1 input.");if(l.NUMBER_TYPES.indexOf(e[0].type)===-1)throw new Error("Invalid input type.")};r.sliceV10=(e,n)=>{t(n);const i=o(e,n);return[e.run(Object.assign(Object.assign({},h),{cacheHint:i.cacheKey,get:()=>p(e,n[0],i)}),[n[0]])]};const o=(e,n)=>{if(!e.session.isInitializer(n[1].dataId)||!e.session.isInitializer(n[2].dataId)||n.length>=4&&!e.session.isInitializer(n[3].dataId)||n.length>=5&&!e.session.isInitializer(n[4].dataId))throw new Error("dynamic slice attributes are not allowed");if(n.length>=5&&n[4].integerData.some(b=>b!==1))throw new Error("currently non-1 steps is not supported for Slice");const i=Array.from(n[1].integerData),u=Array.from(n[2].integerData),g=n.length>=4?Array.from(n[3].integerData):[];return{starts:i,ends:u,axes:g,cacheKey:`${g};${i};${u}`}},t=e=>{if(!e||e.length<3||e.length>5)throw new Error("Invalid input number.");if(e[1].type!=="int32"||e[1].dims.length!==1)throw new Error("Invalid input type.");if(e[2].type!=="int32"||e[2].dims.length!==1)throw new Error("Invalid input type.");if(e.length>=4&&(e[3].type!=="int32"||e[3].dims.length!==1))throw new Error("Invalid input type.");if(e.length>=5&&(e[4].type!=="int32"||e[4].dims.length!==1))throw new Error("Invalid input type.")}},5524:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.softmaxV13=r.parseSoftmaxAttributesV13=r.parseSoftmaxAttributes=r.softmax=void 0;const d=c(246),l=c(2517),m=c(5060),s=c(2039),h=c(3738),p={name:"SoftmaxComputeMax",inputNames:["A"],inputTypes:[s.TextureType.unpacked]},a={name:"SoftmaxComputeScale",inputNames:["A","Max"],inputTypes:[s.TextureType.unpacked,s.TextureType.unpacked]},o={name:"SoftMax",inputNames:["A","Max","Norm"],inputTypes:[s.TextureType.unpacked,s.TextureType.unpacked,s.TextureType.unpacked]};r.softmax=(g,b,y)=>{u(b);const _=b[0].dims.slice(),v=l.ShapeUtil.normalizeAxis(y.axis,_.length),w=l.ShapeUtil.sizeToDimension(_,v),T=l.ShapeUtil.sizeFromDimension(_,v);return t(g,b,y,w,T)},r.parseSoftmaxAttributes=g=>(0,d.createAttributeWithCacheKey)({axis:g.attributes.getInt("axis",1)}),r.parseSoftmaxAttributesV13=g=>(0,d.createAttributeWithCacheKey)({axis:g.attributes.getInt("axis",-1)}),r.softmaxV13=(g,b,y)=>{u(b);const _=b[0].dims.slice(),v=l.ShapeUtil.normalizeAxis(y.axis,_.length),w=_.length,T=v!==w-1,A=[];let E,x=[],P=[];T&&(x=Array.from({length:w}).map((F,q)=>q),x[v]=w-1,x[w-1]=v,x.map(F=>A.push(_[F])),E=(0,d.createAttributeWithCacheKey)({perm:x}),P=(0,h.transpose)(g,b,E));const C=T?l.ShapeUtil.sizeToDimension(A,w-1):l.ShapeUtil.sizeToDimension(_,w-1),k=T?l.ShapeUtil.sizeFromDimension(A,w-1):l.ShapeUtil.sizeFromDimension(_,w-1),$=t(g,T?P:b,y,C,k);return T?(0,h.transpose)(g,$,E):$};const t=(g,b,y,_,v)=>{const w=e(g,b[0],_,v,[_]),T=g.run(Object.assign(Object.assign({},p),{cacheHint:y.cacheKey,get:()=>w}),b),A=n(g,b[0],_,v,w.output.dims,[_]),E=g.run(Object.assign(Object.assign({},a),{cacheHint:y.cacheKey,get:()=>A}),[b[0],T]),x=i(g,b[0],_,v,w.output.dims,A.output.dims);return[g.run(Object.assign(Object.assign({},o),{cacheHint:y.cacheKey,get:()=>x}),[b[0],T,E])]},e=(g,b,y,_,v)=>{const[w,T]=g.calculateTextureWidthAndHeight(b.dims,s.TextureType.unpacked),A=v.length;if(y<1||_<1)throw new Error("Logical row count N and feature count D must be greater than or equal to 1");if(v.length!==1)throw new Error("Dimensionality of the output should be 1");if(v[0]!==y)throw new Error("Shape of the output should be equal to logical row count");const E=(0,m.getGlsl)(g.session.backend.glContext.version),x=` + float process(int[${A}] indices) { + int logical_row_start_offset = indices[0] * ${_}; + + float max = getColorAsFloat(${E.texture2D}(A, offsetToCoords(logical_row_start_offset, ${w}, + ${T} ))); + for(int i=1; i<${_}; ++i) + { + float current = getColorAsFloat(${E.texture2D}(A, offsetToCoords(logical_row_start_offset + i, + ${w}, ${T}))); + if(current > max) + max = current; + } + + return max; + }`;return Object.assign(Object.assign({},p),{output:{dims:v,type:b.type,textureType:s.TextureType.unpacked},shaderSource:x})},n=(g,b,y,_,v,w)=>{const[T,A]=g.calculateTextureWidthAndHeight(b.dims,s.TextureType.unpacked),E=w.length;if(y<1||_<1)throw new Error("Logical row count N and feature count D must be greater than or equal to 1");if(w.length!==1)throw new Error("Dimensionality of the output should be 1");if(w[0]!==y)throw new Error("Shape of the output should be equal to logical row count");if(v.length!==1)throw new Error("Dimensionality of the intermediate results should be 1");if(v[0]!==y)throw new Error("Shape of the intermediate results should be equal to logical row count");const x=` + float process(int[${E}] indices) { + int logical_row_start_offset = indices[0] * ${_}; + + float norm_factor = 0.0; + float max = _Max(indices); + for(int i=0; i<${_}; ++i) + { + norm_factor += exp(getColorAsFloat(${(0,m.getGlsl)(g.session.backend.glContext.version).texture2D}(A, offsetToCoords(logical_row_start_offset + i, + ${T}, ${A}))) - max); + } + + return norm_factor; + }`;return Object.assign(Object.assign({},a),{output:{dims:w,type:b.type,textureType:s.TextureType.unpacked},shaderSource:x})},i=(g,b,y,_,v,w)=>{const[T,A]=g.calculateTextureWidthAndHeight(b.dims,s.TextureType.unpacked),E=b.dims.length;if(y<1||_<1)throw new Error("Logical row count N and feature count D must be greater than or equal to 1");if(v.length!==1||w.length!==1)throw new Error("Dimensionality of the intermediate results should be 1");if(v[0]!==y||w[0]!==y)throw new Error("Shape of the intermediate results should be equal to logical row count");const x=` + float process(int[${E}] indices) { + + // get offset of current logical tensor index from the 2-D texture coordinates (TexCoords) + int offset = coordsToOffset(TexCoords, ${T}, ${A}); + + //determine the logical row for this index + int logical_row_index[1]; + logical_row_index[0] = offset / ${_}; + + float norm_factor = _Norm(logical_row_index); + + // avoid possible division by 0 + // if norm_facor is 0, all elements are zero + // if so, return 0 + if(norm_factor == 0.0) + return 0.0; + + return exp(_A(indices) - _Max(logical_row_index)) / norm_factor; + }`;return Object.assign(Object.assign({},o),{output:{dims:b.dims,type:b.type,textureType:s.TextureType.unpacked},shaderSource:x})},u=g=>{if(!g||g.length!==1)throw new Error("Softmax requires 1 input.");if(g[0].type!=="float32"&&g[0].type!=="float64")throw new Error("Invalid input type")}},5975:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.parseSplitAttributes=r.split=void 0;const d=c(246),l=c(2517),m=c(2039),s={name:"Split",inputNames:["A"],inputTypes:[m.TextureType.unpacked]};r.split=(o,t,e)=>{a(t);const n=l.ShapeUtil.normalizeAxis(e.axis,t[0].dims.length),i=h(o,t,n,e),u=[];for(let g=0;gp(o,t[0],e,n,g)}),t));return u},r.parseSplitAttributes=o=>{const t=o.attributes.getInt("axis",0),e=o.attributes.getInts("split",[]),n=o.outputs.length;return(0,d.createAttributeWithCacheKey)({axis:t,split:e,numOutputs:n})};const h=(o,t,e,n)=>{const[,i]=l.SplitUtil.splitShape(t[0].dims,e,n.split,n.numOutputs);return i.length},p=(o,t,e,n,i)=>{const[u,g]=l.SplitUtil.splitShape(t.dims,n,e.split,e.numOutputs),b=g[i],y=u[i],_=` + float process(int indices[${y.length}]) { + indices[${n}] += ${b}; + return _A(indices); + } + `;return Object.assign(Object.assign({},s),{cacheHint:`${e.cacheKey}:${i}`,output:{dims:y,type:t.type,textureType:m.TextureType.unpacked},shaderSource:_})},a=o=>{if(!o||o.length!==1)throw new Error("Split requires one input.");if(o[0].type!=="int8"&&o[0].type!=="uint8"&&o[0].type!=="int16"&&o[0].type!=="uint16"&&o[0].type!=="int32"&&o[0].type!=="uint32"&&o[0].type!=="float32"&&o[0].type!=="float64"&&o[0].type!=="bool")throw new Error("Invalid input type.")}},3933:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.parseSqueezeAttributes=r.squeezeV13=r.squeeze=void 0;const d=c(2517);r.squeeze=(s,h,p)=>{l(h);const a=d.ShapeUtil.squeezeShape(h[0].dims,p);return[s.reshapeUnpacked(h[0],a)]},r.squeezeV13=(s,h)=>(m(h),(0,r.squeeze)(s,[h[0]],Array.from(h[1].integerData))),r.parseSqueezeAttributes=s=>s.attributes.getInts("axes");const l=s=>{if(!s||s.length!==1)throw new Error("Squeeze requires 1 input.");if(s[0].type==="string")throw new Error("invalid input tensor types.")},m=s=>{if(!s||s.length!==2)throw new Error("Squeeze requires 2 inputs.");if(s[1].type!=="int32")throw new Error("Invalid input type.")}},6558:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.sum=void 0;const d=c(5060),l=c(2039);r.sum=(h,p)=>{s(p);const a={name:"Sum",inputNames:p.map((o,t)=>`X${t}`),inputTypes:new Array(p.length).fill(l.TextureType.unpacked)};return[h.run(Object.assign(Object.assign({},a),{get:()=>m(h,p,a)}),p)]};const m=(h,p,a)=>{const o=(0,d.getGlsl)(h.session.backend.glContext.version),t=p[0].dims.slice(),e=` + void main() { + vec4 result = ${p.map((n,i)=>`${o.texture2D}(X${i},TexCoords)`).join(" + ")}; + ${o.output} = result; + } + `;return Object.assign(Object.assign({},a),{output:{dims:t,type:p[0].type,textureType:l.TextureType.unpacked},hasMain:!0,shaderSource:e})},s=h=>{if(!h||h.length===0)throw new Error("Sum requires inputs.");const p=h[0].dims.length;for(let a=1;a{Object.defineProperty(r,"__esModule",{value:!0}),r.tile=void 0;const d=c(782),l=c(2039);r.tile=(h,p)=>{s(p);const a={name:"Tile",inputNames:["A"],inputTypes:[l.TextureType.unpacked]};return[h.run(Object.assign(Object.assign({},a),{get:()=>m(h,p,a)}),p)]};const m=(h,p,a)=>{const o=p[0].dims.slice(),t=new Array(o.length),e=[];for(let u=0;u{if(!h||h.length!==2)throw new Error("Tile requires 2 input.");if(h[1].dims.length!==1)throw new Error("The second input shape must 1 dimension.");if(h[1].dims[0]!==h[0].dims.length)throw new Error("Invalid input shape.");if(d.NUMBER_TYPES.indexOf(h[0].type)===-1)throw new Error("Invalid input type.");if(h[1].type!=="int32"&&h[1].type!=="int16")throw new Error("Invalid repeat type.")}},3738:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.parseTransposeAttributes=r.transpose=void 0;const d=c(246),l=c(2517),m=c(2039),s={name:"Transpose",inputNames:["A"],inputTypes:[m.TextureType.unpacked]};r.transpose=(e,n,i)=>(t(n),[e.run(Object.assign(Object.assign({},s),{cacheHint:i.cacheKey,get:()=>h(e,n[0],i.perm)}),n)]),r.parseTransposeAttributes=e=>(0,d.createAttributeWithCacheKey)({perm:e.attributes.getInts("perm",[])});const h=(e,n,i)=>{const u=n.dims;i=p(u,i);const g=a(u,i),b=u.length,y=` + ${o("perm",i,b)} + float process(int indices[${b}]) { + int a[${b}]; + perm(a, indices); + return _A(a); + }`;return Object.assign(Object.assign({},s),{output:{dims:g,type:n.type,textureType:m.TextureType.unpacked},shaderSource:y})},p=(e,n)=>(n&&n.length!==e.length&&(n=[...e.keys()].reverse()),n),a=(e,n)=>(n=p(e,n),l.ShapeUtil.sortBasedOnPerm(e,n)),o=(e,n,i)=>{const u=[];u.push(`void ${e}(out int a[${i}], int src[${i}]) {`);for(let g=0;g{if(!e||e.length!==1)throw new Error("Transpose requires 1 input.");if(e[0].type!=="float32"&&e[0].type!=="float64")throw new Error("input should be float tensor")}},8710:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.encodeAsUint8=void 0;const d=c(5060),l=c(2039);r.encodeAsUint8=(m,s)=>{const h=s.shape,p=(0,d.getGlsl)(m.session.backend.glContext.version),a=` + const float FLOAT_MAX = 1.70141184e38; + const float FLOAT_MIN = 1.17549435e-38; + + bool isNaN(float val) { + return (val < 1.0 || 0.0 < val || val == 0.0) ? false : true; + } + + highp vec4 encodeAsUint8(highp float v) { + if (isNaN(v)) { + return vec4(255, 255, 255, 255); + } + + highp float av = abs(v); + + if(av < FLOAT_MIN) { + return vec4(0.0, 0.0, 0.0, 0.0); + } else if(v > FLOAT_MAX) { + return vec4(0.0, 0.0, 128.0, 127.0) / 255.0; + } else if(v < -FLOAT_MAX) { + return vec4(0.0, 0.0, 128.0, 255.0) / 255.0; + } + + highp vec4 c = vec4(0,0,0,0); + + highp float e = floor(log2(av)); + highp float m = exp2(fract(log2(av))) - 1.0; + + c[2] = floor(128.0 * m); + m -= c[2] / 128.0; + c[1] = floor(32768.0 * m); + m -= c[1] / 32768.0; + c[0] = floor(8388608.0 * m); + + highp float ebias = e + 127.0; + c[3] = floor(ebias / 2.0); + ebias -= c[3] * 2.0; + c[2] += floor(ebias) * 128.0; + + c[3] += 128.0 * step(0.0, -v); + + return c / 255.0; + } + + void main() { + float value = ${p.texture2D}(X,TexCoords).r; + ${p.output} = encodeAsUint8(value); + }`,o={name:"Uint8Encode",inputTypes:[l.TextureType.unpacked],inputNames:["X"],output:{dims:h,type:s.tensor.type,textureType:l.TextureType.downloadUint8AsFloat},shaderSource:a,hasMain:!0};return m.executeProgram(o,[s.tensor])}},4909:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.tanh=r.tan=r.sqrt=r.sin=r.sigmoid=r.relu=r.not=r.neg=r.log=r.parseLeakyReluAttributes=r.leakyRelu=r.identity=r.floor=r.exp=r.parseEluAttributes=r.elu=r.cos=r.ceil=r.clipV11=r.parseClipAttributes=r.clip=r.atan=r.asin=r.acos=r.abs=r.glslTanh=r.glslTan=r.glslSqrt=r.glslSigmoid=r.glslRelu=r.glslSin=r.glslNot=r.glslNeg=r.glslLog=r.glslLeakyRelu=r.glslIdentity=r.glslClip=r.glslFloor=r.glslExp=r.glslElu=r.glslCos=r.glslCeil=r.glslAtan=r.glslAsin=r.glslAcos=r.glslAbs=void 0;const d=c(246),l=c(2517),m=c(8520),s=c(5060),h=c(2039);function p(){return $("abs")}function a(){return $("acos")}function o(){return $("asin")}function t(){return $("atan")}function e(){return $("ceil")}function n(){return $("cos")}function i(D){const U="elu";return{body:` + const float alpha = float(${D}); + + float ${U}_(float a) { + return a >= 0.0 ? a: (exp(a) - 1.0) * alpha; + } + vec4 ${U}_(vec4 v) { + return vec4(${U}_(v.x), ${U}_(v.y), ${U}_(v.z), ${U}_(v.w)); + } + `,name:U,type:m.FunctionType.ValueBased}}function u(){return $("exp")}function g(){return $("floor")}function b(D,U){const J="clip";return{body:` + const float min = float(${D}); + const float max = float(${U}); + + float ${J}_(float a) { + return clamp(a, min, max); + } + vec4 ${J}_(vec4 v) { + return clamp(v, min, max); + } + `,name:J,type:m.FunctionType.ValueBased}}function y(){const D="indentity";return{body:` + float ${D}_(float a) { + return a; + } + vec4 ${D}_(vec4 v) { + return v; + } + `,name:D,type:m.FunctionType.ValueBased}}function _(D){const U="leakyRelu";return{body:` + const float alpha = float(${D}); + + float ${U}_(float a) { + return a < 0.0 ? a * alpha : a; + } + vec4 ${U}_(vec4 v) { + return vec4(${U}_(v.x), ${U}_(v.y), ${U}_(v.z), ${U}_(v.w)); + } + `,name:U,type:m.FunctionType.ValueBased}}function v(){return $("log")}function w(){const D="neg";return{body:` + float ${D}_(float a) { + return -a; + } + vec4 ${D}_(vec4 v) { + return -v; + } + `,name:D,type:m.FunctionType.ValueBased}}function T(){const D="not";return{body:` + float ${D}_(float a) { + return float( ! bool(a) ); + } + bool ${D}_(bool a) { + return !a; + } + vec4 ${D}_(vec4 v) { + return vec4(!bool(v.x), !bool(v.y), !bool(v.z), !bool(v.w)); + } + bvec4 ${D}_(bvec4 v) { + return bvec4(!v.x, !v.y, !v.z, !v.w); + } + `,name:D,type:m.FunctionType.ValueBased}}function A(){return $("sin")}function E(){const D="relu";return{body:` + float ${D}_(float a) { + return max( a, 0.0 ); + } + vec4 ${D}_(vec4 v) { + return max( v, 0.0 ); + } + `,name:D,type:m.FunctionType.ValueBased}}function x(){const D="sigmoid";return{body:` + float ${D}_(float a) { + return 1.0 / (1.0 + exp(-a)); + } + vec4 ${D}_(vec4 v) { + return 1.0 / (1.0 + exp(-v)); + } + `,name:D,type:m.FunctionType.ValueBased}}function P(){return $("sqrt")}function C(){return $("tan")}function k(){const D="tanh";return{body:` + float ${D}_(float a) { + a = clamp(a, -10., 10.); + a = exp(2.*a); + return (a - 1.) / (a + 1.); + } + vec4 ${D}_(vec4 v) { + v = clamp(v, -10., 10.); + v = exp(2.*v); + return (v - 1.) / (v + 1.); + } + `,name:D,type:m.FunctionType.ValueBased}}function $(D){return{body:` + float ${D}_(float a) { + return ${D}(a); + } + vec4 ${D}_(vec4 v) { + return ${D}(v); + } + `,name:D,type:m.FunctionType.ValueBased}}r.glslAbs=p,r.glslAcos=a,r.glslAsin=o,r.glslAtan=t,r.glslCeil=e,r.glslCos=n,r.glslElu=i,r.glslExp=u,r.glslFloor=g,r.glslClip=b,r.glslIdentity=y,r.glslLeakyRelu=_,r.glslLog=v,r.glslNeg=w,r.glslNot=T,r.glslSin=A,r.glslRelu=E,r.glslSigmoid=x,r.glslSqrt=P,r.glslTan=C,r.glslTanh=k;const F=(D,U,J,Y)=>{const Z=D.session.pack?h.TextureType.packed:h.TextureType.unpacked,te={name:J.name,inputTypes:[Z],inputNames:["A"],cacheHint:Y};return Object.assign(Object.assign({},te),{get:()=>((he,Me,Te,ue)=>{const xe=he.session.pack?h.TextureType.packed:h.TextureType.unpacked,_e=(0,s.getGlsl)(he.session.backend.glContext.version);return Object.assign(Object.assign({},Me),{output:{dims:Te.dims,type:Te.type,textureType:xe},shaderSource:` + ${ue.body} + void main() { + vec4 v = ${_e.texture2D}(A, TexCoords); + v = ${ue.name}_(v); + ${_e.output} = v; + } + `,hasMain:!0})})(D,te,U,J)})};r.abs=(D,U)=>[D.run(F(D,U[0],p()),U)],r.acos=(D,U)=>[D.run(F(D,U[0],a()),U)],r.asin=(D,U)=>[D.run(F(D,U[0],o()),U)],r.atan=(D,U)=>[D.run(F(D,U[0],t()),U)],r.clip=(D,U,J)=>[D.run(F(D,U[0],b(J.min,J.max),J.cacheKey),U)],r.parseClipAttributes=D=>(0,d.createAttributeWithCacheKey)({min:D.attributes.getFloat("min",l.MIN_CLIP),max:D.attributes.getFloat("max",l.MAX_CLIP)}),r.clipV11=(D,U)=>{const J=q(D,U);return(0,r.clip)(D,[U[0]],J)};const q=(D,U)=>{if(U.length>=3&&(!D.session.isInitializer(U[1].dataId)||!D.session.isInitializer(U[2].dataId)))throw new Error("dynamic clip attributes are not allowed");const J=U.length>=3?U[1].numberData[0]:l.MIN_CLIP,Y=U.length>=3?U[2].numberData[0]:l.MAX_CLIP;return(0,d.createAttributeWithCacheKey)({min:J,max:Y})};r.ceil=(D,U)=>[D.run(F(D,U[0],e()),U)],r.cos=(D,U)=>[D.run(F(D,U[0],n()),U)],r.elu=(D,U,J)=>[D.run(F(D,U[0],i(J.alpha),J.cacheKey),U)],r.parseEluAttributes=D=>(0,d.createAttributeWithCacheKey)({alpha:D.attributes.getFloat("alpha",1)}),r.exp=(D,U)=>[D.run(F(D,U[0],u()),U)],r.floor=(D,U)=>[D.run(F(D,U[0],g()),U)],r.identity=(D,U)=>[D.run(F(D,U[0],y()),U)],r.leakyRelu=(D,U,J)=>[D.run(F(D,U[0],_(J.alpha),J.cacheKey),U)],r.parseLeakyReluAttributes=D=>(0,d.createAttributeWithCacheKey)({alpha:D.attributes.getFloat("alpha",.01)}),r.log=(D,U)=>[D.run(F(D,U[0],v()),U)],r.neg=(D,U)=>[D.run(F(D,U[0],w()),U)],r.not=(D,U)=>[D.run(F(D,U[0],T()),U)],r.relu=(D,U)=>[D.run(F(D,U[0],E()),U)],r.sigmoid=(D,U)=>[D.run(F(D,U[0],x()),U)],r.sin=(D,U)=>[D.run(F(D,U[0],A()),U)],r.sqrt=(D,U)=>[D.run(F(D,U[0],P()),U)],r.tan=(D,U)=>[D.run(F(D,U[0],C()),U)],r.tanh=(D,U)=>[D.run(F(D,U[0],k()),U)]},5611:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.createUnpackProgramInfoLoader=r.createUnpackProgramInfo=void 0;const d=c(5060),l=c(2039),m=c(9390),s=c(2827),h={name:"unpack",inputNames:["A"],inputTypes:[l.TextureType.packed]};r.createUnpackProgramInfo=(p,a)=>{const o=a.dims.length,t=(0,s.getChannels)("rc",o),e=t.slice(-2),n=(0,m.getCoordsDataType)(o),i=(0,s.unpackFromChannel)(),u=a.dims.length===0?"":function(y,_){if(y===1)return"rc";let v="";for(let w=0;wObject.assign(Object.assign({},h),{get:()=>(0,r.createUnpackProgramInfo)(p,a)})},8428:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.parseUnsqueezeAttributes=r.unsqueezeV13=r.unsqueeze=void 0;const d=c(2517);r.unsqueeze=(s,h,p)=>{l(h);const a=d.ShapeUtil.unsqueezeShape(h[0].dims,p);return[s.reshapeUnpacked(h[0],a)]},r.unsqueezeV13=(s,h)=>(m(h),(0,r.unsqueeze)(s,[h[0]],Array.from(h[1].integerData))),r.parseUnsqueezeAttributes=s=>s.attributes.getInts("axes");const l=s=>{if(!s||s.length!==1)throw new Error("Unsqueeze requires 1 input.");if(s[0].type==="string")throw new Error("invalid input tensor types.")},m=s=>{if(!s||s.length!==2)throw new Error("Unsqueeze requires 2 inputs.");if(s[1].type!=="int32")throw new Error("Invalid input type.")}},9793:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.scalesValidation=r.validateInputs=r.parseUpsampleAttributes=r.parseUpsampleAttributesV9=r.parseUpsampleAttributesV7=r.upsample=void 0;const d=c(246),l=c(5060),m=c(2039),s={name:"Upsample",inputNames:["X"],inputTypes:[m.TextureType.unpacked]};r.upsample=(p,a,o)=>((0,r.validateInputs)(a,o),[p.run(Object.assign(Object.assign({},s),{cacheHint:o.cacheKey,get:()=>h(p,a,o)}),a)]),r.parseUpsampleAttributesV7=p=>(0,r.parseUpsampleAttributes)(p,7),r.parseUpsampleAttributesV9=p=>(0,r.parseUpsampleAttributes)(p,9),r.parseUpsampleAttributes=(p,a)=>{const o=a>=10,t=p.attributes.getString("mode","nearest");if(t!=="nearest"&&t!=="linear"&&(a<11||t!=="cubic"))throw new Error(`unrecognized mode: ${t}`);let e=[];a<9&&(e=p.attributes.getFloats("scales"),(0,r.scalesValidation)(e,t,o));const n=p.attributes.getFloat("extrapolation_value",0),i=a>10?p.attributes.getString("coordinate_transformation_mode","half_pixel"):"asymmetric";if(["asymmetric","pytorch_half_pixel","tf_half_pixel_for_nn","align_corners","tf_crop_and_resize","half_pixel"].indexOf(i)===-1)throw new Error(`coordinate_transform_mode '${i}' is not supported`);const u=i==="tf_crop_and_resize",g=u,b=t==="nearest"&&a>=11?p.attributes.getString("nearest_mode","round_prefer_floor"):"";if(["round_prefer_floor","round_prefer_ceil","floor","ceil",""].indexOf(b)===-1)throw new Error(`nearest_mode '${b}' is not supported`);const y=p.attributes.getFloat("cubic_coeff_a",-.75),_=p.attributes.getInt("exclude_outside",0)!==0;if(_&&t!=="cubic")throw new Error("exclude_outside can be set to 1 only when mode is CUBIC.");const v=a<11||t==="nearest"&&i==="asymmetric"&&b==="floor";let w=0,T=0,A=0;return a>10?p.inputs.length>2?(w=1,T=2,A=3):(T=1,A=2):a===9&&(T=1),(0,d.createAttributeWithCacheKey)({opset:a,isResize:o,mode:t,scales:e,extrapolationValue:n,coordinateTransformMode:i,useExtrapolation:g,needRoiInput:u,nearestMode:b,cubicCoefficientA:y,excludeOutside:_,useNearest2xOptimization:v,roiInputIdx:w,scalesInputIdx:T,sizesInputIdx:A})};const h=(p,a,o)=>{const t=(0,l.getGlsl)(p.session.backend.glContext.version),[e,n]=p.calculateTextureWidthAndHeight(a[0].dims,m.TextureType.unpacked),i=a[0].dims.map((A,E)=>Math.floor(A*o.scales[E])),[u,g]=p.calculateTextureWidthAndHeight(i,m.TextureType.unpacked),b=i.length,y=new Array(b),_=new Array(b);let v=` + int output_pitches[${b}]; + int input_pitches[${b}]; + `;for(let A=b-1;A>=0;A--)y[A]=A===b-1?1:y[A+1]*i[A+1],_[A]=A===b-1?1:_[A+1]*a[0].dims[A+1],v+=` + output_pitches[${A}] = ${y[A]}; + input_pitches[${A}] = ${_[A]}; + `;const w=` + float getInputFloat(int index) { + vec2 coords = offsetToCoords(index, ${e}, ${n}); + float value = getColorAsFloat(${t.texture2D}(X, coords)); + return value; + } + `,T=o.mode==="nearest"?` + ${w} + float process(int indices[${b}]) { + int input_index = 0; + int output_index = coordsToOffset(TexCoords, ${u}, ${g}); + + ${v} + + int d, m; + for (int dim = 0; dim < ${b}; ++dim) { + d = output_index / output_pitches[dim]; + m = output_index - d * output_pitches[dim]; + output_index = m; + + if (scales[dim] != 1 && d > 0) { + int d2 = d / scales[dim]; + m = d - d2 * scales[dim]; + d = d2; + } + input_index += input_pitches[dim] * d; + } + + return getInputFloat(input_index); + }`:b===4?` + ${w} + float process(int indices[4]) { + int input_index = 0; + int output_index = coordsToOffset(TexCoords, ${u}, ${g}); + + ${v} + + int m; + int index_of_dim0, index_of_dim1, index_of_dim2, index_of_dim3; + index_of_dim0 = output_index / output_pitches[0]; + m = output_index - index_of_dim0 * output_pitches[0]; + index_of_dim1 = m / output_pitches[1]; + m = m - index_of_dim1 * output_pitches[1]; + index_of_dim2 = m / output_pitches[2]; + m = m - index_of_dim2 * output_pitches[2]; + index_of_dim3 = m; + + int index_of_input_dim2, index_of_input_dim3, x_offset, y_offset; + index_of_input_dim2 = index_of_dim2 / scales[2]; + y_offset = index_of_dim2 - index_of_input_dim2 * scales[2]; + index_of_input_dim3 = index_of_dim3 / scales[3]; + x_offset = index_of_dim3 - index_of_input_dim3 * scales[3]; + + input_index = index_of_dim0 * input_pitches[0] + + index_of_dim1 * input_pitches[1] + + index_of_input_dim2 * input_pitches[2] + + index_of_input_dim3; + + float x00 = getInputFloat(input_index); + float x10, x01, x11; + + bool end_of_dim2 = false; + if (index_of_input_dim2 == (${a[0].dims[2]} - 1)) { + // It's the end in dimension 2 + x01 = x00; + end_of_dim2 = true; + } else { + x01 = getInputFloat(input_index + input_pitches[2]); + } + + if (index_of_input_dim3 == (input_pitches[2] - 1)) { + // It's the end in dimension 3 + x10 = x00; + x11 = x01; + } + else { + x10 = getInputFloat(input_index + 1); + x11 = end_of_dim2 ? x10 : getInputFloat(input_index + input_pitches[2] + 1); + } + + float y0 = x00 + float(y_offset) * (x01 - x00) / float(scales[2]); + float y1 = x10 + float(y_offset) * (x11 - x10) / float(scales[2]); + return y0 + float(x_offset) * (y1 - y0) / float(scales[3]); + }`:` + ${w} + float process(int indices[2]) { + int input_index = 0; + int output_index = coordsToOffset(TexCoords, ${u}, ${g}); + + ${v} + + int m; + int index_of_dim0, index_of_dim1; + index_of_dim0 = output_index / output_pitches[0]; + m = output_index - index_of_dim0 * output_pitches[0]; + index_of_dim1 = m; + + int index_of_input_dim0, index_of_input_dim1, x_offset, y_offset; + index_of_input_dim0 = index_of_dim0 / scales[0]; + y_offset = index_of_dim0 - index_of_input_dim0 * scales[0]; + index_of_input_dim1 = index_of_dim1 / scales[1]; + x_offset = index_of_dim1 - index_of_input_dim1 * scales[1]; + + input_index = index_of_input_dim0 * input_pitches[0] + index_of_input_dim1; + + float x00 = getInputFloat(input_index); + float x10, x01, x11; + + bool end_of_dim0 = false; + if (index_of_input_dim0 == (${a[0].dims[0]} - 1)) { + // It's the end in dimension 0 + x01 = x00; + end_of_dim0 = true; + } else { + x01 = getInputFloat(input_index + input_pitches[0]); + } + + if (index_of_input_dim1 == (input_pitches[0] - 1)) { + // It's the end in dimension 1 + x10 = x00; + x11 = x01; + } + else { + x10 = getInputFloat(input_index + 1); + x11 = end_of_dim0 ? x10 : getInputFloat(input_index + input_pitches[0] + 1); + } + + float y0 = x00 + float(y_offset) * (x01 - x00) / float(scales[0]); + float y1 = x10 + float(y_offset) * (x11 - x10) / float(scales[0]); + return y0 + float(x_offset) * (y1 - y0) / float(scales[1]); + }`;return Object.assign(Object.assign({},s),{output:{dims:i,type:a[0].type,textureType:m.TextureType.unpacked},shaderSource:T,variables:[{name:"scales",type:"int",arrayLength:o.scales.length,data:o.scales.map(A=>Math.ceil(A))}]})};r.validateInputs=(p,a)=>{if(!p||a.opset<9&&p.length!==1||a.opset>=9&&a.opset<11&&p.length!==2||a.opset>=11&&p.length<2)throw new Error("invalid inputs.");if(a.scales.length>0&&p[0].dims.length!==a.scales.length)throw new Error("Invalid input shape.");if(p[0].type==="string")throw new Error("Invalid input tensor types.")},r.scalesValidation=(p,a,o)=>{if(o){for(const t of p)if(t<=0)throw new Error("Scale value should be greater than 0.")}else for(const t of p)if(t<1)throw new Error("Scale value should be greater than or equal to 1.");if(!(a!=="linear"&&a!=="cubic"||p.length===2||p.length===4&&p[0]===1&&p[1]===1))throw new Error(`'Linear' mode and 'Cubic' mode only support 2-D inputs ('Bilinear', 'Bicubic') or 4-D inputs with the corresponding outermost 2 scale values being 1 in the ${o?"Resize":"Upsample"} opeartor.`)}},1958:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ProgramManager=void 0;const d=c(1670),l=c(6231),m=c(8879),s=c(5060);r.ProgramManager=class{constructor(h,p,a){this.profiler=h,this.glContext=p,this.textureLayoutStrategy=a,this.repo=new Map,this.attributesBound=!1}getArtifact(h){return this.repo.get(h)}setArtifact(h,p){this.repo.set(h,p)}run(h,p,a){var o;this.profiler.event("op",`ProgramManager.run ${(o=h.programInfo.name)!==null&&o!==void 0?o:"unknown kernel"}`,()=>{var t;const e=this.glContext.gl,n=h.program;e.useProgram(n);try{this.bindOutput(a),this.attributesBound||this.bindAttributes(h.attribLocations),this.bindUniforms(h.uniformLocations,(t=h.programInfo.variables)!==null&&t!==void 0?t:[],p)}catch(i){throw l.Logger.error("ProgramManager",h.programInfo.shaderSource),i}this.profiler.event("backend","GlContext.draw()",()=>{this.glContext.draw()})},this.glContext)}dispose(){this.vertexShader&&this.glContext.deleteShader(this.vertexShader),this.repo.forEach(h=>this.glContext.deleteProgram(h.program))}build(h,p,a){return this.profiler.event("backend","ProgramManager.build",()=>{const o=new m.GlslPreprocessor(this.glContext,h,p,a),t=o.preprocess(),e=this.compile(t);return{programInfo:h,program:e,uniformLocations:this.getUniformLocations(e,o.context.programInfo.inputNames,o.context.programInfo.variables),attribLocations:this.getAttribLocations(e)}})}compile(h){if(!this.vertexShader){l.Logger.verbose("ProrgramManager","Compiling and caching Vertex shader for the first time");const o=(0,s.getVertexShaderSource)(this.glContext.version);this.vertexShader=this.glContext.compileShader(o,this.glContext.gl.VERTEX_SHADER)}d.env.debug&&l.Logger.verbose("ProrgramManager",`FragShader: +${h} +`);const p=this.glContext.compileShader(h,this.glContext.gl.FRAGMENT_SHADER),a=this.glContext.createProgram(this.vertexShader,p);return this.glContext.deleteShader(p),a}bindOutput(h){const p=h.width,a=h.height;l.Logger.verbose("ProrgramManager",`Binding output texture to Framebuffer: w/h=${p}/${a}, shape=${h.shape}, type=${h.tensor.type}`),this.glContext.attachFramebuffer(h.texture,p,a)}bindAttributes(h){const p=h.position,a=h.textureCoord;this.glContext.setVertexAttributes(p,a),this.attributesBound=!0}bindUniforms(h,p,a){var o;const t=this.glContext.gl;let e=0;for(const{name:n,type:i,location:u,arrayLength:g}of h){const b=(o=p.find(y=>y.name===n))===null||o===void 0?void 0:o.data;if(i!=="sampler2D"&&!b)throw new Error(`variable '${n}' does not have data defined in program info`);switch(i){case"sampler2D":this.bindTexture(a[e],u,e),e++;break;case"float":g?t.uniform1fv(u,b):t.uniform1f(u,b);break;case"int":g?t.uniform1iv(u,b):t.uniform1i(u,b);break;default:throw new Error(`Uniform not implemented: ${i}`)}}}bindTexture(h,p,a){this.glContext.bindTextureToUniform(h.texture,a,p)}getAttribLocations(h){return{position:this.getAttribLocation(h,"position"),textureCoord:this.getAttribLocation(h,"textureCoord")}}getUniformLocations(h,p,a){const o=[];if(p)for(const t of p)o.push({name:t,type:"sampler2D",location:this.getUniformLocation(h,t)});if(a)for(const t of a)o.push(Object.assign(Object.assign({},t),{location:this.getUniformLocation(h,t.name)}));return o}getUniformLocation(h,p){const a=this.glContext.gl.getUniformLocation(h,p);if(a===null)throw new Error(`Uniform ${p} not found.`);return a}getAttribLocation(h,p){return this.glContext.gl.getAttribLocation(h,p)}}},6416:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.WebGLSessionHandler=void 0;const d=c(6231),l=c(1047),m=c(8316),s=c(1640),h=c(1958),p=c(7859),a=c(5702);r.WebGLSessionHandler=class{constructor(o,t){this.backend=o,this.context=t,this.layoutStrategy=new p.PreferLogicalStrategy(o.glContext.maxTextureSize),this.programManager=new h.ProgramManager(this.context.profiler,o.glContext,this.layoutStrategy),this.textureManager=new a.TextureManager(o.glContext,this.layoutStrategy,this.context.profiler,{reuseTextures:o.textureCacheMode==="full"}),this.packedTextureDataCache=new Map,this.unpackedTextureDataCache=new Map,this.pack=o.pack,this.pack2unpackMap=new Map,this.unpack2packMap=new Map}createInferenceHandler(){return new m.WebGLInferenceHandler(this)}onGraphInitialized(o){const t=o.getValues().filter(e=>e.from===-1&&e.tensor).map(e=>e.tensor.dataId);this.initializers=new Set(t)}isInitializer(o){return!!this.initializers&&this.initializers.has(o)}addInitializer(o){this.initializers.add(o)}getTextureData(o,t){return t?this.packedTextureDataCache.get(o):this.unpackedTextureDataCache.get(o)}setTextureData(o,t,e=!1){d.Logger.verbose("WebGLSessionHandler","Storing Texture data in cache"),e?this.packedTextureDataCache.set(o,t):this.unpackedTextureDataCache.set(o,t)}dispose(){this.programManager.dispose(),this.textureManager.clearActiveTextures(),this.packedTextureDataCache.forEach(o=>this.textureManager.releaseTexture(o,!0)),this.packedTextureDataCache=new Map,this.unpackedTextureDataCache.forEach(o=>this.textureManager.releaseTexture(o,!0)),this.unpackedTextureDataCache=new Map}resolve(o,t,e){const n=(0,l.resolveOperator)(o,t,s.WEBGL_OP_RESOLVE_RULES);return{impl:n.opImpl,context:n.opInit?n.opInit(o,e):o}}}},7769:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Uint8DataEncoder=r.RGBAFloatDataEncoder=r.RedFloat32DataEncoder=void 0;const d=c(6231);r.RedFloat32DataEncoder=class{constructor(l,m=1){if(m===1)this.internalFormat=l.R32F,this.format=l.RED,this.textureType=l.FLOAT,this.channelSize=m;else{if(m!==4)throw new Error(`Invalid number of channels: ${m}`);this.internalFormat=l.RGBA32F,this.format=l.RGBA,this.textureType=l.FLOAT,this.channelSize=m}}encode(l,m){let s,h;return l.constructor!==Float32Array&&(d.Logger.warning("Encoder","data was not of type Float32; creating new Float32Array"),h=new Float32Array(l)),m*this.channelSize>l.length?(d.Logger.warning("Encoder","Source data too small. Allocating larger array"),h=l,s=this.allocate(m*this.channelSize),h.forEach((p,a)=>s[a]=p)):(h=l,s=h),s}allocate(l){return new Float32Array(4*l)}decode(l,m){return this.channelSize===1?l.filter((s,h)=>h%4==0).subarray(0,m):l.subarray(0,m)}},r.RGBAFloatDataEncoder=class{constructor(l,m=1,s){if(m!==1&&m!==4)throw new Error(`Invalid number of channels: ${m}`);this.internalFormat=l.RGBA,this.format=l.RGBA,this.channelSize=m,this.textureType=s||l.FLOAT}encode(l,m){let s=l;return this.channelSize===1&&(d.Logger.verbose("Encoder","Exploding into a larger array"),s=this.allocate(m),l.forEach((h,p)=>s[4*p]=h)),s}allocate(l){return new Float32Array(4*l)}decode(l,m){return this.channelSize===1?l.filter((s,h)=>h%4==0).subarray(0,m):l.subarray(0,m)}},r.Uint8DataEncoder=class{constructor(l,m=1){if(this.channelSize=4,m===1)this.internalFormat=l.ALPHA,this.format=l.ALPHA,this.textureType=l.UNSIGNED_BYTE,this.channelSize=m;else{if(m!==4)throw new Error(`Invalid number of channels: ${m}`);this.internalFormat=l.RGBA,this.format=l.RGBA,this.textureType=l.UNSIGNED_BYTE,this.channelSize=m}}encode(l,m){return new Uint8Array(l.buffer,l.byteOffset,l.byteLength)}allocate(l){return new Uint8Array(l*this.channelSize)}decode(l,m){if(l instanceof Uint8Array)return l.subarray(0,m);throw new Error(`Invalid array type: ${l.constructor}`)}}},7859:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.getBatchDim=r.sizeToSquarishShape=r.getRowsCols=r.sizeFromShape=r.isInt=r.parseAxisParam=r.squeezeShape=r.PreferLogicalStrategy=r.AlwaysKeepOriginalSizeStrategy=void 0;const d=c(6231),l=c(2517);function m(o,t){const e=[],n=[],i=t!=null&&Array.isArray(t)&&t.length===0,u=t==null||i?null:s(t,o).sort();let g=0;for(let b=0;bb)&&o[b]===1&&(e.push(o[b]),n.push(b)),u[g]<=b&&g++}o[b]!==1&&(e.push(o[b]),n.push(b))}return{newShape:e,keptDims:n}}function s(o,t){const e=t.length;return o=o==null?t.map((n,i)=>i):[].concat(o),(0,l.assert)(o.every(n=>n>=-e&&n`All values in axis param must be in range [-${e}, ${e}) but got axis ${o}`),(0,l.assert)(o.every(h),()=>`All values in axis param must be integers but got axis ${o}`),o.map(n=>n<0?e+n:n)}function h(o){return o%1==0}function p(o){if(o.length===0)return 1;let t=o[0];for(let e=1;e=o.length?1:o.slice(t.breakAxis).reduce((b,y)=>b*y),g=t.breakAxis<=0?1:o.slice(0,t.breakAxis).reduce((b,y)=>b*y);if(!(u>e||g>e))return[u,g];d.Logger.verbose("TextureLayout",`Given width/height preferences were unattainable: shape:${o}, breakAxis:${t.breakAxis}`)}const n=o.reduce((u,g)=>u*g);let i=Math.floor(Math.sqrt(n));for(;i=e||n%i!=0)throw new Error(`The given dimensions are outside this GPU's boundaries: ${o}`);return[i,n/i]}},r.PreferLogicalStrategy=class{constructor(o){this.maxTextureSize=o}computeTextureWH(o,t){const e=this.computeTexture(o,t);return t&&t.isPacked&&(e[0]/=2,e[1]/=2),t&&t.reverseWH?[e[1],e[0]]:e}computeTexture(o,t){const e=t&&t.isPacked;if(o.length===0)return e?[2,2]:[1,1];let n=this.maxTextureSize;if(t&&t.breakAxis!==void 0){const g=t.breakAxis>=o.length?1:o.slice(t.breakAxis).reduce((y,_)=>y*_),b=t.breakAxis<=0?1:o.slice(0,t.breakAxis).reduce((y,_)=>y*_);if(!(g>n||b>n))return[g,b];d.Logger.verbose("TextureLayout",`Given width/height preferences were unattainable: shape:${o}, breakAxis:${t.breakAxis}`)}let i=o.slice(0);e&&(n*=2,i=i.map((g,b)=>b>=i.length-2?i[b]%2==0?i[b]:i[b]+1:i[b]),i.length===1&&(i=[2,i[0]])),i.length!==2&&(i=m(i).newShape);const u=p(i);return i.length<=1&&u<=n?[1,u]:i.length===2&&i[0]<=n&&i[1]<=n?i:i.length===3&&i[0]*i[1]<=n&&i[2]<=n?[i[0]*i[1],i[2]]:i.length===3&&i[0]<=n&&i[1]*i[2]<=n?[i[0],i[1]*i[2]]:i.length===4&&i[0]*i[1]*i[2]<=n&&i[3]<=n?[i[0]*i[1]*i[2],i[3]]:i.length===4&&i[0]<=n&&i[1]*i[2]*i[3]<=n?[i[0],i[1]*i[2]*i[3]]:e?a(u/4).map(g=>2*g):a(u)}},r.squeezeShape=m,r.parseAxisParam=s,r.isInt=h,r.sizeFromShape=p,r.getRowsCols=function(o){if(o.length===0)throw Error("Cannot get rows and columns of an empty shape array.");return[o.length>1?o[o.length-2]:1,o[o.length-1]]},r.sizeToSquarishShape=a,r.getBatchDim=function(o,t=2){return p(o.slice(0,o.length-t))}},4057:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.createTextureLayoutFromShape=r.calculateTextureWidthAndHeight=r.createTextureLayoutFromTextureType=void 0;const d=c(2517),l=c(2039);r.createTextureLayoutFromTextureType=(m,s,h)=>{const p=h===l.TextureType.unpacked||h===l.TextureType.unpackedReversed?1:4,a=h===l.TextureType.packed,o=h===l.TextureType.unpackedReversed||h===l.TextureType.packed,t=h===l.TextureType.packedLastDimension?s.length-1:void 0,e=h===l.TextureType.packedLastDimension?s.map((n,i)=>i===s.length-1?4*n:n):void 0;return(0,r.createTextureLayoutFromShape)(m,s,p,e,{isPacked:a,reverseWH:o,breakAxis:t})},r.calculateTextureWidthAndHeight=(m,s,h)=>{const p=(0,r.createTextureLayoutFromTextureType)(m,s,h);return[p.width,p.height]},r.createTextureLayoutFromShape=(m,s,h=1,p,a)=>{const o=!(!a||!a.isPacked),[t,e]=m.computeTextureWH(o&&p||s,a),n=s.length;let i=s.slice(0);if(n===0&&(i=[1]),h===1)p=s;else if(o){if(h!==4)throw new Error("a packed texture must be 4-channel");p=s,n>0&&(i[n-1]=Math.ceil(i[n-1]/2)),n>1&&(i[n-2]=Math.ceil(i[n-2]/2))}else if(!p)throw new Error("Unpacked shape is needed when using channels > 1");return{width:t,height:e,channels:h,isPacked:o,shape:i,strides:d.ShapeUtil.computeStrides(i),unpackedShape:p,reversedWH:a&&a.reverseWH}}},5702:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.TextureManager=void 0;const d=c(6231);r.TextureManager=class{constructor(l,m,s,h){this.glContext=l,this.layoutStrategy=m,this.profiler=s,this.config=h,this.pendingRead=new Map,h.reuseTextures&&(this.inUseTextures=new Map,this.idleTextures=new Map,this.textureLookup=new Map)}createTextureFromLayout(l,m,s,h){const p=this.toEncoderType(l),a=this.glContext.getEncoder(p,m.channels||1,h);if(m.isPacked&&h===1)throw new Error("not implemented");const o=m.width,t=m.height;let e,n;if(this.config.reuseTextures){e=`${o}x${t}_${a.format}_${a.internalFormat}_${a.textureType}`,n=this.inUseTextures.get(e),n||(n=[],this.inUseTextures.set(e,n));const u=this.idleTextures.get(e);if(u&&u.length>0){const g=u.pop();return n.push(g),h===1&&this.glContext.updateTexture(g,o,t,a,this.toTextureData(l,s)),g}}d.Logger.verbose("TextureManager",`Creating new texture of size ${m.width}x${m.height}`);const i=this.glContext.allocateTexture(o,t,a,this.toTextureData(l,s));return this.config.reuseTextures&&(n.push(i),this.textureLookup.set(i,e)),i}readTexture(l,m,s){return s||(s=1),this.profiler.event("backend","TextureManager.readTexture",()=>{const h=l.shape.reduce((a,o)=>a*o)*s,p=this.glContext.readTexture(l.texture,l.width,l.height,h,this.toEncoderType(m),s);return this.toTensorData(m,p)})}async readTextureAsync(l,m,s){const h=l.tensor.dataId;if(s||(s=1),this.pendingRead.has(h)){const p=this.pendingRead.get(h);return new Promise(a=>p==null?void 0:p.push(a))}return this.profiler.event("backend","TextureManager.readTextureAsync",async()=>{this.pendingRead.set(h,[]);const p=l.shape.reduce((e,n)=>e*n)*s;await this.glContext.createAndWaitForFence();const a=this.glContext.readTexture(l.texture,l.width,l.height,p,this.toEncoderType(m),s),o=this.toTensorData(m,a),t=this.pendingRead.get(h);return this.pendingRead.delete(h),t==null||t.forEach(e=>e(o)),o})}readUint8TextureAsFloat(l){return this.profiler.event("backend","TextureManager.readUint8TextureAsFloat",()=>{const m=l.shape.reduce((h,p)=>h*p),s=this.glContext.readTexture(l.texture,l.width,l.height,4*m,"byte",4);return new Float32Array(s.buffer,s.byteOffset,m)})}releaseTexture(l,m){let s;if(this.config.reuseTextures&&(s=this.textureLookup.get(l.texture),s)){m&&this.textureLookup.delete(s);const h=this.inUseTextures.get(s);if(h){const p=h.indexOf(l.texture);if(p!==-1){h.splice(p,1);let a=this.idleTextures.get(s);a||(a=[],this.idleTextures.set(s,a)),a.push(l.texture)}}}s&&!m||(d.Logger.verbose("TextureManager",`Deleting texture of size ${l.width}x${l.height}`),this.glContext.deleteTexture(l.texture))}toTensorData(l,m){switch(l){case"int16":return m instanceof Int16Array?m:Int16Array.from(m);case"int32":return m instanceof Int32Array?m:Int32Array.from(m);case"int8":return m instanceof Int8Array?m:Int8Array.from(m);case"uint16":return m instanceof Uint16Array?m:Uint16Array.from(m);case"uint32":return m instanceof Uint32Array?m:Uint32Array.from(m);case"uint8":case"bool":return m instanceof Uint8Array?m:Uint8Array.from(m);case"float32":return m instanceof Float32Array?m:Float32Array.from(m);case"float64":return m instanceof Float64Array?m:Float64Array.from(m);default:throw new Error(`TensorData type ${l} is not supported`)}}toTextureData(l,m){if(m)return m instanceof Float32Array?m:new Float32Array(m)}toEncoderType(l){return"float"}clearActiveTextures(){this.glContext.clearActiveTextures()}}},2039:(f,r)=>{var c;Object.defineProperty(r,"__esModule",{value:!0}),r.TextureType=void 0,(c=r.TextureType||(r.TextureType={}))[c.unpacked=0]="unpacked",c[c.unpackedReversed=1]="unpackedReversed",c[c.packed=2]="packed",c[c.downloadUint8AsFloat=3]="downloadUint8AsFloat",c[c.packedLastDimension=4]="packedLastDimension"},9390:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.getGlChannels=r.getCoordsDataType=r.getSqueezedParams=r.squeezeInputShape=r.generateShaderFuncNameFromInputSamplerNameAtOutCoords=r.generateShaderFuncNameFromInputSamplerName=r.repeatedTry=r.getPackedShape=void 0;const d=c(2517);r.getPackedShape=function(l){const m=l.length;return l.slice(0,m-1).concat(l[m-1]/4)},r.repeatedTry=async function(l,m=h=>0,s){return new Promise((h,p)=>{let a=0;const o=()=>{if(l())return void h();a++;const t=m(a);s!=null&&a>=s?p():setTimeout(o,t)};o()})},r.generateShaderFuncNameFromInputSamplerName=function(l){return(0,d.assert)(l!==void 0&&l.length!==0,()=>"empty string found for sampler name"),"get"+l.charAt(0).toUpperCase()+l.slice(1)},r.generateShaderFuncNameFromInputSamplerNameAtOutCoords=function(l){return(0,d.assert)(l!==void 0&&l.length!==0,()=>"empty string found for sampler name"),"get"+l.charAt(0).toUpperCase()+l.slice(1)+"AtOutCoords"},r.squeezeInputShape=function(l,m){let s=JSON.parse(JSON.stringify(l));return s=m,s},r.getSqueezedParams=function(l,m){return m.map(s=>l[s]).join(", ")},r.getCoordsDataType=function(l){if(l<=1)return"int";if(l===2)return"ivec2";if(l===3)return"ivec3";if(l===4)return"ivec4";if(l===5)return"ivec5";if(l===6)return"ivec6";throw Error(`GPU for rank ${l} is not yet supported`)},r.getGlChannels=function(l=6){return["x","y","z","w","u","v"].slice(0,l)}},7305:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.createNewWebGLContext=r.createWebGLContext=void 0;const d=c(6231),l=c(1713),m={};function s(h){const p=function(){if(typeof document>"u"){if(typeof OffscreenCanvas>"u")throw new TypeError("failed to create canvas: OffscreenCanvas is not supported");return new OffscreenCanvas(1,1)}const t=document.createElement("canvas");return t.width=1,t.height=1,t}();let a;const o={alpha:!1,depth:!1,antialias:!1,stencil:!1,preserveDrawingBuffer:!1,premultipliedAlpha:!1,failIfMajorPerformanceCaveat:!1};if((!h||h==="webgl2")&&(a=p.getContext("webgl2",o),a))try{return new l.WebGLContext(a,2)}catch(t){d.Logger.warning("GlContextFactory",`failed to create WebGLContext using contextId 'webgl2'. Error: ${t}`)}if((!h||h==="webgl")&&(a=p.getContext("webgl",o)||p.getContext("experimental-webgl",o),a))try{return new l.WebGLContext(a,1)}catch(t){d.Logger.warning("GlContextFactory",`failed to create WebGLContext using contextId 'webgl' or 'experimental-webgl'. Error: ${t}`)}throw new Error("WebGL is not supported")}r.createWebGLContext=function h(p){let a;p&&p!=="webgl2"||!("webgl2"in m)?p&&p!=="webgl"||!("webgl"in m)||(a=m.webgl):a=m.webgl2,a=a||s(p),p=p||a.version===1?"webgl":"webgl2";const o=a.gl;return m[p]=a,o.isContextLost()?(delete m[p],h(p)):(o.disable(o.DEPTH_TEST),o.disable(o.STENCIL_TEST),o.disable(o.BLEND),o.disable(o.DITHER),o.disable(o.POLYGON_OFFSET_FILL),o.disable(o.SAMPLE_COVERAGE),o.enable(o.SCISSOR_TEST),o.enable(o.CULL_FACE),o.cullFace(o.BACK),a)},r.createNewWebGLContext=s},1713:function(f,r,c){var d=this&&this.__createBinding||(Object.create?function(o,t,e,n){n===void 0&&(n=e);var i=Object.getOwnPropertyDescriptor(t,e);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[e]}}),Object.defineProperty(o,n,i)}:function(o,t,e,n){n===void 0&&(n=e),o[n]=t[e]}),l=this&&this.__setModuleDefault||(Object.create?function(o,t){Object.defineProperty(o,"default",{enumerable:!0,value:t})}:function(o,t){o.default=t}),m=this&&this.__importStar||function(o){if(o&&o.__esModule)return o;var t={};if(o!=null)for(var e in o)e!=="default"&&Object.prototype.hasOwnProperty.call(o,e)&&d(t,o,e);return l(t,o),t};Object.defineProperty(r,"__esModule",{value:!0}),r.WebGLContext=r.linearSearchLastTrue=void 0;const s=c(1670),h=m(c(7769)),p=c(9390);function a(o){let t=0;for(;tthis.isTimerResultAvailable(o)),this.getTimerResult(o)}async createAndWaitForFence(){const o=this.createFence(this.gl);return this.pollFence(o)}createFence(o){let t;const e=o,n=e.fenceSync(e.SYNC_GPU_COMMANDS_COMPLETE,0);return o.flush(),t=n===null?()=>!0:()=>{const i=e.clientWaitSync(n,0,0);return i===e.ALREADY_SIGNALED||i===e.CONDITION_SATISFIED},{query:n,isFencePassed:t}}async pollFence(o){return new Promise(t=>{this.addItemToPoll(()=>o.isFencePassed(),()=>t())})}pollItems(){const o=a(this.itemsToPoll.map(t=>t.isDoneFn));for(let t=0;t<=o;++t){const{resolveFn:e}=this.itemsToPoll[t];e()}this.itemsToPoll=this.itemsToPoll.slice(o+1)}async addItemToPoll(o,t){this.itemsToPoll.push({isDoneFn:o,resolveFn:t}),this.itemsToPoll.length>1||await(0,p.repeatedTry)(()=>(this.pollItems(),this.itemsToPoll.length===0))}}},1036:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ExecutionPlan=void 0;const d=c(6231);class l{constructor(s,h){this.op=s,this.node=h}}r.ExecutionPlan=class{constructor(m,s,h){this.graph=m,this.profiler=h,this.initialize(s)}initialize(m){this.profiler.event("session","ExecutionPlan.initialize",()=>{const s=this.graph.getNodes();if(s.length!==m.length)throw new Error("The size of nodes and OPs do not match.");this._ops=m.map((h,p)=>new l(h,s[p])),this.reset(),this._starter=[],this._ops.forEach((h,p)=>{let a=!0;for(const o of h.node.inputs)if(!this._values[o]&&this.graph.getInputIndices().indexOf(o)===-1){a=!1;break}a&&this._starter.push(p)})})}reset(){this._values=this.graph.getValues().map(m=>m.tensor)}async execute(m,s){return this.profiler.event("session","ExecutionPlan.execute",async()=>{this.reset();const h=m.createInferenceHandler(),p=this.graph.getInputIndices();if(s.length!==p.length)throw new Error(`number of input tensors don't match the number of inputs to the model: actual: ${s.length} expected: ${p.length}`);s.forEach((i,u)=>{const g=p[u];this._values[g]=i});const a=this._starter.slice(0),o=this.graph.getValues(),t=this.graph.getNodes();let e=0;for(;ethis._values[v]);if(g.indexOf(void 0)!==-1)throw new Error(`unresolved input detected: op: ${u.node}`);const b=g;d.Logger.verbose("ExecPlan",`Runing op:${u.node.name} (${b.map((v,w)=>`'${u.node.inputs[w]}': ${v.type}[${v.dims.join(",")}]`).join(", ")})`);const y=await this.profiler.event("node",u.node.name,async()=>u.op.impl(h,b,u.op.context));if(y.length!==u.node.outputs.length)throw new Error("the size of output does not match model definition.");y.forEach((v,w)=>{const T=u.node.outputs[w];if(this._values[T])throw new Error(`output [${T}] already has value: op:${u.node.name}`);this._values[T]=v});const _=new Set;y.forEach((v,w)=>{const T=u.node.outputs[w];for(const A of o[T].to){const E=t[A];let x=!0;for(const P of E.inputs)if(!this._values[P]){x=!1;break}x&&_.add(A)}}),a.push(..._)}const n=[];for(let i=0;i{Object.defineProperty(r,"__esModule",{value:!0}),r.Graph=void 0;const d=c(1446),l=c(7778),m=c(9395),s=c(9162),h=c(2517);var p=m.onnxruntime.experimental.fbs;r.Graph={from:(e,n)=>new t(e,n)};class a{constructor(n){this._from=void 0,this._to=[],this.tensor=void 0,this.type=void 0,n&&(this.type=h.ProtoUtil.tensorValueTypeFromProto(n.type.tensorType))}get from(){return this._from}get to(){return this._to}}class o{constructor(n,i){n instanceof d.onnx.NodeProto?(this.name=n.name,this.opType=n.opType,this.attributes=new l.Attribute(n.attribute)):n instanceof p.Node&&(this.name=i??n.name(),this.opType=n.opType(),this.attributes=new l.Attribute(h.ProtoUtil.tensorAttributesFromORTFormat(n))),this.inputs=[],this.outputs=[],this.executeNode=!0}}class t{constructor(n,i){if(!n)throw new TypeError("graph is empty");this.buildGraph(n),this.transformGraph(i),this.checkIsAcyclic()}getInputIndices(){return this._allInputIndices}getInputNames(){return this._allInputNames}getOutputIndices(){return this._allOutputIndices}getOutputNames(){return this._allOutputNames}getValues(){return this._allData}getNodes(){return this._nodes}buildGraph(n){if(n instanceof d.onnx.GraphProto)this.buildGraphFromOnnxFormat(n);else{if(!(n instanceof p.Graph))throw new TypeError("Graph type is not supported.");this.buildGraphFromOrtFormat(n)}}buildGraphFromOnnxFormat(n){const i=new Map;this._allData=[],this._allInputIndices=[],this._allInputNames=[],this._allOutputIndices=[],this._allOutputNames=[],this._nodes=[];const u=new Map;if(!n.input)throw new Error("missing information in graph: input");const g=[];for(const b of n.input){if(i.has(b.name))throw new Error(`duplicated input name: ${b.name}`);const y=this._allData.push(new a(b))-1;i.set(b.name,y),g.push(b.name)}if(!n.initializer)throw new Error("missing information in graph: initializer");for(const b of n.initializer){let y=i.get(b.name);if(y===void 0){const _=new a;_.type={shape:{dims:h.ProtoUtil.tensorDimsFromProto(b.dims)},tensorType:h.ProtoUtil.tensorDataTypeFromProto(b.dataType)},y=this._allData.push(_)-1,i.set(b.name,y)}this._allData[y]._from=-1,this._allData[y].tensor=s.Tensor.fromProto(b)}for(let b=0;b{this._allData[g]._to.forEach(b=>{n.add(b)})});const i=Array.from(n),u=new Array(this._nodes.length).fill("white");for(;i.length>0;){const g=i.pop();u[g]==="gray"?u[g]="black":(i.push(g),u[g]="gray",this._nodes[g].outputs.forEach(b=>{const y=this._allData[b];if(y.tensor!==void 0)throw new Error("node outputs should not be initialized");if(y._from!==g)throw new Error("from property of the Value object doesn't match index of Node being processed");y._to.forEach(_=>{if(u[_]==="gray")throw new Error("model graph is cyclic");u[_]==="white"&&i.push(_)})}))}}transformGraph(n){this.removeAllIdentityNodes(),this.removeAllDropoutNodes(),this.fuseConvActivationNodes(),n&&n.transformGraph(this),this.finalizeGraph()}finalizeGraph(){let n=0;for(let i=0;i0&&(this._nodes[i].inputs.forEach(u=>{const g=this._allData[u]._to.indexOf(i+n);g!==-1&&(this._allData[u]._to[g]=i)}),this._nodes[i].outputs.forEach(u=>{this._allData[u]._from&&this._allData[u]._from===i+n&&(this._allData[u]._from=i)})):(n++,this._nodes[i].outputs.forEach(u=>{this._allData[u]._from=-2}),this._nodes.splice(i,1),i--);n=0;for(let i=0;i0){let u=-1;this._allData[i].from!==void 0&&this._allData[i].from!==-1?(u=this._nodes[this._allData[i].from].outputs.indexOf(i+n),u!==-1&&(this._nodes[this._allData[i].from].outputs[u]=i)):(u=this._allInputIndices.indexOf(i+n),u!==-1&&(this._allInputIndices[u]=i)),this._allData[i].to.forEach(g=>{u=this._nodes[g].inputs.indexOf(i+n),u!==-1&&(this._nodes[g].inputs[u]=i)}),this._allData[i].to.length===0&&(u=this._allOutputIndices.indexOf(i+n),u!==-1&&(this._allOutputIndices[u]=i))}}else n++,this._allData.splice(i,1),i--}deleteNode(n){const i=this._nodes[n];if(i.outputs.length>1){for(let v=1;v0)throw new Error("Node deletion with more than one output connected to other nodes is not supported. ")}i.executeNode=!1;const u=i.inputs[0],g=i.outputs[0],b=this._allData[g].to,y=this._allData[u].to.indexOf(n);if(y===-1)throw new Error("The Value object doesn't have the current Node in it's 'to' property ");this._allData[u].to.splice(y,1),this._allData[g]._to=[];const _=this._allOutputIndices.indexOf(g);if(_!==-1&&(this._allOutputIndices[_]=u),b&&b.length>0)for(const v of b){const w=this._nodes[v].inputs.indexOf(g);if(w===-1)throw new Error("The Node object doesn't have the output Value in it's 'inputs' property ");this._nodes[v].inputs[w]=u,this._allData[u].to.push(v)}}removeAllDropoutNodes(){let n=0;for(const i of this._nodes){if(i.opType==="Dropout"){if(i.inputs.length!==1)throw new Error("Dropout nodes should only contain one input. ");if(i.outputs.length!==1&&i.outputs.length!==2)throw new Error("Dropout nodes should contain either 1 or 2 output(s)");if(i.outputs.length===2&&this._allData[i.outputs[1]]._to.length!==0)throw new Error("Dropout nodes's second output should not be referenced by other nodes");this.deleteNode(n)}n++}}removeAllIdentityNodes(){let n=0;for(const i of this._nodes)i.opType==="Identity"&&this.deleteNode(n),n++}isActivation(n){switch(n.opType){case"Relu":case"Sigmoid":case"Clip":return!0;default:return!1}}fuseConvActivationNodes(){for(const n of this._nodes)if(n.opType==="Conv"){const i=this._allData[n.outputs[0]]._to;if(i.length===1&&this.isActivation(this._nodes[i[0]])){const u=this._nodes[i[0]];if(u.opType==="Clip")if(u.inputs.length===1)try{n.attributes.set("activation_params","floats",[u.attributes.getFloat("min"),u.attributes.getFloat("max")])}catch{n.attributes.set("activation_params","floats",[h.MIN_CLIP,h.MAX_CLIP])}else{if(!(u.inputs.length>=3&&this._allData[u.inputs[1]].tensor!==void 0&&this._allData[u.inputs[2]].tensor!==void 0))continue;n.attributes.set("activation_params","floats",[this._allData[u.inputs[1]].tensor.floatData[0],this._allData[u.inputs[2]].tensor.floatData[0]])}n.attributes.set("activation","string",u.opType),this.deleteNode(i[0])}}}}},6231:(f,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.now=r.Profiler=r.Logger=void 0;const c={verbose:1e3,info:2e3,warning:4e3,error:5e3,fatal:6e3},d={none:new class{log(o,t,e){}},console:new class{log(o,t,e){console.log(`${this.color(o)} ${e?"\x1B[35m"+e+"\x1B[0m ":""}${t}`)}color(o){switch(o){case"verbose":return"\x1B[34;40mv\x1B[0m";case"info":return"\x1B[32mi\x1B[0m";case"warning":return"\x1B[30;43mw\x1B[0m";case"error":return"\x1B[31;40me\x1B[0m";case"fatal":return"\x1B[101mf\x1B[0m";default:throw new Error(`unsupported severity: ${o}`)}}}},l={provider:"console",minimalSeverity:"warning",logDateTime:!0,logSourceLocation:!1};let m={"":l};function s(o,t,e,n){if(t===void 0)return i=o,{verbose:s.verbose.bind(null,i),info:s.info.bind(null,i),warning:s.warning.bind(null,i),error:s.error.bind(null,i),fatal:s.fatal.bind(null,i)};if(e===void 0)h(o,t);else if(typeof e=="number"&&n===void 0)h(o,t);else if(typeof e=="string"&&n===void 0)h(o,e,0,t);else{if(typeof e!="string"||typeof n!="number")throw new TypeError("input is valid");h(o,e,0,t)}var i}function h(o,t,e,n){const i=m[n||""]||m[""];c[o]{g.then(async _=>{i&&await i.end(),b(_)},async _=>{i&&await i.end(),y(_)})});if(!u&&i){const b=i.end();if(b&&typeof b.then=="function")return new Promise((y,_)=>{b.then(()=>{y(g)},v=>{_(v)})})}return g}begin(o,t,e){if(!this._started)throw new Error("profiler is not started yet");if(e===void 0){const n=(0,r.now)();return this.flush(n),new p(o,t,n,i=>this.endSync(i))}{const n=e.beginTimer();return new p(o,t,0,async i=>this.end(i),n,e)}}async end(o){const t=await o.checkTimer();this._timingEvents.length=this._flushBatchSize||o-this._flushTime>=this._flushIntervalInMilliseconds){for(const t=this._flushPointer;this._flushPointerperformance.now():Date.now},2644:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Model=void 0;const d=c(5686),l=c(1446),m=c(7070),s=c(9395),h=c(2517);var p=s.onnxruntime.experimental.fbs;r.Model=class{constructor(){}load(a,o,t){if(!t)try{return void this.loadFromOnnxFormat(a,o)}catch(e){if(t!==void 0)throw e}this.loadFromOrtFormat(a,o)}loadFromOnnxFormat(a,o){const t=l.onnx.ModelProto.decode(a);if(h.LongUtil.longToNumber(t.irVersion)<3)throw new Error("only support ONNX model with IR_VERSION>=3");this._opsets=t.opsetImport.map(e=>({domain:e.domain,version:h.LongUtil.longToNumber(e.version)})),this._graph=m.Graph.from(t.graph,o)}loadFromOrtFormat(a,o){const t=new d.flatbuffers.ByteBuffer(a),e=p.InferenceSession.getRootAsInferenceSession(t).model();if(h.LongUtil.longToNumber(e.irVersion())<3)throw new Error("only support ONNX model with IR_VERSION>=3");this._opsets=[];for(let n=0;n{Object.defineProperty(r,"__esModule",{value:!0}),r.FLOAT_TYPES=r.INT_TYPES=r.NUMBER_TYPES=void 0,r.NUMBER_TYPES=["float32","float64","int32","int16","int8","uint16","uint32","uint8"],r.INT_TYPES=["int32","int16","int8","uint16","uint32","uint8"],r.FLOAT_TYPES=["float32","float64"]},1047:(f,r)=>{function c(d,l){if(l.endsWith("+")){const m=Number.parseInt(l.substring(0,l.length-1),10);return!isNaN(m)&&m<=d}if(l.split("-").length===2){const m=l.split("-"),s=Number.parseInt(m[0],10),h=Number.parseInt(m[1],10);return!isNaN(s)&&!isNaN(h)&&s<=d&&d<=h}return Number.parseInt(l,10)===d}Object.defineProperty(r,"__esModule",{value:!0}),r.resolveOperator=void 0,r.resolveOperator=function(d,l,m){for(const s of m){const h=s[0],p=s[1],a=s[2],o=s[3],t=s[4];if(d.opType===h){for(const e of l)if((e.domain===p||e.domain==="ai.onnx"&&p==="")&&c(e.version,a))return{opImpl:o,opInit:t}}}throw new TypeError(`cannot resolve operator '${d.opType}' with opsets: ${l.map(s=>`${s.domain||"ai.onnx"} v${s.version}`).join(", ")}`)}},9395:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.onnxruntime=void 0;const d=c(5686);var l,m;l=r.onnxruntime||(r.onnxruntime={}),function(s){(function(h){h[h.UNDEFINED=0]="UNDEFINED",h[h.FLOAT=1]="FLOAT",h[h.INT=2]="INT",h[h.STRING=3]="STRING",h[h.TENSOR=4]="TENSOR",h[h.GRAPH=5]="GRAPH",h[h.FLOATS=6]="FLOATS",h[h.INTS=7]="INTS",h[h.STRINGS=8]="STRINGS",h[h.TENSORS=9]="TENSORS",h[h.GRAPHS=10]="GRAPHS",h[h.SPARSE_TENSOR=11]="SPARSE_TENSOR",h[h.SPARSE_TENSORS=12]="SPARSE_TENSORS"})(s.AttributeType||(s.AttributeType={}))}((m=l.experimental||(l.experimental={})).fbs||(m.fbs={})),function(s){(function(h){(function(p){(function(a){a[a.UNKNOWN=0]="UNKNOWN",a[a.VALUE=1]="VALUE",a[a.PARAM=2]="PARAM"})(p.DimensionValueType||(p.DimensionValueType={}))})(h.fbs||(h.fbs={}))})(s.experimental||(s.experimental={}))}(r.onnxruntime||(r.onnxruntime={})),function(s){(function(h){(function(p){(function(a){a[a.UNDEFINED=0]="UNDEFINED",a[a.FLOAT=1]="FLOAT",a[a.UINT8=2]="UINT8",a[a.INT8=3]="INT8",a[a.UINT16=4]="UINT16",a[a.INT16=5]="INT16",a[a.INT32=6]="INT32",a[a.INT64=7]="INT64",a[a.STRING=8]="STRING",a[a.BOOL=9]="BOOL",a[a.FLOAT16=10]="FLOAT16",a[a.DOUBLE=11]="DOUBLE",a[a.UINT32=12]="UINT32",a[a.UINT64=13]="UINT64",a[a.COMPLEX64=14]="COMPLEX64",a[a.COMPLEX128=15]="COMPLEX128",a[a.BFLOAT16=16]="BFLOAT16"})(p.TensorDataType||(p.TensorDataType={}))})(h.fbs||(h.fbs={}))})(s.experimental||(s.experimental={}))}(r.onnxruntime||(r.onnxruntime={})),function(s){(function(h){(function(p){(function(a){a[a.Primitive=0]="Primitive",a[a.Fused=1]="Fused"})(p.NodeType||(p.NodeType={}))})(h.fbs||(h.fbs={}))})(s.experimental||(s.experimental={}))}(r.onnxruntime||(r.onnxruntime={})),function(s){(function(h){(function(p){(function(a){a[a.NONE=0]="NONE",a[a.tensor_type=1]="tensor_type",a[a.sequence_type=2]="sequence_type",a[a.map_type=3]="map_type"})(p.TypeInfoValue||(p.TypeInfoValue={}))})(h.fbs||(h.fbs={}))})(s.experimental||(s.experimental={}))}(r.onnxruntime||(r.onnxruntime={})),function(s){(function(h){(function(p){class a{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsShape(t,e){return(e||new a).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsShape(t,e){return t.setPosition(t.position()+d.flatbuffers.SIZE_PREFIX_LENGTH),(e||new a).__init(t.readInt32(t.position())+t.position(),t)}dim(t,e){let n=this.bb.__offset(this.bb_pos,4);return n?(e||new s.experimental.fbs.Dimension).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+4*t),this.bb):null}dimLength(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__vector_len(this.bb_pos+t):0}static startShape(t){t.startObject(1)}static addDim(t,e){t.addFieldOffset(0,e,0)}static createDimVector(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 startDimVector(t,e){t.startVector(4,e,4)}static endShape(t){return t.endObject()}static createShape(t,e){return a.startShape(t),a.addDim(t,e),a.endShape(t)}}p.Shape=a})(h.fbs||(h.fbs={}))})(s.experimental||(s.experimental={}))}(r.onnxruntime||(r.onnxruntime={})),function(s){(function(h){(function(p){class a{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsDimension(t,e){return(e||new a).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDimension(t,e){return t.setPosition(t.position()+d.flatbuffers.SIZE_PREFIX_LENGTH),(e||new a).__init(t.readInt32(t.position())+t.position(),t)}value(t){let e=this.bb.__offset(this.bb_pos,4);return e?(t||new s.experimental.fbs.DimensionValue).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}denotation(t){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__string(this.bb_pos+e,t):null}static startDimension(t){t.startObject(2)}static addValue(t,e){t.addFieldOffset(0,e,0)}static addDenotation(t,e){t.addFieldOffset(1,e,0)}static endDimension(t){return t.endObject()}static createDimension(t,e,n){return a.startDimension(t),a.addValue(t,e),a.addDenotation(t,n),a.endDimension(t)}}p.Dimension=a})(h.fbs||(h.fbs={}))})(s.experimental||(s.experimental={}))}(r.onnxruntime||(r.onnxruntime={})),function(s){(function(h){(function(p){class a{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsDimensionValue(t,e){return(e||new a).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsDimensionValue(t,e){return t.setPosition(t.position()+d.flatbuffers.SIZE_PREFIX_LENGTH),(e||new a).__init(t.readInt32(t.position())+t.position(),t)}dimType(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt8(this.bb_pos+t):s.experimental.fbs.DimensionValueType.UNKNOWN}dimValue(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt64(this.bb_pos+t):this.bb.createLong(0,0)}dimParam(t){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__string(this.bb_pos+e,t):null}static startDimensionValue(t){t.startObject(3)}static addDimType(t,e){t.addFieldInt8(0,e,s.experimental.fbs.DimensionValueType.UNKNOWN)}static addDimValue(t,e){t.addFieldInt64(1,e,t.createLong(0,0))}static addDimParam(t,e){t.addFieldOffset(2,e,0)}static endDimensionValue(t){return t.endObject()}static createDimensionValue(t,e,n,i){return a.startDimensionValue(t),a.addDimType(t,e),a.addDimValue(t,n),a.addDimParam(t,i),a.endDimensionValue(t)}}p.DimensionValue=a})(h.fbs||(h.fbs={}))})(s.experimental||(s.experimental={}))}(r.onnxruntime||(r.onnxruntime={})),function(s){(function(h){(function(p){class a{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsTensorTypeAndShape(t,e){return(e||new a).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsTensorTypeAndShape(t,e){return t.setPosition(t.position()+d.flatbuffers.SIZE_PREFIX_LENGTH),(e||new a).__init(t.readInt32(t.position())+t.position(),t)}elemType(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt32(this.bb_pos+t):s.experimental.fbs.TensorDataType.UNDEFINED}shape(t){let e=this.bb.__offset(this.bb_pos,6);return e?(t||new s.experimental.fbs.Shape).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}static startTensorTypeAndShape(t){t.startObject(2)}static addElemType(t,e){t.addFieldInt32(0,e,s.experimental.fbs.TensorDataType.UNDEFINED)}static addShape(t,e){t.addFieldOffset(1,e,0)}static endTensorTypeAndShape(t){return t.endObject()}static createTensorTypeAndShape(t,e,n){return a.startTensorTypeAndShape(t),a.addElemType(t,e),a.addShape(t,n),a.endTensorTypeAndShape(t)}}p.TensorTypeAndShape=a})(h.fbs||(h.fbs={}))})(s.experimental||(s.experimental={}))}(r.onnxruntime||(r.onnxruntime={})),function(s){(function(h){(function(p){class a{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsMapType(t,e){return(e||new a).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsMapType(t,e){return t.setPosition(t.position()+d.flatbuffers.SIZE_PREFIX_LENGTH),(e||new a).__init(t.readInt32(t.position())+t.position(),t)}keyType(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt32(this.bb_pos+t):s.experimental.fbs.TensorDataType.UNDEFINED}valueType(t){let e=this.bb.__offset(this.bb_pos,6);return e?(t||new s.experimental.fbs.TypeInfo).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}static startMapType(t){t.startObject(2)}static addKeyType(t,e){t.addFieldInt32(0,e,s.experimental.fbs.TensorDataType.UNDEFINED)}static addValueType(t,e){t.addFieldOffset(1,e,0)}static endMapType(t){return t.endObject()}static createMapType(t,e,n){return a.startMapType(t),a.addKeyType(t,e),a.addValueType(t,n),a.endMapType(t)}}p.MapType=a})(h.fbs||(h.fbs={}))})(s.experimental||(s.experimental={}))}(r.onnxruntime||(r.onnxruntime={})),function(s){(function(h){(function(p){class a{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsSequenceType(t,e){return(e||new a).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsSequenceType(t,e){return t.setPosition(t.position()+d.flatbuffers.SIZE_PREFIX_LENGTH),(e||new a).__init(t.readInt32(t.position())+t.position(),t)}elemType(t){let e=this.bb.__offset(this.bb_pos,4);return e?(t||new s.experimental.fbs.TypeInfo).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}static startSequenceType(t){t.startObject(1)}static addElemType(t,e){t.addFieldOffset(0,e,0)}static endSequenceType(t){return t.endObject()}static createSequenceType(t,e){return a.startSequenceType(t),a.addElemType(t,e),a.endSequenceType(t)}}p.SequenceType=a})(h.fbs||(h.fbs={}))})(s.experimental||(s.experimental={}))}(r.onnxruntime||(r.onnxruntime={})),function(s){(function(h){(h.fbs||(h.fbs={})).EdgeEnd=class{constructor(){this.bb=null,this.bb_pos=0}__init(p,a){return this.bb_pos=p,this.bb=a,this}nodeIndex(){return this.bb.readUint32(this.bb_pos)}srcArgIndex(){return this.bb.readInt32(this.bb_pos+4)}dstArgIndex(){return this.bb.readInt32(this.bb_pos+8)}static createEdgeEnd(p,a,o,t){return p.prep(4,12),p.writeInt32(t),p.writeInt32(o),p.writeInt32(a),p.offset()}}})(s.experimental||(s.experimental={}))}(r.onnxruntime||(r.onnxruntime={})),function(s){(function(h){(function(p){class a{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsNodeEdge(t,e){return(e||new a).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsNodeEdge(t,e){return t.setPosition(t.position()+d.flatbuffers.SIZE_PREFIX_LENGTH),(e||new a).__init(t.readInt32(t.position())+t.position(),t)}nodeIndex(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readUint32(this.bb_pos+t):0}inputEdges(t,e){let n=this.bb.__offset(this.bb_pos,6);return n?(e||new s.experimental.fbs.EdgeEnd).__init(this.bb.__vector(this.bb_pos+n)+12*t,this.bb):null}inputEdgesLength(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}outputEdges(t,e){let n=this.bb.__offset(this.bb_pos,8);return n?(e||new s.experimental.fbs.EdgeEnd).__init(this.bb.__vector(this.bb_pos+n)+12*t,this.bb):null}outputEdgesLength(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}static startNodeEdge(t){t.startObject(3)}static addNodeIndex(t,e){t.addFieldInt32(0,e,0)}static addInputEdges(t,e){t.addFieldOffset(1,e,0)}static startInputEdgesVector(t,e){t.startVector(12,e,4)}static addOutputEdges(t,e){t.addFieldOffset(2,e,0)}static startOutputEdgesVector(t,e){t.startVector(12,e,4)}static endNodeEdge(t){return t.endObject()}static createNodeEdge(t,e,n,i){return a.startNodeEdge(t),a.addNodeIndex(t,e),a.addInputEdges(t,n),a.addOutputEdges(t,i),a.endNodeEdge(t)}}p.NodeEdge=a})(h.fbs||(h.fbs={}))})(s.experimental||(s.experimental={}))}(r.onnxruntime||(r.onnxruntime={})),function(s){(function(h){(function(p){class a{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsNode(t,e){return(e||new a).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsNode(t,e){return t.setPosition(t.position()+d.flatbuffers.SIZE_PREFIX_LENGTH),(e||new a).__init(t.readInt32(t.position())+t.position(),t)}name(t){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}docString(t){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__string(this.bb_pos+e,t):null}domain(t){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__string(this.bb_pos+e,t):null}sinceVersion(){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readInt32(this.bb_pos+t):0}index(){let t=this.bb.__offset(this.bb_pos,12);return t?this.bb.readUint32(this.bb_pos+t):0}opType(t){let e=this.bb.__offset(this.bb_pos,14);return e?this.bb.__string(this.bb_pos+e,t):null}type(){let t=this.bb.__offset(this.bb_pos,16);return t?this.bb.readInt32(this.bb_pos+t):s.experimental.fbs.NodeType.Primitive}executionProviderType(t){let e=this.bb.__offset(this.bb_pos,18);return e?this.bb.__string(this.bb_pos+e,t):null}inputs(t,e){let n=this.bb.__offset(this.bb_pos,20);return n?this.bb.__string(this.bb.__vector(this.bb_pos+n)+4*t,e):null}inputsLength(){let t=this.bb.__offset(this.bb_pos,20);return t?this.bb.__vector_len(this.bb_pos+t):0}outputs(t,e){let n=this.bb.__offset(this.bb_pos,22);return n?this.bb.__string(this.bb.__vector(this.bb_pos+n)+4*t,e):null}outputsLength(){let t=this.bb.__offset(this.bb_pos,22);return t?this.bb.__vector_len(this.bb_pos+t):0}attributes(t,e){let n=this.bb.__offset(this.bb_pos,24);return n?(e||new s.experimental.fbs.Attribute).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+4*t),this.bb):null}attributesLength(){let t=this.bb.__offset(this.bb_pos,24);return t?this.bb.__vector_len(this.bb_pos+t):0}inputArgCounts(t){let e=this.bb.__offset(this.bb_pos,26);return e?this.bb.readInt32(this.bb.__vector(this.bb_pos+e)+4*t):0}inputArgCountsLength(){let t=this.bb.__offset(this.bb_pos,26);return t?this.bb.__vector_len(this.bb_pos+t):0}inputArgCountsArray(){let t=this.bb.__offset(this.bb_pos,26);return t?new Int32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}implicitInputs(t,e){let n=this.bb.__offset(this.bb_pos,28);return n?this.bb.__string(this.bb.__vector(this.bb_pos+n)+4*t,e):null}implicitInputsLength(){let t=this.bb.__offset(this.bb_pos,28);return t?this.bb.__vector_len(this.bb_pos+t):0}static startNode(t){t.startObject(13)}static addName(t,e){t.addFieldOffset(0,e,0)}static addDocString(t,e){t.addFieldOffset(1,e,0)}static addDomain(t,e){t.addFieldOffset(2,e,0)}static addSinceVersion(t,e){t.addFieldInt32(3,e,0)}static addIndex(t,e){t.addFieldInt32(4,e,0)}static addOpType(t,e){t.addFieldOffset(5,e,0)}static addType(t,e){t.addFieldInt32(6,e,s.experimental.fbs.NodeType.Primitive)}static addExecutionProviderType(t,e){t.addFieldOffset(7,e,0)}static addInputs(t,e){t.addFieldOffset(8,e,0)}static createInputsVector(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 startInputsVector(t,e){t.startVector(4,e,4)}static addOutputs(t,e){t.addFieldOffset(9,e,0)}static createOutputsVector(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 startOutputsVector(t,e){t.startVector(4,e,4)}static addAttributes(t,e){t.addFieldOffset(10,e,0)}static createAttributesVector(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 startAttributesVector(t,e){t.startVector(4,e,4)}static addInputArgCounts(t,e){t.addFieldOffset(11,e,0)}static createInputArgCountsVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addInt32(e[n]);return t.endVector()}static startInputArgCountsVector(t,e){t.startVector(4,e,4)}static addImplicitInputs(t,e){t.addFieldOffset(12,e,0)}static createImplicitInputsVector(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 startImplicitInputsVector(t,e){t.startVector(4,e,4)}static endNode(t){return t.endObject()}static createNode(t,e,n,i,u,g,b,y,_,v,w,T,A,E){return a.startNode(t),a.addName(t,e),a.addDocString(t,n),a.addDomain(t,i),a.addSinceVersion(t,u),a.addIndex(t,g),a.addOpType(t,b),a.addType(t,y),a.addExecutionProviderType(t,_),a.addInputs(t,v),a.addOutputs(t,w),a.addAttributes(t,T),a.addInputArgCounts(t,A),a.addImplicitInputs(t,E),a.endNode(t)}}p.Node=a})(h.fbs||(h.fbs={}))})(s.experimental||(s.experimental={}))}(r.onnxruntime||(r.onnxruntime={})),function(s){(function(h){(function(p){class a{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsValueInfo(t,e){return(e||new a).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsValueInfo(t,e){return t.setPosition(t.position()+d.flatbuffers.SIZE_PREFIX_LENGTH),(e||new a).__init(t.readInt32(t.position())+t.position(),t)}name(t){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}docString(t){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__string(this.bb_pos+e,t):null}type(t){let e=this.bb.__offset(this.bb_pos,8);return e?(t||new s.experimental.fbs.TypeInfo).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}static startValueInfo(t){t.startObject(3)}static addName(t,e){t.addFieldOffset(0,e,0)}static addDocString(t,e){t.addFieldOffset(1,e,0)}static addType(t,e){t.addFieldOffset(2,e,0)}static endValueInfo(t){return t.endObject()}static createValueInfo(t,e,n,i){return a.startValueInfo(t),a.addName(t,e),a.addDocString(t,n),a.addType(t,i),a.endValueInfo(t)}}p.ValueInfo=a})(h.fbs||(h.fbs={}))})(s.experimental||(s.experimental={}))}(r.onnxruntime||(r.onnxruntime={})),function(s){(function(h){(function(p){class a{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsTypeInfo(t,e){return(e||new a).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsTypeInfo(t,e){return t.setPosition(t.position()+d.flatbuffers.SIZE_PREFIX_LENGTH),(e||new a).__init(t.readInt32(t.position())+t.position(),t)}denotation(t){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}valueType(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readUint8(this.bb_pos+t):s.experimental.fbs.TypeInfoValue.NONE}value(t){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__union(t,this.bb_pos+e):null}static startTypeInfo(t){t.startObject(3)}static addDenotation(t,e){t.addFieldOffset(0,e,0)}static addValueType(t,e){t.addFieldInt8(1,e,s.experimental.fbs.TypeInfoValue.NONE)}static addValue(t,e){t.addFieldOffset(2,e,0)}static endTypeInfo(t){return t.endObject()}static createTypeInfo(t,e,n,i){return a.startTypeInfo(t),a.addDenotation(t,e),a.addValueType(t,n),a.addValue(t,i),a.endTypeInfo(t)}}p.TypeInfo=a})(h.fbs||(h.fbs={}))})(s.experimental||(s.experimental={}))}(r.onnxruntime||(r.onnxruntime={})),function(s){(function(h){(function(p){class a{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsOperatorSetId(t,e){return(e||new a).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsOperatorSetId(t,e){return t.setPosition(t.position()+d.flatbuffers.SIZE_PREFIX_LENGTH),(e||new a).__init(t.readInt32(t.position())+t.position(),t)}domain(t){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}version(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt64(this.bb_pos+t):this.bb.createLong(0,0)}static startOperatorSetId(t){t.startObject(2)}static addDomain(t,e){t.addFieldOffset(0,e,0)}static addVersion(t,e){t.addFieldInt64(1,e,t.createLong(0,0))}static endOperatorSetId(t){return t.endObject()}static createOperatorSetId(t,e,n){return a.startOperatorSetId(t),a.addDomain(t,e),a.addVersion(t,n),a.endOperatorSetId(t)}}p.OperatorSetId=a})(h.fbs||(h.fbs={}))})(s.experimental||(s.experimental={}))}(r.onnxruntime||(r.onnxruntime={})),function(s){(function(h){(function(p){class a{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsTensor(t,e){return(e||new a).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsTensor(t,e){return t.setPosition(t.position()+d.flatbuffers.SIZE_PREFIX_LENGTH),(e||new a).__init(t.readInt32(t.position())+t.position(),t)}name(t){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}docString(t){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__string(this.bb_pos+e,t):null}dims(t){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.readInt64(this.bb.__vector(this.bb_pos+e)+8*t):this.bb.createLong(0,0)}dimsLength(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}dataType(){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readInt32(this.bb_pos+t):s.experimental.fbs.TensorDataType.UNDEFINED}rawData(t){let e=this.bb.__offset(this.bb_pos,12);return e?this.bb.readUint8(this.bb.__vector(this.bb_pos+e)+t):0}rawDataLength(){let t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__vector_len(this.bb_pos+t):0}rawDataArray(){let t=this.bb.__offset(this.bb_pos,12);return t?new Uint8Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}stringData(t,e){let n=this.bb.__offset(this.bb_pos,14);return n?this.bb.__string(this.bb.__vector(this.bb_pos+n)+4*t,e):null}stringDataLength(){let t=this.bb.__offset(this.bb_pos,14);return t?this.bb.__vector_len(this.bb_pos+t):0}static startTensor(t){t.startObject(6)}static addName(t,e){t.addFieldOffset(0,e,0)}static addDocString(t,e){t.addFieldOffset(1,e,0)}static addDims(t,e){t.addFieldOffset(2,e,0)}static createDimsVector(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 startDimsVector(t,e){t.startVector(8,e,8)}static addDataType(t,e){t.addFieldInt32(3,e,s.experimental.fbs.TensorDataType.UNDEFINED)}static addRawData(t,e){t.addFieldOffset(4,e,0)}static createRawDataVector(t,e){t.startVector(1,e.length,1);for(let n=e.length-1;n>=0;n--)t.addInt8(e[n]);return t.endVector()}static startRawDataVector(t,e){t.startVector(1,e,1)}static addStringData(t,e){t.addFieldOffset(5,e,0)}static createStringDataVector(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 startStringDataVector(t,e){t.startVector(4,e,4)}static endTensor(t){return t.endObject()}static createTensor(t,e,n,i,u,g,b){return a.startTensor(t),a.addName(t,e),a.addDocString(t,n),a.addDims(t,i),a.addDataType(t,u),a.addRawData(t,g),a.addStringData(t,b),a.endTensor(t)}}p.Tensor=a})(h.fbs||(h.fbs={}))})(s.experimental||(s.experimental={}))}(r.onnxruntime||(r.onnxruntime={})),function(s){(function(h){(function(p){class a{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsSparseTensor(t,e){return(e||new a).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsSparseTensor(t,e){return t.setPosition(t.position()+d.flatbuffers.SIZE_PREFIX_LENGTH),(e||new a).__init(t.readInt32(t.position())+t.position(),t)}values(t){let e=this.bb.__offset(this.bb_pos,4);return e?(t||new s.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}indices(t){let e=this.bb.__offset(this.bb_pos,6);return e?(t||new s.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}dims(t){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.readInt64(this.bb.__vector(this.bb_pos+e)+8*t):this.bb.createLong(0,0)}dimsLength(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}static startSparseTensor(t){t.startObject(3)}static addValues(t,e){t.addFieldOffset(0,e,0)}static addIndices(t,e){t.addFieldOffset(1,e,0)}static addDims(t,e){t.addFieldOffset(2,e,0)}static createDimsVector(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 startDimsVector(t,e){t.startVector(8,e,8)}static endSparseTensor(t){return t.endObject()}static createSparseTensor(t,e,n,i){return a.startSparseTensor(t),a.addValues(t,e),a.addIndices(t,n),a.addDims(t,i),a.endSparseTensor(t)}}p.SparseTensor=a})(h.fbs||(h.fbs={}))})(s.experimental||(s.experimental={}))}(r.onnxruntime||(r.onnxruntime={})),function(s){(function(h){(function(p){class a{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsAttribute(t,e){return(e||new a).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsAttribute(t,e){return t.setPosition(t.position()+d.flatbuffers.SIZE_PREFIX_LENGTH),(e||new a).__init(t.readInt32(t.position())+t.position(),t)}name(t){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}docString(t){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__string(this.bb_pos+e,t):null}type(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.readInt32(this.bb_pos+t):s.experimental.fbs.AttributeType.UNDEFINED}f(){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readFloat32(this.bb_pos+t):0}i(){let t=this.bb.__offset(this.bb_pos,12);return t?this.bb.readInt64(this.bb_pos+t):this.bb.createLong(0,0)}s(t){let e=this.bb.__offset(this.bb_pos,14);return e?this.bb.__string(this.bb_pos+e,t):null}t(t){let e=this.bb.__offset(this.bb_pos,16);return e?(t||new s.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}g(t){let e=this.bb.__offset(this.bb_pos,18);return e?(t||new s.experimental.fbs.Graph).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}floats(t){let e=this.bb.__offset(this.bb_pos,20);return e?this.bb.readFloat32(this.bb.__vector(this.bb_pos+e)+4*t):0}floatsLength(){let t=this.bb.__offset(this.bb_pos,20);return t?this.bb.__vector_len(this.bb_pos+t):0}floatsArray(){let t=this.bb.__offset(this.bb_pos,20);return t?new Float32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}ints(t){let e=this.bb.__offset(this.bb_pos,22);return e?this.bb.readInt64(this.bb.__vector(this.bb_pos+e)+8*t):this.bb.createLong(0,0)}intsLength(){let t=this.bb.__offset(this.bb_pos,22);return t?this.bb.__vector_len(this.bb_pos+t):0}strings(t,e){let n=this.bb.__offset(this.bb_pos,24);return n?this.bb.__string(this.bb.__vector(this.bb_pos+n)+4*t,e):null}stringsLength(){let t=this.bb.__offset(this.bb_pos,24);return t?this.bb.__vector_len(this.bb_pos+t):0}tensors(t,e){let n=this.bb.__offset(this.bb_pos,26);return n?(e||new s.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+4*t),this.bb):null}tensorsLength(){let t=this.bb.__offset(this.bb_pos,26);return t?this.bb.__vector_len(this.bb_pos+t):0}graphs(t,e){let n=this.bb.__offset(this.bb_pos,28);return n?(e||new s.experimental.fbs.Graph).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+4*t),this.bb):null}graphsLength(){let t=this.bb.__offset(this.bb_pos,28);return t?this.bb.__vector_len(this.bb_pos+t):0}static startAttribute(t){t.startObject(13)}static addName(t,e){t.addFieldOffset(0,e,0)}static addDocString(t,e){t.addFieldOffset(1,e,0)}static addType(t,e){t.addFieldInt32(2,e,s.experimental.fbs.AttributeType.UNDEFINED)}static addF(t,e){t.addFieldFloat32(3,e,0)}static addI(t,e){t.addFieldInt64(4,e,t.createLong(0,0))}static addS(t,e){t.addFieldOffset(5,e,0)}static addT(t,e){t.addFieldOffset(6,e,0)}static addG(t,e){t.addFieldOffset(7,e,0)}static addFloats(t,e){t.addFieldOffset(8,e,0)}static createFloatsVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addFloat32(e[n]);return t.endVector()}static startFloatsVector(t,e){t.startVector(4,e,4)}static addInts(t,e){t.addFieldOffset(9,e,0)}static createIntsVector(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 startIntsVector(t,e){t.startVector(8,e,8)}static addStrings(t,e){t.addFieldOffset(10,e,0)}static createStringsVector(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 startStringsVector(t,e){t.startVector(4,e,4)}static addTensors(t,e){t.addFieldOffset(11,e,0)}static createTensorsVector(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 startTensorsVector(t,e){t.startVector(4,e,4)}static addGraphs(t,e){t.addFieldOffset(12,e,0)}static createGraphsVector(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 startGraphsVector(t,e){t.startVector(4,e,4)}static endAttribute(t){return t.endObject()}static createAttribute(t,e,n,i,u,g,b,y,_,v,w,T,A,E){return a.startAttribute(t),a.addName(t,e),a.addDocString(t,n),a.addType(t,i),a.addF(t,u),a.addI(t,g),a.addS(t,b),a.addT(t,y),a.addG(t,_),a.addFloats(t,v),a.addInts(t,w),a.addStrings(t,T),a.addTensors(t,A),a.addGraphs(t,E),a.endAttribute(t)}}p.Attribute=a})(h.fbs||(h.fbs={}))})(s.experimental||(s.experimental={}))}(r.onnxruntime||(r.onnxruntime={})),function(s){(function(h){(function(p){class a{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsGraph(t,e){return(e||new a).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsGraph(t,e){return t.setPosition(t.position()+d.flatbuffers.SIZE_PREFIX_LENGTH),(e||new a).__init(t.readInt32(t.position())+t.position(),t)}initializers(t,e){let n=this.bb.__offset(this.bb_pos,4);return n?(e||new s.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+4*t),this.bb):null}initializersLength(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__vector_len(this.bb_pos+t):0}nodeArgs(t,e){let n=this.bb.__offset(this.bb_pos,6);return n?(e||new s.experimental.fbs.ValueInfo).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+4*t),this.bb):null}nodeArgsLength(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}nodes(t,e){let n=this.bb.__offset(this.bb_pos,8);return n?(e||new s.experimental.fbs.Node).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+4*t),this.bb):null}nodesLength(){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}maxNodeIndex(){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readUint32(this.bb_pos+t):0}nodeEdges(t,e){let n=this.bb.__offset(this.bb_pos,12);return n?(e||new s.experimental.fbs.NodeEdge).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+4*t),this.bb):null}nodeEdgesLength(){let t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__vector_len(this.bb_pos+t):0}inputs(t,e){let n=this.bb.__offset(this.bb_pos,14);return n?this.bb.__string(this.bb.__vector(this.bb_pos+n)+4*t,e):null}inputsLength(){let t=this.bb.__offset(this.bb_pos,14);return t?this.bb.__vector_len(this.bb_pos+t):0}outputs(t,e){let n=this.bb.__offset(this.bb_pos,16);return n?this.bb.__string(this.bb.__vector(this.bb_pos+n)+4*t,e):null}outputsLength(){let t=this.bb.__offset(this.bb_pos,16);return t?this.bb.__vector_len(this.bb_pos+t):0}sparseInitializers(t,e){let n=this.bb.__offset(this.bb_pos,18);return n?(e||new s.experimental.fbs.SparseTensor).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+4*t),this.bb):null}sparseInitializersLength(){let t=this.bb.__offset(this.bb_pos,18);return t?this.bb.__vector_len(this.bb_pos+t):0}static startGraph(t){t.startObject(8)}static addInitializers(t,e){t.addFieldOffset(0,e,0)}static createInitializersVector(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 startInitializersVector(t,e){t.startVector(4,e,4)}static addNodeArgs(t,e){t.addFieldOffset(1,e,0)}static createNodeArgsVector(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 startNodeArgsVector(t,e){t.startVector(4,e,4)}static addNodes(t,e){t.addFieldOffset(2,e,0)}static createNodesVector(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 startNodesVector(t,e){t.startVector(4,e,4)}static addMaxNodeIndex(t,e){t.addFieldInt32(3,e,0)}static addNodeEdges(t,e){t.addFieldOffset(4,e,0)}static createNodeEdgesVector(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 startNodeEdgesVector(t,e){t.startVector(4,e,4)}static addInputs(t,e){t.addFieldOffset(5,e,0)}static createInputsVector(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 startInputsVector(t,e){t.startVector(4,e,4)}static addOutputs(t,e){t.addFieldOffset(6,e,0)}static createOutputsVector(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 startOutputsVector(t,e){t.startVector(4,e,4)}static addSparseInitializers(t,e){t.addFieldOffset(7,e,0)}static createSparseInitializersVector(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 startSparseInitializersVector(t,e){t.startVector(4,e,4)}static endGraph(t){return t.endObject()}static createGraph(t,e,n,i,u,g,b,y,_){return a.startGraph(t),a.addInitializers(t,e),a.addNodeArgs(t,n),a.addNodes(t,i),a.addMaxNodeIndex(t,u),a.addNodeEdges(t,g),a.addInputs(t,b),a.addOutputs(t,y),a.addSparseInitializers(t,_),a.endGraph(t)}}p.Graph=a})(h.fbs||(h.fbs={}))})(s.experimental||(s.experimental={}))}(r.onnxruntime||(r.onnxruntime={})),function(s){(function(h){(function(p){class a{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsModel(t,e){return(e||new a).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsModel(t,e){return t.setPosition(t.position()+d.flatbuffers.SIZE_PREFIX_LENGTH),(e||new a).__init(t.readInt32(t.position())+t.position(),t)}irVersion(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt64(this.bb_pos+t):this.bb.createLong(0,0)}opsetImport(t,e){let n=this.bb.__offset(this.bb_pos,6);return n?(e||new s.experimental.fbs.OperatorSetId).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+4*t),this.bb):null}opsetImportLength(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}producerName(t){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__string(this.bb_pos+e,t):null}producerVersion(t){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.__string(this.bb_pos+e,t):null}domain(t){let e=this.bb.__offset(this.bb_pos,12);return e?this.bb.__string(this.bb_pos+e,t):null}modelVersion(){let t=this.bb.__offset(this.bb_pos,14);return t?this.bb.readInt64(this.bb_pos+t):this.bb.createLong(0,0)}docString(t){let e=this.bb.__offset(this.bb_pos,16);return e?this.bb.__string(this.bb_pos+e,t):null}graph(t){let e=this.bb.__offset(this.bb_pos,18);return e?(t||new s.experimental.fbs.Graph).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}graphDocString(t){let e=this.bb.__offset(this.bb_pos,20);return e?this.bb.__string(this.bb_pos+e,t):null}static startModel(t){t.startObject(9)}static addIrVersion(t,e){t.addFieldInt64(0,e,t.createLong(0,0))}static addOpsetImport(t,e){t.addFieldOffset(1,e,0)}static createOpsetImportVector(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 startOpsetImportVector(t,e){t.startVector(4,e,4)}static addProducerName(t,e){t.addFieldOffset(2,e,0)}static addProducerVersion(t,e){t.addFieldOffset(3,e,0)}static addDomain(t,e){t.addFieldOffset(4,e,0)}static addModelVersion(t,e){t.addFieldInt64(5,e,t.createLong(0,0))}static addDocString(t,e){t.addFieldOffset(6,e,0)}static addGraph(t,e){t.addFieldOffset(7,e,0)}static addGraphDocString(t,e){t.addFieldOffset(8,e,0)}static endModel(t){return t.endObject()}static createModel(t,e,n,i,u,g,b,y,_,v){return a.startModel(t),a.addIrVersion(t,e),a.addOpsetImport(t,n),a.addProducerName(t,i),a.addProducerVersion(t,u),a.addDomain(t,g),a.addModelVersion(t,b),a.addDocString(t,y),a.addGraph(t,_),a.addGraphDocString(t,v),a.endModel(t)}}p.Model=a})(h.fbs||(h.fbs={}))})(s.experimental||(s.experimental={}))}(r.onnxruntime||(r.onnxruntime={})),function(s){(function(h){(function(p){class a{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsKernelCreateInfos(t,e){return(e||new a).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsKernelCreateInfos(t,e){return t.setPosition(t.position()+d.flatbuffers.SIZE_PREFIX_LENGTH),(e||new a).__init(t.readInt32(t.position())+t.position(),t)}nodeIndices(t){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readUint32(this.bb.__vector(this.bb_pos+e)+4*t):0}nodeIndicesLength(){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__vector_len(this.bb_pos+t):0}nodeIndicesArray(){let t=this.bb.__offset(this.bb_pos,4);return t?new Uint32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}kernelDefHashes(t){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readUint64(this.bb.__vector(this.bb_pos+e)+8*t):this.bb.createLong(0,0)}kernelDefHashesLength(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}static startKernelCreateInfos(t){t.startObject(2)}static addNodeIndices(t,e){t.addFieldOffset(0,e,0)}static createNodeIndicesVector(t,e){t.startVector(4,e.length,4);for(let n=e.length-1;n>=0;n--)t.addInt32(e[n]);return t.endVector()}static startNodeIndicesVector(t,e){t.startVector(4,e,4)}static addKernelDefHashes(t,e){t.addFieldOffset(1,e,0)}static createKernelDefHashesVector(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 startKernelDefHashesVector(t,e){t.startVector(8,e,8)}static endKernelCreateInfos(t){return t.endObject()}static createKernelCreateInfos(t,e,n){return a.startKernelCreateInfos(t),a.addNodeIndices(t,e),a.addKernelDefHashes(t,n),a.endKernelCreateInfos(t)}}p.KernelCreateInfos=a})(h.fbs||(h.fbs={}))})(s.experimental||(s.experimental={}))}(r.onnxruntime||(r.onnxruntime={})),function(s){(function(h){(function(p){class a{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsSubGraphSessionState(t,e){return(e||new a).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsSubGraphSessionState(t,e){return t.setPosition(t.position()+d.flatbuffers.SIZE_PREFIX_LENGTH),(e||new a).__init(t.readInt32(t.position())+t.position(),t)}graphId(t){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}sessionState(t){let e=this.bb.__offset(this.bb_pos,6);return e?(t||new s.experimental.fbs.SessionState).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}static startSubGraphSessionState(t){t.startObject(2)}static addGraphId(t,e){t.addFieldOffset(0,e,0)}static addSessionState(t,e){t.addFieldOffset(1,e,0)}static endSubGraphSessionState(t){let e=t.endObject();return t.requiredField(e,4),e}static createSubGraphSessionState(t,e,n){return a.startSubGraphSessionState(t),a.addGraphId(t,e),a.addSessionState(t,n),a.endSubGraphSessionState(t)}}p.SubGraphSessionState=a})(h.fbs||(h.fbs={}))})(s.experimental||(s.experimental={}))}(r.onnxruntime||(r.onnxruntime={})),function(s){(function(h){(function(p){class a{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsSessionState(t,e){return(e||new a).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsSessionState(t,e){return t.setPosition(t.position()+d.flatbuffers.SIZE_PREFIX_LENGTH),(e||new a).__init(t.readInt32(t.position())+t.position(),t)}kernels(t){let e=this.bb.__offset(this.bb_pos,4);return e?(t||new s.experimental.fbs.KernelCreateInfos).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}subGraphSessionStates(t,e){let n=this.bb.__offset(this.bb_pos,6);return n?(e||new s.experimental.fbs.SubGraphSessionState).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+4*t),this.bb):null}subGraphSessionStatesLength(){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}static startSessionState(t){t.startObject(2)}static addKernels(t,e){t.addFieldOffset(0,e,0)}static addSubGraphSessionStates(t,e){t.addFieldOffset(1,e,0)}static createSubGraphSessionStatesVector(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 startSubGraphSessionStatesVector(t,e){t.startVector(4,e,4)}static endSessionState(t){return t.endObject()}static createSessionState(t,e,n){return a.startSessionState(t),a.addKernels(t,e),a.addSubGraphSessionStates(t,n),a.endSessionState(t)}}p.SessionState=a})(h.fbs||(h.fbs={}))})(s.experimental||(s.experimental={}))}(r.onnxruntime||(r.onnxruntime={})),function(s){(function(h){(function(p){class a{constructor(){this.bb=null,this.bb_pos=0}__init(t,e){return this.bb_pos=t,this.bb=e,this}static getRootAsInferenceSession(t,e){return(e||new a).__init(t.readInt32(t.position())+t.position(),t)}static getSizePrefixedRootAsInferenceSession(t,e){return t.setPosition(t.position()+d.flatbuffers.SIZE_PREFIX_LENGTH),(e||new a).__init(t.readInt32(t.position())+t.position(),t)}static bufferHasIdentifier(t){return t.__has_identifier("ORTM")}ortVersion(t){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}model(t){let e=this.bb.__offset(this.bb_pos,6);return e?(t||new s.experimental.fbs.Model).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}sessionState(t){let e=this.bb.__offset(this.bb_pos,8);return e?(t||new s.experimental.fbs.SessionState).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}static startInferenceSession(t){t.startObject(3)}static addOrtVersion(t,e){t.addFieldOffset(0,e,0)}static addModel(t,e){t.addFieldOffset(1,e,0)}static addSessionState(t,e){t.addFieldOffset(2,e,0)}static endInferenceSession(t){return t.endObject()}static finishInferenceSessionBuffer(t,e){t.finish(e,"ORTM")}static finishSizePrefixedInferenceSessionBuffer(t,e){t.finish(e,"ORTM",!0)}static createInferenceSession(t,e,n,i){return a.startInferenceSession(t),a.addOrtVersion(t,e),a.addModel(t,n),a.addSessionState(t,i),a.endInferenceSession(t)}}p.InferenceSession=a})(h.fbs||(h.fbs={}))})(s.experimental||(s.experimental={}))}(r.onnxruntime||(r.onnxruntime={}))},7448:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.OnnxjsSessionHandler=void 0;const d=c(1670),l=c(9162);r.OnnxjsSessionHandler=class{constructor(m){this.session=m,this.inputNames=this.session.inputNames,this.outputNames=this.session.outputNames}async dispose(){}async run(m,s,h){const p=new Map;for(const t in m)if(Object.hasOwnProperty.call(m,t)){const e=m[t];p.set(t,new l.Tensor(e.dims,e.type,void 0,void 0,e.data))}const a=await this.session.run(p),o={};return a.forEach((t,e)=>{o[e]=new d.Tensor(t.type,t.data,t.dims)}),o}startProfiling(){this.session.startProfiling()}endProfiling(){this.session.endProfiling()}}},6919:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Session=void 0;const d=c(7067),l=c(1296),m=c(7091),s=c(1036),h=c(6231),p=c(2644);r.Session=class{constructor(a={}){this._initialized=!1,this.backendHint=a.backendHint,this.profiler=h.Profiler.create(a.profiler),this.context={profiler:this.profiler,graphInputTypes:[],graphInputDims:[]}}get inputNames(){return this._model.graph.getInputNames()}get outputNames(){return this._model.graph.getOutputNames()}startProfiling(){this.profiler.start()}endProfiling(){this.profiler.stop()}async loadModel(a,o,t){await this.profiler.event("session","Session.loadModel",async()=>{const e=await(0,m.resolveBackend)(this.backendHint);if(this.sessionHandler=e.createSessionHandler(this.context),this._model=new p.Model,typeof a=="string"){const n=a.endsWith(".ort");if(typeof fetch>"u"){const i=await(0,l.promisify)(d.readFile)(a);this.initialize(i,n)}else{const i=await fetch(a),u=await i.arrayBuffer();this.initialize(new Uint8Array(u),n)}}else if(ArrayBuffer.isView(a))this.initialize(a);else{const n=new Uint8Array(a,o||0,t||a.byteLength);this.initialize(n)}})}initialize(a,o){if(this._initialized)throw new Error("already initialized");this.profiler.event("session","Session.initialize",()=>{const t=this.sessionHandler.transformGraph?this.sessionHandler:void 0;this._model.load(a,t,o),this.sessionHandler.onGraphInitialized&&this.sessionHandler.onGraphInitialized(this._model.graph),this.initializeOps(this._model.graph),this._executionPlan=new s.ExecutionPlan(this._model.graph,this._ops,this.profiler)}),this._initialized=!0}async run(a){if(!this._initialized)throw new Error("session not initialized yet");return this.profiler.event("session","Session.run",async()=>{const o=this.normalizeAndValidateInputs(a),t=await this._executionPlan.execute(this.sessionHandler,o);return this.createOutput(t)})}normalizeAndValidateInputs(a){const o=this._model.graph.getInputNames();if(Array.isArray(a)){if(a.length!==o.length)throw new Error(`incorrect input array length: expected ${o.length} but got ${a.length}`)}else{if(a.size!==o.length)throw new Error(`incorrect input map size: expected ${o.length} but got ${a.size}`);const t=new Array(a.size);let e=0;for(let n=0;ntypeof E=="string")))throw new TypeError("cache should be a string array");A&&(this.cache=new Array(T))}else{if(v!==void 0){const E=e(b);if(!(v instanceof E))throw new TypeError(`cache should be type ${E.name}`)}if(A){const E=new ArrayBuffer(T*function(x){switch(x){case"bool":case"int8":case"uint8":return 1;case"int16":case"uint16":return 2;case"int32":case"uint32":case"float32":return 4;case"float64":return 8;default:throw new Error(`cannot calculate sizeof() on type ${x}`)}}(b));this.cache=function(x,P){return new(e(P))(x)}(E,b)}}}static fromProto(g){if(!g)throw new Error("cannot construct Value from an empty tensor");const b=p.ProtoUtil.tensorDataTypeFromProto(g.dataType),y=p.ProtoUtil.tensorDimsFromProto(g.dims),_=new o(y,b);if(b==="string")g.stringData.forEach((v,w)=>{_.data[w]=(0,p.decodeUtf8String)(v)});else if(g.rawData&&typeof g.rawData.byteLength=="number"&&g.rawData.byteLength>0){const v=_.data,w=new DataView(g.rawData.buffer,g.rawData.byteOffset,g.rawData.byteLength),T=t(g.dataType),A=g.rawData.byteLength/T;if(g.rawData.byteLength%T!=0)throw new Error("invalid buffer length");if(v.length!==A)throw new Error("buffer length mismatch");for(let E=0;E0){const v=_.data,w=new DataView(g.rawDataArray().buffer,g.rawDataArray().byteOffset,g.rawDataLength()),T=t(g.dataType()),A=g.rawDataLength()/T;if(g.rawDataLength()%T!=0)throw new Error("invalid buffer length");if(v.length!==A)throw new Error("buffer length mismatch");for(let E=0;E1&&P>1)return;A[T-E]=Math.max(x,P)}return A}static index(b,y){const _=new Array(y.length);return a.fillIndex(b,y,_),_}static fillIndex(b,y,_){const v=b.length-y.length;for(let w=0;w=0;J--)x[J]=k%T[J],k=Math.floor(k/T[J]);q||(a.fillIndex(x,b.dims,P),$=b.get(P)),D||(a.fillIndex(x,y.dims,C),F=y.get(C)),E.set(x,_($,F))}}return E}}static isValidBroadcast(b,y){const _=b.length,v=y.length;if(_>v)return!1;for(let w=1;w<=_;w++)if(b[_-w]!==1&&b[_-w]!==y[v-w])return!1;return!0}static getBroadcastDims(b,y){const _=b.length,v=[];for(let w=0;w<_;w++){const T=_-1-w,A=b[T]||1;(y[y.length-1-w]||1)>1&&A===1&&v.unshift(T)}return v}}r.BroadcastUtil=a,r.arrayCopyHelper=function(g,b,y,_,v){if(_<0||_>=b.length)throw new Error("sourceIndex out of bounds");if(y<0||y>=g.length)throw new Error("targetIndex out of bounds");if(_+v>b.length)throw new Error("source indices to be copied are outside bounds");if(y+v>g.length)throw new Error("target array is too small to hold result");for(let w=0;wm.default.isLong(y)?y.toNumber():y)}static tensorValueTypeFromProto(b){return{tensorType:o.tensorDataTypeFromProto(b.elemType),shape:{dims:o.tensorDimsFromProto(b.shape.dim.map(y=>y.dimValue))}}}static tensorDimsFromORTFormat(b){const y=[];for(let _=0;_b.length)throw new Error(`invalid dimension of ${y} for sizeFromDimension as Tensor has ${b.length} dimensions.`);return e.getSizeFromDimensionRange(b,y,b.length)}static sizeToDimension(b,y){if(y<0||y>b.length)throw new Error(`invalid dimension of ${y} for sizeToDimension as Tensor has ${b.length} dimensions.`);return e.getSizeFromDimensionRange(b,0,y)}static getSizeFromDimensionRange(b,y,_){let v=1;for(let w=y;w<_;w++){if(b[w]<=0)throw new Error("cannot get valid size from specified dimension range. Most likely the range contains 0 or negative values in them.");v*=b[w]}return v}static computeStrides(b){const y=b.length;if(y===0)return[];if(y===1)return[1];const _=new Array(y);_[y-1]=1,_[y-2]=b[y-1];for(let v=y-3;v>=0;--v)_[v]=_[v+1]*b[v+1];return _}static transpose(b){return b.slice().reverse()}static indicesToOffset(b,y,_){_===void 0&&(_=b.length);let v=0;for(let w=0;w<_;++w)v+=y[w]*b[w];return v}static offsetToIndices(b,y){const _=y.length;if(_===0)return[];if(_===1)return[b*y[0]];const v=new Array(y.length);for(let w=0;w=y)throw new Error("unsupported axis for this operation.");return b<0?b+y:b}static normalizeAxes(b,y){return b.map(_=>this.normalizeAxis(_,y))}static incrementIndex(b,y,_){if(y.length===0||b.length===0)throw new Error("Index incrementing unsupported for scalar Tensor");if(_===void 0)_=y.length;else if(_<=0||_>y.length)throw new Error("Incorrect axis to increment on");for(let v=_-1;v>=0&&(b[v]++,!(b[v]=b.length)throw new Error("the dimension with value zero exceeds the dimension size of the input tensor");v[E]=b[E]}else v[E]=y[E];T*=v[E]}}const A=e.size(b);if(w!==-1){if(A%T!=0)throw new Error(`the input tensor cannot be reshaped to the requested shape. Input shape: [${b}] Output shape: [${y}]`);v[w]=A/T}else if(T!==A)throw new Error("reshapedDims and originalDims don't have matching sizes");return v}static sortBasedOnPerm(b,y){return y?y.map(_=>b[_]):b.slice().reverse()}static padShape(b,y){const _=b.length;return b.map((v,w)=>v+y[w]+y[w+_])}static areEqual(b,y){return b.length===y.length&&b.every((_,v)=>_===y[v])}static validateDimsAndCalcSize(b){if(b.length>6)throw new TypeError("Only rank 0 to 6 is supported for tensor shape.");let y=1;for(const _ of b){if(!Number.isInteger(_))throw new TypeError(`Invalid shape: ${_} is not an integer`);if(_<0||_>2147483647)throw new TypeError(`Invalid shape: length ${_} is not allowed`);y*=_}return y}static flattenShape(b,y){y<0&&(y+=b.length);const _=b.reduce((w,T)=>w*T,1),v=b.slice(y).reduce((w,T)=>w*T,1);return[_/v,v]}static squeezeShape(b,y){const _=new Array;y=e.normalizeAxes(y,b.length);for(let v=0;v=0;if(w&&b[v]!==1)throw new Error("squeeze an axis of size different than 1");(y.length===0&&b[v]>1||y.length>0&&!w)&&_.push(b[v])}return _}static unsqueezeShape(b,y){const _=new Array(b.length+y.length);_.fill(0);for(let w=0;w=_.length)throw new Error("'axes' has an out of range axis");if(_[T]!==0)throw new Error("'axes' has a duplicate axis");_[T]=1}let v=0;for(let w=0;w<_.length;w++)_[w]===0&&(_[w]=b[v++]);if(v!==b.length)throw new Error("the unsqueezed dimension could not be established");return _}}r.ShapeUtil=e,r.MathUtil=class{static sqr(g,b,y,_,v){if(_<0||_>=b.length)throw new Error("sourceIndex out of bounds");if(y<0||y>=g.length)throw new Error("targetIndex out of bounds");if(_+v>b.length)throw new Error("source indices to be copied are outside bounds");if(y+v>g.length)throw new Error("target array is too small to hold result");for(let w=0;w=b.length)throw new Error("sourceIndex out of bounds");if(y<0||y>=g.length)throw new Error("targetIndex out of bounds");if(_+v>b.length)throw new Error("source indices to be copied are outside bounds");if(y+v>g.length)throw new Error("target array is too small to hold result");for(let T=0;T=b.length)throw new Error("sourceIndex out of bounds");if(y<0||y>=g.length)throw new Error("targetIndex out of bounds");if(_+v>b.length)throw new Error("source indices to be copied are outside bounds");if(y+v>g.length)throw new Error("target array is too small to hold result");for(let T=0;T=b.length)throw new Error("sourceIndex out of bounds");if(y<0||y>=g.length)throw new Error("targetIndex out of bounds");if(_+v>b.length)throw new Error("source indices to be copied are outside bounds");if(y+v>g.length)throw new Error("target array is too small to hold result");for(let w=0;wy.push(F));const A=i.calcReduceShape(T,y,!0),E=e.size(A),x=new h.Tensor(A,b.type),P=e.computeStrides(A),C=e.computeStrides(T),k=new Array(T.length);for(let $=0;$=y.length)return T(b[w]);const x=y[v],P=x>=_.length?1:e.size(_.slice(x+1));for(let C=0;C<_[x];C++)E=C===0?i.calcReduceByAxis(b,y,_,v+1,w,T,A):A(E,i.calcReduceByAxis(b,y,_,v+1,w,T,A)),w+=P;return E}static calcReduceShape(b,y,_){const v=b.slice();for(let w=0;ww!==0)}}r.ReduceUtil=i;class u{static adjustPoolAttributes(b,y,_,v,w,T){if(!b&&_.length!==y.length-2)throw new Error("length of specified kernel shapes should be 2 less than length of input dimensions");if(b)for(let A=0;A=_.length?_.push(y[A+2]):_[A]=y[A+2];for(let A=0;A<_.length;A++)if(A=_[A]||T[A+_.length]>=_[A])throw new Error("pads should be smaller than kernel")}}static adjustPadsBasedOnAutoPad(b,y,_,v,w,T){if(T){if(w.length!==2*(b.length-2))throw new Error("length of pads should be twice the length of data dimensions");if(y.length!==b.length-2)throw new Error("length of strides should be the length of data dimensions");if(v.length!==b.length-2)throw new Error("length of kernel shapes should be the length of data dimensions");for(let A=0;A{Object.defineProperty(r,"__esModule",{value:!0}),r.iterateExtraOptions=void 0,r.iterateExtraOptions=(c,d,l,m)=>{if(typeof c=="object"&&c!==null){if(l.has(c))throw new Error("Circular reference in options");l.add(c)}Object.entries(c).forEach(([s,h])=>{const p=d?d+s:s;if(typeof h=="object")(0,r.iterateExtraOptions)(h,p+".",l,m);else if(typeof h=="string"||typeof h=="number")m(p,h.toString());else{if(typeof h!="boolean")throw new Error("Can't handle extra config type: "+typeof h);m(p,h?"1":"0")}})}},2157:function(f,r,c){var d,l=this&&this.__createBinding||(Object.create?function(P,C,k,$){$===void 0&&($=k);var F=Object.getOwnPropertyDescriptor(C,k);F&&!("get"in F?!C.__esModule:F.writable||F.configurable)||(F={enumerable:!0,get:function(){return C[k]}}),Object.defineProperty(P,$,F)}:function(P,C,k,$){$===void 0&&($=k),P[$]=C[k]}),m=this&&this.__setModuleDefault||(Object.create?function(P,C){Object.defineProperty(P,"default",{enumerable:!0,value:C})}:function(P,C){P.default=C}),s=this&&this.__importStar||function(P){if(P&&P.__esModule)return P;var C={};if(P!=null)for(var k in P)k!=="default"&&Object.prototype.hasOwnProperty.call(P,k)&&l(C,P,k);return m(C,P),C};Object.defineProperty(r,"__esModule",{value:!0}),r.endProfiling=r.run=r.releaseSession=r.createSession=r.createSessionFinalize=r.createSessionAllocate=r.initOrt=r.initWasm=void 0;const h=c(1670),p=s(c(349)),a=c(6361),o=()=>!!h.env.wasm.proxy&&typeof document<"u";let t,e,n,i=!1,u=!1,g=!1;const b=[],y=[],_=[],v=[],w=[],T=[],A=()=>{if(i||!u||g||!t)throw new Error("worker not ready")},E=P=>{switch(P.data.type){case"init-wasm":i=!1,P.data.err?(g=!0,e[1](P.data.err)):(u=!0,e[0]());break;case"init-ort":P.data.err?n[1](P.data.err):n[0]();break;case"create_allocate":P.data.err?b.shift()[1](P.data.err):b.shift()[0](P.data.out);break;case"create_finalize":P.data.err?y.shift()[1](P.data.err):y.shift()[0](P.data.out);break;case"create":P.data.err?_.shift()[1](P.data.err):_.shift()[0](P.data.out);break;case"release":P.data.err?v.shift()[1](P.data.err):v.shift()[0]();break;case"run":P.data.err?w.shift()[1](P.data.err):w.shift()[0](P.data.out);break;case"end-profiling":P.data.err?T.shift()[1](P.data.err):T.shift()[0]()}},x=typeof document<"u"?(d=document==null?void 0:document.currentScript)===null||d===void 0?void 0:d.src:void 0;r.initWasm=async()=>{if(o()){if(u)return;if(i)throw new Error("multiple calls to 'initWasm()' detected.");if(g)throw new Error("previous call to 'initWasm()' failed.");return i=!0,h.env.wasm.wasmPaths===void 0&&x&&x.indexOf("blob:")!==0&&(h.env.wasm.wasmPaths=x.substr(0,+x.lastIndexOf("/")+1)),new Promise((P,C)=>{t==null||t.terminate(),t=c(9710).Z(),t.onmessage=E,e=[P,C];const k={type:"init-wasm",in:h.env.wasm};t.postMessage(k)})}return(0,a.initializeWebAssembly)(h.env.wasm)},r.initOrt=async(P,C)=>{if(o())return A(),new Promise((k,$)=>{n=[k,$];const F={type:"init-ort",in:{numThreads:P,loggingLevel:C}};t.postMessage(F)});p.initOrt(P,C)},r.createSessionAllocate=async P=>o()?(A(),new Promise((C,k)=>{b.push([C,k]);const $={type:"create_allocate",in:{model:P}};t.postMessage($,[P.buffer])})):p.createSessionAllocate(P),r.createSessionFinalize=async(P,C)=>o()?(A(),new Promise((k,$)=>{y.push([k,$]);const F={type:"create_finalize",in:{modeldata:P,options:C}};t.postMessage(F)})):p.createSessionFinalize(P,C),r.createSession=async(P,C)=>o()?(A(),new Promise((k,$)=>{_.push([k,$]);const F={type:"create",in:{model:P,options:C}};t.postMessage(F,[P.buffer])})):p.createSession(P,C),r.releaseSession=async P=>{if(o())return A(),new Promise((C,k)=>{v.push([C,k]);const $={type:"release",in:P};t.postMessage($)});p.releaseSession(P)},r.run=async(P,C,k,$,F)=>o()?(A(),new Promise((q,D)=>{w.push([q,D]);const U={type:"run",in:{sessionId:P,inputIndices:C,inputs:k,outputIndices:$,options:F}};t.postMessage(U,p.extractTransferableBuffers(k))})):p.run(P,C,k,$,F),r.endProfiling=async P=>{if(o())return A(),new Promise((C,k)=>{T.push([C,k]);const $={type:"end-profiling",in:P};t.postMessage($)});p.endProfiling(P)}},586:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.setRunOptions=void 0;const d=c(7967),l=c(4983),m=c(6361);r.setRunOptions=s=>{const h=(0,m.getInstance)();let p=0;const a=[],o=s||{};try{if((s==null?void 0:s.logSeverityLevel)===void 0)o.logSeverityLevel=2;else if(typeof s.logSeverityLevel!="number"||!Number.isInteger(s.logSeverityLevel)||s.logSeverityLevel<0||s.logSeverityLevel>4)throw new Error(`log serverity level is not valid: ${s.logSeverityLevel}`);if((s==null?void 0:s.logVerbosityLevel)===void 0)o.logVerbosityLevel=0;else if(typeof s.logVerbosityLevel!="number"||!Number.isInteger(s.logVerbosityLevel))throw new Error(`log verbosity level is not valid: ${s.logVerbosityLevel}`);(s==null?void 0:s.terminate)===void 0&&(o.terminate=!1);let t=0;if((s==null?void 0:s.tag)!==void 0&&(t=(0,l.allocWasmString)(s.tag,a)),p=h._OrtCreateRunOptions(o.logSeverityLevel,o.logVerbosityLevel,!!o.terminate,t),p===0)throw new Error("Can't create run options");return(s==null?void 0:s.extra)!==void 0&&(0,d.iterateExtraOptions)(s.extra,"",new WeakSet,(e,n)=>{const i=(0,l.allocWasmString)(e,a),u=(0,l.allocWasmString)(n,a);if(h._OrtAddRunConfigEntry(p,i,u)!==0)throw new Error(`Can't set a run config entry: ${e} - ${n}`)}),[p,a]}catch(t){throw p!==0&&h._OrtReleaseRunOptions(p),a.forEach(h._free),t}}},2306:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.OnnxruntimeWebAssemblySessionHandler=void 0;const d=c(2806),l=c(1670),m=c(2850),s=c(2157);let h;r.OnnxruntimeWebAssemblySessionHandler=class{async createSessionAllocate(p){const a=await fetch(p),o=await a.arrayBuffer();return(0,s.createSessionAllocate)(new Uint8Array(o))}async loadModel(p,a){if(h||(await(0,s.initOrt)(l.env.wasm.numThreads,(o=>{switch(o){case"verbose":return 0;case"info":return 1;case"warning":return 2;case"error":return 3;case"fatal":return 4;default:throw new Error(`unsupported logging level: ${o}`)}})(l.env.logLevel)),h=!0),typeof p=="string")if(typeof fetch>"u"){const o=await(0,m.promisify)(d.readFile)(p);[this.sessionId,this.inputNames,this.outputNames]=await(0,s.createSession)(o,a)}else{const o=await this.createSessionAllocate(p);[this.sessionId,this.inputNames,this.outputNames]=await(0,s.createSessionFinalize)(o,a)}else[this.sessionId,this.inputNames,this.outputNames]=await(0,s.createSession)(p,a)}async dispose(){return(0,s.releaseSession)(this.sessionId)}async run(p,a,o){const t=[],e=[];Object.entries(p).forEach(g=>{const b=g[0],y=g[1],_=this.inputNames.indexOf(b);if(_===-1)throw new Error(`invalid input '${b}'`);t.push(y),e.push(_)});const n=[];Object.entries(a).forEach(g=>{const b=g[0],y=this.outputNames.indexOf(b);if(y===-1)throw new Error(`invalid output '${b}'`);n.push(y)});const i=await(0,s.run)(this.sessionId,e,t.map(g=>[g.type,g.dims,g.data]),n,o),u={};for(let g=0;g{Object.defineProperty(r,"__esModule",{value:!0}),r.setSessionOptions=void 0;const d=c(7967),l=c(4983),m=c(6361);r.setSessionOptions=s=>{const h=(0,m.getInstance)();let p=0;const a=[],o=s||{};(t=>{t.extra||(t.extra={}),t.extra.session||(t.extra.session={});const e=t.extra.session;e.use_ort_model_bytes_directly||(e.use_ort_model_bytes_directly="1")})(o);try{(s==null?void 0:s.graphOptimizationLevel)===void 0&&(o.graphOptimizationLevel="all");const t=(i=>{switch(i){case"disabled":return 0;case"basic":return 1;case"extended":return 2;case"all":return 99;default:throw new Error(`unsupported graph optimization level: ${i}`)}})(o.graphOptimizationLevel);(s==null?void 0:s.enableCpuMemArena)===void 0&&(o.enableCpuMemArena=!0),(s==null?void 0:s.enableMemPattern)===void 0&&(o.enableMemPattern=!0),(s==null?void 0:s.executionMode)===void 0&&(o.executionMode="sequential");const e=(i=>{switch(i){case"sequential":return 0;case"parallel":return 1;default:throw new Error(`unsupported execution mode: ${i}`)}})(o.executionMode);let n=0;if((s==null?void 0:s.logId)!==void 0&&(n=(0,l.allocWasmString)(s.logId,a)),(s==null?void 0:s.logSeverityLevel)===void 0)o.logSeverityLevel=2;else if(typeof s.logSeverityLevel!="number"||!Number.isInteger(s.logSeverityLevel)||s.logSeverityLevel<0||s.logSeverityLevel>4)throw new Error(`log serverity level is not valid: ${s.logSeverityLevel}`);if((s==null?void 0:s.logVerbosityLevel)===void 0)o.logVerbosityLevel=0;else if(typeof s.logVerbosityLevel!="number"||!Number.isInteger(s.logVerbosityLevel))throw new Error(`log verbosity level is not valid: ${s.logVerbosityLevel}`);if((s==null?void 0:s.enableProfiling)===void 0&&(o.enableProfiling=!1),p=h._OrtCreateSessionOptions(t,!!o.enableCpuMemArena,!!o.enableMemPattern,e,!!o.enableProfiling,0,n,o.logSeverityLevel,o.logVerbosityLevel),p===0)throw new Error("Can't create session options");return s!=null&&s.executionProviders&&((i,u,g)=>{for(const b of u){let y=typeof b=="string"?b:b.name;switch(y){case"xnnpack":y="XNNPACK";break;case"wasm":case"cpu":continue;default:throw new Error(`not supported EP: ${y}`)}const _=(0,l.allocWasmString)(y,g);if((0,m.getInstance)()._OrtAppendExecutionProvider(i,_)!==0)throw new Error(`Can't append execution provider: ${y}`)}})(p,s.executionProviders,a),(s==null?void 0:s.extra)!==void 0&&(0,d.iterateExtraOptions)(s.extra,"",new WeakSet,(i,u)=>{const g=(0,l.allocWasmString)(i,a),b=(0,l.allocWasmString)(u,a);if(h._OrtAddSessionConfigEntry(p,g,b)!==0)throw new Error(`Can't set a session config entry: ${i} - ${u}`)}),[p,a]}catch(t){throw p!==0&&h._OrtReleaseSessionOptions(p),a.forEach(h._free),t}}},4983:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.allocWasmString=void 0;const d=c(6361);r.allocWasmString=(l,m)=>{const s=(0,d.getInstance)(),h=s.lengthBytesUTF8(l)+1,p=s._malloc(h);return s.stringToUTF8(l,p,h),m.push(p),p}},349:(f,r,c)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.extractTransferableBuffers=r.endProfiling=r.run=r.releaseSession=r.createSession=r.createSessionFinalize=r.createSessionAllocate=r.initOrt=void 0;const d=c(586),l=c(4919),m=c(4983),s=c(6361);r.initOrt=(t,e)=>{const n=(0,s.getInstance)()._OrtInit(t,e);if(n!==0)throw new Error(`Can't initialize onnxruntime. error code = ${n}`)};const h=new Map;r.createSessionAllocate=t=>{const e=(0,s.getInstance)(),n=e._malloc(t.byteLength);return e.HEAPU8.set(t,n),[n,t.byteLength]},r.createSessionFinalize=(t,e)=>{const n=(0,s.getInstance)();let i=0,u=0,g=[];try{if([u,g]=(0,l.setSessionOptions)(e),i=n._OrtCreateSession(t[0],t[1],u),i===0)throw new Error("Can't create a session")}finally{n._free(t[0]),n._OrtReleaseSessionOptions(u),g.forEach(n._free)}const b=n._OrtGetInputCount(i),y=n._OrtGetOutputCount(i),_=[],v=[],w=[],T=[];for(let A=0;A{const n=(0,r.createSessionAllocate)(t);return(0,r.createSessionFinalize)(n,e)},r.releaseSession=t=>{const e=(0,s.getInstance)(),n=h.get(t);if(!n)throw new Error("invalid session id");const i=n[0],u=n[1],g=n[2];u.forEach(e._OrtFree),g.forEach(e._OrtFree),e._OrtReleaseSession(i),h.delete(t)};const p=t=>{switch(t){case"int8":return 3;case"uint8":return 2;case"bool":return 9;case"int16":return 5;case"uint16":return 4;case"int32":return 6;case"uint32":return 12;case"float32":return 1;case"float64":return 11;case"string":return 8;case"int64":return 7;case"uint64":return 13;default:throw new Error(`unsupported data type: ${t}`)}},a=t=>{switch(t){case 3:return"int8";case 2:return"uint8";case 9:return"bool";case 5:return"int16";case 4:return"uint16";case 6:return"int32";case 12:return"uint32";case 1:return"float32";case 11:return"float64";case 8:return"string";case 7:return"int64";case 13:return"uint64";default:throw new Error(`unsupported data type: ${t}`)}},o=t=>{switch(t){case"float32":return Float32Array;case"uint8":case"bool":return Uint8Array;case"int8":return Int8Array;case"uint16":return Uint16Array;case"int16":return Int16Array;case"int32":return Int32Array;case"float64":return Float64Array;case"uint32":return Uint32Array;case"int64":return BigInt64Array;case"uint64":return BigUint64Array;default:throw new Error(`unsupported type: ${t}`)}};r.run=(t,e,n,i,u)=>{const g=(0,s.getInstance)(),b=h.get(t);if(!b)throw new Error("invalid session id");const y=b[0],_=b[1],v=b[2],w=e.length,T=i.length;let A=0,E=[];const x=[],P=[];try{[A,E]=(0,d.setRunOptions)(u);for(let D=0;Dg.HEAP32[Te++]=xe);const ue=g._OrtCreateTensor(p(U),Z,te,Me,J.length);if(ue===0)throw new Error("Can't create a tensor");x.push(ue)}finally{g.stackRestore(he)}}const C=g.stackSave(),k=g.stackAlloc(4*w),$=g.stackAlloc(4*w),F=g.stackAlloc(4*T),q=g.stackAlloc(4*T);try{let D=k/4,U=$/4,J=F/4,Y=q/4;for(let he=0;hewe*ke);if(xe=a(ze),xe==="string"){const we=[];let ke=_e/4;for(let Ue=0;Ue{const e=(0,s.getInstance)(),n=h.get(t);if(!n)throw new Error("invalid session id");const i=n[0],u=e._OrtEndProfiling(i);if(u===0)throw new Error("Can't get an profile file name");e._OrtFree(u)},r.extractTransferableBuffers=t=>{const e=[];for(const n of t){const i=n[2];!Array.isArray(i)&&i.buffer&&e.push(i.buffer)}return e}},6361:function(f,r,c){var d=this&&this.__createBinding||(Object.create?function(u,g,b,y){y===void 0&&(y=b);var _=Object.getOwnPropertyDescriptor(g,b);_&&!("get"in _?!g.__esModule:_.writable||_.configurable)||(_={enumerable:!0,get:function(){return g[b]}}),Object.defineProperty(u,y,_)}:function(u,g,b,y){y===void 0&&(y=b),u[y]=g[b]}),l=this&&this.__setModuleDefault||(Object.create?function(u,g){Object.defineProperty(u,"default",{enumerable:!0,value:g})}:function(u,g){u.default=g}),m=this&&this.__importStar||function(u){if(u&&u.__esModule)return u;var g={};if(u!=null)for(var b in u)b!=="default"&&Object.prototype.hasOwnProperty.call(u,b)&&d(g,u,b);return l(g,u),g},s=this&&this.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(r,"__esModule",{value:!0}),r.dispose=r.getInstance=r.initializeWebAssembly=void 0;const h=m(c(6449)),p=s(c(932)),a=c(3474);let o,t=!1,e=!1,n=!1;const i=(u,g)=>g?u?"ort-wasm-simd-threaded.wasm":"ort-wasm-threaded.wasm":u?"ort-wasm-simd.wasm":"ort-wasm.wasm";r.initializeWebAssembly=async u=>{if(t)return Promise.resolve();if(e)throw new Error("multiple calls to 'initializeWebAssembly()' detected.");if(n)throw new Error("previous call to 'initializeWebAssembly()' failed.");e=!0;const g=u.initTimeout,b=u.numThreads,y=u.simd,_=b>1&&(()=>{try{return typeof SharedArrayBuffer<"u"&&(typeof MessageChannel<"u"&&new MessageChannel().port1.postMessage(new SharedArrayBuffer(1)),WebAssembly.validate(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])))}catch{return!1}})(),v=y&&(()=>{try{return WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,30,1,28,0,65,0,253,15,253,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,253,186,1,26,11]))}catch{return!1}})(),w=typeof u.wasmPaths=="string"?u.wasmPaths:void 0,T=i(!1,_),A=i(v,_),E=typeof u.wasmPaths=="object"?u.wasmPaths[A]:void 0;let x=!1;const P=[];if(g>0&&P.push(new Promise(C=>{setTimeout(()=>{x=!0,C()},g)})),P.push(new Promise((C,k)=>{const $=_?a:p.default,F={locateFile:(q,D)=>_&&q.endsWith(".worker.js")&&typeof Blob<"u"?URL.createObjectURL(new Blob([c(4154)],{type:"text/javascript"})):q===T?E??(w??D)+A:D+q};if(_)if(typeof Blob>"u")F.mainScriptUrlOrBlob=h.join("/","ort-wasm-threaded.js");else{const q=`var ortWasmThreaded=(function(){var _scriptDir;return ${$.toString()}})();`;F.mainScriptUrlOrBlob=new Blob([q],{type:"text/javascript"})}$(F).then(q=>{e=!1,t=!0,o=q,C()},q=>{e=!1,n=!0,k(q)})})),await Promise.race(P),x)throw new Error(`WebAssembly backend initializing failed due to timeout: ${g}ms`)},r.getInstance=()=>{if(t&&o)return o;throw new Error("WebAssembly is not initialized yet.")},r.dispose=()=>{var u;!t||e||n||(e=!0,(u=o.PThread)===null||u===void 0||u.terminateAllThreads(),o=void 0,e=!1,t=!1,n=!0)}},9710:(f,r,c)=>{c.d(r,{Z:()=>m});var d=c(477),l=c.n(d);function m(){return l()('/*!\n* ONNX Runtime Web v1.14.0\n* Copyright (c) Microsoft Corporation. All rights reserved.\n* Licensed under the MIT License.\n*/\n(()=>{var t={474:(t,e,n)=>{var _scriptDir,r=(_scriptDir=(_scriptDir="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0)||"/index.js",function(t){function e(){return j.buffer!=D&&N(j.buffer),P}function r(){return j.buffer!=D&&N(j.buffer),U}function a(){return j.buffer!=D&&N(j.buffer),F}function i(){return j.buffer!=D&&N(j.buffer),I}function o(){return j.buffer!=D&&N(j.buffer),W}var u,c,s;t=t||{},u||(u=void 0!==t?t:{}),u.ready=new Promise((function(t,e){c=t,s=e}));var l,f,p,h,d,y,b=Object.assign({},u),m="./this.program",g=(t,e)=>{throw e},v="object"==typeof window,w="function"==typeof importScripts,_="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,O=u.ENVIRONMENT_IS_PTHREAD||!1,A="";function S(t){return u.locateFile?u.locateFile(t,A):A+t}if(_){let e;A=w?n(908).dirname(A)+"/":"//",y=()=>{d||(h=n(384),d=n(908))},l=function(t,e){return y(),t=d.normalize(t),h.readFileSync(t,e?void 0:"utf8")},p=t=>((t=l(t,!0)).buffer||(t=new Uint8Array(t)),t),f=(t,e,n)=>{y(),t=d.normalize(t),h.readFile(t,(function(t,r){t?n(t):e(r.buffer)}))},1{if(Q())throw process.exitCode=t,e;e instanceof ct||x("exiting due to exception: "+e),process.exit(t)},u.inspect=function(){return"[Emscripten Module object]"};try{e=n(925)}catch(t){throw console.error(\'The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?\'),t}n.g.Worker=e.Worker}else(v||w)&&(w?A=self.location.href:"undefined"!=typeof document&&document.currentScript&&(A=document.currentScript.src),_scriptDir&&(A=_scriptDir),A=0!==A.indexOf("blob:")?A.substr(0,A.replace(/[?#].*/,"").lastIndexOf("/")+1):"",_||(l=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.send(null),e.responseText},w&&(p=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}),f=(t,e,n)=>{var r=new XMLHttpRequest;r.open("GET",t,!0),r.responseType="arraybuffer",r.onload=()=>{200==r.status||0==r.status&&r.response?e(r.response):n()},r.onerror=n,r.send(null)}));_&&"undefined"==typeof performance&&(n.g.performance=n(953).performance);var T=console.log.bind(console),E=console.warn.bind(console);_&&(y(),T=t=>h.writeSync(1,t+"\\n"),E=t=>h.writeSync(2,t+"\\n"));var M,C=u.print||T,x=u.printErr||E;Object.assign(u,b),b=null,u.thisProgram&&(m=u.thisProgram),u.quit&&(g=u.quit),u.wasmBinary&&(M=u.wasmBinary);var R=u.noExitRuntime||!1;"object"!=typeof WebAssembly&&at("no native wasm support detected");var j,k,D,P,U,F,I,W,H=!1,L="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function z(t,e,n){var r=(e>>>=0)+n;for(n=e;t[n]&&!(n>=r);)++n;if(16(a=224==(240&a)?(15&a)<<12|i<<6|o:(7&a)<<18|i<<12|o<<6|63&t[e++])?r+=String.fromCharCode(a):(a-=65536,r+=String.fromCharCode(55296|a>>10,56320|1023&a))}}else r+=String.fromCharCode(a)}return r}function Y(t,e){return(t>>>=0)?z(r(),t,e):""}function B(t,e,n,r){if(!(0>>=0;r=n+r-1;for(var i=0;i=o&&(o=65536+((1023&o)<<10)|1023&t.charCodeAt(++i)),127>=o){if(n>=r)break;e[n++>>>0]=o}else{if(2047>=o){if(n+1>=r)break;e[n++>>>0]=192|o>>6}else{if(65535>=o){if(n+2>=r)break;e[n++>>>0]=224|o>>12}else{if(n+3>=r)break;e[n++>>>0]=240|o>>18,e[n++>>>0]=128|o>>12&63}e[n++>>>0]=128|o>>6&63}e[n++>>>0]=128|63&o}}return e[n>>>0]=0,n-a}function G(t){for(var e=0,n=0;n=r?e++:2047>=r?e+=2:55296<=r&&57343>=r?(e+=4,++n):e+=3}return e}function N(t){D=t,u.HEAP8=P=new Int8Array(t),u.HEAP16=new Int16Array(t),u.HEAP32=F=new Int32Array(t),u.HEAPU8=U=new Uint8Array(t),u.HEAPU16=new Uint16Array(t),u.HEAPU32=I=new Uint32Array(t),u.HEAPF32=new Float32Array(t),u.HEAPF64=W=new Float64Array(t)}O&&(D=u.buffer);var V=u.INITIAL_MEMORY||16777216;if(O)j=u.wasmMemory,D=u.buffer;else if(u.wasmMemory)j=u.wasmMemory;else if(!((j=new WebAssembly.Memory({initial:V/65536,maximum:65536,shared:!0})).buffer instanceof SharedArrayBuffer))throw x("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag"),_&&console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)"),Error("bad memory");j&&(D=j.buffer),V=D.byteLength,N(D);var $,q=[],X=[],J=[],Z=[];function Q(){return R||!1}function K(){var t=u.preRun.shift();q.unshift(t)}var tt,et=0,nt=null,rt=null;function at(t){throw O?postMessage({cmd:"onAbort",arg:t}):u.onAbort&&u.onAbort(t),x(t="Aborted("+t+")"),H=!0,t=new WebAssembly.RuntimeError(t+". Build with -sASSERTIONS for more info."),s(t),t}function it(){return tt.startsWith("data:application/octet-stream;base64,")}function ot(){var t=tt;try{if(t==tt&&M)return new Uint8Array(M);if(p)return p(t);throw"both async and sync fetching of the wasm failed"}catch(t){at(t)}}tt="ort-wasm-threaded.wasm",it()||(tt=S(tt));var ut={};function ct(t){this.name="ExitStatus",this.message="Program terminated with exit("+t+")",this.status=t}function st(t){(t=ht.Vb[t])||at(),ht.mc(t)}function lt(t){var e=ht.Cc();if(!e)return 6;ht.ac.push(e),ht.Vb[t.Ub]=e,e.Ub=t.Ub;var n={cmd:"run",start_routine:t.Ic,arg:t.zc,pthread_ptr:t.Ub};return e.$b=()=>{n.time=performance.now(),e.postMessage(n,t.Nc)},e.loaded&&(e.$b(),delete e.$b),0}function ft(t){if(O)return $t(1,1,t);Q()||(ht.oc(),u.onExit&&u.onExit(t),H=!0),g(t,new ct(t))}function pt(t,e){if(!e&&O)throw bt(t),"unwind";Q()||O||(me(),dt(J),be(0),re[1].length&&ae(1,10),re[2].length&&ae(2,10),ht.oc()),ft(t)}var ht={Yb:[],ac:[],qc:[],Vb:{},fc:function(){O&&ht.Ec()},Pc:function(){},Ec:function(){ht.receiveObjectTransfer=ht.Gc,ht.threadInitTLS=ht.pc,ht.setExitStatus=ht.nc,R=!1},nc:function(){},oc:function(){for(var t of Object.values(ht.Vb))ht.mc(t);for(t of ht.Yb)t.terminate();ht.Yb=[]},mc:function(t){var e=t.Ub;delete ht.Vb[e],ht.Yb.push(t),ht.ac.splice(ht.ac.indexOf(t),1),t.Ub=0,Oe(e)},Gc:function(){},pc:function(){ht.qc.forEach((t=>t()))},Fc:function(t,e){t.onmessage=n=>{var r=(n=n.data).cmd;if(t.Ub&&(ht.Bc=t.Ub),n.targetThread&&n.targetThread!=he()){var a=ht.Vb[n.Qc];a?a.postMessage(n,n.transferList):x(\'Internal error! Worker sent a message "\'+r+\'" to target pthread \'+n.targetThread+", but that thread no longer exists!")}else"processProxyingQueue"===r?zt(n.queue):"spawnThread"===r?lt(n):"cleanupThread"===r?st(n.thread):"killThread"===r?(n=n.thread,r=ht.Vb[n],delete ht.Vb[n],r.terminate(),Oe(n),ht.ac.splice(ht.ac.indexOf(r),1),r.Ub=0):"cancelThread"===r?ht.Vb[n.thread].postMessage({cmd:"cancel"}):"loaded"===r?(t.loaded=!0,e&&e(t),t.$b&&(t.$b(),delete t.$b)):"print"===r?C("Thread "+n.threadId+": "+n.text):"printErr"===r?x("Thread "+n.threadId+": "+n.text):"alert"===r?alert("Thread "+n.threadId+": "+n.text):"setimmediate"===n.target?t.postMessage(n):"onAbort"===r?u.onAbort&&u.onAbort(n.arg):r&&x("worker sent an unknown command "+r);ht.Bc=void 0},t.onerror=t=>{throw x("worker sent an error! "+t.filename+":"+t.lineno+": "+t.message),t},_&&(t.on("message",(function(e){t.onmessage({data:e})})),t.on("error",(function(e){t.onerror(e)})),t.on("detachedExit",(function(){}))),t.postMessage({cmd:"load",urlOrBlob:u.mainScriptUrlOrBlob||_scriptDir,wasmMemory:j,wasmModule:k})},yc:function(){var t=S("ort-wasm-threaded.worker.js");ht.Yb.push(new Worker(t))},Cc:function(){return 0==ht.Yb.length&&(ht.yc(),ht.Fc(ht.Yb[0])),ht.Yb.pop()}};function dt(t){for(;0>2>>>0];t=a()[t+48>>2>>>0],Te(e,e-t),Me(e)};var mt=[];function gt(t){var e=mt[t];return e||(t>=mt.length&&(mt.length=t+1),mt[t]=e=$.get(t)),e}u.invokeEntryPoint=function(t,e){t=gt(t)(e),Q()?ht.nc(t):Ae(t)};var vt,wt,_t=[],Ot=0,At=0;function St(t){this.Zb=t,this.Sb=t-24,this.xc=function(t){i()[this.Sb+4>>2>>>0]=t},this.bc=function(){return i()[this.Sb+4>>2>>>0]},this.wc=function(t){i()[this.Sb+8>>2>>>0]=t},this.Dc=function(){return i()[this.Sb+8>>2>>>0]},this.rc=function(){a()[this.Sb>>2>>>0]=0},this.hc=function(t){t=t?1:0,e()[this.Sb+12>>0>>>0]=t},this.uc=function(){return 0!=e()[this.Sb+12>>0>>>0]},this.ic=function(t){t=t?1:0,e()[this.Sb+13>>0>>>0]=t},this.kc=function(){return 0!=e()[this.Sb+13>>0>>>0]},this.fc=function(t,e){this.cc(0),this.xc(t),this.wc(e),this.rc(),this.hc(!1),this.ic(!1)},this.sc=function(){Atomics.add(a(),this.Sb>>2,1)},this.Hc=function(){return 1===Atomics.sub(a(),this.Sb>>2,1)},this.cc=function(t){i()[this.Sb+16>>2>>>0]=t},this.tc=function(){return i()[this.Sb+16>>2>>>0]},this.vc=function(){if(Re(this.bc()))return i()[this.Zb>>2>>>0];var t=this.tc();return 0!==t?t:this.Zb}}function Tt(t){return ye(new St(t).Sb)}function Et(t,e,n,r){return O?$t(3,1,t,e,n,r):Mt(t,e,n,r)}function Mt(t,e,n,r){if("undefined"==typeof SharedArrayBuffer)return x("Current environment does not support SharedArrayBuffer, pthreads are not available!"),6;var a=[];return O&&0===a.length?Et(t,e,n,r):(t={Ic:n,Ub:t,zc:r,Nc:a},O?(t.Oc="spawnThread",postMessage(t,a),0):lt(t))}function Ct(t,e,n){return O?$t(4,1,t,e,n):0}function xt(t,e){if(O)return $t(5,1,t,e)}function Rt(t,e){if(O)return $t(6,1,t,e)}function jt(t,e,n){if(O)return $t(7,1,t,e,n)}function kt(t,e,n){return O?$t(8,1,t,e,n):0}function Dt(t,e){if(O)return $t(9,1,t,e)}function Pt(t,e,n){if(O)return $t(10,1,t,e,n)}function Ut(t,e,n,r){if(O)return $t(11,1,t,e,n,r)}function Ft(t,e,n,r){if(O)return $t(12,1,t,e,n,r)}function It(t,e,n,r){if(O)return $t(13,1,t,e,n,r)}function Wt(t){if(O)return $t(14,1,t)}function Ht(t,e){if(O)return $t(15,1,t,e)}function Lt(t,e,n){if(O)return $t(16,1,t,e,n)}function zt(t){Atomics.store(a(),t>>2,1),he()&&_e(t),Atomics.compareExchange(a(),t>>2,1,0)}function Yt(t){return i()[t>>>2]+4294967296*a()[t+4>>>2]}function Bt(t,e,n,r,a,i){return O?$t(17,1,t,e,n,r,a,i):-52}function Gt(t,e,n,r,a,i){if(O)return $t(18,1,t,e,n,r,a,i)}function Nt(t){var n=G(t)+1,r=de(n);return r&&B(t,e(),r,n),r}function Vt(t,e,n){function r(t){return(t=t.toTimeString().match(/\\(([A-Za-z ]+)\\)$/))?t[1]:"GMT"}if(O)return $t(19,1,t,e,n);var o=(new Date).getFullYear(),u=new Date(o,0,1),c=new Date(o,6,1);o=u.getTimezoneOffset();var s=c.getTimezoneOffset(),l=Math.max(o,s);a()[t>>2>>>0]=60*l,a()[e>>2>>>0]=Number(o!=s),t=r(u),e=r(c),t=Nt(t),e=Nt(e),s>2>>>0]=t,i()[n+4>>2>>>0]=e):(i()[n>>2>>>0]=e,i()[n+4>>2>>>0]=t)}function $t(t,e){var n=arguments.length-2,r=arguments;return yt((()=>{for(var a=Ce(8*n),i=a>>3,u=0;u>>0]=c}return we(t,n,a,e)}))}u.executeNotifiedProxyingQueue=zt,wt=_?()=>{var t=process.hrtime();return 1e3*t[0]+t[1]/1e6}:O?()=>performance.now()-u.__performance_now_clock_drift:()=>performance.now();var qt,Xt=[],Jt={};function Zt(){if(!qt){var t,e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:m||"./this.program"};for(t in Jt)void 0===Jt[t]?delete e[t]:e[t]=Jt[t];var n=[];for(t in e)n.push(t+"="+e[t]);qt=n}return qt}function Qt(t,n){if(O)return $t(20,1,t,n);var r=0;return Zt().forEach((function(a,o){var u=n+r;for(o=i()[t+4*o>>2>>>0]=u,u=0;u>0>>>0]=a.charCodeAt(u);e()[o>>0>>>0]=0,r+=a.length+1})),0}function Kt(t,e){if(O)return $t(21,1,t,e);var n=Zt();i()[t>>2>>>0]=n.length;var r=0;return n.forEach((function(t){r+=t.length+1})),i()[e>>2>>>0]=r,0}function te(t){return O?$t(22,1,t):52}function ee(t,e,n,r){return O?$t(23,1,t,e,n,r):52}function ne(t,e,n,r,a){return O?$t(24,1,t,e,n,r,a):70}var re=[null,[],[]];function ae(t,e){var n=re[t];0===e||10===e?((1===t?C:x)(z(n,0)),n.length=0):n.push(e)}function ie(t,e,n,a){if(O)return $t(25,1,t,e,n,a);for(var o=0,u=0;u>2>>>0],s=i()[e+4>>2>>>0];e+=8;for(var l=0;l>>0]);o+=s}return i()[a>>2>>>0]=o,0}var oe=0;function ue(t){return 0==t%4&&(0!=t%100||0==t%400)}var ce=[31,29,31,30,31,30,31,31,30,31,30,31],se=[31,28,31,30,31,30,31,31,30,31,30,31];function le(t,n,r,i){function o(t,e,n){for(t="number"==typeof t?t.toString():t||"";t.lengtht?-1:0r-t.getDate())){t.setDate(t.getDate()+e);break}e-=r-t.getDate()+1,t.setDate(1),11>n?t.setMonth(n+1):(t.setMonth(0),t.setFullYear(t.getFullYear()+1))}return n=new Date(t.getFullYear()+1,0,4),e=s(new Date(t.getFullYear(),0,4)),n=s(n),0>=c(e,t)?0>=c(n,t)?t.getFullYear()+1:t.getFullYear():t.getFullYear()-1}var f=a()[i+40>>2>>>0];for(var p in i={Lc:a()[i>>2>>>0],Kc:a()[i+4>>2>>>0],dc:a()[i+8>>2>>>0],jc:a()[i+12>>2>>>0],ec:a()[i+16>>2>>>0],Xb:a()[i+20>>2>>>0],Tb:a()[i+24>>2>>>0],Wb:a()[i+28>>2>>>0],Rc:a()[i+32>>2>>>0],Jc:a()[i+36>>2>>>0],Mc:f?Y(f):""},r=Y(r),f={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"})r=r.replace(new RegExp(p,"g"),f[p]);var h="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),d="January February March April May June July August September October November December".split(" ");for(p in f={"%a":function(t){return h[t.Tb].substring(0,3)},"%A":function(t){return h[t.Tb]},"%b":function(t){return d[t.ec].substring(0,3)},"%B":function(t){return d[t.ec]},"%C":function(t){return u((t.Xb+1900)/100|0,2)},"%d":function(t){return u(t.jc,2)},"%e":function(t){return o(t.jc,2," ")},"%g":function(t){return l(t).toString().substring(2)},"%G":function(t){return l(t)},"%H":function(t){return u(t.dc,2)},"%I":function(t){return 0==(t=t.dc)?t=12:12t.dc?"AM":"PM"},"%S":function(t){return u(t.Lc,2)},"%t":function(){return"\\t"},"%u":function(t){return t.Tb||7},"%U":function(t){return u(Math.floor((t.Wb+7-t.Tb)/7),2)},"%V":function(t){var e=Math.floor((t.Wb+7-(t.Tb+6)%7)/7);if(2>=(t.Tb+371-t.Wb-2)%7&&e++,e)53==e&&(4==(n=(t.Tb+371-t.Wb)%7)||3==n&&ue(t.Xb)||(e=1));else{e=52;var n=(t.Tb+7-t.Wb-1)%7;(4==n||5==n&&ue(t.Xb%400-1))&&e++}return u(e,2)},"%w":function(t){return t.Tb},"%W":function(t){return u(Math.floor((t.Wb+7-(t.Tb+6)%7)/7),2)},"%y":function(t){return(t.Xb+1900).toString().substring(2)},"%Y":function(t){return t.Xb+1900},"%z":function(t){var e=0<=(t=t.Jc);return t=Math.abs(t)/60,(e?"+":"-")+String("0000"+(t/60*100+t%60)).slice(-4)},"%Z":function(t){return t.Mc},"%%":function(){return"%"}},r=r.replace(/%%/g,"\\0\\0"),f)r.includes(p)&&(r=r.replace(new RegExp(p,"g"),f[p](i)));return p=function(t){var e=Array(G(t)+1);return B(t,e,0,e.length),e}(r=r.replace(/\\0\\0/g,"%")),p.length>n?0:(function(t,n){e().set(t,n>>>0)}(p,t),p.length-1)}ht.fc();var fe=[null,ft,bt,Et,Ct,xt,Rt,jt,kt,Dt,Pt,Ut,Ft,It,Wt,Ht,Lt,Bt,Gt,Vt,Qt,Kt,te,ee,ne,ie],pe={b:function(t){return de(t+24)+24},n:function(t){return(t=new St(t)).uc()||(t.hc(!0),Ot--),t.ic(!1),_t.push(t),t.sc(),t.vc()},ma:function(t){throw x("Unexpected exception thrown, this is not properly supported - aborting"),H=!0,t},x:function(){Se(0);var t=_t.pop();if(t.Hc()&&!t.kc()){var e=t.Dc();e&>(e)(t.Zb),Tt(t.Zb)}At=0},e:function(){var t=At;if(!t)return oe=0;var e=new St(t);e.cc(t);var n=e.bc();if(!n)return oe=0,t;for(var r=Array.prototype.slice.call(arguments),a=0;azt(r)));else if(O)postMessage({targetThread:t,cmd:"processProxyingQueue",queue:r});else{if(!(t=ht.Vb[t]))return;t.postMessage({cmd:"processProxyingQueue",queue:r})}return 1},Ea:function(){return-1},Pa:function(t,e){t=new Date(1e3*Yt(t)),a()[e>>2>>>0]=t.getUTCSeconds(),a()[e+4>>2>>>0]=t.getUTCMinutes(),a()[e+8>>2>>>0]=t.getUTCHours(),a()[e+12>>2>>>0]=t.getUTCDate(),a()[e+16>>2>>>0]=t.getUTCMonth(),a()[e+20>>2>>>0]=t.getUTCFullYear()-1900,a()[e+24>>2>>>0]=t.getUTCDay(),t=(t.getTime()-Date.UTC(t.getUTCFullYear(),0,1,0,0,0,0))/864e5|0,a()[e+28>>2>>>0]=t},Qa:function(t,e){t=new Date(1e3*Yt(t)),a()[e>>2>>>0]=t.getSeconds(),a()[e+4>>2>>>0]=t.getMinutes(),a()[e+8>>2>>>0]=t.getHours(),a()[e+12>>2>>>0]=t.getDate(),a()[e+16>>2>>>0]=t.getMonth(),a()[e+20>>2>>>0]=t.getFullYear()-1900,a()[e+24>>2>>>0]=t.getDay();var n=new Date(t.getFullYear(),0,1),r=(t.getTime()-n.getTime())/864e5|0;a()[e+28>>2>>>0]=r,a()[e+36>>2>>>0]=-60*t.getTimezoneOffset(),r=new Date(t.getFullYear(),6,1).getTimezoneOffset(),t=0|(r!=(n=n.getTimezoneOffset())&&t.getTimezoneOffset()==Math.min(n,r)),a()[e+32>>2>>>0]=t},Ra:function(t){var e=new Date(a()[t+20>>2>>>0]+1900,a()[t+16>>2>>>0],a()[t+12>>2>>>0],a()[t+8>>2>>>0],a()[t+4>>2>>>0],a()[t>>2>>>0],0),n=a()[t+32>>2>>>0],r=e.getTimezoneOffset(),i=new Date(e.getFullYear(),0,1),o=new Date(e.getFullYear(),6,1).getTimezoneOffset(),u=i.getTimezoneOffset(),c=Math.min(u,o);return 0>n?a()[t+32>>2>>>0]=Number(o!=u&&c==r):0>2>>>0]=e.getDay(),n=(e.getTime()-i.getTime())/864e5|0,a()[t+28>>2>>>0]=n,a()[t>>2>>>0]=e.getSeconds(),a()[t+4>>2>>>0]=e.getMinutes(),a()[t+8>>2>>>0]=e.getHours(),a()[t+12>>2>>>0]=e.getDate(),a()[t+16>>2>>>0]=e.getMonth(),e.getTime()/1e3|0},Aa:Bt,Ba:Gt,Sa:function t(e,n,r){t.Ac||(t.Ac=!0,Vt(e,n,r))},y:function(){at("")},U:function(){if(!_&&!w){var t="Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread";vt||(vt={}),vt[t]||(vt[t]=1,_&&(t="warning: "+t),x(t))}},ra:function(){return 4294901760},B:wt,Ia:function(t,e,n){r().copyWithin(t>>>0,e>>>0,e+n>>>0)},F:function(){return _?n(993).cpus().length:navigator.hardwareConcurrency},Da:function(t,e,n){Xt.length=e,n>>=3;for(var r=0;r>>0];return(0>t?ut[-t-1]:fe[t]).apply(null,Xt)},qa:function(t){var e=r().length;if((t>>>=0)<=e||4294901760=n;n*=2){var a=e*(1+.2/n);a=Math.min(a,t+100663296);var i=Math;a=Math.max(t,a),i=i.min.call(i,4294901760,a+(65536-a%65536)%65536);t:{try{j.grow(i-D.byteLength+65535>>>16),N(j.buffer);var o=1;break t}catch(t){}o=void 0}if(o)return!0}return!1},Na:function(){throw"unwind"},Ga:Qt,Ha:Kt,J:pt,I:te,S:ee,ga:ne,R:ie,d:function(){return oe},na:function t(r,a){t.lc||(t.lc=function(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var t=new Uint8Array(1);return()=>(crypto.getRandomValues(t),t[0])}if(_)try{var e=n(Object(function(){var t=new Error("Cannot find module \'crypto\'");throw t.code="MODULE_NOT_FOUND",t}()));return()=>e.randomBytes(1)[0]}catch(t){}return()=>at("randomDevice")}());for(var i=0;i>0>>>0]=t.lc();return 0},ia:function(t,e,n){var r=Ee();try{return gt(t)(e,n)}catch(t){if(Me(r),t!==t+0)throw t;Se(1,0)}},ja:function(t,e,n){var r=Ee();try{return gt(t)(e,n)}catch(t){if(Me(r),t!==t+0)throw t;Se(1,0)}},K:function(t){var e=Ee();try{return gt(t)()}catch(t){if(Me(e),t!==t+0)throw t;Se(1,0)}},f:function(t,e){var n=Ee();try{return gt(t)(e)}catch(t){if(Me(n),t!==t+0)throw t;Se(1,0)}},P:function(t,e,n){var r=Ee();try{return gt(t)(e,n)}catch(t){if(Me(r),t!==t+0)throw t;Se(1,0)}},Q:function(t,e,n){var r=Ee();try{return gt(t)(e,n)}catch(t){if(Me(r),t!==t+0)throw t;Se(1,0)}},k:function(t,e,n){var r=Ee();try{return gt(t)(e,n)}catch(t){if(Me(r),t!==t+0)throw t;Se(1,0)}},p:function(t,e,n,r){var a=Ee();try{return gt(t)(e,n,r)}catch(t){if(Me(a),t!==t+0)throw t;Se(1,0)}},q:function(t,e,n,r,a){var i=Ee();try{return gt(t)(e,n,r,a)}catch(t){if(Me(i),t!==t+0)throw t;Se(1,0)}},N:function(t,e,n,r,a,i){var o=Ee();try{return gt(t)(e,n,r,a,i)}catch(t){if(Me(o),t!==t+0)throw t;Se(1,0)}},s:function(t,e,n,r,a,i){var o=Ee();try{return gt(t)(e,n,r,a,i)}catch(t){if(Me(o),t!==t+0)throw t;Se(1,0)}},w:function(t,e,n,r,a,i,o){var u=Ee();try{return gt(t)(e,n,r,a,i,o)}catch(t){if(Me(u),t!==t+0)throw t;Se(1,0)}},L:function(t,e,n,r,a,i,o,u){var c=Ee();try{return gt(t)(e,n,r,a,i,o,u)}catch(t){if(Me(c),t!==t+0)throw t;Se(1,0)}},E:function(t,e,n,r,a,i,o,u,c,s,l,f){var p=Ee();try{return gt(t)(e,n,r,a,i,o,u,c,s,l,f)}catch(t){if(Me(p),t!==t+0)throw t;Se(1,0)}},aa:function(t,e,n,r,a,i,o,u){var c=Ee();try{return He(t,e,n,r,a,i,o,u)}catch(t){if(Me(c),t!==t+0)throw t;Se(1,0)}},_:function(t,e,n,r,a,i,o){var u=Ee();try{return ke(t,e,n,r,a,i,o)}catch(t){if(Me(u),t!==t+0)throw t;Se(1,0)}},Z:function(t,e,n,r,a){var i=Ee();try{return Le(t,e,n,r,a)}catch(t){if(Me(i),t!==t+0)throw t;Se(1,0)}},ca:function(t,e,n,r){var a=Ee();try{return Ie(t,e,n,r)}catch(t){if(Me(a),t!==t+0)throw t;Se(1,0)}},$:function(t){var e=Ee();try{return je(t)}catch(t){if(Me(e),t!==t+0)throw t;Se(1,0)}},ba:function(t,e){var n=Ee();try{return We(t,e)}catch(t){if(Me(n),t!==t+0)throw t;Se(1,0)}},Y:function(t,e,n){var r=Ee();try{return De(t,e,n)}catch(t){if(Me(r),t!==t+0)throw t;Se(1,0)}},g:function(t){var e=Ee();try{gt(t)()}catch(t){if(Me(e),t!==t+0)throw t;Se(1,0)}},r:function(t,e){var n=Ee();try{gt(t)(e)}catch(t){if(Me(n),t!==t+0)throw t;Se(1,0)}},i:function(t,e,n){var r=Ee();try{gt(t)(e,n)}catch(t){if(Me(r),t!==t+0)throw t;Se(1,0)}},ha:function(t,e,n,r){var a=Ee();try{gt(t)(e,n,r)}catch(t){if(Me(a),t!==t+0)throw t;Se(1,0)}},m:function(t,e,n,r){var a=Ee();try{gt(t)(e,n,r)}catch(t){if(Me(a),t!==t+0)throw t;Se(1,0)}},v:function(t,e,n,r,a){var i=Ee();try{gt(t)(e,n,r,a)}catch(t){if(Me(i),t!==t+0)throw t;Se(1,0)}},u:function(t,e,n,r,a,i){var o=Ee();try{gt(t)(e,n,r,a,i)}catch(t){if(Me(o),t!==t+0)throw t;Se(1,0)}},O:function(t,e,n,r,a,i,o){var u=Ee();try{gt(t)(e,n,r,a,i,o)}catch(t){if(Me(u),t!==t+0)throw t;Se(1,0)}},A:function(t,e,n,r,a,i,o,u){var c=Ee();try{gt(t)(e,n,r,a,i,o,u)}catch(t){if(Me(c),t!==t+0)throw t;Se(1,0)}},ka:function(t,e,n,r,a,i,o,u,c){var s=Ee();try{gt(t)(e,n,r,a,i,o,u,c)}catch(t){if(Me(s),t!==t+0)throw t;Se(1,0)}},C:function(t,e,n,r,a,i,o,u,c,s,l){var f=Ee();try{gt(t)(e,n,r,a,i,o,u,c,s,l)}catch(t){if(Me(f),t!==t+0)throw t;Se(1,0)}},D:function(t,e,n,r,a,i,o,u,c,s,l,f,p,h,d,y){var b=Ee();try{gt(t)(e,n,r,a,i,o,u,c,s,l,f,p,h,d,y)}catch(t){if(Me(b),t!==t+0)throw t;Se(1,0)}},fa:function(t,e,n,r,a,i,o,u){var c=Ee();try{Pe(t,e,n,r,a,i,o,u)}catch(t){if(Me(c),t!==t+0)throw t;Se(1,0)}},da:function(t,e,n,r,a,i,o,u,c,s,l,f){var p=Ee();try{Fe(t,e,n,r,a,i,o,u,c,s,l,f)}catch(t){if(Me(p),t!==t+0)throw t;Se(1,0)}},ea:function(t,e,n,r,a,i){var o=Ee();try{Ue(t,e,n,r,a,i)}catch(t){if(Me(o),t!==t+0)throw t;Se(1,0)}},o:function(t){return t},a:j||u.wasmMemory,G:function(t){oe=t},la:le,z:function(t,e,n,r){return le(t,e,n,r)}};!function(){function t(t,e){u.asm=t.exports,ht.qc.push(u.asm.sb),$=u.asm.ub,X.unshift(u.asm.Va),k=e,O||(et--,u.monitorRunDependencies&&u.monitorRunDependencies(et),0==et&&(null!==nt&&(clearInterval(nt),nt=null),rt&&(t=rt,rt=null,t())))}function e(e){t(e.instance,e.module)}function n(t){return function(){if(!M&&(v||w)){if("function"==typeof fetch&&!tt.startsWith("file://"))return fetch(tt,{credentials:"same-origin"}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at \'"+tt+"\'";return t.arrayBuffer()})).catch((function(){return ot()}));if(f)return new Promise((function(t,e){f(tt,(function(e){t(new Uint8Array(e))}),e)}))}return Promise.resolve().then((function(){return ot()}))}().then((function(t){return WebAssembly.instantiate(t,r)})).then((function(t){return t})).then(t,(function(t){x("failed to asynchronously prepare wasm: "+t),at(t)}))}var r={a:pe};if(O||(et++,u.monitorRunDependencies&&u.monitorRunDependencies(et)),u.instantiateWasm)try{return u.instantiateWasm(r,t)}catch(t){return x("Module.instantiateWasm callback failed with error: "+t),!1}(M||"function"!=typeof WebAssembly.instantiateStreaming||it()||tt.startsWith("file://")||_||"function"!=typeof fetch?n(e):fetch(tt,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,r).then(e,(function(t){return x("wasm streaming compile failed: "+t),x("falling back to ArrayBuffer instantiation"),n(e)}))}))).catch(s)}(),u.___wasm_call_ctors=function(){return(u.___wasm_call_ctors=u.asm.Va).apply(null,arguments)},u._OrtInit=function(){return(u._OrtInit=u.asm.Wa).apply(null,arguments)},u._OrtCreateSessionOptions=function(){return(u._OrtCreateSessionOptions=u.asm.Xa).apply(null,arguments)},u._OrtAppendExecutionProvider=function(){return(u._OrtAppendExecutionProvider=u.asm.Ya).apply(null,arguments)},u._OrtAddSessionConfigEntry=function(){return(u._OrtAddSessionConfigEntry=u.asm.Za).apply(null,arguments)},u._OrtReleaseSessionOptions=function(){return(u._OrtReleaseSessionOptions=u.asm._a).apply(null,arguments)},u._OrtCreateSession=function(){return(u._OrtCreateSession=u.asm.$a).apply(null,arguments)},u._OrtReleaseSession=function(){return(u._OrtReleaseSession=u.asm.ab).apply(null,arguments)},u._OrtGetInputCount=function(){return(u._OrtGetInputCount=u.asm.bb).apply(null,arguments)},u._OrtGetOutputCount=function(){return(u._OrtGetOutputCount=u.asm.cb).apply(null,arguments)},u._OrtGetInputName=function(){return(u._OrtGetInputName=u.asm.db).apply(null,arguments)},u._OrtGetOutputName=function(){return(u._OrtGetOutputName=u.asm.eb).apply(null,arguments)},u._OrtFree=function(){return(u._OrtFree=u.asm.fb).apply(null,arguments)},u._OrtCreateTensor=function(){return(u._OrtCreateTensor=u.asm.gb).apply(null,arguments)},u._OrtGetTensorData=function(){return(u._OrtGetTensorData=u.asm.hb).apply(null,arguments)},u._OrtReleaseTensor=function(){return(u._OrtReleaseTensor=u.asm.ib).apply(null,arguments)},u._OrtCreateRunOptions=function(){return(u._OrtCreateRunOptions=u.asm.jb).apply(null,arguments)},u._OrtAddRunConfigEntry=function(){return(u._OrtAddRunConfigEntry=u.asm.kb).apply(null,arguments)},u._OrtReleaseRunOptions=function(){return(u._OrtReleaseRunOptions=u.asm.lb).apply(null,arguments)},u._OrtRun=function(){return(u._OrtRun=u.asm.mb).apply(null,arguments)},u._OrtEndProfiling=function(){return(u._OrtEndProfiling=u.asm.nb).apply(null,arguments)};var he=u._pthread_self=function(){return(he=u._pthread_self=u.asm.ob).apply(null,arguments)},de=u._malloc=function(){return(de=u._malloc=u.asm.pb).apply(null,arguments)},ye=u._free=function(){return(ye=u._free=u.asm.qb).apply(null,arguments)},be=u._fflush=function(){return(be=u._fflush=u.asm.rb).apply(null,arguments)};u.__emscripten_tls_init=function(){return(u.__emscripten_tls_init=u.asm.sb).apply(null,arguments)};var me=u.___funcs_on_exit=function(){return(me=u.___funcs_on_exit=u.asm.tb).apply(null,arguments)},ge=u.__emscripten_thread_init=function(){return(ge=u.__emscripten_thread_init=u.asm.vb).apply(null,arguments)};u.__emscripten_thread_crashed=function(){return(u.__emscripten_thread_crashed=u.asm.wb).apply(null,arguments)};var ve,we=u._emscripten_run_in_main_runtime_thread_js=function(){return(we=u._emscripten_run_in_main_runtime_thread_js=u.asm.xb).apply(null,arguments)},_e=u.__emscripten_proxy_execute_task_queue=function(){return(_e=u.__emscripten_proxy_execute_task_queue=u.asm.yb).apply(null,arguments)},Oe=u.__emscripten_thread_free_data=function(){return(Oe=u.__emscripten_thread_free_data=u.asm.zb).apply(null,arguments)},Ae=u.__emscripten_thread_exit=function(){return(Ae=u.__emscripten_thread_exit=u.asm.Ab).apply(null,arguments)},Se=u._setThrew=function(){return(Se=u._setThrew=u.asm.Bb).apply(null,arguments)},Te=u._emscripten_stack_set_limits=function(){return(Te=u._emscripten_stack_set_limits=u.asm.Cb).apply(null,arguments)},Ee=u.stackSave=function(){return(Ee=u.stackSave=u.asm.Db).apply(null,arguments)},Me=u.stackRestore=function(){return(Me=u.stackRestore=u.asm.Eb).apply(null,arguments)},Ce=u.stackAlloc=function(){return(Ce=u.stackAlloc=u.asm.Fb).apply(null,arguments)},xe=u.___cxa_can_catch=function(){return(xe=u.___cxa_can_catch=u.asm.Gb).apply(null,arguments)},Re=u.___cxa_is_pointer_type=function(){return(Re=u.___cxa_is_pointer_type=u.asm.Hb).apply(null,arguments)},je=u.dynCall_j=function(){return(je=u.dynCall_j=u.asm.Ib).apply(null,arguments)},ke=u.dynCall_iiiiij=function(){return(ke=u.dynCall_iiiiij=u.asm.Jb).apply(null,arguments)},De=u.dynCall_jii=function(){return(De=u.dynCall_jii=u.asm.Kb).apply(null,arguments)},Pe=u.dynCall_viiiiij=function(){return(Pe=u.dynCall_viiiiij=u.asm.Lb).apply(null,arguments)},Ue=u.dynCall_vjji=function(){return(Ue=u.dynCall_vjji=u.asm.Mb).apply(null,arguments)},Fe=u.dynCall_viiijjjii=function(){return(Fe=u.dynCall_viiijjjii=u.asm.Nb).apply(null,arguments)},Ie=u.dynCall_iij=function(){return(Ie=u.dynCall_iij=u.asm.Ob).apply(null,arguments)},We=u.dynCall_ji=function(){return(We=u.dynCall_ji=u.asm.Pb).apply(null,arguments)},He=u.dynCall_iiiiiij=function(){return(He=u.dynCall_iiiiiij=u.asm.Qb).apply(null,arguments)},Le=u.dynCall_iiij=function(){return(Le=u.dynCall_iiij=u.asm.Rb).apply(null,arguments)};function ze(){function t(){if(!ve&&(ve=!0,u.calledRun=!0,!H)&&(O||dt(X),c(u),u.onRuntimeInitialized&&u.onRuntimeInitialized(),!O)){if(u.postRun)for("function"==typeof u.postRun&&(u.postRun=[u.postRun]);u.postRun.length;){var t=u.postRun.shift();Z.unshift(t)}dt(Z)}}if(!(0{var _scriptDir,r=(_scriptDir=(_scriptDir="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0)||"/index.js",function(t){var e,r,a;t=t||{},e||(e=void 0!==t?t:{}),e.ready=new Promise((function(t,e){r=t,a=e}));var i,o,u,c,s,l,f=Object.assign({},e),p="./this.program",h=(t,e)=>{throw e},d="object"==typeof window,y="function"==typeof importScripts,b="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,m="";b?(m=y?n(908).dirname(m)+"/":"//",l=()=>{s||(c=n(384),s=n(908))},i=function(t,e){return l(),t=s.normalize(t),c.readFileSync(t,e?void 0:"utf8")},u=t=>((t=i(t,!0)).buffer||(t=new Uint8Array(t)),t),o=(t,e,n)=>{l(),t=s.normalize(t),c.readFile(t,(function(t,r){t?n(t):e(r.buffer)}))},1{if(_||0{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.send(null),e.responseText},y&&(u=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}),o=(t,e,n)=>{var r=new XMLHttpRequest;r.open("GET",t,!0),r.responseType="arraybuffer",r.onload=()=>{200==r.status||0==r.status&&r.response?e(r.response):n()},r.onerror=n,r.send(null)});var g,v=e.print||console.log.bind(console),w=e.printErr||console.warn.bind(console);Object.assign(e,f),f=null,e.thisProgram&&(p=e.thisProgram),e.quit&&(h=e.quit),e.wasmBinary&&(g=e.wasmBinary);var _=e.noExitRuntime||!1;"object"!=typeof WebAssembly&&V("no native wasm support detected");var O,A,S,T,E,M,C=!1,x="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function R(t,e,n){var r=(e>>>=0)+n;for(n=e;t[n]&&!(n>=r);)++n;if(16(a=224==(240&a)?(15&a)<<12|i<<6|o:(7&a)<<18|i<<12|o<<6|63&t[e++])?r+=String.fromCharCode(a):(a-=65536,r+=String.fromCharCode(55296|a>>10,56320|1023&a))}}else r+=String.fromCharCode(a)}return r}function j(t,e){return(t>>>=0)?R(T,t,e):""}function k(t,e,n,r){if(!(0>>=0;r=n+r-1;for(var i=0;i=o&&(o=65536+((1023&o)<<10)|1023&t.charCodeAt(++i)),127>=o){if(n>=r)break;e[n++>>>0]=o}else{if(2047>=o){if(n+1>=r)break;e[n++>>>0]=192|o>>6}else{if(65535>=o){if(n+2>=r)break;e[n++>>>0]=224|o>>12}else{if(n+3>=r)break;e[n++>>>0]=240|o>>18,e[n++>>>0]=128|o>>12&63}e[n++>>>0]=128|o>>6&63}e[n++>>>0]=128|63&o}}return e[n>>>0]=0,n-a}function D(t){for(var e=0,n=0;n=r?e++:2047>=r?e+=2:55296<=r&&57343>=r?(e+=4,++n):e+=3}return e}function P(){var t=O.buffer;A=t,e.HEAP8=S=new Int8Array(t),e.HEAP16=new Int16Array(t),e.HEAP32=E=new Int32Array(t),e.HEAPU8=T=new Uint8Array(t),e.HEAPU16=new Uint16Array(t),e.HEAPU32=M=new Uint32Array(t),e.HEAPF32=new Float32Array(t),e.HEAPF64=new Float64Array(t)}var U,F=[],I=[],W=[],H=[],L=0;function z(){var t=e.preRun.shift();F.unshift(t)}var Y,B=0,G=null,N=null;function V(t){throw e.onAbort&&e.onAbort(t),w(t="Aborted("+t+")"),C=!0,t=new WebAssembly.RuntimeError(t+". Build with -sASSERTIONS for more info."),a(t),t}function $(){return Y.startsWith("data:application/octet-stream;base64,")}if(Y="ort-wasm.wasm",!$()){var q=Y;Y=e.locateFile?e.locateFile(q,m):m+q}function X(){var t=Y;try{if(t==Y&&g)return new Uint8Array(g);if(u)return u(t);throw"both async and sync fetching of the wasm failed"}catch(t){V(t)}}function J(t){this.name="ExitStatus",this.message="Program terminated with exit("+t+")",this.status=t}function Z(t){for(;0>2>>>0]=t},this.Eb=function(){return M[this.zb+4>>2>>>0]},this.Sb=function(t){M[this.zb+8>>2>>>0]=t},this.Wb=function(){return M[this.zb+8>>2>>>0]},this.Tb=function(){E[this.zb>>2>>>0]=0},this.Ib=function(t){S[this.zb+12>>0>>>0]=t?1:0},this.Pb=function(){return 0!=S[this.zb+12>>0>>>0]},this.Jb=function(t){S[this.zb+13>>0>>>0]=t?1:0},this.Lb=function(){return 0!=S[this.zb+13>>0>>>0]},this.Rb=function(t,e){this.Fb(0),this.Ub(t),this.Sb(e),this.Tb(),this.Ib(!1),this.Jb(!1)},this.Nb=function(){E[this.zb>>2>>>0]+=1},this.Xb=function(){var t=E[this.zb>>2>>>0];return E[this.zb>>2>>>0]=t-1,1===t},this.Fb=function(t){M[this.zb+16>>2>>>0]=t},this.Ob=function(){return M[this.zb+16>>2>>>0]},this.Qb=function(){if(Mt(this.Eb()))return M[this.Db>>2>>>0];var t=this.Ob();return 0!==t?t:this.Db}}function nt(t){return vt(new et(t).zb)}var rt=[];function at(t){var e=rt[t];return e||(t>=rt.length&&(rt.length=t+1),rt[t]=e=U.get(t)),e}function it(t){var e=D(t)+1,n=gt(e);return n&&k(t,S,n,e),n}var ot={};function ut(){if(!ct){var t,e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:p||"./this.program"};for(t in ot)void 0===ot[t]?delete e[t]:e[t]=ot[t];var n=[];for(t in e)n.push(t+"="+e[t]);ct=n}return ct}var ct,st=[null,[],[]];function lt(t,e){var n=st[t];0===e||10===e?((1===t?v:w)(R(n,0)),n.length=0):n.push(e)}var ft=0;function pt(t){return 0==t%4&&(0!=t%100||0==t%400)}var ht=[31,29,31,30,31,30,31,31,30,31,30,31],dt=[31,28,31,30,31,30,31,31,30,31,30,31];function yt(t,e,n,r){function a(t,e,n){for(t="number"==typeof t?t.toString():t||"";t.lengtht?-1:0r-t.getDate())){t.setDate(t.getDate()+e);break}e-=r-t.getDate()+1,t.setDate(1),11>n?t.setMonth(n+1):(t.setMonth(0),t.setFullYear(t.getFullYear()+1))}return n=new Date(t.getFullYear()+1,0,4),e=u(new Date(t.getFullYear(),0,4)),n=u(n),0>=o(e,t)?0>=o(n,t)?t.getFullYear()+1:t.getFullYear():t.getFullYear()-1}var s=E[r+40>>2>>>0];for(var l in r={$b:E[r>>2>>>0],Zb:E[r+4>>2>>>0],Gb:E[r+8>>2>>>0],Kb:E[r+12>>2>>>0],Hb:E[r+16>>2>>>0],Cb:E[r+20>>2>>>0],Ab:E[r+24>>2>>>0],Bb:E[r+28>>2>>>0],bc:E[r+32>>2>>>0],Yb:E[r+36>>2>>>0],ac:s?j(s):""},n=j(n),s={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"})n=n.replace(new RegExp(l,"g"),s[l]);var f="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),p="January February March April May June July August September October November December".split(" ");for(l in s={"%a":function(t){return f[t.Ab].substring(0,3)},"%A":function(t){return f[t.Ab]},"%b":function(t){return p[t.Hb].substring(0,3)},"%B":function(t){return p[t.Hb]},"%C":function(t){return i((t.Cb+1900)/100|0,2)},"%d":function(t){return i(t.Kb,2)},"%e":function(t){return a(t.Kb,2," ")},"%g":function(t){return c(t).toString().substring(2)},"%G":function(t){return c(t)},"%H":function(t){return i(t.Gb,2)},"%I":function(t){return 0==(t=t.Gb)?t=12:12t.Gb?"AM":"PM"},"%S":function(t){return i(t.$b,2)},"%t":function(){return"\\t"},"%u":function(t){return t.Ab||7},"%U":function(t){return i(Math.floor((t.Bb+7-t.Ab)/7),2)},"%V":function(t){var e=Math.floor((t.Bb+7-(t.Ab+6)%7)/7);if(2>=(t.Ab+371-t.Bb-2)%7&&e++,e)53==e&&(4==(n=(t.Ab+371-t.Bb)%7)||3==n&&pt(t.Cb)||(e=1));else{e=52;var n=(t.Ab+7-t.Bb-1)%7;(4==n||5==n&&pt(t.Cb%400-1))&&e++}return i(e,2)},"%w":function(t){return t.Ab},"%W":function(t){return i(Math.floor((t.Bb+7-(t.Ab+6)%7)/7),2)},"%y":function(t){return(t.Cb+1900).toString().substring(2)},"%Y":function(t){return t.Cb+1900},"%z":function(t){var e=0<=(t=t.Yb);return t=Math.abs(t)/60,(e?"+":"-")+String("0000"+(t/60*100+t%60)).slice(-4)},"%Z":function(t){return t.ac},"%%":function(){return"%"}},n=n.replace(/%%/g,"\\0\\0"),s)n.includes(l)&&(n=n.replace(new RegExp(l,"g"),s[l](r)));return l=function(t){var e=Array(D(t)+1);return k(t,e,0,e.length),e}(n=n.replace(/\\0\\0/g,"%")),l.length>e?0:(S.set(l,t>>>0),l.length-1)}var bt={a:function(t){return gt(t+24)+24},m:function(t){return(t=new et(t)).Pb()||(t.Ib(!0),K--),t.Jb(!1),Q.push(t),t.Nb(),t.Qb()},ia:function(t){throw w("Unexpected exception thrown, this is not properly supported - aborting"),C=!0,t},w:function(){Ot(0);var t=Q.pop();if(t.Xb()&&!t.Lb()){var e=t.Wb();e&&at(e)(t.Db),nt(t.Db)}tt=0},d:function(){var t=tt;if(!t)return ft=0;var e=new et(t);e.Fb(t);var n=e.Eb();if(!n)return ft=0,t;for(var r=Array.prototype.slice.call(arguments),a=0;a>>2]+4294967296*E[t+4>>>2])),E[e>>2>>>0]=t.getUTCSeconds(),E[e+4>>2>>>0]=t.getUTCMinutes(),E[e+8>>2>>>0]=t.getUTCHours(),E[e+12>>2>>>0]=t.getUTCDate(),E[e+16>>2>>>0]=t.getUTCMonth(),E[e+20>>2>>>0]=t.getUTCFullYear()-1900,E[e+24>>2>>>0]=t.getUTCDay(),E[e+28>>2>>>0]=(t.getTime()-Date.UTC(t.getUTCFullYear(),0,1,0,0,0,0))/864e5|0},Ea:function(t,e){t=new Date(1e3*(M[t>>>2]+4294967296*E[t+4>>>2])),E[e>>2>>>0]=t.getSeconds(),E[e+4>>2>>>0]=t.getMinutes(),E[e+8>>2>>>0]=t.getHours(),E[e+12>>2>>>0]=t.getDate(),E[e+16>>2>>>0]=t.getMonth(),E[e+20>>2>>>0]=t.getFullYear()-1900,E[e+24>>2>>>0]=t.getDay();var n=new Date(t.getFullYear(),0,1);E[e+28>>2>>>0]=(t.getTime()-n.getTime())/864e5|0,E[e+36>>2>>>0]=-60*t.getTimezoneOffset();var r=new Date(t.getFullYear(),6,1).getTimezoneOffset();n=n.getTimezoneOffset(),E[e+32>>2>>>0]=0|(r!=n&&t.getTimezoneOffset()==Math.min(n,r))},Fa:function(t){var e=new Date(E[t+20>>2>>>0]+1900,E[t+16>>2>>>0],E[t+12>>2>>>0],E[t+8>>2>>>0],E[t+4>>2>>>0],E[t>>2>>>0],0),n=E[t+32>>2>>>0],r=e.getTimezoneOffset(),a=new Date(e.getFullYear(),0,1),i=new Date(e.getFullYear(),6,1).getTimezoneOffset(),o=a.getTimezoneOffset(),u=Math.min(o,i);return 0>n?E[t+32>>2>>>0]=Number(i!=o&&u==r):0>2>>>0]=e.getDay(),E[t+28>>2>>>0]=(e.getTime()-a.getTime())/864e5|0,E[t>>2>>>0]=e.getSeconds(),E[t+4>>2>>>0]=e.getMinutes(),E[t+8>>2>>>0]=e.getHours(),E[t+12>>2>>>0]=e.getDate(),E[t+16>>2>>>0]=e.getMonth(),e.getTime()/1e3|0},sa:function(){return-52},ta:function(){},Ga:function t(e,n,r){t.Vb||(t.Vb=!0,function(t,e,n){function r(t){return(t=t.toTimeString().match(/\\(([A-Za-z ]+)\\)$/))?t[1]:"GMT"}var a=(new Date).getFullYear(),i=new Date(a,0,1),o=new Date(a,6,1);a=i.getTimezoneOffset();var u=o.getTimezoneOffset();E[t>>2>>>0]=60*Math.max(a,u),E[e>>2>>>0]=Number(a!=u),t=r(i),e=r(o),t=it(t),e=it(e),u>2>>>0]=t,M[n+4>>2>>>0]=e):(M[n>>2>>>0]=e,M[n+4>>2>>>0]=t)}(e,n,r))},B:function(){V("")},ma:function(){return 4294901760},I:b?()=>{var t=process.hrtime();return 1e3*t[0]+t[1]/1e6}:()=>performance.now(),xa:function(t,e,n){T.copyWithin(t>>>0,e>>>0,e+n>>>0)},G:function(t){var e=T.length;if(4294901760<(t>>>=0))return!1;for(var n=1;4>=n;n*=2){var r=e*(1+.2/n);r=Math.min(r,t+100663296);var a=Math;r=Math.max(t,r),a=a.min.call(a,4294901760,r+(65536-r%65536)%65536);t:{try{O.grow(a-A.byteLength+65535>>>16),P();var i=1;break t}catch(t){}i=void 0}if(i)return!0}return!1},va:function(t,e){var n=0;return ut().forEach((function(r,a){var i=e+n;for(a=M[t+4*a>>2>>>0]=i,i=0;i>0>>>0]=r.charCodeAt(i);S[a>>0>>>0]=0,n+=r.length+1})),0},wa:function(t,e){var n=ut();M[t>>2>>>0]=n.length;var r=0;return n.forEach((function(t){r+=t.length+1})),M[e>>2>>>0]=r,0},ba:function(t){_||0>2>>>0],u=M[e+4>>2>>>0];e+=8;for(var c=0;c>>0]);a+=u}return M[r>>2>>>0]=a,0},c:function(){return ft},ja:function t(e,r){t.Mb||(t.Mb=function(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var t=new Uint8Array(1);return()=>(crypto.getRandomValues(t),t[0])}if(b)try{var e=n(Object(function(){var t=new Error("Cannot find module \'crypto\'");throw t.code="MODULE_NOT_FOUND",t}()));return()=>e.randomBytes(1)[0]}catch(t){}return()=>V("randomDevice")}());for(var a=0;a>0>>>0]=t.Mb();return 0},ea:function(t,e,n){var r=At();try{return at(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;Ot(1,0)}},fa:function(t,e,n){var r=At();try{return at(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;Ot(1,0)}},J:function(t){var e=At();try{return at(t)()}catch(t){if(St(e),t!==t+0)throw t;Ot(1,0)}},e:function(t,e){var n=At();try{return at(t)(e)}catch(t){if(St(n),t!==t+0)throw t;Ot(1,0)}},N:function(t,e,n){var r=At();try{return at(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;Ot(1,0)}},O:function(t,e,n){var r=At();try{return at(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;Ot(1,0)}},j:function(t,e,n){var r=At();try{return at(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;Ot(1,0)}},o:function(t,e,n,r){var a=At();try{return at(t)(e,n,r)}catch(t){if(St(a),t!==t+0)throw t;Ot(1,0)}},p:function(t,e,n,r,a){var i=At();try{return at(t)(e,n,r,a)}catch(t){if(St(i),t!==t+0)throw t;Ot(1,0)}},M:function(t,e,n,r,a,i){var o=At();try{return at(t)(e,n,r,a,i)}catch(t){if(St(o),t!==t+0)throw t;Ot(1,0)}},r:function(t,e,n,r,a,i){var o=At();try{return at(t)(e,n,r,a,i)}catch(t){if(St(o),t!==t+0)throw t;Ot(1,0)}},v:function(t,e,n,r,a,i,o){var u=At();try{return at(t)(e,n,r,a,i,o)}catch(t){if(St(u),t!==t+0)throw t;Ot(1,0)}},K:function(t,e,n,r,a,i,o,u){var c=At();try{return at(t)(e,n,r,a,i,o,u)}catch(t){if(St(c),t!==t+0)throw t;Ot(1,0)}},D:function(t,e,n,r,a,i,o,u,c,s,l,f){var p=At();try{return at(t)(e,n,r,a,i,o,u,c,s,l,f)}catch(t){if(St(p),t!==t+0)throw t;Ot(1,0)}},X:function(t,e,n,r,a,i,o,u){var c=At();try{return Ft(t,e,n,r,a,i,o,u)}catch(t){if(St(c),t!==t+0)throw t;Ot(1,0)}},V:function(t,e,n,r,a,i,o){var u=At();try{return xt(t,e,n,r,a,i,o)}catch(t){if(St(u),t!==t+0)throw t;Ot(1,0)}},U:function(t,e,n,r,a){var i=At();try{return It(t,e,n,r,a)}catch(t){if(St(i),t!==t+0)throw t;Ot(1,0)}},Z:function(t,e,n,r){var a=At();try{return Pt(t,e,n,r)}catch(t){if(St(a),t!==t+0)throw t;Ot(1,0)}},W:function(t){var e=At();try{return Ct(t)}catch(t){if(St(e),t!==t+0)throw t;Ot(1,0)}},Y:function(t,e){var n=At();try{return Ut(t,e)}catch(t){if(St(n),t!==t+0)throw t;Ot(1,0)}},T:function(t,e,n){var r=At();try{return Rt(t,e,n)}catch(t){if(St(r),t!==t+0)throw t;Ot(1,0)}},f:function(t){var e=At();try{at(t)()}catch(t){if(St(e),t!==t+0)throw t;Ot(1,0)}},q:function(t,e){var n=At();try{at(t)(e)}catch(t){if(St(n),t!==t+0)throw t;Ot(1,0)}},h:function(t,e,n){var r=At();try{at(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;Ot(1,0)}},da:function(t,e,n,r){var a=At();try{at(t)(e,n,r)}catch(t){if(St(a),t!==t+0)throw t;Ot(1,0)}},l:function(t,e,n,r){var a=At();try{at(t)(e,n,r)}catch(t){if(St(a),t!==t+0)throw t;Ot(1,0)}},t:function(t,e,n,r,a){var i=At();try{at(t)(e,n,r,a)}catch(t){if(St(i),t!==t+0)throw t;Ot(1,0)}},u:function(t,e,n,r,a,i){var o=At();try{at(t)(e,n,r,a,i)}catch(t){if(St(o),t!==t+0)throw t;Ot(1,0)}},x:function(t,e,n,r,a,i,o){var u=At();try{at(t)(e,n,r,a,i,o)}catch(t){if(St(u),t!==t+0)throw t;Ot(1,0)}},z:function(t,e,n,r,a,i,o,u){var c=At();try{at(t)(e,n,r,a,i,o,u)}catch(t){if(St(c),t!==t+0)throw t;Ot(1,0)}},ga:function(t,e,n,r,a,i,o,u,c){var s=At();try{at(t)(e,n,r,a,i,o,u,c)}catch(t){if(St(s),t!==t+0)throw t;Ot(1,0)}},A:function(t,e,n,r,a,i,o,u,c,s,l){var f=At();try{at(t)(e,n,r,a,i,o,u,c,s,l)}catch(t){if(St(f),t!==t+0)throw t;Ot(1,0)}},C:function(t,e,n,r,a,i,o,u,c,s,l,f,p,h,d,y){var b=At();try{at(t)(e,n,r,a,i,o,u,c,s,l,f,p,h,d,y)}catch(t){if(St(b),t!==t+0)throw t;Ot(1,0)}},aa:function(t,e,n,r,a,i,o,u){var c=At();try{jt(t,e,n,r,a,i,o,u)}catch(t){if(St(c),t!==t+0)throw t;Ot(1,0)}},_:function(t,e,n,r,a,i,o,u,c,s,l,f){var p=At();try{Dt(t,e,n,r,a,i,o,u,c,s,l,f)}catch(t){if(St(p),t!==t+0)throw t;Ot(1,0)}},$:function(t,e,n,r,a,i){var o=At();try{kt(t,e,n,r,a,i)}catch(t){if(St(o),t!==t+0)throw t;Ot(1,0)}},n:function(t){return t},F:function(t){ft=t},ha:yt,y:function(t,e,n,r){return yt(t,e,n,r)}};!function(){function t(t){e.asm=t.exports,O=e.asm.Ka,P(),U=e.asm.ib,I.unshift(e.asm.La),B--,e.monitorRunDependencies&&e.monitorRunDependencies(B),0==B&&(null!==G&&(clearInterval(G),G=null),N&&(t=N,N=null,t()))}function n(e){t(e.instance)}function r(t){return function(){if(!g&&(d||y)){if("function"==typeof fetch&&!Y.startsWith("file://"))return fetch(Y,{credentials:"same-origin"}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at \'"+Y+"\'";return t.arrayBuffer()})).catch((function(){return X()}));if(o)return new Promise((function(t,e){o(Y,(function(e){t(new Uint8Array(e))}),e)}))}return Promise.resolve().then((function(){return X()}))}().then((function(t){return WebAssembly.instantiate(t,i)})).then((function(t){return t})).then(t,(function(t){w("failed to asynchronously prepare wasm: "+t),V(t)}))}var i={a:bt};if(B++,e.monitorRunDependencies&&e.monitorRunDependencies(B),e.instantiateWasm)try{return e.instantiateWasm(i,t)}catch(t){return w("Module.instantiateWasm callback failed with error: "+t),!1}(g||"function"!=typeof WebAssembly.instantiateStreaming||$()||Y.startsWith("file://")||b||"function"!=typeof fetch?r(n):fetch(Y,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,i).then(n,(function(t){return w("wasm streaming compile failed: "+t),w("falling back to ArrayBuffer instantiation"),r(n)}))}))).catch(a)}(),e.___wasm_call_ctors=function(){return(e.___wasm_call_ctors=e.asm.La).apply(null,arguments)},e._OrtInit=function(){return(e._OrtInit=e.asm.Ma).apply(null,arguments)},e._OrtCreateSessionOptions=function(){return(e._OrtCreateSessionOptions=e.asm.Na).apply(null,arguments)},e._OrtAppendExecutionProvider=function(){return(e._OrtAppendExecutionProvider=e.asm.Oa).apply(null,arguments)},e._OrtAddSessionConfigEntry=function(){return(e._OrtAddSessionConfigEntry=e.asm.Pa).apply(null,arguments)},e._OrtReleaseSessionOptions=function(){return(e._OrtReleaseSessionOptions=e.asm.Qa).apply(null,arguments)},e._OrtCreateSession=function(){return(e._OrtCreateSession=e.asm.Ra).apply(null,arguments)},e._OrtReleaseSession=function(){return(e._OrtReleaseSession=e.asm.Sa).apply(null,arguments)},e._OrtGetInputCount=function(){return(e._OrtGetInputCount=e.asm.Ta).apply(null,arguments)},e._OrtGetOutputCount=function(){return(e._OrtGetOutputCount=e.asm.Ua).apply(null,arguments)},e._OrtGetInputName=function(){return(e._OrtGetInputName=e.asm.Va).apply(null,arguments)},e._OrtGetOutputName=function(){return(e._OrtGetOutputName=e.asm.Wa).apply(null,arguments)},e._OrtFree=function(){return(e._OrtFree=e.asm.Xa).apply(null,arguments)},e._OrtCreateTensor=function(){return(e._OrtCreateTensor=e.asm.Ya).apply(null,arguments)},e._OrtGetTensorData=function(){return(e._OrtGetTensorData=e.asm.Za).apply(null,arguments)},e._OrtReleaseTensor=function(){return(e._OrtReleaseTensor=e.asm._a).apply(null,arguments)},e._OrtCreateRunOptions=function(){return(e._OrtCreateRunOptions=e.asm.$a).apply(null,arguments)},e._OrtAddRunConfigEntry=function(){return(e._OrtAddRunConfigEntry=e.asm.ab).apply(null,arguments)},e._OrtReleaseRunOptions=function(){return(e._OrtReleaseRunOptions=e.asm.bb).apply(null,arguments)},e._OrtRun=function(){return(e._OrtRun=e.asm.cb).apply(null,arguments)},e._OrtEndProfiling=function(){return(e._OrtEndProfiling=e.asm.db).apply(null,arguments)};var mt,gt=e._malloc=function(){return(gt=e._malloc=e.asm.eb).apply(null,arguments)},vt=e._free=function(){return(vt=e._free=e.asm.fb).apply(null,arguments)},wt=e._fflush=function(){return(wt=e._fflush=e.asm.gb).apply(null,arguments)},_t=e.___funcs_on_exit=function(){return(_t=e.___funcs_on_exit=e.asm.hb).apply(null,arguments)},Ot=e._setThrew=function(){return(Ot=e._setThrew=e.asm.jb).apply(null,arguments)},At=e.stackSave=function(){return(At=e.stackSave=e.asm.kb).apply(null,arguments)},St=e.stackRestore=function(){return(St=e.stackRestore=e.asm.lb).apply(null,arguments)},Tt=e.stackAlloc=function(){return(Tt=e.stackAlloc=e.asm.mb).apply(null,arguments)},Et=e.___cxa_can_catch=function(){return(Et=e.___cxa_can_catch=e.asm.nb).apply(null,arguments)},Mt=e.___cxa_is_pointer_type=function(){return(Mt=e.___cxa_is_pointer_type=e.asm.ob).apply(null,arguments)},Ct=e.dynCall_j=function(){return(Ct=e.dynCall_j=e.asm.pb).apply(null,arguments)},xt=e.dynCall_iiiiij=function(){return(xt=e.dynCall_iiiiij=e.asm.qb).apply(null,arguments)},Rt=e.dynCall_jii=function(){return(Rt=e.dynCall_jii=e.asm.rb).apply(null,arguments)},jt=e.dynCall_viiiiij=function(){return(jt=e.dynCall_viiiiij=e.asm.sb).apply(null,arguments)},kt=e.dynCall_vjji=function(){return(kt=e.dynCall_vjji=e.asm.tb).apply(null,arguments)},Dt=e.dynCall_viiijjjii=function(){return(Dt=e.dynCall_viiijjjii=e.asm.ub).apply(null,arguments)},Pt=e.dynCall_iij=function(){return(Pt=e.dynCall_iij=e.asm.vb).apply(null,arguments)},Ut=e.dynCall_ji=function(){return(Ut=e.dynCall_ji=e.asm.wb).apply(null,arguments)},Ft=e.dynCall_iiiiiij=function(){return(Ft=e.dynCall_iiiiiij=e.asm.xb).apply(null,arguments)},It=e.dynCall_iiij=function(){return(It=e.dynCall_iiij=e.asm.yb).apply(null,arguments)};function Wt(){function t(){if(!mt&&(mt=!0,e.calledRun=!0,!C)){if(Z(I),r(e),e.onRuntimeInitialized&&e.onRuntimeInitialized(),e.postRun)for("function"==typeof e.postRun&&(e.postRun=[e.postRun]);e.postRun.length;){var t=e.postRun.shift();H.unshift(t)}Z(H)}}if(!(0{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.iterateExtraOptions=void 0,e.iterateExtraOptions=(t,n,r,a)=>{if("object"==typeof t&&null!==t){if(r.has(t))throw new Error("Circular reference in options");r.add(t)}Object.entries(t).forEach((([t,i])=>{const o=n?n+t:t;if("object"==typeof i)(0,e.iterateExtraOptions)(i,o+".",r,a);else if("string"==typeof i||"number"==typeof i)a(o,i.toString());else{if("boolean"!=typeof i)throw new Error("Can\'t handle extra config type: "+typeof i);a(o,i?"1":"0")}}))}},586:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.setRunOptions=void 0;const r=n(967),a=n(983),i=n(361);e.setRunOptions=t=>{const e=(0,i.getInstance)();let n=0;const o=[],u=t||{};try{if(void 0===(null==t?void 0:t.logSeverityLevel))u.logSeverityLevel=2;else if("number"!=typeof t.logSeverityLevel||!Number.isInteger(t.logSeverityLevel)||t.logSeverityLevel<0||t.logSeverityLevel>4)throw new Error(`log serverity level is not valid: ${t.logSeverityLevel}`);if(void 0===(null==t?void 0:t.logVerbosityLevel))u.logVerbosityLevel=0;else if("number"!=typeof t.logVerbosityLevel||!Number.isInteger(t.logVerbosityLevel))throw new Error(`log verbosity level is not valid: ${t.logVerbosityLevel}`);void 0===(null==t?void 0:t.terminate)&&(u.terminate=!1);let i=0;if(void 0!==(null==t?void 0:t.tag)&&(i=(0,a.allocWasmString)(t.tag,o)),n=e._OrtCreateRunOptions(u.logSeverityLevel,u.logVerbosityLevel,!!u.terminate,i),0===n)throw new Error("Can\'t create run options");return void 0!==(null==t?void 0:t.extra)&&(0,r.iterateExtraOptions)(t.extra,"",new WeakSet,((t,r)=>{const i=(0,a.allocWasmString)(t,o),u=(0,a.allocWasmString)(r,o);if(0!==e._OrtAddRunConfigEntry(n,i,u))throw new Error(`Can\'t set a run config entry: ${t} - ${r}`)})),[n,o]}catch(t){throw 0!==n&&e._OrtReleaseRunOptions(n),o.forEach(e._free),t}}},919:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.setSessionOptions=void 0;const r=n(967),a=n(983),i=n(361);e.setSessionOptions=t=>{const e=(0,i.getInstance)();let n=0;const o=[],u=t||{};(t=>{t.extra||(t.extra={}),t.extra.session||(t.extra.session={});const e=t.extra.session;e.use_ort_model_bytes_directly||(e.use_ort_model_bytes_directly="1")})(u);try{void 0===(null==t?void 0:t.graphOptimizationLevel)&&(u.graphOptimizationLevel="all");const c=(t=>{switch(t){case"disabled":return 0;case"basic":return 1;case"extended":return 2;case"all":return 99;default:throw new Error(`unsupported graph optimization level: ${t}`)}})(u.graphOptimizationLevel);void 0===(null==t?void 0:t.enableCpuMemArena)&&(u.enableCpuMemArena=!0),void 0===(null==t?void 0:t.enableMemPattern)&&(u.enableMemPattern=!0),void 0===(null==t?void 0:t.executionMode)&&(u.executionMode="sequential");const s=(t=>{switch(t){case"sequential":return 0;case"parallel":return 1;default:throw new Error(`unsupported execution mode: ${t}`)}})(u.executionMode);let l=0;if(void 0!==(null==t?void 0:t.logId)&&(l=(0,a.allocWasmString)(t.logId,o)),void 0===(null==t?void 0:t.logSeverityLevel))u.logSeverityLevel=2;else if("number"!=typeof t.logSeverityLevel||!Number.isInteger(t.logSeverityLevel)||t.logSeverityLevel<0||t.logSeverityLevel>4)throw new Error(`log serverity level is not valid: ${t.logSeverityLevel}`);if(void 0===(null==t?void 0:t.logVerbosityLevel))u.logVerbosityLevel=0;else if("number"!=typeof t.logVerbosityLevel||!Number.isInteger(t.logVerbosityLevel))throw new Error(`log verbosity level is not valid: ${t.logVerbosityLevel}`);if(void 0===(null==t?void 0:t.enableProfiling)&&(u.enableProfiling=!1),n=e._OrtCreateSessionOptions(c,!!u.enableCpuMemArena,!!u.enableMemPattern,s,!!u.enableProfiling,0,l,u.logSeverityLevel,u.logVerbosityLevel),0===n)throw new Error("Can\'t create session options");return(null==t?void 0:t.executionProviders)&&((t,e,n)=>{for(const r of e){let e="string"==typeof r?r:r.name;switch(e){case"xnnpack":e="XNNPACK";break;case"wasm":case"cpu":continue;default:throw new Error(`not supported EP: ${e}`)}const o=(0,a.allocWasmString)(e,n);if(0!==(0,i.getInstance)()._OrtAppendExecutionProvider(t,o))throw new Error(`Can\'t append execution provider: ${e}`)}})(n,t.executionProviders,o),void 0!==(null==t?void 0:t.extra)&&(0,r.iterateExtraOptions)(t.extra,"",new WeakSet,((t,r)=>{const i=(0,a.allocWasmString)(t,o),u=(0,a.allocWasmString)(r,o);if(0!==e._OrtAddSessionConfigEntry(n,i,u))throw new Error(`Can\'t set a session config entry: ${t} - ${r}`)})),[n,o]}catch(t){throw 0!==n&&e._OrtReleaseSessionOptions(n),o.forEach(e._free),t}}},983:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.allocWasmString=void 0;const r=n(361);e.allocWasmString=(t,e)=>{const n=(0,r.getInstance)(),a=n.lengthBytesUTF8(t)+1,i=n._malloc(a);return n.stringToUTF8(t,i,a),e.push(i),i}},349:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.extractTransferableBuffers=e.endProfiling=e.run=e.releaseSession=e.createSession=e.createSessionFinalize=e.createSessionAllocate=e.initOrt=void 0;const r=n(586),a=n(919),i=n(983),o=n(361);e.initOrt=(t,e)=>{const n=(0,o.getInstance)()._OrtInit(t,e);if(0!==n)throw new Error(`Can\'t initialize onnxruntime. error code = ${n}`)};const u=new Map;e.createSessionAllocate=t=>{const e=(0,o.getInstance)(),n=e._malloc(t.byteLength);return e.HEAPU8.set(t,n),[n,t.byteLength]},e.createSessionFinalize=(t,e)=>{const n=(0,o.getInstance)();let r=0,i=0,c=[];try{if([i,c]=(0,a.setSessionOptions)(e),r=n._OrtCreateSession(t[0],t[1],i),0===r)throw new Error("Can\'t create a session")}finally{n._free(t[0]),n._OrtReleaseSessionOptions(i),c.forEach(n._free)}const s=n._OrtGetInputCount(r),l=n._OrtGetOutputCount(r),f=[],p=[],h=[],d=[];for(let t=0;t{const r=(0,e.createSessionAllocate)(t);return(0,e.createSessionFinalize)(r,n)},e.releaseSession=t=>{const e=(0,o.getInstance)(),n=u.get(t);if(!n)throw new Error("invalid session id");const r=n[0],a=n[1],i=n[2];a.forEach(e._OrtFree),i.forEach(e._OrtFree),e._OrtReleaseSession(r),u.delete(t)};const c=t=>{switch(t){case"int8":return 3;case"uint8":return 2;case"bool":return 9;case"int16":return 5;case"uint16":return 4;case"int32":return 6;case"uint32":return 12;case"float32":return 1;case"float64":return 11;case"string":return 8;case"int64":return 7;case"uint64":return 13;default:throw new Error(`unsupported data type: ${t}`)}},s=t=>{switch(t){case 3:return"int8";case 2:return"uint8";case 9:return"bool";case 5:return"int16";case 4:return"uint16";case 6:return"int32";case 12:return"uint32";case 1:return"float32";case 11:return"float64";case 8:return"string";case 7:return"int64";case 13:return"uint64";default:throw new Error(`unsupported data type: ${t}`)}},l=t=>{switch(t){case"float32":return Float32Array;case"uint8":case"bool":return Uint8Array;case"int8":return Int8Array;case"uint16":return Uint16Array;case"int16":return Int16Array;case"int32":return Int32Array;case"float64":return Float64Array;case"uint32":return Uint32Array;case"int64":return BigInt64Array;case"uint64":return BigUint64Array;default:throw new Error(`unsupported type: ${t}`)}};e.run=(t,e,n,a,f)=>{const p=(0,o.getInstance)(),h=u.get(t);if(!h)throw new Error("invalid session id");const d=h[0],y=h[1],b=h[2],m=e.length,g=a.length;let v=0,w=[];const _=[],O=[];try{[v,w]=(0,r.setRunOptions)(f);for(let t=0;tp.HEAP32[t++]=e));const n=p._OrtCreateTensor(c(e),o,u,l,r.length);if(0===n)throw new Error("Can\'t create a tensor");_.push(n)}finally{p.stackRestore(s)}}const t=p.stackSave(),o=p.stackAlloc(4*m),u=p.stackAlloc(4*m),h=p.stackAlloc(4*g),A=p.stackAlloc(4*g);try{let n=o/4,r=u/4,i=h/4,c=A/4;for(let t=0;tt*e));if(a=s(o),"string"===a){const t=[];let e=i/4;for(let n=0;n{const e=(0,o.getInstance)(),n=u.get(t);if(!n)throw new Error("invalid session id");const r=n[0],a=e._OrtEndProfiling(r);if(0===a)throw new Error("Can\'t get an profile file name");e._OrtFree(a)},e.extractTransferableBuffers=t=>{const e=[];for(const n of t){const t=n[2];!Array.isArray(t)&&t.buffer&&e.push(t.buffer)}return e}},361:function(t,e,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n);var a=Object.getOwnPropertyDescriptor(e,n);a&&!("get"in a?!e.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,a)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),a=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&r(e,t,n);return a(e,t),e},o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.dispose=e.getInstance=e.initializeWebAssembly=void 0;const u=i(n(449)),c=o(n(932)),s=n(474);let l,f=!1,p=!1,h=!1;const d=(t,e)=>e?t?"ort-wasm-simd-threaded.wasm":"ort-wasm-threaded.wasm":t?"ort-wasm-simd.wasm":"ort-wasm.wasm";e.initializeWebAssembly=async t=>{if(f)return Promise.resolve();if(p)throw new Error("multiple calls to \'initializeWebAssembly()\' detected.");if(h)throw new Error("previous call to \'initializeWebAssembly()\' failed.");p=!0;const e=t.initTimeout,r=t.numThreads,a=t.simd,i=r>1&&(()=>{try{return"undefined"!=typeof SharedArrayBuffer&&("undefined"!=typeof MessageChannel&&(new MessageChannel).port1.postMessage(new SharedArrayBuffer(1)),WebAssembly.validate(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])))}catch(t){return!1}})(),o=a&&(()=>{try{return WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,30,1,28,0,65,0,253,15,253,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,253,186,1,26,11]))}catch(t){return!1}})(),y="string"==typeof t.wasmPaths?t.wasmPaths:void 0,b=d(!1,i),m=d(o,i),g="object"==typeof t.wasmPaths?t.wasmPaths[m]:void 0;let v=!1;const w=[];if(e>0&&w.push(new Promise((t=>{setTimeout((()=>{v=!0,t()}),e)}))),w.push(new Promise(((t,e)=>{const r=i?s:c.default,a={locateFile:(t,e)=>i&&t.endsWith(".worker.js")&&"undefined"!=typeof Blob?URL.createObjectURL(new Blob([n(154)],{type:"text/javascript"})):t===b?null!=g?g:(null!=y?y:e)+m:e+t};if(i)if("undefined"==typeof Blob)a.mainScriptUrlOrBlob=u.join("/","ort-wasm-threaded.js");else{const t=`var ortWasmThreaded=(function(){var _scriptDir;return ${r.toString()}})();`;a.mainScriptUrlOrBlob=new Blob([t],{type:"text/javascript"})}r(a).then((e=>{p=!1,f=!0,l=e,t()}),(t=>{p=!1,h=!0,e(t)}))}))),await Promise.race(w),v)throw new Error(`WebAssembly backend initializing failed due to timeout: ${e}ms`)},e.getInstance=()=>{if(f&&l)return l;throw new Error("WebAssembly is not initialized yet.")},e.dispose=()=>{var t;!f||p||h||(p=!0,null===(t=l.PThread)||void 0===t||t.terminateAllThreads(),l=void 0,p=!1,f=!1,h=!0)}},154:t=>{"use strict";t.exports=\'"use strict";var e={},t="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node;if(t){var r=require("worker_threads"),a=r.parentPort;a.on("message",(e=>onmessage({data:e})));var o=require("fs");Object.assign(global,{self:global,require:require,Module:e,location:{href:__filename},Worker:r.Worker,importScripts:function(e){(0,eval)(o.readFileSync(e,"utf8"))},postMessage:function(e){a.postMessage(e)},performance:global.performance||{now:function(){return Date.now()}}})}var s=!1,n=[],i=function(){var e=Array.prototype.slice.call(arguments).join(" ");t?o.writeSync(2,e+"\\\\n"):console.error(e)};self.alert=function(){var t=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:t,threadId:e._pthread_self()})},e.instantiateWasm=(t,r)=>{var a=new WebAssembly.Instance(e.wasmModule,t);return r(a),e.wasmModule=null,a.exports},self.onunhandledrejection=e=>{throw e.reason??e},self.onmessage=t=>{try{if("load"===t.data.cmd){if(e.wasmModule=t.data.wasmModule,e.wasmMemory=t.data.wasmMemory,e.buffer=e.wasmMemory.buffer,e.ENVIRONMENT_IS_PTHREAD=!0,"string"==typeof t.data.urlOrBlob)importScripts(t.data.urlOrBlob);else{var r=URL.createObjectURL(t.data.urlOrBlob);importScripts(r),URL.revokeObjectURL(r)}ortWasmThreaded(e).then((function(t){e=t}))}else if("run"===t.data.cmd){e.__performance_now_clock_drift=performance.now()-t.data.time,e.__emscripten_thread_init(t.data.pthread_ptr,0,0,1),e.establishStackSpace(),e.PThread.receiveObjectTransfer(t.data),e.PThread.threadInitTLS(),s||(n.forEach((t=>{e.executeNotifiedProxyingQueue(t)})),n=[],s=!0);try{e.invokeEntryPoint(t.data.start_routine,t.data.arg)}catch(t){if("unwind"!=t){if(!(t instanceof e.ExitStatus))throw t;e.keepRuntimeAlive()||e.__emscripten_thread_exit(t.status)}}}else"cancel"===t.data.cmd?e._pthread_self()&&e.__emscripten_thread_exit(-1):"setimmediate"===t.data.target||("processProxyingQueue"===t.data.cmd?s?e.executeNotifiedProxyingQueue(t.data.queue):n.push(t.data.queue):(i("worker.js received unknown command "+t.data.cmd),i(t.data)))}catch(t){throw i("worker.js onmessage() captured an uncaught exception: "+t),t&&t.stack&&i(t.stack),e.__emscripten_thread_crashed&&e.__emscripten_thread_crashed(),t}};\\n\'},384:()=>{},993:()=>{},908:()=>{},953:()=>{},925:()=>{},449:()=>{}},e={};function n(r){var a=e[r];if(void 0!==a)return a.exports;var i=e[r]={exports:{}};return t[r].call(i.exports,i,i.exports,n),i.exports}n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),(()=>{"use strict";const t=n(349),e=n(361);self.onmessage=n=>{switch(n.data.type){case"init-wasm":(0,e.initializeWebAssembly)(n.data.in).then((()=>postMessage({type:"init-wasm"})),(t=>postMessage({type:"init-wasm",err:t})));break;case"init-ort":try{const{numThreads:e,loggingLevel:r}=n.data.in;(0,t.initOrt)(e,r),postMessage({type:"init-ort"})}catch(t){postMessage({type:"init-ort",err:t})}break;case"create_allocate":try{const{model:e}=n.data.in,r=(0,t.createSessionAllocate)(e);postMessage({type:"create_allocate",out:r})}catch(t){postMessage({type:"create_allocate",err:t})}break;case"create_finalize":try{const{modeldata:e,options:r}=n.data.in,a=(0,t.createSessionFinalize)(e,r);postMessage({type:"create_finalize",out:a})}catch(t){postMessage({type:"create_finalize",err:t})}break;case"create":try{const{model:e,options:r}=n.data.in,a=(0,t.createSession)(e,r);postMessage({type:"create",out:a})}catch(t){postMessage({type:"create",err:t})}break;case"release":try{const e=n.data.in;(0,t.releaseSession)(e),postMessage({type:"release"})}catch(t){postMessage({type:"release",err:t})}break;case"run":try{const{sessionId:e,inputIndices:r,inputs:a,outputIndices:i,options:o}=n.data.in,u=(0,t.run)(e,r,a,i,o);postMessage({type:"run",out:u},(0,t.extractTransferableBuffers)(u))}catch(t){postMessage({type:"run",err:t})}break;case"end-profiling":try{const e=n.data.in;(0,t.endProfiling)(e),postMessage({type:"end-profiling"})}catch(t){postMessage({type:"end-profiling",err:t})}}}})()})();\n',"Worker",void 0,void 0)}},477:f=>{f.exports=function(r,c,d,l){var m=self||window;try{try{var s;try{s=new m.Blob([r])}catch{(s=new(m.BlobBuilder||m.WebKitBlobBuilder||m.MozBlobBuilder||m.MSBlobBuilder)).append(r),s=s.getBlob()}var h=m.URL||m.webkitURL,p=h.createObjectURL(s),a=new m[c](p,d);return h.revokeObjectURL(p),a}catch{return new m[c]("data:application/javascript,".concat(encodeURIComponent(r)),d)}}catch{if(!l)throw Error("Inline worker is not supported");return new m[c](l,d)}}},4154:f=>{f.exports=`"use strict";var e={},t="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node;if(t){var r=require("worker_threads"),a=r.parentPort;a.on("message",(e=>onmessage({data:e})));var o=require("fs");Object.assign(global,{self:global,require:require,Module:e,location:{href:__filename},Worker:r.Worker,importScripts:function(e){(0,eval)(o.readFileSync(e,"utf8"))},postMessage:function(e){a.postMessage(e)},performance:global.performance||{now:function(){return Date.now()}}})}var s=!1,n=[],i=function(){var e=Array.prototype.slice.call(arguments).join(" ");t?o.writeSync(2,e+"\\n"):console.error(e)};self.alert=function(){var t=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:t,threadId:e._pthread_self()})},e.instantiateWasm=(t,r)=>{var a=new WebAssembly.Instance(e.wasmModule,t);return r(a),e.wasmModule=null,a.exports},self.onunhandledrejection=e=>{throw e.reason??e},self.onmessage=t=>{try{if("load"===t.data.cmd){if(e.wasmModule=t.data.wasmModule,e.wasmMemory=t.data.wasmMemory,e.buffer=e.wasmMemory.buffer,e.ENVIRONMENT_IS_PTHREAD=!0,"string"==typeof t.data.urlOrBlob)importScripts(t.data.urlOrBlob);else{var r=URL.createObjectURL(t.data.urlOrBlob);importScripts(r),URL.revokeObjectURL(r)}ortWasmThreaded(e).then((function(t){e=t}))}else if("run"===t.data.cmd){e.__performance_now_clock_drift=performance.now()-t.data.time,e.__emscripten_thread_init(t.data.pthread_ptr,0,0,1),e.establishStackSpace(),e.PThread.receiveObjectTransfer(t.data),e.PThread.threadInitTLS(),s||(n.forEach((t=>{e.executeNotifiedProxyingQueue(t)})),n=[],s=!0);try{e.invokeEntryPoint(t.data.start_routine,t.data.arg)}catch(t){if("unwind"!=t){if(!(t instanceof e.ExitStatus))throw t;e.keepRuntimeAlive()||e.__emscripten_thread_exit(t.status)}}}else"cancel"===t.data.cmd?e._pthread_self()&&e.__emscripten_thread_exit(-1):"setimmediate"===t.data.target||("processProxyingQueue"===t.data.cmd?s?e.executeNotifiedProxyingQueue(t.data.queue):n.push(t.data.queue):(i("worker.js received unknown command "+t.data.cmd),i(t.data)))}catch(t){throw i("worker.js onmessage() captured an uncaught exception: "+t),t&&t.stack&&i(t.stack),e.__emscripten_thread_crashed&&e.__emscripten_thread_crashed(),t}}; +`},1670:f=>{f.exports=__WEBPACK_EXTERNAL_MODULE__1670__},7067:()=>{},1296:()=>{},1384:()=>{},3993:()=>{},908:()=>{},6953:()=>{},9925:()=>{},2806:()=>{},6449:()=>{},2850:()=>{},5381:()=>{},5686:(f,r,c)=>{c.r(r),c.d(r,{flatbuffers:()=>d});var d={};d.Offset,d.Table,d.SIZEOF_SHORT=2,d.SIZEOF_INT=4,d.FILE_IDENTIFIER_LENGTH=4,d.SIZE_PREFIX_LENGTH=4,d.Encoding={UTF8_BYTES:1,UTF16_STRING:2},d.int32=new Int32Array(2),d.float32=new Float32Array(d.int32.buffer),d.float64=new Float64Array(d.int32.buffer),d.isLittleEndian=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1,d.Long=function(l,m){this.low=0|l,this.high=0|m},d.Long.create=function(l,m){return l==0&&m==0?d.Long.ZERO:new d.Long(l,m)},d.Long.prototype.toFloat64=function(){return(this.low>>>0)+4294967296*this.high},d.Long.prototype.equals=function(l){return this.low==l.low&&this.high==l.high},d.Long.ZERO=new d.Long(0,0),d.Builder=function(l){if(l)m=l;else var m=1024;this.bb=d.ByteBuffer.allocate(m),this.space=m,this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1},d.Builder.prototype.clear=function(){this.bb.clear(),this.space=this.bb.capacity(),this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1},d.Builder.prototype.forceDefaults=function(l){this.force_defaults=l},d.Builder.prototype.dataBuffer=function(){return this.bb},d.Builder.prototype.asUint8Array=function(){return this.bb.bytes().subarray(this.bb.position(),this.bb.position()+this.offset())},d.Builder.prototype.prep=function(l,m){l>this.minalign&&(this.minalign=l);for(var s=1+~(this.bb.capacity()-this.space+m)&l-1;this.space=0&&this.vtable[m]==0;m--);for(var s=m+1;m>=0;m--)this.addInt16(this.vtable[m]!=0?l-this.vtable[m]:0);this.addInt16(l-this.object_start);var h=(s+2)*d.SIZEOF_SHORT;this.addInt16(h);var p=0,a=this.space;e:for(m=0;m=0;a--)this.writeInt8(p.charCodeAt(a))}this.prep(this.minalign,d.SIZEOF_INT+h),this.addOffset(l),h&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)},d.Builder.prototype.finishSizePrefixed=function(l,m){this.finish(l,m,!0)},d.Builder.prototype.requiredField=function(l,m){var s=this.bb.capacity()-l,h=s-this.bb.readInt32(s);if(this.bb.readInt16(h+m)==0)throw new Error("FlatBuffers: field "+m+" must be set")},d.Builder.prototype.startVector=function(l,m,s){this.notNested(),this.vector_num_elems=m,this.prep(d.SIZEOF_INT,l*m),this.prep(s,l*m)},d.Builder.prototype.endVector=function(){return this.writeInt32(this.vector_num_elems),this.offset()},d.Builder.prototype.createString=function(l){if(l instanceof Uint8Array)var m=l;else{m=[];for(var s=0;s=56320?p:(p<<10)+l.charCodeAt(s++)+-56613888)<128?m.push(h):(h<2048?m.push(h>>6&31|192):(h<65536?m.push(h>>12&15|224):m.push(h>>18&7|240,h>>12&63|128),m.push(h>>6&63|128)),m.push(63&h|128))}}this.addInt8(0),this.startVector(1,m.length,1),this.bb.setPosition(this.space-=m.length),s=0;for(var a=this.space,o=this.bb.bytes();s>24},d.ByteBuffer.prototype.readUint8=function(l){return this.bytes_[l]},d.ByteBuffer.prototype.readInt16=function(l){return this.readUint16(l)<<16>>16},d.ByteBuffer.prototype.readUint16=function(l){return this.bytes_[l]|this.bytes_[l+1]<<8},d.ByteBuffer.prototype.readInt32=function(l){return this.bytes_[l]|this.bytes_[l+1]<<8|this.bytes_[l+2]<<16|this.bytes_[l+3]<<24},d.ByteBuffer.prototype.readUint32=function(l){return this.readInt32(l)>>>0},d.ByteBuffer.prototype.readInt64=function(l){return new d.Long(this.readInt32(l),this.readInt32(l+4))},d.ByteBuffer.prototype.readUint64=function(l){return new d.Long(this.readUint32(l),this.readUint32(l+4))},d.ByteBuffer.prototype.readFloat32=function(l){return d.int32[0]=this.readInt32(l),d.float32[0]},d.ByteBuffer.prototype.readFloat64=function(l){return d.int32[d.isLittleEndian?0:1]=this.readInt32(l),d.int32[d.isLittleEndian?1:0]=this.readInt32(l+4),d.float64[0]},d.ByteBuffer.prototype.writeInt8=function(l,m){this.bytes_[l]=m},d.ByteBuffer.prototype.writeUint8=function(l,m){this.bytes_[l]=m},d.ByteBuffer.prototype.writeInt16=function(l,m){this.bytes_[l]=m,this.bytes_[l+1]=m>>8},d.ByteBuffer.prototype.writeUint16=function(l,m){this.bytes_[l]=m,this.bytes_[l+1]=m>>8},d.ByteBuffer.prototype.writeInt32=function(l,m){this.bytes_[l]=m,this.bytes_[l+1]=m>>8,this.bytes_[l+2]=m>>16,this.bytes_[l+3]=m>>24},d.ByteBuffer.prototype.writeUint32=function(l,m){this.bytes_[l]=m,this.bytes_[l+1]=m>>8,this.bytes_[l+2]=m>>16,this.bytes_[l+3]=m>>24},d.ByteBuffer.prototype.writeInt64=function(l,m){this.writeInt32(l,m.low),this.writeInt32(l+4,m.high)},d.ByteBuffer.prototype.writeUint64=function(l,m){this.writeUint32(l,m.low),this.writeUint32(l+4,m.high)},d.ByteBuffer.prototype.writeFloat32=function(l,m){d.float32[0]=m,this.writeInt32(l,d.int32[0])},d.ByteBuffer.prototype.writeFloat64=function(l,m){d.float64[0]=m,this.writeInt32(l,d.int32[d.isLittleEndian?0:1]),this.writeInt32(l+4,d.int32[d.isLittleEndian?1:0])},d.ByteBuffer.prototype.getBufferIdentifier=function(){if(this.bytes_.length>10),56320+(1023&a)))}return h},d.ByteBuffer.prototype.__indirect=function(l){return l+this.readInt32(l)},d.ByteBuffer.prototype.__vector=function(l){return l+this.readInt32(l)+d.SIZEOF_INT},d.ByteBuffer.prototype.__vector_len=function(l){return this.readInt32(l+this.readInt32(l))},d.ByteBuffer.prototype.__has_identifier=function(l){if(l.length!=d.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: file identifier must be length "+d.FILE_IDENTIFIER_LENGTH);for(var m=0;m{var r=f&&f.__esModule?()=>f.default:()=>f;return __webpack_require__.d(r,{a:r}),r},__webpack_require__.d=(f,r)=>{for(var c in r)__webpack_require__.o(r,c)&&!__webpack_require__.o(f,c)&&Object.defineProperty(f,c,{enumerable:!0,get:r[c]})},__webpack_require__.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}(),__webpack_require__.o=(f,r)=>Object.prototype.hasOwnProperty.call(f,r),__webpack_require__.r=f=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(f,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(f,"__esModule",{value:!0})};var __webpack_exports__=__webpack_require__(6018);return __webpack_exports__})())}(ortWeb_min)),ortWeb_min.exports}var models={},common={},hasRequiredCommon;function requireCommon(){return hasRequiredCommon||(hasRequiredCommon=1,Object.defineProperty(common,"__esModule",{value:!0})),common}var legacy={},hasRequiredLegacy;function requireLegacy(){if(hasRequiredLegacy)return legacy;hasRequiredLegacy=1;var f;Object.defineProperty(legacy,"__esModule",{value:!0}),legacy.SileroLegacy=void 0;const r=requireLogging();class c{constructor(l,m,s,h,p){this.ortInstance=l,this._session=m,this._h=s,this._c=h,this._sr=p,this.reset_state=()=>{const a=Array(128).fill(0);this._h=new this.ortInstance.Tensor("float32",a,[2,1,64]),this._c=new this.ortInstance.Tensor("float32",a,[2,1,64])},this.process=async a=>{var u;const t={input:new this.ortInstance.Tensor("float32",a,[1,a.length]),h:this._h,c:this._c,sr:this._sr},e=await this._session.run(t);this._h=e.hn,this._c=e.cn;const[n]=(u=e.output)==null?void 0:u.data;return{notSpeech:1-n,isSpeech:n}}}}return legacy.SileroLegacy=c,f=c,c.new=async(d,l)=>{r.log.debug("initializing vad");const m=await l(),s=await d.InferenceSession.create(m),h=new d.Tensor("int64",[16000n]),p=Array(2*64).fill(0),a=new d.Tensor("float32",p,[2,1,64]),o=new d.Tensor("float32",p,[2,1,64]);return r.log.debug("vad is initialized"),new f(d,s,a,o,h)},legacy}var v5={},hasRequiredV5;function requireV5(){if(hasRequiredV5)return v5;hasRequiredV5=1;var f;Object.defineProperty(v5,"__esModule",{value:!0}),v5.SileroV5=void 0;const r=requireLogging();function c(l){const m=Array(256).fill(0);return new l.Tensor("float32",m,[2,1,128])}class d{constructor(m,s,h,p){this._session=m,this._state=s,this._sr=h,this.ortInstance=p,this.reset_state=()=>{this._state=c(this.ortInstance)},this.process=async a=>{var u;const t={input:new this.ortInstance.Tensor("float32",a,[1,a.length]),state:this._state,sr:this._sr},e=await this._session.run(t);this._state=e.stateN;const[n]=(u=e.output)==null?void 0:u.data;return{notSpeech:1-n,isSpeech:n}}}}return v5.SileroV5=d,f=d,d.new=async(l,m)=>{r.log.debug("Loading VAD...");const s=await m(),h=await l.InferenceSession.create(s),p=new l.Tensor("int64",[16000n]),a=c(l);return r.log.debug("...finished loading VAD"),new f(h,a,p,l)},v5}var hasRequiredModels;function requireModels(){return hasRequiredModels||(hasRequiredModels=1,function(f){var r=models&&models.__createBinding||(Object.create?function(m,s,h,p){p===void 0&&(p=h);var a=Object.getOwnPropertyDescriptor(s,h);(!a||("get"in a?!s.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return s[h]}}),Object.defineProperty(m,p,a)}:function(m,s,h,p){p===void 0&&(p=h),m[p]=s[h]}),c=models&&models.__exportStar||function(m,s){for(var h in m)h!=="default"&&!Object.prototype.hasOwnProperty.call(s,h)&&r(s,m,h)};Object.defineProperty(f,"__esModule",{value:!0}),f.SileroV5=f.SileroLegacy=void 0,c(requireCommon(),f);var d=requireLegacy();Object.defineProperty(f,"SileroLegacy",{enumerable:!0,get:function(){return d.SileroLegacy}});var l=requireV5();Object.defineProperty(f,"SileroV5",{enumerable:!0,get:function(){return l.SileroV5}})}(models)),models}var resampler={},hasRequiredResampler;function requireResampler(){if(hasRequiredResampler)return resampler;hasRequiredResampler=1,Object.defineProperty(resampler,"__esModule",{value:!0}),resampler.Resampler=void 0;const f=requireLogging();class r{constructor(d){this.options=d,this.process=l=>{const m=[];for(const s of l)for(this.inputBuffer.push(s);this.hasEnoughDataForFrame();){const h=this.generateOutputFrame();m.push(h)}return m},d.nativeSampleRate<16e3&&f.log.error("nativeSampleRate is too low. Should have 16000 = targetSampleRate <= nativeSampleRate"),this.inputBuffer=[]}async*stream(d){for(const l of d)for(this.inputBuffer.push(l);this.hasEnoughDataForFrame();)yield this.generateOutputFrame()}hasEnoughDataForFrame(){return this.inputBuffer.length*this.options.targetSampleRate/this.options.nativeSampleRate>=this.options.targetFrameSize}generateOutputFrame(){const d=new Float32Array(this.options.targetFrameSize);let l=0,m=0;for(;li.modelFetcher(i.modelURL),g=await a.SileroLegacy.new(l,u),b=new h.FrameProcessor(g.process,g.reset_state,{frameSamples:i.frameSamples,positiveSpeechThreshold:i.positiveSpeechThreshold,negativeSpeechThreshold:i.negativeSpeechThreshold,redemptionFrames:i.redemptionFrames,preSpeechPadFrames:i.preSpeechPadFrames,minSpeechFrames:i.minSpeechFrames,submitUserSpeechOnPause:i.submitUserSpeechOnPause});return b.resume(),new this(u,l,i,b)}constructor(n,i,u,g){this.modelFetcher=n,this.ort=i,this.options=u,this.frameProcessor=g}async*run(n,i){const u={nativeSampleRate:i,targetSampleRate:16e3,targetFrameSize:this.options.frameSamples},g=new o.Resampler(u);let b=0,y=0,_=0,v=[];for await(const A of g.stream(n)){await this.frameProcessor.process(A,E=>{v.push(E)});for(const E of v)switch(E.msg){case p.Message.SpeechStart:b=_*this.options.frameSamples/16;break;case p.Message.SpeechEnd:y=(_+1)*this.options.frameSamples/16,yield{audio:E.audio,start:b,end:y};break}_++}const{msg:w,audio:T}=this.frameProcessor.endSegment(A=>{v.push(A)});for(const A of v)switch(A.msg){case p.Message.SpeechEnd:yield{audio:A.audio,start:b,end:_*this.options.frameSamples/16}}}}f.NonRealTimeVAD=t}(nonRealTimeVad)),nonRealTimeVad}var utils={},hasRequiredUtils;function requireUtils(){if(hasRequiredUtils)return utils;hasRequiredUtils=1,Object.defineProperty(utils,"__esModule",{value:!0}),utils.audioFileToArray=utils.encodeWAV=utils.arrayBufferToBase64=utils.minFramesForTargetMS=void 0;function f(h,p,a=16e3){return Math.ceil(h*a/1e3/p)}utils.minFramesForTargetMS=f;function r(h){const p=new Uint8Array(h),a=p.byteLength,o=new Array(a);for(var t=0;t{a.addEventListener("loadend",i=>{const u=a.result;p.decodeAudioData(u,g=>{o=g,p.startRendering().then(b=>{console.log("Rendering completed successfully"),n()}).catch(b=>{console.error(`Rendering failed: ${b}`)})},g=>{console.log(`Error with decoding audio data: ${g}`)})}),a.readAsArrayBuffer(h)}),o===null)throw Error("some shit");let t=o,e=new Float32Array(t.length);for(let n=0;n({...b==="v5"?s.defaultV5FrameProcessorOptions:s.defaultLegacyFrameProcessorOptions,onFrameProcessed:(_,v)=>{},onVADMisfire:()=>{h.log.debug("VAD misfire")},onSpeechStart:()=>{h.log.debug("Detected speech start")},onSpeechEnd:()=>{h.log.debug("Detected speech end")},onSpeechRealStart:()=>{h.log.debug("Detected real speech start")},baseAssetPath:"https://cdn.jsdelivr.net/npm/@ricky0123/vad-web@latest/dist/",onnxWASMBasePath:"https://cdn.jsdelivr.net/npm/onnxruntime-web@1.14.0/dist/",stream:void 0,ortConfig:void 0,model:b,workletOptions:{}});f.getDefaultRealTimeVADOptions=i;class u{static async new(y={}){const _={...(0,f.getDefaultRealTimeVADOptions)(y.model??f.DEFAULT_MODEL),...y};(0,s.validateOptions)(_);let v;_.stream===void 0?v=await navigator.mediaDevices.getUserMedia({audio:{..._.additionalAudioConstraints,channelCount:1,echoCancellation:!0,autoGainControl:!0,noiseSuppression:!0}}):v=_.stream;const w=new AudioContext,T=new MediaStreamAudioSourceNode(w,{mediaStream:v}),A=await g.new(w,_);return A.receive(T),new u(_,w,v,A,T)}constructor(y,_,v,w,T,A=!1){this.options=y,this.audioContext=_,this.stream=v,this.audioNodeVAD=w,this.sourceNode=T,this.listening=A,this.pause=()=>{this.audioNodeVAD.pause(),this.listening=!1},this.start=()=>{this.audioNodeVAD.start(),this.listening=!0},this.destroy=()=>{this.listening&&this.pause(),this.options.stream===void 0&&this.stream.getTracks().forEach(E=>E.stop()),this.sourceNode.disconnect(),this.audioNodeVAD.destroy(),this.audioContext.close()},this.setOptions=E=>{this.audioNodeVAD.setFrameProcessorOptions(E)}}}f.MicVAD=u;class g{static async new(y,_={}){const v={...(0,f.getDefaultRealTimeVADOptions)(_.model??f.DEFAULT_MODEL),..._};(0,s.validateOptions)(v),f.ort.env.wasm.wasmPaths=v.onnxWASMBasePath,v.ortConfig!==void 0&&v.ortConfig(f.ort);const w=v.model==="v5"?e:n,T=v.baseAssetPath+w,A=v.model==="v5"?a.SileroV5.new:a.SileroLegacy.new;let E;try{E=await A(f.ort,()=>(0,m.defaultModelFetcher)(T))}catch(C){throw console.error(`Encountered an error while loading model file ${T}`),C}const x=new s.FrameProcessor(E.process,E.reset_state,{frameSamples:v.frameSamples,positiveSpeechThreshold:v.positiveSpeechThreshold,negativeSpeechThreshold:v.negativeSpeechThreshold,redemptionFrames:v.redemptionFrames,preSpeechPadFrames:v.preSpeechPadFrames,minSpeechFrames:v.minSpeechFrames,submitUserSpeechOnPause:v.submitUserSpeechOnPause}),P=new g(y,v,x);return await P.setupAudioNode(),P}constructor(y,_,v){this.ctx=y,this.options=_,this.bufferIndex=0,this.pause=()=>{this.frameProcessor.pause(this.handleFrameProcessorEvent)},this.start=()=>{this.frameProcessor.resume()},this.receive=w=>{w.connect(this.audioNode)},this.processFrame=async w=>{await this.frameProcessor.process(w,this.handleFrameProcessorEvent)},this.handleFrameProcessorEvent=w=>{switch(w.msg){case p.Message.FrameProcessed:this.options.onFrameProcessed(w.probs,w.frame);break;case p.Message.SpeechStart:this.options.onSpeechStart();break;case p.Message.SpeechRealStart:this.options.onSpeechRealStart();break;case p.Message.VADMisfire:this.options.onVADMisfire();break;case p.Message.SpeechEnd:this.options.onSpeechEnd(w.audio);break}},this.destroy=()=>{var w;this.audioNode instanceof AudioWorkletNode&&this.audioNode.port.postMessage({message:p.Message.SpeechStop}),this.audioNode.disconnect(),(w=this.gainNode)==null||w.disconnect()},this.setFrameProcessorOptions=w=>{this.frameProcessor.options={...this.frameProcessor.options,...w}},this.frameProcessor=v}async setupAudioNode(){if("audioWorklet"in this.ctx&&typeof AudioWorkletNode=="function")try{const w=this.options.baseAssetPath+t;await this.ctx.audioWorklet.addModule(w);const T=this.options.workletOptions??{};T.processorOptions={...T.processorOptions??{},frameSamples:this.options.frameSamples},this.audioNode=new AudioWorkletNode(this.ctx,"vad-helper-worklet",T),this.audioNode.port.onmessage=async A=>{var E;switch((E=A.data)==null?void 0:E.message){case p.Message.AudioFrame:let x=A.data.data;x instanceof ArrayBuffer||(x=new ArrayBuffer(A.data.data.byteLength),new Uint8Array(x).set(new Uint8Array(A.data.data)));const P=new Float32Array(x);await this.processFrame(P);break}};return}catch(w){console.log("AudioWorklet setup failed, falling back to ScriptProcessor",w)}this.resampler=new o.Resampler({nativeSampleRate:this.ctx.sampleRate,targetSampleRate:16e3,targetFrameSize:this.options.frameSamples??480});const _=4096;this.audioNode=this.ctx.createScriptProcessor(_,1,1),this.gainNode=this.ctx.createGain(),this.gainNode.gain.value=0;let v=!1;this.audioNode.onaudioprocess=async w=>{if(!v){v=!0;try{const T=w.inputBuffer.getChannelData(0);if(w.outputBuffer.getChannelData(0).fill(0),this.resampler){const E=this.resampler.process(T);for(const x of E)await this.processFrame(x)}}catch(T){console.error("Error processing audio:",T)}finally{v=!1}}},this.audioNode.connect(this.gainNode),this.gainNode.connect(this.ctx.destination)}}f.AudioNodeVAD=g}(realTimeVad)),realTimeVad}var hasRequiredDist;function requireDist(){return hasRequiredDist||(hasRequiredDist=1,function(f){Object.defineProperty(f,"__esModule",{value:!0}),f.getDefaultRealTimeVADOptions=f.MicVAD=f.DEFAULT_MODEL=f.AudioNodeVAD=f.utils=f.NonRealTimeVAD=f.Message=f.FrameProcessor=f.defaultModelFetcher=f.baseAssetPath=void 0;var r=requireAssetPath();Object.defineProperty(f,"baseAssetPath",{enumerable:!0,get:function(){return r.baseAssetPath}});var c=requireDefaultModelFetcher();Object.defineProperty(f,"defaultModelFetcher",{enumerable:!0,get:function(){return c.defaultModelFetcher}});var d=requireFrameProcessor();Object.defineProperty(f,"FrameProcessor",{enumerable:!0,get:function(){return d.FrameProcessor}});var l=requireMessages();Object.defineProperty(f,"Message",{enumerable:!0,get:function(){return l.Message}});var m=requireNonRealTimeVad();Object.defineProperty(f,"NonRealTimeVAD",{enumerable:!0,get:function(){return m.NonRealTimeVAD}});const s=requireUtils();f.utils={audioFileToArray:s.audioFileToArray,minFramesForTargetMS:s.minFramesForTargetMS,arrayBufferToBase64:s.arrayBufferToBase64,encodeWAV:s.encodeWAV};var h=requireRealTimeVad();Object.defineProperty(f,"AudioNodeVAD",{enumerable:!0,get:function(){return h.AudioNodeVAD}}),Object.defineProperty(f,"DEFAULT_MODEL",{enumerable:!0,get:function(){return h.DEFAULT_MODEL}}),Object.defineProperty(f,"MicVAD",{enumerable:!0,get:function(){return h.MicVAD}}),Object.defineProperty(f,"getDefaultRealTimeVADOptions",{enumerable:!0,get:function(){return h.getDefaultRealTimeVADOptions}})}(dist)),dist}var distExports=requireDist();/*! + * @pixiv/three-vrm-animation v3.4.0 + * The implementation of VRM Animation + * + * Copyright (c) 2019-2025 pixiv Inc. + * @pixiv/three-vrm-animation is distributed under MIT License + * https://github.com/pixiv/three-vrm/blob/release/LICENSE + */var __async$1=(f,r,c)=>new Promise((d,l)=>{var m=p=>{try{h(c.next(p))}catch(a){l(a)}},s=p=>{try{h(c.throw(p))}catch(a){l(a)}},h=p=>p.done?d(p.value):Promise.resolve(p.value).then(m,s);h((c=c.apply(f,r)).next())}),VRMExpressionPresetName$1={Aa:"aa",Ih:"ih",Ou:"ou",Ee:"ee",Oh:"oh",Blink:"blink",Happy:"happy",Angry:"angry",Sad:"sad",Relaxed:"relaxed",LookUp:"lookUp",Surprised:"surprised",LookDown:"lookDown",LookLeft:"lookLeft",LookRight:"lookRight",BlinkLeft:"blinkLeft",BlinkRight:"blinkRight",Neutral:"neutral"};new Color;new Vector2;new Vector3;new Vector3;var VRMHumanBoneParentMap$1={hips:null,spine:"hips",chest:"spine",upperChest:"chest",neck:"upperChest",head:"neck",leftEye:"head",rightEye:"head",jaw:"head",leftUpperLeg:"hips",leftLowerLeg:"leftUpperLeg",leftFoot:"leftLowerLeg",leftToes:"leftFoot",rightUpperLeg:"hips",rightLowerLeg:"rightUpperLeg",rightFoot:"rightLowerLeg",rightToes:"rightFoot",leftShoulder:"upperChest",leftUpperArm:"leftShoulder",leftLowerArm:"leftUpperArm",leftHand:"leftLowerArm",rightShoulder:"upperChest",rightUpperArm:"rightShoulder",rightLowerArm:"rightUpperArm",rightHand:"rightLowerArm",leftThumbMetacarpal:"leftHand",leftThumbProximal:"leftThumbMetacarpal",leftThumbDistal:"leftThumbProximal",leftIndexProximal:"leftHand",leftIndexIntermediate:"leftIndexProximal",leftIndexDistal:"leftIndexIntermediate",leftMiddleProximal:"leftHand",leftMiddleIntermediate:"leftMiddleProximal",leftMiddleDistal:"leftMiddleIntermediate",leftRingProximal:"leftHand",leftRingIntermediate:"leftRingProximal",leftRingDistal:"leftRingIntermediate",leftLittleProximal:"leftHand",leftLittleIntermediate:"leftLittleProximal",leftLittleDistal:"leftLittleIntermediate",rightThumbMetacarpal:"rightHand",rightThumbProximal:"rightThumbMetacarpal",rightThumbDistal:"rightThumbProximal",rightIndexProximal:"rightHand",rightIndexIntermediate:"rightIndexProximal",rightIndexDistal:"rightIndexIntermediate",rightMiddleProximal:"rightHand",rightMiddleIntermediate:"rightMiddleProximal",rightMiddleDistal:"rightMiddleIntermediate",rightRingProximal:"rightHand",rightRingIntermediate:"rightRingProximal",rightRingDistal:"rightRingIntermediate",rightLittleProximal:"rightHand",rightLittleIntermediate:"rightLittleProximal",rightLittleDistal:"rightLittleIntermediate"};function quatInvertCompat$1(f){return f.invert?f.invert():f.inverse(),f}new Vector3;new Vector3;new Vector3;new Vector3;new Vector3;new Vector3(0,1,0);var _position$1=new Vector3,_scale$1=new Vector3;function getWorldQuaternionLite$1(f,r){return f.matrixWorld.decompose(_position$1,r,_scale$1),r}function calcAzimuthAltitude$1(f){return[Math.atan2(-f.z,f.x),Math.atan2(f.y,Math.sqrt(f.x*f.x+f.z*f.z))]}function sanitizeAngle$1(f){const r=Math.round(f/2/Math.PI);return f-2*Math.PI*r}var VEC3_POSITIVE_Z$1=new Vector3(0,0,1),_v3A5$1=new Vector3,_v3B3$1=new Vector3,_v3C$1=new Vector3,_quatA5$1=new Quaternion,_quatB2$1=new Quaternion,_quatC$1=new Quaternion,_quatD$1=new Quaternion,_eulerA$1=new Euler,_VRMLookAt$1=class mn{constructor(r,c){this.offsetFromHeadBone=new Vector3,this.autoUpdate=!0,this.faceFront=new Vector3(0,0,1),this.humanoid=r,this.applier=c,this._yaw=0,this._pitch=0,this._needsUpdate=!0,this._restHeadWorldQuaternion=this.getLookAtWorldQuaternion(new Quaternion)}get yaw(){return this._yaw}set yaw(r){this._yaw=r,this._needsUpdate=!0}get pitch(){return this._pitch}set pitch(r){this._pitch=r,this._needsUpdate=!0}get euler(){return console.warn("VRMLookAt: euler is deprecated. use getEuler() instead."),this.getEuler(new Euler)}getEuler(r){return r.set(MathUtils.DEG2RAD*this._pitch,MathUtils.DEG2RAD*this._yaw,0,"YXZ")}copy(r){if(this.humanoid!==r.humanoid)throw new Error("VRMLookAt: humanoid must be same in order to copy");return this.offsetFromHeadBone.copy(r.offsetFromHeadBone),this.applier=r.applier,this.autoUpdate=r.autoUpdate,this.target=r.target,this.faceFront.copy(r.faceFront),this}clone(){return new mn(this.humanoid,this.applier).copy(this)}reset(){this._yaw=0,this._pitch=0,this._needsUpdate=!0}getLookAtWorldPosition(r){const c=this.humanoid.getRawBoneNode("head");return r.copy(this.offsetFromHeadBone).applyMatrix4(c.matrixWorld)}getLookAtWorldQuaternion(r){const c=this.humanoid.getRawBoneNode("head");return getWorldQuaternionLite$1(c,r)}getFaceFrontQuaternion(r){if(this.faceFront.distanceToSquared(VEC3_POSITIVE_Z$1)<.01)return r.copy(this._restHeadWorldQuaternion).invert();const[c,d]=calcAzimuthAltitude$1(this.faceFront);return _eulerA$1.set(0,.5*Math.PI+c,d,"YZX"),r.setFromEuler(_eulerA$1).premultiply(_quatD$1.copy(this._restHeadWorldQuaternion).invert())}getLookAtWorldDirection(r){return this.getLookAtWorldQuaternion(_quatB2$1),this.getFaceFrontQuaternion(_quatC$1),r.copy(VEC3_POSITIVE_Z$1).applyQuaternion(_quatB2$1).applyQuaternion(_quatC$1).applyEuler(this.getEuler(_eulerA$1))}lookAt(r){const c=_quatA5$1.copy(this._restHeadWorldQuaternion).multiply(quatInvertCompat$1(this.getLookAtWorldQuaternion(_quatB2$1))),d=this.getLookAtWorldPosition(_v3B3$1),l=_v3C$1.copy(r).sub(d).applyQuaternion(c).normalize(),[m,s]=calcAzimuthAltitude$1(this.faceFront),[h,p]=calcAzimuthAltitude$1(l),a=sanitizeAngle$1(h-m),o=sanitizeAngle$1(s-p);this._yaw=MathUtils.RAD2DEG*a,this._pitch=MathUtils.RAD2DEG*o,this._needsUpdate=!0}update(r){this.target!=null&&this.autoUpdate&&this.lookAt(this.target.getWorldPosition(_v3A5$1)),this._needsUpdate&&(this._needsUpdate=!1,this.applier.applyYawPitch(this._yaw,this._pitch))}};_VRMLookAt$1.EULER_ORDER="YXZ";var VRMLookAt$1=_VRMLookAt$1;new Vector3(0,0,1);new Euler(0,0,0,"YXZ");var RAD2DEG=180/Math.PI,_eulerA3=new Euler,VRMLookAtQuaternionProxy=class extends Object3D{constructor(f){super(),this.vrmLookAt=f,this.type="VRMLookAtQuaternionProxy";const r=this.rotation._onChangeCallback;this.rotation._onChange(()=>{r(),this._applyToLookAt()});const c=this.quaternion._onChangeCallback;this.quaternion._onChange(()=>{c(),this._applyToLookAt()})}_applyToLookAt(){_eulerA3.setFromQuaternion(this.quaternion,VRMLookAt$1.EULER_ORDER),this.vrmLookAt.yaw=RAD2DEG*_eulerA3.y,this.vrmLookAt.pitch=RAD2DEG*_eulerA3.x}};function createVRMAnimationHumanoidTracks(f,r,c){var d,l;const m=new Map,s=new Map;for(const[h,p]of f.humanoidTracks.rotation.entries()){const a=(d=r.getNormalizedBoneNode(h))==null?void 0:d.name;if(a!=null){const o=new QuaternionKeyframeTrack(`${a}.quaternion`,p.times,p.values.map((t,e)=>c==="0"&&e%2===0?-t:t));s.set(h,o)}}for(const[h,p]of f.humanoidTracks.translation.entries()){const a=(l=r.getNormalizedBoneNode(h))==null?void 0:l.name;if(a!=null){const o=f.restHipsPosition.y,e=r.normalizedRestPose.hips.position[1]/o,n=p.clone();n.values=n.values.map((i,u)=>(c==="0"&&u%3!==1?-i:i)*e),n.name=`${a}.position`,m.set(h,n)}}return{translation:m,rotation:s}}function createVRMAnimationExpressionTracks(f,r){const c=new Map,d=new Map;for(const[l,m]of f.expressionTracks.preset.entries()){const s=r.getExpressionTrackName(l);if(s!=null){const h=m.clone();h.name=s,c.set(l,h)}}for(const[l,m]of f.expressionTracks.custom.entries()){const s=r.getExpressionTrackName(l);if(s!=null){const h=m.clone();h.name=s,d.set(l,h)}}return{preset:c,custom:d}}function createVRMAnimationLookAtTrack(f,r){if(f.lookAtTrack==null)return null;const c=f.lookAtTrack.clone();return c.name=r,c}function createVRMAnimationClip(f,r){const c=[],d=createVRMAnimationHumanoidTracks(f,r.humanoid,r.meta.metaVersion);if(c.push(...d.translation.values()),c.push(...d.rotation.values()),r.expressionManager!=null){const l=createVRMAnimationExpressionTracks(f,r.expressionManager);c.push(...l.preset.values()),c.push(...l.custom.values())}if(r.lookAt!=null){let l=r.scene.children.find(s=>s instanceof VRMLookAtQuaternionProxy);l==null?(console.warn("createVRMAnimationClip: VRMLookAtQuaternionProxy is not found. Creating a new one automatically. To suppress this warning, create a VRMLookAtQuaternionProxy manually"),l=new VRMLookAtQuaternionProxy(r.lookAt),l.name="VRMLookAtQuaternionProxy",r.scene.add(l)):l.name==null&&(console.warn("createVRMAnimationClip: VRMLookAtQuaternionProxy is found but its name is not set. Setting the name automatically. To suppress this warning, set the name manually"),l.name="VRMLookAtQuaternionProxy");const m=createVRMAnimationLookAtTrack(f,`${l.name}.quaternion`);m!=null&&c.push(m)}return new AnimationClip("Clip",f.duration,c)}var VRMAnimation=class{constructor(){this.duration=0,this.restHipsPosition=new Vector3,this.humanoidTracks={translation:new Map,rotation:new Map},this.expressionTracks={preset:new Map,custom:new Map},this.lookAtTrack=null}};function arrayChunk(f,r){const c=f.length,d=[];let l=[],m=0;for(let s=0;s{const b=l.animations[g],y=this._parseAnimation(u,b,p,a);return y.restHipsPosition=e,y});f.userData.vrmAnimations=i})}_createNodeMap(f){var r,c,d,l,m;const s=new Map,h=new Map,p=(r=f.humanoid)==null?void 0:r.humanBones;p&&Object.entries(p).forEach(([e,n])=>{const i=n==null?void 0:n.node;i!=null&&s.set(i,e)});const a=(c=f.expressions)==null?void 0:c.preset;a&&Object.entries(a).forEach(([e,n])=>{const i=n==null?void 0:n.node;i!=null&&h.set(i,e)});const o=(d=f.expressions)==null?void 0:d.custom;o&&Object.entries(o).forEach(([e,n])=>{const{node:i}=n;h.set(i,e)});const t=(m=(l=f.lookAt)==null?void 0:l.node)!=null?m:null;return{humanoidIndexToName:s,expressionsIndexToName:h,lookAtIndex:t}}_createBoneWorldMatrixMap(f,r){return __async$1(this,null,function*(){var c,d;f.scene.updateWorldMatrix(!1,!0);const l=yield f.parser.getDependencies("node"),m=new Map;if(r.humanoid==null)return m;for(const[s,h]of Object.entries(r.humanoid.humanBones)){const p=h==null?void 0:h.node;if(p!=null){const a=l[p];m.set(s,a.matrixWorld),s==="hips"&&m.set("hipsParent",(d=(c=a.parent)==null?void 0:c.matrixWorld)!=null?d:MAT4_IDENTITY)}}return m})}_parseAnimation(f,r,c,d){const l=f.tracks,m=r.channels,s=new VRMAnimation;return s.duration=f.duration,m.forEach((h,p)=>{const{node:a,path:o}=h.target,t=l[p];if(a==null)return;const e=c.humanoidIndexToName.get(a);if(e!=null){let i=VRMHumanBoneParentMap$1[e];for(;i!=null&&d.get(i)==null;)i=VRMHumanBoneParentMap$1[i];if(i==null&&(i="hipsParent"),o==="translation")if(e!=="hips")console.warn(`The loading animation contains a translation track for ${e}, which is not permitted in the VRMC_vrm_animation spec. ignoring the track`);else{const u=d.get("hipsParent"),g=arrayChunk(t.values,3).flatMap(y=>_v3A6$1.fromArray(y).applyMatrix4(u).toArray()),b=t.clone();b.values=new Float32Array(g),s.humanoidTracks.translation.set(e,b)}else if(o==="rotation"){const u=d.get(e),g=d.get(i);u.decompose(_v3A6$1,_quatA7$1,_v3A6$1),_quatA7$1.invert(),g.decompose(_v3A6$1,_quatB4$1,_v3A6$1);const b=arrayChunk(t.values,4).flatMap(_=>_quatC2$1.fromArray(_).premultiply(_quatB4$1).multiply(_quatA7$1).toArray()),y=t.clone();y.values=new Float32Array(b),s.humanoidTracks.rotation.set(e,y)}else throw new Error(`Invalid path "${o}"`);return}const n=c.expressionsIndexToName.get(a);if(n!=null){if(o==="translation"){const i=t.times,u=new Float32Array(t.values.length/3);for(let b=0;bnew Promise((d,l)=>{var m=p=>{try{h(c.next(p))}catch(a){l(a)}},s=p=>{try{h(c.throw(p))}catch(a){l(a)}},h=p=>p.done?d(p.value):Promise.resolve(p.value).then(m,s);h((c=c.apply(f,r)).next())}),__async2=(f,r,c)=>new Promise((d,l)=>{var m=p=>{try{h(c.next(p))}catch(a){l(a)}},s=p=>{try{h(c.throw(p))}catch(a){l(a)}},h=p=>p.done?d(p.value):Promise.resolve(p.value).then(m,s);h((c=c.apply(f,r)).next())}),VRMExpression=class extends Object3D{constructor(f){super(),this.weight=0,this.isBinary=!1,this.overrideBlink="none",this.overrideLookAt="none",this.overrideMouth="none",this._binds=[],this.name=`VRMExpression_${f}`,this.expressionName=f,this.type="VRMExpression",this.visible=!1}get binds(){return this._binds}get overrideBlinkAmount(){return this.overrideBlink==="block"?0.5?1:0:this.weight}addBind(f){this._binds.push(f)}deleteBind(f){const r=this._binds.indexOf(f);r>=0&&this._binds.splice(r,1)}applyWeight(f){var r;let c=this.outputWeight;c*=(r=f==null?void 0:f.multiplier)!=null?r:1,this.isBinary&&c<1&&(c=0),this._binds.forEach(d=>d.applyWeight(c))}clearAppliedWeight(){this._binds.forEach(f=>f.clearAppliedWeight())}};function extractPrimitivesInternal(f,r,c){var d,l;const m=f.parser.json,s=(d=m.nodes)==null?void 0:d[r];if(s==null)return console.warn(`extractPrimitivesInternal: Attempt to use nodes[${r}] of glTF but the node doesn't exist`),null;const h=s.mesh;if(h==null)return null;const p=(l=m.meshes)==null?void 0:l[h];if(p==null)return console.warn(`extractPrimitivesInternal: Attempt to use meshes[${h}] of glTF but the mesh doesn't exist`),null;const a=p.primitives.length,o=[];return c.traverse(t=>{o.length{const m=extractPrimitivesInternal(f,l,d);m!=null&&c.set(l,m)}),c})}var VRMExpressionPresetName={Aa:"aa",Ih:"ih",Ou:"ou",Ee:"ee",Oh:"oh",Blink:"blink",Happy:"happy",Angry:"angry",Sad:"sad",Relaxed:"relaxed",LookUp:"lookUp",Surprised:"surprised",LookDown:"lookDown",LookLeft:"lookLeft",LookRight:"lookRight",BlinkLeft:"blinkLeft",BlinkRight:"blinkRight",Neutral:"neutral"};function saturate(f){return Math.max(Math.min(f,1),0)}var VRMExpressionManager=class gn{constructor(){this.blinkExpressionNames=["blink","blinkLeft","blinkRight"],this.lookAtExpressionNames=["lookLeft","lookRight","lookUp","lookDown"],this.mouthExpressionNames=["aa","ee","ih","oh","ou"],this._expressions=[],this._expressionMap={}}get expressions(){return this._expressions.concat()}get expressionMap(){return Object.assign({},this._expressionMap)}get presetExpressionMap(){const r={},c=new Set(Object.values(VRMExpressionPresetName));return Object.entries(this._expressionMap).forEach(([d,l])=>{c.has(d)&&(r[d]=l)}),r}get customExpressionMap(){const r={},c=new Set(Object.values(VRMExpressionPresetName));return Object.entries(this._expressionMap).forEach(([d,l])=>{c.has(d)||(r[d]=l)}),r}copy(r){return this._expressions.concat().forEach(d=>{this.unregisterExpression(d)}),r._expressions.forEach(d=>{this.registerExpression(d)}),this.blinkExpressionNames=r.blinkExpressionNames.concat(),this.lookAtExpressionNames=r.lookAtExpressionNames.concat(),this.mouthExpressionNames=r.mouthExpressionNames.concat(),this}clone(){return new gn().copy(this)}getExpression(r){var c;return(c=this._expressionMap[r])!=null?c:null}registerExpression(r){this._expressions.push(r),this._expressionMap[r.expressionName]=r}unregisterExpression(r){const c=this._expressions.indexOf(r);c===-1&&console.warn("VRMExpressionManager: The specified expressions is not registered"),this._expressions.splice(c,1),delete this._expressionMap[r.expressionName]}getValue(r){var c;const d=this.getExpression(r);return(c=d==null?void 0:d.weight)!=null?c:null}setValue(r,c){const d=this.getExpression(r);d&&(d.weight=saturate(c))}resetValues(){this._expressions.forEach(r=>{r.weight=0})}getExpressionTrackName(r){const c=this.getExpression(r);return c?`${c.name}.weight`:null}update(){const r=this._calculateWeightMultipliers();this._expressions.forEach(c=>{c.clearAppliedWeight()}),this._expressions.forEach(c=>{let d=1;const l=c.expressionName;this.blinkExpressionNames.indexOf(l)!==-1&&(d*=r.blink),this.lookAtExpressionNames.indexOf(l)!==-1&&(d*=r.lookAt),this.mouthExpressionNames.indexOf(l)!==-1&&(d*=r.mouth),c.applyWeight({multiplier:d})})}_calculateWeightMultipliers(){let r=1,c=1,d=1;return this._expressions.forEach(l=>{r-=l.overrideBlinkAmount,c-=l.overrideLookAtAmount,d-=l.overrideMouthAmount}),r=Math.max(0,r),c=Math.max(0,c),d=Math.max(0,d),{blink:r,lookAt:c,mouth:d}}},VRMExpressionMaterialColorType={Color:"color",EmissionColor:"emissionColor",ShadeColor:"shadeColor",RimColor:"rimColor",OutlineColor:"outlineColor"},v0ExpressionMaterialColorMap={_Color:VRMExpressionMaterialColorType.Color,_EmissionColor:VRMExpressionMaterialColorType.EmissionColor,_ShadeColor:VRMExpressionMaterialColorType.ShadeColor,_RimColor:VRMExpressionMaterialColorType.RimColor,_OutlineColor:VRMExpressionMaterialColorType.OutlineColor},_color=new Color,_VRMExpressionMaterialColorBind=class bn{constructor({material:r,type:c,targetValue:d,targetAlpha:l}){this.material=r,this.type=c,this.targetValue=d,this.targetAlpha=l??1;const m=this._initColorBindState(),s=this._initAlphaBindState();this._state={color:m,alpha:s}}applyWeight(r){const{color:c,alpha:d}=this._state;if(c!=null){const{propertyName:l,deltaValue:m}=c,s=this.material[l];s!=null&&s.add(_color.copy(m).multiplyScalar(r))}if(d!=null){const{propertyName:l,deltaValue:m}=d;this.material[l]!=null&&(this.material[l]+=m*r)}}clearAppliedWeight(){const{color:r,alpha:c}=this._state;if(r!=null){const{propertyName:d,initialValue:l}=r,m=this.material[d];m!=null&&m.copy(l)}if(c!=null){const{propertyName:d,initialValue:l}=c;this.material[d]!=null&&(this.material[d]=l)}}_initColorBindState(){var r,c,d;const{material:l,type:m,targetValue:s}=this,h=this._getPropertyNameMap(),p=(c=(r=h==null?void 0:h[m])==null?void 0:r[0])!=null?c:null;if(p==null)return console.warn(`Tried to add a material color bind to the material ${(d=l.name)!=null?d:"(no name)"}, the type ${m} but the material or the type is not supported.`),null;const o=l[p].clone(),t=new Color(s.r-o.r,s.g-o.g,s.b-o.b);return{propertyName:p,initialValue:o,deltaValue:t}}_initAlphaBindState(){var r,c,d;const{material:l,type:m,targetAlpha:s}=this,h=this._getPropertyNameMap(),p=(c=(r=h==null?void 0:h[m])==null?void 0:r[1])!=null?c:null;if(p==null&&s!==1)return console.warn(`Tried to add a material alpha bind to the material ${(d=l.name)!=null?d:"(no name)"}, the type ${m} but the material or the type does not support alpha.`),null;if(p==null)return null;const a=l[p],o=s-a;return{propertyName:p,initialValue:a,deltaValue:o}}_getPropertyNameMap(){var r,c;return(c=(r=Object.entries(bn._propertyNameMapMap).find(([d])=>this.material[d]===!0))==null?void 0:r[1])!=null?c:null}};_VRMExpressionMaterialColorBind._propertyNameMapMap={isMeshStandardMaterial:{color:["color","opacity"],emissionColor:["emissive",null]},isMeshBasicMaterial:{color:["color","opacity"]},isMToonMaterial:{color:["color","opacity"],emissionColor:["emissive",null],outlineColor:["outlineColorFactor",null],matcapColor:["matcapFactor",null],rimColor:["parametricRimColorFactor",null],shadeColor:["shadeColorFactor",null]}};var VRMExpressionMaterialColorBind=_VRMExpressionMaterialColorBind,VRMExpressionMorphTargetBind=class{constructor({primitives:f,index:r,weight:c}){this.primitives=f,this.index=r,this.weight=c}applyWeight(f){this.primitives.forEach(r=>{var c;((c=r.morphTargetInfluences)==null?void 0:c[this.index])!=null&&(r.morphTargetInfluences[this.index]+=this.weight*f)})}clearAppliedWeight(){this.primitives.forEach(f=>{var r;((r=f.morphTargetInfluences)==null?void 0:r[this.index])!=null&&(f.morphTargetInfluences[this.index]=0)})}},_v2=new Vector2,_VRMExpressionTextureTransformBind=class yn{constructor({material:r,scale:c,offset:d}){var l,m;this.material=r,this.scale=c,this.offset=d;const s=(l=Object.entries(yn._propertyNamesMap).find(([h])=>r[h]===!0))==null?void 0:l[1];s==null?(console.warn(`Tried to add a texture transform bind to the material ${(m=r.name)!=null?m:"(no name)"} but the material is not supported.`),this._properties=[]):(this._properties=[],s.forEach(h=>{var p;const a=(p=r[h])==null?void 0:p.clone();if(!a)return null;r[h]=a;const o=a.offset.clone(),t=a.repeat.clone(),e=d.clone().sub(o),n=c.clone().sub(t);this._properties.push({name:h,initialOffset:o,deltaOffset:e,initialScale:t,deltaScale:n})}))}applyWeight(r){this._properties.forEach(c=>{const d=this.material[c.name];d!==void 0&&(d.offset.add(_v2.copy(c.deltaOffset).multiplyScalar(r)),d.repeat.add(_v2.copy(c.deltaScale).multiplyScalar(r)))})}clearAppliedWeight(){this._properties.forEach(r=>{const c=this.material[r.name];c!==void 0&&(c.offset.copy(r.initialOffset),c.repeat.copy(r.initialScale))})}};_VRMExpressionTextureTransformBind._propertyNamesMap={isMeshStandardMaterial:["map","emissiveMap","bumpMap","normalMap","displacementMap","roughnessMap","metalnessMap","alphaMap"],isMeshBasicMaterial:["map","specularMap","alphaMap"],isMToonMaterial:["map","normalMap","emissiveMap","shadeMultiplyTexture","rimMultiplyTexture","outlineWidthMultiplyTexture","uvAnimationMaskTexture"]};var VRMExpressionTextureTransformBind=_VRMExpressionTextureTransformBind,POSSIBLE_SPEC_VERSIONS=new Set(["1.0","1.0-beta"]),_VRMExpressionLoaderPlugin=class _n{get name(){return"VRMExpressionLoaderPlugin"}constructor(r){this.parser=r}afterRoot(r){return __async2(this,null,function*(){r.userData.vrmExpressionManager=yield this._import(r)})}_import(r){return __async2(this,null,function*(){const c=yield this._v1Import(r);if(c)return c;const d=yield this._v0Import(r);return d||null})}_v1Import(r){return __async2(this,null,function*(){var c,d;const l=this.parser.json;if(!(((c=l.extensionsUsed)==null?void 0:c.indexOf("VRMC_vrm"))!==-1))return null;const s=(d=l.extensions)==null?void 0:d.VRMC_vrm;if(!s)return null;const h=s.specVersion;if(!POSSIBLE_SPEC_VERSIONS.has(h))return console.warn(`VRMExpressionLoaderPlugin: Unknown VRMC_vrm specVersion "${h}"`),null;const p=s.expressions;if(!p)return null;const a=new Set(Object.values(VRMExpressionPresetName)),o=new Map;p.preset!=null&&Object.entries(p.preset).forEach(([e,n])=>{if(n!=null){if(!a.has(e)){console.warn(`VRMExpressionLoaderPlugin: Unknown preset name "${e}" detected. Ignoring the expression`);return}o.set(e,n)}}),p.custom!=null&&Object.entries(p.custom).forEach(([e,n])=>{if(a.has(e)){console.warn(`VRMExpressionLoaderPlugin: Custom expression cannot have preset name "${e}". Ignoring the expression`);return}o.set(e,n)});const t=new VRMExpressionManager;return yield Promise.all(Array.from(o.entries()).map(e=>__async2(this,[e],function*([n,i]){var u,g,b,y,_,v,w;const T=new VRMExpression(n);if(r.scene.add(T),T.isBinary=(u=i.isBinary)!=null?u:!1,T.overrideBlink=(g=i.overrideBlink)!=null?g:"none",T.overrideLookAt=(b=i.overrideLookAt)!=null?b:"none",T.overrideMouth=(y=i.overrideMouth)!=null?y:"none",(_=i.morphTargetBinds)==null||_.forEach(A=>__async2(this,null,function*(){var E;if(A.node===void 0||A.index===void 0)return;const x=yield gltfExtractPrimitivesFromNode(r,A.node),P=A.index;if(!x.every(C=>Array.isArray(C.morphTargetInfluences)&&P{const x=E.material;x&&(Array.isArray(x)?A.push(...x):A.push(x))}),(v=i.materialColorBinds)==null||v.forEach(E=>__async2(this,null,function*(){A.filter(P=>{var C;const k=(C=this.parser.associations.get(P))==null?void 0:C.materials;return E.material===k}).forEach(P=>{T.addBind(new VRMExpressionMaterialColorBind({material:P,type:E.type,targetValue:new Color().fromArray(E.targetValue),targetAlpha:E.targetValue[3]}))})})),(w=i.textureTransformBinds)==null||w.forEach(E=>__async2(this,null,function*(){A.filter(P=>{var C;const k=(C=this.parser.associations.get(P))==null?void 0:C.materials;return E.material===k}).forEach(P=>{var C,k;T.addBind(new VRMExpressionTextureTransformBind({material:P,offset:new Vector2().fromArray((C=E.offset)!=null?C:[0,0]),scale:new Vector2().fromArray((k=E.scale)!=null?k:[1,1])}))})}))}t.registerExpression(T)}))),t})}_v0Import(r){return __async2(this,null,function*(){var c;const d=this.parser.json,l=(c=d.extensions)==null?void 0:c.VRM;if(!l)return null;const m=l.blendShapeMaster;if(!m)return null;const s=new VRMExpressionManager,h=m.blendShapeGroups;if(!h)return s;const p=new Set;return yield Promise.all(h.map(a=>__async2(this,null,function*(){var o;const t=a.presetName,e=t!=null&&_n.v0v1PresetNameMap[t]||null,n=e??a.name;if(n==null){console.warn("VRMExpressionLoaderPlugin: One of custom expressions has no name. Ignoring the expression");return}if(p.has(n)){console.warn(`VRMExpressionLoaderPlugin: An expression preset ${t} has duplicated entries. Ignoring the expression`);return}p.add(n);const i=new VRMExpression(n);r.scene.add(i),i.isBinary=(o=a.isBinary)!=null?o:!1,a.binds&&a.binds.forEach(g=>__async2(this,null,function*(){var b;if(g.mesh===void 0||g.index===void 0)return;const y=[];(b=d.nodes)==null||b.forEach((v,w)=>{v.mesh===g.mesh&&y.push(w)});const _=g.index;yield Promise.all(y.map(v=>__async2(this,null,function*(){var w;const T=yield gltfExtractPrimitivesFromNode(r,v);if(!T.every(A=>Array.isArray(A.morphTargetInfluences)&&_{if(g.materialName===void 0||g.propertyName===void 0||g.targetValue===void 0)return;const b=[];r.scene.traverse(_=>{if(_.material){const v=_.material;Array.isArray(v)?b.push(...v.filter(w=>(w.name===g.materialName||w.name===g.materialName+" (Outline)")&&b.indexOf(w)===-1)):v.name===g.materialName&&b.indexOf(v)===-1&&b.push(v)}});const y=g.propertyName;b.forEach(_=>{if(y==="_MainTex_ST"){const w=new Vector2(g.targetValue[0],g.targetValue[1]),T=new Vector2(g.targetValue[2],g.targetValue[3]);T.y=1-T.y-w.y,i.addBind(new VRMExpressionTextureTransformBind({material:_,scale:w,offset:T}));return}const v=v0ExpressionMaterialColorMap[y];if(v){i.addBind(new VRMExpressionMaterialColorBind({material:_,type:v,targetValue:new Color().fromArray(g.targetValue),targetAlpha:g.targetValue[3]}));return}console.warn(y+" is not supported")})}),s.registerExpression(i)}))),s})}};_VRMExpressionLoaderPlugin.v0v1PresetNameMap={a:"aa",e:"ee",i:"ih",o:"oh",u:"ou",blink:"blink",joy:"happy",angry:"angry",sorrow:"sad",fun:"relaxed",lookup:"lookUp",lookdown:"lookDown",lookleft:"lookLeft",lookright:"lookRight",blink_l:"blinkLeft",blink_r:"blinkRight",neutral:"neutral"};var VRMExpressionLoaderPlugin=_VRMExpressionLoaderPlugin,_VRMFirstPerson=class Mt{constructor(r,c){this._firstPersonOnlyLayer=Mt.DEFAULT_FIRSTPERSON_ONLY_LAYER,this._thirdPersonOnlyLayer=Mt.DEFAULT_THIRDPERSON_ONLY_LAYER,this._initializedLayers=!1,this.humanoid=r,this.meshAnnotations=c}copy(r){if(this.humanoid!==r.humanoid)throw new Error("VRMFirstPerson: humanoid must be same in order to copy");return this.meshAnnotations=r.meshAnnotations.map(c=>({meshes:c.meshes.concat(),type:c.type})),this}clone(){return new Mt(this.humanoid,this.meshAnnotations).copy(this)}get firstPersonOnlyLayer(){return this._firstPersonOnlyLayer}get thirdPersonOnlyLayer(){return this._thirdPersonOnlyLayer}setup({firstPersonOnlyLayer:r=Mt.DEFAULT_FIRSTPERSON_ONLY_LAYER,thirdPersonOnlyLayer:c=Mt.DEFAULT_THIRDPERSON_ONLY_LAYER}={}){this._initializedLayers||(this._firstPersonOnlyLayer=r,this._thirdPersonOnlyLayer=c,this.meshAnnotations.forEach(d=>{d.meshes.forEach(l=>{d.type==="firstPersonOnly"?(l.layers.set(this._firstPersonOnlyLayer),l.traverse(m=>m.layers.set(this._firstPersonOnlyLayer))):d.type==="thirdPersonOnly"?(l.layers.set(this._thirdPersonOnlyLayer),l.traverse(m=>m.layers.set(this._thirdPersonOnlyLayer))):d.type==="auto"&&this._createHeadlessModel(l)})}),this._initializedLayers=!0)}_excludeTriangles(r,c,d,l){let m=0;if(c!=null&&c.length>0)for(let s=0;s0&&l.includes(t[0])||o[1]>0&&l.includes(t[1])||o[2]>0&&l.includes(t[2])||o[3]>0&&l.includes(t[3]))continue;const e=c[p],n=d[p];if(e[0]>0&&l.includes(n[0])||e[1]>0&&l.includes(n[1])||e[2]>0&&l.includes(n[2])||e[3]>0&&l.includes(n[3]))continue;const i=c[a],u=d[a];i[0]>0&&l.includes(u[0])||i[1]>0&&l.includes(u[1])||i[2]>0&&l.includes(u[2])||i[3]>0&&l.includes(u[3])||(r[m++]=h,r[m++]=p,r[m++]=a)}return m}_createErasedMesh(r,c){const d=new SkinnedMesh(r.geometry.clone(),r.material);d.name=`${r.name}(erase)`,d.frustumCulled=r.frustumCulled,d.layers.set(this._firstPersonOnlyLayer);const l=d.geometry,m=l.getAttribute("skinIndex"),s=m instanceof GLBufferAttribute?[]:m.array,h=[];for(let u=0;u{this._isEraseTarget(m)&&d.push(s)}),!d.length){c.layers.enable(this._thirdPersonOnlyLayer),c.layers.enable(this._firstPersonOnlyLayer);return}c.layers.set(this._thirdPersonOnlyLayer);const l=this._createErasedMesh(c,d);r.add(l)}_createHeadlessModel(r){if(r.type==="Group")if(r.layers.set(this._thirdPersonOnlyLayer),this._isEraseTarget(r))r.traverse(c=>c.layers.set(this._thirdPersonOnlyLayer));else{const c=new Group;c.name=`_headless_${r.name}`,c.layers.set(this._firstPersonOnlyLayer),r.parent.add(c),r.children.filter(d=>d.type==="SkinnedMesh").forEach(d=>{const l=d;this._createHeadlessModelForSkinnedMesh(c,l)})}else if(r.type==="SkinnedMesh"){const c=r;this._createHeadlessModelForSkinnedMesh(r.parent,c)}else this._isEraseTarget(r)&&(r.layers.set(this._thirdPersonOnlyLayer),r.traverse(c=>c.layers.set(this._thirdPersonOnlyLayer)))}_isEraseTarget(r){return r===this.humanoid.getRawBoneNode("head")?!0:r.parent?this._isEraseTarget(r.parent):!1}};_VRMFirstPerson.DEFAULT_FIRSTPERSON_ONLY_LAYER=9;_VRMFirstPerson.DEFAULT_THIRDPERSON_ONLY_LAYER=10;var VRMFirstPerson=_VRMFirstPerson,POSSIBLE_SPEC_VERSIONS2=new Set(["1.0","1.0-beta"]),VRMFirstPersonLoaderPlugin=class{get name(){return"VRMFirstPersonLoaderPlugin"}constructor(f){this.parser=f}afterRoot(f){return __async2(this,null,function*(){const r=f.userData.vrmHumanoid;if(r!==null){if(r===void 0)throw new Error("VRMFirstPersonLoaderPlugin: vrmHumanoid is undefined. VRMHumanoidLoaderPlugin have to be used first");f.userData.vrmFirstPerson=yield this._import(f,r)}})}_import(f,r){return __async2(this,null,function*(){if(r==null)return null;const c=yield this._v1Import(f,r);if(c)return c;const d=yield this._v0Import(f,r);return d||null})}_v1Import(f,r){return __async2(this,null,function*(){var c,d;const l=this.parser.json;if(!(((c=l.extensionsUsed)==null?void 0:c.indexOf("VRMC_vrm"))!==-1))return null;const s=(d=l.extensions)==null?void 0:d.VRMC_vrm;if(!s)return null;const h=s.specVersion;if(!POSSIBLE_SPEC_VERSIONS2.has(h))return console.warn(`VRMFirstPersonLoaderPlugin: Unknown VRMC_vrm specVersion "${h}"`),null;const p=s.firstPerson,a=[],o=yield gltfExtractPrimitivesFromNodes(f);return Array.from(o.entries()).forEach(([t,e])=>{var n,i;const u=(n=p==null?void 0:p.meshAnnotations)==null?void 0:n.find(g=>g.node===t);a.push({meshes:e,type:(i=u==null?void 0:u.type)!=null?i:"auto"})}),new VRMFirstPerson(r,a)})}_v0Import(f,r){return __async2(this,null,function*(){var c;const d=this.parser.json,l=(c=d.extensions)==null?void 0:c.VRM;if(!l)return null;const m=l.firstPerson;if(!m)return null;const s=[],h=yield gltfExtractPrimitivesFromNodes(f);return Array.from(h.entries()).forEach(([p,a])=>{const o=d.nodes[p],t=m.meshAnnotations?m.meshAnnotations.find(e=>e.mesh===o.mesh):void 0;s.push({meshes:a,type:this._convertV0FlagToV1Type(t==null?void 0:t.firstPersonFlag)})}),new VRMFirstPerson(r,s)})}_convertV0FlagToV1Type(f){return f==="FirstPersonOnly"?"firstPersonOnly":f==="ThirdPersonOnly"?"thirdPersonOnly":f==="Both"?"both":"auto"}},_v3A=new Vector3,_v3B=new Vector3,_quatA=new Quaternion,VRMHumanoidHelper=class extends Group{constructor(f){super(),this.vrmHumanoid=f,this._boneAxesMap=new Map,Object.values(f.humanBones).forEach(r=>{const c=new AxesHelper(1);c.matrixAutoUpdate=!1,c.material.depthTest=!1,c.material.depthWrite=!1,this.add(c),this._boneAxesMap.set(r,c)})}dispose(){Array.from(this._boneAxesMap.values()).forEach(f=>{f.geometry.dispose(),f.material.dispose()})}updateMatrixWorld(f){Array.from(this._boneAxesMap.entries()).forEach(([r,c])=>{r.node.updateWorldMatrix(!0,!1),r.node.matrixWorld.decompose(_v3A,_quatA,_v3B);const d=_v3A.set(.1,.1,.1).divide(_v3B);c.matrix.copy(r.node.matrixWorld).scale(d)}),super.updateMatrixWorld(f)}},VRMHumanBoneList=["hips","spine","chest","upperChest","neck","head","leftEye","rightEye","jaw","leftUpperLeg","leftLowerLeg","leftFoot","leftToes","rightUpperLeg","rightLowerLeg","rightFoot","rightToes","leftShoulder","leftUpperArm","leftLowerArm","leftHand","rightShoulder","rightUpperArm","rightLowerArm","rightHand","leftThumbMetacarpal","leftThumbProximal","leftThumbDistal","leftIndexProximal","leftIndexIntermediate","leftIndexDistal","leftMiddleProximal","leftMiddleIntermediate","leftMiddleDistal","leftRingProximal","leftRingIntermediate","leftRingDistal","leftLittleProximal","leftLittleIntermediate","leftLittleDistal","rightThumbMetacarpal","rightThumbProximal","rightThumbDistal","rightIndexProximal","rightIndexIntermediate","rightIndexDistal","rightMiddleProximal","rightMiddleIntermediate","rightMiddleDistal","rightRingProximal","rightRingIntermediate","rightRingDistal","rightLittleProximal","rightLittleIntermediate","rightLittleDistal"],VRMHumanBoneParentMap={hips:null,spine:"hips",chest:"spine",upperChest:"chest",neck:"upperChest",head:"neck",leftEye:"head",rightEye:"head",jaw:"head",leftUpperLeg:"hips",leftLowerLeg:"leftUpperLeg",leftFoot:"leftLowerLeg",leftToes:"leftFoot",rightUpperLeg:"hips",rightLowerLeg:"rightUpperLeg",rightFoot:"rightLowerLeg",rightToes:"rightFoot",leftShoulder:"upperChest",leftUpperArm:"leftShoulder",leftLowerArm:"leftUpperArm",leftHand:"leftLowerArm",rightShoulder:"upperChest",rightUpperArm:"rightShoulder",rightLowerArm:"rightUpperArm",rightHand:"rightLowerArm",leftThumbMetacarpal:"leftHand",leftThumbProximal:"leftThumbMetacarpal",leftThumbDistal:"leftThumbProximal",leftIndexProximal:"leftHand",leftIndexIntermediate:"leftIndexProximal",leftIndexDistal:"leftIndexIntermediate",leftMiddleProximal:"leftHand",leftMiddleIntermediate:"leftMiddleProximal",leftMiddleDistal:"leftMiddleIntermediate",leftRingProximal:"leftHand",leftRingIntermediate:"leftRingProximal",leftRingDistal:"leftRingIntermediate",leftLittleProximal:"leftHand",leftLittleIntermediate:"leftLittleProximal",leftLittleDistal:"leftLittleIntermediate",rightThumbMetacarpal:"rightHand",rightThumbProximal:"rightThumbMetacarpal",rightThumbDistal:"rightThumbProximal",rightIndexProximal:"rightHand",rightIndexIntermediate:"rightIndexProximal",rightIndexDistal:"rightIndexIntermediate",rightMiddleProximal:"rightHand",rightMiddleIntermediate:"rightMiddleProximal",rightMiddleDistal:"rightMiddleIntermediate",rightRingProximal:"rightHand",rightRingIntermediate:"rightRingProximal",rightRingDistal:"rightRingIntermediate",rightLittleProximal:"rightHand",rightLittleIntermediate:"rightLittleProximal",rightLittleDistal:"rightLittleIntermediate"};function quatInvertCompat(f){return f.invert?f.invert():f.inverse(),f}var _v3A2=new Vector3,_quatA2=new Quaternion,VRMRig=class{constructor(f){this.humanBones=f,this.restPose=this.getAbsolutePose()}getAbsolutePose(){const f={};return Object.keys(this.humanBones).forEach(r=>{const c=r,d=this.getBoneNode(c);d&&(_v3A2.copy(d.position),_quatA2.copy(d.quaternion),f[c]={position:_v3A2.toArray(),rotation:_quatA2.toArray()})}),f}getPose(){const f={};return Object.keys(this.humanBones).forEach(r=>{const c=r,d=this.getBoneNode(c);if(!d)return;_v3A2.set(0,0,0),_quatA2.identity();const l=this.restPose[c];l!=null&&l.position&&_v3A2.fromArray(l.position).negate(),l!=null&&l.rotation&&quatInvertCompat(_quatA2.fromArray(l.rotation)),_v3A2.add(d.position),_quatA2.premultiply(d.quaternion),f[c]={position:_v3A2.toArray(),rotation:_quatA2.toArray()}}),f}setPose(f){Object.entries(f).forEach(([r,c])=>{const d=r,l=this.getBoneNode(d);if(!l)return;const m=this.restPose[d];m&&(c!=null&&c.position&&(l.position.fromArray(c.position),m.position&&l.position.add(_v3A2.fromArray(m.position))),c!=null&&c.rotation&&(l.quaternion.fromArray(c.rotation),m.rotation&&l.quaternion.multiply(_quatA2.fromArray(m.rotation))))})}resetPose(){Object.entries(this.restPose).forEach(([f,r])=>{const c=this.getBoneNode(f);c&&(r!=null&&r.position&&c.position.fromArray(r.position),r!=null&&r.rotation&&c.quaternion.fromArray(r.rotation))})}getBone(f){var r;return(r=this.humanBones[f])!=null?r:void 0}getBoneNode(f){var r,c;return(c=(r=this.humanBones[f])==null?void 0:r.node)!=null?c:null}},_v3A3=new Vector3,_quatA3=new Quaternion,_boneWorldPos=new Vector3,VRMHumanoidRig=class vn extends VRMRig{static _setupTransforms(r){const c=new Object3D;c.name="VRMHumanoidRig";const d={},l={},m={};VRMHumanBoneList.forEach(h=>{var p;const a=r.getBoneNode(h);if(a){const o=new Vector3,t=new Quaternion;a.updateWorldMatrix(!0,!1),a.matrixWorld.decompose(o,t,_v3A3),d[h]=o,l[h]=a.quaternion.clone();const e=new Quaternion;(p=a.parent)==null||p.matrixWorld.decompose(_v3A3,e,_v3A3),m[h]=e}});const s={};return VRMHumanBoneList.forEach(h=>{var p;const a=r.getBoneNode(h);if(a){const o=d[h];let t=h,e;for(;e==null&&(t=VRMHumanBoneParentMap[t],t!=null);)e=d[t];const n=new Object3D;n.name="Normalized_"+a.name,(t?(p=s[t])==null?void 0:p.node:c).add(n),n.position.copy(o),e&&n.position.sub(e),s[h]={node:n}}}),{rigBones:s,root:c,parentWorldRotations:m,boneRotations:l}}constructor(r){const{rigBones:c,root:d,parentWorldRotations:l,boneRotations:m}=vn._setupTransforms(r);super(c),this.original=r,this.root=d,this._parentWorldRotations=l,this._boneRotations=m}update(){VRMHumanBoneList.forEach(r=>{const c=this.original.getBoneNode(r);if(c!=null){const d=this.getBoneNode(r),l=this._parentWorldRotations[r],m=_quatA3.copy(l).invert(),s=this._boneRotations[r];if(c.quaternion.copy(d.quaternion).multiply(l).premultiply(m).multiply(s),r==="hips"){const h=d.getWorldPosition(_boneWorldPos);c.parent.updateWorldMatrix(!0,!1);const p=c.parent.matrixWorld,a=h.applyMatrix4(p.invert());c.position.copy(a)}}})}},VRMHumanoid=class wn{get restPose(){return console.warn("VRMHumanoid: restPose is deprecated. Use either rawRestPose or normalizedRestPose instead."),this.rawRestPose}get rawRestPose(){return this._rawHumanBones.restPose}get normalizedRestPose(){return this._normalizedHumanBones.restPose}get humanBones(){return this._rawHumanBones.humanBones}get rawHumanBones(){return this._rawHumanBones.humanBones}get normalizedHumanBones(){return this._normalizedHumanBones.humanBones}get normalizedHumanBonesRoot(){return this._normalizedHumanBones.root}constructor(r,c){var d;this.autoUpdateHumanBones=(d=c==null?void 0:c.autoUpdateHumanBones)!=null?d:!0,this._rawHumanBones=new VRMRig(r),this._normalizedHumanBones=new VRMHumanoidRig(this._rawHumanBones)}copy(r){return this.autoUpdateHumanBones=r.autoUpdateHumanBones,this._rawHumanBones=new VRMRig(r.humanBones),this._normalizedHumanBones=new VRMHumanoidRig(this._rawHumanBones),this}clone(){return new wn(this.humanBones,{autoUpdateHumanBones:this.autoUpdateHumanBones}).copy(this)}getAbsolutePose(){return console.warn("VRMHumanoid: getAbsolutePose() is deprecated. Use either getRawAbsolutePose() or getNormalizedAbsolutePose() instead."),this.getRawAbsolutePose()}getRawAbsolutePose(){return this._rawHumanBones.getAbsolutePose()}getNormalizedAbsolutePose(){return this._normalizedHumanBones.getAbsolutePose()}getPose(){return console.warn("VRMHumanoid: getPose() is deprecated. Use either getRawPose() or getNormalizedPose() instead."),this.getRawPose()}getRawPose(){return this._rawHumanBones.getPose()}getNormalizedPose(){return this._normalizedHumanBones.getPose()}setPose(r){return console.warn("VRMHumanoid: setPose() is deprecated. Use either setRawPose() or setNormalizedPose() instead."),this.setRawPose(r)}setRawPose(r){return this._rawHumanBones.setPose(r)}setNormalizedPose(r){return this._normalizedHumanBones.setPose(r)}resetPose(){return console.warn("VRMHumanoid: resetPose() is deprecated. Use either resetRawPose() or resetNormalizedPose() instead."),this.resetRawPose()}resetRawPose(){return this._rawHumanBones.resetPose()}resetNormalizedPose(){return this._normalizedHumanBones.resetPose()}getBone(r){return console.warn("VRMHumanoid: getBone() is deprecated. Use either getRawBone() or getNormalizedBone() instead."),this.getRawBone(r)}getRawBone(r){return this._rawHumanBones.getBone(r)}getNormalizedBone(r){return this._normalizedHumanBones.getBone(r)}getBoneNode(r){return console.warn("VRMHumanoid: getBoneNode() is deprecated. Use either getRawBoneNode() or getNormalizedBoneNode() instead."),this.getRawBoneNode(r)}getRawBoneNode(r){return this._rawHumanBones.getBoneNode(r)}getNormalizedBoneNode(r){return this._normalizedHumanBones.getBoneNode(r)}update(){this.autoUpdateHumanBones&&this._normalizedHumanBones.update()}},VRMRequiredHumanBoneName={Hips:"hips",Spine:"spine",Head:"head",LeftUpperLeg:"leftUpperLeg",LeftLowerLeg:"leftLowerLeg",LeftFoot:"leftFoot",RightUpperLeg:"rightUpperLeg",RightLowerLeg:"rightLowerLeg",RightFoot:"rightFoot",LeftUpperArm:"leftUpperArm",LeftLowerArm:"leftLowerArm",LeftHand:"leftHand",RightUpperArm:"rightUpperArm",RightLowerArm:"rightLowerArm",RightHand:"rightHand"},POSSIBLE_SPEC_VERSIONS3=new Set(["1.0","1.0-beta"]),thumbBoneNameMap={leftThumbProximal:"leftThumbMetacarpal",leftThumbIntermediate:"leftThumbProximal",rightThumbProximal:"rightThumbMetacarpal",rightThumbIntermediate:"rightThumbProximal"},VRMHumanoidLoaderPlugin=class{get name(){return"VRMHumanoidLoaderPlugin"}constructor(f,r){this.parser=f,this.helperRoot=r==null?void 0:r.helperRoot,this.autoUpdateHumanBones=r==null?void 0:r.autoUpdateHumanBones}afterRoot(f){return __async2(this,null,function*(){f.userData.vrmHumanoid=yield this._import(f)})}_import(f){return __async2(this,null,function*(){const r=yield this._v1Import(f);if(r)return r;const c=yield this._v0Import(f);return c||null})}_v1Import(f){return __async2(this,null,function*(){var r,c;const d=this.parser.json;if(!(((r=d.extensionsUsed)==null?void 0:r.indexOf("VRMC_vrm"))!==-1))return null;const m=(c=d.extensions)==null?void 0:c.VRMC_vrm;if(!m)return null;const s=m.specVersion;if(!POSSIBLE_SPEC_VERSIONS3.has(s))return console.warn(`VRMHumanoidLoaderPlugin: Unknown VRMC_vrm specVersion "${s}"`),null;const h=m.humanoid;if(!h)return null;const p=h.humanBones.leftThumbIntermediate!=null||h.humanBones.rightThumbIntermediate!=null,a={};h.humanBones!=null&&(yield Promise.all(Object.entries(h.humanBones).map(t=>__async2(this,[t],function*([e,n]){let i=e;const u=n.node;if(p){const b=thumbBoneNameMap[i];b!=null&&(i=b)}const g=yield this.parser.getDependency("node",u);if(g==null){console.warn(`A glTF node bound to the humanoid bone ${i} (index = ${u}) does not exist`);return}a[i]={node:g}}))));const o=new VRMHumanoid(this._ensureRequiredBonesExist(a),{autoUpdateHumanBones:this.autoUpdateHumanBones});if(f.scene.add(o.normalizedHumanBonesRoot),this.helperRoot){const t=new VRMHumanoidHelper(o);this.helperRoot.add(t),t.renderOrder=this.helperRoot.renderOrder}return o})}_v0Import(f){return __async2(this,null,function*(){var r;const d=(r=this.parser.json.extensions)==null?void 0:r.VRM;if(!d)return null;const l=d.humanoid;if(!l)return null;const m={};l.humanBones!=null&&(yield Promise.all(l.humanBones.map(h=>__async2(this,null,function*(){const p=h.bone,a=h.node;if(p==null||a==null)return;const o=yield this.parser.getDependency("node",a);if(o==null){console.warn(`A glTF node bound to the humanoid bone ${p} (index = ${a}) does not exist`);return}const t=thumbBoneNameMap[p],e=t??p;if(m[e]!=null){console.warn(`Multiple bone entries for ${e} detected (index = ${a}), ignoring duplicated entries.`);return}m[e]={node:o}}))));const s=new VRMHumanoid(this._ensureRequiredBonesExist(m),{autoUpdateHumanBones:this.autoUpdateHumanBones});if(f.scene.add(s.normalizedHumanBonesRoot),this.helperRoot){const h=new VRMHumanoidHelper(s);this.helperRoot.add(h),h.renderOrder=this.helperRoot.renderOrder}return s})}_ensureRequiredBonesExist(f){const r=Object.values(VRMRequiredHumanBoneName).filter(c=>f[c]==null);if(r.length>0)throw new Error(`VRMHumanoidLoaderPlugin: These humanoid bones are required but not exist: ${r.join(", ")}`);return f}},FanBufferGeometry=class extends BufferGeometry{constructor(){super(),this._currentTheta=0,this._currentRadius=0,this.theta=0,this.radius=0,this._currentTheta=0,this._currentRadius=0,this._attrPos=new BufferAttribute(new Float32Array(65*3),3),this.setAttribute("position",this._attrPos),this._attrIndex=new BufferAttribute(new Uint16Array(3*63),1),this.setIndex(this._attrIndex),this._buildIndex(),this.update()}update(){let f=!1;this._currentTheta!==this.theta&&(this._currentTheta=this.theta,f=!0),this._currentRadius!==this.radius&&(this._currentRadius=this.radius,f=!0),f&&this._buildPosition()}_buildPosition(){this._attrPos.setXYZ(0,0,0,0);for(let f=0;f<64;f++){const r=f/63*this._currentTheta;this._attrPos.setXYZ(f+1,this._currentRadius*Math.sin(r),0,this._currentRadius*Math.cos(r))}this._attrPos.needsUpdate=!0}_buildIndex(){for(let f=0;f<63;f++)this._attrIndex.setXYZ(f*3,0,f+1,f+2);this._attrIndex.needsUpdate=!0}},LineAndSphereBufferGeometry=class extends BufferGeometry{constructor(){super(),this.radius=0,this._currentRadius=0,this.tail=new Vector3,this._currentTail=new Vector3,this._attrPos=new BufferAttribute(new Float32Array(294),3),this.setAttribute("position",this._attrPos),this._attrIndex=new BufferAttribute(new Uint16Array(194),1),this.setIndex(this._attrIndex),this._buildIndex(),this.update()}update(){let f=!1;this._currentRadius!==this.radius&&(this._currentRadius=this.radius,f=!0),this._currentTail.equals(this.tail)||(this._currentTail.copy(this.tail),f=!0),f&&this._buildPosition()}_buildPosition(){for(let f=0;f<32;f++){const r=f/16*Math.PI;this._attrPos.setXYZ(f,Math.cos(r),Math.sin(r),0),this._attrPos.setXYZ(32+f,0,Math.cos(r),Math.sin(r)),this._attrPos.setXYZ(64+f,Math.sin(r),0,Math.cos(r))}this.scale(this._currentRadius,this._currentRadius,this._currentRadius),this.translate(this._currentTail.x,this._currentTail.y,this._currentTail.z),this._attrPos.setXYZ(96,0,0,0),this._attrPos.setXYZ(97,this._currentTail.x,this._currentTail.y,this._currentTail.z),this._attrPos.needsUpdate=!0}_buildIndex(){for(let f=0;f<32;f++){const r=(f+1)%32;this._attrIndex.setXY(f*2,f,r),this._attrIndex.setXY(64+f*2,32+f,32+r),this._attrIndex.setXY(128+f*2,64+f,64+r)}this._attrIndex.setXY(192,96,97),this._attrIndex.needsUpdate=!0}},_quatA4=new Quaternion,_quatB=new Quaternion,_v3A4=new Vector3,_v3B2=new Vector3,SQRT_2_OVER_2=Math.sqrt(2)/2,QUAT_XY_CW90=new Quaternion(0,0,-SQRT_2_OVER_2,SQRT_2_OVER_2),VEC3_POSITIVE_Y=new Vector3(0,1,0),VRMLookAtHelper=class extends Group{constructor(f){super(),this.matrixAutoUpdate=!1,this.vrmLookAt=f;{const r=new FanBufferGeometry;r.radius=.5;const c=new MeshBasicMaterial({color:65280,transparent:!0,opacity:.5,side:DoubleSide,depthTest:!1,depthWrite:!1});this._meshPitch=new Mesh(r,c),this.add(this._meshPitch)}{const r=new FanBufferGeometry;r.radius=.5;const c=new MeshBasicMaterial({color:16711680,transparent:!0,opacity:.5,side:DoubleSide,depthTest:!1,depthWrite:!1});this._meshYaw=new Mesh(r,c),this.add(this._meshYaw)}{const r=new LineAndSphereBufferGeometry;r.radius=.1;const c=new LineBasicMaterial({color:16777215,depthTest:!1,depthWrite:!1});this._lineTarget=new LineSegments(r,c),this._lineTarget.frustumCulled=!1,this.add(this._lineTarget)}}dispose(){this._meshYaw.geometry.dispose(),this._meshYaw.material.dispose(),this._meshPitch.geometry.dispose(),this._meshPitch.material.dispose(),this._lineTarget.geometry.dispose(),this._lineTarget.material.dispose()}updateMatrixWorld(f){const r=MathUtils.DEG2RAD*this.vrmLookAt.yaw;this._meshYaw.geometry.theta=r,this._meshYaw.geometry.update();const c=MathUtils.DEG2RAD*this.vrmLookAt.pitch;this._meshPitch.geometry.theta=c,this._meshPitch.geometry.update(),this.vrmLookAt.getLookAtWorldPosition(_v3A4),this.vrmLookAt.getLookAtWorldQuaternion(_quatA4),_quatA4.multiply(this.vrmLookAt.getFaceFrontQuaternion(_quatB)),this._meshYaw.position.copy(_v3A4),this._meshYaw.quaternion.copy(_quatA4),this._meshPitch.position.copy(_v3A4),this._meshPitch.quaternion.copy(_quatA4),this._meshPitch.quaternion.multiply(_quatB.setFromAxisAngle(VEC3_POSITIVE_Y,r)),this._meshPitch.quaternion.multiply(QUAT_XY_CW90);const{target:d,autoUpdate:l}=this.vrmLookAt;d!=null&&l&&(d.getWorldPosition(_v3B2).sub(_v3A4),this._lineTarget.geometry.tail.copy(_v3B2),this._lineTarget.geometry.update(),this._lineTarget.position.copy(_v3A4)),super.updateMatrixWorld(f)}},_position=new Vector3,_scale=new Vector3;function getWorldQuaternionLite(f,r){return f.matrixWorld.decompose(_position,r,_scale),r}function calcAzimuthAltitude(f){return[Math.atan2(-f.z,f.x),Math.atan2(f.y,Math.sqrt(f.x*f.x+f.z*f.z))]}function sanitizeAngle(f){const r=Math.round(f/2/Math.PI);return f-2*Math.PI*r}var VEC3_POSITIVE_Z=new Vector3(0,0,1),_v3A5=new Vector3,_v3B3=new Vector3,_v3C=new Vector3,_quatA5=new Quaternion,_quatB2=new Quaternion,_quatC=new Quaternion,_quatD=new Quaternion,_eulerA=new Euler,_VRMLookAt=class xn{constructor(r,c){this.offsetFromHeadBone=new Vector3,this.autoUpdate=!0,this.faceFront=new Vector3(0,0,1),this.humanoid=r,this.applier=c,this._yaw=0,this._pitch=0,this._needsUpdate=!0,this._restHeadWorldQuaternion=this.getLookAtWorldQuaternion(new Quaternion)}get yaw(){return this._yaw}set yaw(r){this._yaw=r,this._needsUpdate=!0}get pitch(){return this._pitch}set pitch(r){this._pitch=r,this._needsUpdate=!0}get euler(){return console.warn("VRMLookAt: euler is deprecated. use getEuler() instead."),this.getEuler(new Euler)}getEuler(r){return r.set(MathUtils.DEG2RAD*this._pitch,MathUtils.DEG2RAD*this._yaw,0,"YXZ")}copy(r){if(this.humanoid!==r.humanoid)throw new Error("VRMLookAt: humanoid must be same in order to copy");return this.offsetFromHeadBone.copy(r.offsetFromHeadBone),this.applier=r.applier,this.autoUpdate=r.autoUpdate,this.target=r.target,this.faceFront.copy(r.faceFront),this}clone(){return new xn(this.humanoid,this.applier).copy(this)}reset(){this._yaw=0,this._pitch=0,this._needsUpdate=!0}getLookAtWorldPosition(r){const c=this.humanoid.getRawBoneNode("head");return r.copy(this.offsetFromHeadBone).applyMatrix4(c.matrixWorld)}getLookAtWorldQuaternion(r){const c=this.humanoid.getRawBoneNode("head");return getWorldQuaternionLite(c,r)}getFaceFrontQuaternion(r){if(this.faceFront.distanceToSquared(VEC3_POSITIVE_Z)<.01)return r.copy(this._restHeadWorldQuaternion).invert();const[c,d]=calcAzimuthAltitude(this.faceFront);return _eulerA.set(0,.5*Math.PI+c,d,"YZX"),r.setFromEuler(_eulerA).premultiply(_quatD.copy(this._restHeadWorldQuaternion).invert())}getLookAtWorldDirection(r){return this.getLookAtWorldQuaternion(_quatB2),this.getFaceFrontQuaternion(_quatC),r.copy(VEC3_POSITIVE_Z).applyQuaternion(_quatB2).applyQuaternion(_quatC).applyEuler(this.getEuler(_eulerA))}lookAt(r){const c=_quatA5.copy(this._restHeadWorldQuaternion).multiply(quatInvertCompat(this.getLookAtWorldQuaternion(_quatB2))),d=this.getLookAtWorldPosition(_v3B3),l=_v3C.copy(r).sub(d).applyQuaternion(c).normalize(),[m,s]=calcAzimuthAltitude(this.faceFront),[h,p]=calcAzimuthAltitude(l),a=sanitizeAngle(h-m),o=sanitizeAngle(s-p);this._yaw=MathUtils.RAD2DEG*a,this._pitch=MathUtils.RAD2DEG*o,this._needsUpdate=!0}update(r){this.target!=null&&this.autoUpdate&&this.lookAt(this.target.getWorldPosition(_v3A5)),this._needsUpdate&&(this._needsUpdate=!1,this.applier.applyYawPitch(this._yaw,this._pitch))}};_VRMLookAt.EULER_ORDER="YXZ";var VRMLookAt=_VRMLookAt,VEC3_POSITIVE_Z2=new Vector3(0,0,1),_quatA6=new Quaternion,_quatB3=new Quaternion,_eulerA2=new Euler(0,0,0,"YXZ"),VRMLookAtBoneApplier=class{constructor(f,r,c,d,l){this.humanoid=f,this.rangeMapHorizontalInner=r,this.rangeMapHorizontalOuter=c,this.rangeMapVerticalDown=d,this.rangeMapVerticalUp=l,this.faceFront=new Vector3(0,0,1),this._restQuatLeftEye=new Quaternion,this._restQuatRightEye=new Quaternion,this._restLeftEyeParentWorldQuat=new Quaternion,this._restRightEyeParentWorldQuat=new Quaternion;const m=this.humanoid.getRawBoneNode("leftEye"),s=this.humanoid.getRawBoneNode("rightEye");m&&(this._restQuatLeftEye.copy(m.quaternion),getWorldQuaternionLite(m.parent,this._restLeftEyeParentWorldQuat)),s&&(this._restQuatRightEye.copy(s.quaternion),getWorldQuaternionLite(s.parent,this._restRightEyeParentWorldQuat))}applyYawPitch(f,r){const c=this.humanoid.getRawBoneNode("leftEye"),d=this.humanoid.getRawBoneNode("rightEye"),l=this.humanoid.getNormalizedBoneNode("leftEye"),m=this.humanoid.getNormalizedBoneNode("rightEye");c&&(r<0?_eulerA2.x=-MathUtils.DEG2RAD*this.rangeMapVerticalDown.map(-r):_eulerA2.x=MathUtils.DEG2RAD*this.rangeMapVerticalUp.map(r),f<0?_eulerA2.y=-MathUtils.DEG2RAD*this.rangeMapHorizontalInner.map(-f):_eulerA2.y=MathUtils.DEG2RAD*this.rangeMapHorizontalOuter.map(f),_quatA6.setFromEuler(_eulerA2),this._getWorldFaceFrontQuat(_quatB3),l.quaternion.copy(_quatB3).multiply(_quatA6).multiply(_quatB3.invert()),_quatA6.copy(this._restLeftEyeParentWorldQuat),c.quaternion.copy(l.quaternion).multiply(_quatA6).premultiply(_quatA6.invert()).multiply(this._restQuatLeftEye)),d&&(r<0?_eulerA2.x=-MathUtils.DEG2RAD*this.rangeMapVerticalDown.map(-r):_eulerA2.x=MathUtils.DEG2RAD*this.rangeMapVerticalUp.map(r),f<0?_eulerA2.y=-MathUtils.DEG2RAD*this.rangeMapHorizontalOuter.map(-f):_eulerA2.y=MathUtils.DEG2RAD*this.rangeMapHorizontalInner.map(f),_quatA6.setFromEuler(_eulerA2),this._getWorldFaceFrontQuat(_quatB3),m.quaternion.copy(_quatB3).multiply(_quatA6).multiply(_quatB3.invert()),_quatA6.copy(this._restRightEyeParentWorldQuat),d.quaternion.copy(m.quaternion).multiply(_quatA6).premultiply(_quatA6.invert()).multiply(this._restQuatRightEye))}lookAt(f){console.warn("VRMLookAtBoneApplier: lookAt() is deprecated. use apply() instead.");const r=MathUtils.RAD2DEG*f.y,c=MathUtils.RAD2DEG*f.x;this.applyYawPitch(r,c)}_getWorldFaceFrontQuat(f){if(this.faceFront.distanceToSquared(VEC3_POSITIVE_Z2)<.01)return f.identity();const[r,c]=calcAzimuthAltitude(this.faceFront);return _eulerA2.set(0,.5*Math.PI+r,c,"YZX"),f.setFromEuler(_eulerA2)}};VRMLookAtBoneApplier.type="bone";var VRMLookAtExpressionApplier=class{constructor(f,r,c,d,l){this.expressions=f,this.rangeMapHorizontalInner=r,this.rangeMapHorizontalOuter=c,this.rangeMapVerticalDown=d,this.rangeMapVerticalUp=l}applyYawPitch(f,r){r<0?(this.expressions.setValue("lookDown",0),this.expressions.setValue("lookUp",this.rangeMapVerticalUp.map(-r))):(this.expressions.setValue("lookUp",0),this.expressions.setValue("lookDown",this.rangeMapVerticalDown.map(r))),f<0?(this.expressions.setValue("lookLeft",0),this.expressions.setValue("lookRight",this.rangeMapHorizontalOuter.map(-f))):(this.expressions.setValue("lookRight",0),this.expressions.setValue("lookLeft",this.rangeMapHorizontalOuter.map(f)))}lookAt(f){console.warn("VRMLookAtBoneApplier: lookAt() is deprecated. use apply() instead.");const r=MathUtils.RAD2DEG*f.y,c=MathUtils.RAD2DEG*f.x;this.applyYawPitch(r,c)}};VRMLookAtExpressionApplier.type="expression";var VRMLookAtRangeMap=class{constructor(f,r){this.inputMaxValue=f,this.outputScale=r}map(f){return this.outputScale*saturate(f/this.inputMaxValue)}},POSSIBLE_SPEC_VERSIONS4=new Set(["1.0","1.0-beta"]),INPUT_MAX_VALUE_MINIMUM=.01,VRMLookAtLoaderPlugin=class{get name(){return"VRMLookAtLoaderPlugin"}constructor(f,r){this.parser=f,this.helperRoot=r==null?void 0:r.helperRoot}afterRoot(f){return __async2(this,null,function*(){const r=f.userData.vrmHumanoid;if(r===null)return;if(r===void 0)throw new Error("VRMLookAtLoaderPlugin: vrmHumanoid is undefined. VRMHumanoidLoaderPlugin have to be used first");const c=f.userData.vrmExpressionManager;if(c!==null){if(c===void 0)throw new Error("VRMLookAtLoaderPlugin: vrmExpressionManager is undefined. VRMExpressionLoaderPlugin have to be used first");f.userData.vrmLookAt=yield this._import(f,r,c)}})}_import(f,r,c){return __async2(this,null,function*(){if(r==null||c==null)return null;const d=yield this._v1Import(f,r,c);if(d)return d;const l=yield this._v0Import(f,r,c);return l||null})}_v1Import(f,r,c){return __async2(this,null,function*(){var d,l,m;const s=this.parser.json;if(!(((d=s.extensionsUsed)==null?void 0:d.indexOf("VRMC_vrm"))!==-1))return null;const p=(l=s.extensions)==null?void 0:l.VRMC_vrm;if(!p)return null;const a=p.specVersion;if(!POSSIBLE_SPEC_VERSIONS4.has(a))return console.warn(`VRMLookAtLoaderPlugin: Unknown VRMC_vrm specVersion "${a}"`),null;const o=p.lookAt;if(!o)return null;const t=o.type==="expression"?1:10,e=this._v1ImportRangeMap(o.rangeMapHorizontalInner,t),n=this._v1ImportRangeMap(o.rangeMapHorizontalOuter,t),i=this._v1ImportRangeMap(o.rangeMapVerticalDown,t),u=this._v1ImportRangeMap(o.rangeMapVerticalUp,t);let g;o.type==="expression"?g=new VRMLookAtExpressionApplier(c,e,n,i,u):g=new VRMLookAtBoneApplier(r,e,n,i,u);const b=this._importLookAt(r,g);return b.offsetFromHeadBone.fromArray((m=o.offsetFromHeadBone)!=null?m:[0,.06,0]),b})}_v1ImportRangeMap(f,r){var c,d;let l=(c=f==null?void 0:f.inputMaxValue)!=null?c:90;const m=(d=f==null?void 0:f.outputScale)!=null?d:r;return l(console.error(s),console.warn("VRMMetaLoaderPlugin: Failed to load a thumbnail image"),null))})}},VRMCore=class{constructor(f){this.scene=f.scene,this.meta=f.meta,this.humanoid=f.humanoid,this.expressionManager=f.expressionManager,this.firstPerson=f.firstPerson,this.lookAt=f.lookAt}update(f){this.humanoid.update(),this.lookAt&&this.lookAt.update(f),this.expressionManager&&this.expressionManager.update()}},VRM=class extends VRMCore{constructor(f){super(f),this.materials=f.materials,this.springBoneManager=f.springBoneManager,this.nodeConstraintManager=f.nodeConstraintManager}update(f){super.update(f),this.nodeConstraintManager&&this.nodeConstraintManager.update(),this.springBoneManager&&this.springBoneManager.update(f),this.materials&&this.materials.forEach(r=>{r.update&&r.update(f)})}},__defProp=Object.defineProperty,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(f,r,c)=>r in f?__defProp(f,r,{enumerable:!0,configurable:!0,writable:!0,value:c}):f[r]=c,__spreadValues=(f,r)=>{for(var c in r||(r={}))__hasOwnProp.call(r,c)&&__defNormalProp(f,c,r[c]);if(__getOwnPropSymbols)for(var c of __getOwnPropSymbols(r))__propIsEnum.call(r,c)&&__defNormalProp(f,c,r[c]);return f},__async3=(f,r,c)=>new Promise((d,l)=>{var m=p=>{try{h(c.next(p))}catch(a){l(a)}},s=p=>{try{h(c.throw(p))}catch(a){l(a)}},h=p=>p.done?d(p.value):Promise.resolve(p.value).then(m,s);h((c=c.apply(f,r)).next())}),colorSpaceEncodingMap={"":3e3,srgb:3001};function setTextureColorSpace(f,r){parseInt(REVISION,10)>=152?f.colorSpace=r:f.encoding=colorSpaceEncodingMap[r]}var GLTFMToonMaterialParamsAssignHelper=class{get pending(){return Promise.all(this._pendings)}constructor(f,r){this._parser=f,this._materialParams=r,this._pendings=[]}assignPrimitive(f,r){r!=null&&(this._materialParams[f]=r)}assignColor(f,r,c){r!=null&&(this._materialParams[f]=new Color().fromArray(r),c&&this._materialParams[f].convertSRGBToLinear())}assignTexture(f,r,c){return __async3(this,null,function*(){const d=__async3(this,null,function*(){r!=null&&(yield this._parser.assignTexture(this._materialParams,f,r),c&&setTextureColorSpace(this._materialParams[f],"srgb"))});return this._pendings.push(d),d})}assignTextureByIndex(f,r,c){return __async3(this,null,function*(){return this.assignTexture(f,r!=null?{index:r}:void 0,c)})}},mtoon_default=`// #define PHONG + +varying vec3 vViewPosition; + +#ifndef FLAT_SHADED + varying vec3 vNormal; +#endif + +#include + +// #include +#ifdef MTOON_USE_UV + varying vec2 vUv; + + // COMPAT: pre-r151 uses a common uvTransform + #if THREE_VRM_THREE_REVISION < 151 + uniform mat3 uvTransform; + #endif +#endif + +// #include +// COMAPT: pre-r151 uses uv2 for lightMap and aoMap +#if THREE_VRM_THREE_REVISION < 151 + #if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) + attribute vec2 uv2; + varying vec2 vUv2; + uniform mat3 uv2Transform; + #endif +#endif + +// #include +// #include +#include +#include +#include +#include +#include +#include +#include + +#ifdef USE_OUTLINEWIDTHMULTIPLYTEXTURE + uniform sampler2D outlineWidthMultiplyTexture; + uniform mat3 outlineWidthMultiplyTextureUvTransform; +#endif + +uniform float outlineWidthFactor; + +void main() { + + // #include + #ifdef MTOON_USE_UV + // COMPAT: pre-r151 uses a common uvTransform + #if THREE_VRM_THREE_REVISION >= 151 + vUv = uv; + #else + vUv = ( uvTransform * vec3( uv, 1 ) ).xy; + #endif + #endif + + // #include + // COMAPT: pre-r151 uses uv2 for lightMap and aoMap + #if THREE_VRM_THREE_REVISION < 151 + #if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) + vUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy; + #endif + #endif + + #include + + #include + #include + #include + #include + + // we need this to compute the outline properly + objectNormal = normalize( objectNormal ); + + #include + + #ifndef FLAT_SHADED // Normal computed with derivatives when FLAT_SHADED + vNormal = normalize( transformedNormal ); + #endif + + #include + + #include + #include + // #include + #include + #include + #include + + vViewPosition = - mvPosition.xyz; + + #ifdef OUTLINE + float worldNormalLength = length( transformedNormal ); + vec3 outlineOffset = outlineWidthFactor * worldNormalLength * objectNormal; + + #ifdef USE_OUTLINEWIDTHMULTIPLYTEXTURE + vec2 outlineWidthMultiplyTextureUv = ( outlineWidthMultiplyTextureUvTransform * vec3( vUv, 1 ) ).xy; + float outlineTex = texture2D( outlineWidthMultiplyTexture, outlineWidthMultiplyTextureUv ).g; + outlineOffset *= outlineTex; + #endif + + #ifdef OUTLINE_WIDTH_SCREEN + outlineOffset *= vViewPosition.z / projectionMatrix[ 1 ].y; + #endif + + gl_Position = projectionMatrix * modelViewMatrix * vec4( outlineOffset + transformed, 1.0 ); + + gl_Position.z += 1E-6 * gl_Position.w; // anti-artifact magic + #endif + + #include + // #include + #include + #include + +}`,mtoon_default2=`// #define PHONG + +uniform vec3 litFactor; + +uniform float opacity; + +uniform vec3 shadeColorFactor; +#ifdef USE_SHADEMULTIPLYTEXTURE + uniform sampler2D shadeMultiplyTexture; + uniform mat3 shadeMultiplyTextureUvTransform; +#endif + +uniform float shadingShiftFactor; +uniform float shadingToonyFactor; + +#ifdef USE_SHADINGSHIFTTEXTURE + uniform sampler2D shadingShiftTexture; + uniform mat3 shadingShiftTextureUvTransform; + uniform float shadingShiftTextureScale; +#endif + +uniform float giEqualizationFactor; + +uniform vec3 parametricRimColorFactor; +#ifdef USE_RIMMULTIPLYTEXTURE + uniform sampler2D rimMultiplyTexture; + uniform mat3 rimMultiplyTextureUvTransform; +#endif +uniform float rimLightingMixFactor; +uniform float parametricRimFresnelPowerFactor; +uniform float parametricRimLiftFactor; + +#ifdef USE_MATCAPTEXTURE + uniform vec3 matcapFactor; + uniform sampler2D matcapTexture; + uniform mat3 matcapTextureUvTransform; +#endif + +uniform vec3 emissive; +uniform float emissiveIntensity; + +uniform vec3 outlineColorFactor; +uniform float outlineLightingMixFactor; + +#ifdef USE_UVANIMATIONMASKTEXTURE + uniform sampler2D uvAnimationMaskTexture; + uniform mat3 uvAnimationMaskTextureUvTransform; +#endif + +uniform float uvAnimationScrollXOffset; +uniform float uvAnimationScrollYOffset; +uniform float uvAnimationRotationPhase; + +#include +#include +#include +#include + +// #include +#if ( defined( MTOON_USE_UV ) && !defined( MTOON_UVS_VERTEX_ONLY ) ) + varying vec2 vUv; +#endif + +// #include +// COMAPT: pre-r151 uses uv2 for lightMap and aoMap +#if THREE_VRM_THREE_REVISION < 151 + #if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) + varying vec2 vUv2; + #endif +#endif + +#include + +#ifdef USE_MAP + uniform mat3 mapUvTransform; +#endif + +// #include + +#include + +#include +// #include +#include + +#ifdef USE_EMISSIVEMAP + uniform mat3 emissiveMapUvTransform; +#endif + +// #include +// #include +// #include +#include + +// #include +// COMPAT: pre-r151 doesn't have BRDF_Lambert in +#if THREE_VRM_THREE_REVISION < 151 + vec3 BRDF_Lambert( const in vec3 diffuseColor ) { + return RECIPROCAL_PI * diffuseColor; + } +#endif + +#include + +#include + +// #include +varying vec3 vViewPosition; + +struct MToonMaterial { + vec3 diffuseColor; + vec3 shadeColor; + float shadingShift; +}; + +float linearstep( float a, float b, float t ) { + return clamp( ( t - a ) / ( b - a ), 0.0, 1.0 ); +} + +/** + * Convert NdotL into toon shading factor using shadingShift and shadingToony + */ +float getShading( + const in float dotNL, + const in float shadow, + const in float shadingShift +) { + float shading = dotNL; + shading = shading + shadingShift; + shading = linearstep( -1.0 + shadingToonyFactor, 1.0 - shadingToonyFactor, shading ); + shading *= shadow; + return shading; +} + +/** + * Mix diffuseColor and shadeColor using shading factor and light color + */ +vec3 getDiffuse( + const in MToonMaterial material, + const in float shading, + in vec3 lightColor +) { + #ifdef DEBUG_LITSHADERATE + return vec3( BRDF_Lambert( shading * lightColor ) ); + #endif + + vec3 col = lightColor * BRDF_Lambert( mix( material.shadeColor, material.diffuseColor, shading ) ); + + // The "comment out if you want to PBR absolutely" line + #ifdef V0_COMPAT_SHADE + col = min( col, material.diffuseColor ); + #endif + + return col; +} + +// COMPAT: pre-r156 uses a struct GeometricContext +#if THREE_VRM_THREE_REVISION >= 157 + void RE_Direct_MToon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in MToonMaterial material, const in float shadow, inout ReflectedLight reflectedLight ) { + float dotNL = clamp( dot( geometryNormal, directLight.direction ), -1.0, 1.0 ); + vec3 irradiance = directLight.color; + + // directSpecular will be used for rim lighting, not an actual specular + reflectedLight.directSpecular += irradiance; + + irradiance *= dotNL; + + float shading = getShading( dotNL, shadow, material.shadingShift ); + + // toon shaded diffuse + reflectedLight.directDiffuse += getDiffuse( material, shading, directLight.color ); + } + + void RE_IndirectDiffuse_MToon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in MToonMaterial material, inout ReflectedLight reflectedLight ) { + // indirect diffuse will use diffuseColor, no shadeColor involved + reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); + + // directSpecular will be used for rim lighting, not an actual specular + reflectedLight.directSpecular += irradiance; + } +#else + void RE_Direct_MToon( const in IncidentLight directLight, const in GeometricContext geometry, const in MToonMaterial material, const in float shadow, inout ReflectedLight reflectedLight ) { + float dotNL = clamp( dot( geometry.normal, directLight.direction ), -1.0, 1.0 ); + vec3 irradiance = directLight.color; + + // directSpecular will be used for rim lighting, not an actual specular + reflectedLight.directSpecular += irradiance; + + irradiance *= dotNL; + + float shading = getShading( dotNL, shadow, material.shadingShift ); + + // toon shaded diffuse + reflectedLight.directDiffuse += getDiffuse( material, shading, directLight.color ); + } + + void RE_IndirectDiffuse_MToon( const in vec3 irradiance, const in GeometricContext geometry, const in MToonMaterial material, inout ReflectedLight reflectedLight ) { + // indirect diffuse will use diffuseColor, no shadeColor involved + reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); + + // directSpecular will be used for rim lighting, not an actual specular + reflectedLight.directSpecular += irradiance; + } +#endif + +#define RE_Direct RE_Direct_MToon +#define RE_IndirectDiffuse RE_IndirectDiffuse_MToon +#define Material_LightProbeLOD( material ) (0) + +#include +// #include + +// #include +#ifdef USE_NORMALMAP + + uniform sampler2D normalMap; + uniform mat3 normalMapUvTransform; + uniform vec2 normalScale; + +#endif + +// COMPAT: pre-r151 +// USE_NORMALMAP_OBJECTSPACE used to be OBJECTSPACE_NORMALMAP in pre-r151 +#if defined( USE_NORMALMAP_OBJECTSPACE ) || defined( OBJECTSPACE_NORMALMAP ) + + uniform mat3 normalMatrix; + +#endif + +// COMPAT: pre-r151 +// USE_NORMALMAP_TANGENTSPACE used to be TANGENTSPACE_NORMALMAP in pre-r151 +#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( TANGENTSPACE_NORMALMAP ) ) + + // Per-Pixel Tangent Space Normal Mapping + // http://hacksoflife.blogspot.ch/2009/11/per-pixel-tangent-space-normal-mapping.html + + // three-vrm specific change: it requires \`uv\` as an input in order to support uv scrolls + + // Temporary compat against shader change @ Three.js r126, r151 + #if THREE_VRM_THREE_REVISION >= 151 + + 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 ); + + } + + #else + + vec3 perturbNormal2Arb( vec2 uv, vec3 eye_pos, vec3 surf_norm, vec3 mapN, float faceDirection ) { + + vec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) ); + vec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) ); + vec2 st0 = dFdx( uv.st ); + vec2 st1 = dFdy( uv.st ); + + vec3 N = normalize( 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; + + // three-vrm specific change: Workaround for the issue that happens when delta of uv = 0.0 + // TODO: Is this still required? Or shall I make a PR about it? + if ( length( T ) == 0.0 || length( B ) == 0.0 ) { + return surf_norm; + } + + float det = max( dot( T, T ), dot( B, B ) ); + float scale = ( det == 0.0 ) ? 0.0 : faceDirection * inversesqrt( det ); + + return normalize( T * ( mapN.x * scale ) + B * ( mapN.y * scale ) + N * mapN.z ); + + } + + #endif + +#endif + +// #include +#include +#include + +// == post correction ========================================================== +void postCorrection() { + #include + #include + #include + #include + #include +} + +// == main procedure =========================================================== +void main() { + #include + + vec2 uv = vec2(0.5, 0.5); + + #if ( defined( MTOON_USE_UV ) && !defined( MTOON_UVS_VERTEX_ONLY ) ) + uv = vUv; + + float uvAnimMask = 1.0; + #ifdef USE_UVANIMATIONMASKTEXTURE + vec2 uvAnimationMaskTextureUv = ( uvAnimationMaskTextureUvTransform * vec3( uv, 1 ) ).xy; + uvAnimMask = texture2D( uvAnimationMaskTexture, uvAnimationMaskTextureUv ).b; + #endif + + float uvRotCos = cos( uvAnimationRotationPhase * uvAnimMask ); + float uvRotSin = sin( uvAnimationRotationPhase * uvAnimMask ); + uv = mat2( uvRotCos, -uvRotSin, uvRotSin, uvRotCos ) * ( uv - 0.5 ) + 0.5; + uv = uv + vec2( uvAnimationScrollXOffset, uvAnimationScrollYOffset ) * uvAnimMask; + #endif + + #ifdef DEBUG_UV + gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); + #if ( defined( MTOON_USE_UV ) && !defined( MTOON_UVS_VERTEX_ONLY ) ) + gl_FragColor = vec4( uv, 0.0, 1.0 ); + #endif + return; + #endif + + vec4 diffuseColor = vec4( litFactor, opacity ); + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive * emissiveIntensity; + + #include + + // #include + #ifdef USE_MAP + vec2 mapUv = ( mapUvTransform * vec3( uv, 1 ) ).xy; + vec4 sampledDiffuseColor = texture2D( map, mapUv ); + #ifdef DECODE_VIDEO_TEXTURE + sampledDiffuseColor = vec4( mix( pow( sampledDiffuseColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), sampledDiffuseColor.rgb * 0.0773993808, vec3( lessThanEqual( sampledDiffuseColor.rgb, vec3( 0.04045 ) ) ) ), sampledDiffuseColor.w ); + #endif + diffuseColor *= sampledDiffuseColor; + #endif + + // #include + #if ( defined( USE_COLOR ) && !defined( IGNORE_VERTEX_COLOR ) ) + diffuseColor.rgb *= vColor; + #endif + + // #include + + #include + + // #include + + // #include + 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 + + #ifdef USE_NORMALMAP + + vec2 normalMapUv = ( normalMapUvTransform * vec3( uv, 1 ) ).xy; + + #endif + + #ifdef USE_NORMALMAP_TANGENTSPACE + + #ifdef USE_TANGENT + + mat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); + + #else + + mat3 tbn = getTangentFrame( - vViewPosition, normal, normalMapUv ); + + #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 + + // non perturbed normal for clearcoat among others + + vec3 nonPerturbedNormal = normal; + + #ifdef OUTLINE + normal *= -1.0; + #endif + + // #include + + // COMPAT: pre-r151 + // USE_NORMALMAP_OBJECTSPACE used to be OBJECTSPACE_NORMALMAP in pre-r151 + #if defined( USE_NORMALMAP_OBJECTSPACE ) || defined( OBJECTSPACE_NORMALMAP ) + + normal = texture2D( normalMap, normalMapUv ).xyz * 2.0 - 1.0; // overrides both flatShading and attribute normals + + #ifdef FLIP_SIDED + + normal = - normal; + + #endif + + #ifdef DOUBLE_SIDED + + normal = normal * faceDirection; + + #endif + + normal = normalize( normalMatrix * normal ); + + // COMPAT: pre-r151 + // USE_NORMALMAP_TANGENTSPACE used to be TANGENTSPACE_NORMALMAP in pre-r151 + #elif defined( USE_NORMALMAP_TANGENTSPACE ) || defined( TANGENTSPACE_NORMALMAP ) + + vec3 mapN = texture2D( normalMap, normalMapUv ).xyz * 2.0 - 1.0; + mapN.xy *= normalScale; + + // COMPAT: pre-r151 + #if THREE_VRM_THREE_REVISION >= 151 || defined( USE_TANGENT ) + + normal = normalize( tbn * mapN ); + + #else + + normal = perturbNormal2Arb( uv, -vViewPosition, normal, mapN, faceDirection ); + + #endif + + #endif + + // #include + #ifdef USE_EMISSIVEMAP + vec2 emissiveMapUv = ( emissiveMapUvTransform * vec3( uv, 1 ) ).xy; + totalEmissiveRadiance *= texture2D( emissiveMap, emissiveMapUv ).rgb; + #endif + + #ifdef DEBUG_NORMAL + gl_FragColor = vec4( 0.5 + 0.5 * normal, 1.0 ); + return; + #endif + + // -- MToon: lighting -------------------------------------------------------- + // accumulation + // #include + MToonMaterial material; + + material.diffuseColor = diffuseColor.rgb; + + material.shadeColor = shadeColorFactor; + #ifdef USE_SHADEMULTIPLYTEXTURE + vec2 shadeMultiplyTextureUv = ( shadeMultiplyTextureUvTransform * vec3( uv, 1 ) ).xy; + material.shadeColor *= texture2D( shadeMultiplyTexture, shadeMultiplyTextureUv ).rgb; + #endif + + #if ( defined( USE_COLOR ) && !defined( IGNORE_VERTEX_COLOR ) ) + material.shadeColor.rgb *= vColor; + #endif + + material.shadingShift = shadingShiftFactor; + #ifdef USE_SHADINGSHIFTTEXTURE + vec2 shadingShiftTextureUv = ( shadingShiftTextureUvTransform * vec3( uv, 1 ) ).xy; + material.shadingShift += texture2D( shadingShiftTexture, shadingShiftTextureUv ).r * shadingShiftTextureScale; + #endif + + // #include + + // MToon Specific changes: + // Since we want to take shadows into account of shading instead of irradiance, + // we had to modify the codes that multiplies the results of shadowmap into color of direct lights. + + // COMPAT: pre-r156 uses a struct GeometricContext + #if THREE_VRM_THREE_REVISION >= 157 + vec3 geometryPosition = - vViewPosition; + vec3 geometryNormal = normal; + vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition ); + + vec3 geometryClearcoatNormal; + + #ifdef USE_CLEARCOAT + + geometryClearcoatNormal = clearcoatNormal; + + #endif + #else + GeometricContext geometry; + + geometry.position = - vViewPosition; + geometry.normal = normal; + geometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition ); + + #ifdef USE_CLEARCOAT + + geometry.clearcoatNormal = clearcoatNormal; + + #endif + #endif + + IncidentLight directLight; + + // since these variables will be used in unrolled loop, we have to define in prior + float shadow; + + #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 ]; + + // COMPAT: pre-r156 uses a struct GeometricContext + #if THREE_VRM_THREE_REVISION >= 157 + getPointLightInfo( pointLight, geometryPosition, directLight ); + #else + getPointLightInfo( pointLight, geometry, directLight ); + #endif + + shadow = 1.0; + #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS ) + pointLightShadow = pointLightShadows[ i ]; + // COMPAT: pre-r166 + // r166 introduced shadowIntensity + #if THREE_VRM_THREE_REVISION >= 166 + shadow = all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowIntensity, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0; + #else + shadow = all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0; + #endif + #endif + + // COMPAT: pre-r156 uses a struct GeometricContext + #if THREE_VRM_THREE_REVISION >= 157 + RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, shadow, reflectedLight ); + #else + RE_Direct( directLight, geometry, material, shadow, reflectedLight ); + #endif + + } + #pragma unroll_loop_end + + #endif + + #if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct ) + + SpotLight spotLight; + #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 ]; + + // COMPAT: pre-r156 uses a struct GeometricContext + #if THREE_VRM_THREE_REVISION >= 157 + getSpotLightInfo( spotLight, geometryPosition, directLight ); + #else + getSpotLightInfo( spotLight, geometry, directLight ); + #endif + + shadow = 1.0; + #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) + spotLightShadow = spotLightShadows[ i ]; + // COMPAT: pre-r166 + // r166 introduced shadowIntensity + #if THREE_VRM_THREE_REVISION >= 166 + shadow = all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowIntensity, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0; + #else + shadow = all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0; + #endif + #endif + + // COMPAT: pre-r156 uses a struct GeometricContext + #if THREE_VRM_THREE_REVISION >= 157 + RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, shadow, reflectedLight ); + #else + RE_Direct( directLight, geometry, material, shadow, reflectedLight ); + #endif + + } + #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 ]; + + // COMPAT: pre-r156 uses a struct GeometricContext + #if THREE_VRM_THREE_REVISION >= 157 + getDirectionalLightInfo( directionalLight, directLight ); + #else + getDirectionalLightInfo( directionalLight, geometry, directLight ); + #endif + + shadow = 1.0; + #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS ) + directionalLightShadow = directionalLightShadows[ i ]; + // COMPAT: pre-r166 + // r166 introduced shadowIntensity + #if THREE_VRM_THREE_REVISION >= 166 + shadow = all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; + #else + shadow = all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; + #endif + #endif + + // COMPAT: pre-r156 uses a struct GeometricContext + #if THREE_VRM_THREE_REVISION >= 157 + RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, shadow, reflectedLight ); + #else + RE_Direct( directLight, geometry, material, shadow, reflectedLight ); + #endif + + } + #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, geometry, material, reflectedLight ); + + // } + // #pragma unroll_loop_end + + // #endif + + #if defined( RE_IndirectDiffuse ) + + vec3 iblIrradiance = vec3( 0.0 ); + + vec3 irradiance = getAmbientLightIrradiance( ambientLightColor ); + + // COMPAT: pre-r156 uses a struct GeometricContext + // COMPAT: pre-r156 doesn't have a define USE_LIGHT_PROBES + #if THREE_VRM_THREE_REVISION >= 157 + #if defined( USE_LIGHT_PROBES ) + irradiance += getLightProbeIrradiance( lightProbe, geometryNormal ); + #endif + #else + irradiance += getLightProbeIrradiance( lightProbe, geometry.normal ); + #endif + + #if ( NUM_HEMI_LIGHTS > 0 ) + + #pragma unroll_loop_start + for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { + + // COMPAT: pre-r156 uses a struct GeometricContext + #if THREE_VRM_THREE_REVISION >= 157 + irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal ); + #else + irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry.normal ); + #endif + + } + #pragma unroll_loop_end + + #endif + + #endif + + // #if defined( RE_IndirectSpecular ) + + // vec3 radiance = vec3( 0.0 ); + // vec3 clearcoatRadiance = vec3( 0.0 ); + + // #endif + + #include + #include + + // modulation + #include + + vec3 col = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse; + + #ifdef DEBUG_LITSHADERATE + gl_FragColor = vec4( col, diffuseColor.a ); + postCorrection(); + return; + #endif + + // -- MToon: rim lighting ----------------------------------------- + vec3 viewDir = normalize( vViewPosition ); + + #ifndef PHYSICALLY_CORRECT_LIGHTS + reflectedLight.directSpecular /= PI; + #endif + vec3 rimMix = mix( vec3( 1.0 ), reflectedLight.directSpecular, 1.0 ); + + vec3 rim = parametricRimColorFactor * pow( saturate( 1.0 - dot( viewDir, normal ) + parametricRimLiftFactor ), parametricRimFresnelPowerFactor ); + + #ifdef USE_MATCAPTEXTURE + { + vec3 x = normalize( vec3( viewDir.z, 0.0, -viewDir.x ) ); + vec3 y = cross( viewDir, x ); // guaranteed to be normalized + vec2 sphereUv = 0.5 + 0.5 * vec2( dot( x, normal ), -dot( y, normal ) ); + sphereUv = ( matcapTextureUvTransform * vec3( sphereUv, 1 ) ).xy; + vec3 matcap = texture2D( matcapTexture, sphereUv ).rgb; + rim += matcapFactor * matcap; + } + #endif + + #ifdef USE_RIMMULTIPLYTEXTURE + vec2 rimMultiplyTextureUv = ( rimMultiplyTextureUvTransform * vec3( uv, 1 ) ).xy; + rim *= texture2D( rimMultiplyTexture, rimMultiplyTextureUv ).rgb; + #endif + + col += rimMix * rim; + + // -- MToon: Emission -------------------------------------------------------- + col += totalEmissiveRadiance; + + // #include + + // -- Almost done! ----------------------------------------------------------- + #if defined( OUTLINE ) + col = outlineColorFactor.rgb * mix( vec3( 1.0 ), col, outlineLightingMixFactor ); + #endif + + #ifdef OPAQUE + diffuseColor.a = 1.0; + #endif + + gl_FragColor = vec4( col, diffuseColor.a ); + postCorrection(); +} +`,MToonMaterialDebugMode={None:"none"},MToonMaterialOutlineWidthMode={None:"none",ScreenCoordinates:"screenCoordinates"},encodingColorSpaceMap={3e3:"",3001:"srgb"};function getTextureColorSpace(f){return parseInt(REVISION,10)>=152?f.colorSpace:encodingColorSpaceMap[f.encoding]}var MToonMaterial=class extends ShaderMaterial{constructor(f={}){var r;super({vertexShader:mtoon_default,fragmentShader:mtoon_default2}),this.uvAnimationScrollXSpeedFactor=0,this.uvAnimationScrollYSpeedFactor=0,this.uvAnimationRotationSpeedFactor=0,this.fog=!0,this.normalMapType=TangentSpaceNormalMap,this._ignoreVertexColor=!0,this._v0CompatShade=!1,this._debugMode=MToonMaterialDebugMode.None,this._outlineWidthMode=MToonMaterialOutlineWidthMode.None,this._isOutline=!1,f.transparentWithZWrite&&(f.depthWrite=!0),delete f.transparentWithZWrite,f.fog=!0,f.lights=!0,f.clipping=!0,this.uniforms=UniformsUtils.merge([UniformsLib.common,UniformsLib.normalmap,UniformsLib.emissivemap,UniformsLib.fog,UniformsLib.lights,{litFactor:{value:new Color(1,1,1)},mapUvTransform:{value:new Matrix3},colorAlpha:{value:1},normalMapUvTransform:{value:new Matrix3},shadeColorFactor:{value:new Color(0,0,0)},shadeMultiplyTexture:{value:null},shadeMultiplyTextureUvTransform:{value:new Matrix3},shadingShiftFactor:{value:0},shadingShiftTexture:{value:null},shadingShiftTextureUvTransform:{value:new Matrix3},shadingShiftTextureScale:{value:1},shadingToonyFactor:{value:.9},giEqualizationFactor:{value:.9},matcapFactor:{value:new Color(1,1,1)},matcapTexture:{value:null},matcapTextureUvTransform:{value:new Matrix3},parametricRimColorFactor:{value:new Color(0,0,0)},rimMultiplyTexture:{value:null},rimMultiplyTextureUvTransform:{value:new Matrix3},rimLightingMixFactor:{value:1},parametricRimFresnelPowerFactor:{value:5},parametricRimLiftFactor:{value:0},emissive:{value:new Color(0,0,0)},emissiveIntensity:{value:1},emissiveMapUvTransform:{value:new Matrix3},outlineWidthMultiplyTexture:{value:null},outlineWidthMultiplyTextureUvTransform:{value:new Matrix3},outlineWidthFactor:{value:0},outlineColorFactor:{value:new Color(0,0,0)},outlineLightingMixFactor:{value:1},uvAnimationMaskTexture:{value:null},uvAnimationMaskTextureUvTransform:{value:new Matrix3},uvAnimationScrollXOffset:{value:0},uvAnimationScrollYOffset:{value:0},uvAnimationRotationPhase:{value:0}},(r=f.uniforms)!=null?r:{}]),this.setValues(f),this._uploadUniformsWorkaround(),this.customProgramCacheKey=()=>[...Object.entries(this._generateDefines()).map(([c,d])=>`${c}:${d}`),this.matcapTexture?`matcapTextureColorSpace:${getTextureColorSpace(this.matcapTexture)}`:"",this.shadeMultiplyTexture?`shadeMultiplyTextureColorSpace:${getTextureColorSpace(this.shadeMultiplyTexture)}`:"",this.rimMultiplyTexture?`rimMultiplyTextureColorSpace:${getTextureColorSpace(this.rimMultiplyTexture)}`:""].join(","),this.onBeforeCompile=c=>{const d=parseInt(REVISION,10),l=Object.entries(__spreadValues(__spreadValues({},this._generateDefines()),this.defines)).filter(([m,s])=>!!s).map(([m,s])=>`#define ${m} ${s}`).join(` +`)+` +`;c.vertexShader=l+c.vertexShader,c.fragmentShader=l+c.fragmentShader,d<154&&(c.fragmentShader=c.fragmentShader.replace("#include ","#include "))}}get color(){return this.uniforms.litFactor.value}set color(f){this.uniforms.litFactor.value=f}get map(){return this.uniforms.map.value}set map(f){this.uniforms.map.value=f}get normalMap(){return this.uniforms.normalMap.value}set normalMap(f){this.uniforms.normalMap.value=f}get normalScale(){return this.uniforms.normalScale.value}set normalScale(f){this.uniforms.normalScale.value=f}get emissive(){return this.uniforms.emissive.value}set emissive(f){this.uniforms.emissive.value=f}get emissiveIntensity(){return this.uniforms.emissiveIntensity.value}set emissiveIntensity(f){this.uniforms.emissiveIntensity.value=f}get emissiveMap(){return this.uniforms.emissiveMap.value}set emissiveMap(f){this.uniforms.emissiveMap.value=f}get shadeColorFactor(){return this.uniforms.shadeColorFactor.value}set shadeColorFactor(f){this.uniforms.shadeColorFactor.value=f}get shadeMultiplyTexture(){return this.uniforms.shadeMultiplyTexture.value}set shadeMultiplyTexture(f){this.uniforms.shadeMultiplyTexture.value=f}get shadingShiftFactor(){return this.uniforms.shadingShiftFactor.value}set shadingShiftFactor(f){this.uniforms.shadingShiftFactor.value=f}get shadingShiftTexture(){return this.uniforms.shadingShiftTexture.value}set shadingShiftTexture(f){this.uniforms.shadingShiftTexture.value=f}get shadingShiftTextureScale(){return this.uniforms.shadingShiftTextureScale.value}set shadingShiftTextureScale(f){this.uniforms.shadingShiftTextureScale.value=f}get shadingToonyFactor(){return this.uniforms.shadingToonyFactor.value}set shadingToonyFactor(f){this.uniforms.shadingToonyFactor.value=f}get giEqualizationFactor(){return this.uniforms.giEqualizationFactor.value}set giEqualizationFactor(f){this.uniforms.giEqualizationFactor.value=f}get matcapFactor(){return this.uniforms.matcapFactor.value}set matcapFactor(f){this.uniforms.matcapFactor.value=f}get matcapTexture(){return this.uniforms.matcapTexture.value}set matcapTexture(f){this.uniforms.matcapTexture.value=f}get parametricRimColorFactor(){return this.uniforms.parametricRimColorFactor.value}set parametricRimColorFactor(f){this.uniforms.parametricRimColorFactor.value=f}get rimMultiplyTexture(){return this.uniforms.rimMultiplyTexture.value}set rimMultiplyTexture(f){this.uniforms.rimMultiplyTexture.value=f}get rimLightingMixFactor(){return this.uniforms.rimLightingMixFactor.value}set rimLightingMixFactor(f){this.uniforms.rimLightingMixFactor.value=f}get parametricRimFresnelPowerFactor(){return this.uniforms.parametricRimFresnelPowerFactor.value}set parametricRimFresnelPowerFactor(f){this.uniforms.parametricRimFresnelPowerFactor.value=f}get parametricRimLiftFactor(){return this.uniforms.parametricRimLiftFactor.value}set parametricRimLiftFactor(f){this.uniforms.parametricRimLiftFactor.value=f}get outlineWidthMultiplyTexture(){return this.uniforms.outlineWidthMultiplyTexture.value}set outlineWidthMultiplyTexture(f){this.uniforms.outlineWidthMultiplyTexture.value=f}get outlineWidthFactor(){return this.uniforms.outlineWidthFactor.value}set outlineWidthFactor(f){this.uniforms.outlineWidthFactor.value=f}get outlineColorFactor(){return this.uniforms.outlineColorFactor.value}set outlineColorFactor(f){this.uniforms.outlineColorFactor.value=f}get outlineLightingMixFactor(){return this.uniforms.outlineLightingMixFactor.value}set outlineLightingMixFactor(f){this.uniforms.outlineLightingMixFactor.value=f}get uvAnimationMaskTexture(){return this.uniforms.uvAnimationMaskTexture.value}set uvAnimationMaskTexture(f){this.uniforms.uvAnimationMaskTexture.value=f}get uvAnimationScrollXOffset(){return this.uniforms.uvAnimationScrollXOffset.value}set uvAnimationScrollXOffset(f){this.uniforms.uvAnimationScrollXOffset.value=f}get uvAnimationScrollYOffset(){return this.uniforms.uvAnimationScrollYOffset.value}set uvAnimationScrollYOffset(f){this.uniforms.uvAnimationScrollYOffset.value=f}get uvAnimationRotationPhase(){return this.uniforms.uvAnimationRotationPhase.value}set uvAnimationRotationPhase(f){this.uniforms.uvAnimationRotationPhase.value=f}get ignoreVertexColor(){return this._ignoreVertexColor}set ignoreVertexColor(f){this._ignoreVertexColor=f,this.needsUpdate=!0}get v0CompatShade(){return this._v0CompatShade}set v0CompatShade(f){this._v0CompatShade=f,this.needsUpdate=!0}get debugMode(){return this._debugMode}set debugMode(f){this._debugMode=f,this.needsUpdate=!0}get outlineWidthMode(){return this._outlineWidthMode}set outlineWidthMode(f){this._outlineWidthMode=f,this.needsUpdate=!0}get isOutline(){return this._isOutline}set isOutline(f){this._isOutline=f,this.needsUpdate=!0}get isMToonMaterial(){return!0}update(f){this._uploadUniformsWorkaround(),this._updateUVAnimation(f)}copy(f){return super.copy(f),this.map=f.map,this.normalMap=f.normalMap,this.emissiveMap=f.emissiveMap,this.shadeMultiplyTexture=f.shadeMultiplyTexture,this.shadingShiftTexture=f.shadingShiftTexture,this.matcapTexture=f.matcapTexture,this.rimMultiplyTexture=f.rimMultiplyTexture,this.outlineWidthMultiplyTexture=f.outlineWidthMultiplyTexture,this.uvAnimationMaskTexture=f.uvAnimationMaskTexture,this.normalMapType=f.normalMapType,this.uvAnimationScrollXSpeedFactor=f.uvAnimationScrollXSpeedFactor,this.uvAnimationScrollYSpeedFactor=f.uvAnimationScrollYSpeedFactor,this.uvAnimationRotationSpeedFactor=f.uvAnimationRotationSpeedFactor,this.ignoreVertexColor=f.ignoreVertexColor,this.v0CompatShade=f.v0CompatShade,this.debugMode=f.debugMode,this.outlineWidthMode=f.outlineWidthMode,this.isOutline=f.isOutline,this.needsUpdate=!0,this}_updateUVAnimation(f){this.uniforms.uvAnimationScrollXOffset.value+=f*this.uvAnimationScrollXSpeedFactor,this.uniforms.uvAnimationScrollYOffset.value+=f*this.uvAnimationScrollYSpeedFactor,this.uniforms.uvAnimationRotationPhase.value+=f*this.uvAnimationRotationSpeedFactor,this.uniforms.alphaTest.value=this.alphaTest,this.uniformsNeedUpdate=!0}_uploadUniformsWorkaround(){this.uniforms.opacity.value=this.opacity,this._updateTextureMatrix(this.uniforms.map,this.uniforms.mapUvTransform),this._updateTextureMatrix(this.uniforms.normalMap,this.uniforms.normalMapUvTransform),this._updateTextureMatrix(this.uniforms.emissiveMap,this.uniforms.emissiveMapUvTransform),this._updateTextureMatrix(this.uniforms.shadeMultiplyTexture,this.uniforms.shadeMultiplyTextureUvTransform),this._updateTextureMatrix(this.uniforms.shadingShiftTexture,this.uniforms.shadingShiftTextureUvTransform),this._updateTextureMatrix(this.uniforms.matcapTexture,this.uniforms.matcapTextureUvTransform),this._updateTextureMatrix(this.uniforms.rimMultiplyTexture,this.uniforms.rimMultiplyTextureUvTransform),this._updateTextureMatrix(this.uniforms.outlineWidthMultiplyTexture,this.uniforms.outlineWidthMultiplyTextureUvTransform),this._updateTextureMatrix(this.uniforms.uvAnimationMaskTexture,this.uniforms.uvAnimationMaskTextureUvTransform),this.uniformsNeedUpdate=!0}_generateDefines(){const f=parseInt(REVISION,10),r=this.outlineWidthMultiplyTexture!==null,c=this.map!==null||this.normalMap!==null||this.emissiveMap!==null||this.shadeMultiplyTexture!==null||this.shadingShiftTexture!==null||this.rimMultiplyTexture!==null||this.uvAnimationMaskTexture!==null;return{THREE_VRM_THREE_REVISION:f,OUTLINE:this._isOutline,MTOON_USE_UV:r||c,MTOON_UVS_VERTEX_ONLY:r&&!c,V0_COMPAT_SHADE:this._v0CompatShade,USE_SHADEMULTIPLYTEXTURE:this.shadeMultiplyTexture!==null,USE_SHADINGSHIFTTEXTURE:this.shadingShiftTexture!==null,USE_MATCAPTEXTURE:this.matcapTexture!==null,USE_RIMMULTIPLYTEXTURE:this.rimMultiplyTexture!==null,USE_OUTLINEWIDTHMULTIPLYTEXTURE:this._isOutline&&this.outlineWidthMultiplyTexture!==null,USE_UVANIMATIONMASKTEXTURE:this.uvAnimationMaskTexture!==null,IGNORE_VERTEX_COLOR:this._ignoreVertexColor===!0,DEBUG_NORMAL:this._debugMode==="normal",DEBUG_LITSHADERATE:this._debugMode==="litShadeRate",DEBUG_UV:this._debugMode==="uv",OUTLINE_WIDTH_SCREEN:this._isOutline&&this._outlineWidthMode===MToonMaterialOutlineWidthMode.ScreenCoordinates}}_updateTextureMatrix(f,r){f.value&&(f.value.matrixAutoUpdate&&f.value.updateMatrix(),r.value.copy(f.value.matrix))}},POSSIBLE_SPEC_VERSIONS6=new Set(["1.0","1.0-beta"]),_MToonMaterialLoaderPlugin=class Ft{get name(){return Ft.EXTENSION_NAME}constructor(r,c={}){var d,l,m,s;this.parser=r,this.materialType=(d=c.materialType)!=null?d:MToonMaterial,this.renderOrderOffset=(l=c.renderOrderOffset)!=null?l:0,this.v0CompatShade=(m=c.v0CompatShade)!=null?m:!1,this.debugMode=(s=c.debugMode)!=null?s:"none",this._mToonMaterialSet=new Set}beforeRoot(){return __async3(this,null,function*(){this._removeUnlitExtensionIfMToonExists()})}afterRoot(r){return __async3(this,null,function*(){r.userData.vrmMToonMaterials=Array.from(this._mToonMaterialSet)})}getMaterialType(r){return this._getMToonExtension(r)?this.materialType:null}extendMaterialParams(r,c){const d=this._getMToonExtension(r);return d?this._extendMaterialParams(d,c):null}loadMesh(r){return __async3(this,null,function*(){var c;const d=this.parser,m=(c=d.json.meshes)==null?void 0:c[r];if(m==null)throw new Error(`MToonMaterialLoaderPlugin: Attempt to use meshes[${r}] of glTF but the mesh doesn't exist`);const s=m.primitives,h=yield d.loadMesh(r);if(s.length===1){const p=h,a=s[0].material;a!=null&&this._setupPrimitive(p,a)}else{const p=h;for(let a=0;a{var s;this._getMToonExtension(m)&&((s=l.extensions)!=null&&s.KHR_materials_unlit)&&delete l.extensions.KHR_materials_unlit})}_getMToonExtension(r){var c,d;const s=(c=this.parser.json.materials)==null?void 0:c[r];if(s==null){console.warn(`MToonMaterialLoaderPlugin: Attempt to use materials[${r}] of glTF but the material doesn't exist`);return}const h=(d=s.extensions)==null?void 0:d[Ft.EXTENSION_NAME];if(h==null)return;const p=h.specVersion;if(!POSSIBLE_SPEC_VERSIONS6.has(p)){console.warn(`MToonMaterialLoaderPlugin: Unknown ${Ft.EXTENSION_NAME} specVersion "${p}"`);return}return h}_extendMaterialParams(r,c){return __async3(this,null,function*(){var d;delete c.metalness,delete c.roughness;const l=new GLTFMToonMaterialParamsAssignHelper(this.parser,c);l.assignPrimitive("transparentWithZWrite",r.transparentWithZWrite),l.assignColor("shadeColorFactor",r.shadeColorFactor),l.assignTexture("shadeMultiplyTexture",r.shadeMultiplyTexture,!0),l.assignPrimitive("shadingShiftFactor",r.shadingShiftFactor),l.assignTexture("shadingShiftTexture",r.shadingShiftTexture,!0),l.assignPrimitive("shadingShiftTextureScale",(d=r.shadingShiftTexture)==null?void 0:d.scale),l.assignPrimitive("shadingToonyFactor",r.shadingToonyFactor),l.assignPrimitive("giEqualizationFactor",r.giEqualizationFactor),l.assignColor("matcapFactor",r.matcapFactor),l.assignTexture("matcapTexture",r.matcapTexture,!0),l.assignColor("parametricRimColorFactor",r.parametricRimColorFactor),l.assignTexture("rimMultiplyTexture",r.rimMultiplyTexture,!0),l.assignPrimitive("rimLightingMixFactor",r.rimLightingMixFactor),l.assignPrimitive("parametricRimFresnelPowerFactor",r.parametricRimFresnelPowerFactor),l.assignPrimitive("parametricRimLiftFactor",r.parametricRimLiftFactor),l.assignPrimitive("outlineWidthMode",r.outlineWidthMode),l.assignPrimitive("outlineWidthFactor",r.outlineWidthFactor),l.assignTexture("outlineWidthMultiplyTexture",r.outlineWidthMultiplyTexture,!1),l.assignColor("outlineColorFactor",r.outlineColorFactor),l.assignPrimitive("outlineLightingMixFactor",r.outlineLightingMixFactor),l.assignTexture("uvAnimationMaskTexture",r.uvAnimationMaskTexture,!1),l.assignPrimitive("uvAnimationScrollXSpeedFactor",r.uvAnimationScrollXSpeedFactor),l.assignPrimitive("uvAnimationScrollYSpeedFactor",r.uvAnimationScrollYSpeedFactor),l.assignPrimitive("uvAnimationRotationSpeedFactor",r.uvAnimationRotationSpeedFactor),l.assignPrimitive("v0CompatShade",this.v0CompatShade),l.assignPrimitive("debugMode",this.debugMode),yield l.pending})}_setupPrimitive(r,c){const d=this._getMToonExtension(c);if(d){const l=this._parseRenderOrder(d);r.renderOrder=l+this.renderOrderOffset,this._generateOutline(r),this._addToMaterialSet(r);return}}_shouldGenerateOutline(r){return typeof r.outlineWidthMode=="string"&&r.outlineWidthMode!=="none"&&typeof r.outlineWidthFactor=="number"&&r.outlineWidthFactor>0}_generateOutline(r){const c=r.material;if(!(c instanceof Material)||!this._shouldGenerateOutline(c))return;r.material=[c];const d=c.clone();d.name+=" (Outline)",d.isOutline=!0,d.side=BackSide,r.material.push(d);const l=r.geometry,m=l.index?l.index.count:l.attributes.position.count/3;l.addGroup(0,m,0),l.addGroup(0,m,1)}_addToMaterialSet(r){const c=r.material,d=new Set;Array.isArray(c)?c.forEach(l=>d.add(l)):d.add(c);for(const l of d)this._mToonMaterialSet.add(l)}_parseRenderOrder(r){var c;return(r.transparentWithZWrite?0:19)+((c=r.renderQueueOffsetNumber)!=null?c:0)}};_MToonMaterialLoaderPlugin.EXTENSION_NAME="VRMC_materials_mtoon";var MToonMaterialLoaderPlugin=_MToonMaterialLoaderPlugin,__async4=(f,r,c)=>new Promise((d,l)=>{var m=p=>{try{h(c.next(p))}catch(a){l(a)}},s=p=>{try{h(c.throw(p))}catch(a){l(a)}},h=p=>p.done?d(p.value):Promise.resolve(p.value).then(m,s);h((c=c.apply(f,r)).next())}),_VRMMaterialsHDREmissiveMultiplierLoaderPlugin=class jt{get name(){return jt.EXTENSION_NAME}constructor(r){this.parser=r}extendMaterialParams(r,c){return __async4(this,null,function*(){const d=this._getHDREmissiveMultiplierExtension(r);if(d==null)return;console.warn("VRMMaterialsHDREmissiveMultiplierLoaderPlugin: `VRMC_materials_hdr_emissiveMultiplier` is archived. Use `KHR_materials_emissive_strength` instead.");const l=d.emissiveMultiplier;c.emissiveIntensity=l})}_getHDREmissiveMultiplierExtension(r){var c,d;const s=(c=this.parser.json.materials)==null?void 0:c[r];if(s==null){console.warn(`VRMMaterialsHDREmissiveMultiplierLoaderPlugin: Attempt to use materials[${r}] of glTF but the material doesn't exist`);return}const h=(d=s.extensions)==null?void 0:d[jt.EXTENSION_NAME];if(h!=null)return h}};_VRMMaterialsHDREmissiveMultiplierLoaderPlugin.EXTENSION_NAME="VRMC_materials_hdr_emissiveMultiplier";var VRMMaterialsHDREmissiveMultiplierLoaderPlugin=_VRMMaterialsHDREmissiveMultiplierLoaderPlugin,__defProp2=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols2=Object.getOwnPropertySymbols,__hasOwnProp2=Object.prototype.hasOwnProperty,__propIsEnum2=Object.prototype.propertyIsEnumerable,__defNormalProp2=(f,r,c)=>r in f?__defProp2(f,r,{enumerable:!0,configurable:!0,writable:!0,value:c}):f[r]=c,__spreadValues2=(f,r)=>{for(var c in r||(r={}))__hasOwnProp2.call(r,c)&&__defNormalProp2(f,c,r[c]);if(__getOwnPropSymbols2)for(var c of __getOwnPropSymbols2(r))__propIsEnum2.call(r,c)&&__defNormalProp2(f,c,r[c]);return f},__spreadProps=(f,r)=>__defProps(f,__getOwnPropDescs(r)),__async5=(f,r,c)=>new Promise((d,l)=>{var m=p=>{try{h(c.next(p))}catch(a){l(a)}},s=p=>{try{h(c.throw(p))}catch(a){l(a)}},h=p=>p.done?d(p.value):Promise.resolve(p.value).then(m,s);h((c=c.apply(f,r)).next())});function gammaEOTF(f){return Math.pow(f,2.2)}var VRMMaterialsV0CompatPlugin=class{get name(){return"VRMMaterialsV0CompatPlugin"}constructor(f){var r;this.parser=f,this._renderQueueMapTransparent=new Map,this._renderQueueMapTransparentZWrite=new Map;const c=this.parser.json;c.extensionsUsed=(r=c.extensionsUsed)!=null?r:[],c.extensionsUsed.indexOf("KHR_texture_transform")===-1&&c.extensionsUsed.push("KHR_texture_transform")}beforeRoot(){return __async5(this,null,function*(){var f;const r=this.parser.json,c=(f=r.extensions)==null?void 0:f.VRM,d=c==null?void 0:c.materialProperties;d&&(this._populateRenderQueueMap(d),d.forEach((l,m)=>{var s,h;const p=(s=r.materials)==null?void 0:s[m];if(p==null){console.warn(`VRMMaterialsV0CompatPlugin: Attempt to use materials[${m}] of glTF but the material doesn't exist`);return}if(l.shader==="VRM/MToon"){const a=this._parseV0MToonProperties(l,p);r.materials[m]=a}else if((h=l.shader)!=null&&h.startsWith("VRM/Unlit")){const a=this._parseV0UnlitProperties(l,p);r.materials[m]=a}else l.shader==="VRM_USE_GLTFSHADER"||console.warn(`VRMMaterialsV0CompatPlugin: Unknown shader: ${l.shader}`)}))})}_parseV0MToonProperties(f,r){var c,d,l,m,s,h,p,a,o,t,e,n,i,u,g,b,y,_,v,w,T,A,E,x,P,C,k,$,F,q,D,U,J,Y,Z,te,he,Me,Te,ue,xe,_e,Le,ze,Se,De,Re,Ae,we,ke,Ue,Be,We,qe,je;const Ve=(d=(c=f.keywordMap)==null?void 0:c._ALPHABLEND_ON)!=null?d:!1,$e=((l=f.floatProperties)==null?void 0:l._ZWrite)===1&&Ve,Ye=this._v0ParseRenderQueue(f),le=(s=(m=f.keywordMap)==null?void 0:m._ALPHATEST_ON)!=null?s:!1,pt=Ve?"BLEND":le?"MASK":"OPAQUE",ut=le?(p=(h=f.floatProperties)==null?void 0:h._Cutoff)!=null?p:.5:void 0,Ke=((o=(a=f.floatProperties)==null?void 0:a._CullMode)!=null?o:2)===0,He=this._portTextureTransform(f),lt=((e=(t=f.vectorProperties)==null?void 0:t._Color)!=null?e:[1,1,1,1]).map((ae,ve)=>ve===3?ae:gammaEOTF(ae)),Ce=(n=f.textureProperties)==null?void 0:n._MainTex,nt=Ce!=null?{index:Ce,extensions:__spreadValues2({},He)}:void 0,ie=(u=(i=f.floatProperties)==null?void 0:i._BumpScale)!=null?u:1,Je=(g=f.textureProperties)==null?void 0:g._BumpMap,At=Je!=null?{index:Je,scale:ie,extensions:__spreadValues2({},He)}:void 0,Et=((y=(b=f.vectorProperties)==null?void 0:b._EmissionColor)!=null?y:[0,0,0,1]).map(gammaEOTF),Xe=(_=f.textureProperties)==null?void 0:_._EmissionMap,ye=Xe!=null?{index:Xe,extensions:__spreadValues2({},He)}:void 0,rt=((w=(v=f.vectorProperties)==null?void 0:v._ShadeColor)!=null?w:[.97,.81,.86,1]).map(gammaEOTF),ct=(T=f.textureProperties)==null?void 0:T._ShadeTexture,it=ct!=null?{index:ct,extensions:__spreadValues2({},He)}:void 0;let oe=(E=(A=f.floatProperties)==null?void 0:A._ShadeShift)!=null?E:0,re=(P=(x=f.floatProperties)==null?void 0:x._ShadeToony)!=null?P:.9;re=MathUtils.lerp(re,1,.5+.5*oe),oe=-oe-(1-re);const se=(k=(C=f.floatProperties)==null?void 0:C._IndirectLightIntensity)!=null?k:.1,ft=se?1-se:void 0,et=($=f.textureProperties)==null?void 0:$._SphereAdd,mt=et!=null?[1,1,1]:void 0,gt=et!=null?{index:et}:void 0,bt=(q=(F=f.floatProperties)==null?void 0:F._RimLightingMix)!=null?q:0,dt=(D=f.textureProperties)==null?void 0:D._RimTexture,yt=dt!=null?{index:dt,extensions:__spreadValues2({},He)}:void 0,_t=((J=(U=f.vectorProperties)==null?void 0:U._RimColor)!=null?J:[0,0,0,1]).map(gammaEOTF),vt=(Z=(Y=f.floatProperties)==null?void 0:Y._RimFresnelPower)!=null?Z:1,wt=(he=(te=f.floatProperties)==null?void 0:te._RimLift)!=null?he:0,xt=["none","worldCoordinates","screenCoordinates"][(Te=(Me=f.floatProperties)==null?void 0:Me._OutlineWidthMode)!=null?Te:0];let ot=(xe=(ue=f.floatProperties)==null?void 0:ue._OutlineWidth)!=null?xe:0;ot=.01*ot;const ht=(_e=f.textureProperties)==null?void 0:_e._OutlineWidthTexture,Tt=ht!=null?{index:ht,extensions:__spreadValues2({},He)}:void 0,M=((ze=(Le=f.vectorProperties)==null?void 0:Le._OutlineColor)!=null?ze:[0,0,0]).map(gammaEOTF),N=((De=(Se=f.floatProperties)==null?void 0:Se._OutlineColorMode)!=null?De:0)===1?(Ae=(Re=f.floatProperties)==null?void 0:Re._OutlineLightingMix)!=null?Ae:1:0,V=(we=f.textureProperties)==null?void 0:we._UvAnimMaskTexture,j=V!=null?{index:V,extensions:__spreadValues2({},He)}:void 0,H=(Ue=(ke=f.floatProperties)==null?void 0:ke._UvAnimScrollX)!=null?Ue:0;let X=(We=(Be=f.floatProperties)==null?void 0:Be._UvAnimScrollY)!=null?We:0;X!=null&&(X=-X);const ee=(je=(qe=f.floatProperties)==null?void 0:qe._UvAnimRotation)!=null?je:0,K={specVersion:"1.0",transparentWithZWrite:$e,renderQueueOffsetNumber:Ye,shadeColorFactor:rt,shadeMultiplyTexture:it,shadingShiftFactor:oe,shadingToonyFactor:re,giEqualizationFactor:ft,matcapFactor:mt,matcapTexture:gt,rimLightingMixFactor:bt,rimMultiplyTexture:yt,parametricRimColorFactor:_t,parametricRimFresnelPowerFactor:vt,parametricRimLiftFactor:wt,outlineWidthMode:xt,outlineWidthFactor:ot,outlineWidthMultiplyTexture:Tt,outlineColorFactor:M,outlineLightingMixFactor:N,uvAnimationMaskTexture:j,uvAnimationScrollXSpeedFactor:H,uvAnimationScrollYSpeedFactor:X,uvAnimationRotationSpeedFactor:ee};return __spreadProps(__spreadValues2({},r),{pbrMetallicRoughness:{baseColorFactor:lt,baseColorTexture:nt},normalTexture:At,emissiveTexture:ye,emissiveFactor:Et,alphaMode:pt,alphaCutoff:ut,doubleSided:Ke,extensions:{VRMC_materials_mtoon:K}})}_parseV0UnlitProperties(f,r){var c,d,l,m,s;const h=f.shader==="VRM/UnlitTransparentZWrite",p=f.shader==="VRM/UnlitTransparent"||h,a=this._v0ParseRenderQueue(f),o=f.shader==="VRM/UnlitCutout",t=p?"BLEND":o?"MASK":"OPAQUE",e=o?(d=(c=f.floatProperties)==null?void 0:c._Cutoff)!=null?d:.5:void 0,n=this._portTextureTransform(f),i=((m=(l=f.vectorProperties)==null?void 0:l._Color)!=null?m:[1,1,1,1]).map(gammaEOTF),u=(s=f.textureProperties)==null?void 0:s._MainTex,g=u!=null?{index:u,extensions:__spreadValues2({},n)}:void 0,b={specVersion:"1.0",transparentWithZWrite:h,renderQueueOffsetNumber:a,shadeColorFactor:i,shadeMultiplyTexture:g};return __spreadProps(__spreadValues2({},r),{pbrMetallicRoughness:{baseColorFactor:i,baseColorTexture:g},alphaMode:t,alphaCutoff:e,extensions:{VRMC_materials_mtoon:b}})}_portTextureTransform(f){var r,c,d,l,m;const s=(r=f.vectorProperties)==null?void 0:r._MainTex;if(s==null)return{};const h=[(c=s==null?void 0:s[0])!=null?c:0,(d=s==null?void 0:s[1])!=null?d:0],p=[(l=s==null?void 0:s[2])!=null?l:1,(m=s==null?void 0:s[3])!=null?m:1];return h[1]=1-p[1]-h[1],{KHR_texture_transform:{offset:h,scale:p}}}_v0ParseRenderQueue(f){var r,c;const d=f.shader==="VRM/UnlitTransparentZWrite",l=((r=f.keywordMap)==null?void 0:r._ALPHABLEND_ON)!=null||f.shader==="VRM/UnlitTransparent"||d,m=((c=f.floatProperties)==null?void 0:c._ZWrite)===1||d;let s=0;if(l){const h=f.renderQueue;h!=null&&(m?s=this._renderQueueMapTransparentZWrite.get(h):s=this._renderQueueMapTransparent.get(h))}return s}_populateRenderQueueMap(f){const r=new Set,c=new Set;f.forEach(d=>{var l,m;const s=d.shader==="VRM/UnlitTransparentZWrite",h=((l=d.keywordMap)==null?void 0:l._ALPHABLEND_ON)!=null||d.shader==="VRM/UnlitTransparent"||s,p=((m=d.floatProperties)==null?void 0:m._ZWrite)===1||s;if(h){const a=d.renderQueue;a!=null&&(p?c.add(a):r.add(a))}}),r.size>10&&console.warn(`VRMMaterialsV0CompatPlugin: This VRM uses ${r.size} render queues for Transparent materials while VRM 1.0 only supports up to 10 render queues. The model might not be rendered correctly.`),c.size>10&&console.warn(`VRMMaterialsV0CompatPlugin: This VRM uses ${c.size} render queues for TransparentZWrite materials while VRM 1.0 only supports up to 10 render queues. The model might not be rendered correctly.`),Array.from(r).sort().forEach((d,l)=>{const m=Math.min(Math.max(l-r.size+1,-9),0);this._renderQueueMapTransparent.set(d,m)}),Array.from(c).sort().forEach((d,l)=>{const m=Math.min(Math.max(l,0),9);this._renderQueueMapTransparentZWrite.set(d,m)})}},__async6=(f,r,c)=>new Promise((d,l)=>{var m=p=>{try{h(c.next(p))}catch(a){l(a)}},s=p=>{try{h(c.throw(p))}catch(a){l(a)}},h=p=>p.done?d(p.value):Promise.resolve(p.value).then(m,s);h((c=c.apply(f,r)).next())}),_v3A6=new Vector3,VRMNodeConstraintHelper=class extends Group{constructor(f){super(),this._attrPosition=new BufferAttribute(new Float32Array([0,0,0,0,0,0]),3),this._attrPosition.setUsage(DynamicDrawUsage);const r=new BufferGeometry;r.setAttribute("position",this._attrPosition);const c=new LineBasicMaterial({color:16711935,depthTest:!1,depthWrite:!1});this._line=new Line(r,c),this.add(this._line),this.constraint=f}updateMatrixWorld(f){_v3A6.setFromMatrixPosition(this.constraint.destination.matrixWorld),this._attrPosition.setXYZ(0,_v3A6.x,_v3A6.y,_v3A6.z),this.constraint.source&&_v3A6.setFromMatrixPosition(this.constraint.source.matrixWorld),this._attrPosition.setXYZ(1,_v3A6.x,_v3A6.y,_v3A6.z),this._attrPosition.needsUpdate=!0,super.updateMatrixWorld(f)}};function decomposePosition(f,r){return r.set(f.elements[12],f.elements[13],f.elements[14])}var _v3A22=new Vector3,_v3B4=new Vector3;function decomposeRotation(f,r){return f.decompose(_v3A22,r,_v3B4),r}function quatInvertCompat2(f){return f.invert?f.invert():f.inverse(),f}var VRMNodeConstraint=class{constructor(f,r){this.destination=f,this.source=r,this.weight=1}},_v3A32=new Vector3,_v3B22=new Vector3,_v3C2=new Vector3,_quatA7=new Quaternion,_quatB4=new Quaternion,_quatC2=new Quaternion,VRMAimConstraint=class extends VRMNodeConstraint{get aimAxis(){return this._aimAxis}set aimAxis(f){this._aimAxis=f,this._v3AimAxis.set(f==="PositiveX"?1:f==="NegativeX"?-1:0,f==="PositiveY"?1:f==="NegativeY"?-1:0,f==="PositiveZ"?1:f==="NegativeZ"?-1:0)}get dependencies(){const f=new Set([this.source]);return this.destination.parent&&f.add(this.destination.parent),f}constructor(f,r){super(f,r),this._aimAxis="PositiveX",this._v3AimAxis=new Vector3(1,0,0),this._dstRestQuat=new Quaternion}setInitState(){this._dstRestQuat.copy(this.destination.quaternion)}update(){this.destination.updateWorldMatrix(!0,!1),this.source.updateWorldMatrix(!0,!1);const f=_quatA7.identity(),r=_quatB4.identity();this.destination.parent&&(decomposeRotation(this.destination.parent.matrixWorld,f),quatInvertCompat2(r.copy(f)));const c=_v3A32.copy(this._v3AimAxis).applyQuaternion(this._dstRestQuat).applyQuaternion(f),d=decomposePosition(this.source.matrixWorld,_v3B22).sub(decomposePosition(this.destination.matrixWorld,_v3C2)).normalize(),l=_quatC2.setFromUnitVectors(c,d).premultiply(r).multiply(f).multiply(this._dstRestQuat);this.destination.quaternion.copy(this._dstRestQuat).slerp(l,this.weight)}};function traverseAncestorsFromRoot(f,r){const c=[f];let d=f.parent;for(;d!==null;)c.unshift(d),d=d.parent;c.forEach(l=>{r(l)})}var VRMNodeConstraintManager=class{constructor(){this._constraints=new Set,this._objectConstraintsMap=new Map}get constraints(){return this._constraints}addConstraint(f){this._constraints.add(f);let r=this._objectConstraintsMap.get(f.destination);r==null&&(r=new Set,this._objectConstraintsMap.set(f.destination,r)),r.add(f)}deleteConstraint(f){this._constraints.delete(f),this._objectConstraintsMap.get(f.destination).delete(f)}setInitState(){const f=new Set,r=new Set;for(const c of this._constraints)this._processConstraint(c,f,r,d=>d.setInitState())}update(){const f=new Set,r=new Set;for(const c of this._constraints)this._processConstraint(c,f,r,d=>d.update())}_processConstraint(f,r,c,d){if(c.has(f))return;if(r.has(f))throw new Error("VRMNodeConstraintManager: Circular dependency detected while updating constraints");r.add(f);const l=f.dependencies;for(const m of l)traverseAncestorsFromRoot(m,s=>{const h=this._objectConstraintsMap.get(s);if(h)for(const p of h)this._processConstraint(p,r,c,d)});d(f),c.add(f)}},_quatA22=new Quaternion,_quatB22=new Quaternion,VRMRotationConstraint=class extends VRMNodeConstraint{get dependencies(){return new Set([this.source])}constructor(f,r){super(f,r),this._dstRestQuat=new Quaternion,this._invSrcRestQuat=new Quaternion}setInitState(){this._dstRestQuat.copy(this.destination.quaternion),quatInvertCompat2(this._invSrcRestQuat.copy(this.source.quaternion))}update(){const f=_quatA22.copy(this._invSrcRestQuat).multiply(this.source.quaternion),r=_quatB22.copy(this._dstRestQuat).multiply(f);this.destination.quaternion.copy(this._dstRestQuat).slerp(r,this.weight)}},_v3A42=new Vector3,_quatA32=new Quaternion,_quatB32=new Quaternion,VRMRollConstraint=class extends VRMNodeConstraint{get rollAxis(){return this._rollAxis}set rollAxis(f){this._rollAxis=f,this._v3RollAxis.set(f==="X"?1:0,f==="Y"?1:0,f==="Z"?1:0)}get dependencies(){return new Set([this.source])}constructor(f,r){super(f,r),this._rollAxis="X",this._v3RollAxis=new Vector3(1,0,0),this._dstRestQuat=new Quaternion,this._invDstRestQuat=new Quaternion,this._invSrcRestQuatMulDstRestQuat=new Quaternion}setInitState(){this._dstRestQuat.copy(this.destination.quaternion),quatInvertCompat2(this._invDstRestQuat.copy(this._dstRestQuat)),quatInvertCompat2(this._invSrcRestQuatMulDstRestQuat.copy(this.source.quaternion)).multiply(this._dstRestQuat)}update(){const f=_quatA32.copy(this._invDstRestQuat).multiply(this.source.quaternion).multiply(this._invSrcRestQuatMulDstRestQuat),r=_v3A42.copy(this._v3RollAxis).applyQuaternion(f),d=_quatB32.setFromUnitVectors(r,this._v3RollAxis).premultiply(this._dstRestQuat).multiply(f);this.destination.quaternion.copy(this._dstRestQuat).slerp(d,this.weight)}},POSSIBLE_SPEC_VERSIONS7=new Set(["1.0","1.0-beta"]),_VRMNodeConstraintLoaderPlugin=class Rt{get name(){return Rt.EXTENSION_NAME}constructor(r,c){this.parser=r,this.helperRoot=c==null?void 0:c.helperRoot}afterRoot(r){return __async6(this,null,function*(){r.userData.vrmNodeConstraintManager=yield this._import(r)})}_import(r){return __async6(this,null,function*(){var c;const d=this.parser.json;if(!(((c=d.extensionsUsed)==null?void 0:c.indexOf(Rt.EXTENSION_NAME))!==-1))return null;const m=new VRMNodeConstraintManager,s=yield this.parser.getDependencies("node");return s.forEach((h,p)=>{var a;const o=d.nodes[p],t=(a=o==null?void 0:o.extensions)==null?void 0:a[Rt.EXTENSION_NAME];if(t==null)return;const e=t.specVersion;if(!POSSIBLE_SPEC_VERSIONS7.has(e)){console.warn(`VRMNodeConstraintLoaderPlugin: Unknown ${Rt.EXTENSION_NAME} specVersion "${e}"`);return}const n=t.constraint;if(n.roll!=null){const i=this._importRollConstraint(h,s,n.roll);m.addConstraint(i)}else if(n.aim!=null){const i=this._importAimConstraint(h,s,n.aim);m.addConstraint(i)}else if(n.rotation!=null){const i=this._importRotationConstraint(h,s,n.rotation);m.addConstraint(i)}}),r.scene.updateMatrixWorld(),m.setInitState(),m})}_importRollConstraint(r,c,d){const{source:l,rollAxis:m,weight:s}=d,h=c[l],p=new VRMRollConstraint(r,h);if(m!=null&&(p.rollAxis=m),s!=null&&(p.weight=s),this.helperRoot){const a=new VRMNodeConstraintHelper(p);this.helperRoot.add(a)}return p}_importAimConstraint(r,c,d){const{source:l,aimAxis:m,weight:s}=d,h=c[l],p=new VRMAimConstraint(r,h);if(m!=null&&(p.aimAxis=m),s!=null&&(p.weight=s),this.helperRoot){const a=new VRMNodeConstraintHelper(p);this.helperRoot.add(a)}return p}_importRotationConstraint(r,c,d){const{source:l,weight:m}=d,s=c[l],h=new VRMRotationConstraint(r,s);if(m!=null&&(h.weight=m),this.helperRoot){const p=new VRMNodeConstraintHelper(h);this.helperRoot.add(p)}return h}};_VRMNodeConstraintLoaderPlugin.EXTENSION_NAME="VRMC_node_constraint";var VRMNodeConstraintLoaderPlugin=_VRMNodeConstraintLoaderPlugin,__async7=(f,r,c)=>new Promise((d,l)=>{var m=p=>{try{h(c.next(p))}catch(a){l(a)}},s=p=>{try{h(c.throw(p))}catch(a){l(a)}},h=p=>p.done?d(p.value):Promise.resolve(p.value).then(m,s);h((c=c.apply(f,r)).next())}),VRMSpringBoneColliderShape=class{},_v3A7=new Vector3,_v3B5=new Vector3,VRMSpringBoneColliderShapeCapsule=class extends VRMSpringBoneColliderShape{get type(){return"capsule"}constructor(f){var r,c,d,l;super(),this.offset=(r=f==null?void 0:f.offset)!=null?r:new Vector3(0,0,0),this.tail=(c=f==null?void 0:f.tail)!=null?c:new Vector3(0,0,0),this.radius=(d=f==null?void 0:f.radius)!=null?d:0,this.inside=(l=f==null?void 0:f.inside)!=null?l:!1}calculateCollision(f,r,c,d){_v3A7.setFromMatrixPosition(f),_v3B5.subVectors(this.tail,this.offset).applyMatrix4(f),_v3B5.sub(_v3A7);const l=_v3B5.lengthSq();d.copy(r).sub(_v3A7);const m=_v3B5.dot(d);m<=0||(l<=m||_v3B5.multiplyScalar(m/l),d.sub(_v3B5));const s=d.length(),h=this.inside?this.radius-c-s:s-c-this.radius;return h<0&&(d.multiplyScalar(1/s),this.inside&&d.negate()),h}},_v3A23=new Vector3,_mat3A=new Matrix3,VRMSpringBoneColliderShapePlane=class extends VRMSpringBoneColliderShape{get type(){return"plane"}constructor(f){var r,c;super(),this.offset=(r=f==null?void 0:f.offset)!=null?r:new Vector3(0,0,0),this.normal=(c=f==null?void 0:f.normal)!=null?c:new Vector3(0,0,1)}calculateCollision(f,r,c,d){d.setFromMatrixPosition(f),d.negate().add(r),_mat3A.getNormalMatrix(f),_v3A23.copy(this.normal).applyNormalMatrix(_mat3A).normalize();const l=d.dot(_v3A23)-c;return d.copy(_v3A23),l}},_v3A33=new Vector3,VRMSpringBoneColliderShapeSphere=class extends VRMSpringBoneColliderShape{get type(){return"sphere"}constructor(f){var r,c,d;super(),this.offset=(r=f==null?void 0:f.offset)!=null?r:new Vector3(0,0,0),this.radius=(c=f==null?void 0:f.radius)!=null?c:0,this.inside=(d=f==null?void 0:f.inside)!=null?d:!1}calculateCollision(f,r,c,d){d.subVectors(r,_v3A33.setFromMatrixPosition(f));const l=d.length(),m=this.inside?this.radius-c-l:l-c-this.radius;return m<0&&(d.multiplyScalar(1/l),this.inside&&d.negate()),m}},_v3A43=new Vector3,ColliderShapeCapsuleBufferGeometry=class extends BufferGeometry{constructor(f){super(),this.worldScale=1,this._currentRadius=0,this._currentOffset=new Vector3,this._currentTail=new Vector3,this._shape=f,this._attrPos=new BufferAttribute(new Float32Array(396),3),this.setAttribute("position",this._attrPos),this._attrIndex=new BufferAttribute(new Uint16Array(264),1),this.setIndex(this._attrIndex),this._buildIndex(),this.update()}update(){let f=!1;const r=this._shape.radius/this.worldScale;this._currentRadius!==r&&(this._currentRadius=r,f=!0),this._currentOffset.equals(this._shape.offset)||(this._currentOffset.copy(this._shape.offset),f=!0);const c=_v3A43.copy(this._shape.tail).divideScalar(this.worldScale);this._currentTail.distanceToSquared(c)>1e-10&&(this._currentTail.copy(c),f=!0),f&&this._buildPosition()}_buildPosition(){_v3A43.copy(this._currentTail).sub(this._currentOffset);const f=_v3A43.length()/this._currentRadius;for(let d=0;d<=16;d++){const l=d/16*Math.PI;this._attrPos.setXYZ(d,-Math.sin(l),-Math.cos(l),0),this._attrPos.setXYZ(17+d,f+Math.sin(l),Math.cos(l),0),this._attrPos.setXYZ(34+d,-Math.sin(l),0,-Math.cos(l)),this._attrPos.setXYZ(51+d,f+Math.sin(l),0,Math.cos(l))}for(let d=0;d<32;d++){const l=d/16*Math.PI;this._attrPos.setXYZ(68+d,0,Math.sin(l),Math.cos(l)),this._attrPos.setXYZ(100+d,f,Math.sin(l),Math.cos(l))}const r=Math.atan2(_v3A43.y,Math.sqrt(_v3A43.x*_v3A43.x+_v3A43.z*_v3A43.z)),c=-Math.atan2(_v3A43.z,_v3A43.x);this.rotateZ(r),this.rotateY(c),this.scale(this._currentRadius,this._currentRadius,this._currentRadius),this.translate(this._currentOffset.x,this._currentOffset.y,this._currentOffset.z),this._attrPos.needsUpdate=!0}_buildIndex(){for(let f=0;f<34;f++){const r=(f+1)%34;this._attrIndex.setXY(f*2,f,r),this._attrIndex.setXY(68+f*2,34+f,34+r)}for(let f=0;f<32;f++){const r=(f+1)%32;this._attrIndex.setXY(136+f*2,68+f,68+r),this._attrIndex.setXY(200+f*2,100+f,100+r)}this._attrIndex.needsUpdate=!0}},ColliderShapePlaneBufferGeometry=class extends BufferGeometry{constructor(f){super(),this.worldScale=1,this._currentOffset=new Vector3,this._currentNormal=new Vector3,this._shape=f,this._attrPos=new BufferAttribute(new Float32Array(6*3),3),this.setAttribute("position",this._attrPos),this._attrIndex=new BufferAttribute(new Uint16Array(10),1),this.setIndex(this._attrIndex),this._buildIndex(),this.update()}update(){let f=!1;this._currentOffset.equals(this._shape.offset)||(this._currentOffset.copy(this._shape.offset),f=!0),this._currentNormal.equals(this._shape.normal)||(this._currentNormal.copy(this._shape.normal),f=!0),f&&this._buildPosition()}_buildPosition(){this._attrPos.setXYZ(0,-.5,-.5,0),this._attrPos.setXYZ(1,.5,-.5,0),this._attrPos.setXYZ(2,.5,.5,0),this._attrPos.setXYZ(3,-.5,.5,0),this._attrPos.setXYZ(4,0,0,0),this._attrPos.setXYZ(5,0,0,.25),this.translate(this._currentOffset.x,this._currentOffset.y,this._currentOffset.z),this.lookAt(this._currentNormal),this._attrPos.needsUpdate=!0}_buildIndex(){this._attrIndex.setXY(0,0,1),this._attrIndex.setXY(2,1,2),this._attrIndex.setXY(4,2,3),this._attrIndex.setXY(6,3,0),this._attrIndex.setXY(8,4,5),this._attrIndex.needsUpdate=!0}},ColliderShapeSphereBufferGeometry=class extends BufferGeometry{constructor(f){super(),this.worldScale=1,this._currentRadius=0,this._currentOffset=new Vector3,this._shape=f,this._attrPos=new BufferAttribute(new Float32Array(32*3*3),3),this.setAttribute("position",this._attrPos),this._attrIndex=new BufferAttribute(new Uint16Array(64*3),1),this.setIndex(this._attrIndex),this._buildIndex(),this.update()}update(){let f=!1;const r=this._shape.radius/this.worldScale;this._currentRadius!==r&&(this._currentRadius=r,f=!0),this._currentOffset.equals(this._shape.offset)||(this._currentOffset.copy(this._shape.offset),f=!0),f&&this._buildPosition()}_buildPosition(){for(let f=0;f<32;f++){const r=f/16*Math.PI;this._attrPos.setXYZ(f,Math.cos(r),Math.sin(r),0),this._attrPos.setXYZ(32+f,0,Math.cos(r),Math.sin(r)),this._attrPos.setXYZ(64+f,Math.sin(r),0,Math.cos(r))}this.scale(this._currentRadius,this._currentRadius,this._currentRadius),this.translate(this._currentOffset.x,this._currentOffset.y,this._currentOffset.z),this._attrPos.needsUpdate=!0}_buildIndex(){for(let f=0;f<32;f++){const r=(f+1)%32;this._attrIndex.setXY(f*2,f,r),this._attrIndex.setXY(64+f*2,32+f,32+r),this._attrIndex.setXY(128+f*2,64+f,64+r)}this._attrIndex.needsUpdate=!0}},_v3A52=new Vector3,VRMSpringBoneColliderHelper=class extends Group{constructor(f){if(super(),this.matrixAutoUpdate=!1,this.collider=f,this.collider.shape instanceof VRMSpringBoneColliderShapeSphere)this._geometry=new ColliderShapeSphereBufferGeometry(this.collider.shape);else if(this.collider.shape instanceof VRMSpringBoneColliderShapeCapsule)this._geometry=new ColliderShapeCapsuleBufferGeometry(this.collider.shape);else if(this.collider.shape instanceof VRMSpringBoneColliderShapePlane)this._geometry=new ColliderShapePlaneBufferGeometry(this.collider.shape);else throw new Error("VRMSpringBoneColliderHelper: Unknown collider shape type detected");const r=new LineBasicMaterial({color:16711935,depthTest:!1,depthWrite:!1});this._line=new LineSegments(this._geometry,r),this.add(this._line)}dispose(){this._geometry.dispose()}updateMatrixWorld(f){this.collider.updateWorldMatrix(!0,!1),this.matrix.copy(this.collider.matrixWorld);const r=this.matrix.elements;this._geometry.worldScale=_v3A52.set(r[0],r[1],r[2]).length(),this._geometry.update(),super.updateMatrixWorld(f)}},SpringBoneBufferGeometry=class extends BufferGeometry{constructor(f){super(),this.worldScale=1,this._currentRadius=0,this._currentTail=new Vector3,this._springBone=f,this._attrPos=new BufferAttribute(new Float32Array(294),3),this.setAttribute("position",this._attrPos),this._attrIndex=new BufferAttribute(new Uint16Array(194),1),this.setIndex(this._attrIndex),this._buildIndex(),this.update()}update(){let f=!1;const r=this._springBone.settings.hitRadius/this.worldScale;this._currentRadius!==r&&(this._currentRadius=r,f=!0),this._currentTail.equals(this._springBone.initialLocalChildPosition)||(this._currentTail.copy(this._springBone.initialLocalChildPosition),f=!0),f&&this._buildPosition()}_buildPosition(){for(let f=0;f<32;f++){const r=f/16*Math.PI;this._attrPos.setXYZ(f,Math.cos(r),Math.sin(r),0),this._attrPos.setXYZ(32+f,0,Math.cos(r),Math.sin(r)),this._attrPos.setXYZ(64+f,Math.sin(r),0,Math.cos(r))}this.scale(this._currentRadius,this._currentRadius,this._currentRadius),this.translate(this._currentTail.x,this._currentTail.y,this._currentTail.z),this._attrPos.setXYZ(96,0,0,0),this._attrPos.setXYZ(97,this._currentTail.x,this._currentTail.y,this._currentTail.z),this._attrPos.needsUpdate=!0}_buildIndex(){for(let f=0;f<32;f++){const r=(f+1)%32;this._attrIndex.setXY(f*2,f,r),this._attrIndex.setXY(64+f*2,32+f,32+r),this._attrIndex.setXY(128+f*2,64+f,64+r)}this._attrIndex.setXY(192,96,97),this._attrIndex.needsUpdate=!0}},_v3A62=new Vector3,VRMSpringBoneJointHelper=class extends Group{constructor(f){super(),this.matrixAutoUpdate=!1,this.springBone=f,this._geometry=new SpringBoneBufferGeometry(this.springBone);const r=new LineBasicMaterial({color:16776960,depthTest:!1,depthWrite:!1});this._line=new LineSegments(this._geometry,r),this.add(this._line)}dispose(){this._geometry.dispose()}updateMatrixWorld(f){this.springBone.bone.updateWorldMatrix(!0,!1),this.matrix.copy(this.springBone.bone.matrixWorld);const r=this.matrix.elements;this._geometry.worldScale=_v3A62.set(r[0],r[1],r[2]).length(),this._geometry.update(),super.updateMatrixWorld(f)}},VRMSpringBoneCollider=class extends Object3D{constructor(f){super(),this.colliderMatrix=new Matrix4,this.shape=f}updateWorldMatrix(f,r){super.updateWorldMatrix(f,r),updateColliderMatrix(this.colliderMatrix,this.matrixWorld,this.shape.offset)}};function updateColliderMatrix(f,r,c){const d=r.elements;f.copy(r),c&&(f.elements[12]=d[0]*c.x+d[4]*c.y+d[8]*c.z+d[12],f.elements[13]=d[1]*c.x+d[5]*c.y+d[9]*c.z+d[13],f.elements[14]=d[2]*c.x+d[6]*c.y+d[10]*c.z+d[14])}var _matA=new Matrix4;function mat4InvertCompat(f){return f.invert?f.invert():f.getInverse(_matA.copy(f)),f}var Matrix4InverseCache=class{constructor(f){this._inverseCache=new Matrix4,this._shouldUpdateInverse=!0,this.matrix=f;const r={set:(c,d,l)=>(this._shouldUpdateInverse=!0,c[d]=l,!0)};this._originalElements=f.elements,f.elements=new Proxy(f.elements,r)}get inverse(){return this._shouldUpdateInverse&&(mat4InvertCompat(this._inverseCache.copy(this.matrix)),this._shouldUpdateInverse=!1),this._inverseCache}revert(){this.matrix.elements=this._originalElements}},IDENTITY_MATRIX4=new Matrix4,_v3A72=new Vector3,_v3B23=new Vector3,_worldSpacePosition=new Vector3,_nextTail=new Vector3,_matA2=new Matrix4,VRMSpringBoneJoint=class{constructor(f,r,c={},d=[]){this._currentTail=new Vector3,this._prevTail=new Vector3,this._boneAxis=new Vector3,this._worldSpaceBoneLength=0,this._center=null,this._initialLocalMatrix=new Matrix4,this._initialLocalRotation=new Quaternion,this._initialLocalChildPosition=new Vector3;var l,m,s,h,p,a;this.bone=f,this.bone.matrixAutoUpdate=!1,this.child=r,this.settings={hitRadius:(l=c.hitRadius)!=null?l:0,stiffness:(m=c.stiffness)!=null?m:1,gravityPower:(s=c.gravityPower)!=null?s:0,gravityDir:(p=(h=c.gravityDir)==null?void 0:h.clone())!=null?p:new Vector3(0,-1,0),dragForce:(a=c.dragForce)!=null?a:.4},this.colliderGroups=d}get dependencies(){const f=new Set,r=this.bone.parent;r&&f.add(r);for(let c=0;c{r(l)})}function traverseChildrenUntilConditionMet(f,r){f.children.forEach(c=>{r(c)||traverseChildrenUntilConditionMet(c,r)})}function lowestCommonAncestor(f){var r;const c=new Map;for(const d of f){let l=d;do{const m=((r=c.get(l))!=null?r:0)+1;if(m===f.size)return l;c.set(l,m),l=l.parent}while(l!==null)}return null}var VRMSpringBoneManager=class{constructor(){this._joints=new Set,this._sortedJoints=[],this._hasWarnedCircularDependency=!1,this._ancestors=[],this._objectSpringBonesMap=new Map,this._isSortedJointsDirty=!1,this._relevantChildrenUpdated=this._relevantChildrenUpdated.bind(this)}get joints(){return this._joints}get springBones(){return console.warn("VRMSpringBoneManager: springBones is deprecated. use joints instead."),this._joints}get colliderGroups(){const f=new Set;return this._joints.forEach(r=>{r.colliderGroups.forEach(c=>{f.add(c)})}),Array.from(f)}get colliders(){const f=new Set;return this.colliderGroups.forEach(r=>{r.colliders.forEach(c=>{f.add(c)})}),Array.from(f)}addJoint(f){this._joints.add(f);let r=this._objectSpringBonesMap.get(f.bone);r==null&&(r=new Set,this._objectSpringBonesMap.set(f.bone,r)),r.add(f),this._isSortedJointsDirty=!0}addSpringBone(f){console.warn("VRMSpringBoneManager: addSpringBone() is deprecated. use addJoint() instead."),this.addJoint(f)}deleteJoint(f){this._joints.delete(f),this._objectSpringBonesMap.get(f.bone).delete(f),this._isSortedJointsDirty=!0}deleteSpringBone(f){console.warn("VRMSpringBoneManager: deleteSpringBone() is deprecated. use deleteJoint() instead."),this.deleteJoint(f)}setInitState(){this._sortJoints();for(let f=0;f{var s,h;return((h=(s=this._objectSpringBonesMap.get(m))==null?void 0:s.size)!=null?h:0)>0?!0:(this._ancestors.push(m),!1)})),this._isSortedJointsDirty=!1}_insertJointSort(f,r,c,d,l){if(c.has(f))return;if(r.has(f)){this._hasWarnedCircularDependency||(console.warn("VRMSpringBoneManager: Circular dependency detected"),this._hasWarnedCircularDependency=!0);return}r.add(f);const m=f.dependencies;for(const s of m){let h=!1,p=null;traverseAncestorsFromRoot2(s,a=>{const o=this._objectSpringBonesMap.get(a);if(o)for(const t of o)h=!0,this._insertJointSort(t,r,c,d,l);else h||(p=a)}),p&&l.add(p)}d.push(f),c.add(f)}_relevantChildrenUpdated(f){var r,c;return((c=(r=this._objectSpringBonesMap.get(f))==null?void 0:r.size)!=null?c:0)>0?!0:(f.updateWorldMatrix(!1,!1),!1)}},EXTENSION_NAME_EXTENDED_COLLIDER="VRMC_springBone_extended_collider",POSSIBLE_SPEC_VERSIONS8=new Set(["1.0","1.0-beta"]),POSSIBLE_SPEC_VERSIONS_EXTENDED_COLLIDERS=new Set(["1.0"]),_VRMSpringBoneLoaderPlugin=class Pt{get name(){return Pt.EXTENSION_NAME}constructor(r,c){var d;this.parser=r,this.jointHelperRoot=c==null?void 0:c.jointHelperRoot,this.colliderHelperRoot=c==null?void 0:c.colliderHelperRoot,this.useExtendedColliders=(d=c==null?void 0:c.useExtendedColliders)!=null?d:!0}afterRoot(r){return __async7(this,null,function*(){r.userData.vrmSpringBoneManager=yield this._import(r)})}_import(r){return __async7(this,null,function*(){const c=yield this._v1Import(r);if(c!=null)return c;const d=yield this._v0Import(r);return d??null})}_v1Import(r){return __async7(this,null,function*(){var c,d,l,m,s;const h=r.parser.json;if(!(((c=h.extensionsUsed)==null?void 0:c.indexOf(Pt.EXTENSION_NAME))!==-1))return null;const a=new VRMSpringBoneManager,o=yield r.parser.getDependencies("node"),t=(d=h.extensions)==null?void 0:d[Pt.EXTENSION_NAME];if(!t)return null;const e=t.specVersion;if(!POSSIBLE_SPEC_VERSIONS8.has(e))return console.warn(`VRMSpringBoneLoaderPlugin: Unknown ${Pt.EXTENSION_NAME} specVersion "${e}"`),null;const n=(l=t.colliders)==null?void 0:l.map((u,g)=>{var b,y,_,v,w,T,A,E,x,P,C,k,$,F,q;const D=o[u.node];if(D==null)return console.warn(`VRMSpringBoneLoaderPlugin: The collider #${g} attempted to use the node #${u.node} but not found`),null;const U=u.shape,J=(b=u.extensions)==null?void 0:b[EXTENSION_NAME_EXTENDED_COLLIDER];if(this.useExtendedColliders&&J!=null){const Y=J.specVersion;if(!POSSIBLE_SPEC_VERSIONS_EXTENDED_COLLIDERS.has(Y))console.warn(`VRMSpringBoneLoaderPlugin: Unknown ${EXTENSION_NAME_EXTENDED_COLLIDER} specVersion "${Y}". Fallbacking to the ${Pt.EXTENSION_NAME} definition`);else{const Z=J.shape;if(Z.sphere)return this._importSphereCollider(D,{offset:new Vector3().fromArray((y=Z.sphere.offset)!=null?y:[0,0,0]),radius:(_=Z.sphere.radius)!=null?_:0,inside:(v=Z.sphere.inside)!=null?v:!1});if(Z.capsule)return this._importCapsuleCollider(D,{offset:new Vector3().fromArray((w=Z.capsule.offset)!=null?w:[0,0,0]),radius:(T=Z.capsule.radius)!=null?T:0,tail:new Vector3().fromArray((A=Z.capsule.tail)!=null?A:[0,0,0]),inside:(E=Z.capsule.inside)!=null?E:!1});if(Z.plane)return this._importPlaneCollider(D,{offset:new Vector3().fromArray((x=Z.plane.offset)!=null?x:[0,0,0]),normal:new Vector3().fromArray((P=Z.plane.normal)!=null?P:[0,0,1])})}}if(U.sphere)return this._importSphereCollider(D,{offset:new Vector3().fromArray((C=U.sphere.offset)!=null?C:[0,0,0]),radius:(k=U.sphere.radius)!=null?k:0,inside:!1});if(U.capsule)return this._importCapsuleCollider(D,{offset:new Vector3().fromArray(($=U.capsule.offset)!=null?$:[0,0,0]),radius:(F=U.capsule.radius)!=null?F:0,tail:new Vector3().fromArray((q=U.capsule.tail)!=null?q:[0,0,0]),inside:!1});throw new Error(`VRMSpringBoneLoaderPlugin: The collider #${g} has no valid shape`)}),i=(m=t.colliderGroups)==null?void 0:m.map((u,g)=>{var b;return{colliders:((b=u.colliders)!=null?b:[]).flatMap(_=>{const v=n==null?void 0:n[_];return v??(console.warn(`VRMSpringBoneLoaderPlugin: The colliderGroup #${g} attempted to use a collider #${_} but not found`),[])}),name:u.name}});return(s=t.springs)==null||s.forEach((u,g)=>{var b;const y=u.joints,_=(b=u.colliderGroups)==null?void 0:b.map(T=>{const A=i==null?void 0:i[T];if(A==null)throw new Error(`VRMSpringBoneLoaderPlugin: The spring #${g} attempted to use a colliderGroup ${T} but not found`);return A}),v=u.center!=null?o[u.center]:void 0;let w;y.forEach(T=>{if(w){const A=w.node,E=o[A],x=T.node,P=o[x],C={hitRadius:w.hitRadius,dragForce:w.dragForce,gravityPower:w.gravityPower,stiffness:w.stiffness,gravityDir:w.gravityDir!=null?new Vector3().fromArray(w.gravityDir):void 0},k=this._importJoint(E,P,C,_);v&&(k.center=v),a.addJoint(k)}w=T})}),a.setInitState(),a})}_v0Import(r){return __async7(this,null,function*(){var c,d,l;const m=r.parser.json;if(!(((c=m.extensionsUsed)==null?void 0:c.indexOf("VRM"))!==-1))return null;const h=(d=m.extensions)==null?void 0:d.VRM,p=h==null?void 0:h.secondaryAnimation;if(!p)return null;const a=p==null?void 0:p.boneGroups;if(!a)return null;const o=new VRMSpringBoneManager,t=yield r.parser.getDependencies("node"),e=(l=p.colliderGroups)==null?void 0:l.map(n=>{var i;const u=t[n.node];return{colliders:((i=n.colliders)!=null?i:[]).map((b,y)=>{var _,v,w;const T=new Vector3(0,0,0);return b.offset&&T.set((_=b.offset.x)!=null?_:0,(v=b.offset.y)!=null?v:0,b.offset.z?-b.offset.z:0),this._importSphereCollider(u,{offset:T,radius:(w=b.radius)!=null?w:0,inside:!1})})}});return a==null||a.forEach((n,i)=>{const u=n.bones;u&&u.forEach(g=>{var b,y,_,v;const w=t[g],T=new Vector3;n.gravityDir?T.set((b=n.gravityDir.x)!=null?b:0,(y=n.gravityDir.y)!=null?y:0,(_=n.gravityDir.z)!=null?_:0):T.set(0,-1,0);const A=n.center!=null?t[n.center]:void 0,E={hitRadius:n.hitRadius,dragForce:n.dragForce,gravityPower:n.gravityPower,stiffness:n.stiffiness,gravityDir:T},x=(v=n.colliderGroups)==null?void 0:v.map(P=>{const C=e==null?void 0:e[P];if(C==null)throw new Error(`VRMSpringBoneLoaderPlugin: The spring #${i} attempted to use a colliderGroup ${P} but not found`);return C});w.traverse(P=>{var C;const k=(C=P.children[0])!=null?C:null,$=this._importJoint(P,k,E,x);A&&($.center=A),o.addJoint($)})})}),r.scene.updateMatrixWorld(),o.setInitState(),o})}_importJoint(r,c,d,l){const m=new VRMSpringBoneJoint(r,c,d,l);if(this.jointHelperRoot){const s=new VRMSpringBoneJointHelper(m);this.jointHelperRoot.add(s),s.renderOrder=this.jointHelperRoot.renderOrder}return m}_importSphereCollider(r,c){const d=new VRMSpringBoneColliderShapeSphere(c),l=new VRMSpringBoneCollider(d);if(r.add(l),this.colliderHelperRoot){const m=new VRMSpringBoneColliderHelper(l);this.colliderHelperRoot.add(m),m.renderOrder=this.colliderHelperRoot.renderOrder}return l}_importCapsuleCollider(r,c){const d=new VRMSpringBoneColliderShapeCapsule(c),l=new VRMSpringBoneCollider(d);if(r.add(l),this.colliderHelperRoot){const m=new VRMSpringBoneColliderHelper(l);this.colliderHelperRoot.add(m),m.renderOrder=this.colliderHelperRoot.renderOrder}return l}_importPlaneCollider(r,c){const d=new VRMSpringBoneColliderShapePlane(c),l=new VRMSpringBoneCollider(d);if(r.add(l),this.colliderHelperRoot){const m=new VRMSpringBoneColliderHelper(l);this.colliderHelperRoot.add(m),m.renderOrder=this.colliderHelperRoot.renderOrder}return l}};_VRMSpringBoneLoaderPlugin.EXTENSION_NAME="VRMC_springBone";var VRMSpringBoneLoaderPlugin=_VRMSpringBoneLoaderPlugin,VRMLoaderPlugin=class{get name(){return"VRMLoaderPlugin"}constructor(f,r){var c,d,l,m,s,h,p,a,o,t;this.parser=f;const e=r==null?void 0:r.helperRoot,n=r==null?void 0:r.autoUpdateHumanBones;this.expressionPlugin=(c=r==null?void 0:r.expressionPlugin)!=null?c:new VRMExpressionLoaderPlugin(f),this.firstPersonPlugin=(d=r==null?void 0:r.firstPersonPlugin)!=null?d:new VRMFirstPersonLoaderPlugin(f),this.humanoidPlugin=(l=r==null?void 0:r.humanoidPlugin)!=null?l:new VRMHumanoidLoaderPlugin(f,{helperRoot:e,autoUpdateHumanBones:n}),this.lookAtPlugin=(m=r==null?void 0:r.lookAtPlugin)!=null?m:new VRMLookAtLoaderPlugin(f,{helperRoot:e}),this.metaPlugin=(s=r==null?void 0:r.metaPlugin)!=null?s:new VRMMetaLoaderPlugin(f),this.mtoonMaterialPlugin=(h=r==null?void 0:r.mtoonMaterialPlugin)!=null?h:new MToonMaterialLoaderPlugin(f),this.materialsHDREmissiveMultiplierPlugin=(p=r==null?void 0:r.materialsHDREmissiveMultiplierPlugin)!=null?p:new VRMMaterialsHDREmissiveMultiplierLoaderPlugin(f),this.materialsV0CompatPlugin=(a=r==null?void 0:r.materialsV0CompatPlugin)!=null?a:new VRMMaterialsV0CompatPlugin(f),this.springBonePlugin=(o=r==null?void 0:r.springBonePlugin)!=null?o:new VRMSpringBoneLoaderPlugin(f,{colliderHelperRoot:e,jointHelperRoot:e}),this.nodeConstraintPlugin=(t=r==null?void 0:r.nodeConstraintPlugin)!=null?t:new VRMNodeConstraintLoaderPlugin(f,{helperRoot:e})}beforeRoot(){return __async(this,null,function*(){yield this.materialsV0CompatPlugin.beforeRoot(),yield this.mtoonMaterialPlugin.beforeRoot()})}loadMesh(f){return __async(this,null,function*(){return yield this.mtoonMaterialPlugin.loadMesh(f)})}getMaterialType(f){const r=this.mtoonMaterialPlugin.getMaterialType(f);return r??null}extendMaterialParams(f,r){return __async(this,null,function*(){yield this.materialsHDREmissiveMultiplierPlugin.extendMaterialParams(f,r),yield this.mtoonMaterialPlugin.extendMaterialParams(f,r)})}afterRoot(f){return __async(this,null,function*(){yield this.metaPlugin.afterRoot(f),yield this.humanoidPlugin.afterRoot(f),yield this.expressionPlugin.afterRoot(f),yield this.lookAtPlugin.afterRoot(f),yield this.firstPersonPlugin.afterRoot(f),yield this.springBonePlugin.afterRoot(f),yield this.nodeConstraintPlugin.afterRoot(f),yield this.mtoonMaterialPlugin.afterRoot(f);const r=f.userData.vrmMeta,c=f.userData.vrmHumanoid;if(r&&c){const d=new VRM({scene:f.scene,expressionManager:f.userData.vrmExpressionManager,firstPerson:f.userData.vrmFirstPerson,humanoid:c,lookAt:f.userData.vrmLookAt,meta:r,materials:f.userData.vrmMToonMaterials,springBoneManager:f.userData.vrmSpringBoneManager,nodeConstraintManager:f.userData.vrmNodeConstraintManager});f.userData.vrm=d}})}};function collectMeshes(f){const r=new Set;return f.traverse(c=>{if(!c.isMesh)return;const d=c;r.add(d)}),r}function combineMorph(f,r,c){if(r.size===1){const s=r.values().next().value;if(s.weight===1)return f[s.index]}const d=new Float32Array(f[0].count*3);let l=0;if(c)l=1;else for(const s of r)l+=s.weight;for(const s of r){const h=f[s.index],p=s.weight/l;for(let a=0;ao.getOrCreate(x)).join(","),A=`${v};${b};${T}`;let E=h.get(A);E==null&&(E=_.clone(),remapSkinIndexAttribute(E,w,i),h.set(A,E)),y.geometry.setAttribute("skinIndex",E)}for(const y of n)y.bind(g,new Matrix4)}}function collectSkinnedMeshes(f){const r=new Set;return f.traverse(c=>{if(!c.isSkinnedMesh)return;const d=c;r.add(d)}),r}function listUsedIndices(f,r){const c=new Set;for(let d=0;dc)return!1;return!0}var ObjectIndexDispatcher=class{constructor(){this._objectIndexMap=new Map,this._index=0}get(f){return this._objectIndexMap.get(f)}getOrCreate(f){let r=this._objectIndexMap.get(f);return r==null&&(r=this._index,this._objectIndexMap.set(f,r),this._index++),r}};function shallowCloneBufferGeometry(f){var r,c,d,l;const m=new BufferGeometry;m.name=f.name,m.setIndex(f.index);for(const[s,h]of Object.entries(f.attributes))m.setAttribute(s,h);for(const[s,h]of Object.entries(f.morphAttributes))m.morphAttributes[s]=h.concat();m.morphTargetsRelative=f.morphTargetsRelative,m.groups=[];for(const s of f.groups)m.addGroup(s.start,s.count,s.materialIndex);return m.boundingSphere=(c=(r=f.boundingSphere)==null?void 0:r.clone())!=null?c:null,m.boundingBox=(l=(d=f.boundingBox)==null?void 0:d.clone())!=null?l:null,m.drawRange.start=f.drawRange.start,m.drawRange.count=f.drawRange.count,m.userData=f.userData,m}function disposeMaterial(f){if(Object.values(f).forEach(r=>{r!=null&&r.isTexture&&r.dispose()}),f.isShaderMaterial){const r=f.uniforms;r&&Object.values(r).forEach(c=>{const d=c.value;d!=null&&d.isTexture&&d.dispose()})}f.dispose()}function dispose(f){const r=f.geometry;r&&r.dispose();const c=f.skeleton;c&&c.dispose();const d=f.material;d&&(Array.isArray(d)?d.forEach(l=>disposeMaterial(l)):d&&disposeMaterial(d))}function deepDispose(f){f.traverse(dispose)}function removeUnnecessaryJoints(f,r){var c,d;console.warn("VRMUtils.removeUnnecessaryJoints: removeUnnecessaryJoints is deprecated. Use combineSkeletons instead. combineSkeletons contributes more to the performance improvement. This function will be removed in the next major version.");const l=(c=r==null?void 0:r.experimentalSameBoneCounts)!=null?c:!1,m=[];f.traverse(p=>{p.type==="SkinnedMesh"&&m.push(p)});const s=new Map;let h=0;for(const p of m){const o=p.geometry.getAttribute("skinIndex");if(s.has(o))continue;const t=new Map,e=new Map;for(let n=0;n{var d,l,m,s;if(!c.isMesh)return;const h=c,p=h.geometry,a=p.index;if(a==null)return;const o=r.get(p);if(o!=null){h.geometry=o;return}const t=Object.values(p.attributes)[0].count,e=new Array(t);let n=0;const i=a.array;for(let v=0;v{y.addGroup(v.start,v.count,v.materialIndex)}),y.boundingBox=(l=(d=p.boundingBox)==null?void 0:d.clone())!=null?l:null,y.boundingSphere=(s=(m=p.boundingSphere)==null?void 0:m.clone())!=null?s:null,y.setDrawRange(p.drawRange.start,p.drawRange.count),y.userData=p.userData,r.set(p,y);{const v=a.array,w=new v.constructor(v.length);for(let T=0;T{const w=p.attributes[v];if(w.isInterleavedBufferAttribute)throw new Error("removeUnnecessaryVertices: InterleavedBufferAttribute is not supported");const T=w.array,{itemSize:A,normalized:E}=w,x=new T.constructor(g.length*A);g.forEach((P,C)=>{for(let k=0;k{y.morphAttributes[v]=[];const w=p.morphAttributes[v];for(let T=0;T{for(let F=0;Fk===0),y.morphAttributes[v][T]=new BufferAttribute(C,x,P)}}),_&&(y.morphAttributes={}),h.geometry=y}),Array.from(r.keys()).forEach(c=>{c.dispose()})}function rotateVRM0(f){var r;((r=f.meta)==null?void 0:r.metaVersion)==="0"&&(f.scene.rotation.y=Math.PI)}var VRMUtils=class{constructor(){}};VRMUtils.combineMorphs=combineMorphs;VRMUtils.combineSkeletons=combineSkeletons;VRMUtils.deepDispose=deepDispose;VRMUtils.removeUnnecessaryJoints=removeUnnecessaryJoints;VRMUtils.removeUnnecessaryVertices=removeUnnecessaryVertices;VRMUtils.rotateVRM0=rotateVRM0;/*! + * @pixiv/three-vrm-core v3.4.0 + * The implementation of core features of VRM, for @pixiv/three-vrm + * + * Copyright (c) 2019-2025 pixiv Inc. + * @pixiv/three-vrm-core is distributed under MIT License + * https://github.com/pixiv/three-vrm/blob/release/LICENSE + *//*! + * @pixiv/three-vrm-materials-mtoon v3.4.0 + * MToon (toon material) module for @pixiv/three-vrm + * + * Copyright (c) 2019-2025 pixiv Inc. + * @pixiv/three-vrm-materials-mtoon is distributed under MIT License + * https://github.com/pixiv/three-vrm/blob/release/LICENSE + *//*! + * @pixiv/three-vrm-materials-hdr-emissive-multiplier v3.4.0 + * Support VRMC_hdr_emissiveMultiplier for @pixiv/three-vrm + * + * Copyright (c) 2019-2025 pixiv Inc. + * @pixiv/three-vrm-materials-hdr-emissive-multiplier is distributed under MIT License + * https://github.com/pixiv/three-vrm/blob/release/LICENSE + *//*! + * @pixiv/three-vrm-materials-v0compat v3.4.0 + * VRM0.0 materials compatibility layer plugin for @pixiv/three-vrm + * + * Copyright (c) 2019-2025 pixiv Inc. + * @pixiv/three-vrm-materials-v0compat is distributed under MIT License + * https://github.com/pixiv/three-vrm/blob/release/LICENSE + *//*! + * @pixiv/three-vrm-node-constraint v3.4.0 + * Node constraint module for @pixiv/three-vrm + * + * Copyright (c) 2019-2025 pixiv Inc. + * @pixiv/three-vrm-node-constraint is distributed under MIT License + * https://github.com/pixiv/three-vrm/blob/release/LICENSE + *//*! + * @pixiv/three-vrm-springbone v3.4.0 + * Spring bone module for @pixiv/three-vrm + * + * Copyright (c) 2019-2025 pixiv Inc. + * @pixiv/three-vrm-springbone is distributed under MIT License + * https://github.com/pixiv/three-vrm/blob/release/LICENSE + */export{VRMLoaderPlugin as V,VRMAnimationLoaderPlugin as a,VRMUtils as b,createVRMAnimationClip as c,distExports as d,VRMLookAtQuaternionProxy as e,randomSaccadeInterval as r}; diff --git a/assets/together-ai-Wdg-uXlv.js b/assets/together-ai-Wdg-uXlv.js deleted file mode 100644 index 6a8f385aeb900a434e8db5ac67a82780452754ed..0000000000000000000000000000000000000000 --- a/assets/together-ai-Wdg-uXlv.js +++ /dev/null @@ -1 +0,0 @@ -import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-BQHOFrhO.js";import{d as h,$ as y,V as U,a0 as $,f as c,T as k,w as K,ac as x,o as z,ad as u,b as l,u as t}from"./index-CNH1g_GM.js";import"./three-vrm-animation.module-B_hGdUpX.js";import"./mcp-B7-jaCfZ.js";import"./emotions-DWNSb738.js";import{u as w}from"./providers-DP46_3AG.js";import"./Select.vue_vue_type_style_index_0_lang-BIffysKh.js";import{_ as C,a as M}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-C-ZUDDxT.js";import{_ as N}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-CR2pR4yl.js";import{_ as P,a as R}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-BpJun8-8.js";import{_ as S}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-DUl7ZNEY.js";import{b as _}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./floating-ui.core-CgBsuaUc.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-dwKULsMl.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-DLt6RcnD.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-tEOSPb7v.js";import"./Input.vue_vue_type_script_setup_true_lang-CvnY3pbX.js";const a="together-ai",B=h({__name:"together-ai",setup(I){const{t:m}=y(),g=U(),d=w(),{providers:o}=$(d),n=c(()=>d.getProviderMetadata(a)),i=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}}),s=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}});k(()=>{var e,r;d.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 b(){var e;o.value[a]={...(e=n.value)==null?void 0:e.defaultOptions}}return(e,r)=>{var v,f;return z(),x(t(S),{"provider-name":(v=n.value)==null?void 0:v.localizedName,"provider-icon-color":(f=n.value)==null?void 0:f.iconColor,"on-back":()=>t(g).back()},{default:u(()=>[l(t(P),null,{default:u(()=>[l(t(R),{title:t(m)("settings.pages.providers.common.section.basic.title"),description:t(m)("settings.pages.providers.common.section.basic.description"),"on-reset":b},{default:u(()=>{var p;return[l(t(N),{modelValue:i.value,"onUpdate:modelValue":r[0]||(r[0]=V=>i.value=V),"provider-name":(p=n.value)==null?void 0:p.localizedName,placeholder:"togetherapi-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(t(C),{title:t(m)("settings.pages.providers.common.section.advanced.title")},{default:u(()=>[l(t(M),{modelValue:s.value,"onUpdate:modelValue":r[1]||(r[1]=p=>s.value=p),placeholder:"https://api.together.xyz/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon-color","on-back"])}}});typeof _=="function"&&_(B);export{B as default}; diff --git a/assets/together-ai-dB0eRXqL.js b/assets/together-ai-dB0eRXqL.js new file mode 100644 index 0000000000000000000000000000000000000000..7f0e58e1c9ccff74082017a84006b0ca142d0763 --- /dev/null +++ b/assets/together-ai-dB0eRXqL.js @@ -0,0 +1 @@ +import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-Du5e5QRV.js";import{d as h,$ as k,V as y,a0 as U,f as c,T as $,w as K,bk as x,o as z,bl as u,b as l,u as t}from"./index-B06xwjXa.js";import"./three-vrm.module-CtuEk7GG.js";import"./emotions-DWNSb738.js";import"./mcp-BfXpaYZf.js";import{u as w}from"./providers-BCv4E6z9.js";import"./Select.vue_vue_type_style_index_0_lang-CzS20kE7.js";import{_ as C,a as M}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-gnnCLEsG.js";import{_ as N}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-DMARmtsp.js";import{_ as P,a as R}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-BoAZvnmm.js";import{_ as S}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-DYsKzYwL.js";import{b as _}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./floating-ui.core-CgBsuaUc.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-BxFBRVXD.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-CyZTJR0c.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-DM6oOIgU.js";import"./Input.vue_vue_type_script_setup_true_lang-CqiG06sL.js";const a="together-ai",B=h({__name:"together-ai",setup(I){const{t:m}=k(),b=y(),d=w(),{providers:o}=U(d),n=c(()=>d.getProviderMetadata(a)),i=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}}),s=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,r;d.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 v,f;return z(),x(t(S),{"provider-name":(v=n.value)==null?void 0:v.localizedName,"provider-icon-color":(f=n.value)==null?void 0:f.iconColor,"on-back":()=>t(b).back()},{default:u(()=>[l(t(P),null,{default:u(()=>[l(t(R),{title:t(m)("settings.pages.providers.common.section.basic.title"),description:t(m)("settings.pages.providers.common.section.basic.description"),"on-reset":g},{default:u(()=>{var p;return[l(t(N),{modelValue:i.value,"onUpdate:modelValue":r[0]||(r[0]=V=>i.value=V),"provider-name":(p=n.value)==null?void 0:p.localizedName,placeholder:"togetherapi-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(t(C),{title:t(m)("settings.pages.providers.common.section.advanced.title")},{default:u(()=>[l(t(M),{modelValue:s.value,"onUpdate:modelValue":r[1]||(r[1]=p=>s.value=p),placeholder:"https://api.together.xyz/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon-color","on-back"])}}});typeof _=="function"&&_(B);export{B as default}; diff --git a/assets/useIconAnimation-BxWVl-bV.js b/assets/useIconAnimation-BxWVl-bV.js new file mode 100644 index 0000000000000000000000000000000000000000..1551d9e3207ba5337545fece5b89193c2e1e135f --- /dev/null +++ b/assets/useIconAnimation-BxWVl-bV.js @@ -0,0 +1 @@ +import"./three-vrm.module-CtuEk7GG.js";import"./emotions-DWNSb738.js";import"./mcp-BfXpaYZf.js";import{e as t,bj as r,f as u,T as m,U as c}from"./index-B06xwjXa.js";function v(s){const n=t(!1),o=t(!1),a=t(s),e=r(),i=u(()=>o.value&&!e.disableTransitions&&e.usePageSpecificTransitions);return m(()=>{o.value=!0,requestAnimationFrame(()=>{n.value=!0})}),c(()=>{n.value=!1,o.value=!1}),{iconAnimationStarted:n,showIconAnimation:i,animationIcon:a}}export{v as u}; diff --git a/assets/useIconAnimation-Df247suB.js b/assets/useIconAnimation-Df247suB.js deleted file mode 100644 index e2df581d338844b54b6fb183e7de91d6e16521fb..0000000000000000000000000000000000000000 --- a/assets/useIconAnimation-Df247suB.js +++ /dev/null @@ -1 +0,0 @@ -import"./mcp-B7-jaCfZ.js";import"./emotions-DWNSb738.js";import{e as t,ab as u,f as r,T as m,U as c}from"./index-CNH1g_GM.js";function d(a){const n=t(!1),o=t(!1),s=t(a),e=u(),i=r(()=>o.value&&!e.disableTransitions&&e.usePageSpecificTransitions);return m(()=>{o.value=!0,requestAnimationFrame(()=>{n.value=!0})}),c(()=>{n.value=!1,o.value=!1}),{iconAnimationStarted:n,showIconAnimation:i,animationIcon:s}}export{d as u}; diff --git a/assets/valibot-CQk-M5rL-B1E8htDM.js b/assets/valibot-CQk-M5rL-B1E8htDM.js deleted file mode 100644 index df870c5d246059cd30f67125f78bc492348c1a5d..0000000000000000000000000000000000000000 --- a/assets/valibot-CQk-M5rL-B1E8htDM.js +++ /dev/null @@ -1 +0,0 @@ -import{cO as r}from"./index-CNH1g_GM.js";import{t as a}from"./mcp-B7-jaCfZ.js";const s=async()=>{const{toJsonSchema:o}=await a(r(()=>import("./index-CShXCEpO.js"),[]),"@valibot/to-json-schema");return t=>o(t)};export{s as getToJsonSchemaFn}; diff --git a/assets/valibot-CQk-M5rL-Ba6sRWRU.js b/assets/valibot-CQk-M5rL-Ba6sRWRU.js new file mode 100644 index 0000000000000000000000000000000000000000..7d134a7b32b5c22f94c9d98d2f43e2c3bd70f17d --- /dev/null +++ b/assets/valibot-CQk-M5rL-Ba6sRWRU.js @@ -0,0 +1 @@ +import{cO as r}from"./index-B06xwjXa.js";import{t as a}from"./mcp-BfXpaYZf.js";const s=async()=>{const{toJsonSchema:o}=await a(r(()=>import("./index-CShXCEpO.js"),[]),"@valibot/to-json-schema");return t=>o(t)};export{s as getToJsonSchemaFn}; diff --git a/assets/vibrant-DyMOQuK8.js b/assets/vibrant-DwwXKvjx.js similarity index 88% rename from assets/vibrant-DyMOQuK8.js rename to assets/vibrant-DwwXKvjx.js index 646a440258aa6eb4f580a9e238aa34c11f56e35f..74a2e17460b645ac4ccc12ddd41799a892cc6012 100644 --- a/assets/vibrant-DyMOQuK8.js +++ b/assets/vibrant-DwwXKvjx.js @@ -1 +1 @@ -import"./Select.vue_vue_type_style_index_0_lang-BIffysKh.js";import{_ as p}from"./InputFile.vue_vue_type_script_setup_true_lang-bO5dM4_S.js";import{V as g}from"./browser-CkchkNbv.js";import{d as v,e as n,w as _,c as r,o,a as s,c6 as b,c7 as h,Y as k,b as w,u as x,W as y,a3 as V}from"./index-CNH1g_GM.js";import"./floating-ui.core-CgBsuaUc.js";const j={flex:"","flex-col":"","gap-4":""},C={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"],R=v({__name:"vibrant",setup(S){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 g(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 _(u,l=>{c(l[0])},{deep:!0}),(l,a)=>(o(),r("div",j,[s("div",C,[(o(!0),r(b,null,h(d.value,(e,m)=>(o(),r("div",{key:m,style:V({backgroundColor:e}),"size-20":"","rounded-full":""},null,4))),128))]),s("div",L,k(i.value),1),s("div",N,[w(x(p),{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)):y("",!0)])]))}});export{R as default}; +import"./Select.vue_vue_type_style_index_0_lang-CzS20kE7.js";import{_ as p}from"./InputFile.vue_vue_type_script_setup_true_lang-B7xRsonQ.js";import{V as g}from"./browser-CkchkNbv.js";import{d as v,e as n,w as _,c as r,o,a as s,c6 as b,c7 as h,Y as k,b as w,u as x,W as y,a3 as V}from"./index-B06xwjXa.js";import"./floating-ui.core-CgBsuaUc.js";const j={flex:"","flex-col":"","gap-4":""},C={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"],R=v({__name:"vibrant",setup(S){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 g(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 _(u,l=>{c(l[0])},{deep:!0}),(l,a)=>(o(),r("div",j,[s("div",C,[(o(!0),r(b,null,h(d.value,(e,m)=>(o(),r("div",{key:m,style:V({backgroundColor:e}),"size-20":"","rounded-full":""},null,4))),128))]),s("div",L,k(i.value),1),s("div",N,[w(x(p),{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)):y("",!0)])]))}});export{R as default}; diff --git a/assets/volcengine-C4ShKUYr.js b/assets/volcengine-C4ShKUYr.js new file mode 100644 index 0000000000000000000000000000000000000000..5302c758dd9a768660ef79d0a095ff5fd5172556 --- /dev/null +++ b/assets/volcengine-C4ShKUYr.js @@ -0,0 +1 @@ +import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-Du5e5QRV.js";import{d as y,e as w,a0 as M,$ as I,f as c,T as S,w as g,bk as k,o as x,bl as v,b as f,u as r,a as F}from"./index-B06xwjXa.js";import"./three-vrm.module-CtuEk7GG.js";import"./emotions-DWNSb738.js";import"./mcp-BfXpaYZf.js";import{u as $}from"./providers-BCv4E6z9.js";import{u as B}from"./speech-CLjA-Bq8.js";import{_ as R}from"./FieldInput.vue_vue_type_script_setup_true_lang-DM6oOIgU.js";import{_ as T}from"./FieldRange.vue_vue_type_script_setup_true_lang-4kHfmFIm.js";import"./Select.vue_vue_type_style_index_0_lang-CzS20kE7.js";import{_ as E,a as K}from"./SpeechProviderSettings.vue_vue_type_script_setup_true_lang-BtrnMHoG.js";import{b as _}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./Input.vue_vue_type_script_setup_true_lang-CqiG06sL.js";import"./floating-ui.core-CgBsuaUc.js";import"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-gnnCLEsG.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-BxFBRVXD.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-CyZTJR0c.js";import"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-DMARmtsp.js";import"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-BoAZvnmm.js";const L={flex:"~ col gap-4"},o="volcengine",b="v1",N=y({__name:"volcengine",setup(U){const s=w(1),d=B(),a=$(),{providers:t}=M(a),{t:n}=I(),p=c({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}}}),C=c(()=>{var e;return!!((e=t.value[o])!=null&&e.apiKey)}),P=c(()=>d.availableVoices[o]||[]);async function V(e,i,l){const m=a.getProviderInstance(o);if(!m)throw new Error("Failed to initialize speech provider");const u=a.getProviderConfig(o),h=u.model||b;return await d.speech(m,h,e,i,{...u})}return S(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)=>(x(),k(r(K),{"provider-id":o,"default-model":b},{"basic-settings":v(()=>[F("div",L,[f(r(R),{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":v(()=>[f(r(T),{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:v(()=>[f(r(E),{"available-voices":P.value,"generate-speech":V,"api-key-configured":C.value,"default-text":"Hello! This is a test of the ElevenLabs voice synthesis."},null,8,["available-voices","api-key-configured"])]),_:1}))}});typeof _=="function"&&_(N);export{N as default}; diff --git a/assets/volcengine-Cu9s47NY.js b/assets/volcengine-Cu9s47NY.js deleted file mode 100644 index 9be8fa52f869bc44c1364e36fd52ba7b9cfe8696..0000000000000000000000000000000000000000 --- a/assets/volcengine-Cu9s47NY.js +++ /dev/null @@ -1 +0,0 @@ -import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-BQHOFrhO.js";import{d as y,e as w,a0 as M,$ as I,f as c,T as S,w as g,ac as x,o as k,ad as v,b as f,u as r,a as F}from"./index-CNH1g_GM.js";import"./three-vrm-animation.module-B_hGdUpX.js";import"./mcp-B7-jaCfZ.js";import"./emotions-DWNSb738.js";import{u as $}from"./providers-DP46_3AG.js";import{u as B}from"./speech-DpuUb2e9.js";import{_ as R}from"./FieldInput.vue_vue_type_script_setup_true_lang-tEOSPb7v.js";import{_ as T}from"./FieldRange.vue_vue_type_script_setup_true_lang-Dou4SIkT.js";import"./Select.vue_vue_type_style_index_0_lang-BIffysKh.js";import{_ as E,a as K}from"./SpeechProviderSettings.vue_vue_type_script_setup_true_lang-C4Rxa7-o.js";import{b as _}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./Input.vue_vue_type_script_setup_true_lang-CvnY3pbX.js";import"./floating-ui.core-CgBsuaUc.js";import"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-C-ZUDDxT.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-dwKULsMl.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-DLt6RcnD.js";import"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-CR2pR4yl.js";import"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-BpJun8-8.js";const L={flex:"~ col gap-4"},o="volcengine",b="v1",N=y({__name:"volcengine",setup(U){const s=w(1),d=B(),a=$(),{providers:t}=M(a),{t:n}=I(),p=c({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}}}),C=c(()=>{var e;return!!((e=t.value[o])!=null&&e.apiKey)}),P=c(()=>d.availableVoices[o]||[]);async function V(e,i,l){const m=a.getProviderInstance(o);if(!m)throw new Error("Failed to initialize speech provider");const u=a.getProviderConfig(o),h=u.model||b;return await d.speech(m,h,e,i,{...u})}return S(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(),x(r(K),{"provider-id":o,"default-model":b},{"basic-settings":v(()=>[F("div",L,[f(r(R),{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":v(()=>[f(r(T),{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:v(()=>[f(r(E),{"available-voices":P.value,"generate-speech":V,"api-key-configured":C.value,"default-text":"Hello! This is a test of the ElevenLabs voice synthesis."},null,8,["available-voices","api-key-configured"])]),_:1}))}});typeof _=="function"&&_(N);export{N as default}; diff --git a/assets/xai-BHmWt46x.js b/assets/xai-BHmWt46x.js deleted file mode 100644 index 36232166180773a4c607a8dd30669e4e60fd2ebc..0000000000000000000000000000000000000000 --- a/assets/xai-BHmWt46x.js +++ /dev/null @@ -1 +0,0 @@ -import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-BQHOFrhO.js";import{d as x,$ as U,V as $,a0 as k,f as c,T as y,w as K,ac as h,o as w,ad as u,b as l,u as t}from"./index-CNH1g_GM.js";import"./three-vrm-animation.module-B_hGdUpX.js";import"./mcp-B7-jaCfZ.js";import"./emotions-DWNSb738.js";import{u as z}from"./providers-DP46_3AG.js";import"./Select.vue_vue_type_style_index_0_lang-BIffysKh.js";import{_ as M,a as N}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-C-ZUDDxT.js";import{_ as P}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-CR2pR4yl.js";import{_ as R,a as S}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-BpJun8-8.js";import{_ as B}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-DUl7ZNEY.js";import{b as _}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./floating-ui.core-CgBsuaUc.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-dwKULsMl.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-DLt6RcnD.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-tEOSPb7v.js";import"./Input.vue_vue_type_script_setup_true_lang-CvnY3pbX.js";const a="xai",C=x({__name:"xai",setup(I){const{t:m}=U(),b=$(),d=z(),{providers:o}=k(d),n=c(()=>d.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}}),s=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}});y(()=>{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 g(){var e;o.value[a]={...(e=n.value)==null?void 0:e.defaultOptions}}return(e,i)=>{var v,f;return w(),h(t(B),{"provider-name":(v=n.value)==null?void 0:v.localizedName,"provider-icon":(f=n.value)==null?void 0:f.icon,"on-back":()=>t(b).back()},{default:u(()=>[l(t(R),null,{default:u(()=>[l(t(S),{title:t(m)("settings.pages.providers.common.section.basic.title"),description:t(m)("settings.pages.providers.common.section.basic.description"),"on-reset":g},{default:u(()=>{var p;return[l(t(P),{modelValue:r.value,"onUpdate:modelValue":i[0]||(i[0]=V=>r.value=V),"provider-name":(p=n.value)==null?void 0:p.localizedName,placeholder:"xai-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(t(M),{title:t(m)("settings.pages.providers.common.section.advanced.title")},{default:u(()=>[l(t(N),{modelValue:s.value,"onUpdate:modelValue":i[1]||(i[1]=p=>s.value=p),placeholder:"https://api.x.ai/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon","on-back"])}}});typeof _=="function"&&_(C);export{C as default}; diff --git a/assets/xai-BHu8lsjK.js b/assets/xai-BHu8lsjK.js new file mode 100644 index 0000000000000000000000000000000000000000..a77ad394afd202f30c25fd9b952790411a7f5760 --- /dev/null +++ b/assets/xai-BHu8lsjK.js @@ -0,0 +1 @@ +import"./Stage.vue_vue_type_style_index_0_scoped_b4de1d75_lang-Du5e5QRV.js";import{d as k,$ as x,V as U,a0 as $,f as v,T as y,w as K,bk as h,o as w,bl as u,b as l,u as t}from"./index-B06xwjXa.js";import"./three-vrm.module-CtuEk7GG.js";import"./emotions-DWNSb738.js";import"./mcp-BfXpaYZf.js";import{u as z}from"./providers-BCv4E6z9.js";import"./Select.vue_vue_type_style_index_0_lang-CzS20kE7.js";import{_ as M,a as N}from"./ProviderBaseUrlInput.vue_vue_type_script_setup_true_lang-gnnCLEsG.js";import{_ as P}from"./ProviderApiKeyInput.vue_vue_type_script_setup_true_lang-DMARmtsp.js";import{_ as R,a as S}from"./ProviderSettingsContainer.vue_vue_type_script_setup_true_lang-BoAZvnmm.js";import{_ as B}from"./ProviderSettingsLayout.vue_vue_type_script_setup_true_lang-DYsKzYwL.js";import{b as _}from"./route-block-B_A1xBdJ.js";import"./index-LHmcipjy.js";import"./floating-ui.core-CgBsuaUc.js";import"./Collapsable.vue_vue_type_script_setup_true_lang-BxFBRVXD.js";import"./TransitionVertical.vue_vue_type_script_setup_true_lang-CyZTJR0c.js";import"./FieldInput.vue_vue_type_script_setup_true_lang-DM6oOIgU.js";import"./Input.vue_vue_type_script_setup_true_lang-CqiG06sL.js";const a="xai",C=k({__name:"xai",setup(I){const{t:m}=x(),b=U(),d=z(),{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}});y(()=>{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 g(){var e;o.value[a]={...(e=n.value)==null?void 0:e.defaultOptions}}return(e,i)=>{var c,f;return w(),h(t(B),{"provider-name":(c=n.value)==null?void 0:c.localizedName,"provider-icon":(f=n.value)==null?void 0:f.icon,"on-back":()=>t(b).back()},{default:u(()=>[l(t(R),null,{default:u(()=>[l(t(S),{title:t(m)("settings.pages.providers.common.section.basic.title"),description:t(m)("settings.pages.providers.common.section.basic.description"),"on-reset":g},{default:u(()=>{var p;return[l(t(P),{modelValue:r.value,"onUpdate:modelValue":i[0]||(i[0]=V=>r.value=V),"provider-name":(p=n.value)==null?void 0:p.localizedName,placeholder:"xai-..."},null,8,["modelValue","provider-name"])]}),_:1},8,["title","description"]),l(t(M),{title:t(m)("settings.pages.providers.common.section.advanced.title")},{default:u(()=>[l(t(N),{modelValue:s.value,"onUpdate:modelValue":i[1]||(i[1]=p=>s.value=p),placeholder:"https://api.x.ai/v1/"},null,8,["modelValue"])]),_:1},8,["title"])]),_:1})]),_:1},8,["provider-name","provider-icon","on-back"])}}});typeof _=="function"&&_(C);export{C as default}; diff --git a/assets/zod-Db63SLXj-mFRszzY4.js b/assets/zod-Db63SLXj-uoU3L6WI.js similarity index 66% rename from assets/zod-Db63SLXj-mFRszzY4.js rename to assets/zod-Db63SLXj-uoU3L6WI.js index 5db563a59dd9117b84b9075bfea8eb895a7eadc3..12355a3d03357b64de9033d3fb476572ff281747 100644 --- a/assets/zod-Db63SLXj-mFRszzY4.js +++ b/assets/zod-Db63SLXj-uoU3L6WI.js @@ -1,2 +1,2 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-DtBLsHNZ.js","assets/mcp-B7-jaCfZ.js","assets/index-CNH1g_GM.js","assets/index-Cgf1vKOZ.css"])))=>i.map(i=>d[i]); -import{cO as n}from"./index-CNH1g_GM.js";import{a as t}from"./mcp-B7-jaCfZ.js";const i=async()=>{let r=e=>{throw new Error(`xsschema: Missing zod v4 dependencies "zod". see ${t}`)},s=e=>{throw new Error(`xsschema: Missing zod v3 dependencies "zod-to-json-schema". see ${t}`)};try{const{toJSONSchema:e}=await n(async()=>{const{toJSONSchema:o}=await import("./index-C78yvWFl.js");return{toJSONSchema:o}},[]);r=e}catch(e){e instanceof Error&&console.error(e.message)}try{const{zodToJsonSchema:e}=await n(async()=>{const{zodToJsonSchema:o}=await import("./index-DtBLsHNZ.js");return{zodToJsonSchema:o}},__vite__mapDeps([0,1,2,3]));s=e}catch(e){e instanceof Error&&console.error(e.message)}return async e=>"_zod"in e?r(e):s(e)};export{i as getToJsonSchemaFn}; +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-CAY2gJLP.js","assets/mcp-BfXpaYZf.js","assets/index-B06xwjXa.js","assets/index-Cgf1vKOZ.css"])))=>i.map(i=>d[i]); +import{cO as n}from"./index-B06xwjXa.js";import{a as t}from"./mcp-BfXpaYZf.js";const i=async()=>{let r=e=>{throw new Error(`xsschema: Missing zod v4 dependencies "zod". see ${t}`)},s=e=>{throw new Error(`xsschema: Missing zod v3 dependencies "zod-to-json-schema". see ${t}`)};try{const{toJSONSchema:e}=await n(async()=>{const{toJSONSchema:o}=await import("./index-C78yvWFl.js");return{toJSONSchema:o}},[]);r=e}catch(e){e instanceof Error&&console.error(e.message)}try{const{zodToJsonSchema:e}=await n(async()=>{const{zodToJsonSchema:o}=await import("./index-CAY2gJLP.js");return{zodToJsonSchema:o}},__vite__mapDeps([0,1,2,3]));s=e}catch(e){e instanceof Error&&console.error(e.message)}return async e=>"_zod"in e?r(e):s(e)};export{i as getToJsonSchemaFn}; diff --git a/index.html b/index.html index 976657a1a3510bf37d90ca5296d7770ae80f1fb1..9358b7449e0113100aad3a222d54915de791469b 100644 --- a/index.html +++ b/index.html @@ -23,7 +23,7 @@ src="/remote-assets/page-external-data/js/script.js" > - +