(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))i(o);new MutationObserver(o=>{for(const n of o)if(n.type==="childList")for(const r of n.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&i(r)}).observe(document,{childList:!0,subtree:!0});function t(o){const n={};return o.integrity&&(n.integrity=o.integrity),o.referrerPolicy&&(n.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?n.credentials="include":o.crossOrigin==="anonymous"?n.credentials="omit":n.credentials="same-origin",n}function i(o){if(o.ep)return;o.ep=!0;const n=t(o);fetch(o.href,n)}})();/** * @vue/shared v3.5.26 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT **/function Vr(A){const e=Object.create(null);for(const t of A.split(","))e[t]=1;return t=>t in e}const _A={},fi=[],nt=()=>{},iI=()=>!1,Bn=A=>A.charCodeAt(0)===111&&A.charCodeAt(1)===110&&(A.charCodeAt(2)>122||A.charCodeAt(2)<97),Wr=A=>A.startsWith("onUpdate:"),ue=Object.assign,qr=(A,e)=>{const t=A.indexOf(e);t>-1&&A.splice(t,1)},oB=Object.prototype.hasOwnProperty,JA=(A,e)=>oB.call(A,e),yA=Array.isArray,hi=A=>co(A)==="[object Map]",Qn=A=>co(A)==="[object Set]",Lg=A=>co(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",oI=A=>(KA(A)||FA(A))&&FA(A.then)&&FA(A.catch),nI=Object.prototype.toString,co=A=>nI.call(A),nB=A=>co(A).slice(8,-1),rI=A=>co(A)==="[object Object]",jr=A=>ee(A)&&A!=="NaN"&&A[0]!=="-"&&""+parseInt(A,10)===A,Oi=Vr(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),cn=A=>{const e=Object.create(null);return t=>e[t]||(e[t]=A(t))},rB=/-\w/g,Je=cn(A=>A.replace(rB,e=>e.slice(1).toUpperCase())),gB=/\B([A-Z])/g,Ii=cn(A=>A.replace(gB,"-$1").toLowerCase()),En=cn(A=>A.charAt(0).toUpperCase()+A.slice(1)),xn=cn(A=>A?`on${En(A)}`:""),Yt=(A,e)=>!Object.is(A,e),To=(A,...e)=>{for(let t=0;t{Object.defineProperty(A,e,{configurable:!0,enumerable:!1,writable:i,value:t})},un=A=>{const e=parseFloat(A);return isNaN(e)?A:e};let Ug;const fn=()=>Ug||(Ug=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(aB);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;thn(t,e))}const aI=A=>!!(A&&A.__v_isRef===!0),F=A=>ee(A)?A:A==null?"":yA(A)||KA(A)&&(A.toString===nI||!FA(A.toString))?aI(A)?F(A.value):JSON.stringify(A,II,2):String(A),II=(A,e)=>aI(e)?II(A,e.value):hi(e)?{[`Map(${e.size})`]:[...e.entries()].reduce((t,[i,o],n)=>(t[Jn(i,n)+" =>"]=o,t),{})}:Qn(e)?{[`Set(${e.size})`]:[...e.values()].map(t=>Jn(t))}:It(e)?Jn(e):KA(e)&&!yA(e)&&!rI(e)?String(e):e,Jn=(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 ve;class CI{constructor(e=!1){this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=ve,!e&&ve&&(this.index=(ve.scopes||(ve.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&&(ve=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 cI(A){for(let e=A.deps;e;e=e.nextDep)e.version=-1,e.prevActiveLink=e.dep.activeLink,e.dep.activeLink=e}function EI(A){let e,t=A.depsTail,i=t;for(;i;){const o=i.prevDep;i.version===-1?(i===t&&(t=o),zr(i),fB(i)):e=i,i.dep.activeLink=i.prevActiveLink,i.prevActiveLink=void 0,i=o}A.deps=e,A.depsTail=t}function Ir(A){for(let e=A.deps;e;e=e.nextDep)if(e.dep.version!==e.version||e.dep.computed&&(uI(e.dep.computed)||e.dep.version!==e.version))return!0;return!!A._dirty}function uI(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||!Ir(A))))return;A.flags|=2;const e=A.dep,t=OA,i=_e;OA=A,_e=!0;try{cI(A);const o=A.fn(A._value);(e.version===0||Yt(o,A._value))&&(A.flags|=128,A._value=o,e.version++)}catch(o){throw e.version++,o}finally{OA=t,_e=i,EI(A),A.flags&=-3}}function zr(A,e=!1){const{dep:t,prevSub:i,nextSub:o}=A;if(i&&(i.nextSub=o,A.prevSub=void 0),o&&(o.prevSub=i,A.nextSub=void 0),t.subs===A&&(t.subs=i,!i&&t.computed)){t.computed.flags&=-5;for(let n=t.computed.deps;n;n=n.nextDep)zr(n,!0)}!e&&!--t.sc&&t.map&&t.map.delete(t.key)}function fB(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 fI=[];function wt(){fI.push(_e),_e=!1}function Dt(){const A=fI.pop();_e=A===void 0?!0:A}function Mg(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 $r{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){Zr();try{for(let t=this.subs;t;t=t.prevSub)t.sub.notify()&&t.sub.dep.notify()}finally{Xr()}}}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 Cr=new WeakMap,ri=Symbol(""),lr=Symbol(""),Ao=Symbol("");function ce(A,e,t){if(_e&&OA){let i=Cr.get(A);i||Cr.set(A,i=new Map);let o=i.get(t);o||(i.set(t,o=new $r),o.map=i,o.key=t),o.track()}}function ut(A,e,t,i,o,n){const r=Cr.get(A);if(!r){$i++;return}const g=s=>{s&&s.trigger()};if(Zr(),e==="clear")r.forEach(g);else{const s=yA(A),a=s&&jr(t);if(s&&t==="length"){const I=Number(i);r.forEach((l,C)=>{(C==="length"||C===Ao||!It(C)&&C>=I)&&g(l)})}else switch((t!==void 0||r.has(void 0))&&g(r.get(t)),a&&g(r.get(Ao)),e){case"add":s?a&&g(r.get("length")):(g(r.get(ri)),hi(A)&&g(r.get(lr)));break;case"delete":s||(g(r.get(ri)),hi(A)&&g(r.get(lr)));break;case"set":hi(A)&&g(r.get(ri));break}}Xr()}function li(A){const e=xA(A);return e===A?e:(ce(e,"iterate",Ao),xe(A)?e:e.map(Oe))}function dn(A){return ce(A=xA(A),"iterate",Ao),A}function Ut(A,e){return kt(A)?gi(A)?Di(Oe(e)):Di(e):Oe(e)}const dB={__proto__:null,[Symbol.iterator](){return Hn(this,Symbol.iterator,A=>Ut(this,A))},concat(...A){return li(this).concat(...A.map(e=>yA(e)?li(e):e))},entries(){return Hn(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 Yn(this,"includes",A)},indexOf(...A){return Yn(this,"indexOf",A)},join(A){return li(this).join(A)},lastIndexOf(...A){return Yn(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 xg(this,"reduce",A,e)},reduceRight(A,...e){return xg(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 li(this).toReversed()},toSorted(A){return li(this).toSorted(A)},toSpliced(...A){return li(this).toSpliced(...A)},unshift(...A){return Mi(this,"unshift",A)},values(){return Hn(this,"values",A=>Ut(this,A))}};function Hn(A,e,t){const i=dn(A),o=i[e]();return i!==A&&!xe(A)&&(o._next=o.next,o.next=()=>{const n=o._next();return n.done||(n.value=t(n.value)),n}),o}const pB=Array.prototype;function lt(A,e,t,i,o,n){const r=dn(A),g=r!==A&&!xe(A),s=r[e];if(s!==pB[e]){const l=s.apply(A,n);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&&o?o(I):I}function xg(A,e,t,i){const o=dn(A);let n=t;return o!==A&&(xe(A)?t.length>3&&(n=function(r,g,s){return t.call(this,r,g,s,A)}):n=function(r,g,s){return t.call(this,r,Ut(A,g),s,A)}),o[e](n,...i)}function Yn(A,e,t){const i=xA(A);ce(i,"iterate",Ao);const o=i[e](...t);return(o===-1||o===!1)&&tg(t[0])?(t[0]=xA(t[0]),i[e](...t)):o}function Mi(A,e,t=[]){wt(),Zr();const i=xA(A)[e].apply(A,t);return Xr(),Dt(),i}const mB=Vr("__proto__,__v_isRef,__isVue"),dI=new Set(Object.getOwnPropertyNames(Symbol).filter(A=>A!=="arguments"&&A!=="caller").map(A=>Symbol[A]).filter(It));function yB(A){It(A)||(A=String(A));const e=xA(this);return ce(e,"has",A),e.hasOwnProperty(A)}class pI{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,i){if(t==="__v_skip")return e.__v_skip;const o=this._isReadonly,n=this._isShallow;if(t==="__v_isReactive")return!o;if(t==="__v_isReadonly")return o;if(t==="__v_isShallow")return n;if(t==="__v_raw")return i===(o?n?GB:DI:n?wI:yI).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(i)?e:void 0;const r=yA(e);if(!o){let s;if(r&&(s=dB[t]))return s;if(t==="hasOwnProperty")return yB}const g=Reflect.get(e,t,le(e)?e:i);if((It(t)?dI.has(t):mB(t))||(o||ce(e,"get",t),n))return g;if(le(g)){const s=r&&jr(t)?g:g.value;return o&&KA(s)?Qr(s):s}return KA(g)?o?Qr(g):pn(g):g}}class mI extends pI{constructor(e=!1){super(!1,e)}set(e,t,i,o){let n=e[t];const r=yA(e)&&jr(t);if(!this._isShallow){const a=kt(n);if(!xe(i)&&!kt(i)&&(n=xA(n),i=xA(i)),!r&&le(n)&&!le(i))return a||(n.value=i),!0}const g=r?Number(t)A,vo=A=>Reflect.getPrototypeOf(A);function FB(A,e,t){return function(...i){const o=this.__v_raw,n=xA(o),r=hi(n),g=A==="entries"||A===Symbol.iterator&&r,s=A==="keys"&&r,a=o[A](...i),I=t?Br:e?Di:Oe;return!e&&ce(n,"iterate",s?lr: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 Fo(A){return function(...e){return A==="delete"?!1:A==="clear"?void 0:this}}function SB(A,e){const t={get(o){const n=this.__v_raw,r=xA(n),g=xA(o);A||(Yt(o,g)&&ce(r,"get",o),ce(r,"get",g));const{has:s}=vo(r),a=e?Br:A?Di:Oe;if(s.call(r,o))return a(n.get(o));if(s.call(r,g))return a(n.get(g));n!==r&&n.get(o)},get size(){const o=this.__v_raw;return!A&&ce(xA(o),"iterate",ri),o.size},has(o){const n=this.__v_raw,r=xA(n),g=xA(o);return A||(Yt(o,g)&&ce(r,"has",o),ce(r,"has",g)),o===g?n.has(o):n.has(o)||n.has(g)},forEach(o,n){const r=this,g=r.__v_raw,s=xA(g),a=e?Br:A?Di:Oe;return!A&&ce(s,"iterate",ri),g.forEach((I,l)=>o.call(n,a(I),a(l),r))}};return ue(t,A?{add:Fo("add"),set:Fo("set"),delete:Fo("delete"),clear:Fo("clear")}:{add(o){!e&&!xe(o)&&!kt(o)&&(o=xA(o));const n=xA(this);return vo(n).has.call(n,o)||(n.add(o),ut(n,"add",o,o)),this},set(o,n){!e&&!xe(n)&&!kt(n)&&(n=xA(n));const r=xA(this),{has:g,get:s}=vo(r);let a=g.call(r,o);a||(o=xA(o),a=g.call(r,o));const I=s.call(r,o);return r.set(o,n),a?Yt(n,I)&&ut(r,"set",o,n):ut(r,"add",o,n),this},delete(o){const n=xA(this),{has:r,get:g}=vo(n);let s=r.call(n,o);s||(o=xA(o),s=r.call(n,o)),g&&g.call(n,o);const a=n.delete(o);return s&&ut(n,"delete",o,void 0),a},clear(){const o=xA(this),n=o.size!==0,r=o.clear();return n&&ut(o,"clear",void 0,void 0),r}}),["keys","values","entries",Symbol.iterator].forEach(o=>{t[o]=FB(o,A,e)}),t}function Ag(A,e){const t=SB(A,e);return(i,o,n)=>o==="__v_isReactive"?!A:o==="__v_isReadonly"?A:o==="__v_raw"?i:Reflect.get(JA(t,o)&&o in i?t:i,o,n)}const RB={get:Ag(!1,!1)},bB={get:Ag(!1,!0)},NB={get:Ag(!0,!1)};const yI=new WeakMap,wI=new WeakMap,DI=new WeakMap,GB=new WeakMap;function LB(A){switch(A){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function UB(A){return A.__v_skip||!Object.isExtensible(A)?0:LB(nB(A))}function pn(A){return kt(A)?A:eg(A,!1,DB,RB,yI)}function kI(A){return eg(A,!1,vB,bB,wI)}function Qr(A){return eg(A,!0,kB,NB,DI)}function eg(A,e,t,i,o){if(!KA(A)||A.__v_raw&&!(e&&A.__v_isReactive))return A;const n=UB(A);if(n===0)return A;const r=o.get(A);if(r)return r;const g=new Proxy(A,n===2?i:t);return o.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 tg(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)&&gI(A,"__v_skip",!0),A}const Oe=A=>KA(A)?pn(A):A,Di=A=>KA(A)?Qr(A):A;function le(A){return A?A.__v_isRef===!0:!1}function uA(A){return vI(A,!1)}function ig(A){return vI(A,!0)}function vI(A,e){return le(A)?A:new MB(A,e)}class MB{constructor(e,t){this.dep=new $r,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 cA(A){return le(A)?A.value:A}const xB={get:(A,e,t)=>e==="__v_raw"?A:cA(Reflect.get(A,e,t)),set:(A,e,t,i)=>{const o=A[e];return le(o)&&!le(t)?(o.value=t,!0):Reflect.set(A,e,t,i)}};function FI(A){return gi(A)?A:new Proxy(A,xB)}class JB{constructor(e,t,i){this.fn=e,this.setter=t,this._value=void 0,this.dep=new $r(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 QI(this,!0),!0}get value(){const e=this.dep.track();return uI(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}}function TB(A,e,t=!1){let i,o;return FA(A)?i=A:(i=A.get,o=A.set),new JB(i,o,t)}const So={},qo=new WeakMap;let ei;function HB(A,e=!1,t=ei){if(t){let i=qo.get(t);i||qo.set(t,i=[]),i.push(A)}}function YB(A,e,t=_A){const{immediate:i,deep:o,once:n,scheduler:r,augmentJob:g,call:s}=t,a=p=>o?p:xe(p)||o===!1||o===0?ft(p,1):ft(p);let I,l,C,Q,f=!1,h=!1;if(le(A)?(l=()=>A.value,f=xe(A)):gi(A)?(l=()=>a(A),f=!0):yA(A)?(h=!0,f=A.some(p=>gi(p)||xe(p)),l=()=>A.map(p=>{if(le(p))return p.value;if(gi(p))return a(p);if(FA(p))return s?s(p,2):p()})):FA(A)?e?l=s?()=>s(A,2):A:l=()=>{if(C){wt();try{C()}finally{Dt()}}const p=ei;ei=I;try{return s?s(A,3,[Q]):A(Q)}finally{ei=p}}:l=nt,e&&o){const p=l,d=o===!0?1/0:o;l=()=>ft(p(),d)}const u=uB(),E=()=>{I.stop(),u&&u.active&&qr(u.effects,I)};if(n&&e){const p=e;e=(...d)=>{p(...d),E()}}let D=h?new Array(A.length).fill(So):So;const c=p=>{if(!(!(I.flags&1)||!I.dirty&&!p))if(e){const d=I.run();if(o||f||(h?d.some((v,b)=>Yt(v,D[b])):Yt(d,D))){C&&C();const v=ei;ei=I;try{const b=[d,D===So?void 0:h&&D[0]===So?[]:D,Q];D=d,s?s(e,3,b):e(...b)}finally{ei=v}}}else I.run()};return g&&g(c),I=new lI(l),I.scheduler=r?()=>r(c,!1):c,Q=p=>HB(p,!1,I),C=I.onStop=()=>{const p=qo.get(I);if(p){if(s)s(p,4);else for(const d of p)d();qo.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 ft(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))ft(A.value,e,t);else if(yA(A))for(let i=0;i{ft(i,e,t)});else if(rI(A)){for(const i in A)ft(A[i],e,t);for(const i of Object.getOwnPropertySymbols(A))Object.prototype.propertyIsEnumerable.call(A,i)&&ft(A[i],e,t)}return A}/** * @vue/runtime-core v3.5.26 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT **/function Eo(A,e,t,i){try{return i?A(...i):A()}catch(o){mn(o,e,t)}}function Ct(A,e,t,i){if(FA(A)){const o=Eo(A,e,t,i);return o&&oI(o)&&o.catch(n=>{mn(n,e,t)}),o}if(yA(A)){const o=[];for(let n=0;n>>1,o=me[i],n=eo(o);n=eo(t)?me.push(A):me.splice(KB(e),0,A),A.flags|=1,RI()}}function RI(){jo||(jo=SI.then(NI))}function OB(A){yA(A)?di.push(...A):Mt&&A.id===-1?Mt.splice(Qi+1,0,A):A.flags&1||(di.push(A),A.flags|=1),RI()}function Jg(A,e,t=At+1){for(;teo(t)-eo(i));if(di.length=0,Mt){Mt.push(...e);return}for(Mt=e,Qi=0;QiA.id==null?A.flags&2?-1:1/0:A.id;function NI(A){try{for(At=0;At{i._d&&$o(-1);const n=Zo(e);let r;try{r=A(...o)}finally{Zo(n),i._d&&$o(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=kn(Re),i=A.dirs||(A.dirs=[]);for(let o=0;o1)return t&&FA(e)?e.call(i&&i.proxy):e}}const VB=Symbol.for("v-scx"),WB=()=>rt(VB);function ae(A,e,t){return LI(A,e,t)}function LI(A,e,t=_A){const{immediate:i,deep:o,flush:n,once:r}=t,g=ue({},t),s=e&&i||!e&&n!=="post";let a;if(io){if(n==="sync"){const Q=WB();a=Q.__watcherHandles||(Q.__watcherHandles=[])}else if(!s){const Q=()=>{};return Q.stop=nt,Q.resume=nt,Q.pause=nt,Q}}const I=Ee;g.call=(Q,f,h)=>Ct(Q,I,f,h);let l=!1;n==="post"?g.scheduler=Q=>{Se(Q,I&&I.suspense)}:n!=="sync"&&(l=!0,g.scheduler=(Q,f)=>{f?Q():og(Q)}),g.augmentJob=Q=>{e&&(Q.flags|=4),l&&(Q.flags|=2,I&&(Q.id=I.uid,Q.i=I))};const C=YB(A,e,g);return io&&(a?a.push(C):s&&C()),C}function qB(A,e,t){const i=this.proxy,o=ee(A)?A.includes(".")?UI(i,A):()=>i[A]:A.bind(i,i);let n;FA(e)?n=e:(n=e.handler,t=e);const r=po(this),g=LI(o,n.bind(i),t);return r(),g}function UI(A,e){const t=e.split(".");return()=>{let i=A;for(let o=0;oA.__isTeleport,XB=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 fo(A,e){return FA(A)?ue({name:A.name},e,{setup:A}):A}function MI(A){A.ids=[A.ids[0]+A.ids[2]+++"-",0,0]}const Xo=new WeakMap;function Wi(A,e,t,i,o=!1){if(yA(A)){A.forEach((f,h)=>Wi(f,e&&(yA(e)?e[h]:e),t,i,o));return}if(qi(i)&&!o){i.shapeFlag&512&&i.type.__asyncResolved&&i.component.subTree.component&&Wi(A,e,t,i.component.subTree);return}const n=i.shapeFlag&4?kn(i.component):i.el,r=o?null:n,{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?iI:f=>JA(C,f);if(a!=null&&a!==s){if(Tg(e),ee(a))I[a]=null,Q(a)&&(l[a]=null);else if(le(a)){a.value=null;const f=e;f.k&&(I[f.k]=null)}}if(FA(s))Eo(s,g,12,[r,I]);else{const f=ee(s),h=le(s);if(f||h){const u=()=>{if(A.f){const E=f?Q(s)?l[s]:I[s]:s.value;if(o)yA(E)&&qr(E,n);else if(yA(E))E.includes(n)||E.push(n);else if(f)I[s]=[n],Q(s)&&(l[s]=I[s]);else{const D=[n];s.value=D,A.k&&(I[A.k]=D)}}else f?(I[s]=r,Q(s)&&(l[s]=r)):h&&(s.value=r,A.k&&(I[A.k]=r))};if(r){const E=()=>{u(),Xo.delete(A)};E.id=-1,Xo.set(A,E),Se(E,t)}else Tg(A),u()}}}function Tg(A){const e=Xo.get(A);e&&(e.flags|=8,Xo.delete(A))}fn().requestIdleCallback;fn().cancelIdleCallback;const qi=A=>!!A.type.__asyncLoader,xI=A=>A.type.__isKeepAlive;function zB(A,e){JI(A,"a",e)}function $B(A,e){JI(A,"da",e)}function JI(A,e,t=Ee){const i=A.__wdc||(A.__wdc=()=>{let o=t;for(;o;){if(o.isDeactivated)return;o=o.parent}return A()});if(yn(e,i,t),t){let o=t.parent;for(;o&&o.parent;)xI(o.parent.vnode)&&AQ(i,e,t,o),o=o.parent}}function AQ(A,e,t,i){const o=yn(e,A,i,!0);Ci(()=>{qr(i[e],o)},t)}function yn(A,e,t=Ee,i=!1){if(t){const o=t[A]||(t[A]=[]),n=e.__weh||(e.__weh=(...r)=>{wt();const g=po(t),s=Ct(e,t,A,r);return g(),Dt(),s});return i?o.unshift(n):o.push(n),n}}const vt=A=>(e,t=Ee)=>{(!io||A==="sp")&&yn(A,(...i)=>e(...i),t)},TI=vt("bm"),Ft=vt("m"),eQ=vt("bu"),tQ=vt("u"),iQ=vt("bum"),Ci=vt("um"),oQ=vt("sp"),nQ=vt("rtg"),rQ=vt("rtc");function gQ(A,e=Ee){yn("ec",A,e)}const sQ="components",HI=Symbol.for("v-ndc");function YI(A){return ee(A)?aQ(sQ,A,!1)||A:A||HI}function aQ(A,e,t=!0,i=!1){const o=Re||Ee;if(o){const n=o.type;{const g=WQ(n,!1);if(g&&(g===e||g===Je(e)||g===En(Je(e))))return n}const r=Hg(o[A]||n[A],e)||Hg(o.appContext[A],e);return!r&&i?n:r}}function Hg(A,e){return A&&(A[e]||A[Je(e)]||A[En(Je(e))])}function Ke(A,e,t,i){let o;const n=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=dn(A)),o=new Array(A.length);for(let I=0,l=A.length;Ie(g,s,void 0,n));else{const g=Object.keys(A);o=new Array(g.length);for(let s=0,a=g.length;sA?rC(A)?kn(A):cr(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=>cr(A.parent),$root:A=>cr(A.root),$host:A=>A.ce,$emit:A=>A.emit,$options:A=>KI(A),$forceUpdate:A=>A.f||(A.f=()=>{og(A.update)}),$nextTick:A=>A.n||(A.n=uo.bind(A.proxy)),$watch:A=>qB.bind(A)}),_n=(A,e)=>A!==_A&&!A.__isScriptSetup&&JA(A,e),IQ={get({_:A},e){if(e==="__v_skip")return!0;const{ctx:t,setupState:i,data:o,props:n,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 o[e];case 4:return t[e];case 3:return n[e]}else{if(_n(i,e))return r[e]=1,i[e];if(o!==_A&&JA(o,e))return r[e]=2,o[e];if(JA(n,e))return r[e]=3,n[e];if(t!==_A&&JA(t,e))return r[e]=4,t[e];Er&&(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:o,ctx:n}=A;return _n(o,e)?(o[e]=t,!0):i!==_A&&JA(i,e)?(i[e]=t,!0):JA(A.props,e)||e[0]==="$"&&e.slice(1)in A?!1:(n[e]=t,!0)},has({_:{data:A,setupState:e,accessCache:t,ctx:i,appContext:o,props:n,type:r}},g){let s;return!!(t[g]||A!==_A&&g[0]!=="$"&&JA(A,g)||_n(e,g)||JA(n,g)||JA(i,g)||JA(ji,g)||JA(o.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 Yg(A){return yA(A)?A.reduce((e,t)=>(e[t]=null,e),{}):A}let Er=!0;function CQ(A){const e=KI(A),t=A.proxy,i=A.ctx;Er=!1,e.beforeCreate&&_g(e.beforeCreate,A,"bc");const{data:o,computed:n,methods:r,watch:g,provide:s,inject:a,created:I,beforeMount:l,mounted:C,beforeUpdate:Q,updated:f,activated:h,deactivated:u,beforeDestroy:E,beforeUnmount:D,destroyed:c,unmounted:p,render:d,renderTracked:v,renderTriggered:b,errorCaptured:N,serverPrefetch:H,expose:M,inheritAttrs:U,components:R,directives:j,filters:rA}=e;if(a&&lQ(a,i,null),r)for(const z in r){const oA=r[z];FA(oA)&&(i[z]=oA.bind(t))}if(o){const z=o.call(t,t);KA(z)&&(A.data=pn(z))}if(Er=!0,n)for(const z in n){const oA=n[z],dA=FA(oA)?oA.bind(t,t):FA(oA.get)?oA.get.bind(t,t):nt,Y=!FA(oA)&&FA(oA.set)?oA.set.bind(t):nt,W=hA({get:dA,set:Y});Object.defineProperty(i,z,{enumerable:!0,configurable:!0,get:()=>W.value,set:$=>W.value=$})}if(g)for(const z in g)_I(g[z],i,t,z);if(s){const z=FA(s)?s.call(t):s;Reflect.ownKeys(z).forEach(oA=>{Ho(oA,z[oA])})}I&&_g(I,A,"c");function AA(z,oA){yA(oA)?oA.forEach(dA=>z(dA.bind(t))):oA&&z(oA.bind(t))}if(AA(TI,l),AA(Ft,C),AA(eQ,Q),AA(tQ,f),AA(zB,h),AA($B,u),AA(gQ,N),AA(rQ,v),AA(nQ,b),AA(iQ,D),AA(Ci,p),AA(oQ,H),yA(M))if(M.length){const z=A.exposed||(A.exposed={});M.forEach(oA=>{Object.defineProperty(z,oA,{get:()=>t[oA],set:dA=>t[oA]=dA,enumerable:!0})})}else A.exposed||(A.exposed={});d&&A.render===nt&&(A.render=d),U!=null&&(A.inheritAttrs=U),R&&(A.components=R),j&&(A.directives=j),H&&MI(A)}function lQ(A,e,t=nt){yA(A)&&(A=ur(A));for(const i in A){const o=A[i];let n;KA(o)?"default"in o?n=rt(o.from||i,o.default,!0):n=rt(o.from||i):n=rt(o),le(n)?Object.defineProperty(e,i,{enumerable:!0,configurable:!0,get:()=>n.value,set:r=>n.value=r}):e[i]=n}}function _g(A,e,t){Ct(yA(A)?A.map(i=>i.bind(e.proxy)):A.bind(e.proxy),e,t)}function _I(A,e,t,i){let o=i.includes(".")?UI(t,i):()=>t[i];if(ee(A)){const n=e[A];FA(n)&&ae(o,n)}else if(FA(A))ae(o,A.bind(t));else if(KA(A))if(yA(A))A.forEach(n=>_I(n,e,t,i));else{const n=FA(A.handler)?A.handler.bind(t):e[A.handler];FA(n)&&ae(o,n,A)}}function KI(A){const e=A.type,{mixins:t,extends:i}=e,{mixins:o,optionsCache:n,config:{optionMergeStrategies:r}}=A.appContext,g=n.get(e);let s;return g?s=g:!o.length&&!t&&!i?s=e:(s={},o.length&&o.forEach(a=>zo(s,a,r,!0)),zo(s,e,r)),KA(e)&&n.set(e,s),s}function zo(A,e,t,i=!1){const{mixins:o,extends:n}=e;n&&zo(A,n,t,!0),o&&o.forEach(r=>zo(A,r,t,!0));for(const r in e)if(!(i&&r==="expose")){const g=BQ[r]||t&&t[r];A[r]=g?g(A[r],e[r]):e[r]}return A}const BQ={data:Kg,props:Og,emits:Og,methods:Ki,computed:Ki,beforeCreate:he,created:he,beforeMount:he,mounted:he,beforeUpdate:he,updated:he,beforeDestroy:he,beforeUnmount:he,destroyed:he,unmounted:he,activated:he,deactivated:he,errorCaptured:he,serverPrefetch:he,components:Ki,directives:Ki,watch:cQ,provide:Kg,inject:QQ};function Kg(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 QQ(A,e){return Ki(ur(A),ur(e))}function ur(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[`${Ii(e)}Modifiers`];function hQ(A,e,...t){if(A.isUnmounted)return;const i=A.vnode.props||_A;let o=t;const n=e.startsWith("update:"),r=n&&fQ(i,e.slice(7));r&&(r.trim&&(o=t.map(I=>ee(I)?I.trim():I)),r.number&&(o=t.map(un)));let g,s=i[g=xn(e)]||i[g=xn(Je(e))];!s&&n&&(s=i[g=xn(Ii(e))]),s&&Ct(s,A,6,o);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,o)}}const dQ=new WeakMap;function PI(A,e,t=!1){const i=t?dQ:e.emitsCache,o=i.get(A);if(o!==void 0)return o;const n=A.emits;let r={},g=!1;if(!FA(A)){const s=a=>{const I=PI(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!n&&!g?(KA(A)&&i.set(A,null),null):(yA(n)?n.forEach(s=>r[s]=null):ue(r,n),KA(A)&&i.set(A,r),r)}function wn(A,e){return!A||!Bn(e)?!1:(e=e.slice(2).replace(/Once$/,""),JA(A,e[0].toLowerCase()+e.slice(1))||JA(A,Ii(e))||JA(A,e))}function Pg(A){const{type:e,vnode:t,proxy:i,withProxy:o,propsOptions:[n],slots:r,attrs:g,emit:s,render:a,renderCache:I,props:l,data:C,setupState:Q,ctx:f,inheritAttrs:h}=A,u=Zo(A);let E,D;try{if(t.shapeFlag&4){const p=o||i,d=p;E=tt(a.call(d,p,I,l,Q,C,f)),D=g}else{const p=e;E=tt(p.length>1?p(l,{attrs:g,slots:r,emit:s}):p(l,null)),D=e.props?g:pQ(g)}}catch(p){Zi.length=0,mn(p,A,1),E=TA(Kt)}let c=E;if(D&&h!==!1){const p=Object.keys(D),{shapeFlag:d}=c;p.length&&d&7&&(n&&p.some(Wr)&&(D=mQ(D,n)),c=ki(c,D,!1,!0))}return t.dirs&&(c=ki(c,null,!1,!0),c.dirs=c.dirs?c.dirs.concat(t.dirs):t.dirs),t.transition&&ng(c,t.transition),E=c,Zo(u),E}const pQ=A=>{let e;for(const t in A)(t==="class"||t==="style"||Bn(t))&&((e||(e={}))[t]=A[t]);return e},mQ=(A,e)=>{const t={};for(const i in A)(!Wr(i)||!(i.slice(9)in e))&&(t[i]=A[i]);return t};function yQ(A,e,t){const{props:i,children:o,component:n}=A,{props:r,children:g,patchFlag:s}=e,a=n.emitsOptions;if(e.dirs||e.transition)return!0;if(t&&s>=0){if(s&1024)return!0;if(s&16)return i?Vg(i,r,a):!!r;if(s&8){const I=e.dynamicProps;for(let l=0;lObject.create(VI),qI=A=>Object.getPrototypeOf(A)===VI;function DQ(A,e,t,i=!1){const o={},n=WI();A.propsDefaults=Object.create(null),jI(A,e,o,n);for(const r in A.propsOptions[0])r in o||(o[r]=void 0);t?A.props=i?o:kI(o):A.type.props?A.props=o:A.props=n,A.attrs=n}function kQ(A,e,t,i){const{props:o,attrs:n,vnode:{patchFlag:r}}=A,g=xA(o),[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]=ZI(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(!n&&!s)return KA(A)&&i.set(A,fi),fi;if(yA(n))for(let I=0;IA==="_"||A==="_ctx"||A==="$stable",gg=A=>yA(A)?A.map(tt):[tt(A)],FQ=(A,e,t)=>{if(e._n)return e;const i=PB((...o)=>gg(e(...o)),t);return i._c=!1,i},XI=(A,e,t)=>{const i=A._ctx;for(const o in A){if(rg(o))continue;const n=A[o];if(FA(n))e[o]=FQ(o,n,i);else if(n!=null){const r=gg(n);e[o]=()=>r}}},zI=(A,e)=>{const t=gg(e);A.slots.default=()=>t},$I=(A,e,t)=>{for(const i in e)(t||!rg(i))&&(A[i]=e[i])},SQ=(A,e,t)=>{const i=A.slots=WI();if(A.vnode.shapeFlag&32){const o=e._;o?($I(i,e,t),t&&gI(i,"_",o,!0)):XI(e,i)}else e&&zI(A,e)},RQ=(A,e,t)=>{const{vnode:i,slots:o}=A;let n=!0,r=_A;if(i.shapeFlag&32){const g=e._;g?t&&g===1?n=!1:$I(o,e,t):(n=!e.$stable,XI(e,o)),r=e}else e&&(zI(A,e),r={default:1});if(n)for(const g in o)!rg(g)&&r[g]==null&&delete o[g]},Se=UQ;function bQ(A){return NQ(A)}function NQ(A,e){const t=fn();t.__VUE__=!0;const{insert:i,remove:o,patchProp:n,createElement:r,createText:g,createComment:s,setText:a,setElementText:I,parentNode:l,nextSibling:C,setScopeId:Q=nt,insertStaticContent:f}=A,h=(w,S,k,x=null,q=null,V=null,nA=void 0,iA=null,m=!!S.dynamicChildren)=>{if(w===S)return;w&&!xi(w,S)&&(x=_(w),$(w,q,V,!0),w=null),S.patchFlag===-2&&(m=!1,S.dynamicChildren=null);const{type:y,ref:L,shapeFlag:O}=S;switch(y){case ho:u(w,S,k,x);break;case Kt:E(w,S,k,x);break;case Yo:w==null&&D(S,k,x,nA);break;case qA:R(w,S,k,x,q,V,nA,iA,m);break;default:O&1?d(w,S,k,x,q,V,nA,iA,m):O&6?j(w,S,k,x,q,V,nA,iA,m):(O&64||O&128)&&y.process(w,S,k,x,q,V,nA,iA,m,EA)}L!=null&&q?Wi(L,w&&w.ref,V,S||w,!S):L==null&&w&&w.ref!=null&&Wi(w.ref,null,V,w,!0)},u=(w,S,k,x)=>{if(w==null)i(S.el=g(S.children),k,x);else{const q=S.el=w.el;S.children!==w.children&&a(q,S.children)}},E=(w,S,k,x)=>{w==null?i(S.el=s(S.children||""),k,x):S.el=w.el},D=(w,S,k,x)=>{[w.el,w.anchor]=f(w.children,S,k,x,w.el,w.anchor)},c=({el:w,anchor:S},k,x)=>{let q;for(;w&&w!==S;)q=C(w),i(w,k,x),w=q;i(S,k,x)},p=({el:w,anchor:S})=>{let k;for(;w&&w!==S;)k=C(w),o(w),w=k;o(S)},d=(w,S,k,x,q,V,nA,iA,m)=>{if(S.type==="svg"?nA="svg":S.type==="math"&&(nA="mathml"),w==null)v(S,k,x,q,V,nA,iA,m);else{const y=w.el&&w.el._isVueCE?w.el:null;try{y&&y._beginPatch(),H(w,S,q,V,nA,iA,m)}finally{y&&y._endPatch()}}},v=(w,S,k,x,q,V,nA,iA)=>{let m,y;const{props:L,shapeFlag:O,transition:gA,dirs:X}=w;if(m=w.el=r(w.type,V,L&&L.is,L),O&8?I(m,w.children):O&16&&N(w.children,m,null,x,q,Kn(w,V),nA,iA),X&&Zt(w,null,x,"created"),b(m,w,w.scopeId,nA,x),L){for(const P in L)P!=="value"&&!Oi(P)&&n(m,P,null,L[P],V,x);"value"in L&&n(m,"value",null,L.value,V),(y=L.onVnodeBeforeMount)&&ze(y,x,w)}X&&Zt(w,null,x,"beforeMount");const G=GQ(q,gA);G&&gA.beforeEnter(m),i(m,S,k),((y=L&&L.onVnodeMounted)||G||X)&&Se(()=>{y&&ze(y,x,w),G&&gA.enter(m),X&&Zt(w,null,x,"mounted")},q)},b=(w,S,k,x,q)=>{if(k&&Q(w,k),x)for(let V=0;V{for(let y=m;y{const iA=S.el=w.el;let{patchFlag:m,dynamicChildren:y,dirs:L}=S;m|=w.patchFlag&16;const O=w.props||_A,gA=S.props||_A;let X;if(k&&Xt(k,!1),(X=gA.onVnodeBeforeUpdate)&&ze(X,k,S,w),L&&Zt(S,w,k,"beforeUpdate"),k&&Xt(k,!0),(O.innerHTML&&gA.innerHTML==null||O.textContent&&gA.textContent==null)&&I(iA,""),y?M(w.dynamicChildren,y,iA,k,x,Kn(S,q),V):nA||oA(w,S,iA,null,k,x,Kn(S,q),V,!1),m>0){if(m&16)U(iA,O,gA,k,q);else if(m&2&&O.class!==gA.class&&n(iA,"class",null,gA.class,q),m&4&&n(iA,"style",O.style,gA.style,q),m&8){const G=S.dynamicProps;for(let P=0;P{X&&ze(X,k,S,w),L&&Zt(S,w,k,"updated")},x)},M=(w,S,k,x,q,V,nA)=>{for(let iA=0;iA{if(S!==k){if(S!==_A)for(const V in S)!Oi(V)&&!(V in k)&&n(w,V,S[V],null,q,x);for(const V in k){if(Oi(V))continue;const nA=k[V],iA=S[V];nA!==iA&&V!=="value"&&n(w,V,iA,nA,q,x)}"value"in k&&n(w,"value",S.value,k.value,q)}},R=(w,S,k,x,q,V,nA,iA,m)=>{const y=S.el=w?w.el:g(""),L=S.anchor=w?w.anchor:g("");let{patchFlag:O,dynamicChildren:gA,slotScopeIds:X}=S;X&&(iA=iA?iA.concat(X):X),w==null?(i(y,k,x),i(L,k,x),N(S.children||[],k,L,q,V,nA,iA,m)):O>0&&O&64&&gA&&w.dynamicChildren&&w.dynamicChildren.length===gA.length?(M(w.dynamicChildren,gA,k,q,V,nA,iA),(S.key!=null||q&&S===q.subTree)&&AC(w,S,!0)):oA(w,S,k,L,q,V,nA,iA,m)},j=(w,S,k,x,q,V,nA,iA,m)=>{S.slotScopeIds=iA,w==null?S.shapeFlag&512?q.ctx.activate(S,k,x,nA,m):rA(S,k,x,q,V,nA,m):IA(w,S,m)},rA=(w,S,k,x,q,V,nA)=>{const iA=w.component=_Q(w,x,q);if(xI(w)&&(iA.ctx.renderer=EA),KQ(iA,!1,nA),iA.asyncDep){if(q&&q.registerDep(iA,AA,nA),!w.el){const m=iA.subTree=TA(Kt);E(null,m,S,k),w.placeholder=m.el}}else AA(iA,w,S,k,q,V,nA)},IA=(w,S,k)=>{const x=S.component=w.component;if(yQ(w,S,k))if(x.asyncDep&&!x.asyncResolved){z(x,S,k);return}else x.next=S,x.update();else S.el=w.el,x.vnode=S},AA=(w,S,k,x,q,V,nA)=>{const iA=()=>{if(w.isMounted){let{next:O,bu:gA,u:X,parent:G,vnode:P}=w;{const Ce=eC(w);if(Ce){O&&(O.el=P.el,z(w,O,nA)),Ce.asyncDep.then(()=>{w.isUnmounted||iA()});return}}let fA=O,bA;Xt(w,!1),O?(O.el=P.el,z(w,O,nA)):O=P,gA&&To(gA),(bA=O.props&&O.props.onVnodeBeforeUpdate)&&ze(bA,G,O,P),Xt(w,!0);const jA=Pg(w),fe=w.subTree;w.subTree=jA,h(fe,jA,l(fe.el),_(fe),w,q,V),O.el=jA.el,fA===null&&wQ(w,jA.el),X&&Se(X,q),(bA=O.props&&O.props.onVnodeUpdated)&&Se(()=>ze(bA,G,O,P),q)}else{let O;const{el:gA,props:X}=S,{bm:G,m:P,parent:fA,root:bA,type:jA}=w,fe=qi(S);Xt(w,!1),G&&To(G),!fe&&(O=X&&X.onVnodeBeforeMount)&&ze(O,fA,S),Xt(w,!0);{bA.ce&&bA.ce._def.shadowRoot!==!1&&bA.ce._injectChildStyle(jA);const Ce=w.subTree=Pg(w);h(null,Ce,k,x,w,q,V),S.el=Ce.el}if(P&&Se(P,q),!fe&&(O=X&&X.onVnodeMounted)){const Ce=S;Se(()=>ze(O,fA,Ce),q)}(S.shapeFlag&256||fA&&qi(fA.vnode)&&fA.vnode.shapeFlag&256)&&w.a&&Se(w.a,q),w.isMounted=!0,S=k=x=null}};w.scope.on();const m=w.effect=new lI(iA);w.scope.off();const y=w.update=m.run.bind(m),L=w.job=m.runIfDirty.bind(m);L.i=w,L.id=w.uid,m.scheduler=()=>og(L),Xt(w,!0),y()},z=(w,S,k)=>{S.component=w;const x=w.vnode.props;w.vnode=S,w.next=null,kQ(w,S.props,x,k),RQ(w,S.children,k),wt(),Jg(w),Dt()},oA=(w,S,k,x,q,V,nA,iA,m=!1)=>{const y=w&&w.children,L=w?w.shapeFlag:0,O=S.children,{patchFlag:gA,shapeFlag:X}=S;if(gA>0){if(gA&128){Y(y,O,k,x,q,V,nA,iA,m);return}else if(gA&256){dA(y,O,k,x,q,V,nA,iA,m);return}}X&8?(L&16&&LA(y,q,V),O!==y&&I(k,O)):L&16?X&16?Y(y,O,k,x,q,V,nA,iA,m):LA(y,q,V,!0):(L&8&&I(k,""),X&16&&N(O,k,x,q,V,nA,iA,m))},dA=(w,S,k,x,q,V,nA,iA,m)=>{w=w||fi,S=S||fi;const y=w.length,L=S.length,O=Math.min(y,L);let gA;for(gA=0;gAL?LA(w,q,V,!0,!1,O):N(S,k,x,q,V,nA,iA,m,O)},Y=(w,S,k,x,q,V,nA,iA,m)=>{let y=0;const L=S.length;let O=w.length-1,gA=L-1;for(;y<=O&&y<=gA;){const X=w[y],G=S[y]=m?xt(S[y]):tt(S[y]);if(xi(X,G))h(X,G,k,null,q,V,nA,iA,m);else break;y++}for(;y<=O&&y<=gA;){const X=w[O],G=S[gA]=m?xt(S[gA]):tt(S[gA]);if(xi(X,G))h(X,G,k,null,q,V,nA,iA,m);else break;O--,gA--}if(y>O){if(y<=gA){const X=gA+1,G=XgA)for(;y<=O;)$(w[y],q,V,!0),y++;else{const X=y,G=y,P=new Map;for(y=G;y<=gA;y++){const Fe=S[y]=m?xt(S[y]):tt(S[y]);Fe.key!=null&&P.set(Fe.key,y)}let fA,bA=0;const jA=gA-G+1;let fe=!1,Ce=0;const jt=new Array(jA);for(y=0;y=jA){$(Fe,q,V,!0);continue}let Xe;if(Fe.key!=null)Xe=P.get(Fe.key);else for(fA=G;fA<=gA;fA++)if(jt[fA-G]===0&&xi(Fe,S[fA])){Xe=fA;break}Xe===void 0?$(Fe,q,V,!0):(jt[Xe-G]=y+1,Xe>=Ce?Ce=Xe:fe=!0,h(Fe,S[Xe],k,null,q,V,nA,iA,m),bA++)}const Mn=fe?LQ(jt):fi;for(fA=Mn.length-1,y=jA-1;y>=0;y--){const Fe=G+y,Xe=S[Fe],Ng=S[Fe+1],Gg=Fe+1{const{el:V,type:nA,transition:iA,children:m,shapeFlag:y}=w;if(y&6){W(w.component.subTree,S,k,x);return}if(y&128){w.suspense.move(S,k,x);return}if(y&64){nA.move(w,S,k,EA);return}if(nA===qA){i(V,S,k);for(let O=0;OiA.enter(V),q);else{const{leave:O,delayLeave:gA,afterLeave:X}=iA,G=()=>{w.ctx.isUnmounted?o(V):i(V,S,k)},P=()=>{V._isLeaving&&V[XB](!0),O(V,()=>{G(),X&&X()})};gA?gA(V,G,P):P()}else i(V,S,k)},$=(w,S,k,x=!1,q=!1)=>{const{type:V,props:nA,ref:iA,children:m,dynamicChildren:y,shapeFlag:L,patchFlag:O,dirs:gA,cacheIndex:X}=w;if(O===-2&&(q=!1),iA!=null&&(wt(),Wi(iA,null,k,w,!0),Dt()),X!=null&&(S.renderCache[X]=void 0),L&256){S.ctx.deactivate(w);return}const G=L&1&&gA,P=!qi(w);let fA;if(P&&(fA=nA&&nA.onVnodeBeforeUnmount)&&ze(fA,S,w),L&6)oe(w.component,k,x);else{if(L&128){w.suspense.unmount(k,x);return}G&&Zt(w,null,S,"beforeUnmount"),L&64?w.type.remove(w,S,k,EA,x):y&&!y.hasOnce&&(V!==qA||O>0&&O&64)?LA(y,S,k,!1,!0):(V===qA&&O&384||!q&&L&16)&&LA(m,S,k),x&&DA(w)}(P&&(fA=nA&&nA.onVnodeUnmounted)||G)&&Se(()=>{fA&&ze(fA,S,w),G&&Zt(w,null,S,"unmounted")},k)},DA=w=>{const{type:S,el:k,anchor:x,transition:q}=w;if(S===qA){NA(k,x);return}if(S===Yo){p(w);return}const V=()=>{o(k),q&&!q.persisted&&q.afterLeave&&q.afterLeave()};if(w.shapeFlag&1&&q&&!q.persisted){const{leave:nA,delayLeave:iA}=q,m=()=>nA(k,V);iA?iA(w.el,V,m):m()}else V()},NA=(w,S)=>{let k;for(;w!==S;)k=C(w),o(w),w=k;o(S)},oe=(w,S,k)=>{const{bum:x,scope:q,job:V,subTree:nA,um:iA,m,a:y}=w;qg(m),qg(y),x&&To(x),q.stop(),V&&(V.flags|=8,$(nA,w,S,k)),iA&&Se(iA,S),Se(()=>{w.isUnmounted=!0},S)},LA=(w,S,k,x=!1,q=!1,V=0)=>{for(let nA=V;nA{if(w.shapeFlag&6)return _(w.component.subTree);if(w.shapeFlag&128)return w.suspense.next();const S=C(w.anchor||w.el),k=S&&S[jB];return k?C(k):S};let eA=!1;const tA=(w,S,k)=>{let x;w==null?S._vnode&&($(S._vnode,null,null,!0),x=S._vnode.component):h(S._vnode||null,w,S,null,null,null,k),S._vnode=w,eA||(eA=!0,Jg(x),bI(),eA=!1)},EA={p:h,um:$,m:W,r:DA,mt:rA,mc:N,pc:oA,pbc:M,n:_,o:A};return{render:tA,hydrate:void 0,createApp:uQ(tA)}}function Kn({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 GQ(A,e){return(!A||A&&!A.pendingBranch)&&e&&!e.persisted}function AC(A,e,t=!1){const i=A.children,o=e.children;if(yA(i)&&yA(o))for(let n=0;n>1,A[t[g]]0&&(e[i]=t[n-1]),t[n]=i)}}for(n=t.length,r=t[n-1];n-- >0;)t[n]=r,r=e[r];return t}function eC(A){const e=A.subTree.component;if(e)return e.asyncDep&&!e.asyncResolved?e:eC(e)}function qg(A){if(A)for(let e=0;eA.__isSuspense;function UQ(A,e){e&&e.pendingBranch?yA(A)?e.effects.push(...A):e.effects.push(A):OB(A)}const qA=Symbol.for("v-fgt"),ho=Symbol.for("v-txt"),Kt=Symbol.for("v-cmt"),Yo=Symbol.for("v-stc"),Zi=[];let be=null;function T(A=!1){Zi.push(be=A?null:[])}function MQ(){Zi.pop(),be=Zi[Zi.length-1]||null}let to=1;function $o(A,e=!1){to+=A,A<0&&be&&e&&(be.hasOnce=!0)}function oC(A){return A.dynamicChildren=to>0?be||fi:null,MQ(),to>0&&be&&be.push(A),A}function K(A,e,t,i,o,n){return oC(B(A,e,t,i,o,n,!0))}function ye(A,e,t,i,o){return oC(TA(A,e,t,i,o,!0))}function An(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,_o=({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,o=null,n=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&&_o(e),scopeId:GI,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:n,patchFlag:i,dynamicProps:o,dynamicChildren:null,appContext:null,ctx:Re};return g?(sg(s,t),n&128&&A.normalize(s)):t&&(s.shapeFlag|=ee(t)?8:16),to>0&&!r&&be&&(s.patchFlag>0||n&6)&&s.patchFlag!==32&&be.push(s),s}const TA=xQ;function xQ(A,e=null,t=null,i=0,o=null,n=!1){if((!A||A===HI)&&(A=Kt),An(A)){const g=ki(A,e,!0);return t&&sg(g,t),to>0&&!n&&be&&(g.shapeFlag&6?be[be.indexOf(A)]=g:be.push(g)),g.patchFlag=-2,g}if(qQ(A)&&(A=A.__vccOpts),e){e=JQ(e);let{class:g,style:s}=e;g&&!ee(g)&&(e.class=kA(g)),KA(s)&&(tg(s)&&!yA(s)&&(s=ue({},s)),e.style=VA(s))}const r=ee(A)?1:iC(A)?128:ZB(A)?64:KA(A)?4:FA(A)?2:0;return B(A,e,t,i,o,r,n,!0)}function JQ(A){return A?tg(A)||qI(A)?ue({},A):A:null}function ki(A,e,t=!1,i=!1){const{props:o,ref:n,patchFlag:r,children:g,transition:s}=A,a=e?TQ(o||{},e):o,I={__v_isVNode:!0,__v_skip:!0,type:A.type,props:a,key:a&&nC(a),ref:e&&e.ref?t&&n?yA(n)?n.concat(_o(e)):[n,_o(e)]:_o(e):n,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&&ki(A.ssContent),ssFallback:A.ssFallback&&ki(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(ho,null,A,e)}function Dn(A,e){const t=TA(Yo,null,A);return t.staticCount=e,t}function CA(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()):An(A)?xt(A):TA(ho,null,String(A))}function xt(A){return A.el===null&&A.patchFlag!==-1||A.memo?A:ki(A)}function sg(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 o=e.default;o&&(o._c&&(o._d=!1),sg(A,o()),o._c&&(o._d=!0));return}else{t=32;const o=e._;!o&&!qI(e)?e._ctx=Re:o===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 TQ(...A){const e={};for(let t=0;tEe||Re;let en,hr;{const A=fn(),e=(t,i)=>{let o;return(o=A[t])||(o=A[t]=[]),o.push(i),n=>{o.length>1?o.forEach(r=>r(n)):o[0](n)}};en=e("__VUE_INSTANCE_SETTERS__",t=>Ee=t),hr=e("__VUE_SSR_SETTERS__",t=>io=t)}const po=A=>{const e=Ee;return en(A),A.scope.on(),()=>{A.scope.off(),en(e)}},jg=()=>{Ee&&Ee.scope.off(),en(null)};function rC(A){return A.vnode.shapeFlag&4}let io=!1;function KQ(A,e=!1,t=!1){e&&hr(e);const{props:i,children:o}=A.vnode,n=rC(A);DQ(A,i,n,e),SQ(A,o,t||e);const r=n?OQ(A,e):void 0;return e&&hr(!1),r}function OQ(A,e){const t=A.type;A.accessCache=Object.create(null),A.proxy=new Proxy(A.ctx,IQ);const{setup:i}=t;if(i){wt();const o=A.setupContext=i.length>1?VQ(A):null,n=po(A),r=Eo(i,A,0,[A.props,o]),g=oI(r);if(Dt(),n(),(g||A.sp)&&!qi(A)&&MI(A),g){if(r.then(jg,jg),e)return r.then(s=>{Zg(A,s)}).catch(s=>{mn(s,A,0)});A.asyncDep=r}else Zg(A,r)}else gC(A)}function Zg(A,e,t){FA(e)?A.type.__ssrInlineRender?A.ssrRender=e:A.render=e:KA(e)&&(A.setupState=FI(e)),gC(A)}function gC(A,e,t){const i=A.type;A.render||(A.render=i.render||nt);{const o=po(A);wt();try{CQ(A)}finally{Dt(),o()}}}const PQ={get(A,e){return ce(A,"get",""),A[e]}};function VQ(A){const e=t=>{A.exposed=t||{}};return{attrs:new Proxy(A.attrs,PQ),slots:A.slots,emit:A.emit,expose:e}}function kn(A){return A.exposed?A.exposeProxy||(A.exposeProxy=new Proxy(FI(_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 WQ(A,e=!0){return FA(A)?A.displayName||A.name:A.name||e&&A.__name}function qQ(A){return FA(A)&&"__vccOpts"in A}const hA=(A,e)=>TB(A,e,io);function GA(A,e,t){try{$o(-1);const i=arguments.length;return i===2?KA(e)&&!yA(e)?An(e)?TA(A,null,[e]):TA(A,e):TA(A,null,e):(i>3?t=Array.prototype.slice.call(arguments,2):i===3&&An(t)&&(t=[t]),TA(A,e,t))}finally{$o(1)}}const jQ="3.5.26";/** * @vue/runtime-dom v3.5.26 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT **/let dr;const Xg=typeof window<"u"&&window.trustedTypes;if(Xg)try{dr=Xg.createPolicy("vue",{createHTML:A=>A})}catch{}const sC=dr?A=>dr.createHTML(A):A=>A,ZQ="http://www.w3.org/2000/svg",XQ="http://www.w3.org/1998/Math/MathML",Et=typeof document<"u"?document:null,zg=Et&&Et.createElement("template"),zQ={insert:(A,e,t)=>{e.insertBefore(A,t||null)},remove:A=>{const e=A.parentNode;e&&e.removeChild(A)},createElement:(A,e,t,i)=>{const o=e==="svg"?Et.createElementNS(ZQ,A):e==="mathml"?Et.createElementNS(XQ,A):t?Et.createElement(A,{is:t}):Et.createElement(A);return A==="select"&&i&&i.multiple!=null&&o.setAttribute("multiple",i.multiple),o},createText:A=>Et.createTextNode(A),createComment:A=>Et.createComment(A),setText:(A,e)=>{A.nodeValue=e},setElementText:(A,e)=>{A.textContent=e},parentNode:A=>A.parentNode,nextSibling:A=>A.nextSibling,querySelector:A=>Et.querySelector(A),setScopeId(A,e){A.setAttribute(e,"")},insertStaticContent(A,e,t,i,o,n){const r=t?t.previousSibling:e.lastChild;if(o&&(o===n||o.nextSibling))for(;e.insertBefore(o.cloneNode(!0),t),!(o===n||!(o=o.nextSibling)););else{zg.innerHTML=sC(i==="svg"?`${A}`:i==="mathml"?`${A}`:A);const g=zg.content;if(i==="svg"||i==="mathml"){const s=g.firstChild;for(;s.firstChild;)g.appendChild(s.firstChild);g.removeChild(s)}e.insertBefore(g,t)}return[r?r.nextSibling:e.firstChild,t?t.previousSibling:e.lastChild]}},$Q=Symbol("_vtc");function Ac(A,e,t){const i=A[$Q];i&&(e=(e?[e,...i]:[...i]).join(" ")),e==null?A.removeAttribute("class"):t?A.setAttribute("class",e):A.className=e}const $g=Symbol("_vod"),ec=Symbol("_vsh"),tc=Symbol(""),ic=/(?:^|;)\s*display\s*:/;function oc(A,e,t){const i=A.style,o=ee(t);let n=!1;if(t&&!o){if(e)if(ee(e))for(const r of e.split(";")){const g=r.slice(0,r.indexOf(":")).trim();t[g]==null&&Ko(i,g,"")}else for(const r in e)t[r]==null&&Ko(i,r,"");for(const r in t)r==="display"&&(n=!0),Ko(i,r,t[r])}else if(o){if(e!==t){const r=i[tc];r&&(t+=";"+r),i.cssText=t,n=ic.test(t)}}else e&&A.removeAttribute("style");$g in A&&(A[$g]=n?i.display:"",A[ec]&&(i.display="none"))}const As=/\s*!important$/;function Ko(A,e,t){if(yA(t))t.forEach(i=>Ko(A,e,i));else if(t==null&&(t=""),e.startsWith("--"))A.setProperty(e,t);else{const i=nc(A,e);As.test(t)?A.setProperty(Ii(i),t.replace(As,""),"important"):A[i]=t}}const es=["Webkit","Moz","ms"],On={};function nc(A,e){const t=On[e];if(t)return t;let i=Je(e);if(i!=="filter"&&i in A)return On[e]=i;i=En(i);for(let o=0;oPn||(ac.then(()=>Pn=0),Pn=Date.now());function Cc(A,e){const t=i=>{if(!i._vts)i._vts=Date.now();else if(i._vts<=t.attached)return;Ct(lc(i,t.value),e,5,[i])};return t.value=A,t.attached=Ic(),t}function lc(A,e){if(yA(e)){const t=A.stopImmediatePropagation;return A.stopImmediatePropagation=()=>{t.call(A),A._stopped=!0},e.map(i=>o=>!o._stopped&&i&&i(o))}else return e}const gs=A=>A.charCodeAt(0)===111&&A.charCodeAt(1)===110&&A.charCodeAt(2)>96&&A.charCodeAt(2)<123,Bc=(A,e,t,i,o,n)=>{const r=o==="svg";e==="class"?Ac(A,i,r):e==="style"?oc(A,t,i):Bn(e)?Wr(e)||gc(A,e,t,i,n):(e[0]==="."?(e=e.slice(1),!0):e[0]==="^"?(e=e.slice(1),!1):Qc(A,e,i,r))?(os(A,e,i),!A.tagName.includes("-")&&(e==="value"||e==="checked"||e==="selected")&&is(A,e,i,r,n,e!=="value")):A._isVueCE&&(/[A-Z]/.test(e)||!ee(i))?os(A,Je(e),i,n,e):(e==="true-value"?A._trueValue=i:e==="false-value"&&(A._falseValue=i),is(A,e,i,r))};function Qc(A,e,t,i){if(i)return!!(e==="innerHTML"||e==="textContent"||e in A&&gs(e)&&FA(t));if(e==="spellcheck"||e==="draggable"||e==="translate"||e==="autocorrect"||e==="sandbox"&&A.tagName==="IFRAME"||e==="form"||e==="list"&&A.tagName==="INPUT"||e==="type"&&A.tagName==="TEXTAREA")return!1;if(e==="width"||e==="height"){const o=A.tagName;if(o==="IMG"||o==="VIDEO"||o==="CANVAS"||o==="SOURCE")return!1}return gs(e)&&ee(t)?!1:e in A}const tn=A=>{const e=A.props["onUpdate:modelValue"]||!1;return yA(e)?t=>To(e,t):e};function cc(A){A.target.composing=!0}function ss(A){const e=A.target;e.composing&&(e.composing=!1,e.dispatchEvent(new Event("input")))}const mi=Symbol("_assign");function as(A,e,t){return e&&(A=A.trim()),t&&(A=un(A)),A}const te={created(A,{modifiers:{lazy:e,trim:t,number:i}},o){A[mi]=tn(o);const n=i||o.props&&o.props.type==="number";ti(A,e?"change":"input",r=>{r.target.composing||A[mi](as(A.value,t,n))}),(t||n)&&ti(A,"change",()=>{A.value=as(A.value,t,n)}),e||(ti(A,"compositionstart",cc),ti(A,"compositionend",ss),ti(A,"change",ss))},mounted(A,{value:e}){A.value=e??""},beforeUpdate(A,{value:e,oldValue:t,modifiers:{lazy:i,trim:o,number:n}},r){if(A[mi]=tn(r),A.composing)return;const g=(n||A.type==="number")&&!/^0\d/.test(A.value)?un(A.value):A.value,s=e??"";g!==s&&(document.activeElement===A&&A.type!=="range"&&(i&&e===t||o&&A.value.trim()===s)||(A.value=s))}},pr={deep:!0,created(A,{value:e,modifiers:{number:t}},i){const o=Qn(e);ti(A,"change",()=>{const n=Array.prototype.filter.call(A.options,r=>r.selected).map(r=>t?un(on(r)):on(r));A[mi](A.multiple?o?new Set(n):n:n[0]),A._assigning=!0,uo(()=>{A._assigning=!1})}),A[mi]=tn(i)},mounted(A,{value:e}){Is(A,e)},beforeUpdate(A,e,t){A[mi]=tn(t)},updated(A,{value:e}){A._assigning||Is(A,e)}};function Is(A,e){const t=A.multiple,i=yA(e);if(!(t&&!i&&!Qn(e))){for(let o=0,n=A.options.length;oString(a)===String(g)):r.selected=cB(e,g)>-1}else r.selected=e.has(g);else if(hn(on(r),e)){A.selectedIndex!==o&&(A.selectedIndex=o);return}}!t&&A.selectedIndex!==-1&&(A.selectedIndex=-1)}}function on(A){return"_value"in A?A._value:A.value}const Ec=["ctrl","shift","alt","meta"],uc={stop:A=>A.stopPropagation(),prevent:A=>A.preventDefault(),self:A=>A.target!==A.currentTarget,ctrl:A=>!A.ctrlKey,shift:A=>!A.shiftKey,alt:A=>!A.altKey,meta:A=>!A.metaKey,left:A=>"button"in A&&A.button!==0,middle:A=>"button"in A&&A.button!==1,right:A=>"button"in A&&A.button!==2,exact:(A,e)=>Ec.some(t=>A[`${t}Key`]&&!e.includes(t))},dt=(A,e)=>{const t=A._withMods||(A._withMods={}),i=e.join(".");return t[i]||(t[i]=(o,...n)=>{for(let r=0;r{const e=hc().createApp(...A),{mount:t}=e;return e.mount=i=>{const o=mc(i);if(!o)return;const n=e._component;!FA(n)&&!n.render&&!n.template&&(n.template=o.innerHTML),o.nodeType===1&&(o.textContent="");const r=t(o,!1,pc(o));return o instanceof Element&&(o.removeAttribute("v-cloak"),o.setAttribute("data-v-app","")),r},e};function pc(A){if(A instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&A instanceof MathMLElement)return"mathml"}function mc(A){return ee(A)?document.querySelector(A):A}/*! * shared v9.14.5 * (c) 2025 kazuya kawaguchi * Released under the MIT License. */function yc(A,e){typeof console<"u"&&(console.warn("[intlify] "+A),e&&console.warn(e.stack))}const nn=typeof window<"u",Vt=(A,e=!1)=>e?Symbol.for(A):Symbol(A),wc=(A,e,t)=>Dc({l:A,k:e,s:t}),Dc=A=>JSON.stringify(A).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),Ae=A=>typeof A=="number"&&isFinite(A),kc=A=>IC(A)==="[object Date]",Ot=A=>IC(A)==="[object RegExp]",vn=A=>vA(A)&&Object.keys(A).length===0,Be=Object.assign,vc=Object.create,HA=(A=null)=>vc(A);let ls;const ht=()=>ls||(ls=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:HA());function Bs(A){return A.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/").replace(/=/g,"=")}function Qs(A){return A.replace(/&(?![a-zA-Z0-9#]{2,6};)/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">")}function Fc(A){return A=A.replace(/(\w+)\s*=\s*"([^"]*)"/g,(i,o,n)=>`${o}="${Qs(n)}"`),A=A.replace(/(\w+)\s*=\s*'([^']*)'/g,(i,o,n)=>`${o}='${Qs(n)}'`),/\s*on\w+\s*=\s*["']?[^"'>]+["']?/gi.test(A)&&(A=A.replace(/(\s+)(on)(\w+\s*=)/gi,"$1on$3")),[/(\s+(?:href|src|action|formaction)\s*=\s*["']?)\s*javascript:/gi,/(style\s*=\s*["'][^"']*url\s*\(\s*)javascript:/gi].forEach(i=>{A=A.replace(i,"$1javascript:")}),A}const Sc=Object.prototype.hasOwnProperty;function He(A,e){return Sc.call(A,e)}const WA=Array.isArray,PA=A=>typeof A=="function",aA=A=>typeof A=="string",RA=A=>typeof A=="boolean",UA=A=>A!==null&&typeof A=="object",Rc=A=>UA(A)&&PA(A.then)&&PA(A.catch),aC=Object.prototype.toString,IC=A=>aC.call(A),vA=A=>{if(!UA(A))return!1;const e=Object.getPrototypeOf(A);return e===null||e.constructor===Object},bc=A=>A==null?"":WA(A)||vA(A)&&A.toString===aC?JSON.stringify(A,null,2):String(A);function Nc(A,e=""){return A.reduce((t,i,o)=>o===0?t+i:t+e+i,"")}function Fn(A){let e=A;return()=>++e}const Ro=A=>!UA(A)||WA(A);function Oo(A,e){if(Ro(A)||Ro(e))throw new Error("Invalid value");const t=[{src:A,des:e}];for(;t.length;){const{src:i,des:o}=t.pop();Object.keys(i).forEach(n=>{n!=="__proto__"&&(UA(i[n])&&!UA(o[n])&&(o[n]=Array.isArray(i[n])?[]:HA()),Ro(o[n])||Ro(i[n])?o[n]=i[n]:t.push({src:i[n],des:o[n]}))})}}/*! * message-compiler v9.14.5 * (c) 2025 kazuya kawaguchi * Released under the MIT License. */function Gc(A,e,t){return{line:A,column:e,offset:t}}function rn(A,e,t){return{start:A,end:e}}const Lc=/\{([0-9a-zA-Z]+)\}/g;function CC(A,...e){return e.length===1&&Uc(e[0])&&(e=e[0]),(!e||!e.hasOwnProperty)&&(e={}),A.replace(Lc,(t,i)=>e.hasOwnProperty(i)?e[i]:"")}const lC=Object.assign,cs=A=>typeof A=="string",Uc=A=>A!==null&&typeof A=="object";function BC(A,e=""){return A.reduce((t,i,o)=>o===0?t+i:t+e+i,"")}const ag={USE_MODULO_SYNTAX:1,__EXTEND_POINT__:2},Mc={[ag.USE_MODULO_SYNTAX]:"Use modulo before '{{0}}'."};function xc(A,e,...t){const i=CC(Mc[A],...t||[]),o={message:String(i),code:A};return e&&(o.location=e),o}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},Jc={[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:o,args:n}=t,r=CC((o||Jc)[A]||"",...n||[]),g=new SyntaxError(String(r));return g.code=A,e&&(g.location=e),g.domain=i,g}function Tc(A){throw A}const Bt=" ",Hc="\r",de=` `,Yc="\u2028",_c="\u2029";function Kc(A){const e=A;let t=0,i=1,o=1,n=0;const r=b=>e[b]===Hc&&e[b+1]===de,g=b=>e[b]===de,s=b=>e[b]===_c,a=b=>e[b]===Yc,I=b=>r(b)||g(b)||s(b)||a(b),l=()=>t,C=()=>i,Q=()=>o,f=()=>n,h=b=>r(b)||s(b)||a(b)?de:e[b],u=()=>h(t),E=()=>h(t+n);function D(){return n=0,I(t)&&(i++,o=0),r(t)&&t++,t++,o++,e[t]}function c(){return r(t+n)&&n++,n++,e[t+n]}function p(){t=0,i=1,o=1,n=0}function d(b=0){n=b}function v(){const b=t+n;for(;b!==t;)D();n=0}return{index:l,line:C,column:Q,peekOffset:f,charAt:h,currentChar:u,currentPeek:E,next:D,peek:c,reset:p,resetPeek:d,skipToPeek:v}}const Rt=void 0,Oc=".",Es="'",Pc="tokenizer";function Vc(A,e={}){const t=e.location!==!1,i=Kc(A),o=()=>i.index(),n=()=>Gc(i.line(),i.column(),i.index()),r=n(),g=o(),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,L,...O){const gA=a();if(y.column+=L,y.offset+=L,I){const X=t?rn(gA.startLoc,y):null,G=Gi(m,X,{domain:Pc,args:O});I(G)}}function C(m,y,L){m.endLoc=n(),m.currentType=y;const O={type:y};return t&&(O.loc=rn(m.startLoc,m.endLoc)),L!=null&&(O.value=L),O}const Q=m=>C(m,14);function f(m,y){return m.currentChar()===y?(m.next(),y):(l(pA.EXPECTED_TOKEN,n(),0,y),"")}function h(m){let y="";for(;m.currentPeek()===Bt||m.currentPeek()===de;)y+=m.currentPeek(),m.peek();return y}function u(m){const y=h(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:L}=y;if(L!==2)return!1;h(m);const O=E(m.currentPeek());return m.resetPeek(),O}function p(m,y){const{currentType:L}=y;if(L!==2)return!1;h(m);const O=m.currentPeek()==="-"?m.peek():m.currentPeek(),gA=D(O);return m.resetPeek(),gA}function d(m,y){const{currentType:L}=y;if(L!==2)return!1;h(m);const O=m.currentPeek()===Es;return m.resetPeek(),O}function v(m,y){const{currentType:L}=y;if(L!==8)return!1;h(m);const O=m.currentPeek()===".";return m.resetPeek(),O}function b(m,y){const{currentType:L}=y;if(L!==9)return!1;h(m);const O=E(m.currentPeek());return m.resetPeek(),O}function N(m,y){const{currentType:L}=y;if(!(L===8||L===12))return!1;h(m);const O=m.currentPeek()===":";return m.resetPeek(),O}function H(m,y){const{currentType:L}=y;if(L!==10)return!1;const O=()=>{const X=m.currentPeek();return X==="{"?E(m.peek()):X==="@"||X==="%"||X==="|"||X===":"||X==="."||X===Bt||!X?!1:X===de?(m.peek(),O()):R(m,!1)},gA=O();return m.resetPeek(),gA}function M(m){h(m);const y=m.currentPeek()==="|";return m.resetPeek(),y}function U(m){const y=h(m),L=m.currentPeek()==="%"&&m.peek()==="{";return m.resetPeek(),{isModulo:L,hasSpace:y.length>0}}function R(m,y=!0){const L=(gA=!1,X="",G=!1)=>{const P=m.currentPeek();return P==="{"?X==="%"?!1:gA:P==="@"||!P?X==="%"?!0:gA:P==="%"?(m.peek(),L(gA,"%",!0)):P==="|"?X==="%"||G?!0:!(X===Bt||X===de):P===Bt?(m.peek(),L(!0,Bt,G)):P===de?(m.peek(),L(!0,de,G)):!0},O=L();return y&&m.resetPeek(),O}function j(m,y){const L=m.currentChar();return L===Rt?Rt:y(L)?(m.next(),L):null}function rA(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 j(m,rA)}function AA(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 z(m){return j(m,AA)}function oA(m){const y=m.charCodeAt(0);return y>=48&&y<=57}function dA(m){return j(m,oA)}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 j(m,Y)}function $(m){let y="",L="";for(;y=dA(m);)L+=y;return L}function DA(m){u(m);const y=m.currentChar();return y!=="%"&&l(pA.EXPECTED_TOKEN,n(),0,y),m.next(),"%"}function NA(m){let y="";for(;;){const L=m.currentChar();if(L==="{"||L==="}"||L==="@"||L==="|"||!L)break;if(L==="%")if(R(m))y+=L,m.next();else break;else if(L===Bt||L===de)if(R(m))y+=L,m.next();else{if(M(m))break;y+=L,m.next()}else y+=L,m.next()}return y}function oe(m){u(m);let y="",L="";for(;y=z(m);)L+=y;return m.currentChar()===Rt&&l(pA.UNTERMINATED_CLOSING_BRACE,n(),0),L}function LA(m){u(m);let y="";return m.currentChar()==="-"?(m.next(),y+=`-${$(m)}`):y+=$(m),m.currentChar()===Rt&&l(pA.UNTERMINATED_CLOSING_BRACE,n(),0),y}function _(m){return m!==Es&&m!==de}function eA(m){u(m),f(m,"'");let y="",L="";for(;y=j(m,_);)y==="\\"?L+=tA(m):L+=y;const O=m.currentChar();return O===de||O===Rt?(l(pA.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,n(),0),O===de&&(m.next(),f(m,"'")),L):(f(m,"'"),L)}function tA(m){const y=m.currentChar();switch(y){case"\\":case"'":return m.next(),`\\${y}`;case"u":return EA(m,y,4);case"U":return EA(m,y,6);default:return l(pA.UNKNOWN_ESCAPE_SEQUENCE,n(),0,y),""}}function EA(m,y,L){f(m,y);let O="";for(let gA=0;gA{const O=m.currentChar();return O==="{"||O==="%"||O==="@"||O==="|"||O==="("||O===")"||!O||O===Bt?L:(L+=O,m.next(),y(L))};return y("")}function x(m){u(m);const y=f(m,"|");return u(m),y}function q(m,y){let L=null;switch(m.currentChar()){case"{":return y.braceNest>=1&&l(pA.NOT_ALLOW_NEST_PLACEHOLDER,n(),0),m.next(),L=C(y,2,"{"),u(m),y.braceNest++,L;case"}":return y.braceNest>0&&y.currentType===2&&l(pA.EMPTY_PLACEHOLDER,n(),0),m.next(),L=C(y,3,"}"),y.braceNest--,y.braceNest>0&&u(m),y.inLinked&&y.braceNest===0&&(y.inLinked=!1),L;case"@":return y.braceNest>0&&l(pA.UNTERMINATED_CLOSING_BRACE,n(),0),L=V(m,y)||Q(y),y.braceNest=0,L;default:{let gA=!0,X=!0,G=!0;if(M(m))return y.braceNest>0&&l(pA.UNTERMINATED_CLOSING_BRACE,n(),0),L=C(y,1,x(m)),y.braceNest=0,y.inLinked=!1,L;if(y.braceNest>0&&(y.currentType===5||y.currentType===6||y.currentType===7))return l(pA.UNTERMINATED_CLOSING_BRACE,n(),0),y.braceNest=0,nA(m,y);if(gA=c(m,y))return L=C(y,5,oe(m)),u(m),L;if(X=p(m,y))return L=C(y,6,LA(m)),u(m),L;if(G=d(m,y))return L=C(y,7,eA(m)),u(m),L;if(!gA&&!X&&!G)return L=C(y,13,w(m)),l(pA.INVALID_TOKEN_IN_PLACEHOLDER,n(),0,L.value),u(m),L;break}}return L}function V(m,y){const{currentType:L}=y;let O=null;const gA=m.currentChar();switch((L===8||L===9||L===12||L===10)&&(gA===de||gA===Bt)&&l(pA.INVALID_LINKED_FORMAT,n(),0),gA){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 M(m)?(O=C(y,1,x(m)),y.braceNest=0,y.inLinked=!1,O):v(m,y)||N(m,y)?(u(m),V(m,y)):b(m,y)?(u(m),C(y,12,S(m))):H(m,y)?(u(m),gA==="{"?q(m,y)||O:C(y,11,k(m))):(L===8&&l(pA.INVALID_LINKED_FORMAT,n(),0),y.braceNest=0,y.inLinked=!1,nA(m,y))}}function nA(m,y){let L={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,n(),0),m.next(),C(y,3,"}");case"@":return V(m,y)||Q(y);default:{if(M(m))return L=C(y,1,x(m)),y.braceNest=0,y.inLinked=!1,L;const{isModulo:gA,hasSpace:X}=U(m);if(gA)return X?C(y,0,NA(m)):C(y,4,DA(m));if(R(m))return C(y,0,NA(m));break}}return L}function iA(){const{currentType:m,offset:y,startLoc:L,endLoc:O}=s;return s.lastType=m,s.lastOffset=y,s.lastStartLoc=L,s.lastEndLoc=O,s.offset=o(),s.startLoc=n(),i.currentChar()===Rt?C(s,14):nA(i,s)}return{nextToken:iA,currentOffset:o,currentPosition:n,context:a}}const Wc="parser",qc=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g;function jc(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 Zc(A={}){const e=A.location!==!1,{onError:t,onWarn:i}=A;function o(c,p,d,v,...b){const N=c.currentPosition();if(N.offset+=v,N.column+=v,t){const H=e?rn(d,N):null,M=Gi(p,H,{domain:Wc,args:b});t(M)}}function n(c,p,d,v,...b){const N=c.currentPosition();if(N.offset+=v,N.column+=v,i){const H=e?rn(d,N):null;i(xc(p,H,b))}}function r(c,p,d){const v={type:c};return e&&(v.start=p,v.end=p,v.loc={start:d,end:d}),v}function g(c,p,d,v){e&&(c.end=p,c.loc&&(c.loc.end=d))}function s(c,p){const d=c.context(),v=r(3,d.offset,d.startLoc);return v.value=p,g(v,c.currentOffset(),c.currentPosition()),v}function a(c,p){const d=c.context(),{lastOffset:v,lastStartLoc:b}=d,N=r(5,v,b);return N.index=parseInt(p,10),c.nextToken(),g(N,c.currentOffset(),c.currentPosition()),N}function I(c,p,d){const v=c.context(),{lastOffset:b,lastStartLoc:N}=v,H=r(4,b,N);return H.key=p,d===!0&&(H.modulo=!0),c.nextToken(),g(H,c.currentOffset(),c.currentPosition()),H}function l(c,p){const d=c.context(),{lastOffset:v,lastStartLoc:b}=d,N=r(9,v,b);return N.value=p.replace(qc,jc),c.nextToken(),g(N,c.currentOffset(),c.currentPosition()),N}function C(c){const p=c.nextToken(),d=c.context(),{lastOffset:v,lastStartLoc:b}=d,N=r(8,v,b);return p.type!==12?(o(c,pA.UNEXPECTED_EMPTY_LINKED_MODIFIER,d.lastStartLoc,0),N.value="",g(N,v,b),{nextConsumeToken:p,node:N}):(p.value==null&&o(c,pA.UNEXPECTED_LEXICAL_ANALYSIS,d.lastStartLoc,0,Te(p)),N.value=p.value||"",g(N,c.currentOffset(),c.currentPosition()),{node:N})}function Q(c,p){const d=c.context(),v=r(7,d.offset,d.startLoc);return v.value=p,g(v,c.currentOffset(),c.currentPosition()),v}function f(c){const p=c.context(),d=r(6,p.offset,p.startLoc);let v=c.nextToken();if(v.type===9){const b=C(c);d.modifier=b.node,v=b.nextConsumeToken||c.nextToken()}switch(v.type!==10&&o(c,pA.UNEXPECTED_LEXICAL_ANALYSIS,p.lastStartLoc,0,Te(v)),v=c.nextToken(),v.type===2&&(v=c.nextToken()),v.type){case 11:v.value==null&&o(c,pA.UNEXPECTED_LEXICAL_ANALYSIS,p.lastStartLoc,0,Te(v)),d.key=Q(c,v.value||"");break;case 5:v.value==null&&o(c,pA.UNEXPECTED_LEXICAL_ANALYSIS,p.lastStartLoc,0,Te(v)),d.key=I(c,v.value||"");break;case 6:v.value==null&&o(c,pA.UNEXPECTED_LEXICAL_ANALYSIS,p.lastStartLoc,0,Te(v)),d.key=a(c,v.value||"");break;case 7:v.value==null&&o(c,pA.UNEXPECTED_LEXICAL_ANALYSIS,p.lastStartLoc,0,Te(v)),d.key=l(c,v.value||"");break;default:{o(c,pA.UNEXPECTED_EMPTY_LINKED_KEY,p.lastStartLoc,0);const b=c.context(),N=r(7,b.offset,b.startLoc);return N.value="",g(N,b.offset,b.startLoc),d.key=N,g(d,b.offset,b.startLoc),{nextConsumeToken:v,node:d}}}return g(d,c.currentOffset(),c.currentPosition()),{node:d}}function h(c){const p=c.context(),d=p.currentType===1?c.currentOffset():p.offset,v=p.currentType===1?p.endLoc:p.startLoc,b=r(2,d,v);b.items=[];let N=null,H=null;do{const R=N||c.nextToken();switch(N=null,R.type){case 0:R.value==null&&o(c,pA.UNEXPECTED_LEXICAL_ANALYSIS,p.lastStartLoc,0,Te(R)),b.items.push(s(c,R.value||""));break;case 6:R.value==null&&o(c,pA.UNEXPECTED_LEXICAL_ANALYSIS,p.lastStartLoc,0,Te(R)),b.items.push(a(c,R.value||""));break;case 4:H=!0;break;case 5:R.value==null&&o(c,pA.UNEXPECTED_LEXICAL_ANALYSIS,p.lastStartLoc,0,Te(R)),b.items.push(I(c,R.value||"",!!H)),H&&(n(c,ag.USE_MODULO_SYNTAX,p.lastStartLoc,0,Te(R)),H=null);break;case 7:R.value==null&&o(c,pA.UNEXPECTED_LEXICAL_ANALYSIS,p.lastStartLoc,0,Te(R)),b.items.push(l(c,R.value||""));break;case 8:{const j=f(c);b.items.push(j.node),N=j.nextConsumeToken||null;break}}}while(p.currentType!==14&&p.currentType!==1);const M=p.currentType===1?p.lastOffset:c.currentOffset(),U=p.currentType===1?p.lastEndLoc:c.currentPosition();return g(b,M,U),b}function u(c,p,d,v){const b=c.context();let N=v.items.length===0;const H=r(1,p,d);H.cases=[],H.cases.push(v);do{const M=h(c);N||(N=M.items.length===0),H.cases.push(M)}while(b.currentType!==14);return N&&o(c,pA.MUST_HAVE_MESSAGES_IN_PLURAL,d,0),g(H,c.currentOffset(),c.currentPosition()),H}function E(c){const p=c.context(),{offset:d,startLoc:v}=p,b=h(c);return p.currentType===14?b:u(c,d,v,b)}function D(c){const p=Vc(c,lC({},A)),d=p.context(),v=r(0,d.offset,d.startLoc);return e&&v.loc&&(v.loc.source=c),v.body=E(p),A.onCacheKey&&(v.cacheKey=A.onCacheKey(c)),d.currentType!==14&&o(p,pA.UNEXPECTED_LEXICAL_ANALYSIS,d.lastStartLoc,0,c[d.offset]||""),g(v,p.currentOffset(),p.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 Xc(A,e={}){const t={ast:A,helpers:new Set};return{context:()=>t,helper:n=>(t.helpers.add(n),n)}}function us(A,e){for(let t=0;tfs(t)),A}function fs(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(h,u){r.code+=h}function a(h,u=!0){const E=u?i:"";s(o?E+" ".repeat(h):E)}function I(h=!0){const u=++r.indentLevel;h&&a(u)}function l(h=!0){const u=--r.indentLevel;h&&a(u)}function C(){a(r.indentLevel)}return{context:g,push:s,indent:I,deindent:l,newline:C,helper:h=>`_${h}`,needIndent:()=>r.needIndent}}function iE(A,e){const{helper:t}=A;A.push(`${t("linked")}(`),Fi(A,e.key),e.modifier?(A.push(", "),Fi(A,e.modifier),A.push(", _type")):A.push(", undefined, _type"),A.push(")")}function oE(A,e){const{helper:t,needIndent:i}=A;A.push(`${t("normalize")}([`),A.indent(i());const o=e.items.length;for(let n=0;n1){A.push(`${t("plural")}([`),A.indent(i());const o=e.cases.length;for(let n=0;n{const t=cs(e.mode)?e.mode:"normal",i=cs(e.filename)?e.filename:"message.intl";e.sourceMap;const o=e.breakLineCode!=null?e.breakLineCode:t==="arrow"?";":` `,n=e.needIndent?e.needIndent:t!=="arrow",r=A.helpers||[],g=tE(A,{filename:i,breakLineCode:o,needIndent:n});g.push(t==="normal"?"function __msg__ (ctx) {":"(ctx) => {"),g.indent(n),r.length>0&&(g.push(`const { ${BC(r.map(I=>`${I}: _${I}`),", ")} } = ctx`),g.newline()),g.push("return "),Fi(g,A),g.deindent(n),g.push("}"),delete A.helpers;const{code:s,map:a}=g.context();return{ast:A,code:s,map:a?a.toJSON():void 0}};function sE(A,e={}){const t=lC({},e),i=!!t.jit,o=!!t.minify,n=t.optimize==null?!0:t.optimize,g=Zc(t).parse(A);return i?(n&&$c(g),o&&ci(g),{ast:g,code:""}):(zc(g,t),gE(g,t))}/*! * core-base v9.14.5 * (c) 2025 kazuya kawaguchi * Released under the MIT License. */function aE(){typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(ht().__INTLIFY_PROD_DEVTOOLS__=!1),typeof __INTLIFY_JIT_COMPILATION__!="boolean"&&(ht().__INTLIFY_JIT_COMPILATION__=!1),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(ht().__INTLIFY_DROP_MESSAGE_COMPILER__=!1)}function st(A){return UA(A)&&Cg(A)===0&&(He(A,"b")||He(A,"body"))}const QC=["b","body"];function IE(A){return Wt(A,QC)}const cC=["c","cases"];function CE(A){return Wt(A,cC,[])}const EC=["s","static"];function lE(A){return Wt(A,EC)}const uC=["i","items"];function BE(A){return Wt(A,uC,[])}const fC=["t","type"];function Cg(A){return Wt(A,fC)}const hC=["v","value"];function bo(A,e){const t=Wt(A,hC);if(t!=null)return t;throw oo(e)}const dC=["m","modifier"];function QE(A){return Wt(A,dC)}const pC=["k","key"];function cE(A){const e=Wt(A,pC);if(e)return e;throw oo(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](),o++},C[3]=()=>{if(o>0)o--,i=4,C[0]();else{if(o=0,r===void 0||(r=dE(r),r===!1))return!1;C[1]()}};function Q(){const f=A[t+1];if(i===5&&f==="'"||i===6&&f==='"')return t++,g="\\"+f,C[0](),!0}for(;i!==null;)if(t++,n=A[t],!(n==="\\"&&Q())){if(s=hE(n),l=qt[i],a=l[s]||l.l||8,a===8||(i=a[0],a[1]!==void 0&&(I=C[a[1]],I&&(g=n,I()===!1))))return;if(i===7)return e}}const hs=new Map;function mE(A,e){return UA(A)?A[e]:null}function yE(A,e){if(!UA(A))return null;let t=hs.get(e);if(t||(t=pE(e),t&&hs.set(e,t)),!t)return null;const i=t.length;let o=A,n=0;for(;nA,DE=A=>"",kE="text",vE=A=>A.length===0?"":Nc(A),FE=bc;function ds(A,e){return A=Math.abs(A),e===2?A?A>1?1:0:1:A?Math.min(A,2):0}function SE(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 RE(A,e){e.count||(e.count=A),e.n||(e.n=A)}function bE(A={}){const e=A.locale,t=SE(A),i=UA(A.pluralRules)&&aA(e)&&PA(A.pluralRules[e])?A.pluralRules[e]:ds,o=UA(A.pluralRules)&&aA(e)&&PA(A.pluralRules[e])?ds:void 0,n=E=>E[i(t,E.length,o)],r=A.list||[],g=E=>r[E],s=A.named||HA();Ae(A.pluralIndex)&&RE(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):DE)}const l=E=>A.modifiers?A.modifiers[E]:wE,C=vA(A.processor)&&PA(A.processor.normalize)?A.processor.normalize:vE,Q=vA(A.processor)&&PA(A.processor.interpolate)?A.processor.interpolate:FE,f=vA(A.processor)&&aA(A.processor.type)?A.processor.type:kE,u={list:g,named:a,plural:n,linked:(E,...D)=>{const[c,p]=D;let d="text",v="";D.length===1?UA(c)?(v=c.modifier||v,d=c.type||d):aA(c)&&(v=c||v):D.length===2&&(aA(c)&&(v=c||v),aA(p)&&(d=p||d));const b=I(E)(u),N=d==="vnode"&&WA(b)&&v?b[0]:b;return v?l(v)(N,d):N},message:I,type:f,interpolate:Q,normalize:C,values:Be(HA(),r,s)};return u}let no=null;function NE(A){no=A}function GE(A,e,t){no&&no.emit("i18n:init",{timestamp:Date.now(),i18n:A,version:e,meta:t})}const LE=UE("function:translate");function UE(A){return e=>no&&no.emit(A,e)}const ME=ag.__EXTEND_POINT__,zt=Fn(ME),xE={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()},yC=pA.__EXTEND_POINT__,$t=Fn(yC),Ye={INVALID_ARGUMENT:yC,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 lg(A,e){return e.locale!=null?ps(e.locale):ps(A.locale)}let Vn;function ps(A){if(aA(A))return A;if(PA(A)){if(A.resolvedOnce&&Vn!=null)return Vn;if(A.constructor.name==="Function"){const e=A();if(Rc(e))throw it(Ye.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return Vn=e}else throw it(Ye.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}else throw it(Ye.NOT_SUPPORT_LOCALE_TYPE)}function JE(A,e,t){return[...new Set([t,...WA(e)?e:UA(e)?Object.keys(e):aA(e)?[e]:[t]])]}function wC(A,e,t){const i=aA(t)?t:Si,o=A;o.__localeChainCache||(o.__localeChainCache=new Map);let n=o.__localeChainCache.get(i);if(!n){n=[];let r=[t];for(;WA(r);)r=ms(n,r,e);const g=WA(e)||!vA(e)?e:e.default?e.default:null;r=aA(g)?[g]:g,WA(r)&&ms(n,r,!1),o.__localeChainCache.set(i,n)}return n}function ms(A,e,t){let i=!0;for(let o=0;o`${A.charAt(0).toLocaleUpperCase()}${A.substr(1)}`;function _E(){return{upper:(A,e)=>e==="text"&&aA(A)?A.toUpperCase():e==="vnode"&&UA(A)&&"__v_isVNode"in A?A.children.toUpperCase():A,lower:(A,e)=>e==="text"&&aA(A)?A.toLowerCase():e==="vnode"&&UA(A)&&"__v_isVNode"in A?A.children.toLowerCase():A,capitalize:(A,e)=>e==="text"&&aA(A)?ws(A):e==="vnode"&&UA(A)&&"__v_isVNode"in A?ws(A.children):A}}let DC;function Ds(A){DC=A}let kC;function KE(A){kC=A}let vC;function OE(A){vC=A}let FC=null;const PE=A=>{FC=A},VE=()=>FC;let SC=null;const ks=A=>{SC=A},WE=()=>SC;let vs=0;function qE(A={}){const e=PA(A.onWarn)?A.onWarn:yc,t=aA(A.version)?A.version:YE,i=aA(A.locale)||PA(A.locale)?A.locale:Si,o=PA(i)?Si:i,n=WA(A.fallbackLocale)||vA(A.fallbackLocale)||aA(A.fallbackLocale)||A.fallbackLocale===!1?A.fallbackLocale:o,r=vA(A.messages)?A.messages:Wn(o),g=vA(A.datetimeFormats)?A.datetimeFormats:Wn(o),s=vA(A.numberFormats)?A.numberFormats:Wn(o),a=Be(HA(),A.modifiers,_E()),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,f=!!A.fallbackFormat,h=!!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,p=PA(A.messageCompiler)?A.messageCompiler:DC,d=PA(A.messageResolver)?A.messageResolver:kC||mE,v=PA(A.localeFallbacker)?A.localeFallbacker:vC||JE,b=UA(A.fallbackContext)?A.fallbackContext:void 0,N=A,H=UA(N.__datetimeFormatters)?N.__datetimeFormatters:new Map,M=UA(N.__numberFormatters)?N.__numberFormatters:new Map,U=UA(N.__meta)?N.__meta:{};vs++;const R={version:t,cid:vs,locale:i,fallbackLocale:n,messages:r,modifiers:a,pluralRules:I,missing:l,missingWarn:C,fallbackWarn:Q,fallbackFormat:f,unresolving:h,postTranslation:u,processor:E,warnHtmlMessage:D,escapeParameter:c,messageCompiler:p,messageResolver:d,localeFallbacker:v,fallbackContext:b,onWarn:e,__meta:U};return R.datetimeFormats=g,R.numberFormats=s,R.__datetimeFormatters=H,R.__numberFormatters=M,__INTLIFY_PROD_DEVTOOLS__&&GE(R,t,U),R}const Wn=A=>({[A]:HA()});function Bg(A,e,t,i,o){const{missing:n,onWarn:r}=A;if(n!==null){const g=n(A,t,e,o);return aA(g)?g:e}else return e}function Ji(A,e,t){const i=A;i.__localeChainCache=new Map,A.localeFallbacker(A,t,e)}function jE(A,e){return A===e?!1:A.split("-")[0]===e.split("-")[0]}function ZE(A,e){const t=e.indexOf(A);if(t===-1)return!1;for(let i=t+1;iXE(t,A)}function XE(A,e){const t=IE(e);if(t==null)throw oo(0);if(Cg(t)===1){const n=CE(t);return A.plural(n.reduce((r,g)=>[...r,Fs(A,g)],[]))}else return Fs(A,t)}function Fs(A,e){const t=lE(e);if(t!=null)return A.type==="text"?t:A.normalize([t]);{const i=BE(e).reduce((o,n)=>[...o,mr(A,n)],[]);return A.normalize(i)}}function mr(A,e){const t=Cg(e);switch(t){case 3:return bo(e,t);case 9:return bo(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 oo(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 oo(t)}case 6:{const i=e,o=QE(i),n=cE(i);return A.linked(mr(A,n),o?mr(A,o):void 0,A.type)}case 7:return bo(e,t);case 8:return bo(e,t);default:throw new Error(`unhandled node on format message part: ${t}`)}}const RC=A=>A;let ui=HA();function bC(A,e={}){let t=!1;const i=e.onError||Tc;return e.onError=o=>{t=!0,i(o)},{...sE(A,e),detectError:t}}const zE=(A,e)=>{if(!aA(A))throw it(Ye.NOT_SUPPORT_NON_STRING_MESSAGE);{RA(e.warnHtmlMessage)&&e.warnHtmlMessage;const i=(e.onCacheKey||RC)(A),o=ui[i];if(o)return o;const{code:n,detectError:r}=bC(A,e),g=new Function(`return ${n}`)();return r?g:ui[i]=g}};function $E(A,e){if(__INTLIFY_JIT_COMPILATION__&&!__INTLIFY_DROP_MESSAGE_COMPILER__&&aA(A)){RA(e.warnHtmlMessage)&&e.warnHtmlMessage;const i=(e.onCacheKey||RC)(A),o=ui[i];if(o)return o;const{ast:n,detectError:r}=bC(A,{...e,location:!1,jit:!0}),g=qn(n);return r?g:ui[i]=g}else{const t=A.cacheKey;if(t){const i=ui[t];return i||(ui[t]=qn(A))}else return qn(A)}}const Ss=()=>"",Me=A=>PA(A);function Rs(A,...e){const{fallbackFormat:t,postTranslation:i,unresolving:o,messageCompiler:n,fallbackLocale:r,messages:g}=A,[s,a]=yr(...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,f=aA(a.default)||RA(a.default)?RA(a.default)?n?s:()=>s:a.default:t?n?s:()=>s:"",h=t||f!=="",u=lg(A,a);C&&Au(a);let[E,D,c]=Q?[s,u,g[u]||HA()]:NC(A,s,u,r,l,I),p=E,d=s;if(!Q&&!(aA(p)||st(p)||Me(p))&&h&&(p=f,d=p),!Q&&(!(aA(p)||st(p)||Me(p))||!aA(D)))return o?Sn:s;let v=!1;const b=()=>{v=!0},N=Me(p)?p:GC(A,s,D,p,d,b);if(v)return p;const H=iu(A,D,c,a),M=bE(H),U=eu(A,N,M);let R=i?i(U,s):U;if(C&&aA(R)&&(R=Fc(R)),__INTLIFY_PROD_DEVTOOLS__){const j={timestamp:Date.now(),key:aA(s)?s:Me(p)?p.key:"",locale:D||(Me(p)?p.locale:""),format:aA(p)?p:Me(p)?p.source:"",message:R};j.meta=Be({},A.__meta,VE()||{}),LE(j)}return R}function Au(A){WA(A.list)?A.list=A.list.map(e=>aA(e)?Bs(e):e):UA(A.named)&&Object.keys(A.named).forEach(e=>{aA(A.named[e])&&(A.named[e]=Bs(A.named[e]))})}function NC(A,e,t,i,o,n){const{messages:r,onWarn:g,messageResolver:s,localeFallbacker:a}=A,I=a(A,i,t);let l=HA(),C,Q=null;const f="translate";for(let h=0;hi;return a.locale=t,a.key=e,a}const s=r(i,tu(A,t,o,i,g,n));return s.locale=t,s.key=e,s.source=i,s}function eu(A,e,t){return e(t)}function yr(...A){const[e,t,i]=A,o=HA();if(!aA(e)&&!Ae(e)&&!Me(e)&&!st(e))throw it(Ye.INVALID_ARGUMENT);const n=Ae(e)?String(e):(Me(e),e);return Ae(t)?o.plural=t:aA(t)?o.default=t:vA(t)&&!vn(t)?o.named=t:WA(t)&&(o.list=t),Ae(i)?o.plural=i:aA(i)?o.default=i:vA(i)&&Be(o,i),[n,o]}function tu(A,e,t,i,o,n){return{locale:e,key:t,warnHtmlMessage:o,onError:r=>{throw n&&n(r),r},onCacheKey:r=>wc(e,t,r)}}function iu(A,e,t,i){const{modifiers:o,pluralRules:n,messageResolver:r,fallbackLocale:g,fallbackWarn:s,missingWarn:a,fallbackContext:I}=A,C={locale:e,modifiers:o,pluralRules:n,messages:Q=>{let f=r(t,Q);if(f==null&&I){const[,,h]=NC(I,Q,e,g,s,a);f=r(h,Q)}if(aA(f)||st(f)){let h=!1;const E=GC(A,Q,e,f,Q,()=>{h=!0});return h?Ss:E}else return Me(f)?f:Ss}};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 bs(A,...e){const{datetimeFormats:t,unresolving:i,fallbackLocale:o,onWarn:n,localeFallbacker:r}=A,{__datetimeFormatters: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,f=lg(A,I),h=r(A,o,f);if(!aA(s)||s==="")return new Intl.DateTimeFormat(f,l).format(a);let u={},E,D=null;const c="datetime format";for(let v=0;v{LC.includes(s)?r[s]=t[s]:n[s]=t[s]}),aA(i)?n.locale=i:vA(i)&&(r=i),vA(o)&&(r=o),[n.key||"",g,n,r]}function Ns(A,e,t){const i=A;for(const o in t){const n=`${e}__${o}`;i.__datetimeFormatters.has(n)&&i.__datetimeFormatters.delete(n)}}function Gs(A,...e){const{numberFormats:t,unresolving:i,fallbackLocale:o,onWarn:n,localeFallbacker:r}=A,{__numberFormatters:g}=A,[s,a,I,l]=Dr(...e),C=RA(I.missingWarn)?I.missingWarn:A.missingWarn;RA(I.fallbackWarn)?I.fallbackWarn:A.fallbackWarn;const Q=!!I.part,f=lg(A,I),h=r(A,o,f);if(!aA(s)||s==="")return new Intl.NumberFormat(f,l).format(a);let u={},E,D=null;const c="number format";for(let v=0;v{UC.includes(s)?r[s]=t[s]:n[s]=t[s]}),aA(i)?n.locale=i:vA(i)&&(r=i),vA(o)&&(r=o),[n.key||"",g,n,r]}function Ls(A,e,t){const i=A;for(const o in t){const n=`${e}__${o}`;i.__numberFormatters.has(n)&&i.__numberFormatters.delete(n)}}aE();/*! * vue-i18n v9.14.5 * (c) 2025 kazuya kawaguchi * Released under the MIT License. */const ou="9.14.5";function nu(){typeof __VUE_I18N_FULL_INSTALL__!="boolean"&&(ht().__VUE_I18N_FULL_INSTALL__=!0),typeof __VUE_I18N_LEGACY_API__!="boolean"&&(ht().__VUE_I18N_LEGACY_API__=!0),typeof __INTLIFY_JIT_COMPILATION__!="boolean"&&(ht().__INTLIFY_JIT_COMPILATION__=!1),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(ht().__INTLIFY_DROP_MESSAGE_COMPILER__=!1),typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(ht().__INTLIFY_PROD_DEVTOOLS__=!1)}const ru=xE.__EXTEND_POINT__,Qt=Fn(ru);Qt(),Qt(),Qt(),Qt(),Qt(),Qt(),Qt(),Qt(),Qt();const MC=Ye.__EXTEND_POINT__,De=Fn(MC),re={UNEXPECTED_RETURN_TYPE:MC,INVALID_ARGUMENT:De(),MUST_BE_CALL_SETUP_TOP:De(),NOT_INSTALLED:De(),NOT_AVAILABLE_IN_LEGACY_MODE:De(),REQUIRED_VALUE:De(),INVALID_VALUE:De(),CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN:De(),NOT_INSTALLED_WITH_PROVIDE:De(),UNEXPECTED_ERROR:De(),NOT_COMPATIBLE_LEGACY_VUE_I18N:De(),BRIDGE_SUPPORT_VUE_2_ONLY:De(),MUST_DEFINE_I18N_OPTION_IN_ALLOW_COMPOSITION:De(),NOT_AVAILABLE_COMPOSITION_IN_LEGACY:De(),__EXTEND_POINT__:De()};function Ie(A,...e){return Gi(A,null,void 0)}const kr=Vt("__translateVNode"),vr=Vt("__datetimeParts"),Fr=Vt("__numberParts"),xC=Vt("__setPluralRules"),JC=Vt("__injectWithOption"),Sr=Vt("__dispose");function ro(A){if(!UA(A)||st(A))return A;for(const e in A)if(He(A,e))if(!e.includes("."))UA(A[e])&&ro(A[e]);else{const t=e.split("."),i=t.length-1;let o=A,n=!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(),Oo(a,r[s])):Oo(a,r)}else aA(g)&&Oo(JSON.parse(g),r)}),o==null&&n)for(const g in r)He(r,g)&&ro(r[g]);return r}function TC(A){return A.type}function HC(A,e,t){let i=UA(e.messages)?e.messages:HA();"__i18nGlobal"in t&&(i=Rn(A.locale.value,{messages:i,__i18n:t.__i18nGlobal}));const o=Object.keys(i);o.length&&o.forEach(n=>{A.mergeLocaleMessage(n,i[n])});{if(UA(e.datetimeFormats)){const n=Object.keys(e.datetimeFormats);n.length&&n.forEach(r=>{A.mergeDateTimeFormat(r,e.datetimeFormats[r])})}if(UA(e.numberFormats)){const n=Object.keys(e.numberFormats);n.length&&n.forEach(r=>{A.mergeNumberFormat(r,e.numberFormats[r])})}}}function Us(A){return TA(ho,null,A,0)}const Ms="__INTLIFY_META__",xs=()=>[],gu=()=>!1;let Js=0;function Ts(A){return(e,t,i,o)=>A(t,i,vi()||void 0,o)}const su=()=>{const A=vi();let e=null;return A&&(e=TC(A)[Ms])?{[Ms]:e}:null};function Qg(A={},e){const{__root:t,__injectWithOption:i}=A,o=t===void 0,n=A.flatJson,r=nn?uA:ig,g=!!A.translateExistCompatible;let s=RA(A.inheritLocale)?A.inheritLocale:!0;const a=r(t&&s?t.locale.value:aA(A.locale)?A.locale:Si),I=r(t&&s?t.fallbackLocale.value:aA(A.fallbackLocale)||WA(A.fallbackLocale)||vA(A.fallbackLocale)||A.fallbackLocale===!1?A.fallbackLocale:a.value),l=r(Rn(a.value,A)),C=r(vA(A.datetimeFormats)?A.datetimeFormats:{[a.value]:{}}),Q=r(vA(A.numberFormats)?A.numberFormats:{[a.value]:{}});let f=t?t.missingWarn:RA(A.missingWarn)||Ot(A.missingWarn)?A.missingWarn:!0,h=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)?Ts(A.missing):null,p=PA(A.postTranslation)?A.postTranslation:null,d=t?t.warnHtmlMessage:RA(A.warnHtmlMessage)?A.warnHtmlMessage:!0,v=!!A.escapeParameter;const b=t?t.modifiers:vA(A.modifiers)?A.modifiers:{};let N=A.pluralRules||t&&t.pluralRules,H;H=(()=>{o&&ks(null);const G={version:ou,locale:a.value,fallbackLocale:I.value,messages:l.value,modifiers:b,pluralRules:N,missing:c===null?void 0:c,missingWarn:f,fallbackWarn:h,fallbackFormat:E,unresolving:!0,postTranslation:p===null?void 0:p,warnHtmlMessage:d,escapeParameter:v,messageResolver:A.messageResolver,messageCompiler:A.messageCompiler,__meta:{framework:"vue"}};G.datetimeFormats=C.value,G.numberFormats=Q.value,G.__datetimeFormatters=vA(H)?H.__datetimeFormatters:void 0,G.__numberFormatters=vA(H)?H.__numberFormatters:void 0;const P=qE(G);return o&&ks(P),P})(),Ji(H,a.value,I.value);function U(){return[a.value,I.value,l.value,C.value,Q.value]}const R=hA({get:()=>a.value,set:G=>{a.value=G,H.locale=a.value}}),j=hA({get:()=>I.value,set:G=>{I.value=G,H.fallbackLocale=I.value,Ji(H,a.value,G)}}),rA=hA(()=>l.value),IA=hA(()=>C.value),AA=hA(()=>Q.value);function z(){return PA(p)?p:null}function oA(G){p=G,H.postTranslation=G}function dA(){return D}function Y(G){G!==null&&(c=Ts(G)),D=G,H.missing=c}const W=(G,P,fA,bA,jA,fe)=>{U();let Ce;try{__INTLIFY_PROD_DEVTOOLS__,o||(H.fallbackContext=t?WE():void 0),Ce=G(H)}finally{__INTLIFY_PROD_DEVTOOLS__,o||(H.fallbackContext=void 0)}if(fA!=="translate exists"&&Ae(Ce)&&Ce===Sn||fA==="translate exists"&&!Ce){const[jt,Mn]=P();return t&&u?bA(t):jA(jt)}else{if(fe(Ce))return Ce;throw Ie(re.UNEXPECTED_RETURN_TYPE)}};function $(...G){return W(P=>Reflect.apply(Rs,null,[P,...G]),()=>yr(...G),"translate",P=>Reflect.apply(P.t,P,[...G]),P=>P,P=>aA(P))}function DA(...G){const[P,fA,bA]=G;if(bA&&!UA(bA))throw Ie(re.INVALID_ARGUMENT);return $(P,fA,Be({resolvedMessage:!0},bA||{}))}function NA(...G){return W(P=>Reflect.apply(bs,null,[P,...G]),()=>wr(...G),"datetime format",P=>Reflect.apply(P.d,P,[...G]),()=>ys,P=>aA(P))}function oe(...G){return W(P=>Reflect.apply(Gs,null,[P,...G]),()=>Dr(...G),"number format",P=>Reflect.apply(P.n,P,[...G]),()=>ys,P=>aA(P))}function LA(G){return G.map(P=>aA(P)||Ae(P)||RA(P)?Us(String(P)):P)}const eA={normalize:LA,interpolate:G=>G,type:"vnode"};function tA(...G){return W(P=>{let fA;const bA=P;try{bA.processor=eA,fA=Reflect.apply(Rs,null,[bA,...G])}finally{bA.processor=null}return fA},()=>yr(...G),"translate",P=>P[kr](...G),P=>[Us(P)],P=>WA(P))}function EA(...G){return W(P=>Reflect.apply(Gs,null,[P,...G]),()=>Dr(...G),"number format",P=>P[Fr](...G),xs,P=>aA(P)||WA(P))}function SA(...G){return W(P=>Reflect.apply(bs,null,[P,...G]),()=>wr(...G),"datetime format",P=>P[vr](...G),xs,P=>aA(P)||WA(P))}function w(G){N=G,H.pluralRules=N}function S(G,P){return W(()=>{if(!G)return!1;const fA=aA(P)?P:a.value,bA=q(fA),jA=H.messageResolver(bA,G);return g?jA!=null:st(jA)||Me(jA)||aA(jA)},()=>[G],"translate exists",fA=>Reflect.apply(fA.te,fA,[G,P]),gu,fA=>RA(fA))}function k(G){let P=null;const fA=wC(H,I.value,a.value);for(let bA=0;bA{s&&(a.value=G,H.locale=G,Ji(H,a.value,I.value))}),ae(t.fallbackLocale,G=>{s&&(I.value=G,H.fallbackLocale=G,Ji(H,a.value,I.value))}));const X={id:Js,locale:R,fallbackLocale:j,get inheritLocale(){return s},set inheritLocale(G){s=G,G&&t&&(a.value=t.locale.value,I.value=t.fallbackLocale.value,Ji(H,a.value,I.value))},get availableLocales(){return Object.keys(l.value).sort()},messages:rA,get modifiers(){return b},get pluralRules(){return N||{}},get isGlobal(){return o},get missingWarn(){return f},set missingWarn(G){f=G,H.missingWarn=f},get fallbackWarn(){return h},set fallbackWarn(G){h=G,H.fallbackWarn=h},get fallbackRoot(){return u},set fallbackRoot(G){u=G},get fallbackFormat(){return E},set fallbackFormat(G){E=G,H.fallbackFormat=E},get warnHtmlMessage(){return d},set warnHtmlMessage(G){d=G,H.warnHtmlMessage=G},get escapeParameter(){return v},set escapeParameter(G){v=G,H.escapeParameter=G},t:$,getLocaleMessage:q,setLocaleMessage:V,mergeLocaleMessage:nA,getPostTranslationHandler:z,setPostTranslationHandler:oA,getMissingHandler:dA,setMissingHandler:Y,[xC]:w};return X.datetimeFormats=IA,X.numberFormats=AA,X.rt=DA,X.te=S,X.tm=x,X.d=NA,X.n=oe,X.getDateTimeFormat=iA,X.setDateTimeFormat=m,X.mergeDateTimeFormat=y,X.getNumberFormat=L,X.setNumberFormat=O,X.mergeNumberFormat=gA,X[JC]=i,X[kr]=tA,X[vr]=SA,X[Fr]=EA,X}function au(A){const e=aA(A.locale)?A.locale:Si,t=aA(A.fallbackLocale)||WA(A.fallbackLocale)||vA(A.fallbackLocale)||A.fallbackLocale===!1?A.fallbackLocale:e,i=PA(A.missing)?A.missing:void 0,o=RA(A.silentTranslationWarn)||Ot(A.silentTranslationWarn)?!A.silentTranslationWarn:!0,n=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=aA(A.warnHtmlInMessage)?A.warnHtmlInMessage!=="off":!0,C=!!A.escapeParameterHtml,Q=RA(A.sync)?A.sync:!0;let f=A.messages;if(vA(A.sharedMessages)){const v=A.sharedMessages;f=Object.keys(v).reduce((N,H)=>{const M=N[H]||(N[H]={});return Be(M,v[H]),N},f||{})}const{__i18n:h,__root:u,__injectWithOption:E}=A,D=A.datetimeFormats,c=A.numberFormats,p=A.flatJson,d=A.translateExistCompatible;return{locale:e,fallbackLocale:t,messages:f,flatJson:p,datetimeFormats:D,numberFormats:c,missing:i,missingWarn:o,fallbackWarn:n,fallbackRoot:r,fallbackFormat:g,modifiers:s,pluralRules:a,postTranslation:I,warnHtmlMessage:l,escapeParameter:C,messageResolver:A.messageResolver,inheritLocale:Q,translateExistCompatible:d,__i18n:h,__root:u,__injectWithOption:E}}function Rr(A={},e){{const t=Qg(au(A)),{__extender:i}=A,o={id:t.id,get locale(){return t.locale.value},set locale(n){t.locale.value=n},get fallbackLocale(){return t.fallbackLocale.value},set fallbackLocale(n){t.fallbackLocale.value=n},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(n){},get missing(){return t.getMissingHandler()},set missing(n){t.setMissingHandler(n)},get silentTranslationWarn(){return RA(t.missingWarn)?!t.missingWarn:t.missingWarn},set silentTranslationWarn(n){t.missingWarn=RA(n)?!n:n},get silentFallbackWarn(){return RA(t.fallbackWarn)?!t.fallbackWarn:t.fallbackWarn},set silentFallbackWarn(n){t.fallbackWarn=RA(n)?!n:n},get modifiers(){return t.modifiers},get formatFallbackMessages(){return t.fallbackFormat},set formatFallbackMessages(n){t.fallbackFormat=n},get postTranslation(){return t.getPostTranslationHandler()},set postTranslation(n){t.setPostTranslationHandler(n)},get sync(){return t.inheritLocale},set sync(n){t.inheritLocale=n},get warnHtmlInMessage(){return t.warnHtmlMessage?"warn":"off"},set warnHtmlInMessage(n){t.warnHtmlMessage=n!=="off"},get escapeParameterHtml(){return t.escapeParameter},set escapeParameterHtml(n){t.escapeParameter=n},get preserveDirectiveContent(){return!0},set preserveDirectiveContent(n){},get pluralizationRules(){return t.pluralRules||{}},__composer:t,t(...n){const[r,g,s]=n,a={};let I=null,l=null;if(!aA(r))throw Ie(re.INVALID_ARGUMENT);const C=r;return aA(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(...n){return Reflect.apply(t.rt,t,[...n])},tc(...n){const[r,g,s]=n,a={plural:1};let I=null,l=null;if(!aA(r))throw Ie(re.INVALID_ARGUMENT);const C=r;return aA(g)?a.locale=g:Ae(g)?a.plural=g:WA(g)?I=g:vA(g)&&(l=g),aA(s)?a.locale=s:WA(s)?I=s:vA(s)&&(l=s),Reflect.apply(t.t,t,[C,I||l||{},a])},te(n,r){return t.te(n,r)},tm(n){return t.tm(n)},getLocaleMessage(n){return t.getLocaleMessage(n)},setLocaleMessage(n,r){t.setLocaleMessage(n,r)},mergeLocaleMessage(n,r){t.mergeLocaleMessage(n,r)},d(...n){return Reflect.apply(t.d,t,[...n])},getDateTimeFormat(n){return t.getDateTimeFormat(n)},setDateTimeFormat(n,r){t.setDateTimeFormat(n,r)},mergeDateTimeFormat(n,r){t.mergeDateTimeFormat(n,r)},n(...n){return Reflect.apply(t.n,t,[...n])},getNumberFormat(n){return t.getNumberFormat(n)},setNumberFormat(n,r){t.setNumberFormat(n,r)},mergeNumberFormat(n,r){t.mergeNumberFormat(n,r)},getChoiceIndex(n,r){return-1}};return o.__extender=i,o}}const cg={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:A=>A==="parent"||A==="global",default:"parent"},i18n:{type:Object}};function Iu({slots:A},e){return e.length===1&&e[0]==="default"?(A.default?A.default():[]).reduce((i,o)=>[...i,...o.type===qA?o.children:[o]],[]):e.reduce((t,i)=>{const o=A[i];return o&&(t[i]=o()),t},HA())}function YC(A){return qA}const Cu=fo({name:"i18n-t",props:Be({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:A=>Ae(A)||!isNaN(A)}},cg),setup(A,e){const{slots:t,attrs:i}=e,o=A.i18n||we({useScope:A.scope,__useComponent:!0});return()=>{const n=Object.keys(t).filter(l=>l!=="_"),r=HA();A.locale&&(r.locale=A.locale),A.plural!==void 0&&(r.plural=aA(A.plural)?+A.plural:A.plural);const g=Iu(e,n),s=o[kr](A.keypath,g,r),a=Be(HA(),i),I=aA(A.tag)||UA(A.tag)?A.tag:YC();return GA(I,a,s)}}}),Hs=Cu;function lu(A){return WA(A)&&!aA(A[0])}function _C(A,e,t,i){const{slots:o,attrs:n}=e;return()=>{const r={part:!0};let g=HA();A.locale&&(r.locale=A.locale),aA(A.format)?r.key=A.format:UA(A.format)&&(aA(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 f=o[C.type],h=f?f({[C.type]:C.value,index:Q,parts:s}):[C.value];return lu(h)&&(h[0].key=`${C.type}-${Q}`),h}):aA(s)&&(a=[s]);const I=Be(HA(),n),l=aA(A.tag)||UA(A.tag)?A.tag:YC();return GA(l,I,a)}}const Bu=fo({name:"i18n-n",props:Be({value:{type:Number,required:!0},format:{type:[String,Object]}},cg),setup(A,e){const t=A.i18n||we({useScope:A.scope,__useComponent:!0});return _C(A,e,UC,(...i)=>t[Fr](...i))}}),Ys=Bu,Qu=fo({name:"i18n-d",props:Be({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},cg),setup(A,e){const t=A.i18n||we({useScope:A.scope,__useComponent:!0});return _C(A,e,LC,(...i)=>t[vr](...i))}}),_s=Qu;function cu(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 Eu(A){const e=r=>{const{instance:g,modifiers:s,value:a}=r;if(!g||!g.$)throw Ie(re.UNEXPECTED_ERROR);const I=cu(A,g.$),l=Ks(a);return[Reflect.apply(I.t,I,[...Os(l)]),I]};return{created:(r,g)=>{const[s,a]=e(g);nn&&A.global===a&&(r.__i18nWatcher=ae(a.locale,()=>{g.instance&&g.instance.$forceUpdate()})),r.__composer=a,r.textContent=s},unmounted:r=>{nn&&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=Ks(g);r.textContent=Reflect.apply(s.t,s,[...Os(a)])}},getSSRProps:r=>{const[g]=e(r);return{textContent:g}}}}function Ks(A){if(aA(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 Os(A){const{path:e,locale:t,args:i,choice:o,plural:n}=A,r={},g=i||{};return aA(t)&&(r.locale=t),Ae(o)&&(r.plural=o),Ae(n)&&(r.plural=n),[e,g,r]}function uu(A,e,...t){const i=vA(t[0])?t[0]:{},o=!!i.useI18nComponentName;(RA(i.globalInstall)?i.globalInstall:!0)&&([o?"i18n":Hs.name,"I18nT"].forEach(r=>A.component(r,Hs)),[Ys.name,"I18nN"].forEach(r=>A.component(r,Ys)),[_s.name,"I18nD"].forEach(r=>A.component(r,_s))),A.directive("t",Eu(e))}function fu(A,e,t){return{beforeCreate(){const i=vi();if(!i)throw Ie(re.UNEXPECTED_ERROR);const o=this.$options;if(o.i18n){const n=o.i18n;if(o.__i18n&&(n.__i18n=o.__i18n),n.__root=e,this===this.$root)this.$i18n=Ps(A,n);else{n.__injectWithOption=!0,n.__extender=t.__vueI18nExtend,this.$i18n=Rr(n);const r=this.$i18n;r.__extender&&(r.__disposer=r.__extender(this.$i18n))}}else if(o.__i18n)if(this===this.$root)this.$i18n=Ps(A,o);else{this.$i18n=Rr({__i18n:o.__i18n,__injectWithOption:!0,__extender:t.__vueI18nExtend,__root:e});const n=this.$i18n;n.__extender&&(n.__disposer=n.__extender(this.$i18n))}else this.$i18n=A;o.__i18nGlobal&&HC(e,o,o),this.$t=(...n)=>this.$i18n.t(...n),this.$rt=(...n)=>this.$i18n.rt(...n),this.$tc=(...n)=>this.$i18n.tc(...n),this.$te=(n,r)=>this.$i18n.te(n,r),this.$d=(...n)=>this.$i18n.d(...n),this.$n=(...n)=>this.$i18n.n(...n),this.$tm=n=>this.$i18n.tm(n),t.__setInstance(i,this.$i18n)},mounted(){},unmounted(){const i=vi();if(!i)throw Ie(re.UNEXPECTED_ERROR);const o=this.$i18n;delete this.$t,delete this.$rt,delete this.$tc,delete this.$te,delete this.$d,delete this.$n,delete this.$tm,o.__disposer&&(o.__disposer(),delete o.__disposer,delete o.__extender),t.__deleteInstance(i),delete this.$i18n}}}function Ps(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[xC](e.pluralizationRules||A.pluralizationRules);const t=Rn(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 du(A={},e){const t=__VUE_I18N_LEGACY_API__&&RA(A.legacy)?A.legacy:__VUE_I18N_LEGACY_API__,i=RA(A.globalInjection)?A.globalInjection:!0,o=__VUE_I18N_LEGACY_API__&&t?!!A.allowComposition:!0,n=new Map,[r,g]=pu(A,t),s=Vt("");function a(C){return n.get(C)||null}function I(C,Q){n.set(C,Q)}function l(C){n.delete(C)}{const C={get mode(){return __VUE_I18N_LEGACY_API__&&t?"legacy":"composition"},get allowComposition(){return o},async install(Q,...f){if(Q.__VUE_I18N_SYMBOL__=s,Q.provide(Q.__VUE_I18N_SYMBOL__,C),vA(f[0])){const E=f[0];C.__composerExtend=E.__composerExtend,C.__vueI18nExtend=E.__vueI18nExtend}let h=null;!t&&i&&(h=Ru(Q,C.global)),__VUE_I18N_FULL_INSTALL__&&uu(Q,C,...f),__VUE_I18N_LEGACY_API__&&t&&Q.mixin(fu(g,g.__composer,C));const u=Q.unmount;Q.unmount=()=>{h&&h(),C.dispose(),u()}},get global(){return g},dispose(){r.stop()},__instances:n,__getInstance:a,__setInstance:I,__deleteInstance:l};return C}}function we(A={}){const e=vi();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=mu(e),i=wu(t),o=TC(e),n=yu(A,o);if(__VUE_I18N_LEGACY_API__&&t.mode==="legacy"&&!A.__useComponent){if(!t.allowComposition)throw Ie(re.NOT_AVAILABLE_IN_LEGACY_MODE);return Fu(e,n,i,A)}if(n==="global")return HC(i,A,o),i;if(n==="parent"){let s=Du(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 o&&(s.__i18n=o.__i18n),i&&(s.__root=i),g=Qg(s),r.__composerExtend&&(g[Sr]=r.__composerExtend(g)),vu(r,e,g),r.__setInstance(e,g)}return g}function pu(A,e,t){const i=EB();{const o=__VUE_I18N_LEGACY_API__&&e?i.run(()=>Rr(A)):i.run(()=>Qg(A));if(o==null)throw Ie(re.UNEXPECTED_ERROR);return[i,o]}}function mu(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 yu(A,e){return vn(A)?"__i18n"in e?"local":"global":A.useScope?A.useScope:"local"}function wu(A){return A.mode==="composition"?A.global:A.global.__composer}function Du(A,e,t=!1){let i=null;const o=e.root;let n=ku(e,t);for(;n!=null;){const r=A;if(A.mode==="composition")i=r.__getInstance(n);else if(__VUE_I18N_LEGACY_API__){const g=r.__getInstance(n);g!=null&&(i=g.__composer,t&&i&&!i[JC]&&(i=null))}if(i!=null||o===n)break;n=n.parent}return i}function ku(A,e=!1){return A==null?null:e&&A.vnode.ctx||A.parent}function vu(A,e,t){Ft(()=>{},e),Ci(()=>{const i=t;A.__deleteInstance(e);const o=i[Sr];o&&(o(),delete i[Sr])},e)}function Fu(A,e,t,i={}){const o=e==="local",n=ig(null);if(o&&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:!aA(i.locale),g=uA(!o||r?t.locale.value:aA(i.locale)?i.locale:Si),s=uA(!o||r?t.fallbackLocale.value:aA(i.fallbackLocale)||WA(i.fallbackLocale)||vA(i.fallbackLocale)||i.fallbackLocale===!1?i.fallbackLocale:g.value),a=uA(Rn(g.value,i)),I=uA(vA(i.datetimeFormats)?i.datetimeFormats:{[g.value]:{}}),l=uA(vA(i.numberFormats)?i.numberFormats:{[g.value]:{}}),C=o?t.missingWarn:RA(i.missingWarn)||Ot(i.missingWarn)?i.missingWarn:!0,Q=o?t.fallbackWarn:RA(i.fallbackWarn)||Ot(i.fallbackWarn)?i.fallbackWarn:!0,f=o?t.fallbackRoot:RA(i.fallbackRoot)?i.fallbackRoot:!0,h=!!i.fallbackFormat,u=PA(i.missing)?i.missing:null,E=PA(i.postTranslation)?i.postTranslation:null,D=o?t.warnHtmlMessage:RA(i.warnHtmlMessage)?i.warnHtmlMessage:!0,c=!!i.escapeParameter,p=o?t.modifiers:vA(i.modifiers)?i.modifiers:{},d=i.pluralRules||o&&t.pluralRules;function v(){return[g.value,s.value,a.value,I.value,l.value]}const b=hA({get:()=>n.value?n.value.locale.value:g.value,set:k=>{n.value&&(n.value.locale.value=k),g.value=k}}),N=hA({get:()=>n.value?n.value.fallbackLocale.value:s.value,set:k=>{n.value&&(n.value.fallbackLocale.value=k),s.value=k}}),H=hA(()=>n.value?n.value.messages.value:a.value),M=hA(()=>I.value),U=hA(()=>l.value);function R(){return n.value?n.value.getPostTranslationHandler():E}function j(k){n.value&&n.value.setPostTranslationHandler(k)}function rA(){return n.value?n.value.getMissingHandler():u}function IA(k){n.value&&n.value.setMissingHandler(k)}function AA(k){return v(),k()}function z(...k){return n.value?AA(()=>Reflect.apply(n.value.t,null,[...k])):AA(()=>"")}function oA(...k){return n.value?Reflect.apply(n.value.rt,null,[...k]):""}function dA(...k){return n.value?AA(()=>Reflect.apply(n.value.d,null,[...k])):AA(()=>"")}function Y(...k){return n.value?AA(()=>Reflect.apply(n.value.n,null,[...k])):AA(()=>"")}function W(k){return n.value?n.value.tm(k):{}}function $(k,x){return n.value?n.value.te(k,x):!1}function DA(k){return n.value?n.value.getLocaleMessage(k):{}}function NA(k,x){n.value&&(n.value.setLocaleMessage(k,x),a.value[k]=x)}function oe(k,x){n.value&&n.value.mergeLocaleMessage(k,x)}function LA(k){return n.value?n.value.getDateTimeFormat(k):{}}function _(k,x){n.value&&(n.value.setDateTimeFormat(k,x),I.value[k]=x)}function eA(k,x){n.value&&n.value.mergeDateTimeFormat(k,x)}function tA(k){return n.value?n.value.getNumberFormat(k):{}}function EA(k,x){n.value&&(n.value.setNumberFormat(k,x),l.value[k]=x)}function SA(k,x){n.value&&n.value.mergeNumberFormat(k,x)}const w={get id(){return n.value?n.value.id:-1},locale:b,fallbackLocale:N,messages:H,datetimeFormats:M,numberFormats:U,get inheritLocale(){return n.value?n.value.inheritLocale:r},set inheritLocale(k){n.value&&(n.value.inheritLocale=k)},get availableLocales(){return n.value?n.value.availableLocales:Object.keys(a.value)},get modifiers(){return n.value?n.value.modifiers:p},get pluralRules(){return n.value?n.value.pluralRules:d},get isGlobal(){return n.value?n.value.isGlobal:!1},get missingWarn(){return n.value?n.value.missingWarn:C},set missingWarn(k){n.value&&(n.value.missingWarn=k)},get fallbackWarn(){return n.value?n.value.fallbackWarn:Q},set fallbackWarn(k){n.value&&(n.value.missingWarn=k)},get fallbackRoot(){return n.value?n.value.fallbackRoot:f},set fallbackRoot(k){n.value&&(n.value.fallbackRoot=k)},get fallbackFormat(){return n.value?n.value.fallbackFormat:h},set fallbackFormat(k){n.value&&(n.value.fallbackFormat=k)},get warnHtmlMessage(){return n.value?n.value.warnHtmlMessage:D},set warnHtmlMessage(k){n.value&&(n.value.warnHtmlMessage=k)},get escapeParameter(){return n.value?n.value.escapeParameter:c},set escapeParameter(k){n.value&&(n.value.escapeParameter=k)},t:z,getPostTranslationHandler:R,setPostTranslationHandler:j,getMissingHandler:rA,setMissingHandler:IA,rt:oA,d:dA,n:Y,tm:W,te:$,getLocaleMessage:DA,setLocaleMessage:NA,mergeLocaleMessage:oe,getDateTimeFormat:LA,setDateTimeFormat:_,mergeDateTimeFormat:eA,getNumberFormat:tA,setNumberFormat:EA,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=h,k.fallbackRoot=f,k.fallbackWarn=Q,k.missingWarn=C,k.warnHtmlMessage=D}return TI(()=>{if(A.proxy==null||A.proxy.$i18n==null)throw Ie(re.NOT_AVAILABLE_COMPOSITION_IN_LEGACY);const k=n.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):o&&S(k)}),w}const Su=["locale","fallbackLocale","availableLocales"],Vs=["t","rt","d","n","tm","te"];function Ru(A,e){const t=Object.create(null);return Su.forEach(o=>{const n=Object.getOwnPropertyDescriptor(e,o);if(!n)throw Ie(re.UNEXPECTED_ERROR);const r=le(n.value)?{get(){return n.value.value},set(g){n.value.value=g}}:{get(){return n.get&&n.get()}};Object.defineProperty(t,o,r)}),A.config.globalProperties.$i18n=t,Vs.forEach(o=>{const n=Object.getOwnPropertyDescriptor(e,o);if(!n||!n.value)throw Ie(re.UNEXPECTED_ERROR);Object.defineProperty(A.config.globalProperties,`$${o}`,n)}),()=>{delete A.config.globalProperties.$i18n,Vs.forEach(o=>{delete A.config.globalProperties[`$${o}`]})}}nu();__INTLIFY_JIT_COMPILATION__?Ds($E):Ds(zE);KE(yE);OE(wC);if(__INTLIFY_PROD_DEVTOOLS__){const A=ht();A.__INTLIFY__=!0,NE(A.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}const Jt=uA({isOnline:!1,error:"",lastCheck:null}),ge=uA({chip:null,board:null,firmware:null,flash:null,assetsPartition:null,network:null,screen:null}),go=uA(""),so=uA(""),br=uA(!1),yi=uA(null),bu=A=>new URLSearchParams(window.location.search).get(A),Po=async(A,e={})=>{const t=await fetch(`/xiaozhi/device/tools/call/${so.value}`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${go.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 o=`Failed to call ${A}`;try{const n=JSON.parse(i);n.message&&(o=n.message)}catch{o=`${o}: HTTP ${t.status}`}throw new Error(o)}},Nu=async()=>{var A,e,t,i;try{const[o,n,r]=await Promise.allSettled([Po("self.get_system_info"),Po("self.get_device_status"),Po("self.screen.get_info")]);if(o.status==="fulfilled"&&o.value){const g=o.value.data||o.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("系统信息获取失败:",o.reason||o.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(n.status==="fulfilled"&&n.value){const g=n.value.data||n.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("设备状态获取失败:",n.reason||n.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(o){console.error("获取设备信息时发生错误:",o)}},bn=async(A=!0)=>{br.value=!0;try{const e=await fetch(`/xiaozhi/device/tools/list/${so.value}`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${go.value}`}});if((await e.json()).code===0)Jt.value.isOnline=!0,Jt.value.error="",Jt.value.lastCheck=new Date,A&&await Nu();else throw new Error(`HTTP ${e.status}: ${e.statusText}`)}catch{Jt.value.isOnline=!1,Jt.value.error="",Jt.value.lastCheck=new Date,yi.value&&clearTimeout(yi.value),yi.value=setTimeout(bn,3e4)}finally{br.value=!1}},Gu=(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}},Lu=()=>{const A=localStorage.getItem("token");so.value=bu("deviceId"),A&&so.value&&(go.value=JSON.parse(A).token,bn())},Uu=()=>{yi.value&&(clearTimeout(yi.value),yi.value=null)},Mu=async()=>{await bn()};function Nn(){const A=hA(()=>!!go.value),e=hA(()=>Jt.value.isOnline);return{token:go,deviceId:so,deviceStatus:Jt,deviceInfo:ge,isChecking:br,hasToken:A,isDeviceOnline:e,initializeDeviceStatus:Lu,cleanupDeviceStatus:Uu,refreshDeviceStatus:Mu,checkDeviceStatus:bn,callMcpTool:Po,getSignalDisplayText:Gu}}const Ws={__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,o)=>(T(),K("svg",{class:kA(t.value),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...o[0]||(o[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))}},qs={__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,o)=>(T(),K("svg",{class:kA(t.value),fill:"currentColor",viewBox:"0 0 24 24"},[...o[0]||(o[0]=[Dn('4G',5)])],2))}},js={__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,o)=>(T(),K("svg",{class:kA(t.value),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...o[0]||(o[0]=[Dn('',14)])],2))}},Zs={__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,o)=>(T(),K("svg",{class:kA(t.value),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...o[0]||(o[0]=[Dn('',10)])],2))}},Xs={__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,o)=>(T(),K("svg",{class:kA(t.value),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...o[0]||(o[0]=[Dn('',10)])],2))}},zs={__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,o)=>(T(),K("svg",{class:kA(t.value),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...o[0]||(o[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))}},xu={class:"flex items-center space-x-2"},Ju={class:"flex items-center space-x-1"},Tu={key:0,class:"flex items-center space-x-1"},Hu={class:"text-xs text-gray-500"},Yu={key:0,class:"flex items-center space-x-4 text-sm text-gray-600"},_u={key:0,class:"flex items-center space-x-1"},Ku={key:1,class:"flex items-center space-x-1"},Ou={key:2,class:"flex items-center space-x-1"},Pu={key:3,class:"flex items-center space-x-1"},Vu={key:1,class:"lg:hidden flex flex-col bg-white rounded-lg border border-gray-200 shadow-sm overflow-hidden"},Wu={class:"flex items-center justify-between px-4 py-3 bg-gray-50 border-b border-gray-200"},qu={class:"flex items-center space-x-2"},ju={key:0,class:"flex items-center space-x-1"},Zu={class:"text-xs font-medium text-gray-600"},Xu={key:0,class:"px-4 py-3"},zu={class:"grid grid-cols-1 gap-2.5"},$u={class:"flex justify-between items-center py-1.5 border-b border-gray-100"},Af={key:0,class:"flex items-center space-x-2 flex-1"},ef={class:"min-w-0 flex-1"},tf={class:"text-xs text-gray-500 leading-tight"},of={class:"text-sm text-gray-800 font-medium truncate"},nf={key:1,class:"flex items-center space-x-2 flex-1 ml-3"},rf={class:"min-w-0 flex-1"},gf={class:"text-xs text-gray-500 leading-tight"},sf={class:"text-sm text-gray-800 font-medium truncate"},af={class:"flex justify-between items-center py-1.5"},If={key:0,class:"flex items-center space-x-2 flex-1"},Cf={class:"min-w-0 flex-1"},lf={class:"text-xs text-gray-500 leading-tight"},Bf={class:"text-sm text-gray-800 font-medium"},Qf={key:1,class:"flex items-center space-x-2 flex-1 ml-3"},cf={class:"min-w-0 flex-1"},Ef={class:"text-xs text-gray-500 leading-tight"},uf={class:"text-sm text-gray-800 font-medium"},ff={__name:"DeviceStatus",setup(A){const{t:e}=we(),{deviceStatus:t,deviceInfo:i,hasToken:o,initializeDeviceStatus:n,cleanupDeviceStatus:r,getSignalDisplayText:g}=Nn(),s=hA(()=>o.value);return Ft(()=>{n()}),Ci(()=>{r()}),(a,I)=>(T(),K(qA,null,[s.value?(T(),K("div",{key:0,class:kA(["hidden lg:flex items-center space-x-4",cA(t).isOnline?"":"opacity-60"])},[B("div",xu,[B("div",Ju,[B("div",{class:kA(["w-2 h-2 rounded-full",cA(t).isOnline?"bg-green-500":"bg-gray-400"])},null,2),B("span",{class:kA(["text-sm font-medium",cA(t).isOnline?"text-gray-700":"text-gray-500"])},F(cA(t).isOnline?a.$t("device.online"):a.$t("device.offline")),3)]),cA(t).isOnline&&cA(i).network?(T(),K("div",Tu,[cA(i).network.type==="wifi"?(T(),ye(cA(Ws),{key:0,color:"text-blue-500"})):cA(i).network.type==="4g"?(T(),ye(cA(qs),{key:1})):CA("",!0),B("span",Hu,F(cA(g)(cA(i).network.signal,cA(e))),1)])):CA("",!0)]),cA(t).isOnline?(T(),K("div",Yu,[cA(i).chip?(T(),K("div",_u,[TA(cA(js)),B("span",null,F(cA(i).chip.model),1)])):CA("",!0),cA(i).flash?(T(),K("div",Ku,[TA(cA(Zs)),B("span",null,F(cA(i).flash.size),1)])):CA("",!0),cA(i).board?(T(),K("div",Ou,[TA(cA(Xs)),B("span",null,F(cA(i).board.model),1)])):CA("",!0),cA(i).screen?(T(),K("div",Pu,[TA(cA(zs)),B("span",null,F(cA(i).screen.resolution),1)])):CA("",!0)])):CA("",!0)],2)):CA("",!0),s.value?(T(),K("div",Vu,[B("div",Wu,[B("div",qu,[B("div",{class:kA(["w-2.5 h-2.5 rounded-full",cA(t).isOnline?"bg-green-500":"bg-red-400"])},null,2),B("span",{class:kA(["text-sm font-medium",cA(t).isOnline?"text-gray-800":"text-gray-600"])},F(cA(t).isOnline?a.$t("device.online"):a.$t("device.offline")),3)]),cA(t).isOnline&&cA(i).network?(T(),K("div",ju,[cA(i).network.type==="wifi"?(T(),ye(cA(Ws),{key:0,color:"text-blue-500"})):cA(i).network.type==="4g"?(T(),ye(cA(qs),{key:1})):CA("",!0),B("span",Zu,F(cA(g)(cA(i).network.signal,cA(e))),1)])):CA("",!0)]),cA(t).isOnline?(T(),K("div",Xu,[B("div",zu,[B("div",$u,[cA(i).chip?(T(),K("div",Af,[TA(cA(js),{class:"flex-shrink-0"}),B("div",ef,[B("div",tf,F(a.$t("device.chip")),1),B("div",of,F(cA(i).chip.model),1)])])):CA("",!0),cA(i).board?(T(),K("div",nf,[TA(cA(Xs),{class:"flex-shrink-0"}),B("div",rf,[B("div",gf,F(a.$t("device.board")),1),B("div",sf,F(cA(i).board.model),1)])])):CA("",!0)]),B("div",af,[cA(i).flash?(T(),K("div",If,[TA(cA(Zs),{class:"flex-shrink-0"}),B("div",Cf,[B("div",lf,F(a.$t("device.flash")),1),B("div",Bf,F(cA(i).flash.size),1)])])):CA("",!0),cA(i).screen?(T(),K("div",Qf,[TA(cA(zs),{class:"flex-shrink-0"}),B("div",cf,[B("div",Ef,F(a.$t("device.screen")),1),B("div",uf,F(cA(i).screen.resolution),1)])])):CA("",!0)])])])):CA("",!0)])):CA("",!0)],64))}},hf={title:"Xiaozhi AI Customization"},df={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",back:"Go Back"},pf={title:"Xiaozhi AI Customization"},mf={title:"Saved Configuration Detected",message:"Configuration has been automatically restored. You can continue from where you left off or start over.",restart:"Start Over"},yf={chip:"Chip Configuration",theme:"Theme Design",generate:"Preview & Generate"},wf={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"}},Df={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"},kf={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."}},vf={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. Please re-upload custom emoji images.`,incompatibleEmojiData:"Incompatible emoji data detected, please reconfigure"},Ff={authTokenMissing:"Authentication token not found",checkingDeviceStatus:"Checking device status...",deviceOfflineOrUnresponsive:"The device does not exist or is not online",unableToGetDeviceStatus:"Unable to get device status",initializingTransferService:"Initializing transfer service...",initializeTransferFailed:"Failed to initialize transfer service: {error}",uploadingFile:"Upload the file ...",uploadFailed:"Upload file failed",settingDeviceDownloadUrl:"Setting device download URL...",setDownloadUrlFailed:"Failed to set download URL: {error}",rebootingDevice:"Rebooting device...",waitingForDeviceReboot:"Waiting for device to reboot...",deviceRebootTimeout:"Device reboot timeout (60 seconds)",deviceReady:"Device ready, please wait for program burning",startingFileTransfer:"Starting file transfer...",flashCompleted:"During program burning, please pay attention to the firmware burning status!",onlineFlashFailed:"Online flashing failed: {error}"},Sf={online:"Online",offline:"Offline",checking:"Checking...",flashing:"Flashing...",ready:"Ready",chip:"Chip",board:"Board",flash:"Flash",screen:"Screen",signal:{unknown:"Unknown",strong:"Strong",medium:"Medium",weak:"Weak",none:"No Signal"}},Rf={title:"Step 1: Chip Model and Screen Configuration",loadingFromDevice:"Loading hardware configuration from device...",loadedFromDevice:"Hardware configuration automatically loaded from device",manualConfig:"Please configure hardware parameters manually",loadingTitle:"Loading Device Configuration...",loadingDesc:"Reading chip model and screen resolution from device",autoLoadedTitle:"Device Configuration Auto-loaded",chipModel:"Chip Model",screenWidth:"Screen Width",screenHeight:"Screen Height",colorFormat:"Color Format:",manualEdit:"Manual Configuration",collapseManual:"Collapse Manual Configuration",manualConfigTitle:"Manual Hardware Configuration",next:"Next",selectChip:"Select Chip",chipRequired:"Chip Model",widthRequired:"Screen Width",heightRequired:"Screen Height",loadingError:"Loading configuration error",deviceOffline:"Device not connected or offline",chipModelError:"Unable to get chip model, please enter manually",resolutionError:"Unable to get screen resolution, please enter manually",timeoutError:"Configuration loading timeout, please enter manually",manualConfigDesc:"Unable to auto-read device configuration",manualConfigHint:"Device not connected or offline, please manually input hardware configuration",manualConfigRequired:"Please manually input hardware configuration",resolutionFormatError:"Screen resolution format error"},bf={title:"Step 2: Theme Design",description:"Configure wake word, font, emoji and background to customize your Xiaozhi AI theme.",previous:"Previous",next:"Next",tabs:{wakeword:"Wake Word Config",font:"Font Config",emoji:"Emoji Collection",background:"Chat Background"}},Nf={title:"Step 3: Preview",description:"Preview the effect of your custom configuration on the actual device.",devicePreview:"Device Preview (1:1 Pixel Ratio)",previewSettings:"Preview Settings",previewText:"Preview Text",defaultPreviewText:"Hi, I'm your friend Xiaozhi!",currentEmotion:"Current Emotion",themeMode:"Theme Mode",lightMode:"Light",darkMode:"Dark",configSummary:"Configuration Summary",wakeword:"Wake Word:",font:"Font:",loading:"Loading...",emotion:"Emotion:",skin:"Skin:",previous:"Previous",generate:"Generate assets.bin",emotions:{neutral:"Neutral",happy:"Happy",laughing:"Laughing",funny:"Funny",sad:"Sad",angry:"Angry",crying:"Crying",loving:"Loving",embarrassed:"Embarrassed",surprised:"Surprised",shocked:"Shocked",thinking:"Thinking",winking:"Winking",cool:"Cool",relaxed:"Relaxed",delicious:"Delicious",kissy:"Kiss",confident:"Confident",sleepy:"Sleepy",silly:"Silly",confused:"Confused"},noEmotionConfigured:"No emotion configured",fontLoading:"Font loading...",configureEmojiFirst:"Please configure emoji package in theme design first",customFont:"Custom Font {size}px",customEmoji:"Custom Emoji {count} images",notConfigured:"Not configured",skinLight:"Light {type}",skinDark:"Dark {type}",hideSubtitle:"Hide Subtitle:",image:"Image",color:"Color"},Gf={title:"Chat Background Configuration",description:"Configure chat backgrounds for light and dark modes, supporting solid colors or custom images.",lightMode:"Light Mode Background",darkMode:"Dark Mode Background",solidBackground:"Solid Background",imageBackground:"Image Background",backgroundColor:"Background Color:",textColor:"Text Color:",backgroundImage:"Background Image:",clickOrDragToUpload:"Click or drag to upload background image",removeImage:"Remove Image",backgroundPreview:"Background Preview",lightModePreview:"Light Mode",darkModePreview:"Dark Mode",chatArea:"Chat Content Area",quickConfig:"Quick Configuration",defaultColors:"Default Colors",stoneTexture:"Stone Texture",sunnyColors:"Sunny Colors",skyBlue:"Sky Blue",romanticPink:"Romantic Pink",selectValidImage:"Please select a valid image file"},Lf={title:"Emoji Collection Configuration",description:"Choose preset emoji package or custom emoji images. Each emoji package contains 21 different emotion expressions.",noEmojiPack:"No Emoji Pack",noEmojiPackDescription:"Don't configure emoji pack, only font and background resources will be included in the package.",presetEmojiPack:"Preset Emoji Pack",customEmojiPack:"Custom Emoji Pack",selectPresetEmojiPack:"Select Preset Emoji Pack",twemoji64:"Twemoji 64×64",twemoji32:"Twemoji 32×32",twemojiDescription:"High-quality emoji set from Twitter, perfect for clear display",twitterEmojiName:"Twemoji {size}x{size}",twitterEmojiDescription:"Twitter emoji pack, {size}×{size} pixels",notoEmojiName:"Noto Emoji {size}x{size}",notoEmojiDescription:"Google Noto animated emoji pack, {size}×{size} pixels (requires PSRAM)",size:"Size",preview:"Preview",select:"Select",customEmojiTitle:"Custom Emoji Pack",customEmojiDescription:"Upload your own emoji images. Each emotion needs one image.",uploadInstructions:"Click or drag to upload emoji images (PNG/JPG/WEBP)",supportedFormats:"Supported formats: PNG, JPG, WEBP. Recommended size: 64×64 pixels",emotionMapping:"Emotion Mapping",uploadAllEmotions:"Please upload emoji images for all emotions",maxImageWidth:"Max Image Width (px)",maxImageHeight:"Max Image Height (px)",clickToUpload:"Click to upload",orDragDrop:"or drag and drop",clickToUploadOrDrag:"Click to upload or drag here",remove:"Remove",replace:"Replace",selectValidEmojiImage:"Please select a valid emoji image file",selectValidFormat:"Please select a valid PNG or GIF format image",maxFileSize:"File size cannot exceed 1MB",invalidFormat:"Unsupported image format. Please use PNG, JPG, or WEBP.",required:"Required",uploadEmojiImages:"Upload Emoji Images (GIF requires PSRAM)",customEmojiPackConfig:"Custom Emoji Pack Configuration",neutralRequiredNotice:"* Must upload neutral default emotion, others are optional. If not uploaded, default emotion will be used instead.",sharedFileMessage:"Emotion {emotionKey} uses the same image file as {existingEmotions} (shared storage)",fileDeleted:"File {fileHash} has been deleted (no other emotion references)",fileRetained:"File {fileHash} is still used by other emotions, retained",imageLoadFailed:"Failed to load emoji image",emotions:{neutral:"Neutral",happy:"Happy",laughing:"Laughing",funny:"Funny",sad:"Sad",angry:"Angry",crying:"Crying",loving:"Loving",embarrassed:"Embarrassed",surprised:"Surprised",shocked:"Shocked",thinking:"Thinking",winking:"Winking",cool:"Cool",relaxed:"Relaxed",delicious:"Delicious",kissy:"Kiss",confident:"Confident",sleepy:"Sleepy",silly:"Silly",confused:"Confused"}},Uf={title:"Font Configuration",description:"Choose preset fonts or upload custom font files.",noFonts:"No Fonts",noFontsDescription:"Do not use font configuration, the device will use the default font",presetFonts:"Preset Fonts",customFonts:"Custom Fonts",selectPresetFont:"Select Preset Font",fontSize:"Font Size:",bitDepth:"Bit Depth:",charset:"Character Set:",fileSize:"File Size:",customFontConfig:"Custom Font Configuration",fontFile:"Font File",clickSelectFontFile:"Click to select font file",orDragFileHere:"or drag file here",supportedFormats:"Supports TTF, WOFF, WOFF2 formats",removeFile:"Remove File",fontSizePx:"Font Size (px)",range:"Range:",bitDepthBpp:"Bit Depth (BPP)",monochrome:"1 bpp (Monochrome)",fourColors:"2 bpp (4 colors)",sixteenColors:"4 bpp (16 colors)",characterSet:"Character Set",deepseekR1:"DeepSeek R1 (7405 characters)",gb2312:"GB2312 (7445 characters)",qwen18409:"Qwen (18409 characters)",latin1:"Latin1 (190 characters)",fullCharset:"Full Character Set (All characters in font file)",hideSubtitle:"Hide Subtitle",hideSubtitleDescription:"Do not show real-time text subtitles during conversation",selectValidFontFile:"Please select a valid font file (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"},Mf={app:hf,common:df,header:pf,configNotice:mf,steps:yf,generateModal:wf,progressSteps:Df,wakewordConfig:kf,errors:vf,flashProgress:Ff,device:Sf,chipConfig:Rf,themeDesign:bf,generateSummary:Nf,backgroundConfig:Gf,emojiConfig:Lf,fontConfig:Uf},xf={title:"小智 AI 自定义"},Jf={cancel:"取消",confirm:"确认",close:"关闭",start:"开始",download:"下载",generate:"生成",reset:"重置",yes:"是",no:"否",loading:"加载中...",error:"错误",success:"成功",warning:"警告",info:"信息",next:"下一步",previous:"上一步",finish:"完成",retry:"重试",ok:"确定",other:"其他",back:"返回"},Tf={title:"小智 AI 自定义"},Hf={title:"检测到已保存的配置",message:"配置已自动恢复,您可以继续之前的进度或重新开始。",restart:"重新开始"},Yf={chip:"芯片配置",theme:"主题设计",generate:"效果预览"},_f={title:"生成 assets.bin",confirmConfig:"请确认您的配置",chipModel:"芯片型号:",resolution:"分辨率:",wakeword:"唤醒词:",font:"字体:",emoji:"表情包:",fileList:"包含的文件列表",estimated:"预估",compressed:"压缩前",generating:"正在生成 assets.bin...",progress:"{progress}% 完成",completed:"您的 assets.bin 文件已准备就绪",filename:"文件名: assets.bin",fileSize:"文件大小: {size}",generationTime:"生成时间: {time}",downloadAssets:"下载 assets.bin",flashToDevice:"在线烧录到设备",flashing:"正在烧录到设备...",flashingCancel:"取消烧录",flashingError:"烧录错误",flashingInProgress:"烧录中,请勿关闭窗口",customFont:"自定义字体",customEmoji:"自定义表情包",notConfigured:"未配置",wakewordNames:{wn9s_hilexin:"Hi,乐鑫",wn9s_hiesp:"Hi,ESP",wn9s_nihaoxiaozhi:"你好小智",wn9_nihaoxiaozhi_tts:"你好小智",wn9_alexa:"Alexa"}},Kf={init:"初始化生成器",font:"处理字体文件",wakeword:"打包唤醒词模型",emoji:"处理表情图片",background:"处理背景图片",index:"生成索引文件",spiffs:"构建SPIFFS映射",package:"完成打包"},Of={resetFailed:"重置失败,请刷新页面重试",generationFailed:"生成失败: {error}",noFileToDownload:"没有可下载的文件",deviceOffline:"设备离线,无法进行烧录",fileTooLarge:"烧录失败:文件大小 {fileSize}MB 超过 assets 分区大小 {partitionSize}MB,请减少配置内容或使用更大容量的设备。",flashCancelConfirm:"确定要取消烧录吗?",oldDataCleared:`检测到旧版本的表情数据结构已被清除。 新版本使用文件去重技术,可以节省存储空间。 请重新上传自定义表情图片。`,incompatibleEmojiData:"检测到不兼容的表情数据,请重新配置"},Pf={authTokenMissing:"未找到认证令牌",checkingDeviceStatus:"检查设备状态...",deviceOfflineOrUnresponsive:"设备不存在或不在线",unableToGetDeviceStatus:"无法获取设备状态",initializingTransferService:"初始化传输服务...",initializeTransferFailed:"初始化传输服务失败: {error}",uploadingFile:"上传文件中...",uploadFailed:"上传文件失败",settingDeviceDownloadUrl:"设置设备下载URL...",setDownloadUrlFailed:"设置下载URL失败: {error}",rebootingDevice:"重启设备...",waitingForDeviceReboot:"等待设备重启...",deviceRebootTimeout:"等待设备重启超时(60秒)",deviceReady:"设备就绪,请等待程序烧录",startingFileTransfer:"开始传输文件...",flashCompleted:"程序烧录中,请留意固件的烧录状态!",onlineFlashFailed:"在线烧录失败: {error}"},Vf={online:"在线",offline:"离线",checking:"检查中...",flashing:"烧录中...",ready:"就绪",chip:"芯片",board:"开发板",flash:"Flash",screen:"屏幕",signal:{unknown:"未知",strong:"强",medium:"中等",weak:"弱",none:"无信号"}},Wf={title:"步骤 1: 芯片型号和屏幕配置",loadingFromDevice:"正在从设备读取硬件配置...",loadedFromDevice:"已从设备自动读取硬件配置",manualConfig:"请手动配置硬件参数",loadingTitle:"正在加载设备配置...",loadingDesc:"从设备读取芯片型号和屏幕分辨率",autoLoadedTitle:"设备配置已自动加载",chipModel:"芯片型号",screenWidth:"屏幕宽度",screenHeight:"屏幕高度",colorFormat:"颜色格式:",manualEdit:"手动修改配置",collapseManual:"收起手动配置",manualConfigTitle:"手动配置硬件参数",next:"下一步",selectChip:"请选择芯片",chipRequired:"芯片型号",widthRequired:"屏幕宽度",heightRequired:"屏幕高度",loadingError:"加载配置时发生错误",deviceOffline:"设备未连接或离线",chipModelError:"无法获取芯片型号,请手动输入",resolutionError:"无法获取屏幕分辨率,请手动输入",timeoutError:"加载设备配置超时,请手动输入",manualConfigDesc:"无法自动读取设备配置",manualConfigHint:"设备未连接或离线,请手动输入硬件配置",manualConfigRequired:"请手动输入硬件配置",resolutionFormatError:"屏幕分辨率格式错误"},qf={title:"步骤 2: 主题设计",description:"配置唤醒词、字体、表情和背景来自定义您的小智AI主题。",previous:"上一步",next:"下一步",tabs:{wakeword:"唤醒词配置",font:"字体配置",emoji:"表情集合",background:"聊天背景"}},jf={title:"步骤 3: 效果预览",description:"预览您的自定义配置在实际设备上的效果。",devicePreview:"设备预览 (1:1 像素比例)",previewSettings:"预览设置",previewText:"预览文字",defaultPreviewText:"你好,我是你的朋友小智!",currentEmotion:"当前表情",themeMode:"主题模式",lightMode:"浅色",darkMode:"深色",configSummary:"配置摘要",wakeword:"唤醒词:",font:"字体:",loading:"加载中...",emotion:"表情:",skin:"皮肤:",previous:"上一步",generate:"生成 assets.bin",emotions:{neutral:"默认",happy:"开心",laughing:"大笑",funny:"搞笑",sad:"伤心",angry:"生气",crying:"哭泣",loving:"喜爱",embarrassed:"尴尬",surprised:"惊讶",shocked:"震惊",thinking:"思考",winking:"眨眼",cool:"酷炫",relaxed:"放松",delicious:"美味",kissy:"飞吻",confident:"自信",sleepy:"困倦",silly:"调皮",confused:"困惑"},noEmotionConfigured:"未配置表情",fontLoading:"字体加载中...",configureEmojiFirst:"请先在主题设计中配置表情包",customFont:"自定义字体 {size}px",customEmoji:"自定义表情 {count}张",notConfigured:"未配置",skinLight:"浅色{type}",skinDark:"深色{type}",hideSubtitle:"隐藏字幕:",image:"图片",color:"颜色"},Zf={title:"聊天背景配置",description:"配置浅色模式和深色模式的聊天背景,支持纯色或自定义图片。",lightMode:"浅色模式背景",darkMode:"深色模式背景",solidBackground:"纯色背景",imageBackground:"图片背景",backgroundColor:"背景颜色:",textColor:"文字颜色:",backgroundImage:"背景图片:",clickOrDragToUpload:"点击或拖拽上传背景图片",removeImage:"移除图片",backgroundPreview:"背景预览",lightModePreview:"浅色模式",darkModePreview:"深色模式",chatArea:"聊天内容区域",quickConfig:"快捷配置",defaultColors:"默认配色",stoneTexture:"石墨质感",sunnyColors:"暖阳配色",skyBlue:"天空蓝调",romanticPink:"浪漫粉色",selectValidImage:"请选择有效的图片文件"},Xf={title:"表情集合配置",description:"选择预设表情包或自定义表情图片。每个表情包包含21种不同情绪的表情。",noEmojiPack:"无表情包",noEmojiPackDescription:"不配置表情包,打包时只包含字体和背景资源。",presetEmojiPack:"预设表情包",customEmojiPack:"自定义表情包",selectPresetEmojiPack:"选择预设表情包",twemoji64:"Twemoji 64×64",twemoji32:"Twemoji 32×32",twemojiDescription:"来自Twitter的高质量表情符号集,适合清晰显示",twitterEmojiName:"Twemoji {size}x{size}",twitterEmojiDescription:"Twitter表情包,{size}×{size}像素",notoEmojiName:"Noto Emoji {size}x{size}",notoEmojiDescription:"Google Noto 动画表情包,{size}×{size}像素(需要 PSRAM)",size:"尺寸",preview:"预览",select:"选择",customEmojiTitle:"自定义表情包",customEmojiDescription:"上传您自己的表情图片。每种情绪需要一张图片。",uploadInstructions:"点击或拖拽上传表情图片 (PNG/JPG/WEBP)",supportedFormats:"支持格式: PNG, JPG, WEBP。推荐尺寸: 64×64像素",emotionMapping:"情绪映射",uploadAllEmotions:"请为所有情绪上传表情图片",maxImageWidth:"最大图片宽度 (px)",maxImageHeight:"最大图片高度 (px)",clickToUpload:"点击上传",orDragDrop:"或拖拽上传",clickToUploadOrDrag:"点击上传或拖拽到此处",remove:"移除",replace:"替换",selectValidEmojiImage:"请选择有效的表情图片文件",selectValidFormat:"请选择有效的PNG或GIF格式图片",maxFileSize:"文件大小不能超过1MB",invalidFormat:"不支持的图片格式。请使用PNG、JPG或WEBP。",required:"必需",uploadEmojiImages:"上传表情图片(GIF 需要 PSRAM)",customEmojiPackConfig:"自定义表情包配置",neutralRequiredNotice:"* 必须上传 neutral 默认表情,其他表情可选。如果不上传其他表情,将使用默认表情代替。",sharedFileMessage:"表情 {emotionKey} 使用了与 {existingEmotions} 相同的图片文件(共享存储)",fileDeleted:"文件 {fileHash} 已删除(无其他表情引用)",fileRetained:"文件 {fileHash} 仍被其他表情使用,保留文件",imageLoadFailed:"表情图片加载失败",emotions:{neutral:"默认",happy:"开心",laughing:"大笑",funny:"搞笑",sad:"伤心",angry:"生气",crying:"哭泣",loving:"喜爱",embarrassed:"尴尬",surprised:"惊讶",shocked:"震惊",thinking:"思考",winking:"眨眼",cool:"酷炫",relaxed:"放松",delicious:"美味",kissy:"飞吻",confident:"自信",sleepy:"困倦",silly:"调皮",confused:"困惑"}},zf={title:"字体配置",description:"选择预设字体或上传自定义字体文件。",noFonts:"无字体",noFontsDescription:"不使用字体配置,设备将使用默认字体",presetFonts:"预设字体",customFonts:"自定义字体",selectPresetFont:"选择预设字体",fontSize:"字号:",bitDepth:"位深:",charset:"字符集:",fileSize:"文件大小:",customFontConfig:"自定义字体配置",fontFile:"字体文件",clickSelectFontFile:"点击选择字体文件",orDragFileHere:"或拖拽文件到此处",supportedFormats:"支持 TTF, WOFF, WOFF2 格式",removeFile:"移除文件",fontSizePx:"字号 (px)",range:"范围:",bitDepthBpp:"位深 (BPP)",monochrome:"1 bpp (单色)",fourColors:"2 bpp (4色)",sixteenColors:"4 bpp (16色)",characterSet:"字符集",deepseekR1:"DeepSeek R1 (7405字符)",gb2312:"GB2312 (7445字符)",qwen18409:"Qwen (18409字符)",latin1:"Latin1 (190字符)",fullCharset:"完整字符集 (字体文件的所有字符)",hideSubtitle:"隐藏字幕",hideSubtitleDescription:"对话时不显示实时文字字幕",selectValidFontFile:"请选择有效的字体文件 (TTF, WOFF, WOFF2)",presetFontNames:{font_puhui_deepseek_14_1:"阿里巴巴普惠体 14px",font_puhui_deepseek_16_4:"阿里巴巴普惠体 16px",font_puhui_deepseek_20_4:"阿里巴巴普惠体 20px",font_puhui_deepseek_30_4:"阿里巴巴普惠体 30px",font_noto_qwen_14_1:"思源黑体 14px",font_noto_qwen_16_4:"思源黑体 16px",font_noto_qwen_20_4:"思源黑体 20px",font_noto_qwen_30_4:"思源黑体 30px"},charsetDeepseek:"DeepSeek 7405",charsetQwen:"Qwen 18409"},$f={title:"唤醒词配置",description:"选择预设唤醒词模型或通过命令词模型自定义唤醒词。",supportWakeNet9:"您的芯片支持 WakeNet9 模型。",supportWakeNet9s:"您的芯片支持 WakeNet9s 模型。",notSupported:"您的芯片不支持唤醒词功能。",notice:"注意:",unsupportedMessage:"{chipModel} 芯片不支持唤醒词功能。如需使用唤醒词,请选择 ESP32-S3、ESP32-P4 或 ESP32-C3/C5/C6 芯片。",noWakeword:"关闭唤醒",presetWakeword:"预设唤醒词",customWakeword:"自定义唤醒词",selectWakeword:"选择唤醒词",placeholder:"选择唤醒词...",customSettings:"自定义唤醒词设置",wakewordName:"唤醒词名称",wakewordNamePlaceholder:"例如:小智 / Potato",wakewordCommand:"唤醒命令",wakewordCommandPlaceholderCN:"拼音空格隔开,例如:ni hao xiao zhi",wakewordCommandPlaceholderEN:"英文单词,不能包含标点,例如:HELLO POTATO",threshold:"灵敏度阈值 (0-100)",thresholdDesc:"越小越灵敏,默认 20",duration:"识别时长",durationDesc:"命令词最长持续时间",selectModel:"选择识别模型",mn6cn:"MultiNet6 (中文)",mn6en:"MultiNet6 (英文)",mn7cn:"MultiNet7 (中文)",mn7en:"MultiNet7 (英文)",errors:{nameRequired:"请输入唤醒词名称",commandRequired:"请输入唤醒命令",noPunctuation:"命令不能包含标点符号",durationRange:"时长需在 500-10000ms 之间"},tips:{tipLabel:"提示:",optional:"唤醒词是可选的,关闭后设备将无法通过语音唤醒。",wakeNet9sOnly:"C3/C5/C6 芯片仅支持 WakeNet9s 轻量级模型。",wakeNet9Full:"S3/P4 芯片支持完整的 WakeNet9 模型,选择更多。",customSupport:"自定义唤醒词使用 MultiNet 模型实现,目前仅支持 ESP32-S3 芯片。"}},Ah={app:xf,common:Jf,header:Tf,configNotice:Hf,steps:Yf,generateModal:_f,progressSteps:Kf,errors:Of,flashProgress:Pf,device:Vf,chipConfig:Wf,themeDesign:qf,generateSummary:jf,backgroundConfig:Zf,emojiConfig:Xf,fontConfig:zf,wakewordConfig:$f},eh={title:"小智 AI 自訂"},th={cancel:"取消",confirm:"確認",close:"關閉",start:"開始",download:"下載",generate:"生成",reset:"重置",yes:"是",no:"否",loading:"載入中...",error:"錯誤",success:"成功",warning:"警告",info:"資訊",next:"下一步",previous:"上一步",finish:"完成",retry:"重試",ok:"確定",other:"其他",back:"返回"},ih={title:"小智 AI 自訂"},oh={title:"檢測到已儲存的配置",message:"配置已自動恢復,您可以繼續之前的進度或重新開始。",restart:"重新開始"},nh={chip:"晶片配置",theme:"主題設計",generate:"效果預覽"},rh={title:"生成 assets.bin",confirmConfig:"請確認您的配置",chipModel:"晶片型號:",resolution:"解析度:",wakeword:"喚醒詞:",font:"字體:",emoji:"表情包:",fileList:"包含的檔案列表",estimated:"預估",compressed:"壓縮前",generating:"正在生成 assets.bin...",progress:"{progress}% 完成",completed:"您的 assets.bin 檔案已準備就緒",filename:"檔案名: assets.bin",fileSize:"檔案大小: {size}",generationTime:"生成時間: {time}",downloadAssets:"下載 assets.bin",flashToDevice:"線上燒錄到設備",flashing:"正在燒錄到設備...",flashingCancel:"取消燒錄",flashingError:"燒錄錯誤",flashingInProgress:"燒錄中,請勿關閉視窗",customFont:"自訂字體",customEmoji:"自訂表情套件",notConfigured:"未設定",wakewordNames:{wn9s_hilexin:"Hi,樂鑫",wn9s_hiesp:"Hi,ESP",wn9s_nihaoxiaozhi:"你好小智",wn9_nihaoxiaozhi_tts:"你好小智",wn9_alexa:"Alexa"}},gh={init:"初始化生成器",font:"處理字體檔案",wakeword:"打包喚醒詞模型",emoji:"處理表情圖片",background:"處理背景圖片",index:"生成索引檔案",spiffs:"建構SPIFFS映射",package:"完成打包"},sh={title:"喚醒詞配置",description:"選擇預設喚醒詞模型或透過命令詞模型自訂喚醒詞。",supportWakeNet9:"您的晶片支援 WakeNet9 模型。",supportWakeNet9s:"您的晶片支援 WakeNet9s 模型。",notSupported:"您的晶片不支援喚醒詞功能。",notice:"注意:",unsupportedMessage:"{chipModel} 晶片不支援喚醒詞功能。如需使用喚醒詞,請選擇 ESP32-S3、ESP32-P4 或 ESP32-C3/C5/C6 晶片。",noWakeword:"關閉喚醒",presetWakeword:"預設喚醒詞",customWakeword:"自訂喚醒詞",selectWakeword:"選擇喚醒詞",placeholder:"選擇喚醒詞...",customSettings:"自訂喚醒詞設定",wakewordName:"喚醒詞名稱",wakewordNamePlaceholder:"例如:小智 / Potato",wakewordCommand:"喚醒命令",wakewordCommandPlaceholderCN:"拼音空格隔開,例如:ni hao xiao zhi",wakewordCommandPlaceholderEN:"英文單詞,不能包含標點,例如:HELLO POTATO",threshold:"靈敏度閾值 (0-100)",thresholdDesc:"越小越靈敏,預設 20",duration:"識別時長",durationDesc:"命令詞最長持續時間",selectModel:"選擇識別模型",mn6cn:"MultiNet6 (中文)",mn6en:"MultiNet6 (英文)",mn7cn:"MultiNet7 (中文)",mn7en:"MultiNet7 (英文)",errors:{nameRequired:"請輸入喚醒詞名稱",commandRequired:"請輸入喚醒命令",noPunctuation:"命令不能包含標點符號",durationRange:"時長需在 500-10000ms 之間"},tips:{tipLabel:"提示:",optional:"喚醒詞是可選的,關閉後裝置將無法透過語音喚醒。",wakeNet9sOnly:"C3/C5/C6 晶片僅支援 WakeNet9s 輕量級模型。",wakeNet9Full:"S3/P4 晶片支援完整的 WakeNet9 模型,選擇更多。",customSupport:"自訂喚醒詞使用 MultiNet 模型實現,目前僅支援 ESP32-S3 晶片。"}},ah={resetFailed:"重置失敗,請重新整理頁面重試",generationFailed:"生成失敗: {error}",noFileToDownload:"沒有可下載的檔案",deviceOffline:"設備離線,無法進行燒錄",fileTooLarge:"燒錄失敗:檔案大小 {fileSize}MB 超過 assets 分區大小 {partitionSize}MB,請減少配置內容或使用更大容量的設備。",flashCancelConfirm:"確定要取消燒錄嗎?",oldDataCleared:`檢測到舊版本的表情資料結構已被清除。 新版本使用檔案去重技術,可以節省儲存空間。 請重新上傳自訂表情圖片。`,incompatibleEmojiData:"檢測到不相容的表情資料,請重新配置"},Ih={authTokenMissing:"未找到認證令牌",checkingDeviceStatus:"檢查設備狀態...",deviceOfflineOrUnresponsive:"設備不存在或不線上",unableToGetDeviceStatus:"無法獲取設備狀態",initializingTransferService:"初始化傳輸服務...",initializeTransferFailed:"初始化傳輸服務失敗: {error}",uploadingFile:"上傳文件中...",uploadFailed:"上傳文件失敗",settingDeviceDownloadUrl:"設置設備下載URL...",setDownloadUrlFailed:"設置下載URL失敗: {error}",rebootingDevice:"重啟設備...",waitingForDeviceReboot:"等待設備重啟...",deviceRebootTimeout:"等待設備重啟超時(60秒)",deviceReady:"设备就绪,请等待程序烧录",startingFileTransfer:"開始檔案傳輸...",flashCompleted:"程式燒錄中,請留意固件的燒錄狀態!",onlineFlashFailed:"線上燒錄失敗: {error}"},Ch={online:"線上",offline:"離線",checking:"檢查中...",flashing:"燒錄中...",ready:"就緒",chip:"晶片",board:"開發板",flash:"Flash",screen:"螢幕",signal:{unknown:"未知",strong:"強",medium:"中等",weak:"弱",none:"無訊號"}},lh={title:"步驟 1: 晶片型號和螢幕配置",loadingFromDevice:"正在從設備讀取硬體配置...",loadedFromDevice:"已從設備自動讀取硬體配置",manualConfig:"請手動配置硬體參數",loadingTitle:"正在載入設備配置...",loadingDesc:"從設備讀取晶片型號和螢幕解析度",autoLoadedTitle:"設備配置已自動載入",chipModel:"晶片型號",screenWidth:"螢幕寬度",screenHeight:"螢幕高度",colorFormat:"顏色格式:",manualEdit:"手動修改配置",collapseManual:"收起手動配置",manualConfigTitle:"手動配置硬體參數",next:"下一步",selectChip:"請選擇晶片",chipRequired:"晶片型號",widthRequired:"螢幕寬度",heightRequired:"螢幕高度",loadingError:"載入配置時發生錯誤",deviceOffline:"設備未連接或離線",chipModelError:"無法獲取晶片型號,請手動輸入",resolutionError:"無法獲取螢幕解析度,請手動輸入",timeoutError:"載入設備配置超時,請手動輸入",manualConfigDesc:"無法自動讀取設備配置",manualConfigHint:"設備未連接或離線,請手動輸入硬體配置",manualConfigRequired:"請手動輸入硬體配置",resolutionFormatError:"螢幕解析度格式錯誤"},Bh={title:"步驟 2: 主題設計",description:"配置喚醒詞、字體、表情和背景來自訂您的小智AI主題。",previous:"上一步",next:"下一步",tabs:{wakeword:"喚醒詞配置",font:"字體配置",emoji:"表情集合",background:"聊天背景"}},Qh={title:"步驟 3: 效果預覽",description:"預覽您的自訂配置在實際設備上的效果。",devicePreview:"設備預覽 (1:1 像素比例)",previewSettings:"預覽設定",previewText:"預覽文字",defaultPreviewText:"你好,我是你的朋友小智!",currentEmotion:"當前表情",themeMode:"主題模式",lightMode:"淺色",darkMode:"深色",configSummary:"配置摘要",wakeword:"喚醒詞:",font:"字體:",loading:"載入中...",emotion:"表情:",skin:"皮膚:",previous:"上一步",generate:"生成 assets.bin",emotions:{neutral:"預設",happy:"開心",laughing:"大笑",funny:"搞笑",sad:"傷心",angry:"生氣",crying:"哭泣",loving:"喜愛",embarrassed:"尷尬",surprised:"驚訝",shocked:"震驚",thinking:"思考",winking:"眨眼",cool:"酷炫",relaxed:"放鬆",delicious:"美味",kissy:"飛吻",confident:"自信",sleepy:"睏倦",silly:"調皮",confused:"困惑"},noEmotionConfigured:"未配置表情",fontLoading:"字體載入中...",configureEmojiFirst:"請先在主題設計中配置表情包",customFont:"自訂字體 {size}px",customEmoji:"自訂表情 {count}張",notConfigured:"未配置",skinLight:"淺色{type}",skinDark:"深色{type}",hideSubtitle:"隱藏字幕:",image:"圖片",color:"顏色"},ch={title:"聊天背景配置",description:"配置淺色模式和深色模式的聊天背景,支援純色或自訂圖片。",lightMode:"淺色模式背景",darkMode:"深色模式背景",solidBackground:"純色背景",imageBackground:"圖片背景",backgroundColor:"背景顏色:",textColor:"文字顏色:",backgroundImage:"背景圖片:",clickOrDragToUpload:"點擊或拖拽上傳背景圖片",removeImage:"移除圖片",backgroundPreview:"背景預覽",lightModePreview:"淺色模式",darkModePreview:"深色模式",chatArea:"聊天內容區域",quickConfig:"快捷配置",defaultColors:"預設配色",stoneTexture:"石墨質感",sunnyColors:"暖陽配色",skyBlue:"天空藍調",romanticPink:"浪漫粉色",selectValidImage:"請選擇有效的圖片檔案"},Eh={title:"表情集合配置",description:"選擇預設表情包或自定義表情圖片。每個表情包包含21種不同情緒的表情。",noEmojiPack:"無表情包",noEmojiPackDescription:"不配置表情包,打包時只包含字體和背景資源。",presetEmojiPack:"預設表情包",customEmojiPack:"自定義表情包",selectPresetEmojiPack:"選擇預設表情包",twemoji64:"Twemoji 64×64",twemoji32:"Twemoji 32×32",twemojiDescription:"來自Twitter的高品質表情符號集,適合清晰顯示",twitterEmojiName:"Twemoji {size}x{size}",twitterEmojiDescription:"Twitter表情包,{size}×{size}像素",notoEmojiName:"Noto Emoji {size}x{size}",notoEmojiDescription:"Google Noto 動畫表情包,{size}×{size}像素(需要 PSRAM)",size:"尺寸",preview:"預覽",select:"選擇",customEmojiTitle:"自定義表情包",customEmojiDescription:"上傳您自己的表情圖片。每種情緒需要一張圖片。",uploadInstructions:"點擊或拖拽上傳表情圖片 (PNG/JPG/WEBP)",supportedFormats:"支援格式: PNG, JPG, WEBP。推薦尺寸: 64×64像素",emotionMapping:"情緒映射",uploadAllEmotions:"請為所有情緒上傳表情圖片",maxImageWidth:"最大圖片寬度 (px)",maxImageHeight:"最大圖片高度 (px)",clickToUpload:"點擊上傳",orDragDrop:"或拖拽上傳",clickToUploadOrDrag:"點擊上傳或拖拽到此處",remove:"移除",replace:"替換",selectValidEmojiImage:"請選擇有效的表情圖片檔案",selectValidFormat:"請選擇有效的PNG或GIF格式圖片",maxFileSize:"檔案大小不能超過1MB",invalidFormat:"不支援的圖片格式。請使用PNG、JPG或WEBP。",required:"必需",uploadEmojiImages:"上傳表情圖片(GIF 需要 PSRAM)",customEmojiPackConfig:"自定義表情包配置",neutralRequiredNotice:"* 必須上傳 neutral 預設表情,其他表情可選。如果不上傳其他表情,將使用預設表情代替。",sharedFileMessage:"表情 {emotionKey} 使用了與 {existingEmotions} 相同的圖片檔案(共享儲存)",fileDeleted:"檔案 {fileHash} 已刪除(無其他表情引用)",fileRetained:"檔案 {fileHash} 仍被其他表情使用,保留檔案",imageLoadFailed:"表情圖片載入失敗",emotions:{neutral:"預設",happy:"開心",laughing:"大笑",funny:"搞笑",sad:"傷心",angry:"生氣",crying:"哭泣",loving:"喜愛",embarrassed:"尷尬",surprised:"驚訝",shocked:"震驚",thinking:"思考",winking:"眨眼",cool:"酷炫",relaxed:"放鬆",delicious:"美味",kissy:"飛吻",confident:"自信",sleepy:"睏倦",silly:"調皮",confused:"困惑"}},uh={title:"字體配置",description:"選擇預設字體或上傳自訂字體檔案。",noFonts:"無字體",noFontsDescription:"不使用字體配置,裝置將使用預設字體",presetFonts:"預設字體",customFonts:"自訂字體",selectPresetFont:"選擇預設字體",fontSize:"字號:",bitDepth:"位元深度:",charset:"字元集:",fileSize:"檔案大小:",customFontConfig:"自訂字體配置",fontFile:"字體檔案",clickSelectFontFile:"點擊選擇字體檔案",orDragFileHere:"或拖拽檔案到此處",supportedFormats:"支援 TTF, WOFF, WOFF2 格式",removeFile:"移除檔案",fontSizePx:"字號 (px)",range:"範圍:",bitDepthBpp:"位元深度 (BPP)",monochrome:"1 bpp (單色)",fourColors:"2 bpp (4色)",sixteenColors:"4 bpp (16色)",characterSet:"字元集",deepseekR1:"DeepSeek R1 (7405字元)",gb2312:"GB2312 (7445字元)",qwen18409:"Qwen (18409字元)",latin1:"Latin1 (190字元)",fullCharset:"完整字元集 (字體檔案的所有字元)",hideSubtitle:"隱藏字幕",hideSubtitleDescription:"對話時不顯示即時文字字幕",selectValidFontFile:"請選擇有效的字體檔案 (TTF, WOFF, WOFF2)",presetFontNames:{font_puhui_deepseek_14_1:"阿里巴巴普惠體 14px",font_puhui_deepseek_16_4:"阿里巴巴普惠體 16px",font_puhui_deepseek_20_4:"阿里巴巴普惠體 20px",font_puhui_deepseek_30_4:"阿里巴巴普惠體 30px",font_noto_qwen_14_1:"思源黑體 14px",font_noto_qwen_16_4:"思源黑體 16px",font_noto_qwen_20_4:"思源黑體 20px",font_noto_qwen_30_4:"思源黑體 30px"},charsetDeepseek:"DeepSeek 7405",charsetQwen:"Qwen 18409"},fh={app:eh,common:th,header:ih,configNotice:oh,steps:nh,generateModal:rh,progressSteps:gh,wakewordConfig:sh,errors:ah,flashProgress:Ih,device:Ch,chipConfig:lh,themeDesign:Bh,generateSummary:Qh,backgroundConfig:ch,emojiConfig:Eh,fontConfig:uh},hh={title:"小智 AI カスタマイズ"},dh={cancel:"キャンセル",confirm:"確認",close:"閉じる",start:"開始",download:"ダウンロード",generate:"生成",reset:"リセット",yes:"はい",no:"いいえ",loading:"読み込み中...",error:"エラー",success:"成功",warning:"警告",info:"情報",next:"次へ",previous:"前へ",finish:"完了",retry:"再試行",ok:"OK",other:"その他",back:"戻る"},ph={title:"小智 AI カスタマイズ"},mh={title:"保存された設定を検出",message:"設定が自動的に復元されました。中断したところから続行するか、最初からやり直すことができます。",restart:"最初からやり直す"},yh={chip:"チップ設定",theme:"テーマデザイン",generate:"プレビュー&生成"},wh={title:"assets.binを生成",confirmConfig:"設定を確認してください",chipModel:"チップモデル:",resolution:"解像度:",wakeword:"ウェイクワード:",font:"フォント:",emoji:"絵文字パック:",fileList:"含まれるファイル一覧",estimated:"推定",compressed:"圧縮前",generating:"assets.binを生成中...",progress:"{progress}% 完了",completed:"assets.binファイルの準備ができました",filename:"ファイル名: assets.bin",fileSize:"ファイルサイズ: {size}",generationTime:"生成時間: {time}",downloadAssets:"assets.binをダウンロード",flashToDevice:"デバイスにオンライン書き込み",flashing:"デバイスに書き込み中...",flashingCancel:"書き込みをキャンセル",flashingError:"書き込みエラー",flashingInProgress:"書き込み中、ウィンドウを閉じないでください",customFont:"カスタムフォント",customEmoji:"カスタム絵文字パック",notConfigured:"未設定",wakewordNames:{wn9s_hilexin:"Hi, Espressif",wn9s_hiesp:"Hi, ESP",wn9s_nihaoxiaozhi:"こんにちは小智",wn9_nihaoxiaozhi_tts:"こんにちは小智",wn9_alexa:"アレクサ"}},Dh={init:"ジェネレーターを初期化",font:"フォントファイルを処理",wakeword:"ウェイクワードモデルをパッケージ化",emoji:"絵文字画像を処理",background:"背景画像を処理",index:"インデックスファイルを生成",spiffs:"SPIFFSマッピングを構築",package:"パッケージ化を完了"},kh={title:"ウェイクワード設定",description:"プリセットのウェイクワードを選択するか、コマンド認識モデルを使用してカスタマイズします。",supportWakeNet9:"チップはWakeNet9モデルをサポートしています。",supportWakeNet9s:"チップはWakeNet9sモデルをサポートしています。",notSupported:"チップはウェイクワード機能をサポートしていません。",notice:"注意:",unsupportedMessage:"{chipModel}チップはウェイクワード機能をサポートしていません。ウェイクワードを使用する必要がある場合は、ESP32-S3、ESP32-P4、またはESP32-C3/C5/C6チップを選択してください。",noWakeword:"起動を無効にする",presetWakeword:"プリセット",customWakeword:"カスタム",selectWakeword:"ウェイクワードを選択",placeholder:"選択してください...",customSettings:"カスタムウェイクワード設定",wakewordName:"ウェイクワード名",wakewordNamePlaceholder:"例:小智 / Potato",wakewordCommand:"ウェイクコマンド",wakewordCommandPlaceholderCN:"ピンインをスペースで区切る。例:ni hao xiao zhi",wakewordCommandPlaceholderEN:"英語の単語。句読点は含めない。例:HELLO POTATO",threshold:"感度しきい値 (0-100)",thresholdDesc:"値が小さいほど感度が高くなります。デフォルトは20",duration:"認識時間",durationDesc:"コマンド認識の最大継続時間",selectModel:"認識モデルを選択",mn6cn:"MultiNet6 (中国語)",mn6en:"MultiNet6 (英語)",mn7cn:"MultiNet7 (中国語)",mn7en:"MultiNet7 (英語)",errors:{nameRequired:"ウェイクワード名を入力してください",commandRequired:"ウェイクコマンドを入力してください",noPunctuation:"コマンドに句読点を含めることはできません",durationRange:"時間は500〜10000msの間で設定してください"},tips:{tipLabel:"ヒント:",optional:"ウェイクワードはオプションです。無効にすると、デバイスは音声で起動できなくなります。",wakeNet9sOnly:"C3/C5/C6チップはWakeNet9s軽量モデルしかサポートしていません。",wakeNet9Full:"S3/P4チップは完全なWakeNet9モデルをサポートし、より多くの選択肢があります。",customSupport:"カスタムウェイクワードはMultiNetモデルを使用しており、現在はESP32-S3チップのみをサポートしています。"}},vh={resetFailed:"リセットに失敗しました、ページを更新して再試行してください",generationFailed:"生成に失敗しました: {error}",noFileToDownload:"ダウンロード可能なファイルがありません",deviceOffline:"デバイスがオフラインで書き込みできません",fileTooLarge:"書き込みに失敗しました: ファイルサイズ{fileSize}MBがassetsパーティションサイズ{partitionSize}MBを超えています。設定内容を減らすか、より大容量のデバイスを使用してください。",flashCancelConfirm:"書き込みをキャンセルしてもよろしいですか?",oldDataCleared:`古いバージョンの絵文字データ構造が検出され、クリアされました。 新しいバージョンはファイル重複除去技術を使用してストレージスペースを節約します。 カスタム絵文字画像を再アップロードしてください。`,incompatibleEmojiData:"互換性のない絵文字データを検出しました、再設定してください"},Fh={authTokenMissing:"認証トークンが見つかりません",checkingDeviceStatus:"デバイスの状態を確認中...",deviceOfflineOrUnresponsive:"デバイスが存在しないか、オンラインではありません",unableToGetDeviceStatus:"デバイスの状態を取得できません",initializingTransferService:"転送サービスを初期化中...",initializeTransferFailed:"転送サービスの初期化に失敗しました: {error}",uploadingFile:"ファイルをアップロード中...",uploadFailed:"ファイルのアップロードに失敗しました",settingDeviceDownloadUrl:"デバイスダウンロードURLを設定中...",setDownloadUrlFailed:"ダウンロードURLの設定に失敗しました: {error}",rebootingDevice:"デバイスを再起動中...",waitingForDeviceReboot:"デバイスの再起動を待機中...",deviceRebootTimeout:"デバイスの再起動タイムアウト(60秒)",deviceReady:"デバイスが準備できました。プログラムの書き込みをお待ちください",startingFileTransfer:"ファイル転送を開始中...",flashCompleted:"プログラムの書き込み中、ファームウェアの書き込み状態に注意してください!",onlineFlashFailed:"オンライン書き込みに失敗しました: {error}"},Sh={online:"オンライン",offline:"オフライン",checking:"確認中...",flashing:"書き込み中...",ready:"準備完了",chip:"チップ",board:"ボード",flash:"Flash",screen:"画面",signal:{unknown:"不明",strong:"強",medium:"中",weak:"弱",none:"信号なし"}},Rh={title:"ステップ1: チップモデルと画面設定",loadingFromDevice:"デバイスからハードウェア設定を読み込み中...",loadedFromDevice:"デバイスからハードウェア設定が自動読み込みされました",manualConfig:"ハードウェアパラメータを手動で設定してください",loadingTitle:"デバイス設定を読み込み中...",loadingDesc:"デバイスからチップモデルと画面解像度を読み取り中",autoLoadedTitle:"デバイス設定が自動読み込みされました",chipModel:"チップモデル",screenWidth:"画面幅",screenHeight:"画面高",colorFormat:"色形式:",manualEdit:"手動設定",collapseManual:"手動設定を折りたたむ",manualConfigTitle:"手動ハードウェア設定",next:"次へ",selectChip:"チップを選択",chipRequired:"チップモデル",widthRequired:"画面幅",heightRequired:"画面高",loadingError:"設定読み込みエラー",deviceOffline:"デバイスが接続されていないかオフラインです",chipModelError:"チップモデルを取得できません、手動で入力してください",resolutionError:"画面解像度を取得できません、手動で入力してください",timeoutError:"設定読み込みタイムアウト、手動で入力してください",manualConfigDesc:"デバイスの設定を自動読み取りできません",manualConfigHint:"デバイスが接続されていないかオフラインです、ハードウェア設定を手動で入力してください",manualConfigRequired:"ハードウェア設定を手動で入力してください",resolutionFormatError:"画面解像度形式エラー"},bh={title:"ステップ2: テーマデザイン",description:"ウェイクワード、フォント、絵文字、背景を設定して、小智AIテーマをカスタマイズします。",previous:"前へ",next:"次へ",tabs:{wakeword:"ウェイクワード設定",font:"フォント設定",emoji:"絵文字コレクション",background:"チャット背景"}},Nh={title:"ステップ3: プレビュー",description:"実際のデバイスでのカスタム設定の効果をプレビューします。",devicePreview:"デバイスプレビュー(1:1ピクセル比)",previewSettings:"プレビュー設定",previewText:"プレビューテキスト",defaultPreviewText:"こんにちは、私はあなたの友人、シャオズーです!",currentEmotion:"現在の感情",themeMode:"テーマモード",lightMode:"ライト",darkMode:"ダーク",configSummary:"設定概要",wakeword:"ウェイクワード:",font:"フォント:",loading:"読み込み中...",emotion:"感情:",skin:"スキン:",previous:"前へ",generate:"assets.binを生成",emotions:{neutral:"中立",happy:"幸せ",laughing:"大笑い",funny:"面白い",sad:"悲しい",angry:"怒り",crying:"泣き",loving:"愛情",embarrassed:"恥ずかしい",surprised:"驚き",shocked:"ショック",thinking:"考え中",winking:"ウインク",cool:"クール",relaxed:"リラックス",delicious:"美味しい",kissy:"キス",confident:"自信",sleepy:"眠い",silly:"ばかげた",confused:"混乱"},noEmotionConfigured:"感情が設定されていません",fontLoading:"フォント読み込み中...",configureEmojiFirst:"テーマデザインで絵文字パックを設定してください",customFont:"カスタムフォント {size}px",customEmoji:"カスタム絵文字 {count}画像",notConfigured:"未設定",skinLight:"ライト{type}",skinDark:"ダーク{type}",hideSubtitle:"字幕を隠す:",image:"画像",color:"色"},Gh={title:"チャット背景設定",description:"ライトモードとダークモードのチャット背景を設定し、単色またはカスタム画像をサポートします。",lightMode:"ライトモード背景",darkMode:"ダークモード背景",solidBackground:"単色背景",imageBackground:"画像背景",backgroundColor:"背景色:",textColor:"文字色:",backgroundImage:"背景画像:",clickOrDragToUpload:"クリックまたはドラッグして背景画像をアップロード",removeImage:"画像を削除",backgroundPreview:"背景プレビュー",lightModePreview:"ライトモード",darkModePreview:"ダークモード",chatArea:"チャットコンテンツエリア",quickConfig:"クイック設定",defaultColors:"デフォルト色",stoneTexture:"石質感",sunnyColors:"晴れ色",skyBlue:"空色",romanticPink:"ロマンチックピンク",selectValidImage:"有効な画像ファイルを選択してください"},Lh={title:"絵文字コレクション設定",description:"プリセット絵文字パックを選択するか、カスタム絵文字画像をアップロードします。各絵文字パックには21種類の異なる感情表現が含まれます。",noEmojiPack:"絵文字パックなし",noEmojiPackDescription:"絵文字パックを設定せず、パッケージにはフォントと背景リソースのみを含めます。",presetEmojiPack:"プリセット絵文字パック",customEmojiPack:"カスタム絵文字パック",selectPresetEmojiPack:"プリセット絵文字パックを選択",twemoji64:"Twemoji 64×64",twemoji32:"Twemoji 32×32",twemojiDescription:"Twitterの高品質絵文字セット、鮮明な表示に最適",twitterEmojiName:"Twemoji {size}x{size}",twitterEmojiDescription:"Twitter絵文字パック、{size}×{size}ピクセル",size:"サイズ",preview:"プレビュー",select:"選択",customEmojiTitle:"カスタム絵文字パック",customEmojiDescription:"独自の絵文字画像をアップロードします。各感情に1つの画像が必要です。",uploadInstructions:"クリックまたはドラッグして絵文字画像をアップロード(PNG/JPG/WEBP)",supportedFormats:"サポート形式: PNG, JPG, WEBP。推奨サイズ: 64×64ピクセル",emotionMapping:"感情マッピング",uploadAllEmotions:"すべての感情の絵文字画像をアップロードしてください",maxImageWidth:"最大画像幅(px)",maxImageHeight:"最大画像高(px)",clickToUpload:"クリックしてアップロード",orDragDrop:"またはドラッグ&ドロップ",clickToUploadOrDrag:"クリックしてアップロードまたはここにドラッグ",remove:"削除",replace:"置き換え",selectValidEmojiImage:"有効な絵文字画像ファイルを選択してください",selectValidFormat:"有効なPNGまたはGIF形式の画像を選択してください",maxFileSize:"ファイルサイズは1MBを超えないでください",invalidFormat:"サポートされていない画像形式です。PNG、JPG、またはWEBPを使用してください。",required:"必須",uploadEmojiImages:"絵文字画像をアップロード(GIFにはPSRAMが必要)",customEmojiPackConfig:"カスタム絵文字パック設定",neutralRequiredNotice:"* 中立のデフォルト感情をアップロードする必要があります、他の感情はオプションです。アップロードしない場合、デフォルト感情が代わりに使用されます。",sharedFileMessage:"感情{emotionKey}は{existingEmotions}と同じ画像ファイルを使用しています(共有ストレージ)",fileDeleted:"ファイル{fileHash}が削除されました(他の感情参照なし)",fileRetained:"ファイル{fileHash}は他の感情でまだ使用されているため、保持されます",imageLoadFailed:"絵文字画像の読み込みに失敗しました",emotions:{neutral:"中立",happy:"幸せ",laughing:"大笑い",funny:"面白い",sad:"悲しい",angry:"怒り",crying:"泣き",loving:"愛情",embarrassed:"恥ずかしい",surprised:"驚き",shocked:"ショック",thinking:"考え中",winking:"ウインク",cool:"クール",relaxed:"リラックス",delicious:"美味しい",kissy:"キス",confident:"自信",sleepy:"眠い",silly:"ばかげた",confused:"混乱"}},Uh={title:"フォント設定",description:"プリセットフォントを選択するか、カスタムフォントファイルをアップロードします。",noFonts:"フォントなし",noFontsDescription:"フォント設定を使用しない、デバイスはデフォルトのフォントを使用します",presetFonts:"プリセットフォント",customFonts:"カスタムフォント",selectPresetFont:"プリセットフォントを選択",fontSize:"フォントサイズ:",bitDepth:"ビット深度:",charset:"文字セット:",fileSize:"ファイルサイズ:",customFontConfig:"カスタムフォント設定",fontFile:"フォントファイル",clickSelectFontFile:"クリックしてフォントファイルを選択",orDragFileHere:"またはファイルをここにドラッグ",supportedFormats:"TTF、WOFF、WOFF2形式をサポート",removeFile:"ファイルを削除",fontSizePx:"フォントサイズ(px)",range:"範囲:",bitDepthBpp:"ビット深度(BPP)",monochrome:"1 bpp(モノクロ)",fourColors:"2 bpp(4色)",sixteenColors:"4 bpp(16色)",characterSet:"文字セット",deepseekR1:"DeepSeek R1(7405文字)",gb2312:"GB2312(7445文字)",qwen18409:"Qwen(18409文字)",latin1:"Latin1(190文字)",fullCharset:"完全な文字セット(フォントファイルのすべての文字)",hideSubtitle:"字幕を隠す",hideSubtitleDescription:"会話中にリアルタイム字幕を表示しない",selectValidFontFile:"有効なフォントファイルを選択してください(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"},Mh={app:hh,common:dh,header:ph,configNotice:mh,steps:yh,generateModal:wh,progressSteps:Dh,wakewordConfig:kh,errors:vh,flashProgress:Fh,device:Sh,chipConfig:Rh,themeDesign:bh,generateSummary:Nh,backgroundConfig:Gh,emojiConfig:Lh,fontConfig:Uh},xh={title:"Xiaozhi AI Tùy chỉnh"},Jh={cancel:"Hủy",confirm:"Xác nhận",close:"Đóng",start:"Bắt đầu",download:"Tải xuống",generate:"Tạo",reset:"Đặt lại",yes:"Có",no:"Không",loading:"Đang tải...",error:"Lỗi",success:"Thành công",warning:"Cảnh báo",info:"Thông tin",next:"Tiếp theo",previous:"Trước đó",finish:"Hoàn thành",retry:"Thử lại",ok:"OK",other:"Khác",back:"trở về"},Th={title:"Xiaozhi AI Tùy chỉnh"},Hh={title:"Phát hiện cấu hình đã lưu",message:"Cấu hình đã được khôi phục tự động. Bạn có thể tiếp tục từ nơi đã dừng hoặc bắt đầu lại.",restart:"Bắt đầu lại"},Yh={chip:"Cấu hình chip",theme:"Thiết kế chủ đề",generate:"Xem trước & Tạo"},_h={title:"Tạo assets.bin",confirmConfig:"Vui lòng xác nhận cấu hình của bạn",chipModel:"Mô hình chip:",resolution:"Độ phân giải:",wakeword:"Từ đánh thức:",font:"Phông chữ:",emoji:"Gói biểu tượng cảm xúc:",fileList:"Danh sách tệp được bao gồm",estimated:"Ước tính",compressed:"Trước khi nén",generating:"Đang tạo assets.bin...",progress:"{progress}% Hoàn thành",completed:"Tệp assets.bin của bạn đã sẵn sàng",filename:"Tên tệp: assets.bin",fileSize:"Kích thước tệp: {size}",generationTime:"Thời gian tạo: {time}",downloadAssets:"Tải xuống assets.bin",flashToDevice:"Flash trực tuyến vào thiết bị",flashing:"Đang flash vào thiết bị...",flashingCancel:"Hủy flash",flashingError:"Lỗi flash",flashingInProgress:"Đang flash, vui lòng không đóng cửa sổ",customFont:"Phông chữ tùy chỉnh",customEmoji:"Gói biểu tượng cảm xúc tùy chỉnh",notConfigured:"Chưa cấu hình",wakewordNames:{wn9s_hilexin:"Hi, Espressif",wn9s_hiesp:"Hi, ESP",wn9s_nihaoxiaozhi:"Xin chào Xiaozhi",wn9_nihaoxiaozhi_tts:"Xin chào Xiaozhi",wn9_alexa:"Alexa"}},Kh={init:"Khởi tạo trình tạo",font:"Xử lý tệp phông chữ",wakeword:"Đóng gói mô hình từ đánh thức",emoji:"Xử lý hình ảnh biểu tượng cảm xúc",background:"Xử lý hình ảnh nền",index:"Tạo tệp chỉ mục",spiffs:"Xây dựng ánh xạ SPIFFS",package:"Hoàn thành đóng gói"},Oh={title:"Cấu hình từ đánh thức",description:"Chọn mô hình từ đánh thức đặt sẵn hoặc tùy chỉnh thông qua mô hình lệnh.",supportWakeNet9:"Chip của bạn hỗ trợ mô hình WakeNet9.",supportWakeNet9s:"Chip của bạn hỗ trợ mô hình WakeNet9s.",notSupported:"Chip của bạn không hỗ trợ chức năng từ đánh thức.",notice:"Lưu ý:",unsupportedMessage:"Chip {chipModel} không hỗ trợ chức năng từ đánh thức. Nếu bạn cần sử dụng từ đánh thức, vui lòng chọn chip ESP32-S3, ESP32-P4 hoặc ESP32-C3/C5/C6.",noWakeword:"Tắt đánh thức",presetWakeword:"Mặc định",customWakeword:"Tùy chỉnh",selectWakeword:"Chọn từ đánh thức",placeholder:"Chọn một từ...",customSettings:"Cài đặt từ đánh thức tùy chỉnh",wakewordName:"Tên từ đánh thức",wakewordNamePlaceholder:"VD: Xiaozhi / Potato",wakewordCommand:"Lệnh đánh thức",wakewordCommandPlaceholderCN:"Pinyin cách nhau bằng dấu cách, VD: ni hao xiao zhi",wakewordCommandPlaceholderEN:"Từ tiếng Anh, không dấu câu, VD: HELLO POTATO",threshold:"Ngưỡng nhạy (0-100)",thresholdDesc:"Càng nhỏ càng nhạy, mặc định là 20",duration:"Thời gian nhận diện",durationDesc:"Thời gian tối đa để nhận diện lệnh",selectModel:"Chọn mô hình nhận diện",mn6cn:"MultiNet6 (Tiếng Trung)",mn6en:"MultiNet6 (Tiếng Anh)",mn7cn:"MultiNet7 (Tiếng Trung)",mn7en:"MultiNet7 (Tiếng Anh)",errors:{nameRequired:"Vui lòng nhập tên từ đánh thức",commandRequired:"Vui lòng nhập lệnh đánh thức",noPunctuation:"Lệnh không thể chứa dấu câu",durationRange:"Thời gian phải từ 500-10000ms"},tips:{tipLabel:"Mẹo:",optional:"Từ đánh thức là tùy chọn. Nếu tắt, thiết bị sẽ không thể đánh thức bằng giọng nói.",wakeNet9sOnly:"Chip C3/C5/C6 chỉ hỗ trợ mô hình nhẹ WakeNet9s.",wakeNet9Full:"Chip S3/P4 hỗ trợ mô hình WakeNet9 hoàn chỉnh với nhiều lựa chọn hơn.",customSupport:"Từ đánh thức tùy chỉnh sử dụng mô hình MultiNet, hiện chỉ hỗ trợ chip ESP32-S3."}},Ph={resetFailed:"Đặt lại thất bại, vui lòng làm mới trang và thử lại",generationFailed:"Tạo thất bại: {error}",noFileToDownload:"Không có tệp nào để tải xuống",deviceOffline:"Thiết bị ngoại tuyến và không thể flash",fileTooLarge:"Flash thất bại: Kích thước tệp {fileSize}MB vượt quá kích thước phân vùng assets {partitionSize}MB. Vui lòng giảm nội dung cấu hình hoặc sử dụng thiết bị có dung lượng lớn hơn.",flashCancelConfirm:"Bạn có chắc chắn muốn hủy flash?",oldDataCleared:`Đã phát hiện và xóa cấu trúc dữ liệu biểu tượng cảm xúc phiên bản cũ. 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"},Vh={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}"},Wh={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"}},qh={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"},jh={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"}},Zh={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"},Xh={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ệ"},zh={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"}},$h={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"},Ad={app:xh,common:Jh,header:Th,configNotice:Hh,steps:Yh,generateModal:_h,progressSteps:Kh,wakewordConfig:Oh,errors:Ph,flashProgress:Vh,device:Wh,chipConfig:qh,themeDesign:jh,generateSummary:Zh,backgroundConfig:Xh,emojiConfig:zh,fontConfig:$h},ed={en:Mf,"zh-CN":Ah,"zh-TW":fh,ja:Mh,vi:Ad},No=[{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 td(){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 id={class:"relative"},od={class:"py-1"},nd=["onClick"],rd={class:"mr-3"},gd={key:0,class:"ml-auto w-4 h-4 text-blue-600",fill:"currentColor",viewBox:"0 0 20 20"},sd={__name:"LanguageSelector",setup(A){const{locale:e,t}=we(),i=uA(!1),o=hA(()=>No.find(a=>a.code===e.value)||No[0]),n=()=>{i.value=!i.value},r=()=>{i.value=!1},g=a=>{e.value=a,localStorage.setItem("user-language",a),document.title=t("app.title"),r()},s=a=>{a.target.closest(".relative")||r()};return Ft(()=>{document.addEventListener("click",s);const a=localStorage.getItem("user-language");a&&No.find(I=>I.code===a)&&(e.value=a)}),Ci(()=>{document.removeEventListener("click",s)}),(a,I)=>(T(),K("div",id,[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(o.value.flag),1),B("span",null,F(o.value.name),1),(T(),K("svg",{class:kA(["w-4 h-4 transition-transform duration-200",{"rotate-180":i.value}]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...I[1]||(I[1]=[B("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 9l-7 7-7-7"},null,-1)])],2))]),i.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:I[0]||(I[0]=dt(()=>{},["stop"]))},[B("div",od,[(T(!0),K(qA,null,Ke(cA(No),l=>(T(),K("button",{key:l.code,onClick:C=>g(l.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":l.code===o.value.code}])},[B("span",rd,F(l.flag),1),B("span",null,F(l.name),1),l.code===o.value.code?(T(),K("svg",gd,[...I[2]||(I[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)])])):CA("",!0)],10,nd))),128))])])):CA("",!0),i.value?(T(),K("div",{key:1,class:"fixed inset-0 z-40",onClick:r})):CA("",!0)]))}},ad={class:"space-y-6"},Id={class:"text-xl font-semibold text-gray-900 mb-4"},Cd={class:"text-gray-600 mb-6"},ld={key:0},Bd={key:1},Qd={key:2},cd={key:0,class:"space-y-4"},Ed={class:"bg-blue-50 border-2 border-blue-200 rounded-lg p-6"},ud={class:"flex items-center justify-center space-x-3"},fd={class:"text-lg font-medium text-blue-900"},hd={class:"text-sm text-blue-700 mt-1"},dd={key:1,class:"space-y-4"},pd={class:"bg-green-50 border-2 border-green-200 rounded-lg p-4"},md={class:"flex items-start justify-between mb-3"},yd={class:"flex items-center"},wd={class:"text-lg font-medium text-green-900"},Dd={class:"grid grid-cols-1 md:grid-cols-3 gap-4 mt-4"},kd={class:"bg-white rounded-lg p-3"},vd={class:"block text-sm font-medium text-gray-700 mb-1"},Fd={class:"text-base font-semibold text-gray-900"},Sd={class:"bg-white rounded-lg p-3"},Rd={class:"block text-sm font-medium text-gray-700 mb-1"},bd={class:"text-base font-semibold text-gray-900"},Nd={class:"bg-white rounded-lg p-3"},Gd={class:"block text-sm font-medium text-gray-700 mb-1"},Ld={class:"text-base font-semibold text-gray-900"},Ud={class:"mt-3 text-sm text-green-700"},Md={class:"border border-gray-200 rounded-lg p-4"},xd={key:0,class:"mt-4"},Jd={key:2,class:"space-y-4"},Td={class:"bg-yellow-50 border border-yellow-200 rounded-lg p-4"},Hd={class:"flex items-start"},Yd={class:"font-medium text-yellow-900"},_d={class:"text-sm text-yellow-700 mt-1"},Kd={class:"border-2 border-gray-300 rounded-lg p-4"},Od={class:"text-lg font-medium text-gray-900 mb-4"},Pd={class:"flex justify-end"},Vd=["disabled"],Wd={__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}=we(),i=e,o=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")}]),n={name:"ConfigForm",props:{config:{type:Object,required:!0},showRequired:{type:Boolean,default:!1}},render(){const d=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"},[d("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}},cA(o).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"},[d("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"},[d("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}=Nn(),a=uA(s.value),I=uA(!1),l=uA(""),C=uA(!1),Q=uA({model:"",display:{width:320,height:240,color:"RGB565"}}),f={"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"},h=()=>{var d,v;try{if(!g.value)return a.value||(l.value=t("chipConfig.deviceOffline"),I.value=!1),!1;const b=(d=r.value.chip)==null?void 0:d.model;if(!b||b==="未知")return!1;let N=f[b.toUpperCase()]||f[b]||b.toLowerCase().replace(/-/g,"");["esp32s3","esp32c3","esp32c5","esp32p4","esp32c6","esp32","others"].includes(N)||(N="others");const M=(v=r.value.screen)==null?void 0:v.resolution;if(!M||M==="未知")return!1;const[U,R]=M.split("x").map(Number);return!U||!R||isNaN(U)||isNaN(R)?(l.value=t("chipConfig.resolutionFormatError"),I.value=!1,a.value=!1,!1):(Q.value={model:N,display:{width:U,height:R,color:"RGB565"}},i("update:modelValue",{model:N,display:{width:U,height:R,color:"RGB565"}}),I.value=!0,l.value="",a.value=!1,console.log("✓ 设备配置加载成功:",{chip:N,width:U,height:R}),!0)}catch(b){return console.error("加载设备配置失败:",b),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},p=()=>{u.value&&i("next")};return ae(()=>Q.value,d=>{i("update:modelValue",{model:d.model,display:{...d.display}})},{deep:!0}),ae(()=>g.value,d=>{d&&!I.value&&(a.value=!0,l.value="",setTimeout(()=>{h()},100))}),ae(()=>[r.value.chip,r.value.screen],()=>{g.value&&!I.value&&h()},{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("✓ 检测到已缓存的设备信息,立即加载"),h()):g.value?(console.log("⏳ 设备在线,等待设备信息加载..."),a.value=!0,setTimeout(()=>{h()},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))}),(d,v)=>(T(),K("div",ad,[B("div",null,[B("h2",Id,F(d.$t("chipConfig.title")),1),B("p",Cd,[a.value?(T(),K("span",ld,F(d.$t("chipConfig.loadingFromDevice")),1)):I.value?(T(),K("span",Bd,F(d.$t("chipConfig.loadedFromDevice")),1)):(T(),K("span",Qd,F(d.$t("chipConfig.manualConfig")),1))])]),a.value?(T(),K("div",cd,[B("div",Ed,[B("div",ud,[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",fd,F(d.$t("chipConfig.loadingTitle")),1),B("p",hd,F(d.$t("chipConfig.loadingDesc")),1)])])])])):cA(g)&&I.value?(T(),K("div",dd,[B("div",pd,[B("div",md,[B("div",yd,[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",wd,F(d.$t("chipConfig.autoLoadedTitle")),1)])]),B("div",Dd,[B("div",kd,[B("label",vd,F(d.$t("chipConfig.chipModel")),1),B("div",Fd,F(E.value),1)]),B("div",Sd,[B("label",Rd,F(d.$t("chipConfig.screenWidth")),1),B("div",bd,F(D.value.width)+" px",1)]),B("div",Nd,[B("label",Gd,F(d.$t("chipConfig.screenHeight")),1),B("div",Ld,F(D.value.height)+" px",1)])]),B("div",Ud," ✓ "+F(d.$t("chipConfig.colorFormat"))+" "+F(D.value.color),1)]),B("div",Md,[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?d.$t("chipConfig.collapseManual"):d.$t("chipConfig.manualEdit")),1)]),C.value?(T(),K("div",xd,[TA(n,{config:Q.value},null,8,["config"])])):CA("",!0)])])):(T(),K("div",Jd,[B("div",Td,[B("div",Hd,[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",Yd,F(d.$t("chipConfig.manualConfigDesc")),1),B("p",_d,F(l.value||d.$t("chipConfig.manualConfigHint")),1)])])]),B("div",Kd,[B("h3",Od,F(d.$t("chipConfig.manualConfigTitle")),1),TA(n,{config:Q.value,"show-required":!0},null,8,["config"])])])),B("div",Pd,[B("button",{onClick:p,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(d.$t("chipConfig.next")),9,Vd)])]))}},qd={class:"space-y-6"},jd={class:"text-lg font-medium text-gray-900 mb-2"},Zd={class:"text-gray-600"},Xd={key:0,class:"bg-orange-50 border border-orange-200 rounded-lg p-4"},zd={class:"text-sm text-orange-800"},$d={class:"mt-1"},A0={key:1,class:"space-y-6"},e0={class:"flex space-x-4"},t0={key:0,class:"space-y-4"},i0={class:"block text-sm font-medium text-gray-700"},o0={class:"relative"},n0=["value"],r0=["value"],g0={key:1,class:"space-y-4 bg-gray-50 p-4 rounded-lg border border-gray-200"},s0={class:"font-medium text-gray-900"},a0={class:"grid grid-cols-1 md:grid-cols-2 gap-4"},I0={class:"block text-sm font-medium text-gray-700 mb-1"},C0=["placeholder"],l0={key:0,class:"text-xs text-red-500 mt-1"},B0={class:"block text-sm font-medium text-gray-700 mb-1"},Q0=["placeholder"],c0={key:0,class:"text-xs text-red-500 mt-1"},E0={class:"grid grid-cols-1 md:grid-cols-3 gap-4"},u0={class:"block text-sm font-medium text-gray-700 mb-1"},f0={class:"flex items-center space-x-2"},h0={class:"text-sm text-gray-600 w-8"},d0={class:"text-xs text-gray-500 mt-1"},p0={class:"block text-sm font-medium text-gray-700 mb-1"},m0={key:0,class:"text-xs text-red-500 mt-1"},y0={class:"block text-sm font-medium text-gray-700 mb-1"},w0={value:"mn6_cn"},D0={value:"mn6_en"},k0={class:"bg-blue-50 border border-blue-200 rounded-lg p-3"},v0={class:"text-sm text-blue-800"},F0={class:"mt-1 list-disc list-inside space-y-1"},S0={key:0},R0={key:1},b0={key:2},N0={__name:"WakewordConfig",props:{modelValue:{type:Object,required:!0},chipModel:{type:String,required:!0}},emits:["update:modelValue"],setup(A,{emit:e}){const{t}=we(),i=A,o=e,n=[{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_histackchan_tts3",name:"Hi,Stack Chan",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"},{id:"wn9_xiao3jia1xiao3jia1_tts3",name:"小珈小珈",model:"WakeNet9"},{id:"wn9_xiao3feng1xiao3feng1_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?n.filter(E=>E.model==="WakeNet9"):g.value?n.filter(E=>E.model==="WakeNet9s"):[]),l=uA({name:"",command:"",threshold:20,duration:3e3,model:"mn6_cn"}),C=uA({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},f=uA(!1),h=E=>{var D;o("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=>{o("update:modelValue",{...i.modelValue,preset:E})};return ae(l,E=>{f.value||i.modelValue.type==="custom"&&(Q(),o("update:modelValue",{...i.modelValue,custom:{...E}}))},{deep:!0}),ae(()=>i.modelValue.custom,E=>{E&&(f.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"},uo(()=>{f.value=!1}))},{deep:!0,immediate:!0}),(E,D)=>(T(),K("div",qd,[B("div",null,[B("h3",jd,F(E.$t("wakewordConfig.title")),1),B("p",Zd,F(E.$t("wakewordConfig.description")),1)]),a.value?(T(),K("div",A0,[B("div",e0,[B("button",{onClick:D[0]||(D[0]=c=>h("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=>h("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=>h("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)):CA("",!0)]),A.modelValue.type==="preset"?(T(),K("div",t0,[B("label",i0,F(E.$t("wakewordConfig.selectWakeword")),1),B("div",o0,[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,r0))),128))],40,n0)])])):CA("",!0),A.modelValue.type==="custom"?(T(),K("div",g0,[B("h4",s0,F(E.$t("wakewordConfig.customSettings")),1),B("div",a0,[B("div",null,[B("label",I0,[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,C0),[[te,l.value.name]]),C.value.name?(T(),K("p",l0,F(C.value.name),1)):CA("",!0)]),B("div",null,[B("label",B0,[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,Q0),[[te,l.value.command]]),C.value.command?(T(),K("p",c0,F(C.value.command),1)):CA("",!0)])]),B("div",E0,[B("div",null,[B("label",u0,F(E.$t("wakewordConfig.threshold")),1),B("div",f0,[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",d0,F(E.$t("wakewordConfig.thresholdDesc")),1)]),B("div",null,[B("label",p0,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",m0,F(C.value.duration),1)):CA("",!0)]),B("div",null,[B("label",y0,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",w0,F(E.$t("wakewordConfig.mn6cn")),1),B("option",D0,F(E.$t("wakewordConfig.mn6en")),1)],512),[[pr,l.value.model]])])])])):CA("",!0),B("div",k0,[B("div",v0,[B("strong",null,F(E.$t("wakewordConfig.tips.tipLabel")),1),B("ul",F0,[B("li",null,F(E.$t("wakewordConfig.tips.optional")),1),g.value?(T(),K("li",S0,F(E.$t("wakewordConfig.tips.wakeNet9sOnly")),1)):r.value?(T(),K("li",R0,F(E.$t("wakewordConfig.tips.wakeNet9Full")),1)):CA("",!0),s.value?(T(),K("li",b0,F(E.$t("wakewordConfig.tips.customSupport")),1)):CA("",!0)])])])])):(T(),K("div",Xd,[B("div",zd,[B("strong",null,F(E.$t("wakewordConfig.notice")),1),B("p",$d,F(E.$t("wakewordConfig.unsupportedMessage",{chipModel:A.chipModel})),1)])]))]))}};class G0{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=o=>{const n=o.target.result;if(n.objectStoreNames.contains("configs")||n.createObjectStore("configs",{keyPath:"key"}).createIndex("timestamp","timestamp",{unique:!1}),!n.objectStoreNames.contains("files")){const r=n.createObjectStore("files",{keyPath:"id"});r.createIndex("type","type",{unique:!1}),r.createIndex("timestamp","timestamp",{unique:!1})}if(!n.objectStoreNames.contains("temp_data")){const r=n.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((o,n)=>{const s=this.db.transaction(["configs"],"readwrite").objectStore("configs").put(i);s.onerror=()=>{console.error("保存配置失败:",s.error),n(s.error)},s.onsuccess=()=>{console.log("配置已保存到 IndexedDB"),o()}})}sanitizeConfigForStorage(e){var i,o,n,r,g,s,a,I,l,C;const t=JSON.parse(JSON.stringify(e||{}));try{if((o=(i=t==null?void 0:t.theme)==null?void 0:i.font)!=null&&o.custom&&(t.theme.font.custom.file=null),((r=(n=t==null?void 0:t.theme)==null?void 0:n.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)||{},f={};if(Object.keys(Q).forEach(h=>{f[h]=null}),t.theme.emoji.custom.images=f,t.theme.emoji.custom.emotionMap,t.theme.emoji.custom.fileMap){const h=t.theme.emoji.custom.fileMap,u={};Object.keys(h).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 n=this.db.transaction(["configs"],"readonly").objectStore("configs").get("current_config");n.onerror=()=>{console.error("加载配置失败:",n.error),t(n.error)},n.onsuccess=()=>{const r=n.result;r?(console.log("从 IndexedDB 恢复配置成功"),e({config:r.config,timestamp:r.timestamp})):e(null)}})}async saveFile(e,t,i,o={}){this.initialized||await this.initialize();const n=await this.fileToArrayBuffer(t);let r={};try{r=o?JSON.parse(JSON.stringify(o)):{}}catch{r={...o}}const g={id:e,type:i,name:t.name,size:t.size,mimeType:t.type,lastModified:t.lastModified,data:n,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,o={}){this.initialized||await this.initialize();const n={key:e,type:i,data:t,metadata:o,timestamp:Date.now()};return new Promise((r,g)=>{const I=this.db.transaction(["temp_data"],"readwrite").objectStore("temp_data").put(n);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 o=this.db.transaction(e,"readwrite");let n=0,r=!1;const g=()=>{n++,n===e.length&&(r?i(new Error("清空部分数据时出现错误")):(console.log("所有存储数据已清空"),t()))};e.forEach(s=>{const I=o.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 o of e){const n=await new Promise((r,g)=>{const I=this.db.transaction([o],"readonly").objectStore(o).count();I.onerror=()=>g(I.error),I.onsuccess=()=>r(I.result)});t[o]={count:n}}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 o=new FileReader;o.onload=()=>t(o.result),o.onerror=()=>i(new Error("读取文件失败")),o.readAsArrayBuffer(e)})}close(){this.db&&(this.db.close(),this.db=null,this.initialized=!1,console.log("IndexedDB 连接已关闭"))}}const Qe=new G0;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(o){console.warn(`保存字体文件失败: ${e.name}`,o)}}}static async saveEmojiFile(e,t,i={}){var o,n;if(t&&e){const r=e.startsWith("hash_")?e:`emoji_${e}`;try{const g=((o=i==null?void 0:i.size)==null?void 0:o.width)??64,s=((n=i==null?void 0:i.size)==null?void 0:n.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 o=`background_${e}`;try{let n={};try{n=i?JSON.parse(JSON.stringify(i)):{}}catch{n={...i}}await Qe.saveFile(o,t,"background",{mode:e,...n}),console.log(`背景文件已保存: ${e} - ${t.name}`)}catch(n){console.warn(`保存背景文件失败: ${e}`,n)}}}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 L0={class:"space-y-6"},U0={class:"text-lg font-medium text-gray-900 mb-2"},M0={class:"text-gray-600"},x0={class:"space-y-4"},J0={class:"flex space-x-4"},T0={key:0,class:"space-y-4"},H0={class:"bg-gray-50 border border-gray-200 rounded-lg p-6 text-center"},Y0={class:"mt-2 text-gray-600"},_0={key:1,class:"space-y-4"},K0={class:"font-medium text-gray-900"},O0={class:"grid grid-cols-1 md:grid-cols-4 gap-4"},P0=["onClick"],V0={class:"flex items-start justify-between"},W0={class:"flex-1"},q0={class:"font-medium text-gray-900 mb-1"},j0={class:"text-sm text-gray-600 space-y-1"},Z0={key:0,class:"flex-shrink-0 ml-3"},X0={key:2,class:"space-y-6"},z0={class:"font-medium text-gray-900"},$0={class:"space-y-2"},Ap={class:"block text-sm font-medium text-gray-700"},ep={key:0},tp={class:"mt-2"},ip={class:"text-gray-500"},op={class:"text-xs text-gray-400 mt-1"},np={key:1,class:"text-green-600"},rp={class:"mt-1 font-medium"},gp={key:0,class:"grid grid-cols-1 md:grid-cols-3 gap-4"},sp={class:"block text-sm font-medium text-gray-700 mb-2"},ap={class:"text-xs text-gray-500 mt-1"},Ip={class:"block text-sm font-medium text-gray-700 mb-2"},Cp={value:1},lp={value:2},Bp={value:4},Qp={class:"block text-sm font-medium text-gray-700 mb-2"},cp={value:"qwen"},Ep={value:"deepseek"},up={value:"gb2312"},fp={value:"latin"},hp={value:"full"},dp={class:"flex items-center justify-between p-4 bg-gray-50 rounded-lg border border-gray-200"},pp={class:"flex-1"},mp={class:"font-medium text-gray-900"},yp={class:"text-sm text-gray-500 mt-1"},wp={class:"ml-4"},Dp={class:"relative inline-flex items-center cursor-pointer"},kp=["checked"],vp={__name:"FontConfig",props:{modelValue:{type:Object,required:!0}},emits:["update:modelValue"],setup(A,{emit:e}){const{t}=we(),i=A,o=e,n=uA(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=uA({size:20,bpp:4,charset:"qwen"}),a=u=>{o("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=>{o("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)$/))?(o("update:modelValue",{...i.modelValue,custom:{...i.modelValue.custom,file:u,...s.value}}),await si.saveFontFile(u,s.value)):alert(t("fontConfig.selectValidFontFile"))},f=async()=>{o("update:modelValue",{...i.modelValue,custom:{...i.modelValue.custom,file:null}}),n.value&&(n.value.value=""),await si.deleteFontFile()},h=uA(!1);return ae(()=>s.value,u=>{h.value||i.modelValue.type==="custom"&&i.modelValue.custom.file&&o("update:modelValue",{...i.modelValue,custom:{...i.modelValue.custom,...u}})},{deep:!0}),ae(()=>i.modelValue.custom,u=>{u.size&&u.bpp&&u.charset&&(h.value=!0,s.value={size:u.size,bpp:u.bpp,charset:u.charset},uo(()=>{h.value=!1}))},{deep:!0,immediate:!0}),(u,E)=>{var D;return T(),K("div",L0,[B("div",null,[B("h3",U0,F(u.$t("fontConfig.title")),1),B("p",M0,F(u.$t("fontConfig.description")),1)]),B("div",x0,[B("div",J0,[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",T0,[B("div",H0,[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",Y0,F(u.$t("fontConfig.noFontsDescription")),1)])])):CA("",!0),A.modelValue.type==="preset"?(T(),K("div",_0,[B("h4",K0,F(u.$t("fontConfig.presetFonts")),1),B("div",O0,[(T(!0),K(qA,null,Ke(g.value,c=>(T(),K("div",{key:c.id,onClick:p=>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",V0,[B("div",W0,[B("h5",q0,F(c.name),1),B("div",j0,[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",Z0,[...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)])])):CA("",!0)])],10,P0))),128))])])):CA("",!0),A.modelValue.type==="custom"?(T(),K("div",X0,[B("h4",z0,F(u.$t("fontConfig.customFonts")),1),B("div",$0,[B("label",Ap,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:n,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",rp,F((D=A.modelValue.custom.file)==null?void 0:D.name),1),B("button",{onClick:f,class:"text-red-600 hover:text-red-500 text-sm mt-1"},F(u.$t("fontConfig.removeFile")),1)])):(T(),K("div",ep,[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",tp,[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",ip,F(u.$t("fontConfig.orDragFileHere")),1)]),B("p",op,F(u.$t("fontConfig.supportedFormats")),1)]))],32)]),A.modelValue.custom.file?(T(),K("div",gp,[B("div",null,[B("label",sp,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",ap,F(u.$t("fontConfig.range"))+" 8-80px",1)]),B("div",null,[B("label",Ip,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",Cp,F(u.$t("fontConfig.monochrome")),1),B("option",lp,F(u.$t("fontConfig.fourColors")),1),B("option",Bp,F(u.$t("fontConfig.sixteenColors")),1)],512),[[pr,s.value.bpp]])]),B("div",null,[B("label",Qp,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",cp,F(u.$t("fontConfig.qwen18409")),1),B("option",Ep,F(u.$t("fontConfig.deepseekR1")),1),B("option",up,F(u.$t("fontConfig.gb2312")),1),B("option",fp,F(u.$t("fontConfig.latin1")),1),B("option",hp,F(u.$t("fontConfig.fullCharset")),1)],512),[[pr,s.value.charset]])])])):CA("",!0)])):CA("",!0),B("div",dp,[B("div",pp,[B("h4",mp,F(u.$t("fontConfig.hideSubtitle")),1),B("p",yp,F(u.$t("fontConfig.hideSubtitleDescription")),1)]),B("div",wp,[B("label",Dp,[B("input",{type:"checkbox",checked:A.modelValue.hide_subtitle,onChange:E[9]||(E[9]=c=>o("update:modelValue",{...A.modelValue,hide_subtitle:c.target.checked})),class:"sr-only peer"},null,40,kp),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))])])])])}}},Fp={class:"space-y-6"},Sp={class:"text-lg font-medium text-gray-900 mb-2"},Rp={class:"text-gray-600"},bp={class:"space-y-4"},Np={class:"flex flex-wrap gap-3"},Gp={key:0,class:"text-sm text-gray-500"},Lp={key:0,class:"space-y-4"},Up={class:"font-medium text-gray-900"},Mp={class:"grid grid-cols-1 md:grid-cols-2 gap-6"},xp=["onClick"],Jp={class:"flex items-start justify-between mb-3"},Tp={class:"font-medium text-gray-900"},Hp={class:"text-sm text-gray-600"},Yp={class:"text-xs text-gray-500 mt-1"},_p={key:0,class:"flex-shrink-0 ml-3"},Kp={class:"grid grid-cols-7 gap-1 justify-items-center overflow-hidden"},Op=["src","alt"],Pp={key:1,class:"space-y-6"},Vp={class:"font-medium text-gray-900"},Wp={class:"grid grid-cols-1 md:grid-cols-2 gap-4"},qp={class:"block text-sm font-medium text-gray-700 mb-2"},jp={class:"block text-sm font-medium text-gray-700 mb-2"},Zp={class:"space-y-4"},Xp={class:"font-medium text-gray-900"},zp={class:"grid grid-cols-2 md:grid-cols-4 lg:grid-cols-7 gap-4"},$p={class:"text-center"},Am={class:"text-lg mb-1"},em={class:"text-xs text-gray-600 flex items-center justify-center gap-1"},tm={key:0,class:"text-red-500"},im=["onDrop"],om=["onChange"],nm=["onClick"],rm={class:"text-xs text-gray-500"},gm={key:1,class:"w-full h-full relative"},sm=["src","alt"],am=["onClick"],Im={class:"text-xs text-gray-500 mt-2"},Cm={__name:"EmojiConfig",props:{modelValue:{type:Object,required:!0}},emits:["update:modelValue"],setup(A,{emit:e}){const{t}=we(),i=A,o=e,n=async c=>{var d;const p=await c.arrayBuffer();if((d=crypto==null?void 0:crypto.subtle)!=null&&d.digest)try{const v=await crypto.subtle.digest("SHA-256",p);return Array.from(new Uint8Array(v)).map(N=>N.toString(16).padStart(2,"0")).join("")}catch(v){console.warn("使用 crypto.subtle.digest 失败,回退到自定义哈希函数:",v)}return r(p)},r=c=>{const p=new Uint8Array(c);let d=2166136261,v=16777619;for(let H=0;H>>0).toString(16).padStart(8,"0")},g=[{id:"twemoji32",name:t("emojiConfig.twitterEmojiName",{size:32}),description:t("emojiConfig.twitterEmojiDescription",{size:32}),size:32,format:"png",preview:["neutral","happy","laughing","funny","sad","angry","crying"]},{id:"twemoji64",name:t("emojiConfig.twitterEmojiName",{size:64}),description:t("emojiConfig.twitterEmojiDescription",{size:64}),size:64,format:"png",preview:["neutral","happy","laughing","funny","sad","angry","crying"]},{id:"noto-emoji_64",name:t("emojiConfig.notoEmojiName",{size:64}),description:t("emojiConfig.notoEmojiDescription",{size:64}),size:64,format:"gif",preview:["neutral","happy","laughing","funny","sad","angry","crying"]},{id:"noto-emoji_128",name:t("emojiConfig.notoEmojiName",{size:128}),description:t("emojiConfig.notoEmojiDescription",{size:128}),size:128,format:"gif",preview:["neutral","happy","laughing","funny","sad","angry","crying"]}],s=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:"🙄"}]),a=uA({size:{width:32,height:32}}),I=c=>{if(i.modelValue.type===c)return;const p={...i.modelValue,type:c};c==="none"?(p.preset="",p.custom={...i.modelValue.custom,images:i.modelValue.custom.images||{}}):c==="preset"?(p.preset=i.modelValue.preset||"twemoji32",p.custom={...i.modelValue.custom,images:i.modelValue.custom.images||{}}):c==="custom"&&(p.preset="",p.custom={...i.modelValue.custom,images:i.modelValue.custom.images||{}}),o("update:modelValue",p)},l=c=>{i.modelValue.preset!==c&&o("update:modelValue",{...i.modelValue,preset:c,custom:{...i.modelValue.custom,images:i.modelValue.custom.images||{}}})},C=(c,p)=>{const d=c.target.files[0];d&&f(p,d)},Q=(c,p)=>{c.preventDefault();const d=c.dataTransfer.files;d.length>0&&f(p,d[0])},f=async(c,p)=>{const d=["png","gif"],v=p.name.split(".").pop().toLowerCase();if(!d.includes(v)){alert(t("emojiConfig.selectValidFormat"));return}const b=await n(p),N=i.modelValue.custom||{},H={...N.fileMap||{}},M={...N.emotionMap||{}},U={...N.images||{}};let R=[];for(const[j,rA]of Object.entries(M))rA===b&&j!==c&&R.push(j);R.length>0&&console.log(t("emojiConfig.sharedFileMessage",{emotionKey:c,existingEmotions:R.join(", ")})),H[b]=p,M[c]=b,U[c]=p,o("update:modelValue",{...i.modelValue,custom:{...N,size:a.value.size,images:U,fileMap:H,emotionMap:M}}),await si.saveEmojiFile(`hash_${b}`,p,{size:a.value.size,format:v,emotions:[...R,c]})},h=async c=>{const p=i.modelValue.custom||{},d={...p.images},v={...p.emotionMap||{}},b={...p.fileMap||{}},N=v[c];delete d[c],delete v[c],Object.values(v).filter(M=>M===N).length===0&&N?(delete b[N],await si.deleteEmojiFile(`hash_${N}`),console.log(t("emojiConfig.fileDeleted",{fileHash:N}))):console.log(t("emojiConfig.fileRetained",{fileHash:N})),o("update:modelValue",{...i.modelValue,custom:{...p,images:d,emotionMap:v,fileMap:b}})},u=(c,p)=>{const d=g.find(b=>b.id===c),v=(d==null?void 0:d.format)||"png";return`./static/emojis/${c}/${p}.${v}`},E=c=>{if(i.modelValue.type==="preset")return u(i.modelValue.preset,c);{const p=i.modelValue.custom.images[c];return p instanceof File||p instanceof Blob?URL.createObjectURL(p):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 p=i.modelValue.custom;JSON.stringify(p.size)!==JSON.stringify(c)&&o("update:modelValue",{...i.modelValue,custom:{...p,size:c}})}},{deep:!0}),i.modelValue.custom.size&&(a.value={size:{...i.modelValue.custom.size}}),(c,p)=>(T(),K("div",Fp,[B("div",null,[B("h3",Sp,F(c.$t("emojiConfig.title")),1),B("p",Rp,F(c.$t("emojiConfig.description")),1)]),B("div",bp,[B("div",Np,[B("button",{onClick:p[0]||(p[0]=d=>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:p[1]||(p[1]=d=>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:p[2]||(p[2]=d=>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",Gp,F(c.$t("emojiConfig.noEmojiPackDescription")),1)):CA("",!0)]),A.modelValue.type==="preset"?(T(),K("div",Lp,[B("h4",Up,F(c.$t("emojiConfig.selectPresetEmojiPack")),1),B("div",Mp,[(T(),K(qA,null,Ke(g,d=>B("div",{key:d.id,onClick:v=>l(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",Jp,[B("div",null,[B("h5",Tp,F(d.name),1),B("p",Hp,F(d.description),1),B("div",Yp,F(c.$t("emojiConfig.size"))+": "+F(d.size)+"px × "+F(d.size)+"px ",1)]),A.modelValue.preset===d.id?(T(),K("div",_p,[...p[7]||(p[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)])])):CA("",!0)]),B("div",Kp,[(T(!0),K(qA,null,Ke(d.preview,v=>(T(),K("div",{key:v,style:VA({width:d.size+"px",height:d.size+"px"}),class:"bg-gray-100 rounded flex items-center justify-center"},[B("img",{src:u(d.id,v),alt:v,style:VA({width:d.size+"px",height:d.size+"px"}),class:"object-contain rounded",onError:D},null,44,Op)],4))),128))])],10,xp)),64))])])):CA("",!0),A.modelValue.type==="custom"?(T(),K("div",Pp,[B("h4",Vp,F(c.$t("emojiConfig.customEmojiPackConfig")),1),B("div",Wp,[B("div",null,[B("label",qp,F(c.$t("emojiConfig.maxImageWidth")),1),ZA(B("input",{type:"number","onUpdate:modelValue":p[3]||(p[3]=d=>a.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,a.value.size.width,void 0,{number:!0}]])]),B("div",null,[B("label",jp,F(c.$t("emojiConfig.maxImageHeight")),1),ZA(B("input",{type:"number","onUpdate:modelValue":p[4]||(p[4]=d=>a.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,a.value.size.height,void 0,{number:!0}]])])]),B("div",Zp,[B("h5",Xp,F(c.$t("emojiConfig.uploadEmojiImages")),1),B("div",zp,[(T(!0),K(qA,null,Ke(s.value,d=>(T(),K("div",{key:d.key,class:"space-y-2"},[B("div",$p,[B("div",Am,F(d.emoji),1),B("div",em,[B("span",null,F(d.name),1),d.key==="neutral"?(T(),K("span",tm,F(c.$t("emojiConfig.required")),1)):CA("",!0)])]),B("div",{onDrop:v=>Q(v,d.key),onDragover:p[5]||(p[5]=dt(()=>{},["prevent"])),onDragenter:p[6]||(p[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:v=>C(v,d.key),class:"hidden"},null,40,om),A.modelValue.custom.images[d.key]?(T(),K("div",gm,[E(d.key)?(T(),K("img",{key:0,src:E(d.key),alt:d.name,class:"w-full h-full object-cover rounded",onError:D},null,40,sm)):CA("",!0),B("button",{onClick:v=>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,am)])):(T(),K("div",{key:0,onClick:v=>{var b;return(b=c.$refs[d.key+"Input"][0])==null?void 0:b.click()}},[p[8]||(p[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",rm,F(c.$t("emojiConfig.clickToUploadOrDrag")),1)],8,nm))],42,im)]))),128))]),B("div",Im,F(c.$t("emojiConfig.neutralRequiredNotice")),1)])])):CA("",!0)]))}},lm={class:"space-y-6"},Bm={class:"text-lg font-medium text-gray-900 mb-2"},Qm={class:"text-gray-600"},cm={class:"space-y-4"},Em={class:"font-medium text-gray-900 flex items-center"},um={class:"border border-gray-200 rounded-lg p-4 space-y-4"},fm={class:"flex space-x-4"},hm={key:0,class:"space-y-3"},dm={class:"flex items-center space-x-3"},pm={class:"text-sm font-medium text-gray-700"},mm={class:"flex items-center space-x-2"},ym={class:"flex items-center space-x-3"},wm={class:"text-sm font-medium text-gray-700"},Dm={class:"flex items-center space-x-2"},km={key:1,class:"space-y-3"},vm={class:"text-sm font-medium text-gray-700"},Fm={class:"mt-1 text-sm text-gray-600"},Sm={key:1,class:"space-y-2"},Rm=["src"],bm={class:"text-sm text-green-700 font-medium"},Nm={class:"flex items-center space-x-3"},Gm={class:"text-sm font-medium text-gray-700"},Lm={class:"flex items-center space-x-2"},Um={class:"space-y-4"},Mm={class:"font-medium text-gray-900 flex items-center"},xm={class:"border border-gray-200 rounded-lg p-4 space-y-4"},Jm={class:"flex space-x-4"},Tm={key:0,class:"space-y-3"},Hm={class:"flex items-center space-x-3"},Ym={class:"text-sm font-medium text-gray-700"},_m={class:"flex items-center space-x-2"},Km={class:"flex items-center space-x-3"},Om={class:"text-sm font-medium text-gray-700"},Pm={class:"flex items-center space-x-2"},Vm={key:1,class:"space-y-3"},Wm={class:"text-sm font-medium text-gray-700"},qm={class:"mt-1 text-sm text-gray-600"},jm={key:1,class:"space-y-2"},Zm=["src"],Xm={class:"text-sm text-green-700 font-medium"},zm={class:"flex items-center space-x-3"},$m={class:"text-sm font-medium text-gray-700"},Ay={class:"flex items-center space-x-2"},ey={class:"space-y-4"},ty={class:"font-medium text-gray-900"},iy={class:"grid grid-cols-1 md:grid-cols-2 gap-4"},oy={class:"space-y-2"},ny={class:"text-sm font-medium text-gray-700"},ry={class:"absolute inset-0 bg-white bg-opacity-10 flex items-center justify-center rounded-lg"},gy={class:"space-y-2"},sy={class:"text-sm font-medium text-gray-700"},ay={class:"absolute inset-0 bg-black bg-opacity-10 flex items-center justify-center rounded-lg"},Iy={class:"bg-blue-50 border border-blue-200 rounded-lg p-4"},Cy={class:"font-medium text-blue-900 mb-2"},ly={class:"flex flex-wrap gap-2"},By={__name:"BackgroundConfig",props:{modelValue:{type:Object,required:!0}},emits:["update:modelValue"],setup(A,{emit:e}){const{t}=we(),i=A,o=e,n=uA(null),r=uA(null),g=hA({get:()=>i.modelValue.light.backgroundColor,set:M=>Q(M)}),s=hA({get:()=>i.modelValue.dark.backgroundColor,set:M=>f(M)}),a=hA({get:()=>i.modelValue.light.textColor,set:M=>h(M)}),I=hA({get:()=>i.modelValue.dark.textColor,set:M=>u(M)}),l=M=>{o("update:modelValue",{...i.modelValue,light:{...i.modelValue.light,backgroundType:M,backgroundImage:M==="image"?i.modelValue.light.backgroundImage:null}})},C=M=>{o("update:modelValue",{...i.modelValue,dark:{...i.modelValue.dark,backgroundType:M,backgroundImage:M==="image"?i.modelValue.dark.backgroundImage:null}})},Q=M=>{o("update:modelValue",{...i.modelValue,light:{...i.modelValue.light,backgroundColor:M}})},f=M=>{o("update:modelValue",{...i.modelValue,dark:{...i.modelValue.dark,backgroundColor:M}})},h=M=>{o("update:modelValue",{...i.modelValue,light:{...i.modelValue.light,textColor:M}})},u=M=>{o("update:modelValue",{...i.modelValue,dark:{...i.modelValue.dark,textColor:M}})},E=(M,U)=>{const R=M.target.files[0];R&&c(U,R)},D=(M,U)=>{M.preventDefault();const R=M.dataTransfer.files;R.length>0&&c(U,R[0])},c=async(M,U)=>{U&&U.type.startsWith("image/")?(o("update:modelValue",{...i.modelValue,[M]:{...i.modelValue[M],backgroundImage:U}}),await si.saveBackgroundFile(M,U)):alert(t("backgroundConfig.selectValidImage"))},p=async M=>{o("update:modelValue",{...i.modelValue,[M]:{...i.modelValue[M],backgroundImage:null}}),M==="light"&&n.value&&(n.value.value=""),M==="dark"&&r.value&&(r.value.value=""),await si.deleteBackgroundFile(M)},d=M=>{const U=i.modelValue[M].backgroundImage;return U?URL.createObjectURL(U):null},v=()=>i.modelValue.light.backgroundType==="image"&&i.modelValue.light.backgroundImage?{backgroundImage:`url(${d("light")})`,backgroundSize:"cover",backgroundPosition:"center"}:{backgroundColor:i.modelValue.light.backgroundColor},b=()=>i.modelValue.dark.backgroundType==="image"&&i.modelValue.dark.backgroundImage?{backgroundImage:`url(${d("dark")})`,backgroundSize:"cover",backgroundPosition:"center"}:{backgroundColor:i.modelValue.dark.backgroundColor},N=(M,U)=>{const R=H(M)?"#000000":"#ffffff",j=H(U)?"#000000":"#ffffff";o("update:modelValue",{...i.modelValue,light:{...i.modelValue.light,backgroundType:"color",backgroundColor:M,textColor:R,backgroundImage:null},dark:{...i.modelValue.dark,backgroundType:"color",backgroundColor:U,textColor:j,backgroundImage:null}})},H=M=>{const U=M.replace("#",""),R=parseInt(U.substr(0,2),16),j=parseInt(U.substr(2,2),16),rA=parseInt(U.substr(4,2),16);return(R*299+j*587+rA*114)/1e3>128};return(M,U)=>(T(),K("div",lm,[B("div",null,[B("h3",Bm,F(M.$t("backgroundConfig.title")),1),B("p",Qm,F(M.$t("backgroundConfig.description")),1)]),B("div",cm,[B("h4",Em,[U[33]||(U[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(M.$t("backgroundConfig.lightMode")),1)]),B("div",um,[B("div",fm,[B("button",{onClick:U[0]||(U[0]=R=>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(M.$t("backgroundConfig.solidBackground")),3),B("button",{onClick:U[1]||(U[1]=R=>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(M.$t("backgroundConfig.imageBackground")),3)]),A.modelValue.light.backgroundType==="color"?(T(),K("div",hm,[B("div",dm,[B("label",pm,F(M.$t("backgroundConfig.backgroundColor")),1),B("div",mm,[ZA(B("input",{type:"color","onUpdate:modelValue":U[2]||(U[2]=R=>g.value=R),class:"w-10 h-10 border border-gray-300 rounded cursor-pointer"},null,512),[[te,g.value]]),ZA(B("input",{type:"text","onUpdate:modelValue":U[3]||(U[3]=R=>g.value=R),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",ym,[B("label",wm,F(M.$t("backgroundConfig.textColor")),1),B("div",Dm,[ZA(B("input",{type:"color","onUpdate:modelValue":U[4]||(U[4]=R=>a.value=R),class:"w-10 h-10 border border-gray-300 rounded cursor-pointer"},null,512),[[te,a.value]]),ZA(B("input",{type:"text","onUpdate:modelValue":U[5]||(U[5]=R=>a.value=R),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)])])):CA("",!0),A.modelValue.light.backgroundType==="image"?(T(),K("div",km,[B("label",vm,F(M.$t("backgroundConfig.backgroundImage")),1),B("div",{onDrop:U[9]||(U[9]=R=>D(R,"light")),onDragover:U[10]||(U[10]=dt(()=>{},["prevent"])),onDragenter:U[11]||(U[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:n,type:"file",accept:"image/*",onChange:U[6]||(U[6]=R=>E(R,"light")),class:"hidden"},null,544),A.modelValue.light.backgroundImage?(T(),K("div",Sm,[B("img",{src:d("light"),alt:"{{ $t('backgroundConfig.lightModePreview') }}背景",class:"max-w-32 max-h-32 mx-auto rounded shadow"},null,8,Rm),B("p",bm,F(A.modelValue.light.backgroundImage.name),1),B("button",{onClick:U[8]||(U[8]=R=>p("light")),class:"text-red-600 hover:text-red-500 text-sm"},F(M.$t("backgroundConfig.removeImage")),1)])):(T(),K("div",{key:0,onClick:U[7]||(U[7]=R=>M.$refs.lightImageInput.click())},[U[34]||(U[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",Fm,F(M.$t("backgroundConfig.clickOrDragToUpload")),1)]))],34),B("div",Nm,[B("label",Gm,F(M.$t("backgroundConfig.textColor")),1),B("div",Lm,[ZA(B("input",{type:"color","onUpdate:modelValue":U[12]||(U[12]=R=>a.value=R),class:"w-10 h-10 border border-gray-300 rounded cursor-pointer"},null,512),[[te,a.value]]),ZA(B("input",{type:"text","onUpdate:modelValue":U[13]||(U[13]=R=>a.value=R),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)])])):CA("",!0)])]),B("div",Um,[B("h4",Mm,[U[35]||(U[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(M.$t("backgroundConfig.darkMode")),1)]),B("div",xm,[B("div",Jm,[B("button",{onClick:U[14]||(U[14]=R=>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(M.$t("backgroundConfig.solidBackground")),3),B("button",{onClick:U[15]||(U[15]=R=>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(M.$t("backgroundConfig.imageBackground")),3)]),A.modelValue.dark.backgroundType==="color"?(T(),K("div",Tm,[B("div",Hm,[B("label",Ym,F(M.$t("backgroundConfig.backgroundColor")),1),B("div",_m,[ZA(B("input",{type:"color","onUpdate:modelValue":U[16]||(U[16]=R=>s.value=R),class:"w-10 h-10 border border-gray-300 rounded cursor-pointer"},null,512),[[te,s.value]]),ZA(B("input",{type:"text","onUpdate:modelValue":U[17]||(U[17]=R=>s.value=R),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",Km,[B("label",Om,F(M.$t("backgroundConfig.textColor")),1),B("div",Pm,[ZA(B("input",{type:"color","onUpdate:modelValue":U[18]||(U[18]=R=>I.value=R),class:"w-10 h-10 border border-gray-300 rounded cursor-pointer"},null,512),[[te,I.value]]),ZA(B("input",{type:"text","onUpdate:modelValue":U[19]||(U[19]=R=>I.value=R),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)])])):CA("",!0),A.modelValue.dark.backgroundType==="image"?(T(),K("div",Vm,[B("label",Wm,F(M.$t("backgroundConfig.backgroundImage")),1),B("div",{onDrop:U[23]||(U[23]=R=>D(R,"dark")),onDragover:U[24]||(U[24]=dt(()=>{},["prevent"])),onDragenter:U[25]||(U[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:U[20]||(U[20]=R=>E(R,"dark")),class:"hidden"},null,544),A.modelValue.dark.backgroundImage?(T(),K("div",jm,[B("img",{src:d("dark"),alt:"{{ $t('backgroundConfig.darkModePreview') }}背景",class:"max-w-32 max-h-32 mx-auto rounded shadow"},null,8,Zm),B("p",Xm,F(A.modelValue.dark.backgroundImage.name),1),B("button",{onClick:U[22]||(U[22]=R=>p("dark")),class:"text-red-600 hover:text-red-500 text-sm"},F(M.$t("backgroundConfig.removeImage")),1)])):(T(),K("div",{key:0,onClick:U[21]||(U[21]=R=>M.$refs.darkImageInput.click())},[U[36]||(U[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",qm,F(M.$t("backgroundConfig.clickOrDragToUpload")),1)]))],34),B("div",zm,[B("label",$m,F(M.$t("backgroundConfig.textColor")),1),B("div",Ay,[ZA(B("input",{type:"color","onUpdate:modelValue":U[26]||(U[26]=R=>I.value=R),class:"w-10 h-10 border border-gray-300 rounded cursor-pointer"},null,512),[[te,I.value]]),ZA(B("input",{type:"text","onUpdate:modelValue":U[27]||(U[27]=R=>I.value=R),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)])])):CA("",!0)])]),B("div",ey,[B("h4",ty,F(M.$t("backgroundConfig.backgroundPreview")),1),B("div",iy,[B("div",oy,[B("div",ny,F(M.$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",ry,[B("span",{style:VA({color:A.modelValue.light.textColor})},F(M.$t("backgroundConfig.chatArea")),5)])],4)]),B("div",gy,[B("div",sy,F(M.$t("backgroundConfig.darkModePreview")),1),B("div",{style:VA(b()),class:"h-32 border border-gray-300 rounded-lg flex items-center justify-center text-sm relative overflow-hidden"},[B("div",ay,[B("span",{style:VA({color:A.modelValue.dark.textColor})},F(M.$t("backgroundConfig.chatArea")),5)])],4)])])]),B("div",Iy,[B("h5",Cy,F(M.$t("backgroundConfig.quickConfig")),1),B("div",ly,[B("button",{onClick:U[28]||(U[28]=R=>N("#ffffff","#1f2937")),class:"px-3 py-1 text-sm bg-white border border-gray-300 rounded hover:bg-gray-50"},F(M.$t("backgroundConfig.defaultColors")),1),B("button",{onClick:U[29]||(U[29]=R=>N("#f5f5f4","#374151")),class:"px-3 py-1 text-sm bg-stone-100 border border-gray-300 rounded hover:bg-stone-200"},F(M.$t("backgroundConfig.stoneTexture")),1),B("button",{onClick:U[30]||(U[30]=R=>N("#fef7cd","#7c2d12")),class:"px-3 py-1 text-sm bg-yellow-100 border border-gray-300 rounded hover:bg-yellow-200"},F(M.$t("backgroundConfig.sunnyColors")),1),B("button",{onClick:U[31]||(U[31]=R=>N("#e0f2fe","#1e40af")),class:"px-3 py-1 text-sm bg-sky-100 border border-gray-300 rounded hover:bg-sky-200"},F(M.$t("backgroundConfig.skyBlue")),1),B("button",{onClick:U[32]||(U[32]=R=>N("#fdf2f8","#be185d")),class:"px-3 py-1 text-sm bg-pink-100 border border-gray-300 rounded hover:bg-pink-200"},F(M.$t("backgroundConfig.romanticPink")),1)])])]))}},Qy={class:"space-y-6"},cy={class:"text-xl font-semibold text-gray-900 mb-4"},Ey={class:"text-gray-600 mb-6"},uy={class:"border-b border-gray-200"},fy={class:"-mb-px flex space-x-4 sm:space-x-8"},hy=["onClick"],dy={class:"flex items-center"},py={class:"hidden sm:inline"},my={class:"min-h-96"},yy={class:"flex justify-between"},wy={__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}=we(),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"})])}},o={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"})])}},n={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=uA(g.activeTab),I=hA(()=>[{id:"wakeword",name:t("themeDesign.tabs.wakeword"),icon:i},{id:"font",name:t("themeDesign.tabs.font"),icon:o},{id:"emoji",name:t("themeDesign.tabs.emoji"),icon:n},{id:"background",name:t("themeDesign.tabs.background"),icon:r}]),l=hA({get:()=>g.modelValue,set:f=>s("update:modelValue",f)}),C=()=>{var u,E,D;const f=g.modelValue.wakeword;if(f.type==="custom"){if(!((u=f.custom.name)!=null&&u.trim())){alert(t("wakewordConfig.errors.nameRequired"));return}if(!((E=f.custom.command)!=null&&E.trim())){alert(t("wakewordConfig.errors.commandRequired"));return}if(!f.custom.duration||f.custom.duration<500||f.custom.duration>1e4){alert(t("wakewordConfig.errors.durationRange"));return}}const h=g.modelValue.font;if(h.type==="custom"&&!((D=h.custom)!=null&&D.file)){alert(t("fontConfig.selectValidFontFile"));return}s("next")},Q=f=>{a.value=f,s("tabChange",f)};return ae(()=>g.activeTab,f=>{a.value=f}),(f,h)=>(T(),K("div",Qy,[B("div",null,[B("h2",cy,F(f.$t("themeDesign.title")),1),B("p",Ey,F(f.$t("themeDesign.description")),1)]),B("div",uy,[B("nav",fy,[(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",dy,[(T(),ye(YI(u.icon),{class:"w-5 h-5 sm:mr-2"})),B("span",py,F(u.name),1)])],10,hy))),128))])]),B("div",my,[a.value==="wakeword"?(T(),ye(N0,{key:0,modelValue:l.value.wakeword,"onUpdate:modelValue":h[0]||(h[0]=u=>l.value.wakeword=u),chipModel:A.chipModel},null,8,["modelValue","chipModel"])):CA("",!0),a.value==="font"?(T(),ye(vp,{key:1,modelValue:l.value.font,"onUpdate:modelValue":h[1]||(h[1]=u=>l.value.font=u)},null,8,["modelValue"])):CA("",!0),a.value==="emoji"?(T(),ye(Cm,{key:2,modelValue:l.value.emoji,"onUpdate:modelValue":h[2]||(h[2]=u=>l.value.emoji=u)},null,8,["modelValue"])):CA("",!0),a.value==="background"?(T(),ye(By,{key:3,modelValue:l.value.skin,"onUpdate:modelValue":h[3]||(h[3]=u=>l.value.skin=u)},null,8,["modelValue"])):CA("",!0)]),B("div",yy,[B("button",{onClick:h[4]||(h[4]=u=>f.$emit("prev")),class:"bg-gray-500 hover:bg-gray-600 text-white px-6 py-2 rounded-lg font-medium transition-colors"},F(f.$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(f.$t("themeDesign.next")),1)])]))}},Dy=(A,e)=>{const t=A.__vccOpts||A;for(const[i,o]of e)t[i]=o;return t},ky={class:"space-y-6"},vy={class:"text-xl font-semibold text-gray-900 mb-4"},Fy={class:"text-gray-600 mb-6"},Sy={class:"flex flex-col lg:flex-row gap-8"},Ry={class:"flex-1"},by={class:"text-lg font-medium text-gray-900 mb-4"},Ny={class:"bg-gray-100 p-4 rounded-lg"},Gy={class:"max-w-full overflow-auto flex justify-center"},Ly={class:"bg-gray-800 p-6 rounded-2xl shadow-2xl inline-block"},Uy={class:"bg-gray-900 p-2 rounded-xl"},My={class:"relative z-10 flex flex-col items-center justify-center p-4 text-center"},xy={class:"mb-4"},Jy={key:0,class:"emoji-container"},Ty=["src","alt"],Hy={key:1,class:"emoji-container"},Yy={class:"text-center"},_y={class:"text-sm"},Ky={class:"text-xs"},Oy={key:0,class:"absolute inset-0 flex items-center justify-center"},Py={class:"animate-pulse text-gray-400 text-xs"},Vy={class:"mt-3 text-center text-xs text-gray-400"},Wy={class:"w-full lg:w-80"},qy={class:"text-lg font-medium text-gray-900 mb-4"},jy={class:"space-y-6 bg-white border border-gray-200 rounded-lg p-4"},Zy={class:"block text-sm font-medium text-gray-700 mb-2"},Xy={class:"block text-sm font-medium text-gray-700 mb-2"},zy={key:0,class:"flex flex-wrap gap-2 max-h-32 overflow-y-auto justify-center"},$y=["onClick","title"],Aw={key:0},ew=["src","alt"],tw={key:1,class:"text-lg"},iw={key:1,class:"text-center py-4 text-gray-500 bg-gray-50 rounded-lg border-2 border-dashed"},ow={class:"text-2xl mb-2"},nw={class:"text-sm"},rw={class:"block text-sm font-medium text-gray-700 mb-2"},gw={class:"flex space-x-2"},sw={class:"border-t pt-4"},aw={class:"font-medium text-gray-900 mb-2"},Iw={class:"text-xs text-gray-600 space-y-1"},Cw={key:0},lw={class:"flex items-center"},Bw={key:0,class:"ml-2 animate-pulse text-blue-500"},Qw={key:1},cw={class:"flex justify-between"},Ew={__name:"GenerateSummary",props:{config:{type:Object,required:!0}},emits:["prev","generate"],setup(A){const{t:e}=we(),t=A,i=uA(e("generateSummary.defaultPreviewText")),o=uA("happy"),n=uA("light"),r=uA(!1),g=uA(""),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(j=>R[j.key])}else return[]}),I=hA(()=>c(o.value)),l=()=>{const{width:R,height:j}=t.config.chip.display;return{width:`${R}px`,height:`${j}px`}},C=()=>{const R=t.config.theme.skin[n.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(j){console.warn("背景图片预览加载失败:",j)}return{backgroundColor:R.backgroundColor||"#ffffff"}},Q={twemoji32:32,twemoji64:64,"noto-emoji_64":64,"noto-emoji_128":128},f=()=>{let R=48;return t.config.theme.emoji.type==="preset"?R=Q[t.config.theme.emoji.preset]||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 rA=t.config.theme.font.preset;rA.includes("_14_")?R=14:rA.includes("_16_")?R=16:rA.includes("_20_")?R=20:rA.includes("_30_")&&(R=30)}else t.config.theme.font.custom.size&&(R=t.config.theme.font.custom.size);const j=n.value==="dark"?t.config.theme.skin.dark.textColor:t.config.theme.skin.light.textColor;return{fontSize:`${R}px`,color:j,fontFamily:E(),textShadow:n.value==="dark"?"1px 1px 2px rgba(0,0,0,0.5)":"1px 1px 2px rgba(255,255,255,0.5)"}},u=async()=>{document.querySelectorAll("style[data-font-preview]").forEach(j=>j.remove()),r.value=!1,g.value="";try{if(t.config.theme.font.type==="preset"){const j=t.config.theme.font.preset;let rA,IA;j&&j.startsWith("font_noto_qwen_")?(rA="NotoPreview",IA="./static/fonts/noto_qwen.ttf"):(rA="PuHuiPreview",IA="./static/fonts/puhui_deepseek.ttf");const AA=document.createElement("style");AA.setAttribute("data-font-preview","true"),AA.textContent=` @font-face { font-family: '${rA}'; src: url('${IA}') format('truetype'); font-display: swap; } `,document.head.appendChild(AA),await document.fonts.load(`16px "${rA}"`),g.value=rA,r.value=!0}else if(t.config.theme.font.custom.file)try{const j=t.config.theme.font.custom.file;if(!j||typeof j!="object"||!j.size)throw new Error("字体文件对象无效");const rA="CustomFontPreview",IA=URL.createObjectURL(j),AA=document.createElement("style");AA.setAttribute("data-font-preview","true"),AA.textContent=` @font-face { font-family: '${rA}'; src: url('${IA}'); font-display: swap; } `,document.head.appendChild(AA),await document.fonts.load(`16px "${rA}"`),g.value=rA,r.value=!0}catch(j){console.warn("自定义字体预览加载失败:",j),g.value="Arial, sans-serif",r.value=!0}else g.value="system-ui",r.value=!0}catch(j){console.warn("Font loading failed:",j),g.value="system-ui",r.value=!0}},E=()=>r.value&&g.value?`"${g.value}", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif`:'"PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif',D={twemoji32:"png",twemoji64:"png","noto-emoji_64":"gif","noto-emoji_128":"gif"},c=R=>{if(t.config.theme.emoji.type==="preset"){const j=t.config.theme.emoji.preset,rA=D[j]||"png";return`./static/emojis/${j}/${R}.${rA}`}else if(t.config.theme.emoji.type==="custom"&&t.config.theme.emoji.custom.images[R])try{const j=t.config.theme.emoji.custom.images[R];if(j&&typeof j=="object"&&j.size)return URL.createObjectURL(j)}catch(j){console.warn(`表情图片预览加载失败 (${R}):`,j)}return null},p=R=>{const j=s.value.find(rA=>rA.key===R);return j?j.emoji:"😶"},d=()=>{if(t.config.theme.emoji.type==="preset"){const R=Q[t.config.theme.emoji.preset]||32;return Math.min(R+16,80)}else 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,80)}return 48},v=()=>{if(t.config.theme.emoji.type==="preset"){const R=Q[t.config.theme.emoji.preset]||32;return Math.min(R,64)}else if(t.config.theme.emoji.custom.size)return Math.min(t.config.theme.emoji.custom.size.width,t.config.theme.emoji.custom.size.height,64);return 32},b=R=>{o.value=R},N=()=>{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")},H=()=>{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})}},M=()=>{if(t.config.theme.emoji.type==="preset"&&t.config.theme.emoji.preset)return{twemoji32:"Twemoji 32×32",twemoji64:"Twemoji 64×64","noto-emoji_64":"Noto Emoji 64×64","noto-emoji_128":"Noto Emoji 128×128"}[t.config.theme.emoji.preset]||t.config.theme.emoji.preset;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")},U=()=>{const R=t.config.theme.skin.light.backgroundType==="image"?e("generateSummary.image"):e("generateSummary.color"),j=t.config.theme.skin.dark.backgroundType==="image"?e("generateSummary.image"):e("generateSummary.color");return e("generateSummary.skinLight",{type:R})+"/"+e("generateSummary.skinDark",{type:j})};return ae(()=>t.config.theme.font,()=>{u()},{deep:!0}),Ft(async()=>{a.value.length>0?o.value=a.value[0].key:o.value="",await u()}),Ci(()=>{document.querySelectorAll("style[data-font-preview]").forEach(j=>j.remove())}),(R,j)=>(T(),K("div",ky,[B("div",null,[B("h2",vy,F(R.$t("generateSummary.title")),1),B("p",Fy,F(R.$t("generateSummary.description")),1)]),B("div",Sy,[B("div",Ry,[B("h3",by,F(R.$t("generateSummary.devicePreview")),1),B("div",Ny,[B("div",Gy,[B("div",Ly,[B("div",Uy,[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",My,[B("div",xy,[o.value&&a.value.length>0?(T(),K("div",Jy,[I.value?(T(),K("img",{key:0,src:I.value,alt:o.value,style:VA(f()),class:"emoji-image"},null,12,Ty)):(T(),K("div",{key:1,style:VA(f()),class:"emoji-fallback bg-gray-200 rounded-full flex items-center justify-center text-2xl"},F(p(o.value)),5))])):(T(),K("div",Hy,[B("div",{style:VA(f()),class:"emoji-placeholder flex items-center justify-center text-gray-400 border-2 border-dashed border-gray-300 rounded bg-gray-50"},[B("div",Yy,[B("div",_y,F(A.config.theme.emoji.type==="none"?"📦":"😕"),1),B("div",Ky,F(A.config.theme.emoji.type==="none"?R.$t("emojiConfig.noEmojiPack"):R.$t("generateSummary.noEmotionConfigured")),1)])],4)]))]),A.config.theme.font.hide_subtitle?CA("",!0):(T(),K("div",{key:0,style:VA(h()),class:"text-message max-w-full break-words relative"},[r.value?CA("",!0):(T(),K("div",Oy,[B("div",Py,F(R.$t("generateSummary.fontLoading")),1)])),B("div",{class:kA({"opacity-0":!r.value})},F(i.value),3)],4))])],4)]),B("div",Vy,F(A.config.chip.display.width)+" × "+F(A.config.chip.display.height)+" "+F(A.config.chip.model.toUpperCase()),1)])])])]),B("div",Wy,[B("h3",qy,F(R.$t("generateSummary.previewSettings")),1),B("div",jy,[B("div",null,[B("label",Zy,F(R.$t("generateSummary.previewText")),1),ZA(B("textarea",{"onUpdate:modelValue":j[0]||(j[0]=rA=>i.value=rA),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",Xy,F(R.$t("generateSummary.currentEmotion")),1),a.value.length>0?(T(),K("div",zy,[(T(!0),K(qA,null,Ke(a.value,rA=>(T(),K("button",{key:rA.key,onClick:IA=>b(rA.key),class:kA(["p-2 border rounded transition-colors flex items-center justify-center",o.value===rA.key?"border-primary-500 bg-primary-50":"border-gray-200 hover:border-gray-300"]),title:rA.name,style:VA({width:d()+"px",height:d()+"px"})},[c(rA.key)?(T(),K("div",Aw,[B("img",{src:c(rA.key),alt:rA.name,style:VA({width:v()+"px",height:v()+"px"}),class:"object-contain rounded"},null,12,ew)])):(T(),K("div",tw,F(rA.emoji),1))],14,$y))),128))])):(T(),K("div",iw,[B("div",ow,F(A.config.theme.emoji.type==="none"?"📦":"😕"),1),B("div",nw,F(A.config.theme.emoji.type==="none"?R.$t("emojiConfig.noEmojiPackDescription"):R.$t("generateSummary.configureEmojiFirst")),1)]))]),B("div",null,[B("label",rw,F(R.$t("generateSummary.themeMode")),1),B("div",gw,[B("button",{onClick:j[1]||(j[1]=rA=>n.value="light"),class:kA(["flex-1 py-2 px-3 text-sm border rounded transition-colors",n.value==="light"?"border-primary-500 bg-primary-50 text-primary-700":"border-gray-300 hover:border-gray-400"])}," 🌞 "+F(R.$t("generateSummary.lightMode")),3),B("button",{onClick:j[2]||(j[2]=rA=>n.value="dark"),class:kA(["flex-1 py-2 px-3 text-sm border rounded transition-colors",n.value==="dark"?"border-primary-500 bg-primary-50 text-primary-700":"border-gray-300 hover:border-gray-400"])}," 🌙 "+F(R.$t("generateSummary.darkMode")),3)])]),B("div",sw,[B("h4",aw,F(R.$t("generateSummary.configSummary")),1),B("div",Iw,[A.config.theme.wakeword?(T(),K("div",Cw,F(R.$t("generateSummary.wakeword"))+" "+F(N()),1)):CA("",!0),B("div",lw,[B("span",null,F(R.$t("generateSummary.font"))+" "+F(H()),1),r.value?CA("",!0):(T(),K("span",Bw,F(R.$t("generateSummary.loading")),1))]),B("div",null,F(R.$t("generateSummary.emotion"))+" "+F(M()),1),B("div",null,F(R.$t("generateSummary.skin"))+" "+F(U()),1),A.config.theme.font.hide_subtitle?(T(),K("div",Qw,F(R.$t("generateSummary.hideSubtitle"))+" "+F(R.$t("common.yes")),1)):CA("",!0)])])])])]),B("div",cw,[B("button",{onClick:j[3]||(j[3]=rA=>R.$emit("prev")),class:"bg-gray-500 hover:bg-gray-600 text-white px-6 py-2 rounded-lg font-medium transition-colors"},F(R.$t("generateSummary.previous")),1),B("button",{onClick:j[4]||(j[4]=rA=>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"},[j[5]||(j[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(R.$t("generateSummary.generate")),1)])])]))}},uw=Dy(Ew,[["__scopeId","data-v-0726c332"]]);/*! https://mths.be/codepointat v0.2.0 by @mathias */String.prototype.codePointAt||function(){var A=function(){try{var t={},i=Object.defineProperty,o=i(t,t,t)&&i}catch{}return o}(),e=function(t){if(this==null)throw TypeError();var i=String(this),o=i.length,n=t?Number(t):0;if(n!=n&&(n=0),!(n<0||n>=o)){var r=i.charCodeAt(n),g;return r>=55296&&r<=56319&&o>n+1&&(g=i.charCodeAt(n+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 Eg=0,KC=-3;function ao(){this.table=new Uint16Array(16),this.trans=new Uint16Array(288)}function fw(A,e){this.source=A,this.sourceIndex=0,this.tag=0,this.bitcount=0,this.dest=e,this.destLen=0,this.ltree=new ao,this.dtree=new ao}var OC=new ao,PC=new ao,ug=new Uint8Array(30),fg=new Uint16Array(30),VC=new Uint8Array(30),WC=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]),$s=new ao,$e=new Uint8Array(320);function qC(A,e,t,i){var o,n;for(o=0;o>>=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 Nr(A,e){for(;A.bitcount<24;)A.tag|=A.source[A.sourceIndex++]<>>=1,++o,t+=e.table[o],i-=e.table[o];while(i>=0);return A.tag=n,A.bitcount-=o,e.trans[t+i]}function mw(A,e,t){var i,o,n,r,g,s;for(i=et(A,5,257),o=et(A,5,1),n=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 KC;for(A.sourceIndex+=4,i=e;i;--i)A.dest[A.destLen++]=A.source[A.sourceIndex++];return A.bitcount=0,Eg}function ww(A,e){var t=new fw(A,e),i,o,n;do{switch(i=pw(t),o=et(t,2,0),o){case 0:n=yw(t);break;case 1:n=ea(t,OC,PC);break;case 2:mw(t,t.ltree,t.dtree),n=ea(t,t.ltree,t.dtree);break;default:n=KC}if(n!==Eg)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,o,n,r,g){var s=[A,e],a=[t,i],I=[o,n],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],f=-3*s[C]+9*a[C]-9*I[C]+3*l[C],h=3*a[C]-3*s[C];if(f===0){if(Q===0)continue;var u=-h/Q;0=0&&s>0&&(g+=" "),g+=e(a)}return g}for(var i="",o=0;o=0&&A<=255,"Byte value should be between 0 and 255."),[A]};wA.BYTE=je(1);sA.CHAR=function(A){return[A.charCodeAt(0)]};wA.CHAR=je(1);sA.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};sA.USHORT=function(A){return[A>>8&255,A&255]};wA.USHORT=je(2);sA.SHORT=function(A){return A>=ia&&(A=-(2*ia-A)),[A>>8&255,A&255]};wA.SHORT=je(2);sA.UINT24=function(A){return[A>>16&255,A>>8&255,A&255]};wA.UINT24=je(3);sA.ULONG=function(A){return[A>>24&255,A>>16&255,A>>8&255,A&255]};wA.ULONG=je(4);sA.LONG=function(A){return A>=oa&&(A=-(2*oa-A)),[A>>24&255,A>>16&255,A>>8&255,A&255]};wA.LONG=je(4);sA.FIXED=sA.ULONG;wA.FIXED=wA.ULONG;sA.FWORD=sA.SHORT;wA.FWORD=wA.SHORT;sA.UFWORD=sA.USHORT;wA.UFWORD=wA.USHORT;sA.LONGDATETIME=function(A){return[0,0,0,0,A>>24&255,A>>16&255,A>>8&255,A&255]};wA.LONGDATETIME=je(8);sA.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);sA.Card8=sA.BYTE;wA.Card8=wA.BYTE;sA.Card16=sA.USHORT;wA.Card16=wA.USHORT;sA.OffSize=sA.BYTE;wA.OffSize=wA.BYTE;sA.SID=sA.USHORT;wA.SID=wA.USHORT;sA.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?sA.NUMBER16(A):sA.NUMBER32(A)};wA.NUMBER=function(A){return sA.NUMBER(A).length};sA.NUMBER16=function(A){return[28,A>>8&255,A&255]};wA.NUMBER16=je(3);sA.NUMBER32=function(A){return[29,A>>24&255,A>>16&255,A>>8&255,A&255]};wA.NUMBER32=je(5);sA.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 o="",n=0,r=e.length;n>8&255,e[e.length]=i&255}return e};wA.UTF16=function(A){return A.length*2};var Gr={"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 o=Gr[i];if(o!==void 0){for(var n="",r=0;r=128&&(n=t[n],n===void 0))return;i[o]=n}return i}};wA.MACSTRING=function(A,e){var t=sA.MACSTRING(A,e);return t!==void 0?t.length:0};function Lr(A){return A>=-128&&A<=127}function vw(A,e,t){for(var i=0,o=A.length;e>8&255,s+256&255)}return n}sA.VARDELTAS=function(A){for(var e=0,t=[];e=-128&&i<=127?e=Fw(A,e,t):e=Sw(A,e,t)}return t};sA.INDEX=function(A){for(var e=1,t=[e],i=[],o=0;o>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,o=new Array(t),n=0;n>1,e.skip("uShort",3),A.glyphIndexMap={};for(var r=new QA.Parser(t,i+o+14),g=new QA.Parser(t,i+o+16+n*2),s=new QA.Parser(t,i+o+16+n*4),a=new QA.Parser(t,i+o+16+n*6),I=i+o+16+n*8,l=0;l=0;o-=1){var n=QA.getUShort(A,e+4+o*8),r=QA.getUShort(A,e+4+o*8+2);if(n===3&&(r===0||r===1||r===10)||n===0&&(r===0||r===1||r===2||r===3||r===4)){i=QA.getULong(A,e+4+o*8+4);break}}if(i===-1)throw new Error("No valid cmap sub-tables found.");var g=new QA.Parser(A,e+i);if(t.format=g.parseUShort(),t.format===12)Mw(t,g);else if(t.format===4)xw(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 Tw(A,e,t){A.segments.push({end:e,start:e,delta:-(e-t),offset:0,glyphIndex:t})}function Hw(A){A.segments.push({end:65535,start:65535,delta:1,offset:0})}function Yw(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 o=[{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||(o=o.concat([{name:"cmap12PlatformID",type:"USHORT",value:3},{name:"cmap12EncodingID",type:"USHORT",value:10},{name:"cmap12Offset",type:"ULONG",value:0}])),o=o.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 n=new lA.Table("cmap",o);for(n.segments=[],t=0;t>4,r=o&15;if(n===t||(e+=i[n],r===t))break;e+=i[r]}return parseFloat(e)}function eD(A,e){var t,i,o,n;if(e===28)return t=A.parseByte(),i=A.parseByte(),t<<8|i;if(e===29)return t=A.parseByte(),i=A.parseByte(),o=A.parseByte(),n=A.parseByte(),t<<24|i<<16|o<<8|n;if(e===30)return AD(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 tD(A){for(var e={},t=0;t>1,s.length=0,I=!0}function b(N){for(var H,M,U,R,j,rA,IA,AA,z,oA,dA,Y,W=0;W1&&!I&&(p=s.shift()+E,I=!0),Q+=s.pop(),d(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(),o=Q+s.shift(),n=i+s.shift(),r=o+s.shift(),C=n+s.shift(),Q=r+s.shift(),g.curveTo(i,o,n,r,C,Q);break;case 10:j=s.pop()+h,rA=f[j],rA&&b(rA);break;case 11:return;case 12:switch($=N[W],W+=1,$){case 35:i=C+s.shift(),o=Q+s.shift(),n=i+s.shift(),r=o+s.shift(),IA=n+s.shift(),AA=r+s.shift(),z=IA+s.shift(),oA=AA+s.shift(),dA=z+s.shift(),Y=oA+s.shift(),C=dA+s.shift(),Q=Y+s.shift(),s.shift(),g.curveTo(i,o,n,r,IA,AA),g.curveTo(z,oA,dA,Y,C,Q);break;case 34:i=C+s.shift(),o=Q,n=i+s.shift(),r=o+s.shift(),IA=n+s.shift(),AA=r,z=IA+s.shift(),oA=r,dA=z+s.shift(),Y=Q,C=dA+s.shift(),g.curveTo(i,o,n,r,IA,AA),g.curveTo(z,oA,dA,Y,C,Q);break;case 36:i=C+s.shift(),o=Q+s.shift(),n=i+s.shift(),r=o+s.shift(),IA=n+s.shift(),AA=r,z=IA+s.shift(),oA=r,dA=z+s.shift(),Y=oA+s.shift(),C=dA+s.shift(),g.curveTo(i,o,n,r,IA,AA),g.curveTo(z,oA,dA,Y,C,Q);break;case 37:i=C+s.shift(),o=Q+s.shift(),n=i+s.shift(),r=o+s.shift(),IA=n+s.shift(),AA=r+s.shift(),z=IA+s.shift(),oA=AA+s.shift(),dA=z+s.shift(),Y=oA+s.shift(),Math.abs(dA-C)>Math.abs(Y-Q)?C=dA+s.shift():Q=Y+s.shift(),g.curveTo(i,o,n,r,IA,AA),g.curveTo(z,oA,dA,Y,C,Q);break;default:console.log("Glyph "+e.index+": unknown operator 1200"+$),s.length=0}break;case 14:s.length>0&&!I&&(p=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&&(p=s.shift()+E,I=!0),Q+=s.pop(),C+=s.pop(),d(C,Q);break;case 22:s.length>1&&!I&&(p=s.shift()+E,I=!0),C+=s.pop(),d(C,Q);break;case 23:v();break;case 24:for(;s.length>2;)i=C+s.shift(),o=Q+s.shift(),n=i+s.shift(),r=o+s.shift(),C=n+s.shift(),Q=r+s.shift(),g.curveTo(i,o,n,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(),o=Q+s.shift(),n=i+s.shift(),r=o+s.shift(),C=n+s.shift(),Q=r+s.shift(),g.curveTo(i,o,n,r,C,Q);break;case 26:for(s.length%2&&(C+=s.shift());s.length>0;)i=C,o=Q+s.shift(),n=i+s.shift(),r=o+s.shift(),C=n,Q=r+s.shift(),g.curveTo(i,o,n,r,C,Q);break;case 27:for(s.length%2&&(Q+=s.shift());s.length>0;)i=C+s.shift(),o=Q,n=i+s.shift(),r=o+s.shift(),C=n+s.shift(),Q=r,g.curveTo(i,o,n,r,C,Q);break;case 28:H=N[W],M=N[W+1],s.push((H<<24|M<<16)>>16),W+=2;break;case 29:j=s.pop()+A.gsubrsBias,rA=A.gsubrs[j],rA&&b(rA);break;case 30:for(;s.length>0&&(i=C,o=Q+s.shift(),n=i+s.shift(),r=o+s.shift(),C=n+s.shift(),Q=r+(s.length===1?s.shift():0),g.curveTo(i,o,n,r,C,Q),s.length!==0);)i=C+s.shift(),o=Q,n=i+s.shift(),r=o+s.shift(),Q=r+s.shift(),C=n+(s.length===1?s.shift():0),g.curveTo(i,o,n,r,C,Q);break;case 31:for(;s.length>0&&(i=C+s.shift(),o=Q,n=i+s.shift(),r=o+s.shift(),Q=r+s.shift(),C=n+(s.length===1?s.shift():0),g.curveTo(i,o,n,r,C,Q),s.length!==0);)i=C,o=Q+s.shift(),n=i+s.shift(),r=o+s.shift(),C=n+s.shift(),Q=r+(s.length===1?s.shift():0),g.curveTo(i,o,n,r,C,Q);break;default:$<32?console.log("Glyph "+e.index+": unknown operator "+$):$<247?s.push($-139):$<251?(H=N[W],W+=1,s.push(($-247)*256+H+108)):$<255?(H=N[W],W+=1,s.push(-($-251)*256-H-108)):(H=N[W],M=N[W+1],U=N[W+2],R=N[W+3],W+=4,s.push((H<<24|M<<16|U<<8|R)/65536))}}}return b(t),e.advanceWidth=p,g}function gD(A,e,t,i){var o=[],n,r=new QA.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 "+n+" (FD count "+i+")");o.push(n)}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 "+n+" (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+Vo.length:(t=Vo.length+e.length,e.push(A)),t}function aD(){return new lA.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 ID(A){var e=new lA.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 TD(A){return new lA.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 Tr={parse:JD,make:TD,unicodeRanges:Jr,getUnicodeRange:xD};function HD(A,e){var t={},i=new QA.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 o=0;o=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(o),e}function ca(A,e,t){for(var i=0;i0){var n=A.glyphs.get(o);return n.getMetrics()}}return t}function VD(A){for(var e=0,t=0;tu||s===void 0)&&u>0&&(s=u),a 123 are reserved for internal usage");if(h.name!==".notdef"){var D=h.getMetrics();e.push(D.xMin),t.push(D.yMin),i.push(D.xMax),o.push(D.yMax),r.push(D.leftSideBearing),g.push(D.rightSideBearing),n.push(h.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,o),advanceWidthMax:Math.max.apply(null,n),advanceWidthAvg:VD(n),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 p=al.make({flags:3,unitsPerEm:A.unitsPerEm,xMin:c.xMin,yMin:c.yMin,xMax:c.xMax,yMax:c.yMax,lowestRecPPEM:3,createdTimestamp:A.createdTimestamp}),d=Il.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=Bl.make(A.glyphs.length),b=Tr.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:ca(A,"xyvw",{yMax:Math.round(c.ascender/2)}).yMax,sCapHeight:ca(A,"HIKLEFJMNTZBDPRAGOQSUVWXY",c).yMax,usDefaultChar:A.hasChar(" ")?32:0,usBreakChar:A.hasChar(" ")?32:0},A.tables.os2)),N=Cl.make(A.glyphs),H=XC.make(A.glyphs),M=A.getEnglishName("fontFamily"),U=A.getEnglishName("fontSubfamily"),R=M+" "+U,j=A.getEnglishName("postScriptName");j||(j=M.replace(/\s/g,"")+"-"+U);var rA={};for(var IA in A.names)rA[IA]=A.names[IA];rA.uniqueID||(rA.uniqueID={en:A.getEnglishName("manufacturer")+":"+R}),rA.postScriptName||(rA.postScriptName={en:j}),rA.preferredFamily||(rA.preferredFamily=A.names.fontFamily),rA.preferredSubfamily||(rA.preferredSubfamily=A.names.fontSubfamily);var AA=[],z=fl.make(rA,AA),oA=AA.length>0?ll.make(AA):void 0,dA=hl.make(),Y=sl.make(A.glyphs,{version:A.getEnglishName("version"),fullName:R,familyName:M,weightName:U,postScriptName:j,unitsPerEm:A.unitsPerEm,fontBBox:[0,c.yMin,c.ascender,c.advanceWidthMax]}),W=A.metas&&Object.keys(A.metas).length>0?pl.make(A.metas):void 0,$=[p,d,v,b,z,H,dA,Y,N];oA&&$.push(oA),A.tables.gsub&&$.push(dl.make(A.tables.gsub)),W&&$.push(W);for(var DA=ml($),NA=DA.encode(),oe=mg(NA),LA=DA.fields,_=!1,eA=0;eA>>1,n=A[o].tag;if(n===e)return o;n>>1,n=A[o];if(n===e)return o;n>>1;t=A[n];var r=t.start;if(r===e)return t;r0)return t=A[i-1],e>t.end?0:t}function mo(A,e){this.font=A,this.tableName=e}mo.prototype={searchTag:Xn,binSearch:Ea,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[o].script;if(e){var n={tag:A,script:{defaultLangSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]},langSysRecords:[]}};return i.splice(-1-o,0,n),n.script}}},getLangSysTable:function(A,e,t){var i=this.getScriptTable(A,t);if(i){if(!e||e==="dflt"||e==="DFLT")return i.defaultLangSys;var o=Xn(i.langSysRecords,e);if(o>=0)return i.langSysRecords[o].langSys;if(t){var n={tag:e,langSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]}};return i.langSysRecords.splice(-1-o,0,n),n.langSys}}},getFeatureTable:function(A,e,t,i){var o=this.getLangSysTable(A,e,i);if(o){for(var n,r=o.featureIndexes,g=this.font.tables[this.tableName].features,s=0;s=g[a-1].tag,"Features must be added in alphabetical order."),n={tag:t,feature:{params:0,lookupListIndexes:[]}},g.push(n),r.push(a),n.feature}}},getLookupTables:function(A,e,t,i,o){var n=this.getFeatureTable(A,e,t,o),r=[];if(n){for(var g,s=n.lookupListIndexes,a=this.font.tables[this.tableName].lookups,I=0;I=0?t:-1;case 2:var i=ua(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 o=this.getLookupTables(t,i,A,2,!0)[0],n=yg(o,1,{substFormat:1,coverage:{format:1,glyphs:[]},sequences:[]});mA.assert(n.coverage.format===1,"Multiple: unable to modify coverage table format "+n.coverage.format);var r=e.sub,g=this.binSearch(n.coverage.glyphs,r);g<0&&(g=-1-g,n.coverage.glyphs.splice(g,0,r),n.sequences.splice(g,0,0)),n.sequences[g]=e.by};Ge.prototype.addAlternate=function(A,e,t,i){var o=this.getLookupTables(t,i,A,3,!0)[0],n=yg(o,1,{substFormat:1,coverage:{format:1,glyphs:[]},alternateSets:[]});mA.assert(n.coverage.format===1,"Alternate: unable to modify coverage table format "+n.coverage.format);var r=e.sub,g=this.binSearch(n.coverage.glyphs,r);g<0&&(g=-1-g,n.coverage.glyphs.splice(g,0,r),n.alternateSets.splice(g,0,0)),n.alternateSets[g]=e.by};Ge.prototype.addLigature=function(A,e,t,i){var o=this.getLookupTables(t,i,A,4,!0)[0],n=o.subtables[0];n||(n={substFormat:1,coverage:{format:1,glyphs:[]},ligatureSets:[]},o.subtables[0]=n),mA.assert(n.coverage.format===1,"Ligature: unable to modify coverage table format "+n.coverage.format);var r=e.sub[0],g=e.sub.slice(1),s={ligGlyph:e.by,components:g},a=this.binSearch(n.coverage.glyphs,r);if(a>=0){for(var I=n.ligatureSets[a],l=0;l0?(n=A.parseByte(),e&o||(n=-n),n=t+n):(e&o)>0?n=t:n=t+A.parseShort(),n}function wl(A,e,t){var i=new QA.Parser(e,t);A.numberOfContours=i.parseShort(),A._xMin=i.parseShort(),A._yMin=i.parseShort(),A._xMax=i.parseShort(),A._yMax=i.parseShort();var o,n;if(A.numberOfContours>0){for(var r=A.endPointIndices=[],g=0;g0)for(var l=i.parseByte(),C=0;C0){var Q=[],f;if(a>0){for(var h=0;h=0,Q.push(f);for(var u=0,E=0;E0?(o&2)>0?(d.dx=i.parseShort(),d.dy=i.parseShort()):d.matchedPoints=[i.parseUShort(),i.parseUShort()]:(o&2)>0?(d.dx=i.parseChar(),d.dy=i.parseChar()):d.matchedPoints=[i.parseByte(),i.parseByte()],(o&8)>0?d.xScale=d.yScale=i.parseF2Dot14():(o&64)>0?(d.xScale=i.parseF2Dot14(),d.yScale=i.parseF2Dot14()):(o&128)>0&&(d.xScale=i.parseF2Dot14(),d.scale01=i.parseF2Dot14(),d.scale10=i.parseF2Dot14(),d.yScale=i.parseF2Dot14()),A.components.push(d),p=!!(o&32)}if(o&256){A.instructionLength=i.parseUShort(),A.instructions=[];for(var v=0;ve.points.length-1||i.matchedPoints[1]>o.points.length-1)throw Error("Matched points out of range in "+e.name);var r=e.points[i.matchedPoints[0]],g=o.points[i.matchedPoints[1]],s={xScale:i.xScale,scale01:i.scale01,scale10:i.scale10,yScale:i.yScale,dx:0,dy:0};g=zn([g],s)[0],s.dx=r.x-g.x,s.dy=r.y-g.y,n=zn(o.points,s)}e.points=e.points.concat(n)}}return Dl(e.points)}function $D(A,e,t,i){for(var o=new at.GlyphSet(i),n=0;n2)){var t=this.font,i=this._prepState;if(!i||i.ppem!==e){var o=this._fpgmState;if(!o){Ht.prototype=gk,o=this._fpgmState=new Ht("fpgm",t.tables.fpgm),o.funcs=[],o.font=t,exports.DEBUG&&(console.log("---EXEC FPGM---"),o.step=-1);try{ai(o)}catch(a){console.log("Hinting error in FPGM:"+a),this._errorState=3;return}}Ht.prototype=o,i=this._prepState=new Ht("prep",t.tables.prep),i.ppem=e;var n=t.tables.cvt;if(n)for(var r=i.cvt=new Array(n.length),g=e/t.unitsPerEm,s=0;s1))try{return Sl(A,i)}catch(a){this._errorState<1&&(console.log("Hinting error:"+a),console.log("Note: further hinting errors are silenced")),this._errorState=1;return}}};Sl=function(A,e){var t=e.ppem/e.font.unitsPerEm,i=t,o=A.components,n,r,g;if(Ht.prototype=e,!o)g=new Ht("glyf",A.instructions),exports.DEBUG&&(console.log("---EXEC GLYPH---"),g.step=-1),Hr(A,g,t,i),r=g.gZone;else{var s=e.font;r=[],n=[];for(var a=0;a=176&&n<=183)i+=n-176+1;else if(n>=184&&n<=191)i+=(n-184+1)*2;else if(e&&o===1&&n===27)break;while(o>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 da(A,e){exports.DEBUG&&console.log(e.step,"SPVTCA["+A.axis+"]"),e.pv=e.dpv=A}function pa(A,e){exports.DEBUG&&console.log(e.step,"SFVTCA["+A.axis+"]"),e.fv=A}function ma(A,e){var t=e.stack,i=t.pop(),o=t.pop(),n=e.z2[i],r=e.z1[o];exports.DEBUG&&console.log("SPVTL["+A+"]",i,o);var g,s;A?(g=n.y-r.y,s=r.x-n.x):(g=r.x-n.x,s=r.y-n.y),e.pv=e.dpv=Do(g,s)}function ya(A,e){var t=e.stack,i=t.pop(),o=t.pop(),n=e.z2[i],r=e.z1[o];exports.DEBUG&&console.log("SFVTL["+A+"]",i,o);var g,s;A?(g=n.y-r.y,s=r.x-n.x):(g=r.x-n.x,s=r.y-n.y),e.fv=Do(g,s)}function sk(A){var e=A.stack,t=e.pop(),i=e.pop();exports.DEBUG&&console.log(A.step,"SPVFS[]",t,i),A.pv=A.dpv=Do(i,t)}function ak(A){var e=A.stack,t=e.pop(),i=e.pop();exports.DEBUG&&console.log(A.step,"SPVFS[]",t,i),A.fv=Do(i,t)}function Ik(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 Ck(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 lk(A){A.fv=A.pv,exports.DEBUG&&console.log(A.step,"SFVTPV[]")}function Bk(A){var e=A.stack,t=e.pop(),i=e.pop(),o=e.pop(),n=e.pop(),r=e.pop(),g=A.z0,s=A.z1,a=g[t],I=g[i],l=s[o],C=s[n],Q=A.z2[r];exports.DEBUG&&console.log("ISECT[], ",t,i,o,n,r);var f=a.x,h=a.y,u=I.x,E=I.y,D=l.x,c=l.y,p=C.x,d=C.y,v=(f-u)*(c-d)-(h-E)*(D-p),b=f*E-h*u,N=D*d-c*p;Q.x=(b*(D-p)-N*(f-u))/v,Q.y=(b*(c-d)-N*(h-E))/v}function Qk(A){A.rp0=A.stack.pop(),exports.DEBUG&&console.log(A.step,"SRP0[]",A.rp0)}function ck(A){A.rp1=A.stack.pop(),exports.DEBUG&&console.log(A.step,"SRP1[]",A.rp1)}function Ek(A){A.rp2=A.stack.pop(),exports.DEBUG&&console.log(A.step,"SRP2[]",A.rp2)}function uk(A){var e=A.stack.pop();switch(exports.DEBUG&&console.log(A.step,"SZP0[]",e),A.zp0=e,e){case 0:A.tZone||Gn(A),A.z0=A.tZone;break;case 1:A.z0=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,"SZP1[]",e),A.zp1=e,e){case 0:A.tZone||Gn(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||Gn(A),A.z2=A.tZone;break;case 1:A.z2=A.gZone;break;default:throw new Error("Invalid zone pointer")}}function dk(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||Gn(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 pk(A){A.loop=A.stack.pop(),exports.DEBUG&&console.log(A.step,"SLOOP[]",A.loop)}function mk(A){exports.DEBUG&&console.log(A.step,"RTG[]"),A.round=bl}function yk(A){exports.DEBUG&&console.log(A.step,"RTHG[]"),A.round=ok}function wk(A){var e=A.stack.pop();exports.DEBUG&&console.log(A.step,"SMD[]",e),A.minDis=e/64}function Dk(A){exports.DEBUG&&console.log(A.step,"ELSE[]"),Gl(A,!1)}function kk(A){var e=A.stack.pop();exports.DEBUG&&console.log(A.step,"JMPR[]",e),A.ip+=e-1}function vk(A){var e=A.stack.pop();exports.DEBUG&&console.log(A.step,"SCVTCI[]",e),A.cvCutIn=e/64}function Fk(A){var e=A.stack;exports.DEBUG&&console.log(A.step,"DUP[]"),e.push(e[e.length-1])}function $n(A){exports.DEBUG&&console.log(A.step,"POP[]"),A.stack.pop()}function Sk(A){exports.DEBUG&&console.log(A.step,"CLEAR[]"),A.stack.length=0}function Rk(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 bk(A){var e=A.stack;exports.DEBUG&&console.log(A.step,"DEPTH[]"),e.push(e.length)}function Nk(A){var e=A.stack,t=e.pop(),i=e.pop();exports.DEBUG&&console.log(A.step,"LOOPCALL[]",t,i);var o=A.ip,n=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 va(A,e){var t=e.stack,i=A?e.rp1:e.rp2,o=(A?e.z0:e.z1)[i],n=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(o,o,!1,!0);do a!==o&&n.setRelative(a,a,I,r),a=a.nextPointOnContour;while(a!==s)}function Fa(A,e){var t=e.stack,i=A?e.rp1:e.rp2,o=(A?e.z0:e.z1)[i],n=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(o,o,!1,!0),l=s.length-2,C=0;C1?"loop "+(A.loop-t)+": ":"")+"SHPIX[]",r,o),i.setRelative(g,g,o),i.touch(g)}A.loop=1}function Jk(A){for(var e=A.stack,t=A.rp1,i=A.rp2,o=A.loop,n=A.z0[t],r=A.z1[i],g=A.fv,s=A.dpv,a=A.z2;o--;){var I=e.pop(),l=a[I];exports.DEBUG&&console.log(A.step,(A.loop>1?"loop "+(A.loop-o)+": ":"")+"IP[]",I,t,"<->",i),g.interpolate(l,n,r,s),g.touch(l)}A.loop=1}function Sa(A,e){var t=e.stack,i=t.pop()/64,o=t.pop(),n=e.z1[o],r=e.z0[e.rp0],g=e.fv,s=e.pv;g.setRelative(n,r,i,s),g.touch(n),exports.DEBUG&&console.log(e.step,"MSIRP["+A+"]",i,o),e.rp1=e.rp0,e.rp2=o,A&&(e.rp0=o)}function Tk(A){for(var e=A.stack,t=A.rp0,i=A.z0[t],o=A.loop,n=A.fv,r=A.pv,g=A.z1;o--;){var s=e.pop(),a=g[s];exports.DEBUG&&console.log(A.step,(A.loop>1?"loop "+(A.loop-o)+": ":"")+"ALIGNRP[]",s),n.setRelative(a,i,0,r),n.touch(a)}A.loop=1}function Hk(A){exports.DEBUG&&console.log(A.step,"RTDG[]"),A.round=ik}function Ra(A,e){var t=e.stack,i=t.pop(),o=t.pop(),n=e.z0[o],r=e.fv,g=e.pv,s=e.cvt[i];exports.DEBUG&&console.log(e.step,"MIAP["+A+"]",i,"(",s,")",o);var a=g.distance(n,lo);A&&(Math.abs(a-s)",g),e.stack.push(Math.round(g*64))}function Wk(A){exports.DEBUG&&console.log(A.step,"MPPEM[]"),A.stack.push(A.ppem)}function qk(A){exports.DEBUG&&console.log(A.step,"FLIPON[]"),A.autoFlip=!0}function jk(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 zk(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 $k(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 Av(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 ev(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 tv(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 iv(A){var e=A.stack.pop();exports.DEBUG&&console.log(A.step,"IF[]",e),e||(Gl(A,!0),exports.DEBUG&&console.log(A.step,"EIF[]"))}function ov(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 rv(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 gv(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(),o=e.fv,n=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 f=(C&15)-8;f>=0&&f++,exports.DEBUG&&console.log(e.step,"DELTAPFIX",l,"by",f*s);var h=a[l];o.setRelative(h,h,f*s,n)}}}function sv(A){var e=A.stack,t=e.pop();exports.DEBUG&&console.log(A.step,"SDB[]",t),A.deltaBase=t}function av(A){var e=A.stack,t=e.pop();exports.DEBUG&&console.log(A.step,"SDS[]",t),A.deltaShift=Math.pow(.5,t)}function Iv(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 Cv(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 lv(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 Bv(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 Qv(A){var e=A.stack,t=e.pop();exports.DEBUG&&console.log(A.step,"ABS[]",t),e.push(Math.abs(t))}function cv(A){var e=A.stack,t=e.pop();exports.DEBUG&&console.log(A.step,"NEG[]",t),e.push(-t)}function Ev(A){var e=A.stack,t=e.pop();exports.DEBUG&&console.log(A.step,"FLOOR[]",t),e.push(Math.floor(t/64)*64)}function uv(A){var e=A.stack,t=e.pop();exports.DEBUG&&console.log(A.step,"CEILING[]",t),e.push(Math.ceil(t/64)*64)}function xo(A,e){var t=e.stack,i=t.pop();exports.DEBUG&&console.log(e.step,"ROUND[]"),t.push(e.round(i/64)*64)}function fv(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(),o=e.ppem,n=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===o){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=Nl;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 dv(A){var e=A.stack.pop();exports.DEBUG&&console.log(A.step,"S45ROUND[]",e),A.round=Nl;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 pv(A){exports.DEBUG&&console.log(A.step,"ROFF[]"),A.round=tk}function mv(A){exports.DEBUG&&console.log(A.step,"RUTG[]"),A.round=nk}function yv(A){exports.DEBUG&&console.log(A.step,"RDTG[]"),A.round=rk}function wv(A){var e=A.stack.pop();exports.DEBUG&&console.log(A.step,"SCANCTRL[]",e)}function Ga(A,e){var t=e.stack,i=t.pop(),o=t.pop(),n=e.z2[i],r=e.z1[o];exports.DEBUG&&console.log(e.step,"SDPVTL["+A+"]",i,o);var g,s;A?(g=n.y-r.y,s=r.x-n.x):(g=r.x-n.x,s=r.y-n.y),e.dpv=Do(g,s)}function Dv(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 kv(A){var e=A.stack,t=e.pop(),i=e.pop(),o=e.pop();exports.DEBUG&&console.log(A.step,"ROLL[]"),e.push(i),e.push(t),e.push(o)}function vv(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 Fv(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 Sv(A){var e=A.stack.pop();exports.DEBUG&&console.log(A.step,"SCANTYPE[]",e)}function Rv(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,o=e.ip;exports.DEBUG&&console.log(e.step,"PUSHB["+A+"]");for(var n=0;n=0?1:-1,u=Math.abs(u),A&&(D=n.cvt[g],i&&Math.abs(u-D)":"_")+(i?"R":"_")+(o===0?"Gr":o===1?"Bl":o===2?"Wh":"")+"]",A?g+"("+n.cvt[g]+","+D+")":"",s,"(d =",h,"->",E*u,")"),n.rp1=n.rp0,n.rp2=s,e&&(n.rp0=s)}Fl=[ha.bind(void 0,pt),ha.bind(void 0,ot),da.bind(void 0,pt),da.bind(void 0,ot),pa.bind(void 0,pt),pa.bind(void 0,ot),ma.bind(void 0,0),ma.bind(void 0,1),ya.bind(void 0,0),ya.bind(void 0,1),sk,ak,Ik,Ck,lk,Bk,Qk,ck,Ek,uk,fk,hk,dk,pk,mk,yk,wk,Dk,kk,vk,void 0,void 0,Fk,$n,Sk,Rk,bk,Lk,Uk,void 0,void 0,void 0,Nk,Gk,Mk,void 0,wa.bind(void 0,0),wa.bind(void 0,1),Da.bind(void 0,pt),Da.bind(void 0,ot),ka.bind(void 0,0),ka.bind(void 0,1),va.bind(void 0,0),va.bind(void 0,1),Fa.bind(void 0,0),Fa.bind(void 0,1),xk,Jk,Sa.bind(void 0,0),Sa.bind(void 0,1),Tk,Hk,Ra.bind(void 0,0),Ra.bind(void 0,1),Yk,_k,Kk,Ok,Pk,Vk,ba.bind(void 0,0),ba.bind(void 0,1),void 0,Na.bind(void 0,0),Na.bind(void 0,1),Wk,void 0,qk,void 0,void 0,jk,Zk,Xk,zk,$k,Av,ev,tv,iv,ov,nv,rv,gv,Ar.bind(void 0,1),sv,av,Iv,Cv,lv,Bv,Qv,cv,Ev,uv,xo.bind(void 0,0),xo.bind(void 0,1),xo.bind(void 0,2),xo.bind(void 0,3),void 0,void 0,void 0,void 0,fv,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,dv,void 0,void 0,pv,void 0,mv,yv,$n,$n,void 0,void 0,void 0,void 0,void 0,wv,Ga.bind(void 0,0),Ga.bind(void 0,1),Dv,void 0,kv,vv,Fv,Sv,Rv,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),BA.bind(void 0,0,0,0,0,0),BA.bind(void 0,0,0,0,0,1),BA.bind(void 0,0,0,0,0,2),BA.bind(void 0,0,0,0,0,3),BA.bind(void 0,0,0,0,1,0),BA.bind(void 0,0,0,0,1,1),BA.bind(void 0,0,0,0,1,2),BA.bind(void 0,0,0,0,1,3),BA.bind(void 0,0,0,1,0,0),BA.bind(void 0,0,0,1,0,1),BA.bind(void 0,0,0,1,0,2),BA.bind(void 0,0,0,1,0,3),BA.bind(void 0,0,0,1,1,0),BA.bind(void 0,0,0,1,1,1),BA.bind(void 0,0,0,1,1,2),BA.bind(void 0,0,0,1,1,3),BA.bind(void 0,0,1,0,0,0),BA.bind(void 0,0,1,0,0,1),BA.bind(void 0,0,1,0,0,2),BA.bind(void 0,0,1,0,0,3),BA.bind(void 0,0,1,0,1,0),BA.bind(void 0,0,1,0,1,1),BA.bind(void 0,0,1,0,1,2),BA.bind(void 0,0,1,0,1,3),BA.bind(void 0,0,1,1,0,0),BA.bind(void 0,0,1,1,0,1),BA.bind(void 0,0,1,1,0,2),BA.bind(void 0,0,1,1,0,3),BA.bind(void 0,0,1,1,1,0),BA.bind(void 0,0,1,1,1,1),BA.bind(void 0,0,1,1,1,2),BA.bind(void 0,0,1,1,1,3),BA.bind(void 0,1,0,0,0,0),BA.bind(void 0,1,0,0,0,1),BA.bind(void 0,1,0,0,0,2),BA.bind(void 0,1,0,0,0,3),BA.bind(void 0,1,0,0,1,0),BA.bind(void 0,1,0,0,1,1),BA.bind(void 0,1,0,0,1,2),BA.bind(void 0,1,0,0,1,3),BA.bind(void 0,1,0,1,0,0),BA.bind(void 0,1,0,1,0,1),BA.bind(void 0,1,0,1,0,2),BA.bind(void 0,1,0,1,0,3),BA.bind(void 0,1,0,1,1,0),BA.bind(void 0,1,0,1,1,1),BA.bind(void 0,1,0,1,1,2),BA.bind(void 0,1,0,1,1,3),BA.bind(void 0,1,1,0,0,0),BA.bind(void 0,1,1,0,0,1),BA.bind(void 0,1,1,0,0,2),BA.bind(void 0,1,1,0,0,3),BA.bind(void 0,1,1,0,1,0),BA.bind(void 0,1,1,0,1,1),BA.bind(void 0,1,1,0,1,2),BA.bind(void 0,1,1,0,1,3),BA.bind(void 0,1,1,1,0,0),BA.bind(void 0,1,1,1,0,1),BA.bind(void 0,1,1,1,0,2),BA.bind(void 0,1,1,1,0,3),BA.bind(void 0,1,1,1,1,0),BA.bind(void 0,1,1,1,1,1),BA.bind(void 0,1,1,1,1,2),BA.bind(void 0,1,1,1,1,3)];function Ui(A){this.char=A,this.state={},this.activeState=null}function wg(A,e,t){this.contextName=t,this.startIndex=A,this.endOffset=e}function bv(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 Ln(A){this.eventId=A,this.subscribers=[]}function Nv(A){var e=this,t=["start","end","next","newToken","contextStart","contextEnd","insertToken","removeToken","removeRange","replaceToken","replaceRange","composeRUD","updateContextsRanges"];t.forEach(function(o){Object.defineProperty(e.events,o,{value:new Ln(o)})}),A&&t.forEach(function(o){var n=A[o];typeof n=="function"&&e.events[o].subscribe(n)});var i=["insertToken","removeToken","removeRange","replaceToken","replaceRange","composeRUD"];i.forEach(function(o){e.events[o].subscribe(e.updateContextsRanges)})}function zA(A){this.tokens=[],this.registeredContexts={},this.contextCheckers=[],this.events={},this.registeredModifiers=[],Nv.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 wg)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 Ln&&i.subscribers.forEach(function(o){o.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 bv(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=o.start&&A<=o.end){var n=A-o.start;return o.index+n}}break;default:return-1}return-1}function Lv(A,e){var t=ko(A,e.coverage);return t===-1?null:A+e.deltaGlyphId}function Uv(A,e){var t=ko(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],o=Ll(i),n=Pt(i);if(!o&&!n)return!0;if(o)return!1}return!1}function Zv(A){if(Ll(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 qD.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),o=0;o=1.2&&(o.markGlyphSets=t.parsePointer(hF)),o}var pF={parse:dF},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),o=this.parseUShort(),n=this.parseUShort();if(t===1)return{posFormat:t,coverage:i,valueFormat1:o,valueFormat2:n,pairSets:this.parseList(J.pointer(J.list(function(){return{secondGlyph:this.parseUShort(),value1:this.parseValueRecord(o),value2:this.parseValueRecord(n)}})))};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:o,valueFormat2:n,classDef1:r,classDef2:g,class1Count:s,class2Count:a,classRecords:this.parseList(s,J.list(a,function(){return{value1:this.parseValueRecord(o),value2:this.parseValueRecord(n)}}))}}};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 mF(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 yF=new Array(10);function wF(A){return new lA.Table("GPOS",[{name:"version",type:"ULONG",value:65536},{name:"scripts",type:"TABLE",value:new lA.ScriptList(A.scripts)},{name:"features",type:"TABLE",value:new lA.FeatureList(A.features)},{name:"lookups",type:"TABLE",value:new lA.LookupList(A.lookups,yF)}])}var DF={parse:mF,make:wF};function kF(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 o=0;o1&&console.warn("Only the first kern subtable is supported."),A.skip("uLong");var i=A.parseUShort(),o=i&255;if(A.skip("uShort"),o===0){var n=A.parseUShort();A.skip("uShort",3);for(var r=0;r"u",o=i&&!t.isUrl?NF:GF;return new Promise(function(n,r){o(A,function(g,s){if(g){if(e)return e(g);r(g)}var a;try{a=vg(s,t)}catch(I){if(e)return e(I,null);r(I)}if(e)return e(null,a);n(a)})})}function MF(A,e){var t=require("fs"),i=t.readFileSync(A);return vg(yl(i),e)}var Yr=Object.freeze({__proto__:null,Font:YA,Glyph:Ne,Path:ie,BoundingBox:St,_parse:QA,parse:vg,load:UF,loadSync:MF});const xF="modulepreload",JF=function(A,e){return new URL(A,e).href},Ja={},Ml=function(e,t,i){let o=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"));o=Promise.allSettled(t.map(a=>{if(a=JF(a,i),a in Ja)return;Ja[a]=!0;const I=a.endsWith(".css"),l=I?'[rel="stylesheet"]':"";if(!!i)for(let f=r.length-1;f>=0;f--){const h=r[f];if(h.href===a&&(!I||h.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${a}"]${l}`))return;const Q=document.createElement("link");if(Q.rel=I?"stylesheet":xF,I||(Q.as="script"),Q.crossOrigin="",Q.href=a,s&&Q.setAttribute("nonce",s),document.head.appendChild(Q),I)return new Promise((f,h)=>{Q.addEventListener("load",f),Q.addEventListener("error",()=>h(new Error(`Unable to preload CSS for ${a}`)))})}))}function n(r){const g=new Event("vite:preloadError",{cancelable:!0});if(g.payload=r,window.dispatchEvent(g),!g.defaultPrevented)throw r}return o.then(r=>{for(const g of r||[])g.status==="rejected"&&n(g.reason);return e().catch(n)})},TF=()=>Ml(()=>import("./ft_render-ByO_jG18.js"),[],import.meta.url);let Z=null,Bo=0;const HF=new Promise(A=>{TF().then(e=>{e.default().then(t=>{Z=t,A()})})});function Ta(A){return A/65536}function Ue(A){return A/64}function Hi(A){return A>=0?A:A+256}let xl,Jl,Tl,Fg,Hl,Yl,_l;async function YF(){if(await HF,Z._init_constants(),xl=Z.cwrap("FT_New_Memory_Face","number",["number","number","number","number","number"]),Jl=Z.cwrap("FT_Set_Char_Size","number",["number","number","number","number","number"]),Tl=Z.cwrap("FT_Set_Pixel_Sizes","number",["number","number","number"]),Fg=Z.cwrap("FT_Get_Char_Index","number",["number","number"]),Hl=Z.cwrap("FT_Load_Glyph","number",["number","number","number"]),Yl=Z.cwrap("FT_Get_Sfnt_Table","number",["number","number"]),Z.cwrap("FT_Get_Kerning","number",["number","number","number","number","number"]),_l=Z.cwrap("FT_Done_Face","number",["number"]),!Bo){let A=Z._malloc(4);try{let e=Z.ccall("FT_Init_FreeType","number",["number"],[A]);if(e)throw new Error(`error in FT_Init_FreeType: ${e}`);Bo=Z.getValue(A,"i32")}finally{Z._free(A)}}}function _F(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 o={ptr:0,font:Z._malloc(i)};const n=A instanceof ArrayBuffer?new Uint8Array(A):A;Z.writeArrayToMemory(n,o.font);let r=Z._malloc(4);try{if(t=xl(Bo,o.font,i,0,r),t)throw new Error(`error in FT_New_Memory_Face: ${t}`);o.ptr=Z.getValue(r,"i32")}finally{Z._free(r)}if(t=Jl(o.ptr,0,e*64,300,300),t)throw new Error(`error in FT_Set_Char_Size: ${t}`);if(t=Tl(o.ptr,0,e),t)throw new Error(`error in FT_Set_Pixel_Sizes: ${t}`);let g=Z.getValue(o.ptr+Z.OFFSET_FACE_UNITS_PER_EM,"i16"),s=Z.getValue(o.ptr+Z.OFFSET_FACE_ASCENDER,"i16"),a=Z.getValue(o.ptr+Z.OFFSET_FACE_DESCENDER,"i16"),I=Z.getValue(o.ptr+Z.OFFSET_FACE_HEIGHT,"i16");return Object.assign(o,{units_per_em:g,ascender:s,descender:a,height:I})}function KF(A){let e=Yl(A.ptr,Z.FT_SFNT_OS2);if(!e)throw new Error("os/2 table not found for this font");let t=Z.getValue(e+Z.OFFSET_TT_OS2_ASCENDER,"i16"),i=Z.getValue(e+Z.OFFSET_TT_OS2_DESCENDER,"i16"),o=Z.getValue(e+Z.OFFSET_TT_OS2_LINEGAP,"i16");return{typoAscent:t,typoDescent:i,typoLineGap:o}}function or(A,e){return Fg(A.ptr,e)!==0}function OF(A,e,t={}){let i=Fg(A.ptr,e);if(i===0)throw new Error(`glyph does not exist for codepoint ${e}`);let o=Z.FT_LOAD_RENDER;t.mono?o|=Z.FT_LOAD_TARGET_MONO:t.lcd?o|=Z.FT_LOAD_TARGET_LCD:t.lcd_v?o|=Z.FT_LOAD_TARGET_LCD_V:t.autohint_strong?o|=Z.FT_LOAD_TARGET_NORMAL:o|=Z.FT_LOAD_TARGET_LIGHT,t.autohint_off?o|=Z.FT_LOAD_NO_AUTOHINT:o|=Z.FT_LOAD_FORCE_AUTOHINT,t.use_color_info&&(o|=Z.FT_LOAD_COLOR);let n=Hl(A.ptr,i,o);if(n)throw new Error(`error in FT_Load_Glyph: ${n}`);let r=Z.getValue(A.ptr+Z.OFFSET_FACE_GLYPH,"i32"),g={glyph_index:Z.getValue(r+Z.OFFSET_GLYPH_INDEX,"i32"),metrics:{width:Ue(Z.getValue(r+Z.OFFSET_GLYPH_METRICS_WIDTH,"i32")),height:Ue(Z.getValue(r+Z.OFFSET_GLYPH_METRICS_HEIGHT,"i32")),horiBearingX:Ue(Z.getValue(r+Z.OFFSET_GLYPH_METRICS_HORI_BEARING_X,"i32")),horiBearingY:Ue(Z.getValue(r+Z.OFFSET_GLYPH_METRICS_HORI_BEARING_Y,"i32")),horiAdvance:Ue(Z.getValue(r+Z.OFFSET_GLYPH_METRICS_HORI_ADVANCE,"i32")),vertBearingX:Ue(Z.getValue(r+Z.OFFSET_GLYPH_METRICS_VERT_BEARING_X,"i32")),vertBearingY:Ue(Z.getValue(r+Z.OFFSET_GLYPH_METRICS_VERT_BEARING_Y,"i32")),vertAdvance:Ue(Z.getValue(r+Z.OFFSET_GLYPH_METRICS_VERT_ADVANCE,"i32"))},linearHoriAdvance:Ta(Z.getValue(r+Z.OFFSET_GLYPH_LINEAR_HORI_ADVANCE,"i32")),linearVertAdvance:Ta(Z.getValue(r+Z.OFFSET_GLYPH_LINEAR_VERT_ADVANCE,"i32")),advance:{x:Ue(Z.getValue(r+Z.OFFSET_GLYPH_ADVANCE_X,"i32")),y:Ue(Z.getValue(r+Z.OFFSET_GLYPH_ADVANCE_Y,"i32"))},bitmap:{width:Z.getValue(r+Z.OFFSET_GLYPH_BITMAP_WIDTH,"i32"),rows:Z.getValue(r+Z.OFFSET_GLYPH_BITMAP_ROWS,"i32"),pitch:Z.getValue(r+Z.OFFSET_GLYPH_BITMAP_PITCH,"i32"),num_grays:Z.getValue(r+Z.OFFSET_GLYPH_BITMAP_NUM_GRAYS,"i16"),pixel_mode:Z.getValue(r+Z.OFFSET_GLYPH_BITMAP_PIXEL_MODE,"i8"),palette_mode:Z.getValue(r+Z.OFFSET_GLYPH_BITMAP_PALETTE_MODE,"i8")},bitmap_left:Z.getValue(r+Z.OFFSET_GLYPH_BITMAP_LEFT,"i32"),bitmap_top:Z.getValue(r+Z.OFFSET_GLYPH_BITMAP_TOP,"i32"),lsb_delta:Ue(Z.getValue(r+Z.OFFSET_GLYPH_LSB_DELTA,"i32")),rsb_delta:Ue(Z.getValue(r+Z.OFFSET_GLYPH_RSB_DELTA,"i32"))},s=g.bitmap.width,a=g.bitmap.rows,I=g.bitmap_left,l=g.bitmap_top,C=Z.getValue(r+Z.OFFSET_GLYPH_BITMAP_BUFFER,"i32"),Q=Math.abs(g.bitmap.pitch),f=g.linearHoriAdvance,h=g.linearVertAdvance,u=g.bitmap.pixel_mode,E=[];for(let D=0;D255&&(M=255),H=(255-M)*H/255,p.push(H)}else{let v=Z.getValue(c+d,"i8");p.push(Hi(v))}E.push(p)}return{x:I,y:l,width:s,height:a,advance_x:f,advance_y:h,pixels:E,freetype:g}}function PF(A){let e=_l(A.ptr);if(e)throw new Error(`error in FT_Done_Face: ${e}`);Z._free(A.font),A.ptr=0,A.font=0}function VF(){let A=Z.ccall("FT_Done_FreeType","number",["number"],[Bo]);if(A)throw new Error(`error in FT_Done_FreeType: ${A}`);Bo=0}class yt extends Error{constructor(e){super(e),this.name="AppError",Error.captureStackTrace&&Error.captureStackTrace(this,yt)}}class WF{constructor(){this.data={}}add_range(e,t,i,o){let n=o-t,r=[];for(let g=t;g<=i;g++)this._set_char(e,g,g+n),r.push(g);return r}add_symbols(e,t){let i=[];for(let o of t){let n=o.codePointAt(0);this._set_char(e,n,n),i.push(n)}return i}_set_char(e,t,i){this.data[i]={font:e,code:t}}get(){return this.data}}async function qF(A){await YF();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 f=Q;f instanceof File?f=await f.arrayBuffer():f instanceof Uint8Array&&(f=f.buffer.slice(f.byteOffset,f.byteOffset+f.byteLength)),t[C]=Yr.parse(f),i[C]=_F(f,A.size)}catch(f){throw new yt(`Cannot load font "${C}": ${f.message}`)}let o=new WF;for(let{source_path:C,ranges:Q}of A.font){let f=i[C];for(let h of Q){if(h.range)for(let u=0;uC-Q).map(Number);for(let C of g){let Q=n[C].code,f=n[C].font;if(!or(i[f],Q))continue;let h=OF(i[f],Q,{autohint_off:e[f].autohint_off,autohint_strong:e[f].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:h.advance_x,bbox:{x:h.x,y:h.y-h.height,width:h.width,height:h.height},kerning:{},freetype:h.freetype,pixels:h.pixels})}if(!A.no_kerning){let C=r.map(Q=>Q.code);for(let{code:Q,kerning:f}of r){let h=n[Q].code,u=n[Q].font,E=t[u],D=E.charToGlyph(String.fromCodePoint(h));for(let c of C){if(n[c].font!==u)continue;let p=n[c].code,d=E.charToGlyph(String.fromCodePoint(p)),v=E.getKerningValue(D,d);v&&(f[c]=v*A.size/E.unitsPerEm)}}}let s=i[A.font[0].source_path],a=A.size/s.units_per_em,I=KF(s),l=t[A.font[0].source_path].tables.post;for(let C of Object.values(i))PF(C);return VF(),{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 jF(){return 16}function ZF(A,e){return 16+(e-A+1)}function XF(A){return 16+A*2}function Ha(A){A=A.sort((i,o)=>i-o);let e=[];for(let i=0;i=0?e[n-1].dist:0,g;A[i]-A[n]<256&&(g=ZF(A[n],A[i]),r+g=0;){let o=e[i];t.unshift([o.format,A.slice(o.start,o.end+1)]),i=o.start-1}return t}const ke=4,zF=(A,e,t)=>{A.setUint32(t,e,!0),A.setUint32(t+4,0,!0)};class $F{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 AS(this),this.glyf=new tS(this),this.cmap=new iS(this),this.kern=new oS(this)}toCBin(){const[e,t]=this.glyf.toCBin(),i=this.cmap.toCBin(ke),o=this.kern.toCBin(ke),n=12+ke*6+0,r=8+ke*4,g=new ArrayBuffer(n+r),s=new DataView(g),a=(u,E)=>s.setUint32(E,u,!0);var I=0;a(0,I),I+=ke,a(0,I),I+=ke,a(0,I),I+=ke,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(n,I),I+=ke,a(0,I),I+=ke,a(0,I),I+=ke;const l=this.head.kern_ref();a(r+o.byteLength,I),I+=ke,a(r+o.byteLength+e.byteLength,I),I+=ke,a(r+o.byteLength+e.byteLength+t.byteLength,I),I+=ke,a(l.dsc==="NULL"?0:r,I),I+=ke,s.setUint16(I,l.scale,!0),I+=2;const C=this.cmap.getMapNumber(),Q=this.opts.bpp,f=l.classes,h=this.glyf.getCompressionCode();return s.setUint16(I,C|Q<<9|f<<13|h<<14,!0),I+=2,this.concatArrayBuffers([g,o,e,t,i])}concatArrayBuffers(e){const t=e.reduce((r,g)=>r+g.byteLength,0),i=new ArrayBuffer(t),o=new Uint8Array(i);let n=0;for(const r of e)o.set(new Uint8Array(r),n),n+=r.byteLength;return i}}class AS{constructor(e){this.font=e}kern_ref(){return this.font,{scale:0,dsc:"NULL",classes:0}}}class eS{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),o=(1<>t-i&o;this.bigEndian?this.buffer[this.byteIndex]|=n<<8-this.bitIndex-i:this.buffer[this.byteIndex]|=n<=8&&(this.byteIndex++,this.bitIndex=0),t-=i}}getUsedBytes(){return this.bitIndex>0?this.byteIndex+1:this.byteIndex}}class tS{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(o=>o>>>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 o=0;o{const o=e.glyph_id[i.code],n=this.lv_bitmap(i);this.lv_data[o]={bin:n,offset:t,glyph:i},t+=n.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),o=new DataView(i);let n=1;return this.lv_data.forEach(r=>{if(r){const g=Math.round(r.glyph.advanceWidth*16);o.setUint32(n*16,r.offset,!0),o.setUint32(n*16+4,g,!0),o.setUint16(n*16+8,r.glyph.bbox.width,!0),o.setUint16(n*16+10,r.glyph.bbox.height,!0),o.setInt16(n*16+12,r.glyph.bbox.x,!0),o.setInt16(n*16+14,r.glyph.bbox.y,!0)}n++}),[t,i]}balign4(e){const t=e.byteLength%4;if(t===0)return e;const i=4-t,o=new ArrayBuffer(i);return this.concatArrayBuffers([e,o])}concatArrayBuffers(e){const t=e.reduce((r,g)=>r+g.byteLength,0),i=new ArrayBuffer(t),o=new Uint8Array(i);let n=0;for(const r of e)o.set(new Uint8Array(r),n),n+=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 iS{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=Ha(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 o=this.font,n=[];for(let r=e;r<=t;r++){const g=o.glyph_id[r]||0;n.push(g?g-i:0)}return n}collect_sparse_data(e,t){const i=this.font;let o=[],n=[];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");o.push(a),n.push(I)}return{codes:o,ids:n}}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=Ha(t.src.glyphs.map(l=>l.code)));const i=this.subtables_plan;let o=0;const n=12+e*2+(e==4?0:4),r=new ArrayBuffer(i.length*n),g=new DataView(r),s=e==4?(l,C)=>g.setUint32(C,l,!0):(l,C)=>zF(g,l,C),a=[];let I=r.byteLength;for(let[l,C]of i){let Q=this.glyphByCode(C[0]),f=t.glyph_id[Q.code],h=C[0],u=C[C.length-1],E=!1,D=!1,c=0,p=new ArrayBuffer(0),d=new ArrayBuffer(0);if(l!=="format0_tiny")if(l==="format0"){D=!0;let b=this.collect_format0_data(h,u,f);c=b.length,p=this.balign4(this.uint8ArrayToBuffer(new Uint8Array(b)))}else if(l==="sparse_tiny"){E=!0;let b=this.collect_sparse_data(C,f);c=b.codes.length,d=this.balign4(this.uint16ArrayToBuffer(new Uint16Array(b.codes)))}else{E=!0,D=!0;let b=this.collect_sparse_data(C,f);c=b.codes.length,d=this.balign4(this.uint16ArrayToBuffer(new Uint16Array(b.codes))),p=this.align4(this.uint16ArrayToBuffer(new Uint16Array(b.ids)))}let v=o*n;g.setUint32(v,h,!0),v+=4,g.setUint16(v,u-h+1,!0),v+=2,g.setUint16(v,f,!0),v+=2,s(E?I:0,v),v+=e,I+=d.byteLength,s(D?I:0,v),v+=e,I+=p.byteLength,g.setUint16(v,c,!0),v+=2,g.setUint8(v,this.lv_format2int(l)),v+=1,a.push(d),a.push(p),o++}return this.concatArrayBuffers([r,...a])}balign4(e){const t=e.byteLength%4;if(t===0)return e;const i=4-t,o=new ArrayBuffer(i);return this.concatArrayBuffers([e,o])}align4(e){const t=e.byteLength%4;if(t===0)return e;const i=4-t,o=new ArrayBuffer(i);return this.concatArrayBuffers([e,o])}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),o=new Uint8Array(i);let n=0;for(const r of e)o.set(new Uint8Array(r),n),n+=r.byteLength;return i}}class oS{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 $F(e,A).toCBin();return{[A.output]:i}}class rS{constructor(){this.initialized=!1,this.supportedFormats=["ttf","woff","woff2","otf"],this.charsetCache=new Map}async initialize(){if(!this.initialized)try{if(typeof Yr>"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(),o=this.supportedFormats.some(r=>t.endsWith(`.${r}`)),n=["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 o||n}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=Yr.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:o=20,bpp:n=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:f,charSymbols:h}=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:f,symbols:h}],autohint_off:!1,autohint_strong:!1}],size:o,bpp:n,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 qF(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 o=[],n=t||"";return e==="full"?(o=[0,65535,0],{ranges:o,charSymbols:n}):(e&&e!=="custom"&&(n=await this.getCharsetContentAsync(e)+n),i&&(o=this.parseUnicodeRange(i)),{ranges:o,charSymbols:n})}parseCharacterInput(e,t,i){let o=[],n=t||"";return e==="full"?(o=[0,65535,0],{ranges:o,charSymbols:n}):(e&&e!=="custom"&&(n=this.getCharsetContent(e)+n),i&&(o=this.parseUnicodeRange(i)),{ranges:o,charSymbols:n})}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 o=await fetch(i);if(!o.ok)throw new Error(`Failed to load charset file: ${o.status}`);const r=(await o.text()).split(` `).join("");return this.charsetCache.set(e,r),r}catch(o){return console.error(`Failed to load charset ${e}:`,o),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 o of i){const n=o.trim();if(n)if(n.includes("-")){const[r,g]=n.split("-"),s=this.parseHexOrDec(r),a=this.parseHexOrDec(g);s!==null&&a!==null&&t.push(s,a,s)}else{const r=this.parseHexOrDec(n);r!==null&&t.push(r,r,r)}}return t}parseHexOrDec(e){const t=e.trim();if(t.startsWith("0x")||t.startsWith("0X")){const o=parseInt(t,16);return isNaN(o)?null:o}const i=parseInt(t,10);return isNaN(i)?null:i}async estimateSizeAsync(e){const{fontSize:t=20,bpp:i=4,charset:o="latin",symbols:n="",range:r=""}=e;let g=n.length;if(o==="full")g=65536;else if(o&&o!=="custom"){const I=await this.getCharsetContentAsync(o);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),o=Math.min(e.length,t);for(let n=0;n>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 o=4;for(const a of t)o+=36,o+=a.files.length*40;const n=o+Array.from(this.models.values()).reduce((a,I)=>a+Array.from(I.values()).reduce((l,C)=>l+C.byteLength,0),0),r=new Uint8Array(n);let g=0;r.set(this.packUint32(i),g),g+=4;let s=o;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 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 o of i.values())t+=o.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,o=this.packUint32(i);return{stringPacking:{input:e,output:Array.from(t).map(n=>`0x${n.toString(16).padStart(2,"0")}`),isASCII:t.every((n,r)=>r>=e.length||n===e.charCodeAt(r))},intPacking:{input:`0x${i.toString(16)}`,output:Array.from(o).map(n=>`0x${n.toString(16).padStart(2,"0")}`),isLittleEndian:o[0]===120&&o[3]===18}}}}class aS{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]),o=URL.createObjectURL(i),n=new Image;n.onload=()=>{URL.revokeObjectURL(o),t({width:n.width,height:n.height})},n.onerror=()=>{URL.revokeObjectURL(o),t({width:0,height:0})},n.src=o}catch{t({width:0,height:0})}})}parseSpecialImageFormat(e,t){const i=e.toLowerCase().split(".").pop();if([".sjpg",".spng",".sqoi"].includes("."+i))try{const o=new DataView(t),n=o.getUint16(14,!0),r=o.getUint16(16,!0);return{width:n,height:r}}catch(o){console.warn(`Failed to parse special image format: ${e}`,o)}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),o=this.textEncoder.encode(e),n=Math.min(o.length,t);return i.set(o.slice(0,n),0),i}computeChecksum(e){let t=0;for(let i=0;i{const o=t.filename.split(".").pop()||"",n=i.filename.split(".").pop()||"";if(o!==n)return o.localeCompare(n);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,o=[];let n=0;for(let D=0;D0||v.height>0)p=v.width,d=v.height;else{const b=c.filename.toLowerCase().split(".").pop();if(["png","jpg","jpeg","gif","bmp","webp"].includes(b)){const N=await this.getImageDimensions(c.data);p=N.width,d=N.height}}}o.push({filename:c.filename,data:c.data,size:c.size,offset:n,width:p,height:d}),n+=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 o)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(n);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,o)=>{var s;const n=((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(o+1).padStart(3," ")}. ${i.filename}`),console.log(` Type: ${n.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,o])=>{console.log(` ${i.toUpperCase()}: ${o} files`)})}clear(){this.files=[]}}let Jo={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(o=>{if(o.status!==200)throw"<"+A+"> Url error!!!"+this.errorLink();return o.arrayBuffer()}).then(o=>e(o));else if(["blob","file"].includes(i))new Response(A).arrayBuffer().then(o=>e(o));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(o=>this.loadOne(o.file)),Promise.all(i).then(function(o){var n=A.map((r,g)=>(r.file=o[g],r));e(n)}).catch(function(o){})})},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:o="",folder:n=[],isStrict:r=!1,start:g=Q=>{}}=A;var s=await this.tool.textToUrl();let a=new Worker(s);var I=this.tool.loadCommand(o),l=await this.tool.loadFile(i),C=(g(l),await this.tool.loadFolder(n));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 f=[];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 Jo.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 f=((1-Q.size/e.size)*100).toFixed(2);console.log(`压缩率: ${f}%`)}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=${n}`),i&&i>0&&r.push(`--lossy=${i}`),r.push(`-O${o}`),r.push("1.gif"),r.push("-o /out/output.gif");const g=r.join(" ");this.debug&&console.log("GIF 优化命令:",g);const s=await Jo.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 Jo.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 o=await t[0].text();return this.parseGifInfo(o)}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 o=e.match(/logical screen (\d+)x(\d+)/);o&&(t.width=parseInt(o[1]),t.height=parseInt(o[2]));const n=e.match(/(\d+) colors/);if(n&&(t.colors=parseInt(n[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:o,width:n,height:r}=t;try{const g=["-U",`--crop ${i},${o}+${n}x${r}`,"1.gif","-o /out/output.gif"].join(" ");this.debug&&console.log("GIF 裁剪命令:",g);const s=await Jo.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 Kl{constructor(){this.config=null,this.resources=new Map,this.tempFiles=[],this.fontConverterBrowser=gS,this.convertedFonts=new Map,this.wakenetPacker=new sS,this.spiffsGenerator=new aS,this.gifScaler=new IS({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 o,n,r;if(!e)return!1;if(!((o=e.chip)!=null&&o.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=(n=e.theme)==null?void 0:n.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,o="other"){return this.resources.set(e,{file:t,filename:i,size:t.size,type:t.type,lastModified:t.lastModified||Date.now(),resourceType:o}),this.autoSaveEnabled&&t instanceof File&&this.saveFileToStorage(e,t,o).catch(n=>{console.warn(`Auto-saving file ${i} failed:`,n)}),this}async saveFileToStorage(e,t,i){try{await this.configStorage.saveFile(e,t,i),console.log(`File ${t.name} auto-saved to storage`)}catch(o){throw console.error(`Failed to save file to storage: ${t.name}`,o),o}}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,o,n,r,g,s,a,I,l,C,Q;if(!e)return;const t=[];if((o=(i=e.theme)==null?void 0:i.font)!=null&&o.custom&&((n=e.theme.font.custom)==null?void 0:n.file)===null){const f="custom_font";if(await this.restoreResourceFromStorage(f)){const h=this.resources.get(f);h&&(e.theme.font.custom.file=h.file,t.push(`Custom font: ${h.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 f=e.theme.emoji.custom,h=f.emotionMap||{},u=f.fileMap||{},E=f.images||{};if(Object.keys(h).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 p=`hash_${c}`,d=await this.restoreResourceFromStorage(p);if(!d){const v=`emoji_hash_${c}`;d=await this.restoreResourceFromStorage(v),d&&(p=v)}if(d){const v=this.resources.get(p);if(v){u[c]=v.file;const b=Object.entries(h).filter(([N,H])=>H===c).map(([N,H])=>N);b.forEach(N=>{E[N]=v.file}),t.push(`Emoji file ${c.substring(0,8)}... (used for: ${b.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 p=`emoji_${D}`;if(await this.restoreResourceFromStorage(p)){const d=this.resources.get(p);d&&(E[D]=d.file,t.push(`Emoji ${D}: ${d.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 f="background_light";if(await this.restoreResourceFromStorage(f)){const h=this.resources.get(f);h&&(e.theme.skin.light.backgroundImage=h.file,t.push(`Light background: ${h.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 f="background_dark";if(await this.restoreResourceFromStorage(f)){const h=this.resources.get(f);h&&(e.theme.skin.dark.backgroundImage=h.file,t.push(`Dark background: ${h.filename}`))}}try{const f=this.getFontInfo();if(f&&f.type==="custom"){const h=`converted_font_${f.filename}`,u=await this.configStorage.loadTempData(h);u&&(this.convertedFonts.set(f.filename,u.data),console.log(`Converted font data restored: ${f.filename}`))}}catch(f){console.warn("Error restoring converted font data:",f)}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}async 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={twemoji32:{size:32,format:"png"},twemoji64:{size:64,format:"png"},"noto-emoji_64":{size:64,format:"gif"},"noto-emoji_128":{size:128,format:"gif"}}[e.preset]||{size:64,format:"png"};i.forEach(r=>{t.push({name:r,file:`${r}.${n.format}`,source:`preset:${e.preset}`,size:{width:n.size,height:n.size}})})}else if(e.type==="custom"){e.custom.images;const i=e.custom.emotionMap||{},o=e.custom.fileMap||{},n=e.custom.size||{width:64,height:64};if(Object.keys(i).length===0||Object.keys(o).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;for(const[g,s]of Object.entries(i)){let a=o[s];if(a||(console.log(`Restoring emoji file from storage: ${g} (hash: ${s.substring(0,8)})`),a=await si.restoreEmojiFile(`hash_${s}`)),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:{...n}})}else console.warn(`Failed to restore emoji file: ${g} (hash: ${s.substring(0,8)})`)}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}async 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 o=this.getSkinInfo();Object.keys(o).length>0&&(e.skin=o);const n=await this.getEmojiCollectionInfo();return n.length>0&&(e.emoji_collection=n.map(r=>({name:r.name,file:r.file}))),e}async preparePackageResources(){var g,s,a,I;const e={files:[],indexJson:await 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 o=await this.getEmojiCollectionInfo(),n=new Set;o.forEach(l=>{if(l.fileHash){if(n.has(l.fileHash)){console.log(`Skipping duplicate file: ${l.name} -> ${l.file} (hash: ${l.fileHash.substring(0,8)})`);return}n.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:(n,r)=>{e&&e(20+n*.2,`Font conversion: ${r}`)}};let o;if(await this.fontConverterBrowser.initialize(),o=await this.fontConverterBrowser.convertToCBIN(i),this.convertedFonts.set(t.filename,o),this.autoSaveEnabled){const n=`converted_font_${t.filename}`;try{await this.configStorage.saveTempData(n,o,"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(o=>setTimeout(o,100)),e&&e(40,"Preparing resource files...");const t=await this.preparePackageResources();this.wakenetPacker.clear(),this.spiffsGenerator.clear(),await this.processResourceFiles(t,e),await new Promise(o=>setTimeout(o,100)),e&&e(90,"Generating final file..."),this.spiffsGenerator.printFileList();const i=await this.spiffsGenerator.generate((o,n)=>{e&&e(90+o*.1,n)});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),o=document.createElement("a");o.href=i,o.download=t,document.body.appendChild(o),o.click(),document.body.removeChild(o),URL.revokeObjectURL(i)}async getFontInfoWithDetails(e=null){var t,i,o,n;try{const r=e||((n=(o=(i=(t=this.config)==null?void 0:t.theme)==null?void 0:i.font)==null?void 0:o.custom)==null?void 0:n.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,o;try{const n=e||((o=(i=(t=this.config)==null?void 0:t.theme)==null?void 0:i.font)==null?void 0:o.custom);if(!n)return null;const r={fontSize:n.size,bpp:n.bpp,charset:n.charset,symbols:n.symbols||"",range:n.range||""};let g;return g=this.fontConverterBrowser.estimateSize(r),g}catch(n){return console.error("Failed to estimate font size:",n),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 o=e.files.length,n=new TextEncoder().encode(JSON.stringify(e.indexJson,null,2));console.log("index.json",e.indexJson),this.spiffsGenerator.addFile("index.json",n.buffer);for(const r of e.files){const g=40+i/o*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,o="png",n=!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;n=this.isGifFile(s),o=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(n){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,o)}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 o={twemoji32:"png",twemoji64:"png","noto-emoji_64":"gif","noto-emoji_128":"gif"}[e]||"png",n=await fetch(`./static/emojis/${e}/${t}.${o}`);if(!n.ok)throw new Error(`HTTP ${n.status}`);return await n.arrayBuffer()}catch(i){throw new Error(`Failed to load preset emoji: ${e}/${t} - ${i.message}`)}}fileToArrayBuffer(e){return new Promise((t,i)=>{const o=new FileReader;o.onload=()=>t(o.result),o.onerror=()=>i(new Error("Failed to read file")),o.readAsArrayBuffer(e)})}async scaleImageToFit(e,t,i="png"){return new Promise((o,n)=>{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,f,h,u;l>C?(Q=t.width,f=t.width/l,h=0,u=(t.height-f)/2):(f=t.height,Q=t.height*l,h=(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,h,u,Q,f),a.toBlob(E=>{const D=new FileReader;D.onload=()=>o(D.result),D.onerror=()=>n(new Error("Failed to convert image data")),D.readAsArrayBuffer(E)},`image/${i}`),URL.revokeObjectURL(g)}catch(a){URL.revokeObjectURL(g),n(a)}},s.onerror=()=>{URL.revokeObjectURL(g),n(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 o=e instanceof File?e:new Blob([e]),n=URL.createObjectURL(o),r=new Image;r.onload=()=>{URL.revokeObjectURL(n),t({width:r.width,height:r.height})},r.onerror=()=>{URL.revokeObjectURL(n),i(new Error("Unable to get image dimensions"))},r.src=n})}async convertImageToRgb565(e){return new Promise((t,i)=>{const o=new Blob([e]),n=URL.createObjectURL(o),r=new Image;r.onload=()=>{var g,s,a,I,l,C;try{const Q=document.createElement("canvas"),f=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 h=r.width/r.height,u=Q.width/Q.height;let E,D,c,p;h>u?(D=Q.height,E=Q.height*h,c=(Q.width-E)/2,p=0):(E=Q.width,D=Q.width/h,c=0,p=(Q.height-D)/2),f.drawImage(r,c,p,E,D);const v=f.getImageData(0,0,Q.width,Q.height).data,b=new ArrayBuffer(Q.width*Q.height*2),N=new Uint16Array(b);for(let W=0;W>3,DA=v[W+1]>>2,NA=v[W+2]>>3;N[W/4]=$<<11|DA<<5|NA}const H=25,M=18,U=Q.width*2,R=28,j=R+b.byteLength,rA=new ArrayBuffer(j),IA=new Uint8Array(rA),AA=new DataView(rA);let z=0;const oA=0|M<<8|H;AA.setUint32(z,oA,!0),z+=4;const dA=Q.height<<16|Q.width;AA.setUint32(z,dA,!0),z+=4;const Y=0|U;AA.setUint32(z,Y,!0),z+=4,AA.setUint32(z,b.byteLength,!0),z+=4,AA.setUint32(z,R,!0),z+=4,AA.setUint32(z,0,!0),z+=4,AA.setUint32(z,0,!0),z+=4,IA.set(new Uint8Array(b),R),URL.revokeObjectURL(n),t(rA)}catch(Q){URL.revokeObjectURL(n),i(Q)}},r.onerror=()=>{URL.revokeObjectURL(n),i(new Error("Unable to load image"))},r.src=n})}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"}`)}async getResourceSummary(){const e=[],t=await this.preparePackageResources(),i={wakeword:0,font:0,emoji:0,background:0};return t.files.forEach(o=>{i[o.type]=(i[o.type]||0)+1;let n="";switch(o.type){case"wakeword":n=`Wakeword model: ${o.name} (${o.modelType})`;break;case"font":o.config?n=`Custom font: size ${o.config.size}px, BPP ${o.config.bpp}`:n=`Preset font: ${o.source}`;break;case"emoji":n=`Emoji: ${o.name} (${o.size.width}x${o.size.height})`;break;case"background":n=`${o.mode==="light"?"Light":"Dark"} mode background`;break}e.push({type:o.type,filename:o.filename,description:n})}),{files:e,counts:i,totalFiles:e.length,indexJson:t.indexJson}}}const CS={class:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 p-4"},lS={class:"bg-white rounded-lg shadow-xl max-w-2xl w-full max-h-[90vh] overflow-hidden"},BS={class:"flex items-center justify-between p-6 border-b border-gray-200"},QS={class:"text-lg font-medium text-gray-900"},cS={key:1,class:"text-sm text-orange-600 font-medium"},ES={class:"p-6 overflow-y-auto",style:{"max-height":"calc(90vh - 140px)"}},uS={key:0,class:"space-y-6"},fS={class:"font-medium text-gray-900 mb-3"},hS={class:"bg-gray-50 rounded-lg p-4 space-y-2 text-sm"},dS={class:"flex justify-between"},pS={class:"text-gray-600"},mS={class:"font-medium"},yS={class:"flex justify-between"},wS={class:"text-gray-600"},DS={class:"font-medium"},kS={class:"flex justify-between"},vS={class:"text-gray-600"},FS={class:"font-medium"},SS={class:"flex justify-between"},RS={class:"text-gray-600"},bS={class:"font-medium"},NS={class:"flex justify-between"},GS={class:"text-gray-600"},LS={class:"font-medium"},US={class:"font-medium text-gray-900 mb-3"},MS={class:"space-y-2 max-h-64 overflow-y-auto"},xS={class:"flex items-center"},JS={class:"text-sm font-medium text-gray-900"},TS={class:"text-sm text-gray-700"},HS={key:0,class:"text-xs text-gray-500 ml-1"},YS={key:1,class:"text-xs text-gray-500 ml-1"},_S={key:1,class:"space-y-6 text-center"},KS={class:"space-y-4"},OS={class:"text-gray-600 mt-2"},PS={class:"bg-gray-200 rounded-full h-2 overflow-hidden"},VS={class:"text-sm text-gray-600"},WS={class:"mt-1"},qS={class:"space-y-2 text-left"},jS={class:"flex-shrink-0 mr-3"},ZS={key:0,class:"w-5 h-5 bg-green-500 rounded-full flex items-center justify-center"},XS={key:1,class:"w-5 h-5 bg-primary-500 rounded-full animate-pulse"},zS={key:2,class:"w-5 h-5 bg-gray-300 rounded-full"},$S={key:2,class:"text-center space-y-6"},AR={class:"text-gray-600 mt-2"},eR={class:"bg-green-50 border border-green-200 rounded-lg p-4"},tR={class:"text-sm text-green-800 space-y-1"},iR={class:"space-y-3"},oR=["disabled"],nR={key:3,class:"space-y-6 text-center"},rR={class:"space-y-4"},gR={class:"text-gray-600"},sR={class:"bg-gray-200 rounded-full h-2 overflow-hidden"},aR={class:"text-sm text-gray-600"},IR={class:"mt-1"},CR={key:4,class:"text-center mt-4"},lR={class:"text-sm text-red-600"},BR={class:"flex justify-end space-x-3 p-6 border-t border-gray-200"},QR=["disabled"],cR={__name:"GenerateModal",props:{config:{type:Object,required:!0}},emits:["close","generate","startFlash"],setup(A,{emit:e}){const{t}=we(),i=A,o=e,{deviceInfo:n,checkDeviceStatus:r,isDeviceOnline:g}=Nn(),s=uA(!1),a=uA(!1),I=uA(0),l=uA(""),C=uA(""),Q=uA(""),f=uA(null),h=uA(null),u=uA(!1),E=uA(0),D=uA(""),c=uA(""),p=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"}]),d=uA([]),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"})])}),b=_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"})])}),N=_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"})])}),H=_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"})])}),M=hA(()=>d.value.length>0),U=()=>{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")},R=()=>i.config.theme.font.type==="preset"?i.config.theme.font.preset.replace("font_","").replace("_"," "):t("generateModal.customFont"),j=()=>i.config.theme.emoji.type==="preset"&&i.config.theme.emoji.preset?{twemoji32:"Twemoji 32×32",twemoji64:"Twemoji 64×64","noto-emoji_64":"Noto Emoji 64×64","noto-emoji_128":"Noto Emoji 128×128"}[i.config.theme.emoji.preset]||i.config.theme.emoji.preset:i.config.theme.emoji.type==="custom"?t("generateModal.customEmoji"):i.config.theme.emoji.type==="none"?t("emojiConfig.noEmojiPack"):t("generateModal.notConfigured"),rA=()=>{d.value=[],d.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"&&d.value.push({id:"srmodels",name:"srmodels.bin",description:Y.type==="custom"?"自定义命令词模型":"预设唤醒词模型",icon:b,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"};d.value.push({id:"font",name:`${i.config.theme.font.preset}.bin`,description:"预设字体文件",icon:N,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,$=Math.max(100,W.size*W.size*W.bpp*.7);d.value.push({id:"font",name:`font_custom_${W.size}_${W.bpp}.bin`,description:"自定义字体文件",icon:N,iconColor:"text-yellow-500",size:$>1024?`${($/1024).toFixed(1)}MB`:`${Math.round($)}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"],$=i.config.theme.emoji.preset==="twemoji64"?"3KB":"1KB";W.forEach(DA=>{d.value.push({id:`emoji_${DA}`,name:`${DA}.png`,description:`${DA}表情图片`,icon:H,iconColor:"text-pink-500",size:$})})}else if(i.config.theme.emoji.type==="custom"){const W=i.config.theme.emoji.custom,$=W.emotionMap||{},DA=W.fileMap||{};if(W.images,Object.keys($).length===0||Object.keys(DA).length===0){console.error(t("errors.incompatibleEmojiData"));return}const NA=new Map,oe=new Map;Object.entries($).forEach(([LA,_])=>{const eA=DA[_];if(eA){if(!NA.has(_)){const tA=Math.round(eA.size/1024);NA.set(_,{file:eA,size:tA>1024?`${(tA/1024).toFixed(1)}MB`:`${tA}KB`,emotions:[]})}NA.get(_).emotions.push(LA),oe.set(LA,_)}}),NA.forEach((LA,_)=>{const eA=LA.emotions.join(", "),tA=LA.emotions.length>1;d.value.push({id:`emoji_${_.substring(0,8)}`,name:`emoji_${_.substring(0,8)}.${LA.file.name.split(".").pop()}`,description:tA?`共享表情图片 (${eA})`:`${eA}表情图片`,icon:H,iconColor:tA?"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:$}=i.config.chip.display,DA=Math.round(W*$*2/1024);d.value.push({id:"bg_dark",name:"background_dark.raw",description:"深色模式背景图片",icon:H,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,$=["B","KB","MB","GB"],DA=Math.floor(Math.log(Y)/Math.log(W));return`${parseFloat((Y/Math.pow(W,DA)).toFixed(2))} ${$[DA]}`},AA=Y=>{if(Y<1e3)return`${Y}ms`;if(Y<6e4)return`${(Y/1e3).toFixed(1)}s`;{const W=Math.floor(Y/6e4),$=Math.floor(Y%6e4/1e3);return`${W}m ${$}s`}},z=async()=>{s.value=!0,I.value=0,h.value=Date.now();try{const Y=new Kl;Y.setConfig(i.config);const W=await Y.generateAssetsBin((NA,oe)=>{I.value=parseInt(NA),l.value=oe;const LA=Math.floor(NA/(100/p.value.length));p.value.forEach((_,eA)=>{eA{NA.status="completed"}),o("generate",d.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}))}},oA=()=>{if(f.value){const Y=URL.createObjectURL(f.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"))},dA=async()=>{if(!f.value){alert(t("errors.noFileToDownload"));return}if(!g.value){alert(t("errors.deviceOffline"));return}if(n.value.assetsPartition&&n.value.assetsPartition.size){const Y=n.value.assetsPartition.size,W=f.value.size;if(W>Y){const $=(W/1024/1024).toFixed(2),DA=(Y/1024/1024).toFixed(2);alert(t("errors.fileTooLarge",{fileSize:$,partitionSize:DA}));return}}u.value=!0,E.value=0,D.value=t("flashProgress.startingFileTransfer"),c.value="";try{o("startFlash",{blob:f.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()=>{rA(),await r(!1)}),(Y,W)=>(T(),K("div",CS,[B("div",lS,[B("div",BS,[B("h3",QS,F(Y.$t("generateModal.title")),1),u.value?(T(),K("div",cS,F(Y.$t("generateModal.flashingInProgress")),1)):(T(),K("button",{key:0,onClick:W[0]||(W[0]=$=>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",ES,[!s.value&&!a.value?(T(),K("div",uS,[B("div",null,[B("h4",fS,F(Y.$t("generateModal.confirmConfig")),1),B("div",hS,[B("div",dS,[B("span",pS,F(Y.$t("generateModal.chipModel")),1),B("span",mS,F(A.config.chip.model.toUpperCase()),1)]),B("div",yS,[B("span",wS,F(Y.$t("generateModal.resolution")),1),B("span",DS,F(A.config.chip.display.width)+"×"+F(A.config.chip.display.height),1)]),B("div",kS,[B("span",vS,F(Y.$t("generateModal.wakeword")),1),B("span",FS,F(U()),1)]),B("div",SS,[B("span",RS,F(Y.$t("generateModal.font")),1),B("span",bS,F(R()),1)]),B("div",NS,[B("span",GS,F(Y.$t("generateModal.emoji")),1),B("span",LS,F(j()),1)])])]),B("div",null,[B("h4",US,F(Y.$t("generateModal.fileList")),1),B("div",MS,[(T(!0),K(qA,null,Ke(d.value,$=>(T(),K("div",{key:$.id,class:"flex items-center justify-between px-3 py-2 border border-gray-200 rounded bg-gray-50"},[B("div",xS,[(T(),ye(YI($.icon),{class:kA(["w-4 h-4 mr-2",$.iconColor])},null,8,["class"])),B("span",JS,F($.name),1)]),B("div",TS,[gt(F($.size)+" ",1),$.estimated?(T(),K("span",HS,F(Y.$t("generateModal.estimated")),1)):CA("",!0),$.isCustomEmoji?(T(),K("span",YS,F(Y.$t("generateModal.compressed")),1)):CA("",!0)])]))),128))])])])):CA("",!0),s.value?(T(),K("div",_S,[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",KS,[B("p",OS,F(Y.$t("generateModal.generating")),1),B("div",PS,[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",VS,[B("div",null,F(l.value),1),B("div",WS,F(Y.$t("generateModal.progress",{progress:I.value})),1)])]),B("div",qS,[(T(!0),K(qA,null,Ke(p.value,$=>(T(),K("div",{key:$.id,class:"flex items-center text-sm"},[B("div",jS,[$.status==="completed"?(T(),K("div",ZS,[...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)])])):$.status==="processing"?(T(),K("div",XS)):(T(),K("div",zS))]),B("span",{class:kA([$.status==="completed"?"text-green-700":$.status==="processing"?"text-primary-700":"text-gray-500"])},F($.name),3)]))),128))])])):CA("",!0),a.value&&!u.value?(T(),K("div",$S,[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",AR,F(Y.$t("generateModal.completed")),1)]),B("div",eR,[B("div",tR,[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",iR,[B("button",{onClick:oA,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:dA,disabled:!cA(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,oR)])])):CA("",!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",rR,[B("p",gR,F(Y.$t("generateModal.flashing")),1),B("div",sR,[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",aR,[B("div",null,F(D.value),1),B("div",IR,F(Y.$t("generateModal.progress",{progress:E.value})),1)])])])):CA("",!0),c.value?(T(),K("div",CR,[B("p",lR,F(c.value),1)])):CA("",!0)]),B("div",BR,[!s.value&&!a.value?(T(),K("button",{key:0,onClick:W[1]||(W[1]=$=>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)):CA("",!0),!s.value&&!a.value?(T(),K("button",{key:1,onClick:z,disabled:!M.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,QR)):CA("",!0),a.value&&!u.value?(T(),K("button",{key:2,onClick:W[2]||(W[2]=$=>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)):CA("",!0)])])]))}},ER={class:"flex items-center justify-between mb-2"},uR={class:"flex items-center"},fR={class:"text-blue-800 font-medium"},hR={class:"text-blue-600 text-sm mb-3"},dR={class:"flex justify-end space-x-2"},pR={class:"flex items-center justify-center mb-8"},mR={class:"flex flex-col items-center"},yR={class:"text-sm mt-2 text-gray-600"},wR={key:0,class:"w-16 h-0.5 bg-gray-300 mx-4"},DR={class:"bg-white rounded-lg shadow-sm border p-6"},nr=60,Ol={__name:"HomePage",setup(A){const e=Nn(),{t}=we(),i=uA(nr),o=uA(null),n=uA(0),r=uA(!1),g=uA("wakeword"),s=uA(!1),a=uA(!1),I=uA(!1),l=uA(!0),C=new Kl,Q=uA(null),f=uA(""),h=[{titleKey:"steps.chip",key:"chip"},{titleKey:"steps.theme",key:"theme"},{titleKey:"steps.generate",key:"generate"}],u=uA({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{n.value{n.value>0&&n.value--},p=()=>{r.value=!0},d=async IA=>{},v=async(IA,AA={})=>await e.callMcpTool(IA,AA),b=async IA=>{const{blob:AA,onProgress:z,onComplete:oA,onError:dA}=IA;try{z(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),dA(t("flashProgress.deviceOfflineOrUnresponsive",{error:Y.msg}));return}z(30,t("flashProgress.uploadingFile"));try{const Y=new FormData;Y.append("file",AA,"assets.bin");const $=await(await fetch("/xiaozhi/otaMag/uploadAssetsBin",{method:"POST",body:Y,headers:{Authorization:`Bearer ${e.token.value}`}})).json();$.code!==0&&await Promise.reject($),f.value=$.data}catch{dA(t("flashProgress.uploadFailed"));return}z(45,t("flashProgress.settingDeviceDownloadUrl"));try{const Y=await v("self.assets.set_download_url",{url:f.value});Y.code!==0&&await Promise.reject(Y)}catch(Y){console.error("设置下载URL失败:",Y),dA(t("flashProgress.setDownloadUrlFailed",{error:Y.msg}));return}z(60,t("flashProgress.waitingForDeviceReboot")),await v("self.reboot").catch(Y=>{console.warn("reboot指令调用警告(设备可能已重启):",Y)}),z(75,t("flashProgress.deviceReady")),o.value=setInterval(()=>{if(z(90,t("flashProgress.flashCompleted")),i.value-=1,i.value<=0){clearInterval(o.value),i.value=nr,o.value=null,dA("请求超时,请检查设备烧录是否异常");return}v("self.get_device_status").then(Y=>{o.value&&Y.code===0&&(clearInterval(o.value),o.value=null,i.value=nr,oA())})},5e3)}catch(Y){console.error("在线烧录失败:",Y),dA(t("flashProgress.onlineFlashFailed",{error:Y.msg}))}},N=IA=>{g.value=IA},H=async()=>{var IA,AA,z;try{l.value=!0;const oA=await Qe.loadConfig();if(oA){u.value=oA.config,n.value=0,g.value="wakeword",s.value=!0,a.value=!0,await M(),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 dA=((z=(AA=(IA=u.value)==null?void 0:IA.theme)==null?void 0:AA.emoji)==null?void 0:z.custom)||{},Y=dA.images||{},W=dA.fileMap||{},$=dA.emotionMap||{};u.value={...u.value,theme:{...u.value.theme,emoji:{...u.value.theme.emoji,custom:{...dA,images:{...Y},fileMap:{...W},emotionMap:{...$}}}}}}catch(dA){console.error("刷新表情配置引用失败:",dA)}}else s.value=!1,a.value=!1}catch(oA){console.error("加载配置失败:",oA),s.value=!1,a.value=!1}finally{l.value=!1}},M=async()=>{var IA,AA,z;try{const oA=(z=(AA=(IA=u.value)==null?void 0:IA.theme)==null?void 0:AA.emoji)==null?void 0:z.custom;if(!oA)return;const dA=Object.keys(oA.images||{}).length>0,Y=oA.fileMap&&Object.keys(oA.fileMap).length>0,W=oA.emotionMap&&Object.keys(oA.emotionMap).length>0;if(dA&&(!Y||!W)){console.warn("⚠️ 检测到旧版本的表情数据结构(不兼容)"),console.log("正在清理旧数据...");try{const DA=Object.keys(oA.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:oA.size||{width:64,height:64},images:{},fileMap:{},emotionMap:{}},u.value.theme.emoji.type==="custom"&&(u.value.theme.emoji.type="",console.log("已重置表情类型,请重新选择")),await U(),console.log("✅ 旧表情数据已完全清除"),setTimeout(()=>{alert(`检测到旧版本的表情数据结构已被清除。 新版本使用文件去重技术,可以节省存储空间。 请重新上传自定义表情图片。`)},500)}}catch(oA){console.error("清理旧表情数据时出错:",oA)}},U=async()=>{try{await Qe.saveConfig(u.value)}catch(IA){console.error("保存配置失败:",IA)}},R=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}}}},n.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 U()},{deep:!0}),Ft(async()=>{await Qe.initialize(),await H()}),Ci(()=>{Q.value&&(clearTimeout(Q.value),clearInterval(o.value))});const j=()=>{s.value=!1,Q.value&&clearTimeout(Q.value)},rA=()=>{Q.value&&clearTimeout(Q.value),Q.value=setTimeout(()=>{s.value=!1},5e3)};return(IA,AA)=>(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:rA},[B("div",ER,[B("div",uR,[AA[3]||(AA[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",fR,F(IA.$t("configNotice.title")),1)]),B("button",{onClick:j,class:"text-gray-500 hover:text-gray-700"},[...AA[4]||(AA[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",dR,[B("button",{onClick:R,class:"px-3 py-1 text-sm text-red-600 hover:text-red-800 font-medium"},F(IA.$t("configNotice.restart")),1)])],32)):CA("",!0),B("div",pR,[(T(),K(qA,null,Ke(h,(z,oA)=>B("div",{key:oA,class:"flex items-center"},[B("div",mR,[B("div",{class:kA(E(oA))},F(oA+1),3),B("span",yR,F(IA.$t(z.titleKey)),1)]),oAu.value.chip=z),onNext:D},null,8,["modelValue"])):CA("",!0),n.value===1?(T(),ye(wy,{key:1,modelValue:u.value.theme,"onUpdate:modelValue":AA[1]||(AA[1]=z=>u.value.theme=z),chipModel:u.value.chip.model,activeTab:g.value,onNext:D,onPrev:c,onTabChange:N},null,8,["modelValue","chipModel","activeTab"])):CA("",!0),n.value===2?(T(),ye(uw,{key:2,config:u.value,onGenerate:p,onPrev:c},null,8,["config"])):CA("",!0)]),r.value?(T(),ye(cR,{key:1,config:u.value,onClose:AA[2]||(AA[2]=z=>r.value=!1),onGenerate:d,onStartFlash:b},null,8,["config"])):CA("",!0)]))}},kR=Object.freeze(Object.defineProperty({__proto__:null,default:Ol},Symbol.toStringTag,{value:"Module"})),vR={class:"min-h-screen bg-gray-50"},FR={class:"bg-white shadow-sm border-b"},SR={class:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-4"},RR={class:"flex flex-col relative sm:flex-row items-start sm:items-center justify-between gap-3 sm:gap-0"},bR={class:"text-2xl font-bold text-gray-900"},NR={class:"flex items-center space-x-4"},GR={class:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8"},LR={__name:"App",setup(A){const{t:e}=we(),t=uA(""),i=()=>{t.value&&(window.location.href=t.value)};return Ft(()=>{t.value=sessionStorage.getItem("devicePath"),document.title=e("app.title")}),(o,n)=>(T(),K("div",vR,[B("header",FR,[B("div",SR,[B("div",RR,[t.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:i},F(o.$t("common.back")),1)):CA("",!0),B("h1",bR,F(o.$t("header.title")),1),B("div",NR,[TA(ff),TA(sd)])])])]),B("main",GR,[TA(Ol)])]))}};/*! * vue-router v4.6.4 * (c) 2025 Eduardo San Martin Morote * @license MIT */const Ei=typeof document<"u";function Pl(A){return typeof A=="object"||"displayName"in A||"props"in A||"__vccOpts"in A}function UR(A){return A.__esModule||A[Symbol.toStringTag]==="Module"||A.default&&Pl(A.default)}const MA=Object.assign;function rr(A,e){const t={};for(const i in e){const o=e[i];t[i]=qe(o)?o.map(A):A(o)}return t}const zi=()=>{},qe=Array.isArray;function Ya(A,e){const t={};for(const i in A)t[i]=i in e?e[i]:A[i];return t}const Vl=/#/g,MR=/&/g,xR=/\//g,JR=/=/g,TR=/\?/g,Wl=/\+/g,HR=/%5B/g,YR=/%5D/g,ql=/%5E/g,_R=/%60/g,jl=/%7B/g,KR=/%7C/g,Zl=/%7D/g,OR=/%20/g;function Sg(A){return A==null?"":encodeURI(""+A).replace(KR,"|").replace(HR,"[").replace(YR,"]")}function PR(A){return Sg(A).replace(jl,"{").replace(Zl,"}").replace(ql,"^")}function _r(A){return Sg(A).replace(Wl,"%2B").replace(OR,"+").replace(Vl,"%23").replace(MR,"%26").replace(_R,"`").replace(jl,"{").replace(Zl,"}").replace(ql,"^")}function VR(A){return _r(A).replace(JR,"%3D")}function WR(A){return Sg(A).replace(Vl,"%23").replace(TR,"%3F")}function qR(A){return WR(A).replace(xR,"%2F")}function Qo(A){if(A==null)return null;try{return decodeURIComponent(""+A)}catch{}return""+A}const jR=/\/$/,ZR=A=>A.replace(jR,"");function gr(A,e,t="/"){let i,o={},n="",r="";const g=e.indexOf("#");let s=e.indexOf("?");return s=g>=0&&s>g?-1:s,s>=0&&(i=e.slice(0,s),n=e.slice(s,g>0?g:e.length),o=A(n.slice(1))),g>=0&&(i=i||e.slice(0,g),r=e.slice(g,e.length)),i=Ab(i??e,t),{fullPath:i+n+r,path:i,query:o,hash:Qo(r)}}function XR(A,e){const t=e.query?A(e.query):"";return e.path+(t&&"?")+t+(e.hash||"")}function _a(A,e){return!e||!A.toLowerCase().startsWith(e.toLowerCase())?A:A.slice(e.length)||"/"}function zR(A,e,t){const i=e.matched.length-1,o=t.matched.length-1;return i>-1&&i===o&&bi(e.matched[i],t.matched[o])&&Xl(e.params,t.params)&&A(e.query)===A(t.query)&&e.hash===t.hash}function bi(A,e){return(A.aliasOf||A)===(e.aliasOf||e)}function Xl(A,e){if(Object.keys(A).length!==Object.keys(e).length)return!1;for(var t in A)if(!$R(A[t],e[t]))return!1;return!0}function $R(A,e){return qe(A)?Ka(A,e):qe(e)?Ka(e,A):(A==null?void 0:A.valueOf())===(e==null?void 0:e.valueOf())}function Ka(A,e){return qe(e)?A.length===e.length&&A.every((t,i)=>t===e[i]):A.length===1&&A[0]===e}function Ab(A,e){if(A.startsWith("/"))return A;if(!A)return e;const t=e.split("/"),i=A.split("/"),o=i[i.length-1];(o===".."||o===".")&&i.push("");let n=t.length-1,r,g;for(r=0;r1&&n--;else break;return t.slice(0,n).join("/")+"/"+i.slice(r).join("/")}const Gt={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};let Kr=function(A){return A.pop="pop",A.push="push",A}({}),sr=function(A){return A.back="back",A.forward="forward",A.unknown="",A}({});function eb(A){if(!A)if(Ei){const e=document.querySelector("base");A=e&&e.getAttribute("href")||"/",A=A.replace(/^\w+:\/\/[^\/]+/,"")}else A="/";return A[0]!=="/"&&A[0]!=="#"&&(A="/"+A),ZR(A)}const tb=/^[^#]+#/;function ib(A,e){return A.replace(tb,"#")+e}function ob(A,e){const t=document.documentElement.getBoundingClientRect(),i=A.getBoundingClientRect();return{behavior:e.behavior,left:i.left-t.left-(e.left||0),top:i.top-t.top-(e.top||0)}}const Un=()=>({left:window.scrollX,top:window.scrollY});function nb(A){let e;if("el"in A){const t=A.el,i=typeof t=="string"&&t.startsWith("#"),o=typeof t=="string"?i?document.getElementById(t.slice(1)):document.querySelector(t):t;if(!o)return;e=ob(o,A)}else e=A;"scrollBehavior"in document.documentElement.style?window.scrollTo(e):window.scrollTo(e.left!=null?e.left:window.scrollX,e.top!=null?e.top:window.scrollY)}function Oa(A,e){return(history.state?history.state.position-e:-1)+A}const Or=new Map;function rb(A,e){Or.set(A,e)}function gb(A){const e=Or.get(A);return Or.delete(A),e}function sb(A){return typeof A=="string"||A&&typeof A=="object"}function zl(A){return typeof A=="string"||typeof A=="symbol"}let XA=function(A){return A[A.MATCHER_NOT_FOUND=1]="MATCHER_NOT_FOUND",A[A.NAVIGATION_GUARD_REDIRECT=2]="NAVIGATION_GUARD_REDIRECT",A[A.NAVIGATION_ABORTED=4]="NAVIGATION_ABORTED",A[A.NAVIGATION_CANCELLED=8]="NAVIGATION_CANCELLED",A[A.NAVIGATION_DUPLICATED=16]="NAVIGATION_DUPLICATED",A}({});const $l=Symbol("");XA.MATCHER_NOT_FOUND+"",XA.NAVIGATION_GUARD_REDIRECT+"",XA.NAVIGATION_ABORTED+"",XA.NAVIGATION_CANCELLED+"",XA.NAVIGATION_DUPLICATED+"";function Ni(A,e){return MA(new Error,{type:A,[$l]:!0},e)}function ct(A,e){return A instanceof Error&&$l in A&&(e==null||!!(A.type&e))}const ab=["params","query","hash"];function Ib(A){if(typeof A=="string")return A;if(A.path!=null)return A.path;const e={};for(const t of ab)t in A&&(e[t]=A[t]);return JSON.stringify(e,null,2)}function Cb(A){const e={};if(A===""||A==="?")return e;const t=(A[0]==="?"?A.slice(1):A).split("&");for(let i=0;io&&_r(o)):[i&&_r(i)]).forEach(o=>{o!==void 0&&(e+=(e.length?"&":"")+t,o!=null&&(e+="="+o))})}return e}function lb(A){const e={};for(const t in A){const i=A[t];i!==void 0&&(e[t]=qe(i)?i.map(o=>o==null?null:""+o):i==null?i:""+i)}return e}const Bb=Symbol(""),Va=Symbol(""),Rg=Symbol(""),AB=Symbol(""),Pr=Symbol("");function Yi(){let A=[];function e(i){return A.push(i),()=>{const o=A.indexOf(i);o>-1&&A.splice(o,1)}}function t(){A=[]}return{add:e,list:()=>A.slice(),reset:t}}function Tt(A,e,t,i,o,n=r=>r()){const r=i&&(i.enterCallbacks[o]=i.enterCallbacks[o]||[]);return()=>new Promise((g,s)=>{const a=C=>{C===!1?s(Ni(XA.NAVIGATION_ABORTED,{from:t,to:e})):C instanceof Error?s(C):sb(C)?s(Ni(XA.NAVIGATION_GUARD_REDIRECT,{from:e,to:C})):(r&&i.enterCallbacks[o]===r&&typeof C=="function"&&r.push(C),g())},I=n(()=>A.call(i&&i.instances[o],e,t,a));let l=Promise.resolve(I);A.length<3&&(l=l.then(a)),l.catch(C=>s(C))})}function ar(A,e,t,i,o=n=>n()){const n=[];for(const r of A)for(const g in r.components){let s=r.components[g];if(!(e!=="beforeRouteEnter"&&!r.instances[g]))if(Pl(s)){const a=(s.__vccOpts||s)[e];a&&n.push(Tt(a,t,i,r,g,o))}else{let a=s();n.push(()=>a.then(I=>{if(!I)throw new Error(`Couldn't resolve component "${g}" at "${r.path}"`);const l=UR(I)?I.default:I;r.mods[g]=I,r.components[g]=l;const C=(l.__vccOpts||l)[e];return C&&Tt(C,t,i,r,g,o)()}))}}return n}function Qb(A,e){const t=[],i=[],o=[],n=Math.max(e.matched.length,A.matched.length);for(let r=0;rbi(a,g))?i.push(g):t.push(g));const s=A.matched[r];s&&(e.matched.find(a=>bi(a,s))||o.push(s))}return[t,i,o]}/*! * vue-router v4.6.4 * (c) 2025 Eduardo San Martin Morote * @license MIT */let cb=()=>location.protocol+"//"+location.host;function eB(A,e){const{pathname:t,search:i,hash:o}=e,n=A.indexOf("#");if(n>-1){let r=o.includes(A.slice(n))?A.slice(n).length:1,g=o.slice(r);return g[0]!=="/"&&(g="/"+g),_a(g,"")}return _a(t,A)+i+o}function Eb(A,e,t,i){let o=[],n=[],r=null;const g=({state:C})=>{const Q=eB(A,location),f=t.value,h=e.value;let u=0;if(C){if(t.value=Q,e.value=C,r&&r===f){r=null;return}u=h?C.position-h.position:0}else i(Q);o.forEach(E=>{E(t.value,f,{delta:u,type:Kr.pop,direction:u?u>0?sr.forward:sr.back:sr.unknown})})};function s(){r=t.value}function a(C){o.push(C);const Q=()=>{const f=o.indexOf(C);f>-1&&o.splice(f,1)};return n.push(Q),Q}function I(){if(document.visibilityState==="hidden"){const{history:C}=window;if(!C.state)return;C.replaceState(MA({},C.state,{scroll:Un()}),"")}}function l(){for(const C of n)C();n=[],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 Wa(A,e,t,i=!1,o=!1){return{back:A,current:e,forward:t,replaced:i,position:window.history.length,scroll:o?Un():null}}function ub(A){const{history:e,location:t}=window,i={value:eB(A,t)},o={value:e.state};o.value||n(i.value,{back:null,current:i.value,forward:null,position:e.length-1,replaced:!0,scroll:null},!0);function n(s,a,I){const l=A.indexOf("#"),C=l>-1?(t.host&&document.querySelector("base")?A:A.slice(l))+s:cb()+A+s;try{e[I?"replaceState":"pushState"](a,"",C),o.value=a}catch(Q){console.error(Q),t[I?"replace":"assign"](C)}}function r(s,a){n(s,MA({},e.state,Wa(o.value.back,s,o.value.forward,!0),a,{position:o.value.position}),!0),i.value=s}function g(s,a){const I=MA({},o.value,e.state,{forward:s,scroll:Un()});n(I.current,I,!0),n(s,MA({},Wa(i.value,s,null),{position:I.position+1},a),!1),i.value=s}return{location:i,state:o,push:g,replace:r}}function fb(A){A=eb(A);const e=ub(A),t=Eb(A,e.state,e.location,e.replace);function i(n,r=!0){r||t.pauseListeners(),history.go(n)}const o=MA({location:"",base:A,go:i,createHref:ib.bind(null,A)},e,t);return Object.defineProperty(o,"location",{enumerable:!0,get:()=>e.location.value}),Object.defineProperty(o,"state",{enumerable:!0,get:()=>e.state.value}),o}let ni=function(A){return A[A.Static=0]="Static",A[A.Param=1]="Param",A[A.Group=2]="Group",A}({});var ne=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}(ne||{});const hb={type:ni.Static,value:""},db=/[a-zA-Z0-9_]/;function pb(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=ne.Static,i=t;const o=[];let n;function r(){n&&o.push(n),n=[]}let g=0,s,a="",I="";function l(){a&&(t===ne.Static?n.push({type:ni.Static,value:a}):t===ne.Param||t===ne.ParamRegExp||t===ne.ParamRegExpEnd?(n.length>1&&(s==="*"||s==="+")&&e(`A repeatable param (${a}) must be alone in its segment. eg: '/:ids+.`),n.push({type:ni.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 tB(A,e){let t=0;const i=A.score,o=e.score;for(;t0&&e[e.length-1]<0}const kb={strict:!1,end:!0,sensitive:!1};function vb(A,e,t){const i=wb(pb(A.path),t),o=MA(i,{record:A,parent:e,children:[],alias:[]});return e&&!o.record.aliasOf==!e.record.aliasOf&&e.children.push(o),o}function Fb(A,e){const t=[],i=new Map;e=Ya(kb,e);function o(l){return i.get(l)}function n(l,C,Q){const f=!Q,h=Xa(l);h.aliasOf=Q&&Q.record;const u=Ya(e,l),E=[h];if("alias"in l){const p=typeof l.alias=="string"?[l.alias]:l.alias;for(const d of p)E.push(Xa(MA({},h,{components:Q?Q.record.components:h.components,path:d,aliasOf:Q?Q.record:h})))}let D,c;for(const p of E){const{path:d}=p;if(C&&d[0]!=="/"){const v=C.record.path,b=v[v.length-1]==="/"?"":"/";p.path=C.record.path+(d&&b+d)}if(D=vb(p,C,u),Q?Q.alias.push(D):(c=c||D,c!==D&&c.alias.push(D),f&&l.name&&!za(D)&&r(l.name)),iB(D)&&s(D),h.children){const v=h.children;for(let b=0;b{r(c)}:zi}function r(l){if(zl(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=bb(l,t);t.splice(C,0,l),l.record.name&&!za(l)&&i.set(l.record.name,l)}function a(l,C){let Q,f={},h,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,f=MA(Za(C.params,Q.keys.filter(c=>!c.optional).concat(Q.parent?Q.parent.keys.filter(c=>c.optional):[]).map(c=>c.name)),l.params&&Za(l.params,Q.keys.map(c=>c.name))),h=Q.stringify(f)}else if(l.path!=null)h=l.path,Q=t.find(c=>c.re.test(h)),Q&&(f=Q.parse(h),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,f=MA({},C.params,l.params),h=Q.stringify(f)}const E=[];let D=Q;for(;D;)E.unshift(D.record),D=D.parent;return{name:u,path:h,params:f,matched:E,meta:Rb(E)}}A.forEach(l=>n(l));function I(){t.length=0,i.clear()}return{addRoute:n,resolve:a,removeRoute:r,clearRoutes:I,getRoutes:g,getRecordMatcher:o}}function Za(A,e){const t={};for(const i of e)i in A&&(t[i]=A[i]);return t}function Xa(A){const e={path:A.path,redirect:A.redirect,name:A.name,meta:A.meta||{},aliasOf:A.aliasOf,beforeEnter:A.beforeEnter,props:Sb(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 Sb(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 za(A){for(;A;){if(A.record.aliasOf)return!0;A=A.parent}return!1}function Rb(A){return A.reduce((e,t)=>MA(e,t.meta),{})}function bb(A,e){let t=0,i=e.length;for(;t!==i;){const n=t+i>>1;tB(A,e[n])<0?i=n:t=n+1}const o=Nb(A);return o&&(i=e.lastIndexOf(o,i-1)),i}function Nb(A){let e=A;for(;e=e.parent;)if(iB(e)&&tB(A,e)===0)return e}function iB({record:A}){return!!(A.name||A.components&&Object.keys(A.components).length||A.redirect)}function $a(A){const e=rt(Rg),t=rt(AB),i=hA(()=>{const s=cA(A.to);return e.resolve(s)}),o=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=AI(s[a-2]);return a>1&&AI(I)===Q&&l[l.length-1].path!==Q?l.findIndex(bi.bind(null,s[a-2])):C}),n=hA(()=>o.value>-1&&xb(t.params,i.value.params)),r=hA(()=>o.value>-1&&o.value===t.matched.length-1&&Xl(t.params,i.value.params));function g(s={}){if(Mb(s)){const a=e[cA(A.replace)?"replace":"push"](cA(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:n,isExactActive:r,navigate:g}}function Gb(A){return A.length===1?A[0]:A}const Lb=fo({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:$a,setup(A,{slots:e}){const t=pn($a(A)),{options:i}=rt(Rg),o=hA(()=>({[eI(A.activeClass,i.linkActiveClass,"router-link-active")]:t.isActive,[eI(A.exactActiveClass,i.linkExactActiveClass,"router-link-exact-active")]:t.isExactActive}));return()=>{const n=e.default&&Gb(e.default(t));return A.custom?n:GA("a",{"aria-current":t.isExactActive?A.ariaCurrentValue:null,href:t.href,onClick:t.navigate,class:o.value},n)}}}),Ub=Lb;function Mb(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 xb(A,e){for(const t in e){const i=e[t],o=A[t];if(typeof i=="string"){if(i!==o)return!1}else if(!qe(o)||o.length!==i.length||i.some((n,r)=>n.valueOf()!==o[r].valueOf()))return!1}return!0}function AI(A){return A?A.aliasOf?A.aliasOf.path:A.path:""}const eI=(A,e,t)=>A??e??t,Jb=fo({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(A,{attrs:e,slots:t}){const i=rt(Pr),o=hA(()=>A.route||i.value),n=rt(Va,0),r=hA(()=>{let a=cA(n);const{matched:I}=o.value;let l;for(;(l=I[a])&&!l.components;)a++;return a}),g=hA(()=>o.value.matched[r.value]);Ho(Va,hA(()=>r.value+1)),Ho(Bb,g),Ho(Pr,o);const s=uA();return ae(()=>[s.value,g.value,A.name],([a,I,l],[C,Q,f])=>{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(h=>h(a))},{flush:"post"}),()=>{const a=o.value,I=A.name,l=g.value,C=l&&l.components[I];if(!C)return tI(t.default,{Component:C,route:a});const Q=l.props[I],f=Q?Q===!0?a.params:typeof Q=="function"?Q(a):Q:null,u=GA(C,MA({},f,e,{onVnodeUnmounted:E=>{E.component.isUnmounted&&(l.instances[I]=null)},ref:s}));return tI(t.default,{Component:u,route:a})||u}}});function tI(A,e){if(!A)return null;const t=A(e);return t.length===1?t[0]:t}const Tb=Jb;function Hb(A){const e=Fb(A.routes,A),t=A.parseQuery||Cb,i=A.stringifyQuery||Pa,o=A.history,n=Yi(),r=Yi(),g=Yi(),s=ig(Gt);let a=Gt;Ei&&A.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const I=rr.bind(null,_=>""+_),l=rr.bind(null,qR),C=rr.bind(null,Qo);function Q(_,eA){let tA,EA;return zl(_)?(tA=e.getRecordMatcher(_),EA=eA):EA=_,e.addRoute(EA,tA)}function f(_){const eA=e.getRecordMatcher(_);eA&&e.removeRoute(eA)}function h(){return e.getRoutes().map(_=>_.record)}function u(_){return!!e.getRecordMatcher(_)}function E(_,eA){if(eA=MA({},eA||s.value),typeof _=="string"){const k=gr(t,_,eA.path),x=e.resolve({path:k.path},eA),q=o.createHref(k.fullPath);return MA(k,x,{params:C(x.params),hash:Qo(k.hash),redirectedFrom:void 0,href:q})}let tA;if(_.path!=null)tA=MA({},_,{path:gr(t,_.path,eA.path).path});else{const k=MA({},_.params);for(const x in k)k[x]==null&&delete k[x];tA=MA({},_,{params:l(k)}),eA.params=l(eA.params)}const EA=e.resolve(tA,eA),SA=_.hash||"";EA.params=I(C(EA.params));const w=XR(i,MA({},_,{hash:PR(SA),path:EA.path})),S=o.createHref(w);return MA({fullPath:w,hash:SA,query:i===Pa?lb(_.query):_.query||{}},EA,{redirectedFrom:void 0,href:S})}function D(_){return typeof _=="string"?gr(t,_,s.value.path):MA({},_)}function c(_,eA){if(a!==_)return Ni(XA.NAVIGATION_CANCELLED,{from:eA,to:_})}function p(_){return b(_)}function d(_){return p(MA(D(_),{replace:!0}))}function v(_,eA){const tA=_.matched[_.matched.length-1];if(tA&&tA.redirect){const{redirect:EA}=tA;let SA=typeof EA=="function"?EA(_,eA):EA;return typeof SA=="string"&&(SA=SA.includes("?")||SA.includes("#")?SA=D(SA):{path:SA},SA.params={}),MA({query:_.query,hash:_.hash,params:SA.path!=null?{}:_.params},SA)}}function b(_,eA){const tA=a=E(_),EA=s.value,SA=_.state,w=_.force,S=_.replace===!0,k=v(tA,EA);if(k)return b(MA(D(k),{state:typeof k=="object"?MA({},SA,k.state):SA,force:w,replace:S}),eA||tA);const x=tA;x.redirectedFrom=eA;let q;return!w&&zR(i,EA,tA)&&(q=Ni(XA.NAVIGATION_DUPLICATED,{to:x,from:EA}),W(EA,EA,!0,!1)),(q?Promise.resolve(q):M(x,EA)).catch(V=>ct(V)?ct(V,XA.NAVIGATION_GUARD_REDIRECT)?V:Y(V):oA(V,x,EA)).then(V=>{if(V){if(ct(V,XA.NAVIGATION_GUARD_REDIRECT))return b(MA({replace:S},D(V.to),{state:typeof V.to=="object"?MA({},SA,V.to.state):SA,force:w}),eA||x)}else V=R(x,EA,!0,S,SA);return U(x,EA,V),V})}function N(_,eA){const tA=c(_,eA);return tA?Promise.reject(tA):Promise.resolve()}function H(_){const eA=NA.values().next().value;return eA&&typeof eA.runWithContext=="function"?eA.runWithContext(_):_()}function M(_,eA){let tA;const[EA,SA,w]=Qb(_,eA);tA=ar(EA.reverse(),"beforeRouteLeave",_,eA);for(const k of EA)k.leaveGuards.forEach(x=>{tA.push(Tt(x,_,eA))});const S=N.bind(null,_,eA);return tA.push(S),LA(tA).then(()=>{tA=[];for(const k of n.list())tA.push(Tt(k,_,eA));return tA.push(S),LA(tA)}).then(()=>{tA=ar(SA,"beforeRouteUpdate",_,eA);for(const k of SA)k.updateGuards.forEach(x=>{tA.push(Tt(x,_,eA))});return tA.push(S),LA(tA)}).then(()=>{tA=[];for(const k of w)if(k.beforeEnter)if(qe(k.beforeEnter))for(const x of k.beforeEnter)tA.push(Tt(x,_,eA));else tA.push(Tt(k.beforeEnter,_,eA));return tA.push(S),LA(tA)}).then(()=>(_.matched.forEach(k=>k.enterCallbacks={}),tA=ar(w,"beforeRouteEnter",_,eA,H),tA.push(S),LA(tA))).then(()=>{tA=[];for(const k of r.list())tA.push(Tt(k,_,eA));return tA.push(S),LA(tA)}).catch(k=>ct(k,XA.NAVIGATION_CANCELLED)?k:Promise.reject(k))}function U(_,eA,tA){g.list().forEach(EA=>H(()=>EA(_,eA,tA)))}function R(_,eA,tA,EA,SA){const w=c(_,eA);if(w)return w;const S=eA===Gt,k=Ei?history.state:{};tA&&(EA||S?o.replace(_.fullPath,MA({scroll:S&&k&&k.scroll},SA)):o.push(_.fullPath,SA)),s.value=_,W(_,eA,tA,S),Y()}let j;function rA(){j||(j=o.listen((_,eA,tA)=>{if(!oe.listening)return;const EA=E(_),SA=v(EA,oe.currentRoute.value);if(SA){b(MA(SA,{replace:!0,force:!0}),EA).catch(zi);return}a=EA;const w=s.value;Ei&&rb(Oa(w.fullPath,tA.delta),Un()),M(EA,w).catch(S=>ct(S,XA.NAVIGATION_ABORTED|XA.NAVIGATION_CANCELLED)?S:ct(S,XA.NAVIGATION_GUARD_REDIRECT)?(b(MA(D(S.to),{force:!0}),EA).then(k=>{ct(k,XA.NAVIGATION_ABORTED|XA.NAVIGATION_DUPLICATED)&&!tA.delta&&tA.type===Kr.pop&&o.go(-1,!1)}).catch(zi),Promise.reject()):(tA.delta&&o.go(-tA.delta,!1),oA(S,EA,w))).then(S=>{S=S||R(EA,w,!1),S&&(tA.delta&&!ct(S,XA.NAVIGATION_CANCELLED)?o.go(-tA.delta,!1):tA.type===Kr.pop&&ct(S,XA.NAVIGATION_ABORTED|XA.NAVIGATION_DUPLICATED)&&o.go(-1,!1)),U(EA,w,S)}).catch(zi)}))}let IA=Yi(),AA=Yi(),z;function oA(_,eA,tA){Y(_);const EA=AA.list();return EA.length?EA.forEach(SA=>SA(_,eA,tA)):console.error(_),Promise.reject(_)}function dA(){return z&&s.value!==Gt?Promise.resolve():new Promise((_,eA)=>{IA.add([_,eA])})}function Y(_){return z||(z=!_,rA(),IA.list().forEach(([eA,tA])=>_?tA(_):eA()),IA.reset()),_}function W(_,eA,tA,EA){const{scrollBehavior:SA}=A;if(!Ei||!SA)return Promise.resolve();const w=!tA&&gb(Oa(_.fullPath,0))||(EA||!tA)&&history.state&&history.state.scroll||null;return uo().then(()=>SA(_,eA,w)).then(S=>S&&nb(S)).catch(S=>oA(S,_,eA))}const $=_=>o.go(_);let DA;const NA=new Set,oe={currentRoute:s,listening:!0,addRoute:Q,removeRoute:f,clearRoutes:e.clearRoutes,hasRoute:u,getRoutes:h,resolve:E,options:A,push:p,replace:d,go:$,back:()=>$(-1),forward:()=>$(1),beforeEach:n.add,beforeResolve:r.add,afterEach:g.add,onError:AA.add,isReady:dA,install(_){_.component("RouterLink",Ub),_.component("RouterView",Tb),_.config.globalProperties.$router=oe,Object.defineProperty(_.config.globalProperties,"$route",{enumerable:!0,get:()=>cA(s)}),Ei&&!DA&&s.value===Gt&&(DA=!0,p(o.location).catch(EA=>{}));const eA={};for(const EA in Gt)Object.defineProperty(eA,EA,{get:()=>s.value[EA],enumerable:!0});_.provide(Rg,oe),_.provide(AB,kI(eA)),_.provide(Pr,s);const tA=_.unmount;NA.add(_),_.unmount=function(){NA.delete(_),NA.size<1&&(a=Gt,j&&j(),j=null,s.value=Gt,DA=!1,z=!1),tA()}}};function LA(_){return _.reduce((eA,tA)=>eA.then(()=>H(tA)),Promise.resolve())}return oe}const Yb=[{path:"/",name:"Home",component:()=>Ml(()=>Promise.resolve().then(()=>kR),void 0,import.meta.url)}],_b=Hb({history:fb("./"),routes:Yb}),Kb=du({legacy:!1,locale:td(),fallbackLocale:"en",messages:ed}),bg=dc(LR);bg.use(_b);bg.use(Kb);bg.mount("#app");