@inpageedit/core 0.4.0 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.umd.js CHANGED
@@ -1,29 +1,55 @@
1
- (function(ce,ye){typeof exports=="object"&&typeof module<"u"?ye(exports):typeof define=="function"&&define.amd?define(["exports"],ye):(ce=typeof globalThis<"u"?globalThis:ce||self,ye(ce.InPageEditBundle={}))})(this,function(ce){"use strict";var Sb=Object.defineProperty;var Gu=ce=>{throw TypeError(ce)};var Eb=(ce,ye,Ie)=>ye in ce?Sb(ce,ye,{enumerable:!0,configurable:!0,writable:!0,value:Ie}):ce[ye]=Ie;var te=(ce,ye,Ie)=>Eb(ce,typeof ye!="symbol"?ye+"":ye,Ie),No=(ce,ye,Ie)=>ye.has(ce)||Gu("Cannot "+Ie);var Ju=(ce,ye,Ie)=>(No(ce,ye,"read from private field"),Ie?Ie.call(ce):ye.get(ce)),jo=(ce,ye,Ie)=>ye.has(ce)?Gu("Cannot add the same private member more than once"):ye instanceof WeakSet?ye.add(ce):ye.set(ce,Ie),Qu=(ce,ye,Ie,ne)=>(No(ce,ye,"write to private field"),ne?ne.call(ce,Ie):ye.set(ce,Ie),Ie),Mi=(ce,ye,Ie)=>(No(ce,ye,"access private method"),Ie);var ct,An,ln,In,Tn,Rn,Dn,Pe,tt,Kt,Xu,Zu,ef,br;const ye=()=>{let t,e;return{promise:new Promise((r,i)=>{t=r,e=i}),resolve:t,reject:e}};Promise.withResolvers||(Promise.withResolvers=ye);var Ie=Object.defineProperty,ne=(t,e)=>Ie(t,"name",{value:e,configurable:!0});function tf(){}ne(tf,"noop");function Ce(t){return t==null}ne(Ce,"isNullable");function nf(t){return!Ce(t)}ne(nf,"isNonNullable");function Sr(t){return t&&typeof t=="object"&&!Array.isArray(t)}ne(Sr,"isPlainObject");function Lo(t,e){return Object.fromEntries(Object.entries(t).filter(([n,r])=>e(n,r)))}ne(Lo,"filterKeys");function Ot(t,e){return Object.fromEntries(Object.entries(t).map(([n,r])=>[n,e(r,n)]))}ne(Ot,"mapValues");function Mo(t,e,n){if(!e)return{...t};const r={};for(const i of e)(n||t[i]!==void 0)&&(r[i]=t[i]);return r}ne(Mo,"pick");function rf(t,e){if(!e)return{...t};const n={...t};for(const r of e)Reflect.deleteProperty(n,r);return n}ne(rf,"omit");function Be(t,e,n){return Object.defineProperty(t,e,{writable:!0,value:n,enumerable:!1})}ne(Be,"defineProperty");function sf(t,e){return e.every(n=>t.includes(n))}ne(sf,"contain");function of(t,e){return t.filter(n=>e.includes(n))}ne(of,"intersection");function af(t,e){return t.filter(n=>!e.includes(n))}ne(af,"difference");function lf(t,e){return Array.from(new Set([...t,...e]))}ne(lf,"union");function cf(t){return[...new Set(t)]}ne(cf,"deduplicate");function jt(t,e){const n=t?.indexOf(e);return n>=0?(t.splice(n,1),!0):!1}ne(jt,"remove");function uf(t){return Array.isArray(t)?t:Ce(t)?[]:[t]}ne(uf,"makeArray");function Lt(t,e){return arguments.length===1?n=>Lt(t,n):t in globalThis&&e instanceof globalThis[t]||Object.prototype.toString.call(e).slice(8,-1)===t}ne(Lt,"is");function Un(t){return Lt("ArrayBuffer",t)||Lt("SharedArrayBuffer",t)}ne(Un,"isArrayBufferLike");function Fo(t){return Un(t)||ArrayBuffer.isView(t)}ne(Fo,"isArrayBufferSource");var pt;(t=>{t.is=Un,t.isSource=Fo;function e(o){return ArrayBuffer.isView(o)?o.buffer.slice(o.byteOffset,o.byteOffset+o.byteLength):o}t.fromSource=e,ne(e,"fromSource");function n(o){if(typeof Buffer<"u")return Buffer.from(o).toString("base64");let a="";const l=new Uint8Array(o);for(let u=0;u<l.byteLength;u++)a+=String.fromCharCode(l[u]);return btoa(a)}t.toBase64=n,ne(n,"toBase64");function r(o){return typeof Buffer<"u"?e(Buffer.from(o,"base64")):Uint8Array.from(atob(o),a=>a.charCodeAt(0))}t.fromBase64=r,ne(r,"fromBase64");function i(o){return typeof Buffer<"u"?Buffer.from(o).toString("hex"):Array.from(new Uint8Array(o),a=>a.toString(16).padStart(2,"0")).join("")}t.toHex=i,ne(i,"toHex");function s(o){if(typeof Buffer<"u")return e(Buffer.from(o,"hex"));const a=o.length%2===0?o:o.slice(0,o.length-1),l=[];for(let u=0;u<a.length;u+=2)l.push(parseInt(`${a[u]}${a[u+1]}`,16));return Uint8Array.from(l).buffer}t.fromHex=s,ne(s,"fromHex")})(pt||(pt={})),pt.fromBase64,pt.toBase64,pt.fromHex,pt.toHex;function Er(t,e=new Map){if(!t||typeof t!="object")return t;if(Lt("Date",t))return new Date(t.valueOf());if(Lt("RegExp",t))return new RegExp(t.source,t.flags);if(Un(t))return t.slice(0);if(ArrayBuffer.isView(t))return t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength);const n=e.get(t);if(n)return n;if(Array.isArray(t)){const i=[];return e.set(t,i),t.forEach((s,o)=>{i[o]=Reflect.apply(Er,null,[s,e])}),i}const r=Object.create(Object.getPrototypeOf(t));e.set(t,r);for(const i of Reflect.ownKeys(t)){const s={...Reflect.getOwnPropertyDescriptor(t,i)};"value"in s&&(s.value=Reflect.apply(Er,null,[s.value,e])),Reflect.defineProperty(r,i,s)}return r}ne(Er,"clone");function Qt(t,e,n){if(t===e||!n&&Ce(t)&&Ce(e))return!0;if(typeof t!=typeof e||typeof t!="object"||!t||!e)return!1;function r(i,s){return i(t)?i(e)?s(t,e):!1:i(e)?!1:void 0}return ne(r,"check"),r(Array.isArray,(i,s)=>i.length===s.length&&i.every((o,a)=>Qt(o,s[a])))??r(Lt("Date"),(i,s)=>i.valueOf()===s.valueOf())??r(Lt("RegExp"),(i,s)=>i.source===s.source&&i.flags===s.flags)??r(Un,(i,s)=>{if(i.byteLength!==s.byteLength)return!1;const o=new Uint8Array(i),a=new Uint8Array(s);for(let l=0;l<o.length;l++)if(o[l]!==a[l])return!1;return!0})??Object.keys({...t,...e}).every(i=>Qt(t[i],e[i],n))}ne(Qt,"deepEqual");function ff(t){return t.charAt(0).toUpperCase()+t.slice(1)}ne(ff,"capitalize");function df(t){return t.charAt(0).toLowerCase()+t.slice(1)}ne(df,"uncapitalize");function hf(t){return t.replace(/[_-][a-z]/g,e=>e.slice(1).toUpperCase())}ne(hf,"camelCase");function Bi(t,e,n){const r=[];let i=0;for(let s=0;s<t.length;s++){const o=t.charCodeAt(s);if(o>=65&&o<=90){if(i===1){const a=t.charCodeAt(s+1);a>=97&&a<=122&&r.push(n),r.push(o+32)}else i!==0&&r.push(n),r.push(o+32);i=1}else o>=97&&o<=122?(r.push(o),i=2):e.includes(o)?(i!==0&&r.push(n),i=0):r.push(o)}return String.fromCharCode(...r)}ne(Bi,"tokenize");function pf(t){return Bi(t,[45,95],45)}ne(pf,"paramCase");function mf(t){return Bi(t,[45,95],95)}ne(mf,"snakeCase");function gf(t){return typeof t!="string"?`[${t.toString()}]`:/^[a-z_$][\w$]*$/i.test(t)?`.${t}`:`[${JSON.stringify(t)}]`}ne(gf,"formatProperty");function Bo(t){return t.replace(/\/$/,"")}ne(Bo,"trimSlash");function yf(t){return t.startsWith("/")||(t="/"+t),Bo(t)}ne(yf,"sanitize");var Uo;(t=>{t.millisecond=1,t.second=1e3,t.minute=t.second*60,t.hour=t.minute*60,t.day=t.hour*24,t.week=t.day*7;let e=new Date().getTimezoneOffset();function n(y){e=y}t.setTimezoneOffset=n,ne(n,"setTimezoneOffset");function r(){return e}t.getTimezoneOffset=r,ne(r,"getTimezoneOffset");function i(y=new Date,v){return typeof y=="number"&&(y=new Date(y)),v===void 0&&(v=e),Math.floor((y.valueOf()/t.minute-v)/1440)}t.getDateNumber=i,ne(i,"getDateNumber");function s(y,v){const I=new Date(y*t.day);return v===void 0&&(v=e),new Date(+I+v*t.minute)}t.fromDateNumber=s,ne(s,"fromDateNumber");const o=/\d+(?:\.\d+)?/.source,a=new RegExp(`^${["w(?:eek(?:s)?)?","d(?:ay(?:s)?)?","h(?:our(?:s)?)?","m(?:in(?:ute)?(?:s)?)?","s(?:ec(?:ond)?(?:s)?)?"].map(y=>`(${o}${y})?`).join("")}$`);function l(y){const v=a.exec(y);return v?(parseFloat(v[1])*t.week||0)+(parseFloat(v[2])*t.day||0)+(parseFloat(v[3])*t.hour||0)+(parseFloat(v[4])*t.minute||0)+(parseFloat(v[5])*t.second||0):0}t.parseTime=l,ne(l,"parseTime");function u(y){const v=l(y);return v?y=Date.now()+v:/^\d{1,2}(:\d{1,2}){1,2}$/.test(y)?y=`${new Date().toLocaleDateString()}-${y}`:/^\d{1,2}-\d{1,2}-\d{1,2}(:\d{1,2}){1,2}$/.test(y)&&(y=`${new Date().getFullYear()}-${y}`),y?new Date(y):new Date}t.parseDate=u,ne(u,"parseDate");function c(y){const v=Math.abs(y);return v>=t.day-t.hour/2?Math.round(y/t.day)+"d":v>=t.hour-t.minute/2?Math.round(y/t.hour)+"h":v>=t.minute-t.second/2?Math.round(y/t.minute)+"m":v>=t.second?Math.round(y/t.second)+"s":y+"ms"}t.format=c,ne(c,"format");function f(y,v=2){return y.toString().padStart(v,"0")}t.toDigits=f,ne(f,"toDigits");function w(y,v=new Date){return y.replace("yyyy",v.getFullYear().toString()).replace("yy",v.getFullYear().toString().slice(2)).replace("MM",f(v.getMonth()+1)).replace("dd",f(v.getDate())).replace("hh",f(v.getHours())).replace("mm",f(v.getMinutes())).replace("ss",f(v.getSeconds())).replace("SSS",f(v.getMilliseconds(),3))}t.template=w,ne(w,"template")})(Uo||(Uo={}));var bf=Object.defineProperty,ie=(t,e)=>bf(t,"name",{value:e,configurable:!0}),Y={shadow:Symbol.for("cordis.shadow"),receiver:Symbol.for("cordis.receiver"),original:Symbol.for("cordis.original"),store:Symbol.for("cordis.store"),events:Symbol.for("cordis.events"),static:Symbol.for("cordis.static"),filter:Symbol.for("cordis.filter"),expose:Symbol.for("cordis.expose"),isolate:Symbol.for("cordis.isolate"),internal:Symbol.for("cordis.internal"),intercept:Symbol.for("cordis.intercept"),setup:Symbol.for("cordis.setup"),invoke:Symbol.for("cordis.invoke"),extend:Symbol.for("cordis.extend"),tracker:Symbol.for("cordis.tracker"),provide:Symbol.for("cordis.provide"),immediate:Symbol.for("cordis.immediate")},vf=function*(){}.constructor,Ho=async function*(){}.constructor;function Ui(t){return!(!t.prototype||t instanceof vf||Ho!==Function&&t instanceof Ho)}ie(Ui,"isConstructor");function Hn(t,e){const n=t.Config||t.schema;return n&&t.schema!==!1&&(e=n(e)),e??{}}ie(Hn,"resolveConfig");function Wo(t){return[Map,Set,Date,Promise].some(e=>t instanceof e)}ie(Wo,"isUnproxyable");function Hi(t,e){if(t===Object.prototype)return e;const n=Object.create(Hi(Object.getPrototypeOf(t),e));for(const r of Reflect.ownKeys(t))Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r));return n}ie(Hi,"joinPrototype");function Wi(t){return t&&(typeof t=="object"||typeof t=="function")}ie(Wi,"isObject");function mt(t,e,n){if(!Wi(e))return e;if(Object.hasOwn(e,Y.shadow))return Object.getPrototypeOf(e);const r=e[Y.tracker];return r?Or(t,e,r,n):e}ie(mt,"getTraceable");function Wn(t,e){return e?new Proxy(t,{get:ie((n,r,i)=>r in e&&r!=="constructor"?Reflect.get(e,r,i):Reflect.get(n,r,i),"get"),set:ie((n,r,i,s)=>r in e&&r!=="constructor"?Reflect.set(e,r,i,s):Reflect.set(n,r,i,s),"set")}):t}ie(Wn,"withProps");function Cr(t,e,n){return Wn(t,Object.defineProperty(Object.create(null),e,{value:n,writable:!1}))}ie(Cr,"withProp");function qi(t,e,n,r){if(!n)return r;const i=Reflect.getOwnPropertyDescriptor(e,n)?.value;return i?Cr(r,n,t.extend({[Y.shadow]:i})):r}ie(qi,"createShadow");function qo(t,e,n,r){return new Proxy(e,{apply:ie((i,s,o)=>(s===n&&(s=r),o=o.map(a=>typeof a!="function"||a[Y.original]?a:new Proxy(a,{get:ie((l,u,c)=>{if(u===Y.original)return l;const f=Reflect.get(l,u,c);return u==="toString"&&f===Function.prototype.toString?function(...w){return Reflect.apply(f,this===c?l:this,w)}:f},"get"),apply:ie((l,u,c)=>Reflect.apply(l,mt(t,u),c.map(f=>mt(t,f))),"apply"),construct:ie((l,u,c)=>Reflect.construct(l,u.map(f=>mt(t,f)),c),"construct")})),mt(t,Reflect.apply(i,s,o))),"apply")})}ie(qo,"createShadowMethod");function Or(t,e,n,r){t[Y.shadow]&&(t=Object.getPrototypeOf(t));const i=new Proxy(e,{get:ie((s,o,a)=>{if(o===Y.original)return s;if(o===n.property)return t;if(typeof o=="symbol")return Reflect.get(s,o,a);if(n.associate&&t[Y.internal][`${n.associate}.${o}`])return Reflect.get(t,`${n.associate}.${o}`,Cr(t,Y.receiver,a));const l=qi(t,s,n.property,a),u=Reflect.get(s,o,l),c=u?.[Y.tracker];return c?Or(t,u,c):!r&&typeof u=="function"?qo(t,u,a,l):u},"get"),set:ie((s,o,a,l)=>{if(o===Y.original||o===n.property)return!1;if(typeof o=="symbol")return Reflect.set(s,o,a,l);if(n.associate&&t[Y.internal][`${n.associate}.${o}`])return Reflect.set(t,`${n.associate}.${o}`,a,Cr(t,Y.receiver,l));const u=qi(t,s,n.property,l);return Reflect.set(s,o,a,u)},"set"),apply:ie((s,o,a)=>zi(i,s,o,a),"apply")});return i}ie(Or,"createTraceable");function zi(t,e,n,r){return e[Y.invoke]?e[Y.invoke].apply(t,r):Reflect.apply(e,n,r)}ie(zi,"applyTraceable");function Vi(t,e,n){const r=ie(function(...i){const s=Or(r.ctx,r,n);return zi(s,r,this,i)},"self");return Be(r,"name",t),Object.setPrototypeOf(r,e)}ie(Vi,"createCallable");var _f=(ct=class{constructor(e){this.ctx=e,Be(this,Y.tracker,{associate:"reflect",property:"ctx"}),this._mixin("reflect",["get","set","provide","accessor","mixin","alias"]),this._mixin("scope",["config","runtime","effect","collect","accept","decline"]),this._mixin("registry",["using","inject","plugin"]),this._mixin("lifecycle",["on","once","parallel","emit","serial","bail","start","stop"])}static resolveInject(e,n){let r=e[Y.internal][n];for(;r?.type==="alias";)n=r.name,r=e[Y.internal][n];return[n,r]}static checkInject(e,n,r){if(e=e[Y.shadow]??e,["prototype","then","registry","lifecycle"].includes(n)||n[0]==="$"||n[0]==="_"||!e.runtime.plugin||e.bail(e,"internal/inject",n))return;const i=r.stack.split(`
1
+ (function(le,ye){typeof exports=="object"&&typeof module<"u"?ye(exports):typeof define=="function"&&define.amd?define(["exports"],ye):(le=typeof globalThis<"u"?globalThis:le||self,ye(le.InPageEditBundle={}))})(this,function(le){"use strict";var gv=Object.defineProperty;var zu=le=>{throw TypeError(le)};var yv=(le,ye,Ie)=>ye in le?gv(le,ye,{enumerable:!0,configurable:!0,writable:!0,value:Ie}):le[ye]=Ie;var te=(le,ye,Ie)=>yv(le,typeof ye!="symbol"?ye+"":ye,Ie),No=(le,ye,Ie)=>ye.has(le)||zu("Cannot "+Ie);var Vu=(le,ye,Ie)=>(No(le,ye,"read from private field"),Ie?Ie.call(le):ye.get(le)),Lo=(le,ye,Ie)=>ye.has(le)?zu("Cannot add the same private member more than once"):ye instanceof WeakSet?ye.add(le):ye.set(le,Ie),Ku=(le,ye,Ie,ne)=>(No(le,ye,"write to private field"),ne?ne.call(le,Ie):ye.set(le,Ie),Ie),Er=(le,ye,Ie)=>(No(le,ye,"access private method"),Ie);var ct,An,ln,In,Rn,Tn,Dn,ke,tt,Pt,Yu,Ju,Qu,Xu,br;const ye=()=>{let t,e;return{promise:new Promise((r,i)=>{t=r,e=i}),resolve:t,reject:e}};Promise.withResolvers||(Promise.withResolvers=ye);var Ie=Object.defineProperty,ne=(t,e)=>Ie(t,"name",{value:e,configurable:!0});function Zu(){}ne(Zu,"noop");function Oe(t){return t==null}ne(Oe,"isNullable");function ef(t){return!Oe(t)}ne(ef,"isNonNullable");function Or(t){return t&&typeof t=="object"&&!Array.isArray(t)}ne(Or,"isPlainObject");function jo(t,e){return Object.fromEntries(Object.entries(t).filter(([n,r])=>e(n,r)))}ne(jo,"filterKeys");function Ct(t,e){return Object.fromEntries(Object.entries(t).map(([n,r])=>[n,e(r,n)]))}ne(Ct,"mapValues");function Mo(t,e,n){if(!e)return{...t};const r={};for(const i of e)(n||t[i]!==void 0)&&(r[i]=t[i]);return r}ne(Mo,"pick");function tf(t,e){if(!e)return{...t};const n={...t};for(const r of e)Reflect.deleteProperty(n,r);return n}ne(tf,"omit");function Be(t,e,n){return Object.defineProperty(t,e,{writable:!0,value:n,enumerable:!1})}ne(Be,"defineProperty");function nf(t,e){return e.every(n=>t.includes(n))}ne(nf,"contain");function rf(t,e){return t.filter(n=>e.includes(n))}ne(rf,"intersection");function sf(t,e){return t.filter(n=>!e.includes(n))}ne(sf,"difference");function of(t,e){return Array.from(new Set([...t,...e]))}ne(of,"union");function af(t){return[...new Set(t)]}ne(af,"deduplicate");function jt(t,e){const n=t?.indexOf(e);return n>=0?(t.splice(n,1),!0):!1}ne(jt,"remove");function lf(t){return Array.isArray(t)?t:Oe(t)?[]:[t]}ne(lf,"makeArray");function Mt(t,e){return arguments.length===1?n=>Mt(t,n):t in globalThis&&e instanceof globalThis[t]||Object.prototype.toString.call(e).slice(8,-1)===t}ne(Mt,"is");function Un(t){return Mt("ArrayBuffer",t)||Mt("SharedArrayBuffer",t)}ne(Un,"isArrayBufferLike");function Fo(t){return Un(t)||ArrayBuffer.isView(t)}ne(Fo,"isArrayBufferSource");var pt;(t=>{t.is=Un,t.isSource=Fo;function e(o){return ArrayBuffer.isView(o)?o.buffer.slice(o.byteOffset,o.byteOffset+o.byteLength):o}t.fromSource=e,ne(e,"fromSource");function n(o){if(typeof Buffer<"u")return Buffer.from(o).toString("base64");let a="";const l=new Uint8Array(o);for(let u=0;u<l.byteLength;u++)a+=String.fromCharCode(l[u]);return btoa(a)}t.toBase64=n,ne(n,"toBase64");function r(o){return typeof Buffer<"u"?e(Buffer.from(o,"base64")):Uint8Array.from(atob(o),a=>a.charCodeAt(0))}t.fromBase64=r,ne(r,"fromBase64");function i(o){return typeof Buffer<"u"?Buffer.from(o).toString("hex"):Array.from(new Uint8Array(o),a=>a.toString(16).padStart(2,"0")).join("")}t.toHex=i,ne(i,"toHex");function s(o){if(typeof Buffer<"u")return e(Buffer.from(o,"hex"));const a=o.length%2===0?o:o.slice(0,o.length-1),l=[];for(let u=0;u<a.length;u+=2)l.push(parseInt(`${a[u]}${a[u+1]}`,16));return Uint8Array.from(l).buffer}t.fromHex=s,ne(s,"fromHex")})(pt||(pt={})),pt.fromBase64,pt.toBase64,pt.fromHex,pt.toHex;function Pr(t,e=new Map){if(!t||typeof t!="object")return t;if(Mt("Date",t))return new Date(t.valueOf());if(Mt("RegExp",t))return new RegExp(t.source,t.flags);if(Un(t))return t.slice(0);if(ArrayBuffer.isView(t))return t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength);const n=e.get(t);if(n)return n;if(Array.isArray(t)){const i=[];return e.set(t,i),t.forEach((s,o)=>{i[o]=Reflect.apply(Pr,null,[s,e])}),i}const r=Object.create(Object.getPrototypeOf(t));e.set(t,r);for(const i of Reflect.ownKeys(t)){const s={...Reflect.getOwnPropertyDescriptor(t,i)};"value"in s&&(s.value=Reflect.apply(Pr,null,[s.value,e])),Reflect.defineProperty(r,i,s)}return r}ne(Pr,"clone");function Qt(t,e,n){if(t===e||!n&&Oe(t)&&Oe(e))return!0;if(typeof t!=typeof e||typeof t!="object"||!t||!e)return!1;function r(i,s){return i(t)?i(e)?s(t,e):!1:i(e)?!1:void 0}return ne(r,"check"),r(Array.isArray,(i,s)=>i.length===s.length&&i.every((o,a)=>Qt(o,s[a])))??r(Mt("Date"),(i,s)=>i.valueOf()===s.valueOf())??r(Mt("RegExp"),(i,s)=>i.source===s.source&&i.flags===s.flags)??r(Un,(i,s)=>{if(i.byteLength!==s.byteLength)return!1;const o=new Uint8Array(i),a=new Uint8Array(s);for(let l=0;l<o.length;l++)if(o[l]!==a[l])return!1;return!0})??Object.keys({...t,...e}).every(i=>Qt(t[i],e[i],n))}ne(Qt,"deepEqual");function cf(t){return t.charAt(0).toUpperCase()+t.slice(1)}ne(cf,"capitalize");function uf(t){return t.charAt(0).toLowerCase()+t.slice(1)}ne(uf,"uncapitalize");function ff(t){return t.replace(/[_-][a-z]/g,e=>e.slice(1).toUpperCase())}ne(ff,"camelCase");function Bi(t,e,n){const r=[];let i=0;for(let s=0;s<t.length;s++){const o=t.charCodeAt(s);if(o>=65&&o<=90){if(i===1){const a=t.charCodeAt(s+1);a>=97&&a<=122&&r.push(n),r.push(o+32)}else i!==0&&r.push(n),r.push(o+32);i=1}else o>=97&&o<=122?(r.push(o),i=2):e.includes(o)?(i!==0&&r.push(n),i=0):r.push(o)}return String.fromCharCode(...r)}ne(Bi,"tokenize");function df(t){return Bi(t,[45,95],45)}ne(df,"paramCase");function hf(t){return Bi(t,[45,95],95)}ne(hf,"snakeCase");function pf(t){return typeof t!="string"?`[${t.toString()}]`:/^[a-z_$][\w$]*$/i.test(t)?`.${t}`:`[${JSON.stringify(t)}]`}ne(pf,"formatProperty");function Bo(t){return t.replace(/\/$/,"")}ne(Bo,"trimSlash");function mf(t){return t.startsWith("/")||(t="/"+t),Bo(t)}ne(mf,"sanitize");var Uo;(t=>{t.millisecond=1,t.second=1e3,t.minute=t.second*60,t.hour=t.minute*60,t.day=t.hour*24,t.week=t.day*7;let e=new Date().getTimezoneOffset();function n(y){e=y}t.setTimezoneOffset=n,ne(n,"setTimezoneOffset");function r(){return e}t.getTimezoneOffset=r,ne(r,"getTimezoneOffset");function i(y=new Date,v){return typeof y=="number"&&(y=new Date(y)),v===void 0&&(v=e),Math.floor((y.valueOf()/t.minute-v)/1440)}t.getDateNumber=i,ne(i,"getDateNumber");function s(y,v){const I=new Date(y*t.day);return v===void 0&&(v=e),new Date(+I+v*t.minute)}t.fromDateNumber=s,ne(s,"fromDateNumber");const o=/\d+(?:\.\d+)?/.source,a=new RegExp(`^${["w(?:eek(?:s)?)?","d(?:ay(?:s)?)?","h(?:our(?:s)?)?","m(?:in(?:ute)?(?:s)?)?","s(?:ec(?:ond)?(?:s)?)?"].map(y=>`(${o}${y})?`).join("")}$`);function l(y){const v=a.exec(y);return v?(parseFloat(v[1])*t.week||0)+(parseFloat(v[2])*t.day||0)+(parseFloat(v[3])*t.hour||0)+(parseFloat(v[4])*t.minute||0)+(parseFloat(v[5])*t.second||0):0}t.parseTime=l,ne(l,"parseTime");function u(y){const v=l(y);return v?y=Date.now()+v:/^\d{1,2}(:\d{1,2}){1,2}$/.test(y)?y=`${new Date().toLocaleDateString()}-${y}`:/^\d{1,2}-\d{1,2}-\d{1,2}(:\d{1,2}){1,2}$/.test(y)&&(y=`${new Date().getFullYear()}-${y}`),y?new Date(y):new Date}t.parseDate=u,ne(u,"parseDate");function c(y){const v=Math.abs(y);return v>=t.day-t.hour/2?Math.round(y/t.day)+"d":v>=t.hour-t.minute/2?Math.round(y/t.hour)+"h":v>=t.minute-t.second/2?Math.round(y/t.minute)+"m":v>=t.second?Math.round(y/t.second)+"s":y+"ms"}t.format=c,ne(c,"format");function f(y,v=2){return y.toString().padStart(v,"0")}t.toDigits=f,ne(f,"toDigits");function w(y,v=new Date){return y.replace("yyyy",v.getFullYear().toString()).replace("yy",v.getFullYear().toString().slice(2)).replace("MM",f(v.getMonth()+1)).replace("dd",f(v.getDate())).replace("hh",f(v.getHours())).replace("mm",f(v.getMinutes())).replace("ss",f(v.getSeconds())).replace("SSS",f(v.getMilliseconds(),3))}t.template=w,ne(w,"template")})(Uo||(Uo={}));var gf=Object.defineProperty,ie=(t,e)=>gf(t,"name",{value:e,configurable:!0}),G={shadow:Symbol.for("cordis.shadow"),receiver:Symbol.for("cordis.receiver"),original:Symbol.for("cordis.original"),store:Symbol.for("cordis.store"),events:Symbol.for("cordis.events"),static:Symbol.for("cordis.static"),filter:Symbol.for("cordis.filter"),expose:Symbol.for("cordis.expose"),isolate:Symbol.for("cordis.isolate"),internal:Symbol.for("cordis.internal"),intercept:Symbol.for("cordis.intercept"),setup:Symbol.for("cordis.setup"),invoke:Symbol.for("cordis.invoke"),extend:Symbol.for("cordis.extend"),tracker:Symbol.for("cordis.tracker"),provide:Symbol.for("cordis.provide"),immediate:Symbol.for("cordis.immediate")},yf=function*(){}.constructor,Ho=async function*(){}.constructor;function Ui(t){return!(!t.prototype||t instanceof yf||Ho!==Function&&t instanceof Ho)}ie(Ui,"isConstructor");function Hn(t,e){const n=t.Config||t.schema;return n&&t.schema!==!1&&(e=n(e)),e??{}}ie(Hn,"resolveConfig");function Wo(t){return[Map,Set,Date,Promise].some(e=>t instanceof e)}ie(Wo,"isUnproxyable");function Hi(t,e){if(t===Object.prototype)return e;const n=Object.create(Hi(Object.getPrototypeOf(t),e));for(const r of Reflect.ownKeys(t))Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r));return n}ie(Hi,"joinPrototype");function Wi(t){return t&&(typeof t=="object"||typeof t=="function")}ie(Wi,"isObject");function mt(t,e,n){if(!Wi(e))return e;if(Object.hasOwn(e,G.shadow))return Object.getPrototypeOf(e);const r=e[G.tracker];return r?kr(t,e,r,n):e}ie(mt,"getTraceable");function Wn(t,e){return e?new Proxy(t,{get:ie((n,r,i)=>r in e&&r!=="constructor"?Reflect.get(e,r,i):Reflect.get(n,r,i),"get"),set:ie((n,r,i,s)=>r in e&&r!=="constructor"?Reflect.set(e,r,i,s):Reflect.set(n,r,i,s),"set")}):t}ie(Wn,"withProps");function Cr(t,e,n){return Wn(t,Object.defineProperty(Object.create(null),e,{value:n,writable:!1}))}ie(Cr,"withProp");function qi(t,e,n,r){if(!n)return r;const i=Reflect.getOwnPropertyDescriptor(e,n)?.value;return i?Cr(r,n,t.extend({[G.shadow]:i})):r}ie(qi,"createShadow");function qo(t,e,n,r){return new Proxy(e,{apply:ie((i,s,o)=>(s===n&&(s=r),o=o.map(a=>typeof a!="function"||a[G.original]?a:new Proxy(a,{get:ie((l,u,c)=>{if(u===G.original)return l;const f=Reflect.get(l,u,c);return u==="toString"&&f===Function.prototype.toString?function(...w){return Reflect.apply(f,this===c?l:this,w)}:f},"get"),apply:ie((l,u,c)=>Reflect.apply(l,mt(t,u),c.map(f=>mt(t,f))),"apply"),construct:ie((l,u,c)=>Reflect.construct(l,u.map(f=>mt(t,f)),c),"construct")})),mt(t,Reflect.apply(i,s,o))),"apply")})}ie(qo,"createShadowMethod");function kr(t,e,n,r){t[G.shadow]&&(t=Object.getPrototypeOf(t));const i=new Proxy(e,{get:ie((s,o,a)=>{if(o===G.original)return s;if(o===n.property)return t;if(typeof o=="symbol")return Reflect.get(s,o,a);if(n.associate&&t[G.internal][`${n.associate}.${o}`])return Reflect.get(t,`${n.associate}.${o}`,Cr(t,G.receiver,a));const l=qi(t,s,n.property,a),u=Reflect.get(s,o,l),c=u?.[G.tracker];return c?kr(t,u,c):!r&&typeof u=="function"?qo(t,u,a,l):u},"get"),set:ie((s,o,a,l)=>{if(o===G.original||o===n.property)return!1;if(typeof o=="symbol")return Reflect.set(s,o,a,l);if(n.associate&&t[G.internal][`${n.associate}.${o}`])return Reflect.set(t,`${n.associate}.${o}`,a,Cr(t,G.receiver,l));const u=qi(t,s,n.property,l);return Reflect.set(s,o,a,u)},"set"),apply:ie((s,o,a)=>zi(i,s,o,a),"apply")});return i}ie(kr,"createTraceable");function zi(t,e,n,r){return e[G.invoke]?e[G.invoke].apply(t,r):Reflect.apply(e,n,r)}ie(zi,"applyTraceable");function Vi(t,e,n){const r=ie(function(...i){const s=kr(r.ctx,r,n);return zi(s,r,this,i)},"self");return Be(r,"name",t),Object.setPrototypeOf(r,e)}ie(Vi,"createCallable");var vf=(ct=class{constructor(e){this.ctx=e,Be(this,G.tracker,{associate:"reflect",property:"ctx"}),this._mixin("reflect",["get","set","provide","accessor","mixin","alias"]),this._mixin("scope",["config","runtime","effect","collect","accept","decline"]),this._mixin("registry",["using","inject","plugin"]),this._mixin("lifecycle",["on","once","parallel","emit","serial","bail","start","stop"])}static resolveInject(e,n){let r=e[G.internal][n];for(;r?.type==="alias";)n=r.name,r=e[G.internal][n];return[n,r]}static checkInject(e,n,r){if(e=e[G.shadow]??e,["prototype","then","registry","lifecycle"].includes(n)||n[0]==="$"||n[0]==="_"||!e.runtime.plugin||e.bail(e,"internal/inject",n))return;const i=r.stack.split(`
2
2
  `);i.splice(1,1),r.stack=i.join(`
3
- `),e.emit(e,"internal/warning",r)}get(e){if(this.ctx[Y.internal][e]?.type!=="service")return;const r=this.ctx[Y.isolate][e],i=this.ctx[Y.store][r]?.value;return mt(this.ctx,i)}set(e,n){this.provide(e);const r=this.ctx[Y.isolate][e],i=this.ctx[Y.store][r]?.value;n??(n=void 0);let s=ie(()=>{},"dispose");if(i===n)return s;if(!Ce(n)&&!Ce(i))throw new Error(`service ${e} has been registered`);const o=this.ctx;Ce(n)||(s=o.effect(()=>()=>{o.set(e,void 0)})),Wo(n)&&o.emit(o,"internal/warning",new Error(`service ${e} is an unproxyable object, which may lead to unexpected behavior`));const a=Object.create(o);return a[Y.filter]=l=>o[Y.isolate][e]===l[Y.isolate][e],o.emit(a,"internal/before-service",e,n),o[Y.store][r]={value:n,source:o},o.emit(a,"internal/service",e,i),s}provide(e,n,r){const i=this.ctx.root[Y.internal];if(e in i)return;const s=Symbol(e);i[e]={type:"service",builtin:r},this.ctx.root[Y.isolate][e]=s,Wi(n)&&(this.ctx[Y.store][s]={value:n,source:null},Be(n,Y.tracker,{associate:e,property:"ctx"}))}_accessor(e,n){const r=this.ctx.root[Y.internal];return e in r?()=>{}:(r[e]={type:"accessor",...n},()=>delete this.ctx.root[Y.isolate][e])}accessor(e,n){this.ctx.scope.effect(()=>this._accessor(e,n))}alias(e,n){const r=this.ctx.root[Y.internal];if(!(e in r))for(const i of n)r[i]||(r[i]={type:"alias",name:e})}_mixin(e,n){const r=Array.isArray(n)?n.map(o=>[o,o]):Object.entries(n),i=typeof e=="string"?o=>o[e]:()=>e,s=r.map(([o,a])=>this._accessor(a,{get(l){const u=i(this);if(Ce(u))return u;const c=l?Wn(l,u):u,f=Reflect.get(u,o,c);return typeof f!="function"?f:f.bind(c??u)},set(l,u){const c=i(this),f=u?Wn(u,c):c;return Reflect.set(c,o,l,f)}}));return()=>s.forEach(o=>o())}mixin(e,n){this.ctx.scope.effect(()=>this._mixin(e,n))}trace(e){return mt(this.ctx,e)}bind(e){return new Proxy(e,{apply:ie((n,r,i)=>n.apply(this.trace(r),i.map(s=>this.trace(s))),"apply")})}},ie(ct,"ReflectService"),te(ct,"handler",{get:ie((e,n,r)=>{if(typeof n!="string")return Reflect.get(e,n,r);if(Reflect.has(e,n))return mt(r,Reflect.get(e,n,r),!0);const[i,s]=ct.resolveInject(e,n),o=new Error(`property ${i} is not registered, declare it as \`inject\` to suppress this warning`);return s?s.type==="accessor"?s.get.call(r,r[Y.receiver]):(s.builtin||ct.checkInject(r,i,o),r.reflect.get(i)):(ct.checkInject(r,i,o),Reflect.get(e,i,r))},"get"),set:ie((e,n,r,i)=>{if(typeof n!="string")return Reflect.set(e,n,r,i);const[s,o]=ct.resolveInject(e,n);return o?o.type==="accessor"?o.set?o.set.call(i,r,i[Y.receiver]):!1:(i.reflect.set(s,r),!0):Reflect.set(e,s,r,i)},"set"),has:ie((e,n)=>{if(typeof n!="string")return Reflect.has(e,n);if(Reflect.has(e,n))return!0;const[,r]=ct.resolveInject(e,n);return!!r},"has")}),ct),Ki=_f;function Yi(t){return t!==null&&t!==!1&&t!==void 0}ie(Yi,"isBailed");var wf=(An=class{constructor(e){te(this,"isActive",!1);te(this,"_tasks",new Set);te(this,"_hooks",{});this.ctx=e,Be(this,Y.tracker,{associate:"lifecycle",property:"ctx"}),Be(this.on("internal/listener",function(r,i,s){const o=s.prepend?"unshift":"push";if(r==="ready")return this.lifecycle.isActive?(this.scope.ensure(async()=>i()),()=>!1):void 0;if(r==="dispose")return this.scope.disposables[o](i),Be(i,"name","event <dispose>"),()=>jt(this.scope.disposables,i);if(r==="fork")return this.scope.runtime.forkables[o](i),this.scope.collect("event <fork>",()=>jt(this.scope.runtime.forkables,i))}),Ke.static,e.scope);for(const r of["info","error","warning"])Be(this.on(`internal/${r}`,(i,...s)=>{this._hooks[`internal/${r}`].length>1||console.info(i,...s)}),Ke.static,e.scope);Be(this.on("internal/before-service",function(r){for(const i of this.registry.values()){if(!i.inject[r]?.required)continue;const s=i.isReusable?i.children:[i];for(const o of s)this[Y.filter](o.ctx)&&(o.updateStatus(),o.reset())}},{global:!0}),Ke.static,e.scope),Be(this.on("internal/service",function(r){for(const i of this.registry.values()){if(!i.inject[r]?.required)continue;const s=i.isReusable?i.children:[i];for(const o of s)this[Y.filter](o.ctx)&&o.start()}},{global:!0}),Ke.static,e.scope);const n=ie((r,i)=>{if(!r.runtime.plugin)return!1;for(const s in r.runtime.inject)if(i===Ki.resolveInject(r.ctx,s)[0])return!0;return n(r.parent.scope,i)},"checkInject");Be(this.on("internal/inject",function(r){return n(this.scope,r)},{global:!0}),Ke.static,e.scope)}async flush(){for(;this._tasks.size;)await Promise.all(Array.from(this._tasks))}filterHooks(e,n){return n=mt(this.ctx,n),e.slice().filter(r=>{const i=n?.[Ke.filter];return r.global||!i||i.call(n,r.ctx)})}*dispatch(e,n){const r=typeof n[0]=="object"||typeof n[0]=="function"?n.shift():null,i=n.shift();i!=="internal/event"&&this.emit("internal/event",e,i,n,r);for(const s of this.filterHooks(this._hooks[i]||[],r))yield s.callback.apply(r,n)}async parallel(...e){await Promise.all(this.dispatch("emit",e))}emit(...e){Array.from(this.dispatch("emit",e))}async serial(...e){for await(const n of this.dispatch("serial",e))if(Yi(n))return n}bail(...e){for(const n of this.dispatch("bail",e))if(Yi(n))return n}register(e,n,r,i){const s=i.prepend?"unshift":"push";return n[s]({ctx:this.ctx,callback:r,...i}),this.ctx.state.collect(e,()=>this.unregister(n,r))}unregister(e,n){const r=e.findIndex(i=>i.callback===n);if(r>=0)return e.splice(r,1),!0}on(e,n,r){var a;typeof r!="object"&&(r={prepend:r}),this.ctx.scope.assertActive(),n=this.ctx.reflect.bind(n);const i=this.bail(this.ctx,"internal/listener",e,n,r);if(i)return i;const s=(a=this._hooks)[e]||(a[e]=[]),o=typeof e=="string"?`event <${e}>`:"event (Symbol)";return this.register(o,s,n,r)}once(e,n,r){const i=this.on(e,function(...s){return i(),n.apply(this,s)},r);return i}async start(){this.isActive=!0;const e=this._hooks.ready||[];for(;e.length;){const{ctx:n,callback:r}=e.shift();n.scope.ensure(async()=>r())}await this.flush()}async stop(){this.isActive=!1,this.ctx.scope.reset()}},ie(An,"Lifecycle"),An),xf=wf,Gi=(ln=class extends Error{constructor(e,n){super(n??ln.Code[e]),this.code=e}},ie(ln,"CordisError"),ln);(t=>{t.Code={INACTIVE_EFFECT:"cannot create effect on inactive context"}})(Gi||(Gi={}));var zo=(In=class{constructor(e,n){te(this,"uid");te(this,"ctx");te(this,"disposables",[]);te(this,"error");te(this,"status",0);te(this,"isActive",!1);te(this,"context");te(this,"proxy");te(this,"acceptors",[]);te(this,"tasks",new Set);te(this,"hasError",!1);this.parent=e,this.config=n,this.uid=e.registry?e.registry.counter:0,this.ctx=this.context=e.extend({scope:this}),this.proxy=new Proxy({},{get:ie((r,i)=>Reflect.get(this.config,i),"get")})}get _config(){return this.runtime.isReactive?this.proxy:this.config}assertActive(){if(!(this.uid!==null||this.isActive))throw new Gi("INACTIVE_EFFECT")}effect(e,n){this.assertActive();const r=Ui(e)?new e(this.ctx,n):e(this.ctx,n);let i=!1;const s=typeof r=="function"?r:r.dispose.bind(r),o=ie((...a)=>{if(!i)return i=!0,jt(this.disposables,o),s(...a)},"wrapped");return this.disposables.push(o),typeof r=="function"?o:(r.dispose=o,r)}collect(e,n){const r=Be(()=>(jt(this.disposables,r),n()),"name",e);return this.disposables.push(r),r}restart(){this.reset(),this.error=null,this.hasError=!1,this.status=0,this.start()}_getStatus(){return this.uid===null?4:this.hasError?3:this.tasks.size?1:this.ready?2:0}updateStatus(e){const n=this.status;e?.(),this.status=this._getStatus(),n!==this.status&&this.context.emit("internal/status",this,n)}ensure(e){const n=e().catch(r=>{this.context.emit(this.ctx,"internal/error",r),this.cancel(r)}).finally(()=>{this.updateStatus(()=>this.tasks.delete(n)),this.context.events._tasks.delete(n)});this.updateStatus(()=>this.tasks.add(n)),this.context.events._tasks.add(n)}cancel(e){this.error=e,this.updateStatus(()=>this.hasError=!0),this.reset()}get ready(){return Object.entries(this.runtime.inject).every(([e,n])=>!n.required||!Ce(this.ctx.get(e)))}reset(){this.isActive=!1,this.disposables=this.disposables.splice(0).filter(e=>{if(this.uid!==null&&e[Ke.static]===this)return!0;(async()=>e())().catch(n=>{this.context.emit(this.ctx,"internal/error",n)})})}init(e){this.config?this.start():this.cancel(e)}start(){if(!this.ready||this.isActive||this.uid===null)return!0;this.isActive=!0,this.updateStatus(()=>this.hasError=!1)}accept(...e){const r={keys:Array.isArray(e[0])?e.shift():null,callback:e[0],...e[1]};return this.effect(()=>(this.acceptors.push(r),r.immediate&&r.callback?.(this.config),()=>jt(this.acceptors,r)))}decline(e){return this.accept(e,()=>!0)}checkUpdate(e,n){if(n||!this.config)return[!0,!0];if(n===!1)return[!1,!1];const r=Object.create(null),i=ie(u=>{const c=r[u]??(r[u]=!Qt(this.config[u],e[u]));return o||(o=c),c},"checkPropertyUpdate"),s=new Set;let o=!1,a=!1,l=this.runtime.isReactive||null;for(const{keys:u,callback:c,passive:f}of this.acceptors){if(!u)l||(l=!f);else if(f)u?.forEach(y=>s.add(y));else{let y=!1;for(const v of u)y||(y=i(v));if(!y)continue}c?.(e)&&(a=!0)}for(const u in{...this.config,...e})if(l!==!1&&!(u in r)&&!s.has(u)){const c=i(u);l===null&&(a||(a=c))}return[o,a]}},ie(In,"EffectScope"),In),Sf=(Tn=class extends zo{constructor(n,r,i,s){super(n,i);te(this,"dispose");this.runtime=r,this.dispose=Be(n.scope.collect(`fork <${n.runtime.name}>`,()=>{this.uid=null,this.reset(),this.context.emit("internal/fork",this);const o=jt(r.disposables,this.dispose);return jt(r.children,this)&&!r.children.length&&n.registry.delete(r.plugin),o}),Ke.static,r),r.children.push(this),r.disposables.push(this.dispose),this.context.emit("internal/fork",this),this.init(s)}start(){if(super.start())return!0;for(const n of this.runtime.forkables)this.ensure(async()=>n(this.context,this._config))}update(n,r){const i=this.config,s=this.runtime.isForkable?this:this.runtime;if(s.config!==i)return;let o;try{o=Hn(this.runtime.plugin,n)}catch(u){return this.context.emit("internal/error",u),this.cancel(u)}const[a,l]=s.checkUpdate(o,r);this.context.emit("internal/before-update",this,n),this.config=o,s.config=o,a&&this.context.emit("internal/update",this,i),l&&s.restart()}},ie(Tn,"ForkScope"),Tn),Vo=(Rn=class extends zo{constructor(n,r,i,s){super(n,i);te(this,"value");te(this,"runtime",this);te(this,"schema");te(this,"name");te(this,"inject",Object.create(null));te(this,"forkables",[]);te(this,"children",[]);te(this,"isReusable",!1);te(this,"isReactive",!1);te(this,"apply",ie((n,r)=>{if(typeof this.plugin!="function")return this.plugin.apply(n,r);if(Ui(this.plugin)){const i=new this.plugin(n,r),s=i[Ke.expose];return s&&n.set(s,i),i.fork&&this.forkables.push(i.fork.bind(i)),i}else return this.plugin(n,r)},"apply"));this.plugin=r,r?(this.setup(),this.init(s)):(this.name="root",this.isActive=!0)}get isForkable(){return this.forkables.length>0}fork(n,r,i){return new Sf(n,this,r,i)}dispose(){return this.uid=null,this.reset(),this.context.emit("internal/runtime",this),!0}setup(){const{name:n}=this.plugin;n&&n!=="apply"&&(this.name=n),this.schema=this.plugin.Config||this.plugin.schema,this.inject=Ve.resolve(this.plugin.using||this.plugin.inject),this.isReusable=this.plugin.reusable,this.isReactive=this.plugin.reactive,this.context.emit("internal/runtime",this),this.isReusable&&this.forkables.push(this.apply)}reset(){super.reset();for(const n of this.children)n.reset()}start(){if(super.start())return!0;!this.isReusable&&this.plugin&&this.ensure(async()=>this.value=this.apply(this.ctx,this._config));for(const n of this.children)n.start()}update(n,r){if(this.isForkable){const u=new Error(`attempting to update forkable plugin "${this.plugin.name}", which may lead to unexpected behavior`);this.context.emit(this.ctx,"internal/warning",u)}const i=this.config;let s;try{s=Hn(this.runtime.plugin||this.context.constructor,n)}catch(u){return this.context.emit("internal/error",u),this.cancel(u)}const[o,a]=this.checkUpdate(s,r),l=this.children.find(u=>u.config===i);this.config=s,l&&(this.context.emit("internal/before-update",l,n),l.config=s,o&&this.context.emit("internal/update",l,i)),a&&this.restart()}},ie(Rn,"MainScope"),Rn);function Ko(t){return t&&typeof t=="object"&&typeof t.apply=="function"}ie(Ko,"isApplicable");function Ve(t){return function(e,n){if(n.kind==="class")e.inject=t;else if(n.kind==="method")n.addInitializer(function(){const r=this[Y.tracker]?.property;if(!r)throw new Error("missing context tracker");this[r].inject(t,i=>{e.call(Wn(this,{[r]:i}))})});else throw new Error("@Inject can only be used on class or class methods")}}ie(Ve,"Inject"),(t=>{function e(n){if(!n)return{};if(Array.isArray(n))return Object.fromEntries(n.map(o=>[o,{required:!0}]));const{required:r,optional:i,...s}=n;return Array.isArray(r)&&Object.assign(s,Object.fromEntries(r.map(o=>[o,{required:!0}]))),Array.isArray(i)&&Object.assign(s,Object.fromEntries(i.map(o=>[o,{required:!1}]))),s}t.resolve=e,ie(e,"resolve")})(Ve||(Ve={}));var Ef=(Dn=class{constructor(e,n){te(this,"_counter",0);te(this,"_internal",new Map);te(this,"context");this.ctx=e,Be(this,Y.tracker,{associate:"registry",property:"ctx"}),this.context=e;const r=new Vo(e,null,n);e.scope=r,r.ctx=e,this.set(null,r)}get counter(){return++this._counter}get size(){return this._internal.size}resolve(e,n=!1){if(e===null||typeof e=="function")return e;if(Ko(e))return e.apply;if(n)throw new Error('invalid plugin, expect function or object with an "apply" method, received '+typeof e)}get(e){const n=this.resolve(e);return n&&this._internal.get(n)}has(e){const n=this.resolve(e);return!!n&&this._internal.has(n)}set(e,n){const r=this.resolve(e);this._internal.set(r,n)}delete(e){const n=this.resolve(e),r=n&&this._internal.get(n);if(r)return this._internal.delete(n),r.dispose(),r}keys(){return this._internal.keys()}values(){return this._internal.values()}entries(){return this._internal.entries()}forEach(e){return this._internal.forEach(e)}using(e,n){return this.inject(e,n)}inject(e,n){return this.plugin({inject:e,apply:n,name:n.name})}plugin(e,n,r){if(this.resolve(e,!0),this.ctx.scope.assertActive(),!r)try{n=Hn(e,n)}catch(s){this.context.emit(this.ctx,"internal/error",s),r=s,n=null}let i=this.get(e);return i?(i.isForkable||this.context.emit(this.ctx,"internal/warning",new Error(`duplicate plugin detected: ${e.name}`)),i.fork(this.ctx,n,r)):(i=new Vo(this.ctx,e,n,r),this.set(e,i),i.fork(this.ctx,n,r))}},ie(Dn,"Registry"),Dn),Cf=Ef,Ke=(Pe=class{static is(e){return!!e?.[Pe.is]}static associate(e,n){return e}constructor(e){e=Hn(this.constructor,e),this[Y.store]=Object.create(null),this[Y.isolate]=Object.create(null),this[Y.internal]=Object.create(null),this[Y.intercept]=Object.create(null);const n=new Proxy(this,Ki.handler);n.root=n,n.reflect=new Ki(n),n.registry=new Cf(n,e),n.lifecycle=new xf(n);const r=ie(i=>{if(i){r(Object.getPrototypeOf(i));for(const s of Object.getOwnPropertyNames(i)){const o=i[s].prototype?.constructor;o&&(n[i[s].key]=new o(n,e),Be(n[i[s].key],"ctx",n))}}},"attach");return r(this[Y.internal]),n}[Symbol.for("nodejs.util.inspect.custom")](){return`Context <${this.name}>`}get name(){let e=this.runtime;for(;e&&!e.name;)e=e.parent.runtime;return e?.name}get events(){return this.lifecycle}get state(){return this.scope}extend(e={}){const n=Reflect.getOwnPropertyDescriptor(this,Y.shadow)?.value,r=Object.assign(Object.create(mt(this,this)),e);return n?Object.assign(Object.create(r),{[Y.shadow]:n}):r}isolate(e,n){const r=Object.create(this[Y.isolate]);return r[e]=n??Symbol(e),this.extend({[Y.isolate]:r})}intercept(e,n){const r=Object.create(this[Y.intercept]);return r[e]=n,this.extend({[Y.intercept]:r})}},ie(Pe,"Context"),te(Pe,"store",Y.store),te(Pe,"events",Y.events),te(Pe,"static",Y.static),te(Pe,"filter",Y.filter),te(Pe,"expose",Y.expose),te(Pe,"isolate",Y.isolate),te(Pe,"internal",Y.internal),te(Pe,"intercept",Y.intercept),te(Pe,"origin","ctx"),te(Pe,"current","ctx"),Pe.is[Symbol.toPrimitive]=()=>Symbol.for("cordis.is"),Pe.prototype[Pe.is]=!0,Pe);Ke.prototype[Ke.internal]=Object.create(null);var dn=(tt=class{constructor(...e){te(this,"ctx");te(this,"name");te(this,"config");let n,r,i,s;Ke.is(e[0])?(n=e[0],typeof e[1]=="string"?(r=e[1],i=e[2]):s=e[1]):s=e[0],r??(r=this.constructor[Y.provide]),i??(i=this.constructor[Y.immediate]);let o=this;const a={associate:r,property:"ctx"};return o[Y.invoke]&&(o=Vi(r,Hi(Object.getPrototypeOf(this),Function.prototype),a)),n?o.ctx=n:o[Y.setup](),o.name=r,o.config=s,Be(o,Y.tracker,a),o.ctx.provide(r),o.ctx.runtime.name=r,i&&(n?o[Y.expose]=r:o.ctx.set(r,o)),o.ctx.on("ready",async()=>{await Promise.resolve(),await o.start(),i||o.ctx.set(r,o)}),o.ctx.on("dispose",()=>o.stop()),o}start(){}stop(){}[Y.filter](e){return e[Y.isolate][this.name]===this.ctx[Y.isolate][this.name]}[Y.setup](){this.ctx=new Ke}[Y.extend](e){let n;return this[tt.invoke]?n=Vi(this.name,this,this[Y.tracker]):n=Object.create(this),Object.assign(n,e)}static[Symbol.hasInstance](e){let n=e.constructor;for(;n;){if(n=n.prototype?.constructor,n===this)return!0;n=Object.getPrototypeOf(n)}return!1}},ie(tt,"Service"),te(tt,"setup",Y.setup),te(tt,"invoke",Y.invoke),te(tt,"extend",Y.extend),te(tt,"tracker",Y.tracker),te(tt,"provide",Y.provide),te(tt,"immediate",Y.immediate),tt),Of=Object.defineProperty,kf=Object.getOwnPropertyNames,ue=(t,e)=>Of(t,"name",{value:e,configurable:!0}),Pf=(t,e)=>function(){return e||(0,t[kf(t)[0]])((e={exports:{}}).exports,e),e.exports},$f=Pf({"src/index.ts"(t,e){var A;var n=Symbol.for("schemastery"),r=Symbol.for("ValidationError");globalThis.__schemastery_index__??(globalThis.__schemastery_index__=0);var i=(A=class extends TypeError{constructor(h,O){let P="$";for(const R of O.path||[])typeof R=="string"?P+="."+R:typeof R=="number"?P+="["+R+"]":typeof R=="symbol"&&(P+=`[Symbol(${R.toString()})]`);P.startsWith(".")&&(P=P.slice(1));super((P==="$"?"":`${P} `)+h);te(this,"name","ValidationError");this.options=O}static is(h){return!!h?.[r]}},ue(A,"ValidationError"),A);Object.defineProperty(i.prototype,r,{value:!0});var s=ue(function(g){const m=ue(function(h,O={}){return s.resolve(h,m,O)[0]},"schema");if(g.refs){const h=Ot(g.refs,P=>new s(P)),O=ue(P=>h[P],"getRef");for(const P in h){const R=h[P];R.sKey=O(R.sKey),R.inner=O(R.inner),R.list=R.list&&R.list.map(O),R.dict=R.dict&&Ot(R.dict,O)}return h[g.uid]}if(Object.assign(m,g),typeof m.callback=="string")try{m.callback=new Function("return "+m.callback)()}catch{}return Object.defineProperty(m,"uid",{value:globalThis.__schemastery_index__++}),Object.setPrototypeOf(m,s.prototype),m.meta||(m.meta={}),m.toString=m.toString.bind(m),m},"Schema");s.prototype=Object.create(Function.prototype),s.prototype[n]=!0,s.ValidationError=i;var o;s.prototype.toJSON=ue(function(){var h;if(o)return o[h=this.uid]??(o[h]=JSON.parse(JSON.stringify({...this}))),this.uid;o={[this.uid]:{...this}},o[this.uid]=JSON.parse(JSON.stringify({...this}));const m={uid:this.uid,refs:o};return o=void 0,m},"toJSON"),s.prototype.set=ue(function(m,h){return this.dict[m]=h,this},"set"),s.prototype.push=ue(function(m){return this.list.push(m),this},"push");function a(g,m){const h=typeof g=="string"?{"":g}:{...g};for(const O in m){const P=m[O];P?.$description||P?.$desc?h[O]=P.$description||P.$desc:typeof P=="string"&&(h[O]=P)}return h}ue(a,"mergeDesc");function l(g){return g?.$value??g?.$inner}ue(l,"getInner");function u(g){return Lo(g??{},m=>!m.startsWith("$"))}ue(u,"extractKeys"),s.prototype.i18n=ue(function(m){const h=s(this),O=a(h.meta.description,m);return Object.keys(O).length&&(h.meta.description=O),h.dict&&(h.dict=Ot(h.dict,(P,R)=>P.i18n(Ot(m,V=>l(V)?.[R]??V?.[R])))),h.list&&(h.list=h.list.map((P,R)=>P.i18n(Ot(m,(V={})=>Array.isArray(l(V))?l(V)[R]:Array.isArray(V)?V[R]:u(V))))),h.inner&&(h.inner=h.inner.i18n(Ot(m,P=>l(P)?l(P):u(P)))),h.sKey&&(h.sKey=h.sKey.i18n(Ot(m,P=>P?.$key))),h},"i18n"),s.prototype.extra=ue(function(m,h){const O=s(this);return O.meta={...O.meta,[m]:h},O},"extra");for(const g of["required","disabled","collapse","hidden","loose"])Object.assign(s.prototype,{[g](m=!0){const h=s(this);return h.meta={...h.meta,[g]:m},h}});s.prototype.deprecated=ue(function(){var h;const m=s(this);return(h=m.meta).badges||(h.badges=[]),m.meta.badges.push({text:"deprecated",type:"danger"}),m},"deprecated"),s.prototype.experimental=ue(function(){var h;const m=s(this);return(h=m.meta).badges||(h.badges=[]),m.meta.badges.push({text:"experimental",type:"warning"}),m},"experimental"),s.prototype.pattern=ue(function(m){const h=s(this),O=Mo(m,["source","flags"]);return h.meta={...h.meta,pattern:O},h},"pattern"),s.prototype.simplify=ue(function(m){if(Qt(m,this.meta.default,this.type==="dict"))return null;if(Ce(m))return m;if(this.type==="object"||this.type==="dict"){const h={};for(const O in m){const R=(this.type==="object"?this.dict[O]:this.inner)?.simplify(m[O]);(this.type==="dict"||!Ce(R))&&(h[O]=R)}return Qt(h,this.meta.default,this.type==="dict")?null:h}else if(this.type==="array"||this.type==="tuple"){const h=[];return m.forEach((O,P)=>{const R=this.type==="array"?this.inner:this.list[P],V=R?R.simplify(O):O;h.push(V)}),h}else if(this.type==="intersect"){const h={};for(const O of this.list)Object.assign(h,O.simplify(m));return h}else if(this.type==="union")for(const h of this.list)try{return s.resolve(m,h,{}),h.simplify(m)}catch{}return m},"simplify"),s.prototype.toString=ue(function(m){return z[this.type]?.(this,m)??`Schema<${this.type}>`},"toString"),s.prototype.role=ue(function(g,m){const h=s(this);return h.meta={...h.meta,role:g,extra:m},h},"role");for(const g of["default","link","comment","description","max","min","step"])Object.assign(s.prototype,{[g](m){const h=s(this);return h.meta={...h.meta,[g]:m},h}});var c={};s.extend=ue(function(m,h){c[m]=h},"extend"),s.resolve=ue(function(m,h,O={},P=!1){if(!h)return[m];if(O.ignore?.(m,h))return[m];if(Ce(m)&&h.type!=="lazy"){if(h.meta.required)throw new i("missing required value",O);let V=h,Z=h.meta.default;for(;V?.type==="intersect"&&Ce(Z);)V=V.list[0],Z=V?.meta.default;if(Ce(Z))return[m];m=Er(Z)}const R=c[h.type];if(!R)throw new i(`unsupported type "${h.type}"`,O);try{return R(m,h,O,P)}catch(V){if(!h.meta.loose)throw V;return[h.meta.default]}},"resolve"),s.from=ue(function(m){if(Ce(m))return s.any();if(["string","number","boolean"].includes(typeof m))return s.const(m).required();if(m[n])return m;if(typeof m=="function")switch(m){case String:return s.string().required();case Number:return s.number().required();case Boolean:return s.boolean().required();case Function:return s.function().required();default:return s.is(m).required()}else throw new TypeError(`cannot infer schema from ${m}`)},"from"),s.lazy=ue(function(m){const h=ue(()=>(O.inner[n]||(O.inner=O.builder(),O.inner.meta={...O.meta,...O.inner.meta}),O.inner.toJSON()),"toJSON"),O=new s({type:"lazy",builder:m,inner:{toJSON:h}});return O},"lazy"),s.natural=ue(function(){return s.number().step(1).min(0)},"natural"),s.percent=ue(function(){return s.number().step(.01).min(0).max(1).role("slider")},"percent"),s.date=ue(function(){return s.union([s.is(Date),s.transform(s.string().role("datetime"),(m,h)=>{const O=new Date(m);if(isNaN(+O))throw new i(`invalid date "${m}"`,h);return O},!0)])},"date"),s.regExp=ue(function(m=""){return s.union([s.is(RegExp),s.transform(s.string().role("regexp",{flag:m}),(h,O)=>{try{return new RegExp(h,m)}catch(P){throw new i(P.message,O)}},!0)])},"regExp"),s.arrayBuffer=ue(function(m){return s.union([s.is(ArrayBuffer),s.is(SharedArrayBuffer),s.transform(s.any(),(h,O)=>{if(pt.isSource(h))return pt.fromSource(h);throw new i(`expected ArrayBufferSource but got ${h}`,O)},!0),...m?[s.transform(s.string(),(h,O)=>{try{return m==="base64"?pt.fromBase64(h):pt.fromHex(h)}catch(P){throw new i(P.message,O)}},!0)]:[]])},"arrayBuffer"),s.extend("lazy",(g,m,h,O)=>(m.inner[n]||(m.inner=m.builder(),m.inner.meta={...m.meta,...m.inner.meta}),s.resolve(g,m.inner,h,O))),s.extend("any",g=>[g]),s.extend("never",(g,m,h)=>{throw new i(`expected nullable but got ${g}`,h)}),s.extend("const",(g,{value:m},h)=>{if(Qt(g,m))return[m];throw new i(`expected ${m} but got ${g}`,h)});function f(g,m,h,O,P=!1){const{max:R=1/0,min:V=-1/0}=m;if(g>R)throw new i(`expected ${h} <= ${R} but got ${g}`,O);if(g<V&&!P)throw new i(`expected ${h} >= ${V} but got ${g}`,O)}ue(f,"checkWithinRange"),s.extend("string",(g,{meta:m},h)=>{if(typeof g!="string")throw new i(`expected string but got ${g}`,h);if(m.pattern){const O=new RegExp(m.pattern.source,m.pattern.flags);if(!O.test(g))throw new i(`expect string to match regexp ${O}`,h)}return f(g.length,m,"string length",h),[g]});function w(g,m){const h=g.toString();if(h.includes("e"))return g*Math.pow(10,m);const O=h.indexOf(".");if(O===-1)return g*Math.pow(10,m);const P=h.slice(O+1),R=h.slice(0,O);return P.length<=m?+(R+P.padEnd(m,"0")):+(R+P.slice(0,m)+"."+P.slice(m))}ue(w,"decimalShift");function y(g,m,h){if(h=Math.abs(h),!/^\d+\.\d+$/.test(h.toString()))return(g-m)%h===0;const O=h.toString().indexOf("."),P=h.toString().slice(O+1).length;return Math.abs(w(g,P)-w(m,P))%w(h,P)===0}ue(y,"isMultipleOf"),s.extend("number",(g,{meta:m},h)=>{if(typeof g!="number")throw new i(`expected number but got ${g}`,h);f(g,m,"number",h);const{step:O}=m;if(O&&!y(g,m.min??0,O))throw new i(`expected number multiple of ${O} but got ${g}`,h);return[g]}),s.extend("boolean",(g,m,h)=>{if(typeof g=="boolean")return[g];throw new i(`expected boolean but got ${g}`,h)}),s.extend("bitset",(g,{bits:m,meta:h},O)=>{let P=0,R=[];if(typeof g=="number"){P=g;for(const V in m)g&m[V]&&R.push(V)}else if(Array.isArray(g)){R=g;for(const V of R){if(typeof V!="string")throw new i(`expected string but got ${V}`,O);V in m&&(P|=m[V])}}else throw new i(`expected number or array but got ${g}`,O);return P===h.default?[P]:[P,R]}),s.extend("function",(g,m,h)=>{if(typeof g=="function")return[g];throw new i(`expected function but got ${g}`,h)}),s.extend("is",(g,{constructor:m},h)=>{if(typeof m=="function"){if(g instanceof m)return[g];throw new i(`expected ${m.name} but got ${g}`,h)}else{if(Ce(g))throw new i(`expected ${m} but got ${g}`,h);let O=Object.getPrototypeOf(g);for(;O;){if(O.constructor?.name===m)return[g];O=Object.getPrototypeOf(O)}throw new i(`expected ${m} but got ${g}`,h)}});function v(g,m,h,O){try{const[P,R]=s.resolve(g[m],h,{...O,path:[...O.path||[],m]});return R!==void 0&&(g[m]=R),P}catch(P){if(!O?.autofix)throw P;return delete g[m],h.meta.default}}ue(v,"property"),s.extend("array",(g,{inner:m,meta:h},O)=>{if(!Array.isArray(g))throw new i(`expected array but got ${g}`,O);return f(g.length,h,"array length",O,!Ce(m.meta.default)),[g.map((P,R)=>v(g,R,m,O))]}),s.extend("dict",(g,{inner:m,sKey:h},O,P)=>{if(!Sr(g))throw new i(`expected object but got ${g}`,O);const R={};for(const V in g){let Z;try{Z=s.resolve(V,h,O)[0]}catch($e){if(P)continue;throw $e}R[Z]=v(g,V,m,O),g[Z]=g[V],V!==Z&&delete g[V]}return[R]}),s.extend("tuple",(g,{list:m},h,O)=>{if(!Array.isArray(g))throw new i(`expected array but got ${g}`,h);const P=m.map((R,V)=>v(g,V,R,h));return O?[P]:(P.push(...g.slice(m.length)),[P])});function I(g,m){for(const h in m)h in g||(g[h]=m[h])}ue(I,"merge"),s.extend("object",(g,{dict:m},h,O)=>{if(!Sr(g))throw new i(`expected object but got ${g}`,h);const P={};for(const R in m){const V=v(g,R,m[R],h);(!Ce(V)||R in g)&&(P[R]=V)}return O||I(P,g),[P]}),s.extend("union",(g,{list:m,toString:h},O,P)=>{for(const R of m)try{return s.resolve(g,R,O,P)}catch{}throw new i(`expected ${h()} but got ${JSON.stringify(g)}`,O)}),s.extend("intersect",(g,{list:m,toString:h},O,P)=>{let R;for(const V of m){const Z=s.resolve(g,V,O,!0)[0];if(!Ce(Z))if(Ce(R))R=Z;else{if(typeof R!=typeof Z)throw new i(`expected ${h()} but got ${JSON.stringify(g)}`,O);if(typeof Z=="object")I(R??(R={}),Z);else if(R!==Z)throw new i(`expected ${h()} but got ${JSON.stringify(g)}`,O)}}return!P&&Sr(g)&&I(R,g),[R]}),s.extend("transform",(g,{inner:m,callback:h,preserve:O},P)=>{const[R,V=g]=s.resolve(g,m,P,!0);return O?[h(R)]:[h(R),h(V)]});var z={};function F(g,m,h){z[g]=h,Object.assign(s,{[g](...O){const P=new s({type:g});return m.forEach((R,V)=>{switch(R){case"sKey":P.sKey=O[V]??s.string();break;case"inner":P.inner=s.from(O[V]);break;case"list":P.list=O[V].map(s.from);break;case"dict":P.dict=Ot(O[V],s.from);break;case"bits":{P.bits={};for(const Z in O[V])typeof O[V][Z]=="number"&&(P.bits[Z]=O[V][Z]);break}case"callback":{const Z=P.callback=O[V];Z.toJSON||(Z.toJSON=()=>Z.toString());break}case"constructor":{const Z=P.constructor=O[V];typeof Z=="function"&&(Z.toJSON||(Z.toJSON=()=>Z.name));break}default:P[R]=O[V]}}),g==="object"||g==="dict"?P.meta.default={}:g==="array"||g==="tuple"?P.meta.default=[]:g==="bitset"&&(P.meta.default=0),P}})}ue(F,"defineMethod"),F("is",["constructor"],({constructor:g})=>typeof g=="function"?g.name:g),F("any",[],()=>"any"),F("never",[],()=>"never"),F("const",["value"],({value:g})=>typeof g=="string"?JSON.stringify(g):g),F("string",[],()=>"string"),F("number",[],()=>"number"),F("boolean",[],()=>"boolean"),F("bitset",["bits"],()=>"bitset"),F("function",[],()=>"function"),F("array",["inner"],({inner:g})=>`${g.toString(!0)}[]`),F("dict",["inner","sKey"],({inner:g,sKey:m})=>`{ [key: ${m.toString()}]: ${g.toString()} }`),F("tuple",["list"],({list:g})=>`[${g.map(m=>m.toString()).join(", ")}]`),F("object",["dict"],({dict:g})=>Object.keys(g).length===0?"{}":`{ ${Object.entries(g).map(([m,h])=>`${m}${h.meta.required?"":"?"}: ${h.toString()}`).join(", ")} }`),F("union",["list"],({list:g},m)=>{const h=g.map(({toString:O})=>O()).join(" | ");return m?`(${h})`:h}),F("intersect",["list"],({list:g})=>`${g.map(m=>m.toString(!0)).join(" & ")}`),F("transform",["inner","callback","preserve"],({inner:g},m)=>g.toString(m)),e.exports=s}});const xe=$f();var Ji=(t=>(t[t.debug=-1]="debug",t[t.log=0]="log",t[t.info=1]="info",t[t.warn=2]="warn",t[t.error=3]="error",t[t.silent=4]="silent",t))(Ji||{});const Yo=globalThis["con".concat("sole")],Go=new Map;function kr(t,e){Go.set(t,e)}function Qi(t){const e=Go.get(t);return e||Af(t)}function Af(t){let e=2166136261;for(let s=0;s<t.length;s++)e^=t.charCodeAt(s),e=Math.imul(e,16777619);return`hsl(${e%360}, 65%, 45%)`}function If(t){return!!t&&Object.prototype.toString.call(t)==="[object Object]"}function Jo(t){if(t.length===0)return{args:t,opts:{}};const e=t[t.length-1];return If(e)&&"print"in e&&Object.keys(e).every(n=>n==="print")?{args:t.slice(0,-1),opts:e}:{args:t,opts:{}}}const Tf={log:{rank:0,label:"L",method:"log"},info:{rank:1,label:"I",method:"info"},warn:{rank:2,label:"W",method:"warn"},error:{rank:3,label:"E",method:"error"}};function Rf(t){return{level:t.level,enabled:t.enabled,name:t.name,nameColor:t.nameColor,groups:t.groups.slice(),levels:new Map(t.levels),hooks:{...t.hooks}}}const Xi=function(e){return Qo(e)};Xi.create=t=>Qo(t);function Qo(t={}){const e={level:t.level??0,enabled:t.enabled??!0,name:t.name,nameColor:t.color,groups:[],levels:new Map(Object.entries({...Tf,...t.levels??{}}).map(([r,i])=>[r,Xo(i)])),hooks:{}};e.name&&e.nameColor&&kr(e.name,e.nameColor);const n=(r,i)=>Zi(n,e,r,i);Zo(n,e);for(const r of e.levels.keys())Pr(n,e,r);return n}function Xo(t){return{rank:t.rank,label:t.label??Nf(t.rank),method:t.method??Df(t.rank)}}function Df(t){return t>=3?"error":t===2?"warn":t===1?"info":"log"}function Nf(t){switch(t){case 3:return"E";case 2:return"W";case 1:return"I";default:return"L"}}function Zo(t,e){Object.defineProperties(t,{isLogger:{value:!0,enumerable:!1},level:{get(){return e.level},set(n){e.level=n|0},enumerable:!0,configurable:!1},enabled:{get(){return e.enabled},set(n){e.enabled=!!n},enumerable:!0,configurable:!1},name:{get(){return e.name},set(n){e.name=n},enumerable:!0,configurable:!1},color:{get(){return e.nameColor},set(n){e.nameColor=n,e.name&&n&&kr(e.name,n)},enumerable:!0,configurable:!1},group:{value:(n,r)=>Zi(t,e,n,r),enumerable:!1},at:{value:(n,...r)=>ea(t,e,n,r),enumerable:!1},defineLevel:{value:(n,r)=>{e.levels.set(n,Xo(r)),Pr(t,e,n)},enumerable:!1},setHooks:{value:n=>{e.hooks={...e.hooks,...n}},enumerable:!1},setLabelColor:{value:(n,r)=>kr(n,r),enumerable:!1}});for(const n of["log","info","warn","error"])n in t||Pr(t,e,n)}function Pr(t,e,n){Object.defineProperty(t,n,{value:(...r)=>ea(t,e,n,r),enumerable:!1,configurable:!0})}function Zi(t,e,n,r){const i=Rf(e);i.groups.push({label:n,color:r?.color}),r?.color&&kr(n,r.color);const s=(o,a)=>Zi(s,i,o,a);Zo(s,i);for(const o of i.levels.keys())Pr(s,i,o);return s}function ea(t,e,n,r){const i=e.levels.get(n);if(!i){const{args:u}=Jo(r),c={level:n,rank:Number.NEGATIVE_INFINITY,method:"log",prefix:e.name,groupPath:e.groups.map(f=>f.label),args:u,enabled:e.enabled,willPrint:e.enabled};if(e.hooks.beforeEmit&&e.hooks.beforeEmit(c)===!1)return;na({method:"log",prefix:e.name,prefixColor:ta(e),groups:e.groups},n,u),e.hooks.afterEmit?.(c);return}const{args:s,opts:o}=Jo(r),a=e.enabled&&(i.rank>=e.level||!!o.print),l={level:n,rank:i.rank,method:i.method,prefix:e.name,groupPath:e.groups.map(u=>u.label),args:s,enabled:e.enabled,willPrint:a};e.hooks.beforeEmit&&e.hooks.beforeEmit(l)===!1||a&&(na({method:i.method,prefix:e.name,prefixColor:ta(e),groups:e.groups,levelBadge:i.label??n},void 0,s),e.hooks.afterEmit?.(l))}function ta(t){if(t.name)return t.nameColor??Qi(t.name)}function na(t,e,n){const r=[],i=[];if(t.prefix){const o=t.prefixColor??Qi(t.prefix);r.push(`%c${t.prefix}`),i.push(jf(o)),r.push("%c"),i.push(""),r.push(" ")}t.levelBadge?(r.push(`[${t.levelBadge}]`),r.push(" ")):e&&r.push(`[${e}] `);for(const o of t.groups){const a=o.color??Qi(o.label);r.push(`%c${o.label}`),i.push(Lf(a)),r.push("%c"),i.push(""),r.push(" ")}const s=Yo[t.method]?t.method:"log";Yo[s](r.join(""),...i,...n)}function jf(t){return`background: ${t}; color: #fff; font-weight: 700; padding: 1px 2px; border-radius: 4px;`}function Lf(t){return`color: ${t}; font-weight: 600; text-decoration: underline;`}var Xe=(t=>(t.BODY_USED="BODY_USED",t.NO_BODY_READER="NO_BODY_READER",t.TIMEOUT="TIMEOUT",t.NETWORK_ERROR="NETWORK_ERROR",t.BODY_NOT_ALLOWED="BODY_NOT_ALLOWED",t.HOOK_CONTEXT_CHANGED="HOOK_CONTEXT_CHANGED",t.ABORTED_BY_HOOK="ABORTED_BY_HOOK",t.INVALID_HOOK_CALLBACK="INVALID_HOOK_CALLBACK",t.UNEXPECTED_HOOK_RETURN="UNEXPECTED_HOOK_RETURN",t))(Xe||{});class Ye extends Error{constructor(e,n,r,i){super(n,i),this.code=e,this.context=r,this.name="FexiosError"}}let Mf=class extends Ye{constructor(e,n,r){super(n.statusText,e,void 0,r),this.response=n,this.name="FexiosResponseError"}};function Ff(t,e=2048){if(!(t instanceof Uint8Array))throw new TypeError("Input must be a Uint8Array");if(t.length===0)return!0;const n=Math.min(Math.max(t.length,256),e),r=t.slice(0,n);if(Bf(r))return!1;const i=Uf(r);if(i.nullByteRatio>.05||i.highByteRatio>.95)return!1;const s=["utf-8","utf-16le","utf-16be","iso-8859-1"];let o=-1,a=!1;for(const l of s)try{const u=new TextDecoder(l,{fatal:!0}).decode(r),c=Hf(u);c>o&&(o=c,a=c>.7)}catch{continue}return a}function Bf(t){if(t.length<4)return!1;const e=[[137,80,78,71],[255,216,255],[71,73,70],[37,80,68,70],[80,75,3,4],[80,75,5,6],[80,75,7,8],[127,69,76,70],[77,90],[202,254,186,190],[0,0,1,0],[82,73,70,70]];for(const n of e)if(t.length>=n.length){let r=!0;for(let i=0;i<n.length;i++)if(t[i]!==n[i]){r=!1;break}if(r)return!0}return!1}function Uf(t){let e=0,n=0,r=0;for(const i of t)i===0&&e++,i>127&&n++,(i<32&&i!==9&&i!==10&&i!==13||i===127)&&r++;return{nullByteRatio:e/t.length,highByteRatio:n/t.length,controlCharRatio:r/t.length}}function Hf(t){if(t.length===0)return 1;let e=1,n=0;for(let i=0;i<t.length;i++){const s=t[i].charCodeAt(0);s>=32&&s<=126||s===9||s===10||s===13||s===32?n++:s>127&&s<65534?!Wf(s)&&!qf(s)&&n++:e-=.1}const r=n/t.length;return e*=r,zf(t)&&(e*=1.1),Math.max(0,Math.min(1,e))}function Wf(t){return t>=0&&t<=31||t>=127&&t<=159}function qf(t){return t>=57344&&t<=63743||t>=983040&&t<=1048573||t>=1048576&&t<=1114109}function zf(t){return[/\b\w+\b/,/[.!?]+\s/,/\s+/,/[a-zA-Z]{3,}/,/[\u4e00-\u9fa5]+/,/\d+/].some(e=>e.test(t))}function es(t){if(typeof t!="object"||t===null||Object.prototype.toString.call(t)!=="[object Object]")return!1;const e=Object.getPrototypeOf(t);return e===Object.prototype||e===null}function ra(t,e={}){const n={};return Object.entries(t).forEach(([r,i])=>{i!=null&&(e.dropEmptyString&&i===""||(n[r]=i))}),n}let qn=class{constructor(e,n,r){this.rawResponse=e,this.data=n,this.ok=e.ok,this.status=e.status,this.statusText=e.statusText,this.headers=e.headers,Object.entries(r||{}).forEach(([i,s])=>{this[i]=s})}};async function Vf(t,e,n){var r;if(t.bodyUsed)throw new Ye(Xe.BODY_USED,"Response body has already been used or locked");const i=t.headers.get("content-type")||"",s=Number(t.headers.get("content-length"))||0,o=(l,u)=>u==="json"||l.startsWith("application/json"),a=(l,u,c)=>c==="blob"||l.startsWith("image/")&&!l.startsWith("image/svg")||l.startsWith("video/")||l.startsWith("audio/")||!Ff(u);if((t.status===101||t.status===426||t.headers.get("upgrade"))&&typeof globalThis.WebSocket<"u"){const l=new WebSocket(t.url);return await new Promise((u,c)=>{l.onopen=u,l.onerror=c}),new qn(t,l,{ok:!0,status:101,statusText:"Switching Protocols"})}else if(i.startsWith("text/event-stream")&&!["text","json"].includes(e||"")&&typeof globalThis.EventSource<"u"){const l=new EventSource(t.url);return await new Promise((u,c)=>{l.onopen=u,l.onerror=c}),new qn(t,l)}else{if(e==="stream")return new qn(t,t.body);{const l=(r=t.clone().body)==null?void 0:r.getReader();if(!l)throw new Ye(Xe.NO_BODY_READER,"Failed to get ReadableStream from response body");let u=new Uint8Array;for(;;){const{done:f,value:w}=await l.read();if(f)break;if(w&&(u=new Uint8Array([...u,...w]),n&&s>0)){const y=Math.min(u.length/s,1);n(y,u)}}const c=new qn(t,void 0);if(e==="arrayBuffer")return c.data=u.buffer,c;if(o(i,e))try{const f=new TextDecoder().decode(u);c.data=JSON.parse(f)}catch{}if(typeof c.data!="string"&&a(i,u,e)?c.data=new Blob([u],{type:t.headers.get("content-type")||void 0}):c.data=new TextDecoder().decode(u),typeof c.data=="string"&&e!=="text"){const f=c.data.trim(),w=f[0],y=f[f.length-1];if(w==="{"&&y==="}"||w==="["&&y==="]")try{c.data=JSON.parse(c.data)}catch{}}if(typeof c.data>"u"&&(c.data=u.length>0?u:void 0),c.ok)return c;throw new Mf(`Request failed with status code ${t.status}`,c)}}}let Kf=class{static makeSearchParams(e){const n=new URLSearchParams;return Object.entries(e).forEach(([r,i])=>{Array.isArray(i)?i.forEach(s=>n.append(r,String(s))):n.set(r,String(i))}),n}static makeQueryString(e){return this.makeSearchParams(e).toString()}};function Yf(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var ts,ia;function Gf(){if(ia)return ts;ia=1;function t(e){var n=this.constructor.prototype[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,this.constructor.prototype),Object.getOwnPropertyNames(n).forEach(function(i){Object.defineProperty(r,i,Object.getOwnPropertyDescriptor(n,i))}),r}return t.prototype=Object.create(Function.prototype),ts=t,ts}var Jf=Gf();const Qf=Yf(Jf);let sa=class Fi extends Qf{constructor(e={}){super("request"),this.baseConfigs=e,this.hooks=[],this.DEFAULT_CONFIGS={baseURL:"",timeout:60*1e3,credentials:"same-origin",headers:{},query:{},responseType:void 0},this.ALL_METHODS=["get","post","put","patch","delete","head","options","trace"],this.METHODS_WITHOUT_BODY=["get","head","options","trace"],this.interceptors={request:this.createInterceptor("beforeRequest"),response:this.createInterceptor("afterResponse")},this.create=Fi.create,this.dropUndefinedAndNull=ra,this.checkIsPlainObject=es,this.ALL_METHODS.forEach(this.createMethodShortcut.bind(this))}async request(e,n){var r,i,s,o;let a=n=n||{};typeof e=="string"||e instanceof URL?a.url=e.toString():typeof e=="object"&&(a={...e,...a}),a=await this.emit("beforeInit",a);const l=n.baseURL||this.baseConfigs.baseURL||((r=globalThis.location)==null?void 0:r.href),u=l?new URL(l,(i=globalThis.location)==null?void 0:i.href):void 0,c=new URL(a.url.toString(),u);a.url=c.href,a.baseURL=u?u.href:c.origin,a.headers=this.mergeHeaders(this.baseConfigs.headers,n.headers);const f=u?.searchParams,w=new URLSearchParams(c.searchParams);if(c.search="",a.url=c.href,a.query=this.mergeQuery(f,this.baseConfigs.query,w,n.query),c.search=Kf.makeQueryString(a.query),a.url=c.toString(),this.METHODS_WITHOUT_BODY.includes((s=a.method)==null?void 0:s.toLocaleLowerCase())&&a.body)throw new Ye(Xe.BODY_NOT_ALLOWED,`Request method "${a.method}" does not allow body`);a=await this.emit("beforeRequest",a);let y;typeof a.body<"u"&&a.body!==null&&(a.body instanceof Blob||a.body instanceof FormData||a.body instanceof URLSearchParams?y=a.body:typeof a.body=="object"&&a.body!==null?(y=JSON.stringify(a.body),a.headers["content-type"]="application/json"):y=a.body),!((o=n.headers)!=null&&o["content-type"])&&y&&(y instanceof FormData||y instanceof URLSearchParams?delete a.headers["content-type"]:typeof y=="string"&&typeof a.body=="object"?a.headers["content-type"]="application/json":y instanceof Blob&&(a.headers["content-type"]=y.type)),a.body=y,a=await this.emit("afterBodyTransformed",a);const v=a.abortController||globalThis.AbortController?new AbortController:void 0,I=new Request(a.url,{method:a.method||"GET",credentials:a.credentials,cache:a.cache,mode:a.mode,headers:a.headers,body:a.body,signal:v?.signal});a.rawRequest=I,a=await this.emit("beforeActualFetch",a);const z=a.timeout||this.baseConfigs.timeout||60*1e3;if(a.url.startsWith("ws"))try{const A=new WebSocket(a.url);return await new Promise((g,m)=>{const h=setTimeout(()=>{m(new Ye(Xe.TIMEOUT,`WebSocket connection timed out after ${z}ms`,a))},z);A.onopen=()=>{clearTimeout(h),g()},A.onerror=O=>{clearTimeout(h),m(new Ye(Xe.NETWORK_ERROR,"WebSocket connection failed",a))},A.onclose=O=>{O.code!==1e3&&(clearTimeout(h),m(new Ye(Xe.NETWORK_ERROR,`WebSocket closed with code ${O.code}`,a)))}}),a.rawResponse=new Response,a.response=new qn(a.rawResponse,A,{ok:!0,status:101,statusText:"Switching Protocols"}),a.data=A,a.headers=new Headers,this.emit("afterResponse",a)}catch(A){throw A instanceof Ye?A:new Ye(Xe.NETWORK_ERROR,`WebSocket creation failed: ${A}`,a)}let F;try{v&&(F=setTimeout(()=>{v.abort()},z));const A=await fetch(a.rawRequest).catch(g=>{throw F&&clearTimeout(F),v!=null&&v.signal.aborted?new Ye(Xe.TIMEOUT,`Request timed out after ${z}ms`,a):new Ye(Xe.NETWORK_ERROR,g.message,a)});return F&&clearTimeout(F),a.rawResponse=A,a.response=await Vf(A,a.responseType,(g,m)=>{var h;(h=n?.onProgress)==null||h.call(n,g,m)}),a.data=a.response.data,a.headers=a.response.headers,this.emit("afterResponse",a)}catch(A){throw F&&clearTimeout(F),A}}mergeQuery(e,...n){const r={},i=s=>{s&&(es(s)?Object.entries(s).forEach(([o,a])=>{a==null?delete r[o]:Array.isArray(a)?(o.endsWith("[]"),r[o]=a.map(String)):r[o]=String(a)}):new URLSearchParams(s).forEach((o,a)=>{r[a]=o}))};return i(e),n.forEach(i),r}mergeHeaders(e,...n){const r={},i=new Headers(e);for(const s of n)if(s!=null)if(es(s)){const o=ra(s);if(Object.keys(o).length===0)continue;new Headers(o).forEach((a,l)=>{i.set(l,a)})}else new Headers(s).forEach((o,a)=>{i.set(a,o)});return i.forEach((s,o)=>{r[o]=s}),r}async emit(e,n){const r=this.hooks.filter(i=>i.event===e);try{let i=0;for(const s of r){const o=`${e}#${s.action.name||`anonymous#${i}`}`,a=Symbol("FexiosHookContext");n[a]=a;const l=await s.action.call(this,n);if(l===!1)throw new Ye(Xe.ABORTED_BY_HOOK,`Request aborted by hook "${o}"`,n);if(typeof l=="object"&&l[a]===a)n=l;else{const u=globalThis["".concat("console")];try{throw new Ye(Xe.HOOK_CONTEXT_CHANGED,`Hook "${o}" should return the original FexiosContext or return false to abort the request, but got "${l}".`)}catch(c){u.warn(c.stack||c)}}delete n[a],i++}}catch(i){return Promise.reject(i)}return n}on(e,n,r=!1){if(typeof n!="function")throw new Ye(Xe.INVALID_HOOK_CALLBACK,`Hook should be a function, but got "${typeof n}"`);return this.hooks[r?"unshift":"push"]({event:e,action:n}),this}off(e,n){return e==="*"||!e?this.hooks=this.hooks.filter(r=>r.action!==n):this.hooks=this.hooks.filter(r=>r.event!==e||r.action!==n),this}createInterceptor(e){return{handlers:()=>this.hooks.filter(n=>n.event===e).map(n=>n.action),use:(n,r=!1)=>this.on(e,n,r),clear:()=>{this.hooks=this.hooks.filter(n=>n.event!==e)}}}createMethodShortcut(e){return Object.defineProperty(this,e,{value:(n,r,i)=>(this.METHODS_WITHOUT_BODY.includes(e.toLocaleLowerCase())?i=r:(i=i||{},i.body=r),this.request(n,{...i,method:e}))}),this}extends(e){const n=new Fi({...this.baseConfigs,...e});return n.hooks=[...this.hooks],n}static create(e){return new Fi(e)}};/**
3
+ `),e.emit(e,"internal/warning",r)}get(e){if(this.ctx[G.internal][e]?.type!=="service")return;const r=this.ctx[G.isolate][e],i=this.ctx[G.store][r]?.value;return mt(this.ctx,i)}set(e,n){this.provide(e);const r=this.ctx[G.isolate][e],i=this.ctx[G.store][r]?.value;n??(n=void 0);let s=ie(()=>{},"dispose");if(i===n)return s;if(!Oe(n)&&!Oe(i))throw new Error(`service ${e} has been registered`);const o=this.ctx;Oe(n)||(s=o.effect(()=>()=>{o.set(e,void 0)})),Wo(n)&&o.emit(o,"internal/warning",new Error(`service ${e} is an unproxyable object, which may lead to unexpected behavior`));const a=Object.create(o);return a[G.filter]=l=>o[G.isolate][e]===l[G.isolate][e],o.emit(a,"internal/before-service",e,n),o[G.store][r]={value:n,source:o},o.emit(a,"internal/service",e,i),s}provide(e,n,r){const i=this.ctx.root[G.internal];if(e in i)return;const s=Symbol(e);i[e]={type:"service",builtin:r},this.ctx.root[G.isolate][e]=s,Wi(n)&&(this.ctx[G.store][s]={value:n,source:null},Be(n,G.tracker,{associate:e,property:"ctx"}))}_accessor(e,n){const r=this.ctx.root[G.internal];return e in r?()=>{}:(r[e]={type:"accessor",...n},()=>delete this.ctx.root[G.isolate][e])}accessor(e,n){this.ctx.scope.effect(()=>this._accessor(e,n))}alias(e,n){const r=this.ctx.root[G.internal];if(!(e in r))for(const i of n)r[i]||(r[i]={type:"alias",name:e})}_mixin(e,n){const r=Array.isArray(n)?n.map(o=>[o,o]):Object.entries(n),i=typeof e=="string"?o=>o[e]:()=>e,s=r.map(([o,a])=>this._accessor(a,{get(l){const u=i(this);if(Oe(u))return u;const c=l?Wn(l,u):u,f=Reflect.get(u,o,c);return typeof f!="function"?f:f.bind(c??u)},set(l,u){const c=i(this),f=u?Wn(u,c):c;return Reflect.set(c,o,l,f)}}));return()=>s.forEach(o=>o())}mixin(e,n){this.ctx.scope.effect(()=>this._mixin(e,n))}trace(e){return mt(this.ctx,e)}bind(e){return new Proxy(e,{apply:ie((n,r,i)=>n.apply(this.trace(r),i.map(s=>this.trace(s))),"apply")})}},ie(ct,"ReflectService"),te(ct,"handler",{get:ie((e,n,r)=>{if(typeof n!="string")return Reflect.get(e,n,r);if(Reflect.has(e,n))return mt(r,Reflect.get(e,n,r),!0);const[i,s]=ct.resolveInject(e,n),o=new Error(`property ${i} is not registered, declare it as \`inject\` to suppress this warning`);return s?s.type==="accessor"?s.get.call(r,r[G.receiver]):(s.builtin||ct.checkInject(r,i,o),r.reflect.get(i)):(ct.checkInject(r,i,o),Reflect.get(e,i,r))},"get"),set:ie((e,n,r,i)=>{if(typeof n!="string")return Reflect.set(e,n,r,i);const[s,o]=ct.resolveInject(e,n);return o?o.type==="accessor"?o.set?o.set.call(i,r,i[G.receiver]):!1:(i.reflect.set(s,r),!0):Reflect.set(e,s,r,i)},"set"),has:ie((e,n)=>{if(typeof n!="string")return Reflect.has(e,n);if(Reflect.has(e,n))return!0;const[,r]=ct.resolveInject(e,n);return!!r},"has")}),ct),Ki=vf;function Gi(t){return t!==null&&t!==!1&&t!==void 0}ie(Gi,"isBailed");var bf=(An=class{constructor(e){te(this,"isActive",!1);te(this,"_tasks",new Set);te(this,"_hooks",{});this.ctx=e,Be(this,G.tracker,{associate:"lifecycle",property:"ctx"}),Be(this.on("internal/listener",function(r,i,s){const o=s.prepend?"unshift":"push";if(r==="ready")return this.lifecycle.isActive?(this.scope.ensure(async()=>i()),()=>!1):void 0;if(r==="dispose")return this.scope.disposables[o](i),Be(i,"name","event <dispose>"),()=>jt(this.scope.disposables,i);if(r==="fork")return this.scope.runtime.forkables[o](i),this.scope.collect("event <fork>",()=>jt(this.scope.runtime.forkables,i))}),Ke.static,e.scope);for(const r of["info","error","warning"])Be(this.on(`internal/${r}`,(i,...s)=>{this._hooks[`internal/${r}`].length>1||console.info(i,...s)}),Ke.static,e.scope);Be(this.on("internal/before-service",function(r){for(const i of this.registry.values()){if(!i.inject[r]?.required)continue;const s=i.isReusable?i.children:[i];for(const o of s)this[G.filter](o.ctx)&&(o.updateStatus(),o.reset())}},{global:!0}),Ke.static,e.scope),Be(this.on("internal/service",function(r){for(const i of this.registry.values()){if(!i.inject[r]?.required)continue;const s=i.isReusable?i.children:[i];for(const o of s)this[G.filter](o.ctx)&&o.start()}},{global:!0}),Ke.static,e.scope);const n=ie((r,i)=>{if(!r.runtime.plugin)return!1;for(const s in r.runtime.inject)if(i===Ki.resolveInject(r.ctx,s)[0])return!0;return n(r.parent.scope,i)},"checkInject");Be(this.on("internal/inject",function(r){return n(this.scope,r)},{global:!0}),Ke.static,e.scope)}async flush(){for(;this._tasks.size;)await Promise.all(Array.from(this._tasks))}filterHooks(e,n){return n=mt(this.ctx,n),e.slice().filter(r=>{const i=n?.[Ke.filter];return r.global||!i||i.call(n,r.ctx)})}*dispatch(e,n){const r=typeof n[0]=="object"||typeof n[0]=="function"?n.shift():null,i=n.shift();i!=="internal/event"&&this.emit("internal/event",e,i,n,r);for(const s of this.filterHooks(this._hooks[i]||[],r))yield s.callback.apply(r,n)}async parallel(...e){await Promise.all(this.dispatch("emit",e))}emit(...e){Array.from(this.dispatch("emit",e))}async serial(...e){for await(const n of this.dispatch("serial",e))if(Gi(n))return n}bail(...e){for(const n of this.dispatch("bail",e))if(Gi(n))return n}register(e,n,r,i){const s=i.prepend?"unshift":"push";return n[s]({ctx:this.ctx,callback:r,...i}),this.ctx.state.collect(e,()=>this.unregister(n,r))}unregister(e,n){const r=e.findIndex(i=>i.callback===n);if(r>=0)return e.splice(r,1),!0}on(e,n,r){var a;typeof r!="object"&&(r={prepend:r}),this.ctx.scope.assertActive(),n=this.ctx.reflect.bind(n);const i=this.bail(this.ctx,"internal/listener",e,n,r);if(i)return i;const s=(a=this._hooks)[e]||(a[e]=[]),o=typeof e=="string"?`event <${e}>`:"event (Symbol)";return this.register(o,s,n,r)}once(e,n,r){const i=this.on(e,function(...s){return i(),n.apply(this,s)},r);return i}async start(){this.isActive=!0;const e=this._hooks.ready||[];for(;e.length;){const{ctx:n,callback:r}=e.shift();n.scope.ensure(async()=>r())}await this.flush()}async stop(){this.isActive=!1,this.ctx.scope.reset()}},ie(An,"Lifecycle"),An),_f=bf,Yi=(ln=class extends Error{constructor(e,n){super(n??ln.Code[e]),this.code=e}},ie(ln,"CordisError"),ln);(t=>{t.Code={INACTIVE_EFFECT:"cannot create effect on inactive context"}})(Yi||(Yi={}));var zo=(In=class{constructor(e,n){te(this,"uid");te(this,"ctx");te(this,"disposables",[]);te(this,"error");te(this,"status",0);te(this,"isActive",!1);te(this,"context");te(this,"proxy");te(this,"acceptors",[]);te(this,"tasks",new Set);te(this,"hasError",!1);this.parent=e,this.config=n,this.uid=e.registry?e.registry.counter:0,this.ctx=this.context=e.extend({scope:this}),this.proxy=new Proxy({},{get:ie((r,i)=>Reflect.get(this.config,i),"get")})}get _config(){return this.runtime.isReactive?this.proxy:this.config}assertActive(){if(!(this.uid!==null||this.isActive))throw new Yi("INACTIVE_EFFECT")}effect(e,n){this.assertActive();const r=Ui(e)?new e(this.ctx,n):e(this.ctx,n);let i=!1;const s=typeof r=="function"?r:r.dispose.bind(r),o=ie((...a)=>{if(!i)return i=!0,jt(this.disposables,o),s(...a)},"wrapped");return this.disposables.push(o),typeof r=="function"?o:(r.dispose=o,r)}collect(e,n){const r=Be(()=>(jt(this.disposables,r),n()),"name",e);return this.disposables.push(r),r}restart(){this.reset(),this.error=null,this.hasError=!1,this.status=0,this.start()}_getStatus(){return this.uid===null?4:this.hasError?3:this.tasks.size?1:this.ready?2:0}updateStatus(e){const n=this.status;e?.(),this.status=this._getStatus(),n!==this.status&&this.context.emit("internal/status",this,n)}ensure(e){const n=e().catch(r=>{this.context.emit(this.ctx,"internal/error",r),this.cancel(r)}).finally(()=>{this.updateStatus(()=>this.tasks.delete(n)),this.context.events._tasks.delete(n)});this.updateStatus(()=>this.tasks.add(n)),this.context.events._tasks.add(n)}cancel(e){this.error=e,this.updateStatus(()=>this.hasError=!0),this.reset()}get ready(){return Object.entries(this.runtime.inject).every(([e,n])=>!n.required||!Oe(this.ctx.get(e)))}reset(){this.isActive=!1,this.disposables=this.disposables.splice(0).filter(e=>{if(this.uid!==null&&e[Ke.static]===this)return!0;(async()=>e())().catch(n=>{this.context.emit(this.ctx,"internal/error",n)})})}init(e){this.config?this.start():this.cancel(e)}start(){if(!this.ready||this.isActive||this.uid===null)return!0;this.isActive=!0,this.updateStatus(()=>this.hasError=!1)}accept(...e){const r={keys:Array.isArray(e[0])?e.shift():null,callback:e[0],...e[1]};return this.effect(()=>(this.acceptors.push(r),r.immediate&&r.callback?.(this.config),()=>jt(this.acceptors,r)))}decline(e){return this.accept(e,()=>!0)}checkUpdate(e,n){if(n||!this.config)return[!0,!0];if(n===!1)return[!1,!1];const r=Object.create(null),i=ie(u=>{const c=r[u]??(r[u]=!Qt(this.config[u],e[u]));return o||(o=c),c},"checkPropertyUpdate"),s=new Set;let o=!1,a=!1,l=this.runtime.isReactive||null;for(const{keys:u,callback:c,passive:f}of this.acceptors){if(!u)l||(l=!f);else if(f)u?.forEach(y=>s.add(y));else{let y=!1;for(const v of u)y||(y=i(v));if(!y)continue}c?.(e)&&(a=!0)}for(const u in{...this.config,...e})if(l!==!1&&!(u in r)&&!s.has(u)){const c=i(u);l===null&&(a||(a=c))}return[o,a]}},ie(In,"EffectScope"),In),wf=(Rn=class extends zo{constructor(n,r,i,s){super(n,i);te(this,"dispose");this.runtime=r,this.dispose=Be(n.scope.collect(`fork <${n.runtime.name}>`,()=>{this.uid=null,this.reset(),this.context.emit("internal/fork",this);const o=jt(r.disposables,this.dispose);return jt(r.children,this)&&!r.children.length&&n.registry.delete(r.plugin),o}),Ke.static,r),r.children.push(this),r.disposables.push(this.dispose),this.context.emit("internal/fork",this),this.init(s)}start(){if(super.start())return!0;for(const n of this.runtime.forkables)this.ensure(async()=>n(this.context,this._config))}update(n,r){const i=this.config,s=this.runtime.isForkable?this:this.runtime;if(s.config!==i)return;let o;try{o=Hn(this.runtime.plugin,n)}catch(u){return this.context.emit("internal/error",u),this.cancel(u)}const[a,l]=s.checkUpdate(o,r);this.context.emit("internal/before-update",this,n),this.config=o,s.config=o,a&&this.context.emit("internal/update",this,i),l&&s.restart()}},ie(Rn,"ForkScope"),Rn),Vo=(Tn=class extends zo{constructor(n,r,i,s){super(n,i);te(this,"value");te(this,"runtime",this);te(this,"schema");te(this,"name");te(this,"inject",Object.create(null));te(this,"forkables",[]);te(this,"children",[]);te(this,"isReusable",!1);te(this,"isReactive",!1);te(this,"apply",ie((n,r)=>{if(typeof this.plugin!="function")return this.plugin.apply(n,r);if(Ui(this.plugin)){const i=new this.plugin(n,r),s=i[Ke.expose];return s&&n.set(s,i),i.fork&&this.forkables.push(i.fork.bind(i)),i}else return this.plugin(n,r)},"apply"));this.plugin=r,r?(this.setup(),this.init(s)):(this.name="root",this.isActive=!0)}get isForkable(){return this.forkables.length>0}fork(n,r,i){return new wf(n,this,r,i)}dispose(){return this.uid=null,this.reset(),this.context.emit("internal/runtime",this),!0}setup(){const{name:n}=this.plugin;n&&n!=="apply"&&(this.name=n),this.schema=this.plugin.Config||this.plugin.schema,this.inject=Ve.resolve(this.plugin.using||this.plugin.inject),this.isReusable=this.plugin.reusable,this.isReactive=this.plugin.reactive,this.context.emit("internal/runtime",this),this.isReusable&&this.forkables.push(this.apply)}reset(){super.reset();for(const n of this.children)n.reset()}start(){if(super.start())return!0;!this.isReusable&&this.plugin&&this.ensure(async()=>this.value=this.apply(this.ctx,this._config));for(const n of this.children)n.start()}update(n,r){if(this.isForkable){const u=new Error(`attempting to update forkable plugin "${this.plugin.name}", which may lead to unexpected behavior`);this.context.emit(this.ctx,"internal/warning",u)}const i=this.config;let s;try{s=Hn(this.runtime.plugin||this.context.constructor,n)}catch(u){return this.context.emit("internal/error",u),this.cancel(u)}const[o,a]=this.checkUpdate(s,r),l=this.children.find(u=>u.config===i);this.config=s,l&&(this.context.emit("internal/before-update",l,n),l.config=s,o&&this.context.emit("internal/update",l,i)),a&&this.restart()}},ie(Tn,"MainScope"),Tn);function Ko(t){return t&&typeof t=="object"&&typeof t.apply=="function"}ie(Ko,"isApplicable");function Ve(t){return function(e,n){if(n.kind==="class")e.inject=t;else if(n.kind==="method")n.addInitializer(function(){const r=this[G.tracker]?.property;if(!r)throw new Error("missing context tracker");this[r].inject(t,i=>{e.call(Wn(this,{[r]:i}))})});else throw new Error("@Inject can only be used on class or class methods")}}ie(Ve,"Inject"),(t=>{function e(n){if(!n)return{};if(Array.isArray(n))return Object.fromEntries(n.map(o=>[o,{required:!0}]));const{required:r,optional:i,...s}=n;return Array.isArray(r)&&Object.assign(s,Object.fromEntries(r.map(o=>[o,{required:!0}]))),Array.isArray(i)&&Object.assign(s,Object.fromEntries(i.map(o=>[o,{required:!1}]))),s}t.resolve=e,ie(e,"resolve")})(Ve||(Ve={}));var xf=(Dn=class{constructor(e,n){te(this,"_counter",0);te(this,"_internal",new Map);te(this,"context");this.ctx=e,Be(this,G.tracker,{associate:"registry",property:"ctx"}),this.context=e;const r=new Vo(e,null,n);e.scope=r,r.ctx=e,this.set(null,r)}get counter(){return++this._counter}get size(){return this._internal.size}resolve(e,n=!1){if(e===null||typeof e=="function")return e;if(Ko(e))return e.apply;if(n)throw new Error('invalid plugin, expect function or object with an "apply" method, received '+typeof e)}get(e){const n=this.resolve(e);return n&&this._internal.get(n)}has(e){const n=this.resolve(e);return!!n&&this._internal.has(n)}set(e,n){const r=this.resolve(e);this._internal.set(r,n)}delete(e){const n=this.resolve(e),r=n&&this._internal.get(n);if(r)return this._internal.delete(n),r.dispose(),r}keys(){return this._internal.keys()}values(){return this._internal.values()}entries(){return this._internal.entries()}forEach(e){return this._internal.forEach(e)}using(e,n){return this.inject(e,n)}inject(e,n){return this.plugin({inject:e,apply:n,name:n.name})}plugin(e,n,r){if(this.resolve(e,!0),this.ctx.scope.assertActive(),!r)try{n=Hn(e,n)}catch(s){this.context.emit(this.ctx,"internal/error",s),r=s,n=null}let i=this.get(e);return i?(i.isForkable||this.context.emit(this.ctx,"internal/warning",new Error(`duplicate plugin detected: ${e.name}`)),i.fork(this.ctx,n,r)):(i=new Vo(this.ctx,e,n,r),this.set(e,i),i.fork(this.ctx,n,r))}},ie(Dn,"Registry"),Dn),Sf=xf,Ke=(ke=class{static is(e){return!!e?.[ke.is]}static associate(e,n){return e}constructor(e){e=Hn(this.constructor,e),this[G.store]=Object.create(null),this[G.isolate]=Object.create(null),this[G.internal]=Object.create(null),this[G.intercept]=Object.create(null);const n=new Proxy(this,Ki.handler);n.root=n,n.reflect=new Ki(n),n.registry=new Sf(n,e),n.lifecycle=new _f(n);const r=ie(i=>{if(i){r(Object.getPrototypeOf(i));for(const s of Object.getOwnPropertyNames(i)){const o=i[s].prototype?.constructor;o&&(n[i[s].key]=new o(n,e),Be(n[i[s].key],"ctx",n))}}},"attach");return r(this[G.internal]),n}[Symbol.for("nodejs.util.inspect.custom")](){return`Context <${this.name}>`}get name(){let e=this.runtime;for(;e&&!e.name;)e=e.parent.runtime;return e?.name}get events(){return this.lifecycle}get state(){return this.scope}extend(e={}){const n=Reflect.getOwnPropertyDescriptor(this,G.shadow)?.value,r=Object.assign(Object.create(mt(this,this)),e);return n?Object.assign(Object.create(r),{[G.shadow]:n}):r}isolate(e,n){const r=Object.create(this[G.isolate]);return r[e]=n??Symbol(e),this.extend({[G.isolate]:r})}intercept(e,n){const r=Object.create(this[G.intercept]);return r[e]=n,this.extend({[G.intercept]:r})}},ie(ke,"Context"),te(ke,"store",G.store),te(ke,"events",G.events),te(ke,"static",G.static),te(ke,"filter",G.filter),te(ke,"expose",G.expose),te(ke,"isolate",G.isolate),te(ke,"internal",G.internal),te(ke,"intercept",G.intercept),te(ke,"origin","ctx"),te(ke,"current","ctx"),ke.is[Symbol.toPrimitive]=()=>Symbol.for("cordis.is"),ke.prototype[ke.is]=!0,ke);Ke.prototype[Ke.internal]=Object.create(null);var dn=(tt=class{constructor(...e){te(this,"ctx");te(this,"name");te(this,"config");let n,r,i,s;Ke.is(e[0])?(n=e[0],typeof e[1]=="string"?(r=e[1],i=e[2]):s=e[1]):s=e[0],r??(r=this.constructor[G.provide]),i??(i=this.constructor[G.immediate]);let o=this;const a={associate:r,property:"ctx"};return o[G.invoke]&&(o=Vi(r,Hi(Object.getPrototypeOf(this),Function.prototype),a)),n?o.ctx=n:o[G.setup](),o.name=r,o.config=s,Be(o,G.tracker,a),o.ctx.provide(r),o.ctx.runtime.name=r,i&&(n?o[G.expose]=r:o.ctx.set(r,o)),o.ctx.on("ready",async()=>{await Promise.resolve(),await o.start(),i||o.ctx.set(r,o)}),o.ctx.on("dispose",()=>o.stop()),o}start(){}stop(){}[G.filter](e){return e[G.isolate][this.name]===this.ctx[G.isolate][this.name]}[G.setup](){this.ctx=new Ke}[G.extend](e){let n;return this[tt.invoke]?n=Vi(this.name,this,this[G.tracker]):n=Object.create(this),Object.assign(n,e)}static[Symbol.hasInstance](e){let n=e.constructor;for(;n;){if(n=n.prototype?.constructor,n===this)return!0;n=Object.getPrototypeOf(n)}return!1}},ie(tt,"Service"),te(tt,"setup",G.setup),te(tt,"invoke",G.invoke),te(tt,"extend",G.extend),te(tt,"tracker",G.tracker),te(tt,"provide",G.provide),te(tt,"immediate",G.immediate),tt),Ef=Object.defineProperty,Of=Object.getOwnPropertyNames,ue=(t,e)=>Ef(t,"name",{value:e,configurable:!0}),Pf=(t,e)=>function(){return e||(0,t[Of(t)[0]])((e={exports:{}}).exports,e),e.exports},Cf=Pf({"src/index.ts"(t,e){var A;var n=Symbol.for("schemastery"),r=Symbol.for("ValidationError");globalThis.__schemastery_index__??(globalThis.__schemastery_index__=0);var i=(A=class extends TypeError{constructor(h,P){let k="$";for(const T of P.path||[])typeof T=="string"?k+="."+T:typeof T=="number"?k+="["+T+"]":typeof T=="symbol"&&(k+=`[Symbol(${T.toString()})]`);k.startsWith(".")&&(k=k.slice(1));super((k==="$"?"":`${k} `)+h);te(this,"name","ValidationError");this.options=P}static is(h){return!!h?.[r]}},ue(A,"ValidationError"),A);Object.defineProperty(i.prototype,r,{value:!0});var s=ue(function(g){const m=ue(function(h,P={}){return s.resolve(h,m,P)[0]},"schema");if(g.refs){const h=Ct(g.refs,k=>new s(k)),P=ue(k=>h[k],"getRef");for(const k in h){const T=h[k];T.sKey=P(T.sKey),T.inner=P(T.inner),T.list=T.list&&T.list.map(P),T.dict=T.dict&&Ct(T.dict,P)}return h[g.uid]}if(Object.assign(m,g),typeof m.callback=="string")try{m.callback=new Function("return "+m.callback)()}catch{}return Object.defineProperty(m,"uid",{value:globalThis.__schemastery_index__++}),Object.setPrototypeOf(m,s.prototype),m.meta||(m.meta={}),m.toString=m.toString.bind(m),m},"Schema");s.prototype=Object.create(Function.prototype),s.prototype[n]=!0,s.ValidationError=i;var o;s.prototype.toJSON=ue(function(){var h;if(o)return o[h=this.uid]??(o[h]=JSON.parse(JSON.stringify({...this}))),this.uid;o={[this.uid]:{...this}},o[this.uid]=JSON.parse(JSON.stringify({...this}));const m={uid:this.uid,refs:o};return o=void 0,m},"toJSON"),s.prototype.set=ue(function(m,h){return this.dict[m]=h,this},"set"),s.prototype.push=ue(function(m){return this.list.push(m),this},"push");function a(g,m){const h=typeof g=="string"?{"":g}:{...g};for(const P in m){const k=m[P];k?.$description||k?.$desc?h[P]=k.$description||k.$desc:typeof k=="string"&&(h[P]=k)}return h}ue(a,"mergeDesc");function l(g){return g?.$value??g?.$inner}ue(l,"getInner");function u(g){return jo(g??{},m=>!m.startsWith("$"))}ue(u,"extractKeys"),s.prototype.i18n=ue(function(m){const h=s(this),P=a(h.meta.description,m);return Object.keys(P).length&&(h.meta.description=P),h.dict&&(h.dict=Ct(h.dict,(k,T)=>k.i18n(Ct(m,V=>l(V)?.[T]??V?.[T])))),h.list&&(h.list=h.list.map((k,T)=>k.i18n(Ct(m,(V={})=>Array.isArray(l(V))?l(V)[T]:Array.isArray(V)?V[T]:u(V))))),h.inner&&(h.inner=h.inner.i18n(Ct(m,k=>l(k)?l(k):u(k)))),h.sKey&&(h.sKey=h.sKey.i18n(Ct(m,k=>k?.$key))),h},"i18n"),s.prototype.extra=ue(function(m,h){const P=s(this);return P.meta={...P.meta,[m]:h},P},"extra");for(const g of["required","disabled","collapse","hidden","loose"])Object.assign(s.prototype,{[g](m=!0){const h=s(this);return h.meta={...h.meta,[g]:m},h}});s.prototype.deprecated=ue(function(){var h;const m=s(this);return(h=m.meta).badges||(h.badges=[]),m.meta.badges.push({text:"deprecated",type:"danger"}),m},"deprecated"),s.prototype.experimental=ue(function(){var h;const m=s(this);return(h=m.meta).badges||(h.badges=[]),m.meta.badges.push({text:"experimental",type:"warning"}),m},"experimental"),s.prototype.pattern=ue(function(m){const h=s(this),P=Mo(m,["source","flags"]);return h.meta={...h.meta,pattern:P},h},"pattern"),s.prototype.simplify=ue(function(m){if(Qt(m,this.meta.default,this.type==="dict"))return null;if(Oe(m))return m;if(this.type==="object"||this.type==="dict"){const h={};for(const P in m){const T=(this.type==="object"?this.dict[P]:this.inner)?.simplify(m[P]);(this.type==="dict"||!Oe(T))&&(h[P]=T)}return Qt(h,this.meta.default,this.type==="dict")?null:h}else if(this.type==="array"||this.type==="tuple"){const h=[];return m.forEach((P,k)=>{const T=this.type==="array"?this.inner:this.list[k],V=T?T.simplify(P):P;h.push(V)}),h}else if(this.type==="intersect"){const h={};for(const P of this.list)Object.assign(h,P.simplify(m));return h}else if(this.type==="union")for(const h of this.list)try{return s.resolve(m,h,{}),h.simplify(m)}catch{}return m},"simplify"),s.prototype.toString=ue(function(m){return z[this.type]?.(this,m)??`Schema<${this.type}>`},"toString"),s.prototype.role=ue(function(g,m){const h=s(this);return h.meta={...h.meta,role:g,extra:m},h},"role");for(const g of["default","link","comment","description","max","min","step"])Object.assign(s.prototype,{[g](m){const h=s(this);return h.meta={...h.meta,[g]:m},h}});var c={};s.extend=ue(function(m,h){c[m]=h},"extend"),s.resolve=ue(function(m,h,P={},k=!1){if(!h)return[m];if(P.ignore?.(m,h))return[m];if(Oe(m)&&h.type!=="lazy"){if(h.meta.required)throw new i("missing required value",P);let V=h,Z=h.meta.default;for(;V?.type==="intersect"&&Oe(Z);)V=V.list[0],Z=V?.meta.default;if(Oe(Z))return[m];m=Pr(Z)}const T=c[h.type];if(!T)throw new i(`unsupported type "${h.type}"`,P);try{return T(m,h,P,k)}catch(V){if(!h.meta.loose)throw V;return[h.meta.default]}},"resolve"),s.from=ue(function(m){if(Oe(m))return s.any();if(["string","number","boolean"].includes(typeof m))return s.const(m).required();if(m[n])return m;if(typeof m=="function")switch(m){case String:return s.string().required();case Number:return s.number().required();case Boolean:return s.boolean().required();case Function:return s.function().required();default:return s.is(m).required()}else throw new TypeError(`cannot infer schema from ${m}`)},"from"),s.lazy=ue(function(m){const h=ue(()=>(P.inner[n]||(P.inner=P.builder(),P.inner.meta={...P.meta,...P.inner.meta}),P.inner.toJSON()),"toJSON"),P=new s({type:"lazy",builder:m,inner:{toJSON:h}});return P},"lazy"),s.natural=ue(function(){return s.number().step(1).min(0)},"natural"),s.percent=ue(function(){return s.number().step(.01).min(0).max(1).role("slider")},"percent"),s.date=ue(function(){return s.union([s.is(Date),s.transform(s.string().role("datetime"),(m,h)=>{const P=new Date(m);if(isNaN(+P))throw new i(`invalid date "${m}"`,h);return P},!0)])},"date"),s.regExp=ue(function(m=""){return s.union([s.is(RegExp),s.transform(s.string().role("regexp",{flag:m}),(h,P)=>{try{return new RegExp(h,m)}catch(k){throw new i(k.message,P)}},!0)])},"regExp"),s.arrayBuffer=ue(function(m){return s.union([s.is(ArrayBuffer),s.is(SharedArrayBuffer),s.transform(s.any(),(h,P)=>{if(pt.isSource(h))return pt.fromSource(h);throw new i(`expected ArrayBufferSource but got ${h}`,P)},!0),...m?[s.transform(s.string(),(h,P)=>{try{return m==="base64"?pt.fromBase64(h):pt.fromHex(h)}catch(k){throw new i(k.message,P)}},!0)]:[]])},"arrayBuffer"),s.extend("lazy",(g,m,h,P)=>(m.inner[n]||(m.inner=m.builder(),m.inner.meta={...m.meta,...m.inner.meta}),s.resolve(g,m.inner,h,P))),s.extend("any",g=>[g]),s.extend("never",(g,m,h)=>{throw new i(`expected nullable but got ${g}`,h)}),s.extend("const",(g,{value:m},h)=>{if(Qt(g,m))return[m];throw new i(`expected ${m} but got ${g}`,h)});function f(g,m,h,P,k=!1){const{max:T=1/0,min:V=-1/0}=m;if(g>T)throw new i(`expected ${h} <= ${T} but got ${g}`,P);if(g<V&&!k)throw new i(`expected ${h} >= ${V} but got ${g}`,P)}ue(f,"checkWithinRange"),s.extend("string",(g,{meta:m},h)=>{if(typeof g!="string")throw new i(`expected string but got ${g}`,h);if(m.pattern){const P=new RegExp(m.pattern.source,m.pattern.flags);if(!P.test(g))throw new i(`expect string to match regexp ${P}`,h)}return f(g.length,m,"string length",h),[g]});function w(g,m){const h=g.toString();if(h.includes("e"))return g*Math.pow(10,m);const P=h.indexOf(".");if(P===-1)return g*Math.pow(10,m);const k=h.slice(P+1),T=h.slice(0,P);return k.length<=m?+(T+k.padEnd(m,"0")):+(T+k.slice(0,m)+"."+k.slice(m))}ue(w,"decimalShift");function y(g,m,h){if(h=Math.abs(h),!/^\d+\.\d+$/.test(h.toString()))return(g-m)%h===0;const P=h.toString().indexOf("."),k=h.toString().slice(P+1).length;return Math.abs(w(g,k)-w(m,k))%w(h,k)===0}ue(y,"isMultipleOf"),s.extend("number",(g,{meta:m},h)=>{if(typeof g!="number")throw new i(`expected number but got ${g}`,h);f(g,m,"number",h);const{step:P}=m;if(P&&!y(g,m.min??0,P))throw new i(`expected number multiple of ${P} but got ${g}`,h);return[g]}),s.extend("boolean",(g,m,h)=>{if(typeof g=="boolean")return[g];throw new i(`expected boolean but got ${g}`,h)}),s.extend("bitset",(g,{bits:m,meta:h},P)=>{let k=0,T=[];if(typeof g=="number"){k=g;for(const V in m)g&m[V]&&T.push(V)}else if(Array.isArray(g)){T=g;for(const V of T){if(typeof V!="string")throw new i(`expected string but got ${V}`,P);V in m&&(k|=m[V])}}else throw new i(`expected number or array but got ${g}`,P);return k===h.default?[k]:[k,T]}),s.extend("function",(g,m,h)=>{if(typeof g=="function")return[g];throw new i(`expected function but got ${g}`,h)}),s.extend("is",(g,{constructor:m},h)=>{if(typeof m=="function"){if(g instanceof m)return[g];throw new i(`expected ${m.name} but got ${g}`,h)}else{if(Oe(g))throw new i(`expected ${m} but got ${g}`,h);let P=Object.getPrototypeOf(g);for(;P;){if(P.constructor?.name===m)return[g];P=Object.getPrototypeOf(P)}throw new i(`expected ${m} but got ${g}`,h)}});function v(g,m,h,P){try{const[k,T]=s.resolve(g[m],h,{...P,path:[...P.path||[],m]});return T!==void 0&&(g[m]=T),k}catch(k){if(!P?.autofix)throw k;return delete g[m],h.meta.default}}ue(v,"property"),s.extend("array",(g,{inner:m,meta:h},P)=>{if(!Array.isArray(g))throw new i(`expected array but got ${g}`,P);return f(g.length,h,"array length",P,!Oe(m.meta.default)),[g.map((k,T)=>v(g,T,m,P))]}),s.extend("dict",(g,{inner:m,sKey:h},P,k)=>{if(!Or(g))throw new i(`expected object but got ${g}`,P);const T={};for(const V in g){let Z;try{Z=s.resolve(V,h,P)[0]}catch($e){if(k)continue;throw $e}T[Z]=v(g,V,m,P),g[Z]=g[V],V!==Z&&delete g[V]}return[T]}),s.extend("tuple",(g,{list:m},h,P)=>{if(!Array.isArray(g))throw new i(`expected array but got ${g}`,h);const k=m.map((T,V)=>v(g,V,T,h));return P?[k]:(k.push(...g.slice(m.length)),[k])});function I(g,m){for(const h in m)h in g||(g[h]=m[h])}ue(I,"merge"),s.extend("object",(g,{dict:m},h,P)=>{if(!Or(g))throw new i(`expected object but got ${g}`,h);const k={};for(const T in m){const V=v(g,T,m[T],h);(!Oe(V)||T in g)&&(k[T]=V)}return P||I(k,g),[k]}),s.extend("union",(g,{list:m,toString:h},P,k)=>{for(const T of m)try{return s.resolve(g,T,P,k)}catch{}throw new i(`expected ${h()} but got ${JSON.stringify(g)}`,P)}),s.extend("intersect",(g,{list:m,toString:h},P,k)=>{let T;for(const V of m){const Z=s.resolve(g,V,P,!0)[0];if(!Oe(Z))if(Oe(T))T=Z;else{if(typeof T!=typeof Z)throw new i(`expected ${h()} but got ${JSON.stringify(g)}`,P);if(typeof Z=="object")I(T??(T={}),Z);else if(T!==Z)throw new i(`expected ${h()} but got ${JSON.stringify(g)}`,P)}}return!k&&Or(g)&&I(T,g),[T]}),s.extend("transform",(g,{inner:m,callback:h,preserve:P},k)=>{const[T,V=g]=s.resolve(g,m,k,!0);return P?[h(T)]:[h(T),h(V)]});var z={};function F(g,m,h){z[g]=h,Object.assign(s,{[g](...P){const k=new s({type:g});return m.forEach((T,V)=>{switch(T){case"sKey":k.sKey=P[V]??s.string();break;case"inner":k.inner=s.from(P[V]);break;case"list":k.list=P[V].map(s.from);break;case"dict":k.dict=Ct(P[V],s.from);break;case"bits":{k.bits={};for(const Z in P[V])typeof P[V][Z]=="number"&&(k.bits[Z]=P[V][Z]);break}case"callback":{const Z=k.callback=P[V];Z.toJSON||(Z.toJSON=()=>Z.toString());break}case"constructor":{const Z=k.constructor=P[V];typeof Z=="function"&&(Z.toJSON||(Z.toJSON=()=>Z.name));break}default:k[T]=P[V]}}),g==="object"||g==="dict"?k.meta.default={}:g==="array"||g==="tuple"?k.meta.default=[]:g==="bitset"&&(k.meta.default=0),k}})}ue(F,"defineMethod"),F("is",["constructor"],({constructor:g})=>typeof g=="function"?g.name:g),F("any",[],()=>"any"),F("never",[],()=>"never"),F("const",["value"],({value:g})=>typeof g=="string"?JSON.stringify(g):g),F("string",[],()=>"string"),F("number",[],()=>"number"),F("boolean",[],()=>"boolean"),F("bitset",["bits"],()=>"bitset"),F("function",[],()=>"function"),F("array",["inner"],({inner:g})=>`${g.toString(!0)}[]`),F("dict",["inner","sKey"],({inner:g,sKey:m})=>`{ [key: ${m.toString()}]: ${g.toString()} }`),F("tuple",["list"],({list:g})=>`[${g.map(m=>m.toString()).join(", ")}]`),F("object",["dict"],({dict:g})=>Object.keys(g).length===0?"{}":`{ ${Object.entries(g).map(([m,h])=>`${m}${h.meta.required?"":"?"}: ${h.toString()}`).join(", ")} }`),F("union",["list"],({list:g},m)=>{const h=g.map(({toString:P})=>P()).join(" | ");return m?`(${h})`:h}),F("intersect",["list"],({list:g})=>`${g.map(m=>m.toString(!0)).join(" & ")}`),F("transform",["inner","callback","preserve"],({inner:g},m)=>g.toString(m)),e.exports=s}});const xe=Cf();/**
4
+ * @inpageedit/logger
5
+ *
6
+ * Flexible, Extensible Console Logger with Colored Labels and Hierarchical Loggers
7
+ *
8
+ * @author dragon-fish <dragon-fish@qq.com>
9
+ * @license MIT
10
+ */var Ji=(t=>(t[t.debug=-1]="debug",t[t.log=0]="log",t[t.info=1]="info",t[t.warn=2]="warn",t[t.error=3]="error",t[t.silent=4]="silent",t))(Ji||{});const Qi=globalThis||window,Xi=Symbol.for("__IPE_LOGGER_COLOR_MAP__");Qi[Xi]||(Qi[Xi]=new Map);const Zi=Qi[Xi];function $r(t){let e=2166136261;for(let n=0;n<t.length;n++)e^=t.charCodeAt(n),e=(e>>>0)*16777619;return e>>>0}const Go=[[350,360],[0,15],[15,30],[200,230],[230,250],[250,280],[280,310],[310,330],[140,160],[160,180]];function kf(t,e){const n=Go.length,r=$r(t)%n,[i,s]=Go[r],o=s-i,a=$r(t+":"+e),l=i+a%(o||1),u=$r(t+":s"),c=$r(t+":l");let f,w;if(e==="name")f=62+u%18,w=30+c%12;else{const y=l>=0&&l<50||l>330&&l<360,v=l>=200&&l<=300;f=55+u%20,v?w=55+c%8:y?w=48+c%6:w=50+c%8,f<60&&(f+=5)}return`hsl(${l}, ${f}%, ${w}%)`}function Ar(t,e){if(e)return Zi.set(t,e),e;const n=Zi.get(t);if(n)return n;const r=t.startsWith("name:")?"name":"group",i=kf(t,r);return Zi.set(t,i),i}/**
11
+ * @inpageedit/logger
12
+ * Flexible, Extensible Console Logger with Colored Labels and Hierarchical Loggers
13
+ *
14
+ * @author dragon-fish <dragon-fish@qq.com>
15
+ * @license MIT
16
+ *
17
+ * @example
18
+ * ```ts
19
+ * const logger = new Logger({ name: 'MyApp', level: LoggerLevel.debug })
20
+ * // normal usage
21
+ * logger.info('Application started')
22
+ * // create sub-logger group
23
+ * const apiLogger = logger.group('API', { color: '#f59e0b' })
24
+ * apiLogger.warn('Deprecated API endpoint used')
25
+ * // define custom level
26
+ * logger.defineLevel('success', { level: LoggerLevel.info, label: '✅', method: 'info' })
27
+ * logger.success('User created successfully')
28
+ * ```
29
+ */let Yo=class Gu{constructor(e={}){this._custom=n=>{if(!this._enabled(n.level))return Jo;const[r,i]=this._prefix(n.label);return this._consoleMethod(n.method).bind(console,r,...i)},this._name=e.name,this._nameColor=e.color,this._groupPath=e._groupPath?[...e._groupPath]:[],this._dynamicLevels={...e._dynamicLevels},this._levelRef=e._levelRef??{value:e.level??1},this._name&&Ar(`name:${this._name}`,this._nameColor),this._installBuiltinLevels();for(const n of Object.keys(this._dynamicLevels))this._installLevelGetter(n,this._dynamicLevels[n]);return Af(this)}get level(){return this._levelRef.value}set level(e){this._levelRef.value=e}group(e,n){return e&&Ar(`group:${e}`,n?.color),new Gu({name:this._name,color:this._nameColor,_groupPath:[...this._groupPath,e],_dynamicLevels:this._dynamicLevels,_levelRef:this._levelRef})}defineLevel(e,n){this._dynamicLevels[e]={...n},this._installLevelGetter(e,n)}get debug(){return this._method("debug")}get log(){return this._method("log")}get info(){return this._method("info")}get warn(){return this._method("warn")}get error(){return this._method("error")}_installBuiltinLevels(){}_installLevelGetter(e,n){Object.defineProperty(this,e,{configurable:!0,enumerable:!1,get:()=>this._custom(n)})}_method(e){const n=$f[e];if(!this._enabled(n.level))return Jo;const[r,i]=this._prefix(n.label);return this._consoleMethod(e).bind(console,r,...i)}_consoleMethod(e){return(console[e]||console.log).bind(console)}_enabled(e){return e>=this._levelRef.value&&this._levelRef.value!==4}_prefix(e){const n=[];let r="";if(this._name){const i=Ar(`name:${this._name}`,this._nameColor);r+=`%c${this._name}%c`,n.push(`background:${i}; color:#fff; padding:1px 4px; border-radius:2px; font-weight:700;`,Qo)}if(e&&(r+=` ${e}`),this._groupPath.length){const i=this._groupPath.join("/"),s=Ar(`group:${i}`);r+=` %c${i}%c`,n.push(`color:${s}; text-decoration: underline;`,Qo)}return[r,n]}};const Jo=()=>{},Qo="color:inherit; background:transparent; text-decoration:none;",$f={debug:{level:-1,label:"",method:"debug"},log:{level:0,label:"",method:"log"},info:{level:1,label:"[I]",method:"info"},warn:{level:2,label:"[W]",method:"warn"},error:{level:3,label:"[E]",method:"error"}};function Af(t){const e=function(n,r){return t.group(n,r)};return new Proxy(e,{get(n,r,i){return t[r]},set(n,r,i){return t[r]=i,!0},apply(n,r,i){return t.group(i[0],i[1])},has(n,r){return r in t}})}function Xo(t){return new Yo(t)}var Xe=(t=>(t.BODY_USED="BODY_USED",t.NO_BODY_READER="NO_BODY_READER",t.TIMEOUT="TIMEOUT",t.NETWORK_ERROR="NETWORK_ERROR",t.BODY_NOT_ALLOWED="BODY_NOT_ALLOWED",t.HOOK_CONTEXT_CHANGED="HOOK_CONTEXT_CHANGED",t.ABORTED_BY_HOOK="ABORTED_BY_HOOK",t.INVALID_HOOK_CALLBACK="INVALID_HOOK_CALLBACK",t.UNEXPECTED_HOOK_RETURN="UNEXPECTED_HOOK_RETURN",t))(Xe||{});class Ge extends Error{constructor(e,n,r,i){super(n,i),this.code=e,this.context=r,this.name="FexiosError"}}let If=class extends Ge{constructor(e,n,r){super(n.statusText,e,void 0,r),this.response=n,this.name="FexiosResponseError"}};function Rf(t,e=2048){if(!(t instanceof Uint8Array))throw new TypeError("Input must be a Uint8Array");if(t.length===0)return!0;const n=Math.min(Math.max(t.length,256),e),r=t.slice(0,n);if(Tf(r))return!1;const i=Df(r);if(i.nullByteRatio>.05||i.highByteRatio>.95)return!1;const s=["utf-8","utf-16le","utf-16be","iso-8859-1"];let o=-1,a=!1;for(const l of s)try{const u=new TextDecoder(l,{fatal:!0}).decode(r),c=Nf(u);c>o&&(o=c,a=c>.7)}catch{continue}return a}function Tf(t){if(t.length<4)return!1;const e=[[137,80,78,71],[255,216,255],[71,73,70],[37,80,68,70],[80,75,3,4],[80,75,5,6],[80,75,7,8],[127,69,76,70],[77,90],[202,254,186,190],[0,0,1,0],[82,73,70,70]];for(const n of e)if(t.length>=n.length){let r=!0;for(let i=0;i<n.length;i++)if(t[i]!==n[i]){r=!1;break}if(r)return!0}return!1}function Df(t){let e=0,n=0,r=0;for(const i of t)i===0&&e++,i>127&&n++,(i<32&&i!==9&&i!==10&&i!==13||i===127)&&r++;return{nullByteRatio:e/t.length,highByteRatio:n/t.length,controlCharRatio:r/t.length}}function Nf(t){if(t.length===0)return 1;let e=1,n=0;for(let i=0;i<t.length;i++){const s=t[i].charCodeAt(0);s>=32&&s<=126||s===9||s===10||s===13||s===32?n++:s>127&&s<65534?!Lf(s)&&!jf(s)&&n++:e-=.1}const r=n/t.length;return e*=r,Mf(t)&&(e*=1.1),Math.max(0,Math.min(1,e))}function Lf(t){return t>=0&&t<=31||t>=127&&t<=159}function jf(t){return t>=57344&&t<=63743||t>=983040&&t<=1048573||t>=1048576&&t<=1114109}function Mf(t){return[/\b\w+\b/,/[.!?]+\s/,/\s+/,/[a-zA-Z]{3,}/,/[\u4e00-\u9fa5]+/,/\d+/].some(e=>e.test(t))}function es(t){if(typeof t!="object"||t===null||Object.prototype.toString.call(t)!=="[object Object]")return!1;const e=Object.getPrototypeOf(t);return e===Object.prototype||e===null}function Zo(t,e={}){const n={};return Object.entries(t).forEach(([r,i])=>{i!=null&&(e.dropEmptyString&&i===""||(n[r]=i))}),n}let qn=class{constructor(e,n,r){this.rawResponse=e,this.data=n,this.ok=e.ok,this.status=e.status,this.statusText=e.statusText,this.headers=e.headers,Object.entries(r||{}).forEach(([i,s])=>{this[i]=s})}};async function Ff(t,e,n){var r;if(t.bodyUsed)throw new Ge(Xe.BODY_USED,"Response body has already been used or locked");const i=t.headers.get("content-type")||"",s=Number(t.headers.get("content-length"))||0,o=(l,u)=>u==="json"||l.startsWith("application/json"),a=(l,u,c)=>c==="blob"||l.startsWith("image/")&&!l.startsWith("image/svg")||l.startsWith("video/")||l.startsWith("audio/")||!Rf(u);if((t.status===101||t.status===426||t.headers.get("upgrade"))&&typeof globalThis.WebSocket<"u"){const l=new WebSocket(t.url);return await new Promise((u,c)=>{l.onopen=u,l.onerror=c}),new qn(t,l,{ok:!0,status:101,statusText:"Switching Protocols"})}else if(i.startsWith("text/event-stream")&&!["text","json"].includes(e||"")&&typeof globalThis.EventSource<"u"){const l=new EventSource(t.url);return await new Promise((u,c)=>{l.onopen=u,l.onerror=c}),new qn(t,l)}else{if(e==="stream")return new qn(t,t.body);{const l=(r=t.clone().body)==null?void 0:r.getReader();if(!l)throw new Ge(Xe.NO_BODY_READER,"Failed to get ReadableStream from response body");let u=new Uint8Array;for(;;){const{done:f,value:w}=await l.read();if(f)break;if(w&&(u=new Uint8Array([...u,...w]),n&&s>0)){const y=Math.min(u.length/s,1);n(y,u)}}const c=new qn(t,void 0);if(e==="arrayBuffer")return c.data=u.buffer,c;if(o(i,e))try{const f=new TextDecoder().decode(u);c.data=JSON.parse(f)}catch{}if(typeof c.data!="string"&&a(i,u,e)?c.data=new Blob([u],{type:t.headers.get("content-type")||void 0}):c.data=new TextDecoder().decode(u),typeof c.data=="string"&&e!=="text"){const f=c.data.trim(),w=f[0],y=f[f.length-1];if(w==="{"&&y==="}"||w==="["&&y==="]")try{c.data=JSON.parse(c.data)}catch{}}if(typeof c.data>"u"&&(c.data=u.length>0?u:void 0),c.ok)return c;throw new If(`Request failed with status code ${t.status}`,c)}}}let Bf=class{static makeSearchParams(e){const n=new URLSearchParams;return Object.entries(e).forEach(([r,i])=>{Array.isArray(i)?i.forEach(s=>n.append(r,String(s))):n.set(r,String(i))}),n}static makeQueryString(e){return this.makeSearchParams(e).toString()}};function Uf(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var ts,ea;function Hf(){if(ea)return ts;ea=1;function t(e){var n=this.constructor.prototype[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,this.constructor.prototype),Object.getOwnPropertyNames(n).forEach(function(i){Object.defineProperty(r,i,Object.getOwnPropertyDescriptor(n,i))}),r}return t.prototype=Object.create(Function.prototype),ts=t,ts}var Wf=Hf();const qf=Uf(Wf);let ta=class Fi extends qf{constructor(e={}){super("request"),this.baseConfigs=e,this.hooks=[],this.DEFAULT_CONFIGS={baseURL:"",timeout:60*1e3,credentials:"same-origin",headers:{},query:{},responseType:void 0},this.ALL_METHODS=["get","post","put","patch","delete","head","options","trace"],this.METHODS_WITHOUT_BODY=["get","head","options","trace"],this.interceptors={request:this.createInterceptor("beforeRequest"),response:this.createInterceptor("afterResponse")},this.create=Fi.create,this.dropUndefinedAndNull=Zo,this.checkIsPlainObject=es,this.ALL_METHODS.forEach(this.createMethodShortcut.bind(this))}async request(e,n){var r,i,s,o;let a=n=n||{};typeof e=="string"||e instanceof URL?a.url=e.toString():typeof e=="object"&&(a={...e,...a}),a=await this.emit("beforeInit",a);const l=n.baseURL||this.baseConfigs.baseURL||((r=globalThis.location)==null?void 0:r.href),u=l?new URL(l,(i=globalThis.location)==null?void 0:i.href):void 0,c=new URL(a.url.toString(),u);a.url=c.href,a.baseURL=u?u.href:c.origin,a.headers=this.mergeHeaders(this.baseConfigs.headers,n.headers);const f=u?.searchParams,w=new URLSearchParams(c.searchParams);if(c.search="",a.url=c.href,a.query=this.mergeQuery(f,this.baseConfigs.query,w,n.query),c.search=Bf.makeQueryString(a.query),a.url=c.toString(),this.METHODS_WITHOUT_BODY.includes((s=a.method)==null?void 0:s.toLocaleLowerCase())&&a.body)throw new Ge(Xe.BODY_NOT_ALLOWED,`Request method "${a.method}" does not allow body`);a=await this.emit("beforeRequest",a);let y;typeof a.body<"u"&&a.body!==null&&(a.body instanceof Blob||a.body instanceof FormData||a.body instanceof URLSearchParams?y=a.body:typeof a.body=="object"&&a.body!==null?(y=JSON.stringify(a.body),a.headers["content-type"]="application/json"):y=a.body),!((o=n.headers)!=null&&o["content-type"])&&y&&(y instanceof FormData||y instanceof URLSearchParams?delete a.headers["content-type"]:typeof y=="string"&&typeof a.body=="object"?a.headers["content-type"]="application/json":y instanceof Blob&&(a.headers["content-type"]=y.type)),a.body=y,a=await this.emit("afterBodyTransformed",a);const v=a.abortController||globalThis.AbortController?new AbortController:void 0,I=new Request(a.url,{method:a.method||"GET",credentials:a.credentials,cache:a.cache,mode:a.mode,headers:a.headers,body:a.body,signal:v?.signal});a.rawRequest=I,a=await this.emit("beforeActualFetch",a);const z=a.timeout||this.baseConfigs.timeout||60*1e3;if(a.url.startsWith("ws"))try{const A=new WebSocket(a.url);return await new Promise((g,m)=>{const h=setTimeout(()=>{m(new Ge(Xe.TIMEOUT,`WebSocket connection timed out after ${z}ms`,a))},z);A.onopen=()=>{clearTimeout(h),g()},A.onerror=P=>{clearTimeout(h),m(new Ge(Xe.NETWORK_ERROR,"WebSocket connection failed",a))},A.onclose=P=>{P.code!==1e3&&(clearTimeout(h),m(new Ge(Xe.NETWORK_ERROR,`WebSocket closed with code ${P.code}`,a)))}}),a.rawResponse=new Response,a.response=new qn(a.rawResponse,A,{ok:!0,status:101,statusText:"Switching Protocols"}),a.data=A,a.headers=new Headers,this.emit("afterResponse",a)}catch(A){throw A instanceof Ge?A:new Ge(Xe.NETWORK_ERROR,`WebSocket creation failed: ${A}`,a)}let F;try{v&&(F=setTimeout(()=>{v.abort()},z));const A=await fetch(a.rawRequest).catch(g=>{throw F&&clearTimeout(F),v!=null&&v.signal.aborted?new Ge(Xe.TIMEOUT,`Request timed out after ${z}ms`,a):new Ge(Xe.NETWORK_ERROR,g.message,a)});return F&&clearTimeout(F),a.rawResponse=A,a.response=await Ff(A,a.responseType,(g,m)=>{var h;(h=n?.onProgress)==null||h.call(n,g,m)}),a.data=a.response.data,a.headers=a.response.headers,this.emit("afterResponse",a)}catch(A){throw F&&clearTimeout(F),A}}mergeQuery(e,...n){const r={},i=s=>{s&&(es(s)?Object.entries(s).forEach(([o,a])=>{a==null?delete r[o]:Array.isArray(a)?(o.endsWith("[]"),r[o]=a.map(String)):r[o]=String(a)}):new URLSearchParams(s).forEach((o,a)=>{r[a]=o}))};return i(e),n.forEach(i),r}mergeHeaders(e,...n){const r={},i=new Headers(e);for(const s of n)if(s!=null)if(es(s)){const o=Zo(s);if(Object.keys(o).length===0)continue;new Headers(o).forEach((a,l)=>{i.set(l,a)})}else new Headers(s).forEach((o,a)=>{i.set(a,o)});return i.forEach((s,o)=>{r[o]=s}),r}async emit(e,n){const r=this.hooks.filter(i=>i.event===e);try{let i=0;for(const s of r){const o=`${e}#${s.action.name||`anonymous#${i}`}`,a=Symbol("FexiosHookContext");n[a]=a;const l=await s.action.call(this,n);if(l===!1)throw new Ge(Xe.ABORTED_BY_HOOK,`Request aborted by hook "${o}"`,n);if(typeof l=="object"&&l[a]===a)n=l;else{const u=globalThis["".concat("console")];try{throw new Ge(Xe.HOOK_CONTEXT_CHANGED,`Hook "${o}" should return the original FexiosContext or return false to abort the request, but got "${l}".`)}catch(c){u.warn(c.stack||c)}}delete n[a],i++}}catch(i){return Promise.reject(i)}return n}on(e,n,r=!1){if(typeof n!="function")throw new Ge(Xe.INVALID_HOOK_CALLBACK,`Hook should be a function, but got "${typeof n}"`);return this.hooks[r?"unshift":"push"]({event:e,action:n}),this}off(e,n){return e==="*"||!e?this.hooks=this.hooks.filter(r=>r.action!==n):this.hooks=this.hooks.filter(r=>r.event!==e||r.action!==n),this}createInterceptor(e){return{handlers:()=>this.hooks.filter(n=>n.event===e).map(n=>n.action),use:(n,r=!1)=>this.on(e,n,r),clear:()=>{this.hooks=this.hooks.filter(n=>n.event!==e)}}}createMethodShortcut(e){return Object.defineProperty(this,e,{value:(n,r,i)=>(this.METHODS_WITHOUT_BODY.includes(e.toLocaleLowerCase())?i=r:(i=i||{},i.body=r),this.request(n,{...i,method:e}))}),this}extends(e){const n=new Fi({...this.baseConfigs,...e});return n.hooks=[...this.hooks],n}static create(e){return new Fi(e)}};/**
4
30
  * Fexios
5
31
  * @desc Fetch based HTTP client with similar API to axios for browser and Node.js
6
32
  *
7
33
  * @license MIT
8
34
  * @author dragon-fish <dragon-fish@qq.com>
9
- */const Xf=sa.create,oa=Xf();typeof globalThis<"u"?globalThis.fexios=oa:typeof window<"u"&&(window.fexios=oa);/**
35
+ */const zf=ta.create,na=zf();typeof globalThis<"u"?globalThis.fexios=na:typeof window<"u"&&(window.fexios=na);/**
10
36
  * MediaWiki Api
11
37
  * Provides the API call methods similar to `mw.Api` at non-mw environments
12
38
  *
13
39
  * @author Dragon-Fish <dragon-fish@qq.com>
14
40
  * @license MIT
15
- */const aa=class Jt{constructor(e,n,r){if(this.baseURL=e,this.version="5.0.0",!e&&typeof window=="object"&&window.mediaWiki){const{wgServer:i,wgScriptPath:s}=window.mediaWiki?.config?.get(["wgServer","wgScriptPath"])||{};typeof i=="string"&&typeof s=="string"&&(e=`${i}${s}/api.php`)}if(typeof e!="string")throw new Error("baseURL is undefined");this.baseURL=e,this.tokens={},this.defaultParams={...Jt.INIT_DEFAULT_PARAMS,...r},this.defaultOptions={responseType:"json",...n},this.request=Jt.createRequestHandler(this.baseURL)}setBaseURL(e){return this.request.baseConfigs.baseURL=e,this}static normalizeParamValue(e){return Array.isArray(e)?e.join("|"):typeof e=="boolean"?e?"1":void 0:typeof e=="number"?""+e:e}static createRequestHandler(e){const n=new sa({baseURL:e,responseType:"json"});return n.on("beforeInit",r=>{if(r.method?.toLowerCase()!=="post")return r;if(typeof r.body=="object"&&r.body!==null&&!(r.body instanceof URLSearchParams)&&!(r.body instanceof FormData)){const i=r.body;Object.keys(i).forEach(s=>{const o=Jt.normalizeParamValue(i[s]);typeof o>"u"||o===null?delete i[s]:o!==i[s]&&(i[s]=o)}),r.body=new URLSearchParams(r.body)}if(globalThis.FormData&&r.body instanceof FormData||r.body instanceof URLSearchParams){const i=r.body;i.forEach((o,a)=>{const l=Jt.normalizeParamValue(o);typeof l>"u"||l===null?i.delete(a):l!==o&&i.set(a,l)});const s=new URLSearchParams(r.query);!s.has("format")&&s.set("format",""+(i.get("format")||"json")),!s.has("formatversion")&&s.set("formatversion",""+(i.get("formatversion")||"2")),i.has("origin")&&s.set("origin",""+i.get("origin")),r.query=Object.fromEntries(s.entries()),i.has("action")&&(r.query.action=""+i.get("action"))}return r}),n.on("beforeInit",r=>{r.query=r.query;for(const i in r.query){const s=Jt.normalizeParamValue(r.query[i]);typeof s>"u"||s===null?delete r.query[i]:s!==r.query[i]&&(r.query[i]=""+s)}return r}),n.on("beforeRequest",r=>{const i=new URL(r.url),s=i.searchParams;if(globalThis.location&&(!s.has("origin")&&location.origin!==new URL(e).origin?(s.set("origin",location.origin),n.baseConfigs.credentials="include",n.baseConfigs.mode="cors"):location.origin===new URL(e).origin&&(s.delete("origin"),n.baseConfigs.credentials=void 0,n.baseConfigs.mode=void 0)),i.searchParams.has("origin")){const o=encodeURIComponent(i.searchParams.get("origin")||"").replace(/\./g,"%2E");r.query={},i.searchParams.delete("origin"),r.url=`${i}${i.search?"&":"?"}origin=${o}`}return r}),n}get(e,n){return this.request.get("",{...this.defaultOptions,query:{...this.defaultParams,...this.defaultOptions.query,...e},...n})}post(e,n){return this.request.post("",e,{...this.defaultOptions,query:{...this.defaultParams,...this.defaultOptions.query},...n})}async login(e,n,r,i){if(this.defaultOptions.credentials="include",i=i||{},i.retry??(i.retry=3),i.retry<1)throw new hn("LOGIN_RETRY_LIMIT_EXCEEDED","The limit of the number of times to automatically re-login has been exceeded");let s;try{const o=await this.postWithToken("login",{action:"login",lgname:e,lgpassword:n,...r},{tokenName:"lgtoken",...i});if(o?.data?.login)s=o.data;else throw o}catch(o){if(o instanceof hn)throw o;if(o?.ok===!1)return this.login(e,n,r,{...i,noCache:!0,retry:i.retry-1});throw new hn("HTTP_ERROR","The server returns an error, but it doesn't seem to be caused by MediaWiki",o)}if(s?.login?.result!=="Success")throw new hn("LOGIN_FAILED",s?.login?.reason?.text||s?.login?.result||"Login failed with unknown reason",s);return s.login}async getUserInfo(){const{data:e}=await this.get({action:"query",meta:"userinfo",uiprop:["groups","rights","blockinfo"]});return e?.query?.userinfo}async getTokens(e=["csrf"]){this.defaultOptions.credentials="include";const{data:n}=await this.get({action:"query",meta:"tokens",type:e});return this.tokens={...this.tokens,...n.query.tokens},this.tokens}async token(e="csrf",n=!1){return(!this.tokens[`${e}token`]||n)&&(delete this.tokens[`${e}token`],await this.getTokens([e])),this.tokens[`${e}token`]}async postWithToken(e,n,r){const{tokenName:i="token",retry:s=3,noCache:o=!1}=r||{};if(s<1)throw new hn("TOKEN_RETRY_LIMIT_EXCEEDED","The limit of the number of times to automatically re-acquire the token has been exceeded");const a=await this.token(e,o),l=()=>this.postWithToken(e,n,{tokenName:i,retry:s-1,noCache:!0});return this.post({[i]:a,...n}).then(u=>{const c=u.data;return Jt.isBadTokenError(c)?l():u}).catch(u=>{const c=u.data;if(Jt.isBadTokenError(c)||u?.ok===!1)return l();if(typeof c=="object"&&c!==null)return Promise.reject(c);throw new hn("HTTP_ERROR","The server returns an error, but it doesn’t seem to be caused by MediaWiki",u)})}postWithEditToken(e){return this.postWithToken("csrf",e)}static isBadTokenError(e){return e?.error?.code==="badtoken"||e?.errors?.some(n=>n.code==="badtoken")||["NeedToken","WrongToken"].includes(e?.login?.result)}async getMessages(e,n="zh",r){const{data:i}=await this.get({action:"query",meta:"allmessages",ammessages:e,amlang:n,...r}),s={};return i.query.allmessages.forEach(function(o){o.missing||(s[o.name]=o.content)}),s}async parseWikitext(e,n,r,i){const{data:s}=await this.post({action:"parse",title:n,text:e,...r},i);return s.parse.text}};aa.INIT_DEFAULT_PARAMS={action:"query",errorformat:"plaintext",format:"json",formatversion:2};let Zf=aa,hn=class extends Error{constructor(e,n="",r){super(),this.code=e,this.message=n,this.cause=r,this.name="WikiSaikouError"}};/**
41
+ */const ra=class Jt{constructor(e,n,r){if(this.baseURL=e,this.version="5.0.0",!e&&typeof window=="object"&&window.mediaWiki){const{wgServer:i,wgScriptPath:s}=window.mediaWiki?.config?.get(["wgServer","wgScriptPath"])||{};typeof i=="string"&&typeof s=="string"&&(e=`${i}${s}/api.php`)}if(typeof e!="string")throw new Error("baseURL is undefined");this.baseURL=e,this.tokens={},this.defaultParams={...Jt.INIT_DEFAULT_PARAMS,...r},this.defaultOptions={responseType:"json",...n},this.request=Jt.createRequestHandler(this.baseURL)}setBaseURL(e){return this.request.baseConfigs.baseURL=e,this}static normalizeParamValue(e){return Array.isArray(e)?e.join("|"):typeof e=="boolean"?e?"1":void 0:typeof e=="number"?""+e:e}static createRequestHandler(e){const n=new ta({baseURL:e,responseType:"json"});return n.on("beforeInit",r=>{if(r.method?.toLowerCase()!=="post")return r;if(typeof r.body=="object"&&r.body!==null&&!(r.body instanceof URLSearchParams)&&!(r.body instanceof FormData)){const i=r.body;Object.keys(i).forEach(s=>{const o=Jt.normalizeParamValue(i[s]);typeof o>"u"||o===null?delete i[s]:o!==i[s]&&(i[s]=o)}),r.body=new URLSearchParams(r.body)}if(globalThis.FormData&&r.body instanceof FormData||r.body instanceof URLSearchParams){const i=r.body;i.forEach((o,a)=>{const l=Jt.normalizeParamValue(o);typeof l>"u"||l===null?i.delete(a):l!==o&&i.set(a,l)});const s=new URLSearchParams(r.query);!s.has("format")&&s.set("format",""+(i.get("format")||"json")),!s.has("formatversion")&&s.set("formatversion",""+(i.get("formatversion")||"2")),i.has("origin")&&s.set("origin",""+i.get("origin")),r.query=Object.fromEntries(s.entries()),i.has("action")&&(r.query.action=""+i.get("action"))}return r}),n.on("beforeInit",r=>{r.query=r.query;for(const i in r.query){const s=Jt.normalizeParamValue(r.query[i]);typeof s>"u"||s===null?delete r.query[i]:s!==r.query[i]&&(r.query[i]=""+s)}return r}),n.on("beforeRequest",r=>{const i=new URL(r.url),s=i.searchParams;if(globalThis.location&&(!s.has("origin")&&location.origin!==new URL(e).origin?(s.set("origin",location.origin),n.baseConfigs.credentials="include",n.baseConfigs.mode="cors"):location.origin===new URL(e).origin&&(s.delete("origin"),n.baseConfigs.credentials=void 0,n.baseConfigs.mode=void 0)),i.searchParams.has("origin")){const o=encodeURIComponent(i.searchParams.get("origin")||"").replace(/\./g,"%2E");r.query={},i.searchParams.delete("origin"),r.url=`${i}${i.search?"&":"?"}origin=${o}`}return r}),n}get(e,n){return this.request.get("",{...this.defaultOptions,query:{...this.defaultParams,...this.defaultOptions.query,...e},...n})}post(e,n){return this.request.post("",e,{...this.defaultOptions,query:{...this.defaultParams,...this.defaultOptions.query},...n})}async login(e,n,r,i){if(this.defaultOptions.credentials="include",i=i||{},i.retry??(i.retry=3),i.retry<1)throw new hn("LOGIN_RETRY_LIMIT_EXCEEDED","The limit of the number of times to automatically re-login has been exceeded");let s;try{const o=await this.postWithToken("login",{action:"login",lgname:e,lgpassword:n,...r},{tokenName:"lgtoken",...i});if(o?.data?.login)s=o.data;else throw o}catch(o){if(o instanceof hn)throw o;if(o?.ok===!1)return this.login(e,n,r,{...i,noCache:!0,retry:i.retry-1});throw new hn("HTTP_ERROR","The server returns an error, but it doesn't seem to be caused by MediaWiki",o)}if(s?.login?.result!=="Success")throw new hn("LOGIN_FAILED",s?.login?.reason?.text||s?.login?.result||"Login failed with unknown reason",s);return s.login}async getUserInfo(){const{data:e}=await this.get({action:"query",meta:"userinfo",uiprop:["groups","rights","blockinfo"]});return e?.query?.userinfo}async getTokens(e=["csrf"]){this.defaultOptions.credentials="include";const{data:n}=await this.get({action:"query",meta:"tokens",type:e});return this.tokens={...this.tokens,...n.query.tokens},this.tokens}async token(e="csrf",n=!1){return(!this.tokens[`${e}token`]||n)&&(delete this.tokens[`${e}token`],await this.getTokens([e])),this.tokens[`${e}token`]}async postWithToken(e,n,r){const{tokenName:i="token",retry:s=3,noCache:o=!1}=r||{};if(s<1)throw new hn("TOKEN_RETRY_LIMIT_EXCEEDED","The limit of the number of times to automatically re-acquire the token has been exceeded");const a=await this.token(e,o),l=()=>this.postWithToken(e,n,{tokenName:i,retry:s-1,noCache:!0});return this.post({[i]:a,...n}).then(u=>{const c=u.data;return Jt.isBadTokenError(c)?l():u}).catch(u=>{const c=u.data;if(Jt.isBadTokenError(c)||u?.ok===!1)return l();if(typeof c=="object"&&c!==null)return Promise.reject(c);throw new hn("HTTP_ERROR","The server returns an error, but it doesn’t seem to be caused by MediaWiki",u)})}postWithEditToken(e){return this.postWithToken("csrf",e)}static isBadTokenError(e){return e?.error?.code==="badtoken"||e?.errors?.some(n=>n.code==="badtoken")||["NeedToken","WrongToken"].includes(e?.login?.result)}async getMessages(e,n="zh",r){const{data:i}=await this.get({action:"query",meta:"allmessages",ammessages:e,amlang:n,...r}),s={};return i.query.allmessages.forEach(function(o){o.missing||(s[o.name]=o.content)}),s}async parseWikitext(e,n,r,i){const{data:s}=await this.post({action:"parse",title:n,text:e,...r},i);return s.parse.text}};ra.INIT_DEFAULT_PARAMS={action:"query",errorformat:"plaintext",format:"json",formatversion:2};let Vf=ra,hn=class extends Error{constructor(e,n="",r){super(),this.code=e,this.message=n,this.cause=r,this.name="WikiSaikouError"}};/**
16
42
  * MediaWiki Api
17
43
  * Provides the API call methods similar to `mw.Api` at non-mw environments
18
44
  *
19
45
  * @author Dragon-Fish <dragon-fish@qq.com>
20
46
  * @license MIT
21
- */let la=class extends Zf{};class ed{constructor(e,n){this.ctx=e;let r=typeof n?.baseURL=="string"?n.baseURL:n?.baseURL?.toString();r?.startsWith("/")&&(r=new URL(r,location.origin).href);const i=new la(r,{headers:{"x-api-user-agent":`InPageEdit-NEXT ${e.version}`}});e.set("api",i)}}class td extends dn{constructor(e){super(e,"resourceLoader",!0),this.ctx=e}stop(){}loadScript(e,n){if(!e)return Promise.resolve(null);const r=`script:${e}`,i=document.querySelector(`[data-ipe="${r}"]`);return i?Promise.resolve(i):new Promise((o,a)=>{const l=document.createElement("script");l.src=e,l.dataset.ipe=r,n&&Object.entries(n).forEach(([u,c])=>{typeof c>"u"||c===!1||c===null?l.removeAttribute(u):l.setAttribute(u,c)}),document.body.appendChild(l),l.onload=()=>o(l),l.onerror=u=>a(u)})}loadStyle(e,n){if(!e)return Promise.resolve(null);const r=`style:${e}`,i=document.querySelector(`[data-ipe="${r}"]`);return i?Promise.resolve(i):new Promise((o,a)=>{const l=document.createElement("link");l.rel="stylesheet",l.href=e,l.dataset.ipe=r,n&&Object.entries(n).forEach(([c,f])=>{typeof f>"u"||f===!1||f===null?l.removeAttribute(c):l.setAttribute(c,f)}),(document.querySelector('meta[name="ipe-styles"]')||(()=>{const c=document.createElement("meta");return c.id="ipe-styles",c.name="ipe-styles",document.head.insertAdjacentElement("afterbegin",c),c})()).before(l),l.onload=()=>o(l),l.onerror=c=>a(c)})}resolveImportPath(e){if(e.startsWith("http")||e.startsWith("//"))return e;const n=document.currentScript?.src;if(!n)return`https://unpkg.com/mediawiki-inpageedit@latest/dist/${e}`;const r=new URL(n);return r.pathname.endsWith(".js")||(r.pathname=r.pathname+"/"),new URL(e,r.toString()).toString()}}const $r=Object.keys;function nd(t){return typeof t=="boolean"}function rd(t){return t&&typeof t.nodeType=="number"}function Ar(t){return typeof t=="string"}function ca(t){return typeof t=="number"}function Xt(t){return typeof t=="object"?t!==null:zn(t)}function zn(t){return typeof t=="function"}function id(t){return!!(t&&t.isComponent)}function sd(t){return Xt(t)&&typeof t.length=="number"&&typeof t.nodeType!="number"}function ns(t,e){if(t)for(const n of $r(t))e(t[n],n)}function od(t){return Xt(t)&&"current"in t}const rs={animationIterationCount:0,borderImageOutset:0,borderImageSlice:0,borderImageWidth:0,boxFlex:0,boxFlexGroup:0,boxOrdinalGroup:0,columnCount:0,columns:0,flex:0,flexGrow:0,flexPositive:0,flexShrink:0,flexNegative:0,flexOrder:0,gridArea:0,gridRow:0,gridRowEnd:0,gridRowSpan:0,gridRowStart:0,gridColumn:0,gridColumnEnd:0,gridColumnSpan:0,gridColumnStart:0,fontWeight:0,lineClamp:0,lineHeight:0,opacity:0,order:0,orphans:0,tabSize:0,widows:0,zIndex:0,zoom:0,fillOpacity:0,floodOpacity:0,stopOpacity:0,strokeDasharray:0,strokeDashoffset:0,strokeMiterlimit:0,strokeOpacity:0,strokeWidth:0};function ad(t,e){return t+e.charAt(0).toUpperCase()+e.substring(1)}const ld=["Webkit","ms","Moz","O"];$r(rs).forEach(t=>{ld.forEach(e=>{rs[ad(e,t)]=0})});const cd=Symbol.for("jsx-dom:type");var ua=function(t){return t.ShadowRoot="ShadowRoot",t}(ua||{});function ud(t){return t!=null&&t[cd]===ua.ShadowRoot}const fd="http://www.w3.org/2000/svg",dd="http://www.w3.org/1999/xlink",hd="http://www.w3.org/XML/1998/namespace";function fa(t){return!nd(t)&&t!=null}function is(t){return Array.isArray(t)?t.map(is).filter(Boolean).join(" "):Xt(t)?Symbol.iterator in t?is(Array.from(t)):$r(t).filter(e=>t[e]).join(" "):fa(t)?""+t:""}const pd={animate:0,circle:0,clipPath:0,defs:0,desc:0,ellipse:0,feBlend:0,feColorMatrix:0,feComponentTransfer:0,feComposite:0,feConvolveMatrix:0,feDiffuseLighting:0,feDisplacementMap:0,feDistantLight:0,feFlood:0,feFuncA:0,feFuncB:0,feFuncG:0,feFuncR:0,feGaussianBlur:0,feImage:0,feMerge:0,feMergeNode:0,feMorphology:0,feOffset:0,fePointLight:0,feSpecularLighting:0,feSpotLight:0,feTile:0,feTurbulence:0,filter:0,foreignObject:0,g:0,image:0,line:0,linearGradient:0,marker:0,mask:0,metadata:0,path:0,pattern:0,polygon:0,polyline:0,radialGradient:0,rect:0,stop:0,svg:0,switch:0,symbol:0,text:0,textPath:0,tspan:0,use:0,view:0},md=/^(a(ll|t|u)|base[FP]|c(al|lipPathU|on)|di|ed|ex|filter[RU]|g(lyphR|r)|ke|l(en|im)|ma(rker[HUW]|s)|n|pat|pr|point[^e]|re[^n]|s[puy]|st[^or]|ta|textL|vi|xC|y|z)/;function Ir(t){const e=document.createDocumentFragment();return Tr(t.children,e),e}function gd(t,e,n){e={...e,children:n};const r=new t(e),i=r.render();return"ref"in e&&ss(e.ref,r),i}function C(t,e){let{children:n,...r}=e;!r.namespaceURI&&pd[t]===0&&(r={...r,namespaceURI:fd});let i;if(Ar(t)){if(i=r.namespaceURI?document.createElementNS(r.namespaceURI,t):document.createElement(t),_d(r,i),Tr(n,i),i instanceof window.HTMLSelectElement&&r.value!=null)if(r.multiple===!0&&Array.isArray(r.value)){const s=r.value.map(o=>String(o));i.querySelectorAll("option").forEach(o=>o.selected=s.includes(o.value))}else i.value=r.value;ss(r.ref,i)}else if(zn(t))Xt(t.defaultProps)&&(r={...t.defaultProps,...r}),i=id(t)?gd(t,r,n):t({...r,children:n});else throw new TypeError(`Invalid JSX element type: ${t}`);return i}function yd(t,e){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];return(Ar(e)||Array.isArray(e))&&(r.unshift(e),e={}),e=e||{},e.children!=null&&!r.length&&({children:r,...e}=e),C(t,{...e,children:r},e.key)}function ss(t,e){od(t)?t.current=e:zn(t)&&t(e)}function Tr(t,e){if(sd(t))bd(t,e);else if(Ar(t)||ca(t))os(document.createTextNode(t),e);else if(t===null)os(document.createComment(""),e);else if(rd(t))os(t,e);else if(ud(t)){const n=e.attachShadow(t.attr);Tr(t.children,n),ss(t.ref,n)}}function bd(t,e){for(const n of[...t])Tr(n,e);return e}function os(t,e){e instanceof window.HTMLTemplateElement?e.content.appendChild(t):e.appendChild(t)}function Rr(t,e){return t.replace(/[A-Z]/g,n=>e+n.toLowerCase())}function da(t,e){e==null||e===!1||(Array.isArray(e)?e.forEach(n=>da(t,n)):Ar(e)?t.setAttribute("style",e):Xt(e)&&ns(e,(n,r)=>{r.indexOf("-")===0?t.style.setProperty(r,n):ca(n)&&rs[r]!==0?t.style[r]=n+"px":t.style[r]=n}))}function vd(t,e,n){switch(t){case"xlinkActuate":case"xlinkArcrole":case"xlinkHref":case"xlinkRole":case"xlinkShow":case"xlinkTitle":case"xlinkType":ha(n,dd,Rr(t,":"),e);return;case"xmlnsXlink":pn(n,Rr(t,":"),e);return;case"xmlBase":case"xmlLang":case"xmlSpace":ha(n,hd,Rr(t,":"),e);return}switch(t){case"htmlFor":pn(n,"for",e);return;case"dataset":ns(e,(r,i)=>{r!=null&&(n.dataset[i]=r)});return;case"innerHTML":case"innerText":case"textContent":fa(e)&&(n[t]=e);return;case"dangerouslySetInnerHTML":Xt(e)&&(n.innerHTML=e.__html);return;case"value":if(e==null||n instanceof window.HTMLSelectElement)return;if(n instanceof window.HTMLTextAreaElement){n.value=e;return}break;case"spellCheck":n.spellcheck=e;return;case"class":case"className":zn(e)?e(n):pn(n,"class",is(e));return;case"ref":case"namespaceURI":return;case"style":da(n,e);return;case"on":case"onCapture":ns(e,(r,i)=>{n.addEventListener(i,r,t==="onCapture")});return}if(zn(e)){if(t[0]==="o"&&t[1]==="n"){let r=t.toLowerCase();const i=r.endsWith("capture");if(r==="ondoubleclick"?r="ondblclick":i&&r==="ondoubleclickcapture"&&(r="ondblclickcapture"),!i&&n[r]===null)n[r]=e;else if(i)n.addEventListener(r.substring(2,r.length-7),e,!0);else{let s;r in window?s=r.substring(2):s=r[2]+t.slice(3),n.addEventListener(s,e)}}}else Xt(e)?n[t]=e:e===!0?pn(n,t,""):e!==!1&&e!=null&&(n instanceof SVGElement&&!md.test(t)?pn(n,Rr(t,"-"),e):pn(n,t,e))}function pn(t,e,n){t.setAttribute(e,n)}function ha(t,e,n,r){t.setAttributeNS(e,n,r)}function _d(t,e){for(const n of $r(t))vd(n,t[n],e);return e}var mn=(t=>(t.ANALYTICS_API_BASE="https://analytics.ipe.wiki/api",t.ANALYTICS_DASH_URL="https://analytics.ipe.wiki",t.GITHUB_URL="https://github.com/inpageedit/inpageedit-v2",t.HOME_URL="https://www.ipe.wiki/",t.PLUGIN_CDN_BASE="https://ipe-plugins.js.org",t.PLUGIN_HOME_URL="https://github.com/inpageedit/Plugins",t.SPECIAL_NOTICE_JSON="https://ipe-plugins.js.org/specialNotice.json",t.UPDATE_LOGS_URL="https://www.ipe.wiki/update/",t))(mn||{});const wd={ipe_progress:"_ipe_progress_so6hn_1"},Zt=t=>{const e=t.indeterminate??!0,n=C("div",{class:`${wd.ipe_progress}`,"data-indeterminate":`${e}`,style:{width:"100%","--progress":t.progress?`${t.progress}%`:"0%"},...t});return n.setProgress=r=>{typeof r=="number"?(n.dataset.indeterminate="false",n.style.setProperty("--progress",`${r}%`)):(n.dataset.indeterminate="true",n.style.setProperty("--progress","0%"))},n},Co=class Co{constructor(e){this.ctx=e,this.start(),this.ctx.on("dispose",()=>{this.stop()})}start(){const{promise:e,resolve:n}=Promise.withResolvers();return window.ssi_modal&&typeof window.ssi_modal.show=="function"?n(window.ssi_modal):(this.ctx.resourceLoader.loadStyle(`${mn.PLUGIN_CDN_BASE}/lib/ssi-modal/ssi-modal.css`),this.ctx.resourceLoader.loadScript(`${mn.PLUGIN_CDN_BASE}/lib/ssi-modal/ssi-modal.js`,{async:""}).then(()=>{n(window.ssi_modal)})),e.then(r=>{this.hackSsiModal(r),this.ctx.set("modal",r),this.modal=r})}get logger(){return this.ctx.logger("SSI_MODAL")}stop(){this.modal?.closeAll()}hackSsiModal(e){const n=this,r=e.proto.init;e.proto.init=function(){var o;return n.logger.log("init",this),(o=this.options).className||(o.className=""),this.options.className+=" in-page-edit theme-ipe",r.call(this)};const i=e.proto.show;e.proto.show=function(){return n.ctx.emit("modal/show",{modal:this}),i.call(this)};const s=e.proto.close;return e.proto.close=function(){return n.ctx.emit("modal/close",{modal:this}),s.call(this)},e.proto.setLoadingState=function(o){if(this.get$window().toggleClass("loading",o),o){const a=this.get$window().find("input:not([disabled]),button:not([disabled])");this.get$modal().data("inputsAndButtons",a),a.prop("disabled",!0),this.get$window().append(C("div",{id:"ssi-modalLoadingWrapper",style:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",justifyContent:"center",alignItems:"center",backgroundColor:"rgba(255, 255, 255, 0.5)",zIndex:2e3},children:C(Zt,{style:{width:"80%",maxWidth:"800px"}})}))}else{this.get$window().find("#ssi-modalLoadingWrapper").remove();const a=this.get$modal().data("inputsAndButtons");a&&a.prop("disabled",!1)}},e}};Co.inject=["resourceLoader"];let as=Co;var Dr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function xd(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Nr(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var ls={exports:{}};/*!
47
+ */let ia=class extends Vf{};class Kf{constructor(e,n){this.ctx=e;let r=typeof n?.baseURL=="string"?n.baseURL:n?.baseURL?.toString();r?.startsWith("/")&&(r=new URL(r,location.origin).href);const i=new ia(r,{headers:{"x-api-user-agent":`InPageEdit-NEXT ${e.version}`}});e.set("api",i)}}class Gf extends dn{constructor(e){super(e,"resourceLoader",!0),this.ctx=e}stop(){}loadScript(e,n){if(!e)return Promise.resolve(null);const r=`script:${e}`,i=document.querySelector(`[data-ipe="${r}"]`);return i?Promise.resolve(i):new Promise((o,a)=>{const l=document.createElement("script");l.src=e,l.dataset.ipe=r,n&&Object.entries(n).forEach(([u,c])=>{typeof c>"u"||c===!1||c===null?l.removeAttribute(u):l.setAttribute(u,c)}),document.body.appendChild(l),l.onload=()=>o(l),l.onerror=u=>a(u)})}loadStyle(e,n){if(!e)return Promise.resolve(null);const r=`style:${e}`,i=document.querySelector(`[data-ipe="${r}"]`);return i?Promise.resolve(i):new Promise((o,a)=>{const l=document.createElement("link");l.rel="stylesheet",l.href=e,l.dataset.ipe=r,n&&Object.entries(n).forEach(([c,f])=>{typeof f>"u"||f===!1||f===null?l.removeAttribute(c):l.setAttribute(c,f)}),(document.querySelector('meta[name="ipe-styles"]')||(()=>{const c=document.createElement("meta");return c.id="ipe-styles",c.name="ipe-styles",document.head.insertAdjacentElement("afterbegin",c),c})()).before(l),l.onload=()=>o(l),l.onerror=c=>a(c)})}resolveImportPath(e){if(e.startsWith("http")||e.startsWith("//"))return e;const n=document.currentScript?.src;if(!n)return`https://unpkg.com/mediawiki-inpageedit@latest/dist/${e}`;const r=new URL(n);return r.pathname.endsWith(".js")||(r.pathname=r.pathname+"/"),new URL(e,r.toString()).toString()}}const Ir=Object.keys;function Yf(t){return typeof t=="boolean"}function Jf(t){return t&&typeof t.nodeType=="number"}function Rr(t){return typeof t=="string"}function sa(t){return typeof t=="number"}function Xt(t){return typeof t=="object"?t!==null:zn(t)}function zn(t){return typeof t=="function"}function Qf(t){return!!(t&&t.isComponent)}function Xf(t){return Xt(t)&&typeof t.length=="number"&&typeof t.nodeType!="number"}function ns(t,e){if(t)for(const n of Ir(t))e(t[n],n)}function Zf(t){return Xt(t)&&"current"in t}const rs={animationIterationCount:0,borderImageOutset:0,borderImageSlice:0,borderImageWidth:0,boxFlex:0,boxFlexGroup:0,boxOrdinalGroup:0,columnCount:0,columns:0,flex:0,flexGrow:0,flexPositive:0,flexShrink:0,flexNegative:0,flexOrder:0,gridArea:0,gridRow:0,gridRowEnd:0,gridRowSpan:0,gridRowStart:0,gridColumn:0,gridColumnEnd:0,gridColumnSpan:0,gridColumnStart:0,fontWeight:0,lineClamp:0,lineHeight:0,opacity:0,order:0,orphans:0,tabSize:0,widows:0,zIndex:0,zoom:0,fillOpacity:0,floodOpacity:0,stopOpacity:0,strokeDasharray:0,strokeDashoffset:0,strokeMiterlimit:0,strokeOpacity:0,strokeWidth:0};function ed(t,e){return t+e.charAt(0).toUpperCase()+e.substring(1)}const td=["Webkit","ms","Moz","O"];Ir(rs).forEach(t=>{td.forEach(e=>{rs[ed(e,t)]=0})});const nd=Symbol.for("jsx-dom:type");var oa=function(t){return t.ShadowRoot="ShadowRoot",t}(oa||{});function rd(t){return t!=null&&t[nd]===oa.ShadowRoot}const id="http://www.w3.org/2000/svg",sd="http://www.w3.org/1999/xlink",od="http://www.w3.org/XML/1998/namespace";function aa(t){return!Yf(t)&&t!=null}function is(t){return Array.isArray(t)?t.map(is).filter(Boolean).join(" "):Xt(t)?Symbol.iterator in t?is(Array.from(t)):Ir(t).filter(e=>t[e]).join(" "):aa(t)?""+t:""}const ad={animate:0,circle:0,clipPath:0,defs:0,desc:0,ellipse:0,feBlend:0,feColorMatrix:0,feComponentTransfer:0,feComposite:0,feConvolveMatrix:0,feDiffuseLighting:0,feDisplacementMap:0,feDistantLight:0,feFlood:0,feFuncA:0,feFuncB:0,feFuncG:0,feFuncR:0,feGaussianBlur:0,feImage:0,feMerge:0,feMergeNode:0,feMorphology:0,feOffset:0,fePointLight:0,feSpecularLighting:0,feSpotLight:0,feTile:0,feTurbulence:0,filter:0,foreignObject:0,g:0,image:0,line:0,linearGradient:0,marker:0,mask:0,metadata:0,path:0,pattern:0,polygon:0,polyline:0,radialGradient:0,rect:0,stop:0,svg:0,switch:0,symbol:0,text:0,textPath:0,tspan:0,use:0,view:0},ld=/^(a(ll|t|u)|base[FP]|c(al|lipPathU|on)|di|ed|ex|filter[RU]|g(lyphR|r)|ke|l(en|im)|ma(rker[HUW]|s)|n|pat|pr|point[^e]|re[^n]|s[puy]|st[^or]|ta|textL|vi|xC|y|z)/;function Tr(t){const e=document.createDocumentFragment();return Dr(t.children,e),e}function cd(t,e,n){e={...e,children:n};const r=new t(e),i=r.render();return"ref"in e&&ss(e.ref,r),i}function O(t,e){let{children:n,...r}=e;!r.namespaceURI&&ad[t]===0&&(r={...r,namespaceURI:id});let i;if(Rr(t)){if(i=r.namespaceURI?document.createElementNS(r.namespaceURI,t):document.createElement(t),hd(r,i),Dr(n,i),i instanceof window.HTMLSelectElement&&r.value!=null)if(r.multiple===!0&&Array.isArray(r.value)){const s=r.value.map(o=>String(o));i.querySelectorAll("option").forEach(o=>o.selected=s.includes(o.value))}else i.value=r.value;ss(r.ref,i)}else if(zn(t))Xt(t.defaultProps)&&(r={...t.defaultProps,...r}),i=Qf(t)?cd(t,r,n):t({...r,children:n});else throw new TypeError(`Invalid JSX element type: ${t}`);return i}function ud(t,e){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];return(Rr(e)||Array.isArray(e))&&(r.unshift(e),e={}),e=e||{},e.children!=null&&!r.length&&({children:r,...e}=e),O(t,{...e,children:r},e.key)}function ss(t,e){Zf(t)?t.current=e:zn(t)&&t(e)}function Dr(t,e){if(Xf(t))fd(t,e);else if(Rr(t)||sa(t))os(document.createTextNode(t),e);else if(t===null)os(document.createComment(""),e);else if(Jf(t))os(t,e);else if(rd(t)){const n=e.attachShadow(t.attr);Dr(t.children,n),ss(t.ref,n)}}function fd(t,e){for(const n of[...t])Dr(n,e);return e}function os(t,e){e instanceof window.HTMLTemplateElement?e.content.appendChild(t):e.appendChild(t)}function Nr(t,e){return t.replace(/[A-Z]/g,n=>e+n.toLowerCase())}function la(t,e){e==null||e===!1||(Array.isArray(e)?e.forEach(n=>la(t,n)):Rr(e)?t.setAttribute("style",e):Xt(e)&&ns(e,(n,r)=>{r.indexOf("-")===0?t.style.setProperty(r,n):sa(n)&&rs[r]!==0?t.style[r]=n+"px":t.style[r]=n}))}function dd(t,e,n){switch(t){case"xlinkActuate":case"xlinkArcrole":case"xlinkHref":case"xlinkRole":case"xlinkShow":case"xlinkTitle":case"xlinkType":ca(n,sd,Nr(t,":"),e);return;case"xmlnsXlink":pn(n,Nr(t,":"),e);return;case"xmlBase":case"xmlLang":case"xmlSpace":ca(n,od,Nr(t,":"),e);return}switch(t){case"htmlFor":pn(n,"for",e);return;case"dataset":ns(e,(r,i)=>{r!=null&&(n.dataset[i]=r)});return;case"innerHTML":case"innerText":case"textContent":aa(e)&&(n[t]=e);return;case"dangerouslySetInnerHTML":Xt(e)&&(n.innerHTML=e.__html);return;case"value":if(e==null||n instanceof window.HTMLSelectElement)return;if(n instanceof window.HTMLTextAreaElement){n.value=e;return}break;case"spellCheck":n.spellcheck=e;return;case"class":case"className":zn(e)?e(n):pn(n,"class",is(e));return;case"ref":case"namespaceURI":return;case"style":la(n,e);return;case"on":case"onCapture":ns(e,(r,i)=>{n.addEventListener(i,r,t==="onCapture")});return}if(zn(e)){if(t[0]==="o"&&t[1]==="n"){let r=t.toLowerCase();const i=r.endsWith("capture");if(r==="ondoubleclick"?r="ondblclick":i&&r==="ondoubleclickcapture"&&(r="ondblclickcapture"),!i&&n[r]===null)n[r]=e;else if(i)n.addEventListener(r.substring(2,r.length-7),e,!0);else{let s;r in window?s=r.substring(2):s=r[2]+t.slice(3),n.addEventListener(s,e)}}}else Xt(e)?n[t]=e:e===!0?pn(n,t,""):e!==!1&&e!=null&&(n instanceof SVGElement&&!ld.test(t)?pn(n,Nr(t,"-"),e):pn(n,t,e))}function pn(t,e,n){t.setAttribute(e,n)}function ca(t,e,n,r){t.setAttributeNS(e,n,r)}function hd(t,e){for(const n of Ir(t))dd(n,t[n],e);return e}var mn=(t=>(t.ANALYTICS_API_BASE="https://analytics.ipe.wiki/api",t.ANALYTICS_DASH_URL="https://analytics.ipe.wiki",t.GITHUB_URL="https://github.com/inpageedit/inpageedit-v2",t.HOME_URL="https://www.ipe.wiki/",t.PLUGIN_CDN_BASE="https://ipe-plugins.js.org",t.PLUGIN_HOME_URL="https://github.com/inpageedit/Plugins",t.SPECIAL_NOTICE_JSON="https://ipe-plugins.js.org/specialNotice.json",t.UPDATE_LOGS_URL="https://www.ipe.wiki/update/",t))(mn||{});const pd={ipe_progress:"_ipe_progress_so6hn_1"},Zt=t=>{const e=t.indeterminate??!0,n=O("div",{class:`${pd.ipe_progress}`,"data-indeterminate":`${e}`,style:{width:"100%","--progress":t.progress?`${t.progress}%`:"0%"},...t});return n.setProgress=r=>{typeof r=="number"?(n.dataset.indeterminate="false",n.style.setProperty("--progress",`${r}%`)):(n.dataset.indeterminate="true",n.style.setProperty("--progress","0%"))},n},Oo=class Oo{constructor(e){this.ctx=e,this.start(),this.ctx.on("dispose",()=>{this.stop()})}start(){const{promise:e,resolve:n}=Promise.withResolvers();return window.ssi_modal&&typeof window.ssi_modal.show=="function"?n(window.ssi_modal):(this.ctx.resourceLoader.loadStyle(`${mn.PLUGIN_CDN_BASE}/lib/ssi-modal/ssi-modal.css`),this.ctx.resourceLoader.loadScript(`${mn.PLUGIN_CDN_BASE}/lib/ssi-modal/ssi-modal.js`,{async:""}).then(()=>{n(window.ssi_modal)})),e.then(r=>{this.hackSsiModal(r),this.ctx.set("modal",r),this.modal=r})}get logger(){return this.ctx.logger("SSI_MODAL")}stop(){this.modal?.closeAll()}hackSsiModal(e){const n=this,r=e.proto.init;e.proto.init=function(){var o;return n.logger.log("init",this),(o=this.options).className||(o.className=""),this.options.className+=" in-page-edit theme-ipe",r.call(this)};const i=e.proto.show;e.proto.show=function(){return n.ctx.emit("modal/show",{modal:this}),i.call(this)};const s=e.proto.close;return e.proto.close=function(){return n.ctx.emit("modal/close",{modal:this}),s.call(this)},e.proto.setLoadingState=function(o){if(this.get$window().toggleClass("loading",o),o){const a=this.get$window().find("input:not([disabled]),button:not([disabled])");this.get$modal().data("inputsAndButtons",a),a.prop("disabled",!0),this.get$window().append(O("div",{id:"ssi-modalLoadingWrapper",style:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",justifyContent:"center",alignItems:"center",backgroundColor:"rgba(255, 255, 255, 0.5)",zIndex:2e3},children:O(Zt,{style:{width:"80%",maxWidth:"800px"}})}))}else{this.get$window().find("#ssi-modalLoadingWrapper").remove();const a=this.get$modal().data("inputsAndButtons");a&&a.prop("disabled",!1)}},e}};Oo.inject=["resourceLoader"];let as=Oo;var Lr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function md(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function jr(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var ls={exports:{}};/*!
22
48
  localForage -- Offline Storage, Improved
23
49
  Version 1.10.0
24
50
  https://localforage.github.io/localForage
25
51
  (c) 2013-2017 Mozilla, Apache License 2.0
26
- */var pa;function Sd(){return pa||(pa=1,function(t,e){(function(n){t.exports=n()})(function(){return function n(r,i,s){function o(u,c){if(!i[u]){if(!r[u]){var f=typeof Nr=="function"&&Nr;if(!c&&f)return f(u,!0);if(a)return a(u,!0);var w=new Error("Cannot find module '"+u+"'");throw w.code="MODULE_NOT_FOUND",w}var y=i[u]={exports:{}};r[u][0].call(y.exports,function(v){var I=r[u][1][v];return o(I||v)},y,y.exports,n,r,i,s)}return i[u].exports}for(var a=typeof Nr=="function"&&Nr,l=0;l<s.length;l++)o(s[l]);return o}({1:[function(n,r,i){(function(s){var o=s.MutationObserver||s.WebKitMutationObserver,a;if(o){var l=0,u=new o(v),c=s.document.createTextNode("");u.observe(c,{characterData:!0}),a=function(){c.data=l=++l%2}}else if(!s.setImmediate&&typeof s.MessageChannel<"u"){var f=new s.MessageChannel;f.port1.onmessage=v,a=function(){f.port2.postMessage(0)}}else"document"in s&&"onreadystatechange"in s.document.createElement("script")?a=function(){var z=s.document.createElement("script");z.onreadystatechange=function(){v(),z.onreadystatechange=null,z.parentNode.removeChild(z),z=null},s.document.documentElement.appendChild(z)}:a=function(){setTimeout(v,0)};var w,y=[];function v(){w=!0;for(var z,F,A=y.length;A;){for(F=y,y=[],z=-1;++z<A;)F[z]();A=y.length}w=!1}r.exports=I;function I(z){y.push(z)===1&&!w&&a()}}).call(this,typeof Dr<"u"?Dr:typeof self<"u"?self:typeof window<"u"?window:{})},{}],2:[function(n,r,i){var s=n(1);function o(){}var a={},l=["REJECTED"],u=["FULFILLED"],c=["PENDING"];r.exports=f;function f(h){if(typeof h!="function")throw new TypeError("resolver must be a function");this.state=c,this.queue=[],this.outcome=void 0,h!==o&&I(this,h)}f.prototype.catch=function(h){return this.then(null,h)},f.prototype.then=function(h,O){if(typeof h!="function"&&this.state===u||typeof O!="function"&&this.state===l)return this;var P=new this.constructor(o);if(this.state!==c){var R=this.state===u?h:O;y(P,R,this.outcome)}else this.queue.push(new w(P,h,O));return P};function w(h,O,P){this.promise=h,typeof O=="function"&&(this.onFulfilled=O,this.callFulfilled=this.otherCallFulfilled),typeof P=="function"&&(this.onRejected=P,this.callRejected=this.otherCallRejected)}w.prototype.callFulfilled=function(h){a.resolve(this.promise,h)},w.prototype.otherCallFulfilled=function(h){y(this.promise,this.onFulfilled,h)},w.prototype.callRejected=function(h){a.reject(this.promise,h)},w.prototype.otherCallRejected=function(h){y(this.promise,this.onRejected,h)};function y(h,O,P){s(function(){var R;try{R=O(P)}catch(V){return a.reject(h,V)}R===h?a.reject(h,new TypeError("Cannot resolve promise with itself")):a.resolve(h,R)})}a.resolve=function(h,O){var P=z(v,O);if(P.status==="error")return a.reject(h,P.value);var R=P.value;if(R)I(h,R);else{h.state=u,h.outcome=O;for(var V=-1,Z=h.queue.length;++V<Z;)h.queue[V].callFulfilled(O)}return h},a.reject=function(h,O){h.state=l,h.outcome=O;for(var P=-1,R=h.queue.length;++P<R;)h.queue[P].callRejected(O);return h};function v(h){var O=h&&h.then;if(h&&(typeof h=="object"||typeof h=="function")&&typeof O=="function")return function(){O.apply(h,arguments)}}function I(h,O){var P=!1;function R(je){P||(P=!0,a.reject(h,je))}function V(je){P||(P=!0,a.resolve(h,je))}function Z(){O(V,R)}var $e=z(Z);$e.status==="error"&&R($e.value)}function z(h,O){var P={};try{P.value=h(O),P.status="success"}catch(R){P.status="error",P.value=R}return P}f.resolve=F;function F(h){return h instanceof this?h:a.resolve(new this(o),h)}f.reject=A;function A(h){var O=new this(o);return a.reject(O,h)}f.all=g;function g(h){var O=this;if(Object.prototype.toString.call(h)!=="[object Array]")return this.reject(new TypeError("must be an array"));var P=h.length,R=!1;if(!P)return this.resolve([]);for(var V=new Array(P),Z=0,$e=-1,je=new this(o);++$e<P;)Qe(h[$e],$e);return je;function Qe(Dt,cn){O.resolve(Dt).then(Te,function(me){R||(R=!0,a.reject(je,me))});function Te(me){V[cn]=me,++Z===P&&!R&&(R=!0,a.resolve(je,V))}}}f.race=m;function m(h){var O=this;if(Object.prototype.toString.call(h)!=="[object Array]")return this.reject(new TypeError("must be an array"));var P=h.length,R=!1;if(!P)return this.resolve([]);for(var V=-1,Z=new this(o);++V<P;)$e(h[V]);return Z;function $e(je){O.resolve(je).then(function(Qe){R||(R=!0,a.resolve(Z,Qe))},function(Qe){R||(R=!0,a.reject(Z,Qe))})}}},{1:1}],3:[function(n,r,i){(function(s){typeof s.Promise!="function"&&(s.Promise=n(2))}).call(this,typeof Dr<"u"?Dr:typeof self<"u"?self:typeof window<"u"?window:{})},{2:2}],4:[function(n,r,i){var s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(d){return typeof d}:function(d){return d&&typeof Symbol=="function"&&d.constructor===Symbol&&d!==Symbol.prototype?"symbol":typeof d};function o(d,_){if(!(d instanceof _))throw new TypeError("Cannot call a class as a function")}function a(){try{if(typeof indexedDB<"u")return indexedDB;if(typeof webkitIndexedDB<"u")return webkitIndexedDB;if(typeof mozIndexedDB<"u")return mozIndexedDB;if(typeof OIndexedDB<"u")return OIndexedDB;if(typeof msIndexedDB<"u")return msIndexedDB}catch{return}}var l=a();function u(){try{if(!l||!l.open)return!1;var d=typeof openDatabase<"u"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),_=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!d||_)&&typeof indexedDB<"u"&&typeof IDBKeyRange<"u"}catch{return!1}}function c(d,_){d=d||[],_=_||{};try{return new Blob(d,_)}catch(x){if(x.name!=="TypeError")throw x;for(var p=typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder,E=new p,k=0;k<d.length;k+=1)E.append(d[k]);return E.getBlob(_.type)}}typeof Promise>"u"&&n(3);var f=Promise;function w(d,_){_&&d.then(function(p){_(null,p)},function(p){_(p)})}function y(d,_,p){typeof _=="function"&&d.then(_),typeof p=="function"&&d.catch(p)}function v(d){return typeof d!="string"&&(console.warn(d+" used as a key, but it is not a string."),d=String(d)),d}function I(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var z="local-forage-detect-blob-support",F=void 0,A={},g=Object.prototype.toString,m="readonly",h="readwrite";function O(d){for(var _=d.length,p=new ArrayBuffer(_),E=new Uint8Array(p),k=0;k<_;k++)E[k]=d.charCodeAt(k);return p}function P(d){return new f(function(_){var p=d.transaction(z,h),E=c([""]);p.objectStore(z).put(E,"key"),p.onabort=function(k){k.preventDefault(),k.stopPropagation(),_(!1)},p.oncomplete=function(){var k=navigator.userAgent.match(/Chrome\/(\d+)/),x=navigator.userAgent.match(/Edge\//);_(x||!k||parseInt(k[1],10)>=43)}}).catch(function(){return!1})}function R(d){return typeof F=="boolean"?f.resolve(F):P(d).then(function(_){return F=_,F})}function V(d){var _=A[d.name],p={};p.promise=new f(function(E,k){p.resolve=E,p.reject=k}),_.deferredOperations.push(p),_.dbReady?_.dbReady=_.dbReady.then(function(){return p.promise}):_.dbReady=p.promise}function Z(d){var _=A[d.name],p=_.deferredOperations.pop();if(p)return p.resolve(),p.promise}function $e(d,_){var p=A[d.name],E=p.deferredOperations.pop();if(E)return E.reject(_),E.promise}function je(d,_){return new f(function(p,E){if(A[d.name]=A[d.name]||nt(),d.db)if(_)V(d),d.db.close();else return p(d.db);var k=[d.name];_&&k.push(d.version);var x=l.open.apply(l,k);_&&(x.onupgradeneeded=function(D){var M=x.result;try{M.createObjectStore(d.storeName),D.oldVersion<=1&&M.createObjectStore(z)}catch(U){if(U.name==="ConstraintError")console.warn('The database "'+d.name+'" has been upgraded from version '+D.oldVersion+" to version "+D.newVersion+', but the storage "'+d.storeName+'" already exists.');else throw U}}),x.onerror=function(D){D.preventDefault(),E(x.error)},x.onsuccess=function(){var D=x.result;D.onversionchange=function(M){M.target.close()},p(D),Z(d)}})}function Qe(d){return je(d,!1)}function Dt(d){return je(d,!0)}function cn(d,_){if(!d.db)return!0;var p=!d.db.objectStoreNames.contains(d.storeName),E=d.version<d.db.version,k=d.version>d.db.version;if(E&&(d.version!==_&&console.warn('The database "'+d.name+`" can't be downgraded from version `+d.db.version+" to version "+d.version+"."),d.version=d.db.version),k||p){if(p){var x=d.db.version+1;x>d.version&&(d.version=x)}return!0}return!1}function Te(d){return new f(function(_,p){var E=new FileReader;E.onerror=p,E.onloadend=function(k){var x=btoa(k.target.result||"");_({__local_forage_encoded_blob:!0,data:x,type:d.type})},E.readAsBinaryString(d)})}function me(d){var _=O(atob(d.data));return c([_],{type:d.type})}function be(d){return d&&d.__local_forage_encoded_blob}function Nt(d){var _=this,p=_._initReady().then(function(){var E=A[_._dbInfo.name];if(E&&E.dbReady)return E.dbReady});return y(p,d,d),p}function jn(d){V(d);for(var _=A[d.name],p=_.forages,E=0;E<p.length;E++){var k=p[E];k._dbInfo.db&&(k._dbInfo.db.close(),k._dbInfo.db=null)}return d.db=null,Qe(d).then(function(x){return d.db=x,cn(d)?Dt(d):x}).then(function(x){d.db=_.db=x;for(var D=0;D<p.length;D++)p[D]._dbInfo.db=x}).catch(function(x){throw $e(d,x),x})}function Le(d,_,p,E){E===void 0&&(E=1);try{var k=d.db.transaction(d.storeName,_);p(null,k)}catch(x){if(E>0&&(!d.db||x.name==="InvalidStateError"||x.name==="NotFoundError"))return f.resolve().then(function(){if(!d.db||x.name==="NotFoundError"&&!d.db.objectStoreNames.contains(d.storeName)&&d.version<=d.db.version)return d.db&&(d.version=d.db.version+1),Dt(d)}).then(function(){return jn(d).then(function(){Le(d,_,p,E-1)})}).catch(p);p(x)}}function nt(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function Ni(d){var _=this,p={db:null};if(d)for(var E in d)p[E]=d[E];var k=A[p.name];k||(k=nt(),A[p.name]=k),k.forages.push(_),_._initReady||(_._initReady=_.ready,_.ready=Nt);var x=[];function D(){return f.resolve()}for(var M=0;M<k.forages.length;M++){var U=k.forages[M];U!==_&&x.push(U._initReady().catch(D))}var H=k.forages.slice(0);return f.all(x).then(function(){return p.db=k.db,Qe(p)}).then(function(q){return p.db=q,cn(p,_._defaultConfig.version)?Dt(p):q}).then(function(q){p.db=k.db=q,_._dbInfo=p;for(var Q=0;Q<H.length;Q++){var ae=H[Q];ae!==_&&(ae._dbInfo.db=p.db,ae._dbInfo.version=p.version)}})}function $o(d,_){var p=this;d=v(d);var E=new f(function(k,x){p.ready().then(function(){Le(p._dbInfo,m,function(D,M){if(D)return x(D);try{var U=M.objectStore(p._dbInfo.storeName),H=U.get(d);H.onsuccess=function(){var q=H.result;q===void 0&&(q=null),be(q)&&(q=me(q)),k(q)},H.onerror=function(){x(H.error)}}catch(q){x(q)}})}).catch(x)});return w(E,_),E}function Ao(d,_){var p=this,E=new f(function(k,x){p.ready().then(function(){Le(p._dbInfo,m,function(D,M){if(D)return x(D);try{var U=M.objectStore(p._dbInfo.storeName),H=U.openCursor(),q=1;H.onsuccess=function(){var Q=H.result;if(Q){var ae=Q.value;be(ae)&&(ae=me(ae));var ge=d(ae,Q.key,q++);ge!==void 0?k(ge):Q.continue()}else k()},H.onerror=function(){x(H.error)}}catch(Q){x(Q)}})}).catch(x)});return w(E,_),E}function un(d,_,p){var E=this;d=v(d);var k=new f(function(x,D){var M;E.ready().then(function(){return M=E._dbInfo,g.call(_)==="[object Blob]"?R(M.db).then(function(U){return U?_:Te(_)}):_}).then(function(U){Le(E._dbInfo,h,function(H,q){if(H)return D(H);try{var Q=q.objectStore(E._dbInfo.storeName);U===null&&(U=void 0);var ae=Q.put(U,d);q.oncomplete=function(){U===void 0&&(U=null),x(U)},q.onabort=q.onerror=function(){var ge=ae.error?ae.error:ae.transaction.error;D(ge)}}catch(ge){D(ge)}})}).catch(D)});return w(k,p),k}function Ln(d,_){var p=this;d=v(d);var E=new f(function(k,x){p.ready().then(function(){Le(p._dbInfo,h,function(D,M){if(D)return x(D);try{var U=M.objectStore(p._dbInfo.storeName),H=U.delete(d);M.oncomplete=function(){k()},M.onerror=function(){x(H.error)},M.onabort=function(){var q=H.error?H.error:H.transaction.error;x(q)}}catch(q){x(q)}})}).catch(x)});return w(E,_),E}function vr(d){var _=this,p=new f(function(E,k){_.ready().then(function(){Le(_._dbInfo,h,function(x,D){if(x)return k(x);try{var M=D.objectStore(_._dbInfo.storeName),U=M.clear();D.oncomplete=function(){E()},D.onabort=D.onerror=function(){var H=U.error?U.error:U.transaction.error;k(H)}}catch(H){k(H)}})}).catch(k)});return w(p,d),p}function ji(d){var _=this,p=new f(function(E,k){_.ready().then(function(){Le(_._dbInfo,m,function(x,D){if(x)return k(x);try{var M=D.objectStore(_._dbInfo.storeName),U=M.count();U.onsuccess=function(){E(U.result)},U.onerror=function(){k(U.error)}}catch(H){k(H)}})}).catch(k)});return w(p,d),p}function fn(d,_){var p=this,E=new f(function(k,x){if(d<0){k(null);return}p.ready().then(function(){Le(p._dbInfo,m,function(D,M){if(D)return x(D);try{var U=M.objectStore(p._dbInfo.storeName),H=!1,q=U.openKeyCursor();q.onsuccess=function(){var Q=q.result;if(!Q){k(null);return}d===0||H?k(Q.key):(H=!0,Q.advance(d))},q.onerror=function(){x(q.error)}}catch(Q){x(Q)}})}).catch(x)});return w(E,_),E}function Wu(d){var _=this,p=new f(function(E,k){_.ready().then(function(){Le(_._dbInfo,m,function(x,D){if(x)return k(x);try{var M=D.objectStore(_._dbInfo.storeName),U=M.openKeyCursor(),H=[];U.onsuccess=function(){var q=U.result;if(!q){E(H);return}H.push(q.key),q.continue()},U.onerror=function(){k(U.error)}}catch(q){k(q)}})}).catch(k)});return w(p,d),p}function b(d,_){_=I.apply(this,arguments);var p=this.config();d=typeof d!="function"&&d||{},d.name||(d.name=d.name||p.name,d.storeName=d.storeName||p.storeName);var E=this,k;if(!d.name)k=f.reject("Invalid arguments");else{var x=d.name===p.name&&E._dbInfo.db,D=x?f.resolve(E._dbInfo.db):Qe(d).then(function(M){var U=A[d.name],H=U.forages;U.db=M;for(var q=0;q<H.length;q++)H[q]._dbInfo.db=M;return M});d.storeName?k=D.then(function(M){if(M.objectStoreNames.contains(d.storeName)){var U=M.version+1;V(d);var H=A[d.name],q=H.forages;M.close();for(var Q=0;Q<q.length;Q++){var ae=q[Q];ae._dbInfo.db=null,ae._dbInfo.version=U}var ge=new f(function(_e,Ae){var ke=l.open(d.name,U);ke.onerror=function(ft){var xr=ke.result;xr.close(),Ae(ft)},ke.onupgradeneeded=function(){var ft=ke.result;ft.deleteObjectStore(d.storeName)},ke.onsuccess=function(){var ft=ke.result;ft.close(),_e(ft)}});return ge.then(function(_e){H.db=_e;for(var Ae=0;Ae<q.length;Ae++){var ke=q[Ae];ke._dbInfo.db=_e,Z(ke._dbInfo)}}).catch(function(_e){throw($e(d,_e)||f.resolve()).catch(function(){}),_e})}}):k=D.then(function(M){V(d);var U=A[d.name],H=U.forages;M.close();for(var q=0;q<H.length;q++){var Q=H[q];Q._dbInfo.db=null}var ae=new f(function(ge,_e){var Ae=l.deleteDatabase(d.name);Ae.onerror=function(){var ke=Ae.result;ke&&ke.close(),_e(Ae.error)},Ae.onblocked=function(){console.warn('dropInstance blocked for database "'+d.name+'" until all open connections are closed')},Ae.onsuccess=function(){var ke=Ae.result;ke&&ke.close(),ge(ke)}});return ae.then(function(ge){U.db=ge;for(var _e=0;_e<H.length;_e++){var Ae=H[_e];Z(Ae._dbInfo)}}).catch(function(ge){throw($e(d,ge)||f.resolve()).catch(function(){}),ge})})}return w(k,_),k}var S={_driver:"asyncStorage",_initStorage:Ni,_support:u(),iterate:Ao,getItem:$o,setItem:un,removeItem:Ln,clear:vr,length:ji,key:fn,keys:Wu,dropInstance:b};function T(){return typeof openDatabase=="function"}var N="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",j="~~local_forage_type~",L=/^~~local_forage_type~([^~]+)~/,G="__lfsc__:",K=G.length,W="arbf",B="blob",ee="si08",J="ui08",X="uic8",re="si16",le="si32",ve="ur16",he="ui32",Me="fl32",Fe="fl64",rt=K+W.length,it=Object.prototype.toString;function Yt(d){var _=d.length*.75,p=d.length,E,k=0,x,D,M,U;d[d.length-1]==="="&&(_--,d[d.length-2]==="="&&_--);var H=new ArrayBuffer(_),q=new Uint8Array(H);for(E=0;E<p;E+=4)x=N.indexOf(d[E]),D=N.indexOf(d[E+1]),M=N.indexOf(d[E+2]),U=N.indexOf(d[E+3]),q[k++]=x<<2|D>>4,q[k++]=(D&15)<<4|M>>2,q[k++]=(M&3)<<6|U&63;return H}function Mn(d){var _=new Uint8Array(d),p="",E;for(E=0;E<_.length;E+=3)p+=N[_[E]>>2],p+=N[(_[E]&3)<<4|_[E+1]>>4],p+=N[(_[E+1]&15)<<2|_[E+2]>>6],p+=N[_[E+2]&63];return _.length%3===2?p=p.substring(0,p.length-1)+"=":_.length%3===1&&(p=p.substring(0,p.length-2)+"=="),p}function ze(d,_){var p="";if(d&&(p=it.call(d)),d&&(p==="[object ArrayBuffer]"||d.buffer&&it.call(d.buffer)==="[object ArrayBuffer]")){var E,k=G;d instanceof ArrayBuffer?(E=d,k+=W):(E=d.buffer,p==="[object Int8Array]"?k+=ee:p==="[object Uint8Array]"?k+=J:p==="[object Uint8ClampedArray]"?k+=X:p==="[object Int16Array]"?k+=re:p==="[object Uint16Array]"?k+=ve:p==="[object Int32Array]"?k+=le:p==="[object Uint32Array]"?k+=he:p==="[object Float32Array]"?k+=Me:p==="[object Float64Array]"?k+=Fe:_(new Error("Failed to get type for BinaryArray"))),_(k+Mn(E))}else if(p==="[object Blob]"){var x=new FileReader;x.onload=function(){var D=j+d.type+"~"+Mn(this.result);_(G+B+D)},x.readAsArrayBuffer(d)}else try{_(JSON.stringify(d))}catch(D){console.error("Couldn't convert value into a JSON string: ",d),_(null,D)}}function ut(d){if(d.substring(0,K)!==G)return JSON.parse(d);var _=d.substring(rt),p=d.substring(K,rt),E;if(p===B&&L.test(_)){var k=_.match(L);E=k[1],_=_.substring(k[0].length)}var x=Yt(_);switch(p){case W:return x;case B:return c([x],{type:E});case ee:return new Int8Array(x);case J:return new Uint8Array(x);case X:return new Uint8ClampedArray(x);case re:return new Int16Array(x);case ve:return new Uint16Array(x);case le:return new Int32Array(x);case he:return new Uint32Array(x);case Me:return new Float32Array(x);case Fe:return new Float64Array(x);default:throw new Error("Unkown type: "+p)}}var Fn={serialize:ze,deserialize:ut,stringToBuffer:Yt,bufferToString:Mn};function _r(d,_,p,E){d.executeSql("CREATE TABLE IF NOT EXISTS "+_.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],p,E)}function Uy(d){var _=this,p={db:null};if(d)for(var E in d)p[E]=typeof d[E]!="string"?d[E].toString():d[E];var k=new f(function(x,D){try{p.db=openDatabase(p.name,String(p.version),p.description,p.size)}catch(M){return D(M)}p.db.transaction(function(M){_r(M,p,function(){_._dbInfo=p,x()},function(U,H){D(H)})},D)});return p.serializer=Fn,k}function Gt(d,_,p,E,k,x){d.executeSql(p,E,k,function(D,M){M.code===M.SYNTAX_ERR?D.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[_.storeName],function(U,H){H.rows.length?x(U,M):_r(U,_,function(){U.executeSql(p,E,k,x)},x)},x):x(D,M)},x)}function Hy(d,_){var p=this;d=v(d);var E=new f(function(k,x){p.ready().then(function(){var D=p._dbInfo;D.db.transaction(function(M){Gt(M,D,"SELECT * FROM "+D.storeName+" WHERE key = ? LIMIT 1",[d],function(U,H){var q=H.rows.length?H.rows.item(0).value:null;q&&(q=D.serializer.deserialize(q)),k(q)},function(U,H){x(H)})})}).catch(x)});return w(E,_),E}function Wy(d,_){var p=this,E=new f(function(k,x){p.ready().then(function(){var D=p._dbInfo;D.db.transaction(function(M){Gt(M,D,"SELECT * FROM "+D.storeName,[],function(U,H){for(var q=H.rows,Q=q.length,ae=0;ae<Q;ae++){var ge=q.item(ae),_e=ge.value;if(_e&&(_e=D.serializer.deserialize(_e)),_e=d(_e,ge.key,ae+1),_e!==void 0){k(_e);return}}k()},function(U,H){x(H)})})}).catch(x)});return w(E,_),E}function qu(d,_,p,E){var k=this;d=v(d);var x=new f(function(D,M){k.ready().then(function(){_===void 0&&(_=null);var U=_,H=k._dbInfo;H.serializer.serialize(_,function(q,Q){Q?M(Q):H.db.transaction(function(ae){Gt(ae,H,"INSERT OR REPLACE INTO "+H.storeName+" (key, value) VALUES (?, ?)",[d,q],function(){D(U)},function(ge,_e){M(_e)})},function(ae){if(ae.code===ae.QUOTA_ERR){if(E>0){D(qu.apply(k,[d,U,p,E-1]));return}M(ae)}})})}).catch(M)});return w(x,p),x}function qy(d,_,p){return qu.apply(this,[d,_,p,1])}function zy(d,_){var p=this;d=v(d);var E=new f(function(k,x){p.ready().then(function(){var D=p._dbInfo;D.db.transaction(function(M){Gt(M,D,"DELETE FROM "+D.storeName+" WHERE key = ?",[d],function(){k()},function(U,H){x(H)})})}).catch(x)});return w(E,_),E}function Vy(d){var _=this,p=new f(function(E,k){_.ready().then(function(){var x=_._dbInfo;x.db.transaction(function(D){Gt(D,x,"DELETE FROM "+x.storeName,[],function(){E()},function(M,U){k(U)})})}).catch(k)});return w(p,d),p}function Ky(d){var _=this,p=new f(function(E,k){_.ready().then(function(){var x=_._dbInfo;x.db.transaction(function(D){Gt(D,x,"SELECT COUNT(key) as c FROM "+x.storeName,[],function(M,U){var H=U.rows.item(0).c;E(H)},function(M,U){k(U)})})}).catch(k)});return w(p,d),p}function Yy(d,_){var p=this,E=new f(function(k,x){p.ready().then(function(){var D=p._dbInfo;D.db.transaction(function(M){Gt(M,D,"SELECT key FROM "+D.storeName+" WHERE id = ? LIMIT 1",[d+1],function(U,H){var q=H.rows.length?H.rows.item(0).key:null;k(q)},function(U,H){x(H)})})}).catch(x)});return w(E,_),E}function Gy(d){var _=this,p=new f(function(E,k){_.ready().then(function(){var x=_._dbInfo;x.db.transaction(function(D){Gt(D,x,"SELECT key FROM "+x.storeName,[],function(M,U){for(var H=[],q=0;q<U.rows.length;q++)H.push(U.rows.item(q).key);E(H)},function(M,U){k(U)})})}).catch(k)});return w(p,d),p}function Jy(d){return new f(function(_,p){d.transaction(function(E){E.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(k,x){for(var D=[],M=0;M<x.rows.length;M++)D.push(x.rows.item(M).name);_({db:d,storeNames:D})},function(k,x){p(x)})},function(E){p(E)})})}function Qy(d,_){_=I.apply(this,arguments);var p=this.config();d=typeof d!="function"&&d||{},d.name||(d.name=d.name||p.name,d.storeName=d.storeName||p.storeName);var E=this,k;return d.name?k=new f(function(x){var D;d.name===p.name?D=E._dbInfo.db:D=openDatabase(d.name,"","",0),d.storeName?x({db:D,storeNames:[d.storeName]}):x(Jy(D))}).then(function(x){return new f(function(D,M){x.db.transaction(function(U){function H(ge){return new f(function(_e,Ae){U.executeSql("DROP TABLE IF EXISTS "+ge,[],function(){_e()},function(ke,ft){Ae(ft)})})}for(var q=[],Q=0,ae=x.storeNames.length;Q<ae;Q++)q.push(H(x.storeNames[Q]));f.all(q).then(function(){D()}).catch(function(ge){M(ge)})},function(U){M(U)})})}):k=f.reject("Invalid arguments"),w(k,_),k}var Xy={_driver:"webSQLStorage",_initStorage:Uy,_support:T(),iterate:Wy,getItem:Hy,setItem:qy,removeItem:zy,clear:Vy,length:Ky,key:Yy,keys:Gy,dropInstance:Qy};function Zy(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}function zu(d,_){var p=d.name+"/";return d.storeName!==_.storeName&&(p+=d.storeName+"/"),p}function eb(){var d="_localforage_support_test";try{return localStorage.setItem(d,!0),localStorage.removeItem(d),!1}catch{return!0}}function tb(){return!eb()||localStorage.length>0}function nb(d){var _=this,p={};if(d)for(var E in d)p[E]=d[E];return p.keyPrefix=zu(d,_._defaultConfig),tb()?(_._dbInfo=p,p.serializer=Fn,f.resolve()):f.reject()}function rb(d){var _=this,p=_.ready().then(function(){for(var E=_._dbInfo.keyPrefix,k=localStorage.length-1;k>=0;k--){var x=localStorage.key(k);x.indexOf(E)===0&&localStorage.removeItem(x)}});return w(p,d),p}function ib(d,_){var p=this;d=v(d);var E=p.ready().then(function(){var k=p._dbInfo,x=localStorage.getItem(k.keyPrefix+d);return x&&(x=k.serializer.deserialize(x)),x});return w(E,_),E}function sb(d,_){var p=this,E=p.ready().then(function(){for(var k=p._dbInfo,x=k.keyPrefix,D=x.length,M=localStorage.length,U=1,H=0;H<M;H++){var q=localStorage.key(H);if(q.indexOf(x)===0){var Q=localStorage.getItem(q);if(Q&&(Q=k.serializer.deserialize(Q)),Q=d(Q,q.substring(D),U++),Q!==void 0)return Q}}});return w(E,_),E}function ob(d,_){var p=this,E=p.ready().then(function(){var k=p._dbInfo,x;try{x=localStorage.key(d)}catch{x=null}return x&&(x=x.substring(k.keyPrefix.length)),x});return w(E,_),E}function ab(d){var _=this,p=_.ready().then(function(){for(var E=_._dbInfo,k=localStorage.length,x=[],D=0;D<k;D++){var M=localStorage.key(D);M.indexOf(E.keyPrefix)===0&&x.push(M.substring(E.keyPrefix.length))}return x});return w(p,d),p}function lb(d){var _=this,p=_.keys().then(function(E){return E.length});return w(p,d),p}function cb(d,_){var p=this;d=v(d);var E=p.ready().then(function(){var k=p._dbInfo;localStorage.removeItem(k.keyPrefix+d)});return w(E,_),E}function ub(d,_,p){var E=this;d=v(d);var k=E.ready().then(function(){_===void 0&&(_=null);var x=_;return new f(function(D,M){var U=E._dbInfo;U.serializer.serialize(_,function(H,q){if(q)M(q);else try{localStorage.setItem(U.keyPrefix+d,H),D(x)}catch(Q){(Q.name==="QuotaExceededError"||Q.name==="NS_ERROR_DOM_QUOTA_REACHED")&&M(Q),M(Q)}})})});return w(k,p),k}function fb(d,_){if(_=I.apply(this,arguments),d=typeof d!="function"&&d||{},!d.name){var p=this.config();d.name=d.name||p.name,d.storeName=d.storeName||p.storeName}var E=this,k;return d.name?k=new f(function(x){d.storeName?x(zu(d,E._defaultConfig)):x(d.name+"/")}).then(function(x){for(var D=localStorage.length-1;D>=0;D--){var M=localStorage.key(D);M.indexOf(x)===0&&localStorage.removeItem(M)}}):k=f.reject("Invalid arguments"),w(k,_),k}var db={_driver:"localStorageWrapper",_initStorage:nb,_support:Zy(),iterate:sb,getItem:ib,setItem:ub,removeItem:cb,clear:rb,length:lb,key:ob,keys:ab,dropInstance:fb},hb=function(_,p){return _===p||typeof _=="number"&&typeof p=="number"&&isNaN(_)&&isNaN(p)},pb=function(_,p){for(var E=_.length,k=0;k<E;){if(hb(_[k],p))return!0;k++}return!1},Vu=Array.isArray||function(d){return Object.prototype.toString.call(d)==="[object Array]"},wr={},Ku={},Bn={INDEXEDDB:S,WEBSQL:Xy,LOCALSTORAGE:db},mb=[Bn.INDEXEDDB._driver,Bn.WEBSQL._driver,Bn.LOCALSTORAGE._driver],Li=["dropInstance"],Io=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(Li),gb={description:"",driver:mb.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function yb(d,_){d[_]=function(){var p=arguments;return d.ready().then(function(){return d[_].apply(d,p)})}}function To(){for(var d=1;d<arguments.length;d++){var _=arguments[d];if(_)for(var p in _)_.hasOwnProperty(p)&&(Vu(_[p])?arguments[0][p]=_[p].slice():arguments[0][p]=_[p])}return arguments[0]}var bb=function(){function d(_){o(this,d);for(var p in Bn)if(Bn.hasOwnProperty(p)){var E=Bn[p],k=E._driver;this[p]=k,wr[k]||this.defineDriver(E)}this._defaultConfig=To({},gb),this._config=To({},this._defaultConfig,_),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return d.prototype.config=function(p){if((typeof p>"u"?"undefined":s(p))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var E in p){if(E==="storeName"&&(p[E]=p[E].replace(/\W/g,"_")),E==="version"&&typeof p[E]!="number")return new Error("Database version must be a number.");this._config[E]=p[E]}return"driver"in p&&p.driver?this.setDriver(this._config.driver):!0}else return typeof p=="string"?this._config[p]:this._config},d.prototype.defineDriver=function(p,E,k){var x=new f(function(D,M){try{var U=p._driver,H=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!p._driver){M(H);return}for(var q=Io.concat("_initStorage"),Q=0,ae=q.length;Q<ae;Q++){var ge=q[Q],_e=!pb(Li,ge);if((_e||p[ge])&&typeof p[ge]!="function"){M(H);return}}var Ae=function(){for(var xr=function(wb){return function(){var xb=new Error("Method "+wb+" is not implemented by the current driver"),Yu=f.reject(xb);return w(Yu,arguments[arguments.length-1]),Yu}},Ro=0,_b=Li.length;Ro<_b;Ro++){var Do=Li[Ro];p[Do]||(p[Do]=xr(Do))}};Ae();var ke=function(xr){wr[U]&&console.info("Redefining LocalForage driver: "+U),wr[U]=p,Ku[U]=xr,D()};"_support"in p?p._support&&typeof p._support=="function"?p._support().then(ke,M):ke(!!p._support):ke(!0)}catch(ft){M(ft)}});return y(x,E,k),x},d.prototype.driver=function(){return this._driver||null},d.prototype.getDriver=function(p,E,k){var x=wr[p]?f.resolve(wr[p]):f.reject(new Error("Driver not found."));return y(x,E,k),x},d.prototype.getSerializer=function(p){var E=f.resolve(Fn);return y(E,p),E},d.prototype.ready=function(p){var E=this,k=E._driverSet.then(function(){return E._ready===null&&(E._ready=E._initDriver()),E._ready});return y(k,p,p),k},d.prototype.setDriver=function(p,E,k){var x=this;Vu(p)||(p=[p]);var D=this._getSupportedDrivers(p);function M(){x._config.driver=x.driver()}function U(Q){return x._extend(Q),M(),x._ready=x._initStorage(x._config),x._ready}function H(Q){return function(){var ae=0;function ge(){for(;ae<Q.length;){var _e=Q[ae];return ae++,x._dbInfo=null,x._ready=null,x.getDriver(_e).then(U).catch(ge)}M();var Ae=new Error("No available storage method found.");return x._driverSet=f.reject(Ae),x._driverSet}return ge()}}var q=this._driverSet!==null?this._driverSet.catch(function(){return f.resolve()}):f.resolve();return this._driverSet=q.then(function(){var Q=D[0];return x._dbInfo=null,x._ready=null,x.getDriver(Q).then(function(ae){x._driver=ae._driver,M(),x._wrapLibraryMethodsWithReady(),x._initDriver=H(D)})}).catch(function(){M();var Q=new Error("No available storage method found.");return x._driverSet=f.reject(Q),x._driverSet}),y(this._driverSet,E,k),this._driverSet},d.prototype.supports=function(p){return!!Ku[p]},d.prototype._extend=function(p){To(this,p)},d.prototype._getSupportedDrivers=function(p){for(var E=[],k=0,x=p.length;k<x;k++){var D=p[k];this.supports(D)&&E.push(D)}return E},d.prototype._wrapLibraryMethodsWithReady=function(){for(var p=0,E=Io.length;p<E;p++)yb(this,Io[p])},d.prototype.createInstance=function(p){return new d(p)},d}(),vb=new bb;r.exports=vb},{3:3}]},{},[4])(4)})}(ls)),ls.exports}var Ed=Sd();const ma=xd(Ed);class Cd extends dn{constructor(e){super(e,"storage",!1),e.set("localforage",ma)}get StorageManager(){return jr}createDatabse(e,n,r){return new jr("InPageEdit",e,n,r)}}const Nn=class Nn{constructor(e,n,r=Nn.DEFAULT_TTL,i){this.dbName=e,this.storeName=n,this.ttl=r,this.version=i,this.db=Nn.createDatabase(e,n),this.keys=this.db.keys.bind(this.db)}static createDatabase(e,n){const r=`${e}:${n}`;if(this._cached_db_instances.has(r))return this._cached_db_instances.get(r);const i=ma.createInstance({name:e,storeName:n});return this._cached_db_instances.set(r,i),i}async get(e,n=this.ttl,r){const i=await this.loadFromDB(e),s=this.checkIfExpired(i,n);if(!i||s){if(typeof r=="function"){const o=await r();return this.set(e,o).then(()=>o)}return null}return i.value}async set(e,n){return n===null||typeof n>"u"?this.delete(e):this.db.setItem(e,{time:Date.now(),value:n,version:this.version})}async has(e,n=this.ttl){const r=await this.loadFromDB(e),i=this.checkIfExpired(r,n);return r!==null&&!i}async delete(e){return this.db.removeItem(e)}async iterate(e){return await this.db.iterate((n,r)=>{e(n.value,r)})}async loadFromDB(e){const n=await this.db.getItem(e);if(!n)return null;if(typeof n.time!="number"||typeof n.value>"u"){try{this.delete(e)}catch{}return null}if(typeof this.version=="number"&&n.version!==this.version){try{this.delete(e)}catch{}return null}return n}checkIfExpired(e,n=this.ttl){return e?Date.now()-e.time>n:!1}async clear(){return await this.db.clear(),this}};Nn.DEFAULT_TTL=1/0,Nn._cached_db_instances=new Map;let jr=Nn;var Od=Object.create,cs=Object.defineProperty,kd=Object.getOwnPropertyDescriptor,ga=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),ya=t=>{throw TypeError(t)},Pd=(t,e,n)=>e in t?cs(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,$d=(t,e)=>cs(t,"name",{value:e,configurable:!0}),Ad=t=>[,,,Od(t?.[ga("metadata")]??null)],Id=["class","method","getter","setter","accessor","field","value","get","set"],ba=t=>t!==void 0&&typeof t!="function"?ya("Function expected"):t,Td=(t,e,n,r,i)=>({kind:Id[t],name:e,metadata:r,addInitializer:s=>n._?ya("Already initialized"):i.push(ba(s||null))}),Rd=(t,e)=>Pd(e,ga("metadata"),t[3]),Dd=(t,e,n,r)=>{for(var i=0,s=t[e>>1],o=s&&s.length;i<o;i++)s[i].call(n);return r},Nd=(t,e,n,r,i,s)=>{var o,a,l,u=e&7,c=!1,f=0,w=t[f]||(t[f]=[]),y=u&&(i=i.prototype,u<5&&(u>3||!c)&&kd(i,n));$d(i,n);for(var v=r.length-1;v>=0;v--)l=Td(u,n,a={},t[3],w),o=(0,r[v])(i,l),a._=1,ba(o)&&(i=o);return Rd(t,i),y&&cs(i,n,y),c?u^4?s:y:i},va,us,_a;va=[Ve(["api","storage"])];class Lr extends(_a=dn){constructor(e){super(e,"sitemeta",!1),this.ctx=e,this._data=void 0,this.siteIdentity=void 0,this.CACHE_TTL=1e3*60*60*24,this.VERSION=2,this.db=void 0,this.queryData={meta:"siteinfo|userinfo",siprop:"general|specialpagealiases|namespacealiases|namespaces|magicwords",uiprop:"groups|rights|blockinfo|options"},this.db=e.storage.createDatabse("sitemeta",this.CACHE_TTL,this.VERSION)}get api(){return this.ctx.api}get mwConfig(){return mw.config.values}async start(){const e=await this.fetchFromCache();if(e){this.ctx.logger("SiteMetadataService").info("Using cached metadata"),this._data=e;return}const n=await this.fetchFromApi();this.saveToCache(n),this._data=n}async computeSiteIdentity(){if(this.siteIdentity)return this.siteIdentity;let e;if(!window.mw?.config)e=new URL(location.href).origin;else{const{wgServer:n,wgArticlePath:r}=window.mw.config.get();e=`${n}${r}`}return this.siteIdentity=e,this.siteIdentity}async fetchFromApi(){return this.api.get({action:"query",...this.queryData}).then(({data:e})=>{if(typeof e?.query?.general>"u")throw new Error("Invalid siteinfo");return e.query}).catch(e=>(this.ctx.logger.error("[InPageEdit]","fetchMetadata error",e),Promise.reject(e)))}async fetchFromCache(){const e=await this.computeSiteIdentity();return this.db.get(e)}async saveToCache(e){const n=await this.computeSiteIdentity();return this.db.set(n,e)}get _raw(){return this._data}get siteInfo(){return this._data.general}get specialPageAliases(){return this._data.specialpagealiases}get namespaceAliases(){return this._data.namespacealiases}get namespaces(){return this._data.namespaces}get namespaceMap(){const e=Object.values(this.namespaces).map(n=>({id:n.id,canonical:n.canonical,aliases:this.namespaceAliases.filter(r=>r.id===n.id).map(r=>r.alias)})).sort((n,r)=>n.id-r.id);return Reflect.defineProperty(this,"namespaceMap",{value:e,writable:!1,configurable:!1,enumerable:!0}),e}get magicWords(){return this._data.magicwords}get userInfo(){return this._data.userinfo}get userOptions(){return this.userInfo.options}get isUserBlocked(){return this.userInfo.blockedbyid&&this.userInfo.blockexpiry&&new Date(this.userInfo.blockexpiry).getTime()>Date.now()}get userGroups(){return this.userInfo.groups}get userRights(){return this.userInfo.rights}hasRight(e){return this.userRights.includes(e)}hasAnyRight(...e){return e.some(n=>this.hasRight(n))}hasEveryRights(...e){return e.every(n=>this.hasRight(n))}inGroup(e){return this.userGroups.includes(e)}inAnyGroup(...e){return this.userGroups.some(n=>e.includes(n))}getBlockInfo(){return this.isUserBlocked?{blockid:this.userInfo.blockid,blockedby:this.userInfo.blockedbyid,blockedbyid:this.userInfo.blockedbyid,blockreason:this.userInfo.blockreason,blockedtimestamp:this.userInfo.blockedtimestamp,blockexpiry:this.userInfo.blockexpiry}:null}}us=Ad(_a),Lr=Nd(us,0,"SiteMetadataService",va,Lr),Dd(us,1,Lr);const Ri=class Ri{constructor(e,n){this.pageInfo={...Ri.DEFAULT_PAGE_INFO,...e},this.api=n||new la}async getPageInfo(e){const{data:{query:{pages:[n]}}}=await this.api.get({action:"query",prop:"info|templates|transcludedin|images|pageimages|revisions",inprop:"protection|url|varianttitles",intestactions:"edit|move|delete",tllimit:"max",tilimit:"max",imlimit:"max",piprop:"thumbnail|name|original",pithumbsize:"200",pilimit:"max",rvprop:"ids|timestamp|flags|comment|user|content",...e});return n.revisions?.forEach(r=>{if(typeof r.slots=="object"){const i=r.slots.main;i&&(r.content=i.content,r.contentmodel=i.contentmodel,r.contentformat=i.contentformat)}}),n}async parse(e){return this.api.post({action:"parse",page:this.pageInfo.title,prop:"text|langlinks|categories|links|templates|images|externallinks|sections|revid|displaytitle|iwlinks|properties|parsewarnings",...e})}async preview(e,n){return this.parse({action:"parse",page:void 0,title:this.title,text:e,pst:1,preview:1,disableeditsection:1,disablelimitreport:1,...n})}async edit(e,n){const{text:r,prependtext:i,appendtext:s,summary:o="",watchlist:a="preferences"}=e;return this.api.postWithEditToken({action:"edit",title:this.title,starttimestamp:this.pageInfo.touched,basetimestamp:this.revisions[0]?.timestamp,text:r,prependtext:i,appendtext:s,summary:o,watchlist:a,...n})}async createOnly(e,n){return this.edit(e,{createonly:1,...n})}async delete(e,n){return this.api.postWithEditToken({action:"delete",pageid:this.pageInfo.pageid,reason:e,...n})}async moveTo(e,n,r){return this.api.postWithEditToken({action:"move",from:this.pageInfo.title,to:e,reason:n,movetalk:1,movesubpages:1,...r})}userCan(e){return this.pageInfo?.actions?.[e]}userCanEdit(){return this.userCan("edit")}async refetch(){const e=await this.getPageInfo({pageids:this.pageInfo.pageid,titles:this.pageInfo.title}),n=(this.pageInfo.revisions||[]).concat(e.revisions||[]).sort((r,i)=>r.revid-i.revid).reduce((r,i)=>(r.find(s=>s.revid===i.revid)||r.push(i),r),[]);return this.pageInfo=e,this.pageInfo.revisions=n,this}get pageid(){return this.pageInfo.pageid}get title(){return this.pageInfo.title}get ns(){return this.pageInfo.ns}get contentmodel(){return this.pageInfo.contentmodel}get fullurl(){return this.pageInfo.fullurl}get canonicalurl(){return this.pageInfo.canonicalurl}get editurl(){return this.pageInfo.editurl}get revisions(){return this.pageInfo.revisions||[]}get templates(){return this.pageInfo.templates||[]}get images(){return this.pageInfo.images||[]}};Ri.DEFAULT_PAGE_INFO={pageid:0,ns:0,title:"",contentmodel:"wikitext",pagelanguage:"",pagelanguagehtmlcode:"",pagelanguagedir:"ltr",touched:new Date().toISOString(),lastrevid:0,length:0,protection:[],restrictiontypes:[],fullurl:"",canonicalurl:"",editurl:"",varianttitles:{},actions:{edit:!0,move:!1,delete:!1},revisions:[],templates:[],images:[]};let Vn=Ri;const Oo=class Oo extends dn{constructor(e){super(e,"wikiPage",!0),this.ctx=e}get WikiPage(){return Vn}async createInstance(e){const{data:{query:{pages:[n]}}}=await this.ctx.api.get({action:"query",prop:"info|templates|transcludedin|images|pageimages|revisions",inprop:"protection|url|varianttitles",intestactions:"edit|move|delete",tllimit:"max",tilimit:"max",imlimit:"max",piprop:"thumbnail|name|original",pithumbsize:"200",pilimit:"max",rvprop:"ids|timestamp|user|userid|content",...e});return new Vn(n,this.ctx.api)}async newFromTitle(e,n=!1,r){return this.createInstance({titles:e,converttitles:n,rvsection:r})}async newFromPageId(e,n){return this.createInstance({pageids:e,rvsection:n})}async newFromRevision(e,n){return this.createInstance({revids:e,rvsection:n})}newBlankPage(e={}){return new Vn(e,this.ctx.api)}};Oo.inject=["api"];let fs=Oo;/**
52
+ */var ua;function gd(){return ua||(ua=1,function(t,e){(function(n){t.exports=n()})(function(){return function n(r,i,s){function o(u,c){if(!i[u]){if(!r[u]){var f=typeof jr=="function"&&jr;if(!c&&f)return f(u,!0);if(a)return a(u,!0);var w=new Error("Cannot find module '"+u+"'");throw w.code="MODULE_NOT_FOUND",w}var y=i[u]={exports:{}};r[u][0].call(y.exports,function(v){var I=r[u][1][v];return o(I||v)},y,y.exports,n,r,i,s)}return i[u].exports}for(var a=typeof jr=="function"&&jr,l=0;l<s.length;l++)o(s[l]);return o}({1:[function(n,r,i){(function(s){var o=s.MutationObserver||s.WebKitMutationObserver,a;if(o){var l=0,u=new o(v),c=s.document.createTextNode("");u.observe(c,{characterData:!0}),a=function(){c.data=l=++l%2}}else if(!s.setImmediate&&typeof s.MessageChannel<"u"){var f=new s.MessageChannel;f.port1.onmessage=v,a=function(){f.port2.postMessage(0)}}else"document"in s&&"onreadystatechange"in s.document.createElement("script")?a=function(){var z=s.document.createElement("script");z.onreadystatechange=function(){v(),z.onreadystatechange=null,z.parentNode.removeChild(z),z=null},s.document.documentElement.appendChild(z)}:a=function(){setTimeout(v,0)};var w,y=[];function v(){w=!0;for(var z,F,A=y.length;A;){for(F=y,y=[],z=-1;++z<A;)F[z]();A=y.length}w=!1}r.exports=I;function I(z){y.push(z)===1&&!w&&a()}}).call(this,typeof Lr<"u"?Lr:typeof self<"u"?self:typeof window<"u"?window:{})},{}],2:[function(n,r,i){var s=n(1);function o(){}var a={},l=["REJECTED"],u=["FULFILLED"],c=["PENDING"];r.exports=f;function f(h){if(typeof h!="function")throw new TypeError("resolver must be a function");this.state=c,this.queue=[],this.outcome=void 0,h!==o&&I(this,h)}f.prototype.catch=function(h){return this.then(null,h)},f.prototype.then=function(h,P){if(typeof h!="function"&&this.state===u||typeof P!="function"&&this.state===l)return this;var k=new this.constructor(o);if(this.state!==c){var T=this.state===u?h:P;y(k,T,this.outcome)}else this.queue.push(new w(k,h,P));return k};function w(h,P,k){this.promise=h,typeof P=="function"&&(this.onFulfilled=P,this.callFulfilled=this.otherCallFulfilled),typeof k=="function"&&(this.onRejected=k,this.callRejected=this.otherCallRejected)}w.prototype.callFulfilled=function(h){a.resolve(this.promise,h)},w.prototype.otherCallFulfilled=function(h){y(this.promise,this.onFulfilled,h)},w.prototype.callRejected=function(h){a.reject(this.promise,h)},w.prototype.otherCallRejected=function(h){y(this.promise,this.onRejected,h)};function y(h,P,k){s(function(){var T;try{T=P(k)}catch(V){return a.reject(h,V)}T===h?a.reject(h,new TypeError("Cannot resolve promise with itself")):a.resolve(h,T)})}a.resolve=function(h,P){var k=z(v,P);if(k.status==="error")return a.reject(h,k.value);var T=k.value;if(T)I(h,T);else{h.state=u,h.outcome=P;for(var V=-1,Z=h.queue.length;++V<Z;)h.queue[V].callFulfilled(P)}return h},a.reject=function(h,P){h.state=l,h.outcome=P;for(var k=-1,T=h.queue.length;++k<T;)h.queue[k].callRejected(P);return h};function v(h){var P=h&&h.then;if(h&&(typeof h=="object"||typeof h=="function")&&typeof P=="function")return function(){P.apply(h,arguments)}}function I(h,P){var k=!1;function T(Le){k||(k=!0,a.reject(h,Le))}function V(Le){k||(k=!0,a.resolve(h,Le))}function Z(){P(V,T)}var $e=z(Z);$e.status==="error"&&T($e.value)}function z(h,P){var k={};try{k.value=h(P),k.status="success"}catch(T){k.status="error",k.value=T}return k}f.resolve=F;function F(h){return h instanceof this?h:a.resolve(new this(o),h)}f.reject=A;function A(h){var P=new this(o);return a.reject(P,h)}f.all=g;function g(h){var P=this;if(Object.prototype.toString.call(h)!=="[object Array]")return this.reject(new TypeError("must be an array"));var k=h.length,T=!1;if(!k)return this.resolve([]);for(var V=new Array(k),Z=0,$e=-1,Le=new this(o);++$e<k;)Qe(h[$e],$e);return Le;function Qe(Nt,cn){P.resolve(Nt).then(Re,function(me){T||(T=!0,a.reject(Le,me))});function Re(me){V[cn]=me,++Z===k&&!T&&(T=!0,a.resolve(Le,V))}}}f.race=m;function m(h){var P=this;if(Object.prototype.toString.call(h)!=="[object Array]")return this.reject(new TypeError("must be an array"));var k=h.length,T=!1;if(!k)return this.resolve([]);for(var V=-1,Z=new this(o);++V<k;)$e(h[V]);return Z;function $e(Le){P.resolve(Le).then(function(Qe){T||(T=!0,a.resolve(Z,Qe))},function(Qe){T||(T=!0,a.reject(Z,Qe))})}}},{1:1}],3:[function(n,r,i){(function(s){typeof s.Promise!="function"&&(s.Promise=n(2))}).call(this,typeof Lr<"u"?Lr:typeof self<"u"?self:typeof window<"u"?window:{})},{2:2}],4:[function(n,r,i){var s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(d){return typeof d}:function(d){return d&&typeof Symbol=="function"&&d.constructor===Symbol&&d!==Symbol.prototype?"symbol":typeof d};function o(d,_){if(!(d instanceof _))throw new TypeError("Cannot call a class as a function")}function a(){try{if(typeof indexedDB<"u")return indexedDB;if(typeof webkitIndexedDB<"u")return webkitIndexedDB;if(typeof mozIndexedDB<"u")return mozIndexedDB;if(typeof OIndexedDB<"u")return OIndexedDB;if(typeof msIndexedDB<"u")return msIndexedDB}catch{return}}var l=a();function u(){try{if(!l||!l.open)return!1;var d=typeof openDatabase<"u"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),_=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!d||_)&&typeof indexedDB<"u"&&typeof IDBKeyRange<"u"}catch{return!1}}function c(d,_){d=d||[],_=_||{};try{return new Blob(d,_)}catch(x){if(x.name!=="TypeError")throw x;for(var p=typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder,E=new p,C=0;C<d.length;C+=1)E.append(d[C]);return E.getBlob(_.type)}}typeof Promise>"u"&&n(3);var f=Promise;function w(d,_){_&&d.then(function(p){_(null,p)},function(p){_(p)})}function y(d,_,p){typeof _=="function"&&d.then(_),typeof p=="function"&&d.catch(p)}function v(d){return typeof d!="string"&&(console.warn(d+" used as a key, but it is not a string."),d=String(d)),d}function I(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var z="local-forage-detect-blob-support",F=void 0,A={},g=Object.prototype.toString,m="readonly",h="readwrite";function P(d){for(var _=d.length,p=new ArrayBuffer(_),E=new Uint8Array(p),C=0;C<_;C++)E[C]=d.charCodeAt(C);return p}function k(d){return new f(function(_){var p=d.transaction(z,h),E=c([""]);p.objectStore(z).put(E,"key"),p.onabort=function(C){C.preventDefault(),C.stopPropagation(),_(!1)},p.oncomplete=function(){var C=navigator.userAgent.match(/Chrome\/(\d+)/),x=navigator.userAgent.match(/Edge\//);_(x||!C||parseInt(C[1],10)>=43)}}).catch(function(){return!1})}function T(d){return typeof F=="boolean"?f.resolve(F):k(d).then(function(_){return F=_,F})}function V(d){var _=A[d.name],p={};p.promise=new f(function(E,C){p.resolve=E,p.reject=C}),_.deferredOperations.push(p),_.dbReady?_.dbReady=_.dbReady.then(function(){return p.promise}):_.dbReady=p.promise}function Z(d){var _=A[d.name],p=_.deferredOperations.pop();if(p)return p.resolve(),p.promise}function $e(d,_){var p=A[d.name],E=p.deferredOperations.pop();if(E)return E.reject(_),E.promise}function Le(d,_){return new f(function(p,E){if(A[d.name]=A[d.name]||nt(),d.db)if(_)V(d),d.db.close();else return p(d.db);var C=[d.name];_&&C.push(d.version);var x=l.open.apply(l,C);_&&(x.onupgradeneeded=function(D){var M=x.result;try{M.createObjectStore(d.storeName),D.oldVersion<=1&&M.createObjectStore(z)}catch(U){if(U.name==="ConstraintError")console.warn('The database "'+d.name+'" has been upgraded from version '+D.oldVersion+" to version "+D.newVersion+', but the storage "'+d.storeName+'" already exists.');else throw U}}),x.onerror=function(D){D.preventDefault(),E(x.error)},x.onsuccess=function(){var D=x.result;D.onversionchange=function(M){M.target.close()},p(D),Z(d)}})}function Qe(d){return Le(d,!1)}function Nt(d){return Le(d,!0)}function cn(d,_){if(!d.db)return!0;var p=!d.db.objectStoreNames.contains(d.storeName),E=d.version<d.db.version,C=d.version>d.db.version;if(E&&(d.version!==_&&console.warn('The database "'+d.name+`" can't be downgraded from version `+d.db.version+" to version "+d.version+"."),d.version=d.db.version),C||p){if(p){var x=d.db.version+1;x>d.version&&(d.version=x)}return!0}return!1}function Re(d){return new f(function(_,p){var E=new FileReader;E.onerror=p,E.onloadend=function(C){var x=btoa(C.target.result||"");_({__local_forage_encoded_blob:!0,data:x,type:d.type})},E.readAsBinaryString(d)})}function me(d){var _=P(atob(d.data));return c([_],{type:d.type})}function ve(d){return d&&d.__local_forage_encoded_blob}function Lt(d){var _=this,p=_._initReady().then(function(){var E=A[_._dbInfo.name];if(E&&E.dbReady)return E.dbReady});return y(p,d,d),p}function Ln(d){V(d);for(var _=A[d.name],p=_.forages,E=0;E<p.length;E++){var C=p[E];C._dbInfo.db&&(C._dbInfo.db.close(),C._dbInfo.db=null)}return d.db=null,Qe(d).then(function(x){return d.db=x,cn(d)?Nt(d):x}).then(function(x){d.db=_.db=x;for(var D=0;D<p.length;D++)p[D]._dbInfo.db=x}).catch(function(x){throw $e(d,x),x})}function je(d,_,p,E){E===void 0&&(E=1);try{var C=d.db.transaction(d.storeName,_);p(null,C)}catch(x){if(E>0&&(!d.db||x.name==="InvalidStateError"||x.name==="NotFoundError"))return f.resolve().then(function(){if(!d.db||x.name==="NotFoundError"&&!d.db.objectStoreNames.contains(d.storeName)&&d.version<=d.db.version)return d.db&&(d.version=d.db.version+1),Nt(d)}).then(function(){return Ln(d).then(function(){je(d,_,p,E-1)})}).catch(p);p(x)}}function nt(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function Li(d){var _=this,p={db:null};if(d)for(var E in d)p[E]=d[E];var C=A[p.name];C||(C=nt(),A[p.name]=C),C.forages.push(_),_._initReady||(_._initReady=_.ready,_.ready=Lt);var x=[];function D(){return f.resolve()}for(var M=0;M<C.forages.length;M++){var U=C.forages[M];U!==_&&x.push(U._initReady().catch(D))}var H=C.forages.slice(0);return f.all(x).then(function(){return p.db=C.db,Qe(p)}).then(function(q){return p.db=q,cn(p,_._defaultConfig.version)?Nt(p):q}).then(function(q){p.db=C.db=q,_._dbInfo=p;for(var Q=0;Q<H.length;Q++){var ae=H[Q];ae!==_&&(ae._dbInfo.db=p.db,ae._dbInfo.version=p.version)}})}function $o(d,_){var p=this;d=v(d);var E=new f(function(C,x){p.ready().then(function(){je(p._dbInfo,m,function(D,M){if(D)return x(D);try{var U=M.objectStore(p._dbInfo.storeName),H=U.get(d);H.onsuccess=function(){var q=H.result;q===void 0&&(q=null),ve(q)&&(q=me(q)),C(q)},H.onerror=function(){x(H.error)}}catch(q){x(q)}})}).catch(x)});return w(E,_),E}function Ao(d,_){var p=this,E=new f(function(C,x){p.ready().then(function(){je(p._dbInfo,m,function(D,M){if(D)return x(D);try{var U=M.objectStore(p._dbInfo.storeName),H=U.openCursor(),q=1;H.onsuccess=function(){var Q=H.result;if(Q){var ae=Q.value;ve(ae)&&(ae=me(ae));var ge=d(ae,Q.key,q++);ge!==void 0?C(ge):Q.continue()}else C()},H.onerror=function(){x(H.error)}}catch(Q){x(Q)}})}).catch(x)});return w(E,_),E}function un(d,_,p){var E=this;d=v(d);var C=new f(function(x,D){var M;E.ready().then(function(){return M=E._dbInfo,g.call(_)==="[object Blob]"?T(M.db).then(function(U){return U?_:Re(_)}):_}).then(function(U){je(E._dbInfo,h,function(H,q){if(H)return D(H);try{var Q=q.objectStore(E._dbInfo.storeName);U===null&&(U=void 0);var ae=Q.put(U,d);q.oncomplete=function(){U===void 0&&(U=null),x(U)},q.onabort=q.onerror=function(){var ge=ae.error?ae.error:ae.transaction.error;D(ge)}}catch(ge){D(ge)}})}).catch(D)});return w(C,p),C}function jn(d,_){var p=this;d=v(d);var E=new f(function(C,x){p.ready().then(function(){je(p._dbInfo,h,function(D,M){if(D)return x(D);try{var U=M.objectStore(p._dbInfo.storeName),H=U.delete(d);M.oncomplete=function(){C()},M.onerror=function(){x(H.error)},M.onabort=function(){var q=H.error?H.error:H.transaction.error;x(q)}}catch(q){x(q)}})}).catch(x)});return w(E,_),E}function _r(d){var _=this,p=new f(function(E,C){_.ready().then(function(){je(_._dbInfo,h,function(x,D){if(x)return C(x);try{var M=D.objectStore(_._dbInfo.storeName),U=M.clear();D.oncomplete=function(){E()},D.onabort=D.onerror=function(){var H=U.error?U.error:U.transaction.error;C(H)}}catch(H){C(H)}})}).catch(C)});return w(p,d),p}function ji(d){var _=this,p=new f(function(E,C){_.ready().then(function(){je(_._dbInfo,m,function(x,D){if(x)return C(x);try{var M=D.objectStore(_._dbInfo.storeName),U=M.count();U.onsuccess=function(){E(U.result)},U.onerror=function(){C(U.error)}}catch(H){C(H)}})}).catch(C)});return w(p,d),p}function fn(d,_){var p=this,E=new f(function(C,x){if(d<0){C(null);return}p.ready().then(function(){je(p._dbInfo,m,function(D,M){if(D)return x(D);try{var U=M.objectStore(p._dbInfo.storeName),H=!1,q=U.openKeyCursor();q.onsuccess=function(){var Q=q.result;if(!Q){C(null);return}d===0||H?C(Q.key):(H=!0,Q.advance(d))},q.onerror=function(){x(q.error)}}catch(Q){x(Q)}})}).catch(x)});return w(E,_),E}function Fu(d){var _=this,p=new f(function(E,C){_.ready().then(function(){je(_._dbInfo,m,function(x,D){if(x)return C(x);try{var M=D.objectStore(_._dbInfo.storeName),U=M.openKeyCursor(),H=[];U.onsuccess=function(){var q=U.result;if(!q){E(H);return}H.push(q.key),q.continue()},U.onerror=function(){C(U.error)}}catch(q){C(q)}})}).catch(C)});return w(p,d),p}function b(d,_){_=I.apply(this,arguments);var p=this.config();d=typeof d!="function"&&d||{},d.name||(d.name=d.name||p.name,d.storeName=d.storeName||p.storeName);var E=this,C;if(!d.name)C=f.reject("Invalid arguments");else{var x=d.name===p.name&&E._dbInfo.db,D=x?f.resolve(E._dbInfo.db):Qe(d).then(function(M){var U=A[d.name],H=U.forages;U.db=M;for(var q=0;q<H.length;q++)H[q]._dbInfo.db=M;return M});d.storeName?C=D.then(function(M){if(M.objectStoreNames.contains(d.storeName)){var U=M.version+1;V(d);var H=A[d.name],q=H.forages;M.close();for(var Q=0;Q<q.length;Q++){var ae=q[Q];ae._dbInfo.db=null,ae._dbInfo.version=U}var ge=new f(function(_e,Ae){var Ce=l.open(d.name,U);Ce.onerror=function(ft){var Sr=Ce.result;Sr.close(),Ae(ft)},Ce.onupgradeneeded=function(){var ft=Ce.result;ft.deleteObjectStore(d.storeName)},Ce.onsuccess=function(){var ft=Ce.result;ft.close(),_e(ft)}});return ge.then(function(_e){H.db=_e;for(var Ae=0;Ae<q.length;Ae++){var Ce=q[Ae];Ce._dbInfo.db=_e,Z(Ce._dbInfo)}}).catch(function(_e){throw($e(d,_e)||f.resolve()).catch(function(){}),_e})}}):C=D.then(function(M){V(d);var U=A[d.name],H=U.forages;M.close();for(var q=0;q<H.length;q++){var Q=H[q];Q._dbInfo.db=null}var ae=new f(function(ge,_e){var Ae=l.deleteDatabase(d.name);Ae.onerror=function(){var Ce=Ae.result;Ce&&Ce.close(),_e(Ae.error)},Ae.onblocked=function(){console.warn('dropInstance blocked for database "'+d.name+'" until all open connections are closed')},Ae.onsuccess=function(){var Ce=Ae.result;Ce&&Ce.close(),ge(Ce)}});return ae.then(function(ge){U.db=ge;for(var _e=0;_e<H.length;_e++){var Ae=H[_e];Z(Ae._dbInfo)}}).catch(function(ge){throw($e(d,ge)||f.resolve()).catch(function(){}),ge})})}return w(C,_),C}var S={_driver:"asyncStorage",_initStorage:Li,_support:u(),iterate:Ao,getItem:$o,setItem:un,removeItem:jn,clear:_r,length:ji,key:fn,keys:Fu,dropInstance:b};function R(){return typeof openDatabase=="function"}var N="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",L="~~local_forage_type~",j=/^~~local_forage_type~([^~]+)~/,Y="__lfsc__:",K=Y.length,W="arbf",B="blob",ee="si08",J="ui08",X="uic8",re="si16",ce="si32",be="ur16",he="ui32",Me="fl32",Fe="fl64",rt=K+W.length,it=Object.prototype.toString;function Gt(d){var _=d.length*.75,p=d.length,E,C=0,x,D,M,U;d[d.length-1]==="="&&(_--,d[d.length-2]==="="&&_--);var H=new ArrayBuffer(_),q=new Uint8Array(H);for(E=0;E<p;E+=4)x=N.indexOf(d[E]),D=N.indexOf(d[E+1]),M=N.indexOf(d[E+2]),U=N.indexOf(d[E+3]),q[C++]=x<<2|D>>4,q[C++]=(D&15)<<4|M>>2,q[C++]=(M&3)<<6|U&63;return H}function Mn(d){var _=new Uint8Array(d),p="",E;for(E=0;E<_.length;E+=3)p+=N[_[E]>>2],p+=N[(_[E]&3)<<4|_[E+1]>>4],p+=N[(_[E+1]&15)<<2|_[E+2]>>6],p+=N[_[E+2]&63];return _.length%3===2?p=p.substring(0,p.length-1)+"=":_.length%3===1&&(p=p.substring(0,p.length-2)+"=="),p}function ze(d,_){var p="";if(d&&(p=it.call(d)),d&&(p==="[object ArrayBuffer]"||d.buffer&&it.call(d.buffer)==="[object ArrayBuffer]")){var E,C=Y;d instanceof ArrayBuffer?(E=d,C+=W):(E=d.buffer,p==="[object Int8Array]"?C+=ee:p==="[object Uint8Array]"?C+=J:p==="[object Uint8ClampedArray]"?C+=X:p==="[object Int16Array]"?C+=re:p==="[object Uint16Array]"?C+=be:p==="[object Int32Array]"?C+=ce:p==="[object Uint32Array]"?C+=he:p==="[object Float32Array]"?C+=Me:p==="[object Float64Array]"?C+=Fe:_(new Error("Failed to get type for BinaryArray"))),_(C+Mn(E))}else if(p==="[object Blob]"){var x=new FileReader;x.onload=function(){var D=L+d.type+"~"+Mn(this.result);_(Y+B+D)},x.readAsArrayBuffer(d)}else try{_(JSON.stringify(d))}catch(D){console.error("Couldn't convert value into a JSON string: ",d),_(null,D)}}function ut(d){if(d.substring(0,K)!==Y)return JSON.parse(d);var _=d.substring(rt),p=d.substring(K,rt),E;if(p===B&&j.test(_)){var C=_.match(j);E=C[1],_=_.substring(C[0].length)}var x=Gt(_);switch(p){case W:return x;case B:return c([x],{type:E});case ee:return new Int8Array(x);case J:return new Uint8Array(x);case X:return new Uint8ClampedArray(x);case re:return new Int16Array(x);case be:return new Uint16Array(x);case ce:return new Int32Array(x);case he:return new Uint32Array(x);case Me:return new Float32Array(x);case Fe:return new Float64Array(x);default:throw new Error("Unkown type: "+p)}}var Fn={serialize:ze,deserialize:ut,stringToBuffer:Gt,bufferToString:Mn};function wr(d,_,p,E){d.executeSql("CREATE TABLE IF NOT EXISTS "+_.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],p,E)}function Dy(d){var _=this,p={db:null};if(d)for(var E in d)p[E]=typeof d[E]!="string"?d[E].toString():d[E];var C=new f(function(x,D){try{p.db=openDatabase(p.name,String(p.version),p.description,p.size)}catch(M){return D(M)}p.db.transaction(function(M){wr(M,p,function(){_._dbInfo=p,x()},function(U,H){D(H)})},D)});return p.serializer=Fn,C}function Yt(d,_,p,E,C,x){d.executeSql(p,E,C,function(D,M){M.code===M.SYNTAX_ERR?D.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[_.storeName],function(U,H){H.rows.length?x(U,M):wr(U,_,function(){U.executeSql(p,E,C,x)},x)},x):x(D,M)},x)}function Ny(d,_){var p=this;d=v(d);var E=new f(function(C,x){p.ready().then(function(){var D=p._dbInfo;D.db.transaction(function(M){Yt(M,D,"SELECT * FROM "+D.storeName+" WHERE key = ? LIMIT 1",[d],function(U,H){var q=H.rows.length?H.rows.item(0).value:null;q&&(q=D.serializer.deserialize(q)),C(q)},function(U,H){x(H)})})}).catch(x)});return w(E,_),E}function Ly(d,_){var p=this,E=new f(function(C,x){p.ready().then(function(){var D=p._dbInfo;D.db.transaction(function(M){Yt(M,D,"SELECT * FROM "+D.storeName,[],function(U,H){for(var q=H.rows,Q=q.length,ae=0;ae<Q;ae++){var ge=q.item(ae),_e=ge.value;if(_e&&(_e=D.serializer.deserialize(_e)),_e=d(_e,ge.key,ae+1),_e!==void 0){C(_e);return}}C()},function(U,H){x(H)})})}).catch(x)});return w(E,_),E}function Bu(d,_,p,E){var C=this;d=v(d);var x=new f(function(D,M){C.ready().then(function(){_===void 0&&(_=null);var U=_,H=C._dbInfo;H.serializer.serialize(_,function(q,Q){Q?M(Q):H.db.transaction(function(ae){Yt(ae,H,"INSERT OR REPLACE INTO "+H.storeName+" (key, value) VALUES (?, ?)",[d,q],function(){D(U)},function(ge,_e){M(_e)})},function(ae){if(ae.code===ae.QUOTA_ERR){if(E>0){D(Bu.apply(C,[d,U,p,E-1]));return}M(ae)}})})}).catch(M)});return w(x,p),x}function jy(d,_,p){return Bu.apply(this,[d,_,p,1])}function My(d,_){var p=this;d=v(d);var E=new f(function(C,x){p.ready().then(function(){var D=p._dbInfo;D.db.transaction(function(M){Yt(M,D,"DELETE FROM "+D.storeName+" WHERE key = ?",[d],function(){C()},function(U,H){x(H)})})}).catch(x)});return w(E,_),E}function Fy(d){var _=this,p=new f(function(E,C){_.ready().then(function(){var x=_._dbInfo;x.db.transaction(function(D){Yt(D,x,"DELETE FROM "+x.storeName,[],function(){E()},function(M,U){C(U)})})}).catch(C)});return w(p,d),p}function By(d){var _=this,p=new f(function(E,C){_.ready().then(function(){var x=_._dbInfo;x.db.transaction(function(D){Yt(D,x,"SELECT COUNT(key) as c FROM "+x.storeName,[],function(M,U){var H=U.rows.item(0).c;E(H)},function(M,U){C(U)})})}).catch(C)});return w(p,d),p}function Uy(d,_){var p=this,E=new f(function(C,x){p.ready().then(function(){var D=p._dbInfo;D.db.transaction(function(M){Yt(M,D,"SELECT key FROM "+D.storeName+" WHERE id = ? LIMIT 1",[d+1],function(U,H){var q=H.rows.length?H.rows.item(0).key:null;C(q)},function(U,H){x(H)})})}).catch(x)});return w(E,_),E}function Hy(d){var _=this,p=new f(function(E,C){_.ready().then(function(){var x=_._dbInfo;x.db.transaction(function(D){Yt(D,x,"SELECT key FROM "+x.storeName,[],function(M,U){for(var H=[],q=0;q<U.rows.length;q++)H.push(U.rows.item(q).key);E(H)},function(M,U){C(U)})})}).catch(C)});return w(p,d),p}function Wy(d){return new f(function(_,p){d.transaction(function(E){E.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(C,x){for(var D=[],M=0;M<x.rows.length;M++)D.push(x.rows.item(M).name);_({db:d,storeNames:D})},function(C,x){p(x)})},function(E){p(E)})})}function qy(d,_){_=I.apply(this,arguments);var p=this.config();d=typeof d!="function"&&d||{},d.name||(d.name=d.name||p.name,d.storeName=d.storeName||p.storeName);var E=this,C;return d.name?C=new f(function(x){var D;d.name===p.name?D=E._dbInfo.db:D=openDatabase(d.name,"","",0),d.storeName?x({db:D,storeNames:[d.storeName]}):x(Wy(D))}).then(function(x){return new f(function(D,M){x.db.transaction(function(U){function H(ge){return new f(function(_e,Ae){U.executeSql("DROP TABLE IF EXISTS "+ge,[],function(){_e()},function(Ce,ft){Ae(ft)})})}for(var q=[],Q=0,ae=x.storeNames.length;Q<ae;Q++)q.push(H(x.storeNames[Q]));f.all(q).then(function(){D()}).catch(function(ge){M(ge)})},function(U){M(U)})})}):C=f.reject("Invalid arguments"),w(C,_),C}var zy={_driver:"webSQLStorage",_initStorage:Dy,_support:R(),iterate:Ly,getItem:Ny,setItem:jy,removeItem:My,clear:Fy,length:By,key:Uy,keys:Hy,dropInstance:qy};function Vy(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}function Uu(d,_){var p=d.name+"/";return d.storeName!==_.storeName&&(p+=d.storeName+"/"),p}function Ky(){var d="_localforage_support_test";try{return localStorage.setItem(d,!0),localStorage.removeItem(d),!1}catch{return!0}}function Gy(){return!Ky()||localStorage.length>0}function Yy(d){var _=this,p={};if(d)for(var E in d)p[E]=d[E];return p.keyPrefix=Uu(d,_._defaultConfig),Gy()?(_._dbInfo=p,p.serializer=Fn,f.resolve()):f.reject()}function Jy(d){var _=this,p=_.ready().then(function(){for(var E=_._dbInfo.keyPrefix,C=localStorage.length-1;C>=0;C--){var x=localStorage.key(C);x.indexOf(E)===0&&localStorage.removeItem(x)}});return w(p,d),p}function Qy(d,_){var p=this;d=v(d);var E=p.ready().then(function(){var C=p._dbInfo,x=localStorage.getItem(C.keyPrefix+d);return x&&(x=C.serializer.deserialize(x)),x});return w(E,_),E}function Xy(d,_){var p=this,E=p.ready().then(function(){for(var C=p._dbInfo,x=C.keyPrefix,D=x.length,M=localStorage.length,U=1,H=0;H<M;H++){var q=localStorage.key(H);if(q.indexOf(x)===0){var Q=localStorage.getItem(q);if(Q&&(Q=C.serializer.deserialize(Q)),Q=d(Q,q.substring(D),U++),Q!==void 0)return Q}}});return w(E,_),E}function Zy(d,_){var p=this,E=p.ready().then(function(){var C=p._dbInfo,x;try{x=localStorage.key(d)}catch{x=null}return x&&(x=x.substring(C.keyPrefix.length)),x});return w(E,_),E}function ev(d){var _=this,p=_.ready().then(function(){for(var E=_._dbInfo,C=localStorage.length,x=[],D=0;D<C;D++){var M=localStorage.key(D);M.indexOf(E.keyPrefix)===0&&x.push(M.substring(E.keyPrefix.length))}return x});return w(p,d),p}function tv(d){var _=this,p=_.keys().then(function(E){return E.length});return w(p,d),p}function nv(d,_){var p=this;d=v(d);var E=p.ready().then(function(){var C=p._dbInfo;localStorage.removeItem(C.keyPrefix+d)});return w(E,_),E}function rv(d,_,p){var E=this;d=v(d);var C=E.ready().then(function(){_===void 0&&(_=null);var x=_;return new f(function(D,M){var U=E._dbInfo;U.serializer.serialize(_,function(H,q){if(q)M(q);else try{localStorage.setItem(U.keyPrefix+d,H),D(x)}catch(Q){(Q.name==="QuotaExceededError"||Q.name==="NS_ERROR_DOM_QUOTA_REACHED")&&M(Q),M(Q)}})})});return w(C,p),C}function iv(d,_){if(_=I.apply(this,arguments),d=typeof d!="function"&&d||{},!d.name){var p=this.config();d.name=d.name||p.name,d.storeName=d.storeName||p.storeName}var E=this,C;return d.name?C=new f(function(x){d.storeName?x(Uu(d,E._defaultConfig)):x(d.name+"/")}).then(function(x){for(var D=localStorage.length-1;D>=0;D--){var M=localStorage.key(D);M.indexOf(x)===0&&localStorage.removeItem(M)}}):C=f.reject("Invalid arguments"),w(C,_),C}var sv={_driver:"localStorageWrapper",_initStorage:Yy,_support:Vy(),iterate:Xy,getItem:Qy,setItem:rv,removeItem:nv,clear:Jy,length:tv,key:Zy,keys:ev,dropInstance:iv},ov=function(_,p){return _===p||typeof _=="number"&&typeof p=="number"&&isNaN(_)&&isNaN(p)},av=function(_,p){for(var E=_.length,C=0;C<E;){if(ov(_[C],p))return!0;C++}return!1},Hu=Array.isArray||function(d){return Object.prototype.toString.call(d)==="[object Array]"},xr={},Wu={},Bn={INDEXEDDB:S,WEBSQL:zy,LOCALSTORAGE:sv},lv=[Bn.INDEXEDDB._driver,Bn.WEBSQL._driver,Bn.LOCALSTORAGE._driver],Mi=["dropInstance"],Io=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(Mi),cv={description:"",driver:lv.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function uv(d,_){d[_]=function(){var p=arguments;return d.ready().then(function(){return d[_].apply(d,p)})}}function Ro(){for(var d=1;d<arguments.length;d++){var _=arguments[d];if(_)for(var p in _)_.hasOwnProperty(p)&&(Hu(_[p])?arguments[0][p]=_[p].slice():arguments[0][p]=_[p])}return arguments[0]}var fv=function(){function d(_){o(this,d);for(var p in Bn)if(Bn.hasOwnProperty(p)){var E=Bn[p],C=E._driver;this[p]=C,xr[C]||this.defineDriver(E)}this._defaultConfig=Ro({},cv),this._config=Ro({},this._defaultConfig,_),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return d.prototype.config=function(p){if((typeof p>"u"?"undefined":s(p))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var E in p){if(E==="storeName"&&(p[E]=p[E].replace(/\W/g,"_")),E==="version"&&typeof p[E]!="number")return new Error("Database version must be a number.");this._config[E]=p[E]}return"driver"in p&&p.driver?this.setDriver(this._config.driver):!0}else return typeof p=="string"?this._config[p]:this._config},d.prototype.defineDriver=function(p,E,C){var x=new f(function(D,M){try{var U=p._driver,H=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!p._driver){M(H);return}for(var q=Io.concat("_initStorage"),Q=0,ae=q.length;Q<ae;Q++){var ge=q[Q],_e=!av(Mi,ge);if((_e||p[ge])&&typeof p[ge]!="function"){M(H);return}}var Ae=function(){for(var Sr=function(pv){return function(){var mv=new Error("Method "+pv+" is not implemented by the current driver"),qu=f.reject(mv);return w(qu,arguments[arguments.length-1]),qu}},To=0,hv=Mi.length;To<hv;To++){var Do=Mi[To];p[Do]||(p[Do]=Sr(Do))}};Ae();var Ce=function(Sr){xr[U]&&console.info("Redefining LocalForage driver: "+U),xr[U]=p,Wu[U]=Sr,D()};"_support"in p?p._support&&typeof p._support=="function"?p._support().then(Ce,M):Ce(!!p._support):Ce(!0)}catch(ft){M(ft)}});return y(x,E,C),x},d.prototype.driver=function(){return this._driver||null},d.prototype.getDriver=function(p,E,C){var x=xr[p]?f.resolve(xr[p]):f.reject(new Error("Driver not found."));return y(x,E,C),x},d.prototype.getSerializer=function(p){var E=f.resolve(Fn);return y(E,p),E},d.prototype.ready=function(p){var E=this,C=E._driverSet.then(function(){return E._ready===null&&(E._ready=E._initDriver()),E._ready});return y(C,p,p),C},d.prototype.setDriver=function(p,E,C){var x=this;Hu(p)||(p=[p]);var D=this._getSupportedDrivers(p);function M(){x._config.driver=x.driver()}function U(Q){return x._extend(Q),M(),x._ready=x._initStorage(x._config),x._ready}function H(Q){return function(){var ae=0;function ge(){for(;ae<Q.length;){var _e=Q[ae];return ae++,x._dbInfo=null,x._ready=null,x.getDriver(_e).then(U).catch(ge)}M();var Ae=new Error("No available storage method found.");return x._driverSet=f.reject(Ae),x._driverSet}return ge()}}var q=this._driverSet!==null?this._driverSet.catch(function(){return f.resolve()}):f.resolve();return this._driverSet=q.then(function(){var Q=D[0];return x._dbInfo=null,x._ready=null,x.getDriver(Q).then(function(ae){x._driver=ae._driver,M(),x._wrapLibraryMethodsWithReady(),x._initDriver=H(D)})}).catch(function(){M();var Q=new Error("No available storage method found.");return x._driverSet=f.reject(Q),x._driverSet}),y(this._driverSet,E,C),this._driverSet},d.prototype.supports=function(p){return!!Wu[p]},d.prototype._extend=function(p){Ro(this,p)},d.prototype._getSupportedDrivers=function(p){for(var E=[],C=0,x=p.length;C<x;C++){var D=p[C];this.supports(D)&&E.push(D)}return E},d.prototype._wrapLibraryMethodsWithReady=function(){for(var p=0,E=Io.length;p<E;p++)uv(this,Io[p])},d.prototype.createInstance=function(p){return new d(p)},d}(),dv=new fv;r.exports=dv},{3:3}]},{},[4])(4)})}(ls)),ls.exports}var yd=gd();const fa=md(yd);class vd extends dn{constructor(e){super(e,"storage",!1),e.set("localforage",fa)}get StorageManager(){return Mr}createDatabse(e,n,r){return new Mr("InPageEdit",e,n,r)}}const Nn=class Nn{constructor(e,n,r=Nn.DEFAULT_TTL,i){this.dbName=e,this.storeName=n,this.ttl=r,this.version=i,this.db=Nn.createDatabase(e,n),this.keys=this.db.keys.bind(this.db)}static createDatabase(e,n){const r=`${e}:${n}`;if(this._cached_db_instances.has(r))return this._cached_db_instances.get(r);const i=fa.createInstance({name:e,storeName:n});return this._cached_db_instances.set(r,i),i}async get(e,n=this.ttl,r){const i=await this.loadFromDB(e),s=this.checkIfExpired(i,n);if(!i||s){if(typeof r=="function"){const o=await r();return this.set(e,o).then(()=>o)}return null}return i.value}async set(e,n){return n===null||typeof n>"u"?this.delete(e):this.db.setItem(e,{time:Date.now(),value:n,version:this.version})}async has(e,n=this.ttl){const r=await this.loadFromDB(e),i=this.checkIfExpired(r,n);return r!==null&&!i}async delete(e){return this.db.removeItem(e)}async iterate(e){return await this.db.iterate((n,r)=>{e(n.value,r)})}async loadFromDB(e){const n=await this.db.getItem(e);if(!n)return null;if(typeof n.time!="number"||typeof n.value>"u"){try{this.delete(e)}catch{}return null}if(typeof this.version=="number"&&n.version!==this.version){try{this.delete(e)}catch{}return null}return n}checkIfExpired(e,n=this.ttl){return e?Date.now()-e.time>n:!1}async clear(){return await this.db.clear(),this}};Nn.DEFAULT_TTL=1/0,Nn._cached_db_instances=new Map;let Mr=Nn;var bd=Object.create,cs=Object.defineProperty,_d=Object.getOwnPropertyDescriptor,da=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),ha=t=>{throw TypeError(t)},wd=(t,e,n)=>e in t?cs(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,xd=(t,e)=>cs(t,"name",{value:e,configurable:!0}),Sd=t=>[,,,bd(t?.[da("metadata")]??null)],Ed=["class","method","getter","setter","accessor","field","value","get","set"],pa=t=>t!==void 0&&typeof t!="function"?ha("Function expected"):t,Od=(t,e,n,r,i)=>({kind:Ed[t],name:e,metadata:r,addInitializer:s=>n._?ha("Already initialized"):i.push(pa(s||null))}),Pd=(t,e)=>wd(e,da("metadata"),t[3]),Cd=(t,e,n,r)=>{for(var i=0,s=t[e>>1],o=s&&s.length;i<o;i++)s[i].call(n);return r},kd=(t,e,n,r,i,s)=>{var o,a,l,u=e&7,c=!1,f=0,w=t[f]||(t[f]=[]),y=u&&(i=i.prototype,u<5&&(u>3||!c)&&_d(i,n));xd(i,n);for(var v=r.length-1;v>=0;v--)l=Od(u,n,a={},t[3],w),o=(0,r[v])(i,l),a._=1,pa(o)&&(i=o);return Pd(t,i),y&&cs(i,n,y),c?u^4?s:y:i},ma,us,ga;ma=[Ve(["api","storage"])];class Fr extends(ga=dn){constructor(e){super(e,"sitemeta",!1),this.ctx=e,this._data=void 0,this.siteIdentity=void 0,this.CACHE_TTL=1e3*60*60*24,this.VERSION=2,this.db=void 0,this.queryData={meta:"siteinfo|userinfo",siprop:"general|specialpagealiases|namespacealiases|namespaces|magicwords",uiprop:"groups|rights|blockinfo|options"},this.db=e.storage.createDatabse("sitemeta",this.CACHE_TTL,this.VERSION)}get api(){return this.ctx.api}get mwConfig(){return mw.config.values}async start(){const e=await this.fetchFromCache();if(e){this.ctx.logger("SiteMetadataService").info("Using cached metadata"),this._data=e;return}const n=await this.fetchFromApi();this.saveToCache(n),this._data=n}async computeSiteIdentity(){if(this.siteIdentity)return this.siteIdentity;let e;if(!window.mw?.config)e=new URL(location.href).origin;else{const{wgServer:n,wgArticlePath:r}=window.mw.config.get();e=`${n}${r}`}return this.siteIdentity=e,this.siteIdentity}async fetchFromApi(){return this.api.get({action:"query",...this.queryData}).then(({data:e})=>{if(typeof e?.query?.general>"u")throw new Error("Invalid siteinfo");return e.query}).catch(e=>(this.ctx.logger.error("[InPageEdit]","fetchMetadata error",e),Promise.reject(e)))}async fetchFromCache(){const e=await this.computeSiteIdentity();return this.db.get(e)}async saveToCache(e){const n=await this.computeSiteIdentity();return this.db.set(n,e)}get _raw(){return this._data}get siteInfo(){return this._data.general}get specialPageAliases(){return this._data.specialpagealiases}get namespaceAliases(){return this._data.namespacealiases}get namespaces(){return this._data.namespaces}get namespaceMap(){const e=Object.values(this.namespaces).map(n=>({id:n.id,canonical:n.canonical,aliases:this.namespaceAliases.filter(r=>r.id===n.id).map(r=>r.alias)})).sort((n,r)=>n.id-r.id);return Reflect.defineProperty(this,"namespaceMap",{value:e,writable:!1,configurable:!1,enumerable:!0}),e}get magicWords(){return this._data.magicwords}get userInfo(){return this._data.userinfo}get userOptions(){return this.userInfo.options}get isUserBlocked(){return this.userInfo.blockedbyid&&this.userInfo.blockexpiry&&new Date(this.userInfo.blockexpiry).getTime()>Date.now()}get userGroups(){return this.userInfo.groups}get userRights(){return this.userInfo.rights}hasRight(e){return this.userRights.includes(e)}hasAnyRight(...e){return e.some(n=>this.hasRight(n))}hasEveryRights(...e){return e.every(n=>this.hasRight(n))}inGroup(e){return this.userGroups.includes(e)}inAnyGroup(...e){return this.userGroups.some(n=>e.includes(n))}getBlockInfo(){return this.isUserBlocked?{blockid:this.userInfo.blockid,blockedby:this.userInfo.blockedbyid,blockedbyid:this.userInfo.blockedbyid,blockreason:this.userInfo.blockreason,blockedtimestamp:this.userInfo.blockedtimestamp,blockexpiry:this.userInfo.blockexpiry}:null}}us=Sd(ga),Fr=kd(us,0,"SiteMetadataService",ma,Fr),Cd(us,1,Fr);const Ni=class Ni{constructor(e,n){this.pageInfo={...Ni.DEFAULT_PAGE_INFO,...e},this.api=n||new ia}async getPageInfo(e){const{data:{query:{pages:[n]}}}=await this.api.get({action:"query",prop:"info|templates|transcludedin|images|pageimages|revisions",inprop:"protection|url|varianttitles",intestactions:"edit|move|delete",tllimit:"max",tilimit:"max",imlimit:"max",piprop:"thumbnail|name|original",pithumbsize:"200",pilimit:"max",rvprop:"ids|timestamp|flags|comment|user|content",...e});return n.revisions?.forEach(r=>{if(typeof r.slots=="object"){const i=r.slots.main;i&&(r.content=i.content,r.contentmodel=i.contentmodel,r.contentformat=i.contentformat)}}),n}async parse(e){return this.api.post({action:"parse",page:this.pageInfo.title,prop:"text|langlinks|categories|links|templates|images|externallinks|sections|revid|displaytitle|iwlinks|properties|parsewarnings",...e})}async preview(e,n){return this.parse({action:"parse",page:void 0,title:this.title,text:e,pst:1,preview:1,disableeditsection:1,disablelimitreport:1,...n})}async edit(e,n){const{text:r,prependtext:i,appendtext:s,summary:o="",watchlist:a="preferences"}=e;return this.api.postWithEditToken({action:"edit",title:this.title,starttimestamp:this.pageInfo.touched,basetimestamp:this.revisions[0]?.timestamp,text:r,prependtext:i,appendtext:s,summary:o,watchlist:a,...n})}async createOnly(e,n){return this.edit(e,{createonly:1,...n})}async delete(e,n){return this.api.postWithEditToken({action:"delete",pageid:this.pageInfo.pageid,reason:e,...n})}async moveTo(e,n,r){return this.api.postWithEditToken({action:"move",from:this.pageInfo.title,to:e,reason:n,movetalk:1,movesubpages:1,...r})}userCan(e){return this.pageInfo?.actions?.[e]}userCanEdit(){return this.userCan("edit")}async refetch(){const e=await this.getPageInfo({pageids:this.pageInfo.pageid,titles:this.pageInfo.title}),n=(this.pageInfo.revisions||[]).concat(e.revisions||[]).sort((r,i)=>r.revid-i.revid).reduce((r,i)=>(r.find(s=>s.revid===i.revid)||r.push(i),r),[]);return this.pageInfo=e,this.pageInfo.revisions=n,this}get pageid(){return this.pageInfo.pageid}get title(){return this.pageInfo.title}get ns(){return this.pageInfo.ns}get contentmodel(){return this.pageInfo.contentmodel}get fullurl(){return this.pageInfo.fullurl}get canonicalurl(){return this.pageInfo.canonicalurl}get editurl(){return this.pageInfo.editurl}get revisions(){return this.pageInfo.revisions||[]}get templates(){return this.pageInfo.templates||[]}get images(){return this.pageInfo.images||[]}};Ni.DEFAULT_PAGE_INFO={pageid:0,ns:0,title:"",contentmodel:"wikitext",pagelanguage:"",pagelanguagehtmlcode:"",pagelanguagedir:"ltr",touched:new Date().toISOString(),lastrevid:0,length:0,protection:[],restrictiontypes:[],fullurl:"",canonicalurl:"",editurl:"",varianttitles:{},actions:{edit:!0,move:!1,delete:!1},revisions:[],templates:[],images:[]};let Vn=Ni;const Po=class Po extends dn{constructor(e){super(e,"wikiPage",!0),this.ctx=e}get WikiPage(){return Vn}async createInstance(e){const{data:{query:{pages:[n]}}}=await this.ctx.api.get({action:"query",prop:"info|templates|transcludedin|images|pageimages|revisions",inprop:"protection|url|varianttitles",intestactions:"edit|move|delete",tllimit:"max",tilimit:"max",imlimit:"max",piprop:"thumbnail|name|original",pithumbsize:"200",pilimit:"max",rvprop:"ids|timestamp|user|userid|content",...e});return new Vn(n,this.ctx.api)}async newFromTitle(e,n=!1,r){return this.createInstance({titles:e,converttitles:n,rvsection:r})}async newFromPageId(e,n){return this.createInstance({pageids:e,rvsection:n})}async newFromRevision(e,n){return this.createInstance({revids:e,rvsection:n})}newBlankPage(e={}){return new Vn(e,this.ctx.api)}};Po.inject=["api"];let fs=Po;/**
27
53
  * ✏️ InPageEdit NEXT
28
54
  *
29
55
  * 🚀 Modular, Extensible Supercharged Plugin for MediaWiki
@@ -31,53 +57,54 @@
31
57
  * @author dragon-fish <dragon-fish@qq.com>
32
58
  * @license MIT
33
59
  * @see https://github.com/inpageedit/inpageedit-next
34
- */const Di=class Di extends Ke{constructor(n){super();jo(this,Kt);this.version="0.4.0",this.Endpoints=mn,this.schema=xe,this.config={...Di.DEFAULT_CONFIG,...n},this.logger=new Xi({name:"IPE",color:"#33aaff",level:this.config.logLevel}),Mi(this,Kt,Xu).call(this),Mi(this,Kt,Zu).call(this),Mi(this,Kt,ef).call(this)}async useScope(n){const{promise:r,resolve:i}=ye();return this.inject(n,s=>{i(s)}),r}};Kt=new WeakSet,Xu=async function(){this.plugin(ed,{baseURL:this.config.baseURL}),this.plugin(td),this.plugin(as),this.plugin(Cd),this.plugin(Lr),this.plugin(fs)},Zu=async function(){[Promise.resolve().then(()=>Qd).then(({PluginPreferences:r})=>r),Promise.resolve().then(()=>bh).then(({PluginQuickEdit:r})=>r),Promise.resolve().then(()=>$h).then(({PluginQuickMove:r})=>r),Promise.resolve().then(()=>Bh).then(({PluginQuickPreview:r})=>r),Promise.resolve().then(()=>$p).then(({PluginQuickDiff:r})=>r),Promise.resolve().then(()=>Ap).then(({PluginQuickRedirect:r})=>r),Promise.resolve().then(()=>Up).then(({PluginToolbox:r})=>r)].forEach(async r=>{this.plugin(await r)})},ef=async function(){this.inject(["resourceLoader"],n=>{n.resourceLoader.loadStyle(`${mn.PLUGIN_CDN_BASE}/skins/ipe-default.css`)})},Di.DEFAULT_CONFIG={baseURL:"",legacyPreferences:{},logLevel:Ji.info};let en=Di;function jd(t){return t.charAt(0).toLowerCase()+t.slice(1)}function Ld(t){return jd(t).replace(/-/g,"_").replace(/.[A-Z]+/g,e=>e[0]+"_"+e.slice(1).toLowerCase())}class gt{constructor(e,n=void 0,r){jo(this,br);this.ctx=e,this.disposeHandlers=[],this.name=r||this.constructor.name,this.config=n||{};const{promise:i,resolve:s,reject:o}=Promise.withResolvers();queueMicrotask(()=>{try{const a=this.start();a&&typeof a.then=="function"?a.then(()=>s()).catch(l=>{this.logger.error("Plugin start failed",l),o(l)}):s()}catch(a){this.logger.error("Plugin start threw synchronously",a),o(a)}i.then(()=>{this.logger.info("Plugin started")}),i.catch(a=>{this.logger.error("Plugin start failed",a),this.ctx.scope.dispose()})}),this.ctx.once("dispose",()=>{this.disposeHandlers.forEach(a=>a(this.ctx)),this.stop(),this.logger.info("Plugin disposed")})}start(){}stop(){}addDisposeHandler(e){this.disposeHandlers.push(e)}removeDisposeHandler(e){this.disposeHandlers=this.disposeHandlers.filter(n=>n!==e)}set name(e){Qu(this,br,Ld(e).toUpperCase())}get name(){return Ju(this,br)}get logger(){return this.ctx.logger(this.name)}}br=new WeakMap,window.RLQ||(window.RLQ=[]),window.__IPE_MODULES__||(window.__IPE_MODULES__=[]),Fd("InPageEdit#autoload",()=>{window.RLQ.push(Md)});async function Md(){typeof window?.ipe?.stop=="function"&&(console.warn("[InPageEdit] Plugin already loaded, disposing..."),await window.ipe.stop());const t=window.InPageEdit||{},e=new en({baseURL:window.mw?.util.wikiScript("api"),legacyPreferences:t?.myPreferences||{}});if(window.InPageEdit=en,window.ipe=e,window.mw.hook("InPageEdit.ready").fire(e),await e.start(),Array.isArray(window.__IPE_MODULES__)){const n=[];for(;window.__IPE_MODULES__.length;)try{const r=window.__IPE_MODULES__.shift();typeof r=="function"&&r?.(e),n.push(r)}catch(r){console.error("[InPageEdit] Failed to initialize module:",r)}window.__IPE_MODULES__={push:r=>{typeof r=="function"&&r(e),n.push(r)}},e.on("dispose",()=>{window.__IPE_MODULES__=n})}e.logger("AUTOLOAD").info(`${mn.HOME_URL}
60
+ * @see https://www.ipe.wiki/
61
+ */const vr=class vr extends Ke{constructor(n){super();Lo(this,Pt);this.version="0.4.1",this.Endpoints=mn,this.schema=xe,this.config={...vr.DEFAULT_CONFIG,...n},this.logger=Xo({name:"IPE",color:"#33aaff",level:this.config.logLevel}),Er(this,Pt,Yu).call(this),Er(this,Pt,Qu).call(this),Er(this,Pt,Xu).call(this)}async useScope(n){const{promise:r,resolve:i}=ye();return this.inject(n,s=>{i(s)}),r}};Pt=new WeakSet,Yu=async function(){this.plugin(Kf,{baseURL:this.config.baseURL}),this.plugin(Gf),this.plugin(as),this.plugin(vd),this.plugin(Fr),this.plugin(fs),Er(this,Pt,Ju).call(this,["api","resourceLoader","modal","storage","wikiPage"])},Ju=function(n){if(typeof n=="string"&&(n=[n]),!Array.isArray(n)||n.length===0)return this;for(const r of n){const i=this[vr.internal][r];i?.type==="service"&&(i.builtin=!0)}return this},Qu=async function(){[Promise.resolve().then(()=>qd).then(({PluginPreferences:r})=>r),Promise.resolve().then(()=>fh).then(({PluginQuickEdit:r})=>r),Promise.resolve().then(()=>xh).then(({PluginQuickMove:r})=>r),Promise.resolve().then(()=>Th).then(({PluginQuickPreview:r})=>r),Promise.resolve().then(()=>xp).then(({PluginQuickDiff:r})=>r),Promise.resolve().then(()=>Sp).then(({PluginQuickRedirect:r})=>r),Promise.resolve().then(()=>Dp).then(({PluginToolbox:r})=>r)].forEach(async r=>{this.plugin(await r)})},Xu=async function(){this.inject(["resourceLoader"],n=>{n.resourceLoader.loadStyle(`${mn.PLUGIN_CDN_BASE}/skins/ipe-default.css`)})},vr.DEFAULT_CONFIG={baseURL:"",legacyPreferences:{},logLevel:Ji.info};let en=vr;function $d(t){return t.charAt(0).toLowerCase()+t.slice(1)}function Ad(t){return $d(t).replace(/-/g,"_").replace(/.[A-Z]+/g,e=>e[0]+"_"+e.slice(1).toLowerCase())}class gt{constructor(e,n=void 0,r){Lo(this,br);this.ctx=e,this.disposeHandlers=[],this.name=r||this.constructor.name,this.config=n||{};const{promise:i,resolve:s,reject:o}=Promise.withResolvers();queueMicrotask(()=>{try{const a=this.start();a&&typeof a.then=="function"?a.then(()=>s()).catch(l=>{this.logger.error("Plugin start failed",l),o(l)}):s()}catch(a){this.logger.error("Plugin start threw synchronously",a),o(a)}i.then(()=>{this.logger.info("Plugin started")}),i.catch(a=>{this.logger.error("Plugin start failed",a),this.ctx.scope.dispose()})}),this.ctx.once("dispose",()=>{this.disposeHandlers.forEach(a=>a(this.ctx)),this.stop(),this.logger.info("Plugin disposed")})}start(){}stop(){}addDisposeHandler(e){this.disposeHandlers.push(e)}removeDisposeHandler(e){this.disposeHandlers=this.disposeHandlers.filter(n=>n!==e)}set name(e){Ku(this,br,Ad(e).toUpperCase())}get name(){return Vu(this,br)}get logger(){return this.ctx.logger(this.name)}}br=new WeakMap,window.RLQ||(window.RLQ=[]),window.__IPE_MODULES__||(window.__IPE_MODULES__=[]),Rd("InPageEdit#autoload",()=>{window.RLQ.push(Id)});async function Id(){typeof window?.ipe?.stop=="function"&&(console.warn("[InPageEdit] Plugin already loaded, disposing..."),await window.ipe.stop());const t=window.InPageEdit||{},e=new en({baseURL:window.mw?.util.wikiScript("api"),legacyPreferences:t?.myPreferences||{}});if(window.InPageEdit=en,window.ipe=e,window.mw.hook("InPageEdit.ready").fire(e),await e.start(),Array.isArray(window.__IPE_MODULES__)){const n=[];for(;window.__IPE_MODULES__.length;)try{const r=window.__IPE_MODULES__.shift();typeof r=="function"&&r?.(e),n.push(r)}catch(r){console.error("[InPageEdit] Failed to initialize module:",r)}window.__IPE_MODULES__={push:r=>{typeof r=="function"&&r(e),n.push(r)}},e.on("dispose",()=>{window.__IPE_MODULES__=n})}e.logger("AUTOLOAD").info(`${mn.HOME_URL}
35
62
  ____ ____ ______ ___ __
36
63
  / _/___ / __ \\____ _____ ____ / ____/___/ (_) /_
37
64
  / // __ \\/ /_/ / __ \`/ __ \`/ _ \\/ __/ / __ / / __/
38
65
  _/ // / / / ____/ /_/ / /_/ / __/ /___/ /_/ / / /_
39
66
  /___/_/ /_/_/ \\__,_/\\__, /\\___/_____/\\__,_/_/\\__/
40
- /____/ v`+e.version)}function Fd(t,e){const n=Symbol.for(t);return window[n]?!1:(window[n]=!0,e(),!0)}const Bd=window?.location?.origin,Mr=({type:t,tag:e,href:n,target:r,children:i,...s})=>(e=e||(n?"a":"button"),typeof r>"u"&&n&&n.startsWith("http")&&!n.startsWith(Bd)&&(r="_blank"),yd(e,{className:`theme-ipe ipe-action-button btn btn-${t||"default"}`,href:e==="a"?n:void 0,target:e==="a"?r:void 0,"data-href":e!=="a"?n:void 0,...s},i));var Ud=Object.create,ds=Object.defineProperty,Hd=Object.getOwnPropertyDescriptor,wa=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),xa=t=>{throw TypeError(t)},Wd=(t,e,n)=>e in t?ds(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,qd=(t,e)=>ds(t,"name",{value:e,configurable:!0}),zd=t=>[,,,Ud(t?.[wa("metadata")]??null)],Vd=["class","method","getter","setter","accessor","field","value","get","set"],Sa=t=>t!==void 0&&typeof t!="function"?xa("Function expected"):t,Kd=(t,e,n,r,i)=>({kind:Vd[t],name:e,metadata:r,addInitializer:s=>n._?xa("Already initialized"):i.push(Sa(s||null))}),Yd=(t,e)=>Wd(e,wa("metadata"),t[3]),Gd=(t,e,n,r)=>{for(var i=0,s=t[e>>1],o=s&&s.length;i<o;i++)s[i].call(n);return r},Jd=(t,e,n,r,i,s)=>{var o,a,l,u=e&7,c=!1,f=0,w=t[f]||(t[f]=[]),y=u&&(i=i.prototype,u<5&&(u>3||!c)&&Hd(i,n));qd(i,n);for(var v=r.length-1;v>=0;v--)l=Kd(u,n,a={},t[3],w),o=(0,r[v])(i,l),a._=1,Sa(o)&&(i=o);return Yd(t,i),y&&ds(i,n,y),c?u^4?s:y:i},Ea,hs,Ca;Ea=[Ve(["sitemeta","storage"])];class Fr extends(Ca=gt){constructor(e){super(e,{},"preferences"),this.ctx=e,this.db=void 0,this.customRegistries=[],this.categoryDefinitions=[],this._defaultPreferences={},this.db=e.storage.createDatabse("preferences",1/0),this.ctx.set("preferences",this)}async start(){this.defineCategory({name:"general",label:"General",description:"General settings"}),this.defineCategory({name:"edit",label:"Editing",description:"Settings related to editing content"}),this.defineCategory({name:"about",label:"About",description:"About InPageEdit",index:99}),this.registerCustomConfig("about",xe.object({about:xe.string().role("html-info").description(C("div",{className:"prose",children:[C("h2",{children:"✏️ InPageEdit NEXT"}),C("i",{children:["v",this.ctx.version]}),C("h2",{children:"Portal"}),C("div",{style:"display: flex; flex-direction: column; gap: 1rem",children:[C(Mr,{href:"https://www.ipe.wiki",style:{display:"block",width:"100%"},children:"Official Website & Help Center"}),C(Mr,{href:"https://www.ipe.wiki/update/",style:{display:"block",width:"100%"},children:"Update Logs"})]}),C("h2",{children:"Join us"}),C("ul",{children:[C("li",{children:[C("strong",{children:"GitHub"}),":"," ",C("a",{href:"https://github.com/inpageedit/inpageedit-next",target:"_blank",children:"inpageedit/inpageedit-next"})]}),C("li",{children:[C("strong",{children:"QQ Group"}),": 1026023666"]})]}),C("hr",{}),C("p",{children:"🚀 Modular, Extensible Supercharged Plugin for MediaWiki."}),C("p",{children:"InPageEdit-NEXT Copyright © 2025-present dragon-fish"})]}).outerHTML).default("")}).description(""),"about",{}),Promise.resolve().then(()=>By).then(e=>{const n=this.ctx.plugin(e.PluginPreferencesUI);this.addDisposeHandler(()=>{n.dispose()})})}get(e,n){return n||(n=()=>{const i=this.getDefaultValue(e);return this.logger.info("default value used",i),i}),this.db.get(e,void 0,n)}getDefaultValue(e){var n;return(n=this._defaultPreferences)[e]??(n[e]=this.loadDefaultConfigs()[e])}set(e,n){const r=this.getDefaultValue(e);return n===r?this.db.delete(e):this.db.set(e,n)}async getAll(){const e=this.loadDefaultConfigs();return await this.db.iterate((n,r)=>{e[r]=n}),e}loadDefaultConfigs(){const e={};return this.getConfigRegistries().forEach(n=>{n.defaults&&Object.entries(n.defaults).forEach(([r,i])=>{e[r]=i,this._defaultPreferences[r]=i})}),e}registerCustomConfig(e,n,r,i){return this.customRegistries.push({name:e,schema:n,category:r,defaults:i}),this}getConfigRegistries(e){return Array.from(this.ctx.registry.entries()).map(([n,r])=>n===null?{name:"root",schema:en?.PreferencesSchema||null,defaults:en?.PreferencesDefaults||{}}:{name:n.name,schema:n?.PreferencesSchema||null,defaults:n?.PreferencesDefaults||{}}).filter(n=>n.schema!==null).map(n=>({...n,category:n.schema.meta.category||"general"})).concat(this.customRegistries).filter(n=>!e||n.category===e)}defineCategory(e){const n=this.categoryDefinitions.findIndex(r=>r.name===e.name);return n<0?this.categoryDefinitions.push(e):this.categoryDefinitions[n]=e,this.categoryDefinitions.sort((r,i)=>(r.index??0)-(i.index??0)),this}getConfigCategories(){return this.categoryDefinitions}}hs=zd(Ca),Fr=Jd(hs,0,"PluginPreferences",Ea,Fr),Gd(hs,1,Fr);const Qd=Object.freeze(Object.defineProperty({__proto__:null,get PluginPreferences(){return Fr}},Symbol.toStringTag,{value:"Module"}));var st=(t=>(t.preferences="preferences",t.watch="watch",t.unwatch="unwatch",t.nochange="nochange",t))(st||{});function Br(t,e){return function(n){return n.PreferencesSchema=t,n.PreferencesDefaults=e,n}}var Xd=Object.create,ps=Object.defineProperty,Zd=Object.getOwnPropertyDescriptor,Oa=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),ka=t=>{throw TypeError(t)},eh=(t,e,n)=>e in t?ps(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,th=(t,e)=>ps(t,"name",{value:e,configurable:!0}),nh=t=>[,,,Xd(t?.[Oa("metadata")]??null)],rh=["class","method","getter","setter","accessor","field","value","get","set"],Pa=t=>t!==void 0&&typeof t!="function"?ka("Function expected"):t,ih=(t,e,n,r,i)=>({kind:rh[t],name:e,metadata:r,addInitializer:s=>n._?ka("Already initialized"):i.push(Pa(s||null))}),sh=(t,e)=>eh(e,Oa("metadata"),t[3]),oh=(t,e,n,r)=>{for(var i=0,s=t[e>>1],o=s&&s.length;i<o;i++)s[i].call(n);return r},ah=(t,e,n,r,i,s)=>{var o,a,l,u=e&7,c=!1,f=0,w=t[f]||(t[f]=[]),y=u&&(i=i.prototype,u<5&&(u>3||!c)&&Zd(i,n));th(i,n);for(var v=r.length-1;v>=0;v--)l=ih(u,n,a={},t[3],w),o=(0,r[v])(i,l),a._=1,Pa(o)&&(i=o);return sh(t,i),y&&ps(i,n,y),c?u^4?s:y:i},$a,ms,Aa;$a=[Ve(["sitemeta","quickEdit"]),Br(xe.object({redLinkEdit:xe.boolean().description("Show quick edit entry after red links").default(!0)}).description("In-article quick edit links"),{redLinkEdit:!0})];class Ur extends(Aa=gt){constructor(e){const n=e.sitemeta.mwConfig,r=n.wgArticlePath.replace("$1",""),i=`${location.protocol}//${n.wgServer.split("//")[1]}`;super(e,{wikiBaseUrl:i,wikiArticlePath:r,wikiArticleBaseUrl:`${i}${r}`,wikiScriptBaseUrl:`${i}${n.wgScriptPath}`,linkClassName:"ipe-quickEdit__in-article-link"},"QuickEditInArticleLinks")}async start(){mw.hook("wikipage.content").add(()=>{document.querySelectorAll("#mw-content-text a[href]").forEach(n=>{const r=this.checkEditAnchor(n);if(!r||n.dataset.ipeQuickEditLink)return;const i=C("a",{href:`#/IPE/quickEdit/${r.title}`,className:this.config.linkClassName,style:{userSelect:"none",marginLeft:"0.2em",verticalAlign:"middle"},onClick:s=>{s.preventDefault(),this.ctx.quickEdit(r)},children:C("svg",{style:"width: 1em; height: 1em",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-pencil-bolt",children:[C("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),C("path",{d:"M4 20h4l10.5 -10.5a2.828 2.828 0 1 0 -4 -4l-10.5 10.5v4"}),C("path",{d:"M13.5 6.5l4 4"}),C("path",{d:"M19 16l-2 3h4l-2 3"})]})});n.insertAdjacentElement("afterend",i),n.dataset.ipeQuickEditLink="true"})})}stop(){document.querySelectorAll(`.${this.config.linkClassName}`).forEach(e=>e.remove())}checkEditAnchor(e){if(!(e instanceof HTMLAnchorElement))return null;const n=e.href||"";if(!n.startsWith(this.config.wikiArticleBaseUrl)&&!n.startsWith(this.config.wikiScriptBaseUrl))return null;const r=new URL(n),i=r.searchParams,s=i.get("action")||"view",o=i.get("title")||decodeURI(r.pathname.substring(this.config.wikiArticlePath.length))||"",a=i.get("section")?.replace(/^T-/,"")||void 0,l=i.get("oldid");if(!o||o.endsWith(".php")||!["edit","editsource","editredlink","submit"].includes(s)||i.get("undo")||i.get("preload"))return null;let u;return a==="new"?u="new":a&&/^\d+$/.test(a)&&(u=parseInt(a,10)),{title:o,section:u,revision:parseInt(""+l,10)||0,createOnly:!!i.get("redlink")}}}ms=nh(Aa),Ur=ah(ms,0,"PluginQuickEditInArticleLinks",$a,Ur),oh(ms,1,Ur);const Hr={mbox:"_mbox_v5fz5_1",title:"_title_v5fz5_12",content:"_content_v5fz5_19",close:"_close_v5fz5_27"},Ia=t=>{const{type:e="default",title:n,content:r,closeable:i=!0,titleProps:s,contentProps:o,children:a,...l}=t;let u=n;typeof n>"u"&&e!=="default"&&(u=e[0].toUpperCase()+e.slice(1).toLowerCase());const c=async()=>{if(!f)return Promise.resolve();const{promise:w,resolve:y}=Promise.withResolvers();return f.animate([{opacity:"1",height:f.clientHeight+"px"},{opacity:"0",height:"0px",margin:"0px"}],{duration:300,easing:"ease"}).addEventListener("finish",()=>{f.remove(),y()}),w},f=C("div",{className:`theme-ipe ipe-mbox mbox-type-${e||"default"} ${Hr.mbox}`,...l,children:[u&&C("div",{className:`ipe-mbox-title ${Hr.title}`,...s,children:u}),C("div",{className:`ipe-mbox-content ${Hr.content}`,...o,children:a||r}),i&&C("a",{onClick:c,className:`ipe-mbox-close ${Hr.close}`,children:"×"})]});return f.close=c,f},gs=t=>{const{label:e,id:n,name:r,value:i,disabled:s,labelProps:o,inputProps:a,...l}=t;return C("div",{className:"theme-ipe ipe-input-box",...l,children:[C("label",{htmlFor:n,style:{display:"block"},...o,children:e}),C("input",{id:n,name:r,value:i,disabled:s,style:{width:"100%"},...a})]})},Ta=t=>{const{id:e,name:n,value:r,label:i,inputProps:s,labelProps:o,children:a,...l}=t;return C("label",{className:"theme-ipe ipe-radio-box",...l,children:[C("input",{type:"radio",id:e,name:n,value:r,...s}),C("span",{className:"ipe-checkbox-box"}),C("span",{...o,children:i||a})]})},gn=t=>{const{id:e,name:n,label:r,checked:i,inputProps:s,labelProps:o,children:a,...l}=t;return C("label",{className:"theme-ipe ipe-checkbox",...l,children:[C("input",{type:"checkbox",id:e,name:n,checked:i,...s}),C("span",{className:"ipe-checkbox-box"}),C("span",{...o,children:r||a})]})},Ra=()=>{},Da=(t=0)=>new Promise(e=>setTimeout(e,t));var lh=Object.create,ys=Object.defineProperty,ch=Object.getOwnPropertyDescriptor,Na=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),ja=t=>{throw TypeError(t)},uh=(t,e,n)=>e in t?ys(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,fh=(t,e)=>ys(t,"name",{value:e,configurable:!0}),dh=t=>[,,,lh(t?.[Na("metadata")]??null)],hh=["class","method","getter","setter","accessor","field","value","get","set"],La=t=>t!==void 0&&typeof t!="function"?ja("Function expected"):t,ph=(t,e,n,r,i)=>({kind:hh[t],name:e,metadata:r,addInitializer:s=>n._?ja("Already initialized"):i.push(La(s||null))}),mh=(t,e)=>uh(e,Na("metadata"),t[3]),gh=(t,e,n,r)=>{for(var i=0,s=t[e>>1],o=s&&s.length;i<o;i++)s[i].call(n);return r},yh=(t,e,n,r,i,s)=>{var o,a,l,u=e&7,c=!1,f=0,w=t[f]||(t[f]=[]),y=u&&(i=i.prototype,u<5&&(u>3||!c)&&ch(i,n));fh(i,n);for(var v=r.length-1;v>=0;v--)l=ph(u,n,a={},t[3],w),o=(0,r[v])(i,l),a._=1,La(o)&&(i=o);return mh(t,i),y&&ys(i,n,y),c?u^4?s:y:i},Ma,bs,Fa;Ma=[Ve(["api","wikiPage","modal","preferences"]),Br(xe.object({editSummary:xe.string().description("Default edit summary for quick edits").default("[IPE-NEXT] Quick edit"),editMinor:xe.boolean().description("Whether to mark the edit as minor").default(!1),outSideClose:xe.boolean().description("Whether to close the modal outside").default(!0),watchList:xe.union([xe.const(st.preferences).description("Follow my preferences"),xe.const(st.nochange).description("Keep the current watchlist status"),xe.const(st.watch).description("Add the page to watchlist"),xe.const(st.unwatch).description("Remove the page from watchlist")]).description("Watchlist options").default(st.preferences)}).description("Quick edit options").extra("category","edit"),{editSummary:"[IPE-NEXT] Quick edit",editMinor:!1,outSideClose:!0,watchList:st.preferences})];class Wr extends(Fa=gt){constructor(e){super(e,{},"quick-edit"),this.ctx=e,this.DEFAULT_OPTIONS={title:"",pageId:0,revision:0,section:void 0,editMinor:!1,editSummary:"",createOnly:!1,reloadAfterSave:!0}}start(){this.ctx.root.set("quickEdit",this.quickEdit.bind(this)),this.ctx.inject(["toolbox"],e=>{this.injectToolbox(e),e.on("dispose",()=>{this.removeToolbox(e)})}),this.ctx.plugin(Ur)}async quickEdit(e){typeof e>"u"?e={}:typeof e=="string"&&(e={title:e}),e?.page&&(e.title=e.page,delete e.page),!e.title&&!e.pageId&&!e.revision&&(this.logger.warn("None of the title, pageId or revision provided. Using defaults."),e={...e,title:mw.config.get("wgPageName"),pageId:mw.config.get("wgArticleId"),revision:mw.config.get("wgRevisionId")});const n=await this.ctx.preferences.get("outSideClose"),r=await this.ctx.preferences.get("watchList"),i=typeof e.editSummary=="string"?e.editSummary:await this.ctx.preferences.get("editSummary"),s=typeof e.editMinor=="boolean"?e.editMinor:await this.ctx.preferences.get("editMinor"),o={...this.DEFAULT_OPTIONS,editSummary:i,editMinor:s,...e};o.editSummary||(o.editSummary=await this.ctx.preferences.get("editSummary")||""),o||this.ctx.emit("quickEdit/initOptions",{ctx:this.ctx,options:o});const a=this.ctx.modal.createObject({className:"in-page-edit ipe-quickEdit ipe-editor",sizeClass:"large",outSideClose:n}).init();a.setTitle(C(Ir,{children:["Loading: ",C("u",{children:o.title})]})),a.setContent(C("section",{className:"ipe-quickEdit-loading",style:{height:"70vh",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"},children:C(Zt,{})})),a.setButtons([{side:"right",type:"button",className:"btn btn-danger btn-secondary",label:"Cancel",method(){a.close()}}]),a.show(),this.ctx.emit("quickEdit/showModal",{ctx:this.ctx,modal:a,options:o});let l;try{l=await this.getWikiPageFromPayload(o)}catch(f){a.close(),this.ctx.modal.notify("error",{title:"Error",content:f instanceof Error?f.message:String(f)});return}a.setTitle(C(Ir,{children:["Quick ",l.pageInfo.pageid===0?"Create":"Edit",":"," ",C("u",{children:l.pageInfo.title})]}));const u=C("form",{className:"ipe-quickEdit-form",children:[l.pageInfo.pageid===0&&C(Ia,{title:"Attention",type:"important",children:C("p",{children:"This page does not exist."})}),C("textarea",{className:"editArea",name:"text",id:"wpTextbox1",children:l.revisions[0]?.content||""}),C("div",{class:"ipe-quickEdit-options",style:{display:"flex",flexDirection:"column",gap:"1rem"},children:[C(gs,{label:"Summary",id:"summary",name:"summary",value:o.editSummary}),C("div",{children:[C("label",{htmlFor:"watchlist",style:{display:"block"},children:"Watchlist"}),C("div",{style:{display:"flex",gap:"1rem"},children:[st.preferences,st.nochange,st.watch,st.unwatch].map(f=>C(Ta,{name:"watchlist",value:f,inputProps:{checked:r===f},children:f},f))})]}),C("div",{style:{display:"flex",gap:"1rem"},children:[C(gn,{name:"minor",id:"minor",checked:o.editMinor,children:"Minor edit"}),C(gn,{name:"reloadAfterSave",id:"reloadAfterSave",checked:o.reloadAfterSave,children:"Reload after save"})]})]}),!1]});a.setContent(u);const c=a.generateButton({side:"left",className:"btn btn-primary submit-btn",label:"Submit",method:()=>{const f=new FormData(u);console.info(l,u,{text:f.get("text"),summary:f.get("summary"),minor:f.get("minor")==="on"}),a.setLoadingState(!0),this.handleSubmit({ctx:this.ctx,modal:a,wikiPage:l,options:o},{text:f.get("text"),summary:f.get("summary"),minor:f.get("minor")==="on"}).then(async()=>{a.setOptions({beforeClose:Ra}),a.close(),this.ctx.modal.notify("success",{title:"Submission Successful",content:"Your changes have been saved."}),f.get("reloadAfterSave")&&(await Da(500),location.reload())}).catch(w=>{this.ctx.modal.notify("error",{title:"Submission Error",content:w instanceof Error?w.message:String(w)}),a.setLoadingState(!1)})}});a.get$buttons("leftButtons").prepend(c),a.setOptions({beforeClose:()=>{const f=l.revisions[0]?.content||"";return(u.querySelector("textarea")?.value||"")===f?!0:(this.ctx.modal.confirm({className:"in-page-edit",title:"Unsaved Changes",content:"All edit contents will be lost after closing the modal. Are you sure you want to close?",center:!0,okBtn:{label:"Give Up",className:"btn btn-danger"},cancelBtn:{label:"Continue",className:"btn"}},y=>(y&&(a.setOptions({beforeClose:Ra}),a.close()),!0)),!1)}}),this.ctx.emit("quickEdit/wikiPage",{ctx:this.ctx,options:o,modal:a,wikiPage:l})}handleSubmit(e,n){const r=n.summary||"",i=n.text||"",s=n.minor||!1,o=n.createonly||!1,a=n.watchlist||st.nochange;return e.wikiPage.edit({summary:r,text:i,watchlist:a},{minor:s,createonly:o})}injectToolbox(e){e.toolbox.addButton({id:"quick-edit",group:"group1",index:0,icon:C("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-edit",children:[C("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),C("path",{d:"M7 7h-1a2 2 0 0 0 -2 2v9a2 2 0 0 0 2 2h9a2 2 0 0 0 2 -2v-1"}),C("path",{d:"M20.385 6.585a2.1 2.1 0 0 0 -2.97 -2.97l-8.415 8.385v3h3l8.385 -8.415z"}),C("path",{d:"M16 5l3 3"})]}),tooltip:"Edit this page quickly",onClick:()=>this.quickEdit()})}async getWikiPageFromPayload(e){if(e.revision)return this.ctx.wikiPage.newFromRevision(e.revision,e.section);if(e.pageId)return this.ctx.wikiPage.newFromPageId(e.pageId,e.section);if(e.title)return this.ctx.wikiPage.newFromTitle(e.title,!1,e.section);throw new Error("Invalid payload")}removeToolbox(e){e.toolbox.removeButton("quick-edit")}}bs=dh(Fa),Wr=yh(bs,0,"PluginQuickEdit",Ma,Wr),gh(bs,1,Wr);const bh=Object.freeze(Object.defineProperty({__proto__:null,get PluginQuickEdit(){return Wr}},Symbol.toStringTag,{value:"Module"})),Kn={twinSwapInput:"_twinSwapInput_1gdgl_9",inputWrapper:"_inputWrapper_1gdgl_23",inputLeft:"_inputLeft_1gdgl_27",inputRight:"_inputRight_1gdgl_30",swapButton:"_swapButton_1gdgl_46"},Ba=t=>{const{inputs:e,enableSwap:n=!0,...r}=t,i=e?.length===2?e:[e?.[0]??{},e?.[1]??{}],s=[null,null];let o=0,a=null,l=null;const u=()=>s.some(v=>v&&v.disabled),c=()=>{if(!s[0]||!s[1]||u())return;const v=s[0],I=s[1],z=v.value,F=I.value;v.value=F,I.value=z,v.dispatchEvent(new Event("change")),I.dispatchEvent(new Event("change")),o++,l&&(l.style.transform=`rotateY(${o*-180}deg)`,l.style.transition="transform 200ms ease")},f=v=>{if(!a)return;const I=v??!a.disabled;a.disabled=!I,I&&s.forEach(z=>{z&&(z.disabled=!1)})},w=C("button",{type:"button","aria-label":"Swap values",onClick:c,disabled:u()||!n,ref:v=>a=v,children:C("svg",{ref:v=>l=v,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon-tabler icons-tabler-outline icon-tabler-transfer",children:[C("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),C("path",{d:"M20 10h-16l5.5 -6"}),C("path",{d:"M4 14h16l-5.5 6"})]})}),y=C("div",{className:`twin-swap-input ${Kn.twinSwapInput}`,...r,children:[i.map((v,I)=>{const{label:z,id:F,name:A,value:g,disabled:m,inputProps:h}=v,O=I===0,P=F||A;return C("div",{className:`${Kn.inputWrapper} ${O?Kn.inputLeft:Kn.inputRight}`,children:[z&&C("label",{htmlFor:P,children:z}),C("input",{ref:R=>s[I]=R,type:"text",id:P,name:A,value:g,disabled:m,...h})]})}),C("div",{className:Kn.swapButton,children:w})]});return y.swap=c,y.toggleEnableSwap=f,y};var vh=Object.create,vs=Object.defineProperty,_h=Object.getOwnPropertyDescriptor,Ua=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),Ha=t=>{throw TypeError(t)},wh=(t,e,n)=>e in t?vs(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,xh=(t,e)=>vs(t,"name",{value:e,configurable:!0}),Sh=t=>[,,,vh(t?.[Ua("metadata")]??null)],Eh=["class","method","getter","setter","accessor","field","value","get","set"],Wa=t=>t!==void 0&&typeof t!="function"?Ha("Function expected"):t,Ch=(t,e,n,r,i)=>({kind:Eh[t],name:e,metadata:r,addInitializer:s=>n._?Ha("Already initialized"):i.push(Wa(s||null))}),Oh=(t,e)=>wh(e,Ua("metadata"),t[3]),kh=(t,e,n,r)=>{for(var i=0,s=t[e>>1],o=s&&s.length;i<o;i++)s[i].call(n);return r},Ph=(t,e,n,r,i,s)=>{var o,a,l,u=e&7,c=!1,f=0,w=t[f]||(t[f]=[]),y=u&&(i=i.prototype,u<5&&(u>3||!c)&&_h(i,n));xh(i,n);for(var v=r.length-1;v>=0;v--)l=Ch(u,n,a={},t[3],w),o=(0,r[v])(i,l),a._=1,Wa(o)&&(i=o);return Oh(t,i),y&&vs(i,n,y),c?u^4?s:y:i},qa,_s,za;qa=[Ve(["modal","sitemeta"])];class qr extends(za=gt){constructor(e){super(e,{},"quick-move"),this.ctx=e,e.set("quickMove",this.quickMove.bind(this)),e.set("movePage",this.movePage.bind(this))}start(){this.ctx.inject(["toolbox"],e=>{this.injectToolbox(e)})}injectToolbox(e){const n=window.mw?.config.get("wgPageName")||"",r=window.mw?.config.get("wgIsProbablyEditable");e.toolbox.addButton({id:"quick-move",icon:C("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-forms",children:[C("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),C("path",{d:"M12 3a3 3 0 0 0 -3 3v12a3 3 0 0 0 3 3"}),C("path",{d:"M6 3a3 3 0 0 1 3 3v12a3 3 0 0 1 -3 3"}),C("path",{d:"M13 7h7a1 1 0 0 1 1 1v8a1 1 0 0 1 -1 1h-7"}),C("path",{d:"M5 7h-1a1 1 0 0 0 -1 1v8a1 1 0 0 0 1 1h1"}),C("path",{d:"M17 12h.01"}),C("path",{d:"M13 12h.01"})]}),tooltip:"Quick Move",group:"group2",onClick:()=>{this.quickMove(r?{lockFromField:!0,from:n}:{})}})}quickMove(e){const n=this.ctx.modal.createObject({title:"Quick Move",content:C(Zt,{}),className:"quick-move",sizeClass:"medium",center:!0}).init();let r=null;return n.setContent(C("form",{ref:i=>r=i,style:{display:"flex",flexDirection:"column",gap:"1rem"},onSubmit:i=>{i.preventDefault();const s=new FormData(r),o={from:s.get("from"),to:s.get("to"),reason:s.get("reason")||"",movetalk:s.get("movetalk")==="on",movesubpages:s.get("movesubpages")==="on",noredirect:s.get("noredirect")==="on"};n.setLoadingState(!0),this.movePage(o).then(()=>{location.reload()}).catch(a=>{n.setLoadingState(!1),this.ctx.modal.notify("error",{title:"Failed to move",content:a instanceof Error?a.message:String(a)})})},children:[C(Ba,{inputs:[{label:"Move from",name:"from",value:e?.from},{label:"Move to",name:"to",value:e?.to}]}),C("div",{children:C(gn,{name:"movetalk",id:"movetalk",checked:e?.movetalk,children:"Move talk page"})}),C("div",{children:C(gn,{name:"movesubpages",id:"movesubpages",checked:e?.movesubpages,children:"Move subpage(s) (up to 100)"})}),this.ctx.sitemeta.hasRight("suppressredirect")&&C("div",{children:C(gn,{name:"noredirect",id:"noredirect",checked:e?.noredirect,children:"Move without leaving a redirect"})}),C(gs,{label:"Reason",id:"reason",name:"reason",value:e?.reason}),C("div",{children:C(Mr,{type:"primary",style:{width:"100%"},children:"Move"})})]})),n.show()}async movePage(e){const{from:n,to:r,reason:i="",...s}=e;if(!n||!r)throw new Error("From and to titles are required.");if(n===r)throw new Error("From and to titles cannot be the same.");return(await this.ctx.wikiPage.newFromTitle(n)).moveTo(r,i,s)}}_s=Sh(za),qr=Ph(_s,0,"PluginQuickMove",qa,qr),kh(_s,1,qr);const $h=Object.freeze(Object.defineProperty({__proto__:null,get PluginQuickMove(){return qr}},Symbol.toStringTag,{value:"Module"}));var Ah=Object.create,ws=Object.defineProperty,Ih=Object.getOwnPropertyDescriptor,Va=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),Ka=t=>{throw TypeError(t)},Th=(t,e,n)=>e in t?ws(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Rh=(t,e)=>ws(t,"name",{value:e,configurable:!0}),Dh=t=>[,,,Ah(t?.[Va("metadata")]??null)],Nh=["class","method","getter","setter","accessor","field","value","get","set"],Ya=t=>t!==void 0&&typeof t!="function"?Ka("Function expected"):t,jh=(t,e,n,r,i)=>({kind:Nh[t],name:e,metadata:r,addInitializer:s=>n._?Ka("Already initialized"):i.push(Ya(s||null))}),Lh=(t,e)=>Th(e,Va("metadata"),t[3]),Mh=(t,e,n,r)=>{for(var i=0,s=t[e>>1],o=s&&s.length;i<o;i++)s[i].call(n);return r},Fh=(t,e,n,r,i,s)=>{var o,a,l,u=e&7,c=!1,f=0,w=t[f]||(t[f]=[]),y=u&&(i=i.prototype,u<5&&(u>3||!c)&&Ih(i,n));Rh(i,n);for(var v=r.length-1;v>=0;v--)l=jh(u,n,a={},t[3],w),o=(0,r[v])(i,l),a._=1,Ya(o)&&(i=o);return Lh(t,i),y&&ws(i,n,y),c?u^4?s:y:i},Ga,xs,Ja;Ga=[Ve(["api","wikiPage","modal"])];class zr extends(Ja=gt){constructor(e){super(e,{},"quickPreview"),this.ctx=e}start(){this.ctx.set("quickPreview",this.quickPreview.bind(this)),this.ctx.on("quickEdit/wikiPage",this.injectQuickEdit.bind(this))}stop(){this.ctx.off("quickEdit/wikiPage",this.injectQuickEdit.bind(this))}injectQuickEdit({ctx:e,modal:n,wikiPage:r}){n.setButtons([{label:"Preview",side:"left",className:"btn btn-secondary",method:()=>{this.quickPreview(n.get$content().find("textarea.editArea").val()||"",void 0,r)}}])}async quickPreview(e,n,r){r||(r=this.ctx.wikiPage.newBlankPage({title:"API"}));const i=this.ctx.modal.createObject({className:"in-page-edit ipe-quickPreview",sizeClass:"large"}).init();i.setTitle("Preview loading..."),i.setContent(C("section",{children:C(Zt,{})})),i.show(),this.ctx.emit("quickPreview/showModal",{ctx:this.ctx,text:e,modal:i,wikiPage:r});const{data:{parse:s}}=await r.preview(e,n);i.setTitle(`Preview - ${s.title}`);let o=null;i.setContent(C("section",{children:C("div",{ref:a=>o=a,className:"mw-parser-output",innerHTML:s.text})})),window.mw?.hook("wikipage.content").fire($(o)),this.ctx.emit("quickPreview/loaded",{ctx:this.ctx,modal:i,wikiPage:r,text:e,parseData:s})}}xs=Dh(Ja),zr=Fh(xs,0,"PluginQuickPreview",Ga,zr),Mh(xs,1,zr);const Bh=Object.freeze(Object.defineProperty({__proto__:null,get PluginQuickPreview(){return zr}},Symbol.toStringTag,{value:"Module"}));class kt{diff(e,n,r={}){let i;typeof r=="function"?(i=r,r={}):"callback"in r&&(i=r.callback);const s=this.castInput(e,r),o=this.castInput(n,r),a=this.removeEmpty(this.tokenize(s,r)),l=this.removeEmpty(this.tokenize(o,r));return this.diffWithOptionsObj(a,l,r,i)}diffWithOptionsObj(e,n,r,i){var s;const o=A=>{if(A=this.postProcess(A,r),i){setTimeout(function(){i(A)},0);return}else return A},a=n.length,l=e.length;let u=1,c=a+l;r.maxEditLength!=null&&(c=Math.min(c,r.maxEditLength));const f=(s=r.timeout)!==null&&s!==void 0?s:1/0,w=Date.now()+f,y=[{oldPos:-1,lastComponent:void 0}];let v=this.extractCommon(y[0],n,e,0,r);if(y[0].oldPos+1>=l&&v+1>=a)return o(this.buildValues(y[0].lastComponent,n,e));let I=-1/0,z=1/0;const F=()=>{for(let A=Math.max(I,-u);A<=Math.min(z,u);A+=2){let g;const m=y[A-1],h=y[A+1];m&&(y[A-1]=void 0);let O=!1;if(h){const R=h.oldPos-A;O=h&&0<=R&&R<a}const P=m&&m.oldPos+1<l;if(!O&&!P){y[A]=void 0;continue}if(!P||O&&m.oldPos<h.oldPos?g=this.addToPath(h,!0,!1,0,r):g=this.addToPath(m,!1,!0,1,r),v=this.extractCommon(g,n,e,A,r),g.oldPos+1>=l&&v+1>=a)return o(this.buildValues(g.lastComponent,n,e))||!0;y[A]=g,g.oldPos+1>=l&&(z=Math.min(z,A-1)),v+1>=a&&(I=Math.max(I,A+1))}u++};if(i)(function A(){setTimeout(function(){if(u>c||Date.now()>w)return i(void 0);F()||A()},0)})();else for(;u<=c&&Date.now()<=w;){const A=F();if(A)return A}}addToPath(e,n,r,i,s){const o=e.lastComponent;return o&&!s.oneChangePerToken&&o.added===n&&o.removed===r?{oldPos:e.oldPos+i,lastComponent:{count:o.count+1,added:n,removed:r,previousComponent:o.previousComponent}}:{oldPos:e.oldPos+i,lastComponent:{count:1,added:n,removed:r,previousComponent:o}}}extractCommon(e,n,r,i,s){const o=n.length,a=r.length;let l=e.oldPos,u=l-i,c=0;for(;u+1<o&&l+1<a&&this.equals(r[l+1],n[u+1],s);)u++,l++,c++,s.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return c&&!s.oneChangePerToken&&(e.lastComponent={count:c,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=l,u}equals(e,n,r){return r.comparator?r.comparator(e,n):e===n||!!r.ignoreCase&&e.toLowerCase()===n.toLowerCase()}removeEmpty(e){const n=[];for(let r=0;r<e.length;r++)e[r]&&n.push(e[r]);return n}castInput(e,n){return e}tokenize(e,n){return Array.from(e)}join(e){return e.join("")}postProcess(e,n){return e}get useLongestToken(){return!1}buildValues(e,n,r){const i=[];let s;for(;e;)i.push(e),s=e.previousComponent,delete e.previousComponent,e=s;i.reverse();const o=i.length;let a=0,l=0,u=0;for(;a<o;a++){const c=i[a];if(c.removed)c.value=this.join(r.slice(u,u+c.count)),u+=c.count;else{if(!c.added&&this.useLongestToken){let f=n.slice(l,l+c.count);f=f.map(function(w,y){const v=r[u+y];return v.length>w.length?v:w}),c.value=this.join(f)}else c.value=this.join(n.slice(l,l+c.count));l+=c.count,c.added||(u+=c.count)}}return i}}class Uh extends kt{}const Qa=new Uh;function Xa(t,e,n){return Qa.diff(t,e,n)}function Za(t,e){let n;for(n=0;n<t.length&&n<e.length;n++)if(t[n]!=e[n])return t.slice(0,n);return t.slice(0,n)}function el(t,e){let n;if(!t||!e||t[t.length-1]!=e[e.length-1])return"";for(n=0;n<t.length&&n<e.length;n++)if(t[t.length-(n+1)]!=e[e.length-(n+1)])return t.slice(-n);return t.slice(-n)}function Ss(t,e,n){if(t.slice(0,e.length)!=e)throw Error(`string ${JSON.stringify(t)} doesn't start with prefix ${JSON.stringify(e)}; this is a bug`);return n+t.slice(e.length)}function Es(t,e,n){if(!e)return t+n;if(t.slice(-e.length)!=e)throw Error(`string ${JSON.stringify(t)} doesn't end with suffix ${JSON.stringify(e)}; this is a bug`);return t.slice(0,-e.length)+n}function Yn(t,e){return Ss(t,e,"")}function Vr(t,e){return Es(t,e,"")}function tl(t,e){return e.slice(0,Hh(t,e))}function Hh(t,e){let n=0;t.length>e.length&&(n=t.length-e.length);let r=e.length;t.length<e.length&&(r=t.length);const i=Array(r);let s=0;i[0]=0;for(let o=1;o<r;o++){for(e[o]==e[s]?i[o]=i[s]:i[o]=s;s>0&&e[o]!=e[s];)s=i[s];e[o]==e[s]&&s++}s=0;for(let o=n;o<t.length;o++){for(;s>0&&t[o]!=e[s];)s=i[s];t[o]==e[s]&&s++}return s}function Wh(t){return t.includes(`\r
67
+ /____/ v`+e.version)}function Rd(t,e){const n=Symbol.for(t);return window[n]?!1:(window[n]=!0,e(),!0)}const Td=window?.location?.origin,Br=({type:t,tag:e,href:n,target:r,children:i,...s})=>(e=e||(n?"a":"button"),typeof r>"u"&&n&&n.startsWith("http")&&!n.startsWith(Td)&&(r="_blank"),ud(e,{className:`theme-ipe ipe-action-button btn btn-${t||"default"}`,href:e==="a"?n:void 0,target:e==="a"?r:void 0,"data-href":e!=="a"?n:void 0,...s},i));var Dd=Object.create,ds=Object.defineProperty,Nd=Object.getOwnPropertyDescriptor,ya=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),va=t=>{throw TypeError(t)},Ld=(t,e,n)=>e in t?ds(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,jd=(t,e)=>ds(t,"name",{value:e,configurable:!0}),Md=t=>[,,,Dd(t?.[ya("metadata")]??null)],Fd=["class","method","getter","setter","accessor","field","value","get","set"],ba=t=>t!==void 0&&typeof t!="function"?va("Function expected"):t,Bd=(t,e,n,r,i)=>({kind:Fd[t],name:e,metadata:r,addInitializer:s=>n._?va("Already initialized"):i.push(ba(s||null))}),Ud=(t,e)=>Ld(e,ya("metadata"),t[3]),Hd=(t,e,n,r)=>{for(var i=0,s=t[e>>1],o=s&&s.length;i<o;i++)s[i].call(n);return r},Wd=(t,e,n,r,i,s)=>{var o,a,l,u=e&7,c=!1,f=0,w=t[f]||(t[f]=[]),y=u&&(i=i.prototype,u<5&&(u>3||!c)&&Nd(i,n));jd(i,n);for(var v=r.length-1;v>=0;v--)l=Bd(u,n,a={},t[3],w),o=(0,r[v])(i,l),a._=1,ba(o)&&(i=o);return Ud(t,i),y&&ds(i,n,y),c?u^4?s:y:i},_a,hs,wa;_a=[Ve(["sitemeta","storage"])];class Ur extends(wa=gt){constructor(e){super(e,{},"preferences"),this.ctx=e,this.db=void 0,this.customRegistries=[],this.categoryDefinitions=[],this._defaultPreferences={},this.db=e.storage.createDatabse("preferences",1/0),this.ctx.set("preferences",this)}async start(){this.defineCategory({name:"general",label:"General",description:"General settings"}),this.defineCategory({name:"edit",label:"Editing",description:"Settings related to editing content"}),this.defineCategory({name:"about",label:"About",description:"About InPageEdit",index:99}),this.registerCustomConfig("about",xe.object({about:xe.string().role("html-info").description(O("div",{className:"prose",children:[O("h2",{children:"✏️ InPageEdit NEXT"}),O("i",{children:["v",this.ctx.version]}),O("h2",{children:"Portal"}),O("div",{style:"display: flex; flex-direction: column; gap: 1rem",children:[O(Br,{href:"https://www.ipe.wiki",style:{display:"block",width:"100%"},children:"Official Website & Help Center"}),O(Br,{href:"https://www.ipe.wiki/update/",style:{display:"block",width:"100%"},children:"Update Logs"})]}),O("h2",{children:"Join us"}),O("ul",{children:[O("li",{children:[O("strong",{children:"GitHub"}),":"," ",O("a",{href:"https://github.com/inpageedit/inpageedit-next",target:"_blank",children:"inpageedit/inpageedit-next"})]}),O("li",{children:[O("strong",{children:"QQ Group"}),": 1026023666"]})]}),O("hr",{}),O("p",{children:"🚀 Modular, Extensible Supercharged Plugin for MediaWiki."}),O("p",{children:"InPageEdit-NEXT Copyright © 2025-present dragon-fish"})]}).outerHTML).default("")}).description(""),"about",{}),Promise.resolve().then(()=>Ty).then(e=>{const n=this.ctx.plugin(e.PluginPreferencesUI);this.addDisposeHandler(()=>{n.dispose()})})}get(e,n){return n||(n=()=>{const i=this.getDefaultValue(e);return this.logger.info("default value used",i),i}),this.db.get(e,void 0,n)}getDefaultValue(e){var n;return(n=this._defaultPreferences)[e]??(n[e]=this.loadDefaultConfigs()[e])}set(e,n){const r=this.getDefaultValue(e);return n===r?this.db.delete(e):this.db.set(e,n)}async getAll(){const e=this.loadDefaultConfigs();return await this.db.iterate((n,r)=>{e[r]=n}),e}loadDefaultConfigs(){const e={};return this.getConfigRegistries().forEach(n=>{n.defaults&&Object.entries(n.defaults).forEach(([r,i])=>{e[r]=i,this._defaultPreferences[r]=i})}),e}registerCustomConfig(e,n,r,i){return this.customRegistries.push({name:e,schema:n,category:r,defaults:i}),this}getConfigRegistries(e){return Array.from(this.ctx.registry.entries()).map(([n,r])=>n===null?{name:"root",schema:en?.PreferencesSchema||null,defaults:en?.PreferencesDefaults||{}}:{name:n.name,schema:n?.PreferencesSchema||null,defaults:n?.PreferencesDefaults||{}}).filter(n=>n.schema!==null).map(n=>({...n,category:n.schema.meta.category||"general"})).concat(this.customRegistries).filter(n=>!e||n.category===e)}defineCategory(e){const n=this.categoryDefinitions.findIndex(r=>r.name===e.name);return n<0?this.categoryDefinitions.push(e):this.categoryDefinitions[n]=e,this.categoryDefinitions.sort((r,i)=>(r.index??0)-(i.index??0)),this}getConfigCategories(){return this.categoryDefinitions}}hs=Md(wa),Ur=Wd(hs,0,"PluginPreferences",_a,Ur),Hd(hs,1,Ur);const qd=Object.freeze(Object.defineProperty({__proto__:null,get PluginPreferences(){return Ur}},Symbol.toStringTag,{value:"Module"}));var st=(t=>(t.preferences="preferences",t.watch="watch",t.unwatch="unwatch",t.nochange="nochange",t))(st||{});function Hr(t,e){return function(n){return n.PreferencesSchema=t,n.PreferencesDefaults=e,n}}var zd=Object.create,ps=Object.defineProperty,Vd=Object.getOwnPropertyDescriptor,xa=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),Sa=t=>{throw TypeError(t)},Kd=(t,e,n)=>e in t?ps(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Gd=(t,e)=>ps(t,"name",{value:e,configurable:!0}),Yd=t=>[,,,zd(t?.[xa("metadata")]??null)],Jd=["class","method","getter","setter","accessor","field","value","get","set"],Ea=t=>t!==void 0&&typeof t!="function"?Sa("Function expected"):t,Qd=(t,e,n,r,i)=>({kind:Jd[t],name:e,metadata:r,addInitializer:s=>n._?Sa("Already initialized"):i.push(Ea(s||null))}),Xd=(t,e)=>Kd(e,xa("metadata"),t[3]),Zd=(t,e,n,r)=>{for(var i=0,s=t[e>>1],o=s&&s.length;i<o;i++)s[i].call(n);return r},eh=(t,e,n,r,i,s)=>{var o,a,l,u=e&7,c=!1,f=0,w=t[f]||(t[f]=[]),y=u&&(i=i.prototype,u<5&&(u>3||!c)&&Vd(i,n));Gd(i,n);for(var v=r.length-1;v>=0;v--)l=Qd(u,n,a={},t[3],w),o=(0,r[v])(i,l),a._=1,Ea(o)&&(i=o);return Xd(t,i),y&&ps(i,n,y),c?u^4?s:y:i},Oa,ms,Pa;Oa=[Ve(["sitemeta","quickEdit"]),Hr(xe.object({redLinkEdit:xe.boolean().description("Show quick edit entry after red links").default(!0)}).description("In-article quick edit links"),{redLinkEdit:!0})];class Wr extends(Pa=gt){constructor(e){const n=e.sitemeta.mwConfig,r=n.wgArticlePath.replace("$1",""),i=`${location.protocol}//${n.wgServer.split("//")[1]}`;super(e,{wikiBaseUrl:i,wikiArticlePath:r,wikiArticleBaseUrl:`${i}${r}`,wikiScriptBaseUrl:`${i}${n.wgScriptPath}`,linkClassName:"ipe-quickEdit__in-article-link"},"QuickEditInArticleLinks")}async start(){mw.hook("wikipage.content").add(()=>{document.querySelectorAll("#mw-content-text a[href]").forEach(n=>{const r=this.checkEditAnchor(n);if(!r||n.dataset.ipeQuickEditLink)return;const i=O("a",{href:`#/IPE/quickEdit/${r.title}`,className:this.config.linkClassName,style:{userSelect:"none",marginLeft:"0.2em",verticalAlign:"middle"},onClick:s=>{s.preventDefault(),this.ctx.quickEdit(r)},children:O("svg",{style:"width: 1em; height: 1em",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-pencil-bolt",children:[O("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),O("path",{d:"M4 20h4l10.5 -10.5a2.828 2.828 0 1 0 -4 -4l-10.5 10.5v4"}),O("path",{d:"M13.5 6.5l4 4"}),O("path",{d:"M19 16l-2 3h4l-2 3"})]})});n.insertAdjacentElement("afterend",i),n.dataset.ipeQuickEditLink="true"})})}stop(){document.querySelectorAll(`.${this.config.linkClassName}`).forEach(e=>e.remove())}checkEditAnchor(e){if(!(e instanceof HTMLAnchorElement))return null;const n=e.href||"";if(!n.startsWith(this.config.wikiArticleBaseUrl)&&!n.startsWith(this.config.wikiScriptBaseUrl))return null;const r=new URL(n),i=r.searchParams,s=i.get("action")||"view",o=i.get("title")||decodeURI(r.pathname.substring(this.config.wikiArticlePath.length))||"",a=i.get("section")?.replace(/^T-/,"")||void 0,l=i.get("oldid");if(!o||o.endsWith(".php")||!["edit","editsource","editredlink","submit"].includes(s)||i.get("undo")||i.get("preload"))return null;let u;return a==="new"?u="new":a&&/^\d+$/.test(a)&&(u=parseInt(a,10)),{title:o,section:u,revision:parseInt(""+l,10)||0,createOnly:!!i.get("redlink")}}}ms=Yd(Pa),Wr=eh(ms,0,"PluginQuickEditInArticleLinks",Oa,Wr),Zd(ms,1,Wr);const qr={mbox:"_mbox_v5fz5_1",title:"_title_v5fz5_12",content:"_content_v5fz5_19",close:"_close_v5fz5_27"},Ca=t=>{const{type:e="default",title:n,content:r,closeable:i=!0,titleProps:s,contentProps:o,children:a,...l}=t;let u=n;typeof n>"u"&&e!=="default"&&(u=e[0].toUpperCase()+e.slice(1).toLowerCase());const c=async()=>{if(!f)return Promise.resolve();const{promise:w,resolve:y}=Promise.withResolvers();return f.animate([{opacity:"1",height:f.clientHeight+"px"},{opacity:"0",height:"0px",margin:"0px"}],{duration:300,easing:"ease"}).addEventListener("finish",()=>{f.remove(),y()}),w},f=O("div",{className:`theme-ipe ipe-mbox mbox-type-${e||"default"} ${qr.mbox}`,...l,children:[u&&O("div",{className:`ipe-mbox-title ${qr.title}`,...s,children:u}),O("div",{className:`ipe-mbox-content ${qr.content}`,...o,children:a||r}),i&&O("a",{onClick:c,className:`ipe-mbox-close ${qr.close}`,children:"×"})]});return f.close=c,f},gs=t=>{const{label:e,id:n,name:r,value:i,disabled:s,labelProps:o,inputProps:a,...l}=t;return O("div",{className:"theme-ipe ipe-input-box",...l,children:[O("label",{htmlFor:n,style:{display:"block"},...o,children:e}),O("input",{id:n,name:r,value:i,disabled:s,style:{width:"100%"},...a})]})},ka=t=>{const{id:e,name:n,value:r,label:i,inputProps:s,labelProps:o,children:a,...l}=t;return O("label",{className:"theme-ipe ipe-radio-box",...l,children:[O("input",{type:"radio",id:e,name:n,value:r,...s}),O("span",{className:"ipe-checkbox-box"}),O("span",{...o,children:i||a})]})},gn=t=>{const{id:e,name:n,label:r,checked:i,inputProps:s,labelProps:o,children:a,...l}=t;return O("label",{className:"theme-ipe ipe-checkbox",...l,children:[O("input",{type:"checkbox",id:e,name:n,checked:i,...s}),O("span",{className:"ipe-checkbox-box"}),O("span",{...o,children:r||a})]})},$a=()=>{},Aa=(t=0)=>new Promise(e=>setTimeout(e,t));var th=Object.create,ys=Object.defineProperty,nh=Object.getOwnPropertyDescriptor,Ia=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),Ra=t=>{throw TypeError(t)},rh=(t,e,n)=>e in t?ys(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,ih=(t,e)=>ys(t,"name",{value:e,configurable:!0}),sh=t=>[,,,th(t?.[Ia("metadata")]??null)],oh=["class","method","getter","setter","accessor","field","value","get","set"],Ta=t=>t!==void 0&&typeof t!="function"?Ra("Function expected"):t,ah=(t,e,n,r,i)=>({kind:oh[t],name:e,metadata:r,addInitializer:s=>n._?Ra("Already initialized"):i.push(Ta(s||null))}),lh=(t,e)=>rh(e,Ia("metadata"),t[3]),ch=(t,e,n,r)=>{for(var i=0,s=t[e>>1],o=s&&s.length;i<o;i++)s[i].call(n);return r},uh=(t,e,n,r,i,s)=>{var o,a,l,u=e&7,c=!1,f=0,w=t[f]||(t[f]=[]),y=u&&(i=i.prototype,u<5&&(u>3||!c)&&nh(i,n));ih(i,n);for(var v=r.length-1;v>=0;v--)l=ah(u,n,a={},t[3],w),o=(0,r[v])(i,l),a._=1,Ta(o)&&(i=o);return lh(t,i),y&&ys(i,n,y),c?u^4?s:y:i},Da,vs,Na;Da=[Ve(["api","wikiPage","modal","preferences"]),Hr(xe.object({editSummary:xe.string().description("Default edit summary for quick edits").default("[IPE-NEXT] Quick edit"),editMinor:xe.boolean().description("Whether to mark the edit as minor").default(!1),outSideClose:xe.boolean().description("Whether to close the modal outside").default(!0),watchList:xe.union([xe.const(st.preferences).description("Follow my preferences"),xe.const(st.nochange).description("Keep the current watchlist status"),xe.const(st.watch).description("Add the page to watchlist"),xe.const(st.unwatch).description("Remove the page from watchlist")]).description("Watchlist options").default(st.preferences)}).description("Quick edit options").extra("category","edit"),{editSummary:"[IPE-NEXT] Quick edit",editMinor:!1,outSideClose:!0,watchList:st.preferences})];class zr extends(Na=gt){constructor(e){super(e,{},"quick-edit"),this.ctx=e,this.DEFAULT_OPTIONS={title:"",pageId:0,revision:0,section:void 0,editMinor:!1,editSummary:"",createOnly:!1,reloadAfterSave:!0}}start(){this.ctx.root.set("quickEdit",this.quickEdit.bind(this)),this.ctx.inject(["toolbox"],e=>{this.injectToolbox(e),e.on("dispose",()=>{this.removeToolbox(e)})}),this.ctx.plugin(Wr)}async quickEdit(e){typeof e>"u"?e={}:typeof e=="string"&&(e={title:e}),e?.page&&(e.title=e.page,delete e.page),!e.title&&!e.pageId&&!e.revision&&(this.logger.warn("None of the title, pageId or revision provided. Using defaults."),e={...e,title:mw.config.get("wgPageName"),pageId:mw.config.get("wgArticleId"),revision:mw.config.get("wgRevisionId")});const n=await this.ctx.preferences.get("outSideClose"),r=await this.ctx.preferences.get("watchList"),i=typeof e.editSummary=="string"?e.editSummary:await this.ctx.preferences.get("editSummary"),s=typeof e.editMinor=="boolean"?e.editMinor:await this.ctx.preferences.get("editMinor"),o={...this.DEFAULT_OPTIONS,editSummary:i,editMinor:s,...e};o.editSummary||(o.editSummary=await this.ctx.preferences.get("editSummary")||""),o||this.ctx.emit("quickEdit/initOptions",{ctx:this.ctx,options:o});const a=this.ctx.modal.createObject({className:"in-page-edit ipe-quickEdit ipe-editor",sizeClass:"large",outSideClose:n}).init();a.setTitle(O(Tr,{children:["Loading: ",O("u",{children:o.title})]})),a.setContent(O("section",{className:"ipe-quickEdit-loading",style:{height:"70vh",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"},children:O(Zt,{})})),a.setButtons([{side:"right",type:"button",className:"btn btn-danger btn-secondary",label:"Cancel",method(){a.close()}}]),a.show(),this.ctx.emit("quickEdit/showModal",{ctx:this.ctx,modal:a,options:o});let l;try{l=await this.getWikiPageFromPayload(o)}catch(f){a.close(),this.ctx.modal.notify("error",{title:"Error",content:f instanceof Error?f.message:String(f)});return}a.setTitle(O(Tr,{children:["Quick ",l.pageInfo.pageid===0?"Create":"Edit",":"," ",O("u",{children:l.pageInfo.title})]}));const u=O("form",{className:"ipe-quickEdit-form",children:[l.pageInfo.pageid===0&&O(Ca,{title:"Attention",type:"important",children:O("p",{children:"This page does not exist."})}),O("textarea",{className:"editArea",name:"text",id:"wpTextbox1",children:l.revisions[0]?.content||""}),O("div",{class:"ipe-quickEdit-options",style:{display:"flex",flexDirection:"column",gap:"1rem"},children:[O(gs,{label:"Summary",id:"summary",name:"summary",value:o.editSummary}),O("div",{children:[O("label",{htmlFor:"watchlist",style:{display:"block"},children:"Watchlist"}),O("div",{style:{display:"flex",gap:"1rem"},children:[st.preferences,st.nochange,st.watch,st.unwatch].map(f=>O(ka,{name:"watchlist",value:f,inputProps:{checked:r===f},children:f},f))})]}),O("div",{style:{display:"flex",gap:"1rem"},children:[O(gn,{name:"minor",id:"minor",checked:o.editMinor,children:"Minor edit"}),O(gn,{name:"reloadAfterSave",id:"reloadAfterSave",checked:o.reloadAfterSave,children:"Reload after save"})]})]}),!1]});a.setContent(u);const c=a.generateButton({side:"left",className:"btn btn-primary submit-btn",label:"Submit",method:()=>{const f=new FormData(u);console.info(l,u,{text:f.get("text"),summary:f.get("summary"),minor:f.get("minor")==="on"}),a.setLoadingState(!0),this.handleSubmit({ctx:this.ctx,modal:a,wikiPage:l,options:o},{text:f.get("text"),summary:f.get("summary"),minor:f.get("minor")==="on"}).then(async()=>{a.setOptions({beforeClose:$a}),a.close(),this.ctx.modal.notify("success",{title:"Submission Successful",content:"Your changes have been saved."}),f.get("reloadAfterSave")&&(await Aa(500),location.reload())}).catch(w=>{this.ctx.modal.notify("error",{title:"Submission Error",content:w instanceof Error?w.message:String(w)}),a.setLoadingState(!1)})}});a.get$buttons("leftButtons").prepend(c),a.setOptions({beforeClose:()=>{const f=l.revisions[0]?.content||"";return(u.querySelector("textarea")?.value||"")===f?!0:(this.ctx.modal.confirm({className:"in-page-edit",title:"Unsaved Changes",content:"All edit contents will be lost after closing the modal. Are you sure you want to close?",center:!0,okBtn:{label:"Give Up",className:"btn btn-danger"},cancelBtn:{label:"Continue",className:"btn"}},y=>(y&&(a.setOptions({beforeClose:$a}),a.close()),!0)),!1)}}),this.ctx.emit("quickEdit/wikiPage",{ctx:this.ctx,options:o,modal:a,wikiPage:l})}handleSubmit(e,n){const r=n.summary||"",i=n.text||"",s=n.minor||!1,o=n.createonly||!1,a=n.watchlist||st.nochange;return e.wikiPage.edit({summary:r,text:i,watchlist:a},{minor:s,createonly:o})}injectToolbox(e){e.toolbox.addButton({id:"quick-edit",group:"group1",index:0,icon:O("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-edit",children:[O("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),O("path",{d:"M7 7h-1a2 2 0 0 0 -2 2v9a2 2 0 0 0 2 2h9a2 2 0 0 0 2 -2v-1"}),O("path",{d:"M20.385 6.585a2.1 2.1 0 0 0 -2.97 -2.97l-8.415 8.385v3h3l8.385 -8.415z"}),O("path",{d:"M16 5l3 3"})]}),tooltip:"Edit this page quickly",onClick:()=>this.quickEdit()})}async getWikiPageFromPayload(e){if(e.revision)return this.ctx.wikiPage.newFromRevision(e.revision,e.section);if(e.pageId)return this.ctx.wikiPage.newFromPageId(e.pageId,e.section);if(e.title)return this.ctx.wikiPage.newFromTitle(e.title,!1,e.section);throw new Error("Invalid payload")}removeToolbox(e){e.toolbox.removeButton("quick-edit")}}vs=sh(Na),zr=uh(vs,0,"PluginQuickEdit",Da,zr),ch(vs,1,zr);const fh=Object.freeze(Object.defineProperty({__proto__:null,get PluginQuickEdit(){return zr}},Symbol.toStringTag,{value:"Module"})),Kn={twinSwapInput:"_twinSwapInput_1gdgl_9",inputWrapper:"_inputWrapper_1gdgl_23",inputLeft:"_inputLeft_1gdgl_27",inputRight:"_inputRight_1gdgl_30",swapButton:"_swapButton_1gdgl_46"},La=t=>{const{inputs:e,enableSwap:n=!0,...r}=t,i=e?.length===2?e:[e?.[0]??{},e?.[1]??{}],s=[null,null];let o=0,a=null,l=null;const u=()=>s.some(v=>v&&v.disabled),c=()=>{if(!s[0]||!s[1]||u())return;const v=s[0],I=s[1],z=v.value,F=I.value;v.value=F,I.value=z,v.dispatchEvent(new Event("change")),I.dispatchEvent(new Event("change")),o++,l&&(l.style.transform=`rotateY(${o*-180}deg)`,l.style.transition="transform 200ms ease")},f=v=>{if(!a)return;const I=v??!a.disabled;a.disabled=!I,I&&s.forEach(z=>{z&&(z.disabled=!1)})},w=O("button",{type:"button","aria-label":"Swap values",onClick:c,disabled:u()||!n,ref:v=>a=v,children:O("svg",{ref:v=>l=v,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon-tabler icons-tabler-outline icon-tabler-transfer",children:[O("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),O("path",{d:"M20 10h-16l5.5 -6"}),O("path",{d:"M4 14h16l-5.5 6"})]})}),y=O("div",{className:`twin-swap-input ${Kn.twinSwapInput}`,...r,children:[i.map((v,I)=>{const{label:z,id:F,name:A,value:g,disabled:m,inputProps:h}=v,P=I===0,k=F||A;return O("div",{className:`${Kn.inputWrapper} ${P?Kn.inputLeft:Kn.inputRight}`,children:[z&&O("label",{htmlFor:k,children:z}),O("input",{ref:T=>s[I]=T,type:"text",id:k,name:A,value:g,disabled:m,...h})]})}),O("div",{className:Kn.swapButton,children:w})]});return y.swap=c,y.toggleEnableSwap=f,y};var dh=Object.create,bs=Object.defineProperty,hh=Object.getOwnPropertyDescriptor,ja=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),Ma=t=>{throw TypeError(t)},ph=(t,e,n)=>e in t?bs(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,mh=(t,e)=>bs(t,"name",{value:e,configurable:!0}),gh=t=>[,,,dh(t?.[ja("metadata")]??null)],yh=["class","method","getter","setter","accessor","field","value","get","set"],Fa=t=>t!==void 0&&typeof t!="function"?Ma("Function expected"):t,vh=(t,e,n,r,i)=>({kind:yh[t],name:e,metadata:r,addInitializer:s=>n._?Ma("Already initialized"):i.push(Fa(s||null))}),bh=(t,e)=>ph(e,ja("metadata"),t[3]),_h=(t,e,n,r)=>{for(var i=0,s=t[e>>1],o=s&&s.length;i<o;i++)s[i].call(n);return r},wh=(t,e,n,r,i,s)=>{var o,a,l,u=e&7,c=!1,f=0,w=t[f]||(t[f]=[]),y=u&&(i=i.prototype,u<5&&(u>3||!c)&&hh(i,n));mh(i,n);for(var v=r.length-1;v>=0;v--)l=vh(u,n,a={},t[3],w),o=(0,r[v])(i,l),a._=1,Fa(o)&&(i=o);return bh(t,i),y&&bs(i,n,y),c?u^4?s:y:i},Ba,_s,Ua;Ba=[Ve(["modal","sitemeta"])];class Vr extends(Ua=gt){constructor(e){super(e,{},"quick-move"),this.ctx=e,e.set("quickMove",this.quickMove.bind(this)),e.set("movePage",this.movePage.bind(this))}start(){this.ctx.inject(["toolbox"],e=>{this.injectToolbox(e)})}injectToolbox(e){const n=window.mw?.config.get("wgPageName")||"",r=window.mw?.config.get("wgIsProbablyEditable");e.toolbox.addButton({id:"quick-move",icon:O("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-forms",children:[O("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),O("path",{d:"M12 3a3 3 0 0 0 -3 3v12a3 3 0 0 0 3 3"}),O("path",{d:"M6 3a3 3 0 0 1 3 3v12a3 3 0 0 1 -3 3"}),O("path",{d:"M13 7h7a1 1 0 0 1 1 1v8a1 1 0 0 1 -1 1h-7"}),O("path",{d:"M5 7h-1a1 1 0 0 0 -1 1v8a1 1 0 0 0 1 1h1"}),O("path",{d:"M17 12h.01"}),O("path",{d:"M13 12h.01"})]}),tooltip:"Quick Move",group:"group2",onClick:()=>{this.quickMove(r?{lockFromField:!0,from:n}:{})}})}quickMove(e){const n=this.ctx.modal.createObject({title:"Quick Move",content:O(Zt,{}),className:"quick-move",sizeClass:"medium",center:!0}).init();let r=null;return n.setContent(O("form",{ref:i=>r=i,style:{display:"flex",flexDirection:"column",gap:"1rem"},onSubmit:i=>{i.preventDefault();const s=new FormData(r),o={from:s.get("from"),to:s.get("to"),reason:s.get("reason")||"",movetalk:s.get("movetalk")==="on",movesubpages:s.get("movesubpages")==="on",noredirect:s.get("noredirect")==="on"};n.setLoadingState(!0),this.movePage(o).then(()=>{location.reload()}).catch(a=>{n.setLoadingState(!1),this.ctx.modal.notify("error",{title:"Failed to move",content:a instanceof Error?a.message:String(a)})})},children:[O(La,{inputs:[{label:"Move from",name:"from",value:e?.from},{label:"Move to",name:"to",value:e?.to}]}),O("div",{children:O(gn,{name:"movetalk",id:"movetalk",checked:e?.movetalk,children:"Move talk page"})}),O("div",{children:O(gn,{name:"movesubpages",id:"movesubpages",checked:e?.movesubpages,children:"Move subpage(s) (up to 100)"})}),this.ctx.sitemeta.hasRight("suppressredirect")&&O("div",{children:O(gn,{name:"noredirect",id:"noredirect",checked:e?.noredirect,children:"Move without leaving a redirect"})}),O(gs,{label:"Reason",id:"reason",name:"reason",value:e?.reason}),O("div",{children:O(Br,{type:"primary",style:{width:"100%"},children:"Move"})})]})),n.show()}async movePage(e){const{from:n,to:r,reason:i="",...s}=e;if(!n||!r)throw new Error("From and to titles are required.");if(n===r)throw new Error("From and to titles cannot be the same.");return(await this.ctx.wikiPage.newFromTitle(n)).moveTo(r,i,s)}}_s=gh(Ua),Vr=wh(_s,0,"PluginQuickMove",Ba,Vr),_h(_s,1,Vr);const xh=Object.freeze(Object.defineProperty({__proto__:null,get PluginQuickMove(){return Vr}},Symbol.toStringTag,{value:"Module"}));var Sh=Object.create,ws=Object.defineProperty,Eh=Object.getOwnPropertyDescriptor,Ha=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),Wa=t=>{throw TypeError(t)},Oh=(t,e,n)=>e in t?ws(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Ph=(t,e)=>ws(t,"name",{value:e,configurable:!0}),Ch=t=>[,,,Sh(t?.[Ha("metadata")]??null)],kh=["class","method","getter","setter","accessor","field","value","get","set"],qa=t=>t!==void 0&&typeof t!="function"?Wa("Function expected"):t,$h=(t,e,n,r,i)=>({kind:kh[t],name:e,metadata:r,addInitializer:s=>n._?Wa("Already initialized"):i.push(qa(s||null))}),Ah=(t,e)=>Oh(e,Ha("metadata"),t[3]),Ih=(t,e,n,r)=>{for(var i=0,s=t[e>>1],o=s&&s.length;i<o;i++)s[i].call(n);return r},Rh=(t,e,n,r,i,s)=>{var o,a,l,u=e&7,c=!1,f=0,w=t[f]||(t[f]=[]),y=u&&(i=i.prototype,u<5&&(u>3||!c)&&Eh(i,n));Ph(i,n);for(var v=r.length-1;v>=0;v--)l=$h(u,n,a={},t[3],w),o=(0,r[v])(i,l),a._=1,qa(o)&&(i=o);return Ah(t,i),y&&ws(i,n,y),c?u^4?s:y:i},za,xs,Va;za=[Ve(["api","wikiPage","modal"])];class Kr extends(Va=gt){constructor(e){super(e,{},"quickPreview"),this.ctx=e}start(){this.ctx.set("quickPreview",this.quickPreview.bind(this)),this.ctx.on("quickEdit/wikiPage",this.injectQuickEdit.bind(this))}stop(){this.ctx.off("quickEdit/wikiPage",this.injectQuickEdit.bind(this))}injectQuickEdit({ctx:e,modal:n,wikiPage:r}){n.setButtons([{label:"Preview",side:"left",className:"btn btn-secondary",method:()=>{this.quickPreview(n.get$content().find("textarea.editArea").val()||"",void 0,r)}}])}async quickPreview(e,n,r){r||(r=this.ctx.wikiPage.newBlankPage({title:"API"}));const i=this.ctx.modal.createObject({className:"in-page-edit ipe-quickPreview",sizeClass:"large"}).init();i.setTitle("Preview loading..."),i.setContent(O("section",{children:O(Zt,{})})),i.show(),this.ctx.emit("quickPreview/showModal",{ctx:this.ctx,text:e,modal:i,wikiPage:r});const{data:{parse:s}}=await r.preview(e,n);i.setTitle(`Preview - ${s.title}`);let o=null;i.setContent(O("section",{children:O("div",{ref:a=>o=a,className:"mw-parser-output",innerHTML:s.text})})),window.mw?.hook("wikipage.content").fire($(o)),this.ctx.emit("quickPreview/loaded",{ctx:this.ctx,modal:i,wikiPage:r,text:e,parseData:s})}}xs=Ch(Va),Kr=Rh(xs,0,"PluginQuickPreview",za,Kr),Ih(xs,1,Kr);const Th=Object.freeze(Object.defineProperty({__proto__:null,get PluginQuickPreview(){return Kr}},Symbol.toStringTag,{value:"Module"}));class kt{diff(e,n,r={}){let i;typeof r=="function"?(i=r,r={}):"callback"in r&&(i=r.callback);const s=this.castInput(e,r),o=this.castInput(n,r),a=this.removeEmpty(this.tokenize(s,r)),l=this.removeEmpty(this.tokenize(o,r));return this.diffWithOptionsObj(a,l,r,i)}diffWithOptionsObj(e,n,r,i){var s;const o=A=>{if(A=this.postProcess(A,r),i){setTimeout(function(){i(A)},0);return}else return A},a=n.length,l=e.length;let u=1,c=a+l;r.maxEditLength!=null&&(c=Math.min(c,r.maxEditLength));const f=(s=r.timeout)!==null&&s!==void 0?s:1/0,w=Date.now()+f,y=[{oldPos:-1,lastComponent:void 0}];let v=this.extractCommon(y[0],n,e,0,r);if(y[0].oldPos+1>=l&&v+1>=a)return o(this.buildValues(y[0].lastComponent,n,e));let I=-1/0,z=1/0;const F=()=>{for(let A=Math.max(I,-u);A<=Math.min(z,u);A+=2){let g;const m=y[A-1],h=y[A+1];m&&(y[A-1]=void 0);let P=!1;if(h){const T=h.oldPos-A;P=h&&0<=T&&T<a}const k=m&&m.oldPos+1<l;if(!P&&!k){y[A]=void 0;continue}if(!k||P&&m.oldPos<h.oldPos?g=this.addToPath(h,!0,!1,0,r):g=this.addToPath(m,!1,!0,1,r),v=this.extractCommon(g,n,e,A,r),g.oldPos+1>=l&&v+1>=a)return o(this.buildValues(g.lastComponent,n,e))||!0;y[A]=g,g.oldPos+1>=l&&(z=Math.min(z,A-1)),v+1>=a&&(I=Math.max(I,A+1))}u++};if(i)(function A(){setTimeout(function(){if(u>c||Date.now()>w)return i(void 0);F()||A()},0)})();else for(;u<=c&&Date.now()<=w;){const A=F();if(A)return A}}addToPath(e,n,r,i,s){const o=e.lastComponent;return o&&!s.oneChangePerToken&&o.added===n&&o.removed===r?{oldPos:e.oldPos+i,lastComponent:{count:o.count+1,added:n,removed:r,previousComponent:o.previousComponent}}:{oldPos:e.oldPos+i,lastComponent:{count:1,added:n,removed:r,previousComponent:o}}}extractCommon(e,n,r,i,s){const o=n.length,a=r.length;let l=e.oldPos,u=l-i,c=0;for(;u+1<o&&l+1<a&&this.equals(r[l+1],n[u+1],s);)u++,l++,c++,s.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return c&&!s.oneChangePerToken&&(e.lastComponent={count:c,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=l,u}equals(e,n,r){return r.comparator?r.comparator(e,n):e===n||!!r.ignoreCase&&e.toLowerCase()===n.toLowerCase()}removeEmpty(e){const n=[];for(let r=0;r<e.length;r++)e[r]&&n.push(e[r]);return n}castInput(e,n){return e}tokenize(e,n){return Array.from(e)}join(e){return e.join("")}postProcess(e,n){return e}get useLongestToken(){return!1}buildValues(e,n,r){const i=[];let s;for(;e;)i.push(e),s=e.previousComponent,delete e.previousComponent,e=s;i.reverse();const o=i.length;let a=0,l=0,u=0;for(;a<o;a++){const c=i[a];if(c.removed)c.value=this.join(r.slice(u,u+c.count)),u+=c.count;else{if(!c.added&&this.useLongestToken){let f=n.slice(l,l+c.count);f=f.map(function(w,y){const v=r[u+y];return v.length>w.length?v:w}),c.value=this.join(f)}else c.value=this.join(n.slice(l,l+c.count));l+=c.count,c.added||(u+=c.count)}}return i}}class Dh extends kt{}const Ka=new Dh;function Ga(t,e,n){return Ka.diff(t,e,n)}function Ya(t,e){let n;for(n=0;n<t.length&&n<e.length;n++)if(t[n]!=e[n])return t.slice(0,n);return t.slice(0,n)}function Ja(t,e){let n;if(!t||!e||t[t.length-1]!=e[e.length-1])return"";for(n=0;n<t.length&&n<e.length;n++)if(t[t.length-(n+1)]!=e[e.length-(n+1)])return t.slice(-n);return t.slice(-n)}function Ss(t,e,n){if(t.slice(0,e.length)!=e)throw Error(`string ${JSON.stringify(t)} doesn't start with prefix ${JSON.stringify(e)}; this is a bug`);return n+t.slice(e.length)}function Es(t,e,n){if(!e)return t+n;if(t.slice(-e.length)!=e)throw Error(`string ${JSON.stringify(t)} doesn't end with suffix ${JSON.stringify(e)}; this is a bug`);return t.slice(0,-e.length)+n}function Gn(t,e){return Ss(t,e,"")}function Gr(t,e){return Es(t,e,"")}function Qa(t,e){return e.slice(0,Nh(t,e))}function Nh(t,e){let n=0;t.length>e.length&&(n=t.length-e.length);let r=e.length;t.length<e.length&&(r=t.length);const i=Array(r);let s=0;i[0]=0;for(let o=1;o<r;o++){for(e[o]==e[s]?i[o]=i[s]:i[o]=s;s>0&&e[o]!=e[s];)s=i[s];e[o]==e[s]&&s++}s=0;for(let o=n;o<t.length;o++){for(;s>0&&t[o]!=e[s];)s=i[s];t[o]==e[s]&&s++}return s}function Lh(t){return t.includes(`\r
41
68
  `)&&!t.startsWith(`
42
- `)&&!t.match(/[^\r]\n/)}function qh(t){return!t.includes(`\r
69
+ `)&&!t.match(/[^\r]\n/)}function jh(t){return!t.includes(`\r
43
70
  `)&&t.includes(`
44
- `)}function Gn(t){let e;for(e=t.length-1;e>=0&&t[e].match(/\s/);e--);return t.substring(e+1)}function Mt(t){const e=t.match(/^\s*/);return e?e[0]:""}const Kr="a-zA-Z0-9_\\u{C0}-\\u{FF}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}",zh=new RegExp(`[${Kr}]+|\\s+|[^${Kr}]`,"ug");class Vh extends kt{equals(e,n,r){return r.ignoreCase&&(e=e.toLowerCase(),n=n.toLowerCase()),e.trim()===n.trim()}tokenize(e,n={}){let r;if(n.intlSegmenter){const o=n.intlSegmenter;if(o.resolvedOptions().granularity!="word")throw new Error('The segmenter passed must have a granularity of "word"');r=Array.from(o.segment(e),a=>a.segment)}else r=e.match(zh)||[];const i=[];let s=null;return r.forEach(o=>{/\s/.test(o)?s==null?i.push(o):i.push(i.pop()+o):s!=null&&/\s/.test(s)?i[i.length-1]==s?i.push(i.pop()+o):i.push(s+o):i.push(o),s=o}),i}join(e){return e.map((n,r)=>r==0?n:n.replace(/^\s+/,"")).join("")}postProcess(e,n){if(!e||n.oneChangePerToken)return e;let r=null,i=null,s=null;return e.forEach(o=>{o.added?i=o:o.removed?s=o:((i||s)&&il(r,s,i,o),r=o,i=null,s=null)}),(i||s)&&il(r,s,i,null),e}}const nl=new Vh;function rl(t,e,n){return n?.ignoreWhitespace!=null&&!n.ignoreWhitespace?Cs(t,e,n):nl.diff(t,e,n)}function il(t,e,n,r){if(e&&n){const i=Mt(e.value),s=Gn(e.value),o=Mt(n.value),a=Gn(n.value);if(t){const l=Za(i,o);t.value=Es(t.value,o,l),e.value=Yn(e.value,l),n.value=Yn(n.value,l)}if(r){const l=el(s,a);r.value=Ss(r.value,a,l),e.value=Vr(e.value,l),n.value=Vr(n.value,l)}}else if(n){if(t){const i=Mt(n.value);n.value=n.value.substring(i.length)}if(r){const i=Mt(r.value);r.value=r.value.substring(i.length)}}else if(t&&r){const i=Mt(r.value),s=Mt(e.value),o=Gn(e.value),a=Za(i,s);e.value=Yn(e.value,a);const l=el(Yn(i,a),o);e.value=Vr(e.value,l),r.value=Ss(r.value,i,l),t.value=Es(t.value,i,i.slice(0,i.length-l.length))}else if(r){const i=Mt(r.value),s=Gn(e.value),o=tl(s,i);e.value=Vr(e.value,o)}else if(t){const i=Gn(t.value),s=Mt(e.value),o=tl(i,s);e.value=Yn(e.value,o)}}class Kh extends kt{tokenize(e){const n=new RegExp(`(\\r?\\n)|[${Kr}]+|[^\\S\\n\\r]+|[^${Kr}]`,"ug");return e.match(n)||[]}}const sl=new Kh;function Cs(t,e,n){return sl.diff(t,e,n)}function Yh(t,e){if(typeof t=="function")e.callback=t;else if(t)for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}class Gh extends kt{constructor(){super(...arguments),this.tokenize=al}equals(e,n,r){return r.ignoreWhitespace?((!r.newlineIsToken||!e.includes(`
71
+ `)}function Yn(t){let e;for(e=t.length-1;e>=0&&t[e].match(/\s/);e--);return t.substring(e+1)}function Ft(t){const e=t.match(/^\s*/);return e?e[0]:""}const Yr="a-zA-Z0-9_\\u{C0}-\\u{FF}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}",Mh=new RegExp(`[${Yr}]+|\\s+|[^${Yr}]`,"ug");class Fh extends kt{equals(e,n,r){return r.ignoreCase&&(e=e.toLowerCase(),n=n.toLowerCase()),e.trim()===n.trim()}tokenize(e,n={}){let r;if(n.intlSegmenter){const o=n.intlSegmenter;if(o.resolvedOptions().granularity!="word")throw new Error('The segmenter passed must have a granularity of "word"');r=Array.from(o.segment(e),a=>a.segment)}else r=e.match(Mh)||[];const i=[];let s=null;return r.forEach(o=>{/\s/.test(o)?s==null?i.push(o):i.push(i.pop()+o):s!=null&&/\s/.test(s)?i[i.length-1]==s?i.push(i.pop()+o):i.push(s+o):i.push(o),s=o}),i}join(e){return e.map((n,r)=>r==0?n:n.replace(/^\s+/,"")).join("")}postProcess(e,n){if(!e||n.oneChangePerToken)return e;let r=null,i=null,s=null;return e.forEach(o=>{o.added?i=o:o.removed?s=o:((i||s)&&el(r,s,i,o),r=o,i=null,s=null)}),(i||s)&&el(r,s,i,null),e}}const Xa=new Fh;function Za(t,e,n){return n?.ignoreWhitespace!=null&&!n.ignoreWhitespace?Os(t,e,n):Xa.diff(t,e,n)}function el(t,e,n,r){if(e&&n){const i=Ft(e.value),s=Yn(e.value),o=Ft(n.value),a=Yn(n.value);if(t){const l=Ya(i,o);t.value=Es(t.value,o,l),e.value=Gn(e.value,l),n.value=Gn(n.value,l)}if(r){const l=Ja(s,a);r.value=Ss(r.value,a,l),e.value=Gr(e.value,l),n.value=Gr(n.value,l)}}else if(n){if(t){const i=Ft(n.value);n.value=n.value.substring(i.length)}if(r){const i=Ft(r.value);r.value=r.value.substring(i.length)}}else if(t&&r){const i=Ft(r.value),s=Ft(e.value),o=Yn(e.value),a=Ya(i,s);e.value=Gn(e.value,a);const l=Ja(Gn(i,a),o);e.value=Gr(e.value,l),r.value=Ss(r.value,i,l),t.value=Es(t.value,i,i.slice(0,i.length-l.length))}else if(r){const i=Ft(r.value),s=Yn(e.value),o=Qa(s,i);e.value=Gr(e.value,o)}else if(t){const i=Yn(t.value),s=Ft(e.value),o=Qa(i,s);e.value=Gn(e.value,o)}}class Bh extends kt{tokenize(e){const n=new RegExp(`(\\r?\\n)|[${Yr}]+|[^\\S\\n\\r]+|[^${Yr}]`,"ug");return e.match(n)||[]}}const tl=new Bh;function Os(t,e,n){return tl.diff(t,e,n)}function Uh(t,e){if(typeof t=="function")e.callback=t;else if(t)for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}class Hh extends kt{constructor(){super(...arguments),this.tokenize=rl}equals(e,n,r){return r.ignoreWhitespace?((!r.newlineIsToken||!e.includes(`
45
72
  `))&&(e=e.trim()),(!r.newlineIsToken||!n.includes(`
46
73
  `))&&(n=n.trim())):r.ignoreNewlineAtEof&&!r.newlineIsToken&&(e.endsWith(`
47
74
  `)&&(e=e.slice(0,-1)),n.endsWith(`
48
- `)&&(n=n.slice(0,-1))),super.equals(e,n,r)}}const Os=new Gh;function Yr(t,e,n){return Os.diff(t,e,n)}function ol(t,e,n){return n=Yh(n,{ignoreWhitespace:!0}),Os.diff(t,e,n)}function al(t,e){e.stripTrailingCr&&(t=t.replace(/\r\n/g,`
49
- `));const n=[],r=t.split(/(\n|\r\n)/);r[r.length-1]||r.pop();for(let i=0;i<r.length;i++){const s=r[i];i%2&&!e.newlineIsToken?n[n.length-1]+=s:n.push(s)}return n}function Jh(t){return t=="."||t=="!"||t=="?"}class Qh extends kt{tokenize(e){var n;const r=[];let i=0;for(let s=0;s<e.length;s++){if(s==e.length-1){r.push(e.slice(i));break}if(Jh(e[s])&&e[s+1].match(/\s/)){for(r.push(e.slice(i,s+1)),s=i=s+1;!((n=e[s+1])===null||n===void 0)&&n.match(/\s/);)s++;r.push(e.slice(i,s+1)),i=s+1}}return r}}const ll=new Qh;function cl(t,e,n){return ll.diff(t,e,n)}class Xh extends kt{tokenize(e){return e.split(/([{}:;,]|\s+)/)}}const ul=new Xh;function fl(t,e,n){return ul.diff(t,e,n)}class Zh extends kt{constructor(){super(...arguments),this.tokenize=al}get useLongestToken(){return!0}castInput(e,n){const{undefinedReplacement:r,stringifyReplacer:i=(s,o)=>typeof o>"u"?r:o}=n;return typeof e=="string"?e:JSON.stringify(Gr(e,null,null,i),null," ")}equals(e,n,r){return super.equals(e.replace(/,([\r\n])/g,"$1"),n.replace(/,([\r\n])/g,"$1"),r)}}const dl=new Zh;function hl(t,e,n){return dl.diff(t,e,n)}function Gr(t,e,n,r,i){e=e||[],n=n||[],r&&(t=r(i===void 0?"":i,t));let s;for(s=0;s<e.length;s+=1)if(e[s]===t)return n[s];let o;if(Object.prototype.toString.call(t)==="[object Array]"){for(e.push(t),o=new Array(t.length),n.push(o),s=0;s<t.length;s+=1)o[s]=Gr(t[s],e,n,r,String(s));return e.pop(),n.pop(),o}if(t&&t.toJSON&&(t=t.toJSON()),typeof t=="object"&&t!==null){e.push(t),o={},n.push(o);const a=[];let l;for(l in t)Object.prototype.hasOwnProperty.call(t,l)&&a.push(l);for(a.sort(),s=0;s<a.length;s+=1)l=a[s],o[l]=Gr(t[l],e,n,r,l);e.pop(),n.pop()}else o=t;return o}class ep extends kt{tokenize(e){return e.slice()}join(e){return e}removeEmpty(e){return e}}const pl=new ep;function ml(t,e,n){return pl.diff(t,e,n)}function gl(t){return Array.isArray(t)?t.map(e=>gl(e)):Object.assign(Object.assign({},t),{hunks:t.hunks.map(e=>Object.assign(Object.assign({},e),{lines:e.lines.map((n,r)=>{var i;return n.startsWith("\\")||n.endsWith("\r")||!((i=e.lines[r+1])===null||i===void 0)&&i.startsWith("\\")?n:n+"\r"})}))})}function yl(t){return Array.isArray(t)?t.map(e=>yl(e)):Object.assign(Object.assign({},t),{hunks:t.hunks.map(e=>Object.assign(Object.assign({},e),{lines:e.lines.map(n=>n.endsWith("\r")?n.substring(0,n.length-1):n)}))})}function tp(t){return Array.isArray(t)||(t=[t]),!t.some(e=>e.hunks.some(n=>n.lines.some(r=>!r.startsWith("\\")&&r.endsWith("\r"))))}function np(t){return Array.isArray(t)||(t=[t]),t.some(e=>e.hunks.some(n=>n.lines.some(r=>r.endsWith("\r"))))&&t.every(e=>e.hunks.every(n=>n.lines.every((r,i)=>{var s;return r.startsWith("\\")||r.endsWith("\r")||((s=n.lines[i+1])===null||s===void 0?void 0:s.startsWith("\\"))})))}function ks(t){const e=t.split(/\n/),n=[];let r=0;function i(){const a={};for(n.push(a);r<e.length;){const l=e[r];if(/^(---|\+\+\+|@@)\s/.test(l))break;const u=/^(?:Index:|diff(?: -r \w+)+)\s+(.+?)\s*$/.exec(l);u&&(a.index=u[1]),r++}for(s(a),s(a),a.hunks=[];r<e.length;){const l=e[r];if(/^(Index:\s|diff\s|---\s|\+\+\+\s|===================================================================)/.test(l))break;if(/^@@/.test(l))a.hunks.push(o());else{if(l)throw new Error("Unknown line "+(r+1)+" "+JSON.stringify(l));r++}}}function s(a){const l=/^(---|\+\+\+)\s+(.*)\r?$/.exec(e[r]);if(l){const u=l[2].split(" ",2),c=(u[1]||"").trim();let f=u[0].replace(/\\\\/g,"\\");/^".*"$/.test(f)&&(f=f.substr(1,f.length-2)),l[1]==="---"?(a.oldFileName=f,a.oldHeader=c):(a.newFileName=f,a.newHeader=c),r++}}function o(){var a;const l=r,u=e[r++],c=u.split(/@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/),f={oldStart:+c[1],oldLines:typeof c[2]>"u"?1:+c[2],newStart:+c[3],newLines:typeof c[4]>"u"?1:+c[4],lines:[]};f.oldLines===0&&(f.oldStart+=1),f.newLines===0&&(f.newStart+=1);let w=0,y=0;for(;r<e.length&&(y<f.oldLines||w<f.newLines||!((a=e[r])===null||a===void 0)&&a.startsWith("\\"));r++){const v=e[r].length==0&&r!=e.length-1?" ":e[r][0];if(v==="+"||v==="-"||v===" "||v==="\\")f.lines.push(e[r]),v==="+"?w++:v==="-"?y++:v===" "&&(w++,y++);else throw new Error(`Hunk at line ${l+1} contained invalid line ${e[r]}`)}if(!w&&f.newLines===1&&(f.newLines=0),!y&&f.oldLines===1&&(f.oldLines=0),w!==f.newLines)throw new Error("Added line count did not match for hunk at line "+(l+1));if(y!==f.oldLines)throw new Error("Removed line count did not match for hunk at line "+(l+1));return f}for(;r<e.length;)i();return n}function rp(t,e,n){let r=!0,i=!1,s=!1,o=1;return function a(){if(r&&!s){if(i?o++:r=!1,t+o<=n)return t+o;s=!0}if(!i)return s||(r=!0),e<=t-o?t-o++:(i=!0,a())}}function bl(t,e,n={}){let r;if(typeof e=="string"?r=ks(e):Array.isArray(e)?r=e:r=[e],r.length>1)throw new Error("applyPatch only works with a single input.");return ip(t,r[0],n)}function ip(t,e,n={}){(n.autoConvertLineEndings||n.autoConvertLineEndings==null)&&(Wh(t)&&tp(e)?e=gl(e):qh(t)&&np(e)&&(e=yl(e)));const r=t.split(`
50
- `),i=e.hunks,s=n.compareLine||((v,I,z,F)=>I===F),o=n.fuzzFactor||0;let a=0;if(o<0||!Number.isInteger(o))throw new Error("fuzzFactor must be a non-negative integer");if(!i.length)return t;let l="",u=!1,c=!1;for(let v=0;v<i[i.length-1].lines.length;v++){const I=i[i.length-1].lines[v];I[0]=="\\"&&(l[0]=="+"?u=!0:l[0]=="-"&&(c=!0)),l=I}if(u){if(c){if(!o&&r[r.length-1]=="")return!1}else if(r[r.length-1]=="")r.pop();else if(!o)return!1}else if(c){if(r[r.length-1]!="")r.push("");else if(!o)return!1}function f(v,I,z,F=0,A=!0,g=[],m=0){let h=0,O=!1;for(;F<v.length;F++){const P=v[F],R=P.length>0?P[0]:" ",V=P.length>0?P.substr(1):P;if(R==="-")if(s(I+1,r[I],R,V))I++,h=0;else return!z||r[I]==null?null:(g[m]=r[I],f(v,I+1,z-1,F,!1,g,m+1));if(R==="+"){if(!A)return null;g[m]=V,m++,h=0,O=!0}if(R===" ")if(h++,g[m]=r[I],s(I+1,r[I],R,V))m++,A=!0,O=!1,I++;else return O||!z?null:r[I]&&(f(v,I+1,z-1,F+1,!1,g,m+1)||f(v,I+1,z-1,F,!1,g,m+1))||f(v,I,z-1,F+1,!1,g,m)}return m-=h,I-=h,g.length=m,{patchedLines:g,oldLineLastI:I-1}}const w=[];let y=0;for(let v=0;v<i.length;v++){const I=i[v];let z;const F=r.length-I.oldLines+o;let A;for(let g=0;g<=o;g++){A=I.oldStart+y-1;const m=rp(A,a,F);for(;A!==void 0&&(z=f(I.lines,A,g),!z);A=m());if(z)break}if(!z)return!1;for(let g=a;g<A;g++)w.push(r[g]);for(let g=0;g<z.patchedLines.length;g++){const m=z.patchedLines[g];w.push(m)}a=z.oldLineLastI+1,y=A+1-I.oldStart}for(let v=a;v<r.length;v++)w.push(r[v]);return w.join(`
51
- `)}function sp(t,e){const n=typeof t=="string"?ks(t):t;let r=0;function i(){const s=n[r++];if(!s)return e.complete();e.loadFile(s,function(o,a){if(o)return e.complete(o);const l=bl(a,s,e);e.patched(s,l,function(u){if(u)return e.complete(u);i()})})}i()}function vl(t){return Array.isArray(t)?t.map(e=>vl(e)).reverse():Object.assign(Object.assign({},t),{oldFileName:t.newFileName,oldHeader:t.newHeader,newFileName:t.oldFileName,newHeader:t.oldHeader,hunks:t.hunks.map(e=>({oldLines:e.newLines,oldStart:e.newStart,newLines:e.oldLines,newStart:e.oldStart,lines:e.lines.map(n=>n.startsWith("-")?`+${n.slice(1)}`:n.startsWith("+")?`-${n.slice(1)}`:n)}))})}function Ps(t,e,n,r,i,s,o){let a;o?typeof o=="function"?a={callback:o}:a=o:a={},typeof a.context>"u"&&(a.context=4);const l=a.context;if(a.newlineIsToken)throw new Error("newlineIsToken may not be used with patch-generation functions, only with diffing functions");if(a.callback){const{callback:c}=a;Yr(n,r,Object.assign(Object.assign({},a),{callback:f=>{const w=u(f);c(w)}}))}else return u(Yr(n,r,a));function u(c){if(!c)return;c.push({value:"",lines:[]});function f(A){return A.map(function(g){return" "+g})}const w=[];let y=0,v=0,I=[],z=1,F=1;for(let A=0;A<c.length;A++){const g=c[A],m=g.lines||ap(g.value);if(g.lines=m,g.added||g.removed){if(!y){const h=c[A-1];y=z,v=F,h&&(I=l>0?f(h.lines.slice(-l)):[],y-=I.length,v-=I.length)}for(const h of m)I.push((g.added?"+":"-")+h);g.added?F+=m.length:z+=m.length}else{if(y)if(m.length<=l*2&&A<c.length-2)for(const h of f(m))I.push(h);else{const h=Math.min(m.length,l);for(const P of f(m.slice(0,h)))I.push(P);const O={oldStart:y,oldLines:z-y+h,newStart:v,newLines:F-v+h,lines:I};w.push(O),y=0,v=0,I=[]}z+=m.length,F+=m.length}}for(const A of w)for(let g=0;g<A.lines.length;g++)A.lines[g].endsWith(`
52
- `)?A.lines[g]=A.lines[g].slice(0,-1):(A.lines.splice(g+1,0,"\"),g++);return{oldFileName:t,newFileName:e,oldHeader:i,newHeader:s,hunks:w}}}function Jr(t){if(Array.isArray(t))return t.map(Jr).join(`
75
+ `)&&(n=n.slice(0,-1))),super.equals(e,n,r)}}const Ps=new Hh;function Jr(t,e,n){return Ps.diff(t,e,n)}function nl(t,e,n){return n=Uh(n,{ignoreWhitespace:!0}),Ps.diff(t,e,n)}function rl(t,e){e.stripTrailingCr&&(t=t.replace(/\r\n/g,`
76
+ `));const n=[],r=t.split(/(\n|\r\n)/);r[r.length-1]||r.pop();for(let i=0;i<r.length;i++){const s=r[i];i%2&&!e.newlineIsToken?n[n.length-1]+=s:n.push(s)}return n}function Wh(t){return t=="."||t=="!"||t=="?"}class qh extends kt{tokenize(e){var n;const r=[];let i=0;for(let s=0;s<e.length;s++){if(s==e.length-1){r.push(e.slice(i));break}if(Wh(e[s])&&e[s+1].match(/\s/)){for(r.push(e.slice(i,s+1)),s=i=s+1;!((n=e[s+1])===null||n===void 0)&&n.match(/\s/);)s++;r.push(e.slice(i,s+1)),i=s+1}}return r}}const il=new qh;function sl(t,e,n){return il.diff(t,e,n)}class zh extends kt{tokenize(e){return e.split(/([{}:;,]|\s+)/)}}const ol=new zh;function al(t,e,n){return ol.diff(t,e,n)}class Vh extends kt{constructor(){super(...arguments),this.tokenize=rl}get useLongestToken(){return!0}castInput(e,n){const{undefinedReplacement:r,stringifyReplacer:i=(s,o)=>typeof o>"u"?r:o}=n;return typeof e=="string"?e:JSON.stringify(Qr(e,null,null,i),null," ")}equals(e,n,r){return super.equals(e.replace(/,([\r\n])/g,"$1"),n.replace(/,([\r\n])/g,"$1"),r)}}const ll=new Vh;function cl(t,e,n){return ll.diff(t,e,n)}function Qr(t,e,n,r,i){e=e||[],n=n||[],r&&(t=r(i===void 0?"":i,t));let s;for(s=0;s<e.length;s+=1)if(e[s]===t)return n[s];let o;if(Object.prototype.toString.call(t)==="[object Array]"){for(e.push(t),o=new Array(t.length),n.push(o),s=0;s<t.length;s+=1)o[s]=Qr(t[s],e,n,r,String(s));return e.pop(),n.pop(),o}if(t&&t.toJSON&&(t=t.toJSON()),typeof t=="object"&&t!==null){e.push(t),o={},n.push(o);const a=[];let l;for(l in t)Object.prototype.hasOwnProperty.call(t,l)&&a.push(l);for(a.sort(),s=0;s<a.length;s+=1)l=a[s],o[l]=Qr(t[l],e,n,r,l);e.pop(),n.pop()}else o=t;return o}class Kh extends kt{tokenize(e){return e.slice()}join(e){return e}removeEmpty(e){return e}}const ul=new Kh;function fl(t,e,n){return ul.diff(t,e,n)}function dl(t){return Array.isArray(t)?t.map(e=>dl(e)):Object.assign(Object.assign({},t),{hunks:t.hunks.map(e=>Object.assign(Object.assign({},e),{lines:e.lines.map((n,r)=>{var i;return n.startsWith("\\")||n.endsWith("\r")||!((i=e.lines[r+1])===null||i===void 0)&&i.startsWith("\\")?n:n+"\r"})}))})}function hl(t){return Array.isArray(t)?t.map(e=>hl(e)):Object.assign(Object.assign({},t),{hunks:t.hunks.map(e=>Object.assign(Object.assign({},e),{lines:e.lines.map(n=>n.endsWith("\r")?n.substring(0,n.length-1):n)}))})}function Gh(t){return Array.isArray(t)||(t=[t]),!t.some(e=>e.hunks.some(n=>n.lines.some(r=>!r.startsWith("\\")&&r.endsWith("\r"))))}function Yh(t){return Array.isArray(t)||(t=[t]),t.some(e=>e.hunks.some(n=>n.lines.some(r=>r.endsWith("\r"))))&&t.every(e=>e.hunks.every(n=>n.lines.every((r,i)=>{var s;return r.startsWith("\\")||r.endsWith("\r")||((s=n.lines[i+1])===null||s===void 0?void 0:s.startsWith("\\"))})))}function Cs(t){const e=t.split(/\n/),n=[];let r=0;function i(){const a={};for(n.push(a);r<e.length;){const l=e[r];if(/^(---|\+\+\+|@@)\s/.test(l))break;const u=/^(?:Index:|diff(?: -r \w+)+)\s+(.+?)\s*$/.exec(l);u&&(a.index=u[1]),r++}for(s(a),s(a),a.hunks=[];r<e.length;){const l=e[r];if(/^(Index:\s|diff\s|---\s|\+\+\+\s|===================================================================)/.test(l))break;if(/^@@/.test(l))a.hunks.push(o());else{if(l)throw new Error("Unknown line "+(r+1)+" "+JSON.stringify(l));r++}}}function s(a){const l=/^(---|\+\+\+)\s+(.*)\r?$/.exec(e[r]);if(l){const u=l[2].split(" ",2),c=(u[1]||"").trim();let f=u[0].replace(/\\\\/g,"\\");/^".*"$/.test(f)&&(f=f.substr(1,f.length-2)),l[1]==="---"?(a.oldFileName=f,a.oldHeader=c):(a.newFileName=f,a.newHeader=c),r++}}function o(){var a;const l=r,u=e[r++],c=u.split(/@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/),f={oldStart:+c[1],oldLines:typeof c[2]>"u"?1:+c[2],newStart:+c[3],newLines:typeof c[4]>"u"?1:+c[4],lines:[]};f.oldLines===0&&(f.oldStart+=1),f.newLines===0&&(f.newStart+=1);let w=0,y=0;for(;r<e.length&&(y<f.oldLines||w<f.newLines||!((a=e[r])===null||a===void 0)&&a.startsWith("\\"));r++){const v=e[r].length==0&&r!=e.length-1?" ":e[r][0];if(v==="+"||v==="-"||v===" "||v==="\\")f.lines.push(e[r]),v==="+"?w++:v==="-"?y++:v===" "&&(w++,y++);else throw new Error(`Hunk at line ${l+1} contained invalid line ${e[r]}`)}if(!w&&f.newLines===1&&(f.newLines=0),!y&&f.oldLines===1&&(f.oldLines=0),w!==f.newLines)throw new Error("Added line count did not match for hunk at line "+(l+1));if(y!==f.oldLines)throw new Error("Removed line count did not match for hunk at line "+(l+1));return f}for(;r<e.length;)i();return n}function Jh(t,e,n){let r=!0,i=!1,s=!1,o=1;return function a(){if(r&&!s){if(i?o++:r=!1,t+o<=n)return t+o;s=!0}if(!i)return s||(r=!0),e<=t-o?t-o++:(i=!0,a())}}function pl(t,e,n={}){let r;if(typeof e=="string"?r=Cs(e):Array.isArray(e)?r=e:r=[e],r.length>1)throw new Error("applyPatch only works with a single input.");return Qh(t,r[0],n)}function Qh(t,e,n={}){(n.autoConvertLineEndings||n.autoConvertLineEndings==null)&&(Lh(t)&&Gh(e)?e=dl(e):jh(t)&&Yh(e)&&(e=hl(e)));const r=t.split(`
77
+ `),i=e.hunks,s=n.compareLine||((v,I,z,F)=>I===F),o=n.fuzzFactor||0;let a=0;if(o<0||!Number.isInteger(o))throw new Error("fuzzFactor must be a non-negative integer");if(!i.length)return t;let l="",u=!1,c=!1;for(let v=0;v<i[i.length-1].lines.length;v++){const I=i[i.length-1].lines[v];I[0]=="\\"&&(l[0]=="+"?u=!0:l[0]=="-"&&(c=!0)),l=I}if(u){if(c){if(!o&&r[r.length-1]=="")return!1}else if(r[r.length-1]=="")r.pop();else if(!o)return!1}else if(c){if(r[r.length-1]!="")r.push("");else if(!o)return!1}function f(v,I,z,F=0,A=!0,g=[],m=0){let h=0,P=!1;for(;F<v.length;F++){const k=v[F],T=k.length>0?k[0]:" ",V=k.length>0?k.substr(1):k;if(T==="-")if(s(I+1,r[I],T,V))I++,h=0;else return!z||r[I]==null?null:(g[m]=r[I],f(v,I+1,z-1,F,!1,g,m+1));if(T==="+"){if(!A)return null;g[m]=V,m++,h=0,P=!0}if(T===" ")if(h++,g[m]=r[I],s(I+1,r[I],T,V))m++,A=!0,P=!1,I++;else return P||!z?null:r[I]&&(f(v,I+1,z-1,F+1,!1,g,m+1)||f(v,I+1,z-1,F,!1,g,m+1))||f(v,I,z-1,F+1,!1,g,m)}return m-=h,I-=h,g.length=m,{patchedLines:g,oldLineLastI:I-1}}const w=[];let y=0;for(let v=0;v<i.length;v++){const I=i[v];let z;const F=r.length-I.oldLines+o;let A;for(let g=0;g<=o;g++){A=I.oldStart+y-1;const m=Jh(A,a,F);for(;A!==void 0&&(z=f(I.lines,A,g),!z);A=m());if(z)break}if(!z)return!1;for(let g=a;g<A;g++)w.push(r[g]);for(let g=0;g<z.patchedLines.length;g++){const m=z.patchedLines[g];w.push(m)}a=z.oldLineLastI+1,y=A+1-I.oldStart}for(let v=a;v<r.length;v++)w.push(r[v]);return w.join(`
78
+ `)}function Xh(t,e){const n=typeof t=="string"?Cs(t):t;let r=0;function i(){const s=n[r++];if(!s)return e.complete();e.loadFile(s,function(o,a){if(o)return e.complete(o);const l=pl(a,s,e);e.patched(s,l,function(u){if(u)return e.complete(u);i()})})}i()}function ml(t){return Array.isArray(t)?t.map(e=>ml(e)).reverse():Object.assign(Object.assign({},t),{oldFileName:t.newFileName,oldHeader:t.newHeader,newFileName:t.oldFileName,newHeader:t.oldHeader,hunks:t.hunks.map(e=>({oldLines:e.newLines,oldStart:e.newStart,newLines:e.oldLines,newStart:e.oldStart,lines:e.lines.map(n=>n.startsWith("-")?`+${n.slice(1)}`:n.startsWith("+")?`-${n.slice(1)}`:n)}))})}function ks(t,e,n,r,i,s,o){let a;o?typeof o=="function"?a={callback:o}:a=o:a={},typeof a.context>"u"&&(a.context=4);const l=a.context;if(a.newlineIsToken)throw new Error("newlineIsToken may not be used with patch-generation functions, only with diffing functions");if(a.callback){const{callback:c}=a;Jr(n,r,Object.assign(Object.assign({},a),{callback:f=>{const w=u(f);c(w)}}))}else return u(Jr(n,r,a));function u(c){if(!c)return;c.push({value:"",lines:[]});function f(A){return A.map(function(g){return" "+g})}const w=[];let y=0,v=0,I=[],z=1,F=1;for(let A=0;A<c.length;A++){const g=c[A],m=g.lines||ep(g.value);if(g.lines=m,g.added||g.removed){if(!y){const h=c[A-1];y=z,v=F,h&&(I=l>0?f(h.lines.slice(-l)):[],y-=I.length,v-=I.length)}for(const h of m)I.push((g.added?"+":"-")+h);g.added?F+=m.length:z+=m.length}else{if(y)if(m.length<=l*2&&A<c.length-2)for(const h of f(m))I.push(h);else{const h=Math.min(m.length,l);for(const k of f(m.slice(0,h)))I.push(k);const P={oldStart:y,oldLines:z-y+h,newStart:v,newLines:F-v+h,lines:I};w.push(P),y=0,v=0,I=[]}z+=m.length,F+=m.length}}for(const A of w)for(let g=0;g<A.lines.length;g++)A.lines[g].endsWith(`
79
+ `)?A.lines[g]=A.lines[g].slice(0,-1):(A.lines.splice(g+1,0,"\"),g++);return{oldFileName:t,newFileName:e,oldHeader:i,newHeader:s,hunks:w}}}function Xr(t){if(Array.isArray(t))return t.map(Xr).join(`
53
80
  `);const e=[];t.oldFileName==t.newFileName&&e.push("Index: "+t.oldFileName),e.push("==================================================================="),e.push("--- "+t.oldFileName+(typeof t.oldHeader>"u"?"":" "+t.oldHeader)),e.push("+++ "+t.newFileName+(typeof t.newHeader>"u"?"":" "+t.newHeader));for(let n=0;n<t.hunks.length;n++){const r=t.hunks[n];r.oldLines===0&&(r.oldStart-=1),r.newLines===0&&(r.newStart-=1),e.push("@@ -"+r.oldStart+","+r.oldLines+" +"+r.newStart+","+r.newLines+" @@");for(const i of r.lines)e.push(i)}return e.join(`
54
81
  `)+`
55
- `}function $s(t,e,n,r,i,s,o){if(typeof o=="function"&&(o={callback:o}),o?.callback){const{callback:a}=o;Ps(t,e,n,r,i,s,Object.assign(Object.assign({},o),{callback:l=>{a(l?Jr(l):void 0)}}))}else{const a=Ps(t,e,n,r,i,s,o);return a?Jr(a):void 0}}function op(t,e,n,r,i,s){return $s(t,t,e,n,r,i,s)}function ap(t){const e=t.endsWith(`
82
+ `}function $s(t,e,n,r,i,s,o){if(typeof o=="function"&&(o={callback:o}),o?.callback){const{callback:a}=o;ks(t,e,n,r,i,s,Object.assign(Object.assign({},o),{callback:l=>{a(l?Xr(l):void 0)}}))}else{const a=ks(t,e,n,r,i,s,o);return a?Xr(a):void 0}}function Zh(t,e,n,r,i,s){return $s(t,t,e,n,r,i,s)}function ep(t){const e=t.endsWith(`
56
83
  `),n=t.split(`
57
84
  `).map(r=>r+`
58
- `);return e?n.pop():n.push(n.pop().slice(0,-1)),n}function lp(t){const e=[];let n,r;for(let i=0;i<t.length;i++)n=t[i],n.added?r=1:n.removed?r=-1:r=0,e.push([r,n.value]);return e}function cp(t){const e=[];for(let n=0;n<t.length;n++){const r=t[n];r.added?e.push("<ins>"):r.removed&&e.push("<del>"),e.push(up(r.value)),r.added?e.push("</ins>"):r.removed&&e.push("</del>")}return e.join("")}function up(t){let e=t;return e=e.replace(/&/g,"&amp;"),e=e.replace(/</g,"&lt;"),e=e.replace(/>/g,"&gt;"),e=e.replace(/"/g,"&quot;"),e}const fp=Object.freeze(Object.defineProperty({__proto__:null,Diff:kt,applyPatch:bl,applyPatches:sp,arrayDiff:pl,canonicalize:Gr,characterDiff:Qa,convertChangesToDMP:lp,convertChangesToXML:cp,createPatch:op,createTwoFilesPatch:$s,cssDiff:ul,diffArrays:ml,diffChars:Xa,diffCss:fl,diffJson:hl,diffLines:Yr,diffSentences:cl,diffTrimmedLines:ol,diffWords:rl,diffWordsWithSpace:Cs,formatPatch:Jr,jsonDiff:dl,lineDiff:Os,parsePatch:ks,reversePatch:vl,sentenceDiff:ll,structuredPatch:Ps,wordDiff:nl,wordsWithSpaceDiff:sl},Symbol.toStringTag,{value:"Module"}));class dp{constructor(e){this.ctx=e,this.JsDiff=fp,this.diffChars=Xa,this.diffWords=rl,this.diffWordsWithSpace=Cs,this.diffLines=Yr,this.diffTrimmedLines=ol,this.diffSentences=cl,this.diffCss=fl,this.diffJson=hl,this.diffArrays=ml,this.createTwoFilesPatch=$s,this.ctx.set("jsdiff",this)}}const hp={"diff-container":"_diff-container_lq0si_2"},pp=t=>{let{user:e,target:n}=t;const r=window.mw?.config?.get("wgArticlePath")||"/$1",i=s=>r.replace("$1",s);return C("span",{className:"mw-userlinks",children:[C("a",{href:i(`User:${e}`),className:"mw-userlink",target:n,children:e})," ",C("span",{className:"mw-usertoollinks",children:["(",C("a",{href:i(`User_talk:${e}`),className:"mw-usertoollinks-talk",target:n,children:"talk"})," | ",C("a",{href:i(`Special:Contributions/${e}`),className:"mw-usertoollinks-contribs",target:n,children:"contribs"})," | ",C("a",{href:i(`Special:Block/${e}`),className:"mw-usertoollinks-block",target:n,children:"block"}),")"]})]})},mp=new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"medium"}).format,_l=t=>{let e=["diff-title"];return t.type==="from"?e.push("diff-otitle"):t.type==="to"&&e.push("diff-ntitle"),!t.pageid||!t.userid?C("td",{colSpan:2,className:e,children:C("div",{className:"mw-diff-title--title",children:t.type==="from"?"Original content":t.type==="to"?"Your content":""})}):C("td",{colSpan:2,className:e,children:[C("div",{className:"mw-diff-title--title",children:t.pagetitle||t.timestamp}),C("div",{className:"mw-diff-title--user",children:t.username&&C(pp,{user:t.username,target:"_blank"})}),C("div",{className:"mw-diff-title--timestamp",children:t.timestamp&&mp(new Date(t.timestamp))}),C("div",{className:"mw-diff-title--comment",children:t.parsedcomment&&C(Ir,{children:["(",C("i",{innerHTML:t.parsedcomment}),")"]})}),C("div",{className:"mw-diff-title--navigation"})]})},gp=t=>{const{data:e,...n}=t,r=C("table",{className:"theme-ipe diff diff-type-table","data-mw":"interface",...n,children:[C("colgroup",{children:[C("col",{className:"diff-marker"}),C("col",{className:"diff-content"}),C("col",{className:"diff-marker"}),C("col",{className:"diff-content"})]}),C("tbody",{children:[C("tr",{children:[C(_l,{type:"from",pageid:e.fromid,pagetitle:e.fromtitle,revid:e.fromrevid,size:e.fromsize,timestamp:e.fromtimestamp,username:e.fromuser,userid:e.fromuserid,comment:e.fromcomment,parsedcomment:e.fromparsedcomment}),C(_l,{type:"to",pageid:e.toid,pagetitle:e.totitle,revid:e.torevid,size:e.tosize,timestamp:e.totimestamp,username:e.touser,userid:e.touserid,comment:e.tocomment,parsedcomment:e.toparsedcomment})]}),C("div",{id:"diffbody"}),C("tr",{className:"diff-size",style:{textAlign:"center"},children:[C("td",{colSpan:2,className:"diff-size-old",children:e.fromsize!==void 0&&`${e.fromsize} bytes`}),C("td",{colSpan:2,className:"diff-size-new",children:e.tosize!==void 0&&`${e.tosize} bytes`})]})]})]});return r.querySelector("#diffbody").outerHTML=e.body||C("tr",{children:C("td",{colSpan:4,children:C("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",height:"5rem"},children:C("i",{children:"No changes"})})})}).outerHTML,r},yp=(t,e=document)=>e.querySelector(t),bp=(t,e=document)=>e.querySelectorAll(t);var vp=Object.create,As=Object.defineProperty,_p=Object.getOwnPropertyDescriptor,wl=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),xl=t=>{throw TypeError(t)},wp=(t,e,n)=>e in t?As(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,xp=(t,e)=>As(t,"name",{value:e,configurable:!0}),Sp=t=>[,,,vp(t?.[wl("metadata")]??null)],Ep=["class","method","getter","setter","accessor","field","value","get","set"],Sl=t=>t!==void 0&&typeof t!="function"?xl("Function expected"):t,Cp=(t,e,n,r,i)=>({kind:Ep[t],name:e,metadata:r,addInitializer:s=>n._?xl("Already initialized"):i.push(Sl(s||null))}),Op=(t,e)=>wp(e,wl("metadata"),t[3]),kp=(t,e,n,r)=>{for(var i=0,s=t[e>>1],o=s&&s.length;i<o;i++)s[i].call(n);return r},Pp=(t,e,n,r,i,s)=>{var o,a,l,u=e&7,c=!1,f=0,w=t[f]||(t[f]=[]),y=u&&(i=i.prototype,u<5&&(u>3||!c)&&_p(i,n));xp(i,n);for(var v=r.length-1;v>=0;v--)l=Cp(u,n,a={},t[3],w),o=(0,r[v])(i,l),a._=1,Sl(o)&&(i=o);return Op(t,i),y&&As(i,n,y),c?u^4?s:y:i},El,Is,Cl;const Ol=["diffChars","diffWords","diffSentences","diffLines","createTwoFilesPatch"];El=[Ve(["jsdiff"]),Br(xe.object({"quickDiff.preferredCompareMode":xe.union([xe.const("jsDiff"),xe.const("mwApi")]).description("The preferred comparison mode for quick diff").default("mwApi"),"quickDiff.jsDiff.defaultType":xe.union(Ol.map(t=>xe.const(t))).description("The default diff type for JsDiff").default("diffSentences")}).description("Quick Diff Preferences"),{"quickDiff.preferredCompareMode":"mwApi","quickDiff.jsDiff.defaultType":"diffSentences"})];class Qr extends(Cl=gt){constructor(e){super(e,{},"quick-diff"),this.ctx=e,this.VALID_DIFF_TYPES=Ol,this.COMPARE_API_DEFAULT_OPTIONS={prop:["comment","diff","diffsize","ids","parsedcomment","size","timestamp","title","user"].join("|"),difftype:"table"}}start(){this.ctx.set("quickDiff",this),this.ctx.on("quickEdit/wikiPage",this.injectQuickEdit.bind(this)),window.RLQ.push(this.injectHistoryPage.bind(this))}stop(){this.ctx.off("quickEdit/wikiPage",this.injectQuickEdit.bind(this))}injectHistoryPage(){const e=yp("#mw-history-compare");if(!e)return;bp(".mw-history-compareselectedversions-button",e).forEach(r=>{r.after(C("button",{className:"cdx-button",onClick:i=>{i.preventDefault();const s=new FormData(e),o=Number(s.get("oldid"))||0,a=Number(s.get("diff"))||0;if(!s.get("title")||!o||!a)return this.logger.warn("Missing title or revision IDs");this.comparePages({fromrev:o,torev:a})},children:"Quick Diff"}))})}injectQuickEdit({modal:e,wikiPage:n}){e.setButtons([{label:"Diff",side:"left",className:"btn btn-secondary",method:()=>{const r=n.title,i=n.revisions?.[0]?.content||"",s=e.get$content().find('textarea[name="text"]').prop("value")||"";return this.comparePages({fromtitle:r,fromtext:i,totitle:r,totext:s})}}])}simpleTextDiff(e,n){const r=this.ctx.modal.show({title:"Quick Diff",className:"in-page-edit ipe-quickDiff"});r.show();const i=C("pre",{className:hp["diff-container"]}),s=C("div",{style:{display:"flex",gap:"1em"},children:this.VALID_DIFF_TYPES.map((o,a)=>C(Ta,{name:"diffType",value:o,label:o,inputProps:{checked:a===0}}))});r.setContent(C("section",{children:[s,i]})),s.querySelectorAll('input[name="diffType"]').forEach(o=>{o.addEventListener("change",()=>{const a=this.renderJsDiff(e,n,o.value);i.textContent="",i.appendChild(a)})}),s.querySelector('input[name="diffType"]').dispatchEvent(new Event("change"))}renderJsDiff(e,n,r="diffSentences"){const i=document.createDocumentFragment();let s;if(r==="createTwoFilesPatch"){let o=!1;s=this.ctx.jsdiff.createTwoFilesPatch("original.txt","modified.txt",e,n).split(`
85
+ `);return e?n.pop():n.push(n.pop().slice(0,-1)),n}function tp(t){const e=[];let n,r;for(let i=0;i<t.length;i++)n=t[i],n.added?r=1:n.removed?r=-1:r=0,e.push([r,n.value]);return e}function np(t){const e=[];for(let n=0;n<t.length;n++){const r=t[n];r.added?e.push("<ins>"):r.removed&&e.push("<del>"),e.push(rp(r.value)),r.added?e.push("</ins>"):r.removed&&e.push("</del>")}return e.join("")}function rp(t){let e=t;return e=e.replace(/&/g,"&amp;"),e=e.replace(/</g,"&lt;"),e=e.replace(/>/g,"&gt;"),e=e.replace(/"/g,"&quot;"),e}const ip=Object.freeze(Object.defineProperty({__proto__:null,Diff:kt,applyPatch:pl,applyPatches:Xh,arrayDiff:ul,canonicalize:Qr,characterDiff:Ka,convertChangesToDMP:tp,convertChangesToXML:np,createPatch:Zh,createTwoFilesPatch:$s,cssDiff:ol,diffArrays:fl,diffChars:Ga,diffCss:al,diffJson:cl,diffLines:Jr,diffSentences:sl,diffTrimmedLines:nl,diffWords:Za,diffWordsWithSpace:Os,formatPatch:Xr,jsonDiff:ll,lineDiff:Ps,parsePatch:Cs,reversePatch:ml,sentenceDiff:il,structuredPatch:ks,wordDiff:Xa,wordsWithSpaceDiff:tl},Symbol.toStringTag,{value:"Module"}));class sp{constructor(e){this.ctx=e,this.JsDiff=ip,this.diffChars=Ga,this.diffWords=Za,this.diffWordsWithSpace=Os,this.diffLines=Jr,this.diffTrimmedLines=nl,this.diffSentences=sl,this.diffCss=al,this.diffJson=cl,this.diffArrays=fl,this.createTwoFilesPatch=$s,this.ctx.set("jsdiff",this)}}const op={"diff-container":"_diff-container_lq0si_2"},ap=t=>{let{user:e,target:n}=t;const r=window.mw?.config?.get("wgArticlePath")||"/$1",i=s=>r.replace("$1",s);return O("span",{className:"mw-userlinks",children:[O("a",{href:i(`User:${e}`),className:"mw-userlink",target:n,children:e})," ",O("span",{className:"mw-usertoollinks",children:["(",O("a",{href:i(`User_talk:${e}`),className:"mw-usertoollinks-talk",target:n,children:"talk"})," | ",O("a",{href:i(`Special:Contributions/${e}`),className:"mw-usertoollinks-contribs",target:n,children:"contribs"})," | ",O("a",{href:i(`Special:Block/${e}`),className:"mw-usertoollinks-block",target:n,children:"block"}),")"]})]})},lp=new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"medium"}).format,gl=t=>{let e=["diff-title"];return t.type==="from"?e.push("diff-otitle"):t.type==="to"&&e.push("diff-ntitle"),!t.pageid||!t.userid?O("td",{colSpan:2,className:e,children:O("div",{className:"mw-diff-title--title",children:t.type==="from"?"Original content":t.type==="to"?"Your content":""})}):O("td",{colSpan:2,className:e,children:[O("div",{className:"mw-diff-title--title",children:t.pagetitle||t.timestamp}),O("div",{className:"mw-diff-title--user",children:t.username&&O(ap,{user:t.username,target:"_blank"})}),O("div",{className:"mw-diff-title--timestamp",children:t.timestamp&&lp(new Date(t.timestamp))}),O("div",{className:"mw-diff-title--comment",children:t.parsedcomment&&O(Tr,{children:["(",O("i",{innerHTML:t.parsedcomment}),")"]})}),O("div",{className:"mw-diff-title--navigation"})]})},cp=t=>{const{data:e,...n}=t,r=O("table",{className:"theme-ipe diff diff-type-table","data-mw":"interface",...n,children:[O("colgroup",{children:[O("col",{className:"diff-marker"}),O("col",{className:"diff-content"}),O("col",{className:"diff-marker"}),O("col",{className:"diff-content"})]}),O("tbody",{children:[O("tr",{children:[O(gl,{type:"from",pageid:e.fromid,pagetitle:e.fromtitle,revid:e.fromrevid,size:e.fromsize,timestamp:e.fromtimestamp,username:e.fromuser,userid:e.fromuserid,comment:e.fromcomment,parsedcomment:e.fromparsedcomment}),O(gl,{type:"to",pageid:e.toid,pagetitle:e.totitle,revid:e.torevid,size:e.tosize,timestamp:e.totimestamp,username:e.touser,userid:e.touserid,comment:e.tocomment,parsedcomment:e.toparsedcomment})]}),O("div",{id:"diffbody"}),O("tr",{className:"diff-size",style:{textAlign:"center"},children:[O("td",{colSpan:2,className:"diff-size-old",children:e.fromsize!==void 0&&`${e.fromsize} bytes`}),O("td",{colSpan:2,className:"diff-size-new",children:e.tosize!==void 0&&`${e.tosize} bytes`})]})]})]});return r.querySelector("#diffbody").outerHTML=e.body||O("tr",{children:O("td",{colSpan:4,children:O("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",height:"5rem"},children:O("i",{children:"No changes"})})})}).outerHTML,r},up=(t,e=document)=>e.querySelector(t),fp=(t,e=document)=>e.querySelectorAll(t);var dp=Object.create,As=Object.defineProperty,hp=Object.getOwnPropertyDescriptor,yl=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),vl=t=>{throw TypeError(t)},pp=(t,e,n)=>e in t?As(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,mp=(t,e)=>As(t,"name",{value:e,configurable:!0}),gp=t=>[,,,dp(t?.[yl("metadata")]??null)],yp=["class","method","getter","setter","accessor","field","value","get","set"],bl=t=>t!==void 0&&typeof t!="function"?vl("Function expected"):t,vp=(t,e,n,r,i)=>({kind:yp[t],name:e,metadata:r,addInitializer:s=>n._?vl("Already initialized"):i.push(bl(s||null))}),bp=(t,e)=>pp(e,yl("metadata"),t[3]),_p=(t,e,n,r)=>{for(var i=0,s=t[e>>1],o=s&&s.length;i<o;i++)s[i].call(n);return r},wp=(t,e,n,r,i,s)=>{var o,a,l,u=e&7,c=!1,f=0,w=t[f]||(t[f]=[]),y=u&&(i=i.prototype,u<5&&(u>3||!c)&&hp(i,n));mp(i,n);for(var v=r.length-1;v>=0;v--)l=vp(u,n,a={},t[3],w),o=(0,r[v])(i,l),a._=1,bl(o)&&(i=o);return bp(t,i),y&&As(i,n,y),c?u^4?s:y:i},_l,Is,wl;const xl=["diffChars","diffWords","diffSentences","diffLines","createTwoFilesPatch"];_l=[Ve(["jsdiff"]),Hr(xe.object({"quickDiff.preferredCompareMode":xe.union([xe.const("jsDiff"),xe.const("mwApi")]).description("The preferred comparison mode for quick diff").default("mwApi"),"quickDiff.jsDiff.defaultType":xe.union(xl.map(t=>xe.const(t))).description("The default diff type for JsDiff").default("diffSentences")}).description("Quick Diff Preferences"),{"quickDiff.preferredCompareMode":"mwApi","quickDiff.jsDiff.defaultType":"diffSentences"})];class Zr extends(wl=gt){constructor(e){super(e,{},"quick-diff"),this.ctx=e,this.VALID_DIFF_TYPES=xl,this.COMPARE_API_DEFAULT_OPTIONS={prop:["comment","diff","diffsize","ids","parsedcomment","size","timestamp","title","user"].join("|"),difftype:"table"}}start(){this.ctx.set("quickDiff",this),this.ctx.on("quickEdit/wikiPage",this.injectQuickEdit.bind(this)),window.RLQ.push(this.injectHistoryPage.bind(this))}stop(){this.ctx.off("quickEdit/wikiPage",this.injectQuickEdit.bind(this))}injectHistoryPage(){const e=up("#mw-history-compare");if(!e)return;fp(".mw-history-compareselectedversions-button",e).forEach(r=>{r.after(O("button",{className:"cdx-button",onClick:i=>{i.preventDefault();const s=new FormData(e),o=Number(s.get("oldid"))||0,a=Number(s.get("diff"))||0;if(!s.get("title")||!o||!a)return this.logger.warn("Missing title or revision IDs");this.comparePages({fromrev:o,torev:a})},children:"Quick Diff"}))})}injectQuickEdit({modal:e,wikiPage:n}){e.setButtons([{label:"Diff",side:"left",className:"btn btn-secondary",method:()=>{const r=n.title,i=n.revisions?.[0]?.content||"",s=e.get$content().find('textarea[name="text"]').prop("value")||"";return this.comparePages({fromtitle:r,fromtext:i,totitle:r,totext:s})}}])}simpleTextDiff(e,n){const r=this.ctx.modal.show({title:"Quick Diff",className:"in-page-edit ipe-quickDiff"});r.show();const i=O("pre",{className:op["diff-container"]}),s=O("div",{style:{display:"flex",gap:"1em"},children:this.VALID_DIFF_TYPES.map((o,a)=>O(ka,{name:"diffType",value:o,label:o,inputProps:{checked:a===0}}))});r.setContent(O("section",{children:[s,i]})),s.querySelectorAll('input[name="diffType"]').forEach(o=>{o.addEventListener("change",()=>{const a=this.renderJsDiff(e,n,o.value);i.textContent="",i.appendChild(a)})}),s.querySelector('input[name="diffType"]').dispatchEvent(new Event("change"))}renderJsDiff(e,n,r="diffSentences"){const i=document.createDocumentFragment();let s;if(r==="createTwoFilesPatch"){let o=!1;s=this.ctx.jsdiff.createTwoFilesPatch("original.txt","modified.txt",e,n).split(`
59
86
  `).map(function(a){const l={value:a+`
60
- `};return a.startsWith("@@")?(l.chunkHeader=!0,o=!0):o&&(a.startsWith("-")?l.removed=!0:a.startsWith("+")&&(l.added=!0)),l})}else{const o=this.ctx.jsdiff[r];if(!o)throw new Error(`Missing DiffEngine for ${r}`);s=o(e,n)}if(!Array.isArray(s))throw new Error("Missing diff result");for(let o=0;o<s.length;o++){if(s[o].added&&s[o+1]&&s[o+1].removed){const l=s[o];s[o]=s[o+1],s[o+1]=l}let a;s[o].removed?(a=document.createElement("del"),a.appendChild(document.createTextNode(s[o].value))):s[o].added?(a=document.createElement("ins"),a.appendChild(document.createTextNode(s[o].value))):s[o].chunkHeader?(a=document.createElement("span"),a.setAttribute("class","chunk-header"),a.appendChild(document.createTextNode(s[o].value))):a=document.createTextNode(s[o].value),i.appendChild(a)}return i}comparePages(e){const n=this.ctx.modal.createObject({title:"Loading diff...",content:C(Zt,{}),className:"quick-diff"}).init();return window.mw&&mw.loader.getState("mediawiki.diff.styles")!=="ready"&&mw.loader.load(["mediawiki.diff.styles"]),this.ctx.api.post({...this.COMPARE_API_DEFAULT_OPTIONS,...e,action:"compare",format:"json",formatversion:2}).then(r=>{if(r.data?.error||r.data?.errors){const s=[r.data?.error,...r.data?.errors||[]].filter(Boolean);throw new Error(s.map(o=>o.info).join(`
61
- `),{cause:r})}if(!r.data.compare)throw new Error("No compare data received",{cause:r});const{data:{compare:i}}=r;n.setTitle(i.fromtitle&&i.totitle?`${i.fromtitle} ⇔ ${i.totitle}`:"Differences"),n.setContent(C("section",{children:C(gp,{data:i})}))}).catch(r=>{n.setContent(C(Ia,{title:"Failed to load diff",type:"error",children:C("pre",{children:r instanceof Error?r.message:String(r)})}))}),n.show()}}Is=Sp(Cl),Qr=Pp(Is,0,"PluginQuickDiffCore",El,Qr),kp(Is,1,Qr);const ko=class ko extends gt{constructor(e){super(e,{},"quick-diff-loader"),this.ctx=e,e.plugin(dp),e.plugin(Qr)}};ko.inject=["api","wikiPage","modal"];let Ts=ko;const $p=Object.freeze(Object.defineProperty({__proto__:null,PluginQuickDiff:Ts},Symbol.toStringTag,{value:"Module"})),Po=class Po extends gt{constructor(e){super(e,{},"quick-redirect"),this.ctx=e}start(){this.ctx.set("quickRedirect",this.quickRedirect.bind(this)),this.ctx.set("redirectPage",this.redirectPage.bind(this));const e=window.mw?.config.get("wgPageName")||"",n=window.mw?.config.get("wgIsProbablyEditable");this.ctx.inject(["toolbox"],r=>{this.ctx=r,r.toolbox.addButton({id:"quick-redirect",icon:C("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-file-symlink",children:[C("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),C("path",{d:"M4 21v-4a3 3 0 0 1 3 -3h5"}),C("path",{d:"M9 17l3 -3l-3 -3"}),C("path",{d:"M14 3v4a1 1 0 0 0 1 1h4"}),C("path",{d:"M5 11v-6a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2h-9.5"})]}),tooltip:"Quick Redirect",group:"group1",onClick:()=>{this.quickRedirect(n?{to:e}:{})}}),this.addDisposeHandler(i=>{i.toolbox.removeButton("quick-redirect")})})}stop(){}quickRedirect(e){const n=this.ctx.modal.createObject({title:"Quick Redirect",content:C(Zt,{}),className:"quick-redirect",sizeClass:"medium",center:!0}).init();let r=null;return n.setContent(C("form",{ref:i=>r=i,style:{display:"flex",flexDirection:"column",gap:"1rem"},onSubmit:i=>{i.preventDefault();const s=new FormData(r),o={from:s.get("from"),to:s.get("to"),reason:s.get("reason")||"",overwrite:s.get("overwrite")==="on"};n.setLoadingState(!0),this.redirectPage(o).then(a=>{n.close(),this.ctx.modal.notify("success",{title:"Redirect successful",content:"The redirect has been created."})}).catch(a=>{n.setLoadingState(!1),this.ctx.modal.notify("error",{title:"Failed to redirect",content:a instanceof Error?a.message:String(a)})})},children:[C(Ba,{inputs:[{label:"From",name:"from",value:e?.from},{label:"To",name:"to",value:e?.to}]}),C(gs,{label:"Reason",id:"reason",name:"reason",value:e?.reason}),C("div",{children:C(gn,{name:"overwrite",id:"overwrite",checked:e?.overwrite,children:"Force create redirect even if the from page already exists"})}),C(Mr,{type:"primary",style:{width:"100%"},children:"Create Redirect"})]})),n.show()}async redirectPage(e){const{from:n,to:r,reason:i="",overwrite:s=!1}=e,o=await this.ctx.wikiPage.newBlankPage({title:n}),a=`#REDIRECT [[:${r}]]`,l=await o.edit({text:a,summary:i},{createonly:!s});if(l.data?.errors)throw new Error(l.data.errors[0].text,{cause:l});return l}};Po.inject=["api","wikiPage","modal"];let Rs=Po;const Ap=Object.freeze(Object.defineProperty({__proto__:null,PluginQuickRedirect:Rs},Symbol.toStringTag,{value:"Module"}));var Ip=Object.create,Ds=Object.defineProperty,Tp=Object.getOwnPropertyDescriptor,kl=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),Pl=t=>{throw TypeError(t)},Rp=(t,e,n)=>e in t?Ds(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Dp=(t,e)=>Ds(t,"name",{value:e,configurable:!0}),Np=t=>[,,,Ip(t?.[kl("metadata")]??null)],jp=["class","method","getter","setter","accessor","field","value","get","set"],$l=t=>t!==void 0&&typeof t!="function"?Pl("Function expected"):t,Lp=(t,e,n,r,i)=>({kind:jp[t],name:e,metadata:r,addInitializer:s=>n._?Pl("Already initialized"):i.push($l(s||null))}),Mp=(t,e)=>Rp(e,kl("metadata"),t[3]),Fp=(t,e,n,r)=>{for(var i=0,s=t[e>>1],o=s&&s.length;i<o;i++)s[i].call(n);return r},Bp=(t,e,n,r,i,s)=>{var o,a,l,u=e&7,c=!1,f=0,w=t[f]||(t[f]=[]),y=u&&(i=i.prototype,u<5&&(u>3||!c)&&Tp(i,n));Dp(i,n);for(var v=r.length-1;v>=0;v--)l=Lp(u,n,a={},t[3],w),o=(0,r[v])(i,l),a._=1,$l(o)&&(i=o);return Mp(t,i),y&&Ds(i,n,y),c?u^4?s:y:i},Al,Ns,Il;Al=[Br(xe.object({toolboxAlwaysShow:xe.boolean().description("Make the toolbox opened by default").default(!1)}),{toolboxAlwaysShow:!1}),Ve(["preferences"])];class Xr extends(Il=dn){constructor(e){super(e,"toolbox",!1),this.ctx=e,this.container=void 0,this.forceShow=!1}async start(){mw&&mw.config.get("wgIsArticle")===!1&&!this.forceShow?this.container=this.createIndicatorForNotArticlePage():this.container=this.createToolbox(),document.body.appendChild(this.container),await Da(0),this.ctx.preferences.get("toolboxAlwaysShow").then(e=>{e&&(this.container.querySelector("#toolbox-toggle")?.classList.add("opened"),this.container.querySelectorAll(".btn-group").forEach(n=>{n.classList.add("opened")}))})}stop(){this.container?.remove()}createToolbox(){const n=C("div",{id:"ipe-edit-toolbox",children:[C("ul",{className:"btn-group group1",style:{display:"flex",flexDirection:"column"}}),C("ul",{className:"btn-group group2",style:{display:"flex",flexDirection:"row"}}),C("button",{className:"ipe-toolbox-btn",id:"toolbox-toggle",onClick:function(r){const i=this.classList.contains("opened");this.classList.toggle("opened",!i),n.querySelectorAll(".btn-group").forEach(s=>{s.classList.toggle("opened",!i)})},children:C("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-plus",children:[C("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),C("path",{d:"M12 5l0 14"}),C("path",{d:"M5 12l14 0"})]})})]});return n}createIndicatorForNotArticlePage(){return C("div",{id:"ipe-edit-toolbox",children:C("div",{id:"ipe-toolbox-placeholder",style:"width: 0.75rem; height: 0.75rem; border-radius: 50%; background: #3f51b5; color: #fff; pointer-events: none;",children:C("svg",{style:"width: 0.5em; height: 0.5em; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"4","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-check",children:[C("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),C("path",{d:"M5 12l5 5l10 -10"})]})})})}normalizeButtonId(e){return e||(e=Math.random().toString(36).substring(2,8)),`ipe-toolbox__${e.trim()}`.replace(/\s\.#/g,"-")}addButton(e){let{id:n,group:r,icon:i,tooltip:s,buttonProps:o,onClick:a,index:l}=e;n=this.normalizeButtonId(n);const u=this.container.querySelector(`#${n}`);u&&(this.ctx.logger("toolbox").warn(`Button with id ${n} already exists, replacing it.`),u.remove());let c=null;if(typeof r>"u"||r==="auto"){const w=this.container.querySelector(".btn-group.group1"),y=this.container.querySelector(".btn-group.group2"),v=w?.children.length||0,I=y?.children.length||0;c=v<=I?w:y}else c=this.container.querySelector(`.btn-group.${r}`);if(!c)throw new Error(`Button group ${r} not found`);const f=C("li",{class:"btn-tip-group",id:n,onClick:a,children:[C("div",{class:"btn-tip",children:s}),C("button",{id:`${n}-btn`,class:"ipe-toolbox-btn",...o,children:i})]});return typeof l=="number"?l<=0?c.prepend(f):l>=c.children.length?c.appendChild(f):c.children[l]?.before(f):c.appendChild(f),this.ctx.emit("toolbox/button/added",{ctx:this.ctx,button:f}),f}removeButton(e){this.container.querySelector(`.ipe-toolbox-btn#${e}`)?.remove(),this.ctx.emit("toolbox/button/removed",{ctx:this.ctx,id:e})}}Ns=Np(Il),Xr=Bp(Ns,0,"PluginToolbox",Al,Xr),Fp(Ns,1,Xr);const Up=Object.freeze(Object.defineProperty({__proto__:null,get PluginToolbox(){return Xr}},Symbol.toStringTag,{value:"Module"}));/**
87
+ `};return a.startsWith("@@")?(l.chunkHeader=!0,o=!0):o&&(a.startsWith("-")?l.removed=!0:a.startsWith("+")&&(l.added=!0)),l})}else{const o=this.ctx.jsdiff[r];if(!o)throw new Error(`Missing DiffEngine for ${r}`);s=o(e,n)}if(!Array.isArray(s))throw new Error("Missing diff result");for(let o=0;o<s.length;o++){if(s[o].added&&s[o+1]&&s[o+1].removed){const l=s[o];s[o]=s[o+1],s[o+1]=l}let a;s[o].removed?(a=document.createElement("del"),a.appendChild(document.createTextNode(s[o].value))):s[o].added?(a=document.createElement("ins"),a.appendChild(document.createTextNode(s[o].value))):s[o].chunkHeader?(a=document.createElement("span"),a.setAttribute("class","chunk-header"),a.appendChild(document.createTextNode(s[o].value))):a=document.createTextNode(s[o].value),i.appendChild(a)}return i}comparePages(e){const n=this.ctx.modal.createObject({title:"Loading diff...",content:O(Zt,{}),className:"quick-diff"}).init();return window.mw&&mw.loader.getState("mediawiki.diff.styles")!=="ready"&&mw.loader.load(["mediawiki.diff.styles"]),this.ctx.api.post({...this.COMPARE_API_DEFAULT_OPTIONS,...e,action:"compare",format:"json",formatversion:2}).then(r=>{if(r.data?.error||r.data?.errors){const s=[r.data?.error,...r.data?.errors||[]].filter(Boolean);throw new Error(s.map(o=>o.info).join(`
88
+ `),{cause:r})}if(!r.data.compare)throw new Error("No compare data received",{cause:r});const{data:{compare:i}}=r;n.setTitle(i.fromtitle&&i.totitle?`${i.fromtitle} ⇔ ${i.totitle}`:"Differences"),n.setContent(O("section",{children:O(cp,{data:i})}))}).catch(r=>{n.setContent(O(Ca,{title:"Failed to load diff",type:"error",children:O("pre",{children:r instanceof Error?r.message:String(r)})}))}),n.show()}}Is=gp(wl),Zr=wp(Is,0,"PluginQuickDiffCore",_l,Zr),_p(Is,1,Zr);const Co=class Co extends gt{constructor(e){super(e,{},"quick-diff-loader"),this.ctx=e,e.plugin(sp),e.plugin(Zr)}};Co.inject=["api","wikiPage","modal"];let Rs=Co;const xp=Object.freeze(Object.defineProperty({__proto__:null,PluginQuickDiff:Rs},Symbol.toStringTag,{value:"Module"})),ko=class ko extends gt{constructor(e){super(e,{},"quick-redirect"),this.ctx=e}start(){this.ctx.set("quickRedirect",this.quickRedirect.bind(this)),this.ctx.set("redirectPage",this.redirectPage.bind(this));const e=window.mw?.config.get("wgPageName")||"",n=window.mw?.config.get("wgIsProbablyEditable");this.ctx.inject(["toolbox"],r=>{this.ctx=r,r.toolbox.addButton({id:"quick-redirect",icon:O("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-file-symlink",children:[O("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),O("path",{d:"M4 21v-4a3 3 0 0 1 3 -3h5"}),O("path",{d:"M9 17l3 -3l-3 -3"}),O("path",{d:"M14 3v4a1 1 0 0 0 1 1h4"}),O("path",{d:"M5 11v-6a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2h-9.5"})]}),tooltip:"Quick Redirect",group:"group1",onClick:()=>{this.quickRedirect(n?{to:e}:{})}}),this.addDisposeHandler(i=>{i.toolbox.removeButton("quick-redirect")})})}stop(){}quickRedirect(e){const n=this.ctx.modal.createObject({title:"Quick Redirect",content:O(Zt,{}),className:"quick-redirect",sizeClass:"medium",center:!0}).init();let r=null;return n.setContent(O("form",{ref:i=>r=i,style:{display:"flex",flexDirection:"column",gap:"1rem"},onSubmit:i=>{i.preventDefault();const s=new FormData(r),o={from:s.get("from"),to:s.get("to"),reason:s.get("reason")||"",overwrite:s.get("overwrite")==="on"};n.setLoadingState(!0),this.redirectPage(o).then(a=>{n.close(),this.ctx.modal.notify("success",{title:"Redirect successful",content:"The redirect has been created."})}).catch(a=>{n.setLoadingState(!1),this.ctx.modal.notify("error",{title:"Failed to redirect",content:a instanceof Error?a.message:String(a)})})},children:[O(La,{inputs:[{label:"From",name:"from",value:e?.from},{label:"To",name:"to",value:e?.to}]}),O(gs,{label:"Reason",id:"reason",name:"reason",value:e?.reason}),O("div",{children:O(gn,{name:"overwrite",id:"overwrite",checked:e?.overwrite,children:"Force create redirect even if the from page already exists"})}),O(Br,{type:"primary",style:{width:"100%"},children:"Create Redirect"})]})),n.show()}async redirectPage(e){const{from:n,to:r,reason:i="",overwrite:s=!1}=e,o=await this.ctx.wikiPage.newBlankPage({title:n}),a=`#REDIRECT [[:${r}]]`,l=await o.edit({text:a,summary:i},{createonly:!s});if(l.data?.errors)throw new Error(l.data.errors[0].text,{cause:l});return l}};ko.inject=["api","wikiPage","modal"];let Ts=ko;const Sp=Object.freeze(Object.defineProperty({__proto__:null,PluginQuickRedirect:Ts},Symbol.toStringTag,{value:"Module"}));var Ep=Object.create,Ds=Object.defineProperty,Op=Object.getOwnPropertyDescriptor,Sl=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),El=t=>{throw TypeError(t)},Pp=(t,e,n)=>e in t?Ds(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Cp=(t,e)=>Ds(t,"name",{value:e,configurable:!0}),kp=t=>[,,,Ep(t?.[Sl("metadata")]??null)],$p=["class","method","getter","setter","accessor","field","value","get","set"],Ol=t=>t!==void 0&&typeof t!="function"?El("Function expected"):t,Ap=(t,e,n,r,i)=>({kind:$p[t],name:e,metadata:r,addInitializer:s=>n._?El("Already initialized"):i.push(Ol(s||null))}),Ip=(t,e)=>Pp(e,Sl("metadata"),t[3]),Rp=(t,e,n,r)=>{for(var i=0,s=t[e>>1],o=s&&s.length;i<o;i++)s[i].call(n);return r},Tp=(t,e,n,r,i,s)=>{var o,a,l,u=e&7,c=!1,f=0,w=t[f]||(t[f]=[]),y=u&&(i=i.prototype,u<5&&(u>3||!c)&&Op(i,n));Cp(i,n);for(var v=r.length-1;v>=0;v--)l=Ap(u,n,a={},t[3],w),o=(0,r[v])(i,l),a._=1,Ol(o)&&(i=o);return Ip(t,i),y&&Ds(i,n,y),c?u^4?s:y:i},Pl,Ns,Cl;Pl=[Hr(xe.object({toolboxAlwaysShow:xe.boolean().description("Make the toolbox opened by default").default(!1)}),{toolboxAlwaysShow:!1}),Ve(["preferences"])];class ei extends(Cl=dn){constructor(e){super(e,"toolbox",!1),this.ctx=e,this.container=void 0,this.forceShow=!1}async start(){mw&&mw.config.get("wgIsArticle")===!1&&!this.forceShow?this.container=this.createIndicatorForNotArticlePage():this.container=this.createToolbox(),document.body.appendChild(this.container),await Aa(0),this.ctx.preferences.get("toolboxAlwaysShow").then(e=>{e&&(this.container.querySelector("#toolbox-toggle")?.classList.add("opened"),this.container.querySelectorAll(".btn-group").forEach(n=>{n.classList.add("opened")}))})}stop(){this.container?.remove()}createToolbox(){const n=O("div",{id:"ipe-edit-toolbox",children:[O("ul",{className:"btn-group group1",style:{display:"flex",flexDirection:"column"}}),O("ul",{className:"btn-group group2",style:{display:"flex",flexDirection:"row"}}),O("button",{className:"ipe-toolbox-btn",id:"toolbox-toggle",onClick:function(r){const i=this.classList.contains("opened");this.classList.toggle("opened",!i),n.querySelectorAll(".btn-group").forEach(s=>{s.classList.toggle("opened",!i)})},children:O("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-plus",children:[O("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),O("path",{d:"M12 5l0 14"}),O("path",{d:"M5 12l14 0"})]})})]});return n}createIndicatorForNotArticlePage(){return O("div",{id:"ipe-edit-toolbox",children:O("div",{id:"ipe-toolbox-placeholder",style:"width: 0.75rem; height: 0.75rem; border-radius: 50%; background: #3f51b5; color: #fff; pointer-events: none;",children:O("svg",{style:"width: 0.5em; height: 0.5em; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"4","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-check",children:[O("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),O("path",{d:"M5 12l5 5l10 -10"})]})})})}normalizeButtonId(e){return e||(e=Math.random().toString(36).substring(2,8)),`ipe-toolbox__${e.trim()}`.replace(/\s\.#/g,"-")}addButton(e){let{id:n,group:r,icon:i,tooltip:s,buttonProps:o,onClick:a,index:l}=e;n=this.normalizeButtonId(n);const u=this.container.querySelector(`#${n}`);u&&(this.ctx.logger("toolbox").warn(`Button with id ${n} already exists, replacing it.`),u.remove());let c=null;if(typeof r>"u"||r==="auto"){const w=this.container.querySelector(".btn-group.group1"),y=this.container.querySelector(".btn-group.group2"),v=w?.children.length||0,I=y?.children.length||0;c=v<=I?w:y}else c=this.container.querySelector(`.btn-group.${r}`);if(!c)throw new Error(`Button group ${r} not found`);const f=O("li",{class:"btn-tip-group",id:n,onClick:a,children:[O("div",{class:"btn-tip",children:s}),O("button",{id:`${n}-btn`,class:"ipe-toolbox-btn",...o,children:i})]});return typeof l=="number"?l<=0?c.prepend(f):l>=c.children.length?c.appendChild(f):c.children[l]?.before(f):c.appendChild(f),this.ctx.emit("toolbox/button/added",{ctx:this.ctx,button:f}),f}removeButton(e){this.container.querySelector(`.ipe-toolbox-btn#${e}`)?.remove(),this.ctx.emit("toolbox/button/removed",{ctx:this.ctx,id:e})}}Ns=kp(Cl),ei=Tp(Ns,0,"PluginToolbox",Pl,ei),Rp(Ns,1,ei);const Dp=Object.freeze(Object.defineProperty({__proto__:null,get PluginToolbox(){return ei}},Symbol.toStringTag,{value:"Module"}));/**
62
89
  * @vue/shared v3.5.21
63
90
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
64
91
  * @license MIT
65
- **/function js(t){const e=Object.create(null);for(const n of t.split(","))e[n]=1;return n=>n in e}const de={},yn=[],yt=()=>{},Tl=()=>!1,Zr=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&(t.charCodeAt(2)>122||t.charCodeAt(2)<97),Ls=t=>t.startsWith("onUpdate:"),De=Object.assign,Ms=(t,e)=>{const n=t.indexOf(e);n>-1&&t.splice(n,1)},Hp=Object.prototype.hasOwnProperty,pe=(t,e)=>Hp.call(t,e),se=Array.isArray,bn=t=>ei(t)==="[object Map]",Rl=t=>ei(t)==="[object Set]",oe=t=>typeof t=="function",Oe=t=>typeof t=="string",Ft=t=>typeof t=="symbol",Se=t=>t!==null&&typeof t=="object",Dl=t=>(Se(t)||oe(t))&&oe(t.then)&&oe(t.catch),Nl=Object.prototype.toString,ei=t=>Nl.call(t),Wp=t=>ei(t).slice(8,-1),jl=t=>ei(t)==="[object Object]",Fs=t=>Oe(t)&&t!=="NaN"&&t[0]!=="-"&&""+parseInt(t,10)===t,Jn=js(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),ti=t=>{const e=Object.create(null);return n=>e[n]||(e[n]=t(n))},qp=/-\w/g,Pt=ti(t=>t.replace(qp,e=>e.slice(1).toUpperCase())),zp=/\B([A-Z])/g,Bt=ti(t=>t.replace(zp,"-$1").toLowerCase()),Ll=ti(t=>t.charAt(0).toUpperCase()+t.slice(1)),Bs=ti(t=>t?`on${Ll(t)}`:""),Ge=(t,e)=>!Object.is(t,e),Us=(t,...e)=>{for(let n=0;n<t.length;n++)t[n](...e)},Ml=(t,e,n,r=!1)=>{Object.defineProperty(t,e,{configurable:!0,enumerable:!1,writable:r,value:n})},Vp=t=>{const e=parseFloat(t);return isNaN(e)?t:e};let Fl;const ni=()=>Fl||(Fl=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Hs(t){if(se(t)){const e={};for(let n=0;n<t.length;n++){const r=t[n],i=Oe(r)?Jp(r):Hs(r);if(i)for(const s in i)e[s]=i[s]}return e}else if(Oe(t)||Se(t))return t}const Kp=/;(?![^(]*\))/g,Yp=/:([^]+)/,Gp=/\/\*[^]*?\*\//g;function Jp(t){const e={};return t.replace(Gp,"").split(Kp).forEach(n=>{if(n){const r=n.split(Yp);r.length>1&&(e[r[0].trim()]=r[1].trim())}}),e}function ri(t){let e="";if(Oe(t))e=t;else if(se(t))for(let n=0;n<t.length;n++){const r=ri(t[n]);r&&(e+=r+" ")}else if(Se(t))for(const n in t)t[n]&&(e+=n+" ");return e.trim()}const Qp=js("itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly");function Bl(t){return!!t||t===""}const Ul=t=>!!(t&&t.__v_isRef===!0),ii=t=>Oe(t)?t:t==null?"":se(t)||Se(t)&&(t.toString===Nl||!oe(t.toString))?Ul(t)?ii(t.value):JSON.stringify(t,Hl,2):String(t),Hl=(t,e)=>Ul(e)?Hl(t,e.value):bn(e)?{[`Map(${e.size})`]:[...e.entries()].reduce((n,[r,i],s)=>(n[Ws(r,s)+" =>"]=i,n),{})}:Rl(e)?{[`Set(${e.size})`]:[...e.values()].map(n=>Ws(n))}:Ft(e)?Ws(e):Se(e)&&!se(e)&&!jl(e)?String(e):e,Ws=(t,e="")=>{var n;return Ft(t)?`Symbol(${(n=t.description)!=null?n:e})`:t};/**
92
+ **/function Ls(t){const e=Object.create(null);for(const n of t.split(","))e[n]=1;return n=>n in e}const de={},yn=[],yt=()=>{},kl=()=>!1,ti=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&(t.charCodeAt(2)>122||t.charCodeAt(2)<97),js=t=>t.startsWith("onUpdate:"),De=Object.assign,Ms=(t,e)=>{const n=t.indexOf(e);n>-1&&t.splice(n,1)},Np=Object.prototype.hasOwnProperty,pe=(t,e)=>Np.call(t,e),se=Array.isArray,vn=t=>ni(t)==="[object Map]",$l=t=>ni(t)==="[object Set]",oe=t=>typeof t=="function",Pe=t=>typeof t=="string",Bt=t=>typeof t=="symbol",Se=t=>t!==null&&typeof t=="object",Al=t=>(Se(t)||oe(t))&&oe(t.then)&&oe(t.catch),Il=Object.prototype.toString,ni=t=>Il.call(t),Lp=t=>ni(t).slice(8,-1),Rl=t=>ni(t)==="[object Object]",Fs=t=>Pe(t)&&t!=="NaN"&&t[0]!=="-"&&""+parseInt(t,10)===t,Jn=Ls(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),ri=t=>{const e=Object.create(null);return n=>e[n]||(e[n]=t(n))},jp=/-\w/g,$t=ri(t=>t.replace(jp,e=>e.slice(1).toUpperCase())),Mp=/\B([A-Z])/g,Ut=ri(t=>t.replace(Mp,"-$1").toLowerCase()),Tl=ri(t=>t.charAt(0).toUpperCase()+t.slice(1)),Bs=ri(t=>t?`on${Tl(t)}`:""),Ye=(t,e)=>!Object.is(t,e),Us=(t,...e)=>{for(let n=0;n<t.length;n++)t[n](...e)},Dl=(t,e,n,r=!1)=>{Object.defineProperty(t,e,{configurable:!0,enumerable:!1,writable:r,value:n})},Fp=t=>{const e=parseFloat(t);return isNaN(e)?t:e};let Nl;const ii=()=>Nl||(Nl=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Hs(t){if(se(t)){const e={};for(let n=0;n<t.length;n++){const r=t[n],i=Pe(r)?Wp(r):Hs(r);if(i)for(const s in i)e[s]=i[s]}return e}else if(Pe(t)||Se(t))return t}const Bp=/;(?![^(]*\))/g,Up=/:([^]+)/,Hp=/\/\*[^]*?\*\//g;function Wp(t){const e={};return t.replace(Hp,"").split(Bp).forEach(n=>{if(n){const r=n.split(Up);r.length>1&&(e[r[0].trim()]=r[1].trim())}}),e}function si(t){let e="";if(Pe(t))e=t;else if(se(t))for(let n=0;n<t.length;n++){const r=si(t[n]);r&&(e+=r+" ")}else if(Se(t))for(const n in t)t[n]&&(e+=n+" ");return e.trim()}const qp=Ls("itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly");function Ll(t){return!!t||t===""}const jl=t=>!!(t&&t.__v_isRef===!0),oi=t=>Pe(t)?t:t==null?"":se(t)||Se(t)&&(t.toString===Il||!oe(t.toString))?jl(t)?oi(t.value):JSON.stringify(t,Ml,2):String(t),Ml=(t,e)=>jl(e)?Ml(t,e.value):vn(e)?{[`Map(${e.size})`]:[...e.entries()].reduce((n,[r,i],s)=>(n[Ws(r,s)+" =>"]=i,n),{})}:$l(e)?{[`Set(${e.size})`]:[...e.values()].map(n=>Ws(n))}:Bt(e)?Ws(e):Se(e)&&!se(e)&&!Rl(e)?String(e):e,Ws=(t,e="")=>{var n;return Bt(t)?`Symbol(${(n=t.description)!=null?n:e})`:t};/**
66
93
  * @vue/reactivity v3.5.21
67
94
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
68
95
  * @license MIT
69
- **/let Je;class Xp{constructor(e=!1){this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=Je,!e&&Je&&(this.index=(Je.scopes||(Je.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,n;if(this.scopes)for(e=0,n=this.scopes.length;e<n;e++)this.scopes[e].pause();for(e=0,n=this.effects.length;e<n;e++)this.effects[e].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let e,n;if(this.scopes)for(e=0,n=this.scopes.length;e<n;e++)this.scopes[e].resume();for(e=0,n=this.effects.length;e<n;e++)this.effects[e].resume()}}run(e){if(this._active){const n=Je;try{return Je=this,e()}finally{Je=n}}}on(){++this._on===1&&(this.prevScope=Je,Je=this)}off(){this._on>0&&--this._on===0&&(Je=this.prevScope,this.prevScope=void 0)}stop(e){if(this._active){this._active=!1;let n,r;for(n=0,r=this.effects.length;n<r;n++)this.effects[n].stop();for(this.effects.length=0,n=0,r=this.cleanups.length;n<r;n++)this.cleanups[n]();if(this.cleanups.length=0,this.scopes){for(n=0,r=this.scopes.length;n<r;n++)this.scopes[n].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!e){const i=this.parent.scopes.pop();i&&i!==this&&(this.parent.scopes[this.index]=i,i.index=this.index)}this.parent=void 0}}}function Zp(){return Je}let we;const qs=new WeakSet;class Wl{constructor(e){this.fn=e,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,Je&&Je.active&&Je.effects.push(this)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,qs.has(this)&&(qs.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||zl(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Jl(this),Vl(this);const e=we,n=dt;we=this,dt=!0;try{return this.fn()}finally{Kl(this),we=e,dt=n,this.flags&=-3}}stop(){if(this.flags&1){for(let e=this.deps;e;e=e.nextDep)Ys(e);this.deps=this.depsTail=void 0,Jl(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?qs.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Ks(this)&&this.run()}get dirty(){return Ks(this)}}let ql=0,Qn,Xn;function zl(t,e=!1){if(t.flags|=8,e){t.next=Xn,Xn=t;return}t.next=Qn,Qn=t}function zs(){ql++}function Vs(){if(--ql>0)return;if(Xn){let e=Xn;for(Xn=void 0;e;){const n=e.next;e.next=void 0,e.flags&=-9,e=n}}let t;for(;Qn;){let e=Qn;for(Qn=void 0;e;){const n=e.next;if(e.next=void 0,e.flags&=-9,e.flags&1)try{e.trigger()}catch(r){t||(t=r)}e=n}}if(t)throw t}function Vl(t){for(let e=t.deps;e;e=e.nextDep)e.version=-1,e.prevActiveLink=e.dep.activeLink,e.dep.activeLink=e}function Kl(t){let e,n=t.depsTail,r=n;for(;r;){const i=r.prevDep;r.version===-1?(r===n&&(n=i),Ys(r),em(r)):e=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=i}t.deps=e,t.depsTail=n}function Ks(t){for(let e=t.deps;e;e=e.nextDep)if(e.dep.version!==e.version||e.dep.computed&&(Yl(e.dep.computed)||e.dep.version!==e.version))return!0;return!!t._dirty}function Yl(t){if(t.flags&4&&!(t.flags&16)||(t.flags&=-17,t.globalVersion===Zn)||(t.globalVersion=Zn,!t.isSSR&&t.flags&128&&(!t.deps&&!t._dirty||!Ks(t))))return;t.flags|=2;const e=t.dep,n=we,r=dt;we=t,dt=!0;try{Vl(t);const i=t.fn(t._value);(e.version===0||Ge(i,t._value))&&(t.flags|=128,t._value=i,e.version++)}catch(i){throw e.version++,i}finally{we=n,dt=r,Kl(t),t.flags&=-3}}function Ys(t,e=!1){const{dep:n,prevSub:r,nextSub:i}=t;if(r&&(r.nextSub=i,t.prevSub=void 0),i&&(i.prevSub=r,t.nextSub=void 0),n.subs===t&&(n.subs=r,!r&&n.computed)){n.computed.flags&=-5;for(let s=n.computed.deps;s;s=s.nextDep)Ys(s,!0)}!e&&!--n.sc&&n.map&&n.map.delete(n.key)}function em(t){const{prevDep:e,nextDep:n}=t;e&&(e.nextDep=n,t.prevDep=void 0),n&&(n.prevDep=e,t.nextDep=void 0)}let dt=!0;const Gl=[];function bt(){Gl.push(dt),dt=!1}function vt(){const t=Gl.pop();dt=t===void 0?!0:t}function Jl(t){const{cleanup:e}=t;if(t.cleanup=void 0,e){const n=we;we=void 0;try{e()}finally{we=n}}}let Zn=0;class tm{constructor(e,n){this.sub=e,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class si{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(e){if(!we||!dt||we===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==we)n=this.activeLink=new tm(we,this),we.deps?(n.prevDep=we.depsTail,we.depsTail.nextDep=n,we.depsTail=n):we.deps=we.depsTail=n,Ql(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const r=n.nextDep;r.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=r),n.prevDep=we.depsTail,n.nextDep=void 0,we.depsTail.nextDep=n,we.depsTail=n,we.deps===n&&(we.deps=r)}return n}trigger(e){this.version++,Zn++,this.notify(e)}notify(e){zs();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{Vs()}}}function Ql(t){if(t.dep.sc++,t.sub.flags&4){const e=t.dep.computed;if(e&&!t.dep.subs){e.flags|=20;for(let r=e.deps;r;r=r.nextDep)Ql(r)}const n=t.dep.subs;n!==t&&(t.prevSub=n,n&&(n.nextSub=t)),t.dep.subs=t}}const Gs=new WeakMap,tn=Symbol(""),Js=Symbol(""),er=Symbol("");function Ue(t,e,n){if(dt&&we){let r=Gs.get(t);r||Gs.set(t,r=new Map);let i=r.get(n);i||(r.set(n,i=new si),i.map=r,i.key=n),i.track()}}function $t(t,e,n,r,i,s){const o=Gs.get(t);if(!o){Zn++;return}const a=l=>{l&&l.trigger()};if(zs(),e==="clear")o.forEach(a);else{const l=se(t),u=l&&Fs(n);if(l&&n==="length"){const c=Number(r);o.forEach((f,w)=>{(w==="length"||w===er||!Ft(w)&&w>=c)&&a(f)})}else switch((n!==void 0||o.has(void 0))&&a(o.get(n)),u&&a(o.get(er)),e){case"add":l?u&&a(o.get("length")):(a(o.get(tn)),bn(t)&&a(o.get(Js)));break;case"delete":l||(a(o.get(tn)),bn(t)&&a(o.get(Js)));break;case"set":bn(t)&&a(o.get(tn));break}}Vs()}function vn(t){const e=fe(t);return e===t?e:(Ue(e,"iterate",er),ot(t)?e:e.map(Ne))}function oi(t){return Ue(t=fe(t),"iterate",er),t}const nm={__proto__:null,[Symbol.iterator](){return Qs(this,Symbol.iterator,Ne)},concat(...t){return vn(this).concat(...t.map(e=>se(e)?vn(e):e))},entries(){return Qs(this,"entries",t=>(t[1]=Ne(t[1]),t))},every(t,e){return At(this,"every",t,e,void 0,arguments)},filter(t,e){return At(this,"filter",t,e,n=>n.map(Ne),arguments)},find(t,e){return At(this,"find",t,e,Ne,arguments)},findIndex(t,e){return At(this,"findIndex",t,e,void 0,arguments)},findLast(t,e){return At(this,"findLast",t,e,Ne,arguments)},findLastIndex(t,e){return At(this,"findLastIndex",t,e,void 0,arguments)},forEach(t,e){return At(this,"forEach",t,e,void 0,arguments)},includes(...t){return Xs(this,"includes",t)},indexOf(...t){return Xs(this,"indexOf",t)},join(t){return vn(this).join(t)},lastIndexOf(...t){return Xs(this,"lastIndexOf",t)},map(t,e){return At(this,"map",t,e,void 0,arguments)},pop(){return tr(this,"pop")},push(...t){return tr(this,"push",t)},reduce(t,...e){return Xl(this,"reduce",t,e)},reduceRight(t,...e){return Xl(this,"reduceRight",t,e)},shift(){return tr(this,"shift")},some(t,e){return At(this,"some",t,e,void 0,arguments)},splice(...t){return tr(this,"splice",t)},toReversed(){return vn(this).toReversed()},toSorted(t){return vn(this).toSorted(t)},toSpliced(...t){return vn(this).toSpliced(...t)},unshift(...t){return tr(this,"unshift",t)},values(){return Qs(this,"values",Ne)}};function Qs(t,e,n){const r=oi(t),i=r[e]();return r!==t&&!ot(t)&&(i._next=i.next,i.next=()=>{const s=i._next();return s.value&&(s.value=n(s.value)),s}),i}const rm=Array.prototype;function At(t,e,n,r,i,s){const o=oi(t),a=o!==t&&!ot(t),l=o[e];if(l!==rm[e]){const f=l.apply(t,s);return a?Ne(f):f}let u=n;o!==t&&(a?u=function(f,w){return n.call(this,Ne(f),w,t)}:n.length>2&&(u=function(f,w){return n.call(this,f,w,t)}));const c=l.call(o,u,r);return a&&i?i(c):c}function Xl(t,e,n,r){const i=oi(t);let s=n;return i!==t&&(ot(t)?n.length>3&&(s=function(o,a,l){return n.call(this,o,a,l,t)}):s=function(o,a,l){return n.call(this,o,Ne(a),l,t)}),i[e](s,...r)}function Xs(t,e,n){const r=fe(t);Ue(r,"iterate",er);const i=r[e](...n);return(i===-1||i===!1)&&to(n[0])?(n[0]=fe(n[0]),r[e](...n)):i}function tr(t,e,n=[]){bt(),zs();const r=fe(t)[e].apply(t,n);return Vs(),vt(),r}const im=js("__proto__,__v_isRef,__isVue"),Zl=new Set(Object.getOwnPropertyNames(Symbol).filter(t=>t!=="arguments"&&t!=="caller").map(t=>Symbol[t]).filter(Ft));function sm(t){Ft(t)||(t=String(t));const e=fe(this);return Ue(e,"has",t),e.hasOwnProperty(t)}class ec{constructor(e=!1,n=!1){this._isReadonly=e,this._isShallow=n}get(e,n,r){if(n==="__v_skip")return e.__v_skip;const i=this._isReadonly,s=this._isShallow;if(n==="__v_isReactive")return!i;if(n==="__v_isReadonly")return i;if(n==="__v_isShallow")return s;if(n==="__v_raw")return r===(i?s?oc:sc:s?ic:rc).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(r)?e:void 0;const o=se(e);if(!i){let l;if(o&&(l=nm[n]))return l;if(n==="hasOwnProperty")return sm}const a=Reflect.get(e,n,Re(e)?e:r);return(Ft(n)?Zl.has(n):im(n))||(i||Ue(e,"get",n),s)?a:Re(a)?o&&Fs(n)?a:a.value:Se(a)?i?ac(a):eo(a):a}}class tc extends ec{constructor(e=!1){super(!1,e)}set(e,n,r,i){let s=e[n];if(!this._isShallow){const l=Ut(s);if(!ot(r)&&!Ut(r)&&(s=fe(s),r=fe(r)),!se(e)&&Re(s)&&!Re(r))return l||(s.value=r),!0}const o=se(e)&&Fs(n)?Number(n)<e.length:pe(e,n),a=Reflect.set(e,n,r,Re(e)?e:i);return e===fe(i)&&(o?Ge(r,s)&&$t(e,"set",n,r):$t(e,"add",n,r)),a}deleteProperty(e,n){const r=pe(e,n);e[n];const i=Reflect.deleteProperty(e,n);return i&&r&&$t(e,"delete",n,void 0),i}has(e,n){const r=Reflect.has(e,n);return(!Ft(n)||!Zl.has(n))&&Ue(e,"has",n),r}ownKeys(e){return Ue(e,"iterate",se(e)?"length":tn),Reflect.ownKeys(e)}}class nc extends ec{constructor(e=!1){super(!0,e)}set(e,n){return!0}deleteProperty(e,n){return!0}}const om=new tc,am=new nc,lm=new tc(!0),cm=new nc(!0),Zs=t=>t,ai=t=>Reflect.getPrototypeOf(t);function um(t,e,n){return function(...r){const i=this.__v_raw,s=fe(i),o=bn(s),a=t==="entries"||t===Symbol.iterator&&o,l=t==="keys"&&o,u=i[t](...r),c=n?Zs:e?fi:Ne;return!e&&Ue(s,"iterate",l?Js:tn),{next(){const{value:f,done:w}=u.next();return w?{value:f,done:w}:{value:a?[c(f[0]),c(f[1])]:c(f),done:w}},[Symbol.iterator](){return this}}}}function li(t){return function(...e){return t==="delete"?!1:t==="clear"?void 0:this}}function fm(t,e){const n={get(i){const s=this.__v_raw,o=fe(s),a=fe(i);t||(Ge(i,a)&&Ue(o,"get",i),Ue(o,"get",a));const{has:l}=ai(o),u=e?Zs:t?fi:Ne;if(l.call(o,i))return u(s.get(i));if(l.call(o,a))return u(s.get(a));s!==o&&s.get(i)},get size(){const i=this.__v_raw;return!t&&Ue(fe(i),"iterate",tn),i.size},has(i){const s=this.__v_raw,o=fe(s),a=fe(i);return t||(Ge(i,a)&&Ue(o,"has",i),Ue(o,"has",a)),i===a?s.has(i):s.has(i)||s.has(a)},forEach(i,s){const o=this,a=o.__v_raw,l=fe(a),u=e?Zs:t?fi:Ne;return!t&&Ue(l,"iterate",tn),a.forEach((c,f)=>i.call(s,u(c),u(f),o))}};return De(n,t?{add:li("add"),set:li("set"),delete:li("delete"),clear:li("clear")}:{add(i){!e&&!ot(i)&&!Ut(i)&&(i=fe(i));const s=fe(this);return ai(s).has.call(s,i)||(s.add(i),$t(s,"add",i,i)),this},set(i,s){!e&&!ot(s)&&!Ut(s)&&(s=fe(s));const o=fe(this),{has:a,get:l}=ai(o);let u=a.call(o,i);u||(i=fe(i),u=a.call(o,i));const c=l.call(o,i);return o.set(i,s),u?Ge(s,c)&&$t(o,"set",i,s):$t(o,"add",i,s),this},delete(i){const s=fe(this),{has:o,get:a}=ai(s);let l=o.call(s,i);l||(i=fe(i),l=o.call(s,i)),a&&a.call(s,i);const u=s.delete(i);return l&&$t(s,"delete",i,void 0),u},clear(){const i=fe(this),s=i.size!==0,o=i.clear();return s&&$t(i,"clear",void 0,void 0),o}}),["keys","values","entries",Symbol.iterator].forEach(i=>{n[i]=um(i,t,e)}),n}function ci(t,e){const n=fm(t,e);return(r,i,s)=>i==="__v_isReactive"?!t:i==="__v_isReadonly"?t:i==="__v_raw"?r:Reflect.get(pe(n,i)&&i in r?n:r,i,s)}const dm={get:ci(!1,!1)},hm={get:ci(!1,!0)},pm={get:ci(!0,!1)},mm={get:ci(!0,!0)},rc=new WeakMap,ic=new WeakMap,sc=new WeakMap,oc=new WeakMap;function gm(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function ym(t){return t.__v_skip||!Object.isExtensible(t)?0:gm(Wp(t))}function eo(t){return Ut(t)?t:ui(t,!1,om,dm,rc)}function bm(t){return ui(t,!1,lm,hm,ic)}function ac(t){return ui(t,!0,am,pm,sc)}function jb(t){return ui(t,!0,cm,mm,oc)}function ui(t,e,n,r,i){if(!Se(t)||t.__v_raw&&!(e&&t.__v_isReactive))return t;const s=ym(t);if(s===0)return t;const o=i.get(t);if(o)return o;const a=new Proxy(t,s===2?r:n);return i.set(t,a),a}function _n(t){return Ut(t)?_n(t.__v_raw):!!(t&&t.__v_isReactive)}function Ut(t){return!!(t&&t.__v_isReadonly)}function ot(t){return!!(t&&t.__v_isShallow)}function to(t){return t?!!t.__v_raw:!1}function fe(t){const e=t&&t.__v_raw;return e?fe(e):t}function vm(t){return!pe(t,"__v_skip")&&Object.isExtensible(t)&&Ml(t,"__v_skip",!0),t}const Ne=t=>Se(t)?eo(t):t,fi=t=>Se(t)?ac(t):t;function Re(t){return t?t.__v_isRef===!0:!1}function di(t){return lc(t,!1)}function _m(t){return lc(t,!0)}function lc(t,e){return Re(t)?t:new wm(t,e)}class wm{constructor(e,n){this.dep=new si,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?e:fe(e),this._value=n?e:Ne(e),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(e){const n=this._rawValue,r=this.__v_isShallow||ot(e)||Ut(e);e=r?e:fe(e),Ge(e,n)&&(this._rawValue=e,this._value=r?e:Ne(e),this.dep.trigger())}}function cc(t){return Re(t)?t.value:t}const xm={get:(t,e,n)=>e==="__v_raw"?t:cc(Reflect.get(t,e,n)),set:(t,e,n,r)=>{const i=t[e];return Re(i)&&!Re(n)?(i.value=n,!0):Reflect.set(t,e,n,r)}};function uc(t){return _n(t)?t:new Proxy(t,xm)}class Sm{constructor(e){this.__v_isRef=!0,this._value=void 0;const n=this.dep=new si,{get:r,set:i}=e(n.track.bind(n),n.trigger.bind(n));this._get=r,this._set=i}get value(){return this._value=this._get()}set value(e){this._set(e)}}function Em(t){return new Sm(t)}class Cm{constructor(e,n,r){this.fn=e,this.setter=n,this._value=void 0,this.dep=new si(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Zn-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=r}notify(){if(this.flags|=16,!(this.flags&8)&&we!==this)return zl(this,!0),!0}get value(){const e=this.dep.track();return Yl(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}}function Om(t,e,n=!1){let r,i;return oe(t)?r=t:(r=t.get,i=t.set),new Cm(r,i,n)}const hi={},pi=new WeakMap;let nn;function km(t,e=!1,n=nn){if(n){let r=pi.get(n);r||pi.set(n,r=[]),r.push(t)}}function Pm(t,e,n=de){const{immediate:r,deep:i,once:s,scheduler:o,augmentJob:a,call:l}=n,u=m=>i?m:ot(m)||i===!1||i===0?It(m,1):It(m);let c,f,w,y,v=!1,I=!1;if(Re(t)?(f=()=>t.value,v=ot(t)):_n(t)?(f=()=>u(t),v=!0):se(t)?(I=!0,v=t.some(m=>_n(m)||ot(m)),f=()=>t.map(m=>{if(Re(m))return m.value;if(_n(m))return u(m);if(oe(m))return l?l(m,2):m()})):oe(t)?e?f=l?()=>l(t,2):t:f=()=>{if(w){bt();try{w()}finally{vt()}}const m=nn;nn=c;try{return l?l(t,3,[y]):t(y)}finally{nn=m}}:f=yt,e&&i){const m=f,h=i===!0?1/0:i;f=()=>It(m(),h)}const z=Zp(),F=()=>{c.stop(),z&&z.active&&Ms(z.effects,c)};if(s&&e){const m=e;e=(...h)=>{m(...h),F()}}let A=I?new Array(t.length).fill(hi):hi;const g=m=>{if(!(!(c.flags&1)||!c.dirty&&!m))if(e){const h=c.run();if(i||v||(I?h.some((O,P)=>Ge(O,A[P])):Ge(h,A))){w&&w();const O=nn;nn=c;try{const P=[h,A===hi?void 0:I&&A[0]===hi?[]:A,y];A=h,l?l(e,3,P):e(...P)}finally{nn=O}}}else c.run()};return a&&a(g),c=new Wl(f),c.scheduler=o?()=>o(g,!1):g,y=m=>km(m,!1,c),w=c.onStop=()=>{const m=pi.get(c);if(m){if(l)l(m,4);else for(const h of m)h();pi.delete(c)}},e?r?g(!0):A=c.run():o?o(g.bind(null,!0),!0):c.run(),F.pause=c.pause.bind(c),F.resume=c.resume.bind(c),F.stop=F,F}function It(t,e=1/0,n){if(e<=0||!Se(t)||t.__v_skip||(n=n||new Map,(n.get(t)||0)>=e))return t;if(n.set(t,e),e--,Re(t))It(t.value,e,n);else if(se(t))for(let r=0;r<t.length;r++)It(t[r],e,n);else if(Rl(t)||bn(t))t.forEach(r=>{It(r,e,n)});else if(jl(t)){for(const r in t)It(t[r],e,n);for(const r of Object.getOwnPropertySymbols(t))Object.prototype.propertyIsEnumerable.call(t,r)&&It(t[r],e,n)}return t}/**
96
+ **/let Je;class zp{constructor(e=!1){this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=Je,!e&&Je&&(this.index=(Je.scopes||(Je.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,n;if(this.scopes)for(e=0,n=this.scopes.length;e<n;e++)this.scopes[e].pause();for(e=0,n=this.effects.length;e<n;e++)this.effects[e].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let e,n;if(this.scopes)for(e=0,n=this.scopes.length;e<n;e++)this.scopes[e].resume();for(e=0,n=this.effects.length;e<n;e++)this.effects[e].resume()}}run(e){if(this._active){const n=Je;try{return Je=this,e()}finally{Je=n}}}on(){++this._on===1&&(this.prevScope=Je,Je=this)}off(){this._on>0&&--this._on===0&&(Je=this.prevScope,this.prevScope=void 0)}stop(e){if(this._active){this._active=!1;let n,r;for(n=0,r=this.effects.length;n<r;n++)this.effects[n].stop();for(this.effects.length=0,n=0,r=this.cleanups.length;n<r;n++)this.cleanups[n]();if(this.cleanups.length=0,this.scopes){for(n=0,r=this.scopes.length;n<r;n++)this.scopes[n].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!e){const i=this.parent.scopes.pop();i&&i!==this&&(this.parent.scopes[this.index]=i,i.index=this.index)}this.parent=void 0}}}function Vp(){return Je}let we;const qs=new WeakSet;class Fl{constructor(e){this.fn=e,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,Je&&Je.active&&Je.effects.push(this)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,qs.has(this)&&(qs.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||Ul(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Vl(this),Hl(this);const e=we,n=dt;we=this,dt=!0;try{return this.fn()}finally{Wl(this),we=e,dt=n,this.flags&=-3}}stop(){if(this.flags&1){for(let e=this.deps;e;e=e.nextDep)Gs(e);this.deps=this.depsTail=void 0,Vl(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?qs.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Ks(this)&&this.run()}get dirty(){return Ks(this)}}let Bl=0,Qn,Xn;function Ul(t,e=!1){if(t.flags|=8,e){t.next=Xn,Xn=t;return}t.next=Qn,Qn=t}function zs(){Bl++}function Vs(){if(--Bl>0)return;if(Xn){let e=Xn;for(Xn=void 0;e;){const n=e.next;e.next=void 0,e.flags&=-9,e=n}}let t;for(;Qn;){let e=Qn;for(Qn=void 0;e;){const n=e.next;if(e.next=void 0,e.flags&=-9,e.flags&1)try{e.trigger()}catch(r){t||(t=r)}e=n}}if(t)throw t}function Hl(t){for(let e=t.deps;e;e=e.nextDep)e.version=-1,e.prevActiveLink=e.dep.activeLink,e.dep.activeLink=e}function Wl(t){let e,n=t.depsTail,r=n;for(;r;){const i=r.prevDep;r.version===-1?(r===n&&(n=i),Gs(r),Kp(r)):e=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=i}t.deps=e,t.depsTail=n}function Ks(t){for(let e=t.deps;e;e=e.nextDep)if(e.dep.version!==e.version||e.dep.computed&&(ql(e.dep.computed)||e.dep.version!==e.version))return!0;return!!t._dirty}function ql(t){if(t.flags&4&&!(t.flags&16)||(t.flags&=-17,t.globalVersion===Zn)||(t.globalVersion=Zn,!t.isSSR&&t.flags&128&&(!t.deps&&!t._dirty||!Ks(t))))return;t.flags|=2;const e=t.dep,n=we,r=dt;we=t,dt=!0;try{Hl(t);const i=t.fn(t._value);(e.version===0||Ye(i,t._value))&&(t.flags|=128,t._value=i,e.version++)}catch(i){throw e.version++,i}finally{we=n,dt=r,Wl(t),t.flags&=-3}}function Gs(t,e=!1){const{dep:n,prevSub:r,nextSub:i}=t;if(r&&(r.nextSub=i,t.prevSub=void 0),i&&(i.prevSub=r,t.nextSub=void 0),n.subs===t&&(n.subs=r,!r&&n.computed)){n.computed.flags&=-5;for(let s=n.computed.deps;s;s=s.nextDep)Gs(s,!0)}!e&&!--n.sc&&n.map&&n.map.delete(n.key)}function Kp(t){const{prevDep:e,nextDep:n}=t;e&&(e.nextDep=n,t.prevDep=void 0),n&&(n.prevDep=e,t.nextDep=void 0)}let dt=!0;const zl=[];function vt(){zl.push(dt),dt=!1}function bt(){const t=zl.pop();dt=t===void 0?!0:t}function Vl(t){const{cleanup:e}=t;if(t.cleanup=void 0,e){const n=we;we=void 0;try{e()}finally{we=n}}}let Zn=0;class Gp{constructor(e,n){this.sub=e,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class ai{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(e){if(!we||!dt||we===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==we)n=this.activeLink=new Gp(we,this),we.deps?(n.prevDep=we.depsTail,we.depsTail.nextDep=n,we.depsTail=n):we.deps=we.depsTail=n,Kl(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const r=n.nextDep;r.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=r),n.prevDep=we.depsTail,n.nextDep=void 0,we.depsTail.nextDep=n,we.depsTail=n,we.deps===n&&(we.deps=r)}return n}trigger(e){this.version++,Zn++,this.notify(e)}notify(e){zs();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{Vs()}}}function Kl(t){if(t.dep.sc++,t.sub.flags&4){const e=t.dep.computed;if(e&&!t.dep.subs){e.flags|=20;for(let r=e.deps;r;r=r.nextDep)Kl(r)}const n=t.dep.subs;n!==t&&(t.prevSub=n,n&&(n.nextSub=t)),t.dep.subs=t}}const Ys=new WeakMap,tn=Symbol(""),Js=Symbol(""),er=Symbol("");function Ue(t,e,n){if(dt&&we){let r=Ys.get(t);r||Ys.set(t,r=new Map);let i=r.get(n);i||(r.set(n,i=new ai),i.map=r,i.key=n),i.track()}}function At(t,e,n,r,i,s){const o=Ys.get(t);if(!o){Zn++;return}const a=l=>{l&&l.trigger()};if(zs(),e==="clear")o.forEach(a);else{const l=se(t),u=l&&Fs(n);if(l&&n==="length"){const c=Number(r);o.forEach((f,w)=>{(w==="length"||w===er||!Bt(w)&&w>=c)&&a(f)})}else switch((n!==void 0||o.has(void 0))&&a(o.get(n)),u&&a(o.get(er)),e){case"add":l?u&&a(o.get("length")):(a(o.get(tn)),vn(t)&&a(o.get(Js)));break;case"delete":l||(a(o.get(tn)),vn(t)&&a(o.get(Js)));break;case"set":vn(t)&&a(o.get(tn));break}}Vs()}function bn(t){const e=fe(t);return e===t?e:(Ue(e,"iterate",er),ot(t)?e:e.map(Ne))}function li(t){return Ue(t=fe(t),"iterate",er),t}const Yp={__proto__:null,[Symbol.iterator](){return Qs(this,Symbol.iterator,Ne)},concat(...t){return bn(this).concat(...t.map(e=>se(e)?bn(e):e))},entries(){return Qs(this,"entries",t=>(t[1]=Ne(t[1]),t))},every(t,e){return It(this,"every",t,e,void 0,arguments)},filter(t,e){return It(this,"filter",t,e,n=>n.map(Ne),arguments)},find(t,e){return It(this,"find",t,e,Ne,arguments)},findIndex(t,e){return It(this,"findIndex",t,e,void 0,arguments)},findLast(t,e){return It(this,"findLast",t,e,Ne,arguments)},findLastIndex(t,e){return It(this,"findLastIndex",t,e,void 0,arguments)},forEach(t,e){return It(this,"forEach",t,e,void 0,arguments)},includes(...t){return Xs(this,"includes",t)},indexOf(...t){return Xs(this,"indexOf",t)},join(t){return bn(this).join(t)},lastIndexOf(...t){return Xs(this,"lastIndexOf",t)},map(t,e){return It(this,"map",t,e,void 0,arguments)},pop(){return tr(this,"pop")},push(...t){return tr(this,"push",t)},reduce(t,...e){return Gl(this,"reduce",t,e)},reduceRight(t,...e){return Gl(this,"reduceRight",t,e)},shift(){return tr(this,"shift")},some(t,e){return It(this,"some",t,e,void 0,arguments)},splice(...t){return tr(this,"splice",t)},toReversed(){return bn(this).toReversed()},toSorted(t){return bn(this).toSorted(t)},toSpliced(...t){return bn(this).toSpliced(...t)},unshift(...t){return tr(this,"unshift",t)},values(){return Qs(this,"values",Ne)}};function Qs(t,e,n){const r=li(t),i=r[e]();return r!==t&&!ot(t)&&(i._next=i.next,i.next=()=>{const s=i._next();return s.value&&(s.value=n(s.value)),s}),i}const Jp=Array.prototype;function It(t,e,n,r,i,s){const o=li(t),a=o!==t&&!ot(t),l=o[e];if(l!==Jp[e]){const f=l.apply(t,s);return a?Ne(f):f}let u=n;o!==t&&(a?u=function(f,w){return n.call(this,Ne(f),w,t)}:n.length>2&&(u=function(f,w){return n.call(this,f,w,t)}));const c=l.call(o,u,r);return a&&i?i(c):c}function Gl(t,e,n,r){const i=li(t);let s=n;return i!==t&&(ot(t)?n.length>3&&(s=function(o,a,l){return n.call(this,o,a,l,t)}):s=function(o,a,l){return n.call(this,o,Ne(a),l,t)}),i[e](s,...r)}function Xs(t,e,n){const r=fe(t);Ue(r,"iterate",er);const i=r[e](...n);return(i===-1||i===!1)&&to(n[0])?(n[0]=fe(n[0]),r[e](...n)):i}function tr(t,e,n=[]){vt(),zs();const r=fe(t)[e].apply(t,n);return Vs(),bt(),r}const Qp=Ls("__proto__,__v_isRef,__isVue"),Yl=new Set(Object.getOwnPropertyNames(Symbol).filter(t=>t!=="arguments"&&t!=="caller").map(t=>Symbol[t]).filter(Bt));function Xp(t){Bt(t)||(t=String(t));const e=fe(this);return Ue(e,"has",t),e.hasOwnProperty(t)}class Jl{constructor(e=!1,n=!1){this._isReadonly=e,this._isShallow=n}get(e,n,r){if(n==="__v_skip")return e.__v_skip;const i=this._isReadonly,s=this._isShallow;if(n==="__v_isReactive")return!i;if(n==="__v_isReadonly")return i;if(n==="__v_isShallow")return s;if(n==="__v_raw")return r===(i?s?nc:tc:s?ec:Zl).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(r)?e:void 0;const o=se(e);if(!i){let l;if(o&&(l=Yp[n]))return l;if(n==="hasOwnProperty")return Xp}const a=Reflect.get(e,n,Te(e)?e:r);return(Bt(n)?Yl.has(n):Qp(n))||(i||Ue(e,"get",n),s)?a:Te(a)?o&&Fs(n)?a:a.value:Se(a)?i?rc(a):eo(a):a}}class Ql extends Jl{constructor(e=!1){super(!1,e)}set(e,n,r,i){let s=e[n];if(!this._isShallow){const l=Ht(s);if(!ot(r)&&!Ht(r)&&(s=fe(s),r=fe(r)),!se(e)&&Te(s)&&!Te(r))return l||(s.value=r),!0}const o=se(e)&&Fs(n)?Number(n)<e.length:pe(e,n),a=Reflect.set(e,n,r,Te(e)?e:i);return e===fe(i)&&(o?Ye(r,s)&&At(e,"set",n,r):At(e,"add",n,r)),a}deleteProperty(e,n){const r=pe(e,n);e[n];const i=Reflect.deleteProperty(e,n);return i&&r&&At(e,"delete",n,void 0),i}has(e,n){const r=Reflect.has(e,n);return(!Bt(n)||!Yl.has(n))&&Ue(e,"has",n),r}ownKeys(e){return Ue(e,"iterate",se(e)?"length":tn),Reflect.ownKeys(e)}}class Xl extends Jl{constructor(e=!1){super(!0,e)}set(e,n){return!0}deleteProperty(e,n){return!0}}const Zp=new Ql,em=new Xl,tm=new Ql(!0),nm=new Xl(!0),Zs=t=>t,ci=t=>Reflect.getPrototypeOf(t);function rm(t,e,n){return function(...r){const i=this.__v_raw,s=fe(i),o=vn(s),a=t==="entries"||t===Symbol.iterator&&o,l=t==="keys"&&o,u=i[t](...r),c=n?Zs:e?hi:Ne;return!e&&Ue(s,"iterate",l?Js:tn),{next(){const{value:f,done:w}=u.next();return w?{value:f,done:w}:{value:a?[c(f[0]),c(f[1])]:c(f),done:w}},[Symbol.iterator](){return this}}}}function ui(t){return function(...e){return t==="delete"?!1:t==="clear"?void 0:this}}function im(t,e){const n={get(i){const s=this.__v_raw,o=fe(s),a=fe(i);t||(Ye(i,a)&&Ue(o,"get",i),Ue(o,"get",a));const{has:l}=ci(o),u=e?Zs:t?hi:Ne;if(l.call(o,i))return u(s.get(i));if(l.call(o,a))return u(s.get(a));s!==o&&s.get(i)},get size(){const i=this.__v_raw;return!t&&Ue(fe(i),"iterate",tn),i.size},has(i){const s=this.__v_raw,o=fe(s),a=fe(i);return t||(Ye(i,a)&&Ue(o,"has",i),Ue(o,"has",a)),i===a?s.has(i):s.has(i)||s.has(a)},forEach(i,s){const o=this,a=o.__v_raw,l=fe(a),u=e?Zs:t?hi:Ne;return!t&&Ue(l,"iterate",tn),a.forEach((c,f)=>i.call(s,u(c),u(f),o))}};return De(n,t?{add:ui("add"),set:ui("set"),delete:ui("delete"),clear:ui("clear")}:{add(i){!e&&!ot(i)&&!Ht(i)&&(i=fe(i));const s=fe(this);return ci(s).has.call(s,i)||(s.add(i),At(s,"add",i,i)),this},set(i,s){!e&&!ot(s)&&!Ht(s)&&(s=fe(s));const o=fe(this),{has:a,get:l}=ci(o);let u=a.call(o,i);u||(i=fe(i),u=a.call(o,i));const c=l.call(o,i);return o.set(i,s),u?Ye(s,c)&&At(o,"set",i,s):At(o,"add",i,s),this},delete(i){const s=fe(this),{has:o,get:a}=ci(s);let l=o.call(s,i);l||(i=fe(i),l=o.call(s,i)),a&&a.call(s,i);const u=s.delete(i);return l&&At(s,"delete",i,void 0),u},clear(){const i=fe(this),s=i.size!==0,o=i.clear();return s&&At(i,"clear",void 0,void 0),o}}),["keys","values","entries",Symbol.iterator].forEach(i=>{n[i]=rm(i,t,e)}),n}function fi(t,e){const n=im(t,e);return(r,i,s)=>i==="__v_isReactive"?!t:i==="__v_isReadonly"?t:i==="__v_raw"?r:Reflect.get(pe(n,i)&&i in r?n:r,i,s)}const sm={get:fi(!1,!1)},om={get:fi(!1,!0)},am={get:fi(!0,!1)},lm={get:fi(!0,!0)},Zl=new WeakMap,ec=new WeakMap,tc=new WeakMap,nc=new WeakMap;function cm(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function um(t){return t.__v_skip||!Object.isExtensible(t)?0:cm(Lp(t))}function eo(t){return Ht(t)?t:di(t,!1,Zp,sm,Zl)}function fm(t){return di(t,!1,tm,om,ec)}function rc(t){return di(t,!0,em,am,tc)}function $v(t){return di(t,!0,nm,lm,nc)}function di(t,e,n,r,i){if(!Se(t)||t.__v_raw&&!(e&&t.__v_isReactive))return t;const s=um(t);if(s===0)return t;const o=i.get(t);if(o)return o;const a=new Proxy(t,s===2?r:n);return i.set(t,a),a}function _n(t){return Ht(t)?_n(t.__v_raw):!!(t&&t.__v_isReactive)}function Ht(t){return!!(t&&t.__v_isReadonly)}function ot(t){return!!(t&&t.__v_isShallow)}function to(t){return t?!!t.__v_raw:!1}function fe(t){const e=t&&t.__v_raw;return e?fe(e):t}function dm(t){return!pe(t,"__v_skip")&&Object.isExtensible(t)&&Dl(t,"__v_skip",!0),t}const Ne=t=>Se(t)?eo(t):t,hi=t=>Se(t)?rc(t):t;function Te(t){return t?t.__v_isRef===!0:!1}function pi(t){return ic(t,!1)}function hm(t){return ic(t,!0)}function ic(t,e){return Te(t)?t:new pm(t,e)}class pm{constructor(e,n){this.dep=new ai,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?e:fe(e),this._value=n?e:Ne(e),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(e){const n=this._rawValue,r=this.__v_isShallow||ot(e)||Ht(e);e=r?e:fe(e),Ye(e,n)&&(this._rawValue=e,this._value=r?e:Ne(e),this.dep.trigger())}}function sc(t){return Te(t)?t.value:t}const mm={get:(t,e,n)=>e==="__v_raw"?t:sc(Reflect.get(t,e,n)),set:(t,e,n,r)=>{const i=t[e];return Te(i)&&!Te(n)?(i.value=n,!0):Reflect.set(t,e,n,r)}};function oc(t){return _n(t)?t:new Proxy(t,mm)}class gm{constructor(e){this.__v_isRef=!0,this._value=void 0;const n=this.dep=new ai,{get:r,set:i}=e(n.track.bind(n),n.trigger.bind(n));this._get=r,this._set=i}get value(){return this._value=this._get()}set value(e){this._set(e)}}function ym(t){return new gm(t)}class vm{constructor(e,n,r){this.fn=e,this.setter=n,this._value=void 0,this.dep=new ai(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Zn-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=r}notify(){if(this.flags|=16,!(this.flags&8)&&we!==this)return Ul(this,!0),!0}get value(){const e=this.dep.track();return ql(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}}function bm(t,e,n=!1){let r,i;return oe(t)?r=t:(r=t.get,i=t.set),new vm(r,i,n)}const mi={},gi=new WeakMap;let nn;function _m(t,e=!1,n=nn){if(n){let r=gi.get(n);r||gi.set(n,r=[]),r.push(t)}}function wm(t,e,n=de){const{immediate:r,deep:i,once:s,scheduler:o,augmentJob:a,call:l}=n,u=m=>i?m:ot(m)||i===!1||i===0?Rt(m,1):Rt(m);let c,f,w,y,v=!1,I=!1;if(Te(t)?(f=()=>t.value,v=ot(t)):_n(t)?(f=()=>u(t),v=!0):se(t)?(I=!0,v=t.some(m=>_n(m)||ot(m)),f=()=>t.map(m=>{if(Te(m))return m.value;if(_n(m))return u(m);if(oe(m))return l?l(m,2):m()})):oe(t)?e?f=l?()=>l(t,2):t:f=()=>{if(w){vt();try{w()}finally{bt()}}const m=nn;nn=c;try{return l?l(t,3,[y]):t(y)}finally{nn=m}}:f=yt,e&&i){const m=f,h=i===!0?1/0:i;f=()=>Rt(m(),h)}const z=Vp(),F=()=>{c.stop(),z&&z.active&&Ms(z.effects,c)};if(s&&e){const m=e;e=(...h)=>{m(...h),F()}}let A=I?new Array(t.length).fill(mi):mi;const g=m=>{if(!(!(c.flags&1)||!c.dirty&&!m))if(e){const h=c.run();if(i||v||(I?h.some((P,k)=>Ye(P,A[k])):Ye(h,A))){w&&w();const P=nn;nn=c;try{const k=[h,A===mi?void 0:I&&A[0]===mi?[]:A,y];A=h,l?l(e,3,k):e(...k)}finally{nn=P}}}else c.run()};return a&&a(g),c=new Fl(f),c.scheduler=o?()=>o(g,!1):g,y=m=>_m(m,!1,c),w=c.onStop=()=>{const m=gi.get(c);if(m){if(l)l(m,4);else for(const h of m)h();gi.delete(c)}},e?r?g(!0):A=c.run():o?o(g.bind(null,!0),!0):c.run(),F.pause=c.pause.bind(c),F.resume=c.resume.bind(c),F.stop=F,F}function Rt(t,e=1/0,n){if(e<=0||!Se(t)||t.__v_skip||(n=n||new Map,(n.get(t)||0)>=e))return t;if(n.set(t,e),e--,Te(t))Rt(t.value,e,n);else if(se(t))for(let r=0;r<t.length;r++)Rt(t[r],e,n);else if($l(t)||vn(t))t.forEach(r=>{Rt(r,e,n)});else if(Rl(t)){for(const r in t)Rt(t[r],e,n);for(const r of Object.getOwnPropertySymbols(t))Object.prototype.propertyIsEnumerable.call(t,r)&&Rt(t[r],e,n)}return t}/**
70
97
  * @vue/runtime-core v3.5.21
71
98
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
72
99
  * @license MIT
73
- **/const nr=[];let no=!1;function Lb(t,...e){if(no)return;no=!0,bt();const n=nr.length?nr[nr.length-1].component:null,r=n&&n.appContext.config.warnHandler,i=$m();if(r)wn(r,n,11,[t+e.map(s=>{var o,a;return(a=(o=s.toString)==null?void 0:o.call(s))!=null?a:JSON.stringify(s)}).join(""),n&&n.proxy,i.map(({vnode:s})=>`at <${cu(n,s.type)}>`).join(`
100
+ **/const nr=[];let no=!1;function Av(t,...e){if(no)return;no=!0,vt();const n=nr.length?nr[nr.length-1].component:null,r=n&&n.appContext.config.warnHandler,i=xm();if(r)wn(r,n,11,[t+e.map(s=>{var o,a;return(a=(o=s.toString)==null?void 0:o.call(s))!=null?a:JSON.stringify(s)}).join(""),n&&n.proxy,i.map(({vnode:s})=>`at <${su(n,s.type)}>`).join(`
74
101
  `),i]);else{const s=[`[Vue warn]: ${t}`,...e];i.length&&s.push(`
75
- `,...Am(i)),console.warn(...s)}vt(),no=!1}function $m(){let t=nr[nr.length-1];if(!t)return[];const e=[];for(;t;){const n=e[0];n&&n.vnode===t?n.recurseCount++:e.push({vnode:t,recurseCount:0});const r=t.component&&t.component.parent;t=r&&r.vnode}return e}function Am(t){const e=[];return t.forEach((n,r)=>{e.push(...r===0?[]:[`
76
- `],...Im(n))}),e}function Im({vnode:t,recurseCount:e}){const n=e>0?`... (${e} recursive calls)`:"",r=t.component?t.component.parent==null:!1,i=` at <${cu(t.component,t.type,r)}`,s=">"+n;return t.props?[i,...Tm(t.props),s]:[i+s]}function Tm(t){const e=[],n=Object.keys(t);return n.slice(0,3).forEach(r=>{e.push(...fc(r,t[r]))}),n.length>3&&e.push(" ..."),e}function fc(t,e,n){return Oe(e)?(e=JSON.stringify(e),n?e:[`${t}=${e}`]):typeof e=="number"||typeof e=="boolean"||e==null?n?e:[`${t}=${e}`]:Re(e)?(e=fc(t,fe(e.value),!0),n?e:[`${t}=Ref<`,e,">"]):oe(e)?[`${t}=fn${e.name?`<${e.name}>`:""}`]:(e=fe(e),n?e:[`${t}=`,e])}function wn(t,e,n,r){try{return r?t(...r):t()}catch(i){mi(i,e,n)}}function _t(t,e,n,r){if(oe(t)){const i=wn(t,e,n,r);return i&&Dl(i)&&i.catch(s=>{mi(s,e,n)}),i}if(se(t)){const i=[];for(let s=0;s<t.length;s++)i.push(_t(t[s],e,n,r));return i}}function mi(t,e,n,r=!0){const i=e?e.vnode:null,{errorHandler:s,throwUnhandledErrorInProduction:o}=e&&e.appContext.config||de;if(e){let a=e.parent;const l=e.proxy,u=`https://vuejs.org/error-reference/#runtime-${n}`;for(;a;){const c=a.ec;if(c){for(let f=0;f<c.length;f++)if(c[f](t,l,u)===!1)return}a=a.parent}if(s){bt(),wn(s,null,10,[t,l,u]),vt();return}}Rm(t,n,i,r,o)}function Rm(t,e,n,r=!0,i=!1){if(i)throw t;console.error(t)}const He=[];let wt=-1;const xn=[];let Ht=null,Sn=0;const dc=Promise.resolve();let gi=null;function yi(t){const e=gi||dc;return t?e.then(this?t.bind(this):t):e}function Dm(t){let e=wt+1,n=He.length;for(;e<n;){const r=e+n>>>1,i=He[r],s=rr(i);s<t||s===t&&i.flags&2?e=r+1:n=r}return e}function ro(t){if(!(t.flags&1)){const e=rr(t),n=He[He.length-1];!n||!(t.flags&2)&&e>=rr(n)?He.push(t):He.splice(Dm(e),0,t),t.flags|=1,hc()}}function hc(){gi||(gi=dc.then(gc))}function Nm(t){se(t)?xn.push(...t):Ht&&t.id===-1?Ht.splice(Sn+1,0,t):t.flags&1||(xn.push(t),t.flags|=1),hc()}function pc(t,e,n=wt+1){for(;n<He.length;n++){const r=He[n];if(r&&r.flags&2){if(t&&r.id!==t.uid)continue;He.splice(n,1),n--,r.flags&4&&(r.flags&=-2),r(),r.flags&4||(r.flags&=-2)}}}function mc(t){if(xn.length){const e=[...new Set(xn)].sort((n,r)=>rr(n)-rr(r));if(xn.length=0,Ht){Ht.push(...e);return}for(Ht=e,Sn=0;Sn<Ht.length;Sn++){const n=Ht[Sn];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}Ht=null,Sn=0}}const rr=t=>t.id==null?t.flags&2?-1:1/0:t.id;function gc(t){try{for(wt=0;wt<He.length;wt++){const e=He[wt];e&&!(e.flags&8)&&(e.flags&4&&(e.flags&=-2),wn(e,e.i,e.i?15:14),e.flags&4||(e.flags&=-2))}}finally{for(;wt<He.length;wt++){const e=He[wt];e&&(e.flags&=-2)}wt=-1,He.length=0,mc(),gi=null,(He.length||xn.length)&&gc()}}let at=null,yc=null;function bi(t){const e=at;return at=t,yc=t&&t.type.__scopeId||null,e}function jm(t,e=at,n){if(!e||t._n)return t;const r=(...i)=>{r._d&&eu(-1);const s=bi(e);let o;try{o=t(...i)}finally{bi(s),r._d&&eu(1)}return o};return r._n=!0,r._c=!0,r._d=!0,r}function Lm(t,e){if(at===null)return t;const n=Pi(at),r=t.dirs||(t.dirs=[]);for(let i=0;i<e.length;i++){let[s,o,a,l=de]=e[i];s&&(oe(s)&&(s={mounted:s,updated:s}),s.deep&&It(o),r.push({dir:s,instance:n,value:o,oldValue:void 0,arg:a,modifiers:l}))}return t}function rn(t,e,n,r){const i=t.dirs,s=e&&e.dirs;for(let o=0;o<i.length;o++){const a=i[o];s&&(a.oldValue=s[o].value);let l=a.dir[r];l&&(bt(),_t(l,n,8,[t.el,a,t,e]),vt())}}const Mm=Symbol("_vte"),Fm=t=>t.__isTeleport,Bm=Symbol("_leaveCb");function io(t,e){t.shapeFlag&6&&t.component?(t.transition=e,io(t.component.subTree,e)):t.shapeFlag&128?(t.ssContent.transition=e.clone(t.ssContent),t.ssFallback.transition=e.clone(t.ssFallback)):t.transition=e}function bc(t,e){return oe(t)?De({name:t.name},e,{setup:t}):t}function vc(t){t.ids=[t.ids[0]+t.ids[2]+++"-",0,0]}function Um(t){const e=yo(),n=_m(null);if(e){const i=e.refs===de?e.refs={}:e.refs;Object.defineProperty(i,t,{enumerable:!0,get:()=>n.value,set:s=>n.value=s})}return n}const vi=new WeakMap;function ir(t,e,n,r,i=!1){if(se(t)){t.forEach((v,I)=>ir(v,e&&(se(e)?e[I]:e),n,r,i));return}if(sr(r)&&!i){r.shapeFlag&512&&r.type.__asyncResolved&&r.component.subTree.component&&ir(t,e,n,r.component.subTree);return}const s=r.shapeFlag&4?Pi(r.component):r.el,o=i?null:s,{i:a,r:l}=t,u=e&&e.r,c=a.refs===de?a.refs={}:a.refs,f=a.setupState,w=fe(f),y=f===de?Tl:v=>pe(w,v);if(u!=null&&u!==l){if(_c(e),Oe(u))c[u]=null,y(u)&&(f[u]=null);else if(Re(u)){u.value=null;const v=e;v.k&&(c[v.k]=null)}}if(oe(l))wn(l,a,12,[o,c]);else{const v=Oe(l),I=Re(l);if(v||I){const z=()=>{if(t.f){const F=v?y(l)?f[l]:c[l]:l.value;if(i)se(F)&&Ms(F,s);else if(se(F))F.includes(s)||F.push(s);else if(v)c[l]=[s],y(l)&&(f[l]=c[l]);else{const A=[s];l.value=A,t.k&&(c[t.k]=A)}}else v?(c[l]=o,y(l)&&(f[l]=o)):I&&(l.value=o,t.k&&(c[t.k]=o))};if(o){const F=()=>{z(),vi.delete(t)};F.id=-1,vi.set(t,F),Ze(F,n)}else _c(t),z()}}}function _c(t){const e=vi.get(t);e&&(e.flags|=8,vi.delete(t))}ni().requestIdleCallback,ni().cancelIdleCallback;const sr=t=>!!t.type.__asyncLoader,wc=t=>t.type.__isKeepAlive;function Hm(t,e){xc(t,"a",e)}function Wm(t,e){xc(t,"da",e)}function xc(t,e,n=qe){const r=t.__wdc||(t.__wdc=()=>{let i=n;for(;i;){if(i.isDeactivated)return;i=i.parent}return t()});if(_i(e,r,n),n){let i=n.parent;for(;i&&i.parent;)wc(i.parent.vnode)&&qm(r,e,n,i),i=i.parent}}function qm(t,e,n,r){const i=_i(e,t,r,!0);Cc(()=>{Ms(r[e],i)},n)}function _i(t,e,n=qe,r=!1){if(n){const i=n[t]||(n[t]=[]),s=e.__weh||(e.__weh=(...o)=>{bt();const a=pr(n),l=_t(e,n,t,o);return a(),vt(),l});return r?i.unshift(s):i.push(s),s}}const Tt=t=>(e,n=qe)=>{(!mr||t==="sp")&&_i(t,(...r)=>e(...r),n)},Sc=Tt("bm"),so=Tt("m"),zm=Tt("bu"),Vm=Tt("u"),Ec=Tt("bum"),Cc=Tt("um"),Km=Tt("sp"),Ym=Tt("rtg"),Gm=Tt("rtc");function Jm(t,e=qe){_i("ec",t,e)}const Qm=Symbol.for("v-ndc");function Oc(t,e,n,r){let i;const s=n,o=se(t);if(o||Oe(t)){const a=o&&_n(t);let l=!1,u=!1;a&&(l=!ot(t),u=Ut(t),t=oi(t)),i=new Array(t.length);for(let c=0,f=t.length;c<f;c++)i[c]=e(l?u?fi(Ne(t[c])):Ne(t[c]):t[c],c,void 0,s)}else if(typeof t=="number"){i=new Array(t);for(let a=0;a<t;a++)i[a]=e(a+1,a,void 0,s)}else if(Se(t))if(t[Symbol.iterator])i=Array.from(t,(a,l)=>e(a,l,void 0,s));else{const a=Object.keys(t);i=new Array(a.length);for(let l=0,u=a.length;l<u;l++){const c=a[l];i[l]=e(t[c],c,l,s)}}else i=[];return i}const oo=t=>t?ou(t)?Pi(t):oo(t.parent):null,or=De(Object.create(null),{$:t=>t,$el:t=>t.vnode.el,$data:t=>t.data,$props:t=>t.props,$attrs:t=>t.attrs,$slots:t=>t.slots,$refs:t=>t.refs,$parent:t=>oo(t.parent),$root:t=>oo(t.root),$host:t=>t.ce,$emit:t=>t.emit,$options:t=>Ac(t),$forceUpdate:t=>t.f||(t.f=()=>{ro(t.update)}),$nextTick:t=>t.n||(t.n=yi.bind(t.proxy)),$watch:t=>_g.bind(t)}),ao=(t,e)=>t!==de&&!t.__isScriptSetup&&pe(t,e),Xm={get({_:t},e){if(e==="__v_skip")return!0;const{ctx:n,setupState:r,data:i,props:s,accessCache:o,type:a,appContext:l}=t;let u;if(e[0]!=="$"){const y=o[e];if(y!==void 0)switch(y){case 1:return r[e];case 2:return i[e];case 4:return n[e];case 3:return s[e]}else{if(ao(r,e))return o[e]=1,r[e];if(i!==de&&pe(i,e))return o[e]=2,i[e];if((u=t.propsOptions[0])&&pe(u,e))return o[e]=3,s[e];if(n!==de&&pe(n,e))return o[e]=4,n[e];lo&&(o[e]=0)}}const c=or[e];let f,w;if(c)return e==="$attrs"&&Ue(t.attrs,"get",""),c(t);if((f=a.__cssModules)&&(f=f[e]))return f;if(n!==de&&pe(n,e))return o[e]=4,n[e];if(w=l.config.globalProperties,pe(w,e))return w[e]},set({_:t},e,n){const{data:r,setupState:i,ctx:s}=t;return ao(i,e)?(i[e]=n,!0):r!==de&&pe(r,e)?(r[e]=n,!0):pe(t.props,e)||e[0]==="$"&&e.slice(1)in t?!1:(s[e]=n,!0)},has({_:{data:t,setupState:e,accessCache:n,ctx:r,appContext:i,propsOptions:s,type:o}},a){let l,u;return!!(n[a]||t!==de&&a[0]!=="$"&&pe(t,a)||ao(e,a)||(l=s[0])&&pe(l,a)||pe(r,a)||pe(or,a)||pe(i.config.globalProperties,a)||(u=o.__cssModules)&&u[a])},defineProperty(t,e,n){return n.get!=null?t._.accessCache[e]=0:pe(n,"value")&&this.set(t,e,n.value,null),Reflect.defineProperty(t,e,n)}};function wi(t){return se(t)?t.reduce((e,n)=>(e[n]=null,e),{}):t}function kc(t,e){return!t||!e?t||e:se(t)&&se(e)?t.concat(e):De({},wi(t),wi(e))}let lo=!0;function Zm(t){const e=Ac(t),n=t.proxy,r=t.ctx;lo=!1,e.beforeCreate&&Pc(e.beforeCreate,t,"bc");const{data:i,computed:s,methods:o,watch:a,provide:l,inject:u,created:c,beforeMount:f,mounted:w,beforeUpdate:y,updated:v,activated:I,deactivated:z,beforeDestroy:F,beforeUnmount:A,destroyed:g,unmounted:m,render:h,renderTracked:O,renderTriggered:P,errorCaptured:R,serverPrefetch:V,expose:Z,inheritAttrs:$e,components:je,directives:Qe,filters:Dt}=e;if(u&&eg(u,r,null),o)for(const me in o){const be=o[me];oe(be)&&(r[me]=be.bind(n))}if(i){const me=i.call(n,n);Se(me)&&(t.data=eo(me))}if(lo=!0,s)for(const me in s){const be=s[me],Nt=oe(be)?be.bind(n,n):oe(be.get)?be.get.bind(n,n):yt,jn=!oe(be)&&oe(be.set)?be.set.bind(n):yt,Le=uu({get:Nt,set:jn});Object.defineProperty(r,me,{enumerable:!0,configurable:!0,get:()=>Le.value,set:nt=>Le.value=nt})}if(a)for(const me in a)$c(a[me],r,n,me);if(l){const me=oe(l)?l.call(n):l;Reflect.ownKeys(me).forEach(be=>{Dc(be,me[be])})}c&&Pc(c,t,"c");function Te(me,be){se(be)?be.forEach(Nt=>me(Nt.bind(n))):be&&me(be.bind(n))}if(Te(Sc,f),Te(so,w),Te(zm,y),Te(Vm,v),Te(Hm,I),Te(Wm,z),Te(Jm,R),Te(Gm,O),Te(Ym,P),Te(Ec,A),Te(Cc,m),Te(Km,V),se(Z))if(Z.length){const me=t.exposed||(t.exposed={});Z.forEach(be=>{Object.defineProperty(me,be,{get:()=>n[be],set:Nt=>n[be]=Nt,enumerable:!0})})}else t.exposed||(t.exposed={});h&&t.render===yt&&(t.render=h),$e!=null&&(t.inheritAttrs=$e),je&&(t.components=je),Qe&&(t.directives=Qe),V&&vc(t)}function eg(t,e,n=yt){se(t)&&(t=co(t));for(const r in t){const i=t[r];let s;Se(i)?"default"in i?s=lr(i.from||r,i.default,!0):s=lr(i.from||r):s=lr(i),Re(s)?Object.defineProperty(e,r,{enumerable:!0,configurable:!0,get:()=>s.value,set:o=>s.value=o}):e[r]=s}}function Pc(t,e,n){_t(se(t)?t.map(r=>r.bind(e.proxy)):t.bind(e.proxy),e,n)}function $c(t,e,n,r){let i=r.includes(".")?Kc(n,r):()=>n[r];if(Oe(t)){const s=e[t];oe(s)&&cr(i,s)}else if(oe(t))cr(i,t.bind(n));else if(Se(t))if(se(t))t.forEach(s=>$c(s,e,n,r));else{const s=oe(t.handler)?t.handler.bind(n):e[t.handler];oe(s)&&cr(i,s,t)}}function Ac(t){const e=t.type,{mixins:n,extends:r}=e,{mixins:i,optionsCache:s,config:{optionMergeStrategies:o}}=t.appContext,a=s.get(e);let l;return a?l=a:!i.length&&!n&&!r?l=e:(l={},i.length&&i.forEach(u=>xi(l,u,o,!0)),xi(l,e,o)),Se(e)&&s.set(e,l),l}function xi(t,e,n,r=!1){const{mixins:i,extends:s}=e;s&&xi(t,s,n,!0),i&&i.forEach(o=>xi(t,o,n,!0));for(const o in e)if(!(r&&o==="expose")){const a=tg[o]||n&&n[o];t[o]=a?a(t[o],e[o]):e[o]}return t}const tg={data:Ic,props:Tc,emits:Tc,methods:ar,computed:ar,beforeCreate:We,created:We,beforeMount:We,mounted:We,beforeUpdate:We,updated:We,beforeDestroy:We,beforeUnmount:We,destroyed:We,unmounted:We,activated:We,deactivated:We,errorCaptured:We,serverPrefetch:We,components:ar,directives:ar,watch:rg,provide:Ic,inject:ng};function Ic(t,e){return e?t?function(){return De(oe(t)?t.call(this,this):t,oe(e)?e.call(this,this):e)}:e:t}function ng(t,e){return ar(co(t),co(e))}function co(t){if(se(t)){const e={};for(let n=0;n<t.length;n++)e[t[n]]=t[n];return e}return t}function We(t,e){return t?[...new Set([].concat(t,e))]:e}function ar(t,e){return t?De(Object.create(null),t,e):e}function Tc(t,e){return t?se(t)&&se(e)?[...new Set([...t,...e])]:De(Object.create(null),wi(t),wi(e??{})):e}function rg(t,e){if(!t)return e;if(!e)return t;const n=De(Object.create(null),t);for(const r in e)n[r]=We(t[r],e[r]);return n}function Rc(){return{app:null,config:{isNativeTag:Tl,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 ig=0;function sg(t,e){return function(r,i=null){oe(r)||(r=De({},r)),i!=null&&!Se(i)&&(i=null);const s=Rc(),o=new WeakSet,a=[];let l=!1;const u=s.app={_uid:ig++,_component:r,_props:i,_container:null,_context:s,_instance:null,version:qg,get config(){return s.config},set config(c){},use(c,...f){return o.has(c)||(c&&oe(c.install)?(o.add(c),c.install(u,...f)):oe(c)&&(o.add(c),c(u,...f))),u},mixin(c){return s.mixins.includes(c)||s.mixins.push(c),u},component(c,f){return f?(s.components[c]=f,u):s.components[c]},directive(c,f){return f?(s.directives[c]=f,u):s.directives[c]},mount(c,f,w){if(!l){const y=u._ceVNode||Wt(r,i);return y.appContext=s,w===!0?w="svg":w===!1&&(w=void 0),t(y,c,w),l=!0,u._container=c,c.__vue_app__=u,Pi(y.component)}},onUnmount(c){a.push(c)},unmount(){l&&(_t(a,u._instance,16),t(null,u._container),delete u._container.__vue_app__)},provide(c,f){return s.provides[c]=f,u},runWithContext(c){const f=En;En=u;try{return c()}finally{En=f}}};return u}}let En=null;function Dc(t,e){if(qe){let n=qe.provides;const r=qe.parent&&qe.parent.provides;r===n&&(n=qe.provides=Object.create(r)),n[t]=e}}function lr(t,e,n=!1){const r=yo();if(r||En){let i=En?En._context.provides:r?r.parent==null||r.ce?r.vnode.appContext&&r.vnode.appContext.provides:r.parent.provides:void 0;if(i&&t in i)return i[t];if(arguments.length>1)return n&&oe(e)?e.call(r&&r.proxy):e}}const Nc={},jc=()=>Object.create(Nc),Lc=t=>Object.getPrototypeOf(t)===Nc;function og(t,e,n,r=!1){const i={},s=jc();t.propsDefaults=Object.create(null),Mc(t,e,i,s);for(const o in t.propsOptions[0])o in i||(i[o]=void 0);n?t.props=r?i:bm(i):t.type.props?t.props=i:t.props=s,t.attrs=s}function ag(t,e,n,r){const{props:i,attrs:s,vnode:{patchFlag:o}}=t,a=fe(i),[l]=t.propsOptions;let u=!1;if((r||o>0)&&!(o&16)){if(o&8){const c=t.vnode.dynamicProps;for(let f=0;f<c.length;f++){let w=c[f];if(Ei(t.emitsOptions,w))continue;const y=e[w];if(l)if(pe(s,w))y!==s[w]&&(s[w]=y,u=!0);else{const v=Pt(w);i[v]=uo(l,a,v,y,t,!1)}else y!==s[w]&&(s[w]=y,u=!0)}}}else{Mc(t,e,i,s)&&(u=!0);let c;for(const f in a)(!e||!pe(e,f)&&((c=Bt(f))===f||!pe(e,c)))&&(l?n&&(n[f]!==void 0||n[c]!==void 0)&&(i[f]=uo(l,a,f,void 0,t,!0)):delete i[f]);if(s!==a)for(const f in s)(!e||!pe(e,f))&&(delete s[f],u=!0)}u&&$t(t.attrs,"set","")}function Mc(t,e,n,r){const[i,s]=t.propsOptions;let o=!1,a;if(e)for(let l in e){if(Jn(l))continue;const u=e[l];let c;i&&pe(i,c=Pt(l))?!s||!s.includes(c)?n[c]=u:(a||(a={}))[c]=u:Ei(t.emitsOptions,l)||(!(l in r)||u!==r[l])&&(r[l]=u,o=!0)}if(s){const l=fe(n),u=a||de;for(let c=0;c<s.length;c++){const f=s[c];n[f]=uo(i,l,f,u[f],t,!pe(u,f))}}return o}function uo(t,e,n,r,i,s){const o=t[n];if(o!=null){const a=pe(o,"default");if(a&&r===void 0){const l=o.default;if(o.type!==Function&&!o.skipFactory&&oe(l)){const{propsDefaults:u}=i;if(n in u)r=u[n];else{const c=pr(i);r=u[n]=l.call(null,e),c()}}else r=l;i.ce&&i.ce._setProp(n,r)}o[0]&&(s&&!a?r=!1:o[1]&&(r===""||r===Bt(n))&&(r=!0))}return r}const lg=new WeakMap;function Fc(t,e,n=!1){const r=n?lg:e.propsCache,i=r.get(t);if(i)return i;const s=t.props,o={},a=[];let l=!1;if(!oe(t)){const c=f=>{l=!0;const[w,y]=Fc(f,e,!0);De(o,w),y&&a.push(...y)};!n&&e.mixins.length&&e.mixins.forEach(c),t.extends&&c(t.extends),t.mixins&&t.mixins.forEach(c)}if(!s&&!l)return Se(t)&&r.set(t,yn),yn;if(se(s))for(let c=0;c<s.length;c++){const f=Pt(s[c]);Bc(f)&&(o[f]=de)}else if(s)for(const c in s){const f=Pt(c);if(Bc(f)){const w=s[c],y=o[f]=se(w)||oe(w)?{type:w}:De({},w),v=y.type;let I=!1,z=!0;if(se(v))for(let F=0;F<v.length;++F){const A=v[F],g=oe(A)&&A.name;if(g==="Boolean"){I=!0;break}else g==="String"&&(z=!1)}else I=oe(v)&&v.name==="Boolean";y[0]=I,y[1]=z,(I||pe(y,"default"))&&a.push(f)}}const u=[o,a];return Se(t)&&r.set(t,u),u}function Bc(t){return t[0]!=="$"&&!Jn(t)}const fo=t=>t==="_"||t==="_ctx"||t==="$stable",ho=t=>se(t)?t.map(xt):[xt(t)],cg=(t,e,n)=>{if(e._n)return e;const r=jm((...i)=>ho(e(...i)),n);return r._c=!1,r},Uc=(t,e,n)=>{const r=t._ctx;for(const i in t){if(fo(i))continue;const s=t[i];if(oe(s))e[i]=cg(i,s,r);else if(s!=null){const o=ho(s);e[i]=()=>o}}},Hc=(t,e)=>{const n=ho(e);t.slots.default=()=>n},Wc=(t,e,n)=>{for(const r in e)(n||!fo(r))&&(t[r]=e[r])},ug=(t,e,n)=>{const r=t.slots=jc();if(t.vnode.shapeFlag&32){const i=e._;i?(Wc(r,e,n),n&&Ml(r,"_",i,!0)):Uc(e,r)}else e&&Hc(t,e)},fg=(t,e,n)=>{const{vnode:r,slots:i}=t;let s=!0,o=de;if(r.shapeFlag&32){const a=e._;a?n&&a===1?s=!1:Wc(i,e,n):(s=!e.$stable,Uc(e,i)),o=e}else e&&(Hc(t,e),o={default:1});if(s)for(const a in i)!fo(a)&&o[a]==null&&delete i[a]},Ze=kg;function dg(t){return hg(t)}function hg(t,e){const n=ni();n.__VUE__=!0;const{insert:r,remove:i,patchProp:s,createElement:o,createText:a,createComment:l,setText:u,setElementText:c,parentNode:f,nextSibling:w,setScopeId:y=yt,insertStaticContent:v}=t,I=(b,S,T,N=null,j=null,L=null,G=void 0,K=null,W=!!S.dynamicChildren)=>{if(b===S)return;b&&!hr(b,S)&&(N=Ln(b),nt(b,j,L,!0),b=null),S.patchFlag===-2&&(W=!1,S.dynamicChildren=null);const{type:B,ref:ee,shapeFlag:J}=S;switch(B){case Ci:z(b,S,T,N);break;case Cn:F(b,S,T,N);break;case mo:b==null&&A(S,T,N,G);break;case ht:je(b,S,T,N,j,L,G,K,W);break;default:J&1?h(b,S,T,N,j,L,G,K,W):J&6?Qe(b,S,T,N,j,L,G,K,W):(J&64||J&128)&&B.process(b,S,T,N,j,L,G,K,W,fn)}ee!=null&&j?ir(ee,b&&b.ref,L,S||b,!S):ee==null&&b&&b.ref!=null&&ir(b.ref,null,L,b,!0)},z=(b,S,T,N)=>{if(b==null)r(S.el=a(S.children),T,N);else{const j=S.el=b.el;S.children!==b.children&&u(j,S.children)}},F=(b,S,T,N)=>{b==null?r(S.el=l(S.children||""),T,N):S.el=b.el},A=(b,S,T,N)=>{[b.el,b.anchor]=v(b.children,S,T,N,b.el,b.anchor)},g=({el:b,anchor:S},T,N)=>{let j;for(;b&&b!==S;)j=w(b),r(b,T,N),b=j;r(S,T,N)},m=({el:b,anchor:S})=>{let T;for(;b&&b!==S;)T=w(b),i(b),b=T;i(S)},h=(b,S,T,N,j,L,G,K,W)=>{S.type==="svg"?G="svg":S.type==="math"&&(G="mathml"),b==null?O(S,T,N,j,L,G,K,W):V(b,S,j,L,G,K,W)},O=(b,S,T,N,j,L,G,K)=>{let W,B;const{props:ee,shapeFlag:J,transition:X,dirs:re}=b;if(W=b.el=o(b.type,L,ee&&ee.is,ee),J&8?c(W,b.children):J&16&&R(b.children,W,null,N,j,po(b,L),G,K),re&&rn(b,null,N,"created"),P(W,b,b.scopeId,G,N),ee){for(const ve in ee)ve!=="value"&&!Jn(ve)&&s(W,ve,null,ee[ve],L,N);"value"in ee&&s(W,"value",null,ee.value,L),(B=ee.onVnodeBeforeMount)&&St(B,N,b)}re&&rn(b,null,N,"beforeMount");const le=pg(j,X);le&&X.beforeEnter(W),r(W,S,T),((B=ee&&ee.onVnodeMounted)||le||re)&&Ze(()=>{B&&St(B,N,b),le&&X.enter(W),re&&rn(b,null,N,"mounted")},j)},P=(b,S,T,N,j)=>{if(T&&y(b,T),N)for(let L=0;L<N.length;L++)y(b,N[L]);if(j){let L=j.subTree;if(S===L||Zc(L.type)&&(L.ssContent===S||L.ssFallback===S)){const G=j.vnode;P(b,G,G.scopeId,G.slotScopeIds,j.parent)}}},R=(b,S,T,N,j,L,G,K,W=0)=>{for(let B=W;B<b.length;B++){const ee=b[B]=K?qt(b[B]):xt(b[B]);I(null,ee,S,T,N,j,L,G,K)}},V=(b,S,T,N,j,L,G)=>{const K=S.el=b.el;let{patchFlag:W,dynamicChildren:B,dirs:ee}=S;W|=b.patchFlag&16;const J=b.props||de,X=S.props||de;let re;if(T&&sn(T,!1),(re=X.onVnodeBeforeUpdate)&&St(re,T,S,b),ee&&rn(S,b,T,"beforeUpdate"),T&&sn(T,!0),(J.innerHTML&&X.innerHTML==null||J.textContent&&X.textContent==null)&&c(K,""),B?Z(b.dynamicChildren,B,K,T,N,po(S,j),L):G||be(b,S,K,null,T,N,po(S,j),L,!1),W>0){if(W&16)$e(K,J,X,T,j);else if(W&2&&J.class!==X.class&&s(K,"class",null,X.class,j),W&4&&s(K,"style",J.style,X.style,j),W&8){const le=S.dynamicProps;for(let ve=0;ve<le.length;ve++){const he=le[ve],Me=J[he],Fe=X[he];(Fe!==Me||he==="value")&&s(K,he,Me,Fe,j,T)}}W&1&&b.children!==S.children&&c(K,S.children)}else!G&&B==null&&$e(K,J,X,T,j);((re=X.onVnodeUpdated)||ee)&&Ze(()=>{re&&St(re,T,S,b),ee&&rn(S,b,T,"updated")},N)},Z=(b,S,T,N,j,L,G)=>{for(let K=0;K<S.length;K++){const W=b[K],B=S[K],ee=W.el&&(W.type===ht||!hr(W,B)||W.shapeFlag&198)?f(W.el):T;I(W,B,ee,null,N,j,L,G,!0)}},$e=(b,S,T,N,j)=>{if(S!==T){if(S!==de)for(const L in S)!Jn(L)&&!(L in T)&&s(b,L,S[L],null,j,N);for(const L in T){if(Jn(L))continue;const G=T[L],K=S[L];G!==K&&L!=="value"&&s(b,L,K,G,j,N)}"value"in T&&s(b,"value",S.value,T.value,j)}},je=(b,S,T,N,j,L,G,K,W)=>{const B=S.el=b?b.el:a(""),ee=S.anchor=b?b.anchor:a("");let{patchFlag:J,dynamicChildren:X,slotScopeIds:re}=S;re&&(K=K?K.concat(re):re),b==null?(r(B,T,N),r(ee,T,N),R(S.children||[],T,ee,j,L,G,K,W)):J>0&&J&64&&X&&b.dynamicChildren?(Z(b.dynamicChildren,X,T,j,L,G,K),(S.key!=null||j&&S===j.subTree)&&qc(b,S,!0)):be(b,S,T,ee,j,L,G,K,W)},Qe=(b,S,T,N,j,L,G,K,W)=>{S.slotScopeIds=K,b==null?S.shapeFlag&512?j.ctx.activate(S,T,N,G,W):Dt(S,T,N,j,L,G,W):cn(b,S,W)},Dt=(b,S,T,N,j,L,G)=>{const K=b.component=Ng(b,N,j);if(wc(b)&&(K.ctx.renderer=fn),jg(K,!1,G),K.asyncDep){if(j&&j.registerDep(K,Te,G),!b.el){const W=K.subTree=Wt(Cn);F(null,W,S,T),b.placeholder=W.el}}else Te(K,b,S,T,j,L,G)},cn=(b,S,T)=>{const N=S.component=b.component;if(Cg(b,S,T))if(N.asyncDep&&!N.asyncResolved){me(N,S,T);return}else N.next=S,N.update();else S.el=b.el,N.vnode=S},Te=(b,S,T,N,j,L,G)=>{const K=()=>{if(b.isMounted){let{next:J,bu:X,u:re,parent:le,vnode:ve}=b;{const it=zc(b);if(it){J&&(J.el=ve.el,me(b,J,G)),it.asyncDep.then(()=>{b.isUnmounted||K()});return}}let he=J,Me;sn(b,!1),J?(J.el=ve.el,me(b,J,G)):J=ve,X&&Us(X),(Me=J.props&&J.props.onVnodeBeforeUpdate)&&St(Me,le,J,ve),sn(b,!0);const Fe=Qc(b),rt=b.subTree;b.subTree=Fe,I(rt,Fe,f(rt.el),Ln(rt),b,j,L),J.el=Fe.el,he===null&&Og(b,Fe.el),re&&Ze(re,j),(Me=J.props&&J.props.onVnodeUpdated)&&Ze(()=>St(Me,le,J,ve),j)}else{let J;const{el:X,props:re}=S,{bm:le,m:ve,parent:he,root:Me,type:Fe}=b,rt=sr(S);sn(b,!1),le&&Us(le),!rt&&(J=re&&re.onVnodeBeforeMount)&&St(J,he,S),sn(b,!0);{Me.ce&&Me.ce._def.shadowRoot!==!1&&Me.ce._injectChildStyle(Fe);const it=b.subTree=Qc(b);I(null,it,T,N,b,j,L),S.el=it.el}if(ve&&Ze(ve,j),!rt&&(J=re&&re.onVnodeMounted)){const it=S;Ze(()=>St(J,he,it),j)}(S.shapeFlag&256||he&&sr(he.vnode)&&he.vnode.shapeFlag&256)&&b.a&&Ze(b.a,j),b.isMounted=!0,S=T=N=null}};b.scope.on();const W=b.effect=new Wl(K);b.scope.off();const B=b.update=W.run.bind(W),ee=b.job=W.runIfDirty.bind(W);ee.i=b,ee.id=b.uid,W.scheduler=()=>ro(ee),sn(b,!0),B()},me=(b,S,T)=>{S.component=b;const N=b.vnode.props;b.vnode=S,b.next=null,ag(b,S.props,N,T),fg(b,S.children,T),bt(),pc(b),vt()},be=(b,S,T,N,j,L,G,K,W=!1)=>{const B=b&&b.children,ee=b?b.shapeFlag:0,J=S.children,{patchFlag:X,shapeFlag:re}=S;if(X>0){if(X&128){jn(B,J,T,N,j,L,G,K,W);return}else if(X&256){Nt(B,J,T,N,j,L,G,K,W);return}}re&8?(ee&16&&un(B,j,L),J!==B&&c(T,J)):ee&16?re&16?jn(B,J,T,N,j,L,G,K,W):un(B,j,L,!0):(ee&8&&c(T,""),re&16&&R(J,T,N,j,L,G,K,W))},Nt=(b,S,T,N,j,L,G,K,W)=>{b=b||yn,S=S||yn;const B=b.length,ee=S.length,J=Math.min(B,ee);let X;for(X=0;X<J;X++){const re=S[X]=W?qt(S[X]):xt(S[X]);I(b[X],re,T,null,j,L,G,K,W)}B>ee?un(b,j,L,!0,!1,J):R(S,T,N,j,L,G,K,W,J)},jn=(b,S,T,N,j,L,G,K,W)=>{let B=0;const ee=S.length;let J=b.length-1,X=ee-1;for(;B<=J&&B<=X;){const re=b[B],le=S[B]=W?qt(S[B]):xt(S[B]);if(hr(re,le))I(re,le,T,null,j,L,G,K,W);else break;B++}for(;B<=J&&B<=X;){const re=b[J],le=S[X]=W?qt(S[X]):xt(S[X]);if(hr(re,le))I(re,le,T,null,j,L,G,K,W);else break;J--,X--}if(B>J){if(B<=X){const re=X+1,le=re<ee?S[re].el:N;for(;B<=X;)I(null,S[B]=W?qt(S[B]):xt(S[B]),T,le,j,L,G,K,W),B++}}else if(B>X)for(;B<=J;)nt(b[B],j,L,!0),B++;else{const re=B,le=B,ve=new Map;for(B=le;B<=X;B++){const ze=S[B]=W?qt(S[B]):xt(S[B]);ze.key!=null&&ve.set(ze.key,B)}let he,Me=0;const Fe=X-le+1;let rt=!1,it=0;const Yt=new Array(Fe);for(B=0;B<Fe;B++)Yt[B]=0;for(B=re;B<=J;B++){const ze=b[B];if(Me>=Fe){nt(ze,j,L,!0);continue}let ut;if(ze.key!=null)ut=ve.get(ze.key);else for(he=le;he<=X;he++)if(Yt[he-le]===0&&hr(ze,S[he])){ut=he;break}ut===void 0?nt(ze,j,L,!0):(Yt[ut-le]=B+1,ut>=it?it=ut:rt=!0,I(ze,S[ut],T,null,j,L,G,K,W),Me++)}const Mn=rt?mg(Yt):yn;for(he=Mn.length-1,B=Fe-1;B>=0;B--){const ze=le+B,ut=S[ze],Fn=S[ze+1],_r=ze+1<ee?Fn.el||Fn.placeholder:N;Yt[B]===0?I(null,ut,T,_r,j,L,G,K,W):rt&&(he<0||B!==Mn[he]?Le(ut,T,_r,2):he--)}}},Le=(b,S,T,N,j=null)=>{const{el:L,type:G,transition:K,children:W,shapeFlag:B}=b;if(B&6){Le(b.component.subTree,S,T,N);return}if(B&128){b.suspense.move(S,T,N);return}if(B&64){G.move(b,S,T,fn);return}if(G===ht){r(L,S,T);for(let J=0;J<W.length;J++)Le(W[J],S,T,N);r(b.anchor,S,T);return}if(G===mo){g(b,S,T);return}if(N!==2&&B&1&&K)if(N===0)K.beforeEnter(L),r(L,S,T),Ze(()=>K.enter(L),j);else{const{leave:J,delayLeave:X,afterLeave:re}=K,le=()=>{b.ctx.isUnmounted?i(L):r(L,S,T)},ve=()=>{L._isLeaving&&L[Bm](!0),J(L,()=>{le(),re&&re()})};X?X(L,le,ve):ve()}else r(L,S,T)},nt=(b,S,T,N=!1,j=!1)=>{const{type:L,props:G,ref:K,children:W,dynamicChildren:B,shapeFlag:ee,patchFlag:J,dirs:X,cacheIndex:re}=b;if(J===-2&&(j=!1),K!=null&&(bt(),ir(K,null,T,b,!0),vt()),re!=null&&(S.renderCache[re]=void 0),ee&256){S.ctx.deactivate(b);return}const le=ee&1&&X,ve=!sr(b);let he;if(ve&&(he=G&&G.onVnodeBeforeUnmount)&&St(he,S,b),ee&6)Ao(b.component,T,N);else{if(ee&128){b.suspense.unmount(T,N);return}le&&rn(b,null,S,"beforeUnmount"),ee&64?b.type.remove(b,S,T,fn,N):B&&!B.hasOnce&&(L!==ht||J>0&&J&64)?un(B,S,T,!1,!0):(L===ht&&J&384||!j&&ee&16)&&un(W,S,T),N&&Ni(b)}(ve&&(he=G&&G.onVnodeUnmounted)||le)&&Ze(()=>{he&&St(he,S,b),le&&rn(b,null,S,"unmounted")},T)},Ni=b=>{const{type:S,el:T,anchor:N,transition:j}=b;if(S===ht){$o(T,N);return}if(S===mo){m(b);return}const L=()=>{i(T),j&&!j.persisted&&j.afterLeave&&j.afterLeave()};if(b.shapeFlag&1&&j&&!j.persisted){const{leave:G,delayLeave:K}=j,W=()=>G(T,L);K?K(b.el,L,W):W()}else L()},$o=(b,S)=>{let T;for(;b!==S;)T=w(b),i(b),b=T;i(S)},Ao=(b,S,T)=>{const{bum:N,scope:j,job:L,subTree:G,um:K,m:W,a:B}=b;Vc(W),Vc(B),N&&Us(N),j.stop(),L&&(L.flags|=8,nt(G,b,S,T)),K&&Ze(K,S),Ze(()=>{b.isUnmounted=!0},S)},un=(b,S,T,N=!1,j=!1,L=0)=>{for(let G=L;G<b.length;G++)nt(b[G],S,T,N,j)},Ln=b=>{if(b.shapeFlag&6)return Ln(b.component.subTree);if(b.shapeFlag&128)return b.suspense.next();const S=w(b.anchor||b.el),T=S&&S[Mm];return T?w(T):S};let vr=!1;const ji=(b,S,T)=>{b==null?S._vnode&&nt(S._vnode,null,null,!0):I(S._vnode||null,b,S,null,null,null,T),S._vnode=b,vr||(vr=!0,pc(),mc(),vr=!1)},fn={p:I,um:nt,m:Le,r:Ni,mt:Dt,mc:R,pc:be,pbc:Z,n:Ln,o:t};return{render:ji,hydrate:void 0,createApp:sg(ji)}}function po({type:t,props:e},n){return n==="svg"&&t==="foreignObject"||n==="mathml"&&t==="annotation-xml"&&e&&e.encoding&&e.encoding.includes("html")?void 0:n}function sn({effect:t,job:e},n){n?(t.flags|=32,e.flags|=4):(t.flags&=-33,e.flags&=-5)}function pg(t,e){return(!t||t&&!t.pendingBranch)&&e&&!e.persisted}function qc(t,e,n=!1){const r=t.children,i=e.children;if(se(r)&&se(i))for(let s=0;s<r.length;s++){const o=r[s];let a=i[s];a.shapeFlag&1&&!a.dynamicChildren&&((a.patchFlag<=0||a.patchFlag===32)&&(a=i[s]=qt(i[s]),a.el=o.el),!n&&a.patchFlag!==-2&&qc(o,a)),a.type===Ci&&a.patchFlag!==-1&&(a.el=o.el),a.type===Cn&&!a.el&&(a.el=o.el)}}function mg(t){const e=t.slice(),n=[0];let r,i,s,o,a;const l=t.length;for(r=0;r<l;r++){const u=t[r];if(u!==0){if(i=n[n.length-1],t[i]<u){e[r]=i,n.push(r);continue}for(s=0,o=n.length-1;s<o;)a=s+o>>1,t[n[a]]<u?s=a+1:o=a;u<t[n[s]]&&(s>0&&(e[r]=n[s-1]),n[s]=r)}}for(s=n.length,o=n[s-1];s-- >0;)n[s]=o,o=e[o];return n}function zc(t){const e=t.subTree.component;if(e)return e.asyncDep&&!e.asyncResolved?e:zc(e)}function Vc(t){if(t)for(let e=0;e<t.length;e++)t[e].flags|=8}const gg=Symbol.for("v-scx"),yg=()=>lr(gg);function bg(t,e){return Si(t,null,e)}function vg(t,e){return Si(t,null,{flush:"sync"})}function cr(t,e,n){return Si(t,e,n)}function Si(t,e,n=de){const{immediate:r,deep:i,flush:s,once:o}=n,a=De({},n),l=e&&r||!e&&s!=="post";let u;if(mr){if(s==="sync"){const y=yg();u=y.__watcherHandles||(y.__watcherHandles=[])}else if(!l){const y=()=>{};return y.stop=yt,y.resume=yt,y.pause=yt,y}}const c=qe;a.call=(y,v,I)=>_t(y,c,v,I);let f=!1;s==="post"?a.scheduler=y=>{Ze(y,c&&c.suspense)}:s!=="sync"&&(f=!0,a.scheduler=(y,v)=>{v?y():ro(y)}),a.augmentJob=y=>{e&&(y.flags|=4),f&&(y.flags|=2,c&&(y.id=c.uid,y.i=c))};const w=Pm(t,e,a);return mr&&(u?u.push(w):l&&w()),w}function _g(t,e,n){const r=this.proxy,i=Oe(t)?t.includes(".")?Kc(r,t):()=>r[t]:t.bind(r,r);let s;oe(e)?s=e:(s=e.handler,n=e);const o=pr(this),a=Si(i,s.bind(r),n);return o(),a}function Kc(t,e){const n=e.split(".");return()=>{let r=t;for(let i=0;i<n.length&&r;i++)r=r[n[i]];return r}}function Yc(t,e,n=de){const r=yo(),i=Pt(e),s=Bt(e),o=Gc(t,i),a=Em((l,u)=>{let c,f=de,w;return vg(()=>{const y=t[i];Ge(c,y)&&(c=y,u())}),{get(){return l(),n.get?n.get(c):c},set(y){const v=n.set?n.set(y):y;if(!Ge(v,c)&&!(f!==de&&Ge(y,f)))return;const I=r.vnode.props;I&&(e in I||i in I||s in I)&&(`onUpdate:${e}`in I||`onUpdate:${i}`in I||`onUpdate:${s}`in I)||(c=y,u()),r.emit(`update:${e}`,v),Ge(y,v)&&Ge(y,f)&&!Ge(v,w)&&u(),f=y,w=v}}});return a[Symbol.iterator]=()=>{let l=0;return{next(){return l<2?{value:l++?o||de:a,done:!1}:{done:!0}}}},a}const Gc=(t,e)=>e==="modelValue"||e==="model-value"?t.modelModifiers:t[`${e}Modifiers`]||t[`${Pt(e)}Modifiers`]||t[`${Bt(e)}Modifiers`];function wg(t,e,...n){if(t.isUnmounted)return;const r=t.vnode.props||de;let i=n;const s=e.startsWith("update:"),o=s&&Gc(r,e.slice(7));o&&(o.trim&&(i=n.map(c=>Oe(c)?c.trim():c)),o.number&&(i=n.map(Vp)));let a,l=r[a=Bs(e)]||r[a=Bs(Pt(e))];!l&&s&&(l=r[a=Bs(Bt(e))]),l&&_t(l,t,6,i);const u=r[a+"Once"];if(u){if(!t.emitted)t.emitted={};else if(t.emitted[a])return;t.emitted[a]=!0,_t(u,t,6,i)}}const xg=new WeakMap;function Jc(t,e,n=!1){const r=n?xg:e.emitsCache,i=r.get(t);if(i!==void 0)return i;const s=t.emits;let o={},a=!1;if(!oe(t)){const l=u=>{const c=Jc(u,e,!0);c&&(a=!0,De(o,c))};!n&&e.mixins.length&&e.mixins.forEach(l),t.extends&&l(t.extends),t.mixins&&t.mixins.forEach(l)}return!s&&!a?(Se(t)&&r.set(t,null),null):(se(s)?s.forEach(l=>o[l]=null):De(o,s),Se(t)&&r.set(t,o),o)}function Ei(t,e){return!t||!Zr(e)?!1:(e=e.slice(2).replace(/Once$/,""),pe(t,e[0].toLowerCase()+e.slice(1))||pe(t,Bt(e))||pe(t,e))}function Mb(){}function Qc(t){const{type:e,vnode:n,proxy:r,withProxy:i,propsOptions:[s],slots:o,attrs:a,emit:l,render:u,renderCache:c,props:f,data:w,setupState:y,ctx:v,inheritAttrs:I}=t,z=bi(t);let F,A;try{if(n.shapeFlag&4){const m=i||r,h=m;F=xt(u.call(h,m,c,f,y,w,v)),A=a}else{const m=e;F=xt(m.length>1?m(f,{attrs:a,slots:o,emit:l}):m(f,null)),A=e.props?a:Sg(a)}}catch(m){ur.length=0,mi(m,t,1),F=Wt(Cn)}let g=F;if(A&&I!==!1){const m=Object.keys(A),{shapeFlag:h}=g;m.length&&h&7&&(s&&m.some(Ls)&&(A=Eg(A,s)),g=kn(g,A,!1,!0))}return n.dirs&&(g=kn(g,null,!1,!0),g.dirs=g.dirs?g.dirs.concat(n.dirs):n.dirs),n.transition&&io(g,n.transition),F=g,bi(z),F}const Sg=t=>{let e;for(const n in t)(n==="class"||n==="style"||Zr(n))&&((e||(e={}))[n]=t[n]);return e},Eg=(t,e)=>{const n={};for(const r in t)(!Ls(r)||!(r.slice(9)in e))&&(n[r]=t[r]);return n};function Cg(t,e,n){const{props:r,children:i,component:s}=t,{props:o,children:a,patchFlag:l}=e,u=s.emitsOptions;if(e.dirs||e.transition)return!0;if(n&&l>=0){if(l&1024)return!0;if(l&16)return r?Xc(r,o,u):!!o;if(l&8){const c=e.dynamicProps;for(let f=0;f<c.length;f++){const w=c[f];if(o[w]!==r[w]&&!Ei(u,w))return!0}}}else return(i||a)&&(!a||!a.$stable)?!0:r===o?!1:r?o?Xc(r,o,u):!0:!!o;return!1}function Xc(t,e,n){const r=Object.keys(e);if(r.length!==Object.keys(t).length)return!0;for(let i=0;i<r.length;i++){const s=r[i];if(e[s]!==t[s]&&!Ei(n,s))return!0}return!1}function Og({vnode:t,parent:e},n){for(;e;){const r=e.subTree;if(r.suspense&&r.suspense.activeBranch===t&&(r.el=t.el),r===t)(t=e.vnode).el=n,e=e.parent;else break}}const Zc=t=>t.__isSuspense;function kg(t,e){e&&e.pendingBranch?se(t)?e.effects.push(...t):e.effects.push(t):Nm(t)}const ht=Symbol.for("v-fgt"),Ci=Symbol.for("v-txt"),Cn=Symbol.for("v-cmt"),mo=Symbol.for("v-stc"),ur=[];let et=null;function On(t=!1){ur.push(et=t?null:[])}function Pg(){ur.pop(),et=ur[ur.length-1]||null}let fr=1;function eu(t,e=!1){fr+=t,t<0&&et&&e&&(et.hasOnce=!0)}function tu(t){return t.dynamicChildren=fr>0?et||yn:null,Pg(),fr>0&&et&&et.push(t),t}function dr(t,e,n,r,i,s){return tu(on(t,e,n,r,i,s,!0))}function $g(t,e,n,r,i){return tu(Wt(t,e,n,r,i,!0))}function nu(t){return t?t.__v_isVNode===!0:!1}function hr(t,e){return t.type===e.type&&t.key===e.key}const ru=({key:t})=>t??null,Oi=({ref:t,ref_key:e,ref_for:n})=>(typeof t=="number"&&(t=""+t),t!=null?Oe(t)||Re(t)||oe(t)?{i:at,r:t,k:e,f:!!n}:t:null);function on(t,e=null,n=null,r=0,i=null,s=t===ht?0:1,o=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:t,props:e,key:e&&ru(e),ref:e&&Oi(e),scopeId:yc,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:s,patchFlag:r,dynamicProps:i,dynamicChildren:null,appContext:null,ctx:at};return a?(go(l,n),s&128&&t.normalize(l)):n&&(l.shapeFlag|=Oe(n)?8:16),fr>0&&!o&&et&&(l.patchFlag>0||s&6)&&l.patchFlag!==32&&et.push(l),l}const Wt=Ag;function Ag(t,e=null,n=null,r=0,i=null,s=!1){if((!t||t===Qm)&&(t=Cn),nu(t)){const a=kn(t,e,!0);return n&&go(a,n),fr>0&&!s&&et&&(a.shapeFlag&6?et[et.indexOf(t)]=a:et.push(a)),a.patchFlag=-2,a}if(Wg(t)&&(t=t.__vccOpts),e){e=Ig(e);let{class:a,style:l}=e;a&&!Oe(a)&&(e.class=ri(a)),Se(l)&&(to(l)&&!se(l)&&(l=De({},l)),e.style=Hs(l))}const o=Oe(t)?1:Zc(t)?128:Fm(t)?64:Se(t)?4:oe(t)?2:0;return on(t,e,n,r,i,o,s,!0)}function Ig(t){return t?to(t)||Lc(t)?De({},t):t:null}function kn(t,e,n=!1,r=!1){const{props:i,ref:s,patchFlag:o,children:a,transition:l}=t,u=e?iu(i||{},e):i,c={__v_isVNode:!0,__v_skip:!0,type:t.type,props:u,key:u&&ru(u),ref:e&&e.ref?n&&s?se(s)?s.concat(Oi(e)):[s,Oi(e)]:Oi(e):s,scopeId:t.scopeId,slotScopeIds:t.slotScopeIds,children:a,target:t.target,targetStart:t.targetStart,targetAnchor:t.targetAnchor,staticCount:t.staticCount,shapeFlag:t.shapeFlag,patchFlag:e&&t.type!==ht?o===-1?16:o|16:o,dynamicProps:t.dynamicProps,dynamicChildren:t.dynamicChildren,appContext:t.appContext,dirs:t.dirs,transition:l,component:t.component,suspense:t.suspense,ssContent:t.ssContent&&kn(t.ssContent),ssFallback:t.ssFallback&&kn(t.ssFallback),placeholder:t.placeholder,el:t.el,anchor:t.anchor,ctx:t.ctx,ce:t.ce};return l&&r&&io(c,l.clone(c)),c}function Tg(t=" ",e=0){return Wt(Ci,null,t,e)}function xt(t){return t==null||typeof t=="boolean"?Wt(Cn):se(t)?Wt(ht,null,t.slice()):nu(t)?qt(t):Wt(Ci,null,String(t))}function qt(t){return t.el===null&&t.patchFlag!==-1||t.memo?t:kn(t)}function go(t,e){let n=0;const{shapeFlag:r}=t;if(e==null)e=null;else if(se(e))n=16;else if(typeof e=="object")if(r&65){const i=e.default;i&&(i._c&&(i._d=!1),go(t,i()),i._c&&(i._d=!0));return}else{n=32;const i=e._;!i&&!Lc(e)?e._ctx=at:i===3&&at&&(at.slots._===1?e._=1:(e._=2,t.patchFlag|=1024))}else oe(e)?(e={default:e,_ctx:at},n=32):(e=String(e),r&64?(n=16,e=[Tg(e)]):n=8);t.children=e,t.shapeFlag|=n}function iu(...t){const e={};for(let n=0;n<t.length;n++){const r=t[n];for(const i in r)if(i==="class")e.class!==r.class&&(e.class=ri([e.class,r.class]));else if(i==="style")e.style=Hs([e.style,r.style]);else if(Zr(i)){const s=e[i],o=r[i];o&&s!==o&&!(se(s)&&s.includes(o))&&(e[i]=s?[].concat(s,o):o)}else i!==""&&(e[i]=r[i])}return e}function St(t,e,n,r=null){_t(t,e,7,[n,r])}const Rg=Rc();let Dg=0;function Ng(t,e,n){const r=t.type,i=(e?e.appContext:t.appContext)||Rg,s={uid:Dg++,vnode:t,type:r,parent:e,appContext:i,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new Xp(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:e?e.provides:Object.create(i.provides),ids:e?e.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:Fc(r,i),emitsOptions:Jc(r,i),emit:null,emitted:null,propsDefaults:de,inheritAttrs:r.inheritAttrs,ctx:de,data:de,props:de,attrs:de,slots:de,refs:de,setupState:de,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 s.ctx={_:s},s.root=e?e.root:s,s.emit=wg.bind(null,s),t.ce&&t.ce(s),s}let qe=null;const yo=()=>qe||at;let ki,bo;{const t=ni(),e=(n,r)=>{let i;return(i=t[n])||(i=t[n]=[]),i.push(r),s=>{i.length>1?i.forEach(o=>o(s)):i[0](s)}};ki=e("__VUE_INSTANCE_SETTERS__",n=>qe=n),bo=e("__VUE_SSR_SETTERS__",n=>mr=n)}const pr=t=>{const e=qe;return ki(t),t.scope.on(),()=>{t.scope.off(),ki(e)}},su=()=>{qe&&qe.scope.off(),ki(null)};function ou(t){return t.vnode.shapeFlag&4}let mr=!1;function jg(t,e=!1,n=!1){e&&bo(e);const{props:r,children:i}=t.vnode,s=ou(t);og(t,r,s,e),ug(t,i,n||e);const o=s?Lg(t,e):void 0;return e&&bo(!1),o}function Lg(t,e){const n=t.type;t.accessCache=Object.create(null),t.proxy=new Proxy(t.ctx,Xm);const{setup:r}=n;if(r){bt();const i=t.setupContext=r.length>1?Fg(t):null,s=pr(t),o=wn(r,t,0,[t.props,i]),a=Dl(o);if(vt(),s(),(a||t.sp)&&!sr(t)&&vc(t),a){if(o.then(su,su),e)return o.then(l=>{au(t,l)}).catch(l=>{mi(l,t,0)});t.asyncDep=o}else au(t,o)}else lu(t)}function au(t,e,n){oe(e)?t.type.__ssrInlineRender?t.ssrRender=e:t.render=e:Se(e)&&(t.setupState=uc(e)),lu(t)}function lu(t,e,n){const r=t.type;t.render||(t.render=r.render||yt);{const i=pr(t);bt();try{Zm(t)}finally{vt(),i()}}}const Mg={get(t,e){return Ue(t,"get",""),t[e]}};function Fg(t){const e=n=>{t.exposed=n||{}};return{attrs:new Proxy(t.attrs,Mg),slots:t.slots,emit:t.emit,expose:e}}function Pi(t){return t.exposed?t.exposeProxy||(t.exposeProxy=new Proxy(uc(vm(t.exposed)),{get(e,n){if(n in e)return e[n];if(n in or)return or[n](t)},has(e,n){return n in e||n in or}})):t.proxy}const Bg=/(?:^|[-_])\w/g,Ug=t=>t.replace(Bg,e=>e.toUpperCase()).replace(/[-_]/g,"");function Hg(t,e=!0){return oe(t)?t.displayName||t.name:t.name||e&&t.__name}function cu(t,e,n=!1){let r=Hg(e);if(!r&&e.__file){const i=e.__file.match(/([^/\\]+)\.\w+$/);i&&(r=i[1])}if(!r&&t&&t.parent){const i=s=>{for(const o in s)if(s[o]===e)return o};r=i(t.components||t.parent.type.components)||i(t.appContext.components)}return r?Ug(r):n?"App":"Anonymous"}function Wg(t){return oe(t)&&"__vccOpts"in t}const uu=(t,e)=>Om(t,e,mr),qg="3.5.21";/**
102
+ `,...Sm(i)),console.warn(...s)}bt(),no=!1}function xm(){let t=nr[nr.length-1];if(!t)return[];const e=[];for(;t;){const n=e[0];n&&n.vnode===t?n.recurseCount++:e.push({vnode:t,recurseCount:0});const r=t.component&&t.component.parent;t=r&&r.vnode}return e}function Sm(t){const e=[];return t.forEach((n,r)=>{e.push(...r===0?[]:[`
103
+ `],...Em(n))}),e}function Em({vnode:t,recurseCount:e}){const n=e>0?`... (${e} recursive calls)`:"",r=t.component?t.component.parent==null:!1,i=` at <${su(t.component,t.type,r)}`,s=">"+n;return t.props?[i,...Om(t.props),s]:[i+s]}function Om(t){const e=[],n=Object.keys(t);return n.slice(0,3).forEach(r=>{e.push(...ac(r,t[r]))}),n.length>3&&e.push(" ..."),e}function ac(t,e,n){return Pe(e)?(e=JSON.stringify(e),n?e:[`${t}=${e}`]):typeof e=="number"||typeof e=="boolean"||e==null?n?e:[`${t}=${e}`]:Te(e)?(e=ac(t,fe(e.value),!0),n?e:[`${t}=Ref<`,e,">"]):oe(e)?[`${t}=fn${e.name?`<${e.name}>`:""}`]:(e=fe(e),n?e:[`${t}=`,e])}function wn(t,e,n,r){try{return r?t(...r):t()}catch(i){yi(i,e,n)}}function _t(t,e,n,r){if(oe(t)){const i=wn(t,e,n,r);return i&&Al(i)&&i.catch(s=>{yi(s,e,n)}),i}if(se(t)){const i=[];for(let s=0;s<t.length;s++)i.push(_t(t[s],e,n,r));return i}}function yi(t,e,n,r=!0){const i=e?e.vnode:null,{errorHandler:s,throwUnhandledErrorInProduction:o}=e&&e.appContext.config||de;if(e){let a=e.parent;const l=e.proxy,u=`https://vuejs.org/error-reference/#runtime-${n}`;for(;a;){const c=a.ec;if(c){for(let f=0;f<c.length;f++)if(c[f](t,l,u)===!1)return}a=a.parent}if(s){vt(),wn(s,null,10,[t,l,u]),bt();return}}Pm(t,n,i,r,o)}function Pm(t,e,n,r=!0,i=!1){if(i)throw t;console.error(t)}const He=[];let wt=-1;const xn=[];let Wt=null,Sn=0;const lc=Promise.resolve();let vi=null;function bi(t){const e=vi||lc;return t?e.then(this?t.bind(this):t):e}function Cm(t){let e=wt+1,n=He.length;for(;e<n;){const r=e+n>>>1,i=He[r],s=rr(i);s<t||s===t&&i.flags&2?e=r+1:n=r}return e}function ro(t){if(!(t.flags&1)){const e=rr(t),n=He[He.length-1];!n||!(t.flags&2)&&e>=rr(n)?He.push(t):He.splice(Cm(e),0,t),t.flags|=1,cc()}}function cc(){vi||(vi=lc.then(dc))}function km(t){se(t)?xn.push(...t):Wt&&t.id===-1?Wt.splice(Sn+1,0,t):t.flags&1||(xn.push(t),t.flags|=1),cc()}function uc(t,e,n=wt+1){for(;n<He.length;n++){const r=He[n];if(r&&r.flags&2){if(t&&r.id!==t.uid)continue;He.splice(n,1),n--,r.flags&4&&(r.flags&=-2),r(),r.flags&4||(r.flags&=-2)}}}function fc(t){if(xn.length){const e=[...new Set(xn)].sort((n,r)=>rr(n)-rr(r));if(xn.length=0,Wt){Wt.push(...e);return}for(Wt=e,Sn=0;Sn<Wt.length;Sn++){const n=Wt[Sn];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}Wt=null,Sn=0}}const rr=t=>t.id==null?t.flags&2?-1:1/0:t.id;function dc(t){try{for(wt=0;wt<He.length;wt++){const e=He[wt];e&&!(e.flags&8)&&(e.flags&4&&(e.flags&=-2),wn(e,e.i,e.i?15:14),e.flags&4||(e.flags&=-2))}}finally{for(;wt<He.length;wt++){const e=He[wt];e&&(e.flags&=-2)}wt=-1,He.length=0,fc(),vi=null,(He.length||xn.length)&&dc()}}let at=null,hc=null;function _i(t){const e=at;return at=t,hc=t&&t.type.__scopeId||null,e}function $m(t,e=at,n){if(!e||t._n)return t;const r=(...i)=>{r._d&&Jc(-1);const s=_i(e);let o;try{o=t(...i)}finally{_i(s),r._d&&Jc(1)}return o};return r._n=!0,r._c=!0,r._d=!0,r}function Am(t,e){if(at===null)return t;const n=Ai(at),r=t.dirs||(t.dirs=[]);for(let i=0;i<e.length;i++){let[s,o,a,l=de]=e[i];s&&(oe(s)&&(s={mounted:s,updated:s}),s.deep&&Rt(o),r.push({dir:s,instance:n,value:o,oldValue:void 0,arg:a,modifiers:l}))}return t}function rn(t,e,n,r){const i=t.dirs,s=e&&e.dirs;for(let o=0;o<i.length;o++){const a=i[o];s&&(a.oldValue=s[o].value);let l=a.dir[r];l&&(vt(),_t(l,n,8,[t.el,a,t,e]),bt())}}const Im=Symbol("_vte"),Rm=t=>t.__isTeleport,Tm=Symbol("_leaveCb");function io(t,e){t.shapeFlag&6&&t.component?(t.transition=e,io(t.component.subTree,e)):t.shapeFlag&128?(t.ssContent.transition=e.clone(t.ssContent),t.ssFallback.transition=e.clone(t.ssFallback)):t.transition=e}function pc(t,e){return oe(t)?De({name:t.name},e,{setup:t}):t}function mc(t){t.ids=[t.ids[0]+t.ids[2]+++"-",0,0]}function Dm(t){const e=yo(),n=hm(null);if(e){const i=e.refs===de?e.refs={}:e.refs;Object.defineProperty(i,t,{enumerable:!0,get:()=>n.value,set:s=>n.value=s})}return n}const wi=new WeakMap;function ir(t,e,n,r,i=!1){if(se(t)){t.forEach((v,I)=>ir(v,e&&(se(e)?e[I]:e),n,r,i));return}if(sr(r)&&!i){r.shapeFlag&512&&r.type.__asyncResolved&&r.component.subTree.component&&ir(t,e,n,r.component.subTree);return}const s=r.shapeFlag&4?Ai(r.component):r.el,o=i?null:s,{i:a,r:l}=t,u=e&&e.r,c=a.refs===de?a.refs={}:a.refs,f=a.setupState,w=fe(f),y=f===de?kl:v=>pe(w,v);if(u!=null&&u!==l){if(gc(e),Pe(u))c[u]=null,y(u)&&(f[u]=null);else if(Te(u)){u.value=null;const v=e;v.k&&(c[v.k]=null)}}if(oe(l))wn(l,a,12,[o,c]);else{const v=Pe(l),I=Te(l);if(v||I){const z=()=>{if(t.f){const F=v?y(l)?f[l]:c[l]:l.value;if(i)se(F)&&Ms(F,s);else if(se(F))F.includes(s)||F.push(s);else if(v)c[l]=[s],y(l)&&(f[l]=c[l]);else{const A=[s];l.value=A,t.k&&(c[t.k]=A)}}else v?(c[l]=o,y(l)&&(f[l]=o)):I&&(l.value=o,t.k&&(c[t.k]=o))};if(o){const F=()=>{z(),wi.delete(t)};F.id=-1,wi.set(t,F),Ze(F,n)}else gc(t),z()}}}function gc(t){const e=wi.get(t);e&&(e.flags|=8,wi.delete(t))}ii().requestIdleCallback,ii().cancelIdleCallback;const sr=t=>!!t.type.__asyncLoader,yc=t=>t.type.__isKeepAlive;function Nm(t,e){vc(t,"a",e)}function Lm(t,e){vc(t,"da",e)}function vc(t,e,n=qe){const r=t.__wdc||(t.__wdc=()=>{let i=n;for(;i;){if(i.isDeactivated)return;i=i.parent}return t()});if(xi(e,r,n),n){let i=n.parent;for(;i&&i.parent;)yc(i.parent.vnode)&&jm(r,e,n,i),i=i.parent}}function jm(t,e,n,r){const i=xi(e,t,r,!0);wc(()=>{Ms(r[e],i)},n)}function xi(t,e,n=qe,r=!1){if(n){const i=n[t]||(n[t]=[]),s=e.__weh||(e.__weh=(...o)=>{vt();const a=pr(n),l=_t(e,n,t,o);return a(),bt(),l});return r?i.unshift(s):i.push(s),s}}const Tt=t=>(e,n=qe)=>{(!mr||t==="sp")&&xi(t,(...r)=>e(...r),n)},bc=Tt("bm"),so=Tt("m"),Mm=Tt("bu"),Fm=Tt("u"),_c=Tt("bum"),wc=Tt("um"),Bm=Tt("sp"),Um=Tt("rtg"),Hm=Tt("rtc");function Wm(t,e=qe){xi("ec",t,e)}const qm=Symbol.for("v-ndc");function xc(t,e,n,r){let i;const s=n,o=se(t);if(o||Pe(t)){const a=o&&_n(t);let l=!1,u=!1;a&&(l=!ot(t),u=Ht(t),t=li(t)),i=new Array(t.length);for(let c=0,f=t.length;c<f;c++)i[c]=e(l?u?hi(Ne(t[c])):Ne(t[c]):t[c],c,void 0,s)}else if(typeof t=="number"){i=new Array(t);for(let a=0;a<t;a++)i[a]=e(a+1,a,void 0,s)}else if(Se(t))if(t[Symbol.iterator])i=Array.from(t,(a,l)=>e(a,l,void 0,s));else{const a=Object.keys(t);i=new Array(a.length);for(let l=0,u=a.length;l<u;l++){const c=a[l];i[l]=e(t[c],c,l,s)}}else i=[];return i}const oo=t=>t?nu(t)?Ai(t):oo(t.parent):null,or=De(Object.create(null),{$:t=>t,$el:t=>t.vnode.el,$data:t=>t.data,$props:t=>t.props,$attrs:t=>t.attrs,$slots:t=>t.slots,$refs:t=>t.refs,$parent:t=>oo(t.parent),$root:t=>oo(t.root),$host:t=>t.ce,$emit:t=>t.emit,$options:t=>Pc(t),$forceUpdate:t=>t.f||(t.f=()=>{ro(t.update)}),$nextTick:t=>t.n||(t.n=bi.bind(t.proxy)),$watch:t=>hg.bind(t)}),ao=(t,e)=>t!==de&&!t.__isScriptSetup&&pe(t,e),zm={get({_:t},e){if(e==="__v_skip")return!0;const{ctx:n,setupState:r,data:i,props:s,accessCache:o,type:a,appContext:l}=t;let u;if(e[0]!=="$"){const y=o[e];if(y!==void 0)switch(y){case 1:return r[e];case 2:return i[e];case 4:return n[e];case 3:return s[e]}else{if(ao(r,e))return o[e]=1,r[e];if(i!==de&&pe(i,e))return o[e]=2,i[e];if((u=t.propsOptions[0])&&pe(u,e))return o[e]=3,s[e];if(n!==de&&pe(n,e))return o[e]=4,n[e];lo&&(o[e]=0)}}const c=or[e];let f,w;if(c)return e==="$attrs"&&Ue(t.attrs,"get",""),c(t);if((f=a.__cssModules)&&(f=f[e]))return f;if(n!==de&&pe(n,e))return o[e]=4,n[e];if(w=l.config.globalProperties,pe(w,e))return w[e]},set({_:t},e,n){const{data:r,setupState:i,ctx:s}=t;return ao(i,e)?(i[e]=n,!0):r!==de&&pe(r,e)?(r[e]=n,!0):pe(t.props,e)||e[0]==="$"&&e.slice(1)in t?!1:(s[e]=n,!0)},has({_:{data:t,setupState:e,accessCache:n,ctx:r,appContext:i,propsOptions:s,type:o}},a){let l,u;return!!(n[a]||t!==de&&a[0]!=="$"&&pe(t,a)||ao(e,a)||(l=s[0])&&pe(l,a)||pe(r,a)||pe(or,a)||pe(i.config.globalProperties,a)||(u=o.__cssModules)&&u[a])},defineProperty(t,e,n){return n.get!=null?t._.accessCache[e]=0:pe(n,"value")&&this.set(t,e,n.value,null),Reflect.defineProperty(t,e,n)}};function Si(t){return se(t)?t.reduce((e,n)=>(e[n]=null,e),{}):t}function Sc(t,e){return!t||!e?t||e:se(t)&&se(e)?t.concat(e):De({},Si(t),Si(e))}let lo=!0;function Vm(t){const e=Pc(t),n=t.proxy,r=t.ctx;lo=!1,e.beforeCreate&&Ec(e.beforeCreate,t,"bc");const{data:i,computed:s,methods:o,watch:a,provide:l,inject:u,created:c,beforeMount:f,mounted:w,beforeUpdate:y,updated:v,activated:I,deactivated:z,beforeDestroy:F,beforeUnmount:A,destroyed:g,unmounted:m,render:h,renderTracked:P,renderTriggered:k,errorCaptured:T,serverPrefetch:V,expose:Z,inheritAttrs:$e,components:Le,directives:Qe,filters:Nt}=e;if(u&&Km(u,r,null),o)for(const me in o){const ve=o[me];oe(ve)&&(r[me]=ve.bind(n))}if(i){const me=i.call(n,n);Se(me)&&(t.data=eo(me))}if(lo=!0,s)for(const me in s){const ve=s[me],Lt=oe(ve)?ve.bind(n,n):oe(ve.get)?ve.get.bind(n,n):yt,Ln=!oe(ve)&&oe(ve.set)?ve.set.bind(n):yt,je=ou({get:Lt,set:Ln});Object.defineProperty(r,me,{enumerable:!0,configurable:!0,get:()=>je.value,set:nt=>je.value=nt})}if(a)for(const me in a)Oc(a[me],r,n,me);if(l){const me=oe(l)?l.call(n):l;Reflect.ownKeys(me).forEach(ve=>{Ac(ve,me[ve])})}c&&Ec(c,t,"c");function Re(me,ve){se(ve)?ve.forEach(Lt=>me(Lt.bind(n))):ve&&me(ve.bind(n))}if(Re(bc,f),Re(so,w),Re(Mm,y),Re(Fm,v),Re(Nm,I),Re(Lm,z),Re(Wm,T),Re(Hm,P),Re(Um,k),Re(_c,A),Re(wc,m),Re(Bm,V),se(Z))if(Z.length){const me=t.exposed||(t.exposed={});Z.forEach(ve=>{Object.defineProperty(me,ve,{get:()=>n[ve],set:Lt=>n[ve]=Lt,enumerable:!0})})}else t.exposed||(t.exposed={});h&&t.render===yt&&(t.render=h),$e!=null&&(t.inheritAttrs=$e),Le&&(t.components=Le),Qe&&(t.directives=Qe),V&&mc(t)}function Km(t,e,n=yt){se(t)&&(t=co(t));for(const r in t){const i=t[r];let s;Se(i)?"default"in i?s=lr(i.from||r,i.default,!0):s=lr(i.from||r):s=lr(i),Te(s)?Object.defineProperty(e,r,{enumerable:!0,configurable:!0,get:()=>s.value,set:o=>s.value=o}):e[r]=s}}function Ec(t,e,n){_t(se(t)?t.map(r=>r.bind(e.proxy)):t.bind(e.proxy),e,n)}function Oc(t,e,n,r){let i=r.includes(".")?Wc(n,r):()=>n[r];if(Pe(t)){const s=e[t];oe(s)&&cr(i,s)}else if(oe(t))cr(i,t.bind(n));else if(Se(t))if(se(t))t.forEach(s=>Oc(s,e,n,r));else{const s=oe(t.handler)?t.handler.bind(n):e[t.handler];oe(s)&&cr(i,s,t)}}function Pc(t){const e=t.type,{mixins:n,extends:r}=e,{mixins:i,optionsCache:s,config:{optionMergeStrategies:o}}=t.appContext,a=s.get(e);let l;return a?l=a:!i.length&&!n&&!r?l=e:(l={},i.length&&i.forEach(u=>Ei(l,u,o,!0)),Ei(l,e,o)),Se(e)&&s.set(e,l),l}function Ei(t,e,n,r=!1){const{mixins:i,extends:s}=e;s&&Ei(t,s,n,!0),i&&i.forEach(o=>Ei(t,o,n,!0));for(const o in e)if(!(r&&o==="expose")){const a=Gm[o]||n&&n[o];t[o]=a?a(t[o],e[o]):e[o]}return t}const Gm={data:Cc,props:kc,emits:kc,methods:ar,computed:ar,beforeCreate:We,created:We,beforeMount:We,mounted:We,beforeUpdate:We,updated:We,beforeDestroy:We,beforeUnmount:We,destroyed:We,unmounted:We,activated:We,deactivated:We,errorCaptured:We,serverPrefetch:We,components:ar,directives:ar,watch:Jm,provide:Cc,inject:Ym};function Cc(t,e){return e?t?function(){return De(oe(t)?t.call(this,this):t,oe(e)?e.call(this,this):e)}:e:t}function Ym(t,e){return ar(co(t),co(e))}function co(t){if(se(t)){const e={};for(let n=0;n<t.length;n++)e[t[n]]=t[n];return e}return t}function We(t,e){return t?[...new Set([].concat(t,e))]:e}function ar(t,e){return t?De(Object.create(null),t,e):e}function kc(t,e){return t?se(t)&&se(e)?[...new Set([...t,...e])]:De(Object.create(null),Si(t),Si(e??{})):e}function Jm(t,e){if(!t)return e;if(!e)return t;const n=De(Object.create(null),t);for(const r in e)n[r]=We(t[r],e[r]);return n}function $c(){return{app:null,config:{isNativeTag:kl,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 Qm=0;function Xm(t,e){return function(r,i=null){oe(r)||(r=De({},r)),i!=null&&!Se(i)&&(i=null);const s=$c(),o=new WeakSet,a=[];let l=!1;const u=s.app={_uid:Qm++,_component:r,_props:i,_container:null,_context:s,_instance:null,version:jg,get config(){return s.config},set config(c){},use(c,...f){return o.has(c)||(c&&oe(c.install)?(o.add(c),c.install(u,...f)):oe(c)&&(o.add(c),c(u,...f))),u},mixin(c){return s.mixins.includes(c)||s.mixins.push(c),u},component(c,f){return f?(s.components[c]=f,u):s.components[c]},directive(c,f){return f?(s.directives[c]=f,u):s.directives[c]},mount(c,f,w){if(!l){const y=u._ceVNode||qt(r,i);return y.appContext=s,w===!0?w="svg":w===!1&&(w=void 0),t(y,c,w),l=!0,u._container=c,c.__vue_app__=u,Ai(y.component)}},onUnmount(c){a.push(c)},unmount(){l&&(_t(a,u._instance,16),t(null,u._container),delete u._container.__vue_app__)},provide(c,f){return s.provides[c]=f,u},runWithContext(c){const f=En;En=u;try{return c()}finally{En=f}}};return u}}let En=null;function Ac(t,e){if(qe){let n=qe.provides;const r=qe.parent&&qe.parent.provides;r===n&&(n=qe.provides=Object.create(r)),n[t]=e}}function lr(t,e,n=!1){const r=yo();if(r||En){let i=En?En._context.provides:r?r.parent==null||r.ce?r.vnode.appContext&&r.vnode.appContext.provides:r.parent.provides:void 0;if(i&&t in i)return i[t];if(arguments.length>1)return n&&oe(e)?e.call(r&&r.proxy):e}}const Ic={},Rc=()=>Object.create(Ic),Tc=t=>Object.getPrototypeOf(t)===Ic;function Zm(t,e,n,r=!1){const i={},s=Rc();t.propsDefaults=Object.create(null),Dc(t,e,i,s);for(const o in t.propsOptions[0])o in i||(i[o]=void 0);n?t.props=r?i:fm(i):t.type.props?t.props=i:t.props=s,t.attrs=s}function eg(t,e,n,r){const{props:i,attrs:s,vnode:{patchFlag:o}}=t,a=fe(i),[l]=t.propsOptions;let u=!1;if((r||o>0)&&!(o&16)){if(o&8){const c=t.vnode.dynamicProps;for(let f=0;f<c.length;f++){let w=c[f];if(Pi(t.emitsOptions,w))continue;const y=e[w];if(l)if(pe(s,w))y!==s[w]&&(s[w]=y,u=!0);else{const v=$t(w);i[v]=uo(l,a,v,y,t,!1)}else y!==s[w]&&(s[w]=y,u=!0)}}}else{Dc(t,e,i,s)&&(u=!0);let c;for(const f in a)(!e||!pe(e,f)&&((c=Ut(f))===f||!pe(e,c)))&&(l?n&&(n[f]!==void 0||n[c]!==void 0)&&(i[f]=uo(l,a,f,void 0,t,!0)):delete i[f]);if(s!==a)for(const f in s)(!e||!pe(e,f))&&(delete s[f],u=!0)}u&&At(t.attrs,"set","")}function Dc(t,e,n,r){const[i,s]=t.propsOptions;let o=!1,a;if(e)for(let l in e){if(Jn(l))continue;const u=e[l];let c;i&&pe(i,c=$t(l))?!s||!s.includes(c)?n[c]=u:(a||(a={}))[c]=u:Pi(t.emitsOptions,l)||(!(l in r)||u!==r[l])&&(r[l]=u,o=!0)}if(s){const l=fe(n),u=a||de;for(let c=0;c<s.length;c++){const f=s[c];n[f]=uo(i,l,f,u[f],t,!pe(u,f))}}return o}function uo(t,e,n,r,i,s){const o=t[n];if(o!=null){const a=pe(o,"default");if(a&&r===void 0){const l=o.default;if(o.type!==Function&&!o.skipFactory&&oe(l)){const{propsDefaults:u}=i;if(n in u)r=u[n];else{const c=pr(i);r=u[n]=l.call(null,e),c()}}else r=l;i.ce&&i.ce._setProp(n,r)}o[0]&&(s&&!a?r=!1:o[1]&&(r===""||r===Ut(n))&&(r=!0))}return r}const tg=new WeakMap;function Nc(t,e,n=!1){const r=n?tg:e.propsCache,i=r.get(t);if(i)return i;const s=t.props,o={},a=[];let l=!1;if(!oe(t)){const c=f=>{l=!0;const[w,y]=Nc(f,e,!0);De(o,w),y&&a.push(...y)};!n&&e.mixins.length&&e.mixins.forEach(c),t.extends&&c(t.extends),t.mixins&&t.mixins.forEach(c)}if(!s&&!l)return Se(t)&&r.set(t,yn),yn;if(se(s))for(let c=0;c<s.length;c++){const f=$t(s[c]);Lc(f)&&(o[f]=de)}else if(s)for(const c in s){const f=$t(c);if(Lc(f)){const w=s[c],y=o[f]=se(w)||oe(w)?{type:w}:De({},w),v=y.type;let I=!1,z=!0;if(se(v))for(let F=0;F<v.length;++F){const A=v[F],g=oe(A)&&A.name;if(g==="Boolean"){I=!0;break}else g==="String"&&(z=!1)}else I=oe(v)&&v.name==="Boolean";y[0]=I,y[1]=z,(I||pe(y,"default"))&&a.push(f)}}const u=[o,a];return Se(t)&&r.set(t,u),u}function Lc(t){return t[0]!=="$"&&!Jn(t)}const fo=t=>t==="_"||t==="_ctx"||t==="$stable",ho=t=>se(t)?t.map(xt):[xt(t)],ng=(t,e,n)=>{if(e._n)return e;const r=$m((...i)=>ho(e(...i)),n);return r._c=!1,r},jc=(t,e,n)=>{const r=t._ctx;for(const i in t){if(fo(i))continue;const s=t[i];if(oe(s))e[i]=ng(i,s,r);else if(s!=null){const o=ho(s);e[i]=()=>o}}},Mc=(t,e)=>{const n=ho(e);t.slots.default=()=>n},Fc=(t,e,n)=>{for(const r in e)(n||!fo(r))&&(t[r]=e[r])},rg=(t,e,n)=>{const r=t.slots=Rc();if(t.vnode.shapeFlag&32){const i=e._;i?(Fc(r,e,n),n&&Dl(r,"_",i,!0)):jc(e,r)}else e&&Mc(t,e)},ig=(t,e,n)=>{const{vnode:r,slots:i}=t;let s=!0,o=de;if(r.shapeFlag&32){const a=e._;a?n&&a===1?s=!1:Fc(i,e,n):(s=!e.$stable,jc(e,i)),o=e}else e&&(Mc(t,e),o={default:1});if(s)for(const a in i)!fo(a)&&o[a]==null&&delete i[a]},Ze=_g;function sg(t){return og(t)}function og(t,e){const n=ii();n.__VUE__=!0;const{insert:r,remove:i,patchProp:s,createElement:o,createText:a,createComment:l,setText:u,setElementText:c,parentNode:f,nextSibling:w,setScopeId:y=yt,insertStaticContent:v}=t,I=(b,S,R,N=null,L=null,j=null,Y=void 0,K=null,W=!!S.dynamicChildren)=>{if(b===S)return;b&&!hr(b,S)&&(N=jn(b),nt(b,L,j,!0),b=null),S.patchFlag===-2&&(W=!1,S.dynamicChildren=null);const{type:B,ref:ee,shapeFlag:J}=S;switch(B){case Ci:z(b,S,R,N);break;case On:F(b,S,R,N);break;case mo:b==null&&A(S,R,N,Y);break;case ht:Le(b,S,R,N,L,j,Y,K,W);break;default:J&1?h(b,S,R,N,L,j,Y,K,W):J&6?Qe(b,S,R,N,L,j,Y,K,W):(J&64||J&128)&&B.process(b,S,R,N,L,j,Y,K,W,fn)}ee!=null&&L?ir(ee,b&&b.ref,j,S||b,!S):ee==null&&b&&b.ref!=null&&ir(b.ref,null,j,b,!0)},z=(b,S,R,N)=>{if(b==null)r(S.el=a(S.children),R,N);else{const L=S.el=b.el;S.children!==b.children&&u(L,S.children)}},F=(b,S,R,N)=>{b==null?r(S.el=l(S.children||""),R,N):S.el=b.el},A=(b,S,R,N)=>{[b.el,b.anchor]=v(b.children,S,R,N,b.el,b.anchor)},g=({el:b,anchor:S},R,N)=>{let L;for(;b&&b!==S;)L=w(b),r(b,R,N),b=L;r(S,R,N)},m=({el:b,anchor:S})=>{let R;for(;b&&b!==S;)R=w(b),i(b),b=R;i(S)},h=(b,S,R,N,L,j,Y,K,W)=>{S.type==="svg"?Y="svg":S.type==="math"&&(Y="mathml"),b==null?P(S,R,N,L,j,Y,K,W):V(b,S,L,j,Y,K,W)},P=(b,S,R,N,L,j,Y,K)=>{let W,B;const{props:ee,shapeFlag:J,transition:X,dirs:re}=b;if(W=b.el=o(b.type,j,ee&&ee.is,ee),J&8?c(W,b.children):J&16&&T(b.children,W,null,N,L,po(b,j),Y,K),re&&rn(b,null,N,"created"),k(W,b,b.scopeId,Y,N),ee){for(const be in ee)be!=="value"&&!Jn(be)&&s(W,be,null,ee[be],j,N);"value"in ee&&s(W,"value",null,ee.value,j),(B=ee.onVnodeBeforeMount)&&St(B,N,b)}re&&rn(b,null,N,"beforeMount");const ce=ag(L,X);ce&&X.beforeEnter(W),r(W,S,R),((B=ee&&ee.onVnodeMounted)||ce||re)&&Ze(()=>{B&&St(B,N,b),ce&&X.enter(W),re&&rn(b,null,N,"mounted")},L)},k=(b,S,R,N,L)=>{if(R&&y(b,R),N)for(let j=0;j<N.length;j++)y(b,N[j]);if(L){let j=L.subTree;if(S===j||Yc(j.type)&&(j.ssContent===S||j.ssFallback===S)){const Y=L.vnode;k(b,Y,Y.scopeId,Y.slotScopeIds,L.parent)}}},T=(b,S,R,N,L,j,Y,K,W=0)=>{for(let B=W;B<b.length;B++){const ee=b[B]=K?zt(b[B]):xt(b[B]);I(null,ee,S,R,N,L,j,Y,K)}},V=(b,S,R,N,L,j,Y)=>{const K=S.el=b.el;let{patchFlag:W,dynamicChildren:B,dirs:ee}=S;W|=b.patchFlag&16;const J=b.props||de,X=S.props||de;let re;if(R&&sn(R,!1),(re=X.onVnodeBeforeUpdate)&&St(re,R,S,b),ee&&rn(S,b,R,"beforeUpdate"),R&&sn(R,!0),(J.innerHTML&&X.innerHTML==null||J.textContent&&X.textContent==null)&&c(K,""),B?Z(b.dynamicChildren,B,K,R,N,po(S,L),j):Y||ve(b,S,K,null,R,N,po(S,L),j,!1),W>0){if(W&16)$e(K,J,X,R,L);else if(W&2&&J.class!==X.class&&s(K,"class",null,X.class,L),W&4&&s(K,"style",J.style,X.style,L),W&8){const ce=S.dynamicProps;for(let be=0;be<ce.length;be++){const he=ce[be],Me=J[he],Fe=X[he];(Fe!==Me||he==="value")&&s(K,he,Me,Fe,L,R)}}W&1&&b.children!==S.children&&c(K,S.children)}else!Y&&B==null&&$e(K,J,X,R,L);((re=X.onVnodeUpdated)||ee)&&Ze(()=>{re&&St(re,R,S,b),ee&&rn(S,b,R,"updated")},N)},Z=(b,S,R,N,L,j,Y)=>{for(let K=0;K<S.length;K++){const W=b[K],B=S[K],ee=W.el&&(W.type===ht||!hr(W,B)||W.shapeFlag&198)?f(W.el):R;I(W,B,ee,null,N,L,j,Y,!0)}},$e=(b,S,R,N,L)=>{if(S!==R){if(S!==de)for(const j in S)!Jn(j)&&!(j in R)&&s(b,j,S[j],null,L,N);for(const j in R){if(Jn(j))continue;const Y=R[j],K=S[j];Y!==K&&j!=="value"&&s(b,j,K,Y,L,N)}"value"in R&&s(b,"value",S.value,R.value,L)}},Le=(b,S,R,N,L,j,Y,K,W)=>{const B=S.el=b?b.el:a(""),ee=S.anchor=b?b.anchor:a("");let{patchFlag:J,dynamicChildren:X,slotScopeIds:re}=S;re&&(K=K?K.concat(re):re),b==null?(r(B,R,N),r(ee,R,N),T(S.children||[],R,ee,L,j,Y,K,W)):J>0&&J&64&&X&&b.dynamicChildren?(Z(b.dynamicChildren,X,R,L,j,Y,K),(S.key!=null||L&&S===L.subTree)&&Bc(b,S,!0)):ve(b,S,R,ee,L,j,Y,K,W)},Qe=(b,S,R,N,L,j,Y,K,W)=>{S.slotScopeIds=K,b==null?S.shapeFlag&512?L.ctx.activate(S,R,N,Y,W):Nt(S,R,N,L,j,Y,W):cn(b,S,W)},Nt=(b,S,R,N,L,j,Y)=>{const K=b.component=kg(b,N,L);if(yc(b)&&(K.ctx.renderer=fn),$g(K,!1,Y),K.asyncDep){if(L&&L.registerDep(K,Re,Y),!b.el){const W=K.subTree=qt(On);F(null,W,S,R),b.placeholder=W.el}}else Re(K,b,S,R,L,j,Y)},cn=(b,S,R)=>{const N=S.component=b.component;if(vg(b,S,R))if(N.asyncDep&&!N.asyncResolved){me(N,S,R);return}else N.next=S,N.update();else S.el=b.el,N.vnode=S},Re=(b,S,R,N,L,j,Y)=>{const K=()=>{if(b.isMounted){let{next:J,bu:X,u:re,parent:ce,vnode:be}=b;{const it=Uc(b);if(it){J&&(J.el=be.el,me(b,J,Y)),it.asyncDep.then(()=>{b.isUnmounted||K()});return}}let he=J,Me;sn(b,!1),J?(J.el=be.el,me(b,J,Y)):J=be,X&&Us(X),(Me=J.props&&J.props.onVnodeBeforeUpdate)&&St(Me,ce,J,be),sn(b,!0);const Fe=Kc(b),rt=b.subTree;b.subTree=Fe,I(rt,Fe,f(rt.el),jn(rt),b,L,j),J.el=Fe.el,he===null&&bg(b,Fe.el),re&&Ze(re,L),(Me=J.props&&J.props.onVnodeUpdated)&&Ze(()=>St(Me,ce,J,be),L)}else{let J;const{el:X,props:re}=S,{bm:ce,m:be,parent:he,root:Me,type:Fe}=b,rt=sr(S);sn(b,!1),ce&&Us(ce),!rt&&(J=re&&re.onVnodeBeforeMount)&&St(J,he,S),sn(b,!0);{Me.ce&&Me.ce._def.shadowRoot!==!1&&Me.ce._injectChildStyle(Fe);const it=b.subTree=Kc(b);I(null,it,R,N,b,L,j),S.el=it.el}if(be&&Ze(be,L),!rt&&(J=re&&re.onVnodeMounted)){const it=S;Ze(()=>St(J,he,it),L)}(S.shapeFlag&256||he&&sr(he.vnode)&&he.vnode.shapeFlag&256)&&b.a&&Ze(b.a,L),b.isMounted=!0,S=R=N=null}};b.scope.on();const W=b.effect=new Fl(K);b.scope.off();const B=b.update=W.run.bind(W),ee=b.job=W.runIfDirty.bind(W);ee.i=b,ee.id=b.uid,W.scheduler=()=>ro(ee),sn(b,!0),B()},me=(b,S,R)=>{S.component=b;const N=b.vnode.props;b.vnode=S,b.next=null,eg(b,S.props,N,R),ig(b,S.children,R),vt(),uc(b),bt()},ve=(b,S,R,N,L,j,Y,K,W=!1)=>{const B=b&&b.children,ee=b?b.shapeFlag:0,J=S.children,{patchFlag:X,shapeFlag:re}=S;if(X>0){if(X&128){Ln(B,J,R,N,L,j,Y,K,W);return}else if(X&256){Lt(B,J,R,N,L,j,Y,K,W);return}}re&8?(ee&16&&un(B,L,j),J!==B&&c(R,J)):ee&16?re&16?Ln(B,J,R,N,L,j,Y,K,W):un(B,L,j,!0):(ee&8&&c(R,""),re&16&&T(J,R,N,L,j,Y,K,W))},Lt=(b,S,R,N,L,j,Y,K,W)=>{b=b||yn,S=S||yn;const B=b.length,ee=S.length,J=Math.min(B,ee);let X;for(X=0;X<J;X++){const re=S[X]=W?zt(S[X]):xt(S[X]);I(b[X],re,R,null,L,j,Y,K,W)}B>ee?un(b,L,j,!0,!1,J):T(S,R,N,L,j,Y,K,W,J)},Ln=(b,S,R,N,L,j,Y,K,W)=>{let B=0;const ee=S.length;let J=b.length-1,X=ee-1;for(;B<=J&&B<=X;){const re=b[B],ce=S[B]=W?zt(S[B]):xt(S[B]);if(hr(re,ce))I(re,ce,R,null,L,j,Y,K,W);else break;B++}for(;B<=J&&B<=X;){const re=b[J],ce=S[X]=W?zt(S[X]):xt(S[X]);if(hr(re,ce))I(re,ce,R,null,L,j,Y,K,W);else break;J--,X--}if(B>J){if(B<=X){const re=X+1,ce=re<ee?S[re].el:N;for(;B<=X;)I(null,S[B]=W?zt(S[B]):xt(S[B]),R,ce,L,j,Y,K,W),B++}}else if(B>X)for(;B<=J;)nt(b[B],L,j,!0),B++;else{const re=B,ce=B,be=new Map;for(B=ce;B<=X;B++){const ze=S[B]=W?zt(S[B]):xt(S[B]);ze.key!=null&&be.set(ze.key,B)}let he,Me=0;const Fe=X-ce+1;let rt=!1,it=0;const Gt=new Array(Fe);for(B=0;B<Fe;B++)Gt[B]=0;for(B=re;B<=J;B++){const ze=b[B];if(Me>=Fe){nt(ze,L,j,!0);continue}let ut;if(ze.key!=null)ut=be.get(ze.key);else for(he=ce;he<=X;he++)if(Gt[he-ce]===0&&hr(ze,S[he])){ut=he;break}ut===void 0?nt(ze,L,j,!0):(Gt[ut-ce]=B+1,ut>=it?it=ut:rt=!0,I(ze,S[ut],R,null,L,j,Y,K,W),Me++)}const Mn=rt?lg(Gt):yn;for(he=Mn.length-1,B=Fe-1;B>=0;B--){const ze=ce+B,ut=S[ze],Fn=S[ze+1],wr=ze+1<ee?Fn.el||Fn.placeholder:N;Gt[B]===0?I(null,ut,R,wr,L,j,Y,K,W):rt&&(he<0||B!==Mn[he]?je(ut,R,wr,2):he--)}}},je=(b,S,R,N,L=null)=>{const{el:j,type:Y,transition:K,children:W,shapeFlag:B}=b;if(B&6){je(b.component.subTree,S,R,N);return}if(B&128){b.suspense.move(S,R,N);return}if(B&64){Y.move(b,S,R,fn);return}if(Y===ht){r(j,S,R);for(let J=0;J<W.length;J++)je(W[J],S,R,N);r(b.anchor,S,R);return}if(Y===mo){g(b,S,R);return}if(N!==2&&B&1&&K)if(N===0)K.beforeEnter(j),r(j,S,R),Ze(()=>K.enter(j),L);else{const{leave:J,delayLeave:X,afterLeave:re}=K,ce=()=>{b.ctx.isUnmounted?i(j):r(j,S,R)},be=()=>{j._isLeaving&&j[Tm](!0),J(j,()=>{ce(),re&&re()})};X?X(j,ce,be):be()}else r(j,S,R)},nt=(b,S,R,N=!1,L=!1)=>{const{type:j,props:Y,ref:K,children:W,dynamicChildren:B,shapeFlag:ee,patchFlag:J,dirs:X,cacheIndex:re}=b;if(J===-2&&(L=!1),K!=null&&(vt(),ir(K,null,R,b,!0),bt()),re!=null&&(S.renderCache[re]=void 0),ee&256){S.ctx.deactivate(b);return}const ce=ee&1&&X,be=!sr(b);let he;if(be&&(he=Y&&Y.onVnodeBeforeUnmount)&&St(he,S,b),ee&6)Ao(b.component,R,N);else{if(ee&128){b.suspense.unmount(R,N);return}ce&&rn(b,null,S,"beforeUnmount"),ee&64?b.type.remove(b,S,R,fn,N):B&&!B.hasOnce&&(j!==ht||J>0&&J&64)?un(B,S,R,!1,!0):(j===ht&&J&384||!L&&ee&16)&&un(W,S,R),N&&Li(b)}(be&&(he=Y&&Y.onVnodeUnmounted)||ce)&&Ze(()=>{he&&St(he,S,b),ce&&rn(b,null,S,"unmounted")},R)},Li=b=>{const{type:S,el:R,anchor:N,transition:L}=b;if(S===ht){$o(R,N);return}if(S===mo){m(b);return}const j=()=>{i(R),L&&!L.persisted&&L.afterLeave&&L.afterLeave()};if(b.shapeFlag&1&&L&&!L.persisted){const{leave:Y,delayLeave:K}=L,W=()=>Y(R,j);K?K(b.el,j,W):W()}else j()},$o=(b,S)=>{let R;for(;b!==S;)R=w(b),i(b),b=R;i(S)},Ao=(b,S,R)=>{const{bum:N,scope:L,job:j,subTree:Y,um:K,m:W,a:B}=b;Hc(W),Hc(B),N&&Us(N),L.stop(),j&&(j.flags|=8,nt(Y,b,S,R)),K&&Ze(K,S),Ze(()=>{b.isUnmounted=!0},S)},un=(b,S,R,N=!1,L=!1,j=0)=>{for(let Y=j;Y<b.length;Y++)nt(b[Y],S,R,N,L)},jn=b=>{if(b.shapeFlag&6)return jn(b.component.subTree);if(b.shapeFlag&128)return b.suspense.next();const S=w(b.anchor||b.el),R=S&&S[Im];return R?w(R):S};let _r=!1;const ji=(b,S,R)=>{b==null?S._vnode&&nt(S._vnode,null,null,!0):I(S._vnode||null,b,S,null,null,null,R),S._vnode=b,_r||(_r=!0,uc(),fc(),_r=!1)},fn={p:I,um:nt,m:je,r:Li,mt:Nt,mc:T,pc:ve,pbc:Z,n:jn,o:t};return{render:ji,hydrate:void 0,createApp:Xm(ji)}}function po({type:t,props:e},n){return n==="svg"&&t==="foreignObject"||n==="mathml"&&t==="annotation-xml"&&e&&e.encoding&&e.encoding.includes("html")?void 0:n}function sn({effect:t,job:e},n){n?(t.flags|=32,e.flags|=4):(t.flags&=-33,e.flags&=-5)}function ag(t,e){return(!t||t&&!t.pendingBranch)&&e&&!e.persisted}function Bc(t,e,n=!1){const r=t.children,i=e.children;if(se(r)&&se(i))for(let s=0;s<r.length;s++){const o=r[s];let a=i[s];a.shapeFlag&1&&!a.dynamicChildren&&((a.patchFlag<=0||a.patchFlag===32)&&(a=i[s]=zt(i[s]),a.el=o.el),!n&&a.patchFlag!==-2&&Bc(o,a)),a.type===Ci&&a.patchFlag!==-1&&(a.el=o.el),a.type===On&&!a.el&&(a.el=o.el)}}function lg(t){const e=t.slice(),n=[0];let r,i,s,o,a;const l=t.length;for(r=0;r<l;r++){const u=t[r];if(u!==0){if(i=n[n.length-1],t[i]<u){e[r]=i,n.push(r);continue}for(s=0,o=n.length-1;s<o;)a=s+o>>1,t[n[a]]<u?s=a+1:o=a;u<t[n[s]]&&(s>0&&(e[r]=n[s-1]),n[s]=r)}}for(s=n.length,o=n[s-1];s-- >0;)n[s]=o,o=e[o];return n}function Uc(t){const e=t.subTree.component;if(e)return e.asyncDep&&!e.asyncResolved?e:Uc(e)}function Hc(t){if(t)for(let e=0;e<t.length;e++)t[e].flags|=8}const cg=Symbol.for("v-scx"),ug=()=>lr(cg);function fg(t,e){return Oi(t,null,e)}function dg(t,e){return Oi(t,null,{flush:"sync"})}function cr(t,e,n){return Oi(t,e,n)}function Oi(t,e,n=de){const{immediate:r,deep:i,flush:s,once:o}=n,a=De({},n),l=e&&r||!e&&s!=="post";let u;if(mr){if(s==="sync"){const y=ug();u=y.__watcherHandles||(y.__watcherHandles=[])}else if(!l){const y=()=>{};return y.stop=yt,y.resume=yt,y.pause=yt,y}}const c=qe;a.call=(y,v,I)=>_t(y,c,v,I);let f=!1;s==="post"?a.scheduler=y=>{Ze(y,c&&c.suspense)}:s!=="sync"&&(f=!0,a.scheduler=(y,v)=>{v?y():ro(y)}),a.augmentJob=y=>{e&&(y.flags|=4),f&&(y.flags|=2,c&&(y.id=c.uid,y.i=c))};const w=wm(t,e,a);return mr&&(u?u.push(w):l&&w()),w}function hg(t,e,n){const r=this.proxy,i=Pe(t)?t.includes(".")?Wc(r,t):()=>r[t]:t.bind(r,r);let s;oe(e)?s=e:(s=e.handler,n=e);const o=pr(this),a=Oi(i,s.bind(r),n);return o(),a}function Wc(t,e){const n=e.split(".");return()=>{let r=t;for(let i=0;i<n.length&&r;i++)r=r[n[i]];return r}}function qc(t,e,n=de){const r=yo(),i=$t(e),s=Ut(e),o=zc(t,i),a=ym((l,u)=>{let c,f=de,w;return dg(()=>{const y=t[i];Ye(c,y)&&(c=y,u())}),{get(){return l(),n.get?n.get(c):c},set(y){const v=n.set?n.set(y):y;if(!Ye(v,c)&&!(f!==de&&Ye(y,f)))return;const I=r.vnode.props;I&&(e in I||i in I||s in I)&&(`onUpdate:${e}`in I||`onUpdate:${i}`in I||`onUpdate:${s}`in I)||(c=y,u()),r.emit(`update:${e}`,v),Ye(y,v)&&Ye(y,f)&&!Ye(v,w)&&u(),f=y,w=v}}});return a[Symbol.iterator]=()=>{let l=0;return{next(){return l<2?{value:l++?o||de:a,done:!1}:{done:!0}}}},a}const zc=(t,e)=>e==="modelValue"||e==="model-value"?t.modelModifiers:t[`${e}Modifiers`]||t[`${$t(e)}Modifiers`]||t[`${Ut(e)}Modifiers`];function pg(t,e,...n){if(t.isUnmounted)return;const r=t.vnode.props||de;let i=n;const s=e.startsWith("update:"),o=s&&zc(r,e.slice(7));o&&(o.trim&&(i=n.map(c=>Pe(c)?c.trim():c)),o.number&&(i=n.map(Fp)));let a,l=r[a=Bs(e)]||r[a=Bs($t(e))];!l&&s&&(l=r[a=Bs(Ut(e))]),l&&_t(l,t,6,i);const u=r[a+"Once"];if(u){if(!t.emitted)t.emitted={};else if(t.emitted[a])return;t.emitted[a]=!0,_t(u,t,6,i)}}const mg=new WeakMap;function Vc(t,e,n=!1){const r=n?mg:e.emitsCache,i=r.get(t);if(i!==void 0)return i;const s=t.emits;let o={},a=!1;if(!oe(t)){const l=u=>{const c=Vc(u,e,!0);c&&(a=!0,De(o,c))};!n&&e.mixins.length&&e.mixins.forEach(l),t.extends&&l(t.extends),t.mixins&&t.mixins.forEach(l)}return!s&&!a?(Se(t)&&r.set(t,null),null):(se(s)?s.forEach(l=>o[l]=null):De(o,s),Se(t)&&r.set(t,o),o)}function Pi(t,e){return!t||!ti(e)?!1:(e=e.slice(2).replace(/Once$/,""),pe(t,e[0].toLowerCase()+e.slice(1))||pe(t,Ut(e))||pe(t,e))}function Iv(){}function Kc(t){const{type:e,vnode:n,proxy:r,withProxy:i,propsOptions:[s],slots:o,attrs:a,emit:l,render:u,renderCache:c,props:f,data:w,setupState:y,ctx:v,inheritAttrs:I}=t,z=_i(t);let F,A;try{if(n.shapeFlag&4){const m=i||r,h=m;F=xt(u.call(h,m,c,f,y,w,v)),A=a}else{const m=e;F=xt(m.length>1?m(f,{attrs:a,slots:o,emit:l}):m(f,null)),A=e.props?a:gg(a)}}catch(m){ur.length=0,yi(m,t,1),F=qt(On)}let g=F;if(A&&I!==!1){const m=Object.keys(A),{shapeFlag:h}=g;m.length&&h&7&&(s&&m.some(js)&&(A=yg(A,s)),g=Cn(g,A,!1,!0))}return n.dirs&&(g=Cn(g,null,!1,!0),g.dirs=g.dirs?g.dirs.concat(n.dirs):n.dirs),n.transition&&io(g,n.transition),F=g,_i(z),F}const gg=t=>{let e;for(const n in t)(n==="class"||n==="style"||ti(n))&&((e||(e={}))[n]=t[n]);return e},yg=(t,e)=>{const n={};for(const r in t)(!js(r)||!(r.slice(9)in e))&&(n[r]=t[r]);return n};function vg(t,e,n){const{props:r,children:i,component:s}=t,{props:o,children:a,patchFlag:l}=e,u=s.emitsOptions;if(e.dirs||e.transition)return!0;if(n&&l>=0){if(l&1024)return!0;if(l&16)return r?Gc(r,o,u):!!o;if(l&8){const c=e.dynamicProps;for(let f=0;f<c.length;f++){const w=c[f];if(o[w]!==r[w]&&!Pi(u,w))return!0}}}else return(i||a)&&(!a||!a.$stable)?!0:r===o?!1:r?o?Gc(r,o,u):!0:!!o;return!1}function Gc(t,e,n){const r=Object.keys(e);if(r.length!==Object.keys(t).length)return!0;for(let i=0;i<r.length;i++){const s=r[i];if(e[s]!==t[s]&&!Pi(n,s))return!0}return!1}function bg({vnode:t,parent:e},n){for(;e;){const r=e.subTree;if(r.suspense&&r.suspense.activeBranch===t&&(r.el=t.el),r===t)(t=e.vnode).el=n,e=e.parent;else break}}const Yc=t=>t.__isSuspense;function _g(t,e){e&&e.pendingBranch?se(t)?e.effects.push(...t):e.effects.push(t):km(t)}const ht=Symbol.for("v-fgt"),Ci=Symbol.for("v-txt"),On=Symbol.for("v-cmt"),mo=Symbol.for("v-stc"),ur=[];let et=null;function Pn(t=!1){ur.push(et=t?null:[])}function wg(){ur.pop(),et=ur[ur.length-1]||null}let fr=1;function Jc(t,e=!1){fr+=t,t<0&&et&&e&&(et.hasOnce=!0)}function Qc(t){return t.dynamicChildren=fr>0?et||yn:null,wg(),fr>0&&et&&et.push(t),t}function dr(t,e,n,r,i,s){return Qc(on(t,e,n,r,i,s,!0))}function xg(t,e,n,r,i){return Qc(qt(t,e,n,r,i,!0))}function Xc(t){return t?t.__v_isVNode===!0:!1}function hr(t,e){return t.type===e.type&&t.key===e.key}const Zc=({key:t})=>t??null,ki=({ref:t,ref_key:e,ref_for:n})=>(typeof t=="number"&&(t=""+t),t!=null?Pe(t)||Te(t)||oe(t)?{i:at,r:t,k:e,f:!!n}:t:null);function on(t,e=null,n=null,r=0,i=null,s=t===ht?0:1,o=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:t,props:e,key:e&&Zc(e),ref:e&&ki(e),scopeId:hc,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:s,patchFlag:r,dynamicProps:i,dynamicChildren:null,appContext:null,ctx:at};return a?(go(l,n),s&128&&t.normalize(l)):n&&(l.shapeFlag|=Pe(n)?8:16),fr>0&&!o&&et&&(l.patchFlag>0||s&6)&&l.patchFlag!==32&&et.push(l),l}const qt=Sg;function Sg(t,e=null,n=null,r=0,i=null,s=!1){if((!t||t===qm)&&(t=On),Xc(t)){const a=Cn(t,e,!0);return n&&go(a,n),fr>0&&!s&&et&&(a.shapeFlag&6?et[et.indexOf(t)]=a:et.push(a)),a.patchFlag=-2,a}if(Lg(t)&&(t=t.__vccOpts),e){e=Eg(e);let{class:a,style:l}=e;a&&!Pe(a)&&(e.class=si(a)),Se(l)&&(to(l)&&!se(l)&&(l=De({},l)),e.style=Hs(l))}const o=Pe(t)?1:Yc(t)?128:Rm(t)?64:Se(t)?4:oe(t)?2:0;return on(t,e,n,r,i,o,s,!0)}function Eg(t){return t?to(t)||Tc(t)?De({},t):t:null}function Cn(t,e,n=!1,r=!1){const{props:i,ref:s,patchFlag:o,children:a,transition:l}=t,u=e?eu(i||{},e):i,c={__v_isVNode:!0,__v_skip:!0,type:t.type,props:u,key:u&&Zc(u),ref:e&&e.ref?n&&s?se(s)?s.concat(ki(e)):[s,ki(e)]:ki(e):s,scopeId:t.scopeId,slotScopeIds:t.slotScopeIds,children:a,target:t.target,targetStart:t.targetStart,targetAnchor:t.targetAnchor,staticCount:t.staticCount,shapeFlag:t.shapeFlag,patchFlag:e&&t.type!==ht?o===-1?16:o|16:o,dynamicProps:t.dynamicProps,dynamicChildren:t.dynamicChildren,appContext:t.appContext,dirs:t.dirs,transition:l,component:t.component,suspense:t.suspense,ssContent:t.ssContent&&Cn(t.ssContent),ssFallback:t.ssFallback&&Cn(t.ssFallback),placeholder:t.placeholder,el:t.el,anchor:t.anchor,ctx:t.ctx,ce:t.ce};return l&&r&&io(c,l.clone(c)),c}function Og(t=" ",e=0){return qt(Ci,null,t,e)}function xt(t){return t==null||typeof t=="boolean"?qt(On):se(t)?qt(ht,null,t.slice()):Xc(t)?zt(t):qt(Ci,null,String(t))}function zt(t){return t.el===null&&t.patchFlag!==-1||t.memo?t:Cn(t)}function go(t,e){let n=0;const{shapeFlag:r}=t;if(e==null)e=null;else if(se(e))n=16;else if(typeof e=="object")if(r&65){const i=e.default;i&&(i._c&&(i._d=!1),go(t,i()),i._c&&(i._d=!0));return}else{n=32;const i=e._;!i&&!Tc(e)?e._ctx=at:i===3&&at&&(at.slots._===1?e._=1:(e._=2,t.patchFlag|=1024))}else oe(e)?(e={default:e,_ctx:at},n=32):(e=String(e),r&64?(n=16,e=[Og(e)]):n=8);t.children=e,t.shapeFlag|=n}function eu(...t){const e={};for(let n=0;n<t.length;n++){const r=t[n];for(const i in r)if(i==="class")e.class!==r.class&&(e.class=si([e.class,r.class]));else if(i==="style")e.style=Hs([e.style,r.style]);else if(ti(i)){const s=e[i],o=r[i];o&&s!==o&&!(se(s)&&s.includes(o))&&(e[i]=s?[].concat(s,o):o)}else i!==""&&(e[i]=r[i])}return e}function St(t,e,n,r=null){_t(t,e,7,[n,r])}const Pg=$c();let Cg=0;function kg(t,e,n){const r=t.type,i=(e?e.appContext:t.appContext)||Pg,s={uid:Cg++,vnode:t,type:r,parent:e,appContext:i,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new zp(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:e?e.provides:Object.create(i.provides),ids:e?e.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:Nc(r,i),emitsOptions:Vc(r,i),emit:null,emitted:null,propsDefaults:de,inheritAttrs:r.inheritAttrs,ctx:de,data:de,props:de,attrs:de,slots:de,refs:de,setupState:de,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 s.ctx={_:s},s.root=e?e.root:s,s.emit=pg.bind(null,s),t.ce&&t.ce(s),s}let qe=null;const yo=()=>qe||at;let $i,vo;{const t=ii(),e=(n,r)=>{let i;return(i=t[n])||(i=t[n]=[]),i.push(r),s=>{i.length>1?i.forEach(o=>o(s)):i[0](s)}};$i=e("__VUE_INSTANCE_SETTERS__",n=>qe=n),vo=e("__VUE_SSR_SETTERS__",n=>mr=n)}const pr=t=>{const e=qe;return $i(t),t.scope.on(),()=>{t.scope.off(),$i(e)}},tu=()=>{qe&&qe.scope.off(),$i(null)};function nu(t){return t.vnode.shapeFlag&4}let mr=!1;function $g(t,e=!1,n=!1){e&&vo(e);const{props:r,children:i}=t.vnode,s=nu(t);Zm(t,r,s,e),rg(t,i,n||e);const o=s?Ag(t,e):void 0;return e&&vo(!1),o}function Ag(t,e){const n=t.type;t.accessCache=Object.create(null),t.proxy=new Proxy(t.ctx,zm);const{setup:r}=n;if(r){vt();const i=t.setupContext=r.length>1?Rg(t):null,s=pr(t),o=wn(r,t,0,[t.props,i]),a=Al(o);if(bt(),s(),(a||t.sp)&&!sr(t)&&mc(t),a){if(o.then(tu,tu),e)return o.then(l=>{ru(t,l)}).catch(l=>{yi(l,t,0)});t.asyncDep=o}else ru(t,o)}else iu(t)}function ru(t,e,n){oe(e)?t.type.__ssrInlineRender?t.ssrRender=e:t.render=e:Se(e)&&(t.setupState=oc(e)),iu(t)}function iu(t,e,n){const r=t.type;t.render||(t.render=r.render||yt);{const i=pr(t);vt();try{Vm(t)}finally{bt(),i()}}}const Ig={get(t,e){return Ue(t,"get",""),t[e]}};function Rg(t){const e=n=>{t.exposed=n||{}};return{attrs:new Proxy(t.attrs,Ig),slots:t.slots,emit:t.emit,expose:e}}function Ai(t){return t.exposed?t.exposeProxy||(t.exposeProxy=new Proxy(oc(dm(t.exposed)),{get(e,n){if(n in e)return e[n];if(n in or)return or[n](t)},has(e,n){return n in e||n in or}})):t.proxy}const Tg=/(?:^|[-_])\w/g,Dg=t=>t.replace(Tg,e=>e.toUpperCase()).replace(/[-_]/g,"");function Ng(t,e=!0){return oe(t)?t.displayName||t.name:t.name||e&&t.__name}function su(t,e,n=!1){let r=Ng(e);if(!r&&e.__file){const i=e.__file.match(/([^/\\]+)\.\w+$/);i&&(r=i[1])}if(!r&&t&&t.parent){const i=s=>{for(const o in s)if(s[o]===e)return o};r=i(t.components||t.parent.type.components)||i(t.appContext.components)}return r?Dg(r):n?"App":"Anonymous"}function Lg(t){return oe(t)&&"__vccOpts"in t}const ou=(t,e)=>bm(t,e,mr),jg="3.5.21";/**
77
104
  * @vue/runtime-dom v3.5.21
78
105
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
79
106
  * @license MIT
80
- **/let vo;const fu=typeof window<"u"&&window.trustedTypes;if(fu)try{vo=fu.createPolicy("vue",{createHTML:t=>t})}catch{}const du=vo?t=>vo.createHTML(t):t=>t,zg="http://www.w3.org/2000/svg",Vg="http://www.w3.org/1998/Math/MathML",Rt=typeof document<"u"?document:null,hu=Rt&&Rt.createElement("template"),Kg={insert:(t,e,n)=>{e.insertBefore(t,n||null)},remove:t=>{const e=t.parentNode;e&&e.removeChild(t)},createElement:(t,e,n,r)=>{const i=e==="svg"?Rt.createElementNS(zg,t):e==="mathml"?Rt.createElementNS(Vg,t):n?Rt.createElement(t,{is:n}):Rt.createElement(t);return t==="select"&&r&&r.multiple!=null&&i.setAttribute("multiple",r.multiple),i},createText:t=>Rt.createTextNode(t),createComment:t=>Rt.createComment(t),setText:(t,e)=>{t.nodeValue=e},setElementText:(t,e)=>{t.textContent=e},parentNode:t=>t.parentNode,nextSibling:t=>t.nextSibling,querySelector:t=>Rt.querySelector(t),setScopeId(t,e){t.setAttribute(e,"")},insertStaticContent(t,e,n,r,i,s){const o=n?n.previousSibling:e.lastChild;if(i&&(i===s||i.nextSibling))for(;e.insertBefore(i.cloneNode(!0),n),!(i===s||!(i=i.nextSibling)););else{hu.innerHTML=du(r==="svg"?`<svg>${t}</svg>`:r==="mathml"?`<math>${t}</math>`:t);const a=hu.content;if(r==="svg"||r==="mathml"){const l=a.firstChild;for(;l.firstChild;)a.appendChild(l.firstChild);a.removeChild(l)}e.insertBefore(a,n)}return[o?o.nextSibling:e.firstChild,n?n.previousSibling:e.lastChild]}},Yg=Symbol("_vtc");function Gg(t,e,n){const r=t[Yg];r&&(e=(e?[e,...r]:[...r]).join(" ")),e==null?t.removeAttribute("class"):n?t.setAttribute("class",e):t.className=e}const $i=Symbol("_vod"),pu=Symbol("_vsh"),Jg={name:"show",beforeMount(t,{value:e},{transition:n}){t[$i]=t.style.display==="none"?"":t.style.display,n&&e?n.beforeEnter(t):gr(t,e)},mounted(t,{value:e},{transition:n}){n&&e&&n.enter(t)},updated(t,{value:e,oldValue:n},{transition:r}){!e!=!n&&(r?e?(r.beforeEnter(t),gr(t,!0),r.enter(t)):r.leave(t,()=>{gr(t,!1)}):gr(t,e))},beforeUnmount(t,{value:e}){gr(t,e)}};function gr(t,e){t.style.display=e?t[$i]:"none",t[pu]=!e}const Qg=Symbol(""),Xg=/(?:^|;)\s*display\s*:/;function Zg(t,e,n){const r=t.style,i=Oe(n);let s=!1;if(n&&!i){if(e)if(Oe(e))for(const o of e.split(";")){const a=o.slice(0,o.indexOf(":")).trim();n[a]==null&&Ai(r,a,"")}else for(const o in e)n[o]==null&&Ai(r,o,"");for(const o in n)o==="display"&&(s=!0),Ai(r,o,n[o])}else if(i){if(e!==n){const o=r[Qg];o&&(n+=";"+o),r.cssText=n,s=Xg.test(n)}}else e&&t.removeAttribute("style");$i in t&&(t[$i]=s?r.display:"",t[pu]&&(r.display="none"))}const mu=/\s*!important$/;function Ai(t,e,n){if(se(n))n.forEach(r=>Ai(t,e,r));else if(n==null&&(n=""),e.startsWith("--"))t.setProperty(e,n);else{const r=ey(t,e);mu.test(n)?t.setProperty(Bt(r),n.replace(mu,""),"important"):t[r]=n}}const gu=["Webkit","Moz","ms"],_o={};function ey(t,e){const n=_o[e];if(n)return n;let r=Pt(e);if(r!=="filter"&&r in t)return _o[e]=r;r=Ll(r);for(let i=0;i<gu.length;i++){const s=gu[i]+r;if(s in t)return _o[e]=s}return e}const yu="http://www.w3.org/1999/xlink";function bu(t,e,n,r,i,s=Qp(e)){r&&e.startsWith("xlink:")?n==null?t.removeAttributeNS(yu,e.slice(6,e.length)):t.setAttributeNS(yu,e,n):n==null||s&&!Bl(n)?t.removeAttribute(e):t.setAttribute(e,s?"":Ft(n)?String(n):n)}function vu(t,e,n,r,i){if(e==="innerHTML"||e==="textContent"){n!=null&&(t[e]=e==="innerHTML"?du(n):n);return}const s=t.tagName;if(e==="value"&&s!=="PROGRESS"&&!s.includes("-")){const a=s==="OPTION"?t.getAttribute("value")||"":t.value,l=n==null?t.type==="checkbox"?"on":"":String(n);(a!==l||!("_value"in t))&&(t.value=l),n==null&&t.removeAttribute(e),t._value=n;return}let o=!1;if(n===""||n==null){const a=typeof t[e];a==="boolean"?n=Bl(n):n==null&&a==="string"?(n="",o=!0):a==="number"&&(n=0,o=!0)}try{t[e]=n}catch{}o&&t.removeAttribute(i||e)}function ty(t,e,n,r){t.addEventListener(e,n,r)}function ny(t,e,n,r){t.removeEventListener(e,n,r)}const _u=Symbol("_vei");function ry(t,e,n,r,i=null){const s=t[_u]||(t[_u]={}),o=s[e];if(r&&o)o.value=r;else{const[a,l]=iy(e);if(r){const u=s[e]=ay(r,i);ty(t,a,u,l)}else o&&(ny(t,a,o,l),s[e]=void 0)}}const wu=/(?:Once|Passive|Capture)$/;function iy(t){let e;if(wu.test(t)){e={};let r;for(;r=t.match(wu);)t=t.slice(0,t.length-r[0].length),e[r[0].toLowerCase()]=!0}return[t[2]===":"?t.slice(3):Bt(t.slice(2)),e]}let wo=0;const sy=Promise.resolve(),oy=()=>wo||(sy.then(()=>wo=0),wo=Date.now());function ay(t,e){const n=r=>{if(!r._vts)r._vts=Date.now();else if(r._vts<=n.attached)return;_t(ly(r,n.value),e,5,[r])};return n.value=t,n.attached=oy(),n}function ly(t,e){if(se(e)){const n=t.stopImmediatePropagation;return t.stopImmediatePropagation=()=>{n.call(t),t._stopped=!0},e.map(r=>i=>!i._stopped&&r&&r(i))}else return e}const xu=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)>96&&t.charCodeAt(2)<123,cy=(t,e,n,r,i,s)=>{const o=i==="svg";e==="class"?Gg(t,r,o):e==="style"?Zg(t,n,r):Zr(e)?Ls(e)||ry(t,e,n,r,s):(e[0]==="."?(e=e.slice(1),!0):e[0]==="^"?(e=e.slice(1),!1):uy(t,e,r,o))?(vu(t,e,r),!t.tagName.includes("-")&&(e==="value"||e==="checked"||e==="selected")&&bu(t,e,r,o,s,e!=="value")):t._isVueCE&&(/[A-Z]/.test(e)||!Oe(r))?vu(t,Pt(e),r,s,e):(e==="true-value"?t._trueValue=r:e==="false-value"&&(t._falseValue=r),bu(t,e,r,o))};function uy(t,e,n,r){if(r)return!!(e==="innerHTML"||e==="textContent"||e in t&&xu(e)&&oe(n));if(e==="spellcheck"||e==="draggable"||e==="translate"||e==="autocorrect"||e==="form"||e==="list"&&t.tagName==="INPUT"||e==="type"&&t.tagName==="TEXTAREA")return!1;if(e==="width"||e==="height"){const i=t.tagName;if(i==="IMG"||i==="VIDEO"||i==="CANVAS"||i==="SOURCE")return!1}return xu(e)&&Oe(n)?!1:e in t}const fy=De({patchProp:cy},Kg);let Su;function dy(){return Su||(Su=dg(fy))}const hy=(...t)=>{const e=dy().createApp(...t),{mount:n}=e;return e.mount=r=>{const i=my(r);if(!i)return;const s=e._component;!oe(s)&&!s.render&&!s.template&&(s.template=i.innerHTML),i.nodeType===1&&(i.textContent="");const o=n(i,!1,py(i));return i instanceof Element&&(i.removeAttribute("v-cloak"),i.setAttribute("data-v-app","")),o},e};function py(t){if(t instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&t instanceof MathMLElement)return"mathml"}function my(t){return Oe(t)?document.querySelector(t):t}const xo=Symbol("IPEInjectKey"),gy=(t,e)=>(e?e.provide(xo,t):Dc(xo,t),t),yy=()=>{const t=lr(xo);if(!t)throw new Error("InPageEdit instance is not provided");return t},lt=":host{all:initial;font-family:var(--schema-font-family, ui-sans-serif, system-ui, -apple-system)}*,*:before,*:after{box-sizing:border-box}:host{color:var(--schema-color-fg, #111827)}:host{--schema-radius: var(--schema-radius, 10px)}.wrapper{display:block;background:var(--schema-color-bg, #ffffff)}.form{display:grid;gap:12px}.field{display:grid;gap:6px;padding:8px 10px;border:1px solid var(--schema-color-muted, #e5e7eb);border-radius:var(--schema-radius);background:var(--schema-surface, #fff)}.label{font-size:12px;color:var(--schema-color-muted-text, #6b7280)}.input,select,textarea{width:100%;padding:8px 10px;border-radius:8px;border:1px solid var(--schema-color-muted, #e5e7eb);background:var(--schema-input-bg, #fff);color:inherit}.checkbox{display:inline-flex;align-items:center;gap:8px}.helper{font-size:12px;color:var(--schema-color-muted-text, #6b7280)}.row{display:grid;gap:8px}.actions{display:flex;gap:8px}.btn{padding:6px 10px;border:1px solid var(--schema-color-muted, #e5e7eb);background:var(--schema-btn-bg, #f8fafc);border-radius:8px;cursor:pointer}.btn.primary{background:var(--schema-color-primary, #2563eb);color:#fff;border-color:transparent}.btn:disabled{opacity:.5;cursor:not-allowed}.btn.danger{background:var(--schema-color-danger, #dc2626);color:#fff;border-color:transparent}.group{display:grid;gap:10px;border-left:3px solid var(--schema-color-muted, #e5e7eb);padding-left:10px}.kv{display:grid;grid-template-columns:1fr 1fr auto;gap:8px;align-items:center}.badge{display:inline-flex;padding:2px 6px;border-radius:999px;font-size:11px;background:var(--schema-badge-bg, #eef2ff);color:var(--schema-badge-fg, #4f46e5)}.hidden{display:none!important}.toolbar{display:flex;gap:6px}";/**
107
+ **/let bo;const au=typeof window<"u"&&window.trustedTypes;if(au)try{bo=au.createPolicy("vue",{createHTML:t=>t})}catch{}const lu=bo?t=>bo.createHTML(t):t=>t,Mg="http://www.w3.org/2000/svg",Fg="http://www.w3.org/1998/Math/MathML",Dt=typeof document<"u"?document:null,cu=Dt&&Dt.createElement("template"),Bg={insert:(t,e,n)=>{e.insertBefore(t,n||null)},remove:t=>{const e=t.parentNode;e&&e.removeChild(t)},createElement:(t,e,n,r)=>{const i=e==="svg"?Dt.createElementNS(Mg,t):e==="mathml"?Dt.createElementNS(Fg,t):n?Dt.createElement(t,{is:n}):Dt.createElement(t);return t==="select"&&r&&r.multiple!=null&&i.setAttribute("multiple",r.multiple),i},createText:t=>Dt.createTextNode(t),createComment:t=>Dt.createComment(t),setText:(t,e)=>{t.nodeValue=e},setElementText:(t,e)=>{t.textContent=e},parentNode:t=>t.parentNode,nextSibling:t=>t.nextSibling,querySelector:t=>Dt.querySelector(t),setScopeId(t,e){t.setAttribute(e,"")},insertStaticContent(t,e,n,r,i,s){const o=n?n.previousSibling:e.lastChild;if(i&&(i===s||i.nextSibling))for(;e.insertBefore(i.cloneNode(!0),n),!(i===s||!(i=i.nextSibling)););else{cu.innerHTML=lu(r==="svg"?`<svg>${t}</svg>`:r==="mathml"?`<math>${t}</math>`:t);const a=cu.content;if(r==="svg"||r==="mathml"){const l=a.firstChild;for(;l.firstChild;)a.appendChild(l.firstChild);a.removeChild(l)}e.insertBefore(a,n)}return[o?o.nextSibling:e.firstChild,n?n.previousSibling:e.lastChild]}},Ug=Symbol("_vtc");function Hg(t,e,n){const r=t[Ug];r&&(e=(e?[e,...r]:[...r]).join(" ")),e==null?t.removeAttribute("class"):n?t.setAttribute("class",e):t.className=e}const Ii=Symbol("_vod"),uu=Symbol("_vsh"),Wg={name:"show",beforeMount(t,{value:e},{transition:n}){t[Ii]=t.style.display==="none"?"":t.style.display,n&&e?n.beforeEnter(t):gr(t,e)},mounted(t,{value:e},{transition:n}){n&&e&&n.enter(t)},updated(t,{value:e,oldValue:n},{transition:r}){!e!=!n&&(r?e?(r.beforeEnter(t),gr(t,!0),r.enter(t)):r.leave(t,()=>{gr(t,!1)}):gr(t,e))},beforeUnmount(t,{value:e}){gr(t,e)}};function gr(t,e){t.style.display=e?t[Ii]:"none",t[uu]=!e}const qg=Symbol(""),zg=/(?:^|;)\s*display\s*:/;function Vg(t,e,n){const r=t.style,i=Pe(n);let s=!1;if(n&&!i){if(e)if(Pe(e))for(const o of e.split(";")){const a=o.slice(0,o.indexOf(":")).trim();n[a]==null&&Ri(r,a,"")}else for(const o in e)n[o]==null&&Ri(r,o,"");for(const o in n)o==="display"&&(s=!0),Ri(r,o,n[o])}else if(i){if(e!==n){const o=r[qg];o&&(n+=";"+o),r.cssText=n,s=zg.test(n)}}else e&&t.removeAttribute("style");Ii in t&&(t[Ii]=s?r.display:"",t[uu]&&(r.display="none"))}const fu=/\s*!important$/;function Ri(t,e,n){if(se(n))n.forEach(r=>Ri(t,e,r));else if(n==null&&(n=""),e.startsWith("--"))t.setProperty(e,n);else{const r=Kg(t,e);fu.test(n)?t.setProperty(Ut(r),n.replace(fu,""),"important"):t[r]=n}}const du=["Webkit","Moz","ms"],_o={};function Kg(t,e){const n=_o[e];if(n)return n;let r=$t(e);if(r!=="filter"&&r in t)return _o[e]=r;r=Tl(r);for(let i=0;i<du.length;i++){const s=du[i]+r;if(s in t)return _o[e]=s}return e}const hu="http://www.w3.org/1999/xlink";function pu(t,e,n,r,i,s=qp(e)){r&&e.startsWith("xlink:")?n==null?t.removeAttributeNS(hu,e.slice(6,e.length)):t.setAttributeNS(hu,e,n):n==null||s&&!Ll(n)?t.removeAttribute(e):t.setAttribute(e,s?"":Bt(n)?String(n):n)}function mu(t,e,n,r,i){if(e==="innerHTML"||e==="textContent"){n!=null&&(t[e]=e==="innerHTML"?lu(n):n);return}const s=t.tagName;if(e==="value"&&s!=="PROGRESS"&&!s.includes("-")){const a=s==="OPTION"?t.getAttribute("value")||"":t.value,l=n==null?t.type==="checkbox"?"on":"":String(n);(a!==l||!("_value"in t))&&(t.value=l),n==null&&t.removeAttribute(e),t._value=n;return}let o=!1;if(n===""||n==null){const a=typeof t[e];a==="boolean"?n=Ll(n):n==null&&a==="string"?(n="",o=!0):a==="number"&&(n=0,o=!0)}try{t[e]=n}catch{}o&&t.removeAttribute(i||e)}function Gg(t,e,n,r){t.addEventListener(e,n,r)}function Yg(t,e,n,r){t.removeEventListener(e,n,r)}const gu=Symbol("_vei");function Jg(t,e,n,r,i=null){const s=t[gu]||(t[gu]={}),o=s[e];if(r&&o)o.value=r;else{const[a,l]=Qg(e);if(r){const u=s[e]=ey(r,i);Gg(t,a,u,l)}else o&&(Yg(t,a,o,l),s[e]=void 0)}}const yu=/(?:Once|Passive|Capture)$/;function Qg(t){let e;if(yu.test(t)){e={};let r;for(;r=t.match(yu);)t=t.slice(0,t.length-r[0].length),e[r[0].toLowerCase()]=!0}return[t[2]===":"?t.slice(3):Ut(t.slice(2)),e]}let wo=0;const Xg=Promise.resolve(),Zg=()=>wo||(Xg.then(()=>wo=0),wo=Date.now());function ey(t,e){const n=r=>{if(!r._vts)r._vts=Date.now();else if(r._vts<=n.attached)return;_t(ty(r,n.value),e,5,[r])};return n.value=t,n.attached=Zg(),n}function ty(t,e){if(se(e)){const n=t.stopImmediatePropagation;return t.stopImmediatePropagation=()=>{n.call(t),t._stopped=!0},e.map(r=>i=>!i._stopped&&r&&r(i))}else return e}const vu=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)>96&&t.charCodeAt(2)<123,ny=(t,e,n,r,i,s)=>{const o=i==="svg";e==="class"?Hg(t,r,o):e==="style"?Vg(t,n,r):ti(e)?js(e)||Jg(t,e,n,r,s):(e[0]==="."?(e=e.slice(1),!0):e[0]==="^"?(e=e.slice(1),!1):ry(t,e,r,o))?(mu(t,e,r),!t.tagName.includes("-")&&(e==="value"||e==="checked"||e==="selected")&&pu(t,e,r,o,s,e!=="value")):t._isVueCE&&(/[A-Z]/.test(e)||!Pe(r))?mu(t,$t(e),r,s,e):(e==="true-value"?t._trueValue=r:e==="false-value"&&(t._falseValue=r),pu(t,e,r,o))};function ry(t,e,n,r){if(r)return!!(e==="innerHTML"||e==="textContent"||e in t&&vu(e)&&oe(n));if(e==="spellcheck"||e==="draggable"||e==="translate"||e==="autocorrect"||e==="form"||e==="list"&&t.tagName==="INPUT"||e==="type"&&t.tagName==="TEXTAREA")return!1;if(e==="width"||e==="height"){const i=t.tagName;if(i==="IMG"||i==="VIDEO"||i==="CANVAS"||i==="SOURCE")return!1}return vu(e)&&Pe(n)?!1:e in t}const iy=De({patchProp:ny},Bg);let bu;function sy(){return bu||(bu=sg(iy))}const oy=(...t)=>{const e=sy().createApp(...t),{mount:n}=e;return e.mount=r=>{const i=ly(r);if(!i)return;const s=e._component;!oe(s)&&!s.render&&!s.template&&(s.template=i.innerHTML),i.nodeType===1&&(i.textContent="");const o=n(i,!1,ay(i));return i instanceof Element&&(i.removeAttribute("v-cloak"),i.setAttribute("data-v-app","")),o},e};function ay(t){if(t instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&t instanceof MathMLElement)return"mathml"}function ly(t){return Pe(t)?document.querySelector(t):t}const xo=Symbol("IPEInjectKey"),cy=(t,e)=>(e?e.provide(xo,t):Ac(xo,t),t),uy=()=>{const t=lr(xo);if(!t)throw new Error("InPageEdit instance is not provided");return t},lt=":host{all:initial;font-family:var(--schema-font-family, ui-sans-serif, system-ui, -apple-system)}*,*:before,*:after{box-sizing:border-box}:host{color:var(--schema-color-fg, #111827)}:host{--schema-radius: var(--schema-radius, 10px)}.wrapper{display:block;background:var(--schema-color-bg, #ffffff)}.form{display:grid;gap:12px}.field{display:grid;gap:6px;padding:8px 10px;border:1px solid var(--schema-color-muted, #e5e7eb);border-radius:var(--schema-radius);background:var(--schema-surface, #fff)}.label{font-size:12px;color:var(--schema-color-muted-text, #6b7280)}.input,select,textarea{width:100%;padding:8px 10px;border-radius:8px;border:1px solid var(--schema-color-muted, #e5e7eb);background:var(--schema-input-bg, #fff);color:inherit}.checkbox{display:inline-flex;align-items:center;gap:8px}.helper{font-size:12px;color:var(--schema-color-muted-text, #6b7280)}.row{display:grid;gap:8px}.actions{display:flex;gap:8px}.btn{padding:6px 10px;border:1px solid var(--schema-color-muted, #e5e7eb);background:var(--schema-btn-bg, #f8fafc);border-radius:8px;cursor:pointer}.btn.primary{background:var(--schema-color-primary, #2563eb);color:#fff;border-color:transparent}.btn:disabled{opacity:.5;cursor:not-allowed}.btn.danger{background:var(--schema-color-danger, #dc2626);color:#fff;border-color:transparent}.group{display:grid;gap:10px;border-left:3px solid var(--schema-color-muted, #e5e7eb);padding-left:10px}.kv{display:grid;grid-template-columns:1fr 1fr auto;gap:8px;align-items:center}.badge{display:inline-flex;padding:2px 6px;border-radius:999px;font-size:11px;background:var(--schema-badge-bg, #eef2ff);color:var(--schema-badge-fg, #4f46e5)}.hidden{display:none!important}.toolbar{display:flex;gap:6px}";/**
81
108
  * SchemaForm
82
109
  * 一个基于 Schemastery 的 Web Components 表单生成器
83
110
  *
@@ -94,5 +121,5 @@
94
121
  * @license MIT
95
122
  * @author dragon-fish
96
123
  * @author @openai/gpt-5
97
- */const Eu={arrayAdd:"+",arrayMoveUp:"↑",arrayMoveDown:"↓",arrayRemove:"×",dictAdd:"+",dictRemove:"×",rootLabel:"root"},Ee=(t,e)=>{customElements.get(t)||customElements.define(t,e)},by=(t,e,n)=>{if(!e.length)return;let r=t,i=null,s=null;for(let a=0;a<e.length-1;a++){const l=e[a];let u=r?.[l];u==null?(u=typeof e[a+1]=="number"?[]:{},r[l]=u):typeof u!="object"&&(u=typeof e[a+1]=="number"?[]:{},r[l]=u),i=r,s=l,r=u}const o=e[e.length-1];if(r==null||typeof r!="object"){const a=typeof o=="number"?[]:{};if(i)i[s]=a,r=a;else return}try{r[o]=n}catch{try{const a=Array.isArray(r)?r.slice():{...r};a[o]=n,i&&(i[s]=a)}catch{}}},yr=t=>t.map(String).join("."),vy=t=>t.replace(/[^a-zA-Z0-9_-]/g,"_"),zt=t=>`schema_${vy(yr(t)||"root")}`,Vt=t=>yr(t);function Ii(t,e){if(e==null)return e;switch(t){case"number":case"natural":case"percent":{if(e==="")return;const n=Number(e);return Number.isNaN(n)?void 0:n}case"boolean":return!!e;case"date":{if(!e)return;const n=new Date(e);return Number.isNaN(+n)?void 0:n}case"const":case"string":default:return e}}function Cu(t){return typeof t=="function"&&!!t?.type}function Ou(t){if(!t)throw new Error("schema is required");if(Cu(t))return t;try{const e=Schema.from(t);if(Cu(e))return e}catch{}if(t?.type){const e=t.type;if(Schema[e])return Schema[e](t.inner??t.list??t.dict)}throw new Error("无法从传入对象生成 Schemastery 实例,请传入 schema 或 schema.toJSON() 的结果。")}function Et(t){return t?.meta??{}}function _y(t){return t.length>0&&t.every(e=>e?.type==="const")}function Pn(t){if(!t)return;const e=t,n=e.meta||{};if(Object.prototype.hasOwnProperty.call(n,"default"))return n.default;const r=e.type;try{const i=t();if(i!==void 0)return i}catch{}switch(r){case"string":return"";case"number":case"natural":case"percent":return 0;case"boolean":return!1;case"array":return[];case"tuple":return[];case"object":return{};case"dict":return{};case"union":{const i=e.list||[];return i.length?Pn(i[0]):void 0}case"const":return e.value;case"date":return;default:return}}class Ct extends HTMLElement{constructor(){super(),this._path=[],this._i18n=Eu,this.$root=this.attachShadow({mode:"open"});const e=document.createElement("style");e.textContent=lt,this.$root.appendChild(e)}makeFieldContainer(e,n){const r=document.createElement("div");if(r.className=`field schema-form-item schema-type-${e}`,r.setAttribute("data-path",yr(this._path)),this._label){const i=document.createElement("label");i.className="label",i.textContent=this._label,r.appendChild(i)}if(n){const i=document.createElement("div");i.className="helper",i.textContent=n,r.appendChild(i)}return r}set schema(e){this._schema=Ou(e),this.render()}get schema(){return this._schema}set path(e){this._path=e??[],this.render()}get path(){return this._path}set label(e){this._label=e,this.render()}get label(){return this._label}set i18n(e){e&&(this._i18n={...this._i18n,...e}),this.render()}get i18n(){return this._i18n}setValue(e){this._value=e,this.render()}getValue(){return this._value}emitChange(e){this._value=e,this.dispatchEvent(new CustomEvent("change",{bubbles:!0,composed:!0,detail:{path:this._path,value:e}}))}}class ku extends Ct{render(){if(this.$input&&this.$root.contains(this.$input)){const s=this._value??"";this.$input.value!==s&&document.activeElement!==this.$input&&(this.$input.value=s);return}this.$root.innerHTML=`<style>${lt}</style>`;const e=Et(this._schema),n=this.makeFieldContainer("string",e.description),r=document.createElement("input");this.$input=r,r.className="input",r.type="text",r.name=Vt(this._path),r.id=zt(this._path),e?.pattern?.source&&(r.pattern=e.pattern.source),e?.max!=null&&(r.maxLength=e.max),r.value=this._value??"",r.oninput=()=>this.emitChange(Ii("string",r.value));const i=n.querySelector("label.label");i&&(i.htmlFor=r.id),n.appendChild(r),this.$root.appendChild(n)}}Ee("schema-form-string",ku);class Pu extends Ct{render(){if(this.$input&&this.$root.contains(this.$input)){const o=this._value??"";this.$input.value!==String(o)&&document.activeElement!==this.$input&&(this.$input.value=o);return}this.$root.innerHTML=`<style>${lt}</style>`;const e=this._schema?.type??"number",n=Et(this._schema),r=this.makeFieldContainer("number",n.description),i=document.createElement("input");this.$input=i,i.className="input",i.type="number",i.name=Vt(this._path),i.id=zt(this._path),n?.min!=null&&(i.min=String(n.min)),n?.max!=null&&(i.max=String(n.max)),n?.step!=null&&(i.step=String(n.step)),e==="percent"&&!i.step&&(i.step="0.01"),i.value=this._value??"",i.oninput=()=>this.emitChange(Ii(e,i.value));const s=r.querySelector("label.label");s&&(s.htmlFor=i.id),r.appendChild(i),this.$root.appendChild(r)}}Ee("schema-form-number",Pu);class $u extends Ct{render(){this.$root.innerHTML=`<style>${lt}</style>`;const e=Et(this._schema),n=this.makeFieldContainer("boolean",e.description),r=document.createElement("label");r.className="checkbox";const i=document.createElement("input");i.type="checkbox",i.checked=!!this._value,i.name=Vt(this._path),i.id=zt(this._path);const s=document.createElement("span");s.textContent=this._label??"",i.onchange=()=>this.emitChange(i.checked);const o=n.querySelector("label.label");o&&(o.htmlFor=i.id),r.append(i,s),n.appendChild(r),this.$root.appendChild(n)}}Ee("schema-form-boolean",$u);class Au extends Ct{render(){if(this.$input&&this.$root.contains(this.$input)){const s=this._value??null;document.activeElement!==this.$input&&(this.$input.valueAsDate=s);return}this.$root.innerHTML=`<style>${lt}</style>`;const e=Et(this._schema),n=this.makeFieldContainer("date",e.description),r=document.createElement("input");this.$input=r,r.className="input",r.type="date",r.name=Vt(this._path),r.id=zt(this._path),r.valueAsDate=this._value??null,r.oninput=()=>this.emitChange(Ii("date",r.value));const i=n.querySelector("label.label");i&&(i.htmlFor=r.id),n.appendChild(r),this.$root.appendChild(n)}}Ee("schema-form-date",Au);class Iu extends Ct{render(){this.$root.innerHTML=`<style>${lt}</style>`;const e=Et(this._schema),n=this.makeFieldContainer("const",e.description),r=document.createElement("input");r.className="input",r.readOnly=!0,r.value=String(this._schema.value),r.name=Vt(this._path),r.id=zt(this._path);const i=n.querySelector("label.label");i&&(i.htmlFor=r.id),n.appendChild(r),this.$root.appendChild(n)}}Ee("schema-form-const",Iu);function wy(t){switch(t.type){case"string":return"schema-form-string";case"number":case"natural":case"percent":return"schema-form-number";case"boolean":return"schema-form-boolean";case"date":return"schema-form-date";case"const":return"schema-form-const";case"array":return"schema-form-array";case"object":return"schema-form-object";case"tuple":return"schema-form-tuple";case"dict":return"schema-form-dict";case"union":return"schema-form-union";default:return"schema-form-string"}}function $n(t,e,n,r,i){const s=wy(t),o=document.createElement(s);return o.schema=t,o.path=e,o.label=r,i&&(o.i18n=i),o.setValue?.(n),o}class Tu extends Ct{render(){this.$root.innerHTML=`<style>${lt}</style>`;const e=Et(this._schema),n=this.makeFieldContainer("union",e.description),r=this._schema.list||[];if(_y(r)){const i=document.createElement("select");i.className="input",i.name=Vt(this._path),i.id=zt(this._path),r.forEach(o=>{const a=document.createElement("option");a.value=String(o.value),a.textContent=String(o.value),this._value===o.value&&(a.selected=!0),i.appendChild(a)}),i.onchange=()=>this.emitChange(Ii("string",i.value));const s=n.querySelector("label.label");s&&(s.htmlFor=i.id),n.appendChild(i)}else{const i=document.createElement("div");i.className="toolbar";const s=document.createElement("select");s.className="input",s.name=Vt(this._path)+".__type",s.id=zt(this._path)+"__type";let o=0;r.forEach((c,f)=>{const w=document.createElement("option");w.value=String(f),w.textContent=c.type,s.appendChild(w)}),s.onchange=()=>{o=Number(s.value);const c=r[o],f=Pn(c);this.emitChange(f),u()};const a=n.querySelector("label.label");a&&(a.htmlFor=s.id),i.appendChild(s),n.appendChild(i);const l=document.createElement("div");l.className="group";const u=()=>{l.innerHTML="";const c=r[o],f=$n(c,this._path,this._value,this._label);f.addEventListener("change",w=>{w.stopPropagation(),this.emitChange(w.detail.value)}),l.appendChild(f)};u(),n.appendChild(l)}this.$root.appendChild(n)}}Ee("schema-form-union",Tu);class Ru extends Ct{render(){this.$root.innerHTML=`<style>${lt}</style>`;const e=Et(this._schema),n=this.makeFieldContainer("tuple",e.description),r=document.createElement("div");r.className="group";const i=Array.isArray(this._value)?this._value:[];(this._schema.list||[]).forEach((s,o)=>{const a=$n(s,[...this._path,o],i[o],`${this._label??""}[${o}]`);a.addEventListener("change",l=>{l.stopPropagation();const u=Array.isArray(this._value)?this._value.slice():[];u[o]=l.detail.value,this.emitChange(u)}),r.appendChild(a)}),n.appendChild(r),this.$root.appendChild(n)}}Ee("schema-form-tuple",Ru);class Du extends Ct{render(){this.$root.innerHTML=`<style>${lt}</style>`;const e=Et(this._schema),n=this.makeFieldContainer("object",e.description),r=document.createElement("div");r.className="group";const i=this._schema.dict||{};Object.keys(i).forEach(s=>{if(i[s]?.meta?.hidden)return;const o=(this._value??{})[s],a=$n(i[s],[...this._path,s],o,s);a.addEventListener("change",l=>{l.stopPropagation();const u={...this._value??{}};u[s]=l.detail.value,this.emitChange(u)}),r.appendChild(a)}),n.appendChild(r),this.$root.appendChild(n)}}Ee("schema-form-object",Du);class Nu extends Ct{render(){this.$root.innerHTML=`<style>${lt}</style>`;const e=Et(this._schema),n=this.makeFieldContainer("array",e.description),r=document.createElement("div");r.className="group";const i=this._schema.inner,s=()=>Array.isArray(this._value)?this._value:[],o=()=>{r.innerHTML="",s().forEach((u,c)=>{const f=[...this._path,c],w=document.createElement("div");w.className="row",w.setAttribute("data-path",yr(f));const y=$n(i,f,u,`${this._label??""}[${c}]`);y.addEventListener("change",A=>{A.stopPropagation();const g=s().slice();g[c]=A.detail.value,this.emitChange(g)});const v=document.createElement("div");v.className="actions";const I=document.createElement("button");I.type="button",I.className="btn",I.textContent=this._i18n.arrayMoveUp??"↑",I.onclick=()=>{if(c>0){const A=s().slice();[A[c-1],A[c]]=[A[c],A[c-1]],this.emitChange(A),o()}};const z=document.createElement("button");z.type="button",z.className="btn",z.textContent=this._i18n.arrayMoveDown??"↓",z.onclick=()=>{const A=s();if(c<A.length-1){const g=A.slice();[g[c+1],g[c]]=[g[c],g[c+1]],this.emitChange(g),o()}};const F=document.createElement("button");F.type="button",F.className="btn danger",F.textContent=this._i18n.arrayRemove??"×",F.onclick=()=>{const A=s().filter((g,m)=>m!==c);this.emitChange(A),o()},v.append(I,z,F),w.appendChild(y),w.appendChild(v),r.appendChild(w)})};o();const a=document.createElement("button");a.type="button",a.className="btn primary",a.textContent=this._i18n.arrayAdd??"+",a.onclick=()=>{const u=s().slice();u.push(Pn(i)),this.emitChange(u),o()};const l=document.createElement("div");l.className="actions",l.appendChild(a),n.appendChild(r),n.appendChild(l),this.$root.appendChild(n)}}Ee("schema-form-array",Nu);class ju extends Ct{render(){this.$root.innerHTML=`<style>${lt}</style>`;const e=Et(this._schema),n=this.makeFieldContainer("dict",e.description),r=document.createElement("div");r.className="group";const i=this._value??{},s=this._schema.inner;Object.keys(i).forEach(l=>{const u=[...this._path,l],c=document.createElement("div");c.className="kv",c.setAttribute("data-path",yr(u));const f=document.createElement("input");f.className="input",f.value=l,f.name=Vt(u)+".__key",f.id=zt(u)+"__key";const w=$n(s,u,i[l],`${this._label??""}[${l}]`),y=document.createElement("button");y.type="button",y.className="btn danger",y.textContent=this._i18n.dictRemove??"×",y.onclick=()=>{const v={...this._value??{}};delete v[l],this.emitChange(v),this.render()},f.onchange=()=>{const v=f.value;if(!v||v===l)return;const I={...this._value??{}};I[v]=I[l],delete I[l],this.emitChange(I),this.render()},w.addEventListener("change",v=>{v.stopPropagation();const I={...this._value??{}};I[l]=v.detail.value,this.emitChange(I)}),c.append(f,w,y),r.appendChild(c)});const o=document.createElement("button");o.type="button",o.className="btn primary",o.textContent=this._i18n.dictAdd??"+",o.onclick=()=>{const l=`k${Object.keys(this._value??{}).length+1}`,u=Pn(s),c={...this._value??{},[l]:u};this.emitChange(c),this.render()};const a=document.createElement("div");a.className="actions",a.appendChild(o),n.appendChild(r),n.appendChild(a),this.$root.appendChild(n)}}Ee("schema-form-dict",ju);class Lu extends HTMLElement{constructor(){super(),this._i18n={...Eu},this.$root=this.attachShadow({mode:"open"});const e=document.createElement("style");e.textContent=lt,this.$root.appendChild(e);const n=document.createElement("div");n.className="wrapper",n.innerHTML='<form class="form" part="form"></form>',this.$root.appendChild(n),this.addEventListener("change",r=>{if(!r?.detail)return;const{path:i,value:s}=r.detail;Array.isArray(i)&&i.length===0?this._state=s:by(this._state??(this._state={}),i,s),this.dispatchEvent(new CustomEvent("form-change",{detail:{path:i,value:s,state:this._state}}))})}set schema(e){this._schema=Ou(e);try{this._state=this._schema(null,{autofix:!0})}catch{this._state=Pn(this._schema)}this.render()}get schema(){return this._schema}set schemaJSON(e){this.schema=e}get schemaJSON(){return this._schema?.toJSON?.()}setData(e,n={validate:!0,autofix:!0}){if(!this._schema)throw new Error("请先设置 schema");const r=n.validate?this._schema(e??null,{autofix:n.autofix}):e;this._state=r,this.render()}getData(e={validate:!0,autofix:!0}){if(!this._schema)throw new Error("请先设置 schema");const n=this._state;return e.validate?this._schema(n??null,{autofix:e.autofix}):n}reset(){try{this._state=this._schema(null,{autofix:!0})}catch{this._state=Pn(this._schema)}this.render()}refresh(){this.render()}set i18n(e){this._i18n={...this._i18n,...e},this.render()}get i18n(){return this._i18n}render(){if(!this._schema)return;const e=this.$root.querySelector("form");e.innerHTML="";const n=$n(this._schema,[],this._state,this._i18n.rootLabel,this._i18n);e.appendChild(n)}}Ee("schema-form",Lu);function xy(){Ee("schema-form",Lu),Ee("schema-form-string",ku),Ee("schema-form-number",Pu),Ee("schema-form-boolean",$u),Ee("schema-form-date",Au),Ee("schema-form-const",Iu),Ee("schema-form-union",Tu),Ee("schema-form-tuple",Ru),Ee("schema-form-object",Du),Ee("schema-form-array",Nu),Ee("schema-form-dict",ju)}const Sy=bc({__name:"SchemasteryFormVue",props:kc({schema:{},value:{},validateOnChange:{type:Boolean,default:!1}},{schema:{required:!0},schemaModifiers:{},value:{required:!1,default:{}},valueModifiers:{}}),emits:kc(["change"],["update:schema","update:value"]),setup(t,{expose:e,emit:n}){const r=Yc(t,"schema"),i=Yc(t,"value"),s=n,o=Um("elRef");let a=!1,l=!1;const u=c=>{if(l)return;console.info("Form changed:",c.detail);const f=o.value,w=t.validateOnChange?f.getData({validate:!0}):c.detail.state;a=!0,i.value=w,yi(()=>{a=!1}),s("change",c.detail)};return Sc(()=>{xy()}),so(()=>{const c=o.value;r.value&&(c.schema=r.value),i.value!==void 0&&c.setData(i.value,{validate:!1,autofix:!0}),c.addEventListener("form-change",u)}),Ec(()=>{o.value?.removeEventListener("form-change",u)}),cr(()=>r,c=>{a||o.value&&c&&o.value.schema!==c.value&&(l=!0,o.value.schema=c.value,yi(()=>{l=!1}))},{deep:!1}),cr(()=>i,c=>{if(a||!o.value||c.value===void 0)return;const f=o.value.getData({validate:!1});JSON.stringify(f)!==JSON.stringify(c.value)&&(l=!0,o.value.setData(c.value,{validate:!1}),yi(()=>{l=!1}))},{deep:!0}),e({setData(c,f){const w=o.value;w.setData(c,{validate:!!f?.validate}),f?.emit&&(i.value=w.getData({validate:!!f?.validate}))},getData(c){return o.value.getData(c)},setSchema(c,f=!0){o.value.schema=c,f&&(r.value=c)},refresh(){o.value.refresh()},reset(){o.value.reset()},el:o}),(c,f)=>(On(),dr("schema-form",iu({ref_key:"elRef",ref:o},c.$attrs),null,16))}});function an(t,e=new WeakMap){if(Re(t))return an(t.value,e);if(t===null||typeof t!="object")return t;if(e.has(t))return e.get(t);if(t instanceof Date)return new Date(t);if(t instanceof RegExp)return new RegExp(t);if(t instanceof Map){const i=new Map;return e.set(t,i),Array.from(t.entries()).forEach(([s,o])=>{i.set(s,an(o,e))}),i}if(t instanceof Set){const i=new Set;return e.set(t,i),Array.from(t).forEach(s=>{i.add(an(s,e))}),i}if(Array.isArray(t)){const i=[];e.set(t,i);for(const s of t)i.push(an(s,e));return i}const n=fe(t),r={};e.set(t,r);for(const i of Object.keys(n))r[i]=an(n[i],e);for(const i of Object.getOwnPropertySymbols(n))r[i]=an(n[i],e);return r}const Ey={class:"preferences-ui-app"},Cy={class:"tabs"},Oy=["onClick","data-value"],ky={style:{"max-height":"20em",overflow:"auto"}},Py={style:{"max-height":"20em",overflow:"auto"}},$y=((t,e)=>{const n=t.__vccOpts||t;for(const[r,i]of e)n[r]=i;return n})(bc({__name:"PreferencesForm",setup(t,{expose:e}){const n=yy(),r=di([]),i=di(""),s=uu(()=>a.value.find(l=>l.category===i.value)?.schema),o=di({}),a=di([]);return e({getValue(){return an(o)}}),bg(()=>{i.value&&(a.value=n.preferences.getConfigRegistries(i.value))}),so(async()=>{n.inject(["preferences"],async l=>{o.value=await l.preferences.getAll(),r.value=l.preferences.getConfigCategories(),i.value=r.value[0].name})}),(l,u)=>(On(),dr("div",Ey,[on("div",Cy,[(On(!0),dr(ht,null,Oc(r.value,c=>(On(),dr("a",{class:ri(["tab",{active:i.value===c.name}]),key:c.name,onClick:f=>i.value=c.name,"data-value":c.name},ii(c.label),11,Oy))),128))]),(On(!0),dr(ht,null,Oc(a.value,c=>Lm((On(),$g(cc(Sy),{key:c.name,schema:c.schema,value:o.value,"onUpdate:value":u[0]||(u[0]=f=>o.value=f),"validate-on-change":!1,i18n:{rootLabel:""}},null,8,["schema","value"])),[[Jg,i.value===c.category]])),128)),on("details",null,[u[1]||(u[1]=on("summary",null,"Debug Info",-1)),on("pre",ky,ii(s.value),1),on("pre",Py,ii(o.value),1)])]))}}),[["__scopeId","data-v-46564df3"]]);var Ay=Object.create,So=Object.defineProperty,Iy=Object.getOwnPropertyDescriptor,Mu=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),Fu=t=>{throw TypeError(t)},Ty=(t,e,n)=>e in t?So(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Ry=(t,e)=>So(t,"name",{value:e,configurable:!0}),Dy=t=>[,,,Ay(t?.[Mu("metadata")]??null)],Ny=["class","method","getter","setter","accessor","field","value","get","set"],Bu=t=>t!==void 0&&typeof t!="function"?Fu("Function expected"):t,jy=(t,e,n,r,i)=>({kind:Ny[t],name:e,metadata:r,addInitializer:s=>n._?Fu("Already initialized"):i.push(Bu(s||null))}),Ly=(t,e)=>Ty(e,Mu("metadata"),t[3]),My=(t,e,n,r)=>{for(var i=0,s=t[e>>1],o=s&&s.length;i<o;i++)s[i].call(n);return r},Fy=(t,e,n,r,i,s)=>{var o,a,l,u=e&7,c=!1,f=0,w=t[f]||(t[f]=[]),y=u&&(i=i.prototype,u<5&&(u>3||!c)&&Iy(i,n));Ry(i,n);for(var v=r.length-1;v>=0;v--)l=jy(u,n,a={},t[3],w),o=(0,r[v])(i,l),a._=1,Bu(o)&&(i=o);return Ly(t,i),y&&So(i,n,y),c?u^4?s:y:i},Uu,Eo,Hu;Uu=[Ve(["preferences","modal"])];class Ti extends(Hu=gt){constructor(e){super(e,{},"preferences-ui"),this.ctx=e,e.set("preferencesUI",this),e.inject(["toolbox"],n=>{n.toolbox.addButton({id:"preferences",icon:C("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",class:"icon icon-tabler icons-tabler-filled icon-tabler-settings",children:[C("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),C("path",{d:"M14.647 4.081a.724 .724 0 0 0 1.08 .448c2.439 -1.485 5.23 1.305 3.745 3.744a.724 .724 0 0 0 .447 1.08c2.775 .673 2.775 4.62 0 5.294a.724 .724 0 0 0 -.448 1.08c1.485 2.439 -1.305 5.23 -3.744 3.745a.724 .724 0 0 0 -1.08 .447c-.673 2.775 -4.62 2.775 -5.294 0a.724 .724 0 0 0 -1.08 -.448c-2.439 1.485 -5.23 -1.305 -3.745 -3.744a.724 .724 0 0 0 -.447 -1.08c-2.775 -.673 -2.775 -4.62 0 -5.294a.724 .724 0 0 0 .448 -1.08c-1.485 -2.439 1.305 -5.23 3.744 -3.745a.722 .722 0 0 0 1.08 -.447c.673 -2.775 4.62 -2.775 5.294 0zm-2.647 4.919a3 3 0 1 0 0 6a3 3 0 0 0 0 -6z"})]}),tooltip:"Open preferences",group:"group2",index:1/0,onClick:()=>this.showModal()}),this.addDisposeHandler(()=>{n.toolbox.removeButton("preferences")})})}showModal(){const e=this.ctx.modal.show({className:"in-page-edit",sizeClass:"small",outSideClose:!1,center:!0,title:"InPageEdit Prefrences",content:C(Ir,{children:C(Zt,{})})});e.get$wrapper().addClass("dialog");const n=C("div",{id:"ipe-preferences-app",style:{minHeight:"65vh"}});e.setContent(n);const r=this.createFormApp(),i=r.mount(n);e.setButtons([{label:"Save",className:"btn",method:()=>{const s=i.getValue();Object.entries(s).forEach(([o,a])=>{this.ctx.preferences.set(o,a).catch(console.error)}),e.close()}},{label:"Cancel",className:"btn btn-danger",method:()=>{e.close()}}]),e.get$modal().on("onClose.ssi-modal",()=>{r.unmount()})}createFormApp(){const e=hy($y);return gy(this.ctx,e),e}}Eo=Dy(Hu),Ti=Fy(Eo,0,"PluginPreferencesUI",Uu,Ti),My(Eo,1,Ti);const By=Object.freeze(Object.defineProperty({__proto__:null,get PluginPreferencesUI(){return Ti}},Symbol.toStringTag,{value:"Module"}));ce.BasePlugin=gt,ce.InPageEdit=en,ce.Inject=Ve,ce.Logger=Xi,ce.LoggerLevel=Ji,ce.Schema=xe,ce.Service=dn,Object.defineProperty(ce,Symbol.toStringTag,{value:"Module"})});
124
+ */const _u={arrayAdd:"+",arrayMoveUp:"↑",arrayMoveDown:"↓",arrayRemove:"×",dictAdd:"+",dictRemove:"×",rootLabel:"root"},Ee=(t,e)=>{customElements.get(t)||customElements.define(t,e)},fy=(t,e,n)=>{if(!e.length)return;let r=t,i=null,s=null;for(let a=0;a<e.length-1;a++){const l=e[a];let u=r?.[l];u==null?(u=typeof e[a+1]=="number"?[]:{},r[l]=u):typeof u!="object"&&(u=typeof e[a+1]=="number"?[]:{},r[l]=u),i=r,s=l,r=u}const o=e[e.length-1];if(r==null||typeof r!="object"){const a=typeof o=="number"?[]:{};if(i)i[s]=a,r=a;else return}try{r[o]=n}catch{try{const a=Array.isArray(r)?r.slice():{...r};a[o]=n,i&&(i[s]=a)}catch{}}},yr=t=>t.map(String).join("."),dy=t=>t.replace(/[^a-zA-Z0-9_-]/g,"_"),Vt=t=>`schema_${dy(yr(t)||"root")}`,Kt=t=>yr(t);function Ti(t,e){if(e==null)return e;switch(t){case"number":case"natural":case"percent":{if(e==="")return;const n=Number(e);return Number.isNaN(n)?void 0:n}case"boolean":return!!e;case"date":{if(!e)return;const n=new Date(e);return Number.isNaN(+n)?void 0:n}case"const":case"string":default:return e}}function wu(t){return typeof t=="function"&&!!t?.type}function xu(t){if(!t)throw new Error("schema is required");if(wu(t))return t;try{const e=Schema.from(t);if(wu(e))return e}catch{}if(t?.type){const e=t.type;if(Schema[e])return Schema[e](t.inner??t.list??t.dict)}throw new Error("无法从传入对象生成 Schemastery 实例,请传入 schema 或 schema.toJSON() 的结果。")}function Et(t){return t?.meta??{}}function hy(t){return t.length>0&&t.every(e=>e?.type==="const")}function kn(t){if(!t)return;const e=t,n=e.meta||{};if(Object.prototype.hasOwnProperty.call(n,"default"))return n.default;const r=e.type;try{const i=t();if(i!==void 0)return i}catch{}switch(r){case"string":return"";case"number":case"natural":case"percent":return 0;case"boolean":return!1;case"array":return[];case"tuple":return[];case"object":return{};case"dict":return{};case"union":{const i=e.list||[];return i.length?kn(i[0]):void 0}case"const":return e.value;case"date":return;default:return}}class Ot extends HTMLElement{constructor(){super(),this._path=[],this._i18n=_u,this.$root=this.attachShadow({mode:"open"});const e=document.createElement("style");e.textContent=lt,this.$root.appendChild(e)}makeFieldContainer(e,n){const r=document.createElement("div");if(r.className=`field schema-form-item schema-type-${e}`,r.setAttribute("data-path",yr(this._path)),this._label){const i=document.createElement("label");i.className="label",i.textContent=this._label,r.appendChild(i)}if(n){const i=document.createElement("div");i.className="helper",i.textContent=n,r.appendChild(i)}return r}set schema(e){this._schema=xu(e),this.render()}get schema(){return this._schema}set path(e){this._path=e??[],this.render()}get path(){return this._path}set label(e){this._label=e,this.render()}get label(){return this._label}set i18n(e){e&&(this._i18n={...this._i18n,...e}),this.render()}get i18n(){return this._i18n}setValue(e){this._value=e,this.render()}getValue(){return this._value}emitChange(e){this._value=e,this.dispatchEvent(new CustomEvent("change",{bubbles:!0,composed:!0,detail:{path:this._path,value:e}}))}}class Su extends Ot{render(){if(this.$input&&this.$root.contains(this.$input)){const s=this._value??"";this.$input.value!==s&&document.activeElement!==this.$input&&(this.$input.value=s);return}this.$root.innerHTML=`<style>${lt}</style>`;const e=Et(this._schema),n=this.makeFieldContainer("string",e.description),r=document.createElement("input");this.$input=r,r.className="input",r.type="text",r.name=Kt(this._path),r.id=Vt(this._path),e?.pattern?.source&&(r.pattern=e.pattern.source),e?.max!=null&&(r.maxLength=e.max),r.value=this._value??"",r.oninput=()=>this.emitChange(Ti("string",r.value));const i=n.querySelector("label.label");i&&(i.htmlFor=r.id),n.appendChild(r),this.$root.appendChild(n)}}Ee("schema-form-string",Su);class Eu extends Ot{render(){if(this.$input&&this.$root.contains(this.$input)){const o=this._value??"";this.$input.value!==String(o)&&document.activeElement!==this.$input&&(this.$input.value=o);return}this.$root.innerHTML=`<style>${lt}</style>`;const e=this._schema?.type??"number",n=Et(this._schema),r=this.makeFieldContainer("number",n.description),i=document.createElement("input");this.$input=i,i.className="input",i.type="number",i.name=Kt(this._path),i.id=Vt(this._path),n?.min!=null&&(i.min=String(n.min)),n?.max!=null&&(i.max=String(n.max)),n?.step!=null&&(i.step=String(n.step)),e==="percent"&&!i.step&&(i.step="0.01"),i.value=this._value??"",i.oninput=()=>this.emitChange(Ti(e,i.value));const s=r.querySelector("label.label");s&&(s.htmlFor=i.id),r.appendChild(i),this.$root.appendChild(r)}}Ee("schema-form-number",Eu);class Ou extends Ot{render(){this.$root.innerHTML=`<style>${lt}</style>`;const e=Et(this._schema),n=this.makeFieldContainer("boolean",e.description),r=document.createElement("label");r.className="checkbox";const i=document.createElement("input");i.type="checkbox",i.checked=!!this._value,i.name=Kt(this._path),i.id=Vt(this._path);const s=document.createElement("span");s.textContent=this._label??"",i.onchange=()=>this.emitChange(i.checked);const o=n.querySelector("label.label");o&&(o.htmlFor=i.id),r.append(i,s),n.appendChild(r),this.$root.appendChild(n)}}Ee("schema-form-boolean",Ou);class Pu extends Ot{render(){if(this.$input&&this.$root.contains(this.$input)){const s=this._value??null;document.activeElement!==this.$input&&(this.$input.valueAsDate=s);return}this.$root.innerHTML=`<style>${lt}</style>`;const e=Et(this._schema),n=this.makeFieldContainer("date",e.description),r=document.createElement("input");this.$input=r,r.className="input",r.type="date",r.name=Kt(this._path),r.id=Vt(this._path),r.valueAsDate=this._value??null,r.oninput=()=>this.emitChange(Ti("date",r.value));const i=n.querySelector("label.label");i&&(i.htmlFor=r.id),n.appendChild(r),this.$root.appendChild(n)}}Ee("schema-form-date",Pu);class Cu extends Ot{render(){this.$root.innerHTML=`<style>${lt}</style>`;const e=Et(this._schema),n=this.makeFieldContainer("const",e.description),r=document.createElement("input");r.className="input",r.readOnly=!0,r.value=String(this._schema.value),r.name=Kt(this._path),r.id=Vt(this._path);const i=n.querySelector("label.label");i&&(i.htmlFor=r.id),n.appendChild(r),this.$root.appendChild(n)}}Ee("schema-form-const",Cu);function py(t){switch(t.type){case"string":return"schema-form-string";case"number":case"natural":case"percent":return"schema-form-number";case"boolean":return"schema-form-boolean";case"date":return"schema-form-date";case"const":return"schema-form-const";case"array":return"schema-form-array";case"object":return"schema-form-object";case"tuple":return"schema-form-tuple";case"dict":return"schema-form-dict";case"union":return"schema-form-union";default:return"schema-form-string"}}function $n(t,e,n,r,i){const s=py(t),o=document.createElement(s);return o.schema=t,o.path=e,o.label=r,i&&(o.i18n=i),o.setValue?.(n),o}class ku extends Ot{render(){this.$root.innerHTML=`<style>${lt}</style>`;const e=Et(this._schema),n=this.makeFieldContainer("union",e.description),r=this._schema.list||[];if(hy(r)){const i=document.createElement("select");i.className="input",i.name=Kt(this._path),i.id=Vt(this._path),r.forEach(o=>{const a=document.createElement("option");a.value=String(o.value),a.textContent=String(o.value),this._value===o.value&&(a.selected=!0),i.appendChild(a)}),i.onchange=()=>this.emitChange(Ti("string",i.value));const s=n.querySelector("label.label");s&&(s.htmlFor=i.id),n.appendChild(i)}else{const i=document.createElement("div");i.className="toolbar";const s=document.createElement("select");s.className="input",s.name=Kt(this._path)+".__type",s.id=Vt(this._path)+"__type";let o=0;r.forEach((c,f)=>{const w=document.createElement("option");w.value=String(f),w.textContent=c.type,s.appendChild(w)}),s.onchange=()=>{o=Number(s.value);const c=r[o],f=kn(c);this.emitChange(f),u()};const a=n.querySelector("label.label");a&&(a.htmlFor=s.id),i.appendChild(s),n.appendChild(i);const l=document.createElement("div");l.className="group";const u=()=>{l.innerHTML="";const c=r[o],f=$n(c,this._path,this._value,this._label);f.addEventListener("change",w=>{w.stopPropagation(),this.emitChange(w.detail.value)}),l.appendChild(f)};u(),n.appendChild(l)}this.$root.appendChild(n)}}Ee("schema-form-union",ku);class $u extends Ot{render(){this.$root.innerHTML=`<style>${lt}</style>`;const e=Et(this._schema),n=this.makeFieldContainer("tuple",e.description),r=document.createElement("div");r.className="group";const i=Array.isArray(this._value)?this._value:[];(this._schema.list||[]).forEach((s,o)=>{const a=$n(s,[...this._path,o],i[o],`${this._label??""}[${o}]`);a.addEventListener("change",l=>{l.stopPropagation();const u=Array.isArray(this._value)?this._value.slice():[];u[o]=l.detail.value,this.emitChange(u)}),r.appendChild(a)}),n.appendChild(r),this.$root.appendChild(n)}}Ee("schema-form-tuple",$u);class Au extends Ot{render(){this.$root.innerHTML=`<style>${lt}</style>`;const e=Et(this._schema),n=this.makeFieldContainer("object",e.description),r=document.createElement("div");r.className="group";const i=this._schema.dict||{};Object.keys(i).forEach(s=>{if(i[s]?.meta?.hidden)return;const o=(this._value??{})[s],a=$n(i[s],[...this._path,s],o,s);a.addEventListener("change",l=>{l.stopPropagation();const u={...this._value??{}};u[s]=l.detail.value,this.emitChange(u)}),r.appendChild(a)}),n.appendChild(r),this.$root.appendChild(n)}}Ee("schema-form-object",Au);class Iu extends Ot{render(){this.$root.innerHTML=`<style>${lt}</style>`;const e=Et(this._schema),n=this.makeFieldContainer("array",e.description),r=document.createElement("div");r.className="group";const i=this._schema.inner,s=()=>Array.isArray(this._value)?this._value:[],o=()=>{r.innerHTML="",s().forEach((u,c)=>{const f=[...this._path,c],w=document.createElement("div");w.className="row",w.setAttribute("data-path",yr(f));const y=$n(i,f,u,`${this._label??""}[${c}]`);y.addEventListener("change",A=>{A.stopPropagation();const g=s().slice();g[c]=A.detail.value,this.emitChange(g)});const v=document.createElement("div");v.className="actions";const I=document.createElement("button");I.type="button",I.className="btn",I.textContent=this._i18n.arrayMoveUp??"↑",I.onclick=()=>{if(c>0){const A=s().slice();[A[c-1],A[c]]=[A[c],A[c-1]],this.emitChange(A),o()}};const z=document.createElement("button");z.type="button",z.className="btn",z.textContent=this._i18n.arrayMoveDown??"↓",z.onclick=()=>{const A=s();if(c<A.length-1){const g=A.slice();[g[c+1],g[c]]=[g[c],g[c+1]],this.emitChange(g),o()}};const F=document.createElement("button");F.type="button",F.className="btn danger",F.textContent=this._i18n.arrayRemove??"×",F.onclick=()=>{const A=s().filter((g,m)=>m!==c);this.emitChange(A),o()},v.append(I,z,F),w.appendChild(y),w.appendChild(v),r.appendChild(w)})};o();const a=document.createElement("button");a.type="button",a.className="btn primary",a.textContent=this._i18n.arrayAdd??"+",a.onclick=()=>{const u=s().slice();u.push(kn(i)),this.emitChange(u),o()};const l=document.createElement("div");l.className="actions",l.appendChild(a),n.appendChild(r),n.appendChild(l),this.$root.appendChild(n)}}Ee("schema-form-array",Iu);class Ru extends Ot{render(){this.$root.innerHTML=`<style>${lt}</style>`;const e=Et(this._schema),n=this.makeFieldContainer("dict",e.description),r=document.createElement("div");r.className="group";const i=this._value??{},s=this._schema.inner;Object.keys(i).forEach(l=>{const u=[...this._path,l],c=document.createElement("div");c.className="kv",c.setAttribute("data-path",yr(u));const f=document.createElement("input");f.className="input",f.value=l,f.name=Kt(u)+".__key",f.id=Vt(u)+"__key";const w=$n(s,u,i[l],`${this._label??""}[${l}]`),y=document.createElement("button");y.type="button",y.className="btn danger",y.textContent=this._i18n.dictRemove??"×",y.onclick=()=>{const v={...this._value??{}};delete v[l],this.emitChange(v),this.render()},f.onchange=()=>{const v=f.value;if(!v||v===l)return;const I={...this._value??{}};I[v]=I[l],delete I[l],this.emitChange(I),this.render()},w.addEventListener("change",v=>{v.stopPropagation();const I={...this._value??{}};I[l]=v.detail.value,this.emitChange(I)}),c.append(f,w,y),r.appendChild(c)});const o=document.createElement("button");o.type="button",o.className="btn primary",o.textContent=this._i18n.dictAdd??"+",o.onclick=()=>{const l=`k${Object.keys(this._value??{}).length+1}`,u=kn(s),c={...this._value??{},[l]:u};this.emitChange(c),this.render()};const a=document.createElement("div");a.className="actions",a.appendChild(o),n.appendChild(r),n.appendChild(a),this.$root.appendChild(n)}}Ee("schema-form-dict",Ru);class Tu extends HTMLElement{constructor(){super(),this._i18n={..._u},this.$root=this.attachShadow({mode:"open"});const e=document.createElement("style");e.textContent=lt,this.$root.appendChild(e);const n=document.createElement("div");n.className="wrapper",n.innerHTML='<form class="form" part="form"></form>',this.$root.appendChild(n),this.addEventListener("change",r=>{if(!r?.detail)return;const{path:i,value:s}=r.detail;Array.isArray(i)&&i.length===0?this._state=s:fy(this._state??(this._state={}),i,s),this.dispatchEvent(new CustomEvent("form-change",{detail:{path:i,value:s,state:this._state}}))})}set schema(e){this._schema=xu(e);try{this._state=this._schema(null,{autofix:!0})}catch{this._state=kn(this._schema)}this.render()}get schema(){return this._schema}set schemaJSON(e){this.schema=e}get schemaJSON(){return this._schema?.toJSON?.()}setData(e,n={validate:!0,autofix:!0}){if(!this._schema)throw new Error("请先设置 schema");const r=n.validate?this._schema(e??null,{autofix:n.autofix}):e;this._state=r,this.render()}getData(e={validate:!0,autofix:!0}){if(!this._schema)throw new Error("请先设置 schema");const n=this._state;return e.validate?this._schema(n??null,{autofix:e.autofix}):n}reset(){try{this._state=this._schema(null,{autofix:!0})}catch{this._state=kn(this._schema)}this.render()}refresh(){this.render()}set i18n(e){this._i18n={...this._i18n,...e},this.render()}get i18n(){return this._i18n}render(){if(!this._schema)return;const e=this.$root.querySelector("form");e.innerHTML="";const n=$n(this._schema,[],this._state,this._i18n.rootLabel,this._i18n);e.appendChild(n)}}Ee("schema-form",Tu);function my(){Ee("schema-form",Tu),Ee("schema-form-string",Su),Ee("schema-form-number",Eu),Ee("schema-form-boolean",Ou),Ee("schema-form-date",Pu),Ee("schema-form-const",Cu),Ee("schema-form-union",ku),Ee("schema-form-tuple",$u),Ee("schema-form-object",Au),Ee("schema-form-array",Iu),Ee("schema-form-dict",Ru)}const gy=pc({__name:"SchemasteryFormVue",props:Sc({schema:{},value:{},validateOnChange:{type:Boolean,default:!1}},{schema:{required:!0},schemaModifiers:{},value:{required:!1,default:{}},valueModifiers:{}}),emits:Sc(["change"],["update:schema","update:value"]),setup(t,{expose:e,emit:n}){const r=qc(t,"schema"),i=qc(t,"value"),s=n,o=Dm("elRef");let a=!1,l=!1;const u=c=>{if(l)return;console.info("Form changed:",c.detail);const f=o.value,w=t.validateOnChange?f.getData({validate:!0}):c.detail.state;a=!0,i.value=w,bi(()=>{a=!1}),s("change",c.detail)};return bc(()=>{my()}),so(()=>{const c=o.value;r.value&&(c.schema=r.value),i.value!==void 0&&c.setData(i.value,{validate:!1,autofix:!0}),c.addEventListener("form-change",u)}),_c(()=>{o.value?.removeEventListener("form-change",u)}),cr(()=>r,c=>{a||o.value&&c&&o.value.schema!==c.value&&(l=!0,o.value.schema=c.value,bi(()=>{l=!1}))},{deep:!1}),cr(()=>i,c=>{if(a||!o.value||c.value===void 0)return;const f=o.value.getData({validate:!1});JSON.stringify(f)!==JSON.stringify(c.value)&&(l=!0,o.value.setData(c.value,{validate:!1}),bi(()=>{l=!1}))},{deep:!0}),e({setData(c,f){const w=o.value;w.setData(c,{validate:!!f?.validate}),f?.emit&&(i.value=w.getData({validate:!!f?.validate}))},getData(c){return o.value.getData(c)},setSchema(c,f=!0){o.value.schema=c,f&&(r.value=c)},refresh(){o.value.refresh()},reset(){o.value.reset()},el:o}),(c,f)=>(Pn(),dr("schema-form",eu({ref_key:"elRef",ref:o},c.$attrs),null,16))}});function an(t,e=new WeakMap){if(Te(t))return an(t.value,e);if(t===null||typeof t!="object")return t;if(e.has(t))return e.get(t);if(t instanceof Date)return new Date(t);if(t instanceof RegExp)return new RegExp(t);if(t instanceof Map){const i=new Map;return e.set(t,i),Array.from(t.entries()).forEach(([s,o])=>{i.set(s,an(o,e))}),i}if(t instanceof Set){const i=new Set;return e.set(t,i),Array.from(t).forEach(s=>{i.add(an(s,e))}),i}if(Array.isArray(t)){const i=[];e.set(t,i);for(const s of t)i.push(an(s,e));return i}const n=fe(t),r={};e.set(t,r);for(const i of Object.keys(n))r[i]=an(n[i],e);for(const i of Object.getOwnPropertySymbols(n))r[i]=an(n[i],e);return r}const yy={class:"preferences-ui-app"},vy={class:"tabs"},by=["onClick","data-value"],_y={style:{"max-height":"20em",overflow:"auto"}},wy={style:{"max-height":"20em",overflow:"auto"}},xy=((t,e)=>{const n=t.__vccOpts||t;for(const[r,i]of e)n[r]=i;return n})(pc({__name:"PreferencesForm",setup(t,{expose:e}){const n=uy(),r=pi([]),i=pi(""),s=ou(()=>a.value.find(l=>l.category===i.value)?.schema),o=pi({}),a=pi([]);return e({getValue(){return an(o)}}),fg(()=>{i.value&&(a.value=n.preferences.getConfigRegistries(i.value))}),so(async()=>{n.inject(["preferences"],async l=>{o.value=await l.preferences.getAll(),r.value=l.preferences.getConfigCategories(),i.value=r.value[0].name})}),(l,u)=>(Pn(),dr("div",yy,[on("div",vy,[(Pn(!0),dr(ht,null,xc(r.value,c=>(Pn(),dr("a",{class:si(["tab",{active:i.value===c.name}]),key:c.name,onClick:f=>i.value=c.name,"data-value":c.name},oi(c.label),11,by))),128))]),(Pn(!0),dr(ht,null,xc(a.value,c=>Am((Pn(),xg(sc(gy),{key:c.name,schema:c.schema,value:o.value,"onUpdate:value":u[0]||(u[0]=f=>o.value=f),"validate-on-change":!1,i18n:{rootLabel:""}},null,8,["schema","value"])),[[Wg,i.value===c.category]])),128)),on("details",null,[u[1]||(u[1]=on("summary",null,"Debug Info",-1)),on("pre",_y,oi(s.value),1),on("pre",wy,oi(o.value),1)])]))}}),[["__scopeId","data-v-46564df3"]]);var Sy=Object.create,So=Object.defineProperty,Ey=Object.getOwnPropertyDescriptor,Du=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),Nu=t=>{throw TypeError(t)},Oy=(t,e,n)=>e in t?So(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Py=(t,e)=>So(t,"name",{value:e,configurable:!0}),Cy=t=>[,,,Sy(t?.[Du("metadata")]??null)],ky=["class","method","getter","setter","accessor","field","value","get","set"],Lu=t=>t!==void 0&&typeof t!="function"?Nu("Function expected"):t,$y=(t,e,n,r,i)=>({kind:ky[t],name:e,metadata:r,addInitializer:s=>n._?Nu("Already initialized"):i.push(Lu(s||null))}),Ay=(t,e)=>Oy(e,Du("metadata"),t[3]),Iy=(t,e,n,r)=>{for(var i=0,s=t[e>>1],o=s&&s.length;i<o;i++)s[i].call(n);return r},Ry=(t,e,n,r,i,s)=>{var o,a,l,u=e&7,c=!1,f=0,w=t[f]||(t[f]=[]),y=u&&(i=i.prototype,u<5&&(u>3||!c)&&Ey(i,n));Py(i,n);for(var v=r.length-1;v>=0;v--)l=$y(u,n,a={},t[3],w),o=(0,r[v])(i,l),a._=1,Lu(o)&&(i=o);return Ay(t,i),y&&So(i,n,y),c?u^4?s:y:i},ju,Eo,Mu;ju=[Ve(["preferences","modal"])];class Di extends(Mu=gt){constructor(e){super(e,{},"preferences-ui"),this.ctx=e,e.set("preferencesUI",this),e.inject(["toolbox"],n=>{n.toolbox.addButton({id:"preferences",icon:O("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",class:"icon icon-tabler icons-tabler-filled icon-tabler-settings",children:[O("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),O("path",{d:"M14.647 4.081a.724 .724 0 0 0 1.08 .448c2.439 -1.485 5.23 1.305 3.745 3.744a.724 .724 0 0 0 .447 1.08c2.775 .673 2.775 4.62 0 5.294a.724 .724 0 0 0 -.448 1.08c1.485 2.439 -1.305 5.23 -3.744 3.745a.724 .724 0 0 0 -1.08 .447c-.673 2.775 -4.62 2.775 -5.294 0a.724 .724 0 0 0 -1.08 -.448c-2.439 1.485 -5.23 -1.305 -3.745 -3.744a.724 .724 0 0 0 -.447 -1.08c-2.775 -.673 -2.775 -4.62 0 -5.294a.724 .724 0 0 0 .448 -1.08c-1.485 -2.439 1.305 -5.23 3.744 -3.745a.722 .722 0 0 0 1.08 -.447c.673 -2.775 4.62 -2.775 5.294 0zm-2.647 4.919a3 3 0 1 0 0 6a3 3 0 0 0 0 -6z"})]}),tooltip:"Open preferences",group:"group2",index:1/0,onClick:()=>this.showModal()}),this.addDisposeHandler(()=>{n.toolbox.removeButton("preferences")})})}showModal(){const e=this.ctx.modal.show({className:"in-page-edit",sizeClass:"small",outSideClose:!1,center:!0,title:"InPageEdit Prefrences",content:O(Tr,{children:O(Zt,{})})});e.get$wrapper().addClass("dialog");const n=O("div",{id:"ipe-preferences-app",style:{minHeight:"65vh"}});e.setContent(n);const r=this.createFormApp(),i=r.mount(n);e.setButtons([{label:"Save",className:"btn",method:()=>{const s=i.getValue();Object.entries(s).forEach(([o,a])=>{this.ctx.preferences.set(o,a).catch(console.error)}),e.close()}},{label:"Cancel",className:"btn btn-danger",method:()=>{e.close()}}]),e.get$modal().on("onClose.ssi-modal",()=>{r.unmount()})}createFormApp(){const e=oy(xy);return cy(this.ctx,e),e}}Eo=Cy(Mu),Di=Ry(Eo,0,"PluginPreferencesUI",ju,Di),Iy(Eo,1,Di);const Ty=Object.freeze(Object.defineProperty({__proto__:null,get PluginPreferencesUI(){return Di}},Symbol.toStringTag,{value:"Module"}));le.BasePlugin=gt,le.InPageEdit=en,le.Inject=Ve,le.Logger=Yo,le.LoggerLevel=Ji,le.Schema=xe,le.Service=dn,le.createLogger=Xo,Object.defineProperty(le,Symbol.toStringTag,{value:"Module"})});
98
125
  //# sourceMappingURL=index.umd.js.map