diff --git a/main/manager-web/public/generator/assets/index-DZRFpHRV.js b/main/manager-web/public/generator/assets/index-B_baqE3-.js similarity index 88% rename from main/manager-web/public/generator/assets/index-DZRFpHRV.js rename to main/manager-web/public/generator/assets/index-B_baqE3-.js index b2855e0b..9f315ab5 100644 --- a/main/manager-web/public/generator/assets/index-DZRFpHRV.js +++ b/main/manager-web/public/generator/assets/index-B_baqE3-.js @@ -2,15 +2,15 @@ * @vue/shared v3.5.26 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT -**/function Pr(A){const e=Object.create(null);for(const t of A.split(","))e[t]=1;return t=>t in e}const _A={},ui=[],ot=()=>{},tI=()=>!1,lo=A=>A.charCodeAt(0)===111&&A.charCodeAt(1)===110&&(A.charCodeAt(2)>122||A.charCodeAt(2)<97),Vr=A=>A.startsWith("onUpdate:"),ue=Object.assign,Wr=(A,e)=>{const t=A.indexOf(e);t>-1&&A.splice(t,1)},iB=Object.prototype.hasOwnProperty,JA=(A,e)=>iB.call(A,e),yA=Array.isArray,hi=A=>En(A)==="[object Map]",Bo=A=>En(A)==="[object Set]",Gg=A=>En(A)==="[object Date]",FA=A=>typeof A=="function",ee=A=>typeof A=="string",It=A=>typeof A=="symbol",KA=A=>A!==null&&typeof A=="object",iI=A=>(KA(A)||FA(A))&&FA(A.then)&&FA(A.catch),nI=Object.prototype.toString,En=A=>nI.call(A),nB=A=>En(A).slice(8,-1),oI=A=>En(A)==="[object Object]",qr=A=>ee(A)&&A!=="NaN"&&A[0]!=="-"&&""+parseInt(A,10)===A,Oi=Pr(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Qo=A=>{const e=Object.create(null);return t=>e[t]||(e[t]=A(t))},oB=/-\w/g,Je=Qo(A=>A.replace(oB,e=>e.slice(1).toUpperCase())),rB=/\B([A-Z])/g,ai=Qo(A=>A.replace(rB,"-$1").toLowerCase()),co=Qo(A=>A.charAt(0).toUpperCase()+A.slice(1)),xo=Qo(A=>A?`on${co(A)}`:""),Yt=(A,e)=>!Object.is(A,e),Tn=(A,...e)=>{for(let t=0;t{Object.defineProperty(A,e,{configurable:!0,enumerable:!1,writable:i,value:t})},Eo=A=>{const e=parseFloat(A);return isNaN(e)?A:e};let Lg;const uo=()=>Lg||(Lg=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function VA(A){if(yA(A)){const e={};for(let t=0;t{if(t){const i=t.split(sB);i.length>1&&(e[i[0].trim()]=i[1].trim())}}),e}function kA(A){let e="";if(ee(A))e=A;else if(yA(A))for(let t=0;tho(t,e))}const sI=A=>!!(A&&A.__v_isRef===!0),v=A=>ee(A)?A:A==null?"":yA(A)||KA(A)&&(A.toString===nI||!FA(A.toString))?sI(A)?v(A.value):JSON.stringify(A,aI,2):String(A),aI=(A,e)=>sI(e)?aI(A,e.value):hi(e)?{[`Map(${e.size})`]:[...e.entries()].reduce((t,[i,n],o)=>(t[Jo(i,o)+" =>"]=n,t),{})}:Bo(e)?{[`Set(${e.size})`]:[...e.values()].map(t=>Jo(t))}:It(e)?Jo(e):KA(e)&&!yA(e)&&!oI(e)?String(e):e,Jo=(A,e="")=>{var t;return It(A)?`Symbol(${(t=A.description)!=null?t:e})`:A};/** +**/function Pr(A){const e=Object.create(null);for(const t of A.split(","))e[t]=1;return t=>t in e}const _A={},ui=[],ot=()=>{},tI=()=>!1,lo=A=>A.charCodeAt(0)===111&&A.charCodeAt(1)===110&&(A.charCodeAt(2)>122||A.charCodeAt(2)<97),Vr=A=>A.startsWith("onUpdate:"),ue=Object.assign,Wr=(A,e)=>{const t=A.indexOf(e);t>-1&&A.splice(t,1)},iB=Object.prototype.hasOwnProperty,JA=(A,e)=>iB.call(A,e),yA=Array.isArray,hi=A=>En(A)==="[object Map]",Bo=A=>En(A)==="[object Set]",Gg=A=>En(A)==="[object Date]",FA=A=>typeof A=="function",ee=A=>typeof A=="string",It=A=>typeof A=="symbol",KA=A=>A!==null&&typeof A=="object",iI=A=>(KA(A)||FA(A))&&FA(A.then)&&FA(A.catch),nI=Object.prototype.toString,En=A=>nI.call(A),nB=A=>En(A).slice(8,-1),oI=A=>En(A)==="[object Object]",qr=A=>ee(A)&&A!=="NaN"&&A[0]!=="-"&&""+parseInt(A,10)===A,Oi=Pr(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Qo=A=>{const e=Object.create(null);return t=>e[t]||(e[t]=A(t))},oB=/-\w/g,Je=Qo(A=>A.replace(oB,e=>e.slice(1).toUpperCase())),rB=/\B([A-Z])/g,ai=Qo(A=>A.replace(rB,"-$1").toLowerCase()),co=Qo(A=>A.charAt(0).toUpperCase()+A.slice(1)),xo=Qo(A=>A?`on${co(A)}`:""),Yt=(A,e)=>!Object.is(A,e),Tn=(A,...e)=>{for(let t=0;t{Object.defineProperty(A,e,{configurable:!0,enumerable:!1,writable:i,value:t})},Eo=A=>{const e=parseFloat(A);return isNaN(e)?A:e};let Lg;const uo=()=>Lg||(Lg=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function VA(A){if(yA(A)){const e={};for(let t=0;t{if(t){const i=t.split(sB);i.length>1&&(e[i[0].trim()]=i[1].trim())}}),e}function kA(A){let e="";if(ee(A))e=A;else if(yA(A))for(let t=0;tho(t,e))}const sI=A=>!!(A&&A.__v_isRef===!0),F=A=>ee(A)?A:A==null?"":yA(A)||KA(A)&&(A.toString===nI||!FA(A.toString))?sI(A)?F(A.value):JSON.stringify(A,aI,2):String(A),aI=(A,e)=>sI(e)?aI(A,e.value):hi(e)?{[`Map(${e.size})`]:[...e.entries()].reduce((t,[i,n],o)=>(t[Jo(i,o)+" =>"]=n,t),{})}:Bo(e)?{[`Set(${e.size})`]:[...e.values()].map(t=>Jo(t))}:It(e)?Jo(e):KA(e)&&!yA(e)&&!oI(e)?String(e):e,Jo=(A,e="")=>{var t;return It(A)?`Symbol(${(t=A.description)!=null?t:e})`:A};/** * @vue/reactivity v3.5.26 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT -**/let ke;class II{constructor(e=!1){this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=ke,!e&&ke&&(this.index=(ke.scopes||(ke.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,t;if(this.scopes)for(e=0,t=this.scopes.length;e0&&--this._on===0&&(ke=this.prevScope,this.prevScope=void 0)}stop(e){if(this._active){this._active=!1;let t,i;for(t=0,i=this.effects.length;t0)return;if(Vi){let e=Vi;for(Vi=void 0;e;){const t=e.next;e.next=void 0,e.flags&=-9,e=t}}let A;for(;Pi;){let e=Pi;for(Pi=void 0;e;){const t=e.next;if(e.next=void 0,e.flags&=-9,e.flags&1)try{e.trigger()}catch(i){A||(A=i)}e=t}}if(A)throw A}function QI(A){for(let e=A.deps;e;e=e.nextDep)e.version=-1,e.prevActiveLink=e.dep.activeLink,e.dep.activeLink=e}function cI(A){let e,t=A.depsTail,i=t;for(;i;){const n=i.prevDep;i.version===-1?(i===t&&(t=n),Xr(i),uB(i)):e=i,i.dep.activeLink=i.prevActiveLink,i.prevActiveLink=void 0,i=n}A.deps=e,A.depsTail=t}function ar(A){for(let e=A.deps;e;e=e.nextDep)if(e.dep.version!==e.version||e.dep.computed&&(EI(e.dep.computed)||e.dep.version!==e.version))return!0;return!!A._dirty}function EI(A){if(A.flags&4&&!(A.flags&16)||(A.flags&=-17,A.globalVersion===$i)||(A.globalVersion=$i,!A.isSSR&&A.flags&128&&(!A.deps&&!A._dirty||!ar(A))))return;A.flags|=2;const e=A.dep,t=OA,i=_e;OA=A,_e=!0;try{QI(A);const n=A.fn(A._value);(e.version===0||Yt(n,A._value))&&(A.flags|=128,A._value=n,e.version++)}catch(n){throw e.version++,n}finally{OA=t,_e=i,cI(A),A.flags&=-3}}function Xr(A,e=!1){const{dep:t,prevSub:i,nextSub:n}=A;if(i&&(i.nextSub=n,A.prevSub=void 0),n&&(n.prevSub=i,A.nextSub=void 0),t.subs===A&&(t.subs=i,!i&&t.computed)){t.computed.flags&=-5;for(let o=t.computed.deps;o;o=o.nextDep)Xr(o,!0)}!e&&!--t.sc&&t.map&&t.map.delete(t.key)}function uB(A){const{prevDep:e,nextDep:t}=A;e&&(e.nextDep=t,A.prevDep=void 0),t&&(t.prevDep=e,A.nextDep=void 0)}let _e=!0;const uI=[];function wt(){uI.push(_e),_e=!1}function Dt(){const A=uI.pop();_e=A===void 0?!0:A}function Ug(A){const{cleanup:e}=A;if(A.cleanup=void 0,e){const t=OA;OA=void 0;try{e()}finally{OA=t}}}let $i=0;class hB{constructor(e,t){this.sub=e,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class zr{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(e){if(!OA||!_e||OA===this.computed)return;let t=this.activeLink;if(t===void 0||t.sub!==OA)t=this.activeLink=new hB(OA,this),OA.deps?(t.prevDep=OA.depsTail,OA.depsTail.nextDep=t,OA.depsTail=t):OA.deps=OA.depsTail=t,hI(t);else if(t.version===-1&&(t.version=this.version,t.nextDep)){const i=t.nextDep;i.prevDep=t.prevDep,t.prevDep&&(t.prevDep.nextDep=i),t.prevDep=OA.depsTail,t.nextDep=void 0,OA.depsTail.nextDep=t,OA.depsTail=t,OA.deps===t&&(OA.deps=i)}return t}trigger(e){this.version++,$i++,this.notify(e)}notify(e){jr();try{for(let t=this.subs;t;t=t.prevSub)t.sub.notify()&&t.sub.dep.notify()}finally{Zr()}}}function hI(A){if(A.dep.sc++,A.sub.flags&4){const e=A.dep.computed;if(e&&!A.dep.subs){e.flags|=20;for(let i=e.deps;i;i=i.nextDep)hI(i)}const t=A.dep.subs;t!==A&&(A.prevSub=t,t&&(t.nextSub=A)),A.dep.subs=A}}const Ir=new WeakMap,ri=Symbol(""),Cr=Symbol(""),An=Symbol("");function ce(A,e,t){if(_e&&OA){let i=Ir.get(A);i||Ir.set(A,i=new Map);let n=i.get(t);n||(i.set(t,n=new zr),n.map=i,n.key=t),n.track()}}function ut(A,e,t,i,n,o){const r=Ir.get(A);if(!r){$i++;return}const g=s=>{s&&s.trigger()};if(jr(),e==="clear")r.forEach(g);else{const s=yA(A),a=s&&qr(t);if(s&&t==="length"){const I=Number(i);r.forEach((l,C)=>{(C==="length"||C===An||!It(C)&&C>=I)&&g(l)})}else switch((t!==void 0||r.has(void 0))&&g(r.get(t)),a&&g(r.get(An)),e){case"add":s?a&&g(r.get("length")):(g(r.get(ri)),hi(A)&&g(r.get(Cr)));break;case"delete":s||(g(r.get(ri)),hi(A)&&g(r.get(Cr)));break;case"set":hi(A)&&g(r.get(ri));break}}Zr()}function Ci(A){const e=xA(A);return e===A?e:(ce(e,"iterate",An),xe(A)?e:e.map(Oe))}function fo(A){return ce(A=xA(A),"iterate",An),A}function Ut(A,e){return kt(A)?gi(A)?wi(Oe(e)):wi(e):Oe(e)}const fB={__proto__:null,[Symbol.iterator](){return Ho(this,Symbol.iterator,A=>Ut(this,A))},concat(...A){return Ci(this).concat(...A.map(e=>yA(e)?Ci(e):e))},entries(){return Ho(this,"entries",A=>(A[1]=Ut(this,A[1]),A))},every(A,e){return lt(this,"every",A,e,void 0,arguments)},filter(A,e){return lt(this,"filter",A,e,t=>t.map(i=>Ut(this,i)),arguments)},find(A,e){return lt(this,"find",A,e,t=>Ut(this,t),arguments)},findIndex(A,e){return lt(this,"findIndex",A,e,void 0,arguments)},findLast(A,e){return lt(this,"findLast",A,e,t=>Ut(this,t),arguments)},findLastIndex(A,e){return lt(this,"findLastIndex",A,e,void 0,arguments)},forEach(A,e){return lt(this,"forEach",A,e,void 0,arguments)},includes(...A){return Yo(this,"includes",A)},indexOf(...A){return Yo(this,"indexOf",A)},join(A){return Ci(this).join(A)},lastIndexOf(...A){return Yo(this,"lastIndexOf",A)},map(A,e){return lt(this,"map",A,e,void 0,arguments)},pop(){return Mi(this,"pop")},push(...A){return Mi(this,"push",A)},reduce(A,...e){return Mg(this,"reduce",A,e)},reduceRight(A,...e){return Mg(this,"reduceRight",A,e)},shift(){return Mi(this,"shift")},some(A,e){return lt(this,"some",A,e,void 0,arguments)},splice(...A){return Mi(this,"splice",A)},toReversed(){return Ci(this).toReversed()},toSorted(A){return Ci(this).toSorted(A)},toSpliced(...A){return Ci(this).toSpliced(...A)},unshift(...A){return Mi(this,"unshift",A)},values(){return Ho(this,"values",A=>Ut(this,A))}};function Ho(A,e,t){const i=fo(A),n=i[e]();return i!==A&&!xe(A)&&(n._next=n.next,n.next=()=>{const o=n._next();return o.done||(o.value=t(o.value)),o}),n}const dB=Array.prototype;function lt(A,e,t,i,n,o){const r=fo(A),g=r!==A&&!xe(A),s=r[e];if(s!==dB[e]){const l=s.apply(A,o);return g?Oe(l):l}let a=t;r!==A&&(g?a=function(l,C){return t.call(this,Ut(A,l),C,A)}:t.length>2&&(a=function(l,C){return t.call(this,l,C,A)}));const I=s.call(r,a,i);return g&&n?n(I):I}function Mg(A,e,t,i){const n=fo(A);let o=t;return n!==A&&(xe(A)?t.length>3&&(o=function(r,g,s){return t.call(this,r,g,s,A)}):o=function(r,g,s){return t.call(this,r,Ut(A,g),s,A)}),n[e](o,...i)}function Yo(A,e,t){const i=xA(A);ce(i,"iterate",An);const n=i[e](...t);return(n===-1||n===!1)&&eg(t[0])?(t[0]=xA(t[0]),i[e](...t)):n}function Mi(A,e,t=[]){wt(),jr();const i=xA(A)[e].apply(A,t);return Zr(),Dt(),i}const pB=Pr("__proto__,__v_isRef,__isVue"),fI=new Set(Object.getOwnPropertyNames(Symbol).filter(A=>A!=="arguments"&&A!=="caller").map(A=>Symbol[A]).filter(It));function mB(A){It(A)||(A=String(A));const e=xA(this);return ce(e,"has",A),e.hasOwnProperty(A)}class dI{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,i){if(t==="__v_skip")return e.__v_skip;const n=this._isReadonly,o=this._isShallow;if(t==="__v_isReactive")return!n;if(t==="__v_isReadonly")return n;if(t==="__v_isShallow")return o;if(t==="__v_raw")return i===(n?o?NB:wI:o?yI:mI).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(i)?e:void 0;const r=yA(e);if(!n){let s;if(r&&(s=fB[t]))return s;if(t==="hasOwnProperty")return mB}const g=Reflect.get(e,t,le(e)?e:i);if((It(t)?fI.has(t):pB(t))||(n||ce(e,"get",t),o))return g;if(le(g)){const s=r&&qr(t)?g:g.value;return n&&KA(s)?Br(s):s}return KA(g)?n?Br(g):po(g):g}}class pI extends dI{constructor(e=!1){super(!1,e)}set(e,t,i,n){let o=e[t];const r=yA(e)&&qr(t);if(!this._isShallow){const a=kt(o);if(!xe(i)&&!kt(i)&&(o=xA(o),i=xA(i)),!r&&le(o)&&!le(i))return a||(o.value=i),!0}const g=r?Number(t)A,vn=A=>Reflect.getPrototypeOf(A);function vB(A,e,t){return function(...i){const n=this.__v_raw,o=xA(n),r=hi(o),g=A==="entries"||A===Symbol.iterator&&r,s=A==="keys"&&r,a=n[A](...i),I=t?lr:e?wi:Oe;return!e&&ce(o,"iterate",s?Cr:ri),{next(){const{value:l,done:C}=a.next();return C?{value:l,done:C}:{value:g?[I(l[0]),I(l[1])]:I(l),done:C}},[Symbol.iterator](){return this}}}}function Fn(A){return function(...e){return A==="delete"?!1:A==="clear"?void 0:this}}function FB(A,e){const t={get(n){const o=this.__v_raw,r=xA(o),g=xA(n);A||(Yt(n,g)&&ce(r,"get",n),ce(r,"get",g));const{has:s}=vn(r),a=e?lr:A?wi:Oe;if(s.call(r,n))return a(o.get(n));if(s.call(r,g))return a(o.get(g));o!==r&&o.get(n)},get size(){const n=this.__v_raw;return!A&&ce(xA(n),"iterate",ri),n.size},has(n){const o=this.__v_raw,r=xA(o),g=xA(n);return A||(Yt(n,g)&&ce(r,"has",n),ce(r,"has",g)),n===g?o.has(n):o.has(n)||o.has(g)},forEach(n,o){const r=this,g=r.__v_raw,s=xA(g),a=e?lr:A?wi:Oe;return!A&&ce(s,"iterate",ri),g.forEach((I,l)=>n.call(o,a(I),a(l),r))}};return ue(t,A?{add:Fn("add"),set:Fn("set"),delete:Fn("delete"),clear:Fn("clear")}:{add(n){!e&&!xe(n)&&!kt(n)&&(n=xA(n));const o=xA(this);return vn(o).has.call(o,n)||(o.add(n),ut(o,"add",n,n)),this},set(n,o){!e&&!xe(o)&&!kt(o)&&(o=xA(o));const r=xA(this),{has:g,get:s}=vn(r);let a=g.call(r,n);a||(n=xA(n),a=g.call(r,n));const I=s.call(r,n);return r.set(n,o),a?Yt(o,I)&&ut(r,"set",n,o):ut(r,"add",n,o),this},delete(n){const o=xA(this),{has:r,get:g}=vn(o);let s=r.call(o,n);s||(n=xA(n),s=r.call(o,n)),g&&g.call(o,n);const a=o.delete(n);return s&&ut(o,"delete",n,void 0),a},clear(){const n=xA(this),o=n.size!==0,r=n.clear();return o&&ut(n,"clear",void 0,void 0),r}}),["keys","values","entries",Symbol.iterator].forEach(n=>{t[n]=vB(n,A,e)}),t}function $r(A,e){const t=FB(A,e);return(i,n,o)=>n==="__v_isReactive"?!A:n==="__v_isReadonly"?A:n==="__v_raw"?i:Reflect.get(JA(t,n)&&n in i?t:i,n,o)}const SB={get:$r(!1,!1)},RB={get:$r(!1,!0)},bB={get:$r(!0,!1)};const mI=new WeakMap,yI=new WeakMap,wI=new WeakMap,NB=new WeakMap;function GB(A){switch(A){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function LB(A){return A.__v_skip||!Object.isExtensible(A)?0:GB(nB(A))}function po(A){return kt(A)?A:Ag(A,!1,wB,SB,mI)}function DI(A){return Ag(A,!1,kB,RB,yI)}function Br(A){return Ag(A,!0,DB,bB,wI)}function Ag(A,e,t,i,n){if(!KA(A)||A.__v_raw&&!(e&&A.__v_isReactive))return A;const o=LB(A);if(o===0)return A;const r=n.get(A);if(r)return r;const g=new Proxy(A,o===2?i:t);return n.set(A,g),g}function gi(A){return kt(A)?gi(A.__v_raw):!!(A&&A.__v_isReactive)}function kt(A){return!!(A&&A.__v_isReadonly)}function xe(A){return!!(A&&A.__v_isShallow)}function eg(A){return A?!!A.__v_raw:!1}function xA(A){const e=A&&A.__v_raw;return e?xA(e):A}function _i(A){return!JA(A,"__v_skip")&&Object.isExtensible(A)&&rI(A,"__v_skip",!0),A}const Oe=A=>KA(A)?po(A):A,wi=A=>KA(A)?Br(A):A;function le(A){return A?A.__v_isRef===!0:!1}function cA(A){return kI(A,!1)}function tg(A){return kI(A,!0)}function kI(A,e){return le(A)?A:new UB(A,e)}class UB{constructor(e,t){this.dep=new zr,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:xA(e),this._value=t?e:Oe(e),this.__v_isShallow=t}get value(){return this.dep.track(),this._value}set value(e){const t=this._rawValue,i=this.__v_isShallow||xe(e)||kt(e);e=i?e:xA(e),Yt(e,t)&&(this._rawValue=e,this._value=i?e:Oe(e),this.dep.trigger())}}function BA(A){return le(A)?A.value:A}const MB={get:(A,e,t)=>e==="__v_raw"?A:BA(Reflect.get(A,e,t)),set:(A,e,t,i)=>{const n=A[e];return le(n)&&!le(t)?(n.value=t,!0):Reflect.set(A,e,t,i)}};function vI(A){return gi(A)?A:new Proxy(A,MB)}class xB{constructor(e,t,i){this.fn=e,this.setter=t,this._value=void 0,this.dep=new zr(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=$i-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=i}notify(){if(this.flags|=16,!(this.flags&8)&&OA!==this)return BI(this,!0),!0}get value(){const e=this.dep.track();return EI(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}}function JB(A,e,t=!1){let i,n;return FA(A)?i=A:(i=A.get,n=A.set),new xB(i,n,t)}const Sn={},qn=new WeakMap;let ei;function TB(A,e=!1,t=ei){if(t){let i=qn.get(t);i||qn.set(t,i=[]),i.push(A)}}function HB(A,e,t=_A){const{immediate:i,deep:n,once:o,scheduler:r,augmentJob:g,call:s}=t,a=d=>n?d:xe(d)||n===!1||n===0?ht(d,1):ht(d);let I,l,C,Q,h=!1,f=!1;if(le(A)?(l=()=>A.value,h=xe(A)):gi(A)?(l=()=>a(A),h=!0):yA(A)?(f=!0,h=A.some(d=>gi(d)||xe(d)),l=()=>A.map(d=>{if(le(d))return d.value;if(gi(d))return a(d);if(FA(d))return s?s(d,2):d()})):FA(A)?e?l=s?()=>s(A,2):A:l=()=>{if(C){wt();try{C()}finally{Dt()}}const d=ei;ei=I;try{return s?s(A,3,[Q]):A(Q)}finally{ei=d}}:l=ot,e&&n){const d=l,w=n===!0?1/0:n;l=()=>ht(d(),w)}const u=EB(),E=()=>{I.stop(),u&&u.active&&Wr(u.effects,I)};if(o&&e){const d=e;e=(...w)=>{d(...w),E()}}let m=f?new Array(A.length).fill(Sn):Sn;const c=d=>{if(!(!(I.flags&1)||!I.dirty&&!d))if(e){const w=I.run();if(n||h||(f?w.some((F,N)=>Yt(F,m[N])):Yt(w,m))){C&&C();const F=ei;ei=I;try{const N=[w,m===Sn?void 0:f&&m[0]===Sn?[]:m,Q];m=w,s?s(e,3,N):e(...N)}finally{ei=F}}}else I.run()};return g&&g(c),I=new CI(l),I.scheduler=r?()=>r(c,!1):c,Q=d=>TB(d,!1,I),C=I.onStop=()=>{const d=qn.get(I);if(d){if(s)s(d,4);else for(const w of d)w();qn.delete(I)}},e?i?c(!0):m=I.run():r?r(c.bind(null,!0),!0):I.run(),E.pause=I.pause.bind(I),E.resume=I.resume.bind(I),E.stop=E,E}function ht(A,e=1/0,t){if(e<=0||!KA(A)||A.__v_skip||(t=t||new Map,(t.get(A)||0)>=e))return A;if(t.set(A,e),e--,le(A))ht(A.value,e,t);else if(yA(A))for(let i=0;i{ht(i,e,t)});else if(oI(A)){for(const i in A)ht(A[i],e,t);for(const i of Object.getOwnPropertySymbols(A))Object.prototype.propertyIsEnumerable.call(A,i)&&ht(A[i],e,t)}return A}/** +**/let ke;class II{constructor(e=!1){this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=ke,!e&&ke&&(this.index=(ke.scopes||(ke.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,t;if(this.scopes)for(e=0,t=this.scopes.length;e0&&--this._on===0&&(ke=this.prevScope,this.prevScope=void 0)}stop(e){if(this._active){this._active=!1;let t,i;for(t=0,i=this.effects.length;t0)return;if(Vi){let e=Vi;for(Vi=void 0;e;){const t=e.next;e.next=void 0,e.flags&=-9,e=t}}let A;for(;Pi;){let e=Pi;for(Pi=void 0;e;){const t=e.next;if(e.next=void 0,e.flags&=-9,e.flags&1)try{e.trigger()}catch(i){A||(A=i)}e=t}}if(A)throw A}function QI(A){for(let e=A.deps;e;e=e.nextDep)e.version=-1,e.prevActiveLink=e.dep.activeLink,e.dep.activeLink=e}function cI(A){let e,t=A.depsTail,i=t;for(;i;){const n=i.prevDep;i.version===-1?(i===t&&(t=n),Xr(i),uB(i)):e=i,i.dep.activeLink=i.prevActiveLink,i.prevActiveLink=void 0,i=n}A.deps=e,A.depsTail=t}function ar(A){for(let e=A.deps;e;e=e.nextDep)if(e.dep.version!==e.version||e.dep.computed&&(EI(e.dep.computed)||e.dep.version!==e.version))return!0;return!!A._dirty}function EI(A){if(A.flags&4&&!(A.flags&16)||(A.flags&=-17,A.globalVersion===$i)||(A.globalVersion=$i,!A.isSSR&&A.flags&128&&(!A.deps&&!A._dirty||!ar(A))))return;A.flags|=2;const e=A.dep,t=OA,i=_e;OA=A,_e=!0;try{QI(A);const n=A.fn(A._value);(e.version===0||Yt(n,A._value))&&(A.flags|=128,A._value=n,e.version++)}catch(n){throw e.version++,n}finally{OA=t,_e=i,cI(A),A.flags&=-3}}function Xr(A,e=!1){const{dep:t,prevSub:i,nextSub:n}=A;if(i&&(i.nextSub=n,A.prevSub=void 0),n&&(n.prevSub=i,A.nextSub=void 0),t.subs===A&&(t.subs=i,!i&&t.computed)){t.computed.flags&=-5;for(let o=t.computed.deps;o;o=o.nextDep)Xr(o,!0)}!e&&!--t.sc&&t.map&&t.map.delete(t.key)}function uB(A){const{prevDep:e,nextDep:t}=A;e&&(e.nextDep=t,A.prevDep=void 0),t&&(t.prevDep=e,A.nextDep=void 0)}let _e=!0;const uI=[];function wt(){uI.push(_e),_e=!1}function Dt(){const A=uI.pop();_e=A===void 0?!0:A}function Ug(A){const{cleanup:e}=A;if(A.cleanup=void 0,e){const t=OA;OA=void 0;try{e()}finally{OA=t}}}let $i=0;class hB{constructor(e,t){this.sub=e,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class zr{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(e){if(!OA||!_e||OA===this.computed)return;let t=this.activeLink;if(t===void 0||t.sub!==OA)t=this.activeLink=new hB(OA,this),OA.deps?(t.prevDep=OA.depsTail,OA.depsTail.nextDep=t,OA.depsTail=t):OA.deps=OA.depsTail=t,hI(t);else if(t.version===-1&&(t.version=this.version,t.nextDep)){const i=t.nextDep;i.prevDep=t.prevDep,t.prevDep&&(t.prevDep.nextDep=i),t.prevDep=OA.depsTail,t.nextDep=void 0,OA.depsTail.nextDep=t,OA.depsTail=t,OA.deps===t&&(OA.deps=i)}return t}trigger(e){this.version++,$i++,this.notify(e)}notify(e){jr();try{for(let t=this.subs;t;t=t.prevSub)t.sub.notify()&&t.sub.dep.notify()}finally{Zr()}}}function hI(A){if(A.dep.sc++,A.sub.flags&4){const e=A.dep.computed;if(e&&!A.dep.subs){e.flags|=20;for(let i=e.deps;i;i=i.nextDep)hI(i)}const t=A.dep.subs;t!==A&&(A.prevSub=t,t&&(t.nextSub=A)),A.dep.subs=A}}const Ir=new WeakMap,ri=Symbol(""),Cr=Symbol(""),An=Symbol("");function ce(A,e,t){if(_e&&OA){let i=Ir.get(A);i||Ir.set(A,i=new Map);let n=i.get(t);n||(i.set(t,n=new zr),n.map=i,n.key=t),n.track()}}function ut(A,e,t,i,n,o){const r=Ir.get(A);if(!r){$i++;return}const g=s=>{s&&s.trigger()};if(jr(),e==="clear")r.forEach(g);else{const s=yA(A),a=s&&qr(t);if(s&&t==="length"){const I=Number(i);r.forEach((l,C)=>{(C==="length"||C===An||!It(C)&&C>=I)&&g(l)})}else switch((t!==void 0||r.has(void 0))&&g(r.get(t)),a&&g(r.get(An)),e){case"add":s?a&&g(r.get("length")):(g(r.get(ri)),hi(A)&&g(r.get(Cr)));break;case"delete":s||(g(r.get(ri)),hi(A)&&g(r.get(Cr)));break;case"set":hi(A)&&g(r.get(ri));break}}Zr()}function Ci(A){const e=xA(A);return e===A?e:(ce(e,"iterate",An),xe(A)?e:e.map(Oe))}function fo(A){return ce(A=xA(A),"iterate",An),A}function Ut(A,e){return kt(A)?gi(A)?wi(Oe(e)):wi(e):Oe(e)}const fB={__proto__:null,[Symbol.iterator](){return Ho(this,Symbol.iterator,A=>Ut(this,A))},concat(...A){return Ci(this).concat(...A.map(e=>yA(e)?Ci(e):e))},entries(){return Ho(this,"entries",A=>(A[1]=Ut(this,A[1]),A))},every(A,e){return lt(this,"every",A,e,void 0,arguments)},filter(A,e){return lt(this,"filter",A,e,t=>t.map(i=>Ut(this,i)),arguments)},find(A,e){return lt(this,"find",A,e,t=>Ut(this,t),arguments)},findIndex(A,e){return lt(this,"findIndex",A,e,void 0,arguments)},findLast(A,e){return lt(this,"findLast",A,e,t=>Ut(this,t),arguments)},findLastIndex(A,e){return lt(this,"findLastIndex",A,e,void 0,arguments)},forEach(A,e){return lt(this,"forEach",A,e,void 0,arguments)},includes(...A){return Yo(this,"includes",A)},indexOf(...A){return Yo(this,"indexOf",A)},join(A){return Ci(this).join(A)},lastIndexOf(...A){return Yo(this,"lastIndexOf",A)},map(A,e){return lt(this,"map",A,e,void 0,arguments)},pop(){return Mi(this,"pop")},push(...A){return Mi(this,"push",A)},reduce(A,...e){return Mg(this,"reduce",A,e)},reduceRight(A,...e){return Mg(this,"reduceRight",A,e)},shift(){return Mi(this,"shift")},some(A,e){return lt(this,"some",A,e,void 0,arguments)},splice(...A){return Mi(this,"splice",A)},toReversed(){return Ci(this).toReversed()},toSorted(A){return Ci(this).toSorted(A)},toSpliced(...A){return Ci(this).toSpliced(...A)},unshift(...A){return Mi(this,"unshift",A)},values(){return Ho(this,"values",A=>Ut(this,A))}};function Ho(A,e,t){const i=fo(A),n=i[e]();return i!==A&&!xe(A)&&(n._next=n.next,n.next=()=>{const o=n._next();return o.done||(o.value=t(o.value)),o}),n}const dB=Array.prototype;function lt(A,e,t,i,n,o){const r=fo(A),g=r!==A&&!xe(A),s=r[e];if(s!==dB[e]){const l=s.apply(A,o);return g?Oe(l):l}let a=t;r!==A&&(g?a=function(l,C){return t.call(this,Ut(A,l),C,A)}:t.length>2&&(a=function(l,C){return t.call(this,l,C,A)}));const I=s.call(r,a,i);return g&&n?n(I):I}function Mg(A,e,t,i){const n=fo(A);let o=t;return n!==A&&(xe(A)?t.length>3&&(o=function(r,g,s){return t.call(this,r,g,s,A)}):o=function(r,g,s){return t.call(this,r,Ut(A,g),s,A)}),n[e](o,...i)}function Yo(A,e,t){const i=xA(A);ce(i,"iterate",An);const n=i[e](...t);return(n===-1||n===!1)&&eg(t[0])?(t[0]=xA(t[0]),i[e](...t)):n}function Mi(A,e,t=[]){wt(),jr();const i=xA(A)[e].apply(A,t);return Zr(),Dt(),i}const pB=Pr("__proto__,__v_isRef,__isVue"),fI=new Set(Object.getOwnPropertyNames(Symbol).filter(A=>A!=="arguments"&&A!=="caller").map(A=>Symbol[A]).filter(It));function mB(A){It(A)||(A=String(A));const e=xA(this);return ce(e,"has",A),e.hasOwnProperty(A)}class dI{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,i){if(t==="__v_skip")return e.__v_skip;const n=this._isReadonly,o=this._isShallow;if(t==="__v_isReactive")return!n;if(t==="__v_isReadonly")return n;if(t==="__v_isShallow")return o;if(t==="__v_raw")return i===(n?o?NB:wI:o?yI:mI).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(i)?e:void 0;const r=yA(e);if(!n){let s;if(r&&(s=fB[t]))return s;if(t==="hasOwnProperty")return mB}const g=Reflect.get(e,t,le(e)?e:i);if((It(t)?fI.has(t):pB(t))||(n||ce(e,"get",t),o))return g;if(le(g)){const s=r&&qr(t)?g:g.value;return n&&KA(s)?Br(s):s}return KA(g)?n?Br(g):po(g):g}}class pI extends dI{constructor(e=!1){super(!1,e)}set(e,t,i,n){let o=e[t];const r=yA(e)&&qr(t);if(!this._isShallow){const a=kt(o);if(!xe(i)&&!kt(i)&&(o=xA(o),i=xA(i)),!r&&le(o)&&!le(i))return a||(o.value=i),!0}const g=r?Number(t)A,vn=A=>Reflect.getPrototypeOf(A);function vB(A,e,t){return function(...i){const n=this.__v_raw,o=xA(n),r=hi(o),g=A==="entries"||A===Symbol.iterator&&r,s=A==="keys"&&r,a=n[A](...i),I=t?lr:e?wi:Oe;return!e&&ce(o,"iterate",s?Cr:ri),{next(){const{value:l,done:C}=a.next();return C?{value:l,done:C}:{value:g?[I(l[0]),I(l[1])]:I(l),done:C}},[Symbol.iterator](){return this}}}}function Fn(A){return function(...e){return A==="delete"?!1:A==="clear"?void 0:this}}function FB(A,e){const t={get(n){const o=this.__v_raw,r=xA(o),g=xA(n);A||(Yt(n,g)&&ce(r,"get",n),ce(r,"get",g));const{has:s}=vn(r),a=e?lr:A?wi:Oe;if(s.call(r,n))return a(o.get(n));if(s.call(r,g))return a(o.get(g));o!==r&&o.get(n)},get size(){const n=this.__v_raw;return!A&&ce(xA(n),"iterate",ri),n.size},has(n){const o=this.__v_raw,r=xA(o),g=xA(n);return A||(Yt(n,g)&&ce(r,"has",n),ce(r,"has",g)),n===g?o.has(n):o.has(n)||o.has(g)},forEach(n,o){const r=this,g=r.__v_raw,s=xA(g),a=e?lr:A?wi:Oe;return!A&&ce(s,"iterate",ri),g.forEach((I,l)=>n.call(o,a(I),a(l),r))}};return ue(t,A?{add:Fn("add"),set:Fn("set"),delete:Fn("delete"),clear:Fn("clear")}:{add(n){!e&&!xe(n)&&!kt(n)&&(n=xA(n));const o=xA(this);return vn(o).has.call(o,n)||(o.add(n),ut(o,"add",n,n)),this},set(n,o){!e&&!xe(o)&&!kt(o)&&(o=xA(o));const r=xA(this),{has:g,get:s}=vn(r);let a=g.call(r,n);a||(n=xA(n),a=g.call(r,n));const I=s.call(r,n);return r.set(n,o),a?Yt(o,I)&&ut(r,"set",n,o):ut(r,"add",n,o),this},delete(n){const o=xA(this),{has:r,get:g}=vn(o);let s=r.call(o,n);s||(n=xA(n),s=r.call(o,n)),g&&g.call(o,n);const a=o.delete(n);return s&&ut(o,"delete",n,void 0),a},clear(){const n=xA(this),o=n.size!==0,r=n.clear();return o&&ut(n,"clear",void 0,void 0),r}}),["keys","values","entries",Symbol.iterator].forEach(n=>{t[n]=vB(n,A,e)}),t}function $r(A,e){const t=FB(A,e);return(i,n,o)=>n==="__v_isReactive"?!A:n==="__v_isReadonly"?A:n==="__v_raw"?i:Reflect.get(JA(t,n)&&n in i?t:i,n,o)}const SB={get:$r(!1,!1)},RB={get:$r(!1,!0)},bB={get:$r(!0,!1)};const mI=new WeakMap,yI=new WeakMap,wI=new WeakMap,NB=new WeakMap;function GB(A){switch(A){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function LB(A){return A.__v_skip||!Object.isExtensible(A)?0:GB(nB(A))}function po(A){return kt(A)?A:Ag(A,!1,wB,SB,mI)}function DI(A){return Ag(A,!1,kB,RB,yI)}function Br(A){return Ag(A,!0,DB,bB,wI)}function Ag(A,e,t,i,n){if(!KA(A)||A.__v_raw&&!(e&&A.__v_isReactive))return A;const o=LB(A);if(o===0)return A;const r=n.get(A);if(r)return r;const g=new Proxy(A,o===2?i:t);return n.set(A,g),g}function gi(A){return kt(A)?gi(A.__v_raw):!!(A&&A.__v_isReactive)}function kt(A){return!!(A&&A.__v_isReadonly)}function xe(A){return!!(A&&A.__v_isShallow)}function eg(A){return A?!!A.__v_raw:!1}function xA(A){const e=A&&A.__v_raw;return e?xA(e):A}function _i(A){return!JA(A,"__v_skip")&&Object.isExtensible(A)&&rI(A,"__v_skip",!0),A}const Oe=A=>KA(A)?po(A):A,wi=A=>KA(A)?Br(A):A;function le(A){return A?A.__v_isRef===!0:!1}function EA(A){return kI(A,!1)}function tg(A){return kI(A,!0)}function kI(A,e){return le(A)?A:new UB(A,e)}class UB{constructor(e,t){this.dep=new zr,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:xA(e),this._value=t?e:Oe(e),this.__v_isShallow=t}get value(){return this.dep.track(),this._value}set value(e){const t=this._rawValue,i=this.__v_isShallow||xe(e)||kt(e);e=i?e:xA(e),Yt(e,t)&&(this._rawValue=e,this._value=i?e:Oe(e),this.dep.trigger())}}function BA(A){return le(A)?A.value:A}const MB={get:(A,e,t)=>e==="__v_raw"?A:BA(Reflect.get(A,e,t)),set:(A,e,t,i)=>{const n=A[e];return le(n)&&!le(t)?(n.value=t,!0):Reflect.set(A,e,t,i)}};function vI(A){return gi(A)?A:new Proxy(A,MB)}class xB{constructor(e,t,i){this.fn=e,this.setter=t,this._value=void 0,this.dep=new zr(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=$i-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=i}notify(){if(this.flags|=16,!(this.flags&8)&&OA!==this)return BI(this,!0),!0}get value(){const e=this.dep.track();return EI(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}}function JB(A,e,t=!1){let i,n;return FA(A)?i=A:(i=A.get,n=A.set),new xB(i,n,t)}const Sn={},qn=new WeakMap;let ei;function TB(A,e=!1,t=ei){if(t){let i=qn.get(t);i||qn.set(t,i=[]),i.push(A)}}function HB(A,e,t=_A){const{immediate:i,deep:n,once:o,scheduler:r,augmentJob:g,call:s}=t,a=d=>n?d:xe(d)||n===!1||n===0?ht(d,1):ht(d);let I,l,C,Q,h=!1,f=!1;if(le(A)?(l=()=>A.value,h=xe(A)):gi(A)?(l=()=>a(A),h=!0):yA(A)?(f=!0,h=A.some(d=>gi(d)||xe(d)),l=()=>A.map(d=>{if(le(d))return d.value;if(gi(d))return a(d);if(FA(d))return s?s(d,2):d()})):FA(A)?e?l=s?()=>s(A,2):A:l=()=>{if(C){wt();try{C()}finally{Dt()}}const d=ei;ei=I;try{return s?s(A,3,[Q]):A(Q)}finally{ei=d}}:l=ot,e&&n){const d=l,p=n===!0?1/0:n;l=()=>ht(d(),p)}const u=EB(),E=()=>{I.stop(),u&&u.active&&Wr(u.effects,I)};if(o&&e){const d=e;e=(...p)=>{d(...p),E()}}let D=f?new Array(A.length).fill(Sn):Sn;const c=d=>{if(!(!(I.flags&1)||!I.dirty&&!d))if(e){const p=I.run();if(n||h||(f?p.some((v,N)=>Yt(v,D[N])):Yt(p,D))){C&&C();const v=ei;ei=I;try{const N=[p,D===Sn?void 0:f&&D[0]===Sn?[]:D,Q];D=p,s?s(e,3,N):e(...N)}finally{ei=v}}}else I.run()};return g&&g(c),I=new CI(l),I.scheduler=r?()=>r(c,!1):c,Q=d=>TB(d,!1,I),C=I.onStop=()=>{const d=qn.get(I);if(d){if(s)s(d,4);else for(const p of d)p();qn.delete(I)}},e?i?c(!0):D=I.run():r?r(c.bind(null,!0),!0):I.run(),E.pause=I.pause.bind(I),E.resume=I.resume.bind(I),E.stop=E,E}function ht(A,e=1/0,t){if(e<=0||!KA(A)||A.__v_skip||(t=t||new Map,(t.get(A)||0)>=e))return A;if(t.set(A,e),e--,le(A))ht(A.value,e,t);else if(yA(A))for(let i=0;i{ht(i,e,t)});else if(oI(A)){for(const i in A)ht(A[i],e,t);for(const i of Object.getOwnPropertySymbols(A))Object.prototype.propertyIsEnumerable.call(A,i)&&ht(A[i],e,t)}return A}/** * @vue/runtime-core v3.5.26 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT -**/function un(A,e,t,i){try{return i?A(...i):A()}catch(n){mo(n,e,t)}}function Ct(A,e,t,i){if(FA(A)){const n=un(A,e,t,i);return n&&iI(n)&&n.catch(o=>{mo(o,e,t)}),n}if(yA(A)){const n=[];for(let o=0;o>>1,n=me[i],o=en(n);o=en(t)?me.push(A):me.splice(_B(e),0,A),A.flags|=1,SI()}}function SI(){jn||(jn=FI.then(bI))}function KB(A){yA(A)?fi.push(...A):Mt&&A.id===-1?Mt.splice(Bi+1,0,A):A.flags&1||(fi.push(A),A.flags|=1),SI()}function xg(A,e,t=At+1){for(;ten(t)-en(i));if(fi.length=0,Mt){Mt.push(...e);return}for(Mt=e,Bi=0;BiA.id==null?A.flags&2?-1:1/0:A.id;function bI(A){try{for(At=0;At{i._d&&$n(-1);const o=Zn(e);let r;try{r=A(...n)}finally{Zn(o),i._d&&$n(1)}return r};return i._n=!0,i._c=!0,i._d=!0,i}function ZA(A,e){if(Re===null)return A;const t=ko(Re),i=A.dirs||(A.dirs=[]);for(let n=0;n1)return t&&FA(e)?e.call(i&&i.proxy):e}}const PB=Symbol.for("v-scx"),VB=()=>rt(PB);function ae(A,e,t){return GI(A,e,t)}function GI(A,e,t=_A){const{immediate:i,deep:n,flush:o,once:r}=t,g=ue({},t),s=e&&i||!e&&o!=="post";let a;if(nn){if(o==="sync"){const Q=VB();a=Q.__watcherHandles||(Q.__watcherHandles=[])}else if(!s){const Q=()=>{};return Q.stop=ot,Q.resume=ot,Q.pause=ot,Q}}const I=Ee;g.call=(Q,h,f)=>Ct(Q,I,h,f);let l=!1;o==="post"?g.scheduler=Q=>{Se(Q,I&&I.suspense)}:o!=="sync"&&(l=!0,g.scheduler=(Q,h)=>{h?Q():ig(Q)}),g.augmentJob=Q=>{e&&(Q.flags|=4),l&&(Q.flags|=2,I&&(Q.id=I.uid,Q.i=I))};const C=HB(A,e,g);return nn&&(a?a.push(C):s&&C()),C}function WB(A,e,t){const i=this.proxy,n=ee(A)?A.includes(".")?LI(i,A):()=>i[A]:A.bind(i,i);let o;FA(e)?o=e:(o=e.handler,t=e);const r=pn(this),g=GI(n,o.bind(i),t);return r(),g}function LI(A,e){const t=e.split(".");return()=>{let i=A;for(let n=0;nA.__isTeleport,ZB=Symbol("_leaveCb");function ng(A,e){A.shapeFlag&6&&A.component?(A.transition=e,ng(A.component.subTree,e)):A.shapeFlag&128?(A.ssContent.transition=e.clone(A.ssContent),A.ssFallback.transition=e.clone(A.ssFallback)):A.transition=e}function fn(A,e){return FA(A)?ue({name:A.name},e,{setup:A}):A}function UI(A){A.ids=[A.ids[0]+A.ids[2]+++"-",0,0]}const Xn=new WeakMap;function Wi(A,e,t,i,n=!1){if(yA(A)){A.forEach((h,f)=>Wi(h,e&&(yA(e)?e[f]:e),t,i,n));return}if(qi(i)&&!n){i.shapeFlag&512&&i.type.__asyncResolved&&i.component.subTree.component&&Wi(A,e,t,i.component.subTree);return}const o=i.shapeFlag&4?ko(i.component):i.el,r=n?null:o,{i:g,r:s}=A,a=e&&e.r,I=g.refs===_A?g.refs={}:g.refs,l=g.setupState,C=xA(l),Q=l===_A?tI:h=>JA(C,h);if(a!=null&&a!==s){if(Jg(e),ee(a))I[a]=null,Q(a)&&(l[a]=null);else if(le(a)){a.value=null;const h=e;h.k&&(I[h.k]=null)}}if(FA(s))un(s,g,12,[r,I]);else{const h=ee(s),f=le(s);if(h||f){const u=()=>{if(A.f){const E=h?Q(s)?l[s]:I[s]:s.value;if(n)yA(E)&&Wr(E,o);else if(yA(E))E.includes(o)||E.push(o);else if(h)I[s]=[o],Q(s)&&(l[s]=I[s]);else{const m=[o];s.value=m,A.k&&(I[A.k]=m)}}else h?(I[s]=r,Q(s)&&(l[s]=r)):f&&(s.value=r,A.k&&(I[A.k]=r))};if(r){const E=()=>{u(),Xn.delete(A)};E.id=-1,Xn.set(A,E),Se(E,t)}else Jg(A),u()}}}function Jg(A){const e=Xn.get(A);e&&(e.flags|=8,Xn.delete(A))}uo().requestIdleCallback;uo().cancelIdleCallback;const qi=A=>!!A.type.__asyncLoader,MI=A=>A.type.__isKeepAlive;function XB(A,e){xI(A,"a",e)}function zB(A,e){xI(A,"da",e)}function xI(A,e,t=Ee){const i=A.__wdc||(A.__wdc=()=>{let n=t;for(;n;){if(n.isDeactivated)return;n=n.parent}return A()});if(yo(e,i,t),t){let n=t.parent;for(;n&&n.parent;)MI(n.parent.vnode)&&$B(i,e,t,n),n=n.parent}}function $B(A,e,t,i){const n=yo(e,A,i,!0);Ii(()=>{Wr(i[e],n)},t)}function yo(A,e,t=Ee,i=!1){if(t){const n=t[A]||(t[A]=[]),o=e.__weh||(e.__weh=(...r)=>{wt();const g=pn(t),s=Ct(e,t,A,r);return g(),Dt(),s});return i?n.unshift(o):n.push(o),o}}const vt=A=>(e,t=Ee)=>{(!nn||A==="sp")&&yo(A,(...i)=>e(...i),t)},JI=vt("bm"),Ft=vt("m"),AQ=vt("bu"),eQ=vt("u"),tQ=vt("bum"),Ii=vt("um"),iQ=vt("sp"),nQ=vt("rtg"),oQ=vt("rtc");function rQ(A,e=Ee){yo("ec",A,e)}const gQ="components",TI=Symbol.for("v-ndc");function HI(A){return ee(A)?sQ(gQ,A,!1)||A:A||TI}function sQ(A,e,t=!0,i=!1){const n=Re||Ee;if(n){const o=n.type;{const g=VQ(o,!1);if(g&&(g===e||g===Je(e)||g===co(Je(e))))return o}const r=Tg(n[A]||o[A],e)||Tg(n.appContext[A],e);return!r&&i?o:r}}function Tg(A,e){return A&&(A[e]||A[Je(e)]||A[co(Je(e))])}function Ke(A,e,t,i){let n;const o=t,r=yA(A);if(r||ee(A)){const g=r&&gi(A);let s=!1,a=!1;g&&(s=!xe(A),a=kt(A),A=fo(A)),n=new Array(A.length);for(let I=0,l=A.length;Ie(g,s,void 0,o));else{const g=Object.keys(A);n=new Array(g.length);for(let s=0,a=g.length;sA?oC(A)?ko(A):Qr(A.parent):null,ji=ue(Object.create(null),{$:A=>A,$el:A=>A.vnode.el,$data:A=>A.data,$props:A=>A.props,$attrs:A=>A.attrs,$slots:A=>A.slots,$refs:A=>A.refs,$parent:A=>Qr(A.parent),$root:A=>Qr(A.root),$host:A=>A.ce,$emit:A=>A.emit,$options:A=>_I(A),$forceUpdate:A=>A.f||(A.f=()=>{ig(A.update)}),$nextTick:A=>A.n||(A.n=hn.bind(A.proxy)),$watch:A=>WB.bind(A)}),_o=(A,e)=>A!==_A&&!A.__isScriptSetup&&JA(A,e),aQ={get({_:A},e){if(e==="__v_skip")return!0;const{ctx:t,setupState:i,data:n,props:o,accessCache:r,type:g,appContext:s}=A;if(e[0]!=="$"){const C=r[e];if(C!==void 0)switch(C){case 1:return i[e];case 2:return n[e];case 4:return t[e];case 3:return o[e]}else{if(_o(i,e))return r[e]=1,i[e];if(n!==_A&&JA(n,e))return r[e]=2,n[e];if(JA(o,e))return r[e]=3,o[e];if(t!==_A&&JA(t,e))return r[e]=4,t[e];cr&&(r[e]=0)}}const a=ji[e];let I,l;if(a)return e==="$attrs"&&ce(A.attrs,"get",""),a(A);if((I=g.__cssModules)&&(I=I[e]))return I;if(t!==_A&&JA(t,e))return r[e]=4,t[e];if(l=s.config.globalProperties,JA(l,e))return l[e]},set({_:A},e,t){const{data:i,setupState:n,ctx:o}=A;return _o(n,e)?(n[e]=t,!0):i!==_A&&JA(i,e)?(i[e]=t,!0):JA(A.props,e)||e[0]==="$"&&e.slice(1)in A?!1:(o[e]=t,!0)},has({_:{data:A,setupState:e,accessCache:t,ctx:i,appContext:n,props:o,type:r}},g){let s;return!!(t[g]||A!==_A&&g[0]!=="$"&&JA(A,g)||_o(e,g)||JA(o,g)||JA(i,g)||JA(ji,g)||JA(n.config.globalProperties,g)||(s=r.__cssModules)&&s[g])},defineProperty(A,e,t){return t.get!=null?A._.accessCache[e]=0:JA(t,"value")&&this.set(A,e,t.value,null),Reflect.defineProperty(A,e,t)}};function Hg(A){return yA(A)?A.reduce((e,t)=>(e[t]=null,e),{}):A}let cr=!0;function IQ(A){const e=_I(A),t=A.proxy,i=A.ctx;cr=!1,e.beforeCreate&&Yg(e.beforeCreate,A,"bc");const{data:n,computed:o,methods:r,watch:g,provide:s,inject:a,created:I,beforeMount:l,mounted:C,beforeUpdate:Q,updated:h,activated:f,deactivated:u,beforeDestroy:E,beforeUnmount:m,destroyed:c,unmounted:d,render:w,renderTracked:F,renderTriggered:N,errorCaptured:G,serverPrefetch:K,expose:R,inheritAttrs:b,components:L,directives:EA,filters:dA}=e;if(a&&CQ(a,i,null),r)for(const X in r){const tA=r[X];FA(tA)&&(i[X]=tA.bind(t))}if(n){const X=n.call(t,t);KA(X)&&(A.data=po(X))}if(cr=!0,o)for(const X in o){const tA=o[X],fA=FA(tA)?tA.bind(t,t):FA(tA.get)?tA.get.bind(t,t):ot,Y=!FA(tA)&&FA(tA.set)?tA.set.bind(t):ot,W=hA({get:fA,set:Y});Object.defineProperty(i,X,{enumerable:!0,configurable:!0,get:()=>W.value,set:z=>W.value=z})}if(g)for(const X in g)YI(g[X],i,t,X);if(s){const X=FA(s)?s.call(t):s;Reflect.ownKeys(X).forEach(tA=>{Hn(tA,X[tA])})}I&&Yg(I,A,"c");function nA(X,tA){yA(tA)?tA.forEach(fA=>X(fA.bind(t))):tA&&X(tA.bind(t))}if(nA(JI,l),nA(Ft,C),nA(AQ,Q),nA(eQ,h),nA(XB,f),nA(zB,u),nA(rQ,G),nA(oQ,F),nA(nQ,N),nA(tQ,m),nA(Ii,d),nA(iQ,K),yA(R))if(R.length){const X=A.exposed||(A.exposed={});R.forEach(tA=>{Object.defineProperty(X,tA,{get:()=>t[tA],set:fA=>t[tA]=fA,enumerable:!0})})}else A.exposed||(A.exposed={});w&&A.render===ot&&(A.render=w),b!=null&&(A.inheritAttrs=b),L&&(A.components=L),EA&&(A.directives=EA),K&&UI(A)}function CQ(A,e,t=ot){yA(A)&&(A=Er(A));for(const i in A){const n=A[i];let o;KA(n)?"default"in n?o=rt(n.from||i,n.default,!0):o=rt(n.from||i):o=rt(n),le(o)?Object.defineProperty(e,i,{enumerable:!0,configurable:!0,get:()=>o.value,set:r=>o.value=r}):e[i]=o}}function Yg(A,e,t){Ct(yA(A)?A.map(i=>i.bind(e.proxy)):A.bind(e.proxy),e,t)}function YI(A,e,t,i){let n=i.includes(".")?LI(t,i):()=>t[i];if(ee(A)){const o=e[A];FA(o)&&ae(n,o)}else if(FA(A))ae(n,A.bind(t));else if(KA(A))if(yA(A))A.forEach(o=>YI(o,e,t,i));else{const o=FA(A.handler)?A.handler.bind(t):e[A.handler];FA(o)&&ae(n,o,A)}}function _I(A){const e=A.type,{mixins:t,extends:i}=e,{mixins:n,optionsCache:o,config:{optionMergeStrategies:r}}=A.appContext,g=o.get(e);let s;return g?s=g:!n.length&&!t&&!i?s=e:(s={},n.length&&n.forEach(a=>zn(s,a,r,!0)),zn(s,e,r)),KA(e)&&o.set(e,s),s}function zn(A,e,t,i=!1){const{mixins:n,extends:o}=e;o&&zn(A,o,t,!0),n&&n.forEach(r=>zn(A,r,t,!0));for(const r in e)if(!(i&&r==="expose")){const g=lQ[r]||t&&t[r];A[r]=g?g(A[r],e[r]):e[r]}return A}const lQ={data:_g,props:Kg,emits:Kg,methods:Ki,computed:Ki,beforeCreate:fe,created:fe,beforeMount:fe,mounted:fe,beforeUpdate:fe,updated:fe,beforeDestroy:fe,beforeUnmount:fe,destroyed:fe,unmounted:fe,activated:fe,deactivated:fe,errorCaptured:fe,serverPrefetch:fe,components:Ki,directives:Ki,watch:QQ,provide:_g,inject:BQ};function _g(A,e){return e?A?function(){return ue(FA(A)?A.call(this,this):A,FA(e)?e.call(this,this):e)}:e:A}function BQ(A,e){return Ki(Er(A),Er(e))}function Er(A){if(yA(A)){const e={};for(let t=0;te==="modelValue"||e==="model-value"?A.modelModifiers:A[`${e}Modifiers`]||A[`${Je(e)}Modifiers`]||A[`${ai(e)}Modifiers`];function hQ(A,e,...t){if(A.isUnmounted)return;const i=A.vnode.props||_A;let n=t;const o=e.startsWith("update:"),r=o&&uQ(i,e.slice(7));r&&(r.trim&&(n=t.map(I=>ee(I)?I.trim():I)),r.number&&(n=t.map(Eo)));let g,s=i[g=xo(e)]||i[g=xo(Je(e))];!s&&o&&(s=i[g=xo(ai(e))]),s&&Ct(s,A,6,n);const a=i[g+"Once"];if(a){if(!A.emitted)A.emitted={};else if(A.emitted[g])return;A.emitted[g]=!0,Ct(a,A,6,n)}}const fQ=new WeakMap;function OI(A,e,t=!1){const i=t?fQ:e.emitsCache,n=i.get(A);if(n!==void 0)return n;const o=A.emits;let r={},g=!1;if(!FA(A)){const s=a=>{const I=OI(a,e,!0);I&&(g=!0,ue(r,I))};!t&&e.mixins.length&&e.mixins.forEach(s),A.extends&&s(A.extends),A.mixins&&A.mixins.forEach(s)}return!o&&!g?(KA(A)&&i.set(A,null),null):(yA(o)?o.forEach(s=>r[s]=null):ue(r,o),KA(A)&&i.set(A,r),r)}function wo(A,e){return!A||!lo(e)?!1:(e=e.slice(2).replace(/Once$/,""),JA(A,e[0].toLowerCase()+e.slice(1))||JA(A,ai(e))||JA(A,e))}function Og(A){const{type:e,vnode:t,proxy:i,withProxy:n,propsOptions:[o],slots:r,attrs:g,emit:s,render:a,renderCache:I,props:l,data:C,setupState:Q,ctx:h,inheritAttrs:f}=A,u=Zn(A);let E,m;try{if(t.shapeFlag&4){const d=n||i,w=d;E=tt(a.call(w,d,I,l,Q,C,h)),m=g}else{const d=e;E=tt(d.length>1?d(l,{attrs:g,slots:r,emit:s}):d(l,null)),m=e.props?g:dQ(g)}}catch(d){Zi.length=0,mo(d,A,1),E=TA(Kt)}let c=E;if(m&&f!==!1){const d=Object.keys(m),{shapeFlag:w}=c;d.length&&w&7&&(o&&d.some(Vr)&&(m=pQ(m,o)),c=Di(c,m,!1,!0))}return t.dirs&&(c=Di(c,null,!1,!0),c.dirs=c.dirs?c.dirs.concat(t.dirs):t.dirs),t.transition&&ng(c,t.transition),E=c,Zn(u),E}const dQ=A=>{let e;for(const t in A)(t==="class"||t==="style"||lo(t))&&((e||(e={}))[t]=A[t]);return e},pQ=(A,e)=>{const t={};for(const i in A)(!Vr(i)||!(i.slice(9)in e))&&(t[i]=A[i]);return t};function mQ(A,e,t){const{props:i,children:n,component:o}=A,{props:r,children:g,patchFlag:s}=e,a=o.emitsOptions;if(e.dirs||e.transition)return!0;if(t&&s>=0){if(s&1024)return!0;if(s&16)return i?Pg(i,r,a):!!r;if(s&8){const I=e.dynamicProps;for(let l=0;lObject.create(PI),WI=A=>Object.getPrototypeOf(A)===PI;function wQ(A,e,t,i=!1){const n={},o=VI();A.propsDefaults=Object.create(null),qI(A,e,n,o);for(const r in A.propsOptions[0])r in n||(n[r]=void 0);t?A.props=i?n:DI(n):A.type.props?A.props=n:A.props=o,A.attrs=o}function DQ(A,e,t,i){const{props:n,attrs:o,vnode:{patchFlag:r}}=A,g=xA(n),[s]=A.propsOptions;let a=!1;if((i||r>0)&&!(r&16)){if(r&8){const I=A.vnode.dynamicProps;for(let l=0;l{s=!0;const[C,Q]=jI(l,e,!0);ue(r,C),Q&&g.push(...Q)};!t&&e.mixins.length&&e.mixins.forEach(I),A.extends&&I(A.extends),A.mixins&&A.mixins.forEach(I)}if(!o&&!s)return KA(A)&&i.set(A,ui),ui;if(yA(o))for(let I=0;IA==="_"||A==="_ctx"||A==="$stable",rg=A=>yA(A)?A.map(tt):[tt(A)],vQ=(A,e,t)=>{if(e._n)return e;const i=OB((...n)=>rg(e(...n)),t);return i._c=!1,i},ZI=(A,e,t)=>{const i=A._ctx;for(const n in A){if(og(n))continue;const o=A[n];if(FA(o))e[n]=vQ(n,o,i);else if(o!=null){const r=rg(o);e[n]=()=>r}}},XI=(A,e)=>{const t=rg(e);A.slots.default=()=>t},zI=(A,e,t)=>{for(const i in e)(t||!og(i))&&(A[i]=e[i])},FQ=(A,e,t)=>{const i=A.slots=VI();if(A.vnode.shapeFlag&32){const n=e._;n?(zI(i,e,t),t&&rI(i,"_",n,!0)):ZI(e,i)}else e&&XI(A,e)},SQ=(A,e,t)=>{const{vnode:i,slots:n}=A;let o=!0,r=_A;if(i.shapeFlag&32){const g=e._;g?t&&g===1?o=!1:zI(n,e,t):(o=!e.$stable,ZI(e,n)),r=e}else e&&(XI(A,e),r={default:1});if(o)for(const g in n)!og(g)&&r[g]==null&&delete n[g]},Se=LQ;function RQ(A){return bQ(A)}function bQ(A,e){const t=uo();t.__VUE__=!0;const{insert:i,remove:n,patchProp:o,createElement:r,createText:g,createComment:s,setText:a,setElementText:I,parentNode:l,nextSibling:C,setScopeId:Q=ot,insertStaticContent:h}=A,f=(D,S,k,x=null,q=null,V=null,iA=void 0,eA=null,p=!!S.dynamicChildren)=>{if(D===S)return;D&&!xi(D,S)&&(x=H(D),z(D,q,V,!0),D=null),S.patchFlag===-2&&(p=!1,S.dynamicChildren=null);const{type:y,ref:M,shapeFlag:O}=S;switch(y){case dn:u(D,S,k,x);break;case Kt:E(D,S,k,x);break;case Yn:D==null&&m(S,k,x,iA);break;case qA:L(D,S,k,x,q,V,iA,eA,p);break;default:O&1?w(D,S,k,x,q,V,iA,eA,p):O&6?EA(D,S,k,x,q,V,iA,eA,p):(O&64||O&128)&&y.process(D,S,k,x,q,V,iA,eA,p,QA)}M!=null&&q?Wi(M,D&&D.ref,V,S||D,!S):M==null&&D&&D.ref!=null&&Wi(D.ref,null,V,D,!0)},u=(D,S,k,x)=>{if(D==null)i(S.el=g(S.children),k,x);else{const q=S.el=D.el;S.children!==D.children&&a(q,S.children)}},E=(D,S,k,x)=>{D==null?i(S.el=s(S.children||""),k,x):S.el=D.el},m=(D,S,k,x)=>{[D.el,D.anchor]=h(D.children,S,k,x,D.el,D.anchor)},c=({el:D,anchor:S},k,x)=>{let q;for(;D&&D!==S;)q=C(D),i(D,k,x),D=q;i(S,k,x)},d=({el:D,anchor:S})=>{let k;for(;D&&D!==S;)k=C(D),n(D),D=k;n(S)},w=(D,S,k,x,q,V,iA,eA,p)=>{if(S.type==="svg"?iA="svg":S.type==="math"&&(iA="mathml"),D==null)F(S,k,x,q,V,iA,eA,p);else{const y=D.el&&D.el._isVueCE?D.el:null;try{y&&y._beginPatch(),K(D,S,q,V,iA,eA,p)}finally{y&&y._endPatch()}}},F=(D,S,k,x,q,V,iA,eA)=>{let p,y;const{props:M,shapeFlag:O,transition:oA,dirs:Z}=D;if(p=D.el=r(D.type,V,M&&M.is,M),O&8?I(p,D.children):O&16&&G(D.children,p,null,x,q,Ko(D,V),iA,eA),Z&&Zt(D,null,x,"created"),N(p,D,D.scopeId,iA,x),M){for(const P in M)P!=="value"&&!Oi(P)&&o(p,P,null,M[P],V,x);"value"in M&&o(p,"value",null,M.value,V),(y=M.onVnodeBeforeMount)&&ze(y,x,D)}Z&&Zt(D,null,x,"beforeMount");const U=NQ(q,oA);U&&oA.beforeEnter(p),i(p,S,k),((y=M&&M.onVnodeMounted)||U||Z)&&Se(()=>{y&&ze(y,x,D),U&&oA.enter(p),Z&&Zt(D,null,x,"mounted")},q)},N=(D,S,k,x,q)=>{if(k&&Q(D,k),x)for(let V=0;V{for(let y=p;y{const eA=S.el=D.el;let{patchFlag:p,dynamicChildren:y,dirs:M}=S;p|=D.patchFlag&16;const O=D.props||_A,oA=S.props||_A;let Z;if(k&&Xt(k,!1),(Z=oA.onVnodeBeforeUpdate)&&ze(Z,k,S,D),M&&Zt(S,D,k,"beforeUpdate"),k&&Xt(k,!0),(O.innerHTML&&oA.innerHTML==null||O.textContent&&oA.textContent==null)&&I(eA,""),y?R(D.dynamicChildren,y,eA,k,x,Ko(S,q),V):iA||tA(D,S,eA,null,k,x,Ko(S,q),V,!1),p>0){if(p&16)b(eA,O,oA,k,q);else if(p&2&&O.class!==oA.class&&o(eA,"class",null,oA.class,q),p&4&&o(eA,"style",O.style,oA.style,q),p&8){const U=S.dynamicProps;for(let P=0;P{Z&&ze(Z,k,S,D),M&&Zt(S,D,k,"updated")},x)},R=(D,S,k,x,q,V,iA)=>{for(let eA=0;eA{if(S!==k){if(S!==_A)for(const V in S)!Oi(V)&&!(V in k)&&o(D,V,S[V],null,q,x);for(const V in k){if(Oi(V))continue;const iA=k[V],eA=S[V];iA!==eA&&V!=="value"&&o(D,V,eA,iA,q,x)}"value"in k&&o(D,"value",S.value,k.value,q)}},L=(D,S,k,x,q,V,iA,eA,p)=>{const y=S.el=D?D.el:g(""),M=S.anchor=D?D.anchor:g("");let{patchFlag:O,dynamicChildren:oA,slotScopeIds:Z}=S;Z&&(eA=eA?eA.concat(Z):Z),D==null?(i(y,k,x),i(M,k,x),G(S.children||[],k,M,q,V,iA,eA,p)):O>0&&O&64&&oA&&D.dynamicChildren&&D.dynamicChildren.length===oA.length?(R(D.dynamicChildren,oA,k,q,V,iA,eA),(S.key!=null||q&&S===q.subTree)&&$I(D,S,!0)):tA(D,S,k,M,q,V,iA,eA,p)},EA=(D,S,k,x,q,V,iA,eA,p)=>{S.slotScopeIds=eA,D==null?S.shapeFlag&512?q.ctx.activate(S,k,x,iA,p):dA(S,k,x,q,V,iA,p):IA(D,S,p)},dA=(D,S,k,x,q,V,iA)=>{const eA=D.component=YQ(D,x,q);if(MI(D)&&(eA.ctx.renderer=QA),_Q(eA,!1,iA),eA.asyncDep){if(q&&q.registerDep(eA,nA,iA),!D.el){const p=eA.subTree=TA(Kt);E(null,p,S,k),D.placeholder=p.el}}else nA(eA,D,S,k,q,V,iA)},IA=(D,S,k)=>{const x=S.component=D.component;if(mQ(D,S,k))if(x.asyncDep&&!x.asyncResolved){X(x,S,k);return}else x.next=S,x.update();else S.el=D.el,x.vnode=S},nA=(D,S,k,x,q,V,iA)=>{const eA=()=>{if(D.isMounted){let{next:O,bu:oA,u:Z,parent:U,vnode:P}=D;{const Ce=AC(D);if(Ce){O&&(O.el=P.el,X(D,O,iA)),Ce.asyncDep.then(()=>{D.isUnmounted||eA()});return}}let uA=O,bA;Xt(D,!1),O?(O.el=P.el,X(D,O,iA)):O=P,oA&&Tn(oA),(bA=O.props&&O.props.onVnodeBeforeUpdate)&&ze(bA,U,O,P),Xt(D,!0);const jA=Og(D),he=D.subTree;D.subTree=jA,f(he,jA,l(he.el),H(he),D,q,V),O.el=jA.el,uA===null&&yQ(D,jA.el),Z&&Se(Z,q),(bA=O.props&&O.props.onVnodeUpdated)&&Se(()=>ze(bA,U,O,P),q)}else{let O;const{el:oA,props:Z}=S,{bm:U,m:P,parent:uA,root:bA,type:jA}=D,he=qi(S);Xt(D,!1),U&&Tn(U),!he&&(O=Z&&Z.onVnodeBeforeMount)&&ze(O,uA,S),Xt(D,!0);{bA.ce&&bA.ce._def.shadowRoot!==!1&&bA.ce._injectChildStyle(jA);const Ce=D.subTree=Og(D);f(null,Ce,k,x,D,q,V),S.el=Ce.el}if(P&&Se(P,q),!he&&(O=Z&&Z.onVnodeMounted)){const Ce=S;Se(()=>ze(O,uA,Ce),q)}(S.shapeFlag&256||uA&&qi(uA.vnode)&&uA.vnode.shapeFlag&256)&&D.a&&Se(D.a,q),D.isMounted=!0,S=k=x=null}};D.scope.on();const p=D.effect=new CI(eA);D.scope.off();const y=D.update=p.run.bind(p),M=D.job=p.runIfDirty.bind(p);M.i=D,M.id=D.uid,p.scheduler=()=>ig(M),Xt(D,!0),y()},X=(D,S,k)=>{S.component=D;const x=D.vnode.props;D.vnode=S,D.next=null,DQ(D,S.props,x,k),SQ(D,S.children,k),wt(),xg(D),Dt()},tA=(D,S,k,x,q,V,iA,eA,p=!1)=>{const y=D&&D.children,M=D?D.shapeFlag:0,O=S.children,{patchFlag:oA,shapeFlag:Z}=S;if(oA>0){if(oA&128){Y(y,O,k,x,q,V,iA,eA,p);return}else if(oA&256){fA(y,O,k,x,q,V,iA,eA,p);return}}Z&8?(M&16&&LA(y,q,V),O!==y&&I(k,O)):M&16?Z&16?Y(y,O,k,x,q,V,iA,eA,p):LA(y,q,V,!0):(M&8&&I(k,""),Z&16&&G(O,k,x,q,V,iA,eA,p))},fA=(D,S,k,x,q,V,iA,eA,p)=>{D=D||ui,S=S||ui;const y=D.length,M=S.length,O=Math.min(y,M);let oA;for(oA=0;oAM?LA(D,q,V,!0,!1,O):G(S,k,x,q,V,iA,eA,p,O)},Y=(D,S,k,x,q,V,iA,eA,p)=>{let y=0;const M=S.length;let O=D.length-1,oA=M-1;for(;y<=O&&y<=oA;){const Z=D[y],U=S[y]=p?xt(S[y]):tt(S[y]);if(xi(Z,U))f(Z,U,k,null,q,V,iA,eA,p);else break;y++}for(;y<=O&&y<=oA;){const Z=D[O],U=S[oA]=p?xt(S[oA]):tt(S[oA]);if(xi(Z,U))f(Z,U,k,null,q,V,iA,eA,p);else break;O--,oA--}if(y>O){if(y<=oA){const Z=oA+1,U=ZoA)for(;y<=O;)z(D[y],q,V,!0),y++;else{const Z=y,U=y,P=new Map;for(y=U;y<=oA;y++){const Fe=S[y]=p?xt(S[y]):tt(S[y]);Fe.key!=null&&P.set(Fe.key,y)}let uA,bA=0;const jA=oA-U+1;let he=!1,Ce=0;const jt=new Array(jA);for(y=0;y=jA){z(Fe,q,V,!0);continue}let Xe;if(Fe.key!=null)Xe=P.get(Fe.key);else for(uA=U;uA<=oA;uA++)if(jt[uA-U]===0&&xi(Fe,S[uA])){Xe=uA;break}Xe===void 0?z(Fe,q,V,!0):(jt[Xe-U]=y+1,Xe>=Ce?Ce=Xe:he=!0,f(Fe,S[Xe],k,null,q,V,iA,eA,p),bA++)}const Mo=he?GQ(jt):ui;for(uA=Mo.length-1,y=jA-1;y>=0;y--){const Fe=U+y,Xe=S[Fe],bg=S[Fe+1],Ng=Fe+1{const{el:V,type:iA,transition:eA,children:p,shapeFlag:y}=D;if(y&6){W(D.component.subTree,S,k,x);return}if(y&128){D.suspense.move(S,k,x);return}if(y&64){iA.move(D,S,k,QA);return}if(iA===qA){i(V,S,k);for(let O=0;OeA.enter(V),q);else{const{leave:O,delayLeave:oA,afterLeave:Z}=eA,U=()=>{D.ctx.isUnmounted?n(V):i(V,S,k)},P=()=>{V._isLeaving&&V[ZB](!0),O(V,()=>{U(),Z&&Z()})};oA?oA(V,U,P):P()}else i(V,S,k)},z=(D,S,k,x=!1,q=!1)=>{const{type:V,props:iA,ref:eA,children:p,dynamicChildren:y,shapeFlag:M,patchFlag:O,dirs:oA,cacheIndex:Z}=D;if(O===-2&&(q=!1),eA!=null&&(wt(),Wi(eA,null,k,D,!0),Dt()),Z!=null&&(S.renderCache[Z]=void 0),M&256){S.ctx.deactivate(D);return}const U=M&1&&oA,P=!qi(D);let uA;if(P&&(uA=iA&&iA.onVnodeBeforeUnmount)&&ze(uA,S,D),M&6)ne(D.component,k,x);else{if(M&128){D.suspense.unmount(k,x);return}U&&Zt(D,null,S,"beforeUnmount"),M&64?D.type.remove(D,S,k,QA,x):y&&!y.hasOnce&&(V!==qA||O>0&&O&64)?LA(y,S,k,!1,!0):(V===qA&&O&384||!q&&M&16)&&LA(p,S,k),x&&DA(D)}(P&&(uA=iA&&iA.onVnodeUnmounted)||U)&&Se(()=>{uA&&ze(uA,S,D),U&&Zt(D,null,S,"unmounted")},k)},DA=D=>{const{type:S,el:k,anchor:x,transition:q}=D;if(S===qA){NA(k,x);return}if(S===Yn){d(D);return}const V=()=>{n(k),q&&!q.persisted&&q.afterLeave&&q.afterLeave()};if(D.shapeFlag&1&&q&&!q.persisted){const{leave:iA,delayLeave:eA}=q,p=()=>iA(k,V);eA?eA(D.el,V,p):p()}else V()},NA=(D,S)=>{let k;for(;D!==S;)k=C(D),n(D),D=k;n(S)},ne=(D,S,k)=>{const{bum:x,scope:q,job:V,subTree:iA,um:eA,m:p,a:y}=D;Wg(p),Wg(y),x&&Tn(x),q.stop(),V&&(V.flags|=8,z(iA,D,S,k)),eA&&Se(eA,S),Se(()=>{D.isUnmounted=!0},S)},LA=(D,S,k,x=!1,q=!1,V=0)=>{for(let iA=V;iA{if(D.shapeFlag&6)return H(D.component.subTree);if(D.shapeFlag&128)return D.suspense.next();const S=C(D.anchor||D.el),k=S&&S[qB];return k?C(k):S};let $=!1;const AA=(D,S,k)=>{let x;D==null?S._vnode&&(z(S._vnode,null,null,!0),x=S._vnode.component):f(S._vnode||null,D,S,null,null,null,k),S._vnode=D,$||($=!0,xg(x),RI(),$=!1)},QA={p:f,um:z,m:W,r:DA,mt:dA,mc:G,pc:tA,pbc:R,n:H,o:A};return{render:AA,hydrate:void 0,createApp:EQ(AA)}}function Ko({type:A,props:e},t){return t==="svg"&&A==="foreignObject"||t==="mathml"&&A==="annotation-xml"&&e&&e.encoding&&e.encoding.includes("html")?void 0:t}function Xt({effect:A,job:e},t){t?(A.flags|=32,e.flags|=4):(A.flags&=-33,e.flags&=-5)}function NQ(A,e){return(!A||A&&!A.pendingBranch)&&e&&!e.persisted}function $I(A,e,t=!1){const i=A.children,n=e.children;if(yA(i)&&yA(n))for(let o=0;o>1,A[t[g]]0&&(e[i]=t[o-1]),t[o]=i)}}for(o=t.length,r=t[o-1];o-- >0;)t[o]=r,r=e[r];return t}function AC(A){const e=A.subTree.component;if(e)return e.asyncDep&&!e.asyncResolved?e:AC(e)}function Wg(A){if(A)for(let e=0;eA.__isSuspense;function LQ(A,e){e&&e.pendingBranch?yA(A)?e.effects.push(...A):e.effects.push(A):KB(A)}const qA=Symbol.for("v-fgt"),dn=Symbol.for("v-txt"),Kt=Symbol.for("v-cmt"),Yn=Symbol.for("v-stc"),Zi=[];let be=null;function T(A=!1){Zi.push(be=A?null:[])}function UQ(){Zi.pop(),be=Zi[Zi.length-1]||null}let tn=1;function $n(A,e=!1){tn+=A,A<0&&be&&e&&(be.hasOnce=!0)}function iC(A){return A.dynamicChildren=tn>0?be||ui:null,UQ(),tn>0&&be&&be.push(A),A}function _(A,e,t,i,n,o){return iC(B(A,e,t,i,n,o,!0))}function ye(A,e,t,i,n){return iC(TA(A,e,t,i,n,!0))}function Ao(A){return A?A.__v_isVNode===!0:!1}function xi(A,e){return A.type===e.type&&A.key===e.key}const nC=({key:A})=>A??null,_n=({ref:A,ref_key:e,ref_for:t})=>(typeof A=="number"&&(A=""+A),A!=null?ee(A)||le(A)||FA(A)?{i:Re,r:A,k:e,f:!!t}:A:null);function B(A,e=null,t=null,i=0,n=null,o=A===qA?0:1,r=!1,g=!1){const s={__v_isVNode:!0,__v_skip:!0,type:A,props:e,key:e&&nC(e),ref:e&&_n(e),scopeId:NI,slotScopeIds:null,children:t,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:o,patchFlag:i,dynamicProps:n,dynamicChildren:null,appContext:null,ctx:Re};return g?(gg(s,t),o&128&&A.normalize(s)):t&&(s.shapeFlag|=ee(t)?8:16),tn>0&&!r&&be&&(s.patchFlag>0||o&6)&&s.patchFlag!==32&&be.push(s),s}const TA=MQ;function MQ(A,e=null,t=null,i=0,n=null,o=!1){if((!A||A===TI)&&(A=Kt),Ao(A)){const g=Di(A,e,!0);return t&&gg(g,t),tn>0&&!o&&be&&(g.shapeFlag&6?be[be.indexOf(A)]=g:be.push(g)),g.patchFlag=-2,g}if(WQ(A)&&(A=A.__vccOpts),e){e=xQ(e);let{class:g,style:s}=e;g&&!ee(g)&&(e.class=kA(g)),KA(s)&&(eg(s)&&!yA(s)&&(s=ue({},s)),e.style=VA(s))}const r=ee(A)?1:tC(A)?128:jB(A)?64:KA(A)?4:FA(A)?2:0;return B(A,e,t,i,n,r,o,!0)}function xQ(A){return A?eg(A)||WI(A)?ue({},A):A:null}function Di(A,e,t=!1,i=!1){const{props:n,ref:o,patchFlag:r,children:g,transition:s}=A,a=e?JQ(n||{},e):n,I={__v_isVNode:!0,__v_skip:!0,type:A.type,props:a,key:a&&nC(a),ref:e&&e.ref?t&&o?yA(o)?o.concat(_n(e)):[o,_n(e)]:_n(e):o,scopeId:A.scopeId,slotScopeIds:A.slotScopeIds,children:g,target:A.target,targetStart:A.targetStart,targetAnchor:A.targetAnchor,staticCount:A.staticCount,shapeFlag:A.shapeFlag,patchFlag:e&&A.type!==qA?r===-1?16:r|16:r,dynamicProps:A.dynamicProps,dynamicChildren:A.dynamicChildren,appContext:A.appContext,dirs:A.dirs,transition:s,component:A.component,suspense:A.suspense,ssContent:A.ssContent&&Di(A.ssContent),ssFallback:A.ssFallback&&Di(A.ssFallback),placeholder:A.placeholder,el:A.el,anchor:A.anchor,ctx:A.ctx,ce:A.ce};return s&&i&&ng(I,s.clone(I)),I}function gt(A=" ",e=0){return TA(dn,null,A,e)}function Do(A,e){const t=TA(Yn,null,A);return t.staticCount=e,t}function sA(A="",e=!1){return e?(T(),ye(Kt,null,A)):TA(Kt,null,A)}function tt(A){return A==null||typeof A=="boolean"?TA(Kt):yA(A)?TA(qA,null,A.slice()):Ao(A)?xt(A):TA(dn,null,String(A))}function xt(A){return A.el===null&&A.patchFlag!==-1||A.memo?A:Di(A)}function gg(A,e){let t=0;const{shapeFlag:i}=A;if(e==null)e=null;else if(yA(e))t=16;else if(typeof e=="object")if(i&65){const n=e.default;n&&(n._c&&(n._d=!1),gg(A,n()),n._c&&(n._d=!0));return}else{t=32;const n=e._;!n&&!WI(e)?e._ctx=Re:n===3&&Re&&(Re.slots._===1?e._=1:(e._=2,A.patchFlag|=1024))}else FA(e)?(e={default:e,_ctx:Re},t=32):(e=String(e),i&64?(t=16,e=[gt(e)]):t=8);A.children=e,A.shapeFlag|=t}function JQ(...A){const e={};for(let t=0;tEe||Re;let eo,hr;{const A=uo(),e=(t,i)=>{let n;return(n=A[t])||(n=A[t]=[]),n.push(i),o=>{n.length>1?n.forEach(r=>r(o)):n[0](o)}};eo=e("__VUE_INSTANCE_SETTERS__",t=>Ee=t),hr=e("__VUE_SSR_SETTERS__",t=>nn=t)}const pn=A=>{const e=Ee;return eo(A),A.scope.on(),()=>{A.scope.off(),eo(e)}},qg=()=>{Ee&&Ee.scope.off(),eo(null)};function oC(A){return A.vnode.shapeFlag&4}let nn=!1;function _Q(A,e=!1,t=!1){e&&hr(e);const{props:i,children:n}=A.vnode,o=oC(A);wQ(A,i,o,e),FQ(A,n,t||e);const r=o?KQ(A,e):void 0;return e&&hr(!1),r}function KQ(A,e){const t=A.type;A.accessCache=Object.create(null),A.proxy=new Proxy(A.ctx,aQ);const{setup:i}=t;if(i){wt();const n=A.setupContext=i.length>1?PQ(A):null,o=pn(A),r=un(i,A,0,[A.props,n]),g=iI(r);if(Dt(),o(),(g||A.sp)&&!qi(A)&&UI(A),g){if(r.then(qg,qg),e)return r.then(s=>{jg(A,s)}).catch(s=>{mo(s,A,0)});A.asyncDep=r}else jg(A,r)}else rC(A)}function jg(A,e,t){FA(e)?A.type.__ssrInlineRender?A.ssrRender=e:A.render=e:KA(e)&&(A.setupState=vI(e)),rC(A)}function rC(A,e,t){const i=A.type;A.render||(A.render=i.render||ot);{const n=pn(A);wt();try{IQ(A)}finally{Dt(),n()}}}const OQ={get(A,e){return ce(A,"get",""),A[e]}};function PQ(A){const e=t=>{A.exposed=t||{}};return{attrs:new Proxy(A.attrs,OQ),slots:A.slots,emit:A.emit,expose:e}}function ko(A){return A.exposed?A.exposeProxy||(A.exposeProxy=new Proxy(vI(_i(A.exposed)),{get(e,t){if(t in e)return e[t];if(t in ji)return ji[t](A)},has(e,t){return t in e||t in ji}})):A.proxy}function VQ(A,e=!0){return FA(A)?A.displayName||A.name:A.name||e&&A.__name}function WQ(A){return FA(A)&&"__vccOpts"in A}const hA=(A,e)=>JB(A,e,nn);function GA(A,e,t){try{$n(-1);const i=arguments.length;return i===2?KA(e)&&!yA(e)?Ao(e)?TA(A,null,[e]):TA(A,e):TA(A,null,e):(i>3?t=Array.prototype.slice.call(arguments,2):i===3&&Ao(t)&&(t=[t]),TA(A,e,t))}finally{$n(1)}}const qQ="3.5.26";/** +**/function un(A,e,t,i){try{return i?A(...i):A()}catch(n){mo(n,e,t)}}function Ct(A,e,t,i){if(FA(A)){const n=un(A,e,t,i);return n&&iI(n)&&n.catch(o=>{mo(o,e,t)}),n}if(yA(A)){const n=[];for(let o=0;o>>1,n=me[i],o=en(n);o=en(t)?me.push(A):me.splice(_B(e),0,A),A.flags|=1,SI()}}function SI(){jn||(jn=FI.then(bI))}function KB(A){yA(A)?fi.push(...A):Mt&&A.id===-1?Mt.splice(Bi+1,0,A):A.flags&1||(fi.push(A),A.flags|=1),SI()}function xg(A,e,t=At+1){for(;ten(t)-en(i));if(fi.length=0,Mt){Mt.push(...e);return}for(Mt=e,Bi=0;BiA.id==null?A.flags&2?-1:1/0:A.id;function bI(A){try{for(At=0;At{i._d&&$n(-1);const o=Zn(e);let r;try{r=A(...n)}finally{Zn(o),i._d&&$n(1)}return r};return i._n=!0,i._c=!0,i._d=!0,i}function ZA(A,e){if(Re===null)return A;const t=ko(Re),i=A.dirs||(A.dirs=[]);for(let n=0;n1)return t&&FA(e)?e.call(i&&i.proxy):e}}const PB=Symbol.for("v-scx"),VB=()=>rt(PB);function ae(A,e,t){return GI(A,e,t)}function GI(A,e,t=_A){const{immediate:i,deep:n,flush:o,once:r}=t,g=ue({},t),s=e&&i||!e&&o!=="post";let a;if(nn){if(o==="sync"){const Q=VB();a=Q.__watcherHandles||(Q.__watcherHandles=[])}else if(!s){const Q=()=>{};return Q.stop=ot,Q.resume=ot,Q.pause=ot,Q}}const I=Ee;g.call=(Q,h,f)=>Ct(Q,I,h,f);let l=!1;o==="post"?g.scheduler=Q=>{Se(Q,I&&I.suspense)}:o!=="sync"&&(l=!0,g.scheduler=(Q,h)=>{h?Q():ig(Q)}),g.augmentJob=Q=>{e&&(Q.flags|=4),l&&(Q.flags|=2,I&&(Q.id=I.uid,Q.i=I))};const C=HB(A,e,g);return nn&&(a?a.push(C):s&&C()),C}function WB(A,e,t){const i=this.proxy,n=ee(A)?A.includes(".")?LI(i,A):()=>i[A]:A.bind(i,i);let o;FA(e)?o=e:(o=e.handler,t=e);const r=pn(this),g=GI(n,o.bind(i),t);return r(),g}function LI(A,e){const t=e.split(".");return()=>{let i=A;for(let n=0;nA.__isTeleport,ZB=Symbol("_leaveCb");function ng(A,e){A.shapeFlag&6&&A.component?(A.transition=e,ng(A.component.subTree,e)):A.shapeFlag&128?(A.ssContent.transition=e.clone(A.ssContent),A.ssFallback.transition=e.clone(A.ssFallback)):A.transition=e}function fn(A,e){return FA(A)?ue({name:A.name},e,{setup:A}):A}function UI(A){A.ids=[A.ids[0]+A.ids[2]+++"-",0,0]}const Xn=new WeakMap;function Wi(A,e,t,i,n=!1){if(yA(A)){A.forEach((h,f)=>Wi(h,e&&(yA(e)?e[f]:e),t,i,n));return}if(qi(i)&&!n){i.shapeFlag&512&&i.type.__asyncResolved&&i.component.subTree.component&&Wi(A,e,t,i.component.subTree);return}const o=i.shapeFlag&4?ko(i.component):i.el,r=n?null:o,{i:g,r:s}=A,a=e&&e.r,I=g.refs===_A?g.refs={}:g.refs,l=g.setupState,C=xA(l),Q=l===_A?tI:h=>JA(C,h);if(a!=null&&a!==s){if(Jg(e),ee(a))I[a]=null,Q(a)&&(l[a]=null);else if(le(a)){a.value=null;const h=e;h.k&&(I[h.k]=null)}}if(FA(s))un(s,g,12,[r,I]);else{const h=ee(s),f=le(s);if(h||f){const u=()=>{if(A.f){const E=h?Q(s)?l[s]:I[s]:s.value;if(n)yA(E)&&Wr(E,o);else if(yA(E))E.includes(o)||E.push(o);else if(h)I[s]=[o],Q(s)&&(l[s]=I[s]);else{const D=[o];s.value=D,A.k&&(I[A.k]=D)}}else h?(I[s]=r,Q(s)&&(l[s]=r)):f&&(s.value=r,A.k&&(I[A.k]=r))};if(r){const E=()=>{u(),Xn.delete(A)};E.id=-1,Xn.set(A,E),Se(E,t)}else Jg(A),u()}}}function Jg(A){const e=Xn.get(A);e&&(e.flags|=8,Xn.delete(A))}uo().requestIdleCallback;uo().cancelIdleCallback;const qi=A=>!!A.type.__asyncLoader,MI=A=>A.type.__isKeepAlive;function XB(A,e){xI(A,"a",e)}function zB(A,e){xI(A,"da",e)}function xI(A,e,t=Ee){const i=A.__wdc||(A.__wdc=()=>{let n=t;for(;n;){if(n.isDeactivated)return;n=n.parent}return A()});if(yo(e,i,t),t){let n=t.parent;for(;n&&n.parent;)MI(n.parent.vnode)&&$B(i,e,t,n),n=n.parent}}function $B(A,e,t,i){const n=yo(e,A,i,!0);Ii(()=>{Wr(i[e],n)},t)}function yo(A,e,t=Ee,i=!1){if(t){const n=t[A]||(t[A]=[]),o=e.__weh||(e.__weh=(...r)=>{wt();const g=pn(t),s=Ct(e,t,A,r);return g(),Dt(),s});return i?n.unshift(o):n.push(o),o}}const vt=A=>(e,t=Ee)=>{(!nn||A==="sp")&&yo(A,(...i)=>e(...i),t)},JI=vt("bm"),Ft=vt("m"),AQ=vt("bu"),eQ=vt("u"),tQ=vt("bum"),Ii=vt("um"),iQ=vt("sp"),nQ=vt("rtg"),oQ=vt("rtc");function rQ(A,e=Ee){yo("ec",A,e)}const gQ="components",TI=Symbol.for("v-ndc");function HI(A){return ee(A)?sQ(gQ,A,!1)||A:A||TI}function sQ(A,e,t=!0,i=!1){const n=Re||Ee;if(n){const o=n.type;{const g=VQ(o,!1);if(g&&(g===e||g===Je(e)||g===co(Je(e))))return o}const r=Tg(n[A]||o[A],e)||Tg(n.appContext[A],e);return!r&&i?o:r}}function Tg(A,e){return A&&(A[e]||A[Je(e)]||A[co(Je(e))])}function Ke(A,e,t,i){let n;const o=t,r=yA(A);if(r||ee(A)){const g=r&&gi(A);let s=!1,a=!1;g&&(s=!xe(A),a=kt(A),A=fo(A)),n=new Array(A.length);for(let I=0,l=A.length;Ie(g,s,void 0,o));else{const g=Object.keys(A);n=new Array(g.length);for(let s=0,a=g.length;sA?oC(A)?ko(A):Qr(A.parent):null,ji=ue(Object.create(null),{$:A=>A,$el:A=>A.vnode.el,$data:A=>A.data,$props:A=>A.props,$attrs:A=>A.attrs,$slots:A=>A.slots,$refs:A=>A.refs,$parent:A=>Qr(A.parent),$root:A=>Qr(A.root),$host:A=>A.ce,$emit:A=>A.emit,$options:A=>_I(A),$forceUpdate:A=>A.f||(A.f=()=>{ig(A.update)}),$nextTick:A=>A.n||(A.n=hn.bind(A.proxy)),$watch:A=>WB.bind(A)}),_o=(A,e)=>A!==_A&&!A.__isScriptSetup&&JA(A,e),aQ={get({_:A},e){if(e==="__v_skip")return!0;const{ctx:t,setupState:i,data:n,props:o,accessCache:r,type:g,appContext:s}=A;if(e[0]!=="$"){const C=r[e];if(C!==void 0)switch(C){case 1:return i[e];case 2:return n[e];case 4:return t[e];case 3:return o[e]}else{if(_o(i,e))return r[e]=1,i[e];if(n!==_A&&JA(n,e))return r[e]=2,n[e];if(JA(o,e))return r[e]=3,o[e];if(t!==_A&&JA(t,e))return r[e]=4,t[e];cr&&(r[e]=0)}}const a=ji[e];let I,l;if(a)return e==="$attrs"&&ce(A.attrs,"get",""),a(A);if((I=g.__cssModules)&&(I=I[e]))return I;if(t!==_A&&JA(t,e))return r[e]=4,t[e];if(l=s.config.globalProperties,JA(l,e))return l[e]},set({_:A},e,t){const{data:i,setupState:n,ctx:o}=A;return _o(n,e)?(n[e]=t,!0):i!==_A&&JA(i,e)?(i[e]=t,!0):JA(A.props,e)||e[0]==="$"&&e.slice(1)in A?!1:(o[e]=t,!0)},has({_:{data:A,setupState:e,accessCache:t,ctx:i,appContext:n,props:o,type:r}},g){let s;return!!(t[g]||A!==_A&&g[0]!=="$"&&JA(A,g)||_o(e,g)||JA(o,g)||JA(i,g)||JA(ji,g)||JA(n.config.globalProperties,g)||(s=r.__cssModules)&&s[g])},defineProperty(A,e,t){return t.get!=null?A._.accessCache[e]=0:JA(t,"value")&&this.set(A,e,t.value,null),Reflect.defineProperty(A,e,t)}};function Hg(A){return yA(A)?A.reduce((e,t)=>(e[t]=null,e),{}):A}let cr=!0;function IQ(A){const e=_I(A),t=A.proxy,i=A.ctx;cr=!1,e.beforeCreate&&Yg(e.beforeCreate,A,"bc");const{data:n,computed:o,methods:r,watch:g,provide:s,inject:a,created:I,beforeMount:l,mounted:C,beforeUpdate:Q,updated:h,activated:f,deactivated:u,beforeDestroy:E,beforeUnmount:D,destroyed:c,unmounted:d,render:p,renderTracked:v,renderTriggered:N,errorCaptured:G,serverPrefetch:_,expose:S,inheritAttrs:b,components:L,directives:QA,filters:dA}=e;if(a&&CQ(a,i,null),r)for(const X in r){const tA=r[X];FA(tA)&&(i[X]=tA.bind(t))}if(n){const X=n.call(t,t);KA(X)&&(A.data=po(X))}if(cr=!0,o)for(const X in o){const tA=o[X],fA=FA(tA)?tA.bind(t,t):FA(tA.get)?tA.get.bind(t,t):ot,Y=!FA(tA)&&FA(tA.set)?tA.set.bind(t):ot,W=hA({get:fA,set:Y});Object.defineProperty(i,X,{enumerable:!0,configurable:!0,get:()=>W.value,set:z=>W.value=z})}if(g)for(const X in g)YI(g[X],i,t,X);if(s){const X=FA(s)?s.call(t):s;Reflect.ownKeys(X).forEach(tA=>{Hn(tA,X[tA])})}I&&Yg(I,A,"c");function nA(X,tA){yA(tA)?tA.forEach(fA=>X(fA.bind(t))):tA&&X(tA.bind(t))}if(nA(JI,l),nA(Ft,C),nA(AQ,Q),nA(eQ,h),nA(XB,f),nA(zB,u),nA(rQ,G),nA(oQ,v),nA(nQ,N),nA(tQ,D),nA(Ii,d),nA(iQ,_),yA(S))if(S.length){const X=A.exposed||(A.exposed={});S.forEach(tA=>{Object.defineProperty(X,tA,{get:()=>t[tA],set:fA=>t[tA]=fA,enumerable:!0})})}else A.exposed||(A.exposed={});p&&A.render===ot&&(A.render=p),b!=null&&(A.inheritAttrs=b),L&&(A.components=L),QA&&(A.directives=QA),_&&UI(A)}function CQ(A,e,t=ot){yA(A)&&(A=Er(A));for(const i in A){const n=A[i];let o;KA(n)?"default"in n?o=rt(n.from||i,n.default,!0):o=rt(n.from||i):o=rt(n),le(o)?Object.defineProperty(e,i,{enumerable:!0,configurable:!0,get:()=>o.value,set:r=>o.value=r}):e[i]=o}}function Yg(A,e,t){Ct(yA(A)?A.map(i=>i.bind(e.proxy)):A.bind(e.proxy),e,t)}function YI(A,e,t,i){let n=i.includes(".")?LI(t,i):()=>t[i];if(ee(A)){const o=e[A];FA(o)&&ae(n,o)}else if(FA(A))ae(n,A.bind(t));else if(KA(A))if(yA(A))A.forEach(o=>YI(o,e,t,i));else{const o=FA(A.handler)?A.handler.bind(t):e[A.handler];FA(o)&&ae(n,o,A)}}function _I(A){const e=A.type,{mixins:t,extends:i}=e,{mixins:n,optionsCache:o,config:{optionMergeStrategies:r}}=A.appContext,g=o.get(e);let s;return g?s=g:!n.length&&!t&&!i?s=e:(s={},n.length&&n.forEach(a=>zn(s,a,r,!0)),zn(s,e,r)),KA(e)&&o.set(e,s),s}function zn(A,e,t,i=!1){const{mixins:n,extends:o}=e;o&&zn(A,o,t,!0),n&&n.forEach(r=>zn(A,r,t,!0));for(const r in e)if(!(i&&r==="expose")){const g=lQ[r]||t&&t[r];A[r]=g?g(A[r],e[r]):e[r]}return A}const lQ={data:_g,props:Kg,emits:Kg,methods:Ki,computed:Ki,beforeCreate:fe,created:fe,beforeMount:fe,mounted:fe,beforeUpdate:fe,updated:fe,beforeDestroy:fe,beforeUnmount:fe,destroyed:fe,unmounted:fe,activated:fe,deactivated:fe,errorCaptured:fe,serverPrefetch:fe,components:Ki,directives:Ki,watch:QQ,provide:_g,inject:BQ};function _g(A,e){return e?A?function(){return ue(FA(A)?A.call(this,this):A,FA(e)?e.call(this,this):e)}:e:A}function BQ(A,e){return Ki(Er(A),Er(e))}function Er(A){if(yA(A)){const e={};for(let t=0;te==="modelValue"||e==="model-value"?A.modelModifiers:A[`${e}Modifiers`]||A[`${Je(e)}Modifiers`]||A[`${ai(e)}Modifiers`];function hQ(A,e,...t){if(A.isUnmounted)return;const i=A.vnode.props||_A;let n=t;const o=e.startsWith("update:"),r=o&&uQ(i,e.slice(7));r&&(r.trim&&(n=t.map(I=>ee(I)?I.trim():I)),r.number&&(n=t.map(Eo)));let g,s=i[g=xo(e)]||i[g=xo(Je(e))];!s&&o&&(s=i[g=xo(ai(e))]),s&&Ct(s,A,6,n);const a=i[g+"Once"];if(a){if(!A.emitted)A.emitted={};else if(A.emitted[g])return;A.emitted[g]=!0,Ct(a,A,6,n)}}const fQ=new WeakMap;function OI(A,e,t=!1){const i=t?fQ:e.emitsCache,n=i.get(A);if(n!==void 0)return n;const o=A.emits;let r={},g=!1;if(!FA(A)){const s=a=>{const I=OI(a,e,!0);I&&(g=!0,ue(r,I))};!t&&e.mixins.length&&e.mixins.forEach(s),A.extends&&s(A.extends),A.mixins&&A.mixins.forEach(s)}return!o&&!g?(KA(A)&&i.set(A,null),null):(yA(o)?o.forEach(s=>r[s]=null):ue(r,o),KA(A)&&i.set(A,r),r)}function wo(A,e){return!A||!lo(e)?!1:(e=e.slice(2).replace(/Once$/,""),JA(A,e[0].toLowerCase()+e.slice(1))||JA(A,ai(e))||JA(A,e))}function Og(A){const{type:e,vnode:t,proxy:i,withProxy:n,propsOptions:[o],slots:r,attrs:g,emit:s,render:a,renderCache:I,props:l,data:C,setupState:Q,ctx:h,inheritAttrs:f}=A,u=Zn(A);let E,D;try{if(t.shapeFlag&4){const d=n||i,p=d;E=tt(a.call(p,d,I,l,Q,C,h)),D=g}else{const d=e;E=tt(d.length>1?d(l,{attrs:g,slots:r,emit:s}):d(l,null)),D=e.props?g:dQ(g)}}catch(d){Zi.length=0,mo(d,A,1),E=TA(Kt)}let c=E;if(D&&f!==!1){const d=Object.keys(D),{shapeFlag:p}=c;d.length&&p&7&&(o&&d.some(Vr)&&(D=pQ(D,o)),c=Di(c,D,!1,!0))}return t.dirs&&(c=Di(c,null,!1,!0),c.dirs=c.dirs?c.dirs.concat(t.dirs):t.dirs),t.transition&&ng(c,t.transition),E=c,Zn(u),E}const dQ=A=>{let e;for(const t in A)(t==="class"||t==="style"||lo(t))&&((e||(e={}))[t]=A[t]);return e},pQ=(A,e)=>{const t={};for(const i in A)(!Vr(i)||!(i.slice(9)in e))&&(t[i]=A[i]);return t};function mQ(A,e,t){const{props:i,children:n,component:o}=A,{props:r,children:g,patchFlag:s}=e,a=o.emitsOptions;if(e.dirs||e.transition)return!0;if(t&&s>=0){if(s&1024)return!0;if(s&16)return i?Pg(i,r,a):!!r;if(s&8){const I=e.dynamicProps;for(let l=0;lObject.create(PI),WI=A=>Object.getPrototypeOf(A)===PI;function wQ(A,e,t,i=!1){const n={},o=VI();A.propsDefaults=Object.create(null),qI(A,e,n,o);for(const r in A.propsOptions[0])r in n||(n[r]=void 0);t?A.props=i?n:DI(n):A.type.props?A.props=n:A.props=o,A.attrs=o}function DQ(A,e,t,i){const{props:n,attrs:o,vnode:{patchFlag:r}}=A,g=xA(n),[s]=A.propsOptions;let a=!1;if((i||r>0)&&!(r&16)){if(r&8){const I=A.vnode.dynamicProps;for(let l=0;l{s=!0;const[C,Q]=jI(l,e,!0);ue(r,C),Q&&g.push(...Q)};!t&&e.mixins.length&&e.mixins.forEach(I),A.extends&&I(A.extends),A.mixins&&A.mixins.forEach(I)}if(!o&&!s)return KA(A)&&i.set(A,ui),ui;if(yA(o))for(let I=0;IA==="_"||A==="_ctx"||A==="$stable",rg=A=>yA(A)?A.map(tt):[tt(A)],vQ=(A,e,t)=>{if(e._n)return e;const i=OB((...n)=>rg(e(...n)),t);return i._c=!1,i},ZI=(A,e,t)=>{const i=A._ctx;for(const n in A){if(og(n))continue;const o=A[n];if(FA(o))e[n]=vQ(n,o,i);else if(o!=null){const r=rg(o);e[n]=()=>r}}},XI=(A,e)=>{const t=rg(e);A.slots.default=()=>t},zI=(A,e,t)=>{for(const i in e)(t||!og(i))&&(A[i]=e[i])},FQ=(A,e,t)=>{const i=A.slots=VI();if(A.vnode.shapeFlag&32){const n=e._;n?(zI(i,e,t),t&&rI(i,"_",n,!0)):ZI(e,i)}else e&&XI(A,e)},SQ=(A,e,t)=>{const{vnode:i,slots:n}=A;let o=!0,r=_A;if(i.shapeFlag&32){const g=e._;g?t&&g===1?o=!1:zI(n,e,t):(o=!e.$stable,ZI(e,n)),r=e}else e&&(XI(A,e),r={default:1});if(o)for(const g in n)!og(g)&&r[g]==null&&delete n[g]},Se=LQ;function RQ(A){return bQ(A)}function bQ(A,e){const t=uo();t.__VUE__=!0;const{insert:i,remove:n,patchProp:o,createElement:r,createText:g,createComment:s,setText:a,setElementText:I,parentNode:l,nextSibling:C,setScopeId:Q=ot,insertStaticContent:h}=A,f=(w,R,k,x=null,q=null,V=null,iA=void 0,eA=null,m=!!R.dynamicChildren)=>{if(w===R)return;w&&!xi(w,R)&&(x=H(w),z(w,q,V,!0),w=null),R.patchFlag===-2&&(m=!1,R.dynamicChildren=null);const{type:y,ref:M,shapeFlag:O}=R;switch(y){case dn:u(w,R,k,x);break;case Kt:E(w,R,k,x);break;case Yn:w==null&&D(R,k,x,iA);break;case qA:L(w,R,k,x,q,V,iA,eA,m);break;default:O&1?p(w,R,k,x,q,V,iA,eA,m):O&6?QA(w,R,k,x,q,V,iA,eA,m):(O&64||O&128)&&y.process(w,R,k,x,q,V,iA,eA,m,cA)}M!=null&&q?Wi(M,w&&w.ref,V,R||w,!R):M==null&&w&&w.ref!=null&&Wi(w.ref,null,V,w,!0)},u=(w,R,k,x)=>{if(w==null)i(R.el=g(R.children),k,x);else{const q=R.el=w.el;R.children!==w.children&&a(q,R.children)}},E=(w,R,k,x)=>{w==null?i(R.el=s(R.children||""),k,x):R.el=w.el},D=(w,R,k,x)=>{[w.el,w.anchor]=h(w.children,R,k,x,w.el,w.anchor)},c=({el:w,anchor:R},k,x)=>{let q;for(;w&&w!==R;)q=C(w),i(w,k,x),w=q;i(R,k,x)},d=({el:w,anchor:R})=>{let k;for(;w&&w!==R;)k=C(w),n(w),w=k;n(R)},p=(w,R,k,x,q,V,iA,eA,m)=>{if(R.type==="svg"?iA="svg":R.type==="math"&&(iA="mathml"),w==null)v(R,k,x,q,V,iA,eA,m);else{const y=w.el&&w.el._isVueCE?w.el:null;try{y&&y._beginPatch(),_(w,R,q,V,iA,eA,m)}finally{y&&y._endPatch()}}},v=(w,R,k,x,q,V,iA,eA)=>{let m,y;const{props:M,shapeFlag:O,transition:oA,dirs:Z}=w;if(m=w.el=r(w.type,V,M&&M.is,M),O&8?I(m,w.children):O&16&&G(w.children,m,null,x,q,Ko(w,V),iA,eA),Z&&Zt(w,null,x,"created"),N(m,w,w.scopeId,iA,x),M){for(const P in M)P!=="value"&&!Oi(P)&&o(m,P,null,M[P],V,x);"value"in M&&o(m,"value",null,M.value,V),(y=M.onVnodeBeforeMount)&&ze(y,x,w)}Z&&Zt(w,null,x,"beforeMount");const U=NQ(q,oA);U&&oA.beforeEnter(m),i(m,R,k),((y=M&&M.onVnodeMounted)||U||Z)&&Se(()=>{y&&ze(y,x,w),U&&oA.enter(m),Z&&Zt(w,null,x,"mounted")},q)},N=(w,R,k,x,q)=>{if(k&&Q(w,k),x)for(let V=0;V{for(let y=m;y{const eA=R.el=w.el;let{patchFlag:m,dynamicChildren:y,dirs:M}=R;m|=w.patchFlag&16;const O=w.props||_A,oA=R.props||_A;let Z;if(k&&Xt(k,!1),(Z=oA.onVnodeBeforeUpdate)&&ze(Z,k,R,w),M&&Zt(R,w,k,"beforeUpdate"),k&&Xt(k,!0),(O.innerHTML&&oA.innerHTML==null||O.textContent&&oA.textContent==null)&&I(eA,""),y?S(w.dynamicChildren,y,eA,k,x,Ko(R,q),V):iA||tA(w,R,eA,null,k,x,Ko(R,q),V,!1),m>0){if(m&16)b(eA,O,oA,k,q);else if(m&2&&O.class!==oA.class&&o(eA,"class",null,oA.class,q),m&4&&o(eA,"style",O.style,oA.style,q),m&8){const U=R.dynamicProps;for(let P=0;P{Z&&ze(Z,k,R,w),M&&Zt(R,w,k,"updated")},x)},S=(w,R,k,x,q,V,iA)=>{for(let eA=0;eA{if(R!==k){if(R!==_A)for(const V in R)!Oi(V)&&!(V in k)&&o(w,V,R[V],null,q,x);for(const V in k){if(Oi(V))continue;const iA=k[V],eA=R[V];iA!==eA&&V!=="value"&&o(w,V,eA,iA,q,x)}"value"in k&&o(w,"value",R.value,k.value,q)}},L=(w,R,k,x,q,V,iA,eA,m)=>{const y=R.el=w?w.el:g(""),M=R.anchor=w?w.anchor:g("");let{patchFlag:O,dynamicChildren:oA,slotScopeIds:Z}=R;Z&&(eA=eA?eA.concat(Z):Z),w==null?(i(y,k,x),i(M,k,x),G(R.children||[],k,M,q,V,iA,eA,m)):O>0&&O&64&&oA&&w.dynamicChildren&&w.dynamicChildren.length===oA.length?(S(w.dynamicChildren,oA,k,q,V,iA,eA),(R.key!=null||q&&R===q.subTree)&&$I(w,R,!0)):tA(w,R,k,M,q,V,iA,eA,m)},QA=(w,R,k,x,q,V,iA,eA,m)=>{R.slotScopeIds=eA,w==null?R.shapeFlag&512?q.ctx.activate(R,k,x,iA,m):dA(R,k,x,q,V,iA,m):IA(w,R,m)},dA=(w,R,k,x,q,V,iA)=>{const eA=w.component=YQ(w,x,q);if(MI(w)&&(eA.ctx.renderer=cA),_Q(eA,!1,iA),eA.asyncDep){if(q&&q.registerDep(eA,nA,iA),!w.el){const m=eA.subTree=TA(Kt);E(null,m,R,k),w.placeholder=m.el}}else nA(eA,w,R,k,q,V,iA)},IA=(w,R,k)=>{const x=R.component=w.component;if(mQ(w,R,k))if(x.asyncDep&&!x.asyncResolved){X(x,R,k);return}else x.next=R,x.update();else R.el=w.el,x.vnode=R},nA=(w,R,k,x,q,V,iA)=>{const eA=()=>{if(w.isMounted){let{next:O,bu:oA,u:Z,parent:U,vnode:P}=w;{const Ce=AC(w);if(Ce){O&&(O.el=P.el,X(w,O,iA)),Ce.asyncDep.then(()=>{w.isUnmounted||eA()});return}}let uA=O,bA;Xt(w,!1),O?(O.el=P.el,X(w,O,iA)):O=P,oA&&Tn(oA),(bA=O.props&&O.props.onVnodeBeforeUpdate)&&ze(bA,U,O,P),Xt(w,!0);const jA=Og(w),he=w.subTree;w.subTree=jA,f(he,jA,l(he.el),H(he),w,q,V),O.el=jA.el,uA===null&&yQ(w,jA.el),Z&&Se(Z,q),(bA=O.props&&O.props.onVnodeUpdated)&&Se(()=>ze(bA,U,O,P),q)}else{let O;const{el:oA,props:Z}=R,{bm:U,m:P,parent:uA,root:bA,type:jA}=w,he=qi(R);Xt(w,!1),U&&Tn(U),!he&&(O=Z&&Z.onVnodeBeforeMount)&&ze(O,uA,R),Xt(w,!0);{bA.ce&&bA.ce._def.shadowRoot!==!1&&bA.ce._injectChildStyle(jA);const Ce=w.subTree=Og(w);f(null,Ce,k,x,w,q,V),R.el=Ce.el}if(P&&Se(P,q),!he&&(O=Z&&Z.onVnodeMounted)){const Ce=R;Se(()=>ze(O,uA,Ce),q)}(R.shapeFlag&256||uA&&qi(uA.vnode)&&uA.vnode.shapeFlag&256)&&w.a&&Se(w.a,q),w.isMounted=!0,R=k=x=null}};w.scope.on();const m=w.effect=new CI(eA);w.scope.off();const y=w.update=m.run.bind(m),M=w.job=m.runIfDirty.bind(m);M.i=w,M.id=w.uid,m.scheduler=()=>ig(M),Xt(w,!0),y()},X=(w,R,k)=>{R.component=w;const x=w.vnode.props;w.vnode=R,w.next=null,DQ(w,R.props,x,k),SQ(w,R.children,k),wt(),xg(w),Dt()},tA=(w,R,k,x,q,V,iA,eA,m=!1)=>{const y=w&&w.children,M=w?w.shapeFlag:0,O=R.children,{patchFlag:oA,shapeFlag:Z}=R;if(oA>0){if(oA&128){Y(y,O,k,x,q,V,iA,eA,m);return}else if(oA&256){fA(y,O,k,x,q,V,iA,eA,m);return}}Z&8?(M&16&&LA(y,q,V),O!==y&&I(k,O)):M&16?Z&16?Y(y,O,k,x,q,V,iA,eA,m):LA(y,q,V,!0):(M&8&&I(k,""),Z&16&&G(O,k,x,q,V,iA,eA,m))},fA=(w,R,k,x,q,V,iA,eA,m)=>{w=w||ui,R=R||ui;const y=w.length,M=R.length,O=Math.min(y,M);let oA;for(oA=0;oAM?LA(w,q,V,!0,!1,O):G(R,k,x,q,V,iA,eA,m,O)},Y=(w,R,k,x,q,V,iA,eA,m)=>{let y=0;const M=R.length;let O=w.length-1,oA=M-1;for(;y<=O&&y<=oA;){const Z=w[y],U=R[y]=m?xt(R[y]):tt(R[y]);if(xi(Z,U))f(Z,U,k,null,q,V,iA,eA,m);else break;y++}for(;y<=O&&y<=oA;){const Z=w[O],U=R[oA]=m?xt(R[oA]):tt(R[oA]);if(xi(Z,U))f(Z,U,k,null,q,V,iA,eA,m);else break;O--,oA--}if(y>O){if(y<=oA){const Z=oA+1,U=ZoA)for(;y<=O;)z(w[y],q,V,!0),y++;else{const Z=y,U=y,P=new Map;for(y=U;y<=oA;y++){const Fe=R[y]=m?xt(R[y]):tt(R[y]);Fe.key!=null&&P.set(Fe.key,y)}let uA,bA=0;const jA=oA-U+1;let he=!1,Ce=0;const jt=new Array(jA);for(y=0;y=jA){z(Fe,q,V,!0);continue}let Xe;if(Fe.key!=null)Xe=P.get(Fe.key);else for(uA=U;uA<=oA;uA++)if(jt[uA-U]===0&&xi(Fe,R[uA])){Xe=uA;break}Xe===void 0?z(Fe,q,V,!0):(jt[Xe-U]=y+1,Xe>=Ce?Ce=Xe:he=!0,f(Fe,R[Xe],k,null,q,V,iA,eA,m),bA++)}const Mo=he?GQ(jt):ui;for(uA=Mo.length-1,y=jA-1;y>=0;y--){const Fe=U+y,Xe=R[Fe],bg=R[Fe+1],Ng=Fe+1{const{el:V,type:iA,transition:eA,children:m,shapeFlag:y}=w;if(y&6){W(w.component.subTree,R,k,x);return}if(y&128){w.suspense.move(R,k,x);return}if(y&64){iA.move(w,R,k,cA);return}if(iA===qA){i(V,R,k);for(let O=0;OeA.enter(V),q);else{const{leave:O,delayLeave:oA,afterLeave:Z}=eA,U=()=>{w.ctx.isUnmounted?n(V):i(V,R,k)},P=()=>{V._isLeaving&&V[ZB](!0),O(V,()=>{U(),Z&&Z()})};oA?oA(V,U,P):P()}else i(V,R,k)},z=(w,R,k,x=!1,q=!1)=>{const{type:V,props:iA,ref:eA,children:m,dynamicChildren:y,shapeFlag:M,patchFlag:O,dirs:oA,cacheIndex:Z}=w;if(O===-2&&(q=!1),eA!=null&&(wt(),Wi(eA,null,k,w,!0),Dt()),Z!=null&&(R.renderCache[Z]=void 0),M&256){R.ctx.deactivate(w);return}const U=M&1&&oA,P=!qi(w);let uA;if(P&&(uA=iA&&iA.onVnodeBeforeUnmount)&&ze(uA,R,w),M&6)ne(w.component,k,x);else{if(M&128){w.suspense.unmount(k,x);return}U&&Zt(w,null,R,"beforeUnmount"),M&64?w.type.remove(w,R,k,cA,x):y&&!y.hasOnce&&(V!==qA||O>0&&O&64)?LA(y,R,k,!1,!0):(V===qA&&O&384||!q&&M&16)&&LA(m,R,k),x&&DA(w)}(P&&(uA=iA&&iA.onVnodeUnmounted)||U)&&Se(()=>{uA&&ze(uA,R,w),U&&Zt(w,null,R,"unmounted")},k)},DA=w=>{const{type:R,el:k,anchor:x,transition:q}=w;if(R===qA){NA(k,x);return}if(R===Yn){d(w);return}const V=()=>{n(k),q&&!q.persisted&&q.afterLeave&&q.afterLeave()};if(w.shapeFlag&1&&q&&!q.persisted){const{leave:iA,delayLeave:eA}=q,m=()=>iA(k,V);eA?eA(w.el,V,m):m()}else V()},NA=(w,R)=>{let k;for(;w!==R;)k=C(w),n(w),w=k;n(R)},ne=(w,R,k)=>{const{bum:x,scope:q,job:V,subTree:iA,um:eA,m,a:y}=w;Wg(m),Wg(y),x&&Tn(x),q.stop(),V&&(V.flags|=8,z(iA,w,R,k)),eA&&Se(eA,R),Se(()=>{w.isUnmounted=!0},R)},LA=(w,R,k,x=!1,q=!1,V=0)=>{for(let iA=V;iA{if(w.shapeFlag&6)return H(w.component.subTree);if(w.shapeFlag&128)return w.suspense.next();const R=C(w.anchor||w.el),k=R&&R[qB];return k?C(k):R};let $=!1;const AA=(w,R,k)=>{let x;w==null?R._vnode&&(z(R._vnode,null,null,!0),x=R._vnode.component):f(R._vnode||null,w,R,null,null,null,k),R._vnode=w,$||($=!0,xg(x),RI(),$=!1)},cA={p:f,um:z,m:W,r:DA,mt:dA,mc:G,pc:tA,pbc:S,n:H,o:A};return{render:AA,hydrate:void 0,createApp:EQ(AA)}}function Ko({type:A,props:e},t){return t==="svg"&&A==="foreignObject"||t==="mathml"&&A==="annotation-xml"&&e&&e.encoding&&e.encoding.includes("html")?void 0:t}function Xt({effect:A,job:e},t){t?(A.flags|=32,e.flags|=4):(A.flags&=-33,e.flags&=-5)}function NQ(A,e){return(!A||A&&!A.pendingBranch)&&e&&!e.persisted}function $I(A,e,t=!1){const i=A.children,n=e.children;if(yA(i)&&yA(n))for(let o=0;o>1,A[t[g]]0&&(e[i]=t[o-1]),t[o]=i)}}for(o=t.length,r=t[o-1];o-- >0;)t[o]=r,r=e[r];return t}function AC(A){const e=A.subTree.component;if(e)return e.asyncDep&&!e.asyncResolved?e:AC(e)}function Wg(A){if(A)for(let e=0;eA.__isSuspense;function LQ(A,e){e&&e.pendingBranch?yA(A)?e.effects.push(...A):e.effects.push(A):KB(A)}const qA=Symbol.for("v-fgt"),dn=Symbol.for("v-txt"),Kt=Symbol.for("v-cmt"),Yn=Symbol.for("v-stc"),Zi=[];let be=null;function T(A=!1){Zi.push(be=A?null:[])}function UQ(){Zi.pop(),be=Zi[Zi.length-1]||null}let tn=1;function $n(A,e=!1){tn+=A,A<0&&be&&e&&(be.hasOnce=!0)}function iC(A){return A.dynamicChildren=tn>0?be||ui:null,UQ(),tn>0&&be&&be.push(A),A}function K(A,e,t,i,n,o){return iC(B(A,e,t,i,n,o,!0))}function ye(A,e,t,i,n){return iC(TA(A,e,t,i,n,!0))}function Ao(A){return A?A.__v_isVNode===!0:!1}function xi(A,e){return A.type===e.type&&A.key===e.key}const nC=({key:A})=>A??null,_n=({ref:A,ref_key:e,ref_for:t})=>(typeof A=="number"&&(A=""+A),A!=null?ee(A)||le(A)||FA(A)?{i:Re,r:A,k:e,f:!!t}:A:null);function B(A,e=null,t=null,i=0,n=null,o=A===qA?0:1,r=!1,g=!1){const s={__v_isVNode:!0,__v_skip:!0,type:A,props:e,key:e&&nC(e),ref:e&&_n(e),scopeId:NI,slotScopeIds:null,children:t,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:o,patchFlag:i,dynamicProps:n,dynamicChildren:null,appContext:null,ctx:Re};return g?(gg(s,t),o&128&&A.normalize(s)):t&&(s.shapeFlag|=ee(t)?8:16),tn>0&&!r&&be&&(s.patchFlag>0||o&6)&&s.patchFlag!==32&&be.push(s),s}const TA=MQ;function MQ(A,e=null,t=null,i=0,n=null,o=!1){if((!A||A===TI)&&(A=Kt),Ao(A)){const g=Di(A,e,!0);return t&&gg(g,t),tn>0&&!o&&be&&(g.shapeFlag&6?be[be.indexOf(A)]=g:be.push(g)),g.patchFlag=-2,g}if(WQ(A)&&(A=A.__vccOpts),e){e=xQ(e);let{class:g,style:s}=e;g&&!ee(g)&&(e.class=kA(g)),KA(s)&&(eg(s)&&!yA(s)&&(s=ue({},s)),e.style=VA(s))}const r=ee(A)?1:tC(A)?128:jB(A)?64:KA(A)?4:FA(A)?2:0;return B(A,e,t,i,n,r,o,!0)}function xQ(A){return A?eg(A)||WI(A)?ue({},A):A:null}function Di(A,e,t=!1,i=!1){const{props:n,ref:o,patchFlag:r,children:g,transition:s}=A,a=e?JQ(n||{},e):n,I={__v_isVNode:!0,__v_skip:!0,type:A.type,props:a,key:a&&nC(a),ref:e&&e.ref?t&&o?yA(o)?o.concat(_n(e)):[o,_n(e)]:_n(e):o,scopeId:A.scopeId,slotScopeIds:A.slotScopeIds,children:g,target:A.target,targetStart:A.targetStart,targetAnchor:A.targetAnchor,staticCount:A.staticCount,shapeFlag:A.shapeFlag,patchFlag:e&&A.type!==qA?r===-1?16:r|16:r,dynamicProps:A.dynamicProps,dynamicChildren:A.dynamicChildren,appContext:A.appContext,dirs:A.dirs,transition:s,component:A.component,suspense:A.suspense,ssContent:A.ssContent&&Di(A.ssContent),ssFallback:A.ssFallback&&Di(A.ssFallback),placeholder:A.placeholder,el:A.el,anchor:A.anchor,ctx:A.ctx,ce:A.ce};return s&&i&&ng(I,s.clone(I)),I}function gt(A=" ",e=0){return TA(dn,null,A,e)}function Do(A,e){const t=TA(Yn,null,A);return t.staticCount=e,t}function sA(A="",e=!1){return e?(T(),ye(Kt,null,A)):TA(Kt,null,A)}function tt(A){return A==null||typeof A=="boolean"?TA(Kt):yA(A)?TA(qA,null,A.slice()):Ao(A)?xt(A):TA(dn,null,String(A))}function xt(A){return A.el===null&&A.patchFlag!==-1||A.memo?A:Di(A)}function gg(A,e){let t=0;const{shapeFlag:i}=A;if(e==null)e=null;else if(yA(e))t=16;else if(typeof e=="object")if(i&65){const n=e.default;n&&(n._c&&(n._d=!1),gg(A,n()),n._c&&(n._d=!0));return}else{t=32;const n=e._;!n&&!WI(e)?e._ctx=Re:n===3&&Re&&(Re.slots._===1?e._=1:(e._=2,A.patchFlag|=1024))}else FA(e)?(e={default:e,_ctx:Re},t=32):(e=String(e),i&64?(t=16,e=[gt(e)]):t=8);A.children=e,A.shapeFlag|=t}function JQ(...A){const e={};for(let t=0;tEe||Re;let eo,hr;{const A=uo(),e=(t,i)=>{let n;return(n=A[t])||(n=A[t]=[]),n.push(i),o=>{n.length>1?n.forEach(r=>r(o)):n[0](o)}};eo=e("__VUE_INSTANCE_SETTERS__",t=>Ee=t),hr=e("__VUE_SSR_SETTERS__",t=>nn=t)}const pn=A=>{const e=Ee;return eo(A),A.scope.on(),()=>{A.scope.off(),eo(e)}},qg=()=>{Ee&&Ee.scope.off(),eo(null)};function oC(A){return A.vnode.shapeFlag&4}let nn=!1;function _Q(A,e=!1,t=!1){e&&hr(e);const{props:i,children:n}=A.vnode,o=oC(A);wQ(A,i,o,e),FQ(A,n,t||e);const r=o?KQ(A,e):void 0;return e&&hr(!1),r}function KQ(A,e){const t=A.type;A.accessCache=Object.create(null),A.proxy=new Proxy(A.ctx,aQ);const{setup:i}=t;if(i){wt();const n=A.setupContext=i.length>1?PQ(A):null,o=pn(A),r=un(i,A,0,[A.props,n]),g=iI(r);if(Dt(),o(),(g||A.sp)&&!qi(A)&&UI(A),g){if(r.then(qg,qg),e)return r.then(s=>{jg(A,s)}).catch(s=>{mo(s,A,0)});A.asyncDep=r}else jg(A,r)}else rC(A)}function jg(A,e,t){FA(e)?A.type.__ssrInlineRender?A.ssrRender=e:A.render=e:KA(e)&&(A.setupState=vI(e)),rC(A)}function rC(A,e,t){const i=A.type;A.render||(A.render=i.render||ot);{const n=pn(A);wt();try{IQ(A)}finally{Dt(),n()}}}const OQ={get(A,e){return ce(A,"get",""),A[e]}};function PQ(A){const e=t=>{A.exposed=t||{}};return{attrs:new Proxy(A.attrs,OQ),slots:A.slots,emit:A.emit,expose:e}}function ko(A){return A.exposed?A.exposeProxy||(A.exposeProxy=new Proxy(vI(_i(A.exposed)),{get(e,t){if(t in e)return e[t];if(t in ji)return ji[t](A)},has(e,t){return t in e||t in ji}})):A.proxy}function VQ(A,e=!0){return FA(A)?A.displayName||A.name:A.name||e&&A.__name}function WQ(A){return FA(A)&&"__vccOpts"in A}const hA=(A,e)=>JB(A,e,nn);function GA(A,e,t){try{$n(-1);const i=arguments.length;return i===2?KA(e)&&!yA(e)?Ao(e)?TA(A,null,[e]):TA(A,e):TA(A,null,e):(i>3?t=Array.prototype.slice.call(arguments,2):i===3&&Ao(t)&&(t=[t]),TA(A,e,t))}finally{$n(1)}}const qQ="3.5.26";/** * @vue/runtime-dom v3.5.26 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT @@ -23,16 +23,16 @@ * (c) 2025 kazuya kawaguchi * Released under the MIT License. */function Nc(A,e,t){return{line:A,column:e,offset:t}}function oo(A,e,t){return{start:A,end:e}}const Gc=/\{([0-9a-zA-Z]+)\}/g;function IC(A,...e){return e.length===1&&Lc(e[0])&&(e=e[0]),(!e||!e.hasOwnProperty)&&(e={}),A.replace(Gc,(t,i)=>e.hasOwnProperty(i)?e[i]:"")}const CC=Object.assign,Qs=A=>typeof A=="string",Lc=A=>A!==null&&typeof A=="object";function lC(A,e=""){return A.reduce((t,i,n)=>n===0?t+i:t+e+i,"")}const sg={USE_MODULO_SYNTAX:1,__EXTEND_POINT__:2},Uc={[sg.USE_MODULO_SYNTAX]:"Use modulo before '{{0}}'."};function Mc(A,e,...t){const i=IC(Uc[A],...t||[]),n={message:String(i),code:A};return e&&(n.location=e),n}const pA={EXPECTED_TOKEN:1,INVALID_TOKEN_IN_PLACEHOLDER:2,UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER:3,UNKNOWN_ESCAPE_SEQUENCE:4,INVALID_UNICODE_ESCAPE_SEQUENCE:5,UNBALANCED_CLOSING_BRACE:6,UNTERMINATED_CLOSING_BRACE:7,EMPTY_PLACEHOLDER:8,NOT_ALLOW_NEST_PLACEHOLDER:9,INVALID_LINKED_FORMAT:10,MUST_HAVE_MESSAGES_IN_PLURAL:11,UNEXPECTED_EMPTY_LINKED_MODIFIER:12,UNEXPECTED_EMPTY_LINKED_KEY:13,UNEXPECTED_LEXICAL_ANALYSIS:14,UNHANDLED_CODEGEN_NODE_TYPE:15,UNHANDLED_MINIFIER_NODE_TYPE:16,__EXTEND_POINT__:17},xc={[pA.EXPECTED_TOKEN]:"Expected token: '{0}'",[pA.INVALID_TOKEN_IN_PLACEHOLDER]:"Invalid token in placeholder: '{0}'",[pA.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER]:"Unterminated single quote in placeholder",[pA.UNKNOWN_ESCAPE_SEQUENCE]:"Unknown escape sequence: \\{0}",[pA.INVALID_UNICODE_ESCAPE_SEQUENCE]:"Invalid unicode escape sequence: {0}",[pA.UNBALANCED_CLOSING_BRACE]:"Unbalanced closing brace",[pA.UNTERMINATED_CLOSING_BRACE]:"Unterminated closing brace",[pA.EMPTY_PLACEHOLDER]:"Empty placeholder",[pA.NOT_ALLOW_NEST_PLACEHOLDER]:"Not allowed nest placeholder",[pA.INVALID_LINKED_FORMAT]:"Invalid linked format",[pA.MUST_HAVE_MESSAGES_IN_PLURAL]:"Plural must have messages",[pA.UNEXPECTED_EMPTY_LINKED_MODIFIER]:"Unexpected empty linked modifier",[pA.UNEXPECTED_EMPTY_LINKED_KEY]:"Unexpected empty linked key",[pA.UNEXPECTED_LEXICAL_ANALYSIS]:"Unexpected lexical analysis in token: '{0}'",[pA.UNHANDLED_CODEGEN_NODE_TYPE]:"unhandled codegen node type: '{0}'",[pA.UNHANDLED_MINIFIER_NODE_TYPE]:"unhandled mimifier node type: '{0}'"};function Gi(A,e,t={}){const{domain:i,messages:n,args:o}=t,r=IC((n||xc)[A]||"",...o||[]),g=new SyntaxError(String(r));return g.code=A,e&&(g.location=e),g.domain=i,g}function Jc(A){throw A}const Bt=" ",Tc="\r",de=` -`,Hc="\u2028",Yc="\u2029";function _c(A){const e=A;let t=0,i=1,n=1,o=0;const r=N=>e[N]===Tc&&e[N+1]===de,g=N=>e[N]===de,s=N=>e[N]===Yc,a=N=>e[N]===Hc,I=N=>r(N)||g(N)||s(N)||a(N),l=()=>t,C=()=>i,Q=()=>n,h=()=>o,f=N=>r(N)||s(N)||a(N)?de:e[N],u=()=>f(t),E=()=>f(t+o);function m(){return o=0,I(t)&&(i++,n=0),r(t)&&t++,t++,n++,e[t]}function c(){return r(t+o)&&o++,o++,e[t+o]}function d(){t=0,i=1,n=1,o=0}function w(N=0){o=N}function F(){const N=t+o;for(;N!==t;)m();o=0}return{index:l,line:C,column:Q,peekOffset:h,charAt:f,currentChar:u,currentPeek:E,next:m,peek:c,reset:d,resetPeek:w,skipToPeek:F}}const Rt=void 0,Kc=".",cs="'",Oc="tokenizer";function Pc(A,e={}){const t=e.location!==!1,i=_c(A),n=()=>i.index(),o=()=>Nc(i.line(),i.column(),i.index()),r=o(),g=n(),s={currentType:14,offset:g,startLoc:r,endLoc:r,lastType:14,lastOffset:g,lastStartLoc:r,lastEndLoc:r,braceNest:0,inLinked:!1,text:""},a=()=>s,{onError:I}=e;function l(p,y,M,...O){const oA=a();if(y.column+=M,y.offset+=M,I){const Z=t?oo(oA.startLoc,y):null,U=Gi(p,Z,{domain:Oc,args:O});I(U)}}function C(p,y,M){p.endLoc=o(),p.currentType=y;const O={type:y};return t&&(O.loc=oo(p.startLoc,p.endLoc)),M!=null&&(O.value=M),O}const Q=p=>C(p,14);function h(p,y){return p.currentChar()===y?(p.next(),y):(l(pA.EXPECTED_TOKEN,o(),0,y),"")}function f(p){let y="";for(;p.currentPeek()===Bt||p.currentPeek()===de;)y+=p.currentPeek(),p.peek();return y}function u(p){const y=f(p);return p.skipToPeek(),y}function E(p){if(p===Rt)return!1;const y=p.charCodeAt(0);return y>=97&&y<=122||y>=65&&y<=90||y===95}function m(p){if(p===Rt)return!1;const y=p.charCodeAt(0);return y>=48&&y<=57}function c(p,y){const{currentType:M}=y;if(M!==2)return!1;f(p);const O=E(p.currentPeek());return p.resetPeek(),O}function d(p,y){const{currentType:M}=y;if(M!==2)return!1;f(p);const O=p.currentPeek()==="-"?p.peek():p.currentPeek(),oA=m(O);return p.resetPeek(),oA}function w(p,y){const{currentType:M}=y;if(M!==2)return!1;f(p);const O=p.currentPeek()===cs;return p.resetPeek(),O}function F(p,y){const{currentType:M}=y;if(M!==8)return!1;f(p);const O=p.currentPeek()===".";return p.resetPeek(),O}function N(p,y){const{currentType:M}=y;if(M!==9)return!1;f(p);const O=E(p.currentPeek());return p.resetPeek(),O}function G(p,y){const{currentType:M}=y;if(!(M===8||M===12))return!1;f(p);const O=p.currentPeek()===":";return p.resetPeek(),O}function K(p,y){const{currentType:M}=y;if(M!==10)return!1;const O=()=>{const Z=p.currentPeek();return Z==="{"?E(p.peek()):Z==="@"||Z==="%"||Z==="|"||Z===":"||Z==="."||Z===Bt||!Z?!1:Z===de?(p.peek(),O()):L(p,!1)},oA=O();return p.resetPeek(),oA}function R(p){f(p);const y=p.currentPeek()==="|";return p.resetPeek(),y}function b(p){const y=f(p),M=p.currentPeek()==="%"&&p.peek()==="{";return p.resetPeek(),{isModulo:M,hasSpace:y.length>0}}function L(p,y=!0){const M=(oA=!1,Z="",U=!1)=>{const P=p.currentPeek();return P==="{"?Z==="%"?!1:oA:P==="@"||!P?Z==="%"?!0:oA:P==="%"?(p.peek(),M(oA,"%",!0)):P==="|"?Z==="%"||U?!0:!(Z===Bt||Z===de):P===Bt?(p.peek(),M(!0,Bt,U)):P===de?(p.peek(),M(!0,de,U)):!0},O=M();return y&&p.resetPeek(),O}function EA(p,y){const M=p.currentChar();return M===Rt?Rt:y(M)?(p.next(),M):null}function dA(p){const y=p.charCodeAt(0);return y>=97&&y<=122||y>=65&&y<=90||y>=48&&y<=57||y===95||y===36}function IA(p){return EA(p,dA)}function nA(p){const y=p.charCodeAt(0);return y>=97&&y<=122||y>=65&&y<=90||y>=48&&y<=57||y===95||y===36||y===45}function X(p){return EA(p,nA)}function tA(p){const y=p.charCodeAt(0);return y>=48&&y<=57}function fA(p){return EA(p,tA)}function Y(p){const y=p.charCodeAt(0);return y>=48&&y<=57||y>=65&&y<=70||y>=97&&y<=102}function W(p){return EA(p,Y)}function z(p){let y="",M="";for(;y=fA(p);)M+=y;return M}function DA(p){u(p);const y=p.currentChar();return y!=="%"&&l(pA.EXPECTED_TOKEN,o(),0,y),p.next(),"%"}function NA(p){let y="";for(;;){const M=p.currentChar();if(M==="{"||M==="}"||M==="@"||M==="|"||!M)break;if(M==="%")if(L(p))y+=M,p.next();else break;else if(M===Bt||M===de)if(L(p))y+=M,p.next();else{if(R(p))break;y+=M,p.next()}else y+=M,p.next()}return y}function ne(p){u(p);let y="",M="";for(;y=X(p);)M+=y;return p.currentChar()===Rt&&l(pA.UNTERMINATED_CLOSING_BRACE,o(),0),M}function LA(p){u(p);let y="";return p.currentChar()==="-"?(p.next(),y+=`-${z(p)}`):y+=z(p),p.currentChar()===Rt&&l(pA.UNTERMINATED_CLOSING_BRACE,o(),0),y}function H(p){return p!==cs&&p!==de}function $(p){u(p),h(p,"'");let y="",M="";for(;y=EA(p,H);)y==="\\"?M+=AA(p):M+=y;const O=p.currentChar();return O===de||O===Rt?(l(pA.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,o(),0),O===de&&(p.next(),h(p,"'")),M):(h(p,"'"),M)}function AA(p){const y=p.currentChar();switch(y){case"\\":case"'":return p.next(),`\\${y}`;case"u":return QA(p,y,4);case"U":return QA(p,y,6);default:return l(pA.UNKNOWN_ESCAPE_SEQUENCE,o(),0,y),""}}function QA(p,y,M){h(p,y);let O="";for(let oA=0;oA{const O=p.currentChar();return O==="{"||O==="%"||O==="@"||O==="|"||O==="("||O===")"||!O||O===Bt?M:(M+=O,p.next(),y(M))};return y("")}function x(p){u(p);const y=h(p,"|");return u(p),y}function q(p,y){let M=null;switch(p.currentChar()){case"{":return y.braceNest>=1&&l(pA.NOT_ALLOW_NEST_PLACEHOLDER,o(),0),p.next(),M=C(y,2,"{"),u(p),y.braceNest++,M;case"}":return y.braceNest>0&&y.currentType===2&&l(pA.EMPTY_PLACEHOLDER,o(),0),p.next(),M=C(y,3,"}"),y.braceNest--,y.braceNest>0&&u(p),y.inLinked&&y.braceNest===0&&(y.inLinked=!1),M;case"@":return y.braceNest>0&&l(pA.UNTERMINATED_CLOSING_BRACE,o(),0),M=V(p,y)||Q(y),y.braceNest=0,M;default:{let oA=!0,Z=!0,U=!0;if(R(p))return y.braceNest>0&&l(pA.UNTERMINATED_CLOSING_BRACE,o(),0),M=C(y,1,x(p)),y.braceNest=0,y.inLinked=!1,M;if(y.braceNest>0&&(y.currentType===5||y.currentType===6||y.currentType===7))return l(pA.UNTERMINATED_CLOSING_BRACE,o(),0),y.braceNest=0,iA(p,y);if(oA=c(p,y))return M=C(y,5,ne(p)),u(p),M;if(Z=d(p,y))return M=C(y,6,LA(p)),u(p),M;if(U=w(p,y))return M=C(y,7,$(p)),u(p),M;if(!oA&&!Z&&!U)return M=C(y,13,D(p)),l(pA.INVALID_TOKEN_IN_PLACEHOLDER,o(),0,M.value),u(p),M;break}}return M}function V(p,y){const{currentType:M}=y;let O=null;const oA=p.currentChar();switch((M===8||M===9||M===12||M===10)&&(oA===de||oA===Bt)&&l(pA.INVALID_LINKED_FORMAT,o(),0),oA){case"@":return p.next(),O=C(y,8,"@"),y.inLinked=!0,O;case".":return u(p),p.next(),C(y,9,".");case":":return u(p),p.next(),C(y,10,":");default:return R(p)?(O=C(y,1,x(p)),y.braceNest=0,y.inLinked=!1,O):F(p,y)||G(p,y)?(u(p),V(p,y)):N(p,y)?(u(p),C(y,12,S(p))):K(p,y)?(u(p),oA==="{"?q(p,y)||O:C(y,11,k(p))):(M===8&&l(pA.INVALID_LINKED_FORMAT,o(),0),y.braceNest=0,y.inLinked=!1,iA(p,y))}}function iA(p,y){let M={type:14};if(y.braceNest>0)return q(p,y)||Q(y);if(y.inLinked)return V(p,y)||Q(y);switch(p.currentChar()){case"{":return q(p,y)||Q(y);case"}":return l(pA.UNBALANCED_CLOSING_BRACE,o(),0),p.next(),C(y,3,"}");case"@":return V(p,y)||Q(y);default:{if(R(p))return M=C(y,1,x(p)),y.braceNest=0,y.inLinked=!1,M;const{isModulo:oA,hasSpace:Z}=b(p);if(oA)return Z?C(y,0,NA(p)):C(y,4,DA(p));if(L(p))return C(y,0,NA(p));break}}return M}function eA(){const{currentType:p,offset:y,startLoc:M,endLoc:O}=s;return s.lastType=p,s.lastOffset=y,s.lastStartLoc=M,s.lastEndLoc=O,s.offset=n(),s.startLoc=o(),i.currentChar()===Rt?C(s,14):iA(i,s)}return{nextToken:eA,currentOffset:n,currentPosition:o,context:a}}const Vc="parser",Wc=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g;function qc(A,e,t){switch(A){case"\\\\":return"\\";case"\\'":return"'";default:{const i=parseInt(e||t,16);return i<=55295||i>=57344?String.fromCodePoint(i):"�"}}}function jc(A={}){const e=A.location!==!1,{onError:t,onWarn:i}=A;function n(c,d,w,F,...N){const G=c.currentPosition();if(G.offset+=F,G.column+=F,t){const K=e?oo(w,G):null,R=Gi(d,K,{domain:Vc,args:N});t(R)}}function o(c,d,w,F,...N){const G=c.currentPosition();if(G.offset+=F,G.column+=F,i){const K=e?oo(w,G):null;i(Mc(d,K,N))}}function r(c,d,w){const F={type:c};return e&&(F.start=d,F.end=d,F.loc={start:w,end:w}),F}function g(c,d,w,F){e&&(c.end=d,c.loc&&(c.loc.end=w))}function s(c,d){const w=c.context(),F=r(3,w.offset,w.startLoc);return F.value=d,g(F,c.currentOffset(),c.currentPosition()),F}function a(c,d){const w=c.context(),{lastOffset:F,lastStartLoc:N}=w,G=r(5,F,N);return G.index=parseInt(d,10),c.nextToken(),g(G,c.currentOffset(),c.currentPosition()),G}function I(c,d,w){const F=c.context(),{lastOffset:N,lastStartLoc:G}=F,K=r(4,N,G);return K.key=d,w===!0&&(K.modulo=!0),c.nextToken(),g(K,c.currentOffset(),c.currentPosition()),K}function l(c,d){const w=c.context(),{lastOffset:F,lastStartLoc:N}=w,G=r(9,F,N);return G.value=d.replace(Wc,qc),c.nextToken(),g(G,c.currentOffset(),c.currentPosition()),G}function C(c){const d=c.nextToken(),w=c.context(),{lastOffset:F,lastStartLoc:N}=w,G=r(8,F,N);return d.type!==12?(n(c,pA.UNEXPECTED_EMPTY_LINKED_MODIFIER,w.lastStartLoc,0),G.value="",g(G,F,N),{nextConsumeToken:d,node:G}):(d.value==null&&n(c,pA.UNEXPECTED_LEXICAL_ANALYSIS,w.lastStartLoc,0,Te(d)),G.value=d.value||"",g(G,c.currentOffset(),c.currentPosition()),{node:G})}function Q(c,d){const w=c.context(),F=r(7,w.offset,w.startLoc);return F.value=d,g(F,c.currentOffset(),c.currentPosition()),F}function h(c){const d=c.context(),w=r(6,d.offset,d.startLoc);let F=c.nextToken();if(F.type===9){const N=C(c);w.modifier=N.node,F=N.nextConsumeToken||c.nextToken()}switch(F.type!==10&&n(c,pA.UNEXPECTED_LEXICAL_ANALYSIS,d.lastStartLoc,0,Te(F)),F=c.nextToken(),F.type===2&&(F=c.nextToken()),F.type){case 11:F.value==null&&n(c,pA.UNEXPECTED_LEXICAL_ANALYSIS,d.lastStartLoc,0,Te(F)),w.key=Q(c,F.value||"");break;case 5:F.value==null&&n(c,pA.UNEXPECTED_LEXICAL_ANALYSIS,d.lastStartLoc,0,Te(F)),w.key=I(c,F.value||"");break;case 6:F.value==null&&n(c,pA.UNEXPECTED_LEXICAL_ANALYSIS,d.lastStartLoc,0,Te(F)),w.key=a(c,F.value||"");break;case 7:F.value==null&&n(c,pA.UNEXPECTED_LEXICAL_ANALYSIS,d.lastStartLoc,0,Te(F)),w.key=l(c,F.value||"");break;default:{n(c,pA.UNEXPECTED_EMPTY_LINKED_KEY,d.lastStartLoc,0);const N=c.context(),G=r(7,N.offset,N.startLoc);return G.value="",g(G,N.offset,N.startLoc),w.key=G,g(w,N.offset,N.startLoc),{nextConsumeToken:F,node:w}}}return g(w,c.currentOffset(),c.currentPosition()),{node:w}}function f(c){const d=c.context(),w=d.currentType===1?c.currentOffset():d.offset,F=d.currentType===1?d.endLoc:d.startLoc,N=r(2,w,F);N.items=[];let G=null,K=null;do{const L=G||c.nextToken();switch(G=null,L.type){case 0:L.value==null&&n(c,pA.UNEXPECTED_LEXICAL_ANALYSIS,d.lastStartLoc,0,Te(L)),N.items.push(s(c,L.value||""));break;case 6:L.value==null&&n(c,pA.UNEXPECTED_LEXICAL_ANALYSIS,d.lastStartLoc,0,Te(L)),N.items.push(a(c,L.value||""));break;case 4:K=!0;break;case 5:L.value==null&&n(c,pA.UNEXPECTED_LEXICAL_ANALYSIS,d.lastStartLoc,0,Te(L)),N.items.push(I(c,L.value||"",!!K)),K&&(o(c,sg.USE_MODULO_SYNTAX,d.lastStartLoc,0,Te(L)),K=null);break;case 7:L.value==null&&n(c,pA.UNEXPECTED_LEXICAL_ANALYSIS,d.lastStartLoc,0,Te(L)),N.items.push(l(c,L.value||""));break;case 8:{const EA=h(c);N.items.push(EA.node),G=EA.nextConsumeToken||null;break}}}while(d.currentType!==14&&d.currentType!==1);const R=d.currentType===1?d.lastOffset:c.currentOffset(),b=d.currentType===1?d.lastEndLoc:c.currentPosition();return g(N,R,b),N}function u(c,d,w,F){const N=c.context();let G=F.items.length===0;const K=r(1,d,w);K.cases=[],K.cases.push(F);do{const R=f(c);G||(G=R.items.length===0),K.cases.push(R)}while(N.currentType!==14);return G&&n(c,pA.MUST_HAVE_MESSAGES_IN_PLURAL,w,0),g(K,c.currentOffset(),c.currentPosition()),K}function E(c){const d=c.context(),{offset:w,startLoc:F}=d,N=f(c);return d.currentType===14?N:u(c,w,F,N)}function m(c){const d=Pc(c,CC({},A)),w=d.context(),F=r(0,w.offset,w.startLoc);return e&&F.loc&&(F.loc.source=c),F.body=E(d),A.onCacheKey&&(F.cacheKey=A.onCacheKey(c)),w.currentType!==14&&n(d,pA.UNEXPECTED_LEXICAL_ANALYSIS,w.lastStartLoc,0,c[w.offset]||""),g(F,d.currentOffset(),d.currentPosition()),F}return{parse:m}}function Te(A){if(A.type===14)return"EOF";const e=(A.value||"").replace(/\r?\n/gu,"\\n");return e.length>10?e.slice(0,9)+"…":e}function Zc(A,e={}){const t={ast:A,helpers:new Set};return{context:()=>t,helper:o=>(t.helpers.add(o),o)}}function Es(A,e){for(let t=0;tus(t)),A}function us(A){if(A.items.length===1){const e=A.items[0];(e.type===3||e.type===9)&&(A.static=e.value,delete e.value)}else{const e=[];for(let t=0;tr;function s(f,u){r.code+=f}function a(f,u=!0){const E=u?i:"";s(n?E+" ".repeat(f):E)}function I(f=!0){const u=++r.indentLevel;f&&a(u)}function l(f=!0){const u=--r.indentLevel;f&&a(u)}function C(){a(r.indentLevel)}return{context:g,push:s,indent:I,deindent:l,newline:C,helper:f=>`_${f}`,needIndent:()=>r.needIndent}}function tE(A,e){const{helper:t}=A;A.push(`${t("linked")}(`),vi(A,e.key),e.modifier?(A.push(", "),vi(A,e.modifier),A.push(", _type")):A.push(", undefined, _type"),A.push(")")}function iE(A,e){const{helper:t,needIndent:i}=A;A.push(`${t("normalize")}([`),A.indent(i());const n=e.items.length;for(let o=0;o1){A.push(`${t("plural")}([`),A.indent(i());const n=e.cases.length;for(let o=0;o{const t=Qs(e.mode)?e.mode:"normal",i=Qs(e.filename)?e.filename:"message.intl";e.sourceMap;const n=e.breakLineCode!=null?e.breakLineCode:t==="arrow"?";":` +`,Hc="\u2028",Yc="\u2029";function _c(A){const e=A;let t=0,i=1,n=1,o=0;const r=N=>e[N]===Tc&&e[N+1]===de,g=N=>e[N]===de,s=N=>e[N]===Yc,a=N=>e[N]===Hc,I=N=>r(N)||g(N)||s(N)||a(N),l=()=>t,C=()=>i,Q=()=>n,h=()=>o,f=N=>r(N)||s(N)||a(N)?de:e[N],u=()=>f(t),E=()=>f(t+o);function D(){return o=0,I(t)&&(i++,n=0),r(t)&&t++,t++,n++,e[t]}function c(){return r(t+o)&&o++,o++,e[t+o]}function d(){t=0,i=1,n=1,o=0}function p(N=0){o=N}function v(){const N=t+o;for(;N!==t;)D();o=0}return{index:l,line:C,column:Q,peekOffset:h,charAt:f,currentChar:u,currentPeek:E,next:D,peek:c,reset:d,resetPeek:p,skipToPeek:v}}const Rt=void 0,Kc=".",cs="'",Oc="tokenizer";function Pc(A,e={}){const t=e.location!==!1,i=_c(A),n=()=>i.index(),o=()=>Nc(i.line(),i.column(),i.index()),r=o(),g=n(),s={currentType:14,offset:g,startLoc:r,endLoc:r,lastType:14,lastOffset:g,lastStartLoc:r,lastEndLoc:r,braceNest:0,inLinked:!1,text:""},a=()=>s,{onError:I}=e;function l(m,y,M,...O){const oA=a();if(y.column+=M,y.offset+=M,I){const Z=t?oo(oA.startLoc,y):null,U=Gi(m,Z,{domain:Oc,args:O});I(U)}}function C(m,y,M){m.endLoc=o(),m.currentType=y;const O={type:y};return t&&(O.loc=oo(m.startLoc,m.endLoc)),M!=null&&(O.value=M),O}const Q=m=>C(m,14);function h(m,y){return m.currentChar()===y?(m.next(),y):(l(pA.EXPECTED_TOKEN,o(),0,y),"")}function f(m){let y="";for(;m.currentPeek()===Bt||m.currentPeek()===de;)y+=m.currentPeek(),m.peek();return y}function u(m){const y=f(m);return m.skipToPeek(),y}function E(m){if(m===Rt)return!1;const y=m.charCodeAt(0);return y>=97&&y<=122||y>=65&&y<=90||y===95}function D(m){if(m===Rt)return!1;const y=m.charCodeAt(0);return y>=48&&y<=57}function c(m,y){const{currentType:M}=y;if(M!==2)return!1;f(m);const O=E(m.currentPeek());return m.resetPeek(),O}function d(m,y){const{currentType:M}=y;if(M!==2)return!1;f(m);const O=m.currentPeek()==="-"?m.peek():m.currentPeek(),oA=D(O);return m.resetPeek(),oA}function p(m,y){const{currentType:M}=y;if(M!==2)return!1;f(m);const O=m.currentPeek()===cs;return m.resetPeek(),O}function v(m,y){const{currentType:M}=y;if(M!==8)return!1;f(m);const O=m.currentPeek()===".";return m.resetPeek(),O}function N(m,y){const{currentType:M}=y;if(M!==9)return!1;f(m);const O=E(m.currentPeek());return m.resetPeek(),O}function G(m,y){const{currentType:M}=y;if(!(M===8||M===12))return!1;f(m);const O=m.currentPeek()===":";return m.resetPeek(),O}function _(m,y){const{currentType:M}=y;if(M!==10)return!1;const O=()=>{const Z=m.currentPeek();return Z==="{"?E(m.peek()):Z==="@"||Z==="%"||Z==="|"||Z===":"||Z==="."||Z===Bt||!Z?!1:Z===de?(m.peek(),O()):L(m,!1)},oA=O();return m.resetPeek(),oA}function S(m){f(m);const y=m.currentPeek()==="|";return m.resetPeek(),y}function b(m){const y=f(m),M=m.currentPeek()==="%"&&m.peek()==="{";return m.resetPeek(),{isModulo:M,hasSpace:y.length>0}}function L(m,y=!0){const M=(oA=!1,Z="",U=!1)=>{const P=m.currentPeek();return P==="{"?Z==="%"?!1:oA:P==="@"||!P?Z==="%"?!0:oA:P==="%"?(m.peek(),M(oA,"%",!0)):P==="|"?Z==="%"||U?!0:!(Z===Bt||Z===de):P===Bt?(m.peek(),M(!0,Bt,U)):P===de?(m.peek(),M(!0,de,U)):!0},O=M();return y&&m.resetPeek(),O}function QA(m,y){const M=m.currentChar();return M===Rt?Rt:y(M)?(m.next(),M):null}function dA(m){const y=m.charCodeAt(0);return y>=97&&y<=122||y>=65&&y<=90||y>=48&&y<=57||y===95||y===36}function IA(m){return QA(m,dA)}function nA(m){const y=m.charCodeAt(0);return y>=97&&y<=122||y>=65&&y<=90||y>=48&&y<=57||y===95||y===36||y===45}function X(m){return QA(m,nA)}function tA(m){const y=m.charCodeAt(0);return y>=48&&y<=57}function fA(m){return QA(m,tA)}function Y(m){const y=m.charCodeAt(0);return y>=48&&y<=57||y>=65&&y<=70||y>=97&&y<=102}function W(m){return QA(m,Y)}function z(m){let y="",M="";for(;y=fA(m);)M+=y;return M}function DA(m){u(m);const y=m.currentChar();return y!=="%"&&l(pA.EXPECTED_TOKEN,o(),0,y),m.next(),"%"}function NA(m){let y="";for(;;){const M=m.currentChar();if(M==="{"||M==="}"||M==="@"||M==="|"||!M)break;if(M==="%")if(L(m))y+=M,m.next();else break;else if(M===Bt||M===de)if(L(m))y+=M,m.next();else{if(S(m))break;y+=M,m.next()}else y+=M,m.next()}return y}function ne(m){u(m);let y="",M="";for(;y=X(m);)M+=y;return m.currentChar()===Rt&&l(pA.UNTERMINATED_CLOSING_BRACE,o(),0),M}function LA(m){u(m);let y="";return m.currentChar()==="-"?(m.next(),y+=`-${z(m)}`):y+=z(m),m.currentChar()===Rt&&l(pA.UNTERMINATED_CLOSING_BRACE,o(),0),y}function H(m){return m!==cs&&m!==de}function $(m){u(m),h(m,"'");let y="",M="";for(;y=QA(m,H);)y==="\\"?M+=AA(m):M+=y;const O=m.currentChar();return O===de||O===Rt?(l(pA.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,o(),0),O===de&&(m.next(),h(m,"'")),M):(h(m,"'"),M)}function AA(m){const y=m.currentChar();switch(y){case"\\":case"'":return m.next(),`\\${y}`;case"u":return cA(m,y,4);case"U":return cA(m,y,6);default:return l(pA.UNKNOWN_ESCAPE_SEQUENCE,o(),0,y),""}}function cA(m,y,M){h(m,y);let O="";for(let oA=0;oA{const O=m.currentChar();return O==="{"||O==="%"||O==="@"||O==="|"||O==="("||O===")"||!O||O===Bt?M:(M+=O,m.next(),y(M))};return y("")}function x(m){u(m);const y=h(m,"|");return u(m),y}function q(m,y){let M=null;switch(m.currentChar()){case"{":return y.braceNest>=1&&l(pA.NOT_ALLOW_NEST_PLACEHOLDER,o(),0),m.next(),M=C(y,2,"{"),u(m),y.braceNest++,M;case"}":return y.braceNest>0&&y.currentType===2&&l(pA.EMPTY_PLACEHOLDER,o(),0),m.next(),M=C(y,3,"}"),y.braceNest--,y.braceNest>0&&u(m),y.inLinked&&y.braceNest===0&&(y.inLinked=!1),M;case"@":return y.braceNest>0&&l(pA.UNTERMINATED_CLOSING_BRACE,o(),0),M=V(m,y)||Q(y),y.braceNest=0,M;default:{let oA=!0,Z=!0,U=!0;if(S(m))return y.braceNest>0&&l(pA.UNTERMINATED_CLOSING_BRACE,o(),0),M=C(y,1,x(m)),y.braceNest=0,y.inLinked=!1,M;if(y.braceNest>0&&(y.currentType===5||y.currentType===6||y.currentType===7))return l(pA.UNTERMINATED_CLOSING_BRACE,o(),0),y.braceNest=0,iA(m,y);if(oA=c(m,y))return M=C(y,5,ne(m)),u(m),M;if(Z=d(m,y))return M=C(y,6,LA(m)),u(m),M;if(U=p(m,y))return M=C(y,7,$(m)),u(m),M;if(!oA&&!Z&&!U)return M=C(y,13,w(m)),l(pA.INVALID_TOKEN_IN_PLACEHOLDER,o(),0,M.value),u(m),M;break}}return M}function V(m,y){const{currentType:M}=y;let O=null;const oA=m.currentChar();switch((M===8||M===9||M===12||M===10)&&(oA===de||oA===Bt)&&l(pA.INVALID_LINKED_FORMAT,o(),0),oA){case"@":return m.next(),O=C(y,8,"@"),y.inLinked=!0,O;case".":return u(m),m.next(),C(y,9,".");case":":return u(m),m.next(),C(y,10,":");default:return S(m)?(O=C(y,1,x(m)),y.braceNest=0,y.inLinked=!1,O):v(m,y)||G(m,y)?(u(m),V(m,y)):N(m,y)?(u(m),C(y,12,R(m))):_(m,y)?(u(m),oA==="{"?q(m,y)||O:C(y,11,k(m))):(M===8&&l(pA.INVALID_LINKED_FORMAT,o(),0),y.braceNest=0,y.inLinked=!1,iA(m,y))}}function iA(m,y){let M={type:14};if(y.braceNest>0)return q(m,y)||Q(y);if(y.inLinked)return V(m,y)||Q(y);switch(m.currentChar()){case"{":return q(m,y)||Q(y);case"}":return l(pA.UNBALANCED_CLOSING_BRACE,o(),0),m.next(),C(y,3,"}");case"@":return V(m,y)||Q(y);default:{if(S(m))return M=C(y,1,x(m)),y.braceNest=0,y.inLinked=!1,M;const{isModulo:oA,hasSpace:Z}=b(m);if(oA)return Z?C(y,0,NA(m)):C(y,4,DA(m));if(L(m))return C(y,0,NA(m));break}}return M}function eA(){const{currentType:m,offset:y,startLoc:M,endLoc:O}=s;return s.lastType=m,s.lastOffset=y,s.lastStartLoc=M,s.lastEndLoc=O,s.offset=n(),s.startLoc=o(),i.currentChar()===Rt?C(s,14):iA(i,s)}return{nextToken:eA,currentOffset:n,currentPosition:o,context:a}}const Vc="parser",Wc=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g;function qc(A,e,t){switch(A){case"\\\\":return"\\";case"\\'":return"'";default:{const i=parseInt(e||t,16);return i<=55295||i>=57344?String.fromCodePoint(i):"�"}}}function jc(A={}){const e=A.location!==!1,{onError:t,onWarn:i}=A;function n(c,d,p,v,...N){const G=c.currentPosition();if(G.offset+=v,G.column+=v,t){const _=e?oo(p,G):null,S=Gi(d,_,{domain:Vc,args:N});t(S)}}function o(c,d,p,v,...N){const G=c.currentPosition();if(G.offset+=v,G.column+=v,i){const _=e?oo(p,G):null;i(Mc(d,_,N))}}function r(c,d,p){const v={type:c};return e&&(v.start=d,v.end=d,v.loc={start:p,end:p}),v}function g(c,d,p,v){e&&(c.end=d,c.loc&&(c.loc.end=p))}function s(c,d){const p=c.context(),v=r(3,p.offset,p.startLoc);return v.value=d,g(v,c.currentOffset(),c.currentPosition()),v}function a(c,d){const p=c.context(),{lastOffset:v,lastStartLoc:N}=p,G=r(5,v,N);return G.index=parseInt(d,10),c.nextToken(),g(G,c.currentOffset(),c.currentPosition()),G}function I(c,d,p){const v=c.context(),{lastOffset:N,lastStartLoc:G}=v,_=r(4,N,G);return _.key=d,p===!0&&(_.modulo=!0),c.nextToken(),g(_,c.currentOffset(),c.currentPosition()),_}function l(c,d){const p=c.context(),{lastOffset:v,lastStartLoc:N}=p,G=r(9,v,N);return G.value=d.replace(Wc,qc),c.nextToken(),g(G,c.currentOffset(),c.currentPosition()),G}function C(c){const d=c.nextToken(),p=c.context(),{lastOffset:v,lastStartLoc:N}=p,G=r(8,v,N);return d.type!==12?(n(c,pA.UNEXPECTED_EMPTY_LINKED_MODIFIER,p.lastStartLoc,0),G.value="",g(G,v,N),{nextConsumeToken:d,node:G}):(d.value==null&&n(c,pA.UNEXPECTED_LEXICAL_ANALYSIS,p.lastStartLoc,0,Te(d)),G.value=d.value||"",g(G,c.currentOffset(),c.currentPosition()),{node:G})}function Q(c,d){const p=c.context(),v=r(7,p.offset,p.startLoc);return v.value=d,g(v,c.currentOffset(),c.currentPosition()),v}function h(c){const d=c.context(),p=r(6,d.offset,d.startLoc);let v=c.nextToken();if(v.type===9){const N=C(c);p.modifier=N.node,v=N.nextConsumeToken||c.nextToken()}switch(v.type!==10&&n(c,pA.UNEXPECTED_LEXICAL_ANALYSIS,d.lastStartLoc,0,Te(v)),v=c.nextToken(),v.type===2&&(v=c.nextToken()),v.type){case 11:v.value==null&&n(c,pA.UNEXPECTED_LEXICAL_ANALYSIS,d.lastStartLoc,0,Te(v)),p.key=Q(c,v.value||"");break;case 5:v.value==null&&n(c,pA.UNEXPECTED_LEXICAL_ANALYSIS,d.lastStartLoc,0,Te(v)),p.key=I(c,v.value||"");break;case 6:v.value==null&&n(c,pA.UNEXPECTED_LEXICAL_ANALYSIS,d.lastStartLoc,0,Te(v)),p.key=a(c,v.value||"");break;case 7:v.value==null&&n(c,pA.UNEXPECTED_LEXICAL_ANALYSIS,d.lastStartLoc,0,Te(v)),p.key=l(c,v.value||"");break;default:{n(c,pA.UNEXPECTED_EMPTY_LINKED_KEY,d.lastStartLoc,0);const N=c.context(),G=r(7,N.offset,N.startLoc);return G.value="",g(G,N.offset,N.startLoc),p.key=G,g(p,N.offset,N.startLoc),{nextConsumeToken:v,node:p}}}return g(p,c.currentOffset(),c.currentPosition()),{node:p}}function f(c){const d=c.context(),p=d.currentType===1?c.currentOffset():d.offset,v=d.currentType===1?d.endLoc:d.startLoc,N=r(2,p,v);N.items=[];let G=null,_=null;do{const L=G||c.nextToken();switch(G=null,L.type){case 0:L.value==null&&n(c,pA.UNEXPECTED_LEXICAL_ANALYSIS,d.lastStartLoc,0,Te(L)),N.items.push(s(c,L.value||""));break;case 6:L.value==null&&n(c,pA.UNEXPECTED_LEXICAL_ANALYSIS,d.lastStartLoc,0,Te(L)),N.items.push(a(c,L.value||""));break;case 4:_=!0;break;case 5:L.value==null&&n(c,pA.UNEXPECTED_LEXICAL_ANALYSIS,d.lastStartLoc,0,Te(L)),N.items.push(I(c,L.value||"",!!_)),_&&(o(c,sg.USE_MODULO_SYNTAX,d.lastStartLoc,0,Te(L)),_=null);break;case 7:L.value==null&&n(c,pA.UNEXPECTED_LEXICAL_ANALYSIS,d.lastStartLoc,0,Te(L)),N.items.push(l(c,L.value||""));break;case 8:{const QA=h(c);N.items.push(QA.node),G=QA.nextConsumeToken||null;break}}}while(d.currentType!==14&&d.currentType!==1);const S=d.currentType===1?d.lastOffset:c.currentOffset(),b=d.currentType===1?d.lastEndLoc:c.currentPosition();return g(N,S,b),N}function u(c,d,p,v){const N=c.context();let G=v.items.length===0;const _=r(1,d,p);_.cases=[],_.cases.push(v);do{const S=f(c);G||(G=S.items.length===0),_.cases.push(S)}while(N.currentType!==14);return G&&n(c,pA.MUST_HAVE_MESSAGES_IN_PLURAL,p,0),g(_,c.currentOffset(),c.currentPosition()),_}function E(c){const d=c.context(),{offset:p,startLoc:v}=d,N=f(c);return d.currentType===14?N:u(c,p,v,N)}function D(c){const d=Pc(c,CC({},A)),p=d.context(),v=r(0,p.offset,p.startLoc);return e&&v.loc&&(v.loc.source=c),v.body=E(d),A.onCacheKey&&(v.cacheKey=A.onCacheKey(c)),p.currentType!==14&&n(d,pA.UNEXPECTED_LEXICAL_ANALYSIS,p.lastStartLoc,0,c[p.offset]||""),g(v,d.currentOffset(),d.currentPosition()),v}return{parse:D}}function Te(A){if(A.type===14)return"EOF";const e=(A.value||"").replace(/\r?\n/gu,"\\n");return e.length>10?e.slice(0,9)+"…":e}function Zc(A,e={}){const t={ast:A,helpers:new Set};return{context:()=>t,helper:o=>(t.helpers.add(o),o)}}function Es(A,e){for(let t=0;tus(t)),A}function us(A){if(A.items.length===1){const e=A.items[0];(e.type===3||e.type===9)&&(A.static=e.value,delete e.value)}else{const e=[];for(let t=0;tr;function s(f,u){r.code+=f}function a(f,u=!0){const E=u?i:"";s(n?E+" ".repeat(f):E)}function I(f=!0){const u=++r.indentLevel;f&&a(u)}function l(f=!0){const u=--r.indentLevel;f&&a(u)}function C(){a(r.indentLevel)}return{context:g,push:s,indent:I,deindent:l,newline:C,helper:f=>`_${f}`,needIndent:()=>r.needIndent}}function tE(A,e){const{helper:t}=A;A.push(`${t("linked")}(`),vi(A,e.key),e.modifier?(A.push(", "),vi(A,e.modifier),A.push(", _type")):A.push(", undefined, _type"),A.push(")")}function iE(A,e){const{helper:t,needIndent:i}=A;A.push(`${t("normalize")}([`),A.indent(i());const n=e.items.length;for(let o=0;o1){A.push(`${t("plural")}([`),A.indent(i());const n=e.cases.length;for(let o=0;o{const t=Qs(e.mode)?e.mode:"normal",i=Qs(e.filename)?e.filename:"message.intl";e.sourceMap;const n=e.breakLineCode!=null?e.breakLineCode:t==="arrow"?";":` `,o=e.needIndent?e.needIndent:t!=="arrow",r=A.helpers||[],g=eE(A,{filename:i,breakLineCode:n,needIndent:o});g.push(t==="normal"?"function __msg__ (ctx) {":"(ctx) => {"),g.indent(o),r.length>0&&(g.push(`const { ${lC(r.map(I=>`${I}: _${I}`),", ")} } = ctx`),g.newline()),g.push("return "),vi(g,A),g.deindent(o),g.push("}"),delete A.helpers;const{code:s,map:a}=g.context();return{ast:A,code:s,map:a?a.toJSON():void 0}};function gE(A,e={}){const t=CC({},e),i=!!t.jit,n=!!t.minify,o=t.optimize==null?!0:t.optimize,g=jc(t).parse(A);return i?(o&&zc(g),n&&Qi(g),{ast:g,code:""}):(Xc(g,t),rE(g,t))}/*! * core-base v9.14.5 * (c) 2025 kazuya kawaguchi * Released under the MIT License. - */function sE(){typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(ft().__INTLIFY_PROD_DEVTOOLS__=!1),typeof __INTLIFY_JIT_COMPILATION__!="boolean"&&(ft().__INTLIFY_JIT_COMPILATION__=!1),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(ft().__INTLIFY_DROP_MESSAGE_COMPILER__=!1)}function st(A){return UA(A)&&Ig(A)===0&&(He(A,"b")||He(A,"body"))}const BC=["b","body"];function aE(A){return Wt(A,BC)}const QC=["c","cases"];function IE(A){return Wt(A,QC,[])}const cC=["s","static"];function CE(A){return Wt(A,cC)}const EC=["i","items"];function lE(A){return Wt(A,EC,[])}const uC=["t","type"];function Ig(A){return Wt(A,uC)}const hC=["v","value"];function bn(A,e){const t=Wt(A,hC);if(t!=null)return t;throw on(e)}const fC=["m","modifier"];function BE(A){return Wt(A,fC)}const dC=["k","key"];function QE(A){const e=Wt(A,dC);if(e)return e;throw on(6)}function Wt(A,e,t){for(let i=0;i{r===void 0?r=g:r+=g},C[1]=()=>{r!==void 0&&(e.push(r),r=void 0)},C[2]=()=>{C[0](),n++},C[3]=()=>{if(n>0)n--,i=4,C[0]();else{if(n=0,r===void 0||(r=fE(r),r===!1))return!1;C[1]()}};function Q(){const h=A[t+1];if(i===5&&h==="'"||i===6&&h==='"')return t++,g="\\"+h,C[0](),!0}for(;i!==null;)if(t++,o=A[t],!(o==="\\"&&Q())){if(s=hE(o),l=qt[i],a=l[s]||l.l||8,a===8||(i=a[0],a[1]!==void 0&&(I=C[a[1]],I&&(g=o,I()===!1))))return;if(i===7)return e}}const hs=new Map;function pE(A,e){return UA(A)?A[e]:null}function mE(A,e){if(!UA(A))return null;let t=hs.get(e);if(t||(t=dE(e),t&&hs.set(e,t)),!t)return null;const i=t.length;let n=A,o=0;for(;oA,wE=A=>"",DE="text",kE=A=>A.length===0?"":bc(A),vE=Rc;function fs(A,e){return A=Math.abs(A),e===2?A?A>1?1:0:1:A?Math.min(A,2):0}function FE(A){const e=Ae(A.pluralIndex)?A.pluralIndex:-1;return A.named&&(Ae(A.named.count)||Ae(A.named.n))?Ae(A.named.count)?A.named.count:Ae(A.named.n)?A.named.n:e:e}function SE(A,e){e.count||(e.count=A),e.n||(e.n=A)}function RE(A={}){const e=A.locale,t=FE(A),i=UA(A.pluralRules)&&gA(e)&&PA(A.pluralRules[e])?A.pluralRules[e]:fs,n=UA(A.pluralRules)&&gA(e)&&PA(A.pluralRules[e])?fs:void 0,o=E=>E[i(t,E.length,n)],r=A.list||[],g=E=>r[E],s=A.named||HA();Ae(A.pluralIndex)&&SE(t,s);const a=E=>s[E];function I(E){const m=PA(A.messages)?A.messages(E):UA(A.messages)?A.messages[E]:!1;return m||(A.parent?A.parent.message(E):wE)}const l=E=>A.modifiers?A.modifiers[E]:yE,C=vA(A.processor)&&PA(A.processor.normalize)?A.processor.normalize:kE,Q=vA(A.processor)&&PA(A.processor.interpolate)?A.processor.interpolate:vE,h=vA(A.processor)&&gA(A.processor.type)?A.processor.type:DE,u={list:g,named:a,plural:o,linked:(E,...m)=>{const[c,d]=m;let w="text",F="";m.length===1?UA(c)?(F=c.modifier||F,w=c.type||w):gA(c)&&(F=c||F):m.length===2&&(gA(c)&&(F=c||F),gA(d)&&(w=d||w));const N=I(E)(u),G=w==="vnode"&&WA(N)&&F?N[0]:N;return F?l(F)(G,w):G},message:I,type:h,interpolate:Q,normalize:C,values:Be(HA(),r,s)};return u}let rn=null;function bE(A){rn=A}function NE(A,e,t){rn&&rn.emit("i18n:init",{timestamp:Date.now(),i18n:A,version:e,meta:t})}const GE=LE("function:translate");function LE(A){return e=>rn&&rn.emit(A,e)}const UE=sg.__EXTEND_POINT__,zt=Fo(UE),ME={FALLBACK_TO_TRANSLATE:zt(),CANNOT_FORMAT_NUMBER:zt(),FALLBACK_TO_NUMBER_FORMAT:zt(),CANNOT_FORMAT_DATE:zt(),FALLBACK_TO_DATE_FORMAT:zt(),EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER:zt(),__EXTEND_POINT__:zt()},mC=pA.__EXTEND_POINT__,$t=Fo(mC),Ye={INVALID_ARGUMENT:mC,INVALID_DATE_ARGUMENT:$t(),INVALID_ISO_DATE_ARGUMENT:$t(),NOT_SUPPORT_NON_STRING_MESSAGE:$t(),NOT_SUPPORT_LOCALE_PROMISE_VALUE:$t(),NOT_SUPPORT_LOCALE_ASYNC_FUNCTION:$t(),NOT_SUPPORT_LOCALE_TYPE:$t(),__EXTEND_POINT__:$t()};function it(A){return Gi(A,null,void 0)}function Cg(A,e){return e.locale!=null?ds(e.locale):ds(A.locale)}let Vo;function ds(A){if(gA(A))return A;if(PA(A)){if(A.resolvedOnce&&Vo!=null)return Vo;if(A.constructor.name==="Function"){const e=A();if(Sc(e))throw it(Ye.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return Vo=e}else throw it(Ye.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}else throw it(Ye.NOT_SUPPORT_LOCALE_TYPE)}function xE(A,e,t){return[...new Set([t,...WA(e)?e:UA(e)?Object.keys(e):gA(e)?[e]:[t]])]}function yC(A,e,t){const i=gA(t)?t:Fi,n=A;n.__localeChainCache||(n.__localeChainCache=new Map);let o=n.__localeChainCache.get(i);if(!o){o=[];let r=[t];for(;WA(r);)r=ps(o,r,e);const g=WA(e)||!vA(e)?e:e.default?e.default:null;r=gA(g)?[g]:g,WA(r)&&ps(o,r,!1),n.__localeChainCache.set(i,o)}return o}function ps(A,e,t){let i=!0;for(let n=0;n`${A.charAt(0).toLocaleUpperCase()}${A.substr(1)}`;function YE(){return{upper:(A,e)=>e==="text"&&gA(A)?A.toUpperCase():e==="vnode"&&UA(A)&&"__v_isVNode"in A?A.children.toUpperCase():A,lower:(A,e)=>e==="text"&&gA(A)?A.toLowerCase():e==="vnode"&&UA(A)&&"__v_isVNode"in A?A.children.toLowerCase():A,capitalize:(A,e)=>e==="text"&&gA(A)?ys(A):e==="vnode"&&UA(A)&&"__v_isVNode"in A?ys(A.children):A}}let wC;function ws(A){wC=A}let DC;function _E(A){DC=A}let kC;function KE(A){kC=A}let vC=null;const OE=A=>{vC=A},PE=()=>vC;let FC=null;const Ds=A=>{FC=A},VE=()=>FC;let ks=0;function WE(A={}){const e=PA(A.onWarn)?A.onWarn:mc,t=gA(A.version)?A.version:HE,i=gA(A.locale)||PA(A.locale)?A.locale:Fi,n=PA(i)?Fi:i,o=WA(A.fallbackLocale)||vA(A.fallbackLocale)||gA(A.fallbackLocale)||A.fallbackLocale===!1?A.fallbackLocale:n,r=vA(A.messages)?A.messages:Wo(n),g=vA(A.datetimeFormats)?A.datetimeFormats:Wo(n),s=vA(A.numberFormats)?A.numberFormats:Wo(n),a=Be(HA(),A.modifiers,YE()),I=A.pluralRules||HA(),l=PA(A.missing)?A.missing:null,C=RA(A.missingWarn)||Ot(A.missingWarn)?A.missingWarn:!0,Q=RA(A.fallbackWarn)||Ot(A.fallbackWarn)?A.fallbackWarn:!0,h=!!A.fallbackFormat,f=!!A.unresolving,u=PA(A.postTranslation)?A.postTranslation:null,E=vA(A.processor)?A.processor:null,m=RA(A.warnHtmlMessage)?A.warnHtmlMessage:!0,c=!!A.escapeParameter,d=PA(A.messageCompiler)?A.messageCompiler:wC,w=PA(A.messageResolver)?A.messageResolver:DC||pE,F=PA(A.localeFallbacker)?A.localeFallbacker:kC||xE,N=UA(A.fallbackContext)?A.fallbackContext:void 0,G=A,K=UA(G.__datetimeFormatters)?G.__datetimeFormatters:new Map,R=UA(G.__numberFormatters)?G.__numberFormatters:new Map,b=UA(G.__meta)?G.__meta:{};ks++;const L={version:t,cid:ks,locale:i,fallbackLocale:o,messages:r,modifiers:a,pluralRules:I,missing:l,missingWarn:C,fallbackWarn:Q,fallbackFormat:h,unresolving:f,postTranslation:u,processor:E,warnHtmlMessage:m,escapeParameter:c,messageCompiler:d,messageResolver:w,localeFallbacker:F,fallbackContext:N,onWarn:e,__meta:b};return L.datetimeFormats=g,L.numberFormats=s,L.__datetimeFormatters=K,L.__numberFormatters=R,__INTLIFY_PROD_DEVTOOLS__&&NE(L,t,b),L}const Wo=A=>({[A]:HA()});function lg(A,e,t,i,n){const{missing:o,onWarn:r}=A;if(o!==null){const g=o(A,t,e,n);return gA(g)?g:e}else return e}function Ji(A,e,t){const i=A;i.__localeChainCache=new Map,A.localeFallbacker(A,t,e)}function qE(A,e){return A===e?!1:A.split("-")[0]===e.split("-")[0]}function jE(A,e){const t=e.indexOf(A);if(t===-1)return!1;for(let i=t+1;iZE(t,A)}function ZE(A,e){const t=aE(e);if(t==null)throw on(0);if(Ig(t)===1){const o=IE(t);return A.plural(o.reduce((r,g)=>[...r,vs(A,g)],[]))}else return vs(A,t)}function vs(A,e){const t=CE(e);if(t!=null)return A.type==="text"?t:A.normalize([t]);{const i=lE(e).reduce((n,o)=>[...n,pr(A,o)],[]);return A.normalize(i)}}function pr(A,e){const t=Ig(e);switch(t){case 3:return bn(e,t);case 9:return bn(e,t);case 4:{const i=e;if(He(i,"k")&&i.k)return A.interpolate(A.named(i.k));if(He(i,"key")&&i.key)return A.interpolate(A.named(i.key));throw on(t)}case 5:{const i=e;if(He(i,"i")&&Ae(i.i))return A.interpolate(A.list(i.i));if(He(i,"index")&&Ae(i.index))return A.interpolate(A.list(i.index));throw on(t)}case 6:{const i=e,n=BE(i),o=QE(i);return A.linked(pr(A,o),n?pr(A,n):void 0,A.type)}case 7:return bn(e,t);case 8:return bn(e,t);default:throw new Error(`unhandled node on format message part: ${t}`)}}const SC=A=>A;let Ei=HA();function RC(A,e={}){let t=!1;const i=e.onError||Jc;return e.onError=n=>{t=!0,i(n)},{...gE(A,e),detectError:t}}const XE=(A,e)=>{if(!gA(A))throw it(Ye.NOT_SUPPORT_NON_STRING_MESSAGE);{RA(e.warnHtmlMessage)&&e.warnHtmlMessage;const i=(e.onCacheKey||SC)(A),n=Ei[i];if(n)return n;const{code:o,detectError:r}=RC(A,e),g=new Function(`return ${o}`)();return r?g:Ei[i]=g}};function zE(A,e){if(__INTLIFY_JIT_COMPILATION__&&!__INTLIFY_DROP_MESSAGE_COMPILER__&&gA(A)){RA(e.warnHtmlMessage)&&e.warnHtmlMessage;const i=(e.onCacheKey||SC)(A),n=Ei[i];if(n)return n;const{ast:o,detectError:r}=RC(A,{...e,location:!1,jit:!0}),g=qo(o);return r?g:Ei[i]=g}else{const t=A.cacheKey;if(t){const i=Ei[t];return i||(Ei[t]=qo(A))}else return qo(A)}}const Fs=()=>"",Me=A=>PA(A);function Ss(A,...e){const{fallbackFormat:t,postTranslation:i,unresolving:n,messageCompiler:o,fallbackLocale:r,messages:g}=A,[s,a]=mr(...e),I=RA(a.missingWarn)?a.missingWarn:A.missingWarn,l=RA(a.fallbackWarn)?a.fallbackWarn:A.fallbackWarn,C=RA(a.escapeParameter)?a.escapeParameter:A.escapeParameter,Q=!!a.resolvedMessage,h=gA(a.default)||RA(a.default)?RA(a.default)?o?s:()=>s:a.default:t?o?s:()=>s:"",f=t||h!=="",u=Cg(A,a);C&&$E(a);let[E,m,c]=Q?[s,u,g[u]||HA()]:bC(A,s,u,r,l,I),d=E,w=s;if(!Q&&!(gA(d)||st(d)||Me(d))&&f&&(d=h,w=d),!Q&&(!(gA(d)||st(d)||Me(d))||!gA(m)))return n?So:s;let F=!1;const N=()=>{F=!0},G=Me(d)?d:NC(A,s,m,d,w,N);if(F)return d;const K=tu(A,m,c,a),R=RE(K),b=Au(A,G,R);let L=i?i(b,s):b;if(C&&gA(L)&&(L=vc(L)),__INTLIFY_PROD_DEVTOOLS__){const EA={timestamp:Date.now(),key:gA(s)?s:Me(d)?d.key:"",locale:m||(Me(d)?d.locale:""),format:gA(d)?d:Me(d)?d.source:"",message:L};EA.meta=Be({},A.__meta,PE()||{}),GE(EA)}return L}function $E(A){WA(A.list)?A.list=A.list.map(e=>gA(e)?ls(e):e):UA(A.named)&&Object.keys(A.named).forEach(e=>{gA(A.named[e])&&(A.named[e]=ls(A.named[e]))})}function bC(A,e,t,i,n,o){const{messages:r,onWarn:g,messageResolver:s,localeFallbacker:a}=A,I=a(A,i,t);let l=HA(),C,Q=null;const h="translate";for(let f=0;fi;return a.locale=t,a.key=e,a}const s=r(i,eu(A,t,n,i,g,o));return s.locale=t,s.key=e,s.source=i,s}function Au(A,e,t){return e(t)}function mr(...A){const[e,t,i]=A,n=HA();if(!gA(e)&&!Ae(e)&&!Me(e)&&!st(e))throw it(Ye.INVALID_ARGUMENT);const o=Ae(e)?String(e):(Me(e),e);return Ae(t)?n.plural=t:gA(t)?n.default=t:vA(t)&&!vo(t)?n.named=t:WA(t)&&(n.list=t),Ae(i)?n.plural=i:gA(i)?n.default=i:vA(i)&&Be(n,i),[o,n]}function eu(A,e,t,i,n,o){return{locale:e,key:t,warnHtmlMessage:n,onError:r=>{throw o&&o(r),r},onCacheKey:r=>yc(e,t,r)}}function tu(A,e,t,i){const{modifiers:n,pluralRules:o,messageResolver:r,fallbackLocale:g,fallbackWarn:s,missingWarn:a,fallbackContext:I}=A,C={locale:e,modifiers:n,pluralRules:o,messages:Q=>{let h=r(t,Q);if(h==null&&I){const[,,f]=bC(I,Q,e,g,s,a);h=r(f,Q)}if(gA(h)||st(h)){let f=!1;const E=NC(A,Q,e,h,Q,()=>{f=!0});return f?Fs:E}else return Me(h)?h:Fs}};return A.processor&&(C.processor=A.processor),i.list&&(C.list=i.list),i.named&&(C.named=i.named),Ae(i.plural)&&(C.pluralIndex=i.plural),C}function Rs(A,...e){const{datetimeFormats:t,unresolving:i,fallbackLocale:n,onWarn:o,localeFallbacker:r}=A,{__datetimeFormatters:g}=A,[s,a,I,l]=yr(...e),C=RA(I.missingWarn)?I.missingWarn:A.missingWarn;RA(I.fallbackWarn)?I.fallbackWarn:A.fallbackWarn;const Q=!!I.part,h=Cg(A,I),f=r(A,n,h);if(!gA(s)||s==="")return new Intl.DateTimeFormat(h,l).format(a);let u={},E,m=null;const c="datetime format";for(let F=0;F{GC.includes(s)?r[s]=t[s]:o[s]=t[s]}),gA(i)?o.locale=i:vA(i)&&(r=i),vA(n)&&(r=n),[o.key||"",g,o,r]}function bs(A,e,t){const i=A;for(const n in t){const o=`${e}__${n}`;i.__datetimeFormatters.has(o)&&i.__datetimeFormatters.delete(o)}}function Ns(A,...e){const{numberFormats:t,unresolving:i,fallbackLocale:n,onWarn:o,localeFallbacker:r}=A,{__numberFormatters:g}=A,[s,a,I,l]=wr(...e),C=RA(I.missingWarn)?I.missingWarn:A.missingWarn;RA(I.fallbackWarn)?I.fallbackWarn:A.fallbackWarn;const Q=!!I.part,h=Cg(A,I),f=r(A,n,h);if(!gA(s)||s==="")return new Intl.NumberFormat(h,l).format(a);let u={},E,m=null;const c="number format";for(let F=0;F{LC.includes(s)?r[s]=t[s]:o[s]=t[s]}),gA(i)?o.locale=i:vA(i)&&(r=i),vA(n)&&(r=n),[o.key||"",g,o,r]}function Gs(A,e,t){const i=A;for(const n in t){const o=`${e}__${n}`;i.__numberFormatters.has(o)&&i.__numberFormatters.delete(o)}}sE();/*! + */function sE(){typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(ft().__INTLIFY_PROD_DEVTOOLS__=!1),typeof __INTLIFY_JIT_COMPILATION__!="boolean"&&(ft().__INTLIFY_JIT_COMPILATION__=!1),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(ft().__INTLIFY_DROP_MESSAGE_COMPILER__=!1)}function st(A){return UA(A)&&Ig(A)===0&&(He(A,"b")||He(A,"body"))}const BC=["b","body"];function aE(A){return Wt(A,BC)}const QC=["c","cases"];function IE(A){return Wt(A,QC,[])}const cC=["s","static"];function CE(A){return Wt(A,cC)}const EC=["i","items"];function lE(A){return Wt(A,EC,[])}const uC=["t","type"];function Ig(A){return Wt(A,uC)}const hC=["v","value"];function bn(A,e){const t=Wt(A,hC);if(t!=null)return t;throw on(e)}const fC=["m","modifier"];function BE(A){return Wt(A,fC)}const dC=["k","key"];function QE(A){const e=Wt(A,dC);if(e)return e;throw on(6)}function Wt(A,e,t){for(let i=0;i{r===void 0?r=g:r+=g},C[1]=()=>{r!==void 0&&(e.push(r),r=void 0)},C[2]=()=>{C[0](),n++},C[3]=()=>{if(n>0)n--,i=4,C[0]();else{if(n=0,r===void 0||(r=fE(r),r===!1))return!1;C[1]()}};function Q(){const h=A[t+1];if(i===5&&h==="'"||i===6&&h==='"')return t++,g="\\"+h,C[0](),!0}for(;i!==null;)if(t++,o=A[t],!(o==="\\"&&Q())){if(s=hE(o),l=qt[i],a=l[s]||l.l||8,a===8||(i=a[0],a[1]!==void 0&&(I=C[a[1]],I&&(g=o,I()===!1))))return;if(i===7)return e}}const hs=new Map;function pE(A,e){return UA(A)?A[e]:null}function mE(A,e){if(!UA(A))return null;let t=hs.get(e);if(t||(t=dE(e),t&&hs.set(e,t)),!t)return null;const i=t.length;let n=A,o=0;for(;oA,wE=A=>"",DE="text",kE=A=>A.length===0?"":bc(A),vE=Rc;function fs(A,e){return A=Math.abs(A),e===2?A?A>1?1:0:1:A?Math.min(A,2):0}function FE(A){const e=Ae(A.pluralIndex)?A.pluralIndex:-1;return A.named&&(Ae(A.named.count)||Ae(A.named.n))?Ae(A.named.count)?A.named.count:Ae(A.named.n)?A.named.n:e:e}function SE(A,e){e.count||(e.count=A),e.n||(e.n=A)}function RE(A={}){const e=A.locale,t=FE(A),i=UA(A.pluralRules)&&gA(e)&&PA(A.pluralRules[e])?A.pluralRules[e]:fs,n=UA(A.pluralRules)&&gA(e)&&PA(A.pluralRules[e])?fs:void 0,o=E=>E[i(t,E.length,n)],r=A.list||[],g=E=>r[E],s=A.named||HA();Ae(A.pluralIndex)&&SE(t,s);const a=E=>s[E];function I(E){const D=PA(A.messages)?A.messages(E):UA(A.messages)?A.messages[E]:!1;return D||(A.parent?A.parent.message(E):wE)}const l=E=>A.modifiers?A.modifiers[E]:yE,C=vA(A.processor)&&PA(A.processor.normalize)?A.processor.normalize:kE,Q=vA(A.processor)&&PA(A.processor.interpolate)?A.processor.interpolate:vE,h=vA(A.processor)&&gA(A.processor.type)?A.processor.type:DE,u={list:g,named:a,plural:o,linked:(E,...D)=>{const[c,d]=D;let p="text",v="";D.length===1?UA(c)?(v=c.modifier||v,p=c.type||p):gA(c)&&(v=c||v):D.length===2&&(gA(c)&&(v=c||v),gA(d)&&(p=d||p));const N=I(E)(u),G=p==="vnode"&&WA(N)&&v?N[0]:N;return v?l(v)(G,p):G},message:I,type:h,interpolate:Q,normalize:C,values:Be(HA(),r,s)};return u}let rn=null;function bE(A){rn=A}function NE(A,e,t){rn&&rn.emit("i18n:init",{timestamp:Date.now(),i18n:A,version:e,meta:t})}const GE=LE("function:translate");function LE(A){return e=>rn&&rn.emit(A,e)}const UE=sg.__EXTEND_POINT__,zt=Fo(UE),ME={FALLBACK_TO_TRANSLATE:zt(),CANNOT_FORMAT_NUMBER:zt(),FALLBACK_TO_NUMBER_FORMAT:zt(),CANNOT_FORMAT_DATE:zt(),FALLBACK_TO_DATE_FORMAT:zt(),EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER:zt(),__EXTEND_POINT__:zt()},mC=pA.__EXTEND_POINT__,$t=Fo(mC),Ye={INVALID_ARGUMENT:mC,INVALID_DATE_ARGUMENT:$t(),INVALID_ISO_DATE_ARGUMENT:$t(),NOT_SUPPORT_NON_STRING_MESSAGE:$t(),NOT_SUPPORT_LOCALE_PROMISE_VALUE:$t(),NOT_SUPPORT_LOCALE_ASYNC_FUNCTION:$t(),NOT_SUPPORT_LOCALE_TYPE:$t(),__EXTEND_POINT__:$t()};function it(A){return Gi(A,null,void 0)}function Cg(A,e){return e.locale!=null?ds(e.locale):ds(A.locale)}let Vo;function ds(A){if(gA(A))return A;if(PA(A)){if(A.resolvedOnce&&Vo!=null)return Vo;if(A.constructor.name==="Function"){const e=A();if(Sc(e))throw it(Ye.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return Vo=e}else throw it(Ye.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}else throw it(Ye.NOT_SUPPORT_LOCALE_TYPE)}function xE(A,e,t){return[...new Set([t,...WA(e)?e:UA(e)?Object.keys(e):gA(e)?[e]:[t]])]}function yC(A,e,t){const i=gA(t)?t:Fi,n=A;n.__localeChainCache||(n.__localeChainCache=new Map);let o=n.__localeChainCache.get(i);if(!o){o=[];let r=[t];for(;WA(r);)r=ps(o,r,e);const g=WA(e)||!vA(e)?e:e.default?e.default:null;r=gA(g)?[g]:g,WA(r)&&ps(o,r,!1),n.__localeChainCache.set(i,o)}return o}function ps(A,e,t){let i=!0;for(let n=0;n`${A.charAt(0).toLocaleUpperCase()}${A.substr(1)}`;function YE(){return{upper:(A,e)=>e==="text"&&gA(A)?A.toUpperCase():e==="vnode"&&UA(A)&&"__v_isVNode"in A?A.children.toUpperCase():A,lower:(A,e)=>e==="text"&&gA(A)?A.toLowerCase():e==="vnode"&&UA(A)&&"__v_isVNode"in A?A.children.toLowerCase():A,capitalize:(A,e)=>e==="text"&&gA(A)?ys(A):e==="vnode"&&UA(A)&&"__v_isVNode"in A?ys(A.children):A}}let wC;function ws(A){wC=A}let DC;function _E(A){DC=A}let kC;function KE(A){kC=A}let vC=null;const OE=A=>{vC=A},PE=()=>vC;let FC=null;const Ds=A=>{FC=A},VE=()=>FC;let ks=0;function WE(A={}){const e=PA(A.onWarn)?A.onWarn:mc,t=gA(A.version)?A.version:HE,i=gA(A.locale)||PA(A.locale)?A.locale:Fi,n=PA(i)?Fi:i,o=WA(A.fallbackLocale)||vA(A.fallbackLocale)||gA(A.fallbackLocale)||A.fallbackLocale===!1?A.fallbackLocale:n,r=vA(A.messages)?A.messages:Wo(n),g=vA(A.datetimeFormats)?A.datetimeFormats:Wo(n),s=vA(A.numberFormats)?A.numberFormats:Wo(n),a=Be(HA(),A.modifiers,YE()),I=A.pluralRules||HA(),l=PA(A.missing)?A.missing:null,C=RA(A.missingWarn)||Ot(A.missingWarn)?A.missingWarn:!0,Q=RA(A.fallbackWarn)||Ot(A.fallbackWarn)?A.fallbackWarn:!0,h=!!A.fallbackFormat,f=!!A.unresolving,u=PA(A.postTranslation)?A.postTranslation:null,E=vA(A.processor)?A.processor:null,D=RA(A.warnHtmlMessage)?A.warnHtmlMessage:!0,c=!!A.escapeParameter,d=PA(A.messageCompiler)?A.messageCompiler:wC,p=PA(A.messageResolver)?A.messageResolver:DC||pE,v=PA(A.localeFallbacker)?A.localeFallbacker:kC||xE,N=UA(A.fallbackContext)?A.fallbackContext:void 0,G=A,_=UA(G.__datetimeFormatters)?G.__datetimeFormatters:new Map,S=UA(G.__numberFormatters)?G.__numberFormatters:new Map,b=UA(G.__meta)?G.__meta:{};ks++;const L={version:t,cid:ks,locale:i,fallbackLocale:o,messages:r,modifiers:a,pluralRules:I,missing:l,missingWarn:C,fallbackWarn:Q,fallbackFormat:h,unresolving:f,postTranslation:u,processor:E,warnHtmlMessage:D,escapeParameter:c,messageCompiler:d,messageResolver:p,localeFallbacker:v,fallbackContext:N,onWarn:e,__meta:b};return L.datetimeFormats=g,L.numberFormats=s,L.__datetimeFormatters=_,L.__numberFormatters=S,__INTLIFY_PROD_DEVTOOLS__&&NE(L,t,b),L}const Wo=A=>({[A]:HA()});function lg(A,e,t,i,n){const{missing:o,onWarn:r}=A;if(o!==null){const g=o(A,t,e,n);return gA(g)?g:e}else return e}function Ji(A,e,t){const i=A;i.__localeChainCache=new Map,A.localeFallbacker(A,t,e)}function qE(A,e){return A===e?!1:A.split("-")[0]===e.split("-")[0]}function jE(A,e){const t=e.indexOf(A);if(t===-1)return!1;for(let i=t+1;iZE(t,A)}function ZE(A,e){const t=aE(e);if(t==null)throw on(0);if(Ig(t)===1){const o=IE(t);return A.plural(o.reduce((r,g)=>[...r,vs(A,g)],[]))}else return vs(A,t)}function vs(A,e){const t=CE(e);if(t!=null)return A.type==="text"?t:A.normalize([t]);{const i=lE(e).reduce((n,o)=>[...n,pr(A,o)],[]);return A.normalize(i)}}function pr(A,e){const t=Ig(e);switch(t){case 3:return bn(e,t);case 9:return bn(e,t);case 4:{const i=e;if(He(i,"k")&&i.k)return A.interpolate(A.named(i.k));if(He(i,"key")&&i.key)return A.interpolate(A.named(i.key));throw on(t)}case 5:{const i=e;if(He(i,"i")&&Ae(i.i))return A.interpolate(A.list(i.i));if(He(i,"index")&&Ae(i.index))return A.interpolate(A.list(i.index));throw on(t)}case 6:{const i=e,n=BE(i),o=QE(i);return A.linked(pr(A,o),n?pr(A,n):void 0,A.type)}case 7:return bn(e,t);case 8:return bn(e,t);default:throw new Error(`unhandled node on format message part: ${t}`)}}const SC=A=>A;let Ei=HA();function RC(A,e={}){let t=!1;const i=e.onError||Jc;return e.onError=n=>{t=!0,i(n)},{...gE(A,e),detectError:t}}const XE=(A,e)=>{if(!gA(A))throw it(Ye.NOT_SUPPORT_NON_STRING_MESSAGE);{RA(e.warnHtmlMessage)&&e.warnHtmlMessage;const i=(e.onCacheKey||SC)(A),n=Ei[i];if(n)return n;const{code:o,detectError:r}=RC(A,e),g=new Function(`return ${o}`)();return r?g:Ei[i]=g}};function zE(A,e){if(__INTLIFY_JIT_COMPILATION__&&!__INTLIFY_DROP_MESSAGE_COMPILER__&&gA(A)){RA(e.warnHtmlMessage)&&e.warnHtmlMessage;const i=(e.onCacheKey||SC)(A),n=Ei[i];if(n)return n;const{ast:o,detectError:r}=RC(A,{...e,location:!1,jit:!0}),g=qo(o);return r?g:Ei[i]=g}else{const t=A.cacheKey;if(t){const i=Ei[t];return i||(Ei[t]=qo(A))}else return qo(A)}}const Fs=()=>"",Me=A=>PA(A);function Ss(A,...e){const{fallbackFormat:t,postTranslation:i,unresolving:n,messageCompiler:o,fallbackLocale:r,messages:g}=A,[s,a]=mr(...e),I=RA(a.missingWarn)?a.missingWarn:A.missingWarn,l=RA(a.fallbackWarn)?a.fallbackWarn:A.fallbackWarn,C=RA(a.escapeParameter)?a.escapeParameter:A.escapeParameter,Q=!!a.resolvedMessage,h=gA(a.default)||RA(a.default)?RA(a.default)?o?s:()=>s:a.default:t?o?s:()=>s:"",f=t||h!=="",u=Cg(A,a);C&&$E(a);let[E,D,c]=Q?[s,u,g[u]||HA()]:bC(A,s,u,r,l,I),d=E,p=s;if(!Q&&!(gA(d)||st(d)||Me(d))&&f&&(d=h,p=d),!Q&&(!(gA(d)||st(d)||Me(d))||!gA(D)))return n?So:s;let v=!1;const N=()=>{v=!0},G=Me(d)?d:NC(A,s,D,d,p,N);if(v)return d;const _=tu(A,D,c,a),S=RE(_),b=Au(A,G,S);let L=i?i(b,s):b;if(C&&gA(L)&&(L=vc(L)),__INTLIFY_PROD_DEVTOOLS__){const QA={timestamp:Date.now(),key:gA(s)?s:Me(d)?d.key:"",locale:D||(Me(d)?d.locale:""),format:gA(d)?d:Me(d)?d.source:"",message:L};QA.meta=Be({},A.__meta,PE()||{}),GE(QA)}return L}function $E(A){WA(A.list)?A.list=A.list.map(e=>gA(e)?ls(e):e):UA(A.named)&&Object.keys(A.named).forEach(e=>{gA(A.named[e])&&(A.named[e]=ls(A.named[e]))})}function bC(A,e,t,i,n,o){const{messages:r,onWarn:g,messageResolver:s,localeFallbacker:a}=A,I=a(A,i,t);let l=HA(),C,Q=null;const h="translate";for(let f=0;fi;return a.locale=t,a.key=e,a}const s=r(i,eu(A,t,n,i,g,o));return s.locale=t,s.key=e,s.source=i,s}function Au(A,e,t){return e(t)}function mr(...A){const[e,t,i]=A,n=HA();if(!gA(e)&&!Ae(e)&&!Me(e)&&!st(e))throw it(Ye.INVALID_ARGUMENT);const o=Ae(e)?String(e):(Me(e),e);return Ae(t)?n.plural=t:gA(t)?n.default=t:vA(t)&&!vo(t)?n.named=t:WA(t)&&(n.list=t),Ae(i)?n.plural=i:gA(i)?n.default=i:vA(i)&&Be(n,i),[o,n]}function eu(A,e,t,i,n,o){return{locale:e,key:t,warnHtmlMessage:n,onError:r=>{throw o&&o(r),r},onCacheKey:r=>yc(e,t,r)}}function tu(A,e,t,i){const{modifiers:n,pluralRules:o,messageResolver:r,fallbackLocale:g,fallbackWarn:s,missingWarn:a,fallbackContext:I}=A,C={locale:e,modifiers:n,pluralRules:o,messages:Q=>{let h=r(t,Q);if(h==null&&I){const[,,f]=bC(I,Q,e,g,s,a);h=r(f,Q)}if(gA(h)||st(h)){let f=!1;const E=NC(A,Q,e,h,Q,()=>{f=!0});return f?Fs:E}else return Me(h)?h:Fs}};return A.processor&&(C.processor=A.processor),i.list&&(C.list=i.list),i.named&&(C.named=i.named),Ae(i.plural)&&(C.pluralIndex=i.plural),C}function Rs(A,...e){const{datetimeFormats:t,unresolving:i,fallbackLocale:n,onWarn:o,localeFallbacker:r}=A,{__datetimeFormatters:g}=A,[s,a,I,l]=yr(...e),C=RA(I.missingWarn)?I.missingWarn:A.missingWarn;RA(I.fallbackWarn)?I.fallbackWarn:A.fallbackWarn;const Q=!!I.part,h=Cg(A,I),f=r(A,n,h);if(!gA(s)||s==="")return new Intl.DateTimeFormat(h,l).format(a);let u={},E,D=null;const c="datetime format";for(let v=0;v{GC.includes(s)?r[s]=t[s]:o[s]=t[s]}),gA(i)?o.locale=i:vA(i)&&(r=i),vA(n)&&(r=n),[o.key||"",g,o,r]}function bs(A,e,t){const i=A;for(const n in t){const o=`${e}__${n}`;i.__datetimeFormatters.has(o)&&i.__datetimeFormatters.delete(o)}}function Ns(A,...e){const{numberFormats:t,unresolving:i,fallbackLocale:n,onWarn:o,localeFallbacker:r}=A,{__numberFormatters:g}=A,[s,a,I,l]=wr(...e),C=RA(I.missingWarn)?I.missingWarn:A.missingWarn;RA(I.fallbackWarn)?I.fallbackWarn:A.fallbackWarn;const Q=!!I.part,h=Cg(A,I),f=r(A,n,h);if(!gA(s)||s==="")return new Intl.NumberFormat(h,l).format(a);let u={},E,D=null;const c="number format";for(let v=0;v{LC.includes(s)?r[s]=t[s]:o[s]=t[s]}),gA(i)?o.locale=i:vA(i)&&(r=i),vA(n)&&(r=n),[o.key||"",g,o,r]}function Gs(A,e,t){const i=A;for(const n in t){const o=`${e}__${n}`;i.__numberFormatters.has(o)&&i.__numberFormatters.delete(o)}}sE();/*! * vue-i18n v9.14.5 * (c) 2025 kazuya kawaguchi * Released under the MIT License. - */const iu="9.14.5";function nu(){typeof __VUE_I18N_FULL_INSTALL__!="boolean"&&(ft().__VUE_I18N_FULL_INSTALL__=!0),typeof __VUE_I18N_LEGACY_API__!="boolean"&&(ft().__VUE_I18N_LEGACY_API__=!0),typeof __INTLIFY_JIT_COMPILATION__!="boolean"&&(ft().__INTLIFY_JIT_COMPILATION__=!1),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(ft().__INTLIFY_DROP_MESSAGE_COMPILER__=!1),typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(ft().__INTLIFY_PROD_DEVTOOLS__=!1)}const ou=ME.__EXTEND_POINT__,Qt=Fo(ou);Qt(),Qt(),Qt(),Qt(),Qt(),Qt(),Qt(),Qt(),Qt();const UC=Ye.__EXTEND_POINT__,we=Fo(UC),re={UNEXPECTED_RETURN_TYPE:UC,INVALID_ARGUMENT:we(),MUST_BE_CALL_SETUP_TOP:we(),NOT_INSTALLED:we(),NOT_AVAILABLE_IN_LEGACY_MODE:we(),REQUIRED_VALUE:we(),INVALID_VALUE:we(),CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN:we(),NOT_INSTALLED_WITH_PROVIDE:we(),UNEXPECTED_ERROR:we(),NOT_COMPATIBLE_LEGACY_VUE_I18N:we(),BRIDGE_SUPPORT_VUE_2_ONLY:we(),MUST_DEFINE_I18N_OPTION_IN_ALLOW_COMPOSITION:we(),NOT_AVAILABLE_COMPOSITION_IN_LEGACY:we(),__EXTEND_POINT__:we()};function Ie(A,...e){return Gi(A,null,void 0)}const Dr=Vt("__translateVNode"),kr=Vt("__datetimeParts"),vr=Vt("__numberParts"),MC=Vt("__setPluralRules"),xC=Vt("__injectWithOption"),Fr=Vt("__dispose");function gn(A){if(!UA(A)||st(A))return A;for(const e in A)if(He(A,e))if(!e.includes("."))UA(A[e])&&gn(A[e]);else{const t=e.split("."),i=t.length-1;let n=A,o=!1;for(let r=0;r{if("locale"in g&&"resource"in g){const{locale:s,resource:a}=g;s?(r[s]=r[s]||HA(),On(a,r[s])):On(a,r)}else gA(g)&&On(JSON.parse(g),r)}),n==null&&o)for(const g in r)He(r,g)&&gn(r[g]);return r}function JC(A){return A.type}function TC(A,e,t){let i=UA(e.messages)?e.messages:HA();"__i18nGlobal"in t&&(i=Ro(A.locale.value,{messages:i,__i18n:t.__i18nGlobal}));const n=Object.keys(i);n.length&&n.forEach(o=>{A.mergeLocaleMessage(o,i[o])});{if(UA(e.datetimeFormats)){const o=Object.keys(e.datetimeFormats);o.length&&o.forEach(r=>{A.mergeDateTimeFormat(r,e.datetimeFormats[r])})}if(UA(e.numberFormats)){const o=Object.keys(e.numberFormats);o.length&&o.forEach(r=>{A.mergeNumberFormat(r,e.numberFormats[r])})}}}function Ls(A){return TA(dn,null,A,0)}const Us="__INTLIFY_META__",Ms=()=>[],ru=()=>!1;let xs=0;function Js(A){return(e,t,i,n)=>A(t,i,ki()||void 0,n)}const gu=()=>{const A=ki();let e=null;return A&&(e=JC(A)[Us])?{[Us]:e}:null};function Bg(A={},e){const{__root:t,__injectWithOption:i}=A,n=t===void 0,o=A.flatJson,r=no?cA:tg,g=!!A.translateExistCompatible;let s=RA(A.inheritLocale)?A.inheritLocale:!0;const a=r(t&&s?t.locale.value:gA(A.locale)?A.locale:Fi),I=r(t&&s?t.fallbackLocale.value:gA(A.fallbackLocale)||WA(A.fallbackLocale)||vA(A.fallbackLocale)||A.fallbackLocale===!1?A.fallbackLocale:a.value),l=r(Ro(a.value,A)),C=r(vA(A.datetimeFormats)?A.datetimeFormats:{[a.value]:{}}),Q=r(vA(A.numberFormats)?A.numberFormats:{[a.value]:{}});let h=t?t.missingWarn:RA(A.missingWarn)||Ot(A.missingWarn)?A.missingWarn:!0,f=t?t.fallbackWarn:RA(A.fallbackWarn)||Ot(A.fallbackWarn)?A.fallbackWarn:!0,u=t?t.fallbackRoot:RA(A.fallbackRoot)?A.fallbackRoot:!0,E=!!A.fallbackFormat,m=PA(A.missing)?A.missing:null,c=PA(A.missing)?Js(A.missing):null,d=PA(A.postTranslation)?A.postTranslation:null,w=t?t.warnHtmlMessage:RA(A.warnHtmlMessage)?A.warnHtmlMessage:!0,F=!!A.escapeParameter;const N=t?t.modifiers:vA(A.modifiers)?A.modifiers:{};let G=A.pluralRules||t&&t.pluralRules,K;K=(()=>{n&&Ds(null);const U={version:iu,locale:a.value,fallbackLocale:I.value,messages:l.value,modifiers:N,pluralRules:G,missing:c===null?void 0:c,missingWarn:h,fallbackWarn:f,fallbackFormat:E,unresolving:!0,postTranslation:d===null?void 0:d,warnHtmlMessage:w,escapeParameter:F,messageResolver:A.messageResolver,messageCompiler:A.messageCompiler,__meta:{framework:"vue"}};U.datetimeFormats=C.value,U.numberFormats=Q.value,U.__datetimeFormatters=vA(K)?K.__datetimeFormatters:void 0,U.__numberFormatters=vA(K)?K.__numberFormatters:void 0;const P=WE(U);return n&&Ds(P),P})(),Ji(K,a.value,I.value);function b(){return[a.value,I.value,l.value,C.value,Q.value]}const L=hA({get:()=>a.value,set:U=>{a.value=U,K.locale=a.value}}),EA=hA({get:()=>I.value,set:U=>{I.value=U,K.fallbackLocale=I.value,Ji(K,a.value,U)}}),dA=hA(()=>l.value),IA=hA(()=>C.value),nA=hA(()=>Q.value);function X(){return PA(d)?d:null}function tA(U){d=U,K.postTranslation=U}function fA(){return m}function Y(U){U!==null&&(c=Js(U)),m=U,K.missing=c}const W=(U,P,uA,bA,jA,he)=>{b();let Ce;try{__INTLIFY_PROD_DEVTOOLS__,n||(K.fallbackContext=t?VE():void 0),Ce=U(K)}finally{__INTLIFY_PROD_DEVTOOLS__,n||(K.fallbackContext=void 0)}if(uA!=="translate exists"&&Ae(Ce)&&Ce===So||uA==="translate exists"&&!Ce){const[jt,Mo]=P();return t&&u?bA(t):jA(jt)}else{if(he(Ce))return Ce;throw Ie(re.UNEXPECTED_RETURN_TYPE)}};function z(...U){return W(P=>Reflect.apply(Ss,null,[P,...U]),()=>mr(...U),"translate",P=>Reflect.apply(P.t,P,[...U]),P=>P,P=>gA(P))}function DA(...U){const[P,uA,bA]=U;if(bA&&!UA(bA))throw Ie(re.INVALID_ARGUMENT);return z(P,uA,Be({resolvedMessage:!0},bA||{}))}function NA(...U){return W(P=>Reflect.apply(Rs,null,[P,...U]),()=>yr(...U),"datetime format",P=>Reflect.apply(P.d,P,[...U]),()=>ms,P=>gA(P))}function ne(...U){return W(P=>Reflect.apply(Ns,null,[P,...U]),()=>wr(...U),"number format",P=>Reflect.apply(P.n,P,[...U]),()=>ms,P=>gA(P))}function LA(U){return U.map(P=>gA(P)||Ae(P)||RA(P)?Ls(String(P)):P)}const $={normalize:LA,interpolate:U=>U,type:"vnode"};function AA(...U){return W(P=>{let uA;const bA=P;try{bA.processor=$,uA=Reflect.apply(Ss,null,[bA,...U])}finally{bA.processor=null}return uA},()=>mr(...U),"translate",P=>P[Dr](...U),P=>[Ls(P)],P=>WA(P))}function QA(...U){return W(P=>Reflect.apply(Ns,null,[P,...U]),()=>wr(...U),"number format",P=>P[vr](...U),Ms,P=>gA(P)||WA(P))}function SA(...U){return W(P=>Reflect.apply(Rs,null,[P,...U]),()=>yr(...U),"datetime format",P=>P[kr](...U),Ms,P=>gA(P)||WA(P))}function D(U){G=U,K.pluralRules=G}function S(U,P){return W(()=>{if(!U)return!1;const uA=gA(P)?P:a.value,bA=q(uA),jA=K.messageResolver(bA,U);return g?jA!=null:st(jA)||Me(jA)||gA(jA)},()=>[U],"translate exists",uA=>Reflect.apply(uA.te,uA,[U,P]),ru,uA=>RA(uA))}function k(U){let P=null;const uA=yC(K,I.value,a.value);for(let bA=0;bA{s&&(a.value=U,K.locale=U,Ji(K,a.value,I.value))}),ae(t.fallbackLocale,U=>{s&&(I.value=U,K.fallbackLocale=U,Ji(K,a.value,I.value))}));const Z={id:xs,locale:L,fallbackLocale:EA,get inheritLocale(){return s},set inheritLocale(U){s=U,U&&t&&(a.value=t.locale.value,I.value=t.fallbackLocale.value,Ji(K,a.value,I.value))},get availableLocales(){return Object.keys(l.value).sort()},messages:dA,get modifiers(){return N},get pluralRules(){return G||{}},get isGlobal(){return n},get missingWarn(){return h},set missingWarn(U){h=U,K.missingWarn=h},get fallbackWarn(){return f},set fallbackWarn(U){f=U,K.fallbackWarn=f},get fallbackRoot(){return u},set fallbackRoot(U){u=U},get fallbackFormat(){return E},set fallbackFormat(U){E=U,K.fallbackFormat=E},get warnHtmlMessage(){return w},set warnHtmlMessage(U){w=U,K.warnHtmlMessage=U},get escapeParameter(){return F},set escapeParameter(U){F=U,K.escapeParameter=U},t:z,getLocaleMessage:q,setLocaleMessage:V,mergeLocaleMessage:iA,getPostTranslationHandler:X,setPostTranslationHandler:tA,getMissingHandler:fA,setMissingHandler:Y,[MC]:D};return Z.datetimeFormats=IA,Z.numberFormats=nA,Z.rt=DA,Z.te=S,Z.tm=x,Z.d=NA,Z.n=ne,Z.getDateTimeFormat=eA,Z.setDateTimeFormat=p,Z.mergeDateTimeFormat=y,Z.getNumberFormat=M,Z.setNumberFormat=O,Z.mergeNumberFormat=oA,Z[xC]=i,Z[Dr]=AA,Z[kr]=SA,Z[vr]=QA,Z}function su(A){const e=gA(A.locale)?A.locale:Fi,t=gA(A.fallbackLocale)||WA(A.fallbackLocale)||vA(A.fallbackLocale)||A.fallbackLocale===!1?A.fallbackLocale:e,i=PA(A.missing)?A.missing:void 0,n=RA(A.silentTranslationWarn)||Ot(A.silentTranslationWarn)?!A.silentTranslationWarn:!0,o=RA(A.silentFallbackWarn)||Ot(A.silentFallbackWarn)?!A.silentFallbackWarn:!0,r=RA(A.fallbackRoot)?A.fallbackRoot:!0,g=!!A.formatFallbackMessages,s=vA(A.modifiers)?A.modifiers:{},a=A.pluralizationRules,I=PA(A.postTranslation)?A.postTranslation:void 0,l=gA(A.warnHtmlInMessage)?A.warnHtmlInMessage!=="off":!0,C=!!A.escapeParameterHtml,Q=RA(A.sync)?A.sync:!0;let h=A.messages;if(vA(A.sharedMessages)){const F=A.sharedMessages;h=Object.keys(F).reduce((G,K)=>{const R=G[K]||(G[K]={});return Be(R,F[K]),G},h||{})}const{__i18n:f,__root:u,__injectWithOption:E}=A,m=A.datetimeFormats,c=A.numberFormats,d=A.flatJson,w=A.translateExistCompatible;return{locale:e,fallbackLocale:t,messages:h,flatJson:d,datetimeFormats:m,numberFormats:c,missing:i,missingWarn:n,fallbackWarn:o,fallbackRoot:r,fallbackFormat:g,modifiers:s,pluralRules:a,postTranslation:I,warnHtmlMessage:l,escapeParameter:C,messageResolver:A.messageResolver,inheritLocale:Q,translateExistCompatible:w,__i18n:f,__root:u,__injectWithOption:E}}function Sr(A={},e){{const t=Bg(su(A)),{__extender:i}=A,n={id:t.id,get locale(){return t.locale.value},set locale(o){t.locale.value=o},get fallbackLocale(){return t.fallbackLocale.value},set fallbackLocale(o){t.fallbackLocale.value=o},get messages(){return t.messages.value},get datetimeFormats(){return t.datetimeFormats.value},get numberFormats(){return t.numberFormats.value},get availableLocales(){return t.availableLocales},get formatter(){return{interpolate(){return[]}}},set formatter(o){},get missing(){return t.getMissingHandler()},set missing(o){t.setMissingHandler(o)},get silentTranslationWarn(){return RA(t.missingWarn)?!t.missingWarn:t.missingWarn},set silentTranslationWarn(o){t.missingWarn=RA(o)?!o:o},get silentFallbackWarn(){return RA(t.fallbackWarn)?!t.fallbackWarn:t.fallbackWarn},set silentFallbackWarn(o){t.fallbackWarn=RA(o)?!o:o},get modifiers(){return t.modifiers},get formatFallbackMessages(){return t.fallbackFormat},set formatFallbackMessages(o){t.fallbackFormat=o},get postTranslation(){return t.getPostTranslationHandler()},set postTranslation(o){t.setPostTranslationHandler(o)},get sync(){return t.inheritLocale},set sync(o){t.inheritLocale=o},get warnHtmlInMessage(){return t.warnHtmlMessage?"warn":"off"},set warnHtmlInMessage(o){t.warnHtmlMessage=o!=="off"},get escapeParameterHtml(){return t.escapeParameter},set escapeParameterHtml(o){t.escapeParameter=o},get preserveDirectiveContent(){return!0},set preserveDirectiveContent(o){},get pluralizationRules(){return t.pluralRules||{}},__composer:t,t(...o){const[r,g,s]=o,a={};let I=null,l=null;if(!gA(r))throw Ie(re.INVALID_ARGUMENT);const C=r;return gA(g)?a.locale=g:WA(g)?I=g:vA(g)&&(l=g),WA(s)?I=s:vA(s)&&(l=s),Reflect.apply(t.t,t,[C,I||l||{},a])},rt(...o){return Reflect.apply(t.rt,t,[...o])},tc(...o){const[r,g,s]=o,a={plural:1};let I=null,l=null;if(!gA(r))throw Ie(re.INVALID_ARGUMENT);const C=r;return gA(g)?a.locale=g:Ae(g)?a.plural=g:WA(g)?I=g:vA(g)&&(l=g),gA(s)?a.locale=s:WA(s)?I=s:vA(s)&&(l=s),Reflect.apply(t.t,t,[C,I||l||{},a])},te(o,r){return t.te(o,r)},tm(o){return t.tm(o)},getLocaleMessage(o){return t.getLocaleMessage(o)},setLocaleMessage(o,r){t.setLocaleMessage(o,r)},mergeLocaleMessage(o,r){t.mergeLocaleMessage(o,r)},d(...o){return Reflect.apply(t.d,t,[...o])},getDateTimeFormat(o){return t.getDateTimeFormat(o)},setDateTimeFormat(o,r){t.setDateTimeFormat(o,r)},mergeDateTimeFormat(o,r){t.mergeDateTimeFormat(o,r)},n(...o){return Reflect.apply(t.n,t,[...o])},getNumberFormat(o){return t.getNumberFormat(o)},setNumberFormat(o,r){t.setNumberFormat(o,r)},mergeNumberFormat(o,r){t.mergeNumberFormat(o,r)},getChoiceIndex(o,r){return-1}};return n.__extender=i,n}}const Qg={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:A=>A==="parent"||A==="global",default:"parent"},i18n:{type:Object}};function au({slots:A},e){return e.length===1&&e[0]==="default"?(A.default?A.default():[]).reduce((i,n)=>[...i,...n.type===qA?n.children:[n]],[]):e.reduce((t,i)=>{const n=A[i];return n&&(t[i]=n()),t},HA())}function HC(A){return qA}const Iu=fn({name:"i18n-t",props:Be({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:A=>Ae(A)||!isNaN(A)}},Qg),setup(A,e){const{slots:t,attrs:i}=e,n=A.i18n||ve({useScope:A.scope,__useComponent:!0});return()=>{const o=Object.keys(t).filter(l=>l!=="_"),r=HA();A.locale&&(r.locale=A.locale),A.plural!==void 0&&(r.plural=gA(A.plural)?+A.plural:A.plural);const g=au(e,o),s=n[Dr](A.keypath,g,r),a=Be(HA(),i),I=gA(A.tag)||UA(A.tag)?A.tag:HC();return GA(I,a,s)}}}),Ts=Iu;function Cu(A){return WA(A)&&!gA(A[0])}function YC(A,e,t,i){const{slots:n,attrs:o}=e;return()=>{const r={part:!0};let g=HA();A.locale&&(r.locale=A.locale),gA(A.format)?r.key=A.format:UA(A.format)&&(gA(A.format.key)&&(r.key=A.format.key),g=Object.keys(A.format).reduce((C,Q)=>t.includes(Q)?Be(HA(),C,{[Q]:A.format[Q]}):C,HA()));const s=i(A.value,r,g);let a=[r.key];WA(s)?a=s.map((C,Q)=>{const h=n[C.type],f=h?h({[C.type]:C.value,index:Q,parts:s}):[C.value];return Cu(f)&&(f[0].key=`${C.type}-${Q}`),f}):gA(s)&&(a=[s]);const I=Be(HA(),o),l=gA(A.tag)||UA(A.tag)?A.tag:HC();return GA(l,I,a)}}const lu=fn({name:"i18n-n",props:Be({value:{type:Number,required:!0},format:{type:[String,Object]}},Qg),setup(A,e){const t=A.i18n||ve({useScope:A.scope,__useComponent:!0});return YC(A,e,LC,(...i)=>t[vr](...i))}}),Hs=lu,Bu=fn({name:"i18n-d",props:Be({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},Qg),setup(A,e){const t=A.i18n||ve({useScope:A.scope,__useComponent:!0});return YC(A,e,GC,(...i)=>t[kr](...i))}}),Ys=Bu;function Qu(A,e){const t=A;if(A.mode==="composition")return t.__getInstance(e)||A.global;{const i=t.__getInstance(e);return i!=null?i.__composer:A.global.__composer}}function cu(A){const e=r=>{const{instance:g,modifiers:s,value:a}=r;if(!g||!g.$)throw Ie(re.UNEXPECTED_ERROR);const I=Qu(A,g.$),l=_s(a);return[Reflect.apply(I.t,I,[...Ks(l)]),I]};return{created:(r,g)=>{const[s,a]=e(g);no&&A.global===a&&(r.__i18nWatcher=ae(a.locale,()=>{g.instance&&g.instance.$forceUpdate()})),r.__composer=a,r.textContent=s},unmounted:r=>{no&&r.__i18nWatcher&&(r.__i18nWatcher(),r.__i18nWatcher=void 0,delete r.__i18nWatcher),r.__composer&&(r.__composer=void 0,delete r.__composer)},beforeUpdate:(r,{value:g})=>{if(r.__composer){const s=r.__composer,a=_s(g);r.textContent=Reflect.apply(s.t,s,[...Ks(a)])}},getSSRProps:r=>{const[g]=e(r);return{textContent:g}}}}function _s(A){if(gA(A))return{path:A};if(vA(A)){if(!("path"in A))throw Ie(re.REQUIRED_VALUE,"path");return A}else throw Ie(re.INVALID_VALUE)}function Ks(A){const{path:e,locale:t,args:i,choice:n,plural:o}=A,r={},g=i||{};return gA(t)&&(r.locale=t),Ae(n)&&(r.plural=n),Ae(o)&&(r.plural=o),[e,g,r]}function Eu(A,e,...t){const i=vA(t[0])?t[0]:{},n=!!i.useI18nComponentName;(RA(i.globalInstall)?i.globalInstall:!0)&&([n?"i18n":Ts.name,"I18nT"].forEach(r=>A.component(r,Ts)),[Hs.name,"I18nN"].forEach(r=>A.component(r,Hs)),[Ys.name,"I18nD"].forEach(r=>A.component(r,Ys))),A.directive("t",cu(e))}function uu(A,e,t){return{beforeCreate(){const i=ki();if(!i)throw Ie(re.UNEXPECTED_ERROR);const n=this.$options;if(n.i18n){const o=n.i18n;if(n.__i18n&&(o.__i18n=n.__i18n),o.__root=e,this===this.$root)this.$i18n=Os(A,o);else{o.__injectWithOption=!0,o.__extender=t.__vueI18nExtend,this.$i18n=Sr(o);const r=this.$i18n;r.__extender&&(r.__disposer=r.__extender(this.$i18n))}}else if(n.__i18n)if(this===this.$root)this.$i18n=Os(A,n);else{this.$i18n=Sr({__i18n:n.__i18n,__injectWithOption:!0,__extender:t.__vueI18nExtend,__root:e});const o=this.$i18n;o.__extender&&(o.__disposer=o.__extender(this.$i18n))}else this.$i18n=A;n.__i18nGlobal&&TC(e,n,n),this.$t=(...o)=>this.$i18n.t(...o),this.$rt=(...o)=>this.$i18n.rt(...o),this.$tc=(...o)=>this.$i18n.tc(...o),this.$te=(o,r)=>this.$i18n.te(o,r),this.$d=(...o)=>this.$i18n.d(...o),this.$n=(...o)=>this.$i18n.n(...o),this.$tm=o=>this.$i18n.tm(o),t.__setInstance(i,this.$i18n)},mounted(){},unmounted(){const i=ki();if(!i)throw Ie(re.UNEXPECTED_ERROR);const n=this.$i18n;delete this.$t,delete this.$rt,delete this.$tc,delete this.$te,delete this.$d,delete this.$n,delete this.$tm,n.__disposer&&(n.__disposer(),delete n.__disposer,delete n.__extender),t.__deleteInstance(i),delete this.$i18n}}}function Os(A,e){A.locale=e.locale||A.locale,A.fallbackLocale=e.fallbackLocale||A.fallbackLocale,A.missing=e.missing||A.missing,A.silentTranslationWarn=e.silentTranslationWarn||A.silentFallbackWarn,A.silentFallbackWarn=e.silentFallbackWarn||A.silentFallbackWarn,A.formatFallbackMessages=e.formatFallbackMessages||A.formatFallbackMessages,A.postTranslation=e.postTranslation||A.postTranslation,A.warnHtmlInMessage=e.warnHtmlInMessage||A.warnHtmlInMessage,A.escapeParameterHtml=e.escapeParameterHtml||A.escapeParameterHtml,A.sync=e.sync||A.sync,A.__composer[MC](e.pluralizationRules||A.pluralizationRules);const t=Ro(A.locale,{messages:e.messages,__i18n:e.__i18n});return Object.keys(t).forEach(i=>A.mergeLocaleMessage(i,t[i])),e.datetimeFormats&&Object.keys(e.datetimeFormats).forEach(i=>A.mergeDateTimeFormat(i,e.datetimeFormats[i])),e.numberFormats&&Object.keys(e.numberFormats).forEach(i=>A.mergeNumberFormat(i,e.numberFormats[i])),A}const hu=Vt("global-vue-i18n");function fu(A={},e){const t=__VUE_I18N_LEGACY_API__&&RA(A.legacy)?A.legacy:__VUE_I18N_LEGACY_API__,i=RA(A.globalInjection)?A.globalInjection:!0,n=__VUE_I18N_LEGACY_API__&&t?!!A.allowComposition:!0,o=new Map,[r,g]=du(A,t),s=Vt("");function a(C){return o.get(C)||null}function I(C,Q){o.set(C,Q)}function l(C){o.delete(C)}{const C={get mode(){return __VUE_I18N_LEGACY_API__&&t?"legacy":"composition"},get allowComposition(){return n},async install(Q,...h){if(Q.__VUE_I18N_SYMBOL__=s,Q.provide(Q.__VUE_I18N_SYMBOL__,C),vA(h[0])){const E=h[0];C.__composerExtend=E.__composerExtend,C.__vueI18nExtend=E.__vueI18nExtend}let f=null;!t&&i&&(f=Su(Q,C.global)),__VUE_I18N_FULL_INSTALL__&&Eu(Q,C,...h),__VUE_I18N_LEGACY_API__&&t&&Q.mixin(uu(g,g.__composer,C));const u=Q.unmount;Q.unmount=()=>{f&&f(),C.dispose(),u()}},get global(){return g},dispose(){r.stop()},__instances:o,__getInstance:a,__setInstance:I,__deleteInstance:l};return C}}function ve(A={}){const e=ki();if(e==null)throw Ie(re.MUST_BE_CALL_SETUP_TOP);if(!e.isCE&&e.appContext.app!=null&&!e.appContext.app.__VUE_I18N_SYMBOL__)throw Ie(re.NOT_INSTALLED);const t=pu(e),i=yu(t),n=JC(e),o=mu(A,n);if(__VUE_I18N_LEGACY_API__&&t.mode==="legacy"&&!A.__useComponent){if(!t.allowComposition)throw Ie(re.NOT_AVAILABLE_IN_LEGACY_MODE);return vu(e,o,i,A)}if(o==="global")return TC(i,A,n),i;if(o==="parent"){let s=wu(t,e,A.__useComponent);return s==null&&(s=i),s}const r=t;let g=r.__getInstance(e);if(g==null){const s=Be({},A);"__i18n"in n&&(s.__i18n=n.__i18n),i&&(s.__root=i),g=Bg(s),r.__composerExtend&&(g[Fr]=r.__composerExtend(g)),ku(r,e,g),r.__setInstance(e,g)}return g}function du(A,e,t){const i=cB();{const n=__VUE_I18N_LEGACY_API__&&e?i.run(()=>Sr(A)):i.run(()=>Bg(A));if(n==null)throw Ie(re.UNEXPECTED_ERROR);return[i,n]}}function pu(A){{const e=rt(A.isCE?hu:A.appContext.app.__VUE_I18N_SYMBOL__);if(!e)throw Ie(A.isCE?re.NOT_INSTALLED_WITH_PROVIDE:re.UNEXPECTED_ERROR);return e}}function mu(A,e){return vo(A)?"__i18n"in e?"local":"global":A.useScope?A.useScope:"local"}function yu(A){return A.mode==="composition"?A.global:A.global.__composer}function wu(A,e,t=!1){let i=null;const n=e.root;let o=Du(e,t);for(;o!=null;){const r=A;if(A.mode==="composition")i=r.__getInstance(o);else if(__VUE_I18N_LEGACY_API__){const g=r.__getInstance(o);g!=null&&(i=g.__composer,t&&i&&!i[xC]&&(i=null))}if(i!=null||n===o)break;o=o.parent}return i}function Du(A,e=!1){return A==null?null:e&&A.vnode.ctx||A.parent}function ku(A,e,t){Ft(()=>{},e),Ii(()=>{const i=t;A.__deleteInstance(e);const n=i[Fr];n&&(n(),delete i[Fr])},e)}function vu(A,e,t,i={}){const n=e==="local",o=tg(null);if(n&&A.proxy&&!(A.proxy.$options.i18n||A.proxy.$options.__i18n))throw Ie(re.MUST_DEFINE_I18N_OPTION_IN_ALLOW_COMPOSITION);const r=RA(i.inheritLocale)?i.inheritLocale:!gA(i.locale),g=cA(!n||r?t.locale.value:gA(i.locale)?i.locale:Fi),s=cA(!n||r?t.fallbackLocale.value:gA(i.fallbackLocale)||WA(i.fallbackLocale)||vA(i.fallbackLocale)||i.fallbackLocale===!1?i.fallbackLocale:g.value),a=cA(Ro(g.value,i)),I=cA(vA(i.datetimeFormats)?i.datetimeFormats:{[g.value]:{}}),l=cA(vA(i.numberFormats)?i.numberFormats:{[g.value]:{}}),C=n?t.missingWarn:RA(i.missingWarn)||Ot(i.missingWarn)?i.missingWarn:!0,Q=n?t.fallbackWarn:RA(i.fallbackWarn)||Ot(i.fallbackWarn)?i.fallbackWarn:!0,h=n?t.fallbackRoot:RA(i.fallbackRoot)?i.fallbackRoot:!0,f=!!i.fallbackFormat,u=PA(i.missing)?i.missing:null,E=PA(i.postTranslation)?i.postTranslation:null,m=n?t.warnHtmlMessage:RA(i.warnHtmlMessage)?i.warnHtmlMessage:!0,c=!!i.escapeParameter,d=n?t.modifiers:vA(i.modifiers)?i.modifiers:{},w=i.pluralRules||n&&t.pluralRules;function F(){return[g.value,s.value,a.value,I.value,l.value]}const N=hA({get:()=>o.value?o.value.locale.value:g.value,set:k=>{o.value&&(o.value.locale.value=k),g.value=k}}),G=hA({get:()=>o.value?o.value.fallbackLocale.value:s.value,set:k=>{o.value&&(o.value.fallbackLocale.value=k),s.value=k}}),K=hA(()=>o.value?o.value.messages.value:a.value),R=hA(()=>I.value),b=hA(()=>l.value);function L(){return o.value?o.value.getPostTranslationHandler():E}function EA(k){o.value&&o.value.setPostTranslationHandler(k)}function dA(){return o.value?o.value.getMissingHandler():u}function IA(k){o.value&&o.value.setMissingHandler(k)}function nA(k){return F(),k()}function X(...k){return o.value?nA(()=>Reflect.apply(o.value.t,null,[...k])):nA(()=>"")}function tA(...k){return o.value?Reflect.apply(o.value.rt,null,[...k]):""}function fA(...k){return o.value?nA(()=>Reflect.apply(o.value.d,null,[...k])):nA(()=>"")}function Y(...k){return o.value?nA(()=>Reflect.apply(o.value.n,null,[...k])):nA(()=>"")}function W(k){return o.value?o.value.tm(k):{}}function z(k,x){return o.value?o.value.te(k,x):!1}function DA(k){return o.value?o.value.getLocaleMessage(k):{}}function NA(k,x){o.value&&(o.value.setLocaleMessage(k,x),a.value[k]=x)}function ne(k,x){o.value&&o.value.mergeLocaleMessage(k,x)}function LA(k){return o.value?o.value.getDateTimeFormat(k):{}}function H(k,x){o.value&&(o.value.setDateTimeFormat(k,x),I.value[k]=x)}function $(k,x){o.value&&o.value.mergeDateTimeFormat(k,x)}function AA(k){return o.value?o.value.getNumberFormat(k):{}}function QA(k,x){o.value&&(o.value.setNumberFormat(k,x),l.value[k]=x)}function SA(k,x){o.value&&o.value.mergeNumberFormat(k,x)}const D={get id(){return o.value?o.value.id:-1},locale:N,fallbackLocale:G,messages:K,datetimeFormats:R,numberFormats:b,get inheritLocale(){return o.value?o.value.inheritLocale:r},set inheritLocale(k){o.value&&(o.value.inheritLocale=k)},get availableLocales(){return o.value?o.value.availableLocales:Object.keys(a.value)},get modifiers(){return o.value?o.value.modifiers:d},get pluralRules(){return o.value?o.value.pluralRules:w},get isGlobal(){return o.value?o.value.isGlobal:!1},get missingWarn(){return o.value?o.value.missingWarn:C},set missingWarn(k){o.value&&(o.value.missingWarn=k)},get fallbackWarn(){return o.value?o.value.fallbackWarn:Q},set fallbackWarn(k){o.value&&(o.value.missingWarn=k)},get fallbackRoot(){return o.value?o.value.fallbackRoot:h},set fallbackRoot(k){o.value&&(o.value.fallbackRoot=k)},get fallbackFormat(){return o.value?o.value.fallbackFormat:f},set fallbackFormat(k){o.value&&(o.value.fallbackFormat=k)},get warnHtmlMessage(){return o.value?o.value.warnHtmlMessage:m},set warnHtmlMessage(k){o.value&&(o.value.warnHtmlMessage=k)},get escapeParameter(){return o.value?o.value.escapeParameter:c},set escapeParameter(k){o.value&&(o.value.escapeParameter=k)},t:X,getPostTranslationHandler:L,setPostTranslationHandler:EA,getMissingHandler:dA,setMissingHandler:IA,rt:tA,d:fA,n:Y,tm:W,te:z,getLocaleMessage:DA,setLocaleMessage:NA,mergeLocaleMessage:ne,getDateTimeFormat:LA,setDateTimeFormat:H,mergeDateTimeFormat:$,getNumberFormat:AA,setNumberFormat:QA,mergeNumberFormat:SA};function S(k){k.locale.value=g.value,k.fallbackLocale.value=s.value,Object.keys(a.value).forEach(x=>{k.mergeLocaleMessage(x,a.value[x])}),Object.keys(I.value).forEach(x=>{k.mergeDateTimeFormat(x,I.value[x])}),Object.keys(l.value).forEach(x=>{k.mergeNumberFormat(x,l.value[x])}),k.escapeParameter=c,k.fallbackFormat=f,k.fallbackRoot=h,k.fallbackWarn=Q,k.missingWarn=C,k.warnHtmlMessage=m}return JI(()=>{if(A.proxy==null||A.proxy.$i18n==null)throw Ie(re.NOT_AVAILABLE_COMPOSITION_IN_LEGACY);const k=o.value=A.proxy.$i18n.__composer;e==="global"?(g.value=k.locale.value,s.value=k.fallbackLocale.value,a.value=k.messages.value,I.value=k.datetimeFormats.value,l.value=k.numberFormats.value):n&&S(k)}),D}const Fu=["locale","fallbackLocale","availableLocales"],Ps=["t","rt","d","n","tm","te"];function Su(A,e){const t=Object.create(null);return Fu.forEach(n=>{const o=Object.getOwnPropertyDescriptor(e,n);if(!o)throw Ie(re.UNEXPECTED_ERROR);const r=le(o.value)?{get(){return o.value.value},set(g){o.value.value=g}}:{get(){return o.get&&o.get()}};Object.defineProperty(t,n,r)}),A.config.globalProperties.$i18n=t,Ps.forEach(n=>{const o=Object.getOwnPropertyDescriptor(e,n);if(!o||!o.value)throw Ie(re.UNEXPECTED_ERROR);Object.defineProperty(A.config.globalProperties,`$${n}`,o)}),()=>{delete A.config.globalProperties.$i18n,Ps.forEach(n=>{delete A.config.globalProperties[`$${n}`]})}}nu();__INTLIFY_JIT_COMPILATION__?ws(zE):ws(XE);_E(mE);KE(yC);if(__INTLIFY_PROD_DEVTOOLS__){const A=ft();A.__INTLIFY__=!0,bE(A.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}const Jt=cA({isOnline:!1,error:"",lastCheck:null}),ge=cA({chip:null,board:null,firmware:null,flash:null,assetsPartition:null,network:null,screen:null}),sn=cA(""),an=cA(""),Rr=cA(!1),mi=cA(null),Ru=A=>new URLSearchParams(window.location.search).get(A),Pn=async(A,e={})=>{const t=await fetch(`/xiaozhi/device/tools/call/${an.value}`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${sn.value}`},body:JSON.stringify({name:A,arguments:e})});if(t.ok)return await t.json();{const i=await t.text();console.error(`MCP tool ${A} failed:`,t.status,i);let n=`Failed to call ${A}`;try{const o=JSON.parse(i);o.message&&(n=o.message)}catch{n=`${n}: HTTP ${t.status}`}throw new Error(n)}},bu=async()=>{var A,e,t,i;try{const[n,o,r]=await Promise.allSettled([Pn("self.get_system_info"),Pn("self.get_device_status"),Pn("self.screen.get_info")]);if(n.status==="fulfilled"&&n.value){const g=n.value.data||n.value;if(ge.value.chip={model:g.chip_model_name||"Unknown"},ge.value.board={model:((A=g.board)==null?void 0:A.name)||"Unknown"},ge.value.firmware={version:((e=g.application)==null?void 0:e.version)||"Unknown"},g.flash_size){const s=Math.round(g.flash_size/1024/1024);ge.value.flash={size:`${s}MB`}}else ge.value.flash={size:"Unknown"};if(g.partition_table){const s=g.partition_table.find(a=>a.label==="assets");s?ge.value.assetsPartition={size:s.size,sizeFormatted:`${Math.round(s.size/1024/1024)}MB`}:ge.value.assetsPartition=null}else ge.value.assetsPartition=null}else console.warn("系统信息获取失败:",n.reason||n.value),ge.value.chip={model:"Unknown"},ge.value.board={model:"Unknown"},ge.value.firmware={version:"Unknown"},ge.value.flash={size:"Unknown"},ge.value.assetsPartition=null;if(o.status==="fulfilled"&&o.value){const g=o.value.data||o.value;ge.value.network={type:((t=g.network)==null?void 0:t.type)||"unknown",signal:((i=g.network)==null?void 0:i.signal)||"Unknown"}}else console.warn("设备状态获取失败:",o.reason||o.value),ge.value.network={type:"unknown",signal:"Unknown"};if(r.status==="fulfilled"&&r.value){const g=r.value.data||r.value;ge.value.screen={resolution:`${g.width||0}x${g.height||0}`}}else console.warn("屏幕信息获取失败:",r.reason||r.value),ge.value.screen={resolution:"Unknown"}}catch(n){console.error("获取设备信息时发生错误:",n)}},bo=async(A=!0)=>{Rr.value=!0;try{const e=await fetch(`/xiaozhi/device/tools/list/${an.value}`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${sn.value}`}});if((await e.json()).code===0)Jt.value.isOnline=!0,Jt.value.error="",Jt.value.lastCheck=new Date,A&&await bu();else throw new Error(`HTTP ${e.status}: ${e.statusText}`)}catch{Jt.value.isOnline=!1,Jt.value.error="",Jt.value.lastCheck=new Date,mi.value&&clearTimeout(mi.value),mi.value=setTimeout(bo,3e4)}finally{Rr.value=!1}},Nu=(A,e)=>{if(!A)return e("device.signal.unknown");switch(A.toLowerCase()){case"strong":return e("device.signal.strong");case"medium":return e("device.signal.medium");case"weak":return e("device.signal.weak");case"none":return e("device.signal.none");default:return A}},Gu=()=>{const A=localStorage.getItem("token");an.value=Ru("deviceId"),A&&an.value&&(sn.value=JSON.parse(A).token,bo())},Lu=()=>{mi.value&&(clearTimeout(mi.value),mi.value=null)},Uu=async()=>{await bo()};function No(){const A=hA(()=>!!sn.value),e=hA(()=>Jt.value.isOnline);return{token:sn,deviceId:an,deviceStatus:Jt,deviceInfo:ge,isChecking:Rr,hasToken:A,isDeviceOnline:e,initializeDeviceStatus:Gu,cleanupDeviceStatus:Lu,refreshDeviceStatus:Uu,checkDeviceStatus:bo,callMcpTool:Pn,getSignalDisplayText:Nu}}const Vs={__name:"WifiIcon",props:{size:{type:String,default:"w-4 h-4"},color:{type:String,default:"text-blue-500"}},setup(A){const e=A,t=hA(()=>`${e.size} ${e.color}`);return(i,n)=>(T(),_("svg",{class:kA(t.value),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...n[0]||(n[0]=[B("path",{d:"M3 9c4.97-4.97 13.03-4.97 18 0","stroke-width":"2","stroke-linecap":"round"},null,-1),B("path",{d:"M6 12c3.31-3.31 8.69-3.31 12 0","stroke-width":"2","stroke-linecap":"round"},null,-1),B("path",{d:"M9 15c1.66-1.66 4.34-1.66 6 0","stroke-width":"2","stroke-linecap":"round"},null,-1),B("circle",{cx:"12",cy:"18",r:"1.5",fill:"currentColor"},null,-1)])],2))}},Ws={__name:"Signal4GIcon",props:{size:{type:String,default:"w-4 h-4"},color:{type:String,default:"text-green-500"}},setup(A){const e=A,t=hA(()=>`${e.size} ${e.color}`);return(i,n)=>(T(),_("svg",{class:kA(t.value),fill:"currentColor",viewBox:"0 0 24 24"},[...n[0]||(n[0]=[Do('4G',5)])],2))}},qs={__name:"ChipIcon",props:{size:{type:String,default:"w-4 h-4"},color:{type:String,default:"text-gray-400"}},setup(A){const e=A,t=hA(()=>`${e.size} ${e.color}`);return(i,n)=>(T(),_("svg",{class:kA(t.value),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...n[0]||(n[0]=[Do('',14)])],2))}},js={__name:"FlashIcon",props:{size:{type:String,default:"w-4 h-4"},color:{type:String,default:"text-gray-400"}},setup(A){const e=A,t=hA(()=>`${e.size} ${e.color}`);return(i,n)=>(T(),_("svg",{class:kA(t.value),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...n[0]||(n[0]=[Do('',10)])],2))}},Zs={__name:"BoardIcon",props:{size:{type:String,default:"w-4 h-4"},color:{type:String,default:"text-gray-400"}},setup(A){const e=A,t=hA(()=>`${e.size} ${e.color}`);return(i,n)=>(T(),_("svg",{class:kA(t.value),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...n[0]||(n[0]=[Do('',10)])],2))}},Xs={__name:"ScreenIcon",props:{size:{type:String,default:"w-4 h-4"},color:{type:String,default:"text-gray-400"}},setup(A){const e=A,t=hA(()=>`${e.size} ${e.color}`);return(i,n)=>(T(),_("svg",{class:kA(t.value),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...n[0]||(n[0]=[B("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9.75 17L9 20l-1 1h8l-1-1-.75-3M3 13h18M5 17h14a2 2 0 002-2V5a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"},null,-1)])],2))}},Mu={class:"flex items-center space-x-2"},xu={class:"flex items-center space-x-1"},Ju={key:0,class:"flex items-center space-x-1"},Tu={class:"text-xs text-gray-500"},Hu={key:0,class:"flex items-center space-x-4 text-sm text-gray-600"},Yu={key:0,class:"flex items-center space-x-1"},_u={key:1,class:"flex items-center space-x-1"},Ku={key:2,class:"flex items-center space-x-1"},Ou={key:3,class:"flex items-center space-x-1"},Pu={key:1,class:"lg:hidden flex flex-col bg-white rounded-lg border border-gray-200 shadow-sm overflow-hidden"},Vu={class:"flex items-center justify-between px-4 py-3 bg-gray-50 border-b border-gray-200"},Wu={class:"flex items-center space-x-2"},qu={key:0,class:"flex items-center space-x-1"},ju={class:"text-xs font-medium text-gray-600"},Zu={key:0,class:"px-4 py-3"},Xu={class:"grid grid-cols-1 gap-2.5"},zu={class:"flex justify-between items-center py-1.5 border-b border-gray-100"},$u={key:0,class:"flex items-center space-x-2 flex-1"},Ah={class:"min-w-0 flex-1"},eh={class:"text-xs text-gray-500 leading-tight"},th={class:"text-sm text-gray-800 font-medium truncate"},ih={key:1,class:"flex items-center space-x-2 flex-1 ml-3"},nh={class:"min-w-0 flex-1"},oh={class:"text-xs text-gray-500 leading-tight"},rh={class:"text-sm text-gray-800 font-medium truncate"},gh={class:"flex justify-between items-center py-1.5"},sh={key:0,class:"flex items-center space-x-2 flex-1"},ah={class:"min-w-0 flex-1"},Ih={class:"text-xs text-gray-500 leading-tight"},Ch={class:"text-sm text-gray-800 font-medium"},lh={key:1,class:"flex items-center space-x-2 flex-1 ml-3"},Bh={class:"min-w-0 flex-1"},Qh={class:"text-xs text-gray-500 leading-tight"},ch={class:"text-sm text-gray-800 font-medium"},Eh={__name:"DeviceStatus",setup(A){const{t:e}=ve(),{deviceStatus:t,deviceInfo:i,hasToken:n,initializeDeviceStatus:o,cleanupDeviceStatus:r,getSignalDisplayText:g}=No(),s=hA(()=>n.value);return Ft(()=>{o()}),Ii(()=>{r()}),(a,I)=>(T(),_(qA,null,[s.value?(T(),_("div",{key:0,class:kA(["hidden lg:flex items-center space-x-4",BA(t).isOnline?"":"opacity-60"])},[B("div",Mu,[B("div",xu,[B("div",{class:kA(["w-2 h-2 rounded-full",BA(t).isOnline?"bg-green-500":"bg-gray-400"])},null,2),B("span",{class:kA(["text-sm font-medium",BA(t).isOnline?"text-gray-700":"text-gray-500"])},v(BA(t).isOnline?a.$t("device.online"):a.$t("device.offline")),3)]),BA(t).isOnline&&BA(i).network?(T(),_("div",Ju,[BA(i).network.type==="wifi"?(T(),ye(BA(Vs),{key:0,color:"text-blue-500"})):BA(i).network.type==="4g"?(T(),ye(BA(Ws),{key:1})):sA("",!0),B("span",Tu,v(BA(g)(BA(i).network.signal,BA(e))),1)])):sA("",!0)]),BA(t).isOnline?(T(),_("div",Hu,[BA(i).chip?(T(),_("div",Yu,[TA(BA(qs)),B("span",null,v(BA(i).chip.model),1)])):sA("",!0),BA(i).flash?(T(),_("div",_u,[TA(BA(js)),B("span",null,v(BA(i).flash.size),1)])):sA("",!0),BA(i).board?(T(),_("div",Ku,[TA(BA(Zs)),B("span",null,v(BA(i).board.model),1)])):sA("",!0),BA(i).screen?(T(),_("div",Ou,[TA(BA(Xs)),B("span",null,v(BA(i).screen.resolution),1)])):sA("",!0)])):sA("",!0)],2)):sA("",!0),s.value?(T(),_("div",Pu,[B("div",Vu,[B("div",Wu,[B("div",{class:kA(["w-2.5 h-2.5 rounded-full",BA(t).isOnline?"bg-green-500":"bg-red-400"])},null,2),B("span",{class:kA(["text-sm font-medium",BA(t).isOnline?"text-gray-800":"text-gray-600"])},v(BA(t).isOnline?a.$t("device.online"):a.$t("device.offline")),3)]),BA(t).isOnline&&BA(i).network?(T(),_("div",qu,[BA(i).network.type==="wifi"?(T(),ye(BA(Vs),{key:0,color:"text-blue-500"})):BA(i).network.type==="4g"?(T(),ye(BA(Ws),{key:1})):sA("",!0),B("span",ju,v(BA(g)(BA(i).network.signal,BA(e))),1)])):sA("",!0)]),BA(t).isOnline?(T(),_("div",Zu,[B("div",Xu,[B("div",zu,[BA(i).chip?(T(),_("div",$u,[TA(BA(qs),{class:"flex-shrink-0"}),B("div",Ah,[B("div",eh,v(a.$t("device.chip")),1),B("div",th,v(BA(i).chip.model),1)])])):sA("",!0),BA(i).board?(T(),_("div",ih,[TA(BA(Zs),{class:"flex-shrink-0"}),B("div",nh,[B("div",oh,v(a.$t("device.board")),1),B("div",rh,v(BA(i).board.model),1)])])):sA("",!0)]),B("div",gh,[BA(i).flash?(T(),_("div",sh,[TA(BA(js),{class:"flex-shrink-0"}),B("div",ah,[B("div",Ih,v(a.$t("device.flash")),1),B("div",Ch,v(BA(i).flash.size),1)])])):sA("",!0),BA(i).screen?(T(),_("div",lh,[TA(BA(Xs),{class:"flex-shrink-0"}),B("div",Bh,[B("div",Qh,v(a.$t("device.screen")),1),B("div",ch,v(BA(i).screen.resolution),1)])])):sA("",!0)])])])):sA("",!0)])):sA("",!0)],64))}},uh={title:"Xiaozhi AI Customization"},hh={cancel:"Cancel",confirm:"Confirm",close:"Close",start:"Start",download:"Download",generate:"Generate",reset:"Reset",yes:"Yes",no:"No",loading:"Loading...",error:"Error",success:"Success",warning:"Warning",info:"Information",next:"Next",previous:"Previous",finish:"Finish",retry:"Retry",ok:"OK",other:"Other"},fh={title:"Xiaozhi AI Customization"},dh={title:"Saved Configuration Detected",message:"Configuration has been automatically restored. You can continue from where you left off or start over.",restart:"Start Over"},ph={chip:"Chip Configuration",theme:"Theme Design",generate:"Preview & Generate"},mh={title:"Generate assets.bin",confirmConfig:"Please confirm your configuration",chipModel:"Chip Model:",resolution:"Resolution:",wakeword:"Wake Word:",font:"Font:",emoji:"Emoji Package:",fileList:"Included Files List",estimated:"Estimated",compressed:"Before compression",generating:"Generating assets.bin...",progress:"{progress}% Complete",completed:"Your assets.bin file is ready",filename:"Filename: assets.bin",fileSize:"File Size: {size}",generationTime:"Generation Time: {time}",downloadAssets:"Download assets.bin",flashToDevice:"Flash to Device Online",flashing:"Flashing to device...",flashingCancel:"Cancel Flash",flashingError:"Flashing Error",flashingInProgress:"Flashing in progress, please do not close the window",customFont:"Custom Font",customEmoji:"Custom Emoji Package",notConfigured:"Not Configured",wakewordNames:{wn9s_hilexin:"Hi, Espressif",wn9s_hiesp:"Hi, ESP",wn9s_nihaoxiaozhi:"Hello Xiaozhi",wn9_nihaoxiaozhi_tts:"Hello Xiaozhi",wn9_alexa:"Alexa"}},yh={init:"Initialize Generator",font:"Process Font Files",wakeword:"Package Wake Word Model",emoji:"Process Emoji Images",background:"Process Background Images",index:"Generate Index File",spiffs:"Build SPIFFS Mapping",package:"Complete Packaging"},wh={title:"Wake Word Configuration",description:"Select a preset wake word model or customize it using a command recognition model.",supportWakeNet9:"Your chip supports WakeNet9 models.",supportWakeNet9s:"Your chip supports WakeNet9s models.",notSupported:"Your chip does not support wake word functionality.",notice:"Note:",unsupportedMessage:"{chipModel} chip does not support wake word functionality. If you need to use wake words, please select ESP32-S3, ESP32-P4, or ESP32-C3/C5/C6 chips.",noWakeword:"No Wake Word",presetWakeword:"Preset Wake Word",customWakeword:"Custom Wake Word",selectWakeword:"Select Wake Word",placeholder:"Select wake word...",customSettings:"Custom Wake Word Settings",wakewordName:"Wake Word Name",wakewordNamePlaceholder:"e.g., Xiaozhi / Potato",wakewordCommand:"Wake Command",wakewordCommandPlaceholderCN:"Pinyin separated by spaces, e.g., ni hao xiao zhi",wakewordCommandPlaceholderEN:"English words, no punctuation, e.g., HELLO POTATO",threshold:"Sensitivity Threshold (0-100)",thresholdDesc:"Lower is more sensitive, default 20",duration:"Recognition Duration",durationDesc:"Maximum duration for command recognition",selectModel:"Select Recognition Model",mn6cn:"MultiNet6 (Chinese)",mn6en:"MultiNet6 (English)",mn7cn:"MultiNet7 (Chinese)",mn7en:"MultiNet7 (English)",errors:{nameRequired:"Please enter wake word name",commandRequired:"Please enter wake command",noPunctuation:"Command cannot contain punctuation",durationRange:"Duration must be between 500-10000ms"},tips:{tipLabel:"Tip:",optional:"Wake words are optional. If disabled, the device cannot be voice-activated.",wakeNet9sOnly:"C3/C5/C6 chips only support WakeNet9s lightweight models.",wakeNet9Full:"S3/P4 chips support complete WakeNet9 models with more choices.",customSupport:"Custom wake words use MultiNet models, currently only supported on ESP32-S3."}},Dh={resetFailed:"Reset failed, please refresh the page and try again",generationFailed:"Generation failed: {error}",noFileToDownload:"No downloadable file available",deviceOffline:"Device is offline and cannot be flashed",fileTooLarge:"Flash failed: File size {fileSize}MB exceeds assets partition size {partitionSize}MB. Please reduce configuration content or use a device with larger capacity.",flashCancelConfirm:"Are you sure you want to cancel flashing?",oldDataCleared:`Old version emoji data structure has been detected and cleared. + */const iu="9.14.5";function nu(){typeof __VUE_I18N_FULL_INSTALL__!="boolean"&&(ft().__VUE_I18N_FULL_INSTALL__=!0),typeof __VUE_I18N_LEGACY_API__!="boolean"&&(ft().__VUE_I18N_LEGACY_API__=!0),typeof __INTLIFY_JIT_COMPILATION__!="boolean"&&(ft().__INTLIFY_JIT_COMPILATION__=!1),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(ft().__INTLIFY_DROP_MESSAGE_COMPILER__=!1),typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(ft().__INTLIFY_PROD_DEVTOOLS__=!1)}const ou=ME.__EXTEND_POINT__,Qt=Fo(ou);Qt(),Qt(),Qt(),Qt(),Qt(),Qt(),Qt(),Qt(),Qt();const UC=Ye.__EXTEND_POINT__,we=Fo(UC),re={UNEXPECTED_RETURN_TYPE:UC,INVALID_ARGUMENT:we(),MUST_BE_CALL_SETUP_TOP:we(),NOT_INSTALLED:we(),NOT_AVAILABLE_IN_LEGACY_MODE:we(),REQUIRED_VALUE:we(),INVALID_VALUE:we(),CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN:we(),NOT_INSTALLED_WITH_PROVIDE:we(),UNEXPECTED_ERROR:we(),NOT_COMPATIBLE_LEGACY_VUE_I18N:we(),BRIDGE_SUPPORT_VUE_2_ONLY:we(),MUST_DEFINE_I18N_OPTION_IN_ALLOW_COMPOSITION:we(),NOT_AVAILABLE_COMPOSITION_IN_LEGACY:we(),__EXTEND_POINT__:we()};function Ie(A,...e){return Gi(A,null,void 0)}const Dr=Vt("__translateVNode"),kr=Vt("__datetimeParts"),vr=Vt("__numberParts"),MC=Vt("__setPluralRules"),xC=Vt("__injectWithOption"),Fr=Vt("__dispose");function gn(A){if(!UA(A)||st(A))return A;for(const e in A)if(He(A,e))if(!e.includes("."))UA(A[e])&&gn(A[e]);else{const t=e.split("."),i=t.length-1;let n=A,o=!1;for(let r=0;r{if("locale"in g&&"resource"in g){const{locale:s,resource:a}=g;s?(r[s]=r[s]||HA(),On(a,r[s])):On(a,r)}else gA(g)&&On(JSON.parse(g),r)}),n==null&&o)for(const g in r)He(r,g)&&gn(r[g]);return r}function JC(A){return A.type}function TC(A,e,t){let i=UA(e.messages)?e.messages:HA();"__i18nGlobal"in t&&(i=Ro(A.locale.value,{messages:i,__i18n:t.__i18nGlobal}));const n=Object.keys(i);n.length&&n.forEach(o=>{A.mergeLocaleMessage(o,i[o])});{if(UA(e.datetimeFormats)){const o=Object.keys(e.datetimeFormats);o.length&&o.forEach(r=>{A.mergeDateTimeFormat(r,e.datetimeFormats[r])})}if(UA(e.numberFormats)){const o=Object.keys(e.numberFormats);o.length&&o.forEach(r=>{A.mergeNumberFormat(r,e.numberFormats[r])})}}}function Ls(A){return TA(dn,null,A,0)}const Us="__INTLIFY_META__",Ms=()=>[],ru=()=>!1;let xs=0;function Js(A){return(e,t,i,n)=>A(t,i,ki()||void 0,n)}const gu=()=>{const A=ki();let e=null;return A&&(e=JC(A)[Us])?{[Us]:e}:null};function Bg(A={},e){const{__root:t,__injectWithOption:i}=A,n=t===void 0,o=A.flatJson,r=no?EA:tg,g=!!A.translateExistCompatible;let s=RA(A.inheritLocale)?A.inheritLocale:!0;const a=r(t&&s?t.locale.value:gA(A.locale)?A.locale:Fi),I=r(t&&s?t.fallbackLocale.value:gA(A.fallbackLocale)||WA(A.fallbackLocale)||vA(A.fallbackLocale)||A.fallbackLocale===!1?A.fallbackLocale:a.value),l=r(Ro(a.value,A)),C=r(vA(A.datetimeFormats)?A.datetimeFormats:{[a.value]:{}}),Q=r(vA(A.numberFormats)?A.numberFormats:{[a.value]:{}});let h=t?t.missingWarn:RA(A.missingWarn)||Ot(A.missingWarn)?A.missingWarn:!0,f=t?t.fallbackWarn:RA(A.fallbackWarn)||Ot(A.fallbackWarn)?A.fallbackWarn:!0,u=t?t.fallbackRoot:RA(A.fallbackRoot)?A.fallbackRoot:!0,E=!!A.fallbackFormat,D=PA(A.missing)?A.missing:null,c=PA(A.missing)?Js(A.missing):null,d=PA(A.postTranslation)?A.postTranslation:null,p=t?t.warnHtmlMessage:RA(A.warnHtmlMessage)?A.warnHtmlMessage:!0,v=!!A.escapeParameter;const N=t?t.modifiers:vA(A.modifiers)?A.modifiers:{};let G=A.pluralRules||t&&t.pluralRules,_;_=(()=>{n&&Ds(null);const U={version:iu,locale:a.value,fallbackLocale:I.value,messages:l.value,modifiers:N,pluralRules:G,missing:c===null?void 0:c,missingWarn:h,fallbackWarn:f,fallbackFormat:E,unresolving:!0,postTranslation:d===null?void 0:d,warnHtmlMessage:p,escapeParameter:v,messageResolver:A.messageResolver,messageCompiler:A.messageCompiler,__meta:{framework:"vue"}};U.datetimeFormats=C.value,U.numberFormats=Q.value,U.__datetimeFormatters=vA(_)?_.__datetimeFormatters:void 0,U.__numberFormatters=vA(_)?_.__numberFormatters:void 0;const P=WE(U);return n&&Ds(P),P})(),Ji(_,a.value,I.value);function b(){return[a.value,I.value,l.value,C.value,Q.value]}const L=hA({get:()=>a.value,set:U=>{a.value=U,_.locale=a.value}}),QA=hA({get:()=>I.value,set:U=>{I.value=U,_.fallbackLocale=I.value,Ji(_,a.value,U)}}),dA=hA(()=>l.value),IA=hA(()=>C.value),nA=hA(()=>Q.value);function X(){return PA(d)?d:null}function tA(U){d=U,_.postTranslation=U}function fA(){return D}function Y(U){U!==null&&(c=Js(U)),D=U,_.missing=c}const W=(U,P,uA,bA,jA,he)=>{b();let Ce;try{__INTLIFY_PROD_DEVTOOLS__,n||(_.fallbackContext=t?VE():void 0),Ce=U(_)}finally{__INTLIFY_PROD_DEVTOOLS__,n||(_.fallbackContext=void 0)}if(uA!=="translate exists"&&Ae(Ce)&&Ce===So||uA==="translate exists"&&!Ce){const[jt,Mo]=P();return t&&u?bA(t):jA(jt)}else{if(he(Ce))return Ce;throw Ie(re.UNEXPECTED_RETURN_TYPE)}};function z(...U){return W(P=>Reflect.apply(Ss,null,[P,...U]),()=>mr(...U),"translate",P=>Reflect.apply(P.t,P,[...U]),P=>P,P=>gA(P))}function DA(...U){const[P,uA,bA]=U;if(bA&&!UA(bA))throw Ie(re.INVALID_ARGUMENT);return z(P,uA,Be({resolvedMessage:!0},bA||{}))}function NA(...U){return W(P=>Reflect.apply(Rs,null,[P,...U]),()=>yr(...U),"datetime format",P=>Reflect.apply(P.d,P,[...U]),()=>ms,P=>gA(P))}function ne(...U){return W(P=>Reflect.apply(Ns,null,[P,...U]),()=>wr(...U),"number format",P=>Reflect.apply(P.n,P,[...U]),()=>ms,P=>gA(P))}function LA(U){return U.map(P=>gA(P)||Ae(P)||RA(P)?Ls(String(P)):P)}const $={normalize:LA,interpolate:U=>U,type:"vnode"};function AA(...U){return W(P=>{let uA;const bA=P;try{bA.processor=$,uA=Reflect.apply(Ss,null,[bA,...U])}finally{bA.processor=null}return uA},()=>mr(...U),"translate",P=>P[Dr](...U),P=>[Ls(P)],P=>WA(P))}function cA(...U){return W(P=>Reflect.apply(Ns,null,[P,...U]),()=>wr(...U),"number format",P=>P[vr](...U),Ms,P=>gA(P)||WA(P))}function SA(...U){return W(P=>Reflect.apply(Rs,null,[P,...U]),()=>yr(...U),"datetime format",P=>P[kr](...U),Ms,P=>gA(P)||WA(P))}function w(U){G=U,_.pluralRules=G}function R(U,P){return W(()=>{if(!U)return!1;const uA=gA(P)?P:a.value,bA=q(uA),jA=_.messageResolver(bA,U);return g?jA!=null:st(jA)||Me(jA)||gA(jA)},()=>[U],"translate exists",uA=>Reflect.apply(uA.te,uA,[U,P]),ru,uA=>RA(uA))}function k(U){let P=null;const uA=yC(_,I.value,a.value);for(let bA=0;bA{s&&(a.value=U,_.locale=U,Ji(_,a.value,I.value))}),ae(t.fallbackLocale,U=>{s&&(I.value=U,_.fallbackLocale=U,Ji(_,a.value,I.value))}));const Z={id:xs,locale:L,fallbackLocale:QA,get inheritLocale(){return s},set inheritLocale(U){s=U,U&&t&&(a.value=t.locale.value,I.value=t.fallbackLocale.value,Ji(_,a.value,I.value))},get availableLocales(){return Object.keys(l.value).sort()},messages:dA,get modifiers(){return N},get pluralRules(){return G||{}},get isGlobal(){return n},get missingWarn(){return h},set missingWarn(U){h=U,_.missingWarn=h},get fallbackWarn(){return f},set fallbackWarn(U){f=U,_.fallbackWarn=f},get fallbackRoot(){return u},set fallbackRoot(U){u=U},get fallbackFormat(){return E},set fallbackFormat(U){E=U,_.fallbackFormat=E},get warnHtmlMessage(){return p},set warnHtmlMessage(U){p=U,_.warnHtmlMessage=U},get escapeParameter(){return v},set escapeParameter(U){v=U,_.escapeParameter=U},t:z,getLocaleMessage:q,setLocaleMessage:V,mergeLocaleMessage:iA,getPostTranslationHandler:X,setPostTranslationHandler:tA,getMissingHandler:fA,setMissingHandler:Y,[MC]:w};return Z.datetimeFormats=IA,Z.numberFormats=nA,Z.rt=DA,Z.te=R,Z.tm=x,Z.d=NA,Z.n=ne,Z.getDateTimeFormat=eA,Z.setDateTimeFormat=m,Z.mergeDateTimeFormat=y,Z.getNumberFormat=M,Z.setNumberFormat=O,Z.mergeNumberFormat=oA,Z[xC]=i,Z[Dr]=AA,Z[kr]=SA,Z[vr]=cA,Z}function su(A){const e=gA(A.locale)?A.locale:Fi,t=gA(A.fallbackLocale)||WA(A.fallbackLocale)||vA(A.fallbackLocale)||A.fallbackLocale===!1?A.fallbackLocale:e,i=PA(A.missing)?A.missing:void 0,n=RA(A.silentTranslationWarn)||Ot(A.silentTranslationWarn)?!A.silentTranslationWarn:!0,o=RA(A.silentFallbackWarn)||Ot(A.silentFallbackWarn)?!A.silentFallbackWarn:!0,r=RA(A.fallbackRoot)?A.fallbackRoot:!0,g=!!A.formatFallbackMessages,s=vA(A.modifiers)?A.modifiers:{},a=A.pluralizationRules,I=PA(A.postTranslation)?A.postTranslation:void 0,l=gA(A.warnHtmlInMessage)?A.warnHtmlInMessage!=="off":!0,C=!!A.escapeParameterHtml,Q=RA(A.sync)?A.sync:!0;let h=A.messages;if(vA(A.sharedMessages)){const v=A.sharedMessages;h=Object.keys(v).reduce((G,_)=>{const S=G[_]||(G[_]={});return Be(S,v[_]),G},h||{})}const{__i18n:f,__root:u,__injectWithOption:E}=A,D=A.datetimeFormats,c=A.numberFormats,d=A.flatJson,p=A.translateExistCompatible;return{locale:e,fallbackLocale:t,messages:h,flatJson:d,datetimeFormats:D,numberFormats:c,missing:i,missingWarn:n,fallbackWarn:o,fallbackRoot:r,fallbackFormat:g,modifiers:s,pluralRules:a,postTranslation:I,warnHtmlMessage:l,escapeParameter:C,messageResolver:A.messageResolver,inheritLocale:Q,translateExistCompatible:p,__i18n:f,__root:u,__injectWithOption:E}}function Sr(A={},e){{const t=Bg(su(A)),{__extender:i}=A,n={id:t.id,get locale(){return t.locale.value},set locale(o){t.locale.value=o},get fallbackLocale(){return t.fallbackLocale.value},set fallbackLocale(o){t.fallbackLocale.value=o},get messages(){return t.messages.value},get datetimeFormats(){return t.datetimeFormats.value},get numberFormats(){return t.numberFormats.value},get availableLocales(){return t.availableLocales},get formatter(){return{interpolate(){return[]}}},set formatter(o){},get missing(){return t.getMissingHandler()},set missing(o){t.setMissingHandler(o)},get silentTranslationWarn(){return RA(t.missingWarn)?!t.missingWarn:t.missingWarn},set silentTranslationWarn(o){t.missingWarn=RA(o)?!o:o},get silentFallbackWarn(){return RA(t.fallbackWarn)?!t.fallbackWarn:t.fallbackWarn},set silentFallbackWarn(o){t.fallbackWarn=RA(o)?!o:o},get modifiers(){return t.modifiers},get formatFallbackMessages(){return t.fallbackFormat},set formatFallbackMessages(o){t.fallbackFormat=o},get postTranslation(){return t.getPostTranslationHandler()},set postTranslation(o){t.setPostTranslationHandler(o)},get sync(){return t.inheritLocale},set sync(o){t.inheritLocale=o},get warnHtmlInMessage(){return t.warnHtmlMessage?"warn":"off"},set warnHtmlInMessage(o){t.warnHtmlMessage=o!=="off"},get escapeParameterHtml(){return t.escapeParameter},set escapeParameterHtml(o){t.escapeParameter=o},get preserveDirectiveContent(){return!0},set preserveDirectiveContent(o){},get pluralizationRules(){return t.pluralRules||{}},__composer:t,t(...o){const[r,g,s]=o,a={};let I=null,l=null;if(!gA(r))throw Ie(re.INVALID_ARGUMENT);const C=r;return gA(g)?a.locale=g:WA(g)?I=g:vA(g)&&(l=g),WA(s)?I=s:vA(s)&&(l=s),Reflect.apply(t.t,t,[C,I||l||{},a])},rt(...o){return Reflect.apply(t.rt,t,[...o])},tc(...o){const[r,g,s]=o,a={plural:1};let I=null,l=null;if(!gA(r))throw Ie(re.INVALID_ARGUMENT);const C=r;return gA(g)?a.locale=g:Ae(g)?a.plural=g:WA(g)?I=g:vA(g)&&(l=g),gA(s)?a.locale=s:WA(s)?I=s:vA(s)&&(l=s),Reflect.apply(t.t,t,[C,I||l||{},a])},te(o,r){return t.te(o,r)},tm(o){return t.tm(o)},getLocaleMessage(o){return t.getLocaleMessage(o)},setLocaleMessage(o,r){t.setLocaleMessage(o,r)},mergeLocaleMessage(o,r){t.mergeLocaleMessage(o,r)},d(...o){return Reflect.apply(t.d,t,[...o])},getDateTimeFormat(o){return t.getDateTimeFormat(o)},setDateTimeFormat(o,r){t.setDateTimeFormat(o,r)},mergeDateTimeFormat(o,r){t.mergeDateTimeFormat(o,r)},n(...o){return Reflect.apply(t.n,t,[...o])},getNumberFormat(o){return t.getNumberFormat(o)},setNumberFormat(o,r){t.setNumberFormat(o,r)},mergeNumberFormat(o,r){t.mergeNumberFormat(o,r)},getChoiceIndex(o,r){return-1}};return n.__extender=i,n}}const Qg={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:A=>A==="parent"||A==="global",default:"parent"},i18n:{type:Object}};function au({slots:A},e){return e.length===1&&e[0]==="default"?(A.default?A.default():[]).reduce((i,n)=>[...i,...n.type===qA?n.children:[n]],[]):e.reduce((t,i)=>{const n=A[i];return n&&(t[i]=n()),t},HA())}function HC(A){return qA}const Iu=fn({name:"i18n-t",props:Be({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:A=>Ae(A)||!isNaN(A)}},Qg),setup(A,e){const{slots:t,attrs:i}=e,n=A.i18n||ve({useScope:A.scope,__useComponent:!0});return()=>{const o=Object.keys(t).filter(l=>l!=="_"),r=HA();A.locale&&(r.locale=A.locale),A.plural!==void 0&&(r.plural=gA(A.plural)?+A.plural:A.plural);const g=au(e,o),s=n[Dr](A.keypath,g,r),a=Be(HA(),i),I=gA(A.tag)||UA(A.tag)?A.tag:HC();return GA(I,a,s)}}}),Ts=Iu;function Cu(A){return WA(A)&&!gA(A[0])}function YC(A,e,t,i){const{slots:n,attrs:o}=e;return()=>{const r={part:!0};let g=HA();A.locale&&(r.locale=A.locale),gA(A.format)?r.key=A.format:UA(A.format)&&(gA(A.format.key)&&(r.key=A.format.key),g=Object.keys(A.format).reduce((C,Q)=>t.includes(Q)?Be(HA(),C,{[Q]:A.format[Q]}):C,HA()));const s=i(A.value,r,g);let a=[r.key];WA(s)?a=s.map((C,Q)=>{const h=n[C.type],f=h?h({[C.type]:C.value,index:Q,parts:s}):[C.value];return Cu(f)&&(f[0].key=`${C.type}-${Q}`),f}):gA(s)&&(a=[s]);const I=Be(HA(),o),l=gA(A.tag)||UA(A.tag)?A.tag:HC();return GA(l,I,a)}}const lu=fn({name:"i18n-n",props:Be({value:{type:Number,required:!0},format:{type:[String,Object]}},Qg),setup(A,e){const t=A.i18n||ve({useScope:A.scope,__useComponent:!0});return YC(A,e,LC,(...i)=>t[vr](...i))}}),Hs=lu,Bu=fn({name:"i18n-d",props:Be({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},Qg),setup(A,e){const t=A.i18n||ve({useScope:A.scope,__useComponent:!0});return YC(A,e,GC,(...i)=>t[kr](...i))}}),Ys=Bu;function Qu(A,e){const t=A;if(A.mode==="composition")return t.__getInstance(e)||A.global;{const i=t.__getInstance(e);return i!=null?i.__composer:A.global.__composer}}function cu(A){const e=r=>{const{instance:g,modifiers:s,value:a}=r;if(!g||!g.$)throw Ie(re.UNEXPECTED_ERROR);const I=Qu(A,g.$),l=_s(a);return[Reflect.apply(I.t,I,[...Ks(l)]),I]};return{created:(r,g)=>{const[s,a]=e(g);no&&A.global===a&&(r.__i18nWatcher=ae(a.locale,()=>{g.instance&&g.instance.$forceUpdate()})),r.__composer=a,r.textContent=s},unmounted:r=>{no&&r.__i18nWatcher&&(r.__i18nWatcher(),r.__i18nWatcher=void 0,delete r.__i18nWatcher),r.__composer&&(r.__composer=void 0,delete r.__composer)},beforeUpdate:(r,{value:g})=>{if(r.__composer){const s=r.__composer,a=_s(g);r.textContent=Reflect.apply(s.t,s,[...Ks(a)])}},getSSRProps:r=>{const[g]=e(r);return{textContent:g}}}}function _s(A){if(gA(A))return{path:A};if(vA(A)){if(!("path"in A))throw Ie(re.REQUIRED_VALUE,"path");return A}else throw Ie(re.INVALID_VALUE)}function Ks(A){const{path:e,locale:t,args:i,choice:n,plural:o}=A,r={},g=i||{};return gA(t)&&(r.locale=t),Ae(n)&&(r.plural=n),Ae(o)&&(r.plural=o),[e,g,r]}function Eu(A,e,...t){const i=vA(t[0])?t[0]:{},n=!!i.useI18nComponentName;(RA(i.globalInstall)?i.globalInstall:!0)&&([n?"i18n":Ts.name,"I18nT"].forEach(r=>A.component(r,Ts)),[Hs.name,"I18nN"].forEach(r=>A.component(r,Hs)),[Ys.name,"I18nD"].forEach(r=>A.component(r,Ys))),A.directive("t",cu(e))}function uu(A,e,t){return{beforeCreate(){const i=ki();if(!i)throw Ie(re.UNEXPECTED_ERROR);const n=this.$options;if(n.i18n){const o=n.i18n;if(n.__i18n&&(o.__i18n=n.__i18n),o.__root=e,this===this.$root)this.$i18n=Os(A,o);else{o.__injectWithOption=!0,o.__extender=t.__vueI18nExtend,this.$i18n=Sr(o);const r=this.$i18n;r.__extender&&(r.__disposer=r.__extender(this.$i18n))}}else if(n.__i18n)if(this===this.$root)this.$i18n=Os(A,n);else{this.$i18n=Sr({__i18n:n.__i18n,__injectWithOption:!0,__extender:t.__vueI18nExtend,__root:e});const o=this.$i18n;o.__extender&&(o.__disposer=o.__extender(this.$i18n))}else this.$i18n=A;n.__i18nGlobal&&TC(e,n,n),this.$t=(...o)=>this.$i18n.t(...o),this.$rt=(...o)=>this.$i18n.rt(...o),this.$tc=(...o)=>this.$i18n.tc(...o),this.$te=(o,r)=>this.$i18n.te(o,r),this.$d=(...o)=>this.$i18n.d(...o),this.$n=(...o)=>this.$i18n.n(...o),this.$tm=o=>this.$i18n.tm(o),t.__setInstance(i,this.$i18n)},mounted(){},unmounted(){const i=ki();if(!i)throw Ie(re.UNEXPECTED_ERROR);const n=this.$i18n;delete this.$t,delete this.$rt,delete this.$tc,delete this.$te,delete this.$d,delete this.$n,delete this.$tm,n.__disposer&&(n.__disposer(),delete n.__disposer,delete n.__extender),t.__deleteInstance(i),delete this.$i18n}}}function Os(A,e){A.locale=e.locale||A.locale,A.fallbackLocale=e.fallbackLocale||A.fallbackLocale,A.missing=e.missing||A.missing,A.silentTranslationWarn=e.silentTranslationWarn||A.silentFallbackWarn,A.silentFallbackWarn=e.silentFallbackWarn||A.silentFallbackWarn,A.formatFallbackMessages=e.formatFallbackMessages||A.formatFallbackMessages,A.postTranslation=e.postTranslation||A.postTranslation,A.warnHtmlInMessage=e.warnHtmlInMessage||A.warnHtmlInMessage,A.escapeParameterHtml=e.escapeParameterHtml||A.escapeParameterHtml,A.sync=e.sync||A.sync,A.__composer[MC](e.pluralizationRules||A.pluralizationRules);const t=Ro(A.locale,{messages:e.messages,__i18n:e.__i18n});return Object.keys(t).forEach(i=>A.mergeLocaleMessage(i,t[i])),e.datetimeFormats&&Object.keys(e.datetimeFormats).forEach(i=>A.mergeDateTimeFormat(i,e.datetimeFormats[i])),e.numberFormats&&Object.keys(e.numberFormats).forEach(i=>A.mergeNumberFormat(i,e.numberFormats[i])),A}const hu=Vt("global-vue-i18n");function fu(A={},e){const t=__VUE_I18N_LEGACY_API__&&RA(A.legacy)?A.legacy:__VUE_I18N_LEGACY_API__,i=RA(A.globalInjection)?A.globalInjection:!0,n=__VUE_I18N_LEGACY_API__&&t?!!A.allowComposition:!0,o=new Map,[r,g]=du(A,t),s=Vt("");function a(C){return o.get(C)||null}function I(C,Q){o.set(C,Q)}function l(C){o.delete(C)}{const C={get mode(){return __VUE_I18N_LEGACY_API__&&t?"legacy":"composition"},get allowComposition(){return n},async install(Q,...h){if(Q.__VUE_I18N_SYMBOL__=s,Q.provide(Q.__VUE_I18N_SYMBOL__,C),vA(h[0])){const E=h[0];C.__composerExtend=E.__composerExtend,C.__vueI18nExtend=E.__vueI18nExtend}let f=null;!t&&i&&(f=Su(Q,C.global)),__VUE_I18N_FULL_INSTALL__&&Eu(Q,C,...h),__VUE_I18N_LEGACY_API__&&t&&Q.mixin(uu(g,g.__composer,C));const u=Q.unmount;Q.unmount=()=>{f&&f(),C.dispose(),u()}},get global(){return g},dispose(){r.stop()},__instances:o,__getInstance:a,__setInstance:I,__deleteInstance:l};return C}}function ve(A={}){const e=ki();if(e==null)throw Ie(re.MUST_BE_CALL_SETUP_TOP);if(!e.isCE&&e.appContext.app!=null&&!e.appContext.app.__VUE_I18N_SYMBOL__)throw Ie(re.NOT_INSTALLED);const t=pu(e),i=yu(t),n=JC(e),o=mu(A,n);if(__VUE_I18N_LEGACY_API__&&t.mode==="legacy"&&!A.__useComponent){if(!t.allowComposition)throw Ie(re.NOT_AVAILABLE_IN_LEGACY_MODE);return vu(e,o,i,A)}if(o==="global")return TC(i,A,n),i;if(o==="parent"){let s=wu(t,e,A.__useComponent);return s==null&&(s=i),s}const r=t;let g=r.__getInstance(e);if(g==null){const s=Be({},A);"__i18n"in n&&(s.__i18n=n.__i18n),i&&(s.__root=i),g=Bg(s),r.__composerExtend&&(g[Fr]=r.__composerExtend(g)),ku(r,e,g),r.__setInstance(e,g)}return g}function du(A,e,t){const i=cB();{const n=__VUE_I18N_LEGACY_API__&&e?i.run(()=>Sr(A)):i.run(()=>Bg(A));if(n==null)throw Ie(re.UNEXPECTED_ERROR);return[i,n]}}function pu(A){{const e=rt(A.isCE?hu:A.appContext.app.__VUE_I18N_SYMBOL__);if(!e)throw Ie(A.isCE?re.NOT_INSTALLED_WITH_PROVIDE:re.UNEXPECTED_ERROR);return e}}function mu(A,e){return vo(A)?"__i18n"in e?"local":"global":A.useScope?A.useScope:"local"}function yu(A){return A.mode==="composition"?A.global:A.global.__composer}function wu(A,e,t=!1){let i=null;const n=e.root;let o=Du(e,t);for(;o!=null;){const r=A;if(A.mode==="composition")i=r.__getInstance(o);else if(__VUE_I18N_LEGACY_API__){const g=r.__getInstance(o);g!=null&&(i=g.__composer,t&&i&&!i[xC]&&(i=null))}if(i!=null||n===o)break;o=o.parent}return i}function Du(A,e=!1){return A==null?null:e&&A.vnode.ctx||A.parent}function ku(A,e,t){Ft(()=>{},e),Ii(()=>{const i=t;A.__deleteInstance(e);const n=i[Fr];n&&(n(),delete i[Fr])},e)}function vu(A,e,t,i={}){const n=e==="local",o=tg(null);if(n&&A.proxy&&!(A.proxy.$options.i18n||A.proxy.$options.__i18n))throw Ie(re.MUST_DEFINE_I18N_OPTION_IN_ALLOW_COMPOSITION);const r=RA(i.inheritLocale)?i.inheritLocale:!gA(i.locale),g=EA(!n||r?t.locale.value:gA(i.locale)?i.locale:Fi),s=EA(!n||r?t.fallbackLocale.value:gA(i.fallbackLocale)||WA(i.fallbackLocale)||vA(i.fallbackLocale)||i.fallbackLocale===!1?i.fallbackLocale:g.value),a=EA(Ro(g.value,i)),I=EA(vA(i.datetimeFormats)?i.datetimeFormats:{[g.value]:{}}),l=EA(vA(i.numberFormats)?i.numberFormats:{[g.value]:{}}),C=n?t.missingWarn:RA(i.missingWarn)||Ot(i.missingWarn)?i.missingWarn:!0,Q=n?t.fallbackWarn:RA(i.fallbackWarn)||Ot(i.fallbackWarn)?i.fallbackWarn:!0,h=n?t.fallbackRoot:RA(i.fallbackRoot)?i.fallbackRoot:!0,f=!!i.fallbackFormat,u=PA(i.missing)?i.missing:null,E=PA(i.postTranslation)?i.postTranslation:null,D=n?t.warnHtmlMessage:RA(i.warnHtmlMessage)?i.warnHtmlMessage:!0,c=!!i.escapeParameter,d=n?t.modifiers:vA(i.modifiers)?i.modifiers:{},p=i.pluralRules||n&&t.pluralRules;function v(){return[g.value,s.value,a.value,I.value,l.value]}const N=hA({get:()=>o.value?o.value.locale.value:g.value,set:k=>{o.value&&(o.value.locale.value=k),g.value=k}}),G=hA({get:()=>o.value?o.value.fallbackLocale.value:s.value,set:k=>{o.value&&(o.value.fallbackLocale.value=k),s.value=k}}),_=hA(()=>o.value?o.value.messages.value:a.value),S=hA(()=>I.value),b=hA(()=>l.value);function L(){return o.value?o.value.getPostTranslationHandler():E}function QA(k){o.value&&o.value.setPostTranslationHandler(k)}function dA(){return o.value?o.value.getMissingHandler():u}function IA(k){o.value&&o.value.setMissingHandler(k)}function nA(k){return v(),k()}function X(...k){return o.value?nA(()=>Reflect.apply(o.value.t,null,[...k])):nA(()=>"")}function tA(...k){return o.value?Reflect.apply(o.value.rt,null,[...k]):""}function fA(...k){return o.value?nA(()=>Reflect.apply(o.value.d,null,[...k])):nA(()=>"")}function Y(...k){return o.value?nA(()=>Reflect.apply(o.value.n,null,[...k])):nA(()=>"")}function W(k){return o.value?o.value.tm(k):{}}function z(k,x){return o.value?o.value.te(k,x):!1}function DA(k){return o.value?o.value.getLocaleMessage(k):{}}function NA(k,x){o.value&&(o.value.setLocaleMessage(k,x),a.value[k]=x)}function ne(k,x){o.value&&o.value.mergeLocaleMessage(k,x)}function LA(k){return o.value?o.value.getDateTimeFormat(k):{}}function H(k,x){o.value&&(o.value.setDateTimeFormat(k,x),I.value[k]=x)}function $(k,x){o.value&&o.value.mergeDateTimeFormat(k,x)}function AA(k){return o.value?o.value.getNumberFormat(k):{}}function cA(k,x){o.value&&(o.value.setNumberFormat(k,x),l.value[k]=x)}function SA(k,x){o.value&&o.value.mergeNumberFormat(k,x)}const w={get id(){return o.value?o.value.id:-1},locale:N,fallbackLocale:G,messages:_,datetimeFormats:S,numberFormats:b,get inheritLocale(){return o.value?o.value.inheritLocale:r},set inheritLocale(k){o.value&&(o.value.inheritLocale=k)},get availableLocales(){return o.value?o.value.availableLocales:Object.keys(a.value)},get modifiers(){return o.value?o.value.modifiers:d},get pluralRules(){return o.value?o.value.pluralRules:p},get isGlobal(){return o.value?o.value.isGlobal:!1},get missingWarn(){return o.value?o.value.missingWarn:C},set missingWarn(k){o.value&&(o.value.missingWarn=k)},get fallbackWarn(){return o.value?o.value.fallbackWarn:Q},set fallbackWarn(k){o.value&&(o.value.missingWarn=k)},get fallbackRoot(){return o.value?o.value.fallbackRoot:h},set fallbackRoot(k){o.value&&(o.value.fallbackRoot=k)},get fallbackFormat(){return o.value?o.value.fallbackFormat:f},set fallbackFormat(k){o.value&&(o.value.fallbackFormat=k)},get warnHtmlMessage(){return o.value?o.value.warnHtmlMessage:D},set warnHtmlMessage(k){o.value&&(o.value.warnHtmlMessage=k)},get escapeParameter(){return o.value?o.value.escapeParameter:c},set escapeParameter(k){o.value&&(o.value.escapeParameter=k)},t:X,getPostTranslationHandler:L,setPostTranslationHandler:QA,getMissingHandler:dA,setMissingHandler:IA,rt:tA,d:fA,n:Y,tm:W,te:z,getLocaleMessage:DA,setLocaleMessage:NA,mergeLocaleMessage:ne,getDateTimeFormat:LA,setDateTimeFormat:H,mergeDateTimeFormat:$,getNumberFormat:AA,setNumberFormat:cA,mergeNumberFormat:SA};function R(k){k.locale.value=g.value,k.fallbackLocale.value=s.value,Object.keys(a.value).forEach(x=>{k.mergeLocaleMessage(x,a.value[x])}),Object.keys(I.value).forEach(x=>{k.mergeDateTimeFormat(x,I.value[x])}),Object.keys(l.value).forEach(x=>{k.mergeNumberFormat(x,l.value[x])}),k.escapeParameter=c,k.fallbackFormat=f,k.fallbackRoot=h,k.fallbackWarn=Q,k.missingWarn=C,k.warnHtmlMessage=D}return JI(()=>{if(A.proxy==null||A.proxy.$i18n==null)throw Ie(re.NOT_AVAILABLE_COMPOSITION_IN_LEGACY);const k=o.value=A.proxy.$i18n.__composer;e==="global"?(g.value=k.locale.value,s.value=k.fallbackLocale.value,a.value=k.messages.value,I.value=k.datetimeFormats.value,l.value=k.numberFormats.value):n&&R(k)}),w}const Fu=["locale","fallbackLocale","availableLocales"],Ps=["t","rt","d","n","tm","te"];function Su(A,e){const t=Object.create(null);return Fu.forEach(n=>{const o=Object.getOwnPropertyDescriptor(e,n);if(!o)throw Ie(re.UNEXPECTED_ERROR);const r=le(o.value)?{get(){return o.value.value},set(g){o.value.value=g}}:{get(){return o.get&&o.get()}};Object.defineProperty(t,n,r)}),A.config.globalProperties.$i18n=t,Ps.forEach(n=>{const o=Object.getOwnPropertyDescriptor(e,n);if(!o||!o.value)throw Ie(re.UNEXPECTED_ERROR);Object.defineProperty(A.config.globalProperties,`$${n}`,o)}),()=>{delete A.config.globalProperties.$i18n,Ps.forEach(n=>{delete A.config.globalProperties[`$${n}`]})}}nu();__INTLIFY_JIT_COMPILATION__?ws(zE):ws(XE);_E(mE);KE(yC);if(__INTLIFY_PROD_DEVTOOLS__){const A=ft();A.__INTLIFY__=!0,bE(A.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}const Jt=EA({isOnline:!1,error:"",lastCheck:null}),ge=EA({chip:null,board:null,firmware:null,flash:null,assetsPartition:null,network:null,screen:null}),sn=EA(""),an=EA(""),Rr=EA(!1),mi=EA(null),Ru=A=>new URLSearchParams(window.location.search).get(A),Pn=async(A,e={})=>{const t=await fetch(`/xiaozhi/device/tools/call/${an.value}`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${sn.value}`},body:JSON.stringify({name:A,arguments:e})});if(t.ok)return await t.json();{const i=await t.text();console.error(`MCP tool ${A} failed:`,t.status,i);let n=`Failed to call ${A}`;try{const o=JSON.parse(i);o.message&&(n=o.message)}catch{n=`${n}: HTTP ${t.status}`}throw new Error(n)}},bu=async()=>{var A,e,t,i;try{const[n,o,r]=await Promise.allSettled([Pn("self.get_system_info"),Pn("self.get_device_status"),Pn("self.screen.get_info")]);if(n.status==="fulfilled"&&n.value){const g=n.value.data||n.value;if(ge.value.chip={model:g.chip_model_name||"Unknown"},ge.value.board={model:((A=g.board)==null?void 0:A.name)||"Unknown"},ge.value.firmware={version:((e=g.application)==null?void 0:e.version)||"Unknown"},g.flash_size){const s=Math.round(g.flash_size/1024/1024);ge.value.flash={size:`${s}MB`}}else ge.value.flash={size:"Unknown"};if(g.partition_table){const s=g.partition_table.find(a=>a.label==="assets");s?ge.value.assetsPartition={size:s.size,sizeFormatted:`${Math.round(s.size/1024/1024)}MB`}:ge.value.assetsPartition=null}else ge.value.assetsPartition=null}else console.warn("系统信息获取失败:",n.reason||n.value),ge.value.chip={model:"Unknown"},ge.value.board={model:"Unknown"},ge.value.firmware={version:"Unknown"},ge.value.flash={size:"Unknown"},ge.value.assetsPartition=null;if(o.status==="fulfilled"&&o.value){const g=o.value.data||o.value;ge.value.network={type:((t=g.network)==null?void 0:t.type)||"unknown",signal:((i=g.network)==null?void 0:i.signal)||"Unknown"}}else console.warn("设备状态获取失败:",o.reason||o.value),ge.value.network={type:"unknown",signal:"Unknown"};if(r.status==="fulfilled"&&r.value){const g=r.value.data||r.value;ge.value.screen={resolution:`${g.width||0}x${g.height||0}`}}else console.warn("屏幕信息获取失败:",r.reason||r.value),ge.value.screen={resolution:"Unknown"}}catch(n){console.error("获取设备信息时发生错误:",n)}},bo=async(A=!0)=>{Rr.value=!0;try{const e=await fetch(`/xiaozhi/device/tools/list/${an.value}`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${sn.value}`}});if((await e.json()).code===0)Jt.value.isOnline=!0,Jt.value.error="",Jt.value.lastCheck=new Date,A&&await bu();else throw new Error(`HTTP ${e.status}: ${e.statusText}`)}catch{Jt.value.isOnline=!1,Jt.value.error="",Jt.value.lastCheck=new Date,mi.value&&clearTimeout(mi.value),mi.value=setTimeout(bo,3e4)}finally{Rr.value=!1}},Nu=(A,e)=>{if(!A)return e("device.signal.unknown");switch(A.toLowerCase()){case"strong":return e("device.signal.strong");case"medium":return e("device.signal.medium");case"weak":return e("device.signal.weak");case"none":return e("device.signal.none");default:return A}},Gu=()=>{const A=localStorage.getItem("token");an.value=Ru("deviceId"),A&&an.value&&(sn.value=JSON.parse(A).token,bo())},Lu=()=>{mi.value&&(clearTimeout(mi.value),mi.value=null)},Uu=async()=>{await bo()};function No(){const A=hA(()=>!!sn.value),e=hA(()=>Jt.value.isOnline);return{token:sn,deviceId:an,deviceStatus:Jt,deviceInfo:ge,isChecking:Rr,hasToken:A,isDeviceOnline:e,initializeDeviceStatus:Gu,cleanupDeviceStatus:Lu,refreshDeviceStatus:Uu,checkDeviceStatus:bo,callMcpTool:Pn,getSignalDisplayText:Nu}}const Vs={__name:"WifiIcon",props:{size:{type:String,default:"w-4 h-4"},color:{type:String,default:"text-blue-500"}},setup(A){const e=A,t=hA(()=>`${e.size} ${e.color}`);return(i,n)=>(T(),K("svg",{class:kA(t.value),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...n[0]||(n[0]=[B("path",{d:"M3 9c4.97-4.97 13.03-4.97 18 0","stroke-width":"2","stroke-linecap":"round"},null,-1),B("path",{d:"M6 12c3.31-3.31 8.69-3.31 12 0","stroke-width":"2","stroke-linecap":"round"},null,-1),B("path",{d:"M9 15c1.66-1.66 4.34-1.66 6 0","stroke-width":"2","stroke-linecap":"round"},null,-1),B("circle",{cx:"12",cy:"18",r:"1.5",fill:"currentColor"},null,-1)])],2))}},Ws={__name:"Signal4GIcon",props:{size:{type:String,default:"w-4 h-4"},color:{type:String,default:"text-green-500"}},setup(A){const e=A,t=hA(()=>`${e.size} ${e.color}`);return(i,n)=>(T(),K("svg",{class:kA(t.value),fill:"currentColor",viewBox:"0 0 24 24"},[...n[0]||(n[0]=[Do('4G',5)])],2))}},qs={__name:"ChipIcon",props:{size:{type:String,default:"w-4 h-4"},color:{type:String,default:"text-gray-400"}},setup(A){const e=A,t=hA(()=>`${e.size} ${e.color}`);return(i,n)=>(T(),K("svg",{class:kA(t.value),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...n[0]||(n[0]=[Do('',14)])],2))}},js={__name:"FlashIcon",props:{size:{type:String,default:"w-4 h-4"},color:{type:String,default:"text-gray-400"}},setup(A){const e=A,t=hA(()=>`${e.size} ${e.color}`);return(i,n)=>(T(),K("svg",{class:kA(t.value),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...n[0]||(n[0]=[Do('',10)])],2))}},Zs={__name:"BoardIcon",props:{size:{type:String,default:"w-4 h-4"},color:{type:String,default:"text-gray-400"}},setup(A){const e=A,t=hA(()=>`${e.size} ${e.color}`);return(i,n)=>(T(),K("svg",{class:kA(t.value),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...n[0]||(n[0]=[Do('',10)])],2))}},Xs={__name:"ScreenIcon",props:{size:{type:String,default:"w-4 h-4"},color:{type:String,default:"text-gray-400"}},setup(A){const e=A,t=hA(()=>`${e.size} ${e.color}`);return(i,n)=>(T(),K("svg",{class:kA(t.value),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...n[0]||(n[0]=[B("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9.75 17L9 20l-1 1h8l-1-1-.75-3M3 13h18M5 17h14a2 2 0 002-2V5a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"},null,-1)])],2))}},Mu={class:"flex items-center space-x-2"},xu={class:"flex items-center space-x-1"},Ju={key:0,class:"flex items-center space-x-1"},Tu={class:"text-xs text-gray-500"},Hu={key:0,class:"flex items-center space-x-4 text-sm text-gray-600"},Yu={key:0,class:"flex items-center space-x-1"},_u={key:1,class:"flex items-center space-x-1"},Ku={key:2,class:"flex items-center space-x-1"},Ou={key:3,class:"flex items-center space-x-1"},Pu={key:1,class:"lg:hidden flex flex-col bg-white rounded-lg border border-gray-200 shadow-sm overflow-hidden"},Vu={class:"flex items-center justify-between px-4 py-3 bg-gray-50 border-b border-gray-200"},Wu={class:"flex items-center space-x-2"},qu={key:0,class:"flex items-center space-x-1"},ju={class:"text-xs font-medium text-gray-600"},Zu={key:0,class:"px-4 py-3"},Xu={class:"grid grid-cols-1 gap-2.5"},zu={class:"flex justify-between items-center py-1.5 border-b border-gray-100"},$u={key:0,class:"flex items-center space-x-2 flex-1"},Ah={class:"min-w-0 flex-1"},eh={class:"text-xs text-gray-500 leading-tight"},th={class:"text-sm text-gray-800 font-medium truncate"},ih={key:1,class:"flex items-center space-x-2 flex-1 ml-3"},nh={class:"min-w-0 flex-1"},oh={class:"text-xs text-gray-500 leading-tight"},rh={class:"text-sm text-gray-800 font-medium truncate"},gh={class:"flex justify-between items-center py-1.5"},sh={key:0,class:"flex items-center space-x-2 flex-1"},ah={class:"min-w-0 flex-1"},Ih={class:"text-xs text-gray-500 leading-tight"},Ch={class:"text-sm text-gray-800 font-medium"},lh={key:1,class:"flex items-center space-x-2 flex-1 ml-3"},Bh={class:"min-w-0 flex-1"},Qh={class:"text-xs text-gray-500 leading-tight"},ch={class:"text-sm text-gray-800 font-medium"},Eh={__name:"DeviceStatus",setup(A){const{t:e}=ve(),{deviceStatus:t,deviceInfo:i,hasToken:n,initializeDeviceStatus:o,cleanupDeviceStatus:r,getSignalDisplayText:g}=No(),s=hA(()=>n.value);return Ft(()=>{o()}),Ii(()=>{r()}),(a,I)=>(T(),K(qA,null,[s.value?(T(),K("div",{key:0,class:kA(["hidden lg:flex items-center space-x-4",BA(t).isOnline?"":"opacity-60"])},[B("div",Mu,[B("div",xu,[B("div",{class:kA(["w-2 h-2 rounded-full",BA(t).isOnline?"bg-green-500":"bg-gray-400"])},null,2),B("span",{class:kA(["text-sm font-medium",BA(t).isOnline?"text-gray-700":"text-gray-500"])},F(BA(t).isOnline?a.$t("device.online"):a.$t("device.offline")),3)]),BA(t).isOnline&&BA(i).network?(T(),K("div",Ju,[BA(i).network.type==="wifi"?(T(),ye(BA(Vs),{key:0,color:"text-blue-500"})):BA(i).network.type==="4g"?(T(),ye(BA(Ws),{key:1})):sA("",!0),B("span",Tu,F(BA(g)(BA(i).network.signal,BA(e))),1)])):sA("",!0)]),BA(t).isOnline?(T(),K("div",Hu,[BA(i).chip?(T(),K("div",Yu,[TA(BA(qs)),B("span",null,F(BA(i).chip.model),1)])):sA("",!0),BA(i).flash?(T(),K("div",_u,[TA(BA(js)),B("span",null,F(BA(i).flash.size),1)])):sA("",!0),BA(i).board?(T(),K("div",Ku,[TA(BA(Zs)),B("span",null,F(BA(i).board.model),1)])):sA("",!0),BA(i).screen?(T(),K("div",Ou,[TA(BA(Xs)),B("span",null,F(BA(i).screen.resolution),1)])):sA("",!0)])):sA("",!0)],2)):sA("",!0),s.value?(T(),K("div",Pu,[B("div",Vu,[B("div",Wu,[B("div",{class:kA(["w-2.5 h-2.5 rounded-full",BA(t).isOnline?"bg-green-500":"bg-red-400"])},null,2),B("span",{class:kA(["text-sm font-medium",BA(t).isOnline?"text-gray-800":"text-gray-600"])},F(BA(t).isOnline?a.$t("device.online"):a.$t("device.offline")),3)]),BA(t).isOnline&&BA(i).network?(T(),K("div",qu,[BA(i).network.type==="wifi"?(T(),ye(BA(Vs),{key:0,color:"text-blue-500"})):BA(i).network.type==="4g"?(T(),ye(BA(Ws),{key:1})):sA("",!0),B("span",ju,F(BA(g)(BA(i).network.signal,BA(e))),1)])):sA("",!0)]),BA(t).isOnline?(T(),K("div",Zu,[B("div",Xu,[B("div",zu,[BA(i).chip?(T(),K("div",$u,[TA(BA(qs),{class:"flex-shrink-0"}),B("div",Ah,[B("div",eh,F(a.$t("device.chip")),1),B("div",th,F(BA(i).chip.model),1)])])):sA("",!0),BA(i).board?(T(),K("div",ih,[TA(BA(Zs),{class:"flex-shrink-0"}),B("div",nh,[B("div",oh,F(a.$t("device.board")),1),B("div",rh,F(BA(i).board.model),1)])])):sA("",!0)]),B("div",gh,[BA(i).flash?(T(),K("div",sh,[TA(BA(js),{class:"flex-shrink-0"}),B("div",ah,[B("div",Ih,F(a.$t("device.flash")),1),B("div",Ch,F(BA(i).flash.size),1)])])):sA("",!0),BA(i).screen?(T(),K("div",lh,[TA(BA(Xs),{class:"flex-shrink-0"}),B("div",Bh,[B("div",Qh,F(a.$t("device.screen")),1),B("div",ch,F(BA(i).screen.resolution),1)])])):sA("",!0)])])])):sA("",!0)])):sA("",!0)],64))}},uh={title:"Xiaozhi AI Customization"},hh={cancel:"Cancel",confirm:"Confirm",close:"Close",start:"Start",download:"Download",generate:"Generate",reset:"Reset",yes:"Yes",no:"No",loading:"Loading...",error:"Error",success:"Success",warning:"Warning",info:"Information",next:"Next",previous:"Previous",finish:"Finish",retry:"Retry",ok:"OK",other:"Other"},fh={title:"Xiaozhi AI Customization"},dh={title:"Saved Configuration Detected",message:"Configuration has been automatically restored. You can continue from where you left off or start over.",restart:"Start Over"},ph={chip:"Chip Configuration",theme:"Theme Design",generate:"Preview & Generate"},mh={title:"Generate assets.bin",confirmConfig:"Please confirm your configuration",chipModel:"Chip Model:",resolution:"Resolution:",wakeword:"Wake Word:",font:"Font:",emoji:"Emoji Package:",fileList:"Included Files List",estimated:"Estimated",compressed:"Before compression",generating:"Generating assets.bin...",progress:"{progress}% Complete",completed:"Your assets.bin file is ready",filename:"Filename: assets.bin",fileSize:"File Size: {size}",generationTime:"Generation Time: {time}",downloadAssets:"Download assets.bin",flashToDevice:"Flash to Device Online",flashing:"Flashing to device...",flashingCancel:"Cancel Flash",flashingError:"Flashing Error",flashingInProgress:"Flashing in progress, please do not close the window",customFont:"Custom Font",customEmoji:"Custom Emoji Package",notConfigured:"Not Configured",wakewordNames:{wn9s_hilexin:"Hi, Espressif",wn9s_hiesp:"Hi, ESP",wn9s_nihaoxiaozhi:"Hello Xiaozhi",wn9_nihaoxiaozhi_tts:"Hello Xiaozhi",wn9_alexa:"Alexa"}},yh={init:"Initialize Generator",font:"Process Font Files",wakeword:"Package Wake Word Model",emoji:"Process Emoji Images",background:"Process Background Images",index:"Generate Index File",spiffs:"Build SPIFFS Mapping",package:"Complete Packaging"},wh={title:"Wake Word Configuration",description:"Select a preset wake word model or customize it using a command recognition model.",supportWakeNet9:"Your chip supports WakeNet9 models.",supportWakeNet9s:"Your chip supports WakeNet9s models.",notSupported:"Your chip does not support wake word functionality.",notice:"Note:",unsupportedMessage:"{chipModel} chip does not support wake word functionality. If you need to use wake words, please select ESP32-S3, ESP32-P4, or ESP32-C3/C5/C6 chips.",noWakeword:"No Wake Word",presetWakeword:"Preset Wake Word",customWakeword:"Custom Wake Word",selectWakeword:"Select Wake Word",placeholder:"Select wake word...",customSettings:"Custom Wake Word Settings",wakewordName:"Wake Word Name",wakewordNamePlaceholder:"e.g., Xiaozhi / Potato",wakewordCommand:"Wake Command",wakewordCommandPlaceholderCN:"Pinyin separated by spaces, e.g., ni hao xiao zhi",wakewordCommandPlaceholderEN:"English words, no punctuation, e.g., HELLO POTATO",threshold:"Sensitivity Threshold (0-100)",thresholdDesc:"Lower is more sensitive, default 20",duration:"Recognition Duration",durationDesc:"Maximum duration for command recognition",selectModel:"Select Recognition Model",mn6cn:"MultiNet6 (Chinese)",mn6en:"MultiNet6 (English)",mn7cn:"MultiNet7 (Chinese)",mn7en:"MultiNet7 (English)",errors:{nameRequired:"Please enter wake word name",commandRequired:"Please enter wake command",noPunctuation:"Command cannot contain punctuation",durationRange:"Duration must be between 500-10000ms"},tips:{tipLabel:"Tip:",optional:"Wake words are optional. If disabled, the device cannot be voice-activated.",wakeNet9sOnly:"C3/C5/C6 chips only support WakeNet9s lightweight models.",wakeNet9Full:"S3/P4 chips support complete WakeNet9 models with more choices.",customSupport:"Custom wake words use MultiNet models, currently only supported on ESP32-S3."}},Dh={resetFailed:"Reset failed, please refresh the page and try again",generationFailed:"Generation failed: {error}",noFileToDownload:"No downloadable file available",deviceOffline:"Device is offline and cannot be flashed",fileTooLarge:"Flash failed: File size {fileSize}MB exceeds assets partition size {partitionSize}MB. Please reduce configuration content or use a device with larger capacity.",flashCancelConfirm:"Are you sure you want to cancel flashing?",oldDataCleared:`Old version emoji data structure has been detected and cleared. The new version uses file deduplication technology to save storage space. @@ -52,25 +52,25 @@ Please re-upload custom emoji images.`,incompatibleEmojiData:"Incompatible emoji Phiên bản mới sử dụng công nghệ loại bỏ trùng lặp tệp để tiết kiệm không gian lưu trữ. -Vui lòng tải lại hình ảnh biểu tượng cảm xúc tùy chỉnh.`,incompatibleEmojiData:"Phát hiện dữ liệu biểu tượng cảm xúc không tương thích, vui lòng cấu hình lại"},Pf={authTokenMissing:"Không tìm thấy mã thông báo xác thực",checkingDeviceStatus:"Đang kiểm tra trạng thái thiết bị...",deviceOfflineOrUnresponsive:"Thiết bị không tồn tại hoặc không trực tuyến",unableToGetDeviceStatus:"Không thể lấy trạng thái thiết bị",initializingTransferService:"Đang khởi tạo dịch vụ truyền tải...",initializeTransferFailed:"Khởi tạo dịch vụ truyền tải thất bại: {error}",uploadingFile:"Tải lên tập tin. .....",uploadFailed:"Tải lên tập tin không thành công",settingDeviceDownloadUrl:"Đang thiết lập URL tải xuống thiết bị...",setDownloadUrlFailed:"Thiết lập URL tải xuống thất bại: {error}",rebootingDevice:"Đang khởi động lại thiết bị...",waitingForDeviceReboot:"Đang chờ thiết bị khởi động lại...",deviceRebootTimeout:"Hết thời gian chờ thiết bị khởi động lại (60 giây)",deviceReady:"Thiết bị đã sẵn sàng, vui lòng chờ chương trình ghi",startingFileTransfer:"Đang bắt đầu truyền tải tệp...",flashCompleted:"Trong quá trình ghi âm chương trình, xin lưu ý trạng thái ghi âm của phần cố định!",onlineFlashFailed:"Flash trực tuyến thất bại: {error}"},Vf={online:"Trực tuyến",offline:"Ngoại tuyến",checking:"Đang kiểm tra...",flashing:"Đang flash...",ready:"Sẵn sàng",chip:"Chip",board:"Bo mạch",flash:"Flash",screen:"Màn hình",signal:{unknown:"Không xác định",strong:"Mạnh",medium:"Trung bình",weak:"Yếu",none:"Không có tín hiệu"}},Wf={title:"Bước 1: Cấu hình mô hình chip và màn hình",loadingFromDevice:"Đang tải cấu hình phần cứng từ thiết bị...",loadedFromDevice:"Cấu hình phần cứng được tải tự động từ thiết bị",manualConfig:"Vui lòng cấu hình các thông số phần cứng theo cách thủ công",loadingTitle:"Đang tải cấu hình thiết bị...",loadingDesc:"Đang đọc mô hình chip và độ phân giải màn hình từ thiết bị",autoLoadedTitle:"Cấu hình thiết bị được tải tự động",chipModel:"Mô hình chip",screenWidth:"Chiều rộng màn hình",screenHeight:"Chiều cao màn hình",colorFormat:"Định dạng màu:",manualEdit:"Cấu hình thủ công",collapseManual:"Thu gọn cấu hình thủ công",manualConfigTitle:"Cấu hình phần cứng thủ công",next:"Tiếp theo",selectChip:"Chọn chip",chipRequired:"Mô hình chip",widthRequired:"Chiều rộng màn hình",heightRequired:"Chiều cao màn hình",loadingError:"Lỗi tải cấu hình",deviceOffline:"Thiết bị chưa kết nối hoặc ngoại tuyến",chipModelError:"Không thể lấy mô hình chip, vui lòng nhập thủ công",resolutionError:"Không thể lấy độ phân giải màn hình, vui lòng nhập thủ công",timeoutError:"Hết thời gian tải cấu hình, vui lòng nhập thủ công",manualConfigDesc:"Không thể tự động đọc cấu hình thiết bị",manualConfigHint:"Thiết bị chưa kết nối hoặc ngoại tuyến, vui lòng nhập cấu hình phần cứng thủ công",manualConfigRequired:"Vui lòng nhập cấu hình phần cứng thủ công",resolutionFormatError:"Lỗi định dạng độ phân giải màn hình"},qf={title:"Bước 2: Thiết kế chủ đề",description:"Cấu hình từ đánh thức, phông chữ, biểu tượng cảm xúc và nền để tùy chỉnh chủ đề Xiaozhi AI của bạn.",previous:"Trước đó",next:"Tiếp theo",tabs:{wakeword:"Cấu hình từ đánh thức",font:"Cấu hình phông chữ",emoji:"Bộ sưu tập biểu tượng cảm xúc",background:"Nền trò chuyện"}},jf={title:"Bước 3: Xem trước",description:"Xem trước hiệu ứng của cấu hình tùy chỉnh trên thiết bị thực tế.",devicePreview:"Xem trước thiết bị (tỷ lệ pixel 1:1)",previewSettings:"Cài đặt xem trước",previewText:"Văn bản xem trước",defaultPreviewText:"Xin chào, tôi là bạn của bạn Xiaozhi!",currentEmotion:"Cảm xúc hiện tại",themeMode:"Chế độ chủ đề",lightMode:"Sáng",darkMode:"Tối",configSummary:"Tóm tắt cấu hình",wakeword:"Từ đánh thức:",font:"Phông chữ:",loading:"Đang tải...",emotion:"Cảm xúc:",skin:"Da:",previous:"Trước đó",generate:"Tạo assets.bin",emotions:{neutral:"Trung lập",happy:"Vui vẻ",laughing:"Cười lớn",funny:"Hài hước",sad:"Buồn",angry:"Giận dữ",crying:"Khóc",loving:"Yêu thương",embarrassed:"Xấu hổ",surprised:"Bất ngờ",shocked:"Sốc",thinking:"Suy nghĩ",winking:"Nháy mắt",cool:"Ngầu",relaxed:"Thoải mái",delicious:"Ngon miệng",kissy:"Hôn",confident:"Tự tin",sleepy:"Buồn ngủ",silly:"Ngớ ngẩn",confused:"Bối rối"},noEmotionConfigured:"Chưa cấu hình cảm xúc",fontLoading:"Đang tải phông chữ...",configureEmojiFirst:"Vui lòng cấu hình gói biểu tượng cảm xúc trong thiết kế chủ đề trước",customFont:"Phông chữ tùy chỉnh {size}px",customEmoji:"Biểu tượng cảm xúc tùy chỉnh {count} hình ảnh",notConfigured:"Chưa cấu hình",skinLight:"Sáng {type}",skinDark:"Tối {type}",hideSubtitle:"Ẩn phụ đề:",image:"Hình ảnh",color:"Màu sắc"},Zf={title:"Cấu hình nền trò chuyện",description:"Cấu hình nền trò chuyện cho chế độ sáng và tối, hỗ trợ màu đơn hoặc hình ảnh tùy chỉnh.",lightMode:"Nền chế độ sáng",darkMode:"Nền chế độ tối",solidBackground:"Nền màu đơn",imageBackground:"Nền hình ảnh",backgroundColor:"Màu nền:",textColor:"Màu chữ:",backgroundImage:"Hình ảnh nền:",clickOrDragToUpload:"Nhấp hoặc kéo để tải lên hình ảnh nền",removeImage:"Xóa hình ảnh",backgroundPreview:"Xem trước nền",lightModePreview:"Chế độ sáng",darkModePreview:"Chế độ tối",chatArea:"Khu vực nội dung trò chuyện",quickConfig:"Cấu hình nhanh",defaultColors:"Màu mặc định",stoneTexture:"Kết cấu đá",sunnyColors:"Màu nắng",skyBlue:"Xanh trời",romanticPink:"Hồng lãng mạn",selectValidImage:"Vui lòng chọn tệp hình ảnh hợp lệ"},Xf={title:"Cấu hình bộ sưu tập biểu tượng cảm xúc",description:"Chọn gói biểu tượng cảm xúc đặt sẵn hoặc hình ảnh biểu tượng cảm xúc tùy chỉnh. Mỗi gói biểu tượng cảm xúc chứa 21 biểu cảm cảm xúc khác nhau.",noEmojiPack:"Không có gói biểu tượng cảm xúc",noEmojiPackDescription:"Không cấu hình gói biểu tượng cảm xúc, chỉ bao gồm phông chữ và tài nguyên nền trong gói.",presetEmojiPack:"Gói biểu tượng cảm xúc đặt sẵn",customEmojiPack:"Gói biểu tượng cảm xúc tùy chỉnh",selectPresetEmojiPack:"Chọn gói biểu tượng cảm xúc đặt sẵn",twemoji64:"Twemoji 64×64",twemoji32:"Twemoji 32×32",twemojiDescription:"Bộ biểu tượng cảm xúc chất lượng cao từ Twitter, hoàn hảo để hiển thị rõ ràng",twitterEmojiName:"Twemoji {size}x{size}",twitterEmojiDescription:"Gói biểu tượng cảm xúc Twitter, {size}×{size} pixel",size:"Kích thước",preview:"Xem trước",select:"Chọn",customEmojiTitle:"Gói biểu tượng cảm xúc tùy chỉnh",customEmojiDescription:"Tải lên hình ảnh biểu tượng cảm xúc của riêng bạn. Mỗi cảm xúc cần một hình ảnh.",uploadInstructions:"Nhấp hoặc kéo để tải lên hình ảnh biểu tượng cảm xúc (PNG/JPG/WEBP)",supportedFormats:"Định dạng được hỗ trợ: PNG, JPG, WEBP. Kích thước khuyến nghị: 64×64 pixel",emotionMapping:"Ánh xạ cảm xúc",uploadAllEmotions:"Vui lòng tải lên hình ảnh biểu tượng cảm xúc cho tất cả cảm xúc",maxImageWidth:"Chiều rộng hình ảnh tối đa (px)",maxImageHeight:"Chiều cao hình ảnh tối đa (px)",clickToUpload:"Nhấp để tải lên",orDragDrop:"hoặc kéo và thả",clickToUploadOrDrag:"Nhấp để tải lên hoặc kéo vào đây",remove:"Xóa",replace:"Thay thế",selectValidEmojiImage:"Vui lòng chọn tệp hình ảnh biểu tượng cảm xúc hợp lệ",selectValidFormat:"Vui lòng chọn hình ảnh định dạng PNG hoặc GIF hợp lệ",maxFileSize:"Kích thước tệp không được vượt quá 1MB",invalidFormat:"Định dạng hình ảnh không được hỗ trợ. Vui lòng sử dụng PNG, JPG hoặc WEBP.",required:"Bắt buộc",uploadEmojiImages:"Tải lên hình ảnh biểu tượng cảm xúc (GIF cần PSRAM)",customEmojiPackConfig:"Cấu hình gói biểu tượng cảm xúc tùy chỉnh",neutralRequiredNotice:"* Phải tải lên cảm xúc mặc định trung lập, các cảm xúc khác là tùy chọn. Nếu không tải lên, cảm xúc mặc định sẽ được sử dụng thay thế.",sharedFileMessage:"Cảm xúc {emotionKey} sử dụng cùng tệp hình ảnh với {existingEmotions} (lưu trữ chia sẻ)",fileDeleted:"Tệp {fileHash} đã bị xóa (không có tham chiếu cảm xúc khác)",fileRetained:"Tệp {fileHash} vẫn được sử dụng bởi các cảm xúc khác, được giữ lại",imageLoadFailed:"Không tải được hình ảnh biểu tượng cảm xúc",emotions:{neutral:"Trung lập",happy:"Vui vẻ",laughing:"Cười lớn",funny:"Hài hước",sad:"Buồn",angry:"Giận dữ",crying:"Khóc",loving:"Yêu thương",embarrassed:"Xấu hổ",surprised:"Bất ngờ",shocked:"Sốc",thinking:"Suy nghĩ",winking:"Nháy mắt",cool:"Ngầu",relaxed:"Thoải mái",delicious:"Ngon miệng",kissy:"Hôn",confident:"Tự tin",sleepy:"Buồn ngủ",silly:"Ngớ ngẩn",confused:"Bối rối"}},zf={title:"Cấu hình phông chữ",description:"Chọn phông chữ đặt sẵn hoặc tải lên tệp phông chữ tùy chỉnh.",noFonts:"Không có phông chữ",noFontsDescription:"Không sử dụng cấu hình phông chữ, thiết bị sẽ sử dụng phông chữ mặc định",presetFonts:"Phông chữ đặt sẵn",customFonts:"Phông chữ tùy chỉnh",selectPresetFont:"Chọn phông chữ đặt sẵn",fontSize:"Kích thước phông chữ:",bitDepth:"Độ sâu bit:",charset:"Bộ ký tự:",fileSize:"Kích thước tệp:",customFontConfig:"Cấu hình phông chữ tùy chỉnh",fontFile:"Tệp phông chữ",clickSelectFontFile:"Nhấp để chọn tệp phông chữ",orDragFileHere:"hoặc kéo tệp vào đây",supportedFormats:"Hỗ trợ định dạng TTF, WOFF, WOFF2",removeFile:"Xóa tệp",fontSizePx:"Kích thước phông chữ (px)",range:"Phạm vi:",bitDepthBpp:"Độ sâu bit (BPP)",monochrome:"1 bpp (Đơn sắc)",fourColors:"2 bpp (4 màu)",sixteenColors:"4 bpp (16 màu)",characterSet:"Bộ ký tự",deepseekR1:"DeepSeek R1 (7405 ký tự)",gb2312:"GB2312 (7445 ký tự)",qwen18409:"Qwen (18409 ký tự)",latin1:"Latin1 (190 ký tự)",fullCharset:"Bộ ký tự đầy đủ (Tất cả ký tự trong tệp phông chữ)",hideSubtitle:"Ẩn phụ đề",hideSubtitleDescription:"Không hiển thị phụ đề văn bản trong khi trò chuyện",selectValidFontFile:"Vui lòng chọn tệp phông chữ hợp lệ (TTF, WOFF, WOFF2)",presetFontNames:{font_puhui_deepseek_14_1:"Alibaba PuHuiTi 14px",font_puhui_deepseek_16_4:"Alibaba PuHuiTi 16px",font_puhui_deepseek_20_4:"Alibaba PuHuiTi 20px",font_puhui_deepseek_30_4:"Alibaba PuHuiTi 30px",font_noto_qwen_14_1:"Noto Sans 14px",font_noto_qwen_16_4:"Noto Sans 16px",font_noto_qwen_20_4:"Noto Sans 20px",font_noto_qwen_30_4:"Noto Sans 30px"},charsetDeepseek:"DeepSeek 7405",charsetQwen:"Qwen 18409"},$f={app:Mf,common:xf,header:Jf,configNotice:Tf,steps:Hf,generateModal:Yf,progressSteps:_f,wakewordConfig:Kf,errors:Of,flashProgress:Pf,device:Vf,chipConfig:Wf,themeDesign:qf,generateSummary:jf,backgroundConfig:Zf,emojiConfig:Xf,fontConfig:zf},Ad={en:Lh,"zh-CN":zh,"zh-TW":uf,ja:Uf,vi:$f},Nn=[{code:"en",name:"English",flag:"🇺🇸"},{code:"zh-CN",name:"简体中文",flag:"🇨🇳"},{code:"zh-TW",name:"繁體中文",flag:"🇹🇼"},{code:"ja",name:"日本語",flag:"🇯🇵"},{code:"vi",name:"Tiếng Việt",flag:"🇻🇳"}];function ed(){const A=navigator.language||navigator.userLanguage;return{"zh-CN":"zh-CN","zh-TW":"zh-TW","zh-HK":"zh-TW",zh:"zh-CN",ja:"ja",vi:"vi",en:"en","en-US":"en","en-GB":"en"}[A]||"en"}const td={class:"relative"},id={class:"py-1"},nd=["onClick"],od={class:"mr-3"},rd={key:0,class:"ml-auto w-4 h-4 text-blue-600",fill:"currentColor",viewBox:"0 0 20 20"},gd={__name:"LanguageSelector",setup(A){const{locale:e}=ve(),t=cA(!1),i=hA(()=>Nn.find(s=>s.code===e.value)||Nn[0]),n=()=>{t.value=!t.value},o=()=>{t.value=!1},r=s=>{e.value=s,localStorage.setItem("user-language",s),o()},g=s=>{s.target.closest(".relative")||o()};return Ft(()=>{document.addEventListener("click",g);const s=localStorage.getItem("user-language");s&&Nn.find(a=>a.code===s)&&(e.value=s)}),Ii(()=>{document.removeEventListener("click",g)}),(s,a)=>(T(),_("div",td,[B("button",{onClick:n,class:"flex items-center space-x-2 px-3 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-md hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500"},[B("span",null,v(i.value.flag),1),B("span",null,v(i.value.name),1),(T(),_("svg",{class:kA(["w-4 h-4 transition-transform duration-200",{"rotate-180":t.value}]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...a[1]||(a[1]=[B("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 9l-7 7-7-7"},null,-1)])],2))]),t.value?(T(),_("div",{key:0,class:"absolute right-0 mt-2 w-48 bg-white border border-gray-200 rounded-md shadow-lg z-50",onClick:a[0]||(a[0]=dt(()=>{},["stop"]))},[B("div",id,[(T(!0),_(qA,null,Ke(BA(Nn),I=>(T(),_("button",{key:I.code,onClick:l=>r(I.code),class:kA(["flex items-center w-full px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 focus:outline-none focus:bg-gray-100",{"bg-blue-50 text-blue-700":I.code===i.value.code}])},[B("span",od,v(I.flag),1),B("span",null,v(I.name),1),I.code===i.value.code?(T(),_("svg",rd,[...a[2]||(a[2]=[B("path",{"fill-rule":"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z","clip-rule":"evenodd"},null,-1)])])):sA("",!0)],10,nd))),128))])])):sA("",!0),t.value?(T(),_("div",{key:1,class:"fixed inset-0 z-40",onClick:o})):sA("",!0)]))}},sd={class:"space-y-6"},ad={class:"text-xl font-semibold text-gray-900 mb-4"},Id={class:"text-gray-600 mb-6"},Cd={key:0},ld={key:1},Bd={key:2},Qd={key:0,class:"space-y-4"},cd={class:"bg-blue-50 border-2 border-blue-200 rounded-lg p-6"},Ed={class:"flex items-center justify-center space-x-3"},ud={class:"text-lg font-medium text-blue-900"},hd={class:"text-sm text-blue-700 mt-1"},fd={key:1,class:"space-y-4"},dd={class:"bg-green-50 border-2 border-green-200 rounded-lg p-4"},pd={class:"flex items-start justify-between mb-3"},md={class:"flex items-center"},yd={class:"text-lg font-medium text-green-900"},wd={class:"grid grid-cols-1 md:grid-cols-3 gap-4 mt-4"},Dd={class:"bg-white rounded-lg p-3"},kd={class:"block text-sm font-medium text-gray-700 mb-1"},vd={class:"text-base font-semibold text-gray-900"},Fd={class:"bg-white rounded-lg p-3"},Sd={class:"block text-sm font-medium text-gray-700 mb-1"},Rd={class:"text-base font-semibold text-gray-900"},bd={class:"bg-white rounded-lg p-3"},Nd={class:"block text-sm font-medium text-gray-700 mb-1"},Gd={class:"text-base font-semibold text-gray-900"},Ld={class:"mt-3 text-sm text-green-700"},Ud={class:"border border-gray-200 rounded-lg p-4"},Md={key:0,class:"mt-4"},xd={key:2,class:"space-y-4"},Jd={class:"bg-yellow-50 border border-yellow-200 rounded-lg p-4"},Td={class:"flex items-start"},Hd={class:"font-medium text-yellow-900"},Yd={class:"text-sm text-yellow-700 mt-1"},_d={class:"border-2 border-gray-300 rounded-lg p-4"},Kd={class:"text-lg font-medium text-gray-900 mb-4"},Od={class:"flex justify-end"},Pd=["disabled"],Vd={__name:"ChipConfig",props:{modelValue:{type:Object,default:()=>({model:"",display:{width:320,height:240,color:"RGB565"}})}},emits:["update:modelValue","next"],setup(A,{emit:e}){const{t}=ve(),i=e,n=hA(()=>[{value:"",label:t("chipConfig.selectChip")},{value:"esp32s3",label:"ESP32-S3"},{value:"esp32c3",label:"ESP32-C3"},{value:"esp32c5",label:"ESP32-C5"},{value:"esp32c6",label:"ESP32-C6"},{value:"esp32p4",label:"ESP32-P4"},{value:"esp32",label:"ESP32"},{value:"others",label:t("common.other")}]),o={name:"ConfigForm",props:{config:{type:Object,required:!0},showRequired:{type:Boolean,default:!1}},render(){const w=this.$t;return GA("div",{class:"grid grid-cols-1 md:grid-cols-3 gap-4"},[GA("div",[GA("label",{class:"block text-sm font-medium text-gray-700 mb-2"},[w("chipConfig.chipRequired")+" ",this.showRequired&&GA("span",{class:"text-red-500"},"*")]),GA("select",{class:"w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-primary-500",value:this.config.model,onChange:F=>{this.config.model=F.target.value}},BA(n).map(F=>GA("option",{value:F.value,key:F.value},F.label)))]),GA("div",[GA("label",{class:"block text-sm font-medium text-gray-700 mb-2"},[w("chipConfig.widthRequired")+" ",this.showRequired&&GA("span",{class:"text-red-500"},"*")]),GA("input",{type:"number",class:"w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-primary-500",value:this.config.display.width,min:128,max:800,placeholder:"320",onInput:F=>{this.config.display.width=Number(F.target.value)}})]),GA("div",[GA("label",{class:"block text-sm font-medium text-gray-700 mb-2"},[w("chipConfig.heightRequired")+" ",this.showRequired&&GA("span",{class:"text-red-500"},"*")]),GA("input",{type:"number",class:"w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-primary-500",value:this.config.display.height,min:128,max:600,placeholder:"240",onInput:F=>{this.config.display.height=Number(F.target.value)}})])])}},{deviceInfo:r,isDeviceOnline:g,hasToken:s}=No(),a=cA(s.value),I=cA(!1),l=cA(""),C=cA(!1),Q=cA({model:"",display:{width:320,height:240,color:"RGB565"}}),h={"ESP32-S3":"esp32s3",ESP32S3:"esp32s3","ESP32-C3":"esp32c3",ESP32C3:"esp32c3","ESP32-C5":"esp32c5",ESP32C5:"esp32c5","ESP32-P4":"esp32p4",ESP32P4:"esp32p4","ESP32-C6":"esp32c6",ESP32C6:"esp32c6",ESP32:"esp32"},f=()=>{var w,F;try{if(!g.value)return a.value||(l.value=t("chipConfig.deviceOffline"),I.value=!1),!1;const N=(w=r.value.chip)==null?void 0:w.model;if(!N||N==="未知")return!1;let G=h[N.toUpperCase()]||h[N]||N.toLowerCase().replace(/-/g,"");["esp32s3","esp32c3","esp32c5","esp32p4","esp32c6","esp32","others"].includes(G)||(G="others");const R=(F=r.value.screen)==null?void 0:F.resolution;if(!R||R==="未知")return!1;const[b,L]=R.split("x").map(Number);return!b||!L||isNaN(b)||isNaN(L)?(l.value=t("chipConfig.resolutionFormatError"),I.value=!1,a.value=!1,!1):(Q.value={model:G,display:{width:b,height:L,color:"RGB565"}},i("update:modelValue",{model:G,display:{width:b,height:L,color:"RGB565"}}),I.value=!0,l.value="",a.value=!1,console.log("✓ 设备配置加载成功:",{chip:G,width:b,height:L}),!0)}catch(N){return console.error("加载设备配置失败:",N),l.value=t("chipConfig.loadingError"),I.value=!1,a.value=!1,!1}},u=hA(()=>Q.value.model&&Q.value.display.width&&Q.value.display.height),E=hA(()=>Q.value.model?Q.value.model.toUpperCase().replace(/ESP32/i,"ESP32-"):""),m=hA(()=>Q.value.display),c=()=>{C.value=!C.value},d=()=>{u.value&&i("next")};return ae(()=>Q.value,w=>{i("update:modelValue",{model:w.model,display:{...w.display}})},{deep:!0}),ae(()=>g.value,w=>{w&&!I.value&&(a.value=!0,l.value="",setTimeout(()=>{f()},100))}),ae(()=>[r.value.chip,r.value.screen],()=>{g.value&&!I.value&&f()},{deep:!0}),Ft(()=>{if(!s.value){a.value=!1,l.value=t("chipConfig.manualConfigRequired"),console.log("⚠ 未检测到设备连接,使用手动配置模式");return}g.value&&r.value.chip&&r.value.chip.model!=="未知"&&r.value.screen&&r.value.screen.resolution!=="未知"?(console.log("✓ 检测到已缓存的设备信息,立即加载"),f()):g.value?(console.log("⏳ 设备在线,等待设备信息加载..."),a.value=!0,setTimeout(()=>{f()},500),setTimeout(()=>{a.value&&!I.value&&g.value&&(a.value=!1,!r.value.chip||r.value.chip.model==="未知"?l.value=t("chipConfig.chipModelError"):!r.value.screen||r.value.screen.resolution==="未知"?l.value=t("chipConfig.resolutionError"):l.value=t("chipConfig.timeoutError"),console.warn("⚠ 设备配置加载超时:",l.value))},1e4)):(console.log("⏳ 等待设备连接..."),a.value=!0,setTimeout(()=>{a.value&&!I.value&&!g.value&&(a.value=!1,l.value=t("chipConfig.manualConfigHint"),console.warn("⚠ 等待设备连接超时"))},1e4))}),(w,F)=>(T(),_("div",sd,[B("div",null,[B("h2",ad,v(w.$t("chipConfig.title")),1),B("p",Id,[a.value?(T(),_("span",Cd,v(w.$t("chipConfig.loadingFromDevice")),1)):I.value?(T(),_("span",ld,v(w.$t("chipConfig.loadedFromDevice")),1)):(T(),_("span",Bd,v(w.$t("chipConfig.manualConfig")),1))])]),a.value?(T(),_("div",Qd,[B("div",cd,[B("div",Ed,[F[0]||(F[0]=B("svg",{class:"animate-spin h-6 w-6 text-blue-600",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[B("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),B("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})],-1)),B("div",null,[B("h3",ud,v(w.$t("chipConfig.loadingTitle")),1),B("p",hd,v(w.$t("chipConfig.loadingDesc")),1)])])])])):BA(g)&&I.value?(T(),_("div",fd,[B("div",dd,[B("div",pd,[B("div",md,[F[1]||(F[1]=B("div",{class:"w-5 h-5 bg-green-500 rounded-full flex items-center justify-center mr-2"},[B("svg",{class:"w-3 h-3 text-white",fill:"currentColor",viewBox:"0 0 20 20"},[B("path",{"fill-rule":"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z","clip-rule":"evenodd"})])],-1)),B("h3",yd,v(w.$t("chipConfig.autoLoadedTitle")),1)])]),B("div",wd,[B("div",Dd,[B("label",kd,v(w.$t("chipConfig.chipModel")),1),B("div",vd,v(E.value),1)]),B("div",Fd,[B("label",Sd,v(w.$t("chipConfig.screenWidth")),1),B("div",Rd,v(m.value.width)+" px",1)]),B("div",bd,[B("label",Nd,v(w.$t("chipConfig.screenHeight")),1),B("div",Gd,v(m.value.height)+" px",1)])]),B("div",Ld," ✓ "+v(w.$t("chipConfig.colorFormat"))+" "+v(m.value.color),1)]),B("div",Ud,[B("button",{onClick:c,class:"flex items-center text-sm text-gray-600 hover:text-gray-900"},[F[2]||(F[2]=B("svg",{class:"w-4 h-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[B("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),B("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})],-1)),gt(" "+v(C.value?w.$t("chipConfig.collapseManual"):w.$t("chipConfig.manualEdit")),1)]),C.value?(T(),_("div",Md,[TA(o,{config:Q.value},null,8,["config"])])):sA("",!0)])])):(T(),_("div",xd,[B("div",Jd,[B("div",Td,[F[3]||(F[3]=B("svg",{class:"w-5 h-5 text-yellow-600 mr-3 flex-shrink-0 mt-0.5",fill:"currentColor",viewBox:"0 0 20 20"},[B("path",{"fill-rule":"evenodd",d:"M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z","clip-rule":"evenodd"})],-1)),B("div",null,[B("h4",Hd,v(w.$t("chipConfig.manualConfigDesc")),1),B("p",Yd,v(l.value||w.$t("chipConfig.manualConfigHint")),1)])])]),B("div",_d,[B("h3",Kd,v(w.$t("chipConfig.manualConfigTitle")),1),TA(o,{config:Q.value,"show-required":!0},null,8,["config"])])])),B("div",Od,[B("button",{onClick:d,disabled:!u.value,class:"bg-primary-500 hover:bg-primary-600 disabled:bg-gray-300 text-white px-6 py-2 rounded-lg font-medium transition-colors"},v(w.$t("chipConfig.next")),9,Pd)])]))}},Wd={class:"space-y-6"},qd={class:"text-lg font-medium text-gray-900 mb-2"},jd={class:"text-gray-600"},Zd={key:0,class:"bg-orange-50 border border-orange-200 rounded-lg p-4"},Xd={class:"text-sm text-orange-800"},zd={class:"mt-1"},$d={key:1,class:"space-y-6"},A0={class:"flex space-x-4"},e0={key:0,class:"space-y-4"},t0={class:"block text-sm font-medium text-gray-700"},i0={class:"relative"},n0=["value"],o0=["value"],r0={key:1,class:"space-y-4 bg-gray-50 p-4 rounded-lg border border-gray-200"},g0={class:"font-medium text-gray-900"},s0={class:"grid grid-cols-1 md:grid-cols-2 gap-4"},a0={class:"block text-sm font-medium text-gray-700 mb-1"},I0=["placeholder"],C0={key:0,class:"text-xs text-red-500 mt-1"},l0={class:"block text-sm font-medium text-gray-700 mb-1"},B0=["placeholder"],Q0={key:0,class:"text-xs text-red-500 mt-1"},c0={class:"grid grid-cols-1 md:grid-cols-3 gap-4"},E0={class:"block text-sm font-medium text-gray-700 mb-1"},u0={class:"flex items-center space-x-2"},h0={class:"text-sm text-gray-600 w-8"},f0={class:"text-xs text-gray-500 mt-1"},d0={class:"block text-sm font-medium text-gray-700 mb-1"},p0={key:0,class:"text-xs text-red-500 mt-1"},m0={class:"block text-sm font-medium text-gray-700 mb-1"},y0={value:"mn6_cn"},w0={value:"mn6_en"},D0={class:"bg-blue-50 border border-blue-200 rounded-lg p-3"},k0={class:"text-sm text-blue-800"},v0={class:"mt-1 list-disc list-inside space-y-1"},F0={key:0},S0={key:1},R0={key:2},b0={__name:"WakewordConfig",props:{modelValue:{type:Object,required:!0},chipModel:{type:String,required:!0}},emits:["update:modelValue"],setup(A,{emit:e}){const{t}=ve(),i=A,n=e,o=[{id:"wn9s_hilexin",name:"Hi,乐鑫",model:"WakeNet9s"},{id:"wn9s_hiesp",name:"Hi,ESP",model:"WakeNet9s"},{id:"wn9s_nihaoxiaozhi",name:"你好小智",model:"WakeNet9s"},{id:"wn9s_hijason",name:"Hi,Jason",model:"WakeNet9s"},{id:"wn9s_alexa",name:"Alexa",model:"WakeNet9s"},{id:"wn9_hilexin",name:"Hi,乐鑫",model:"WakeNet9"},{id:"wn9_hiesp",name:"Hi,ESP",model:"WakeNet9"},{id:"wn9_nihaoxiaozhi_tts",name:"你好小智",model:"WakeNet9"},{id:"wn9_hijason_tts2",name:"Hi,Jason",model:"WakeNet9"},{id:"wn9_nihaomiaoban_tts2",name:"你好喵伴",model:"WakeNet9"},{id:"wn9_xiaoaitongxue",name:"小爱同学",model:"WakeNet9"},{id:"wn9_himfive",name:"Hi,M Five",model:"WakeNet9"},{id:"wn9_alexa",name:"Alexa",model:"WakeNet9"},{id:"wn9_jarvis_tts",name:"Jarvis",model:"WakeNet9"},{id:"wn9_computer_tts",name:"Computer",model:"WakeNet9"},{id:"wn9_heywillow_tts",name:"Hey,Willow",model:"WakeNet9"},{id:"wn9_sophia_tts",name:"Sophia",model:"WakeNet9"},{id:"wn9_mycroft_tts",name:"Mycroft",model:"WakeNet9"},{id:"wn9_heyprinter_tts",name:"Hey,Printer",model:"WakeNet9"},{id:"wn9_hijoy_tts",name:"Hi,Joy",model:"WakeNet9"},{id:"wn9_heywanda_tts",name:"Hey,Wand",model:"WakeNet9"},{id:"wn9_astrolabe_tts",name:"Astrolabe",model:"WakeNet9"},{id:"wn9_heyily_tts2",name:"Hey,Ily",model:"WakeNet9"},{id:"wn9_hijolly_tts2",name:"Hi,Jolly",model:"WakeNet9"},{id:"wn9_hifairy_tts2",name:"Hi,Fairy",model:"WakeNet9"},{id:"wn9_bluechip_tts2",name:"Blue Chip",model:"WakeNet9"},{id:"wn9_hiandy_tts2",name:"Hi,Andy",model:"WakeNet9"},{id:"wn9_heyivy_tts2",name:"Hey,Ivy",model:"WakeNet9"},{id:"wn9_hiwalle_tts2",name:"Hi,Wall E",model:"WakeNet9"},{id:"wn9_nihaoxiaoxin_tts",name:"你好小鑫",model:"WakeNet9"},{id:"wn9_xiaomeitongxue_tts",name:"小美同学",model:"WakeNet9"},{id:"wn9_hixiaoxing_tts",name:"Hi,小星",model:"WakeNet9"},{id:"wn9_xiaolongxiaolong_tts",name:"小龙小龙",model:"WakeNet9"},{id:"wn9_miaomiaotongxue_tts",name:"喵喵同学",model:"WakeNet9"},{id:"wn9_himiaomiao_tts",name:"Hi,喵喵",model:"WakeNet9"},{id:"wn9_hilili_tts",name:"Hi,Lily",model:"WakeNet9"},{id:"wn9_hitelly_tts",name:"Hi,Telly",model:"WakeNet9"},{id:"wn9_xiaobinxiaobin_tts",name:"小滨小滨",model:"WakeNet9"},{id:"wn9_haixiaowu_tts",name:"Hi,小巫",model:"WakeNet9"},{id:"wn9_xiaoyaxiaoya_tts2",name:"小鸭小鸭",model:"WakeNet9"},{id:"wn9_linaiban_tts2",name:"璃奈板",model:"WakeNet9"},{id:"wn9_xiaosurou_tts2",name:"小酥肉",model:"WakeNet9"},{id:"wn9_xiaoyutongxue_tts2",name:"小宇同学",model:"WakeNet9"},{id:"wn9_xiaomingtongxue_tts2",name:"小明同学",model:"WakeNet9"},{id:"wn9_xiaokangtongxue_tts2",name:"小康同学",model:"WakeNet9"},{id:"wn9_xiaojianxiaojian_tts2",name:"小箭小箭",model:"WakeNet9"},{id:"wn9_xiaotexiaote_tts2",name:"小特小特",model:"WakeNet9"},{id:"wn9_nihaoxiaoyi_tts2",name:"你好小益",model:"WakeNet9"},{id:"wn9_nihaobaiying_tts2",name:"你好百应",model:"WakeNet9"},{id:"wn9_xiaoluxiaolu_tts2",name:"小鹿小鹿",model:"WakeNet9"},{id:"wn9_nihaodongdong_tts2",name:"你好东东",model:"WakeNet9"},{id:"wn9_nihaoxiaoan_tts2",name:"你好小安",model:"WakeNet9"},{id:"wn9_ni3hao3xiao3mai4_tts2",name:"你好小脉",model:"WakeNet9"},{id:"wn9_ni3hao3xiao3rui4_tts3",name:"你好小瑞",model:"WakeNet9"},{id:"wn9_hai1xiao3ou1_tts3",name:"嗨小欧",model:"WakeNet9"}],r=hA(()=>{const E=i.chipModel.toLowerCase();return E==="esp32s3"||E==="esp32p4"}),g=hA(()=>{const E=i.chipModel.toLowerCase();return E==="esp32c3"||E==="esp32c5"||E==="esp32c6"}),s=hA(()=>i.chipModel.toLowerCase()==="esp32s3"),a=hA(()=>r.value||g.value),I=hA(()=>r.value?o.filter(E=>E.model==="WakeNet9"):g.value?o.filter(E=>E.model==="WakeNet9s"):[]),l=cA({name:"",command:"",threshold:20,duration:3e3,model:"mn6_cn"}),C=cA({name:"",command:"",duration:""}),Q=()=>{let E=!0;return C.value={name:"",command:"",duration:""},l.value.name.trim()||(C.value.name=t("wakewordConfig.errors.nameRequired"),E=!1),l.value.command.trim()?l.value.model.includes("_en")&&/[!,.?]/.test(l.value.command)&&(C.value.command=t("wakewordConfig.errors.noPunctuation"),E=!1):(C.value.command=t("wakewordConfig.errors.commandRequired"),E=!1),(!l.value.duration||l.value.duration<500||l.value.duration>1e4)&&(C.value.duration=t("wakewordConfig.errors.durationRange"),E=!1),E},h=cA(!1),f=E=>{var m;n("update:modelValue",{...i.modelValue,type:E,preset:E==="preset"&&(i.modelValue.preset||((m=I.value[0])==null?void 0:m.id))||"",custom:{...i.modelValue.custom,...l.value}})},u=E=>{n("update:modelValue",{...i.modelValue,preset:E})};return ae(l,E=>{h.value||i.modelValue.type==="custom"&&(Q(),n("update:modelValue",{...i.modelValue,custom:{...E}}))},{deep:!0}),ae(()=>i.modelValue.custom,E=>{E&&(h.value=!0,l.value={name:E.name||"",command:E.command||"",threshold:E.threshold!==void 0?E.threshold:20,duration:E.duration!==void 0?E.duration:3e3,model:E.model||"mn6_cn"},hn(()=>{h.value=!1}))},{deep:!0,immediate:!0}),(E,m)=>(T(),_("div",Wd,[B("div",null,[B("h3",qd,v(E.$t("wakewordConfig.title")),1),B("p",jd,v(E.$t("wakewordConfig.description")),1)]),a.value?(T(),_("div",$d,[B("div",A0,[B("button",{onClick:m[0]||(m[0]=c=>f("none")),class:kA(["px-4 py-2 border rounded-lg transition-colors",A.modelValue.type==="none"?"border-primary-500 bg-primary-50 text-primary-700":"border-gray-300 hover:border-gray-400"])},v(E.$t("wakewordConfig.noWakeword")),3),B("button",{onClick:m[1]||(m[1]=c=>f("preset")),class:kA(["px-4 py-2 border rounded-lg transition-colors",A.modelValue.type==="preset"?"border-primary-500 bg-primary-50 text-primary-700":"border-gray-300 hover:border-gray-400"])},v(E.$t("wakewordConfig.presetWakeword")),3),s.value?(T(),_("button",{key:0,onClick:m[2]||(m[2]=c=>f("custom")),class:kA(["px-4 py-2 border rounded-lg transition-colors",A.modelValue.type==="custom"?"border-primary-500 bg-primary-50 text-primary-700":"border-gray-300 hover:border-gray-400"])},v(E.$t("wakewordConfig.customWakeword")),3)):sA("",!0)]),A.modelValue.type==="preset"?(T(),_("div",e0,[B("label",t0,v(E.$t("wakewordConfig.selectWakeword")),1),B("div",i0,[B("select",{value:A.modelValue.preset,onChange:m[3]||(m[3]=c=>u(c.target.value)),class:"w-full border border-gray-300 rounded-md px-3 py-2 pr-10 bg-white focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-primary-500"},[(T(!0),_(qA,null,Ke(I.value,c=>(T(),_("option",{key:c.id,value:c.id},v(c.name)+" ("+v(c.model)+") ",9,o0))),128))],40,n0)])])):sA("",!0),A.modelValue.type==="custom"?(T(),_("div",r0,[B("h4",g0,v(E.$t("wakewordConfig.customSettings")),1),B("div",s0,[B("div",null,[B("label",a0,[gt(v(E.$t("wakewordConfig.wakewordName"))+" ",1),m[9]||(m[9]=B("span",{class:"text-red-500"},"*",-1))]),ZA(B("input",{type:"text","onUpdate:modelValue":m[4]||(m[4]=c=>l.value.name=c),placeholder:E.$t("wakewordConfig.wakewordNamePlaceholder"),class:kA(["w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-primary-500",{"border-red-500":C.value.name}])},null,10,I0),[[te,l.value.name]]),C.value.name?(T(),_("p",C0,v(C.value.name),1)):sA("",!0)]),B("div",null,[B("label",l0,[gt(v(E.$t("wakewordConfig.wakewordCommand"))+" ",1),m[10]||(m[10]=B("span",{class:"text-red-500"},"*",-1))]),ZA(B("input",{type:"text","onUpdate:modelValue":m[5]||(m[5]=c=>l.value.command=c),placeholder:l.value.model.includes("_cn")?E.$t("wakewordConfig.wakewordCommandPlaceholderCN"):E.$t("wakewordConfig.wakewordCommandPlaceholderEN"),class:kA(["w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-primary-500",{"border-red-500":C.value.command}])},null,10,B0),[[te,l.value.command]]),C.value.command?(T(),_("p",Q0,v(C.value.command),1)):sA("",!0)])]),B("div",c0,[B("div",null,[B("label",E0,v(E.$t("wakewordConfig.threshold")),1),B("div",u0,[ZA(B("input",{type:"range","onUpdate:modelValue":m[6]||(m[6]=c=>l.value.threshold=c),min:"0",max:"100",step:"1",class:"flex-1"},null,512),[[te,l.value.threshold,void 0,{number:!0}]]),B("span",h0,v(l.value.threshold),1)]),B("p",f0,v(E.$t("wakewordConfig.thresholdDesc")),1)]),B("div",null,[B("label",d0,v(E.$t("wakewordConfig.duration"))+" (ms) ",1),ZA(B("input",{type:"number","onUpdate:modelValue":m[7]||(m[7]=c=>l.value.duration=c),min:"500",max:"10000",step:"100",class:kA(["w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-primary-500",{"border-red-500":C.value.duration}])},null,2),[[te,l.value.duration,void 0,{number:!0}]]),C.value.duration?(T(),_("p",p0,v(C.value.duration),1)):sA("",!0)]),B("div",null,[B("label",m0,v(E.$t("wakewordConfig.selectModel")),1),ZA(B("select",{"onUpdate:modelValue":m[8]||(m[8]=c=>l.value.model=c),class:"w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-primary-500"},[B("option",y0,v(E.$t("wakewordConfig.mn6cn")),1),B("option",w0,v(E.$t("wakewordConfig.mn6en")),1)],512),[[dr,l.value.model]])])])])):sA("",!0),B("div",D0,[B("div",k0,[B("strong",null,v(E.$t("wakewordConfig.tips.tipLabel")),1),B("ul",v0,[B("li",null,v(E.$t("wakewordConfig.tips.optional")),1),g.value?(T(),_("li",F0,v(E.$t("wakewordConfig.tips.wakeNet9sOnly")),1)):r.value?(T(),_("li",S0,v(E.$t("wakewordConfig.tips.wakeNet9Full")),1)):sA("",!0),s.value?(T(),_("li",R0,v(E.$t("wakewordConfig.tips.customSupport")),1)):sA("",!0)])])])])):(T(),_("div",Zd,[B("div",Xd,[B("strong",null,v(E.$t("wakewordConfig.notice")),1),B("p",zd,v(E.$t("wakewordConfig.unsupportedMessage",{chipModel:A.chipModel})),1)])]))]))}};class N0{constructor(){this.dbName="XiaozhiConfigDB",this.version=1,this.db=null,this.initialized=!1}async initialize(){if(!(this.initialized&&this.db))return new Promise((e,t)=>{const i=indexedDB.open(this.dbName,this.version);i.onerror=()=>{console.error("IndexedDB 初始化失败:",i.error),t(i.error)},i.onsuccess=()=>{this.db=i.result,this.initialized=!0,console.log("IndexedDB 初始化成功"),e()},i.onupgradeneeded=n=>{const o=n.target.result;if(o.objectStoreNames.contains("configs")||o.createObjectStore("configs",{keyPath:"key"}).createIndex("timestamp","timestamp",{unique:!1}),!o.objectStoreNames.contains("files")){const r=o.createObjectStore("files",{keyPath:"id"});r.createIndex("type","type",{unique:!1}),r.createIndex("timestamp","timestamp",{unique:!1})}if(!o.objectStoreNames.contains("temp_data")){const r=o.createObjectStore("temp_data",{keyPath:"key"});r.createIndex("type","type",{unique:!1}),r.createIndex("timestamp","timestamp",{unique:!1})}console.log("IndexedDB 表结构创建完成")}})}async saveConfig(e){this.initialized||await this.initialize();const i={key:"current_config",config:this.sanitizeConfigForStorage(e),timestamp:Date.now()};return new Promise((n,o)=>{const s=this.db.transaction(["configs"],"readwrite").objectStore("configs").put(i);s.onerror=()=>{console.error("保存配置失败:",s.error),o(s.error)},s.onsuccess=()=>{console.log("配置已保存到 IndexedDB"),n()}})}sanitizeConfigForStorage(e){var i,n,o,r,g,s,a,I,l,C;const t=JSON.parse(JSON.stringify(e||{}));try{if((n=(i=t==null?void 0:t.theme)==null?void 0:i.font)!=null&&n.custom&&(t.theme.font.custom.file=null),((r=(o=t==null?void 0:t.theme)==null?void 0:o.emoji)==null?void 0:r.type)==="custom"){t.theme.emoji.custom||(t.theme.emoji.custom={});const Q=((s=(g=t.theme.emoji)==null?void 0:g.custom)==null?void 0:s.images)||{},h={};if(Object.keys(Q).forEach(f=>{h[f]=null}),t.theme.emoji.custom.images=h,t.theme.emoji.custom.emotionMap,t.theme.emoji.custom.fileMap){const f=t.theme.emoji.custom.fileMap,u={};Object.keys(f).forEach(E=>{u[E]=null}),t.theme.emoji.custom.fileMap=u}}(I=(a=t==null?void 0:t.theme)==null?void 0:a.skin)!=null&&I.light&&(t.theme.skin.light.backgroundImage=null),(C=(l=t==null?void 0:t.theme)==null?void 0:l.skin)!=null&&C.dark&&(t.theme.skin.dark.backgroundImage=null)}catch{}return t}async loadConfig(){return this.initialized||await this.initialize(),new Promise((e,t)=>{const o=this.db.transaction(["configs"],"readonly").objectStore("configs").get("current_config");o.onerror=()=>{console.error("加载配置失败:",o.error),t(o.error)},o.onsuccess=()=>{const r=o.result;r?(console.log("从 IndexedDB 恢复配置成功"),e({config:r.config,timestamp:r.timestamp})):e(null)}})}async saveFile(e,t,i,n={}){this.initialized||await this.initialize();const o=await this.fileToArrayBuffer(t);let r={};try{r=n?JSON.parse(JSON.stringify(n)):{}}catch{r={...n}}const g={id:e,type:i,name:t.name,size:t.size,mimeType:t.type,lastModified:t.lastModified,data:o,metadata:r,timestamp:Date.now()};return new Promise((s,a)=>{const C=this.db.transaction(["files"],"readwrite").objectStore("files").put(g);C.onerror=()=>{console.error("保存文件失败:",C.error),a(C.error)},C.onsuccess=()=>{console.log(`文件 ${t.name} 已保存到 IndexedDB`),s()}})}async loadFile(e){return this.initialized||await this.initialize(),new Promise((t,i)=>{const r=this.db.transaction(["files"],"readonly").objectStore("files").get(e);r.onerror=()=>{console.error("加载文件失败:",r.error),i(r.error)},r.onsuccess=()=>{const g=r.result;if(g){const s=new Blob([g.data],{type:g.mimeType}),a=new File([s],g.name,{type:g.mimeType,lastModified:g.lastModified});a.storedId=g.id,a.storedType=g.type,a.storedMetadata=g.metadata,a.storedTimestamp=g.timestamp,console.log(`文件 ${g.name} 从 IndexedDB 恢复成功`),t(a)}else t(null)}})}async getFilesByType(e){return this.initialized||await this.initialize(),new Promise((t,i)=>{const g=this.db.transaction(["files"],"readonly").objectStore("files").index("type").getAll(e);g.onerror=()=>{console.error("获取文件列表失败:",g.error),i(g.error)},g.onsuccess=()=>{const a=(g.result||[]).map(I=>{const l=new Blob([I.data],{type:I.mimeType}),C=new File([l],I.name,{type:I.mimeType,lastModified:I.lastModified});return C.storedId=I.id,C.storedType=I.type,C.storedMetadata=I.metadata,C.storedTimestamp=I.timestamp,C});t(a)}})}async saveTempData(e,t,i,n={}){this.initialized||await this.initialize();const o={key:e,type:i,data:t,metadata:n,timestamp:Date.now()};return new Promise((r,g)=>{const I=this.db.transaction(["temp_data"],"readwrite").objectStore("temp_data").put(o);I.onerror=()=>{console.error("保存临时数据失败:",I.error),g(I.error)},I.onsuccess=()=>{console.log(`临时数据 ${e} 已保存`),r()}})}async loadTempData(e){return this.initialized||await this.initialize(),new Promise((t,i)=>{const r=this.db.transaction(["temp_data"],"readonly").objectStore("temp_data").get(e);r.onerror=()=>{console.error("加载临时数据失败:",r.error),i(r.error)},r.onsuccess=()=>{const g=r.result;t(g||null)}})}async clearAll(){this.initialized||await this.initialize();const e=["configs","files","temp_data"];return new Promise((t,i)=>{const n=this.db.transaction(e,"readwrite");let o=0,r=!1;const g=()=>{o++,o===e.length&&(r?i(new Error("清空部分数据时出现错误")):(console.log("所有存储数据已清空"),t()))};e.forEach(s=>{const I=n.objectStore(s).clear();I.onerror=()=>{console.error(`清空 ${s} 失败:`,I.error),r=!0,g()},I.onsuccess=()=>{console.log(`${s} 已清空`),g()}})})}async deleteFile(e){return this.initialized||await this.initialize(),new Promise((t,i)=>{const r=this.db.transaction(["files"],"readwrite").objectStore("files").delete(e);r.onerror=()=>{console.error("删除文件失败:",r.error),i(r.error)},r.onsuccess=()=>{console.log(`文件 ${e} 已删除`),t()}})}async getStorageInfo(){this.initialized||await this.initialize();const e=["configs","files","temp_data"],t={};for(const n of e){const o=await new Promise((r,g)=>{const I=this.db.transaction([n],"readonly").objectStore(n).count();I.onerror=()=>g(I.error),I.onsuccess=()=>r(I.result)});t[n]={count:o}}const i=await this.loadConfig();return t.lastSaved=i?new Date(i.timestamp):null,t}async hasStoredConfig(){try{return await this.loadConfig()!==null}catch(e){return console.error("检查存储配置时出错:",e),!1}}fileToArrayBuffer(e){return new Promise((t,i)=>{const n=new FileReader;n.onload=()=>t(n.result),n.onerror=()=>i(new Error("读取文件失败")),n.readAsArrayBuffer(e)})}close(){this.db&&(this.db.close(),this.db=null,this.initialized=!1,console.log("IndexedDB 连接已关闭"))}}const Qe=new N0;class Si{static async saveFontFile(e,t={}){if(e){const i="custom_font";try{await Qe.saveFile(i,e,"font",{size:t.size||20,bpp:t.bpp||4,charset:t.charset||"deepseek"}),console.log(`字体文件已保存: ${e.name}`)}catch(n){console.warn(`保存字体文件失败: ${e.name}`,n)}}}static async saveEmojiFile(e,t,i={}){var n,o;if(t&&e){const r=e.startsWith("hash_")?e:`emoji_${e}`;try{const g=((n=i==null?void 0:i.size)==null?void 0:n.width)??64,s=((o=i==null?void 0:i.size)==null?void 0:o.height)??64;await Qe.saveFile(r,t,"emoji",{name:e,size:{width:g,height:s},format:i==null?void 0:i.format,emotions:i==null?void 0:i.emotions}),console.log(`表情文件已保存: ${r} - ${t.name}`)}catch(g){console.warn(`保存表情文件失败: ${e}`,g)}}}static async saveBackgroundFile(e,t,i={}){if(t&&e){const n=`background_${e}`;try{let o={};try{o=i?JSON.parse(JSON.stringify(i)):{}}catch{o={...i}}await Qe.saveFile(n,t,"background",{mode:e,...o}),console.log(`背景文件已保存: ${e} - ${t.name}`)}catch(o){console.warn(`保存背景文件失败: ${e}`,o)}}}static async restoreFontFile(){try{return await Qe.loadFile("custom_font")}catch(e){return console.warn("恢复字体文件失败:",e),null}}static async restoreEmojiFile(e){if(!e)return null;try{const t=e.startsWith("hash_")?e:`emoji_${e}`;return await Qe.loadFile(t)}catch(t){return console.warn(`恢复表情文件失败: ${e}`,t),null}}static async restoreBackgroundFile(e){if(!e)return null;try{const t=`background_${e}`;return await Qe.loadFile(t)}catch(t){return console.warn(`恢复背景文件失败: ${e}`,t),null}}static async deleteFontFile(){try{await Qe.deleteFile("custom_font"),console.log("字体文件已删除")}catch(e){console.warn("删除字体文件失败:",e)}}static async deleteEmojiFile(e){if(e)try{const t=e.startsWith("hash_")?e:`emoji_${e}`;await Qe.deleteFile(t),console.log(`表情文件已删除: ${t}`)}catch(t){console.warn(`删除表情文件失败: ${e}`,t)}}static async deleteBackgroundFile(e){if(e)try{const t=`background_${e}`;await Qe.deleteFile(t),console.log(`背景文件已删除: ${e}`)}catch(t){console.warn(`删除背景文件失败: ${e}`,t)}}static async getStorageInfo(){try{return await Qe.getStorageInfo()}catch(e){return console.warn("获取存储信息失败:",e),{configs:{count:0},files:{count:0},temp_data:{count:0},lastSaved:null}}}static async clearAllFiles(){try{await Qe.clearAll(),console.log("所有存储文件已清理")}catch(e){throw console.warn("清理存储文件失败:",e),e}}}const G0={class:"space-y-6"},L0={class:"text-lg font-medium text-gray-900 mb-2"},U0={class:"text-gray-600"},M0={class:"space-y-4"},x0={class:"flex space-x-4"},J0={key:0,class:"space-y-4"},T0={class:"bg-gray-50 border border-gray-200 rounded-lg p-6 text-center"},H0={class:"mt-2 text-gray-600"},Y0={key:1,class:"space-y-4"},_0={class:"font-medium text-gray-900"},K0={class:"grid grid-cols-1 md:grid-cols-4 gap-4"},O0=["onClick"],P0={class:"flex items-start justify-between"},V0={class:"flex-1"},W0={class:"font-medium text-gray-900 mb-1"},q0={class:"text-sm text-gray-600 space-y-1"},j0={key:0,class:"flex-shrink-0 ml-3"},Z0={key:2,class:"space-y-6"},X0={class:"font-medium text-gray-900"},z0={class:"space-y-2"},$0={class:"block text-sm font-medium text-gray-700"},Ap={key:0},ep={class:"mt-2"},tp={class:"text-gray-500"},ip={class:"text-xs text-gray-400 mt-1"},np={key:1,class:"text-green-600"},op={class:"mt-1 font-medium"},rp={key:0,class:"grid grid-cols-1 md:grid-cols-3 gap-4"},gp={class:"block text-sm font-medium text-gray-700 mb-2"},sp={class:"text-xs text-gray-500 mt-1"},ap={class:"block text-sm font-medium text-gray-700 mb-2"},Ip={value:1},Cp={value:2},lp={value:4},Bp={class:"block text-sm font-medium text-gray-700 mb-2"},Qp={value:"qwen"},cp={value:"deepseek"},Ep={value:"gb2312"},up={value:"latin"},hp={value:"full"},fp={class:"flex items-center justify-between p-4 bg-gray-50 rounded-lg border border-gray-200"},dp={class:"flex-1"},pp={class:"font-medium text-gray-900"},mp={class:"text-sm text-gray-500 mt-1"},yp={class:"ml-4"},wp={class:"relative inline-flex items-center cursor-pointer"},Dp=["checked"],kp={__name:"FontConfig",props:{modelValue:{type:Object,required:!0}},emits:["update:modelValue"],setup(A,{emit:e}){const{t}=ve(),i=A,n=e,o=cA(null),r=[{id:"font_puhui_deepseek_14_1",size:14,bpp:1,fileSize:"~180KB"},{id:"font_puhui_deepseek_16_4",size:16,bpp:4,fileSize:"~720KB"},{id:"font_puhui_deepseek_20_4",size:20,bpp:4,fileSize:"~1.1MB"},{id:"font_puhui_deepseek_30_4",size:30,bpp:4,fileSize:"~2.5MB"},{id:"font_noto_qwen_14_1",size:14,bpp:1,fileSize:"~626KB"},{id:"font_noto_qwen_16_4",size:16,bpp:4,fileSize:"~2.0MB"},{id:"font_noto_qwen_20_4",size:20,bpp:4,fileSize:"~2.9MB"},{id:"font_noto_qwen_30_4",size:30,bpp:4,fileSize:"~5.8MB"}],g=hA(()=>r.map(u=>{let E;return u.id.startsWith("font_puhui_deepseek_")?E=t("fontConfig.charsetDeepseek"):u.id.startsWith("font_noto_qwen_")&&(E=t("fontConfig.charsetQwen")),{...u,name:t("fontConfig.presetFontNames."+u.id),charset:E}})),s=cA({size:20,bpp:4,charset:"qwen"}),a=u=>{n("update:modelValue",{...i.modelValue,type:u,preset:u==="preset"?i.modelValue.preset||"font_puhui_deepseek_20_4":"",custom:{...i.modelValue.custom,file:i.modelValue.custom.file||null}})},I=u=>{n("update:modelValue",{...i.modelValue,preset:u,custom:{...i.modelValue.custom,file:i.modelValue.custom.file||null}})},l=u=>{const E=u.target.files[0];E&&Q(E)},C=u=>{u.preventDefault();const E=u.dataTransfer.files;E.length>0&&Q(E[0])},Q=async u=>{u&&(u.type.includes("font")||u.name.toLowerCase().match(/\.(ttf|woff|woff2)$/))?(n("update:modelValue",{...i.modelValue,custom:{...i.modelValue.custom,file:u,...s.value}}),await Si.saveFontFile(u,s.value)):alert(t("fontConfig.selectValidFontFile"))},h=async()=>{n("update:modelValue",{...i.modelValue,custom:{...i.modelValue.custom,file:null}}),o.value&&(o.value.value=""),await Si.deleteFontFile()},f=cA(!1);return ae(()=>s.value,u=>{f.value||i.modelValue.type==="custom"&&i.modelValue.custom.file&&n("update:modelValue",{...i.modelValue,custom:{...i.modelValue.custom,...u}})},{deep:!0}),ae(()=>i.modelValue.custom,u=>{u.size&&u.bpp&&u.charset&&(f.value=!0,s.value={size:u.size,bpp:u.bpp,charset:u.charset},hn(()=>{f.value=!1}))},{deep:!0,immediate:!0}),(u,E)=>{var m;return T(),_("div",G0,[B("div",null,[B("h3",L0,v(u.$t("fontConfig.title")),1),B("p",U0,v(u.$t("fontConfig.description")),1)]),B("div",M0,[B("div",x0,[B("button",{onClick:E[0]||(E[0]=c=>a("none")),class:kA(["px-4 py-2 border rounded-lg transition-colors",A.modelValue.type==="none"?"border-primary-500 bg-primary-50 text-primary-700":"border-gray-300 hover:border-gray-400"])},v(u.$t("fontConfig.noFonts")),3),B("button",{onClick:E[1]||(E[1]=c=>a("preset")),class:kA(["px-4 py-2 border rounded-lg transition-colors",A.modelValue.type==="preset"?"border-primary-500 bg-primary-50 text-primary-700":"border-gray-300 hover:border-gray-400"])},v(u.$t("fontConfig.presetFonts")),3),B("button",{onClick:E[2]||(E[2]=c=>a("custom")),class:kA(["px-4 py-2 border rounded-lg transition-colors",A.modelValue.type==="custom"?"border-primary-500 bg-primary-50 text-primary-700":"border-gray-300 hover:border-gray-400"])},v(u.$t("fontConfig.customFonts")),3)])]),A.modelValue.type==="none"?(T(),_("div",J0,[B("div",T0,[E[10]||(E[10]=B("svg",{class:"mx-auto h-12 w-12 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[B("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)),B("p",H0,v(u.$t("fontConfig.noFontsDescription")),1)])])):sA("",!0),A.modelValue.type==="preset"?(T(),_("div",Y0,[B("h4",_0,v(u.$t("fontConfig.presetFonts")),1),B("div",K0,[(T(!0),_(qA,null,Ke(g.value,c=>(T(),_("div",{key:c.id,onClick:d=>I(c.id),class:kA(["border-2 rounded-lg p-4 cursor-pointer transition-all",A.modelValue.preset===c.id?"border-primary-500 bg-primary-50":"border-gray-200 hover:border-gray-300"])},[B("div",P0,[B("div",V0,[B("h5",W0,v(c.name),1),B("div",q0,[B("div",null,v(u.$t("fontConfig.fontSize"))+" "+v(c.size)+"px",1),B("div",null,v(u.$t("fontConfig.bitDepth"))+" "+v(c.bpp)+"bpp",1),B("div",null,v(u.$t("fontConfig.charset"))+" "+v(c.charset),1),B("div",null,v(u.$t("fontConfig.fileSize"))+" "+v(c.fileSize),1)])]),A.modelValue.preset===c.id?(T(),_("div",j0,[...E[11]||(E[11]=[B("div",{class:"w-5 h-5 bg-primary-500 rounded-full flex items-center justify-center"},[B("svg",{class:"w-3 h-3 text-white",fill:"currentColor",viewBox:"0 0 20 20"},[B("path",{"fill-rule":"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z","clip-rule":"evenodd"})])],-1)])])):sA("",!0)])],10,O0))),128))])])):sA("",!0),A.modelValue.type==="custom"?(T(),_("div",Z0,[B("h4",X0,v(u.$t("fontConfig.customFonts")),1),B("div",z0,[B("label",$0,v(u.$t("fontConfig.fontFile")),1),B("div",{onDrop:C,onDragover:E[4]||(E[4]=dt(()=>{},["prevent"])),onDragenter:E[5]||(E[5]=dt(()=>{},["prevent"])),class:"border-2 border-dashed border-gray-300 rounded-lg p-6 text-center hover:border-gray-400 transition-colors"},[B("input",{ref_key:"fileInput",ref:o,type:"file",accept:".ttf,.woff,.woff2",onChange:l,class:"hidden"},null,544),A.modelValue.custom.file?(T(),_("div",np,[E[13]||(E[13]=B("svg",{class:"mx-auto h-8 w-8",fill:"currentColor",viewBox:"0 0 20 20"},[B("path",{"fill-rule":"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z","clip-rule":"evenodd"})],-1)),B("p",op,v((m=A.modelValue.custom.file)==null?void 0:m.name),1),B("button",{onClick:h,class:"text-red-600 hover:text-red-500 text-sm mt-1"},v(u.$t("fontConfig.removeFile")),1)])):(T(),_("div",Ap,[E[12]||(E[12]=B("svg",{class:"mx-auto h-12 w-12 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[B("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12"})],-1)),B("div",ep,[B("button",{onClick:E[3]||(E[3]=c=>u.$refs.fileInput.click()),class:"text-primary-600 hover:text-primary-500 font-medium"},v(u.$t("fontConfig.clickSelectFontFile")),1),B("p",tp,v(u.$t("fontConfig.orDragFileHere")),1)]),B("p",ip,v(u.$t("fontConfig.supportedFormats")),1)]))],32)]),A.modelValue.custom.file?(T(),_("div",rp,[B("div",null,[B("label",gp,v(u.$t("fontConfig.fontSizePx")),1),ZA(B("input",{type:"number","onUpdate:modelValue":E[6]||(E[6]=c=>s.value.size=c),min:"8",max:"80",class:"w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-primary-500"},null,512),[[te,s.value.size,void 0,{number:!0}]]),B("p",sp,v(u.$t("fontConfig.range"))+" 8-80px",1)]),B("div",null,[B("label",ap,v(u.$t("fontConfig.bitDepthBpp")),1),ZA(B("select",{"onUpdate:modelValue":E[7]||(E[7]=c=>s.value.bpp=c),class:"w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-primary-500"},[B("option",Ip,v(u.$t("fontConfig.monochrome")),1),B("option",Cp,v(u.$t("fontConfig.fourColors")),1),B("option",lp,v(u.$t("fontConfig.sixteenColors")),1)],512),[[dr,s.value.bpp]])]),B("div",null,[B("label",Bp,v(u.$t("fontConfig.characterSet")),1),ZA(B("select",{"onUpdate:modelValue":E[8]||(E[8]=c=>s.value.charset=c),class:"w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-primary-500"},[B("option",Qp,v(u.$t("fontConfig.qwen18409")),1),B("option",cp,v(u.$t("fontConfig.deepseekR1")),1),B("option",Ep,v(u.$t("fontConfig.gb2312")),1),B("option",up,v(u.$t("fontConfig.latin1")),1),B("option",hp,v(u.$t("fontConfig.fullCharset")),1)],512),[[dr,s.value.charset]])])])):sA("",!0)])):sA("",!0),B("div",fp,[B("div",dp,[B("h4",pp,v(u.$t("fontConfig.hideSubtitle")),1),B("p",mp,v(u.$t("fontConfig.hideSubtitleDescription")),1)]),B("div",yp,[B("label",wp,[B("input",{type:"checkbox",checked:A.modelValue.hide_subtitle,onChange:E[9]||(E[9]=c=>n("update:modelValue",{...A.modelValue,hide_subtitle:c.target.checked})),class:"sr-only peer"},null,40,Dp),E[14]||(E[14]=B("div",{class:"w-11 h-6 bg-gray-200 peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-primary-300 rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-primary-500"},null,-1))])])])])}}},vp={class:"space-y-6"},Fp={class:"text-lg font-medium text-gray-900 mb-2"},Sp={class:"text-gray-600"},Rp={class:"space-y-4"},bp={class:"flex flex-wrap gap-3"},Np={key:0,class:"text-sm text-gray-500"},Gp={key:0,class:"space-y-4"},Lp={class:"font-medium text-gray-900"},Up={class:"grid grid-cols-1 md:grid-cols-2 gap-6"},Mp=["onClick"],xp={class:"flex items-start justify-between mb-3"},Jp={class:"font-medium text-gray-900"},Tp={class:"text-sm text-gray-600"},Hp={class:"text-xs text-gray-500 mt-1"},Yp={key:0,class:"flex-shrink-0 ml-3"},_p={class:"grid grid-cols-7 gap-1 justify-items-center"},Kp=["src","alt"],Op={key:1,class:"space-y-6"},Pp={class:"font-medium text-gray-900"},Vp={class:"grid grid-cols-1 md:grid-cols-2 gap-4"},Wp={class:"block text-sm font-medium text-gray-700 mb-2"},qp={class:"block text-sm font-medium text-gray-700 mb-2"},jp={class:"space-y-4"},Zp={class:"font-medium text-gray-900"},Xp={class:"grid grid-cols-2 md:grid-cols-4 lg:grid-cols-7 gap-4"},zp={class:"text-center"},$p={class:"text-lg mb-1"},Am={class:"text-xs text-gray-600 flex items-center justify-center gap-1"},em={key:0,class:"text-red-500"},tm=["onDrop"],im=["onChange"],nm=["onClick"],om={class:"text-xs text-gray-500"},rm={key:1,class:"w-full h-full relative"},gm=["src","alt"],sm=["onClick"],am={class:"text-xs text-gray-500 mt-2"},Im={__name:"EmojiConfig",props:{modelValue:{type:Object,required:!0}},emits:["update:modelValue"],setup(A,{emit:e}){const{t}=ve(),i=A,n=e,o=async m=>{const c=await m.arrayBuffer(),d=await crypto.subtle.digest("SHA-256",c);return Array.from(new Uint8Array(d)).map(N=>N.toString(16).padStart(2,"0")).join("")},r=[{id:"twemoji32",name:t("emojiConfig.twitterEmojiName",{size:32}),description:t("emojiConfig.twitterEmojiDescription",{size:32}),size:32,preview:["neutral","happy","laughing","funny","sad","angry","crying"]},{id:"twemoji64",name:t("emojiConfig.twitterEmojiName",{size:64}),description:t("emojiConfig.twitterEmojiDescription",{size:64}),size:64,preview:["neutral","happy","laughing","funny","sad","angry","crying"]}],g=hA(()=>[{key:"neutral",name:t("emojiConfig.emotions.neutral"),emoji:"😶"},{key:"happy",name:t("emojiConfig.emotions.happy"),emoji:"🙂"},{key:"laughing",name:t("emojiConfig.emotions.laughing"),emoji:"😆"},{key:"funny",name:t("emojiConfig.emotions.funny"),emoji:"😂"},{key:"sad",name:t("emojiConfig.emotions.sad"),emoji:"😔"},{key:"angry",name:t("emojiConfig.emotions.angry"),emoji:"😠"},{key:"crying",name:t("emojiConfig.emotions.crying"),emoji:"😭"},{key:"loving",name:t("emojiConfig.emotions.loving"),emoji:"😍"},{key:"embarrassed",name:t("emojiConfig.emotions.embarrassed"),emoji:"😳"},{key:"surprised",name:t("emojiConfig.emotions.surprised"),emoji:"😯"},{key:"shocked",name:t("emojiConfig.emotions.shocked"),emoji:"😱"},{key:"thinking",name:t("emojiConfig.emotions.thinking"),emoji:"🤔"},{key:"winking",name:t("emojiConfig.emotions.winking"),emoji:"😉"},{key:"cool",name:t("emojiConfig.emotions.cool"),emoji:"😎"},{key:"relaxed",name:t("emojiConfig.emotions.relaxed"),emoji:"😌"},{key:"delicious",name:t("emojiConfig.emotions.delicious"),emoji:"🤤"},{key:"kissy",name:t("emojiConfig.emotions.kissy"),emoji:"😘"},{key:"confident",name:t("emojiConfig.emotions.confident"),emoji:"😏"},{key:"sleepy",name:t("emojiConfig.emotions.sleepy"),emoji:"😴"},{key:"silly",name:t("emojiConfig.emotions.silly"),emoji:"😜"},{key:"confused",name:t("emojiConfig.emotions.confused"),emoji:"🙄"}]),s=cA({size:{width:32,height:32}}),a=m=>{if(i.modelValue.type===m)return;const c={...i.modelValue,type:m};m==="none"?(c.preset="",c.custom={...i.modelValue.custom,images:i.modelValue.custom.images||{}}):m==="preset"?(c.preset=i.modelValue.preset||"twemoji32",c.custom={...i.modelValue.custom,images:i.modelValue.custom.images||{}}):m==="custom"&&(c.preset="",c.custom={...i.modelValue.custom,images:i.modelValue.custom.images||{}}),n("update:modelValue",c)},I=m=>{i.modelValue.preset!==m&&n("update:modelValue",{...i.modelValue,preset:m,custom:{...i.modelValue.custom,images:i.modelValue.custom.images||{}}})},l=(m,c)=>{const d=m.target.files[0];d&&Q(c,d)},C=(m,c)=>{m.preventDefault();const d=m.dataTransfer.files;d.length>0&&Q(c,d[0])},Q=async(m,c)=>{const d=["png","gif"],w=c.name.split(".").pop().toLowerCase();if(!d.includes(w)){alert(t("emojiConfig.selectValidFormat"));return}const F=await o(c),N=i.modelValue.custom||{},G={...N.fileMap||{}},K={...N.emotionMap||{}},R={...N.images||{}};let b=[];for(const[L,EA]of Object.entries(K))EA===F&&L!==m&&b.push(L);b.length>0&&console.log(t("emojiConfig.sharedFileMessage",{emotionKey:m,existingEmotions:b.join(", ")})),G[F]=c,K[m]=F,R[m]=c,n("update:modelValue",{...i.modelValue,custom:{...N,size:s.value.size,images:R,fileMap:G,emotionMap:K}}),await Si.saveEmojiFile(`hash_${F}`,c,{size:s.value.size,format:w,emotions:[...b,m]})},h=async m=>{const c=i.modelValue.custom||{},d={...c.images},w={...c.emotionMap||{}},F={...c.fileMap||{}},N=w[m];delete d[m],delete w[m],Object.values(w).filter(K=>K===N).length===0&&N?(delete F[N],await Si.deleteEmojiFile(`hash_${N}`),console.log(t("emojiConfig.fileDeleted",{fileHash:N}))):console.log(t("emojiConfig.fileRetained",{fileHash:N})),n("update:modelValue",{...i.modelValue,custom:{...c,images:d,emotionMap:w,fileMap:F}})},f=(m,c)=>`./static/twemoji${m==="twemoji64"?"64":"32"}/${c}.png`,u=m=>{if(i.modelValue.type==="preset")return f(i.modelValue.preset,m);{const c=i.modelValue.custom.images[m];return c instanceof File||c instanceof Blob?URL.createObjectURL(c):null}},E=m=>{console.warn(t("emojiConfig.imageLoadFailed"),m.target.src),m.target.style.display="none"};return ae(()=>s.value.size,m=>{if(i.modelValue.type==="custom"){const c=i.modelValue.custom;JSON.stringify(c.size)!==JSON.stringify(m)&&n("update:modelValue",{...i.modelValue,custom:{...c,size:m}})}},{deep:!0}),i.modelValue.custom.size&&(s.value={size:{...i.modelValue.custom.size}}),(m,c)=>(T(),_("div",vp,[B("div",null,[B("h3",Fp,v(m.$t("emojiConfig.title")),1),B("p",Sp,v(m.$t("emojiConfig.description")),1)]),B("div",Rp,[B("div",bp,[B("button",{onClick:c[0]||(c[0]=d=>a("none")),class:kA(["px-4 py-2 border rounded-lg transition-colors",A.modelValue.type==="none"?"border-primary-500 bg-primary-50 text-primary-700":"border-gray-300 hover:border-gray-400"])},v(m.$t("emojiConfig.noEmojiPack")),3),B("button",{onClick:c[1]||(c[1]=d=>a("preset")),class:kA(["px-4 py-2 border rounded-lg transition-colors",A.modelValue.type==="preset"?"border-primary-500 bg-primary-50 text-primary-700":"border-gray-300 hover:border-gray-400"])},v(m.$t("emojiConfig.presetEmojiPack")),3),B("button",{onClick:c[2]||(c[2]=d=>a("custom")),class:kA(["px-4 py-2 border rounded-lg transition-colors",A.modelValue.type==="custom"?"border-primary-500 bg-primary-50 text-primary-700":"border-gray-300 hover:border-gray-400"])},v(m.$t("emojiConfig.customEmojiPack")),3)]),A.modelValue.type==="none"?(T(),_("p",Np,v(m.$t("emojiConfig.noEmojiPackDescription")),1)):sA("",!0)]),A.modelValue.type==="preset"?(T(),_("div",Gp,[B("h4",Lp,v(m.$t("emojiConfig.selectPresetEmojiPack")),1),B("div",Up,[(T(),_(qA,null,Ke(r,d=>B("div",{key:d.id,onClick:w=>I(d.id),class:kA(["border-2 rounded-lg p-4 cursor-pointer transition-all",A.modelValue.preset===d.id?"border-primary-500 bg-primary-50":"border-gray-200 hover:border-gray-300"])},[B("div",xp,[B("div",null,[B("h5",Jp,v(d.name),1),B("p",Tp,v(d.description),1),B("div",Hp,v(m.$t("emojiConfig.size"))+": "+v(d.size)+"px × "+v(d.size)+"px ",1)]),A.modelValue.preset===d.id?(T(),_("div",Yp,[...c[7]||(c[7]=[B("div",{class:"w-5 h-5 bg-primary-500 rounded-full flex items-center justify-center"},[B("svg",{class:"w-3 h-3 text-white",fill:"currentColor",viewBox:"0 0 20 20"},[B("path",{"fill-rule":"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z","clip-rule":"evenodd"})])],-1)])])):sA("",!0)]),B("div",_p,[(T(!0),_(qA,null,Ke(d.preview,w=>(T(),_("div",{key:w,style:VA({width:d.size+"px",height:d.size+"px"}),class:"bg-gray-100 rounded flex items-center justify-center"},[B("img",{src:f(d.id,w),alt:w,style:VA({width:d.size+"px",height:d.size+"px"}),class:"object-contain rounded",onError:E},null,44,Kp)],4))),128))])],10,Mp)),64))])])):sA("",!0),A.modelValue.type==="custom"?(T(),_("div",Op,[B("h4",Pp,v(m.$t("emojiConfig.customEmojiPackConfig")),1),B("div",Vp,[B("div",null,[B("label",Wp,v(m.$t("emojiConfig.maxImageWidth")),1),ZA(B("input",{type:"number","onUpdate:modelValue":c[3]||(c[3]=d=>s.value.size.width=d),min:"16",max:"200",class:"w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-primary-500"},null,512),[[te,s.value.size.width,void 0,{number:!0}]])]),B("div",null,[B("label",qp,v(m.$t("emojiConfig.maxImageHeight")),1),ZA(B("input",{type:"number","onUpdate:modelValue":c[4]||(c[4]=d=>s.value.size.height=d),min:"16",max:"200",class:"w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-primary-500"},null,512),[[te,s.value.size.height,void 0,{number:!0}]])])]),B("div",jp,[B("h5",Zp,v(m.$t("emojiConfig.uploadEmojiImages")),1),B("div",Xp,[(T(!0),_(qA,null,Ke(g.value,d=>(T(),_("div",{key:d.key,class:"space-y-2"},[B("div",zp,[B("div",$p,v(d.emoji),1),B("div",Am,[B("span",null,v(d.name),1),d.key==="neutral"?(T(),_("span",em,v(m.$t("emojiConfig.required")),1)):sA("",!0)])]),B("div",{onDrop:w=>C(w,d.key),onDragover:c[5]||(c[5]=dt(()=>{},["prevent"])),onDragenter:c[6]||(c[6]=dt(()=>{},["prevent"])),class:kA(["border-2 border-dashed rounded-lg p-2 text-center cursor-pointer transition-colors aspect-square flex flex-col items-center justify-center",A.modelValue.custom.images[d.key]?"border-green-300 bg-green-50":d.key==="neutral"?"border-red-300 bg-red-50":"border-gray-300 hover:border-gray-400"])},[B("input",{ref_for:!0,ref:d.key+"Input",type:"file",accept:".png,.gif",onChange:w=>l(w,d.key),class:"hidden"},null,40,im),A.modelValue.custom.images[d.key]?(T(),_("div",rm,[u(d.key)?(T(),_("img",{key:0,src:u(d.key),alt:d.name,class:"w-full h-full object-cover rounded",onError:E},null,40,gm)):sA("",!0),B("button",{onClick:w=>h(d.key),class:"absolute -top-1 -right-1 w-4 h-4 bg-red-500 text-white rounded-full flex items-center justify-center text-xs hover:bg-red-600"}," × ",8,sm)])):(T(),_("div",{key:0,onClick:w=>{var F;return(F=m.$refs[d.key+"Input"][0])==null?void 0:F.click()}},[c[8]||(c[8]=B("svg",{class:"w-6 h-6 text-gray-400 mx-auto mb-1",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[B("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 6v6m0 0v6m0-6h6m-6 0H6"})],-1)),B("div",om,v(m.$t("emojiConfig.clickToUploadOrDrag")),1)],8,nm))],42,tm)]))),128))]),B("div",am,v(m.$t("emojiConfig.neutralRequiredNotice")),1)])])):sA("",!0)]))}},Cm={class:"space-y-6"},lm={class:"text-lg font-medium text-gray-900 mb-2"},Bm={class:"text-gray-600"},Qm={class:"space-y-4"},cm={class:"font-medium text-gray-900 flex items-center"},Em={class:"border border-gray-200 rounded-lg p-4 space-y-4"},um={class:"flex space-x-4"},hm={key:0,class:"space-y-3"},fm={class:"flex items-center space-x-3"},dm={class:"text-sm font-medium text-gray-700"},pm={class:"flex items-center space-x-2"},mm={class:"flex items-center space-x-3"},ym={class:"text-sm font-medium text-gray-700"},wm={class:"flex items-center space-x-2"},Dm={key:1,class:"space-y-3"},km={class:"text-sm font-medium text-gray-700"},vm={class:"mt-1 text-sm text-gray-600"},Fm={key:1,class:"space-y-2"},Sm=["src"],Rm={class:"text-sm text-green-700 font-medium"},bm={class:"flex items-center space-x-3"},Nm={class:"text-sm font-medium text-gray-700"},Gm={class:"flex items-center space-x-2"},Lm={class:"space-y-4"},Um={class:"font-medium text-gray-900 flex items-center"},Mm={class:"border border-gray-200 rounded-lg p-4 space-y-4"},xm={class:"flex space-x-4"},Jm={key:0,class:"space-y-3"},Tm={class:"flex items-center space-x-3"},Hm={class:"text-sm font-medium text-gray-700"},Ym={class:"flex items-center space-x-2"},_m={class:"flex items-center space-x-3"},Km={class:"text-sm font-medium text-gray-700"},Om={class:"flex items-center space-x-2"},Pm={key:1,class:"space-y-3"},Vm={class:"text-sm font-medium text-gray-700"},Wm={class:"mt-1 text-sm text-gray-600"},qm={key:1,class:"space-y-2"},jm=["src"],Zm={class:"text-sm text-green-700 font-medium"},Xm={class:"flex items-center space-x-3"},zm={class:"text-sm font-medium text-gray-700"},$m={class:"flex items-center space-x-2"},Ay={class:"space-y-4"},ey={class:"font-medium text-gray-900"},ty={class:"grid grid-cols-1 md:grid-cols-2 gap-4"},iy={class:"space-y-2"},ny={class:"text-sm font-medium text-gray-700"},oy={class:"absolute inset-0 bg-white bg-opacity-10 flex items-center justify-center rounded-lg"},ry={class:"space-y-2"},gy={class:"text-sm font-medium text-gray-700"},sy={class:"absolute inset-0 bg-black bg-opacity-10 flex items-center justify-center rounded-lg"},ay={class:"bg-blue-50 border border-blue-200 rounded-lg p-4"},Iy={class:"font-medium text-blue-900 mb-2"},Cy={class:"flex flex-wrap gap-2"},ly={__name:"BackgroundConfig",props:{modelValue:{type:Object,required:!0}},emits:["update:modelValue"],setup(A,{emit:e}){const{t}=ve(),i=A,n=e,o=cA(null),r=cA(null),g=hA({get:()=>i.modelValue.light.backgroundColor,set:R=>Q(R)}),s=hA({get:()=>i.modelValue.dark.backgroundColor,set:R=>h(R)}),a=hA({get:()=>i.modelValue.light.textColor,set:R=>f(R)}),I=hA({get:()=>i.modelValue.dark.textColor,set:R=>u(R)}),l=R=>{n("update:modelValue",{...i.modelValue,light:{...i.modelValue.light,backgroundType:R,backgroundImage:R==="image"?i.modelValue.light.backgroundImage:null}})},C=R=>{n("update:modelValue",{...i.modelValue,dark:{...i.modelValue.dark,backgroundType:R,backgroundImage:R==="image"?i.modelValue.dark.backgroundImage:null}})},Q=R=>{n("update:modelValue",{...i.modelValue,light:{...i.modelValue.light,backgroundColor:R}})},h=R=>{n("update:modelValue",{...i.modelValue,dark:{...i.modelValue.dark,backgroundColor:R}})},f=R=>{n("update:modelValue",{...i.modelValue,light:{...i.modelValue.light,textColor:R}})},u=R=>{n("update:modelValue",{...i.modelValue,dark:{...i.modelValue.dark,textColor:R}})},E=(R,b)=>{const L=R.target.files[0];L&&c(b,L)},m=(R,b)=>{R.preventDefault();const L=R.dataTransfer.files;L.length>0&&c(b,L[0])},c=async(R,b)=>{b&&b.type.startsWith("image/")?(n("update:modelValue",{...i.modelValue,[R]:{...i.modelValue[R],backgroundImage:b}}),await Si.saveBackgroundFile(R,b)):alert(t("backgroundConfig.selectValidImage"))},d=async R=>{n("update:modelValue",{...i.modelValue,[R]:{...i.modelValue[R],backgroundImage:null}}),R==="light"&&o.value&&(o.value.value=""),R==="dark"&&r.value&&(r.value.value=""),await Si.deleteBackgroundFile(R)},w=R=>{const b=i.modelValue[R].backgroundImage;return b?URL.createObjectURL(b):null},F=()=>i.modelValue.light.backgroundType==="image"&&i.modelValue.light.backgroundImage?{backgroundImage:`url(${w("light")})`,backgroundSize:"cover",backgroundPosition:"center"}:{backgroundColor:i.modelValue.light.backgroundColor},N=()=>i.modelValue.dark.backgroundType==="image"&&i.modelValue.dark.backgroundImage?{backgroundImage:`url(${w("dark")})`,backgroundSize:"cover",backgroundPosition:"center"}:{backgroundColor:i.modelValue.dark.backgroundColor},G=(R,b)=>{const L=K(R)?"#000000":"#ffffff",EA=K(b)?"#000000":"#ffffff";n("update:modelValue",{...i.modelValue,light:{...i.modelValue.light,backgroundType:"color",backgroundColor:R,textColor:L,backgroundImage:null},dark:{...i.modelValue.dark,backgroundType:"color",backgroundColor:b,textColor:EA,backgroundImage:null}})},K=R=>{const b=R.replace("#",""),L=parseInt(b.substr(0,2),16),EA=parseInt(b.substr(2,2),16),dA=parseInt(b.substr(4,2),16);return(L*299+EA*587+dA*114)/1e3>128};return(R,b)=>(T(),_("div",Cm,[B("div",null,[B("h3",lm,v(R.$t("backgroundConfig.title")),1),B("p",Bm,v(R.$t("backgroundConfig.description")),1)]),B("div",Qm,[B("h4",cm,[b[33]||(b[33]=B("svg",{class:"w-5 h-5 mr-2 text-yellow-500",fill:"currentColor",viewBox:"0 0 20 20"},[B("path",{"fill-rule":"evenodd",d:"M10 2a1 1 0 011 1v1a1 1 0 11-2 0V3a1 1 0 011-1zm4 8a4 4 0 11-8 0 4 4 0 018 0zm-.464 4.95l.707.707a1 1 0 001.414-1.414l-.707-.707a1 1 0 00-1.414 1.414zm2.12-10.607a1 1 0 010 1.414l-.706.707a1 1 0 11-1.414-1.414l.707-.707a1 1 0 011.414 0zM17 11a1 1 0 100-2h-1a1 1 0 100 2h1zm-7 4a1 1 0 011 1v1a1 1 0 11-2 0v-1a1 1 0 011-1zM5.05 6.464A1 1 0 106.465 5.05l-.708-.707a1 1 0 00-1.414 1.414l.707.707zm1.414 8.486l-.707.707a1 1 0 01-1.414-1.414l.707-.707a1 1 0 011.414 1.414zM4 11a1 1 0 100-2H3a1 1 0 000 2h1z","clip-rule":"evenodd"})],-1)),gt(" "+v(R.$t("backgroundConfig.lightMode")),1)]),B("div",Em,[B("div",um,[B("button",{onClick:b[0]||(b[0]=L=>l("color")),class:kA(["px-3 py-2 text-sm border rounded transition-colors",A.modelValue.light.backgroundType==="color"?"border-primary-500 bg-primary-50 text-primary-700":"border-gray-300 hover:border-gray-400"])},v(R.$t("backgroundConfig.solidBackground")),3),B("button",{onClick:b[1]||(b[1]=L=>l("image")),class:kA(["px-3 py-2 text-sm border rounded transition-colors",A.modelValue.light.backgroundType==="image"?"border-primary-500 bg-primary-50 text-primary-700":"border-gray-300 hover:border-gray-400"])},v(R.$t("backgroundConfig.imageBackground")),3)]),A.modelValue.light.backgroundType==="color"?(T(),_("div",hm,[B("div",fm,[B("label",dm,v(R.$t("backgroundConfig.backgroundColor")),1),B("div",pm,[ZA(B("input",{type:"color","onUpdate:modelValue":b[2]||(b[2]=L=>g.value=L),class:"w-10 h-10 border border-gray-300 rounded cursor-pointer"},null,512),[[te,g.value]]),ZA(B("input",{type:"text","onUpdate:modelValue":b[3]||(b[3]=L=>g.value=L),class:"border border-gray-300 rounded px-3 py-2 text-sm font-mono w-24"},null,512),[[te,g.value]])]),B("div",{style:VA({backgroundColor:g.value}),class:"w-16 h-10 border border-gray-300 rounded shadow-inner"},null,4)]),B("div",mm,[B("label",ym,v(R.$t("backgroundConfig.textColor")),1),B("div",wm,[ZA(B("input",{type:"color","onUpdate:modelValue":b[4]||(b[4]=L=>a.value=L),class:"w-10 h-10 border border-gray-300 rounded cursor-pointer"},null,512),[[te,a.value]]),ZA(B("input",{type:"text","onUpdate:modelValue":b[5]||(b[5]=L=>a.value=L),class:"border border-gray-300 rounded px-3 py-2 text-sm font-mono w-24"},null,512),[[te,a.value]])]),B("div",{style:VA({backgroundColor:a.value}),class:"w-16 h-10 border border-gray-300 rounded shadow-inner"},null,4)])])):sA("",!0),A.modelValue.light.backgroundType==="image"?(T(),_("div",Dm,[B("label",km,v(R.$t("backgroundConfig.backgroundImage")),1),B("div",{onDrop:b[9]||(b[9]=L=>m(L,"light")),onDragover:b[10]||(b[10]=dt(()=>{},["prevent"])),onDragenter:b[11]||(b[11]=dt(()=>{},["prevent"])),class:kA(["border-2 border-dashed rounded-lg p-4 text-center cursor-pointer transition-colors",A.modelValue.light.backgroundImage?"border-green-300 bg-green-50":"border-gray-300 hover:border-gray-400"])},[B("input",{ref_key:"lightImageInput",ref:o,type:"file",accept:"image/*",onChange:b[6]||(b[6]=L=>E(L,"light")),class:"hidden"},null,544),A.modelValue.light.backgroundImage?(T(),_("div",Fm,[B("img",{src:w("light"),alt:"{{ $t('backgroundConfig.lightModePreview') }}背景",class:"max-w-32 max-h-32 mx-auto rounded shadow"},null,8,Sm),B("p",Rm,v(A.modelValue.light.backgroundImage.name),1),B("button",{onClick:b[8]||(b[8]=L=>d("light")),class:"text-red-600 hover:text-red-500 text-sm"},v(R.$t("backgroundConfig.removeImage")),1)])):(T(),_("div",{key:0,onClick:b[7]||(b[7]=L=>R.$refs.lightImageInput.click())},[b[34]||(b[34]=B("svg",{class:"mx-auto h-8 w-8 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[B("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})],-1)),B("p",vm,v(R.$t("backgroundConfig.clickOrDragToUpload")),1)]))],34),B("div",bm,[B("label",Nm,v(R.$t("backgroundConfig.textColor")),1),B("div",Gm,[ZA(B("input",{type:"color","onUpdate:modelValue":b[12]||(b[12]=L=>a.value=L),class:"w-10 h-10 border border-gray-300 rounded cursor-pointer"},null,512),[[te,a.value]]),ZA(B("input",{type:"text","onUpdate:modelValue":b[13]||(b[13]=L=>a.value=L),class:"border border-gray-300 rounded px-3 py-2 text-sm font-mono w-24"},null,512),[[te,a.value]])]),B("div",{style:VA({backgroundColor:a.value}),class:"w-16 h-10 border border-gray-300 rounded shadow-inner"},null,4)])])):sA("",!0)])]),B("div",Lm,[B("h4",Um,[b[35]||(b[35]=B("svg",{class:"w-5 h-5 mr-2 text-gray-600",fill:"currentColor",viewBox:"0 0 20 20"},[B("path",{d:"M17.293 13.293A8 8 0 016.707 2.707a8.001 8.001 0 1010.586 10.586z"})],-1)),gt(" "+v(R.$t("backgroundConfig.darkMode")),1)]),B("div",Mm,[B("div",xm,[B("button",{onClick:b[14]||(b[14]=L=>C("color")),class:kA(["px-3 py-2 text-sm border rounded transition-colors",A.modelValue.dark.backgroundType==="color"?"border-primary-500 bg-primary-50 text-primary-700":"border-gray-300 hover:border-gray-400"])},v(R.$t("backgroundConfig.solidBackground")),3),B("button",{onClick:b[15]||(b[15]=L=>C("image")),class:kA(["px-3 py-2 text-sm border rounded transition-colors",A.modelValue.dark.backgroundType==="image"?"border-primary-500 bg-primary-50 text-primary-700":"border-gray-300 hover:border-gray-400"])},v(R.$t("backgroundConfig.imageBackground")),3)]),A.modelValue.dark.backgroundType==="color"?(T(),_("div",Jm,[B("div",Tm,[B("label",Hm,v(R.$t("backgroundConfig.backgroundColor")),1),B("div",Ym,[ZA(B("input",{type:"color","onUpdate:modelValue":b[16]||(b[16]=L=>s.value=L),class:"w-10 h-10 border border-gray-300 rounded cursor-pointer"},null,512),[[te,s.value]]),ZA(B("input",{type:"text","onUpdate:modelValue":b[17]||(b[17]=L=>s.value=L),class:"border border-gray-300 rounded px-3 py-2 text-sm font-mono w-24"},null,512),[[te,s.value]])]),B("div",{style:VA({backgroundColor:s.value}),class:"w-16 h-10 border border-gray-300 rounded shadow-inner"},null,4)]),B("div",_m,[B("label",Km,v(R.$t("backgroundConfig.textColor")),1),B("div",Om,[ZA(B("input",{type:"color","onUpdate:modelValue":b[18]||(b[18]=L=>I.value=L),class:"w-10 h-10 border border-gray-300 rounded cursor-pointer"},null,512),[[te,I.value]]),ZA(B("input",{type:"text","onUpdate:modelValue":b[19]||(b[19]=L=>I.value=L),class:"border border-gray-300 rounded px-3 py-2 text-sm font-mono w-24"},null,512),[[te,I.value]])]),B("div",{style:VA({backgroundColor:I.value}),class:"w-16 h-10 border border-gray-300 rounded shadow-inner"},null,4)])])):sA("",!0),A.modelValue.dark.backgroundType==="image"?(T(),_("div",Pm,[B("label",Vm,v(R.$t("backgroundConfig.backgroundImage")),1),B("div",{onDrop:b[23]||(b[23]=L=>m(L,"dark")),onDragover:b[24]||(b[24]=dt(()=>{},["prevent"])),onDragenter:b[25]||(b[25]=dt(()=>{},["prevent"])),class:kA(["border-2 border-dashed rounded-lg p-4 text-center cursor-pointer transition-colors",A.modelValue.dark.backgroundImage?"border-green-300 bg-green-50":"border-gray-300 hover:border-gray-400"])},[B("input",{ref_key:"darkImageInput",ref:r,type:"file",accept:"image/*",onChange:b[20]||(b[20]=L=>E(L,"dark")),class:"hidden"},null,544),A.modelValue.dark.backgroundImage?(T(),_("div",qm,[B("img",{src:w("dark"),alt:"{{ $t('backgroundConfig.darkModePreview') }}背景",class:"max-w-32 max-h-32 mx-auto rounded shadow"},null,8,jm),B("p",Zm,v(A.modelValue.dark.backgroundImage.name),1),B("button",{onClick:b[22]||(b[22]=L=>d("dark")),class:"text-red-600 hover:text-red-500 text-sm"},v(R.$t("backgroundConfig.removeImage")),1)])):(T(),_("div",{key:0,onClick:b[21]||(b[21]=L=>R.$refs.darkImageInput.click())},[b[36]||(b[36]=B("svg",{class:"mx-auto h-8 w-8 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[B("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})],-1)),B("p",Wm,v(R.$t("backgroundConfig.clickOrDragToUpload")),1)]))],34),B("div",Xm,[B("label",zm,v(R.$t("backgroundConfig.textColor")),1),B("div",$m,[ZA(B("input",{type:"color","onUpdate:modelValue":b[26]||(b[26]=L=>I.value=L),class:"w-10 h-10 border border-gray-300 rounded cursor-pointer"},null,512),[[te,I.value]]),ZA(B("input",{type:"text","onUpdate:modelValue":b[27]||(b[27]=L=>I.value=L),class:"border border-gray-300 rounded px-3 py-2 text-sm font-mono w-24"},null,512),[[te,I.value]])]),B("div",{style:VA({backgroundColor:I.value}),class:"w-16 h-10 border border-gray-300 rounded shadow-inner"},null,4)])])):sA("",!0)])]),B("div",Ay,[B("h4",ey,v(R.$t("backgroundConfig.backgroundPreview")),1),B("div",ty,[B("div",iy,[B("div",ny,v(R.$t("backgroundConfig.lightModePreview")),1),B("div",{style:VA(F()),class:"h-32 border border-gray-300 rounded-lg flex items-center justify-center text-sm relative overflow-hidden"},[B("div",oy,[B("span",{style:VA({color:A.modelValue.light.textColor})},v(R.$t("backgroundConfig.chatArea")),5)])],4)]),B("div",ry,[B("div",gy,v(R.$t("backgroundConfig.darkModePreview")),1),B("div",{style:VA(N()),class:"h-32 border border-gray-300 rounded-lg flex items-center justify-center text-sm relative overflow-hidden"},[B("div",sy,[B("span",{style:VA({color:A.modelValue.dark.textColor})},v(R.$t("backgroundConfig.chatArea")),5)])],4)])])]),B("div",ay,[B("h5",Iy,v(R.$t("backgroundConfig.quickConfig")),1),B("div",Cy,[B("button",{onClick:b[28]||(b[28]=L=>G("#ffffff","#1f2937")),class:"px-3 py-1 text-sm bg-white border border-gray-300 rounded hover:bg-gray-50"},v(R.$t("backgroundConfig.defaultColors")),1),B("button",{onClick:b[29]||(b[29]=L=>G("#f5f5f4","#374151")),class:"px-3 py-1 text-sm bg-stone-100 border border-gray-300 rounded hover:bg-stone-200"},v(R.$t("backgroundConfig.stoneTexture")),1),B("button",{onClick:b[30]||(b[30]=L=>G("#fef7cd","#7c2d12")),class:"px-3 py-1 text-sm bg-yellow-100 border border-gray-300 rounded hover:bg-yellow-200"},v(R.$t("backgroundConfig.sunnyColors")),1),B("button",{onClick:b[31]||(b[31]=L=>G("#e0f2fe","#1e40af")),class:"px-3 py-1 text-sm bg-sky-100 border border-gray-300 rounded hover:bg-sky-200"},v(R.$t("backgroundConfig.skyBlue")),1),B("button",{onClick:b[32]||(b[32]=L=>G("#fdf2f8","#be185d")),class:"px-3 py-1 text-sm bg-pink-100 border border-gray-300 rounded hover:bg-pink-200"},v(R.$t("backgroundConfig.romanticPink")),1)])])]))}},By={class:"space-y-6"},Qy={class:"text-xl font-semibold text-gray-900 mb-4"},cy={class:"text-gray-600 mb-6"},Ey={class:"border-b border-gray-200"},uy={class:"-mb-px flex space-x-4 sm:space-x-8"},hy=["onClick"],fy={class:"flex items-center"},dy={class:"hidden sm:inline"},py={class:"min-h-96"},my={class:"flex justify-between"},yy={__name:"ThemeDesign",props:{modelValue:{type:Object,required:!0},chipModel:{type:String,required:!0},activeTab:{type:String,default:"wakeword"}},emits:["update:modelValue","next","prev","tabChange"],setup(A,{emit:e}){const{t}=ve(),i={render(){return GA("svg",{fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[GA("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 11a7 7 0 01-7 7m0 0a7 7 0 01-7-7m7 7v4m0 0H8m4 0h4m-4-8a3 3 0 01-3-3V5a3 3 0 116 0v6a3 3 0 01-3 3z"})])}},n={render(){return GA("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 640 640"},[GA("path",{d:"M320 96C329.5 96 338 101.5 341.9 110.2L515.1 496L536 496C549.3 496 560 506.7 560 520C560 533.3 549.3 544 536 544L440 544C426.7 544 416 533.3 416 520C416 506.7 426.7 496 440 496L462.5 496L426.6 416L213.4 416L177.5 496L200 496C213.3 496 224 506.7 224 520C224 533.3 213.3 544 200 544L104 544C90.7 544 80 533.3 80 520C80 506.7 90.7 496 104 496L124.9 496L298.1 110.2C302 101.5 310.5 96 320 96zM320 178.6L235 368L405 368L320 178.6z"})])}},o={render(){return GA("svg",{fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[GA("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M14.828 14.828a4 4 0 01-5.656 0M9 10h.01M15 10h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})])}},r={render(){return GA("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 640 640"},[GA("path",{d:"M160 144C151.2 144 144 151.2 144 160L144 480C144 488.8 151.2 496 160 496L480 496C488.8 496 496 488.8 496 480L496 160C496 151.2 488.8 144 480 144L160 144zM96 160C96 124.7 124.7 96 160 96L480 96C515.3 96 544 124.7 544 160L544 480C544 515.3 515.3 544 480 544L160 544C124.7 544 96 515.3 96 480L96 160zM224 192C241.7 192 256 206.3 256 224C256 241.7 241.7 256 224 256C206.3 256 192 241.7 192 224C192 206.3 206.3 192 224 192zM360 264C368.5 264 376.4 268.5 380.7 275.8L460.7 411.8C465.1 419.2 465.1 428.4 460.8 435.9C456.5 443.4 448.6 448 440 448L200 448C191.1 448 182.8 443 178.7 435.1C174.6 427.2 175.2 417.6 180.3 410.3L236.3 330.3C240.8 323.9 248.1 320.1 256 320.1C263.9 320.1 271.2 323.9 275.7 330.3L292.9 354.9L339.4 275.9C343.7 268.6 351.6 264.1 360.1 264.1z"})])}},g=A,s=e,a=cA(g.activeTab),I=hA(()=>[{id:"wakeword",name:t("themeDesign.tabs.wakeword"),icon:i},{id:"font",name:t("themeDesign.tabs.font"),icon:n},{id:"emoji",name:t("themeDesign.tabs.emoji"),icon:o},{id:"background",name:t("themeDesign.tabs.background"),icon:r}]),l=hA({get:()=>g.modelValue,set:h=>s("update:modelValue",h)}),C=()=>{var u,E,m;const h=g.modelValue.wakeword;if(h.type==="custom"){if(!((u=h.custom.name)!=null&&u.trim())){alert(t("wakewordConfig.errors.nameRequired"));return}if(!((E=h.custom.command)!=null&&E.trim())){alert(t("wakewordConfig.errors.commandRequired"));return}if(!h.custom.duration||h.custom.duration<500||h.custom.duration>1e4){alert(t("wakewordConfig.errors.durationRange"));return}}const f=g.modelValue.font;if(f.type==="custom"&&!((m=f.custom)!=null&&m.file)){alert(t("fontConfig.selectValidFontFile"));return}s("next")},Q=h=>{a.value=h,s("tabChange",h)};return ae(()=>g.activeTab,h=>{a.value=h}),(h,f)=>(T(),_("div",By,[B("div",null,[B("h2",Qy,v(h.$t("themeDesign.title")),1),B("p",cy,v(h.$t("themeDesign.description")),1)]),B("div",Ey,[B("nav",uy,[(T(!0),_(qA,null,Ke(I.value,u=>(T(),_("button",{key:u.id,onClick:E=>Q(u.id),class:kA(["py-2 px-1 border-b-2 font-medium text-sm relative",a.value===u.id?"border-primary-500 text-primary-600":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300"])},[B("span",fy,[(T(),ye(HI(u.icon),{class:"w-5 h-5 sm:mr-2"})),B("span",dy,v(u.name),1)])],10,hy))),128))])]),B("div",py,[a.value==="wakeword"?(T(),ye(b0,{key:0,modelValue:l.value.wakeword,"onUpdate:modelValue":f[0]||(f[0]=u=>l.value.wakeword=u),chipModel:A.chipModel},null,8,["modelValue","chipModel"])):sA("",!0),a.value==="font"?(T(),ye(kp,{key:1,modelValue:l.value.font,"onUpdate:modelValue":f[1]||(f[1]=u=>l.value.font=u)},null,8,["modelValue"])):sA("",!0),a.value==="emoji"?(T(),ye(Im,{key:2,modelValue:l.value.emoji,"onUpdate:modelValue":f[2]||(f[2]=u=>l.value.emoji=u)},null,8,["modelValue"])):sA("",!0),a.value==="background"?(T(),ye(ly,{key:3,modelValue:l.value.skin,"onUpdate:modelValue":f[3]||(f[3]=u=>l.value.skin=u)},null,8,["modelValue"])):sA("",!0)]),B("div",my,[B("button",{onClick:f[4]||(f[4]=u=>h.$emit("prev")),class:"bg-gray-500 hover:bg-gray-600 text-white px-6 py-2 rounded-lg font-medium transition-colors"},v(h.$t("themeDesign.previous")),1),B("button",{onClick:C,class:"bg-primary-500 hover:bg-primary-600 text-white px-6 py-2 rounded-lg font-medium transition-colors"},v(h.$t("themeDesign.next")),1)])]))}},wy=(A,e)=>{const t=A.__vccOpts||A;for(const[i,n]of e)t[i]=n;return t},Dy={class:"space-y-6"},ky={class:"text-xl font-semibold text-gray-900 mb-4"},vy={class:"text-gray-600 mb-6"},Fy={class:"flex flex-col lg:flex-row gap-8"},Sy={class:"flex-1"},Ry={class:"text-lg font-medium text-gray-900 mb-4"},by={class:"bg-gray-100 p-4 rounded-lg"},Ny={class:"max-w-full overflow-auto flex justify-center"},Gy={class:"bg-gray-800 p-6 rounded-2xl shadow-2xl inline-block"},Ly={class:"bg-gray-900 p-2 rounded-xl"},Uy={class:"relative z-10 flex flex-col items-center justify-center p-4 text-center"},My={class:"mb-4"},xy={key:0,class:"emoji-container"},Jy=["src","alt"],Ty={key:1,class:"emoji-container"},Hy={class:"text-center"},Yy={class:"text-sm"},_y={class:"text-xs"},Ky={key:0,class:"absolute inset-0 flex items-center justify-center"},Oy={class:"animate-pulse text-gray-400 text-xs"},Py={class:"mt-3 text-center text-xs text-gray-400"},Vy={class:"w-full lg:w-80"},Wy={class:"text-lg font-medium text-gray-900 mb-4"},qy={class:"space-y-6 bg-white border border-gray-200 rounded-lg p-4"},jy={class:"block text-sm font-medium text-gray-700 mb-2"},Zy={class:"block text-sm font-medium text-gray-700 mb-2"},Xy={key:0,class:"flex flex-wrap gap-2 max-h-32 overflow-y-auto justify-center"},zy=["onClick","title"],$y={key:0},Aw=["src","alt"],ew={key:1,class:"text-lg"},tw={key:1,class:"text-center py-4 text-gray-500 bg-gray-50 rounded-lg border-2 border-dashed"},iw={class:"text-2xl mb-2"},nw={class:"text-sm"},ow={class:"block text-sm font-medium text-gray-700 mb-2"},rw={class:"flex space-x-2"},gw={class:"border-t pt-4"},sw={class:"font-medium text-gray-900 mb-2"},aw={class:"text-xs text-gray-600 space-y-1"},Iw={key:0},Cw={class:"flex items-center"},lw={key:0,class:"ml-2 animate-pulse text-blue-500"},Bw={key:1},Qw={class:"flex justify-between"},cw={__name:"GenerateSummary",props:{config:{type:Object,required:!0}},emits:["prev","generate"],setup(A){const{t:e}=ve(),t=A,i=cA(e("generateSummary.defaultPreviewText")),n=cA("happy"),o=cA("light"),r=cA(!1),g=cA(""),s=hA(()=>[{key:"neutral",name:e("generateSummary.emotions.neutral"),emoji:"😶"},{key:"happy",name:e("generateSummary.emotions.happy"),emoji:"🙂"},{key:"laughing",name:e("generateSummary.emotions.laughing"),emoji:"😆"},{key:"funny",name:e("generateSummary.emotions.funny"),emoji:"😂"},{key:"sad",name:e("generateSummary.emotions.sad"),emoji:"😔"},{key:"angry",name:e("generateSummary.emotions.angry"),emoji:"😠"},{key:"crying",name:e("generateSummary.emotions.crying"),emoji:"😭"},{key:"loving",name:e("generateSummary.emotions.loving"),emoji:"😍"},{key:"surprised",name:e("generateSummary.emotions.surprised"),emoji:"😯"},{key:"thinking",name:e("generateSummary.emotions.thinking"),emoji:"🤔"},{key:"cool",name:e("generateSummary.emotions.cool"),emoji:"😎"},{key:"sleepy",name:e("generateSummary.emotions.sleepy"),emoji:"😴"}]),a=hA(()=>{if(t.config.theme.emoji.type==="preset"&&t.config.theme.emoji.preset)return s.value;if(t.config.theme.emoji.type==="custom"){const R=t.config.theme.emoji.custom.images;return s.value.filter(b=>R[b.key])}else return[]}),I=hA(()=>E(n.value)),l=()=>{const{width:R,height:b}=t.config.chip.display;return{width:`${R}px`,height:`${b}px`}},C=()=>{const R=t.config.theme.skin[o.value];if(R.backgroundType==="image"&&R.backgroundImage)try{if(R.backgroundImage&&typeof R.backgroundImage=="object"&&R.backgroundImage.size)return{backgroundImage:`url(${URL.createObjectURL(R.backgroundImage)})`,backgroundSize:"cover",backgroundPosition:"center"}}catch(b){console.warn("背景图片预览加载失败:",b)}return{backgroundColor:R.backgroundColor||"#ffffff"}},Q=()=>{let R=48;return t.config.theme.emoji.type==="preset"?R=t.config.theme.emoji.preset==="twemoji64"?64:32:t.config.theme.emoji.custom.size&&(R=Math.min(t.config.theme.emoji.custom.size.width,t.config.theme.emoji.custom.size.height)),{width:`${R}px`,height:`${R}px`}},h=()=>{let R=14;if(t.config.theme.font.type==="preset"){const L=t.config.theme.font.preset;L.includes("_14_")?R=14:L.includes("_16_")?R=16:L.includes("_20_")?R=20:L.includes("_30_")&&(R=30)}else t.config.theme.font.custom.size&&(R=t.config.theme.font.custom.size);const b=o.value==="dark"?t.config.theme.skin.dark.textColor:t.config.theme.skin.light.textColor;return{fontSize:`${R}px`,color:b,fontFamily:u(),textShadow:o.value==="dark"?"1px 1px 2px rgba(0,0,0,0.5)":"1px 1px 2px rgba(255,255,255,0.5)"}},f=async()=>{document.querySelectorAll("style[data-font-preview]").forEach(b=>b.remove()),r.value=!1,g.value="";try{if(t.config.theme.font.type==="preset"){const b=t.config.theme.font.preset;let L,EA;b&&b.startsWith("font_noto_qwen_")?(L="NotoPreview",EA="./static/fonts/noto_qwen.ttf"):(L="PuHuiPreview",EA="./static/fonts/puhui_deepseek.ttf");const dA=document.createElement("style");dA.setAttribute("data-font-preview","true"),dA.textContent=` +Vui lòng tải lại hình ảnh biểu tượng cảm xúc tùy chỉnh.`,incompatibleEmojiData:"Phát hiện dữ liệu biểu tượng cảm xúc không tương thích, vui lòng cấu hình lại"},Pf={authTokenMissing:"Không tìm thấy mã thông báo xác thực",checkingDeviceStatus:"Đang kiểm tra trạng thái thiết bị...",deviceOfflineOrUnresponsive:"Thiết bị không tồn tại hoặc không trực tuyến",unableToGetDeviceStatus:"Không thể lấy trạng thái thiết bị",initializingTransferService:"Đang khởi tạo dịch vụ truyền tải...",initializeTransferFailed:"Khởi tạo dịch vụ truyền tải thất bại: {error}",uploadingFile:"Tải lên tập tin. .....",uploadFailed:"Tải lên tập tin không thành công",settingDeviceDownloadUrl:"Đang thiết lập URL tải xuống thiết bị...",setDownloadUrlFailed:"Thiết lập URL tải xuống thất bại: {error}",rebootingDevice:"Đang khởi động lại thiết bị...",waitingForDeviceReboot:"Đang chờ thiết bị khởi động lại...",deviceRebootTimeout:"Hết thời gian chờ thiết bị khởi động lại (60 giây)",deviceReady:"Thiết bị đã sẵn sàng, vui lòng chờ chương trình ghi",startingFileTransfer:"Đang bắt đầu truyền tải tệp...",flashCompleted:"Trong quá trình ghi âm chương trình, xin lưu ý trạng thái ghi âm của phần cố định!",onlineFlashFailed:"Flash trực tuyến thất bại: {error}"},Vf={online:"Trực tuyến",offline:"Ngoại tuyến",checking:"Đang kiểm tra...",flashing:"Đang flash...",ready:"Sẵn sàng",chip:"Chip",board:"Bo mạch",flash:"Flash",screen:"Màn hình",signal:{unknown:"Không xác định",strong:"Mạnh",medium:"Trung bình",weak:"Yếu",none:"Không có tín hiệu"}},Wf={title:"Bước 1: Cấu hình mô hình chip và màn hình",loadingFromDevice:"Đang tải cấu hình phần cứng từ thiết bị...",loadedFromDevice:"Cấu hình phần cứng được tải tự động từ thiết bị",manualConfig:"Vui lòng cấu hình các thông số phần cứng theo cách thủ công",loadingTitle:"Đang tải cấu hình thiết bị...",loadingDesc:"Đang đọc mô hình chip và độ phân giải màn hình từ thiết bị",autoLoadedTitle:"Cấu hình thiết bị được tải tự động",chipModel:"Mô hình chip",screenWidth:"Chiều rộng màn hình",screenHeight:"Chiều cao màn hình",colorFormat:"Định dạng màu:",manualEdit:"Cấu hình thủ công",collapseManual:"Thu gọn cấu hình thủ công",manualConfigTitle:"Cấu hình phần cứng thủ công",next:"Tiếp theo",selectChip:"Chọn chip",chipRequired:"Mô hình chip",widthRequired:"Chiều rộng màn hình",heightRequired:"Chiều cao màn hình",loadingError:"Lỗi tải cấu hình",deviceOffline:"Thiết bị chưa kết nối hoặc ngoại tuyến",chipModelError:"Không thể lấy mô hình chip, vui lòng nhập thủ công",resolutionError:"Không thể lấy độ phân giải màn hình, vui lòng nhập thủ công",timeoutError:"Hết thời gian tải cấu hình, vui lòng nhập thủ công",manualConfigDesc:"Không thể tự động đọc cấu hình thiết bị",manualConfigHint:"Thiết bị chưa kết nối hoặc ngoại tuyến, vui lòng nhập cấu hình phần cứng thủ công",manualConfigRequired:"Vui lòng nhập cấu hình phần cứng thủ công",resolutionFormatError:"Lỗi định dạng độ phân giải màn hình"},qf={title:"Bước 2: Thiết kế chủ đề",description:"Cấu hình từ đánh thức, phông chữ, biểu tượng cảm xúc và nền để tùy chỉnh chủ đề Xiaozhi AI của bạn.",previous:"Trước đó",next:"Tiếp theo",tabs:{wakeword:"Cấu hình từ đánh thức",font:"Cấu hình phông chữ",emoji:"Bộ sưu tập biểu tượng cảm xúc",background:"Nền trò chuyện"}},jf={title:"Bước 3: Xem trước",description:"Xem trước hiệu ứng của cấu hình tùy chỉnh trên thiết bị thực tế.",devicePreview:"Xem trước thiết bị (tỷ lệ pixel 1:1)",previewSettings:"Cài đặt xem trước",previewText:"Văn bản xem trước",defaultPreviewText:"Xin chào, tôi là bạn của bạn Xiaozhi!",currentEmotion:"Cảm xúc hiện tại",themeMode:"Chế độ chủ đề",lightMode:"Sáng",darkMode:"Tối",configSummary:"Tóm tắt cấu hình",wakeword:"Từ đánh thức:",font:"Phông chữ:",loading:"Đang tải...",emotion:"Cảm xúc:",skin:"Da:",previous:"Trước đó",generate:"Tạo assets.bin",emotions:{neutral:"Trung lập",happy:"Vui vẻ",laughing:"Cười lớn",funny:"Hài hước",sad:"Buồn",angry:"Giận dữ",crying:"Khóc",loving:"Yêu thương",embarrassed:"Xấu hổ",surprised:"Bất ngờ",shocked:"Sốc",thinking:"Suy nghĩ",winking:"Nháy mắt",cool:"Ngầu",relaxed:"Thoải mái",delicious:"Ngon miệng",kissy:"Hôn",confident:"Tự tin",sleepy:"Buồn ngủ",silly:"Ngớ ngẩn",confused:"Bối rối"},noEmotionConfigured:"Chưa cấu hình cảm xúc",fontLoading:"Đang tải phông chữ...",configureEmojiFirst:"Vui lòng cấu hình gói biểu tượng cảm xúc trong thiết kế chủ đề trước",customFont:"Phông chữ tùy chỉnh {size}px",customEmoji:"Biểu tượng cảm xúc tùy chỉnh {count} hình ảnh",notConfigured:"Chưa cấu hình",skinLight:"Sáng {type}",skinDark:"Tối {type}",hideSubtitle:"Ẩn phụ đề:",image:"Hình ảnh",color:"Màu sắc"},Zf={title:"Cấu hình nền trò chuyện",description:"Cấu hình nền trò chuyện cho chế độ sáng và tối, hỗ trợ màu đơn hoặc hình ảnh tùy chỉnh.",lightMode:"Nền chế độ sáng",darkMode:"Nền chế độ tối",solidBackground:"Nền màu đơn",imageBackground:"Nền hình ảnh",backgroundColor:"Màu nền:",textColor:"Màu chữ:",backgroundImage:"Hình ảnh nền:",clickOrDragToUpload:"Nhấp hoặc kéo để tải lên hình ảnh nền",removeImage:"Xóa hình ảnh",backgroundPreview:"Xem trước nền",lightModePreview:"Chế độ sáng",darkModePreview:"Chế độ tối",chatArea:"Khu vực nội dung trò chuyện",quickConfig:"Cấu hình nhanh",defaultColors:"Màu mặc định",stoneTexture:"Kết cấu đá",sunnyColors:"Màu nắng",skyBlue:"Xanh trời",romanticPink:"Hồng lãng mạn",selectValidImage:"Vui lòng chọn tệp hình ảnh hợp lệ"},Xf={title:"Cấu hình bộ sưu tập biểu tượng cảm xúc",description:"Chọn gói biểu tượng cảm xúc đặt sẵn hoặc hình ảnh biểu tượng cảm xúc tùy chỉnh. Mỗi gói biểu tượng cảm xúc chứa 21 biểu cảm cảm xúc khác nhau.",noEmojiPack:"Không có gói biểu tượng cảm xúc",noEmojiPackDescription:"Không cấu hình gói biểu tượng cảm xúc, chỉ bao gồm phông chữ và tài nguyên nền trong gói.",presetEmojiPack:"Gói biểu tượng cảm xúc đặt sẵn",customEmojiPack:"Gói biểu tượng cảm xúc tùy chỉnh",selectPresetEmojiPack:"Chọn gói biểu tượng cảm xúc đặt sẵn",twemoji64:"Twemoji 64×64",twemoji32:"Twemoji 32×32",twemojiDescription:"Bộ biểu tượng cảm xúc chất lượng cao từ Twitter, hoàn hảo để hiển thị rõ ràng",twitterEmojiName:"Twemoji {size}x{size}",twitterEmojiDescription:"Gói biểu tượng cảm xúc Twitter, {size}×{size} pixel",size:"Kích thước",preview:"Xem trước",select:"Chọn",customEmojiTitle:"Gói biểu tượng cảm xúc tùy chỉnh",customEmojiDescription:"Tải lên hình ảnh biểu tượng cảm xúc của riêng bạn. Mỗi cảm xúc cần một hình ảnh.",uploadInstructions:"Nhấp hoặc kéo để tải lên hình ảnh biểu tượng cảm xúc (PNG/JPG/WEBP)",supportedFormats:"Định dạng được hỗ trợ: PNG, JPG, WEBP. Kích thước khuyến nghị: 64×64 pixel",emotionMapping:"Ánh xạ cảm xúc",uploadAllEmotions:"Vui lòng tải lên hình ảnh biểu tượng cảm xúc cho tất cả cảm xúc",maxImageWidth:"Chiều rộng hình ảnh tối đa (px)",maxImageHeight:"Chiều cao hình ảnh tối đa (px)",clickToUpload:"Nhấp để tải lên",orDragDrop:"hoặc kéo và thả",clickToUploadOrDrag:"Nhấp để tải lên hoặc kéo vào đây",remove:"Xóa",replace:"Thay thế",selectValidEmojiImage:"Vui lòng chọn tệp hình ảnh biểu tượng cảm xúc hợp lệ",selectValidFormat:"Vui lòng chọn hình ảnh định dạng PNG hoặc GIF hợp lệ",maxFileSize:"Kích thước tệp không được vượt quá 1MB",invalidFormat:"Định dạng hình ảnh không được hỗ trợ. Vui lòng sử dụng PNG, JPG hoặc WEBP.",required:"Bắt buộc",uploadEmojiImages:"Tải lên hình ảnh biểu tượng cảm xúc (GIF cần PSRAM)",customEmojiPackConfig:"Cấu hình gói biểu tượng cảm xúc tùy chỉnh",neutralRequiredNotice:"* Phải tải lên cảm xúc mặc định trung lập, các cảm xúc khác là tùy chọn. Nếu không tải lên, cảm xúc mặc định sẽ được sử dụng thay thế.",sharedFileMessage:"Cảm xúc {emotionKey} sử dụng cùng tệp hình ảnh với {existingEmotions} (lưu trữ chia sẻ)",fileDeleted:"Tệp {fileHash} đã bị xóa (không có tham chiếu cảm xúc khác)",fileRetained:"Tệp {fileHash} vẫn được sử dụng bởi các cảm xúc khác, được giữ lại",imageLoadFailed:"Không tải được hình ảnh biểu tượng cảm xúc",emotions:{neutral:"Trung lập",happy:"Vui vẻ",laughing:"Cười lớn",funny:"Hài hước",sad:"Buồn",angry:"Giận dữ",crying:"Khóc",loving:"Yêu thương",embarrassed:"Xấu hổ",surprised:"Bất ngờ",shocked:"Sốc",thinking:"Suy nghĩ",winking:"Nháy mắt",cool:"Ngầu",relaxed:"Thoải mái",delicious:"Ngon miệng",kissy:"Hôn",confident:"Tự tin",sleepy:"Buồn ngủ",silly:"Ngớ ngẩn",confused:"Bối rối"}},zf={title:"Cấu hình phông chữ",description:"Chọn phông chữ đặt sẵn hoặc tải lên tệp phông chữ tùy chỉnh.",noFonts:"Không có phông chữ",noFontsDescription:"Không sử dụng cấu hình phông chữ, thiết bị sẽ sử dụng phông chữ mặc định",presetFonts:"Phông chữ đặt sẵn",customFonts:"Phông chữ tùy chỉnh",selectPresetFont:"Chọn phông chữ đặt sẵn",fontSize:"Kích thước phông chữ:",bitDepth:"Độ sâu bit:",charset:"Bộ ký tự:",fileSize:"Kích thước tệp:",customFontConfig:"Cấu hình phông chữ tùy chỉnh",fontFile:"Tệp phông chữ",clickSelectFontFile:"Nhấp để chọn tệp phông chữ",orDragFileHere:"hoặc kéo tệp vào đây",supportedFormats:"Hỗ trợ định dạng TTF, WOFF, WOFF2",removeFile:"Xóa tệp",fontSizePx:"Kích thước phông chữ (px)",range:"Phạm vi:",bitDepthBpp:"Độ sâu bit (BPP)",monochrome:"1 bpp (Đơn sắc)",fourColors:"2 bpp (4 màu)",sixteenColors:"4 bpp (16 màu)",characterSet:"Bộ ký tự",deepseekR1:"DeepSeek R1 (7405 ký tự)",gb2312:"GB2312 (7445 ký tự)",qwen18409:"Qwen (18409 ký tự)",latin1:"Latin1 (190 ký tự)",fullCharset:"Bộ ký tự đầy đủ (Tất cả ký tự trong tệp phông chữ)",hideSubtitle:"Ẩn phụ đề",hideSubtitleDescription:"Không hiển thị phụ đề văn bản trong khi trò chuyện",selectValidFontFile:"Vui lòng chọn tệp phông chữ hợp lệ (TTF, WOFF, WOFF2)",presetFontNames:{font_puhui_deepseek_14_1:"Alibaba PuHuiTi 14px",font_puhui_deepseek_16_4:"Alibaba PuHuiTi 16px",font_puhui_deepseek_20_4:"Alibaba PuHuiTi 20px",font_puhui_deepseek_30_4:"Alibaba PuHuiTi 30px",font_noto_qwen_14_1:"Noto Sans 14px",font_noto_qwen_16_4:"Noto Sans 16px",font_noto_qwen_20_4:"Noto Sans 20px",font_noto_qwen_30_4:"Noto Sans 30px"},charsetDeepseek:"DeepSeek 7405",charsetQwen:"Qwen 18409"},$f={app:Mf,common:xf,header:Jf,configNotice:Tf,steps:Hf,generateModal:Yf,progressSteps:_f,wakewordConfig:Kf,errors:Of,flashProgress:Pf,device:Vf,chipConfig:Wf,themeDesign:qf,generateSummary:jf,backgroundConfig:Zf,emojiConfig:Xf,fontConfig:zf},Ad={en:Lh,"zh-CN":zh,"zh-TW":uf,ja:Uf,vi:$f},Nn=[{code:"en",name:"English",flag:"🇺🇸"},{code:"zh-CN",name:"简体中文",flag:"🇨🇳"},{code:"zh-TW",name:"繁體中文",flag:"🇹🇼"},{code:"ja",name:"日本語",flag:"🇯🇵"},{code:"vi",name:"Tiếng Việt",flag:"🇻🇳"}];function ed(){const A=navigator.language||navigator.userLanguage;return{"zh-CN":"zh-CN","zh-TW":"zh-TW","zh-HK":"zh-TW",zh:"zh-CN",ja:"ja",vi:"vi",en:"en","en-US":"en","en-GB":"en"}[A]||"en"}const td={class:"relative"},id={class:"py-1"},nd=["onClick"],od={class:"mr-3"},rd={key:0,class:"ml-auto w-4 h-4 text-blue-600",fill:"currentColor",viewBox:"0 0 20 20"},gd={__name:"LanguageSelector",setup(A){const{locale:e}=ve(),t=EA(!1),i=hA(()=>Nn.find(s=>s.code===e.value)||Nn[0]),n=()=>{t.value=!t.value},o=()=>{t.value=!1},r=s=>{e.value=s,localStorage.setItem("user-language",s),o()},g=s=>{s.target.closest(".relative")||o()};return Ft(()=>{document.addEventListener("click",g);const s=localStorage.getItem("user-language");s&&Nn.find(a=>a.code===s)&&(e.value=s)}),Ii(()=>{document.removeEventListener("click",g)}),(s,a)=>(T(),K("div",td,[B("button",{onClick:n,class:"flex items-center space-x-2 px-3 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-md hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500"},[B("span",null,F(i.value.flag),1),B("span",null,F(i.value.name),1),(T(),K("svg",{class:kA(["w-4 h-4 transition-transform duration-200",{"rotate-180":t.value}]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...a[1]||(a[1]=[B("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 9l-7 7-7-7"},null,-1)])],2))]),t.value?(T(),K("div",{key:0,class:"absolute right-0 mt-2 w-48 bg-white border border-gray-200 rounded-md shadow-lg z-50",onClick:a[0]||(a[0]=dt(()=>{},["stop"]))},[B("div",id,[(T(!0),K(qA,null,Ke(BA(Nn),I=>(T(),K("button",{key:I.code,onClick:l=>r(I.code),class:kA(["flex items-center w-full px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 focus:outline-none focus:bg-gray-100",{"bg-blue-50 text-blue-700":I.code===i.value.code}])},[B("span",od,F(I.flag),1),B("span",null,F(I.name),1),I.code===i.value.code?(T(),K("svg",rd,[...a[2]||(a[2]=[B("path",{"fill-rule":"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z","clip-rule":"evenodd"},null,-1)])])):sA("",!0)],10,nd))),128))])])):sA("",!0),t.value?(T(),K("div",{key:1,class:"fixed inset-0 z-40",onClick:o})):sA("",!0)]))}},sd={class:"space-y-6"},ad={class:"text-xl font-semibold text-gray-900 mb-4"},Id={class:"text-gray-600 mb-6"},Cd={key:0},ld={key:1},Bd={key:2},Qd={key:0,class:"space-y-4"},cd={class:"bg-blue-50 border-2 border-blue-200 rounded-lg p-6"},Ed={class:"flex items-center justify-center space-x-3"},ud={class:"text-lg font-medium text-blue-900"},hd={class:"text-sm text-blue-700 mt-1"},fd={key:1,class:"space-y-4"},dd={class:"bg-green-50 border-2 border-green-200 rounded-lg p-4"},pd={class:"flex items-start justify-between mb-3"},md={class:"flex items-center"},yd={class:"text-lg font-medium text-green-900"},wd={class:"grid grid-cols-1 md:grid-cols-3 gap-4 mt-4"},Dd={class:"bg-white rounded-lg p-3"},kd={class:"block text-sm font-medium text-gray-700 mb-1"},vd={class:"text-base font-semibold text-gray-900"},Fd={class:"bg-white rounded-lg p-3"},Sd={class:"block text-sm font-medium text-gray-700 mb-1"},Rd={class:"text-base font-semibold text-gray-900"},bd={class:"bg-white rounded-lg p-3"},Nd={class:"block text-sm font-medium text-gray-700 mb-1"},Gd={class:"text-base font-semibold text-gray-900"},Ld={class:"mt-3 text-sm text-green-700"},Ud={class:"border border-gray-200 rounded-lg p-4"},Md={key:0,class:"mt-4"},xd={key:2,class:"space-y-4"},Jd={class:"bg-yellow-50 border border-yellow-200 rounded-lg p-4"},Td={class:"flex items-start"},Hd={class:"font-medium text-yellow-900"},Yd={class:"text-sm text-yellow-700 mt-1"},_d={class:"border-2 border-gray-300 rounded-lg p-4"},Kd={class:"text-lg font-medium text-gray-900 mb-4"},Od={class:"flex justify-end"},Pd=["disabled"],Vd={__name:"ChipConfig",props:{modelValue:{type:Object,default:()=>({model:"",display:{width:320,height:240,color:"RGB565"}})}},emits:["update:modelValue","next"],setup(A,{emit:e}){const{t}=ve(),i=e,n=hA(()=>[{value:"",label:t("chipConfig.selectChip")},{value:"esp32s3",label:"ESP32-S3"},{value:"esp32c3",label:"ESP32-C3"},{value:"esp32c5",label:"ESP32-C5"},{value:"esp32c6",label:"ESP32-C6"},{value:"esp32p4",label:"ESP32-P4"},{value:"esp32",label:"ESP32"},{value:"others",label:t("common.other")}]),o={name:"ConfigForm",props:{config:{type:Object,required:!0},showRequired:{type:Boolean,default:!1}},render(){const p=this.$t;return GA("div",{class:"grid grid-cols-1 md:grid-cols-3 gap-4"},[GA("div",[GA("label",{class:"block text-sm font-medium text-gray-700 mb-2"},[p("chipConfig.chipRequired")+" ",this.showRequired&&GA("span",{class:"text-red-500"},"*")]),GA("select",{class:"w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-primary-500",value:this.config.model,onChange:v=>{this.config.model=v.target.value}},BA(n).map(v=>GA("option",{value:v.value,key:v.value},v.label)))]),GA("div",[GA("label",{class:"block text-sm font-medium text-gray-700 mb-2"},[p("chipConfig.widthRequired")+" ",this.showRequired&&GA("span",{class:"text-red-500"},"*")]),GA("input",{type:"number",class:"w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-primary-500",value:this.config.display.width,min:128,max:800,placeholder:"320",onInput:v=>{this.config.display.width=Number(v.target.value)}})]),GA("div",[GA("label",{class:"block text-sm font-medium text-gray-700 mb-2"},[p("chipConfig.heightRequired")+" ",this.showRequired&&GA("span",{class:"text-red-500"},"*")]),GA("input",{type:"number",class:"w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-primary-500",value:this.config.display.height,min:128,max:600,placeholder:"240",onInput:v=>{this.config.display.height=Number(v.target.value)}})])])}},{deviceInfo:r,isDeviceOnline:g,hasToken:s}=No(),a=EA(s.value),I=EA(!1),l=EA(""),C=EA(!1),Q=EA({model:"",display:{width:320,height:240,color:"RGB565"}}),h={"ESP32-S3":"esp32s3",ESP32S3:"esp32s3","ESP32-C3":"esp32c3",ESP32C3:"esp32c3","ESP32-C5":"esp32c5",ESP32C5:"esp32c5","ESP32-P4":"esp32p4",ESP32P4:"esp32p4","ESP32-C6":"esp32c6",ESP32C6:"esp32c6",ESP32:"esp32"},f=()=>{var p,v;try{if(!g.value)return a.value||(l.value=t("chipConfig.deviceOffline"),I.value=!1),!1;const N=(p=r.value.chip)==null?void 0:p.model;if(!N||N==="未知")return!1;let G=h[N.toUpperCase()]||h[N]||N.toLowerCase().replace(/-/g,"");["esp32s3","esp32c3","esp32c5","esp32p4","esp32c6","esp32","others"].includes(G)||(G="others");const S=(v=r.value.screen)==null?void 0:v.resolution;if(!S||S==="未知")return!1;const[b,L]=S.split("x").map(Number);return!b||!L||isNaN(b)||isNaN(L)?(l.value=t("chipConfig.resolutionFormatError"),I.value=!1,a.value=!1,!1):(Q.value={model:G,display:{width:b,height:L,color:"RGB565"}},i("update:modelValue",{model:G,display:{width:b,height:L,color:"RGB565"}}),I.value=!0,l.value="",a.value=!1,console.log("✓ 设备配置加载成功:",{chip:G,width:b,height:L}),!0)}catch(N){return console.error("加载设备配置失败:",N),l.value=t("chipConfig.loadingError"),I.value=!1,a.value=!1,!1}},u=hA(()=>Q.value.model&&Q.value.display.width&&Q.value.display.height),E=hA(()=>Q.value.model?Q.value.model.toUpperCase().replace(/ESP32/i,"ESP32-"):""),D=hA(()=>Q.value.display),c=()=>{C.value=!C.value},d=()=>{u.value&&i("next")};return ae(()=>Q.value,p=>{i("update:modelValue",{model:p.model,display:{...p.display}})},{deep:!0}),ae(()=>g.value,p=>{p&&!I.value&&(a.value=!0,l.value="",setTimeout(()=>{f()},100))}),ae(()=>[r.value.chip,r.value.screen],()=>{g.value&&!I.value&&f()},{deep:!0}),Ft(()=>{if(!s.value){a.value=!1,l.value=t("chipConfig.manualConfigRequired"),console.log("⚠ 未检测到设备连接,使用手动配置模式");return}g.value&&r.value.chip&&r.value.chip.model!=="未知"&&r.value.screen&&r.value.screen.resolution!=="未知"?(console.log("✓ 检测到已缓存的设备信息,立即加载"),f()):g.value?(console.log("⏳ 设备在线,等待设备信息加载..."),a.value=!0,setTimeout(()=>{f()},500),setTimeout(()=>{a.value&&!I.value&&g.value&&(a.value=!1,!r.value.chip||r.value.chip.model==="未知"?l.value=t("chipConfig.chipModelError"):!r.value.screen||r.value.screen.resolution==="未知"?l.value=t("chipConfig.resolutionError"):l.value=t("chipConfig.timeoutError"),console.warn("⚠ 设备配置加载超时:",l.value))},1e4)):(console.log("⏳ 等待设备连接..."),a.value=!0,setTimeout(()=>{a.value&&!I.value&&!g.value&&(a.value=!1,l.value=t("chipConfig.manualConfigHint"),console.warn("⚠ 等待设备连接超时"))},1e4))}),(p,v)=>(T(),K("div",sd,[B("div",null,[B("h2",ad,F(p.$t("chipConfig.title")),1),B("p",Id,[a.value?(T(),K("span",Cd,F(p.$t("chipConfig.loadingFromDevice")),1)):I.value?(T(),K("span",ld,F(p.$t("chipConfig.loadedFromDevice")),1)):(T(),K("span",Bd,F(p.$t("chipConfig.manualConfig")),1))])]),a.value?(T(),K("div",Qd,[B("div",cd,[B("div",Ed,[v[0]||(v[0]=B("svg",{class:"animate-spin h-6 w-6 text-blue-600",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[B("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),B("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})],-1)),B("div",null,[B("h3",ud,F(p.$t("chipConfig.loadingTitle")),1),B("p",hd,F(p.$t("chipConfig.loadingDesc")),1)])])])])):BA(g)&&I.value?(T(),K("div",fd,[B("div",dd,[B("div",pd,[B("div",md,[v[1]||(v[1]=B("div",{class:"w-5 h-5 bg-green-500 rounded-full flex items-center justify-center mr-2"},[B("svg",{class:"w-3 h-3 text-white",fill:"currentColor",viewBox:"0 0 20 20"},[B("path",{"fill-rule":"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z","clip-rule":"evenodd"})])],-1)),B("h3",yd,F(p.$t("chipConfig.autoLoadedTitle")),1)])]),B("div",wd,[B("div",Dd,[B("label",kd,F(p.$t("chipConfig.chipModel")),1),B("div",vd,F(E.value),1)]),B("div",Fd,[B("label",Sd,F(p.$t("chipConfig.screenWidth")),1),B("div",Rd,F(D.value.width)+" px",1)]),B("div",bd,[B("label",Nd,F(p.$t("chipConfig.screenHeight")),1),B("div",Gd,F(D.value.height)+" px",1)])]),B("div",Ld," ✓ "+F(p.$t("chipConfig.colorFormat"))+" "+F(D.value.color),1)]),B("div",Ud,[B("button",{onClick:c,class:"flex items-center text-sm text-gray-600 hover:text-gray-900"},[v[2]||(v[2]=B("svg",{class:"w-4 h-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[B("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),B("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})],-1)),gt(" "+F(C.value?p.$t("chipConfig.collapseManual"):p.$t("chipConfig.manualEdit")),1)]),C.value?(T(),K("div",Md,[TA(o,{config:Q.value},null,8,["config"])])):sA("",!0)])])):(T(),K("div",xd,[B("div",Jd,[B("div",Td,[v[3]||(v[3]=B("svg",{class:"w-5 h-5 text-yellow-600 mr-3 flex-shrink-0 mt-0.5",fill:"currentColor",viewBox:"0 0 20 20"},[B("path",{"fill-rule":"evenodd",d:"M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z","clip-rule":"evenodd"})],-1)),B("div",null,[B("h4",Hd,F(p.$t("chipConfig.manualConfigDesc")),1),B("p",Yd,F(l.value||p.$t("chipConfig.manualConfigHint")),1)])])]),B("div",_d,[B("h3",Kd,F(p.$t("chipConfig.manualConfigTitle")),1),TA(o,{config:Q.value,"show-required":!0},null,8,["config"])])])),B("div",Od,[B("button",{onClick:d,disabled:!u.value,class:"bg-primary-500 hover:bg-primary-600 disabled:bg-gray-300 text-white px-6 py-2 rounded-lg font-medium transition-colors"},F(p.$t("chipConfig.next")),9,Pd)])]))}},Wd={class:"space-y-6"},qd={class:"text-lg font-medium text-gray-900 mb-2"},jd={class:"text-gray-600"},Zd={key:0,class:"bg-orange-50 border border-orange-200 rounded-lg p-4"},Xd={class:"text-sm text-orange-800"},zd={class:"mt-1"},$d={key:1,class:"space-y-6"},A0={class:"flex space-x-4"},e0={key:0,class:"space-y-4"},t0={class:"block text-sm font-medium text-gray-700"},i0={class:"relative"},n0=["value"],o0=["value"],r0={key:1,class:"space-y-4 bg-gray-50 p-4 rounded-lg border border-gray-200"},g0={class:"font-medium text-gray-900"},s0={class:"grid grid-cols-1 md:grid-cols-2 gap-4"},a0={class:"block text-sm font-medium text-gray-700 mb-1"},I0=["placeholder"],C0={key:0,class:"text-xs text-red-500 mt-1"},l0={class:"block text-sm font-medium text-gray-700 mb-1"},B0=["placeholder"],Q0={key:0,class:"text-xs text-red-500 mt-1"},c0={class:"grid grid-cols-1 md:grid-cols-3 gap-4"},E0={class:"block text-sm font-medium text-gray-700 mb-1"},u0={class:"flex items-center space-x-2"},h0={class:"text-sm text-gray-600 w-8"},f0={class:"text-xs text-gray-500 mt-1"},d0={class:"block text-sm font-medium text-gray-700 mb-1"},p0={key:0,class:"text-xs text-red-500 mt-1"},m0={class:"block text-sm font-medium text-gray-700 mb-1"},y0={value:"mn6_cn"},w0={value:"mn6_en"},D0={class:"bg-blue-50 border border-blue-200 rounded-lg p-3"},k0={class:"text-sm text-blue-800"},v0={class:"mt-1 list-disc list-inside space-y-1"},F0={key:0},S0={key:1},R0={key:2},b0={__name:"WakewordConfig",props:{modelValue:{type:Object,required:!0},chipModel:{type:String,required:!0}},emits:["update:modelValue"],setup(A,{emit:e}){const{t}=ve(),i=A,n=e,o=[{id:"wn9s_hilexin",name:"Hi,乐鑫",model:"WakeNet9s"},{id:"wn9s_hiesp",name:"Hi,ESP",model:"WakeNet9s"},{id:"wn9s_nihaoxiaozhi",name:"你好小智",model:"WakeNet9s"},{id:"wn9s_hijason",name:"Hi,Jason",model:"WakeNet9s"},{id:"wn9s_alexa",name:"Alexa",model:"WakeNet9s"},{id:"wn9_hilexin",name:"Hi,乐鑫",model:"WakeNet9"},{id:"wn9_hiesp",name:"Hi,ESP",model:"WakeNet9"},{id:"wn9_nihaoxiaozhi_tts",name:"你好小智",model:"WakeNet9"},{id:"wn9_hijason_tts2",name:"Hi,Jason",model:"WakeNet9"},{id:"wn9_nihaomiaoban_tts2",name:"你好喵伴",model:"WakeNet9"},{id:"wn9_xiaoaitongxue",name:"小爱同学",model:"WakeNet9"},{id:"wn9_himfive",name:"Hi,M Five",model:"WakeNet9"},{id:"wn9_alexa",name:"Alexa",model:"WakeNet9"},{id:"wn9_jarvis_tts",name:"Jarvis",model:"WakeNet9"},{id:"wn9_computer_tts",name:"Computer",model:"WakeNet9"},{id:"wn9_heywillow_tts",name:"Hey,Willow",model:"WakeNet9"},{id:"wn9_sophia_tts",name:"Sophia",model:"WakeNet9"},{id:"wn9_mycroft_tts",name:"Mycroft",model:"WakeNet9"},{id:"wn9_heyprinter_tts",name:"Hey,Printer",model:"WakeNet9"},{id:"wn9_hijoy_tts",name:"Hi,Joy",model:"WakeNet9"},{id:"wn9_heywanda_tts",name:"Hey,Wand",model:"WakeNet9"},{id:"wn9_astrolabe_tts",name:"Astrolabe",model:"WakeNet9"},{id:"wn9_heyily_tts2",name:"Hey,Ily",model:"WakeNet9"},{id:"wn9_hijolly_tts2",name:"Hi,Jolly",model:"WakeNet9"},{id:"wn9_hifairy_tts2",name:"Hi,Fairy",model:"WakeNet9"},{id:"wn9_bluechip_tts2",name:"Blue Chip",model:"WakeNet9"},{id:"wn9_hiandy_tts2",name:"Hi,Andy",model:"WakeNet9"},{id:"wn9_heyivy_tts2",name:"Hey,Ivy",model:"WakeNet9"},{id:"wn9_hiwalle_tts2",name:"Hi,Wall E",model:"WakeNet9"},{id:"wn9_nihaoxiaoxin_tts",name:"你好小鑫",model:"WakeNet9"},{id:"wn9_xiaomeitongxue_tts",name:"小美同学",model:"WakeNet9"},{id:"wn9_hixiaoxing_tts",name:"Hi,小星",model:"WakeNet9"},{id:"wn9_xiaolongxiaolong_tts",name:"小龙小龙",model:"WakeNet9"},{id:"wn9_miaomiaotongxue_tts",name:"喵喵同学",model:"WakeNet9"},{id:"wn9_himiaomiao_tts",name:"Hi,喵喵",model:"WakeNet9"},{id:"wn9_hilili_tts",name:"Hi,Lily",model:"WakeNet9"},{id:"wn9_hitelly_tts",name:"Hi,Telly",model:"WakeNet9"},{id:"wn9_xiaobinxiaobin_tts",name:"小滨小滨",model:"WakeNet9"},{id:"wn9_haixiaowu_tts",name:"Hi,小巫",model:"WakeNet9"},{id:"wn9_xiaoyaxiaoya_tts2",name:"小鸭小鸭",model:"WakeNet9"},{id:"wn9_linaiban_tts2",name:"璃奈板",model:"WakeNet9"},{id:"wn9_xiaosurou_tts2",name:"小酥肉",model:"WakeNet9"},{id:"wn9_xiaoyutongxue_tts2",name:"小宇同学",model:"WakeNet9"},{id:"wn9_xiaomingtongxue_tts2",name:"小明同学",model:"WakeNet9"},{id:"wn9_xiaokangtongxue_tts2",name:"小康同学",model:"WakeNet9"},{id:"wn9_xiaojianxiaojian_tts2",name:"小箭小箭",model:"WakeNet9"},{id:"wn9_xiaotexiaote_tts2",name:"小特小特",model:"WakeNet9"},{id:"wn9_nihaoxiaoyi_tts2",name:"你好小益",model:"WakeNet9"},{id:"wn9_nihaobaiying_tts2",name:"你好百应",model:"WakeNet9"},{id:"wn9_xiaoluxiaolu_tts2",name:"小鹿小鹿",model:"WakeNet9"},{id:"wn9_nihaodongdong_tts2",name:"你好东东",model:"WakeNet9"},{id:"wn9_nihaoxiaoan_tts2",name:"你好小安",model:"WakeNet9"},{id:"wn9_ni3hao3xiao3mai4_tts2",name:"你好小脉",model:"WakeNet9"},{id:"wn9_ni3hao3xiao3rui4_tts3",name:"你好小瑞",model:"WakeNet9"},{id:"wn9_hai1xiao3ou1_tts3",name:"嗨小欧",model:"WakeNet9"}],r=hA(()=>{const E=i.chipModel.toLowerCase();return E==="esp32s3"||E==="esp32p4"}),g=hA(()=>{const E=i.chipModel.toLowerCase();return E==="esp32c3"||E==="esp32c5"||E==="esp32c6"}),s=hA(()=>i.chipModel.toLowerCase()==="esp32s3"),a=hA(()=>r.value||g.value),I=hA(()=>r.value?o.filter(E=>E.model==="WakeNet9"):g.value?o.filter(E=>E.model==="WakeNet9s"):[]),l=EA({name:"",command:"",threshold:20,duration:3e3,model:"mn6_cn"}),C=EA({name:"",command:"",duration:""}),Q=()=>{let E=!0;return C.value={name:"",command:"",duration:""},l.value.name.trim()||(C.value.name=t("wakewordConfig.errors.nameRequired"),E=!1),l.value.command.trim()?l.value.model.includes("_en")&&/[!,.?]/.test(l.value.command)&&(C.value.command=t("wakewordConfig.errors.noPunctuation"),E=!1):(C.value.command=t("wakewordConfig.errors.commandRequired"),E=!1),(!l.value.duration||l.value.duration<500||l.value.duration>1e4)&&(C.value.duration=t("wakewordConfig.errors.durationRange"),E=!1),E},h=EA(!1),f=E=>{var D;n("update:modelValue",{...i.modelValue,type:E,preset:E==="preset"&&(i.modelValue.preset||((D=I.value[0])==null?void 0:D.id))||"",custom:{...i.modelValue.custom,...l.value}})},u=E=>{n("update:modelValue",{...i.modelValue,preset:E})};return ae(l,E=>{h.value||i.modelValue.type==="custom"&&(Q(),n("update:modelValue",{...i.modelValue,custom:{...E}}))},{deep:!0}),ae(()=>i.modelValue.custom,E=>{E&&(h.value=!0,l.value={name:E.name||"",command:E.command||"",threshold:E.threshold!==void 0?E.threshold:20,duration:E.duration!==void 0?E.duration:3e3,model:E.model||"mn6_cn"},hn(()=>{h.value=!1}))},{deep:!0,immediate:!0}),(E,D)=>(T(),K("div",Wd,[B("div",null,[B("h3",qd,F(E.$t("wakewordConfig.title")),1),B("p",jd,F(E.$t("wakewordConfig.description")),1)]),a.value?(T(),K("div",$d,[B("div",A0,[B("button",{onClick:D[0]||(D[0]=c=>f("none")),class:kA(["px-4 py-2 border rounded-lg transition-colors",A.modelValue.type==="none"?"border-primary-500 bg-primary-50 text-primary-700":"border-gray-300 hover:border-gray-400"])},F(E.$t("wakewordConfig.noWakeword")),3),B("button",{onClick:D[1]||(D[1]=c=>f("preset")),class:kA(["px-4 py-2 border rounded-lg transition-colors",A.modelValue.type==="preset"?"border-primary-500 bg-primary-50 text-primary-700":"border-gray-300 hover:border-gray-400"])},F(E.$t("wakewordConfig.presetWakeword")),3),s.value?(T(),K("button",{key:0,onClick:D[2]||(D[2]=c=>f("custom")),class:kA(["px-4 py-2 border rounded-lg transition-colors",A.modelValue.type==="custom"?"border-primary-500 bg-primary-50 text-primary-700":"border-gray-300 hover:border-gray-400"])},F(E.$t("wakewordConfig.customWakeword")),3)):sA("",!0)]),A.modelValue.type==="preset"?(T(),K("div",e0,[B("label",t0,F(E.$t("wakewordConfig.selectWakeword")),1),B("div",i0,[B("select",{value:A.modelValue.preset,onChange:D[3]||(D[3]=c=>u(c.target.value)),class:"w-full border border-gray-300 rounded-md px-3 py-2 pr-10 bg-white focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-primary-500"},[(T(!0),K(qA,null,Ke(I.value,c=>(T(),K("option",{key:c.id,value:c.id},F(c.name)+" ("+F(c.model)+") ",9,o0))),128))],40,n0)])])):sA("",!0),A.modelValue.type==="custom"?(T(),K("div",r0,[B("h4",g0,F(E.$t("wakewordConfig.customSettings")),1),B("div",s0,[B("div",null,[B("label",a0,[gt(F(E.$t("wakewordConfig.wakewordName"))+" ",1),D[9]||(D[9]=B("span",{class:"text-red-500"},"*",-1))]),ZA(B("input",{type:"text","onUpdate:modelValue":D[4]||(D[4]=c=>l.value.name=c),placeholder:E.$t("wakewordConfig.wakewordNamePlaceholder"),class:kA(["w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-primary-500",{"border-red-500":C.value.name}])},null,10,I0),[[te,l.value.name]]),C.value.name?(T(),K("p",C0,F(C.value.name),1)):sA("",!0)]),B("div",null,[B("label",l0,[gt(F(E.$t("wakewordConfig.wakewordCommand"))+" ",1),D[10]||(D[10]=B("span",{class:"text-red-500"},"*",-1))]),ZA(B("input",{type:"text","onUpdate:modelValue":D[5]||(D[5]=c=>l.value.command=c),placeholder:l.value.model.includes("_cn")?E.$t("wakewordConfig.wakewordCommandPlaceholderCN"):E.$t("wakewordConfig.wakewordCommandPlaceholderEN"),class:kA(["w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-primary-500",{"border-red-500":C.value.command}])},null,10,B0),[[te,l.value.command]]),C.value.command?(T(),K("p",Q0,F(C.value.command),1)):sA("",!0)])]),B("div",c0,[B("div",null,[B("label",E0,F(E.$t("wakewordConfig.threshold")),1),B("div",u0,[ZA(B("input",{type:"range","onUpdate:modelValue":D[6]||(D[6]=c=>l.value.threshold=c),min:"0",max:"100",step:"1",class:"flex-1"},null,512),[[te,l.value.threshold,void 0,{number:!0}]]),B("span",h0,F(l.value.threshold),1)]),B("p",f0,F(E.$t("wakewordConfig.thresholdDesc")),1)]),B("div",null,[B("label",d0,F(E.$t("wakewordConfig.duration"))+" (ms) ",1),ZA(B("input",{type:"number","onUpdate:modelValue":D[7]||(D[7]=c=>l.value.duration=c),min:"500",max:"10000",step:"100",class:kA(["w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-primary-500",{"border-red-500":C.value.duration}])},null,2),[[te,l.value.duration,void 0,{number:!0}]]),C.value.duration?(T(),K("p",p0,F(C.value.duration),1)):sA("",!0)]),B("div",null,[B("label",m0,F(E.$t("wakewordConfig.selectModel")),1),ZA(B("select",{"onUpdate:modelValue":D[8]||(D[8]=c=>l.value.model=c),class:"w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-primary-500"},[B("option",y0,F(E.$t("wakewordConfig.mn6cn")),1),B("option",w0,F(E.$t("wakewordConfig.mn6en")),1)],512),[[dr,l.value.model]])])])])):sA("",!0),B("div",D0,[B("div",k0,[B("strong",null,F(E.$t("wakewordConfig.tips.tipLabel")),1),B("ul",v0,[B("li",null,F(E.$t("wakewordConfig.tips.optional")),1),g.value?(T(),K("li",F0,F(E.$t("wakewordConfig.tips.wakeNet9sOnly")),1)):r.value?(T(),K("li",S0,F(E.$t("wakewordConfig.tips.wakeNet9Full")),1)):sA("",!0),s.value?(T(),K("li",R0,F(E.$t("wakewordConfig.tips.customSupport")),1)):sA("",!0)])])])])):(T(),K("div",Zd,[B("div",Xd,[B("strong",null,F(E.$t("wakewordConfig.notice")),1),B("p",zd,F(E.$t("wakewordConfig.unsupportedMessage",{chipModel:A.chipModel})),1)])]))]))}};class N0{constructor(){this.dbName="XiaozhiConfigDB",this.version=1,this.db=null,this.initialized=!1}async initialize(){if(!(this.initialized&&this.db))return new Promise((e,t)=>{const i=indexedDB.open(this.dbName,this.version);i.onerror=()=>{console.error("IndexedDB 初始化失败:",i.error),t(i.error)},i.onsuccess=()=>{this.db=i.result,this.initialized=!0,console.log("IndexedDB 初始化成功"),e()},i.onupgradeneeded=n=>{const o=n.target.result;if(o.objectStoreNames.contains("configs")||o.createObjectStore("configs",{keyPath:"key"}).createIndex("timestamp","timestamp",{unique:!1}),!o.objectStoreNames.contains("files")){const r=o.createObjectStore("files",{keyPath:"id"});r.createIndex("type","type",{unique:!1}),r.createIndex("timestamp","timestamp",{unique:!1})}if(!o.objectStoreNames.contains("temp_data")){const r=o.createObjectStore("temp_data",{keyPath:"key"});r.createIndex("type","type",{unique:!1}),r.createIndex("timestamp","timestamp",{unique:!1})}console.log("IndexedDB 表结构创建完成")}})}async saveConfig(e){this.initialized||await this.initialize();const i={key:"current_config",config:this.sanitizeConfigForStorage(e),timestamp:Date.now()};return new Promise((n,o)=>{const s=this.db.transaction(["configs"],"readwrite").objectStore("configs").put(i);s.onerror=()=>{console.error("保存配置失败:",s.error),o(s.error)},s.onsuccess=()=>{console.log("配置已保存到 IndexedDB"),n()}})}sanitizeConfigForStorage(e){var i,n,o,r,g,s,a,I,l,C;const t=JSON.parse(JSON.stringify(e||{}));try{if((n=(i=t==null?void 0:t.theme)==null?void 0:i.font)!=null&&n.custom&&(t.theme.font.custom.file=null),((r=(o=t==null?void 0:t.theme)==null?void 0:o.emoji)==null?void 0:r.type)==="custom"){t.theme.emoji.custom||(t.theme.emoji.custom={});const Q=((s=(g=t.theme.emoji)==null?void 0:g.custom)==null?void 0:s.images)||{},h={};if(Object.keys(Q).forEach(f=>{h[f]=null}),t.theme.emoji.custom.images=h,t.theme.emoji.custom.emotionMap,t.theme.emoji.custom.fileMap){const f=t.theme.emoji.custom.fileMap,u={};Object.keys(f).forEach(E=>{u[E]=null}),t.theme.emoji.custom.fileMap=u}}(I=(a=t==null?void 0:t.theme)==null?void 0:a.skin)!=null&&I.light&&(t.theme.skin.light.backgroundImage=null),(C=(l=t==null?void 0:t.theme)==null?void 0:l.skin)!=null&&C.dark&&(t.theme.skin.dark.backgroundImage=null)}catch{}return t}async loadConfig(){return this.initialized||await this.initialize(),new Promise((e,t)=>{const o=this.db.transaction(["configs"],"readonly").objectStore("configs").get("current_config");o.onerror=()=>{console.error("加载配置失败:",o.error),t(o.error)},o.onsuccess=()=>{const r=o.result;r?(console.log("从 IndexedDB 恢复配置成功"),e({config:r.config,timestamp:r.timestamp})):e(null)}})}async saveFile(e,t,i,n={}){this.initialized||await this.initialize();const o=await this.fileToArrayBuffer(t);let r={};try{r=n?JSON.parse(JSON.stringify(n)):{}}catch{r={...n}}const g={id:e,type:i,name:t.name,size:t.size,mimeType:t.type,lastModified:t.lastModified,data:o,metadata:r,timestamp:Date.now()};return new Promise((s,a)=>{const C=this.db.transaction(["files"],"readwrite").objectStore("files").put(g);C.onerror=()=>{console.error("保存文件失败:",C.error),a(C.error)},C.onsuccess=()=>{console.log(`文件 ${t.name} 已保存到 IndexedDB`),s()}})}async loadFile(e){return this.initialized||await this.initialize(),new Promise((t,i)=>{const r=this.db.transaction(["files"],"readonly").objectStore("files").get(e);r.onerror=()=>{console.error("加载文件失败:",r.error),i(r.error)},r.onsuccess=()=>{const g=r.result;if(g){const s=new Blob([g.data],{type:g.mimeType}),a=new File([s],g.name,{type:g.mimeType,lastModified:g.lastModified});a.storedId=g.id,a.storedType=g.type,a.storedMetadata=g.metadata,a.storedTimestamp=g.timestamp,console.log(`文件 ${g.name} 从 IndexedDB 恢复成功`),t(a)}else t(null)}})}async getFilesByType(e){return this.initialized||await this.initialize(),new Promise((t,i)=>{const g=this.db.transaction(["files"],"readonly").objectStore("files").index("type").getAll(e);g.onerror=()=>{console.error("获取文件列表失败:",g.error),i(g.error)},g.onsuccess=()=>{const a=(g.result||[]).map(I=>{const l=new Blob([I.data],{type:I.mimeType}),C=new File([l],I.name,{type:I.mimeType,lastModified:I.lastModified});return C.storedId=I.id,C.storedType=I.type,C.storedMetadata=I.metadata,C.storedTimestamp=I.timestamp,C});t(a)}})}async saveTempData(e,t,i,n={}){this.initialized||await this.initialize();const o={key:e,type:i,data:t,metadata:n,timestamp:Date.now()};return new Promise((r,g)=>{const I=this.db.transaction(["temp_data"],"readwrite").objectStore("temp_data").put(o);I.onerror=()=>{console.error("保存临时数据失败:",I.error),g(I.error)},I.onsuccess=()=>{console.log(`临时数据 ${e} 已保存`),r()}})}async loadTempData(e){return this.initialized||await this.initialize(),new Promise((t,i)=>{const r=this.db.transaction(["temp_data"],"readonly").objectStore("temp_data").get(e);r.onerror=()=>{console.error("加载临时数据失败:",r.error),i(r.error)},r.onsuccess=()=>{const g=r.result;t(g||null)}})}async clearAll(){this.initialized||await this.initialize();const e=["configs","files","temp_data"];return new Promise((t,i)=>{const n=this.db.transaction(e,"readwrite");let o=0,r=!1;const g=()=>{o++,o===e.length&&(r?i(new Error("清空部分数据时出现错误")):(console.log("所有存储数据已清空"),t()))};e.forEach(s=>{const I=n.objectStore(s).clear();I.onerror=()=>{console.error(`清空 ${s} 失败:`,I.error),r=!0,g()},I.onsuccess=()=>{console.log(`${s} 已清空`),g()}})})}async deleteFile(e){return this.initialized||await this.initialize(),new Promise((t,i)=>{const r=this.db.transaction(["files"],"readwrite").objectStore("files").delete(e);r.onerror=()=>{console.error("删除文件失败:",r.error),i(r.error)},r.onsuccess=()=>{console.log(`文件 ${e} 已删除`),t()}})}async getStorageInfo(){this.initialized||await this.initialize();const e=["configs","files","temp_data"],t={};for(const n of e){const o=await new Promise((r,g)=>{const I=this.db.transaction([n],"readonly").objectStore(n).count();I.onerror=()=>g(I.error),I.onsuccess=()=>r(I.result)});t[n]={count:o}}const i=await this.loadConfig();return t.lastSaved=i?new Date(i.timestamp):null,t}async hasStoredConfig(){try{return await this.loadConfig()!==null}catch(e){return console.error("检查存储配置时出错:",e),!1}}fileToArrayBuffer(e){return new Promise((t,i)=>{const n=new FileReader;n.onload=()=>t(n.result),n.onerror=()=>i(new Error("读取文件失败")),n.readAsArrayBuffer(e)})}close(){this.db&&(this.db.close(),this.db=null,this.initialized=!1,console.log("IndexedDB 连接已关闭"))}}const Qe=new N0;class Si{static async saveFontFile(e,t={}){if(e){const i="custom_font";try{await Qe.saveFile(i,e,"font",{size:t.size||20,bpp:t.bpp||4,charset:t.charset||"deepseek"}),console.log(`字体文件已保存: ${e.name}`)}catch(n){console.warn(`保存字体文件失败: ${e.name}`,n)}}}static async saveEmojiFile(e,t,i={}){var n,o;if(t&&e){const r=e.startsWith("hash_")?e:`emoji_${e}`;try{const g=((n=i==null?void 0:i.size)==null?void 0:n.width)??64,s=((o=i==null?void 0:i.size)==null?void 0:o.height)??64;await Qe.saveFile(r,t,"emoji",{name:e,size:{width:g,height:s},format:i==null?void 0:i.format,emotions:i==null?void 0:i.emotions}),console.log(`表情文件已保存: ${r} - ${t.name}`)}catch(g){console.warn(`保存表情文件失败: ${e}`,g)}}}static async saveBackgroundFile(e,t,i={}){if(t&&e){const n=`background_${e}`;try{let o={};try{o=i?JSON.parse(JSON.stringify(i)):{}}catch{o={...i}}await Qe.saveFile(n,t,"background",{mode:e,...o}),console.log(`背景文件已保存: ${e} - ${t.name}`)}catch(o){console.warn(`保存背景文件失败: ${e}`,o)}}}static async restoreFontFile(){try{return await Qe.loadFile("custom_font")}catch(e){return console.warn("恢复字体文件失败:",e),null}}static async restoreEmojiFile(e){if(!e)return null;try{const t=e.startsWith("hash_")?e:`emoji_${e}`;return await Qe.loadFile(t)}catch(t){return console.warn(`恢复表情文件失败: ${e}`,t),null}}static async restoreBackgroundFile(e){if(!e)return null;try{const t=`background_${e}`;return await Qe.loadFile(t)}catch(t){return console.warn(`恢复背景文件失败: ${e}`,t),null}}static async deleteFontFile(){try{await Qe.deleteFile("custom_font"),console.log("字体文件已删除")}catch(e){console.warn("删除字体文件失败:",e)}}static async deleteEmojiFile(e){if(e)try{const t=e.startsWith("hash_")?e:`emoji_${e}`;await Qe.deleteFile(t),console.log(`表情文件已删除: ${t}`)}catch(t){console.warn(`删除表情文件失败: ${e}`,t)}}static async deleteBackgroundFile(e){if(e)try{const t=`background_${e}`;await Qe.deleteFile(t),console.log(`背景文件已删除: ${e}`)}catch(t){console.warn(`删除背景文件失败: ${e}`,t)}}static async getStorageInfo(){try{return await Qe.getStorageInfo()}catch(e){return console.warn("获取存储信息失败:",e),{configs:{count:0},files:{count:0},temp_data:{count:0},lastSaved:null}}}static async clearAllFiles(){try{await Qe.clearAll(),console.log("所有存储文件已清理")}catch(e){throw console.warn("清理存储文件失败:",e),e}}}const G0={class:"space-y-6"},L0={class:"text-lg font-medium text-gray-900 mb-2"},U0={class:"text-gray-600"},M0={class:"space-y-4"},x0={class:"flex space-x-4"},J0={key:0,class:"space-y-4"},T0={class:"bg-gray-50 border border-gray-200 rounded-lg p-6 text-center"},H0={class:"mt-2 text-gray-600"},Y0={key:1,class:"space-y-4"},_0={class:"font-medium text-gray-900"},K0={class:"grid grid-cols-1 md:grid-cols-4 gap-4"},O0=["onClick"],P0={class:"flex items-start justify-between"},V0={class:"flex-1"},W0={class:"font-medium text-gray-900 mb-1"},q0={class:"text-sm text-gray-600 space-y-1"},j0={key:0,class:"flex-shrink-0 ml-3"},Z0={key:2,class:"space-y-6"},X0={class:"font-medium text-gray-900"},z0={class:"space-y-2"},$0={class:"block text-sm font-medium text-gray-700"},Ap={key:0},ep={class:"mt-2"},tp={class:"text-gray-500"},ip={class:"text-xs text-gray-400 mt-1"},np={key:1,class:"text-green-600"},op={class:"mt-1 font-medium"},rp={key:0,class:"grid grid-cols-1 md:grid-cols-3 gap-4"},gp={class:"block text-sm font-medium text-gray-700 mb-2"},sp={class:"text-xs text-gray-500 mt-1"},ap={class:"block text-sm font-medium text-gray-700 mb-2"},Ip={value:1},Cp={value:2},lp={value:4},Bp={class:"block text-sm font-medium text-gray-700 mb-2"},Qp={value:"qwen"},cp={value:"deepseek"},Ep={value:"gb2312"},up={value:"latin"},hp={value:"full"},fp={class:"flex items-center justify-between p-4 bg-gray-50 rounded-lg border border-gray-200"},dp={class:"flex-1"},pp={class:"font-medium text-gray-900"},mp={class:"text-sm text-gray-500 mt-1"},yp={class:"ml-4"},wp={class:"relative inline-flex items-center cursor-pointer"},Dp=["checked"],kp={__name:"FontConfig",props:{modelValue:{type:Object,required:!0}},emits:["update:modelValue"],setup(A,{emit:e}){const{t}=ve(),i=A,n=e,o=EA(null),r=[{id:"font_puhui_deepseek_14_1",size:14,bpp:1,fileSize:"~180KB"},{id:"font_puhui_deepseek_16_4",size:16,bpp:4,fileSize:"~720KB"},{id:"font_puhui_deepseek_20_4",size:20,bpp:4,fileSize:"~1.1MB"},{id:"font_puhui_deepseek_30_4",size:30,bpp:4,fileSize:"~2.5MB"},{id:"font_noto_qwen_14_1",size:14,bpp:1,fileSize:"~626KB"},{id:"font_noto_qwen_16_4",size:16,bpp:4,fileSize:"~2.0MB"},{id:"font_noto_qwen_20_4",size:20,bpp:4,fileSize:"~2.9MB"},{id:"font_noto_qwen_30_4",size:30,bpp:4,fileSize:"~5.8MB"}],g=hA(()=>r.map(u=>{let E;return u.id.startsWith("font_puhui_deepseek_")?E=t("fontConfig.charsetDeepseek"):u.id.startsWith("font_noto_qwen_")&&(E=t("fontConfig.charsetQwen")),{...u,name:t("fontConfig.presetFontNames."+u.id),charset:E}})),s=EA({size:20,bpp:4,charset:"qwen"}),a=u=>{n("update:modelValue",{...i.modelValue,type:u,preset:u==="preset"?i.modelValue.preset||"font_puhui_deepseek_20_4":"",custom:{...i.modelValue.custom,file:i.modelValue.custom.file||null}})},I=u=>{n("update:modelValue",{...i.modelValue,preset:u,custom:{...i.modelValue.custom,file:i.modelValue.custom.file||null}})},l=u=>{const E=u.target.files[0];E&&Q(E)},C=u=>{u.preventDefault();const E=u.dataTransfer.files;E.length>0&&Q(E[0])},Q=async u=>{u&&(u.type.includes("font")||u.name.toLowerCase().match(/\.(ttf|woff|woff2)$/))?(n("update:modelValue",{...i.modelValue,custom:{...i.modelValue.custom,file:u,...s.value}}),await Si.saveFontFile(u,s.value)):alert(t("fontConfig.selectValidFontFile"))},h=async()=>{n("update:modelValue",{...i.modelValue,custom:{...i.modelValue.custom,file:null}}),o.value&&(o.value.value=""),await Si.deleteFontFile()},f=EA(!1);return ae(()=>s.value,u=>{f.value||i.modelValue.type==="custom"&&i.modelValue.custom.file&&n("update:modelValue",{...i.modelValue,custom:{...i.modelValue.custom,...u}})},{deep:!0}),ae(()=>i.modelValue.custom,u=>{u.size&&u.bpp&&u.charset&&(f.value=!0,s.value={size:u.size,bpp:u.bpp,charset:u.charset},hn(()=>{f.value=!1}))},{deep:!0,immediate:!0}),(u,E)=>{var D;return T(),K("div",G0,[B("div",null,[B("h3",L0,F(u.$t("fontConfig.title")),1),B("p",U0,F(u.$t("fontConfig.description")),1)]),B("div",M0,[B("div",x0,[B("button",{onClick:E[0]||(E[0]=c=>a("none")),class:kA(["px-4 py-2 border rounded-lg transition-colors",A.modelValue.type==="none"?"border-primary-500 bg-primary-50 text-primary-700":"border-gray-300 hover:border-gray-400"])},F(u.$t("fontConfig.noFonts")),3),B("button",{onClick:E[1]||(E[1]=c=>a("preset")),class:kA(["px-4 py-2 border rounded-lg transition-colors",A.modelValue.type==="preset"?"border-primary-500 bg-primary-50 text-primary-700":"border-gray-300 hover:border-gray-400"])},F(u.$t("fontConfig.presetFonts")),3),B("button",{onClick:E[2]||(E[2]=c=>a("custom")),class:kA(["px-4 py-2 border rounded-lg transition-colors",A.modelValue.type==="custom"?"border-primary-500 bg-primary-50 text-primary-700":"border-gray-300 hover:border-gray-400"])},F(u.$t("fontConfig.customFonts")),3)])]),A.modelValue.type==="none"?(T(),K("div",J0,[B("div",T0,[E[10]||(E[10]=B("svg",{class:"mx-auto h-12 w-12 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[B("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)),B("p",H0,F(u.$t("fontConfig.noFontsDescription")),1)])])):sA("",!0),A.modelValue.type==="preset"?(T(),K("div",Y0,[B("h4",_0,F(u.$t("fontConfig.presetFonts")),1),B("div",K0,[(T(!0),K(qA,null,Ke(g.value,c=>(T(),K("div",{key:c.id,onClick:d=>I(c.id),class:kA(["border-2 rounded-lg p-4 cursor-pointer transition-all",A.modelValue.preset===c.id?"border-primary-500 bg-primary-50":"border-gray-200 hover:border-gray-300"])},[B("div",P0,[B("div",V0,[B("h5",W0,F(c.name),1),B("div",q0,[B("div",null,F(u.$t("fontConfig.fontSize"))+" "+F(c.size)+"px",1),B("div",null,F(u.$t("fontConfig.bitDepth"))+" "+F(c.bpp)+"bpp",1),B("div",null,F(u.$t("fontConfig.charset"))+" "+F(c.charset),1),B("div",null,F(u.$t("fontConfig.fileSize"))+" "+F(c.fileSize),1)])]),A.modelValue.preset===c.id?(T(),K("div",j0,[...E[11]||(E[11]=[B("div",{class:"w-5 h-5 bg-primary-500 rounded-full flex items-center justify-center"},[B("svg",{class:"w-3 h-3 text-white",fill:"currentColor",viewBox:"0 0 20 20"},[B("path",{"fill-rule":"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z","clip-rule":"evenodd"})])],-1)])])):sA("",!0)])],10,O0))),128))])])):sA("",!0),A.modelValue.type==="custom"?(T(),K("div",Z0,[B("h4",X0,F(u.$t("fontConfig.customFonts")),1),B("div",z0,[B("label",$0,F(u.$t("fontConfig.fontFile")),1),B("div",{onDrop:C,onDragover:E[4]||(E[4]=dt(()=>{},["prevent"])),onDragenter:E[5]||(E[5]=dt(()=>{},["prevent"])),class:"border-2 border-dashed border-gray-300 rounded-lg p-6 text-center hover:border-gray-400 transition-colors"},[B("input",{ref_key:"fileInput",ref:o,type:"file",accept:".ttf,.woff,.woff2",onChange:l,class:"hidden"},null,544),A.modelValue.custom.file?(T(),K("div",np,[E[13]||(E[13]=B("svg",{class:"mx-auto h-8 w-8",fill:"currentColor",viewBox:"0 0 20 20"},[B("path",{"fill-rule":"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z","clip-rule":"evenodd"})],-1)),B("p",op,F((D=A.modelValue.custom.file)==null?void 0:D.name),1),B("button",{onClick:h,class:"text-red-600 hover:text-red-500 text-sm mt-1"},F(u.$t("fontConfig.removeFile")),1)])):(T(),K("div",Ap,[E[12]||(E[12]=B("svg",{class:"mx-auto h-12 w-12 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[B("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12"})],-1)),B("div",ep,[B("button",{onClick:E[3]||(E[3]=c=>u.$refs.fileInput.click()),class:"text-primary-600 hover:text-primary-500 font-medium"},F(u.$t("fontConfig.clickSelectFontFile")),1),B("p",tp,F(u.$t("fontConfig.orDragFileHere")),1)]),B("p",ip,F(u.$t("fontConfig.supportedFormats")),1)]))],32)]),A.modelValue.custom.file?(T(),K("div",rp,[B("div",null,[B("label",gp,F(u.$t("fontConfig.fontSizePx")),1),ZA(B("input",{type:"number","onUpdate:modelValue":E[6]||(E[6]=c=>s.value.size=c),min:"8",max:"80",class:"w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-primary-500"},null,512),[[te,s.value.size,void 0,{number:!0}]]),B("p",sp,F(u.$t("fontConfig.range"))+" 8-80px",1)]),B("div",null,[B("label",ap,F(u.$t("fontConfig.bitDepthBpp")),1),ZA(B("select",{"onUpdate:modelValue":E[7]||(E[7]=c=>s.value.bpp=c),class:"w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-primary-500"},[B("option",Ip,F(u.$t("fontConfig.monochrome")),1),B("option",Cp,F(u.$t("fontConfig.fourColors")),1),B("option",lp,F(u.$t("fontConfig.sixteenColors")),1)],512),[[dr,s.value.bpp]])]),B("div",null,[B("label",Bp,F(u.$t("fontConfig.characterSet")),1),ZA(B("select",{"onUpdate:modelValue":E[8]||(E[8]=c=>s.value.charset=c),class:"w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-primary-500"},[B("option",Qp,F(u.$t("fontConfig.qwen18409")),1),B("option",cp,F(u.$t("fontConfig.deepseekR1")),1),B("option",Ep,F(u.$t("fontConfig.gb2312")),1),B("option",up,F(u.$t("fontConfig.latin1")),1),B("option",hp,F(u.$t("fontConfig.fullCharset")),1)],512),[[dr,s.value.charset]])])])):sA("",!0)])):sA("",!0),B("div",fp,[B("div",dp,[B("h4",pp,F(u.$t("fontConfig.hideSubtitle")),1),B("p",mp,F(u.$t("fontConfig.hideSubtitleDescription")),1)]),B("div",yp,[B("label",wp,[B("input",{type:"checkbox",checked:A.modelValue.hide_subtitle,onChange:E[9]||(E[9]=c=>n("update:modelValue",{...A.modelValue,hide_subtitle:c.target.checked})),class:"sr-only peer"},null,40,Dp),E[14]||(E[14]=B("div",{class:"w-11 h-6 bg-gray-200 peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-primary-300 rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-primary-500"},null,-1))])])])])}}},vp={class:"space-y-6"},Fp={class:"text-lg font-medium text-gray-900 mb-2"},Sp={class:"text-gray-600"},Rp={class:"space-y-4"},bp={class:"flex flex-wrap gap-3"},Np={key:0,class:"text-sm text-gray-500"},Gp={key:0,class:"space-y-4"},Lp={class:"font-medium text-gray-900"},Up={class:"grid grid-cols-1 md:grid-cols-2 gap-6"},Mp=["onClick"],xp={class:"flex items-start justify-between mb-3"},Jp={class:"font-medium text-gray-900"},Tp={class:"text-sm text-gray-600"},Hp={class:"text-xs text-gray-500 mt-1"},Yp={key:0,class:"flex-shrink-0 ml-3"},_p={class:"grid grid-cols-7 gap-1 justify-items-center"},Kp=["src","alt"],Op={key:1,class:"space-y-6"},Pp={class:"font-medium text-gray-900"},Vp={class:"grid grid-cols-1 md:grid-cols-2 gap-4"},Wp={class:"block text-sm font-medium text-gray-700 mb-2"},qp={class:"block text-sm font-medium text-gray-700 mb-2"},jp={class:"space-y-4"},Zp={class:"font-medium text-gray-900"},Xp={class:"grid grid-cols-2 md:grid-cols-4 lg:grid-cols-7 gap-4"},zp={class:"text-center"},$p={class:"text-lg mb-1"},Am={class:"text-xs text-gray-600 flex items-center justify-center gap-1"},em={key:0,class:"text-red-500"},tm=["onDrop"],im=["onChange"],nm=["onClick"],om={class:"text-xs text-gray-500"},rm={key:1,class:"w-full h-full relative"},gm=["src","alt"],sm=["onClick"],am={class:"text-xs text-gray-500 mt-2"},Im={__name:"EmojiConfig",props:{modelValue:{type:Object,required:!0}},emits:["update:modelValue"],setup(A,{emit:e}){const{t}=ve(),i=A,n=e,o=async c=>{const d=await c.arrayBuffer();try{if(typeof window<"u"&&window.crypto&&window.crypto.subtle){const p=await window.crypto.subtle.digest("SHA-256",d);return Array.from(new Uint8Array(p)).map(G=>G.toString(16).padStart(2,"0")).join("")}else return r(d)}catch(p){return console.warn("Web Crypto API 不可用,使用降级哈希方案:",p),r(d)}},r=c=>{const d=new Uint8Array(c);let p=0;for(let _=0;_[{key:"neutral",name:t("emojiConfig.emotions.neutral"),emoji:"😶"},{key:"happy",name:t("emojiConfig.emotions.happy"),emoji:"🙂"},{key:"laughing",name:t("emojiConfig.emotions.laughing"),emoji:"😆"},{key:"funny",name:t("emojiConfig.emotions.funny"),emoji:"😂"},{key:"sad",name:t("emojiConfig.emotions.sad"),emoji:"😔"},{key:"angry",name:t("emojiConfig.emotions.angry"),emoji:"😠"},{key:"crying",name:t("emojiConfig.emotions.crying"),emoji:"😭"},{key:"loving",name:t("emojiConfig.emotions.loving"),emoji:"😍"},{key:"embarrassed",name:t("emojiConfig.emotions.embarrassed"),emoji:"😳"},{key:"surprised",name:t("emojiConfig.emotions.surprised"),emoji:"😯"},{key:"shocked",name:t("emojiConfig.emotions.shocked"),emoji:"😱"},{key:"thinking",name:t("emojiConfig.emotions.thinking"),emoji:"🤔"},{key:"winking",name:t("emojiConfig.emotions.winking"),emoji:"😉"},{key:"cool",name:t("emojiConfig.emotions.cool"),emoji:"😎"},{key:"relaxed",name:t("emojiConfig.emotions.relaxed"),emoji:"😌"},{key:"delicious",name:t("emojiConfig.emotions.delicious"),emoji:"🤤"},{key:"kissy",name:t("emojiConfig.emotions.kissy"),emoji:"😘"},{key:"confident",name:t("emojiConfig.emotions.confident"),emoji:"😏"},{key:"sleepy",name:t("emojiConfig.emotions.sleepy"),emoji:"😴"},{key:"silly",name:t("emojiConfig.emotions.silly"),emoji:"😜"},{key:"confused",name:t("emojiConfig.emotions.confused"),emoji:"🙄"}]),a=EA({size:{width:32,height:32}}),I=c=>{if(i.modelValue.type===c)return;const d={...i.modelValue,type:c};c==="none"?(d.preset="",d.custom={...i.modelValue.custom,images:i.modelValue.custom.images||{}}):c==="preset"?(d.preset=i.modelValue.preset||"twemoji32",d.custom={...i.modelValue.custom,images:i.modelValue.custom.images||{}}):c==="custom"&&(d.preset="",d.custom={...i.modelValue.custom,images:i.modelValue.custom.images||{}}),n("update:modelValue",d)},l=c=>{i.modelValue.preset!==c&&n("update:modelValue",{...i.modelValue,preset:c,custom:{...i.modelValue.custom,images:i.modelValue.custom.images||{}}})},C=(c,d)=>{const p=c.target.files[0];p&&h(d,p)},Q=(c,d)=>{c.preventDefault();const p=c.dataTransfer.files;p.length>0&&h(d,p[0])},h=async(c,d)=>{const p=["png","gif"],v=d.name.split(".").pop().toLowerCase();if(!p.includes(v)){alert(t("emojiConfig.selectValidFormat"));return}const N=await o(d),G=i.modelValue.custom||{},_={...G.fileMap||{}},S={...G.emotionMap||{}},b={...G.images||{}};let L=[];for(const[QA,dA]of Object.entries(S))dA===N&&QA!==c&&L.push(QA);L.length>0&&console.log(t("emojiConfig.sharedFileMessage",{emotionKey:c,existingEmotions:L.join(", ")})),_[N]=d,S[c]=N,b[c]=d,n("update:modelValue",{...i.modelValue,custom:{...G,size:a.value.size,images:b,fileMap:_,emotionMap:S}}),await Si.saveEmojiFile(`hash_${N}`,d,{size:a.value.size,format:v,emotions:[...L,c]})},f=async c=>{const d=i.modelValue.custom||{},p={...d.images},v={...d.emotionMap||{}},N={...d.fileMap||{}},G=v[c];delete p[c],delete v[c],Object.values(v).filter(S=>S===G).length===0&&G?(delete N[G],await Si.deleteEmojiFile(`hash_${G}`),console.log(t("emojiConfig.fileDeleted",{fileHash:G}))):console.log(t("emojiConfig.fileRetained",{fileHash:G})),n("update:modelValue",{...i.modelValue,custom:{...d,images:p,emotionMap:v,fileMap:N}})},u=(c,d)=>`./static/twemoji${c==="twemoji64"?"64":"32"}/${d}.png`,E=c=>{if(i.modelValue.type==="preset")return u(i.modelValue.preset,c);{const d=i.modelValue.custom.images[c];return d instanceof File||d instanceof Blob?URL.createObjectURL(d):null}},D=c=>{console.warn(t("emojiConfig.imageLoadFailed"),c.target.src),c.target.style.display="none"};return ae(()=>a.value.size,c=>{if(i.modelValue.type==="custom"){const d=i.modelValue.custom;JSON.stringify(d.size)!==JSON.stringify(c)&&n("update:modelValue",{...i.modelValue,custom:{...d,size:c}})}},{deep:!0}),i.modelValue.custom.size&&(a.value={size:{...i.modelValue.custom.size}}),(c,d)=>(T(),K("div",vp,[B("div",null,[B("h3",Fp,F(c.$t("emojiConfig.title")),1),B("p",Sp,F(c.$t("emojiConfig.description")),1)]),B("div",Rp,[B("div",bp,[B("button",{onClick:d[0]||(d[0]=p=>I("none")),class:kA(["px-4 py-2 border rounded-lg transition-colors",A.modelValue.type==="none"?"border-primary-500 bg-primary-50 text-primary-700":"border-gray-300 hover:border-gray-400"])},F(c.$t("emojiConfig.noEmojiPack")),3),B("button",{onClick:d[1]||(d[1]=p=>I("preset")),class:kA(["px-4 py-2 border rounded-lg transition-colors",A.modelValue.type==="preset"?"border-primary-500 bg-primary-50 text-primary-700":"border-gray-300 hover:border-gray-400"])},F(c.$t("emojiConfig.presetEmojiPack")),3),B("button",{onClick:d[2]||(d[2]=p=>I("custom")),class:kA(["px-4 py-2 border rounded-lg transition-colors",A.modelValue.type==="custom"?"border-primary-500 bg-primary-50 text-primary-700":"border-gray-300 hover:border-gray-400"])},F(c.$t("emojiConfig.customEmojiPack")),3)]),A.modelValue.type==="none"?(T(),K("p",Np,F(c.$t("emojiConfig.noEmojiPackDescription")),1)):sA("",!0)]),A.modelValue.type==="preset"?(T(),K("div",Gp,[B("h4",Lp,F(c.$t("emojiConfig.selectPresetEmojiPack")),1),B("div",Up,[(T(),K(qA,null,Ke(g,p=>B("div",{key:p.id,onClick:v=>l(p.id),class:kA(["border-2 rounded-lg p-4 cursor-pointer transition-all",A.modelValue.preset===p.id?"border-primary-500 bg-primary-50":"border-gray-200 hover:border-gray-300"])},[B("div",xp,[B("div",null,[B("h5",Jp,F(p.name),1),B("p",Tp,F(p.description),1),B("div",Hp,F(c.$t("emojiConfig.size"))+": "+F(p.size)+"px × "+F(p.size)+"px ",1)]),A.modelValue.preset===p.id?(T(),K("div",Yp,[...d[7]||(d[7]=[B("div",{class:"w-5 h-5 bg-primary-500 rounded-full flex items-center justify-center"},[B("svg",{class:"w-3 h-3 text-white",fill:"currentColor",viewBox:"0 0 20 20"},[B("path",{"fill-rule":"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z","clip-rule":"evenodd"})])],-1)])])):sA("",!0)]),B("div",_p,[(T(!0),K(qA,null,Ke(p.preview,v=>(T(),K("div",{key:v,style:VA({width:p.size+"px",height:p.size+"px"}),class:"bg-gray-100 rounded flex items-center justify-center"},[B("img",{src:u(p.id,v),alt:v,style:VA({width:p.size+"px",height:p.size+"px"}),class:"object-contain rounded",onError:D},null,44,Kp)],4))),128))])],10,Mp)),64))])])):sA("",!0),A.modelValue.type==="custom"?(T(),K("div",Op,[B("h4",Pp,F(c.$t("emojiConfig.customEmojiPackConfig")),1),B("div",Vp,[B("div",null,[B("label",Wp,F(c.$t("emojiConfig.maxImageWidth")),1),ZA(B("input",{type:"number","onUpdate:modelValue":d[3]||(d[3]=p=>a.value.size.width=p),min:"16",max:"200",class:"w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-primary-500"},null,512),[[te,a.value.size.width,void 0,{number:!0}]])]),B("div",null,[B("label",qp,F(c.$t("emojiConfig.maxImageHeight")),1),ZA(B("input",{type:"number","onUpdate:modelValue":d[4]||(d[4]=p=>a.value.size.height=p),min:"16",max:"200",class:"w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-primary-500"},null,512),[[te,a.value.size.height,void 0,{number:!0}]])])]),B("div",jp,[B("h5",Zp,F(c.$t("emojiConfig.uploadEmojiImages")),1),B("div",Xp,[(T(!0),K(qA,null,Ke(s.value,p=>(T(),K("div",{key:p.key,class:"space-y-2"},[B("div",zp,[B("div",$p,F(p.emoji),1),B("div",Am,[B("span",null,F(p.name),1),p.key==="neutral"?(T(),K("span",em,F(c.$t("emojiConfig.required")),1)):sA("",!0)])]),B("div",{onDrop:v=>Q(v,p.key),onDragover:d[5]||(d[5]=dt(()=>{},["prevent"])),onDragenter:d[6]||(d[6]=dt(()=>{},["prevent"])),class:kA(["border-2 border-dashed rounded-lg p-2 text-center cursor-pointer transition-colors aspect-square flex flex-col items-center justify-center",A.modelValue.custom.images[p.key]?"border-green-300 bg-green-50":p.key==="neutral"?"border-red-300 bg-red-50":"border-gray-300 hover:border-gray-400"])},[B("input",{ref_for:!0,ref:p.key+"Input",type:"file",accept:".png,.gif",onChange:v=>C(v,p.key),class:"hidden"},null,40,im),A.modelValue.custom.images[p.key]?(T(),K("div",rm,[E(p.key)?(T(),K("img",{key:0,src:E(p.key),alt:p.name,class:"w-full h-full object-cover rounded",onError:D},null,40,gm)):sA("",!0),B("button",{onClick:v=>f(p.key),class:"absolute -top-1 -right-1 w-4 h-4 bg-red-500 text-white rounded-full flex items-center justify-center text-xs hover:bg-red-600"}," × ",8,sm)])):(T(),K("div",{key:0,onClick:v=>{var N;return(N=c.$refs[p.key+"Input"][0])==null?void 0:N.click()}},[d[8]||(d[8]=B("svg",{class:"w-6 h-6 text-gray-400 mx-auto mb-1",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[B("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 6v6m0 0v6m0-6h6m-6 0H6"})],-1)),B("div",om,F(c.$t("emojiConfig.clickToUploadOrDrag")),1)],8,nm))],42,tm)]))),128))]),B("div",am,F(c.$t("emojiConfig.neutralRequiredNotice")),1)])])):sA("",!0)]))}},Cm={class:"space-y-6"},lm={class:"text-lg font-medium text-gray-900 mb-2"},Bm={class:"text-gray-600"},Qm={class:"space-y-4"},cm={class:"font-medium text-gray-900 flex items-center"},Em={class:"border border-gray-200 rounded-lg p-4 space-y-4"},um={class:"flex space-x-4"},hm={key:0,class:"space-y-3"},fm={class:"flex items-center space-x-3"},dm={class:"text-sm font-medium text-gray-700"},pm={class:"flex items-center space-x-2"},mm={class:"flex items-center space-x-3"},ym={class:"text-sm font-medium text-gray-700"},wm={class:"flex items-center space-x-2"},Dm={key:1,class:"space-y-3"},km={class:"text-sm font-medium text-gray-700"},vm={class:"mt-1 text-sm text-gray-600"},Fm={key:1,class:"space-y-2"},Sm=["src"],Rm={class:"text-sm text-green-700 font-medium"},bm={class:"flex items-center space-x-3"},Nm={class:"text-sm font-medium text-gray-700"},Gm={class:"flex items-center space-x-2"},Lm={class:"space-y-4"},Um={class:"font-medium text-gray-900 flex items-center"},Mm={class:"border border-gray-200 rounded-lg p-4 space-y-4"},xm={class:"flex space-x-4"},Jm={key:0,class:"space-y-3"},Tm={class:"flex items-center space-x-3"},Hm={class:"text-sm font-medium text-gray-700"},Ym={class:"flex items-center space-x-2"},_m={class:"flex items-center space-x-3"},Km={class:"text-sm font-medium text-gray-700"},Om={class:"flex items-center space-x-2"},Pm={key:1,class:"space-y-3"},Vm={class:"text-sm font-medium text-gray-700"},Wm={class:"mt-1 text-sm text-gray-600"},qm={key:1,class:"space-y-2"},jm=["src"],Zm={class:"text-sm text-green-700 font-medium"},Xm={class:"flex items-center space-x-3"},zm={class:"text-sm font-medium text-gray-700"},$m={class:"flex items-center space-x-2"},Ay={class:"space-y-4"},ey={class:"font-medium text-gray-900"},ty={class:"grid grid-cols-1 md:grid-cols-2 gap-4"},iy={class:"space-y-2"},ny={class:"text-sm font-medium text-gray-700"},oy={class:"absolute inset-0 bg-white bg-opacity-10 flex items-center justify-center rounded-lg"},ry={class:"space-y-2"},gy={class:"text-sm font-medium text-gray-700"},sy={class:"absolute inset-0 bg-black bg-opacity-10 flex items-center justify-center rounded-lg"},ay={class:"bg-blue-50 border border-blue-200 rounded-lg p-4"},Iy={class:"font-medium text-blue-900 mb-2"},Cy={class:"flex flex-wrap gap-2"},ly={__name:"BackgroundConfig",props:{modelValue:{type:Object,required:!0}},emits:["update:modelValue"],setup(A,{emit:e}){const{t}=ve(),i=A,n=e,o=EA(null),r=EA(null),g=hA({get:()=>i.modelValue.light.backgroundColor,set:S=>Q(S)}),s=hA({get:()=>i.modelValue.dark.backgroundColor,set:S=>h(S)}),a=hA({get:()=>i.modelValue.light.textColor,set:S=>f(S)}),I=hA({get:()=>i.modelValue.dark.textColor,set:S=>u(S)}),l=S=>{n("update:modelValue",{...i.modelValue,light:{...i.modelValue.light,backgroundType:S,backgroundImage:S==="image"?i.modelValue.light.backgroundImage:null}})},C=S=>{n("update:modelValue",{...i.modelValue,dark:{...i.modelValue.dark,backgroundType:S,backgroundImage:S==="image"?i.modelValue.dark.backgroundImage:null}})},Q=S=>{n("update:modelValue",{...i.modelValue,light:{...i.modelValue.light,backgroundColor:S}})},h=S=>{n("update:modelValue",{...i.modelValue,dark:{...i.modelValue.dark,backgroundColor:S}})},f=S=>{n("update:modelValue",{...i.modelValue,light:{...i.modelValue.light,textColor:S}})},u=S=>{n("update:modelValue",{...i.modelValue,dark:{...i.modelValue.dark,textColor:S}})},E=(S,b)=>{const L=S.target.files[0];L&&c(b,L)},D=(S,b)=>{S.preventDefault();const L=S.dataTransfer.files;L.length>0&&c(b,L[0])},c=async(S,b)=>{b&&b.type.startsWith("image/")?(n("update:modelValue",{...i.modelValue,[S]:{...i.modelValue[S],backgroundImage:b}}),await Si.saveBackgroundFile(S,b)):alert(t("backgroundConfig.selectValidImage"))},d=async S=>{n("update:modelValue",{...i.modelValue,[S]:{...i.modelValue[S],backgroundImage:null}}),S==="light"&&o.value&&(o.value.value=""),S==="dark"&&r.value&&(r.value.value=""),await Si.deleteBackgroundFile(S)},p=S=>{const b=i.modelValue[S].backgroundImage;return b?URL.createObjectURL(b):null},v=()=>i.modelValue.light.backgroundType==="image"&&i.modelValue.light.backgroundImage?{backgroundImage:`url(${p("light")})`,backgroundSize:"cover",backgroundPosition:"center"}:{backgroundColor:i.modelValue.light.backgroundColor},N=()=>i.modelValue.dark.backgroundType==="image"&&i.modelValue.dark.backgroundImage?{backgroundImage:`url(${p("dark")})`,backgroundSize:"cover",backgroundPosition:"center"}:{backgroundColor:i.modelValue.dark.backgroundColor},G=(S,b)=>{const L=_(S)?"#000000":"#ffffff",QA=_(b)?"#000000":"#ffffff";n("update:modelValue",{...i.modelValue,light:{...i.modelValue.light,backgroundType:"color",backgroundColor:S,textColor:L,backgroundImage:null},dark:{...i.modelValue.dark,backgroundType:"color",backgroundColor:b,textColor:QA,backgroundImage:null}})},_=S=>{const b=S.replace("#",""),L=parseInt(b.substr(0,2),16),QA=parseInt(b.substr(2,2),16),dA=parseInt(b.substr(4,2),16);return(L*299+QA*587+dA*114)/1e3>128};return(S,b)=>(T(),K("div",Cm,[B("div",null,[B("h3",lm,F(S.$t("backgroundConfig.title")),1),B("p",Bm,F(S.$t("backgroundConfig.description")),1)]),B("div",Qm,[B("h4",cm,[b[33]||(b[33]=B("svg",{class:"w-5 h-5 mr-2 text-yellow-500",fill:"currentColor",viewBox:"0 0 20 20"},[B("path",{"fill-rule":"evenodd",d:"M10 2a1 1 0 011 1v1a1 1 0 11-2 0V3a1 1 0 011-1zm4 8a4 4 0 11-8 0 4 4 0 018 0zm-.464 4.95l.707.707a1 1 0 001.414-1.414l-.707-.707a1 1 0 00-1.414 1.414zm2.12-10.607a1 1 0 010 1.414l-.706.707a1 1 0 11-1.414-1.414l.707-.707a1 1 0 011.414 0zM17 11a1 1 0 100-2h-1a1 1 0 100 2h1zm-7 4a1 1 0 011 1v1a1 1 0 11-2 0v-1a1 1 0 011-1zM5.05 6.464A1 1 0 106.465 5.05l-.708-.707a1 1 0 00-1.414 1.414l.707.707zm1.414 8.486l-.707.707a1 1 0 01-1.414-1.414l.707-.707a1 1 0 011.414 1.414zM4 11a1 1 0 100-2H3a1 1 0 000 2h1z","clip-rule":"evenodd"})],-1)),gt(" "+F(S.$t("backgroundConfig.lightMode")),1)]),B("div",Em,[B("div",um,[B("button",{onClick:b[0]||(b[0]=L=>l("color")),class:kA(["px-3 py-2 text-sm border rounded transition-colors",A.modelValue.light.backgroundType==="color"?"border-primary-500 bg-primary-50 text-primary-700":"border-gray-300 hover:border-gray-400"])},F(S.$t("backgroundConfig.solidBackground")),3),B("button",{onClick:b[1]||(b[1]=L=>l("image")),class:kA(["px-3 py-2 text-sm border rounded transition-colors",A.modelValue.light.backgroundType==="image"?"border-primary-500 bg-primary-50 text-primary-700":"border-gray-300 hover:border-gray-400"])},F(S.$t("backgroundConfig.imageBackground")),3)]),A.modelValue.light.backgroundType==="color"?(T(),K("div",hm,[B("div",fm,[B("label",dm,F(S.$t("backgroundConfig.backgroundColor")),1),B("div",pm,[ZA(B("input",{type:"color","onUpdate:modelValue":b[2]||(b[2]=L=>g.value=L),class:"w-10 h-10 border border-gray-300 rounded cursor-pointer"},null,512),[[te,g.value]]),ZA(B("input",{type:"text","onUpdate:modelValue":b[3]||(b[3]=L=>g.value=L),class:"border border-gray-300 rounded px-3 py-2 text-sm font-mono w-24"},null,512),[[te,g.value]])]),B("div",{style:VA({backgroundColor:g.value}),class:"w-16 h-10 border border-gray-300 rounded shadow-inner"},null,4)]),B("div",mm,[B("label",ym,F(S.$t("backgroundConfig.textColor")),1),B("div",wm,[ZA(B("input",{type:"color","onUpdate:modelValue":b[4]||(b[4]=L=>a.value=L),class:"w-10 h-10 border border-gray-300 rounded cursor-pointer"},null,512),[[te,a.value]]),ZA(B("input",{type:"text","onUpdate:modelValue":b[5]||(b[5]=L=>a.value=L),class:"border border-gray-300 rounded px-3 py-2 text-sm font-mono w-24"},null,512),[[te,a.value]])]),B("div",{style:VA({backgroundColor:a.value}),class:"w-16 h-10 border border-gray-300 rounded shadow-inner"},null,4)])])):sA("",!0),A.modelValue.light.backgroundType==="image"?(T(),K("div",Dm,[B("label",km,F(S.$t("backgroundConfig.backgroundImage")),1),B("div",{onDrop:b[9]||(b[9]=L=>D(L,"light")),onDragover:b[10]||(b[10]=dt(()=>{},["prevent"])),onDragenter:b[11]||(b[11]=dt(()=>{},["prevent"])),class:kA(["border-2 border-dashed rounded-lg p-4 text-center cursor-pointer transition-colors",A.modelValue.light.backgroundImage?"border-green-300 bg-green-50":"border-gray-300 hover:border-gray-400"])},[B("input",{ref_key:"lightImageInput",ref:o,type:"file",accept:"image/*",onChange:b[6]||(b[6]=L=>E(L,"light")),class:"hidden"},null,544),A.modelValue.light.backgroundImage?(T(),K("div",Fm,[B("img",{src:p("light"),alt:"{{ $t('backgroundConfig.lightModePreview') }}背景",class:"max-w-32 max-h-32 mx-auto rounded shadow"},null,8,Sm),B("p",Rm,F(A.modelValue.light.backgroundImage.name),1),B("button",{onClick:b[8]||(b[8]=L=>d("light")),class:"text-red-600 hover:text-red-500 text-sm"},F(S.$t("backgroundConfig.removeImage")),1)])):(T(),K("div",{key:0,onClick:b[7]||(b[7]=L=>S.$refs.lightImageInput.click())},[b[34]||(b[34]=B("svg",{class:"mx-auto h-8 w-8 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[B("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})],-1)),B("p",vm,F(S.$t("backgroundConfig.clickOrDragToUpload")),1)]))],34),B("div",bm,[B("label",Nm,F(S.$t("backgroundConfig.textColor")),1),B("div",Gm,[ZA(B("input",{type:"color","onUpdate:modelValue":b[12]||(b[12]=L=>a.value=L),class:"w-10 h-10 border border-gray-300 rounded cursor-pointer"},null,512),[[te,a.value]]),ZA(B("input",{type:"text","onUpdate:modelValue":b[13]||(b[13]=L=>a.value=L),class:"border border-gray-300 rounded px-3 py-2 text-sm font-mono w-24"},null,512),[[te,a.value]])]),B("div",{style:VA({backgroundColor:a.value}),class:"w-16 h-10 border border-gray-300 rounded shadow-inner"},null,4)])])):sA("",!0)])]),B("div",Lm,[B("h4",Um,[b[35]||(b[35]=B("svg",{class:"w-5 h-5 mr-2 text-gray-600",fill:"currentColor",viewBox:"0 0 20 20"},[B("path",{d:"M17.293 13.293A8 8 0 016.707 2.707a8.001 8.001 0 1010.586 10.586z"})],-1)),gt(" "+F(S.$t("backgroundConfig.darkMode")),1)]),B("div",Mm,[B("div",xm,[B("button",{onClick:b[14]||(b[14]=L=>C("color")),class:kA(["px-3 py-2 text-sm border rounded transition-colors",A.modelValue.dark.backgroundType==="color"?"border-primary-500 bg-primary-50 text-primary-700":"border-gray-300 hover:border-gray-400"])},F(S.$t("backgroundConfig.solidBackground")),3),B("button",{onClick:b[15]||(b[15]=L=>C("image")),class:kA(["px-3 py-2 text-sm border rounded transition-colors",A.modelValue.dark.backgroundType==="image"?"border-primary-500 bg-primary-50 text-primary-700":"border-gray-300 hover:border-gray-400"])},F(S.$t("backgroundConfig.imageBackground")),3)]),A.modelValue.dark.backgroundType==="color"?(T(),K("div",Jm,[B("div",Tm,[B("label",Hm,F(S.$t("backgroundConfig.backgroundColor")),1),B("div",Ym,[ZA(B("input",{type:"color","onUpdate:modelValue":b[16]||(b[16]=L=>s.value=L),class:"w-10 h-10 border border-gray-300 rounded cursor-pointer"},null,512),[[te,s.value]]),ZA(B("input",{type:"text","onUpdate:modelValue":b[17]||(b[17]=L=>s.value=L),class:"border border-gray-300 rounded px-3 py-2 text-sm font-mono w-24"},null,512),[[te,s.value]])]),B("div",{style:VA({backgroundColor:s.value}),class:"w-16 h-10 border border-gray-300 rounded shadow-inner"},null,4)]),B("div",_m,[B("label",Km,F(S.$t("backgroundConfig.textColor")),1),B("div",Om,[ZA(B("input",{type:"color","onUpdate:modelValue":b[18]||(b[18]=L=>I.value=L),class:"w-10 h-10 border border-gray-300 rounded cursor-pointer"},null,512),[[te,I.value]]),ZA(B("input",{type:"text","onUpdate:modelValue":b[19]||(b[19]=L=>I.value=L),class:"border border-gray-300 rounded px-3 py-2 text-sm font-mono w-24"},null,512),[[te,I.value]])]),B("div",{style:VA({backgroundColor:I.value}),class:"w-16 h-10 border border-gray-300 rounded shadow-inner"},null,4)])])):sA("",!0),A.modelValue.dark.backgroundType==="image"?(T(),K("div",Pm,[B("label",Vm,F(S.$t("backgroundConfig.backgroundImage")),1),B("div",{onDrop:b[23]||(b[23]=L=>D(L,"dark")),onDragover:b[24]||(b[24]=dt(()=>{},["prevent"])),onDragenter:b[25]||(b[25]=dt(()=>{},["prevent"])),class:kA(["border-2 border-dashed rounded-lg p-4 text-center cursor-pointer transition-colors",A.modelValue.dark.backgroundImage?"border-green-300 bg-green-50":"border-gray-300 hover:border-gray-400"])},[B("input",{ref_key:"darkImageInput",ref:r,type:"file",accept:"image/*",onChange:b[20]||(b[20]=L=>E(L,"dark")),class:"hidden"},null,544),A.modelValue.dark.backgroundImage?(T(),K("div",qm,[B("img",{src:p("dark"),alt:"{{ $t('backgroundConfig.darkModePreview') }}背景",class:"max-w-32 max-h-32 mx-auto rounded shadow"},null,8,jm),B("p",Zm,F(A.modelValue.dark.backgroundImage.name),1),B("button",{onClick:b[22]||(b[22]=L=>d("dark")),class:"text-red-600 hover:text-red-500 text-sm"},F(S.$t("backgroundConfig.removeImage")),1)])):(T(),K("div",{key:0,onClick:b[21]||(b[21]=L=>S.$refs.darkImageInput.click())},[b[36]||(b[36]=B("svg",{class:"mx-auto h-8 w-8 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[B("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})],-1)),B("p",Wm,F(S.$t("backgroundConfig.clickOrDragToUpload")),1)]))],34),B("div",Xm,[B("label",zm,F(S.$t("backgroundConfig.textColor")),1),B("div",$m,[ZA(B("input",{type:"color","onUpdate:modelValue":b[26]||(b[26]=L=>I.value=L),class:"w-10 h-10 border border-gray-300 rounded cursor-pointer"},null,512),[[te,I.value]]),ZA(B("input",{type:"text","onUpdate:modelValue":b[27]||(b[27]=L=>I.value=L),class:"border border-gray-300 rounded px-3 py-2 text-sm font-mono w-24"},null,512),[[te,I.value]])]),B("div",{style:VA({backgroundColor:I.value}),class:"w-16 h-10 border border-gray-300 rounded shadow-inner"},null,4)])])):sA("",!0)])]),B("div",Ay,[B("h4",ey,F(S.$t("backgroundConfig.backgroundPreview")),1),B("div",ty,[B("div",iy,[B("div",ny,F(S.$t("backgroundConfig.lightModePreview")),1),B("div",{style:VA(v()),class:"h-32 border border-gray-300 rounded-lg flex items-center justify-center text-sm relative overflow-hidden"},[B("div",oy,[B("span",{style:VA({color:A.modelValue.light.textColor})},F(S.$t("backgroundConfig.chatArea")),5)])],4)]),B("div",ry,[B("div",gy,F(S.$t("backgroundConfig.darkModePreview")),1),B("div",{style:VA(N()),class:"h-32 border border-gray-300 rounded-lg flex items-center justify-center text-sm relative overflow-hidden"},[B("div",sy,[B("span",{style:VA({color:A.modelValue.dark.textColor})},F(S.$t("backgroundConfig.chatArea")),5)])],4)])])]),B("div",ay,[B("h5",Iy,F(S.$t("backgroundConfig.quickConfig")),1),B("div",Cy,[B("button",{onClick:b[28]||(b[28]=L=>G("#ffffff","#1f2937")),class:"px-3 py-1 text-sm bg-white border border-gray-300 rounded hover:bg-gray-50"},F(S.$t("backgroundConfig.defaultColors")),1),B("button",{onClick:b[29]||(b[29]=L=>G("#f5f5f4","#374151")),class:"px-3 py-1 text-sm bg-stone-100 border border-gray-300 rounded hover:bg-stone-200"},F(S.$t("backgroundConfig.stoneTexture")),1),B("button",{onClick:b[30]||(b[30]=L=>G("#fef7cd","#7c2d12")),class:"px-3 py-1 text-sm bg-yellow-100 border border-gray-300 rounded hover:bg-yellow-200"},F(S.$t("backgroundConfig.sunnyColors")),1),B("button",{onClick:b[31]||(b[31]=L=>G("#e0f2fe","#1e40af")),class:"px-3 py-1 text-sm bg-sky-100 border border-gray-300 rounded hover:bg-sky-200"},F(S.$t("backgroundConfig.skyBlue")),1),B("button",{onClick:b[32]||(b[32]=L=>G("#fdf2f8","#be185d")),class:"px-3 py-1 text-sm bg-pink-100 border border-gray-300 rounded hover:bg-pink-200"},F(S.$t("backgroundConfig.romanticPink")),1)])])]))}},By={class:"space-y-6"},Qy={class:"text-xl font-semibold text-gray-900 mb-4"},cy={class:"text-gray-600 mb-6"},Ey={class:"border-b border-gray-200"},uy={class:"-mb-px flex space-x-4 sm:space-x-8"},hy=["onClick"],fy={class:"flex items-center"},dy={class:"hidden sm:inline"},py={class:"min-h-96"},my={class:"flex justify-between"},yy={__name:"ThemeDesign",props:{modelValue:{type:Object,required:!0},chipModel:{type:String,required:!0},activeTab:{type:String,default:"wakeword"}},emits:["update:modelValue","next","prev","tabChange"],setup(A,{emit:e}){const{t}=ve(),i={render(){return GA("svg",{fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[GA("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 11a7 7 0 01-7 7m0 0a7 7 0 01-7-7m7 7v4m0 0H8m4 0h4m-4-8a3 3 0 01-3-3V5a3 3 0 116 0v6a3 3 0 01-3 3z"})])}},n={render(){return GA("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 640 640"},[GA("path",{d:"M320 96C329.5 96 338 101.5 341.9 110.2L515.1 496L536 496C549.3 496 560 506.7 560 520C560 533.3 549.3 544 536 544L440 544C426.7 544 416 533.3 416 520C416 506.7 426.7 496 440 496L462.5 496L426.6 416L213.4 416L177.5 496L200 496C213.3 496 224 506.7 224 520C224 533.3 213.3 544 200 544L104 544C90.7 544 80 533.3 80 520C80 506.7 90.7 496 104 496L124.9 496L298.1 110.2C302 101.5 310.5 96 320 96zM320 178.6L235 368L405 368L320 178.6z"})])}},o={render(){return GA("svg",{fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[GA("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M14.828 14.828a4 4 0 01-5.656 0M9 10h.01M15 10h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})])}},r={render(){return GA("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 640 640"},[GA("path",{d:"M160 144C151.2 144 144 151.2 144 160L144 480C144 488.8 151.2 496 160 496L480 496C488.8 496 496 488.8 496 480L496 160C496 151.2 488.8 144 480 144L160 144zM96 160C96 124.7 124.7 96 160 96L480 96C515.3 96 544 124.7 544 160L544 480C544 515.3 515.3 544 480 544L160 544C124.7 544 96 515.3 96 480L96 160zM224 192C241.7 192 256 206.3 256 224C256 241.7 241.7 256 224 256C206.3 256 192 241.7 192 224C192 206.3 206.3 192 224 192zM360 264C368.5 264 376.4 268.5 380.7 275.8L460.7 411.8C465.1 419.2 465.1 428.4 460.8 435.9C456.5 443.4 448.6 448 440 448L200 448C191.1 448 182.8 443 178.7 435.1C174.6 427.2 175.2 417.6 180.3 410.3L236.3 330.3C240.8 323.9 248.1 320.1 256 320.1C263.9 320.1 271.2 323.9 275.7 330.3L292.9 354.9L339.4 275.9C343.7 268.6 351.6 264.1 360.1 264.1z"})])}},g=A,s=e,a=EA(g.activeTab),I=hA(()=>[{id:"wakeword",name:t("themeDesign.tabs.wakeword"),icon:i},{id:"font",name:t("themeDesign.tabs.font"),icon:n},{id:"emoji",name:t("themeDesign.tabs.emoji"),icon:o},{id:"background",name:t("themeDesign.tabs.background"),icon:r}]),l=hA({get:()=>g.modelValue,set:h=>s("update:modelValue",h)}),C=()=>{var u,E,D;const h=g.modelValue.wakeword;if(h.type==="custom"){if(!((u=h.custom.name)!=null&&u.trim())){alert(t("wakewordConfig.errors.nameRequired"));return}if(!((E=h.custom.command)!=null&&E.trim())){alert(t("wakewordConfig.errors.commandRequired"));return}if(!h.custom.duration||h.custom.duration<500||h.custom.duration>1e4){alert(t("wakewordConfig.errors.durationRange"));return}}const f=g.modelValue.font;if(f.type==="custom"&&!((D=f.custom)!=null&&D.file)){alert(t("fontConfig.selectValidFontFile"));return}s("next")},Q=h=>{a.value=h,s("tabChange",h)};return ae(()=>g.activeTab,h=>{a.value=h}),(h,f)=>(T(),K("div",By,[B("div",null,[B("h2",Qy,F(h.$t("themeDesign.title")),1),B("p",cy,F(h.$t("themeDesign.description")),1)]),B("div",Ey,[B("nav",uy,[(T(!0),K(qA,null,Ke(I.value,u=>(T(),K("button",{key:u.id,onClick:E=>Q(u.id),class:kA(["py-2 px-1 border-b-2 font-medium text-sm relative",a.value===u.id?"border-primary-500 text-primary-600":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300"])},[B("span",fy,[(T(),ye(HI(u.icon),{class:"w-5 h-5 sm:mr-2"})),B("span",dy,F(u.name),1)])],10,hy))),128))])]),B("div",py,[a.value==="wakeword"?(T(),ye(b0,{key:0,modelValue:l.value.wakeword,"onUpdate:modelValue":f[0]||(f[0]=u=>l.value.wakeword=u),chipModel:A.chipModel},null,8,["modelValue","chipModel"])):sA("",!0),a.value==="font"?(T(),ye(kp,{key:1,modelValue:l.value.font,"onUpdate:modelValue":f[1]||(f[1]=u=>l.value.font=u)},null,8,["modelValue"])):sA("",!0),a.value==="emoji"?(T(),ye(Im,{key:2,modelValue:l.value.emoji,"onUpdate:modelValue":f[2]||(f[2]=u=>l.value.emoji=u)},null,8,["modelValue"])):sA("",!0),a.value==="background"?(T(),ye(ly,{key:3,modelValue:l.value.skin,"onUpdate:modelValue":f[3]||(f[3]=u=>l.value.skin=u)},null,8,["modelValue"])):sA("",!0)]),B("div",my,[B("button",{onClick:f[4]||(f[4]=u=>h.$emit("prev")),class:"bg-gray-500 hover:bg-gray-600 text-white px-6 py-2 rounded-lg font-medium transition-colors"},F(h.$t("themeDesign.previous")),1),B("button",{onClick:C,class:"bg-primary-500 hover:bg-primary-600 text-white px-6 py-2 rounded-lg font-medium transition-colors"},F(h.$t("themeDesign.next")),1)])]))}},wy=(A,e)=>{const t=A.__vccOpts||A;for(const[i,n]of e)t[i]=n;return t},Dy={class:"space-y-6"},ky={class:"text-xl font-semibold text-gray-900 mb-4"},vy={class:"text-gray-600 mb-6"},Fy={class:"flex flex-col lg:flex-row gap-8"},Sy={class:"flex-1"},Ry={class:"text-lg font-medium text-gray-900 mb-4"},by={class:"bg-gray-100 p-4 rounded-lg"},Ny={class:"max-w-full overflow-auto flex justify-center"},Gy={class:"bg-gray-800 p-6 rounded-2xl shadow-2xl inline-block"},Ly={class:"bg-gray-900 p-2 rounded-xl"},Uy={class:"relative z-10 flex flex-col items-center justify-center p-4 text-center"},My={class:"mb-4"},xy={key:0,class:"emoji-container"},Jy=["src","alt"],Ty={key:1,class:"emoji-container"},Hy={class:"text-center"},Yy={class:"text-sm"},_y={class:"text-xs"},Ky={key:0,class:"absolute inset-0 flex items-center justify-center"},Oy={class:"animate-pulse text-gray-400 text-xs"},Py={class:"mt-3 text-center text-xs text-gray-400"},Vy={class:"w-full lg:w-80"},Wy={class:"text-lg font-medium text-gray-900 mb-4"},qy={class:"space-y-6 bg-white border border-gray-200 rounded-lg p-4"},jy={class:"block text-sm font-medium text-gray-700 mb-2"},Zy={class:"block text-sm font-medium text-gray-700 mb-2"},Xy={key:0,class:"flex flex-wrap gap-2 max-h-32 overflow-y-auto justify-center"},zy=["onClick","title"],$y={key:0},Aw=["src","alt"],ew={key:1,class:"text-lg"},tw={key:1,class:"text-center py-4 text-gray-500 bg-gray-50 rounded-lg border-2 border-dashed"},iw={class:"text-2xl mb-2"},nw={class:"text-sm"},ow={class:"block text-sm font-medium text-gray-700 mb-2"},rw={class:"flex space-x-2"},gw={class:"border-t pt-4"},sw={class:"font-medium text-gray-900 mb-2"},aw={class:"text-xs text-gray-600 space-y-1"},Iw={key:0},Cw={class:"flex items-center"},lw={key:0,class:"ml-2 animate-pulse text-blue-500"},Bw={key:1},Qw={class:"flex justify-between"},cw={__name:"GenerateSummary",props:{config:{type:Object,required:!0}},emits:["prev","generate"],setup(A){const{t:e}=ve(),t=A,i=EA(e("generateSummary.defaultPreviewText")),n=EA("happy"),o=EA("light"),r=EA(!1),g=EA(""),s=hA(()=>[{key:"neutral",name:e("generateSummary.emotions.neutral"),emoji:"😶"},{key:"happy",name:e("generateSummary.emotions.happy"),emoji:"🙂"},{key:"laughing",name:e("generateSummary.emotions.laughing"),emoji:"😆"},{key:"funny",name:e("generateSummary.emotions.funny"),emoji:"😂"},{key:"sad",name:e("generateSummary.emotions.sad"),emoji:"😔"},{key:"angry",name:e("generateSummary.emotions.angry"),emoji:"😠"},{key:"crying",name:e("generateSummary.emotions.crying"),emoji:"😭"},{key:"loving",name:e("generateSummary.emotions.loving"),emoji:"😍"},{key:"surprised",name:e("generateSummary.emotions.surprised"),emoji:"😯"},{key:"thinking",name:e("generateSummary.emotions.thinking"),emoji:"🤔"},{key:"cool",name:e("generateSummary.emotions.cool"),emoji:"😎"},{key:"sleepy",name:e("generateSummary.emotions.sleepy"),emoji:"😴"}]),a=hA(()=>{if(t.config.theme.emoji.type==="preset"&&t.config.theme.emoji.preset)return s.value;if(t.config.theme.emoji.type==="custom"){const S=t.config.theme.emoji.custom.images;return s.value.filter(b=>S[b.key])}else return[]}),I=hA(()=>E(n.value)),l=()=>{const{width:S,height:b}=t.config.chip.display;return{width:`${S}px`,height:`${b}px`}},C=()=>{const S=t.config.theme.skin[o.value];if(S.backgroundType==="image"&&S.backgroundImage)try{if(S.backgroundImage&&typeof S.backgroundImage=="object"&&S.backgroundImage.size)return{backgroundImage:`url(${URL.createObjectURL(S.backgroundImage)})`,backgroundSize:"cover",backgroundPosition:"center"}}catch(b){console.warn("背景图片预览加载失败:",b)}return{backgroundColor:S.backgroundColor||"#ffffff"}},Q=()=>{let S=48;return t.config.theme.emoji.type==="preset"?S=t.config.theme.emoji.preset==="twemoji64"?64:32:t.config.theme.emoji.custom.size&&(S=Math.min(t.config.theme.emoji.custom.size.width,t.config.theme.emoji.custom.size.height)),{width:`${S}px`,height:`${S}px`}},h=()=>{let S=14;if(t.config.theme.font.type==="preset"){const L=t.config.theme.font.preset;L.includes("_14_")?S=14:L.includes("_16_")?S=16:L.includes("_20_")?S=20:L.includes("_30_")&&(S=30)}else t.config.theme.font.custom.size&&(S=t.config.theme.font.custom.size);const b=o.value==="dark"?t.config.theme.skin.dark.textColor:t.config.theme.skin.light.textColor;return{fontSize:`${S}px`,color:b,fontFamily:u(),textShadow:o.value==="dark"?"1px 1px 2px rgba(0,0,0,0.5)":"1px 1px 2px rgba(255,255,255,0.5)"}},f=async()=>{document.querySelectorAll("style[data-font-preview]").forEach(b=>b.remove()),r.value=!1,g.value="";try{if(t.config.theme.font.type==="preset"){const b=t.config.theme.font.preset;let L,QA;b&&b.startsWith("font_noto_qwen_")?(L="NotoPreview",QA="./static/fonts/noto_qwen.ttf"):(L="PuHuiPreview",QA="./static/fonts/puhui_deepseek.ttf");const dA=document.createElement("style");dA.setAttribute("data-font-preview","true"),dA.textContent=` @font-face { font-family: '${L}'; - src: url('${EA}') format('truetype'); + src: url('${QA}') format('truetype'); font-display: swap; } - `,document.head.appendChild(dA),await document.fonts.load(`16px "${L}"`),g.value=L,r.value=!0}else if(t.config.theme.font.custom.file)try{const b=t.config.theme.font.custom.file;if(!b||typeof b!="object"||!b.size)throw new Error("字体文件对象无效");const L="CustomFontPreview",EA=URL.createObjectURL(b),dA=document.createElement("style");dA.setAttribute("data-font-preview","true"),dA.textContent=` + `,document.head.appendChild(dA),await document.fonts.load(`16px "${L}"`),g.value=L,r.value=!0}else if(t.config.theme.font.custom.file)try{const b=t.config.theme.font.custom.file;if(!b||typeof b!="object"||!b.size)throw new Error("字体文件对象无效");const L="CustomFontPreview",QA=URL.createObjectURL(b),dA=document.createElement("style");dA.setAttribute("data-font-preview","true"),dA.textContent=` @font-face { font-family: '${L}'; - src: url('${EA}'); + src: url('${QA}'); font-display: swap; } - `,document.head.appendChild(dA),await document.fonts.load(`16px "${L}"`),g.value=L,r.value=!0}catch(b){console.warn("自定义字体预览加载失败:",b),g.value="Arial, sans-serif",r.value=!0}else g.value="system-ui",r.value=!0}catch(b){console.warn("Font loading failed:",b),g.value="system-ui",r.value=!0}},u=()=>r.value&&g.value?`"${g.value}", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif`:'"PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif',E=R=>{if(t.config.theme.emoji.type==="preset")return`./static/twemoji${t.config.theme.emoji.preset==="twemoji64"?"64":"32"}/${R}.png`;if(t.config.theme.emoji.type==="custom"&&t.config.theme.emoji.custom.images[R])try{const b=t.config.theme.emoji.custom.images[R];if(b&&typeof b=="object"&&b.size)return URL.createObjectURL(b)}catch(b){console.warn(`表情图片预览加载失败 (${R}):`,b)}return null},m=R=>{const b=s.value.find(L=>L.key===R);return b?b.emoji:"😶"},c=()=>{if(t.config.theme.emoji.type==="preset")return(t.config.theme.emoji.preset==="twemoji64"?64:32)+16;if(t.config.theme.emoji.custom.size){const R=Math.min(t.config.theme.emoji.custom.size.width,t.config.theme.emoji.custom.size.height);return Math.min(R+16,64)}return 48},d=()=>t.config.theme.emoji.type==="preset"?t.config.theme.emoji.preset==="twemoji64"?64:32:t.config.theme.emoji.custom.size?Math.min(t.config.theme.emoji.custom.size.width,t.config.theme.emoji.custom.size.height,48):32,w=R=>{n.value=R},F=()=>{const R=t.config.theme.wakeword;return!R||R.type==="none"?e("wakewordConfig.noWakeword"):R.type==="preset"?{wn9s_hilexin:"Hi,乐鑫",wn9s_hiesp:"Hi,ESP",wn9s_nihaoxiaozhi:"你好小智",wn9_nihaoxiaozhi_tts:"你好小智",wn9_alexa:"Alexa",wn9_jarvis_tts:"Jarvis"}[R.preset]||R.preset:R.type==="custom"?R.custom.name||e("wakewordConfig.customWakeword"):e("wakewordConfig.noWakeword")},N=()=>{if(t.config.theme.font.type==="preset")return e("fontConfig.presetFontNames."+t.config.theme.font.preset)||t.config.theme.font.preset;{const R=t.config.theme.font.custom;return e("generateSummary.customFont",{size:R.size})}},G=()=>{if(t.config.theme.emoji.type==="preset"&&t.config.theme.emoji.preset)return t.config.theme.emoji.preset==="twemoji64"?"Twemoji 64×64":"Twemoji 32×32";if(t.config.theme.emoji.type==="custom"){const R=Object.keys(t.config.theme.emoji.custom.images).length;return e("generateSummary.customEmoji",{count:R})}else return t.config.theme.emoji.type==="none"?e("emojiConfig.noEmojiPack"):e("generateSummary.notConfigured")},K=()=>{const R=t.config.theme.skin.light.backgroundType==="image"?e("generateSummary.image"):e("generateSummary.color"),b=t.config.theme.skin.dark.backgroundType==="image"?e("generateSummary.image"):e("generateSummary.color");return e("generateSummary.skinLight",{type:R})+"/"+e("generateSummary.skinDark",{type:b})};return ae(()=>t.config.theme.font,()=>{f()},{deep:!0}),Ft(async()=>{a.value.length>0?n.value=a.value[0].key:n.value="",await f()}),Ii(()=>{document.querySelectorAll("style[data-font-preview]").forEach(b=>b.remove())}),(R,b)=>(T(),_("div",Dy,[B("div",null,[B("h2",ky,v(R.$t("generateSummary.title")),1),B("p",vy,v(R.$t("generateSummary.description")),1)]),B("div",Fy,[B("div",Sy,[B("h3",Ry,v(R.$t("generateSummary.devicePreview")),1),B("div",by,[B("div",Ny,[B("div",Gy,[B("div",Ly,[B("div",{style:VA(l()),class:"relative rounded-lg overflow-hidden border-2 border-gray-700 flex flex-col items-center justify-center"},[B("div",{style:VA(C()),class:"absolute inset-0"},null,4),B("div",Uy,[B("div",My,[n.value&&a.value.length>0?(T(),_("div",xy,[I.value?(T(),_("img",{key:0,src:I.value,alt:n.value,style:VA(Q()),class:"emoji-image"},null,12,Jy)):(T(),_("div",{key:1,style:VA(Q()),class:"emoji-fallback bg-gray-200 rounded-full flex items-center justify-center text-2xl"},v(m(n.value)),5))])):(T(),_("div",Ty,[B("div",{style:VA(Q()),class:"emoji-placeholder flex items-center justify-center text-gray-400 border-2 border-dashed border-gray-300 rounded bg-gray-50"},[B("div",Hy,[B("div",Yy,v(A.config.theme.emoji.type==="none"?"📦":"😕"),1),B("div",_y,v(A.config.theme.emoji.type==="none"?R.$t("emojiConfig.noEmojiPack"):R.$t("generateSummary.noEmotionConfigured")),1)])],4)]))]),A.config.theme.font.hide_subtitle?sA("",!0):(T(),_("div",{key:0,style:VA(h()),class:"text-message max-w-full break-words relative"},[r.value?sA("",!0):(T(),_("div",Ky,[B("div",Oy,v(R.$t("generateSummary.fontLoading")),1)])),B("div",{class:kA({"opacity-0":!r.value})},v(i.value),3)],4))])],4)]),B("div",Py,v(A.config.chip.display.width)+" × "+v(A.config.chip.display.height)+" "+v(A.config.chip.model.toUpperCase()),1)])])])]),B("div",Vy,[B("h3",Wy,v(R.$t("generateSummary.previewSettings")),1),B("div",qy,[B("div",null,[B("label",jy,v(R.$t("generateSummary.previewText")),1),ZA(B("textarea",{"onUpdate:modelValue":b[0]||(b[0]=L=>i.value=L),class:"w-full border border-gray-300 rounded-md px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-primary-500",rows:"3",placeholder:"Hi, I'm your friend Xiaozhi!"},null,512),[[te,i.value]])]),B("div",null,[B("label",Zy,v(R.$t("generateSummary.currentEmotion")),1),a.value.length>0?(T(),_("div",Xy,[(T(!0),_(qA,null,Ke(a.value,L=>(T(),_("button",{key:L.key,onClick:EA=>w(L.key),class:kA(["p-2 border rounded transition-colors flex items-center justify-center",n.value===L.key?"border-primary-500 bg-primary-50":"border-gray-200 hover:border-gray-300"]),title:L.name,style:VA({width:c()+"px",height:c()+"px"})},[E(L.key)?(T(),_("div",$y,[B("img",{src:E(L.key),alt:L.name,style:VA({width:d()+"px",height:d()+"px"}),class:"object-contain rounded"},null,12,Aw)])):(T(),_("div",ew,v(L.emoji),1))],14,zy))),128))])):(T(),_("div",tw,[B("div",iw,v(A.config.theme.emoji.type==="none"?"📦":"😕"),1),B("div",nw,v(A.config.theme.emoji.type==="none"?R.$t("emojiConfig.noEmojiPackDescription"):R.$t("generateSummary.configureEmojiFirst")),1)]))]),B("div",null,[B("label",ow,v(R.$t("generateSummary.themeMode")),1),B("div",rw,[B("button",{onClick:b[1]||(b[1]=L=>o.value="light"),class:kA(["flex-1 py-2 px-3 text-sm border rounded transition-colors",o.value==="light"?"border-primary-500 bg-primary-50 text-primary-700":"border-gray-300 hover:border-gray-400"])}," 🌞 "+v(R.$t("generateSummary.lightMode")),3),B("button",{onClick:b[2]||(b[2]=L=>o.value="dark"),class:kA(["flex-1 py-2 px-3 text-sm border rounded transition-colors",o.value==="dark"?"border-primary-500 bg-primary-50 text-primary-700":"border-gray-300 hover:border-gray-400"])}," 🌙 "+v(R.$t("generateSummary.darkMode")),3)])]),B("div",gw,[B("h4",sw,v(R.$t("generateSummary.configSummary")),1),B("div",aw,[A.config.theme.wakeword?(T(),_("div",Iw,v(R.$t("generateSummary.wakeword"))+" "+v(F()),1)):sA("",!0),B("div",Cw,[B("span",null,v(R.$t("generateSummary.font"))+" "+v(N()),1),r.value?sA("",!0):(T(),_("span",lw,v(R.$t("generateSummary.loading")),1))]),B("div",null,v(R.$t("generateSummary.emotion"))+" "+v(G()),1),B("div",null,v(R.$t("generateSummary.skin"))+" "+v(K()),1),A.config.theme.font.hide_subtitle?(T(),_("div",Bw,v(R.$t("generateSummary.hideSubtitle"))+" "+v(R.$t("common.yes")),1)):sA("",!0)])])])])]),B("div",Qw,[B("button",{onClick:b[3]||(b[3]=L=>R.$emit("prev")),class:"bg-gray-500 hover:bg-gray-600 text-white px-6 py-2 rounded-lg font-medium transition-colors"},v(R.$t("generateSummary.previous")),1),B("button",{onClick:b[4]||(b[4]=L=>R.$emit("generate")),class:"bg-green-500 hover:bg-green-600 text-white px-8 py-2 rounded-lg font-medium transition-colors flex items-center"},[b[5]||(b[5]=B("svg",{class:"w-5 h-5 mr-2",fill:"currentColor",viewBox:"0 0 20 20"},[B("path",{"fill-rule":"evenodd",d:"M3 17a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zm3.293-7.707a1 1 0 011.414 0L9 10.586V3a1 1 0 112 0v7.586l1.293-1.293a1 1 0 111.414 1.414l-3 3a1 1 0 01-1.414 0l-3-3a1 1 0 010-1.414z","clip-rule":"evenodd"})],-1)),gt(" "+v(R.$t("generateSummary.generate")),1)])])]))}},Ew=wy(cw,[["__scopeId","data-v-aa1dde40"]]);/*! https://mths.be/codepointat v0.2.0 by @mathias */String.prototype.codePointAt||function(){var A=function(){try{var t={},i=Object.defineProperty,n=i(t,t,t)&&i}catch{}return n}(),e=function(t){if(this==null)throw TypeError();var i=String(this),n=i.length,o=t?Number(t):0;if(o!=o&&(o=0),!(o<0||o>=n)){var r=i.charCodeAt(o),g;return r>=55296&&r<=56319&&n>o+1&&(g=i.charCodeAt(o+1),g>=56320&&g<=57343)?(r-55296)*1024+g-56320+65536:r}};A?A(String.prototype,"codePointAt",{value:e,configurable:!0,writable:!0}):String.prototype.codePointAt=e}();var cg=0,_C=-3;function In(){this.table=new Uint16Array(16),this.trans=new Uint16Array(288)}function uw(A,e){this.source=A,this.sourceIndex=0,this.tag=0,this.bitcount=0,this.dest=e,this.destLen=0,this.ltree=new In,this.dtree=new In}var KC=new In,OC=new In,Eg=new Uint8Array(30),ug=new Uint16Array(30),PC=new Uint8Array(30),VC=new Uint16Array(30),hw=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),zs=new In,$e=new Uint8Array(320);function WC(A,e,t,i){var n,o;for(n=0;n>>=1,e}function et(A,e,t){if(!e)return t;for(;A.bitcount<24;)A.tag|=A.source[A.sourceIndex++]<>>16-e;return A.tag>>>=e,A.bitcount-=e,i+t}function br(A,e){for(;A.bitcount<24;)A.tag|=A.source[A.sourceIndex++]<>>=1,++n,t+=e.table[n],i-=e.table[n];while(i>=0);return A.tag=o,A.bitcount-=n,e.trans[t+i]}function pw(A,e,t){var i,n,o,r,g,s;for(i=et(A,5,257),n=et(A,5,1),o=et(A,4,4),r=0;r<19;++r)$e[r]=0;for(r=0;r8;)A.sourceIndex--,A.bitcount-=8;if(e=A.source[A.sourceIndex+1],e=256*e+A.source[A.sourceIndex],t=A.source[A.sourceIndex+3],t=256*t+A.source[A.sourceIndex+2],e!==(~t&65535))return _C;for(A.sourceIndex+=4,i=e;i;--i)A.dest[A.destLen++]=A.source[A.sourceIndex++];return A.bitcount=0,cg}function yw(A,e){var t=new uw(A,e),i,n,o;do{switch(i=dw(t),n=et(t,2,0),n){case 0:o=mw(t);break;case 1:o=Aa(t,KC,OC);break;case 2:pw(t,t.ltree,t.dtree),o=Aa(t,t.ltree,t.dtree);break;default:o=_C}if(o!==cg)throw new Error("Data error")}while(!i);return t.destLenthis.x2&&(this.x2=A)),typeof e=="number"&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=e,this.y2=e),ethis.y2&&(this.y2=e))};St.prototype.addX=function(A){this.addPoint(A,null)};St.prototype.addY=function(A){this.addPoint(null,A)};St.prototype.addBezier=function(A,e,t,i,n,o,r,g){var s=[A,e],a=[t,i],I=[n,o],l=[r,g];this.addPoint(A,e),this.addPoint(r,g);for(var C=0;C<=1;C++){var Q=6*s[C]-12*a[C]+6*I[C],h=-3*s[C]+9*a[C]-9*I[C]+3*l[C],f=3*a[C]-3*s[C];if(h===0){if(Q===0)continue;var u=-f/Q;0=0&&s>0&&(g+=" "),g+=e(a)}return g}for(var i="",n=0;n=0&&A<=255,"Byte value should be between 0 and 255."),[A]};wA.BYTE=je(1);rA.CHAR=function(A){return[A.charCodeAt(0)]};wA.CHAR=je(1);rA.CHARARRAY=function(A){typeof A>"u"&&(A="",console.warn("Undefined CHARARRAY encountered and treated as an empty string. This is probably caused by a missing glyph name."));for(var e=[],t=0;t"u"?0:A.length};rA.USHORT=function(A){return[A>>8&255,A&255]};wA.USHORT=je(2);rA.SHORT=function(A){return A>=ta&&(A=-(2*ta-A)),[A>>8&255,A&255]};wA.SHORT=je(2);rA.UINT24=function(A){return[A>>16&255,A>>8&255,A&255]};wA.UINT24=je(3);rA.ULONG=function(A){return[A>>24&255,A>>16&255,A>>8&255,A&255]};wA.ULONG=je(4);rA.LONG=function(A){return A>=ia&&(A=-(2*ia-A)),[A>>24&255,A>>16&255,A>>8&255,A&255]};wA.LONG=je(4);rA.FIXED=rA.ULONG;wA.FIXED=wA.ULONG;rA.FWORD=rA.SHORT;wA.FWORD=wA.SHORT;rA.UFWORD=rA.USHORT;wA.UFWORD=wA.USHORT;rA.LONGDATETIME=function(A){return[0,0,0,0,A>>24&255,A>>16&255,A>>8&255,A&255]};wA.LONGDATETIME=je(8);rA.TAG=function(A){return mA.argument(A.length===4,"Tag should be exactly 4 ASCII characters."),[A.charCodeAt(0),A.charCodeAt(1),A.charCodeAt(2),A.charCodeAt(3)]};wA.TAG=je(4);rA.Card8=rA.BYTE;wA.Card8=wA.BYTE;rA.Card16=rA.USHORT;wA.Card16=wA.USHORT;rA.OffSize=rA.BYTE;wA.OffSize=wA.BYTE;rA.SID=rA.USHORT;wA.SID=wA.USHORT;rA.NUMBER=function(A){return A>=-107&&A<=107?[A+139]:A>=108&&A<=1131?(A=A-108,[(A>>8)+247,A&255]):A>=-1131&&A<=-108?(A=-A-108,[(A>>8)+251,A&255]):A>=-32768&&A<=32767?rA.NUMBER16(A):rA.NUMBER32(A)};wA.NUMBER=function(A){return rA.NUMBER(A).length};rA.NUMBER16=function(A){return[28,A>>8&255,A&255]};wA.NUMBER16=je(3);rA.NUMBER32=function(A){return[29,A>>24&255,A>>16&255,A>>8&255,A&255]};wA.NUMBER32=je(5);rA.REAL=function(A){var e=A.toString(),t=/\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(e);if(t){var i=parseFloat("1e"+((t[2]?+t[2]:0)+t[1].length));e=(Math.round(A*i)/i).toString()}for(var n="",o=0,r=e.length;o>8&255,e[e.length]=i&255}return e};wA.UTF16=function(A){return A.length*2};var Nr={"x-mac-croatian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈ƫȅ ÀÃÕŒœĐ—“”‘’÷◊©⁄€‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ","x-mac-cyrillic":"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю","x-mac-gaelic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØḂ±≤≥ḃĊċḊḋḞḟĠġṀæøṁṖṗɼƒſṠ«»… ÀÃÕŒœ–—“”‘’ṡẛÿŸṪ€‹›Ŷŷṫ·Ỳỳ⁊ÂÊÁËÈÍÎÏÌÓÔ♣ÒÚÛÙıÝýŴŵẄẅẀẁẂẃ","x-mac-greek":"Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦€ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ­","x-mac-icelandic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüݰ¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-inuit":"ᐃᐄᐅᐆᐊᐋᐱᐲᐳᐴᐸᐹᑉᑎᑏᑐᑑᑕᑖᑦᑭᑮᑯᑰᑲᑳᒃᒋᒌᒍᒎᒐᒑ°ᒡᒥᒦ•¶ᒧ®©™ᒨᒪᒫᒻᓂᓃᓄᓅᓇᓈᓐᓯᓰᓱᓲᓴᓵᔅᓕᓖᓗᓘᓚᓛᓪᔨᔩᔪᔫᔭ… ᔮᔾᕕᕖᕗ–—“”‘’ᕘᕙᕚᕝᕆᕇᕈᕉᕋᕌᕐᕿᖀᖁᖂᖃᖄᖅᖏᖐᖑᖒᖓᖔᖕᙱᙲᙳᙴᙵᙶᖖᖠᖡᖢᖣᖤᖥᖦᕼŁł","x-mac-ce":"ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ",macintosh:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-romanian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂȘ∞±≤≥¥µ∂∑∏π∫ªºΩăș¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›Țț‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-turkish":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙˆ˜¯˘˙˚¸˝˛ˇ"};Ri.MACSTRING=function(A,e,t,i){var n=Nr[i];if(n!==void 0){for(var o="",r=0;r=128&&(o=t[o],o===void 0))return;i[n]=o}return i}};wA.MACSTRING=function(A,e){var t=rA.MACSTRING(A,e);return t!==void 0?t.length:0};function Gr(A){return A>=-128&&A<=127}function kw(A,e,t){for(var i=0,n=A.length;e>8&255,s+256&255)}return o}rA.VARDELTAS=function(A){for(var e=0,t=[];e=-128&&i<=127?e=vw(A,e,t):e=Fw(A,e,t)}return t};rA.INDEX=function(A){for(var e=1,t=[e],i=[],n=0;n>8,e[l+1]=C&255,e=e.concat(i[I])}return e};wA.TABLE=function(A){for(var e=0,t=A.fields.length,i=0;i0)return new J(this.data,this.offset+e).parseStruct(A)};J.prototype.parsePointer32=function(A){var e=this.parseOffset32();if(e>0)return new J(this.data,this.offset+e).parseStruct(A)};J.prototype.parseListOfLists=function(A){for(var e=this.parseOffset16List(),t=e.length,i=this.relativeOffset,n=new Array(t),o=0;o>1,e.skip("uShort",3),A.glyphIndexMap={};for(var r=new lA.Parser(t,i+n+14),g=new lA.Parser(t,i+n+16+o*2),s=new lA.Parser(t,i+n+16+o*4),a=new lA.Parser(t,i+n+16+o*6),I=i+n+16+o*8,l=0;l=0;n-=1){var o=lA.getUShort(A,e+4+n*8),r=lA.getUShort(A,e+4+n*8+2);if(o===3&&(r===0||r===1||r===10)||o===0&&(r===0||r===1||r===2||r===3||r===4)){i=lA.getULong(A,e+4+n*8+4);break}}if(i===-1)throw new Error("No valid cmap sub-tables found.");var g=new lA.Parser(A,e+i);if(t.format=g.parseUShort(),t.format===12)Uw(t,g);else if(t.format===4)Mw(t,g,A,e,i);else throw new Error("Only format 4 and 12 cmap tables are supported (found format "+t.format+").");return t}function Jw(A,e,t){A.segments.push({end:e,start:e,delta:-(e-t),offset:0,glyphIndex:t})}function Tw(A){A.segments.push({end:65535,start:65535,delta:1,offset:0})}function Hw(A){var e=!0,t;for(t=A.length-1;t>0;t-=1){var i=A.get(t);if(i.unicode>65535){console.log("Adding CMAP format 12 (needed!)"),e=!1;break}}var n=[{name:"version",type:"USHORT",value:0},{name:"numTables",type:"USHORT",value:e?1:2},{name:"platformID",type:"USHORT",value:3},{name:"encodingID",type:"USHORT",value:1},{name:"offset",type:"ULONG",value:e?12:20}];e||(n=n.concat([{name:"cmap12PlatformID",type:"USHORT",value:3},{name:"cmap12EncodingID",type:"USHORT",value:10},{name:"cmap12Offset",type:"ULONG",value:0}])),n=n.concat([{name:"format",type:"USHORT",value:4},{name:"cmap4Length",type:"USHORT",value:0},{name:"language",type:"USHORT",value:0},{name:"segCountX2",type:"USHORT",value:0},{name:"searchRange",type:"USHORT",value:0},{name:"entrySelector",type:"USHORT",value:0},{name:"rangeShift",type:"USHORT",value:0}]);var o=new aA.Table("cmap",n);for(o.segments=[],t=0;t>4,r=n&15;if(o===t||(e+=i[o],r===t))break;e+=i[r]}return parseFloat(e)}function AD(A,e){var t,i,n,o;if(e===28)return t=A.parseByte(),i=A.parseByte(),t<<8|i;if(e===29)return t=A.parseByte(),i=A.parseByte(),n=A.parseByte(),o=A.parseByte(),t<<24|i<<16|n<<8|o;if(e===30)return $w(A);if(e>=32&&e<=246)return e-139;if(e>=247&&e<=250)return t=A.parseByte(),(e-247)*256+t+108;if(e>=251&&e<=254)return t=A.parseByte(),-(e-251)*256-t-108;throw new Error("Invalid b0 "+e)}function eD(A){for(var e={},t=0;t>1,s.length=0,I=!0}function N(G){for(var K,R,b,L,EA,dA,IA,nA,X,tA,fA,Y,W=0;W1&&!I&&(d=s.shift()+E,I=!0),Q+=s.pop(),w(C,Q);break;case 5:for(;s.length>0;)C+=s.shift(),Q+=s.shift(),g.lineTo(C,Q);break;case 6:for(;s.length>0&&(C+=s.shift(),g.lineTo(C,Q),s.length!==0);)Q+=s.shift(),g.lineTo(C,Q);break;case 7:for(;s.length>0&&(Q+=s.shift(),g.lineTo(C,Q),s.length!==0);)C+=s.shift(),g.lineTo(C,Q);break;case 8:for(;s.length>0;)i=C+s.shift(),n=Q+s.shift(),o=i+s.shift(),r=n+s.shift(),C=o+s.shift(),Q=r+s.shift(),g.curveTo(i,n,o,r,C,Q);break;case 10:EA=s.pop()+f,dA=h[EA],dA&&N(dA);break;case 11:return;case 12:switch(z=G[W],W+=1,z){case 35:i=C+s.shift(),n=Q+s.shift(),o=i+s.shift(),r=n+s.shift(),IA=o+s.shift(),nA=r+s.shift(),X=IA+s.shift(),tA=nA+s.shift(),fA=X+s.shift(),Y=tA+s.shift(),C=fA+s.shift(),Q=Y+s.shift(),s.shift(),g.curveTo(i,n,o,r,IA,nA),g.curveTo(X,tA,fA,Y,C,Q);break;case 34:i=C+s.shift(),n=Q,o=i+s.shift(),r=n+s.shift(),IA=o+s.shift(),nA=r,X=IA+s.shift(),tA=r,fA=X+s.shift(),Y=Q,C=fA+s.shift(),g.curveTo(i,n,o,r,IA,nA),g.curveTo(X,tA,fA,Y,C,Q);break;case 36:i=C+s.shift(),n=Q+s.shift(),o=i+s.shift(),r=n+s.shift(),IA=o+s.shift(),nA=r,X=IA+s.shift(),tA=r,fA=X+s.shift(),Y=tA+s.shift(),C=fA+s.shift(),g.curveTo(i,n,o,r,IA,nA),g.curveTo(X,tA,fA,Y,C,Q);break;case 37:i=C+s.shift(),n=Q+s.shift(),o=i+s.shift(),r=n+s.shift(),IA=o+s.shift(),nA=r+s.shift(),X=IA+s.shift(),tA=nA+s.shift(),fA=X+s.shift(),Y=tA+s.shift(),Math.abs(fA-C)>Math.abs(Y-Q)?C=fA+s.shift():Q=Y+s.shift(),g.curveTo(i,n,o,r,IA,nA),g.curveTo(X,tA,fA,Y,C,Q);break;default:console.log("Glyph "+e.index+": unknown operator 1200"+z),s.length=0}break;case 14:s.length>0&&!I&&(d=s.shift()+E,I=!0),l&&(g.closePath(),l=!1);break;case 18:F();break;case 19:case 20:F(),W+=a+7>>3;break;case 21:s.length>2&&!I&&(d=s.shift()+E,I=!0),Q+=s.pop(),C+=s.pop(),w(C,Q);break;case 22:s.length>1&&!I&&(d=s.shift()+E,I=!0),C+=s.pop(),w(C,Q);break;case 23:F();break;case 24:for(;s.length>2;)i=C+s.shift(),n=Q+s.shift(),o=i+s.shift(),r=n+s.shift(),C=o+s.shift(),Q=r+s.shift(),g.curveTo(i,n,o,r,C,Q);C+=s.shift(),Q+=s.shift(),g.lineTo(C,Q);break;case 25:for(;s.length>6;)C+=s.shift(),Q+=s.shift(),g.lineTo(C,Q);i=C+s.shift(),n=Q+s.shift(),o=i+s.shift(),r=n+s.shift(),C=o+s.shift(),Q=r+s.shift(),g.curveTo(i,n,o,r,C,Q);break;case 26:for(s.length%2&&(C+=s.shift());s.length>0;)i=C,n=Q+s.shift(),o=i+s.shift(),r=n+s.shift(),C=o,Q=r+s.shift(),g.curveTo(i,n,o,r,C,Q);break;case 27:for(s.length%2&&(Q+=s.shift());s.length>0;)i=C+s.shift(),n=Q,o=i+s.shift(),r=n+s.shift(),C=o+s.shift(),Q=r,g.curveTo(i,n,o,r,C,Q);break;case 28:K=G[W],R=G[W+1],s.push((K<<24|R<<16)>>16),W+=2;break;case 29:EA=s.pop()+A.gsubrsBias,dA=A.gsubrs[EA],dA&&N(dA);break;case 30:for(;s.length>0&&(i=C,n=Q+s.shift(),o=i+s.shift(),r=n+s.shift(),C=o+s.shift(),Q=r+(s.length===1?s.shift():0),g.curveTo(i,n,o,r,C,Q),s.length!==0);)i=C+s.shift(),n=Q,o=i+s.shift(),r=n+s.shift(),Q=r+s.shift(),C=o+(s.length===1?s.shift():0),g.curveTo(i,n,o,r,C,Q);break;case 31:for(;s.length>0&&(i=C+s.shift(),n=Q,o=i+s.shift(),r=n+s.shift(),Q=r+s.shift(),C=o+(s.length===1?s.shift():0),g.curveTo(i,n,o,r,C,Q),s.length!==0);)i=C,n=Q+s.shift(),o=i+s.shift(),r=n+s.shift(),C=o+s.shift(),Q=r+(s.length===1?s.shift():0),g.curveTo(i,n,o,r,C,Q);break;default:z<32?console.log("Glyph "+e.index+": unknown operator "+z):z<247?s.push(z-139):z<251?(K=G[W],W+=1,s.push((z-247)*256+K+108)):z<255?(K=G[W],W+=1,s.push(-(z-251)*256-K-108)):(K=G[W],R=G[W+1],b=G[W+2],L=G[W+3],W+=4,s.push((K<<24|R<<16|b<<8|L)/65536))}}}return N(t),e.advanceWidth=d,g}function rD(A,e,t,i){var n=[],o,r=new lA.Parser(A,e),g=r.parseCard8();if(g===0)for(var s=0;s=i)throw new Error("CFF table CID Font FDSelect has bad FD index value "+o+" (FD count "+i+")");n.push(o)}else if(g===3){var a=r.parseCard16(),I=r.parseCard16();if(I!==0)throw new Error("CFF Table CID Font FDSelect format 3 range has bad initial GID "+I);for(var l,C=0;C=i)throw new Error("CFF table CID Font FDSelect has bad FD index value "+o+" (FD count "+i+")");if(l>t)throw new Error("CFF Table CID Font FDSelect format 3 range has bad GID "+l);for(;I=0&&(t=i),i=e.indexOf(A),i>=0?t=i+Vn.length:(t=Vn.length+e.length,e.push(A)),t}function sD(){return new aA.Record("Header",[{name:"major",type:"Card8",value:1},{name:"minor",type:"Card8",value:0},{name:"hdrSize",type:"Card8",value:4},{name:"major",type:"Card8",value:1}])}function aD(A){var e=new aA.Record("Name INDEX",[{name:"names",type:"INDEX",value:[]}]);e.names=[];for(var t=0;t=t.begin&&A=1&&(t.ulCodePageRange1=i.parseULong(),t.ulCodePageRange2=i.parseULong()),t.version>=2&&(t.sxHeight=i.parseShort(),t.sCapHeight=i.parseShort(),t.usDefaultChar=i.parseUShort(),t.usBreakChar=i.parseUShort(),t.usMaxContent=i.parseUShort()),t}function JD(A){return new aA.Table("OS/2",[{name:"version",type:"USHORT",value:3},{name:"xAvgCharWidth",type:"SHORT",value:0},{name:"usWeightClass",type:"USHORT",value:0},{name:"usWidthClass",type:"USHORT",value:0},{name:"fsType",type:"USHORT",value:0},{name:"ySubscriptXSize",type:"SHORT",value:650},{name:"ySubscriptYSize",type:"SHORT",value:699},{name:"ySubscriptXOffset",type:"SHORT",value:0},{name:"ySubscriptYOffset",type:"SHORT",value:140},{name:"ySuperscriptXSize",type:"SHORT",value:650},{name:"ySuperscriptYSize",type:"SHORT",value:699},{name:"ySuperscriptXOffset",type:"SHORT",value:0},{name:"ySuperscriptYOffset",type:"SHORT",value:479},{name:"yStrikeoutSize",type:"SHORT",value:49},{name:"yStrikeoutPosition",type:"SHORT",value:258},{name:"sFamilyClass",type:"SHORT",value:0},{name:"bFamilyType",type:"BYTE",value:0},{name:"bSerifStyle",type:"BYTE",value:0},{name:"bWeight",type:"BYTE",value:0},{name:"bProportion",type:"BYTE",value:0},{name:"bContrast",type:"BYTE",value:0},{name:"bStrokeVariation",type:"BYTE",value:0},{name:"bArmStyle",type:"BYTE",value:0},{name:"bLetterform",type:"BYTE",value:0},{name:"bMidline",type:"BYTE",value:0},{name:"bXHeight",type:"BYTE",value:0},{name:"ulUnicodeRange1",type:"ULONG",value:0},{name:"ulUnicodeRange2",type:"ULONG",value:0},{name:"ulUnicodeRange3",type:"ULONG",value:0},{name:"ulUnicodeRange4",type:"ULONG",value:0},{name:"achVendID",type:"CHARARRAY",value:"XXXX"},{name:"fsSelection",type:"USHORT",value:0},{name:"usFirstCharIndex",type:"USHORT",value:0},{name:"usLastCharIndex",type:"USHORT",value:0},{name:"sTypoAscender",type:"SHORT",value:0},{name:"sTypoDescender",type:"SHORT",value:0},{name:"sTypoLineGap",type:"SHORT",value:0},{name:"usWinAscent",type:"USHORT",value:0},{name:"usWinDescent",type:"USHORT",value:0},{name:"ulCodePageRange1",type:"ULONG",value:0},{name:"ulCodePageRange2",type:"ULONG",value:0},{name:"sxHeight",type:"SHORT",value:0},{name:"sCapHeight",type:"SHORT",value:0},{name:"usDefaultChar",type:"USHORT",value:0},{name:"usBreakChar",type:"USHORT",value:0},{name:"usMaxContext",type:"USHORT",value:0}],A)}var Jr={parse:xD,make:JD,unicodeRanges:xr,getUnicodeRange:MD};function TD(A,e){var t={},i=new lA.Parser(A,e);switch(t.version=i.parseVersion(),t.italicAngle=i.parseFixed(),t.underlinePosition=i.parseShort(),t.underlineThickness=i.parseShort(),t.isFixedPitch=i.parseULong(),t.minMemType42=i.parseULong(),t.maxMemType42=i.parseULong(),t.minMemType1=i.parseULong(),t.maxMemType1=i.parseULong(),t.version){case 1:t.names=ii.slice();break;case 2:t.numberOfGlyphs=i.parseUShort(),t.glyphNameIndex=new Array(t.numberOfGlyphs);for(var n=0;n=ii.length){var r=i.parseChar();t.names.push(i.parseString(r))}break;case 2.5:t.numberOfGlyphs=i.parseUShort(),t.offset=new Array(t.numberOfGlyphs);for(var g=0;gl.value.tag?1:-1}),e.fields=e.fields.concat(i),e.fields=e.fields.concat(n),e}function Qa(A,e,t){for(var i=0;i0){var o=A.glyphs.get(n);return o.getMetrics()}}return t}function PD(A){for(var e=0,t=0;tu||s===void 0)&&u>0&&(s=u),a 123 are reserved for internal usage");if(f.name!==".notdef"){var m=f.getMetrics();e.push(m.xMin),t.push(m.yMin),i.push(m.xMax),n.push(m.yMax),r.push(m.leftSideBearing),g.push(m.rightSideBearing),o.push(f.advanceWidth)}}var c={xMin:Math.min.apply(null,e),yMin:Math.min.apply(null,t),xMax:Math.max.apply(null,i),yMax:Math.max.apply(null,n),advanceWidthMax:Math.max.apply(null,o),advanceWidthAvg:PD(o),minLeftSideBearing:Math.min.apply(null,r),maxLeftSideBearing:Math.max.apply(null,r),minRightSideBearing:Math.min.apply(null,g)};c.ascender=A.ascender,c.descender=A.descender;var d=sl.make({flags:3,unitsPerEm:A.unitsPerEm,xMin:c.xMin,yMin:c.yMin,xMax:c.xMax,yMax:c.yMax,lowestRecPPEM:3,createdTimestamp:A.createdTimestamp}),w=al.make({ascender:c.ascender,descender:c.descender,advanceWidthMax:c.advanceWidthMax,minLeftSideBearing:c.minLeftSideBearing,minRightSideBearing:c.minRightSideBearing,xMaxExtent:c.maxLeftSideBearing+(c.xMax-c.xMin),numberOfHMetrics:A.glyphs.length}),F=ll.make(A.glyphs.length),N=Jr.make(Object.assign({xAvgCharWidth:Math.round(c.advanceWidthAvg),usFirstCharIndex:s,usLastCharIndex:a,ulUnicodeRange1:I,ulUnicodeRange2:l,ulUnicodeRange3:C,ulUnicodeRange4:Q,sTypoAscender:c.ascender,sTypoDescender:c.descender,sTypoLineGap:0,usWinAscent:c.yMax,usWinDescent:Math.abs(c.yMin),ulCodePageRange1:1,sxHeight:Qa(A,"xyvw",{yMax:Math.round(c.ascender/2)}).yMax,sCapHeight:Qa(A,"HIKLEFJMNTZBDPRAGOQSUVWXY",c).yMax,usDefaultChar:A.hasChar(" ")?32:0,usBreakChar:A.hasChar(" ")?32:0},A.tables.os2)),G=Il.make(A.glyphs),K=ZC.make(A.glyphs),R=A.getEnglishName("fontFamily"),b=A.getEnglishName("fontSubfamily"),L=R+" "+b,EA=A.getEnglishName("postScriptName");EA||(EA=R.replace(/\s/g,"")+"-"+b);var dA={};for(var IA in A.names)dA[IA]=A.names[IA];dA.uniqueID||(dA.uniqueID={en:A.getEnglishName("manufacturer")+":"+L}),dA.postScriptName||(dA.postScriptName={en:EA}),dA.preferredFamily||(dA.preferredFamily=A.names.fontFamily),dA.preferredSubfamily||(dA.preferredSubfamily=A.names.fontSubfamily);var nA=[],X=ul.make(dA,nA),tA=nA.length>0?Cl.make(nA):void 0,fA=hl.make(),Y=gl.make(A.glyphs,{version:A.getEnglishName("version"),fullName:L,familyName:R,weightName:b,postScriptName:EA,unitsPerEm:A.unitsPerEm,fontBBox:[0,c.yMin,c.ascender,c.advanceWidthMax]}),W=A.metas&&Object.keys(A.metas).length>0?dl.make(A.metas):void 0,z=[d,w,F,N,X,K,fA,Y,G];tA&&z.push(tA),A.tables.gsub&&z.push(fl.make(A.tables.gsub)),W&&z.push(W);for(var DA=pl(z),NA=DA.encode(),ne=pg(NA),LA=DA.fields,H=!1,$=0;$>>1,o=A[n].tag;if(o===e)return n;o>>1,o=A[n];if(o===e)return n;o>>1;t=A[o];var r=t.start;if(r===e)return t;r0)return t=A[i-1],e>t.end?0:t}function mn(A,e){this.font=A,this.tableName=e}mn.prototype={searchTag:Xo,binSearch:ca,getTable:function(A){var e=this.font.tables[this.tableName];return!e&&A&&(e=this.font.tables[this.tableName]=this.createDefaultTable()),e},getScriptNames:function(){var A=this.getTable();return A?A.scripts.map(function(e){return e.tag}):[]},getDefaultScriptName:function(){var A=this.getTable();if(A){for(var e=!1,t=0;t=0)return i[n].script;if(e){var o={tag:A,script:{defaultLangSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]},langSysRecords:[]}};return i.splice(-1-n,0,o),o.script}}},getLangSysTable:function(A,e,t){var i=this.getScriptTable(A,t);if(i){if(!e||e==="dflt"||e==="DFLT")return i.defaultLangSys;var n=Xo(i.langSysRecords,e);if(n>=0)return i.langSysRecords[n].langSys;if(t){var o={tag:e,langSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]}};return i.langSysRecords.splice(-1-n,0,o),o.langSys}}},getFeatureTable:function(A,e,t,i){var n=this.getLangSysTable(A,e,i);if(n){for(var o,r=n.featureIndexes,g=this.font.tables[this.tableName].features,s=0;s=g[a-1].tag,"Features must be added in alphabetical order."),o={tag:t,feature:{params:0,lookupListIndexes:[]}},g.push(o),r.push(a),o.feature}}},getLookupTables:function(A,e,t,i,n){var o=this.getFeatureTable(A,e,t,n),r=[];if(o){for(var g,s=o.lookupListIndexes,a=this.font.tables[this.tableName].lookups,I=0;I=0?t:-1;case 2:var i=Ea(A.ranges,e);return i?i.index+e-i.start:-1}},expandCoverage:function(A){if(A.format===1)return A.glyphs;for(var e=[],t=A.ranges,i=0;i1,'Multiple: "by" must be an array of two or more ids');var n=this.getLookupTables(t,i,A,2,!0)[0],o=mg(n,1,{substFormat:1,coverage:{format:1,glyphs:[]},sequences:[]});mA.assert(o.coverage.format===1,"Multiple: unable to modify coverage table format "+o.coverage.format);var r=e.sub,g=this.binSearch(o.coverage.glyphs,r);g<0&&(g=-1-g,o.coverage.glyphs.splice(g,0,r),o.sequences.splice(g,0,0)),o.sequences[g]=e.by};Ge.prototype.addAlternate=function(A,e,t,i){var n=this.getLookupTables(t,i,A,3,!0)[0],o=mg(n,1,{substFormat:1,coverage:{format:1,glyphs:[]},alternateSets:[]});mA.assert(o.coverage.format===1,"Alternate: unable to modify coverage table format "+o.coverage.format);var r=e.sub,g=this.binSearch(o.coverage.glyphs,r);g<0&&(g=-1-g,o.coverage.glyphs.splice(g,0,r),o.alternateSets.splice(g,0,0)),o.alternateSets[g]=e.by};Ge.prototype.addLigature=function(A,e,t,i){var n=this.getLookupTables(t,i,A,4,!0)[0],o=n.subtables[0];o||(o={substFormat:1,coverage:{format:1,glyphs:[]},ligatureSets:[]},n.subtables[0]=o),mA.assert(o.coverage.format===1,"Ligature: unable to modify coverage table format "+o.coverage.format);var r=e.sub[0],g=e.sub.slice(1),s={ligGlyph:e.by,components:g},a=this.binSearch(o.coverage.glyphs,r);if(a>=0){for(var I=o.ligatureSets[a],l=0;l0?(o=A.parseByte(),e&n||(o=-o),o=t+o):(e&n)>0?o=t:o=t+A.parseShort(),o}function yl(A,e,t){var i=new lA.Parser(e,t);A.numberOfContours=i.parseShort(),A._xMin=i.parseShort(),A._yMin=i.parseShort(),A._xMax=i.parseShort(),A._yMax=i.parseShort();var n,o;if(A.numberOfContours>0){for(var r=A.endPointIndices=[],g=0;g0)for(var l=i.parseByte(),C=0;C0){var Q=[],h;if(a>0){for(var f=0;f=0,Q.push(h);for(var u=0,E=0;E0?(n&2)>0?(w.dx=i.parseShort(),w.dy=i.parseShort()):w.matchedPoints=[i.parseUShort(),i.parseUShort()]:(n&2)>0?(w.dx=i.parseChar(),w.dy=i.parseChar()):w.matchedPoints=[i.parseByte(),i.parseByte()],(n&8)>0?w.xScale=w.yScale=i.parseF2Dot14():(n&64)>0?(w.xScale=i.parseF2Dot14(),w.yScale=i.parseF2Dot14()):(n&128)>0&&(w.xScale=i.parseF2Dot14(),w.scale01=i.parseF2Dot14(),w.scale10=i.parseF2Dot14(),w.yScale=i.parseF2Dot14()),A.components.push(w),d=!!(n&32)}if(n&256){A.instructionLength=i.parseUShort(),A.instructions=[];for(var F=0;Fe.points.length-1||i.matchedPoints[1]>n.points.length-1)throw Error("Matched points out of range in "+e.name);var r=e.points[i.matchedPoints[0]],g=n.points[i.matchedPoints[1]],s={xScale:i.xScale,scale01:i.scale01,scale10:i.scale10,yScale:i.yScale,dx:0,dy:0};g=zo([g],s)[0],s.dx=r.x-g.x,s.dy=r.y-g.y,o=zo(n.points,s)}e.points=e.points.concat(o)}}return wl(e.points)}function zD(A,e,t,i){for(var n=new at.GlyphSet(i),o=0;o2)){var t=this.font,i=this._prepState;if(!i||i.ppem!==e){var n=this._fpgmState;if(!n){Ht.prototype=rk,n=this._fpgmState=new Ht("fpgm",t.tables.fpgm),n.funcs=[],n.font=t,exports.DEBUG&&(console.log("---EXEC FPGM---"),n.step=-1);try{si(n)}catch(a){console.log("Hinting error in FPGM:"+a),this._errorState=3;return}}Ht.prototype=n,i=this._prepState=new Ht("prep",t.tables.prep),i.ppem=e;var o=t.tables.cvt;if(o)for(var r=i.cvt=new Array(o.length),g=e/t.unitsPerEm,s=0;s1))try{return Fl(A,i)}catch(a){this._errorState<1&&(console.log("Hinting error:"+a),console.log("Note: further hinting errors are silenced")),this._errorState=1;return}}};Fl=function(A,e){var t=e.ppem/e.font.unitsPerEm,i=t,n=A.components,o,r,g;if(Ht.prototype=e,!n)g=new Ht("glyf",A.instructions),exports.DEBUG&&(console.log("---EXEC GLYPH---"),g.step=-1),Tr(A,g,t,i),r=g.gZone;else{var s=e.font;r=[],o=[];for(var a=0;a=176&&o<=183)i+=o-176+1;else if(o>=184&&o<=191)i+=(o-184+1)*2;else if(e&&n===1&&o===27)break;while(n>0);A.ip=i}function ha(A,e){exports.DEBUG&&console.log(e.step,"SVTCA["+A.axis+"]"),e.fv=e.pv=e.dpv=A}function fa(A,e){exports.DEBUG&&console.log(e.step,"SPVTCA["+A.axis+"]"),e.pv=e.dpv=A}function da(A,e){exports.DEBUG&&console.log(e.step,"SFVTCA["+A.axis+"]"),e.fv=A}function pa(A,e){var t=e.stack,i=t.pop(),n=t.pop(),o=e.z2[i],r=e.z1[n];exports.DEBUG&&console.log("SPVTL["+A+"]",i,n);var g,s;A?(g=o.y-r.y,s=r.x-o.x):(g=r.x-o.x,s=r.y-o.y),e.pv=e.dpv=Dn(g,s)}function ma(A,e){var t=e.stack,i=t.pop(),n=t.pop(),o=e.z2[i],r=e.z1[n];exports.DEBUG&&console.log("SFVTL["+A+"]",i,n);var g,s;A?(g=o.y-r.y,s=r.x-o.x):(g=r.x-o.x,s=r.y-o.y),e.fv=Dn(g,s)}function gk(A){var e=A.stack,t=e.pop(),i=e.pop();exports.DEBUG&&console.log(A.step,"SPVFS[]",t,i),A.pv=A.dpv=Dn(i,t)}function sk(A){var e=A.stack,t=e.pop(),i=e.pop();exports.DEBUG&&console.log(A.step,"SPVFS[]",t,i),A.fv=Dn(i,t)}function ak(A){var e=A.stack,t=A.pv;exports.DEBUG&&console.log(A.step,"GPV[]"),e.push(t.x*16384),e.push(t.y*16384)}function Ik(A){var e=A.stack,t=A.fv;exports.DEBUG&&console.log(A.step,"GFV[]"),e.push(t.x*16384),e.push(t.y*16384)}function Ck(A){A.fv=A.pv,exports.DEBUG&&console.log(A.step,"SFVTPV[]")}function lk(A){var e=A.stack,t=e.pop(),i=e.pop(),n=e.pop(),o=e.pop(),r=e.pop(),g=A.z0,s=A.z1,a=g[t],I=g[i],l=s[n],C=s[o],Q=A.z2[r];exports.DEBUG&&console.log("ISECT[], ",t,i,n,o,r);var h=a.x,f=a.y,u=I.x,E=I.y,m=l.x,c=l.y,d=C.x,w=C.y,F=(h-u)*(c-w)-(f-E)*(m-d),N=h*E-f*u,G=m*w-c*d;Q.x=(N*(m-d)-G*(h-u))/F,Q.y=(N*(c-w)-G*(f-E))/F}function Bk(A){A.rp0=A.stack.pop(),exports.DEBUG&&console.log(A.step,"SRP0[]",A.rp0)}function Qk(A){A.rp1=A.stack.pop(),exports.DEBUG&&console.log(A.step,"SRP1[]",A.rp1)}function ck(A){A.rp2=A.stack.pop(),exports.DEBUG&&console.log(A.step,"SRP2[]",A.rp2)}function Ek(A){var e=A.stack.pop();switch(exports.DEBUG&&console.log(A.step,"SZP0[]",e),A.zp0=e,e){case 0:A.tZone||Go(A),A.z0=A.tZone;break;case 1:A.z0=A.gZone;break;default:throw new Error("Invalid zone pointer")}}function uk(A){var e=A.stack.pop();switch(exports.DEBUG&&console.log(A.step,"SZP1[]",e),A.zp1=e,e){case 0:A.tZone||Go(A),A.z1=A.tZone;break;case 1:A.z1=A.gZone;break;default:throw new Error("Invalid zone pointer")}}function hk(A){var e=A.stack.pop();switch(exports.DEBUG&&console.log(A.step,"SZP2[]",e),A.zp2=e,e){case 0:A.tZone||Go(A),A.z2=A.tZone;break;case 1:A.z2=A.gZone;break;default:throw new Error("Invalid zone pointer")}}function fk(A){var e=A.stack.pop();switch(exports.DEBUG&&console.log(A.step,"SZPS[]",e),A.zp0=A.zp1=A.zp2=e,e){case 0:A.tZone||Go(A),A.z0=A.z1=A.z2=A.tZone;break;case 1:A.z0=A.z1=A.z2=A.gZone;break;default:throw new Error("Invalid zone pointer")}}function dk(A){A.loop=A.stack.pop(),exports.DEBUG&&console.log(A.step,"SLOOP[]",A.loop)}function pk(A){exports.DEBUG&&console.log(A.step,"RTG[]"),A.round=Rl}function mk(A){exports.DEBUG&&console.log(A.step,"RTHG[]"),A.round=ik}function yk(A){var e=A.stack.pop();exports.DEBUG&&console.log(A.step,"SMD[]",e),A.minDis=e/64}function wk(A){exports.DEBUG&&console.log(A.step,"ELSE[]"),Nl(A,!1)}function Dk(A){var e=A.stack.pop();exports.DEBUG&&console.log(A.step,"JMPR[]",e),A.ip+=e-1}function kk(A){var e=A.stack.pop();exports.DEBUG&&console.log(A.step,"SCVTCI[]",e),A.cvCutIn=e/64}function vk(A){var e=A.stack;exports.DEBUG&&console.log(A.step,"DUP[]"),e.push(e[e.length-1])}function $o(A){exports.DEBUG&&console.log(A.step,"POP[]"),A.stack.pop()}function Fk(A){exports.DEBUG&&console.log(A.step,"CLEAR[]"),A.stack.length=0}function Sk(A){var e=A.stack,t=e.pop(),i=e.pop();exports.DEBUG&&console.log(A.step,"SWAP[]"),e.push(t),e.push(i)}function Rk(A){var e=A.stack;exports.DEBUG&&console.log(A.step,"DEPTH[]"),e.push(e.length)}function bk(A){var e=A.stack,t=e.pop(),i=e.pop();exports.DEBUG&&console.log(A.step,"LOOPCALL[]",t,i);var n=A.ip,o=A.prog;A.prog=A.funcs[t];for(var r=0;r1?"loop "+(e.loop-g)+": ":"")+"SHP["+(A?"rp1":"rp2")+"]",a)}e.loop=1}function ka(A,e){var t=e.stack,i=A?e.rp1:e.rp2,n=(A?e.z0:e.z1)[i],o=e.fv,r=e.pv,g=t.pop(),s=e.z2[e.contours[g]],a=s;exports.DEBUG&&console.log(e.step,"SHC["+A+"]",g);var I=r.distance(n,n,!1,!0);do a!==n&&o.setRelative(a,a,I,r),a=a.nextPointOnContour;while(a!==s)}function va(A,e){var t=e.stack,i=A?e.rp1:e.rp2,n=(A?e.z0:e.z1)[i],o=e.fv,r=e.pv,g=t.pop();exports.DEBUG&&console.log(e.step,"SHZ["+A+"]",g);var s;switch(g){case 0:s=e.tZone;break;case 1:s=e.gZone;break;default:throw new Error("Invalid zone")}for(var a,I=r.distance(n,n,!1,!0),l=s.length-2,C=0;C1?"loop "+(A.loop-t)+": ":"")+"SHPIX[]",r,n),i.setRelative(g,g,n),i.touch(g)}A.loop=1}function xk(A){for(var e=A.stack,t=A.rp1,i=A.rp2,n=A.loop,o=A.z0[t],r=A.z1[i],g=A.fv,s=A.dpv,a=A.z2;n--;){var I=e.pop(),l=a[I];exports.DEBUG&&console.log(A.step,(A.loop>1?"loop "+(A.loop-n)+": ":"")+"IP[]",I,t,"<->",i),g.interpolate(l,o,r,s),g.touch(l)}A.loop=1}function Fa(A,e){var t=e.stack,i=t.pop()/64,n=t.pop(),o=e.z1[n],r=e.z0[e.rp0],g=e.fv,s=e.pv;g.setRelative(o,r,i,s),g.touch(o),exports.DEBUG&&console.log(e.step,"MSIRP["+A+"]",i,n),e.rp1=e.rp0,e.rp2=n,A&&(e.rp0=n)}function Jk(A){for(var e=A.stack,t=A.rp0,i=A.z0[t],n=A.loop,o=A.fv,r=A.pv,g=A.z1;n--;){var s=e.pop(),a=g[s];exports.DEBUG&&console.log(A.step,(A.loop>1?"loop "+(A.loop-n)+": ":"")+"ALIGNRP[]",s),o.setRelative(a,i,0,r),o.touch(a)}A.loop=1}function Tk(A){exports.DEBUG&&console.log(A.step,"RTDG[]"),A.round=tk}function Sa(A,e){var t=e.stack,i=t.pop(),n=t.pop(),o=e.z0[n],r=e.fv,g=e.pv,s=e.cvt[i];exports.DEBUG&&console.log(e.step,"MIAP["+A+"]",i,"(",s,")",n);var a=g.distance(o,Bn);A&&(Math.abs(a-s)",g),e.stack.push(Math.round(g*64))}function Vk(A){exports.DEBUG&&console.log(A.step,"MPPEM[]"),A.stack.push(A.ppem)}function Wk(A){exports.DEBUG&&console.log(A.step,"FLIPON[]"),A.autoFlip=!0}function qk(A){var e=A.stack,t=e.pop(),i=e.pop();exports.DEBUG&&console.log(A.step,"LT[]",t,i),e.push(it?1:0)}function Xk(A){var e=A.stack,t=e.pop(),i=e.pop();exports.DEBUG&&console.log(A.step,"GTEQ[]",t,i),e.push(i>=t?1:0)}function zk(A){var e=A.stack,t=e.pop(),i=e.pop();exports.DEBUG&&console.log(A.step,"EQ[]",t,i),e.push(t===i?1:0)}function $k(A){var e=A.stack,t=e.pop(),i=e.pop();exports.DEBUG&&console.log(A.step,"NEQ[]",t,i),e.push(t!==i?1:0)}function Av(A){var e=A.stack,t=e.pop();exports.DEBUG&&console.log(A.step,"ODD[]",t),e.push(Math.trunc(t)%2?1:0)}function ev(A){var e=A.stack,t=e.pop();exports.DEBUG&&console.log(A.step,"EVEN[]",t),e.push(Math.trunc(t)%2?0:1)}function tv(A){var e=A.stack.pop();exports.DEBUG&&console.log(A.step,"IF[]",e),e||(Nl(A,!0),exports.DEBUG&&console.log(A.step,"EIF[]"))}function iv(A){exports.DEBUG&&console.log(A.step,"EIF[]")}function nv(A){var e=A.stack,t=e.pop(),i=e.pop();exports.DEBUG&&console.log(A.step,"AND[]",t,i),e.push(t&&i?1:0)}function ov(A){var e=A.stack,t=e.pop(),i=e.pop();exports.DEBUG&&console.log(A.step,"OR[]",t,i),e.push(t||i?1:0)}function rv(A){var e=A.stack,t=e.pop();exports.DEBUG&&console.log(A.step,"NOT[]",t),e.push(t?0:1)}function Ar(A,e){var t=e.stack,i=t.pop(),n=e.fv,o=e.pv,r=e.ppem,g=e.deltaBase+(A-1)*16,s=e.deltaShift,a=e.z0;exports.DEBUG&&console.log(e.step,"DELTAP["+A+"]",i,t);for(var I=0;I>4);if(Q===r){var h=(C&15)-8;h>=0&&h++,exports.DEBUG&&console.log(e.step,"DELTAPFIX",l,"by",h*s);var f=a[l];n.setRelative(f,f,h*s,o)}}}function gv(A){var e=A.stack,t=e.pop();exports.DEBUG&&console.log(A.step,"SDB[]",t),A.deltaBase=t}function sv(A){var e=A.stack,t=e.pop();exports.DEBUG&&console.log(A.step,"SDS[]",t),A.deltaShift=Math.pow(.5,t)}function av(A){var e=A.stack,t=e.pop(),i=e.pop();exports.DEBUG&&console.log(A.step,"ADD[]",t,i),e.push(i+t)}function Iv(A){var e=A.stack,t=e.pop(),i=e.pop();exports.DEBUG&&console.log(A.step,"SUB[]",t,i),e.push(i-t)}function Cv(A){var e=A.stack,t=e.pop(),i=e.pop();exports.DEBUG&&console.log(A.step,"DIV[]",t,i),e.push(i*64/t)}function lv(A){var e=A.stack,t=e.pop(),i=e.pop();exports.DEBUG&&console.log(A.step,"MUL[]",t,i),e.push(i*t/64)}function Bv(A){var e=A.stack,t=e.pop();exports.DEBUG&&console.log(A.step,"ABS[]",t),e.push(Math.abs(t))}function Qv(A){var e=A.stack,t=e.pop();exports.DEBUG&&console.log(A.step,"NEG[]",t),e.push(-t)}function cv(A){var e=A.stack,t=e.pop();exports.DEBUG&&console.log(A.step,"FLOOR[]",t),e.push(Math.floor(t/64)*64)}function Ev(A){var e=A.stack,t=e.pop();exports.DEBUG&&console.log(A.step,"CEILING[]",t),e.push(Math.ceil(t/64)*64)}function xn(A,e){var t=e.stack,i=t.pop();exports.DEBUG&&console.log(e.step,"ROUND[]"),t.push(e.round(i/64)*64)}function uv(A){var e=A.stack,t=e.pop(),i=e.pop();exports.DEBUG&&console.log(A.step,"WCVTF[]",t,i),A.cvt[i]=t*A.ppem/A.font.unitsPerEm}function er(A,e){var t=e.stack,i=t.pop(),n=e.ppem,o=e.deltaBase+(A-1)*16,r=e.deltaShift;exports.DEBUG&&console.log(e.step,"DELTAC["+A+"]",i,t);for(var g=0;g>4);if(I===n){var l=(a&15)-8;l>=0&&l++;var C=l*r;exports.DEBUG&&console.log(e.step,"DELTACFIX",s,"by",C),e.cvt[s]+=C}}}function hv(A){var e=A.stack.pop();exports.DEBUG&&console.log(A.step,"SROUND[]",e),A.round=bl;var t;switch(e&192){case 0:t=.5;break;case 64:t=1;break;case 128:t=2;break;default:throw new Error("invalid SROUND value")}switch(A.srPeriod=t,e&48){case 0:A.srPhase=0;break;case 16:A.srPhase=.25*t;break;case 32:A.srPhase=.5*t;break;case 48:A.srPhase=.75*t;break;default:throw new Error("invalid SROUND value")}e&=15,e===0?A.srThreshold=0:A.srThreshold=(e/8-.5)*t}function fv(A){var e=A.stack.pop();exports.DEBUG&&console.log(A.step,"S45ROUND[]",e),A.round=bl;var t;switch(e&192){case 0:t=Math.sqrt(2)/2;break;case 64:t=Math.sqrt(2);break;case 128:t=2*Math.sqrt(2);break;default:throw new Error("invalid S45ROUND value")}switch(A.srPeriod=t,e&48){case 0:A.srPhase=0;break;case 16:A.srPhase=.25*t;break;case 32:A.srPhase=.5*t;break;case 48:A.srPhase=.75*t;break;default:throw new Error("invalid S45ROUND value")}e&=15,e===0?A.srThreshold=0:A.srThreshold=(e/8-.5)*t}function dv(A){exports.DEBUG&&console.log(A.step,"ROFF[]"),A.round=ek}function pv(A){exports.DEBUG&&console.log(A.step,"RUTG[]"),A.round=nk}function mv(A){exports.DEBUG&&console.log(A.step,"RDTG[]"),A.round=ok}function yv(A){var e=A.stack.pop();exports.DEBUG&&console.log(A.step,"SCANCTRL[]",e)}function Na(A,e){var t=e.stack,i=t.pop(),n=t.pop(),o=e.z2[i],r=e.z1[n];exports.DEBUG&&console.log(e.step,"SDPVTL["+A+"]",i,n);var g,s;A?(g=o.y-r.y,s=r.x-o.x):(g=r.x-o.x,s=r.y-o.y),e.dpv=Dn(g,s)}function wv(A){var e=A.stack,t=e.pop(),i=0;exports.DEBUG&&console.log(A.step,"GETINFO[]",t),t&1&&(i=35),t&32&&(i|=4096),e.push(i)}function Dv(A){var e=A.stack,t=e.pop(),i=e.pop(),n=e.pop();exports.DEBUG&&console.log(A.step,"ROLL[]"),e.push(i),e.push(t),e.push(n)}function kv(A){var e=A.stack,t=e.pop(),i=e.pop();exports.DEBUG&&console.log(A.step,"MAX[]",t,i),e.push(Math.max(i,t))}function vv(A){var e=A.stack,t=e.pop(),i=e.pop();exports.DEBUG&&console.log(A.step,"MIN[]",t,i),e.push(Math.min(i,t))}function Fv(A){var e=A.stack.pop();exports.DEBUG&&console.log(A.step,"SCANTYPE[]",e)}function Sv(A){var e=A.stack.pop(),t=A.stack.pop();switch(exports.DEBUG&&console.log(A.step,"INSTCTRL[]",e,t),e){case 1:A.inhibitGridFit=!!t;return;case 2:A.ignoreCvt=!!t;return;default:throw new Error("invalid INSTCTRL[] selector")}}function bt(A,e){var t=e.stack,i=e.prog,n=e.ip;exports.DEBUG&&console.log(e.step,"PUSHB["+A+"]");for(var o=0;o=0?1:-1,u=Math.abs(u),A&&(m=o.cvt[g],i&&Math.abs(u-m)":"_")+(i?"R":"_")+(n===0?"Gr":n===1?"Bl":n===2?"Wh":"")+"]",A?g+"("+o.cvt[g]+","+m+")":"",s,"(d =",f,"->",E*u,")"),o.rp1=o.rp0,o.rp2=s,e&&(o.rp0=s)}vl=[ha.bind(void 0,pt),ha.bind(void 0,nt),fa.bind(void 0,pt),fa.bind(void 0,nt),da.bind(void 0,pt),da.bind(void 0,nt),pa.bind(void 0,0),pa.bind(void 0,1),ma.bind(void 0,0),ma.bind(void 0,1),gk,sk,ak,Ik,Ck,lk,Bk,Qk,ck,Ek,uk,hk,fk,dk,pk,mk,yk,wk,Dk,kk,void 0,void 0,vk,$o,Fk,Sk,Rk,Gk,Lk,void 0,void 0,void 0,bk,Nk,Uk,void 0,ya.bind(void 0,0),ya.bind(void 0,1),wa.bind(void 0,pt),wa.bind(void 0,nt),Da.bind(void 0,0),Da.bind(void 0,1),ka.bind(void 0,0),ka.bind(void 0,1),va.bind(void 0,0),va.bind(void 0,1),Mk,xk,Fa.bind(void 0,0),Fa.bind(void 0,1),Jk,Tk,Sa.bind(void 0,0),Sa.bind(void 0,1),Hk,Yk,_k,Kk,Ok,Pk,Ra.bind(void 0,0),Ra.bind(void 0,1),void 0,ba.bind(void 0,0),ba.bind(void 0,1),Vk,void 0,Wk,void 0,void 0,qk,jk,Zk,Xk,zk,$k,Av,ev,tv,iv,nv,ov,rv,Ar.bind(void 0,1),gv,sv,av,Iv,Cv,lv,Bv,Qv,cv,Ev,xn.bind(void 0,0),xn.bind(void 0,1),xn.bind(void 0,2),xn.bind(void 0,3),void 0,void 0,void 0,void 0,uv,Ar.bind(void 0,2),Ar.bind(void 0,3),er.bind(void 0,1),er.bind(void 0,2),er.bind(void 0,3),hv,fv,void 0,void 0,dv,void 0,pv,mv,$o,$o,void 0,void 0,void 0,void 0,void 0,yv,Na.bind(void 0,0),Na.bind(void 0,1),wv,void 0,Dv,kv,vv,Fv,Sv,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,bt.bind(void 0,1),bt.bind(void 0,2),bt.bind(void 0,3),bt.bind(void 0,4),bt.bind(void 0,5),bt.bind(void 0,6),bt.bind(void 0,7),bt.bind(void 0,8),Nt.bind(void 0,1),Nt.bind(void 0,2),Nt.bind(void 0,3),Nt.bind(void 0,4),Nt.bind(void 0,5),Nt.bind(void 0,6),Nt.bind(void 0,7),Nt.bind(void 0,8),CA.bind(void 0,0,0,0,0,0),CA.bind(void 0,0,0,0,0,1),CA.bind(void 0,0,0,0,0,2),CA.bind(void 0,0,0,0,0,3),CA.bind(void 0,0,0,0,1,0),CA.bind(void 0,0,0,0,1,1),CA.bind(void 0,0,0,0,1,2),CA.bind(void 0,0,0,0,1,3),CA.bind(void 0,0,0,1,0,0),CA.bind(void 0,0,0,1,0,1),CA.bind(void 0,0,0,1,0,2),CA.bind(void 0,0,0,1,0,3),CA.bind(void 0,0,0,1,1,0),CA.bind(void 0,0,0,1,1,1),CA.bind(void 0,0,0,1,1,2),CA.bind(void 0,0,0,1,1,3),CA.bind(void 0,0,1,0,0,0),CA.bind(void 0,0,1,0,0,1),CA.bind(void 0,0,1,0,0,2),CA.bind(void 0,0,1,0,0,3),CA.bind(void 0,0,1,0,1,0),CA.bind(void 0,0,1,0,1,1),CA.bind(void 0,0,1,0,1,2),CA.bind(void 0,0,1,0,1,3),CA.bind(void 0,0,1,1,0,0),CA.bind(void 0,0,1,1,0,1),CA.bind(void 0,0,1,1,0,2),CA.bind(void 0,0,1,1,0,3),CA.bind(void 0,0,1,1,1,0),CA.bind(void 0,0,1,1,1,1),CA.bind(void 0,0,1,1,1,2),CA.bind(void 0,0,1,1,1,3),CA.bind(void 0,1,0,0,0,0),CA.bind(void 0,1,0,0,0,1),CA.bind(void 0,1,0,0,0,2),CA.bind(void 0,1,0,0,0,3),CA.bind(void 0,1,0,0,1,0),CA.bind(void 0,1,0,0,1,1),CA.bind(void 0,1,0,0,1,2),CA.bind(void 0,1,0,0,1,3),CA.bind(void 0,1,0,1,0,0),CA.bind(void 0,1,0,1,0,1),CA.bind(void 0,1,0,1,0,2),CA.bind(void 0,1,0,1,0,3),CA.bind(void 0,1,0,1,1,0),CA.bind(void 0,1,0,1,1,1),CA.bind(void 0,1,0,1,1,2),CA.bind(void 0,1,0,1,1,3),CA.bind(void 0,1,1,0,0,0),CA.bind(void 0,1,1,0,0,1),CA.bind(void 0,1,1,0,0,2),CA.bind(void 0,1,1,0,0,3),CA.bind(void 0,1,1,0,1,0),CA.bind(void 0,1,1,0,1,1),CA.bind(void 0,1,1,0,1,2),CA.bind(void 0,1,1,0,1,3),CA.bind(void 0,1,1,1,0,0),CA.bind(void 0,1,1,1,0,1),CA.bind(void 0,1,1,1,0,2),CA.bind(void 0,1,1,1,0,3),CA.bind(void 0,1,1,1,1,0),CA.bind(void 0,1,1,1,1,1),CA.bind(void 0,1,1,1,1,2),CA.bind(void 0,1,1,1,1,3)];function Ui(A){this.char=A,this.state={},this.activeState=null}function yg(A,e,t){this.contextName=t,this.startIndex=A,this.endOffset=e}function Rv(A,e,t){this.contextName=A,this.openRange=null,this.ranges=[],this.checkStart=e,this.checkEnd=t}function Ve(A,e){this.context=A,this.index=e,this.length=A.length,this.current=A[e],this.backtrack=A.slice(0,e),this.lookahead=A.slice(e+1)}function Lo(A){this.eventId=A,this.subscribers=[]}function bv(A){var e=this,t=["start","end","next","newToken","contextStart","contextEnd","insertToken","removeToken","removeRange","replaceToken","replaceRange","composeRUD","updateContextsRanges"];t.forEach(function(n){Object.defineProperty(e.events,n,{value:new Lo(n)})}),A&&t.forEach(function(n){var o=A[n];typeof o=="function"&&e.events[n].subscribe(o)});var i=["insertToken","removeToken","removeRange","replaceToken","replaceRange","composeRUD"];i.forEach(function(n){e.events[n].subscribe(e.updateContextsRanges)})}function zA(A){this.tokens=[],this.registeredContexts={},this.contextCheckers=[],this.events={},this.registeredModifiers=[],bv.call(this,A)}Ui.prototype.setState=function(A,e){return this.state[A]=e,this.activeState={key:A,value:this.state[A]},this.activeState};Ui.prototype.getState=function(A){return this.state[A]||null};zA.prototype.inboundIndex=function(A){return A>=0&&A0&&A<=this.lookahead.length):return this.lookahead[A-1];default:return null}};zA.prototype.rangeToText=function(A){if(A instanceof yg)return this.getRangeTokens(A).map(function(e){return e.char}).join("")};zA.prototype.getText=function(){return this.tokens.map(function(A){return A.char}).join("")};zA.prototype.getContext=function(A){var e=this.registeredContexts[A];return e||null};zA.prototype.on=function(A,e){var t=this.events[A];return t?t.subscribe(e):null};zA.prototype.dispatch=function(A,e){var t=this,i=this.events[A];i instanceof Lo&&i.subscribers.forEach(function(n){n.apply(t,e||[])})};zA.prototype.registerContextChecker=function(A,e,t){if(this.getContext(A))return{FAIL:"context name '"+A+"' is already registered."};if(typeof e!="function")return{FAIL:"missing context start check."};if(typeof t!="function")return{FAIL:"missing context end check."};var i=new Rv(A,e,t);return this.registeredContexts[A]=i,this.contextCheckers.push(i),i};zA.prototype.getRangeTokens=function(A){var e=A.startIndex+A.endOffset;return[].concat(this.tokens.slice(A.startIndex,e))};zA.prototype.getContextRanges=function(A){var e=this.getContext(A);return e?e.ranges:{FAIL:"context checker '"+A+"' is not registered."}};zA.prototype.resetContextsRanges=function(){var A=this.registeredContexts;for(var e in A)if(A.hasOwnProperty(e)){var t=A[e];t.ranges=[]}};zA.prototype.updateContextsRanges=function(){this.resetContextsRanges();for(var A=this.tokens.map(function(i){return i.char}),e=0;e=n.start&&A<=n.end){var o=A-n.start;return n.index+o}}break;default:return-1}return-1}function Gv(A,e){var t=kn(A,e.coverage);return t===-1?null:A+e.deltaGlyphId}function Lv(A,e){var t=kn(A,e.coverage);return t===-1?null:e.substitute[t]}function tr(A,e){for(var t=[],i=0;i=0;t--){var i=e[t],n=Gl(i),o=Pt(i);if(!n&&!o)return!0;if(n)return!1}return!1}function jv(A){if(Gl(A.current))return!1;for(var e=0;e0}t("fontFamily"),t("weightName"),t("manufacturer"),t("copyright"),t("version"),this.unitsPerEm>0};YA.prototype.toTables=function(){return WD.fontToTable(this)};YA.prototype.toBuffer=function(){return console.warn("Font.toBuffer is deprecated. Use Font.toArrayBuffer instead."),this.toArrayBuffer()};YA.prototype.toArrayBuffer=function(){for(var A=this.toTables(),e=A.encode(),t=new ArrayBuffer(e.length),i=new Uint8Array(t),n=0;n=1.2&&(n.markGlyphSets=t.parsePointer(hF)),n}var dF={parse:fF},We=new Array(10);We[1]=function(){var e=this.offset+this.relativeOffset,t=this.parseUShort();if(t===1)return{posFormat:1,coverage:this.parsePointer(J.coverage),value:this.parseValueRecord()};if(t===2)return{posFormat:2,coverage:this.parsePointer(J.coverage),values:this.parseValueRecordList()};mA.assert(!1,"0x"+e.toString(16)+": GPOS lookup type 1 format must be 1 or 2.")};We[2]=function(){var e=this.offset+this.relativeOffset,t=this.parseUShort();mA.assert(t===1||t===2,"0x"+e.toString(16)+": GPOS lookup type 2 format must be 1 or 2.");var i=this.parsePointer(J.coverage),n=this.parseUShort(),o=this.parseUShort();if(t===1)return{posFormat:t,coverage:i,valueFormat1:n,valueFormat2:o,pairSets:this.parseList(J.pointer(J.list(function(){return{secondGlyph:this.parseUShort(),value1:this.parseValueRecord(n),value2:this.parseValueRecord(o)}})))};if(t===2){var r=this.parsePointer(J.classDef),g=this.parsePointer(J.classDef),s=this.parseUShort(),a=this.parseUShort();return{posFormat:t,coverage:i,valueFormat1:n,valueFormat2:o,classDef1:r,classDef2:g,class1Count:s,class2Count:a,classRecords:this.parseList(s,J.list(a,function(){return{value1:this.parseValueRecord(n),value2:this.parseValueRecord(o)}}))}}};We[3]=function(){return{error:"GPOS Lookup 3 not supported"}};We[4]=function(){return{error:"GPOS Lookup 4 not supported"}};We[5]=function(){return{error:"GPOS Lookup 5 not supported"}};We[6]=function(){return{error:"GPOS Lookup 6 not supported"}};We[7]=function(){return{error:"GPOS Lookup 7 not supported"}};We[8]=function(){return{error:"GPOS Lookup 8 not supported"}};We[9]=function(){return{error:"GPOS Lookup 9 not supported"}};function pF(A,e){e=e||0;var t=new J(A,e),i=t.parseVersion(1);return mA.argument(i===1||i===1.1,"Unsupported GPOS table version "+i),i===1?{version:i,scripts:t.parseScriptList(),features:t.parseFeatureList(),lookups:t.parseLookupList(We)}:{version:i,scripts:t.parseScriptList(),features:t.parseFeatureList(),lookups:t.parseLookupList(We),variations:t.parseFeatureVariationsList()}}var mF=new Array(10);function yF(A){return new aA.Table("GPOS",[{name:"version",type:"ULONG",value:65536},{name:"scripts",type:"TABLE",value:new aA.ScriptList(A.scripts)},{name:"features",type:"TABLE",value:new aA.FeatureList(A.features)},{name:"lookups",type:"TABLE",value:new aA.LookupList(A.lookups,mF)}])}var wF={parse:pF,make:yF};function DF(A){var e={};A.skip("uShort");var t=A.parseUShort();mA.argument(t===0,"Unsupported kern sub-table version."),A.skip("uShort",2);var i=A.parseUShort();A.skip("uShort",3);for(var n=0;n1&&console.warn("Only the first kern subtable is supported."),A.skip("uLong");var i=A.parseUShort(),n=i&255;if(A.skip("uShort"),n===0){var o=A.parseUShort();A.skip("uShort",3);for(var r=0;r"u",n=i&&!t.isUrl?bF:NF;return new Promise(function(o,r){n(A,function(g,s){if(g){if(e)return e(g);r(g)}var a;try{a=kg(s,t)}catch(I){if(e)return e(I,null);r(I)}if(e)return e(null,a);o(a)})})}function UF(A,e){var t=require("fs"),i=t.readFileSync(A);return kg(ml(i),e)}var Hr=Object.freeze({__proto__:null,Font:YA,Glyph:Ne,Path:ie,BoundingBox:St,_parse:lA,parse:kg,load:LF,loadSync:UF});const MF="modulepreload",xF=function(A,e){return new URL(A,e).href},xa={},Ul=function(e,t,i){let n=Promise.resolve();if(t&&t.length>0){const r=document.getElementsByTagName("link"),g=document.querySelector("meta[property=csp-nonce]"),s=(g==null?void 0:g.nonce)||(g==null?void 0:g.getAttribute("nonce"));n=Promise.allSettled(t.map(a=>{if(a=xF(a,i),a in xa)return;xa[a]=!0;const I=a.endsWith(".css"),l=I?'[rel="stylesheet"]':"";if(!!i)for(let h=r.length-1;h>=0;h--){const f=r[h];if(f.href===a&&(!I||f.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${a}"]${l}`))return;const Q=document.createElement("link");if(Q.rel=I?"stylesheet":MF,I||(Q.as="script"),Q.crossOrigin="",Q.href=a,s&&Q.setAttribute("nonce",s),document.head.appendChild(Q),I)return new Promise((h,f)=>{Q.addEventListener("load",h),Q.addEventListener("error",()=>f(new Error(`Unable to preload CSS for ${a}`)))})}))}function o(r){const g=new Event("vite:preloadError",{cancelable:!0});if(g.payload=r,window.dispatchEvent(g),!g.defaultPrevented)throw r}return n.then(r=>{for(const g of r||[])g.status==="rejected"&&o(g.reason);return e().catch(o)})},JF=()=>Ul(()=>import("./ft_render-ByO_jG18.js"),[],import.meta.url);let j=null,Qn=0;const TF=new Promise(A=>{JF().then(e=>{e.default().then(t=>{j=t,A()})})});function Ja(A){return A/65536}function Ue(A){return A/64}function Hi(A){return A>=0?A:A+256}let Ml,xl,Jl,vg,Tl,Hl,Yl;async function HF(){if(await TF,j._init_constants(),Ml=j.cwrap("FT_New_Memory_Face","number",["number","number","number","number","number"]),xl=j.cwrap("FT_Set_Char_Size","number",["number","number","number","number","number"]),Jl=j.cwrap("FT_Set_Pixel_Sizes","number",["number","number","number"]),vg=j.cwrap("FT_Get_Char_Index","number",["number","number"]),Tl=j.cwrap("FT_Load_Glyph","number",["number","number","number"]),Hl=j.cwrap("FT_Get_Sfnt_Table","number",["number","number"]),j.cwrap("FT_Get_Kerning","number",["number","number","number","number","number"]),Yl=j.cwrap("FT_Done_Face","number",["number"]),!Qn){let A=j._malloc(4);try{let e=j.ccall("FT_Init_FreeType","number",["number"],[A]);if(e)throw new Error(`error in FT_Init_FreeType: ${e}`);Qn=j.getValue(A,"i32")}finally{j._free(A)}}}function YF(A,e){let t,i;if(A instanceof ArrayBuffer)i=A.byteLength;else if(A instanceof Uint8Array)i=A.byteLength;else if(A&&typeof A.length=="number")i=A.length;else throw new Error("Invalid font source format");let n={ptr:0,font:j._malloc(i)};const o=A instanceof ArrayBuffer?new Uint8Array(A):A;j.writeArrayToMemory(o,n.font);let r=j._malloc(4);try{if(t=Ml(Qn,n.font,i,0,r),t)throw new Error(`error in FT_New_Memory_Face: ${t}`);n.ptr=j.getValue(r,"i32")}finally{j._free(r)}if(t=xl(n.ptr,0,e*64,300,300),t)throw new Error(`error in FT_Set_Char_Size: ${t}`);if(t=Jl(n.ptr,0,e),t)throw new Error(`error in FT_Set_Pixel_Sizes: ${t}`);let g=j.getValue(n.ptr+j.OFFSET_FACE_UNITS_PER_EM,"i16"),s=j.getValue(n.ptr+j.OFFSET_FACE_ASCENDER,"i16"),a=j.getValue(n.ptr+j.OFFSET_FACE_DESCENDER,"i16"),I=j.getValue(n.ptr+j.OFFSET_FACE_HEIGHT,"i16");return Object.assign(n,{units_per_em:g,ascender:s,descender:a,height:I})}function _F(A){let e=Hl(A.ptr,j.FT_SFNT_OS2);if(!e)throw new Error("os/2 table not found for this font");let t=j.getValue(e+j.OFFSET_TT_OS2_ASCENDER,"i16"),i=j.getValue(e+j.OFFSET_TT_OS2_DESCENDER,"i16"),n=j.getValue(e+j.OFFSET_TT_OS2_LINEGAP,"i16");return{typoAscent:t,typoDescent:i,typoLineGap:n}}function nr(A,e){return vg(A.ptr,e)!==0}function KF(A,e,t={}){let i=vg(A.ptr,e);if(i===0)throw new Error(`glyph does not exist for codepoint ${e}`);let n=j.FT_LOAD_RENDER;t.mono?n|=j.FT_LOAD_TARGET_MONO:t.lcd?n|=j.FT_LOAD_TARGET_LCD:t.lcd_v?n|=j.FT_LOAD_TARGET_LCD_V:t.autohint_strong?n|=j.FT_LOAD_TARGET_NORMAL:n|=j.FT_LOAD_TARGET_LIGHT,t.autohint_off?n|=j.FT_LOAD_NO_AUTOHINT:n|=j.FT_LOAD_FORCE_AUTOHINT,t.use_color_info&&(n|=j.FT_LOAD_COLOR);let o=Tl(A.ptr,i,n);if(o)throw new Error(`error in FT_Load_Glyph: ${o}`);let r=j.getValue(A.ptr+j.OFFSET_FACE_GLYPH,"i32"),g={glyph_index:j.getValue(r+j.OFFSET_GLYPH_INDEX,"i32"),metrics:{width:Ue(j.getValue(r+j.OFFSET_GLYPH_METRICS_WIDTH,"i32")),height:Ue(j.getValue(r+j.OFFSET_GLYPH_METRICS_HEIGHT,"i32")),horiBearingX:Ue(j.getValue(r+j.OFFSET_GLYPH_METRICS_HORI_BEARING_X,"i32")),horiBearingY:Ue(j.getValue(r+j.OFFSET_GLYPH_METRICS_HORI_BEARING_Y,"i32")),horiAdvance:Ue(j.getValue(r+j.OFFSET_GLYPH_METRICS_HORI_ADVANCE,"i32")),vertBearingX:Ue(j.getValue(r+j.OFFSET_GLYPH_METRICS_VERT_BEARING_X,"i32")),vertBearingY:Ue(j.getValue(r+j.OFFSET_GLYPH_METRICS_VERT_BEARING_Y,"i32")),vertAdvance:Ue(j.getValue(r+j.OFFSET_GLYPH_METRICS_VERT_ADVANCE,"i32"))},linearHoriAdvance:Ja(j.getValue(r+j.OFFSET_GLYPH_LINEAR_HORI_ADVANCE,"i32")),linearVertAdvance:Ja(j.getValue(r+j.OFFSET_GLYPH_LINEAR_VERT_ADVANCE,"i32")),advance:{x:Ue(j.getValue(r+j.OFFSET_GLYPH_ADVANCE_X,"i32")),y:Ue(j.getValue(r+j.OFFSET_GLYPH_ADVANCE_Y,"i32"))},bitmap:{width:j.getValue(r+j.OFFSET_GLYPH_BITMAP_WIDTH,"i32"),rows:j.getValue(r+j.OFFSET_GLYPH_BITMAP_ROWS,"i32"),pitch:j.getValue(r+j.OFFSET_GLYPH_BITMAP_PITCH,"i32"),num_grays:j.getValue(r+j.OFFSET_GLYPH_BITMAP_NUM_GRAYS,"i16"),pixel_mode:j.getValue(r+j.OFFSET_GLYPH_BITMAP_PIXEL_MODE,"i8"),palette_mode:j.getValue(r+j.OFFSET_GLYPH_BITMAP_PALETTE_MODE,"i8")},bitmap_left:j.getValue(r+j.OFFSET_GLYPH_BITMAP_LEFT,"i32"),bitmap_top:j.getValue(r+j.OFFSET_GLYPH_BITMAP_TOP,"i32"),lsb_delta:Ue(j.getValue(r+j.OFFSET_GLYPH_LSB_DELTA,"i32")),rsb_delta:Ue(j.getValue(r+j.OFFSET_GLYPH_RSB_DELTA,"i32"))},s=g.bitmap.width,a=g.bitmap.rows,I=g.bitmap_left,l=g.bitmap_top,C=j.getValue(r+j.OFFSET_GLYPH_BITMAP_BUFFER,"i32"),Q=Math.abs(g.bitmap.pitch),h=g.linearHoriAdvance,f=g.linearVertAdvance,u=g.bitmap.pixel_mode,E=[];for(let m=0;m255&&(R=255),K=(255-R)*K/255,d.push(K)}else{let F=j.getValue(c+w,"i8");d.push(Hi(F))}E.push(d)}return{x:I,y:l,width:s,height:a,advance_x:h,advance_y:f,pixels:E,freetype:g}}function OF(A){let e=Yl(A.ptr);if(e)throw new Error(`error in FT_Done_Face: ${e}`);j._free(A.font),A.ptr=0,A.font=0}function PF(){let A=j.ccall("FT_Done_FreeType","number",["number"],[Qn]);if(A)throw new Error(`error in FT_Done_FreeType: ${A}`);Qn=0}class yt extends Error{constructor(e){super(e),this.name="AppError",Error.captureStackTrace&&Error.captureStackTrace(this,yt)}}class VF{constructor(){this.data={}}add_range(e,t,i,n){let o=n-t,r=[];for(let g=t;g<=i;g++)this._set_char(e,g,g+o),r.push(g);return r}add_symbols(e,t){let i=[];for(let n of t){let o=n.codePointAt(0);this._set_char(e,o,o),i.push(o)}return i}_set_char(e,t,i){this.data[i]={font:e,code:t}}get(){return this.data}}async function WF(A){await HF();let e={};A.font.forEach(C=>{e[C.source_path]=C});let t={},i={};for(let{source_path:C,source_bin:Q}of A.font)if(!t[C])try{let h=Q;h instanceof File?h=await h.arrayBuffer():h instanceof Uint8Array&&(h=h.buffer.slice(h.byteOffset,h.byteOffset+h.byteLength)),t[C]=Hr.parse(h),i[C]=YF(h,A.size)}catch(h){throw new yt(`Cannot load font "${C}": ${h.message}`)}let n=new VF;for(let{source_path:C,ranges:Q}of A.font){let h=i[C];for(let f of Q){if(f.range)for(let u=0;uC-Q).map(Number);for(let C of g){let Q=o[C].code,h=o[C].font;if(!nr(i[h],Q))continue;let f=KF(i[h],Q,{autohint_off:e[h].autohint_off,autohint_strong:e[h].autohint_strong,lcd:A.lcd,lcd_v:A.lcd_v,mono:!A.lcd&&!A.lcd_v&&A.bpp===1,use_color_info:A.use_color_info});r.push({code:C,advanceWidth:f.advance_x,bbox:{x:f.x,y:f.y-f.height,width:f.width,height:f.height},kerning:{},freetype:f.freetype,pixels:f.pixels})}if(!A.no_kerning){let C=r.map(Q=>Q.code);for(let{code:Q,kerning:h}of r){let f=o[Q].code,u=o[Q].font,E=t[u],m=E.charToGlyph(String.fromCodePoint(f));for(let c of C){if(o[c].font!==u)continue;let d=o[c].code,w=E.charToGlyph(String.fromCodePoint(d)),F=E.getKerningValue(m,w);F&&(h[c]=F*A.size/E.unitsPerEm)}}}let s=i[A.font[0].source_path],a=A.size/s.units_per_em,I=_F(s),l=t[A.font[0].source_path].tables.post;for(let C of Object.values(i))OF(C);return PF(),{ascent:Math.max(...r.map(C=>C.bbox.y+C.bbox.height)),descent:Math.min(...r.map(C=>C.bbox.y)),typoAscent:Math.round(I.typoAscent*a),typoDescent:Math.round(I.typoDescent*a),typoLineGap:Math.round(I.typoLineGap*a),size:A.size,glyphs:r,underlinePosition:Math.round(l.underlinePosition*a),underlineThickness:Math.round(l.underlineThickness*a)}}function qF(){return 16}function jF(A,e){return 16+(e-A+1)}function ZF(A){return 16+A*2}function Ta(A){A=A.sort((i,n)=>i-n);let e=[];for(let i=0;i=0?e[o-1].dist:0,g;A[i]-A[o]<256&&(g=jF(A[o],A[i]),r+g=0;){let n=e[i];t.unshift([n.format,A.slice(n.start,n.end+1)]),i=n.start-1}return t}const De=4,XF=(A,e,t)=>{A.setUint32(t,e,!0),A.setUint32(t+4,0,!0)};class zF{constructor(e,t){if(this.src=e,this.opts=t,this.font_name=t.lv_font_name,this.font_name||(this.font_name=t.output||"font"),t.bpp===3&&t.no_compress)throw new yt('LVGL supports "--bpp 3" with compression only');this.init_tables()}init_tables(){this.head=new $F(this),this.glyf=new eS(this),this.cmap=new tS(this),this.kern=new iS(this)}toCBin(){const[e,t]=this.glyf.toCBin(),i=this.cmap.toCBin(De),n=this.kern.toCBin(De),o=12+De*6+0,r=8+De*4,g=new ArrayBuffer(o+r),s=new DataView(g),a=(u,E)=>s.setUint32(E,u,!0);var I=0;a(0,I),I+=De,a(0,I),I+=De,a(0,I),I+=De,s.setUint32(I,this.src.ascent-this.src.descent,!0),I+=4,s.setInt32(I,-this.src.descent,!0),I+=4,s.setUint8(I,this.src.subpixels_mode||0),I+=1,s.setInt8(I,this.src.underlinePosition||0),I+=1,s.setInt8(I,this.src.underlineThickness||0),I+=1,I+=1,a(o,I),I+=De,a(0,I),I+=De,a(0,I),I+=De;const l=this.head.kern_ref();a(r+n.byteLength,I),I+=De,a(r+n.byteLength+e.byteLength,I),I+=De,a(r+n.byteLength+e.byteLength+t.byteLength,I),I+=De,a(l.dsc==="NULL"?0:r,I),I+=De,s.setUint16(I,l.scale,!0),I+=2;const C=this.cmap.getMapNumber(),Q=this.opts.bpp,h=l.classes,f=this.glyf.getCompressionCode();return s.setUint16(I,C|Q<<9|h<<13|f<<14,!0),I+=2,this.concatArrayBuffers([g,n,e,t,i])}concatArrayBuffers(e){const t=e.reduce((r,g)=>r+g.byteLength,0),i=new ArrayBuffer(t),n=new Uint8Array(i);let o=0;for(const r of e)n.set(new Uint8Array(r),o),o+=r.byteLength;return i}}class $F{constructor(e){this.font=e}kern_ref(){return this.font,{scale:0,dsc:"NULL",classes:0}}}class AS{constructor(e){this.buffer=new Uint8Array(e),this.byteIndex=0,this.bitIndex=0,this.bigEndian=!0}writeBits(e,t){for(;t>0;){const i=Math.min(8-this.bitIndex,t),n=(1<>t-i&n;this.bigEndian?this.buffer[this.byteIndex]|=o<<8-this.bitIndex-i:this.buffer[this.byteIndex]|=o<=8&&(this.byteIndex++,this.bitIndex=0),t-=i}}getUsedBytes(){return this.bitIndex>0?this.byteIndex+1:this.byteIndex}}class eS{constructor(e){this.font=e,this.lv_data=[],this.lv_compiled=!1}pixelsToBpp(e){const t=this.font.opts.bpp;return e.map(i=>i.map(n=>n>>>8-t))}storePixels(e,t){this.getCompressionCode()===0?this.storePixelsRaw(e,t):this.storePixelsCompressed(e,t)}storePixelsRaw(e,t){const i=this.font.opts.bpp;for(let n=0;n{const n=e.glyph_id[i.code],o=this.lv_bitmap(i);this.lv_data[n]={bin:o,offset:t,glyph:i},t+=o.byteLength})}toCBin(){this.lv_compile();const e=this.lv_data.slice(1).filter(r=>r).map(r=>r.bin),t=this.balign4(this.concatArrayBuffers(e)),i=new ArrayBuffer(this.lv_data.length*16+16),n=new DataView(i);let o=1;return this.lv_data.forEach(r=>{if(r){const g=Math.round(r.glyph.advanceWidth*16);n.setUint32(o*16,r.offset,!0),n.setUint32(o*16+4,g,!0),n.setUint16(o*16+8,r.glyph.bbox.width,!0),n.setUint16(o*16+10,r.glyph.bbox.height,!0),n.setInt16(o*16+12,r.glyph.bbox.x,!0),n.setInt16(o*16+14,r.glyph.bbox.y,!0)}o++}),[t,i]}balign4(e){const t=e.byteLength%4;if(t===0)return e;const i=4-t,n=new ArrayBuffer(i);return this.concatArrayBuffers([e,n])}concatArrayBuffers(e){const t=e.reduce((r,g)=>r+g.byteLength,0),i=new ArrayBuffer(t),n=new Uint8Array(i);let o=0;for(const r of e)n.set(new Uint8Array(r),o),o+=r.byteLength;return i}getCompressionCode(){return this.font.opts.no_compress||this.font.opts.bpp===1?0:this.font.opts.no_prefilter?2:1}}class tS{constructor(e){this.font=e,this.lv_compiled=!1,this.lv_subtables=[],this.subtables_plan=null,this.buildGlyphIdMap()}buildGlyphIdMap(){const e=this.font;e.glyph_id={},e.src.glyphs&&e.src.glyphs.forEach((t,i)=>{e.glyph_id[t.code]=i+1})}lv_format2enum(e){switch(e){case"format0_tiny":return"LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY";case"format0":return"LV_FONT_FMT_TXT_CMAP_FORMAT0_FULL";case"sparse_tiny":return"LV_FONT_FMT_TXT_CMAP_SPARSE_TINY";case"sparse":return"LV_FONT_FMT_TXT_CMAP_SPARSE_FULL";default:throw new Error("Unknown subtable format")}}lv_format2int(e){return["format0","sparse","format0_tiny","sparse_tiny"].indexOf(e)}getMapNumber(){if(!this.subtables_plan){const e=this.font;if(!e.src.glyphs||e.src.glyphs.length===0)return 0;this.subtables_plan=Ta(e.src.glyphs.map(t=>t.code))}return this.subtables_plan.length}glyphByCode(e){const t=this.font;return t.src.glyphs?t.src.glyphs.find(i=>i.code===e):null}collect_format0_data(e,t,i){const n=this.font,o=[];for(let r=e;r<=t;r++){const g=n.glyph_id[r]||0;o.push(g?g-i:0)}return o}collect_sparse_data(e,t){const i=this.font;let n=[],o=[];for(let r of e){let g=this.glyphByCode(r),s=i.glyph_id[g.code],a=r-e[0],I=s-t;if(a<0||a>65535)throw new Error("Codepoint delta out of range");if(I<0||I>65535)throw new Error("Glyph ID delta out of range");n.push(a),o.push(I)}return{codes:n,ids:o}}toCBin(e){const t=this.font;if(!t.src.glyphs||t.src.glyphs.length===0)return new ArrayBuffer(0);this.subtables_plan||(this.subtables_plan=Ta(t.src.glyphs.map(l=>l.code)));const i=this.subtables_plan;let n=0;const o=12+e*2+(e==4?0:4),r=new ArrayBuffer(i.length*o),g=new DataView(r),s=e==4?(l,C)=>g.setUint32(C,l,!0):(l,C)=>XF(g,l,C),a=[];let I=r.byteLength;for(let[l,C]of i){let Q=this.glyphByCode(C[0]),h=t.glyph_id[Q.code],f=C[0],u=C[C.length-1],E=!1,m=!1,c=0,d=new ArrayBuffer(0),w=new ArrayBuffer(0);if(l!=="format0_tiny")if(l==="format0"){m=!0;let N=this.collect_format0_data(f,u,h);c=N.length,d=this.balign4(this.uint8ArrayToBuffer(new Uint8Array(N)))}else if(l==="sparse_tiny"){E=!0;let N=this.collect_sparse_data(C,h);c=N.codes.length,w=this.balign4(this.uint16ArrayToBuffer(new Uint16Array(N.codes)))}else{E=!0,m=!0;let N=this.collect_sparse_data(C,h);c=N.codes.length,w=this.balign4(this.uint16ArrayToBuffer(new Uint16Array(N.codes))),d=this.align4(this.uint16ArrayToBuffer(new Uint16Array(N.ids)))}let F=n*o;g.setUint32(F,f,!0),F+=4,g.setUint16(F,u-f+1,!0),F+=2,g.setUint16(F,h,!0),F+=2,s(E?I:0,F),F+=e,I+=w.byteLength,s(m?I:0,F),F+=e,I+=d.byteLength,g.setUint16(F,c,!0),F+=2,g.setUint8(F,this.lv_format2int(l)),F+=1,a.push(w),a.push(d),n++}return this.concatArrayBuffers([r,...a])}balign4(e){const t=e.byteLength%4;if(t===0)return e;const i=4-t,n=new ArrayBuffer(i);return this.concatArrayBuffers([e,n])}align4(e){const t=e.byteLength%4;if(t===0)return e;const i=4-t,n=new ArrayBuffer(i);return this.concatArrayBuffers([e,n])}uint8ArrayToBuffer(e){const t=new ArrayBuffer(e.byteLength);return new Uint8Array(t).set(e),t}uint16ArrayToBuffer(e){return e.buffer.slice(0,e.byteLength)}concatArrayBuffers(e){const t=e.reduce((r,g)=>r+g.byteLength,0),i=new ArrayBuffer(t),n=new Uint8Array(i);let o=0;for(const r of e)n.set(new Uint8Array(r),o),o+=r.byteLength;return i}}class iS{constructor(e){this.font=e}toCBin(e){return new ArrayBuffer(0)}}function nS(A,e){if(!A.output)throw new yt('Output is required for "cbin" writer');const i=new zF(e,A).toCBin();return{[A.output]:i}}class oS{constructor(){this.initialized=!1,this.supportedFormats=["ttf","woff","woff2","otf"],this.charsetCache=new Map}async initialize(){if(!this.initialized)try{if(typeof Hr>"u")throw new Error("opentype.js not loaded");this.initialized=!0,console.log("BrowserFontConverter 初始化完成")}catch(e){throw console.error("BrowserFontConverter initialization failed:",e),e}}validateFont(e){if(!e)return!1;if(e instanceof File){const t=e.name.toLowerCase(),i=e.type.toLowerCase(),n=this.supportedFormats.some(r=>t.endsWith(`.${r}`)),o=["font/ttf","font/truetype","application/x-font-ttf","font/woff","font/woff2","application/font-woff","font/otf","application/x-font-otf"].some(r=>i.includes(r));return n||o}return e instanceof ArrayBuffer&&e.byteLength>0}async getFontInfo(e){try{let t;if(e instanceof File)t=await e.arrayBuffer();else if(e instanceof ArrayBuffer)t=e;else throw new Error("Unsupported font file type");const i=Hr.parse(t);return{familyName:this.getLocalizedName(i.names.fontFamily)||"Unknown",fullName:this.getLocalizedName(i.names.fullName)||"Unknown",postScriptName:this.getLocalizedName(i.names.postScriptName)||"Unknown",version:this.getLocalizedName(i.names.version)||"Unknown",unitsPerEm:i.unitsPerEm,ascender:i.ascender,descender:i.descender,numGlyphs:i.numGlyphs,supported:!0}}catch(t){return console.error("Failed to get font information:",t),{familyName:"Unknown",supported:!1,error:t.message}}}getLocalizedName(e){return e?e.zh||e["zh-CN"]||e.en||e[Object.keys(e)[0]]:null}async convertToCBIN(e){this.initialized||await this.initialize();const{fontFile:t,fontName:i,fontSize:n=20,bpp:o=4,charset:r="deepseek",symbols:g="",range:s="",compression:a=!1,lcd:I=!1,lcd_v:l=!1,progressCallback:C=null}=e;if(!this.validateFont(t))throw new yt("不支持的字体文件格式");try{C&&C(0,"Starting font processing...");let Q;t instanceof File?Q=await t.arrayBuffer():Q=t,C&&C(10,"Parsing font structure...");const{ranges:h,charSymbols:f}=await this.parseCharacterInputAsync(r,g,s);C&&C(20,"Preparing conversion parameters...");const u={font:[{source_path:i||"custom_font",source_bin:Q,ranges:[{range:h,symbols:f}],autohint_off:!1,autohint_strong:!1}],size:n,bpp:o,lcd:I,lcd_v:l,no_compress:!a,no_kerning:!1,use_color_info:!1,format:"cbin",output:i||"font"};C&&C(30,"Collecting font data...");const E=await WF(u);C&&C(70,"Generating CBIN format...");const m=nS(u,E),c=u.output;return C&&C(100,"Conversion completed!"),m[c]}catch(Q){throw console.error("Font conversion failed:",Q),new yt(`Font conversion failed: ${Q.message}`)}}async parseCharacterInputAsync(e,t,i){let n=[],o=t||"";return e==="full"?(n=[0,65535,0],{ranges:n,charSymbols:o}):(e&&e!=="custom"&&(o=await this.getCharsetContentAsync(e)+o),i&&(n=this.parseUnicodeRange(i)),{ranges:n,charSymbols:o})}parseCharacterInput(e,t,i){let n=[],o=t||"";return e==="full"?(n=[0,65535,0],{ranges:n,charSymbols:o}):(e&&e!=="custom"&&(o=this.getCharsetContent(e)+o),i&&(n=this.parseUnicodeRange(i)),{ranges:n,charSymbols:o})}async loadCharsetFromFile(e){const i={latin:"./static/charsets/latin1.txt",deepseek:"./static/charsets/deepseek.txt",gb2312:"./static/charsets/gb2312.txt",qwen:"./static/charsets/qwen18409.txt"}[e];if(!i)return null;try{const n=await fetch(i);if(!n.ok)throw new Error(`Failed to load charset file: ${n.status}`);const r=(await n.text()).split(` -`).join("");return this.charsetCache.set(e,r),r}catch(n){return console.error(`Failed to load charset ${e}:`,n),null}}getCharsetContent(e){const t={};return(e==="latin"||e==="deepseek"||e==="gb2312")&&this.charsetCache.has(e)?this.charsetCache.get(e):e==="basic"?this.getCharsetContent("latin"):t[e]||""}async getCharsetContentAsync(e){if(e==="basic"&&(e="latin"),this.charsetCache.has(e))return this.charsetCache.get(e);if(e==="latin"||e==="deepseek"||e==="gb2312"||e==="qwen"){const t=await this.loadCharsetFromFile(e);if(t)return t}return this.getCharsetContent(e)}parseUnicodeRange(e){const t=[],i=e.split(",");for(const n of i){const o=n.trim();if(o)if(o.includes("-")){const[r,g]=o.split("-"),s=this.parseHexOrDec(r),a=this.parseHexOrDec(g);s!==null&&a!==null&&t.push(s,a,s)}else{const r=this.parseHexOrDec(o);r!==null&&t.push(r,r,r)}}return t}parseHexOrDec(e){const t=e.trim();if(t.startsWith("0x")||t.startsWith("0X")){const n=parseInt(t,16);return isNaN(n)?null:n}const i=parseInt(t,10);return isNaN(i)?null:i}async estimateSizeAsync(e){const{fontSize:t=20,bpp:i=4,charset:n="latin",symbols:o="",range:r=""}=e;let g=o.length;if(n==="full")g=65536;else if(n&&n!=="custom"){const I=await this.getCharsetContentAsync(n);g+=I.length}if(r){const I=this.parseUnicodeRange(r);for(let l=0;l0}catch(e){return console.error("加载 FST 模型失败",e),!1}}packString(e,t){const i=new Uint8Array(t),n=Math.min(e.length,t);for(let o=0;o>8&255,t[2]=e>>16&255,t[3]=e>>24&255,t}packModels(){if(this.models.size===0)throw new Error("没有模型数据可打包");let e=0;const t=[];for(const[a,I]of Array.from(this.models.entries()).sort((l,C)=>l[0].localeCompare(C[0]))){e+=I.size;const l=Array.from(I.entries()).sort((C,Q)=>C[0].localeCompare(Q[0]));t.push({name:a,files:l})}const i=this.models.size;let n=4;for(const a of t)n+=36,n+=a.files.length*40;const o=n+Array.from(this.models.values()).reduce((a,I)=>a+Array.from(I.values()).reduce((l,C)=>l+C.byteLength,0),0),r=new Uint8Array(o);let g=0;r.set(this.packUint32(i),g),g+=4;let s=n;for(const a of t){r.set(this.packString(a.name,32),g),g+=32,r.set(this.packUint32(a.files.length),g),g+=4;for(const[I,l]of a.files)r.set(this.packString(I,32),g),g+=32,r.set(this.packUint32(s),g),g+=4,r.set(this.packUint32(l.byteLength),g),g+=4,s+=l.byteLength}for(const a of t)for(const[I,l]of a.files)r.set(new Uint8Array(l),g),g+=l.byteLength;return r.buffer}static async getAvailableModels(){try{return{WakeNet9:["wn9_alexa","wn9_astrolabe_tts","wn9_bluechip_tts2","wn9_computer_tts","wn9_haixiaowu_tts","wn9_heyily_tts2","wn9_heyprinter_tts","wn9_heywanda_tts","wn9_heywillow_tts","wn9_hiesp","wn9_hifairy_tts2","wn9_hijason_tts2","wn9_hijolly_tts2","wn9_hijoy_tts","wn9_hilexin","wn9_hilili_tts","wn9_himfive","wn9_himiaomiao_tts","wn9_hitelly_tts","wn9_hiwalle_tts2","wn9_hixiaoxing_tts","wn9_jarvis_tts","wn9_linaiban_tts2","wn9_miaomiaotongxue_tts","wn9_mycroft_tts","wn9_nihaobaiying_tts2","wn9_nihaodongdong_tts2","wn9_nihaomiaoban_tts2","wn9_nihaoxiaoan_tts2","wn9_nihaoxiaoxin_tts","wn9_nihaoxiaoyi_tts2","wn9_nihaoxiaozhi","wn9_nihaoxiaozhi_tts","wn9_sophia_tts","wn9_xiaoaitongxue","wn9_xiaobinxiaobin_tts","wn9_xiaojianxiaojian_tts2","wn9_xiaokangtongxue_tts2","wn9_xiaolongxiaolong_tts","wn9_xiaoluxiaolu_tts2","wn9_xiaomeitongxue_tts","wn9_xiaomingtongxue_tts2","wn9_xiaosurou_tts2","wn9_xiaotexiaote_tts2","wn9_xiaoyaxiaoya_tts2","wn9_xiaoyutongxue_tts2"],WakeNet9s:["wn9s_alexa","wn9s_hiesp","wn9s_hijason","wn9s_hilexin","wn9s_nihaoxiaozhi"]}}catch(e){return console.error("获取模型列表失败:",e),{WakeNet9:[],WakeNet9s:[]}}}static isValidModel(e,t){return t==="esp32c3"||t==="esp32c6"?e.startsWith("wn9s_"):e.startsWith("wn9_")}clear(){this.models.clear()}getStats(){let e=0,t=0;for(const i of this.models.values()){e+=i.size;for(const n of i.values())t+=n.byteLength}return{modelCount:this.models.size,fileCount:e,totalSize:t,models:Array.from(this.models.keys())}}validatePackingCompatibility(){const e="test_model",t=this.packString(e,32),i=305419896,n=this.packUint32(i);return{stringPacking:{input:e,output:Array.from(t).map(o=>`0x${o.toString(16).padStart(2,"0")}`),isASCII:t.every((o,r)=>r>=e.length||o===e.charCodeAt(r))},intPacking:{input:`0x${i.toString(16)}`,output:Array.from(n).map(o=>`0x${o.toString(16).padStart(2,"0")}`),isLittleEndian:n[0]===120&&n[3]===18}}}}class sS{constructor(){this.files=[],this.textEncoder=new TextEncoder}addFile(e,t,i={}){e.length>32&&console.warn(`Filename "${e}" exceeds 32 bytes and will be truncated`),this.files.push({filename:e,data:t,size:t.byteLength,width:i.width||0,height:i.height||0})}async getImageDimensions(e){return new Promise(t=>{try{const i=new Blob([e]),n=URL.createObjectURL(i),o=new Image;o.onload=()=>{URL.revokeObjectURL(n),t({width:o.width,height:o.height})},o.onerror=()=>{URL.revokeObjectURL(n),t({width:0,height:0})},o.src=n}catch{t({width:0,height:0})}})}parseSpecialImageFormat(e,t){const i=e.toLowerCase().split(".").pop();if([".sjpg",".spng",".sqoi"].includes("."+i))try{const n=new DataView(t),o=n.getUint16(14,!0),r=n.getUint16(16,!0);return{width:o,height:r}}catch(n){console.warn(`Failed to parse special image format: ${e}`,n)}return{width:0,height:0}}packUint32(e){const t=new Uint8Array(4);return t[0]=e&255,t[1]=e>>8&255,t[2]=e>>16&255,t[3]=e>>24&255,t}packUint16(e){const t=new Uint8Array(2);return t[0]=e&255,t[1]=e>>8&255,t}packString(e,t){const i=new Uint8Array(t),n=this.textEncoder.encode(e),o=Math.min(n.length,t);return i.set(n.slice(0,o),0),i}computeChecksum(e){let t=0;for(let i=0;i{const n=t.filename.split(".").pop()||"",o=i.filename.split(".").pop()||"";if(n!==o)return n.localeCompare(o);const r=t.filename.replace(/\.[^/.]+$/,""),g=i.filename.replace(/\.[^/.]+$/,"");return r.localeCompare(g)})}async generate(e=null){if(this.files.length===0)throw new Error("No files to package");e&&e(0,"Starting to package files...");const t=this.sortFiles(this.files),i=t.length,n=[];let o=0;for(let m=0;m0||F.height>0)d=F.width,w=F.height;else{const N=c.filename.toLowerCase().split(".").pop();if(["png","jpg","jpeg","gif","bmp","webp"].includes(N)){const G=await this.getImageDimensions(c.data);d=G.width,w=G.height}}}n.push({filename:c.filename,data:c.data,size:c.size,offset:o,width:d,height:w}),o+=2+c.size}e&&e(40,"Building file mapping table...");const r=i*44,g=new Uint8Array(r);let s=0;for(const m of n)g.set(this.packString(m.filename,32),s),s+=32,g.set(this.packUint32(m.size),s),s+=4,g.set(this.packUint32(m.offset),s),s+=4,g.set(this.packUint16(m.width),s),s+=2,g.set(this.packUint16(m.height),s),s+=2;e&&e(60,"Merging file data...");const a=new Uint8Array(o);let I=0;for(let m=0;m0?Math.round(e/this.files.length):0}}printFileList(){if(console.log("=== Packaged File List ==="),console.log(`Total files: ${this.files.length}`),this.files.length===0){console.log("No files available");return}this.sortFiles(this.files).forEach((i,n)=>{var s;const o=((s=i.filename.split(".").pop())==null?void 0:s.toLowerCase())||"unknown",r=(i.size/1024).toFixed(2),g=i.width&&i.height?`${i.width}x${i.height}`:"N/A";console.log(`${String(n+1).padStart(3," ")}. ${i.filename}`),console.log(` Type: ${o.toUpperCase()}`),console.log(` Size: ${r} KB (${i.size} bytes)`),console.log(` Dimensions: ${g}`),console.log("")});const t=this.getStats();console.log("=== File Statistics ==="),console.log(`Total size: ${(t.totalSize/1024).toFixed(2)} KB`),console.log(`Average size: ${(t.averageFileSize/1024).toFixed(2)} KB`),console.log("File type distribution:"),Object.entries(t.fileTypes).forEach(([i,n])=>{console.log(` ${i.toUpperCase()}: ${n} files`)})}clear(){this.files=[]}}let Jn={tool:{workerLocalUrl:`var gifsicle=function(){Me="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0,"undefined"!=typeof __filename&&(Me=Me||__filename);var Me,c=function(e){var j,r,h=void 0!==(e=e||{})?e:{},t=(h.ready=new Promise(function(e,r){j=e}),h.preRun=h.preRun||[],h.preRun.push(function(){if(h.folder&&h.folder.length)for(let e=0;e>10,56320|1023&s)))):i+=String.fromCharCode(u)}return i}function W(e,r){return e?g(E,e,r):""}function X(e,r,t,n){if(!(0>6,r[t++]=128|63&s}else if(s<=65535){if(i<=t+2)break;r[t++]=224|s>>12,r[t++]=128|s>>6&63,r[t++]=128|63&s}else{if(i<=t+3)break;r[t++]=240|s>>18,r[t++]=128|s>>12&63,r[t++]=128|s>>6&63,r[t++]=128|63&s}}return r[t]=0,t-o}function G(e){for(var r=0,t=0;t>2]=e}var x={splitPath:function(e){return/^(\\/?|)([\\s\\S]*?)((?:\\.{1,2}|[^\\/]+?|)(\\.[^.\\/]*|))(?:[\\/]*)$/.exec(e).slice(1)},normalizeArray:function(e,r){for(var t=0,n=e.length-1;0<=n;n--){var o=e[n];"."===o?e.splice(n,1):".."===o?(e.splice(n,1),t++):t&&(e.splice(n,1),t--)}if(r)for(;t;t--)e.unshift("..");return e},normalize:function(e){var r="/"===e.charAt(0),t="/"===e.substr(-1);return(e=(e=x.normalizeArray(e.split("/").filter(function(e){return!!e}),!r).join("/"))||r?e:".")&&t&&(e+="/"),(r?"/":"")+e},dirname:function(e){var e=x.splitPath(e),r=e[0],e=e[1];return r||e?r+(e=e&&e.substr(0,e.length-1)):"."},basename:function(e){if("/"===e)return"/";var r=e.lastIndexOf("/");return-1===r?e:e.substr(r+1)},extname:function(e){return x.splitPath(e)[3]},join:function(){var e=Array.prototype.slice.call(arguments,0);return x.normalize(e.join("/"))},join2:function(e,r){return x.normalize(e+"/"+r)}},R={resolve:function(){for(var e="",r=!1,t=arguments.length-1;-1<=t&&!r;t--){var n=0<=t?arguments[t]:T.cwd();if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");if(!n)return"";e=n+"/"+e,r="/"===n.charAt(0)}return(r?"/":"")+(e=x.normalizeArray(e.split("/").filter(function(e){return!!e}),!r).join("/"))||"."},relative:function(e,r){function t(e){for(var r=0;r>>0),0!=t&&(r=Math.max(r,256)),t=e.contents,e.contents=new Uint8Array(r),0r)e.contents.length=r;else for(;e.contents.length=e.node.usedBytes)return 0;var a=Math.min(e.node.usedBytes-o,n);if(8>>0)%T.nameTable.length},hashAddNode:function(e){var r=T.hashName(e.parent.id,e.name);e.name_next=T.nameTable[r],T.nameTable[r]=e},hashRemoveNode:function(e){var r=T.hashName(e.parent.id,e.name);if(T.nameTable[r]===e)T.nameTable[r]=e.name_next;else for(var t=T.nameTable[r];t;){if(t.name_next===e){t.name_next=e.name_next;break}t=t.name_next}},lookupNode:function(e,r){var t=T.mayLookup(e);if(t)throw new T.ErrnoError(t,e);for(var t=T.hashName(e.id,r),n=T.nameTable[t];n;n=n.name_next){var o=n.name;if(n.parent.id===e.id&&o===r)return n}return T.lookup(e,r)},createNode:function(e,r,t,n){e=new T.FSNode(e,r,t,n);return T.hashAddNode(e),e},destroyNode:function(e){T.hashRemoveNode(e)},isRoot:function(e){return e===e.parent},isMountpoint:function(e){return!!e.mounted},isFile:function(e){return 32768==(61440&e)},isDir:function(e){return 16384==(61440&e)},isLink:function(e){return 40960==(61440&e)},isChrdev:function(e){return 8192==(61440&e)},isBlkdev:function(e){return 24576==(61440&e)},isFIFO:function(e){return 4096==(61440&e)},isSocket:function(e){return 49152==(49152&e)},flagModes:{r:0,rs:1052672,"r+":2,w:577,wx:705,xw:705,"w+":578,"wx+":706,"xw+":706,a:1089,ax:1217,xa:1217,"a+":1090,"ax+":1218,"xa+":1218},modeStringToFlags:function(e){var r=T.flagModes[e];if(void 0===r)throw new Error("Unknown file open mode: "+e);return r},flagsToPermissionString:function(e){var r=["r","w","rw"][3&e];return 512&e&&(r+="w"),r},nodePermissions:function(e,r){return T.ignorePermissions||(-1===r.indexOf("r")||292&e.mode)&&(-1===r.indexOf("w")||146&e.mode)&&(-1===r.indexOf("x")||73&e.mode)?0:2},mayLookup:function(e){var r=T.nodePermissions(e,"x");return r||(e.node_ops.lookup?0:2)},mayCreate:function(e,r){try{T.lookupNode(e,r);return 20}catch(e){}return T.nodePermissions(e,"wx")},mayDelete:function(e,r,t){var n;try{n=T.lookupNode(e,r)}catch(e){return e.errno}r=T.nodePermissions(e,"wx");if(r)return r;if(t){if(!T.isDir(n.mode))return 54;if(T.isRoot(n)||T.getPath(n)===T.cwd())return 10}else if(T.isDir(n.mode))return 31;return 0},mayOpen:function(e,r){return e?T.isLink(e.mode)?32:T.isDir(e.mode)&&("r"!==T.flagsToPermissionString(r)||512&r)?31:T.nodePermissions(e,T.flagsToPermissionString(r)):44},MAX_OPEN_FDS:4096,nextfd:function(e,r){r=r||T.MAX_OPEN_FDS;for(var t=e=e||0;t<=r;t++)if(!T.streams[t])return t;throw new T.ErrnoError(33)},getStream:function(e){return T.streams[e]},createStream:function(e,r,t){T.FSStream||(T.FSStream=function(){},T.FSStream.prototype={object:{get:function(){return this.node},set:function(e){this.node=e}},isRead:{get:function(){return 1!=(2097155&this.flags)}},isWrite:{get:function(){return 0!=(2097155&this.flags)}},isAppend:{get:function(){return 1024&this.flags}}});var n,o=new T.FSStream;for(n in e)o[n]=e[n];e=o;r=T.nextfd(r,t);return e.fd=r,T.streams[r]=e},closeStream:function(e){T.streams[e]=null},chrdev_stream_ops:{open:function(e){var r=T.getDevice(e.node.rdev);e.stream_ops=r.stream_ops,e.stream_ops.open&&e.stream_ops.open(e)},llseek:function(){throw new T.ErrnoError(70)}},major:function(e){return e>>8},minor:function(e){return 255&e},makedev:function(e,r){return e<<8|r},registerDevice:function(e,r){T.devices[e]={stream_ops:r}},getDevice:function(e){return T.devices[e]},getMounts:function(e){for(var r=[],t=[e];t.length;){var n=t.pop();r.push(n),t.push.apply(t,n.mounts)}return r},syncfs:function(r,t){"function"==typeof r&&(t=r,r=!1),T.syncFSRequests++,1=n.length&&i(null)}n.forEach(function(e){if(!e.type.syncfs)return a(null);e.type.syncfs(e,r,a)})},mount:function(e,r,t){var n,o="/"===t,i=!t;if(o&&T.root)throw new T.ErrnoError(10);if(!o&&!i){i=T.lookupPath(t,{follow_mount:!1});if(t=i.path,n=i.node,T.isMountpoint(n))throw new T.ErrnoError(10);if(!T.isDir(n.mode))throw new T.ErrnoError(54)}i={type:e,opts:r,mountpoint:t,mounts:[]},r=e.mount(i);return(r.mount=i).root=r,o?T.root=r:n&&(n.mounted=i,n.mount&&n.mount.mounts.push(i)),r},unmount:function(e){e=T.lookupPath(e,{follow_mount:!1});if(!T.isMountpoint(e.node))throw new T.ErrnoError(28);var e=e.node,r=e.mounted,n=T.getMounts(r),r=(Object.keys(T.nameTable).forEach(function(e){for(var r=T.nameTable[e];r;){var t=r.name_next;-1!==n.indexOf(r.mount)&&T.destroyNode(r),r=t}}),e.mounted=null,e.mount.mounts.indexOf(r));e.mount.mounts.splice(r,1)},lookup:function(e,r){return e.node_ops.lookup(e,r)},mknod:function(e,r,t){var n=T.lookupPath(e,{parent:!0}).node,e=x.basename(e);if(!e||"."===e||".."===e)throw new T.ErrnoError(28);var o=T.mayCreate(n,e);if(o)throw new T.ErrnoError(o);if(n.node_ops.mknod)return n.node_ops.mknod(n,e,r,t);throw new T.ErrnoError(63)},create:function(e,r){return T.mknod(e,r=(r=void 0!==r?r:438)&4095|32768,0)},mkdir:function(e,r){return T.mknod(e,r=(r=void 0!==r?r:511)&1023|16384,0)},mkdirTree:function(e,r){for(var t=e.split("/"),n="",o=0;othis.length-1||e<0))return r=e%this.chunkSize,e=e/this.chunkSize|0,this.getter(e)[r]},o.prototype.setDataGetter=function(e){this.getter=e},o.prototype.cacheLength=function(){var e=new XMLHttpRequest;if(e.open("HEAD",a,!1),e.send(null),!(200<=e.status&&e.status<300||304===e.status))throw new Error("Couldn't load "+a+". Status: "+e.status);var r,n=Number(e.getResponseHeader("Content-length")),t=(r=e.getResponseHeader("Accept-Ranges"))&&"bytes"===r,e=(r=e.getResponseHeader("Content-Encoding"))&&"gzip"===r,o=1048576,i=(t||(o=n),this);i.setDataGetter(function(e){var r=e*o,t=(e+1)*o-1,t=Math.min(t,n-1);if(void 0===i.chunks[e]&&(i.chunks[e]=function(e,r){if(r=i.length)return 0;var a=Math.min(i.length-o,n);if(i.slice)for(var s=0;s>2]=n.dev,k[t+4>>2]=0,k[t+8>>2]=n.ino,k[t+12>>2]=n.mode,k[t+16>>2]=n.nlink,k[t+20>>2]=n.uid,k[t+24>>2]=n.gid,k[t+28>>2]=n.rdev,k[t+32>>2]=0,F=[n.size>>>0,(S=n.size,1<=+ne(S)?0>>0:~~+oe((S-(~~S>>>0))/4294967296)>>>0:0)],k[t+40>>2]=F[0],k[t+44>>2]=F[1],k[t+48>>2]=4096,k[t+52>>2]=n.blocks,k[t+56>>2]=n.atime.getTime()/1e3|0,k[t+60>>2]=0,k[t+64>>2]=n.mtime.getTime()/1e3|0,k[t+68>>2]=0,k[t+72>>2]=n.ctime.getTime()/1e3|0,k[t+76>>2]=0,F=[n.ino>>>0,(S=n.ino,1<=+ne(S)?0>>0:~~+oe((S-(~~S>>>0))/4294967296)>>>0:0)],k[t+80>>2]=F[0],k[t+84>>2]=F[1],0},doMsync:function(e,r,t,n,o){e=E.slice(e,e+t);T.msync(r,e,o,t,n)},doMkdir:function(e,r){return"/"===(e=x.normalize(e))[e.length-1]&&(e=e.substr(0,e.length-1)),T.mkdir(e,r,0),0},doMknod:function(e,r,t){switch(61440&r){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}return T.mknod(e,r,t),0},doReadlink:function(e,r,t){if(t<=0)return-28;var e=T.readlink(e),n=Math.min(t,G(e)),o=y[r+n];return X(e,E,r,t+1),y[r+n]=o,n},doAccess:function(e,r){if(-8&r)return-28;e=T.lookupPath(e,{follow:!0}).node;if(!e)return-44;var t="";return 4&r&&(t+="r"),2&r&&(t+="w"),1&r&&(t+="x"),t&&T.nodePermissions(e,t)?-2:0},doDup:function(e,r,t){var n=T.getStream(t);return n&&T.close(n),T.open(e,r,0,t,t).fd},doReadv:function(e,r,t,n){for(var o=0,i=0;i>2],s=k[r+(8*i+4)>>2],a=T.read(e,y,a,s,n);if(a<0)return-1;if(o+=a,a>2],s=k[r+(8*i+4)>>2],a=T.write(e,y,a,s,n);if(a<0)return-1;o+=a}return o},varargs:void 0,get:function(){return N.varargs+=4,k[N.varargs-4>>2]},getStr:function(e){return W(e)},getStreamFromFD:function(e){e=T.getStream(e);if(e)return e;throw new T.ErrnoError(8)},get64:function(e,r){return e}};var ge={};function z(){if(!z.strings){var 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",_:C||"./this.program"};for(r in ge)e[r]=ge[r];var r,t=[];for(r in e)t.push(r+"="+e[r]);z.strings=t}return z.strings}function ve(e,r,t,n){this.parent=e=e||this,this.mount=e.mount,this.mounted=null,this.id=T.nextInode++,this.name=r,this.mode=t,this.node_ops={},this.stream_ops={},this.rdev=n}function ye(e,r,t){t=0>2]=t/1e3|0,k[r+4>>2]=t%1e3*1e3*1e3|0,0},d:function(e,r,t){N.varargs=t;try{var n=N.getStreamFromFD(e);switch(r){case 0:return(o=N.get())<0?-28:T.open(n.path,n.flags,0,o).fd;case 1:case 2:return 0;case 3:return n.flags;case 4:var o=N.get();return n.flags|=o,0;case 12:o=N.get();return K[o+0>>1]=2,0;case 13:case 14:return 0;case 16:case 8:return-28;case 9:return A(28),-1;default:return-28}}catch(e){return void 0!==T&&e instanceof T.ErrnoError||D(e),-e.errno}},i:function(e,r,t){N.varargs=t;try{var n=N.getStreamFromFD(e);switch(r){case 21509:case 21505:return n.tty?0:-59;case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:return n.tty?0:-59;case 21519:if(!n.tty)return-59;var o=N.get();return k[o>>2]=0;case 21520:return n.tty?-28:-59;case 21531:o=N.get();return T.ioctl(n,r,o);case 21523:case 21524:return n.tty?0:-59;default:D("bad ioctl syscall "+r)}}catch(e){return void 0!==T&&e instanceof T.ErrnoError||D(e),-e.errno}},e:function(e,r,t){N.varargs=t;try{var n=N.getStr(e),o=N.get();return T.open(n,r,o).fd}catch(e){return void 0!==T&&e instanceof T.ErrnoError||D(e),-e.errno}},t:function(e){try{return e=N.getStr(e),T.rmdir(e),0}catch(e){return void 0!==T&&e instanceof T.ErrnoError||D(e),-e.errno}},j:function(e){try{var r=N.umask;return N.umask=e,r}catch(e){return void 0!==T&&e instanceof T.ErrnoError||D(e),-e.errno}},u:function(e){try{return e=N.getStr(e),T.unlink(e),0}catch(e){return void 0!==T&&e instanceof T.ErrnoError||D(e),-e.errno}},v:function(e,r,t,n){try{D("cannot wait on child processes")}catch(e){return void 0!==T&&e instanceof T.ErrnoError||D(e),-e.errno}},n:function(e,r,t){E.copyWithin(e,r,r+t)},b:function(e){var r=E.length,t=2147483648;if(t<(e>>>=0))return!1;for(var n,o=1;o<=4;o*=2){var i=r*(1+.2/o),i=Math.min(i,e+100663296);if(function(e){try{return p.grow(e-v.byteLength+65535>>>16),Y(p.buffer),1}catch(e){}}(Math.min(t,(0<(i=Math.max(16777216,e,i))%(n=65536)&&(i+=n-i%n),i))))return!0}return!1},p:function(a,s){var u=0;return z().forEach(function(e,r){for(var t=s+u,n=(k[a+4*r>>2]=t,e),o=t,r=void 0,i=0;i>0]=n.charCodeAt(i);r||(y[o>>0]=0),u+=e.length+1}),0},q:function(e,r){var t=z(),n=(k[e>>2]=t.length,0);return t.forEach(function(e){n+=e.length+1}),k[r>>2]=n,0},c:function(e){xe(e)},f:function(e){try{var r=N.getStreamFromFD(e);return T.close(r),0}catch(e){return void 0!==T&&e instanceof T.ErrnoError||D(e),e.errno}},r:function(e,r){try{var t=N.getStreamFromFD(e),n=t.tty?2:T.isDir(t.mode)?3:T.isLink(t.mode)?7:4;return y[r>>0]=n,0}catch(e){return void 0!==T&&e instanceof T.ErrnoError||D(e),e.errno}},h:function(e,r,t,n){try{var o=N.getStreamFromFD(e),i=N.doReadv(o,r,t);return k[n>>2]=i,0}catch(e){return void 0!==T&&e instanceof T.ErrnoError||D(e),e.errno}},m:function(e,r,t,n,o){try{var i=N.getStreamFromFD(e),a=4294967296*t+(r>>>0),s=9007199254740992;return a<=-s||s<=a?-61:(T.llseek(i,a,n),F=[i.position>>>0,(S=i.position,1<=+ne(S)?0>>0:~~+oe((S-(~~S>>>0))/4294967296)>>>0:0)],k[o>>2]=F[0],k[o+4>>2]=F[1],i.getdents&&0==a&&0===n&&(i.getdents=null),0)}catch(e){return void 0!==T&&e instanceof T.ErrnoError||D(e),e.errno}},g:function(e,r,t,n){try{var o=N.getStreamFromFD(e),i=N.doWritev(o,r,t);return k[n>>2]=i,0}catch(e){return void 0!==T&&e instanceof T.ErrnoError||D(e),e.errno}},memory:p,o:function(){w("missing function: popen"),D(-1)},l:function(){return 6},k:function(){},table:I},_e=(!function(){var r={a:ke};function t(e,r){e=e.exports;h.asm=e,ue()}function n(e){t(e.instance)}function o(e){return(l||!L&&!c||"function"!=typeof fetch||de(P)?new Promise(function(e,r){e(pe())}):fetch(P,{credentials:"same-origin"}).then(function(e){if(e.ok)return e.arrayBuffer();throw"failed to load wasm binary file at '"+P+"'"}).catch(pe)).then(function(e){return WebAssembly.instantiate(e,r)}).then(e,function(e){w("failed to asynchronously prepare wasm: "+e),D(e)})}if(se(),h.instantiateWasm)try{h.instantiateWasm(r,t);return}catch(e){return w("Module.instantiateWasm callback failed with error: "+e)}l||"function"!=typeof WebAssembly.instantiateStreaming||ce(P,fe)||de(P)||"function"!=typeof fetch?o(n):fetch(P,{credentials:"same-origin"}).then(function(e){return WebAssembly.instantiateStreaming(e,r).then(n,function(e){return w("wasm streaming compile failed: "+e),w("falling back to ArrayBuffer instantiation"),o(n)})})}(),h.___wasm_call_ctors=function(){return(_e=h.___wasm_call_ctors=h.asm.w).apply(null,arguments)}),be=h._malloc=function(){return(be=h._malloc=h.asm.x).apply(null,arguments)},De=h.___errno_location=function(){return(De=h.___errno_location=h.asm.y).apply(null,arguments)},Se=(h._main=function(){return(h._main=h.asm.z).apply(null,arguments)},h.stackAlloc=function(){return(Se=h.stackAlloc=h.asm.A).apply(null,arguments)});function Fe(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}function Pe(r){var t=h._main;r=r||[];try{for(let e=0;e>2]=V(C);for(var n=1;n>2)+n]=V(e[n-1]);return k[(t>>2)+r]=0,{argc:r,argv:t}}(s.split(" ").filter(e=>Boolean(e)));if(0!==(n=t(o,i)))break}xe(n,!0)}catch(e){if(e instanceof Fe)return;if("unwind"==e)return void(d=!0);var a=e;e&&"object"==typeof e&&e.stack&&(a=[e,e.stack]),w("exception thrown: "+a),u(1,e)}}function Ae(e){function r(){Ee||(Ee=!0,h.calledRun=!0,U||(h.noFSInit||T.init.initialized||T.init(),Z(J),T.ignorePermissions=!1,Z(Q),j(h),h.onRuntimeInitialized&&h.onRuntimeInitialized(),Re&&Pe(e),te()))}e=e||a,0<_||(re(),0<_||(h.setStatus?(h.setStatus("Running..."),setTimeout(function(){setTimeout(function(){h.setStatus("")},1),r()},1)):r()))}function xe(e,r){r&&d&&0===e||(d||(U=!0,h.onExit&&h.onExit(e)),u(e,new Fe(e)))}if(h.dynCall_vi=function(){return(h.dynCall_vi=h.asm.B).apply(null,arguments)},b=function e(){Ee||Ae(),Ee||(b=e)},h.run=Ae,h.preInit)for("function"==typeof h.preInit&&(h.preInit=[h.preInit]);0{0{t+=String.fromCharCode(e),10===e&&(console.error(t),t="")},stdout:e=>{r+=String.fromCharCode(e),10===e&&(console.log(r),r="")}};const l=[];return async(e={})=>{let{data:i=null,command:a=[],folder:s=[],isStrict:u=!1}=e;return await new Promise(e=>{l.push(e),1===l.length&&l[0]()}),new Promise((r,t)=>{let n=!1,o="";c({stdout:f.stdout,stderr:e=>{o+=String.fromCharCode(e),10===e&&(console.error(o),u&&t(o))},arguments:a,input:i,folder:s,output:e=>{r(e),n=!0}}).then(()=>{(0,f.flush)(),n||t(),0{var e=await gifsicle(r.data).catch(e=>{postMessage(e)});postMessage(e)})().catch(e=>{postMessage(null)})};`,workerBlobUrl:"",worker(){return this.workerBlobUrl||(this.workerLocalUrl?this.workerBlobUrl=URL.createObjectURL(new Blob([this.workerLocalUrl])):this.workerBlobUrl="../src/worker.js",this.workerBlobUrl)},errorLink(){return` - Check: https://github.com/renzhezhilu/gifsicle-wasm-browser`},testType(A){return A instanceof Element?"element":Object.prototype.toString.call(A).replace(/\[object\s(.+)\]/,"$1").toLowerCase()},async textToUrl(A){return this.worker()},loadCommand(A){var e=this.testType(A);if(A.length===0)throw" the content can not be blank"+this.errorLink();if(e==="array")return A.map(t=>t.replace(/\n/gi," "));throw" types:"+e+", must be an array"+this.errorLink()},loadOne(A){return new Promise(async(e,t)=>{var i=this.testType(A);if(["string"].includes(i))fetch(A).then(n=>{if(n.status!==200)throw"<"+A+"> Url error!!!"+this.errorLink();return n.arrayBuffer()}).then(n=>e(n));else if(["blob","file"].includes(i))new Response(A).arrayBuffer().then(n=>e(n));else{if(!["arraybuffer"].includes(i))throw" types:"+i+", only supports Url, blob, file, arraybuffer"+this.errorLink();e(A)}})},loadFile(A){return new Promise(async(e,t)=>{var i=this.testType(A);if(i!=="array")throw" types:"+i+", only supports Array"+this.errorLink();if(A.length===0)throw" the content can not be blank"+this.errorLink();i=A.map(n=>this.loadOne(n.file)),Promise.all(i).then(function(n){var o=A.map((r,g)=>(r.file=n[g],r));e(o)}).catch(function(n){})})},loadFolder(A){return new Promise(async(e,t)=>{var i=this.testType(A);if(!["array"].includes(i))throw" types:"+i+", only supports Array"+this.errorLink();e(A)})}},run(A={}){return new Promise(async(e,t)=>{let{input:i=[],command:n="",folder:o=[],isStrict:r=!1,start:g=Q=>{}}=A;var s=await this.tool.textToUrl();let a=new Worker(s);var I=this.tool.loadCommand(n),l=await this.tool.loadFile(i),C=(g(l),await this.tool.loadFolder(o));a.postMessage({data:l,command:I,folder:C,isStrict:r}),a.onmessage=async function(Q){if(!Q.data||typeof Q.data=="string")return a.terminate(),void t(Q.data);let h=[];for(let u=0;u=0&&I.push(`--loopcount=${s}`),g&&g>0&&I.push(`--lossy=${g}`),r&&I.push(`-O${this.optimizationLevel}`),I.push("1.gif"),I.push("-o /out/output.gif");const l=I.join(" ");this.debug&&(console.log("GIF 缩放命令:",l),console.log("输入文件大小:",e.size||"未知"));const C=await Jn.run({input:[{file:e,name:"1.gif"}],command:[l]});if(!C||C.length===0)throw new Error("gifsicle 处理失败,未返回结果");const Q=C[0];if(this.debug&&(console.log("GIF 缩放完成"),console.log("输出文件大小:",Q.size),e.size)){const h=((1-Q.size/e.size)*100).toFixed(2);console.log(`压缩率: ${h}%`)}return new Blob([Q],{type:"image/gif"})}catch(a){throw console.error("GIF 缩放失败:",a),new Error(`GIF 缩放失败: ${a.message}`)}}async scaleGifBatch(e){const t=[];for(let i=0;i=0&&r.push(`--loopcount=${o}`),i&&i>0&&r.push(`--lossy=${i}`),r.push(`-O${n}`),r.push("1.gif"),r.push("-o /out/output.gif");const g=r.join(" ");this.debug&&console.log("GIF 优化命令:",g);const s=await Jn.run({input:[{file:e,name:"1.gif"}],command:[g]});if(!s||s.length===0)throw new Error("gifsicle 优化失败");return new Blob([s[0]],{type:"image/gif"})}catch(r){throw console.error("GIF 优化失败:",r),new Error(`GIF 优化失败: ${r.message}`)}}async getGifInfo(e){try{const t=await Jn.run({input:[{file:e,name:"1.gif"}],command:["--info 1.gif -o /out/info.txt"]});if(!t||t.length===0)throw new Error("无法获取 GIF 信息");const n=await t[0].text();return this.parseGifInfo(n)}catch(t){return console.error("获取 GIF 信息失败:",t),{size:e.size||0,type:"image/gif"}}}parseGifInfo(e){const t={frames:0,width:0,height:0,colors:0,loopCount:0};try{const i=e.match(/(\d+) images?/);i&&(t.frames=parseInt(i[1]));const n=e.match(/logical screen (\d+)x(\d+)/);n&&(t.width=parseInt(n[1]),t.height=parseInt(n[2]));const o=e.match(/(\d+) colors/);if(o&&(t.colors=parseInt(o[1])),e.includes("loop forever"))t.loopCount=0;else{const r=e.match(/loop count (\d+)/);r&&(t.loopCount=parseInt(r[1]))}}catch(i){console.warn("解析 GIF 信息时出错:",i)}return t}async cropGif(e,t){const{x:i,y:n,width:o,height:r}=t;try{const g=["-U",`--crop ${i},${n}+${o}x${r}`,"1.gif","-o /out/output.gif"].join(" ");this.debug&&console.log("GIF 裁剪命令:",g);const s=await Jn.run({input:[{file:e,name:"1.gif"}],command:[g]});if(!s||s.length===0)throw new Error("gifsicle 裁剪失败");return new Blob([s[0]],{type:"image/gif"})}catch(g){throw console.error("GIF 裁剪失败:",g),new Error(`GIF 裁剪失败: ${g.message}`)}}dispose(){this.debug&&console.log("WasmGifScaler disposed")}setDebug(e){this.debug=e}setQuality(e){if(e<1||e>200)throw new Error("质量参数必须在 1-200 之间");this.quality=e}setOptimizationLevel(e){if(e<1||e>3)throw new Error("优化级别必须在 1-3 之间");this.optimizationLevel=e}}class _l{constructor(){this.config=null,this.resources=new Map,this.tempFiles=[],this.fontConverterBrowser=rS,this.convertedFonts=new Map,this.wakenetPacker=new gS,this.spiffsGenerator=new sS,this.gifScaler=new aS({quality:30,debug:!0,scalingMode:"auto",optimize:!0,optimizationLevel:2}),this.configStorage=Qe,this.autoSaveEnabled=!0}setConfig(e,t={}){if(((t==null?void 0:t.strict)??!0)&&!this.validateConfig(e))throw new Error("Configuration object validation failed");return this.config={...e},this}validateConfig(e){var n,o,r;if(!e)return!1;if(!((n=e.chip)!=null&&n.model))return console.error("Missing chip model configuration"),!1;const t=e.chip.display;if(!(t!=null&&t.width)||!(t!=null&&t.height))return console.error("Missing display resolution configuration"),!1;const i=(o=e.theme)==null?void 0:o.font;return(i==null?void 0:i.type)==="preset"&&!i.preset?(console.error("Preset font configuration is incomplete"),!1):(i==null?void 0:i.type)==="custom"&&!((r=i.custom)!=null&&r.file)?(console.error("Custom font file not provided"),!1):!0}addResource(e,t,i,n="other"){return this.resources.set(e,{file:t,filename:i,size:t.size,type:t.type,lastModified:t.lastModified||Date.now(),resourceType:n}),this.autoSaveEnabled&&t instanceof File&&this.saveFileToStorage(e,t,n).catch(o=>{console.warn(`Auto-saving file ${i} failed:`,o)}),this}async saveFileToStorage(e,t,i){try{await this.configStorage.saveFile(e,t,i),console.log(`File ${t.name} auto-saved to storage`)}catch(n){throw console.error(`Failed to save file to storage: ${t.name}`,n),n}}async restoreResourceFromStorage(e){try{const t=await this.configStorage.loadFile(e);return t?(this.resources.set(e,{file:t,filename:t.name,size:t.size,type:t.type,lastModified:t.lastModified,resourceType:t.storedType,fromStorage:!0}),console.log(`Resource ${e} restored from storage successfully: ${t.name}`),!0):!1}catch(t){return console.error(`Failed to restore resource from storage: ${e}`,t),!1}}async restoreAllResourcesFromStorage(e){var i,n,o,r,g,s,a,I,l,C,Q;if(!e)return;const t=[];if((n=(i=e.theme)==null?void 0:i.font)!=null&&n.custom&&((o=e.theme.font.custom)==null?void 0:o.file)===null){const h="custom_font";if(await this.restoreResourceFromStorage(h)){const f=this.resources.get(h);f&&(e.theme.font.custom.file=f.file,t.push(`Custom font: ${f.filename}`),console.log(`Custom font restored even when type is '${e.theme.font.type}'`))}}if(((g=(r=e.theme)==null?void 0:r.emoji)==null?void 0:g.type)==="custom"&&e.theme.emoji.custom){const h=e.theme.emoji.custom,f=h.emotionMap||{},u=h.fileMap||{},E=h.images||{};if(Object.keys(f).length>0||Object.keys(u).length>0){const m=new Set;for(const c of Object.keys(u))u[c]===null&&m.add(c);for(const c of m){let d=`hash_${c}`,w=await this.restoreResourceFromStorage(d);if(!w){const F=`emoji_hash_${c}`;w=await this.restoreResourceFromStorage(F),w&&(d=F)}if(w){const F=this.resources.get(d);if(F){u[c]=F.file;const N=Object.entries(f).filter(([G,K])=>K===c).map(([G,K])=>G);N.forEach(G=>{E[G]=F.file}),t.push(`Emoji file ${c.substring(0,8)}... (used for: ${N.join(", ")})`)}}}Object.keys(u).forEach(c=>{e.theme.emoji.custom.fileMap[c]=u[c]}),Object.keys(E).forEach(c=>{e.theme.emoji.custom.images[c]=E[c]})}else{for(const[m,c]of Object.entries(E))if(c===null){const d=`emoji_${m}`;if(await this.restoreResourceFromStorage(d)){const w=this.resources.get(d);w&&(E[m]=w.file,t.push(`Emoji ${m}: ${w.filename}`))}}e.theme.emoji.custom.images=E}}if(((I=(a=(s=e.theme)==null?void 0:s.skin)==null?void 0:a.light)==null?void 0:I.backgroundType)==="image"&&e.theme.skin.light.backgroundImage===null){const h="background_light";if(await this.restoreResourceFromStorage(h)){const f=this.resources.get(h);f&&(e.theme.skin.light.backgroundImage=f.file,t.push(`Light background: ${f.filename}`))}}if(((Q=(C=(l=e.theme)==null?void 0:l.skin)==null?void 0:C.dark)==null?void 0:Q.backgroundType)==="image"&&e.theme.skin.dark.backgroundImage===null){const h="background_dark";if(await this.restoreResourceFromStorage(h)){const f=this.resources.get(h);f&&(e.theme.skin.dark.backgroundImage=f.file,t.push(`Dark background: ${f.filename}`))}}try{const h=this.getFontInfo();if(h&&h.type==="custom"){const f=`converted_font_${h.filename}`,u=await this.configStorage.loadTempData(f);u&&(this.convertedFonts.set(h.filename,u.data),console.log(`Converted font data restored: ${h.filename}`))}}catch(h){console.warn("Error restoring converted font data:",h)}t.length>0&&console.log("Files restored from storage:",t)}getWakewordModelInfo(){if(!this.config||!this.config.chip||!this.config.theme)return null;const e=this.config.chip.model,t=this.config.theme.wakeword;return!t||t.type==="none"?null:t.type==="preset"?{type:e==="esp32c3"||e==="esp32c6"?"WakeNet9s":"WakeNet9",name:t.preset,filename:"srmodels.bin"}:t.type==="custom"?{type:"MultiNet",name:t.custom.model,filename:"srmodels.bin",custom:t.custom}:null}getFontInfo(){if(!this.config||!this.config.theme||!this.config.theme.font)return null;const e=this.config.theme.font;if(e.type==="preset")return{type:"preset",filename:`${e.preset}.bin`,source:e.preset};if(e.type==="custom"&&e.custom.file){const t=e.custom;return{type:"custom",filename:`font_custom_${t.size}_${t.bpp}.bin`,source:e.custom.file,config:{size:t.size,bpp:t.bpp,charset:t.charset}}}return null}getEmojiCollectionInfo(){if(!this.config||!this.config.theme||!this.config.theme.emoji)return[];const e=this.config.theme.emoji,t=[];if(e.type==="preset"){const i=["neutral","happy","laughing","funny","sad","angry","crying","loving","embarrassed","surprised","shocked","thinking","winking","cool","relaxed","delicious","kissy","confident","sleepy","silly","confused"],n=e.preset==="twemoji32"?"32":"64";i.forEach(o=>{t.push({name:o,file:`${o}.png`,source:`preset:${e.preset}`,size:{width:parseInt(n),height:parseInt(n)}})})}else if(e.type==="custom"){e.custom.images;const i=e.custom.emotionMap||{},n=e.custom.fileMap||{},o=e.custom.size||{width:64,height:64};if(Object.keys(i).length===0||Object.keys(n).length===0)throw console.error("❌ Error: Detected old version of emoji data structure"),console.error("Please clear browser cache or reset configuration, then re-upload emoji images"),new Error("Incompatible emoji data structure: Missing fileMap or emotionMap. Please reconfigure emojis.");const r=new Map;Object.entries(i).forEach(([g,s])=>{const a=n[s];if(a){if(!r.has(s)){const l=a.name?a.name.split(".").pop().toLowerCase():"png",C=`emoji_${s.substring(0,8)}.${l}`;r.set(s,C)}const I=r.get(s);t.push({name:g,file:I,source:a,fileHash:s,size:{...o}})}}),console.log(`Emoji deduplication: ${Object.keys(i).length} emojis using ${r.size} different image files`),t.find(g=>g.name==="neutral")||console.warn("Warning: neutral emoji not provided, default image will be used")}return t}getSkinInfo(){if(!this.config||!this.config.theme||!this.config.theme.skin)return{};const e=this.config.theme.skin,t={};return e.light&&(t.light={text_color:e.light.textColor||"#000000",background_color:e.light.backgroundColor||"#ffffff"},e.light.backgroundType==="image"&&e.light.backgroundImage&&(t.light.background_image="background_light.raw")),e.dark&&(t.dark={text_color:e.dark.textColor||"#ffffff",background_color:e.dark.backgroundColor||"#121212"},e.dark.backgroundType==="image"&&e.dark.backgroundImage&&(t.dark.background_image="background_dark.raw")),t}generateIndexJson(){if(!this.config)throw new Error("Configuration object not set");const e={version:1,chip_model:this.config.chip.model,hide_subtitle:this.config.theme.font.hide_subtitle||!1,display_config:{width:this.config.chip.display.width,height:this.config.chip.display.height,monochrome:!1,color:this.config.chip.display.color||"RGB565"}},t=this.getWakewordModelInfo();if(t&&(e.srmodels=t.filename,t.type==="MultiNet"&&t.custom)){const r=t.custom;e.multinet_model={language:r.model.includes("_en")?"en":"cn",duration:r.duration||3e3,threshold:r.threshold/100,commands:[{command:r.command,text:r.name,action:"wake"}]}}const i=this.getFontInfo();i&&(e.text_font=i.filename);const n=this.getSkinInfo();Object.keys(n).length>0&&(e.skin=n);const o=this.getEmojiCollectionInfo();return o.length>0&&(e.emoji_collection=o.map(r=>({name:r.name,file:r.file}))),e}preparePackageResources(){var g,s,a,I;const e={files:[],indexJson:this.generateIndexJson(),config:{...this.config}},t=this.getWakewordModelInfo();t&&t.name&&e.files.push({type:"wakeword",name:t.name,filename:t.filename,modelType:t.type,isCustom:t.type==="MultiNet"});const i=this.getFontInfo();i&&e.files.push({type:"font",filename:i.filename,source:i.source,config:i.config||null});const n=this.getEmojiCollectionInfo(),o=new Set;n.forEach(l=>{if(l.fileHash){if(o.has(l.fileHash)){console.log(`Skipping duplicate file: ${l.name} -> ${l.file} (hash: ${l.fileHash.substring(0,8)})`);return}o.add(l.fileHash)}e.files.push({type:"emoji",name:l.name,filename:l.file,source:l.source,size:l.size,fileHash:l.fileHash})});const r=(s=(g=this.config)==null?void 0:g.theme)==null?void 0:s.skin;return((a=r==null?void 0:r.light)==null?void 0:a.backgroundType)==="image"&&r.light.backgroundImage&&e.files.push({type:"background",filename:"background_light.raw",source:r.light.backgroundImage,mode:"light"}),((I=r==null?void 0:r.dark)==null?void 0:I.backgroundType)==="image"&&r.dark.backgroundImage&&e.files.push({type:"background",filename:"background_dark.raw",source:r.dark.backgroundImage,mode:"dark"}),e}async preprocessCustomFonts(e=null){const t=this.getFontInfo();if(t&&t.type==="custom"&&!this.convertedFonts.has(t.filename)){e&&e(20,"Converting custom font...");try{const i={fontFile:t.source,fontName:t.filename.replace(/\.bin$/,""),fontSize:t.config.size,bpp:t.config.bpp,charset:t.config.charset,symbols:t.config.symbols||"",range:t.config.range||"",compression:!1,progressCallback:(o,r)=>{e&&e(20+o*.2,`Font conversion: ${r}`)}};let n;if(await this.fontConverterBrowser.initialize(),n=await this.fontConverterBrowser.convertToCBIN(i),this.convertedFonts.set(t.filename,n),this.autoSaveEnabled){const o=`converted_font_${t.filename}`;try{await this.configStorage.saveTempData(o,n,"converted_font",{filename:t.filename,size:t.config.size,bpp:t.config.bpp,charset:t.config.charset}),console.log(`Converted font saved to storage: ${t.filename}`)}catch(r){console.warn(`Failed to save converted font: ${t.filename}`,r)}}}catch(i){throw console.error("Font conversion failed:",i),new Error(`Font conversion failed: ${i.message}`)}}}async generateAssetsBin(e=null){if(!this.config)throw new Error("Configuration object not set");try{e&&e(0,"Starting generation..."),await this.preprocessCustomFonts(e),await new Promise(n=>setTimeout(n,100)),e&&e(40,"Preparing resource files...");const t=this.preparePackageResources();this.wakenetPacker.clear(),this.spiffsGenerator.clear(),await this.processResourceFiles(t,e),await new Promise(n=>setTimeout(n,100)),e&&e(90,"Generating final file..."),this.spiffsGenerator.printFileList();const i=await this.spiffsGenerator.generate((n,o)=>{e&&e(90+n*.1,o)});return e&&e(100,"Generation completed"),new Blob([i],{type:"application/octet-stream"})}catch(t){throw console.error("Failed to generate assets.bin:",t),t}}downloadAssetsBin(e,t="assets.bin"){const i=URL.createObjectURL(e),n=document.createElement("a");n.href=i,n.download=t,document.body.appendChild(n),n.click(),document.body.removeChild(n),URL.revokeObjectURL(i)}async getFontInfoWithDetails(e=null){var t,i,n,o;try{const r=e||((o=(n=(i=(t=this.config)==null?void 0:t.theme)==null?void 0:i.font)==null?void 0:n.custom)==null?void 0:o.file);if(!r)return null;let g;return await this.fontConverterBrowser.initialize(),g=await this.fontConverterBrowser.getFontInfo(r),{...g,file:r,isCustom:!0}}catch(r){return console.error("Failed to get font details:",r),null}}async estimateFontSize(e=null){var t,i,n;try{const o=e||((n=(i=(t=this.config)==null?void 0:t.theme)==null?void 0:i.font)==null?void 0:n.custom);if(!o)return null;const r={fontSize:o.size,bpp:o.bpp,charset:o.charset,symbols:o.symbols||"",range:o.range||""};let g;return g=this.fontConverterBrowser.estimateSize(r),g}catch(o){return console.error("Failed to estimate font size:",o),null}}validateCustomFont(e){const t=[],i=[];return e.file?this.fontConverterBrowser.validateFont(e.file)||t.push("Font file format not supported"):t.push("Missing font file"),(e.size<8||e.size>80)&&t.push("Font size must be between 8-80"),[1,2,4,8].includes(e.bpp)||t.push("BPP must be 1, 2, 4 or 8"),!e.charset&&!e.symbols&&!e.range&&i.push("No charset, symbols or range specified, default charset will be used"),{valid:t.length===0,errors:t,warnings:i}}getConverterStatus(){return{initialized:this.fontConverterBrowser.initialized,supportedFormats:this.fontConverterBrowser.supportedFormats}}async processResourceFiles(e,t=null){let i=0;const n=e.files.length,o=new TextEncoder().encode(JSON.stringify(e.indexJson,null,2));console.log("index.json",e.indexJson),this.spiffsGenerator.addFile("index.json",o.buffer);for(const r of e.files){const g=40+i/n*40;t&&t(g,`Processing file: ${r.filename}`);try{await this.processResourceFile(r),i++}catch(s){throw console.error(`Failed to process resource file: ${r.filename}`,s),new Error(`Failed to process resource file: ${r.filename} - ${s.message}`)}}}async processResourceFile(e){switch(e.type){case"wakeword":await this.processWakewordModel(e);break;case"font":await this.processFontFile(e);break;case"emoji":await this.processEmojiFile(e);break;case"background":await this.processBackgroundFile(e);break;default:console.warn(`Unknown resource type: ${e.type}`)}}async processWakewordModel(e){if(!await this.wakenetPacker.loadModelFromShare(e.name))throw new Error(`Failed to load wakeword model: ${e.name}`);const i=this.wakenetPacker.packModels();this.spiffsGenerator.addFile(e.filename,i)}async processFontFile(e){if(e.config){const t=this.convertedFonts.get(e.filename);if(t)this.spiffsGenerator.addFile(e.filename,t);else throw new Error(`Converted font not found: ${e.filename}`)}else{const t=await this.loadPresetFont(e.source);this.spiffsGenerator.addFile(e.filename,t)}}async processEmojiFile(e){var r,g;let t,i=!1,n="png",o=!1;if(typeof e.source=="string"&&e.source.startsWith("preset:")){const s=e.source.replace("preset:","");t=await this.loadPresetEmoji(s,e.name)}else{const s=e.source;o=this.isGifFile(s),n=s.name.split(".").pop().toLowerCase();try{const I=await this.getImageDimensions(s),l=e.size||{width:64,height:64};(I.width>l.width||I.height>l.height)&&(i=!0,console.log(`Emoji ${e.name} needs scaling: ${I.width}x${I.height} -> ${l.width}x${l.height}`))}catch(I){console.warn(`Failed to get emoji image dimensions: ${e.name}`,I)}i||(t=await this.fileToArrayBuffer(s))}if(i)try{const s=e.size||{width:64,height:64};if(o){console.log(`Using WasmGifScaler to process GIF emoji: ${e.name}`);const a=await this.gifScaler.scaleGif(e.source,{maxWidth:s.width,maxHeight:s.height,keepAspectRatio:!0,lossy:30});t=await this.fileToArrayBuffer(a)}else t=await this.scaleImageToFit(e.source,s,n)}catch(s){console.error(`Failed to scale emoji image: ${e.name}`,s),t=await this.fileToArrayBuffer(e.source)}this.spiffsGenerator.addFile(e.filename,t,{width:((r=e.size)==null?void 0:r.width)||0,height:((g=e.size)==null?void 0:g.height)||0}),e.fileHash&&console.log(`Emoji file added: ${e.filename} (hash: ${e.fileHash.substring(0,8)})`)}async processBackgroundFile(e){const t=await this.fileToArrayBuffer(e.source),i=await this.convertImageToRgb565(t);this.spiffsGenerator.addFile(e.filename,i)}async loadPresetFont(e){try{const t=await fetch(`./static/fonts/${e}.bin`);if(!t.ok)throw new Error(`HTTP ${t.status}`);return await t.arrayBuffer()}catch(t){throw new Error(`Failed to load preset font: ${e} - ${t.message}`)}}async loadPresetEmoji(e,t){try{const i=await fetch(`./static/${e}/${t}.png`);if(!i.ok)throw new Error(`HTTP ${i.status}`);return await i.arrayBuffer()}catch(i){throw new Error(`Failed to load preset emoji: ${e}/${t} - ${i.message}`)}}fileToArrayBuffer(e){return new Promise((t,i)=>{const n=new FileReader;n.onload=()=>t(n.result),n.onerror=()=>i(new Error("Failed to read file")),n.readAsArrayBuffer(e)})}async scaleImageToFit(e,t,i="png"){return new Promise((n,o)=>{const r=e instanceof File?e:new Blob([e]),g=URL.createObjectURL(r),s=new Image;s.onload=()=>{try{const a=document.createElement("canvas"),I=a.getContext("2d");a.width=t.width,a.height=t.height;const l=s.width/s.height,C=t.width/t.height;let Q,h,f,u;l>C?(Q=t.width,h=t.width/l,f=0,u=(t.height-h)/2):(h=t.height,Q=t.height*l,f=(t.width-Q)/2,u=0),i==="png"?I.clearRect(0,0,a.width,a.height):(I.fillStyle="#FFFFFF",I.fillRect(0,0,a.width,a.height)),I.drawImage(s,f,u,Q,h),a.toBlob(E=>{const m=new FileReader;m.onload=()=>n(m.result),m.onerror=()=>o(new Error("Failed to convert image data")),m.readAsArrayBuffer(E)},`image/${i}`),URL.revokeObjectURL(g)}catch(a){URL.revokeObjectURL(g),o(a)}},s.onerror=()=>{URL.revokeObjectURL(g),o(new Error("Unable to load image"))},s.src=g})}isGifFile(e){return e.type==="image/gif"?!0:e.name.split(".").pop().toLowerCase()==="gif"}async getImageDimensions(e){return new Promise((t,i)=>{const n=e instanceof File?e:new Blob([e]),o=URL.createObjectURL(n),r=new Image;r.onload=()=>{URL.revokeObjectURL(o),t({width:r.width,height:r.height})},r.onerror=()=>{URL.revokeObjectURL(o),i(new Error("Unable to get image dimensions"))},r.src=o})}async convertImageToRgb565(e){return new Promise((t,i)=>{const n=new Blob([e]),o=URL.createObjectURL(n),r=new Image;r.onload=()=>{var g,s,a,I,l,C;try{const Q=document.createElement("canvas"),h=Q.getContext("2d",{willReadFrequently:!0});Q.width=((a=(s=(g=this.config)==null?void 0:g.chip)==null?void 0:s.display)==null?void 0:a.width)||320,Q.height=((C=(l=(I=this.config)==null?void 0:I.chip)==null?void 0:l.display)==null?void 0:C.height)||240;const f=r.width/r.height,u=Q.width/Q.height;let E,m,c,d;f>u?(m=Q.height,E=Q.height*f,c=(Q.width-E)/2,d=0):(E=Q.width,m=Q.width/f,c=0,d=(Q.height-m)/2),h.drawImage(r,c,d,E,m);const F=h.getImageData(0,0,Q.width,Q.height).data,N=new ArrayBuffer(Q.width*Q.height*2),G=new Uint16Array(N);for(let W=0;W>3,DA=F[W+1]>>2,NA=F[W+2]>>3;G[W/4]=z<<11|DA<<5|NA}const K=25,R=18,b=Q.width*2,L=28,EA=L+N.byteLength,dA=new ArrayBuffer(EA),IA=new Uint8Array(dA),nA=new DataView(dA);let X=0;const tA=0|R<<8|K;nA.setUint32(X,tA,!0),X+=4;const fA=Q.height<<16|Q.width;nA.setUint32(X,fA,!0),X+=4;const Y=0|b;nA.setUint32(X,Y,!0),X+=4,nA.setUint32(X,N.byteLength,!0),X+=4,nA.setUint32(X,L,!0),X+=4,nA.setUint32(X,0,!0),X+=4,nA.setUint32(X,0,!0),X+=4,IA.set(new Uint8Array(N),L),URL.revokeObjectURL(o),t(dA)}catch(Q){URL.revokeObjectURL(o),i(Q)}},r.onerror=()=>{URL.revokeObjectURL(o),i(new Error("Unable to load image"))},r.src=o})}cleanup(){this.resources.clear(),this.tempFiles=[],this.convertedFonts.clear(),this.wakenetPacker.clear(),this.spiffsGenerator.clear(),this.gifScaler.dispose()}async clearAllStoredData(){try{await this.configStorage.clearAll(),this.cleanup(),console.log("All stored data cleared")}catch(e){throw console.error("Failed to clear stored data:",e),e}}async getStorageStatus(){try{const e=await this.configStorage.getStorageInfo();return{hasStoredData:await this.configStorage.hasStoredConfig(),storageInfo:e,autoSaveEnabled:this.autoSaveEnabled}}catch(e){return console.error("Failed to get storage status:",e),{hasStoredData:!1,storageInfo:null,autoSaveEnabled:this.autoSaveEnabled}}}setAutoSave(e){this.autoSaveEnabled=e,console.log(`Auto-save ${e?"enabled":"disabled"}`)}getResourceSummary(){const e=[],t=this.preparePackageResources(),i={wakeword:0,font:0,emoji:0,background:0};return t.files.forEach(n=>{i[n.type]=(i[n.type]||0)+1;let o="";switch(n.type){case"wakeword":o=`Wakeword model: ${n.name} (${n.modelType})`;break;case"font":n.config?o=`Custom font: size ${n.config.size}px, BPP ${n.config.bpp}`:o=`Preset font: ${n.source}`;break;case"emoji":o=`Emoji: ${n.name} (${n.size.width}x${n.size.height})`;break;case"background":o=`${n.mode==="light"?"Light":"Dark"} mode background`;break}e.push({type:n.type,filename:n.filename,description:o})}),{files:e,counts:i,totalFiles:e.length,indexJson:t.indexJson}}}const IS={class:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 p-4"},CS={class:"bg-white rounded-lg shadow-xl max-w-2xl w-full max-h-[90vh] overflow-hidden"},lS={class:"flex items-center justify-between p-6 border-b border-gray-200"},BS={class:"text-lg font-medium text-gray-900"},QS={key:1,class:"text-sm text-orange-600 font-medium"},cS={class:"p-6 overflow-y-auto",style:{"max-height":"calc(90vh - 140px)"}},ES={key:0,class:"space-y-6"},uS={class:"font-medium text-gray-900 mb-3"},hS={class:"bg-gray-50 rounded-lg p-4 space-y-2 text-sm"},fS={class:"flex justify-between"},dS={class:"text-gray-600"},pS={class:"font-medium"},mS={class:"flex justify-between"},yS={class:"text-gray-600"},wS={class:"font-medium"},DS={class:"flex justify-between"},kS={class:"text-gray-600"},vS={class:"font-medium"},FS={class:"flex justify-between"},SS={class:"text-gray-600"},RS={class:"font-medium"},bS={class:"flex justify-between"},NS={class:"text-gray-600"},GS={class:"font-medium"},LS={class:"font-medium text-gray-900 mb-3"},US={class:"space-y-2 max-h-64 overflow-y-auto"},MS={class:"flex items-center"},xS={class:"text-sm font-medium text-gray-900"},JS={class:"text-sm text-gray-700"},TS={key:0,class:"text-xs text-gray-500 ml-1"},HS={key:1,class:"text-xs text-gray-500 ml-1"},YS={key:1,class:"space-y-6 text-center"},_S={class:"space-y-4"},KS={class:"text-gray-600 mt-2"},OS={class:"bg-gray-200 rounded-full h-2 overflow-hidden"},PS={class:"text-sm text-gray-600"},VS={class:"mt-1"},WS={class:"space-y-2 text-left"},qS={class:"flex-shrink-0 mr-3"},jS={key:0,class:"w-5 h-5 bg-green-500 rounded-full flex items-center justify-center"},ZS={key:1,class:"w-5 h-5 bg-primary-500 rounded-full animate-pulse"},XS={key:2,class:"w-5 h-5 bg-gray-300 rounded-full"},zS={key:2,class:"text-center space-y-6"},$S={class:"text-gray-600 mt-2"},AR={class:"bg-green-50 border border-green-200 rounded-lg p-4"},eR={class:"text-sm text-green-800 space-y-1"},tR={class:"space-y-3"},iR=["disabled"],nR={key:3,class:"space-y-6 text-center"},oR={class:"space-y-4"},rR={class:"text-gray-600"},gR={class:"bg-gray-200 rounded-full h-2 overflow-hidden"},sR={class:"text-sm text-gray-600"},aR={class:"mt-1"},IR={key:4,class:"text-center mt-4"},CR={class:"text-sm text-red-600"},lR={class:"flex justify-end space-x-3 p-6 border-t border-gray-200"},BR=["disabled"],QR={__name:"GenerateModal",props:{config:{type:Object,required:!0}},emits:["close","generate","startFlash"],setup(A,{emit:e}){const{t}=ve(),i=A,n=e,{deviceInfo:o,checkDeviceStatus:r,isDeviceOnline:g}=No(),s=cA(!1),a=cA(!1),I=cA(0),l=cA(""),C=cA(""),Q=cA(""),h=cA(null),f=cA(null),u=cA(!1),E=cA(0),m=cA(""),c=cA(""),d=hA(()=>[{id:1,name:t("progressSteps.init"),status:"pending"},{id:2,name:t("progressSteps.font"),status:"pending"},{id:3,name:t("progressSteps.wakeword"),status:"pending"},{id:4,name:t("progressSteps.emoji"),status:"pending"},{id:5,name:t("progressSteps.background"),status:"pending"},{id:6,name:t("progressSteps.index"),status:"pending"},{id:7,name:t("progressSteps.spiffs"),status:"pending"},{id:8,name:t("progressSteps.package"),status:"pending"}]),w=cA([]),F=_i({render:()=>GA("svg",{fill:"currentColor",viewBox:"0 0 20 20"},[GA("path",{d:"M4 3a2 2 0 00-2 2v1a1 1 0 001 1h14a1 1 0 001-1V5a2 2 0 00-2-2H4zM3 8a1 1 0 011-1h12a1 1 0 011 1v5a2 2 0 01-2 2H5a2 2 0 01-2-2V8z"})])}),N=_i({render:()=>GA("svg",{fill:"currentColor",viewBox:"0 0 20 20"},[GA("path",{"fill-rule":"evenodd",d:"M7 4a3 3 0 016 0v4a3 3 0 11-6 0V4zm4 10.93A7.001 7.001 0 0017 8a1 1 0 10-2 0A5 5 0 015 8a1 1 0 00-2 0 7.001 7.001 0 006 6.93V17H6a1 1 0 100 2h8a1 1 0 100-2h-3v-2.07z","clip-rule":"evenodd"})])}),G=_i({render:()=>GA("svg",{fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[GA("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 4l8 16m-6-6h4"})])}),K=_i({render:()=>GA("svg",{fill:"currentColor",viewBox:"0 0 20 20"},[GA("path",{"fill-rule":"evenodd",d:"M4 3a2 2 0 00-2 2v10a2 2 0 002 2h12a2 2 0 002-2V5a2 2 0 00-2-2H4zm12 12H4l4-8 3 6 2-4 3 6z","clip-rule":"evenodd"})])}),R=hA(()=>w.value.length>0),b=()=>{const Y=i.config.theme.wakeword;return!Y||Y.type==="none"?t("wakewordConfig.noWakeword"):Y.type==="preset"?{wn9s_hilexin:"Hi,乐鑫",wn9s_hiesp:"Hi,ESP",wn9s_nihaoxiaozhi:"你好小智",wn9_nihaoxiaozhi_tts:"你好小智",wn9_alexa:"Alexa"}[Y.preset]||Y.preset:Y.type==="custom"?Y.custom.name||t("wakewordConfig.customWakeword"):t("wakewordConfig.noWakeword")},L=()=>i.config.theme.font.type==="preset"?i.config.theme.font.preset.replace("font_","").replace("_"," "):t("generateModal.customFont"),EA=()=>i.config.theme.emoji.type==="preset"&&i.config.theme.emoji.preset?i.config.theme.emoji.preset==="twemoji32"?"Twemoji 32×32":"Twemoji 64×64":i.config.theme.emoji.type==="custom"?t("generateModal.customEmoji"):i.config.theme.emoji.type==="none"?t("emojiConfig.noEmojiPack"):t("generateModal.notConfigured"),dA=()=>{w.value=[],w.value.push({id:"index",name:"index.json",description:"配置索引文件",icon:F,iconColor:"text-blue-500",size:"1KB"});const Y=i.config.theme.wakeword;if(Y&&Y.type!=="none"&&w.value.push({id:"srmodels",name:"srmodels.bin",description:Y.type==="custom"?"自定义命令词模型":"预设唤醒词模型",icon:N,iconColor:"text-green-500",size:Y.type==="custom"?"~1.2MB":"~300KB"}),i.config.theme.font.type==="preset"){const W={font_puhui_deepseek_14_1:"180KB",font_puhui_deepseek_16_4:"720KB",font_puhui_deepseek_20_4:"1.1MB",font_puhui_deepseek_30_4:"2.5MB"};w.value.push({id:"font",name:`${i.config.theme.font.preset}.bin`,description:"预设字体文件",icon:G,iconColor:"text-yellow-500",size:W[i.config.theme.font.preset]||"500KB"})}else if(i.config.theme.font.custom.file){const W=i.config.theme.font.custom,z=Math.max(100,W.size*W.size*W.bpp*.7);w.value.push({id:"font",name:`font_custom_${W.size}_${W.bpp}.bin`,description:"自定义字体文件",icon:G,iconColor:"text-yellow-500",size:z>1024?`${(z/1024).toFixed(1)}MB`:`${Math.round(z)}KB`,estimated:!0})}if(i.config.theme.emoji.type==="preset"&&i.config.theme.emoji.preset){const W=["neutral","happy","laughing","funny","sad","angry","crying","loving","embarrassed","surprised","shocked","thinking","winking","cool","relaxed","delicious","kissy","confident","sleepy","silly","confused"],z=i.config.theme.emoji.preset==="twemoji64"?"3KB":"1KB";W.forEach(DA=>{w.value.push({id:`emoji_${DA}`,name:`${DA}.png`,description:`${DA}表情图片`,icon:K,iconColor:"text-pink-500",size:z})})}else if(i.config.theme.emoji.type==="custom"){const W=i.config.theme.emoji.custom,z=W.emotionMap||{},DA=W.fileMap||{};if(W.images,Object.keys(z).length===0||Object.keys(DA).length===0){console.error(t("errors.incompatibleEmojiData"));return}const NA=new Map,ne=new Map;Object.entries(z).forEach(([LA,H])=>{const $=DA[H];if($){if(!NA.has(H)){const AA=Math.round($.size/1024);NA.set(H,{file:$,size:AA>1024?`${(AA/1024).toFixed(1)}MB`:`${AA}KB`,emotions:[]})}NA.get(H).emotions.push(LA),ne.set(LA,H)}}),NA.forEach((LA,H)=>{const $=LA.emotions.join(", "),AA=LA.emotions.length>1;w.value.push({id:`emoji_${H.substring(0,8)}`,name:`emoji_${H.substring(0,8)}.${LA.file.name.split(".").pop()}`,description:AA?`共享表情图片 (${$})`:`${$}表情图片`,icon:K,iconColor:AA?"text-purple-500":"text-pink-500",size:LA.size,isCustomEmoji:!0})}),NA.size1024?`${(DA/1024).toFixed(1)}MB`:`${DA}KB`,estimated:!0})}if(i.config.theme.skin.dark.backgroundType==="image"&&i.config.theme.skin.dark.backgroundImage){const{width:W,height:z}=i.config.chip.display,DA=Math.round(W*z*2/1024);w.value.push({id:"bg_dark",name:"background_dark.raw",description:"深色模式背景图片",icon:K,iconColor:"text-indigo-500",size:DA>1024?`${(DA/1024).toFixed(1)}MB`:`${DA}KB`,estimated:!0})}},IA=Y=>{if(Y===0)return"0 B";const W=1024,z=["B","KB","MB","GB"],DA=Math.floor(Math.log(Y)/Math.log(W));return`${parseFloat((Y/Math.pow(W,DA)).toFixed(2))} ${z[DA]}`},nA=Y=>{if(Y<1e3)return`${Y}ms`;if(Y<6e4)return`${(Y/1e3).toFixed(1)}s`;{const W=Math.floor(Y/6e4),z=Math.floor(Y%6e4/1e3);return`${W}m ${z}s`}},X=async()=>{s.value=!0,I.value=0,f.value=Date.now();try{const Y=new _l;Y.setConfig(i.config);const W=await Y.generateAssetsBin((NA,ne)=>{I.value=parseInt(NA),l.value=ne;const LA=Math.floor(NA/(100/d.value.length));d.value.forEach((H,$)=>{${NA.status="completed"}),n("generate",w.value.map(NA=>({id:NA.id,name:NA.name})))}catch(Y){console.error("生成 assets.bin 失败:",Y),s.value=!1,a.value=!1,alert(t("errors.generationFailed",{error:Y.message}))}},tA=()=>{if(h.value){const Y=URL.createObjectURL(h.value),W=document.createElement("a");W.href=Y,W.download="assets.bin",W.style.display="none",document.body.appendChild(W),W.click(),document.body.removeChild(W),URL.revokeObjectURL(Y)}else console.error(t("errors.noFileToDownload"))},fA=async()=>{if(!h.value){alert(t("errors.noFileToDownload"));return}if(!g.value){alert(t("errors.deviceOffline"));return}if(o.value.assetsPartition&&o.value.assetsPartition.size){const Y=o.value.assetsPartition.size,W=h.value.size;if(W>Y){const z=(W/1024/1024).toFixed(2),DA=(Y/1024/1024).toFixed(2);alert(t("errors.fileTooLarge",{fileSize:z,partitionSize:DA}));return}}u.value=!0,E.value=0,m.value=t("flashProgress.startingFileTransfer"),c.value="";try{n("startFlash",{blob:h.value,onProgress:(Y,W)=>{E.value=Y,m.value=W},onComplete:()=>{u.value=!1,E.value=100,m.value=t("flashProgress.flashCompleted")},onError:Y=>{u.value=!1,c.value=Y,console.error(t("flashProgress.onlineFlashFailed",{error:Y}))}})}catch(Y){u.value=!1,c.value=t("flashProgress.onlineFlashFailed",{error:Y.message}),console.error(t("flashProgress.onlineFlashFailed",{error:Y}))}};return Ft(async()=>{dA(),await r(!1)}),(Y,W)=>(T(),_("div",IS,[B("div",CS,[B("div",lS,[B("h3",BS,v(Y.$t("generateModal.title")),1),u.value?(T(),_("div",QS,v(Y.$t("generateModal.flashingInProgress")),1)):(T(),_("button",{key:0,onClick:W[0]||(W[0]=z=>Y.$emit("close")),class:"text-gray-400 hover:text-gray-500"},[...W[3]||(W[3]=[B("svg",{class:"w-6 h-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[B("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])]))]),B("div",cS,[!s.value&&!a.value?(T(),_("div",ES,[B("div",null,[B("h4",uS,v(Y.$t("generateModal.confirmConfig")),1),B("div",hS,[B("div",fS,[B("span",dS,v(Y.$t("generateModal.chipModel")),1),B("span",pS,v(A.config.chip.model.toUpperCase()),1)]),B("div",mS,[B("span",yS,v(Y.$t("generateModal.resolution")),1),B("span",wS,v(A.config.chip.display.width)+"×"+v(A.config.chip.display.height),1)]),B("div",DS,[B("span",kS,v(Y.$t("generateModal.wakeword")),1),B("span",vS,v(b()),1)]),B("div",FS,[B("span",SS,v(Y.$t("generateModal.font")),1),B("span",RS,v(L()),1)]),B("div",bS,[B("span",NS,v(Y.$t("generateModal.emoji")),1),B("span",GS,v(EA()),1)])])]),B("div",null,[B("h4",LS,v(Y.$t("generateModal.fileList")),1),B("div",US,[(T(!0),_(qA,null,Ke(w.value,z=>(T(),_("div",{key:z.id,class:"flex items-center justify-between px-3 py-2 border border-gray-200 rounded bg-gray-50"},[B("div",MS,[(T(),ye(HI(z.icon),{class:kA(["w-4 h-4 mr-2",z.iconColor])},null,8,["class"])),B("span",xS,v(z.name),1)]),B("div",JS,[gt(v(z.size)+" ",1),z.estimated?(T(),_("span",TS,v(Y.$t("generateModal.estimated")),1)):sA("",!0),z.isCustomEmoji?(T(),_("span",HS,v(Y.$t("generateModal.compressed")),1)):sA("",!0)])]))),128))])])])):sA("",!0),s.value?(T(),_("div",YS,[W[5]||(W[5]=B("div",{class:"flex items-center justify-center"},[B("div",{class:"animate-spin rounded-full h-16 w-16 border-b-2 border-primary-500"})],-1)),B("div",_S,[B("p",KS,v(Y.$t("generateModal.generating")),1),B("div",OS,[B("div",{class:"bg-primary-500 h-2 rounded-full transition-all duration-500 ease-out",style:VA({width:I.value+"%"})},null,4)]),B("div",PS,[B("div",null,v(l.value),1),B("div",VS,v(Y.$t("generateModal.progress",{progress:I.value})),1)])]),B("div",WS,[(T(!0),_(qA,null,Ke(d.value,z=>(T(),_("div",{key:z.id,class:"flex items-center text-sm"},[B("div",qS,[z.status==="completed"?(T(),_("div",jS,[...W[4]||(W[4]=[B("svg",{class:"w-3 h-3 text-white",fill:"currentColor",viewBox:"0 0 20 20"},[B("path",{"fill-rule":"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z","clip-rule":"evenodd"})],-1)])])):z.status==="processing"?(T(),_("div",ZS)):(T(),_("div",XS))]),B("span",{class:kA([z.status==="completed"?"text-green-700":z.status==="processing"?"text-primary-700":"text-gray-500"])},v(z.name),3)]))),128))])])):sA("",!0),a.value&&!u.value?(T(),_("div",zS,[W[8]||(W[8]=B("div",{class:"mx-auto flex items-center justify-center"},[B("svg",{class:"w-20 h-20 text-green-600",fill:"currentColor",viewBox:"0 0 20 20"},[B("path",{"fill-rule":"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z","clip-rule":"evenodd"})])],-1)),B("div",null,[B("p",$S,v(Y.$t("generateModal.completed")),1)]),B("div",AR,[B("div",eR,[B("div",null,v(Y.$t("generateModal.filename")),1),B("div",null,v(Y.$t("generateModal.fileSize",{size:C.value})),1),B("div",null,v(Y.$t("generateModal.generationTime",{time:Q.value})),1)])]),B("div",tR,[B("button",{onClick:tA,class:"w-full bg-gray-100 hover:bg-gray-200 text-gray-700 px-6 py-3 rounded-lg font-medium transition-colors flex items-center justify-center"},[W[6]||(W[6]=B("svg",{class:"w-5 h-5 mr-2",fill:"currentColor",viewBox:"0 0 20 20"},[B("path",{"fill-rule":"evenodd",d:"M3 17a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zm3.293-7.707a1 1 0 011.414 0L9 10.586V3a1 1 0 112 0v7.586l1.293-1.293a1 1 0 111.414 1.414l-3 3a1 1 0 01-1.414 0l-3-3a1 1 0 010-1.414z","clip-rule":"evenodd"})],-1)),gt(" "+v(Y.$t("generateModal.downloadAssets")),1)]),B("button",{onClick:fA,disabled:!BA(g),class:"w-full bg-blue-500 hover:bg-blue-600 disabled:bg-gray-300 text-white px-6 py-3 rounded-lg font-medium transition-colors flex items-center justify-center"},[W[7]||(W[7]=B("svg",{class:"w-5 h-5 mr-2",fill:"currentColor",viewBox:"0 0 20 20"},[B("path",{"fill-rule":"evenodd",d:"M3 17a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zm3.293-7.707a1 1 0 011.414 0L9 10.586V3a1 1 0 112 0v7.586l1.293-1.293a1 1 0 111.414 1.414l-3 3a1 1 0 01-1.414 0l-3-3a1 1 0 010-1.414z","clip-rule":"evenodd"})],-1)),gt(" "+v(Y.$t("generateModal.flashToDevice")),1)],8,iR)])])):sA("",!0),u.value&&!c.value?(T(),_("div",nR,[W[9]||(W[9]=B("div",{class:"flex items-center justify-center"},[B("div",{class:"animate-spin rounded-full h-16 w-16 border-b-2 border-blue-500"})],-1)),B("div",oR,[B("p",rR,v(Y.$t("generateModal.flashing")),1),B("div",gR,[B("div",{class:"bg-blue-500 h-2 rounded-full transition-all duration-500 ease-out",style:VA({width:E.value+"%"})},null,4)]),B("div",sR,[B("div",null,v(m.value),1),B("div",aR,v(Y.$t("generateModal.progress",{progress:E.value})),1)])])])):sA("",!0),c.value?(T(),_("div",IR,[B("p",CR,v(c.value),1)])):sA("",!0)]),B("div",lR,[!s.value&&!a.value?(T(),_("button",{key:0,onClick:W[1]||(W[1]=z=>Y.$emit("close")),class:"px-4 py-2 text-sm font-medium text-gray-700 bg-gray-100 hover:bg-gray-200 rounded-md transition-colors"},v(Y.$t("common.cancel")),1)):sA("",!0),!s.value&&!a.value?(T(),_("button",{key:1,onClick:X,disabled:!R.value,class:"px-6 py-2 text-sm font-medium text-white bg-primary-500 hover:bg-primary-600 disabled:bg-gray-300 rounded-md transition-colors"},v(Y.$t("common.start"))+" "+v(Y.$t("common.generate")),9,BR)):sA("",!0),a.value&&!u.value?(T(),_("button",{key:2,onClick:W[2]||(W[2]=z=>Y.$emit("close")),class:"px-4 py-2 text-sm font-medium text-gray-700 bg-gray-100 hover:bg-gray-200 rounded-md transition-colors"},v(Y.$t("common.close")),1)):sA("",!0)])])]))}},cR={class:"flex items-center justify-between mb-2"},ER={class:"flex items-center"},uR={class:"text-blue-800 font-medium"},hR={class:"text-blue-600 text-sm mb-3"},fR={class:"flex justify-end space-x-2"},dR={class:"flex items-center justify-center mb-8"},pR={class:"flex flex-col items-center"},mR={class:"text-sm mt-2 text-gray-600"},yR={key:0,class:"w-16 h-0.5 bg-gray-300 mx-4"},wR={class:"bg-white rounded-lg shadow-sm border p-6"},Kl={__name:"HomePage",setup(A){const e=No(),{t}=ve(),i=cA(30),n=cA(null),o=cA(0),r=cA(!1),g=cA("wakeword"),s=cA(!1),a=cA(!1),I=cA(!1),l=cA(!0),C=new _l,Q=cA(null),h=cA(""),f=[{titleKey:"steps.chip",key:"chip"},{titleKey:"steps.theme",key:"theme"},{titleKey:"steps.generate",key:"generate"}],u=cA({chip:{model:"",display:{width:320,height:240,color:"RGB565"}},theme:{wakeword:{type:"none",preset:"",custom:{name:"",command:"",threshold:20,duration:3e3,model:"mn6_cn"}},font:{type:"none",preset:"",hide_subtitle:!1,custom:{file:null,size:20,bpp:4,charset:"deepseek"}},emoji:{type:"none",preset:"",custom:{size:{width:160,height:120},images:{}}},skin:{light:{backgroundType:"color",backgroundColor:"#ffffff",textColor:"#000000",backgroundImage:null},dark:{backgroundType:"color",backgroundColor:"#121212",textColor:"#ffffff",backgroundImage:null}}}});hA(()=>u.value.chip.model&&(u.value.theme.font.type==="none"||u.value.theme.font.preset||u.value.theme.font.custom.file));const E=IA=>IA{o.value{o.value>0&&o.value--},d=()=>{r.value=!0},w=async IA=>{},F=async(IA,nA={})=>await e.callMcpTool(IA,nA),N=async IA=>{const{blob:nA,onProgress:X,onComplete:tA,onError:fA}=IA;try{X(15,t("flashProgress.checkingDeviceStatus"));try{if((await F("self.get_device_status")).code!==0)throw new Error(t("flashProgress.deviceOfflineOrUnresponsive",{error:t("flashProgress.unableToGetDeviceStatus")}))}catch(Y){console.error("检查设备状态失败:",Y),fA(t("flashProgress.deviceOfflineOrUnresponsive",{error:Y.msg}));return}X(30,t("flashProgress.uploadingFile"));try{const Y=new FormData;Y.append("file",nA,"assets.bin");const z=await(await fetch("/xiaozhi/otaMag/uploadAssetsBin",{method:"POST",body:Y,headers:{Authorization:`Bearer ${e.token.value}`}})).json();z.code!==0&&await Promise.reject(z),h.value=z.data}catch{fA(t("flashProgress.uploadFailed"));return}X(45,t("flashProgress.settingDeviceDownloadUrl"));try{const Y=await F("self.assets.set_download_url",{url:h.value});Y.code!==0&&await Promise.reject(Y)}catch(Y){console.error("设置下载URL失败:",Y),fA(t("flashProgress.setDownloadUrlFailed",{error:Y.msg}));return}X(60,t("flashProgress.waitingForDeviceReboot")),await F("self.reboot").catch(Y=>{console.warn("reboot指令调用警告(设备可能已重启):",Y)}),X(75,t("flashProgress.deviceReady")),n.value=setInterval(()=>{if(X(90,t("flashProgress.flashCompleted")),i.value-=1,i.value<=0){clearInterval(n.value),i.value=30,n.value=null,fA("请求超时,请检查设备烧录是否异常");return}F("self.get_device_status").then(Y=>{n.value&&Y.code===0&&(clearInterval(n.value),n.value=null,i.value=30,tA())})},5e3)}catch(Y){console.error("在线烧录失败:",Y),fA(t("flashProgress.onlineFlashFailed",{error:Y.msg}))}},G=IA=>{g.value=IA},K=async()=>{var IA,nA,X;try{l.value=!0;const tA=await Qe.loadConfig();if(tA){u.value=tA.config,o.value=0,g.value="wakeword",s.value=!0,a.value=!0,await R(),Q.value&&clearTimeout(Q.value),Q.value=setTimeout(()=>{s.value=!1},5e3),C.setConfig(u.value,{strict:!1}),await C.restoreAllResourcesFromStorage(u.value);try{const fA=((X=(nA=(IA=u.value)==null?void 0:IA.theme)==null?void 0:nA.emoji)==null?void 0:X.custom)||{},Y=fA.images||{},W=fA.fileMap||{},z=fA.emotionMap||{};u.value={...u.value,theme:{...u.value.theme,emoji:{...u.value.theme.emoji,custom:{...fA,images:{...Y},fileMap:{...W},emotionMap:{...z}}}}}}catch(fA){console.error("刷新表情配置引用失败:",fA)}}else s.value=!1,a.value=!1}catch(tA){console.error("加载配置失败:",tA),s.value=!1,a.value=!1}finally{l.value=!1}},R=async()=>{var IA,nA,X;try{const tA=(X=(nA=(IA=u.value)==null?void 0:IA.theme)==null?void 0:nA.emoji)==null?void 0:X.custom;if(!tA)return;const fA=Object.keys(tA.images||{}).length>0,Y=tA.fileMap&&Object.keys(tA.fileMap).length>0,W=tA.emotionMap&&Object.keys(tA.emotionMap).length>0;if(fA&&(!Y||!W)){console.warn("⚠️ 检测到旧版本的表情数据结构(不兼容)"),console.log("正在清理旧数据...");try{const DA=Object.keys(tA.images||{});for(const NA of DA)await Qe.deleteFile(`emoji_${NA}`);console.log(`已删除 ${DA.length} 个旧表情文件`)}catch(DA){console.warn("清理旧表情文件时出错:",DA)}u.value.theme.emoji.custom={size:tA.size||{width:64,height:64},images:{},fileMap:{},emotionMap:{}},u.value.theme.emoji.type==="custom"&&(u.value.theme.emoji.type="",console.log("已重置表情类型,请重新选择")),await b(),console.log("✅ 旧表情数据已完全清除"),setTimeout(()=>{alert(`检测到旧版本的表情数据结构已被清除。 + `,document.head.appendChild(dA),await document.fonts.load(`16px "${L}"`),g.value=L,r.value=!0}catch(b){console.warn("自定义字体预览加载失败:",b),g.value="Arial, sans-serif",r.value=!0}else g.value="system-ui",r.value=!0}catch(b){console.warn("Font loading failed:",b),g.value="system-ui",r.value=!0}},u=()=>r.value&&g.value?`"${g.value}", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif`:'"PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif',E=S=>{if(t.config.theme.emoji.type==="preset")return`./static/twemoji${t.config.theme.emoji.preset==="twemoji64"?"64":"32"}/${S}.png`;if(t.config.theme.emoji.type==="custom"&&t.config.theme.emoji.custom.images[S])try{const b=t.config.theme.emoji.custom.images[S];if(b&&typeof b=="object"&&b.size)return URL.createObjectURL(b)}catch(b){console.warn(`表情图片预览加载失败 (${S}):`,b)}return null},D=S=>{const b=s.value.find(L=>L.key===S);return b?b.emoji:"😶"},c=()=>{if(t.config.theme.emoji.type==="preset")return(t.config.theme.emoji.preset==="twemoji64"?64:32)+16;if(t.config.theme.emoji.custom.size){const S=Math.min(t.config.theme.emoji.custom.size.width,t.config.theme.emoji.custom.size.height);return Math.min(S+16,64)}return 48},d=()=>t.config.theme.emoji.type==="preset"?t.config.theme.emoji.preset==="twemoji64"?64:32:t.config.theme.emoji.custom.size?Math.min(t.config.theme.emoji.custom.size.width,t.config.theme.emoji.custom.size.height,48):32,p=S=>{n.value=S},v=()=>{const S=t.config.theme.wakeword;return!S||S.type==="none"?e("wakewordConfig.noWakeword"):S.type==="preset"?{wn9s_hilexin:"Hi,乐鑫",wn9s_hiesp:"Hi,ESP",wn9s_nihaoxiaozhi:"你好小智",wn9_nihaoxiaozhi_tts:"你好小智",wn9_alexa:"Alexa",wn9_jarvis_tts:"Jarvis"}[S.preset]||S.preset:S.type==="custom"?S.custom.name||e("wakewordConfig.customWakeword"):e("wakewordConfig.noWakeword")},N=()=>{if(t.config.theme.font.type==="preset")return e("fontConfig.presetFontNames."+t.config.theme.font.preset)||t.config.theme.font.preset;{const S=t.config.theme.font.custom;return e("generateSummary.customFont",{size:S.size})}},G=()=>{if(t.config.theme.emoji.type==="preset"&&t.config.theme.emoji.preset)return t.config.theme.emoji.preset==="twemoji64"?"Twemoji 64×64":"Twemoji 32×32";if(t.config.theme.emoji.type==="custom"){const S=Object.keys(t.config.theme.emoji.custom.images).length;return e("generateSummary.customEmoji",{count:S})}else return t.config.theme.emoji.type==="none"?e("emojiConfig.noEmojiPack"):e("generateSummary.notConfigured")},_=()=>{const S=t.config.theme.skin.light.backgroundType==="image"?e("generateSummary.image"):e("generateSummary.color"),b=t.config.theme.skin.dark.backgroundType==="image"?e("generateSummary.image"):e("generateSummary.color");return e("generateSummary.skinLight",{type:S})+"/"+e("generateSummary.skinDark",{type:b})};return ae(()=>t.config.theme.font,()=>{f()},{deep:!0}),Ft(async()=>{a.value.length>0?n.value=a.value[0].key:n.value="",await f()}),Ii(()=>{document.querySelectorAll("style[data-font-preview]").forEach(b=>b.remove())}),(S,b)=>(T(),K("div",Dy,[B("div",null,[B("h2",ky,F(S.$t("generateSummary.title")),1),B("p",vy,F(S.$t("generateSummary.description")),1)]),B("div",Fy,[B("div",Sy,[B("h3",Ry,F(S.$t("generateSummary.devicePreview")),1),B("div",by,[B("div",Ny,[B("div",Gy,[B("div",Ly,[B("div",{style:VA(l()),class:"relative rounded-lg overflow-hidden border-2 border-gray-700 flex flex-col items-center justify-center"},[B("div",{style:VA(C()),class:"absolute inset-0"},null,4),B("div",Uy,[B("div",My,[n.value&&a.value.length>0?(T(),K("div",xy,[I.value?(T(),K("img",{key:0,src:I.value,alt:n.value,style:VA(Q()),class:"emoji-image"},null,12,Jy)):(T(),K("div",{key:1,style:VA(Q()),class:"emoji-fallback bg-gray-200 rounded-full flex items-center justify-center text-2xl"},F(D(n.value)),5))])):(T(),K("div",Ty,[B("div",{style:VA(Q()),class:"emoji-placeholder flex items-center justify-center text-gray-400 border-2 border-dashed border-gray-300 rounded bg-gray-50"},[B("div",Hy,[B("div",Yy,F(A.config.theme.emoji.type==="none"?"📦":"😕"),1),B("div",_y,F(A.config.theme.emoji.type==="none"?S.$t("emojiConfig.noEmojiPack"):S.$t("generateSummary.noEmotionConfigured")),1)])],4)]))]),A.config.theme.font.hide_subtitle?sA("",!0):(T(),K("div",{key:0,style:VA(h()),class:"text-message max-w-full break-words relative"},[r.value?sA("",!0):(T(),K("div",Ky,[B("div",Oy,F(S.$t("generateSummary.fontLoading")),1)])),B("div",{class:kA({"opacity-0":!r.value})},F(i.value),3)],4))])],4)]),B("div",Py,F(A.config.chip.display.width)+" × "+F(A.config.chip.display.height)+" "+F(A.config.chip.model.toUpperCase()),1)])])])]),B("div",Vy,[B("h3",Wy,F(S.$t("generateSummary.previewSettings")),1),B("div",qy,[B("div",null,[B("label",jy,F(S.$t("generateSummary.previewText")),1),ZA(B("textarea",{"onUpdate:modelValue":b[0]||(b[0]=L=>i.value=L),class:"w-full border border-gray-300 rounded-md px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-primary-500",rows:"3",placeholder:"Hi, I'm your friend Xiaozhi!"},null,512),[[te,i.value]])]),B("div",null,[B("label",Zy,F(S.$t("generateSummary.currentEmotion")),1),a.value.length>0?(T(),K("div",Xy,[(T(!0),K(qA,null,Ke(a.value,L=>(T(),K("button",{key:L.key,onClick:QA=>p(L.key),class:kA(["p-2 border rounded transition-colors flex items-center justify-center",n.value===L.key?"border-primary-500 bg-primary-50":"border-gray-200 hover:border-gray-300"]),title:L.name,style:VA({width:c()+"px",height:c()+"px"})},[E(L.key)?(T(),K("div",$y,[B("img",{src:E(L.key),alt:L.name,style:VA({width:d()+"px",height:d()+"px"}),class:"object-contain rounded"},null,12,Aw)])):(T(),K("div",ew,F(L.emoji),1))],14,zy))),128))])):(T(),K("div",tw,[B("div",iw,F(A.config.theme.emoji.type==="none"?"📦":"😕"),1),B("div",nw,F(A.config.theme.emoji.type==="none"?S.$t("emojiConfig.noEmojiPackDescription"):S.$t("generateSummary.configureEmojiFirst")),1)]))]),B("div",null,[B("label",ow,F(S.$t("generateSummary.themeMode")),1),B("div",rw,[B("button",{onClick:b[1]||(b[1]=L=>o.value="light"),class:kA(["flex-1 py-2 px-3 text-sm border rounded transition-colors",o.value==="light"?"border-primary-500 bg-primary-50 text-primary-700":"border-gray-300 hover:border-gray-400"])}," 🌞 "+F(S.$t("generateSummary.lightMode")),3),B("button",{onClick:b[2]||(b[2]=L=>o.value="dark"),class:kA(["flex-1 py-2 px-3 text-sm border rounded transition-colors",o.value==="dark"?"border-primary-500 bg-primary-50 text-primary-700":"border-gray-300 hover:border-gray-400"])}," 🌙 "+F(S.$t("generateSummary.darkMode")),3)])]),B("div",gw,[B("h4",sw,F(S.$t("generateSummary.configSummary")),1),B("div",aw,[A.config.theme.wakeword?(T(),K("div",Iw,F(S.$t("generateSummary.wakeword"))+" "+F(v()),1)):sA("",!0),B("div",Cw,[B("span",null,F(S.$t("generateSummary.font"))+" "+F(N()),1),r.value?sA("",!0):(T(),K("span",lw,F(S.$t("generateSummary.loading")),1))]),B("div",null,F(S.$t("generateSummary.emotion"))+" "+F(G()),1),B("div",null,F(S.$t("generateSummary.skin"))+" "+F(_()),1),A.config.theme.font.hide_subtitle?(T(),K("div",Bw,F(S.$t("generateSummary.hideSubtitle"))+" "+F(S.$t("common.yes")),1)):sA("",!0)])])])])]),B("div",Qw,[B("button",{onClick:b[3]||(b[3]=L=>S.$emit("prev")),class:"bg-gray-500 hover:bg-gray-600 text-white px-6 py-2 rounded-lg font-medium transition-colors"},F(S.$t("generateSummary.previous")),1),B("button",{onClick:b[4]||(b[4]=L=>S.$emit("generate")),class:"bg-green-500 hover:bg-green-600 text-white px-8 py-2 rounded-lg font-medium transition-colors flex items-center"},[b[5]||(b[5]=B("svg",{class:"w-5 h-5 mr-2",fill:"currentColor",viewBox:"0 0 20 20"},[B("path",{"fill-rule":"evenodd",d:"M3 17a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zm3.293-7.707a1 1 0 011.414 0L9 10.586V3a1 1 0 112 0v7.586l1.293-1.293a1 1 0 111.414 1.414l-3 3a1 1 0 01-1.414 0l-3-3a1 1 0 010-1.414z","clip-rule":"evenodd"})],-1)),gt(" "+F(S.$t("generateSummary.generate")),1)])])]))}},Ew=wy(cw,[["__scopeId","data-v-aa1dde40"]]);/*! https://mths.be/codepointat v0.2.0 by @mathias */String.prototype.codePointAt||function(){var A=function(){try{var t={},i=Object.defineProperty,n=i(t,t,t)&&i}catch{}return n}(),e=function(t){if(this==null)throw TypeError();var i=String(this),n=i.length,o=t?Number(t):0;if(o!=o&&(o=0),!(o<0||o>=n)){var r=i.charCodeAt(o),g;return r>=55296&&r<=56319&&n>o+1&&(g=i.charCodeAt(o+1),g>=56320&&g<=57343)?(r-55296)*1024+g-56320+65536:r}};A?A(String.prototype,"codePointAt",{value:e,configurable:!0,writable:!0}):String.prototype.codePointAt=e}();var cg=0,_C=-3;function In(){this.table=new Uint16Array(16),this.trans=new Uint16Array(288)}function uw(A,e){this.source=A,this.sourceIndex=0,this.tag=0,this.bitcount=0,this.dest=e,this.destLen=0,this.ltree=new In,this.dtree=new In}var KC=new In,OC=new In,Eg=new Uint8Array(30),ug=new Uint16Array(30),PC=new Uint8Array(30),VC=new Uint16Array(30),hw=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),zs=new In,$e=new Uint8Array(320);function WC(A,e,t,i){var n,o;for(n=0;n>>=1,e}function et(A,e,t){if(!e)return t;for(;A.bitcount<24;)A.tag|=A.source[A.sourceIndex++]<>>16-e;return A.tag>>>=e,A.bitcount-=e,i+t}function br(A,e){for(;A.bitcount<24;)A.tag|=A.source[A.sourceIndex++]<>>=1,++n,t+=e.table[n],i-=e.table[n];while(i>=0);return A.tag=o,A.bitcount-=n,e.trans[t+i]}function pw(A,e,t){var i,n,o,r,g,s;for(i=et(A,5,257),n=et(A,5,1),o=et(A,4,4),r=0;r<19;++r)$e[r]=0;for(r=0;r8;)A.sourceIndex--,A.bitcount-=8;if(e=A.source[A.sourceIndex+1],e=256*e+A.source[A.sourceIndex],t=A.source[A.sourceIndex+3],t=256*t+A.source[A.sourceIndex+2],e!==(~t&65535))return _C;for(A.sourceIndex+=4,i=e;i;--i)A.dest[A.destLen++]=A.source[A.sourceIndex++];return A.bitcount=0,cg}function yw(A,e){var t=new uw(A,e),i,n,o;do{switch(i=dw(t),n=et(t,2,0),n){case 0:o=mw(t);break;case 1:o=Aa(t,KC,OC);break;case 2:pw(t,t.ltree,t.dtree),o=Aa(t,t.ltree,t.dtree);break;default:o=_C}if(o!==cg)throw new Error("Data error")}while(!i);return t.destLenthis.x2&&(this.x2=A)),typeof e=="number"&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=e,this.y2=e),ethis.y2&&(this.y2=e))};St.prototype.addX=function(A){this.addPoint(A,null)};St.prototype.addY=function(A){this.addPoint(null,A)};St.prototype.addBezier=function(A,e,t,i,n,o,r,g){var s=[A,e],a=[t,i],I=[n,o],l=[r,g];this.addPoint(A,e),this.addPoint(r,g);for(var C=0;C<=1;C++){var Q=6*s[C]-12*a[C]+6*I[C],h=-3*s[C]+9*a[C]-9*I[C]+3*l[C],f=3*a[C]-3*s[C];if(h===0){if(Q===0)continue;var u=-f/Q;0=0&&s>0&&(g+=" "),g+=e(a)}return g}for(var i="",n=0;n=0&&A<=255,"Byte value should be between 0 and 255."),[A]};wA.BYTE=je(1);rA.CHAR=function(A){return[A.charCodeAt(0)]};wA.CHAR=je(1);rA.CHARARRAY=function(A){typeof A>"u"&&(A="",console.warn("Undefined CHARARRAY encountered and treated as an empty string. This is probably caused by a missing glyph name."));for(var e=[],t=0;t"u"?0:A.length};rA.USHORT=function(A){return[A>>8&255,A&255]};wA.USHORT=je(2);rA.SHORT=function(A){return A>=ta&&(A=-(2*ta-A)),[A>>8&255,A&255]};wA.SHORT=je(2);rA.UINT24=function(A){return[A>>16&255,A>>8&255,A&255]};wA.UINT24=je(3);rA.ULONG=function(A){return[A>>24&255,A>>16&255,A>>8&255,A&255]};wA.ULONG=je(4);rA.LONG=function(A){return A>=ia&&(A=-(2*ia-A)),[A>>24&255,A>>16&255,A>>8&255,A&255]};wA.LONG=je(4);rA.FIXED=rA.ULONG;wA.FIXED=wA.ULONG;rA.FWORD=rA.SHORT;wA.FWORD=wA.SHORT;rA.UFWORD=rA.USHORT;wA.UFWORD=wA.USHORT;rA.LONGDATETIME=function(A){return[0,0,0,0,A>>24&255,A>>16&255,A>>8&255,A&255]};wA.LONGDATETIME=je(8);rA.TAG=function(A){return mA.argument(A.length===4,"Tag should be exactly 4 ASCII characters."),[A.charCodeAt(0),A.charCodeAt(1),A.charCodeAt(2),A.charCodeAt(3)]};wA.TAG=je(4);rA.Card8=rA.BYTE;wA.Card8=wA.BYTE;rA.Card16=rA.USHORT;wA.Card16=wA.USHORT;rA.OffSize=rA.BYTE;wA.OffSize=wA.BYTE;rA.SID=rA.USHORT;wA.SID=wA.USHORT;rA.NUMBER=function(A){return A>=-107&&A<=107?[A+139]:A>=108&&A<=1131?(A=A-108,[(A>>8)+247,A&255]):A>=-1131&&A<=-108?(A=-A-108,[(A>>8)+251,A&255]):A>=-32768&&A<=32767?rA.NUMBER16(A):rA.NUMBER32(A)};wA.NUMBER=function(A){return rA.NUMBER(A).length};rA.NUMBER16=function(A){return[28,A>>8&255,A&255]};wA.NUMBER16=je(3);rA.NUMBER32=function(A){return[29,A>>24&255,A>>16&255,A>>8&255,A&255]};wA.NUMBER32=je(5);rA.REAL=function(A){var e=A.toString(),t=/\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(e);if(t){var i=parseFloat("1e"+((t[2]?+t[2]:0)+t[1].length));e=(Math.round(A*i)/i).toString()}for(var n="",o=0,r=e.length;o>8&255,e[e.length]=i&255}return e};wA.UTF16=function(A){return A.length*2};var Nr={"x-mac-croatian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈ƫȅ ÀÃÕŒœĐ—“”‘’÷◊©⁄€‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ","x-mac-cyrillic":"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю","x-mac-gaelic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØḂ±≤≥ḃĊċḊḋḞḟĠġṀæøṁṖṗɼƒſṠ«»… ÀÃÕŒœ–—“”‘’ṡẛÿŸṪ€‹›Ŷŷṫ·Ỳỳ⁊ÂÊÁËÈÍÎÏÌÓÔ♣ÒÚÛÙıÝýŴŵẄẅẀẁẂẃ","x-mac-greek":"Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦€ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ­","x-mac-icelandic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüݰ¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-inuit":"ᐃᐄᐅᐆᐊᐋᐱᐲᐳᐴᐸᐹᑉᑎᑏᑐᑑᑕᑖᑦᑭᑮᑯᑰᑲᑳᒃᒋᒌᒍᒎᒐᒑ°ᒡᒥᒦ•¶ᒧ®©™ᒨᒪᒫᒻᓂᓃᓄᓅᓇᓈᓐᓯᓰᓱᓲᓴᓵᔅᓕᓖᓗᓘᓚᓛᓪᔨᔩᔪᔫᔭ… ᔮᔾᕕᕖᕗ–—“”‘’ᕘᕙᕚᕝᕆᕇᕈᕉᕋᕌᕐᕿᖀᖁᖂᖃᖄᖅᖏᖐᖑᖒᖓᖔᖕᙱᙲᙳᙴᙵᙶᖖᖠᖡᖢᖣᖤᖥᖦᕼŁł","x-mac-ce":"ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ",macintosh:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-romanian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂȘ∞±≤≥¥µ∂∑∏π∫ªºΩăș¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›Țț‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-turkish":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙˆ˜¯˘˙˚¸˝˛ˇ"};Ri.MACSTRING=function(A,e,t,i){var n=Nr[i];if(n!==void 0){for(var o="",r=0;r=128&&(o=t[o],o===void 0))return;i[n]=o}return i}};wA.MACSTRING=function(A,e){var t=rA.MACSTRING(A,e);return t!==void 0?t.length:0};function Gr(A){return A>=-128&&A<=127}function kw(A,e,t){for(var i=0,n=A.length;e>8&255,s+256&255)}return o}rA.VARDELTAS=function(A){for(var e=0,t=[];e=-128&&i<=127?e=vw(A,e,t):e=Fw(A,e,t)}return t};rA.INDEX=function(A){for(var e=1,t=[e],i=[],n=0;n>8,e[l+1]=C&255,e=e.concat(i[I])}return e};wA.TABLE=function(A){for(var e=0,t=A.fields.length,i=0;i0)return new J(this.data,this.offset+e).parseStruct(A)};J.prototype.parsePointer32=function(A){var e=this.parseOffset32();if(e>0)return new J(this.data,this.offset+e).parseStruct(A)};J.prototype.parseListOfLists=function(A){for(var e=this.parseOffset16List(),t=e.length,i=this.relativeOffset,n=new Array(t),o=0;o>1,e.skip("uShort",3),A.glyphIndexMap={};for(var r=new lA.Parser(t,i+n+14),g=new lA.Parser(t,i+n+16+o*2),s=new lA.Parser(t,i+n+16+o*4),a=new lA.Parser(t,i+n+16+o*6),I=i+n+16+o*8,l=0;l=0;n-=1){var o=lA.getUShort(A,e+4+n*8),r=lA.getUShort(A,e+4+n*8+2);if(o===3&&(r===0||r===1||r===10)||o===0&&(r===0||r===1||r===2||r===3||r===4)){i=lA.getULong(A,e+4+n*8+4);break}}if(i===-1)throw new Error("No valid cmap sub-tables found.");var g=new lA.Parser(A,e+i);if(t.format=g.parseUShort(),t.format===12)Uw(t,g);else if(t.format===4)Mw(t,g,A,e,i);else throw new Error("Only format 4 and 12 cmap tables are supported (found format "+t.format+").");return t}function Jw(A,e,t){A.segments.push({end:e,start:e,delta:-(e-t),offset:0,glyphIndex:t})}function Tw(A){A.segments.push({end:65535,start:65535,delta:1,offset:0})}function Hw(A){var e=!0,t;for(t=A.length-1;t>0;t-=1){var i=A.get(t);if(i.unicode>65535){console.log("Adding CMAP format 12 (needed!)"),e=!1;break}}var n=[{name:"version",type:"USHORT",value:0},{name:"numTables",type:"USHORT",value:e?1:2},{name:"platformID",type:"USHORT",value:3},{name:"encodingID",type:"USHORT",value:1},{name:"offset",type:"ULONG",value:e?12:20}];e||(n=n.concat([{name:"cmap12PlatformID",type:"USHORT",value:3},{name:"cmap12EncodingID",type:"USHORT",value:10},{name:"cmap12Offset",type:"ULONG",value:0}])),n=n.concat([{name:"format",type:"USHORT",value:4},{name:"cmap4Length",type:"USHORT",value:0},{name:"language",type:"USHORT",value:0},{name:"segCountX2",type:"USHORT",value:0},{name:"searchRange",type:"USHORT",value:0},{name:"entrySelector",type:"USHORT",value:0},{name:"rangeShift",type:"USHORT",value:0}]);var o=new aA.Table("cmap",n);for(o.segments=[],t=0;t>4,r=n&15;if(o===t||(e+=i[o],r===t))break;e+=i[r]}return parseFloat(e)}function AD(A,e){var t,i,n,o;if(e===28)return t=A.parseByte(),i=A.parseByte(),t<<8|i;if(e===29)return t=A.parseByte(),i=A.parseByte(),n=A.parseByte(),o=A.parseByte(),t<<24|i<<16|n<<8|o;if(e===30)return $w(A);if(e>=32&&e<=246)return e-139;if(e>=247&&e<=250)return t=A.parseByte(),(e-247)*256+t+108;if(e>=251&&e<=254)return t=A.parseByte(),-(e-251)*256-t-108;throw new Error("Invalid b0 "+e)}function eD(A){for(var e={},t=0;t>1,s.length=0,I=!0}function N(G){for(var _,S,b,L,QA,dA,IA,nA,X,tA,fA,Y,W=0;W1&&!I&&(d=s.shift()+E,I=!0),Q+=s.pop(),p(C,Q);break;case 5:for(;s.length>0;)C+=s.shift(),Q+=s.shift(),g.lineTo(C,Q);break;case 6:for(;s.length>0&&(C+=s.shift(),g.lineTo(C,Q),s.length!==0);)Q+=s.shift(),g.lineTo(C,Q);break;case 7:for(;s.length>0&&(Q+=s.shift(),g.lineTo(C,Q),s.length!==0);)C+=s.shift(),g.lineTo(C,Q);break;case 8:for(;s.length>0;)i=C+s.shift(),n=Q+s.shift(),o=i+s.shift(),r=n+s.shift(),C=o+s.shift(),Q=r+s.shift(),g.curveTo(i,n,o,r,C,Q);break;case 10:QA=s.pop()+f,dA=h[QA],dA&&N(dA);break;case 11:return;case 12:switch(z=G[W],W+=1,z){case 35:i=C+s.shift(),n=Q+s.shift(),o=i+s.shift(),r=n+s.shift(),IA=o+s.shift(),nA=r+s.shift(),X=IA+s.shift(),tA=nA+s.shift(),fA=X+s.shift(),Y=tA+s.shift(),C=fA+s.shift(),Q=Y+s.shift(),s.shift(),g.curveTo(i,n,o,r,IA,nA),g.curveTo(X,tA,fA,Y,C,Q);break;case 34:i=C+s.shift(),n=Q,o=i+s.shift(),r=n+s.shift(),IA=o+s.shift(),nA=r,X=IA+s.shift(),tA=r,fA=X+s.shift(),Y=Q,C=fA+s.shift(),g.curveTo(i,n,o,r,IA,nA),g.curveTo(X,tA,fA,Y,C,Q);break;case 36:i=C+s.shift(),n=Q+s.shift(),o=i+s.shift(),r=n+s.shift(),IA=o+s.shift(),nA=r,X=IA+s.shift(),tA=r,fA=X+s.shift(),Y=tA+s.shift(),C=fA+s.shift(),g.curveTo(i,n,o,r,IA,nA),g.curveTo(X,tA,fA,Y,C,Q);break;case 37:i=C+s.shift(),n=Q+s.shift(),o=i+s.shift(),r=n+s.shift(),IA=o+s.shift(),nA=r+s.shift(),X=IA+s.shift(),tA=nA+s.shift(),fA=X+s.shift(),Y=tA+s.shift(),Math.abs(fA-C)>Math.abs(Y-Q)?C=fA+s.shift():Q=Y+s.shift(),g.curveTo(i,n,o,r,IA,nA),g.curveTo(X,tA,fA,Y,C,Q);break;default:console.log("Glyph "+e.index+": unknown operator 1200"+z),s.length=0}break;case 14:s.length>0&&!I&&(d=s.shift()+E,I=!0),l&&(g.closePath(),l=!1);break;case 18:v();break;case 19:case 20:v(),W+=a+7>>3;break;case 21:s.length>2&&!I&&(d=s.shift()+E,I=!0),Q+=s.pop(),C+=s.pop(),p(C,Q);break;case 22:s.length>1&&!I&&(d=s.shift()+E,I=!0),C+=s.pop(),p(C,Q);break;case 23:v();break;case 24:for(;s.length>2;)i=C+s.shift(),n=Q+s.shift(),o=i+s.shift(),r=n+s.shift(),C=o+s.shift(),Q=r+s.shift(),g.curveTo(i,n,o,r,C,Q);C+=s.shift(),Q+=s.shift(),g.lineTo(C,Q);break;case 25:for(;s.length>6;)C+=s.shift(),Q+=s.shift(),g.lineTo(C,Q);i=C+s.shift(),n=Q+s.shift(),o=i+s.shift(),r=n+s.shift(),C=o+s.shift(),Q=r+s.shift(),g.curveTo(i,n,o,r,C,Q);break;case 26:for(s.length%2&&(C+=s.shift());s.length>0;)i=C,n=Q+s.shift(),o=i+s.shift(),r=n+s.shift(),C=o,Q=r+s.shift(),g.curveTo(i,n,o,r,C,Q);break;case 27:for(s.length%2&&(Q+=s.shift());s.length>0;)i=C+s.shift(),n=Q,o=i+s.shift(),r=n+s.shift(),C=o+s.shift(),Q=r,g.curveTo(i,n,o,r,C,Q);break;case 28:_=G[W],S=G[W+1],s.push((_<<24|S<<16)>>16),W+=2;break;case 29:QA=s.pop()+A.gsubrsBias,dA=A.gsubrs[QA],dA&&N(dA);break;case 30:for(;s.length>0&&(i=C,n=Q+s.shift(),o=i+s.shift(),r=n+s.shift(),C=o+s.shift(),Q=r+(s.length===1?s.shift():0),g.curveTo(i,n,o,r,C,Q),s.length!==0);)i=C+s.shift(),n=Q,o=i+s.shift(),r=n+s.shift(),Q=r+s.shift(),C=o+(s.length===1?s.shift():0),g.curveTo(i,n,o,r,C,Q);break;case 31:for(;s.length>0&&(i=C+s.shift(),n=Q,o=i+s.shift(),r=n+s.shift(),Q=r+s.shift(),C=o+(s.length===1?s.shift():0),g.curveTo(i,n,o,r,C,Q),s.length!==0);)i=C,n=Q+s.shift(),o=i+s.shift(),r=n+s.shift(),C=o+s.shift(),Q=r+(s.length===1?s.shift():0),g.curveTo(i,n,o,r,C,Q);break;default:z<32?console.log("Glyph "+e.index+": unknown operator "+z):z<247?s.push(z-139):z<251?(_=G[W],W+=1,s.push((z-247)*256+_+108)):z<255?(_=G[W],W+=1,s.push(-(z-251)*256-_-108)):(_=G[W],S=G[W+1],b=G[W+2],L=G[W+3],W+=4,s.push((_<<24|S<<16|b<<8|L)/65536))}}}return N(t),e.advanceWidth=d,g}function rD(A,e,t,i){var n=[],o,r=new lA.Parser(A,e),g=r.parseCard8();if(g===0)for(var s=0;s=i)throw new Error("CFF table CID Font FDSelect has bad FD index value "+o+" (FD count "+i+")");n.push(o)}else if(g===3){var a=r.parseCard16(),I=r.parseCard16();if(I!==0)throw new Error("CFF Table CID Font FDSelect format 3 range has bad initial GID "+I);for(var l,C=0;C=i)throw new Error("CFF table CID Font FDSelect has bad FD index value "+o+" (FD count "+i+")");if(l>t)throw new Error("CFF Table CID Font FDSelect format 3 range has bad GID "+l);for(;I=0&&(t=i),i=e.indexOf(A),i>=0?t=i+Vn.length:(t=Vn.length+e.length,e.push(A)),t}function sD(){return new aA.Record("Header",[{name:"major",type:"Card8",value:1},{name:"minor",type:"Card8",value:0},{name:"hdrSize",type:"Card8",value:4},{name:"major",type:"Card8",value:1}])}function aD(A){var e=new aA.Record("Name INDEX",[{name:"names",type:"INDEX",value:[]}]);e.names=[];for(var t=0;t=t.begin&&A=1&&(t.ulCodePageRange1=i.parseULong(),t.ulCodePageRange2=i.parseULong()),t.version>=2&&(t.sxHeight=i.parseShort(),t.sCapHeight=i.parseShort(),t.usDefaultChar=i.parseUShort(),t.usBreakChar=i.parseUShort(),t.usMaxContent=i.parseUShort()),t}function JD(A){return new aA.Table("OS/2",[{name:"version",type:"USHORT",value:3},{name:"xAvgCharWidth",type:"SHORT",value:0},{name:"usWeightClass",type:"USHORT",value:0},{name:"usWidthClass",type:"USHORT",value:0},{name:"fsType",type:"USHORT",value:0},{name:"ySubscriptXSize",type:"SHORT",value:650},{name:"ySubscriptYSize",type:"SHORT",value:699},{name:"ySubscriptXOffset",type:"SHORT",value:0},{name:"ySubscriptYOffset",type:"SHORT",value:140},{name:"ySuperscriptXSize",type:"SHORT",value:650},{name:"ySuperscriptYSize",type:"SHORT",value:699},{name:"ySuperscriptXOffset",type:"SHORT",value:0},{name:"ySuperscriptYOffset",type:"SHORT",value:479},{name:"yStrikeoutSize",type:"SHORT",value:49},{name:"yStrikeoutPosition",type:"SHORT",value:258},{name:"sFamilyClass",type:"SHORT",value:0},{name:"bFamilyType",type:"BYTE",value:0},{name:"bSerifStyle",type:"BYTE",value:0},{name:"bWeight",type:"BYTE",value:0},{name:"bProportion",type:"BYTE",value:0},{name:"bContrast",type:"BYTE",value:0},{name:"bStrokeVariation",type:"BYTE",value:0},{name:"bArmStyle",type:"BYTE",value:0},{name:"bLetterform",type:"BYTE",value:0},{name:"bMidline",type:"BYTE",value:0},{name:"bXHeight",type:"BYTE",value:0},{name:"ulUnicodeRange1",type:"ULONG",value:0},{name:"ulUnicodeRange2",type:"ULONG",value:0},{name:"ulUnicodeRange3",type:"ULONG",value:0},{name:"ulUnicodeRange4",type:"ULONG",value:0},{name:"achVendID",type:"CHARARRAY",value:"XXXX"},{name:"fsSelection",type:"USHORT",value:0},{name:"usFirstCharIndex",type:"USHORT",value:0},{name:"usLastCharIndex",type:"USHORT",value:0},{name:"sTypoAscender",type:"SHORT",value:0},{name:"sTypoDescender",type:"SHORT",value:0},{name:"sTypoLineGap",type:"SHORT",value:0},{name:"usWinAscent",type:"USHORT",value:0},{name:"usWinDescent",type:"USHORT",value:0},{name:"ulCodePageRange1",type:"ULONG",value:0},{name:"ulCodePageRange2",type:"ULONG",value:0},{name:"sxHeight",type:"SHORT",value:0},{name:"sCapHeight",type:"SHORT",value:0},{name:"usDefaultChar",type:"USHORT",value:0},{name:"usBreakChar",type:"USHORT",value:0},{name:"usMaxContext",type:"USHORT",value:0}],A)}var Jr={parse:xD,make:JD,unicodeRanges:xr,getUnicodeRange:MD};function TD(A,e){var t={},i=new lA.Parser(A,e);switch(t.version=i.parseVersion(),t.italicAngle=i.parseFixed(),t.underlinePosition=i.parseShort(),t.underlineThickness=i.parseShort(),t.isFixedPitch=i.parseULong(),t.minMemType42=i.parseULong(),t.maxMemType42=i.parseULong(),t.minMemType1=i.parseULong(),t.maxMemType1=i.parseULong(),t.version){case 1:t.names=ii.slice();break;case 2:t.numberOfGlyphs=i.parseUShort(),t.glyphNameIndex=new Array(t.numberOfGlyphs);for(var n=0;n=ii.length){var r=i.parseChar();t.names.push(i.parseString(r))}break;case 2.5:t.numberOfGlyphs=i.parseUShort(),t.offset=new Array(t.numberOfGlyphs);for(var g=0;gl.value.tag?1:-1}),e.fields=e.fields.concat(i),e.fields=e.fields.concat(n),e}function Qa(A,e,t){for(var i=0;i0){var o=A.glyphs.get(n);return o.getMetrics()}}return t}function PD(A){for(var e=0,t=0;tu||s===void 0)&&u>0&&(s=u),a 123 are reserved for internal usage");if(f.name!==".notdef"){var D=f.getMetrics();e.push(D.xMin),t.push(D.yMin),i.push(D.xMax),n.push(D.yMax),r.push(D.leftSideBearing),g.push(D.rightSideBearing),o.push(f.advanceWidth)}}var c={xMin:Math.min.apply(null,e),yMin:Math.min.apply(null,t),xMax:Math.max.apply(null,i),yMax:Math.max.apply(null,n),advanceWidthMax:Math.max.apply(null,o),advanceWidthAvg:PD(o),minLeftSideBearing:Math.min.apply(null,r),maxLeftSideBearing:Math.max.apply(null,r),minRightSideBearing:Math.min.apply(null,g)};c.ascender=A.ascender,c.descender=A.descender;var d=sl.make({flags:3,unitsPerEm:A.unitsPerEm,xMin:c.xMin,yMin:c.yMin,xMax:c.xMax,yMax:c.yMax,lowestRecPPEM:3,createdTimestamp:A.createdTimestamp}),p=al.make({ascender:c.ascender,descender:c.descender,advanceWidthMax:c.advanceWidthMax,minLeftSideBearing:c.minLeftSideBearing,minRightSideBearing:c.minRightSideBearing,xMaxExtent:c.maxLeftSideBearing+(c.xMax-c.xMin),numberOfHMetrics:A.glyphs.length}),v=ll.make(A.glyphs.length),N=Jr.make(Object.assign({xAvgCharWidth:Math.round(c.advanceWidthAvg),usFirstCharIndex:s,usLastCharIndex:a,ulUnicodeRange1:I,ulUnicodeRange2:l,ulUnicodeRange3:C,ulUnicodeRange4:Q,sTypoAscender:c.ascender,sTypoDescender:c.descender,sTypoLineGap:0,usWinAscent:c.yMax,usWinDescent:Math.abs(c.yMin),ulCodePageRange1:1,sxHeight:Qa(A,"xyvw",{yMax:Math.round(c.ascender/2)}).yMax,sCapHeight:Qa(A,"HIKLEFJMNTZBDPRAGOQSUVWXY",c).yMax,usDefaultChar:A.hasChar(" ")?32:0,usBreakChar:A.hasChar(" ")?32:0},A.tables.os2)),G=Il.make(A.glyphs),_=ZC.make(A.glyphs),S=A.getEnglishName("fontFamily"),b=A.getEnglishName("fontSubfamily"),L=S+" "+b,QA=A.getEnglishName("postScriptName");QA||(QA=S.replace(/\s/g,"")+"-"+b);var dA={};for(var IA in A.names)dA[IA]=A.names[IA];dA.uniqueID||(dA.uniqueID={en:A.getEnglishName("manufacturer")+":"+L}),dA.postScriptName||(dA.postScriptName={en:QA}),dA.preferredFamily||(dA.preferredFamily=A.names.fontFamily),dA.preferredSubfamily||(dA.preferredSubfamily=A.names.fontSubfamily);var nA=[],X=ul.make(dA,nA),tA=nA.length>0?Cl.make(nA):void 0,fA=hl.make(),Y=gl.make(A.glyphs,{version:A.getEnglishName("version"),fullName:L,familyName:S,weightName:b,postScriptName:QA,unitsPerEm:A.unitsPerEm,fontBBox:[0,c.yMin,c.ascender,c.advanceWidthMax]}),W=A.metas&&Object.keys(A.metas).length>0?dl.make(A.metas):void 0,z=[d,p,v,N,X,_,fA,Y,G];tA&&z.push(tA),A.tables.gsub&&z.push(fl.make(A.tables.gsub)),W&&z.push(W);for(var DA=pl(z),NA=DA.encode(),ne=pg(NA),LA=DA.fields,H=!1,$=0;$>>1,o=A[n].tag;if(o===e)return n;o>>1,o=A[n];if(o===e)return n;o>>1;t=A[o];var r=t.start;if(r===e)return t;r0)return t=A[i-1],e>t.end?0:t}function mn(A,e){this.font=A,this.tableName=e}mn.prototype={searchTag:Xo,binSearch:ca,getTable:function(A){var e=this.font.tables[this.tableName];return!e&&A&&(e=this.font.tables[this.tableName]=this.createDefaultTable()),e},getScriptNames:function(){var A=this.getTable();return A?A.scripts.map(function(e){return e.tag}):[]},getDefaultScriptName:function(){var A=this.getTable();if(A){for(var e=!1,t=0;t=0)return i[n].script;if(e){var o={tag:A,script:{defaultLangSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]},langSysRecords:[]}};return i.splice(-1-n,0,o),o.script}}},getLangSysTable:function(A,e,t){var i=this.getScriptTable(A,t);if(i){if(!e||e==="dflt"||e==="DFLT")return i.defaultLangSys;var n=Xo(i.langSysRecords,e);if(n>=0)return i.langSysRecords[n].langSys;if(t){var o={tag:e,langSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]}};return i.langSysRecords.splice(-1-n,0,o),o.langSys}}},getFeatureTable:function(A,e,t,i){var n=this.getLangSysTable(A,e,i);if(n){for(var o,r=n.featureIndexes,g=this.font.tables[this.tableName].features,s=0;s=g[a-1].tag,"Features must be added in alphabetical order."),o={tag:t,feature:{params:0,lookupListIndexes:[]}},g.push(o),r.push(a),o.feature}}},getLookupTables:function(A,e,t,i,n){var o=this.getFeatureTable(A,e,t,n),r=[];if(o){for(var g,s=o.lookupListIndexes,a=this.font.tables[this.tableName].lookups,I=0;I=0?t:-1;case 2:var i=Ea(A.ranges,e);return i?i.index+e-i.start:-1}},expandCoverage:function(A){if(A.format===1)return A.glyphs;for(var e=[],t=A.ranges,i=0;i1,'Multiple: "by" must be an array of two or more ids');var n=this.getLookupTables(t,i,A,2,!0)[0],o=mg(n,1,{substFormat:1,coverage:{format:1,glyphs:[]},sequences:[]});mA.assert(o.coverage.format===1,"Multiple: unable to modify coverage table format "+o.coverage.format);var r=e.sub,g=this.binSearch(o.coverage.glyphs,r);g<0&&(g=-1-g,o.coverage.glyphs.splice(g,0,r),o.sequences.splice(g,0,0)),o.sequences[g]=e.by};Ge.prototype.addAlternate=function(A,e,t,i){var n=this.getLookupTables(t,i,A,3,!0)[0],o=mg(n,1,{substFormat:1,coverage:{format:1,glyphs:[]},alternateSets:[]});mA.assert(o.coverage.format===1,"Alternate: unable to modify coverage table format "+o.coverage.format);var r=e.sub,g=this.binSearch(o.coverage.glyphs,r);g<0&&(g=-1-g,o.coverage.glyphs.splice(g,0,r),o.alternateSets.splice(g,0,0)),o.alternateSets[g]=e.by};Ge.prototype.addLigature=function(A,e,t,i){var n=this.getLookupTables(t,i,A,4,!0)[0],o=n.subtables[0];o||(o={substFormat:1,coverage:{format:1,glyphs:[]},ligatureSets:[]},n.subtables[0]=o),mA.assert(o.coverage.format===1,"Ligature: unable to modify coverage table format "+o.coverage.format);var r=e.sub[0],g=e.sub.slice(1),s={ligGlyph:e.by,components:g},a=this.binSearch(o.coverage.glyphs,r);if(a>=0){for(var I=o.ligatureSets[a],l=0;l0?(o=A.parseByte(),e&n||(o=-o),o=t+o):(e&n)>0?o=t:o=t+A.parseShort(),o}function yl(A,e,t){var i=new lA.Parser(e,t);A.numberOfContours=i.parseShort(),A._xMin=i.parseShort(),A._yMin=i.parseShort(),A._xMax=i.parseShort(),A._yMax=i.parseShort();var n,o;if(A.numberOfContours>0){for(var r=A.endPointIndices=[],g=0;g0)for(var l=i.parseByte(),C=0;C0){var Q=[],h;if(a>0){for(var f=0;f=0,Q.push(h);for(var u=0,E=0;E0?(n&2)>0?(p.dx=i.parseShort(),p.dy=i.parseShort()):p.matchedPoints=[i.parseUShort(),i.parseUShort()]:(n&2)>0?(p.dx=i.parseChar(),p.dy=i.parseChar()):p.matchedPoints=[i.parseByte(),i.parseByte()],(n&8)>0?p.xScale=p.yScale=i.parseF2Dot14():(n&64)>0?(p.xScale=i.parseF2Dot14(),p.yScale=i.parseF2Dot14()):(n&128)>0&&(p.xScale=i.parseF2Dot14(),p.scale01=i.parseF2Dot14(),p.scale10=i.parseF2Dot14(),p.yScale=i.parseF2Dot14()),A.components.push(p),d=!!(n&32)}if(n&256){A.instructionLength=i.parseUShort(),A.instructions=[];for(var v=0;ve.points.length-1||i.matchedPoints[1]>n.points.length-1)throw Error("Matched points out of range in "+e.name);var r=e.points[i.matchedPoints[0]],g=n.points[i.matchedPoints[1]],s={xScale:i.xScale,scale01:i.scale01,scale10:i.scale10,yScale:i.yScale,dx:0,dy:0};g=zo([g],s)[0],s.dx=r.x-g.x,s.dy=r.y-g.y,o=zo(n.points,s)}e.points=e.points.concat(o)}}return wl(e.points)}function zD(A,e,t,i){for(var n=new at.GlyphSet(i),o=0;o2)){var t=this.font,i=this._prepState;if(!i||i.ppem!==e){var n=this._fpgmState;if(!n){Ht.prototype=rk,n=this._fpgmState=new Ht("fpgm",t.tables.fpgm),n.funcs=[],n.font=t,exports.DEBUG&&(console.log("---EXEC FPGM---"),n.step=-1);try{si(n)}catch(a){console.log("Hinting error in FPGM:"+a),this._errorState=3;return}}Ht.prototype=n,i=this._prepState=new Ht("prep",t.tables.prep),i.ppem=e;var o=t.tables.cvt;if(o)for(var r=i.cvt=new Array(o.length),g=e/t.unitsPerEm,s=0;s1))try{return Fl(A,i)}catch(a){this._errorState<1&&(console.log("Hinting error:"+a),console.log("Note: further hinting errors are silenced")),this._errorState=1;return}}};Fl=function(A,e){var t=e.ppem/e.font.unitsPerEm,i=t,n=A.components,o,r,g;if(Ht.prototype=e,!n)g=new Ht("glyf",A.instructions),exports.DEBUG&&(console.log("---EXEC GLYPH---"),g.step=-1),Tr(A,g,t,i),r=g.gZone;else{var s=e.font;r=[],o=[];for(var a=0;a=176&&o<=183)i+=o-176+1;else if(o>=184&&o<=191)i+=(o-184+1)*2;else if(e&&n===1&&o===27)break;while(n>0);A.ip=i}function ha(A,e){exports.DEBUG&&console.log(e.step,"SVTCA["+A.axis+"]"),e.fv=e.pv=e.dpv=A}function fa(A,e){exports.DEBUG&&console.log(e.step,"SPVTCA["+A.axis+"]"),e.pv=e.dpv=A}function da(A,e){exports.DEBUG&&console.log(e.step,"SFVTCA["+A.axis+"]"),e.fv=A}function pa(A,e){var t=e.stack,i=t.pop(),n=t.pop(),o=e.z2[i],r=e.z1[n];exports.DEBUG&&console.log("SPVTL["+A+"]",i,n);var g,s;A?(g=o.y-r.y,s=r.x-o.x):(g=r.x-o.x,s=r.y-o.y),e.pv=e.dpv=Dn(g,s)}function ma(A,e){var t=e.stack,i=t.pop(),n=t.pop(),o=e.z2[i],r=e.z1[n];exports.DEBUG&&console.log("SFVTL["+A+"]",i,n);var g,s;A?(g=o.y-r.y,s=r.x-o.x):(g=r.x-o.x,s=r.y-o.y),e.fv=Dn(g,s)}function gk(A){var e=A.stack,t=e.pop(),i=e.pop();exports.DEBUG&&console.log(A.step,"SPVFS[]",t,i),A.pv=A.dpv=Dn(i,t)}function sk(A){var e=A.stack,t=e.pop(),i=e.pop();exports.DEBUG&&console.log(A.step,"SPVFS[]",t,i),A.fv=Dn(i,t)}function ak(A){var e=A.stack,t=A.pv;exports.DEBUG&&console.log(A.step,"GPV[]"),e.push(t.x*16384),e.push(t.y*16384)}function Ik(A){var e=A.stack,t=A.fv;exports.DEBUG&&console.log(A.step,"GFV[]"),e.push(t.x*16384),e.push(t.y*16384)}function Ck(A){A.fv=A.pv,exports.DEBUG&&console.log(A.step,"SFVTPV[]")}function lk(A){var e=A.stack,t=e.pop(),i=e.pop(),n=e.pop(),o=e.pop(),r=e.pop(),g=A.z0,s=A.z1,a=g[t],I=g[i],l=s[n],C=s[o],Q=A.z2[r];exports.DEBUG&&console.log("ISECT[], ",t,i,n,o,r);var h=a.x,f=a.y,u=I.x,E=I.y,D=l.x,c=l.y,d=C.x,p=C.y,v=(h-u)*(c-p)-(f-E)*(D-d),N=h*E-f*u,G=D*p-c*d;Q.x=(N*(D-d)-G*(h-u))/v,Q.y=(N*(c-p)-G*(f-E))/v}function Bk(A){A.rp0=A.stack.pop(),exports.DEBUG&&console.log(A.step,"SRP0[]",A.rp0)}function Qk(A){A.rp1=A.stack.pop(),exports.DEBUG&&console.log(A.step,"SRP1[]",A.rp1)}function ck(A){A.rp2=A.stack.pop(),exports.DEBUG&&console.log(A.step,"SRP2[]",A.rp2)}function Ek(A){var e=A.stack.pop();switch(exports.DEBUG&&console.log(A.step,"SZP0[]",e),A.zp0=e,e){case 0:A.tZone||Go(A),A.z0=A.tZone;break;case 1:A.z0=A.gZone;break;default:throw new Error("Invalid zone pointer")}}function uk(A){var e=A.stack.pop();switch(exports.DEBUG&&console.log(A.step,"SZP1[]",e),A.zp1=e,e){case 0:A.tZone||Go(A),A.z1=A.tZone;break;case 1:A.z1=A.gZone;break;default:throw new Error("Invalid zone pointer")}}function hk(A){var e=A.stack.pop();switch(exports.DEBUG&&console.log(A.step,"SZP2[]",e),A.zp2=e,e){case 0:A.tZone||Go(A),A.z2=A.tZone;break;case 1:A.z2=A.gZone;break;default:throw new Error("Invalid zone pointer")}}function fk(A){var e=A.stack.pop();switch(exports.DEBUG&&console.log(A.step,"SZPS[]",e),A.zp0=A.zp1=A.zp2=e,e){case 0:A.tZone||Go(A),A.z0=A.z1=A.z2=A.tZone;break;case 1:A.z0=A.z1=A.z2=A.gZone;break;default:throw new Error("Invalid zone pointer")}}function dk(A){A.loop=A.stack.pop(),exports.DEBUG&&console.log(A.step,"SLOOP[]",A.loop)}function pk(A){exports.DEBUG&&console.log(A.step,"RTG[]"),A.round=Rl}function mk(A){exports.DEBUG&&console.log(A.step,"RTHG[]"),A.round=ik}function yk(A){var e=A.stack.pop();exports.DEBUG&&console.log(A.step,"SMD[]",e),A.minDis=e/64}function wk(A){exports.DEBUG&&console.log(A.step,"ELSE[]"),Nl(A,!1)}function Dk(A){var e=A.stack.pop();exports.DEBUG&&console.log(A.step,"JMPR[]",e),A.ip+=e-1}function kk(A){var e=A.stack.pop();exports.DEBUG&&console.log(A.step,"SCVTCI[]",e),A.cvCutIn=e/64}function vk(A){var e=A.stack;exports.DEBUG&&console.log(A.step,"DUP[]"),e.push(e[e.length-1])}function $o(A){exports.DEBUG&&console.log(A.step,"POP[]"),A.stack.pop()}function Fk(A){exports.DEBUG&&console.log(A.step,"CLEAR[]"),A.stack.length=0}function Sk(A){var e=A.stack,t=e.pop(),i=e.pop();exports.DEBUG&&console.log(A.step,"SWAP[]"),e.push(t),e.push(i)}function Rk(A){var e=A.stack;exports.DEBUG&&console.log(A.step,"DEPTH[]"),e.push(e.length)}function bk(A){var e=A.stack,t=e.pop(),i=e.pop();exports.DEBUG&&console.log(A.step,"LOOPCALL[]",t,i);var n=A.ip,o=A.prog;A.prog=A.funcs[t];for(var r=0;r1?"loop "+(e.loop-g)+": ":"")+"SHP["+(A?"rp1":"rp2")+"]",a)}e.loop=1}function ka(A,e){var t=e.stack,i=A?e.rp1:e.rp2,n=(A?e.z0:e.z1)[i],o=e.fv,r=e.pv,g=t.pop(),s=e.z2[e.contours[g]],a=s;exports.DEBUG&&console.log(e.step,"SHC["+A+"]",g);var I=r.distance(n,n,!1,!0);do a!==n&&o.setRelative(a,a,I,r),a=a.nextPointOnContour;while(a!==s)}function va(A,e){var t=e.stack,i=A?e.rp1:e.rp2,n=(A?e.z0:e.z1)[i],o=e.fv,r=e.pv,g=t.pop();exports.DEBUG&&console.log(e.step,"SHZ["+A+"]",g);var s;switch(g){case 0:s=e.tZone;break;case 1:s=e.gZone;break;default:throw new Error("Invalid zone")}for(var a,I=r.distance(n,n,!1,!0),l=s.length-2,C=0;C1?"loop "+(A.loop-t)+": ":"")+"SHPIX[]",r,n),i.setRelative(g,g,n),i.touch(g)}A.loop=1}function xk(A){for(var e=A.stack,t=A.rp1,i=A.rp2,n=A.loop,o=A.z0[t],r=A.z1[i],g=A.fv,s=A.dpv,a=A.z2;n--;){var I=e.pop(),l=a[I];exports.DEBUG&&console.log(A.step,(A.loop>1?"loop "+(A.loop-n)+": ":"")+"IP[]",I,t,"<->",i),g.interpolate(l,o,r,s),g.touch(l)}A.loop=1}function Fa(A,e){var t=e.stack,i=t.pop()/64,n=t.pop(),o=e.z1[n],r=e.z0[e.rp0],g=e.fv,s=e.pv;g.setRelative(o,r,i,s),g.touch(o),exports.DEBUG&&console.log(e.step,"MSIRP["+A+"]",i,n),e.rp1=e.rp0,e.rp2=n,A&&(e.rp0=n)}function Jk(A){for(var e=A.stack,t=A.rp0,i=A.z0[t],n=A.loop,o=A.fv,r=A.pv,g=A.z1;n--;){var s=e.pop(),a=g[s];exports.DEBUG&&console.log(A.step,(A.loop>1?"loop "+(A.loop-n)+": ":"")+"ALIGNRP[]",s),o.setRelative(a,i,0,r),o.touch(a)}A.loop=1}function Tk(A){exports.DEBUG&&console.log(A.step,"RTDG[]"),A.round=tk}function Sa(A,e){var t=e.stack,i=t.pop(),n=t.pop(),o=e.z0[n],r=e.fv,g=e.pv,s=e.cvt[i];exports.DEBUG&&console.log(e.step,"MIAP["+A+"]",i,"(",s,")",n);var a=g.distance(o,Bn);A&&(Math.abs(a-s)",g),e.stack.push(Math.round(g*64))}function Vk(A){exports.DEBUG&&console.log(A.step,"MPPEM[]"),A.stack.push(A.ppem)}function Wk(A){exports.DEBUG&&console.log(A.step,"FLIPON[]"),A.autoFlip=!0}function qk(A){var e=A.stack,t=e.pop(),i=e.pop();exports.DEBUG&&console.log(A.step,"LT[]",t,i),e.push(it?1:0)}function Xk(A){var e=A.stack,t=e.pop(),i=e.pop();exports.DEBUG&&console.log(A.step,"GTEQ[]",t,i),e.push(i>=t?1:0)}function zk(A){var e=A.stack,t=e.pop(),i=e.pop();exports.DEBUG&&console.log(A.step,"EQ[]",t,i),e.push(t===i?1:0)}function $k(A){var e=A.stack,t=e.pop(),i=e.pop();exports.DEBUG&&console.log(A.step,"NEQ[]",t,i),e.push(t!==i?1:0)}function Av(A){var e=A.stack,t=e.pop();exports.DEBUG&&console.log(A.step,"ODD[]",t),e.push(Math.trunc(t)%2?1:0)}function ev(A){var e=A.stack,t=e.pop();exports.DEBUG&&console.log(A.step,"EVEN[]",t),e.push(Math.trunc(t)%2?0:1)}function tv(A){var e=A.stack.pop();exports.DEBUG&&console.log(A.step,"IF[]",e),e||(Nl(A,!0),exports.DEBUG&&console.log(A.step,"EIF[]"))}function iv(A){exports.DEBUG&&console.log(A.step,"EIF[]")}function nv(A){var e=A.stack,t=e.pop(),i=e.pop();exports.DEBUG&&console.log(A.step,"AND[]",t,i),e.push(t&&i?1:0)}function ov(A){var e=A.stack,t=e.pop(),i=e.pop();exports.DEBUG&&console.log(A.step,"OR[]",t,i),e.push(t||i?1:0)}function rv(A){var e=A.stack,t=e.pop();exports.DEBUG&&console.log(A.step,"NOT[]",t),e.push(t?0:1)}function Ar(A,e){var t=e.stack,i=t.pop(),n=e.fv,o=e.pv,r=e.ppem,g=e.deltaBase+(A-1)*16,s=e.deltaShift,a=e.z0;exports.DEBUG&&console.log(e.step,"DELTAP["+A+"]",i,t);for(var I=0;I>4);if(Q===r){var h=(C&15)-8;h>=0&&h++,exports.DEBUG&&console.log(e.step,"DELTAPFIX",l,"by",h*s);var f=a[l];n.setRelative(f,f,h*s,o)}}}function gv(A){var e=A.stack,t=e.pop();exports.DEBUG&&console.log(A.step,"SDB[]",t),A.deltaBase=t}function sv(A){var e=A.stack,t=e.pop();exports.DEBUG&&console.log(A.step,"SDS[]",t),A.deltaShift=Math.pow(.5,t)}function av(A){var e=A.stack,t=e.pop(),i=e.pop();exports.DEBUG&&console.log(A.step,"ADD[]",t,i),e.push(i+t)}function Iv(A){var e=A.stack,t=e.pop(),i=e.pop();exports.DEBUG&&console.log(A.step,"SUB[]",t,i),e.push(i-t)}function Cv(A){var e=A.stack,t=e.pop(),i=e.pop();exports.DEBUG&&console.log(A.step,"DIV[]",t,i),e.push(i*64/t)}function lv(A){var e=A.stack,t=e.pop(),i=e.pop();exports.DEBUG&&console.log(A.step,"MUL[]",t,i),e.push(i*t/64)}function Bv(A){var e=A.stack,t=e.pop();exports.DEBUG&&console.log(A.step,"ABS[]",t),e.push(Math.abs(t))}function Qv(A){var e=A.stack,t=e.pop();exports.DEBUG&&console.log(A.step,"NEG[]",t),e.push(-t)}function cv(A){var e=A.stack,t=e.pop();exports.DEBUG&&console.log(A.step,"FLOOR[]",t),e.push(Math.floor(t/64)*64)}function Ev(A){var e=A.stack,t=e.pop();exports.DEBUG&&console.log(A.step,"CEILING[]",t),e.push(Math.ceil(t/64)*64)}function xn(A,e){var t=e.stack,i=t.pop();exports.DEBUG&&console.log(e.step,"ROUND[]"),t.push(e.round(i/64)*64)}function uv(A){var e=A.stack,t=e.pop(),i=e.pop();exports.DEBUG&&console.log(A.step,"WCVTF[]",t,i),A.cvt[i]=t*A.ppem/A.font.unitsPerEm}function er(A,e){var t=e.stack,i=t.pop(),n=e.ppem,o=e.deltaBase+(A-1)*16,r=e.deltaShift;exports.DEBUG&&console.log(e.step,"DELTAC["+A+"]",i,t);for(var g=0;g>4);if(I===n){var l=(a&15)-8;l>=0&&l++;var C=l*r;exports.DEBUG&&console.log(e.step,"DELTACFIX",s,"by",C),e.cvt[s]+=C}}}function hv(A){var e=A.stack.pop();exports.DEBUG&&console.log(A.step,"SROUND[]",e),A.round=bl;var t;switch(e&192){case 0:t=.5;break;case 64:t=1;break;case 128:t=2;break;default:throw new Error("invalid SROUND value")}switch(A.srPeriod=t,e&48){case 0:A.srPhase=0;break;case 16:A.srPhase=.25*t;break;case 32:A.srPhase=.5*t;break;case 48:A.srPhase=.75*t;break;default:throw new Error("invalid SROUND value")}e&=15,e===0?A.srThreshold=0:A.srThreshold=(e/8-.5)*t}function fv(A){var e=A.stack.pop();exports.DEBUG&&console.log(A.step,"S45ROUND[]",e),A.round=bl;var t;switch(e&192){case 0:t=Math.sqrt(2)/2;break;case 64:t=Math.sqrt(2);break;case 128:t=2*Math.sqrt(2);break;default:throw new Error("invalid S45ROUND value")}switch(A.srPeriod=t,e&48){case 0:A.srPhase=0;break;case 16:A.srPhase=.25*t;break;case 32:A.srPhase=.5*t;break;case 48:A.srPhase=.75*t;break;default:throw new Error("invalid S45ROUND value")}e&=15,e===0?A.srThreshold=0:A.srThreshold=(e/8-.5)*t}function dv(A){exports.DEBUG&&console.log(A.step,"ROFF[]"),A.round=ek}function pv(A){exports.DEBUG&&console.log(A.step,"RUTG[]"),A.round=nk}function mv(A){exports.DEBUG&&console.log(A.step,"RDTG[]"),A.round=ok}function yv(A){var e=A.stack.pop();exports.DEBUG&&console.log(A.step,"SCANCTRL[]",e)}function Na(A,e){var t=e.stack,i=t.pop(),n=t.pop(),o=e.z2[i],r=e.z1[n];exports.DEBUG&&console.log(e.step,"SDPVTL["+A+"]",i,n);var g,s;A?(g=o.y-r.y,s=r.x-o.x):(g=r.x-o.x,s=r.y-o.y),e.dpv=Dn(g,s)}function wv(A){var e=A.stack,t=e.pop(),i=0;exports.DEBUG&&console.log(A.step,"GETINFO[]",t),t&1&&(i=35),t&32&&(i|=4096),e.push(i)}function Dv(A){var e=A.stack,t=e.pop(),i=e.pop(),n=e.pop();exports.DEBUG&&console.log(A.step,"ROLL[]"),e.push(i),e.push(t),e.push(n)}function kv(A){var e=A.stack,t=e.pop(),i=e.pop();exports.DEBUG&&console.log(A.step,"MAX[]",t,i),e.push(Math.max(i,t))}function vv(A){var e=A.stack,t=e.pop(),i=e.pop();exports.DEBUG&&console.log(A.step,"MIN[]",t,i),e.push(Math.min(i,t))}function Fv(A){var e=A.stack.pop();exports.DEBUG&&console.log(A.step,"SCANTYPE[]",e)}function Sv(A){var e=A.stack.pop(),t=A.stack.pop();switch(exports.DEBUG&&console.log(A.step,"INSTCTRL[]",e,t),e){case 1:A.inhibitGridFit=!!t;return;case 2:A.ignoreCvt=!!t;return;default:throw new Error("invalid INSTCTRL[] selector")}}function bt(A,e){var t=e.stack,i=e.prog,n=e.ip;exports.DEBUG&&console.log(e.step,"PUSHB["+A+"]");for(var o=0;o=0?1:-1,u=Math.abs(u),A&&(D=o.cvt[g],i&&Math.abs(u-D)":"_")+(i?"R":"_")+(n===0?"Gr":n===1?"Bl":n===2?"Wh":"")+"]",A?g+"("+o.cvt[g]+","+D+")":"",s,"(d =",f,"->",E*u,")"),o.rp1=o.rp0,o.rp2=s,e&&(o.rp0=s)}vl=[ha.bind(void 0,pt),ha.bind(void 0,nt),fa.bind(void 0,pt),fa.bind(void 0,nt),da.bind(void 0,pt),da.bind(void 0,nt),pa.bind(void 0,0),pa.bind(void 0,1),ma.bind(void 0,0),ma.bind(void 0,1),gk,sk,ak,Ik,Ck,lk,Bk,Qk,ck,Ek,uk,hk,fk,dk,pk,mk,yk,wk,Dk,kk,void 0,void 0,vk,$o,Fk,Sk,Rk,Gk,Lk,void 0,void 0,void 0,bk,Nk,Uk,void 0,ya.bind(void 0,0),ya.bind(void 0,1),wa.bind(void 0,pt),wa.bind(void 0,nt),Da.bind(void 0,0),Da.bind(void 0,1),ka.bind(void 0,0),ka.bind(void 0,1),va.bind(void 0,0),va.bind(void 0,1),Mk,xk,Fa.bind(void 0,0),Fa.bind(void 0,1),Jk,Tk,Sa.bind(void 0,0),Sa.bind(void 0,1),Hk,Yk,_k,Kk,Ok,Pk,Ra.bind(void 0,0),Ra.bind(void 0,1),void 0,ba.bind(void 0,0),ba.bind(void 0,1),Vk,void 0,Wk,void 0,void 0,qk,jk,Zk,Xk,zk,$k,Av,ev,tv,iv,nv,ov,rv,Ar.bind(void 0,1),gv,sv,av,Iv,Cv,lv,Bv,Qv,cv,Ev,xn.bind(void 0,0),xn.bind(void 0,1),xn.bind(void 0,2),xn.bind(void 0,3),void 0,void 0,void 0,void 0,uv,Ar.bind(void 0,2),Ar.bind(void 0,3),er.bind(void 0,1),er.bind(void 0,2),er.bind(void 0,3),hv,fv,void 0,void 0,dv,void 0,pv,mv,$o,$o,void 0,void 0,void 0,void 0,void 0,yv,Na.bind(void 0,0),Na.bind(void 0,1),wv,void 0,Dv,kv,vv,Fv,Sv,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,bt.bind(void 0,1),bt.bind(void 0,2),bt.bind(void 0,3),bt.bind(void 0,4),bt.bind(void 0,5),bt.bind(void 0,6),bt.bind(void 0,7),bt.bind(void 0,8),Nt.bind(void 0,1),Nt.bind(void 0,2),Nt.bind(void 0,3),Nt.bind(void 0,4),Nt.bind(void 0,5),Nt.bind(void 0,6),Nt.bind(void 0,7),Nt.bind(void 0,8),CA.bind(void 0,0,0,0,0,0),CA.bind(void 0,0,0,0,0,1),CA.bind(void 0,0,0,0,0,2),CA.bind(void 0,0,0,0,0,3),CA.bind(void 0,0,0,0,1,0),CA.bind(void 0,0,0,0,1,1),CA.bind(void 0,0,0,0,1,2),CA.bind(void 0,0,0,0,1,3),CA.bind(void 0,0,0,1,0,0),CA.bind(void 0,0,0,1,0,1),CA.bind(void 0,0,0,1,0,2),CA.bind(void 0,0,0,1,0,3),CA.bind(void 0,0,0,1,1,0),CA.bind(void 0,0,0,1,1,1),CA.bind(void 0,0,0,1,1,2),CA.bind(void 0,0,0,1,1,3),CA.bind(void 0,0,1,0,0,0),CA.bind(void 0,0,1,0,0,1),CA.bind(void 0,0,1,0,0,2),CA.bind(void 0,0,1,0,0,3),CA.bind(void 0,0,1,0,1,0),CA.bind(void 0,0,1,0,1,1),CA.bind(void 0,0,1,0,1,2),CA.bind(void 0,0,1,0,1,3),CA.bind(void 0,0,1,1,0,0),CA.bind(void 0,0,1,1,0,1),CA.bind(void 0,0,1,1,0,2),CA.bind(void 0,0,1,1,0,3),CA.bind(void 0,0,1,1,1,0),CA.bind(void 0,0,1,1,1,1),CA.bind(void 0,0,1,1,1,2),CA.bind(void 0,0,1,1,1,3),CA.bind(void 0,1,0,0,0,0),CA.bind(void 0,1,0,0,0,1),CA.bind(void 0,1,0,0,0,2),CA.bind(void 0,1,0,0,0,3),CA.bind(void 0,1,0,0,1,0),CA.bind(void 0,1,0,0,1,1),CA.bind(void 0,1,0,0,1,2),CA.bind(void 0,1,0,0,1,3),CA.bind(void 0,1,0,1,0,0),CA.bind(void 0,1,0,1,0,1),CA.bind(void 0,1,0,1,0,2),CA.bind(void 0,1,0,1,0,3),CA.bind(void 0,1,0,1,1,0),CA.bind(void 0,1,0,1,1,1),CA.bind(void 0,1,0,1,1,2),CA.bind(void 0,1,0,1,1,3),CA.bind(void 0,1,1,0,0,0),CA.bind(void 0,1,1,0,0,1),CA.bind(void 0,1,1,0,0,2),CA.bind(void 0,1,1,0,0,3),CA.bind(void 0,1,1,0,1,0),CA.bind(void 0,1,1,0,1,1),CA.bind(void 0,1,1,0,1,2),CA.bind(void 0,1,1,0,1,3),CA.bind(void 0,1,1,1,0,0),CA.bind(void 0,1,1,1,0,1),CA.bind(void 0,1,1,1,0,2),CA.bind(void 0,1,1,1,0,3),CA.bind(void 0,1,1,1,1,0),CA.bind(void 0,1,1,1,1,1),CA.bind(void 0,1,1,1,1,2),CA.bind(void 0,1,1,1,1,3)];function Ui(A){this.char=A,this.state={},this.activeState=null}function yg(A,e,t){this.contextName=t,this.startIndex=A,this.endOffset=e}function Rv(A,e,t){this.contextName=A,this.openRange=null,this.ranges=[],this.checkStart=e,this.checkEnd=t}function Ve(A,e){this.context=A,this.index=e,this.length=A.length,this.current=A[e],this.backtrack=A.slice(0,e),this.lookahead=A.slice(e+1)}function Lo(A){this.eventId=A,this.subscribers=[]}function bv(A){var e=this,t=["start","end","next","newToken","contextStart","contextEnd","insertToken","removeToken","removeRange","replaceToken","replaceRange","composeRUD","updateContextsRanges"];t.forEach(function(n){Object.defineProperty(e.events,n,{value:new Lo(n)})}),A&&t.forEach(function(n){var o=A[n];typeof o=="function"&&e.events[n].subscribe(o)});var i=["insertToken","removeToken","removeRange","replaceToken","replaceRange","composeRUD"];i.forEach(function(n){e.events[n].subscribe(e.updateContextsRanges)})}function zA(A){this.tokens=[],this.registeredContexts={},this.contextCheckers=[],this.events={},this.registeredModifiers=[],bv.call(this,A)}Ui.prototype.setState=function(A,e){return this.state[A]=e,this.activeState={key:A,value:this.state[A]},this.activeState};Ui.prototype.getState=function(A){return this.state[A]||null};zA.prototype.inboundIndex=function(A){return A>=0&&A0&&A<=this.lookahead.length):return this.lookahead[A-1];default:return null}};zA.prototype.rangeToText=function(A){if(A instanceof yg)return this.getRangeTokens(A).map(function(e){return e.char}).join("")};zA.prototype.getText=function(){return this.tokens.map(function(A){return A.char}).join("")};zA.prototype.getContext=function(A){var e=this.registeredContexts[A];return e||null};zA.prototype.on=function(A,e){var t=this.events[A];return t?t.subscribe(e):null};zA.prototype.dispatch=function(A,e){var t=this,i=this.events[A];i instanceof Lo&&i.subscribers.forEach(function(n){n.apply(t,e||[])})};zA.prototype.registerContextChecker=function(A,e,t){if(this.getContext(A))return{FAIL:"context name '"+A+"' is already registered."};if(typeof e!="function")return{FAIL:"missing context start check."};if(typeof t!="function")return{FAIL:"missing context end check."};var i=new Rv(A,e,t);return this.registeredContexts[A]=i,this.contextCheckers.push(i),i};zA.prototype.getRangeTokens=function(A){var e=A.startIndex+A.endOffset;return[].concat(this.tokens.slice(A.startIndex,e))};zA.prototype.getContextRanges=function(A){var e=this.getContext(A);return e?e.ranges:{FAIL:"context checker '"+A+"' is not registered."}};zA.prototype.resetContextsRanges=function(){var A=this.registeredContexts;for(var e in A)if(A.hasOwnProperty(e)){var t=A[e];t.ranges=[]}};zA.prototype.updateContextsRanges=function(){this.resetContextsRanges();for(var A=this.tokens.map(function(i){return i.char}),e=0;e=n.start&&A<=n.end){var o=A-n.start;return n.index+o}}break;default:return-1}return-1}function Gv(A,e){var t=kn(A,e.coverage);return t===-1?null:A+e.deltaGlyphId}function Lv(A,e){var t=kn(A,e.coverage);return t===-1?null:e.substitute[t]}function tr(A,e){for(var t=[],i=0;i=0;t--){var i=e[t],n=Gl(i),o=Pt(i);if(!n&&!o)return!0;if(n)return!1}return!1}function jv(A){if(Gl(A.current))return!1;for(var e=0;e0}t("fontFamily"),t("weightName"),t("manufacturer"),t("copyright"),t("version"),this.unitsPerEm>0};YA.prototype.toTables=function(){return WD.fontToTable(this)};YA.prototype.toBuffer=function(){return console.warn("Font.toBuffer is deprecated. Use Font.toArrayBuffer instead."),this.toArrayBuffer()};YA.prototype.toArrayBuffer=function(){for(var A=this.toTables(),e=A.encode(),t=new ArrayBuffer(e.length),i=new Uint8Array(t),n=0;n=1.2&&(n.markGlyphSets=t.parsePointer(hF)),n}var dF={parse:fF},We=new Array(10);We[1]=function(){var e=this.offset+this.relativeOffset,t=this.parseUShort();if(t===1)return{posFormat:1,coverage:this.parsePointer(J.coverage),value:this.parseValueRecord()};if(t===2)return{posFormat:2,coverage:this.parsePointer(J.coverage),values:this.parseValueRecordList()};mA.assert(!1,"0x"+e.toString(16)+": GPOS lookup type 1 format must be 1 or 2.")};We[2]=function(){var e=this.offset+this.relativeOffset,t=this.parseUShort();mA.assert(t===1||t===2,"0x"+e.toString(16)+": GPOS lookup type 2 format must be 1 or 2.");var i=this.parsePointer(J.coverage),n=this.parseUShort(),o=this.parseUShort();if(t===1)return{posFormat:t,coverage:i,valueFormat1:n,valueFormat2:o,pairSets:this.parseList(J.pointer(J.list(function(){return{secondGlyph:this.parseUShort(),value1:this.parseValueRecord(n),value2:this.parseValueRecord(o)}})))};if(t===2){var r=this.parsePointer(J.classDef),g=this.parsePointer(J.classDef),s=this.parseUShort(),a=this.parseUShort();return{posFormat:t,coverage:i,valueFormat1:n,valueFormat2:o,classDef1:r,classDef2:g,class1Count:s,class2Count:a,classRecords:this.parseList(s,J.list(a,function(){return{value1:this.parseValueRecord(n),value2:this.parseValueRecord(o)}}))}}};We[3]=function(){return{error:"GPOS Lookup 3 not supported"}};We[4]=function(){return{error:"GPOS Lookup 4 not supported"}};We[5]=function(){return{error:"GPOS Lookup 5 not supported"}};We[6]=function(){return{error:"GPOS Lookup 6 not supported"}};We[7]=function(){return{error:"GPOS Lookup 7 not supported"}};We[8]=function(){return{error:"GPOS Lookup 8 not supported"}};We[9]=function(){return{error:"GPOS Lookup 9 not supported"}};function pF(A,e){e=e||0;var t=new J(A,e),i=t.parseVersion(1);return mA.argument(i===1||i===1.1,"Unsupported GPOS table version "+i),i===1?{version:i,scripts:t.parseScriptList(),features:t.parseFeatureList(),lookups:t.parseLookupList(We)}:{version:i,scripts:t.parseScriptList(),features:t.parseFeatureList(),lookups:t.parseLookupList(We),variations:t.parseFeatureVariationsList()}}var mF=new Array(10);function yF(A){return new aA.Table("GPOS",[{name:"version",type:"ULONG",value:65536},{name:"scripts",type:"TABLE",value:new aA.ScriptList(A.scripts)},{name:"features",type:"TABLE",value:new aA.FeatureList(A.features)},{name:"lookups",type:"TABLE",value:new aA.LookupList(A.lookups,mF)}])}var wF={parse:pF,make:yF};function DF(A){var e={};A.skip("uShort");var t=A.parseUShort();mA.argument(t===0,"Unsupported kern sub-table version."),A.skip("uShort",2);var i=A.parseUShort();A.skip("uShort",3);for(var n=0;n1&&console.warn("Only the first kern subtable is supported."),A.skip("uLong");var i=A.parseUShort(),n=i&255;if(A.skip("uShort"),n===0){var o=A.parseUShort();A.skip("uShort",3);for(var r=0;r"u",n=i&&!t.isUrl?bF:NF;return new Promise(function(o,r){n(A,function(g,s){if(g){if(e)return e(g);r(g)}var a;try{a=kg(s,t)}catch(I){if(e)return e(I,null);r(I)}if(e)return e(null,a);o(a)})})}function UF(A,e){var t=require("fs"),i=t.readFileSync(A);return kg(ml(i),e)}var Hr=Object.freeze({__proto__:null,Font:YA,Glyph:Ne,Path:ie,BoundingBox:St,_parse:lA,parse:kg,load:LF,loadSync:UF});const MF="modulepreload",xF=function(A,e){return new URL(A,e).href},xa={},Ul=function(e,t,i){let n=Promise.resolve();if(t&&t.length>0){const r=document.getElementsByTagName("link"),g=document.querySelector("meta[property=csp-nonce]"),s=(g==null?void 0:g.nonce)||(g==null?void 0:g.getAttribute("nonce"));n=Promise.allSettled(t.map(a=>{if(a=xF(a,i),a in xa)return;xa[a]=!0;const I=a.endsWith(".css"),l=I?'[rel="stylesheet"]':"";if(!!i)for(let h=r.length-1;h>=0;h--){const f=r[h];if(f.href===a&&(!I||f.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${a}"]${l}`))return;const Q=document.createElement("link");if(Q.rel=I?"stylesheet":MF,I||(Q.as="script"),Q.crossOrigin="",Q.href=a,s&&Q.setAttribute("nonce",s),document.head.appendChild(Q),I)return new Promise((h,f)=>{Q.addEventListener("load",h),Q.addEventListener("error",()=>f(new Error(`Unable to preload CSS for ${a}`)))})}))}function o(r){const g=new Event("vite:preloadError",{cancelable:!0});if(g.payload=r,window.dispatchEvent(g),!g.defaultPrevented)throw r}return n.then(r=>{for(const g of r||[])g.status==="rejected"&&o(g.reason);return e().catch(o)})},JF=()=>Ul(()=>import("./ft_render-ByO_jG18.js"),[],import.meta.url);let j=null,Qn=0;const TF=new Promise(A=>{JF().then(e=>{e.default().then(t=>{j=t,A()})})});function Ja(A){return A/65536}function Ue(A){return A/64}function Hi(A){return A>=0?A:A+256}let Ml,xl,Jl,vg,Tl,Hl,Yl;async function HF(){if(await TF,j._init_constants(),Ml=j.cwrap("FT_New_Memory_Face","number",["number","number","number","number","number"]),xl=j.cwrap("FT_Set_Char_Size","number",["number","number","number","number","number"]),Jl=j.cwrap("FT_Set_Pixel_Sizes","number",["number","number","number"]),vg=j.cwrap("FT_Get_Char_Index","number",["number","number"]),Tl=j.cwrap("FT_Load_Glyph","number",["number","number","number"]),Hl=j.cwrap("FT_Get_Sfnt_Table","number",["number","number"]),j.cwrap("FT_Get_Kerning","number",["number","number","number","number","number"]),Yl=j.cwrap("FT_Done_Face","number",["number"]),!Qn){let A=j._malloc(4);try{let e=j.ccall("FT_Init_FreeType","number",["number"],[A]);if(e)throw new Error(`error in FT_Init_FreeType: ${e}`);Qn=j.getValue(A,"i32")}finally{j._free(A)}}}function YF(A,e){let t,i;if(A instanceof ArrayBuffer)i=A.byteLength;else if(A instanceof Uint8Array)i=A.byteLength;else if(A&&typeof A.length=="number")i=A.length;else throw new Error("Invalid font source format");let n={ptr:0,font:j._malloc(i)};const o=A instanceof ArrayBuffer?new Uint8Array(A):A;j.writeArrayToMemory(o,n.font);let r=j._malloc(4);try{if(t=Ml(Qn,n.font,i,0,r),t)throw new Error(`error in FT_New_Memory_Face: ${t}`);n.ptr=j.getValue(r,"i32")}finally{j._free(r)}if(t=xl(n.ptr,0,e*64,300,300),t)throw new Error(`error in FT_Set_Char_Size: ${t}`);if(t=Jl(n.ptr,0,e),t)throw new Error(`error in FT_Set_Pixel_Sizes: ${t}`);let g=j.getValue(n.ptr+j.OFFSET_FACE_UNITS_PER_EM,"i16"),s=j.getValue(n.ptr+j.OFFSET_FACE_ASCENDER,"i16"),a=j.getValue(n.ptr+j.OFFSET_FACE_DESCENDER,"i16"),I=j.getValue(n.ptr+j.OFFSET_FACE_HEIGHT,"i16");return Object.assign(n,{units_per_em:g,ascender:s,descender:a,height:I})}function _F(A){let e=Hl(A.ptr,j.FT_SFNT_OS2);if(!e)throw new Error("os/2 table not found for this font");let t=j.getValue(e+j.OFFSET_TT_OS2_ASCENDER,"i16"),i=j.getValue(e+j.OFFSET_TT_OS2_DESCENDER,"i16"),n=j.getValue(e+j.OFFSET_TT_OS2_LINEGAP,"i16");return{typoAscent:t,typoDescent:i,typoLineGap:n}}function nr(A,e){return vg(A.ptr,e)!==0}function KF(A,e,t={}){let i=vg(A.ptr,e);if(i===0)throw new Error(`glyph does not exist for codepoint ${e}`);let n=j.FT_LOAD_RENDER;t.mono?n|=j.FT_LOAD_TARGET_MONO:t.lcd?n|=j.FT_LOAD_TARGET_LCD:t.lcd_v?n|=j.FT_LOAD_TARGET_LCD_V:t.autohint_strong?n|=j.FT_LOAD_TARGET_NORMAL:n|=j.FT_LOAD_TARGET_LIGHT,t.autohint_off?n|=j.FT_LOAD_NO_AUTOHINT:n|=j.FT_LOAD_FORCE_AUTOHINT,t.use_color_info&&(n|=j.FT_LOAD_COLOR);let o=Tl(A.ptr,i,n);if(o)throw new Error(`error in FT_Load_Glyph: ${o}`);let r=j.getValue(A.ptr+j.OFFSET_FACE_GLYPH,"i32"),g={glyph_index:j.getValue(r+j.OFFSET_GLYPH_INDEX,"i32"),metrics:{width:Ue(j.getValue(r+j.OFFSET_GLYPH_METRICS_WIDTH,"i32")),height:Ue(j.getValue(r+j.OFFSET_GLYPH_METRICS_HEIGHT,"i32")),horiBearingX:Ue(j.getValue(r+j.OFFSET_GLYPH_METRICS_HORI_BEARING_X,"i32")),horiBearingY:Ue(j.getValue(r+j.OFFSET_GLYPH_METRICS_HORI_BEARING_Y,"i32")),horiAdvance:Ue(j.getValue(r+j.OFFSET_GLYPH_METRICS_HORI_ADVANCE,"i32")),vertBearingX:Ue(j.getValue(r+j.OFFSET_GLYPH_METRICS_VERT_BEARING_X,"i32")),vertBearingY:Ue(j.getValue(r+j.OFFSET_GLYPH_METRICS_VERT_BEARING_Y,"i32")),vertAdvance:Ue(j.getValue(r+j.OFFSET_GLYPH_METRICS_VERT_ADVANCE,"i32"))},linearHoriAdvance:Ja(j.getValue(r+j.OFFSET_GLYPH_LINEAR_HORI_ADVANCE,"i32")),linearVertAdvance:Ja(j.getValue(r+j.OFFSET_GLYPH_LINEAR_VERT_ADVANCE,"i32")),advance:{x:Ue(j.getValue(r+j.OFFSET_GLYPH_ADVANCE_X,"i32")),y:Ue(j.getValue(r+j.OFFSET_GLYPH_ADVANCE_Y,"i32"))},bitmap:{width:j.getValue(r+j.OFFSET_GLYPH_BITMAP_WIDTH,"i32"),rows:j.getValue(r+j.OFFSET_GLYPH_BITMAP_ROWS,"i32"),pitch:j.getValue(r+j.OFFSET_GLYPH_BITMAP_PITCH,"i32"),num_grays:j.getValue(r+j.OFFSET_GLYPH_BITMAP_NUM_GRAYS,"i16"),pixel_mode:j.getValue(r+j.OFFSET_GLYPH_BITMAP_PIXEL_MODE,"i8"),palette_mode:j.getValue(r+j.OFFSET_GLYPH_BITMAP_PALETTE_MODE,"i8")},bitmap_left:j.getValue(r+j.OFFSET_GLYPH_BITMAP_LEFT,"i32"),bitmap_top:j.getValue(r+j.OFFSET_GLYPH_BITMAP_TOP,"i32"),lsb_delta:Ue(j.getValue(r+j.OFFSET_GLYPH_LSB_DELTA,"i32")),rsb_delta:Ue(j.getValue(r+j.OFFSET_GLYPH_RSB_DELTA,"i32"))},s=g.bitmap.width,a=g.bitmap.rows,I=g.bitmap_left,l=g.bitmap_top,C=j.getValue(r+j.OFFSET_GLYPH_BITMAP_BUFFER,"i32"),Q=Math.abs(g.bitmap.pitch),h=g.linearHoriAdvance,f=g.linearVertAdvance,u=g.bitmap.pixel_mode,E=[];for(let D=0;D255&&(S=255),_=(255-S)*_/255,d.push(_)}else{let v=j.getValue(c+p,"i8");d.push(Hi(v))}E.push(d)}return{x:I,y:l,width:s,height:a,advance_x:h,advance_y:f,pixels:E,freetype:g}}function OF(A){let e=Yl(A.ptr);if(e)throw new Error(`error in FT_Done_Face: ${e}`);j._free(A.font),A.ptr=0,A.font=0}function PF(){let A=j.ccall("FT_Done_FreeType","number",["number"],[Qn]);if(A)throw new Error(`error in FT_Done_FreeType: ${A}`);Qn=0}class yt extends Error{constructor(e){super(e),this.name="AppError",Error.captureStackTrace&&Error.captureStackTrace(this,yt)}}class VF{constructor(){this.data={}}add_range(e,t,i,n){let o=n-t,r=[];for(let g=t;g<=i;g++)this._set_char(e,g,g+o),r.push(g);return r}add_symbols(e,t){let i=[];for(let n of t){let o=n.codePointAt(0);this._set_char(e,o,o),i.push(o)}return i}_set_char(e,t,i){this.data[i]={font:e,code:t}}get(){return this.data}}async function WF(A){await HF();let e={};A.font.forEach(C=>{e[C.source_path]=C});let t={},i={};for(let{source_path:C,source_bin:Q}of A.font)if(!t[C])try{let h=Q;h instanceof File?h=await h.arrayBuffer():h instanceof Uint8Array&&(h=h.buffer.slice(h.byteOffset,h.byteOffset+h.byteLength)),t[C]=Hr.parse(h),i[C]=YF(h,A.size)}catch(h){throw new yt(`Cannot load font "${C}": ${h.message}`)}let n=new VF;for(let{source_path:C,ranges:Q}of A.font){let h=i[C];for(let f of Q){if(f.range)for(let u=0;uC-Q).map(Number);for(let C of g){let Q=o[C].code,h=o[C].font;if(!nr(i[h],Q))continue;let f=KF(i[h],Q,{autohint_off:e[h].autohint_off,autohint_strong:e[h].autohint_strong,lcd:A.lcd,lcd_v:A.lcd_v,mono:!A.lcd&&!A.lcd_v&&A.bpp===1,use_color_info:A.use_color_info});r.push({code:C,advanceWidth:f.advance_x,bbox:{x:f.x,y:f.y-f.height,width:f.width,height:f.height},kerning:{},freetype:f.freetype,pixels:f.pixels})}if(!A.no_kerning){let C=r.map(Q=>Q.code);for(let{code:Q,kerning:h}of r){let f=o[Q].code,u=o[Q].font,E=t[u],D=E.charToGlyph(String.fromCodePoint(f));for(let c of C){if(o[c].font!==u)continue;let d=o[c].code,p=E.charToGlyph(String.fromCodePoint(d)),v=E.getKerningValue(D,p);v&&(h[c]=v*A.size/E.unitsPerEm)}}}let s=i[A.font[0].source_path],a=A.size/s.units_per_em,I=_F(s),l=t[A.font[0].source_path].tables.post;for(let C of Object.values(i))OF(C);return PF(),{ascent:Math.max(...r.map(C=>C.bbox.y+C.bbox.height)),descent:Math.min(...r.map(C=>C.bbox.y)),typoAscent:Math.round(I.typoAscent*a),typoDescent:Math.round(I.typoDescent*a),typoLineGap:Math.round(I.typoLineGap*a),size:A.size,glyphs:r,underlinePosition:Math.round(l.underlinePosition*a),underlineThickness:Math.round(l.underlineThickness*a)}}function qF(){return 16}function jF(A,e){return 16+(e-A+1)}function ZF(A){return 16+A*2}function Ta(A){A=A.sort((i,n)=>i-n);let e=[];for(let i=0;i=0?e[o-1].dist:0,g;A[i]-A[o]<256&&(g=jF(A[o],A[i]),r+g=0;){let n=e[i];t.unshift([n.format,A.slice(n.start,n.end+1)]),i=n.start-1}return t}const De=4,XF=(A,e,t)=>{A.setUint32(t,e,!0),A.setUint32(t+4,0,!0)};class zF{constructor(e,t){if(this.src=e,this.opts=t,this.font_name=t.lv_font_name,this.font_name||(this.font_name=t.output||"font"),t.bpp===3&&t.no_compress)throw new yt('LVGL supports "--bpp 3" with compression only');this.init_tables()}init_tables(){this.head=new $F(this),this.glyf=new eS(this),this.cmap=new tS(this),this.kern=new iS(this)}toCBin(){const[e,t]=this.glyf.toCBin(),i=this.cmap.toCBin(De),n=this.kern.toCBin(De),o=12+De*6+0,r=8+De*4,g=new ArrayBuffer(o+r),s=new DataView(g),a=(u,E)=>s.setUint32(E,u,!0);var I=0;a(0,I),I+=De,a(0,I),I+=De,a(0,I),I+=De,s.setUint32(I,this.src.ascent-this.src.descent,!0),I+=4,s.setInt32(I,-this.src.descent,!0),I+=4,s.setUint8(I,this.src.subpixels_mode||0),I+=1,s.setInt8(I,this.src.underlinePosition||0),I+=1,s.setInt8(I,this.src.underlineThickness||0),I+=1,I+=1,a(o,I),I+=De,a(0,I),I+=De,a(0,I),I+=De;const l=this.head.kern_ref();a(r+n.byteLength,I),I+=De,a(r+n.byteLength+e.byteLength,I),I+=De,a(r+n.byteLength+e.byteLength+t.byteLength,I),I+=De,a(l.dsc==="NULL"?0:r,I),I+=De,s.setUint16(I,l.scale,!0),I+=2;const C=this.cmap.getMapNumber(),Q=this.opts.bpp,h=l.classes,f=this.glyf.getCompressionCode();return s.setUint16(I,C|Q<<9|h<<13|f<<14,!0),I+=2,this.concatArrayBuffers([g,n,e,t,i])}concatArrayBuffers(e){const t=e.reduce((r,g)=>r+g.byteLength,0),i=new ArrayBuffer(t),n=new Uint8Array(i);let o=0;for(const r of e)n.set(new Uint8Array(r),o),o+=r.byteLength;return i}}class $F{constructor(e){this.font=e}kern_ref(){return this.font,{scale:0,dsc:"NULL",classes:0}}}class AS{constructor(e){this.buffer=new Uint8Array(e),this.byteIndex=0,this.bitIndex=0,this.bigEndian=!0}writeBits(e,t){for(;t>0;){const i=Math.min(8-this.bitIndex,t),n=(1<>t-i&n;this.bigEndian?this.buffer[this.byteIndex]|=o<<8-this.bitIndex-i:this.buffer[this.byteIndex]|=o<=8&&(this.byteIndex++,this.bitIndex=0),t-=i}}getUsedBytes(){return this.bitIndex>0?this.byteIndex+1:this.byteIndex}}class eS{constructor(e){this.font=e,this.lv_data=[],this.lv_compiled=!1}pixelsToBpp(e){const t=this.font.opts.bpp;return e.map(i=>i.map(n=>n>>>8-t))}storePixels(e,t){this.getCompressionCode()===0?this.storePixelsRaw(e,t):this.storePixelsCompressed(e,t)}storePixelsRaw(e,t){const i=this.font.opts.bpp;for(let n=0;n{const n=e.glyph_id[i.code],o=this.lv_bitmap(i);this.lv_data[n]={bin:o,offset:t,glyph:i},t+=o.byteLength})}toCBin(){this.lv_compile();const e=this.lv_data.slice(1).filter(r=>r).map(r=>r.bin),t=this.balign4(this.concatArrayBuffers(e)),i=new ArrayBuffer(this.lv_data.length*16+16),n=new DataView(i);let o=1;return this.lv_data.forEach(r=>{if(r){const g=Math.round(r.glyph.advanceWidth*16);n.setUint32(o*16,r.offset,!0),n.setUint32(o*16+4,g,!0),n.setUint16(o*16+8,r.glyph.bbox.width,!0),n.setUint16(o*16+10,r.glyph.bbox.height,!0),n.setInt16(o*16+12,r.glyph.bbox.x,!0),n.setInt16(o*16+14,r.glyph.bbox.y,!0)}o++}),[t,i]}balign4(e){const t=e.byteLength%4;if(t===0)return e;const i=4-t,n=new ArrayBuffer(i);return this.concatArrayBuffers([e,n])}concatArrayBuffers(e){const t=e.reduce((r,g)=>r+g.byteLength,0),i=new ArrayBuffer(t),n=new Uint8Array(i);let o=0;for(const r of e)n.set(new Uint8Array(r),o),o+=r.byteLength;return i}getCompressionCode(){return this.font.opts.no_compress||this.font.opts.bpp===1?0:this.font.opts.no_prefilter?2:1}}class tS{constructor(e){this.font=e,this.lv_compiled=!1,this.lv_subtables=[],this.subtables_plan=null,this.buildGlyphIdMap()}buildGlyphIdMap(){const e=this.font;e.glyph_id={},e.src.glyphs&&e.src.glyphs.forEach((t,i)=>{e.glyph_id[t.code]=i+1})}lv_format2enum(e){switch(e){case"format0_tiny":return"LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY";case"format0":return"LV_FONT_FMT_TXT_CMAP_FORMAT0_FULL";case"sparse_tiny":return"LV_FONT_FMT_TXT_CMAP_SPARSE_TINY";case"sparse":return"LV_FONT_FMT_TXT_CMAP_SPARSE_FULL";default:throw new Error("Unknown subtable format")}}lv_format2int(e){return["format0","sparse","format0_tiny","sparse_tiny"].indexOf(e)}getMapNumber(){if(!this.subtables_plan){const e=this.font;if(!e.src.glyphs||e.src.glyphs.length===0)return 0;this.subtables_plan=Ta(e.src.glyphs.map(t=>t.code))}return this.subtables_plan.length}glyphByCode(e){const t=this.font;return t.src.glyphs?t.src.glyphs.find(i=>i.code===e):null}collect_format0_data(e,t,i){const n=this.font,o=[];for(let r=e;r<=t;r++){const g=n.glyph_id[r]||0;o.push(g?g-i:0)}return o}collect_sparse_data(e,t){const i=this.font;let n=[],o=[];for(let r of e){let g=this.glyphByCode(r),s=i.glyph_id[g.code],a=r-e[0],I=s-t;if(a<0||a>65535)throw new Error("Codepoint delta out of range");if(I<0||I>65535)throw new Error("Glyph ID delta out of range");n.push(a),o.push(I)}return{codes:n,ids:o}}toCBin(e){const t=this.font;if(!t.src.glyphs||t.src.glyphs.length===0)return new ArrayBuffer(0);this.subtables_plan||(this.subtables_plan=Ta(t.src.glyphs.map(l=>l.code)));const i=this.subtables_plan;let n=0;const o=12+e*2+(e==4?0:4),r=new ArrayBuffer(i.length*o),g=new DataView(r),s=e==4?(l,C)=>g.setUint32(C,l,!0):(l,C)=>XF(g,l,C),a=[];let I=r.byteLength;for(let[l,C]of i){let Q=this.glyphByCode(C[0]),h=t.glyph_id[Q.code],f=C[0],u=C[C.length-1],E=!1,D=!1,c=0,d=new ArrayBuffer(0),p=new ArrayBuffer(0);if(l!=="format0_tiny")if(l==="format0"){D=!0;let N=this.collect_format0_data(f,u,h);c=N.length,d=this.balign4(this.uint8ArrayToBuffer(new Uint8Array(N)))}else if(l==="sparse_tiny"){E=!0;let N=this.collect_sparse_data(C,h);c=N.codes.length,p=this.balign4(this.uint16ArrayToBuffer(new Uint16Array(N.codes)))}else{E=!0,D=!0;let N=this.collect_sparse_data(C,h);c=N.codes.length,p=this.balign4(this.uint16ArrayToBuffer(new Uint16Array(N.codes))),d=this.align4(this.uint16ArrayToBuffer(new Uint16Array(N.ids)))}let v=n*o;g.setUint32(v,f,!0),v+=4,g.setUint16(v,u-f+1,!0),v+=2,g.setUint16(v,h,!0),v+=2,s(E?I:0,v),v+=e,I+=p.byteLength,s(D?I:0,v),v+=e,I+=d.byteLength,g.setUint16(v,c,!0),v+=2,g.setUint8(v,this.lv_format2int(l)),v+=1,a.push(p),a.push(d),n++}return this.concatArrayBuffers([r,...a])}balign4(e){const t=e.byteLength%4;if(t===0)return e;const i=4-t,n=new ArrayBuffer(i);return this.concatArrayBuffers([e,n])}align4(e){const t=e.byteLength%4;if(t===0)return e;const i=4-t,n=new ArrayBuffer(i);return this.concatArrayBuffers([e,n])}uint8ArrayToBuffer(e){const t=new ArrayBuffer(e.byteLength);return new Uint8Array(t).set(e),t}uint16ArrayToBuffer(e){return e.buffer.slice(0,e.byteLength)}concatArrayBuffers(e){const t=e.reduce((r,g)=>r+g.byteLength,0),i=new ArrayBuffer(t),n=new Uint8Array(i);let o=0;for(const r of e)n.set(new Uint8Array(r),o),o+=r.byteLength;return i}}class iS{constructor(e){this.font=e}toCBin(e){return new ArrayBuffer(0)}}function nS(A,e){if(!A.output)throw new yt('Output is required for "cbin" writer');const i=new zF(e,A).toCBin();return{[A.output]:i}}class oS{constructor(){this.initialized=!1,this.supportedFormats=["ttf","woff","woff2","otf"],this.charsetCache=new Map}async initialize(){if(!this.initialized)try{if(typeof Hr>"u")throw new Error("opentype.js not loaded");this.initialized=!0,console.log("BrowserFontConverter 初始化完成")}catch(e){throw console.error("BrowserFontConverter initialization failed:",e),e}}validateFont(e){if(!e)return!1;if(e instanceof File){const t=e.name.toLowerCase(),i=e.type.toLowerCase(),n=this.supportedFormats.some(r=>t.endsWith(`.${r}`)),o=["font/ttf","font/truetype","application/x-font-ttf","font/woff","font/woff2","application/font-woff","font/otf","application/x-font-otf"].some(r=>i.includes(r));return n||o}return e instanceof ArrayBuffer&&e.byteLength>0}async getFontInfo(e){try{let t;if(e instanceof File)t=await e.arrayBuffer();else if(e instanceof ArrayBuffer)t=e;else throw new Error("Unsupported font file type");const i=Hr.parse(t);return{familyName:this.getLocalizedName(i.names.fontFamily)||"Unknown",fullName:this.getLocalizedName(i.names.fullName)||"Unknown",postScriptName:this.getLocalizedName(i.names.postScriptName)||"Unknown",version:this.getLocalizedName(i.names.version)||"Unknown",unitsPerEm:i.unitsPerEm,ascender:i.ascender,descender:i.descender,numGlyphs:i.numGlyphs,supported:!0}}catch(t){return console.error("Failed to get font information:",t),{familyName:"Unknown",supported:!1,error:t.message}}}getLocalizedName(e){return e?e.zh||e["zh-CN"]||e.en||e[Object.keys(e)[0]]:null}async convertToCBIN(e){this.initialized||await this.initialize();const{fontFile:t,fontName:i,fontSize:n=20,bpp:o=4,charset:r="deepseek",symbols:g="",range:s="",compression:a=!1,lcd:I=!1,lcd_v:l=!1,progressCallback:C=null}=e;if(!this.validateFont(t))throw new yt("不支持的字体文件格式");try{C&&C(0,"Starting font processing...");let Q;t instanceof File?Q=await t.arrayBuffer():Q=t,C&&C(10,"Parsing font structure...");const{ranges:h,charSymbols:f}=await this.parseCharacterInputAsync(r,g,s);C&&C(20,"Preparing conversion parameters...");const u={font:[{source_path:i||"custom_font",source_bin:Q,ranges:[{range:h,symbols:f}],autohint_off:!1,autohint_strong:!1}],size:n,bpp:o,lcd:I,lcd_v:l,no_compress:!a,no_kerning:!1,use_color_info:!1,format:"cbin",output:i||"font"};C&&C(30,"Collecting font data...");const E=await WF(u);C&&C(70,"Generating CBIN format...");const D=nS(u,E),c=u.output;return C&&C(100,"Conversion completed!"),D[c]}catch(Q){throw console.error("Font conversion failed:",Q),new yt(`Font conversion failed: ${Q.message}`)}}async parseCharacterInputAsync(e,t,i){let n=[],o=t||"";return e==="full"?(n=[0,65535,0],{ranges:n,charSymbols:o}):(e&&e!=="custom"&&(o=await this.getCharsetContentAsync(e)+o),i&&(n=this.parseUnicodeRange(i)),{ranges:n,charSymbols:o})}parseCharacterInput(e,t,i){let n=[],o=t||"";return e==="full"?(n=[0,65535,0],{ranges:n,charSymbols:o}):(e&&e!=="custom"&&(o=this.getCharsetContent(e)+o),i&&(n=this.parseUnicodeRange(i)),{ranges:n,charSymbols:o})}async loadCharsetFromFile(e){const i={latin:"./static/charsets/latin1.txt",deepseek:"./static/charsets/deepseek.txt",gb2312:"./static/charsets/gb2312.txt",qwen:"./static/charsets/qwen18409.txt"}[e];if(!i)return null;try{const n=await fetch(i);if(!n.ok)throw new Error(`Failed to load charset file: ${n.status}`);const r=(await n.text()).split(` +`).join("");return this.charsetCache.set(e,r),r}catch(n){return console.error(`Failed to load charset ${e}:`,n),null}}getCharsetContent(e){const t={};return(e==="latin"||e==="deepseek"||e==="gb2312")&&this.charsetCache.has(e)?this.charsetCache.get(e):e==="basic"?this.getCharsetContent("latin"):t[e]||""}async getCharsetContentAsync(e){if(e==="basic"&&(e="latin"),this.charsetCache.has(e))return this.charsetCache.get(e);if(e==="latin"||e==="deepseek"||e==="gb2312"||e==="qwen"){const t=await this.loadCharsetFromFile(e);if(t)return t}return this.getCharsetContent(e)}parseUnicodeRange(e){const t=[],i=e.split(",");for(const n of i){const o=n.trim();if(o)if(o.includes("-")){const[r,g]=o.split("-"),s=this.parseHexOrDec(r),a=this.parseHexOrDec(g);s!==null&&a!==null&&t.push(s,a,s)}else{const r=this.parseHexOrDec(o);r!==null&&t.push(r,r,r)}}return t}parseHexOrDec(e){const t=e.trim();if(t.startsWith("0x")||t.startsWith("0X")){const n=parseInt(t,16);return isNaN(n)?null:n}const i=parseInt(t,10);return isNaN(i)?null:i}async estimateSizeAsync(e){const{fontSize:t=20,bpp:i=4,charset:n="latin",symbols:o="",range:r=""}=e;let g=o.length;if(n==="full")g=65536;else if(n&&n!=="custom"){const I=await this.getCharsetContentAsync(n);g+=I.length}if(r){const I=this.parseUnicodeRange(r);for(let l=0;l0}catch(e){return console.error("加载 FST 模型失败",e),!1}}packString(e,t){const i=new Uint8Array(t),n=Math.min(e.length,t);for(let o=0;o>8&255,t[2]=e>>16&255,t[3]=e>>24&255,t}packModels(){if(this.models.size===0)throw new Error("没有模型数据可打包");let e=0;const t=[];for(const[a,I]of Array.from(this.models.entries()).sort((l,C)=>l[0].localeCompare(C[0]))){e+=I.size;const l=Array.from(I.entries()).sort((C,Q)=>C[0].localeCompare(Q[0]));t.push({name:a,files:l})}const i=this.models.size;let n=4;for(const a of t)n+=36,n+=a.files.length*40;const o=n+Array.from(this.models.values()).reduce((a,I)=>a+Array.from(I.values()).reduce((l,C)=>l+C.byteLength,0),0),r=new Uint8Array(o);let g=0;r.set(this.packUint32(i),g),g+=4;let s=n;for(const a of t){r.set(this.packString(a.name,32),g),g+=32,r.set(this.packUint32(a.files.length),g),g+=4;for(const[I,l]of a.files)r.set(this.packString(I,32),g),g+=32,r.set(this.packUint32(s),g),g+=4,r.set(this.packUint32(l.byteLength),g),g+=4,s+=l.byteLength}for(const a of t)for(const[I,l]of a.files)r.set(new Uint8Array(l),g),g+=l.byteLength;return r.buffer}static async getAvailableModels(){try{return{WakeNet9:["wn9_alexa","wn9_astrolabe_tts","wn9_bluechip_tts2","wn9_computer_tts","wn9_haixiaowu_tts","wn9_heyily_tts2","wn9_heyprinter_tts","wn9_heywanda_tts","wn9_heywillow_tts","wn9_hiesp","wn9_hifairy_tts2","wn9_hijason_tts2","wn9_hijolly_tts2","wn9_hijoy_tts","wn9_hilexin","wn9_hilili_tts","wn9_himfive","wn9_himiaomiao_tts","wn9_hitelly_tts","wn9_hiwalle_tts2","wn9_hixiaoxing_tts","wn9_jarvis_tts","wn9_linaiban_tts2","wn9_miaomiaotongxue_tts","wn9_mycroft_tts","wn9_nihaobaiying_tts2","wn9_nihaodongdong_tts2","wn9_nihaomiaoban_tts2","wn9_nihaoxiaoan_tts2","wn9_nihaoxiaoxin_tts","wn9_nihaoxiaoyi_tts2","wn9_nihaoxiaozhi","wn9_nihaoxiaozhi_tts","wn9_sophia_tts","wn9_xiaoaitongxue","wn9_xiaobinxiaobin_tts","wn9_xiaojianxiaojian_tts2","wn9_xiaokangtongxue_tts2","wn9_xiaolongxiaolong_tts","wn9_xiaoluxiaolu_tts2","wn9_xiaomeitongxue_tts","wn9_xiaomingtongxue_tts2","wn9_xiaosurou_tts2","wn9_xiaotexiaote_tts2","wn9_xiaoyaxiaoya_tts2","wn9_xiaoyutongxue_tts2"],WakeNet9s:["wn9s_alexa","wn9s_hiesp","wn9s_hijason","wn9s_hilexin","wn9s_nihaoxiaozhi"]}}catch(e){return console.error("获取模型列表失败:",e),{WakeNet9:[],WakeNet9s:[]}}}static isValidModel(e,t){return t==="esp32c3"||t==="esp32c6"?e.startsWith("wn9s_"):e.startsWith("wn9_")}clear(){this.models.clear()}getStats(){let e=0,t=0;for(const i of this.models.values()){e+=i.size;for(const n of i.values())t+=n.byteLength}return{modelCount:this.models.size,fileCount:e,totalSize:t,models:Array.from(this.models.keys())}}validatePackingCompatibility(){const e="test_model",t=this.packString(e,32),i=305419896,n=this.packUint32(i);return{stringPacking:{input:e,output:Array.from(t).map(o=>`0x${o.toString(16).padStart(2,"0")}`),isASCII:t.every((o,r)=>r>=e.length||o===e.charCodeAt(r))},intPacking:{input:`0x${i.toString(16)}`,output:Array.from(n).map(o=>`0x${o.toString(16).padStart(2,"0")}`),isLittleEndian:n[0]===120&&n[3]===18}}}}class sS{constructor(){this.files=[],this.textEncoder=new TextEncoder}addFile(e,t,i={}){e.length>32&&console.warn(`Filename "${e}" exceeds 32 bytes and will be truncated`),this.files.push({filename:e,data:t,size:t.byteLength,width:i.width||0,height:i.height||0})}async getImageDimensions(e){return new Promise(t=>{try{const i=new Blob([e]),n=URL.createObjectURL(i),o=new Image;o.onload=()=>{URL.revokeObjectURL(n),t({width:o.width,height:o.height})},o.onerror=()=>{URL.revokeObjectURL(n),t({width:0,height:0})},o.src=n}catch{t({width:0,height:0})}})}parseSpecialImageFormat(e,t){const i=e.toLowerCase().split(".").pop();if([".sjpg",".spng",".sqoi"].includes("."+i))try{const n=new DataView(t),o=n.getUint16(14,!0),r=n.getUint16(16,!0);return{width:o,height:r}}catch(n){console.warn(`Failed to parse special image format: ${e}`,n)}return{width:0,height:0}}packUint32(e){const t=new Uint8Array(4);return t[0]=e&255,t[1]=e>>8&255,t[2]=e>>16&255,t[3]=e>>24&255,t}packUint16(e){const t=new Uint8Array(2);return t[0]=e&255,t[1]=e>>8&255,t}packString(e,t){const i=new Uint8Array(t),n=this.textEncoder.encode(e),o=Math.min(n.length,t);return i.set(n.slice(0,o),0),i}computeChecksum(e){let t=0;for(let i=0;i{const n=t.filename.split(".").pop()||"",o=i.filename.split(".").pop()||"";if(n!==o)return n.localeCompare(o);const r=t.filename.replace(/\.[^/.]+$/,""),g=i.filename.replace(/\.[^/.]+$/,"");return r.localeCompare(g)})}async generate(e=null){if(this.files.length===0)throw new Error("No files to package");e&&e(0,"Starting to package files...");const t=this.sortFiles(this.files),i=t.length,n=[];let o=0;for(let D=0;D0||v.height>0)d=v.width,p=v.height;else{const N=c.filename.toLowerCase().split(".").pop();if(["png","jpg","jpeg","gif","bmp","webp"].includes(N)){const G=await this.getImageDimensions(c.data);d=G.width,p=G.height}}}n.push({filename:c.filename,data:c.data,size:c.size,offset:o,width:d,height:p}),o+=2+c.size}e&&e(40,"Building file mapping table...");const r=i*44,g=new Uint8Array(r);let s=0;for(const D of n)g.set(this.packString(D.filename,32),s),s+=32,g.set(this.packUint32(D.size),s),s+=4,g.set(this.packUint32(D.offset),s),s+=4,g.set(this.packUint16(D.width),s),s+=2,g.set(this.packUint16(D.height),s),s+=2;e&&e(60,"Merging file data...");const a=new Uint8Array(o);let I=0;for(let D=0;D0?Math.round(e/this.files.length):0}}printFileList(){if(console.log("=== Packaged File List ==="),console.log(`Total files: ${this.files.length}`),this.files.length===0){console.log("No files available");return}this.sortFiles(this.files).forEach((i,n)=>{var s;const o=((s=i.filename.split(".").pop())==null?void 0:s.toLowerCase())||"unknown",r=(i.size/1024).toFixed(2),g=i.width&&i.height?`${i.width}x${i.height}`:"N/A";console.log(`${String(n+1).padStart(3," ")}. ${i.filename}`),console.log(` Type: ${o.toUpperCase()}`),console.log(` Size: ${r} KB (${i.size} bytes)`),console.log(` Dimensions: ${g}`),console.log("")});const t=this.getStats();console.log("=== File Statistics ==="),console.log(`Total size: ${(t.totalSize/1024).toFixed(2)} KB`),console.log(`Average size: ${(t.averageFileSize/1024).toFixed(2)} KB`),console.log("File type distribution:"),Object.entries(t.fileTypes).forEach(([i,n])=>{console.log(` ${i.toUpperCase()}: ${n} files`)})}clear(){this.files=[]}}let Jn={tool:{workerLocalUrl:`var gifsicle=function(){Me="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0,"undefined"!=typeof __filename&&(Me=Me||__filename);var Me,c=function(e){var j,r,h=void 0!==(e=e||{})?e:{},t=(h.ready=new Promise(function(e,r){j=e}),h.preRun=h.preRun||[],h.preRun.push(function(){if(h.folder&&h.folder.length)for(let e=0;e>10,56320|1023&s)))):i+=String.fromCharCode(u)}return i}function W(e,r){return e?g(E,e,r):""}function X(e,r,t,n){if(!(0>6,r[t++]=128|63&s}else if(s<=65535){if(i<=t+2)break;r[t++]=224|s>>12,r[t++]=128|s>>6&63,r[t++]=128|63&s}else{if(i<=t+3)break;r[t++]=240|s>>18,r[t++]=128|s>>12&63,r[t++]=128|s>>6&63,r[t++]=128|63&s}}return r[t]=0,t-o}function G(e){for(var r=0,t=0;t>2]=e}var x={splitPath:function(e){return/^(\\/?|)([\\s\\S]*?)((?:\\.{1,2}|[^\\/]+?|)(\\.[^.\\/]*|))(?:[\\/]*)$/.exec(e).slice(1)},normalizeArray:function(e,r){for(var t=0,n=e.length-1;0<=n;n--){var o=e[n];"."===o?e.splice(n,1):".."===o?(e.splice(n,1),t++):t&&(e.splice(n,1),t--)}if(r)for(;t;t--)e.unshift("..");return e},normalize:function(e){var r="/"===e.charAt(0),t="/"===e.substr(-1);return(e=(e=x.normalizeArray(e.split("/").filter(function(e){return!!e}),!r).join("/"))||r?e:".")&&t&&(e+="/"),(r?"/":"")+e},dirname:function(e){var e=x.splitPath(e),r=e[0],e=e[1];return r||e?r+(e=e&&e.substr(0,e.length-1)):"."},basename:function(e){if("/"===e)return"/";var r=e.lastIndexOf("/");return-1===r?e:e.substr(r+1)},extname:function(e){return x.splitPath(e)[3]},join:function(){var e=Array.prototype.slice.call(arguments,0);return x.normalize(e.join("/"))},join2:function(e,r){return x.normalize(e+"/"+r)}},R={resolve:function(){for(var e="",r=!1,t=arguments.length-1;-1<=t&&!r;t--){var n=0<=t?arguments[t]:T.cwd();if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");if(!n)return"";e=n+"/"+e,r="/"===n.charAt(0)}return(r?"/":"")+(e=x.normalizeArray(e.split("/").filter(function(e){return!!e}),!r).join("/"))||"."},relative:function(e,r){function t(e){for(var r=0;r>>0),0!=t&&(r=Math.max(r,256)),t=e.contents,e.contents=new Uint8Array(r),0r)e.contents.length=r;else for(;e.contents.length=e.node.usedBytes)return 0;var a=Math.min(e.node.usedBytes-o,n);if(8>>0)%T.nameTable.length},hashAddNode:function(e){var r=T.hashName(e.parent.id,e.name);e.name_next=T.nameTable[r],T.nameTable[r]=e},hashRemoveNode:function(e){var r=T.hashName(e.parent.id,e.name);if(T.nameTable[r]===e)T.nameTable[r]=e.name_next;else for(var t=T.nameTable[r];t;){if(t.name_next===e){t.name_next=e.name_next;break}t=t.name_next}},lookupNode:function(e,r){var t=T.mayLookup(e);if(t)throw new T.ErrnoError(t,e);for(var t=T.hashName(e.id,r),n=T.nameTable[t];n;n=n.name_next){var o=n.name;if(n.parent.id===e.id&&o===r)return n}return T.lookup(e,r)},createNode:function(e,r,t,n){e=new T.FSNode(e,r,t,n);return T.hashAddNode(e),e},destroyNode:function(e){T.hashRemoveNode(e)},isRoot:function(e){return e===e.parent},isMountpoint:function(e){return!!e.mounted},isFile:function(e){return 32768==(61440&e)},isDir:function(e){return 16384==(61440&e)},isLink:function(e){return 40960==(61440&e)},isChrdev:function(e){return 8192==(61440&e)},isBlkdev:function(e){return 24576==(61440&e)},isFIFO:function(e){return 4096==(61440&e)},isSocket:function(e){return 49152==(49152&e)},flagModes:{r:0,rs:1052672,"r+":2,w:577,wx:705,xw:705,"w+":578,"wx+":706,"xw+":706,a:1089,ax:1217,xa:1217,"a+":1090,"ax+":1218,"xa+":1218},modeStringToFlags:function(e){var r=T.flagModes[e];if(void 0===r)throw new Error("Unknown file open mode: "+e);return r},flagsToPermissionString:function(e){var r=["r","w","rw"][3&e];return 512&e&&(r+="w"),r},nodePermissions:function(e,r){return T.ignorePermissions||(-1===r.indexOf("r")||292&e.mode)&&(-1===r.indexOf("w")||146&e.mode)&&(-1===r.indexOf("x")||73&e.mode)?0:2},mayLookup:function(e){var r=T.nodePermissions(e,"x");return r||(e.node_ops.lookup?0:2)},mayCreate:function(e,r){try{T.lookupNode(e,r);return 20}catch(e){}return T.nodePermissions(e,"wx")},mayDelete:function(e,r,t){var n;try{n=T.lookupNode(e,r)}catch(e){return e.errno}r=T.nodePermissions(e,"wx");if(r)return r;if(t){if(!T.isDir(n.mode))return 54;if(T.isRoot(n)||T.getPath(n)===T.cwd())return 10}else if(T.isDir(n.mode))return 31;return 0},mayOpen:function(e,r){return e?T.isLink(e.mode)?32:T.isDir(e.mode)&&("r"!==T.flagsToPermissionString(r)||512&r)?31:T.nodePermissions(e,T.flagsToPermissionString(r)):44},MAX_OPEN_FDS:4096,nextfd:function(e,r){r=r||T.MAX_OPEN_FDS;for(var t=e=e||0;t<=r;t++)if(!T.streams[t])return t;throw new T.ErrnoError(33)},getStream:function(e){return T.streams[e]},createStream:function(e,r,t){T.FSStream||(T.FSStream=function(){},T.FSStream.prototype={object:{get:function(){return this.node},set:function(e){this.node=e}},isRead:{get:function(){return 1!=(2097155&this.flags)}},isWrite:{get:function(){return 0!=(2097155&this.flags)}},isAppend:{get:function(){return 1024&this.flags}}});var n,o=new T.FSStream;for(n in e)o[n]=e[n];e=o;r=T.nextfd(r,t);return e.fd=r,T.streams[r]=e},closeStream:function(e){T.streams[e]=null},chrdev_stream_ops:{open:function(e){var r=T.getDevice(e.node.rdev);e.stream_ops=r.stream_ops,e.stream_ops.open&&e.stream_ops.open(e)},llseek:function(){throw new T.ErrnoError(70)}},major:function(e){return e>>8},minor:function(e){return 255&e},makedev:function(e,r){return e<<8|r},registerDevice:function(e,r){T.devices[e]={stream_ops:r}},getDevice:function(e){return T.devices[e]},getMounts:function(e){for(var r=[],t=[e];t.length;){var n=t.pop();r.push(n),t.push.apply(t,n.mounts)}return r},syncfs:function(r,t){"function"==typeof r&&(t=r,r=!1),T.syncFSRequests++,1=n.length&&i(null)}n.forEach(function(e){if(!e.type.syncfs)return a(null);e.type.syncfs(e,r,a)})},mount:function(e,r,t){var n,o="/"===t,i=!t;if(o&&T.root)throw new T.ErrnoError(10);if(!o&&!i){i=T.lookupPath(t,{follow_mount:!1});if(t=i.path,n=i.node,T.isMountpoint(n))throw new T.ErrnoError(10);if(!T.isDir(n.mode))throw new T.ErrnoError(54)}i={type:e,opts:r,mountpoint:t,mounts:[]},r=e.mount(i);return(r.mount=i).root=r,o?T.root=r:n&&(n.mounted=i,n.mount&&n.mount.mounts.push(i)),r},unmount:function(e){e=T.lookupPath(e,{follow_mount:!1});if(!T.isMountpoint(e.node))throw new T.ErrnoError(28);var e=e.node,r=e.mounted,n=T.getMounts(r),r=(Object.keys(T.nameTable).forEach(function(e){for(var r=T.nameTable[e];r;){var t=r.name_next;-1!==n.indexOf(r.mount)&&T.destroyNode(r),r=t}}),e.mounted=null,e.mount.mounts.indexOf(r));e.mount.mounts.splice(r,1)},lookup:function(e,r){return e.node_ops.lookup(e,r)},mknod:function(e,r,t){var n=T.lookupPath(e,{parent:!0}).node,e=x.basename(e);if(!e||"."===e||".."===e)throw new T.ErrnoError(28);var o=T.mayCreate(n,e);if(o)throw new T.ErrnoError(o);if(n.node_ops.mknod)return n.node_ops.mknod(n,e,r,t);throw new T.ErrnoError(63)},create:function(e,r){return T.mknod(e,r=(r=void 0!==r?r:438)&4095|32768,0)},mkdir:function(e,r){return T.mknod(e,r=(r=void 0!==r?r:511)&1023|16384,0)},mkdirTree:function(e,r){for(var t=e.split("/"),n="",o=0;othis.length-1||e<0))return r=e%this.chunkSize,e=e/this.chunkSize|0,this.getter(e)[r]},o.prototype.setDataGetter=function(e){this.getter=e},o.prototype.cacheLength=function(){var e=new XMLHttpRequest;if(e.open("HEAD",a,!1),e.send(null),!(200<=e.status&&e.status<300||304===e.status))throw new Error("Couldn't load "+a+". Status: "+e.status);var r,n=Number(e.getResponseHeader("Content-length")),t=(r=e.getResponseHeader("Accept-Ranges"))&&"bytes"===r,e=(r=e.getResponseHeader("Content-Encoding"))&&"gzip"===r,o=1048576,i=(t||(o=n),this);i.setDataGetter(function(e){var r=e*o,t=(e+1)*o-1,t=Math.min(t,n-1);if(void 0===i.chunks[e]&&(i.chunks[e]=function(e,r){if(r=i.length)return 0;var a=Math.min(i.length-o,n);if(i.slice)for(var s=0;s>2]=n.dev,k[t+4>>2]=0,k[t+8>>2]=n.ino,k[t+12>>2]=n.mode,k[t+16>>2]=n.nlink,k[t+20>>2]=n.uid,k[t+24>>2]=n.gid,k[t+28>>2]=n.rdev,k[t+32>>2]=0,F=[n.size>>>0,(S=n.size,1<=+ne(S)?0>>0:~~+oe((S-(~~S>>>0))/4294967296)>>>0:0)],k[t+40>>2]=F[0],k[t+44>>2]=F[1],k[t+48>>2]=4096,k[t+52>>2]=n.blocks,k[t+56>>2]=n.atime.getTime()/1e3|0,k[t+60>>2]=0,k[t+64>>2]=n.mtime.getTime()/1e3|0,k[t+68>>2]=0,k[t+72>>2]=n.ctime.getTime()/1e3|0,k[t+76>>2]=0,F=[n.ino>>>0,(S=n.ino,1<=+ne(S)?0>>0:~~+oe((S-(~~S>>>0))/4294967296)>>>0:0)],k[t+80>>2]=F[0],k[t+84>>2]=F[1],0},doMsync:function(e,r,t,n,o){e=E.slice(e,e+t);T.msync(r,e,o,t,n)},doMkdir:function(e,r){return"/"===(e=x.normalize(e))[e.length-1]&&(e=e.substr(0,e.length-1)),T.mkdir(e,r,0),0},doMknod:function(e,r,t){switch(61440&r){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}return T.mknod(e,r,t),0},doReadlink:function(e,r,t){if(t<=0)return-28;var e=T.readlink(e),n=Math.min(t,G(e)),o=y[r+n];return X(e,E,r,t+1),y[r+n]=o,n},doAccess:function(e,r){if(-8&r)return-28;e=T.lookupPath(e,{follow:!0}).node;if(!e)return-44;var t="";return 4&r&&(t+="r"),2&r&&(t+="w"),1&r&&(t+="x"),t&&T.nodePermissions(e,t)?-2:0},doDup:function(e,r,t){var n=T.getStream(t);return n&&T.close(n),T.open(e,r,0,t,t).fd},doReadv:function(e,r,t,n){for(var o=0,i=0;i>2],s=k[r+(8*i+4)>>2],a=T.read(e,y,a,s,n);if(a<0)return-1;if(o+=a,a>2],s=k[r+(8*i+4)>>2],a=T.write(e,y,a,s,n);if(a<0)return-1;o+=a}return o},varargs:void 0,get:function(){return N.varargs+=4,k[N.varargs-4>>2]},getStr:function(e){return W(e)},getStreamFromFD:function(e){e=T.getStream(e);if(e)return e;throw new T.ErrnoError(8)},get64:function(e,r){return e}};var ge={};function z(){if(!z.strings){var 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",_:C||"./this.program"};for(r in ge)e[r]=ge[r];var r,t=[];for(r in e)t.push(r+"="+e[r]);z.strings=t}return z.strings}function ve(e,r,t,n){this.parent=e=e||this,this.mount=e.mount,this.mounted=null,this.id=T.nextInode++,this.name=r,this.mode=t,this.node_ops={},this.stream_ops={},this.rdev=n}function ye(e,r,t){t=0>2]=t/1e3|0,k[r+4>>2]=t%1e3*1e3*1e3|0,0},d:function(e,r,t){N.varargs=t;try{var n=N.getStreamFromFD(e);switch(r){case 0:return(o=N.get())<0?-28:T.open(n.path,n.flags,0,o).fd;case 1:case 2:return 0;case 3:return n.flags;case 4:var o=N.get();return n.flags|=o,0;case 12:o=N.get();return K[o+0>>1]=2,0;case 13:case 14:return 0;case 16:case 8:return-28;case 9:return A(28),-1;default:return-28}}catch(e){return void 0!==T&&e instanceof T.ErrnoError||D(e),-e.errno}},i:function(e,r,t){N.varargs=t;try{var n=N.getStreamFromFD(e);switch(r){case 21509:case 21505:return n.tty?0:-59;case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:return n.tty?0:-59;case 21519:if(!n.tty)return-59;var o=N.get();return k[o>>2]=0;case 21520:return n.tty?-28:-59;case 21531:o=N.get();return T.ioctl(n,r,o);case 21523:case 21524:return n.tty?0:-59;default:D("bad ioctl syscall "+r)}}catch(e){return void 0!==T&&e instanceof T.ErrnoError||D(e),-e.errno}},e:function(e,r,t){N.varargs=t;try{var n=N.getStr(e),o=N.get();return T.open(n,r,o).fd}catch(e){return void 0!==T&&e instanceof T.ErrnoError||D(e),-e.errno}},t:function(e){try{return e=N.getStr(e),T.rmdir(e),0}catch(e){return void 0!==T&&e instanceof T.ErrnoError||D(e),-e.errno}},j:function(e){try{var r=N.umask;return N.umask=e,r}catch(e){return void 0!==T&&e instanceof T.ErrnoError||D(e),-e.errno}},u:function(e){try{return e=N.getStr(e),T.unlink(e),0}catch(e){return void 0!==T&&e instanceof T.ErrnoError||D(e),-e.errno}},v:function(e,r,t,n){try{D("cannot wait on child processes")}catch(e){return void 0!==T&&e instanceof T.ErrnoError||D(e),-e.errno}},n:function(e,r,t){E.copyWithin(e,r,r+t)},b:function(e){var r=E.length,t=2147483648;if(t<(e>>>=0))return!1;for(var n,o=1;o<=4;o*=2){var i=r*(1+.2/o),i=Math.min(i,e+100663296);if(function(e){try{return p.grow(e-v.byteLength+65535>>>16),Y(p.buffer),1}catch(e){}}(Math.min(t,(0<(i=Math.max(16777216,e,i))%(n=65536)&&(i+=n-i%n),i))))return!0}return!1},p:function(a,s){var u=0;return z().forEach(function(e,r){for(var t=s+u,n=(k[a+4*r>>2]=t,e),o=t,r=void 0,i=0;i>0]=n.charCodeAt(i);r||(y[o>>0]=0),u+=e.length+1}),0},q:function(e,r){var t=z(),n=(k[e>>2]=t.length,0);return t.forEach(function(e){n+=e.length+1}),k[r>>2]=n,0},c:function(e){xe(e)},f:function(e){try{var r=N.getStreamFromFD(e);return T.close(r),0}catch(e){return void 0!==T&&e instanceof T.ErrnoError||D(e),e.errno}},r:function(e,r){try{var t=N.getStreamFromFD(e),n=t.tty?2:T.isDir(t.mode)?3:T.isLink(t.mode)?7:4;return y[r>>0]=n,0}catch(e){return void 0!==T&&e instanceof T.ErrnoError||D(e),e.errno}},h:function(e,r,t,n){try{var o=N.getStreamFromFD(e),i=N.doReadv(o,r,t);return k[n>>2]=i,0}catch(e){return void 0!==T&&e instanceof T.ErrnoError||D(e),e.errno}},m:function(e,r,t,n,o){try{var i=N.getStreamFromFD(e),a=4294967296*t+(r>>>0),s=9007199254740992;return a<=-s||s<=a?-61:(T.llseek(i,a,n),F=[i.position>>>0,(S=i.position,1<=+ne(S)?0>>0:~~+oe((S-(~~S>>>0))/4294967296)>>>0:0)],k[o>>2]=F[0],k[o+4>>2]=F[1],i.getdents&&0==a&&0===n&&(i.getdents=null),0)}catch(e){return void 0!==T&&e instanceof T.ErrnoError||D(e),e.errno}},g:function(e,r,t,n){try{var o=N.getStreamFromFD(e),i=N.doWritev(o,r,t);return k[n>>2]=i,0}catch(e){return void 0!==T&&e instanceof T.ErrnoError||D(e),e.errno}},memory:p,o:function(){w("missing function: popen"),D(-1)},l:function(){return 6},k:function(){},table:I},_e=(!function(){var r={a:ke};function t(e,r){e=e.exports;h.asm=e,ue()}function n(e){t(e.instance)}function o(e){return(l||!L&&!c||"function"!=typeof fetch||de(P)?new Promise(function(e,r){e(pe())}):fetch(P,{credentials:"same-origin"}).then(function(e){if(e.ok)return e.arrayBuffer();throw"failed to load wasm binary file at '"+P+"'"}).catch(pe)).then(function(e){return WebAssembly.instantiate(e,r)}).then(e,function(e){w("failed to asynchronously prepare wasm: "+e),D(e)})}if(se(),h.instantiateWasm)try{h.instantiateWasm(r,t);return}catch(e){return w("Module.instantiateWasm callback failed with error: "+e)}l||"function"!=typeof WebAssembly.instantiateStreaming||ce(P,fe)||de(P)||"function"!=typeof fetch?o(n):fetch(P,{credentials:"same-origin"}).then(function(e){return WebAssembly.instantiateStreaming(e,r).then(n,function(e){return w("wasm streaming compile failed: "+e),w("falling back to ArrayBuffer instantiation"),o(n)})})}(),h.___wasm_call_ctors=function(){return(_e=h.___wasm_call_ctors=h.asm.w).apply(null,arguments)}),be=h._malloc=function(){return(be=h._malloc=h.asm.x).apply(null,arguments)},De=h.___errno_location=function(){return(De=h.___errno_location=h.asm.y).apply(null,arguments)},Se=(h._main=function(){return(h._main=h.asm.z).apply(null,arguments)},h.stackAlloc=function(){return(Se=h.stackAlloc=h.asm.A).apply(null,arguments)});function Fe(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}function Pe(r){var t=h._main;r=r||[];try{for(let e=0;e>2]=V(C);for(var n=1;n>2)+n]=V(e[n-1]);return k[(t>>2)+r]=0,{argc:r,argv:t}}(s.split(" ").filter(e=>Boolean(e)));if(0!==(n=t(o,i)))break}xe(n,!0)}catch(e){if(e instanceof Fe)return;if("unwind"==e)return void(d=!0);var a=e;e&&"object"==typeof e&&e.stack&&(a=[e,e.stack]),w("exception thrown: "+a),u(1,e)}}function Ae(e){function r(){Ee||(Ee=!0,h.calledRun=!0,U||(h.noFSInit||T.init.initialized||T.init(),Z(J),T.ignorePermissions=!1,Z(Q),j(h),h.onRuntimeInitialized&&h.onRuntimeInitialized(),Re&&Pe(e),te()))}e=e||a,0<_||(re(),0<_||(h.setStatus?(h.setStatus("Running..."),setTimeout(function(){setTimeout(function(){h.setStatus("")},1),r()},1)):r()))}function xe(e,r){r&&d&&0===e||(d||(U=!0,h.onExit&&h.onExit(e)),u(e,new Fe(e)))}if(h.dynCall_vi=function(){return(h.dynCall_vi=h.asm.B).apply(null,arguments)},b=function e(){Ee||Ae(),Ee||(b=e)},h.run=Ae,h.preInit)for("function"==typeof h.preInit&&(h.preInit=[h.preInit]);0{0{t+=String.fromCharCode(e),10===e&&(console.error(t),t="")},stdout:e=>{r+=String.fromCharCode(e),10===e&&(console.log(r),r="")}};const l=[];return async(e={})=>{let{data:i=null,command:a=[],folder:s=[],isStrict:u=!1}=e;return await new Promise(e=>{l.push(e),1===l.length&&l[0]()}),new Promise((r,t)=>{let n=!1,o="";c({stdout:f.stdout,stderr:e=>{o+=String.fromCharCode(e),10===e&&(console.error(o),u&&t(o))},arguments:a,input:i,folder:s,output:e=>{r(e),n=!0}}).then(()=>{(0,f.flush)(),n||t(),0{var e=await gifsicle(r.data).catch(e=>{postMessage(e)});postMessage(e)})().catch(e=>{postMessage(null)})};`,workerBlobUrl:"",worker(){return this.workerBlobUrl||(this.workerLocalUrl?this.workerBlobUrl=URL.createObjectURL(new Blob([this.workerLocalUrl])):this.workerBlobUrl="../src/worker.js",this.workerBlobUrl)},errorLink(){return` + Check: https://github.com/renzhezhilu/gifsicle-wasm-browser`},testType(A){return A instanceof Element?"element":Object.prototype.toString.call(A).replace(/\[object\s(.+)\]/,"$1").toLowerCase()},async textToUrl(A){return this.worker()},loadCommand(A){var e=this.testType(A);if(A.length===0)throw" the content can not be blank"+this.errorLink();if(e==="array")return A.map(t=>t.replace(/\n/gi," "));throw" types:"+e+", must be an array"+this.errorLink()},loadOne(A){return new Promise(async(e,t)=>{var i=this.testType(A);if(["string"].includes(i))fetch(A).then(n=>{if(n.status!==200)throw"<"+A+"> Url error!!!"+this.errorLink();return n.arrayBuffer()}).then(n=>e(n));else if(["blob","file"].includes(i))new Response(A).arrayBuffer().then(n=>e(n));else{if(!["arraybuffer"].includes(i))throw" types:"+i+", only supports Url, blob, file, arraybuffer"+this.errorLink();e(A)}})},loadFile(A){return new Promise(async(e,t)=>{var i=this.testType(A);if(i!=="array")throw" types:"+i+", only supports Array"+this.errorLink();if(A.length===0)throw" the content can not be blank"+this.errorLink();i=A.map(n=>this.loadOne(n.file)),Promise.all(i).then(function(n){var o=A.map((r,g)=>(r.file=n[g],r));e(o)}).catch(function(n){})})},loadFolder(A){return new Promise(async(e,t)=>{var i=this.testType(A);if(!["array"].includes(i))throw" types:"+i+", only supports Array"+this.errorLink();e(A)})}},run(A={}){return new Promise(async(e,t)=>{let{input:i=[],command:n="",folder:o=[],isStrict:r=!1,start:g=Q=>{}}=A;var s=await this.tool.textToUrl();let a=new Worker(s);var I=this.tool.loadCommand(n),l=await this.tool.loadFile(i),C=(g(l),await this.tool.loadFolder(o));a.postMessage({data:l,command:I,folder:C,isStrict:r}),a.onmessage=async function(Q){if(!Q.data||typeof Q.data=="string")return a.terminate(),void t(Q.data);let h=[];for(let u=0;u=0&&I.push(`--loopcount=${s}`),g&&g>0&&I.push(`--lossy=${g}`),r&&I.push(`-O${this.optimizationLevel}`),I.push("1.gif"),I.push("-o /out/output.gif");const l=I.join(" ");this.debug&&(console.log("GIF 缩放命令:",l),console.log("输入文件大小:",e.size||"未知"));const C=await Jn.run({input:[{file:e,name:"1.gif"}],command:[l]});if(!C||C.length===0)throw new Error("gifsicle 处理失败,未返回结果");const Q=C[0];if(this.debug&&(console.log("GIF 缩放完成"),console.log("输出文件大小:",Q.size),e.size)){const h=((1-Q.size/e.size)*100).toFixed(2);console.log(`压缩率: ${h}%`)}return new Blob([Q],{type:"image/gif"})}catch(a){throw console.error("GIF 缩放失败:",a),new Error(`GIF 缩放失败: ${a.message}`)}}async scaleGifBatch(e){const t=[];for(let i=0;i=0&&r.push(`--loopcount=${o}`),i&&i>0&&r.push(`--lossy=${i}`),r.push(`-O${n}`),r.push("1.gif"),r.push("-o /out/output.gif");const g=r.join(" ");this.debug&&console.log("GIF 优化命令:",g);const s=await Jn.run({input:[{file:e,name:"1.gif"}],command:[g]});if(!s||s.length===0)throw new Error("gifsicle 优化失败");return new Blob([s[0]],{type:"image/gif"})}catch(r){throw console.error("GIF 优化失败:",r),new Error(`GIF 优化失败: ${r.message}`)}}async getGifInfo(e){try{const t=await Jn.run({input:[{file:e,name:"1.gif"}],command:["--info 1.gif -o /out/info.txt"]});if(!t||t.length===0)throw new Error("无法获取 GIF 信息");const n=await t[0].text();return this.parseGifInfo(n)}catch(t){return console.error("获取 GIF 信息失败:",t),{size:e.size||0,type:"image/gif"}}}parseGifInfo(e){const t={frames:0,width:0,height:0,colors:0,loopCount:0};try{const i=e.match(/(\d+) images?/);i&&(t.frames=parseInt(i[1]));const n=e.match(/logical screen (\d+)x(\d+)/);n&&(t.width=parseInt(n[1]),t.height=parseInt(n[2]));const o=e.match(/(\d+) colors/);if(o&&(t.colors=parseInt(o[1])),e.includes("loop forever"))t.loopCount=0;else{const r=e.match(/loop count (\d+)/);r&&(t.loopCount=parseInt(r[1]))}}catch(i){console.warn("解析 GIF 信息时出错:",i)}return t}async cropGif(e,t){const{x:i,y:n,width:o,height:r}=t;try{const g=["-U",`--crop ${i},${n}+${o}x${r}`,"1.gif","-o /out/output.gif"].join(" ");this.debug&&console.log("GIF 裁剪命令:",g);const s=await Jn.run({input:[{file:e,name:"1.gif"}],command:[g]});if(!s||s.length===0)throw new Error("gifsicle 裁剪失败");return new Blob([s[0]],{type:"image/gif"})}catch(g){throw console.error("GIF 裁剪失败:",g),new Error(`GIF 裁剪失败: ${g.message}`)}}dispose(){this.debug&&console.log("WasmGifScaler disposed")}setDebug(e){this.debug=e}setQuality(e){if(e<1||e>200)throw new Error("质量参数必须在 1-200 之间");this.quality=e}setOptimizationLevel(e){if(e<1||e>3)throw new Error("优化级别必须在 1-3 之间");this.optimizationLevel=e}}class _l{constructor(){this.config=null,this.resources=new Map,this.tempFiles=[],this.fontConverterBrowser=rS,this.convertedFonts=new Map,this.wakenetPacker=new gS,this.spiffsGenerator=new sS,this.gifScaler=new aS({quality:30,debug:!0,scalingMode:"auto",optimize:!0,optimizationLevel:2}),this.configStorage=Qe,this.autoSaveEnabled=!0}setConfig(e,t={}){if(((t==null?void 0:t.strict)??!0)&&!this.validateConfig(e))throw new Error("Configuration object validation failed");return this.config={...e},this}validateConfig(e){var n,o,r;if(!e)return!1;if(!((n=e.chip)!=null&&n.model))return console.error("Missing chip model configuration"),!1;const t=e.chip.display;if(!(t!=null&&t.width)||!(t!=null&&t.height))return console.error("Missing display resolution configuration"),!1;const i=(o=e.theme)==null?void 0:o.font;return(i==null?void 0:i.type)==="preset"&&!i.preset?(console.error("Preset font configuration is incomplete"),!1):(i==null?void 0:i.type)==="custom"&&!((r=i.custom)!=null&&r.file)?(console.error("Custom font file not provided"),!1):!0}addResource(e,t,i,n="other"){return this.resources.set(e,{file:t,filename:i,size:t.size,type:t.type,lastModified:t.lastModified||Date.now(),resourceType:n}),this.autoSaveEnabled&&t instanceof File&&this.saveFileToStorage(e,t,n).catch(o=>{console.warn(`Auto-saving file ${i} failed:`,o)}),this}async saveFileToStorage(e,t,i){try{await this.configStorage.saveFile(e,t,i),console.log(`File ${t.name} auto-saved to storage`)}catch(n){throw console.error(`Failed to save file to storage: ${t.name}`,n),n}}async restoreResourceFromStorage(e){try{const t=await this.configStorage.loadFile(e);return t?(this.resources.set(e,{file:t,filename:t.name,size:t.size,type:t.type,lastModified:t.lastModified,resourceType:t.storedType,fromStorage:!0}),console.log(`Resource ${e} restored from storage successfully: ${t.name}`),!0):!1}catch(t){return console.error(`Failed to restore resource from storage: ${e}`,t),!1}}async restoreAllResourcesFromStorage(e){var i,n,o,r,g,s,a,I,l,C,Q;if(!e)return;const t=[];if((n=(i=e.theme)==null?void 0:i.font)!=null&&n.custom&&((o=e.theme.font.custom)==null?void 0:o.file)===null){const h="custom_font";if(await this.restoreResourceFromStorage(h)){const f=this.resources.get(h);f&&(e.theme.font.custom.file=f.file,t.push(`Custom font: ${f.filename}`),console.log(`Custom font restored even when type is '${e.theme.font.type}'`))}}if(((g=(r=e.theme)==null?void 0:r.emoji)==null?void 0:g.type)==="custom"&&e.theme.emoji.custom){const h=e.theme.emoji.custom,f=h.emotionMap||{},u=h.fileMap||{},E=h.images||{};if(Object.keys(f).length>0||Object.keys(u).length>0){const D=new Set;for(const c of Object.keys(u))u[c]===null&&D.add(c);for(const c of D){let d=`hash_${c}`,p=await this.restoreResourceFromStorage(d);if(!p){const v=`emoji_hash_${c}`;p=await this.restoreResourceFromStorage(v),p&&(d=v)}if(p){const v=this.resources.get(d);if(v){u[c]=v.file;const N=Object.entries(f).filter(([G,_])=>_===c).map(([G,_])=>G);N.forEach(G=>{E[G]=v.file}),t.push(`Emoji file ${c.substring(0,8)}... (used for: ${N.join(", ")})`)}}}Object.keys(u).forEach(c=>{e.theme.emoji.custom.fileMap[c]=u[c]}),Object.keys(E).forEach(c=>{e.theme.emoji.custom.images[c]=E[c]})}else{for(const[D,c]of Object.entries(E))if(c===null){const d=`emoji_${D}`;if(await this.restoreResourceFromStorage(d)){const p=this.resources.get(d);p&&(E[D]=p.file,t.push(`Emoji ${D}: ${p.filename}`))}}e.theme.emoji.custom.images=E}}if(((I=(a=(s=e.theme)==null?void 0:s.skin)==null?void 0:a.light)==null?void 0:I.backgroundType)==="image"&&e.theme.skin.light.backgroundImage===null){const h="background_light";if(await this.restoreResourceFromStorage(h)){const f=this.resources.get(h);f&&(e.theme.skin.light.backgroundImage=f.file,t.push(`Light background: ${f.filename}`))}}if(((Q=(C=(l=e.theme)==null?void 0:l.skin)==null?void 0:C.dark)==null?void 0:Q.backgroundType)==="image"&&e.theme.skin.dark.backgroundImage===null){const h="background_dark";if(await this.restoreResourceFromStorage(h)){const f=this.resources.get(h);f&&(e.theme.skin.dark.backgroundImage=f.file,t.push(`Dark background: ${f.filename}`))}}try{const h=this.getFontInfo();if(h&&h.type==="custom"){const f=`converted_font_${h.filename}`,u=await this.configStorage.loadTempData(f);u&&(this.convertedFonts.set(h.filename,u.data),console.log(`Converted font data restored: ${h.filename}`))}}catch(h){console.warn("Error restoring converted font data:",h)}t.length>0&&console.log("Files restored from storage:",t)}getWakewordModelInfo(){if(!this.config||!this.config.chip||!this.config.theme)return null;const e=this.config.chip.model,t=this.config.theme.wakeword;return!t||t.type==="none"?null:t.type==="preset"?{type:e==="esp32c3"||e==="esp32c6"?"WakeNet9s":"WakeNet9",name:t.preset,filename:"srmodels.bin"}:t.type==="custom"?{type:"MultiNet",name:t.custom.model,filename:"srmodels.bin",custom:t.custom}:null}getFontInfo(){if(!this.config||!this.config.theme||!this.config.theme.font)return null;const e=this.config.theme.font;if(e.type==="preset")return{type:"preset",filename:`${e.preset}.bin`,source:e.preset};if(e.type==="custom"&&e.custom.file){const t=e.custom;return{type:"custom",filename:`font_custom_${t.size}_${t.bpp}.bin`,source:e.custom.file,config:{size:t.size,bpp:t.bpp,charset:t.charset}}}return null}getEmojiCollectionInfo(){if(!this.config||!this.config.theme||!this.config.theme.emoji)return[];const e=this.config.theme.emoji,t=[];if(e.type==="preset"){const i=["neutral","happy","laughing","funny","sad","angry","crying","loving","embarrassed","surprised","shocked","thinking","winking","cool","relaxed","delicious","kissy","confident","sleepy","silly","confused"],n=e.preset==="twemoji32"?"32":"64";i.forEach(o=>{t.push({name:o,file:`${o}.png`,source:`preset:${e.preset}`,size:{width:parseInt(n),height:parseInt(n)}})})}else if(e.type==="custom"){e.custom.images;const i=e.custom.emotionMap||{},n=e.custom.fileMap||{},o=e.custom.size||{width:64,height:64};if(Object.keys(i).length===0||Object.keys(n).length===0)throw console.error("❌ Error: Detected old version of emoji data structure"),console.error("Please clear browser cache or reset configuration, then re-upload emoji images"),new Error("Incompatible emoji data structure: Missing fileMap or emotionMap. Please reconfigure emojis.");const r=new Map;Object.entries(i).forEach(([g,s])=>{const a=n[s];if(a){if(!r.has(s)){const l=a.name?a.name.split(".").pop().toLowerCase():"png",C=`emoji_${s.substring(0,8)}.${l}`;r.set(s,C)}const I=r.get(s);t.push({name:g,file:I,source:a,fileHash:s,size:{...o}})}}),console.log(`Emoji deduplication: ${Object.keys(i).length} emojis using ${r.size} different image files`),t.find(g=>g.name==="neutral")||console.warn("Warning: neutral emoji not provided, default image will be used")}return t}getSkinInfo(){if(!this.config||!this.config.theme||!this.config.theme.skin)return{};const e=this.config.theme.skin,t={};return e.light&&(t.light={text_color:e.light.textColor||"#000000",background_color:e.light.backgroundColor||"#ffffff"},e.light.backgroundType==="image"&&e.light.backgroundImage&&(t.light.background_image="background_light.raw")),e.dark&&(t.dark={text_color:e.dark.textColor||"#ffffff",background_color:e.dark.backgroundColor||"#121212"},e.dark.backgroundType==="image"&&e.dark.backgroundImage&&(t.dark.background_image="background_dark.raw")),t}generateIndexJson(){if(!this.config)throw new Error("Configuration object not set");const e={version:1,chip_model:this.config.chip.model,hide_subtitle:this.config.theme.font.hide_subtitle||!1,display_config:{width:this.config.chip.display.width,height:this.config.chip.display.height,monochrome:!1,color:this.config.chip.display.color||"RGB565"}},t=this.getWakewordModelInfo();if(t&&(e.srmodels=t.filename,t.type==="MultiNet"&&t.custom)){const r=t.custom;e.multinet_model={language:r.model.includes("_en")?"en":"cn",duration:r.duration||3e3,threshold:r.threshold/100,commands:[{command:r.command,text:r.name,action:"wake"}]}}const i=this.getFontInfo();i&&(e.text_font=i.filename);const n=this.getSkinInfo();Object.keys(n).length>0&&(e.skin=n);const o=this.getEmojiCollectionInfo();return o.length>0&&(e.emoji_collection=o.map(r=>({name:r.name,file:r.file}))),e}preparePackageResources(){var g,s,a,I;const e={files:[],indexJson:this.generateIndexJson(),config:{...this.config}},t=this.getWakewordModelInfo();t&&t.name&&e.files.push({type:"wakeword",name:t.name,filename:t.filename,modelType:t.type,isCustom:t.type==="MultiNet"});const i=this.getFontInfo();i&&e.files.push({type:"font",filename:i.filename,source:i.source,config:i.config||null});const n=this.getEmojiCollectionInfo(),o=new Set;n.forEach(l=>{if(l.fileHash){if(o.has(l.fileHash)){console.log(`Skipping duplicate file: ${l.name} -> ${l.file} (hash: ${l.fileHash.substring(0,8)})`);return}o.add(l.fileHash)}e.files.push({type:"emoji",name:l.name,filename:l.file,source:l.source,size:l.size,fileHash:l.fileHash})});const r=(s=(g=this.config)==null?void 0:g.theme)==null?void 0:s.skin;return((a=r==null?void 0:r.light)==null?void 0:a.backgroundType)==="image"&&r.light.backgroundImage&&e.files.push({type:"background",filename:"background_light.raw",source:r.light.backgroundImage,mode:"light"}),((I=r==null?void 0:r.dark)==null?void 0:I.backgroundType)==="image"&&r.dark.backgroundImage&&e.files.push({type:"background",filename:"background_dark.raw",source:r.dark.backgroundImage,mode:"dark"}),e}async preprocessCustomFonts(e=null){const t=this.getFontInfo();if(t&&t.type==="custom"&&!this.convertedFonts.has(t.filename)){e&&e(20,"Converting custom font...");try{const i={fontFile:t.source,fontName:t.filename.replace(/\.bin$/,""),fontSize:t.config.size,bpp:t.config.bpp,charset:t.config.charset,symbols:t.config.symbols||"",range:t.config.range||"",compression:!1,progressCallback:(o,r)=>{e&&e(20+o*.2,`Font conversion: ${r}`)}};let n;if(await this.fontConverterBrowser.initialize(),n=await this.fontConverterBrowser.convertToCBIN(i),this.convertedFonts.set(t.filename,n),this.autoSaveEnabled){const o=`converted_font_${t.filename}`;try{await this.configStorage.saveTempData(o,n,"converted_font",{filename:t.filename,size:t.config.size,bpp:t.config.bpp,charset:t.config.charset}),console.log(`Converted font saved to storage: ${t.filename}`)}catch(r){console.warn(`Failed to save converted font: ${t.filename}`,r)}}}catch(i){throw console.error("Font conversion failed:",i),new Error(`Font conversion failed: ${i.message}`)}}}async generateAssetsBin(e=null){if(!this.config)throw new Error("Configuration object not set");try{e&&e(0,"Starting generation..."),await this.preprocessCustomFonts(e),await new Promise(n=>setTimeout(n,100)),e&&e(40,"Preparing resource files...");const t=this.preparePackageResources();this.wakenetPacker.clear(),this.spiffsGenerator.clear(),await this.processResourceFiles(t,e),await new Promise(n=>setTimeout(n,100)),e&&e(90,"Generating final file..."),this.spiffsGenerator.printFileList();const i=await this.spiffsGenerator.generate((n,o)=>{e&&e(90+n*.1,o)});return e&&e(100,"Generation completed"),new Blob([i],{type:"application/octet-stream"})}catch(t){throw console.error("Failed to generate assets.bin:",t),t}}downloadAssetsBin(e,t="assets.bin"){const i=URL.createObjectURL(e),n=document.createElement("a");n.href=i,n.download=t,document.body.appendChild(n),n.click(),document.body.removeChild(n),URL.revokeObjectURL(i)}async getFontInfoWithDetails(e=null){var t,i,n,o;try{const r=e||((o=(n=(i=(t=this.config)==null?void 0:t.theme)==null?void 0:i.font)==null?void 0:n.custom)==null?void 0:o.file);if(!r)return null;let g;return await this.fontConverterBrowser.initialize(),g=await this.fontConverterBrowser.getFontInfo(r),{...g,file:r,isCustom:!0}}catch(r){return console.error("Failed to get font details:",r),null}}async estimateFontSize(e=null){var t,i,n;try{const o=e||((n=(i=(t=this.config)==null?void 0:t.theme)==null?void 0:i.font)==null?void 0:n.custom);if(!o)return null;const r={fontSize:o.size,bpp:o.bpp,charset:o.charset,symbols:o.symbols||"",range:o.range||""};let g;return g=this.fontConverterBrowser.estimateSize(r),g}catch(o){return console.error("Failed to estimate font size:",o),null}}validateCustomFont(e){const t=[],i=[];return e.file?this.fontConverterBrowser.validateFont(e.file)||t.push("Font file format not supported"):t.push("Missing font file"),(e.size<8||e.size>80)&&t.push("Font size must be between 8-80"),[1,2,4,8].includes(e.bpp)||t.push("BPP must be 1, 2, 4 or 8"),!e.charset&&!e.symbols&&!e.range&&i.push("No charset, symbols or range specified, default charset will be used"),{valid:t.length===0,errors:t,warnings:i}}getConverterStatus(){return{initialized:this.fontConverterBrowser.initialized,supportedFormats:this.fontConverterBrowser.supportedFormats}}async processResourceFiles(e,t=null){let i=0;const n=e.files.length,o=new TextEncoder().encode(JSON.stringify(e.indexJson,null,2));console.log("index.json",e.indexJson),this.spiffsGenerator.addFile("index.json",o.buffer);for(const r of e.files){const g=40+i/n*40;t&&t(g,`Processing file: ${r.filename}`);try{await this.processResourceFile(r),i++}catch(s){throw console.error(`Failed to process resource file: ${r.filename}`,s),new Error(`Failed to process resource file: ${r.filename} - ${s.message}`)}}}async processResourceFile(e){switch(e.type){case"wakeword":await this.processWakewordModel(e);break;case"font":await this.processFontFile(e);break;case"emoji":await this.processEmojiFile(e);break;case"background":await this.processBackgroundFile(e);break;default:console.warn(`Unknown resource type: ${e.type}`)}}async processWakewordModel(e){if(!await this.wakenetPacker.loadModelFromShare(e.name))throw new Error(`Failed to load wakeword model: ${e.name}`);const i=this.wakenetPacker.packModels();this.spiffsGenerator.addFile(e.filename,i)}async processFontFile(e){if(e.config){const t=this.convertedFonts.get(e.filename);if(t)this.spiffsGenerator.addFile(e.filename,t);else throw new Error(`Converted font not found: ${e.filename}`)}else{const t=await this.loadPresetFont(e.source);this.spiffsGenerator.addFile(e.filename,t)}}async processEmojiFile(e){var r,g;let t,i=!1,n="png",o=!1;if(typeof e.source=="string"&&e.source.startsWith("preset:")){const s=e.source.replace("preset:","");t=await this.loadPresetEmoji(s,e.name)}else{const s=e.source;o=this.isGifFile(s),n=s.name.split(".").pop().toLowerCase();try{const I=await this.getImageDimensions(s),l=e.size||{width:64,height:64};(I.width>l.width||I.height>l.height)&&(i=!0,console.log(`Emoji ${e.name} needs scaling: ${I.width}x${I.height} -> ${l.width}x${l.height}`))}catch(I){console.warn(`Failed to get emoji image dimensions: ${e.name}`,I)}i||(t=await this.fileToArrayBuffer(s))}if(i)try{const s=e.size||{width:64,height:64};if(o){console.log(`Using WasmGifScaler to process GIF emoji: ${e.name}`);const a=await this.gifScaler.scaleGif(e.source,{maxWidth:s.width,maxHeight:s.height,keepAspectRatio:!0,lossy:30});t=await this.fileToArrayBuffer(a)}else t=await this.scaleImageToFit(e.source,s,n)}catch(s){console.error(`Failed to scale emoji image: ${e.name}`,s),t=await this.fileToArrayBuffer(e.source)}this.spiffsGenerator.addFile(e.filename,t,{width:((r=e.size)==null?void 0:r.width)||0,height:((g=e.size)==null?void 0:g.height)||0}),e.fileHash&&console.log(`Emoji file added: ${e.filename} (hash: ${e.fileHash.substring(0,8)})`)}async processBackgroundFile(e){const t=await this.fileToArrayBuffer(e.source),i=await this.convertImageToRgb565(t);this.spiffsGenerator.addFile(e.filename,i)}async loadPresetFont(e){try{const t=await fetch(`./static/fonts/${e}.bin`);if(!t.ok)throw new Error(`HTTP ${t.status}`);return await t.arrayBuffer()}catch(t){throw new Error(`Failed to load preset font: ${e} - ${t.message}`)}}async loadPresetEmoji(e,t){try{const i=await fetch(`./static/${e}/${t}.png`);if(!i.ok)throw new Error(`HTTP ${i.status}`);return await i.arrayBuffer()}catch(i){throw new Error(`Failed to load preset emoji: ${e}/${t} - ${i.message}`)}}fileToArrayBuffer(e){return new Promise((t,i)=>{const n=new FileReader;n.onload=()=>t(n.result),n.onerror=()=>i(new Error("Failed to read file")),n.readAsArrayBuffer(e)})}async scaleImageToFit(e,t,i="png"){return new Promise((n,o)=>{const r=e instanceof File?e:new Blob([e]),g=URL.createObjectURL(r),s=new Image;s.onload=()=>{try{const a=document.createElement("canvas"),I=a.getContext("2d");a.width=t.width,a.height=t.height;const l=s.width/s.height,C=t.width/t.height;let Q,h,f,u;l>C?(Q=t.width,h=t.width/l,f=0,u=(t.height-h)/2):(h=t.height,Q=t.height*l,f=(t.width-Q)/2,u=0),i==="png"?I.clearRect(0,0,a.width,a.height):(I.fillStyle="#FFFFFF",I.fillRect(0,0,a.width,a.height)),I.drawImage(s,f,u,Q,h),a.toBlob(E=>{const D=new FileReader;D.onload=()=>n(D.result),D.onerror=()=>o(new Error("Failed to convert image data")),D.readAsArrayBuffer(E)},`image/${i}`),URL.revokeObjectURL(g)}catch(a){URL.revokeObjectURL(g),o(a)}},s.onerror=()=>{URL.revokeObjectURL(g),o(new Error("Unable to load image"))},s.src=g})}isGifFile(e){return e.type==="image/gif"?!0:e.name.split(".").pop().toLowerCase()==="gif"}async getImageDimensions(e){return new Promise((t,i)=>{const n=e instanceof File?e:new Blob([e]),o=URL.createObjectURL(n),r=new Image;r.onload=()=>{URL.revokeObjectURL(o),t({width:r.width,height:r.height})},r.onerror=()=>{URL.revokeObjectURL(o),i(new Error("Unable to get image dimensions"))},r.src=o})}async convertImageToRgb565(e){return new Promise((t,i)=>{const n=new Blob([e]),o=URL.createObjectURL(n),r=new Image;r.onload=()=>{var g,s,a,I,l,C;try{const Q=document.createElement("canvas"),h=Q.getContext("2d",{willReadFrequently:!0});Q.width=((a=(s=(g=this.config)==null?void 0:g.chip)==null?void 0:s.display)==null?void 0:a.width)||320,Q.height=((C=(l=(I=this.config)==null?void 0:I.chip)==null?void 0:l.display)==null?void 0:C.height)||240;const f=r.width/r.height,u=Q.width/Q.height;let E,D,c,d;f>u?(D=Q.height,E=Q.height*f,c=(Q.width-E)/2,d=0):(E=Q.width,D=Q.width/f,c=0,d=(Q.height-D)/2),h.drawImage(r,c,d,E,D);const v=h.getImageData(0,0,Q.width,Q.height).data,N=new ArrayBuffer(Q.width*Q.height*2),G=new Uint16Array(N);for(let W=0;W>3,DA=v[W+1]>>2,NA=v[W+2]>>3;G[W/4]=z<<11|DA<<5|NA}const _=25,S=18,b=Q.width*2,L=28,QA=L+N.byteLength,dA=new ArrayBuffer(QA),IA=new Uint8Array(dA),nA=new DataView(dA);let X=0;const tA=0|S<<8|_;nA.setUint32(X,tA,!0),X+=4;const fA=Q.height<<16|Q.width;nA.setUint32(X,fA,!0),X+=4;const Y=0|b;nA.setUint32(X,Y,!0),X+=4,nA.setUint32(X,N.byteLength,!0),X+=4,nA.setUint32(X,L,!0),X+=4,nA.setUint32(X,0,!0),X+=4,nA.setUint32(X,0,!0),X+=4,IA.set(new Uint8Array(N),L),URL.revokeObjectURL(o),t(dA)}catch(Q){URL.revokeObjectURL(o),i(Q)}},r.onerror=()=>{URL.revokeObjectURL(o),i(new Error("Unable to load image"))},r.src=o})}cleanup(){this.resources.clear(),this.tempFiles=[],this.convertedFonts.clear(),this.wakenetPacker.clear(),this.spiffsGenerator.clear(),this.gifScaler.dispose()}async clearAllStoredData(){try{await this.configStorage.clearAll(),this.cleanup(),console.log("All stored data cleared")}catch(e){throw console.error("Failed to clear stored data:",e),e}}async getStorageStatus(){try{const e=await this.configStorage.getStorageInfo();return{hasStoredData:await this.configStorage.hasStoredConfig(),storageInfo:e,autoSaveEnabled:this.autoSaveEnabled}}catch(e){return console.error("Failed to get storage status:",e),{hasStoredData:!1,storageInfo:null,autoSaveEnabled:this.autoSaveEnabled}}}setAutoSave(e){this.autoSaveEnabled=e,console.log(`Auto-save ${e?"enabled":"disabled"}`)}getResourceSummary(){const e=[],t=this.preparePackageResources(),i={wakeword:0,font:0,emoji:0,background:0};return t.files.forEach(n=>{i[n.type]=(i[n.type]||0)+1;let o="";switch(n.type){case"wakeword":o=`Wakeword model: ${n.name} (${n.modelType})`;break;case"font":n.config?o=`Custom font: size ${n.config.size}px, BPP ${n.config.bpp}`:o=`Preset font: ${n.source}`;break;case"emoji":o=`Emoji: ${n.name} (${n.size.width}x${n.size.height})`;break;case"background":o=`${n.mode==="light"?"Light":"Dark"} mode background`;break}e.push({type:n.type,filename:n.filename,description:o})}),{files:e,counts:i,totalFiles:e.length,indexJson:t.indexJson}}}const IS={class:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 p-4"},CS={class:"bg-white rounded-lg shadow-xl max-w-2xl w-full max-h-[90vh] overflow-hidden"},lS={class:"flex items-center justify-between p-6 border-b border-gray-200"},BS={class:"text-lg font-medium text-gray-900"},QS={key:1,class:"text-sm text-orange-600 font-medium"},cS={class:"p-6 overflow-y-auto",style:{"max-height":"calc(90vh - 140px)"}},ES={key:0,class:"space-y-6"},uS={class:"font-medium text-gray-900 mb-3"},hS={class:"bg-gray-50 rounded-lg p-4 space-y-2 text-sm"},fS={class:"flex justify-between"},dS={class:"text-gray-600"},pS={class:"font-medium"},mS={class:"flex justify-between"},yS={class:"text-gray-600"},wS={class:"font-medium"},DS={class:"flex justify-between"},kS={class:"text-gray-600"},vS={class:"font-medium"},FS={class:"flex justify-between"},SS={class:"text-gray-600"},RS={class:"font-medium"},bS={class:"flex justify-between"},NS={class:"text-gray-600"},GS={class:"font-medium"},LS={class:"font-medium text-gray-900 mb-3"},US={class:"space-y-2 max-h-64 overflow-y-auto"},MS={class:"flex items-center"},xS={class:"text-sm font-medium text-gray-900"},JS={class:"text-sm text-gray-700"},TS={key:0,class:"text-xs text-gray-500 ml-1"},HS={key:1,class:"text-xs text-gray-500 ml-1"},YS={key:1,class:"space-y-6 text-center"},_S={class:"space-y-4"},KS={class:"text-gray-600 mt-2"},OS={class:"bg-gray-200 rounded-full h-2 overflow-hidden"},PS={class:"text-sm text-gray-600"},VS={class:"mt-1"},WS={class:"space-y-2 text-left"},qS={class:"flex-shrink-0 mr-3"},jS={key:0,class:"w-5 h-5 bg-green-500 rounded-full flex items-center justify-center"},ZS={key:1,class:"w-5 h-5 bg-primary-500 rounded-full animate-pulse"},XS={key:2,class:"w-5 h-5 bg-gray-300 rounded-full"},zS={key:2,class:"text-center space-y-6"},$S={class:"text-gray-600 mt-2"},AR={class:"bg-green-50 border border-green-200 rounded-lg p-4"},eR={class:"text-sm text-green-800 space-y-1"},tR={class:"space-y-3"},iR=["disabled"],nR={key:3,class:"space-y-6 text-center"},oR={class:"space-y-4"},rR={class:"text-gray-600"},gR={class:"bg-gray-200 rounded-full h-2 overflow-hidden"},sR={class:"text-sm text-gray-600"},aR={class:"mt-1"},IR={key:4,class:"text-center mt-4"},CR={class:"text-sm text-red-600"},lR={class:"flex justify-end space-x-3 p-6 border-t border-gray-200"},BR=["disabled"],QR={__name:"GenerateModal",props:{config:{type:Object,required:!0}},emits:["close","generate","startFlash"],setup(A,{emit:e}){const{t}=ve(),i=A,n=e,{deviceInfo:o,checkDeviceStatus:r,isDeviceOnline:g}=No(),s=EA(!1),a=EA(!1),I=EA(0),l=EA(""),C=EA(""),Q=EA(""),h=EA(null),f=EA(null),u=EA(!1),E=EA(0),D=EA(""),c=EA(""),d=hA(()=>[{id:1,name:t("progressSteps.init"),status:"pending"},{id:2,name:t("progressSteps.font"),status:"pending"},{id:3,name:t("progressSteps.wakeword"),status:"pending"},{id:4,name:t("progressSteps.emoji"),status:"pending"},{id:5,name:t("progressSteps.background"),status:"pending"},{id:6,name:t("progressSteps.index"),status:"pending"},{id:7,name:t("progressSteps.spiffs"),status:"pending"},{id:8,name:t("progressSteps.package"),status:"pending"}]),p=EA([]),v=_i({render:()=>GA("svg",{fill:"currentColor",viewBox:"0 0 20 20"},[GA("path",{d:"M4 3a2 2 0 00-2 2v1a1 1 0 001 1h14a1 1 0 001-1V5a2 2 0 00-2-2H4zM3 8a1 1 0 011-1h12a1 1 0 011 1v5a2 2 0 01-2 2H5a2 2 0 01-2-2V8z"})])}),N=_i({render:()=>GA("svg",{fill:"currentColor",viewBox:"0 0 20 20"},[GA("path",{"fill-rule":"evenodd",d:"M7 4a3 3 0 016 0v4a3 3 0 11-6 0V4zm4 10.93A7.001 7.001 0 0017 8a1 1 0 10-2 0A5 5 0 015 8a1 1 0 00-2 0 7.001 7.001 0 006 6.93V17H6a1 1 0 100 2h8a1 1 0 100-2h-3v-2.07z","clip-rule":"evenodd"})])}),G=_i({render:()=>GA("svg",{fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[GA("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 4l8 16m-6-6h4"})])}),_=_i({render:()=>GA("svg",{fill:"currentColor",viewBox:"0 0 20 20"},[GA("path",{"fill-rule":"evenodd",d:"M4 3a2 2 0 00-2 2v10a2 2 0 002 2h12a2 2 0 002-2V5a2 2 0 00-2-2H4zm12 12H4l4-8 3 6 2-4 3 6z","clip-rule":"evenodd"})])}),S=hA(()=>p.value.length>0),b=()=>{const Y=i.config.theme.wakeword;return!Y||Y.type==="none"?t("wakewordConfig.noWakeword"):Y.type==="preset"?{wn9s_hilexin:"Hi,乐鑫",wn9s_hiesp:"Hi,ESP",wn9s_nihaoxiaozhi:"你好小智",wn9_nihaoxiaozhi_tts:"你好小智",wn9_alexa:"Alexa"}[Y.preset]||Y.preset:Y.type==="custom"?Y.custom.name||t("wakewordConfig.customWakeword"):t("wakewordConfig.noWakeword")},L=()=>i.config.theme.font.type==="preset"?i.config.theme.font.preset.replace("font_","").replace("_"," "):t("generateModal.customFont"),QA=()=>i.config.theme.emoji.type==="preset"&&i.config.theme.emoji.preset?i.config.theme.emoji.preset==="twemoji32"?"Twemoji 32×32":"Twemoji 64×64":i.config.theme.emoji.type==="custom"?t("generateModal.customEmoji"):i.config.theme.emoji.type==="none"?t("emojiConfig.noEmojiPack"):t("generateModal.notConfigured"),dA=()=>{p.value=[],p.value.push({id:"index",name:"index.json",description:"配置索引文件",icon:v,iconColor:"text-blue-500",size:"1KB"});const Y=i.config.theme.wakeword;if(Y&&Y.type!=="none"&&p.value.push({id:"srmodels",name:"srmodels.bin",description:Y.type==="custom"?"自定义命令词模型":"预设唤醒词模型",icon:N,iconColor:"text-green-500",size:Y.type==="custom"?"~1.2MB":"~300KB"}),i.config.theme.font.type==="preset"){const W={font_puhui_deepseek_14_1:"180KB",font_puhui_deepseek_16_4:"720KB",font_puhui_deepseek_20_4:"1.1MB",font_puhui_deepseek_30_4:"2.5MB"};p.value.push({id:"font",name:`${i.config.theme.font.preset}.bin`,description:"预设字体文件",icon:G,iconColor:"text-yellow-500",size:W[i.config.theme.font.preset]||"500KB"})}else if(i.config.theme.font.custom.file){const W=i.config.theme.font.custom,z=Math.max(100,W.size*W.size*W.bpp*.7);p.value.push({id:"font",name:`font_custom_${W.size}_${W.bpp}.bin`,description:"自定义字体文件",icon:G,iconColor:"text-yellow-500",size:z>1024?`${(z/1024).toFixed(1)}MB`:`${Math.round(z)}KB`,estimated:!0})}if(i.config.theme.emoji.type==="preset"&&i.config.theme.emoji.preset){const W=["neutral","happy","laughing","funny","sad","angry","crying","loving","embarrassed","surprised","shocked","thinking","winking","cool","relaxed","delicious","kissy","confident","sleepy","silly","confused"],z=i.config.theme.emoji.preset==="twemoji64"?"3KB":"1KB";W.forEach(DA=>{p.value.push({id:`emoji_${DA}`,name:`${DA}.png`,description:`${DA}表情图片`,icon:_,iconColor:"text-pink-500",size:z})})}else if(i.config.theme.emoji.type==="custom"){const W=i.config.theme.emoji.custom,z=W.emotionMap||{},DA=W.fileMap||{};if(W.images,Object.keys(z).length===0||Object.keys(DA).length===0){console.error(t("errors.incompatibleEmojiData"));return}const NA=new Map,ne=new Map;Object.entries(z).forEach(([LA,H])=>{const $=DA[H];if($){if(!NA.has(H)){const AA=Math.round($.size/1024);NA.set(H,{file:$,size:AA>1024?`${(AA/1024).toFixed(1)}MB`:`${AA}KB`,emotions:[]})}NA.get(H).emotions.push(LA),ne.set(LA,H)}}),NA.forEach((LA,H)=>{const $=LA.emotions.join(", "),AA=LA.emotions.length>1;p.value.push({id:`emoji_${H.substring(0,8)}`,name:`emoji_${H.substring(0,8)}.${LA.file.name.split(".").pop()}`,description:AA?`共享表情图片 (${$})`:`${$}表情图片`,icon:_,iconColor:AA?"text-purple-500":"text-pink-500",size:LA.size,isCustomEmoji:!0})}),NA.size1024?`${(DA/1024).toFixed(1)}MB`:`${DA}KB`,estimated:!0})}if(i.config.theme.skin.dark.backgroundType==="image"&&i.config.theme.skin.dark.backgroundImage){const{width:W,height:z}=i.config.chip.display,DA=Math.round(W*z*2/1024);p.value.push({id:"bg_dark",name:"background_dark.raw",description:"深色模式背景图片",icon:_,iconColor:"text-indigo-500",size:DA>1024?`${(DA/1024).toFixed(1)}MB`:`${DA}KB`,estimated:!0})}},IA=Y=>{if(Y===0)return"0 B";const W=1024,z=["B","KB","MB","GB"],DA=Math.floor(Math.log(Y)/Math.log(W));return`${parseFloat((Y/Math.pow(W,DA)).toFixed(2))} ${z[DA]}`},nA=Y=>{if(Y<1e3)return`${Y}ms`;if(Y<6e4)return`${(Y/1e3).toFixed(1)}s`;{const W=Math.floor(Y/6e4),z=Math.floor(Y%6e4/1e3);return`${W}m ${z}s`}},X=async()=>{s.value=!0,I.value=0,f.value=Date.now();try{const Y=new _l;Y.setConfig(i.config);const W=await Y.generateAssetsBin((NA,ne)=>{I.value=parseInt(NA),l.value=ne;const LA=Math.floor(NA/(100/d.value.length));d.value.forEach((H,$)=>{${NA.status="completed"}),n("generate",p.value.map(NA=>({id:NA.id,name:NA.name})))}catch(Y){console.error("生成 assets.bin 失败:",Y),s.value=!1,a.value=!1,alert(t("errors.generationFailed",{error:Y.message}))}},tA=()=>{if(h.value){const Y=URL.createObjectURL(h.value),W=document.createElement("a");W.href=Y,W.download="assets.bin",W.style.display="none",document.body.appendChild(W),W.click(),document.body.removeChild(W),URL.revokeObjectURL(Y)}else console.error(t("errors.noFileToDownload"))},fA=async()=>{if(!h.value){alert(t("errors.noFileToDownload"));return}if(!g.value){alert(t("errors.deviceOffline"));return}if(o.value.assetsPartition&&o.value.assetsPartition.size){const Y=o.value.assetsPartition.size,W=h.value.size;if(W>Y){const z=(W/1024/1024).toFixed(2),DA=(Y/1024/1024).toFixed(2);alert(t("errors.fileTooLarge",{fileSize:z,partitionSize:DA}));return}}u.value=!0,E.value=0,D.value=t("flashProgress.startingFileTransfer"),c.value="";try{n("startFlash",{blob:h.value,onProgress:(Y,W)=>{E.value=Y,D.value=W},onComplete:()=>{u.value=!1,E.value=100,D.value=t("flashProgress.flashCompleted")},onError:Y=>{u.value=!1,c.value=Y,console.error(t("flashProgress.onlineFlashFailed",{error:Y}))}})}catch(Y){u.value=!1,c.value=t("flashProgress.onlineFlashFailed",{error:Y.message}),console.error(t("flashProgress.onlineFlashFailed",{error:Y}))}};return Ft(async()=>{dA(),await r(!1)}),(Y,W)=>(T(),K("div",IS,[B("div",CS,[B("div",lS,[B("h3",BS,F(Y.$t("generateModal.title")),1),u.value?(T(),K("div",QS,F(Y.$t("generateModal.flashingInProgress")),1)):(T(),K("button",{key:0,onClick:W[0]||(W[0]=z=>Y.$emit("close")),class:"text-gray-400 hover:text-gray-500"},[...W[3]||(W[3]=[B("svg",{class:"w-6 h-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[B("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])]))]),B("div",cS,[!s.value&&!a.value?(T(),K("div",ES,[B("div",null,[B("h4",uS,F(Y.$t("generateModal.confirmConfig")),1),B("div",hS,[B("div",fS,[B("span",dS,F(Y.$t("generateModal.chipModel")),1),B("span",pS,F(A.config.chip.model.toUpperCase()),1)]),B("div",mS,[B("span",yS,F(Y.$t("generateModal.resolution")),1),B("span",wS,F(A.config.chip.display.width)+"×"+F(A.config.chip.display.height),1)]),B("div",DS,[B("span",kS,F(Y.$t("generateModal.wakeword")),1),B("span",vS,F(b()),1)]),B("div",FS,[B("span",SS,F(Y.$t("generateModal.font")),1),B("span",RS,F(L()),1)]),B("div",bS,[B("span",NS,F(Y.$t("generateModal.emoji")),1),B("span",GS,F(QA()),1)])])]),B("div",null,[B("h4",LS,F(Y.$t("generateModal.fileList")),1),B("div",US,[(T(!0),K(qA,null,Ke(p.value,z=>(T(),K("div",{key:z.id,class:"flex items-center justify-between px-3 py-2 border border-gray-200 rounded bg-gray-50"},[B("div",MS,[(T(),ye(HI(z.icon),{class:kA(["w-4 h-4 mr-2",z.iconColor])},null,8,["class"])),B("span",xS,F(z.name),1)]),B("div",JS,[gt(F(z.size)+" ",1),z.estimated?(T(),K("span",TS,F(Y.$t("generateModal.estimated")),1)):sA("",!0),z.isCustomEmoji?(T(),K("span",HS,F(Y.$t("generateModal.compressed")),1)):sA("",!0)])]))),128))])])])):sA("",!0),s.value?(T(),K("div",YS,[W[5]||(W[5]=B("div",{class:"flex items-center justify-center"},[B("div",{class:"animate-spin rounded-full h-16 w-16 border-b-2 border-primary-500"})],-1)),B("div",_S,[B("p",KS,F(Y.$t("generateModal.generating")),1),B("div",OS,[B("div",{class:"bg-primary-500 h-2 rounded-full transition-all duration-500 ease-out",style:VA({width:I.value+"%"})},null,4)]),B("div",PS,[B("div",null,F(l.value),1),B("div",VS,F(Y.$t("generateModal.progress",{progress:I.value})),1)])]),B("div",WS,[(T(!0),K(qA,null,Ke(d.value,z=>(T(),K("div",{key:z.id,class:"flex items-center text-sm"},[B("div",qS,[z.status==="completed"?(T(),K("div",jS,[...W[4]||(W[4]=[B("svg",{class:"w-3 h-3 text-white",fill:"currentColor",viewBox:"0 0 20 20"},[B("path",{"fill-rule":"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z","clip-rule":"evenodd"})],-1)])])):z.status==="processing"?(T(),K("div",ZS)):(T(),K("div",XS))]),B("span",{class:kA([z.status==="completed"?"text-green-700":z.status==="processing"?"text-primary-700":"text-gray-500"])},F(z.name),3)]))),128))])])):sA("",!0),a.value&&!u.value?(T(),K("div",zS,[W[8]||(W[8]=B("div",{class:"mx-auto flex items-center justify-center"},[B("svg",{class:"w-20 h-20 text-green-600",fill:"currentColor",viewBox:"0 0 20 20"},[B("path",{"fill-rule":"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z","clip-rule":"evenodd"})])],-1)),B("div",null,[B("p",$S,F(Y.$t("generateModal.completed")),1)]),B("div",AR,[B("div",eR,[B("div",null,F(Y.$t("generateModal.filename")),1),B("div",null,F(Y.$t("generateModal.fileSize",{size:C.value})),1),B("div",null,F(Y.$t("generateModal.generationTime",{time:Q.value})),1)])]),B("div",tR,[B("button",{onClick:tA,class:"w-full bg-gray-100 hover:bg-gray-200 text-gray-700 px-6 py-3 rounded-lg font-medium transition-colors flex items-center justify-center"},[W[6]||(W[6]=B("svg",{class:"w-5 h-5 mr-2",fill:"currentColor",viewBox:"0 0 20 20"},[B("path",{"fill-rule":"evenodd",d:"M3 17a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zm3.293-7.707a1 1 0 011.414 0L9 10.586V3a1 1 0 112 0v7.586l1.293-1.293a1 1 0 111.414 1.414l-3 3a1 1 0 01-1.414 0l-3-3a1 1 0 010-1.414z","clip-rule":"evenodd"})],-1)),gt(" "+F(Y.$t("generateModal.downloadAssets")),1)]),B("button",{onClick:fA,disabled:!BA(g),class:"w-full bg-blue-500 hover:bg-blue-600 disabled:bg-gray-300 text-white px-6 py-3 rounded-lg font-medium transition-colors flex items-center justify-center"},[W[7]||(W[7]=B("svg",{class:"w-5 h-5 mr-2",fill:"currentColor",viewBox:"0 0 20 20"},[B("path",{"fill-rule":"evenodd",d:"M3 17a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zm3.293-7.707a1 1 0 011.414 0L9 10.586V3a1 1 0 112 0v7.586l1.293-1.293a1 1 0 111.414 1.414l-3 3a1 1 0 01-1.414 0l-3-3a1 1 0 010-1.414z","clip-rule":"evenodd"})],-1)),gt(" "+F(Y.$t("generateModal.flashToDevice")),1)],8,iR)])])):sA("",!0),u.value&&!c.value?(T(),K("div",nR,[W[9]||(W[9]=B("div",{class:"flex items-center justify-center"},[B("div",{class:"animate-spin rounded-full h-16 w-16 border-b-2 border-blue-500"})],-1)),B("div",oR,[B("p",rR,F(Y.$t("generateModal.flashing")),1),B("div",gR,[B("div",{class:"bg-blue-500 h-2 rounded-full transition-all duration-500 ease-out",style:VA({width:E.value+"%"})},null,4)]),B("div",sR,[B("div",null,F(D.value),1),B("div",aR,F(Y.$t("generateModal.progress",{progress:E.value})),1)])])])):sA("",!0),c.value?(T(),K("div",IR,[B("p",CR,F(c.value),1)])):sA("",!0)]),B("div",lR,[!s.value&&!a.value?(T(),K("button",{key:0,onClick:W[1]||(W[1]=z=>Y.$emit("close")),class:"px-4 py-2 text-sm font-medium text-gray-700 bg-gray-100 hover:bg-gray-200 rounded-md transition-colors"},F(Y.$t("common.cancel")),1)):sA("",!0),!s.value&&!a.value?(T(),K("button",{key:1,onClick:X,disabled:!S.value,class:"px-6 py-2 text-sm font-medium text-white bg-primary-500 hover:bg-primary-600 disabled:bg-gray-300 rounded-md transition-colors"},F(Y.$t("common.start"))+" "+F(Y.$t("common.generate")),9,BR)):sA("",!0),a.value&&!u.value?(T(),K("button",{key:2,onClick:W[2]||(W[2]=z=>Y.$emit("close")),class:"px-4 py-2 text-sm font-medium text-gray-700 bg-gray-100 hover:bg-gray-200 rounded-md transition-colors"},F(Y.$t("common.close")),1)):sA("",!0)])])]))}},cR={class:"flex items-center justify-between mb-2"},ER={class:"flex items-center"},uR={class:"text-blue-800 font-medium"},hR={class:"text-blue-600 text-sm mb-3"},fR={class:"flex justify-end space-x-2"},dR={class:"flex items-center justify-center mb-8"},pR={class:"flex flex-col items-center"},mR={class:"text-sm mt-2 text-gray-600"},yR={key:0,class:"w-16 h-0.5 bg-gray-300 mx-4"},wR={class:"bg-white rounded-lg shadow-sm border p-6"},Kl={__name:"HomePage",setup(A){const e=No(),{t}=ve(),i=EA(30),n=EA(null),o=EA(0),r=EA(!1),g=EA("wakeword"),s=EA(!1),a=EA(!1),I=EA(!1),l=EA(!0),C=new _l,Q=EA(null),h=EA(""),f=[{titleKey:"steps.chip",key:"chip"},{titleKey:"steps.theme",key:"theme"},{titleKey:"steps.generate",key:"generate"}],u=EA({chip:{model:"",display:{width:320,height:240,color:"RGB565"}},theme:{wakeword:{type:"none",preset:"",custom:{name:"",command:"",threshold:20,duration:3e3,model:"mn6_cn"}},font:{type:"none",preset:"",hide_subtitle:!1,custom:{file:null,size:20,bpp:4,charset:"deepseek"}},emoji:{type:"none",preset:"",custom:{size:{width:160,height:120},images:{}}},skin:{light:{backgroundType:"color",backgroundColor:"#ffffff",textColor:"#000000",backgroundImage:null},dark:{backgroundType:"color",backgroundColor:"#121212",textColor:"#ffffff",backgroundImage:null}}}});hA(()=>u.value.chip.model&&(u.value.theme.font.type==="none"||u.value.theme.font.preset||u.value.theme.font.custom.file));const E=IA=>IA{o.value{o.value>0&&o.value--},d=()=>{r.value=!0},p=async IA=>{},v=async(IA,nA={})=>await e.callMcpTool(IA,nA),N=async IA=>{const{blob:nA,onProgress:X,onComplete:tA,onError:fA}=IA;try{X(15,t("flashProgress.checkingDeviceStatus"));try{if((await v("self.get_device_status")).code!==0)throw new Error(t("flashProgress.deviceOfflineOrUnresponsive",{error:t("flashProgress.unableToGetDeviceStatus")}))}catch(Y){console.error("检查设备状态失败:",Y),fA(t("flashProgress.deviceOfflineOrUnresponsive",{error:Y.msg}));return}X(30,t("flashProgress.uploadingFile"));try{const Y=new FormData;Y.append("file",nA,"assets.bin");const z=await(await fetch("/xiaozhi/otaMag/uploadAssetsBin",{method:"POST",body:Y,headers:{Authorization:`Bearer ${e.token.value}`}})).json();z.code!==0&&await Promise.reject(z),h.value=z.data}catch{fA(t("flashProgress.uploadFailed"));return}X(45,t("flashProgress.settingDeviceDownloadUrl"));try{const Y=await v("self.assets.set_download_url",{url:h.value});Y.code!==0&&await Promise.reject(Y)}catch(Y){console.error("设置下载URL失败:",Y),fA(t("flashProgress.setDownloadUrlFailed",{error:Y.msg}));return}X(60,t("flashProgress.waitingForDeviceReboot")),await v("self.reboot").catch(Y=>{console.warn("reboot指令调用警告(设备可能已重启):",Y)}),X(75,t("flashProgress.deviceReady")),n.value=setInterval(()=>{if(X(90,t("flashProgress.flashCompleted")),i.value-=1,i.value<=0){clearInterval(n.value),i.value=30,n.value=null,fA("请求超时,请检查设备烧录是否异常");return}v("self.get_device_status").then(Y=>{n.value&&Y.code===0&&(clearInterval(n.value),n.value=null,i.value=30,tA())})},5e3)}catch(Y){console.error("在线烧录失败:",Y),fA(t("flashProgress.onlineFlashFailed",{error:Y.msg}))}},G=IA=>{g.value=IA},_=async()=>{var IA,nA,X;try{l.value=!0;const tA=await Qe.loadConfig();if(tA){u.value=tA.config,o.value=0,g.value="wakeword",s.value=!0,a.value=!0,await S(),Q.value&&clearTimeout(Q.value),Q.value=setTimeout(()=>{s.value=!1},5e3),C.setConfig(u.value,{strict:!1}),await C.restoreAllResourcesFromStorage(u.value);try{const fA=((X=(nA=(IA=u.value)==null?void 0:IA.theme)==null?void 0:nA.emoji)==null?void 0:X.custom)||{},Y=fA.images||{},W=fA.fileMap||{},z=fA.emotionMap||{};u.value={...u.value,theme:{...u.value.theme,emoji:{...u.value.theme.emoji,custom:{...fA,images:{...Y},fileMap:{...W},emotionMap:{...z}}}}}}catch(fA){console.error("刷新表情配置引用失败:",fA)}}else s.value=!1,a.value=!1}catch(tA){console.error("加载配置失败:",tA),s.value=!1,a.value=!1}finally{l.value=!1}},S=async()=>{var IA,nA,X;try{const tA=(X=(nA=(IA=u.value)==null?void 0:IA.theme)==null?void 0:nA.emoji)==null?void 0:X.custom;if(!tA)return;const fA=Object.keys(tA.images||{}).length>0,Y=tA.fileMap&&Object.keys(tA.fileMap).length>0,W=tA.emotionMap&&Object.keys(tA.emotionMap).length>0;if(fA&&(!Y||!W)){console.warn("⚠️ 检测到旧版本的表情数据结构(不兼容)"),console.log("正在清理旧数据...");try{const DA=Object.keys(tA.images||{});for(const NA of DA)await Qe.deleteFile(`emoji_${NA}`);console.log(`已删除 ${DA.length} 个旧表情文件`)}catch(DA){console.warn("清理旧表情文件时出错:",DA)}u.value.theme.emoji.custom={size:tA.size||{width:64,height:64},images:{},fileMap:{},emotionMap:{}},u.value.theme.emoji.type==="custom"&&(u.value.theme.emoji.type="",console.log("已重置表情类型,请重新选择")),await b(),console.log("✅ 旧表情数据已完全清除"),setTimeout(()=>{alert(`检测到旧版本的表情数据结构已被清除。 新版本使用文件去重技术,可以节省存储空间。 -请重新上传自定义表情图片。`)},500)}}catch(tA){console.error("清理旧表情数据时出错:",tA)}},b=async()=>{try{await Qe.saveConfig(u.value)}catch(IA){console.error("保存配置失败:",IA)}},L=async()=>{try{I.value=!0,await C.clearAllStoredData();const IA={model:u.value.chip.model,display:{...u.value.chip.display}};u.value={chip:IA,theme:{wakeword:{type:"none",preset:"",custom:{name:"",command:"",threshold:20,model:"mn6_cn"}},font:{type:"none",preset:"",hide_subtitle:!1,custom:{file:null,size:20,bpp:4,charset:"deepseek"}},emoji:{type:"none",preset:"",custom:{size:{width:64,height:64},images:{}}},skin:{light:{backgroundType:"color",backgroundColor:"#ffffff",textColor:"#000000",backgroundImage:null},dark:{backgroundType:"color",backgroundColor:"#121212",textColor:"#ffffff",backgroundImage:null}}}},o.value=0,g.value="wakeword",s.value=!1,a.value=!1}catch(IA){console.error("重置配置失败:",IA),alert(t("errors.resetFailed"))}finally{I.value=!1}};ae(u,async IA=>{!l.value&&a.value&&await b()},{deep:!0}),Ft(async()=>{await Qe.initialize(),await K()}),Ii(()=>{Q.value&&(clearTimeout(Q.value),clearInterval(n.value))});const EA=()=>{s.value=!1,Q.value&&clearTimeout(Q.value)},dA=()=>{Q.value&&clearTimeout(Q.value),Q.value=setTimeout(()=>{s.value=!1},5e3)};return(IA,nA)=>(T(),_("div",null,[s.value?(T(),_("div",{key:0,class:"fixed bottom-4 right-4 z-50 bg-blue-50 border border-blue-200 rounded-lg p-4 shadow-lg transition-opacity duration-300 min-w-[300px]",onMouseenter:dA},[B("div",cR,[B("div",ER,[nA[3]||(nA[3]=B("svg",{class:"w-5 h-5 text-blue-500 mr-2",fill:"currentColor",viewBox:"0 0 20 20"},[B("path",{"fill-rule":"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z","clip-rule":"evenodd"})],-1)),B("span",uR,v(IA.$t("configNotice.title")),1)]),B("button",{onClick:EA,class:"text-gray-500 hover:text-gray-700"},[...nA[4]||(nA[4]=[B("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[B("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])])]),B("p",hR,v(IA.$t("configNotice.message")),1),B("div",fR,[B("button",{onClick:L,class:"px-3 py-1 text-sm text-red-600 hover:text-red-800 font-medium"},v(IA.$t("configNotice.restart")),1)])],32)):sA("",!0),B("div",dR,[(T(),_(qA,null,Ke(f,(X,tA)=>B("div",{key:tA,class:"flex items-center"},[B("div",pR,[B("div",{class:kA(E(tA))},v(tA+1),3),B("span",mR,v(IA.$t(X.titleKey)),1)]),tAu.value.chip=X),onNext:m},null,8,["modelValue"])):sA("",!0),o.value===1?(T(),ye(yy,{key:1,modelValue:u.value.theme,"onUpdate:modelValue":nA[1]||(nA[1]=X=>u.value.theme=X),chipModel:u.value.chip.model,activeTab:g.value,onNext:m,onPrev:c,onTabChange:G},null,8,["modelValue","chipModel","activeTab"])):sA("",!0),o.value===2?(T(),ye(Ew,{key:2,config:u.value,onGenerate:d,onPrev:c},null,8,["config"])):sA("",!0)]),r.value?(T(),ye(QR,{key:1,config:u.value,onClose:nA[2]||(nA[2]=X=>r.value=!1),onGenerate:w,onStartFlash:N},null,8,["config"])):sA("",!0)]))}},DR=Object.freeze(Object.defineProperty({__proto__:null,default:Kl},Symbol.toStringTag,{value:"Module"})),kR={class:"min-h-screen bg-gray-50"},vR={class:"bg-white shadow-sm border-b"},FR={class:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-4"},SR={class:"flex flex-col relative sm:flex-row items-start sm:items-center justify-between gap-3 sm:gap-0"},RR={class:"text-2xl font-bold text-gray-900"},bR={class:"flex items-center space-x-4"},NR={class:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8"},GR={__name:"App",setup(A){const e=cA(""),t=()=>{e.value&&(window.location.href=e.value)};return Ft(()=>{e.value=sessionStorage.getItem("devicePath")}),(i,n)=>(T(),_("div",kR,[B("header",vR,[B("div",FR,[B("div",SR,[e.value?(T(),_("div",{key:0,class:"bg-primary-500 hover:bg-primary-600 text-white px-6 py-1 rounded-md cursor-pointer",onClick:t},"返回")):sA("",!0),B("h1",RR,v(i.$t("header.title")),1),B("div",bR,[TA(Eh),TA(gd)])])])]),B("main",NR,[TA(Kl)])]))}};/*! +请重新上传自定义表情图片。`)},500)}}catch(tA){console.error("清理旧表情数据时出错:",tA)}},b=async()=>{try{await Qe.saveConfig(u.value)}catch(IA){console.error("保存配置失败:",IA)}},L=async()=>{try{I.value=!0,await C.clearAllStoredData();const IA={model:u.value.chip.model,display:{...u.value.chip.display}};u.value={chip:IA,theme:{wakeword:{type:"none",preset:"",custom:{name:"",command:"",threshold:20,model:"mn6_cn"}},font:{type:"none",preset:"",hide_subtitle:!1,custom:{file:null,size:20,bpp:4,charset:"deepseek"}},emoji:{type:"none",preset:"",custom:{size:{width:64,height:64},images:{}}},skin:{light:{backgroundType:"color",backgroundColor:"#ffffff",textColor:"#000000",backgroundImage:null},dark:{backgroundType:"color",backgroundColor:"#121212",textColor:"#ffffff",backgroundImage:null}}}},o.value=0,g.value="wakeword",s.value=!1,a.value=!1}catch(IA){console.error("重置配置失败:",IA),alert(t("errors.resetFailed"))}finally{I.value=!1}};ae(u,async IA=>{!l.value&&a.value&&await b()},{deep:!0}),Ft(async()=>{await Qe.initialize(),await _()}),Ii(()=>{Q.value&&(clearTimeout(Q.value),clearInterval(n.value))});const QA=()=>{s.value=!1,Q.value&&clearTimeout(Q.value)},dA=()=>{Q.value&&clearTimeout(Q.value),Q.value=setTimeout(()=>{s.value=!1},5e3)};return(IA,nA)=>(T(),K("div",null,[s.value?(T(),K("div",{key:0,class:"fixed bottom-4 right-4 z-50 bg-blue-50 border border-blue-200 rounded-lg p-4 shadow-lg transition-opacity duration-300 min-w-[300px]",onMouseenter:dA},[B("div",cR,[B("div",ER,[nA[3]||(nA[3]=B("svg",{class:"w-5 h-5 text-blue-500 mr-2",fill:"currentColor",viewBox:"0 0 20 20"},[B("path",{"fill-rule":"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z","clip-rule":"evenodd"})],-1)),B("span",uR,F(IA.$t("configNotice.title")),1)]),B("button",{onClick:QA,class:"text-gray-500 hover:text-gray-700"},[...nA[4]||(nA[4]=[B("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[B("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])])]),B("p",hR,F(IA.$t("configNotice.message")),1),B("div",fR,[B("button",{onClick:L,class:"px-3 py-1 text-sm text-red-600 hover:text-red-800 font-medium"},F(IA.$t("configNotice.restart")),1)])],32)):sA("",!0),B("div",dR,[(T(),K(qA,null,Ke(f,(X,tA)=>B("div",{key:tA,class:"flex items-center"},[B("div",pR,[B("div",{class:kA(E(tA))},F(tA+1),3),B("span",mR,F(IA.$t(X.titleKey)),1)]),tAu.value.chip=X),onNext:D},null,8,["modelValue"])):sA("",!0),o.value===1?(T(),ye(yy,{key:1,modelValue:u.value.theme,"onUpdate:modelValue":nA[1]||(nA[1]=X=>u.value.theme=X),chipModel:u.value.chip.model,activeTab:g.value,onNext:D,onPrev:c,onTabChange:G},null,8,["modelValue","chipModel","activeTab"])):sA("",!0),o.value===2?(T(),ye(Ew,{key:2,config:u.value,onGenerate:d,onPrev:c},null,8,["config"])):sA("",!0)]),r.value?(T(),ye(QR,{key:1,config:u.value,onClose:nA[2]||(nA[2]=X=>r.value=!1),onGenerate:p,onStartFlash:N},null,8,["config"])):sA("",!0)]))}},DR=Object.freeze(Object.defineProperty({__proto__:null,default:Kl},Symbol.toStringTag,{value:"Module"})),kR={class:"min-h-screen bg-gray-50"},vR={class:"bg-white shadow-sm border-b"},FR={class:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-4"},SR={class:"flex flex-col relative sm:flex-row items-start sm:items-center justify-between gap-3 sm:gap-0"},RR={class:"text-2xl font-bold text-gray-900"},bR={class:"flex items-center space-x-4"},NR={class:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8"},GR={__name:"App",setup(A){const e=EA(""),t=()=>{e.value&&(window.location.href=e.value)};return Ft(()=>{e.value=sessionStorage.getItem("devicePath")}),(i,n)=>(T(),K("div",kR,[B("header",vR,[B("div",FR,[B("div",SR,[e.value?(T(),K("div",{key:0,class:"bg-primary-500 hover:bg-primary-600 text-white px-6 py-1 rounded-md cursor-pointer",onClick:t},"返回")):sA("",!0),B("h1",RR,F(i.$t("header.title")),1),B("div",bR,[TA(Eh),TA(gd)])])])]),B("main",NR,[TA(Kl)])]))}};/*! * vue-router v4.6.4 * (c) 2025 Eduardo San Martin Morote * @license MIT @@ -78,4 +78,4 @@ Vui lòng tải lại hình ảnh biểu tượng cảm xúc tùy chỉnh.`,inco * vue-router v4.6.4 * (c) 2025 Eduardo San Martin Morote * @license MIT - */let Qb=()=>location.protocol+"//"+location.host;function AB(A,e){const{pathname:t,search:i,hash:n}=e,o=A.indexOf("#");if(o>-1){let r=n.includes(A.slice(o))?A.slice(o).length:1,g=n.slice(r);return g[0]!=="/"&&(g="/"+g),Ya(g,"")}return Ya(t,A)+i+n}function cb(A,e,t,i){let n=[],o=[],r=null;const g=({state:C})=>{const Q=AB(A,location),h=t.value,f=e.value;let u=0;if(C){if(t.value=Q,e.value=C,r&&r===h){r=null;return}u=f?C.position-f.position:0}else i(Q);n.forEach(E=>{E(t.value,h,{delta:u,type:_r.pop,direction:u?u>0?gr.forward:gr.back:gr.unknown})})};function s(){r=t.value}function a(C){n.push(C);const Q=()=>{const h=n.indexOf(C);h>-1&&n.splice(h,1)};return o.push(Q),Q}function I(){if(document.visibilityState==="hidden"){const{history:C}=window;if(!C.state)return;C.replaceState(MA({},C.state,{scroll:Uo()}),"")}}function l(){for(const C of o)C();o=[],window.removeEventListener("popstate",g),window.removeEventListener("pagehide",I),document.removeEventListener("visibilitychange",I)}return window.addEventListener("popstate",g),window.addEventListener("pagehide",I),document.addEventListener("visibilitychange",I),{pauseListeners:s,listen:a,destroy:l}}function Va(A,e,t,i=!1,n=!1){return{back:A,current:e,forward:t,replaced:i,position:window.history.length,scroll:n?Uo():null}}function Eb(A){const{history:e,location:t}=window,i={value:AB(A,t)},n={value:e.state};n.value||o(i.value,{back:null,current:i.value,forward:null,position:e.length-1,replaced:!0,scroll:null},!0);function o(s,a,I){const l=A.indexOf("#"),C=l>-1?(t.host&&document.querySelector("base")?A:A.slice(l))+s:Qb()+A+s;try{e[I?"replaceState":"pushState"](a,"",C),n.value=a}catch(Q){console.error(Q),t[I?"replace":"assign"](C)}}function r(s,a){o(s,MA({},e.state,Va(n.value.back,s,n.value.forward,!0),a,{position:n.value.position}),!0),i.value=s}function g(s,a){const I=MA({},n.value,e.state,{forward:s,scroll:Uo()});o(I.current,I,!0),o(s,MA({},Va(i.value,s,null),{position:I.position+1},a),!1),i.value=s}return{location:i,state:n,push:g,replace:r}}function ub(A){A=Ab(A);const e=Eb(A),t=cb(A,e.state,e.location,e.replace);function i(o,r=!0){r||t.pauseListeners(),history.go(o)}const n=MA({location:"",base:A,go:i,createHref:tb.bind(null,A)},e,t);return Object.defineProperty(n,"location",{enumerable:!0,get:()=>e.location.value}),Object.defineProperty(n,"state",{enumerable:!0,get:()=>e.state.value}),n}let oi=function(A){return A[A.Static=0]="Static",A[A.Param=1]="Param",A[A.Group=2]="Group",A}({});var oe=function(A){return A[A.Static=0]="Static",A[A.Param=1]="Param",A[A.ParamRegExp=2]="ParamRegExp",A[A.ParamRegExpEnd=3]="ParamRegExpEnd",A[A.EscapeNext=4]="EscapeNext",A}(oe||{});const hb={type:oi.Static,value:""},fb=/[a-zA-Z0-9_]/;function db(A){if(!A)return[[]];if(A==="/")return[[hb]];if(!A.startsWith("/"))throw new Error(`Invalid path "${A}"`);function e(Q){throw new Error(`ERR (${t})/"${a}": ${Q}`)}let t=oe.Static,i=t;const n=[];let o;function r(){o&&n.push(o),o=[]}let g=0,s,a="",I="";function l(){a&&(t===oe.Static?o.push({type:oi.Static,value:a}):t===oe.Param||t===oe.ParamRegExp||t===oe.ParamRegExpEnd?(o.length>1&&(s==="*"||s==="+")&&e(`A repeatable param (${a}) must be alone in its segment. eg: '/:ids+.`),o.push({type:oi.Param,value:a,regexp:I,repeatable:s==="*"||s==="+",optional:s==="*"||s==="?"})):e("Invalid state to consume buffer"),a="")}function C(){a+=s}for(;ge.length?e.length===1&&e[0]===pe.Static+pe.Segment?1:-1:0}function eB(A,e){let t=0;const i=A.score,n=e.score;for(;t0&&e[e.length-1]<0}const Db={strict:!1,end:!0,sensitive:!1};function kb(A,e,t){const i=yb(db(A.path),t),n=MA(i,{record:A,parent:e,children:[],alias:[]});return e&&!n.record.aliasOf==!e.record.aliasOf&&e.children.push(n),n}function vb(A,e){const t=[],i=new Map;e=Ha(Db,e);function n(l){return i.get(l)}function o(l,C,Q){const h=!Q,f=Za(l);f.aliasOf=Q&&Q.record;const u=Ha(e,l),E=[f];if("alias"in l){const d=typeof l.alias=="string"?[l.alias]:l.alias;for(const w of d)E.push(Za(MA({},f,{components:Q?Q.record.components:f.components,path:w,aliasOf:Q?Q.record:f})))}let m,c;for(const d of E){const{path:w}=d;if(C&&w[0]!=="/"){const F=C.record.path,N=F[F.length-1]==="/"?"":"/";d.path=C.record.path+(w&&N+w)}if(m=kb(d,C,u),Q?Q.alias.push(m):(c=c||m,c!==m&&c.alias.push(m),h&&l.name&&!Xa(m)&&r(l.name)),tB(m)&&s(m),f.children){const F=f.children;for(let N=0;N{r(c)}:zi}function r(l){if(Xl(l)){const C=i.get(l);C&&(i.delete(l),t.splice(t.indexOf(C),1),C.children.forEach(r),C.alias.forEach(r))}else{const C=t.indexOf(l);C>-1&&(t.splice(C,1),l.record.name&&i.delete(l.record.name),l.children.forEach(r),l.alias.forEach(r))}}function g(){return t}function s(l){const C=Rb(l,t);t.splice(C,0,l),l.record.name&&!Xa(l)&&i.set(l.record.name,l)}function a(l,C){let Q,h={},f,u;if("name"in l&&l.name){if(Q=i.get(l.name),!Q)throw Ni(XA.MATCHER_NOT_FOUND,{location:l});u=Q.record.name,h=MA(ja(C.params,Q.keys.filter(c=>!c.optional).concat(Q.parent?Q.parent.keys.filter(c=>c.optional):[]).map(c=>c.name)),l.params&&ja(l.params,Q.keys.map(c=>c.name))),f=Q.stringify(h)}else if(l.path!=null)f=l.path,Q=t.find(c=>c.re.test(f)),Q&&(h=Q.parse(f),u=Q.record.name);else{if(Q=C.name?i.get(C.name):t.find(c=>c.re.test(C.path)),!Q)throw Ni(XA.MATCHER_NOT_FOUND,{location:l,currentLocation:C});u=Q.record.name,h=MA({},C.params,l.params),f=Q.stringify(h)}const E=[];let m=Q;for(;m;)E.unshift(m.record),m=m.parent;return{name:u,path:f,params:h,matched:E,meta:Sb(E)}}A.forEach(l=>o(l));function I(){t.length=0,i.clear()}return{addRoute:o,resolve:a,removeRoute:r,clearRoutes:I,getRoutes:g,getRecordMatcher:n}}function ja(A,e){const t={};for(const i of e)i in A&&(t[i]=A[i]);return t}function Za(A){const e={path:A.path,redirect:A.redirect,name:A.name,meta:A.meta||{},aliasOf:A.aliasOf,beforeEnter:A.beforeEnter,props:Fb(A),children:A.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in A?A.components||null:A.component&&{default:A.component}};return Object.defineProperty(e,"mods",{value:{}}),e}function Fb(A){const e={},t=A.props||!1;if("component"in A)e.default=t;else for(const i in A.components)e[i]=typeof t=="object"?t[i]:t;return e}function Xa(A){for(;A;){if(A.record.aliasOf)return!0;A=A.parent}return!1}function Sb(A){return A.reduce((e,t)=>MA(e,t.meta),{})}function Rb(A,e){let t=0,i=e.length;for(;t!==i;){const o=t+i>>1;eB(A,e[o])<0?i=o:t=o+1}const n=bb(A);return n&&(i=e.lastIndexOf(n,i-1)),i}function bb(A){let e=A;for(;e=e.parent;)if(tB(e)&&eB(A,e)===0)return e}function tB({record:A}){return!!(A.name||A.components&&Object.keys(A.components).length||A.redirect)}function za(A){const e=rt(Sg),t=rt($l),i=hA(()=>{const s=BA(A.to);return e.resolve(s)}),n=hA(()=>{const{matched:s}=i.value,{length:a}=s,I=s[a-1],l=t.matched;if(!I||!l.length)return-1;const C=l.findIndex(bi.bind(null,I));if(C>-1)return C;const Q=$a(s[a-2]);return a>1&&$a(I)===Q&&l[l.length-1].path!==Q?l.findIndex(bi.bind(null,s[a-2])):C}),o=hA(()=>n.value>-1&&Mb(t.params,i.value.params)),r=hA(()=>n.value>-1&&n.value===t.matched.length-1&&Zl(t.params,i.value.params));function g(s={}){if(Ub(s)){const a=e[BA(A.replace)?"replace":"push"](BA(A.to)).catch(zi);return A.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>a),a}return Promise.resolve()}return{route:i,href:hA(()=>i.value.href),isActive:o,isExactActive:r,navigate:g}}function Nb(A){return A.length===1?A[0]:A}const Gb=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:za,setup(A,{slots:e}){const t=po(za(A)),{options:i}=rt(Sg),n=hA(()=>({[AI(A.activeClass,i.linkActiveClass,"router-link-active")]:t.isActive,[AI(A.exactActiveClass,i.linkExactActiveClass,"router-link-exact-active")]:t.isExactActive}));return()=>{const o=e.default&&Nb(e.default(t));return A.custom?o:GA("a",{"aria-current":t.isExactActive?A.ariaCurrentValue:null,href:t.href,onClick:t.navigate,class:n.value},o)}}}),Lb=Gb;function Ub(A){if(!(A.metaKey||A.altKey||A.ctrlKey||A.shiftKey)&&!A.defaultPrevented&&!(A.button!==void 0&&A.button!==0)){if(A.currentTarget&&A.currentTarget.getAttribute){const e=A.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(e))return}return A.preventDefault&&A.preventDefault(),!0}}function Mb(A,e){for(const t in e){const i=e[t],n=A[t];if(typeof i=="string"){if(i!==n)return!1}else if(!qe(n)||n.length!==i.length||i.some((o,r)=>o.valueOf()!==n[r].valueOf()))return!1}return!0}function $a(A){return A?A.aliasOf?A.aliasOf.path:A.path:""}const AI=(A,e,t)=>A??e??t,xb=fn({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(A,{attrs:e,slots:t}){const i=rt(Or),n=hA(()=>A.route||i.value),o=rt(Pa,0),r=hA(()=>{let a=BA(o);const{matched:I}=n.value;let l;for(;(l=I[a])&&!l.components;)a++;return a}),g=hA(()=>n.value.matched[r.value]);Hn(Pa,hA(()=>r.value+1)),Hn(lb,g),Hn(Or,n);const s=cA();return ae(()=>[s.value,g.value,A.name],([a,I,l],[C,Q,h])=>{I&&(I.instances[l]=a,Q&&Q!==I&&a&&a===C&&(I.leaveGuards.size||(I.leaveGuards=Q.leaveGuards),I.updateGuards.size||(I.updateGuards=Q.updateGuards))),a&&I&&(!Q||!bi(I,Q)||!C)&&(I.enterCallbacks[l]||[]).forEach(f=>f(a))},{flush:"post"}),()=>{const a=n.value,I=A.name,l=g.value,C=l&&l.components[I];if(!C)return eI(t.default,{Component:C,route:a});const Q=l.props[I],h=Q?Q===!0?a.params:typeof Q=="function"?Q(a):Q:null,u=GA(C,MA({},h,e,{onVnodeUnmounted:E=>{E.component.isUnmounted&&(l.instances[I]=null)},ref:s}));return eI(t.default,{Component:u,route:a})||u}}});function eI(A,e){if(!A)return null;const t=A(e);return t.length===1?t[0]:t}const Jb=xb;function Tb(A){const e=vb(A.routes,A),t=A.parseQuery||Ib,i=A.stringifyQuery||Oa,n=A.history,o=Yi(),r=Yi(),g=Yi(),s=tg(Gt);let a=Gt;ci&&A.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const I=or.bind(null,H=>""+H),l=or.bind(null,WR),C=or.bind(null,cn);function Q(H,$){let AA,QA;return Xl(H)?(AA=e.getRecordMatcher(H),QA=$):QA=H,e.addRoute(QA,AA)}function h(H){const $=e.getRecordMatcher(H);$&&e.removeRoute($)}function f(){return e.getRoutes().map(H=>H.record)}function u(H){return!!e.getRecordMatcher(H)}function E(H,$){if($=MA({},$||s.value),typeof H=="string"){const k=rr(t,H,$.path),x=e.resolve({path:k.path},$),q=n.createHref(k.fullPath);return MA(k,x,{params:C(x.params),hash:cn(k.hash),redirectedFrom:void 0,href:q})}let AA;if(H.path!=null)AA=MA({},H,{path:rr(t,H.path,$.path).path});else{const k=MA({},H.params);for(const x in k)k[x]==null&&delete k[x];AA=MA({},H,{params:l(k)}),$.params=l($.params)}const QA=e.resolve(AA,$),SA=H.hash||"";QA.params=I(C(QA.params));const D=ZR(i,MA({},H,{hash:OR(SA),path:QA.path})),S=n.createHref(D);return MA({fullPath:D,hash:SA,query:i===Oa?Cb(H.query):H.query||{}},QA,{redirectedFrom:void 0,href:S})}function m(H){return typeof H=="string"?rr(t,H,s.value.path):MA({},H)}function c(H,$){if(a!==H)return Ni(XA.NAVIGATION_CANCELLED,{from:$,to:H})}function d(H){return N(H)}function w(H){return d(MA(m(H),{replace:!0}))}function F(H,$){const AA=H.matched[H.matched.length-1];if(AA&&AA.redirect){const{redirect:QA}=AA;let SA=typeof QA=="function"?QA(H,$):QA;return typeof SA=="string"&&(SA=SA.includes("?")||SA.includes("#")?SA=m(SA):{path:SA},SA.params={}),MA({query:H.query,hash:H.hash,params:SA.path!=null?{}:H.params},SA)}}function N(H,$){const AA=a=E(H),QA=s.value,SA=H.state,D=H.force,S=H.replace===!0,k=F(AA,QA);if(k)return N(MA(m(k),{state:typeof k=="object"?MA({},SA,k.state):SA,force:D,replace:S}),$||AA);const x=AA;x.redirectedFrom=$;let q;return!D&&XR(i,QA,AA)&&(q=Ni(XA.NAVIGATION_DUPLICATED,{to:x,from:QA}),W(QA,QA,!0,!1)),(q?Promise.resolve(q):R(x,QA)).catch(V=>ct(V)?ct(V,XA.NAVIGATION_GUARD_REDIRECT)?V:Y(V):tA(V,x,QA)).then(V=>{if(V){if(ct(V,XA.NAVIGATION_GUARD_REDIRECT))return N(MA({replace:S},m(V.to),{state:typeof V.to=="object"?MA({},SA,V.to.state):SA,force:D}),$||x)}else V=L(x,QA,!0,S,SA);return b(x,QA,V),V})}function G(H,$){const AA=c(H,$);return AA?Promise.reject(AA):Promise.resolve()}function K(H){const $=NA.values().next().value;return $&&typeof $.runWithContext=="function"?$.runWithContext(H):H()}function R(H,$){let AA;const[QA,SA,D]=Bb(H,$);AA=sr(QA.reverse(),"beforeRouteLeave",H,$);for(const k of QA)k.leaveGuards.forEach(x=>{AA.push(Tt(x,H,$))});const S=G.bind(null,H,$);return AA.push(S),LA(AA).then(()=>{AA=[];for(const k of o.list())AA.push(Tt(k,H,$));return AA.push(S),LA(AA)}).then(()=>{AA=sr(SA,"beforeRouteUpdate",H,$);for(const k of SA)k.updateGuards.forEach(x=>{AA.push(Tt(x,H,$))});return AA.push(S),LA(AA)}).then(()=>{AA=[];for(const k of D)if(k.beforeEnter)if(qe(k.beforeEnter))for(const x of k.beforeEnter)AA.push(Tt(x,H,$));else AA.push(Tt(k.beforeEnter,H,$));return AA.push(S),LA(AA)}).then(()=>(H.matched.forEach(k=>k.enterCallbacks={}),AA=sr(D,"beforeRouteEnter",H,$,K),AA.push(S),LA(AA))).then(()=>{AA=[];for(const k of r.list())AA.push(Tt(k,H,$));return AA.push(S),LA(AA)}).catch(k=>ct(k,XA.NAVIGATION_CANCELLED)?k:Promise.reject(k))}function b(H,$,AA){g.list().forEach(QA=>K(()=>QA(H,$,AA)))}function L(H,$,AA,QA,SA){const D=c(H,$);if(D)return D;const S=$===Gt,k=ci?history.state:{};AA&&(QA||S?n.replace(H.fullPath,MA({scroll:S&&k&&k.scroll},SA)):n.push(H.fullPath,SA)),s.value=H,W(H,$,AA,S),Y()}let EA;function dA(){EA||(EA=n.listen((H,$,AA)=>{if(!ne.listening)return;const QA=E(H),SA=F(QA,ne.currentRoute.value);if(SA){N(MA(SA,{replace:!0,force:!0}),QA).catch(zi);return}a=QA;const D=s.value;ci&&ob(Ka(D.fullPath,AA.delta),Uo()),R(QA,D).catch(S=>ct(S,XA.NAVIGATION_ABORTED|XA.NAVIGATION_CANCELLED)?S:ct(S,XA.NAVIGATION_GUARD_REDIRECT)?(N(MA(m(S.to),{force:!0}),QA).then(k=>{ct(k,XA.NAVIGATION_ABORTED|XA.NAVIGATION_DUPLICATED)&&!AA.delta&&AA.type===_r.pop&&n.go(-1,!1)}).catch(zi),Promise.reject()):(AA.delta&&n.go(-AA.delta,!1),tA(S,QA,D))).then(S=>{S=S||L(QA,D,!1),S&&(AA.delta&&!ct(S,XA.NAVIGATION_CANCELLED)?n.go(-AA.delta,!1):AA.type===_r.pop&&ct(S,XA.NAVIGATION_ABORTED|XA.NAVIGATION_DUPLICATED)&&n.go(-1,!1)),b(QA,D,S)}).catch(zi)}))}let IA=Yi(),nA=Yi(),X;function tA(H,$,AA){Y(H);const QA=nA.list();return QA.length?QA.forEach(SA=>SA(H,$,AA)):console.error(H),Promise.reject(H)}function fA(){return X&&s.value!==Gt?Promise.resolve():new Promise((H,$)=>{IA.add([H,$])})}function Y(H){return X||(X=!H,dA(),IA.list().forEach(([$,AA])=>H?AA(H):$()),IA.reset()),H}function W(H,$,AA,QA){const{scrollBehavior:SA}=A;if(!ci||!SA)return Promise.resolve();const D=!AA&&rb(Ka(H.fullPath,0))||(QA||!AA)&&history.state&&history.state.scroll||null;return hn().then(()=>SA(H,$,D)).then(S=>S&&nb(S)).catch(S=>tA(S,H,$))}const z=H=>n.go(H);let DA;const NA=new Set,ne={currentRoute:s,listening:!0,addRoute:Q,removeRoute:h,clearRoutes:e.clearRoutes,hasRoute:u,getRoutes:f,resolve:E,options:A,push:d,replace:w,go:z,back:()=>z(-1),forward:()=>z(1),beforeEach:o.add,beforeResolve:r.add,afterEach:g.add,onError:nA.add,isReady:fA,install(H){H.component("RouterLink",Lb),H.component("RouterView",Jb),H.config.globalProperties.$router=ne,Object.defineProperty(H.config.globalProperties,"$route",{enumerable:!0,get:()=>BA(s)}),ci&&!DA&&s.value===Gt&&(DA=!0,d(n.location).catch(QA=>{}));const $={};for(const QA in Gt)Object.defineProperty($,QA,{get:()=>s.value[QA],enumerable:!0});H.provide(Sg,ne),H.provide($l,DI($)),H.provide(Or,s);const AA=H.unmount;NA.add(H),H.unmount=function(){NA.delete(H),NA.size<1&&(a=Gt,EA&&EA(),EA=null,s.value=Gt,DA=!1,X=!1),AA()}}};function LA(H){return H.reduce(($,AA)=>$.then(()=>K(AA)),Promise.resolve())}return ne}const Hb=[{path:"/",name:"Home",component:()=>Ul(()=>Promise.resolve().then(()=>DR),void 0,import.meta.url)}],Yb=Tb({history:ub("./"),routes:Hb}),_b=fu({legacy:!1,locale:ed(),fallbackLocale:"en",messages:Ad}),Rg=fc(GR);Rg.use(Yb);Rg.use(_b);Rg.mount("#app"); + */let Qb=()=>location.protocol+"//"+location.host;function AB(A,e){const{pathname:t,search:i,hash:n}=e,o=A.indexOf("#");if(o>-1){let r=n.includes(A.slice(o))?A.slice(o).length:1,g=n.slice(r);return g[0]!=="/"&&(g="/"+g),Ya(g,"")}return Ya(t,A)+i+n}function cb(A,e,t,i){let n=[],o=[],r=null;const g=({state:C})=>{const Q=AB(A,location),h=t.value,f=e.value;let u=0;if(C){if(t.value=Q,e.value=C,r&&r===h){r=null;return}u=f?C.position-f.position:0}else i(Q);n.forEach(E=>{E(t.value,h,{delta:u,type:_r.pop,direction:u?u>0?gr.forward:gr.back:gr.unknown})})};function s(){r=t.value}function a(C){n.push(C);const Q=()=>{const h=n.indexOf(C);h>-1&&n.splice(h,1)};return o.push(Q),Q}function I(){if(document.visibilityState==="hidden"){const{history:C}=window;if(!C.state)return;C.replaceState(MA({},C.state,{scroll:Uo()}),"")}}function l(){for(const C of o)C();o=[],window.removeEventListener("popstate",g),window.removeEventListener("pagehide",I),document.removeEventListener("visibilitychange",I)}return window.addEventListener("popstate",g),window.addEventListener("pagehide",I),document.addEventListener("visibilitychange",I),{pauseListeners:s,listen:a,destroy:l}}function Va(A,e,t,i=!1,n=!1){return{back:A,current:e,forward:t,replaced:i,position:window.history.length,scroll:n?Uo():null}}function Eb(A){const{history:e,location:t}=window,i={value:AB(A,t)},n={value:e.state};n.value||o(i.value,{back:null,current:i.value,forward:null,position:e.length-1,replaced:!0,scroll:null},!0);function o(s,a,I){const l=A.indexOf("#"),C=l>-1?(t.host&&document.querySelector("base")?A:A.slice(l))+s:Qb()+A+s;try{e[I?"replaceState":"pushState"](a,"",C),n.value=a}catch(Q){console.error(Q),t[I?"replace":"assign"](C)}}function r(s,a){o(s,MA({},e.state,Va(n.value.back,s,n.value.forward,!0),a,{position:n.value.position}),!0),i.value=s}function g(s,a){const I=MA({},n.value,e.state,{forward:s,scroll:Uo()});o(I.current,I,!0),o(s,MA({},Va(i.value,s,null),{position:I.position+1},a),!1),i.value=s}return{location:i,state:n,push:g,replace:r}}function ub(A){A=Ab(A);const e=Eb(A),t=cb(A,e.state,e.location,e.replace);function i(o,r=!0){r||t.pauseListeners(),history.go(o)}const n=MA({location:"",base:A,go:i,createHref:tb.bind(null,A)},e,t);return Object.defineProperty(n,"location",{enumerable:!0,get:()=>e.location.value}),Object.defineProperty(n,"state",{enumerable:!0,get:()=>e.state.value}),n}let oi=function(A){return A[A.Static=0]="Static",A[A.Param=1]="Param",A[A.Group=2]="Group",A}({});var oe=function(A){return A[A.Static=0]="Static",A[A.Param=1]="Param",A[A.ParamRegExp=2]="ParamRegExp",A[A.ParamRegExpEnd=3]="ParamRegExpEnd",A[A.EscapeNext=4]="EscapeNext",A}(oe||{});const hb={type:oi.Static,value:""},fb=/[a-zA-Z0-9_]/;function db(A){if(!A)return[[]];if(A==="/")return[[hb]];if(!A.startsWith("/"))throw new Error(`Invalid path "${A}"`);function e(Q){throw new Error(`ERR (${t})/"${a}": ${Q}`)}let t=oe.Static,i=t;const n=[];let o;function r(){o&&n.push(o),o=[]}let g=0,s,a="",I="";function l(){a&&(t===oe.Static?o.push({type:oi.Static,value:a}):t===oe.Param||t===oe.ParamRegExp||t===oe.ParamRegExpEnd?(o.length>1&&(s==="*"||s==="+")&&e(`A repeatable param (${a}) must be alone in its segment. eg: '/:ids+.`),o.push({type:oi.Param,value:a,regexp:I,repeatable:s==="*"||s==="+",optional:s==="*"||s==="?"})):e("Invalid state to consume buffer"),a="")}function C(){a+=s}for(;ge.length?e.length===1&&e[0]===pe.Static+pe.Segment?1:-1:0}function eB(A,e){let t=0;const i=A.score,n=e.score;for(;t0&&e[e.length-1]<0}const Db={strict:!1,end:!0,sensitive:!1};function kb(A,e,t){const i=yb(db(A.path),t),n=MA(i,{record:A,parent:e,children:[],alias:[]});return e&&!n.record.aliasOf==!e.record.aliasOf&&e.children.push(n),n}function vb(A,e){const t=[],i=new Map;e=Ha(Db,e);function n(l){return i.get(l)}function o(l,C,Q){const h=!Q,f=Za(l);f.aliasOf=Q&&Q.record;const u=Ha(e,l),E=[f];if("alias"in l){const d=typeof l.alias=="string"?[l.alias]:l.alias;for(const p of d)E.push(Za(MA({},f,{components:Q?Q.record.components:f.components,path:p,aliasOf:Q?Q.record:f})))}let D,c;for(const d of E){const{path:p}=d;if(C&&p[0]!=="/"){const v=C.record.path,N=v[v.length-1]==="/"?"":"/";d.path=C.record.path+(p&&N+p)}if(D=kb(d,C,u),Q?Q.alias.push(D):(c=c||D,c!==D&&c.alias.push(D),h&&l.name&&!Xa(D)&&r(l.name)),tB(D)&&s(D),f.children){const v=f.children;for(let N=0;N{r(c)}:zi}function r(l){if(Xl(l)){const C=i.get(l);C&&(i.delete(l),t.splice(t.indexOf(C),1),C.children.forEach(r),C.alias.forEach(r))}else{const C=t.indexOf(l);C>-1&&(t.splice(C,1),l.record.name&&i.delete(l.record.name),l.children.forEach(r),l.alias.forEach(r))}}function g(){return t}function s(l){const C=Rb(l,t);t.splice(C,0,l),l.record.name&&!Xa(l)&&i.set(l.record.name,l)}function a(l,C){let Q,h={},f,u;if("name"in l&&l.name){if(Q=i.get(l.name),!Q)throw Ni(XA.MATCHER_NOT_FOUND,{location:l});u=Q.record.name,h=MA(ja(C.params,Q.keys.filter(c=>!c.optional).concat(Q.parent?Q.parent.keys.filter(c=>c.optional):[]).map(c=>c.name)),l.params&&ja(l.params,Q.keys.map(c=>c.name))),f=Q.stringify(h)}else if(l.path!=null)f=l.path,Q=t.find(c=>c.re.test(f)),Q&&(h=Q.parse(f),u=Q.record.name);else{if(Q=C.name?i.get(C.name):t.find(c=>c.re.test(C.path)),!Q)throw Ni(XA.MATCHER_NOT_FOUND,{location:l,currentLocation:C});u=Q.record.name,h=MA({},C.params,l.params),f=Q.stringify(h)}const E=[];let D=Q;for(;D;)E.unshift(D.record),D=D.parent;return{name:u,path:f,params:h,matched:E,meta:Sb(E)}}A.forEach(l=>o(l));function I(){t.length=0,i.clear()}return{addRoute:o,resolve:a,removeRoute:r,clearRoutes:I,getRoutes:g,getRecordMatcher:n}}function ja(A,e){const t={};for(const i of e)i in A&&(t[i]=A[i]);return t}function Za(A){const e={path:A.path,redirect:A.redirect,name:A.name,meta:A.meta||{},aliasOf:A.aliasOf,beforeEnter:A.beforeEnter,props:Fb(A),children:A.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in A?A.components||null:A.component&&{default:A.component}};return Object.defineProperty(e,"mods",{value:{}}),e}function Fb(A){const e={},t=A.props||!1;if("component"in A)e.default=t;else for(const i in A.components)e[i]=typeof t=="object"?t[i]:t;return e}function Xa(A){for(;A;){if(A.record.aliasOf)return!0;A=A.parent}return!1}function Sb(A){return A.reduce((e,t)=>MA(e,t.meta),{})}function Rb(A,e){let t=0,i=e.length;for(;t!==i;){const o=t+i>>1;eB(A,e[o])<0?i=o:t=o+1}const n=bb(A);return n&&(i=e.lastIndexOf(n,i-1)),i}function bb(A){let e=A;for(;e=e.parent;)if(tB(e)&&eB(A,e)===0)return e}function tB({record:A}){return!!(A.name||A.components&&Object.keys(A.components).length||A.redirect)}function za(A){const e=rt(Sg),t=rt($l),i=hA(()=>{const s=BA(A.to);return e.resolve(s)}),n=hA(()=>{const{matched:s}=i.value,{length:a}=s,I=s[a-1],l=t.matched;if(!I||!l.length)return-1;const C=l.findIndex(bi.bind(null,I));if(C>-1)return C;const Q=$a(s[a-2]);return a>1&&$a(I)===Q&&l[l.length-1].path!==Q?l.findIndex(bi.bind(null,s[a-2])):C}),o=hA(()=>n.value>-1&&Mb(t.params,i.value.params)),r=hA(()=>n.value>-1&&n.value===t.matched.length-1&&Zl(t.params,i.value.params));function g(s={}){if(Ub(s)){const a=e[BA(A.replace)?"replace":"push"](BA(A.to)).catch(zi);return A.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>a),a}return Promise.resolve()}return{route:i,href:hA(()=>i.value.href),isActive:o,isExactActive:r,navigate:g}}function Nb(A){return A.length===1?A[0]:A}const Gb=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:za,setup(A,{slots:e}){const t=po(za(A)),{options:i}=rt(Sg),n=hA(()=>({[AI(A.activeClass,i.linkActiveClass,"router-link-active")]:t.isActive,[AI(A.exactActiveClass,i.linkExactActiveClass,"router-link-exact-active")]:t.isExactActive}));return()=>{const o=e.default&&Nb(e.default(t));return A.custom?o:GA("a",{"aria-current":t.isExactActive?A.ariaCurrentValue:null,href:t.href,onClick:t.navigate,class:n.value},o)}}}),Lb=Gb;function Ub(A){if(!(A.metaKey||A.altKey||A.ctrlKey||A.shiftKey)&&!A.defaultPrevented&&!(A.button!==void 0&&A.button!==0)){if(A.currentTarget&&A.currentTarget.getAttribute){const e=A.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(e))return}return A.preventDefault&&A.preventDefault(),!0}}function Mb(A,e){for(const t in e){const i=e[t],n=A[t];if(typeof i=="string"){if(i!==n)return!1}else if(!qe(n)||n.length!==i.length||i.some((o,r)=>o.valueOf()!==n[r].valueOf()))return!1}return!0}function $a(A){return A?A.aliasOf?A.aliasOf.path:A.path:""}const AI=(A,e,t)=>A??e??t,xb=fn({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(A,{attrs:e,slots:t}){const i=rt(Or),n=hA(()=>A.route||i.value),o=rt(Pa,0),r=hA(()=>{let a=BA(o);const{matched:I}=n.value;let l;for(;(l=I[a])&&!l.components;)a++;return a}),g=hA(()=>n.value.matched[r.value]);Hn(Pa,hA(()=>r.value+1)),Hn(lb,g),Hn(Or,n);const s=EA();return ae(()=>[s.value,g.value,A.name],([a,I,l],[C,Q,h])=>{I&&(I.instances[l]=a,Q&&Q!==I&&a&&a===C&&(I.leaveGuards.size||(I.leaveGuards=Q.leaveGuards),I.updateGuards.size||(I.updateGuards=Q.updateGuards))),a&&I&&(!Q||!bi(I,Q)||!C)&&(I.enterCallbacks[l]||[]).forEach(f=>f(a))},{flush:"post"}),()=>{const a=n.value,I=A.name,l=g.value,C=l&&l.components[I];if(!C)return eI(t.default,{Component:C,route:a});const Q=l.props[I],h=Q?Q===!0?a.params:typeof Q=="function"?Q(a):Q:null,u=GA(C,MA({},h,e,{onVnodeUnmounted:E=>{E.component.isUnmounted&&(l.instances[I]=null)},ref:s}));return eI(t.default,{Component:u,route:a})||u}}});function eI(A,e){if(!A)return null;const t=A(e);return t.length===1?t[0]:t}const Jb=xb;function Tb(A){const e=vb(A.routes,A),t=A.parseQuery||Ib,i=A.stringifyQuery||Oa,n=A.history,o=Yi(),r=Yi(),g=Yi(),s=tg(Gt);let a=Gt;ci&&A.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const I=or.bind(null,H=>""+H),l=or.bind(null,WR),C=or.bind(null,cn);function Q(H,$){let AA,cA;return Xl(H)?(AA=e.getRecordMatcher(H),cA=$):cA=H,e.addRoute(cA,AA)}function h(H){const $=e.getRecordMatcher(H);$&&e.removeRoute($)}function f(){return e.getRoutes().map(H=>H.record)}function u(H){return!!e.getRecordMatcher(H)}function E(H,$){if($=MA({},$||s.value),typeof H=="string"){const k=rr(t,H,$.path),x=e.resolve({path:k.path},$),q=n.createHref(k.fullPath);return MA(k,x,{params:C(x.params),hash:cn(k.hash),redirectedFrom:void 0,href:q})}let AA;if(H.path!=null)AA=MA({},H,{path:rr(t,H.path,$.path).path});else{const k=MA({},H.params);for(const x in k)k[x]==null&&delete k[x];AA=MA({},H,{params:l(k)}),$.params=l($.params)}const cA=e.resolve(AA,$),SA=H.hash||"";cA.params=I(C(cA.params));const w=ZR(i,MA({},H,{hash:OR(SA),path:cA.path})),R=n.createHref(w);return MA({fullPath:w,hash:SA,query:i===Oa?Cb(H.query):H.query||{}},cA,{redirectedFrom:void 0,href:R})}function D(H){return typeof H=="string"?rr(t,H,s.value.path):MA({},H)}function c(H,$){if(a!==H)return Ni(XA.NAVIGATION_CANCELLED,{from:$,to:H})}function d(H){return N(H)}function p(H){return d(MA(D(H),{replace:!0}))}function v(H,$){const AA=H.matched[H.matched.length-1];if(AA&&AA.redirect){const{redirect:cA}=AA;let SA=typeof cA=="function"?cA(H,$):cA;return typeof SA=="string"&&(SA=SA.includes("?")||SA.includes("#")?SA=D(SA):{path:SA},SA.params={}),MA({query:H.query,hash:H.hash,params:SA.path!=null?{}:H.params},SA)}}function N(H,$){const AA=a=E(H),cA=s.value,SA=H.state,w=H.force,R=H.replace===!0,k=v(AA,cA);if(k)return N(MA(D(k),{state:typeof k=="object"?MA({},SA,k.state):SA,force:w,replace:R}),$||AA);const x=AA;x.redirectedFrom=$;let q;return!w&&XR(i,cA,AA)&&(q=Ni(XA.NAVIGATION_DUPLICATED,{to:x,from:cA}),W(cA,cA,!0,!1)),(q?Promise.resolve(q):S(x,cA)).catch(V=>ct(V)?ct(V,XA.NAVIGATION_GUARD_REDIRECT)?V:Y(V):tA(V,x,cA)).then(V=>{if(V){if(ct(V,XA.NAVIGATION_GUARD_REDIRECT))return N(MA({replace:R},D(V.to),{state:typeof V.to=="object"?MA({},SA,V.to.state):SA,force:w}),$||x)}else V=L(x,cA,!0,R,SA);return b(x,cA,V),V})}function G(H,$){const AA=c(H,$);return AA?Promise.reject(AA):Promise.resolve()}function _(H){const $=NA.values().next().value;return $&&typeof $.runWithContext=="function"?$.runWithContext(H):H()}function S(H,$){let AA;const[cA,SA,w]=Bb(H,$);AA=sr(cA.reverse(),"beforeRouteLeave",H,$);for(const k of cA)k.leaveGuards.forEach(x=>{AA.push(Tt(x,H,$))});const R=G.bind(null,H,$);return AA.push(R),LA(AA).then(()=>{AA=[];for(const k of o.list())AA.push(Tt(k,H,$));return AA.push(R),LA(AA)}).then(()=>{AA=sr(SA,"beforeRouteUpdate",H,$);for(const k of SA)k.updateGuards.forEach(x=>{AA.push(Tt(x,H,$))});return AA.push(R),LA(AA)}).then(()=>{AA=[];for(const k of w)if(k.beforeEnter)if(qe(k.beforeEnter))for(const x of k.beforeEnter)AA.push(Tt(x,H,$));else AA.push(Tt(k.beforeEnter,H,$));return AA.push(R),LA(AA)}).then(()=>(H.matched.forEach(k=>k.enterCallbacks={}),AA=sr(w,"beforeRouteEnter",H,$,_),AA.push(R),LA(AA))).then(()=>{AA=[];for(const k of r.list())AA.push(Tt(k,H,$));return AA.push(R),LA(AA)}).catch(k=>ct(k,XA.NAVIGATION_CANCELLED)?k:Promise.reject(k))}function b(H,$,AA){g.list().forEach(cA=>_(()=>cA(H,$,AA)))}function L(H,$,AA,cA,SA){const w=c(H,$);if(w)return w;const R=$===Gt,k=ci?history.state:{};AA&&(cA||R?n.replace(H.fullPath,MA({scroll:R&&k&&k.scroll},SA)):n.push(H.fullPath,SA)),s.value=H,W(H,$,AA,R),Y()}let QA;function dA(){QA||(QA=n.listen((H,$,AA)=>{if(!ne.listening)return;const cA=E(H),SA=v(cA,ne.currentRoute.value);if(SA){N(MA(SA,{replace:!0,force:!0}),cA).catch(zi);return}a=cA;const w=s.value;ci&&ob(Ka(w.fullPath,AA.delta),Uo()),S(cA,w).catch(R=>ct(R,XA.NAVIGATION_ABORTED|XA.NAVIGATION_CANCELLED)?R:ct(R,XA.NAVIGATION_GUARD_REDIRECT)?(N(MA(D(R.to),{force:!0}),cA).then(k=>{ct(k,XA.NAVIGATION_ABORTED|XA.NAVIGATION_DUPLICATED)&&!AA.delta&&AA.type===_r.pop&&n.go(-1,!1)}).catch(zi),Promise.reject()):(AA.delta&&n.go(-AA.delta,!1),tA(R,cA,w))).then(R=>{R=R||L(cA,w,!1),R&&(AA.delta&&!ct(R,XA.NAVIGATION_CANCELLED)?n.go(-AA.delta,!1):AA.type===_r.pop&&ct(R,XA.NAVIGATION_ABORTED|XA.NAVIGATION_DUPLICATED)&&n.go(-1,!1)),b(cA,w,R)}).catch(zi)}))}let IA=Yi(),nA=Yi(),X;function tA(H,$,AA){Y(H);const cA=nA.list();return cA.length?cA.forEach(SA=>SA(H,$,AA)):console.error(H),Promise.reject(H)}function fA(){return X&&s.value!==Gt?Promise.resolve():new Promise((H,$)=>{IA.add([H,$])})}function Y(H){return X||(X=!H,dA(),IA.list().forEach(([$,AA])=>H?AA(H):$()),IA.reset()),H}function W(H,$,AA,cA){const{scrollBehavior:SA}=A;if(!ci||!SA)return Promise.resolve();const w=!AA&&rb(Ka(H.fullPath,0))||(cA||!AA)&&history.state&&history.state.scroll||null;return hn().then(()=>SA(H,$,w)).then(R=>R&&nb(R)).catch(R=>tA(R,H,$))}const z=H=>n.go(H);let DA;const NA=new Set,ne={currentRoute:s,listening:!0,addRoute:Q,removeRoute:h,clearRoutes:e.clearRoutes,hasRoute:u,getRoutes:f,resolve:E,options:A,push:d,replace:p,go:z,back:()=>z(-1),forward:()=>z(1),beforeEach:o.add,beforeResolve:r.add,afterEach:g.add,onError:nA.add,isReady:fA,install(H){H.component("RouterLink",Lb),H.component("RouterView",Jb),H.config.globalProperties.$router=ne,Object.defineProperty(H.config.globalProperties,"$route",{enumerable:!0,get:()=>BA(s)}),ci&&!DA&&s.value===Gt&&(DA=!0,d(n.location).catch(cA=>{}));const $={};for(const cA in Gt)Object.defineProperty($,cA,{get:()=>s.value[cA],enumerable:!0});H.provide(Sg,ne),H.provide($l,DI($)),H.provide(Or,s);const AA=H.unmount;NA.add(H),H.unmount=function(){NA.delete(H),NA.size<1&&(a=Gt,QA&&QA(),QA=null,s.value=Gt,DA=!1,X=!1),AA()}}};function LA(H){return H.reduce(($,AA)=>$.then(()=>_(AA)),Promise.resolve())}return ne}const Hb=[{path:"/",name:"Home",component:()=>Ul(()=>Promise.resolve().then(()=>DR),void 0,import.meta.url)}],Yb=Tb({history:ub("./"),routes:Hb}),_b=fu({legacy:!1,locale:ed(),fallbackLocale:"en",messages:Ad}),Rg=fc(GR);Rg.use(Yb);Rg.use(_b);Rg.mount("#app"); diff --git a/main/manager-web/public/generator/index.html b/main/manager-web/public/generator/index.html index 77166600..65b5dd62 100644 --- a/main/manager-web/public/generator/index.html +++ b/main/manager-web/public/generator/index.html @@ -6,7 +6,7 @@ Xiaozhi AI Customization - +