188 lines
732 KiB
JavaScript
188 lines
732 KiB
JavaScript
(function(_r){typeof define=="function"&&define.amd?define(_r):_r()})(function(){"use strict";/**
|
||
* @vue/shared v3.5.13
|
||
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
||
* @license MIT
|
||
**//*! #__NO_SIDE_EFFECTS__ */function _r(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const Qt={},yr=[],Oo=()=>{},Nh=()=>!1,rs=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Fl=e=>e.startsWith("onUpdate:"),xn=Object.assign,Bl=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},Fh=Object.prototype.hasOwnProperty,jt=(e,t)=>Fh.call(e,t),st=Array.isArray,br=e=>ai(e)==="[object Map]",wr=e=>ai(e)==="[object Set]",Jc=e=>ai(e)==="[object Date]",mt=e=>typeof e=="function",fn=e=>typeof e=="string",To=e=>typeof e=="symbol",Zt=e=>e!==null&&typeof e=="object",Xc=e=>(Zt(e)||mt(e))&&mt(e.then)&&mt(e.catch),Qc=Object.prototype.toString,ai=e=>Qc.call(e),Bh=e=>ai(e).slice(8,-1),Zc=e=>ai(e)==="[object Object]",Ul=e=>fn(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,ri=_r(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),is=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},Uh=/-(\w)/g,ho=is(e=>e.replace(Uh,(t,n)=>n?n.toUpperCase():"")),zh=/\B([A-Z])/g,ya=is(e=>e.replace(zh,"-$1").toLowerCase()),ss=is(e=>e.charAt(0).toUpperCase()+e.slice(1)),zl=is(e=>e?`on${ss(e)}`:""),ba=(e,t)=>!Object.is(e,t),ls=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},ed=(e,t,n,o=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:o,value:n})},us=e=>{const t=parseFloat(e);return isNaN(t)?e:t},Vh=e=>{const t=fn(e)?Number(e):NaN;return isNaN(t)?e:t};let td;const cs=()=>td||(td=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Bt(e){if(st(e)){const t={};for(let n=0;n<e.length;n++){const o=e[n],a=fn(o)?Gh(o):Bt(o);if(a)for(const r in a)t[r]=a[r]}return t}else if(fn(e)||Zt(e))return e}const Wh=/;(?![^(]*\))/g,jh=/:([^]+)/,Hh=/\/\*[^]*?\*\//g;function Gh(e){const t={};return e.replace(Hh,"").split(Wh).forEach(n=>{if(n){const o=n.split(jh);o.length>1&&(t[o[0].trim()]=o[1].trim())}}),t}function We(e){let t="";if(fn(e))t=e;else if(st(e))for(let n=0;n<e.length;n++){const o=We(e[n]);o&&(t+=o+" ")}else if(Zt(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}const qh=_r("itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly");function nd(e){return!!e||e===""}function Yh(e,t){if(e.length!==t.length)return!1;let n=!0;for(let o=0;n&&o<e.length;o++)n=Ga(e[o],t[o]);return n}function Ga(e,t){if(e===t)return!0;let n=Jc(e),o=Jc(t);if(n||o)return n&&o?e.getTime()===t.getTime():!1;if(n=To(e),o=To(t),n||o)return e===t;if(n=st(e),o=st(t),n||o)return n&&o?Yh(e,t):!1;if(n=Zt(e),o=Zt(t),n||o){if(!n||!o)return!1;const a=Object.keys(e).length,r=Object.keys(t).length;if(a!==r)return!1;for(const s in e){const u=e.hasOwnProperty(s),p=t.hasOwnProperty(s);if(u&&!p||!u&&p||!Ga(e[s],t[s]))return!1}}return String(e)===String(t)}function Vl(e,t){return e.findIndex(n=>Ga(n,t))}const od=e=>!!(e&&e.__v_isRef===!0),y=e=>fn(e)?e:e==null?"":st(e)||Zt(e)&&(e.toString===Qc||!mt(e.toString))?od(e)?y(e.value):JSON.stringify(e,ad,2):String(e),ad=(e,t)=>od(t)?ad(e,t.value):br(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[o,a],r)=>(n[Wl(o,r)+" =>"]=a,n),{})}:wr(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>Wl(n))}:To(t)?Wl(t):Zt(t)&&!st(t)&&!Zc(t)?String(t):t,Wl=(e,t="")=>{var n;return To(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};/**
|
||
* @vue/reactivity v3.5.13
|
||
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
||
* @license MIT
|
||
**/let Vn;class rd{constructor(t=!1){this.detached=t,this._active=!0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=Vn,!t&&Vn&&(this.index=(Vn.scopes||(Vn.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,n;if(this.scopes)for(t=0,n=this.scopes.length;t<n;t++)this.scopes[t].pause();for(t=0,n=this.effects.length;t<n;t++)this.effects[t].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let t,n;if(this.scopes)for(t=0,n=this.scopes.length;t<n;t++)this.scopes[t].resume();for(t=0,n=this.effects.length;t<n;t++)this.effects[t].resume()}}run(t){if(this._active){const n=Vn;try{return Vn=this,t()}finally{Vn=n}}}on(){Vn=this}off(){Vn=this.parent}stop(t){if(this._active){this._active=!1;let n,o;for(n=0,o=this.effects.length;n<o;n++)this.effects[n].stop();for(this.effects.length=0,n=0,o=this.cleanups.length;n<o;n++)this.cleanups[n]();if(this.cleanups.length=0,this.scopes){for(n=0,o=this.scopes.length;n<o;n++)this.scopes[n].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!t){const a=this.parent.scopes.pop();a&&a!==this&&(this.parent.scopes[this.index]=a,a.index=this.index)}this.parent=void 0}}}function jl(e){return new rd(e)}function id(){return Vn}function Kh(e,t=!1){Vn&&Vn.cleanups.push(e)}let tn;const Hl=new WeakSet;class sd{constructor(t){this.fn=t,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,Vn&&Vn.active&&Vn.effects.push(this)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,Hl.has(this)&&(Hl.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||ud(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,gd(this),cd(this);const t=tn,n=ko;tn=this,ko=!0;try{return this.fn()}finally{dd(this),tn=t,ko=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)Kl(t);this.deps=this.depsTail=void 0,gd(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Hl.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Yl(this)&&this.run()}get dirty(){return Yl(this)}}let ld=0,ii,si;function ud(e,t=!1){if(e.flags|=8,t){e.next=si,si=e;return}e.next=ii,ii=e}function Gl(){ld++}function ql(){if(--ld>0)return;if(si){let t=si;for(si=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;ii;){let t=ii;for(ii=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(o){e||(e=o)}t=n}}if(e)throw e}function cd(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function dd(e){let t,n=e.depsTail,o=n;for(;o;){const a=o.prevDep;o.version===-1?(o===n&&(n=a),Kl(o),Jh(o)):t=o,o.dep.activeLink=o.prevActiveLink,o.prevActiveLink=void 0,o=a}e.deps=t,e.depsTail=n}function Yl(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(pd(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function pd(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===li))return;e.globalVersion=li;const t=e.dep;if(e.flags|=2,t.version>0&&!e.isSSR&&e.deps&&!Yl(e)){e.flags&=-3;return}const n=tn,o=ko;tn=e,ko=!0;try{cd(e);const a=e.fn(e._value);(t.version===0||ba(a,e._value))&&(e._value=a,t.version++)}catch(a){throw t.version++,a}finally{tn=n,ko=o,dd(e),e.flags&=-3}}function Kl(e,t=!1){const{dep:n,prevSub:o,nextSub:a}=e;if(o&&(o.nextSub=a,e.prevSub=void 0),a&&(a.prevSub=o,e.nextSub=void 0),n.subs===e&&(n.subs=o,!o&&n.computed)){n.computed.flags&=-5;for(let r=n.computed.deps;r;r=r.nextDep)Kl(r,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function Jh(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let ko=!0;const fd=[];function Ko(){fd.push(ko),ko=!1}function Jo(){const e=fd.pop();ko=e===void 0?!0:e}function gd(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=tn;tn=void 0;try{t()}finally{tn=n}}}let li=0;class Xh{constructor(t,n){this.sub=t,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class Jl{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0}track(t){if(!tn||!ko||tn===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==tn)n=this.activeLink=new Xh(tn,this),tn.deps?(n.prevDep=tn.depsTail,tn.depsTail.nextDep=n,tn.depsTail=n):tn.deps=tn.depsTail=n,md(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const o=n.nextDep;o.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=o),n.prevDep=tn.depsTail,n.nextDep=void 0,tn.depsTail.nextDep=n,tn.depsTail=n,tn.deps===n&&(tn.deps=o)}return n}trigger(t){this.version++,li++,this.notify(t)}notify(t){Gl();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{ql()}}}function md(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let o=t.deps;o;o=o.nextDep)md(o)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const ds=new WeakMap,qa=Symbol(""),Xl=Symbol(""),ui=Symbol("");function Dn(e,t,n){if(ko&&tn){let o=ds.get(e);o||ds.set(e,o=new Map);let a=o.get(n);a||(o.set(n,a=new Jl),a.map=o,a.key=n),a.track()}}function Xo(e,t,n,o,a,r){const s=ds.get(e);if(!s){li++;return}const u=p=>{p&&p.trigger()};if(Gl(),t==="clear")s.forEach(u);else{const p=st(e),m=p&&Ul(n);if(p&&n==="length"){const f=Number(o);s.forEach((g,x)=>{(x==="length"||x===ui||!To(x)&&x>=f)&&u(g)})}else switch((n!==void 0||s.has(void 0))&&u(s.get(n)),m&&u(s.get(ui)),t){case"add":p?m&&u(s.get("length")):(u(s.get(qa)),br(e)&&u(s.get(Xl)));break;case"delete":p||(u(s.get(qa)),br(e)&&u(s.get(Xl)));break;case"set":br(e)&&u(s.get(qa));break}}ql()}function Qh(e,t){const n=ds.get(e);return n&&n.get(t)}function xr(e){const t=Lt(e);return t===e?t:(Dn(t,"iterate",ui),vo(e)?t:t.map(On))}function ps(e){return Dn(e=Lt(e),"iterate",ui),e}const Zh={__proto__:null,[Symbol.iterator](){return Ql(this,Symbol.iterator,On)},concat(...e){return xr(this).concat(...e.map(t=>st(t)?xr(t):t))},entries(){return Ql(this,"entries",e=>(e[1]=On(e[1]),e))},every(e,t){return Qo(this,"every",e,t,void 0,arguments)},filter(e,t){return Qo(this,"filter",e,t,n=>n.map(On),arguments)},find(e,t){return Qo(this,"find",e,t,On,arguments)},findIndex(e,t){return Qo(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return Qo(this,"findLast",e,t,On,arguments)},findLastIndex(e,t){return Qo(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return Qo(this,"forEach",e,t,void 0,arguments)},includes(...e){return Zl(this,"includes",e)},indexOf(...e){return Zl(this,"indexOf",e)},join(e){return xr(this).join(e)},lastIndexOf(...e){return Zl(this,"lastIndexOf",e)},map(e,t){return Qo(this,"map",e,t,void 0,arguments)},pop(){return ci(this,"pop")},push(...e){return ci(this,"push",e)},reduce(e,...t){return hd(this,"reduce",e,t)},reduceRight(e,...t){return hd(this,"reduceRight",e,t)},shift(){return ci(this,"shift")},some(e,t){return Qo(this,"some",e,t,void 0,arguments)},splice(...e){return ci(this,"splice",e)},toReversed(){return xr(this).toReversed()},toSorted(e){return xr(this).toSorted(e)},toSpliced(...e){return xr(this).toSpliced(...e)},unshift(...e){return ci(this,"unshift",e)},values(){return Ql(this,"values",On)}};function Ql(e,t,n){const o=ps(e),a=o[t]();return o!==e&&!vo(e)&&(a._next=a.next,a.next=()=>{const r=a._next();return r.value&&(r.value=n(r.value)),r}),a}const ev=Array.prototype;function Qo(e,t,n,o,a,r){const s=ps(e),u=s!==e&&!vo(e),p=s[t];if(p!==ev[t]){const g=p.apply(e,r);return u?On(g):g}let m=n;s!==e&&(u?m=function(g,x){return n.call(this,On(g),x,e)}:n.length>2&&(m=function(g,x){return n.call(this,g,x,e)}));const f=p.call(s,m,o);return u&&a?a(f):f}function hd(e,t,n,o){const a=ps(e);let r=n;return a!==e&&(vo(e)?n.length>3&&(r=function(s,u,p){return n.call(this,s,u,p,e)}):r=function(s,u,p){return n.call(this,s,On(u),p,e)}),a[t](r,...o)}function Zl(e,t,n){const o=Lt(e);Dn(o,"iterate",ui);const a=o[t](...n);return(a===-1||a===!1)&&tu(n[0])?(n[0]=Lt(n[0]),o[t](...n)):a}function ci(e,t,n=[]){Ko(),Gl();const o=Lt(e)[t].apply(e,n);return ql(),Jo(),o}const tv=_r("__proto__,__v_isRef,__isVue"),vd=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(To));function nv(e){To(e)||(e=String(e));const t=Lt(this);return Dn(t,"has",e),t.hasOwnProperty(e)}class _d{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,o){if(n==="__v_skip")return t.__v_skip;const a=this._isReadonly,r=this._isShallow;if(n==="__v_isReactive")return!a;if(n==="__v_isReadonly")return a;if(n==="__v_isShallow")return r;if(n==="__v_raw")return o===(a?r?Td:Sd:r?xd:wd).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(o)?t:void 0;const s=st(t);if(!a){let p;if(s&&(p=Zh[n]))return p;if(n==="hasOwnProperty")return nv}const u=Reflect.get(t,n,gn(t)?t:o);return(To(n)?vd.has(n):tv(n))||(a||Dn(t,"get",n),r)?u:gn(u)?s&&Ul(n)?u:u.value:Zt(u)?a?kd(u):hs(u):u}}class yd extends _d{constructor(t=!1){super(!1,t)}set(t,n,o,a){let r=t[n];if(!this._isShallow){const p=Ya(r);if(!vo(o)&&!Ya(o)&&(r=Lt(r),o=Lt(o)),!st(t)&&gn(r)&&!gn(o))return p?!1:(r.value=o,!0)}const s=st(t)&&Ul(n)?Number(n)<t.length:jt(t,n),u=Reflect.set(t,n,o,gn(t)?t:a);return t===Lt(a)&&(s?ba(o,r)&&Xo(t,"set",n,o):Xo(t,"add",n,o)),u}deleteProperty(t,n){const o=jt(t,n);t[n];const a=Reflect.deleteProperty(t,n);return a&&o&&Xo(t,"delete",n,void 0),a}has(t,n){const o=Reflect.has(t,n);return(!To(n)||!vd.has(n))&&Dn(t,"has",n),o}ownKeys(t){return Dn(t,"iterate",st(t)?"length":qa),Reflect.ownKeys(t)}}class bd extends _d{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const ov=new yd,av=new bd,rv=new yd(!0),iv=new bd(!0),eu=e=>e,fs=e=>Reflect.getPrototypeOf(e);function sv(e,t,n){return function(...o){const a=this.__v_raw,r=Lt(a),s=br(r),u=e==="entries"||e===Symbol.iterator&&s,p=e==="keys"&&s,m=a[e](...o),f=n?eu:t?ou:On;return!t&&Dn(r,"iterate",p?Xl:qa),{next(){const{value:g,done:x}=m.next();return x?{value:g,done:x}:{value:u?[f(g[0]),f(g[1])]:f(g),done:x}},[Symbol.iterator](){return this}}}}function gs(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function lv(e,t){const n={get(a){const r=this.__v_raw,s=Lt(r),u=Lt(a);e||(ba(a,u)&&Dn(s,"get",a),Dn(s,"get",u));const{has:p}=fs(s),m=t?eu:e?ou:On;if(p.call(s,a))return m(r.get(a));if(p.call(s,u))return m(r.get(u));r!==s&&r.get(a)},get size(){const a=this.__v_raw;return!e&&Dn(Lt(a),"iterate",qa),Reflect.get(a,"size",a)},has(a){const r=this.__v_raw,s=Lt(r),u=Lt(a);return e||(ba(a,u)&&Dn(s,"has",a),Dn(s,"has",u)),a===u?r.has(a):r.has(a)||r.has(u)},forEach(a,r){const s=this,u=s.__v_raw,p=Lt(u),m=t?eu:e?ou:On;return!e&&Dn(p,"iterate",qa),u.forEach((f,g)=>a.call(r,m(f),m(g),s))}};return xn(n,e?{add:gs("add"),set:gs("set"),delete:gs("delete"),clear:gs("clear")}:{add(a){!t&&!vo(a)&&!Ya(a)&&(a=Lt(a));const r=Lt(this);return fs(r).has.call(r,a)||(r.add(a),Xo(r,"add",a,a)),this},set(a,r){!t&&!vo(r)&&!Ya(r)&&(r=Lt(r));const s=Lt(this),{has:u,get:p}=fs(s);let m=u.call(s,a);m||(a=Lt(a),m=u.call(s,a));const f=p.call(s,a);return s.set(a,r),m?ba(r,f)&&Xo(s,"set",a,r):Xo(s,"add",a,r),this},delete(a){const r=Lt(this),{has:s,get:u}=fs(r);let p=s.call(r,a);p||(a=Lt(a),p=s.call(r,a)),u&&u.call(r,a);const m=r.delete(a);return p&&Xo(r,"delete",a,void 0),m},clear(){const a=Lt(this),r=a.size!==0,s=a.clear();return r&&Xo(a,"clear",void 0,void 0),s}}),["keys","values","entries",Symbol.iterator].forEach(a=>{n[a]=sv(a,e,t)}),n}function ms(e,t){const n=lv(e,t);return(o,a,r)=>a==="__v_isReactive"?!e:a==="__v_isReadonly"?e:a==="__v_raw"?o:Reflect.get(jt(n,a)&&a in o?n:o,a,r)}const uv={get:ms(!1,!1)},cv={get:ms(!1,!0)},dv={get:ms(!0,!1)},pv={get:ms(!0,!0)},wd=new WeakMap,xd=new WeakMap,Sd=new WeakMap,Td=new WeakMap;function fv(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function gv(e){return e.__v_skip||!Object.isExtensible(e)?0:fv(Bh(e))}function hs(e){return Ya(e)?e:vs(e,!1,ov,uv,wd)}function mv(e){return vs(e,!1,rv,cv,xd)}function kd(e){return vs(e,!0,av,dv,Sd)}function nD(e){return vs(e,!0,iv,pv,Td)}function vs(e,t,n,o,a){if(!Zt(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const r=a.get(e);if(r)return r;const s=gv(e);if(s===0)return e;const u=new Proxy(e,s===2?o:n);return a.set(e,u),u}function wa(e){return Ya(e)?wa(e.__v_raw):!!(e&&e.__v_isReactive)}function Ya(e){return!!(e&&e.__v_isReadonly)}function vo(e){return!!(e&&e.__v_isShallow)}function tu(e){return e?!!e.__v_raw:!1}function Lt(e){const t=e&&e.__v_raw;return t?Lt(t):e}function nu(e){return!jt(e,"__v_skip")&&Object.isExtensible(e)&&ed(e,"__v_skip",!0),e}const On=e=>Zt(e)?hs(e):e,ou=e=>Zt(e)?kd(e):e;function gn(e){return e?e.__v_isRef===!0:!1}function S(e){return Cd(e,!1)}function hv(e){return Cd(e,!0)}function Cd(e,t){return gn(e)?e:new vv(e,t)}class vv{constructor(t,n){this.dep=new Jl,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:Lt(t),this._value=n?t:On(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,o=this.__v_isShallow||vo(t)||Ya(t);t=o?t:Lt(t),ba(t,n)&&(this._rawValue=t,this._value=o?t:On(t),this.dep.trigger())}}function v(e){return gn(e)?e.value:e}const _v={get:(e,t,n)=>t==="__v_raw"?e:v(Reflect.get(e,t,n)),set:(e,t,n,o)=>{const a=e[t];return gn(a)&&!gn(n)?(a.value=n,!0):Reflect.set(e,t,n,o)}};function Ed(e){return wa(e)?e:new Proxy(e,_v)}function yv(e){const t=st(e)?new Array(e.length):{};for(const n in e)t[n]=wv(e,n);return t}class bv{constructor(t,n,o){this._object=t,this._key=n,this._defaultValue=o,this.__v_isRef=!0,this._value=void 0}get value(){const t=this._object[this._key];return this._value=t===void 0?this._defaultValue:t}set value(t){this._object[this._key]=t}get dep(){return Qh(Lt(this._object),this._key)}}function wv(e,t,n){const o=e[t];return gn(o)?o:new bv(e,t,n)}class xv{constructor(t,n,o){this.fn=t,this.setter=n,this._value=void 0,this.dep=new Jl(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=li-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=o}notify(){if(this.flags|=16,!(this.flags&8)&&tn!==this)return ud(this,!0),!0}get value(){const t=this.dep.track();return pd(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function Sv(e,t,n=!1){let o,a;return mt(e)?o=e:(o=e.get,a=e.set),new xv(o,a,n)}const _s={},ys=new WeakMap;let Ka;function Tv(e,t=!1,n=Ka){if(n){let o=ys.get(n);o||ys.set(n,o=[]),o.push(e)}}function kv(e,t,n=Qt){const{immediate:o,deep:a,once:r,scheduler:s,augmentJob:u,call:p}=n,m=M=>a?M:vo(M)||a===!1||a===0?Zo(M,1):Zo(M);let f,g,x,b,k=!1,$=!1;if(gn(e)?(g=()=>e.value,k=vo(e)):wa(e)?(g=()=>m(e),k=!0):st(e)?($=!0,k=e.some(M=>wa(M)||vo(M)),g=()=>e.map(M=>{if(gn(M))return M.value;if(wa(M))return m(M);if(mt(M))return p?p(M,2):M()})):mt(e)?t?g=p?()=>p(e,2):e:g=()=>{if(x){Ko();try{x()}finally{Jo()}}const M=Ka;Ka=f;try{return p?p(e,3,[b]):e(b)}finally{Ka=M}}:g=Oo,t&&a){const M=g,z=a===!0?1/0:a;g=()=>Zo(M(),z)}const O=id(),I=()=>{f.stop(),O&&O.active&&Bl(O.effects,f)};if(r&&t){const M=t;t=(...z)=>{M(...z),I()}}let V=$?new Array(e.length).fill(_s):_s;const me=M=>{if(!(!(f.flags&1)||!f.dirty&&!M))if(t){const z=f.run();if(a||k||($?z.some((ce,P)=>ba(ce,V[P])):ba(z,V))){x&&x();const ce=Ka;Ka=f;try{const P=[z,V===_s?void 0:$&&V[0]===_s?[]:V,b];p?p(t,3,P):t(...P),V=z}finally{Ka=ce}}}else f.run()};return u&&u(me),f=new sd(g),f.scheduler=s?()=>s(me,!1):me,b=M=>Tv(M,!1,f),x=f.onStop=()=>{const M=ys.get(f);if(M){if(p)p(M,4);else for(const z of M)z();ys.delete(f)}},t?o?me(!0):V=f.run():s?s(me.bind(null,!0),!0):f.run(),I.pause=f.pause.bind(f),I.resume=f.resume.bind(f),I.stop=I,I}function Zo(e,t=1/0,n){if(t<=0||!Zt(e)||e.__v_skip||(n=n||new Set,n.has(e)))return e;if(n.add(e),t--,gn(e))Zo(e.value,t,n);else if(st(e))for(let o=0;o<e.length;o++)Zo(e[o],t,n);else if(wr(e)||br(e))e.forEach(o=>{Zo(o,t,n)});else if(Zc(e)){for(const o in e)Zo(e[o],t,n);for(const o of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,o)&&Zo(e[o],t,n)}return e}/**
|
||
* @vue/runtime-core v3.5.13
|
||
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
||
* @license MIT
|
||
**/const di=[];let au=!1;function oD(e,...t){if(au)return;au=!0,Ko();const n=di.length?di[di.length-1].component:null,o=n&&n.appContext.config.warnHandler,a=Cv();if(o)Sr(o,n,11,[e+t.map(r=>{var s,u;return(u=(s=r.toString)==null?void 0:s.call(r))!=null?u:JSON.stringify(r)}).join(""),n&&n.proxy,a.map(({vnode:r})=>`at <${Op(n,r.type)}>`).join(`
|
||
`),a]);else{const r=[`[Vue warn]: ${e}`,...t];a.length&&r.push(`
|
||
`,...Ev(a)),console.warn(...r)}Jo(),au=!1}function Cv(){let e=di[di.length-1];if(!e)return[];const t=[];for(;e;){const n=t[0];n&&n.vnode===e?n.recurseCount++:t.push({vnode:e,recurseCount:0});const o=e.component&&e.component.parent;e=o&&o.vnode}return t}function Ev(e){const t=[];return e.forEach((n,o)=>{t.push(...o===0?[]:[`
|
||
`],...$v(n))}),t}function $v({vnode:e,recurseCount:t}){const n=t>0?`... (${t} recursive calls)`:"",o=e.component?e.component.parent==null:!1,a=` at <${Op(e.component,e.type,o)}`,r=">"+n;return e.props?[a,...Lv(e.props),r]:[a+r]}function Lv(e){const t=[],n=Object.keys(e);return n.slice(0,3).forEach(o=>{t.push(...$d(o,e[o]))}),n.length>3&&t.push(" ..."),t}function $d(e,t,n){return fn(t)?(t=JSON.stringify(t),n?t:[`${e}=${t}`]):typeof t=="number"||typeof t=="boolean"||t==null?n?t:[`${e}=${t}`]:gn(t)?(t=$d(e,Lt(t.value),!0),n?t:[`${e}=Ref<`,t,">"]):mt(t)?[`${e}=fn${t.name?`<${t.name}>`:""}`]:(t=Lt(t),n?t:[`${e}=`,t])}function Sr(e,t,n,o){try{return o?e(...o):e()}catch(a){bs(a,t,n)}}function Co(e,t,n,o){if(mt(e)){const a=Sr(e,t,n,o);return a&&Xc(a)&&a.catch(r=>{bs(r,t,n)}),a}if(st(e)){const a=[];for(let r=0;r<e.length;r++)a.push(Co(e[r],t,n,o));return a}}function bs(e,t,n,o=!0){const a=t?t.vnode:null,{errorHandler:r,throwUnhandledErrorInProduction:s}=t&&t.appContext.config||Qt;if(t){let u=t.parent;const p=t.proxy,m=`https://vuejs.org/error-reference/#runtime-${n}`;for(;u;){const f=u.ec;if(f){for(let g=0;g<f.length;g++)if(f[g](e,p,m)===!1)return}u=u.parent}if(r){Ko(),Sr(r,null,10,[e,p,m]),Jo();return}}Av(e,n,a,o,s)}function Av(e,t,n,o=!0,a=!1){if(a)throw e;console.error(e)}const Wn=[];let Ro=-1;const Tr=[];let xa=null,kr=0;const Ld=Promise.resolve();let ws=null;function vt(e){const t=ws||Ld;return e?t.then(this?e.bind(this):e):t}function Mv(e){let t=Ro+1,n=Wn.length;for(;t<n;){const o=t+n>>>1,a=Wn[o],r=pi(a);r<e||r===e&&a.flags&2?t=o+1:n=o}return t}function ru(e){if(!(e.flags&1)){const t=pi(e),n=Wn[Wn.length-1];!n||!(e.flags&2)&&t>=pi(n)?Wn.push(e):Wn.splice(Mv(t),0,e),e.flags|=1,Ad()}}function Ad(){ws||(ws=Ld.then(Dd))}function Iv(e){st(e)?Tr.push(...e):xa&&e.id===-1?xa.splice(kr+1,0,e):e.flags&1||(Tr.push(e),e.flags|=1),Ad()}function Md(e,t,n=Ro+1){for(;n<Wn.length;n++){const o=Wn[n];if(o&&o.flags&2){if(e&&o.id!==e.uid)continue;Wn.splice(n,1),n--,o.flags&4&&(o.flags&=-2),o(),o.flags&4||(o.flags&=-2)}}}function Id(e){if(Tr.length){const t=[...new Set(Tr)].sort((n,o)=>pi(n)-pi(o));if(Tr.length=0,xa){xa.push(...t);return}for(xa=t,kr=0;kr<xa.length;kr++){const n=xa[kr];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}xa=null,kr=0}}const pi=e=>e.id==null?e.flags&2?-1:1/0:e.id;function Dd(e){try{for(Ro=0;Ro<Wn.length;Ro++){const t=Wn[Ro];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),Sr(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;Ro<Wn.length;Ro++){const t=Wn[Ro];t&&(t.flags&=-2)}Ro=-1,Wn.length=0,Id(),ws=null,(Wn.length||Tr.length)&&Dd()}}let Sn=null,Od=null;function xs(e){const t=Sn;return Sn=e,Od=e&&e.type.__scopeId||null,t}function Pt(e,t=Sn,n){if(!t||e._n)return e;const o=(...a)=>{o._d&&Cp(-1);const r=xs(t);let s;try{s=e(...a)}finally{xs(r),o._d&&Cp(1)}return s};return o._n=!0,o._c=!0,o._d=!0,o}function $e(e,t){if(Sn===null)return e;const n=Ds(Sn),o=e.dirs||(e.dirs=[]);for(let a=0;a<t.length;a++){let[r,s,u,p=Qt]=t[a];r&&(mt(r)&&(r={mounted:r,updated:r}),r.deep&&Zo(s),o.push({dir:r,instance:n,value:s,oldValue:void 0,arg:u,modifiers:p}))}return e}function Ja(e,t,n,o){const a=e.dirs,r=t&&t.dirs;for(let s=0;s<a.length;s++){const u=a[s];r&&(u.oldValue=r[s].value);let p=u.dir[o];p&&(Ko(),Co(p,n,8,[e.el,u,e,t]),Jo())}}const Rd=Symbol("_vte"),Pd=e=>e.__isTeleport,fi=e=>e&&(e.disabled||e.disabled===""),Nd=e=>e&&(e.defer||e.defer===""),Fd=e=>typeof SVGElement<"u"&&e instanceof SVGElement,Bd=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,iu=(e,t)=>{const n=e&&e.to;return fn(n)?t?t(n):null:n},Ud={name:"Teleport",__isTeleport:!0,process(e,t,n,o,a,r,s,u,p,m){const{mc:f,pc:g,pbc:x,o:{insert:b,querySelector:k,createText:$,createComment:O}}=m,I=fi(t.props);let{shapeFlag:V,children:me,dynamicChildren:M}=t;if(e==null){const z=t.el=$(""),ce=t.anchor=$("");b(z,n,o),b(ce,n,o);const P=(ie,Oe)=>{V&16&&(a&&a.isCE&&(a.ce._teleportTarget=ie),f(me,ie,Oe,a,r,s,u,p))},le=()=>{const ie=t.target=iu(t.props,k),Oe=Vd(ie,t,$,b);ie&&(s!=="svg"&&Fd(ie)?s="svg":s!=="mathml"&&Bd(ie)&&(s="mathml"),I||(P(ie,Oe),Ts(t,!1)))};I&&(P(n,ce),Ts(t,!0)),Nd(t.props)?Hn(()=>{le(),t.el.__isMounted=!0},r):le()}else{if(Nd(t.props)&&!e.el.__isMounted){Hn(()=>{Ud.process(e,t,n,o,a,r,s,u,p,m),delete e.el.__isMounted},r);return}t.el=e.el,t.targetStart=e.targetStart;const z=t.anchor=e.anchor,ce=t.target=e.target,P=t.targetAnchor=e.targetAnchor,le=fi(e.props),ie=le?n:ce,Oe=le?z:P;if(s==="svg"||Fd(ce)?s="svg":(s==="mathml"||Bd(ce))&&(s="mathml"),M?(x(e.dynamicChildren,M,ie,a,r,s,u),vu(e,t,!0)):p||g(e,t,ie,Oe,a,r,s,u,!1),I)le?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):Ss(t,n,z,m,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const Ae=t.target=iu(t.props,k);Ae&&Ss(t,Ae,null,m,0)}else le&&Ss(t,ce,P,m,1);Ts(t,I)}},remove(e,t,n,{um:o,o:{remove:a}},r){const{shapeFlag:s,children:u,anchor:p,targetStart:m,targetAnchor:f,target:g,props:x}=e;if(g&&(a(m),a(f)),r&&a(p),s&16){const b=r||!fi(x);for(let k=0;k<u.length;k++){const $=u[k];o($,t,n,b,!!$.dynamicChildren)}}},move:Ss,hydrate:Dv};function Ss(e,t,n,{o:{insert:o},m:a},r=2){r===0&&o(e.targetAnchor,t,n);const{el:s,anchor:u,shapeFlag:p,children:m,props:f}=e,g=r===2;if(g&&o(s,t,n),(!g||fi(f))&&p&16)for(let x=0;x<m.length;x++)a(m[x],t,n,2);g&&o(u,t,n)}function Dv(e,t,n,o,a,r,{o:{nextSibling:s,parentNode:u,querySelector:p,insert:m,createText:f}},g){const x=t.target=iu(t.props,p);if(x){const b=fi(t.props),k=x._lpa||x.firstChild;if(t.shapeFlag&16)if(b)t.anchor=g(s(e),t,u(e),n,o,a,r),t.targetStart=k,t.targetAnchor=k&&s(k);else{t.anchor=s(e);let $=k;for(;$;){if($&&$.nodeType===8){if($.data==="teleport start anchor")t.targetStart=$;else if($.data==="teleport anchor"){t.targetAnchor=$,x._lpa=t.targetAnchor&&s(t.targetAnchor);break}}$=s($)}t.targetAnchor||Vd(x,t,f,m),g(k&&s(k),t,x,n,o,a,r)}Ts(t,b)}return t.anchor&&s(t.anchor)}const zd=Ud;function Ts(e,t){const n=e.ctx;if(n&&n.ut){let o,a;for(t?(o=e.el,a=e.anchor):(o=e.targetStart,a=e.targetAnchor);o&&o!==a;)o.nodeType===1&&o.setAttribute("data-v-owner",n.uid),o=o.nextSibling;n.ut()}}function Vd(e,t,n,o){const a=t.targetStart=n(""),r=t.targetAnchor=n("");return a[Rd]=r,e&&(o(a,e),o(r,e)),r}const Sa=Symbol("_leaveCb"),ks=Symbol("_enterCb");function Wd(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return Ut(()=>{e.isMounted=!0}),Ta(()=>{e.isUnmounting=!0}),e}const _o=[Function,Array],jd={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:_o,onEnter:_o,onAfterEnter:_o,onEnterCancelled:_o,onBeforeLeave:_o,onLeave:_o,onAfterLeave:_o,onLeaveCancelled:_o,onBeforeAppear:_o,onAppear:_o,onAfterAppear:_o,onAppearCancelled:_o},Hd=e=>{const t=e.subTree;return t.component?Hd(t.component):t},Ov={name:"BaseTransition",props:jd,setup(e,{slots:t}){const n=tr(),o=Wd();return()=>{const a=t.default&&lu(t.default(),!0);if(!a||!a.length)return;const r=Gd(a),s=Lt(e),{mode:u}=s;if(o.isLeaving)return su(r);const p=Yd(r);if(!p)return su(r);let m=gi(p,s,o,n,g=>m=g);p.type!==Gn&&Xa(p,m);let f=n.subTree&&Yd(n.subTree);if(f&&f.type!==Gn&&!er(p,f)&&Hd(n).type!==Gn){let g=gi(f,s,o,n);if(Xa(f,g),u==="out-in"&&p.type!==Gn)return o.isLeaving=!0,g.afterLeave=()=>{o.isLeaving=!1,n.job.flags&8||n.update(),delete g.afterLeave,f=void 0},su(r);u==="in-out"&&p.type!==Gn?g.delayLeave=(x,b,k)=>{const $=qd(o,f);$[String(f.key)]=f,x[Sa]=()=>{b(),x[Sa]=void 0,delete m.delayedLeave,f=void 0},m.delayedLeave=()=>{k(),delete m.delayedLeave,f=void 0}}:f=void 0}else f&&(f=void 0);return r}}};function Gd(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==Gn){t=n;break}}return t}const Rv=Ov;function qd(e,t){const{leavingVNodes:n}=e;let o=n.get(t.type);return o||(o=Object.create(null),n.set(t.type,o)),o}function gi(e,t,n,o,a){const{appear:r,mode:s,persisted:u=!1,onBeforeEnter:p,onEnter:m,onAfterEnter:f,onEnterCancelled:g,onBeforeLeave:x,onLeave:b,onAfterLeave:k,onLeaveCancelled:$,onBeforeAppear:O,onAppear:I,onAfterAppear:V,onAppearCancelled:me}=t,M=String(e.key),z=qd(n,e),ce=(ie,Oe)=>{ie&&Co(ie,o,9,Oe)},P=(ie,Oe)=>{const Ae=Oe[1];ce(ie,Oe),st(ie)?ie.every(fe=>fe.length<=1)&&Ae():ie.length<=1&&Ae()},le={mode:s,persisted:u,beforeEnter(ie){let Oe=p;if(!n.isMounted)if(r)Oe=O||p;else return;ie[Sa]&&ie[Sa](!0);const Ae=z[M];Ae&&er(e,Ae)&&Ae.el[Sa]&&Ae.el[Sa](),ce(Oe,[ie])},enter(ie){let Oe=m,Ae=f,fe=g;if(!n.isMounted)if(r)Oe=I||m,Ae=V||f,fe=me||g;else return;let _e=!1;const ae=ie[ks]=W=>{_e||(_e=!0,W?ce(fe,[ie]):ce(Ae,[ie]),le.delayedLeave&&le.delayedLeave(),ie[ks]=void 0)};Oe?P(Oe,[ie,ae]):ae()},leave(ie,Oe){const Ae=String(e.key);if(ie[ks]&&ie[ks](!0),n.isUnmounting)return Oe();ce(x,[ie]);let fe=!1;const _e=ie[Sa]=ae=>{fe||(fe=!0,Oe(),ae?ce($,[ie]):ce(k,[ie]),ie[Sa]=void 0,z[Ae]===e&&delete z[Ae])};z[Ae]=e,b?P(b,[ie,_e]):_e()},clone(ie){const Oe=gi(ie,t,n,o,a);return a&&a(Oe),Oe}};return le}function su(e){if(Es(e))return e=ka(e),e.children=null,e}function Yd(e){if(!Es(e))return Pd(e.type)&&e.children?Gd(e.children):e;const{shapeFlag:t,children:n}=e;if(n){if(t&16)return n[0];if(t&32&&mt(n.default))return n.default()}}function Xa(e,t){e.shapeFlag&6&&e.component?(e.transition=t,Xa(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function lu(e,t=!1,n){let o=[],a=0;for(let r=0;r<e.length;r++){let s=e[r];const u=n==null?s.key:String(n)+String(s.key!=null?s.key:r);s.type===Ke?(s.patchFlag&128&&a++,o=o.concat(lu(s.children,t,u))):(t||s.type!==Gn)&&o.push(u!=null?ka(s,{key:u}):s)}if(a>1)for(let r=0;r<o.length;r++)o[r].patchFlag=-2;return o}/*! #__NO_SIDE_EFFECTS__ */function uu(e,t){return mt(e)?xn({name:e.name},t,{setup:e}):e}function Kd(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function Cs(e,t,n,o,a=!1){if(st(e)){e.forEach((k,$)=>Cs(k,t&&(st(t)?t[$]:t),n,o,a));return}if(Cr(o)&&!a){o.shapeFlag&512&&o.type.__asyncResolved&&o.component.subTree.component&&Cs(e,t,n,o.component.subTree);return}const r=o.shapeFlag&4?Ds(o.component):o.el,s=a?null:r,{i:u,r:p}=e,m=t&&t.r,f=u.refs===Qt?u.refs={}:u.refs,g=u.setupState,x=Lt(g),b=g===Qt?()=>!1:k=>jt(x,k);if(m!=null&&m!==p&&(fn(m)?(f[m]=null,b(m)&&(g[m]=null)):gn(m)&&(m.value=null)),mt(p))Sr(p,u,12,[s,f]);else{const k=fn(p),$=gn(p);if(k||$){const O=()=>{if(e.f){const I=k?b(p)?g[p]:f[p]:p.value;a?st(I)&&Bl(I,r):st(I)?I.includes(r)||I.push(r):k?(f[p]=[r],b(p)&&(g[p]=f[p])):(p.value=[r],e.k&&(f[e.k]=p.value))}else k?(f[p]=s,b(p)&&(g[p]=s)):$&&(p.value=s,e.k&&(f[e.k]=s))};s?(O.id=-1,Hn(O,n)):O()}}}cs().requestIdleCallback,cs().cancelIdleCallback;const Cr=e=>!!e.type.__asyncLoader,Es=e=>e.type.__isKeepAlive;function Pv(e,t){Jd(e,"a",t)}function Nv(e,t){Jd(e,"da",t)}function Jd(e,t,n=$n){const o=e.__wdc||(e.__wdc=()=>{let a=n;for(;a;){if(a.isDeactivated)return;a=a.parent}return e()});if($s(t,o,n),n){let a=n.parent;for(;a&&a.parent;)Es(a.parent.vnode)&&Fv(o,t,n,a),a=a.parent}}function Fv(e,t,n,o){const a=$s(t,e,o,!0);so(()=>{Bl(o[t],a)},n)}function $s(e,t,n=$n,o=!1){if(n){const a=n[e]||(n[e]=[]),r=t.__weh||(t.__weh=(...s)=>{Ko();const u=xi(n),p=Co(t,n,e,s);return u(),Jo(),p});return o?a.unshift(r):a.push(r),r}}const ea=e=>(t,n=$n)=>{(!Si||e==="sp")&&$s(e,(...o)=>t(...o),n)},Bv=ea("bm"),Ut=ea("m"),Xd=ea("bu"),Qd=ea("u"),Ta=ea("bum"),so=ea("um"),Uv=ea("sp"),zv=ea("rtg"),Vv=ea("rtc");function Wv(e,t=$n){$s("ec",e,t)}const jv="components";function Hv(e,t){return qv(jv,e,!0,t)||e}const Gv=Symbol.for("v-ndc");function qv(e,t,n=!0,o=!1){const a=Sn||$n;if(a){const r=a.type;{const u=Dp(r,!1);if(u&&(u===t||u===ho(t)||u===ss(ho(t))))return r}const s=Zd(a[e]||r[e],t)||Zd(a.appContext[e],t);return!s&&o?r:s}}function Zd(e,t){return e&&(e[t]||e[ho(t)]||e[ss(ho(t))])}function lt(e,t,n,o){let a;const r=n,s=st(e);if(s||fn(e)){const u=s&&wa(e);let p=!1;u&&(p=!vo(e),e=ps(e)),a=new Array(e.length);for(let m=0,f=e.length;m<f;m++)a[m]=t(p?On(e[m]):e[m],m,void 0,r)}else if(typeof e=="number"){a=new Array(e);for(let u=0;u<e;u++)a[u]=t(u+1,u,void 0,r)}else if(Zt(e))if(e[Symbol.iterator])a=Array.from(e,(u,p)=>t(u,p,void 0,r));else{const u=Object.keys(e);a=new Array(u.length);for(let p=0,m=u.length;p<m;p++){const f=u[p];a[p]=t(e[f],f,p,r)}}else a=[];return a}function mi(e,t,n={},o,a){if(Sn.ce||Sn.parent&&Cr(Sn.parent)&&Sn.parent.ce)return t!=="default"&&(n.name=t),E(),Jt(Ke,null,[it("slot",n,o&&o())],64);let r=e[t];r&&r._c&&(r._d=!1),E();const s=r&&ep(r(n)),u=n.key||s&&s.key,p=Jt(Ke,{key:(u&&!To(u)?u:`_${t}`)+(!s&&o?"_fb":"")},s||(o?o():[]),s&&e._===1?64:-2);return!a&&p.scopeId&&(p.slotScopeIds=[p.scopeId+"-s"]),r&&r._c&&(r._d=!0),p}function ep(e){return e.some(t=>wi(t)?!(t.type===Gn||t.type===Ke&&!ep(t.children)):!0)?e:null}const cu=e=>e?Ap(e)?Ds(e):cu(e.parent):null,hi=xn(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>cu(e.parent),$root:e=>cu(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>ap(e),$forceUpdate:e=>e.f||(e.f=()=>{ru(e.update)}),$nextTick:e=>e.n||(e.n=vt.bind(e.proxy)),$watch:e=>h1.bind(e)}),du=(e,t)=>e!==Qt&&!e.__isScriptSetup&&jt(e,t),Yv={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:o,data:a,props:r,accessCache:s,type:u,appContext:p}=e;let m;if(t[0]!=="$"){const b=s[t];if(b!==void 0)switch(b){case 1:return o[t];case 2:return a[t];case 4:return n[t];case 3:return r[t]}else{if(du(o,t))return s[t]=1,o[t];if(a!==Qt&&jt(a,t))return s[t]=2,a[t];if((m=e.propsOptions[0])&&jt(m,t))return s[t]=3,r[t];if(n!==Qt&&jt(n,t))return s[t]=4,n[t];pu&&(s[t]=0)}}const f=hi[t];let g,x;if(f)return t==="$attrs"&&Dn(e.attrs,"get",""),f(e);if((g=u.__cssModules)&&(g=g[t]))return g;if(n!==Qt&&jt(n,t))return s[t]=4,n[t];if(x=p.config.globalProperties,jt(x,t))return x[t]},set({_:e},t,n){const{data:o,setupState:a,ctx:r}=e;return du(a,t)?(a[t]=n,!0):o!==Qt&&jt(o,t)?(o[t]=n,!0):jt(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(r[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:o,appContext:a,propsOptions:r}},s){let u;return!!n[s]||e!==Qt&&jt(e,s)||du(t,s)||(u=r[0])&&jt(u,s)||jt(o,s)||jt(hi,s)||jt(a.config.globalProperties,s)},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:jt(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function tp(e){return st(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let pu=!0;function Kv(e){const t=ap(e),n=e.proxy,o=e.ctx;pu=!1,t.beforeCreate&&np(t.beforeCreate,e,"bc");const{data:a,computed:r,methods:s,watch:u,provide:p,inject:m,created:f,beforeMount:g,mounted:x,beforeUpdate:b,updated:k,activated:$,deactivated:O,beforeDestroy:I,beforeUnmount:V,destroyed:me,unmounted:M,render:z,renderTracked:ce,renderTriggered:P,errorCaptured:le,serverPrefetch:ie,expose:Oe,inheritAttrs:Ae,components:fe,directives:_e,filters:ae}=t;if(m&&Jv(m,o,null),s)for(const Q in s){const X=s[Q];mt(X)&&(o[Q]=X.bind(n))}if(a){const Q=a.call(n,n);Zt(Q)&&(e.data=hs(Q))}if(pu=!0,r)for(const Q in r){const X=r[Q],ye=mt(X)?X.bind(n,n):mt(X.get)?X.get.bind(n,n):Oo,pe=!mt(X)&&mt(X.set)?X.set.bind(n):Oo,Z=Ht({get:ye,set:pe});Object.defineProperty(o,Q,{enumerable:!0,configurable:!0,get:()=>Z.value,set:oe=>Z.value=oe})}if(u)for(const Q in u)op(u[Q],o,n,Q);if(p){const Q=mt(p)?p.call(n):p;Reflect.ownKeys(Q).forEach(X=>{n1(X,Q[X])})}f&&np(f,e,"c");function re(Q,X){st(X)?X.forEach(ye=>Q(ye.bind(n))):X&&Q(X.bind(n))}if(re(Bv,g),re(Ut,x),re(Xd,b),re(Qd,k),re(Pv,$),re(Nv,O),re(Wv,le),re(Vv,ce),re(zv,P),re(Ta,V),re(so,M),re(Uv,ie),st(Oe))if(Oe.length){const Q=e.exposed||(e.exposed={});Oe.forEach(X=>{Object.defineProperty(Q,X,{get:()=>n[X],set:ye=>n[X]=ye})})}else e.exposed||(e.exposed={});z&&e.render===Oo&&(e.render=z),Ae!=null&&(e.inheritAttrs=Ae),fe&&(e.components=fe),_e&&(e.directives=_e),ie&&Kd(e)}function Jv(e,t,n=Oo){st(e)&&(e=fu(e));for(const o in e){const a=e[o];let r;Zt(a)?"default"in a?r=Er(a.from||o,a.default,!0):r=Er(a.from||o):r=Er(a),gn(r)?Object.defineProperty(t,o,{enumerable:!0,configurable:!0,get:()=>r.value,set:s=>r.value=s}):t[o]=r}}function np(e,t,n){Co(st(e)?e.map(o=>o.bind(t.proxy)):e.bind(t.proxy),t,n)}function op(e,t,n,o){let a=o.includes(".")?wp(n,o):()=>n[o];if(fn(e)){const r=t[e];mt(r)&&At(a,r)}else if(mt(e))At(a,e.bind(n));else if(Zt(e))if(st(e))e.forEach(r=>op(r,t,n,o));else{const r=mt(e.handler)?e.handler.bind(n):t[e.handler];mt(r)&&At(a,r,e)}}function ap(e){const t=e.type,{mixins:n,extends:o}=t,{mixins:a,optionsCache:r,config:{optionMergeStrategies:s}}=e.appContext,u=r.get(t);let p;return u?p=u:!a.length&&!n&&!o?p=t:(p={},a.length&&a.forEach(m=>Ls(p,m,s,!0)),Ls(p,t,s)),Zt(t)&&r.set(t,p),p}function Ls(e,t,n,o=!1){const{mixins:a,extends:r}=t;r&&Ls(e,r,n,!0),a&&a.forEach(s=>Ls(e,s,n,!0));for(const s in t)if(!(o&&s==="expose")){const u=Xv[s]||n&&n[s];e[s]=u?u(e[s],t[s]):t[s]}return e}const Xv={data:rp,props:ip,emits:ip,methods:vi,computed:vi,beforeCreate:jn,created:jn,beforeMount:jn,mounted:jn,beforeUpdate:jn,updated:jn,beforeDestroy:jn,beforeUnmount:jn,destroyed:jn,unmounted:jn,activated:jn,deactivated:jn,errorCaptured:jn,serverPrefetch:jn,components:vi,directives:vi,watch:Zv,provide:rp,inject:Qv};function rp(e,t){return t?e?function(){return xn(mt(e)?e.call(this,this):e,mt(t)?t.call(this,this):t)}:t:e}function Qv(e,t){return vi(fu(e),fu(t))}function fu(e){if(st(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function jn(e,t){return e?[...new Set([].concat(e,t))]:t}function vi(e,t){return e?xn(Object.create(null),e,t):t}function ip(e,t){return e?st(e)&&st(t)?[...new Set([...e,...t])]:xn(Object.create(null),tp(e),tp(t??{})):t}function Zv(e,t){if(!e)return t;if(!t)return e;const n=xn(Object.create(null),e);for(const o in t)n[o]=jn(e[o],t[o]);return n}function sp(){return{app:null,config:{isNativeTag:Nh,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let e1=0;function t1(e,t){return function(o,a=null){mt(o)||(o=xn({},o)),a!=null&&!Zt(a)&&(a=null);const r=sp(),s=new WeakSet,u=[];let p=!1;const m=r.app={_uid:e1++,_component:o,_props:a,_container:null,_context:r,_instance:null,version:F1,get config(){return r.config},set config(f){},use(f,...g){return s.has(f)||(f&&mt(f.install)?(s.add(f),f.install(m,...g)):mt(f)&&(s.add(f),f(m,...g))),m},mixin(f){return r.mixins.includes(f)||r.mixins.push(f),m},component(f,g){return g?(r.components[f]=g,m):r.components[f]},directive(f,g){return g?(r.directives[f]=g,m):r.directives[f]},mount(f,g,x){if(!p){const b=m._ceVNode||it(o,a);return b.appContext=r,x===!0?x="svg":x===!1&&(x=void 0),e(b,f,x),p=!0,m._container=f,f.__vue_app__=m,Ds(b.component)}},onUnmount(f){u.push(f)},unmount(){p&&(Co(u,m._instance,16),e(null,m._container),delete m._container.__vue_app__)},provide(f,g){return r.provides[f]=g,m},runWithContext(f){const g=Qa;Qa=m;try{return f()}finally{Qa=g}}};return m}}let Qa=null;function n1(e,t){if($n){let n=$n.provides;const o=$n.parent&&$n.parent.provides;o===n&&(n=$n.provides=Object.create(o)),n[e]=t}}function Er(e,t,n=!1){const o=$n||Sn;if(o||Qa){const a=Qa?Qa._context.provides:o?o.parent==null?o.vnode.appContext&&o.vnode.appContext.provides:o.parent.provides:void 0;if(a&&e in a)return a[e];if(arguments.length>1)return n&&mt(t)?t.call(o&&o.proxy):t}}function o1(){return!!($n||Sn||Qa)}const lp={},up=()=>Object.create(lp),cp=e=>Object.getPrototypeOf(e)===lp;function a1(e,t,n,o=!1){const a={},r=up();e.propsDefaults=Object.create(null),dp(e,t,a,r);for(const s in e.propsOptions[0])s in a||(a[s]=void 0);n?e.props=o?a:mv(a):e.type.props?e.props=a:e.props=r,e.attrs=r}function r1(e,t,n,o){const{props:a,attrs:r,vnode:{patchFlag:s}}=e,u=Lt(a),[p]=e.propsOptions;let m=!1;if((o||s>0)&&!(s&16)){if(s&8){const f=e.vnode.dynamicProps;for(let g=0;g<f.length;g++){let x=f[g];if(As(e.emitsOptions,x))continue;const b=t[x];if(p)if(jt(r,x))b!==r[x]&&(r[x]=b,m=!0);else{const k=ho(x);a[k]=gu(p,u,k,b,e,!1)}else b!==r[x]&&(r[x]=b,m=!0)}}}else{dp(e,t,a,r)&&(m=!0);let f;for(const g in u)(!t||!jt(t,g)&&((f=ya(g))===g||!jt(t,f)))&&(p?n&&(n[g]!==void 0||n[f]!==void 0)&&(a[g]=gu(p,u,g,void 0,e,!0)):delete a[g]);if(r!==u)for(const g in r)(!t||!jt(t,g))&&(delete r[g],m=!0)}m&&Xo(e.attrs,"set","")}function dp(e,t,n,o){const[a,r]=e.propsOptions;let s=!1,u;if(t)for(let p in t){if(ri(p))continue;const m=t[p];let f;a&&jt(a,f=ho(p))?!r||!r.includes(f)?n[f]=m:(u||(u={}))[f]=m:As(e.emitsOptions,p)||(!(p in o)||m!==o[p])&&(o[p]=m,s=!0)}if(r){const p=Lt(n),m=u||Qt;for(let f=0;f<r.length;f++){const g=r[f];n[g]=gu(a,p,g,m[g],e,!jt(m,g))}}return s}function gu(e,t,n,o,a,r){const s=e[n];if(s!=null){const u=jt(s,"default");if(u&&o===void 0){const p=s.default;if(s.type!==Function&&!s.skipFactory&&mt(p)){const{propsDefaults:m}=a;if(n in m)o=m[n];else{const f=xi(a);o=m[n]=p.call(null,t),f()}}else o=p;a.ce&&a.ce._setProp(n,o)}s[0]&&(r&&!u?o=!1:s[1]&&(o===""||o===ya(n))&&(o=!0))}return o}const i1=new WeakMap;function pp(e,t,n=!1){const o=n?i1:t.propsCache,a=o.get(e);if(a)return a;const r=e.props,s={},u=[];let p=!1;if(!mt(e)){const f=g=>{p=!0;const[x,b]=pp(g,t,!0);xn(s,x),b&&u.push(...b)};!n&&t.mixins.length&&t.mixins.forEach(f),e.extends&&f(e.extends),e.mixins&&e.mixins.forEach(f)}if(!r&&!p)return Zt(e)&&o.set(e,yr),yr;if(st(r))for(let f=0;f<r.length;f++){const g=ho(r[f]);fp(g)&&(s[g]=Qt)}else if(r)for(const f in r){const g=ho(f);if(fp(g)){const x=r[f],b=s[g]=st(x)||mt(x)?{type:x}:xn({},x),k=b.type;let $=!1,O=!0;if(st(k))for(let I=0;I<k.length;++I){const V=k[I],me=mt(V)&&V.name;if(me==="Boolean"){$=!0;break}else me==="String"&&(O=!1)}else $=mt(k)&&k.name==="Boolean";b[0]=$,b[1]=O,($||jt(b,"default"))&&u.push(g)}}const m=[s,u];return Zt(e)&&o.set(e,m),m}function fp(e){return e[0]!=="$"&&!ri(e)}const gp=e=>e[0]==="_"||e==="$stable",mu=e=>st(e)?e.map(Po):[Po(e)],s1=(e,t,n)=>{if(t._n)return t;const o=Pt((...a)=>mu(t(...a)),n);return o._c=!1,o},mp=(e,t,n)=>{const o=e._ctx;for(const a in e){if(gp(a))continue;const r=e[a];if(mt(r))t[a]=s1(a,r,o);else if(r!=null){const s=mu(r);t[a]=()=>s}}},hp=(e,t)=>{const n=mu(t);e.slots.default=()=>n},vp=(e,t,n)=>{for(const o in t)(n||o!=="_")&&(e[o]=t[o])},l1=(e,t,n)=>{const o=e.slots=up();if(e.vnode.shapeFlag&32){const a=t._;a?(vp(o,t,n),n&&ed(o,"_",a,!0)):mp(t,o)}else t&&hp(e,t)},u1=(e,t,n)=>{const{vnode:o,slots:a}=e;let r=!0,s=Qt;if(o.shapeFlag&32){const u=t._;u?n&&u===1?r=!1:vp(a,t,n):(r=!t.$stable,mp(t,a)),s=t}else t&&(hp(e,t),s={default:1});if(r)for(const u in a)!gp(u)&&s[u]==null&&delete a[u]},Hn=S1;function c1(e){return d1(e)}function d1(e,t){const n=cs();n.__VUE__=!0;const{insert:o,remove:a,patchProp:r,createElement:s,createText:u,createComment:p,setText:m,setElementText:f,parentNode:g,nextSibling:x,setScopeId:b=Oo,insertStaticContent:k}=e,$=(L,C,G,de=null,Se=null,Le=null,N=void 0,T=null,j=!!C.dynamicChildren)=>{if(L===C)return;L&&!er(L,C)&&(de=K(L),oe(L,Se,Le,!0),L=null),C.patchFlag===-2&&(j=!1,C.dynamicChildren=null);const{type:ne,ref:Pe,shapeFlag:De}=C;switch(ne){case _i:O(L,C,G,de);break;case Gn:I(L,C,G,de);break;case _u:L==null&&V(C,G,de,N);break;case Ke:fe(L,C,G,de,Se,Le,N,T,j);break;default:De&1?z(L,C,G,de,Se,Le,N,T,j):De&6?_e(L,C,G,de,Se,Le,N,T,j):(De&64||De&128)&&ne.process(L,C,G,de,Se,Le,N,T,j,J)}Pe!=null&&Se&&Cs(Pe,L&&L.ref,Le,C||L,!C)},O=(L,C,G,de)=>{if(L==null)o(C.el=u(C.children),G,de);else{const Se=C.el=L.el;C.children!==L.children&&m(Se,C.children)}},I=(L,C,G,de)=>{L==null?o(C.el=p(C.children||""),G,de):C.el=L.el},V=(L,C,G,de)=>{[L.el,L.anchor]=k(L.children,C,G,de,L.el,L.anchor)},me=({el:L,anchor:C},G,de)=>{let Se;for(;L&&L!==C;)Se=x(L),o(L,G,de),L=Se;o(C,G,de)},M=({el:L,anchor:C})=>{let G;for(;L&&L!==C;)G=x(L),a(L),L=G;a(C)},z=(L,C,G,de,Se,Le,N,T,j)=>{C.type==="svg"?N="svg":C.type==="math"&&(N="mathml"),L==null?ce(C,G,de,Se,Le,N,T,j):ie(L,C,Se,Le,N,T,j)},ce=(L,C,G,de,Se,Le,N,T)=>{let j,ne;const{props:Pe,shapeFlag:De,transition:se,dirs:Te}=L;if(j=L.el=s(L.type,Le,Pe&&Pe.is,Pe),De&8?f(j,L.children):De&16&&le(L.children,j,null,de,Se,hu(L,Le),N,T),Te&&Ja(L,null,de,"created"),P(j,L,L.scopeId,N,de),Pe){for(const et in Pe)et!=="value"&&!ri(et)&&r(j,et,null,Pe[et],Le,de);"value"in Pe&&r(j,"value",null,Pe.value,Le),(ne=Pe.onVnodeBeforeMount)&&No(ne,de,L)}Te&&Ja(L,null,de,"beforeMount");const qe=p1(Se,se);qe&&se.beforeEnter(j),o(j,C,G),((ne=Pe&&Pe.onVnodeMounted)||qe||Te)&&Hn(()=>{ne&&No(ne,de,L),qe&&se.enter(j),Te&&Ja(L,null,de,"mounted")},Se)},P=(L,C,G,de,Se)=>{if(G&&b(L,G),de)for(let Le=0;Le<de.length;Le++)b(L,de[Le]);if(Se){let Le=Se.subTree;if(C===Le||kp(Le.type)&&(Le.ssContent===C||Le.ssFallback===C)){const N=Se.vnode;P(L,N,N.scopeId,N.slotScopeIds,Se.parent)}}},le=(L,C,G,de,Se,Le,N,T,j=0)=>{for(let ne=j;ne<L.length;ne++){const Pe=L[ne]=T?Ca(L[ne]):Po(L[ne]);$(null,Pe,C,G,de,Se,Le,N,T)}},ie=(L,C,G,de,Se,Le,N)=>{const T=C.el=L.el;let{patchFlag:j,dynamicChildren:ne,dirs:Pe}=C;j|=L.patchFlag&16;const De=L.props||Qt,se=C.props||Qt;let Te;if(G&&Za(G,!1),(Te=se.onVnodeBeforeUpdate)&&No(Te,G,C,L),Pe&&Ja(C,L,G,"beforeUpdate"),G&&Za(G,!0),(De.innerHTML&&se.innerHTML==null||De.textContent&&se.textContent==null)&&f(T,""),ne?Oe(L.dynamicChildren,ne,T,G,de,hu(C,Se),Le):N||X(L,C,T,null,G,de,hu(C,Se),Le,!1),j>0){if(j&16)Ae(T,De,se,G,Se);else if(j&2&&De.class!==se.class&&r(T,"class",null,se.class,Se),j&4&&r(T,"style",De.style,se.style,Se),j&8){const qe=C.dynamicProps;for(let et=0;et<qe.length;et++){const ot=qe[et],ft=De[ot],bt=se[ot];(bt!==ft||ot==="value")&&r(T,ot,ft,bt,Se,G)}}j&1&&L.children!==C.children&&f(T,C.children)}else!N&&ne==null&&Ae(T,De,se,G,Se);((Te=se.onVnodeUpdated)||Pe)&&Hn(()=>{Te&&No(Te,G,C,L),Pe&&Ja(C,L,G,"updated")},de)},Oe=(L,C,G,de,Se,Le,N)=>{for(let T=0;T<C.length;T++){const j=L[T],ne=C[T],Pe=j.el&&(j.type===Ke||!er(j,ne)||j.shapeFlag&70)?g(j.el):G;$(j,ne,Pe,null,de,Se,Le,N,!0)}},Ae=(L,C,G,de,Se)=>{if(C!==G){if(C!==Qt)for(const Le in C)!ri(Le)&&!(Le in G)&&r(L,Le,C[Le],null,Se,de);for(const Le in G){if(ri(Le))continue;const N=G[Le],T=C[Le];N!==T&&Le!=="value"&&r(L,Le,T,N,Se,de)}"value"in G&&r(L,"value",C.value,G.value,Se)}},fe=(L,C,G,de,Se,Le,N,T,j)=>{const ne=C.el=L?L.el:u(""),Pe=C.anchor=L?L.anchor:u("");let{patchFlag:De,dynamicChildren:se,slotScopeIds:Te}=C;Te&&(T=T?T.concat(Te):Te),L==null?(o(ne,G,de),o(Pe,G,de),le(C.children||[],G,Pe,Se,Le,N,T,j)):De>0&&De&64&&se&&L.dynamicChildren?(Oe(L.dynamicChildren,se,G,Se,Le,N,T),(C.key!=null||Se&&C===Se.subTree)&&vu(L,C,!0)):X(L,C,G,Pe,Se,Le,N,T,j)},_e=(L,C,G,de,Se,Le,N,T,j)=>{C.slotScopeIds=T,L==null?C.shapeFlag&512?Se.ctx.activate(C,G,de,N,j):ae(C,G,de,Se,Le,N,j):W(L,C,j)},ae=(L,C,G,de,Se,Le,N)=>{const T=L.component=A1(L,de,Se);if(Es(L)&&(T.ctx.renderer=J),M1(T,!1,N),T.asyncDep){if(Se&&Se.registerDep(T,re,N),!L.el){const j=T.subTree=it(Gn);I(null,j,C,G)}}else re(T,L,C,G,Se,Le,N)},W=(L,C,G)=>{const de=C.component=L.component;if(w1(L,C,G))if(de.asyncDep&&!de.asyncResolved){Q(de,C,G);return}else de.next=C,de.update();else C.el=L.el,de.vnode=C},re=(L,C,G,de,Se,Le,N)=>{const T=()=>{if(L.isMounted){let{next:De,bu:se,u:Te,parent:qe,vnode:et}=L;{const Vt=_p(L);if(Vt){De&&(De.el=et.el,Q(L,De,N)),Vt.asyncDep.then(()=>{L.isUnmounted||T()});return}}let ot=De,ft;Za(L,!1),De?(De.el=et.el,Q(L,De,N)):De=et,se&&ls(se),(ft=De.props&&De.props.onVnodeBeforeUpdate)&&No(ft,qe,De,et),Za(L,!0);const bt=Sp(L),Mt=L.subTree;L.subTree=bt,$(Mt,bt,g(Mt.el),K(Mt),L,Se,Le),De.el=bt.el,ot===null&&x1(L,bt.el),Te&&Hn(Te,Se),(ft=De.props&&De.props.onVnodeUpdated)&&Hn(()=>No(ft,qe,De,et),Se)}else{let De;const{el:se,props:Te}=C,{bm:qe,m:et,parent:ot,root:ft,type:bt}=L,Mt=Cr(C);Za(L,!1),qe&&ls(qe),!Mt&&(De=Te&&Te.onVnodeBeforeMount)&&No(De,ot,C),Za(L,!0);{ft.ce&&ft.ce._injectChildStyle(bt);const Vt=L.subTree=Sp(L);$(null,Vt,G,de,L,Se,Le),C.el=Vt.el}if(et&&Hn(et,Se),!Mt&&(De=Te&&Te.onVnodeMounted)){const Vt=C;Hn(()=>No(De,ot,Vt),Se)}(C.shapeFlag&256||ot&&Cr(ot.vnode)&&ot.vnode.shapeFlag&256)&&L.a&&Hn(L.a,Se),L.isMounted=!0,C=G=de=null}};L.scope.on();const j=L.effect=new sd(T);L.scope.off();const ne=L.update=j.run.bind(j),Pe=L.job=j.runIfDirty.bind(j);Pe.i=L,Pe.id=L.uid,j.scheduler=()=>ru(Pe),Za(L,!0),ne()},Q=(L,C,G)=>{C.component=L;const de=L.vnode.props;L.vnode=C,L.next=null,r1(L,C.props,de,G),u1(L,C.children,G),Ko(),Md(L),Jo()},X=(L,C,G,de,Se,Le,N,T,j=!1)=>{const ne=L&&L.children,Pe=L?L.shapeFlag:0,De=C.children,{patchFlag:se,shapeFlag:Te}=C;if(se>0){if(se&128){pe(ne,De,G,de,Se,Le,N,T,j);return}else if(se&256){ye(ne,De,G,de,Se,Le,N,T,j);return}}Te&8?(Pe&16&&te(ne,Se,Le),De!==ne&&f(G,De)):Pe&16?Te&16?pe(ne,De,G,de,Se,Le,N,T,j):te(ne,Se,Le,!0):(Pe&8&&f(G,""),Te&16&&le(De,G,de,Se,Le,N,T,j))},ye=(L,C,G,de,Se,Le,N,T,j)=>{L=L||yr,C=C||yr;const ne=L.length,Pe=C.length,De=Math.min(ne,Pe);let se;for(se=0;se<De;se++){const Te=C[se]=j?Ca(C[se]):Po(C[se]);$(L[se],Te,G,null,Se,Le,N,T,j)}ne>Pe?te(L,Se,Le,!0,!1,De):le(C,G,de,Se,Le,N,T,j,De)},pe=(L,C,G,de,Se,Le,N,T,j)=>{let ne=0;const Pe=C.length;let De=L.length-1,se=Pe-1;for(;ne<=De&&ne<=se;){const Te=L[ne],qe=C[ne]=j?Ca(C[ne]):Po(C[ne]);if(er(Te,qe))$(Te,qe,G,null,Se,Le,N,T,j);else break;ne++}for(;ne<=De&&ne<=se;){const Te=L[De],qe=C[se]=j?Ca(C[se]):Po(C[se]);if(er(Te,qe))$(Te,qe,G,null,Se,Le,N,T,j);else break;De--,se--}if(ne>De){if(ne<=se){const Te=se+1,qe=Te<Pe?C[Te].el:de;for(;ne<=se;)$(null,C[ne]=j?Ca(C[ne]):Po(C[ne]),G,qe,Se,Le,N,T,j),ne++}}else if(ne>se)for(;ne<=De;)oe(L[ne],Se,Le,!0),ne++;else{const Te=ne,qe=ne,et=new Map;for(ne=qe;ne<=se;ne++){const an=C[ne]=j?Ca(C[ne]):Po(C[ne]);an.key!=null&&et.set(an.key,ne)}let ot,ft=0;const bt=se-qe+1;let Mt=!1,Vt=0;const An=new Array(bt);for(ne=0;ne<bt;ne++)An[ne]=0;for(ne=Te;ne<=De;ne++){const an=L[ne];if(ft>=bt){oe(an,Se,Le,!0);continue}let hn;if(an.key!=null)hn=et.get(an.key);else for(ot=qe;ot<=se;ot++)if(An[ot-qe]===0&&er(an,C[ot])){hn=ot;break}hn===void 0?oe(an,Se,Le,!0):(An[hn-qe]=ne+1,hn>=Vt?Vt=hn:Mt=!0,$(an,C[hn],G,null,Se,Le,N,T,j),ft++)}const ao=Mt?f1(An):yr;for(ot=ao.length-1,ne=bt-1;ne>=0;ne--){const an=qe+ne,hn=C[an],Jn=an+1<Pe?C[an+1].el:de;An[ne]===0?$(null,hn,G,Jn,Se,Le,N,T,j):Mt&&(ot<0||ne!==ao[ot]?Z(hn,G,Jn,2):ot--)}}},Z=(L,C,G,de,Se=null)=>{const{el:Le,type:N,transition:T,children:j,shapeFlag:ne}=L;if(ne&6){Z(L.component.subTree,C,G,de);return}if(ne&128){L.suspense.move(C,G,de);return}if(ne&64){N.move(L,C,G,J);return}if(N===Ke){o(Le,C,G);for(let De=0;De<j.length;De++)Z(j[De],C,G,de);o(L.anchor,C,G);return}if(N===_u){me(L,C,G);return}if(de!==2&&ne&1&&T)if(de===0)T.beforeEnter(Le),o(Le,C,G),Hn(()=>T.enter(Le),Se);else{const{leave:De,delayLeave:se,afterLeave:Te}=T,qe=()=>o(Le,C,G),et=()=>{De(Le,()=>{qe(),Te&&Te()})};se?se(Le,qe,et):et()}else o(Le,C,G)},oe=(L,C,G,de=!1,Se=!1)=>{const{type:Le,props:N,ref:T,children:j,dynamicChildren:ne,shapeFlag:Pe,patchFlag:De,dirs:se,cacheIndex:Te}=L;if(De===-2&&(Se=!1),T!=null&&Cs(T,null,G,L,!0),Te!=null&&(C.renderCache[Te]=void 0),Pe&256){C.ctx.deactivate(L);return}const qe=Pe&1&&se,et=!Cr(L);let ot;if(et&&(ot=N&&N.onVnodeBeforeUnmount)&&No(ot,C,L),Pe&6)he(L.component,G,de);else{if(Pe&128){L.suspense.unmount(G,de);return}qe&&Ja(L,null,C,"beforeUnmount"),Pe&64?L.type.remove(L,C,G,J,de):ne&&!ne.hasOnce&&(Le!==Ke||De>0&&De&64)?te(ne,C,G,!1,!0):(Le===Ke&&De&384||!Se&&Pe&16)&&te(j,C,G),de&&be(L)}(et&&(ot=N&&N.onVnodeUnmounted)||qe)&&Hn(()=>{ot&&No(ot,C,L),qe&&Ja(L,null,C,"unmounted")},G)},be=L=>{const{type:C,el:G,anchor:de,transition:Se}=L;if(C===Ke){ve(G,de);return}if(C===_u){M(L);return}const Le=()=>{a(G),Se&&!Se.persisted&&Se.afterLeave&&Se.afterLeave()};if(L.shapeFlag&1&&Se&&!Se.persisted){const{leave:N,delayLeave:T}=Se,j=()=>N(G,Le);T?T(L.el,Le,j):j()}else Le()},ve=(L,C)=>{let G;for(;L!==C;)G=x(L),a(L),L=G;a(C)},he=(L,C,G)=>{const{bum:de,scope:Se,job:Le,subTree:N,um:T,m:j,a:ne}=L;yp(j),yp(ne),de&&ls(de),Se.stop(),Le&&(Le.flags|=8,oe(N,L,C,G)),T&&Hn(T,C),Hn(()=>{L.isUnmounted=!0},C),C&&C.pendingBranch&&!C.isUnmounted&&L.asyncDep&&!L.asyncResolved&&L.suspenseId===C.pendingId&&(C.deps--,C.deps===0&&C.resolve())},te=(L,C,G,de=!1,Se=!1,Le=0)=>{for(let N=Le;N<L.length;N++)oe(L[N],C,G,de,Se)},K=L=>{if(L.shapeFlag&6)return K(L.component.subTree);if(L.shapeFlag&128)return L.suspense.next();const C=x(L.anchor||L.el),G=C&&C[Rd];return G?x(G):C};let ee=!1;const F=(L,C,G)=>{L==null?C._vnode&&oe(C._vnode,null,null,!0):$(C._vnode||null,L,C,null,null,null,G),C._vnode=L,ee||(ee=!0,Md(),Id(),ee=!1)},J={p:$,um:oe,m:Z,r:be,mt:ae,mc:le,pc:X,pbc:Oe,n:K,o:e};return{render:F,hydrate:void 0,createApp:t1(F)}}function hu({type:e,props:t},n){return n==="svg"&&e==="foreignObject"||n==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function Za({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function p1(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function vu(e,t,n=!1){const o=e.children,a=t.children;if(st(o)&&st(a))for(let r=0;r<o.length;r++){const s=o[r];let u=a[r];u.shapeFlag&1&&!u.dynamicChildren&&((u.patchFlag<=0||u.patchFlag===32)&&(u=a[r]=Ca(a[r]),u.el=s.el),!n&&u.patchFlag!==-2&&vu(s,u)),u.type===_i&&(u.el=s.el)}}function f1(e){const t=e.slice(),n=[0];let o,a,r,s,u;const p=e.length;for(o=0;o<p;o++){const m=e[o];if(m!==0){if(a=n[n.length-1],e[a]<m){t[o]=a,n.push(o);continue}for(r=0,s=n.length-1;r<s;)u=r+s>>1,e[n[u]]<m?r=u+1:s=u;m<e[n[r]]&&(r>0&&(t[o]=n[r-1]),n[r]=o)}}for(r=n.length,s=n[r-1];r-- >0;)n[r]=s,s=t[s];return n}function _p(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:_p(t)}function yp(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}const g1=Symbol.for("v-scx"),m1=()=>Er(g1);function At(e,t,n){return bp(e,t,n)}function bp(e,t,n=Qt){const{immediate:o,deep:a,flush:r,once:s}=n,u=xn({},n),p=t&&o||!t&&r!=="post";let m;if(Si){if(r==="sync"){const b=m1();m=b.__watcherHandles||(b.__watcherHandles=[])}else if(!p){const b=()=>{};return b.stop=Oo,b.resume=Oo,b.pause=Oo,b}}const f=$n;u.call=(b,k,$)=>Co(b,f,k,$);let g=!1;r==="post"?u.scheduler=b=>{Hn(b,f&&f.suspense)}:r!=="sync"&&(g=!0,u.scheduler=(b,k)=>{k?b():ru(b)}),u.augmentJob=b=>{t&&(b.flags|=4),g&&(b.flags|=2,f&&(b.id=f.uid,b.i=f))};const x=kv(e,t,u);return Si&&(m?m.push(x):p&&x()),x}function h1(e,t,n){const o=this.proxy,a=fn(e)?e.includes(".")?wp(o,e):()=>o[e]:e.bind(o,o);let r;mt(t)?r=t:(r=t.handler,n=t);const s=xi(this),u=bp(a,r.bind(o),n);return s(),u}function wp(e,t){const n=t.split(".");return()=>{let o=e;for(let a=0;a<n.length&&o;a++)o=o[n[a]];return o}}const v1=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${ho(t)}Modifiers`]||e[`${ya(t)}Modifiers`];function _1(e,t,...n){if(e.isUnmounted)return;const o=e.vnode.props||Qt;let a=n;const r=t.startsWith("update:"),s=r&&v1(o,t.slice(7));s&&(s.trim&&(a=n.map(f=>fn(f)?f.trim():f)),s.number&&(a=n.map(us)));let u,p=o[u=zl(t)]||o[u=zl(ho(t))];!p&&r&&(p=o[u=zl(ya(t))]),p&&Co(p,e,6,a);const m=o[u+"Once"];if(m){if(!e.emitted)e.emitted={};else if(e.emitted[u])return;e.emitted[u]=!0,Co(m,e,6,a)}}function xp(e,t,n=!1){const o=t.emitsCache,a=o.get(e);if(a!==void 0)return a;const r=e.emits;let s={},u=!1;if(!mt(e)){const p=m=>{const f=xp(m,t,!0);f&&(u=!0,xn(s,f))};!n&&t.mixins.length&&t.mixins.forEach(p),e.extends&&p(e.extends),e.mixins&&e.mixins.forEach(p)}return!r&&!u?(Zt(e)&&o.set(e,null),null):(st(r)?r.forEach(p=>s[p]=null):xn(s,r),Zt(e)&&o.set(e,s),s)}function As(e,t){return!e||!rs(t)?!1:(t=t.slice(2).replace(/Once$/,""),jt(e,t[0].toLowerCase()+t.slice(1))||jt(e,ya(t))||jt(e,t))}function aD(){}function Sp(e){const{type:t,vnode:n,proxy:o,withProxy:a,propsOptions:[r],slots:s,attrs:u,emit:p,render:m,renderCache:f,props:g,data:x,setupState:b,ctx:k,inheritAttrs:$}=e,O=xs(e);let I,V;try{if(n.shapeFlag&4){const M=a||o,z=M;I=Po(m.call(z,M,f,g,b,x,k)),V=u}else{const M=t;I=Po(M.length>1?M(g,{attrs:u,slots:s,emit:p}):M(g,null)),V=t.props?u:y1(u)}}catch(M){yi.length=0,bs(M,e,1),I=it(Gn)}let me=I;if(V&&$!==!1){const M=Object.keys(V),{shapeFlag:z}=me;M.length&&z&7&&(r&&M.some(Fl)&&(V=b1(V,r)),me=ka(me,V,!1,!0))}return n.dirs&&(me=ka(me,null,!1,!0),me.dirs=me.dirs?me.dirs.concat(n.dirs):n.dirs),n.transition&&Xa(me,n.transition),I=me,xs(O),I}const y1=e=>{let t;for(const n in e)(n==="class"||n==="style"||rs(n))&&((t||(t={}))[n]=e[n]);return t},b1=(e,t)=>{const n={};for(const o in e)(!Fl(o)||!(o.slice(9)in t))&&(n[o]=e[o]);return n};function w1(e,t,n){const{props:o,children:a,component:r}=e,{props:s,children:u,patchFlag:p}=t,m=r.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&p>=0){if(p&1024)return!0;if(p&16)return o?Tp(o,s,m):!!s;if(p&8){const f=t.dynamicProps;for(let g=0;g<f.length;g++){const x=f[g];if(s[x]!==o[x]&&!As(m,x))return!0}}}else return(a||u)&&(!u||!u.$stable)?!0:o===s?!1:o?s?Tp(o,s,m):!0:!!s;return!1}function Tp(e,t,n){const o=Object.keys(t);if(o.length!==Object.keys(e).length)return!0;for(let a=0;a<o.length;a++){const r=o[a];if(t[r]!==e[r]&&!As(n,r))return!0}return!1}function x1({vnode:e,parent:t},n){for(;t;){const o=t.subTree;if(o.suspense&&o.suspense.activeBranch===e&&(o.el=e.el),o===e)(e=t.vnode).el=n,t=t.parent;else break}}const kp=e=>e.__isSuspense;function S1(e,t){t&&t.pendingBranch?st(e)?t.effects.push(...e):t.effects.push(e):Iv(e)}const Ke=Symbol.for("v-fgt"),_i=Symbol.for("v-txt"),Gn=Symbol.for("v-cmt"),_u=Symbol.for("v-stc"),yi=[];let lo=null;function E(e=!1){yi.push(lo=e?null:[])}function T1(){yi.pop(),lo=yi[yi.length-1]||null}let bi=1;function Cp(e,t=!1){bi+=e,e<0&&lo&&t&&(lo.hasOnce=!0)}function Ep(e){return e.dynamicChildren=bi>0?lo||yr:null,T1(),bi>0&&lo&&lo.push(e),e}function D(e,t,n,o,a,r){return Ep(i(e,t,n,o,a,r,!0))}function Jt(e,t,n,o,a){return Ep(it(e,t,n,o,a,!0))}function wi(e){return e?e.__v_isVNode===!0:!1}function er(e,t){return e.type===t.type&&e.key===t.key}const $p=({key:e})=>e??null,Ms=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?fn(e)||gn(e)||mt(e)?{i:Sn,r:e,k:t,f:!!n}:e:null);function i(e,t=null,n=null,o=0,a=null,r=e===Ke?0:1,s=!1,u=!1){const p={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&$p(t),ref:t&&Ms(t),scopeId:Od,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:r,patchFlag:o,dynamicProps:a,dynamicChildren:null,appContext:null,ctx:Sn};return u?(yu(p,n),r&128&&e.normalize(p)):n&&(p.shapeFlag|=fn(n)?8:16),bi>0&&!s&&lo&&(p.patchFlag>0||r&6)&&p.patchFlag!==32&&lo.push(p),p}const it=k1;function k1(e,t=null,n=null,o=0,a=null,r=!1){if((!e||e===Gv)&&(e=Gn),wi(e)){const u=ka(e,t,!0);return n&&yu(u,n),bi>0&&!r&&lo&&(u.shapeFlag&6?lo[lo.indexOf(e)]=u:lo.push(u)),u.patchFlag=-2,u}if(N1(e)&&(e=e.__vccOpts),t){t=C1(t);let{class:u,style:p}=t;u&&!fn(u)&&(t.class=We(u)),Zt(p)&&(tu(p)&&!st(p)&&(p=xn({},p)),t.style=Bt(p))}const s=fn(e)?1:kp(e)?128:Pd(e)?64:Zt(e)?4:mt(e)?2:0;return i(e,t,n,o,a,s,r,!0)}function C1(e){return e?tu(e)||cp(e)?xn({},e):e:null}function ka(e,t,n=!1,o=!1){const{props:a,ref:r,patchFlag:s,children:u,transition:p}=e,m=t?E1(a||{},t):a,f={__v_isVNode:!0,__v_skip:!0,type:e.type,props:m,key:m&&$p(m),ref:t&&t.ref?n&&r?st(r)?r.concat(Ms(t)):[r,Ms(t)]:Ms(t):r,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:u,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==Ke?s===-1?16:s|16:s,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:p,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&ka(e.ssContent),ssFallback:e.ssFallback&&ka(e.ssFallback),el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return p&&o&&Xa(f,p.clone(f)),f}function ut(e=" ",t=0){return it(_i,null,e,t)}function Ce(e="",t=!1){return t?(E(),Jt(Gn,null,e)):it(Gn,null,e)}function Po(e){return e==null||typeof e=="boolean"?it(Gn):st(e)?it(Ke,null,e.slice()):wi(e)?Ca(e):it(_i,null,String(e))}function Ca(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:ka(e)}function yu(e,t){let n=0;const{shapeFlag:o}=e;if(t==null)t=null;else if(st(t))n=16;else if(typeof t=="object")if(o&65){const a=t.default;a&&(a._c&&(a._d=!1),yu(e,a()),a._c&&(a._d=!0));return}else{n=32;const a=t._;!a&&!cp(t)?t._ctx=Sn:a===3&&Sn&&(Sn.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else mt(t)?(t={default:t,_ctx:Sn},n=32):(t=String(t),o&64?(n=16,t=[ut(t)]):n=8);e.children=t,e.shapeFlag|=n}function E1(...e){const t={};for(let n=0;n<e.length;n++){const o=e[n];for(const a in o)if(a==="class")t.class!==o.class&&(t.class=We([t.class,o.class]));else if(a==="style")t.style=Bt([t.style,o.style]);else if(rs(a)){const r=t[a],s=o[a];s&&r!==s&&!(st(r)&&r.includes(s))&&(t[a]=r?[].concat(r,s):s)}else a!==""&&(t[a]=o[a])}return t}function No(e,t,n,o=null){Co(e,t,7,[n,o])}const $1=sp();let L1=0;function A1(e,t,n){const o=e.type,a=(t?t.appContext:e.appContext)||$1,r={uid:L1++,vnode:e,type:o,parent:t,appContext:a,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new rd(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(a.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:pp(o,a),emitsOptions:xp(o,a),emit:null,emitted:null,propsDefaults:Qt,inheritAttrs:o.inheritAttrs,ctx:Qt,data:Qt,props:Qt,attrs:Qt,slots:Qt,refs:Qt,setupState:Qt,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return r.ctx={_:r},r.root=t?t.root:r,r.emit=_1.bind(null,r),e.ce&&e.ce(r),r}let $n=null;const tr=()=>$n||Sn;let Is,bu;{const e=cs(),t=(n,o)=>{let a;return(a=e[n])||(a=e[n]=[]),a.push(o),r=>{a.length>1?a.forEach(s=>s(r)):a[0](r)}};Is=t("__VUE_INSTANCE_SETTERS__",n=>$n=n),bu=t("__VUE_SSR_SETTERS__",n=>Si=n)}const xi=e=>{const t=$n;return Is(e),e.scope.on(),()=>{e.scope.off(),Is(t)}},Lp=()=>{$n&&$n.scope.off(),Is(null)};function Ap(e){return e.vnode.shapeFlag&4}let Si=!1;function M1(e,t=!1,n=!1){t&&bu(t);const{props:o,children:a}=e.vnode,r=Ap(e);a1(e,o,r,t),l1(e,a,n);const s=r?I1(e,t):void 0;return t&&bu(!1),s}function I1(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,Yv);const{setup:o}=n;if(o){Ko();const a=e.setupContext=o.length>1?O1(e):null,r=xi(e),s=Sr(o,e,0,[e.props,a]),u=Xc(s);if(Jo(),r(),(u||e.sp)&&!Cr(e)&&Kd(e),u){if(s.then(Lp,Lp),t)return s.then(p=>{Mp(e,p)}).catch(p=>{bs(p,e,0)});e.asyncDep=s}else Mp(e,s)}else Ip(e)}function Mp(e,t,n){mt(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:Zt(t)&&(e.setupState=Ed(t)),Ip(e)}function Ip(e,t,n){const o=e.type;e.render||(e.render=o.render||Oo);{const a=xi(e);Ko();try{Kv(e)}finally{Jo(),a()}}}const D1={get(e,t){return Dn(e,"get",""),e[t]}};function O1(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,D1),slots:e.slots,emit:e.emit,expose:t}}function Ds(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(Ed(nu(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in hi)return hi[n](e)},has(t,n){return n in t||n in hi}})):e.proxy}const R1=/(?:^|[-_])(\w)/g,P1=e=>e.replace(R1,t=>t.toUpperCase()).replace(/[-_]/g,"");function Dp(e,t=!0){return mt(e)?e.displayName||e.name:e.name||t&&e.__name}function Op(e,t,n=!1){let o=Dp(t);if(!o&&t.__file){const a=t.__file.match(/([^/\\]+)\.\w+$/);a&&(o=a[1])}if(!o&&e&&e.parent){const a=r=>{for(const s in r)if(r[s]===t)return s};o=a(e.components||e.parent.type.components)||a(e.appContext.components)}return o?P1(o):n?"App":"Anonymous"}function N1(e){return mt(e)&&"__vccOpts"in e}const Ht=(e,t)=>Sv(e,t,Si);function Nt(e,t,n){const o=arguments.length;return o===2?Zt(t)&&!st(t)?wi(t)?it(e,null,[t]):it(e,t):it(e,null,t):(o>3?n=Array.prototype.slice.call(arguments,2):o===3&&wi(n)&&(n=[n]),it(e,t,n))}const F1="3.5.13";/**
|
||
* @vue/runtime-dom v3.5.13
|
||
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
||
* @license MIT
|
||
**/let wu;const Rp=typeof window<"u"&&window.trustedTypes;if(Rp)try{wu=Rp.createPolicy("vue",{createHTML:e=>e})}catch{}const Pp=wu?e=>wu.createHTML(e):e=>e,B1="http://www.w3.org/2000/svg",U1="http://www.w3.org/1998/Math/MathML",ta=typeof document<"u"?document:null,Np=ta&&ta.createElement("template"),z1={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,o)=>{const a=t==="svg"?ta.createElementNS(B1,e):t==="mathml"?ta.createElementNS(U1,e):n?ta.createElement(e,{is:n}):ta.createElement(e);return e==="select"&&o&&o.multiple!=null&&a.setAttribute("multiple",o.multiple),a},createText:e=>ta.createTextNode(e),createComment:e=>ta.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>ta.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,o,a,r){const s=n?n.previousSibling:t.lastChild;if(a&&(a===r||a.nextSibling))for(;t.insertBefore(a.cloneNode(!0),n),!(a===r||!(a=a.nextSibling)););else{Np.innerHTML=Pp(o==="svg"?`<svg>${e}</svg>`:o==="mathml"?`<math>${e}</math>`:e);const u=Np.content;if(o==="svg"||o==="mathml"){const p=u.firstChild;for(;p.firstChild;)u.appendChild(p.firstChild);u.removeChild(p)}t.insertBefore(u,n)}return[s?s.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},Ea="transition",Ti="animation",$r=Symbol("_vtc"),Fp={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},Bp=xn({},jd,Fp),Os=(e=>(e.displayName="Transition",e.props=Bp,e))((e,{slots:t})=>Nt(Rv,zp(e),t)),nr=(e,t=[])=>{st(e)?e.forEach(n=>n(...t)):e&&e(...t)},Up=e=>e?st(e)?e.some(t=>t.length>1):e.length>1:!1;function zp(e){const t={};for(const fe in e)fe in Fp||(t[fe]=e[fe]);if(e.css===!1)return t;const{name:n="v",type:o,duration:a,enterFromClass:r=`${n}-enter-from`,enterActiveClass:s=`${n}-enter-active`,enterToClass:u=`${n}-enter-to`,appearFromClass:p=r,appearActiveClass:m=s,appearToClass:f=u,leaveFromClass:g=`${n}-leave-from`,leaveActiveClass:x=`${n}-leave-active`,leaveToClass:b=`${n}-leave-to`}=e,k=V1(a),$=k&&k[0],O=k&&k[1],{onBeforeEnter:I,onEnter:V,onEnterCancelled:me,onLeave:M,onLeaveCancelled:z,onBeforeAppear:ce=I,onAppear:P=V,onAppearCancelled:le=me}=t,ie=(fe,_e,ae,W)=>{fe._enterCancelled=W,$a(fe,_e?f:u),$a(fe,_e?m:s),ae&&ae()},Oe=(fe,_e)=>{fe._isLeaving=!1,$a(fe,g),$a(fe,b),$a(fe,x),_e&&_e()},Ae=fe=>(_e,ae)=>{const W=fe?P:V,re=()=>ie(_e,fe,ae);nr(W,[_e,re]),Vp(()=>{$a(_e,fe?p:r),Fo(_e,fe?f:u),Up(W)||Wp(_e,o,$,re)})};return xn(t,{onBeforeEnter(fe){nr(I,[fe]),Fo(fe,r),Fo(fe,s)},onBeforeAppear(fe){nr(ce,[fe]),Fo(fe,p),Fo(fe,m)},onEnter:Ae(!1),onAppear:Ae(!0),onLeave(fe,_e){fe._isLeaving=!0;const ae=()=>Oe(fe,_e);Fo(fe,g),fe._enterCancelled?(Fo(fe,x),Su()):(Su(),Fo(fe,x)),Vp(()=>{fe._isLeaving&&($a(fe,g),Fo(fe,b),Up(M)||Wp(fe,o,O,ae))}),nr(M,[fe,ae])},onEnterCancelled(fe){ie(fe,!1,void 0,!0),nr(me,[fe])},onAppearCancelled(fe){ie(fe,!0,void 0,!0),nr(le,[fe])},onLeaveCancelled(fe){Oe(fe),nr(z,[fe])}})}function V1(e){if(e==null)return null;if(Zt(e))return[xu(e.enter),xu(e.leave)];{const t=xu(e);return[t,t]}}function xu(e){return Vh(e)}function Fo(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[$r]||(e[$r]=new Set)).add(t)}function $a(e,t){t.split(/\s+/).forEach(o=>o&&e.classList.remove(o));const n=e[$r];n&&(n.delete(t),n.size||(e[$r]=void 0))}function Vp(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let W1=0;function Wp(e,t,n,o){const a=e._endId=++W1,r=()=>{a===e._endId&&o()};if(n!=null)return setTimeout(r,n);const{type:s,timeout:u,propCount:p}=jp(e,t);if(!s)return o();const m=s+"end";let f=0;const g=()=>{e.removeEventListener(m,x),r()},x=b=>{b.target===e&&++f>=p&&g()};setTimeout(()=>{f<p&&g()},u+1),e.addEventListener(m,x)}function jp(e,t){const n=window.getComputedStyle(e),o=k=>(n[k]||"").split(", "),a=o(`${Ea}Delay`),r=o(`${Ea}Duration`),s=Hp(a,r),u=o(`${Ti}Delay`),p=o(`${Ti}Duration`),m=Hp(u,p);let f=null,g=0,x=0;t===Ea?s>0&&(f=Ea,g=s,x=r.length):t===Ti?m>0&&(f=Ti,g=m,x=p.length):(g=Math.max(s,m),f=g>0?s>m?Ea:Ti:null,x=f?f===Ea?r.length:p.length:0);const b=f===Ea&&/\b(transform|all)(,|$)/.test(o(`${Ea}Property`).toString());return{type:f,timeout:g,propCount:x,hasTransform:b}}function Hp(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,o)=>Gp(n)+Gp(e[o])))}function Gp(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function Su(){return document.body.offsetHeight}function j1(e,t,n){const o=e[$r];o&&(t=(t?[t,...o]:[...o]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const Rs=Symbol("_vod"),qp=Symbol("_vsh"),ki={beforeMount(e,{value:t},{transition:n}){e[Rs]=e.style.display==="none"?"":e.style.display,n&&t?n.beforeEnter(e):Ci(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:o}){!t!=!n&&(o?t?(o.beforeEnter(e),Ci(e,!0),o.enter(e)):o.leave(e,()=>{Ci(e,!1)}):Ci(e,t))},beforeUnmount(e,{value:t}){Ci(e,t)}};function Ci(e,t){e.style.display=t?e[Rs]:"none",e[qp]=!t}const H1=Symbol(""),G1=/(^|;)\s*display\s*:/;function q1(e,t,n){const o=e.style,a=fn(n);let r=!1;if(n&&!a){if(t)if(fn(t))for(const s of t.split(";")){const u=s.slice(0,s.indexOf(":")).trim();n[u]==null&&Ps(o,u,"")}else for(const s in t)n[s]==null&&Ps(o,s,"");for(const s in n)s==="display"&&(r=!0),Ps(o,s,n[s])}else if(a){if(t!==n){const s=o[H1];s&&(n+=";"+s),o.cssText=n,r=G1.test(n)}}else t&&e.removeAttribute("style");Rs in e&&(e[Rs]=r?o.display:"",e[qp]&&(o.display="none"))}const Yp=/\s*!important$/;function Ps(e,t,n){if(st(n))n.forEach(o=>Ps(e,t,o));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const o=Y1(e,t);Yp.test(n)?e.setProperty(ya(o),n.replace(Yp,""),"important"):e[o]=n}}const Kp=["Webkit","Moz","ms"],Tu={};function Y1(e,t){const n=Tu[t];if(n)return n;let o=ho(t);if(o!=="filter"&&o in e)return Tu[t]=o;o=ss(o);for(let a=0;a<Kp.length;a++){const r=Kp[a]+o;if(r in e)return Tu[t]=r}return t}const Jp="http://www.w3.org/1999/xlink";function Xp(e,t,n,o,a,r=qh(t)){o&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(Jp,t.slice(6,t.length)):e.setAttributeNS(Jp,t,n):n==null||r&&!nd(n)?e.removeAttribute(t):e.setAttribute(t,r?"":To(n)?String(n):n)}function Qp(e,t,n,o,a){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?Pp(n):n);return}const r=e.tagName;if(t==="value"&&r!=="PROGRESS"&&!r.includes("-")){const u=r==="OPTION"?e.getAttribute("value")||"":e.value,p=n==null?e.type==="checkbox"?"on":"":String(n);(u!==p||!("_value"in e))&&(e.value=p),n==null&&e.removeAttribute(t),e._value=n;return}let s=!1;if(n===""||n==null){const u=typeof e[t];u==="boolean"?n=nd(n):n==null&&u==="string"?(n="",s=!0):u==="number"&&(n=0,s=!0)}try{e[t]=n}catch{}s&&e.removeAttribute(a||t)}function na(e,t,n,o){e.addEventListener(t,n,o)}function K1(e,t,n,o){e.removeEventListener(t,n,o)}const Zp=Symbol("_vei");function J1(e,t,n,o,a=null){const r=e[Zp]||(e[Zp]={}),s=r[t];if(o&&s)s.value=o;else{const[u,p]=X1(t);if(o){const m=r[t]=e_(o,a);na(e,u,m,p)}else s&&(K1(e,u,s,p),r[t]=void 0)}}const ef=/(?:Once|Passive|Capture)$/;function X1(e){let t;if(ef.test(e)){t={};let o;for(;o=e.match(ef);)e=e.slice(0,e.length-o[0].length),t[o[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):ya(e.slice(2)),t]}let ku=0;const Q1=Promise.resolve(),Z1=()=>ku||(Q1.then(()=>ku=0),ku=Date.now());function e_(e,t){const n=o=>{if(!o._vts)o._vts=Date.now();else if(o._vts<=n.attached)return;Co(t_(o,n.value),t,5,[o])};return n.value=e,n.attached=Z1(),n}function t_(e,t){if(st(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(o=>a=>!a._stopped&&o&&o(a))}else return t}const tf=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,n_=(e,t,n,o,a,r)=>{const s=a==="svg";t==="class"?j1(e,o,s):t==="style"?q1(e,n,o):rs(t)?Fl(t)||J1(e,t,n,o,r):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):o_(e,t,o,s))?(Qp(e,t,o),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&Xp(e,t,o,s,r,t!=="value")):e._isVueCE&&(/[A-Z]/.test(t)||!fn(o))?Qp(e,ho(t),o,r,t):(t==="true-value"?e._trueValue=o:t==="false-value"&&(e._falseValue=o),Xp(e,t,o,s))};function o_(e,t,n,o){if(o)return!!(t==="innerHTML"||t==="textContent"||t in e&&tf(t)&&mt(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const a=e.tagName;if(a==="IMG"||a==="VIDEO"||a==="CANVAS"||a==="SOURCE")return!1}return tf(t)&&fn(n)?!1:t in e}const nf=new WeakMap,of=new WeakMap,Ns=Symbol("_moveCb"),af=Symbol("_enterCb"),a_=(e=>(delete e.props.mode,e))({name:"TransitionGroup",props:xn({},Bp,{tag:String,moveClass:String}),setup(e,{slots:t}){const n=tr(),o=Wd();let a,r;return Qd(()=>{if(!a.length)return;const s=e.moveClass||`${e.name||"v"}-move`;if(!l_(a[0].el,n.vnode.el,s))return;a.forEach(r_),a.forEach(i_);const u=a.filter(s_);Su(),u.forEach(p=>{const m=p.el,f=m.style;Fo(m,s),f.transform=f.webkitTransform=f.transitionDuration="";const g=m[Ns]=x=>{x&&x.target!==m||(!x||/transform$/.test(x.propertyName))&&(m.removeEventListener("transitionend",g),m[Ns]=null,$a(m,s))};m.addEventListener("transitionend",g)})}),()=>{const s=Lt(e),u=zp(s);let p=s.tag||Ke;if(a=[],r)for(let m=0;m<r.length;m++){const f=r[m];f.el&&f.el instanceof Element&&(a.push(f),Xa(f,gi(f,u,o,n)),nf.set(f,f.el.getBoundingClientRect()))}r=t.default?lu(t.default()):[];for(let m=0;m<r.length;m++){const f=r[m];f.key!=null&&Xa(f,gi(f,u,o,n))}return it(p,null,r)}}});function r_(e){const t=e.el;t[Ns]&&t[Ns](),t[af]&&t[af]()}function i_(e){of.set(e,e.el.getBoundingClientRect())}function s_(e){const t=nf.get(e),n=of.get(e),o=t.left-n.left,a=t.top-n.top;if(o||a){const r=e.el.style;return r.transform=r.webkitTransform=`translate(${o}px,${a}px)`,r.transitionDuration="0s",e}}function l_(e,t,n){const o=e.cloneNode(),a=e[$r];a&&a.forEach(u=>{u.split(/\s+/).forEach(p=>p&&o.classList.remove(p))}),n.split(/\s+/).forEach(u=>u&&o.classList.add(u)),o.style.display="none";const r=t.nodeType===1?t:t.parentNode;r.appendChild(o);const{hasTransform:s}=jp(o);return r.removeChild(o),s}const La=e=>{const t=e.props["onUpdate:modelValue"]||!1;return st(t)?n=>ls(t,n):t};function u_(e){e.target.composing=!0}function rf(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const yo=Symbol("_assign"),ze={created(e,{modifiers:{lazy:t,trim:n,number:o}},a){e[yo]=La(a);const r=o||a.props&&a.props.type==="number";na(e,t?"change":"input",s=>{if(s.target.composing)return;let u=e.value;n&&(u=u.trim()),r&&(u=us(u)),e[yo](u)}),n&&na(e,"change",()=>{e.value=e.value.trim()}),t||(na(e,"compositionstart",u_),na(e,"compositionend",rf),na(e,"change",rf))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:o,trim:a,number:r}},s){if(e[yo]=La(s),e.composing)return;const u=(r||e.type==="number")&&!/^0\d/.test(e.value)?us(e.value):e.value,p=t??"";u!==p&&(document.activeElement===e&&e.type!=="range"&&(o&&t===n||a&&e.value.trim()===p)||(e.value=p))}},nn={deep:!0,created(e,t,n){e[yo]=La(n),na(e,"change",()=>{const o=e._modelValue,a=Lr(e),r=e.checked,s=e[yo];if(st(o)){const u=Vl(o,a),p=u!==-1;if(r&&!p)s(o.concat(a));else if(!r&&p){const m=[...o];m.splice(u,1),s(m)}}else if(wr(o)){const u=new Set(o);r?u.add(a):u.delete(a),s(u)}else s(uf(e,r))})},mounted:sf,beforeUpdate(e,t,n){e[yo]=La(n),sf(e,t,n)}};function sf(e,{value:t,oldValue:n},o){e._modelValue=t;let a;if(st(t))a=Vl(t,o.props.value)>-1;else if(wr(t))a=t.has(o.props.value);else{if(t===n)return;a=Ga(t,uf(e,!0))}e.checked!==a&&(e.checked=a)}const oa={created(e,{value:t},n){e.checked=Ga(t,n.props.value),e[yo]=La(n),na(e,"change",()=>{e[yo](Lr(e))})},beforeUpdate(e,{value:t,oldValue:n},o){e[yo]=La(o),t!==n&&(e.checked=Ga(t,o.props.value))}},Tn={deep:!0,created(e,{value:t,modifiers:{number:n}},o){const a=wr(t);na(e,"change",()=>{const r=Array.prototype.filter.call(e.options,s=>s.selected).map(s=>n?us(Lr(s)):Lr(s));e[yo](e.multiple?a?new Set(r):r:r[0]),e._assigning=!0,vt(()=>{e._assigning=!1})}),e[yo]=La(o)},mounted(e,{value:t}){lf(e,t)},beforeUpdate(e,t,n){e[yo]=La(n)},updated(e,{value:t}){e._assigning||lf(e,t)}};function lf(e,t){const n=e.multiple,o=st(t);if(!(n&&!o&&!wr(t))){for(let a=0,r=e.options.length;a<r;a++){const s=e.options[a],u=Lr(s);if(n)if(o){const p=typeof u;p==="string"||p==="number"?s.selected=t.some(m=>String(m)===String(u)):s.selected=Vl(t,u)>-1}else s.selected=t.has(u);else if(Ga(Lr(s),t)){e.selectedIndex!==a&&(e.selectedIndex=a);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function Lr(e){return"_value"in e?e._value:e.value}function uf(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const cf={created(e,t,n){Fs(e,t,n,null,"created")},mounted(e,t,n){Fs(e,t,n,null,"mounted")},beforeUpdate(e,t,n,o){Fs(e,t,n,o,"beforeUpdate")},updated(e,t,n,o){Fs(e,t,n,o,"updated")}};function c_(e,t){switch(e){case"SELECT":return Tn;case"TEXTAREA":return ze;default:switch(t){case"checkbox":return nn;case"radio":return oa;default:return ze}}}function Fs(e,t,n,o,a){const s=c_(e.tagName,n.props&&n.props.type)[a];s&&s(e,t,n,o)}const d_=["ctrl","shift","alt","meta"],p_={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>d_.some(n=>e[`${n}Key`]&&!t.includes(n))},Tt=(e,t)=>{const n=e._withMods||(e._withMods={}),o=t.join(".");return n[o]||(n[o]=(a,...r)=>{for(let s=0;s<t.length;s++){const u=p_[t[s]];if(u&&u(a,t))return}return e(a,...r)})},f_={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},Rn=(e,t)=>{const n=e._withKeys||(e._withKeys={}),o=t.join(".");return n[o]||(n[o]=a=>{if(!("key"in a))return;const r=ya(a.key);if(t.some(s=>s===r||f_[s]===r))return e(a)})},g_=xn({patchProp:n_},z1);let df;function pf(){return df||(df=c1(g_))}const ff=(...e)=>{pf().render(...e)},m_=(...e)=>{const t=pf().createApp(...e),{mount:n}=t;return t.mount=o=>{const a=v_(o);if(!a)return;const r=t._component;!mt(r)&&!r.render&&!r.template&&(r.template=a.innerHTML),a.nodeType===1&&(a.textContent="");const s=n(a,!1,h_(a));return a instanceof Element&&(a.removeAttribute("v-cloak"),a.setAttribute("data-v-app","")),s},t};function h_(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function v_(e){return fn(e)?document.querySelector(e):e}/*!
|
||
* shared v11.1.2
|
||
* (c) 2025 kazuya kawaguchi
|
||
* Released under the MIT License.
|
||
*/const Bs=typeof window<"u",Aa=(e,t=!1)=>t?Symbol.for(e):Symbol(e),__=(e,t,n)=>y_({l:e,k:t,s:n}),y_=e=>JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),_n=e=>typeof e=="number"&&isFinite(e),b_=e=>Cu(e)==="[object Date]",Ar=e=>Cu(e)==="[object RegExp]",Us=e=>$t(e)&&Object.keys(e).length===0,kn=Object.assign,w_=Object.create,Xt=(e=null)=>w_(e);let gf;const or=()=>gf||(gf=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:Xt());function mf(e){return e.replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}const x_=Object.prototype.hasOwnProperty;function Eo(e,t){return x_.call(e,t)}const yn=Array.isArray,on=e=>typeof e=="function",Ze=e=>typeof e=="string",Ft=e=>typeof e=="boolean",zt=e=>e!==null&&typeof e=="object",S_=e=>zt(e)&&on(e.then)&&on(e.catch),hf=Object.prototype.toString,Cu=e=>hf.call(e),$t=e=>Cu(e)==="[object Object]",T_=e=>e==null?"":yn(e)||$t(e)&&e.toString===hf?JSON.stringify(e,null,2):String(e);function Eu(e,t=""){return e.reduce((n,o,a)=>a===0?n+o:n+t+o,"")}function k_(e,t){typeof console<"u"&&(console.warn("[intlify] "+e),t&&console.warn(t.stack))}const zs=e=>!zt(e)||yn(e);function Vs(e,t){if(zs(e)||zs(t))throw new Error("Invalid value");const n=[{src:e,des:t}];for(;n.length;){const{src:o,des:a}=n.pop();Object.keys(o).forEach(r=>{r!=="__proto__"&&(zt(o[r])&&!zt(a[r])&&(a[r]=Array.isArray(o[r])?[]:Xt()),zs(a[r])||zs(o[r])?a[r]=o[r]:n.push({src:o[r],des:a[r]}))})}}/*!
|
||
* message-compiler v11.1.2
|
||
* (c) 2025 kazuya kawaguchi
|
||
* Released under the MIT License.
|
||
*/function C_(e,t,n){return{line:e,column:t,offset:n}}function $u(e,t,n){return{start:e,end:t}}const Kt={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},E_=17;function Ws(e,t,n={}){const{domain:o,messages:a,args:r}=n,s=e,u=new SyntaxError(String(s));return u.code=e,t&&(u.location=t),u.domain=o,u}function $_(e){throw e}const aa=" ",L_="\r",qn=`
|
||
`,A_="\u2028",M_="\u2029";function I_(e){const t=e;let n=0,o=1,a=1,r=0;const s=P=>t[P]===L_&&t[P+1]===qn,u=P=>t[P]===qn,p=P=>t[P]===M_,m=P=>t[P]===A_,f=P=>s(P)||u(P)||p(P)||m(P),g=()=>n,x=()=>o,b=()=>a,k=()=>r,$=P=>s(P)||p(P)||m(P)?qn:t[P],O=()=>$(n),I=()=>$(n+r);function V(){return r=0,f(n)&&(o++,a=0),s(n)&&n++,n++,a++,t[n]}function me(){return s(n+r)&&r++,r++,t[n+r]}function M(){n=0,o=1,a=1,r=0}function z(P=0){r=P}function ce(){const P=n+r;for(;P!==n;)V();r=0}return{index:g,line:x,column:b,peekOffset:k,charAt:$,currentChar:O,currentPeek:I,next:V,peek:me,reset:M,resetPeek:z,skipToPeek:ce}}const Ma=void 0,D_=".",vf="'",O_="tokenizer";function R_(e,t={}){const n=t.location!==!1,o=I_(e),a=()=>o.index(),r=()=>C_(o.line(),o.column(),o.index()),s=r(),u=a(),p={currentType:13,offset:u,startLoc:s,endLoc:s,lastType:13,lastOffset:u,lastStartLoc:s,lastEndLoc:s,braceNest:0,inLinked:!1,text:""},m=()=>p,{onError:f}=t;function g(N,T,j,...ne){const Pe=m();if(T.column+=j,T.offset+=j,f){const De=n?$u(Pe.startLoc,T):null,se=Ws(N,De,{domain:O_,args:ne});f(se)}}function x(N,T,j){N.endLoc=r(),N.currentType=T;const ne={type:T};return n&&(ne.loc=$u(N.startLoc,N.endLoc)),j!=null&&(ne.value=j),ne}const b=N=>x(N,13);function k(N,T){return N.currentChar()===T?(N.next(),T):(g(Kt.EXPECTED_TOKEN,r(),0,T),"")}function $(N){let T="";for(;N.currentPeek()===aa||N.currentPeek()===qn;)T+=N.currentPeek(),N.peek();return T}function O(N){const T=$(N);return N.skipToPeek(),T}function I(N){if(N===Ma)return!1;const T=N.charCodeAt(0);return T>=97&&T<=122||T>=65&&T<=90||T===95}function V(N){if(N===Ma)return!1;const T=N.charCodeAt(0);return T>=48&&T<=57}function me(N,T){const{currentType:j}=T;if(j!==2)return!1;$(N);const ne=I(N.currentPeek());return N.resetPeek(),ne}function M(N,T){const{currentType:j}=T;if(j!==2)return!1;$(N);const ne=N.currentPeek()==="-"?N.peek():N.currentPeek(),Pe=V(ne);return N.resetPeek(),Pe}function z(N,T){const{currentType:j}=T;if(j!==2)return!1;$(N);const ne=N.currentPeek()===vf;return N.resetPeek(),ne}function ce(N,T){const{currentType:j}=T;if(j!==7)return!1;$(N);const ne=N.currentPeek()===".";return N.resetPeek(),ne}function P(N,T){const{currentType:j}=T;if(j!==8)return!1;$(N);const ne=I(N.currentPeek());return N.resetPeek(),ne}function le(N,T){const{currentType:j}=T;if(!(j===7||j===11))return!1;$(N);const ne=N.currentPeek()===":";return N.resetPeek(),ne}function ie(N,T){const{currentType:j}=T;if(j!==9)return!1;const ne=()=>{const De=N.currentPeek();return De==="{"?I(N.peek()):De==="@"||De==="|"||De===":"||De==="."||De===aa||!De?!1:De===qn?(N.peek(),ne()):Ae(N,!1)},Pe=ne();return N.resetPeek(),Pe}function Oe(N){$(N);const T=N.currentPeek()==="|";return N.resetPeek(),T}function Ae(N,T=!0){const j=(Pe=!1,De="")=>{const se=N.currentPeek();return se==="{"||se==="@"||!se?Pe:se==="|"?!(De===aa||De===qn):se===aa?(N.peek(),j(!0,aa)):se===qn?(N.peek(),j(!0,qn)):!0},ne=j();return T&&N.resetPeek(),ne}function fe(N,T){const j=N.currentChar();return j===Ma?Ma:T(j)?(N.next(),j):null}function _e(N){const T=N.charCodeAt(0);return T>=97&&T<=122||T>=65&&T<=90||T>=48&&T<=57||T===95||T===36}function ae(N){return fe(N,_e)}function W(N){const T=N.charCodeAt(0);return T>=97&&T<=122||T>=65&&T<=90||T>=48&&T<=57||T===95||T===36||T===45}function re(N){return fe(N,W)}function Q(N){const T=N.charCodeAt(0);return T>=48&&T<=57}function X(N){return fe(N,Q)}function ye(N){const T=N.charCodeAt(0);return T>=48&&T<=57||T>=65&&T<=70||T>=97&&T<=102}function pe(N){return fe(N,ye)}function Z(N){let T="",j="";for(;T=X(N);)j+=T;return j}function oe(N){let T="";for(;;){const j=N.currentChar();if(j==="{"||j==="}"||j==="@"||j==="|"||!j)break;if(j===aa||j===qn)if(Ae(N))T+=j,N.next();else{if(Oe(N))break;T+=j,N.next()}else T+=j,N.next()}return T}function be(N){O(N);let T="",j="";for(;T=re(N);)j+=T;return N.currentChar()===Ma&&g(Kt.UNTERMINATED_CLOSING_BRACE,r(),0),j}function ve(N){O(N);let T="";return N.currentChar()==="-"?(N.next(),T+=`-${Z(N)}`):T+=Z(N),N.currentChar()===Ma&&g(Kt.UNTERMINATED_CLOSING_BRACE,r(),0),T}function he(N){return N!==vf&&N!==qn}function te(N){O(N),k(N,"'");let T="",j="";for(;T=fe(N,he);)T==="\\"?j+=K(N):j+=T;const ne=N.currentChar();return ne===qn||ne===Ma?(g(Kt.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,r(),0),ne===qn&&(N.next(),k(N,"'")),j):(k(N,"'"),j)}function K(N){const T=N.currentChar();switch(T){case"\\":case"'":return N.next(),`\\${T}`;case"u":return ee(N,T,4);case"U":return ee(N,T,6);default:return g(Kt.UNKNOWN_ESCAPE_SEQUENCE,r(),0,T),""}}function ee(N,T,j){k(N,T);let ne="";for(let Pe=0;Pe<j;Pe++){const De=pe(N);if(!De){g(Kt.INVALID_UNICODE_ESCAPE_SEQUENCE,r(),0,`\\${T}${ne}${N.currentChar()}`);break}ne+=De}return`\\${T}${ne}`}function F(N){return N!=="{"&&N!=="}"&&N!==aa&&N!==qn}function J(N){O(N);let T="",j="";for(;T=fe(N,F);)j+=T;return j}function Y(N){let T="",j="";for(;T=ae(N);)j+=T;return j}function L(N){const T=j=>{const ne=N.currentChar();return ne==="{"||ne==="@"||ne==="|"||ne==="("||ne===")"||!ne||ne===aa?j:(j+=ne,N.next(),T(j))};return T("")}function C(N){O(N);const T=k(N,"|");return O(N),T}function G(N,T){let j=null;switch(N.currentChar()){case"{":return T.braceNest>=1&&g(Kt.NOT_ALLOW_NEST_PLACEHOLDER,r(),0),N.next(),j=x(T,2,"{"),O(N),T.braceNest++,j;case"}":return T.braceNest>0&&T.currentType===2&&g(Kt.EMPTY_PLACEHOLDER,r(),0),N.next(),j=x(T,3,"}"),T.braceNest--,T.braceNest>0&&O(N),T.inLinked&&T.braceNest===0&&(T.inLinked=!1),j;case"@":return T.braceNest>0&&g(Kt.UNTERMINATED_CLOSING_BRACE,r(),0),j=de(N,T)||b(T),T.braceNest=0,j;default:{let Pe=!0,De=!0,se=!0;if(Oe(N))return T.braceNest>0&&g(Kt.UNTERMINATED_CLOSING_BRACE,r(),0),j=x(T,1,C(N)),T.braceNest=0,T.inLinked=!1,j;if(T.braceNest>0&&(T.currentType===4||T.currentType===5||T.currentType===6))return g(Kt.UNTERMINATED_CLOSING_BRACE,r(),0),T.braceNest=0,Se(N,T);if(Pe=me(N,T))return j=x(T,4,be(N)),O(N),j;if(De=M(N,T))return j=x(T,5,ve(N)),O(N),j;if(se=z(N,T))return j=x(T,6,te(N)),O(N),j;if(!Pe&&!De&&!se)return j=x(T,12,J(N)),g(Kt.INVALID_TOKEN_IN_PLACEHOLDER,r(),0,j.value),O(N),j;break}}return j}function de(N,T){const{currentType:j}=T;let ne=null;const Pe=N.currentChar();switch((j===7||j===8||j===11||j===9)&&(Pe===qn||Pe===aa)&&g(Kt.INVALID_LINKED_FORMAT,r(),0),Pe){case"@":return N.next(),ne=x(T,7,"@"),T.inLinked=!0,ne;case".":return O(N),N.next(),x(T,8,".");case":":return O(N),N.next(),x(T,9,":");default:return Oe(N)?(ne=x(T,1,C(N)),T.braceNest=0,T.inLinked=!1,ne):ce(N,T)||le(N,T)?(O(N),de(N,T)):P(N,T)?(O(N),x(T,11,Y(N))):ie(N,T)?(O(N),Pe==="{"?G(N,T)||ne:x(T,10,L(N))):(j===7&&g(Kt.INVALID_LINKED_FORMAT,r(),0),T.braceNest=0,T.inLinked=!1,Se(N,T))}}function Se(N,T){let j={type:13};if(T.braceNest>0)return G(N,T)||b(T);if(T.inLinked)return de(N,T)||b(T);switch(N.currentChar()){case"{":return G(N,T)||b(T);case"}":return g(Kt.UNBALANCED_CLOSING_BRACE,r(),0),N.next(),x(T,3,"}");case"@":return de(N,T)||b(T);default:{if(Oe(N))return j=x(T,1,C(N)),T.braceNest=0,T.inLinked=!1,j;if(Ae(N))return x(T,0,oe(N));break}}return j}function Le(){const{currentType:N,offset:T,startLoc:j,endLoc:ne}=p;return p.lastType=N,p.lastOffset=T,p.lastStartLoc=j,p.lastEndLoc=ne,p.offset=a(),p.startLoc=r(),o.currentChar()===Ma?x(p,13):Se(o,p)}return{nextToken:Le,currentOffset:a,currentPosition:r,context:m}}const P_="parser",N_=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g;function F_(e,t,n){switch(e){case"\\\\":return"\\";case"\\'":return"'";default:{const o=parseInt(t||n,16);return o<=55295||o>=57344?String.fromCodePoint(o):"�"}}}function B_(e={}){const t=e.location!==!1,{onError:n}=e;function o(I,V,me,M,...z){const ce=I.currentPosition();if(ce.offset+=M,ce.column+=M,n){const P=t?$u(me,ce):null,le=Ws(V,P,{domain:P_,args:z});n(le)}}function a(I,V,me){const M={type:I};return t&&(M.start=V,M.end=V,M.loc={start:me,end:me}),M}function r(I,V,me,M){t&&(I.end=V,I.loc&&(I.loc.end=me))}function s(I,V){const me=I.context(),M=a(3,me.offset,me.startLoc);return M.value=V,r(M,I.currentOffset(),I.currentPosition()),M}function u(I,V){const me=I.context(),{lastOffset:M,lastStartLoc:z}=me,ce=a(5,M,z);return ce.index=parseInt(V,10),I.nextToken(),r(ce,I.currentOffset(),I.currentPosition()),ce}function p(I,V){const me=I.context(),{lastOffset:M,lastStartLoc:z}=me,ce=a(4,M,z);return ce.key=V,I.nextToken(),r(ce,I.currentOffset(),I.currentPosition()),ce}function m(I,V){const me=I.context(),{lastOffset:M,lastStartLoc:z}=me,ce=a(9,M,z);return ce.value=V.replace(N_,F_),I.nextToken(),r(ce,I.currentOffset(),I.currentPosition()),ce}function f(I){const V=I.nextToken(),me=I.context(),{lastOffset:M,lastStartLoc:z}=me,ce=a(8,M,z);return V.type!==11?(o(I,Kt.UNEXPECTED_EMPTY_LINKED_MODIFIER,me.lastStartLoc,0),ce.value="",r(ce,M,z),{nextConsumeToken:V,node:ce}):(V.value==null&&o(I,Kt.UNEXPECTED_LEXICAL_ANALYSIS,me.lastStartLoc,0,Bo(V)),ce.value=V.value||"",r(ce,I.currentOffset(),I.currentPosition()),{node:ce})}function g(I,V){const me=I.context(),M=a(7,me.offset,me.startLoc);return M.value=V,r(M,I.currentOffset(),I.currentPosition()),M}function x(I){const V=I.context(),me=a(6,V.offset,V.startLoc);let M=I.nextToken();if(M.type===8){const z=f(I);me.modifier=z.node,M=z.nextConsumeToken||I.nextToken()}switch(M.type!==9&&o(I,Kt.UNEXPECTED_LEXICAL_ANALYSIS,V.lastStartLoc,0,Bo(M)),M=I.nextToken(),M.type===2&&(M=I.nextToken()),M.type){case 10:M.value==null&&o(I,Kt.UNEXPECTED_LEXICAL_ANALYSIS,V.lastStartLoc,0,Bo(M)),me.key=g(I,M.value||"");break;case 4:M.value==null&&o(I,Kt.UNEXPECTED_LEXICAL_ANALYSIS,V.lastStartLoc,0,Bo(M)),me.key=p(I,M.value||"");break;case 5:M.value==null&&o(I,Kt.UNEXPECTED_LEXICAL_ANALYSIS,V.lastStartLoc,0,Bo(M)),me.key=u(I,M.value||"");break;case 6:M.value==null&&o(I,Kt.UNEXPECTED_LEXICAL_ANALYSIS,V.lastStartLoc,0,Bo(M)),me.key=m(I,M.value||"");break;default:{o(I,Kt.UNEXPECTED_EMPTY_LINKED_KEY,V.lastStartLoc,0);const z=I.context(),ce=a(7,z.offset,z.startLoc);return ce.value="",r(ce,z.offset,z.startLoc),me.key=ce,r(me,z.offset,z.startLoc),{nextConsumeToken:M,node:me}}}return r(me,I.currentOffset(),I.currentPosition()),{node:me}}function b(I){const V=I.context(),me=V.currentType===1?I.currentOffset():V.offset,M=V.currentType===1?V.endLoc:V.startLoc,z=a(2,me,M);z.items=[];let ce=null;do{const ie=ce||I.nextToken();switch(ce=null,ie.type){case 0:ie.value==null&&o(I,Kt.UNEXPECTED_LEXICAL_ANALYSIS,V.lastStartLoc,0,Bo(ie)),z.items.push(s(I,ie.value||""));break;case 5:ie.value==null&&o(I,Kt.UNEXPECTED_LEXICAL_ANALYSIS,V.lastStartLoc,0,Bo(ie)),z.items.push(u(I,ie.value||""));break;case 4:ie.value==null&&o(I,Kt.UNEXPECTED_LEXICAL_ANALYSIS,V.lastStartLoc,0,Bo(ie)),z.items.push(p(I,ie.value||""));break;case 6:ie.value==null&&o(I,Kt.UNEXPECTED_LEXICAL_ANALYSIS,V.lastStartLoc,0,Bo(ie)),z.items.push(m(I,ie.value||""));break;case 7:{const Oe=x(I);z.items.push(Oe.node),ce=Oe.nextConsumeToken||null;break}}}while(V.currentType!==13&&V.currentType!==1);const P=V.currentType===1?V.lastOffset:I.currentOffset(),le=V.currentType===1?V.lastEndLoc:I.currentPosition();return r(z,P,le),z}function k(I,V,me,M){const z=I.context();let ce=M.items.length===0;const P=a(1,V,me);P.cases=[],P.cases.push(M);do{const le=b(I);ce||(ce=le.items.length===0),P.cases.push(le)}while(z.currentType!==13);return ce&&o(I,Kt.MUST_HAVE_MESSAGES_IN_PLURAL,me,0),r(P,I.currentOffset(),I.currentPosition()),P}function $(I){const V=I.context(),{offset:me,startLoc:M}=V,z=b(I);return V.currentType===13?z:k(I,me,M,z)}function O(I){const V=R_(I,kn({},e)),me=V.context(),M=a(0,me.offset,me.startLoc);return t&&M.loc&&(M.loc.source=I),M.body=$(V),e.onCacheKey&&(M.cacheKey=e.onCacheKey(I)),me.currentType!==13&&o(V,Kt.UNEXPECTED_LEXICAL_ANALYSIS,me.lastStartLoc,0,I[me.offset]||""),r(M,V.currentOffset(),V.currentPosition()),M}return{parse:O}}function Bo(e){if(e.type===13)return"EOF";const t=(e.value||"").replace(/\r?\n/gu,"\\n");return t.length>10?t.slice(0,9)+"…":t}function U_(e,t={}){const n={ast:e,helpers:new Set};return{context:()=>n,helper:r=>(n.helpers.add(r),r)}}function _f(e,t){for(let n=0;n<e.length;n++)Lu(e[n],t)}function Lu(e,t){switch(e.type){case 1:_f(e.cases,t),t.helper("plural");break;case 2:_f(e.items,t);break;case 6:{Lu(e.key,t),t.helper("linked"),t.helper("type");break}case 5:t.helper("interpolate"),t.helper("list");break;case 4:t.helper("interpolate"),t.helper("named");break}}function z_(e,t={}){const n=U_(e);n.helper("normalize"),e.body&&Lu(e.body,n);const o=n.context();e.helpers=Array.from(o.helpers)}function V_(e){const t=e.body;return t.type===2?yf(t):t.cases.forEach(n=>yf(n)),e}function yf(e){if(e.items.length===1){const t=e.items[0];(t.type===3||t.type===9)&&(e.static=t.value,delete t.value)}else{const t=[];for(let n=0;n<e.items.length;n++){const o=e.items[n];if(!(o.type===3||o.type===9)||o.value==null)break;t.push(o.value)}if(t.length===e.items.length){e.static=Eu(t);for(let n=0;n<e.items.length;n++){const o=e.items[n];(o.type===3||o.type===9)&&delete o.value}}}}function Mr(e){switch(e.t=e.type,e.type){case 0:{const t=e;Mr(t.body),t.b=t.body,delete t.body;break}case 1:{const t=e,n=t.cases;for(let o=0;o<n.length;o++)Mr(n[o]);t.c=n,delete t.cases;break}case 2:{const t=e,n=t.items;for(let o=0;o<n.length;o++)Mr(n[o]);t.i=n,delete t.items,t.static&&(t.s=t.static,delete t.static);break}case 3:case 9:case 8:case 7:{const t=e;t.value&&(t.v=t.value,delete t.value);break}case 6:{const t=e;Mr(t.key),t.k=t.key,delete t.key,t.modifier&&(Mr(t.modifier),t.m=t.modifier,delete t.modifier);break}case 5:{const t=e;t.i=t.index,delete t.index;break}case 4:{const t=e;t.k=t.key,delete t.key;break}}delete e.type}function W_(e,t){const{filename:n,breakLineCode:o,needIndent:a}=t,r=t.location!==!1,s={filename:n,code:"",column:1,line:1,offset:0,map:void 0,breakLineCode:o,needIndent:a,indentLevel:0};r&&e.loc&&(s.source=e.loc.source);const u=()=>s;function p($,O){s.code+=$}function m($,O=!0){const I=O?o:"";p(a?I+" ".repeat($):I)}function f($=!0){const O=++s.indentLevel;$&&m(O)}function g($=!0){const O=--s.indentLevel;$&&m(O)}function x(){m(s.indentLevel)}return{context:u,push:p,indent:f,deindent:g,newline:x,helper:$=>`_${$}`,needIndent:()=>s.needIndent}}function j_(e,t){const{helper:n}=e;e.push(`${n("linked")}(`),Ir(e,t.key),t.modifier?(e.push(", "),Ir(e,t.modifier),e.push(", _type")):e.push(", undefined, _type"),e.push(")")}function H_(e,t){const{helper:n,needIndent:o}=e;e.push(`${n("normalize")}([`),e.indent(o());const a=t.items.length;for(let r=0;r<a&&(Ir(e,t.items[r]),r!==a-1);r++)e.push(", ");e.deindent(o()),e.push("])")}function G_(e,t){const{helper:n,needIndent:o}=e;if(t.cases.length>1){e.push(`${n("plural")}([`),e.indent(o());const a=t.cases.length;for(let r=0;r<a&&(Ir(e,t.cases[r]),r!==a-1);r++)e.push(", ");e.deindent(o()),e.push("])")}}function q_(e,t){t.body?Ir(e,t.body):e.push("null")}function Ir(e,t){const{helper:n}=e;switch(t.type){case 0:q_(e,t);break;case 1:G_(e,t);break;case 2:H_(e,t);break;case 6:j_(e,t);break;case 8:e.push(JSON.stringify(t.value),t);break;case 7:e.push(JSON.stringify(t.value),t);break;case 5:e.push(`${n("interpolate")}(${n("list")}(${t.index}))`,t);break;case 4:e.push(`${n("interpolate")}(${n("named")}(${JSON.stringify(t.key)}))`,t);break;case 9:e.push(JSON.stringify(t.value),t);break;case 3:e.push(JSON.stringify(t.value),t);break}}const Y_=(e,t={})=>{const n=Ze(t.mode)?t.mode:"normal",o=Ze(t.filename)?t.filename:"message.intl";t.sourceMap;const a=t.breakLineCode!=null?t.breakLineCode:n==="arrow"?";":`
|
||
`,r=t.needIndent?t.needIndent:n!=="arrow",s=e.helpers||[],u=W_(e,{filename:o,breakLineCode:a,needIndent:r});u.push(n==="normal"?"function __msg__ (ctx) {":"(ctx) => {"),u.indent(r),s.length>0&&(u.push(`const { ${Eu(s.map(f=>`${f}: _${f}`),", ")} } = ctx`),u.newline()),u.push("return "),Ir(u,e),u.deindent(r),u.push("}"),delete e.helpers;const{code:p,map:m}=u.context();return{ast:e,code:p,map:m?m.toJSON():void 0}};function K_(e,t={}){const n=kn({},t),o=!!n.jit,a=!!n.minify,r=n.optimize==null?!0:n.optimize,u=B_(n).parse(e);return o?(r&&V_(u),a&&Mr(u),{ast:u,code:""}):(z_(u,n),Y_(u,n))}/*!
|
||
* core-base v11.1.2
|
||
* (c) 2025 kazuya kawaguchi
|
||
* Released under the MIT License.
|
||
*/function J_(){typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(or().__INTLIFY_PROD_DEVTOOLS__=!1),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(or().__INTLIFY_DROP_MESSAGE_COMPILER__=!1)}function Au(e){return n=>X_(n,e)}function X_(e,t){const n=Z_(t);if(n==null)throw Ei(0);if(Iu(n)===1){const r=t0(n);return e.plural(r.reduce((s,u)=>[...s,bf(e,u)],[]))}else return bf(e,n)}const Q_=["b","body"];function Z_(e){return Ia(e,Q_)}const e0=["c","cases"];function t0(e){return Ia(e,e0,[])}function bf(e,t){const n=o0(t);if(n!=null)return e.type==="text"?n:e.normalize([n]);{const o=r0(t).reduce((a,r)=>[...a,Mu(e,r)],[]);return e.normalize(o)}}const n0=["s","static"];function o0(e){return Ia(e,n0)}const a0=["i","items"];function r0(e){return Ia(e,a0,[])}function Mu(e,t){const n=Iu(t);switch(n){case 3:return js(t,n);case 9:return js(t,n);case 4:{const o=t;if(Eo(o,"k")&&o.k)return e.interpolate(e.named(o.k));if(Eo(o,"key")&&o.key)return e.interpolate(e.named(o.key));throw Ei(n)}case 5:{const o=t;if(Eo(o,"i")&&_n(o.i))return e.interpolate(e.list(o.i));if(Eo(o,"index")&&_n(o.index))return e.interpolate(e.list(o.index));throw Ei(n)}case 6:{const o=t,a=u0(o),r=d0(o);return e.linked(Mu(e,r),a?Mu(e,a):void 0,e.type)}case 7:return js(t,n);case 8:return js(t,n);default:throw new Error(`unhandled node on format message part: ${n}`)}}const i0=["t","type"];function Iu(e){return Ia(e,i0)}const s0=["v","value"];function js(e,t){const n=Ia(e,s0);if(n)return n;throw Ei(t)}const l0=["m","modifier"];function u0(e){return Ia(e,l0)}const c0=["k","key"];function d0(e){const t=Ia(e,c0);if(t)return t;throw Ei(6)}function Ia(e,t,n){for(let o=0;o<t.length;o++){const a=t[o];if(Eo(e,a)&&e[a]!=null)return e[a]}return n}function Ei(e){return new Error(`unhandled node type: ${e}`)}const p0=e=>e;let Hs=Xt();function Dr(e){return zt(e)&&Iu(e)===0&&(Eo(e,"b")||Eo(e,"body"))}function f0(e,t={}){let n=!1;const o=t.onError||$_;return t.onError=a=>{n=!0,o(a)},{...K_(e,t),detectError:n}}function g0(e,t){if(!__INTLIFY_DROP_MESSAGE_COMPILER__&&Ze(e)){Ft(t.warnHtmlMessage)&&t.warnHtmlMessage;const o=(t.onCacheKey||p0)(e),a=Hs[o];if(a)return a;const{ast:r,detectError:s}=f0(e,{...t,location:!1,jit:!0}),u=Au(r);return s?u:Hs[o]=u}else{const n=e.cacheKey;if(n){const o=Hs[n];return o||(Hs[n]=Au(e))}else return Au(e)}}let $i=null;function m0(e){$i=e}function h0(e,t,n){$i&&$i.emit("i18n:init",{timestamp:Date.now(),i18n:e,version:t,meta:n})}const v0=_0("function:translate");function _0(e){return t=>$i&&$i.emit(e,t)}const ra={INVALID_ARGUMENT:E_,INVALID_DATE_ARGUMENT:18,INVALID_ISO_DATE_ARGUMENT:19,NOT_SUPPORT_LOCALE_PROMISE_VALUE:21,NOT_SUPPORT_LOCALE_ASYNC_FUNCTION:22,NOT_SUPPORT_LOCALE_TYPE:23},y0=24;function ia(e){return Ws(e,null,void 0)}function Du(e,t){return t.locale!=null?wf(t.locale):wf(e.locale)}let Ou;function wf(e){if(Ze(e))return e;if(on(e)){if(e.resolvedOnce&&Ou!=null)return Ou;if(e.constructor.name==="Function"){const t=e();if(S_(t))throw ia(ra.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return Ou=t}else throw ia(ra.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}else throw ia(ra.NOT_SUPPORT_LOCALE_TYPE)}function b0(e,t,n){return[...new Set([n,...yn(t)?t:zt(t)?Object.keys(t):Ze(t)?[t]:[n]])]}function xf(e,t,n){const o=Ze(n)?n:Li,a=e;a.__localeChainCache||(a.__localeChainCache=new Map);let r=a.__localeChainCache.get(o);if(!r){r=[];let s=[n];for(;yn(s);)s=Sf(r,s,t);const u=yn(t)||!$t(t)?t:t.default?t.default:null;s=Ze(u)?[u]:u,yn(s)&&Sf(r,s,!1),a.__localeChainCache.set(o,r)}return r}function Sf(e,t,n){let o=!0;for(let a=0;a<t.length&&Ft(o);a++){const r=t[a];Ze(r)&&(o=w0(e,t[a],n))}return o}function w0(e,t,n){let o;const a=t.split("-");do{const r=a.join("-");o=x0(e,r,n),a.splice(-1,1)}while(a.length&&o===!0);return o}function x0(e,t,n){let o=!1;if(!e.includes(t)&&(o=!0,t)){o=t[t.length-1]!=="!";const a=t.replace(/!/g,"");e.push(a),(yn(n)||$t(n))&&n[a]&&(o=n[a])}return o}const Da=[];Da[0]={w:[0],i:[3,0],"[":[4],o:[7]},Da[1]={w:[1],".":[2],"[":[4],o:[7]},Da[2]={w:[2],i:[3,0],0:[3,0]},Da[3]={i:[3,0],0:[3,0],w:[1,1],".":[2,1],"[":[4,1],o:[7,1]},Da[4]={"'":[5,0],'"':[6,0],"[":[4,2],"]":[1,3],o:8,l:[4,0]},Da[5]={"'":[4,0],o:8,l:[5,0]},Da[6]={'"':[4,0],o:8,l:[6,0]};const S0=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function T0(e){return S0.test(e)}function k0(e){const t=e.charCodeAt(0),n=e.charCodeAt(e.length-1);return t===n&&(t===34||t===39)?e.slice(1,-1):e}function C0(e){if(e==null)return"o";switch(e.charCodeAt(0)){case 91:case 93:case 46:case 34:case 39:return e;case 95:case 36:case 45:return"i";case 9:case 10:case 13:case 160:case 65279:case 8232:case 8233:return"w"}return"i"}function E0(e){const t=e.trim();return e.charAt(0)==="0"&&isNaN(parseInt(e))?!1:T0(t)?k0(t):"*"+t}function $0(e){const t=[];let n=-1,o=0,a=0,r,s,u,p,m,f,g;const x=[];x[0]=()=>{s===void 0?s=u:s+=u},x[1]=()=>{s!==void 0&&(t.push(s),s=void 0)},x[2]=()=>{x[0](),a++},x[3]=()=>{if(a>0)a--,o=4,x[0]();else{if(a=0,s===void 0||(s=E0(s),s===!1))return!1;x[1]()}};function b(){const k=e[n+1];if(o===5&&k==="'"||o===6&&k==='"')return n++,u="\\"+k,x[0](),!0}for(;o!==null;)if(n++,r=e[n],!(r==="\\"&&b())){if(p=C0(r),g=Da[o],m=g[p]||g.l||8,m===8||(o=m[0],m[1]!==void 0&&(f=x[m[1]],f&&(u=r,f()===!1))))return;if(o===7)return t}}const Tf=new Map;function L0(e,t){return zt(e)?e[t]:null}function A0(e,t){if(!zt(e))return null;let n=Tf.get(t);if(n||(n=$0(t),n&&Tf.set(t,n)),!n)return null;const o=n.length;let a=e,r=0;for(;r<o;){const s=a[n[r]];if(s===void 0||on(a))return null;a=s,r++}return a}const M0="11.1.2",Gs=-1,Li="en-US",kf="",Cf=e=>`${e.charAt(0).toLocaleUpperCase()}${e.substr(1)}`;function I0(){return{upper:(e,t)=>t==="text"&&Ze(e)?e.toUpperCase():t==="vnode"&&zt(e)&&"__v_isVNode"in e?e.children.toUpperCase():e,lower:(e,t)=>t==="text"&&Ze(e)?e.toLowerCase():t==="vnode"&&zt(e)&&"__v_isVNode"in e?e.children.toLowerCase():e,capitalize:(e,t)=>t==="text"&&Ze(e)?Cf(e):t==="vnode"&&zt(e)&&"__v_isVNode"in e?Cf(e.children):e}}let Ef;function D0(e){Ef=e}let $f;function O0(e){$f=e}let Lf;function R0(e){Lf=e}let Af=null;const P0=e=>{Af=e},N0=()=>Af;let Mf=null;const If=e=>{Mf=e},F0=()=>Mf;let Df=0;function B0(e={}){const t=on(e.onWarn)?e.onWarn:k_,n=Ze(e.version)?e.version:M0,o=Ze(e.locale)||on(e.locale)?e.locale:Li,a=on(o)?Li:o,r=yn(e.fallbackLocale)||$t(e.fallbackLocale)||Ze(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:a,s=$t(e.messages)?e.messages:Ru(a),u=$t(e.datetimeFormats)?e.datetimeFormats:Ru(a),p=$t(e.numberFormats)?e.numberFormats:Ru(a),m=kn(Xt(),e.modifiers,I0()),f=e.pluralRules||Xt(),g=on(e.missing)?e.missing:null,x=Ft(e.missingWarn)||Ar(e.missingWarn)?e.missingWarn:!0,b=Ft(e.fallbackWarn)||Ar(e.fallbackWarn)?e.fallbackWarn:!0,k=!!e.fallbackFormat,$=!!e.unresolving,O=on(e.postTranslation)?e.postTranslation:null,I=$t(e.processor)?e.processor:null,V=Ft(e.warnHtmlMessage)?e.warnHtmlMessage:!0,me=!!e.escapeParameter,M=on(e.messageCompiler)?e.messageCompiler:Ef,z=on(e.messageResolver)?e.messageResolver:$f||L0,ce=on(e.localeFallbacker)?e.localeFallbacker:Lf||b0,P=zt(e.fallbackContext)?e.fallbackContext:void 0,le=e,ie=zt(le.__datetimeFormatters)?le.__datetimeFormatters:new Map,Oe=zt(le.__numberFormatters)?le.__numberFormatters:new Map,Ae=zt(le.__meta)?le.__meta:{};Df++;const fe={version:n,cid:Df,locale:o,fallbackLocale:r,messages:s,modifiers:m,pluralRules:f,missing:g,missingWarn:x,fallbackWarn:b,fallbackFormat:k,unresolving:$,postTranslation:O,processor:I,warnHtmlMessage:V,escapeParameter:me,messageCompiler:M,messageResolver:z,localeFallbacker:ce,fallbackContext:P,onWarn:t,__meta:Ae};return fe.datetimeFormats=u,fe.numberFormats=p,fe.__datetimeFormatters=ie,fe.__numberFormatters=Oe,__INTLIFY_PROD_DEVTOOLS__&&h0(fe,n,Ae),fe}const Ru=e=>({[e]:Xt()});function Pu(e,t,n,o,a){const{missing:r,onWarn:s}=e;if(r!==null){const u=r(e,n,t,a);return Ze(u)?u:t}else return t}function Ai(e,t,n){const o=e;o.__localeChainCache=new Map,e.localeFallbacker(e,n,t)}function U0(e,t){return e===t?!1:e.split("-")[0]===t.split("-")[0]}function z0(e,t){const n=t.indexOf(e);if(n===-1)return!1;for(let o=n+1;o<t.length;o++)if(U0(e,t[o]))return!0;return!1}function Of(e,...t){const{datetimeFormats:n,unresolving:o,fallbackLocale:a,onWarn:r,localeFallbacker:s}=e,{__datetimeFormatters:u}=e,[p,m,f,g]=Nu(...t),x=Ft(f.missingWarn)?f.missingWarn:e.missingWarn;Ft(f.fallbackWarn)?f.fallbackWarn:e.fallbackWarn;const b=!!f.part,k=Du(e,f),$=s(e,a,k);if(!Ze(p)||p==="")return new Intl.DateTimeFormat(k,g).format(m);let O={},I,V=null;const me="datetime format";for(let ce=0;ce<$.length&&(I=$[ce],O=n[I]||{},V=O[p],!$t(V));ce++)Pu(e,p,I,x,me);if(!$t(V)||!Ze(I))return o?Gs:p;let M=`${I}__${p}`;Us(g)||(M=`${M}__${JSON.stringify(g)}`);let z=u.get(M);return z||(z=new Intl.DateTimeFormat(I,kn({},V,g)),u.set(M,z)),b?z.formatToParts(m):z.format(m)}const Rf=["localeMatcher","weekday","era","year","month","day","hour","minute","second","timeZoneName","formatMatcher","hour12","timeZone","dateStyle","timeStyle","calendar","dayPeriod","numberingSystem","hourCycle","fractionalSecondDigits"];function Nu(...e){const[t,n,o,a]=e,r=Xt();let s=Xt(),u;if(Ze(t)){const p=t.match(/(\d{4}-\d{2}-\d{2})(T|\s)?(.*)/);if(!p)throw ia(ra.INVALID_ISO_DATE_ARGUMENT);const m=p[3]?p[3].trim().startsWith("T")?`${p[1].trim()}${p[3].trim()}`:`${p[1].trim()}T${p[3].trim()}`:p[1].trim();u=new Date(m);try{u.toISOString()}catch{throw ia(ra.INVALID_ISO_DATE_ARGUMENT)}}else if(b_(t)){if(isNaN(t.getTime()))throw ia(ra.INVALID_DATE_ARGUMENT);u=t}else if(_n(t))u=t;else throw ia(ra.INVALID_ARGUMENT);return Ze(n)?r.key=n:$t(n)&&Object.keys(n).forEach(p=>{Rf.includes(p)?s[p]=n[p]:r[p]=n[p]}),Ze(o)?r.locale=o:$t(o)&&(s=o),$t(a)&&(s=a),[r.key||"",u,r,s]}function Pf(e,t,n){const o=e;for(const a in n){const r=`${t}__${a}`;o.__datetimeFormatters.has(r)&&o.__datetimeFormatters.delete(r)}}function Nf(e,...t){const{numberFormats:n,unresolving:o,fallbackLocale:a,onWarn:r,localeFallbacker:s}=e,{__numberFormatters:u}=e,[p,m,f,g]=Fu(...t),x=Ft(f.missingWarn)?f.missingWarn:e.missingWarn;Ft(f.fallbackWarn)?f.fallbackWarn:e.fallbackWarn;const b=!!f.part,k=Du(e,f),$=s(e,a,k);if(!Ze(p)||p==="")return new Intl.NumberFormat(k,g).format(m);let O={},I,V=null;const me="number format";for(let ce=0;ce<$.length&&(I=$[ce],O=n[I]||{},V=O[p],!$t(V));ce++)Pu(e,p,I,x,me);if(!$t(V)||!Ze(I))return o?Gs:p;let M=`${I}__${p}`;Us(g)||(M=`${M}__${JSON.stringify(g)}`);let z=u.get(M);return z||(z=new Intl.NumberFormat(I,kn({},V,g)),u.set(M,z)),b?z.formatToParts(m):z.format(m)}const Ff=["localeMatcher","style","currency","currencyDisplay","currencySign","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","compactDisplay","notation","signDisplay","unit","unitDisplay","roundingMode","roundingPriority","roundingIncrement","trailingZeroDisplay"];function Fu(...e){const[t,n,o,a]=e,r=Xt();let s=Xt();if(!_n(t))throw ia(ra.INVALID_ARGUMENT);const u=t;return Ze(n)?r.key=n:$t(n)&&Object.keys(n).forEach(p=>{Ff.includes(p)?s[p]=n[p]:r[p]=n[p]}),Ze(o)?r.locale=o:$t(o)&&(s=o),$t(a)&&(s=a),[r.key||"",u,r,s]}function Bf(e,t,n){const o=e;for(const a in n){const r=`${t}__${a}`;o.__numberFormatters.has(r)&&o.__numberFormatters.delete(r)}}const V0=e=>e,W0=e=>"",j0="text",H0=e=>e.length===0?"":Eu(e),G0=T_;function Uf(e,t){return e=Math.abs(e),t===2?e?e>1?1:0:1:e?Math.min(e,2):0}function q0(e){const t=_n(e.pluralIndex)?e.pluralIndex:-1;return e.named&&(_n(e.named.count)||_n(e.named.n))?_n(e.named.count)?e.named.count:_n(e.named.n)?e.named.n:t:t}function Y0(e,t){t.count||(t.count=e),t.n||(t.n=e)}function K0(e={}){const t=e.locale,n=q0(e),o=zt(e.pluralRules)&&Ze(t)&&on(e.pluralRules[t])?e.pluralRules[t]:Uf,a=zt(e.pluralRules)&&Ze(t)&&on(e.pluralRules[t])?Uf:void 0,r=I=>I[o(n,I.length,a)],s=e.list||[],u=I=>s[I],p=e.named||Xt();_n(e.pluralIndex)&&Y0(n,p);const m=I=>p[I];function f(I,V){const me=on(e.messages)?e.messages(I,!!V):zt(e.messages)?e.messages[I]:!1;return me||(e.parent?e.parent.message(I):W0)}const g=I=>e.modifiers?e.modifiers[I]:V0,x=$t(e.processor)&&on(e.processor.normalize)?e.processor.normalize:H0,b=$t(e.processor)&&on(e.processor.interpolate)?e.processor.interpolate:G0,k=$t(e.processor)&&Ze(e.processor.type)?e.processor.type:j0,O={list:u,named:m,plural:r,linked:(I,...V)=>{const[me,M]=V;let z="text",ce="";V.length===1?zt(me)?(ce=me.modifier||ce,z=me.type||z):Ze(me)&&(ce=me||ce):V.length===2&&(Ze(me)&&(ce=me||ce),Ze(M)&&(z=M||z));const P=f(I,!0)(O),le=z==="vnode"&&yn(P)&&ce?P[0]:P;return ce?g(ce)(le,z):le},message:f,type:k,interpolate:b,normalize:x,values:kn(Xt(),s,p)};return O}const zf=()=>"",bo=e=>on(e);function Vf(e,...t){const{fallbackFormat:n,postTranslation:o,unresolving:a,messageCompiler:r,fallbackLocale:s,messages:u}=e,[p,m]=Bu(...t),f=Ft(m.missingWarn)?m.missingWarn:e.missingWarn,g=Ft(m.fallbackWarn)?m.fallbackWarn:e.fallbackWarn,x=Ft(m.escapeParameter)?m.escapeParameter:e.escapeParameter,b=!!m.resolvedMessage,k=Ze(m.default)||Ft(m.default)?Ft(m.default)?r?p:()=>p:m.default:n?r?p:()=>p:null,$=n||k!=null&&(Ze(k)||on(k)),O=Du(e,m);x&&J0(m);let[I,V,me]=b?[p,O,u[O]||Xt()]:Wf(e,p,O,s,g,f),M=I,z=p;if(!b&&!(Ze(M)||Dr(M)||bo(M))&&$&&(M=k,z=M),!b&&(!(Ze(M)||Dr(M)||bo(M))||!Ze(V)))return a?Gs:p;let ce=!1;const P=()=>{ce=!0},le=bo(M)?M:jf(e,p,V,M,z,P);if(ce)return M;const ie=Z0(e,V,me,m),Oe=K0(ie),Ae=X0(e,le,Oe),fe=o?o(Ae,p):Ae;if(__INTLIFY_PROD_DEVTOOLS__){const _e={timestamp:Date.now(),key:Ze(p)?p:bo(M)?M.key:"",locale:V||(bo(M)?M.locale:""),format:Ze(M)?M:bo(M)?M.source:"",message:fe};_e.meta=kn({},e.__meta,N0()||{}),v0(_e)}return fe}function J0(e){yn(e.list)?e.list=e.list.map(t=>Ze(t)?mf(t):t):zt(e.named)&&Object.keys(e.named).forEach(t=>{Ze(e.named[t])&&(e.named[t]=mf(e.named[t]))})}function Wf(e,t,n,o,a,r){const{messages:s,onWarn:u,messageResolver:p,localeFallbacker:m}=e,f=m(e,o,n);let g=Xt(),x,b=null;const k="translate";for(let $=0;$<f.length&&(x=f[$],g=s[x]||Xt(),(b=p(g,t))===null&&(b=g[t]),!(Ze(b)||Dr(b)||bo(b)));$++)if(!z0(x,f)){const O=Pu(e,t,x,r,k);O!==t&&(b=O)}return[b,x,g]}function jf(e,t,n,o,a,r){const{messageCompiler:s,warnHtmlMessage:u}=e;if(bo(o)){const m=o;return m.locale=m.locale||n,m.key=m.key||t,m}if(s==null){const m=()=>o;return m.locale=n,m.key=t,m}const p=s(o,Q0(e,n,a,o,u,r));return p.locale=n,p.key=t,p.source=o,p}function X0(e,t,n){return t(n)}function Bu(...e){const[t,n,o]=e,a=Xt();if(!Ze(t)&&!_n(t)&&!bo(t)&&!Dr(t))throw ia(ra.INVALID_ARGUMENT);const r=_n(t)?String(t):(bo(t),t);return _n(n)?a.plural=n:Ze(n)?a.default=n:$t(n)&&!Us(n)?a.named=n:yn(n)&&(a.list=n),_n(o)?a.plural=o:Ze(o)?a.default=o:$t(o)&&kn(a,o),[r,a]}function Q0(e,t,n,o,a,r){return{locale:t,key:n,warnHtmlMessage:a,onError:s=>{throw r&&r(s),s},onCacheKey:s=>__(t,n,s)}}function Z0(e,t,n,o){const{modifiers:a,pluralRules:r,messageResolver:s,fallbackLocale:u,fallbackWarn:p,missingWarn:m,fallbackContext:f}=e,x={locale:t,modifiers:a,pluralRules:r,messages:(b,k)=>{let $=s(n,b);if($==null&&(f||k)){const[,,O]=Wf(f||e,b,t,u,p,m);$=s(O,b)}if(Ze($)||Dr($)){let O=!1;const V=jf(e,b,t,$,b,()=>{O=!0});return O?zf:V}else return bo($)?$:zf}};return e.processor&&(x.processor=e.processor),o.list&&(x.list=o.list),o.named&&(x.named=o.named),_n(o.plural)&&(x.pluralIndex=o.plural),x}J_();/*!
|
||
* vue-i18n v11.1.2
|
||
* (c) 2025 kazuya kawaguchi
|
||
* Released under the MIT License.
|
||
*/const e2="11.1.2";function t2(){typeof __VUE_I18N_FULL_INSTALL__!="boolean"&&(or().__VUE_I18N_FULL_INSTALL__=!0),typeof __VUE_I18N_LEGACY_API__!="boolean"&&(or().__VUE_I18N_LEGACY_API__=!0),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(or().__INTLIFY_DROP_MESSAGE_COMPILER__=!1),typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(or().__INTLIFY_PROD_DEVTOOLS__=!1)}const Qn={UNEXPECTED_RETURN_TYPE:y0,INVALID_ARGUMENT:25,MUST_BE_CALL_SETUP_TOP:26,NOT_INSTALLED:27,REQUIRED_VALUE:28,INVALID_VALUE:29,NOT_INSTALLED_WITH_PROVIDE:31,UNEXPECTED_ERROR:32};function uo(e,...t){return Ws(e,null,void 0)}const Uu=Aa("__translateVNode"),zu=Aa("__datetimeParts"),Vu=Aa("__numberParts"),Hf=Aa("__setPluralRules"),Gf=Aa("__injectWithOption"),Wu=Aa("__dispose");function Mi(e){if(!zt(e))return e;for(const t in e)if(Eo(e,t))if(!t.includes("."))zt(e[t])&&Mi(e[t]);else{const n=t.split("."),o=n.length-1;let a=e,r=!1;for(let s=0;s<o;s++){if(n[s]==="__proto__")throw new Error(`unsafe key: ${n[s]}`);if(n[s]in a||(a[n[s]]=Xt()),!zt(a[n[s]])){r=!0;break}a=a[n[s]]}r||(a[n[o]]=e[t],delete e[t]),zt(a[n[o]])&&Mi(a[n[o]])}return e}function ju(e,t){const{messages:n,__i18n:o,messageResolver:a,flatJson:r}=t,s=$t(n)?n:yn(o)?Xt():{[e]:Xt()};if(yn(o)&&o.forEach(u=>{if("locale"in u&&"resource"in u){const{locale:p,resource:m}=u;p?(s[p]=s[p]||Xt(),Vs(m,s[p])):Vs(m,s)}else Ze(u)&&Vs(JSON.parse(u),s)}),a==null&&r)for(const u in s)Eo(s,u)&&Mi(s[u]);return s}function qf(e){return e.type}function Yf(e,t,n){let o=zt(t.messages)?t.messages:Xt();"__i18nGlobal"in n&&(o=ju(e.locale.value,{messages:o,__i18n:n.__i18nGlobal}));const a=Object.keys(o);a.length&&a.forEach(r=>{e.mergeLocaleMessage(r,o[r])});{if(zt(t.datetimeFormats)){const r=Object.keys(t.datetimeFormats);r.length&&r.forEach(s=>{e.mergeDateTimeFormat(s,t.datetimeFormats[s])})}if(zt(t.numberFormats)){const r=Object.keys(t.numberFormats);r.length&&r.forEach(s=>{e.mergeNumberFormat(s,t.numberFormats[s])})}}}function Kf(e){return it(_i,null,e,0)}const Jf="__INTLIFY_META__",Xf=()=>[],n2=()=>!1;let Qf=0;function Zf(e){return(t,n,o,a)=>e(n,o,tr()||void 0,a)}const o2=()=>{const e=tr();let t=null;return e&&(t=qf(e)[Jf])?{[Jf]:t}:null};function Hu(e={}){const{__root:t,__injectWithOption:n}=e,o=t===void 0,a=e.flatJson,r=Bs?S:hv;let s=Ft(e.inheritLocale)?e.inheritLocale:!0;const u=r(t&&s?t.locale.value:Ze(e.locale)?e.locale:Li),p=r(t&&s?t.fallbackLocale.value:Ze(e.fallbackLocale)||yn(e.fallbackLocale)||$t(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:u.value),m=r(ju(u.value,e)),f=r($t(e.datetimeFormats)?e.datetimeFormats:{[u.value]:{}}),g=r($t(e.numberFormats)?e.numberFormats:{[u.value]:{}});let x=t?t.missingWarn:Ft(e.missingWarn)||Ar(e.missingWarn)?e.missingWarn:!0,b=t?t.fallbackWarn:Ft(e.fallbackWarn)||Ar(e.fallbackWarn)?e.fallbackWarn:!0,k=t?t.fallbackRoot:Ft(e.fallbackRoot)?e.fallbackRoot:!0,$=!!e.fallbackFormat,O=on(e.missing)?e.missing:null,I=on(e.missing)?Zf(e.missing):null,V=on(e.postTranslation)?e.postTranslation:null,me=t?t.warnHtmlMessage:Ft(e.warnHtmlMessage)?e.warnHtmlMessage:!0,M=!!e.escapeParameter;const z=t?t.modifiers:$t(e.modifiers)?e.modifiers:{};let ce=e.pluralRules||t&&t.pluralRules,P;P=(()=>{o&&If(null);const se={version:e2,locale:u.value,fallbackLocale:p.value,messages:m.value,modifiers:z,pluralRules:ce,missing:I===null?void 0:I,missingWarn:x,fallbackWarn:b,fallbackFormat:$,unresolving:!0,postTranslation:V===null?void 0:V,warnHtmlMessage:me,escapeParameter:M,messageResolver:e.messageResolver,messageCompiler:e.messageCompiler,__meta:{framework:"vue"}};se.datetimeFormats=f.value,se.numberFormats=g.value,se.__datetimeFormatters=$t(P)?P.__datetimeFormatters:void 0,se.__numberFormatters=$t(P)?P.__numberFormatters:void 0;const Te=B0(se);return o&&If(Te),Te})(),Ai(P,u.value,p.value);function ie(){return[u.value,p.value,m.value,f.value,g.value]}const Oe=Ht({get:()=>u.value,set:se=>{P.locale=se,u.value=se}}),Ae=Ht({get:()=>p.value,set:se=>{P.fallbackLocale=se,p.value=se,Ai(P,u.value,se)}}),fe=Ht(()=>m.value),_e=Ht(()=>f.value),ae=Ht(()=>g.value);function W(){return on(V)?V:null}function re(se){V=se,P.postTranslation=se}function Q(){return O}function X(se){se!==null&&(I=Zf(se)),O=se,P.missing=I}const ye=(se,Te,qe,et,ot,ft)=>{ie();let bt;try{__INTLIFY_PROD_DEVTOOLS__,o||(P.fallbackContext=t?F0():void 0),bt=se(P)}finally{__INTLIFY_PROD_DEVTOOLS__,o||(P.fallbackContext=void 0)}if(qe!=="translate exists"&&_n(bt)&&bt===Gs||qe==="translate exists"&&!bt){const[Mt,Vt]=Te();return t&&k?et(t):ot(Mt)}else{if(ft(bt))return bt;throw uo(Qn.UNEXPECTED_RETURN_TYPE)}};function pe(...se){return ye(Te=>Reflect.apply(Vf,null,[Te,...se]),()=>Bu(...se),"translate",Te=>Reflect.apply(Te.t,Te,[...se]),Te=>Te,Te=>Ze(Te))}function Z(...se){const[Te,qe,et]=se;if(et&&!zt(et))throw uo(Qn.INVALID_ARGUMENT);return pe(Te,qe,kn({resolvedMessage:!0},et||{}))}function oe(...se){return ye(Te=>Reflect.apply(Of,null,[Te,...se]),()=>Nu(...se),"datetime format",Te=>Reflect.apply(Te.d,Te,[...se]),()=>kf,Te=>Ze(Te))}function be(...se){return ye(Te=>Reflect.apply(Nf,null,[Te,...se]),()=>Fu(...se),"number format",Te=>Reflect.apply(Te.n,Te,[...se]),()=>kf,Te=>Ze(Te))}function ve(se){return se.map(Te=>Ze(Te)||_n(Te)||Ft(Te)?Kf(String(Te)):Te)}const te={normalize:ve,interpolate:se=>se,type:"vnode"};function K(...se){return ye(Te=>{let qe;const et=Te;try{et.processor=te,qe=Reflect.apply(Vf,null,[et,...se])}finally{et.processor=null}return qe},()=>Bu(...se),"translate",Te=>Te[Uu](...se),Te=>[Kf(Te)],Te=>yn(Te))}function ee(...se){return ye(Te=>Reflect.apply(Nf,null,[Te,...se]),()=>Fu(...se),"number format",Te=>Te[Vu](...se),Xf,Te=>Ze(Te)||yn(Te))}function F(...se){return ye(Te=>Reflect.apply(Of,null,[Te,...se]),()=>Nu(...se),"datetime format",Te=>Te[zu](...se),Xf,Te=>Ze(Te)||yn(Te))}function J(se){ce=se,P.pluralRules=ce}function Y(se,Te){return ye(()=>{if(!se)return!1;const qe=Ze(Te)?Te:u.value,et=G(qe),ot=P.messageResolver(et,se);return Dr(ot)||bo(ot)||Ze(ot)},()=>[se],"translate exists",qe=>Reflect.apply(qe.te,qe,[se,Te]),n2,qe=>Ft(qe))}function L(se){let Te=null;const qe=xf(P,p.value,u.value);for(let et=0;et<qe.length;et++){const ot=m.value[qe[et]]||{},ft=P.messageResolver(ot,se);if(ft!=null){Te=ft;break}}return Te}function C(se){const Te=L(se);return Te??(t?t.tm(se)||{}:{})}function G(se){return m.value[se]||{}}function de(se,Te){if(a){const qe={[se]:Te};for(const et in qe)Eo(qe,et)&&Mi(qe[et]);Te=qe[se]}m.value[se]=Te,P.messages=m.value}function Se(se,Te){m.value[se]=m.value[se]||{};const qe={[se]:Te};if(a)for(const et in qe)Eo(qe,et)&&Mi(qe[et]);Te=qe[se],Vs(Te,m.value[se]),P.messages=m.value}function Le(se){return f.value[se]||{}}function N(se,Te){f.value[se]=Te,P.datetimeFormats=f.value,Pf(P,se,Te)}function T(se,Te){f.value[se]=kn(f.value[se]||{},Te),P.datetimeFormats=f.value,Pf(P,se,Te)}function j(se){return g.value[se]||{}}function ne(se,Te){g.value[se]=Te,P.numberFormats=g.value,Bf(P,se,Te)}function Pe(se,Te){g.value[se]=kn(g.value[se]||{},Te),P.numberFormats=g.value,Bf(P,se,Te)}Qf++,t&&Bs&&(At(t.locale,se=>{s&&(u.value=se,P.locale=se,Ai(P,u.value,p.value))}),At(t.fallbackLocale,se=>{s&&(p.value=se,P.fallbackLocale=se,Ai(P,u.value,p.value))}));const De={id:Qf,locale:Oe,fallbackLocale:Ae,get inheritLocale(){return s},set inheritLocale(se){s=se,se&&t&&(u.value=t.locale.value,p.value=t.fallbackLocale.value,Ai(P,u.value,p.value))},get availableLocales(){return Object.keys(m.value).sort()},messages:fe,get modifiers(){return z},get pluralRules(){return ce||{}},get isGlobal(){return o},get missingWarn(){return x},set missingWarn(se){x=se,P.missingWarn=x},get fallbackWarn(){return b},set fallbackWarn(se){b=se,P.fallbackWarn=b},get fallbackRoot(){return k},set fallbackRoot(se){k=se},get fallbackFormat(){return $},set fallbackFormat(se){$=se,P.fallbackFormat=$},get warnHtmlMessage(){return me},set warnHtmlMessage(se){me=se,P.warnHtmlMessage=se},get escapeParameter(){return M},set escapeParameter(se){M=se,P.escapeParameter=se},t:pe,getLocaleMessage:G,setLocaleMessage:de,mergeLocaleMessage:Se,getPostTranslationHandler:W,setPostTranslationHandler:re,getMissingHandler:Q,setMissingHandler:X,[Hf]:J};return De.datetimeFormats=_e,De.numberFormats=ae,De.rt=Z,De.te=Y,De.tm=C,De.d=oe,De.n=be,De.getDateTimeFormat=Le,De.setDateTimeFormat=N,De.mergeDateTimeFormat=T,De.getNumberFormat=j,De.setNumberFormat=ne,De.mergeNumberFormat=Pe,De[Gf]=n,De[Uu]=K,De[zu]=F,De[Vu]=ee,De}function a2(e){const t=Ze(e.locale)?e.locale:Li,n=Ze(e.fallbackLocale)||yn(e.fallbackLocale)||$t(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:t,o=on(e.missing)?e.missing:void 0,a=Ft(e.silentTranslationWarn)||Ar(e.silentTranslationWarn)?!e.silentTranslationWarn:!0,r=Ft(e.silentFallbackWarn)||Ar(e.silentFallbackWarn)?!e.silentFallbackWarn:!0,s=Ft(e.fallbackRoot)?e.fallbackRoot:!0,u=!!e.formatFallbackMessages,p=$t(e.modifiers)?e.modifiers:{},m=e.pluralizationRules,f=on(e.postTranslation)?e.postTranslation:void 0,g=Ze(e.warnHtmlInMessage)?e.warnHtmlInMessage!=="off":!0,x=!!e.escapeParameterHtml,b=Ft(e.sync)?e.sync:!0;let k=e.messages;if($t(e.sharedMessages)){const z=e.sharedMessages;k=Object.keys(z).reduce((P,le)=>{const ie=P[le]||(P[le]={});return kn(ie,z[le]),P},k||{})}const{__i18n:$,__root:O,__injectWithOption:I}=e,V=e.datetimeFormats,me=e.numberFormats,M=e.flatJson;return{locale:t,fallbackLocale:n,messages:k,flatJson:M,datetimeFormats:V,numberFormats:me,missing:o,missingWarn:a,fallbackWarn:r,fallbackRoot:s,fallbackFormat:u,modifiers:p,pluralRules:m,postTranslation:f,warnHtmlMessage:g,escapeParameter:x,messageResolver:e.messageResolver,inheritLocale:b,__i18n:$,__root:O,__injectWithOption:I}}function Gu(e={}){const t=Hu(a2(e)),{__extender:n}=e,o={id:t.id,get locale(){return t.locale.value},set locale(a){t.locale.value=a},get fallbackLocale(){return t.fallbackLocale.value},set fallbackLocale(a){t.fallbackLocale.value=a},get messages(){return t.messages.value},get datetimeFormats(){return t.datetimeFormats.value},get numberFormats(){return t.numberFormats.value},get availableLocales(){return t.availableLocales},get missing(){return t.getMissingHandler()},set missing(a){t.setMissingHandler(a)},get silentTranslationWarn(){return Ft(t.missingWarn)?!t.missingWarn:t.missingWarn},set silentTranslationWarn(a){t.missingWarn=Ft(a)?!a:a},get silentFallbackWarn(){return Ft(t.fallbackWarn)?!t.fallbackWarn:t.fallbackWarn},set silentFallbackWarn(a){t.fallbackWarn=Ft(a)?!a:a},get modifiers(){return t.modifiers},get formatFallbackMessages(){return t.fallbackFormat},set formatFallbackMessages(a){t.fallbackFormat=a},get postTranslation(){return t.getPostTranslationHandler()},set postTranslation(a){t.setPostTranslationHandler(a)},get sync(){return t.inheritLocale},set sync(a){t.inheritLocale=a},get warnHtmlInMessage(){return t.warnHtmlMessage?"warn":"off"},set warnHtmlInMessage(a){t.warnHtmlMessage=a!=="off"},get escapeParameterHtml(){return t.escapeParameter},set escapeParameterHtml(a){t.escapeParameter=a},get pluralizationRules(){return t.pluralRules||{}},__composer:t,t(...a){return Reflect.apply(t.t,t,[...a])},rt(...a){return Reflect.apply(t.rt,t,[...a])},te(a,r){return t.te(a,r)},tm(a){return t.tm(a)},getLocaleMessage(a){return t.getLocaleMessage(a)},setLocaleMessage(a,r){t.setLocaleMessage(a,r)},mergeLocaleMessage(a,r){t.mergeLocaleMessage(a,r)},d(...a){return Reflect.apply(t.d,t,[...a])},getDateTimeFormat(a){return t.getDateTimeFormat(a)},setDateTimeFormat(a,r){t.setDateTimeFormat(a,r)},mergeDateTimeFormat(a,r){t.mergeDateTimeFormat(a,r)},n(...a){return Reflect.apply(t.n,t,[...a])},getNumberFormat(a){return t.getNumberFormat(a)},setNumberFormat(a,r){t.setNumberFormat(a,r)},mergeNumberFormat(a,r){t.mergeNumberFormat(a,r)}};return o.__extender=n,o}function r2(e,t,n){return{beforeCreate(){const o=tr();if(!o)throw uo(Qn.UNEXPECTED_ERROR);const a=this.$options;if(a.i18n){const r=a.i18n;if(a.__i18n&&(r.__i18n=a.__i18n),r.__root=t,this===this.$root)this.$i18n=eg(e,r);else{r.__injectWithOption=!0,r.__extender=n.__vueI18nExtend,this.$i18n=Gu(r);const s=this.$i18n;s.__extender&&(s.__disposer=s.__extender(this.$i18n))}}else if(a.__i18n)if(this===this.$root)this.$i18n=eg(e,a);else{this.$i18n=Gu({__i18n:a.__i18n,__injectWithOption:!0,__extender:n.__vueI18nExtend,__root:t});const r=this.$i18n;r.__extender&&(r.__disposer=r.__extender(this.$i18n))}else this.$i18n=e;a.__i18nGlobal&&Yf(t,a,a),this.$t=(...r)=>this.$i18n.t(...r),this.$rt=(...r)=>this.$i18n.rt(...r),this.$te=(r,s)=>this.$i18n.te(r,s),this.$d=(...r)=>this.$i18n.d(...r),this.$n=(...r)=>this.$i18n.n(...r),this.$tm=r=>this.$i18n.tm(r),n.__setInstance(o,this.$i18n)},mounted(){},unmounted(){const o=tr();if(!o)throw uo(Qn.UNEXPECTED_ERROR);const a=this.$i18n;delete this.$t,delete this.$rt,delete this.$te,delete this.$d,delete this.$n,delete this.$tm,a.__disposer&&(a.__disposer(),delete a.__disposer,delete a.__extender),n.__deleteInstance(o),delete this.$i18n}}}function eg(e,t){e.locale=t.locale||e.locale,e.fallbackLocale=t.fallbackLocale||e.fallbackLocale,e.missing=t.missing||e.missing,e.silentTranslationWarn=t.silentTranslationWarn||e.silentFallbackWarn,e.silentFallbackWarn=t.silentFallbackWarn||e.silentFallbackWarn,e.formatFallbackMessages=t.formatFallbackMessages||e.formatFallbackMessages,e.postTranslation=t.postTranslation||e.postTranslation,e.warnHtmlInMessage=t.warnHtmlInMessage||e.warnHtmlInMessage,e.escapeParameterHtml=t.escapeParameterHtml||e.escapeParameterHtml,e.sync=t.sync||e.sync,e.__composer[Hf](t.pluralizationRules||e.pluralizationRules);const n=ju(e.locale,{messages:t.messages,__i18n:t.__i18n});return Object.keys(n).forEach(o=>e.mergeLocaleMessage(o,n[o])),t.datetimeFormats&&Object.keys(t.datetimeFormats).forEach(o=>e.mergeDateTimeFormat(o,t.datetimeFormats[o])),t.numberFormats&&Object.keys(t.numberFormats).forEach(o=>e.mergeNumberFormat(o,t.numberFormats[o])),e}const qu={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:e=>e==="parent"||e==="global",default:"parent"},i18n:{type:Object}};function i2({slots:e},t){return t.length===1&&t[0]==="default"?(e.default?e.default():[]).reduce((o,a)=>[...o,...a.type===Ke?a.children:[a]],[]):t.reduce((n,o)=>{const a=e[o];return a&&(n[o]=a()),n},Xt())}function tg(){return Ke}const ng=uu({name:"i18n-t",props:kn({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:e=>_n(e)||!isNaN(e)}},qu),setup(e,t){const{slots:n,attrs:o}=t,a=e.i18n||Gt({useScope:e.scope,__useComponent:!0});return()=>{const r=Object.keys(n).filter(g=>g!=="_"),s=Xt();e.locale&&(s.locale=e.locale),e.plural!==void 0&&(s.plural=Ze(e.plural)?+e.plural:e.plural);const u=i2(t,r),p=a[Uu](e.keypath,u,s),m=kn(Xt(),o),f=Ze(e.tag)||zt(e.tag)?e.tag:tg();return Nt(f,m,p)}}});function s2(e){return yn(e)&&!Ze(e[0])}function og(e,t,n,o){const{slots:a,attrs:r}=t;return()=>{const s={part:!0};let u=Xt();e.locale&&(s.locale=e.locale),Ze(e.format)?s.key=e.format:zt(e.format)&&(Ze(e.format.key)&&(s.key=e.format.key),u=Object.keys(e.format).reduce((x,b)=>n.includes(b)?kn(Xt(),x,{[b]:e.format[b]}):x,Xt()));const p=o(e.value,s,u);let m=[s.key];yn(p)?m=p.map((x,b)=>{const k=a[x.type],$=k?k({[x.type]:x.value,index:b,parts:p}):[x.value];return s2($)&&($[0].key=`${x.type}-${b}`),$}):Ze(p)&&(m=[p]);const f=kn(Xt(),r),g=Ze(e.tag)||zt(e.tag)?e.tag:tg();return Nt(g,f,m)}}const ag=uu({name:"i18n-n",props:kn({value:{type:Number,required:!0},format:{type:[String,Object]}},qu),setup(e,t){const n=e.i18n||Gt({useScope:e.scope,__useComponent:!0});return og(e,t,Ff,(...o)=>n[Vu](...o))}});function l2(e,t){const n=e;if(e.mode==="composition")return n.__getInstance(t)||e.global;{const o=n.__getInstance(t);return o!=null?o.__composer:e.global.__composer}}function u2(e){const t=s=>{const{instance:u,value:p}=s;if(!u||!u.$)throw uo(Qn.UNEXPECTED_ERROR);const m=l2(e,u.$),f=rg(p);return[Reflect.apply(m.t,m,[...ig(f)]),m]};return{created:(s,u)=>{const[p,m]=t(u);Bs&&e.global===m&&(s.__i18nWatcher=At(m.locale,()=>{u.instance&&u.instance.$forceUpdate()})),s.__composer=m,s.textContent=p},unmounted:s=>{Bs&&s.__i18nWatcher&&(s.__i18nWatcher(),s.__i18nWatcher=void 0,delete s.__i18nWatcher),s.__composer&&(s.__composer=void 0,delete s.__composer)},beforeUpdate:(s,{value:u})=>{if(s.__composer){const p=s.__composer,m=rg(u);s.textContent=Reflect.apply(p.t,p,[...ig(m)])}},getSSRProps:s=>{const[u]=t(s);return{textContent:u}}}}function rg(e){if(Ze(e))return{path:e};if($t(e)){if(!("path"in e))throw uo(Qn.REQUIRED_VALUE,"path");return e}else throw uo(Qn.INVALID_VALUE)}function ig(e){const{path:t,locale:n,args:o,choice:a,plural:r}=e,s={},u=o||{};return Ze(n)&&(s.locale=n),_n(a)&&(s.plural=a),_n(r)&&(s.plural=r),[t,u,s]}function c2(e,t,...n){const o=$t(n[0])?n[0]:{};(Ft(o.globalInstall)?o.globalInstall:!0)&&([ng.name,"I18nT"].forEach(r=>e.component(r,ng)),[ag.name,"I18nN"].forEach(r=>e.component(r,ag)),[lg.name,"I18nD"].forEach(r=>e.component(r,lg))),e.directive("t",u2(t))}const d2=Aa("global-vue-i18n");function p2(e={}){const t=__VUE_I18N_LEGACY_API__&&Ft(e.legacy)?e.legacy:__VUE_I18N_LEGACY_API__,n=Ft(e.globalInjection)?e.globalInjection:!0,o=new Map,[a,r]=f2(e,t),s=Aa("");function u(g){return o.get(g)||null}function p(g,x){o.set(g,x)}function m(g){o.delete(g)}const f={get mode(){return __VUE_I18N_LEGACY_API__&&t?"legacy":"composition"},async install(g,...x){if(g.__VUE_I18N_SYMBOL__=s,g.provide(g.__VUE_I18N_SYMBOL__,f),$t(x[0])){const $=x[0];f.__composerExtend=$.__composerExtend,f.__vueI18nExtend=$.__vueI18nExtend}let b=null;!t&&n&&(b=w2(g,f.global)),__VUE_I18N_FULL_INSTALL__&&c2(g,f,...x),__VUE_I18N_LEGACY_API__&&t&&g.mixin(r2(r,r.__composer,f));const k=g.unmount;g.unmount=()=>{b&&b(),f.dispose(),k()}},get global(){return r},dispose(){a.stop()},__instances:o,__getInstance:u,__setInstance:p,__deleteInstance:m};return f}function Gt(e={}){const t=tr();if(t==null)throw uo(Qn.MUST_BE_CALL_SETUP_TOP);if(!t.isCE&&t.appContext.app!=null&&!t.appContext.app.__VUE_I18N_SYMBOL__)throw uo(Qn.NOT_INSTALLED);const n=g2(t),o=h2(n),a=qf(t),r=m2(e,a);if(r==="global")return Yf(o,e,a),o;if(r==="parent"){let p=v2(n,t,e.__useComponent);return p==null&&(p=o),p}const s=n;let u=s.__getInstance(t);if(u==null){const p=kn({},e);"__i18n"in a&&(p.__i18n=a.__i18n),o&&(p.__root=o),u=Hu(p),s.__composerExtend&&(u[Wu]=s.__composerExtend(u)),y2(s,t,u),s.__setInstance(t,u)}return u}function f2(e,t){const n=jl(),o=__VUE_I18N_LEGACY_API__&&t?n.run(()=>Gu(e)):n.run(()=>Hu(e));if(o==null)throw uo(Qn.UNEXPECTED_ERROR);return[n,o]}function g2(e){const t=Er(e.isCE?d2:e.appContext.app.__VUE_I18N_SYMBOL__);if(!t)throw uo(e.isCE?Qn.NOT_INSTALLED_WITH_PROVIDE:Qn.UNEXPECTED_ERROR);return t}function m2(e,t){return Us(e)?"__i18n"in t?"local":"global":e.useScope?e.useScope:"local"}function h2(e){return e.mode==="composition"?e.global:e.global.__composer}function v2(e,t,n=!1){let o=null;const a=t.root;let r=_2(t,n);for(;r!=null;){const s=e;if(e.mode==="composition")o=s.__getInstance(r);else if(__VUE_I18N_LEGACY_API__){const u=s.__getInstance(r);u!=null&&(o=u.__composer,n&&o&&!o[Gf]&&(o=null))}if(o!=null||a===r)break;r=r.parent}return o}function _2(e,t=!1){return e==null?null:t&&e.vnode.ctx||e.parent}function y2(e,t,n){Ut(()=>{},t),so(()=>{const o=n;e.__deleteInstance(t);const a=o[Wu];a&&(a(),delete o[Wu])},t)}const b2=["locale","fallbackLocale","availableLocales"],sg=["t","rt","d","n","tm","te"];function w2(e,t){const n=Object.create(null);return b2.forEach(a=>{const r=Object.getOwnPropertyDescriptor(t,a);if(!r)throw uo(Qn.UNEXPECTED_ERROR);const s=gn(r.value)?{get(){return r.value.value},set(u){r.value.value=u}}:{get(){return r.get&&r.get()}};Object.defineProperty(n,a,s)}),e.config.globalProperties.$i18n=n,sg.forEach(a=>{const r=Object.getOwnPropertyDescriptor(t,a);if(!r||!r.value)throw uo(Qn.UNEXPECTED_ERROR);Object.defineProperty(e.config.globalProperties,`$${a}`,r)}),()=>{delete e.config.globalProperties.$i18n,sg.forEach(a=>{delete e.config.globalProperties[`$${a}`]})}}const lg=uu({name:"i18n-d",props:kn({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},qu),setup(e,t){const n=e.i18n||Gt({useScope:e.scope,__useComponent:!0});return og(e,t,Rf,(...o)=>n[zu](...o))}});if(t2(),D0(g0),O0(A0),R0(xf),__INTLIFY_PROD_DEVTOOLS__){const e=or();e.__INTLIFY__=!0,m0(e.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}function ug(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ii={exports:{}},x2=Ii.exports,cg;function S2(){return cg||(cg=1,function(e,t){(function(n,o){e.exports=o()})(x2,function(){function n(c,l){var d=Object.keys(c);if(Object.getOwnPropertySymbols){var h=Object.getOwnPropertySymbols(c);l&&(h=h.filter(function(_){return Object.getOwnPropertyDescriptor(c,_).enumerable})),d.push.apply(d,h)}return d}function o(c){for(var l=1;l<arguments.length;l++){var d=arguments[l]!=null?arguments[l]:{};l%2?n(Object(d),!0).forEach(function(h){p(c,h,d[h])}):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(d)):n(Object(d)).forEach(function(h){Object.defineProperty(c,h,Object.getOwnPropertyDescriptor(d,h))})}return c}function a(c){return a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(l){return typeof l}:function(l){return l&&typeof Symbol=="function"&&l.constructor===Symbol&&l!==Symbol.prototype?"symbol":typeof l},a(c)}function r(c,l){if(!(c instanceof l))throw new TypeError("Cannot call a class as a function")}function s(c,l){for(var d=0;d<l.length;d++){var h=l[d];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(c,$(h.key),h)}}function u(c,l,d){return l&&s(c.prototype,l),Object.defineProperty(c,"prototype",{writable:!1}),c}function p(c,l,d){return(l=$(l))in c?Object.defineProperty(c,l,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[l]=d,c}function m(c,l){if(typeof l!="function"&&l!==null)throw new TypeError("Super expression must either be null or a function");c.prototype=Object.create(l&&l.prototype,{constructor:{value:c,writable:!0,configurable:!0}}),Object.defineProperty(c,"prototype",{writable:!1}),l&&g(c,l)}function f(c){return f=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(l){return l.__proto__||Object.getPrototypeOf(l)},f(c)}function g(c,l){return g=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(d,h){return d.__proto__=h,d},g(c,l)}function x(c){if(c===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c}function b(c){var l=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var d,h=f(c);if(l){var _=f(this).constructor;d=Reflect.construct(h,arguments,_)}else d=h.apply(this,arguments);return function(w,A){if(A&&(typeof A=="object"||typeof A=="function"))return A;if(A!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return x(w)}(this,d)}}function k(){return k=typeof Reflect<"u"&&Reflect.get?Reflect.get.bind():function(c,l,d){var h=function(w,A){for(;!Object.prototype.hasOwnProperty.call(w,A)&&(w=f(w))!==null;);return w}(c,l);if(h){var _=Object.getOwnPropertyDescriptor(h,l);return _.get?_.get.call(arguments.length<3?c:d):_.value}},k.apply(this,arguments)}function $(c){var l=function(d,h){if(typeof d!="object"||d===null)return d;var _=d[Symbol.toPrimitive];if(_!==void 0){var w=_.call(d,h);if(typeof w!="object")return w;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(d)}(c,"string");return typeof l=="symbol"?l:l+""}var O=function(c){return!(!c||!c.Window)&&c instanceof c.Window},I=void 0,V=void 0;function me(c){I=c;var l=c.document.createTextNode("");l.ownerDocument!==c.document&&typeof c.wrap=="function"&&c.wrap(l)===l&&(c=c.wrap(c)),V=c}function M(c){return O(c)?c:(c.ownerDocument||c).defaultView||V.window}typeof window<"u"&&window&&me(window);var z=function(c){return!!c&&a(c)==="object"},ce=function(c){return typeof c=="function"},P={window:function(c){return c===V||O(c)},docFrag:function(c){return z(c)&&c.nodeType===11},object:z,func:ce,number:function(c){return typeof c=="number"},bool:function(c){return typeof c=="boolean"},string:function(c){return typeof c=="string"},element:function(c){if(!c||a(c)!=="object")return!1;var l=M(c)||V;return/object|function/.test(typeof Element>"u"?"undefined":a(Element))?c instanceof Element||c instanceof l.Element:c.nodeType===1&&typeof c.nodeName=="string"},plainObject:function(c){return z(c)&&!!c.constructor&&/function Object\b/.test(c.constructor.toString())},array:function(c){return z(c)&&c.length!==void 0&&ce(c.splice)}};function le(c){var l=c.interaction;if(l.prepared.name==="drag"){var d=l.prepared.axis;d==="x"?(l.coords.cur.page.y=l.coords.start.page.y,l.coords.cur.client.y=l.coords.start.client.y,l.coords.velocity.client.y=0,l.coords.velocity.page.y=0):d==="y"&&(l.coords.cur.page.x=l.coords.start.page.x,l.coords.cur.client.x=l.coords.start.client.x,l.coords.velocity.client.x=0,l.coords.velocity.page.x=0)}}function ie(c){var l=c.iEvent,d=c.interaction;if(d.prepared.name==="drag"){var h=d.prepared.axis;if(h==="x"||h==="y"){var _=h==="x"?"y":"x";l.page[_]=d.coords.start.page[_],l.client[_]=d.coords.start.client[_],l.delta[_]=0}}}var Oe={id:"actions/drag",install:function(c){var l=c.actions,d=c.Interactable,h=c.defaults;d.prototype.draggable=Oe.draggable,l.map.drag=Oe,l.methodDict.drag="draggable",h.actions.drag=Oe.defaults},listeners:{"interactions:before-action-move":le,"interactions:action-resume":le,"interactions:action-move":ie,"auto-start:check":function(c){var l=c.interaction,d=c.interactable,h=c.buttons,_=d.options.drag;if(_&&_.enabled&&(!l.pointerIsDown||!/mouse|pointer/.test(l.pointerType)||(h&d.options.drag.mouseButtons)!=0))return c.action={name:"drag",axis:_.lockAxis==="start"?_.startAxis:_.lockAxis},!1}},draggable:function(c){return P.object(c)?(this.options.drag.enabled=c.enabled!==!1,this.setPerAction("drag",c),this.setOnEvents("drag",c),/^(xy|x|y|start)$/.test(c.lockAxis)&&(this.options.drag.lockAxis=c.lockAxis),/^(xy|x|y)$/.test(c.startAxis)&&(this.options.drag.startAxis=c.startAxis),this):P.bool(c)?(this.options.drag.enabled=c,this):this.options.drag},beforeMove:le,move:ie,defaults:{startAxis:"xy",lockAxis:"xy"},getCursor:function(){return"move"},filterEventType:function(c){return c.search("drag")===0}},Ae=Oe,fe={init:function(c){var l=c;fe.document=l.document,fe.DocumentFragment=l.DocumentFragment||_e,fe.SVGElement=l.SVGElement||_e,fe.SVGSVGElement=l.SVGSVGElement||_e,fe.SVGElementInstance=l.SVGElementInstance||_e,fe.Element=l.Element||_e,fe.HTMLElement=l.HTMLElement||fe.Element,fe.Event=l.Event,fe.Touch=l.Touch||_e,fe.PointerEvent=l.PointerEvent||l.MSPointerEvent},document:null,DocumentFragment:null,SVGElement:null,SVGSVGElement:null,SVGElementInstance:null,Element:null,HTMLElement:null,Event:null,Touch:null,PointerEvent:null};function _e(){}var ae=fe,W={init:function(c){var l=ae.Element,d=c.navigator||{};W.supportsTouch="ontouchstart"in c||P.func(c.DocumentTouch)&&ae.document instanceof c.DocumentTouch,W.supportsPointerEvent=d.pointerEnabled!==!1&&!!ae.PointerEvent,W.isIOS=/iP(hone|od|ad)/.test(d.platform),W.isIOS7=/iP(hone|od|ad)/.test(d.platform)&&/OS 7[^\d]/.test(d.appVersion),W.isIe9=/MSIE 9/.test(d.userAgent),W.isOperaMobile=d.appName==="Opera"&&W.supportsTouch&&/Presto/.test(d.userAgent),W.prefixedMatchesSelector="matches"in l.prototype?"matches":"webkitMatchesSelector"in l.prototype?"webkitMatchesSelector":"mozMatchesSelector"in l.prototype?"mozMatchesSelector":"oMatchesSelector"in l.prototype?"oMatchesSelector":"msMatchesSelector",W.pEventTypes=W.supportsPointerEvent?ae.PointerEvent===c.MSPointerEvent?{up:"MSPointerUp",down:"MSPointerDown",over:"mouseover",out:"mouseout",move:"MSPointerMove",cancel:"MSPointerCancel"}:{up:"pointerup",down:"pointerdown",over:"pointerover",out:"pointerout",move:"pointermove",cancel:"pointercancel"}:null,W.wheelEvent=ae.document&&"onmousewheel"in ae.document?"mousewheel":"wheel"},supportsTouch:null,supportsPointerEvent:null,isIOS7:null,isIOS:null,isIe9:null,isOperaMobile:null,prefixedMatchesSelector:null,pEventTypes:null,wheelEvent:null},re=W;function Q(c,l){if(c.contains)return c.contains(l);for(;l;){if(l===c)return!0;l=l.parentNode}return!1}function X(c,l){for(;P.element(c);){if(pe(c,l))return c;c=ye(c)}return null}function ye(c){var l=c.parentNode;if(P.docFrag(l)){for(;(l=l.host)&&P.docFrag(l););return l}return l}function pe(c,l){return V!==I&&(l=l.replace(/\/deep\//g," ")),c[re.prefixedMatchesSelector](l)}var Z=function(c){return c.parentNode||c.host};function oe(c,l){for(var d,h=[],_=c;(d=Z(_))&&_!==l&&d!==_.ownerDocument;)h.unshift(_),_=d;return h}function be(c,l,d){for(;P.element(c);){if(pe(c,l))return!0;if((c=ye(c))===d)return pe(c,l)}return!1}function ve(c){return c.correspondingUseElement||c}function he(c){var l=c instanceof ae.SVGElement?c.getBoundingClientRect():c.getClientRects()[0];return l&&{left:l.left,right:l.right,top:l.top,bottom:l.bottom,width:l.width||l.right-l.left,height:l.height||l.bottom-l.top}}function te(c){var l,d=he(c);if(!re.isIOS7&&d){var h={x:(l=(l=M(c))||V).scrollX||l.document.documentElement.scrollLeft,y:l.scrollY||l.document.documentElement.scrollTop};d.left+=h.x,d.right+=h.x,d.top+=h.y,d.bottom+=h.y}return d}function K(c){for(var l=[];c;)l.push(c),c=ye(c);return l}function ee(c){return!!P.string(c)&&(ae.document.querySelector(c),!0)}function F(c,l){for(var d in l)c[d]=l[d];return c}function J(c,l,d){return c==="parent"?ye(d):c==="self"?l.getRect(d):X(d,c)}function Y(c,l,d,h){var _=c;return P.string(_)?_=J(_,l,d):P.func(_)&&(_=_.apply(void 0,h)),P.element(_)&&(_=te(_)),_}function L(c){return c&&{x:"x"in c?c.x:c.left,y:"y"in c?c.y:c.top}}function C(c){return!c||"x"in c&&"y"in c||((c=F({},c)).x=c.left||0,c.y=c.top||0,c.width=c.width||(c.right||0)-c.x,c.height=c.height||(c.bottom||0)-c.y),c}function G(c,l,d){c.left&&(l.left+=d.x),c.right&&(l.right+=d.x),c.top&&(l.top+=d.y),c.bottom&&(l.bottom+=d.y),l.width=l.right-l.left,l.height=l.bottom-l.top}function de(c,l,d){var h=d&&c.options[d];return L(Y(h&&h.origin||c.options.origin,c,l,[c&&l]))||{x:0,y:0}}function Se(c,l){var d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(H){return!0},h=arguments.length>3?arguments[3]:void 0;if(h=h||{},P.string(c)&&c.search(" ")!==-1&&(c=Le(c)),P.array(c))return c.forEach(function(H){return Se(H,l,d,h)}),h;if(P.object(c)&&(l=c,c=""),P.func(l)&&d(c))h[c]=h[c]||[],h[c].push(l);else if(P.array(l))for(var _=0,w=l;_<w.length;_++){var A=w[_];Se(c,A,d,h)}else if(P.object(l))for(var B in l)Se(Le(B).map(function(H){return"".concat(c).concat(H)}),l[B],d,h);return h}function Le(c){return c.trim().split(/ +/)}var N=function(c,l){return Math.sqrt(c*c+l*l)},T=["webkit","moz"];function j(c,l){c.__set||(c.__set={});var d=function(_){if(T.some(function(w){return _.indexOf(w)===0}))return 1;typeof c[_]!="function"&&_!=="__set"&&Object.defineProperty(c,_,{get:function(){return _ in c.__set?c.__set[_]:c.__set[_]=l[_]},set:function(w){c.__set[_]=w},configurable:!0})};for(var h in l)d(h);return c}function ne(c,l){c.page=c.page||{},c.page.x=l.page.x,c.page.y=l.page.y,c.client=c.client||{},c.client.x=l.client.x,c.client.y=l.client.y,c.timeStamp=l.timeStamp}function Pe(c){c.page.x=0,c.page.y=0,c.client.x=0,c.client.y=0}function De(c){return c instanceof ae.Event||c instanceof ae.Touch}function se(c,l,d){return c=c||"page",(d=d||{}).x=l[c+"X"],d.y=l[c+"Y"],d}function Te(c,l){return l=l||{x:0,y:0},re.isOperaMobile&&De(c)?(se("screen",c,l),l.x+=window.scrollX,l.y+=window.scrollY):se("page",c,l),l}function qe(c){return P.number(c.pointerId)?c.pointerId:c.identifier}function et(c,l,d){var h=l.length>1?ft(l):l[0];Te(h,c.page),function(_,w){w=w||{},re.isOperaMobile&&De(_)?se("screen",_,w):se("client",_,w)}(h,c.client),c.timeStamp=d}function ot(c){var l=[];return P.array(c)?(l[0]=c[0],l[1]=c[1]):c.type==="touchend"?c.touches.length===1?(l[0]=c.touches[0],l[1]=c.changedTouches[0]):c.touches.length===0&&(l[0]=c.changedTouches[0],l[1]=c.changedTouches[1]):(l[0]=c.touches[0],l[1]=c.touches[1]),l}function ft(c){for(var l={pageX:0,pageY:0,clientX:0,clientY:0,screenX:0,screenY:0},d=0;d<c.length;d++){var h=c[d];for(var _ in l)l[_]+=h[_]}for(var w in l)l[w]/=c.length;return l}function bt(c){if(!c.length)return null;var l=ot(c),d=Math.min(l[0].pageX,l[1].pageX),h=Math.min(l[0].pageY,l[1].pageY),_=Math.max(l[0].pageX,l[1].pageX),w=Math.max(l[0].pageY,l[1].pageY);return{x:d,y:h,left:d,top:h,right:_,bottom:w,width:_-d,height:w-h}}function Mt(c,l){var d=l+"X",h=l+"Y",_=ot(c),w=_[0][d]-_[1][d],A=_[0][h]-_[1][h];return N(w,A)}function Vt(c,l){var d=l+"X",h=l+"Y",_=ot(c),w=_[1][d]-_[0][d],A=_[1][h]-_[0][h];return 180*Math.atan2(A,w)/Math.PI}function An(c){return P.string(c.pointerType)?c.pointerType:P.number(c.pointerType)?[void 0,void 0,"touch","pen","mouse"][c.pointerType]:/touch/.test(c.type||"")||c instanceof ae.Touch?"touch":"mouse"}function ao(c){var l=P.func(c.composedPath)?c.composedPath():c.path;return[ve(l?l[0]:c.target),ve(c.currentTarget)]}var an=function(){function c(l){r(this,c),this.immediatePropagationStopped=!1,this.propagationStopped=!1,this._interaction=l}return u(c,[{key:"preventDefault",value:function(){}},{key:"stopPropagation",value:function(){this.propagationStopped=!0}},{key:"stopImmediatePropagation",value:function(){this.immediatePropagationStopped=this.propagationStopped=!0}}]),c}();Object.defineProperty(an.prototype,"interaction",{get:function(){return this._interaction._proxy},set:function(){}});var hn=function(c,l){for(var d=0;d<l.length;d++){var h=l[d];c.push(h)}return c},Jn=function(c){return hn([],c)},wo=function(c,l){for(var d=0;d<c.length;d++)if(l(c[d],d,c))return d;return-1},dt=function(c,l){return c[wo(c,l)]},Ne=function(c){m(d,c);var l=b(d);function d(h,_,w){var A;r(this,d),(A=l.call(this,_._interaction)).dropzone=void 0,A.dragEvent=void 0,A.relatedTarget=void 0,A.draggable=void 0,A.propagationStopped=!1,A.immediatePropagationStopped=!1;var B=w==="dragleave"?h.prev:h.cur,H=B.element,ge=B.dropzone;return A.type=w,A.target=H,A.currentTarget=H,A.dropzone=ge,A.dragEvent=_,A.relatedTarget=_.target,A.draggable=_.interactable,A.timeStamp=_.timeStamp,A}return u(d,[{key:"reject",value:function(){var h=this,_=this._interaction.dropState;if(this.type==="dropactivate"||this.dropzone&&_.cur.dropzone===this.dropzone&&_.cur.element===this.target)if(_.prev.dropzone=this.dropzone,_.prev.element=this.target,_.rejected=!0,_.events.enter=null,this.stopImmediatePropagation(),this.type==="dropactivate"){var w=_.activeDrops,A=wo(w,function(H){var ge=H.dropzone,q=H.element;return ge===h.dropzone&&q===h.target});_.activeDrops.splice(A,1);var B=new d(_,this.dragEvent,"dropdeactivate");B.dropzone=this.dropzone,B.target=this.target,this.dropzone.fire(B)}else this.dropzone.fire(new d(_,this.dragEvent,"dragleave"))}},{key:"preventDefault",value:function(){}},{key:"stopPropagation",value:function(){this.propagationStopped=!0}},{key:"stopImmediatePropagation",value:function(){this.immediatePropagationStopped=this.propagationStopped=!0}}]),d}(an);function Ue(c,l){for(var d=0,h=c.slice();d<h.length;d++){var _=h[d],w=_.dropzone,A=_.element;l.dropzone=w,l.target=A,w.fire(l),l.propagationStopped=l.immediatePropagationStopped=!1}}function Ot(c,l){for(var d=function(w,A){for(var B=[],H=0,ge=w.interactables.list;H<ge.length;H++){var q=ge[H];if(q.options.drop.enabled){var we=q.options.drop.accept;if(!(P.element(we)&&we!==A||P.string(we)&&!pe(A,we)||P.func(we)&&!we({dropzone:q,draggableElement:A})))for(var Be=0,He=q.getAllElements();Be<He.length;Be++){var Ve=He[Be];Ve!==A&&B.push({dropzone:q,element:Ve,rect:q.getRect(Ve)})}}}return B}(c,l),h=0;h<d.length;h++){var _=d[h];_.rect=_.dropzone.getRect(_.element)}return d}function En(c,l,d){for(var h=c.dropState,_=c.interactable,w=c.element,A=[],B=0,H=h.activeDrops;B<H.length;B++){var ge=H[B],q=ge.dropzone,we=ge.element,Be=ge.rect,He=q.dropCheck(l,d,_,w,we,Be);A.push(He?we:null)}var Ve=function(Ge){for(var tt,Xe,at,wt=[],It=0;It<Ge.length;It++){var pt=Ge[It],St=Ge[tt];if(pt&&It!==tt)if(St){var Xn=Z(pt),pn=Z(St);if(Xn!==pt.ownerDocument)if(pn!==pt.ownerDocument)if(Xn!==pn){wt=wt.length?wt:oe(St);var mo=void 0;if(St instanceof ae.HTMLElement&&pt instanceof ae.SVGElement&&!(pt instanceof ae.SVGSVGElement)){if(pt===pn)continue;mo=pt.ownerSVGElement}else mo=pt;for(var Do=oe(mo,St.ownerDocument),_a=0;Do[_a]&&Do[_a]===wt[_a];)_a++;var Nl=[Do[_a-1],Do[_a],wt[_a]];if(Nl[0])for(var as=Nl[0].lastChild;as;){if(as===Nl[1]){tt=It,wt=Do;break}if(as===Nl[2])break;as=as.previousSibling}}else at=St,(parseInt(M(Xe=pt).getComputedStyle(Xe).zIndex,10)||0)>=(parseInt(M(at).getComputedStyle(at).zIndex,10)||0)&&(tt=It);else tt=It}else tt=It}return tt}(A);return h.activeDrops[Ve]||null}function Ba(c,l,d){var h=c.dropState,_={enter:null,leave:null,activate:null,deactivate:null,move:null,drop:null};return d.type==="dragstart"&&(_.activate=new Ne(h,d,"dropactivate"),_.activate.target=null,_.activate.dropzone=null),d.type==="dragend"&&(_.deactivate=new Ne(h,d,"dropdeactivate"),_.deactivate.target=null,_.deactivate.dropzone=null),h.rejected||(h.cur.element!==h.prev.element&&(h.prev.dropzone&&(_.leave=new Ne(h,d,"dragleave"),d.dragLeave=_.leave.target=h.prev.element,d.prevDropzone=_.leave.dropzone=h.prev.dropzone),h.cur.dropzone&&(_.enter=new Ne(h,d,"dragenter"),d.dragEnter=h.cur.element,d.dropzone=h.cur.dropzone)),d.type==="dragend"&&h.cur.dropzone&&(_.drop=new Ne(h,d,"drop"),d.dropzone=h.cur.dropzone,d.relatedTarget=h.cur.element),d.type==="dragmove"&&h.cur.dropzone&&(_.move=new Ne(h,d,"dropmove"),d.dropzone=h.cur.dropzone)),_}function pa(c,l){var d=c.dropState,h=d.activeDrops,_=d.cur,w=d.prev;l.leave&&w.dropzone.fire(l.leave),l.enter&&_.dropzone.fire(l.enter),l.move&&_.dropzone.fire(l.move),l.drop&&_.dropzone.fire(l.drop),l.deactivate&&Ue(h,l.deactivate),d.prev.dropzone=_.dropzone,d.prev.element=_.element}function Ua(c,l){var d=c.interaction,h=c.iEvent,_=c.event;if(h.type==="dragmove"||h.type==="dragend"){var w=d.dropState;l.dynamicDrop&&(w.activeDrops=Ot(l,d.element));var A=h,B=En(d,A,_);w.rejected=w.rejected&&!!B&&B.dropzone===w.cur.dropzone&&B.element===w.cur.element,w.cur.dropzone=B&&B.dropzone,w.cur.element=B&&B.element,w.events=Ba(d,0,A)}}var qr={id:"actions/drop",install:function(c){var l=c.actions,d=c.interactStatic,h=c.Interactable,_=c.defaults;c.usePlugin(Ae),h.prototype.dropzone=function(w){return function(A,B){if(P.object(B)){if(A.options.drop.enabled=B.enabled!==!1,B.listeners){var H=Se(B.listeners),ge=Object.keys(H).reduce(function(we,Be){return we[/^(enter|leave)/.test(Be)?"drag".concat(Be):/^(activate|deactivate|move)/.test(Be)?"drop".concat(Be):Be]=H[Be],we},{}),q=A.options.drop.listeners;q&&A.off(q),A.on(ge),A.options.drop.listeners=ge}return P.func(B.ondrop)&&A.on("drop",B.ondrop),P.func(B.ondropactivate)&&A.on("dropactivate",B.ondropactivate),P.func(B.ondropdeactivate)&&A.on("dropdeactivate",B.ondropdeactivate),P.func(B.ondragenter)&&A.on("dragenter",B.ondragenter),P.func(B.ondragleave)&&A.on("dragleave",B.ondragleave),P.func(B.ondropmove)&&A.on("dropmove",B.ondropmove),/^(pointer|center)$/.test(B.overlap)?A.options.drop.overlap=B.overlap:P.number(B.overlap)&&(A.options.drop.overlap=Math.max(Math.min(1,B.overlap),0)),"accept"in B&&(A.options.drop.accept=B.accept),"checker"in B&&(A.options.drop.checker=B.checker),A}return P.bool(B)?(A.options.drop.enabled=B,A):A.options.drop}(this,w)},h.prototype.dropCheck=function(w,A,B,H,ge,q){return function(we,Be,He,Ve,Ge,tt,Xe){var at=!1;if(!(Xe=Xe||we.getRect(tt)))return!!we.options.drop.checker&&we.options.drop.checker(Be,He,at,we,tt,Ve,Ge);var wt=we.options.drop.overlap;if(wt==="pointer"){var It=de(Ve,Ge,"drag"),pt=Te(Be);pt.x+=It.x,pt.y+=It.y;var St=pt.x>Xe.left&&pt.x<Xe.right,Xn=pt.y>Xe.top&&pt.y<Xe.bottom;at=St&&Xn}var pn=Ve.getRect(Ge);if(pn&&wt==="center"){var mo=pn.left+pn.width/2,Do=pn.top+pn.height/2;at=mo>=Xe.left&&mo<=Xe.right&&Do>=Xe.top&&Do<=Xe.bottom}return pn&&P.number(wt)&&(at=Math.max(0,Math.min(Xe.right,pn.right)-Math.max(Xe.left,pn.left))*Math.max(0,Math.min(Xe.bottom,pn.bottom)-Math.max(Xe.top,pn.top))/(pn.width*pn.height)>=wt),we.options.drop.checker&&(at=we.options.drop.checker(Be,He,at,we,tt,Ve,Ge)),at}(this,w,A,B,H,ge,q)},d.dynamicDrop=function(w){return P.bool(w)?(c.dynamicDrop=w,d):c.dynamicDrop},F(l.phaselessTypes,{dragenter:!0,dragleave:!0,dropactivate:!0,dropdeactivate:!0,dropmove:!0,drop:!0}),l.methodDict.drop="dropzone",c.dynamicDrop=!1,_.actions.drop=qr.defaults},listeners:{"interactions:before-action-start":function(c){var l=c.interaction;l.prepared.name==="drag"&&(l.dropState={cur:{dropzone:null,element:null},prev:{dropzone:null,element:null},rejected:null,events:null,activeDrops:[]})},"interactions:after-action-start":function(c,l){var d=c.interaction,h=(c.event,c.iEvent);if(d.prepared.name==="drag"){var _=d.dropState;_.activeDrops=[],_.events={},_.activeDrops=Ot(l,d.element),_.events=Ba(d,0,h),_.events.activate&&(Ue(_.activeDrops,_.events.activate),l.fire("actions/drop:start",{interaction:d,dragEvent:h}))}},"interactions:action-move":Ua,"interactions:after-action-move":function(c,l){var d=c.interaction,h=c.iEvent;if(d.prepared.name==="drag"){var _=d.dropState;pa(d,_.events),l.fire("actions/drop:move",{interaction:d,dragEvent:h}),_.events={}}},"interactions:action-end":function(c,l){if(c.interaction.prepared.name==="drag"){var d=c.interaction,h=c.iEvent;Ua(c,l),pa(d,d.dropState.events),l.fire("actions/drop:end",{interaction:d,dragEvent:h})}},"interactions:stop":function(c){var l=c.interaction;if(l.prepared.name==="drag"){var d=l.dropState;d&&(d.activeDrops=null,d.events=null,d.cur.dropzone=null,d.cur.element=null,d.prev.dropzone=null,d.prev.element=null,d.rejected=!1)}}},getActiveDrops:Ot,getDrop:En,getDropEvents:Ba,fireDropEvents:pa,filterEventType:function(c){return c.search("drag")===0||c.search("drop")===0},defaults:{enabled:!1,accept:null,overlap:"pointer"}},qi=qr;function fa(c){var l=c.interaction,d=c.iEvent,h=c.phase;if(l.prepared.name==="gesture"){var _=l.pointers.map(function(ge){return ge.pointer}),w=h==="start",A=h==="end",B=l.interactable.options.deltaSource;if(d.touches=[_[0],_[1]],w)d.distance=Mt(_,B),d.box=bt(_),d.scale=1,d.ds=0,d.angle=Vt(_,B),d.da=0,l.gesture.startDistance=d.distance,l.gesture.startAngle=d.angle;else if(A||l.pointers.length<2){var H=l.prevEvent;d.distance=H.distance,d.box=H.box,d.scale=H.scale,d.ds=0,d.angle=H.angle,d.da=0}else d.distance=Mt(_,B),d.box=bt(_),d.scale=d.distance/l.gesture.startDistance,d.angle=Vt(_,B),d.ds=d.scale-l.gesture.scale,d.da=d.angle-l.gesture.angle;l.gesture.distance=d.distance,l.gesture.angle=d.angle,P.number(d.scale)&&d.scale!==1/0&&!isNaN(d.scale)&&(l.gesture.scale=d.scale)}}var Vo={id:"actions/gesture",before:["actions/drag","actions/resize"],install:function(c){var l=c.actions,d=c.Interactable,h=c.defaults;d.prototype.gesturable=function(_){return P.object(_)?(this.options.gesture.enabled=_.enabled!==!1,this.setPerAction("gesture",_),this.setOnEvents("gesture",_),this):P.bool(_)?(this.options.gesture.enabled=_,this):this.options.gesture},l.map.gesture=Vo,l.methodDict.gesture="gesturable",h.actions.gesture=Vo.defaults},listeners:{"interactions:action-start":fa,"interactions:action-move":fa,"interactions:action-end":fa,"interactions:new":function(c){c.interaction.gesture={angle:0,distance:0,scale:1,startAngle:0,startDistance:0}},"auto-start:check":function(c){if(!(c.interaction.pointers.length<2)){var l=c.interactable.options.gesture;if(l&&l.enabled)return c.action={name:"gesture"},!1}}},defaults:{},getCursor:function(){return""},filterEventType:function(c){return c.search("gesture")===0}},za=Vo;function Yr(c,l,d,h,_,w,A){if(!l)return!1;if(l===!0){var B=P.number(w.width)?w.width:w.right-w.left,H=P.number(w.height)?w.height:w.bottom-w.top;if(A=Math.min(A,Math.abs((c==="left"||c==="right"?B:H)/2)),B<0&&(c==="left"?c="right":c==="right"&&(c="left")),H<0&&(c==="top"?c="bottom":c==="bottom"&&(c="top")),c==="left"){var ge=B>=0?w.left:w.right;return d.x<ge+A}if(c==="top"){var q=H>=0?w.top:w.bottom;return d.y<q+A}if(c==="right")return d.x>(B>=0?w.right:w.left)-A;if(c==="bottom")return d.y>(H>=0?w.bottom:w.top)-A}return!!P.element(h)&&(P.element(l)?l===h:be(h,l,_))}function xo(c){var l=c.iEvent,d=c.interaction;if(d.prepared.name==="resize"&&d.resizeAxes){var h=l;d.interactable.options.resize.square?(d.resizeAxes==="y"?h.delta.x=h.delta.y:h.delta.y=h.delta.x,h.axes="xy"):(h.axes=d.resizeAxes,d.resizeAxes==="x"?h.delta.y=0:d.resizeAxes==="y"&&(h.delta.x=0))}}var Fn,en,ro={id:"actions/resize",before:["actions/drag"],install:function(c){var l=c.actions,d=c.browser,h=c.Interactable,_=c.defaults;ro.cursors=function(w){return w.isIe9?{x:"e-resize",y:"s-resize",xy:"se-resize",top:"n-resize",left:"w-resize",bottom:"s-resize",right:"e-resize",topleft:"se-resize",bottomright:"se-resize",topright:"ne-resize",bottomleft:"ne-resize"}:{x:"ew-resize",y:"ns-resize",xy:"nwse-resize",top:"ns-resize",left:"ew-resize",bottom:"ns-resize",right:"ew-resize",topleft:"nwse-resize",bottomright:"nwse-resize",topright:"nesw-resize",bottomleft:"nesw-resize"}}(d),ro.defaultMargin=d.supportsTouch||d.supportsPointerEvent?20:10,h.prototype.resizable=function(w){return function(A,B,H){return P.object(B)?(A.options.resize.enabled=B.enabled!==!1,A.setPerAction("resize",B),A.setOnEvents("resize",B),P.string(B.axis)&&/^x$|^y$|^xy$/.test(B.axis)?A.options.resize.axis=B.axis:B.axis===null&&(A.options.resize.axis=H.defaults.actions.resize.axis),P.bool(B.preserveAspectRatio)?A.options.resize.preserveAspectRatio=B.preserveAspectRatio:P.bool(B.square)&&(A.options.resize.square=B.square),A):P.bool(B)?(A.options.resize.enabled=B,A):A.options.resize}(this,w,c)},l.map.resize=ro,l.methodDict.resize="resizable",_.actions.resize=ro.defaults},listeners:{"interactions:new":function(c){c.interaction.resizeAxes="xy"},"interactions:action-start":function(c){(function(l){var d=l.iEvent,h=l.interaction;if(h.prepared.name==="resize"&&h.prepared.edges){var _=d,w=h.rect;h._rects={start:F({},w),corrected:F({},w),previous:F({},w),delta:{left:0,right:0,width:0,top:0,bottom:0,height:0}},_.edges=h.prepared.edges,_.rect=h._rects.corrected,_.deltaRect=h._rects.delta}})(c),xo(c)},"interactions:action-move":function(c){(function(l){var d=l.iEvent,h=l.interaction;if(h.prepared.name==="resize"&&h.prepared.edges){var _=d,w=h.interactable.options.resize.invert,A=w==="reposition"||w==="negate",B=h.rect,H=h._rects,ge=H.start,q=H.corrected,we=H.delta,Be=H.previous;if(F(Be,q),A){if(F(q,B),w==="reposition"){if(q.top>q.bottom){var He=q.top;q.top=q.bottom,q.bottom=He}if(q.left>q.right){var Ve=q.left;q.left=q.right,q.right=Ve}}}else q.top=Math.min(B.top,ge.bottom),q.bottom=Math.max(B.bottom,ge.top),q.left=Math.min(B.left,ge.right),q.right=Math.max(B.right,ge.left);for(var Ge in q.width=q.right-q.left,q.height=q.bottom-q.top,q)we[Ge]=q[Ge]-Be[Ge];_.edges=h.prepared.edges,_.rect=q,_.deltaRect=we}})(c),xo(c)},"interactions:action-end":function(c){var l=c.iEvent,d=c.interaction;if(d.prepared.name==="resize"&&d.prepared.edges){var h=l;h.edges=d.prepared.edges,h.rect=d._rects.corrected,h.deltaRect=d._rects.delta}},"auto-start:check":function(c){var l=c.interaction,d=c.interactable,h=c.element,_=c.rect,w=c.buttons;if(_){var A=F({},l.coords.cur.page),B=d.options.resize;if(B&&B.enabled&&(!l.pointerIsDown||!/mouse|pointer/.test(l.pointerType)||(w&B.mouseButtons)!=0)){if(P.object(B.edges)){var H={left:!1,right:!1,top:!1,bottom:!1};for(var ge in H)H[ge]=Yr(ge,B.edges[ge],A,l._latestPointer.eventTarget,h,_,B.margin||ro.defaultMargin);H.left=H.left&&!H.right,H.top=H.top&&!H.bottom,(H.left||H.right||H.top||H.bottom)&&(c.action={name:"resize",edges:H})}else{var q=B.axis!=="y"&&A.x>_.right-ro.defaultMargin,we=B.axis!=="x"&&A.y>_.bottom-ro.defaultMargin;(q||we)&&(c.action={name:"resize",axes:(q?"x":"")+(we?"y":"")})}return!c.action&&void 0}}}},defaults:{square:!1,preserveAspectRatio:!1,axis:"xy",margin:NaN,edges:null,invert:"none"},cursors:null,getCursor:function(c){var l=c.edges,d=c.axis,h=c.name,_=ro.cursors,w=null;if(d)w=_[h+d];else if(l){for(var A="",B=0,H=["top","bottom","left","right"];B<H.length;B++){var ge=H[B];l[ge]&&(A+=ge)}w=_[A]}return w},filterEventType:function(c){return c.search("resize")===0},defaultMargin:null},Ao=ro,Bn={id:"actions",install:function(c){c.usePlugin(za),c.usePlugin(Ao),c.usePlugin(Ae),c.usePlugin(qi)}},Wo=0,io={request:function(c){return Fn(c)},cancel:function(c){return en(c)},init:function(c){if(Fn=c.requestAnimationFrame,en=c.cancelAnimationFrame,!Fn)for(var l=["ms","moz","webkit","o"],d=0;d<l.length;d++){var h=l[d];Fn=c["".concat(h,"RequestAnimationFrame")],en=c["".concat(h,"CancelAnimationFrame")]||c["".concat(h,"CancelRequestAnimationFrame")]}Fn=Fn&&Fn.bind(c),en=en&&en.bind(c),Fn||(Fn=function(_){var w=Date.now(),A=Math.max(0,16-(w-Wo)),B=c.setTimeout(function(){_(w+A)},A);return Wo=w+A,B},en=function(_){return clearTimeout(_)})}},ct={defaults:{enabled:!1,margin:60,container:null,speed:300},now:Date.now,interaction:null,i:0,x:0,y:0,isScrolling:!1,prevTime:0,margin:0,speed:0,start:function(c){ct.isScrolling=!0,io.cancel(ct.i),c.autoScroll=ct,ct.interaction=c,ct.prevTime=ct.now(),ct.i=io.request(ct.scroll)},stop:function(){ct.isScrolling=!1,ct.interaction&&(ct.interaction.autoScroll=null),io.cancel(ct.i)},scroll:function(){var c=ct.interaction,l=c.interactable,d=c.element,h=c.prepared.name,_=l.options[h].autoScroll,w=So(_.container,l,d),A=ct.now(),B=(A-ct.prevTime)/1e3,H=_.speed*B;if(H>=1){var ge={x:ct.x*H,y:ct.y*H};if(ge.x||ge.y){var q=jo(w);P.window(w)?w.scrollBy(ge.x,ge.y):w&&(w.scrollLeft+=ge.x,w.scrollTop+=ge.y);var we=jo(w),Be={x:we.x-q.x,y:we.y-q.y};(Be.x||Be.y)&&l.fire({type:"autoscroll",target:d,interactable:l,delta:Be,interaction:c,container:w})}ct.prevTime=A}ct.isScrolling&&(io.cancel(ct.i),ct.i=io.request(ct.scroll))},check:function(c,l){var d;return(d=c.options[l].autoScroll)==null?void 0:d.enabled},onInteractionMove:function(c){var l=c.interaction,d=c.pointer;if(l.interacting()&&ct.check(l.interactable,l.prepared.name))if(l.simulation)ct.x=ct.y=0;else{var h,_,w,A,B=l.interactable,H=l.element,ge=l.prepared.name,q=B.options[ge].autoScroll,we=So(q.container,B,H);if(P.window(we))A=d.clientX<ct.margin,h=d.clientY<ct.margin,_=d.clientX>we.innerWidth-ct.margin,w=d.clientY>we.innerHeight-ct.margin;else{var Be=he(we);A=d.clientX<Be.left+ct.margin,h=d.clientY<Be.top+ct.margin,_=d.clientX>Be.right-ct.margin,w=d.clientY>Be.bottom-ct.margin}ct.x=_?1:A?-1:0,ct.y=w?1:h?-1:0,ct.isScrolling||(ct.margin=q.margin,ct.speed=q.speed,ct.start(l))}}};function So(c,l,d){return(P.string(c)?J(c,l,d):c)||M(d)}function jo(c){return P.window(c)&&(c=window.document.body),{x:c.scrollLeft,y:c.scrollTop}}var Kr={id:"auto-scroll",install:function(c){var l=c.defaults,d=c.actions;c.autoScroll=ct,ct.now=function(){return c.now()},d.phaselessTypes.autoscroll=!0,l.perAction.autoScroll=ct.defaults},listeners:{"interactions:new":function(c){c.interaction.autoScroll=null},"interactions:destroy":function(c){c.interaction.autoScroll=null,ct.stop(),ct.interaction&&(ct.interaction=null)},"interactions:stop":ct.stop,"interactions:action-move":function(c){return ct.onInteractionMove(c)}}},Jr=Kr;function ga(c,l){var d=!1;return function(){return d||(V.console.warn(l),d=!0),c.apply(this,arguments)}}function ur(c,l){return c.name=l.name,c.axis=l.axis,c.edges=l.edges,c}function cr(c){return P.bool(c)?(this.options.styleCursor=c,this):c===null?(delete this.options.styleCursor,this):this.options.styleCursor}function Yi(c){return P.func(c)?(this.options.actionChecker=c,this):c===null?(delete this.options.actionChecker,this):this.options.actionChecker}var Ee={id:"auto-start/interactableMethods",install:function(c){var l=c.Interactable;l.prototype.getAction=function(d,h,_,w){var A=function(B,H,ge,q,we){var Be=B.getRect(q),He=H.buttons||{0:1,1:4,3:8,4:16}[H.button],Ve={action:null,interactable:B,interaction:ge,element:q,rect:Be,buttons:He};return we.fire("auto-start:check",Ve),Ve.action}(this,h,_,w,c);return this.options.actionChecker?this.options.actionChecker(d,h,A,this,w,_):A},l.prototype.ignoreFrom=ga(function(d){return this._backCompatOption("ignoreFrom",d)},"Interactable.ignoreFrom() has been deprecated. Use Interactble.draggable({ignoreFrom: newValue})."),l.prototype.allowFrom=ga(function(d){return this._backCompatOption("allowFrom",d)},"Interactable.allowFrom() has been deprecated. Use Interactble.draggable({allowFrom: newValue})."),l.prototype.actionChecker=Yi,l.prototype.styleCursor=cr}};function ke(c,l,d,h,_){return l.testIgnoreAllow(l.options[c.name],d,h)&&l.options[c.name].enabled&&cn(l,d,c,_)?c:null}function Re(c,l,d,h,_,w,A){for(var B=0,H=h.length;B<H;B++){var ge=h[B],q=_[B],we=ge.getAction(l,d,c,q);if(we){var Be=ke(we,ge,q,w,A);if(Be)return{action:Be,interactable:ge,element:q}}}return{action:null,interactable:null,element:null}}function ht(c,l,d,h,_){var w=[],A=[],B=h;function H(q){w.push(q),A.push(B)}for(;P.element(B);){w=[],A=[],_.interactables.forEachMatch(B,H);var ge=Re(c,l,d,w,A,h,_);if(ge.action&&!ge.interactable.options[ge.action.name].manualStart)return ge;B=ye(B)}return{action:null,interactable:null,element:null}}function rn(c,l,d){var h=l.action,_=l.interactable,w=l.element;h=h||{name:null},c.interactable=_,c.element=w,ur(c.prepared,h),c.rect=_&&h.name?_.getRect(w):null,dr(c,d),d.fire("autoStart:prepared",{interaction:c})}function cn(c,l,d,h){var _=c.options,w=_[d.name].max,A=_[d.name].maxPerElement,B=h.autoStart.maxInteractions,H=0,ge=0,q=0;if(!(w&&A&&B))return!1;for(var we=0,Be=h.interactions.list;we<Be.length;we++){var He=Be[we],Ve=He.prepared.name;if(He.interacting()&&(++H>=B||He.interactable===c&&((ge+=Ve===d.name?1:0)>=w||He.element===l&&(q++,Ve===d.name&&q>=A))))return!1}return B>0}function Dt(c,l){return P.number(c)?(l.autoStart.maxInteractions=c,this):l.autoStart.maxInteractions}function sn(c,l,d){var h=d.autoStart.cursorElement;h&&h!==c&&(h.style.cursor=""),c.ownerDocument.documentElement.style.cursor=l,c.style.cursor=l,d.autoStart.cursorElement=l?c:null}function dr(c,l){var d=c.interactable,h=c.element,_=c.prepared;if(c.pointerType==="mouse"&&d&&d.options.styleCursor){var w="";if(_.name){var A=d.options[_.name].cursorChecker;w=P.func(A)?A(_,d,h,c._interacting):l.actions.map[_.name].getCursor(_)}sn(c.element,w||"",l)}else l.autoStart.cursorElement&&sn(l.autoStart.cursorElement,"",l)}var Un={id:"auto-start/base",before:["actions"],install:function(c){var l=c.interactStatic,d=c.defaults;c.usePlugin(Ee),d.base.actionChecker=null,d.base.styleCursor=!0,F(d.perAction,{manualStart:!1,max:1/0,maxPerElement:1,allowFrom:null,ignoreFrom:null,mouseButtons:1}),l.maxInteractions=function(h){return Dt(h,c)},c.autoStart={maxInteractions:1/0,withinInteractionLimit:cn,cursorElement:null}},listeners:{"interactions:down":function(c,l){var d=c.interaction,h=c.pointer,_=c.event,w=c.eventTarget;d.interacting()||rn(d,ht(d,h,_,w,l),l)},"interactions:move":function(c,l){(function(d,h){var _=d.interaction,w=d.pointer,A=d.event,B=d.eventTarget;_.pointerType!=="mouse"||_.pointerIsDown||_.interacting()||rn(_,ht(_,w,A,B,h),h)})(c,l),function(d,h){var _=d.interaction;if(_.pointerIsDown&&!_.interacting()&&_.pointerWasMoved&&_.prepared.name){h.fire("autoStart:before-start",d);var w=_.interactable,A=_.prepared.name;A&&w&&(w.options[A].manualStart||!cn(w,_.element,_.prepared,h)?_.stop():(_.start(_.prepared,w,_.element),dr(_,h)))}}(c,l)},"interactions:stop":function(c,l){var d=c.interaction,h=d.interactable;h&&h.options.styleCursor&&sn(d.element,"",l)}},maxInteractions:Dt,withinInteractionLimit:cn,validateAction:ke},pr=Un,Xr={id:"auto-start/dragAxis",listeners:{"autoStart:before-start":function(c,l){var d=c.interaction,h=c.eventTarget,_=c.dx,w=c.dy;if(d.prepared.name==="drag"){var A=Math.abs(_),B=Math.abs(w),H=d.interactable.options.drag,ge=H.startAxis,q=A>B?"x":A<B?"y":"xy";if(d.prepared.axis=H.lockAxis==="start"?q[0]:H.lockAxis,q!=="xy"&&ge!=="xy"&&ge!==q){d.prepared.name=null;for(var we=h,Be=function(Ve){if(Ve!==d.interactable){var Ge=d.interactable.options.drag;if(!Ge.manualStart&&Ve.testIgnoreAllow(Ge,we,h)){var tt=Ve.getAction(d.downPointer,d.downEvent,d,we);if(tt&&tt.name==="drag"&&function(Xe,at){if(!at)return!1;var wt=at.options.drag.startAxis;return Xe==="xy"||wt==="xy"||wt===Xe}(q,Ve)&&pr.validateAction(tt,Ve,we,h,l))return Ve}}};P.element(we);){var He=l.interactables.forEachMatch(we,Be);if(He){d.prepared.name="drag",d.interactable=He,d.element=we;break}we=ye(we)}}}}}};function Ki(c){var l=c.prepared&&c.prepared.name;if(!l)return null;var d=c.interactable.options;return d[l].hold||d[l].delay}var Oc={id:"auto-start/hold",install:function(c){var l=c.defaults;c.usePlugin(pr),l.perAction.hold=0,l.perAction.delay=0},listeners:{"interactions:new":function(c){c.interaction.autoStartHoldTimer=null},"autoStart:prepared":function(c){var l=c.interaction,d=Ki(l);d>0&&(l.autoStartHoldTimer=setTimeout(function(){l.start(l.prepared,l.interactable,l.element)},d))},"interactions:move":function(c){var l=c.interaction,d=c.duplicate;l.autoStartHoldTimer&&l.pointerWasMoved&&!d&&(clearTimeout(l.autoStartHoldTimer),l.autoStartHoldTimer=null)},"autoStart:before-start":function(c){var l=c.interaction;Ki(l)>0&&(l.prepared.name=null)}},getHoldDuration:Ki},Va=Oc,bl={id:"auto-start",install:function(c){c.usePlugin(pr),c.usePlugin(Va),c.usePlugin(Xr)}},Rc=function(c){return/^(always|never|auto)$/.test(c)?(this.options.preventDefault=c,this):P.bool(c)?(this.options.preventDefault=c?"always":"never",this):this.options.preventDefault};function Qr(c){var l=c.interaction,d=c.event;l.interactable&&l.interactable.checkAndPreventDefault(d)}var fr={id:"core/interactablePreventDefault",install:function(c){var l=c.Interactable;l.prototype.preventDefault=Rc,l.prototype.checkAndPreventDefault=function(d){return function(h,_,w){var A=h.options.preventDefault;if(A!=="never")if(A!=="always"){if(_.events.supportsPassive&&/^touch(start|move)$/.test(w.type)){var B=M(w.target).document,H=_.getDocOptions(B);if(!H||!H.events||H.events.passive!==!1)return}/^(mouse|pointer|touch)*(down|start)/i.test(w.type)||P.element(w.target)&&pe(w.target,"input,select,textarea,[contenteditable=true],[contenteditable=true] *")||w.preventDefault()}else w.preventDefault()}(this,c,d)},c.interactions.docEvents.push({type:"dragstart",listener:function(d){for(var h=0,_=c.interactions.list;h<_.length;h++){var w=_[h];if(w.element&&(w.element===d.target||Q(w.element,d.target)))return void w.interactable.checkAndPreventDefault(d)}}})},listeners:["down","move","up","cancel"].reduce(function(c,l){return c["interactions:".concat(l)]=Qr,c},{})};function go(c,l){if(l.phaselessTypes[c])return!0;for(var d in l.map)if(c.indexOf(d)===0&&c.substr(d.length)in l.phases)return!0;return!1}function ma(c){var l={};for(var d in c){var h=c[d];P.plainObject(h)?l[d]=ma(h):P.array(h)?l[d]=Jn(h):l[d]=h}return l}var Zr=function(){function c(l){r(this,c),this.states=[],this.startOffset={left:0,right:0,top:0,bottom:0},this.startDelta=void 0,this.result=void 0,this.endResult=void 0,this.startEdges=void 0,this.edges=void 0,this.interaction=void 0,this.interaction=l,this.result=ha(),this.edges={left:!1,right:!1,top:!1,bottom:!1}}return u(c,[{key:"start",value:function(l,d){var h,_,w=l.phase,A=this.interaction,B=function(ge){var q=ge.interactable.options[ge.prepared.name],we=q.modifiers;return we&&we.length?we:["snap","snapSize","snapEdges","restrict","restrictEdges","restrictSize"].map(function(Be){var He=q[Be];return He&&He.enabled&&{options:He,methods:He._methods}}).filter(function(Be){return!!Be})}(A);this.prepareStates(B),this.startEdges=F({},A.edges),this.edges=F({},this.startEdges),this.startOffset=(h=A.rect,_=d,h?{left:_.x-h.left,top:_.y-h.top,right:h.right-_.x,bottom:h.bottom-_.y}:{left:0,top:0,right:0,bottom:0}),this.startDelta={x:0,y:0};var H=this.fillArg({phase:w,pageCoords:d,preEnd:!1});return this.result=ha(),this.startAll(H),this.result=this.setAll(H)}},{key:"fillArg",value:function(l){var d=this.interaction;return l.interaction=d,l.interactable=d.interactable,l.element=d.element,l.rect||(l.rect=d.rect),l.edges||(l.edges=this.startEdges),l.startOffset=this.startOffset,l}},{key:"startAll",value:function(l){for(var d=0,h=this.states;d<h.length;d++){var _=h[d];_.methods.start&&(l.state=_,_.methods.start(l))}}},{key:"setAll",value:function(l){var d=l.phase,h=l.preEnd,_=l.skipModifiers,w=l.rect,A=l.edges;l.coords=F({},l.pageCoords),l.rect=F({},w),l.edges=F({},A);for(var B=_?this.states.slice(_):this.states,H=ha(l.coords,l.rect),ge=0;ge<B.length;ge++){var q,we=B[ge],Be=we.options,He=F({},l.coords),Ve=null;(q=we.methods)!=null&&q.set&&this.shouldDo(Be,h,d)&&(l.state=we,Ve=we.methods.set(l),G(l.edges,l.rect,{x:l.coords.x-He.x,y:l.coords.y-He.y})),H.eventProps.push(Ve)}F(this.edges,l.edges),H.delta.x=l.coords.x-l.pageCoords.x,H.delta.y=l.coords.y-l.pageCoords.y,H.rectDelta.left=l.rect.left-w.left,H.rectDelta.right=l.rect.right-w.right,H.rectDelta.top=l.rect.top-w.top,H.rectDelta.bottom=l.rect.bottom-w.bottom;var Ge=this.result.coords,tt=this.result.rect;if(Ge&&tt){var Xe=H.rect.left!==tt.left||H.rect.right!==tt.right||H.rect.top!==tt.top||H.rect.bottom!==tt.bottom;H.changed=Xe||Ge.x!==H.coords.x||Ge.y!==H.coords.y}return H}},{key:"applyToInteraction",value:function(l){var d=this.interaction,h=l.phase,_=d.coords.cur,w=d.coords.start,A=this.result,B=this.startDelta,H=A.delta;h==="start"&&F(this.startDelta,A.delta);for(var ge=0,q=[[w,B],[_,H]];ge<q.length;ge++){var we=q[ge],Be=we[0],He=we[1];Be.page.x+=He.x,Be.page.y+=He.y,Be.client.x+=He.x,Be.client.y+=He.y}var Ve=this.result.rectDelta,Ge=l.rect||d.rect;Ge.left+=Ve.left,Ge.right+=Ve.right,Ge.top+=Ve.top,Ge.bottom+=Ve.bottom,Ge.width=Ge.right-Ge.left,Ge.height=Ge.bottom-Ge.top}},{key:"setAndApply",value:function(l){var d=this.interaction,h=l.phase,_=l.preEnd,w=l.skipModifiers,A=this.setAll(this.fillArg({preEnd:_,phase:h,pageCoords:l.modifiedCoords||d.coords.cur.page}));if(this.result=A,!A.changed&&(!w||w<this.states.length)&&d.interacting())return!1;if(l.modifiedCoords){var B=d.coords.cur.page,H={x:l.modifiedCoords.x-B.x,y:l.modifiedCoords.y-B.y};A.coords.x+=H.x,A.coords.y+=H.y,A.delta.x+=H.x,A.delta.y+=H.y}this.applyToInteraction(l)}},{key:"beforeEnd",value:function(l){var d=l.interaction,h=l.event,_=this.states;if(_&&_.length){for(var w=!1,A=0;A<_.length;A++){var B=_[A];l.state=B;var H=B.options,ge=B.methods,q=ge.beforeEnd&&ge.beforeEnd(l);if(q)return this.endResult=q,!1;w=w||!w&&this.shouldDo(H,!0,l.phase,!0)}w&&d.move({event:h,preEnd:!0})}}},{key:"stop",value:function(l){var d=l.interaction;if(this.states&&this.states.length){var h=F({states:this.states,interactable:d.interactable,element:d.element,rect:null},l);this.fillArg(h);for(var _=0,w=this.states;_<w.length;_++){var A=w[_];h.state=A,A.methods.stop&&A.methods.stop(h)}this.states=null,this.endResult=null}}},{key:"prepareStates",value:function(l){this.states=[];for(var d=0;d<l.length;d++){var h=l[d],_=h.options,w=h.methods,A=h.name;this.states.push({options:_,methods:w,index:d,name:A})}return this.states}},{key:"restoreInteractionCoords",value:function(l){var d=l.interaction,h=d.coords,_=d.rect,w=d.modification;if(w.result){for(var A=w.startDelta,B=w.result,H=B.delta,ge=B.rectDelta,q=0,we=[[h.start,A],[h.cur,H]];q<we.length;q++){var Be=we[q],He=Be[0],Ve=Be[1];He.page.x-=Ve.x,He.page.y-=Ve.y,He.client.x-=Ve.x,He.client.y-=Ve.y}_.left-=ge.left,_.right-=ge.right,_.top-=ge.top,_.bottom-=ge.bottom}}},{key:"shouldDo",value:function(l,d,h,_){return!(!l||l.enabled===!1||_&&!l.endOnly||l.endOnly&&!d||h==="start"&&!l.setStart)}},{key:"copyFrom",value:function(l){this.startOffset=l.startOffset,this.startDelta=l.startDelta,this.startEdges=l.startEdges,this.edges=l.edges,this.states=l.states.map(function(d){return ma(d)}),this.result=ha(F({},l.result.coords),F({},l.result.rect))}},{key:"destroy",value:function(){for(var l in this)this[l]=null}}]),c}();function ha(c,l){return{rect:l,coords:c,delta:{x:0,y:0},rectDelta:{left:0,right:0,top:0,bottom:0},eventProps:[],changed:!0}}function Ho(c,l){var d=c.defaults,h={start:c.start,set:c.set,beforeEnd:c.beforeEnd,stop:c.stop},_=function(w){var A=w||{};for(var B in A.enabled=A.enabled!==!1,d)B in A||(A[B]=d[B]);var H={options:A,methods:h,name:l,enable:function(){return A.enabled=!0,H},disable:function(){return A.enabled=!1,H}};return H};return l&&typeof l=="string"&&(_._defaults=d,_._methods=h),_}function Wa(c){var l=c.iEvent,d=c.interaction.modification.result;d&&(l.modifiers=d.eventProps)}var Pc={id:"modifiers/base",before:["actions"],install:function(c){c.defaults.perAction.modifiers=[]},listeners:{"interactions:new":function(c){var l=c.interaction;l.modification=new Zr(l)},"interactions:before-action-start":function(c){var l=c.interaction,d=c.interaction.modification;d.start(c,l.coords.start.page),l.edges=d.edges,d.applyToInteraction(c)},"interactions:before-action-move":function(c){var l=c.interaction,d=l.modification,h=d.setAndApply(c);return l.edges=d.edges,h},"interactions:before-action-end":function(c){var l=c.interaction,d=l.modification,h=d.beforeEnd(c);return l.edges=d.startEdges,h},"interactions:action-start":Wa,"interactions:action-move":Wa,"interactions:action-end":Wa,"interactions:after-action-start":function(c){return c.interaction.modification.restoreInteractionCoords(c)},"interactions:after-action-move":function(c){return c.interaction.modification.restoreInteractionCoords(c)},"interactions:stop":function(c){return c.interaction.modification.stop(c)}}},wl=Pc,xl={base:{preventDefault:"auto",deltaSource:"page"},perAction:{enabled:!1,origin:{x:0,y:0}},actions:{}},Ji=function(c){m(d,c);var l=b(d);function d(h,_,w,A,B,H,ge){var q;r(this,d),(q=l.call(this,h)).relatedTarget=null,q.screenX=void 0,q.screenY=void 0,q.button=void 0,q.buttons=void 0,q.ctrlKey=void 0,q.shiftKey=void 0,q.altKey=void 0,q.metaKey=void 0,q.page=void 0,q.client=void 0,q.delta=void 0,q.rect=void 0,q.x0=void 0,q.y0=void 0,q.t0=void 0,q.dt=void 0,q.duration=void 0,q.clientX0=void 0,q.clientY0=void 0,q.velocity=void 0,q.speed=void 0,q.swipe=void 0,q.axes=void 0,q.preEnd=void 0,B=B||h.element;var we=h.interactable,Be=(we&&we.options||xl).deltaSource,He=de(we,B,w),Ve=A==="start",Ge=A==="end",tt=Ve?x(q):h.prevEvent,Xe=Ve?h.coords.start:Ge?{page:tt.page,client:tt.client,timeStamp:h.coords.cur.timeStamp}:h.coords.cur;return q.page=F({},Xe.page),q.client=F({},Xe.client),q.rect=F({},h.rect),q.timeStamp=Xe.timeStamp,Ge||(q.page.x-=He.x,q.page.y-=He.y,q.client.x-=He.x,q.client.y-=He.y),q.ctrlKey=_.ctrlKey,q.altKey=_.altKey,q.shiftKey=_.shiftKey,q.metaKey=_.metaKey,q.button=_.button,q.buttons=_.buttons,q.target=B,q.currentTarget=B,q.preEnd=H,q.type=ge||w+(A||""),q.interactable=we,q.t0=Ve?h.pointers[h.pointers.length-1].downTime:tt.t0,q.x0=h.coords.start.page.x-He.x,q.y0=h.coords.start.page.y-He.y,q.clientX0=h.coords.start.client.x-He.x,q.clientY0=h.coords.start.client.y-He.y,q.delta=Ve||Ge?{x:0,y:0}:{x:q[Be].x-tt[Be].x,y:q[Be].y-tt[Be].y},q.dt=h.coords.delta.timeStamp,q.duration=q.timeStamp-q.t0,q.velocity=F({},h.coords.velocity[Be]),q.speed=N(q.velocity.x,q.velocity.y),q.swipe=Ge||A==="inertiastart"?q.getSwipe():null,q}return u(d,[{key:"getSwipe",value:function(){var h=this._interaction;if(h.prevEvent.speed<600||this.timeStamp-h.prevEvent.timeStamp>150)return null;var _=180*Math.atan2(h.prevEvent.velocityY,h.prevEvent.velocityX)/Math.PI;_<0&&(_+=360);var w=112.5<=_&&_<247.5,A=202.5<=_&&_<337.5;return{up:A,down:!A&&22.5<=_&&_<157.5,left:w,right:!w&&(292.5<=_||_<67.5),angle:_,speed:h.prevEvent.speed,velocity:{x:h.prevEvent.velocityX,y:h.prevEvent.velocityY}}}},{key:"preventDefault",value:function(){}},{key:"stopImmediatePropagation",value:function(){this.immediatePropagationStopped=this.propagationStopped=!0}},{key:"stopPropagation",value:function(){this.propagationStopped=!0}}]),d}(an);Object.defineProperties(Ji.prototype,{pageX:{get:function(){return this.page.x},set:function(c){this.page.x=c}},pageY:{get:function(){return this.page.y},set:function(c){this.page.y=c}},clientX:{get:function(){return this.client.x},set:function(c){this.client.x=c}},clientY:{get:function(){return this.client.y},set:function(c){this.client.y=c}},dx:{get:function(){return this.delta.x},set:function(c){this.delta.x=c}},dy:{get:function(){return this.delta.y},set:function(c){this.delta.y=c}},velocityX:{get:function(){return this.velocity.x},set:function(c){this.velocity.x=c}},velocityY:{get:function(){return this.velocity.y},set:function(c){this.velocity.y=c}}});var Nc=u(function c(l,d,h,_,w){r(this,c),this.id=void 0,this.pointer=void 0,this.event=void 0,this.downTime=void 0,this.downTarget=void 0,this.id=l,this.pointer=d,this.event=h,this.downTime=_,this.downTarget=w}),gr=function(c){return c.interactable="",c.element="",c.prepared="",c.pointerIsDown="",c.pointerWasMoved="",c._proxy="",c}({}),ei=function(c){return c.start="",c.move="",c.end="",c.stop="",c.interacting="",c}({}),Fc=0,ti=function(){function c(l){var d=this,h=l.pointerType,_=l.scopeFire;r(this,c),this.interactable=null,this.element=null,this.rect=null,this._rects=void 0,this.edges=null,this._scopeFire=void 0,this.prepared={name:null,axis:null,edges:null},this.pointerType=void 0,this.pointers=[],this.downEvent=null,this.downPointer={},this._latestPointer={pointer:null,event:null,eventTarget:null},this.prevEvent=null,this.pointerIsDown=!1,this.pointerWasMoved=!1,this._interacting=!1,this._ending=!1,this._stopped=!0,this._proxy=void 0,this.simulation=null,this.doMove=ga(function(q){this.move(q)},"The interaction.doMove() method has been renamed to interaction.move()"),this.coords={start:{page:{x:0,y:0},client:{x:0,y:0},timeStamp:0},prev:{page:{x:0,y:0},client:{x:0,y:0},timeStamp:0},cur:{page:{x:0,y:0},client:{x:0,y:0},timeStamp:0},delta:{page:{x:0,y:0},client:{x:0,y:0},timeStamp:0},velocity:{page:{x:0,y:0},client:{x:0,y:0},timeStamp:0}},this._id=Fc++,this._scopeFire=_,this.pointerType=h;var w=this;this._proxy={};var A=function(q){Object.defineProperty(d._proxy,q,{get:function(){return w[q]}})};for(var B in gr)A(B);var H=function(q){Object.defineProperty(d._proxy,q,{value:function(){return w[q].apply(w,arguments)}})};for(var ge in ei)H(ge);this._scopeFire("interactions:new",{interaction:this})}return u(c,[{key:"pointerMoveTolerance",get:function(){return 1}},{key:"pointerDown",value:function(l,d,h){var _=this.updatePointer(l,d,h,!0),w=this.pointers[_];this._scopeFire("interactions:down",{pointer:l,event:d,eventTarget:h,pointerIndex:_,pointerInfo:w,type:"down",interaction:this})}},{key:"start",value:function(l,d,h){return!(this.interacting()||!this.pointerIsDown||this.pointers.length<(l.name==="gesture"?2:1)||!d.options[l.name].enabled)&&(ur(this.prepared,l),this.interactable=d,this.element=h,this.rect=d.getRect(h),this.edges=this.prepared.edges?F({},this.prepared.edges):{left:!0,right:!0,top:!0,bottom:!0},this._stopped=!1,this._interacting=this._doPhase({interaction:this,event:this.downEvent,phase:"start"})&&!this._stopped,this._interacting)}},{key:"pointerMove",value:function(l,d,h){this.simulation||this.modification&&this.modification.endResult||this.updatePointer(l,d,h,!1);var _,w,A=this.coords.cur.page.x===this.coords.prev.page.x&&this.coords.cur.page.y===this.coords.prev.page.y&&this.coords.cur.client.x===this.coords.prev.client.x&&this.coords.cur.client.y===this.coords.prev.client.y;this.pointerIsDown&&!this.pointerWasMoved&&(_=this.coords.cur.client.x-this.coords.start.client.x,w=this.coords.cur.client.y-this.coords.start.client.y,this.pointerWasMoved=N(_,w)>this.pointerMoveTolerance);var B,H,ge,q=this.getPointerIndex(l),we={pointer:l,pointerIndex:q,pointerInfo:this.pointers[q],event:d,type:"move",eventTarget:h,dx:_,dy:w,duplicate:A,interaction:this};A||(B=this.coords.velocity,H=this.coords.delta,ge=Math.max(H.timeStamp/1e3,.001),B.page.x=H.page.x/ge,B.page.y=H.page.y/ge,B.client.x=H.client.x/ge,B.client.y=H.client.y/ge,B.timeStamp=ge),this._scopeFire("interactions:move",we),A||this.simulation||(this.interacting()&&(we.type=null,this.move(we)),this.pointerWasMoved&&ne(this.coords.prev,this.coords.cur))}},{key:"move",value:function(l){l&&l.event||Pe(this.coords.delta),(l=F({pointer:this._latestPointer.pointer,event:this._latestPointer.event,eventTarget:this._latestPointer.eventTarget,interaction:this},l||{})).phase="move",this._doPhase(l)}},{key:"pointerUp",value:function(l,d,h,_){var w=this.getPointerIndex(l);w===-1&&(w=this.updatePointer(l,d,h,!1));var A=/cancel$/i.test(d.type)?"cancel":"up";this._scopeFire("interactions:".concat(A),{pointer:l,pointerIndex:w,pointerInfo:this.pointers[w],event:d,eventTarget:h,type:A,curEventTarget:_,interaction:this}),this.simulation||this.end(d),this.removePointer(l,d)}},{key:"documentBlur",value:function(l){this.end(l),this._scopeFire("interactions:blur",{event:l,type:"blur",interaction:this})}},{key:"end",value:function(l){var d;this._ending=!0,l=l||this._latestPointer.event,this.interacting()&&(d=this._doPhase({event:l,interaction:this,phase:"end"})),this._ending=!1,d===!0&&this.stop()}},{key:"currentAction",value:function(){return this._interacting?this.prepared.name:null}},{key:"interacting",value:function(){return this._interacting}},{key:"stop",value:function(){this._scopeFire("interactions:stop",{interaction:this}),this.interactable=this.element=null,this._interacting=!1,this._stopped=!0,this.prepared.name=this.prevEvent=null}},{key:"getPointerIndex",value:function(l){var d=qe(l);return this.pointerType==="mouse"||this.pointerType==="pen"?this.pointers.length-1:wo(this.pointers,function(h){return h.id===d})}},{key:"getPointerInfo",value:function(l){return this.pointers[this.getPointerIndex(l)]}},{key:"updatePointer",value:function(l,d,h,_){var w,A,B,H=qe(l),ge=this.getPointerIndex(l),q=this.pointers[ge];return _=_!==!1&&(_||/(down|start)$/i.test(d.type)),q?q.pointer=l:(q=new Nc(H,l,d,null,null),ge=this.pointers.length,this.pointers.push(q)),et(this.coords.cur,this.pointers.map(function(we){return we.pointer}),this._now()),w=this.coords.delta,A=this.coords.prev,B=this.coords.cur,w.page.x=B.page.x-A.page.x,w.page.y=B.page.y-A.page.y,w.client.x=B.client.x-A.client.x,w.client.y=B.client.y-A.client.y,w.timeStamp=B.timeStamp-A.timeStamp,_&&(this.pointerIsDown=!0,q.downTime=this.coords.cur.timeStamp,q.downTarget=h,j(this.downPointer,l),this.interacting()||(ne(this.coords.start,this.coords.cur),ne(this.coords.prev,this.coords.cur),this.downEvent=d,this.pointerWasMoved=!1)),this._updateLatestPointer(l,d,h),this._scopeFire("interactions:update-pointer",{pointer:l,event:d,eventTarget:h,down:_,pointerInfo:q,pointerIndex:ge,interaction:this}),ge}},{key:"removePointer",value:function(l,d){var h=this.getPointerIndex(l);if(h!==-1){var _=this.pointers[h];this._scopeFire("interactions:remove-pointer",{pointer:l,event:d,eventTarget:null,pointerIndex:h,pointerInfo:_,interaction:this}),this.pointers.splice(h,1),this.pointerIsDown=!1}}},{key:"_updateLatestPointer",value:function(l,d,h){this._latestPointer.pointer=l,this._latestPointer.event=d,this._latestPointer.eventTarget=h}},{key:"destroy",value:function(){this._latestPointer.pointer=null,this._latestPointer.event=null,this._latestPointer.eventTarget=null}},{key:"_createPreparedEvent",value:function(l,d,h,_){return new Ji(this,l,this.prepared.name,d,this.element,h,_)}},{key:"_fireEvent",value:function(l){var d;(d=this.interactable)==null||d.fire(l),(!this.prevEvent||l.timeStamp>=this.prevEvent.timeStamp)&&(this.prevEvent=l)}},{key:"_doPhase",value:function(l){var d=l.event,h=l.phase,_=l.preEnd,w=l.type,A=this.rect;if(A&&h==="move"&&(G(this.edges,A,this.coords.delta[this.interactable.options.deltaSource]),A.width=A.right-A.left,A.height=A.bottom-A.top),this._scopeFire("interactions:before-action-".concat(h),l)===!1)return!1;var B=l.iEvent=this._createPreparedEvent(d,h,_,w);return this._scopeFire("interactions:action-".concat(h),l),h==="start"&&(this.prevEvent=B),this._fireEvent(B),this._scopeFire("interactions:after-action-".concat(h),l),!0}},{key:"_now",value:function(){return Date.now()}}]),c}();function Xi(c){Qi(c.interaction)}function Qi(c){if(!function(d){return!(!d.offset.pending.x&&!d.offset.pending.y)}(c))return!1;var l=c.offset.pending;return Zi(c.coords.cur,l),Zi(c.coords.delta,l),G(c.edges,c.rect,l),l.x=0,l.y=0,!0}function Sl(c){var l=c.x,d=c.y;this.offset.pending.x+=l,this.offset.pending.y+=d,this.offset.total.x+=l,this.offset.total.y+=d}function Zi(c,l){var d=c.page,h=c.client,_=l.x,w=l.y;d.x+=_,d.y+=w,h.x+=_,h.y+=w}ei.offsetBy="";var Tl={id:"offset",before:["modifiers","pointer-events","actions","inertia"],install:function(c){c.Interaction.prototype.offsetBy=Sl},listeners:{"interactions:new":function(c){c.interaction.offset={total:{x:0,y:0},pending:{x:0,y:0}}},"interactions:update-pointer":function(c){return function(l){l.pointerIsDown&&(Zi(l.coords.cur,l.offset.total),l.offset.pending.x=0,l.offset.pending.y=0)}(c.interaction)},"interactions:before-action-start":Xi,"interactions:before-action-move":Xi,"interactions:before-action-end":function(c){var l=c.interaction;if(Qi(l))return l.move({offset:!0}),l.end(),!1},"interactions:stop":function(c){var l=c.interaction;l.offset.total.x=0,l.offset.total.y=0,l.offset.pending.x=0,l.offset.pending.y=0}}},kl=Tl,Cl=function(){function c(l){r(this,c),this.active=!1,this.isModified=!1,this.smoothEnd=!1,this.allowResume=!1,this.modification=void 0,this.modifierCount=0,this.modifierArg=void 0,this.startCoords=void 0,this.t0=0,this.v0=0,this.te=0,this.targetOffset=void 0,this.modifiedOffset=void 0,this.currentOffset=void 0,this.lambda_v0=0,this.one_ve_v0=0,this.timeout=void 0,this.interaction=void 0,this.interaction=l}return u(c,[{key:"start",value:function(l){var d=this.interaction,h=ni(d);if(!h||!h.enabled)return!1;var _=d.coords.velocity.client,w=N(_.x,_.y),A=this.modification||(this.modification=new Zr(d));if(A.copyFrom(d.modification),this.t0=d._now(),this.allowResume=h.allowResume,this.v0=w,this.currentOffset={x:0,y:0},this.startCoords=d.coords.cur.page,this.modifierArg=A.fillArg({pageCoords:this.startCoords,preEnd:!0,phase:"inertiastart"}),this.t0-d.coords.cur.timeStamp<50&&w>h.minSpeed&&w>h.endSpeed)this.startInertia();else{if(A.result=A.setAll(this.modifierArg),!A.result.changed)return!1;this.startSmoothEnd()}return d.modification.result.rect=null,d.offsetBy(this.targetOffset),d._doPhase({interaction:d,event:l,phase:"inertiastart"}),d.offsetBy({x:-this.targetOffset.x,y:-this.targetOffset.y}),d.modification.result.rect=null,this.active=!0,d.simulation=this,!0}},{key:"startInertia",value:function(){var l=this,d=this.interaction.coords.velocity.client,h=ni(this.interaction),_=h.resistance,w=-Math.log(h.endSpeed/this.v0)/_;this.targetOffset={x:(d.x-w)/_,y:(d.y-w)/_},this.te=w,this.lambda_v0=_/this.v0,this.one_ve_v0=1-h.endSpeed/this.v0;var A=this.modification,B=this.modifierArg;B.pageCoords={x:this.startCoords.x+this.targetOffset.x,y:this.startCoords.y+this.targetOffset.y},A.result=A.setAll(B),A.result.changed&&(this.isModified=!0,this.modifiedOffset={x:this.targetOffset.x+A.result.delta.x,y:this.targetOffset.y+A.result.delta.y}),this.onNextFrame(function(){return l.inertiaTick()})}},{key:"startSmoothEnd",value:function(){var l=this;this.smoothEnd=!0,this.isModified=!0,this.targetOffset={x:this.modification.result.delta.x,y:this.modification.result.delta.y},this.onNextFrame(function(){return l.smoothEndTick()})}},{key:"onNextFrame",value:function(l){var d=this;this.timeout=io.request(function(){d.active&&l()})}},{key:"inertiaTick",value:function(){var l,d,h,_,w,A,B,H=this,ge=this.interaction,q=ni(ge).resistance,we=(ge._now()-this.t0)/1e3;if(we<this.te){var Be,He=1-(Math.exp(-q*we)-this.lambda_v0)/this.one_ve_v0;this.isModified?(l=0,d=0,h=this.targetOffset.x,_=this.targetOffset.y,w=this.modifiedOffset.x,A=this.modifiedOffset.y,Be={x:$l(B=He,l,h,w),y:$l(B,d,_,A)}):Be={x:this.targetOffset.x*He,y:this.targetOffset.y*He};var Ve={x:Be.x-this.currentOffset.x,y:Be.y-this.currentOffset.y};this.currentOffset.x+=Ve.x,this.currentOffset.y+=Ve.y,ge.offsetBy(Ve),ge.move(),this.onNextFrame(function(){return H.inertiaTick()})}else ge.offsetBy({x:this.modifiedOffset.x-this.currentOffset.x,y:this.modifiedOffset.y-this.currentOffset.y}),this.end()}},{key:"smoothEndTick",value:function(){var l=this,d=this.interaction,h=d._now()-this.t0,_=ni(d).smoothEndDuration;if(h<_){var w={x:es(h,0,this.targetOffset.x,_),y:es(h,0,this.targetOffset.y,_)},A={x:w.x-this.currentOffset.x,y:w.y-this.currentOffset.y};this.currentOffset.x+=A.x,this.currentOffset.y+=A.y,d.offsetBy(A),d.move({skipModifiers:this.modifierCount}),this.onNextFrame(function(){return l.smoothEndTick()})}else d.offsetBy({x:this.targetOffset.x-this.currentOffset.x,y:this.targetOffset.y-this.currentOffset.y}),this.end()}},{key:"resume",value:function(l){var d=l.pointer,h=l.event,_=l.eventTarget,w=this.interaction;w.offsetBy({x:-this.currentOffset.x,y:-this.currentOffset.y}),w.updatePointer(d,h,_,!0),w._doPhase({interaction:w,event:h,phase:"resume"}),ne(w.coords.prev,w.coords.cur),this.stop()}},{key:"end",value:function(){this.interaction.move(),this.interaction.end(),this.stop()}},{key:"stop",value:function(){this.active=this.smoothEnd=!1,this.interaction.simulation=null,io.cancel(this.timeout)}}]),c}();function ni(c){var l=c.interactable,d=c.prepared;return l&&l.options&&d.name&&l.options[d.name].inertia}var El={id:"inertia",before:["modifiers","actions"],install:function(c){var l=c.defaults;c.usePlugin(kl),c.usePlugin(wl),c.actions.phases.inertiastart=!0,c.actions.phases.resume=!0,l.perAction.inertia={enabled:!1,resistance:10,minSpeed:100,endSpeed:10,allowResume:!0,smoothEndDuration:300}},listeners:{"interactions:new":function(c){var l=c.interaction;l.inertia=new Cl(l)},"interactions:before-action-end":function(c){var l=c.interaction,d=c.event;return(!l._interacting||l.simulation||!l.inertia.start(d))&&null},"interactions:down":function(c){var l=c.interaction,d=c.eventTarget,h=l.inertia;if(h.active)for(var _=d;P.element(_);){if(_===l.element){h.resume(c);break}_=ye(_)}},"interactions:stop":function(c){var l=c.interaction.inertia;l.active&&l.stop()},"interactions:before-action-resume":function(c){var l=c.interaction.modification;l.stop(c),l.start(c,c.interaction.coords.cur.page),l.applyToInteraction(c)},"interactions:before-action-inertiastart":function(c){return c.interaction.modification.setAndApply(c)},"interactions:action-resume":Wa,"interactions:action-inertiastart":Wa,"interactions:after-action-inertiastart":function(c){return c.interaction.modification.restoreInteractionCoords(c)},"interactions:after-action-resume":function(c){return c.interaction.modification.restoreInteractionCoords(c)}}};function $l(c,l,d,h){var _=1-c;return _*_*l+2*_*c*d+c*c*h}function es(c,l,d,h){return-d*(c/=h)*(c-2)+l}var Ll=El;function ts(c,l){for(var d=0;d<l.length;d++){var h=l[d];if(c.immediatePropagationStopped)break;h(c)}}var mr=function(){function c(l){r(this,c),this.options=void 0,this.types={},this.propagationStopped=!1,this.immediatePropagationStopped=!1,this.global=void 0,this.options=F({},l||{})}return u(c,[{key:"fire",value:function(l){var d,h=this.global;(d=this.types[l.type])&&ts(l,d),!l.propagationStopped&&h&&(d=h[l.type])&&ts(l,d)}},{key:"on",value:function(l,d){var h=Se(l,d);for(l in h)this.types[l]=hn(this.types[l]||[],h[l])}},{key:"off",value:function(l,d){var h=Se(l,d);for(l in h){var _=this.types[l];if(_&&_.length)for(var w=0,A=h[l];w<A.length;w++){var B=A[w],H=_.indexOf(B);H!==-1&&_.splice(H,1)}}}},{key:"getRect",value:function(l){return null}}]),c}(),hr=function(){function c(l){r(this,c),this.currentTarget=void 0,this.originalEvent=void 0,this.type=void 0,this.originalEvent=l,j(this,l)}return u(c,[{key:"preventOriginalDefault",value:function(){this.originalEvent.preventDefault()}},{key:"stopPropagation",value:function(){this.originalEvent.stopPropagation()}},{key:"stopImmediatePropagation",value:function(){this.originalEvent.stopImmediatePropagation()}}]),c}();function Mn(c){return P.object(c)?{capture:!!c.capture,passive:!!c.passive}:{capture:!!c,passive:!1}}function Mo(c,l){return c===l||(typeof c=="boolean"?!!l.capture===c&&!l.passive:!!c.capture==!!l.capture&&!!c.passive==!!l.passive)}var Go={id:"events",install:function(c){var l,d=[],h={},_=[],w={add:A,remove:B,addDelegate:function(q,we,Be,He,Ve){var Ge=Mn(Ve);if(!h[Be]){h[Be]=[];for(var tt=0;tt<_.length;tt++){var Xe=_[tt];A(Xe,Be,H),A(Xe,Be,ge,!0)}}var at=h[Be],wt=dt(at,function(It){return It.selector===q&&It.context===we});wt||(wt={selector:q,context:we,listeners:[]},at.push(wt)),wt.listeners.push({func:He,options:Ge})},removeDelegate:function(q,we,Be,He,Ve){var Ge,tt=Mn(Ve),Xe=h[Be],at=!1;if(Xe)for(Ge=Xe.length-1;Ge>=0;Ge--){var wt=Xe[Ge];if(wt.selector===q&&wt.context===we){for(var It=wt.listeners,pt=It.length-1;pt>=0;pt--){var St=It[pt];if(St.func===He&&Mo(St.options,tt)){It.splice(pt,1),It.length||(Xe.splice(Ge,1),B(we,Be,H),B(we,Be,ge,!0)),at=!0;break}}if(at)break}}},delegateListener:H,delegateUseCapture:ge,delegatedEvents:h,documents:_,targets:d,supportsOptions:!1,supportsPassive:!1};function A(q,we,Be,He){if(q.addEventListener){var Ve=Mn(He),Ge=dt(d,function(tt){return tt.eventTarget===q});Ge||(Ge={eventTarget:q,events:{}},d.push(Ge)),Ge.events[we]||(Ge.events[we]=[]),dt(Ge.events[we],function(tt){return tt.func===Be&&Mo(tt.options,Ve)})||(q.addEventListener(we,Be,w.supportsOptions?Ve:Ve.capture),Ge.events[we].push({func:Be,options:Ve}))}}function B(q,we,Be,He){if(q.addEventListener&&q.removeEventListener){var Ve=wo(d,function(Xn){return Xn.eventTarget===q}),Ge=d[Ve];if(Ge&&Ge.events)if(we!=="all"){var tt=!1,Xe=Ge.events[we];if(Xe){if(Be==="all"){for(var at=Xe.length-1;at>=0;at--){var wt=Xe[at];B(q,we,wt.func,wt.options)}return}for(var It=Mn(He),pt=0;pt<Xe.length;pt++){var St=Xe[pt];if(St.func===Be&&Mo(St.options,It)){q.removeEventListener(we,Be,w.supportsOptions?It:It.capture),Xe.splice(pt,1),Xe.length===0&&(delete Ge.events[we],tt=!0);break}}}tt&&!Object.keys(Ge.events).length&&d.splice(Ve,1)}else for(we in Ge.events)Ge.events.hasOwnProperty(we)&&B(q,we,"all")}}function H(q,we){for(var Be=Mn(we),He=new hr(q),Ve=h[q.type],Ge=ao(q)[0],tt=Ge;P.element(tt);){for(var Xe=0;Xe<Ve.length;Xe++){var at=Ve[Xe],wt=at.selector,It=at.context;if(pe(tt,wt)&&Q(It,Ge)&&Q(It,tt)){var pt=at.listeners;He.currentTarget=tt;for(var St=0;St<pt.length;St++){var Xn=pt[St];Mo(Xn.options,Be)&&Xn.func(He)}}}tt=ye(tt)}}function ge(q){return H(q,!0)}return(l=c.document)==null||l.createElement("div").addEventListener("test",null,{get capture(){return w.supportsOptions=!0},get passive(){return w.supportsPassive=!0}}),c.events=w,w}},ns={methodOrder:["simulationResume","mouseOrPen","hasPointer","idle"],search:function(c){for(var l=0,d=ns.methodOrder;l<d.length;l++){var h=d[l],_=ns[h](c);if(_)return _}return null},simulationResume:function(c){var l=c.pointerType,d=c.eventType,h=c.eventTarget,_=c.scope;if(!/down|start/i.test(d))return null;for(var w=0,A=_.interactions.list;w<A.length;w++){var B=A[w],H=h;if(B.simulation&&B.simulation.allowResume&&B.pointerType===l)for(;H;){if(H===B.element)return B;H=ye(H)}}return null},mouseOrPen:function(c){var l,d=c.pointerId,h=c.pointerType,_=c.eventType,w=c.scope;if(h!=="mouse"&&h!=="pen")return null;for(var A=0,B=w.interactions.list;A<B.length;A++){var H=B[A];if(H.pointerType===h){if(H.simulation&&!Al(H,d))continue;if(H.interacting())return H;l||(l=H)}}if(l)return l;for(var ge=0,q=w.interactions.list;ge<q.length;ge++){var we=q[ge];if(!(we.pointerType!==h||/down/i.test(_)&&we.simulation))return we}return null},hasPointer:function(c){for(var l=c.pointerId,d=0,h=c.scope.interactions.list;d<h.length;d++){var _=h[d];if(Al(_,l))return _}return null},idle:function(c){for(var l=c.pointerType,d=0,h=c.scope.interactions.list;d<h.length;d++){var _=h[d];if(_.pointers.length===1){var w=_.interactable;if(w&&(!w.options.gesture||!w.options.gesture.enabled))continue}else if(_.pointers.length>=2)continue;if(!_.interacting()&&l===_.pointerType)return _}return null}};function Al(c,l){return c.pointers.some(function(d){return d.id===l})}var Bc=ns,oi=["pointerDown","pointerMove","pointerUp","updatePointer","removePointer","windowBlur"];function Ml(c,l){return function(d){var h=l.interactions.list,_=An(d),w=ao(d),A=w[0],B=w[1],H=[];if(/^touch/.test(d.type)){l.prevTouchTime=l.now();for(var ge=0,q=d.changedTouches;ge<q.length;ge++){var we=q[ge],Be={pointer:we,pointerId:qe(we),pointerType:_,eventType:d.type,eventTarget:A,curEventTarget:B,scope:l},He=Il(Be);H.push([Be.pointer,Be.eventTarget,Be.curEventTarget,He])}}else{var Ve=!1;if(!re.supportsPointerEvent&&/mouse/.test(d.type)){for(var Ge=0;Ge<h.length&&!Ve;Ge++)Ve=h[Ge].pointerType!=="mouse"&&h[Ge].pointerIsDown;Ve=Ve||l.now()-l.prevTouchTime<500||d.timeStamp===0}if(!Ve){var tt={pointer:d,pointerId:qe(d),pointerType:_,eventType:d.type,curEventTarget:B,eventTarget:A,scope:l},Xe=Il(tt);H.push([tt.pointer,tt.eventTarget,tt.curEventTarget,Xe])}}for(var at=0;at<H.length;at++){var wt=H[at],It=wt[0],pt=wt[1],St=wt[2];wt[3][c](It,d,pt,St)}}}function Il(c){var l=c.pointerType,d=c.scope,h={interaction:Bc.search(c),searchDetails:c};return d.fire("interactions:find",h),h.interaction||d.interactions.new({pointerType:l})}function zn(c,l){var d=c.doc,h=c.scope,_=c.options,w=h.interactions.docEvents,A=h.events,B=A[l];for(var H in h.browser.isIOS&&!_.events&&(_.events={passive:!1}),A.delegatedEvents)B(d,H,A.delegateListener),B(d,H,A.delegateUseCapture,!0);for(var ge=_&&_.events,q=0;q<w.length;q++){var we=w[q];B(d,we.type,we.listener,ge)}}var Uc={id:"core/interactions",install:function(c){for(var l={},d=0;d<oi.length;d++){var h=oi[d];l[h]=Ml(h,c)}var _,w=re.pEventTypes;function A(){for(var B=0,H=c.interactions.list;B<H.length;B++){var ge=H[B];if(ge.pointerIsDown&&ge.pointerType==="touch"&&!ge._interacting)for(var q=function(){var He=Be[we];c.documents.some(function(Ve){return Q(Ve.doc,He.downTarget)})||ge.removePointer(He.pointer,He.event)},we=0,Be=ge.pointers;we<Be.length;we++)q()}}(_=ae.PointerEvent?[{type:w.down,listener:A},{type:w.down,listener:l.pointerDown},{type:w.move,listener:l.pointerMove},{type:w.up,listener:l.pointerUp},{type:w.cancel,listener:l.pointerUp}]:[{type:"mousedown",listener:l.pointerDown},{type:"mousemove",listener:l.pointerMove},{type:"mouseup",listener:l.pointerUp},{type:"touchstart",listener:A},{type:"touchstart",listener:l.pointerDown},{type:"touchmove",listener:l.pointerMove},{type:"touchend",listener:l.pointerUp},{type:"touchcancel",listener:l.pointerUp}]).push({type:"blur",listener:function(B){for(var H=0,ge=c.interactions.list;H<ge.length;H++)ge[H].documentBlur(B)}}),c.prevTouchTime=0,c.Interaction=function(B){m(ge,B);var H=b(ge);function ge(){return r(this,ge),H.apply(this,arguments)}return u(ge,[{key:"pointerMoveTolerance",get:function(){return c.interactions.pointerMoveTolerance},set:function(q){c.interactions.pointerMoveTolerance=q}},{key:"_now",value:function(){return c.now()}}]),ge}(ti),c.interactions={list:[],new:function(B){B.scopeFire=function(ge,q){return c.fire(ge,q)};var H=new c.Interaction(B);return c.interactions.list.push(H),H},listeners:l,docEvents:_,pointerMoveTolerance:1},c.usePlugin(fr)},listeners:{"scope:add-document":function(c){return zn(c,"add")},"scope:remove-document":function(c){return zn(c,"remove")},"interactable:unset":function(c,l){for(var d=c.interactable,h=l.interactions.list.length-1;h>=0;h--){var _=l.interactions.list[h];_.interactable===d&&(_.stop(),l.fire("interactions:destroy",{interaction:_}),_.destroy(),l.interactions.list.length>2&&l.interactions.list.splice(h,1))}}},onDocSignal:zn,doOnInteractions:Ml,methodNames:oi},zc=Uc,qo=function(c){return c[c.On=0]="On",c[c.Off=1]="Off",c}(qo||{}),Vc=function(){function c(l,d,h,_){r(this,c),this.target=void 0,this.options=void 0,this._actions=void 0,this.events=new mr,this._context=void 0,this._win=void 0,this._doc=void 0,this._scopeEvents=void 0,this._actions=d.actions,this.target=l,this._context=d.context||h,this._win=M(ee(l)?this._context:l),this._doc=this._win.document,this._scopeEvents=_,this.set(d)}return u(c,[{key:"_defaults",get:function(){return{base:{},perAction:{},actions:{}}}},{key:"setOnEvents",value:function(l,d){return P.func(d.onstart)&&this.on("".concat(l,"start"),d.onstart),P.func(d.onmove)&&this.on("".concat(l,"move"),d.onmove),P.func(d.onend)&&this.on("".concat(l,"end"),d.onend),P.func(d.oninertiastart)&&this.on("".concat(l,"inertiastart"),d.oninertiastart),this}},{key:"updatePerActionListeners",value:function(l,d,h){var _,w=this,A=(_=this._actions.map[l])==null?void 0:_.filterEventType,B=function(H){return(A==null||A(H))&&go(H,w._actions)};(P.array(d)||P.object(d))&&this._onOff(qo.Off,l,d,void 0,B),(P.array(h)||P.object(h))&&this._onOff(qo.On,l,h,void 0,B)}},{key:"setPerAction",value:function(l,d){var h=this._defaults;for(var _ in d){var w=_,A=this.options[l],B=d[w];w==="listeners"&&this.updatePerActionListeners(l,A.listeners,B),P.array(B)?A[w]=Jn(B):P.plainObject(B)?(A[w]=F(A[w]||{},ma(B)),P.object(h.perAction[w])&&"enabled"in h.perAction[w]&&(A[w].enabled=B.enabled!==!1)):P.bool(B)&&P.object(h.perAction[w])?A[w].enabled=B:A[w]=B}}},{key:"getRect",value:function(l){return l=l||(P.element(this.target)?this.target:null),P.string(this.target)&&(l=l||this._context.querySelector(this.target)),te(l)}},{key:"rectChecker",value:function(l){var d=this;return P.func(l)?(this.getRect=function(h){var _=F({},l.apply(d,h));return"width"in _||(_.width=_.right-_.left,_.height=_.bottom-_.top),_},this):l===null?(delete this.getRect,this):this.getRect}},{key:"_backCompatOption",value:function(l,d){if(ee(d)||P.object(d)){for(var h in this.options[l]=d,this._actions.map)this.options[h][l]=d;return this}return this.options[l]}},{key:"origin",value:function(l){return this._backCompatOption("origin",l)}},{key:"deltaSource",value:function(l){return l==="page"||l==="client"?(this.options.deltaSource=l,this):this.options.deltaSource}},{key:"getAllElements",value:function(){var l=this.target;return P.string(l)?Array.from(this._context.querySelectorAll(l)):P.func(l)&&l.getAllElements?l.getAllElements():P.element(l)?[l]:[]}},{key:"context",value:function(){return this._context}},{key:"inContext",value:function(l){return this._context===l.ownerDocument||Q(this._context,l)}},{key:"testIgnoreAllow",value:function(l,d,h){return!this.testIgnore(l.ignoreFrom,d,h)&&this.testAllow(l.allowFrom,d,h)}},{key:"testAllow",value:function(l,d,h){return!l||!!P.element(h)&&(P.string(l)?be(h,l,d):!!P.element(l)&&Q(l,h))}},{key:"testIgnore",value:function(l,d,h){return!(!l||!P.element(h))&&(P.string(l)?be(h,l,d):!!P.element(l)&&Q(l,h))}},{key:"fire",value:function(l){return this.events.fire(l),this}},{key:"_onOff",value:function(l,d,h,_,w){P.object(d)&&!P.array(d)&&(_=h,h=null);var A=Se(d,h,w);for(var B in A){B==="wheel"&&(B=re.wheelEvent);for(var H=0,ge=A[B];H<ge.length;H++){var q=ge[H];go(B,this._actions)?this.events[l===qo.On?"on":"off"](B,q):P.string(this.target)?this._scopeEvents[l===qo.On?"addDelegate":"removeDelegate"](this.target,this._context,B,q,_):this._scopeEvents[l===qo.On?"add":"remove"](this.target,B,q,_)}}return this}},{key:"on",value:function(l,d,h){return this._onOff(qo.On,l,d,h)}},{key:"off",value:function(l,d,h){return this._onOff(qo.Off,l,d,h)}},{key:"set",value:function(l){var d=this._defaults;for(var h in P.object(l)||(l={}),this.options=ma(d.base),this._actions.methodDict){var _=h,w=this._actions.methodDict[_];this.options[_]={},this.setPerAction(_,F(F({},d.perAction),d.actions[_])),this[w](l[_])}for(var A in l)A!=="getRect"?P.func(this[A])&&this[A](l[A]):this.rectChecker(l.getRect);return this}},{key:"unset",value:function(){if(P.string(this.target))for(var l in this._scopeEvents.delegatedEvents)for(var d=this._scopeEvents.delegatedEvents[l],h=d.length-1;h>=0;h--){var _=d[h],w=_.selector,A=_.context,B=_.listeners;w===this.target&&A===this._context&&d.splice(h,1);for(var H=B.length-1;H>=0;H--)this._scopeEvents.removeDelegate(this.target,this._context,l,B[H][0],B[H][1])}else this._scopeEvents.remove(this.target,"all")}}]),c}(),Wc=function(){function c(l){var d=this;r(this,c),this.list=[],this.selectorMap={},this.scope=void 0,this.scope=l,l.addListeners({"interactable:unset":function(h){var _=h.interactable,w=_.target,A=P.string(w)?d.selectorMap[w]:w[d.scope.id],B=wo(A,function(H){return H===_});A.splice(B,1)}})}return u(c,[{key:"new",value:function(l,d){d=F(d||{},{actions:this.scope.actions});var h=new this.scope.Interactable(l,d,this.scope.document,this.scope.events);return this.scope.addDocument(h._doc),this.list.push(h),P.string(l)?(this.selectorMap[l]||(this.selectorMap[l]=[]),this.selectorMap[l].push(h)):(h.target[this.scope.id]||Object.defineProperty(l,this.scope.id,{value:[],configurable:!0}),l[this.scope.id].push(h)),this.scope.fire("interactable:new",{target:l,options:d,interactable:h,win:this.scope._win}),h}},{key:"getExisting",value:function(l,d){var h=d&&d.context||this.scope.document,_=P.string(l),w=_?this.selectorMap[l]:l[this.scope.id];if(w)return dt(w,function(A){return A._context===h&&(_||A.inContext(l))})}},{key:"forEachMatch",value:function(l,d){for(var h=0,_=this.list;h<_.length;h++){var w=_[h],A=void 0;if((P.string(w.target)?P.element(l)&&pe(l,w.target):l===w.target)&&w.inContext(l)&&(A=d(w)),A!==void 0)return A}}}]),c}(),ja=function(){function c(){var l=this;r(this,c),this.id="__interact_scope_".concat(Math.floor(100*Math.random())),this.isInitialized=!1,this.listenerMaps=[],this.browser=re,this.defaults=ma(xl),this.Eventable=mr,this.actions={map:{},phases:{start:!0,move:!0,end:!0},methodDict:{},phaselessTypes:{}},this.interactStatic=function(h){var _=function w(A,B){var H=h.interactables.getExisting(A,B);return H||((H=h.interactables.new(A,B)).events.global=w.globalEvents),H};return _.getPointerAverage=ft,_.getTouchBBox=bt,_.getTouchDistance=Mt,_.getTouchAngle=Vt,_.getElementRect=te,_.getElementClientRect=he,_.matchesSelector=pe,_.closest=X,_.globalEvents={},_.version="1.10.27",_.scope=h,_.use=function(w,A){return this.scope.usePlugin(w,A),this},_.isSet=function(w,A){return!!this.scope.interactables.get(w,A&&A.context)},_.on=ga(function(w,A,B){if(P.string(w)&&w.search(" ")!==-1&&(w=w.trim().split(/ +/)),P.array(w)){for(var H=0,ge=w;H<ge.length;H++){var q=ge[H];this.on(q,A,B)}return this}if(P.object(w)){for(var we in w)this.on(we,w[we],A);return this}return go(w,this.scope.actions)?this.globalEvents[w]?this.globalEvents[w].push(A):this.globalEvents[w]=[A]:this.scope.events.add(this.scope.document,w,A,{options:B}),this},"The interact.on() method is being deprecated"),_.off=ga(function(w,A,B){if(P.string(w)&&w.search(" ")!==-1&&(w=w.trim().split(/ +/)),P.array(w)){for(var H=0,ge=w;H<ge.length;H++){var q=ge[H];this.off(q,A,B)}return this}if(P.object(w)){for(var we in w)this.off(we,w[we],A);return this}var Be;return go(w,this.scope.actions)?w in this.globalEvents&&(Be=this.globalEvents[w].indexOf(A))!==-1&&this.globalEvents[w].splice(Be,1):this.scope.events.remove(this.scope.document,w,A,B),this},"The interact.off() method is being deprecated"),_.debug=function(){return this.scope},_.supportsTouch=function(){return re.supportsTouch},_.supportsPointerEvent=function(){return re.supportsPointerEvent},_.stop=function(){for(var w=0,A=this.scope.interactions.list;w<A.length;w++)A[w].stop();return this},_.pointerMoveTolerance=function(w){return P.number(w)?(this.scope.interactions.pointerMoveTolerance=w,this):this.scope.interactions.pointerMoveTolerance},_.addDocument=function(w,A){this.scope.addDocument(w,A)},_.removeDocument=function(w){this.scope.removeDocument(w)},_}(this),this.InteractEvent=Ji,this.Interactable=void 0,this.interactables=new Wc(this),this._win=void 0,this.document=void 0,this.window=void 0,this.documents=[],this._plugins={list:[],map:{}},this.onWindowUnload=function(h){return l.removeDocument(h.target)};var d=this;this.Interactable=function(h){m(w,h);var _=b(w);function w(){return r(this,w),_.apply(this,arguments)}return u(w,[{key:"_defaults",get:function(){return d.defaults}},{key:"set",value:function(A){return k(f(w.prototype),"set",this).call(this,A),d.fire("interactable:set",{options:A,interactable:this}),this}},{key:"unset",value:function(){k(f(w.prototype),"unset",this).call(this);var A=d.interactables.list.indexOf(this);A<0||(d.interactables.list.splice(A,1),d.fire("interactable:unset",{interactable:this}))}}]),w}(Vc)}return u(c,[{key:"addListeners",value:function(l,d){this.listenerMaps.push({id:d,map:l})}},{key:"fire",value:function(l,d){for(var h=0,_=this.listenerMaps;h<_.length;h++){var w=_[h].map[l];if(w&&w(d,this,l)===!1)return!1}}},{key:"init",value:function(l){return this.isInitialized?this:function(d,h){return d.isInitialized=!0,P.window(h)&&me(h),ae.init(h),re.init(h),io.init(h),d.window=h,d.document=h.document,d.usePlugin(zc),d.usePlugin(Go),d}(this,l)}},{key:"pluginIsInstalled",value:function(l){var d=l.id;return d?!!this._plugins.map[d]:this._plugins.list.indexOf(l)!==-1}},{key:"usePlugin",value:function(l,d){if(!this.isInitialized)return this;if(this.pluginIsInstalled(l))return this;if(l.id&&(this._plugins.map[l.id]=l),this._plugins.list.push(l),l.install&&l.install(this,d),l.listeners&&l.before){for(var h=0,_=this.listenerMaps.length,w=l.before.reduce(function(B,H){return B[H]=!0,B[Dl(H)]=!0,B},{});h<_;h++){var A=this.listenerMaps[h].id;if(A&&(w[A]||w[Dl(A)]))break}this.listenerMaps.splice(h,0,{id:l.id,map:l.listeners})}else l.listeners&&this.listenerMaps.push({id:l.id,map:l.listeners});return this}},{key:"addDocument",value:function(l,d){if(this.getDocIndex(l)!==-1)return!1;var h=M(l);d=d?F({},d):{},this.documents.push({doc:l,options:d}),this.events.documents.push(l),l!==this.document&&this.events.add(h,"unload",this.onWindowUnload),this.fire("scope:add-document",{doc:l,window:h,scope:this,options:d})}},{key:"removeDocument",value:function(l){var d=this.getDocIndex(l),h=M(l),_=this.documents[d].options;this.events.remove(h,"unload",this.onWindowUnload),this.documents.splice(d,1),this.events.documents.splice(d,1),this.fire("scope:remove-document",{doc:l,window:h,scope:this,options:_})}},{key:"getDocIndex",value:function(l){for(var d=0;d<this.documents.length;d++)if(this.documents[d].doc===l)return d;return-1}},{key:"getDocOptions",value:function(l){var d=this.getDocIndex(l);return d===-1?null:this.documents[d].options}},{key:"now",value:function(){return(this.window.Date||Date).now()}}]),c}();function Dl(c){return c&&c.replace(/\/.*$/,"")}var Ol=new ja,In=Ol.interactStatic,jc=typeof globalThis<"u"?globalThis:window;Ol.init(jc);var os=Object.freeze({__proto__:null,edgeTarget:function(){},elements:function(){},grid:function(c){var l=[["x","y"],["left","top"],["right","bottom"],["width","height"]].filter(function(h){var _=h[0],w=h[1];return _ in c||w in c}),d=function(h,_){for(var w=c.range,A=c.limits,B=A===void 0?{left:-1/0,right:1/0,top:-1/0,bottom:1/0}:A,H=c.offset,ge=H===void 0?{x:0,y:0}:H,q={range:w,grid:c,x:null,y:null},we=0;we<l.length;we++){var Be=l[we],He=Be[0],Ve=Be[1],Ge=Math.round((h-ge.x)/c[He]),tt=Math.round((_-ge.y)/c[Ve]);q[He]=Math.max(B.left,Math.min(B.right,Ge*c[He]+ge.x)),q[Ve]=Math.max(B.top,Math.min(B.bottom,tt*c[Ve]+ge.y))}return q};return d.grid=c,d.coordFields=l,d}}),Hc={id:"snappers",install:function(c){var l=c.interactStatic;l.snappers=F(l.snappers||{},os),l.createSnapGrid=l.snappers.grid}},Gc=Hc,qc={start:function(c){var l=c.state,d=c.rect,h=c.edges,_=c.pageCoords,w=l.options,A=w.ratio,B=w.enabled,H=l.options,ge=H.equalDelta,q=H.modifiers;A==="preserve"&&(A=d.width/d.height),l.startCoords=F({},_),l.startRect=F({},d),l.ratio=A,l.equalDelta=ge;var we=l.linkedEdges={top:h.top||h.left&&!h.bottom,left:h.left||h.top&&!h.right,bottom:h.bottom||h.right&&!h.top,right:h.right||h.bottom&&!h.left};if(l.xIsPrimaryAxis=!(!h.left&&!h.right),l.equalDelta){var Be=(we.left?1:-1)*(we.top?1:-1);l.edgeSign={x:Be,y:Be}}else l.edgeSign={x:we.left?-1:1,y:we.top?-1:1};if(B!==!1&&F(h,we),q!=null&&q.length){var He=new Zr(c.interaction);He.copyFrom(c.interaction.modification),He.prepareStates(q),l.subModification=He,He.startAll(o({},c))}},set:function(c){var l=c.state,d=c.rect,h=c.coords,_=l.linkedEdges,w=F({},h),A=l.equalDelta?Yc:U;if(F(c.edges,_),A(l,l.xIsPrimaryAxis,h,d),!l.subModification)return null;var B=F({},d);G(_,B,{x:h.x-w.x,y:h.y-w.y});var H=l.subModification.setAll(o(o({},c),{},{rect:B,edges:_,pageCoords:h,prevCoords:h,prevRect:B})),ge=H.delta;return H.changed&&(A(l,Math.abs(ge.x)>Math.abs(ge.y),H.coords,H.rect),F(h,H.coords)),H.eventProps},defaults:{ratio:"preserve",equalDelta:!1,modifiers:[],enabled:!1}};function Yc(c,l,d){var h=c.startCoords,_=c.edgeSign;l?d.y=h.y+(d.x-h.x)*_.y:d.x=h.x+(d.y-h.y)*_.x}function U(c,l,d,h){var _=c.startRect,w=c.startCoords,A=c.ratio,B=c.edgeSign;if(l){var H=h.width/A;d.y=w.y+(H-_.height)*B.y}else{var ge=h.height*A;d.x=w.x+(ge-_.width)*B.x}}var R=Ho(qc,"aspectRatio"),xe=function(){};xe._defaults={};var Ie=xe;function Qe(c,l,d){return P.func(c)?Y(c,l.interactable,l.element,[d.x,d.y,l]):Y(c,l.interactable,l.element)}var Me={start:function(c){var l=c.rect,d=c.startOffset,h=c.state,_=c.interaction,w=c.pageCoords,A=h.options,B=A.elementRect,H=F({left:0,top:0,right:0,bottom:0},A.offset||{});if(l&&B){var ge=Qe(A.restriction,_,w);if(ge){var q=ge.right-ge.left-l.width,we=ge.bottom-ge.top-l.height;q<0&&(H.left+=q,H.right+=q),we<0&&(H.top+=we,H.bottom+=we)}H.left+=d.left-l.width*B.left,H.top+=d.top-l.height*B.top,H.right+=d.right-l.width*(1-B.right),H.bottom+=d.bottom-l.height*(1-B.bottom)}h.offset=H},set:function(c){var l=c.coords,d=c.interaction,h=c.state,_=h.options,w=h.offset,A=Qe(_.restriction,d,l);if(A){var B=function(H){return!H||"left"in H&&"top"in H||((H=F({},H)).left=H.x||0,H.top=H.y||0,H.right=H.right||H.left+H.width,H.bottom=H.bottom||H.top+H.height),H}(A);l.x=Math.max(Math.min(B.right-w.right,l.x),B.left+w.left),l.y=Math.max(Math.min(B.bottom-w.bottom,l.y),B.top+w.top)}},defaults:{restriction:null,elementRect:null,offset:null,endOnly:!1,enabled:!1}},je=Ho(Me,"restrict"),Je={top:1/0,left:1/0,bottom:-1/0,right:-1/0},gt={top:-1/0,left:-1/0,bottom:1/0,right:1/0};function kt(c,l){for(var d=0,h=["top","left","bottom","right"];d<h.length;d++){var _=h[d];_ in c||(c[_]=l[_])}return c}var xt={noInner:Je,noOuter:gt,start:function(c){var l,d=c.interaction,h=c.startOffset,_=c.state,w=_.options;w&&(l=L(Qe(w.offset,d,d.coords.start.page))),l=l||{x:0,y:0},_.offset={top:l.y+h.top,left:l.x+h.left,bottom:l.y-h.bottom,right:l.x-h.right}},set:function(c){var l=c.coords,d=c.edges,h=c.interaction,_=c.state,w=_.offset,A=_.options;if(d){var B=F({},l),H=Qe(A.inner,h,B)||{},ge=Qe(A.outer,h,B)||{};kt(H,Je),kt(ge,gt),d.top?l.y=Math.min(Math.max(ge.top+w.top,B.y),H.top+w.top):d.bottom&&(l.y=Math.max(Math.min(ge.bottom+w.bottom,B.y),H.bottom+w.bottom)),d.left?l.x=Math.min(Math.max(ge.left+w.left,B.x),H.left+w.left):d.right&&(l.x=Math.max(Math.min(ge.right+w.right,B.x),H.right+w.right))}},defaults:{inner:null,outer:null,offset:null,endOnly:!1,enabled:!1}},dn=Ho(xt,"restrictEdges"),ln=F({get elementRect(){return{top:0,left:0,bottom:1,right:1}},set elementRect(c){}},Me.defaults),_t=Ho({start:Me.start,set:Me.set,defaults:ln},"restrictRect"),Rt={width:-1/0,height:-1/0},Et={width:1/0,height:1/0},Ct=Ho({start:function(c){return xt.start(c)},set:function(c){var l=c.interaction,d=c.state,h=c.rect,_=c.edges,w=d.options;if(_){var A=C(Qe(w.min,l,c.coords))||Rt,B=C(Qe(w.max,l,c.coords))||Et;d.options={endOnly:w.endOnly,inner:F({},xt.noInner),outer:F({},xt.noOuter)},_.top?(d.options.inner.top=h.bottom-A.height,d.options.outer.top=h.bottom-B.height):_.bottom&&(d.options.inner.bottom=h.top+A.height,d.options.outer.bottom=h.top+B.height),_.left?(d.options.inner.left=h.right-A.width,d.options.outer.left=h.right-B.width):_.right&&(d.options.inner.right=h.left+A.width,d.options.outer.right=h.left+B.width),xt.set(c),d.options=w}},defaults:{min:null,max:null,endOnly:!1,enabled:!1}},"restrictSize"),Wt={start:function(c){var l,d=c.interaction,h=c.interactable,_=c.element,w=c.rect,A=c.state,B=c.startOffset,H=A.options,ge=H.offsetWithOrigin?function(Be){var He=Be.interaction.element,Ve=L(Y(Be.state.options.origin,null,null,[He])),Ge=Ve||de(Be.interactable,He,Be.interaction.prepared.name);return Ge}(c):{x:0,y:0};if(H.offset==="startCoords")l={x:d.coords.start.page.x,y:d.coords.start.page.y};else{var q=Y(H.offset,h,_,[d]);(l=L(q)||{x:0,y:0}).x+=ge.x,l.y+=ge.y}var we=H.relativePoints;A.offsets=w&&we&&we.length?we.map(function(Be,He){return{index:He,relativePoint:Be,x:B.left-w.width*Be.x+l.x,y:B.top-w.height*Be.y+l.y}}):[{index:0,relativePoint:null,x:l.x,y:l.y}]},set:function(c){var l=c.interaction,d=c.coords,h=c.state,_=h.options,w=h.offsets,A=de(l.interactable,l.element,l.prepared.name),B=F({},d),H=[];_.offsetWithOrigin||(B.x-=A.x,B.y-=A.y);for(var ge=0,q=w;ge<q.length;ge++)for(var we=q[ge],Be=B.x-we.x,He=B.y-we.y,Ve=0,Ge=_.targets.length;Ve<Ge;Ve++){var tt=_.targets[Ve],Xe=void 0;(Xe=P.func(tt)?tt(Be,He,l._proxy,we,Ve):tt)&&H.push({x:(P.number(Xe.x)?Xe.x:Be)+we.x,y:(P.number(Xe.y)?Xe.y:He)+we.y,range:P.number(Xe.range)?Xe.range:_.range,source:tt,index:Ve,offset:we})}for(var at={target:null,inRange:!1,distance:0,range:0,delta:{x:0,y:0}},wt=0;wt<H.length;wt++){var It=H[wt],pt=It.range,St=It.x-B.x,Xn=It.y-B.y,pn=N(St,Xn),mo=pn<=pt;pt===1/0&&at.inRange&&at.range!==1/0&&(mo=!1),at.target&&!(mo?at.inRange&&pt!==1/0?pn/pt<at.distance/at.range:pt===1/0&&at.range!==1/0||pn<at.distance:!at.inRange&&pn<at.distance)||(at.target=It,at.distance=pn,at.range=pt,at.inRange=mo,at.delta.x=St,at.delta.y=Xn)}return at.inRange&&(d.x=at.target.x,d.y=at.target.y),h.closest=at,at},defaults:{range:1/0,targets:null,offset:null,offsetWithOrigin:!0,origin:null,relativePoints:null,endOnly:!1,enabled:!1}},Yt=Ho(Wt,"snap"),vn={start:function(c){var l=c.state,d=c.edges,h=l.options;if(!d)return null;c.state={options:{targets:null,relativePoints:[{x:d.left?0:1,y:d.top?0:1}],offset:h.offset||"self",origin:{x:0,y:0},range:h.range}},l.targetFields=l.targetFields||[["width","height"],["x","y"]],Wt.start(c),l.offsets=c.state.offsets,c.state=l},set:function(c){var l=c.interaction,d=c.state,h=c.coords,_=d.options,w=d.offsets,A={x:h.x-w[0].x,y:h.y-w[0].y};d.options=F({},_),d.options.targets=[];for(var B=0,H=_.targets||[];B<H.length;B++){var ge=H[B],q=void 0;if(q=P.func(ge)?ge(A.x,A.y,l):ge){for(var we=0,Be=d.targetFields;we<Be.length;we++){var He=Be[we],Ve=He[0],Ge=He[1];if(Ve in q||Ge in q){q.x=q[Ve],q.y=q[Ge];break}}d.options.targets.push(q)}}var tt=Wt.set(c);return d.options=_,tt},defaults:{range:1/0,targets:null,offset:null,endOnly:!1,enabled:!1}},vr=Ho(vn,"snapSize"),va={aspectRatio:R,restrictEdges:dn,restrict:je,restrictRect:_t,restrictSize:Ct,snapEdges:Ho({start:function(c){var l=c.edges;return l?(c.state.targetFields=c.state.targetFields||[[l.left?"left":"right",l.top?"top":"bottom"]],vn.start(c)):null},set:vn.set,defaults:F(ma(vn.defaults),{targets:void 0,range:void 0,offset:{x:0,y:0}})},"snapEdges"),snap:Yt,snapSize:vr,spring:Ie,avoid:Ie,transform:Ie,rubberband:Ie},Rl={id:"modifiers",install:function(c){var l=c.interactStatic;for(var d in c.usePlugin(wl),c.usePlugin(Gc),l.modifiers=va,va){var h=va[d],_=h._defaults,w=h._methods;_._methods=w,c.defaults.perAction[d]=_}}},Io=Rl,Pl=function(c){m(d,c);var l=b(d);function d(h,_,w,A,B,H){var ge;if(r(this,d),j(x(ge=l.call(this,B)),w),w!==_&&j(x(ge),_),ge.timeStamp=H,ge.originalEvent=w,ge.type=h,ge.pointerId=qe(_),ge.pointerType=An(_),ge.target=A,ge.currentTarget=null,h==="tap"){var q=B.getPointerIndex(_);ge.dt=ge.timeStamp-B.pointers[q].downTime;var we=ge.timeStamp-B.tapTime;ge.double=!!B.prevTap&&B.prevTap.type!=="doubletap"&&B.prevTap.target===ge.target&&we<500}else h==="doubletap"&&(ge.dt=_.timeStamp-B.tapTime,ge.double=!0);return ge}return u(d,[{key:"_subtractOrigin",value:function(h){var _=h.x,w=h.y;return this.pageX-=_,this.pageY-=w,this.clientX-=_,this.clientY-=w,this}},{key:"_addOrigin",value:function(h){var _=h.x,w=h.y;return this.pageX+=_,this.pageY+=w,this.clientX+=_,this.clientY+=w,this}},{key:"preventDefault",value:function(){this.originalEvent.preventDefault()}}]),d}(an),Ha={id:"pointer-events/base",before:["inertia","modifiers","auto-start","actions"],install:function(c){c.pointerEvents=Ha,c.defaults.actions.pointerEvents=Ha.defaults,F(c.actions.phaselessTypes,Ha.types)},listeners:{"interactions:new":function(c){var l=c.interaction;l.prevTap=null,l.tapTime=0},"interactions:update-pointer":function(c){var l=c.down,d=c.pointerInfo;!l&&d.hold||(d.hold={duration:1/0,timeout:null})},"interactions:move":function(c,l){var d=c.interaction,h=c.pointer,_=c.event,w=c.eventTarget;c.duplicate||d.pointerIsDown&&!d.pointerWasMoved||(d.pointerIsDown&&Kc(c),Yo({interaction:d,pointer:h,event:_,eventTarget:w,type:"move"},l))},"interactions:down":function(c,l){(function(d,h){for(var _=d.interaction,w=d.pointer,A=d.event,B=d.eventTarget,H=d.pointerIndex,ge=_.pointers[H].hold,q=K(B),we={interaction:_,pointer:w,event:A,eventTarget:B,type:"hold",targets:[],path:q,node:null},Be=0;Be<q.length;Be++){var He=q[Be];we.node=He,h.fire("pointerEvents:collect-targets",we)}if(we.targets.length){for(var Ve=1/0,Ge=0,tt=we.targets;Ge<tt.length;Ge++){var Xe=tt[Ge].eventable.options.holdDuration;Xe<Ve&&(Ve=Xe)}ge.duration=Ve,ge.timeout=setTimeout(function(){Yo({interaction:_,eventTarget:B,pointer:w,event:A,type:"hold"},h)},Ve)}})(c,l),Yo(c,l)},"interactions:up":function(c,l){Kc(c),Yo(c,l),function(d,h){var _=d.interaction,w=d.pointer,A=d.event,B=d.eventTarget;_.pointerWasMoved||Yo({interaction:_,eventTarget:B,pointer:w,event:A,type:"tap"},h)}(c,l)},"interactions:cancel":function(c,l){Kc(c),Yo(c,l)}},PointerEvent:Pl,fire:Yo,collectEventTargets:Rh,defaults:{holdDuration:600,ignoreFrom:null,allowFrom:null,origin:{x:0,y:0}},types:{down:!0,move:!0,up:!0,cancel:!0,tap:!0,doubletap:!0,hold:!0}};function Yo(c,l){var d=c.interaction,h=c.pointer,_=c.event,w=c.eventTarget,A=c.type,B=c.targets,H=B===void 0?Rh(c,l):B,ge=new Pl(A,h,_,w,d,l.now());l.fire("pointerEvents:new",{pointerEvent:ge});for(var q={interaction:d,pointer:h,event:_,eventTarget:w,targets:H,type:A,pointerEvent:ge},we=0;we<H.length;we++){var Be=H[we];for(var He in Be.props||{})ge[He]=Be.props[He];var Ve=de(Be.eventable,Be.node);if(ge._subtractOrigin(Ve),ge.eventable=Be.eventable,ge.currentTarget=Be.node,Be.eventable.fire(ge),ge._addOrigin(Ve),ge.immediatePropagationStopped||ge.propagationStopped&&we+1<H.length&&H[we+1].node!==ge.currentTarget)break}if(l.fire("pointerEvents:fired",q),A==="tap"){var Ge=ge.double?Yo({interaction:d,pointer:h,event:_,eventTarget:w,type:"doubletap"},l):ge;d.prevTap=Ge,d.tapTime=Ge.timeStamp}return ge}function Rh(c,l){var d=c.interaction,h=c.pointer,_=c.event,w=c.eventTarget,A=c.type,B=d.getPointerIndex(h),H=d.pointers[B];if(A==="tap"&&(d.pointerWasMoved||!H||H.downTarget!==w))return[];for(var ge=K(w),q={interaction:d,pointer:h,event:_,eventTarget:w,type:A,path:ge,targets:[],node:null},we=0;we<ge.length;we++){var Be=ge[we];q.node=Be,l.fire("pointerEvents:collect-targets",q)}return A==="hold"&&(q.targets=q.targets.filter(function(He){var Ve,Ge;return He.eventable.options.holdDuration===((Ve=d.pointers[B])==null||(Ge=Ve.hold)==null?void 0:Ge.duration)})),q.targets}function Kc(c){var l=c.interaction,d=c.pointerIndex,h=l.pointers[d].hold;h&&h.timeout&&(clearTimeout(h.timeout),h.timeout=null)}var HI=Object.freeze({__proto__:null,default:Ha});function GI(c){var l=c.interaction;l.holdIntervalHandle&&(clearInterval(l.holdIntervalHandle),l.holdIntervalHandle=null)}var qI={id:"pointer-events/holdRepeat",install:function(c){c.usePlugin(Ha);var l=c.pointerEvents;l.defaults.holdRepeatInterval=0,l.types.holdrepeat=c.actions.phaselessTypes.holdrepeat=!0},listeners:["move","up","cancel","endall"].reduce(function(c,l){return c["pointerEvents:".concat(l)]=GI,c},{"pointerEvents:new":function(c){var l=c.pointerEvent;l.type==="hold"&&(l.count=(l.count||0)+1)},"pointerEvents:fired":function(c,l){var d=c.interaction,h=c.pointerEvent,_=c.eventTarget,w=c.targets;if(h.type==="hold"&&w.length){var A=w[0].eventable.options.holdRepeatInterval;A<=0||(d.holdIntervalHandle=setTimeout(function(){l.pointerEvents.fire({interaction:d,eventTarget:_,type:"hold",pointer:h,event:h},l)},A))}}})},YI=qI,KI={id:"pointer-events/interactableTargets",install:function(c){var l=c.Interactable;l.prototype.pointerEvents=function(h){return F(this.events.options,h),this};var d=l.prototype._backCompatOption;l.prototype._backCompatOption=function(h,_){var w=d.call(this,h,_);return w===this&&(this.events.options[h]=_),w}},listeners:{"pointerEvents:collect-targets":function(c,l){var d=c.targets,h=c.node,_=c.type,w=c.eventTarget;l.interactables.forEachMatch(h,function(A){var B=A.events,H=B.options;B.types[_]&&B.types[_].length&&A.testIgnoreAllow(H,h,w)&&d.push({node:h,eventable:B,props:{interactable:A}})})},"interactable:new":function(c){var l=c.interactable;l.events.getRect=function(d){return l.getRect(d)}},"interactable:set":function(c,l){var d=c.interactable,h=c.options;F(d.events.options,l.pointerEvents.defaults),F(d.events.options,h.pointerEvents||{})}}},JI=KI,XI={id:"pointer-events",install:function(c){c.usePlugin(HI),c.usePlugin(YI),c.usePlugin(JI)}},QI=XI,ZI={id:"reflow",install:function(c){var l=c.Interactable;c.actions.phases.reflow=!0,l.prototype.reflow=function(d){return function(h,_,w){for(var A=h.getAllElements(),B=w.window.Promise,H=B?[]:null,ge=function(){var we=A[q],Be=h.getRect(we);if(!Be)return 1;var He,Ve=dt(w.interactions.list,function(Xe){return Xe.interacting()&&Xe.interactable===h&&Xe.element===we&&Xe.prepared.name===_.name});if(Ve)Ve.move(),H&&(He=Ve._reflowPromise||new B(function(Xe){Ve._reflowResolve=Xe}));else{var Ge=C(Be),tt=function(Xe){return{coords:Xe,get page(){return this.coords.page},get client(){return this.coords.client},get timeStamp(){return this.coords.timeStamp},get pageX(){return this.coords.page.x},get pageY(){return this.coords.page.y},get clientX(){return this.coords.client.x},get clientY(){return this.coords.client.y},get pointerId(){return this.coords.pointerId},get target(){return this.coords.target},get type(){return this.coords.type},get pointerType(){return this.coords.pointerType},get buttons(){return this.coords.buttons},preventDefault:function(){}}}({page:{x:Ge.x,y:Ge.y},client:{x:Ge.x,y:Ge.y},timeStamp:w.now()});He=function(Xe,at,wt,It,pt){var St=Xe.interactions.new({pointerType:"reflow"}),Xn={interaction:St,event:pt,pointer:pt,eventTarget:wt,phase:"reflow"};St.interactable=at,St.element=wt,St.prevEvent=pt,St.updatePointer(pt,pt,wt,!0),Pe(St.coords.delta),ur(St.prepared,It),St._doPhase(Xn);var pn=Xe.window,mo=pn.Promise,Do=mo?new mo(function(_a){St._reflowResolve=_a}):void 0;return St._reflowPromise=Do,St.start(It,at,wt),St._interacting?(St.move(Xn),St.end(pt)):(St.stop(),St._reflowResolve()),St.removePointer(pt,pt),Do}(w,h,we,_,tt)}H&&H.push(He)},q=0;q<A.length&&!ge();q++);return H&&B.all(H).then(function(){return h})}(this,d,c)}},listeners:{"interactions:stop":function(c,l){var d=c.interaction;d.pointerType==="reflow"&&(d._reflowResolve&&d._reflowResolve(),function(h,_){h.splice(h.indexOf(_),1)}(l.interactions.list,d))}}},eD=ZI;if(In.use(fr),In.use(kl),In.use(QI),In.use(Ll),In.use(Io),In.use(bl),In.use(Bn),In.use(Jr),In.use(eD),In.default=In,a(e)==="object"&&e)try{e.exports=In}catch{}return In.default=In,In})}(Ii,Ii.exports)),Ii.exports}var T2=S2();const dg=ug(T2),qt=(e,t)=>{const n=e.__vccOpts||e;for(const[o,a]of t)n[o]=a;return n},k2={class:"weilin_prompt_ui_window-title"},C2=["title"],E2=["title"],$2=["title"],L2=["title"],co=qt({__name:"DraggableWindow",props:{title:{type:String,required:!0},position:{type:Object,required:!0},size:{type:Object,required:!0},zIndex:{type:Number,default:1},name:{type:String,default:"default_window_name"}},emits:["update:position","update:size","active","close"],setup(e,{emit:t}){const n=e,{t:o}=Gt(),a=t,r=S(null);let s=null,u=null;const p=S({x:0,y:0}),m=S({width:600,height:400});At(()=>n.position,z=>{z&&(p.value={...z})},{immediate:!0,deep:!0}),At(()=>n.size,z=>{z&&(m.value={...z})},{immediate:!0,deep:!0});let f=null;const g=()=>{f||(f=setTimeout(()=>{window.parent.postMessage({type:`weilin_prompt_ui_window_change_${n.name}_scroll`},"*"),f=null},100))},x=(z,ce,P=m.value.width)=>{const le=window.innerWidth,ie=window.innerHeight;return{x:Math.min(Math.max(100-P,z),le-100),y:Math.min(Math.max(100,ce),ie-100)}},b=()=>{u&&(u.stop(),u=null)},k=z=>{var P;return((z==null?void 0:z.buttons)??((P=z==null?void 0:z.originalEvent)==null?void 0:P.buttons))===0},$=z=>k(z)?(b(),!0):!1,O=()=>{b()},I=()=>{r.value&&(s=dg(r.value).draggable({allowFrom:".weilin_prompt_ui_window-header",ignoreFrom:".weilin_prompt_ui_close-btn,.weilin_prompt_ui_resize-handle",listeners:{start(z){u=z.interaction},move(z){if($(z))return;const ce=x(p.value.x+z.dx,p.value.y+z.dy);p.value=ce,a("update:position",ce)},end(){u=null}}}).resizable({edges:{top:".weilin_prompt_ui_resize-handle-nw, .weilin_prompt_ui_resize-handle-ne",right:".weilin_prompt_ui_resize-handle-ne, .weilin_prompt_ui_resize-handle-se",bottom:".weilin_prompt_ui_resize-handle-sw, .weilin_prompt_ui_resize-handle-se",left:".weilin_prompt_ui_resize-handle-nw, .weilin_prompt_ui_resize-handle-sw"},modifiers:[dg.modifiers.restrictSize({min:{width:200,height:200}})],listeners:{start(z){u=z.interaction},move(z){if($(z))return;const ce={width:z.rect.width,height:z.rect.height},P=x(p.value.x+z.deltaRect.left,p.value.y+z.deltaRect.top,ce.width);p.value=P,m.value=ce,a("update:position",P),a("update:size",ce)},end(){u=null}}}))};Ut(()=>{var z;n.position&&(p.value=x(n.position.x,n.position.y,((z=n.size)==null?void 0:z.width)||m.value.width)),n.size&&(m.value={...n.size}),I(),window.addEventListener("blur",O),window.addEventListener("mouseup",b),window.addEventListener("pointerup",b)}),so(()=>{f&&(clearTimeout(f),f=null),window.removeEventListener("blur",O),window.removeEventListener("mouseup",b),window.removeEventListener("pointerup",b),b(),s&&(s.unset(),s=null)});const V=()=>{a("active")},me=()=>{a("close")},M=()=>{V()};return(z,ce)=>(E(),Jt(zd,{to:"#weilin_comfyui_tools_prompt_ui_div"},[i("div",{ref_key:"windowRef",ref:r,class:"weilin_prompt_ui_draggable-window",style:Bt({left:`${p.value.x}px`,top:`${p.value.y}px`,width:`${m.value.width}px`,height:`${m.value.height}px`,zIndex:e.zIndex}),onMousedown:V},[i("div",{class:"weilin_prompt_ui_window-header",onMousedown:Tt(M,["stop"])},[i("div",k2,y(e.title),1),i("button",{class:"weilin_prompt_ui_close-btn",onClick:me},"×")],32),i("div",{class:"weilin_prompt_ui_window-content",onScroll:g},[mi(z.$slots,"default",{},void 0,!0)],32),i("div",{class:"weilin_prompt_ui_resize-handle weilin_prompt_ui_resize-handle-nw",title:v(o)("common.windowSize")},null,8,C2),i("div",{class:"weilin_prompt_ui_resize-handle weilin_prompt_ui_resize-handle-ne",title:v(o)("common.windowSize")},null,8,E2),i("div",{class:"weilin_prompt_ui_resize-handle weilin_prompt_ui_resize-handle-sw",title:v(o)("common.windowSize")},null,8,$2),i("div",{class:"weilin_prompt_ui_resize-handle weilin_prompt_ui_resize-handle-se",title:v(o)("common.windowSize")},null,8,L2)],36)]))}},[["__scopeId","data-v-d64522ec"]]),sa="v0.0.76",A2={promptBox:{placeholder:"请输入文本...",delete:"删除",newline:"换行",tab:"制表符",windowTitle:`WeiLin提示词UI窗口 ${sa}`,windowTitleGlobal:`WeiLin全局提示词UI窗口 ${sa}`,translate:"翻译",translatePlaceholder:"请输入要翻译的文本,回车即可",weight:"权重",weightPlaceholder:"请输入权重",addBracket:"添加括号",removeLayer:"减去括号",hiddenHint:"双击显示提示词",tagTips:`鼠标左键双击屏蔽Tag
|
||
鼠标左键单击Tag可以编辑
|
||
鼠标左键拖动可以拖动Tag`,oneClickRandomTag:"一键随机Tag",oneClickCleanAll:"一键清空所有",oneClickClearDisabled:"一键清空禁用",clearDisabledSuccess:"已清空所有禁用标签",randomTagSettings:"设置随机Tag规则",oneClickTranslate:"一键翻译Tag",showDeleteButton:"显示删除按钮",hideDeleteButton:"隐藏删除按钮",modelWeight:"模型权重",textWeight:"文本权重",favour:"收藏",lineToken:"换行",addLineToken:"添加换行符",settings:{title:"设置",cancel:"取消",save:"保存",translator:"翻译设置",sourceLanguage:"源语言",targetLanguage:"目标语言",chinese_simplified:"简体中文",english:"英语",close:"关闭",auto_detect:"自动检测",setting_function_toggles:"功能开关设置",setting_function_toggles_full:"功能开关设置(保存后重新打开窗口生效)",enableClearAll:"启用一键清空所有",enableDeleteButton:"启用删除按钮显示开关",enableRandomTag:"启用一键随机标签",enableRandomTagSettings:"启用随机标签设置",enableTranslateTag:"启用一键翻译标签",enableClearDisabled:"启用一键清空禁用",setting_floating_ball:"悬浮球设置",setting_prompt_box:"提示词设置",enablePromptCommaShow:"显示提示词逗号",floatingBallCount:"悬浮球数量",floatingBallCountPlaceholder:"请输入悬浮球数量",floatingBallSize:"悬浮球宽度",floatingBallSizePlaceholder:"请输入悬浮球宽度",floatingBallHeight:"悬浮球高度",floatingBallHeightPlaceholder:"请输入悬浮球高度",enableFloatingBall:"启用悬浮球",enableCommaConversion:"启用逗号转换,全角逗号转为半角逗号",enablePeriodConversion:"启用句号转换,全角句号转为半角句号",enableBracketConversion:"启用括号转换,全角括号转为半角括号",enableAngleBracketConversion:"启用尖括号转换,全角尖括号转为半角尖括号",enableUnderscoreToBracket:"启用下划线转换,下划线转换为空格",enableBracketEscape:"启用括号转义,自动添加\\转义括号",enableCommaCloseAutocomplete:"启动逗号关闭补全,输入逗号立即关闭补全列表",setting_openai_box:"OpenAI设置",openai_api_key:"API Key",openai_api_key_placeholder:"请输入API Key",openai_api_key_save:"保存",openaiSettings:"OpenAI设置",openai_base_url:"Base URL",openai_base_url_placeholder:"请输入Base URL",openai_model:"模型",openai_model_placeholder:"请输入模型",not_set:"未设置",edit:"编辑",delete:"删除",selectedOpenaiConfig:"当前选择的OpenAI配置",addNewConfig:"添加OpenAI配置",setting_sponsor_me:"赞助我",sponsorMe:"赞助我",sponsorMeTip:"赞助我,支持我继续开发",sponsorMeLink:"唯一赞助链接 https://afdian.com/a/weilin9999",setting_start_panel:"启动面板",startPanel:"启动面板",startPanelTip:"点击启动面板,启动成功后会自动打开面板页面",selectTranslater:"选择翻译器",selectOptionNetworkTranslater:"三方网络翻译",selectOptionPythonTranslater:"翻译库翻译",apply:"应用",selectOptionNetworkTranslaterTitle:"三方网络翻译设置",selectOptionPythonTranslaterTitle:"翻译库设置",selectOptionNetworkTranslaterInfo:"使用的三方工具是(仅网络翻译)",selectOptionPythonTranslaterInfo:"使用的翻译包为translators",install:"安装",nowTranlaterPackageState:"当前翻译包状态:",tranlaterPackageStateTrue:"已安装",tranlaterPackageStateFlase:"未安装",installed:"正在安装中...",installTranslaterPackageInfo:"当前正在安装翻译库中,请不要关闭窗口!等待安装完成",translaterSetting:"翻译设置",chooseTranslaterSetting:"选择翻译服务:",translaterLangSourceSetting:"翻译语言:",translaterLangTargeSetting:"翻译目标语言:",saveTranslaterSetting:"保存设置",testTranslaterTitle:"测试翻译",inputTestTranslater:"输入翻译内容:",outPutTestTranslater:"翻译结果:",testingTranslater:"测试翻译",inputTestTranslaterPlaceholder:"请输入要翻译的内容",outPutTestTranslaterPlaceholder:"翻译结果将显示在这里",errorPrompt:"读取节点提示词失败!",setting_auto_complete_limit:"补全提示设置",show_auto_limit:"显示补全提示数量",showAutoLimitPlaceholder:"请输入要显示的数量",settingAutoCompleteWidth:"设置补全提示框宽度",settingAutoCompleteWidthPlaceholder:"请输入宽度",settingAutoCompleteHeight:"设置补全提示框最大高度",settingAutoCompleteHeightPlaceholder:"请输入最大高度",skinSetting:"皮肤设置",defaultSkin:"默认皮肤",customSkin:"自定义皮肤",uploadSkin:"上传皮肤",bgSetting:"背景设置",gradientBg:"渐变颜色",transparentBg:"透明",gradientColor:"渐变颜色选择",borderRadius:"圆角设置",resetToDefault:"恢复默认"}},controls:{language:"语言",settings:"设置",switchTheme:"切换主题",darkMode:"夜间模式",lightMode:"日间模式",tagManager:"标签管理",loraStack:"Lora堆",loraManager:"Lora管理",history:"历史记录",addLora:"添加Lora",removeLora:"移除Lora",lookOnLora:"查看Lora",aiChat:"AI对话",github:"Github主页",shareCloudData:"共享云数据",tutorialVideo:"教程视频",sponsor:"赞助我",danbooruManager:"Danbooru管理器"},theme:{toggle:"切换主题"},common:{confirmDelete:"确认删除",delete:"删除",cancel:"取消",confirm:"确定",edit:"编辑",save:"保存",refresh:"刷新",copy:"复制",copySuccess:"复制成功",copyFailed:"复制失败",windowSize:"调节窗口大小",showMore:"显示更多",showLess:"收起"},cloudWindow:{windowTitle:"共享云仓库",back:"返回上一级",currentPath:"当前路径",tagDatabase:"Tag 数据库",danbooruDatabase:"Danbooru 数据库",open:"打开文件夹",installed:"已安装",install:"安装",installing:"正在安装..."},nodeListWindow:{windowTitle:"节点列表",openPromptUI:"打开提示词编辑器"},lora:{title:"Lora 信息",rawTitle:"LoraRaw",file:"文件",hash:"Hash值",civitai:"Civitai",viewOnCivitai:"在 Civitai 上查看",fetchFromCivitai:"从 Civitai 获取信息",modelNotFound:"模型未找到",modelNotFoundTip:"该模型在 Civitai 上未找到,可能是私有模型或已被删除",name:"名称",nameTip:"模型的显示名称",type:"类型",baseModel:"基础模型",trainedWords:"训练词",trainedWordsTip:"模型训练时使用的关键词,点击可选择复制",selectedWords:"已选择 {count} 个词",strengthMin:"最小强度",strengthMinTip:"推荐的最小强度值",strengthMax:"最大强度",strengthMaxTip:"推荐的最大强度值",promptWords:"提示词",promptWordsTip:"使用该模型时的推荐提示词",loraWorks:"Lora提示词",strWeight:"文本强度权重",hideLora:"禁用Lora",showLora:"启用Lora",skipClip:"跳过层",seeLoraRaw:"查看LoraRaw",addDiyFiled:"添加自定义字段",getCivitData:"获取Civitai信息",copy:"复制"},tagManager:{deletePrimaryCategoryConfirm:"确定要删除分类 {name} 吗?",deleteGroupConfirm:"确定要删除分组 {name} 吗?",deleteTagConfirm:"确定要删除标签 {name} 吗?",windowTitle:"标签管理器",categories:"分类管理",groups:"分组管理",selectCategory:"请选择分类",selectGroup:"请选择分组",addPrimaryCategory:"添加分类",addGroup:"添加分组",editPrimaryCategory:"编辑分类",editGroup:"编辑分组",editTag:"编辑标签",categoryName:"分类名称",categoryNamePlaceholder:"请输入分类名称",categoryNameRequired:"分类名称不能为空",groupName:"分组名称",groupNamePlaceholder:"请输入分组名称",groupNameRequired:"分组名称不能为空",addTag:"添加Tag",text:"Tag描述",textPlaceholder:"请输入Tag描述",description:"Tag",descriptionPlaceholder:"请输入Tag",textRequired:"Tag和Tag描述不能为空",favourRequired:"Tag和Tag描述不能为空,且必须选择分组",backgroundColor:"背景颜色",colorPickerTitle:"选择颜色",opacity:"透明度",searchPlaceholder:"搜索Tag...",noResults:"未找到相关结果",searchInCategory:"在分类中",searchInTag:"在Tag中",save:"保存",cancel:"取消",confirm:"确定",delete:"删除",addSubCategory:"添加子分类",editSubCategory:"编辑子分类",subCategoryName:"子分类名称",subCategoryNamePlaceholder:"请输入子分类名称",subCategoryNameRequired:"子分类名称不能为空",deleteConfirmTitle:"确认删除",deleteConfirmMessage:"此操作将永久删除该{type},是否继续?",deleteSuccess:"删除成功",deleteFailed:"删除失败",saveSuccess:"保存成功",saveFailed:"保存失败",colorPickerAlpha:"透明度",colorPickerHex:"十六进制颜色值",colorPreview:"颜色预览",dragToSort:"拖动排序",searchTags:"搜索标签",noTagsFound:"未找到标签",noGroupsFound:"未找到分组",noCategoriesFound:"未找到分类",refresh:"刷新",refreshing:"刷新中...",refreshSuccess:"刷新成功",refreshFailed:"刷新失败",search:"搜索",searching:"搜索中...",searchResult:"搜索结果",searchInPath:"位于: {path}",category:"分类",group:"分组",tag:"标签",resultType:{category:"分类",group:"分组",tag:"标签"},hasDeleteAction:"批量删除",deleteSelected:"删除选中",confirmDeleteSelected:"确定要删除选中标签吗?",cancelDelete:"取消删除",moveTag:"移动标签",targetTag:"目标标签",movePosition:"移动位置",moveBefore:"移动到目标标签之前",moveAfter:"移动到目标标签之后",deleteTag:"删除标签",editGroupMode:"编辑模式",exitEditMode:"退出编辑模式",autoAddSearchTag:"搜索的Tag自动添加到提示词中",importTags:"批量导入Tag",share:"分享",edit:"编辑",outputSuccess:"分享成功",noTagsSelected:"没有选择要分享的Tag",shareSelected:"分享选择的Tag",batchShare:"批量分享Tag",cancelShare:"取消分享",moveGroup:"移动分组",targetGroup:"目标分组",moveGroupBefore:"移动到目标分组之前",moveGroupAfter:"移动到目标分组之后",importDanbooru:"批量导入",modifyTabSize:"修改标签尺寸",tabSizeConfig:"标签尺寸配置",primaryTabConfig:"一级分类标签配置",groupTabConfig:"二级分类标签配置",tabWidth:"标签宽度",tabHeight:"标签高度",fontSize:"字体大小",fitContent:"自适应内容",customWidth:"自定义宽度",resetDefault:"重置为默认值",tabSizeConfigSaved:"标签尺寸配置已保存",tabSizeConfigSaveFailed:"标签尺寸配置保存失败"},loraManager:{windowTitle:"Lora管理",modelWeight:"模型权重",textEncoderWeight:"CLIP权重",triggerWeight:"触发词权重",all:"全部",root:"根目录",refresh:"刷新",cacheAll:"缓存全部Lora信息",searchPlaceholder:"搜索Lora...",prevPage:"上一页",nextPage:"下一页",noResults:"未找到相关结果",loadingMore:"正在加载更多...",noMoreData:"没有更多结果了"},message:{copySuccess:"复制成功",copyFailed:"复制失败",saveSuccess:"保存成功",saveFailed:"保存失败",deleteSuccess:"删除成功",deleteFailed:"删除失败",operationSuccess:"操作成功",operationFailed:"操作失败",networkError:"网络错误",unknownError:"未知错误",refreshSuccess:"刷新成功",refreshFailed:"刷新失败",loadingData:"加载数据中...",dataLoaded:"数据加载完成",editSuccess:"编辑成功",editFailed:"编辑失败",addSuccess:"添加成功",addFailed:"添加失败",addFavoriteSuccess:"已添加到收藏夹",addFavoriteIsExist:"已添加到收藏夹",error:"错误",editNameExist:"名称已存在",moveSuccess:"移动成功",moveFailed:"移动失败",setLanguageSuccess:"设置语言成功",setLanguageFailed:"设置语言失败",startPanelSuccess:"启动面板成功",startPanelFailed:"启动面板失败",isLoading:"已在执行中请等待",loaddingPrc:"执行进度 {name}%",loaddingSuccess:"已全部加载成功",noFinishKuo:"括号不完整,请检查输入",getTranslaterFail:"获取翻译设置失败",applyTranslaterFail:"应用翻译设置失败",applyToTranslaterFail:"切换翻译库翻译需要安装翻译库,请先安装翻译库再应用设置",applyTranslaterSuccess:"应用翻译设置成功",tranlaterPackageInstallFail:"等待安装超时,请查看后台安装情况,若安装成功再次点击安装即可验证",tranlaterPackageInstallSuccess:"安装翻译包成功",translaterTestFail:"翻译失败,请使用其它的翻译服务进行尝试",installPackageSuccess:"安装共享数据成功!",installPackageFail:"安装共享数据失败,请查看后台错误",loadFailed:"加载失败",jsonErrorMesg:"JSON文件格式错误",pleaseAddSub:"请先添加二级分类",pleaseAddMainCeb:"请先添加一级分类",pleaseSelectGroup:"请选择完整的分组路径",isLoadingPleaseWait:"正在执行中,请查看后台进度",shareGroupError:"分享失败,获取分组信息失败",shareTagError:"分享失败,获取组Tag信息失败"},history:{title:"历史记录",search_placeholder:"搜索历史记录...",search:"搜索",windowTitle:"历史记录",favorites:"收藏夹",history:"历史记录",refresh:"刷新",refresh_history:"刷新历史记录",refresh_favorites:"刷新收藏夹",add_to_favorites:"添加到收藏夹",delete_history:"删除历史记录",use_item:"使用",add_new:"添加收藏",bulk_delete:"批量删除",deleteHistoryConfirm:"确定要删除历史记录 {name} 吗?",deleteFavoriteConfirm:"确定要删除收藏夹 {name} 吗?",confirmDeleteSelected:"确定要删除选中的信息吗?",cancel_delete:"取消删除",sure_delete:"确定删除",deleteSelected:"删除选中",dialog:{add_tag:"添加收藏",edit_tag:"编辑收藏",name:"名称",name_placeholder:"请输入名称",tag:"标签",tag_placeholder:"请输入标签",background_color:"背景颜色",background_color_placeholder:"请选择背景颜色",edit_favorite:"编辑收藏",delete_favorite:"删除收藏"},edit_favorite:"编辑收藏",delete_favorite:"删除收藏",use_favorite:"使用收藏"},floatingBall:{promptBox:"打开全局提示词",tagManager:"打开标签管理",loraManager:"打开Lora管理",aiWindow:"打开AI对话",restoreWindow:"重置所有窗口",openNodeListWindow:"打开节点列表",tranToWeb:"图片转换工具",openSetting:"打开设置"},aiWindow:{windowTitle:"AI对话窗口",newChat:"新建对话",chatName:"对话",thinking:"思考中...",send:"发送",inputMessage:"输入你的消息..."},translaterService:{niutrans:"小牛翻译",mymemory:"MyMemory",alibaba:"阿里巴巴翻译",baidu:"百度翻译",modernmt:"ModernMT",volcengine:"火山翻译",iciba:"金山词霸",iflytek:"科大讯飞翻译",google:"谷歌翻译",bing:"必应翻译",lingvanex:"Lingvanex",yandex:"Yandex翻译",itranslate:"iTranslate",systran:"SYSTRAN",argos:"Argos翻译",apertium:"Apertium",reverso:"Reverso翻译",deepl:"DeepL翻译",cloudtranslation:"云翻译",qqtransmart:"腾讯翻译君",translatecom:"Translate.com",sogou:"搜狗翻译",tilde:"Tilde翻译",caiyun:"彩云小译",qqfanyi:"腾讯翻译",translateme:"TranslateMe",papago:"Papago翻译",mirai:"未来翻译",youdao:"有道翻译",iflyrec:"讯飞听见翻译",hujiang:"沪江翻译",yeekit:"译库翻译",languagewire:"LanguageWire",elia:"Elia翻译",judic:"Judic翻译",mglip:"蒙古语翻译",utibet:"藏语翻译"},translaterLanguage:{english:"英语",chinese:"中文",arabic:"阿拉伯语",russian:"俄语",french:"法语",german:"德语",spanish:"西班牙语",portuguese:"葡萄牙语",italian:"意大利语",japanese:"日语",korean:"韩语",greek:"希腊语",dutch:"荷兰语",hindi:"印地语",turkish:"土耳其语",malay:"马来语",thai:"泰语",vietnamese:"越南语",indonesian:"印度尼西亚语",hebrew:"希伯来语",polish:"波兰语",mongolian:"蒙古语",czech:"捷克语",hungarian:"匈牙利语",estonian:"爱沙尼亚语",bulgarian:"保加利亚语",danish:"丹麦语",finnish:"芬兰语",romanian:"罗马尼亚语",swedish:"瑞典语",slovenian:"斯洛文尼亚语","persian/farsi":"波斯语/波斯语",bosnian:"波斯尼亚语",serbian:"塞尔维亚语",fijian:"斐济语",filipino:"菲律宾语",haitiancreole:"海地克里奥尔语",catalan:"加泰罗尼亚语",croatian:"克罗地亚语",latvian:"拉脱维亚语",lithuanian:"立陶宛语",urdu:"乌尔都语",ukrainian:"乌克兰语",welsh:"威尔士语",tahiti:"塔希提语",tongan:"汤加语",swahili:"斯瓦希里语",samoan:"萨摩亚语",slovak:"斯洛伐克语",afrikaans:"南非荷兰语",norwegian:"挪威语",bengali:"孟加拉语",malagasy:"马达加斯加语",maltese:"马耳他语","queretaro otomi":"克雷塔罗奥托米语","klingon/tlhingan hol":"克林贡语",gujarati:"古吉拉特语",tamil:"泰米尔语",telugu:"泰卢固语",punjabi:"旁遮普语",amharic:"阿姆哈拉语",azerbaijani:"阿塞拜疆语",bashkir:"巴什基尔语",belarusian:"白俄罗斯语",cebuano:"宿务语",chuvash:"楚瓦什语",esperanto:"世界语",basque:"巴斯克语",irish:"爱尔兰语"},utils:{tranToWeb:"转换图片为HTML",dropOrPasteImage:"点击本区域可以上传文件也可以拖动图片或粘贴图片到此处",downloadHtml:"下载HTML",copyHtml:"复制HTML",copySuccess:"HTML已复制",copyFailed:"复制HTML失败",clear:"清空内容"},importDialog:{title:"批量导入Tag",sure:"确认并导入",cleanAll:"清空所有",dumpSQL:"导出所有SQL",uploadSQL:"上传原始SQL文件",setMainCeb:"设置一级分类",setSubCeb:"设置二级分类",addTag:"添加Tag",fromJSONImput:"从JSON文件批量导入Tag",fromTxtInput:"从TXT文件批量导入Tag",fromYmalInput:"从YAML文件批量导入Tag",selectMainCeb:"选择一级分类",selectSubCeb:"选择二级分类",selectGroup:"选择已有分类",pleaseAddGroupName:"请填写一级分类名称",pleaseAddSubGroupName:"请填写二级分类名称",pleaseFullRequest:"请填写完整一级分类和二级分类信息",successImport:"导入成功",importFail:"导入失败",dumpOnlySQL:"仅导出Tag的SQL",settingOutputName:"设置导出文件名称",sureYes:"确认",cancel:"取消",edit:"编辑",delete:"删除",add:"添加Tag",pleaseMainCebUuid:"一级分原UUID,增量更新才需要",pleaseSubGroupUuid:"二级分原UUID,增量更新才需要",pleaseSubGroup:"二级分类名称",pleaseMainCeb:"一级分类名称",translater:"描述",tips1:"使用教程:",tips1text:"B站视频教程",tips2:"Tag云仓库:",tips2text:"GitHub仓库",tips3:"在线批量编辑:",tips3text:"在线编辑器",selectTitle:"选择分类",selectedCategories:"已选择的分类",clearAll:"清除全部",primaryCategories:"一级分类",subCategories:"二级分类",noSelectedCategories:"暂无选择的分类",selectCategory:"选择此分类",selectSubcategory:"选择此子分类",sureSelect:"确认选择"},randomUtils:{title:"随机Tag规则设置",generalSettings:"通用设置",totalTags:"随机Tag总数量(规则范围超过总数量按总数量算最大范围)",rules:"规则",addRule:"添加规则",rule:"规则",range:"范围",tagType:"标签类型",category:"Tag数据",specificTags:"特定标签",selectCategory:"选择分类",addTagPlaceholder:"输入标签并按回车",addTag:"添加标签",testRandom:"测试随机",generatedTags:"生成的标签",selectTagGroup:"选择Tag分组",ruleTemplates:"规则模板",saveAsTemplate:"保存为模板",selectTemplate:"选择模板",applyTemplate:"应用模板",templateNamePlaceholder:"输入模板名称",templateNameRequired:"请输入模板名称",templateSaved:"模板已保存",templateApplied:"模板已应用",errorSavingTemplates:"保存模板时出错",save:"保存",cancel:"取消",editTemplate:"修改名称",deleteTemplate:"删除模板",confirmDeleteTemplate:"确定要删除此模板吗?",templateDeleted:"模板已删除",templateUpdated:"模板名称已更新",errorUpdatingTemplate:"更新模板失败",errorLoadingTemplate:"加载模板失败",errorDeletingTemplate:"删除模板失败",errorApplyingTemplate:"应用模板失败",pleaseChooseTemplate:"请选择模板",errorSavingTemplate:"保存模板失败",newTemplate:"新建模板",rulesReminder:"提醒:第一个规则的范围必须从1开始!如果范围区间超过了随机的总数则直接显示全部不会随机!"},danbooruManager:{title:"Danbooru管理器",controle:"操作",translatePlaceholder:"请输入对应的翻译文本",searchPlaceholder:"输入需要搜索的Danbooru标签...",pageShow:"每页显示:",pageLimit:"条",hot:"热度",aliases:"分区",sureBatchDelete:"批量删除确认",sureBatchDeleteTips1:"您确定要删除选中的",sureBatchDeleteTips2:"个标签吗?此操作不可撤销。",sureDelete:"确认删除",import:"Danbooru格式导入",importBatchTitle:"批量导入Danbooru数据",importTitle:"Danbooru 导入数据展示",add:"添加Danbooru标签",edit:"编辑Danbooru标签"}},M2={promptBox:{placeholder:"Please enter text...",delete:"Delete",newline:"New Line",tab:"Tab",windowTitle:`WeiLin Prompt UI Window ${sa}`,windowTitleGlobal:`WeiLin Global Prompt UI Window ${sa}`,translate:"Translate",translatePlaceholder:"Please enter the text to be translated",weight:"Weight",weightPlaceholder:"Please enter the weight",addBracket:"Add Bracket",removeLayer:"Remove Bracket",hiddenHint:"Double-click to show",tagTips:`Double-click the left mouse button to mask the Tag
|
||
click the Tag to edit
|
||
and drag the Tag to drag`,oneClickRandomTag:"one Click Random Tag",oneClickCleanAll:"one Click Clean All",oneClickClearDisabled:"Clear All Disabled",clearDisabledSuccess:"All disabled tags cleared",randomTagSettings:"setting Random Tag",oneClickTranslate:"one Click Translate Tag",showDeleteButton:"Show Delete Button",hideDeleteButton:"Hide Delete Button",modelWeight:"Model Weight",textWeight:"Text Weight",favour:"Favour",lineToken:"Line Break",addLineToken:"Add Line Break Token",settings:{title:"Settings",cancel:"Cancel",save:"Save",translator:"Translator",sourceLanguage:"Source Language",targetLanguage:"Target Language",chinese_simplified:"Chinese Simplified",english:"English",close:"Close",auto_detect:"Auto Detect",setting_floating_ball:"Setting Floating Ball",setting_prompt_box:"Setting Prompt Box",setting_function_toggles:"Function Toggle Settings",setting_function_toggles_full:"Function Toggle Settings (Reopen window to take effect)",enableClearDisabled:"Enable Clear Disabled",enablePromptCommaShow:"Show Prompt Comma",floatingBallCount:"Floating Ball Count",floatingBallCountPlaceholder:"Please enter the number of floating balls",floatingBallSize:"Width of suspended ball",floatingBallSizePlaceholder:"Please enter the width of the suspension ball",floatingBallHeight:"Height of suspended ball",floatingBallHeightPlaceholder:"Please input the height of the suspension ball",enableFloatingBall:"Enable Floating Ball",enableCommaConversion:"Enable Comma Conversion",enablePeriodConversion:"Enable Period Conversion",enableBracketConversion:"Enable Bracket Conversion",enableAngleBracketConversion:"Enable Angle Bracket Conversion",enableUnderscoreToBracket:"Enable Underscore to Bracket",setting_openai_box:"OpenAI Settings",openai_api_key:"API Key",openai_api_key_placeholder:"Please enter API Key",openai_api_key_save:"Save",openaiSettings:"OpenAI Settings",openaiSettings_api_key:"API Key",openaiSettings_api_key_placeholder:"Please enter API Key",openaiSettings_api_key_save:"Save",openai_base_url:"Base URL",openai_base_url_placeholder:"Please enter Base URL",openai_model:"Model",openai_model_placeholder:"Please enter Model",not_set:"Not Set",edit:"Edit",delete:"Delete",selectedOpenaiConfig:"Selected OpenAI Config",addNewConfig:"Add New Config",setting_sponsor_me:"Sponsor Me",sponsorMe:"Sponsor Me",sponsorMeTip:"Sponsor Me, Support Me to Continue Development",sponsorMeLink:"Unique Sponsor Link https://afdian.com/a/weilin9999",setting_start_panel:"Start Panel",startPanel:"Start Panel",startPanelTip:"Click Start Panel, after successful startup, the panel page will be automatically opened",selectTranslater:"select translater",selectOptionNetworkTranslater:"Three party online translation",selectOptionPythonTranslater:"Translation Library Translation",apply:"Apply",selectOptionNetworkTranslaterTitle:"Three party network translation settings",selectOptionPythonTranslaterTitle:"Translation library settings",selectOptionNetworkTranslaterInfo:"The third-party tool used is (only for online translation)",selectOptionPythonTranslaterInfo:"The translation package used is translators",install:"Install",nowTranlaterPackageState:"now transtler package state:",tranlaterPackageStateTrue:"installed",tranlaterPackageStateFlase:"not installed",installed:"is installed ....",installTranslaterPackageInfo:"Currently installing translation library, please do not close the window! Wait for installation to complete",translaterSetting:"Translation Settings",chooseTranslaterSetting:"Choose a translation service:",translaterLangSourceSetting:"Translation language:",translaterLangTargeSetting:"Translation target language:",saveTranslaterSetting:"Save Settings",testTranslaterTitle:"Test translation",inputTestTranslater:"Enter translation content:",outPutTestTranslater:"Translation result:",testingTranslater:"Test translation",inputTestTranslaterPlaceholder:"Please enter the content to be translated",outPutTestTranslaterPlaceholder:"The translation result will be displayed here",errorPrompt:"Read the prompt node failed",skinSetting:"skin setting",defaultSkin:"default skin",customSkin:"custom skin",uploadSkin:"upload skin",bgSetting:"background setting",gradientBg:"gradient color",transparentBg:"transparent",gradientColor:"gradient color select",borderRadius:"border radius",resetToDefault:"reset to default"}},controls:{language:"Language",settings:"Settings",switchTheme:"Switch Theme",darkMode:"Dark Mode",lightMode:"Light Mode",tagManager:"Tag Manager",loraStack:"Lora Stack",loraManager:"Lora Manager",history:"History",addLora:"Add Lora",removeLora:"Remove Lora",lookOnLora:"Look On Lora",aiChat:"AI Chat",github:"Github Home",shareCloudData:"Share Cloud Data",tutorialVideo:"Tutorial Video",sponsor:"Sponsor Me",danbooruManager:"danbooru Manager"},theme:{toggle:"Switch Theme"},lora:{title:"Lora Information",rawTitle:"LoraRaw",file:"File",hash:"Hash",civitai:"Civitai",viewOnCivitai:"View on Civitai",fetchFromCivitai:"Fetch from Civitai",modelNotFound:"Model not found",modelNotFoundTip:"The model was not found on Civitai. It might be private or deleted",name:"Name",nameTip:"Display name of the model",type:"Type",baseModel:"Base Model",trainedWords:"Trained Words",trainedWordsTip:"Keywords used in model training, click to select for copying",selectedWords:"{count} words selected",strengthMin:"Min Strength",strengthMinTip:"Recommended minimum strength value",strengthMax:"Max Strength",strengthMaxTip:"Recommended maximum strength value",promptWords:"Prompt Words",promptWordsTip:"Recommended prompt words when using this model",loraWorks:"Lora Prompt Words",strWeight:"Text Strength Weight",hideLora:"Disable Lora",showLora:"Enable Lora",skipClip:"Clip Skip",seeLoraRaw:"LoraRaw",addDiyFiled:"Add DIY Filed",getCivitData:"Get Civitai Data",copy:"Copy"},common:{confirmDelete:"Confirm Delete",delete:"Delete",cancel:"Cancel",confirm:"Confirm",edit:"Edit",save:"Save",refresh:"Refresh",copy:"Copy",copySuccess:"Copied successfully",copyFailed:"Copy failed",windowSize:"Adjust window size",showMore:"show more",showLess:"show less"},nodeListWindow:{windowTitle:"Node List",openPromptUI:"Open Prompt UI"},tagManager:{deletePrimaryCategoryConfirm:"Are you sure you want to delete category {name}?",deleteGroupConfirm:"Are you sure you want to delete group {name}?",deleteTagConfirm:"Are you sure you want to delete tag {name}?",windowTitle:"Tag Manager",categories:"Categories",groups:"Groups",selectCategory:"Please select a category",selectGroup:"Please select a group",addPrimaryCategory:"Add Category",addGroup:"Add Group",editPrimaryCategory:"Edit Category",editGroup:"Edit Group",editTag:"Edit Tag",categoryName:"Category Name",categoryNamePlaceholder:"Enter category name",categoryNameRequired:"Category name is required",groupName:"Group Name",groupNamePlaceholder:"Enter group name",groupNameRequired:"Group name is required",addTag:"Add Tag",text:"Tag Description",textPlaceholder:"Enter tag Description",description:"Tag",descriptionPlaceholder:"Enter tag",textRequired:"Tag and Tag description cannot be empty",favourRequired:"Tag and Tag description cannot be empty, and a group must be selected",backgroundColor:"Background Color",colorPickerTitle:"Select Color",opacity:"Opacity",searchPlaceholder:"Search tags...",noResults:"No results found",searchInCategory:"in category",searchInTag:"in tag",save:"Save",cancel:"Cancel",confirm:"Confirm",delete:"Delete",addSubCategory:"Add Sub-category",editSubCategory:"Edit Sub-category",subCategoryName:"Sub-category Name",subCategoryNamePlaceholder:"Enter sub-category name",subCategoryNameRequired:"Sub-category name is required",deleteConfirmTitle:"Confirm Delete",deleteConfirmMessage:"This action will permanently delete this {type}. Continue?",deleteSuccess:"Deleted successfully",deleteFailed:"Delete failed",saveSuccess:"Saved successfully",saveFailed:"Save failed",colorPickerAlpha:"Opacity",colorPickerHex:"Hex Color Value",colorPreview:"Color Preview",dragToSort:"Drag to Sort",searchTags:"Search Tags",noTagsFound:"No tags found",noGroupsFound:"No groups found",noCategoriesFound:"No categories found",refresh:"Refresh",refreshing:"Refreshing...",refreshSuccess:"Refresh successful",refreshFailed:"Refresh failed",search:"Search",searching:"Searching...",searchResult:"Search Result",searchInPath:"Located in: {path}",category:"Category",group:"Group",tag:"Tag",resultType:{category:"Category",group:"Group",tag:"Tag"},hasDeleteAction:"Batch Delete",deleteSelected:"Delete Selected",confirmDeleteSelected:"Are you sure you want to delete the selected tags?",cancelDelete:"Cancel Delete",moveTag:"Move Tag",targetTag:"Target Tag",movePosition:"Move Position",moveBefore:"Move Before",moveAfter:"Move After",deleteTag:"Delete Tag",editGroupMode:"Edit Group Mode",exitEditMode:"Exit Edit Mode",autoAddSearchTag:"Auto Add Search Tag With Prompt",importTags:"Import Tags",share:"Share",edit:"Edit",outputSuccess:"Share successfully",noTagsSelected:"No share tags selected",shareSelected:"Share selected Tag",batchShare:"Batch Share Tag",cancelShare:"Cancel Share",moveGroup:"Move Group",targetGroup:"Target Group",moveGroupBefore:"Move Before",moveGroupAfter:"Move After",importDanbooru:"Batch import",modifyTabSize:"Modify Tag Size",tabSizeConfig:"Tag Size Configuration",primaryTabConfig:"Primary Category Tab Configuration",groupTabConfig:"Group Category Tab Configuration",tabWidth:"Tab Width",tabHeight:"Tab Height",fontSize:"Font Size",fitContent:"Fit Content",customWidth:"Custom Width",resetDefault:"Reset to Default",tabSizeConfigSaved:"Tag size configuration saved",tabSizeConfigSaveFailed:"Failed to save tag size configuration"},loraManager:{windowTitle:"Lora Manager",modelWeight:"Model Weight",textEncoderWeight:"CLIP Weight",triggerWeight:"Trigger Weight",all:"All",root:"Root",refresh:"Refresh",cacheAll:"Cache all Lora information",searchPlaceholder:"Search Lora...",noResults:"No results found",prevPage:"prev page",nextPage:"next page",loadingMore:"Loadding more ...",noMoreData:"No more data"},message:{copySuccess:"Copy successful",copyFailed:"Copy failed",saveSuccess:"Save successful",saveFailed:"Save failed",deleteSuccess:"Delete successful",deleteFailed:"Delete failed",operationSuccess:"Operation successful",operationFailed:"Operation failed",networkError:"Network error",unknownError:"Unknown error",refreshSuccess:"Refresh successful",refreshFailed:"Refresh failed",loadingData:"Loading data...",dataLoaded:"Data loaded",editSuccess:"Edit successful",editFailed:"Edit failed",addSuccess:"Add successful",addFailed:"Add failed",addFavoriteSuccess:"Added to favorites",addFavoriteIsExist:"Added to favorites",error:"Error",moveSuccess:"Move successful",moveFailed:"Move failed",setLanguageSuccess:"Set language successful",setLanguageFailed:"Set language failed",startPanelSuccess:"Start panel successful",startPanelFailed:"Start panel failed",isLoading:"Loading...",loaddingPrc:"Execution progress {name}%",loaddingSuccess:"All loaded successfully",noFinishKuo:"The parentheses are incomplete. Please check the input",getTranslaterFail:"Get translator failed",applyTranslaterFail:"Apply translator failed",applyToTranslaterFail:"Switching to a translation library requires installing a translation library. Please install the translation library first and then apply the settings",applyTranslaterSuccess:"Apply translator successful",tranlaterPackageInstallFail:"Waiting for installation timeout, please check the background installation status. If the installation is successful, click install again to verify",tranlaterPackageInstallSuccess:"Successfully installed translation package",translaterTestFail:"Translation failed, please try using another translation service",installPackageSuccess:"Successfully installed translation package",installPackageFail:"Failed to install translation package, please check the background installation status",loadFailed:"load failed",jsonErrorMesg:"The format of the JSON file is incorrect",pleaseAddSub:"Please add the secondary classification first",pleaseAddMainCeb:"Please add the first-level category first",pleaseSelectGroup:"Please select the complete grouping path",isLoadingPleaseWait:"It is being executed. Please check the progress in the background",shareGroupError:"Failed to share and failed to obtain group information",shareTagError:"Failed to share and failed to obtain group tag information"},cloudWindow:{windowTitle:"Share Cloud Window",back:"Back",currentPath:"Current Path",tagDatabase:"Tag Database",danbooruDatabase:"Danbooru Database",open:"Open Folder",installed:"Installed",install:"Install",installing:"Installing..."},history:{title:"History",search_placeholder:"Search history...",windowTitle:"History",search:"Search",favorites:"Favorites",history:"History",refresh:"Refresh",refresh_history:"Refresh history",refresh_favorites:"Refresh favorites",add_to_favorites:"Add to favorites",delete_history:"Delete history",use_item:"Use",add_new:"Add new",bulk_delete:"Bulk delete",deleteHistoryConfirm:"Are you sure you want to delete history {name}?",deleteFavoriteConfirm:"Are you sure you want to delete favorite {name}?",confirmDeleteSelected:"Are you sure you want to delete selected information?",cancel_delete:"Cancel delete",sure_delete:"Sure delete",deleteSelected:"Delete selected",dialog:{add_tag:"Add favorite",edit_tag:"Edit favorite",name:"Name",name_placeholder:"Please enter name",tag:"Tag",tag_placeholder:"Please enter tag",background_color:"Background color",background_color_placeholder:"Please select background color",edit_favorite:"Edit favorite",delete_favorite:"Delete favorite"},edit_favorite:"Edit favorite",delete_favorite:"Delete favorite",use_favorite:"Use favorite"},floatingBall:{promptBox:"open Global Prompt Box",tagManager:"open Tag Manager",loraManager:"open Lora Manager",aiWindow:"open AI Chat",restoreWindow:"reset all windows",openNodeListWindow:"open Node List",tranToWeb:"Image to Web Utils",openSetting:"open Setting"},aiWindow:{windowTitle:"AI Chat Window",newChat:"New Chat",chatName:"Chat",thinking:"Thinking...",send:"Send",inputMessage:"Enter your message..."},translaterService:{niutrans:"niutrans",mymemory:"mymemory",alibaba:"alibaba",baidu:"baidu",modernmt:"modernmt",volcengine:"volcengine",iciba:"iciba",iflytek:"iflytek",google:"google",bing:"bing",lingvanex:"lingvanex",yandex:"yandex",itranslate:"itranslate",systran:"systran",argos:"argos",apertium:"apertium",reverso:"reverso",deepl:"deepl",cloudtranslation:"cloudtranslation",qqtransmart:"qqtransmart",translatecom:"translatecom",sogou:"sogou",tilde:"tilde",caiyun:"caiyun",qqfanyi:"qqfanyi",translateme:"translateme",papago:"papago",mirai:"mirai",youdao:"youdao",iflyrec:"iflyrec",hujiang:"hujiang",yeekit:"yeekit",languagewire:"languagewire",elia:"elia",judic:"judic",mglip:"mglip",utibet:"utibet"},translaterLanguage:{english:"english",chinese:"chinese",arabic:"arabic",russian:"russian",french:"french",german:"german",spanish:"spanish",portuguese:"portuguese",italian:"italian",japanese:"japanese",korean:"korean",greek:"greek",dutch:"dutch",hindi:"hindi",turkish:"turkish",malay:"malay",thai:"thai",vietnamese:"vietnamese",indonesian:"indonesian",hebrew:"hebrew",polish:"polish",mongolian:"mongolian",czech:"czech",hungarian:"hungarian",estonian:"estonian",bulgarian:"bulgarian",danish:"danish",finnish:"finnish",romanian:"romanian",swedish:"swedish",slovenian:"slovenian","persian/farsi":"persian/farsi",bosnian:"bosnian",serbian:"serbian",fijian:"fijian",filipino:"filipino",haitiancreole:"haitiancreole",catalan:"catalan",croatian:"croatian",latvian:"latvian",lithuanian:"lithuanian",urdu:"urdu",ukrainian:"ukrainian",welsh:"welsh",tahiti:"tahiti",tongan:"tongan",swahili:"swahili",samoan:"samoan",slovak:"slovak",afrikaans:"afrikaans",norwegian:"norwegian",bengali:"bengali",malagasy:"malagasy",maltese:"maltese","queretaro otomi":"queretaro otomi","klingon/tlhingan hol":"klingon/tlhingan hol",gujarati:"gujarati",tamil:"tamil",telugu:"telugu",punjabi:"punjabi",amharic:"amharic",azerbaijani:"azerbaijani",bashkir:"bashkir",belarusian:"belarusian",cebuano:"cebuano",chuvash:"chuvash",esperanto:"esperanto",basque:"basque",irish:"irish"},utils:{tranToWeb:"Image to HTML",dropOrPasteImage:"Drop or paste image here",downloadHtml:"Download HTML",copyHtml:"Copy HTML",copySuccess:"HTML copied to clipboard",copyFailed:"Failed to copy HTML",clear:"Clear"},importDialog:{title:"Batch import of Tags",sure:"Confirm and import",cleanAll:"Empty all",dumpSQL:"Export All SQL",uploadSQL:"Upload the original SQL file",setMainCeb:"Set up a first-level classification",setSubCeb:"Set up secondary classification",addTag:"Add Tag",fromJSONImput:"Import tags from the JSON file",fromTxtInput:"Batch import tags from TXT files",fromYmalInput:"Batch import tags from YMAL files",selectMainCeb:"Select the first-level classification",selectSubCeb:"Select the secondary classification",selectGroup:"Select the existing classification",pleaseAddGroupName:"Please fill in the name of the first-level classification",pleaseAddSubGroupName:"Please fill in the name of the secondary classification",pleaseFullRequest:"Please fill in the information of the first-level and second-level classifications completely",successImport:"Import successful",importFail:"Import failed",dumpOnlySQL:"Only export the SQL of the Tag",settingOutputName:"Set the name of the export file",sureYes:"Sure",cancel:"Cancel",edit:"Edit",delete:"Delete",add:"Add Tag",pleaseMainCebUuid:"The original UUID of the first-level division is only required for incremental updates and cannot be modified",pleaseSubGroupUuid:"The secondary division of the original UUID is only required for incremental updates and cannot be modified",pleaseSubGroup:"Secondary classification name",pleaseMainCeb:"First-level classification name",translater:"Description",tips1:"Usage Tutorial:",tips1text:"Bilibili video tutorial",tips2:"Tag Cloud Warehouse:",tips2text:"GitHub repository",tips3:"Online batch editing:",tips3text:"Online editor",selectTitle:"Select Category",selectedCategories:"Selected Categories",clearAll:"Clear All",primaryCategories:"Primary Categories",subCategories:"Sub Categories",noSelectedCategories:"No categories selected",selectCategory:"Select this category",selectSubcategory:"Select this subcategory",sureSelect:"Confirm Selection"},randomUtils:{title:"Random Tag Rules Settings",generalSettings:"General Settings",totalTags:"Random Tag Total Number (If the rule range exceeds the total quantity, the maximum range is calculated by the total quantity)",rules:"Rules",addRule:"Add Rule",rule:"Rule",range:"Range",tagType:"Tag Type",category:"Tag Category",specificTags:"Specific Tags",selectCategory:"Select Category",addTagPlaceholder:"Enter tag and press Enter",addTag:"Add Tag",testRandom:"Test Random",generatedTags:"Generated Tags",selectTagGroup:"Select Tag Group",ruleTemplates:"Rule Templates",saveAsTemplate:"Save as Template",selectTemplate:"Select Template",applyTemplate:"Apply Template",templateNamePlaceholder:"Enter template name",templateNameRequired:"Template name is required",templateSaved:"Template saved",templateApplied:"Template applied",errorSavingTemplates:"Error saving templates",save:"Save",cancel:"Cancel",editTemplate:"Edit Name",deleteTemplate:"Delete",confirmDeleteTemplate:"Are you sure you want to delete this template?",templateDeleted:"Template deleted",templateUpdated:"Template name updated",errorUpdatingTemplate:"Update template failed",errorLoadingTemplate:"Load template failed",errorDeletingTemplate:"Delete template failed",pleaseChooseTemplate:"Please choose a template",errorApplyingTemplate:"Apply template failed",errorSavingTemplate:"Save template failed",newTemplate:"New Template",rulesReminder:"Reminder: The range of the first rule must start at 1! If the range exceeds the total number of random, it will simply display all not random!"},danbooruManager:{title:"Danbooru Manager",controle:"Controle",translatePlaceholder:"Please enter the tag to be translated",searchPlaceholder:"Input need search danbooru tag",pageShow:"Display per page:",pageLimit:"article",hot:"hot",aliases:"aliases",sureBatchDelete:"Batch deletion confirmation",sureBatchDeleteTips1:"You are sure you want to delete the selected one",sureBatchDeleteTips2:"A label? This operation is irrevocable.",sureDelete:"Confirm deletion",import:"Import in Danbooru format",importBatchTitle:"Batch import Danbooru data",importTitle:"Danbooru Import data display",add:"Add Danbooru Tag",edit:"Edit Danbooru Tag"}};/*!
|
||
* pinia v3.0.1
|
||
* (c) 2025 Eduardo San Martin Morote
|
||
* @license MIT
|
||
*/let pg;const qs=e=>pg=e,fg=Symbol();function Yu(e){return e&&typeof e=="object"&&Object.prototype.toString.call(e)==="[object Object]"&&typeof e.toJSON!="function"}var Di;(function(e){e.direct="direct",e.patchObject="patch object",e.patchFunction="patch function"})(Di||(Di={}));function I2(){const e=jl(!0),t=e.run(()=>S({}));let n=[],o=[];const a=nu({install(r){qs(a),a._a=r,r.provide(fg,a),r.config.globalProperties.$pinia=a,o.forEach(s=>n.push(s)),o=[]},use(r){return this._a?n.push(r):o.push(r),this},_p:n,_a:null,_e:e,_s:new Map,state:t});return a}const gg=()=>{};function mg(e,t,n,o=gg){e.push(t);const a=()=>{const r=e.indexOf(t);r>-1&&(e.splice(r,1),o())};return!n&&id()&&Kh(a),a}function Or(e,...t){e.slice().forEach(n=>{n(...t)})}const D2=e=>e(),hg=Symbol(),Ku=Symbol();function Ju(e,t){e instanceof Map&&t instanceof Map?t.forEach((n,o)=>e.set(o,n)):e instanceof Set&&t instanceof Set&&t.forEach(e.add,e);for(const n in t){if(!t.hasOwnProperty(n))continue;const o=t[n],a=e[n];Yu(a)&&Yu(o)&&e.hasOwnProperty(n)&&!gn(o)&&!wa(o)?e[n]=Ju(a,o):e[n]=o}return e}const O2=Symbol();function R2(e){return!Yu(e)||!e.hasOwnProperty(O2)}const{assign:Oa}=Object;function P2(e){return!!(gn(e)&&e.effect)}function N2(e,t,n,o){const{state:a,actions:r,getters:s}=t,u=n.state.value[e];let p;function m(){u||(n.state.value[e]=a?a():{});const f=yv(n.state.value[e]);return Oa(f,r,Object.keys(s||{}).reduce((g,x)=>(g[x]=nu(Ht(()=>{qs(n);const b=n._s.get(e);return s[x].call(b,b)})),g),{}))}return p=vg(e,m,t,n,o,!0),p}function vg(e,t,n={},o,a,r){let s;const u=Oa({actions:{}},n),p={deep:!0};let m,f,g=[],x=[],b;const k=o.state.value[e];!r&&!k&&(o.state.value[e]={}),S({});let $;function O(le){let ie;m=f=!1,typeof le=="function"?(le(o.state.value[e]),ie={type:Di.patchFunction,storeId:e,events:b}):(Ju(o.state.value[e],le),ie={type:Di.patchObject,payload:le,storeId:e,events:b});const Oe=$=Symbol();vt().then(()=>{$===Oe&&(m=!0)}),f=!0,Or(g,ie,o.state.value[e])}const I=r?function(){const{state:ie}=n,Oe=ie?ie():{};this.$patch(Ae=>{Oa(Ae,Oe)})}:gg;function V(){s.stop(),g=[],x=[],o._s.delete(e)}const me=(le,ie="")=>{if(hg in le)return le[Ku]=ie,le;const Oe=function(){qs(o);const Ae=Array.from(arguments),fe=[],_e=[];function ae(Q){fe.push(Q)}function W(Q){_e.push(Q)}Or(x,{args:Ae,name:Oe[Ku],store:z,after:ae,onError:W});let re;try{re=le.apply(this&&this.$id===e?this:z,Ae)}catch(Q){throw Or(_e,Q),Q}return re instanceof Promise?re.then(Q=>(Or(fe,Q),Q)).catch(Q=>(Or(_e,Q),Promise.reject(Q))):(Or(fe,re),re)};return Oe[hg]=!0,Oe[Ku]=ie,Oe},M={_p:o,$id:e,$onAction:mg.bind(null,x),$patch:O,$reset:I,$subscribe(le,ie={}){const Oe=mg(g,le,ie.detached,()=>Ae()),Ae=s.run(()=>At(()=>o.state.value[e],fe=>{(ie.flush==="sync"?f:m)&&le({storeId:e,type:Di.direct,events:b},fe)},Oa({},p,ie)));return Oe},$dispose:V},z=hs(M);o._s.set(e,z);const P=(o._a&&o._a.runWithContext||D2)(()=>o._e.run(()=>(s=jl()).run(()=>t({action:me}))));for(const le in P){const ie=P[le];if(gn(ie)&&!P2(ie)||wa(ie))r||(k&&R2(ie)&&(gn(ie)?ie.value=k[le]:Ju(ie,k[le])),o.state.value[e][le]=ie);else if(typeof ie=="function"){const Oe=me(ie,le);P[le]=Oe,u.actions[le]=ie}}return Oa(z,P),Oa(Lt(z),P),Object.defineProperty(z,"$state",{get:()=>o.state.value[e],set:le=>{O(ie=>{Oa(ie,le)})}}),o._p.forEach(le=>{Oa(z,s.run(()=>le({store:z,app:o._a,pinia:o,options:u})))}),k&&r&&n.hydrate&&n.hydrate(z.$state,k),m=!0,f=!0,z}/*! #__NO_SIDE_EFFECTS__ */function F2(e,t,n){let o;const a=typeof t=="function";o=a?n:t;function r(s,u){const p=o1();return s=s||(p?Er(fg,null):null),s&&qs(s),s=pg,s._s.has(e)||(a?vg(e,t,o,s):N2(e,o,s)),s._s.get(e)}return r.$id=e,r}const Xu=F2("tag",()=>{const e=S([]),t=S({user_lang:"zh_CN"}),n=S(0);return{categories:e,setCategories:s=>{e.value=s},userSetting:t,setUserSetting:s=>{t.value=s},isFirstLoading:n,setisFirstLoading:s=>{n.value=s}}});function _g(e,t){return function(){return e.apply(t,arguments)}}const{toString:B2}=Object.prototype,{getPrototypeOf:Qu}=Object,Ys=(e=>t=>{const n=B2.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),$o=e=>(e=e.toLowerCase(),t=>Ys(t)===e),Ks=e=>t=>typeof t===e,{isArray:Rr}=Array,Oi=Ks("undefined");function U2(e){return e!==null&&!Oi(e)&&e.constructor!==null&&!Oi(e.constructor)&&po(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const yg=$o("ArrayBuffer");function z2(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&yg(e.buffer),t}const V2=Ks("string"),po=Ks("function"),bg=Ks("number"),Js=e=>e!==null&&typeof e=="object",W2=e=>e===!0||e===!1,Xs=e=>{if(Ys(e)!=="object")return!1;const t=Qu(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},j2=$o("Date"),H2=$o("File"),G2=$o("Blob"),q2=$o("FileList"),Y2=e=>Js(e)&&po(e.pipe),K2=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||po(e.append)&&((t=Ys(e))==="formdata"||t==="object"&&po(e.toString)&&e.toString()==="[object FormData]"))},J2=$o("URLSearchParams"),[X2,Q2,Z2,ey]=["ReadableStream","Request","Response","Headers"].map($o),ty=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Ri(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let o,a;if(typeof e!="object"&&(e=[e]),Rr(e))for(o=0,a=e.length;o<a;o++)t.call(null,e[o],o,e);else{const r=n?Object.getOwnPropertyNames(e):Object.keys(e),s=r.length;let u;for(o=0;o<s;o++)u=r[o],t.call(null,e[u],u,e)}}function wg(e,t){t=t.toLowerCase();const n=Object.keys(e);let o=n.length,a;for(;o-- >0;)if(a=n[o],t===a.toLowerCase())return a;return null}const ar=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,xg=e=>!Oi(e)&&e!==ar;function Zu(){const{caseless:e}=xg(this)&&this||{},t={},n=(o,a)=>{const r=e&&wg(t,a)||a;Xs(t[r])&&Xs(o)?t[r]=Zu(t[r],o):Xs(o)?t[r]=Zu({},o):Rr(o)?t[r]=o.slice():t[r]=o};for(let o=0,a=arguments.length;o<a;o++)arguments[o]&&Ri(arguments[o],n);return t}const ny=(e,t,n,{allOwnKeys:o}={})=>(Ri(t,(a,r)=>{n&&po(a)?e[r]=_g(a,n):e[r]=a},{allOwnKeys:o}),e),oy=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),ay=(e,t,n,o)=>{e.prototype=Object.create(t.prototype,o),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},ry=(e,t,n,o)=>{let a,r,s;const u={};if(t=t||{},e==null)return t;do{for(a=Object.getOwnPropertyNames(e),r=a.length;r-- >0;)s=a[r],(!o||o(s,e,t))&&!u[s]&&(t[s]=e[s],u[s]=!0);e=n!==!1&&Qu(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},iy=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const o=e.indexOf(t,n);return o!==-1&&o===n},sy=e=>{if(!e)return null;if(Rr(e))return e;let t=e.length;if(!bg(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},ly=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Qu(Uint8Array)),uy=(e,t)=>{const o=(e&&e[Symbol.iterator]).call(e);let a;for(;(a=o.next())&&!a.done;){const r=a.value;t.call(e,r[0],r[1])}},cy=(e,t)=>{let n;const o=[];for(;(n=e.exec(t))!==null;)o.push(n);return o},dy=$o("HTMLFormElement"),py=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,o,a){return o.toUpperCase()+a}),Sg=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),fy=$o("RegExp"),Tg=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),o={};Ri(n,(a,r)=>{let s;(s=t(a,r,e))!==!1&&(o[r]=s||a)}),Object.defineProperties(e,o)},gy=e=>{Tg(e,(t,n)=>{if(po(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const o=e[n];if(po(o)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},my=(e,t)=>{const n={},o=a=>{a.forEach(r=>{n[r]=!0})};return Rr(e)?o(e):o(String(e).split(t)),n},hy=()=>{},vy=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function _y(e){return!!(e&&po(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const yy=e=>{const t=new Array(10),n=(o,a)=>{if(Js(o)){if(t.indexOf(o)>=0)return;if(!("toJSON"in o)){t[a]=o;const r=Rr(o)?[]:{};return Ri(o,(s,u)=>{const p=n(s,a+1);!Oi(p)&&(r[u]=p)}),t[a]=void 0,r}}return o};return n(e,0)},by=$o("AsyncFunction"),wy=e=>e&&(Js(e)||po(e))&&po(e.then)&&po(e.catch),kg=((e,t)=>e?setImmediate:t?((n,o)=>(ar.addEventListener("message",({source:a,data:r})=>{a===ar&&r===n&&o.length&&o.shift()()},!1),a=>{o.push(a),ar.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",po(ar.postMessage)),xy=typeof queueMicrotask<"u"?queueMicrotask.bind(ar):typeof process<"u"&&process.nextTick||kg,Fe={isArray:Rr,isArrayBuffer:yg,isBuffer:U2,isFormData:K2,isArrayBufferView:z2,isString:V2,isNumber:bg,isBoolean:W2,isObject:Js,isPlainObject:Xs,isReadableStream:X2,isRequest:Q2,isResponse:Z2,isHeaders:ey,isUndefined:Oi,isDate:j2,isFile:H2,isBlob:G2,isRegExp:fy,isFunction:po,isStream:Y2,isURLSearchParams:J2,isTypedArray:ly,isFileList:q2,forEach:Ri,merge:Zu,extend:ny,trim:ty,stripBOM:oy,inherits:ay,toFlatObject:ry,kindOf:Ys,kindOfTest:$o,endsWith:iy,toArray:sy,forEachEntry:uy,matchAll:cy,isHTMLForm:dy,hasOwnProperty:Sg,hasOwnProp:Sg,reduceDescriptors:Tg,freezeMethods:gy,toObjectSet:my,toCamelCase:py,noop:hy,toFiniteNumber:vy,findKey:wg,global:ar,isContextDefined:xg,isSpecCompliantForm:_y,toJSONObject:yy,isAsyncFn:by,isThenable:wy,setImmediate:kg,asap:xy};function yt(e,t,n,o,a){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),o&&(this.request=o),a&&(this.response=a,this.status=a.status?a.status:null)}Fe.inherits(yt,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Fe.toJSONObject(this.config),code:this.code,status:this.status}}});const Cg=yt.prototype,Eg={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{Eg[e]={value:e}}),Object.defineProperties(yt,Eg),Object.defineProperty(Cg,"isAxiosError",{value:!0}),yt.from=(e,t,n,o,a,r)=>{const s=Object.create(Cg);return Fe.toFlatObject(e,s,function(p){return p!==Error.prototype},u=>u!=="isAxiosError"),yt.call(s,e.message,t,n,o,a),s.cause=e,s.name=e.name,r&&Object.assign(s,r),s};const Sy=null;function ec(e){return Fe.isPlainObject(e)||Fe.isArray(e)}function $g(e){return Fe.endsWith(e,"[]")?e.slice(0,-2):e}function Lg(e,t,n){return e?e.concat(t).map(function(a,r){return a=$g(a),!n&&r?"["+a+"]":a}).join(n?".":""):t}function Ty(e){return Fe.isArray(e)&&!e.some(ec)}const ky=Fe.toFlatObject(Fe,{},null,function(t){return/^is[A-Z]/.test(t)});function Qs(e,t,n){if(!Fe.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=Fe.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function($,O){return!Fe.isUndefined(O[$])});const o=n.metaTokens,a=n.visitor||f,r=n.dots,s=n.indexes,p=(n.Blob||typeof Blob<"u"&&Blob)&&Fe.isSpecCompliantForm(t);if(!Fe.isFunction(a))throw new TypeError("visitor must be a function");function m(k){if(k===null)return"";if(Fe.isDate(k))return k.toISOString();if(!p&&Fe.isBlob(k))throw new yt("Blob is not supported. Use a Buffer instead.");return Fe.isArrayBuffer(k)||Fe.isTypedArray(k)?p&&typeof Blob=="function"?new Blob([k]):Buffer.from(k):k}function f(k,$,O){let I=k;if(k&&!O&&typeof k=="object"){if(Fe.endsWith($,"{}"))$=o?$:$.slice(0,-2),k=JSON.stringify(k);else if(Fe.isArray(k)&&Ty(k)||(Fe.isFileList(k)||Fe.endsWith($,"[]"))&&(I=Fe.toArray(k)))return $=$g($),I.forEach(function(me,M){!(Fe.isUndefined(me)||me===null)&&t.append(s===!0?Lg([$],M,r):s===null?$:$+"[]",m(me))}),!1}return ec(k)?!0:(t.append(Lg(O,$,r),m(k)),!1)}const g=[],x=Object.assign(ky,{defaultVisitor:f,convertValue:m,isVisitable:ec});function b(k,$){if(!Fe.isUndefined(k)){if(g.indexOf(k)!==-1)throw Error("Circular reference detected in "+$.join("."));g.push(k),Fe.forEach(k,function(I,V){(!(Fe.isUndefined(I)||I===null)&&a.call(t,I,Fe.isString(V)?V.trim():V,$,x))===!0&&b(I,$?$.concat(V):[V])}),g.pop()}}if(!Fe.isObject(e))throw new TypeError("data must be an object");return b(e),t}function Ag(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(o){return t[o]})}function tc(e,t){this._pairs=[],e&&Qs(e,this,t)}const Mg=tc.prototype;Mg.append=function(t,n){this._pairs.push([t,n])},Mg.toString=function(t){const n=t?function(o){return t.call(this,o,Ag)}:Ag;return this._pairs.map(function(a){return n(a[0])+"="+n(a[1])},"").join("&")};function Cy(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Ig(e,t,n){if(!t)return e;const o=n&&n.encode||Cy;Fe.isFunction(n)&&(n={serialize:n});const a=n&&n.serialize;let r;if(a?r=a(t,n):r=Fe.isURLSearchParams(t)?t.toString():new tc(t,n).toString(o),r){const s=e.indexOf("#");s!==-1&&(e=e.slice(0,s)),e+=(e.indexOf("?")===-1?"?":"&")+r}return e}class Dg{constructor(){this.handlers=[]}use(t,n,o){return this.handlers.push({fulfilled:t,rejected:n,synchronous:o?o.synchronous:!1,runWhen:o?o.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){Fe.forEach(this.handlers,function(o){o!==null&&t(o)})}}const Og={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Ey={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:tc,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},nc=typeof window<"u"&&typeof document<"u",oc=typeof navigator=="object"&&navigator||void 0,$y=nc&&(!oc||["ReactNative","NativeScript","NS"].indexOf(oc.product)<0),Ly=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Ay=nc&&window.location.href||"http://localhost",Pn={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:nc,hasStandardBrowserEnv:$y,hasStandardBrowserWebWorkerEnv:Ly,navigator:oc,origin:Ay},Symbol.toStringTag,{value:"Module"})),...Ey};function My(e,t){return Qs(e,new Pn.classes.URLSearchParams,Object.assign({visitor:function(n,o,a,r){return Pn.isNode&&Fe.isBuffer(n)?(this.append(o,n.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}function Iy(e){return Fe.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Dy(e){const t={},n=Object.keys(e);let o;const a=n.length;let r;for(o=0;o<a;o++)r=n[o],t[r]=e[r];return t}function Rg(e){function t(n,o,a,r){let s=n[r++];if(s==="__proto__")return!0;const u=Number.isFinite(+s),p=r>=n.length;return s=!s&&Fe.isArray(a)?a.length:s,p?(Fe.hasOwnProp(a,s)?a[s]=[a[s],o]:a[s]=o,!u):((!a[s]||!Fe.isObject(a[s]))&&(a[s]=[]),t(n,o,a[s],r)&&Fe.isArray(a[s])&&(a[s]=Dy(a[s])),!u)}if(Fe.isFormData(e)&&Fe.isFunction(e.entries)){const n={};return Fe.forEachEntry(e,(o,a)=>{t(Iy(o),a,n,0)}),n}return null}function Oy(e,t,n){if(Fe.isString(e))try{return(t||JSON.parse)(e),Fe.trim(e)}catch(o){if(o.name!=="SyntaxError")throw o}return(n||JSON.stringify)(e)}const Pi={transitional:Og,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const o=n.getContentType()||"",a=o.indexOf("application/json")>-1,r=Fe.isObject(t);if(r&&Fe.isHTMLForm(t)&&(t=new FormData(t)),Fe.isFormData(t))return a?JSON.stringify(Rg(t)):t;if(Fe.isArrayBuffer(t)||Fe.isBuffer(t)||Fe.isStream(t)||Fe.isFile(t)||Fe.isBlob(t)||Fe.isReadableStream(t))return t;if(Fe.isArrayBufferView(t))return t.buffer;if(Fe.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let u;if(r){if(o.indexOf("application/x-www-form-urlencoded")>-1)return My(t,this.formSerializer).toString();if((u=Fe.isFileList(t))||o.indexOf("multipart/form-data")>-1){const p=this.env&&this.env.FormData;return Qs(u?{"files[]":t}:t,p&&new p,this.formSerializer)}}return r||a?(n.setContentType("application/json",!1),Oy(t)):t}],transformResponse:[function(t){const n=this.transitional||Pi.transitional,o=n&&n.forcedJSONParsing,a=this.responseType==="json";if(Fe.isResponse(t)||Fe.isReadableStream(t))return t;if(t&&Fe.isString(t)&&(o&&!this.responseType||a)){const s=!(n&&n.silentJSONParsing)&&a;try{return JSON.parse(t)}catch(u){if(s)throw u.name==="SyntaxError"?yt.from(u,yt.ERR_BAD_RESPONSE,this,null,this.response):u}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Pn.classes.FormData,Blob:Pn.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Fe.forEach(["delete","get","head","post","put","patch"],e=>{Pi.headers[e]={}});const Ry=Fe.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Py=e=>{const t={};let n,o,a;return e&&e.split(`
|
||
`).forEach(function(s){a=s.indexOf(":"),n=s.substring(0,a).trim().toLowerCase(),o=s.substring(a+1).trim(),!(!n||t[n]&&Ry[n])&&(n==="set-cookie"?t[n]?t[n].push(o):t[n]=[o]:t[n]=t[n]?t[n]+", "+o:o)}),t},Pg=Symbol("internals");function Ni(e){return e&&String(e).trim().toLowerCase()}function Zs(e){return e===!1||e==null?e:Fe.isArray(e)?e.map(Zs):String(e)}function Ny(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let o;for(;o=n.exec(e);)t[o[1]]=o[2];return t}const Fy=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function ac(e,t,n,o,a){if(Fe.isFunction(o))return o.call(this,t,n);if(a&&(t=n),!!Fe.isString(t)){if(Fe.isString(o))return t.indexOf(o)!==-1;if(Fe.isRegExp(o))return o.test(t)}}function By(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,o)=>n.toUpperCase()+o)}function Uy(e,t){const n=Fe.toCamelCase(" "+t);["get","set","has"].forEach(o=>{Object.defineProperty(e,o+n,{value:function(a,r,s){return this[o].call(this,t,a,r,s)},configurable:!0})})}let Zn=class{constructor(t){t&&this.set(t)}set(t,n,o){const a=this;function r(u,p,m){const f=Ni(p);if(!f)throw new Error("header name must be a non-empty string");const g=Fe.findKey(a,f);(!g||a[g]===void 0||m===!0||m===void 0&&a[g]!==!1)&&(a[g||p]=Zs(u))}const s=(u,p)=>Fe.forEach(u,(m,f)=>r(m,f,p));if(Fe.isPlainObject(t)||t instanceof this.constructor)s(t,n);else if(Fe.isString(t)&&(t=t.trim())&&!Fy(t))s(Py(t),n);else if(Fe.isHeaders(t))for(const[u,p]of t.entries())r(p,u,o);else t!=null&&r(n,t,o);return this}get(t,n){if(t=Ni(t),t){const o=Fe.findKey(this,t);if(o){const a=this[o];if(!n)return a;if(n===!0)return Ny(a);if(Fe.isFunction(n))return n.call(this,a,o);if(Fe.isRegExp(n))return n.exec(a);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=Ni(t),t){const o=Fe.findKey(this,t);return!!(o&&this[o]!==void 0&&(!n||ac(this,this[o],o,n)))}return!1}delete(t,n){const o=this;let a=!1;function r(s){if(s=Ni(s),s){const u=Fe.findKey(o,s);u&&(!n||ac(o,o[u],u,n))&&(delete o[u],a=!0)}}return Fe.isArray(t)?t.forEach(r):r(t),a}clear(t){const n=Object.keys(this);let o=n.length,a=!1;for(;o--;){const r=n[o];(!t||ac(this,this[r],r,t,!0))&&(delete this[r],a=!0)}return a}normalize(t){const n=this,o={};return Fe.forEach(this,(a,r)=>{const s=Fe.findKey(o,r);if(s){n[s]=Zs(a),delete n[r];return}const u=t?By(r):String(r).trim();u!==r&&delete n[r],n[u]=Zs(a),o[u]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return Fe.forEach(this,(o,a)=>{o!=null&&o!==!1&&(n[a]=t&&Fe.isArray(o)?o.join(", "):o)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
|
||
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const o=new this(t);return n.forEach(a=>o.set(a)),o}static accessor(t){const o=(this[Pg]=this[Pg]={accessors:{}}).accessors,a=this.prototype;function r(s){const u=Ni(s);o[u]||(Uy(a,s),o[u]=!0)}return Fe.isArray(t)?t.forEach(r):r(t),this}};Zn.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Fe.reduceDescriptors(Zn.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(o){this[n]=o}}}),Fe.freezeMethods(Zn);function rc(e,t){const n=this||Pi,o=t||n,a=Zn.from(o.headers);let r=o.data;return Fe.forEach(e,function(u){r=u.call(n,r,a.normalize(),t?t.status:void 0)}),a.normalize(),r}function Ng(e){return!!(e&&e.__CANCEL__)}function Pr(e,t,n){yt.call(this,e??"canceled",yt.ERR_CANCELED,t,n),this.name="CanceledError"}Fe.inherits(Pr,yt,{__CANCEL__:!0});function Fg(e,t,n){const o=n.config.validateStatus;!n.status||!o||o(n.status)?e(n):t(new yt("Request failed with status code "+n.status,[yt.ERR_BAD_REQUEST,yt.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function zy(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Vy(e,t){e=e||10;const n=new Array(e),o=new Array(e);let a=0,r=0,s;return t=t!==void 0?t:1e3,function(p){const m=Date.now(),f=o[r];s||(s=m),n[a]=p,o[a]=m;let g=r,x=0;for(;g!==a;)x+=n[g++],g=g%e;if(a=(a+1)%e,a===r&&(r=(r+1)%e),m-s<t)return;const b=f&&m-f;return b?Math.round(x*1e3/b):void 0}}function Wy(e,t){let n=0,o=1e3/t,a,r;const s=(m,f=Date.now())=>{n=f,a=null,r&&(clearTimeout(r),r=null),e.apply(null,m)};return[(...m)=>{const f=Date.now(),g=f-n;g>=o?s(m,f):(a=m,r||(r=setTimeout(()=>{r=null,s(a)},o-g)))},()=>a&&s(a)]}const el=(e,t,n=3)=>{let o=0;const a=Vy(50,250);return Wy(r=>{const s=r.loaded,u=r.lengthComputable?r.total:void 0,p=s-o,m=a(p),f=s<=u;o=s;const g={loaded:s,total:u,progress:u?s/u:void 0,bytes:p,rate:m||void 0,estimated:m&&u&&f?(u-s)/m:void 0,event:r,lengthComputable:u!=null,[t?"download":"upload"]:!0};e(g)},n)},Bg=(e,t)=>{const n=e!=null;return[o=>t[0]({lengthComputable:n,total:e,loaded:o}),t[1]]},Ug=e=>(...t)=>Fe.asap(()=>e(...t)),jy=Pn.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Pn.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Pn.origin),Pn.navigator&&/(msie|trident)/i.test(Pn.navigator.userAgent)):()=>!0,Hy=Pn.hasStandardBrowserEnv?{write(e,t,n,o,a,r){const s=[e+"="+encodeURIComponent(t)];Fe.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),Fe.isString(o)&&s.push("path="+o),Fe.isString(a)&&s.push("domain="+a),r===!0&&s.push("secure"),document.cookie=s.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function Gy(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function qy(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function zg(e,t,n){let o=!Gy(t);return e&&o||n==!1?qy(e,t):t}const Vg=e=>e instanceof Zn?{...e}:e;function rr(e,t){t=t||{};const n={};function o(m,f,g,x){return Fe.isPlainObject(m)&&Fe.isPlainObject(f)?Fe.merge.call({caseless:x},m,f):Fe.isPlainObject(f)?Fe.merge({},f):Fe.isArray(f)?f.slice():f}function a(m,f,g,x){if(Fe.isUndefined(f)){if(!Fe.isUndefined(m))return o(void 0,m,g,x)}else return o(m,f,g,x)}function r(m,f){if(!Fe.isUndefined(f))return o(void 0,f)}function s(m,f){if(Fe.isUndefined(f)){if(!Fe.isUndefined(m))return o(void 0,m)}else return o(void 0,f)}function u(m,f,g){if(g in t)return o(m,f);if(g in e)return o(void 0,m)}const p={url:r,method:r,data:r,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:u,headers:(m,f,g)=>a(Vg(m),Vg(f),g,!0)};return Fe.forEach(Object.keys(Object.assign({},e,t)),function(f){const g=p[f]||a,x=g(e[f],t[f],f);Fe.isUndefined(x)&&g!==u||(n[f]=x)}),n}const Wg=e=>{const t=rr({},e);let{data:n,withXSRFToken:o,xsrfHeaderName:a,xsrfCookieName:r,headers:s,auth:u}=t;t.headers=s=Zn.from(s),t.url=Ig(zg(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),u&&s.set("Authorization","Basic "+btoa((u.username||"")+":"+(u.password?unescape(encodeURIComponent(u.password)):"")));let p;if(Fe.isFormData(n)){if(Pn.hasStandardBrowserEnv||Pn.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if((p=s.getContentType())!==!1){const[m,...f]=p?p.split(";").map(g=>g.trim()).filter(Boolean):[];s.setContentType([m||"multipart/form-data",...f].join("; "))}}if(Pn.hasStandardBrowserEnv&&(o&&Fe.isFunction(o)&&(o=o(t)),o||o!==!1&&jy(t.url))){const m=a&&r&&Hy.read(r);m&&s.set(a,m)}return t},Yy=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,o){const a=Wg(e);let r=a.data;const s=Zn.from(a.headers).normalize();let{responseType:u,onUploadProgress:p,onDownloadProgress:m}=a,f,g,x,b,k;function $(){b&&b(),k&&k(),a.cancelToken&&a.cancelToken.unsubscribe(f),a.signal&&a.signal.removeEventListener("abort",f)}let O=new XMLHttpRequest;O.open(a.method.toUpperCase(),a.url,!0),O.timeout=a.timeout;function I(){if(!O)return;const me=Zn.from("getAllResponseHeaders"in O&&O.getAllResponseHeaders()),z={data:!u||u==="text"||u==="json"?O.responseText:O.response,status:O.status,statusText:O.statusText,headers:me,config:e,request:O};Fg(function(P){n(P),$()},function(P){o(P),$()},z),O=null}"onloadend"in O?O.onloadend=I:O.onreadystatechange=function(){!O||O.readyState!==4||O.status===0&&!(O.responseURL&&O.responseURL.indexOf("file:")===0)||setTimeout(I)},O.onabort=function(){O&&(o(new yt("Request aborted",yt.ECONNABORTED,e,O)),O=null)},O.onerror=function(){o(new yt("Network Error",yt.ERR_NETWORK,e,O)),O=null},O.ontimeout=function(){let M=a.timeout?"timeout of "+a.timeout+"ms exceeded":"timeout exceeded";const z=a.transitional||Og;a.timeoutErrorMessage&&(M=a.timeoutErrorMessage),o(new yt(M,z.clarifyTimeoutError?yt.ETIMEDOUT:yt.ECONNABORTED,e,O)),O=null},r===void 0&&s.setContentType(null),"setRequestHeader"in O&&Fe.forEach(s.toJSON(),function(M,z){O.setRequestHeader(z,M)}),Fe.isUndefined(a.withCredentials)||(O.withCredentials=!!a.withCredentials),u&&u!=="json"&&(O.responseType=a.responseType),m&&([x,k]=el(m,!0),O.addEventListener("progress",x)),p&&O.upload&&([g,b]=el(p),O.upload.addEventListener("progress",g),O.upload.addEventListener("loadend",b)),(a.cancelToken||a.signal)&&(f=me=>{O&&(o(!me||me.type?new Pr(null,e,O):me),O.abort(),O=null)},a.cancelToken&&a.cancelToken.subscribe(f),a.signal&&(a.signal.aborted?f():a.signal.addEventListener("abort",f)));const V=zy(a.url);if(V&&Pn.protocols.indexOf(V)===-1){o(new yt("Unsupported protocol "+V+":",yt.ERR_BAD_REQUEST,e));return}O.send(r||null)})},Ky=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let o=new AbortController,a;const r=function(m){if(!a){a=!0,u();const f=m instanceof Error?m:this.reason;o.abort(f instanceof yt?f:new Pr(f instanceof Error?f.message:f))}};let s=t&&setTimeout(()=>{s=null,r(new yt(`timeout ${t} of ms exceeded`,yt.ETIMEDOUT))},t);const u=()=>{e&&(s&&clearTimeout(s),s=null,e.forEach(m=>{m.unsubscribe?m.unsubscribe(r):m.removeEventListener("abort",r)}),e=null)};e.forEach(m=>m.addEventListener("abort",r));const{signal:p}=o;return p.unsubscribe=()=>Fe.asap(u),p}},Jy=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let o=0,a;for(;o<n;)a=o+t,yield e.slice(o,a),o=a},Xy=async function*(e,t){for await(const n of Qy(e))yield*Jy(n,t)},Qy=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:o}=await t.read();if(n)break;yield o}}finally{await t.cancel()}},jg=(e,t,n,o)=>{const a=Xy(e,t);let r=0,s,u=p=>{s||(s=!0,o&&o(p))};return new ReadableStream({async pull(p){try{const{done:m,value:f}=await a.next();if(m){u(),p.close();return}let g=f.byteLength;if(n){let x=r+=g;n(x)}p.enqueue(new Uint8Array(f))}catch(m){throw u(m),m}},cancel(p){return u(p),a.return()}},{highWaterMark:2})},tl=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Hg=tl&&typeof ReadableStream=="function",Zy=tl&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),Gg=(e,...t)=>{try{return!!e(...t)}catch{return!1}},eb=Hg&&Gg(()=>{let e=!1;const t=new Request(Pn.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),qg=64*1024,ic=Hg&&Gg(()=>Fe.isReadableStream(new Response("").body)),nl={stream:ic&&(e=>e.body)};tl&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!nl[t]&&(nl[t]=Fe.isFunction(e[t])?n=>n[t]():(n,o)=>{throw new yt(`Response type '${t}' is not supported`,yt.ERR_NOT_SUPPORT,o)})})})(new Response);const tb=async e=>{if(e==null)return 0;if(Fe.isBlob(e))return e.size;if(Fe.isSpecCompliantForm(e))return(await new Request(Pn.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(Fe.isArrayBufferView(e)||Fe.isArrayBuffer(e))return e.byteLength;if(Fe.isURLSearchParams(e)&&(e=e+""),Fe.isString(e))return(await Zy(e)).byteLength},nb=async(e,t)=>{const n=Fe.toFiniteNumber(e.getContentLength());return n??tb(t)},sc={http:Sy,xhr:Yy,fetch:tl&&(async e=>{let{url:t,method:n,data:o,signal:a,cancelToken:r,timeout:s,onDownloadProgress:u,onUploadProgress:p,responseType:m,headers:f,withCredentials:g="same-origin",fetchOptions:x}=Wg(e);m=m?(m+"").toLowerCase():"text";let b=Ky([a,r&&r.toAbortSignal()],s),k;const $=b&&b.unsubscribe&&(()=>{b.unsubscribe()});let O;try{if(p&&eb&&n!=="get"&&n!=="head"&&(O=await nb(f,o))!==0){let z=new Request(t,{method:"POST",body:o,duplex:"half"}),ce;if(Fe.isFormData(o)&&(ce=z.headers.get("content-type"))&&f.setContentType(ce),z.body){const[P,le]=Bg(O,el(Ug(p)));o=jg(z.body,qg,P,le)}}Fe.isString(g)||(g=g?"include":"omit");const I="credentials"in Request.prototype;k=new Request(t,{...x,signal:b,method:n.toUpperCase(),headers:f.normalize().toJSON(),body:o,duplex:"half",credentials:I?g:void 0});let V=await fetch(k);const me=ic&&(m==="stream"||m==="response");if(ic&&(u||me&&$)){const z={};["status","statusText","headers"].forEach(ie=>{z[ie]=V[ie]});const ce=Fe.toFiniteNumber(V.headers.get("content-length")),[P,le]=u&&Bg(ce,el(Ug(u),!0))||[];V=new Response(jg(V.body,qg,P,()=>{le&&le(),$&&$()}),z)}m=m||"text";let M=await nl[Fe.findKey(nl,m)||"text"](V,e);return!me&&$&&$(),await new Promise((z,ce)=>{Fg(z,ce,{data:M,headers:Zn.from(V.headers),status:V.status,statusText:V.statusText,config:e,request:k})})}catch(I){throw $&&$(),I&&I.name==="TypeError"&&/fetch/i.test(I.message)?Object.assign(new yt("Network Error",yt.ERR_NETWORK,e,k),{cause:I.cause||I}):yt.from(I,I&&I.code,e,k)}})};Fe.forEach(sc,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Yg=e=>`- ${e}`,ob=e=>Fe.isFunction(e)||e===null||e===!1,Kg={getAdapter:e=>{e=Fe.isArray(e)?e:[e];const{length:t}=e;let n,o;const a={};for(let r=0;r<t;r++){n=e[r];let s;if(o=n,!ob(n)&&(o=sc[(s=String(n)).toLowerCase()],o===void 0))throw new yt(`Unknown adapter '${s}'`);if(o)break;a[s||"#"+r]=o}if(!o){const r=Object.entries(a).map(([u,p])=>`adapter ${u} `+(p===!1?"is not supported by the environment":"is not available in the build"));let s=t?r.length>1?`since :
|
||
`+r.map(Yg).join(`
|
||
`):" "+Yg(r[0]):"as no adapter specified";throw new yt("There is no suitable adapter to dispatch the request "+s,"ERR_NOT_SUPPORT")}return o},adapters:sc};function lc(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Pr(null,e)}function Jg(e){return lc(e),e.headers=Zn.from(e.headers),e.data=rc.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Kg.getAdapter(e.adapter||Pi.adapter)(e).then(function(o){return lc(e),o.data=rc.call(e,e.transformResponse,o),o.headers=Zn.from(o.headers),o},function(o){return Ng(o)||(lc(e),o&&o.response&&(o.response.data=rc.call(e,e.transformResponse,o.response),o.response.headers=Zn.from(o.response.headers))),Promise.reject(o)})}const Xg="1.8.3",ol={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{ol[e]=function(o){return typeof o===e||"a"+(t<1?"n ":" ")+e}});const Qg={};ol.transitional=function(t,n,o){function a(r,s){return"[Axios v"+Xg+"] Transitional option '"+r+"'"+s+(o?". "+o:"")}return(r,s,u)=>{if(t===!1)throw new yt(a(s," has been removed"+(n?" in "+n:"")),yt.ERR_DEPRECATED);return n&&!Qg[s]&&(Qg[s]=!0,console.warn(a(s," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(r,s,u):!0}},ol.spelling=function(t){return(n,o)=>(console.warn(`${o} is likely a misspelling of ${t}`),!0)};function ab(e,t,n){if(typeof e!="object")throw new yt("options must be an object",yt.ERR_BAD_OPTION_VALUE);const o=Object.keys(e);let a=o.length;for(;a-- >0;){const r=o[a],s=t[r];if(s){const u=e[r],p=u===void 0||s(u,r,e);if(p!==!0)throw new yt("option "+r+" must be "+p,yt.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new yt("Unknown option "+r,yt.ERR_BAD_OPTION)}}const al={assertOptions:ab,validators:ol},Uo=al.validators;let ir=class{constructor(t){this.defaults=t,this.interceptors={request:new Dg,response:new Dg}}async request(t,n){try{return await this._request(t,n)}catch(o){if(o instanceof Error){let a={};Error.captureStackTrace?Error.captureStackTrace(a):a=new Error;const r=a.stack?a.stack.replace(/^.+\n/,""):"";try{o.stack?r&&!String(o.stack).endsWith(r.replace(/^.+\n.+\n/,""))&&(o.stack+=`
|
||
`+r):o.stack=r}catch{}}throw o}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=rr(this.defaults,n);const{transitional:o,paramsSerializer:a,headers:r}=n;o!==void 0&&al.assertOptions(o,{silentJSONParsing:Uo.transitional(Uo.boolean),forcedJSONParsing:Uo.transitional(Uo.boolean),clarifyTimeoutError:Uo.transitional(Uo.boolean)},!1),a!=null&&(Fe.isFunction(a)?n.paramsSerializer={serialize:a}:al.assertOptions(a,{encode:Uo.function,serialize:Uo.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),al.assertOptions(n,{baseUrl:Uo.spelling("baseURL"),withXsrfToken:Uo.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let s=r&&Fe.merge(r.common,r[n.method]);r&&Fe.forEach(["delete","get","head","post","put","patch","common"],k=>{delete r[k]}),n.headers=Zn.concat(s,r);const u=[];let p=!0;this.interceptors.request.forEach(function($){typeof $.runWhen=="function"&&$.runWhen(n)===!1||(p=p&&$.synchronous,u.unshift($.fulfilled,$.rejected))});const m=[];this.interceptors.response.forEach(function($){m.push($.fulfilled,$.rejected)});let f,g=0,x;if(!p){const k=[Jg.bind(this),void 0];for(k.unshift.apply(k,u),k.push.apply(k,m),x=k.length,f=Promise.resolve(n);g<x;)f=f.then(k[g++],k[g++]);return f}x=u.length;let b=n;for(g=0;g<x;){const k=u[g++],$=u[g++];try{b=k(b)}catch(O){$.call(this,O);break}}try{f=Jg.call(this,b)}catch(k){return Promise.reject(k)}for(g=0,x=m.length;g<x;)f=f.then(m[g++],m[g++]);return f}getUri(t){t=rr(this.defaults,t);const n=zg(t.baseURL,t.url,t.allowAbsoluteUrls);return Ig(n,t.params,t.paramsSerializer)}};Fe.forEach(["delete","get","head","options"],function(t){ir.prototype[t]=function(n,o){return this.request(rr(o||{},{method:t,url:n,data:(o||{}).data}))}}),Fe.forEach(["post","put","patch"],function(t){function n(o){return function(r,s,u){return this.request(rr(u||{},{method:t,headers:o?{"Content-Type":"multipart/form-data"}:{},url:r,data:s}))}}ir.prototype[t]=n(),ir.prototype[t+"Form"]=n(!0)});let rb=class Ph{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(r){n=r});const o=this;this.promise.then(a=>{if(!o._listeners)return;let r=o._listeners.length;for(;r-- >0;)o._listeners[r](a);o._listeners=null}),this.promise.then=a=>{let r;const s=new Promise(u=>{o.subscribe(u),r=u}).then(a);return s.cancel=function(){o.unsubscribe(r)},s},t(function(r,s,u){o.reason||(o.reason=new Pr(r,s,u),n(o.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=o=>{t.abort(o)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new Ph(function(a){t=a}),cancel:t}}};function ib(e){return function(n){return e.apply(null,n)}}function sb(e){return Fe.isObject(e)&&e.isAxiosError===!0}const uc={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(uc).forEach(([e,t])=>{uc[t]=e});function Zg(e){const t=new ir(e),n=_g(ir.prototype.request,t);return Fe.extend(n,ir.prototype,t,{allOwnKeys:!0}),Fe.extend(n,t,null,{allOwnKeys:!0}),n.create=function(a){return Zg(rr(e,a))},n}const mn=Zg(Pi);mn.Axios=ir,mn.CanceledError=Pr,mn.CancelToken=rb,mn.isCancel=Ng,mn.VERSION=Xg,mn.toFormData=Qs,mn.AxiosError=yt,mn.Cancel=mn.CanceledError,mn.all=function(t){return Promise.all(t)},mn.spread=ib,mn.isAxiosError=sb,mn.mergeConfig=rr,mn.AxiosHeaders=Zn,mn.formToJSON=e=>Rg(Fe.isHTMLForm(e)?new FormData(e):e),mn.getAdapter=Kg.getAdapter,mn.HttpStatusCode=uc,mn.default=mn;const{Axios:_D,AxiosError:yD,CanceledError:bD,isCancel:wD,CancelToken:xD,VERSION:SD,all:TD,Cancel:kD,isAxiosError:CD,spread:ED,toFormData:$D,AxiosHeaders:LD,HttpStatusCode:AD,formToJSON:MD,getAdapter:ID,mergeConfig:DD}=mn,Ye=mn.create({baseURL:"/weilin/prompt_ui/api",timeout:3e4,headers:{"Content-Type":"application/json"}});Ye.interceptors.request.use(e=>e,e=>Promise.reject(e)),Ye.interceptors.response.use(e=>e.data,e=>Promise.reject(e));const rl={getUserSetting:()=>Ye({url:"/user_init/get_settings",method:"get"}),setUserLanguage:e=>Ye({url:"/user_init/set_user_lang",method:"post",data:{user_lang:e}}),startPanel:()=>Ye({url:"/panel/start",method:"post"})},em=()=>Xu(),Fi=p2({legacy:!1,locale:"zh_CN",fallbackLocale:"zh_CN",messages:{zh_CN:A2,en_US:M2}}),lb=()=>{const e=em();rl.getUserSetting().then(t=>{var o;e.setUserSetting(t.data);const n=((o=e.userSetting)==null?void 0:o.user_lang)||"zh_CN";Fi.global.locale.value=n})},ub=e=>{Fi.global.locale.value=e,em().setUserSetting({user_lang:e})},cb=()=>{lb()},db={name:"popmessage",props:{type:{type:String,default:"success"},str:{type:String,default:"登陆成功"}},setup(){const e={warn:{color:"#E6A23C",backgroundColor:"rgb(253, 246, 236)",borderColor:"rgb(250, 236, 216)"},error:{color:"#F56C6C",backgroundColor:"rgb(254, 240, 240)",borderColor:"rgb(253, 226, 226)"},success:{color:"#67C23A",backgroundColor:"rgb(240, 249, 235)",borderColor:"rgb(225, 243, 216)"}},t=S(!1);return Ut(()=>{t.value=!0}),{style:e,visible:t}}},pb={class:"text"};function fb(e,t,n,o,a,r){return $e((E(),D("div",{class:"pop-message",style:Bt(o.style[n.type])},[i("i",{class:We(["icon",[o.style[n.type].icon]])},null,2),i("span",pb,y(n.str),1)],4)),[[ki,o.visible]])}const gb=qt(db,[["render",fb],["__scopeId","data-v-466143c4"]]),cc=document.createElement("div");document.body.appendChild(cc);let dc=null;const ue=({str:e,type:t,name:n=""})=>{let o=Fi.global.t(e);n.length>0&&(o=Fi.global.t(e,{name:n}));const a=it(gb,{str:o,type:t});ff(a,cc),dc&&clearTimeout(dc),dc=setTimeout(()=>{ff(null,cc)},2e3)},mb={class:"language-selector-content"},hb=["onClick"],vb={class:"lang-name"},_b=qt({__name:"LanguageSwitcher",emits:["close"],setup(e,{expose:t,emit:n}){const{t:o}=Gt(),a=S(null),r=Xu(),s=Ht(()=>r.userSetting.user_lang),u=[{code:"zh_CN",name:"简体中文"},{code:"en_US",name:"English"}],p=n,m=x=>{f(x),p("close",{})},f=x=>{rl.setUserLanguage(x).then(()=>{ub(x),window.postMessage({type:"weilin_prompt_ui_tag_manager_refresh"},"*"),window.postMessage({type:"weilin_prompt_ui_refresh_all_data"},"*"),ue({type:"success",str:"message.setLanguageSuccess"})}).catch(()=>{ue({type:"warn",str:"message.setLanguageFailed"})})};return t({setPosition:x=>{if(!a.value)return;const b=a.value;b.style.position="fixed",b.style.top=`${x.bottom}px`}}),(x,b)=>(E(),D("div",{class:"language-selector",ref_key:"selectorRef",ref:a},[i("div",mb,[(E(),D(Ke,null,lt(u,(k,$)=>i("div",{style:Bt({"margin-top":$===0?"0":"2px"}),key:k.code,class:We(["language-option",{active:s.value===k.code}]),onClick:O=>m(k.code)},[i("span",vb,y(k.name),1)],14,hb)),64))])],512))}},[["__scopeId","data-v-ed3849db"]]),la="weilin_prompt_ui_",Nr=qt({__name:"Dialog",props:{modelValue:Boolean,title:{type:String,default:"标题"},closeOnClickOverlay:{type:Boolean,default:!1},width:{type:String,default:"60%"}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,o=t,a=()=>{o("update:modelValue",!1)},r=()=>{n.closeOnClickOverlay&&a()};return(s,u)=>(E(),Jt(zd,{to:"#weilin_comfyui_tools_prompt_ui_div"},[it(Os,{name:`${la}dialog-fade`},{default:Pt(()=>[e.modelValue?(E(),D("div",{key:0,class:We(`${la}dialog-overlay`),onClick:r},[it(Os,{name:`${la}dialog-slide`},{default:Pt(()=>[e.modelValue?(E(),D("div",{key:0,style:Bt({width:e.width}),class:We(`${la}dialog`),onClick:u[0]||(u[0]=Tt(()=>{},["stop"]))},[i("div",{class:We(`${la}dialog-header`)},[i("h3",{class:We(`${la}dialog-title`)},y(e.title),3),i("button",{class:We(`${la}dialog-close`),onClick:a},u[1]||(u[1]=[i("svg",{viewBox:"0 0 24 24",width:"16",height:"16"},[i("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})],-1)]),2)],2),i("div",{class:We(`${la}dialog-content`)},[mi(s.$slots,"default")],2),s.$slots.footer?(E(),D("div",{key:0,class:We(`${la}dialog-footer`)},[mi(s.$slots,"footer")],2)):Ce("",!0)],6)):Ce("",!0)]),_:3},8,["name"])],2)):Ce("",!0)]),_:3},8,["name"])]))}},[["__scopeId","data-v-48cece99"]]),eo={getTranslateLocal:e=>Ye({url:"/prompt/local/translate",method:"post",data:{phrase:e}}),getTranslateSetting:()=>Ye({url:"/translate/get/setting",method:"post",data:{}}),applyTranslateSetting:e=>Ye({url:"/translate/apply_setting",method:"post",data:{setting:e}}),getTranslateBuktSetting:()=>Ye({url:"/translate/get/tran_setting",method:"post",data:{}}),saveTranslateSetting:(e,t,n)=>Ye({url:"/translate/save_tran/setting",method:"post",data:{service:e,source_lang:t,target_lang:n}}),translaterText:(e,t)=>Ye({url:"/translate/tran/text",method:"post",timeout:0,data:{str_object:e,text:t}}),translaterInputText:(e,t)=>Ye({url:"/translate/tran/input",method:"post",timeout:0,data:{str_object:e,text:t}})},pc={getAutocomplete:e=>Ye({url:"/prompt/fast/autocomplete",method:"post",data:{query:e}}),getAutocompleteLimit:()=>Ye({url:"/get/setting/get_auto_limit_setting",method:"post"}),updateAutocompleteLimit:e=>Ye({url:"/update/setting/update_auto_limit_setting",method:"post",data:{limit:e}})},Bi={updateOpenAiSetting:e=>Ye({url:"/prompt/openai/update_settings",method:"post",data:e}),addOpenAiSetting:e=>Ye({url:"/prompt/openai/add_setting",method:"post",data:e}),deleteOpenAiSetting:e=>Ye({url:"/prompt/openai/delete_setting",method:"post",data:e}),setOpenAiSelect:e=>Ye({url:"/prompt/openai/set_select",method:"post",data:e}),getOpenAiSetting:()=>Ye({url:"/prompt/openai/get_settings",method:"get"})},yb=["alibaba","bing","youdao"],Ui=[{language:"chinese",translator:"zh"},{language:"english",translator:"en"},{language:"arabic",translator:"ar"},{language:"russian",translator:"ru"},{language:"french",translator:"fr"},{language:"german",translator:"de"},{language:"spanish",translator:"es"},{language:"portuguese",translator:"pt"},{language:"italian",translator:"it"},{language:"japanese",translator:"ja"},{language:"korean",translator:"ko"},{language:"greek",translator:"el"},{language:"dutch",translator:"nl"},{language:"hindi",translator:"hi"},{language:"turkish",translator:"tr"},{language:"malay",translator:"ms"},{language:"thai",translator:"th"},{language:"vietnamese",translator:"vi"},{language:"indonesian",translator:"id"},{language:"hebrew",translator:"he"},{language:"polish",translator:"pl"},{language:"mongolian",translator:"mn"},{language:"czech",translator:"cs"},{language:"hungarian",translator:"hu"},{language:"estonian",translator:"et"},{language:"bulgarian",translator:"bg"},{language:"danish",translator:"da"},{language:"finnish",translator:"fi"},{language:"romanian",translator:"ro"},{language:"swedish",translator:"sv"},{language:"slovenian",translator:"sl"},{language:"persian/farsi",translator:"fa"},{language:"bosnian",translator:"bs"},{language:"serbian",translator:"sr"},{language:"fijian",translator:"fj"},{language:"filipino",translator:"tl"},{language:"haitiancreole",translator:"ht"},{language:"catalan",translator:"ca"},{language:"croatian",translator:"hr"},{language:"latvian",translator:"lv"},{language:"lithuanian",translator:"lt"},{language:"urdu",translator:"ur"},{language:"ukrainian",translator:"uk"},{language:"welsh",translator:"cy"},{language:"tahiti",translator:"ty"},{language:"tongan",translator:"to"},{language:"swahili",translator:"sw"},{language:"samoan",translator:"sm"},{language:"slovak",translator:"sk"},{language:"afrikaans",translator:"af"},{language:"norwegian",translator:"no"},{language:"bengali",translator:"bn"},{language:"malagasy",translator:"mg"},{language:"maltese",translator:"mt"},{language:"queretaro otomi",translator:"otq"},{language:"klingon/tlhingan hol",translator:"tlh"},{language:"gujarati",translator:"gu"},{language:"tamil",translator:"ta"},{language:"telugu",translator:"te"},{language:"punjabi",translator:"pa"},{language:"amharic",translator:"am"},{language:"azerbaijani",translator:"az"},{language:"bashkir",translator:"ba"},{language:"belarusian",translator:"be"},{language:"cebuano",translator:"ceb"},{language:"chuvash",translator:"cv"},{language:"esperanto",translator:"eo"},{language:"basque",translator:"eu"},{language:"irish",translator:"ga"}],fc={getAiServerSetting:()=>Ye({url:"/ai_server/get_settings",method:"post",data:{}}),updateAiServerSetting:e=>Ye({url:"/ai_server/update_settings",method:"post",data:e}),getAiModels:()=>Ye({url:"/ai_server/get_ai_models",method:"post",data:{}})},bb={class:"ai-server-setting-panel"},wb={class:"weilin-comfyui-translater-setting-box"},xb={class:"weilin-comfyui-setting-item"},Sb={class:"weilin-comfyui-setting-item"},Tb={class:"weilin-comfyui-setting-item"},kb={style:{display:"flex",gap:"10px"}},Cb=["value"],Eb={class:"weilin-comfyui-translater-setting-box"},$b={class:"weilin-comfyui-setting-small-titile"},Lb={class:"weilin-comfyui-language-selectors"},Ab={class:"weilin-comfyui-setting-item"},Mb=["index","value"],Ib={class:"weilin-comfyui-setting-item"},Db=["index","value"],Ob={class:"weilin-comfyui-translater-setting-box"},Rb={class:"weilin-comfyui-setting-small-titile"},Pb={class:"weilin-comfyui-setting-item"},Nb=["placeholder"],Fb={class:"weilin-comfyui-setting-item"},Bb=["placeholder"],Ub=qt({__name:"ai_server_setting",setup(e){const{t}=Gt(),n=S(""),o=S(""),a=S(""),r=S(""),s=S(""),u=S({api_key:"",base_url:"https://api.siliconflow.cn/v1",model:"",temperature:0,top_p:.7,max_tokens:4096}),p=S({object:"list",data:[]}),m=()=>{fc.updateAiServerSetting(u.value).then($=>{$.info==="ok"?ue({type:"success",str:"message.saveSuccess"}):ue({type:"warn",str:"message.saveFailed"})}).catch(()=>{ue({type:"warn",str:"message.saveFailed"})})},f=()=>{fc.getAiServerSetting().then($=>{u.value=$.data}).catch(()=>{ue({type:"warn",str:"message.getTranslaterFail"})})},g=()=>{fc.getAiModels().then($=>{p.value=$.data}).catch(()=>{ue({type:"warn",str:"message.getTranslaterFail"})})},x=()=>{eo.getTranslateBuktSetting().then($=>{n.value=$.data.translate_service,o.value=$.data.translate_source_lang,a.value=$.data.translate_target_lang}).catch(()=>{ue({type:"warn",str:"message.getTranslaterFail"})})},b=()=>{eo.saveTranslateSetting(n.value,o.value,a.value).then($=>{$.info==="ok"?ue({type:"success",str:"message.saveSuccess"}):ue({type:"warn",str:"message.saveFailed"})}).catch(()=>{ue({type:"warn",str:"message.saveFailed"})})},k=()=>{eo.translaterInputText("",s.value).then($=>{$&&$.data&&(r.value=$.data)}).catch(()=>{ue({type:"warn",str:"message.translaterTestFail"})})};return Ut(()=>{f(),g(),x()}),($,O)=>(E(),D("div",bb,[i("div",wb,[i("div",xb,[O[7]||(O[7]=i("label",null,"API Key",-1)),$e(i("input",{type:"text","onUpdate:modelValue":O[0]||(O[0]=I=>u.value.api_key=I),placeholder:"请输入API Key",class:"weilin-comfyui-common-select"},null,512),[[ze,u.value.api_key]])]),i("div",Sb,[O[9]||(O[9]=i("label",null,"AI平台",-1)),$e(i("select",{"onUpdate:modelValue":O[1]||(O[1]=I=>u.value.base_url=I),disabled:"",class:"weilin-comfyui-common-select"},O[8]||(O[8]=[i("option",{value:"https://api.siliconflow.cn/v1"},"硅基AI",-1)]),512),[[Tn,u.value.base_url]])]),i("div",Tb,[O[10]||(O[10]=i("label",null,"Model(获取前请先填写完API Key点击保存后再获取!)",-1)),i("div",kb,[$e(i("select",{"onUpdate:modelValue":O[2]||(O[2]=I=>u.value.model=I),class:"weilin-comfyui-common-select",style:{flex:"1"}},[(E(!0),D(Ke,null,lt(p.value.data,I=>(E(),D("option",{key:I.id,value:I.id},y(I.id),9,Cb))),128))],512),[[Tn,u.value.model]]),i("button",{type:"button",class:"weilin-comfyui-install-button",style:{width:"auto","min-width":"120px"},onClick:g}," 获取模型列表 ")])]),i("button",{class:"weilin-comfyui-save-button",onClick:m}," 保存AI平台设置 ")]),i("div",Eb,[i("div",$b,y(v(t)("promptBox.settings.translaterSetting")),1),i("div",Lb,[i("div",Ab,[i("label",null,y(v(t)("promptBox.settings.translaterLangSourceSetting")),1),$e(i("select",{"onUpdate:modelValue":O[3]||(O[3]=I=>o.value=I)},[(E(!0),D(Ke,null,lt(v(Ui),(I,V)=>(E(),D("option",{index:V,key:"lan-item_"+V,value:I.translator},y(v(t)("translaterLanguage."+I.language)),9,Mb))),128))],512),[[Tn,o.value]])]),i("div",Ib,[i("label",null,y(v(t)("promptBox.settings.translaterLangTargeSetting")),1),$e(i("select",{"onUpdate:modelValue":O[4]||(O[4]=I=>a.value=I)},[(E(!0),D(Ke,null,lt(v(Ui),(I,V)=>(E(),D("option",{index:V,key:"lan-mu-item_"+V,value:I.translator},y(v(t)("translaterLanguage."+I.language)),9,Db))),128))],512),[[Tn,a.value]])])]),i("button",{class:"weilin-comfyui-install-button",onClick:b},y(v(t)("promptBox.settings.saveTranslaterSetting")),1)]),i("div",Ob,[i("div",Rb,y(v(t)("promptBox.settings.testTranslaterTitle")),1),i("div",Pb,[i("label",null,y(v(t)("promptBox.settings.inputTestTranslater")),1),$e(i("input",{type:"text","onUpdate:modelValue":O[5]||(O[5]=I=>s.value=I),placeholder:v(t)("promptBox.settings.inputTestTranslaterPlaceholder")},null,8,Nb),[[ze,s.value]])]),i("div",Fb,[i("label",null,y(v(t)("promptBox.settings.outPutTestTranslater")),1),$e(i("input",{type:"text","onUpdate:modelValue":O[6]||(O[6]=I=>r.value=I),readonly:"",placeholder:v(t)("promptBox.settings.outPutTestTranslaterPlaceholder")},null,8,Bb),[[ze,r.value]])]),i("button",{class:"weilin-comfyui-install-button",onClick:k},y(v(t)("promptBox.settings.testingTranslater")),1)])]))}},[["__scopeId","data-v-8663ecc8"]]),zb={class:"weilin-comfyui-settings-content"},Vb={class:"weilin-comfyui-settings-sidebar"},Wb={class:"weilin-comfyui-settings-main"},jb={key:0},Hb={class:"weilin-comfyui-setting-select"},Gb={value:"translater"},qb={class:"weilin-comfyui-translator-settings"},Yb={key:0,class:"weilin-comfyui-group-box"},Kb={key:1,class:"weilin-comfyui-group-box"},Jb={class:"weilin-comfyui-group-title"},Xb={class:"weilin-comfyui-note-top"},Qb={class:"weilin-comfyui-setting-item"},Zb={value:"auto"},e4={value:"chinese_simplified"},t4={value:"english"},n4={class:"weilin-comfyui-setting-item"},o4={value:"chinese_simplified"},a4={value:"english"},r4={key:2,class:"weilin-comfyui-group-box"},i4={class:"weilin-comfyui-group-title"},s4={class:"weilin-comfyui-translater-setting-box"},l4={class:"weilin-comfyui-setting-small-titile"},u4={class:"weilin-comfyui-setting-item"},c4=["index","value"],d4={class:"weilin-comfyui-language-selectors"},p4={class:"weilin-comfyui-setting-item"},f4=["index","value"],g4={class:"weilin-comfyui-setting-item"},m4=["index","value"],h4={class:"weilin-comfyui-tranlater-text-box"},v4={class:"weilin-comfyui-setting-small-titile"},_4={class:"weilin-comfyui-setting-item"},y4=["placeholder"],b4={class:"weilin-comfyui-setting-item"},w4=["placeholder"],x4={key:1},S4={class:"weilin-comfyui-floating-ball-settings"},T4={class:"weilin-comfyui-setting-item"},k4=["placeholder"],C4={class:"weilin-comfyui-setting-item"},E4=["placeholder"],$4={class:"weilin-comfyui-setting-item"},L4=["placeholder"],A4={key:2},M4={class:"weilin-comfyui-floating-ball-settings"},I4={class:"weilin-comfyui-setting-item"},D4={class:"weilin-comfyui-setting-item"},O4={class:"weilin-comfyui-setting-item"},R4={class:"weilin-comfyui-setting-item"},P4={class:"weilin-comfyui-setting-item"},N4={class:"weilin-comfyui-setting-item"},F4={key:3},B4={class:"weilin-comfyui-floating-ball-settings",style:{display:"grid","grid-template-columns":"repeat(2, 1fr)",gap:"15px"}},U4={class:"weilin-comfyui-settings-column"},z4={class:"weilin-comfyui-setting-item"},V4={class:"weilin-comfyui-setting-item"},W4=["placeholder"],j4={class:"weilin-comfyui-setting-item"},H4=["placeholder"],G4={class:"weilin-comfyui-setting-item"},q4=["placeholder"],Y4={class:"weilin-comfyui-settings-column"},K4={class:"weilin-comfyui-setting-item"},J4={value:"default"},X4={value:"custom"},Q4={key:0,class:"weilin-comfyui-setting-item"},Z4={key:0,class:"weilin-comfyui-skin-preview"},ew=["src"],tw={class:"weilin-comfyui-setting-item",style:{"grid-column":"span 2"}},nw={value:"gradient"},ow={value:"transparent"},aw={key:0,class:"weilin-comfyui-setting-item",style:{"grid-column":"span 2"}},rw={style:{display:"flex",gap:"10px","align-items":"center"}},iw={class:"weilin-comfyui-setting-item",style:{"grid-column":"span 2"}},sw={key:4},lw={class:"weilin-comfyui-floating-ball-settings"},uw={class:"weilin-comfyui-setting-item"},cw={class:"weilin-comfyui-setting-item"},dw={class:"weilin-comfyui-setting-item"},pw={class:"weilin-comfyui-setting-item"},fw={class:"weilin-comfyui-setting-item"},gw={class:"weilin-comfyui-setting-item"},mw={class:"weilin-comfyui-setting-item"},hw={key:5},vw={class:"weilin-comfyui-openai-settings"},_w={class:"weilin-comfyui-setting-item"},yw=["value"],bw={class:"weilin-comfyui-config-list"},ww={class:"weilin-comfyui-config-header"},xw={class:"weilin-comfyui-config-actions"},Sw=["onClick"],Tw=["onClick"],kw={key:0,class:"weilin-comfyui-config-form"},Cw={class:"weilin-comfyui-form-group"},Ew=["placeholder"],$w={class:"weilin-comfyui-form-group"},Lw=["placeholder"],Aw={class:"weilin-comfyui-form-group"},Mw=["placeholder"],Iw={class:"weilin-comfyui-form-actions"},Dw=["onClick"],Ow={key:1,class:"weilin-comfyui-config-details"},Rw={key:0,class:"weilin-comfyui-config-form"},Pw={class:"weilin-comfyui-form-group"},Nw=["placeholder"],Fw={class:"weilin-comfyui-form-group"},Bw=["placeholder"],Uw={class:"weilin-comfyui-form-group"},zw=["placeholder"],Vw={class:"weilin-comfyui-form-actions"},Ww={key:6},jw={class:"weilin-comfyui-sponsor-me-settings"},Hw={key:7},Gw={class:"weilin-comfyui-start-panel-settings"},tm=qt({__name:"setting_dialog",emits:["functionTogglesUpdated"],setup(e,{expose:t,emit:n}){const o=n,{t:a}=Gt(),r=S(!1),s=S("translator"),u=S("baidu"),p=S(""),m=S(localStorage.getItem("weilin_prompt_ui_sourceLanguage")||"english"),f=S(localStorage.getItem("weilin_prompt_ui_targetLanguage")||"chinese_simplified"),g=S(localStorage.getItem("weilin_prompt_ui_floatingBallCount")||1),x=S(localStorage.getItem("weilin_prompt_ui_floatingBallSize")||66),b=S(localStorage.getItem("weilin_prompt_ui_floatingBallHeightSize")||x.value),k=S(localStorage.getItem("weilin_prompt_ui_floatingBallEnabled")==="true"),$=S(localStorage.getItem("weilin_prompt_ui_ballSkinType")||"default"),O=S(localStorage.getItem("weilin_prompt_ui_customSkinUrl")||""),I=S(localStorage.getItem("weilin_prompt_ui_bgType")||"gradient"),V=S(localStorage.getItem("weilin_prompt_ui_gradientColor1")||"#6a11cb"),me=S(localStorage.getItem("weilin_prompt_ui_gradientColor2")||"#2575fc"),M=S(localStorage.getItem("weilin_prompt_ui_ballBorderRadius")||50),z=S(localStorage.getItem("weilin_prompt_ui_comma_conversion")==="true"),ce=S(localStorage.getItem("weilin_prompt_ui_period_conversion")==="true"),P=S(localStorage.getItem("weilin_prompt_ui_bracket_conversion")==="true"),le=S(localStorage.getItem("weilin_prompt_ui_angle_bracket_conversion")==="true"),ie=S(localStorage.getItem("weilin_prompt_ui_underscore_to_bracket")==="true"),Oe=S(localStorage.getItem("weilin_prompt_ui_comma_close_autocomplete")==="true"),Ae=S(localStorage.getItem("weilin_prompt_ui_bracket_escape")==="true"),fe=S(localStorage.getItem("weilin_function_toggles_clearAll")!=="false"),_e=S(localStorage.getItem("weilin_function_toggles_deleteButton")!=="false"),ae=S(localStorage.getItem("weilin_function_toggles_randomTag")!=="false"),W=S(localStorage.getItem("weilin_function_toggles_randomTagSettings")!=="false"),re=S(localStorage.getItem("weilin_function_toggles_translateTag")!=="false"),Q=S(localStorage.getItem("weilin_function_toggles_clearDisabled")!=="false"),X=S(""),ye=S(""),pe=S(""),Z=S(0),oe=S([]),be=S(!1),ve=S({api_key:"",base_url:"https://api.openai.com/v1",model:""}),he=S(!1),te=S(-1),K=S("");S(!1),S(!1);const ee=S(""),F=S(""),J=S(25),Y=S(localStorage.getItem("weilin_prompt_ui_auto_box_width")||450),L=S(localStorage.getItem("weilin_prompt_ui_auto_box_height")||350),C=dt=>{s.value=dt,dt==="setting_auto_complete_limit"&&hn()},G=()=>{localStorage.setItem("weilin_prompt_ui_sourceLanguage",m.value),localStorage.setItem("weilin_prompt_ui_targetLanguage",f.value),window.parent.postMessage({type:"weilin_prompt_ui_translate_setting"},"*"),ue({type:"success",str:"message.saveSuccess"})},de=()=>{localStorage.setItem("weilin_function_toggles_clearAll",fe.value),localStorage.setItem("weilin_function_toggles_deleteButton",_e.value),localStorage.setItem("weilin_function_toggles_randomTag",ae.value),localStorage.setItem("weilin_function_toggles_randomTagSettings",W.value),localStorage.setItem("weilin_function_toggles_translateTag",re.value),localStorage.setItem("weilin_function_toggles_clearDisabled",Q.value),o("functionTogglesUpdated",{clearAll:fe.value,deleteButton:_e.value,randomTag:ae.value,randomTagSettings:W.value,translateTag:re.value,clearDisabled:Q.value}),ue({type:"success",str:"message.saveSuccess"})},Se=dt=>{const Ne=dt.target.files[0];if(Ne){const Ue=new FileReader;Ue.onload=Ot=>{O.value=Ot.target.result,localStorage.setItem("weilin_prompt_ui_customSkinUrl",Ot.target.result)},Ue.readAsDataURL(Ne)}},Le=()=>{V.value="#6a11cb",me.value="#2575fc"},N=()=>{if(g.value<1||x.value<5||b.value<5){ue({type:"warn",str:"message.error"});return}localStorage.setItem("weilin_prompt_ui_floatingBallEnabled",k.value),localStorage.setItem("weilin_prompt_ui_floatingBallCount",g.value),localStorage.setItem("weilin_prompt_ui_floatingBallSize",x.value),localStorage.setItem("weilin_prompt_ui_floatingBallHeightSize",b.value),localStorage.setItem("weilin_prompt_ui_ballSkinType",$.value),localStorage.setItem("weilin_prompt_ui_bgType",I.value),localStorage.setItem("weilin_prompt_ui_gradientColor1",V.value),localStorage.setItem("weilin_prompt_ui_gradientColor2",me.value),localStorage.setItem("weilin_prompt_ui_ballBorderRadius",M.value),localStorage.setItem("weilin_prompt_ui_floatingBallHeightSize",b.value),window.parent.postMessage({type:"weilin_prompt_ui_floating_ball_setting"},"*"),ue({type:"success",str:"message.saveSuccess"})},T=()=>{localStorage.setItem("weilin_prompt_ui_comma_conversion",z.value),localStorage.setItem("weilin_prompt_ui_period_conversion",ce.value),localStorage.setItem("weilin_prompt_ui_bracket_conversion",P.value),localStorage.setItem("weilin_prompt_ui_angle_bracket_conversion",le.value),localStorage.setItem("weilin_prompt_ui_underscore_to_bracket",ie.value),localStorage.setItem("weilin_prompt_ui_comma_close_autocomplete",Oe.value),localStorage.setItem("weilin_prompt_ui_bracket_escape",Ae.value),ue({type:"success",str:"message.saveSuccess"})},j=()=>{rl.getUserSetting().then(dt=>{oe.value=dt.data.openai_settings,Z.value=dt.data.select_openai})},ne=()=>{ve.value={api_key:"",base_url:"https://api.openai.com/v1",model:""},he.value=!1,be.value=!0},Pe=dt=>{Bi.deleteOpenAiSetting({index:dt}).then(()=>{j(),ue({type:"success",str:"message.deleteSuccess"})}).catch(()=>{ue({type:"warn",str:"message.networkError"})})},De=dt=>{te.value===dt?te.value=-1:(ve.value={...oe.value[dt]},te.value=dt)},se=dt=>{Bi.updateOpenAiSetting({index:dt,...ve.value}).then(()=>{j(),te.value=-1,ue({type:"success",str:"message.saveSuccess"})}).catch(()=>{ue({type:"warn",str:"message.networkError"})})},Te=()=>{Bi.addOpenAiSetting({...ve.value}).then(()=>{j(),be.value=!1,te.value=-1,ue({type:"success",str:"message.saveSuccess"})}).catch(()=>{ue({type:"warn",str:"message.networkError"})})},qe=()=>{be.value=!1,te.value=-1},et=()=>{Bi.setOpenAiSelect({index:Z.value}).then(()=>{ue({type:"success",str:"message.saveSuccess"})}).catch(()=>{ue({type:"warn",str:"message.networkError"})})},ot=()=>{window.open("https://afdian.com/a/weilin9999","_blank")},ft=()=>{rl.startPanel().then(()=>{ue({type:"success",str:"message.startPanelSuccess"})}).catch(()=>{ue({type:"warn",str:"message.startPanelFailed"})})},bt=()=>{eo.getTranslateSetting().then(dt=>{localStorage.setItem("weilin_prompt_ui_translater_setting",dt.data),K.value=dt.data}).catch(()=>{ue({type:"warn",str:"message.getTranslaterFail"})})},Mt=()=>{eo.applyTranslateSetting(K.value).then(dt=>{dt.info==="ok"?(localStorage.setItem("weilin_prompt_ui_translater_setting",K.value),ue({type:"success",str:"message.applyTranslaterSuccess"})):ue({type:"warn",str:"message.applyToTranslaterFail"})}).catch(()=>{ue({type:"warn",str:"message.applyTranslaterFail"})})},Vt=()=>{eo.getTranslateBuktSetting().then(dt=>{X.value=dt.data.translate_service,ye.value=dt.data.translate_source_lang,pe.value=dt.data.translate_target_lang}).catch(()=>{ue({type:"warn",str:"message.getTranslaterFail"})})},An=()=>{eo.saveTranslateSetting(X.value,ye.value,pe.value).then(dt=>{dt.info==="ok"?ue({type:"success",str:"message.saveSuccess"}):ue({type:"warn",str:"message.saveFailed"})}).catch(()=>{ue({type:"warn",str:"message.saveFailed"})})},ao=()=>{eo.translaterInputText("",ee.value).then(dt=>{F.value=dt.data}).catch(()=>{ue({type:"warn",str:"message.translaterTestFail"})})},an=S(null),hn=async()=>{await pc.getAutocompleteLimit().then(dt=>{J.value=dt.data}).catch(dt=>{console.error(dt),ue({type:"warn",str:"message.networkError"})})},Jn=async()=>{await pc.updateAutocompleteLimit(J.value).then(()=>{ue({type:"success",str:"message.saveSuccess"}),localStorage.setItem("weilin_prompt_ui_auto_box_width",Y.value),localStorage.setItem("weilin_prompt_ui_auto_box_height",L.value)}).catch(dt=>{console.error(dt),ue({type:"warn",str:"message.networkError"})})},wo=dt=>{const Ne=Ui.find(Ue=>Ue.translator===dt);return Ne?Ne.language:dt};return Ut(()=>{Vt(),bt(),j()}),so(()=>{an.value&&clearInterval(an.value)}),t({open:()=>{s.value="translator",u.value="baidu",p.value="",m.value=localStorage.getItem("weilin_prompt_ui_sourceLanguage")||"english",f.value=localStorage.getItem("weilin_prompt_ui_targetLanguage")||"chinese_simplified",g.value=localStorage.getItem("weilin_prompt_ui_floatingBallCount")||1,x.value=localStorage.getItem("weilin_prompt_ui_floatingBallSize")||5,k.value=localStorage.getItem("weilin_prompt_ui_floatingBallEnabled")==="true",z.value=localStorage.getItem("weilin_prompt_ui_comma_conversion")==="true",ce.value=localStorage.getItem("weilin_prompt_ui_period_conversion")==="true",P.value=localStorage.getItem("weilin_prompt_ui_bracket_conversion")==="true",le.value=localStorage.getItem("weilin_prompt_ui_angle_bracket_conversion")==="true",ie.value=localStorage.getItem("weilin_prompt_ui_underscore_to_bracket")==="true",Oe.value=localStorage.getItem("weilin_prompt_ui_comma_close_autocomplete")==="true",r.value=!0}}),(dt,Ne)=>(E(),Jt(Nr,{modelValue:r.value,"onUpdate:modelValue":Ne[48]||(Ne[48]=Ue=>r.value=Ue),title:v(a)("promptBox.settings.title")},{footer:Pt(()=>[i("button",{onClick:Ne[47]||(Ne[47]=Ue=>r.value=!1)},y(v(a)("promptBox.settings.close")),1)]),default:Pt(()=>[i("div",zb,[i("div",Vb,[i("ul",null,[i("li",{class:We({"weilin-comfyui-active":s.value==="translator"}),onClick:Ne[0]||(Ne[0]=Ue=>C("translator"))},y(v(a)("promptBox.settings.translator")),3),i("li",{class:We({"weilin-comfyui-active":s.value==="setting_function_toggles"}),onClick:Ne[1]||(Ne[1]=Ue=>C("setting_function_toggles"))},y(v(a)("promptBox.settings.setting_function_toggles")),3),i("li",{class:We({"weilin-comfyui-active":s.value==="setting_auto_complete_limit"}),onClick:Ne[2]||(Ne[2]=Ue=>C("setting_auto_complete_limit"))},y(v(a)("promptBox.settings.setting_auto_complete_limit")),3),i("li",{class:We({"weilin-comfyui-active":s.value==="setting_floating_ball"}),onClick:Ne[3]||(Ne[3]=Ue=>C("setting_floating_ball"))},y(v(a)("promptBox.settings.setting_floating_ball")),3),i("li",{class:We({"weilin-comfyui-active":s.value==="setting_prompt_box"}),onClick:Ne[4]||(Ne[4]=Ue=>C("setting_prompt_box"))},y(v(a)("promptBox.settings.setting_prompt_box")),3),i("li",{class:We({"weilin-comfyui-active":s.value==="setting_openai_box"}),onClick:Ne[5]||(Ne[5]=Ue=>C("setting_openai_box"))},y(v(a)("promptBox.settings.setting_openai_box")),3),i("li",{class:We({"weilin-comfyui-active":s.value==="setting_sponsor_me"}),onClick:Ne[6]||(Ne[6]=Ue=>C("setting_sponsor_me"))},y(v(a)("promptBox.settings.setting_sponsor_me")),3)])]),i("div",Wb,[s.value==="translator"?(E(),D("div",jb,[i("h3",null,y(v(a)("promptBox.settings.translator")),1),i("div",Hb,[i("label",null,y(v(a)("promptBox.settings.selectTranslater")),1),$e(i("select",{style:{"margin-left":"10px"},"onUpdate:modelValue":Ne[7]||(Ne[7]=Ue=>K.value=Ue),class:"weilin-comfyui-common-select"},[i("option",Gb,y(v(a)("promptBox.settings.selectOptionPythonTranslater")),1),Ne[49]||(Ne[49]=i("option",{value:"other_ai_plate"},"使用三方AI平台翻译",-1)),Ne[50]||(Ne[50]=i("option",{value:"openai"},"OpenAI API 翻译",-1))],512),[[Tn,K.value]]),i("button",{class:"weilin-comfyui-install-button",onClick:Mt},y(v(a)("promptBox.settings.apply")),1)]),i("div",qb,[K.value=="other_ai_plate"?(E(),D("div",Yb,[it(Ub)])):Ce("",!0),K.value=="network"?(E(),D("div",Kb,[i("div",Jb,y(v(a)("promptBox.settings.selectOptionNetworkTranslaterTitle")),1),i("div",Xb,y(v(a)("promptBox.settings.selectOptionNetworkTranslaterInfo"))+":https://github.com/xnx3/translate ",1),i("div",Qb,[i("label",null,y(v(a)("promptBox.settings.sourceLanguage")),1),$e(i("select",{"onUpdate:modelValue":Ne[8]||(Ne[8]=Ue=>m.value=Ue),class:"weilin-comfyui-common-select"},[i("option",Zb,y(v(a)("promptBox.settings.auto_detect")),1),i("option",e4,y(v(a)("promptBox.settings.chinese_simplified")),1),i("option",t4,y(v(a)("promptBox.settings.english")),1)],512),[[Tn,m.value]])]),i("div",n4,[i("label",null,y(v(a)("promptBox.settings.targetLanguage")),1),$e(i("select",{"onUpdate:modelValue":Ne[9]||(Ne[9]=Ue=>f.value=Ue),class:"weilin-comfyui-common-select"},[i("option",o4,y(v(a)("promptBox.settings.chinese_simplified")),1),i("option",a4,y(v(a)("promptBox.settings.english")),1)],512),[[Tn,f.value]])]),i("button",{class:"weilin-comfyui-save-button",onClick:G},y(v(a)("promptBox.settings.save")),1)])):Ce("",!0),K.value=="translater"?(E(),D("div",r4,[i("div",i4,y(v(a)("promptBox.settings.selectOptionPythonTranslaterTitle")),1),i("div",s4,[i("div",l4,y(v(a)("promptBox.settings.translaterSetting")),1),i("div",u4,[i("label",null,y(v(a)("promptBox.settings.chooseTranslaterSetting")),1),$e(i("select",{"onUpdate:modelValue":Ne[10]||(Ne[10]=Ue=>X.value=Ue)},[(E(!0),D(Ke,null,lt(v(yb),(Ue,Ot)=>(E(),D("option",{index:Ot,key:"tran-item_"+Ot,value:Ue},y(v(a)("translaterService."+Ue)),9,c4))),128))],512),[[Tn,X.value]])]),i("div",d4,[i("div",p4,[i("label",null,y(v(a)("promptBox.settings.translaterLangSourceSetting")),1),$e(i("select",{"onUpdate:modelValue":Ne[11]||(Ne[11]=Ue=>ye.value=Ue)},[(E(!0),D(Ke,null,lt(v(Ui),(Ue,Ot)=>(E(),D("option",{index:Ot,key:"lan-item_"+Ot,value:Ue.translator},y(v(a)("translaterLanguage."+Ue.language)),9,f4))),128))],512),[[Tn,ye.value]])]),i("div",g4,[i("label",null,y(v(a)("promptBox.settings.translaterLangTargeSetting")),1),$e(i("select",{"onUpdate:modelValue":Ne[12]||(Ne[12]=Ue=>pe.value=Ue)},[(E(!0),D(Ke,null,lt(v(Ui),(Ue,Ot)=>(E(),D("option",{index:Ot,key:"lan-mu-item_"+Ot,value:Ue.translator},y(v(a)("translaterLanguage."+Ue.language)),9,m4))),128))],512),[[Tn,pe.value]])])]),i("button",{class:"weilin-comfyui-install-button",onClick:An},y(v(a)("promptBox.settings.saveTranslaterSetting")),1)]),i("div",h4,[i("div",v4,y(v(a)("promptBox.settings.testTranslaterTitle")),1),i("div",_4,[i("label",null,y(v(a)("promptBox.settings.inputTestTranslater"))+" - "+y(v(a)("translaterLanguage."+wo(pe.value))),1),$e(i("input",{type:"text","onUpdate:modelValue":Ne[13]||(Ne[13]=Ue=>ee.value=Ue),placeholder:v(a)("promptBox.settings.inputTestTranslaterPlaceholder")},null,8,y4),[[ze,ee.value]])]),i("div",b4,[i("label",null,y(v(a)("promptBox.settings.outPutTestTranslater"))+" - "+y(v(a)("translaterLanguage."+wo(ye.value))),1),$e(i("input",{type:"text","onUpdate:modelValue":Ne[14]||(Ne[14]=Ue=>F.value=Ue),readonly:"",placeholder:v(a)("promptBox.settings.outPutTestTranslaterPlaceholder")},null,8,w4),[[ze,F.value]])]),i("button",{class:"weilin-comfyui-install-button",onClick:ao},y(v(a)("promptBox.settings.testingTranslater")),1)])])):Ce("",!0)])])):Ce("",!0),s.value==="setting_auto_complete_limit"?(E(),D("div",x4,[i("h3",null,y(v(a)("promptBox.settings.setting_auto_complete_limit")),1),i("div",S4,[i("div",T4,[i("label",null,y(v(a)("promptBox.settings.show_auto_limit")),1),$e(i("input",{type:"number","onUpdate:modelValue":Ne[15]||(Ne[15]=Ue=>J.value=Ue),min:"1",max:"99999999",style:{width:"100px"},placeholder:v(a)("promptBox.settings.showAutoLimitPlaceholder")},null,8,k4),[[ze,J.value,void 0,{number:!0}]])]),i("div",C4,[i("label",null,y(v(a)("promptBox.settings.settingAutoCompleteWidth")),1),$e(i("input",{type:"number","onUpdate:modelValue":Ne[16]||(Ne[16]=Ue=>Y.value=Ue),min:"5",style:{width:"100px"},placeholder:v(a)("promptBox.settings.settingAutoCompleteWidthPlaceholder")},null,8,E4),[[ze,Y.value,void 0,{number:!0}]])]),i("div",$4,[i("label",null,y(v(a)("promptBox.settings.settingAutoCompleteHeight")),1),$e(i("input",{type:"number","onUpdate:modelValue":Ne[17]||(Ne[17]=Ue=>L.value=Ue),min:"5",style:{width:"100px"},placeholder:v(a)("promptBox.settings.settingAutoCompleteHeightPlaceholder")},null,8,L4),[[ze,L.value,void 0,{number:!0}]])]),i("button",{class:"weilin-comfyui-save-button",onClick:Jn},y(v(a)("promptBox.settings.save")),1)])])):Ce("",!0),s.value==="setting_function_toggles"?(E(),D("div",A4,[i("h3",null,y(v(a)("promptBox.settings.setting_function_toggles_full")),1),i("div",M4,[i("div",I4,[i("label",null,[$e(i("input",{type:"checkbox","onUpdate:modelValue":Ne[18]||(Ne[18]=Ue=>fe.value=Ue)},null,512),[[nn,fe.value]]),ut(" "+y(v(a)("promptBox.settings.enableClearAll")),1)])]),i("div",D4,[i("label",null,[$e(i("input",{type:"checkbox","onUpdate:modelValue":Ne[19]||(Ne[19]=Ue=>_e.value=Ue)},null,512),[[nn,_e.value]]),ut(" "+y(v(a)("promptBox.settings.enableDeleteButton")),1)])]),i("div",O4,[i("label",null,[$e(i("input",{type:"checkbox","onUpdate:modelValue":Ne[20]||(Ne[20]=Ue=>ae.value=Ue)},null,512),[[nn,ae.value]]),ut(" "+y(v(a)("promptBox.settings.enableRandomTag")),1)])]),i("div",R4,[i("label",null,[$e(i("input",{type:"checkbox","onUpdate:modelValue":Ne[21]||(Ne[21]=Ue=>W.value=Ue)},null,512),[[nn,W.value]]),ut(" "+y(v(a)("promptBox.settings.enableRandomTagSettings")),1)])]),i("div",P4,[i("label",null,[$e(i("input",{type:"checkbox","onUpdate:modelValue":Ne[22]||(Ne[22]=Ue=>re.value=Ue)},null,512),[[nn,re.value]]),ut(" "+y(v(a)("promptBox.settings.enableTranslateTag")),1)])]),i("div",N4,[i("label",null,[$e(i("input",{type:"checkbox","onUpdate:modelValue":Ne[23]||(Ne[23]=Ue=>Q.value=Ue)},null,512),[[nn,Q.value]]),ut(" "+y(v(a)("promptBox.settings.enableClearDisabled")),1)])]),i("button",{class:"weilin-comfyui-save-button",onClick:de},y(v(a)("promptBox.settings.save")),1)])])):Ce("",!0),s.value==="setting_floating_ball"?(E(),D("div",F4,[i("h3",null,y(v(a)("promptBox.settings.setting_floating_ball")),1),i("div",B4,[i("div",U4,[i("div",z4,[i("label",null,[$e(i("input",{type:"checkbox","onUpdate:modelValue":Ne[24]||(Ne[24]=Ue=>k.value=Ue)},null,512),[[nn,k.value]]),ut(" "+y(v(a)("promptBox.settings.enableFloatingBall")),1)])]),i("div",V4,[i("label",null,y(v(a)("promptBox.settings.floatingBallCount")),1),$e(i("input",{type:"number","onUpdate:modelValue":Ne[25]||(Ne[25]=Ue=>g.value=Ue),min:"1",max:"100",placeholder:v(a)("promptBox.settings.floatingBallCountPlaceholder")},null,8,W4),[[ze,g.value,void 0,{number:!0}]])]),i("div",j4,[i("label",null,y(v(a)("promptBox.settings.floatingBallSize")),1),$e(i("input",{type:"number","onUpdate:modelValue":Ne[26]||(Ne[26]=Ue=>x.value=Ue),min:"5",max:"999999",placeholder:v(a)("promptBox.settings.floatingBallSizePlaceholder")},null,8,H4),[[ze,x.value,void 0,{number:!0}]])]),i("div",G4,[i("label",null,y(v(a)("promptBox.settings.floatingBallHeight")),1),$e(i("input",{type:"number","onUpdate:modelValue":Ne[27]||(Ne[27]=Ue=>b.value=Ue),min:"5",max:"999999",placeholder:v(a)("promptBox.settings.floatingBallHeightPlaceholder")},null,8,q4),[[ze,b.value,void 0,{number:!0}]])])]),i("div",Y4,[i("div",K4,[i("label",null,y(v(a)("promptBox.settings.skinSetting")),1),$e(i("select",{"onUpdate:modelValue":Ne[28]||(Ne[28]=Ue=>$.value=Ue)},[i("option",J4,y(v(a)("promptBox.settings.defaultSkin")),1),i("option",X4,y(v(a)("promptBox.settings.customSkin")),1)],512),[[Tn,$.value]])]),$.value==="custom"?(E(),D("div",Q4,[i("label",null,y(v(a)("promptBox.settings.uploadSkin")),1),i("input",{type:"file",accept:"image/*",onChange:Se,ref:"skinUploader"},null,544),O.value?(E(),D("div",Z4,[i("img",{src:O.value,alt:"Custom Skin Preview"},null,8,ew)])):Ce("",!0)])):Ce("",!0)]),i("div",tw,[i("label",null,y(v(a)("promptBox.settings.bgSetting")),1),$e(i("select",{"onUpdate:modelValue":Ne[29]||(Ne[29]=Ue=>I.value=Ue)},[i("option",nw,y(v(a)("promptBox.settings.gradientBg")),1),i("option",ow,y(v(a)("promptBox.settings.transparentBg")),1)],512),[[Tn,I.value]])]),I.value==="gradient"?(E(),D("div",aw,[i("label",null,y(v(a)("promptBox.settings.gradientColor")),1),i("div",rw,[$e(i("input",{type:"color","onUpdate:modelValue":Ne[30]||(Ne[30]=Ue=>V.value=Ue)},null,512),[[ze,V.value]]),$e(i("input",{type:"color","onUpdate:modelValue":Ne[31]||(Ne[31]=Ue=>me.value=Ue)},null,512),[[ze,me.value]]),i("button",{onClick:Le,style:{"margin-left":"10px",width:"200px"}},y(v(a)("promptBox.settings.resetToDefault")),1)])])):Ce("",!0),i("div",iw,[i("label",null,y(v(a)("promptBox.settings.borderRadius")),1),$e(i("input",{type:"number","onUpdate:modelValue":Ne[32]||(Ne[32]=Ue=>M.value=Ue),min:"0",max:"50"},null,512),[[ze,M.value,void 0,{number:!0}]])]),i("button",{class:"weilin-comfyui-save-button",style:{"grid-column":"span 2"},onClick:N},y(v(a)("promptBox.settings.save")),1)])])):Ce("",!0),s.value==="setting_prompt_box"?(E(),D("div",sw,[i("h3",null,y(v(a)("promptBox.settings.setting_prompt_box")),1),i("div",lw,[i("div",uw,[i("label",null,[$e(i("input",{type:"checkbox","onUpdate:modelValue":Ne[33]||(Ne[33]=Ue=>z.value=Ue)},null,512),[[nn,z.value]]),ut(" "+y(v(a)("promptBox.settings.enableCommaConversion")),1)])]),i("div",cw,[i("label",null,[$e(i("input",{type:"checkbox","onUpdate:modelValue":Ne[34]||(Ne[34]=Ue=>ce.value=Ue)},null,512),[[nn,ce.value]]),ut(" "+y(v(a)("promptBox.settings.enablePeriodConversion")),1)])]),i("div",dw,[i("label",null,[$e(i("input",{type:"checkbox","onUpdate:modelValue":Ne[35]||(Ne[35]=Ue=>P.value=Ue)},null,512),[[nn,P.value]]),ut(" "+y(v(a)("promptBox.settings.enableBracketConversion")),1)])]),i("div",pw,[i("label",null,[$e(i("input",{type:"checkbox","onUpdate:modelValue":Ne[36]||(Ne[36]=Ue=>le.value=Ue)},null,512),[[nn,le.value]]),ut(" "+y(v(a)("promptBox.settings.enableAngleBracketConversion")),1)])]),i("div",fw,[i("label",null,[$e(i("input",{type:"checkbox","onUpdate:modelValue":Ne[37]||(Ne[37]=Ue=>ie.value=Ue)},null,512),[[nn,ie.value]]),ut(" "+y(v(a)("promptBox.settings.enableUnderscoreToBracket")),1)])]),i("div",gw,[i("label",null,[$e(i("input",{type:"checkbox","onUpdate:modelValue":Ne[38]||(Ne[38]=Ue=>Oe.value=Ue)},null,512),[[nn,Oe.value]]),ut(" "+y(v(a)("promptBox.settings.enableCommaCloseAutocomplete")),1)])]),i("div",mw,[i("label",null,[$e(i("input",{type:"checkbox","onUpdate:modelValue":Ne[39]||(Ne[39]=Ue=>Ae.value=Ue)},null,512),[[nn,Ae.value]]),ut(" "+y(v(a)("promptBox.settings.enableBracketEscape")),1)])]),i("button",{class:"weilin-comfyui-save-button",onClick:T},y(v(a)("promptBox.settings.save")),1)])])):Ce("",!0),s.value==="setting_openai_box"?(E(),D("div",hw,[i("h3",null,y(v(a)("promptBox.settings.openaiSettings")),1),i("div",vw,[i("div",_w,[i("label",null,y(v(a)("promptBox.settings.selectedOpenaiConfig")),1),$e(i("select",{"onUpdate:modelValue":Ne[40]||(Ne[40]=Ue=>Z.value=Ue),onChange:et},[(E(!0),D(Ke,null,lt(oe.value,(Ue,Ot)=>(E(),D("option",{key:Ot,value:Ot},y(Ue.model)+" ("+y(Ue.base_url)+") ",9,yw))),128))],544),[[Tn,Z.value]])]),i("div",bw,[(E(!0),D(Ke,null,lt(oe.value,(Ue,Ot)=>(E(),D("div",{key:Ot,class:"weilin-comfyui-config-item"},[i("div",ww,[i("span",null,y(Ue.model),1),i("div",xw,[i("button",{onClick:En=>De(Ot)},y(te.value===Ot?v(a)("promptBox.settings.cancel"):v(a)("promptBox.settings.edit")),9,Sw),i("button",{onClick:En=>Pe(Ot)},y(v(a)("promptBox.settings.delete")),9,Tw)])]),te.value===Ot?(E(),D("div",kw,[i("div",Cw,[i("label",null,y(v(a)("promptBox.settings.openai_api_key"))+":",1),$e(i("input",{type:"text","onUpdate:modelValue":Ne[41]||(Ne[41]=En=>ve.value.api_key=En),placeholder:v(a)("promptBox.settings.openai_api_key_placeholder")},null,8,Ew),[[ze,ve.value.api_key]])]),i("div",$w,[i("label",null,y(v(a)("promptBox.settings.openai_base_url"))+":",1),$e(i("input",{type:"text","onUpdate:modelValue":Ne[42]||(Ne[42]=En=>ve.value.base_url=En),placeholder:v(a)("promptBox.settings.openai_base_url_placeholder")},null,8,Lw),[[ze,ve.value.base_url]])]),i("div",Aw,[i("label",null,y(v(a)("promptBox.settings.openai_model"))+":",1),$e(i("input",{type:"text","onUpdate:modelValue":Ne[43]||(Ne[43]=En=>ve.value.model=En),placeholder:v(a)("promptBox.settings.openai_model_placeholder")},null,8,Mw),[[ze,ve.value.model]])]),i("div",Iw,[i("button",{onClick:En=>se(Ot)},y(v(a)("promptBox.settings.save")),9,Dw)])])):(E(),D("div",Ow,[i("div",null,y(v(a)("promptBox.settings.openai_api_key"))+": "+y(Ue.api_key?"******":v(a)("promptBox.settings.not_set")),1),i("div",null,y(v(a)("promptBox.settings.openai_base_url"))+": "+y(Ue.base_url),1)]))]))),128))]),be.value?(E(),D("div",Rw,[i("div",Pw,[i("label",null,y(v(a)("promptBox.settings.openai_api_key"))+":",1),$e(i("input",{type:"text","onUpdate:modelValue":Ne[44]||(Ne[44]=Ue=>ve.value.api_key=Ue),placeholder:v(a)("promptBox.settings.openai_api_key_placeholder")},null,8,Nw),[[ze,ve.value.api_key]])]),i("div",Fw,[i("label",null,y(v(a)("promptBox.settings.openai_base_url"))+":",1),$e(i("input",{type:"text","onUpdate:modelValue":Ne[45]||(Ne[45]=Ue=>ve.value.base_url=Ue),placeholder:v(a)("promptBox.settings.openai_base_url_placeholder")},null,8,Bw),[[ze,ve.value.base_url]])]),i("div",Uw,[i("label",null,y(v(a)("promptBox.settings.openai_model"))+":",1),$e(i("input",{type:"text","onUpdate:modelValue":Ne[46]||(Ne[46]=Ue=>ve.value.model=Ue),placeholder:v(a)("promptBox.settings.openai_model_placeholder")},null,8,zw),[[ze,ve.value.model]])]),i("div",Vw,[i("button",{onClick:qe},y(v(a)("promptBox.settings.cancel")),1),i("button",{onClick:Te},y(v(a)("promptBox.settings.save")),1)])])):Ce("",!0),be.value?Ce("",!0):(E(),D("button",{key:1,class:"weilin-comfyui-add-button",onClick:ne},y(v(a)("promptBox.settings.addNewConfig")),1))])])):Ce("",!0),s.value==="setting_sponsor_me"?(E(),D("div",Ww,[i("h3",null,y(v(a)("promptBox.settings.setting_sponsor_me")),1),i("div",jw,[i("h1",null,y(v(a)("promptBox.settings.sponsorMeTip")),1),i("h2",null,y(v(a)("promptBox.settings.sponsorMeLink")),1),i("button",{class:"weilin-comfyui-sponsor-me-button",onClick:ot},y(v(a)("promptBox.settings.sponsorMe")),1)])])):Ce("",!0),s.value==="setting_start_panel"?(E(),D("div",Hw,[i("h3",null,y(v(a)("promptBox.settings.setting_start_panel")),1),i("div",Gw,[i("h4",null,y(v(a)("promptBox.settings.startPanelTip")),1),i("button",{class:"weilin-comfyui-start-panel-button",onClick:ft},y(v(a)("promptBox.settings.startPanel")),1)])])):Ce("",!0)])])]),_:1},8,["modelValue","title"]))}},[["__scopeId","data-v-067a4b09"]]),qw=["title"],Yw={class:"switch-icon"},Kw={key:0,class:"moon",viewBox:"0 0 24 24"},Jw={key:1,class:"sun",viewBox:"0 0 24 24"},Xw="weilin_tools_",Qw=qt({__name:"ThemeSwitch",setup(e){const{t}=Gt(),n=`${Xw}theme`,o=S(localStorage.getItem(n)==="dark"),a=()=>{o.value=!o.value;const r=document.getElementById("weilin_comfyui_tools_prompt_ui_div");r&&r.setAttribute("data-theme",o.value?"dark":"light"),localStorage.setItem(n,o.value?"dark":"light")};return(r,s)=>(E(),D("button",{class:"theme-switch",onClick:a,title:v(t)("theme.toggle")},[i("div",Yw,[o.value?(E(),D("svg",Kw,s[0]||(s[0]=[i("path",{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"},null,-1)]))):(E(),D("svg",Jw,s[1]||(s[1]=[i("circle",{cx:"12",cy:"12",r:"5"},null,-1),i("path",{d:"M12 1v2M12 21v2M4.22 4.22l1.42 1.42M18.36 18.36l1.42 1.42M1 12h2M21 12h2M4.22 19.78l1.42-1.42M18.36 5.64l1.42-1.42"},null,-1)])))]),mi(r.$slots,"default",{isDark:o.value},void 0,!0)],8,qw))}},[["__scopeId","data-v-687d9c9d"]]),to="weilin_tools_",ua={categories:null,subCategories:{},tags:{},lastUpdated:0},Zw=5*60*1e3,no=()=>{ua.categories=null,ua.subCategories={},ua.tags={},ua.lastUpdated=0},un={getTagsList:async e=>{const t=localStorage.getItem(`${to}userLocale`)||"zh_CN",n=Date.now();if(ua.categories&&n-ua.lastUpdated<Zw)return ua.categories;const o=await Ye({url:"/prompt/get_group_tags",method:"get",params:{...e,lang:t}});return ua.categories=o,ua.lastUpdated=n,o},addPrimaryCategory:async e=>{const t=localStorage.getItem(`${to}userLocale`)||"zh_CN",n=await Ye({url:"/prompt/add_new_f_group",method:"post",data:{...e,lang:t}});return no(),n},editPrimaryCategory:async e=>{const t=localStorage.getItem(`${to}userLocale`)||"zh_CN",n=await Ye({url:"/prompt/edit_f_group",method:"post",data:{...e,lang:t}});return no(),n},deletePrimaryCategory:async e=>{const t=localStorage.getItem(`${to}userLocale`)||"zh_CN",n=await Ye({url:"/prompt/delete_f_group",method:"post",data:{...e,lang:t}});return no(),n},addSubCategory:async e=>{const t=localStorage.getItem(`${to}userLocale`)||"zh_CN",n=await Ye({url:"/prompt/add_new_s_group",method:"post",data:{...e,lang:t}});return no(),n},editSubCategory:async e=>{const t=localStorage.getItem(`${to}userLocale`)||"zh_CN",n=await Ye({url:"/prompt/edit_s_group",method:"post",data:{...e,lang:t}});return no(),n},deleteSubCategory:async e=>{const t=localStorage.getItem(`${to}userLocale`)||"zh_CN",n=await Ye({url:"/prompt/delete_s_group",method:"post",data:{...e,lang:t}});return no(),n},addNewTags:async e=>{const t=localStorage.getItem(`${to}userLocale`)||"zh_CN",n=await Ye({url:"/prompt/new_tags",method:"post",data:{...e,lang:t}});return no(),n},editTags:async e=>{const t=localStorage.getItem(`${to}userLocale`)||"zh_CN",n=await Ye({url:"/prompt/edit_tags",method:"post",data:{...e,lang:t}});return no(),n},deleteTags:async e=>{const t=localStorage.getItem(`${to}userLocale`)||"zh_CN",n=await Ye({url:"/prompt/delete_tags",method:"post",data:{...e,lang:t}});return no(),n},batchDeleteTags:async e=>{const t=localStorage.getItem(`${to}userLocale`)||"zh_CN",n=await Ye({url:"/prompt/batch_delete_tags",method:"post",data:{...e,lang:t}});return no(),n},moveTag:async e=>{const t=localStorage.getItem(`${to}userLocale`)||"zh_CN",n=await Ye({url:"/prompt/move_tag",method:"post",data:{...e,lang:t}});return no(),n},getTagsGroupList:()=>Ye({url:"/prompt/get_groups_list",method:"post"}),runSQLToServer:async e=>{const t=await Ye({url:"/prompt/run_sql_text",method:"post",timeout:0,data:{sql:e}});return no(),t},moveMainGroup:async e=>{const t=localStorage.getItem(`${to}userLocale`)||"zh_CN",n=await Ye({url:"/prompt/move_group",method:"post",data:{...e,lang:t}});return no(),n},moveSubGroup:async e=>{const t=localStorage.getItem(`${to}userLocale`)||"zh_CN",n=await Ye({url:"/prompt/move_subgroup",method:"post",data:{...e,lang:t}});return no(),n},getTagMainGroup:()=>Ye({url:"/prompt/get_tag_groups",method:"post"}),getTagSubGroup:e=>Ye({url:"/prompt/get_tag_subgroups",method:"post",data:{p_uuid:e}}),getTagList:e=>Ye({url:"/prompt/get_tag_tags",method:"post",data:{g_uuid:e}}),searchTag:e=>Ye({url:"/prompt/search_tags",method:"post",data:{keyword:e}})};/**
|
||
* uuidv7: A JavaScript implementation of UUID version 7
|
||
*
|
||
* Copyright 2021-2024 LiosK
|
||
*
|
||
* @license Apache-2.0
|
||
* @packageDocumentation
|
||
*/const il="0123456789abcdef";class sr{constructor(t){this.bytes=t}static ofInner(t){if(t.length!==16)throw new TypeError("not 128-bit length");return new sr(t)}static fromFieldsV7(t,n,o,a){if(!Number.isInteger(t)||!Number.isInteger(n)||!Number.isInteger(o)||!Number.isInteger(a)||t<0||n<0||o<0||a<0||t>0xffffffffffff||n>4095||o>1073741823||a>4294967295)throw new RangeError("invalid field value");const r=new Uint8Array(16);return r[0]=t/2**40,r[1]=t/2**32,r[2]=t/2**24,r[3]=t/2**16,r[4]=t/2**8,r[5]=t,r[6]=112|n>>>8,r[7]=n,r[8]=128|o>>>24,r[9]=o>>>16,r[10]=o>>>8,r[11]=o,r[12]=a>>>24,r[13]=a>>>16,r[14]=a>>>8,r[15]=a,new sr(r)}static parse(t){var n,o,a,r;let s;switch(t.length){case 32:s=(n=/^[0-9a-f]{32}$/i.exec(t))===null||n===void 0?void 0:n[0];break;case 36:s=(o=/^([0-9a-f]{8})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{12})$/i.exec(t))===null||o===void 0?void 0:o.slice(1,6).join("");break;case 38:s=(a=/^\{([0-9a-f]{8})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{12})\}$/i.exec(t))===null||a===void 0?void 0:a.slice(1,6).join("");break;case 45:s=(r=/^urn:uuid:([0-9a-f]{8})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{12})$/i.exec(t))===null||r===void 0?void 0:r.slice(1,6).join("");break}if(s){const u=new Uint8Array(16);for(let p=0;p<16;p+=4){const m=parseInt(s.substring(2*p,2*p+8),16);u[p+0]=m>>>24,u[p+1]=m>>>16,u[p+2]=m>>>8,u[p+3]=m}return new sr(u)}else throw new SyntaxError("could not parse UUID string")}toString(){let t="";for(let n=0;n<this.bytes.length;n++)t+=il.charAt(this.bytes[n]>>>4),t+=il.charAt(this.bytes[n]&15),(n===3||n===5||n===7||n===9)&&(t+="-");return t}toHex(){let t="";for(let n=0;n<this.bytes.length;n++)t+=il.charAt(this.bytes[n]>>>4),t+=il.charAt(this.bytes[n]&15);return t}toJSON(){return this.toString()}getVariant(){const t=this.bytes[8]>>>4;if(t<0)throw new Error("unreachable");if(t<=7)return this.bytes.every(n=>n===0)?"NIL":"VAR_0";if(t<=11)return"VAR_10";if(t<=13)return"VAR_110";if(t<=15)return this.bytes.every(n=>n===255)?"MAX":"VAR_RESERVED";throw new Error("unreachable")}getVersion(){return this.getVariant()==="VAR_10"?this.bytes[6]>>>4:void 0}clone(){return new sr(this.bytes.slice(0))}equals(t){return this.compareTo(t)===0}compareTo(t){for(let n=0;n<16;n++){const o=this.bytes[n]-t.bytes[n];if(o!==0)return Math.sign(o)}return 0}}class e3{constructor(t){this.timestamp=0,this.counter=0,this.random=t??t3()}generate(){return this.generateOrResetCore(Date.now(),1e4)}generateOrAbort(){return this.generateOrAbortCore(Date.now(),1e4)}generateOrResetCore(t,n){let o=this.generateOrAbortCore(t,n);return o===void 0&&(this.timestamp=0,o=this.generateOrAbortCore(t,n)),o}generateOrAbortCore(t,n){if(!Number.isInteger(t)||t<1||t>0xffffffffffff)throw new RangeError("`unixTsMs` must be a 48-bit positive integer");if(n<0||n>0xffffffffffff)throw new RangeError("`rollbackAllowance` out of reasonable range");if(t>this.timestamp)this.timestamp=t,this.resetCounter();else if(t+n>=this.timestamp)this.counter++,this.counter>4398046511103&&(this.timestamp++,this.resetCounter());else return;return sr.fromFieldsV7(this.timestamp,Math.trunc(this.counter/2**30),this.counter&2**30-1,this.random.nextUint32())}resetCounter(){this.counter=this.random.nextUint32()*1024+(this.random.nextUint32()&1023)}generateV4(){const t=new Uint8Array(Uint32Array.of(this.random.nextUint32(),this.random.nextUint32(),this.random.nextUint32(),this.random.nextUint32()).buffer);return t[6]=64|t[6]>>>4,t[8]=128|t[8]>>>2,sr.ofInner(t)}}const t3=()=>{if(typeof crypto<"u"&&typeof crypto.getRandomValues<"u")return new n3;if(typeof UUIDV7_DENY_WEAK_RNG<"u"&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");return{nextUint32:()=>Math.trunc(Math.random()*65536)*65536+Math.trunc(Math.random()*65536)}};class n3{constructor(){this.buffer=new Uint32Array(8),this.cursor=65535}nextUint32(){return this.cursor>=this.buffer.length&&(crypto.getRandomValues(this.buffer),this.cursor=0),this.buffer[this.cursor++]}}let nm;const Ra=()=>o3().toString(),o3=()=>(nm||(nm=new e3)).generate(),a3={class:"tag-manager"},r3={class:"category-tabs"},i3={class:"tabs-wrapper primary-tabs"},s3={class:"tabs-scroll"},l3=["onClick"],u3={class:"tab-text"},c3={key:0,class:"tabs-wrapper group-tabs"},d3={class:"tabs-scroll"},p3=["onClick"],f3={class:"tab-text"},om=qt({__name:"tag_group_select",emits:["sureSelect"],setup(e,{expose:t,emit:n}){const{t:o}=Gt(),a=n,r=S([]),s=S(null),u=S(null),p=S([]),m=S(!1),f=S(!1),g=()=>{window.postMessage({type:"weilin_prompt_ui_tag_manager_refresh_select"},"*")},x=async()=>{try{const V=await un.getTagsGroupList();if(r.value=V.info,u.value){const me=r.value.flatMap(M=>M.groups).find(M=>M.p_uuid===u.value.p_uuid);me?u.value=me:u.value=null}if(s.value){const me=r.value.find(M=>M.p_uuid===s.value.p_uuid);me?s.value=me:s.value=null}}catch(V){console.error("获取标签列表失败:",V)}},b=V=>{if(!V||V==="transparent")return"var(--primary-text)";let me,M,z,ce=1;if(V.startsWith("rgba")){const le=V.match(/rgba\((\d+),\s*(\d+),\s*(\d+),\s*([\d.]+)\)/);le&&([,me,M,z,ce]=le.map(Number))}else if(V.startsWith("rgb")){const le=V.match(/rgb\((\d+),\s*(\d+),\s*(\d+)\)/);le&&([,me,M,z]=le.map(Number))}return ce<.5?"var(--primary-text)":(me*299+M*587+z*114)/1e3>128?"#000000":"#ffffff"};Ut(()=>{window.addEventListener("message",O)}),Ta(()=>{window.removeEventListener("message",O)});const k=V=>{s.value=V,u.value=null,m.value=!1,p.value=[]},$=V=>{u.value=V,m.value=!1,p.value=[]},O=V=>{!V.data||!V.data.type||V.data.type.startsWith("weilin_prompt_ui_")&&V.data.type==="weilin_prompt_ui_tag_manager_refresh_select"&&x()},I=()=>{if(u.value===null||s.value===null){ue({type:"warn",str:"message.pleaseSelectGroup"});return}a("sureSelect",{group:s.value,sub:u.value}),f.value=!1};return t({open:()=>{g(),f.value=!0}}),(V,me)=>(E(),Jt(Nr,{modelValue:f.value,"onUpdate:modelValue":me[1]||(me[1]=M=>f.value=M),title:v(o)("importDialog.selectTitle")},{footer:Pt(()=>[i("button",{onClick:me[0]||(me[0]=M=>f.value=!1)},y(v(o)("promptBox.settings.close")),1),i("button",{onClick:I},y(v(o)("importDialog.sureSelect")),1)]),default:Pt(()=>[i("div",a3,[i("div",r3,[i("div",i3,[i("div",s3,[(E(!0),D(Ke,null,lt(r.value,(M,z)=>{var ce,P,le;return E(),D("div",{key:"Tabss-"+z,class:We(["tab-item",{active:((ce=s.value)==null?void 0:ce.name)===M.name}]),style:Bt({backgroundColor:((P=s.value)==null?void 0:P.name)===M.name?"var(--primary-color)":M.color,color:((le=s.value)==null?void 0:le.name)===M.name?"#ffffff":b(M.color)}),onClick:ie=>k(M)},[i("span",u3,y(M.name),1)],14,l3)}),128))])]),s.value?(E(),D("div",c3,[i("div",d3,[(E(!0),D(Ke,null,lt(s.value.groups,(M,z)=>{var ce,P,le;return E(),D("div",{key:"TabsSw-"+z,class:We(["tab-item",{active:((ce=u.value)==null?void 0:ce.name)===M.name}]),style:Bt({backgroundColor:((P=u.value)==null?void 0:P.name)===M.name?"var(--primary-color)":M.color,color:((le=u.value)==null?void 0:le.name)===M.name?"#ffffff":b(M.color)}),onClick:ie=>$(M)},[i("span",f3,y(M.name),1)],14,p3)}),128))])])):Ce("",!0)])])]),_:1},8,["modelValue","title"]))}},[["__scopeId","data-v-d1f6a811"]]);/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */function am(e){return typeof e>"u"||e===null}function g3(e){return typeof e=="object"&&e!==null}function m3(e){return Array.isArray(e)?e:am(e)?[]:[e]}function h3(e,t){var n,o,a,r;if(t)for(r=Object.keys(t),n=0,o=r.length;n<o;n+=1)a=r[n],e[a]=t[a];return e}function v3(e,t){var n="",o;for(o=0;o<t;o+=1)n+=e;return n}function _3(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var y3=am,b3=g3,w3=m3,x3=v3,S3=_3,T3=h3,Cn={isNothing:y3,isObject:b3,toArray:w3,repeat:x3,isNegativeZero:S3,extend:T3};function rm(e,t){var n="",o=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(n+='in "'+e.mark.name+'" '),n+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!t&&e.mark.snippet&&(n+=`
|
||
|
||
`+e.mark.snippet),o+" "+n):o}function zi(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=rm(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}zi.prototype=Object.create(Error.prototype),zi.prototype.constructor=zi,zi.prototype.toString=function(t){return this.name+": "+rm(this,t)};var Yn=zi;function gc(e,t,n,o,a){var r="",s="",u=Math.floor(a/2)-1;return o-t>u&&(r=" ... ",t=o-u+r.length),n-o>u&&(s=" ...",n=o+u-s.length),{str:r+e.slice(t,n).replace(/\t/g,"→")+s,pos:o-t+r.length}}function mc(e,t){return Cn.repeat(" ",t-e.length)+e}function k3(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||(t.maxLength=79),typeof t.indent!="number"&&(t.indent=1),typeof t.linesBefore!="number"&&(t.linesBefore=3),typeof t.linesAfter!="number"&&(t.linesAfter=2);for(var n=/\r?\n|\r|\0/g,o=[0],a=[],r,s=-1;r=n.exec(e.buffer);)a.push(r.index),o.push(r.index+r[0].length),e.position<=r.index&&s<0&&(s=o.length-2);s<0&&(s=o.length-1);var u="",p,m,f=Math.min(e.line+t.linesAfter,a.length).toString().length,g=t.maxLength-(t.indent+f+3);for(p=1;p<=t.linesBefore&&!(s-p<0);p++)m=gc(e.buffer,o[s-p],a[s-p],e.position-(o[s]-o[s-p]),g),u=Cn.repeat(" ",t.indent)+mc((e.line-p+1).toString(),f)+" | "+m.str+`
|
||
`+u;for(m=gc(e.buffer,o[s],a[s],e.position,g),u+=Cn.repeat(" ",t.indent)+mc((e.line+1).toString(),f)+" | "+m.str+`
|
||
`,u+=Cn.repeat("-",t.indent+f+3+m.pos)+`^
|
||
`,p=1;p<=t.linesAfter&&!(s+p>=a.length);p++)m=gc(e.buffer,o[s+p],a[s+p],e.position-(o[s]-o[s+p]),g),u+=Cn.repeat(" ",t.indent)+mc((e.line+p+1).toString(),f)+" | "+m.str+`
|
||
`;return u.replace(/\n$/,"")}var C3=k3,E3=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],$3=["scalar","sequence","mapping"];function L3(e){var t={};return e!==null&&Object.keys(e).forEach(function(n){e[n].forEach(function(o){t[String(o)]=n})}),t}function A3(e,t){if(t=t||{},Object.keys(t).forEach(function(n){if(E3.indexOf(n)===-1)throw new Yn('Unknown option "'+n+'" is met in definition of "'+e+'" YAML type.')}),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(n){return n},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=L3(t.styleAliases||null),$3.indexOf(this.kind)===-1)throw new Yn('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var Ln=A3;function im(e,t){var n=[];return e[t].forEach(function(o){var a=n.length;n.forEach(function(r,s){r.tag===o.tag&&r.kind===o.kind&&r.multi===o.multi&&(a=s)}),n[a]=o}),n}function M3(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},t,n;function o(a){a.multi?(e.multi[a.kind].push(a),e.multi.fallback.push(a)):e[a.kind][a.tag]=e.fallback[a.tag]=a}for(t=0,n=arguments.length;t<n;t+=1)arguments[t].forEach(o);return e}function hc(e){return this.extend(e)}hc.prototype.extend=function(t){var n=[],o=[];if(t instanceof Ln)o.push(t);else if(Array.isArray(t))o=o.concat(t);else if(t&&(Array.isArray(t.implicit)||Array.isArray(t.explicit)))t.implicit&&(n=n.concat(t.implicit)),t.explicit&&(o=o.concat(t.explicit));else throw new Yn("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");n.forEach(function(r){if(!(r instanceof Ln))throw new Yn("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(r.loadKind&&r.loadKind!=="scalar")throw new Yn("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(r.multi)throw new Yn("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),o.forEach(function(r){if(!(r instanceof Ln))throw new Yn("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var a=Object.create(hc.prototype);return a.implicit=(this.implicit||[]).concat(n),a.explicit=(this.explicit||[]).concat(o),a.compiledImplicit=im(a,"implicit"),a.compiledExplicit=im(a,"explicit"),a.compiledTypeMap=M3(a.compiledImplicit,a.compiledExplicit),a};var sm=hc,lm=new Ln("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),um=new Ln("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),cm=new Ln("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),dm=new sm({explicit:[lm,um,cm]});function I3(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}function D3(){return null}function O3(e){return e===null}var pm=new Ln("tag:yaml.org,2002:null",{kind:"scalar",resolve:I3,construct:D3,predicate:O3,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function R3(e){if(e===null)return!1;var t=e.length;return t===4&&(e==="true"||e==="True"||e==="TRUE")||t===5&&(e==="false"||e==="False"||e==="FALSE")}function P3(e){return e==="true"||e==="True"||e==="TRUE"}function N3(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var fm=new Ln("tag:yaml.org,2002:bool",{kind:"scalar",resolve:R3,construct:P3,predicate:N3,represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"});function F3(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function B3(e){return 48<=e&&e<=55}function U3(e){return 48<=e&&e<=57}function z3(e){if(e===null)return!1;var t=e.length,n=0,o=!1,a;if(!t)return!1;if(a=e[n],(a==="-"||a==="+")&&(a=e[++n]),a==="0"){if(n+1===t)return!0;if(a=e[++n],a==="b"){for(n++;n<t;n++)if(a=e[n],a!=="_"){if(a!=="0"&&a!=="1")return!1;o=!0}return o&&a!=="_"}if(a==="x"){for(n++;n<t;n++)if(a=e[n],a!=="_"){if(!F3(e.charCodeAt(n)))return!1;o=!0}return o&&a!=="_"}if(a==="o"){for(n++;n<t;n++)if(a=e[n],a!=="_"){if(!B3(e.charCodeAt(n)))return!1;o=!0}return o&&a!=="_"}}if(a==="_")return!1;for(;n<t;n++)if(a=e[n],a!=="_"){if(!U3(e.charCodeAt(n)))return!1;o=!0}return!(!o||a==="_")}function V3(e){var t=e,n=1,o;if(t.indexOf("_")!==-1&&(t=t.replace(/_/g,"")),o=t[0],(o==="-"||o==="+")&&(o==="-"&&(n=-1),t=t.slice(1),o=t[0]),t==="0")return 0;if(o==="0"){if(t[1]==="b")return n*parseInt(t.slice(2),2);if(t[1]==="x")return n*parseInt(t.slice(2),16);if(t[1]==="o")return n*parseInt(t.slice(2),8)}return n*parseInt(t,10)}function W3(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!Cn.isNegativeZero(e)}var gm=new Ln("tag:yaml.org,2002:int",{kind:"scalar",resolve:z3,construct:V3,predicate:W3,represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),j3=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function H3(e){return!(e===null||!j3.test(e)||e[e.length-1]==="_")}function G3(e){var t,n;return t=e.replace(/_/g,"").toLowerCase(),n=t[0]==="-"?-1:1,"+-".indexOf(t[0])>=0&&(t=t.slice(1)),t===".inf"?n===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:t===".nan"?NaN:n*parseFloat(t,10)}var q3=/^[-+]?[0-9]+e/;function Y3(e,t){var n;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(Cn.isNegativeZero(e))return"-0.0";return n=e.toString(10),q3.test(n)?n.replace("e",".e"):n}function K3(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||Cn.isNegativeZero(e))}var mm=new Ln("tag:yaml.org,2002:float",{kind:"scalar",resolve:H3,construct:G3,predicate:K3,represent:Y3,defaultStyle:"lowercase"}),hm=dm.extend({implicit:[pm,fm,gm,mm]}),vm=hm,_m=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),ym=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function J3(e){return e===null?!1:_m.exec(e)!==null||ym.exec(e)!==null}function X3(e){var t,n,o,a,r,s,u,p=0,m=null,f,g,x;if(t=_m.exec(e),t===null&&(t=ym.exec(e)),t===null)throw new Error("Date resolve error");if(n=+t[1],o=+t[2]-1,a=+t[3],!t[4])return new Date(Date.UTC(n,o,a));if(r=+t[4],s=+t[5],u=+t[6],t[7]){for(p=t[7].slice(0,3);p.length<3;)p+="0";p=+p}return t[9]&&(f=+t[10],g=+(t[11]||0),m=(f*60+g)*6e4,t[9]==="-"&&(m=-m)),x=new Date(Date.UTC(n,o,a,r,s,u,p)),m&&x.setTime(x.getTime()-m),x}function Q3(e){return e.toISOString()}var bm=new Ln("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:J3,construct:X3,instanceOf:Date,represent:Q3});function Z3(e){return e==="<<"||e===null}var wm=new Ln("tag:yaml.org,2002:merge",{kind:"scalar",resolve:Z3}),vc=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
|
||
\r`;function e5(e){if(e===null)return!1;var t,n,o=0,a=e.length,r=vc;for(n=0;n<a;n++)if(t=r.indexOf(e.charAt(n)),!(t>64)){if(t<0)return!1;o+=6}return o%8===0}function t5(e){var t,n,o=e.replace(/[\r\n=]/g,""),a=o.length,r=vc,s=0,u=[];for(t=0;t<a;t++)t%4===0&&t&&(u.push(s>>16&255),u.push(s>>8&255),u.push(s&255)),s=s<<6|r.indexOf(o.charAt(t));return n=a%4*6,n===0?(u.push(s>>16&255),u.push(s>>8&255),u.push(s&255)):n===18?(u.push(s>>10&255),u.push(s>>2&255)):n===12&&u.push(s>>4&255),new Uint8Array(u)}function n5(e){var t="",n=0,o,a,r=e.length,s=vc;for(o=0;o<r;o++)o%3===0&&o&&(t+=s[n>>18&63],t+=s[n>>12&63],t+=s[n>>6&63],t+=s[n&63]),n=(n<<8)+e[o];return a=r%3,a===0?(t+=s[n>>18&63],t+=s[n>>12&63],t+=s[n>>6&63],t+=s[n&63]):a===2?(t+=s[n>>10&63],t+=s[n>>4&63],t+=s[n<<2&63],t+=s[64]):a===1&&(t+=s[n>>2&63],t+=s[n<<4&63],t+=s[64],t+=s[64]),t}function o5(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var xm=new Ln("tag:yaml.org,2002:binary",{kind:"scalar",resolve:e5,construct:t5,predicate:o5,represent:n5}),a5=Object.prototype.hasOwnProperty,r5=Object.prototype.toString;function i5(e){if(e===null)return!0;var t=[],n,o,a,r,s,u=e;for(n=0,o=u.length;n<o;n+=1){if(a=u[n],s=!1,r5.call(a)!=="[object Object]")return!1;for(r in a)if(a5.call(a,r))if(!s)s=!0;else return!1;if(!s)return!1;if(t.indexOf(r)===-1)t.push(r);else return!1}return!0}function s5(e){return e!==null?e:[]}var Sm=new Ln("tag:yaml.org,2002:omap",{kind:"sequence",resolve:i5,construct:s5}),l5=Object.prototype.toString;function u5(e){if(e===null)return!0;var t,n,o,a,r,s=e;for(r=new Array(s.length),t=0,n=s.length;t<n;t+=1){if(o=s[t],l5.call(o)!=="[object Object]"||(a=Object.keys(o),a.length!==1))return!1;r[t]=[a[0],o[a[0]]]}return!0}function c5(e){if(e===null)return[];var t,n,o,a,r,s=e;for(r=new Array(s.length),t=0,n=s.length;t<n;t+=1)o=s[t],a=Object.keys(o),r[t]=[a[0],o[a[0]]];return r}var Tm=new Ln("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:u5,construct:c5}),d5=Object.prototype.hasOwnProperty;function p5(e){if(e===null)return!0;var t,n=e;for(t in n)if(d5.call(n,t)&&n[t]!==null)return!1;return!0}function f5(e){return e!==null?e:{}}var km=new Ln("tag:yaml.org,2002:set",{kind:"mapping",resolve:p5,construct:f5}),_c=vm.extend({implicit:[bm,wm],explicit:[xm,Sm,Tm,km]}),Pa=Object.prototype.hasOwnProperty,sl=1,Cm=2,Em=3,ll=4,yc=1,g5=2,$m=3,m5=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,h5=/[\x85\u2028\u2029]/,v5=/[,\[\]\{\}]/,Lm=/^(?:!|!!|![a-z\-]+!)$/i,Am=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function Mm(e){return Object.prototype.toString.call(e)}function zo(e){return e===10||e===13}function lr(e){return e===9||e===32}function oo(e){return e===9||e===32||e===10||e===13}function Fr(e){return e===44||e===91||e===93||e===123||e===125}function _5(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}function y5(e){return e===120?2:e===117?4:e===85?8:0}function b5(e){return 48<=e&&e<=57?e-48:-1}function Im(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
|
||
`:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"
":e===95?" ":e===76?"\u2028":e===80?"\u2029":""}function w5(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}for(var Dm=new Array(256),Om=new Array(256),Br=0;Br<256;Br++)Dm[Br]=Im(Br)?1:0,Om[Br]=Im(Br);function x5(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||_c,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function Rm(e,t){var n={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return n.snippet=C3(n),new Yn(t,n)}function rt(e,t){throw Rm(e,t)}function ul(e,t){e.onWarning&&e.onWarning.call(null,Rm(e,t))}var Pm={YAML:function(t,n,o){var a,r,s;t.version!==null&&rt(t,"duplication of %YAML directive"),o.length!==1&&rt(t,"YAML directive accepts exactly one argument"),a=/^([0-9]+)\.([0-9]+)$/.exec(o[0]),a===null&&rt(t,"ill-formed argument of the YAML directive"),r=parseInt(a[1],10),s=parseInt(a[2],10),r!==1&&rt(t,"unacceptable YAML version of the document"),t.version=o[0],t.checkLineBreaks=s<2,s!==1&&s!==2&&ul(t,"unsupported YAML version of the document")},TAG:function(t,n,o){var a,r;o.length!==2&&rt(t,"TAG directive accepts exactly two arguments"),a=o[0],r=o[1],Lm.test(a)||rt(t,"ill-formed tag handle (first argument) of the TAG directive"),Pa.call(t.tagMap,a)&&rt(t,'there is a previously declared suffix for "'+a+'" tag handle'),Am.test(r)||rt(t,"ill-formed tag prefix (second argument) of the TAG directive");try{r=decodeURIComponent(r)}catch{rt(t,"tag prefix is malformed: "+r)}t.tagMap[a]=r}};function Na(e,t,n,o){var a,r,s,u;if(t<n){if(u=e.input.slice(t,n),o)for(a=0,r=u.length;a<r;a+=1)s=u.charCodeAt(a),s===9||32<=s&&s<=1114111||rt(e,"expected valid JSON character");else m5.test(u)&&rt(e,"the stream contains non-printable characters");e.result+=u}}function Nm(e,t,n,o){var a,r,s,u;for(Cn.isObject(n)||rt(e,"cannot merge mappings; the provided source object is unacceptable"),a=Object.keys(n),s=0,u=a.length;s<u;s+=1)r=a[s],Pa.call(t,r)||(t[r]=n[r],o[r]=!0)}function Ur(e,t,n,o,a,r,s,u,p){var m,f;if(Array.isArray(a))for(a=Array.prototype.slice.call(a),m=0,f=a.length;m<f;m+=1)Array.isArray(a[m])&&rt(e,"nested arrays are not supported inside keys"),typeof a=="object"&&Mm(a[m])==="[object Object]"&&(a[m]="[object Object]");if(typeof a=="object"&&Mm(a)==="[object Object]"&&(a="[object Object]"),a=String(a),t===null&&(t={}),o==="tag:yaml.org,2002:merge")if(Array.isArray(r))for(m=0,f=r.length;m<f;m+=1)Nm(e,t,r[m],n);else Nm(e,t,r,n);else!e.json&&!Pa.call(n,a)&&Pa.call(t,a)&&(e.line=s||e.line,e.lineStart=u||e.lineStart,e.position=p||e.position,rt(e,"duplicated mapping key")),a==="__proto__"?Object.defineProperty(t,a,{configurable:!0,enumerable:!0,writable:!0,value:r}):t[a]=r,delete n[a];return t}function bc(e){var t;t=e.input.charCodeAt(e.position),t===10?e.position++:t===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):rt(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function bn(e,t,n){for(var o=0,a=e.input.charCodeAt(e.position);a!==0;){for(;lr(a);)a===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),a=e.input.charCodeAt(++e.position);if(t&&a===35)do a=e.input.charCodeAt(++e.position);while(a!==10&&a!==13&&a!==0);if(zo(a))for(bc(e),a=e.input.charCodeAt(e.position),o++,e.lineIndent=0;a===32;)e.lineIndent++,a=e.input.charCodeAt(++e.position);else break}return n!==-1&&o!==0&&e.lineIndent<n&&ul(e,"deficient indentation"),o}function cl(e){var t=e.position,n;return n=e.input.charCodeAt(t),!!((n===45||n===46)&&n===e.input.charCodeAt(t+1)&&n===e.input.charCodeAt(t+2)&&(t+=3,n=e.input.charCodeAt(t),n===0||oo(n)))}function wc(e,t){t===1?e.result+=" ":t>1&&(e.result+=Cn.repeat(`
|
||
`,t-1))}function S5(e,t,n){var o,a,r,s,u,p,m,f,g=e.kind,x=e.result,b;if(b=e.input.charCodeAt(e.position),oo(b)||Fr(b)||b===35||b===38||b===42||b===33||b===124||b===62||b===39||b===34||b===37||b===64||b===96||(b===63||b===45)&&(a=e.input.charCodeAt(e.position+1),oo(a)||n&&Fr(a)))return!1;for(e.kind="scalar",e.result="",r=s=e.position,u=!1;b!==0;){if(b===58){if(a=e.input.charCodeAt(e.position+1),oo(a)||n&&Fr(a))break}else if(b===35){if(o=e.input.charCodeAt(e.position-1),oo(o))break}else{if(e.position===e.lineStart&&cl(e)||n&&Fr(b))break;if(zo(b))if(p=e.line,m=e.lineStart,f=e.lineIndent,bn(e,!1,-1),e.lineIndent>=t){u=!0,b=e.input.charCodeAt(e.position);continue}else{e.position=s,e.line=p,e.lineStart=m,e.lineIndent=f;break}}u&&(Na(e,r,s,!1),wc(e,e.line-p),r=s=e.position,u=!1),lr(b)||(s=e.position+1),b=e.input.charCodeAt(++e.position)}return Na(e,r,s,!1),e.result?!0:(e.kind=g,e.result=x,!1)}function T5(e,t){var n,o,a;if(n=e.input.charCodeAt(e.position),n!==39)return!1;for(e.kind="scalar",e.result="",e.position++,o=a=e.position;(n=e.input.charCodeAt(e.position))!==0;)if(n===39)if(Na(e,o,e.position,!0),n=e.input.charCodeAt(++e.position),n===39)o=e.position,e.position++,a=e.position;else return!0;else zo(n)?(Na(e,o,a,!0),wc(e,bn(e,!1,t)),o=a=e.position):e.position===e.lineStart&&cl(e)?rt(e,"unexpected end of the document within a single quoted scalar"):(e.position++,a=e.position);rt(e,"unexpected end of the stream within a single quoted scalar")}function k5(e,t){var n,o,a,r,s,u;if(u=e.input.charCodeAt(e.position),u!==34)return!1;for(e.kind="scalar",e.result="",e.position++,n=o=e.position;(u=e.input.charCodeAt(e.position))!==0;){if(u===34)return Na(e,n,e.position,!0),e.position++,!0;if(u===92){if(Na(e,n,e.position,!0),u=e.input.charCodeAt(++e.position),zo(u))bn(e,!1,t);else if(u<256&&Dm[u])e.result+=Om[u],e.position++;else if((s=y5(u))>0){for(a=s,r=0;a>0;a--)u=e.input.charCodeAt(++e.position),(s=_5(u))>=0?r=(r<<4)+s:rt(e,"expected hexadecimal character");e.result+=w5(r),e.position++}else rt(e,"unknown escape sequence");n=o=e.position}else zo(u)?(Na(e,n,o,!0),wc(e,bn(e,!1,t)),n=o=e.position):e.position===e.lineStart&&cl(e)?rt(e,"unexpected end of the document within a double quoted scalar"):(e.position++,o=e.position)}rt(e,"unexpected end of the stream within a double quoted scalar")}function C5(e,t){var n=!0,o,a,r,s=e.tag,u,p=e.anchor,m,f,g,x,b,k=Object.create(null),$,O,I,V;if(V=e.input.charCodeAt(e.position),V===91)f=93,b=!1,u=[];else if(V===123)f=125,b=!0,u={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=u),V=e.input.charCodeAt(++e.position);V!==0;){if(bn(e,!0,t),V=e.input.charCodeAt(e.position),V===f)return e.position++,e.tag=s,e.anchor=p,e.kind=b?"mapping":"sequence",e.result=u,!0;n?V===44&&rt(e,"expected the node content, but found ','"):rt(e,"missed comma between flow collection entries"),O=$=I=null,g=x=!1,V===63&&(m=e.input.charCodeAt(e.position+1),oo(m)&&(g=x=!0,e.position++,bn(e,!0,t))),o=e.line,a=e.lineStart,r=e.position,zr(e,t,sl,!1,!0),O=e.tag,$=e.result,bn(e,!0,t),V=e.input.charCodeAt(e.position),(x||e.line===o)&&V===58&&(g=!0,V=e.input.charCodeAt(++e.position),bn(e,!0,t),zr(e,t,sl,!1,!0),I=e.result),b?Ur(e,u,k,O,$,I,o,a,r):g?u.push(Ur(e,null,k,O,$,I,o,a,r)):u.push($),bn(e,!0,t),V=e.input.charCodeAt(e.position),V===44?(n=!0,V=e.input.charCodeAt(++e.position)):n=!1}rt(e,"unexpected end of the stream within a flow collection")}function E5(e,t){var n,o,a=yc,r=!1,s=!1,u=t,p=0,m=!1,f,g;if(g=e.input.charCodeAt(e.position),g===124)o=!1;else if(g===62)o=!0;else return!1;for(e.kind="scalar",e.result="";g!==0;)if(g=e.input.charCodeAt(++e.position),g===43||g===45)yc===a?a=g===43?$m:g5:rt(e,"repeat of a chomping mode identifier");else if((f=b5(g))>=0)f===0?rt(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):s?rt(e,"repeat of an indentation width identifier"):(u=t+f-1,s=!0);else break;if(lr(g)){do g=e.input.charCodeAt(++e.position);while(lr(g));if(g===35)do g=e.input.charCodeAt(++e.position);while(!zo(g)&&g!==0)}for(;g!==0;){for(bc(e),e.lineIndent=0,g=e.input.charCodeAt(e.position);(!s||e.lineIndent<u)&&g===32;)e.lineIndent++,g=e.input.charCodeAt(++e.position);if(!s&&e.lineIndent>u&&(u=e.lineIndent),zo(g)){p++;continue}if(e.lineIndent<u){a===$m?e.result+=Cn.repeat(`
|
||
`,r?1+p:p):a===yc&&r&&(e.result+=`
|
||
`);break}for(o?lr(g)?(m=!0,e.result+=Cn.repeat(`
|
||
`,r?1+p:p)):m?(m=!1,e.result+=Cn.repeat(`
|
||
`,p+1)):p===0?r&&(e.result+=" "):e.result+=Cn.repeat(`
|
||
`,p):e.result+=Cn.repeat(`
|
||
`,r?1+p:p),r=!0,s=!0,p=0,n=e.position;!zo(g)&&g!==0;)g=e.input.charCodeAt(++e.position);Na(e,n,e.position,!1)}return!0}function Fm(e,t){var n,o=e.tag,a=e.anchor,r=[],s,u=!1,p;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=r),p=e.input.charCodeAt(e.position);p!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,rt(e,"tab characters must not be used in indentation")),!(p!==45||(s=e.input.charCodeAt(e.position+1),!oo(s))));){if(u=!0,e.position++,bn(e,!0,-1)&&e.lineIndent<=t){r.push(null),p=e.input.charCodeAt(e.position);continue}if(n=e.line,zr(e,t,Em,!1,!0),r.push(e.result),bn(e,!0,-1),p=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>t)&&p!==0)rt(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break}return u?(e.tag=o,e.anchor=a,e.kind="sequence",e.result=r,!0):!1}function $5(e,t,n){var o,a,r,s,u,p,m=e.tag,f=e.anchor,g={},x=Object.create(null),b=null,k=null,$=null,O=!1,I=!1,V;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=g),V=e.input.charCodeAt(e.position);V!==0;){if(!O&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,rt(e,"tab characters must not be used in indentation")),o=e.input.charCodeAt(e.position+1),r=e.line,(V===63||V===58)&&oo(o))V===63?(O&&(Ur(e,g,x,b,k,null,s,u,p),b=k=$=null),I=!0,O=!0,a=!0):O?(O=!1,a=!0):rt(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,V=o;else{if(s=e.line,u=e.lineStart,p=e.position,!zr(e,n,Cm,!1,!0))break;if(e.line===r){for(V=e.input.charCodeAt(e.position);lr(V);)V=e.input.charCodeAt(++e.position);if(V===58)V=e.input.charCodeAt(++e.position),oo(V)||rt(e,"a whitespace character is expected after the key-value separator within a block mapping"),O&&(Ur(e,g,x,b,k,null,s,u,p),b=k=$=null),I=!0,O=!1,a=!1,b=e.tag,k=e.result;else if(I)rt(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=m,e.anchor=f,!0}else if(I)rt(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=m,e.anchor=f,!0}if((e.line===r||e.lineIndent>t)&&(O&&(s=e.line,u=e.lineStart,p=e.position),zr(e,t,ll,!0,a)&&(O?k=e.result:$=e.result),O||(Ur(e,g,x,b,k,$,s,u,p),b=k=$=null),bn(e,!0,-1),V=e.input.charCodeAt(e.position)),(e.line===r||e.lineIndent>t)&&V!==0)rt(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return O&&Ur(e,g,x,b,k,null,s,u,p),I&&(e.tag=m,e.anchor=f,e.kind="mapping",e.result=g),I}function L5(e){var t,n=!1,o=!1,a,r,s;if(s=e.input.charCodeAt(e.position),s!==33)return!1;if(e.tag!==null&&rt(e,"duplication of a tag property"),s=e.input.charCodeAt(++e.position),s===60?(n=!0,s=e.input.charCodeAt(++e.position)):s===33?(o=!0,a="!!",s=e.input.charCodeAt(++e.position)):a="!",t=e.position,n){do s=e.input.charCodeAt(++e.position);while(s!==0&&s!==62);e.position<e.length?(r=e.input.slice(t,e.position),s=e.input.charCodeAt(++e.position)):rt(e,"unexpected end of the stream within a verbatim tag")}else{for(;s!==0&&!oo(s);)s===33&&(o?rt(e,"tag suffix cannot contain exclamation marks"):(a=e.input.slice(t-1,e.position+1),Lm.test(a)||rt(e,"named tag handle cannot contain such characters"),o=!0,t=e.position+1)),s=e.input.charCodeAt(++e.position);r=e.input.slice(t,e.position),v5.test(r)&&rt(e,"tag suffix cannot contain flow indicator characters")}r&&!Am.test(r)&&rt(e,"tag name cannot contain such characters: "+r);try{r=decodeURIComponent(r)}catch{rt(e,"tag name is malformed: "+r)}return n?e.tag=r:Pa.call(e.tagMap,a)?e.tag=e.tagMap[a]+r:a==="!"?e.tag="!"+r:a==="!!"?e.tag="tag:yaml.org,2002:"+r:rt(e,'undeclared tag handle "'+a+'"'),!0}function A5(e){var t,n;if(n=e.input.charCodeAt(e.position),n!==38)return!1;for(e.anchor!==null&&rt(e,"duplication of an anchor property"),n=e.input.charCodeAt(++e.position),t=e.position;n!==0&&!oo(n)&&!Fr(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&rt(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function M5(e){var t,n,o;if(o=e.input.charCodeAt(e.position),o!==42)return!1;for(o=e.input.charCodeAt(++e.position),t=e.position;o!==0&&!oo(o)&&!Fr(o);)o=e.input.charCodeAt(++e.position);return e.position===t&&rt(e,"name of an alias node must contain at least one character"),n=e.input.slice(t,e.position),Pa.call(e.anchorMap,n)||rt(e,'unidentified alias "'+n+'"'),e.result=e.anchorMap[n],bn(e,!0,-1),!0}function zr(e,t,n,o,a){var r,s,u,p=1,m=!1,f=!1,g,x,b,k,$,O;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,r=s=u=ll===n||Em===n,o&&bn(e,!0,-1)&&(m=!0,e.lineIndent>t?p=1:e.lineIndent===t?p=0:e.lineIndent<t&&(p=-1)),p===1)for(;L5(e)||A5(e);)bn(e,!0,-1)?(m=!0,u=r,e.lineIndent>t?p=1:e.lineIndent===t?p=0:e.lineIndent<t&&(p=-1)):u=!1;if(u&&(u=m||a),(p===1||ll===n)&&(sl===n||Cm===n?$=t:$=t+1,O=e.position-e.lineStart,p===1?u&&(Fm(e,O)||$5(e,O,$))||C5(e,$)?f=!0:(s&&E5(e,$)||T5(e,$)||k5(e,$)?f=!0:M5(e)?(f=!0,(e.tag!==null||e.anchor!==null)&&rt(e,"alias node should not have any properties")):S5(e,$,sl===n)&&(f=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):p===0&&(f=u&&Fm(e,O))),e.tag===null)e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);else if(e.tag==="?"){for(e.result!==null&&e.kind!=="scalar"&&rt(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),g=0,x=e.implicitTypes.length;g<x;g+=1)if(k=e.implicitTypes[g],k.resolve(e.result)){e.result=k.construct(e.result),e.tag=k.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else if(e.tag!=="!"){if(Pa.call(e.typeMap[e.kind||"fallback"],e.tag))k=e.typeMap[e.kind||"fallback"][e.tag];else for(k=null,b=e.typeMap.multi[e.kind||"fallback"],g=0,x=b.length;g<x;g+=1)if(e.tag.slice(0,b[g].tag.length)===b[g].tag){k=b[g];break}k||rt(e,"unknown tag !<"+e.tag+">"),e.result!==null&&k.kind!==e.kind&&rt(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+k.kind+'", not "'+e.kind+'"'),k.resolve(e.result,e.tag)?(e.result=k.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):rt(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||f}function I5(e){var t=e.position,n,o,a,r=!1,s;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(s=e.input.charCodeAt(e.position))!==0&&(bn(e,!0,-1),s=e.input.charCodeAt(e.position),!(e.lineIndent>0||s!==37));){for(r=!0,s=e.input.charCodeAt(++e.position),n=e.position;s!==0&&!oo(s);)s=e.input.charCodeAt(++e.position);for(o=e.input.slice(n,e.position),a=[],o.length<1&&rt(e,"directive name must not be less than one character in length");s!==0;){for(;lr(s);)s=e.input.charCodeAt(++e.position);if(s===35){do s=e.input.charCodeAt(++e.position);while(s!==0&&!zo(s));break}if(zo(s))break;for(n=e.position;s!==0&&!oo(s);)s=e.input.charCodeAt(++e.position);a.push(e.input.slice(n,e.position))}s!==0&&bc(e),Pa.call(Pm,o)?Pm[o](e,o,a):ul(e,'unknown document directive "'+o+'"')}if(bn(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,bn(e,!0,-1)):r&&rt(e,"directives end mark is expected"),zr(e,e.lineIndent-1,ll,!1,!0),bn(e,!0,-1),e.checkLineBreaks&&h5.test(e.input.slice(t,e.position))&&ul(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&cl(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,bn(e,!0,-1));return}if(e.position<e.length-1)rt(e,"end of the stream or a document separator is expected");else return}function Bm(e,t){e=String(e),t=t||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
|
||
`),e.charCodeAt(0)===65279&&(e=e.slice(1)));var n=new x5(e,t),o=e.indexOf("\0");for(o!==-1&&(n.position=o,rt(n,"null byte is not allowed in input")),n.input+="\0";n.input.charCodeAt(n.position)===32;)n.lineIndent+=1,n.position+=1;for(;n.position<n.length-1;)I5(n);return n.documents}function D5(e,t,n){t!==null&&typeof t=="object"&&typeof n>"u"&&(n=t,t=null);var o=Bm(e,n);if(typeof t!="function")return o;for(var a=0,r=o.length;a<r;a+=1)t(o[a])}function O5(e,t){var n=Bm(e,t);if(n.length!==0){if(n.length===1)return n[0];throw new Yn("expected a single document in the stream, but found more")}}var R5=D5,P5=O5,Um={loadAll:R5,load:P5},zm=Object.prototype.toString,Vm=Object.prototype.hasOwnProperty,xc=65279,N5=9,Vi=10,F5=13,B5=32,U5=33,z5=34,Sc=35,V5=37,W5=38,j5=39,H5=42,Wm=44,G5=45,dl=58,q5=61,Y5=62,K5=63,J5=64,jm=91,Hm=93,X5=96,Gm=123,Q5=124,qm=125,Nn={};Nn[0]="\\0",Nn[7]="\\a",Nn[8]="\\b",Nn[9]="\\t",Nn[10]="\\n",Nn[11]="\\v",Nn[12]="\\f",Nn[13]="\\r",Nn[27]="\\e",Nn[34]='\\"',Nn[92]="\\\\",Nn[133]="\\N",Nn[160]="\\_",Nn[8232]="\\L",Nn[8233]="\\P";var Z5=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],e6=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function t6(e,t){var n,o,a,r,s,u,p;if(t===null)return{};for(n={},o=Object.keys(t),a=0,r=o.length;a<r;a+=1)s=o[a],u=String(t[s]),s.slice(0,2)==="!!"&&(s="tag:yaml.org,2002:"+s.slice(2)),p=e.compiledTypeMap.fallback[s],p&&Vm.call(p.styleAliases,u)&&(u=p.styleAliases[u]),n[s]=u;return n}function n6(e){var t,n,o;if(t=e.toString(16).toUpperCase(),e<=255)n="x",o=2;else if(e<=65535)n="u",o=4;else if(e<=4294967295)n="U",o=8;else throw new Yn("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+n+Cn.repeat("0",o-t.length)+t}var o6=1,Wi=2;function a6(e){this.schema=e.schema||_c,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=Cn.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=t6(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.quotingType=e.quotingType==='"'?Wi:o6,this.forceQuotes=e.forceQuotes||!1,this.replacer=typeof e.replacer=="function"?e.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function Ym(e,t){for(var n=Cn.repeat(" ",t),o=0,a=-1,r="",s,u=e.length;o<u;)a=e.indexOf(`
|
||
`,o),a===-1?(s=e.slice(o),o=u):(s=e.slice(o,a+1),o=a+1),s.length&&s!==`
|
||
`&&(r+=n),r+=s;return r}function Tc(e,t){return`
|
||
`+Cn.repeat(" ",e.indent*t)}function r6(e,t){var n,o,a;for(n=0,o=e.implicitTypes.length;n<o;n+=1)if(a=e.implicitTypes[n],a.resolve(t))return!0;return!1}function pl(e){return e===B5||e===N5}function ji(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==xc||65536<=e&&e<=1114111}function Km(e){return ji(e)&&e!==xc&&e!==F5&&e!==Vi}function Jm(e,t,n){var o=Km(e),a=o&&!pl(e);return(n?o:o&&e!==Wm&&e!==jm&&e!==Hm&&e!==Gm&&e!==qm)&&e!==Sc&&!(t===dl&&!a)||Km(t)&&!pl(t)&&e===Sc||t===dl&&a}function i6(e){return ji(e)&&e!==xc&&!pl(e)&&e!==G5&&e!==K5&&e!==dl&&e!==Wm&&e!==jm&&e!==Hm&&e!==Gm&&e!==qm&&e!==Sc&&e!==W5&&e!==H5&&e!==U5&&e!==Q5&&e!==q5&&e!==Y5&&e!==j5&&e!==z5&&e!==V5&&e!==J5&&e!==X5}function s6(e){return!pl(e)&&e!==dl}function Hi(e,t){var n=e.charCodeAt(t),o;return n>=55296&&n<=56319&&t+1<e.length&&(o=e.charCodeAt(t+1),o>=56320&&o<=57343)?(n-55296)*1024+o-56320+65536:n}function Xm(e){var t=/^\n* /;return t.test(e)}var Qm=1,kc=2,Zm=3,eh=4,Vr=5;function l6(e,t,n,o,a,r,s,u){var p,m=0,f=null,g=!1,x=!1,b=o!==-1,k=-1,$=i6(Hi(e,0))&&s6(Hi(e,e.length-1));if(t||s)for(p=0;p<e.length;m>=65536?p+=2:p++){if(m=Hi(e,p),!ji(m))return Vr;$=$&&Jm(m,f,u),f=m}else{for(p=0;p<e.length;m>=65536?p+=2:p++){if(m=Hi(e,p),m===Vi)g=!0,b&&(x=x||p-k-1>o&&e[k+1]!==" ",k=p);else if(!ji(m))return Vr;$=$&&Jm(m,f,u),f=m}x=x||b&&p-k-1>o&&e[k+1]!==" "}return!g&&!x?$&&!s&&!a(e)?Qm:r===Wi?Vr:kc:n>9&&Xm(e)?Vr:s?r===Wi?Vr:kc:x?eh:Zm}function u6(e,t,n,o,a){e.dump=function(){if(t.length===0)return e.quotingType===Wi?'""':"''";if(!e.noCompatMode&&(Z5.indexOf(t)!==-1||e6.test(t)))return e.quotingType===Wi?'"'+t+'"':"'"+t+"'";var r=e.indent*Math.max(1,n),s=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-r),u=o||e.flowLevel>-1&&n>=e.flowLevel;function p(m){return r6(e,m)}switch(l6(t,u,e.indent,s,p,e.quotingType,e.forceQuotes&&!o,a)){case Qm:return t;case kc:return"'"+t.replace(/'/g,"''")+"'";case Zm:return"|"+th(t,e.indent)+nh(Ym(t,r));case eh:return">"+th(t,e.indent)+nh(Ym(c6(t,s),r));case Vr:return'"'+d6(t)+'"';default:throw new Yn("impossible error: invalid scalar style")}}()}function th(e,t){var n=Xm(e)?String(t):"",o=e[e.length-1]===`
|
||
`,a=o&&(e[e.length-2]===`
|
||
`||e===`
|
||
`),r=a?"+":o?"":"-";return n+r+`
|
||
`}function nh(e){return e[e.length-1]===`
|
||
`?e.slice(0,-1):e}function c6(e,t){for(var n=/(\n+)([^\n]*)/g,o=function(){var m=e.indexOf(`
|
||
`);return m=m!==-1?m:e.length,n.lastIndex=m,oh(e.slice(0,m),t)}(),a=e[0]===`
|
||
`||e[0]===" ",r,s;s=n.exec(e);){var u=s[1],p=s[2];r=p[0]===" ",o+=u+(!a&&!r&&p!==""?`
|
||
`:"")+oh(p,t),a=r}return o}function oh(e,t){if(e===""||e[0]===" ")return e;for(var n=/ [^ ]/g,o,a=0,r,s=0,u=0,p="";o=n.exec(e);)u=o.index,u-a>t&&(r=s>a?s:u,p+=`
|
||
`+e.slice(a,r),a=r+1),s=u;return p+=`
|
||
`,e.length-a>t&&s>a?p+=e.slice(a,s)+`
|
||
`+e.slice(s+1):p+=e.slice(a),p.slice(1)}function d6(e){for(var t="",n=0,o,a=0;a<e.length;n>=65536?a+=2:a++)n=Hi(e,a),o=Nn[n],!o&&ji(n)?(t+=e[a],n>=65536&&(t+=e[a+1])):t+=o||n6(n);return t}function p6(e,t,n){var o="",a=e.tag,r,s,u;for(r=0,s=n.length;r<s;r+=1)u=n[r],e.replacer&&(u=e.replacer.call(n,String(r),u)),(ca(e,t,u,!1,!1)||typeof u>"u"&&ca(e,t,null,!1,!1))&&(o!==""&&(o+=","+(e.condenseFlow?"":" ")),o+=e.dump);e.tag=a,e.dump="["+o+"]"}function ah(e,t,n,o){var a="",r=e.tag,s,u,p;for(s=0,u=n.length;s<u;s+=1)p=n[s],e.replacer&&(p=e.replacer.call(n,String(s),p)),(ca(e,t+1,p,!0,!0,!1,!0)||typeof p>"u"&&ca(e,t+1,null,!0,!0,!1,!0))&&((!o||a!=="")&&(a+=Tc(e,t)),e.dump&&Vi===e.dump.charCodeAt(0)?a+="-":a+="- ",a+=e.dump);e.tag=r,e.dump=a||"[]"}function f6(e,t,n){var o="",a=e.tag,r=Object.keys(n),s,u,p,m,f;for(s=0,u=r.length;s<u;s+=1)f="",o!==""&&(f+=", "),e.condenseFlow&&(f+='"'),p=r[s],m=n[p],e.replacer&&(m=e.replacer.call(n,p,m)),ca(e,t,p,!1,!1)&&(e.dump.length>1024&&(f+="? "),f+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),ca(e,t,m,!1,!1)&&(f+=e.dump,o+=f));e.tag=a,e.dump="{"+o+"}"}function g6(e,t,n,o){var a="",r=e.tag,s=Object.keys(n),u,p,m,f,g,x;if(e.sortKeys===!0)s.sort();else if(typeof e.sortKeys=="function")s.sort(e.sortKeys);else if(e.sortKeys)throw new Yn("sortKeys must be a boolean or a function");for(u=0,p=s.length;u<p;u+=1)x="",(!o||a!=="")&&(x+=Tc(e,t)),m=s[u],f=n[m],e.replacer&&(f=e.replacer.call(n,m,f)),ca(e,t+1,m,!0,!0,!0)&&(g=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,g&&(e.dump&&Vi===e.dump.charCodeAt(0)?x+="?":x+="? "),x+=e.dump,g&&(x+=Tc(e,t)),ca(e,t+1,f,!0,g)&&(e.dump&&Vi===e.dump.charCodeAt(0)?x+=":":x+=": ",x+=e.dump,a+=x));e.tag=r,e.dump=a||"{}"}function rh(e,t,n){var o,a,r,s,u,p;for(a=n?e.explicitTypes:e.implicitTypes,r=0,s=a.length;r<s;r+=1)if(u=a[r],(u.instanceOf||u.predicate)&&(!u.instanceOf||typeof t=="object"&&t instanceof u.instanceOf)&&(!u.predicate||u.predicate(t))){if(n?u.multi&&u.representName?e.tag=u.representName(t):e.tag=u.tag:e.tag="?",u.represent){if(p=e.styleMap[u.tag]||u.defaultStyle,zm.call(u.represent)==="[object Function]")o=u.represent(t,p);else if(Vm.call(u.represent,p))o=u.represent[p](t,p);else throw new Yn("!<"+u.tag+'> tag resolver accepts not "'+p+'" style');e.dump=o}return!0}return!1}function ca(e,t,n,o,a,r,s){e.tag=null,e.dump=n,rh(e,n,!1)||rh(e,n,!0);var u=zm.call(e.dump),p=o,m;o&&(o=e.flowLevel<0||e.flowLevel>t);var f=u==="[object Object]"||u==="[object Array]",g,x;if(f&&(g=e.duplicates.indexOf(n),x=g!==-1),(e.tag!==null&&e.tag!=="?"||x||e.indent!==2&&t>0)&&(a=!1),x&&e.usedDuplicates[g])e.dump="*ref_"+g;else{if(f&&x&&!e.usedDuplicates[g]&&(e.usedDuplicates[g]=!0),u==="[object Object]")o&&Object.keys(e.dump).length!==0?(g6(e,t,e.dump,a),x&&(e.dump="&ref_"+g+e.dump)):(f6(e,t,e.dump),x&&(e.dump="&ref_"+g+" "+e.dump));else if(u==="[object Array]")o&&e.dump.length!==0?(e.noArrayIndent&&!s&&t>0?ah(e,t-1,e.dump,a):ah(e,t,e.dump,a),x&&(e.dump="&ref_"+g+e.dump)):(p6(e,t,e.dump),x&&(e.dump="&ref_"+g+" "+e.dump));else if(u==="[object String]")e.tag!=="?"&&u6(e,e.dump,t,r,p);else{if(u==="[object Undefined]")return!1;if(e.skipInvalid)return!1;throw new Yn("unacceptable kind of an object to dump "+u)}e.tag!==null&&e.tag!=="?"&&(m=encodeURI(e.tag[0]==="!"?e.tag.slice(1):e.tag).replace(/!/g,"%21"),e.tag[0]==="!"?m="!"+m:m.slice(0,18)==="tag:yaml.org,2002:"?m="!!"+m.slice(18):m="!<"+m+">",e.dump=m+" "+e.dump)}return!0}function m6(e,t){var n=[],o=[],a,r;for(Cc(e,n,o),a=0,r=o.length;a<r;a+=1)t.duplicates.push(n[o[a]]);t.usedDuplicates=new Array(r)}function Cc(e,t,n){var o,a,r;if(e!==null&&typeof e=="object")if(a=t.indexOf(e),a!==-1)n.indexOf(a)===-1&&n.push(a);else if(t.push(e),Array.isArray(e))for(a=0,r=e.length;a<r;a+=1)Cc(e[a],t,n);else for(o=Object.keys(e),a=0,r=o.length;a<r;a+=1)Cc(e[o[a]],t,n)}function h6(e,t){t=t||{};var n=new a6(t);n.noRefs||m6(e,n);var o=e;return n.replacer&&(o=n.replacer.call({"":o},"",o)),ca(n,0,o,!0,!0)?n.dump+`
|
||
`:""}var v6=h6,_6={dump:v6};function Ec(e,t){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+t+" instead, which is now safe by default.")}}var y6=Ln,b6=sm,w6=dm,x6=hm,S6=vm,T6=_c,k6=Um.load,C6=Um.loadAll,E6=_6.dump,$6=Yn,L6={binary:xm,float:mm,map:cm,null:pm,pairs:Tm,set:km,timestamp:bm,bool:fm,int:gm,merge:wm,omap:Sm,seq:um,str:lm},A6=Ec("safeLoad","load"),M6=Ec("safeLoadAll","loadAll"),I6=Ec("safeDump","dump"),ih={Type:y6,Schema:b6,FAILSAFE_SCHEMA:w6,JSON_SCHEMA:x6,CORE_SCHEMA:S6,DEFAULT_SCHEMA:T6,load:k6,loadAll:C6,dump:E6,YAMLException:$6,types:L6,safeLoad:A6,safeLoadAll:M6,safeDump:I6};const D6={key:0,class:"loading-overlay"},O6={class:"settings-content"},R6={class:"info-links"},P6={class:"info-link-item"},N6={class:"info-link-label"},F6={href:"https://www.bilibili.com/list/288025756/?sid=4690314&spm_id_from=333.1387.0.0&oid=114342431298474&bvid=BV1txdfYxE7X",target:"_blank",class:"info-link"},B6={class:"info-link-item"},U6={class:"info-link-label"},z6={href:"https://github.com/weilin9999/WeiLin-Comfyui-Tools-Prompt",target:"_blank",class:"info-link"},V6={class:"info-link-item"},W6={class:"info-link-label"},j6={href:"https://weilin9999.github.io/WeiLin-Share-Prompt-Web/#/",target:"_blank",class:"info-link"},H6={style:{"margin-bottom":"16px"}},G6=["placeholder"],q6={style:{"margin-bottom":"16px"}},Y6=["placeholder"],K6=["placeholder"],J6={style:{"margin-bottom":"16px"}},X6=["placeholder"],Q6=["placeholder"],Z6={style:{"margin-bottom":"16px"}},ex=["placeholder"],tx={class:"data-container"},nx={key:0},ox={key:0},ax={class:"tag-group-container"},rx={style:{display:"flex","align-items":"center"}},ix={key:0},sx=["placeholder"],lx=["onClick"],ux=["onClick"],cx=["onClick"],dx=qt({__name:"import_tag",setup(e,{expose:t}){const{t:n}=Gt(),o=S(!1),a=S(""),r=S(""),s=S(""),u=S(""),p=S(""),m=S(""),f=S(""),g=S(""),x=S(""),b=S([]),k=S(-1),$=S(""),O=S(""),I=S(null),V=S(null),me=S(null),M=S(!1),z=S(""),ce=S(null);function P(){if(u.value.length<=0||p.value.length<=0){ue({type:"warn",str:"importDialog.pleaseFullRequest"});return}ce.value.click()}function le(){a.value="",r.value="",s.value="",u.value="",p.value="",m.value="",f.value="",g.value="",x.value="",b.value=[],k.value=-1,$.value="",O.value="",M.value=!1}function ie(C){const G=C.target.files[0];if(G){const de=new FileReader;de.onload=Se=>{const N=Se.target.result.split(`
|
||
`).filter(j=>j.trim());let T=0;N.forEach(j=>{const[ne,Pe]=j.split(",");if(ne&&Pe){const De=ne.trim().replace(/'/g,"''"),se=Pe.trim().replace(/'/g,"''"),Te=Ra();T=T+1;const qe=parseInt(new Date().getTime()/1e3,10)+T,et=`INSERT OR REPLACE INTO "tag_tags" ("text", "desc", "color", "create_time", "g_uuid", "t_uuid") VALUES ('${De}', '${se}', 'rgba(255, 123, 2, .4)', ${qe}, '${x.value}', '${Te}');`;b.value.push(et)}})},de.readAsText(G)}C.target.value=""}function Oe(C){const G=C.target.files[0];if(G){const de=new FileReader;de.onload=Se=>{try{const Le=JSON.parse(Se.target.result);let N=0;Object.entries(Le).forEach(([T,j])=>{const ne=T.replace(/'/g,"''"),Pe=j.replace(/'/g,"''"),De=Ra();N=N+1;const se=parseInt(new Date().getTime()/1e3,10)+N,Te=`INSERT OR REPLACE INTO "tag_tags" ("text", "desc", "color", "create_time", "g_uuid", "t_uuid") VALUES ('${ne}', '${Pe}', 'rgba(255, 123, 2, .4)', ${se}, '${x.value}', '${De}');`;b.value.push(Te)})}catch{ue({type:"warn",str:"message.jsonErrorMesg"})}},de.readAsText(G)}C.target.value=""}function Ae(C){const G=C.target.files[0];if(G){const de=new FileReader;de.onload=Se=>{try{const Le=ih.load(Se.target.result);let N=0;Object.entries(Le).forEach(([T,j])=>{const ne=T.replace(/'/g,"''"),Pe=String(j).replace(/'/g,"''"),De=Ra();N=N+1;const se=parseInt(new Date().getTime()/1e3,10)+N,Te=`INSERT OR REPLACE INTO "tag_tags" ("text", "desc", "color", "create_time", "g_uuid", "t_uuid") VALUES ('${ne}', '${Pe}', 'rgba(255, 123, 2, .4)', ${se}, '${x.value}', '${De}');`;b.value.push(Te)})}catch{ue({type:"warn",str:"message.yamlErrorMesg"})}},de.readAsText(G)}C.target.value=""}function fe(C){le();const G=C.target.files[0];if(G){const de=new FileReader;de.onload=Se=>{Se.target.result.split(";").filter(T=>T.trim()).forEach(T=>{if((T.includes("tag_groups")||T.includes("tag_subgroups"))&&T.includes("p_uuid"))if(T.includes("g_uuid")){p.value=`${T};`;const ne=T.split("VALUES")[1].trim().match(/,\s*'([^']+)'\)$/);ne&&(x.value=ne[1]);const Pe=T.match(/VALUES\s*\([^'"]*['"]([^'"]+)['"]/);Pe&&(f.value=Pe[1].replace(/''/g,"'"))}else{u.value=`${T};`;const ne=T.split("VALUES")[1].trim().match(/,\s*'([^']+)'\)$/);ne&&(g.value=ne[1]);const Pe=T.match(/VALUES\s*\([^'"]*['"]([^'"]+)['"]/);Pe&&(m.value=Pe[1].replace(/''/g,"'"))}else T.includes("tag_tags")&&b.value.push(`${T};`)})},de.readAsText(G)}C.target.value=""}function _e(){if(u.value.length<=0||p.value.length<=0){ue({type:"warn",str:"importDialog.pleaseFullRequest"});return}me.value.click()}function ae(){if(u.value.length<=0||p.value.length<=0){ue({type:"warn",str:"importDialog.pleaseFullRequest"});return}V.value.click()}function W(){I.value.click()}function re(){const C=[u.value,p.value,...b.value].join(`
|
||
`),G=new Blob([C],{type:"text/sql"}),de=document.createElement("a");if(de.href=URL.createObjectURL(G),z.value.length<=0){const Se=parseInt(new Date().getTime()/1e3,10);de.download=`export_${Se}.sql`}else de.download=`${z.value}.sql`;de.click()}const Q=()=>{const C=[...b.value].join(`
|
||
`),G=new Blob([C],{type:"text/sql"}),de=document.createElement("a");if(de.href=URL.createObjectURL(G),z.value.length<=0){const Se=parseInt(new Date().getTime()/1e3,10);de.download=`export_tags_${Se}.sql`}else de.download=`${z.value}.sql`;de.click()};function X(C){const G=C.match(/VALUES\s*\([^']*'([^']+)'/),de=C.match(/VALUES\s*\([^']*'[^']*'\s*,\s*'([^']+)'/);return{text:G?G[1].replace(/''/g,"'"):"",desc:de?de[1].replace(/''/g,"'"):""}}function ye(C){b.value.splice(C,1)}function pe(C){const G=b.value[C],de=X(G);$.value=de.text,O.value=de.desc,k.value=C}function Z(C){const G=$.value.replace(/'/g,"''"),de=O.value.replace(/'/g,"''");b.value[C]=b.value[C].replace(/(VALUES\s*\([^']*')([^']+)'/,`$1${G}'`).replace(/(VALUES\s*\([^']*'[^']*'\s*,\s*')([^']+)'/,`$1${de}'`),k.value=-1}function oe(){k.value=-1}function be(){if(!x.value){ue({type:"warn",str:"message.pleaseAddSub"});return}const C=a.value.replace(/'/g,"''"),G=r.value.replace(/'/g,"''"),de=Ra(),Se=parseInt(new Date().getTime()/1e3,10);s.value=`INSERT OR REPLACE INTO "tag_tags" ("text", "desc", "color", "create_time", "g_uuid", "t_uuid") VALUES ('${C}', '${G}', 'rgba(255, 123, 2, .4)', ${Se}, '${x.value}', '${de}');`,b.value.push(s.value)}function ve(){if(m.value.length<=0){ue({type:"warn",str:"importDialog.pleaseAddGroupName"});return}const C=m.value.replace(/'/g,"''");g.value.length<=0&&(g.value=Ra());const G=parseInt(new Date().getTime()/1e3,10);u.value=`INSERT OR REPLACE INTO "tag_groups" ("name", "color", "create_time", "p_uuid") VALUES ('${C}', 'rgba(255, 123, 2, .4)', ${G}, '${g.value}');`}function he(){if(f.value.length<=0){ue({type:"warn",str:"importDialog.pleaseAddSubGroupName"});return}if(!g.value){ue({type:"warn",str:"message.pleaseAddMainCeb"});return}const C=f.value.replace(/'/g,"''");x.value.length<=0&&(x.value=Ra());const G=parseInt(new Date().getTime()/1e3,10);p.value=`INSERT OR REPLACE INTO "tag_subgroups" ("name", "color", "create_time", "p_uuid", "g_uuid") VALUES ('${C}', 'rgba(255, 123, 2, .4)', ${G}, '${g.value}', '${x.value}');`}const te=S(null),K=()=>{te.value.open()},ee=C=>{M.value=!0,m.value=C.group.name,f.value=C.sub.name,g.value=C.group.p_uuid,x.value=C.sub.g_uuid;const G=C.group.name.replace(/'/g,"''"),de=C.sub.name.replace(/'/g,"''");u.value=`INSERT OR REPLACE INTO "tag_groups" ("name", "color", "create_time", "p_uuid") VALUES ('${G}', '${C.group.color}', ${C.group.create_time}, '${C.group.p_uuid}');`,p.value=`INSERT OR REPLACE INTO "tag_subgroups" ("name", "color", "create_time", "p_uuid", "g_uuid") VALUES ('${de}', '${C.sub.color}', ${C.sub.create_time}, '${C.group.p_uuid}', '${C.sub.g_uuid}');`},F=S(!1),J=async C=>{F.value=!0;try{await un.runSQLToServer(C).then(G=>{G.code!==200?ue({type:"warn",str:G.message}):(Y(),ue({type:"success",str:"importDialog.successImport"}))}).catch(G=>{console.error(G),ue({type:"warn",str:"importDialog.importFail"})})}catch(G){console.error(G),ue({type:"warn",str:"importDialog.importFail"})}finally{F.value=!1}},Y=()=>{window.postMessage({type:"weilin_prompt_ui_tag_manager_refresh"},"*")},L=async()=>{if(M.value){if(u.value.length<=0||p.value.length<=0){ue({type:"warn",str:"importDialog.pleaseFullRequest"});return}const C=[...b.value];await J(C)}else{if(u.value.length<=0||p.value.length<=0){ue({type:"warn",str:"importDialog.pleaseFullRequest"});return}const C=[u.value,p.value,...b.value];await J(C)}};return At(u,(C,G)=>{var Le,N;if(!C||C===G)return;const de=(Le=C.match(/'([^']+)'\s*\)\s*;?$/))==null?void 0:Le[1],Se=(N=G==null?void 0:G.match(/'([^']+)'\s*\)\s*;?$/))==null?void 0:N[1];de&&Se&&p.value&&(p.value=p.value.replace(new RegExp(`'${Se}'`,"g"),`'${de}'`))}),At(p,(C,G)=>{var Le,N;if(!C||C===G)return;const de=(Le=C.match(/'([^']+)'\s*\)\s*;?$/))==null?void 0:Le[1],Se=(N=G==null?void 0:G.match(/'([^']+)'\s*\)\s*;?$/))==null?void 0:N[1];de&&Se&&b.value.length>0&&(b.value=b.value.map(T=>T.replace(new RegExp(`'${Se}'`,"g"),`'${de}'`)))}),t({open:()=>{o.value=!0}}),(C,G)=>(E(),D(Ke,null,[F.value?(E(),D("div",D6,G[11]||(G[11]=[i("div",{class:"loading-spinner"},null,-1)]))):Ce("",!0),it(Nr,{modelValue:o.value,"onUpdate:modelValue":G[10]||(G[10]=de=>o.value=de),title:v(n)("importDialog.title")},{footer:Pt(()=>[i("button",{onClick:G[9]||(G[9]=de=>o.value=!1)},y(v(n)("promptBox.settings.close")),1),i("button",{onClick:L},y(v(n)("importDialog.sure")),1)]),default:Pt(()=>[i("div",O6,[i("div",R6,[i("div",P6,[i("span",N6,y(v(n)("importDialog.tips1")),1),i("a",F6,y(v(n)("importDialog.tips1text")),1)]),i("div",B6,[i("span",U6,y(v(n)("importDialog.tips2")),1),i("a",z6,y(v(n)("importDialog.tips2text")),1)]),i("div",V6,[i("span",W6,y(v(n)("importDialog.tips3")),1),i("a",j6,y(v(n)("importDialog.tips3text")),1)])]),i("div",H6,[i("button",{onClick:le,class:"upload-btn"},y(v(n)("importDialog.cleanAll")),1),i("button",{style:{"margin-left":"10px"},onClick:W,class:"upload-btn"},y(v(n)("importDialog.uploadSQL")),1),i("button",{style:{"margin-left":"10px"},onClick:K},y(v(n)("importDialog.selectGroup")),1),i("button",{style:{"margin-left":"10px"},onClick:re},y(v(n)("importDialog.dumpSQL")),1),i("button",{style:{"margin-left":"10px"},onClick:Q},y(v(n)("importDialog.dumpOnlySQL")),1),$e(i("input",{style:{width:"300px","margin-left":"10px"},"onUpdate:modelValue":G[0]||(G[0]=de=>z.value=de),placeholder:v(n)("importDialog.settingOutputName")},null,8,G6),[[ze,z.value]]),i("input",{type:"file",ref_key:"fileInput",ref:I,onChange:fe,accept:".sql",style:{display:"none"}},null,544),i("input",{type:"file",ref_key:"jsonFileInput",ref:V,onChange:Oe,accept:".json",style:{display:"none"}},null,544),i("input",{type:"file",ref_key:"txtFileInput",ref:me,onChange:ie,accept:".txt",style:{display:"none"}},null,544),i("input",{type:"file",ref_key:"yamlFileInput",ref:ce,onChange:Ae,accept:".yaml,.yml",style:{display:"none"}},null,544)]),i("div",q6,[$e(i("input",{"onUpdate:modelValue":G[1]||(G[1]=de=>m.value=de),placeholder:v(n)("importDialog.pleaseMainCeb")},null,8,Y6),[[ze,m.value]]),i("button",{onClick:ve},y(v(n)("importDialog.setMainCeb")),1),$e(i("input",{style:{width:"300px","margin-left":"10px"},"onUpdate:modelValue":G[2]||(G[2]=de=>g.value=de),placeholder:v(n)("importDialog.pleaseMainCebUuid")},null,8,K6),[[ze,g.value]])]),i("div",J6,[$e(i("input",{"onUpdate:modelValue":G[3]||(G[3]=de=>f.value=de),placeholder:v(n)("importDialog.pleaseSubGroup")},null,8,X6),[[ze,f.value]]),i("button",{onClick:he},y(v(n)("importDialog.setSubCeb")),1),$e(i("input",{style:{width:"300px","margin-left":"10px"},"onUpdate:modelValue":G[4]||(G[4]=de=>x.value=de),placeholder:v(n)("importDialog.pleaseSubGroupUuid")},null,8,Q6),[[ze,x.value]])]),i("div",Z6,[$e(i("input",{"onUpdate:modelValue":G[5]||(G[5]=de=>a.value=de),placeholder:"Tag"},null,512),[[ze,a.value]]),$e(i("input",{"onUpdate:modelValue":G[6]||(G[6]=de=>r.value=de),placeholder:v(n)("importDialog.translater")},null,8,ex),[[ze,r.value]]),i("button",{onClick:be},y(v(n)("importDialog.add")),1),i("button",{style:{"margin-left":"10px"},onClick:ae,class:"upload-btn"},y(v(n)("importDialog.fromJSONImput")),1),i("button",{style:{"margin-left":"10px"},onClick:_e,class:"upload-btn"},y(v(n)("importDialog.fromTxtInput")),1),i("button",{style:{"margin-left":"10px"},onClick:P,class:"upload-btn"},y(v(n)("importDialog.fromYmalInput")),1)]),i("div",tx,[u.value?(E(),D("div",nx,[i("h3",null,y(X(u.value).text),1),p.value?(E(),D("div",ox,[i("h4",null,y(X(p.value).text),1),i("div",ax,[(E(!0),D(Ke,null,lt(b.value,(de,Se)=>(E(),D("div",{key:Se,style:{display:"flex","flex-direction":"column","align-items":"center"}},[i("p",null,y(X(de).text)+" - "+y(X(de).desc),1),i("div",rx,[k.value===Se?(E(),D("div",ix,[$e(i("input",{"onUpdate:modelValue":G[7]||(G[7]=Le=>$.value=Le),placeholder:"Tag"},null,512),[[ze,$.value]]),$e(i("input",{"onUpdate:modelValue":G[8]||(G[8]=Le=>O.value=Le),placeholder:v(n)("importDialog.translater")},null,8,sx),[[ze,O.value]]),i("button",{onClick:Le=>Z(Se)},y(v(n)("importDialog.sureYes")),9,lx),i("button",{style:{"margin-left":"10px"},onClick:oe},y(v(n)("importDialog.cancel")),1)])):(E(),D("button",{key:1,onClick:Le=>pe(Se)},y(v(n)("importDialog.edit")),9,ux)),i("button",{style:{"margin-left":"10px"},onClick:Le=>ye(Se)},y(v(n)("importDialog.delete")),9,cx)])]))),128))])])):Ce("",!0)])):Ce("",!0)])])]),_:1},8,["modelValue","title"]),it(om,{ref_key:"tagGroupSelectDialogItem",ref:te,onSureSelect:ee},null,512)],64))}},[["__scopeId","data-v-9427256d"]]),px={class:"tag-manager"},fx={class:"toolbar"},gx={class:"toolbar-top"},mx={class:"search-container"},hx=["placeholder"],vx={key:0,class:"no-results"},_x=["onClick"],yx={class:"result-content"},bx={class:"result-text"},wx={class:"result-path"},xx={class:"toolbar-bottom"},Sx={class:"auto-add-checkbox"},Tx={class:"category-tabs"},kx={class:"tabs-wrapper primary-tabs"},Cx={class:"tabs-scroll"},Ex=["onClick","onMouseenter","onMouseleave"],$x={class:"tab-text"},Lx={key:0,class:"tab-actions"},Ax=["onClick","title"],Mx=["onClick","title"],Ix=["onClick","title"],Dx=["onClick","title"],Ox={class:"group-edit-mode"},Rx={key:0,class:"tabs-wrapper group-tabs"},Px={class:"tabs-scroll"},Nx=["onClick","onMouseenter","onMouseleave"],Fx={class:"tab-text"},Bx={key:0,class:"tab-actions"},Ux=["onClick","title"],zx=["onClick","title"],Vx=["onClick","title"],Wx=["onClick","title"],jx={class:"group-edit-mode"},Hx={class:"tags-content"},Gx={class:"tags-header"},qx={class:"tags-title"},Yx={class:"tags-actions"},Kx=["disabled"],Jx=["disabled"],Xx=["disabled"],Qx=["disabled"],Zx=["disabled"],e8={key:0,class:"tags-grid"},t8=["onClick"],n8={class:"tag-actions"},o8=["onClick","title"],a8=["onClick","title"],r8=["onClick","title"],i8={class:"tag-desc"},s8=["value"],l8={key:0,class:"weilin-tools-dialog-overlay"},u8={class:"weilin-tools-dialog-header"},c8={class:"weilin-tools-dialog-body"},d8={key:0,class:"form-group"},p8=["placeholder"],f8={key:1,class:"form-group"},g8=["placeholder"],m8={class:"form-group"},h8={class:"color-picker"},v8={class:"color-controls"},_8={class:"alpha-control"},y8={class:"alpha-value"},b8={class:"weilin-tools-dialog-footer"},w8={key:1,class:"weilin-tools-dialog-overlay"},x8={class:"weilin-tools-dialog-header"},S8={class:"weilin-tools-dialog-body"},T8={class:"form-group"},k8=["placeholder"],C8={class:"form-group"},E8=["placeholder"],$8={class:"form-group"},L8={class:"color-picker"},A8={class:"color-controls"},M8={class:"alpha-control"},I8={class:"alpha-value"},D8={class:"weilin-tools-dialog-footer"},O8={key:2,class:"weilin-tools-dialog-overlay"},R8={class:"weilin-tools-dialog-header"},P8={class:"weilin-tools-dialog-body"},N8={class:"confirm-message"},F8={class:"weilin-tools-dialog-footer"},B8={key:3,class:"weilin-tools-dialog-overlay"},U8={class:"weilin-tools-dialog-content"},z8={class:"weilin-tools-dialog-header"},V8={class:"weilin-tools-dialog-body"},W8={class:"form-group"},j8=["value"],H8={class:"form-group"},G8={class:"radio-group"},q8={class:"weilin-tools-dialog-footer"},Y8={key:4,class:"weilin-tools-dialog-overlay"},K8={class:"weilin-tools-dialog-content"},J8={class:"weilin-tools-dialog-header"},X8={class:"weilin-tools-dialog-body"},Q8={class:"form-group"},Z8=["value"],e7={class:"form-group"},t7={class:"radio-group"},n7={class:"weilin-tools-dialog-footer"},o7={key:5,class:"weilin-tools-dialog-overlay"},a7={class:"weilin-tools-dialog-header"},r7={class:"weilin-tools-dialog-body"},i7={class:"config-section"},s7={class:"form-group"},l7={class:"width-control"},u7={class:"radio-label"},c7={class:"radio-label"},d7={class:"form-group"},p7={class:"form-group"},f7={class:"config-section"},g7={class:"form-group"},m7={class:"width-control"},h7={class:"radio-label"},v7={class:"radio-label"},_7={class:"form-group"},y7={class:"form-group"},b7={class:"weilin-tools-dialog-footer"},sh=qt({__name:"tag_index",props:{tagManager:{type:String,default:"prompt"}},setup(e){Xu();const{t}=Gt(),n=S([]),o=S(null),a=S([]),r=S([]),s=S(null),u=S(!1),p=S(!1),m=S(!1),f=S(!1),g=S("primary"),x=S([]),b=S(!1),k=S(!1),$=S("None"),O=S("None"),I=S(0),V=S(0),me=S(null),M=S(0),z=S(!1),ce=S(null),P=S("before"),le=S(null),ie=S("before"),Oe=S(null),Ae=S(null),fe=S(!1),_e=S(!1),ae=S(!1),W=S({primaryTab:{width:"fit-content",height:34,fontSize:10},groupTab:{width:"fit-content",height:34,fontSize:10}}),re={primaryTab:{width:"fit-content",height:34,fontSize:10},groupTab:{width:"fit-content",height:34,fontSize:10}},Q=e,X=S({name:"",color:"rgba(255, 123, 2, .4)",id_index:"",groups:[]}),ye=S({name:"",id_index:"",color:"rgba(255, 123, 2, .4)",tags:[]}),pe=S({text:"",desc:"",id_index:"",color:"rgba(255, 123, 2, .4)"}),Z=Ee=>{const ke=Ee.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*([0-9.]+))?\)/);if(ke){const[,Re,ht,rn,cn]=ke,Dt=`#${((1<<24)+(parseInt(Re)<<16)+(parseInt(ht)<<8)+parseInt(rn)).toString(16).slice(1)}`,sn=cn?Math.round(parseFloat(cn)*100):100;return{hex:Dt,alpha:sn}}return{hex:"#FFFFFF",alpha:100}},oe=()=>{window.postMessage({type:"weilin_prompt_ui_tag_manager_refresh"},"*")},be=async()=>{try{await un.getTagMainGroup().then(Ee=>{n.value=Ee}).catch(Ee=>{console.error(Ee),ue({type:"warn",str:"message.networkError"})}),o.value&&await ve(o.value.p_uuid),s.value&&await he(s.value.g_uuid)}catch(Ee){console.error("Tag管理器列表失败:",Ee)}},ve=async Ee=>{try{await un.getTagSubGroup(Ee).then(ke=>{a.value=ke}).catch(ke=>{console.error(ke),ue({type:"warn",str:"message.networkError"})})}catch(ke){console.error("二级分类列表失败:",ke)}},he=async Ee=>{try{await un.getTagList(Ee).then(ke=>{r.value=ke}).catch(ke=>{console.error(ke),ue({type:"warn",str:"message.networkError"})})}catch(ke){console.error("Tag列表失败:",ke)}};Ut(()=>{en(),window.addEventListener("click",Ao),window.addEventListener("resize",en),window.addEventListener("message",ro),window.addEventListener("keydown",Bn),Jr(),oe()}),Ta(()=>{window.removeEventListener("click",Ao),window.removeEventListener("resize",en),window.removeEventListener("message",ro),window.removeEventListener("keydown",Bn)});const te=async Ee=>{o.value=Ee,s.value=null,b.value=!1,x.value=[],await ve(Ee.p_uuid)},K=async Ee=>{s.value=Ee,b.value=!1,x.value=[],await he(Ee.g_uuid)},ee=Ee=>{g.value=Ee,m.value=!1,N.value=Z("rgba(255, 123, 2, .4)"),Ee==="primary"?X.value={name:"",color:"rgba(255, 123, 2, .4)",groups:[]}:ye.value={name:"",color:"rgba(255, 123, 2, .4)",tags:[]},u.value=!0},F=Ee=>{m.value=!0,g.value="primary",X.value={...Ee},N.value=Z(Ee.color),u.value=!0},J=Ee=>{m.value=!0,g.value="group",ye.value={...Ee},N.value=Z(Ee.color),u.value=!0},Y=()=>{if(g.value==="primary"){if(!X.value.name){ue({type:"warn",str:"tagManager.categoryNameRequired"});return}m.value?n.value.findIndex(ke=>ke.id_index===X.value.id_index)!==-1&&un.editPrimaryCategory({id_index:X.value.id_index,name:X.value.name,color:X.value.color}).then(ke=>{ke.code===200?(oe(),ue({type:"success",str:"message.editSuccess"})):ke.code===201?ue({type:"error",str:"message.editNameExist"}):ue({type:"error",str:"message.editFailed"})}).catch(ke=>{ue({type:"warn",str:"message.networkError"})}):un.addPrimaryCategory({name:X.value.name,color:X.value.color}).then(Ee=>{Ee.code===200?(oe(),ue({type:"success",str:"message.addSuccess"})):Ee.code===201?ue({type:"error",str:"message.editNameExist"}):ue({type:"error",str:"message.addFailed"})}).catch(Ee=>{ue({type:"warn",str:"message.networkError"})})}else{if(!ye.value.name){ue({type:"warn",str:"tagManager.groupNameRequired"});return}m.value?un.editSubCategory({id_index:ye.value.id_index,name:ye.value.name,color:ye.value.color}).then(Ee=>{Ee.code===200?(oe(),ue({type:"success",str:"message.editSuccess"})):Ee.code===201?ue({type:"error",str:"message.editNameExist"}):ue({type:"error",str:"message.editFailed"})}).catch(Ee=>{ue({type:"warn",str:"message.networkError"})}):un.addSubCategory({name:ye.value.name,color:ye.value.color,key:o.value.id_index,p_uuid:o.value.p_uuid}).then(Ee=>{Ee.code===200?(oe(),ue({type:"success",str:"message.addSuccess"})):Ee.code===201?ue({type:"error",str:"message.editNameExist"}):ue({type:"error",str:"message.editFailed"})}).catch(Ee=>{ue({type:"warn",str:"message.networkError"})})}C()},L=()=>m.value?g.value==="primary"?t("tagManager.editPrimaryCategory"):t("tagManager.editSubCategory"):g.value==="primary"?t("tagManager.addPrimaryCategory"):t("tagManager.addSubCategory"),C=()=>{u.value=!1,X.value={id:"",name:"",parentId:null,subCategories:[],backgroundColor:"transparent"},N.value={hex:"#FFFFFF",alpha:0}},G=()=>{s.value&&(f.value=!1,pe.value={id:"",text:"",desc:"",categoryId:s.value.id,g_uuid:s.value.g_uuid,backgroundColor:ye.value.color},N.value=Z(ye.value.color),p.value=!0)},de=Ee=>{f.value=!0,pe.value={...Ee},N.value=Z(Ee.color),p.value=!0},Se=()=>{if(!pe.value.text||!pe.value.desc){ue({type:"warn",str:"tagManager.textRequired"});return}f.value&&s.value?un.editTags({id_index:pe.value.id_index,text:pe.value.text,desc:pe.value.desc,color:pe.value.color}).then(Ee=>{oe(),window.postMessage({type:"weilin_prompt_ui_refresh_all_data"},"*"),ue({type:"success",str:"message.editSuccess"})}).catch(Ee=>{ue({type:"warn",str:"message.networkError"})}):s.value&&un.addNewTags({id_index:s.value.id_index,g_uuid:s.value.g_uuid,text:pe.value.text,desc:pe.value.desc,color:pe.value.color?pe.value.color:"rgba(255, 123, 2, .4)"}).then(Ee=>{oe(),window.postMessage({type:"weilin_prompt_ui_refresh_all_data"},"*"),ue({type:"success",str:"message.addSuccess"})}).catch(Ee=>{ue({type:"warn",str:"message.networkError"})}),Le()},Le=()=>{p.value=!1,pe.value={text:"",desc:"",color:"rgba(255, 123, 2, .4)"},f.value=!1},N=S({hex:"#FFFFFF",alpha:100}),T=Ht(()=>ne(N.value.hex,N.value.alpha)),j=()=>{const Ee=ne(N.value.hex,N.value.alpha);u.value?g.value==="primary"?X.value.color=Ee:ye.value.color=Ee:p.value&&(pe.value.color=Ee)},ne=(Ee,ke)=>{const Re=parseInt(Ee.slice(1,3),16),ht=parseInt(Ee.slice(3,5),16),rn=parseInt(Ee.slice(5,7),16);return`rgba(${Re}, ${ht}, ${rn}, ${ke/100})`},Pe=S(""),De=S([]),se=S(!1),Te=async()=>{se.value=Pe.value.trim().length>0;const Ee=Pe.value.trim().toLowerCase();if(!Ee){De.value=[];return}De.value=[],await un.searchTag(Ee).then(ke=>{De.value=ke}).catch(ke=>{ue({type:"warn",str:"message.networkError"})})};At(Pe,()=>{Te()});const qe=async Ee=>{const ke=n.value.find(Re=>Re.p_uuid===Ee.p_uuid);ke&&await te(ke).then(async()=>{await vt(async()=>{const Re=a.value.find(ht=>ht.g_uuid===Ee.g_uuid);Re&&await K(Re).then(async()=>{await vt(()=>{M.value==1&&window.postMessage({type:"weilin_prompt_ui_insertTag",tagText:Ee.text},"*"),me.value=Ee.id_index,setTimeout(()=>{const ht=document.querySelector(".tag-wrapper.highlight");ht&&ht.scrollIntoView({behavior:"smooth",block:"center"})},100),setTimeout(()=>{me.value=null},5e3)})})})}),Pe.value=""},et=Ee=>{if(!Ee||Ee==="transparent")return"var(--primary-text)";let ke,Re,ht,rn=1;if(Ee.startsWith("rgba")){const Dt=Ee.match(/rgba\((\d+),\s*(\d+),\s*(\d+),\s*([\d.]+)\)/);Dt&&([,ke,Re,ht,rn]=Dt.map(Number))}else if(Ee.startsWith("rgb")){const Dt=Ee.match(/rgb\((\d+),\s*(\d+),\s*(\d+)\)/);Dt&&([,ke,Re,ht]=Dt.map(Number))}return rn<.5?"var(--primary-text)":(ke*299+Re*587+ht*114)/1e3>128?"#000000":"#ffffff"},ot=Ee=>{Q.tagManager==="prompt"&&window.postMessage({type:"weilin_prompt_ui_insertTag",tagText:Ee.text},"*")},ft=S(!1),bt=S(""),Mt=S(null),Vt=Ht(()=>{if(!Mt.value)return"";switch(bt.value){case"category":return t("tagManager.deletePrimaryCategoryConfirm",{name:Mt.value.name});case"group":return t("tagManager.deleteGroupConfirm",{name:Mt.value.name});case"tag":return t("tagManager.deleteTagConfirm",{name:Mt.value.text});case"deleteSelected":return t("tagManager.confirmDeleteSelected");default:return""}}),An=Ee=>{bt.value="category",Mt.value=Ee,ft.value=!0},ao=Ee=>{bt.value="group",Mt.value=Ee,ft.value=!0},an=Ee=>{bt.value="tag",Mt.value=Ee,ft.value=!0},hn=async()=>{try{switch(bt.value){case"category":un.deletePrimaryCategory({p_uuid:Mt.value.p_uuid}).then(Ee=>{oe(),ue({type:"success",str:"message.deleteSuccess"})}).catch(Ee=>{ue({type:"warn",str:"message.networkError"})});break;case"group":un.deleteSubCategory({g_uuid:Mt.value.g_uuid}).then(Ee=>{oe(),ue({type:"success",str:"message.deleteSuccess"})}).catch(Ee=>{ue({type:"warn",str:"message.networkError"})});break;case"tag":un.deleteTags({id_index:Mt.value.id_index}).then(Ee=>{oe(),window.postMessage({type:"weilin_prompt_ui_refresh_all_data"},"*"),ue({type:"success",str:"message.deleteSuccess"})}).catch(Ee=>{ue({type:"warn",str:"message.networkError"})});break;case"deleteSelected":un.batchDeleteTags({id_indexs:x.value}).then(Ee=>{oe(),window.postMessage({type:"weilin_prompt_ui_refresh_all_data"},"*"),ue({type:"success",str:"message.deleteSuccess"})}).catch(Ee=>{ue({type:"warn",str:"message.networkError"})});break}za()}catch(Ee){console.error("删除失败:",Ee)}},Jn=async Ee=>{const ke=`INSERT OR REPLACE INTO "tag_groups" ("name", "color", "create_time", "p_uuid") VALUES ('${Ee.name.replace(/'/g,"''")}', '${Ee.color}', ${Ee.create_time}, '${Ee.p_uuid}');`;try{const Re=await un.getTagSubGroup(Ee.p_uuid);let ht=[];ht.push(ke);for(const Dt of Re){const sn=`INSERT OR REPLACE INTO "tag_subgroups" ("name", "color", "create_time", "p_uuid", "g_uuid") VALUES ('${Dt.name.replace(/'/g,"''")}', '${Dt.color}', ${Dt.create_time}, '${Dt.p_uuid}', '${Dt.g_uuid}');`;ht.push(sn);try{(await un.getTagList(Dt.g_uuid)).forEach(Un=>{const pr=`INSERT OR REPLACE INTO "tag_tags" ("text", "desc", "color", "create_time", "g_uuid", "t_uuid") VALUES ('${Un.text!=null&&Un.text.length>0?Un.text.replace(/'/g,"''"):""}', '${Un.desc!=null&&Un.desc.length>0?Un.desc.replace(/'/g,"''"):""}', '${Un.color}', ${Un.create_time}, '${Un.g_uuid}', '${Ra()}');`;ht.push(pr)})}catch(dr){console.error("Tag列表失败:",dr),ue({type:"warn",str:"message.shareTagError"})}}const rn=new Blob([ht.join(`
|
||
`)],{type:"text/sql"}),cn=document.createElement("a");cn.href=URL.createObjectURL(rn),cn.download=`${Ee.name}_export_${Date.now()}.sql`,cn.click(),ue({type:"success",str:"tagManager.outputSuccess"})}catch(Re){console.error("二级分类列表失败:",Re),ue({type:"warn",str:"message.shareGroupError"})}},wo=async Ee=>{try{let ke=[];const Re=`INSERT OR REPLACE INTO "tag_subgroups" ("name", "color", "create_time", "p_uuid", "g_uuid") VALUES ('${Ee.name.replace(/'/g,"''")}', '${Ee.color}', ${Ee.create_time}, '${Ee.p_uuid}', '${Ee.g_uuid}');`;ke.push(Re);try{(await un.getTagList(Ee.g_uuid)).forEach(Dt=>{const sn=`INSERT OR REPLACE INTO "tag_tags" ("text", "desc", "color", "create_time", "g_uuid", "t_uuid") VALUES ('${Dt.text!=null&&Dt.text.length>0?Dt.text.replace(/'/g,"''"):""}', '${Dt.desc!=null&&Dt.desc.length>0?Dt.desc.replace(/'/g,"''"):""}', '${Dt.color}', ${Dt.create_time}, '${Dt.g_uuid}', '${Ra()}');`;ke.push(sn)})}catch(cn){console.error("Tag列表失败:",cn),ue({type:"warn",str:"message.shareTagError"})}const ht=new Blob([ke.join(`
|
||
`)],{type:"text/sql"}),rn=document.createElement("a");rn.href=URL.createObjectURL(ht),rn.download=`${Ee.name}_export_${Date.now()}.sql`,rn.click(),ue({type:"success",str:"tagManager.outputSuccess"})}catch(ke){console.error("二级分类列表失败:",ke),ue({type:"warn",str:"message.shareGroupError"})}},dt=Ee=>{le.value=Ee.id_index,z.value=!0},Ne=async()=>{try{un.moveTag({id_index:le.value,reference_id_index:ce.value,position:P.value}).then(Ee=>{oe(),z.value=!1,ue({type:"success",str:t("message.moveSuccess")})}).catch(Ee=>{ue({type:"error",str:t("message.moveFailed")})})}catch(Ee){console.error("移动标签失败:",Ee),ue({type:"error",str:t("message.moveFailed")})}},Ue=S([]),Ot=S(1),En=(Ee,ke)=>{Ot.value=ke,ke===1?(Ue.value=n.value,Oe.value=Ee.id_index,k.value=!0):(Ue.value=a.value,Oe.value=Ee.id_index,k.value=!0)},Ba=async()=>{if(Ot.value===1)try{un.moveMainGroup({id_index:Oe.value,reference_id_index:Ae.value,position:ie.value}).then(Ee=>{oe(),k.value=!1,ue({type:"success",str:t("message.moveSuccess")})}).catch(Ee=>{ue({type:"error",str:t("message.moveFailed")})})}catch(Ee){console.error("移动标签失败:",Ee),ue({type:"error",str:t("message.moveFailed")})}else try{un.moveSubGroup({id_index:Oe.value,reference_id_index:Ae.value,position:ie.value}).then(Ee=>{oe(),k.value=!1,ue({type:"success",str:t("message.moveSuccess")})}).catch(Ee=>{ue({type:"error",str:t("message.moveFailed")})})}catch(Ee){console.error("移动标签失败:",Ee),ue({type:"error",str:t("message.moveFailed")})}},pa=()=>{b.value=!0,fe.value=!0},Ua=()=>{b.value=!1,fe.value=!1,x.value=[]},qr=()=>{x.value.length!==0&&(bt.value="deleteSelected",Mt.value={},ft.value=!0)},qi=()=>{b.value=!0,_e.value=!0},fa=()=>{b.value=!1,_e.value=!1,x.value=[]},Vo=()=>{if(x.value.length===0){ue({type:"warn",str:"tagManager.noTagsSelected"});return}const Ee={};x.value.forEach(ht=>{Ee[ht.text]=ht.desc});const ke=new Blob([ih.dump(Ee)],{type:"text/yaml"}),Re=document.createElement("a");Re.href=URL.createObjectURL(ke),Re.download=`selected_tags_export_${Date.now()}.yaml`,Re.click(),ue({type:"success",str:"tagManager.outputSuccess"}),fa()},za=()=>{ft.value=!1,bt.value="",Mt.value=null},Yr=async()=>{try{await oe()}catch(Ee){console.error("刷新标签列表失败:",Ee)}},xo=S(),Fn=S({}),en=()=>{if(xo.value){const Ee=xo.value.getBoundingClientRect();Fn.value={position:"fixed",top:`${Ee.bottom}px`,left:`${Ee.left}px`,width:`${Ee.width}px`,zIndex:1e3}}},ro=Ee=>{Ee.data.type==="weilin_prompt_ui_window_change_tagManager_position"||Ee.data.type==="weilin_prompt_ui_window_change_tagManager_size"||Ee.data.type==="weilin_prompt_ui_window_change_tagManager_scroll"||Ee.data.type==="weilin_prompt_ui_window_change_promptBox_position"||Ee.data.type==="weilin_prompt_ui_window_change_promptBox_size"||Ee.data.type==="weilin_prompt_ui_window_change_promptBox_scroll"?en():Ee.data.type==="weilin_prompt_ui_window_change_click_outside"||Ee.data.type==="weilin_prompt_ui_tag_manager_refresh"&&be()},Ao=Ee=>{se.value&&!xo.value.contains(Ee.target)&&(se.value=!1)},Bn=Ee=>{Ee.key==="Escape"&&(se.value=!1)},Wo=Ee=>{V.value==1&&($.value="TabID-"+Ee)},io=Ee=>{$.value="None"},ct=Ee=>{I.value==1&&(O.value="TabID-"+Ee)},So=Ee=>{O.value="None"},jo=S(),Kr=()=>{jo.value.open()},Jr=()=>{const Ee=JSON.parse(JSON.stringify(re));try{const ke=localStorage.getItem("weilin_tag_manager_tab_size_config");if(ke){const Re=JSON.parse(ke);W.value={...Ee,...Re}}else W.value={...Ee}}catch(ke){console.error("读取标签尺寸配置失败:",ke),W.value={...Ee}}},ga=()=>{try{localStorage.setItem("weilin_tag_manager_tab_size_config",JSON.stringify(W.value)),ue({type:"success",str:"tagManager.tabSizeConfigSaved"}),ae.value=!1}catch(Ee){console.error("保存标签尺寸配置失败:",Ee),ue({type:"error",str:"tagManager.tabSizeConfigSaveFailed"})}},ur=()=>{ae.value=!0},cr=()=>{ae.value=!1,Jr()},Yi=()=>{const Ee=JSON.parse(JSON.stringify(re));W.value={...Ee}};return(Ee,ke)=>(E(),D("div",px,[i("div",fx,[i("div",gx,[i("button",{class:"refresh-btn",onClick:Yr},ke[40]||(ke[40]=[i("svg",{viewBox:"0 0 24 24",width:"16",height:"16",class:"refresh-icon"},[i("path",{d:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z"})],-1)])),i("div",mx,[$e(i("input",{type:"text","onUpdate:modelValue":ke[0]||(ke[0]=Re=>Pe.value=Re),placeholder:v(t)("tagManager.searchPlaceholder"),class:"search-input",ref_key:"searchInput",ref:xo,onInput:ke[1]||(ke[1]=Re=>se.value=Pe.value.trim().length>0)},null,40,hx),[[ze,Pe.value]]),se.value?(E(),D("div",{key:0,class:"search-results",style:Bt(Fn.value)},[De.value.length===0?(E(),D("div",vx,y(v(t)("tagManager.noResults")),1)):(E(!0),D(Ke,{key:1},lt(De.value,(Re,ht)=>(E(),D("div",{key:`${ht}-search_item`,class:"search-result-item",onClick:rn=>qe(Re)},[i("div",yx,[i("span",bx,y(Re.name||Re.text),1),i("span",wx,y(Re.where),1)])],8,_x))),128))],4)):Ce("",!0)]),i("button",{class:"import-btn",onClick:Kr},y(v(t)("tagManager.importTags")),1)]),i("div",xx,[i("div",Sx,[i("label",null,[$e(i("input",{type:"checkbox","onUpdate:modelValue":ke[2]||(ke[2]=Re=>M.value=Re),"true-value":1,"false-value":0},null,512),[[nn,M.value]]),ut(" "+y(v(t)("tagManager.autoAddSearchTag")),1)])]),i("button",{class:"tab-size-btn",onClick:ur},y(v(t)("tagManager.modifyTabSize")),1)])]),i("div",Tx,[i("div",kx,[i("div",Cx,[(E(!0),D(Ke,null,lt(n.value,(Re,ht)=>{var rn,cn,Dt;return E(),D("div",{key:"Tabss-"+ht,class:We(["tab-item",{active:((rn=o.value)==null?void 0:rn.name)===Re.name}]),style:Bt({backgroundColor:((cn=o.value)==null?void 0:cn.name)===Re.name?"var(--primary-color)":Re.color,color:((Dt=o.value)==null?void 0:Dt.name)===Re.name?"#ffffff":et(Re.color),width:W.value.primaryTab.width==="fit-content"?"fit-content":W.value.primaryTab.width+"px",height:W.value.primaryTab.height+"px",fontSize:W.value.primaryTab.fontSize+"px"}),onClick:sn=>te(Re),onMouseenter:sn=>Wo(ht),onMouseleave:sn=>io()},[i("span",$x,y(Re.name),1),$.value=="TabID-"+ht?(E(),D("div",Lx,[i("button",{class:"action-btn move",onClick:Tt(sn=>En(Re,1),["stop"]),title:v(t)("tagManager.moveGroup")},ke[41]||(ke[41]=[i("svg",{viewBox:"0 0 24 24",class:"move-icon"},[i("path",{d:"M13 6v3h8V6h-8zm0 5v3h8v-3h-8zm-8 5v3h8v-3H5zm0-5v3h8v-3H5zm0-5v3h8V6H5z"})],-1)]),8,Ax),i("button",{class:"action-btn edit",onClick:Tt(sn=>F(Re),["stop"]),title:v(t)("tagManager.edit")},ke[42]||(ke[42]=[i("svg",{viewBox:"0 0 24 24",class:"action-icon"},[i("path",{d:"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"})],-1)]),8,Mx),i("button",{class:"action-btn share",onClick:Tt(sn=>Jn(Re),["stop"]),title:v(t)("tagManager.share")},ke[43]||(ke[43]=[i("svg",{viewBox:"0 0 24 24",class:"action-icon"},[i("path",{d:"M18 16.08c-.76 0-1.44.3-1.96.77L8.91 12.7c.05-.23.09-.46.09-.7s-.04-.47-.09-.7l7.05-4.11c.54.5 1.25.81 2.04.81 1.66 0 3-1.34 3-3s-1.34-3-3-3-3 1.34-3 3c0 .24.04.47.09.7L8.04 9.81C7.5 9.31 6.79 9 6 9c-1.66 0-3 1.34-3 3s1.34 3 3 3c.79 0 1.5-.31 2.04-.81l7.12 4.16c-.05.21-.08.43-.08.65 0 1.61 1.31 2.92 2.92 2.92 1.61 0 2.92-1.31 2.92-2.92s-1.31-2.92-2.92-2.92z"})],-1)]),8,Ix),i("button",{class:"action-btn delete",onClick:Tt(sn=>An(Re),["stop"]),title:v(t)("tagManager.delete")},ke[44]||(ke[44]=[i("svg",{viewBox:"0 0 24 24",class:"action-icon"},[i("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"})],-1)]),8,Dx)])):Ce("",!0)],46,Ex)}),128)),i("button",{class:"add-tab",onClick:ke[3]||(ke[3]=Re=>ee("primary"))},[ke[45]||(ke[45]=i("span",{class:"plus-icon"},"+",-1)),ut(" "+y(v(t)("tagManager.addPrimaryCategory")),1)]),i("div",Ox,[i("label",null,[$e(i("input",{type:"checkbox","onUpdate:modelValue":ke[4]||(ke[4]=Re=>V.value=Re),"true-value":1,"false-value":0},null,512),[[nn,V.value]]),ut(" "+y(V.value==1?v(t)("tagManager.exitEditMode"):v(t)("tagManager.editGroupMode")),1)])])])]),o.value?(E(),D("div",Rx,[i("div",Px,[(E(!0),D(Ke,null,lt(a.value,(Re,ht)=>{var rn,cn,Dt;return E(),D("div",{key:"TabsSw-"+ht,class:We(["tab-item",{active:((rn=s.value)==null?void 0:rn.name)===Re.name}]),style:Bt({backgroundColor:((cn=s.value)==null?void 0:cn.name)===Re.name?"var(--primary-color)":Re.color,color:((Dt=s.value)==null?void 0:Dt.name)===Re.name?"#ffffff":et(Re.color),width:W.value.groupTab.width==="fit-content"?"fit-content":W.value.groupTab.width+"px",height:W.value.groupTab.height+"px",fontSize:W.value.groupTab.fontSize+"px"}),onClick:sn=>K(Re),onMouseenter:sn=>ct(ht),onMouseleave:sn=>So()},[i("span",Fx,y(Re.name),1),O.value=="TabID-"+ht?(E(),D("div",Bx,[i("button",{class:"action-btn move",onClick:Tt(sn=>En(Re,2),["stop"]),title:v(t)("tagManager.moveGroup")},ke[46]||(ke[46]=[i("svg",{viewBox:"0 0 24 24",class:"move-icon"},[i("path",{d:"M13 6v3h8V6h-8zm0 5v3h8v-3h-8zm-8 5v3h8v-3H5zm0-5v3h8v-3H5zm0-5v3h8V6H5z"})],-1)]),8,Ux),i("button",{class:"action-btn edit",onClick:Tt(sn=>J(Re),["stop"]),title:v(t)("tagManager.edit")},ke[47]||(ke[47]=[i("svg",{viewBox:"0 0 24 24",class:"action-icon"},[i("path",{d:"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"})],-1)]),8,zx),i("button",{class:"action-btn delete",onClick:Tt(sn=>ao(Re),["stop"]),title:v(t)("tagManager.delete")},ke[48]||(ke[48]=[i("svg",{viewBox:"0 0 24 24",class:"action-icon"},[i("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"})],-1)]),8,Vx),i("button",{class:"action-btn share",onClick:Tt(sn=>wo(Re),["stop"]),title:v(t)("tagManager.share")},ke[49]||(ke[49]=[i("svg",{viewBox:"0 0 24 24",class:"action-icon"},[i("path",{d:"M18 16.08c-.76 0-1.44.3-1.96.77L8.91 12.7c.05-.23.09-.46.09-.7s-.04-.47-.09-.7l7.05-4.11c.54.5 1.25.81 2.04.81 1.66 0 3-1.34 3-3s-1.34-3-3-3-3 1.34-3 3c0 .24.04.47.09.7L8.04 9.81C7.5 9.31 6.79 9 6 9c-1.66 0-3 1.34-3 3s1.34 3 3 3c.79 0 1.5-.31 2.04-.81l7.12 4.16c-.05.21-.08.43-.08.65 0 1.61 1.31 2.92 2.92 2.92 1.61 0 2.92-1.31 2.92-2.92s-1.31-2.92-2.92-2.92z"})],-1)]),8,Wx)])):Ce("",!0)],46,Nx)}),128)),o.value?(E(),D("button",{key:0,class:"add-tab",onClick:ke[5]||(ke[5]=Re=>ee("group"))},[ke[50]||(ke[50]=i("span",{class:"plus-icon"},"+",-1)),ut(" "+y(v(t)("tagManager.addGroup")),1)])):Ce("",!0),i("div",jx,[i("label",null,[$e(i("input",{type:"checkbox","onUpdate:modelValue":ke[6]||(ke[6]=Re=>I.value=Re),"true-value":1,"false-value":0},null,512),[[nn,I.value]]),ut(" "+y(I.value==1?v(t)("tagManager.exitEditMode"):v(t)("tagManager.editGroupMode")),1)])])])])):Ce("",!0)]),i("div",Hx,[i("div",Gx,[i("div",qx,y(s.value?s.value.name:v(t)("tagManager.selectCategory")),1),i("div",Yx,[i("button",{class:"add-btn",onClick:G,disabled:!s.value},[ke[51]||(ke[51]=i("span",{class:"plus-icon"},"+",-1)),ut(" "+y(v(t)("tagManager.addTag")),1)],8,Kx),_e.value?(E(),D("button",{key:0,class:"share-selected-btn",onClick:Vo,disabled:!x.value.length},y(v(t)("tagManager.shareSelected")),9,Jx)):(E(),D("button",{key:1,class:"share-btn",onClick:qi,disabled:!s.value},y(v(t)("tagManager.batchShare")),9,Xx)),_e.value?(E(),D("button",{key:2,class:"cancel-delete-btn",onClick:fa},y(v(t)("tagManager.cancelShare")),1)):Ce("",!0),fe.value?(E(),D("button",{key:3,class:"delete-btn",onClick:qr,disabled:!x.value.length},y(v(t)("tagManager.deleteSelected")),9,Qx)):(E(),D("button",{key:4,class:"delete-action-btn",onClick:pa,disabled:!s.value},y(v(t)("tagManager.hasDeleteAction")),9,Zx)),fe.value?(E(),D("button",{key:5,class:"cancel-delete-btn",onClick:Ua},y(v(t)("tagManager.cancelDelete")),1)):Ce("",!0)])]),s.value?(E(),D("div",e8,[(E(!0),D(Ke,null,lt(r.value,Re=>(E(),D("div",{key:"tag-grid-"+Re.id_index,class:We(me.value===Re.id_index?"tag-wrapper highlight":"tag-wrapper")},[i("div",{class:"tag-content",onClick:ht=>ot(Re)},[i("div",{class:"tag-main",style:Bt({backgroundColor:Re.color||"transparent"})},[ut(y(Re.desc)+" ",1),i("div",n8,[i("button",{class:"action-btn move",onClick:Tt(ht=>dt(Re),["stop"]),title:v(t)("tagManager.moveTag")},ke[52]||(ke[52]=[i("svg",{viewBox:"0 0 24 24",class:"move-icon"},[i("path",{d:"M13 6v3h8V6h-8zm0 5v3h8v-3h-8zm-8 5v3h8v-3H5zm0-5v3h8v-3H5zm0-5v3h8V6H5z"})],-1)]),8,o8),i("button",{class:"action-btn edit",onClick:Tt(ht=>de(Re),["stop"]),title:v(t)("tagManager.editTag")},ke[53]||(ke[53]=[i("svg",{viewBox:"0 0 24 24",class:"edit-icon"},[i("path",{d:"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"})],-1)]),8,a8),i("button",{class:"action-btn delete",onClick:Tt(ht=>an(Re),["stop"]),title:v(t)("tagManager.deleteTag")},ke[54]||(ke[54]=[i("svg",{viewBox:"0 0 24 24",class:"delete-icon"},[i("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"})],-1)]),8,r8)])],4),i("div",i8,y(Re.text),1)],8,t8),b.value?$e((E(),D("input",{key:0,type:"checkbox","onUpdate:modelValue":ke[7]||(ke[7]=ht=>x.value=ht),value:Re,class:"tag-checkbox"},null,8,s8)),[[nn,x.value]]):Ce("",!0)],2))),128))])):Ce("",!0)]),u.value?(E(),D("div",l8,[i("div",{class:"weilin-tools-dialog-content",onMousedown:ke[12]||(ke[12]=Tt(()=>{},["stop"]))},[i("div",u8,[i("h2",null,y(L()),1),i("button",{class:"close-btn",onClick:C},"×")]),i("div",c8,[g.value=="primary"?(E(),D("div",d8,[i("label",null,y(v(t)("tagManager.categoryName")),1),$e(i("input",{type:"text","onUpdate:modelValue":ke[8]||(ke[8]=Re=>X.value.name=Re),placeholder:v(t)("tagManager.categoryNamePlaceholder"),onKeyup:Rn(Y,["enter"])},null,40,p8),[[ze,X.value.name]])])):Ce("",!0),g.value=="group"?(E(),D("div",f8,[i("label",null,y(v(t)("tagManager.groupName")),1),$e(i("input",{type:"text","onUpdate:modelValue":ke[9]||(ke[9]=Re=>ye.value.name=Re),placeholder:v(t)("tagManager.groupNamePlaceholder"),onKeyup:Rn(Y,["enter"])},null,40,g8),[[ze,ye.value.name]])])):Ce("",!0),i("div",m8,[i("label",null,y(v(t)("tagManager.backgroundColor")),1),i("div",h8,[i("div",{class:"color-preview",style:Bt({backgroundColor:T.value})},null,4),i("div",v8,[$e(i("input",{type:"color","onUpdate:modelValue":ke[10]||(ke[10]=Re=>N.value.hex=Re),onInput:j,class:"color-input"},null,544),[[ze,N.value.hex]]),i("div",_8,[$e(i("input",{type:"range","onUpdate:modelValue":ke[11]||(ke[11]=Re=>N.value.alpha=Re),min:"0",max:"100",onInput:j,class:"alpha-slider"},null,544),[[ze,N.value.alpha,void 0,{number:!0}]]),i("span",y8,y(N.value.alpha)+"%",1)])])])])]),i("div",b8,[i("button",{class:"cancel-btn",onClick:C},y(v(t)("common.cancel")),1),i("button",{class:"confirm-btn",onClick:Y},y(v(t)("common.confirm")),1)])],32)])):Ce("",!0),p.value?(E(),D("div",w8,[i("div",{class:"weilin-tools-dialog-content",onMousedown:ke[17]||(ke[17]=Tt(()=>{},["stop"]))},[i("div",x8,[i("h2",null,y(f.value?v(t)("tagManager.editTag"):v(t)("tagManager.addTag")),1),i("button",{class:"close-btn",onClick:Le},"×")]),i("div",S8,[i("div",T8,[i("label",null,y(v(t)("tagManager.text")),1),$e(i("input",{type:"text","onUpdate:modelValue":ke[13]||(ke[13]=Re=>pe.value.desc=Re),placeholder:v(t)("tagManager.textPlaceholder")},null,8,k8),[[ze,pe.value.desc]])]),i("div",C8,[i("label",null,y(v(t)("tagManager.description")),1),$e(i("textarea",{"onUpdate:modelValue":ke[14]||(ke[14]=Re=>pe.value.text=Re),placeholder:v(t)("tagManager.descriptionPlaceholder"),rows:"4"}," ",8,E8),[[ze,pe.value.text]])]),i("div",$8,[i("label",null,y(v(t)("tagManager.backgroundColor")),1),i("div",L8,[i("div",{class:"color-preview",style:Bt({backgroundColor:T.value})},null,4),i("div",A8,[$e(i("input",{type:"color","onUpdate:modelValue":ke[15]||(ke[15]=Re=>N.value.hex=Re),onInput:j,class:"color-input"},null,544),[[ze,N.value.hex]]),i("div",M8,[$e(i("input",{type:"range","onUpdate:modelValue":ke[16]||(ke[16]=Re=>N.value.alpha=Re),min:"0",max:"100",onInput:j,class:"alpha-slider"},null,544),[[ze,N.value.alpha,void 0,{number:!0}]]),i("span",I8,y(N.value.alpha)+"%",1)])])])])]),i("div",D8,[i("button",{class:"cancel-btn",onClick:Le},y(v(t)("common.cancel")),1),i("button",{class:"confirm-btn",onClick:Se},y(v(t)("common.confirm")),1)])],32)])):Ce("",!0),ft.value?(E(),D("div",O8,[i("div",{class:"weilin-tools-dialog-content confirm-weilin-tools-dialog",onMousedown:ke[18]||(ke[18]=Tt(()=>{},["stop"]))},[i("div",R8,[i("h2",null,y(v(t)("common.confirmDelete")),1),i("button",{class:"close-btn",onClick:za},"×")]),i("div",P8,[i("p",N8,y(Vt.value),1)]),i("div",F8,[i("button",{class:"cancel-btn",onClick:za},y(v(t)("common.cancel")),1),i("button",{class:"delete-btn",onClick:hn},y(v(t)("common.delete")),1)])],32)])):Ce("",!0),z.value?(E(),D("div",B8,[i("div",U8,[i("div",z8,[i("h2",null,y(v(t)("tagManager.moveTag")),1),i("button",{class:"close-btn",onClick:ke[19]||(ke[19]=Re=>z.value=!1)},"×")]),i("div",V8,[i("div",W8,[i("label",null,y(v(t)("tagManager.targetTag")),1),$e(i("select",{"onUpdate:modelValue":ke[20]||(ke[20]=Re=>ce.value=Re),class:"form-select"},[(E(!0),D(Ke,null,lt(r.value,Re=>(E(),D("option",{key:Re.id_index,value:Re.id_index},y(Re.desc+" --> "+Re.text),9,j8))),128))],512),[[Tn,ce.value]])]),i("div",H8,[i("label",null,y(v(t)("tagManager.movePosition")),1),i("div",G8,[i("label",null,[$e(i("input",{class:"radio-input",type:"radio","onUpdate:modelValue":ke[21]||(ke[21]=Re=>P.value=Re),value:"before"},null,512),[[oa,P.value]]),ut(" "+y(v(t)("tagManager.moveBefore")),1)]),i("label",null,[$e(i("input",{class:"radio-input",type:"radio","onUpdate:modelValue":ke[22]||(ke[22]=Re=>P.value=Re),value:"after"},null,512),[[oa,P.value]]),ut(" "+y(v(t)("tagManager.moveAfter")),1)])])])]),i("div",q8,[i("button",{class:"cancel-btn",onClick:ke[23]||(ke[23]=Re=>z.value=!1)},y(v(t)("common.cancel")),1),i("button",{class:"confirm-btn",onClick:Ne},y(v(t)("common.confirm")),1)])])])):Ce("",!0),k.value?(E(),D("div",Y8,[i("div",K8,[i("div",J8,[i("h2",null,y(v(t)("tagManager.moveGroup")),1),i("button",{class:"close-btn",onClick:ke[24]||(ke[24]=Re=>k.value=!1)},"×")]),i("div",X8,[i("div",Q8,[i("label",null,y(v(t)("tagManager.targetGroup")),1),$e(i("select",{"onUpdate:modelValue":ke[25]||(ke[25]=Re=>Ae.value=Re),class:"form-select"},[(E(!0),D(Ke,null,lt(Ue.value,(Re,ht)=>(E(),D("option",{key:"group_move_id"+ht,value:Re.id_index},y(Re.name),9,Z8))),128))],512),[[Tn,Ae.value]])]),i("div",e7,[i("label",null,y(v(t)("tagManager.movePosition")),1),i("div",t7,[i("label",null,[$e(i("input",{class:"radio-input",type:"radio","onUpdate:modelValue":ke[26]||(ke[26]=Re=>ie.value=Re),value:"before"},null,512),[[oa,ie.value]]),ut(" "+y(v(t)("tagManager.moveGroupBefore")),1)]),i("label",null,[$e(i("input",{class:"radio-input",type:"radio","onUpdate:modelValue":ke[27]||(ke[27]=Re=>ie.value=Re),value:"after"},null,512),[[oa,ie.value]]),ut(" "+y(v(t)("tagManager.moveGroupAfter")),1)])])])]),i("div",n7,[i("button",{class:"cancel-btn",onClick:ke[28]||(ke[28]=Re=>k.value=!1)},y(v(t)("common.cancel")),1),i("button",{class:"confirm-btn",onClick:Ba},y(v(t)("common.confirm")),1)])])])):Ce("",!0),ae.value?(E(),D("div",o7,[i("div",{class:"weilin-tools-dialog-content tab-size-weilin-tools-dialog",onMousedown:ke[39]||(ke[39]=Tt(()=>{},["stop"]))},[i("div",a7,[i("h2",null,y(v(t)("tagManager.tabSizeConfig")),1),i("button",{class:"close-btn",onClick:cr},"×")]),i("div",r7,[i("div",i7,[i("h3",null,y(v(t)("tagManager.primaryTabConfig")),1),i("div",s7,[i("label",null,y(v(t)("tagManager.tabWidth")),1),i("div",l7,[i("label",u7,[$e(i("input",{type:"radio","onUpdate:modelValue":ke[29]||(ke[29]=Re=>W.value.primaryTab.width=Re),value:"fit-content"},null,512),[[oa,W.value.primaryTab.width]]),ut(" "+y(v(t)("tagManager.fitContent")),1)]),i("label",c7,[$e(i("input",{type:"radio","onUpdate:modelValue":ke[30]||(ke[30]=Re=>W.value.primaryTab.width=Re),value:"custom"},null,512),[[oa,W.value.primaryTab.width]]),ut(" "+y(v(t)("tagManager.customWidth")),1)]),W.value.primaryTab.width!=="fit-content"?$e((E(),D("input",{key:0,type:"number","onUpdate:modelValue":ke[31]||(ke[31]=Re=>W.value.primaryTab.width=Re),min:"50",max:"300",class:"number-input"},null,512)),[[ze,W.value.primaryTab.width,void 0,{number:!0}]]):Ce("",!0)])]),i("div",d7,[i("label",null,y(v(t)("tagManager.tabHeight"))+" ("+y(W.value.primaryTab.height)+"px)",1),$e(i("input",{type:"range","onUpdate:modelValue":ke[32]||(ke[32]=Re=>W.value.primaryTab.height=Re),min:"20",max:"60",class:"range-input"},null,512),[[ze,W.value.primaryTab.height,void 0,{number:!0}]])]),i("div",p7,[i("label",null,y(v(t)("tagManager.fontSize"))+" ("+y(W.value.primaryTab.fontSize)+"px)",1),$e(i("input",{type:"range","onUpdate:modelValue":ke[33]||(ke[33]=Re=>W.value.primaryTab.fontSize=Re),min:"8",max:"20",class:"range-input"},null,512),[[ze,W.value.primaryTab.fontSize,void 0,{number:!0}]])])]),i("div",f7,[i("h3",null,y(v(t)("tagManager.groupTabConfig")),1),i("div",g7,[i("label",null,y(v(t)("tagManager.tabWidth")),1),i("div",m7,[i("label",h7,[$e(i("input",{type:"radio","onUpdate:modelValue":ke[34]||(ke[34]=Re=>W.value.groupTab.width=Re),value:"fit-content"},null,512),[[oa,W.value.groupTab.width]]),ut(" "+y(v(t)("tagManager.fitContent")),1)]),i("label",v7,[$e(i("input",{type:"radio","onUpdate:modelValue":ke[35]||(ke[35]=Re=>W.value.groupTab.width=Re),value:"custom"},null,512),[[oa,W.value.groupTab.width]]),ut(" "+y(v(t)("tagManager.customWidth")),1)]),W.value.groupTab.width!=="fit-content"?$e((E(),D("input",{key:0,type:"number","onUpdate:modelValue":ke[36]||(ke[36]=Re=>W.value.groupTab.width=Re),min:"50",max:"300",class:"number-input"},null,512)),[[ze,W.value.groupTab.width,void 0,{number:!0}]]):Ce("",!0)])]),i("div",_7,[i("label",null,y(v(t)("tagManager.tabHeight"))+" ("+y(W.value.groupTab.height)+"px)",1),$e(i("input",{type:"range","onUpdate:modelValue":ke[37]||(ke[37]=Re=>W.value.groupTab.height=Re),min:"20",max:"60",class:"range-input"},null,512),[[ze,W.value.groupTab.height,void 0,{number:!0}]])]),i("div",y7,[i("label",null,y(v(t)("tagManager.fontSize"))+" ("+y(W.value.groupTab.fontSize)+"px)",1),$e(i("input",{type:"range","onUpdate:modelValue":ke[38]||(ke[38]=Re=>W.value.groupTab.fontSize=Re),min:"8",max:"20",class:"range-input"},null,512),[[ze,W.value.groupTab.fontSize,void 0,{number:!0}]])])])]),i("div",b7,[i("button",{class:"reset-btn",onClick:Yi},y(v(t)("tagManager.resetDefault")),1),i("button",{class:"cancel-btn",onClick:cr},y(v(t)("common.cancel")),1),i("button",{class:"confirm-btn",onClick:ga},y(v(t)("common.confirm")),1)])],32)])):Ce("",!0),it(dx,{ref_key:"importTagDialogItem",ref:jo},null,512)]))}},[["__scopeId","data-v-c63ff697"]]),fl=100,lh=S(""),da=S({}),nt={setActiveWindow(e){lh.value!==e&&(lh.value=e,Object.keys(da.value).forEach(t=>{da.value[t]=fl}),da.value[e]=fl+10)},getZIndex(e){return da.value[e]||(da.value[e]=fl),da.value[e]},registerWindow(e){da.value[e]||(da.value[e]=fl)},unregisterWindow(e){delete da.value[e]}},fo={getLoraList:e=>Ye({url:"/get_lora_list",method:"get",params:e}),getAllLoraList:e=>Ye({url:"/get_lora_load_all",method:"get",params:e}),getAllLoraStatus:e=>Ye({url:"/get_lora_load_status",method:"get",params:e}),getLoraDetail:e=>Ye({url:"/lorainfo/api/loras/info",method:"get",params:e}),getLoraRefresh:e=>Ye({url:"/lorainfo/api/loras/info/refresh",method:"get",params:e}),postUplaodImg:(e,t,n)=>{const o=new FormData;return o.append("image",e),o.append("path",t),o.append("fileName",n),Ye({url:"/lorainfo/api/loras/set/img",method:"post",data:o,headers:{"Content-Type":"multipart/form-data"}})},postLoraSave:(e,t)=>{const n=new FormData;return n.append("json",JSON.stringify(t)),Ye({url:`/lorainfo/api/loras/info?file=${e}`,method:"post",data:n,headers:{"Content-Type":"multipart/form-data"}})},postLoraDelet:(e,t)=>Ye({url:`/lorainfo/api/delete/loras/info/filed?file=${e}`,method:"post",data:{json:t}}),getLoraFolderList:()=>Ye({url:"/get_lora_folder_list",method:"post"}),getLoraRangeList:e=>Ye({url:"/get_lora_list_by_range",method:"post",data:{range:e}}),searchLoraGetFolderList:e=>Ye({url:"/get_lora_list_by_search",method:"post",data:{search:e}})};function gl(e){"@babel/helpers - typeof";return gl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gl(e)}var w7=/^([hH][tT]{2}[pP]:\/\/|[hH][tT]{2}[pP][sS]:\/\/)(([A-Za-z0-9-~]+)\.)+([A-Za-z0-9-~\/])+$/,uh={name:"JsonString",props:{jsonValue:{type:String,required:!0}},data:function(){return{expand:!0,canExtend:!1}},mounted:function(){this.$refs.itemRef.offsetHeight>this.$refs.holderRef.offsetHeight&&(this.canExtend=!0)},methods:{toggle:function(){this.expand=!this.expand}},render:function(){var t=this.jsonValue,n=w7.test(t),o;return this.expand?(o={class:{"jv-item":!0,"jv-string":!0},ref:"itemRef"},n?(t='<a href="'.concat(t,'" target="_blank" class="jv-link">').concat(t,"</a>"),o.innerHTML='"'.concat(t.toString(),'"')):o.innerText='"'.concat(t.toString(),'"')):o={class:{"jv-ellipsis":!0},onClick:this.toggle,innerText:"..."},Nt("span",{},[this.canExtend&&Nt("span",{class:{"jv-toggle":!0,open:this.expand},onClick:this.toggle}),Nt("span",{class:{"jv-holder-node":!0},ref:"holderRef"}),Nt("span",o)])}};uh.__file="src/Components/types/json-string.vue";var ch={name:"JsonUndefined",functional:!0,props:{jsonValue:{type:Object,default:null}},render:function(){return Nt("span",{class:{"jv-item":!0,"jv-undefined":!0},innerText:this.jsonValue===null?"null":"undefined"})}};ch.__file="src/Components/types/json-undefined.vue";var dh={name:"JsonNumber",functional:!0,props:{jsonValue:{type:Number,required:!0}},render:function(){var t=Number.isInteger(this.jsonValue);return Nt("span",{class:{"jv-item":!0,"jv-number":!0,"jv-number-integer":t,"jv-number-float":!t},innerText:this.jsonValue.toString()})}};dh.__file="src/Components/types/json-number.vue";var ph={name:"JsonBoolean",functional:!0,props:{jsonValue:Boolean},render:function(){return Nt("span",{class:{"jv-item":!0,"jv-boolean":!0},innerText:this.jsonValue.toString()})}};ph.__file="src/Components/types/json-boolean.vue";var fh={name:"JsonObject",props:{jsonValue:{type:Object,required:!0},keyName:{type:String,default:""},depth:{type:Number,default:0},expand:Boolean,sort:Boolean,previewMode:Boolean},data:function(){return{value:{}}},computed:{ordered:function(){var t=this;if(!this.sort)return this.value;var n={};return Object.keys(this.value).sort().forEach(function(o){n[o]=t.value[o]}),n}},watch:{jsonValue:function(t){this.setValue(t)}},mounted:function(){this.setValue(this.jsonValue)},methods:{setValue:function(t){var n=this;setTimeout(function(){n.value=t},0)},toggle:function(){this.$emit("update:expand",!this.expand),this.dispatchEvent()},dispatchEvent:function(){try{this.$el.dispatchEvent(new Event("resized"))}catch{var t=document.createEvent("Event");t.initEvent("resized",!0,!1),this.$el.dispatchEvent(t)}}},render:function(){var t=[];if(!this.previewMode&&!this.keyName&&t.push(Nt("span",{class:{"jv-toggle":!0,open:!!this.expand},onClick:this.toggle})),t.push(Nt("span",{class:{"jv-item":!0,"jv-object":!0},innerText:"{"})),this.expand){for(var n in this.ordered)if(this.ordered.hasOwnProperty(n)){var o=this.ordered[n];t.push(Nt(ml,{key:n,style:{display:this.expand?void 0:"none"},sort:this.sort,keyName:n,depth:this.depth+1,value:o,previewMode:this.previewMode}))}}return!this.expand&&Object.keys(this.value).length&&t.push(Nt("span",{style:{display:this.expand?"none":void 0},class:{"jv-ellipsis":!0},onClick:this.toggle,title:"click to reveal object content (keys: ".concat(Object.keys(this.ordered).join(", "),")"),innerText:"..."})),t.push(Nt("span",{class:{"jv-item":!0,"jv-object":!0},innerText:"}"})),Nt("span",t)}};fh.__file="src/Components/types/json-object.vue";var gh={name:"JsonArray",props:{jsonValue:{type:Array,required:!0},keyName:{type:String,default:""},depth:{type:Number,default:0},sort:Boolean,expand:Boolean,previewMode:Boolean},data:function(){return{value:[]}},watch:{jsonValue:function(t){this.setValue(t)}},mounted:function(){this.setValue(this.jsonValue)},methods:{setValue:function(t){var n=this,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;o===0&&(this.value=[]),setTimeout(function(){t.length>o&&(n.value.push(t[o]),n.setValue(t,o+1))},0)},toggle:function(){this.$emit("update:expand",!this.expand);try{this.$el.dispatchEvent(new Event("resized"))}catch{var t=document.createEvent("Event");t.initEvent("resized",!0,!1),this.$el.dispatchEvent(t)}}},render:function(){var t=this,n=[];return!this.previewMode&&!this.keyName&&n.push(Nt("span",{class:{"jv-toggle":!0,open:!!this.expand},onClick:this.toggle})),n.push(Nt("span",{class:{"jv-item":!0,"jv-array":!0},innerText:"["})),this.expand&&this.value.forEach(function(o,a){n.push(Nt(ml,{key:a,style:{display:t.expand?void 0:"none"},sort:t.sort,depth:t.depth+1,value:o,previewMode:t.previewMode}))}),!this.expand&&this.value.length&&n.push(Nt("span",{style:{display:void 0},class:{"jv-ellipsis":!0},onClick:this.toggle,title:"click to reveal ".concat(this.value.length," hidden items"),innerText:"..."})),n.push(Nt("span",{class:{"jv-item":!0,"jv-array":!0},innerText:"]"})),Nt("span",n)}};gh.__file="src/Components/types/json-array.vue";var mh={name:"JsonFunction",functional:!0,props:{jsonValue:{type:Function,required:!0}},render:function(){return Nt("span",{class:{"jv-item":!0,"jv-function":!0},attrs:{title:this.jsonValue.toString()},innerHTML:"<function>"})}};mh.__file="src/Components/types/json-function.vue";var hh={name:"JsonDate",inject:["timeformat"],functional:!0,props:{jsonValue:{type:Date,required:!0}},render:function(){var t=this.jsonValue,n=this.timeformat;return Nt("span",{class:{"jv-item":!0,"jv-string":!0},innerText:'"'.concat(n(t),'"')})}};hh.__file="src/Components/types/json-date.vue";var x7=/^([hH][tT]{2}[pP]:\/\/|[hH][tT]{2}[pP][sS]:\/\/)(([A-Za-z0-9-~]+)\.)+([A-Za-z0-9-~\/])+$/,vh={name:"JsonString",props:{jsonValue:{type:RegExp,required:!0}},data:function(){return{expand:!0,canExtend:!1}},mounted:function(){this.$refs.itemRef.offsetHeight>this.$refs.holderRef.offsetHeight&&(this.canExtend=!0)},methods:{toggle:function(){this.expand=!this.expand}},render:function(){var t=this.jsonValue,n=x7.test(t),o;return this.expand?(o={class:{"jv-item":!0,"jv-string":!0},ref:"itemRef"},n?(t='<a href="'.concat(t,'" target="_blank" class="jv-link">').concat(t,"</a>"),o.innerHTML="".concat(t.toString())):o.innerText="".concat(t.toString())):o={class:{"jv-ellipsis":!0},onClick:this.toggle,innerText:"..."},Nt("span",{},[this.canExtend&&Nt("span",{class:{"jv-toggle":!0,open:this.expand},onClick:this.toggle}),Nt("span",{class:{"jv-holder-node":!0},ref:"holderRef"}),Nt("span",o)])}};vh.__file="src/Components/types/json-regexp.vue";var ml={name:"JsonBox",inject:["expandDepth","keyClick"],props:{value:{type:[Object,Array,String,Number,Boolean,Function,Date],default:null},keyName:{type:String,default:""},sort:Boolean,depth:{type:Number,default:0},previewMode:Boolean},data:function(){return{expand:!0}},mounted:function(){this.expand=this.previewMode||!(this.depth>=this.expandDepth)},methods:{toggle:function(){this.expand=!this.expand;try{this.$el.dispatchEvent(new Event("resized"))}catch{var t=document.createEvent("Event");t.initEvent("resized",!0,!1),this.$el.dispatchEvent(t)}}},render:function(){var t=this,n=[],o;this.value===null||this.value===void 0?o=ch:Array.isArray(this.value)?o=gh:Object.prototype.toString.call(this.value)==="[object Date]"?o=hh:gl(this.value)==="object"?o=fh:typeof this.value=="number"?o=dh:typeof this.value=="string"?o=uh:typeof this.value=="boolean"?o=ph:typeof this.value=="function"&&(o=mh),this.value.constructor===RegExp&&(o=vh);var a=this.keyName&&this.value&&(Array.isArray(this.value)||gl(this.value)==="object"&&Object.prototype.toString.call(this.value)!=="[object Date]");return!this.previewMode&&a&&n.push(Nt("span",{class:{"jv-toggle":!0,open:!!this.expand},onClick:this.toggle})),this.keyName&&n.push(Nt("span",{class:{"jv-key":!0},onClick:function(){t.keyClick(t.keyName)},innerText:"".concat(this.keyName,":")})),n.push(Nt(o,{class:{"jv-push":!0},jsonValue:this.value,keyName:this.keyName,sort:this.sort,depth:this.depth,expand:this.expand,previewMode:this.previewMode,"onUpdate:expand":function(s){t.expand=s}})),Nt("div",{class:{"jv-node":!0,"jv-key-node":!!this.keyName&&!a,toggle:!this.previewMode&&a}},n)}};ml.__file="src/Components/json-box.vue";var S7=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function T7(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var _h={exports:{}};(function(e,t){(function(o,a){e.exports=a()})(S7,function(){return function(){var n={686:function(r,s,u){u.d(s,{default:function(){return Z}});var p=u(279),m=u.n(p),f=u(370),g=u.n(f),x=u(817),b=u.n(x);function k(oe){try{return document.execCommand(oe)}catch{return!1}}var $=function(be){var ve=b()(be);return k("cut"),ve},O=$;function I(oe){var be=document.documentElement.getAttribute("dir")==="rtl",ve=document.createElement("textarea");ve.style.fontSize="12pt",ve.style.border="0",ve.style.padding="0",ve.style.margin="0",ve.style.position="absolute",ve.style[be?"right":"left"]="-9999px";var he=window.pageYOffset||document.documentElement.scrollTop;return ve.style.top="".concat(he,"px"),ve.setAttribute("readonly",""),ve.value=oe,ve}var V=function(be,ve){var he=I(be);ve.container.appendChild(he);var te=b()(he);return k("copy"),he.remove(),te},me=function(be){var ve=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{container:document.body},he="";return typeof be=="string"?he=V(be,ve):be instanceof HTMLInputElement&&!["text","search","url","tel","password"].includes(be==null?void 0:be.type)?he=V(be.value,ve):(he=b()(be),k("copy")),he},M=me;function z(oe){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?z=function(ve){return typeof ve}:z=function(ve){return ve&&typeof Symbol=="function"&&ve.constructor===Symbol&&ve!==Symbol.prototype?"symbol":typeof ve},z(oe)}var ce=function(){var be=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},ve=be.action,he=ve===void 0?"copy":ve,te=be.container,K=be.target,ee=be.text;if(he!=="copy"&&he!=="cut")throw new Error('Invalid "action" value, use either "copy" or "cut"');if(K!==void 0)if(K&&z(K)==="object"&&K.nodeType===1){if(he==="copy"&&K.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if(he==="cut"&&(K.hasAttribute("readonly")||K.hasAttribute("disabled")))throw new Error(`Invalid "target" attribute. You can't cut text from elements with "readonly" or "disabled" attributes`)}else throw new Error('Invalid "target" value, use a valid Element');if(ee)return M(ee,{container:te});if(K)return he==="cut"?O(K):M(K,{container:te})},P=ce;function le(oe){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?le=function(ve){return typeof ve}:le=function(ve){return ve&&typeof Symbol=="function"&&ve.constructor===Symbol&&ve!==Symbol.prototype?"symbol":typeof ve},le(oe)}function ie(oe,be){if(!(oe instanceof be))throw new TypeError("Cannot call a class as a function")}function Oe(oe,be){for(var ve=0;ve<be.length;ve++){var he=be[ve];he.enumerable=he.enumerable||!1,he.configurable=!0,"value"in he&&(he.writable=!0),Object.defineProperty(oe,he.key,he)}}function Ae(oe,be,ve){return be&&Oe(oe.prototype,be),ve&&Oe(oe,ve),oe}function fe(oe,be){if(typeof be!="function"&&be!==null)throw new TypeError("Super expression must either be null or a function");oe.prototype=Object.create(be&&be.prototype,{constructor:{value:oe,writable:!0,configurable:!0}}),be&&_e(oe,be)}function _e(oe,be){return _e=Object.setPrototypeOf||function(he,te){return he.__proto__=te,he},_e(oe,be)}function ae(oe){var be=Q();return function(){var he=X(oe),te;if(be){var K=X(this).constructor;te=Reflect.construct(he,arguments,K)}else te=he.apply(this,arguments);return W(this,te)}}function W(oe,be){return be&&(le(be)==="object"||typeof be=="function")?be:re(oe)}function re(oe){if(oe===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return oe}function Q(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function X(oe){return X=Object.setPrototypeOf?Object.getPrototypeOf:function(ve){return ve.__proto__||Object.getPrototypeOf(ve)},X(oe)}function ye(oe,be){var ve="data-clipboard-".concat(oe);if(be.hasAttribute(ve))return be.getAttribute(ve)}var pe=function(oe){fe(ve,oe);var be=ae(ve);function ve(he,te){var K;return ie(this,ve),K=be.call(this),K.resolveOptions(te),K.listenClick(he),K}return Ae(ve,[{key:"resolveOptions",value:function(){var te=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.action=typeof te.action=="function"?te.action:this.defaultAction,this.target=typeof te.target=="function"?te.target:this.defaultTarget,this.text=typeof te.text=="function"?te.text:this.defaultText,this.container=le(te.container)==="object"?te.container:document.body}},{key:"listenClick",value:function(te){var K=this;this.listener=g()(te,"click",function(ee){return K.onClick(ee)})}},{key:"onClick",value:function(te){var K=te.delegateTarget||te.currentTarget,ee=this.action(K)||"copy",F=P({action:ee,container:this.container,target:this.target(K),text:this.text(K)});this.emit(F?"success":"error",{action:ee,text:F,trigger:K,clearSelection:function(){K&&K.focus(),window.getSelection().removeAllRanges()}})}},{key:"defaultAction",value:function(te){return ye("action",te)}},{key:"defaultTarget",value:function(te){var K=ye("target",te);if(K)return document.querySelector(K)}},{key:"defaultText",value:function(te){return ye("text",te)}},{key:"destroy",value:function(){this.listener.destroy()}}],[{key:"copy",value:function(te){var K=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{container:document.body};return M(te,K)}},{key:"cut",value:function(te){return O(te)}},{key:"isSupported",value:function(){var te=arguments.length>0&&arguments[0]!==void 0?arguments[0]:["copy","cut"],K=typeof te=="string"?[te]:te,ee=!!document.queryCommandSupported;return K.forEach(function(F){ee=ee&&!!document.queryCommandSupported(F)}),ee}}]),ve}(m()),Z=pe},828:function(r){var s=9;if(typeof Element<"u"&&!Element.prototype.matches){var u=Element.prototype;u.matches=u.matchesSelector||u.mozMatchesSelector||u.msMatchesSelector||u.oMatchesSelector||u.webkitMatchesSelector}function p(m,f){for(;m&&m.nodeType!==s;){if(typeof m.matches=="function"&&m.matches(f))return m;m=m.parentNode}}r.exports=p},438:function(r,s,u){var p=u(828);function m(x,b,k,$,O){var I=g.apply(this,arguments);return x.addEventListener(k,I,O),{destroy:function(){x.removeEventListener(k,I,O)}}}function f(x,b,k,$,O){return typeof x.addEventListener=="function"?m.apply(null,arguments):typeof k=="function"?m.bind(null,document).apply(null,arguments):(typeof x=="string"&&(x=document.querySelectorAll(x)),Array.prototype.map.call(x,function(I){return m(I,b,k,$,O)}))}function g(x,b,k,$){return function(O){O.delegateTarget=p(O.target,b),O.delegateTarget&&$.call(x,O)}}r.exports=f},879:function(r,s){s.node=function(u){return u!==void 0&&u instanceof HTMLElement&&u.nodeType===1},s.nodeList=function(u){var p=Object.prototype.toString.call(u);return u!==void 0&&(p==="[object NodeList]"||p==="[object HTMLCollection]")&&"length"in u&&(u.length===0||s.node(u[0]))},s.string=function(u){return typeof u=="string"||u instanceof String},s.fn=function(u){var p=Object.prototype.toString.call(u);return p==="[object Function]"}},370:function(r,s,u){var p=u(879),m=u(438);function f(k,$,O){if(!k&&!$&&!O)throw new Error("Missing required arguments");if(!p.string($))throw new TypeError("Second argument must be a String");if(!p.fn(O))throw new TypeError("Third argument must be a Function");if(p.node(k))return g(k,$,O);if(p.nodeList(k))return x(k,$,O);if(p.string(k))return b(k,$,O);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}function g(k,$,O){return k.addEventListener($,O),{destroy:function(){k.removeEventListener($,O)}}}function x(k,$,O){return Array.prototype.forEach.call(k,function(I){I.addEventListener($,O)}),{destroy:function(){Array.prototype.forEach.call(k,function(I){I.removeEventListener($,O)})}}}function b(k,$,O){return m(document.body,k,$,O)}r.exports=f},817:function(r){function s(u){var p;if(u.nodeName==="SELECT")u.focus(),p=u.value;else if(u.nodeName==="INPUT"||u.nodeName==="TEXTAREA"){var m=u.hasAttribute("readonly");m||u.setAttribute("readonly",""),u.select(),u.setSelectionRange(0,u.value.length),m||u.removeAttribute("readonly"),p=u.value}else{u.hasAttribute("contenteditable")&&u.focus();var f=window.getSelection(),g=document.createRange();g.selectNodeContents(u),f.removeAllRanges(),f.addRange(g),p=f.toString()}return p}r.exports=s},279:function(r){function s(){}s.prototype={on:function(u,p,m){var f=this.e||(this.e={});return(f[u]||(f[u]=[])).push({fn:p,ctx:m}),this},once:function(u,p,m){var f=this;function g(){f.off(u,g),p.apply(m,arguments)}return g._=p,this.on(u,g,m)},emit:function(u){var p=[].slice.call(arguments,1),m=((this.e||(this.e={}))[u]||[]).slice(),f=0,g=m.length;for(f;f<g;f++)m[f].fn.apply(m[f].ctx,p);return this},off:function(u,p){var m=this.e||(this.e={}),f=m[u],g=[];if(f&&p)for(var x=0,b=f.length;x<b;x++)f[x].fn!==p&&f[x].fn._!==p&&g.push(f[x]);return g.length?m[u]=g:delete m[u],this}},r.exports=s,r.exports.TinyEmitter=s}},o={};function a(r){if(o[r])return o[r].exports;var s=o[r]={exports:{}};return n[r](s,s.exports,a),s.exports}return function(){a.n=function(r){var s=r&&r.__esModule?function(){return r.default}:function(){return r};return a.d(s,{a:s}),s}}(),function(){a.d=function(r,s){for(var u in s)a.o(s,u)&&!a.o(r,u)&&Object.defineProperty(r,u,{enumerable:!0,get:s[u]})}}(),function(){a.o=function(r,s){return Object.prototype.hasOwnProperty.call(r,s)}}(),a(686)}().default})})(_h);var k7=T7(_h.exports),C7=function(t,n){var o=Date.now(),a;return function(){for(var r=arguments.length,s=new Array(r),u=0;u<r;u++)s[u]=arguments[u];Date.now()-o<n&&a&&clearTimeout(a),a=setTimeout(function(){t.apply(void 0,s)},n),o=Date.now()}},$c={name:"JsonViewer",components:{JsonBox:ml},props:{value:{type:[Object,Array,String,Number,Boolean,Function],required:!0},expanded:{type:Boolean,default:!1},expandDepth:{type:Number,default:1},copyable:{type:[Boolean,Object],default:!1},sort:{type:Boolean,default:!1},boxed:{type:Boolean,default:!1},theme:{type:String,default:"light"},timeformat:{type:Function,default:function(t){return t.toLocaleString()}},previewMode:{type:Boolean,default:!1},parse:{type:Boolean,default:!1}},provide:function(){return{expandDepth:this.expandDepth,timeformat:this.timeformat,keyClick:this.keyClick}},data:function(){return{copied:!1,expandableCode:!1,expandCode:this.expanded}},emits:["onKeyClick"],computed:{jvClass:function(){return"jv-container jv-"+this.theme+(this.boxed?" boxed":"")},copyText:function(){var t=this.copyable,n=t.copyText,o=t.copiedText,a=t.timeout,r=t.align;return{copyText:n||"copy",copiedText:o||"copied!",timeout:a||2e3,align:r}},parseValue:function(){if(!this.parse||typeof this.value!="string")return this.value;try{return JSON.parse(this.value)}catch{return this.value}}},watch:{value:function(){this.onResized()}},mounted:function(){var t=this;if(this.debounceResized=C7(this.debResized.bind(this),200),this.boxed&&this.$refs.jsonBox&&(this.onResized(),this.$refs.jsonBox.$el.addEventListener("resized",this.onResized,!0)),this.copyable){var n=new k7(this.$refs.clip,{text:function(){return JSON.stringify(t.value,null,2)}});n.on("success",function(o){t.onCopied(o)})}},methods:{onResized:function(){this.debounceResized()},debResized:function(){var t=this;this.$nextTick(function(){t.$refs.jsonBox&&(t.$refs.jsonBox.$el.clientHeight>=250?t.expandableCode=!0:t.expandableCode=!1)})},keyClick:function(t){this.$emit("onKeyClick",t)},onCopied:function(t){var n=this;this.copied||(this.copied=!0,setTimeout(function(){n.copied=!1},this.copyText.timeout),this.$emit("copied",t))},toggleExpandCode:function(){this.expandCode=!this.expandCode}}};function E7(e,t,n,o,a,r){var s=Hv("json-box");return E(),D("div",{class:We(r.jvClass)},[n.copyable?(E(),D("div",{key:0,class:We("jv-tooltip ".concat(r.copyText.align||"right"))},[i("span",{ref:"clip",class:We(["jv-button",{copied:a.copied}])},[mi(e.$slots,"copy",{copied:a.copied},function(){return[ut(y(a.copied?r.copyText.copiedText:r.copyText.copyText),1)]})],2)],2)):Ce("v-if",!0),i("div",{class:We(["jv-code",{open:a.expandCode,boxed:n.boxed}])},[it(s,{ref:"jsonBox",value:r.parseValue,sort:n.sort,"preview-mode":n.previewMode},null,8,["value","sort","preview-mode"])],2),a.expandableCode&&n.boxed?(E(),D("div",{key:1,class:"jv-more",onClick:t[0]||(t[0]=function(){return r.toggleExpandCode&&r.toggleExpandCode.apply(r,arguments)})},[i("span",{class:We(["jv-toggle",{open:!!a.expandCode}])},null,2)])):Ce("v-if",!0)],2)}$c.render=E7,$c.__file="src/Components/json-viewer.vue";const $7={class:"lora-raw__content"},yh="weilin_tools_",L7=qt({__name:"lora_raw",emits:["close","update"],setup(e,{expose:t,emit:n}){const{t:o}=Gt(),a=S({}),r=S(!1),s={loraRaw:{visible:!1,position:{x:150,y:150},size:{width:800,height:600}}},p=S((()=>{try{const b=localStorage.getItem(`${yh}loraRawState`);if(b){const k=JSON.parse(b),$={...s};return k.loraRaw&&($.loraRaw={...s.loraRaw,...k.loraRaw}),$}}catch(b){console.error("Error loading window states:",b)}return{...s}})());At(p,b=>{try{localStorage.setItem(`${yh}loraRawState`,JSON.stringify(b))}catch(k){console.error("Error saving window states:",k)}},{deep:!0}),Ut(()=>{nt.registerWindow("loraRaw")}),so(()=>{nt.unregisterWindow("loraRaw")});const m=()=>{r.value=!1},f=(b,k)=>{p.value[b]&&(p.value[b].position={...k})},g=(b,k)=>{p.value[b]&&(p.value[b].size={...k})};return t({open:b=>{r.value=!0,nt.setActiveWindow("loraRaw"),a.value=b}}),(b,k)=>r.value?(E(),Jt(co,{key:0,title:v(o)("lora.rawTitle"),position:p.value.loraRaw.position,size:p.value.loraRaw.size,"z-index":v(nt).getZIndex("loraRaw"),"onUpdate:position":k[0]||(k[0]=$=>f("loraRaw",$)),"onUpdate:size":k[1]||(k[1]=$=>g("loraRaw",$)),onActive:k[2]||(k[2]=$=>v(nt).setActiveWindow("loraRaw")),onClose:k[3]||(k[3]=$=>m())},{default:Pt(()=>[i("div",$7,[it(v($c),{value:a.value,copyable:"",sort:"",theme:"dark"},null,8,["value"])])]),_:1},8,["title","position","size","z-index"])):Ce("",!0)}},[["__scopeId","data-v-f2df06a0"]]),A7={key:0,class:"lora-detail__loading"},M7={class:"lora-detail__body"},I7={class:"lora-detail__tags"},D7=["title"],O7=["title"],R7={class:"lora-detail__table"},P7={class:"label"},N7={colspan:"2"},F7={colspan:"3"},B7={class:"label"},U7={colspan:"2",class:"hash"},z7={class:"label"},V7={colspan:"2"},W7=["href"],j7={key:1,class:"not-found"},H7=["title"],G7={class:"label"},q7=["title"],Y7={key:1,class:"text"},K7={class:"actions"},J7={class:"svg-icon",viewBox:"0 0 24 24",width:"16",height:"16"},X7={key:0,d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z"},Q7={key:1,d:"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"},Z7={class:"label"},eS={colspan:"2"},tS={class:"label"},nS={colspan:"2"},oS={class:"label"},aS=["title"],rS=["onUpdate:modelValue","type","onKeyup"],iS={key:1,class:"text"},sS={class:"actions"},lS=["onClick","title"],uS={class:"svg-icon",viewBox:"0 0 24 24",width:"16",height:"16"},cS={key:0,d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z"},dS={key:1,d:"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"},pS={class:"label"},fS=["onUpdate:modelValue"],gS={key:1},mS=["onUpdate:modelValue","type","onKeyup"],hS={key:1,class:"text"},vS={class:"actions"},_S=["onClick","title"],yS={class:"svg-icon",viewBox:"0 0 24 24",width:"16",height:"16"},bS={key:0,d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z"},wS={key:1,d:"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"},xS=["onClick","title"],SS={class:"field-management"},TS=["title"],kS={key:0},CS={class:"label"},ES=["title"],$S={key:0,class:"word-selection"},LS={colspan:"2"},AS={class:"word-list"},MS=["onClick"],IS={key:0,viewBox:"0 0 24 24",width:"16",height:"16",class:"civitai-icon"},DS={key:1},OS={key:0,class:"lora-detail__images"},RS={class:"image-wrapper"},PS=["onClick"],NS=["src"],FS={class:"image-info"},BS={key:0,class:"info-item"},US=["href"],zS={key:1,class:"info-item"},VS={key:2,class:"info-item"},WS={key:3,class:"info-item"},jS={key:4,class:"info-item"},HS={key:5,class:"info-item"},GS={key:6,class:"info-item"},qS={key:7,class:"info-item"},bh="weilin_tools_",hl=qt({__name:"lora_detail",emits:["close","update"],setup(e,{expose:t,emit:n}){const{t:o}=Gt(),a=S(!1),r=S({}),s=S(!1),u=S(),p=S(null),m=S({}),f={loraDetail:{visible:!1,position:{x:150,y:150},size:{width:800,height:600}}},x=S((()=>{try{const ee=localStorage.getItem(`${bh}loraDetailState`);if(ee){const F=JSON.parse(ee),J={...f};return F.loraDetail&&(J.loraDetail={...f.loraDetail,...F.loraDetail}),J}}catch(ee){console.error("Error loading window states:",ee)}return{...f}})());At(x,ee=>{try{localStorage.setItem(`${bh}loraDetailState`,JSON.stringify(ee))}catch(F){console.error("Error saving window states:",F)}},{deep:!0}),Ut(()=>{nt.registerWindow("loraDetail")}),so(()=>{nt.unregisterWindow("loraDetail")});const b=()=>{s.value=!1},k=(ee,F)=>{x.value[ee]&&(x.value[ee].position={...F})},$=(ee,F)=>{x.value[ee]&&(x.value[ee].size={...F})};t({open:ee=>{s.value=!0,nt.setActiveWindow("loraDetail"),a.value=!0,r.value=ee,vt(()=>{Oe()})}});const I=S(""),V=S(),me=ee=>{V.value.open(ee)},M=S({}),z=S({}),ce=S([]),P=[{key:"strengthMin",label:o("lora.strengthMin"),tip:o("lora.strengthMinTip"),type:"number"},{key:"strengthMax",label:o("lora.strengthMax"),tip:o("lora.strengthMaxTip"),type:"number"},{key:"strWeight",label:o("lora.strWeight"),tip:o("lora.strWeightTip"),type:"number"},{key:"loraWorks",label:o("lora.promptWords"),tip:o("lora.promptWordsTip")}],le=()=>{const ee=`custom_${Date.now()}`;r.value.user_diy_fileds||(r.value.user_diy_fileds={}),m.value[ee]={label:"新字段",type:"text"},r.value.user_diy_fileds[ee]={label:"新字段",value:""},z.value[ee]="",ye(ee)},ie=async ee=>{var F,J;delete m.value[ee],delete z.value[ee],(J=(F=r.value)==null?void 0:F.user_diy_fileds)!=null&&J[ee]&&delete r.value.user_diy_fileds[ee],await vt(async()=>{await oe(ee)})},Oe=()=>{I.value=r.value.name,r.value={},ce.value=[],z.value={name:!1,nameValue:"",min:!1,minValue:"",max:!1,maxValue:"",notes:!1,notesValue:"",loraWorks:!1,loraWorksValue:""},fo.getLoraDetail({file:I.value,refresh:!1,light:!1}).then(ee=>{r.value=ee.data,vt(()=>{let F,J,Y,L,C,G;r.value.name=r.value.name||((J=(F=r.value.raw)===null||F===void 0?void 0:F.metadata)===null||J===void 0?void 0:J.ss_output_name===void 0?J["modelspec.title"]:J.ss_output_name)||"",z.value.nameValue=r.value.name,r.value.strengthMin=(Y=r.value.strengthMin)!==null&&Y!==void 0?Y:"",z.value.minValue=r.value.strengthMin,r.value.strengthMax=(L=r.value.strengthMax)!==null&&L!==void 0?L:"",z.value.maxValue=r.value.strengthMax,r.value.userNote=(C=r.value.userNote)!==null&&C!==void 0?C:"",z.value.notesValue=r.value.userNote,r.value.loraWorks=(G=r.value.loraWorks)!==null&&G!==void 0?G:"",z.value.loraWorksValue=r.value.loraWorks,r.value.user_diy_fileds&&(m.value=r.value.user_diy_fileds),a.value=!1})}).catch(()=>{ue({type:"warn",str:"message.networkError"}),a.value=!1})},Ae=ee=>{let J=new URL(ee).pathname.split("/").pop();return J=J.split("?")[0],decodeURIComponent(J)},fe=async ee=>{try{const F=await fetch(ee),J=Ae(ee),Y=await F.blob();fo.postUplaodImg(Y,r.value.file,J).then(()=>{ue({type:"success",str:"message.saveSuccess"})}).catch(()=>{ue({type:"warn",str:"message.unknownError"})})}catch{ue({type:"warn",str:"message.unknownError"})}},_e=Ht(()=>{var ee;return(ee=r.value.links)==null?void 0:ee.find(F=>F.includes("civitai.com/models"))}),ae=Ht(()=>{var ee,F;return((F=(ee=r.value.raw)==null?void 0:ee.civitai)==null?void 0:F.error)==="Model not found"}),W=Ht(()=>r.value.trainedWords||[]),re=()=>{var F;const ee=((F=u.value)==null?void 0:F.scrollTop)||0;a.value=!0,fo.getLoraRefresh({file:I.value}).then(J=>{r.value=J.data,vt(()=>{let Y,L,C,G,de,Se;r.value.name=r.value.name||((L=(Y=r.value.raw)===null||Y===void 0?void 0:Y.metadata)===null||L===void 0?void 0:L.ss_output_name===void 0?L["modelspec.title"]:L.ss_output_name)||"",z.value.nameValue=r.value.name,r.value.strengthMin=(C=r.value.strengthMin)!==null&&C!==void 0?C:"",z.value.minValue=r.value.strengthMin,r.value.strengthMax=(G=r.value.strengthMax)!==null&&G!==void 0?G:"",z.value.maxValue=r.value.strengthMax,r.value.userNote=(de=r.value.userNote)!==null&&de!==void 0?de:"",z.value.notesValue=r.value.userNote,r.value.loraWorks=(Se=r.value.loraWorks)!==null&&Se!==void 0?Se:"",z.value.loraWorksValue=r.value.loraWorks,r.value.user_diy_fileds&&(m.value=r.value.user_diy_fileds),a.value=!1}),vt(()=>{a.value=!1}),u.value&&(u.value.scrollTop=ee),ue({type:"success",str:"message.dataLoaded"})}).catch(()=>{ue({type:"warn",str:"message.networkError"}),a.value=!1})},Q=ee=>{M.value[ee]?ye(ee):X(ee)},X=ee=>{var F,J;M.value[ee]=!0,ee in m.value?z.value[ee]=((J=(F=r.value.user_diy_fileds)==null?void 0:F[ee])==null?void 0:J.value)||"":z.value[ee]=r.value[ee],vt(()=>{ee==="name"&&p.value&&p.value.focus()})},ye=ee=>{ee in m.value?(r.value.user_diy_fileds||(r.value.user_diy_fileds={}),r.value.user_diy_fileds[ee]={label:m.value[ee].label,value:z.value[ee]}):r.value[ee]=z.value[ee],Z(r.value),M.value[ee]=!1},pe=ee=>{M.value[ee]=!1,z.value[ee]=r.value[ee]},Z=ee=>{var J;const F=((J=u.value)==null?void 0:J.scrollTop)||0;a.value=!0,fo.postLoraSave(I.value,ee).then(Y=>{r.value=Y.data,vt(()=>{let L,C,G,de,Se,Le;r.value.name=r.value.name||((C=(L=r.value.raw)===null||L===void 0?void 0:L.metadata)===null||C===void 0?void 0:C.ss_output_name===void 0?C["modelspec.title"]:C.ss_output_name)||"",z.value.nameValue=r.value.name,r.value.strengthMin=(G=r.value.strengthMin)!==null&&G!==void 0?G:"",z.value.minValue=r.value.strengthMin,r.value.strengthMax=(de=r.value.strengthMax)!==null&&de!==void 0?de:"",z.value.maxValue=r.value.strengthMax,r.value.userNote=(Se=r.value.userNote)!==null&&Se!==void 0?Se:"",z.value.notesValue=r.value.userNote,r.value.loraWorks=(Le=r.value.loraWorks)!==null&&Le!==void 0?Le:"",z.value.loraWorksValue=r.value.loraWorks,r.value.user_diy_fileds&&(m.value=r.value.user_diy_fileds),a.value=!1,vt(()=>{u.value&&(u.value.scrollTop=F)})}),ue({type:"success",str:"message.saveSuccess"})}).catch(()=>{ue({type:"warn",str:"message.networkError"}),a.value=!1})},oe=async ee=>{var J;const F=((J=u.value)==null?void 0:J.scrollTop)||0;a.value=!0,await fo.postLoraDelet(I.value,ee).then(Y=>{r.value=Y.data,vt(()=>{let L,C,G,de,Se,Le;r.value.name=r.value.name||((C=(L=r.value.raw)===null||L===void 0?void 0:L.metadata)===null||C===void 0?void 0:C.ss_output_name===void 0?C["modelspec.title"]:C.ss_output_name)||"",z.value.nameValue=r.value.name,r.value.strengthMin=(G=r.value.strengthMin)!==null&&G!==void 0?G:"",z.value.minValue=r.value.strengthMin,r.value.strengthMax=(de=r.value.strengthMax)!==null&&de!==void 0?de:"",z.value.maxValue=r.value.strengthMax,r.value.userNote=(Se=r.value.userNote)!==null&&Se!==void 0?Se:"",z.value.notesValue=r.value.userNote,r.value.loraWorks=(Le=r.value.loraWorks)!==null&&Le!==void 0?Le:"",z.value.loraWorksValue=r.value.loraWorks,r.value.user_diy_fileds&&(m.value=r.value.user_diy_fileds),a.value=!1,vt(()=>{u.value&&(u.value.scrollTop=F)})}),ue({type:"success",str:"message.deleteSuccess"})}).catch(()=>{ue({type:"warn",str:"message.networkError"}),a.value=!1})},be=ee=>{const F=ce.value.indexOf(ee);F===-1?ce.value.push(ee):ce.value.splice(F,1)},ve=ee=>ce.value.includes(ee),he=()=>{ce.value.length&&navigator.clipboard.writeText(ce.value).then(()=>{ue({type:"success",str:"message.copySuccess"})},()=>{ue({type:"warn",str:"message.copyFailed"})})};S(!1),S(!1),Ht(()=>a.value?o("common.loading"):o("common.ready"));const te=S(!0),K=()=>{te.value=!te.value};return(ee,F)=>(E(),D(Ke,null,[s.value?(E(),Jt(co,{key:0,title:v(o)("lora.title"),position:x.value.loraDetail.position,size:x.value.loraDetail.size,"z-index":v(nt).getZIndex("loraDetail"),"onUpdate:position":F[5]||(F[5]=J=>k("loraDetail",J)),"onUpdate:size":F[6]||(F[6]=J=>$("loraDetail",J)),onActive:F[7]||(F[7]=J=>v(nt).setActiveWindow("loraDetail")),onClose:F[8]||(F[8]=J=>b())},{default:Pt(()=>{var J;return[i("div",{class:"lora-detail__content",ref_key:"loraContent",ref:u},[a.value?(E(),D("div",A7,F[9]||(F[9]=[i("svg",{viewBox:"0 0 24 24",width:"24",height:"24",class:"is-rotating"},[i("path",{d:"M12 4V2C6.48 2 2 6.48 2 12H4C4 7.58 7.58 4 12 4Z"})],-1)]))):Ce("",!0),i("div",M7,[F[24]||(F[24]=i("div",{class:"lora-detail__title"},"Lora 信息",-1)),i("ul",I7,[r.value.type?(E(),D("li",{key:0,class:We(["lora-detail__tag",`-type-${r.value.type.toLowerCase()}`]),title:v(o)("lora.type")},y(r.value.type),11,D7)):Ce("",!0),r.value.baseModel?(E(),D("li",{key:1,class:We(["lora-detail__tag",`-basemodel-${r.value.baseModel.toLowerCase()}`]),title:v(o)("lora.baseModel")},y(r.value.baseModel),11,O7)):Ce("",!0)]),i("table",R7,[i("tbody",null,[i("tr",null,[i("td",P7,y(v(o)("lora.file")),1),i("td",N7,y(r.value.file),1),i("td",F7,[i("button",{class:"fetch-btn",onClick:F[0]||(F[0]=Y=>me(r.value.raw.metadata))},y(v(o)("lora.seeLoraRaw")),1)])]),i("tr",null,[i("td",B7,y(v(o)("lora.hash")),1),i("td",U7,y(r.value.sha256),1)]),i("tr",null,[i("td",z7,y(v(o)("lora.civitai")),1),i("td",V7,[_e.value?(E(),D(Ke,{key:0},[i("a",{href:_e.value,target:"_blank",class:"civitai-link"},[F[10]||(F[10]=i("svg",{viewBox:"0 0 24 24",width:"16",height:"16",class:"civitai-icon"},[i("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-1 15v-4H8l4-7v4h3l-4 7z"})],-1)),i("span",null,y(v(o)("lora.viewOnCivitai")),1)],8,W7),i("button",{style:{"margin-left":"10px"},class:"refresh-btn",onClick:re},y(v(o)("lora.getCivitData")),1)],64)):ae.value?(E(),D("div",j7,[i("i",null,y(v(o)("lora.modelNotFound")),1),(E(),D("svg",{viewBox:"0 0 24 24",width:"16",height:"16",class:"help-icon",title:v(o)("lora.modelNotFoundTip")},F[11]||(F[11]=[i("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 17h-2v-2h2v2zm2.07-7.75l-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25z"},null,-1)]),8,H7))])):(E(),D("button",{key:2,class:"fetch-btn",onClick:re},y(v(o)("lora.fetchFromCivitai")),1))])]),i("tr",{class:We({"is-editing":M.value.name})},[i("td",G7,[ut(y(v(o)("lora.name"))+" ",1),(E(),D("svg",{viewBox:"0 0 24 24",width:"16",height:"16",class:"help-icon",title:v(o)("lora.nameTip")},F[12]||(F[12]=[i("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 17h-2v-2h2v2zm2.07-7.75l-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25z"},null,-1)]),8,q7))]),i("td",null,[M.value.name?$e((E(),D("input",{key:0,"onUpdate:modelValue":F[1]||(F[1]=Y=>z.value.name=Y),type:"text",onKeyup:[F[2]||(F[2]=Rn(Y=>ye("name"),["enter"])),F[3]||(F[3]=Rn(Y=>pe("name"),["esc"]))],ref_key:"nameInput",ref:p},null,544)),[[ze,z.value.name]]):(E(),D("span",Y7,y(r.value.name),1))]),i("td",K7,[i("button",{class:"edit-btn",onClick:F[4]||(F[4]=Y=>Q("name"))},[(E(),D("svg",J7,[M.value.name?(E(),D("path",X7)):(E(),D("path",Q7))]))])])],2),i("tr",null,[i("td",Z7,y(v(o)("lora.baseModel")),1),i("td",eS,y(!r.value.baseModelFile&&!r.value.baseModelFile?"":(r.value.baseModel||"")+(r.value.baseModelFile?`
|
||
(${r.value.baseModelFile})`:"")),1)]),i("tr",null,[i("td",tS,y(v(o)("lora.skipClip")),1),i("td",nS,y((ee._t=(ee._s=r.value.raw)===null||ee._s===void 0?void 0:ee._s.metadata)===null||ee._t===void 0?void 0:ee._t.ss_clip_skip),1)]),(E(),D(Ke,null,lt(P,Y=>i("tr",{key:Y.key,class:We({"is-editing":M.value[Y.key]})},[i("td",oS,[ut(y(Y.label)+" ",1),Y.tip?(E(),D("svg",{key:0,viewBox:"0 0 24 24",width:"16",height:"16",class:"help-icon",title:Y.tip},F[13]||(F[13]=[i("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 17h-2v-2h2v2zm2.07-7.75l-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25z"},null,-1)]),8,aS)):Ce("",!0)]),i("td",null,[M.value[Y.key]?$e((E(),D("input",{key:0,"onUpdate:modelValue":L=>z.value[Y.key]=L,type:Y.type||"text",onKeyup:[Rn(L=>ye(Y.key),["enter"]),Rn(L=>pe(Y.key),["esc"])]},null,40,rS)),[[cf,z.value[Y.key]]]):(E(),D("span",iS,y(r.value[Y.key]),1))]),i("td",sS,[i("button",{class:"edit-btn",onClick:L=>Q(Y.key),title:v(o)("promptBox.settings.edit")},[(E(),D("svg",uS,[M.value[Y.key]?(E(),D("path",cS)):(E(),D("path",dS))]))],8,lS)])],2)),64)),(E(!0),D(Ke,null,lt(m.value,(Y,L)=>{var C;return E(),D("tr",{key:L,class:We({"is-editing":M.value[L]})},[i("td",pS,[M.value[L]?$e((E(),D("input",{key:0,"onUpdate:modelValue":G=>Y.label=G,type:"text"},null,8,fS)),[[ze,Y.label]]):(E(),D("span",gS,y(Y.label),1))]),i("td",null,[M.value[L]?$e((E(),D("input",{key:0,"onUpdate:modelValue":G=>z.value[L]=G,type:Y.type||"text",onKeyup:[Rn(G=>ye(L),["enter"]),Rn(G=>pe(L),["esc"])]},null,40,mS)),[[cf,z.value[L]]]):(E(),D("span",hS,y(r.value.user_diy_fileds?(C=r.value.user_diy_fileds[L])==null?void 0:C.value:""),1))]),i("td",vS,[i("button",{class:"edit-btn",onClick:G=>Q(L),title:v(o)("promptBox.settings.edit")},[(E(),D("svg",yS,[M.value[L]?(E(),D("path",bS)):(E(),D("path",wS))]))],8,_S),i("button",{style:{"margin-left":"5px",color:"#f87171"},onClick:G=>ie(L),class:"edit-btn",title:v(o)("promptBox.settings.delete")},y(v(o)("promptBox.settings.delete")),9,xS)])],2)}),128)),i("div",SS,[i("button",{onClick:le,class:"add-btn",title:v(o)("lora.addDiyFiled")},y(v(o)("lora.addDiyFiled")),9,TS)]),W.value.length?(E(),D("tr",kS,[i("td",CS,[ut(y(v(o)("lora.trainedWords"))+" ",1),(E(),D("svg",{viewBox:"0 0 24 24",width:"16",height:"16",class:"help-icon",title:v(o)("lora.trainedWordsTip")},F[14]||(F[14]=[i("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 17h-2v-2h2v2zm2.07-7.75l-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25z"},null,-1)]),8,ES)),ce.value.length?(E(),D("div",$S,[ut(y(v(o)("lora.selectedWords",{count:ce.value.length}))+" ",1),i("button",{class:"copy-btn",onClick:he},y(v(o)("common.copy")),1)])):Ce("",!0)]),i("td",LS,[i("ul",AS,[(E(!0),D(Ke,null,lt(te.value?W.value.slice(0,10):W.value,(Y,L)=>(E(),D("li",{key:"words-"+L,class:We(["word-item",{"is-selected":ve(Y.word),"is-hidden":te.value&&L>=10}]),onClick:C=>be(Y.word)},[i("span",null,y(Y.word),1),Y.civitai?(E(),D("svg",IS,F[15]||(F[15]=[i("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-1 15v-4H8l4-7v4h3l-4 7z"},null,-1)]))):Ce("",!0),Y.count!=null?(E(),D("small",DS,y(Y.count),1)):Ce("",!0)],10,MS))),128)),W.value.length>10?(E(),D("li",{key:0,class:"toggle-btn",onClick:K},y(te.value?v(o)("common.showMore"):v(o)("common.showLess")),1)):Ce("",!0)])])])):Ce("",!0)])]),(J=r.value.images)!=null&&J.length?(E(),D("ul",OS,[(E(!0),D(Ke,null,lt(r.value.images,(Y,L)=>(E(),D("li",{key:L,class:"lora-detail__image-item"},[i("figure",null,[i("div",RS,[i("div",{class:"image-action",onClick:C=>fe(Y.url)},"设置为Lora封面",8,PS),i("img",{src:Y.url},null,8,NS)]),i("figcaption",FS,[Y.civitaiUrl?(E(),D("span",BS,[i("a",{href:Y.civitaiUrl,target:"_blank",class:"civitai-link"},F[16]||(F[16]=[ut(" C站 civitai "),i("svg",{viewBox:"0 0 24 24",width:"16",height:"16"},[i("path",{d:"M19 19H5V5h7V3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7h-2v7zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3h-7z"})],-1)]),8,US)])):Ce("",!0),Y.seed?(E(),D("span",zS,[F[17]||(F[17]=i("label",null,"种子 seed",-1)),ut(" "+y(Y.seed),1)])):Ce("",!0),Y.steps?(E(),D("span",VS,[F[18]||(F[18]=i("label",null,"步数 steps",-1)),ut(" "+y(Y.steps),1)])):Ce("",!0),Y.cfg?(E(),D("span",WS,[F[19]||(F[19]=i("label",null,"引导系数 cfg",-1)),ut(" "+y(Y.cfg),1)])):Ce("",!0),Y.sampler?(E(),D("span",jS,[F[20]||(F[20]=i("label",null,"采样器 sampler",-1)),ut(" "+y(Y.sampler),1)])):Ce("",!0),Y.model?(E(),D("span",HS,[F[21]||(F[21]=i("label",null,"基础模型 model",-1)),ut(" "+y(Y.model),1)])):Ce("",!0),Y.positive?(E(),D("span",GS,[F[22]||(F[22]=i("label",null,"正向提示词 positive",-1)),ut(" "+y(Y.positive),1)])):Ce("",!0),Y.negative?(E(),D("span",qS,[F[23]||(F[23]=i("label",null,"反向提示词 negative",-1)),ut(" "+y(Y.negative),1)])):Ce("",!0)])])]))),128))])):Ce("",!0)])],512)]}),_:1},8,["title","position","size","z-index"])):Ce("",!0),it(L7,{ref_key:"loraRawRef",ref:V},null,512)],64))}},[["__scopeId","data-v-0b29ccf2"]]),YS={key:0,class:"lora-detail__loading"},KS={class:"lora-detail__body"},JS={class:"lora-detail__tags"},XS=["title"],QS=["title"],ZS={class:"lora-detail__table"},e9={class:"label"},t9={colspan:"2"},n9={class:"label"},o9={colspan:"2",class:"hash"},a9={class:"label"},r9={colspan:"2"},i9=["href"],s9={key:1,class:"not-found"},l9=["title"],u9={class:"label"},c9=["title"],d9={key:1,class:"text"},p9={class:"label"},f9={colspan:"2"},g9={class:"label"},m9={colspan:"2"},h9={class:"label"},v9=["title"],_9={class:"text"},y9={class:"actions"},b9=["onClick","title"],w9={class:"label"},x9=["onUpdate:modelValue"],S9={key:1},T9={class:"text"},k9={class:"actions"},C9=["onClick","title"],E9={key:0},$9={class:"label"},L9=["title"],A9={key:0,class:"word-selection"},M9={colspan:"2"},I9={class:"word-list"},D9=["onClick"],O9={key:0,viewBox:"0 0 24 24",width:"16",height:"16",class:"civitai-icon"},R9={key:1},P9={key:0,class:"lora-detail__images",style:{display:"grid","grid-template-columns":"repeat(2, 1fr)",gap:"12px"}},N9={class:"image-wrapper",style:{height:"200px"}},F9=["src"],Lc=qt({__name:"lora_card",props:{fileNmae:{type:String,required:!0},paddingLeft:{type:Number,required:!1,default:100},paddingTop:{type:Number,required:!1,default:100}},emits:["cardLeave","cardenter"],setup(e,{expose:t,emit:n}){const{t:o}=Gt(),a=S(!1),r=S({}),s=S(),u=S(null),p=S({}),m=e,f=S(""),g=n,x=()=>{g("cardLeave")},b=()=>{g("cardenter")},k=S({}),$=S({}),O=S([]),I=[{key:"strengthMin",label:o("lora.strengthMin"),tip:o("lora.strengthMinTip"),type:"number"},{key:"strengthMax",label:o("lora.strengthMax"),tip:o("lora.strengthMaxTip"),type:"number"},{key:"strWeight",label:o("lora.strWeight"),tip:o("lora.strWeightTip"),type:"number"},{key:"loraWorks",label:o("lora.promptWords"),tip:o("lora.promptWordsTip")}];Ut(()=>{V()});const V=()=>{f.value=m.fileNmae,r.value={},O.value=[],$.value={name:!1,nameValue:"",min:!1,minValue:"",max:!1,maxValue:"",notes:!1,notesValue:"",loraWorks:!1,loraWorksValue:""},fo.getLoraDetail({file:f.value,refresh:!1,light:!1}).then(Q=>{r.value=Q.data,vt(()=>{let X,ye,pe,Z,oe,be;r.value.name=r.value.name||((ye=(X=r.value.raw)===null||X===void 0?void 0:X.metadata)===null||ye===void 0?void 0:ye.ss_output_name===void 0?ye["modelspec.title"]:ye.ss_output_name)||"",$.value.nameValue=r.value.name,r.value.strengthMin=(pe=r.value.strengthMin)!==null&&pe!==void 0?pe:"",$.value.minValue=r.value.strengthMin,r.value.strengthMax=(Z=r.value.strengthMax)!==null&&Z!==void 0?Z:"",$.value.maxValue=r.value.strengthMax,r.value.userNote=(oe=r.value.userNote)!==null&&oe!==void 0?oe:"",$.value.notesValue=r.value.userNote,r.value.loraWorks=(be=r.value.loraWorks)!==null&&be!==void 0?be:"",$.value.loraWorksValue=r.value.loraWorks,p.value=r.value.user_diy_fileds,a.value=!1})}).catch(()=>{ue({type:"warn",str:"message.networkError"}),a.value=!1})},me=Q=>{navigator.clipboard.writeText(Q).then(()=>{ue({type:"success",str:"已复制到剪贴板"})}).catch(()=>{ue({type:"error",str:"复制失败"})})},M=Ht(()=>{var Q;return(Q=r.value.links)==null?void 0:Q.find(X=>X.includes("civitai.com/models"))}),z=Ht(()=>{var Q,X;return((X=(Q=r.value.raw)==null?void 0:Q.civitai)==null?void 0:X.error)==="Model not found"}),ce=Ht(()=>r.value.trainedWords||[]),P=()=>{var X;const Q=((X=s.value)==null?void 0:X.scrollTop)||0;a.value=!0,fo.getLoraRefresh({file:f.value}).then(ye=>{r.value=ye.data,vt(()=>{let pe,Z,oe,be,ve;r.value.name=r.value.name||((Z=(pe=r.value.raw)===null||pe===void 0?void 0:pe.metadata)===null||Z===void 0?void 0:Z.ss_output_name===void 0?Z["modelspec.title"]:Z.ss_output_name)||"",$.value.nameValue=r.value.name,r.value.strengthMin=(oe=r.value.strengthMin)!==null&&oe!==void 0?oe:"",$.value.minValue=r.value.strengthMin,r.value.strengthMax=(be=r.value.strengthMax)!==null&&be!==void 0?be:"",$.value.maxValue=r.value.strengthMax,r.value.userNote=(ve=r.value.userNote)!==null&&ve!==void 0?ve:"",$.value.notesValue=r.value.userNote,a.value=!1}),vt(()=>{a.value=!1}),s.value&&(s.value.scrollTop=Q),ue({type:"success",str:"message.dataLoaded"})}).catch(()=>{ue({type:"warn",str:"message.networkError"}),a.value=!1})},le=Q=>{Q in p.value?(r.value.user_diy_fileds||(r.value.user_diy_fileds={}),r.value.user_diy_fileds[Q]={label:p.value[Q].label,value:$.value[Q]}):r.value[Q]=$.value[Q],Oe(r.value),k.value[Q]=!1},ie=Q=>{k.value[Q]=!1,$.value[Q]=r.value[Q]},Oe=Q=>{var ye;const X=((ye=s.value)==null?void 0:ye.scrollTop)||0;a.value=!0,fo.postLoraSave(f.value,Q).then(pe=>{r.value=pe.data,vt(()=>{let Z,oe,be,ve,he;r.value.name=r.value.name||((oe=(Z=r.value.raw)===null||Z===void 0?void 0:Z.metadata)===null||oe===void 0?void 0:oe.ss_output_name===void 0?oe["modelspec.title"]:oe.ss_output_name)||"",$.value.nameValue=r.value.name,r.value.strengthMin=(be=r.value.strengthMin)!==null&&be!==void 0?be:"",$.value.minValue=r.value.strengthMin,r.value.strengthMax=(ve=r.value.strengthMax)!==null&&ve!==void 0?ve:"",$.value.maxValue=r.value.strengthMax,r.value.userNote=(he=r.value.userNote)!==null&&he!==void 0?he:"",$.value.notesValue=r.value.userNote,a.value=!1,vt(()=>{s.value&&(s.value.scrollTop=X)})}),ue({type:"success",str:"message.saveSuccess"})}).catch(()=>{ue({type:"warn",str:"message.networkError"}),a.value=!1})},Ae=Q=>{const X=O.value.indexOf(Q);X===-1?O.value.push(Q):O.value.splice(X,1)},fe=Q=>O.value.includes(Q),_e=()=>{O.value.length&&navigator.clipboard.writeText(O.value).then(()=>{ue({type:"success",str:"message.copySuccess"})},()=>{ue({type:"warn",str:"message.copyFailed"})})},ae=S(!0),W=()=>{ae.value=!ae.value};return t({refresh:()=>{V()}}),(Q,X)=>{var ye;return E(),D("div",{class:"lora_catd_content",style:Bt(["left: "+e.paddingLeft+"px;top: "+e.paddingTop+"px;",{"font-size":"0.55em"}]),onMouseenter:b,onMouseleave:x},[i("div",{class:"close-button",onClick:x,title:"关闭"},X[3]||(X[3]=[i("span",null,"×",-1)])),i("div",{class:"lora-detail__content",ref_key:"loraContent",ref:s},[a.value?(E(),D("div",YS,X[4]||(X[4]=[i("svg",{viewBox:"0 0 24 24",width:"24",height:"24",class:"is-rotating"},[i("path",{d:"M12 4V2C6.48 2 2 6.48 2 12H4C4 7.58 7.58 4 12 4Z"})],-1)]))):Ce("",!0),i("div",KS,[X[13]||(X[13]=i("div",{class:"lora-detail__title"},"Lora 信息",-1)),i("ul",JS,[r.value.type?(E(),D("li",{key:0,class:We(["lora-detail__tag",`-type-${r.value.type.toLowerCase()}`]),title:v(o)("lora.type")},y(r.value.type),11,XS)):Ce("",!0),r.value.baseModel?(E(),D("li",{key:1,class:We(["lora-detail__tag",`-basemodel-${r.value.baseModel.toLowerCase()}`]),title:v(o)("lora.baseModel")},y(r.value.baseModel),11,QS)):Ce("",!0)]),i("table",ZS,[i("tbody",null,[i("tr",null,[i("td",e9,y(v(o)("lora.file")),1),i("td",t9,y(r.value.file),1)]),i("tr",null,[i("td",n9,y(v(o)("lora.hash")),1),i("td",o9,y(r.value.sha256),1)]),i("tr",null,[i("td",a9,y(v(o)("lora.civitai")),1),i("td",r9,[M.value?(E(),D(Ke,{key:0},[i("a",{href:M.value,target:"_blank",class:"civitai-link"},[X[5]||(X[5]=i("svg",{viewBox:"0 0 24 24",width:"16",height:"16",class:"civitai-icon"},[i("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-1 15v-4H8l4-7v4h3l-4 7z"})],-1)),i("span",null,y(v(o)("lora.viewOnCivitai")),1)],8,i9),i("button",{style:{"margin-left":"10px"},class:"refresh-btn",onClick:P},y(v(o)("lora.getCivitData")),1)],64)):z.value?(E(),D("div",s9,[i("i",null,y(v(o)("lora.modelNotFound")),1),(E(),D("svg",{viewBox:"0 0 24 24",width:"16",height:"16",class:"help-icon",title:v(o)("lora.modelNotFoundTip")},X[6]||(X[6]=[i("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 17h-2v-2h2v2zm2.07-7.75l-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25z"},null,-1)]),8,l9))])):(E(),D("button",{key:2,class:"fetch-btn",onClick:P},y(v(o)("lora.fetchFromCivitai")),1))])]),i("tr",{class:We({"is-editing":k.value.name})},[i("td",u9,[ut(y(v(o)("lora.name"))+" ",1),(E(),D("svg",{viewBox:"0 0 24 24",width:"16",height:"16",class:"help-icon",title:v(o)("lora.nameTip")},X[7]||(X[7]=[i("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 17h-2v-2h2v2zm2.07-7.75l-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25z"},null,-1)]),8,c9))]),i("td",null,[k.value.name?$e((E(),D("input",{key:0,"onUpdate:modelValue":X[0]||(X[0]=pe=>$.value.name=pe),type:"text",onKeyup:[X[1]||(X[1]=Rn(pe=>le("name"),["enter"])),X[2]||(X[2]=Rn(pe=>ie("name"),["esc"]))],ref_key:"nameInput",ref:u},null,544)),[[ze,$.value.name]]):(E(),D("span",d9,y(r.value.name),1))])],2),i("tr",null,[i("td",p9,y(v(o)("lora.baseModel")),1),i("td",f9,y(!r.value.baseModelFile&&!r.value.baseModelFile?"":(r.value.baseModel||"")+(r.value.baseModelFile?`
|
||
(${r.value.baseModelFile})`:"")),1)]),i("tr",null,[i("td",g9,y(v(o)("lora.skipClip")),1),i("td",m9,y((Q._t=(Q._s=r.value.raw)===null||Q._s===void 0?void 0:Q._s.metadata)===null||Q._t===void 0?void 0:Q._t.ss_clip_skip),1)]),(E(),D(Ke,null,lt(I,pe=>i("tr",{key:pe.key,class:We({"is-editing":k.value[pe.key]})},[i("td",h9,[ut(y(pe.label)+" ",1),pe.tip?(E(),D("svg",{key:0,viewBox:"0 0 24 24",width:"16",height:"16",class:"help-icon",title:pe.tip},X[8]||(X[8]=[i("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 17h-2v-2h2v2zm2.07-7.75l-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25z"},null,-1)]),8,v9)):Ce("",!0)]),i("td",null,[i("span",_9,y(r.value[pe.key]),1)]),i("td",y9,[i("button",{class:"copy-btn",onClick:Z=>me(r.value[pe.key]),title:v(o)("lora.copy")},[X[9]||(X[9]=i("svg",{class:"svg-icon",viewBox:"0 0 24 24",width:"16",height:"16"},[i("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z"})],-1)),ut(" "+y(v(o)("lora.copy")),1)],8,b9)])],2)),64)),(E(!0),D(Ke,null,lt(p.value,(pe,Z)=>{var oe;return E(),D("tr",{key:Z,class:We({"is-editing":k.value[Z]})},[i("td",w9,[k.value[Z]?$e((E(),D("input",{key:0,"onUpdate:modelValue":be=>pe.label=be,type:"text"},null,8,x9)),[[ze,pe.label]]):(E(),D("span",S9,y(pe.label),1))]),i("td",null,[i("span",T9,y(r.value.user_diy_fileds?(oe=r.value.user_diy_fileds[Z])==null?void 0:oe.value:""),1)]),i("td",k9,[i("button",{class:"copy-btn",onClick:be=>{var ve;return me((ve=r.value.user_diy_fileds[Z])==null?void 0:ve.value)},title:v(o)("lora.copy")},[X[10]||(X[10]=i("svg",{class:"svg-icon",viewBox:"0 0 24 24",width:"16",height:"16"},[i("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z"})],-1)),ut(" "+y(v(o)("lora.copy")),1)],8,C9)])],2)}),128)),ce.value.length?(E(),D("tr",E9,[i("td",$9,[ut(y(v(o)("lora.trainedWords"))+" ",1),(E(),D("svg",{viewBox:"0 0 24 24",width:"16",height:"16",class:"help-icon",title:v(o)("lora.trainedWordsTip")},X[11]||(X[11]=[i("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 17h-2v-2h2v2zm2.07-7.75l-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25z"},null,-1)]),8,L9)),O.value.length?(E(),D("div",A9,[ut(y(v(o)("lora.selectedWords",{count:O.value.length}))+" ",1),i("button",{class:"copy-btn",onClick:_e},y(v(o)("common.copy")),1)])):Ce("",!0)]),i("td",M9,[i("ul",I9,[(E(!0),D(Ke,null,lt(ae.value?ce.value.slice(0,10):ce.value,(pe,Z)=>(E(),D("li",{key:"words-"+Z,class:We(["word-item",{"is-selected":fe(pe.word),"is-hidden":ae.value&&Z>=10}]),onClick:oe=>Ae(pe.word)},[i("span",null,y(pe.word),1),pe.civitai?(E(),D("svg",O9,X[12]||(X[12]=[i("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-1 15v-4H8l4-7v4h3l-4 7z"},null,-1)]))):Ce("",!0),pe.count!=null?(E(),D("small",R9,y(pe.count),1)):Ce("",!0)],10,D9))),128)),ce.value.length>10?(E(),D("li",{key:0,class:"toggle-btn",onClick:W},y(ae.value?v(o)("common.showMore"):v(o)("common.showLess")),1)):Ce("",!0)])])])):Ce("",!0)])]),(ye=r.value.images)!=null&&ye.length?(E(),D("ul",P9,[(E(!0),D(Ke,null,lt(r.value.images,(pe,Z)=>(E(),D("li",{key:Z,class:"lora-detail__image-item"},[i("div",N9,[i("img",{src:pe.url,style:{width:"100%",height:"100%","object-fit":"contain"}},null,8,F9)])]))),128))])):Ce("",!0)])],512)],36)}}},[["__scopeId","data-v-b0ee2f35"]]),B9={class:"header-actions"},U9=["title"],z9=["onMouseover","onDragstart","onDrop"],V9={class:"lora-info"},W9={class:"lora-header"},j9=["title"],H9={class:"lora-actions"},G9=["onClick","title"],q9=["onClick","title"],Y9={class:"lora-weights-row"},K9={class:"weight-item-col"},J9=["onUpdate:modelValue"],X9={class:"weight-item-col"},Q9=["onUpdate:modelValue"],Z9={class:"weight-item-col"},eT=["onUpdate:modelValue"],tT={class:"switch-item-col"},nT={class:"switch"},oT=["checked","onChange"],Fa="weilin_prompt_ui_",aT=qt({__name:"lora_stack",props:{isOpen:{type:Boolean,default:!1},selectedLoras:{type:Array,default:()=>[]}},emits:["close","update:selectedLoras"],setup(e,{expose:t,emit:n}){const{t:o}=Gt(),a=S(!1),r=S(""),s=S(100),u=S(0),p=S(),m=S(!1),f=S(!1),g=S(),x=e,b=n,k=(ae,W)=>{if(f.value=!0,r.value===ae&&a.value)return;const Q=W.currentTarget.getBoundingClientRect(),ye={left:Q.left-450-10,top:Q.top};ye.left<10&&(ye.left=Q.right+10),ye.top=Math.max(10,Math.min(ye.top,window.innerHeight-310)),s.value=ye.left,u.value=ye.top,a.value=!0,r.value=ae,vt(()=>{g.value.refresh()})},$=()=>{f.value=!1,setTimeout(()=>{!m.value&&!f.value&&(a.value=!1,r.value="",m.value=!1)},200)},O=()=>{m.value=!0,f.value=!0},I=()=>{a.value=!1,r.value="",m.value=!1},V=()=>{window.postMessage({type:"weilin_prompt_ui_openLoraManager_addLora"},"*")},me=ae=>{ae.hidden=!ae.hidden},M=ae=>{if(x.selectedLoras&&!x.selectedLoras.find(W=>W.name===ae.name)){const W={name:ae.name,weight:ae.weight||1,text_encoder_weight:ae.text_encoder_weight||1,trigger_weight:ae.trigger_weight||1,lora:ae.lora,loraWorks:ae.loraWorks||"",display_name:ae.display_name||ae.name},re=[...x.selectedLoras,W];b("update:selectedLoras",re)}},z=ae=>{const W=x.selectedLoras.findIndex(re=>re.name===ae.name);if(W>-1){const re=x.selectedLoras.filter((Q,X)=>X!==W);b("update:selectedLoras",re)}},ce=S(),P=ae=>{ce.value.open({name:ae.lora})};window.addEventListener("message",ae=>{ae.data.type==="weilin_prompt_ui_selectLora"&&M(ae.data.lora)});let le="",ie=!1;At(()=>x.selectedLoras,ae=>{if(ie){if(ae&&ae.length>0){const re=ae.filter(Q=>!Q.hidden).map(Q=>`<wlr:${Q.lora?Q.lora.replace(".safetensors",""):Q.name}:${Q.weight||1}:${Q.text_encoder_weight||1}:${Q.trigger_weight||1}>`);le=JSON.stringify(re)}else le="";return}if(ae&&ae.length>0){const re=ae.filter(X=>!X.hidden).map(X=>`<wlr:${X.lora?X.lora.replace(".safetensors",""):X.name}:${X.weight||1}:${X.text_encoder_weight||1}:${X.trigger_weight||1}>`),Q=JSON.stringify(re);Q!==le&&(le=Q,window.postMessage({type:"weilin_prompt_ui_update_lora_tags",tags:re},"*"))}else le!==""&&(le="",window.postMessage({type:"weilin_prompt_ui_update_lora_tags",tags:[]},"*"))},{deep:!0});const Oe=ae=>{ie=ae},Ae=S(null),fe=ae=>{Ae.value=ae},_e=ae=>{if(Ae.value===null||Ae.value===ae)return;const W=[...x.selectedLoras],re=W.splice(Ae.value,1)[0];W.splice(ae,0,re),Ae.value=null,b("update:selectedLoras",W)};return t({addLora:M,removeLora:z,setInitializing:Oe}),(ae,W)=>(E(),D("div",{class:We(`${Fa}lora-stack`),style:Bt([{width:e.isOpen?"300px":"0"},{paddingRight:e.isOpen?"16px":"0"}])},[i("div",{class:We(`${Fa}lora-content`)},[i("div",{class:We(`${Fa}lora-header`)},[i("h3",{class:We(`${Fa}lora-title`)},y(v(o)("controls.loraStack")),3),i("div",B9,[i("button",{class:We(`${Fa}add-btn`),onClick:V,title:v(o)("controls.addLora")},W[2]||(W[2]=[i("svg",{viewBox:"0 0 24 24",width:"16",height:"16"},[i("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"})],-1)]),10,U9),i("button",{class:We(`${Fa}close-btn`),onClick:W[0]||(W[0]=re=>ae.$emit("close"))},W[3]||(W[3]=[i("svg",{viewBox:"0 0 24 24",width:"16",height:"16"},[i("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})],-1)]),2)])],2),i("div",{class:We(`${Fa}lora-body`)},[i("div",{class:We(`${Fa}lora-list`)},[(E(!0),D(Ke,null,lt(e.selectedLoras,(re,Q)=>(E(),D("div",{ref_for:!0,ref_key:"loraStackItemRef",ref:p,key:re.name,class:We(["lora-item",{"hidden-lora":re.hidden}]),onMouseover:X=>k(re.lora,X),onMouseleave:$,draggable:"true",onDragstart:X=>fe(Q),onDragover:W[1]||(W[1]=Tt(()=>{},["prevent"])),onDrop:X=>_e(Q)},[i("div",V9,[i("div",W9,[i("span",{class:"lora-name",title:re.name},y(re.name),9,j9),i("div",H9,[i("button",{class:"look-on-btn",onClick:X=>P(re),title:v(o)("controls.lookOnLora")},W[4]||(W[4]=[i("svg",{viewBox:"0 0 1024 1024",width:"14",height:"14"},[i("path",{d:"M576.5 930.2H163.1c-52.9 0-96-43.1-96-96v-672c0-52.9 43.1-96 96-96h672c52.9 0 96 43.1 96 96V577c0 17.7-14.3 32-32 32s-32-14.3-32-32V162.2c0-17.6-14.4-32-32-32h-672c-17.6 0-32 14.4-32 32v672c0 17.6 14.4 32 32 32h413.4c17.7 0 32 14.3 32 32s-14.3 32-32 32z","p-id":"3466"}),i("path",{d:"M692.4 322.3H245.7c-17.7 0-32-14.3-32-32s14.3-32 32-32h446.7c17.7 0 32 14.3 32 32s-14.3 32-32 32zM388.5 530.2H245.7c-17.7 0-32-14.3-32-32s14.3-32 32-32h142.7c17.7 0 32 14.3 32 32 0.1 17.6-14.3 32-31.9 32zM388.5 738H245.7c-17.7 0-32-14.3-32-32s14.3-32 32-32h142.7c17.7 0 32 14.3 32 32 0.1 17.7-14.3 32-31.9 32z","p-id":"3467"}),i("path",{d:"M624.1 792.5c-94.8 0-172-77.2-172-172s77.2-172 172-172 172 77.2 172 172-77.1 172-172 172z m0-280c-59.6 0-108 48.4-108 108s48.4 108 108 108 108-48.4 108-108-48.4-108-108-108z","p-id":"3468"}),i("path",{d:"M820.8 864.2L710.5 753.9c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L866 818.9c12.5 12.5 12.5 32.8 0 45.3s-32.7 12.5-45.2 0z","p-id":"3469"})],-1)]),8,G9),i("button",{class:"remove-btn",onClick:X=>z(re),title:v(o)("controls.removeLora")},W[5]||(W[5]=[i("svg",{viewBox:"0 0 24 24",width:"14",height:"14"},[i("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})],-1)]),8,q9)])]),i("div",Y9,[i("div",K9,[i("label",null,y(v(o)("loraManager.modelWeight")),1),$e(i("input",{type:"number","onUpdate:modelValue":X=>re.weight=X,class:"lora-weight",step:"0.1"},null,8,J9),[[ze,re.weight]])]),i("div",X9,[i("label",null,y(v(o)("loraManager.textEncoderWeight")),1),$e(i("input",{type:"number","onUpdate:modelValue":X=>re.text_encoder_weight=X,class:"lora-weight",step:"0.1"},null,8,Q9),[[ze,re.text_encoder_weight]])]),i("div",Z9,[i("label",null,y(v(o)("loraManager.triggerWeight")),1),$e(i("input",{type:"number","onUpdate:modelValue":X=>re.trigger_weight=X,class:"lora-weight",step:"0.1"},null,8,eT),[[ze,re.trigger_weight]])]),i("div",tT,[i("label",null,y(re.hidden?v(o)("lora.hideLora"):v(o)("lora.showLora")),1),i("label",nT,[i("input",{type:"checkbox",checked:!re.hidden,onChange:X=>me(re)},null,40,oT),W[6]||(W[6]=i("span",{class:"slider"},null,-1))])])])])],42,z9))),128))],2)],2)],2),it(hl,{ref_key:"loraDetailLoraStackRef",ref:ce},null,512),a.value?(E(),Jt(Lc,{key:0,ref_key:"loraCardItem",ref:g,fileNmae:r.value,paddingLeft:s.value,paddingTop:u.value,onCardLeave:I,onCardenter:O},null,8,["fileNmae","paddingLeft","paddingTop"])):Ce("",!0)],6))}},[["__scopeId","data-v-ac4d42a1"]]),rT={class:"main-label-manager"},iT={class:"mlm-header"},sT={class:"mlm-grid"},lT=["disabled"],uT=["disabled"],cT=["onClick","title","onDragstart","onDragenter","onDrop"],dT={class:"mlm-item-main"},pT={key:0,class:"pin-badge"},fT={class:"mlm-name"},gT={class:"mlm-item-actions"},mT=["title","onClick"],hT=["title","onClick"],wh="/weilin/prompt_ui/api/",vT="weilin_prompt_ui_main_labels_v1",_T=qt({__name:"main_label_manager",props:{selectedId:{type:String,default:null}},emits:["select"],setup(e,{expose:t,emit:n}){const o=e,a=n,r=S(null),s=S(""),u=S([]),p=S(o.selectedId),m=S(!0),f=S(!0),g=S("time"),x=S(null),b=S(null);async function k(){const he={items:u.value,settings:{sortMode:g.value,sortTimeDesc:m.value,sortNameAsc:f.value,selectedId:p.value}};try{await mn.post(`${wh}labels/save`,he)}catch(te){console.error("保存标签数据失败:",te),alert(`保存失败: ${te.message}`)}}async function $(){var he;try{const K=(he=(await mn.get(`${wh}labels/get`)).data)==null?void 0:he.data;if(!K)throw new Error("no data");const ee=Array.isArray(K)?K:(K==null?void 0:K.items)??[],F=Array.isArray(K)?{}:(K==null?void 0:K.settings)??{};u.value=ee.map((J,Y)=>({id:J.id??me(),name:J.name??"未命名",content:J.content??"",createdAt:J.createdAt??J.updatedAt??Date.now(),updatedAt:J.updatedAt??J.createdAt??Date.now(),pinned:!!J.pinned,highlighted:!!J.highlighted,order:typeof J.order=="number"?J.order:Y})),F.sortMode&&(g.value=F.sortMode),typeof F.sortTimeDesc=="boolean"&&(m.value=F.sortTimeDesc),typeof F.sortNameAsc=="boolean"&&(f.value=F.sortNameAsc),(typeof F.selectedId=="string"||F.selectedId===null)&&(p.value=F.selectedId)}catch(te){console.error("加载标签数据失败:",te),u.value=[]}}Ut(async()=>{await $()}),At(()=>o.selectedId,he=>{p.value=he}),At([g,m,f],()=>{k()}),At(u,()=>{k()},{deep:!0}),At(p,he=>{k();const te=he?M(he):null;a("select",te?{...te}:null)});const O=Ht(()=>{const he=s.value.trim().toLowerCase();return he?u.value.filter(te=>(te.name||"").toLowerCase().includes(he)):u.value}),I=Ht(()=>{const he=[...O.value];if(g.value==="manual")return he.sort((F,J)=>{const Y=F.order??0,L=J.order??0;return Y!==L?Y-L:(F.createdAt??0)-(J.createdAt??0)});const te=(F,J)=>{const Y=F.name||"",L=J.name||"";let C=Y.localeCompare(L,void 0,{numeric:!0,sensitivity:"base"});return f.value||(C=-C),C},K=(F,J)=>{let Y=F.createdAt-J.createdAt;return m.value&&(Y=-Y),Y},ee=F=>F.pinned?0:1;return he.sort((F,J)=>{const Y=ee(F)-ee(J);if(Y!==0)return Y;if(g.value==="name"){const C=te(F,J);return C!==0?C:K(F,J)}const L=K(F,J);return L!==0?L:te(F,J)}),he}),V=Ht(()=>M(p.value));function me(){return`mlm_${Math.random().toString(36).slice(2)}_${Date.now()}`}function M(he){return u.value.find(te=>te.id===he)||null}function z(he){p.value=he.id,a("select",{...he})}function ce(){const he=window.prompt("新建标签名称:","");if(!he)return;re(),g.value="manual";const te=me(),K=Date.now(),ee=u.value.reduce((J,Y)=>typeof Y.order=="number"?Math.min(J,Y.order):J,0),F={id:te,name:he.trim(),content:"",createdAt:K,updatedAt:K,pinned:!1,highlighted:!1,order:ee-1};u.value.push(F),k(),p.value=te,a("select",{...F})}function P(){const he=V.value;if(!he)return;const te=window.prompt("重命名标签:",he.name||"");te&&(he.name=te.trim(),he.updatedAt=Date.now(),k())}function le(){const he=V.value;if(!he||!window.confirm(`确定删除标签"${he.name}"吗?`))return;const te=u.value.findIndex(K=>K.id===he.id);te>=0&&u.value.splice(te,1),k(),u.value.length?(p.value=u.value[0].id,a("select",{...u.value[0]})):(p.value=null,a("select",null))}function ie(){g.value="time",m.value=!m.value}function Oe(){g.value="name",f.value=!f.value}function Ae(he){he.pinned=!he.pinned,he.updatedAt=Date.now(),k()}function fe(he){he.highlighted=!he.highlighted,he.updatedAt=Date.now(),k()}function _e(he){const te=V.value;te&&(te.content=he??"",te.updatedAt=Date.now(),clearTimeout(ae),ae=setTimeout(()=>k(),400))}let ae=null;function W(he){try{const te=new Date(he);return`${te.getFullYear()}-${(te.getMonth()+1).toString().padStart(2,"0")}-${te.getDate().toString().padStart(2,"0")} ${te.getHours().toString().padStart(2,"0")}:${te.getMinutes().toString().padStart(2,"0")}`}catch{return""}}function re(){I.value.forEach((te,K)=>{te.order=K})}function Q(he,te,K){try{K.dataTransfer.effectAllowed="move"}catch{}x.value=he.id,b.value=null,re(),g.value="manual"}function X(he){x.value&&(b.value=he.id)}function ye(he){if(!x.value)return;const te=x.value,K=he==null?void 0:he.id;if(!K||te===K)return pe();const ee=[...I.value],F=ee.findIndex(L=>L.id===te),J=ee.findIndex(L=>L.id===K);if(F<0||J<0)return pe();const[Y]=ee.splice(F,1);ee.splice(J,0,Y),ee.forEach((L,C)=>{L.order=C}),k(),pe()}function pe(){x.value=null,b.value=null}async function Z(){try{const he=localStorage.getItem(vT);if(!he){alert("未找到浏览器中的旧数据");return}const te=JSON.parse(he),K=Array.isArray(te)?te:(te==null?void 0:te.items)??[],ee=Array.isArray(te)?{}:(te==null?void 0:te.settings)??{};if(!Array.isArray(K)||K.length===0){alert("浏览器中没有可迁移的数据");return}if(!window.confirm(`发现浏览器中有 ${K.length} 个标签
|
||
|
||
点击"确定"将这些数据迁移到服务器
|
||
(会与服务器现有数据合并,不会覆盖)`))return;const J=new Set(u.value.map(C=>C.id)),Y=u.value.reduce((C,G)=>Math.max(C,typeof G.order=="number"?G.order:C),-1);let L=0;K.forEach((C,G)=>{let de=C.id;J.has(de)&&(de=me()),J.add(de),u.value.push({id:de,name:C.name??"未命名",content:C.content??"",createdAt:C.createdAt??C.updatedAt??Date.now(),updatedAt:C.updatedAt??C.createdAt??Date.now(),pinned:!!C.pinned,highlighted:!!C.highlighted,order:(typeof C.order=="number",Y+1+G)}),L++}),!g.value&&ee.sortMode&&(g.value=ee.sortMode),typeof m.value>"u"&&typeof ee.sortTimeDesc=="boolean"&&(m.value=ee.sortTimeDesc),typeof f.value>"u"&&typeof ee.sortNameAsc=="boolean"&&(f.value=ee.sortNameAsc),await k(),alert(`迁移成功!
|
||
|
||
已从浏览器迁移 ${L} 个标签到服务器
|
||
当前共 ${u.value.length} 个标签`)}catch(he){console.error("迁移失败:",he),alert(`迁移失败: ${he.message}`)}}function oe(){try{const he={items:u.value,settings:{sortMode:g.value,sortTimeDesc:m.value,sortNameAsc:f.value,selectedId:p.value},exportTime:new Date().toISOString(),version:"v1"},te=JSON.stringify(he,null,2),K=new Blob([te],{type:"application/json"}),ee=URL.createObjectURL(K),F=document.createElement("a");F.href=ee;const J=new Date,Y=J.getFullYear()+(J.getMonth()+1).toString().padStart(2,"0")+J.getDate().toString().padStart(2,"0"),L=J.getHours().toString().padStart(2,"0")+J.getMinutes().toString().padStart(2,"0")+J.getSeconds().toString().padStart(2,"0");F.download=`weilin_prompt_labels_${Y}_${L}.json`,document.body.appendChild(F),F.click(),document.body.removeChild(F),URL.revokeObjectURL(ee),alert(`导出成功!共导出 ${u.value.length} 个标签`)}catch(he){console.error("导出失败:",he),alert(`导出失败: ${he.message}`)}}function be(){var he;(he=r.value)==null||he.click()}function ve(he){var ee;const te=(ee=he.target.files)==null?void 0:ee[0];if(!te)return;const K=new FileReader;K.onload=async F=>{var J,Y;try{const L=(J=F.target)==null?void 0:J.result;if(typeof L!="string")throw new Error("文件读取失败");const C=JSON.parse(L);if(!C||typeof C!="object")throw new Error("JSON格式不正确");const G=Array.isArray(C)?C:(C==null?void 0:C.items)??[],de=Array.isArray(C)?{}:(C==null?void 0:C.settings)??{};if(!Array.isArray(G))throw new Error("数据格式错误:未找到items数组");const Se=window.confirm(`检测到 ${G.length} 个标签
|
||
|
||
点击"确定"将替换当前所有数据
|
||
点击"取消"将合并导入(保留现有数据)`)?"replace":"merge";if(Se==="replace"){u.value=G.map((N,T)=>({id:N.id??me(),name:N.name??"未命名",content:N.content??"",createdAt:N.createdAt??N.updatedAt??Date.now(),updatedAt:N.updatedAt??N.createdAt??Date.now(),pinned:!!N.pinned,highlighted:!!N.highlighted,order:typeof N.order=="number"?N.order:T})),de.sortMode&&(g.value=de.sortMode),typeof de.sortTimeDesc=="boolean"&&(m.value=de.sortTimeDesc),typeof de.sortNameAsc=="boolean"&&(f.value=de.sortNameAsc);const Le=de.selectedId&&u.value.find(N=>N.id===de.selectedId)?de.selectedId:((Y=u.value[0])==null?void 0:Y.id)??null;p.value=Le}else{const Le=new Set(u.value.map(j=>j.id)),N=u.value.reduce((j,ne)=>Math.max(j,typeof ne.order=="number"?ne.order:j),-1);let T=0;G.forEach((j,ne)=>{let Pe=j.id;Le.has(Pe)&&(Pe=me()),Le.add(Pe),u.value.push({id:Pe,name:j.name??"未命名",content:j.content??"",createdAt:j.createdAt??j.updatedAt??Date.now(),updatedAt:j.updatedAt??j.createdAt??Date.now(),pinned:!!j.pinned,highlighted:!!j.highlighted,order:(typeof j.order=="number",N+1+ne)}),T++}),alert(`合并成功!新增 ${T} 个标签,当前共 ${u.value.length} 个标签`)}await k(),Se==="replace"&&alert(`导入成功!已替换为 ${u.value.length} 个标签`)}catch(L){console.error("导入失败:",L),alert(`导入失败: ${L.message}`)}finally{r.value&&(r.value.value="")}},K.onerror=()=>{alert("文件读取失败"),r.value&&(r.value.value="")},K.readAsText(te)}return t({updateSelectedContent:_e}),(he,te)=>(E(),D("div",rT,[i("div",iT,[$e(i("input",{"onUpdate:modelValue":te[0]||(te[0]=K=>s.value=K),class:"mlm-search",type:"text",placeholder:"搜索标签…"},null,512),[[ze,s.value]]),i("button",{class:"mlm-add",onClick:ce},"+ 新建标签"),i("button",{class:"mlm-migrate",onClick:Z,title:"将浏览器中的旧数据迁移到服务器"}," 📦 从浏览器迁移数据 "),i("div",{class:"mlm-io-grid"},[i("button",{class:"mlm-export",onClick:oe,title:"导出提示词数据到JSON文件"}," 导出数据 "),i("button",{class:"mlm-import",onClick:be,title:"从JSON文件导入提示词数据"}," 导入数据 ")]),i("input",{ref_key:"fileInput",ref:r,type:"file",accept:".json",style:{display:"none"},onChange:ve},null,544),i("div",sT,[i("button",{class:"mlm-sort",onClick:ie}," 按时间 "+y(m.value?"后→先":"先→后"),1),i("button",{class:"mlm-sort",onClick:Oe}," 按名称 "+y(f.value?"A→Z":"Z→A"),1),i("button",{class:"mlm-edit",disabled:!V.value,onClick:P},"编辑",8,lT),i("button",{class:"mlm-delete",disabled:!V.value,onClick:le},"删除",8,uT)])]),it(a_,{name:"mlm",tag:"div",class:"mlm-list"},{default:Pt(()=>[(E(!0),D(Ke,null,lt(I.value,(K,ee)=>(E(),D("div",{key:K.id,class:We(["mlm-item",{active:K.id===p.value,pinned:!!K.pinned,highlighted:!!K.highlighted},{dragging:x.value===K.id,"drag-over":b.value===K.id}]),onClick:F=>z(K),title:K.updatedAt?W(K.updatedAt):"",draggable:"true",onDragstart:F=>Q(K,ee,F),onDragenter:Tt(F=>X(K),["prevent"]),onDragover:te[1]||(te[1]=Tt(()=>{},["prevent"])),onDrop:Tt(F=>ye(K),["prevent"]),onDragend:pe},[i("div",dT,[K.pinned?(E(),D("span",pT,"置顶")):Ce("",!0),i("span",fT,y(K.name),1)]),i("div",gT,[i("button",{class:We(["mini-btn","pin",{active:K.pinned}]),title:K.pinned?"取消置顶":"置顶",onClick:Tt(F=>Ae(K),["stop"])},te[2]||(te[2]=[i("svg",{viewBox:"0 0 24 24",width:"18",height:"18",fill:"currentColor"},[i("path",{d:"M4 14h4v6h8v-6h4L12 4 4 14z"})],-1)]),10,mT),i("button",{class:We(["mini-btn","highlight",{active:K.highlighted}]),title:K.highlighted?"取消高亮":"高亮",onClick:Tt(F=>fe(K),["stop"])},te[3]||(te[3]=[i("svg",{viewBox:"0 0 24 24",width:"18",height:"18",fill:"currentColor"},[i("path",{d:"M12 17.27L18.18 21 16.54 13.97 22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z"})],-1)]),10,hT)])],42,cT))),128))]),_:1})]))}},[["__scopeId","data-v-3a6be373"]]),Lo={getHistory:()=>Ye({url:"/prompt/history/get_history",method:"get"}),saveHistory:e=>Ye({url:"/prompt/history/add_history",method:"post",data:e}),deleteHistory:e=>Ye({url:"/prompt/history/delete_history",method:"post",data:{id_index:e}}),batchDeleteHistory:e=>Ye({url:"/prompt/history/batch_delete_history",method:"post",data:{id_index:e}}),getFavorite:()=>Ye({url:"/prompt/collect_history/get_collect_history",method:"get"}),addFavorite:e=>Ye({url:"/prompt/collect_history/add_collect_history",method:"post",data:e}),editFavorite:e=>Ye({url:"/prompt/collect_history/edit_collect_history",method:"post",data:e}),deleteFavorite:e=>Ye({url:"/prompt/collect_history/delete_collect_history",method:"post",data:{id_index:e}}),batchDeleteFavorite:e=>Ye({url:"/prompt/collect_history/batch_delete_collect_history",method:"post",data:{id_indices:e}})},yT={class:"lora-manager-top-bar"},bT=["placeholder"],wT=["title"],xT=["title"],ST={class:"checkbox-container"},TT=["onClick"],kT=["onClick"],CT={key:0,class:"loading-indicator"},ET={key:1,class:"empty-list"},$T=["onClick","onMouseover"],LT=["src","alt","title"],AT={key:0,class:"loading-more"},MT={key:1,class:"no-more-data"},wn="weilin_prompt_ui_",xh=qt({__name:"lora_index",props:{loraManager:{type:String,default:"look"}},setup(e,{expose:t}){const{t:n}=Gt(),o=S(!1),a=S(!1),r=S(!1),s=S(!1),u=S("all"),p=S(""),m=S(null),f=S(""),g=S(null),x=S(!1),b=S(""),k=S(100),$=S(0),O=S(),I=S(!1),V=S(!1),me=S(),M=S(localStorage.getItem("weilin_prompt_ui_showHoverInfo")),z=S(localStorage.getItem("weilin_prompt_ui_clickAddTag"));(M.value===null||M.value===void 0||M.value==="")&&(localStorage.setItem("weilin_prompt_ui_showHoverInfo",!0),M.value=!0),(z.value===null||z.value===void 0||z.value==="")&&(localStorage.setItem("weilin_prompt_ui_clickAddTag",!1),z.value=!1);const ce=e;At(M,T=>{localStorage.setItem("weilin_prompt_ui_showHoverInfo",T)}),At(z,T=>{localStorage.setItem("weilin_prompt_ui_clickAddTag",T)});const P=S(1),le=S(50),ie=Ht(()=>{if(u.value==="all"){const j=W.value;if(j){const ne=Object.values(j);return Math.ceil(ne.length/le.value)}return 1}const T=W.value[p.value];if(T){const j=T.all||Object.keys(T).filter(ne=>ne!=="all").map(ne=>T[ne]);return Math.ceil(j.length/le.value)}return 1}),Oe=()=>{I.value=!0,V.value=!0},Ae=(T,j)=>{if(!M.value||M.value==="false"||(V.value=!0,b.value===T&&x.value))return;const Pe=j.currentTarget.getBoundingClientRect(),De=window.innerHeight,se=450,Te={left:Pe.left+(Pe.width-se)/2,top:Pe.top+Pe.height+10};Te.top+310>De&&(Te.top=Pe.top-310),Te.left=Math.max(10,Math.min(Te.left,window.innerWidth-se-10)),Te.top=Math.max(10,Math.min(Te.top,De-310)),k.value=Te.left,$.value=Te.top,x.value=!0,b.value=T,vt(()=>{me.value.refresh()})},fe=()=>{V.value=!1,setTimeout(()=>{!I.value&&!V.value&&(x.value=!1,b.value="",I.value=!1)},200)},_e=()=>{x.value=!1,b.value="",I.value=!1},ae=S([]),W=S([]),re=S(""),Q=S(0),X=(T,j)=>{Q.value=T,re.value=j},ye=async()=>{try{const T=await fo.getLoraFolderList();ae.value=T.data}catch(T){console.error("Failed to get folder list:",T),ue({type:"error",str:"message.loadFailed"})}},pe=()=>{if(!g.value||r.value||s.value)return;const T=g.value;T.scrollHeight-T.scrollTop-T.clientHeight<100&&de()},Z=S(!1);let oe=null;const be=()=>{oe&&clearTimeout(oe),oe=setTimeout(()=>{f.value.length>0?(Z.value=!0,K()):(Z.value=!1,G())},300)},ve=T=>{var j;return(j=T.local_info)!=null&&j.name&&T.local_info.name!==""&&T.local_info.name.length>0?T.local_info.name:T.name},he=S(),te=T=>{ce.loraManager==="addLora"?Le(T):ce.loraManager==="prompt_inner"&&z.value?N(T):he.value.open(T)},K=async()=>{try{const T=await fo.searchLoraGetFolderList(f.value);if(W.value=T.data,W.value.length>0){P.value=1;const j=Object.values(W.value),ne=(P.value-1)*50,Pe=ne+50,De=j.slice(ne,Pe);Y(De)}}catch(T){console.error("Failed to get folder list:",T),ue({type:"error",str:"message.loadFailed"})}},ee=S([]),F=T=>{if(T==="all"){ee.value=[],u.value=T,p.value="/",W.value=ae.value[T];const j=W.value;if(j){s.value=!1,P.value=1;const ne=Object.values(j),Pe=(P.value-1)*50,De=Pe+50,se=ne.slice(Pe,De);Y(se)}}else{ee.value=[],u.value=T,p.value="/",W.value=ae.value[T];const j=W.value["/"];if(j){s.value=!1,P.value=1;const ne=Object.values(j),Pe=(P.value-1)*50,De=Pe+50,se=ne.slice(Pe,De);Y(se)}}},J=T=>{if(T!==p.value){p.value=T,ee.value=[];const j=W.value[p.value];if(j){s.value=!1,P.value=1;const ne=j.all||Object.keys(j).filter(Te=>Te!=="all").map(Te=>j[Te]),Pe=(P.value-1)*50,De=Pe+50,se=ne.slice(Pe,De);Y(se)}}},Y=async T=>{const j=await fo.getLoraRangeList(T);P.value===1?ee.value=j.data.loras:ee.value=ee.value.concat(j.data.loras)},L=async()=>{if(m.value!==null){ue({type:"warn",str:"message.isLoading"});return}try{ue({type:"success",str:"message.isLoadingPleaseWait"}),await fo.getAllLoraList(),m.value=setInterval(async()=>{await C()},1e3)}catch(T){console.error("Failed to get all lora list:",T),ue({type:"error",str:"message.loadFailed"})}},C=async()=>{try{const T=await fo.getAllLoraStatus();T.data.isLoading===!1?(clearInterval(m.value),m.value=null,ue({type:"success",str:"message.loaddingSuccess"}),await G()):ue({type:"warn",str:"message.loaddingPrc",name:T.data.progress})}catch(T){console.error("Failed to get lora status:",T),clearInterval(m.value),m.value=null,ue({type:"error",str:"message.loadFailed"})}},G=async()=>{if(!o.value){o.value=!0,P.value=1,s.value=!1,r.value=!1;try{await ye(),vt(()=>{F("all")})}catch(T){console.error("Failed to refresh lora list:",T)}finally{o.value=!1}}},de=()=>{if(P.value>=ie.value){s.value=!0;return}r.value=!0;try{if(P.value++,Z.value){if(W.value.length>0){const T=Object.values(W.value),j=(P.value-1)*50,ne=j+50,Pe=T.slice(j,ne);Y(Pe)}}else if(u.value==="all"){W.value=ae.value[u.value];const T=W.value;if(T){const j=Object.values(T),ne=(P.value-1)*50,Pe=ne+50,De=j.slice(ne,Pe);Y(De)}}else{const T=W.value[p.value];if(T){const j=T.all||Object.keys(T).filter(se=>se!=="all").map(se=>T[se]),ne=(P.value-1)*50,Pe=ne+50,De=j.slice(ne,Pe);Y(De)}}}finally{r.value=!1}},Se=()=>{P.value=1,s.value=!1,r.value=!1};At([u,p,f],()=>{Se()}),Ut(()=>{G()});const Le=T=>{var j,ne,Pe,De,se,Te,qe,et,ot,ft,bt,Mt,Vt,An,ao;Q.value===0?window.postMessage({type:"weilin_prompt_ui_selectLora",lora:{name:T.model_name,display_name:ve(T),lora:T.name,weight:(j=T.local_info)!=null&&j.strengthMin?T.local_info.strengthMin:1,text_encoder_weight:(ne=T.local_info)!=null&&ne.strWeight?T.local_info.strWeight:1,trigger_weight:(Pe=T.local_info)!=null&&Pe.triggerWeight?T.local_info.triggerWeight:(De=T.local_info)!=null&&De.strWeight?T.local_info.strWeight:1,loraWorks:(se=T.local_info)!=null&&se.loraWorks?T.local_info.loraWorks:""}},"*"):Q.value===1?window.postMessage({type:`weilin_prompt_ui_selectLora_stack_${re.value}`,lora:{name:T.model_name,display_name:ve(T),lora:T.name,weight:(Te=T.local_info)!=null&&Te.strengthMin?T.local_info.strengthMin:1,text_encoder_weight:(qe=T.local_info)!=null&&qe.strWeight?T.local_info.strWeight:1,trigger_weight:(et=T.local_info)!=null&&et.triggerWeight?T.local_info.triggerWeight:(ot=T.local_info)!=null&&ot.strWeight?T.local_info.strWeight:1,loraWorks:(ft=T.local_info)!=null&&ft.loraWorks?T.local_info.loraWorks:""}},"*"):Q.value===2&&window.postMessage({type:`weilin_prompt_ui_selectLora_stack_node_${re.value}`,lora:{name:T.model_name,display_name:ve(T),lora:T.name,weight:(bt=T.local_info)!=null&&bt.strengthMin?T.local_info.strengthMin:1,text_encoder_weight:(Mt=T.local_info)!=null&&Mt.strWeight?T.local_info.strWeight:1,trigger_weight:(Vt=T.local_info)!=null&&Vt.triggerWeight?T.local_info.triggerWeight:(An=T.local_info)!=null&&An.strWeight?T.local_info.strWeight:1,loraWorks:(ao=T.local_info)!=null&&ao.loraWorks?T.local_info.loraWorks:""}},"*")},N=T=>{var Te,qe,et;const j=T.model_name,ne=(Te=T.local_info)!=null&&Te.strengthMin?T.local_info.strengthMin:1,Pe=(qe=T.local_info)!=null&&qe.strWeight?T.local_info.strWeight:1,De=(et=T.local_info)!=null&&et.triggerWeight?T.local_info.triggerWeight:Pe,se=`<wlr:${j}:${ne}:${Pe}:${De}>`;window.postMessage({type:"weilin_prompt_ui_add_lora_tag",tag:se},"*")};return t({openSetSeed:X}),(T,j)=>(E(),D("div",{class:We(`${wn}lora-manager`)},[i("div",yT,[$e(i("input",{"onUpdate:modelValue":j[0]||(j[0]=ne=>f.value=ne),class:We(`${wn}search-input`),placeholder:v(n)("loraManager.searchPlaceholder"),onInput:be},null,42,bT),[[ze,f.value]]),i("button",{class:We(`${wn}refresh-btn`),onClick:G,title:v(n)("loraManager.refresh")},[(E(),D("svg",{class:We([`${wn}refresh-icon`,{"is-rotating":o.value}]),viewBox:"0 0 24 24",width:"20",height:"20"},j[3]||(j[3]=[i("path",{d:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z"},null,-1)]),2))],10,wT),i("button",{style:{"margin-left":"10px"},class:We(`${wn}refresh-btn`),onClick:L,title:v(n)("loraManager.cacheAll")},[(E(),D("svg",{class:We([`${wn}refresh-icon`,{"is-rotating":o.value}]),viewBox:"0 0 24 24",width:"20",height:"20"},j[4]||(j[4]=[i("path",{d:"M19 12v7H5v-7H3v7c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-7h-2zm-6 .67l2.59-2.58L17 11.5l-5 5-5-5 1.41-1.41L11 12.67V3h2z"},null,-1)]),2))],10,xT),i("div",ST,[i("label",{class:We(`${wn}checkbox-label`)},[$e(i("input",{type:"checkbox","onUpdate:modelValue":j[1]||(j[1]=ne=>M.value=ne),class:We(`${wn}checkbox`)},null,2),[[nn,M.value]]),j[5]||(j[5]=i("span",null,"悬浮信息",-1))],2),e.loraManager=="prompt_inner"?(E(),D("label",{key:0,class:We(`${wn}checkbox-label`)},[$e(i("input",{type:"checkbox","onUpdate:modelValue":j[2]||(j[2]=ne=>z.value=ne),class:We(`${wn}checkbox`)},null,2),[[nn,z.value]]),j[6]||(j[6]=i("span",null,"点击添加Tag",-1))],2)):Ce("",!0)])]),Z.value?Ce("",!0):(E(),D("div",{key:0,class:We(`${wn}category-nav`)},[(E(!0),D(Ke,null,lt(Object.keys(ae.value),ne=>(E(),D("button",{key:ne,class:We([`${wn}category-btn`,{active:u.value===ne}]),onClick:Pe=>F(ne)},y(ne==="/"?v(n)("loraManager.root"):ne=="all"?v(n)("loraManager.all"):ne),11,TT))),128))],2)),u.value!="all"&&!Z.value?(E(),D("div",{key:1,class:We(`${wn}subcategory-nav`)},[(E(!0),D(Ke,null,lt(Object.keys(W.value),ne=>(E(),D("button",{key:ne,class:We([`${wn}category-btn`,{active:p.value===ne}]),onClick:Pe=>J(ne)},y(ne==="/"?v(n)("loraManager.root"):ne=="all"?v(n)("loraManager.all"):ne),11,kT))),128))],2)):Ce("",!0),i("div",{class:We(`${wn}lora-list-container`),ref_key:"scrollContainer",ref:g,onScroll:pe},[a.value&&!r.value?(E(),D("div",CT,y(v(n)("loraManager.loading")),1)):ee.value.length===0?(E(),D("div",ET,y(v(n)("loraManager.noResults")),1)):Ce("",!0),i("div",{class:We(`${wn}lora-list`),style:{display:"grid","grid-template-columns":"repeat(auto-fill, minmax(150px, 1fr))",gap:"12px"}},[(E(!0),D(Ke,null,lt(ee.value,ne=>(E(),D("div",{key:ne.file_path,class:We(`${wn}lora-card`),ref_for:!0,ref_key:"loraCardRef",ref:O,onClick:Pe=>te(ne),onMouseover:Pe=>Ae(ne.name,Pe),onMouseleave:fe,style:{display:"flex","flex-direction":"column","min-height":"200px",cursor:"pointer"}},[i("div",{class:We(`${wn}lora-preview`),style:{flex:"1",display:"flex","align-items":"center","justify-content":"center",overflow:"hidden",width:"100%"}},[ne.preview?(E(),D("img",{key:0,src:ne.preview,alt:ne.model_name,title:ne.model_name,loading:"lazy",style:{width:"100%",height:"100%","object-fit":"contain","min-height":"150px"}},null,8,LT)):(E(),D("div",{key:1,class:We(`${wn}no-preview`),style:{width:"100%",height:"100%",display:"flex","align-items":"center","justify-content":"center","min-height":"150px"}},j[7]||(j[7]=[i("svg",{viewBox:"0 0 24 24",width:"24",height:"24"},[i("path",{d:"M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2zM8.5 13.5l2.5 3.01L14.5 12l4.5 6H5l3.5-4.5z"})],-1)]),2))],2),i("div",{class:We(`${wn}lora-name`),style:{padding:"8px","text-align":"center","word-break":"break-word","white-space":"normal",display:"-webkit-box","-webkit-line-clamp":"2","line-clamp":"2","-webkit-box-orient":"vertical",overflow:"hidden","min-height":"40px","max-height":"40px","line-height":"20px","text-overflow":"ellipsis"}},y(ve(ne)),3)],42,$T))),128))],2),i("div",null,[r.value?(E(),D("div",AT,y(v(n)("loraManager.loadingMore")),1)):Ce("",!0),!r.value&&s.value?(E(),D("div",MT,y(v(n)("loraManager.noMoreData")),1)):Ce("",!0)])],34),it(hl,{ref_key:"loraDetailRef",ref:he},null,512),x.value?(E(),Jt(Lc,{key:2,ref_key:"loraCardItem",ref:me,fileNmae:b.value,paddingLeft:k.value,paddingTop:$.value,onCardLeave:_e,onCardenter:Oe},null,8,["fileNmae","paddingLeft","paddingTop"])):Ce("",!0)],2))}},[["__scopeId","data-v-61a57bab"]]),IT={class:"tag-manager"},DT={class:"selected-categories-container"},OT={class:"selected-categories-header"},RT={class:"selected-categories-content"},PT={key:0,class:"selected-category-section"},NT={class:"section-title"},FT={class:"selected-items"},BT={class:"category-name"},UT=["onClick"],zT={key:1,class:"selected-category-section"},VT={class:"section-title"},WT={class:"selected-items"},jT={class:"category-name"},HT={class:"subcategory-name"},GT=["onClick"],qT={key:2,class:"no-selected"},YT={class:"category-tabs"},KT={class:"tabs-wrapper primary-tabs"},JT={class:"tabs-scroll"},XT=["onClick"],QT={class:"tab-text"},ZT=["onClick","title"],ek={key:0,class:"tabs-wrapper group-tabs"},tk={class:"tabs-scroll"},nk=["onClick"],ok={class:"tab-text"},ak=["onClick","disabled","title"],rk=qt({__name:"tag_group_select",emits:["sureSelect"],setup(e,{expose:t,emit:n}){const{t:o}=Gt(),a=n,r=S([]),s=S(null),u=S(null),p=S([]),m=S(!1),f=S([]),g=S(!1),x=S(0),b=Ht(()=>f.value.filter(_e=>!_e.sub)),k=Ht(()=>f.value.filter(_e=>_e.sub)),$=_e=>f.value.findIndex(ae=>ae.group.p_uuid===_e.group.p_uuid&&!ae.sub),O=_e=>f.value.findIndex(ae=>ae.group.p_uuid===_e.group.p_uuid&&ae.sub&&ae.sub.g_uuid===_e.sub.g_uuid),I=()=>{window.postMessage({type:"weilin_prompt_ui_tag_manager_refresh_select"},"*")},V=async()=>{try{const _e=await un.getTagsGroupList();if(r.value=_e.info,u.value){const ae=r.value.flatMap(W=>W.groups).find(W=>W.p_uuid===u.value.p_uuid);ae?u.value=ae:u.value=null}if(s.value){const ae=r.value.find(W=>W.p_uuid===s.value.p_uuid);ae?s.value=ae:s.value=null}}catch(_e){console.error("获取标签列表失败:",_e)}},me=_e=>{if(!_e||_e==="transparent")return"var(--primary-text)";let ae,W,re,Q=1;if(_e.startsWith("rgba")){const ye=_e.match(/rgba\((\d+),\s*(\d+),\s*(\d+),\s*([\d.]+)\)/);ye&&([,ae,W,re,Q]=ye.map(Number))}else if(_e.startsWith("rgb")){const ye=_e.match(/rgb\((\d+),\s*(\d+),\s*(\d+)\)/);ye&&([,ae,W,re]=ye.map(Number))}return Q<.5?"var(--primary-text)":(ae*299+W*587+re*114)/1e3>128?"#000000":"#ffffff"};Ut(()=>{window.addEventListener("message",Ae)}),Ta(()=>{window.removeEventListener("message",Ae)});const M=_e=>{s.value=_e,u.value=null,m.value=!1,p.value=[]},z=_e=>{ce(s.value)||(u.value=_e,m.value=!1,p.value=[])},ce=_e=>_e?f.value.some(ae=>ae.group.p_uuid===_e.p_uuid&&!ae.sub):!1,P=_e=>{const ae=f.value.findIndex(W=>W.group.p_uuid===_e.p_uuid&&!W.sub);ae!==-1?f.value.splice(ae,1):(f.value=f.value.filter(W=>W.group.p_uuid!==_e.p_uuid),f.value.push({group:{p_uuid:_e.p_uuid,name:_e.name},sub:null}))},le=(_e,ae)=>{if(ce(_e))return;const W=f.value.findIndex(re=>re.group.p_uuid===_e.p_uuid&&re.sub&&re.sub.g_uuid===ae.g_uuid);if(W!==-1)f.value.splice(W,1);else{const re=f.value.findIndex(Q=>Q.group.p_uuid===_e.p_uuid&&!Q.sub);re!==-1&&f.value.splice(re,1),f.value.push({group:{p_uuid:_e.p_uuid,name:_e.name},sub:ae?{g_uuid:ae.g_uuid,name:ae.name}:null})}},ie=_e=>{f.value.splice(_e,1)},Oe=()=>{f.value=[]},Ae=_e=>{!_e.data||!_e.data.type||_e.data.type.startsWith("weilin_prompt_ui_")&&_e.data.type==="weilin_prompt_ui_tag_manager_refresh_select"&&V()},fe=()=>{if(f.value.length===0){ue({type:"warn",str:"message.pleaseSelectGroup"});return}a("sureSelect",{data:f.value,index:x.value}),g.value=!1};return t({open:(_e,ae)=>{I(),x.value=_e,f.value=ae,g.value=!0}}),(_e,ae)=>(E(),Jt(Nr,{modelValue:g.value,"onUpdate:modelValue":ae[1]||(ae[1]=W=>g.value=W),title:v(o)("importDialog.selectTitle")},{footer:Pt(()=>[i("button",{onClick:ae[0]||(ae[0]=W=>g.value=!1)},y(v(o)("promptBox.settings.close")),1),i("button",{onClick:fe},y(v(o)("importDialog.sureSelect")),1)]),default:Pt(()=>[i("div",IT,[i("div",DT,[i("div",OT,[i("span",null,y(v(o)("importDialog.selectedCategories")),1),f.value.length>0?(E(),D("button",{key:0,class:"clear-all-btn",onClick:Oe},y(v(o)("importDialog.clearAll")),1)):Ce("",!0)]),i("div",RT,[b.value.length>0?(E(),D("div",PT,[i("div",NT,y(v(o)("importDialog.primaryCategories")),1),i("div",FT,[(E(!0),D(Ke,null,lt(b.value,(W,re)=>(E(),D("div",{key:"primary-"+re,class:"selected-item"},[i("span",BT,y(W.group.name),1),i("button",{class:"remove-selected-btn",onClick:Q=>ie($(W))}," × ",8,UT)]))),128))])])):Ce("",!0),k.value.length>0?(E(),D("div",zT,[i("div",VT,y(v(o)("importDialog.subCategories")),1),i("div",WT,[(E(!0),D(Ke,null,lt(k.value,(W,re)=>(E(),D("div",{key:"sub-"+re,class:"selected-item"},[i("span",jT,y(W.group.name),1),ae[2]||(ae[2]=i("span",{class:"separator"},">",-1)),i("span",HT,y(W.sub.name),1),i("button",{class:"remove-selected-btn",onClick:Q=>ie(O(W))}," × ",8,GT)]))),128))])])):Ce("",!0),f.value.length===0?(E(),D("div",qT,y(v(o)("importDialog.noSelectedCategories")),1)):Ce("",!0)])]),i("div",YT,[i("div",KT,[i("div",JT,[(E(!0),D(Ke,null,lt(r.value,(W,re)=>{var Q,X,ye;return E(),D("div",{key:"Tabss-"+re,class:We(["tab-item",{active:((Q=s.value)==null?void 0:Q.p_uuid)===W.p_uuid}]),style:Bt({backgroundColor:((X=s.value)==null?void 0:X.p_uuid)===W.p_uuid?"var(--weilin-prompt-ui-primary-bg)":W.color,color:((ye=s.value)==null?void 0:ye.p_uuid)===W.p_uuid?"var(--weilin-prompt-ui-primary-text)":me(W.color)}),onClick:pe=>M(W)},[i("span",QT,y(W.name),1),i("button",{class:"select-tab-btn",onClick:Tt(pe=>P(W),["stop"]),title:v(o)("importDialog.selectCategory")},ae[3]||(ae[3]=[i("svg",{viewBox:"0 0 24 24",width:"28",height:"28"},[i("path",{fill:"currentColor",d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"})],-1)]),8,ZT)],14,XT)}),128))])]),s.value?(E(),D("div",ek,[i("div",tk,[(E(!0),D(Ke,null,lt(s.value.groups,(W,re)=>{var Q,X,ye;return E(),D("div",{key:"TabsSw-"+re,class:We(["tab-item",{active:((Q=u.value)==null?void 0:Q.g_uuid)===W.g_uuid,disabled:ce(s.value)}]),style:Bt({backgroundColor:((X=u.value)==null?void 0:X.g_uuid)===W.g_uuid?"var(--weilin-prompt-ui-primary-bg)":W.color,color:((ye=u.value)==null?void 0:ye.g_uuid)===W.g_uuid?"var(--weilin-prompt-ui-primary-text)":me(W.color),opacity:ce(s.value)?"0.5":"1",cursor:ce(s.value)?"not-allowed":"pointer"}),onClick:pe=>ce(s.value)?null:z(W)},[i("span",ok,y(W.name),1),ce(s.value)?Ce("",!0):(E(),D("button",{key:0,class:"select-tab-btn",onClick:Tt(pe=>le(s.value,W),["stop"]),disabled:ce(s.value),title:v(o)("importDialog.selectSubcategory")},ae[4]||(ae[4]=[i("svg",{viewBox:"0 0 24 24",width:"28",height:"28"},[i("path",{fill:"currentColor",d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"})],-1)]),8,ak))],14,nk)}),128))])])):Ce("",!0)])])]),_:1},8,["modelValue","title"]))}},[["__scopeId","data-v-e6f4f475"]]),Kn={getTemplateList:()=>Ye({url:"/random_template/get_template_list",method:"post"}),getTemplateData:e=>Ye({url:"/random_template/get_template_data",method:"post",data:{name:e}}),saveTemplateData:e=>Ye({url:"/random_template/save_template",method:"post",data:{data:e}}),updateTemplateData:(e,t)=>Ye({url:"/random_template/update_template",method:"post",data:{name:e,data:t}}),deleteTemplateData:e=>Ye({url:"/random_template/delete_template",method:"post",data:{name:e}}),getRandomTemplateApple:()=>Ye({url:"/get/setting/get_random_template_setting",method:"post"}),updateRandomTemplateApple:e=>Ye({url:"/update/setting/update_random_template_setting",method:"post",data:{path:e}}),goRandomTemplate:()=>Ye({url:"/random_template/go_random_template",method:"post"}),goRandomTemplatePath:e=>Ye({url:"/random_template/go_random_template_path",method:"post",data:{name:e}})},ik={class:"random-rule-container"},sk={class:"settings-section template-section"},lk={class:"section-header"},uk={class:"template-controls"},ck={class:"template-select-group"},dk={class:"template-select-with-apply"},pk={value:""},fk=["value"],gk=["disabled"],mk={class:"template-bottom-buttons"},hk=["disabled"],vk=["disabled"],_k={key:0,class:"template-name-input"},yk=["placeholder"],bk={class:"template-actions"},wk={key:0},xk={class:"settings-section"},Sk={class:"section-header"},Tk={class:"rules-reminder"},kk={class:"rules-list"},Ck={class:"rule-header"},Ek=["onClick"],$k={class:"rule-content"},Lk={class:"form-group"},Ak={class:"range-inputs"},Mk=["onUpdate:modelValue"],Ik=["onUpdate:modelValue"],Dk={class:"form-group"},Ok=["onUpdate:modelValue"],Rk={value:"category"},Pk={value:"specific"},Nk={key:0,class:"form-group"},Fk={class:"selected-categories-container"},Bk={class:"selected-categories-header"},Uk={class:"selected-categories-content"},zk={key:0,class:"selected-category-section"},Vk={class:"section-title"},Wk={class:"selected-items"},jk={class:"category-name"},Hk={key:1,class:"selected-category-section"},Gk={class:"section-title"},qk={class:"selected-items"},Yk={class:"category-name"},Kk={class:"subcategory-name"},Jk={key:2,class:"no-selected"},Xk=["onClick"],Qk={key:1,class:"form-group"},Zk={class:"tags-input-container"},eC=["onClick"],tC=["onUpdate:modelValue","onKeydown","placeholder"],nC=["onClick"],oC={class:"actions-section"},aC=["disabled"],Sh="weilin_tools_",rC=qt({__name:"random_setting",emits:["close","update","generateRandomTags"],setup(e,{expose:t,emit:n}){const{t:o}=Gt(),a=S(!1),r=S(null),s=S(!1),u=S(""),p=S(""),m={randomRuleSetting:{visible:!1,position:{x:150,y:150},size:{width:800,height:600}}},f={file_name:"new_random_template",rules:[{range:{min:1,max:3},type:"category",categoryId:1,specificTags:[],tagGroupList:[],tagInput:""},{range:{min:4,max:6},type:"category",categoryId:2,specificTags:[],tagGroupList:[],tagInput:""}]},g=S({});async function x(){try{u.value==="prompt_global"?await Kn.getRandomTemplateApple().then(F=>{F.data===""?g.value=f:Kn.getTemplateData(F.data).then(J=>{W.value=F.data,g.value=J.data,s.value=!0}).catch(J=>{console.error("加载模板失败:",J),ue({type:"warn",str:"randomUtils.errorLoadingTemplate"})})}).catch(F=>{console.error(F),ue({type:"warn",str:"message.networkError"})}):p.value===""?g.value=f:Kn.getTemplateData(p.value).then(F=>{W.value=p.value,g.value=F.data,s.value=!0}).catch(F=>{console.error("加载模板失败:",F),ue({type:"warn",str:"randomUtils.errorLoadingTemplate"})})}catch(F){ue({type:"warn",str:"message.networkError"}),console.error("Error loading random tag settings:",F)}}function b(){try{const F=JSON.parse(JSON.stringify(g.value));F.rules&&F.rules.forEach(J=>{delete J.tagInput}),Kn.updateTemplateData(W.value,F).then(J=>{Kn.getTemplateData(J.path_name).then(Y=>{g.value=Y.data,ue({type:"success",str:"randomUtils.templateSaved"})}).catch(Y=>{console.error("加载模板失败:",Y),ue({type:"warn",str:"randomUtils.errorLoadingTemplate"})})}).catch(J=>{console.error("更新模板失败:",J),ue({type:"warn",str:"randomUtils.errorSavingTemplate"})})}catch(F){console.error("Error saving random tag settings:",F),ue({type:"warn",str:"randomUtils.errorSavingSettings"})}}function k(){g.value.rules.push({range:{min:g.value.rules.length>0?g.value.rules[g.value.rules.length-1].range.max+1:1,max:g.value.rules.length>0?g.value.rules[g.value.rules.length-1].range.max+3:3},type:"category",categoryId:1,specificTags:[],tagGroupList:[],tagInput:""})}function $(F){g.value.rules.splice(F,1)}function O(F){F.tagInput&&F.tagInput.trim()&&(F.specificTags.push(F.tagInput.trim()),F.tagInput="")}function I(F,J){F.specificTags.splice(J,1)}function V(){}const M=S((()=>{try{const F=localStorage.getItem(`${Sh}randomRuleSettingState`);if(F){const J=JSON.parse(F),Y={...m};return J.randomRuleSetting&&(Y.randomRuleSetting={...m.randomRuleSetting,...J.randomRuleSetting}),Y}}catch(F){console.error("Error loading window states:",F)}return{...m}})());At(M,F=>{try{localStorage.setItem(`${Sh}randomRuleSettingState`,JSON.stringify(F))}catch(J){console.error("Error saving window states:",J)}},{deep:!0});const z=()=>{a.value=!1},ce=(F,J)=>{M.value[F]&&(M.value[F].position={...J})},P=(F,J)=>{M.value[F]&&(M.value[F].size={...J})},le=F=>{a.value=!0,u.value=F,nt.registerWindow("randomRuleSetting"),vt(()=>{nt.setActiveWindow("randomRuleSetting"),F==="prompt_global"?ye(1):K()})},ie=(F,J)=>{r.value.open(F,J)},Oe=()=>void 0,Ae=F=>!F||!Array.isArray(F)||F.length<=0?[]:F.filter(J=>!J.sub),fe=F=>!F||!Array.isArray(F)||F.length<=0?[]:F.filter(J=>J.sub),_e=F=>{F&&F.data&&Array.isArray(F.data)?g.value.rules[F.index].tagGroupList=F.data:g.value.rules[F.index].tagGroupList=[]},ae=S([]),W=S(""),re=S(""),Q=S(!1),X=S(!1);async function ye(F=0){try{await Kn.getTemplateList().then(J=>{ae.value=J.data,F===1&&x()}).catch(J=>{console.error(J),ue({type:"warn",str:"message.networkError"})})}catch(J){ue({type:"warn",str:"message.networkError"}),console.error("RandomTemplate获取列表失败:",J)}}function pe(){Q.value=!0,re.value=""}function Z(){Q.value=!1,re.value=""}function oe(){if(!W.value){ue.warm(o("randomUtils.pleaseChooseTemplate"));return}u.value==="prompt_global"?Kn.updateRandomTemplateApple(W.value).then(()=>{ue({type:"success",str:"randomUtils.templateApplied"})}).catch(F=>{console.error("获取模板失败:",F),ue({type:"warn",str:"randomUtils.errorApplyingTemplate"})}):(window.postMessage({type:"weilin_prompt_ui_prompt_inner_update_node_tag_template_id",data:W.value},"*"),ue({type:"success",str:"randomUtils.templateApplied"}))}function be(){W.value&&Kn.deleteTemplateData(W.value).then(()=>{ue({type:"success",str:"randomUtils.templateDeleted"}),ye(),W.value=""}).catch(F=>{console.error("删除模板失败:",F),ue({type:"warn",str:"randomUtils.errorDeletingTemplate"})})}function ve(){if(!W.value)return;const F=ae.value.find(J=>J.path_name===W.value);F&&(Q.value=!0,re.value=F.file_name,X.value=!0)}function he(){if(!re.value.trim()){ue({type:"warn",str:"randomUtils.templateNameRequired"});return}if(g.value.file_name=re.value.trim(),X.value){const F=ae.value.find(J=>J.path_name===W.value);if(F){F.file_name=re.value.trim();const J=JSON.parse(JSON.stringify(g.value));J.rules&&J.rules.forEach(Y=>{delete Y.tagInput}),Kn.updateTemplateData(F.path_name,J).then(Y=>{ue({type:"success",str:"randomUtils.templateSaved"}),ye().then(()=>{Kn.getTemplateData(Y.path_name).then(L=>{W.value=Y.path_name,g.value=L.data,ue({type:"success",str:"randomUtils.templateSaved"})}).catch(L=>{console.error("加载模板失败:",L),ue({type:"warn",str:"randomUtils.errorLoadingTemplate"})})})}).catch(Y=>{console.error("保存模板失败:",Y),ue({type:"warn",str:"randomUtils.errorSavingTemplate"})})}}else{g.value=f,g.value.file_name=re.value.trim();const F=JSON.parse(JSON.stringify(g.value));F.rules&&F.rules.forEach(J=>{delete J.tagInput}),Kn.saveTemplateData(F).then(J=>{ye().then(()=>{Kn.getTemplateData(J.path_name).then(Y=>{W.value=J.path_name,g.value=Y.data,ue({type:"success",str:"randomUtils.templateSaved"})}).catch(Y=>{console.error("加载模板失败:",Y),ue({type:"warn",str:"randomUtils.errorLoadingTemplate"})})})}).catch(J=>{console.error("保存模板失败:",J),ue({type:"warn",str:"randomUtils.errorSavingTemplate"})})}Q.value=!1,re.value="",X.value=!1}const te=F=>{if(F.target.value!=="")try{Kn.getTemplateData(F.target.value).then(J=>{W.value=J.path_name,g.value=J.data,s.value=!0}).catch(J=>{console.error("加载模板失败:",J),ue({type:"warn",str:"randomUtils.errorLoadingTemplate"})})}catch(J){ue({type:"warn",str:"message.networkError"}),console.error("Error loading random tag settings:",J)}},K=()=>{window.postMessage({type:"weilin_prompt_ui_prompt_inner_get_node_tag_template_id"},"*")},ee=F=>{!F.data||!F.data.type||F.data.type.startsWith("weilin_prompt_ui_")&&F.data.type==="weilin_prompt_ui_prompt_inner_get_node_tag_template_id_response"&&(p.value=F.data.data,ye(1))};return Ut(()=>{window.addEventListener("message",ee)}),so(()=>{nt.unregisterWindow("randomRuleSetting"),window.removeEventListener("message",ee)}),t({open:le,getRandomTags:Oe}),(F,J)=>(E(),D(Ke,null,[a.value?(E(),Jt(co,{key:0,title:v(o)("randomUtils.title"),position:M.value.randomRuleSetting.position,size:M.value.randomRuleSetting.size,"z-index":v(nt).getZIndex("randomRuleSetting"),"onUpdate:position":J[2]||(J[2]=Y=>ce("randomRuleSetting",Y)),"onUpdate:size":J[3]||(J[3]=Y=>P("randomRuleSetting",Y)),onActive:J[4]||(J[4]=Y=>v(nt).setActiveWindow("randomRuleSetting")),onClose:J[5]||(J[5]=Y=>z())},{default:Pt(()=>[i("div",ik,[i("div",sk,[i("div",lk,[i("h3",null,y(v(o)("randomUtils.ruleTemplates")),1)]),i("div",uk,[i("div",ck,[i("div",dk,[$e(i("select",{"onUpdate:modelValue":J[0]||(J[0]=Y=>W.value=Y),onChange:te,class:"form-select template-select"},[i("option",pk,y(v(o)("randomUtils.selectTemplate")),1),(E(!0),D(Ke,null,lt(ae.value,(Y,L)=>(E(),D("option",{key:L,value:Y.path_name},y(Y.file_name),9,fk))),128))],544),[[Tn,W.value]]),i("button",{class:"apply-template-btn",onClick:oe,disabled:!W.value},y(v(o)("randomUtils.applyTemplate")),9,gk)]),i("div",mk,[i("button",{class:"new-template-btn",onClick:pe},y(v(o)("randomUtils.newTemplate")),1),i("button",{class:"edit-template-btn",onClick:ve,disabled:!W.value},y(v(o)("randomUtils.editTemplate")),9,hk),i("button",{class:"delete-template-btn",onClick:be,disabled:!W.value},y(v(o)("randomUtils.deleteTemplate")),9,vk)])]),Q.value?(E(),D("div",_k,[$e(i("input",{type:"text","onUpdate:modelValue":J[1]||(J[1]=Y=>re.value=Y),class:"form-input",placeholder:v(o)("randomUtils.templateNamePlaceholder")},null,8,yk),[[ze,re.value]]),i("div",bk,[i("button",{class:"save-template-btn",onClick:he},y(v(o)("randomUtils.save")),1),i("button",{class:"cancel-template-btn",onClick:Z},y(v(o)("randomUtils.cancel")),1)])])):Ce("",!0)])]),W.value&&s.value?(E(),D("div",wk,[i("div",xk,[i("div",Sk,[i("h3",null,y(v(o)("randomUtils.rules")),1),i("button",{class:"add-rule-btn",onClick:k},[J[6]||(J[6]=i("span",null,"+",-1)),ut(" "+y(v(o)("randomUtils.addRule")),1)])]),i("div",Tk,[i("p",null,y(v(o)("randomUtils.rulesReminder")),1)]),i("div",kk,[(E(!0),D(Ke,null,lt(g.value.rules,(Y,L)=>(E(),D("div",{key:L,class:"rule-item"},[i("div",Ck,[i("h4",null,y(v(o)("randomUtils.rule"))+" #"+y(L+1),1),i("button",{class:"delete-rule-btn",onClick:C=>$(L)},"×",8,Ek)]),i("div",$k,[i("div",Lk,[i("label",null,y(v(o)("randomUtils.range")),1),i("div",Ak,[$e(i("input",{type:"number","onUpdate:modelValue":C=>Y.range.min=C,min:"1",class:"form-input range-input"},null,8,Mk),[[ze,Y.range.min,void 0,{number:!0}]]),J[7]||(J[7]=i("span",null,"-",-1)),$e(i("input",{type:"number","onUpdate:modelValue":C=>Y.range.max=C,min:"1",class:"form-input range-input"},null,8,Ik),[[ze,Y.range.max,void 0,{number:!0}]])])]),i("div",Dk,[i("label",null,y(v(o)("randomUtils.tagType")),1),$e(i("select",{"onUpdate:modelValue":C=>Y.type=C,class:"form-select"},[i("option",Rk,y(v(o)("randomUtils.category")),1),i("option",Pk,y(v(o)("randomUtils.specificTags")),1)],8,Ok),[[Tn,Y.type]])]),Y.type==="category"?(E(),D("div",Nk,[i("div",Fk,[i("div",Bk,[i("span",null,y(v(o)("importDialog.selectedCategories")),1)]),i("div",Uk,[Ae(Y.tagGroupList).length>0?(E(),D("div",zk,[i("div",Vk,y(v(o)("importDialog.primaryCategories")),1),i("div",Wk,[(E(!0),D(Ke,null,lt(Ae(Y.tagGroupList),(C,G)=>(E(),D("div",{key:"primary-"+G,class:"selected-item"},[i("span",jk,y(C.group.name),1)]))),128))])])):Ce("",!0),fe(Y.tagGroupList).length>0?(E(),D("div",Hk,[i("div",Gk,y(v(o)("importDialog.subCategories")),1),i("div",qk,[(E(!0),D(Ke,null,lt(fe(Y.tagGroupList),(C,G)=>(E(),D("div",{key:"sub-"+G,class:"selected-item"},[i("span",Yk,y(C.group.name),1),J[8]||(J[8]=i("span",{class:"separator"},">",-1)),i("span",Kk,y(C.sub.name),1)]))),128))])])):Ce("",!0),!Y.tagGroupList||Y.tagGroupList.length===0?(E(),D("div",Jk,y(v(o)("importDialog.noSelectedCategories")),1)):Ce("",!0)])]),i("button",{class:"add-tag-btn",onClick:C=>ie(L,Y.tagGroupList)},y(v(o)("randomUtils.selectTagGroup")),9,Xk)])):Ce("",!0),Y.type==="specific"?(E(),D("div",Qk,[i("label",null,y(v(o)("randomUtils.specificTags")),1),i("div",Zk,[(E(!0),D(Ke,null,lt(Y.specificTags,(C,G)=>(E(),D("div",{key:G,class:"tag-chip"},[ut(y(C)+" ",1),i("button",{class:"remove-tag-btn",onClick:de=>I(Y,G)},"×",8,eC)]))),128)),$e(i("input",{type:"text","onUpdate:modelValue":C=>Y.tagInput=C,onKeydown:Rn(Tt(C=>O(Y),["prevent"]),["enter"]),class:"tag-input",placeholder:v(o)("randomUtils.addTagPlaceholder")},null,40,tC),[[ze,Y.tagInput]])]),i("button",{class:"add-tag-btn",onClick:C=>O(Y)},y(v(o)("randomUtils.addTag")),9,nC)])):Ce("",!0)])]))),128))])])])):Ce("",!0)]),i("div",oC,[i("button",{class:"save-btn",onClick:b,disabled:!W.value},y(v(o)("common.save")),9,aC)])]),_:1},8,["title","position","size","z-index"])):Ce("",!0),it(rk,{ref_key:"tagGroupSelectItem",ref:r,onSureSelect:_e},null,512)],64))}},[["__scopeId","data-v-576f597a"]]);function Wr(e){let t=e.length;for(;--t>=0;)e[t]=0}const iC=3,sC=258,Th=29,lC=256+1+Th,kh=30,uC=512,cC=new Array((lC+2)*2);Wr(cC);const dC=new Array(kh*2);Wr(dC);const pC=new Array(uC);Wr(pC);const fC=new Array(sC-iC+1);Wr(fC);const gC=new Array(Th);Wr(gC);const mC=new Array(kh);Wr(mC);try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{}const Ac=new Uint8Array(256);for(let e=0;e<256;e++)Ac[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;Ac[254]=Ac[254]=1;const hC={class:"tag-manager"},vC={class:"form-group"},_C={class:"select-group-item"},yC=["value","placeholder"],bC={class:"form-group"},wC=["placeholder"],xC={class:"form-group"},SC=["placeholder"],TC={class:"form-group"},kC={class:"color-picker"},CC={class:"color-controls"},EC={class:"alpha-control"},$C={class:"alpha-value"},LC=qt({__name:"favour",emits:["sureSelect"],setup(e,{expose:t,emit:n}){const{t:o}=Gt(),a=S(null),r=S(!1),s=S({text:"",desc:"",id_index:"",color:"rgba(255, 123, 2, .4)"}),u=S({group:{id_index:0,name:"",color:"",create_time:0,p_uuid:""},sub:{id_index:0,name:"",color:"",create_time:0,g_uuid:"",p_uuid:""}}),p=S({hex:"#ff7b02",alpha:40}),m=Ht(()=>g(p.value.hex,p.value.alpha)),f=()=>{const O=g(p.value.hex,p.value.alpha);s.value.color=O},g=(O,I)=>{const V=parseInt(O.slice(1,3),16),me=parseInt(O.slice(3,5),16),M=parseInt(O.slice(5,7),16);return`rgba(${V}, ${me}, ${M}, ${I/100})`},x=()=>{a.value.open()},b=()=>{if(!s.value.text||!s.value.desc||!u.value.sub.id_index||!u.value.sub.g_uuid){ue({type:"warn",str:"tagManager.textRequired"});return}un.addNewTags({id_index:u.value.sub.id_index,g_uuid:u.value.sub.g_uuid,text:s.value.text,desc:s.value.desc,color:s.value.color?s.value.color:"rgba(255, 123, 2, .4)"}).then(()=>{window.postMessage({type:"weilin_prompt_ui_refresh_all_data"},"*"),ue({type:"success",str:"message.addSuccess"}),k()}).catch(()=>{ue({type:"warn",str:"message.networkError"})})},k=()=>{s.value={id_index:"",text:"",desc:"",color:"rgba(255, 123, 2, .4)"},r.value=!1},$=O=>{u.value=O,s.value.id_index=O.sub.id_index};return t({open:(O,I)=>{s.value={id_index:"",text:"",desc:"",color:"rgba(255, 123, 2, .4)"},s.value.text=O,s.value.desc=I,r.value=!0}}),(O,I)=>(E(),D(Ke,null,[it(Nr,{modelValue:r.value,"onUpdate:modelValue":I[5]||(I[5]=V=>r.value=V),title:v(o)("tagManager.addTag")},{footer:Pt(()=>[i("button",{onClick:I[4]||(I[4]=V=>r.value=!1)},y(v(o)("common.cancel")),1),i("button",{onClick:b},y(v(o)("common.confirm")),1)]),default:Pt(()=>[i("div",hC,[i("div",vC,[i("label",null,y(v(o)("importDialog.selectGroup")),1),i("div",_C,[i("input",{type:"text",value:s.value.id_index!=""?u.value.group.name+" -> "+u.value.sub.name:"请选择分组",readonly:"",placeholder:v(o)("importDialog.selectGroup")},null,8,yC),i("button",{class:"add-tag-btn",style:{"margin-left":"10px","min-width":"fit-content"},onClick:x},y(v(o)("importDialog.selectGroup")),1)])]),i("div",bC,[i("label",null,y(v(o)("tagManager.text")),1),$e(i("input",{type:"text","onUpdate:modelValue":I[0]||(I[0]=V=>s.value.desc=V),placeholder:v(o)("tagManager.textPlaceholder")},null,8,wC),[[ze,s.value.desc]])]),i("div",xC,[i("label",null,y(v(o)("tagManager.description")),1),$e(i("textarea",{"onUpdate:modelValue":I[1]||(I[1]=V=>s.value.text=V),placeholder:v(o)("tagManager.descriptionPlaceholder"),rows:"4"}," ",8,SC),[[ze,s.value.text]])]),i("div",TC,[i("label",null,y(v(o)("tagManager.backgroundColor")),1),i("div",kC,[i("div",{class:"color-preview",style:Bt({backgroundColor:m.value})},null,4),i("div",CC,[$e(i("input",{type:"color","onUpdate:modelValue":I[2]||(I[2]=V=>p.value.hex=V),onInput:f,class:"color-input"},null,544),[[ze,p.value.hex]]),i("div",EC,[$e(i("input",{type:"range","onUpdate:modelValue":I[3]||(I[3]=V=>p.value.alpha=V),min:"0",max:"100",onInput:f,class:"alpha-slider"},null,544),[[ze,p.value.alpha,void 0,{number:!0}]]),i("span",$C,y(p.value.alpha)+"%",1)])])])])])]),_:1},8,["modelValue","title"]),it(om,{ref_key:"tagGroupSelectItem",ref:a,onSureSelect:$},null,512)],64))}},[["__scopeId","data-v-7f6ca984"]]),AC={class:"weilin_prompt_ui_prompt-box"},MC={key:0,class:"weilin-toast",role:"status","aria-live":"polite"},IC={class:"center-container"},DC={class:"action-item"},OC=["title"],RC={class:"action-text"},PC={class:"action-item"},NC=["title"],FC={class:"action-text"},BC={class:"action-item"},UC={class:"action-text"},zC={class:"action-item"},VC=["title"],WC={class:"action-text"},jC={class:"action-item"},HC=["title"],GC={class:"action-text"},qC={class:"action-item"},YC=["title"],KC={class:"action-text"},JC={key:0,class:"action-item"},XC=["title"],QC={class:"action-text"},ZC={class:"action-item"},eE=["title"],tE={class:"action-text"},nE={class:"action-item"},oE=["title"],aE={class:"action-text"},rE={class:"action-item"},iE=["title"],sE={class:"action-text"},lE={class:"action-item"},uE=["title"],cE={class:"action-text"},dE={class:"action-item"},pE=["title"],fE={class:"action-text"},gE={class:"action-item"},mE=["title"],hE={class:"action-text"},vE={class:"action-item"},_E=["title"],yE={class:"action-text"},bE={class:"action-item weilin-comfyui-toolbar-right"},wE=["disabled"],xE=["placeholder"],SE={class:"token-counter"},TE=["onClick"],kE={class:"tag"},CE={class:"desc"},EE={class:"prompt-input-translate-area"},$E={style:{display:"flex","align-items":"center"}},LE=["placeholder"],AE=["title"],ME={style:{"margin-left":"5px"},class:"action-text"},IE=["title"],DE={class:"action-text"},OE=["title"],RE={class:"action-text"},PE=["title"],NE={class:"action-text"},FE=["title"],BE={class:"action-text"},UE=["title"],zE={class:"action-text"},VE={key:0,class:"tokens-container"},WE=["draggable","onDragstart","onDragover","onDrop","onDblclick"],jE={key:0,class:"newline-token"},HE=["title"],GE=["onMouseenter","onMouseleave"],qE=["title"],YE=["title","onMouseenter","onMouseleave"],KE={style:{"margin-left":"5px"}},JE=["onMouseenter","onMouseleave"],XE=["onClick"],QE=["value","onInput","onBlur","onKeyup"],ZE=["onClick","title"],e$={key:4,class:"translation-result"},t$=["onClick","title"],n$={class:"translated-text"},o$={key:0,class:"line-break"},a$={class:"tag-tips-content"},r$=["innerHTML"],i$={key:0,class:"weight-control"},s$={class:"weight-label"},l$={key:1,class:"lora-weight-controls"},u$={class:"weight-control"},c$={class:"weight-label"},d$={class:"weight-control"},p$={class:"weight-label"},f$=["title"],g$=["title"],m$={key:2,class:"bracket-btn-group"},h$={class:"bracket-btn-container"},v$={class:"vertical-btn-group"},_$=["title"],y$=["title"],b$={class:"bracket-btn-container"},w$={class:"vertical-btn-group"},x$=["title"],S$=["title"],T$={class:"bracket-btn-container"},k$={class:"vertical-btn-group"},C$=["title"],E$=["title"],$$=["title"],L$={class:"tag-manager-section"},A$={class:"weilin-comfyui-selection-actions-content"},M$={class:"weilin-comfyui-selection-actions-count"},I$={class:"header-left"},D$={class:"section-title"},O$={class:"header-right"},R$={class:"lora-manager-container"},P$={class:"tag-manager-section"},N$={class:"header-left"},F$={class:"section-title"},B$={class:"header-right"},U$={class:"tag-manager-container"},z$="weilin_prompt_ui_",Gi="weilin-selection-box",V$=16,Ch="weilin_prompt_ui_sidebar_visible",W$="weilin_prompt_ui_main_labels_v1",j$=50,H$=qt({__name:"prompt_index",props:{promptManager:{type:String,default:"prompt_global"},hasPromptLoraStack:{type:Boolean,default:!1}},setup(e,{expose:t}){const n=S(null),{t:o}=Gt(),a=S(),r=S(),s=S({top:0,left:0}),u=S(0),p=e,m=S(null),f=S(""),g=S([]),x={},b=S(null),k=S(!1),$=S({top:"0px",left:"0px"}),O=S(!1),I=S(null),V=S(null),me=S(null),M=S([]),z=S(!1),ce=S(!1),P=S([]),le=S(0),ie=S(null),Oe=S(localStorage.getItem("weilin_prompt_ui_auto_box_width")||450),Ae=S(localStorage.getItem("weilin_prompt_ui_auto_box_height")||350),fe=S(""),_e=S(!1),ae=S({x:0,y:0}),W=S({x:0,y:0}),re=S([]),Q=S(null),X=S(!1),ye=S(!1),pe=S(!1),Z=S({top:"0px",left:"0px"}),oe=S(!1),be=S(!1),ve=S(0),he=S(!1),te=S({top:"0px",left:"0px"}),K=S(localStorage.getItem("weilin_prompt_ui_show_delete_button")!=="false"),ee=()=>{localStorage.setItem("weilin_prompt_ui_show_delete_button",String(K.value))},F=()=>{K.value=!K.value,ee()},J=U=>{U.key==="weilin_prompt_ui_show_delete_button"&&(K.value=U.newValue!=="false")};Ut(()=>{window.addEventListener("storage",J),window.addEventListener("storage",Pe)}),so(()=>{window.removeEventListener("storage",J),window.removeEventListener("storage",Pe)});const Y=S(null),L=S(null),C=S(""),G=S(0),de=S(!0),Se=S(localStorage.getItem("weilin_function_toggles_clearAll")!=="false"),Le=S(localStorage.getItem("weilin_function_toggles_deleteButton")!=="false"),N=S(localStorage.getItem("weilin_function_toggles_randomTag")!=="false"),T=S(localStorage.getItem("weilin_function_toggles_randomTagSettings")!=="false"),j=S(localStorage.getItem("weilin_function_toggles_translateTag")!=="false"),ne=S(localStorage.getItem("weilin_function_toggles_clearDisabled")!=="false");At([Se,Le,N,T,j,ne],([U,R,xe,Ie,Qe,Me])=>{localStorage.setItem("weilin_function_toggles_clearAll",String(U)),localStorage.setItem("weilin_function_toggles_deleteButton",String(R)),localStorage.setItem("weilin_function_toggles_randomTag",String(xe)),localStorage.setItem("weilin_function_toggles_randomTagSettings",String(Ie)),localStorage.setItem("weilin_function_toggles_translateTag",String(Qe)),localStorage.setItem("weilin_function_toggles_clearDisabled",String(Me))});const Pe=U=>{U.key==="weilin_function_toggles_clearAll"?Se.value=U.newValue!=="false":U.key==="weilin_function_toggles_deleteButton"?Le.value=U.newValue!=="false":U.key==="weilin_function_toggles_randomTag"?N.value=U.newValue!=="false":U.key==="weilin_function_toggles_randomTagSettings"?T.value=U.newValue!=="false":U.key==="weilin_function_toggles_translateTag"?j.value=U.newValue!=="false":U.key==="weilin_function_toggles_clearDisabled"&&(ne.value=U.newValue!=="false")},De=()=>{de.value=!de.value};At(de,U=>{localStorage.setItem(Ch,String(U))}),Ut(()=>{const U=localStorage.getItem(Ch);de.value=U!=="false"});const se=()=>(G.value++,`token_${G.value}_${Date.now()}`),Te=()=>{z.value=!z.value},qe=()=>{z.value=!1},et=S(null),ot=S(null),ft=S(!1),bt=`weilin_prompt_ui_last_main_label_id_${p.promptManager||"default"}`,Mt=Ht(()=>{const U=de.value?280:0;return`calc(100% - ${(z.value?300:0)+U}px)`});let Vt=!1;const An=U=>{if(!U){ot.value=null,f.value="",vt(()=>{r.value&&(r.value.value="",xo({target:r.value}))}),ft.value=!1;return}ot.value=U.id,Vt=!0,f.value=U.content||"",vt(()=>{r.value&&(r.value.value=f.value,xo({target:r.value}))}),ft.value=!1};At(f,U=>{if(Vt){Vt=!1;return}ft.value=!0}),At(g,()=>{Vt||(ft.value=!0)},{deep:!0}),At(ot,U=>{try{localStorage.setItem(bt,U||"")}catch{}});function ao(){try{const U=localStorage.getItem(bt);if(!U)return;const R=localStorage.getItem(W$),xe=R?JSON.parse(R):[],Ie=Array.isArray(xe)?xe.find(Qe=>Qe&&Qe.id===U):null;if(!Ie)return;ot.value=U,Vt=!0,f.value=Ie.content||"",vt(()=>{r.value&&(r.value.value=f.value,xo({target:r.value})),Vt=!1}),ft.value=!1}catch{}}Ut(()=>{ao();const U=()=>{try{localStorage.setItem(bt,ot.value||"")}catch{}};window.addEventListener("beforeunload",U),Ta(()=>window.removeEventListener("beforeunload",U))});function an(){var U;ot.value&&(U=et.value)!=null&&U.updateSelectedContent&&(et.value.updateSelectedContent(f.value),ft.value=!1,wo())}const hn=S(!1);let Jn=null;function wo(){hn.value=!0,Jn&&clearTimeout(Jn),Jn=setTimeout(()=>{hn.value=!1},1600)}Ta(()=>{Jn&&clearTimeout(Jn)});const dt=()=>{I.value.open()},Ne=S(1),Ue=()=>{if(b.value===null)return;let R=g.value[b.value].text;if(!qr(R)){ue({type:"warn",str:"message.noFinishKuo"});return}const xe=je=>je.startsWith("(")&&je.endsWith(")")&&!je.slice(1,-1).includes("(")&&!je.slice(1,-1).includes(")")&&!je.slice(1,-1).includes("[")&&!je.slice(1,-1).includes("]")&&!je.slice(1,-1).includes("{")&&!je.slice(1,-1).includes("}")&&!je.slice(1,-1).includes("<")&&!je.slice(1,-1).includes(">");let Ie=R;const Qe=/:(-?\d+(\.\d+)?)$/.test(R),Me=R.match(/^\((.*?):(-?\d+(\.\d+)?)\)$/);if(Qe||Me)Ne.value===1?R.startsWith("(")&&R.endsWith(")")?Ie=R.slice(1,-1).replace(/:(\d+(\.\d+)?)$/,""):Ie=R.replace(/:(\d+(\.\d+)?)$/,""):Me?Ie=`(${Me[1]}:${Ne.value})`:Ie=R.replace(/:(-?\d+(\.\d+)?)$/,`:${Ne.value}`);else{const je=R.match(/^([^_]+)_(\([^)]+\))$/);if(je&&!R.includes("\\(")&&!R.includes("\\)")){const[,Je,gt]=je;Ne.value===1?Ie=R:Ie=`(${Je} ${gt}:${Ne.value})`}else R.includes("\\(")&&R.includes("\\)")&&!/[\(\)\[\]\{\}<>]/.test(R.replace(/\\[\(\)\[\]\{\}<>]/g,""))?Ne.value===1?Ie=R:R.startsWith("(")&&R.endsWith(")")?Ie=R.replace(/\)$/,`:${Ne.value})`):Ie=`(${R}:${Ne.value})`:/[\(\[\{\<\)\]\}\>]/.test(R)?Ne.value===1&&xe(R)?Ie=R.slice(1,-1):Ne.value===1?Ie=R:R.startsWith("(")&&R.endsWith(")")?Ie=R.replace(/\)$/,`:${Ne.value})`):Ie=`(${R}:${Ne.value})`:Ne.value===1?Ie=R:Ie=`(${R}:${Ne.value})`}g.value[b.value].text=Ie,zn()},Ot=S(.5),En=S(.5);At(b,U=>{var R;if(U!==null&&((R=g.value[U])!=null&&R.isLoraTag)){const Ie=g.value[U].text.match(/<wlr:([^:]+):([^:]+):([^>]+)>/);Ie&&(Ot.value=parseFloat(Ie[2]),En.value=parseFloat(Ie[3]))}});const Ba=()=>{var U;if(b.value!==null&&((U=g.value[b.value])!=null&&U.isLoraTag)){const R=g.value[b.value],xe=R.text.match(/<wlr:([^:]+):([^:]+):([^>]+)>/);if(xe){const Qe=`<wlr:${xe[1]}:${Ot.value}:${En.value}>`;R.text=Qe,zn()}}},pa=U=>{if(b.value===null)return;let xe=g.value[b.value].text;const Ie={"(":")","[":"]","{":"}","<":">"}[U];xe=`${U}${xe}${Ie}`,g.value[b.value].text=xe,Bn()},Ua=U=>{if(b.value===null)return;let xe=g.value[b.value].text;const Ie={"(":")","[":"]","{":"}","<":">"};xe.startsWith(U)&&xe.endsWith(Ie[U])&&(xe=xe.slice(1,-1),g.value[b.value].text=xe,Bn())},qr=U=>{const R=[],xe={"(":")","[":"]","{":"}","<":">"};for(let Ie of U)if(xe[Ie])R.push(Ie);else if(Object.values(xe).includes(Ie)&&(R.length===0||xe[R.pop()]!==Ie))return!1;return R.length===0};Xd(()=>{for(const U in x)delete x[U]}),S(!0),S(!1);const qi=U=>/[\p{L}]/u.test(U),fa=U=>{const R=U.match(/([^:]+):[\d.]+/);return R?R[1]:U};let Vo=null;const za=async()=>{Vo&&clearTimeout(Vo),Vo=setTimeout(async()=>{if(!r.value)return;const U=r.value,R=U.selectionStart;await vt();const xe=U.value.substring(0,R),Ie=document.createElement("div");Ie.style.position="absolute",Ie.style.top="0",Ie.style.left="0",Ie.style.visibility="hidden",Ie.style.whiteSpace="pre-wrap",Ie.style.wordWrap="break-word",Ie.style.width=window.getComputedStyle(U).width,Ie.style.font=window.getComputedStyle(U).font,Ie.style.padding=window.getComputedStyle(U).padding;const Qe=document.createTextNode(xe),Me=document.createElement("span");Me.textContent="|",Ie.appendChild(Qe),Ie.appendChild(Me),U.parentNode.appendChild(Ie);const je=Me.getBoundingClientRect(),Je=U.parentNode.getBoundingClientRect();let gt=je.top-Je.top+je.height,kt=je.left-Je.left;if(await vt(),a.value){const xt=a.value.offsetWidth,dn=U.offsetWidth,ln=U.getBoundingClientRect().left-Je.left;kt+xt>ln+dn&&(kt=ln+dn-xt),kt<ln&&(kt=ln),kt=Math.max(0,Math.min(kt,Je.width-xt))}U.parentNode.removeChild(Ie),s.value={top:gt,left:kt},Vo=null},50)},Yr=S(null),xo=U=>{if(!(U!=null&&U.target)||!r.value)return;const R=U.target.value,xe=U.target.selectionStart,Ie=U.target.selectionEnd,Qe={comma:{enabled:localStorage.getItem("weilin_prompt_ui_comma_conversion")!=="false",pattern:/,/g,replace:","},period:{enabled:localStorage.getItem("weilin_prompt_ui_period_conversion")!=="false",pattern:/。/g,replace:"."},bracket:{enabled:localStorage.getItem("weilin_prompt_ui_bracket_conversion")!=="false",patterns:[{pattern:/【/g,replace:"["},{pattern:/】/g,replace:"]"},{pattern:/(/g,replace:"("},{pattern:/)/g,replace:")"}]},angleBracket:{enabled:localStorage.getItem("weilin_prompt_ui_angle_bracket_conversion")!=="false",patterns:[{pattern:/《/g,replace:"<"},{pattern:/》/g,replace:">"}]}};let Me=R.substring(0,xe),je=R;Object.values(Qe).forEach(Ct=>{Ct.enabled&&(Ct.pattern?(Me=Me.replace(Ct.pattern,Ct.replace),je=je.replace(Ct.pattern,Ct.replace)):Ct.patterns&&Ct.patterns.forEach(({pattern:Wt,replace:Yt})=>{Me=Me.replace(Wt,Yt),je=je.replace(Wt,Yt)}))}),f.value=je;const Je=Me.length,gt=Ie-xe,kt=Je+gt;vt(()=>{r.value&&(r.value.setSelectionRange(Je,kt),r.value.focus())});const xt=je.substring(0,Je),dn=localStorage.getItem("weilin_prompt_ui_comma_close_autocomplete")==="true",ln=Je>0?xt[Je-1]:"";if((ln===","||ln===" ")&&dn){ce.value=!1,Y.value&&clearTimeout(Y.value),Y.value=setTimeout(()=>{var va;const Ct=((va=r.value)==null?void 0:va.selectionStart)||0,Yt=(f.value||"").substring(0,Ct);let vn=Ct;for(;vn>0&&!/[,\s]/.test(Yt[vn-1]);)vn--;const vr=Yt.substring(vn,Ct).trim();vr&&Cl(vr),Wo()},300),u.value=Fn(f.value);return}let Rt=Je;for(;Rt>0&&!/[,\s]/.test(xt[Rt-1]);)Rt--;const Et=xt.substring(Rt,Je).trim();Y.value&&clearTimeout(Y.value),Y.value=setTimeout(()=>{Et&&Cl(Et),Wo()},300),u.value=Fn(f.value)},Fn=U=>U?U.trim().split(/\s+/).length:0,en=async()=>{let U=localStorage.getItem("weilin_prompt_ui_comma_conversion")==="true",R=localStorage.getItem("weilin_prompt_ui_period_conversion")==="true",xe=localStorage.getItem("weilin_prompt_ui_bracket_conversion")==="true",Ie=localStorage.getItem("weilin_prompt_ui_angle_bracket_conversion")==="true";localStorage.getItem("weilin_prompt_ui_underscore_to_bracket"),localStorage.getItem("weilin_prompt_ui_comma_conversion")||(localStorage.setItem("weilin_prompt_ui_comma_conversion","true"),U=!0),localStorage.getItem("weilin_prompt_ui_period_conversion")||(localStorage.setItem("weilin_prompt_ui_period_conversion","true"),R=!0),localStorage.getItem("weilin_prompt_ui_bracket_conversion")||(localStorage.setItem("weilin_prompt_ui_bracket_conversion","true"),xe=!0),localStorage.getItem("weilin_prompt_ui_angle_bracket_conversion")||(localStorage.setItem("weilin_prompt_ui_angle_bracket_conversion","true"),Ie=!0),localStorage.getItem("weilin_prompt_ui_underscore_to_bracket")||localStorage.setItem("weilin_prompt_ui_underscore_to_bracket","false"),U&&(f.value=f.value.replace(/,/g,",")),R&&(f.value=f.value.replace(/。/g,".")),xe&&(f.value=f.value.replace(/【/g,"[").replace(/】/g,"]").replace(/(/g,"(").replace(/)/g,")")),Ie&&(f.value=f.value.replace(/《/g,"<").replace(/》/g,">"));const Qe=f.value;let Me=[];const je=g.value.map((_t,Rt)=>({token:_t,originalIndex:Rt,currentIndex:Rt})).filter(({token:_t})=>_t.isHidden);Me=((_t,Rt=0)=>{let Et=[],Ct=Rt,Wt="",Yt=[];for(;Ct<_t.length;){const vn=_t[Ct];if(vn===`
|
||
`){Wt.trim()&&(Et.push(Wt.trim()),Wt=""),Et.push(`
|
||
`),Ct++;continue}Yt.length===0&&vn===","?(Wt.trim()&&Et.push(Wt.trim()),Wt=""):Wt+=vn,Ct++}return Wt.trim()&&(Yt.length===0?Et.push(...Wt.split(",").filter(Boolean).map(vn=>vn.trim())):Et.push(Wt.trim())),Et})(Qe);const gt=new Map;g.value.forEach((_t,Rt)=>{_t.id||(_t.id=se()),gt.set(Rt,_t)});const kt=[];Me.forEach(_t=>{if(_t===`
|
||
`)kt.push({id:se(),text:`
|
||
`,translate:"",isPunctuation:!1,isEditing:!1,isHidden:!1,color:""});else if(_t.trim()){const Rt=_t.trim(),Et=/^<wlr:[^:]+:\d+(\.\d+)?:\d+(\.\d+)?>$/.test(Rt);let Ct=!1;for(const[Wt,Yt]of gt)if(Yt.text===Rt&&!Yt.isHidden&&!kt.includes(Yt)){Et&&!Yt.isLoraTag&&(Yt.isLoraTag=!0),kt.push(Yt),gt.delete(Wt),Ct=!0;break}if(!Ct){for(const[Wt,Yt]of gt)if(Yt.text===Rt&&!kt.includes(Yt)){Et&&!Yt.isLoraTag&&(Yt.isLoraTag=!0),kt.push(Yt),gt.delete(Wt),Ct=!0;break}}Ct||kt.push({id:se(),text:Rt,translate:"",isPunctuation:!1,isEditing:!1,isHidden:!1,color:"",isLoraTag:Et})}});const xt=new Set;je.forEach(({token:_t,originalIndex:Rt})=>{if(xt.has(_t.id)||(xt.add(_t.id),kt.some(Wt=>Wt.id===_t.id)))return;let Ct=Rt;for(;Ct>kt.length;)Ct--;Ct<0?kt.push(_t):kt.splice(Ct,0,_t)}),g.value=kt,f.value=g.value.length>0?g.value.reduce((_t,Rt,Et)=>{var va,Rl;if(Rt.isHidden)return _t;if(Rt.text===`
|
||
`){const Io=ja(Et);return Io!==-1&&g.value[Io],_t+Rt.text}if(_t===""){let Io=Et+1;for(;Io<g.value.length&&((va=g.value[Io])!=null&&va.isHidden);)Io++;const Pl=Io>=g.value.length,Ha=Io<g.value.length?g.value[Io]:null,Yo=Pl||Ha&&Ha.text===`
|
||
`;return Rt.text+(Yo?",":"")}let Ct=Et+1;for(;Ct<g.value.length&&((Rl=g.value[Ct])!=null&&Rl.isHidden);)Ct++;const Wt=Ct>=g.value.length,Yt=Ct<g.value.length?g.value[Ct]:null,vn=Yt&&Yt.text===`
|
||
`||Wt,vr=ja(Et);return vr!==-1&&g.value[vr].text===`
|
||
`?_t+Rt.text+(vn?",":""):_t+", "+Rt.text+(vn?",":"")},""):"",L.value&&clearTimeout(L.value),L.value=setTimeout(()=>{Bn()},100),Wo();const dn=50;let ln=0;for(;ln<g.value.length;){const _t=Math.min(ln+dn,g.value.length),Rt=[];for(let Et=ln;Et<_t;Et++)if(g.value[Et].text.length>0&&!g.value[Et].translate){let Ct=g.value[Et].text;const Wt=fa(Ct.trim());Rt.push(eo.getTranslateLocal(Wt).then(Yt=>{const vn=Yt;g.value[Et].translate=vn.translated.translate,g.value[Et].color=vn.translated.color}))}await Promise.all(Rt),ln=_t}u.value=Fn(f.value)},ro=async()=>{let R=0,xe=0,Ie=0;for(let Qe=0;Qe<g.value.length;Qe++){const Me=g.value[Qe];Me.translate&&(Me.translate===Me.text||/[a-zA-Z]/.test(Me.translate))&&!(typeof Me.text=="string"&&Me.text.startsWith("<wlr"))&&Ie++}for(console.log(`开始批量翻译,总共需要翻译 ${Ie} 个项目,批量大小: 50`);R<g.value.length;){const Qe=Math.min(R+50,g.value.length),Me=[],je=[];for(let Je=R;Je<Qe;Je++){const gt=g.value[Je];gt.translate&&(gt.translate===gt.text||/[a-zA-Z]/.test(gt.translate))&&!(typeof gt.text=="string"&>.text.startsWith("<wlr"))&&(Me.push(gt.text),je.push(Je))}if(Me.length>0){console.log(`处理第 ${Math.floor(R/50)+1} 批,翻译 ${Me.length} 个项目`);const Je=Me.join(`
|
||
`);try{const gt=new Promise((xt,dn)=>setTimeout(()=>dn(new Error("翻译请求超时")),3e4)),kt=await Promise.race([eo.translaterText("",Je),gt]);if(kt.data&&kt.data.length>0){const xt=kt.data.split(`
|
||
`);if(xt.length===Me.length){for(let dn=0;dn<je.length;dn++){const ln=je[dn];dn<xt.length&&xt[dn].trim()&&(g.value[ln].translate=xt[dn].trim(),xe++)}console.log(`第 ${Math.floor(R/50)+1} 批翻译完成,已处理 ${xe}/${Ie} 个`)}else throw new Error(`翻译结果数量不匹配: 期望${Me.length}个,实际${xt.length}个`)}else throw new Error("翻译返回结果为空")}catch(gt){console.error(`第 ${Math.floor(R/50)+1} 批批量翻译失败:`,gt),console.log("回退到逐个翻译模式...");let kt=0;for(let xt=0;xt<je.length;xt++){const dn=je[xt],ln=Me[xt];try{const _t=await eo.translaterText("",ln);_t.data&&_t.data.length>0&&(g.value[dn].translate=_t.data,xe++,kt++)}catch(_t){console.error(`单个翻译失败 (${ln}):`,_t)}}console.log(`回退翻译完成,成功 ${kt} 个`)}}R=Qe}console.log(`批量翻译完成!总共处理 ${xe}/${Ie} 个项目`)},Ao=S(""),Bn=()=>{const U=f.value.replace(/[\s\t\n]+/g,"");if(M.value.length>0){if(U.length>0){const R=M.value.filter(Qe=>!Qe.hidden);let xe={prompt:f.value,lora:"",temp_prompt:g.value,temp_lora:M.value};R.length>0&&(xe.lora=R);const Ie=JSON.stringify(xe);Ao.value!=Ie&&(Ao.value=Ie,Lo.saveHistory({tag:Ie}))}}else if(Ao.value!=f.value){const R={prompt:f.value,lora:"",temp_prompt:g.value,temp_lora:""},xe=JSON.stringify(R);U.length>0&&Lo.saveHistory({tag:xe})}Wo(),Vt||(ft.value=!0)},Wo=()=>{if(M.value.length>0){Ao.value=f.value;const U=M.value.filter(Ie=>!Ie.hidden);let R={prompt:f.value,lora:"",temp_prompt:g.value,temp_lora:M.value};U.length>0&&(R.lora=U);const xe=JSON.stringify(R);window.postMessage({type:"weilin_prompt_ui_prompt_finish_prompt",data:xe},"*")}else{Ao.value=f.value;const U={prompt:f.value,lora:"",temp_prompt:g.value,temp_lora:""},R=JSON.stringify(U);window.postMessage({type:"weilin_prompt_ui_prompt_finish_prompt",data:R},"*")}},io=(U,R)=>{if(X.value)return;So.value&&(clearTimeout(So.value),So.value=null);const xe=R.target.getBoundingClientRect();$.value={top:`${xe.top-50}px`,left:`${xe.left+xe.width/2}px`},b.value=U;const Ie=g.value[U].text;Ne.value=ct(Ie),te.value={top:`${xe.bottom+window.scrollY+xe.height+10}px`,left:`${xe.left+xe.width/2}px`},g.value[U].isLoraTag||(he.value=!0)},ct=U=>{const R=[{open:"(",close:")"},{open:"[",close:"]"},{open:"{",close:"}"},{open:"<",close:">"}];for(const Ie of R)if(U.startsWith(Ie.open)&&U.endsWith(Ie.close))return ct(U.slice(1,-1));const xe=U.match(/:(\d+(\.\d+)?)$/);return xe?parseFloat(xe[1]):1},So=S(null),jo=U=>{So.value&&clearTimeout(So.value),So.value=setTimeout(()=>{k.value||Jr(),So.value=null},100),he.value=!1},Kr=()=>{k.value=!1,jo(b.value),setTimeout(()=>{k.value||(X.value=!1)},100)},Jr=()=>{k.value||(b.value=null)},ga=()=>{if(b.value!==null){const U=b.value;cr(U),b.value=null,k.value=!1}},ur=()=>{if(b.value!==null){const U=b.value;g.value.splice(U+1,0,{id:se(),text:`
|
||
`,translate:"",isPunctuation:!1,isEditing:!1,isHidden:!1,color:""}),zn()}},cr=U=>{const R=f.value;let xe=g.value[U],Ie=0,Qe=-1;for(let Me=0;Me<U;Me++){let je=R.indexOf(g.value[Me].text,Ie);je!==-1&&(Ie=je+g.value[Me].text.length)}if(xe.text===`
|
||
`||xe.text===" "){for(let Me=Ie;Me<R.length;Me++)if(R[Me]===xe.text){Qe=Me;break}}else Qe=R.indexOf(xe.text,Ie);if(Qe!==-1){const Me=xe.text===`
|
||
`?" ":"",je=R.substring(0,Qe)+Me+R.substring(Qe+xe.text.length);f.value=je}g.value.splice(U,1),f.value=g.value.length>0?g.value.reduce((Me,je,Je)=>{var _t,Rt;if(je.isHidden)return Me;if(je.text===`
|
||
`){const Et=ja(Je);return Et!==-1&&g.value[Et],Me+je.text}if(Me===""){let Et=Je+1;for(;Et<g.value.length&&((_t=g.value[Et])!=null&&_t.isHidden);)Et++;const Ct=Et>=g.value.length,Wt=Et<g.value.length?g.value[Et]:null,Yt=Ct||Wt&&Wt.text===`
|
||
`;return je.text+(Yt?",":"")}let gt=Je+1;for(;gt<g.value.length&&((Rt=g.value[gt])!=null&&Rt.isHidden);)gt++;const kt=gt>=g.value.length,xt=gt<g.value.length?g.value[gt]:null,dn=xt&&xt.text===`
|
||
`||kt,ln=ja(Je);return ln!==-1&&g.value[ln].text===`
|
||
`?Me+je.text+(dn?",":""):Me+", "+je.text+(dn?",":"")},""):"",Bn(),ft.value=!0},Yi=(U,R)=>{const xe=f.value;let Ie=0,Qe=-1;for(let je=0;je<U;je++){let Je=xe.indexOf(g.value[je].text,Ie);Je!==-1&&(Ie=Je+g.value[je].text.length)}const Me=g.value[U].text;if(Qe=xe.indexOf(Me,Ie),Qe!==-1){const je=R.target.value,Je=xe.substring(0,Qe)+je+xe.substring(Qe+Me.length);f.value=Je,g.value[U]={...g.value[U],text:je},Bn()}},Ee=U=>{g.value[U].isPunctuation||(g.value[U].isEditing=!0,setTimeout(()=>{const R=x[U];if(R){R.focus();const xe=R.value.length;R.setSelectionRange(xe,xe),ke(R),R.addEventListener("input",()=>ke(R)),Bn(),ft.value=!0}}))},ke=U=>{const R=document.createElement("span");R.style.visibility="hidden",R.style.position="absolute",R.style.whiteSpace="pre";const xe=window.getComputedStyle(U);R.style.font=xe.font,R.style.fontSize=xe.fontSize,R.style.fontFamily=xe.fontFamily,R.style.padding=xe.padding,R.style.border=xe.border,R.textContent=U.value||U.placeholder||"",document.body.appendChild(R);const Ie=R.offsetWidth;U.style.width=`${Math.max(Ie+4,20)}px`,document.body.removeChild(R)},Re=U=>{g.value[U].isEditing=!1};At(g,U=>{zn()},{deep:!0}),At(M,U=>{Bn(),ft.value=!0},{deep:!0});const ht=()=>{O.value=!O.value,O.value&&vt(()=>{var R;const U=V.value.getBoundingClientRect();(R=me.value)==null||R.setPosition(U)})},rn=()=>{O.value=!1},cn=U=>{var R,xe;V.value&&!V.value.contains(U.target)&&me.value&&!me.value.$el.contains(U.target)&&rn(),(R=a.value)!=null&&R.contains&&((xe=r.value)!=null&&xe.contains)&&!a.value.contains(U.target)&&!r.value.contains(U.target)&&(ce.value=!1)},Dt=()=>{window.parent.postMessage({type:"weilin_prompt_ui_openTagManager_prompt"},"*")},sn=()=>{window.parent.postMessage({type:"weilin_prompt_ui_openLoraManager"},"*")},dr=()=>{window.parent.postMessage({type:"weilin_prompt_ui_openHistoryManager"},"*")},Un=S(!0),pr=()=>{Un.value=!Un.value},Xr=S(!1),Ki=()=>{Xr.value=!Xr.value};S(null);const Oc=()=>{const U=r.value;U&&(U.addEventListener("keyup",Va),U.addEventListener("click",Va),U.addEventListener("input",Va))},Va=()=>{ce.value&&za()},bl=()=>{if(r.value){const U=r.value.style.height||`${r.value.offsetHeight}px`;localStorage.setItem("weilinPromptTextAreaHeight",U)}},Rc=()=>{const U=localStorage.getItem("weilinPromptTextAreaHeight");U&&r.value&&(r.value.style.height=U)};Ut(()=>{document.addEventListener("click",cn),window.addEventListener("message",Qi),Sl(),Oc(),vt(()=>{Rc()}),setTimeout(()=>{Q.value||(Q.value=document.querySelector(".tokens-container")),Q.value?(Q.value.removeEventListener("mousedown",Qr),Q.value.removeEventListener("mousemove",fr),Q.value.removeEventListener("mouseup",go),Q.value.removeEventListener("mouseleave",go),Q.value.addEventListener("mousedown",Qr),Q.value.addEventListener("mousemove",fr),Q.value.addEventListener("mouseup",go),Q.value.addEventListener("mouseleave",go),Q.value.style.userSelect="none",Q.value.style.cursor="default",console.log("框选功能事件监听器绑定成功")):console.warn("未能找到tokens-container元素,框选功能可能无法正常工作")},100)}),Ta(()=>{Q.value&&(Q.value.removeEventListener("mousedown",Qr),Q.value.removeEventListener("mousemove",fr),Q.value.removeEventListener("mouseup",go),Q.value.removeEventListener("mouseleave",go)),ha()});const Qr=U=>{if(U.button===0&&!U.ctrlKey&&!U.metaKey){const R=U.target.closest(".token-item-box, .token-item, .lora-tag-icon, .newline-token, .tab-token, .delete-btn, .weight-control, .bracket-btn, .translate-button, .tag-tips-box, .token-controls"),xe=Q.value;if(xe&&!R){ye.value=!1,_e.value=!1,oe.value=!1,be.value=!1,gr(),ha();const Ie=xe.getBoundingClientRect();ae.value={x:Math.max(U.clientX,Ie.left),y:Math.max(U.clientY,Ie.top)},W.value={x:Math.max(U.clientX,Ie.left),y:Math.max(U.clientY,Ie.top)},ye.value=!0,console.log("记录框选起始位置")}}},fr=U=>{if(ye.value&&Q.value&&!_e.value&&Math.sqrt(Math.pow(U.clientX-ae.value.x,2)+Math.pow(U.clientY-ae.value.y,2))>3&&(U.preventDefault(),U.stopPropagation(),_e.value=!0,X.value=!0,re.value=[],ma(),console.log("开始实际框选")),_e.value&&Q.value){U.preventDefault(),U.stopPropagation();const R=Q.value.getBoundingClientRect();W.value={x:Math.min(Math.max(U.clientX,R.left),R.right),y:Math.min(Math.max(U.clientY,R.top),R.bottom)};const xe=5;Math.abs(W.value.x-ae.value.x)<xe&&(W.value.x=ae.value.x+xe),Math.abs(W.value.y-ae.value.y)<xe&&(W.value.y=ae.value.y+xe),(!oe.value||Date.now()-ve.value>100)&&(oe.value=!0,requestAnimationFrame(()=>{Zr(),oe.value=!1}));const Ie=Date.now();!be.value&&Ie-ve.value>V$&&(ve.value=Ie,be.value=!0,requestAnimationFrame(()=>{Ho(),be.value=!1}))}},go=()=>{if(ye.value=!1,_e.value){const U=re.value.length;_e.value=!1,X.value=!1,oe.value=!1,be.value=!1,ha(),U>0&&Pc()}},ma=()=>{try{let U=document.getElementById(Gi);U&&document.body.removeChild(U),U=document.createElement("div"),U.id=Gi,U.style.cssText=`
|
||
position: fixed;
|
||
background-color: rgba(66, 133, 244, 0.4);
|
||
border: 2px dashed #4285f4;
|
||
box-shadow: 0 0 12px rgba(66, 133, 244, 0.6);
|
||
pointer-events: none;
|
||
z-index: 99999;
|
||
transition: none;
|
||
opacity: 1;
|
||
display: block;
|
||
`,document.body.appendChild(U),console.log("选择框已创建"),Zr()}catch(U){console.error("创建选择框失败:",U),oe.value=!1}},Zr=()=>{try{let U=document.getElementById(Gi);if(!U&&_e.value&&(ma(),U=document.getElementById(Gi),!U))return;const R=Math.min(ae.value.x,W.value.x),xe=Math.min(ae.value.y,W.value.y),Ie=Math.abs(W.value.x-ae.value.x),Qe=Math.abs(W.value.y-ae.value.y),Me=5,je=Math.max(Ie,Me),Je=Math.max(Qe,Me);U&&(U.style.left=`${R}px`,U.style.top=`${xe}px`,U.style.width=`${je}px`,U.style.height=`${Je}px`)}catch(U){console.error("更新选择框失败:",U),oe.value=!1}},ha=()=>{try{const U=document.getElementById(Gi);U&&document.body.removeChild(U)}catch(U){console.error("移除选择框失败:",U)}},Ho=()=>{re.value=[];const U=Math.min(ae.value.x,W.value.x),R=Math.min(ae.value.y,W.value.y),xe=Math.max(ae.value.x,W.value.x),Ie=Math.max(ae.value.y,W.value.y);document.querySelectorAll(".token-item-box").forEach((Me,je)=>{if(!Me.querySelector(".token-item, .lora-tag-icon, .newline-token, .tab-token"))return;const gt=Me.getBoundingClientRect();gt.right>=U&>.left<=xe&>.bottom>=R&>.top<=Ie&&re.value.push(je)}),Wa()},Wa=()=>{const U=document.querySelectorAll(".token-item-box"),R=[],xe=[];U.forEach((Ie,Qe)=>{re.value.includes(Qe)?R.push(Ie):xe.push(Ie)}),R.forEach(Ie=>{Ie.classList.add("token-item-box-selected")}),xe.forEach(Ie=>{Ie.classList.remove("token-item-box-selected"),Ie.style.border="",Ie.style.boxShadow="",Ie.style.backgroundColor=Ie.dataset.originalBgColor||""})},Pc=()=>{if(re.value.length>0){const U=Math.min(ae.value.x,W.value.x),R=Math.min(ae.value.y,W.value.y),xe=Math.max(ae.value.x,W.value.x);Math.max(ae.value.y,W.value.y),Z.value={top:`${R-50}px`,left:`${(U+xe)/2}px`},pe.value=!0,setTimeout(()=>{document.addEventListener("click",ei)},0)}},wl=()=>{if(re.value.length===0)return;const xe=[...re.value].sort((Ie,Qe)=>Ie-Qe).map(Ie=>g.value[Ie].text).join(", ");navigator.clipboard.writeText(xe).then(()=>{const Ie=document.createElement("div");Ie.style.cssText=`
|
||
position: fixed;
|
||
top: 20px;
|
||
right: 20px;
|
||
background-color: #4caf50;
|
||
color: white;
|
||
padding: 10px 15px;
|
||
border-radius: 4px;
|
||
z-index: 999999;
|
||
`,Ie.textContent="已复制到剪贴板",document.body.appendChild(Ie),setTimeout(()=>{document.body.removeChild(Ie)},2e3)}),gr()},xl=()=>{re.value.length!==0&&(re.value.forEach(U=>{g.value[U]&&!g.value[U].isHidden&&(g.value[U].isHidden=!0,g.value[U].hiddenHint=o("promptBox.hiddenHint"))}),zn(),Bn(),gr())},Ji=()=>{re.value.length!==0&&(re.value.forEach(U=>{g.value[U]&&g.value[U].isHidden&&(g.value[U].isHidden=!1,g.value[U].hiddenHint="")}),zn(),Bn(),gr())},Nc=()=>{re.value.length>0&&(confirm(`确定要删除选中的 ${re.value.length} 个标签吗?`)?Fc():ti())},gr=()=>{pe.value=!1,document.removeEventListener("click",ei),ti()},ei=U=>{const R=document.querySelector(".token-controls");R&&!R.contains(U.target)&&gr()},Fc=()=>{if(re.value.length===0)return;[...re.value].sort((R,xe)=>xe-R).forEach(R=>{g.value.splice(R,1)}),zn(),Bn(),ti()},ti=()=>{document.querySelectorAll(".token-item-box-selected").forEach(R=>{R.classList.remove("token-item-box-selected"),R.style.border="",R.style.boxShadow="",R.style.backgroundColor=R.dataset.originalBgColor||""}),re.value=[],pe.value&&(pe.value=!1,document.removeEventListener("click",ei))},Xi=U=>{if(re.value.length===0)return;const R=U.target.closest(".token-item-box, .token-item, .token-controls, .delete-btn, .weight-control, .bracket-btn, .translate-button, .tag-tips-box"),xe=Q.value;(U.target===r.value||!R&&(!xe||!xe.contains(U.target)))&&ti()};Ut(()=>{document.addEventListener("click",Xi)}),so(()=>{document.removeEventListener("click",cn),document.removeEventListener("click",Xi),Yr.value&&clearTimeout(Yr.value),window.removeEventListener("message",Qi);const U=r.value;U&&(U.removeEventListener("keyup",Va),U.removeEventListener("click",Va),U.removeEventListener("input",Va)),Q.value&&(Q.value.removeEventListener("mousedown",Qr),Q.value.removeEventListener("mousemove",fr),Q.value.removeEventListener("mouseup",go),Q.value.removeEventListener("mouseleave",go)),ha()});const Qi=U=>{if(U.data.type==="weilin_prompt_ui_insertTag"){const R=f.value,xe=U.data.tagText;R===""?f.value=xe:(R.endsWith(" "),f.value=R+", "+xe+","),C.value=f.value,en(),vt(()=>{Bn()})}else if(U.data.type==="weilin_prompt_ui_user_history_tag"){const R=U.data.tagText;Ao.value=R,ts(R)}else if(U.data.type!=="weilin_prompt_ui_refresh_all_data"){if(U.data.type==="weilin_prompt_ui_translate_setting")Sl();else if(U.data.type==="weilin_prompt_ui_selectLora"){if(U.data.lora.loraWorks!=null&&U.data.lora.loraWorks.length>0){const R=f.value,xe=U.data.lora.loraWorks;R===""?f.value=xe:(R.endsWith(" "),f.value=R+", "+xe+","),C.value=f.value,en()}}else if(U.data.type==="weilin_prompt_ui_prompt_inner_get_node_tag_template_id_go_random_response")jc(U.data.data);else if(U.data.type==="weilin_prompt_ui_addLoraTag_inner")if(U.data.lora.loraWorks!=null&&U.data.lora.loraWorks.length>0){const R=f.value,xe=U.data.lora.tag+(U.data.lora.loraWorks===""?"":", "+U.data.lora.loraWorks);R===""?f.value=xe:(R.endsWith(" "),f.value=R+", "+xe+","),C.value=f.value,en()}else{const R=f.value,xe=U.data.lora.tag;R===""?f.value=xe:(R.endsWith(" "),f.value=R+", "+xe+","),C.value=f.value,en()}}},Sl=async()=>{const U=localStorage.getItem("weilin_prompt_ui_sourceLanguage")||"english",R=localStorage.getItem("weilin_prompt_ui_targetLanguage")||"chinese_simplified";localStorage.getItem("weilin_prompt_ui_sourceLanguage")||localStorage.setItem("weilin_prompt_ui_sourceLanguage",U),localStorage.getItem("weilin_prompt_ui_targetLanguage")||localStorage.setItem("weilin_prompt_ui_targetLanguage",R),await vt()},Zi=(U,R)=>{eo.translaterText("",U).then(xe=>{xe.data.length>0&&(R.translate=xe.data)})},Tl=()=>{eo.translaterInputText("",fe.value).then(U=>{U.data.length>0&&(g.value.push({text:U.data,translate:fe.value,isPunctuation:!1,isEditing:!1,isHidden:!1,color:""}),fe.value="",zn())})},kl=()=>{setTimeout(()=>{ce.value||(C.value=f.value,en())},100)},Cl=U=>{let R=U.replace(/[\[\]{}]/g,"").trim();const Ie=fa(R).trim();if(!Ie){ce.value=!1;return}if(Ie.length>20){ce.value=!1;return}try{const Qe=Ie.toLowerCase();pc.getAutocomplete(String(Qe)).then(async Me=>{P.value=Me.data,await za(),setTimeout(()=>{Oe.value=localStorage.getItem("weilin_prompt_ui_auto_box_width")||450,Ae.value=localStorage.getItem("weilin_prompt_ui_auto_box_height")||350,ce.value=P.value.length>0,le.value=0},50)})}catch(Qe){console.error("Autocomplete error:",Qe),ce.value=!1}},ni=U=>{ce.value&&(U.key==="ArrowDown"?(U.preventDefault(),le.value=Math.min(le.value+1,P.value.length-1),El()):U.key==="ArrowUp"?(U.preventDefault(),le.value=Math.max(le.value-1,0),El()):U.key==="Tab"||U.key==="Enter"?(U.preventDefault(),es(le.value,null)):U.key==="Escape"&&(U.preventDefault(),Ll()))},El=()=>{vt(()=>{if(ie.value&&a.value){const U=a.value,R=ie.value,xe=U.getBoundingClientRect(),Ie=R.getBoundingClientRect(),Qe=Ie.top<xe.top,Me=Ie.bottom>xe.bottom;Qe?U.scrollTop=U.scrollTop+(Ie.top-xe.top):Me&&(U.scrollTop=U.scrollTop+(Ie.bottom-xe.bottom))}})},$l=Ht(()=>{if(!m.value)return{left:s.value.left};const U=m.value.offsetWidth;Oe.value=localStorage.getItem("weilin_prompt_ui_auto_box_width")||450;const R=Oe.value;let xe=s.value.left;return xe+R>U&&(xe=U-R),xe<0&&(xe=0),{left:xe}}),es=(U,R)=>{if(R&&(R.preventDefault(),R.stopPropagation()),!P.value[U])return;ce.value=!1;const xe=r.value.selectionStart,Ie=r.value.selectionEnd,Qe=f.value;let Me=P.value[U].text;localStorage.getItem("weilin_prompt_ui_comma_conversion")!=="false"&&(Me=Me.replace(/,/g,",")),localStorage.getItem("weilin_prompt_ui_period_conversion")!=="false"&&(Me=Me.replace(/。/g,".")),localStorage.getItem("weilin_prompt_ui_bracket_conversion")!=="false"&&(Me=Me.replace(/【/g,"[").replace(/】/g,"]").replace(/(/g,"(").replace(/)/g,")")),localStorage.getItem("weilin_prompt_ui_angle_bracket_conversion")!=="false"&&(Me=Me.replace(/《/g,"<").replace(/》/g,">")),localStorage.getItem("weilin_prompt_ui_underscore_to_bracket")==="true"&&(Me=Me.replace(/_/g," ")),localStorage.getItem("weilin_prompt_ui_bracket_escape")==="true"&&(Me=Me.replace(/\(([^)]+)\)/g,"\\($1\\)"));let je=xe,Je=Ie;for(;je>0&&!/[,\s]/.test(Qe[je-1]);)je--;for(;!1;)Je++;let gt=Qe.substring(0,je)+Me+", "+Qe.substring(Je);const kt=je+Me.length+2;f.value=gt,C.value=gt,en(),vt(()=>{r.value&&(r.value.selectionStart=kt,r.value.selectionEnd=kt)})},Ll=()=>{ce.value=!1},ts=U=>{if(U.length>0)try{const R=JSON.parse(U);if(f.value=R.prompt,C.value=f.value,R.lora&&R.lora!=""&&(M.value=R.lora),R.temp_prompt&&R.temp_prompt!=""){const xe=R.temp_prompt;let Ie=!1;xe.tokens&&xe.tokens.length>0&&xe.tokens!=""&&(g.value=xe.tokens,Ie=!0),xe.lora&&xe.lora.length>0&&xe.lora!=""&&(M.value=xe.lora,Ie=!0),!Ie&&xe.length>0&&xe!=""&&(g.value=xe)}if(R.temp_lora&&R.temp_lora.length>0&&R.temp_lora!=""){const xe=R.temp_lora;M.value=xe}en()}catch{ue({type:"warn",str:"promptBox.settings.errorPrompt"})}},mr=S(!1),hr=S(null),Mn=S([]);let Mo=null,Go=null;const ns=(U,R=!1)=>{mr.value=!0,hr.value=null,Mn.value=[],R&&re.value.length>1&&re.value.includes(U)?Mn.value=[...re.value].sort((xe,Ie)=>xe-Ie):(re.value=[],hr.value=U),Go={originalTokens:[...g.value],draggedItems:Mn.value.length>0?Mn.value.map(xe=>g.value[xe]):[g.value[U]]}},Al=(U,R)=>{if(X.value){R.preventDefault();return}ns(U,!0),R.dataTransfer.effectAllowed="move"},Bc=(U,R,xe)=>{const Ie=R.filter(je=>je<xe).length;let Qe=Math.max(0,xe-Ie);const Me=U.length-R.length;return Qe=Math.min(Qe,Me),Qe},oi=U=>{if(!Go)return;const R=[...Go.originalTokens],xe=Mn.value.length>0?Mn.value:[hr.value],Ie=xe.map(Me=>Go.originalTokens[Me]);for(let Me=xe.length-1;Me>=0;Me--){const je=xe[Me];je<R.length&&R.splice(je,1)}const Qe=Bc(Go.originalTokens,xe,U);if(Go.draggedItems.forEach((Me,je)=>{R.splice(Qe+je,0,Me)}),g.value=R,zn(),Mn.value.length>0&&re.value.length>0){const Me=[];for(let je=0;je<R.length;je++){const Je=R[je];Ie.some(gt=>gt.text===Je.text)&&Me.push(je)}re.value=Me,setTimeout(()=>{Wa()},0)}},Ml=(U,R)=>{if(X.value){R.preventDefault();return}R.preventDefault(),mr.value&&(U<0||U>=g.value.length||Mn.value.length>0&&Mn.value.includes(U)||Mn.value.length===0&&hr.value===U||(Mo&&clearTimeout(Mo),Mo=setTimeout(()=>{oi(U)},j$)))},Il=(U,R)=>{R.preventDefault(),Mo&&(clearTimeout(Mo),Mo=null),mr.value&&Go&&oi(U),mr.value=!1,hr.value=null,Mn.value=[],Go=null},zn=()=>{f.value=g.value.length>0?g.value.reduce((U,R,xe)=>{var gt,kt;if(R.isHidden)return U;if(R.text===`
|
||
`){const xt=ja(xe);return xt!==-1&&g.value[xt],U+R.text}if(U===""){let xt=xe+1;for(;xt<g.value.length&&((gt=g.value[xt])!=null&>.isHidden);)xt++;const dn=xt>=g.value.length,ln=xt<g.value.length?g.value[xt]:null,_t=dn||ln&&ln.text===`
|
||
`;return R.text+(_t?",":"")}let Ie=xe+1;for(;Ie<g.value.length&&((kt=g.value[Ie])!=null&&kt.isHidden);)Ie++;const Qe=Ie>=g.value.length,Me=Ie<g.value.length?g.value[Ie]:null,je=Me&&Me.text===`
|
||
`||Qe,Je=ja(xe);return Je!==-1&&g.value[Je].text===`
|
||
`?U+R.text+(je?",":""):U+", "+R.text+(je?",":"")},""):"",Wo(),Vt||(ft.value=!0)},Uc=()=>{window.parent.postMessage({type:"weilin_prompt_ui_openAiWindow"},"*")},zc=()=>{window.open("https://github.com/weilin9999/WeiLin-Comfyui-Tools","_blank")},qo=()=>{window.parent.postMessage({type:"weilin_prompt_ui_open_cloud_window"},"*")},Vc=()=>{window.parent.postMessage({type:"weilin_prompt_ui_open_danbooru_manager_window"},"*")},Wc=()=>{window.open("https://afdian.com/a/weilin9999","_blank")},ja=U=>{for(let R=U-1;R>=0;R--)if(!g.value[R].isHidden)return R;return-1},Dl=U=>{if(U>=0&&U<g.value.length){if(g.value[U].text===`
|
||
`||g.value[U].text===" ")return;g.value[U].isHidden=!g.value[U].isHidden,g.value[U].isHidden?g.value[U].hiddenHint=o("promptBox.hiddenHint"):g.value[U].hiddenHint="",zn()}},Ol=()=>{window.open("https://www.bilibili.com/list/288025756/?sid=4690314&spm_id_from=333.1387.0.0&oid=114342431298474&bvid=BV1txdfYxE7X","_blank")},In=async()=>{if(p.promptManager=="prompt_global")try{await Kn.goRandomTemplate().then(U=>{U.code===200?(f.value=U.random_tags,vt(()=>{en()})):ue({type:"warn",str:U.info})}).catch(U=>{console.error(U),ue({type:"warn",str:"message.networkError"})})}catch(U){ue({type:"warn",str:"message.networkError"}),console.error("Error loading random tag settings:",U)}else window.postMessage({type:"weilin_prompt_ui_prompt_inner_get_node_tag_template_id_gorandom"},"*")},jc=async U=>{try{await Kn.goRandomTemplatePath(U).then(R=>{R.code===200?(f.value=R.random_tags,vt(()=>{en()})):ue({type:"warn",str:R.info})}).catch(R=>{console.error(R),ue({type:"warn",str:"message.networkError"})})}catch(R){ue({type:"warn",str:"message.networkError"}),console.error("Error loading random tag settings:",R)}},os=S(null),Hc=U=>{os.value&&os.value.open(U.text,U.translate)},Gc=()=>{n.value.open(p.promptManager)},qc=()=>{f.value="",g.value=[],fe.value="",M.value=[],C.value="",zn()},Yc=()=>{const U=g.value.filter(R=>!R.isHidden);g.value=U,zn(),ue({type:"success",str:o("promptBox.clearDisabledSuccess")||"已清空所有禁用标签"})};return t({setPromptText:ts}),(U,R)=>{var xe,Ie,Qe;return E(),D(Ke,null,[i("div",AC,[it(Os,{name:"weilin-fade"},{default:Pt(()=>[hn.value?(E(),D("div",MC,"已更新标签")):Ce("",!0)]),_:1}),p.promptManager==="prompt"?(E(),Jt(aT,{key:0,"is-open":z.value,"selected-loras":M.value,onClose:qe},null,8,["is-open","selected-loras"])):Ce("",!0),de.value?(E(),Jt(_T,{key:1,ref_key:"mainLabelManagerRef",ref:et,"selected-id":ot.value,onSelect:An},null,8,["selected-id"])):Ce("",!0),i("div",{class:We(`${z$}main-content`),style:Bt({width:Mt.value})},[i("div",IC,[i("div",DC,[i("button",{class:"tag-manager-btn",onClick:De,title:de.value?"收起标签栏":"展开标签栏"},[(E(),D("svg",{class:We(["weilin-comfyui-sidebar-toggle-icon",{"is-closed":!de.value}]),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24"},R[16]||(R[16]=[i("path",{d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"},null,-1)]),2)),i("span",RC,y(de.value?"收起标签栏":"展开标签栏"),1)],8,OC)]),i("div",PC,[i("button",{class:"language-switch-btn",onClick:Tt(ht,["stop"]),ref_key:"langBtnRef",ref:V,title:v(o)("controls.language")},[R[17]||(R[17]=i("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",class:"translate-icon"},[i("path",{d:"M12.87 15.07l-2.54-2.51.03-.03c1.74-1.94 2.98-4.17 3.71-6.53H17V4h-7V2H8v2H1v1.99h11.17C11.5 7.92 10.44 9.75 9 11.35 8.07 10.32 7.3 9.19 6.69 8h-2c.73 1.63 1.73 3.17 2.98 4.56l-5.09 5.02L4 19l5-5 3.11 3.11.76-2.04zM18.5 10h-2L12 22h2l1.12-3h4.75L21 22h2l-4.5-12zm-2.62 7l1.62-4.33L19.12 17h-3.24z"})],-1)),i("span",FC,y(v(o)("controls.language")),1)],8,NC),it(Os,{name:"fade"},{default:Pt(()=>[O.value?(E(),Jt(_b,{key:0,ref_key:"languageSwitcherRef",ref:me,onClose:rn},null,512)):Ce("",!0)]),_:1})]),i("div",BC,[it(Qw,{title:v(o)("controls.switchTheme")},{default:Pt(({isDark:Me})=>[i("span",UC,y(v(o)(Me?"controls.darkMode":"controls.lightMode")),1)]),_:1},8,["title"])]),i("div",zC,[i("button",{class:"settings-btn",onClick:dt,title:v(o)("controls.settings")},[R[18]||(R[18]=i("svg",{class:"settings-icon",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[i("path",{d:"M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.07.62-.07.94s.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z"})],-1)),i("span",WC,y(v(o)("controls.settings")),1)],8,VC)]),i("div",jC,[i("button",{class:"tag-manager-btn",onClick:Dt,title:v(o)("controls.tagManager")},[R[19]||(R[19]=i("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",class:"tag-icon"},[i("path",{d:"M21.41 11.58l-9-9C12.05 2.22 11.55 2 11 2H4c-1.1 0-2 .9-2 2v7c0 .55.22 1.05.59 1.42l9 9c.36.36.86.58 1.41.58.55 0 1.05-.22 1.41-.59l7-7c.37-.36.59-.86.59-1.41 0-.55-.23-1.06-.59-1.42zM5.5 7C4.67 7 4 6.33 4 5.5S4.67 4 5.5 4 7 4.67 7 5.5 6.33 7 5.5 7z"})],-1)),i("span",GC,y(v(o)("controls.tagManager")),1)],8,HC)]),i("div",qC,[i("button",{class:"tag-manager-btn",onClick:Vc,title:v(o)("controls.danbooruManager")},[R[20]||(R[20]=i("svg",{class:"tag-icon",viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},[i("path",{d:"M21.41 11.58l-9-9C12.05 2.22 11.55 2 11 2H4c-1.1 0-2 .9-2 2v7c0 .55.22 1.05.59 1.42l9 9c.36.36.86.58 1.41.58.55 0 1.05-.22 1.41-.59l7-7c.37-.36.59-.86.59-1.41 0-.55-.23-1.06-.59-1.42zM5.5 7C4.67 7 4 6.33 4 5.5S4.67 4 5.5 4 7 4.67 7 5.5 6.33 7 5.5 7z"})],-1)),i("span",KC,y(v(o)("controls.danbooruManager")),1)],8,YC)]),p.hasPromptLoraStack?(E(),D("div",JC,[i("button",{class:"tag-manager-btn",onClick:Te,title:v(o)("controls.loraStack")},[R[21]||(R[21]=i("svg",{sxmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",class:"tag-icon",width:"24",height:"24"},[i("path",{d:"M902.5 485.1c-59-17.5-113.8-3.4-155 27.7V365.1c0-45.2-36.9-82.1-82.1-82.1H511.2c31.1-41.2 45.2-96 27.7-155C522.2 71.6 475 26.1 418 12 303.4-16.5 200.9 69.4 200.9 179.3c0 39.1 13.5 74.7 35.3 103.7H82.1C36.9 283 0 319.9 0 365.1v113.1c0 25.5 27.9 38.8 49.5 25.3 38.8-24.3 87.8-33.6 139.4-19.5 57 15.6 103.4 62.5 118.4 119.7 30.1 115.5-56.2 219.4-166.8 219.4-33.5 0-64.7-9.6-91.1-26.2C27.8 783.4 0 796.8 0 822.2v113.2c0 45.2 36.9 82.1 82.1 82.1h583.3c45.2 0 82.1-36.9 82.1-82.1V787.7c29 21.9 64.6 35.3 103.7 35.3 109.9 0 195.8-102.5 167.3-217.1-14.1-56.9-59.7-104.1-116-120.8z"})],-1)),i("span",QC,y(v(o)("controls.loraStack")),1)],8,XC)])):Ce("",!0),i("div",ZC,[i("button",{class:"tag-manager-btn",onClick:sn,title:v(o)("controls.loraManager")},[R[22]||(R[22]=i("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",class:"tag-icon",width:"24",height:"24"},[i("path",{d:"M129 128h350v80H209v224h270v80H129V128zM129 895V576h768v319H129z m80-239v159h608V656H209zM730 356c19.882 0 36-16.118 36-36s-16.118-36-36-36-36 16.118-36 36 16.118 36 36 36z"}),i("path",{d:"M578.517 214.386a32.002 32.002 0 0 0-16.01 27.731l0.058 155.918a31.998 31.998 0 0 0 16 27.701l135.156 78.033a32.002 32.002 0 0 0 31.99 0.006l135.058-77.909a32.002 32.002 0 0 0 16.01-27.731l-0.058-155.918a32 32 0 0 0-16-27.701l-135.157-78.033a31.998 31.998 0 0 0-31.989-0.005l-135.058 77.908z m67.002 58.058l84.033-48.591 84.181 48.715 0.034 95.24-84.034 48.591-84.18-48.714-0.034-95.241z"})],-1)),i("span",tE,y(v(o)("controls.loraManager")),1)],8,eE)]),i("div",nE,[i("button",{class:"tag-manager-btn",onClick:dr,title:v(o)("controls.history")},[R[23]||(R[23]=i("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",class:"tag-icon",width:"24",height:"24"},[i("path",{d:"M653.7 85.83c-235.05 0-426.29 191.25-426.29 426.3s191.24 426.3 426.29 426.3c235.06 0 426.3-191.25 426.3-426.3S888.76 85.83 653.7 85.83z m0 779.98c-195.01 0-353.67-158.65-353.67-353.68S458.69 158.45 653.7 158.45c195.02 0 353.68 158.65 353.68 353.68S848.72 865.81 653.7 865.81z"}),i("path",{d:"M866.78 634.19L695.93 533.61V302.59c0-20.06-16.26-36.31-36.31-36.31s-36.31 16.26-36.31 36.31v253.66c0 17.06 11.8 31.26 27.66 35.16l178.98 105.36c17.28 10.17 39.54 4.41 49.71-12.87 10.17-17.28 4.4-39.54-12.88-49.71zM44.76 324.51h186.42c20.05 0 36.31-16.26 36.31-36.31s-16.26-36.31-36.31-36.31H44.76c-20.05 0-36.31 16.26-36.31 36.31s16.26 36.31 36.31 36.31zM231.18 703.25H44.76c-20.05 0-36.31 16.26-36.31 36.31s16.26 36.31 36.31 36.31h186.42c20.05 0 36.31-16.26 36.31-36.31s-16.25-36.31-36.31-36.31zM36.31 550.19h118.8c20.05 0 36.31-16.26 36.31-36.31s-16.26-36.31-36.31-36.31H36.31c-20.05 0-36.31 16.26-36.31 36.31 0 20.06 16.26 36.31 36.31 36.31z"})],-1)),i("span",aE,y(v(o)("controls.history")),1)],8,oE)]),i("div",rE,[i("button",{class:"tag-manager-btn",onClick:Uc,title:v(o)("controls.aiChat")},[R[24]||(R[24]=i("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",class:"tag-icon",width:"24",height:"24"},[i("path",{d:"M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2z"}),i("path",{d:"M6 14h12v2H6zm0-3h12v2H6zm0-3h12v2H6z"})],-1)),i("span",sE,y(v(o)("controls.aiChat")),1)],8,iE)]),i("div",lE,[i("button",{class:"tag-manager-btn",onClick:zc,title:v(o)("controls.github")},[R[25]||(R[25]=i("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",class:"tag-icon",width:"24",height:"24"},[i("path",{d:"M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z"})],-1)),i("span",cE,y(v(o)("controls.github")),1)],8,uE)]),i("div",dE,[i("button",{class:"tag-manager-btn",onClick:qo,title:v(o)("controls.shareCloudData")},[R[26]||(R[26]=i("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",class:"tag-icon",width:"24",height:"24"},[i("path",{d:"M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96zM14 13v4h-4v-4H7l5-5 5 5h-3z"})],-1)),i("span",fE,y(v(o)("controls.shareCloudData")),1)],8,pE)]),i("div",gE,[i("button",{class:"tag-manager-btn",onClick:Ol,title:v(o)("controls.tutorialVideo")},[R[27]||(R[27]=i("svg",{t:"1745234292993",class:"tag-icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"1496",width:"128",height:"128"},[i("path",{d:"M204.288 63.488c-8.704 8.192-16.896 20.48-18.944 26.624-3.584 11.776 12.8 62.464 20.48 62.464S235.52 176.128 235.52 184.32c0 16.384-17.92 26.112-47.104 26.112-34.816 0-104.448 27.648-128.512 51.2-9.216 8.704-26.112 33.792-37.888 56.32L0 358.4v469.504l21.504 40.448c24.576 47.616 35.84 59.392 82.944 84.992l40.96 22.528h722.944l40.96-19.968c51.712-24.576 72.704-45.056 95.744-94.72l17.92-38.4v-231.424l0.512-231.424-17.92-36.352c-9.216-20.48-28.16-47.104-42.496-59.904-31.232-30.208-86.528-54.272-122.368-54.272-54.272 0-65.024-22.528-26.624-57.856 20.48-18.432 23.04-25.088 23.04-45.568 0-19.968-3.584-28.16-16.896-41.984-9.216-9.216-22.528-16.896-29.696-16.896-11.776 0-34.304 9.216-40.448 16.896-1.536 1.536-35.84 35.328-75.776 74.24l-73.216 71.168-83.456-0.512c-45.568 0-88.064-2.56-93.696-4.608-5.632-2.56-38.4-31.232-72.704-65.024C249.856 40.448 235.008 32.256 204.288 63.488z m652.8 262.656c5.12 0.512 19.968 9.216 31.744 20.48l21.504 19.968 1.536 217.088c1.024 197.12 0.512 218.112-8.704 236.032-14.336 27.136-34.816 40.448-65.536 41.984-14.336 0.512-173.568 0.512-353.28 0l-326.144-1.536-45.056-45.056V373.248l20.992-22.528c15.872-17.92 25.6-23.552 41.984-25.088 16.384-1.024 634.88-0.512 680.96 0.512z","p-id":"1497"}),i("path",{d:"M279.04 502.272c-20.48 22.016-20.992 25.088-20.992 66.56 0 39.936 1.024 44.544 17.92 64 29.184 33.28 55.808 32.256 84.48-2.56 11.264-12.8 12.8-22.016 13.312-64 0-47.104-0.512-48.64-19.968-68.096-27.136-27.648-47.616-26.112-74.752 4.096z m393.216-3.584c-18.944 18.944-19.968 20.992-19.968 69.12 0 47.616 0.512 49.664 18.432 67.072 24.576 23.552 35.84 26.624 58.368 13.824 29.184-16.896 39.936-43.52 36.864-90.624-2.56-35.328-4.608-41.984-22.016-59.904-25.088-25.6-45.568-25.6-71.68 0.512z","p-id":"1498"})],-1)),i("span",hE,y(v(o)("controls.tutorialVideo")),1)],8,mE)]),i("div",vE,[i("button",{class:"tag-manager-btn",onClick:Wc,title:v(o)("controls.sponsor")},[R[28]||(R[28]=i("svg",{t:"1745823985128",class:"tag-icon",viewBox:"0 0 1322 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24"},[i("path",{d:"M495.899049 634.906371c-17.304811 0-31.251971 13.947161-31.251971 31.251971S478.594238 697.410314 495.899049 697.410314c17.304811 0 31.251971-13.947161 31.251971-31.251972 0-17.304811-13.947161-31.251971-31.251971-31.251971zM790.855671 728.662285c-17.304811 0-31.251971 13.947161-31.251972 31.251971s13.947161 31.251971 31.251972 31.251972 31.251971-13.947161 31.251971-31.251972c0-17.04653-13.947161-30.993691-31.251971-31.251971z"}),i("path",{d:"M1262.99289 719.622459c-13.430599-8.264984-28.927445-13.430599-44.68257-14.980284 34.867902-84.974368 57.080047-196.293374-18.596215-306.837537-115.193217-168.657333-280.75118-256.73107-491.766556-260.863562-60.179416-1.291404-130.948343 1.549685-205.849762 4.649054-87.040614 3.35765-203.008673 8.006703-281.526023 1.549684 15.755126-8.523265 32.543375-16.788249 47.007098-23.761829 55.530362-27.119479 98.921529-48.04022 84.457807-85.232649-7.748423-21.695583-30.218848-33.059937-67.411277-34.09306C206.624604-1.755689 37.967271 43.443443 7.748423 119.636265c-17.04653 42.874605-19.887618 125.524447 152.902206 198.876182 71.027208 30.218848 271.969635 66.894715 349.453861 74.643138 17.563091 1.549685 34.867902 5.165615 51.397871 11.364353-17.821372 11.622634-35.901025 24.02011-54.238959 36.417586-31.768533-18.079653-83.941245-39.516955-122.683358-13.172318-14.463722 9.298107-23.503549 25.053233-24.02011 42.358044-0.516562 21.179022 12.397476 42.099763 26.861198 58.629731-57.080047 45.715694-103.312302 89.881703-119.84227 123.974762-18.337934 41.841482-25.828075 110.544163 8.523265 177.438879 43.391167 84.974368 138.955046 144.120661 284.625391 176.147474 190.352916 41.583202 354.619476 4.132492 463.355674-53.205835 60.437697-32.026814 103.570583-69.994085 124.233043-103.828864 6.457019 2.066246 12.914038 4.132492 19.629338 6.198738 9.298107 2.841088 18.596214 5.682177 27.37776 8.781546 28.669164 10.072949 60.695977 8.523265 85.232649-3.61593l1.291403-0.774843c17.821372-9.039826 31.510252-25.053233 37.708991-44.166009 15.238565-51.139589-29.444006-79.033911-56.563486-96.08044z m-811.776412-239.684541l-17.30481 12.655757c-5.165615-5.165615-9.814669-11.106072-13.430599-17.563091 6.7153-2.066246 18.337934 0.258281 30.735409 4.907334zM1262.99289 798.139808c-1.291404 3.874211-4.132492 6.97358-9.298107 9.814669-10.33123 5.165615-25.569795 5.423896-39.258675 0.774842-9.298107-3.35765-19.371057-6.457019-29.444006-9.556388-18.596214-5.682177-49.848186-15.238565-55.788643-22.470426-9.814669-12.914038-28.152602-15.755126-41.32492-5.940457s-15.755126 28.152602-5.940458 41.324921c3.615931 4.390773 7.490142 8.264984 12.139196 11.622634-44.940851 62.245662-242.267348 186.220424-521.468844 125.007885-125.782728-27.636041-210.498815-77.742507-244.850155-145.412065-24.794952-48.815063-19.112776-98.921529-7.231861-126.299289 34.09306-71.027208 280.75118-234.518925 438.30244-327.241716 13.947161-8.264984 18.596214-26.344637 10.33123-40.291798s-27.119479-19.629337-40.291797-10.33123c-12.655757 7.490142-55.788643 33.059937-111.060725 68.186119-18.596214-12.655757-50.881309-27.894322-102.537459-33.059936-81.874999-8.264984-270.936512-44.42429-332.149051-70.252366C139.471608 245.418993 40.033517 196.34565 61.987381 141.073568c5.165615-12.914038 29.185725-33.576498 81.100157-53.464116 35.384463-13.430599 72.318611-22.470426 109.769321-27.119479l-11.622634 5.682176c-35.384463 17.304811-73.868296 36.417586-99.954652 59.146293-1.807965-1.033123-3.615931-2.324527-5.165615-3.874211-10.847792-11.622634-29.185725-12.397476-41.06664-1.291404l-0.516562 0.516561c-11.880915 11.106072-12.139195 29.702287-1.033123 41.583202 10.589511 11.106072 26.086356 19.371057 45.715694 25.569795 0.774842 0.258281 1.291404 0.516562 2.066246 0.774842 68.702681 21.179022 190.611197 18.596214 362.367899 11.622634 74.126577-2.841088 144.120661-5.682177 202.492111-4.649054 193.710566 3.874211 339.122631 80.841876 444.75946 235.552049 64.828469 95.047318 41.583202 188.544951 4.390773 269.903388-4.649054-3.615931-9.039826-7.748423-12.655757-12.139195-10.33123-12.397476-28.669164-14.463722-41.324921-4.649054-12.655757 10.072949-14.722003 28.669164-4.649054 41.324921 5.940457 7.490142 36.675867 42.874605 74.643138 39.775236h2.066246c1.291404-0.258281 2.324527 0 3.615931-0.258281 25.828075-4.649054 42.358044-3.615931 57.596608 6.198738 20.40418 12.914038 30.218848 20.40418 28.410883 26.861199z"})],-1)),i("span",yE,y(v(o)("controls.sponsor")),1)],8,_E)]),it(tm,{ref_key:"settingDialog",ref:I},null,512),i("div",bE,[i("button",{class:We(["update-label-btn",{"is-dirty":ft.value}]),disabled:!ot.value||!ft.value,onClick:an}," 更新标签 ",10,wE)])]),i("div",{style:{position:"relative"},ref_key:"parentCneterBox",ref:m},[$e(i("textarea",{"onUpdate:modelValue":R[0]||(R[0]=Me=>f.value=Me),class:"input-area",onInput:xo,placeholder:v(o)("promptBox.placeholder"),onKeydown:ni,onBlur:kl,rows:"6",ref_key:"inputAreaRef",ref:r,onMouseup:bl,onResize:bl},null,40,xE),[[ze,f.value]]),i("div",SE,y(u.value)+" tokens ",1),i("div",{class:"autocomplete-container",ref_key:"autocompleteContainerRef",ref:a,style:Bt({top:`${s.value.top}px`,left:`${$l.value.left}px`,display:ce.value?"block":"none",width:`${Oe.value}px`,maxHeight:`${Ae.value}px`})},[i("button",{class:"close-autocomplete-btn",onClick:Tt(Ll,["stop"])},"×"),(E(!0),D(Ke,null,lt(P.value,(Me,je)=>(E(),D("div",{key:je,class:We(["autocomplete-item",{selected:je===le.value}]),onClick:Tt(Je=>es(je,Je),["stop"]),ref_for:!0,ref:Je=>{Je&&je===le.value&&(ie.value=Je)}},[i("span",kE,y(Me.text),1),i("span",CE,y(Me.desc),1)],10,TE))),128))],4)],512),i("div",EE,[i("div",$E,[$e(i("input",{type:"text","onUpdate:modelValue":R[1]||(R[1]=Me=>fe.value=Me),class:"prompt-input-translate-area-textarea",onKeyup:R[2]||(R[2]=Rn(Me=>Tl(),["enter"])),placeholder:v(o)("promptBox.translatePlaceholder")},null,40,LE),[[ze,fe.value]]),i("button",{class:"translate-btn",style:{"margin-left":"8px"},onClick:R[3]||(R[3]=Me=>Tl())}," 翻译 ")]),j.value?(E(),D("button",{key:0,class:"translate-btn random-tag-settings-btn",onClick:ro,title:v(o)("promptBox.oneClickTranslate")},[R[29]||(R[29]=i("svg",{viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",class:"token-item-icon",width:"24",height:"24"},[i("path",{d:"M677.676657 294.6142c19.165116 57.5433 44.715939 102.2992 89.431879 147.0551 38.322239-38.3622 63.873063-89.5118 83.038178-147.0551h-172.470057z m-421.56861 319.685h166.076358l-83.038179-223.7795-83.038179 223.7795z","p-id":"2419"}),i("path",{d:"M894.854661 0.504H128.353929C58.095158 0.504 0.607803 58.0473 0.607803 128.378v767.244c0 70.3307 57.487355 127.874 127.746126 127.874h766.500733c70.258771 0 127.746126-57.5433 127.746126-127.874V128.378c0-70.3307-51.101647-127.874-127.746126-127.874zM581.867062 825.2913c-12.771416 12.7874-25.550824 12.7874-38.322239 12.7874-6.3937 0-19.165116 0-25.550824-6.3937-6.3937-6.3937-12.779408 0-12.779408-6.3937s-6.385708-12.7874-12.771415-25.5748c-6.3937-12.7874-6.3937-19.1811-12.779408-31.9685l-25.542832-70.3307H230.557224L205.0064 767.748c-12.771416 25.5748-19.165116 44.7559-25.550824 57.5433-6.3937 12.7874-19.165116 12.7874-38.322239 12.7874-12.779408 0-25.550824-6.3937-38.330231-12.7874-12.771416-12.7874-19.157124-19.1811-19.157124-31.9685 0-6.3937 0-12.7874 6.385708-25.5748 6.3937-12.7874 6.3937-19.1811 12.771416-31.9685l140.525533-358.0472c6.3937-12.7874 6.3937-25.5748 12.779408-38.3622 6.385708-12.7874 12.771416-25.5748 19.157124-31.9685 6.3937-6.3937 12.779408-19.1811 25.550823-25.5748 12.779408-6.3937 25.550824-6.3937 38.330232-6.3937 12.771416 0 25.542832 0 38.322239 6.3937 12.771416 6.3937 19.165116 12.7874 25.550824 25.5748 6.385708 6.3937 12.771416 19.1811 19.157124 31.9685 6.3937 12.7874 12.779408 25.5748 19.165115 44.7559l140.525534 351.6535c12.771416 25.5748 19.165116 44.7559 19.165116 57.5433-6.3937 6.3937-12.779408 19.1811-19.165116 31.9685zM933.176901 575.937c-70.258771-25.5748-121.360418-57.5433-166.076358-95.9055-44.707947 44.7559-102.195302 76.7244-172.462065 95.9055l-19.157124-31.9685c70.258771-19.1811 127.746126-44.7559 172.462066-89.5118C703.22748 409.7008 664.905241 352.1575 652.125833 288.2205h-63.873063v-25.5748h172.470058c-12.7874-19.1811-25.558816-44.7559-38.330232-63.937l19.157124-6.3937c12.779408 19.1811 31.944524 44.7559 44.715939 70.3307h159.682658v31.9685h-63.873063c-19.157124 63.937-51.093655 121.4803-89.423887 159.8425 44.715939 38.3622 95.809594 70.3307 166.076358 89.5118l-25.550824 31.9685z","p-id":"2420"})],-1)),i("span",ME,y(v(o)("promptBox.oneClickTranslate")),1)],8,AE)):Ce("",!0),T.value?(E(),D("button",{key:1,class:"translate-btn random-tag-settings-btn",onClick:Gc,title:v(o)("promptBox.randomTagSettings")},[R[30]||(R[30]=i("svg",{viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",class:"utils-item-icon",width:"24",height:"24"},[i("path",{d:"M512 409.6c-56.32 0-102.4 46.08-102.4 102.4s46.08 102.4 102.4 102.4 102.4-46.08 102.4-102.4-46.08-102.4-102.4-102.4z m0 153.6c-28.16 0-51.2-23.04-51.2-51.2s23.04-51.2 51.2-51.2 51.2 23.04 51.2 51.2-23.04 51.2-51.2 51.2z"}),i("path",{d:"M512 204.8c-25.6 0-51.2 2.56-76.8 7.68l-15.36-61.44c-2.56-10.24-10.24-17.92-20.48-20.48-10.24-2.56-20.48 0-28.16 7.68l-76.8 76.8c-5.12 5.12-7.68 12.8-7.68 20.48s2.56 15.36 7.68 20.48l76.8 76.8c5.12 5.12 12.8 7.68 20.48 7.68 2.56 0 5.12 0 7.68-2.56 10.24-2.56 17.92-10.24 20.48-20.48l15.36-61.44c25.6-5.12 51.2-7.68 76.8-7.68 140.8 0 256 115.2 256 256s-115.2 256-256 256-256-115.2-256-256c0-25.6 2.56-51.2 7.68-76.8l61.44-15.36c10.24-2.56 17.92-10.24 20.48-20.48 2.56-10.24 0-20.48-7.68-28.16l-76.8-76.8c-5.12-5.12-12.8-7.68-20.48-7.68s-15.36 2.56-20.48 7.68l-76.8 76.8c-7.68 7.68-10.24 17.92-7.68 28.16 2.56 10.24 10.24 17.92 20.48 20.48l61.44 15.36c-5.12 25.6-7.68 51.2-7.68 76.8 0 168.96 138.24 307.2 307.2 307.2s307.2-138.24 307.2-307.2-138.24-307.2-307.2-307.2z"})],-1)),i("span",DE,y(v(o)("promptBox.randomTagSettings")),1)],8,IE)):Ce("",!0),N.value?(E(),D("button",{key:2,class:"translate-btn random-tag-btn",onClick:In,title:v(o)("promptBox.oneClickRandomTag")},[R[31]||(R[31]=i("svg",{viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",class:"utils-item-icon",width:"24",height:"24"},[i("path",{d:"M832 512c0-176-144-320-320-320S192 336 192 512s144 320 320 320 320-144 320-320z m-384 0c0-35.2 28.8-64 64-64s64 28.8 64 64-28.8 64-64 64-64-28.8-64-64z m128-128c0-35.2 28.8-64 64-64s64 28.8 64 64-28.8 64-64 64-64-28.8-64-64z m-256 0c0-35.2 28.8-64 64-64s64 28.8 64 64-28.8 64-64 64-64-28.8-64-64z m128-128c0-35.2 28.8-64 64-64s64 28.8 64 64-28.8 64-64 64-64-28.8-64-64z m256 256c0-35.2 28.8-64 64-64s64 28.8 64 64-28.8 64-64 64-64-28.8-64-64z m-256 0c0-35.2 28.8-64 64-64s64 28.8 64 64-28.8 64-64 64-64-28.8-64-64z m-128 128c0-35.2 28.8-64 64-64s64 28.8 64 64-28.8 64-64 64-64-28.8-64-64z m256 0c0-35.2 28.8-64 64-64s64 28.8 64 64-28.8 64-64 64-64-28.8-64-64z"})],-1)),i("span",RE,y(v(o)("promptBox.oneClickRandomTag")),1)],8,OE)):Ce("",!0),Le.value?(E(),D("button",{key:3,class:We(["translate-btn toggle-delete-btn",{active:K.value}]),onClick:F,title:K.value?v(o)("promptBox.hideDeleteButton"):v(o)("promptBox.showDeleteButton")},[R[32]||(R[32]=i("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",class:"utils-item-icon",width:"24",height:"24"},[i("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z",fill:"currentColor"})],-1)),i("span",NE,y(K.value?v(o)("promptBox.hideDeleteButton"):v(o)("promptBox.showDeleteButton")),1)],10,PE)):Ce("",!0),Se.value?(E(),D("button",{key:4,class:"translate-btn clear-all-btn",onClick:qc,title:v(o)("promptBox.oneClickCleanAll")},[R[33]||(R[33]=i("svg",{class:"utils-item-icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"1605",width:"24",height:"24"},[i("path",{d:"M716.8 338.944H307.2v-102.4a76.8 76.8 0 0 1 76.8-76.8h256a77.312 77.312 0 0 1 76.8 76.8z m-358.4-51.2h307.2v-51.2a26.112 26.112 0 0 0-25.6-25.6h-256a25.6 25.6 0 0 0-25.6 25.6zM702.464 856.576H321.536A65.024 65.024 0 0 1 256 791.04V406.528a25.6 25.6 0 0 1 25.6-25.6 25.6 25.6 0 0 1 25.6 25.6v384.512a14.336 14.336 0 0 0 13.824 14.336h380.928a14.848 14.848 0 0 0 14.336-14.336V406.528a25.6 25.6 0 0 1 25.6-25.6 25.6 25.6 0 0 1 25.6 25.6v384.512a65.536 65.536 0 0 1-65.024 65.536z"}),i("path",{d:"M432.128 678.912a25.6 25.6 0 0 1-25.6-25.6v-220.16a25.6 25.6 0 0 1 25.6-25.6 26.112 26.112 0 0 1 25.6 25.6v220.16a25.6 25.6 0 0 1-25.6 25.6z"}),i("path",{d:"M593.408 678.912a25.6 25.6 0 0 1-25.6-25.6v-220.16a26.112 26.112 0 0 1 25.6-25.6 25.6 25.6 0 0 1 25.6 25.6v220.16a25.6 25.6 0 0 1-25.6 25.6z"}),i("path",{d:"M828.416 338.944H196.096a25.6 25.6 0 0 1-25.6-25.6 25.6 25.6 0 0 1 25.6-25.6h632.32a25.6 25.6 0 0 1 25.6 25.6 25.6 25.6 0 0 1-25.6 25.6z"})],-1)),i("span",BE,y(v(o)("promptBox.oneClickCleanAll")),1)],8,FE)):Ce("",!0),ne.value?(E(),D("button",{key:5,class:"translate-btn clear-disabled-btn",onClick:Yc,title:v(o)("promptBox.oneClickClearDisabled")},[R[34]||(R[34]=i("svg",{class:"utils-item-icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"1605",width:"24",height:"24"},[i("path",{d:"M716.8 338.944H307.2v-102.4a76.8 76.8 0 0 1 76.8-76.8h256a77.312 77.312 0 0 1 76.8 76.8z m-358.4-51.2h307.2v-51.2a26.112 26.112 0 0 0-25.6-25.6h-256a25.6 25.6 0 0 0-25.6 25.6zM702.464 856.576H321.536A65.024 65.024 0 0 1 256 791.04V406.528a25.6 25.6 0 0 1 25.6-25.6 25.6 25.6 0 0 1 25.6 25.6v384.512a14.336 14.336 0 0 0 13.824 14.336h380.928a14.848 14.848 0 0 0 14.336-14.336V406.528a25.6 25.6 0 0 1 25.6-25.6 25.6 25.6 0 0 1 25.6 25.6v384.512a65.536 65.536 0 0 1-65.024 65.536z"}),i("path",{d:"M432.128 678.912a25.6 25.6 0 0 1-25.6-25.6v-220.16a25.6 25.6 0 0 1 25.6-25.6 26.112 26.112 0 0 1 25.6 25.6v220.16a25.6 25.6 0 0 1-25.6 25.6z"}),i("path",{d:"M593.408 678.912a25.6 25.6 0 0 1-25.6-25.6v-220.16a26.112 26.112 0 0 1 25.6-25.6 25.6 25.6 0 0 1 25.6 25.6v220.16a25.6 25.6 0 0 1-25.6 25.6z"}),i("path",{d:"M828.416 338.944H196.096a25.6 25.6 0 0 1-25.6-25.6 25.6 25.6 0 0 1 25.6-25.6h632.32a25.6 25.6 0 0 1 25.6 25.6 25.6 25.6 0 0 1-25.6 25.6z"})],-1)),i("span",zE,y(v(o)("promptBox.oneClickClearDisabled")),1)],8,UE)):Ce("",!0)]),g.value.length>0?(E(),D("div",VE,[(E(!0),D(Ke,null,lt(g.value,(Me,je)=>(E(),D(Ke,{key:"tag-item-"+je},[i("div",{class:We(["token-item-box",{"token-item-box-disabled":Me.isHidden}]),draggable:!Me.isEditing,onDragstart:Je=>Al(je,Je),onDragover:Tt(Je=>Ml(je,Je),["prevent"]),onDrop:Je=>Il(je,Je),onDblclick:Je=>Dl(je),style:Bt({backgroundColor:Me.color})},[Me.text===`
|
||
`?(E(),D("div",jE,[i("span",{class:"token-symbol",title:v(o)("promptBox.newline")},"↵",8,HE)])):Me.text===" "?(E(),D("div",{key:1,class:"token-item tab-token",onMouseenter:Je=>io(je,Je),onMouseleave:Je=>jo()},[i("span",{class:"token-symbol",title:v(o)("promptBox.tab")},"→",8,qE)],40,GE)):Me.isLoraTag?(E(),D("div",{key:2,class:"lora-tag-icon",title:v(o)("promptBox.loraTag"),onMouseenter:Je=>io(je,Je),onMouseleave:Je=>jo()},[R[35]||(R[35]=i("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"15",height:"15"},[i("path",{d:"M20.5 11H19V7c0-1.1-.9-2-2-2h-4V3.5C13 2.12 11.88 1 10.5 1S8 2.12 8 3.5V5H4c-1.1 0-1.99.9-1.99 2v3.8H3.5c1.49 0 2.7 1.21 2.7 2.7s-1.21 2.7-2.7 2.7H2V20c0 1.1.9 2 2 2h3.8v-1.5c0-1.49 1.21-2.7 2.7-2.7 1.49 0 2.7 1.21 2.7 2.7V22H17c1.1 0 2-.9 2-2v-4h1.5c1.38 0 2.5-1.12 2.5-2.5S21.88 11 20.5 11z"})],-1)),i("span",KE,y(Me.text),1)],40,YE)):Me.text&&!Me.isLoraTag?(E(),D("div",{key:3,class:We(["token-item",{punctuation:Me.isPunctuation}]),onMouseenter:Je=>io(je,Je),onMouseleave:Je=>jo()},[!Me.isEditing||Me.isPunctuation?(E(),D("span",{key:0,onClick:Je=>!Me.isPunctuation&&Ee(je)},y(Me.text),9,XE)):Me.isPunctuation?Ce("",!0):(E(),D("input",{key:1,value:Me.text,onInput:Je=>Yi(je,Je),onBlur:Je=>Re(je),onKeyup:Rn(Je=>Re(je),["enter"]),ref_for:!0,ref:Je=>{Je&&(x[je]=Je)}},null,40,QE)),K.value?(E(),D("button",{key:2,class:"quick-delete-btn",onClick:Tt(Je=>cr(je),["stop"]),title:v(o)("promptBox.delete"),style:{"margin-left":"4px"}},R[36]||(R[36]=[i("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none"},[i("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z",fill:"#ff4d4f70"})],-1)]),8,ZE)):Ce("",!0)],42,JE)):Ce("",!0),Me.text!==`
|
||
`&&Me.text!==" "&&!Me.isLoraTag?(E(),D("div",e$,[qi(Me.text)?(E(),D("div",{key:0,onClick:Je=>Zi(Me.text,Me),class:"translate-button",title:v(o)("promptBox.translate")},R[37]||(R[37]=[i("svg",{viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",class:"token-item-icon",width:"24",height:"24"},[i("path",{d:"M677.676657 294.6142c19.165116 57.5433 44.715939 102.2992 89.431879 147.0551 38.322239-38.3622 63.873063-89.5118 83.038178-147.0551h-172.470057z m-421.56861 319.685h166.076358l-83.038179-223.7795-83.038179 223.7795z","p-id":"2419"}),i("path",{d:"M894.854661 0.504H128.353929C58.095158 0.504 0.607803 58.0473 0.607803 128.378v767.244c0 70.3307 57.487355 127.874 127.746126 127.874h766.500733c70.258771 0 127.746126-57.5433 127.746126-127.874V128.378c0-70.3307-51.101647-127.874-127.746126-127.874zM581.867062 825.2913c-12.771416 12.7874-25.550824 12.7874-38.322239 12.7874-6.3937 0-19.165116 0-25.550824-6.3937-6.3937-6.3937-12.779408 0-12.779408-6.3937s-6.385708-12.7874-12.771415-25.5748c-6.3937-12.7874-6.3937-19.1811-12.779408-31.9685l-25.542832-70.3307H230.557224L205.0064 767.748c-12.771416 25.5748-19.165116 44.7559-25.550824 57.5433-6.3937 12.7874-19.165116 12.7874-38.322239 12.7874-12.779408 0-25.550824-6.3937-38.330231-12.7874-12.771416-12.7874-19.157124-19.1811-19.157124-31.9685 0-6.3937 0-12.7874 6.385708-25.5748 6.3937-12.7874 6.3937-19.1811 12.771416-31.9685l140.525533-358.0472c6.3937-12.7874 6.3937-25.5748 12.779408-38.3622 6.385708-12.7874 12.771416-25.5748 19.157124-31.9685 6.3937-6.3937 12.779408-19.1811 25.550823-25.5748 12.779408-6.3937 25.550824-6.3937 38.330232-6.3937 12.771416 0 25.542832 0 38.322239 6.3937 12.771416 6.3937 19.165116 12.7874 25.550824 25.5748 6.385708 6.3937 12.771416 19.1811 19.157124 31.9685 6.3937 12.7874 12.779408 25.5748 19.165115 44.7559l140.525534 351.6535c12.771416 25.5748 19.165116 44.7559 19.165116 57.5433-6.3937 6.3937-12.779408 19.1811-19.165116 31.9685zM933.176901 575.937c-70.258771-25.5748-121.360418-57.5433-166.076358-95.9055-44.707947 44.7559-102.195302 76.7244-172.462065 95.9055l-19.157124-31.9685c70.258771-19.1811 127.746126-44.7559 172.462066-89.5118C703.22748 409.7008 664.905241 352.1575 652.125833 288.2205h-63.873063v-25.5748h172.470058c-12.7874-19.1811-25.558816-44.7559-38.330232-63.937l19.157124-6.3937c12.779408 19.1811 31.944524 44.7559 44.715939 70.3307h159.682658v31.9685h-63.873063c-19.157124 63.937-51.093655 121.4803-89.423887 159.8425 44.715939 38.3622 95.809594 70.3307 166.076358 89.5118l-25.550824 31.9685z","p-id":"2420"})],-1)]),8,t$)):Ce("",!0),i("span",n$,y(Me.translate?Me.translate:""),1)])):Ce("",!0)],46,WE),Me.text===`
|
||
`?(E(),D("div",o$)):Ce("",!0)],64))),128))])):Ce("",!0),he.value?(E(),D("div",{key:1,class:"tag-tips-box",style:Bt(te.value)},[i("div",a$,[i("p",{innerHTML:v(o)("promptBox.tagTips")},null,8,r$)])],4)):Ce("",!0),$e(i("div",{class:"token-controls",style:Bt($.value),onMouseenter:R[14]||(R[14]=Me=>k.value=!0),onMouseleave:Kr},[(xe=g.value[b.value])!=null&&xe.isLoraTag?Ce("",!0):(E(),D("div",i$,[$e(i("input",{type:"number","onUpdate:modelValue":R[4]||(R[4]=Me=>Ne.value=Me),step:"0.1",class:"weight-input",onChange:Ue},null,544),[[ze,Ne.value]]),i("span",s$,y(v(o)("promptBox.weight")),1)])),(Ie=g.value[b.value])!=null&&Ie.isLoraTag?(E(),D("div",l$,[i("div",u$,[$e(i("input",{type:"number","onUpdate:modelValue":R[5]||(R[5]=Me=>Ot.value=Me),step:"0.1",class:"weight-input",onChange:Ba},null,544),[[ze,Ot.value]]),i("span",c$,y(v(o)("promptBox.modelWeight")),1)]),i("div",d$,[$e(i("input",{type:"number","onUpdate:modelValue":R[6]||(R[6]=Me=>En.value=Me),step:"0.1",class:"weight-input",onChange:Ba},null,544),[[ze,En.value]]),i("span",p$,y(v(o)("promptBox.textWeight")),1)])])):Ce("",!0),i("button",{class:"favour-btn",onClick:R[7]||(R[7]=Me=>Hc(g.value[b.value])),title:v(o)("promptBox.favour")},R[38]||(R[38]=[i("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none"},[i("path",{d:"M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z",fill:"#FFD700"})],-1)]),8,f$),i("button",{onClick:ga,class:"delete-btn",title:v(o)("promptBox.delete")},R[39]||(R[39]=[i("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[i("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})],-1)]),8,g$),(Qe=g.value[b.value])!=null&&Qe.isLoraTag?Ce("",!0):(E(),D("div",m$,[i("div",h$,[R[40]||(R[40]=i("div",{class:"bracket-btn"}," () ",-1)),i("div",v$,[i("button",{class:"vertical-btn",onClick:R[8]||(R[8]=Me=>pa("(")),title:v(o)("promptBox.addBracket")}," + ",8,_$),i("button",{class:"vertical-btn",onClick:R[9]||(R[9]=Me=>Ua("(")),title:v(o)("promptBox.removeLayer")}," - ",8,y$)])]),i("div",b$,[R[41]||(R[41]=i("div",{class:"bracket-btn"}," [] ",-1)),i("div",w$,[i("button",{class:"vertical-btn",onClick:R[10]||(R[10]=Me=>pa("[")),title:v(o)("promptBox.addBracket")}," + ",8,x$),i("button",{class:"vertical-btn",onClick:R[11]||(R[11]=Me=>Ua("[")),title:v(o)("promptBox.removeLayer")}," - ",8,S$)])]),i("div",T$,[R[42]||(R[42]=i("div",{class:"bracket-btn"}," {} ",-1)),i("div",k$,[i("button",{class:"vertical-btn",onClick:R[12]||(R[12]=Me=>pa("{")),title:v(o)("promptBox.addBracket")}," + ",8,C$),i("button",{class:"vertical-btn",onClick:R[13]||(R[13]=Me=>Ua("{")),title:v(o)("promptBox.removeLayer")}," - ",8,E$)])])])),i("button",{class:"line-token-btn",onClick:ur,title:v(o)("promptBox.addLineToken"),style:{"margin-left":"8px"}},R[43]||(R[43]=[i("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none"},[i("path",{d:"M5 19h14v-2H5v2zm0-7h14v-2H5v2zm0-7v2h14V5H5z",fill:"#888"}),i("path",{d:"M7 17v-2h2v2H7zm0-7V8h2v2H7zm0-7V3h2v2H7z",fill:"#4285f4"})],-1)]),8,$$)],36),[[ki,b.value!==null&&g.value[b.value]]]),i("div",L$,[$e(i("div",{class:"token-controls",style:Bt(Z.value),onMouseenter:R[15]||(R[15]=Me=>k.value=!0),onMouseleave:Kr},[i("div",A$,[i("div",M$,"选中 "+y(re.value.length)+" 个标签",1),i("div",{class:"weilin-comfyui-selection-actions-buttons"},[i("button",{class:"delete-btn copy-btn",onClick:wl,title:"复制"},R[44]||(R[44]=[i("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[i("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z"})],-1)])),i("button",{class:"delete-btn",onClick:xl,title:"禁用"},R[45]||(R[45]=[i("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[i("circle",{cx:"12",cy:"12",r:"10",fill:"none",stroke:"#ff4d4f","stroke-width":"2"}),i("path",{d:"M8.5 8.5l7 7",stroke:"#ff4d4f","stroke-width":"2","stroke-linecap":"round"})],-1)])),i("button",{class:"delete-btn enable-btn",onClick:Ji,title:"启用"},R[46]||(R[46]=[i("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[i("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"})],-1)])),i("button",{class:"delete-btn",onClick:Nc,title:"删除"},R[47]||(R[47]=[i("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[i("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})],-1)]))])])],36),[[ki,pe.value]]),i("div",{class:"tag-manager-header",onClick:Ki},[i("div",I$,[R[48]||(R[48]=i("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",class:"tag-icon",width:"24",height:"24"},[i("path",{d:"M129 128h350v80H209v224h270v80H129V128zM129 895V576h768v319H129z m80-239v159h608V656H209zM730 356c19.882 0 36-16.118 36-36s-16.118-36-36-36-36 16.118-36 36 16.118 36 36 36z"}),i("path",{d:"M578.517 214.386a32.002 32.002 0 0 0-16.01 27.731l0.058 155.918a31.998 31.998 0 0 0 16 27.701l135.156 78.033a32.002 32.002 0 0 0 31.99 0.006l135.058-77.909a32.002 32.002 0 0 0 16.01-27.731l-0.058-155.918a32 32 0 0 0-16-27.701l-135.157-78.033a31.998 31.998 0 0 0-31.989-0.005l-135.058 77.908z m67.002 58.058l84.033-48.591 84.181 48.715 0.034 95.24-84.034 48.591-84.18-48.714-0.034-95.241z"})],-1)),i("span",D$,y(v(o)("controls.loraManager")),1)]),i("div",O$,[(E(),D("svg",{class:We(["collapse-icon",{"is-collapsed":!Xr.value}]),viewBox:"0 0 24 24"},R[49]||(R[49]=[i("path",{d:"M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z"},null,-1)]),2))])]),$e(i("div",R$,[it(xh,{loraManager:"prompt_inner"})],512),[[ki,Xr.value]])]),i("div",P$,[i("div",{class:"tag-manager-header",onClick:pr},[i("div",N$,[R[50]||(R[50]=i("svg",{class:"tag-icon",viewBox:"0 0 24 24"},[i("path",{d:"M21.41 11.58l-9-9C12.05 2.22 11.55 2 11 2H4c-1.1 0-2 .9-2 2v7c0 .55.22 1.05.59 1.42l9 9c.36.36.86.58 1.41.58.55 0 1.05-.22 1.41-.59l7-7c.37-.36.59-.86.59-1.41 0-.55-.23-1.06-.59-1.42zM5.5 7C4.67 7 4 6.33 4 5.5S4.67 4 5.5 4 7 4.67 7 5.5 6.33 7 5.5 7z"})],-1)),i("span",F$,y(v(o)("controls.tagManager")),1)]),i("div",B$,[(E(),D("svg",{class:We(["collapse-icon",{"is-collapsed":!Un.value}]),viewBox:"0 0 24 24"},R[51]||(R[51]=[i("path",{d:"M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z"},null,-1)]),2))])]),$e(i("div",U$,[it(sh)],512),[[ki,Un.value]])])],6)]),it(rC,{ref_key:"randomSettingItem",ref:n},null,512),it(LC,{ref_key:"favourItemRef",ref:os},null,512)],64)}}},[["__scopeId","data-v-ce9610cb"]]),G$={class:"container"},q$={class:"tab-container"},Y$={key:0},K$={class:"search-container"},J$=["placeholder"],X$=["title"],Q$=["title","disabled"],Z$=["title"],eL={class:"history-list"},tL={class:"action-buttons"},nL=["onClick","title"],oL=["onClick","title"],aL=["onClick","title"],rL=["value"],iL={key:1},sL={class:"search-container"},lL=["placeholder"],uL=["title"],cL=["title"],dL=["title","disabled"],pL=["title"],fL={class:"history-list"},gL={key:0,class:"favor-name"},mL={class:"action-buttons"},hL=["onClick","title"],vL=["onClick","title"],_L=["onClick","title"],yL=["value"],bL={key:2,class:"weilin-tools-dialog-overlay"},wL={class:"weilin-tools-dialog-header"},xL={class:"weilin-tools-dialog-body"},SL={class:"form-group"},TL=["placeholder"],kL={class:"form-group"},CL=["placeholder"],EL={class:"form-group"},$L={class:"color-picker"},LL={class:"color-controls"},AL={class:"alpha-control"},ML={class:"alpha-value"},IL={class:"weilin-tools-dialog-footer"},DL={key:3,class:"weilin-tools-dialog-overlay"},OL={class:"weilin-tools-dialog-header"},RL={class:"weilin-tools-dialog-body"},PL={class:"confirm-message"},NL={class:"weilin-tools-dialog-footer"},FL=qt({__name:"history_index",setup(e){const{t}=Gt(),n=S(""),o=S([]),a=S([]),r=S([]),s=S([]),u=S("history"),p=S([]),m=S(!1),f=S(!1),g=S(!1),x=S({hex:"rgba(255, 123, 2, .4)",alpha:100}),b=S({name:"",tag:"",color:"rgba(255, 123, 2, .4)"}),k=S(!1),$=S(0),O=J=>JSON.parse(J).prompt,I=J=>({hex:"#FFFFFF",alpha:0}),V=J=>{const{hex:Y,alpha:L}=I();x.value={hex:Y,alpha:L}},me=()=>{g.value=!1,b.value={id:"",name:"",tag:"",backgroundColor:"transparent"},V(),m.value=!0},M=J=>{const Y=J.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*([0-9.]+))?\)/);if(Y){const[,L,C,G,de]=Y,Se=`#${((1<<24)+(parseInt(L,10)<<16)+(parseInt(C,10)<<8)+parseInt(G,10)).toString(16).slice(1)}`,Le=de?Math.round(parseFloat(de)*100):100;return{hex:Se,alpha:Le}}return{hex:"#FF7B02",alpha:50}},z=J=>{g.value=!0,b.value={...J},x.value=M(J.color),m.value=!0},ce=()=>{const J=Q(x.value.hex,x.value.alpha);b.value.color=J},P=()=>{m.value=!1,b.value={name:"",tag:"",color:"rgba(255, 123, 2, .4)"},g.value=!1},le=S(""),ie=S(null),Oe=Ht(()=>{if(!ie.value)return"";switch(le.value){case"history":return t("history.deleteHistoryConfirm",{name:ie.value.tag});case"favorite":return t("history.deleteFavoriteConfirm",{name:ie.value.tag});case"deleteSelected":return t("history.confirmDeleteSelected");case"deleteSelectedFavorite":return t("history.confirmDeleteSelected");default:return""}}),Ae=J=>{le.value="history",ie.value=J,f.value=!0},fe=J=>{le.value="favorite",ie.value=J,f.value=!0},_e=()=>{k.value=!1,$.value=0,le.value="deleteSelected",ie.value=p.value,f.value=!0},ae=()=>{k.value=!1,$.value=0,le.value="deleteSelectedFavorite",ie.value=p.value,f.value=!0},W=()=>{try{switch(le.value){case"history":Lo.deleteHistory(ie.value.id_index).then(()=>{pe(),ue({type:"success",str:"message.deleteSuccess"})}).catch(()=>{ue({type:"warn",str:"message.networkError"})});break;case"favorite":Lo.deleteFavorite(ie.value.id_index).then(()=>{Z(),window.postMessage({type:"weilin_prompt_ui_refresh_all_data"},"*"),ue({type:"success",str:"message.deleteSuccess"})}).catch(()=>{ue({type:"warn",str:"message.networkError"})});break;case"deleteSelected":Lo.batchDeleteHistory(p.value).then(()=>{pe(),ue({type:"success",str:"message.deleteSuccess"})}).catch(()=>{ue({type:"warn",str:"message.networkError"})});break;case"deleteSelectedFavorite":Lo.batchDeleteFavorite(ie.value).then(()=>{Z(),window.postMessage({type:"weilin_prompt_ui_refresh_all_data"},"*"),ue({type:"success",str:"message.deleteSuccess"})}).catch(()=>{ue({type:"warn",str:"message.networkError"})});break}X()}catch{ue({type:"warn",str:"message.networkError"})}},re=J=>{J.target.checked?u.value==="history"?p.value=o.value.map(Y=>Y.id_index):p.value=r.value.map(Y=>Y.id_index):p.value=[]},Q=(J,Y)=>{const L=parseInt(J.slice(1,3),16),C=parseInt(J.slice(3,5),16),G=parseInt(J.slice(5,7),16);return`rgba(${L}, ${C}, ${G}, ${Y/100})`},X=()=>{f.value=!1,le.value="",ie.value=null},ye=()=>{if(!b.value.tag){ue({type:"warn",str:"history.dialog.tag_placeholder"});return}g.value?Lo.editFavorite({id_index:b.value.id_index,name:b.value.name,tag:b.value.tag,color:b.value.color}).then(()=>{Z(),window.postMessage({type:"weilin_prompt_ui_refresh_all_data"},"*"),ue({type:"success",str:"message.editSuccess"})}).catch(()=>{ue({type:"warn",str:"message.networkError"})}):Lo.addFavorite({name:b.value.name,tag:b.value.tag,color:b.value.color}).then(()=>{Z(),window.postMessage({type:"weilin_prompt_ui_refresh_all_data"},"*"),ue({type:"success",str:"message.addSuccess"})}).catch(()=>{ue({type:"warn",str:"message.networkError"})}),P()},pe=()=>{Lo.getHistory({}).then(J=>{o.value=J.data,a.value=o.value}).catch(()=>{ue({type:"warn",str:"message.networkError"})})},Z=()=>{Lo.getFavorite().then(J=>{r.value=J.data,s.value=r.value}).catch(()=>{ue({type:"warn",str:"message.networkError"})})},oe=()=>{a.value=o.value.filter(J=>J.tag.includes(n.value))},be=()=>{s.value=r.value.filter(J=>J.tag.includes(n.value))},ve=()=>{pe()},he=()=>{Z()},te=J=>{Lo.addFavorite({tag:J.tag}).then(Y=>{Y.code===200?(window.postMessage({type:"weilin_prompt_ui_refresh_all_data"},"*"),Z(),ue({type:"success",str:"message.addFavoriteSuccess"})):ue({type:"success",str:"message.addFavoriteIsExist"})}).catch(()=>{ue({type:"warn",str:"message.networkError"})})},K=J=>{window.postMessage({type:"weilin_prompt_ui_user_history_tag",tagText:J.tag},"*")},ee=()=>{p.value=[],k.value=!0},F=()=>{p.value=[],k.value=!1,$.value=0};return Ut(()=>{pe(),Z()}),(J,Y)=>(E(),D("div",G$,[i("h1",null,y(u.value==="history"?v(t)("history.title"):v(t)("history.favorites")),1),i("div",q$,[i("button",{class:We([{active:u.value==="history"},"tab-button"]),onClick:Y[0]||(Y[0]=L=>u.value="history")},y(v(t)("history.history")),3),i("button",{class:We([{active:u.value==="favorites"},"tab-button"]),onClick:Y[1]||(Y[1]=L=>u.value="favorites")},y(v(t)("history.favorites")),3)]),u.value==="history"?(E(),D("div",Y$,[i("div",K$,[i("button",{class:"refresh-btn",onClick:ve},Y[14]||(Y[14]=[i("svg",{viewBox:"0 0 24 24",width:"16",height:"16",class:"refresh-icon"},[i("path",{d:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z"})],-1)])),$e(i("input",{type:"text","onUpdate:modelValue":Y[2]||(Y[2]=L=>n.value=L),placeholder:v(t)("history.search_placeholder"),onInput:oe,class:"search-input"},null,40,J$),[[ze,n.value]]),k.value?$e((E(),D("input",{key:0,type:"checkbox","onUpdate:modelValue":Y[3]||(Y[3]=L=>$.value=L),value:1,class:"tag-checkbox",onChange:re},null,544)),[[nn,$.value]]):Ce("",!0),k.value?Ce("",!0):(E(),D("button",{key:1,class:"bulk-delete-btn",onClick:ee,title:v(t)("history.bulk_delete")},Y[15]||(Y[15]=[i("svg",{viewBox:"0 0 1024 1024",width:"16",height:"16",class:"delete-favorite-icon"},[i("path",{d:"M907.618072 232.742353 744.713682 232.742353 744.713682 116.382952c0-12.852708-10.419786-23.272495-23.272495-23.272495L302.556765 93.110457c-12.852708 0-23.272495 10.418762-23.272495 23.272495l0 116.360425L116.380904 232.743377c-12.852708 0-23.272495 10.419786-23.272495 23.272495s10.418762 23.272495 23.272495 23.272495l791.237168 0c12.852708 0 23.272495-10.419786 23.272495-23.272495S920.469756 232.742353 907.618072 232.742353zM325.829259 139.654423l372.340458 0 0 93.08793L325.829259 232.742353 325.829259 139.654423zM791.257647 372.362985c-12.852708 0-23.272495 10.418762-23.272495 23.272495l0 488.712146L256.012799 884.347625 256.012799 395.635479c0-12.852708-10.418762-23.272495-23.272495-23.272495s-23.272495 10.418762-23.272495 23.272495l0 511.983617c0 12.852708 10.418762 23.272495 23.272495 23.272495l558.516318 0c12.852708 0 23.272495-10.419786 23.272495-23.272495L814.529118 395.635479C814.529118 382.782771 804.110355 372.362985 791.257647 372.362985zM442.189684 767.987201l0-372.351721c0-12.852708-10.418762-23.272495-23.272495-23.272495s-23.272495 10.418762-23.272495 23.272495l0 372.351721c0 12.852708 10.418762 23.272495 23.272495 23.272495S442.189684 780.839909 442.189684 767.987201zM628.353257 767.987201l0-372.351721c0-12.852708-10.419786-23.272495-23.272495-23.272495s-23.272495 10.418762-23.272495 23.272495l0 372.351721c0 12.852708 10.419786 23.272495 23.272495 23.272495S628.353257 780.839909 628.353257 767.987201z"})],-1)]),8,X$)),k.value?(E(),D("button",{key:2,class:"bulk-delete-btn",onClick:_e,title:v(t)("history.sure_delete"),disabled:p.value.length===0},Y[16]||(Y[16]=[i("svg",{viewBox:"0 0 1024 1024",width:"16",height:"16",class:"delete-favorite-icon"},[i("path",{d:"M392.533333 806.4L85.333333 503.466667l59.733334-59.733334 247.466666 247.466667L866.133333 213.333333l59.733334 59.733334L392.533333 806.4z"})],-1)]),8,Q$)):Ce("",!0),k.value?(E(),D("button",{key:3,class:"bulk-delete-btn",onClick:F,title:v(t)("history.cancel_delete")},Y[17]||(Y[17]=[i("svg",{viewBox:"0 0 1024 1024",width:"16",height:"16",class:"delete-favorite-icon"},[i("path",{d:"M794.8 794.8c-14 14-36.9 14-50.9 0L229.2 280.1c-14-14-14-36.9 0-50.9s36.9-14 50.9 0L794.9 744c13.9 13.9 13.9 36.8-0.1 50.8z"}),i("path",{d:"M794.8 229.2c14 14 14 36.9 0 50.9L280.1 794.8c-14 14-36.9 14-50.9 0s-14-36.9 0-50.9L744 229.1c13.9-13.9 36.8-13.9 50.8 0.1z"})],-1)]),8,Z$)):Ce("",!0)]),i("ul",eL,[(E(!0),D(Ke,null,lt(a.value,L=>(E(),D("li",{key:L.id_index,class:"history-item"},[i("span",null,y(O(L.tag)),1),i("div",tL,[i("button",{onClick:C=>te(L),class:"favorite-btn",title:v(t)("history.add_to_favorites")},Y[18]||(Y[18]=[i("svg",{viewBox:"0 0 24 24",width:"24",height:"24",class:"favorite-icon"},[i("path",{d:"M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z"})],-1)]),8,nL),i("button",{onClick:C=>Ae(L),class:"delete-favorite-btn",title:v(t)("history.delete_history")},Y[19]||(Y[19]=[i("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24",class:"delete-favorite-icon"},[i("path",{d:"M907.618072 232.742353 744.713682 232.742353 744.713682 116.382952c0-12.852708-10.419786-23.272495-23.272495-23.272495L302.556765 93.110457c-12.852708 0-23.272495 10.418762-23.272495 23.272495l0 116.360425L116.380904 232.743377c-12.852708 0-23.272495 10.419786-23.272495 23.272495s10.418762 23.272495 23.272495 23.272495l791.237168 0c12.852708 0 23.272495-10.419786 23.272495-23.272495S920.469756 232.742353 907.618072 232.742353zM325.829259 139.654423l372.340458 0 0 93.08793L325.829259 232.742353 325.829259 139.654423zM791.257647 372.362985c-12.852708 0-23.272495 10.418762-23.272495 23.272495l0 488.712146L256.012799 884.347625 256.012799 395.635479c0-12.852708-10.418762-23.272495-23.272495-23.272495s-23.272495 10.418762-23.272495 23.272495l0 511.983617c0 12.852708 10.418762 23.272495 23.272495 23.272495l558.516318 0c12.852708 0 23.272495-10.419786 23.272495-23.272495L814.529118 395.635479C814.529118 382.782771 804.110355 372.362985 791.257647 372.362985zM442.189684 767.987201l0-372.351721c0-12.852708-10.418762-23.272495-23.272495-23.272495s-23.272495 10.418762-23.272495 23.272495l0 372.351721c0 12.852708 10.418762 23.272495 23.272495 23.272495S442.189684 780.839909 442.189684 767.987201zM628.353257 767.987201l0-372.351721c0-12.852708-10.419786-23.272495-23.272495-23.272495s-23.272495 10.418762-23.272495 23.272495l0 372.351721c0 12.852708 10.419786 23.272495 23.272495 23.272495S628.353257 780.839909 628.353257 767.987201z"})],-1)]),8,oL),i("button",{onClick:C=>K(L),class:"use-btn",title:v(t)("history.use_item")},Y[20]||(Y[20]=[i("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24",class:"use-icon"},[i("path",{d:"M915.515273 142.819385 98.213046 458.199122c-46.058539 17.772838-44.90475 43.601756 2.348455 57.622994l197.477685 58.594874 80.292024 238.91085c10.51184 31.277988 37.972822 37.873693 61.462483 14.603752l103.584447-102.611545 204.475018 149.840224c26.565749 19.467242 53.878547 9.222132 61.049613-23.090076l149.210699-672.34491C965.264096 147.505054 946.218922 130.971848 915.515273 142.819385zM791.141174 294.834331l-348.61988 310.610267c-6.268679 5.58499-11.941557 16.652774-12.812263 24.846818l-15.390659 144.697741c-1.728128 16.24808-7.330491 16.918483-12.497501 1.344894l-67.457277-203.338603c-2.638691-7.954906 0.975968-17.705389 8.022355-21.931178l442.114555-265.181253C812.67481 268.984974 815.674251 272.975713 791.141174 294.834331z","p-id":"18085"})],-1)]),8,aL),k.value?$e((E(),D("input",{key:0,type:"checkbox","onUpdate:modelValue":Y[4]||(Y[4]=C=>p.value=C),value:L.id_index,class:"tag-checkbox"},null,8,rL)),[[nn,p.value]]):Ce("",!0)])]))),128))])])):(E(),D("div",iL,[i("div",sL,[i("button",{class:"refresh-btn",onClick:he},Y[21]||(Y[21]=[i("svg",{viewBox:"0 0 24 24",width:"16",height:"16",class:"refresh-icon"},[i("path",{d:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z"})],-1)])),$e(i("input",{type:"text","onUpdate:modelValue":Y[5]||(Y[5]=L=>n.value=L),placeholder:v(t)("history.search_placeholder"),onInput:be,class:"search-input"},null,40,lL),[[ze,n.value]]),k.value?$e((E(),D("input",{key:0,type:"checkbox","onUpdate:modelValue":Y[6]||(Y[6]=L=>$.value=L),value:1,class:"tag-checkbox",onChange:re},null,544)),[[nn,$.value]]):Ce("",!0),i("button",{class:"add-his-btn",onClick:me,title:v(t)("history.add_new")},Y[22]||(Y[22]=[i("svg",{viewBox:"0 0 24 24",width:"16",height:"16",class:"add-icon"},[i("path",{d:"M19 11h-6V5c0-.55-.45-1-1-1s-1 .45-1 1v6H5c-.55 0-1 .45-1 1s.45 1 1 1h6v6c0 .55.45 1 1 1s1-.45 1-1v-6h6c.55 0 1-.45 1-1s-.45-1-1-1z"})],-1)]),8,uL),k.value?Ce("",!0):(E(),D("button",{key:1,class:"bulk-delete-btn",onClick:ee,title:v(t)("history.bulk_delete")},Y[23]||(Y[23]=[i("svg",{viewBox:"0 0 1024 1024",width:"16",height:"16",class:"delete-favorite-icon"},[i("path",{d:"M907.618072 232.742353 744.713682 232.742353 744.713682 116.382952c0-12.852708-10.419786-23.272495-23.272495-23.272495L302.556765 93.110457c-12.852708 0-23.272495 10.418762-23.272495 23.272495l0 116.360425L116.380904 232.743377c-12.852708 0-23.272495 10.419786-23.272495 23.272495s10.418762 23.272495 23.272495 23.272495l791.237168 0c12.852708 0 23.272495-10.419786 23.272495-23.272495S920.469756 232.742353 907.618072 232.742353zM325.829259 139.654423l372.340458 0 0 93.08793L325.829259 232.742353 325.829259 139.654423zM791.257647 372.362985c-12.852708 0-23.272495 10.418762-23.272495 23.272495l0 488.712146L256.012799 884.347625 256.012799 395.635479c0-12.852708-10.418762-23.272495-23.272495-23.272495s-23.272495 10.418762-23.272495 23.272495l0 511.983617c0 12.852708 10.418762 23.272495 23.272495 23.272495l558.516318 0c12.852708 0 23.272495-10.419786 23.272495-23.272495L814.529118 395.635479C814.529118 382.782771 804.110355 372.362985 791.257647 372.362985zM442.189684 767.987201l0-372.351721c0-12.852708-10.418762-23.272495-23.272495-23.272495s-23.272495 10.418762-23.272495 23.272495l0 372.351721c0 12.852708 10.418762 23.272495 23.272495 23.272495S442.189684 780.839909 442.189684 767.987201zM628.353257 767.987201l0-372.351721c0-12.852708-10.419786-23.272495-23.272495-23.272495s-23.272495 10.418762-23.272495 23.272495l0 372.351721c0 12.852708 10.419786 23.272495 23.272495 23.272495S628.353257 780.839909 628.353257 767.987201z"})],-1)]),8,cL)),k.value?(E(),D("button",{key:2,class:"bulk-delete-btn",onClick:ae,title:v(t)("history.sure_delete"),disabled:p.value.length===0},Y[24]||(Y[24]=[i("svg",{viewBox:"0 0 1024 1024",width:"16",height:"16",class:"delete-favorite-icon"},[i("path",{d:"M392.533333 806.4L85.333333 503.466667l59.733334-59.733334 247.466666 247.466667L866.133333 213.333333l59.733334 59.733334L392.533333 806.4z"})],-1)]),8,dL)):Ce("",!0),k.value?(E(),D("button",{key:3,class:"bulk-delete-btn",onClick:F,title:v(t)("history.cancel_delete")},Y[25]||(Y[25]=[i("svg",{viewBox:"0 0 1024 1024",width:"16",height:"16",class:"delete-favorite-icon"},[i("path",{d:"M794.8 794.8c-14 14-36.9 14-50.9 0L229.2 280.1c-14-14-14-36.9 0-50.9s36.9-14 50.9 0L794.9 744c13.9 13.9 13.9 36.8-0.1 50.8z"}),i("path",{d:"M794.8 229.2c14 14 14 36.9 0 50.9L280.1 794.8c-14 14-36.9 14-50.9 0s-14-36.9 0-50.9L744 229.1c13.9-13.9 36.8-13.9 50.8 0.1z"})],-1)]),8,pL)):Ce("",!0)]),i("ul",fL,[(E(!0),D(Ke,null,lt(s.value,L=>(E(),D("li",{key:L.id_index,class:"history-item"},[i("div",{class:"favor-name-box",style:Bt({backgroundColor:L.color||"transparent"})},[L.name.length>0?(E(),D("span",gL,y(L.name),1)):Ce("",!0)],4),i("span",null,y(O(L.tag)),1),i("div",mL,[i("button",{onClick:C=>z(L),class:"delete-favorite-btn",title:v(t)("history.edit_favorite")},Y[26]||(Y[26]=[i("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24",class:"delete-favorite-icon"},[i("path",{d:"M200.59 626.48v129.5h129.5l381.93-381.93-129.5-129.5-381.93 381.93z m611.56-352.57c13.45-13.41 13.48-35.18 0.07-48.62l-0.07-0.07-80.81-80.81c-13.41-13.45-35.18-13.48-48.62-0.07l-0.07 0.07-63.19 63.19 129.5 129.5 63.19-63.19zM131.52 824.96h759.71c23.02 0 34.53 11.51 34.53 34.53 0 23.02-11.51 34.53-34.53 34.53H131.52c-23.02 0-34.53-11.51-34.53-34.53 0-23.02 11.51-34.53 34.53-34.53z","p-id":"2346"})],-1)]),8,hL),i("button",{onClick:C=>fe(L),class:"delete-favorite-btn",title:v(t)("history.delete_favorite")},Y[27]||(Y[27]=[i("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24",class:"delete-favorite-icon"},[i("path",{d:"M907.618072 232.742353 744.713682 232.742353 744.713682 116.382952c0-12.852708-10.419786-23.272495-23.272495-23.272495L302.556765 93.110457c-12.852708 0-23.272495 10.418762-23.272495 23.272495l0 116.360425L116.380904 232.743377c-12.852708 0-23.272495 10.419786-23.272495 23.272495s10.418762 23.272495 23.272495 23.272495l791.237168 0c12.852708 0 23.272495-10.419786 23.272495-23.272495S920.469756 232.742353 907.618072 232.742353zM325.829259 139.654423l372.340458 0 0 93.08793L325.829259 232.742353 325.829259 139.654423zM791.257647 372.362985c-12.852708 0-23.272495 10.418762-23.272495 23.272495l0 488.712146L256.012799 884.347625 256.012799 395.635479c0-12.852708-10.418762-23.272495-23.272495-23.272495s-23.272495 10.418762-23.272495 23.272495l0 511.983617c0 12.852708 10.418762 23.272495 23.272495 23.272495l558.516318 0c12.852708 0 23.272495-10.419786 23.272495-23.272495L814.529118 395.635479C814.529118 382.782771 804.110355 372.362985 791.257647 372.362985zM442.189684 767.987201l0-372.351721c0-12.852708-10.418762-23.272495-23.272495-23.272495s-23.272495 10.418762-23.272495 23.272495l0 372.351721c0 12.852708 10.418762 23.272495 23.272495 23.272495S442.189684 780.839909 442.189684 767.987201zM628.353257 767.987201l0-372.351721c0-12.852708-10.419786-23.272495-23.272495-23.272495s-23.272495 10.418762-23.272495 23.272495l0 372.351721c0 12.852708 10.419786 23.272495 23.272495 23.272495S628.353257 780.839909 628.353257 767.987201z"})],-1)]),8,vL),i("button",{onClick:C=>K(L),class:"use-btn",title:v(t)("history.use_favorite")},Y[28]||(Y[28]=[i("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24",class:"use-icon"},[i("path",{d:"M915.515273 142.819385 98.213046 458.199122c-46.058539 17.772838-44.90475 43.601756 2.348455 57.622994l197.477685 58.594874 80.292024 238.91085c10.51184 31.277988 37.972822 37.873693 61.462483 14.603752l103.584447-102.611545 204.475018 149.840224c26.565749 19.467242 53.878547 9.222132 61.049613-23.090076l149.210699-672.34491C965.264096 147.505054 946.218922 130.971848 915.515273 142.819385zM791.141174 294.834331l-348.61988 310.610267c-6.268679 5.58499-11.941557 16.652774-12.812263 24.846818l-15.390659 144.697741c-1.728128 16.24808-7.330491 16.918483-12.497501 1.344894l-67.457277-203.338603c-2.638691-7.954906 0.975968-17.705389 8.022355-21.931178l442.114555-265.181253C812.67481 268.984974 815.674251 272.975713 791.141174 294.834331z","p-id":"18085"})],-1)]),8,_L),k.value?$e((E(),D("input",{key:0,type:"checkbox","onUpdate:modelValue":Y[7]||(Y[7]=C=>p.value=C),value:L.id_index,class:"tag-checkbox"},null,8,yL)),[[nn,p.value]]):Ce("",!0)])]))),128))])])),m.value?(E(),D("div",bL,[i("div",{class:"weilin-tools-dialog-content",onMousedown:Y[12]||(Y[12]=Tt(()=>{},["stop"]))},[i("div",wL,[i("h2",null,y(g.value?v(t)("history.dialog.edit_tag"):v(t)("history.dialog.add_tag")),1),i("button",{class:"close-btn",onClick:P},"×")]),i("div",xL,[i("div",SL,[i("label",null,y(v(t)("history.dialog.name")),1),$e(i("input",{type:"text","onUpdate:modelValue":Y[8]||(Y[8]=L=>b.value.name=L),placeholder:v(t)("history.dialog.name_placeholder")},null,8,TL),[[ze,b.value.name]])]),i("div",kL,[i("label",null,y(v(t)("history.dialog.tag")),1),$e(i("textarea",{"onUpdate:modelValue":Y[9]||(Y[9]=L=>b.value.tag=L),placeholder:v(t)("history.dialog.tag_placeholder"),rows:"4"}," ",8,CL),[[ze,b.value.tag]])]),i("div",EL,[i("label",null,y(v(t)("history.dialog.background_color")),1),i("div",$L,[i("div",{class:"color-preview",style:Bt({backgroundColor:J.previewColor})},null,4),i("div",LL,[$e(i("input",{type:"color","onUpdate:modelValue":Y[10]||(Y[10]=L=>x.value.hex=L),onInput:ce,class:"color-input"},null,544),[[ze,x.value.hex]]),i("div",AL,[$e(i("input",{type:"range","onUpdate:modelValue":Y[11]||(Y[11]=L=>x.value.alpha=L),min:"0",max:"100",onInput:ce,class:"alpha-slider"},null,544),[[ze,x.value.alpha,void 0,{number:!0}]]),i("span",ML,y(x.value.alpha)+"%",1)])])])])]),i("div",IL,[i("button",{class:"cancel-btn",onClick:P},y(v(t)("common.cancel")),1),i("button",{class:"confirm-btn",onClick:ye},y(v(t)("common.confirm")),1)])],32)])):Ce("",!0),f.value?(E(),D("div",DL,[i("div",{class:"weilin-tools-dialog-content confirm-weilin-tools-dialog",onMousedown:Y[13]||(Y[13]=Tt(()=>{},["stop"]))},[i("div",OL,[i("h2",null,y(v(t)("common.confirmDelete")),1),i("button",{class:"close-btn",onClick:X},"×")]),i("div",RL,[i("p",PL,y(Oe.value),1)]),i("div",NL,[i("button",{class:"cancel-btn",onClick:X},y(v(t)("common.cancel")),1),i("button",{class:"delete-btn",onClick:W},y(v(t)("common.delete")),1)])],32)])):Ce("",!0)]))}},[["__scopeId","data-v-6d1ae298"]]),BL={key:0,class:"drop-zone"},UL={key:1,class:"preview-container"},zL=["srcdoc"],VL={class:"action-buttons"},Eh="weilin_tools_",WL=qt({__name:"tranToWeb",emits:["close","update"],setup(e,{expose:t,emit:n}){const{t:o}=Gt(),a=S(!1),r=S(""),s=S(null),u={tranToWeb:{visible:!1,position:{x:150,y:150},size:{width:800,height:600}}},m=S((()=>{try{const le=localStorage.getItem(`${Eh}tranToWebState`);if(le){const ie=JSON.parse(le),Oe={...u};return ie.tranToWeb&&(Oe.tranToWeb={...u.tranToWeb,...ie.tranToWeb}),Oe}}catch(le){console.error("Error loading window states:",le)}return{...u}})());At(m,le=>{try{localStorage.setItem(`${Eh}tranToWebState`,JSON.stringify(le))}catch(ie){console.error("Error saving window states:",ie)}},{deep:!0}),Ut(()=>{nt.registerWindow("tranToWeb")}),so(()=>{nt.unregisterWindow("tranToWeb")});const f=()=>{a.value=!1},g=(le,ie)=>{m.value[le]&&(m.value[le].position={...ie})},x=(le,ie)=>{m.value[le]&&(m.value[le].size={...ie})},b=()=>{a.value=!0,nt.setActiveWindow("tranToWeb")},k=le=>{le.dataTransfer.dropEffect="copy"},$=le=>{const ie=le.dataTransfer.files[0];ie&&ie.type.startsWith("image/")&&I(ie)},O=le=>{const ie=le.clipboardData.items;for(let Oe=0;Oe<ie.length;Oe++)if(ie[Oe].type.startsWith("image/")){const Ae=ie[Oe].getAsFile();I(Ae);break}},I=le=>{const ie=new FileReader;ie.onload=Oe=>{const Ae=Oe.target.result,fe=btoa(Ae);s.value=fe,V()},ie.readAsDataURL(le)},V=()=>{r.value=`
|
||
<!DOCTYPE html>
|
||
<html>
|
||
<head>
|
||
<title>WeiLin Comfyui Tools - Image to HTML</title>
|
||
<style>
|
||
body { margin: 0; padding: 0; }
|
||
img { max-width: 100%; height: auto; }
|
||
</style>
|
||
<script>
|
||
window.onload = function() {
|
||
// 解密图片数据
|
||
try {
|
||
const encryptedData = "${s.value}";
|
||
const originalData = atob(encryptedData);
|
||
document.getElementById('decrypted-img').src = originalData;
|
||
document.getElementById('decrypted-img').style.display = 'block';
|
||
} catch(e) {
|
||
console.error('解密失败:', e);
|
||
document.body.innerHTML = '<p>图片解密失败</p>';
|
||
}
|
||
};
|
||
<\/script>
|
||
</head>
|
||
<body>
|
||
<img id="decrypted-img" style="display:none;" />
|
||
</body>
|
||
</html>
|
||
`},me=()=>{const le=new Blob([r.value],{type:"text/html"}),ie=URL.createObjectURL(le),Oe=document.createElement("a");Oe.href=ie,Oe.download="image-to-html.html",document.body.appendChild(Oe),Oe.click(),document.body.removeChild(Oe),URL.revokeObjectURL(ie)},M=()=>{r.value="",s.value=null},z=S(null),ce=()=>{r.value||z.value.click()},P=le=>{const ie=le.target.files[0];ie&&ie.type.startsWith("image/")&&I(ie)};return t({open:b}),(le,ie)=>a.value?(E(),Jt(co,{key:0,title:v(o)("utils.tranToWeb"),position:m.value.tranToWeb.position,size:m.value.tranToWeb.size,"z-index":v(nt).getZIndex("tranToWeb"),"onUpdate:position":ie[0]||(ie[0]=Oe=>g("tranToWeb",Oe)),"onUpdate:size":ie[1]||(ie[1]=Oe=>x("tranToWeb",Oe)),onActive:ie[2]||(ie[2]=Oe=>v(nt).setActiveWindow("tranToWeb")),onClose:ie[3]||(ie[3]=Oe=>f())},{default:Pt(()=>[i("div",{class:"utils_tran_web__content",onDragover:Tt(k,["prevent"]),onDrop:Tt($,["prevent"]),onPaste:O,onClick:ce},[r.value?(E(),D("div",UL,[i("iframe",{srcdoc:r.value,class:"html-preview"},null,8,zL),i("div",VL,[i("button",{onClick:me},y(v(o)("utils.downloadHtml")),1),i("button",{onClick:M},y(v(o)("utils.clear")),1)])])):(E(),D("div",BL,y(v(o)("utils.dropOrPasteImage")),1)),i("input",{type:"file",ref_key:"fileInput",ref:z,style:{display:"none"},accept:"image/*",onChange:P},null,544)],32)]),_:1},8,["title","position","size","z-index"])):Ce("",!0)}},[["__scopeId","data-v-a865c34f"]]),jL=["onMouseenter","onMouseleave","onMousedown","onMouseup"],HL=qt({__name:"FloatingBall",setup(e){const{t}=Gt(),n=S(parseInt(localStorage.getItem("weilin_prompt_ui_floatingBallCount"),10)||1),o=S(parseInt(localStorage.getItem("weilin_prompt_ui_floatingBallSize"),10)||66),a=S(localStorage.getItem("weilin_prompt_ui_floatingBallHeightSize")||o.value),r=S(localStorage.getItem("weilin_prompt_ui_ballSkinType")||"default"),s=S(localStorage.getItem("weilin_prompt_ui_customSkinUrl")||""),u=S(localStorage.getItem("weilin_prompt_ui_bgType")||"gradient"),p=S(localStorage.getItem("weilin_prompt_ui_gradientColor1")||"#6a11cb"),m=S(localStorage.getItem("weilin_prompt_ui_gradientColor2")||"#2575fc"),f=S(localStorage.getItem("weilin_prompt_ui_ballBorderRadius")||50);n.value<1&&(n.value=1,localStorage.setItem("weilin_prompt_ui_floatingBallCount",n.value)),o.value<5&&(o.value=66,localStorage.setItem("weilin_prompt_ui_floatingBallSize",o.value)),a.value<5&&(a.value=66,localStorage.setItem("weilin_prompt_ui_floatingBallHeightSize",a.value)),localStorage.getItem("weilin_prompt_ui_floatingBallCount")||localStorage.setItem("weilin_prompt_ui_floatingBallCount",n.value),localStorage.getItem("weilin_prompt_ui_floatingBallSize")||localStorage.setItem("weilin_prompt_ui_floatingBallSize",o.value),localStorage.getItem("weilin_prompt_ui_floatingBallHeightSize")||localStorage.setItem("weilin_prompt_ui_floatingBallHeightSize",o.value);const g=S([]),x=S([]),b=S([]),k=S([]),$=S(null),O=Ht(()=>k.value.map(Ae=>{const fe={...Ae};return r.value==="custom"&&s.value?(fe.backgroundImage=`url(${s.value})`,fe.backgroundSize="contain",fe.backgroundRepeat="no-repeat",fe.backgroundPosition="center",fe.imageRendering="optimizeQuality"):u.value==="gradient"?fe.background=`linear-gradient(135deg, ${p.value}, ${m.value})`:fe.background="transparent",fe.borderRadius=`${f.value}%`,fe}));for(let Ae=0;Ae<n.value;Ae++){b.value[Ae]=!1,x.value[Ae]=!1;const fe=window.innerWidth,_e=window.innerHeight,ae=o.value,W=a.value,re=10,Q=Math.floor(fe/(ae+re)),X=Math.floor(Ae/Q);let pe=20+Ae%Q*(ae+re),Z=_e-100-X*(W+re);pe=Math.max(0,pe),pe=Math.min(pe,fe-ae),Z=Math.max(0,Z),Z=Math.min(Z,_e-W),g.value[Ae]={x:pe,y:Z,width:`${ae}px`,height:`${W}px`},k.value[Ae]={left:`${g.value[Ae].x}px`,top:`${g.value[Ae].y}px`,width:`${ae}px`,height:`${W}px`}}const I=(Ae,fe)=>{Ae.target.closest(".weilin_prompt_ui_floating-ball")&&(x.value[fe]=!0,document.addEventListener("mousemove",ae=>V(ae,fe)),document.addEventListener("mouseup",ae=>me(ae,fe)))},V=(Ae,fe)=>{if(x.value[fe]){const _e=window.innerWidth,ae=window.innerHeight,W=o.value,re=a.value;let Q=Ae.clientX-W/2,X=Ae.clientY-re/2;Q=Math.max(0,Q),Q=Math.min(Q,_e-W),X=Math.max(0,X),X=Math.min(X,ae-re),g.value[fe]={x:Q,y:X,width:`${W}px`,height:`${re}px`},k.value[fe]={left:`${g.value[fe].x}px`,top:`${g.value[fe].y}px`,width:`${W}px`,height:`${re}px`}}},me=(Ae,fe)=>{x.value[fe]=!1,document.removeEventListener("mousemove",_e=>V(_e,fe)),document.removeEventListener("mouseup",_e=>me(_e,fe))},M=()=>{},z=Ae=>{switch(Ae){case"item1":window.parent.postMessage({type:"weilin_prompt_ui_open_global_prompt_box"},"*");break;case"item2":window.parent.postMessage({type:"weilin_prompt_ui_open_global_tag_manager"},"*");break;case"item3":window.parent.postMessage({type:"weilin_prompt_ui_open_global_lora_manager"},"*");break;case"item4":window.parent.postMessage({type:"weilin_prompt_ui_openAiWindow"},"*");break;case"item5":window.parent.postMessage({type:"weilin_prompt_ui_restore_window"},"*");break;case"item6":window.parent.postMessage({type:"weilin_prompt_ui_open_node_list_window"},"*");break;case"item7":P();break;case"item8":$.value.open();break}},ce=S(),P=()=>{ce.value.open()},le=Ae=>{if(!(!Ae.data||!Ae.data.type)&&Ae.data.type.startsWith("weilin_prompt_ui_")&&Ae.data.type==="weilin_prompt_ui_floating_ball_setting"){n.value=parseInt(localStorage.getItem("weilin_prompt_ui_floatingBallCount"),10)||1,o.value=parseInt(localStorage.getItem("weilin_prompt_ui_floatingBallSize"),10)||66,a.value=parseInt(localStorage.getItem("weilin_prompt_ui_floatingBallHeightSize"),10)||o.value,r.value=localStorage.getItem("weilin_prompt_ui_ballSkinType")||"default",s.value=localStorage.getItem("weilin_prompt_ui_customSkinUrl")||"",u.value=localStorage.getItem("weilin_prompt_ui_bgType")||"gradient",p.value=localStorage.getItem("weilin_prompt_ui_gradientColor1")||"#6a11cb",m.value=localStorage.getItem("weilin_prompt_ui_gradientColor2")||"#2575fc",f.value=localStorage.getItem("weilin_prompt_ui_ballBorderRadius")||50,b.value=[],x.value=[],g.value=[],k.value=[];for(let fe=0;fe<n.value;fe++){b.value[fe]=!1,x.value[fe]=!1;const _e=window.innerWidth,ae=window.innerHeight,W=o.value,re=a.value,Q=10,X=Math.floor(_e/(W+Q)),ye=Math.floor(fe/X);let Z=20+fe%X*(W+Q),oe=ae-100-ye*(re+Q);Z=Math.max(0,Z),Z=Math.min(Z,_e-W),oe=Math.max(0,oe),oe=Math.min(oe,ae-re),g.value[fe]={x:Z,y:oe,width:`${W}px`,height:`${re}px`},k.value[fe]={left:`${g.value[fe].x}px`,top:`${g.value[fe].y}px`,width:`${W}px`,height:`${re}px`,...r.value==="custom"&&s.value?{backgroundImage:`url(${s.value})`,backgroundSize:"cover",backgroundRepeat:"no-repeat",backgroundPosition:"center"}:u.value==="gradient"?{background:`linear-gradient(135deg, ${p.value}, ${m.value})`}:{background:"transparent"},borderRadius:`${f.value}%`}}}},ie=Ae=>{b.value[Ae]=!0},Oe=Ae=>{b.value[Ae]=!1};return Ut(()=>{window.addEventListener("message",le)}),so(()=>{window.removeEventListener("message",le),document.removeEventListener("mousemove",V),document.removeEventListener("mouseup",me)}),(Ae,fe)=>(E(),D(Ke,null,[(E(!0),D(Ke,null,lt(n.value,_e=>(E(),D("div",{class:"weilin_prompt_ui_floating-ball",style:Bt(O.value[_e-1]),onMouseenter:ae=>ie(_e-1),onMouseleave:ae=>Oe(_e-1),onMousedown:ae=>I(ae,_e-1),onMouseup:ae=>me(ae,_e-1),key:"floating-ball-"+_e},[i("div",{class:"weilin_prompt_ui_ball-content",onClick:M},y(r.value==="default"?"WeiLin":""),1),b.value[_e-1]?(E(),D("div",{key:0,class:"weilin_prompt_ui_menu-container",onMousedown:fe[8]||(fe[8]=Tt(()=>{},["stop"]))},[i("div",{class:"weilin_prompt_ui_menu-item",onClick:fe[0]||(fe[0]=ae=>z("item1"))},y(v(t)("floatingBall.promptBox")),1),i("div",{class:"weilin_prompt_ui_menu-item",onClick:fe[1]||(fe[1]=ae=>z("item2"))},y(v(t)("floatingBall.tagManager")),1),i("div",{class:"weilin_prompt_ui_menu-item",onClick:fe[2]||(fe[2]=ae=>z("item3"))},y(v(t)("floatingBall.loraManager")),1),i("div",{class:"weilin_prompt_ui_menu-item",onClick:fe[3]||(fe[3]=ae=>z("item4"))},y(v(t)("floatingBall.aiWindow")),1),i("div",{class:"weilin_prompt_ui_menu-item",onClick:fe[4]||(fe[4]=ae=>z("item6"))},y(v(t)("floatingBall.openNodeListWindow")),1),i("div",{class:"weilin_prompt_ui_menu-item",onClick:fe[5]||(fe[5]=ae=>z("item7"))},y(v(t)("floatingBall.tranToWeb")),1),i("div",{class:"weilin_prompt_ui_menu-item",onClick:fe[6]||(fe[6]=ae=>z("item8"))},y(v(t)("floatingBall.openSetting")),1),i("div",{class:"weilin_prompt_ui_menu-item",onClick:fe[7]||(fe[7]=ae=>z("item5"))},y(v(t)("floatingBall.restoreWindow")),1)],32)):Ce("",!0)],44,jL))),128)),it(WL,{ref_key:"tranToWebRef",ref:ce},null,512),it(tm,{ref_key:"settingDialog",ref:$},null,512)],64))}},[["__scopeId","data-v-dc48fe8a"]]),GL={class:"ai-chat-window"},qL={class:"history-sidebar"},YL={class:"history-list"},KL=["onClick"],JL={key:0},XL=["onKeyup","onBlur"],QL={class:"item-actions"},ZL=["onClick"],eA=["onClick"],tA={class:"chat-main"},nA={class:"message-list"},oA={class:"message-content"},aA={key:0,class:"message assistant"},rA={class:"message-content"},iA={class:"input-area"},sA=["placeholder","onKeydown"],lA=["disabled"],uA=qt({__name:"ai_window",setup(e){const{t}=Gt(),n=S([]),o=S(-1),a=S(""),r=S(!1),s=S({}),u=S(!1),p=S(""),m=z=>{var ce;n.value[z]&&(u.value=!0,p.value=((ce=n.value[z])==null?void 0:ce.title)||`对话 ${z+1}`,o.value=z)},f=z=>{n.value[z]&&(p.value.trim()&&(n.value[z].title=p.value.trim(),I()),u.value=!1)},g=()=>{u.value=!1},x=()=>{Bi.getOpenAiSetting().then(z=>{s.value=z.data}).catch(()=>{ue({type:"warn",str:"message.networkError"})})};Ut(()=>{x()});const b=Ht(()=>n.value[o.value]||{messages:[]}),k=z=>{o.value=z},$=()=>{r.value=!0;const z={title:`对话 ${n.value.length+1}`,messages:[],createdAt:new Date().toISOString()};return n.value.push(z),o.value=n.value.length-1,I(),r.value=!1,z},O=()=>{const z=localStorage.getItem("aiChatHistory");z&&(n.value=JSON.parse(z))},I=()=>{localStorage.setItem("aiChatHistory",JSON.stringify(n.value))};Ut(()=>{x(),O()});const V=async()=>{if(!a.value.trim()||r.value)return;(n.value.length===0||o.value===-1)&&$();const z={role:"user",content:a.value,timestamp:new Date().toISOString()};b.value.messages.push(z),I(),a.value="";const ce={role:"assistant",content:"",timestamp:new Date().toISOString()};b.value.messages.push(ce),I(),r.value=!0;try{await M({messages:b.value.messages},P=>{const le=b.value.messages[b.value.messages.length-1];le.content+=P.content,I()},P=>{console.error("Error:",P);const le=b.value.messages[b.value.messages.length-1];le.content="抱歉,出错了,请稍后再试。",I()},()=>{r.value=!1,I()})}catch(P){console.error("Error:",P),r.value=!1;const le=b.value.messages[b.value.messages.length-1];le.content="请求失败,请检查网络连接。",I()}},me=z=>{n.value.splice(z,1),o.value===z&&(o.value=Math.max(0,z-1)),I()},M=async(z,ce,P,le)=>{var ie,Oe;try{const Ae=await fetch(`${s.value.base_url}/chat/completions`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${s.value.api_key}`},body:JSON.stringify({model:s.value.model,messages:z.messages,stream:!0})});if(!Ae.ok)throw new Error(`HTTP error! status: ${Ae.status}`);const fe=Ae.body.getReader(),_e=new TextDecoder;let ae="";for(;;){const{done:W,value:re}=await fe.read();if(W){le();break}ae+=_e.decode(re,{stream:!0});const Q=ae.split(`
|
||
`);ae=Q.pop();for(const X of Q)if(X.trim()!==""){if(X==="data: [DONE]"){le();return}try{const ye=X.replace(/^data: /,""),Z=((Oe=(ie=JSON.parse(ye).choices[0])==null?void 0:ie.delta)==null?void 0:Oe.content)||"";Z&&ce({content:Z})}catch{console.error("Failed to parse message:",X)}}}}catch(Ae){P(Ae)}};return(z,ce)=>(E(),D("div",GL,[i("div",qL,[i("button",{class:"new-chat-btn",onClick:$},y(v(t)("aiWindow.newChat")),1),i("div",YL,[(E(!0),D(Ke,null,lt(n.value,(P,le)=>(E(),D("div",{key:le,class:We(["history-item",{active:o.value===le}]),onClick:ie=>k(le)},[!u.value||o.value!==le?(E(),D("span",JL,y((P==null?void 0:P.title)||v(t)("aiWindow.chatName")+` ${le+1}`),1)):$e((E(),D("input",{key:1,"onUpdate:modelValue":ce[0]||(ce[0]=ie=>p.value=ie),onKeyup:[Rn(ie=>f(le),["enter"]),Rn(g,["esc"])],onBlur:ie=>f(le),class:"rename-input"},null,40,XL)),[[ze,p.value]]),i("div",QL,[i("button",{class:"rename-btn",onClick:Tt(ie=>m(le),["stop"])},"✎",8,ZL),u.value?Ce("",!0):(E(),D("button",{key:0,class:"delete-btn",onClick:Tt(ie=>me(le),["stop"])},"×",8,eA))])],10,KL))),128))])]),i("div",tA,[i("div",nA,[(E(!0),D(Ke,null,lt(b.value.messages,(P,le)=>(E(),D("div",{key:le,class:We(["message",P.role])},[i("div",oA,[i("pre",null,y(P.content),1)])],2))),128)),r.value?(E(),D("div",aA,[i("div",rA,[i("pre",null,y(v(t)("aiWindow.thinking")),1)])])):Ce("",!0)]),i("div",iA,[$e(i("textarea",{class:"ai-chat-textarea","onUpdate:modelValue":ce[1]||(ce[1]=P=>a.value=P),placeholder:v(t)("aiWindow.inputMessage"),onKeydown:Rn(Tt(V,["exact","prevent"]),["enter"])},null,40,sA),[[ze,a.value]]),i("button",{class:"ai-chat-btn",onClick:V,disabled:r.value},y(v(t)("aiWindow.send")),9,lA)])])]))}},[["__scopeId","data-v-a48359ca"]]),cA={class:"lora-info"},dA={class:"lora-header"},pA=["title"],fA={class:"lora-weights"},gA={class:"weight-item"},mA=["title"],hA={class:"weight-item"},vA={class:"center-box"},_A=["onClick"],vl="weilin_prompt_ui_",yA=qt({__name:"index",setup(e){const{t}=Gt(),n=S([]);window.addEventListener("message",a=>{a.data.type==="weilin_prompt_ui_update_node_list_info"&&(n.value=a.data.nodeList)});const o=a=>{window.postMessage({type:"weilin_prompt_ui_prompt_open_node_wit_seed",seed:a},"*")};return Ut(()=>{window.postMessage({type:"weilin_prompt_ui_prompt_get_node_list_info"},"*")}),(a,r)=>(E(),D("div",{class:We(`${vl}lora-stack`)},[i("div",{class:We(`${vl}lora-content`)},[i("div",{class:We(`${vl}lora-body`)},[i("div",{class:We(`${vl}lora-list`)},[(E(!0),D(Ke,null,lt(n.value,s=>(E(),D("div",{key:s.id,class:"lora-item"},[i("div",cA,[i("div",dA,[i("span",{class:"lora-name",title:s.title},"#"+y(s.id)+" - "+y(s.title),9,pA)]),i("div",fA,[i("div",gA,[i("div",{class:"text-label",title:s.text},y(s.text),9,mA)]),i("div",hA,[i("div",vA,[i("button",{onClick:u=>o(s.seed),class:"open-button"},y(v(t)("nodeListWindow.openPromptUI")),9,_A)])])])])]))),128))],2)],2)],2)],2))}},[["__scopeId","data-v-bd98d345"]]),Mc={getTreeFromCloud:e=>Ye({url:"/cloud/get/tree",method:"post",data:{path:e}}),getLocalInstallPackage:()=>Ye({url:"/cloud/get/local/package",method:"post",data:{}}),installSelectPackage:(e,t)=>Ye({url:"/cloud/download/file",method:"post",timeout:0,data:{paths:t,path:e}})},bA={class:"cloud-manager"},wA={class:"weilin-toolbar"},xA={class:"current-path"},SA={class:"file-list"},TA={class:"file-info"},kA={class:"file-name"},CA={class:"file-type"},EA={class:"file-actions"},$A=["onClick"],LA={key:1,class:"install-container"},AA={key:0,class:"installed-badge"},MA=["onClick","disabled"],IA=qt({__name:"index",setup(e){const{t}=Gt(),n=S([]),o=S("tags"),a=S("tags"),r=S([]),s=async $=>{try{const O=await Mc.getTreeFromCloud($);n.value=O.data}catch(O){console.error("获取文件树失败:",O),ue({type:"warn",str:"message.networkError"})}},u=async()=>{try{const $=await Mc.getLocalInstallPackage();r.value=$.data||[]}catch($){console.error("获取已安装包列表失败:",$),ue({type:"warn",str:"message.networkError"})}},p=$=>r.value.some(O=>O===$),m=async $=>{try{const O=n.value.find(I=>I.path===$);O&&(O.isInstalling=!0,await Mc.installSelectPackage(a.value,[$]).then(()=>{u(),ue({type:"success",str:"message.installPackageSuccess"})}))}catch(O){console.error("安装包失败:",O),ue({type:"warn",str:"message.installPackageFail"})}finally{const O=n.value.find(I=>I.path===$);O&&(O.isInstalling=!1)}},f=()=>{const $=o.value.split("/");$.length>1&&(o.value=$.slice(0,-1).join("/"),s(o.value))},g=()=>{s(o.value),u()},x=$=>{o.value=$,s($)},b=()=>{a.value="tags",o.value="tags",s(o.value)},k=()=>{a.value="danbooru",o.value="danbooru",s(o.value)};return Ut(()=>{s(o.value),u()}),($,O)=>(E(),D("div",bA,[i("div",wA,[i("button",{class:"refresh-btn",onClick:g},O[0]||(O[0]=[i("svg",{viewBox:"0 0 24 24",width:"16",height:"16",class:"tag-icon"},[i("path",{d:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z"})],-1)])),i("button",{class:"database-btn",onClick:b},[O[1]||(O[1]=i("svg",{viewBox:"0 0 24 24",width:"16",height:"16",class:"tag-icon"},[i("path",{d:"M21.41 11.58l-9-9C12.05 2.22 11.55 2 11 2H4c-1.1 0-2 .9-2 2v7c0 .55.22 1.05.59 1.42l9 9c.36.36.86.58 1.41.58.55 0 1.05-.22 1.41-.59l7-7c.37-.36.59-.86.59-1.41 0-.55-.23-1.06-.59-1.42zM5.5 7C4.67 7 4 6.33 4 5.5S4.67 4 5.5 4 7 4.67 7 5.5 6.33 7 5.5 7z"})],-1)),i("span",null,y(v(t)("cloudWindow.tagDatabase")),1)]),i("button",{class:"database-btn",onClick:k},[O[2]||(O[2]=i("svg",{viewBox:"0 0 24 24",width:"16",height:"16",class:"tag-icon"},[i("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V5h14v14zm-8-2h2v-4h4v-2h-4V7h-2v4H7v2h4v4z"})],-1)),i("span",null,y(v(t)("cloudWindow.danbooruDatabase")),1)]),i("div",xA,[i("span",null,y(v(t)("cloudWindow.currentPath"))+": "+y(a.value=="tags"?v(t)("cloudWindow.tagDatabase"):v(t)("cloudWindow.danbooruDatabase")),1)])]),i("div",SA,[o.value!=="tags"&&o.value!=="danbooru"?(E(),D("button",{key:0,class:"back-btn",onClick:f},[O[3]||(O[3]=i("svg",{viewBox:"0 0 24 24",width:"16",height:"16",class:"tag-icon"},[i("path",{d:"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"})],-1)),ut(" "+y(v(t)("cloudWindow.back")),1)])):Ce("",!0),(E(!0),D(Ke,null,lt(n.value,I=>(E(),D("div",{key:I.path,class:"file-item"},[i("div",TA,[i("span",kA,y(I.name),1),i("span",CA,y(I.type=="dir"?"文件夹":I.type=="file"?"文件":"其它未知文件"),1)]),i("div",EA,[I.type==="dir"?(E(),D("button",{key:0,onClick:V=>x(I.path),class:"open-btn"},y(v(t)("cloudWindow.open")),9,$A)):I.type==="file"?(E(),D("div",LA,[p(I.path)?(E(),D("span",AA,y(v(t)("cloudWindow.installed")),1)):(E(),D("button",{key:1,onClick:V=>m(I.path),class:"install-btn",disabled:I.isInstalling},y(I.isInstalling?v(t)("cloudWindow.installing"):v(t)("cloudWindow.install")),9,MA))])):Ce("",!0)])]))),128))])]))}},[["__scopeId","data-v-d34491cd"]]),DA={class:"header-actions"},OA=["title"],RA=["onMouseover","onDragstart","onDrop"],PA={class:"lora-info"},NA={class:"lora-header"},FA=["title"],BA={class:"lora-actions"},UA=["onClick","title"],zA=["onClick","title"],VA={class:"lora-weights-row"},WA={class:"weight-item-col"},jA=["onUpdate:modelValue"],HA={class:"weight-item-col"},GA=["onUpdate:modelValue"],qA={class:"weight-item-col"},YA=["onUpdate:modelValue"],KA={class:"switch-item-col"},JA={class:"switch"},XA=["checked","onChange"],jr="weilin_prompt_ui_",QA=qt({__name:"lora_stack",setup(e,{expose:t}){const{t:n}=Gt(),o=S([]),a=S(""),r=()=>`lora_stack_${Math.random().toString(36).substring(2,15)}`;Ut(()=>{a.value||(a.value=r())});let s=!1;const u=W=>{if(W.data.type===`weilin_prompt_ui_selectLora_stack_${a.value}`)P(W.data.lora);else if(W.data.type===`weilin_prompt_ui_prompt_node_finish_lora_stack_${a.value}`)try{const re=JSON.parse(W.data.data);s=!0,re.temp_lora&&re.temp_lora.length>0&&re.temp_lora!==""?o.value=re.temp_lora:re.lora&&re.lora!==""?o.value=re.lora:o.value=[],vt(()=>{s=!1})}catch(re){console.error("解析节点lora数据失败:",re),s=!1}else if(W.data.type===`weilin_prompt_ui_query_lora_stack_response_${a.value}`)try{const re=JSON.parse(W.data.data);s=!0,re.temp_lora&&re.temp_lora.length>0?o.value=re.temp_lora:o.value=[],vt(()=>{s=!1})}catch(re){console.error("解析节点查询响应失败:",re),s=!1}};window.addEventListener("message",u);const p=(W,re)=>{if(a.value=re,window.postMessage({type:`weilin_prompt_ui_query_lora_stack_${a.value}`},"*"),W.length>0)try{const Q=JSON.parse(W);if(Q.lora&&Q.lora!==""&&(o.value=Q.lora),Q.temp_lora&&Q.temp_lora.length>0&&Q.temp_lora!==""){const X=Q.temp_lora;o.value=X}}catch{ue({type:"warn",str:"promptBox.settings.errorPrompt"})}},m=S(!1),f=S(""),g=S(100),x=S(0),b=S(),k=S(!1),$=S(!1),O=S(),I=()=>{window.postMessage({type:"weilin_prompt_ui_openLoraManager_addLora_stack",seed:a.value},"*")},V=W=>{W.hidden=!W.hidden},me=(W,re)=>{if($.value=!0,f.value===W&&m.value)return;const X=re.currentTarget.getBoundingClientRect(),pe={left:X.left-450-10,top:X.top};pe.left<10&&(pe.left=X.right+10),pe.top=Math.max(10,Math.min(pe.top,window.innerHeight-310)),g.value=pe.left,x.value=pe.top,m.value=!0,f.value=W,vt(()=>{O.value.refresh()})},M=()=>{$.value=!1,setTimeout(()=>{!k.value&&!$.value&&(m.value=!1,f.value="",k.value=!1)},200)},z=()=>{k.value=!0,$.value=!0},ce=()=>{m.value=!1,f.value="",k.value=!1},P=W=>{const re=o.value.findIndex(Q=>Q.name===W.name);re===-1?o.value.push({name:W.name,weight:1,text_encoder_weight:1,...W}):o.value[re]={...o.value[re],...W,weight:o.value[re].weight,text_encoder_weight:o.value[re].text_encoder_weight}},le=W=>{const re=o.value.findIndex(Q=>Q.name===W.name);re>-1&&o.value.splice(re,1)},ie=S(),Oe=W=>{ie.value.open({name:W.lora})};At(o,()=>{s||Ae()},{deep:!0});const Ae=()=>{const W=o.value.filter(ye=>!ye.hidden),re={lora:W.length>0?W:"",temp_lora:o.value.length>0?o.value:[]},Q=JSON.stringify(re);window.postMessage({type:`weilin_prompt_ui_prompt_node_finish_lora_stack_${a.value}`,data:Q},"*");const X=W.map(ye=>`<wlr:${ye.lora?ye.lora.replace(".safetensors",""):ye.name}:${ye.weight||1}:${ye.text_encoder_weight||1}:${ye.trigger_weight||1}>`);window.postMessage({type:`weilin_prompt_ui_update_lora_tags_${a.value}`,tags:X},"*")},fe=S(null),_e=W=>{fe.value=W},ae=W=>{if(fe.value===null||fe.value===W)return;const re=o.value.splice(fe.value,1)[0];o.value.splice(W,0,re),fe.value=null,Ae()};return t({initLoraStack:p}),(W,re)=>(E(),D("div",{class:We(`${jr}lora-stack`)},[i("div",{class:We(`${jr}lora-content`)},[i("div",{class:We(`${jr}lora-header`)},[i("div",DA,[i("button",{class:We(`${jr}add-btn`),onClick:I,title:v(n)("controls.addLora")},re[1]||(re[1]=[i("svg",{viewBox:"0 0 24 24",width:"16",height:"16"},[i("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"})],-1)]),10,OA)])],2),i("div",{class:We(`${jr}lora-body`)},[i("div",{class:We(`${jr}lora-list`)},[(E(!0),D(Ke,null,lt(o.value,(Q,X)=>(E(),D("div",{ref_for:!0,ref_key:"loraStackItemRef",ref:b,key:Q.name,class:We(["lora-item",{"hidden-lora":Q.hidden}]),onMouseover:ye=>me(Q.lora,ye),onMouseleave:M,draggable:"true",onDragstart:ye=>_e(X),onDragover:re[0]||(re[0]=Tt(()=>{},["prevent"])),onDrop:ye=>ae(X)},[i("div",PA,[i("div",NA,[i("span",{class:"lora-name",title:Q.name},y(Q.name),9,FA),i("div",BA,[i("button",{class:"look-on-btn",onClick:ye=>Oe(Q),title:v(n)("controls.lookOnLora")},re[2]||(re[2]=[i("svg",{viewBox:"0 0 1024 1024",width:"14",height:"14"},[i("path",{d:"M576.5 930.2H163.1c-52.9 0-96-43.1-96-96v-672c0-52.9 43.1-96 96-96h672c52.9 0 96 43.1 96 96V577c0 17.7-14.3 32-32 32s-32-14.3-32-32V162.2c0-17.6-14.4-32-32-32h-672c-17.6 0-32 14.4-32 32v672c0 17.6 14.4 32 32 32h413.4c17.7 0 32 14.3 32 32s-14.3 32-32 32z","p-id":"3466"}),i("path",{d:"M692.4 322.3H245.7c-17.7 0-32-14.3-32-32s14.3-32 32-32h446.7c17.7 0 32 14.3 32 32s-14.3 32-32 32zM388.5 530.2H245.7c-17.7 0-32-14.3-32-32s14.3-32 32-32h142.7c17.7 0 32 14.3 32 32 0.1 17.6-14.3 32-31.9 32zM388.5 738H245.7c-17.7 0-32-14.3-32-32s14.3-32 32-32h142.7c17.7 0 32 14.3 32 32 0.1 17.7-14.3 32-31.9 32z","p-id":"3467"}),i("path",{d:"M624.1 792.5c-94.8 0-172-77.2-172-172s77.2-172 172-172 172 77.2 172 172-77.1 172-172 172z m0-280c-59.6 0-108 48.4-108 108s48.4 108 108 108 108-48.4 108-108-48.4-108-108-108z","p-id":"3468"}),i("path",{d:"M820.8 864.2L710.5 753.9c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L866 818.9c12.5 12.5 12.5 32.8 0 45.3s-32.7 12.5-45.2 0z","p-id":"3469"})],-1)]),8,UA),i("button",{class:"remove-btn",onClick:ye=>le(Q),title:v(n)("controls.removeLora")},re[3]||(re[3]=[i("svg",{viewBox:"0 0 24 24",width:"14",height:"14"},[i("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})],-1)]),8,zA)])]),i("div",VA,[i("div",WA,[i("label",null,y(v(n)("loraManager.modelWeight")),1),$e(i("input",{type:"number","onUpdate:modelValue":ye=>Q.weight=ye,class:"lora-weight",step:"0.1"},null,8,jA),[[ze,Q.weight]])]),i("div",HA,[i("label",null,y(v(n)("loraManager.textEncoderWeight")),1),$e(i("input",{type:"number","onUpdate:modelValue":ye=>Q.text_encoder_weight=ye,class:"lora-weight",step:"0.1"},null,8,GA),[[ze,Q.text_encoder_weight]])]),i("div",qA,[i("label",null,y(v(n)("loraManager.triggerWeight")),1),$e(i("input",{type:"number","onUpdate:modelValue":ye=>Q.trigger_weight=ye,class:"lora-weight",step:"0.1"},null,8,YA),[[ze,Q.trigger_weight]])]),i("div",KA,[i("label",null,y(Q.hidden?v(n)("lora.hideLora"):v(n)("lora.showLora")),1),i("label",JA,[i("input",{type:"checkbox",checked:!Q.hidden,onChange:ye=>V(Q)},null,40,XA),re[4]||(re[4]=i("span",{class:"slider"},null,-1))])])])])],42,RA))),128))],2)],2)],2),it(hl,{ref_key:"loraDetailLoraStackRef",ref:ie},null,512),m.value?(E(),Jt(Lc,{key:0,ref_key:"loraCardItem",ref:O,fileNmae:f.value,paddingLeft:g.value,paddingTop:x.value,onCardLeave:ce,onCardenter:z},null,8,["fileNmae","paddingLeft","paddingTop"])):Ce("",!0)],2))}},[["__scopeId","data-v-0a691b76"]]),Hr={searchDanbooru:(e="",t=1,n=100)=>Ye({url:"/danbooru/get_tags",method:"post",data:{search:e,page:t,limit:n}}),addDanbooruTag:e=>Ye({url:"/danbooru/add_tag",method:"post",data:e}),updateDanbooruTag:e=>Ye({url:"/danbooru/update_tag",method:"post",timeout:0,data:e}),deleteDanbooruTag:e=>Ye({url:"/danbooru/delete_tag",method:"post",timeout:0,data:{id:e}}),batchDeleteDanbooruTags:e=>Ye({url:"/danbooru/batch_delete_tag",method:"post",timeout:0,data:{values:e}}),runSQLToServer:e=>Ye({url:"/danbooru/run_sql_text",method:"post",timeout:0,data:{sql:e}})},ZA={key:0,class:"loading-overlay"},eM={class:"settings-content"},tM={style:{"margin-bottom":"16px"}},nM=["placeholder"],oM={style:{"margin-bottom":"16px"}},aM=["placeholder"],rM=["placeholder"],iM=["placeholder"],sM={class:"data-container"},lM={key:0},uM={key:0},cM={class:"tag-group-container"},dM={key:0},pM={key:1},fM={style:{display:"flex","align-items":"center"}},gM={key:0},mM=["placeholder"],hM=["placeholder"],vM=["placeholder"],_M=["placeholder"],yM=["onClick"],bM=["onClick"],wM=["onClick"],xM={key:1},SM={class:"tag-group-container"},TM={key:0},kM={key:1},CM={style:{display:"flex","align-items":"center"}},EM={key:0},$M=["placeholder"],LM=["placeholder"],AM=["placeholder"],MM=["placeholder"],IM=qt({__name:"import_danbooru",setup(e,{expose:t}){const{t:n}=Gt(),o=S(!1),a=S(""),r=S(""),s=S(""),u=S(""),p=S(""),m=S(""),f=S(""),g=S(""),x=S(""),b=S([]),k=S(-1),$=S(""),O=S(""),I=S(null);S(null);const V=S(null),me=S(!1),M=S(""),z=S(0),ce=S(0);function P(){a.value="",r.value="",z.value=0,ce.value=0,s.value="",u.value="",p.value="",m.value="",f.value="",g.value="",x.value="",b.value=[],k.value=-1,$.value="",O.value="",me.value=!1}function le(te){P();const K=te.target.files[0];if(K){const ee=new FileReader;ee.onload=F=>{F.target.result.split(";").filter(L=>L.trim()).forEach(L=>{if((L.includes("tag_groups")||L.includes("tag_subgroups"))&&L.includes("p_uuid"))if(L.includes("g_uuid")){p.value=`${L};`;const G=L.split("VALUES")[1].trim().match(/,\s*'([^']+)'\)$/);G&&(x.value=G[1]);const de=L.match(/VALUES\s*\([^'"]*['"]([^'"]+)['"]/);de&&(f.value=de[1].replace(/''/g,"'"))}else{u.value=`${L};`;const G=L.split("VALUES")[1].trim().match(/,\s*'([^']+)'\)$/);G&&(g.value=G[1]);const de=L.match(/VALUES\s*\([^'"]*['"]([^'"]+)['"]/);de&&(m.value=de[1].replace(/''/g,"'"))}else L.includes("tag_tags")&&b.value.push(`${L};`)})},ee.readAsText(K)}te.target.value=""}function ie(te){const K=te.target.files[0];if(K){const ee=new FileReader;ee.onload=F=>{F.target.result.split(`
|
||
`).filter(L=>L.trim()).forEach(L=>{const C=L.split(",");if(C.length>=2){let G,de,Se,Le;C.length===2?(G=C[0].trim(),Le=C[1].trim(),de=0,Se=0):C.length>=3&&(G=C[0].trim(),de=parseInt(C[1].trim(),10)||0,Se=parseInt(C[2].trim(),10)||0,Le=C.slice(3).join(",").trim(),Le=Le.replace(/^"(.*)"$/,"$1"));const N=G.replace(/'/g,"''"),T=Le.replace(/'/g,"''"),j=`INSERT INTO "danbooru_tag" ("tag", "color_id", "translate", "hot", "aliases") VALUES ('${N}', '', '${T}', ${Se}, ${de});`;b.value.push(j)}})},ee.readAsText(K)}te.target.value=""}function Oe(){V.value.click()}function Ae(){let te;b.value.length>0&&_e(b.value[0])?te=[...b.value].join(`
|
||
`):te=[u.value,p.value,...b.value].join(`
|
||
`);const K=new Blob([te],{type:"text/sql"}),ee=document.createElement("a");if(ee.href=URL.createObjectURL(K),M.value.length<=0){const F=parseInt(new Date().getTime()/1e3,10);ee.download=`export_${F}.sql`}else ee.download=`${M.value}.sql`;ee.click()}function fe(te){const K=te.match(/VALUES\s*\([^']*'([^']+)'/),ee=te.match(/VALUES\s*\([^']*'[^']*'\s*,\s*'([^']+)'/);return{text:K?K[1].replace(/''/g,"'"):"",desc:ee?ee[1].replace(/''/g,"'"):""}}function _e(te){return te.includes("danbooru_tag")}function ae(te){const K=te.match(/VALUES\s*\(\s*'([^']+)'\s*,\s*'([^']*)'\s*,\s*'([^']*)'\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/);return K?{tag:K[1].replace(/''/g,"'"),color_id:K[2],translate:K[3].replace(/''/g,"'"),hot:parseInt(K[4],10),aliases:parseInt(K[5],10)}:{tag:"",color_id:"",translate:"",hot:0,aliases:0}}const W=S(0),re=S(0);function Q(te){const K=b.value[te];if(_e(K)){const ee=ae(K);$.value=ee.tag,O.value=ee.translate,W.value=ee.hot,re.value=ee.aliases}else{const ee=fe(K);$.value=ee.text,O.value=ee.desc}k.value=te}function X(te){const K=$.value.replace(/'/g,"''"),ee=O.value.replace(/'/g,"''");if(_e(b.value[te])){const F=ae(b.value[te]),J=parseInt(W.value,10)||0,Y=parseInt(re.value,10)||0;b.value[te]=`INSERT INTO "danbooru_tag" ("tag", "color_id", "translate", "hot", "aliases") VALUES ('${K}', '${F.color_id}', '${ee}', ${J}, ${Y});`}else b.value[te]=b.value[te].replace(/(VALUES\s*\([^']*')([^']+)'/,`$1${K}'`).replace(/(VALUES\s*\([^']*'[^']*'\s*,\s*')([^']+)'/,`$1${ee}'`);k.value=-1}function ye(){k.value=-1,$.value="",O.value="",W.value=0,re.value=0}function pe(te){b.value.splice(te,1)}function Z(){const te=a.value.replace(/'/g,"''"),K=r.value.replace(/'/g,"''"),ee=parseInt(z.value,10)||0,F=parseInt(ce.value,10)||0,J=`INSERT INTO "danbooru_tag" ("tag", "color_id", "translate", "hot", "aliases") VALUES ('${te}', '', '${K}', ${ee}, ${F});`;b.value.push(J),a.value="",r.value="",z.value=0,ce.value=0}const oe=S(!1),be=async te=>{oe.value=!0;try{await Hr.runSQLToServer(te).then(K=>{K.code!==200?ue({type:"warn",str:K.message}):(ve(),ue({type:"success",str:"importDialog.successImport"}))}).catch(K=>{console.error(K),ue({type:"warn",str:"importDialog.importFail"})})}catch(K){console.error(K),ue({type:"warn",str:"importDialog.importFail"})}finally{oe.value=!1}},ve=()=>{window.postMessage({type:"weilin_prompt_ui_tag_manager_refresh"},"*")},he=async()=>{if(b.value.length>0&&_e(b.value[0])){const te=[...b.value];await be(te)}else if(me.value){if(u.value.length<=0||p.value.length<=0){ue({type:"warn",str:"importDialog.pleaseFullRequest"});return}const te=[...b.value];await be(te)}else{if(u.value.length<=0||p.value.length<=0){ue({type:"warn",str:"importDialog.pleaseFullRequest"});return}const te=[u.value,p.value,...b.value];await be(te)}};return At(u,(te,K)=>{var J,Y;if(!te||te===K)return;const ee=(J=te.match(/'([^']+)'\s*\)\s*;?$/))==null?void 0:J[1],F=(Y=K==null?void 0:K.match(/'([^']+)'\s*\)\s*;?$/))==null?void 0:Y[1];ee&&F&&p.value&&(p.value=p.value.replace(new RegExp(`'${F}'`,"g"),`'${ee}'`))}),At(p,(te,K)=>{var J,Y;if(!te||te===K)return;const ee=(J=te.match(/'([^']+)'\s*\)\s*;?$/))==null?void 0:J[1],F=(Y=K==null?void 0:K.match(/'([^']+)'\s*\)\s*;?$/))==null?void 0:Y[1];ee&&F&&b.value.length>0&&(b.value=b.value.map(L=>L.replace(new RegExp(`'${F}'`,"g"),`'${ee}'`)))}),t({open:()=>{o.value=!0}}),(te,K)=>(E(),D(Ke,null,[oe.value?(E(),D("div",ZA,K[22]||(K[22]=[i("div",{class:"loading-spinner"},null,-1)]))):Ce("",!0),it(Nr,{modelValue:o.value,"onUpdate:modelValue":K[21]||(K[21]=ee=>o.value=ee),title:v(n)("danbooruManager.importBatchTitle")},{footer:Pt(()=>[i("button",{onClick:K[20]||(K[20]=ee=>o.value=!1)},y(v(n)("promptBox.settings.close")),1),i("button",{onClick:he},y(v(n)("importDialog.sure")),1)]),default:Pt(()=>[i("div",eM,[i("div",tM,[i("button",{onClick:P,class:"upload-btn"},y(v(n)("importDialog.cleanAll")),1),i("button",{style:{"margin-left":"10px"},onClick:Ae},y(v(n)("importDialog.dumpSQL")),1),$e(i("input",{style:{width:"300px","margin-left":"10px"},"onUpdate:modelValue":K[0]||(K[0]=ee=>M.value=ee),placeholder:v(n)("importDialog.settingOutputName")},null,8,nM),[[ze,M.value]]),i("input",{type:"file",ref_key:"fileInput",ref:I,onChange:le,accept:".sql",style:{display:"none"}},null,544),i("input",{type:"file",ref_key:"danbooruTxtFileInput",ref:V,onChange:ie,accept:".txt,.csv",style:{display:"none"}},null,544)]),i("div",oM,[$e(i("input",{"onUpdate:modelValue":K[1]||(K[1]=ee=>a.value=ee),placeholder:"Tag"},null,512),[[ze,a.value]]),$e(i("input",{"onUpdate:modelValue":K[2]||(K[2]=ee=>r.value=ee),placeholder:v(n)("importDialog.translater")},null,8,aM),[[ze,r.value]]),$e(i("input",{"onUpdate:modelValue":K[3]||(K[3]=ee=>z.value=ee),placeholder:v(n)("danbooruManager.hot"),type:"number"},null,8,rM),[[ze,z.value]]),$e(i("input",{"onUpdate:modelValue":K[4]||(K[4]=ee=>ce.value=ee),placeholder:v(n)("danbooruManager.aliases"),type:"number"},null,8,iM),[[ze,ce.value]]),i("button",{onClick:Z},y(v(n)("importDialog.add")),1),i("button",{style:{"margin-left":"10px"},onClick:Oe,class:"upload-btn"},y(v(n)("danbooruManager.import")),1)]),i("div",sM,[u.value?(E(),D("div",lM,[i("h3",null,y(fe(u.value).text),1),p.value?(E(),D("div",uM,[i("h4",null,y(fe(p.value).text),1),i("div",cM,[(E(!0),D(Ke,null,lt(b.value,(ee,F)=>(E(),D("div",{key:F,style:{display:"flex","flex-direction":"column","align-items":"center"}},[_e(ee)?(E(),D("p",dM,y(ae(ee).tag)+" - "+y(ae(ee).translate)+" ("+y(v(n)("danbooruManager.hot"))+": "+y(ae(ee).hot)+", "+y(v(n)("danbooruManager.aliases"))+": "+y(ae(ee).aliases)+") ",1)):(E(),D("p",pM,y(fe(ee).text)+" - "+y(fe(ee).desc),1)),i("div",fM,[k.value===F?(E(),D("div",gM,[_e(ee)?$e((E(),D("input",{key:0,"onUpdate:modelValue":K[5]||(K[5]=J=>$.value=J),placeholder:"Tag"},null,512)),[[ze,$.value]]):$e((E(),D("input",{key:1,"onUpdate:modelValue":K[6]||(K[6]=J=>$.value=J),placeholder:"Tag"},null,512)),[[ze,$.value]]),_e(ee)?$e((E(),D("input",{key:2,"onUpdate:modelValue":K[7]||(K[7]=J=>O.value=J),placeholder:v(n)("importDialog.translate")},null,8,mM)),[[ze,O.value]]):$e((E(),D("input",{key:3,"onUpdate:modelValue":K[8]||(K[8]=J=>O.value=J),placeholder:v(n)("importDialog.translater")},null,8,hM)),[[ze,O.value]]),_e(ee)?$e((E(),D("input",{key:4,"onUpdate:modelValue":K[9]||(K[9]=J=>W.value=J),placeholder:v(n)("danbooruManager.hot"),type:"number"},null,8,vM)),[[ze,W.value]]):Ce("",!0),_e(a.value)?$e((E(),D("input",{key:5,"onUpdate:modelValue":K[10]||(K[10]=J=>re.value=J),placeholder:v(n)("danbooruManager.aliases"),type:"number"},null,8,_M)),[[ze,re.value]]):Ce("",!0),i("button",{onClick:J=>X(F)},y(v(n)("importDialog.sureYes")),9,yM),i("button",{style:{"margin-left":"10px"},onClick:ye},y(v(n)("importDialog.cancel")),1)])):(E(),D("button",{key:1,onClick:J=>Q(F)},y(v(n)("importDialog.edit")),9,bM)),i("button",{style:{"margin-left":"10px"},onClick:J=>pe(F)},y(v(n)("importDialog.delete")),9,wM)])]))),128))])])):Ce("",!0)])):b.value.length>0?(E(),D("div",xM,[i("h3",null,y(v(n)("danbooruManager.importTitle")),1),i("div",SM,[(E(!0),D(Ke,null,lt(b.value,(ee,F)=>(E(),D("div",{key:F,style:{display:"flex","flex-direction":"column","align-items":"center"}},[_e(ee)?(E(),D("p",TM,y(ae(ee).tag)+" - "+y(ae(ee).translate)+" (热度: "+y(ae(ee).hot)+", 别名: "+y(ae(ee).aliases)+") ",1)):(E(),D("p",kM,y(fe(ee).text)+" - "+y(fe(ee).desc),1)),i("div",CM,[k.value===F?(E(),D("div",EM,[_e(ee)?$e((E(),D("input",{key:0,"onUpdate:modelValue":K[11]||(K[11]=J=>$.value=J),placeholder:"Tag"},null,512)),[[ze,$.value]]):$e((E(),D("input",{key:1,"onUpdate:modelValue":K[12]||(K[12]=J=>$.value=J),placeholder:"Tag"},null,512)),[[ze,$.value]]),_e(ee)?$e((E(),D("input",{key:2,"onUpdate:modelValue":K[13]||(K[13]=J=>O.value=J),placeholder:v(n)("importDialog.translater")},null,8,$M)),[[ze,O.value]]):$e((E(),D("input",{key:3,"onUpdate:modelValue":K[14]||(K[14]=J=>O.value=J),placeholder:v(n)("importDialog.translater")},null,8,LM)),[[ze,O.value]]),_e(ee)?$e((E(),D("input",{key:4,"onUpdate:modelValue":K[15]||(K[15]=J=>W.value=J),placeholder:v(n)("danbooruManager.hot"),type:"number"},null,8,AM)),[[ze,W.value]]):Ce("",!0),_e(a.value)?$e((E(),D("input",{key:5,"onUpdate:modelValue":K[16]||(K[16]=J=>re.value=J),placeholder:v(n)("danbooruManager.aliases"),type:"number"},null,8,MM)),[[ze,re.value]]):Ce("",!0),i("button",{onClick:K[17]||(K[17]=J=>X(te.index))},y(v(n)("importDialog.sureYes")),1),i("button",{style:{"margin-left":"10px"},onClick:ye},y(v(n)("importDialog.cancel")),1)])):(E(),D("button",{key:1,onClick:K[18]||(K[18]=J=>Q(te.index))},y(v(n)("importDialog.edit")),1)),i("button",{style:{"margin-left":"10px"},onClick:K[19]||(K[19]=J=>pe(te.index))},y(v(n)("importDialog.delete")),1)])]))),128))])])):Ce("",!0)])])]),_:1},8,["modelValue","title"])],64))}},[["__scopeId","data-v-422476cf"]]),DM={class:"danbooru-manager"},OM={class:"title"},RM={class:"action-bar"},PM={class:"search-box"},NM=["placeholder"],FM=["disabled"],BM={class:"pagination"},UM=["disabled"],zM={class:"page-info"},VM=["disabled"],WM={class:"page-size-control"},jM={key:0,class:"tag-list"},HM={style:{"table-layout":"fixed",overflow:"auto"}},GM={class:"checkbox-column"},qM=["checked"],YM={class:"tag-column"},KM={class:"translate-column"},JM={class:"color-column"},XM={class:"hot-column"},QM={class:"aliases-column"},ZM={class:"control-column"},eI=["value"],tI=["onClick"],nI=["onClick"],oI={key:1,class:"no-results"},aI={key:2,class:"weilin-tools-dialog"},rI={class:"weilin-tools-dialog-content"},iI={class:"form-group"},sI=["placeholder"],lI={class:"form-group"},uI=["placeholder"],cI={class:"form-group"},dI=["value"],pI={class:"form-group"},fI={key:0,class:"form-group"},gI={class:"weilin-tools-dialog-actions"},mI={key:3,class:"weilin-tools-dialog"},hI={class:"weilin-tools-dialog-content"},vI={class:"weilin-tools-dialog-actions"},_I={key:4,class:"weilin-tools-dialog"},yI={class:"weilin-tools-dialog-content"},bI={class:"weilin-tools-dialog-actions"},wI={key:5,class:"overlay"},xI=qt({__name:"danbooru_manager",setup(e){const{t}=Gt(),n=S(""),o=S([]),a=S(1),r=S(1),s=S(100),u=S(!1),p=S(!1),m=S(!1),f=S(!1),g=S(!1),x=S(null),b=S({tag:"",translate:"",color_id:0,hot:0,aliases:0}),k=[{name:"默认",color:"#888888"},{name:"红色",color:"#FF6666"},{name:"绿色",color:"#66FF66"},{name:"蓝色",color:"#6666FF"},{name:"黄色",color:"#FFFF66"},{name:"紫色",color:"#FF66FF"},{name:"青色",color:"#66FFFF"},{name:"橙色",color:"#FF9966"},{name:"粉色",color:"#FF99CC"},{name:"棕色",color:"#996633"}],$=X=>k[X]?k[X].color:k[0].color;let O=null;const I=()=>{O&&clearTimeout(O),O=setTimeout(()=>{a.value=1,V()},300)},V=async()=>{u.value=!0,Ae.value=[];try{const X=await Hr.searchDanbooru(n.value,a.value,s.value);X&&X.data?(o.value=X.data.data||[],r.value=X.data.total_pages||1):(o.value=[],r.value=1)}catch(X){console.error("搜索标签失败:",X),ue({type:"error",str:t("message.searchFailed")}),o.value=[]}finally{u.value=!1}},me=X=>{X<1||X>r.value||(a.value=X,V())},M=()=>{s.value<10&&(s.value=10),s.value>500&&(s.value=500),a.value=1,Ae.value=[],V()},z=()=>{g.value=!1,b.value={tag:"",translate:"",color_id:0,hot:0,aliases:0},p.value=!0},ce=X=>{g.value=!0,x.value=X,b.value={id:X.id_index,tag:X.tag,translate:X.translate||"",color_id:X.color_id||0,hot:X.hot||0,aliases:X.aliases||0},p.value=!0},P=()=>{p.value=!1},le=async()=>{if(!b.value.tag){ue({type:"error",str:t("tagManager.textRequired")});return}try{if(g.value){const X=await Hr.updateDanbooruTag({id:b.value.id,update_data:{tag:b.value.tag,translate:b.value.translate,color_id:b.value.color_id,hot:b.value.hot,aliases:b.value.aliases}});X&&X.code===200?(ue({type:"success",str:t("message.editSuccess")}),V()):ue({type:"error",str:t("message.editFailed")})}else{const X=await Hr.addDanbooruTag({tag:b.value.tag,translate:b.value.translate,color_id:b.value.color_id,hot:b.value.hot,aliases:b.value.aliases});X&&X.code===200?(ue({type:"success",str:t("message.addSuccess")}),V()):ue({type:"error",str:t("message.addFailed")})}P()}catch(X){console.error("提交表单失败:",X),ue({type:"error",str:g.value?t("message.editFailed"):t("message.addFailed")})}},ie=X=>{x.value=X,m.value=!0},Oe=async()=>{if(!(!x.value||!x.value.id_index))try{const X=await Hr.deleteDanbooruTag(x.value.id_index);X&&X.code===200?(ue({type:"success",str:t("message.deleteSuccess")}),V()):ue({type:"error",str:t("message.deleteFailed")}),m.value=!1}catch(X){console.error("删除标签失败:",X),ue({type:"error",str:t("message.deleteFailed")})}},Ae=S([]),fe=Ht(()=>o.value.length>0&&Ae.value.length===o.value.length),_e=()=>{fe.value?Ae.value=[]:Ae.value=o.value.map(X=>X.id_index)},ae=()=>{Ae.value.length!==0&&(f.value=!0)},W=async()=>{if(Ae.value.length!==0){try{const X=await Hr.batchDeleteDanbooruTags(Ae.value);X&&X.code===200?(ue({type:"success",str:`成功删除 ${Ae.value.length} 个标签`}),Ae.value=[],V()):ue({type:"error",str:"批量删除失败"})}catch(X){console.error("批量删除失败:",X),ue({type:"error",str:"批量删除失败"})}f.value=!1}},re=S(),Q=()=>{re.value.open()};return Ut(()=>{V()}),(X,ye)=>{var pe;return E(),D("div",DM,[i("h2",OM,y(v(t)("danbooruManager.title")),1),i("div",RM,[i("div",PM,[$e(i("input",{"onUpdate:modelValue":ye[0]||(ye[0]=Z=>n.value=Z),type:"text",placeholder:v(t)("danbooruManager.searchPlaceholder"),onInput:I},null,40,NM),[[ze,n.value]]),i("button",{class:"search-btn",onClick:V},y(v(t)("tagManager.search")),1)]),i("button",{class:"add-btn",onClick:z},y(v(t)("danbooruManager.add")),1),i("button",{class:"add-btn",onClick:Q},y(v(t)("tagManager.importDanbooru")),1),i("button",{class:We(["batch-delete-btn",{disabled:Ae.value.length===0}]),disabled:Ae.value.length===0,onClick:ae},y(v(t)("tagManager.hasDeleteAction"))+" ("+y(Ae.value.length)+") ",11,FM)]),i("div",BM,[i("button",{disabled:a.value<=1,onClick:ye[1]||(ye[1]=Z=>me(a.value-1)),class:"page-btn"},y(v(t)("loraManager.prevPage")),9,UM),i("span",zM,y(a.value)+" / "+y(r.value),1),i("button",{disabled:a.value>=r.value,onClick:ye[2]||(ye[2]=Z=>me(a.value+1)),class:"page-btn"},y(v(t)("loraManager.nextPage")),9,VM),i("div",WM,[i("label",null,y(v(t)("danbooruManager.pageShow")),1),$e(i("input",{"onUpdate:modelValue":ye[3]||(ye[3]=Z=>s.value=Z),type:"number",min:"10",max:"500",onChange:M,class:"page-size-input"},null,544),[[ze,s.value,void 0,{number:!0}]]),i("span",null,y(v(t)("danbooruManager.pageLimit")),1)])]),o.value.length>0?(E(),D("div",jM,[i("table",HM,[i("thead",null,[i("tr",null,[i("th",GM,[i("input",{type:"checkbox",checked:fe.value,onChange:_e},null,40,qM)]),ye[12]||(ye[12]=i("th",{class:"id-column"},"ID",-1)),i("th",YM,y(v(t)("tagManager.description")),1),i("th",KM,y(v(t)("promptBox.translate")),1),i("th",JM,y(v(t)("tagManager.backgroundColor")),1),i("th",XM,y(v(t)("danbooruManager.hot")),1),i("th",QM,y(v(t)("danbooruManager.aliases")),1),i("th",ZM,y(v(t)("danbooruManager.controle")),1)])]),i("tbody",null,[(E(!0),D(Ke,null,lt(o.value,Z=>(E(),D("tr",{key:Z.id_index},[i("td",null,[$e(i("input",{type:"checkbox",value:Z.id_index,"onUpdate:modelValue":ye[4]||(ye[4]=oe=>Ae.value=oe)},null,8,eI),[[nn,Ae.value]])]),i("td",null,y(Z.id_index),1),i("td",null,y(Z.tag),1),i("td",null,y(Z.translate),1),i("td",null,[i("div",{class:"color-box",style:Bt({backgroundColor:$(Z.color_id)})},null,4)]),i("td",null,y(Z.hot),1),i("td",null,y(Z.aliases),1),i("td",null,[i("button",{class:"edit-btn",onClick:oe=>ce(Z)},y(v(t)("common.edit")),9,tI),i("button",{style:{"margin-left":"10px"},class:"delete-btn",onClick:oe=>ie(Z)},y(v(t)("common.delete")),9,nI)])]))),128))])])])):(E(),D("div",oI,y(v(t)("tagManager.noResults")),1)),p.value?(E(),D("div",aI,[i("div",rI,[i("h3",null,y(g.value?v(t)("danbooruManager.edit"):v(t)("danbooruManager.add")),1),i("div",iI,[i("label",null,y(v(t)("tagManager.description")),1),$e(i("input",{"onUpdate:modelValue":ye[5]||(ye[5]=Z=>b.value.tag=Z),type:"text",placeholder:v(t)("tagManager.descriptionPlaceholder")},null,8,sI),[[ze,b.value.tag]])]),i("div",lI,[i("label",null,y(v(t)("promptBox.translate")),1),$e(i("input",{"onUpdate:modelValue":ye[6]||(ye[6]=Z=>b.value.translate=Z),type:"text",placeholder:v(t)("danbooruManager.translatePlaceholder")},null,8,uI),[[ze,b.value.translate]])]),i("div",cI,[i("label",null,y(v(t)("tagManager.backgroundColor")),1),$e(i("select",{"onUpdate:modelValue":ye[7]||(ye[7]=Z=>b.value.color_id=Z)},[(E(),D(Ke,null,lt(k,(Z,oe)=>i("option",{key:oe,value:oe},y(Z.name),9,dI)),64))],512),[[Tn,b.value.color_id]]),i("div",{class:"color-preview",style:Bt({backgroundColor:$(b.value.color_id)})},null,4)]),i("div",pI,[ye[13]||(ye[13]=i("label",null,"Hot",-1)),$e(i("input",{"onUpdate:modelValue":ye[8]||(ye[8]=Z=>b.value.hot=Z),type:"number",min:"0"},null,512),[[ze,b.value.hot,void 0,{number:!0}]])]),g.value?Ce("",!0):(E(),D("div",fI,[ye[14]||(ye[14]=i("label",null,"Aliases",-1)),$e(i("input",{"onUpdate:modelValue":ye[9]||(ye[9]=Z=>b.value.aliases=Z),type:"number",min:"0"},null,512),[[ze,b.value.aliases,void 0,{number:!0}]])])),i("div",gI,[i("button",{onClick:P},y(v(t)("common.cancel")),1),i("button",{onClick:le},y(v(t)("common.save")),1)])])])):Ce("",!0),m.value?(E(),D("div",mI,[i("div",hI,[i("h3",null,y(v(t)("common.confirmDelete")),1),i("p",null,y(v(t)("tagManager.deleteTagConfirm",{name:((pe=x.value)==null?void 0:pe.tag)||""})),1),i("div",vI,[i("button",{onClick:ye[10]||(ye[10]=Z=>m.value=!1)},y(v(t)("common.cancel")),1),i("button",{class:"delete-btn",onClick:Oe},y(v(t)("common.delete")),1)])])])):Ce("",!0),f.value?(E(),D("div",_I,[i("div",yI,[i("h3",null,y(v(t)("danbooruManager.sureBatchDelete")),1),i("p",null,y(v(t)("danbooruManager.sureBatchDeleteTips1"))+" "+y(Ae.value.length)+" "+y(v(t)("danbooruManager.sureBatchDeleteTips2")),1),i("div",bI,[i("button",{onClick:ye[11]||(ye[11]=Z=>f.value=!1)},y(v(t)("common.cancel")),1),i("button",{class:"delete-btn",onClick:W},y(v(t)("danbooruManager.sureDelete")),1)])])])):Ce("",!0),p.value||m.value||f.value?(E(),D("div",wI)):Ce("",!0),it(IM,{ref_key:"importDanbooruDialog",ref:re},null,512)])}}},[["__scopeId","data-v-cbcf8313"]]),SI={id:"weilin_comfyui_tools_prompt_ui_container_main"},TI={key:10,class:"version-update-notification"},kI={class:"version-update-content"},Gr="weilin_tools_",CI=qt({__name:"App",setup(e){const{t}=Gt(),n=S(localStorage.getItem("weilin_prompt_ui_floatingBallEnabled")==="true");localStorage.getItem("weilin_prompt_ui_floatingBallEnabled")||(localStorage.setItem("weilin_prompt_ui_floatingBallEnabled","true"),n.value=!0);const o=S(""),a=S("look"),r=S("manager"),s=S("prompt_global"),u=S(!1),p=`${Gr}theme`,m=S(localStorage.getItem(p)==="dark"),f=S(""),g=S(!1),x=S(""),b=S(null),k=`${Gr}version_update_remind`,$=()=>{g.value=!1,b.value&&(clearTimeout(b.value),b.value=null)},O=()=>{window.open("https://github.com/weilin9999/WeiLin-Comfyui-Tools","_blank"),$()},I=()=>{localStorage.setItem(k,"false"),$()},V={prompt:{visible:!1,is_default_close:!1,position:{x:100,y:100},size:{width:600,height:500}},tag:{visible:!1,is_default_close:!1,position:{x:150,y:150},size:{width:800,height:600}},lora:{visible:!1,is_default_close:!1,position:{x:200,y:200},size:{width:800,height:600}},history:{visible:!1,is_default_close:!1,position:{x:300,y:300},size:{width:800,height:600}},ai_window:{visible:!1,is_default_close:!1,position:{x:400,y:400},size:{width:800,height:600}},node_list_window:{visible:!1,is_default_close:!1,position:{x:100,y:100},size:{width:300,height:600}},cloud_window:{visible:!1,is_default_close:!1,position:{x:100,y:100},size:{width:800,height:600}},lora_stack_window:{visible:!1,is_default_close:!0,position:{x:100,y:100},size:{width:300,height:600}},danbooru_manager_window:{visible:!1,is_default_close:!0,position:{x:100,y:100},size:{width:800,height:600}}},me=()=>{try{const pe=localStorage.getItem(`${Gr}windowStates`);if(pe){const Z=JSON.parse(pe),oe={...V};return Object.keys(Z).forEach(be=>{be in oe&&(oe[be]={...V[be],...Z[be],visible:Z[be].is_default_close?!1:Z[be].visible})}),oe}}catch(pe){console.error("Error loading window states:",pe)}return{...V}},M=S(me());let z=null;At(M,pe=>{z&&clearTimeout(z),z=setTimeout(()=>{try{localStorage.setItem(`${Gr}windowStates`,JSON.stringify(pe))}catch(Z){console.error("Error saving window states:",Z)}z=null},500)},{deep:!0}),Ut(()=>{Object.keys(M.value).forEach(pe=>{nt.registerWindow(pe)}),ce(),window.addEventListener("message",X),ye()});const ce=()=>{let pe=localStorage.getItem(p);pe||(localStorage.setItem(p,"dark"),pe="dark",m.value=!0),m.value=pe==="dark";const Z=document.getElementById("weilin_comfyui_tools_prompt_ui_div");Z&&Z.setAttribute("data-theme",m.value?"dark":"light")};so(()=>{Object.keys(M.value).forEach(pe=>{nt.unregisterWindow(pe)}),window.removeEventListener("message",X),b.value&&(clearTimeout(b.value),b.value=null)});const P=pe=>{pe==="prompt"&&(o.value=""),M.value[pe].visible=!1},le=(pe,Z)=>{M.value[pe]&&(M.value[pe].position={...Z})},ie=(pe,Z)=>{M.value[pe]&&(M.value[pe].size={...Z})},Oe=()=>{const pe={loraDetail:{visible:!1,is_default_close:!1,position:{x:150,y:150},size:{width:800,height:600}}},Z={prompt:{visible:!1,is_default_close:!1,position:{x:100,y:100},size:{width:600,height:400}},tag:{visible:!1,is_default_close:!1,position:{x:150,y:150},size:{width:800,height:600}},lora:{visible:!1,is_default_close:!1,position:{x:200,y:200},size:{width:800,height:600}},history:{visible:!1,is_default_close:!1,position:{x:300,y:300},size:{width:800,height:600}},ai_window:{visible:!1,is_default_close:!1,position:{x:400,y:400},size:{width:800,height:600}},node_list_window:{visible:!1,is_default_close:!1,position:{x:100,y:100},size:{width:400,height:800}},cloud_window:{visible:!1,is_default_close:!1,position:{x:100,y:100},size:{width:800,height:600}},lora_stack_window:{visible:!1,is_default_close:!0,position:{x:100,y:100},size:{width:300,height:600}},danbooru_manager_window:{visible:!1,is_default_close:!0,position:{x:100,y:100},size:{width:800,height:600}}};localStorage.setItem(`${Gr}windowStates`,JSON.stringify(Z)),localStorage.setItem(`${Gr}loraDetailState`,JSON.stringify(pe)),M.value=me()};(()=>{eo.getTranslateSetting().then(pe=>{localStorage.setItem("weilin_prompt_ui_translater_setting",pe.data)}).catch(()=>{ue({type:"warn",str:"message.getTranslaterFail"})})})();const fe=S(),_e=S(),ae=S(),W=S(),re=S(),Q=(pe,Z,oe=50)=>{let be=0;const ve=()=>{be++,pe.value?Z(pe.value):be<oe?vt(ve):console.warn("[WeiLin] Ref not ready after",oe,"attempts")};vt(ve)},X=pe=>{!pe.data||!pe.data.type||pe.data.type.startsWith("weilin_prompt_ui_")&&(pe.data.type==="weilin_prompt_ui_openTagManager"?(r.value="manager",M.value.tag.visible=!0,nt.setActiveWindow("tag")):pe.data.type==="weilin_prompt_ui_openTagManager_prompt"?(r.value="prompt",M.value.tag.visible=!0,nt.setActiveWindow("tag")):pe.data.type==="weilin_prompt_ui_openPromptBox"?(o.value=pe.data.id,s.value="prompt",M.value.prompt.visible=!0,u.value=!1,pe.data.node==="WeiLinPromptUI"&&(u.value=!0),Q(fe,Z=>{Z.setPromptText(pe.data.prompt),Z.setCurrentEditNodeId(pe.data.id)}),nt.setActiveWindow("prompt")):pe.data.type==="weilin_prompt_ui_openLoraManager"?(a.value="look",M.value.lora.visible=!0,nt.setActiveWindow("lora")):pe.data.type==="weilin_prompt_ui_openLoraManager_addLora"?(a.value="addLora",M.value.lora.visible=!0,Q(ae,Z=>{Z.openSetSeed(0,"")}),nt.setActiveWindow("lora")):pe.data.type==="weilin_prompt_ui_openLoraManager_addLora_stack"?(a.value="addLora",M.value.lora.visible=!0,Q(ae,Z=>{Z.openSetSeed(1,pe.data.seed)}),nt.setActiveWindow("lora")):pe.data.type==="weilin_prompt_ui_openLoraManager_addLora_stack_node"?(a.value="addLora",M.value.lora.visible=!0,Q(ae,Z=>{Z.openSetSeed(2,pe.data.seed)}),nt.setActiveWindow("lora")):pe.data.type==="weilin_prompt_ui_openHistoryManager"?(M.value.history.visible=!0,nt.setActiveWindow("history")):pe.data.type==="weilin_prompt_ui_openAiWindow"?(M.value.ai_window.visible=!0,nt.setActiveWindow("ai_window")):pe.data.type==="weilin_prompt_ui_open_node_list_window"?(M.value.node_list_window.visible=!0,nt.setActiveWindow("node_list_window")):pe.data.type==="weilin_prompt_ui_prompt_finish_prompt"?window.postMessage({type:`weilin_prompt_ui_prompt_update_prompt_${o.value}`,data:pe.data.data},"*"):pe.data.type==="weilin_prompt_ui_open_global_prompt_box"?(s.value="prompt_global",o.value="global",M.value.prompt.visible=!0,u.value=!1,Q(fe,Z=>{Z.setPromptText(f.value)}),nt.setActiveWindow("prompt")):pe.data.type==="weilin_prompt_ui_open_global_tag_manager"?(r.value="manager",M.value.tag.visible=!0,nt.setActiveWindow("tag")):pe.data.type==="weilin_prompt_ui_open_global_lora_manager"?(a.value="look",M.value.lora.visible=!0,nt.setActiveWindow("lora")):pe.data.type==="weilin_prompt_ui_prompt_update_prompt_global"?f.value=pe.data.data:pe.data.type==="weilin_prompt_ui_floating_ball_setting"?n.value=localStorage.getItem("weilin_prompt_ui_floatingBallEnabled")==="true":pe.data.type==="weilin_prompt_ui_restore_window"?Oe():pe.data.type==="weilin_prompt_ui_open_cloud_window"?(M.value.cloud_window.visible=!0,nt.setActiveWindow("cloud_window")):pe.data.type==="weilin_prompt_ui_open_prompt_lora_stack_window"?(M.value.lora_stack_window.visible=!0,Q(_e,Z=>{Z.initLoraStack(pe.data.prompt,pe.data.seed)}),nt.setActiveWindow("lora_stack_window")):pe.data.type==="weilin_prompt_ui_open_node_lora_stack_window"?(M.value.lora_stack_window.visible=!0,Q(_e,Z=>{Z.initLoraStack(pe.data.prompt,pe.data.seed)}),nt.setActiveWindow("lora_stack_window")):pe.data.type==="weilin_prompt_ui_openLoraDetail"?Q(W,Z=>{Z.open({name:pe.data.lora})}):pe.data.type==="weilin_prompt_ui_open_danbooru_manager_window"?(M.value.danbooru_manager_window.visible=!0,nt.setActiveWindow("danbooru_manager_window")):pe.data.type==="weilin_prompt_ui_prompt_inner_get_node_tag_template_id"?window.postMessage({type:`weilin_prompt_ui_get_template_${o.value}`,data:pe.data.data},"*"):pe.data.type==="weilin_prompt_ui_get_template_response"?o.value===pe.data.id&&window.postMessage({type:"weilin_prompt_ui_prompt_inner_get_node_tag_template_id_response",data:pe.data.data},"*"):pe.data.type==="weilin_prompt_ui_prompt_inner_update_node_tag_template_id"?window.postMessage({type:`weilin_prompt_ui_update_template_${o.value}`,data:pe.data.data},"*"):pe.data.type==="weilin_prompt_ui_prompt_inner_get_node_tag_template_id_gorandom"?window.postMessage({type:`weilin_prompt_ui_get_template_go_random_${o.value}`,data:pe.data.data},"*"):pe.data.type==="weilin_prompt_ui_get_template_go_random_response"&&o.value===pe.data.id&&window.postMessage({type:"weilin_prompt_ui_prompt_inner_get_node_tag_template_id_go_random_response",data:pe.data.data},"*"))},ye=async()=>{try{if(localStorage.getItem(k)==="false"){console.info("WeiLin-Comfyui-Tools 版本更新提醒已禁用");return}const Z=await fetch("https://raw.githubusercontent.com/weilin9999/WeiLin-Comfyui-Tools/refs/heads/main/src/src/utils/version.js");if(!Z.ok){console.error("获取版本信息失败:",Z.status);return}const be=(await Z.text()).match(/export const version = "([^"]+)"/);if(be&&be[1]){const ve=be[1];console.info(`WeiLin-Comfyui-Tools GitHub版本: ${ve}`),ve!==sa&&(x.value=`WeiLin-Comfyui-Tools 发现新版本 ${ve},当前版本 ${sa}`,g.value=!0,b.value&&clearTimeout(b.value),b.value=setTimeout(()=>{g.value=!1,b.value=null},1e4),console.info(`WeiLin-Comfyui-Tools 发现新版本 ${ve},当前版本 ${sa} GitHub链接:https://github.com/weilin9999/WeiLin-Comfyui-Tools`))}}catch(pe){console.error("WeiLin-Comfyui-Tools 检查更新失败:",pe)}};return(pe,Z)=>(E(),D("div",SI,[M.value.prompt.visible?(E(),Jt(co,{key:0,name:"promptBox",title:s.value==="prompt"?v(t)("promptBox.windowTitle"):v(t)("promptBox.windowTitleGlobal"),position:M.value.prompt.position,size:M.value.prompt.size,"z-index":v(nt).getZIndex("prompt"),"onUpdate:position":Z[0]||(Z[0]=oe=>le("prompt",oe)),"onUpdate:size":Z[1]||(Z[1]=oe=>ie("prompt",oe)),onActive:Z[2]||(Z[2]=oe=>v(nt).setActiveWindow("prompt")),onClose:Z[3]||(Z[3]=oe=>P("prompt"))},{default:Pt(()=>[it(H$,{promptManager:s.value,hasPromptLoraStack:u.value,ref_key:"promptBoxRef",ref:fe},null,8,["promptManager","hasPromptLoraStack"])]),_:1},8,["title","position","size","z-index"])):Ce("",!0),M.value.tag.visible?(E(),Jt(co,{key:1,name:"tagManager",title:v(t)("tagManager.windowTitle"),position:M.value.tag.position,size:M.value.tag.size,"z-index":v(nt).getZIndex("tag"),"onUpdate:position":Z[4]||(Z[4]=oe=>le("tag",oe)),"onUpdate:size":Z[5]||(Z[5]=oe=>ie("tag",oe)),onActive:Z[6]||(Z[6]=oe=>v(nt).setActiveWindow("tag")),onClose:Z[7]||(Z[7]=oe=>P("tag"))},{default:Pt(()=>[it(sh,{tagManager:r.value},null,8,["tagManager"])]),_:1},8,["title","position","size","z-index"])):Ce("",!0),M.value.lora.visible?(E(),Jt(co,{key:2,name:"loraManager",title:v(t)("loraManager.windowTitle"),position:M.value.lora.position,size:M.value.lora.size,"z-index":v(nt).getZIndex("lora"),"onUpdate:position":Z[8]||(Z[8]=oe=>le("lora",oe)),"onUpdate:size":Z[9]||(Z[9]=oe=>ie("lora",oe)),onActive:Z[10]||(Z[10]=oe=>v(nt).setActiveWindow("lora")),onClose:Z[11]||(Z[11]=oe=>P("lora"))},{default:Pt(()=>[it(xh,{loraManager:a.value,ref_key:"loraManagerRef",ref:ae},null,8,["loraManager"])]),_:1},8,["title","position","size","z-index"])):Ce("",!0),M.value.history.visible?(E(),Jt(co,{key:3,name:"historyManager",title:v(t)("history.windowTitle"),position:M.value.history.position,size:M.value.history.size,"z-index":v(nt).getZIndex("history"),"onUpdate:position":Z[12]||(Z[12]=oe=>le("history",oe)),"onUpdate:size":Z[13]||(Z[13]=oe=>ie("history",oe)),onActive:Z[14]||(Z[14]=oe=>v(nt).setActiveWindow("history")),onClose:Z[15]||(Z[15]=oe=>P("history"))},{default:Pt(()=>[it(FL)]),_:1},8,["title","position","size","z-index"])):Ce("",!0),M.value.ai_window.visible?(E(),Jt(co,{key:4,name:"aiWindow",title:v(t)("aiWindow.windowTitle"),position:M.value.ai_window.position,size:M.value.ai_window.size,"z-index":v(nt).getZIndex("ai_window"),"onUpdate:position":Z[16]||(Z[16]=oe=>le("ai_window",oe)),"onUpdate:size":Z[17]||(Z[17]=oe=>ie("ai_window",oe)),onActive:Z[18]||(Z[18]=oe=>v(nt).setActiveWindow("ai_window")),onClose:Z[19]||(Z[19]=oe=>P("ai_window"))},{default:Pt(()=>[it(uA)]),_:1},8,["title","position","size","z-index"])):Ce("",!0),M.value.node_list_window.visible?(E(),Jt(co,{key:5,name:"nodeListWindow",title:v(t)("nodeListWindow.windowTitle"),position:M.value.node_list_window.position,size:M.value.node_list_window.size,"z-index":v(nt).getZIndex("node_list_window"),"onUpdate:position":Z[20]||(Z[20]=oe=>le("node_list_window",oe)),"onUpdate:size":Z[21]||(Z[21]=oe=>ie("node_list_window",oe)),onActive:Z[22]||(Z[22]=oe=>v(nt).setActiveWindow("node_list_window")),onClose:Z[23]||(Z[23]=oe=>P("node_list_window"))},{default:Pt(()=>[it(yA)]),_:1},8,["title","position","size","z-index"])):Ce("",!0),M.value.cloud_window.visible?(E(),Jt(co,{key:6,name:"cloudWindow",title:v(t)("cloudWindow.windowTitle"),position:M.value.cloud_window.position,size:M.value.cloud_window.size,"z-index":v(nt).getZIndex("cloud_window"),"onUpdate:position":Z[24]||(Z[24]=oe=>le("cloud_window",oe)),"onUpdate:size":Z[25]||(Z[25]=oe=>ie("cloud_window",oe)),onActive:Z[26]||(Z[26]=oe=>v(nt).setActiveWindow("cloud_window")),onClose:Z[27]||(Z[27]=oe=>P("cloud_window"))},{default:Pt(()=>[it(IA)]),_:1},8,["title","position","size","z-index"])):Ce("",!0),M.value.lora_stack_window.visible?(E(),Jt(co,{key:7,name:"loraStackWindow",title:v(t)("controls.loraStack"),position:M.value.lora_stack_window.position,size:M.value.lora_stack_window.size,"z-index":v(nt).getZIndex("lora_stack_window"),"onUpdate:position":Z[28]||(Z[28]=oe=>le("lora_stack_window",oe)),"onUpdate:size":Z[29]||(Z[29]=oe=>ie("lora_stack_window",oe)),onActive:Z[30]||(Z[30]=oe=>v(nt).setActiveWindow("lora_stack_window")),onClose:Z[31]||(Z[31]=oe=>P("lora_stack_window"))},{default:Pt(()=>[it(QA,{ref_key:"loraStackRef",ref:_e},null,512)]),_:1},8,["title","position","size","z-index"])):Ce("",!0),M.value.danbooru_manager_window.visible?(E(),Jt(co,{key:8,name:"DanbooruManagerWindow",title:v(t)("controls.danbooruManager"),position:M.value.danbooru_manager_window.position,size:M.value.danbooru_manager_window.size,"z-index":v(nt).getZIndex("danbooru_manager_window"),"onUpdate:position":Z[32]||(Z[32]=oe=>le("danbooru_manager_window",oe)),"onUpdate:size":Z[33]||(Z[33]=oe=>ie("danbooru_manager_window",oe)),onActive:Z[34]||(Z[34]=oe=>v(nt).setActiveWindow("danbooru_manager_window")),onClose:Z[35]||(Z[35]=oe=>P("danbooru_manager_window"))},{default:Pt(()=>[it(xI,{ref_key:"danbooruManagerRef",ref:re},null,512)]),_:1},8,["title","position","size","z-index"])):Ce("",!0),n.value?(E(),Jt(HL,{key:9})):Ce("",!0),it(hl,{ref_key:"loraDetailLoraStackRef",ref:W},null,512),g.value?(E(),D("div",TI,[i("div",kI,[i("span",null,y(x.value),1),i("div",{class:"version-update-actions"},[i("button",{class:"goto-github-btn",onClick:O},"前往GitHub"),i("button",{class:"no-remind-btn",onClick:I},"不再提醒"),i("button",{class:"close-version-update",onClick:$},"×")])])])):Ce("",!0)]))}},[["__scopeId","data-v-1af60f9a"]]);var _l={exports:{}};/*!
|
||
* clipboard.js v2.0.11
|
||
* https://clipboardjs.com/
|
||
*
|
||
* Licensed MIT © Zeno Rocha
|
||
*/var EI=_l.exports,$h;function $I(){return $h||($h=1,function(e,t){(function(o,a){e.exports=a()})(EI,function(){return function(){var n={686:function(r,s,u){u.d(s,{default:function(){return Z}});var p=u(279),m=u.n(p),f=u(370),g=u.n(f),x=u(817),b=u.n(x);function k(oe){try{return document.execCommand(oe)}catch{return!1}}var $=function(be){var ve=b()(be);return k("cut"),ve},O=$;function I(oe){var be=document.documentElement.getAttribute("dir")==="rtl",ve=document.createElement("textarea");ve.style.fontSize="12pt",ve.style.border="0",ve.style.padding="0",ve.style.margin="0",ve.style.position="absolute",ve.style[be?"right":"left"]="-9999px";var he=window.pageYOffset||document.documentElement.scrollTop;return ve.style.top="".concat(he,"px"),ve.setAttribute("readonly",""),ve.value=oe,ve}var V=function(be,ve){var he=I(be);ve.container.appendChild(he);var te=b()(he);return k("copy"),he.remove(),te},me=function(be){var ve=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{container:document.body},he="";return typeof be=="string"?he=V(be,ve):be instanceof HTMLInputElement&&!["text","search","url","tel","password"].includes(be==null?void 0:be.type)?he=V(be.value,ve):(he=b()(be),k("copy")),he},M=me;function z(oe){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?z=function(ve){return typeof ve}:z=function(ve){return ve&&typeof Symbol=="function"&&ve.constructor===Symbol&&ve!==Symbol.prototype?"symbol":typeof ve},z(oe)}var ce=function(){var be=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},ve=be.action,he=ve===void 0?"copy":ve,te=be.container,K=be.target,ee=be.text;if(he!=="copy"&&he!=="cut")throw new Error('Invalid "action" value, use either "copy" or "cut"');if(K!==void 0)if(K&&z(K)==="object"&&K.nodeType===1){if(he==="copy"&&K.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if(he==="cut"&&(K.hasAttribute("readonly")||K.hasAttribute("disabled")))throw new Error(`Invalid "target" attribute. You can't cut text from elements with "readonly" or "disabled" attributes`)}else throw new Error('Invalid "target" value, use a valid Element');if(ee)return M(ee,{container:te});if(K)return he==="cut"?O(K):M(K,{container:te})},P=ce;function le(oe){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?le=function(ve){return typeof ve}:le=function(ve){return ve&&typeof Symbol=="function"&&ve.constructor===Symbol&&ve!==Symbol.prototype?"symbol":typeof ve},le(oe)}function ie(oe,be){if(!(oe instanceof be))throw new TypeError("Cannot call a class as a function")}function Oe(oe,be){for(var ve=0;ve<be.length;ve++){var he=be[ve];he.enumerable=he.enumerable||!1,he.configurable=!0,"value"in he&&(he.writable=!0),Object.defineProperty(oe,he.key,he)}}function Ae(oe,be,ve){return be&&Oe(oe.prototype,be),ve&&Oe(oe,ve),oe}function fe(oe,be){if(typeof be!="function"&&be!==null)throw new TypeError("Super expression must either be null or a function");oe.prototype=Object.create(be&&be.prototype,{constructor:{value:oe,writable:!0,configurable:!0}}),be&&_e(oe,be)}function _e(oe,be){return _e=Object.setPrototypeOf||function(he,te){return he.__proto__=te,he},_e(oe,be)}function ae(oe){var be=Q();return function(){var he=X(oe),te;if(be){var K=X(this).constructor;te=Reflect.construct(he,arguments,K)}else te=he.apply(this,arguments);return W(this,te)}}function W(oe,be){return be&&(le(be)==="object"||typeof be=="function")?be:re(oe)}function re(oe){if(oe===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return oe}function Q(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function X(oe){return X=Object.setPrototypeOf?Object.getPrototypeOf:function(ve){return ve.__proto__||Object.getPrototypeOf(ve)},X(oe)}function ye(oe,be){var ve="data-clipboard-".concat(oe);if(be.hasAttribute(ve))return be.getAttribute(ve)}var pe=function(oe){fe(ve,oe);var be=ae(ve);function ve(he,te){var K;return ie(this,ve),K=be.call(this),K.resolveOptions(te),K.listenClick(he),K}return Ae(ve,[{key:"resolveOptions",value:function(){var te=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.action=typeof te.action=="function"?te.action:this.defaultAction,this.target=typeof te.target=="function"?te.target:this.defaultTarget,this.text=typeof te.text=="function"?te.text:this.defaultText,this.container=le(te.container)==="object"?te.container:document.body}},{key:"listenClick",value:function(te){var K=this;this.listener=g()(te,"click",function(ee){return K.onClick(ee)})}},{key:"onClick",value:function(te){var K=te.delegateTarget||te.currentTarget,ee=this.action(K)||"copy",F=P({action:ee,container:this.container,target:this.target(K),text:this.text(K)});this.emit(F?"success":"error",{action:ee,text:F,trigger:K,clearSelection:function(){K&&K.focus(),window.getSelection().removeAllRanges()}})}},{key:"defaultAction",value:function(te){return ye("action",te)}},{key:"defaultTarget",value:function(te){var K=ye("target",te);if(K)return document.querySelector(K)}},{key:"defaultText",value:function(te){return ye("text",te)}},{key:"destroy",value:function(){this.listener.destroy()}}],[{key:"copy",value:function(te){var K=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{container:document.body};return M(te,K)}},{key:"cut",value:function(te){return O(te)}},{key:"isSupported",value:function(){var te=arguments.length>0&&arguments[0]!==void 0?arguments[0]:["copy","cut"],K=typeof te=="string"?[te]:te,ee=!!document.queryCommandSupported;return K.forEach(function(F){ee=ee&&!!document.queryCommandSupported(F)}),ee}}]),ve}(m()),Z=pe},828:function(r){var s=9;if(typeof Element<"u"&&!Element.prototype.matches){var u=Element.prototype;u.matches=u.matchesSelector||u.mozMatchesSelector||u.msMatchesSelector||u.oMatchesSelector||u.webkitMatchesSelector}function p(m,f){for(;m&&m.nodeType!==s;){if(typeof m.matches=="function"&&m.matches(f))return m;m=m.parentNode}}r.exports=p},438:function(r,s,u){var p=u(828);function m(x,b,k,$,O){var I=g.apply(this,arguments);return x.addEventListener(k,I,O),{destroy:function(){x.removeEventListener(k,I,O)}}}function f(x,b,k,$,O){return typeof x.addEventListener=="function"?m.apply(null,arguments):typeof k=="function"?m.bind(null,document).apply(null,arguments):(typeof x=="string"&&(x=document.querySelectorAll(x)),Array.prototype.map.call(x,function(I){return m(I,b,k,$,O)}))}function g(x,b,k,$){return function(O){O.delegateTarget=p(O.target,b),O.delegateTarget&&$.call(x,O)}}r.exports=f},879:function(r,s){s.node=function(u){return u!==void 0&&u instanceof HTMLElement&&u.nodeType===1},s.nodeList=function(u){var p=Object.prototype.toString.call(u);return u!==void 0&&(p==="[object NodeList]"||p==="[object HTMLCollection]")&&"length"in u&&(u.length===0||s.node(u[0]))},s.string=function(u){return typeof u=="string"||u instanceof String},s.fn=function(u){var p=Object.prototype.toString.call(u);return p==="[object Function]"}},370:function(r,s,u){var p=u(879),m=u(438);function f(k,$,O){if(!k&&!$&&!O)throw new Error("Missing required arguments");if(!p.string($))throw new TypeError("Second argument must be a String");if(!p.fn(O))throw new TypeError("Third argument must be a Function");if(p.node(k))return g(k,$,O);if(p.nodeList(k))return x(k,$,O);if(p.string(k))return b(k,$,O);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}function g(k,$,O){return k.addEventListener($,O),{destroy:function(){k.removeEventListener($,O)}}}function x(k,$,O){return Array.prototype.forEach.call(k,function(I){I.addEventListener($,O)}),{destroy:function(){Array.prototype.forEach.call(k,function(I){I.removeEventListener($,O)})}}}function b(k,$,O){return m(document.body,k,$,O)}r.exports=f},817:function(r){function s(u){var p;if(u.nodeName==="SELECT")u.focus(),p=u.value;else if(u.nodeName==="INPUT"||u.nodeName==="TEXTAREA"){var m=u.hasAttribute("readonly");m||u.setAttribute("readonly",""),u.select(),u.setSelectionRange(0,u.value.length),m||u.removeAttribute("readonly"),p=u.value}else{u.hasAttribute("contenteditable")&&u.focus();var f=window.getSelection(),g=document.createRange();g.selectNodeContents(u),f.removeAllRanges(),f.addRange(g),p=f.toString()}return p}r.exports=s},279:function(r){function s(){}s.prototype={on:function(u,p,m){var f=this.e||(this.e={});return(f[u]||(f[u]=[])).push({fn:p,ctx:m}),this},once:function(u,p,m){var f=this;function g(){f.off(u,g),p.apply(m,arguments)}return g._=p,this.on(u,g,m)},emit:function(u){var p=[].slice.call(arguments,1),m=((this.e||(this.e={}))[u]||[]).slice(),f=0,g=m.length;for(f;f<g;f++)m[f].fn.apply(m[f].ctx,p);return this},off:function(u,p){var m=this.e||(this.e={}),f=m[u],g=[];if(f&&p)for(var x=0,b=f.length;x<b;x++)f[x].fn!==p&&f[x].fn._!==p&&g.push(f[x]);return g.length?m[u]=g:delete m[u],this}},r.exports=s,r.exports.TinyEmitter=s}},o={};function a(r){if(o[r])return o[r].exports;var s=o[r]={exports:{}};return n[r](s,s.exports,a),s.exports}return function(){a.n=function(r){var s=r&&r.__esModule?function(){return r.default}:function(){return r};return a.d(s,{a:s}),s}}(),function(){a.d=function(r,s){for(var u in s)a.o(s,u)&&!a.o(r,u)&&Object.defineProperty(r,u,{enumerable:!0,get:s[u]})}}(),function(){a.o=function(r,s){return Object.prototype.hasOwnProperty.call(r,s)}}(),a(686)}().default})}(_l)),_l.exports}var LI=$I();const AI=ug(LI),MI=e=>({toClipboard(t,n){return new Promise((o,a)=>{const r=document.createElement("button"),s=new AI(r,{text:()=>t,action:()=>"copy",container:n!==void 0?n:document.body});s.on("success",u=>{s.destroy(),o(u)}),s.on("error",u=>{s.destroy(),a(u)}),document.body.appendChild(r),r.click(),document.body.removeChild(r)})}}),II=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,DI=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,OI=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function RI(e,t){if(e==="__proto__"||e==="constructor"&&t&&typeof t=="object"&&"prototype"in t){PI(e);return}return t}function PI(e){console.warn(`[destr] Dropping "${e}" key to prevent prototype pollution.`)}function NI(e,t={}){if(typeof e!="string")return e;const n=e.trim();if(e[0]==='"'&&e.endsWith('"')&&!e.includes("\\"))return n.slice(1,-1);if(n.length<=9){const o=n.toLowerCase();if(o==="true")return!0;if(o==="false")return!1;if(o==="undefined")return;if(o==="null")return null;if(o==="nan")return Number.NaN;if(o==="infinity")return Number.POSITIVE_INFINITY;if(o==="-infinity")return Number.NEGATIVE_INFINITY}if(!OI.test(e)){if(t.strict)throw new SyntaxError("[destr] Invalid JSON");return e}try{if(II.test(e)||DI.test(e)){if(t.strict)throw new Error("[destr] Possible prototype pollution");return JSON.parse(e,RI)}return JSON.parse(e)}catch(o){if(t.strict)throw o;return e}}function FI(e,t){if(e==null)return;let n=e;for(let o=0;o<t.length;o++){if(n==null||n[t[o]]==null)return;n=n[t[o]]}return n}function Ic(e,t,n){if(n.length===0)return t;const o=n[0];return n.length>1&&(t=Ic(typeof e!="object"||e===null||!Object.prototype.hasOwnProperty.call(e,o)?Number.isInteger(Number(n[1]))?[]:{}:e[o],t,Array.prototype.slice.call(n,1))),Number.isInteger(Number(o))&&Array.isArray(e)?e.slice()[o]:Object.assign({},e,{[o]:t})}function Lh(e,t){if(e==null||t.length===0)return e;if(t.length===1){if(e==null)return e;if(Number.isInteger(t[0])&&Array.isArray(e))return Array.prototype.slice.call(e,0).splice(t[0],1);const n={};for(const o in e)n[o]=e[o];return delete n[t[0]],n}if(e[t[0]]==null){if(Number.isInteger(t[0])&&Array.isArray(e))return Array.prototype.concat.call([],e);const n={};for(const o in e)n[o]=e[o];return n}return Ic(e,Lh(e[t[0]],Array.prototype.slice.call(t,1)),[t[0]])}function Ah(e,t){return t.map(n=>n.split(".")).map(n=>[n,FI(e,n)]).filter(n=>n[1]!==void 0).reduce((n,o)=>Ic(n,o[1],o[0]),{})}function Mh(e,t){return t.map(n=>n.split(".")).reduce((n,o)=>Lh(n,o),e)}function Ih(e,{storage:t,serializer:n,key:o,debug:a,pick:r,omit:s,beforeHydrate:u,afterHydrate:p},m,f=!0){try{f&&(u==null||u(m));const g=t.getItem(o);if(g){const x=n.deserialize(g),b=r?Ah(x,r):x,k=s?Mh(b,s):b;e.$patch(k)}f&&(p==null||p(m))}catch(g){a&&console.error("[pinia-plugin-persistedstate]",g)}}function Dh(e,{storage:t,serializer:n,key:o,debug:a,pick:r,omit:s}){try{const u=r?Ah(e,r):e,p=s?Mh(u,s):u,m=n.serialize(p);t.setItem(o,m)}catch(u){a&&console.error("[pinia-plugin-persistedstate]",u)}}function BI(e,t,n){const{pinia:o,store:a,options:{persist:r=n}}=e;if(!r)return;if(!(a.$id in o.state.value)){const p=o._s.get(a.$id.replace("__hot:",""));p&&Promise.resolve().then(()=>p.$persist());return}const u=(Array.isArray(r)?r:r===!0?[{}]:[r]).map(t);a.$hydrate=({runHooks:p=!0}={})=>{u.forEach(m=>{Ih(a,m,e,p)})},a.$persist=()=>{u.forEach(p=>{Dh(a.$state,p)})},u.forEach(p=>{Ih(a,p,e),a.$subscribe((m,f)=>Dh(f,p),{detached:!0})})}function UI(e={}){return function(t){BI(t,n=>({key:(e.key?e.key:o=>o)(n.key??t.store.$id),debug:n.debug??e.debug??!1,serializer:n.serializer??e.serializer??{serialize:o=>JSON.stringify(o),deserialize:o=>NI(o)},storage:n.storage??e.storage??window.localStorage,beforeHydrate:n.beforeHydrate,afterHydrate:n.afterHydrate,pick:n.pick,omit:n.omit}),e.auto??!1)}}var zI=UI();const{toClipboard:VI}=MI(),Dc=document.createElement("div");Dc.id="weilin_comfyui_tools_prompt_ui_div",document.querySelector("body").appendChild(Dc);const Oh=I2();Oh.use(zI);const yl=m_(CI);yl.use(Oh),yl.use(Fi),cb(),yl.config.globalProperties.$copyText=VI,yl.mount(Dc),console.log(`WeiLin Prompt UI is running - version ${sa}`),console.log(`WeiLin 节点插件已运行 - 版本 ${sa}`);const WI=new MutationObserver(e=>{e.forEach(t=>{const n=document.querySelectorAll("#weilin-hidden-weight");if(n.length>0)for(const o of n){const a=o.closest(".lg-node-widget");a.style.display="none"}})}),jI={childList:!0,subtree:!0};WI.observe(document.body,jI)});
|
||
//# sourceMappingURL=main.entry.js.map
|