astrbot_plugin_imagestudio/pages/imagestudio/assets/index-BZ25rUbw.js

58 行
663 KiB
JavaScript

var Ow=Object.defineProperty;var Dw=(e,n,o)=>n in e?Ow(e,n,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[n]=o;var mc=(e,n,o)=>Dw(e,typeof n!="symbol"?n+"":n,o);(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const d of document.querySelectorAll('link[rel="modulepreload"]'))r(d);new MutationObserver(d=>{for(const v of d)if(v.type==="childList")for(const p of v.addedNodes)p.tagName==="LINK"&&p.rel==="modulepreload"&&r(p)}).observe(document,{childList:!0,subtree:!0});function o(d){const v={};return d.integrity&&(v.integrity=d.integrity),d.referrerPolicy&&(v.referrerPolicy=d.referrerPolicy),d.crossOrigin==="use-credentials"?v.credentials="include":d.crossOrigin==="anonymous"?v.credentials="omit":v.credentials="same-origin",v}function r(d){if(d.ep)return;d.ep=!0;const v=o(d);fetch(d.href,v)}})();/**
* @vue/shared v3.5.39
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**/function ov(e){const n=Object.create(null);for(const o of e.split(","))n[o]=1;return o=>o in n}const jt={},br=[],Gn=()=>{},hm=()=>!1,ju=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Vu=e=>e.startsWith("onUpdate:"),xa=Object.assign,iv=(e,n)=>{const o=e.indexOf(n);o>-1&&e.splice(o,1)},Ww=Object.prototype.hasOwnProperty,qt=(e,n)=>Ww.call(e,n),tt=Array.isArray,_r=e=>ws(e)==="[object Map]",xr=e=>ws(e)==="[object Set]",Mp=e=>ws(e)==="[object Date]",bt=e=>typeof e=="function",sa=e=>typeof e=="string",bn=e=>typeof e=="symbol",Ot=e=>e!==null&&typeof e=="object",$m=e=>(Ot(e)||bt(e))&&bt(e.then)&&bt(e.catch),Cm=Object.prototype.toString,ws=e=>Cm.call(e),Uw=e=>ws(e).slice(8,-1),Sm=e=>ws(e)==="[object Object]",rv=e=>sa(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,os=ov(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Ku=e=>{const n=Object.create(null);return(o=>n[o]||(n[o]=e(o)))},Fw=/-\w/g,gn=Ku(e=>e.replace(Fw,n=>n.slice(1).toUpperCase())),jw=/\B([A-Z])/g,ci=Ku(e=>e.replace(jw,"-$1").toLowerCase()),Im=Ku(e=>e.charAt(0).toUpperCase()+e.slice(1)),gc=Ku(e=>e?`on${Im(e)}`:""),Kn=(e,n)=>!Object.is(e,n),Su=(e,...n)=>{for(let o=0;o<e.length;o++)e[o](...n)},Pm=(e,n,o,r=!1)=>{Object.defineProperty(e,n,{configurable:!0,enumerable:!1,writable:r,value:o})},Gu=e=>{const n=parseFloat(e);return isNaN(n)?e:n},Vw=e=>{const n=sa(e)?Number(e):NaN;return isNaN(n)?e:n};let Rp;const zu=()=>Rp||(Rp=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function va(e){if(tt(e)){const n={};for(let o=0;o<e.length;o++){const r=e[o],d=sa(r)?Hw(r):va(r);if(d)for(const v in d)n[v]=d[v]}return n}else if(sa(e)||Ot(e))return e}const Kw=/;(?![^(]*\))/g,Gw=/:([^]+)/,zw=/\/\*[^]*?\*\//g;function Hw(e){const n={};return e.replace(zw,"").split(Kw).forEach(o=>{if(o){const r=o.split(Gw);r.length>1&&(n[r[0].trim()]=r[1].trim())}}),n}function de(e){let n="";if(sa(e))n=e;else if(tt(e))for(let o=0;o<e.length;o++){const r=de(e[o]);r&&(n+=r+" ")}else if(Ot(e))for(const o in e)e[o]&&(n+=o+" ");return n.trim()}const Qw="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",Jw=ov(Qw);function xm(e){return!!e||e===""}function Yw(e,n){if(e.length!==n.length)return!1;let o=!0;for(let r=0;o&&r<e.length;r++)o=si(e[r],n[r]);return o}function si(e,n){if(e===n)return!0;let o=Mp(e),r=Mp(n);if(o||r)return o&&r?e.getTime()===n.getTime():!1;if(o=bn(e),r=bn(n),o||r)return e===n;if(o=tt(e),r=tt(n),o||r)return o&&r?Yw(e,n):!1;if(o=Ot(e),r=Ot(n),o||r){if(!o||!r)return!1;const d=Object.keys(e).length,v=Object.keys(n).length;if(d!==v)return!1;for(const p in e){const y=e.hasOwnProperty(p),b=n.hasOwnProperty(p);if(y&&!b||!y&&b||!si(e[p],n[p]))return!1}}return String(e)===String(n)}function sv(e,n){return e.findIndex(o=>si(o,n))}const Am=e=>!!(e&&e.__v_isRef===!0),s=e=>sa(e)?e:e==null?"":tt(e)||Ot(e)&&(e.toString===Cm||!bt(e.toString))?Am(e)?s(e.value):JSON.stringify(e,Mm,2):String(e),Mm=(e,n)=>Am(n)?Mm(e,n.value):_r(n)?{[`Map(${n.size})`]:[...n.entries()].reduce((o,[r,d],v)=>(o[yc(r,v)+" =>"]=d,o),{})}:xr(n)?{[`Set(${n.size})`]:[...n.values()].map(o=>yc(o))}:bn(n)?yc(n):Ot(n)&&!tt(n)&&!Sm(n)?String(n):n,yc=(e,n="")=>{var o;return bn(e)?`Symbol(${(o=e.description)!=null?o:n})`:e};/**
* @vue/reactivity v3.5.39
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**/let ja;class Xw{constructor(n=!1){this.detached=n,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!n&&ja&&(ja.active?(this.parent=ja,this.index=(ja.scopes||(ja.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let n,o;if(this.scopes)for(n=0,o=this.scopes.length;n<o;n++)this.scopes[n].pause();for(n=0,o=this.effects.length;n<o;n++)this.effects[n].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let n,o;if(this.scopes)for(n=0,o=this.scopes.length;n<o;n++)this.scopes[n].resume();for(n=0,o=this.effects.length;n<o;n++)this.effects[n].resume()}}run(n){if(this._active){const o=ja;try{return ja=this,n()}finally{ja=o}}}on(){++this._on===1&&(this.prevScope=ja,ja=this)}off(){if(this._on>0&&--this._on===0){if(ja===this)ja=this.prevScope;else{let n=ja;for(;n;){if(n.prevScope===this){n.prevScope=this.prevScope;break}n=n.prevScope}}this.prevScope=void 0}}stop(n){if(this._active){this._active=!1;let o,r;for(o=0,r=this.effects.length;o<r;o++)this.effects[o].stop();for(this.effects.length=0,o=0,r=this.cleanups.length;o<r;o++)this.cleanups[o]();if(this.cleanups.length=0,this.scopes){for(o=0,r=this.scopes.length;o<r;o++)this.scopes[o].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!n){const d=this.parent.scopes.pop();d&&d!==this&&(this.parent.scopes[this.index]=d,d.index=this.index)}this.parent=void 0}}}function Zw(){return ja}let Qt;const bc=new WeakSet;class Rm{constructor(n){this.fn=n,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,ja&&(ja.active?ja.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,bc.has(this)&&(bc.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||Em(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Bp(this),Nm(this);const n=Qt,o=yn;Qt=this,yn=!0;try{return this.fn()}finally{Lm(this),Qt=n,yn=o,this.flags&=-3}}stop(){if(this.flags&1){for(let n=this.deps;n;n=n.nextDep)cv(n);this.deps=this.depsTail=void 0,Bp(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?bc.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Wc(this)&&this.run()}get dirty(){return Wc(this)}}let Bm=0,is,rs;function Em(e,n=!1){if(e.flags|=8,n){e.next=rs,rs=e;return}e.next=is,is=e}function uv(){Bm++}function dv(){if(--Bm>0)return;if(rs){let n=rs;for(rs=void 0;n;){const o=n.next;n.next=void 0,n.flags&=-9,n=o}}let e;for(;is;){let n=is;for(is=void 0;n;){const o=n.next;if(n.next=void 0,n.flags&=-9,n.flags&1)try{n.trigger()}catch(r){e||(e=r)}n=o}}if(e)throw e}function Nm(e){for(let n=e.deps;n;n=n.nextDep)n.version=-1,n.prevActiveLink=n.dep.activeLink,n.dep.activeLink=n}function Lm(e){let n,o=e.depsTail,r=o;for(;r;){const d=r.prevDep;r.version===-1?(r===o&&(o=d),cv(r),ek(r)):n=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=d}e.deps=n,e.depsTail=o}function Wc(e){for(let n=e.deps;n;n=n.nextDep)if(n.dep.version!==n.version||n.dep.computed&&(Tm(n.dep.computed)||n.dep.version!==n.version))return!0;return!!e._dirty}function Tm(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===vs)||(e.globalVersion=vs,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Wc(e))))return;e.flags|=2;const n=e.dep,o=Qt,r=yn;Qt=e,yn=!0;try{Nm(e);const d=e.fn(e._value);(n.version===0||Kn(d,e._value))&&(e.flags|=128,e._value=d,n.version++)}catch(d){throw n.version++,d}finally{Qt=o,yn=r,Lm(e),e.flags&=-3}}function cv(e,n=!1){const{dep:o,prevSub:r,nextSub:d}=e;if(r&&(r.nextSub=d,e.prevSub=void 0),d&&(d.prevSub=r,e.nextSub=void 0),o.subs===e&&(o.subs=r,!r&&o.computed)){o.computed.flags&=-5;for(let v=o.computed.deps;v;v=v.nextDep)cv(v,!0)}!n&&!--o.sc&&o.map&&o.map.delete(o.key)}function ek(e){const{prevDep:n,nextDep:o}=e;n&&(n.nextDep=o,e.prevDep=void 0),o&&(o.prevDep=n,e.nextDep=void 0)}let yn=!0;const qm=[];function zn(){qm.push(yn),yn=!1}function Hn(){const e=qm.pop();yn=e===void 0?!0:
* @vue/runtime-core v3.5.39
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**/function ks(e,n,o,r){try{return r?e(...r):e()}catch(d){Qu(d,n,o)}}function tn(e,n,o,r){if(bt(e)){const d=ks(e,n,o,r);return d&&$m(d)&&d.catch(v=>{Qu(v,n,o)}),d}if(tt(e)){const d=[];for(let v=0;v<e.length;v++)d.push(tn(e[v],n,o,r));return d}}function Qu(e,n,o,r=!0){const d=n?n.vnode:null,{errorHandler:v,throwUnhandledErrorInProduction:p}=n&&n.appContext.config||jt;if(n){let y=n.parent;const b=n.proxy,k=`https://vuejs.org/error-reference/#runtime-${o}`;for(;y;){const w=y.ec;if(w){for(let $=0;$<w.length;$++)if(w[$](e,b,k)===!1)return}y=y.parent}if(v){zn(),ks(v,null,10,[e,b,k]),Hn();return}}Ik(e,o,d,r,p)}function Ik(e,n,o,r=!0,d=!1){if(d)throw e;console.error(e)}const il=[];let Fn=-1;const wr=[];let ii=null,yr=0;const Gm=Promise.resolve();let Eu=null;function ra(e){const n=Eu||Gm;return e?n.then(this?e.bind(this):e):n}function Pk(e){let n=Fn+1,o=il.length;for(;n<o;){const r=n+o>>>1,d=il[r],v=ps(d);v<e||v===e&&d.flags&2?n=r+1:o=r}return n}function yv(e){if(!(e.flags&1)){const n=ps(e),o=il[il.length-1];!o||!(e.flags&2)&&n>=ps(o)?il.push(e):il.splice(Pk(n),0,e),e.flags|=1,zm()}}function zm(){Eu||(Eu=Gm.then(Qm))}function xk(e){tt(e)?wr.push(...e):ii&&e.id===-1?ii.splice(yr+1,0,e):e.flags&1||(wr.push(e),e.flags|=1),zm()}function Np(e,n,o=Fn+1){for(;o<il.length;o++){const r=il[o];if(r&&r.flags&2){if(e&&r.id!==e.uid)continue;il.splice(o,1),o--,r.flags&4&&(r.flags&=-2),r(),r.flags&4||(r.flags&=-2)}}}function Hm(e){if(wr.length){const n=[...new Set(wr)].sort((o,r)=>ps(o)-ps(r));if(wr.length=0,ii){ii.push(...n);return}for(ii=n,yr=0;yr<ii.length;yr++){const o=ii[yr];o.flags&4&&(o.flags&=-2),o.flags&8||o(),o.flags&=-2}ii=null,yr=0}}const ps=e=>e.id==null?e.flags&2?-1:1/0:e.id;function Qm(e){try{for(Fn=0;Fn<il.length;Fn++){const n=il[Fn];n&&!(n.flags&8)&&(n.flags&4&&(n.flags&=-2),ks(n,n.i,n.i?15:14),n.flags&4||(n.flags&=-2))}}finally{for(;Fn<il.length;Fn++){const n=il[Fn];n&&(n.flags&=-2)}Fn=-1,il.length=0,Hm(),Eu=null,(il.length||wr.length)&&Qm()}}let za=null,Jm=null;function Nu(e){const n=za;return za=e,Jm=e&&e.type.__scopeId||null,n}function Zt(e,n=za,o){if(!n||e._n)return e;const r=(...d)=>{r._d&&qu(-1);const v=Nu(n);let p;try{p=e(...d)}finally{Nu(v),r._d&&qu(1)}return p};return r._n=!0,r._c=!0,r._d=!0,r}function Se(e,n){if(za===null)return e;const o=td(za),r=e.dirs||(e.dirs=[]);for(let d=0;d<n.length;d++){let[v,p,y,b=jt]=n[d];v&&(bt(v)&&(v={mounted:v,updated:v}),v.deep&&bo(p),r.push({dir:v,instance:o,value:p,oldValue:void 0,arg:y,modifiers:b}))}return e}function Li(e,n,o,r){const d=e.dirs,v=n&&n.dirs;for(let p=0;p<d.length;p++){const y=d[p];v&&(y.oldValue=v[p].value);let b=y.dir[r];b&&(zn(),tn(b,o,8,[e.el,y,e,n]),Hn())}}function Ak(e,n){if(rl){let o=rl.provides;const r=rl.parent&&rl.parent.provides;r===o&&(o=rl.provides=Object.create(r)),o[e]=n}}function Iu(e,n,o=!1){const r=ed();if(r||hr){let d=hr?hr._context.provides:r?r.parent==null||r.ce?r.vnode.appContext&&r.vnode.appContext.provides:r.parent.provides:void 0;if(d&&e in d)return d[e];if(arguments.length>1)return o&&bt(n)?n.call(r&&r.proxy):n}}const Mk=Symbol.for("v-scx"),Rk=()=>Iu(Mk);function dt(e,n,o){return Ym(e,n,o)}function Ym(e,n,o=jt){const{immediate:r,deep:d,flush:v,once:p}=o,y=xa({},o),b=n&&r||!n&&v!=="post";let k;if(bs){if(v==="sync"){const I=Rk();k=I.__watcherHandles||(I.__watcherHandles=[])}else if(!b){const I=()=>{};return I.stop=Gn,I.resume=Gn,I.pause=Gn,I}}const w=rl;y.call=(I,N,L)=>tn(I,w,N,L);let $=!1;v==="post"?y.scheduler=I=>{_l(I,w&&w.suspense)}:v!=="sync"&&($=!0,y.scheduler=(I,N)=>{N?I():yv(I)}),y.augmentJob=I=>{n&&(I.flags|=4),$&&(I.flags|=2,w&&(I.id=w.uid,I.i=w))};const M=Sk(e,n,y);return bs&&(k?k.push(M):b&&M()),M}function Bk(e,n,o){const r=this.proxy,d=sa(e)?e.includes(".")?Xm(r,e):()=>r[e]:e.bind(r,r);let v;bt(n)?v=n:(v=n.handler,o=n);const p=hs(this),y=Ym(d,v.bind(r),o);return p(),y}function Xm(e,n){const o=n.split(".");return()=>{let r=e;for(let d=0;d<o.length&&r;d++)r=r[o[d]];return r}}const Ek=Symbol("_vte"),Zm=e=>e.__isTeleport,Yl=Symbol("_leaveCb"),Yr=Symbol("_enterCb");function eg(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingV
* @vue/runtime-dom v3.5.39
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**/let Jc;const Qp=typeof window<"u"&&window.trustedTypes;if(Qp)try{Jc=Qp.createPolicy("vue",{createHTML:e=>e})}catch{}const Rg=Jc?e=>Jc.createHTML(e):e=>e,Eh="http://www.w3.org/2000/svg",Nh="http://www.w3.org/1998/Math/MathML",po=typeof document<"u"?document:null,Jp=po&&po.createElement("template"),Lh={insert:(e,n,o)=>{n.insertBefore(e,o||null)},remove:e=>{const n=e.parentNode;n&&n.removeChild(e)},createElement:(e,n,o,r)=>{const d=n==="svg"?po.createElementNS(Eh,e):n==="mathml"?po.createElementNS(Nh,e):o?po.createElement(e,{is:o}):po.createElement(e);return e==="select"&&r&&r.multiple!=null&&d.setAttribute("multiple",r.multiple),d},createText:e=>po.createTextNode(e),createComment:e=>po.createComment(e),setText:(e,n)=>{e.nodeValue=n},setElementText:(e,n)=>{e.textContent=n},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>po.querySelector(e),setScopeId(e,n){e.setAttribute(n,"")},insertStaticContent(e,n,o,r,d,v){const p=o?o.previousSibling:n.lastChild;if(d&&(d===v||d.nextSibling))for(;n.insertBefore(d.cloneNode(!0),o),!(d===v||!(d=d.nextSibling)););else{Jp.innerHTML=Rg(r==="svg"?`<svg>${e}</svg>`:r==="mathml"?`<math>${e}</math>`:e);const y=Jp.content;if(r==="svg"||r==="mathml"){const b=y.firstChild;for(;b.firstChild;)y.appendChild(b.firstChild);y.removeChild(b)}n.insertBefore(y,o)}return[p?p.nextSibling:n.firstChild,o?o.previousSibling:n.lastChild]}},ai="transition",Xr="animation",Sr=Symbol("_vtc"),Bg={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},Eg=xa({},tg,Bg),Th=e=>(e.displayName="Transition",e.props=Eg,e),Ma=Th((e,{slots:n})=>Rh(Lk,Ng(e),n)),qi=(e,n=[])=>{tt(e)?e.forEach(o=>o(...n)):e&&e(...n)},Yp=e=>e?tt(e)?e.some(n=>n.length>1):e.length>1:!1;function Ng(e){const n={};for(const K in e)K in Bg||(n[K]=e[K]);if(e.css===!1)return n;const{name:o="v",type:r,duration:d,enterFromClass:v=`${o}-enter-from`,enterActiveClass:p=`${o}-enter-active`,enterToClass:y=`${o}-enter-to`,appearFromClass:b=v,appearActiveClass:k=p,appearToClass:w=y,leaveFromClass:$=`${o}-leave-from`,leaveActiveClass:M=`${o}-leave-active`,leaveToClass:I=`${o}-leave-to`}=e,N=qh(d),L=N&&N[0],H=N&&N[1],{onBeforeEnter:G,onEnter:Q,onEnterCancelled:ee,onLeave:ve,onLeaveCancelled:oe,onBeforeAppear:ye=G,onAppear:Z=Q,onAppearCancelled:D=ee}=n,E=(K,be,te,ae)=>{K._enterCancelled=ae,ni(K,be?w:y),ni(K,be?k:p),te&&te()},h=(K,be)=>{K._isLeaving=!1,ni(K,$),ni(K,I),ni(K,M),be&&be()},F=K=>(be,te)=>{const ae=K?Z:Q,z=()=>E(be,K,te);qi(ae,[be,z]),Xp(()=>{ni(be,K?b:v),Un(be,K?w:y),Yp(ae)||Zp(be,r,L,z)})};return xa(n,{onBeforeEnter(K){qi(G,[K]),Un(K,v),Un(K,p)},onBeforeAppear(K){qi(ye,[K]),Un(K,b),Un(K,k)},onEnter:F(!1),onAppear:F(!0),onLeave(K,be){K._isLeaving=!0;const te=()=>h(K,be);Un(K,$),K._enterCancelled?(Un(K,M),Yc(K)):(Yc(K),Un(K,M)),Xp(()=>{K._isLeaving&&(ni(K,$),Un(K,I),Yp(ve)||Zp(K,r,H,te))}),qi(ve,[K,te])},onEnterCancelled(K){E(K,!1,void 0,!0),qi(ee,[K])},onAppearCancelled(K){E(K,!0,void 0,!0),qi(D,[K])},onLeaveCancelled(K){h(K),qi(oe,[K])}})}function qh(e){if(e==null)return null;if(Ot(e))return[Cc(e.enter),Cc(e.leave)];{const n=Cc(e);return[n,n]}}function Cc(e){return Vw(e)}function Un(e,n){n.split(/\s+/).forEach(o=>o&&e.classList.add(o)),(e[Sr]||(e[Sr]=new Set)).add(n)}function ni(e,n){n.split(/\s+/).forEach(r=>r&&e.classList.remove(r));const o=e[Sr];o&&(o.delete(n),o.size||(e[Sr]=void 0))}function Xp(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let Oh=0;function Zp(e,n,o,r){const d=e._endId=++Oh,v=()=>{d===e._endId&&r()};if(o!=null)return setTimeout(v,o);const{type:p,timeout:y,propCount:b}=Lg(e,n);if(!p)return r();const k=p+"end";let w=0;const $=()=>{e.removeEventListener(k,M),v()},M=I=>{I.target===e&&++w>=b&&$()};setTimeout(()=>{w<b&&$()},y+1),e.addEventListener(k,M)}function Lg(e,n){const o=window.getComputedStyle(e),r=N=>(o[N]||"").split(", "),d=r(`${ai}Delay`),v=r(`${ai}Duration`),p=em(d,v
`)}function p(M,I){const N=Array.from(new Set(I.replace(/,/g,",").split(/[\n,]/).map(L=>L.trim()).filter(Boolean)));r("update:modelValue",{...o.modelValue,[M]:N})}function y(M,I){r("update:modelValue",{...o.modelValue,[M]:I})}const b=A(()=>d("group_allowlist").length),k=A(()=>d("user_allowlist").length),w=A(()=>d("adult_group_allowlist").length),$=A(()=>d("adult_user_allowlist").length);return(M,I)=>(u(),c("section",fA,[I[24]||(I[24]=kv('<div class="intro" data-v-1ac2e616><span data-v-1ac2e616>AstrBot 聊天指令</span><strong data-v-1ac2e616>群聊与用户白名单</strong><p data-v-1ac2e616>每行填写一个平台提供的群聊 ID 或用户 ID,也支持用逗号分隔。白名单为空时不会放行对应条件。</p></div><div class="rules" data-v-1ac2e616><article data-v-1ac2e616><b data-v-1ac2e616>快速角色 / 角色工作流</b><strong data-v-1ac2e616>群聊命中 + 用户命中</strong><p data-v-1ac2e616>两个白名单必须同时命中才允许使用,避免群内未授权成员启动完整工作流。</p></article><article data-v-1ac2e616><b data-v-1ac2e616>单图生成</b><strong data-v-1ac2e616>群聊命中 或 用户命中</strong><p data-v-1ac2e616>任意一个白名单命中即可使用;用户白名单也可以在私聊中放行单图。</p></article></div>',2)),t("div",pA,[t("label",null,[t("span",null,[I[10]||(I[10]=st("群聊白名单 ",-1)),t("em",null,s(b.value)+" 项",1)]),t("textarea",{value:v("group_allowlist"),disabled:e.disabled,rows:"10",placeholder:`每行一个群聊 ID
例如:123456789`,onInput:I[0]||(I[0]=N=>p("group_allowlist",N.target.value))},null,40,mA),I[11]||(I[11]=t("small",null,"用于判断命令所在群聊是否获得授权。",-1))]),t("label",null,[t("span",null,[I[12]||(I[12]=st("用户白名单 ",-1)),t("em",null,s(k.value)+" 项",1)]),t("textarea",{value:v("user_allowlist"),disabled:e.disabled,rows:"10",placeholder:`每行一个用户 ID
例如:987654321`,onInput:I[1]||(I[1]=N=>p("user_allowlist",N.target.value))},null,40,gA),I[13]||(I[13]=t("small",null,"使用 AstrBot 事件返回的平台用户 ID,不使用昵称。",-1))])]),I[25]||(I[25]=t("div",{class:"adult-intro"},[t("div",null,[t("span",null,"成人内容独立授权"),t("strong",null,"必须同时通过内容审核与成人白名单")]),t("p",null,"这些名单不会放宽恐怖主义、高危暴力、现实伤害或其他禁止内容。群聊内要求成人群聊与成人用户同时命中;私聊要求成人用户命中。")],-1)),t("div",yA,[t("label",null,[t("span",null,[I[14]||(I[14]=st("成人内容群聊白名单 ",-1)),t("em",null,s(w.value)+" 项",1)]),t("textarea",{value:v("adult_group_allowlist"),disabled:e.disabled,rows:"6",placeholder:"每行一个允许成人路由的群聊 ID",onInput:I[2]||(I[2]=N=>p("adult_group_allowlist",N.target.value))},null,40,bA),I[15]||(I[15]=t("small",null,"仅影响通过审核的 adult_allowed 内容。",-1))]),t("label",null,[t("span",null,[I[16]||(I[16]=st("成人内容用户白名单 ",-1)),t("em",null,s($.value)+" 项",1)]),t("textarea",{value:v("adult_user_allowlist"),disabled:e.disabled,rows:"6",placeholder:"每行一个允许成人路由的用户 ID",onInput:I[3]||(I[3]=N=>p("adult_user_allowlist",N.target.value))},null,40,_A),I[17]||(I[17]=t("small",null,"不会继承普通用户白名单,必须单独授权。",-1))])]),t("div",wA,[t("label",null,[I[18]||(I[18]=t("span",null,"用户并发上限",-1)),t("input",{type:"number",min:"1",value:Number(e.modelValue.user_concurrency_limit||2),disabled:e.disabled,onInput:I[4]||(I[4]=N=>y("user_concurrency_limit",Number(N.target.value)))},null,40,kA)]),t("label",null,[I[19]||(I[19]=t("span",null,"群聊并发上限",-1)),t("input",{type:"number",min:"1",value:Number(e.modelValue.group_concurrency_limit||5),disabled:e.disabled,onInput:I[5]||(I[5]=N=>y("group_concurrency_limit",Number(N.target.value)))},null,40,hA)]),t("label",null,[I[20]||(I[20]=t("span",null,"用户每日生成上限",-1)),t("input",{type:"number",min:"1",value:Number(e.modelValue.daily_user_generation_limit||30),disabled:e.disabled,onInput:I[6]||(I[6]=N=>y("daily_user_generation_limit",Number(N.target.value)))},null,40,$A)]),t("label",null,[I[21]||(I[21]=t("span",null,"群聊每日生成上限",-1)),t("input",{type:"number",min:"1",value:Number(e.modelValue.daily_group_generation_limit||100),disabled:e.disabled,onInput:I[7]||(I[7]=N=>y("daily_group_generation_limit",Number(N.target.value)))},null,40,CA)]),t("label",SA,[t("input",{type:"checkbox",checked:e.modelValue.allow_2k!==!1,disabled:e.disabled,onChange:I[8]||(I[8]=N=>y("allow_2k",N.target.checked))},null,40,IA),I[22]||(I[22]=t("span",null,"允许聊天使用 2K",-1))]),t("label",PA,[t("input",{type:"checkbox",checked:e.modelValue.allow_4k===!0,disabled:e.disabled,onChange:I[9]||(I[9]=N=>y("allow_4k",N.target.checked))},null,40,xA),I[23]||(I[23]=t("span",null,"允许聊天使用 4K",-1))])])]))}}),MA=Nt(AA,[["__scopeId","data-v-1ac2e616"]]),RA={class:"governance"},BA={class:"preview-card"},EA=["disabled"],NA={class:"preview-choice"},LA={key:1,class:"preview-error"},TA={key:2,class:"preview-result"},qA={class:"card"},OA={class:"switch"},DA=["checked","disabled"],WA={class:"route-pair source-pair"},UA=["value","disabled"],FA=["value"],jA=["value"],VA=["value","disabled"],KA=["value"],GA=["value"],zA={class:"grid"},HA=["value","disabled"],QA={class:"entries"},JA=["checked","disabled","onChange"],YA={class:"card"},XA={class:"switch"},ZA=["checked","disabled"],eM={class:"route-pair source-pair"},tM=["value","disabled"],aM=["value"],lM=["value"],nM=["value","disabled"],oM=["value"],iM=["value"],rM={class:"grid"},sM=["value","disabled"],uM={class:"card routing"},dM={class:"switch"},cM=["checked","disabled"],vM={class:"route-pair"},fM=["value","disabled"],pM=["value"],mM=["value","disabled"],gM=["value"],yM={class:"entries"},bM=["checked","disabled","onChange"],_M={class:"card"},wM={class:"switch"},kM=["checked","disabled"],hM={class:"route-pair source-pair"},$M=["value","disabled
`)}function nc(a){const l=wt.value,i=Xe.value;return{source:"standalone_web_workflow_chat",ui_node_id:rt.value,ui_node_title:l.title,ui_node_phase:l.phase,ui_node_status:l.status,profile_id:i.profileId,profile_name:i.name,workflow_id:i.workflowId,source_language:"auto",target_prompt_language:"en",translation_mode:"backend_llm",user_instruction:a,persona_split_fields_ready:Hs.value,persona_split_fields_total:zs.value,selected_material_ids:Kd(),selected_draft_image_ids:xl.value.filter(Ml).map(f=>f.image_id),candidate_feedback:ma.value}}function X_(a){var m;const l=a.interpretation;if(!l)return"候选反馈已保存。";const i=[],f=[["喜欢",l.liked],["拒绝",l.rejected],["严格拒绝",l.strict_rejected]];for(const[g,C]of f)C.length&&i.push(`${g} ${C.map(T=>T.display_code).join("、")}`);return(m=l.final)!=null&&m.display_code&&i.push(`待定稿 ${l.final.display_code}`),l.positive_patch&&i.push("已生成正向调整"),l.negative_patch&&i.push("已生成负向约束"),l.material_intent&&i.push(`素材意图:${l.material_intent}`),i.length?i.join(";"):"下一轮调整要求已保存。"}async function Ff(a){var i,f,m;const l=It.value;if(!Ia.value||!l||l.legacy||!l.candidates.length)return"not_applicable";if(Ks.value)return q.value="该轮次已经确认;如需继续修改,请先从当前节点创建分支。","blocked";nt.value=!0,q.value="",He.value="";try{const g=await Me(U.roundFeedback(l.round.round_id),{feedback_text:a,idempotency_key:`web-round-feedback-text-${l.round.round_id}-${Date.now()}`});Jo(l.round.node_id,g);const C=X_(g);return He.value=`${C} 点击“开始新一轮”后会使用这些反馈。`,Ve.value=C,Co.value=a,So.value=(f=(i=g.interpretation)==null?void 0:i.metadata)!=null&&f.model_route?`候选反馈 / ${String(g.interpretation.metadata.model_route)}`:`候选反馈 / ${((m=g.interpretation)==null?void 0:m.source)||"确定性解释"}`,$a.value="","saved"}catch(g){return q.value=`候选反馈理解失败:${ze(g)}`,Ve.value=q.value,"failed"}finally{nt.value=!1}}async function Z_(){const a=$a.value.trim();if(!a||nt.value||await Ff(a)!=="not_applicable")return;if(Ia.value&&!Vo.value.route){Ve.value="当前节点和后端默认均未提供生图路由,请先显式覆盖或前往设置配置。";return}await fu({promptPatch:lc(a),metadata:nc(a)})&&(Co.value=a,So.value=`${wt.value.title} / ${Cd.value||"后端自动"}`)}function jf(){!Da.value||!La(Da.value)||(Rs.value="generation",Rl("imageViewer"),ic(),Bo.value=!0)}function cu(a){const l=(a?Bd.value.find(i=>i.image_id===a):null)??Bn.value;!l||!La(l)||(Ra.value=!1,Ut.value=l.image_id,jf())}function Vf(){xl.value.length<2||(Ra.value=!0)}function e1(a){return{configure_distinct_generation_cross_review_routes:"请在设置页配置至少一个与主候选不同的生图模型",configure_image_generation_route:"请先配置并启用可用的生图模型路由",regenerate_primary_candidate_with_configured_route:"主候选缺少可复用的模型路由,请先重新生成主候选",retry_or_remove_failed_review_candidate:"当前审查轮次存在失败候选,请重试失败项后再继续",select_review_candidates:"请至少勾选一个需要重新生成的审查候选",open_active_cross_review:"该节点已有进行中的交叉审查,请打开当前审查轮次",create_branch:"当前节点已锁定或工作流已封存,请先创建可编辑分支"}[a]||a.replace(/_/g," ")}function vu(a,l){const i=ze(a),f=a instanceof Ka?De(a.details,"required_action"):"";return f?`${i};建议操作:${e1(f)}。`:`${l}:${i}`}async function t1(){var i;const a=It.value;if(!a||a.legacy||!Ia.value)return;const l=a.round.round_id;el.value=!0,In.value="";try{const f=await Be(U.round(l));if(((i=It.value)==null?void 0:i.round.round_id)!==l)return;Jo(f.round.node_id,f,{select:!0}),sn.value=f,bi.value=!0}catch(f){q.value=vu(f,"交叉审查轮次加载失败")}finally{el.value=!1}}function a1(){el.value||(bi.value=!1,In.value="")}function l1(a){var i;const l=(i=a.image)==null?void 0:i.image_id;l&&cu(l)}function oc(a){Jo(a.round.node_id,a,{select:!0}),sn.value=a,
${m.trim()}`).join(`
`)}function y1(a){const l=Ei(a),i=(...g)=>{for(const C of g){const T=l.find(re=>oi(re.node_key)===C);if(T!=null&&T.selected_image_id)return T.selected_image_id}return""},f={avatar:i("headshot"),persona_image:i("design_sheet","turnaround"),standing:i("full_body"),pv:i("style_lock")},m=Object.entries(f).filter(([,g])=>!g).map(([g])=>g);if(m.length){const g={avatar:"头像(头像草稿)",persona_image:"人设图(设定图或三视图)",standing:"立绘(全身设定)",pv:"PV 图(高清修复与统一风格)"};return Ve.value=`档案卡还缺少已明确采用的资产:${m.map(C=>g[C]).join("、")}。请回到对应节点确认一张候选图。`,null}return f}function b1(a){if(!(a instanceof Ka))return`档案卡封存失败:${ze(a)}`;const l=[],i=a.details.incomplete_node_keys;Array.isArray(i)&&i.length&&l.push(`未完成节点:${i.map(String).join("、")}`);const f=De(a.details,"asset_role");f&&l.push(`资产角色:${f}`);const m=De(a.details,"active_branch")||De(a.details,"branch_name");m&&l.push(`当前分支:${m}`);const g=De(a.details,"status");g&&l.push(`工作流状态:${g}`);const C=l.length?`(${l.join(";")})`:"";return`档案卡封存失败:${a.message}${C}`}async function _1(){const a=Xe.value;if(!a||nt.value)return;const l=Xt("建立档案卡");if(l){Ve.value=l;return}if(!a.workflowId||!a.profileId){Ve.value="请先保存角色并创建详细角色工作流,再建立档案卡。";return}const i=a.workflowId,f=At.value[i],m=(f==null?void 0:f.current_branch)||"main",g=y1(i);if(!g)return;const C=g1(a);if(!C){Ve.value="档案卡缺少人设文档,请先完成角色设定拆解。";return}const T={idempotency_key:`web-profile-card-${i}-${au(m)}`,persona_document:C,assets:g,metadata:{source:"standalone_web_profile_card",schema_version:"character_profile_card_v1",profile_id:a.profileId,profile_name:a.name,workflow_id:i,branch_name:m,selected_material_ids:Kd()}};nt.value=!0,Ve.value="";try{const re=await Me(U.workflowFinalizeCard(i),T);Ar.value={...Ar.value,[a.profileId]:[re,...(Ar.value[a.profileId]??[]).filter(Re=>Re.card_id!==re.card_id)]},xo.value=re.created_at,await pu(a,i,"archive");const[me]=await Promise.allSettled([Be(U.profileCards(a.profileId)),Od(),tl(),pl()]);me.status==="fulfilled"&&(Ar.value={...Ar.value,[a.profileId]:me.value}),Nn("archive"),Ve.value=`档案卡已原子封存:${yl(re.card_id)} / ${re.branch_name},4 类必填资产均已入库。`}catch(re){Ve.value=b1(re)}finally{nt.value=!1}}async function sc(a){const l=Xe.value,i=l==null?void 0:l.workflowId;if(!i||cl.value)return;const f=a==="start"?"启动":a==="cancel"?"取消":"归档";if(a==="start"&&!js.value){Sn.value="请先在第一个节点导入粗略人设;导入成功后工作流会自动启动。";return}if(!(a!=="start"&&!window.confirm(`确定${f}当前工作流吗?`))){cl.value=!0,Sn.value="";try{const m=a==="start"?U.workflowStart(i):a==="cancel"?U.workflowCancel(i):U.workflowArchive(i),g=await Me(m);At.value={...At.value,[i]:g},Sn.value=`工作流已${f}`}catch(m){Sn.value=ze(m)}finally{cl.value=!1}}}async function w1(){var l;const a=(l=Xe.value)==null?void 0:l.workflowId;if(a){cl.value=!0;try{Xa.value=await Be(U.workflowReview(a)),Sn.value="整体审查已完成"}catch(i){Sn.value=ze(i)}finally{cl.value=!1}}}async function Yf(){var i;const a=(i=vt.value)==null?void 0:i.node_id;if(!a)return;cl.value=!0;const l=await Zd(a,!0);Sn.value=l?"依赖上下文已刷新":Ca.value,cl.value=!1}function Hr(a){return fl.value?`${a}暂不可用:${no.value}`:Rn.value?`${a}已被锁定:${Go.value}`:""}function k1(a){return`branch_${(a.node_key||a.node_id).replace(/[^a-zA-Z0-9_-]+/g,"_").slice(0,28)}_${Date.now().toString(36)}`}async function Xf(a,l,i,f={}){const m=await Me(U.workflowSwitchBranch(l),{branch_name:i}),g=await Be(U.workflowNodes(l)),C=g.filter(me=>me.branch_name===m.current_branch);xt.value={...xt.value,[l]:g},At.value={...At.value,[l]:m},Bi(a,m,C.length?C:g);const T=(f.copiedFromNodeId?C.find(me=>De(me.metadata,"copied_from_node_id")===f.copiedFromNodeId):void 0)??(f.preferredUiNodeId?C
`)}}function mu(a,l,i,f,m){return{id:a,title:l,prompt:i,negative:f,weight_suggestions:[{label:"identity",value:1.25,reason:"keep character identity stable"},{label:"style",value:.85,reason:"avoid overfitting style over identity"}],inherits:m,status:"ready"}}function L1(a){const l=Pl.value,i=v.map((f,m)=>{const g=l.find(C=>C.category===f.category);return{id:`rule_${f.category}_${m+1}`,category:f.category,material_id:Vd(g==null?void 0:g.id),material_label:(g==null?void 0:g.label)??"",material_group:(g==null?void 0:g.group)??(g==null?void 0:g.category)??"",material_prompt:(g==null?void 0:g.prompt)??"",material_colors:(g==null?void 0:g.colors)??[],bind_to_stages:tp(f.category),inheritance_rule:g?`${f.category} only affects explicitly bound downstream stages.`:"do not use reference unless user explicitly selects one",reference_strength:g?ap(f.category):"弱",required:!!(g&&["风格","服装"].includes(f.category)),status:g?"ready":"pending"}});return{profile_id:a.profileId,profile_name:a.name,selected_material_ids:Kd(),rules:i}}function tp(a){return{风格:[{stage_id:"portrait-draft",stage_title:"头像草稿"},{stage_id:"halfbody-draft",stage_title:"半身草稿"},{stage_id:"body-sheet",stage_title:"全身与设定图"},{stage_id:"review-archive",stage_title:"修复入库"}],构图:[{stage_id:"portrait-draft",stage_title:"头像草稿"},{stage_id:"body-sheet",stage_title:"全身与设定图"}],服装:[{stage_id:"halfbody-draft",stage_title:"半身草稿"},{stage_id:"body-sheet",stage_title:"全身与设定图"}],鞋袜:[{stage_id:"body-sheet",stage_title:"全身与设定图"}],配饰:[{stage_id:"body-sheet",stage_title:"全身与设定图"},{stage_id:"review-archive",stage_title:"修复入库"}]}[a]??[{stage_id:"body-sheet",stage_title:"全身与设定图"}]}function ap(a){return a==="风格"||a==="服装"?"强":a==="构图"?"中":"弱"}async function T1(){var i;const a=Xe.value;if(!a||Po.value)return;const l=Xt("保存快照");if(l){hn.value=l;return}if(!a.workflowId){hn.value="请先生成档案并创建后端工作流,再保存快照。";return}Po.value=!0,hn.value="";try{const f=await Me(U.workflowHistory(a.workflowId),{action:"save_version",title:`${a.name} / ${((i=wt.value)==null?void 0:i.title)??"工作流快照"}`,node_id:Yo(rt.value,a),include_nodes:!0,metadata:{source:"standalone_web",ui_node_id:rt.value,profile_id:a.profileId,profile_name:a.name,profile_status:a.status}});xo.value=f.created_at}catch(f){hn.value=`保存快照失败:${ze(f)}`}finally{Po.value=!1}}function Yo(a,l){if(!l.workflowId)return;const f=Ei(l.workflowId).find(g=>pn(g)===a);if(f)return f.node_id;const m=l.workflowNodeIds??[];if(a!=="brief-import"&&a==="persona-split")return m[0]}function Ei(a){var f;const l=xt.value[a]??[],i=(f=At.value[a])==null?void 0:f.current_branch;return i?l.filter(m=>m.branch_name===i):l}function q1(a){const l=Qs.value;if(l&&(!a||l.node_id===a))return[l.image_id];if(!a)return[];const i=(ea.value[a]??[]).find(f=>{var m;return f.image_id===((m=Mn.value.find(g=>g.node_id===a))==null?void 0:m.selected_image_id)});return i&&Ml(i)?[i.image_id]:[]}function Ml(a){const l="metadata"in a&&a.metadata&&typeof a.metadata=="object"?a.metadata:{},i=l.mock===!0||l.mock===1||l.mock==="true",f=Object.prototype.hasOwnProperty.call(l,"provider_error")&&l.provider_error!=null,m=l.fallback_used===!0||l.degraded===!0;return!i&&!f&&!m}async function O1(){if(!Ov.value||Xn.value)return;const a=Xt("生成档案");if(a){on.value=a;return}mi.value+=1;const l=j1(Ue.value,mi.value);Xn.value=!0,on.value="";try{const i=await Me(U.quickProfileDraft,D1(l,Ue.value,Ja.value)),f={...l,name:i.profile_preview.name||l.name,style:i.profile_preview.style_prompt||l.style,negative:i.profile_preview.negative_prompt||l.negative},m=await Me(U.quickProfileDraftSave,W1(f,Ue.value,Ja.value,i)),C={...U1(m,f),status:"文本档案已保存"};Ya.value=[C,...Ya.value.filter(T=>T.id!==C.id)],ga.value=[m.profile,...ga.value.filter(T=>T.profile_id!==m.profile.profile_id)],ua.value={...ua.value,[m.profile.profile_id]:m.workflow?[m.workflow]:[]},nu(C),it.value="quickProfile"
<svg xmlns="http://www.w3.org/2000/svg" width="${kt}" height="${Ke}" viewBox="0 0 ${kt} ${Ke}" preserveAspectRatio="xMidYMid meet">
<defs>
<linearGradient id="bg" x1="0" y1="0" x2="1" y2="1">
<stop offset="0%" stop-color="${g}" />
<stop offset="58%" stop-color="${C}" />
<stop offset="100%" stop-color="#111827" />
</linearGradient>
<radialGradient id="halo" cx="72%" cy="22%" r="55%">
<stop offset="0%" stop-color="${T}" stop-opacity="0.82" />
<stop offset="100%" stop-color="${T}" stop-opacity="0" />
</radialGradient>
<pattern id="grid" width="${Tt}" height="${Tt}" patternUnits="userSpaceOnUse">
<path d="M${Tt} 0H0V${Tt}" fill="none" stroke="#ffffff" stroke-opacity="0.13" stroke-width="2" />
</pattern>
</defs>
<rect width="${kt}" height="${Ke}" fill="url(#bg)" />
<rect width="${kt}" height="${Ke}" fill="url(#grid)" />
<circle cx="${Tn}" cy="${ei}" r="${qn}" fill="url(#halo)" />
<circle cx="${ti}" cy="${On}" r="${B}" fill="#ffffff" opacity="0.11" />
<rect x="${zt}" y="${zt}" width="${Kl}" height="${Fa}" rx="${ll}" fill="#ffffff" opacity="0.14" />
<rect x="${_a}" y="${_a}" width="${ml}" height="${Gl}" rx="${Math.round(ll*.72)}" fill="#0f172a" opacity="0.24" />
<text x="${_a+Math.round(ht*.035)}" y="${Pa}" fill="#ffffff" opacity="0.72" font-family="Inter, Microsoft YaHei, sans-serif" font-size="${wa}" font-weight="700">IMAGESTUDIO · 未生成 ${re}</text>
<text x="${_a+Math.round(ht*.035)}" y="${nl}" fill="#ffffff" font-family="Inter, Microsoft YaHei, sans-serif" font-size="${W}" font-weight="800">${me}</text>
<text x="${_a+Math.round(ht*.035)}" y="${Wa}" fill="#ffffff" opacity="0.78" font-family="Inter, Microsoft YaHei, sans-serif" font-size="${mt}">${Re}</text>
<text x="${qe}" y="${Pa+Math.round(ht*.02)}" text-anchor="middle" fill="#ffffff" opacity="0.86" font-family="Inter, Microsoft YaHei, sans-serif" font-size="${Ua}" font-weight="900">${re}</text>
<text x="${kt-zt}" y="${Ke-Math.round(zt*.35)}" text-anchor="end" fill="#ffffff" opacity="0.72" font-family="Inter, Microsoft YaHei, sans-serif" font-size="${Math.max(18,Math.round(ht*.027))}" font-weight="800">${Te}</text>
</svg>`;return`data:image/svg+xml;charset=UTF-8,${encodeURIComponent(Et)}`}function Pp(a){return a.replace(/[&<>"']/g,l=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&apos;"})[l]??l)}function al(a){return"title"in a&&a.title?a.title:a.node_id||a.workflow_id||a.profile_id||yl(a.image_id)}function La(a){return Vl(a.thumbnail_url)||Vl(a.image_url)}function Vl(a){const l=String(a||"").trim();if(!l)return"";const i=Aw(l);if(!i)return l;const f=se.value[l];if(f)return f;if(!pe.has(l)){const m=Mw(l,i).finally(()=>{pe.delete(l)});pe.set(l,m)}return Cu()==="plugin-bridge"?"":l}function Aw(a){var l;try{const i=new URL(a,window.location.origin);return i.pathname.endsWith("/media/fetch")&&((l=i.searchParams.get("token"))==null?void 0:l.trim())||""}catch{return""}}async function Mw(a,l){try{const i=await Be(U.mediaPayload,{token:l}),f=String(i.body_base64||"");if(!f)return;const m=f.replace(/-/g,"+").replace(/_/g,"/"),g=m.padEnd(Math.ceil(m.length/4)*4,"="),C=window.atob(g),T=new Uint8Array(C.length);for(let me=0;me<C.length;me+=1)T[me]=C.charCodeAt(me);const re=URL.createObjectURL(new Blob([T],{type:i.content_type||"application/octet-stream"}));xe.add(re),se.value={...se.value,[a]:re}}catch(i){console.warn("ImageStudio media bridge failed",i)}}function Rw(a){if(a.status==="confirmed_unsupported")return!1;if(a.dialect==="openai_images"||a.dialect==="comfyui")return!0;const l=a.capabilities||{};return!!(l.text_to_image||l.image_generation||l.workflow_graph||Object.keys(l).some(i=>["text_to_image","image_generation","workflow_graph"].includes(i)))}function Bw(a,l,i){return Math.max(l,Math.min(i,a))}function Ew(){try{const a=localStorage.getItem(Fl.theme);(a==="light"||a==="dark")&&(Pn.value=a),Mo.value=localStorage.getItem(Fl.primary)||Mo.value,Ro.value=localStorage.getItem(Fl.accent)||Ro.value;const l=localStorage.getItem(Fl.navigationPinned);dn.value=l===null||l==="true",Dl.value=xp(localStorage.getItem(Fl.readNotifications)),Yi.value=xp(localStorage.getItem(Fl.dismissedNotifications))}catch{}Qi.value=dn.value}function Nw(){try{localStorage.setItem(Fl.theme,Pn.value),localStorage.setItem(Fl.primary,Mo.value),localStorage.setItem(Fl.accent,Ro.value),localStorage.setItem(Fl.navigationPinned,String(dn.value)),localStorage.setItem(Fl.readNotifications,JSON.stringify(Dl.value)),localStorage.setItem(Fl.dismissedNotifications,JSON.stringify(Yi.value))}catch{}}function xp(a){if(!a)return[];try{const l=JSON.parse(a);return Array.isArray(l)?l.filter(i=>typeof i=="string"):[]}catch{return[]}}function co(a,l){const i=pc(a);return i?`rgba(${i.r}, ${i.g}, ${i.b}, ${l})`:`rgba(118, 104, 232, ${l})`}function vc(a,l,i){const f=pc(a),m=pc(l);if(!f||!m)return a;const g=Math.min(1,Math.max(0,i));return`#${fc(f.r*(1-g)+m.r*g)}${fc(f.g*(1-g)+m.g*g)}${fc(f.b*(1-g)+m.b*g)}`}function fc(a){return Math.round(a).toString(16).padStart(2,"0")}function pc(a){const l=a.replace("#","");return/^[0-9a-fA-F]{6}$/.test(l)?{r:Number.parseInt(l.slice(0,2),16),g:Number.parseInt(l.slice(2,4),16),b:Number.parseInt(l.slice(4,6),16)}:null}function De(a,l){const i=a==null?void 0:a[l];return typeof i=="string"?i:""}function Lw(a){return!ca(a)||typeof a.task_id!="string"?null:{task_id:a.task_id,task_type:typeof a.task_type=="string"?a.task_type:"generation",status:typeof a.status=="string"?a.status:"created",progress:typeof a.progress=="number"?a.progress:0,created_at:typeof a.created_at=="string"?a.created_at:"",updated_at:typeof a.updated_at=="string"?a.updated_at:"",profile_id:typeof a.profile_id=="string"?a.profile_id:null,workflow_id:typeof a.workflow_id=="string"?a.workflow_id:null,node_id:typeof a.node_id=="string"?a.node_id:null,model_route:typeof a.model_route=="string"?a.model_route:null,idempotency_key:typeof a.idempotency_key=="string"?a.idempotency_key:null,request:ca(a.request)?a.request:void 0,result:ca(a.result)?a.result:void 0,metadata:ca(a.metadata)?a.metadata:void 0,error_message:typeof a.error_message=="string"?a.error_message:null}}function Tw(a){return!!a}function ca(a){return!!(a&&typeof a=="object"&&!Array.isArray(a))}function qw(a){return bl(a,
身份:近未来港区巡查员\r
性格:冷静、可靠、行动快\r
外观:黑色短发,青绿色眼睛\r
服装:轻机能外套、短靴、发光臂章\r
避雷:低质量、结构错误`},null,512),[[Qe,nn.value]])]),t("aside",W9,[t("header",null,[t("div",null,[l[165]||(l[165]=t("span",null,"识别预览",-1)),t("strong",null,s(ey.value)+" / "+s(fd.value.length),1)]),t("em",null,s(er.value?`${er.value.length} 字`:"待粘贴"),1)]),t("dl",null,[(u(!0),c(X,null,ie(fd.value,B=>(u(),c("div",{key:B.key,class:de({pending:er.value&&!B.recognized})},[t("dt",null,[st(s(B.label)+" ",1),t("span",null,s(B.recognized?"已识别":"待整理"),1)]),t("dd",null,s(B.value||"粘贴文本后显示"),1)],2))),128))])])]),t("footer",null,[t("span",null,s(er.value?"识别结果会先填入问卷,仍可在问卷里继续微调。":"等待外部角色卡文本。"),1),t("button",{type:"button",onClick:l[36]||(l[36]=B=>ba("externalProfileImport"))},"取消"),t("button",{type:"button",disabled:!er.value,onClick:G1}," 识别并填入问卷 ",8,U9)])])])):V("",!0)]),_:1}),ct(Ma,{name:"viewer-fade"},{default:Zt(()=>[Yn.value?(u(),c("div",F9,[t("section",j9,[t("header",null,[l[166]||(l[166]=t("div",null,[t("span",null,"快速角色"),t("strong",null,"创建角色档案问卷")],-1)),t("button",{type:"button",title:"关闭",onClick:l[37]||(l[37]=B=>ba("personaQuestionnaire"))},"×")]),t("div",V9,[t("label",null,[l[167]||(l[167]=t("span",null,"角色核心",-1)),Se(t("textarea",{"onUpdate:modelValue":l[38]||(l[38]=B=>Ue.value.roleCore=B),rows:"3",placeholder:"角色名、身份、核心定位,可以只写一句。"},null,512),[[Qe,Ue.value.roleCore]])]),t("label",K9,[l[169]||(l[169]=t("span",null,"性别表现",-1)),Se(t("select",{"onUpdate:modelValue":l[39]||(l[39]=B=>Ue.value.genderPresentation=B)},[...l[168]||(l[168]=[t("option",{value:""},"未指定",-1),t("option",{value:"female"},"女性 / Female",-1),t("option",{value:"male"},"男性 / Male",-1),t("option",{value:"androgynous"},"中性 / Androgynous",-1),t("option",{value:"nonbinary"},"非二元 / Nonbinary",-1)])],512),[[Ta,Ue.value.genderPresentation]])]),t("label",G9,[l[170]||(l[170]=t("span",null,"年龄阶段",-1)),Se(t("input",{"onUpdate:modelValue":l[40]||(l[40]=B=>Ue.value.ageStage=B),type:"text",placeholder:"例如 adult、young adult、middle-aged"},null,512),[[Qe,Ue.value.ageStage]])]),t("label",z9,[l[171]||(l[171]=t("span",null,"物种 / 种族",-1)),Se(t("input",{"onUpdate:modelValue":l[41]||(l[41]=B=>Ue.value.species=B),type:"text",placeholder:"例如 human、elf、android"},null,512),[[Qe,Ue.value.species]])]),t("label",H9,[l[172]||(l[172]=t("span",null,"体型",-1)),Se(t("input",{"onUpdate:modelValue":l[42]||(l[42]=B=>Ue.value.bodyType=B),type:"text",placeholder:"例如 slim、athletic、muscular"},null,512),[[Qe,Ue.value.bodyType]])]),t("label",null,[l[173]||(l[173]=t("span",null,"显著特征",-1)),Se(t("textarea",{"onUpdate:modelValue":l[43]||(l[43]=B=>Ue.value.distinctiveFeatures=B),rows:"3",placeholder:"伤疤、异色瞳、义体、角、纹身或固定视觉记忆点。"},null,512),[[Qe,Ue.value.distinctiveFeatures]])]),t("label",null,[l[174]||(l[174]=t("span",null,"性格关键词",-1)),Se(t("textarea",{"onUpdate:modelValue":l[44]||(l[44]=B=>Ue.value.personality=B),rows:"3",placeholder:"外显性格、内在矛盾、行动方式。"},null,512),[[Qe,Ue.value.personality]])]),t("label",null,[l[175]||(l[175]=t("span",null,"外观特征",-1)),Se(t("textarea",{"onUpdate:modelValue":l[45]||(l[45]=B=>Ue.value.appearance=B),rows:"3",placeholder:"发色、发型、眼睛、五官和视觉记忆点。"},null,512),[[Qe,Ue.value.appearance]])]),t("label",null,[l[176]||(l[176]=t("span",null,"服装与配饰",-1)),Se(t("textarea",{"onUpdate:modelValue":l[46]||(l[46]=B=>Ue.value.outfit=B),rows:"3",placeholder:"服装风格、配饰、武器或随身物。"},null,512),[[Qe,Ue.value.outfit]])]),t("label",null,[l[177]||(l[177]=t("span",null,"常用场景",-1)),Se(t("textarea",{"onUpdate:modelValue":l[47]||(l[47]=B=>Ue.value.scene=B),rows:"3",placeholder:"常驻地点、画面背景、适合出现的环境。"},null,512),[[Qe,Ue.value.scene]])]),t("label",null,[l[178]||(l[178]=t("span",null,"避雷内容",-1)),Se(t("textarea",{"onUpd