Deploy to Production / pre-check (push) Successful in 58s
Deploy to Production / build (push) Successful in 4m3s
Deploy to Production / deploy-edgeone (push) Successful in 3m48s
Deploy to Production / finalize (push) Successful in 26s
Deploy to Production / notify-failure (push) Skipped
62 lines
476 KiB
JavaScript
62 lines
476 KiB
JavaScript
var e=Object.defineProperty,t=Object.defineProperties,n=Object.getOwnPropertyDescriptors,s=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable,o=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),a=(t,n,s)=>n in t?e(t,n,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[n]=s,l=(e,t)=>{for(var n in t||(t={}))r.call(t,n)&&a(e,n,t[n]);if(s)for(var n of s(t))i.call(t,n)&&a(e,n,t[n]);return e},c=(e,s)=>t(e,n(s)),u=(e,t,n)=>(a(e,"symbol"!=typeof t?t+"":t,n),n),d=(e,t,n)=>new Promise(((s,r)=>{var i=e=>{try{a(n.next(e))}catch(t){r(t)}},o=e=>{try{a(n.throw(e))}catch(t){r(t)}},a=e=>e.done?s(e.value):Promise.resolve(e.value).then(i,o);a((n=n.apply(e,t)).next())})),p=function(e,t){this[0]=e,this[1]=t},h=e=>{var t,n=e[o("asyncIterator")],s=!1,r={};return null==n?(n=e[o("iterator")](),t=e=>r[e]=t=>n[e](t)):(n=n.call(e),t=e=>r[e]=t=>{if(s){if(s=!1,"throw"===e)throw t;return t}return s=!0,{done:!1,value:new p(new Promise((s=>{var r=n[e](t);if(!(r instanceof Object))throw TypeError("Object expected");s(r)})),1)}}),r[o("iterator")]=()=>r,t("next"),"throw"in n?t("throw"):r.throw=e=>{throw e},"return"in n&&t("return"),r};
|
||
/**
|
||
* @vue/shared v3.4.26
|
||
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
||
* @license MIT
|
||
**/
|
||
/*! #__NO_SIDE_EFFECTS__ */
|
||
function f(e,t){const n=new Set(e.split(","));return e=>n.has(e)}!function(){const e=document.createElement("link").relList;if(!(e&&e.supports&&e.supports("modulepreload"))){for(const e of document.querySelectorAll('link[rel="modulepreload"]'))t(e);new MutationObserver((e=>{for(const n of e)if("childList"===n.type)for(const e of n.addedNodes)"LINK"===e.tagName&&"modulepreload"===e.rel&&t(e)})).observe(document,{childList:!0,subtree:!0})}function t(e){if(e.ep)return;e.ep=!0;const t=function(e){const t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),"use-credentials"===e.crossOrigin?t.credentials="include":"anonymous"===e.crossOrigin?t.credentials="omit":t.credentials="same-origin",t}(e);fetch(e.href,t)}}();const m={},g=[],v=()=>{},y=()=>!1,k=e=>111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),b=e=>e.startsWith("onUpdate:"),w=Object.assign,_=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},E=Object.prototype.hasOwnProperty,x=(e,t)=>E.call(e,t),S=Array.isArray,C=e=>"[object Map]"===R(e),A=e=>"[object Set]"===R(e),$=e=>"[object Date]"===R(e),T=e=>"function"==typeof e,L=e=>"string"==typeof e,O=e=>"symbol"==typeof e,N=e=>null!==e&&"object"==typeof e,I=e=>(N(e)||T(e))&&T(e.then)&&T(e.catch),P=Object.prototype.toString,R=e=>P.call(e),M=e=>R(e).slice(8,-1),D=e=>"[object Object]"===R(e),U=e=>L(e)&&"NaN"!==e&&"-"!==e[0]&&""+parseInt(e,10)===e,F=f(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),j=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},B=/-(\w)/g,q=j((e=>e.replace(B,((e,t)=>t?t.toUpperCase():"")))),W=/\B([A-Z])/g,H=j((e=>e.replace(W,"-$1").toLowerCase())),V=j((e=>e.charAt(0).toUpperCase()+e.slice(1))),K=j((e=>e?`on${V(e)}`:"")),z=(e,t)=>!Object.is(e,t),G=(e,t)=>{for(let n=0;n<e.length;n++)e[n](t)},Y=(e,t,n,s=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:s,value:n})},Q=e=>{const t=parseFloat(e);return isNaN(t)?e:t},X=e=>{const t=L(e)?Number(e):NaN;return isNaN(t)?e:t};let J;const Z=()=>J||(J="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{});function ee(e){if(S(e)){const t={};for(let n=0;n<e.length;n++){const s=e[n],r=L(s)?re(s):ee(s);if(r)for(const e in r)t[e]=r[e]}return t}if(L(e)||N(e))return e}const te=/;(?![^(]*\))/g,ne=/:([^]+)/,se=/\/\*[^]*?\*\//g;function re(e){const t={};return e.replace(se,"").split(te).forEach((e=>{if(e){const n=e.split(ne);n.length>1&&(t[n[0].trim()]=n[1].trim())}})),t}function ie(e){let t="";if(L(e))t=e;else if(S(e))for(let n=0;n<e.length;n++){const s=ie(e[n]);s&&(t+=s+" ")}else if(N(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}const oe=f("itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly");function ae(e){return!!e||""===e}function le(e,t){if(e===t)return!0;let n=$(e),s=$(t);if(n||s)return!(!n||!s)&&e.getTime()===t.getTime();if(n=O(e),s=O(t),n||s)return e===t;if(n=S(e),s=S(t),n||s)return!(!n||!s)&&function(e,t){if(e.length!==t.length)return!1;let n=!0;for(let s=0;n&&s<e.length;s++)n=le(e[s],t[s]);return n}(e,t);if(n=N(e),s=N(t),n||s){if(!n||!s)return!1;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e){const s=e.hasOwnProperty(n),r=t.hasOwnProperty(n);if(s&&!r||!s&&r||!le(e[n],t[n]))return!1}}return String(e)===String(t)}function ce(e,t){return e.findIndex((e=>le(e,t)))}const ue=e=>L(e)?e:null==e?"":S(e)||N(e)&&(e.toString===P||!T(e.toString))?JSON.stringify(e,de,2):String(e),de=(e,t)=>t&&t.__v_isRef?de(e,t.value):C(t)?{[`Map(${t.size})`]:[...t.entries()].reduce(((e,[t,n],s)=>(e[pe(t,s)+" =>"]=n,e)),{})}:A(t)?{[`Set(${t.size})`]:[...t.values()].map((e=>pe(e)))}:O(t)?pe(t):!N(t)||S(t)||D(t)?t:String(t),pe=(e,t="")=>{var n;return O(e)?`Symbol(${null!=(n=e.description)?n:t})`:e};
|
||
/**
|
||
* @vue/reactivity v3.4.26
|
||
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
||
* @license MIT
|
||
**/
|
||
let he,fe;class me{constructor(e=!1){this.detached=e,this._active=!0,this.effects=[],this.cleanups=[],this.parent=he,!e&&he&&(this.index=(he.scopes||(he.scopes=[])).push(this)-1)}get active(){return this._active}run(e){if(this._active){const t=he;try{return he=this,e()}finally{he=t}}}on(){he=this}off(){he=this.parent}stop(e){if(this._active){let t,n;for(t=0,n=this.effects.length;t<n;t++)this.effects[t].stop();for(t=0,n=this.cleanups.length;t<n;t++)this.cleanups[t]();if(this.scopes)for(t=0,n=this.scopes.length;t<n;t++)this.scopes[t].stop(!0);if(!this.detached&&this.parent&&!e){const e=this.parent.scopes.pop();e&&e!==this&&(this.parent.scopes[this.index]=e,e.index=this.index)}this.parent=void 0,this._active=!1}}}function ge(e){return new me(e)}function ve(){return he}class ye{constructor(e,t,n,s){this.fn=e,this.trigger=t,this.scheduler=n,this.active=!0,this.deps=[],this._dirtyLevel=4,this._trackId=0,this._runnings=0,this._shouldSchedule=!1,this._depsLength=0,function(e,t=he){t&&t.active&&t.effects.push(e)}(this,s)}get dirty(){if(2===this._dirtyLevel||3===this._dirtyLevel){this._dirtyLevel=1,Se();for(let e=0;e<this._depsLength;e++){const t=this.deps[e];if(t.computed&&(t.computed.value,this._dirtyLevel>=4))break}1===this._dirtyLevel&&(this._dirtyLevel=0),Ce()}return this._dirtyLevel>=4}set dirty(e){this._dirtyLevel=e?4:0}run(){if(this._dirtyLevel=0,!this.active)return this.fn();let e=_e,t=fe;try{return _e=!0,fe=this,this._runnings++,ke(this),this.fn()}finally{be(this),this._runnings--,fe=t,_e=e}}stop(){this.active&&(ke(this),be(this),this.onStop&&this.onStop(),this.active=!1)}}function ke(e){e._trackId++,e._depsLength=0}function be(e){if(e.deps.length>e._depsLength){for(let t=e._depsLength;t<e.deps.length;t++)we(e.deps[t],e);e.deps.length=e._depsLength}}function we(e,t){const n=e.get(t);void 0!==n&&t._trackId!==n&&(e.delete(t),0===e.size&&e.cleanup())}let _e=!0,Ee=0;const xe=[];function Se(){xe.push(_e),_e=!1}function Ce(){const e=xe.pop();_e=void 0===e||e}function Ae(){Ee++}function $e(){for(Ee--;!Ee&&Le.length;)Le.shift()()}function Te(e,t,n){if(t.get(e)!==e._trackId){t.set(e,e._trackId);const n=e.deps[e._depsLength];n!==t?(n&&we(n,e),e.deps[e._depsLength++]=t):e._depsLength++}}const Le=[];function Oe(e,t,n){Ae();for(const s of e.keys()){let n;s._dirtyLevel<t&&(null!=n?n:n=e.get(s)===s._trackId)&&(s._shouldSchedule||(s._shouldSchedule=0===s._dirtyLevel),s._dirtyLevel=t),s._shouldSchedule&&(null!=n?n:n=e.get(s)===s._trackId)&&(s.trigger(),s._runnings&&!s.allowRecurse||2===s._dirtyLevel||(s._shouldSchedule=!1,s.scheduler&&Le.push(s.scheduler)))}$e()}const Ne=(e,t)=>{const n=new Map;return n.cleanup=e,n.computed=t,n},Ie=new WeakMap,Pe=Symbol(""),Re=Symbol("");function Me(e,t,n){if(_e&&fe){let t=Ie.get(e);t||Ie.set(e,t=new Map);let s=t.get(n);s||t.set(n,s=Ne((()=>t.delete(n)))),Te(fe,s)}}function De(e,t,n,s,r,i){const o=Ie.get(e);if(!o)return;let a=[];if("clear"===t)a=[...o.values()];else if("length"===n&&S(e)){const e=Number(s);o.forEach(((t,n)=>{("length"===n||!O(n)&&n>=e)&&a.push(t)}))}else switch(void 0!==n&&a.push(o.get(n)),t){case"add":S(e)?U(n)&&a.push(o.get("length")):(a.push(o.get(Pe)),C(e)&&a.push(o.get(Re)));break;case"delete":S(e)||(a.push(o.get(Pe)),C(e)&&a.push(o.get(Re)));break;case"set":C(e)&&a.push(o.get(Pe))}Ae();for(const l of a)l&&Oe(l,4);$e()}const Ue=f("__proto__,__v_isRef,__isVue"),Fe=new Set(Object.getOwnPropertyNames(Symbol).filter((e=>"arguments"!==e&&"caller"!==e)).map((e=>Symbol[e])).filter(O)),je=Be();function Be(){const e={};return["includes","indexOf","lastIndexOf"].forEach((t=>{e[t]=function(...e){const n=$t(this);for(let t=0,r=this.length;t<r;t++)Me(n,0,t+"");const s=n[t](...e);return-1===s||!1===s?n[t](...e.map($t)):s}})),["push","pop","shift","unshift","splice"].forEach((t=>{e[t]=function(...e){Se(),Ae();const n=$t(this)[t].apply(this,e);return $e(),Ce(),n}})),e}function qe(e){O(e)||(e=String(e));const t=$t(this);return Me(t,0,e),t.hasOwnProperty(e)}class We{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,n){const s=this._isReadonly,r=this._isShallow;if("__v_isReactive"===t)return!s;if("__v_isReadonly"===t)return s;if("__v_isShallow"===t)return r;if("__v_raw"===t)return n===(s?r?kt:yt:r?vt:gt).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(n)?e:void 0;const i=S(e);if(!s){if(i&&x(je,t))return Reflect.get(je,t,n);if("hasOwnProperty"===t)return qe}const o=Reflect.get(e,t,n);return(O(t)?Fe.has(t):Ue(t))?o:(s||Me(e,0,t),r?o:Rt(o)?i&&U(t)?o:o.value:N(o)?s?_t(o):bt(o):o)}}class He extends We{constructor(e=!1){super(!1,e)}set(e,t,n,s){let r=e[t];if(!this._isShallow){const t=St(r);if(Ct(n)||St(n)||(r=$t(r),n=$t(n)),!S(e)&&Rt(r)&&!Rt(n))return!t&&(r.value=n,!0)}const i=S(e)&&U(t)?Number(t)<e.length:x(e,t),o=Reflect.set(e,t,n,s);return e===$t(s)&&(i?z(n,r)&&De(e,"set",t,n):De(e,"add",t,n)),o}deleteProperty(e,t){const n=x(e,t);e[t];const s=Reflect.deleteProperty(e,t);return s&&n&&De(e,"delete",t,void 0),s}has(e,t){const n=Reflect.has(e,t);return O(t)&&Fe.has(t)||Me(e,0,t),n}ownKeys(e){return Me(e,0,S(e)?"length":Pe),Reflect.ownKeys(e)}}class Ve extends We{constructor(e=!1){super(!0,e)}set(e,t){return!0}deleteProperty(e,t){return!0}}const Ke=new He,ze=new Ve,Ge=new He(!0),Ye=e=>e,Qe=e=>Reflect.getPrototypeOf(e);function Xe(e,t,n=!1,s=!1){const r=$t(e=e.__v_raw),i=$t(t);n||(z(t,i)&&Me(r,0,t),Me(r,0,i));const{has:o}=Qe(r),a=s?Ye:n?Ot:Lt;return o.call(r,t)?a(e.get(t)):o.call(r,i)?a(e.get(i)):void(e!==r&&e.get(t))}function Je(e,t=!1){const n=this.__v_raw,s=$t(n),r=$t(e);return t||(z(e,r)&&Me(s,0,e),Me(s,0,r)),e===r?n.has(e):n.has(e)||n.has(r)}function Ze(e,t=!1){return e=e.__v_raw,!t&&Me($t(e),0,Pe),Reflect.get(e,"size",e)}function et(e){e=$t(e);const t=$t(this);return Qe(t).has.call(t,e)||(t.add(e),De(t,"add",e,e)),this}function tt(e,t){t=$t(t);const n=$t(this),{has:s,get:r}=Qe(n);let i=s.call(n,e);i||(e=$t(e),i=s.call(n,e));const o=r.call(n,e);return n.set(e,t),i?z(t,o)&&De(n,"set",e,t):De(n,"add",e,t),this}function nt(e){const t=$t(this),{has:n,get:s}=Qe(t);let r=n.call(t,e);r||(e=$t(e),r=n.call(t,e)),s&&s.call(t,e);const i=t.delete(e);return r&&De(t,"delete",e,void 0),i}function st(){const e=$t(this),t=0!==e.size,n=e.clear();return t&&De(e,"clear",void 0,void 0),n}function rt(e,t){return function(n,s){const r=this,i=r.__v_raw,o=$t(i),a=t?Ye:e?Ot:Lt;return!e&&Me(o,0,Pe),i.forEach(((e,t)=>n.call(s,a(e),a(t),r)))}}function it(e,t,n){return function(...s){const r=this.__v_raw,i=$t(r),o=C(i),a="entries"===e||e===Symbol.iterator&&o,l="keys"===e&&o,c=r[e](...s),u=n?Ye:t?Ot:Lt;return!t&&Me(i,0,l?Re:Pe),{next(){const{value:e,done:t}=c.next();return t?{value:e,done:t}:{value:a?[u(e[0]),u(e[1])]:u(e),done:t}},[Symbol.iterator](){return this}}}}function ot(e){return function(...t){return"delete"!==e&&("clear"===e?void 0:this)}}function at(){const e={get(e){return Xe(this,e)},get size(){return Ze(this)},has:Je,add:et,set:tt,delete:nt,clear:st,forEach:rt(!1,!1)},t={get(e){return Xe(this,e,!1,!0)},get size(){return Ze(this)},has:Je,add:et,set:tt,delete:nt,clear:st,forEach:rt(!1,!0)},n={get(e){return Xe(this,e,!0)},get size(){return Ze(this,!0)},has(e){return Je.call(this,e,!0)},add:ot("add"),set:ot("set"),delete:ot("delete"),clear:ot("clear"),forEach:rt(!0,!1)},s={get(e){return Xe(this,e,!0,!0)},get size(){return Ze(this,!0)},has(e){return Je.call(this,e,!0)},add:ot("add"),set:ot("set"),delete:ot("delete"),clear:ot("clear"),forEach:rt(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach((r=>{e[r]=it(r,!1,!1),n[r]=it(r,!0,!1),t[r]=it(r,!1,!0),s[r]=it(r,!0,!0)})),[e,n,t,s]}const[lt,ct,ut,dt]=at();function pt(e,t){const n=t?e?dt:ut:e?ct:lt;return(t,s,r)=>"__v_isReactive"===s?!e:"__v_isReadonly"===s?e:"__v_raw"===s?t:Reflect.get(x(n,s)&&s in t?n:t,s,r)}const ht={get:pt(!1,!1)},ft={get:pt(!1,!0)},mt={get:pt(!0,!1)},gt=new WeakMap,vt=new WeakMap,yt=new WeakMap,kt=new WeakMap;function bt(e){return St(e)?e:Et(e,!1,Ke,ht,gt)}function wt(e){return Et(e,!1,Ge,ft,vt)}function _t(e){return Et(e,!0,ze,mt,yt)}function Et(e,t,n,s,r){if(!N(e))return e;if(e.__v_raw&&(!t||!e.__v_isReactive))return e;const i=r.get(e);if(i)return i;const o=(a=e).__v_skip||!Object.isExtensible(a)?0:function(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}(M(a));var a;if(0===o)return e;const l=new Proxy(e,2===o?s:n);return r.set(e,l),l}function xt(e){return St(e)?xt(e.__v_raw):!(!e||!e.__v_isReactive)}function St(e){return!(!e||!e.__v_isReadonly)}function Ct(e){return!(!e||!e.__v_isShallow)}function At(e){return!!e&&!!e.__v_raw}function $t(e){const t=e&&e.__v_raw;return t?$t(t):e}function Tt(e){return Object.isExtensible(e)&&Y(e,"__v_skip",!0),e}const Lt=e=>N(e)?bt(e):e,Ot=e=>N(e)?_t(e):e;class Nt{constructor(e,t,n,s){this.getter=e,this._setter=t,this.dep=void 0,this.__v_isRef=!0,this.__v_isReadonly=!1,this.effect=new ye((()=>e(this._value)),(()=>Pt(this,2===this.effect._dirtyLevel?2:3))),this.effect.computed=this,this.effect.active=this._cacheable=!s,this.__v_isReadonly=n}get value(){const e=$t(this);return e._cacheable&&!e.effect.dirty||!z(e._value,e._value=e.effect.run())||Pt(e,4),It(e),e.effect._dirtyLevel>=2&&Pt(e,2),e._value}set value(e){this._setter(e)}get _dirty(){return this.effect.dirty}set _dirty(e){this.effect.dirty=e}}function It(e){var t;_e&&fe&&(e=$t(e),Te(fe,null!=(t=e.dep)?t:e.dep=Ne((()=>e.dep=void 0),e instanceof Nt?e:void 0)))}function Pt(e,t=4,n){const s=(e=$t(e)).dep;s&&Oe(s,t)}function Rt(e){return!(!e||!0!==e.__v_isRef)}function Mt(e){return Ut(e,!1)}function Dt(e){return Ut(e,!0)}function Ut(e,t){return Rt(e)?e:new Ft(e,t)}class Ft{constructor(e,t){this.__v_isShallow=t,this.dep=void 0,this.__v_isRef=!0,this._rawValue=t?e:$t(e),this._value=t?e:Lt(e)}get value(){return It(this),this._value}set value(e){const t=this.__v_isShallow||Ct(e)||St(e);e=t?e:$t(e),z(e,this._rawValue)&&(this._rawValue=e,this._value=t?e:Lt(e),Pt(this,4))}}function jt(e){return Rt(e)?e.value:e}const Bt={get:(e,t,n)=>jt(Reflect.get(e,t,n)),set:(e,t,n,s)=>{const r=e[t];return Rt(r)&&!Rt(n)?(r.value=n,!0):Reflect.set(e,t,n,s)}};function qt(e){return xt(e)?e:new Proxy(e,Bt)}function Wt(e){const t=S(e)?new Array(e.length):{};for(const n in e)t[n]=zt(e,n);return t}class Ht{constructor(e,t,n){this._object=e,this._key=t,this._defaultValue=n,this.__v_isRef=!0}get value(){const e=this._object[this._key];return void 0===e?this._defaultValue:e}set value(e){this._object[this._key]=e}get dep(){return function(e,t){const n=Ie.get(e);return n&&n.get(t)}($t(this._object),this._key)}}class Vt{constructor(e){this._getter=e,this.__v_isRef=!0,this.__v_isReadonly=!0}get value(){return this._getter()}}function Kt(e,t,n){return Rt(e)?e:T(e)?new Vt(e):N(e)&&arguments.length>1?zt(e,t,n):Mt(e)}function zt(e,t,n){const s=e[t];return Rt(s)?s:new Ht(e,t,n)}
|
||
/**
|
||
* @vue/runtime-core v3.4.26
|
||
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
||
* @license MIT
|
||
**/function Gt(e,t,n,s){try{return s?e(...s):e()}catch(r){Qt(r,t,n)}}function Yt(e,t,n,s){if(T(e)){const r=Gt(e,t,n,s);return r&&I(r)&&r.catch((e=>{Qt(e,t,n)})),r}if(S(e)){const r=[];for(let i=0;i<e.length;i++)r.push(Yt(e[i],t,n,s));return r}}function Qt(e,t,n,s=!0){t&&t.vnode;if(t){let s=t.parent;const r=t.proxy,i=`https://vuejs.org/error-reference/#runtime-${n}`;for(;s;){const t=s.ec;if(t)for(let n=0;n<t.length;n++)if(!1===t[n](e,r,i))return;s=s.parent}const o=t.appContext.config.errorHandler;if(o)return Se(),Gt(o,null,10,[e,r,i]),void Ce()}!function(e,t,n,s=!0){console.error(e)}(e,0,0,s)}let Xt=!1,Jt=!1;const Zt=[];let en=0;const tn=[];let nn=null,sn=0;const rn=Promise.resolve();let on=null;function an(e){const t=on||rn;return e?t.then(this?e.bind(this):e):t}function ln(e){Zt.length&&Zt.includes(e,Xt&&e.allowRecurse?en+1:en)||(null==e.id?Zt.push(e):Zt.splice(function(e){let t=en+1,n=Zt.length;for(;t<n;){const s=t+n>>>1,r=Zt[s],i=pn(r);i<e||i===e&&r.pre?t=s+1:n=s}return t}(e.id),0,e),cn())}function cn(){Xt||Jt||(Jt=!0,on=rn.then(fn))}function un(e,t,n=(Xt?en+1:0)){for(;n<Zt.length;n++){const t=Zt[n];if(t&&t.pre){if(e&&t.id!==e.uid)continue;Zt.splice(n,1),n--,t()}}}function dn(e){if(tn.length){const e=[...new Set(tn)].sort(((e,t)=>pn(e)-pn(t)));if(tn.length=0,nn)return void nn.push(...e);for(nn=e,sn=0;sn<nn.length;sn++)nn[sn]();nn=null,sn=0}}const pn=e=>null==e.id?1/0:e.id,hn=(e,t)=>{const n=pn(e)-pn(t);if(0===n){if(e.pre&&!t.pre)return-1;if(t.pre&&!e.pre)return 1}return n};function fn(e){Jt=!1,Xt=!0,Zt.sort(hn);try{for(en=0;en<Zt.length;en++){const e=Zt[en];e&&!1!==e.active&&Gt(e,null,14)}}finally{en=0,Zt.length=0,dn(),Xt=!1,on=null,(Zt.length||tn.length)&&fn()}}function mn(e,t,...n){if(e.isUnmounted)return;const s=e.vnode.props||m;let r=n;const i=t.startsWith("update:"),o=i&&t.slice(7);if(o&&o in s){const e=`${"modelValue"===o?"model":o}Modifiers`,{number:t,trim:i}=s[e]||m;i&&(r=n.map((e=>L(e)?e.trim():e))),t&&(r=n.map(Q))}let a,l=s[a=K(t)]||s[a=K(q(t))];!l&&i&&(l=s[a=K(H(t))]),l&&Yt(l,e,6,r);const c=s[a+"Once"];if(c){if(e.emitted){if(e.emitted[a])return}else e.emitted={};e.emitted[a]=!0,Yt(c,e,6,r)}}function gn(e,t,n=!1){const s=t.emitsCache,r=s.get(e);if(void 0!==r)return r;const i=e.emits;let o={},a=!1;if(!T(e)){const s=e=>{const n=gn(e,t,!0);n&&(a=!0,w(o,n))};!n&&t.mixins.length&&t.mixins.forEach(s),e.extends&&s(e.extends),e.mixins&&e.mixins.forEach(s)}return i||a?(S(i)?i.forEach((e=>o[e]=null)):w(o,i),N(e)&&s.set(e,o),o):(N(e)&&s.set(e,null),null)}function vn(e,t){return!(!e||!k(t))&&(t=t.slice(2).replace(/Once$/,""),x(e,t[0].toLowerCase()+t.slice(1))||x(e,H(t))||x(e,t))}let yn=null,kn=null;function bn(e){const t=yn;return yn=e,kn=e&&e.type.__scopeId||null,t}function wn(e){kn=e}function _n(){kn=null}function En(e,t=yn,n){if(!t)return e;if(e._n)return e;const s=(...n)=>{s._d&&wr(-1);const r=bn(t);let i;try{i=e(...n)}finally{bn(r),s._d&&wr(1)}return i};return s._n=!0,s._c=!0,s._d=!0,s}function xn(e){const{type:t,vnode:n,proxy:s,withProxy:r,propsOptions:[i],slots:o,attrs:a,emit:l,render:c,renderCache:u,props:d,data:p,setupState:h,ctx:f,inheritAttrs:m}=e,g=bn(e);let v,y;try{if(4&n.shapeFlag){const e=r||s,t=e;v=Pr(c.call(t,e,u,d,h,p,f)),y=a}else{const e=t;0,v=Pr(e.length>1?e(d,{attrs:a,slots:o,emit:l}):e(d,null)),y=t.props?a:Sn(a)}}catch(w){vr.length=0,Qt(w,e,1),v=Lr(mr)}let k=v;if(y&&!1!==m){const e=Object.keys(y),{shapeFlag:t}=k;e.length&&7&t&&(i&&e.some(b)&&(y=Cn(y,i)),k=Or(k,y,!1,!0))}return n.dirs&&(k=Or(k,null,!1,!0),k.dirs=k.dirs?k.dirs.concat(n.dirs):n.dirs),n.transition&&(k.transition=n.transition),v=k,bn(g),v}const Sn=e=>{let t;for(const n in e)("class"===n||"style"===n||k(n))&&((t||(t={}))[n]=e[n]);return t},Cn=(e,t)=>{const n={};for(const s in e)b(s)&&s.slice(9)in t||(n[s]=e[s]);return n};function An(e,t,n){const s=Object.keys(t);if(s.length!==Object.keys(e).length)return!0;for(let r=0;r<s.length;r++){const i=s[r];if(t[i]!==e[i]&&!vn(n,i))return!0}return!1}function $n(e,t){return function(e,t,n=!0,s=!1){const r=yn||jr;if(r){const n=r.type;{const e=Zr(n,!1);if(e&&(e===t||e===q(t)||e===V(q(t))))return n}const i=Ln(r[e]||n[e],t)||Ln(r.appContext[e],t);return!i&&s?n:i}}("components",e,!0,t)||e}const Tn=Symbol.for("v-ndc");function Ln(e,t){return e&&(e[t]||e[q(t)]||e[V(q(t))])}const On=Symbol.for("v-scx"),Nn=()=>qs(On),In={};function Pn(e,t,n){return Rn(e,t,n)}function Rn(e,t,{immediate:n,deep:s,flush:r,once:i,onTrack:o,onTrigger:a}=m){if(t&&i){const e=t;t=(...t)=>{e(...t),x()}}const l=jr,c=e=>!0===s?e:Un(e,!1===s?1:void 0);let u,d,p=!1,h=!1;if(Rt(e)?(u=()=>e.value,p=Ct(e)):xt(e)?(u=()=>c(e),p=!0):S(e)?(h=!0,p=e.some((e=>xt(e)||Ct(e))),u=()=>e.map((e=>Rt(e)?e.value:xt(e)?c(e):T(e)?Gt(e,l,2):void 0))):u=T(e)?t?()=>Gt(e,l,2):()=>(d&&d(),Yt(e,l,3,[g])):v,t&&s){const e=u;u=()=>Un(e())}let f,g=e=>{d=w.onStop=()=>{Gt(e,l,4),d=w.onStop=void 0}};if(Gr){if(g=v,t?n&&Yt(t,l,3,[u(),h?[]:void 0,g]):u(),"sync"!==r)return v;{const e=Nn();f=e.__watcherHandles||(e.__watcherHandles=[])}}let y=h?new Array(e.length).fill(In):In;const k=()=>{if(w.active&&w.dirty)if(t){const e=w.run();(s||p||(h?e.some(((e,t)=>z(e,y[t]))):z(e,y)))&&(d&&d(),Yt(t,l,3,[e,y===In?void 0:h&&y[0]===In?[]:y,g]),y=e)}else w.run()};let b;k.allowRecurse=!!t,"sync"===r?b=k:"post"===r?b=()=>ar(k,l&&l.suspense):(k.pre=!0,l&&(k.id=l.uid),b=()=>ln(k));const w=new ye(u,v,b),E=ve(),x=()=>{w.stop(),E&&_(E.effects,w)};return t?n?k():y=w.run():"post"===r?ar(w.run.bind(w),l&&l.suspense):w.run(),f&&f.push(x),x}function Mn(e,t,n){const s=this.proxy,r=L(e)?e.includes(".")?Dn(s,e):()=>s[e]:e.bind(s,s);let i;T(t)?i=t:(i=t.handler,n=t);const o=Hr(this),a=Rn(r,i.bind(s),n);return o(),a}function Dn(e,t){const n=t.split(".");return()=>{let t=e;for(let e=0;e<n.length&&t;e++)t=t[n[e]];return t}}function Un(e,t=1/0,n){if(t<=0||!N(e)||e.__v_skip)return e;if((n=n||new Set).has(e))return e;if(n.add(e),t--,Rt(e))Un(e.value,t,n);else if(S(e))for(let s=0;s<e.length;s++)Un(e[s],t,n);else if(A(e)||C(e))e.forEach((e=>{Un(e,t,n)}));else if(D(e))for(const s in e)Un(e[s],t,n);return e}function Fn(e,t){if(null===yn)return e;const n=Jr(yn)||yn.proxy,s=e.dirs||(e.dirs=[]);for(let r=0;r<t.length;r++){let[e,i,o,a=m]=t[r];e&&(T(e)&&(e={mounted:e,updated:e}),e.deep&&Un(i),s.push({dir:e,instance:n,value:i,oldValue:void 0,arg:o,modifiers:a}))}return e}function jn(e,t,n,s){const r=e.dirs,i=t&&t.dirs;for(let o=0;o<r.length;o++){const a=r[o];i&&(a.oldValue=i[o].value);let l=a.dir[s];l&&(Se(),Yt(l,n,8,[e.el,a,e,t]),Ce())}}const Bn=Symbol("_leaveCb"),qn=Symbol("_enterCb");const Wn=[Function,Array],Hn={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Wn,onEnter:Wn,onAfterEnter:Wn,onEnterCancelled:Wn,onBeforeLeave:Wn,onLeave:Wn,onAfterLeave:Wn,onLeaveCancelled:Wn,onBeforeAppear:Wn,onAppear:Wn,onAfterAppear:Wn,onAppearCancelled:Wn},Vn={name:"BaseTransition",props:Hn,setup(e,{slots:t}){const n=Br(),s=function(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return ls((()=>{e.isMounted=!0})),ds((()=>{e.isUnmounting=!0})),e}();return()=>{const r=t.default&&Xn(t.default(),!0);if(!r||!r.length)return;let i=r[0];if(r.length>1)for(const e of r)if(e.type!==mr){i=e;break}const o=$t(e),{mode:a}=o;if(s.isLeaving)return Gn(i);const l=Yn(i);if(!l)return Gn(i);const c=zn(l,o,s,n);Qn(l,c);const u=n.subTree,d=u&&Yn(u);if(d&&d.type!==mr&&!Cr(l,d)){const e=zn(d,o,s,n);if(Qn(d,e),"out-in"===a&&l.type!==mr)return s.isLeaving=!0,e.afterLeave=()=>{s.isLeaving=!1,!1!==n.update.active&&(n.effect.dirty=!0,n.update())},Gn(i);"in-out"===a&&l.type!==mr&&(e.delayLeave=(e,t,n)=>{Kn(s,d)[String(d.key)]=d,e[Bn]=()=>{t(),e[Bn]=void 0,delete c.delayedLeave},c.delayedLeave=n})}return i}}};function Kn(e,t){const{leavingVNodes:n}=e;let s=n.get(t.type);return s||(s=Object.create(null),n.set(t.type,s)),s}function zn(e,t,n,s){const{appear:r,mode:i,persisted:o=!1,onBeforeEnter:a,onEnter:l,onAfterEnter:c,onEnterCancelled:u,onBeforeLeave:d,onLeave:p,onAfterLeave:h,onLeaveCancelled:f,onBeforeAppear:m,onAppear:g,onAfterAppear:v,onAppearCancelled:y}=t,k=String(e.key),b=Kn(n,e),w=(e,t)=>{e&&Yt(e,s,9,t)},_=(e,t)=>{const n=t[1];w(e,t),S(e)?e.every((e=>e.length<=1))&&n():e.length<=1&&n()},E={mode:i,persisted:o,beforeEnter(t){let s=a;if(!n.isMounted){if(!r)return;s=m||a}t[Bn]&&t[Bn](!0);const i=b[k];i&&Cr(e,i)&&i.el[Bn]&&i.el[Bn](),w(s,[t])},enter(e){let t=l,s=c,i=u;if(!n.isMounted){if(!r)return;t=g||l,s=v||c,i=y||u}let o=!1;const a=e[qn]=t=>{o||(o=!0,w(t?i:s,[e]),E.delayedLeave&&E.delayedLeave(),e[qn]=void 0)};t?_(t,[e,a]):a()},leave(t,s){const r=String(e.key);if(t[qn]&&t[qn](!0),n.isUnmounting)return s();w(d,[t]);let i=!1;const o=t[Bn]=n=>{i||(i=!0,s(),w(n?f:h,[t]),t[Bn]=void 0,b[r]===e&&delete b[r])};b[r]=e,p?_(p,[t,o]):o()},clone:e=>zn(e,t,n,s)};return E}function Gn(e){if(es(e))return(e=Or(e)).children=null,e}function Yn(e){if(!es(e))return e;const{shapeFlag:t,children:n}=e;if(n){if(16&t)return n[0];if(32&t&&T(n.default))return n.default()}}function Qn(e,t){6&e.shapeFlag&&e.component?Qn(e.component.subTree,t):128&e.shapeFlag?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function Xn(e,t=!1,n){let s=[],r=0;for(let i=0;i<e.length;i++){let o=e[i];const a=null==n?o.key:String(n)+String(null!=o.key?o.key:i);o.type===hr?(128&o.patchFlag&&r++,s=s.concat(Xn(o.children,t,a))):(t||o.type!==mr)&&s.push(null!=a?Or(o,{key:a}):o)}if(r>1)for(let i=0;i<s.length;i++)s[i].patchFlag=-2;return s}
|
||
/*! #__NO_SIDE_EFFECTS__ */function Jn(e,t){return T(e)?(()=>w({name:e.name},t,{setup:e}))():e}const Zn=e=>!!e.type.__asyncLoader,es=e=>e.type.__isKeepAlive;function ts(e,t){ss(e,"a",t)}function ns(e,t){ss(e,"da",t)}function ss(e,t,n=jr){const s=e.__wdc||(e.__wdc=()=>{let t=n;for(;t;){if(t.isDeactivated)return;t=t.parent}return e()});if(is(t,s,n),n){let e=n.parent;for(;e&&e.parent;)es(e.parent.vnode)&&rs(s,t,n,e),e=e.parent}}function rs(e,t,n,s){const r=is(t,e,s,!0);ps((()=>{_(s[t],r)}),n)}function is(e,t,n=jr,s=!1){if(n){const r=n[e]||(n[e]=[]),i=t.__weh||(t.__weh=(...s)=>{if(n.isUnmounted)return;Se();const r=Hr(n),i=Yt(t,n,e,s);return r(),Ce(),i});return s?r.unshift(i):r.push(i),i}}const os=e=>(t,n=jr)=>(!Gr||"sp"===e)&&is(e,((...e)=>t(...e)),n),as=os("bm"),ls=os("m"),cs=os("bu"),us=os("u"),ds=os("bum"),ps=os("um"),hs=os("sp"),fs=os("rtg"),ms=os("rtc");function gs(e,t=jr){is("ec",e,t)}function vs(e,t,n,s){let r;const i=n;if(S(e)||L(e)){r=new Array(e.length);for(let n=0,s=e.length;n<s;n++)r[n]=t(e[n],n,void 0,i)}else if("number"==typeof e){r=new Array(e);for(let n=0;n<e;n++)r[n]=t(n+1,n,void 0,i)}else if(N(e))if(e[Symbol.iterator])r=Array.from(e,((e,n)=>t(e,n,void 0,i)));else{const n=Object.keys(e);r=new Array(n.length);for(let s=0,o=n.length;s<o;s++){const o=n[s];r[s]=t(e[o],o,s,i)}}else r=[];return r}function ys(e,t,n={},s,r){if(yn.isCE||yn.parent&&Zn(yn.parent)&&yn.parent.isCE)return"default"!==t&&(n.name=t),Lr("slot",n,s);let i=e[t];i&&i._c&&(i._d=!1),kr();const o=i&&ks(i(n)),a=xr(hr,{key:n.key||o&&o.key||`_${t}`},o||[],o&&1===e._?64:-2);return a.scopeId&&(a.slotScopeIds=[a.scopeId+"-s"]),i&&i._c&&(i._d=!0),a}function ks(e){return e.some((e=>!Sr(e)||e.type!==mr&&!(e.type===hr&&!ks(e.children))))?e:null}const bs=e=>e?Kr(e)?Jr(e)||e.proxy:bs(e.parent):null,ws=w(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>bs(e.parent),$root:e=>bs(e.root),$emit:e=>e.emit,$options:e=>Ts(e),$forceUpdate:e=>e.f||(e.f=()=>{e.effect.dirty=!0,ln(e.update)}),$nextTick:e=>e.n||(e.n=an.bind(e.proxy)),$watch:e=>Mn.bind(e)}),_s=(e,t)=>e!==m&&!e.__isScriptSetup&&x(e,t),Es={get({_:e},t){if("__v_skip"===t)return!0;const{ctx:n,setupState:s,data:r,props:i,accessCache:o,type:a,appContext:l}=e;let c;if("$"!==t[0]){const a=o[t];if(void 0!==a)switch(a){case 1:return s[t];case 2:return r[t];case 4:return n[t];case 3:return i[t]}else{if(_s(s,t))return o[t]=1,s[t];if(r!==m&&x(r,t))return o[t]=2,r[t];if((c=e.propsOptions[0])&&x(c,t))return o[t]=3,i[t];if(n!==m&&x(n,t))return o[t]=4,n[t];Ss&&(o[t]=0)}}const u=ws[t];let d,p;return u?("$attrs"===t&&Me(e.attrs,0,""),u(e)):(d=a.__cssModules)&&(d=d[t])?d:n!==m&&x(n,t)?(o[t]=4,n[t]):(p=l.config.globalProperties,x(p,t)?p[t]:void 0)},set({_:e},t,n){const{data:s,setupState:r,ctx:i}=e;return _s(r,t)?(r[t]=n,!0):s!==m&&x(s,t)?(s[t]=n,!0):!x(e.props,t)&&(("$"!==t[0]||!(t.slice(1)in e))&&(i[t]=n,!0))},has({_:{data:e,setupState:t,accessCache:n,ctx:s,appContext:r,propsOptions:i}},o){let a;return!!n[o]||e!==m&&x(e,o)||_s(t,o)||(a=i[0])&&x(a,o)||x(s,o)||x(ws,o)||x(r.config.globalProperties,o)},defineProperty(e,t,n){return null!=n.get?e._.accessCache[t]=0:x(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function xs(e){return S(e)?e.reduce(((e,t)=>(e[t]=null,e)),{}):e}let Ss=!0;function Cs(e){const t=Ts(e),n=e.proxy,s=e.ctx;Ss=!1,t.beforeCreate&&As(t.beforeCreate,e,"bc");const{data:r,computed:i,methods:o,watch:a,provide:l,inject:c,created:u,beforeMount:d,mounted:p,beforeUpdate:h,updated:f,activated:m,deactivated:g,beforeDestroy:y,beforeUnmount:k,destroyed:b,unmounted:w,render:_,renderTracked:E,renderTriggered:x,errorCaptured:C,serverPrefetch:A,expose:$,inheritAttrs:L,components:O,directives:I,filters:P}=t;if(c&&function(e,t,n=v){S(e)&&(e=Is(e));for(const s in e){const n=e[s];let r;r=N(n)?"default"in n?qs(n.from||s,n.default,!0):qs(n.from||s):qs(n),Rt(r)?Object.defineProperty(t,s,{enumerable:!0,configurable:!0,get:()=>r.value,set:e=>r.value=e}):t[s]=r}}(c,s,null),o)for(const v in o){const e=o[v];T(e)&&(s[v]=e.bind(n))}if(r){const t=r.call(n,n);N(t)&&(e.data=bt(t))}if(Ss=!0,i)for(const S in i){const e=i[S],t=T(e)?e.bind(n,n):T(e.get)?e.get.bind(n,n):v,r=!T(e)&&T(e.set)?e.set.bind(n):v,o=ei({get:t,set:r});Object.defineProperty(s,S,{enumerable:!0,configurable:!0,get:()=>o.value,set:e=>o.value=e})}if(a)for(const v in a)$s(a[v],s,n,v);if(l){const e=T(l)?l.call(n):l;Reflect.ownKeys(e).forEach((t=>{Bs(t,e[t])}))}function R(e,t){S(t)?t.forEach((t=>e(t.bind(n)))):t&&e(t.bind(n))}if(u&&As(u,e,"c"),R(as,d),R(ls,p),R(cs,h),R(us,f),R(ts,m),R(ns,g),R(gs,C),R(ms,E),R(fs,x),R(ds,k),R(ps,w),R(hs,A),S($))if($.length){const t=e.exposed||(e.exposed={});$.forEach((e=>{Object.defineProperty(t,e,{get:()=>n[e],set:t=>n[e]=t})}))}else e.exposed||(e.exposed={});_&&e.render===v&&(e.render=_),null!=L&&(e.inheritAttrs=L),O&&(e.components=O),I&&(e.directives=I)}function As(e,t,n){Yt(S(e)?e.map((e=>e.bind(t.proxy))):e.bind(t.proxy),t,n)}function $s(e,t,n,s){const r=s.includes(".")?Dn(n,s):()=>n[s];if(L(e)){const n=t[e];T(n)&&Pn(r,n)}else if(T(e))Pn(r,e.bind(n));else if(N(e))if(S(e))e.forEach((e=>$s(e,t,n,s)));else{const s=T(e.handler)?e.handler.bind(n):t[e.handler];T(s)&&Pn(r,s,e)}}function Ts(e){const t=e.type,{mixins:n,extends:s}=t,{mixins:r,optionsCache:i,config:{optionMergeStrategies:o}}=e.appContext,a=i.get(t);let l;return a?l=a:r.length||n||s?(l={},r.length&&r.forEach((e=>Ls(l,e,o,!0))),Ls(l,t,o)):l=t,N(t)&&i.set(t,l),l}function Ls(e,t,n,s=!1){const{mixins:r,extends:i}=t;i&&Ls(e,i,n,!0),r&&r.forEach((t=>Ls(e,t,n,!0)));for(const o in t)if(s&&"expose"===o);else{const s=Os[o]||n&&n[o];e[o]=s?s(e[o],t[o]):t[o]}return e}const Os={data:Ns,props:Ms,emits:Ms,methods:Rs,computed:Rs,beforeCreate:Ps,created:Ps,beforeMount:Ps,mounted:Ps,beforeUpdate:Ps,updated:Ps,beforeDestroy:Ps,beforeUnmount:Ps,destroyed:Ps,unmounted:Ps,activated:Ps,deactivated:Ps,errorCaptured:Ps,serverPrefetch:Ps,components:Rs,directives:Rs,watch:function(e,t){if(!e)return t;if(!t)return e;const n=w(Object.create(null),e);for(const s in t)n[s]=Ps(e[s],t[s]);return n},provide:Ns,inject:function(e,t){return Rs(Is(e),Is(t))}};function Ns(e,t){return t?e?function(){return w(T(e)?e.call(this,this):e,T(t)?t.call(this,this):t)}:t:e}function Is(e){if(S(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function Ps(e,t){return e?[...new Set([].concat(e,t))]:t}function Rs(e,t){return e?w(Object.create(null),e,t):t}function Ms(e,t){return e?S(e)&&S(t)?[...new Set([...e,...t])]:w(Object.create(null),xs(e),xs(null!=t?t:{})):t}function Ds(){return{app:null,config:{isNativeTag:y,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 Us=0;function Fs(e,t){return function(n,s=null){T(n)||(n=w({},n)),null==s||N(s)||(s=null);const r=Ds(),i=new WeakSet;let o=!1;const a=r.app={_uid:Us++,_component:n,_props:s,_container:null,_context:r,_instance:null,version:ni,get config(){return r.config},set config(e){},use:(e,...t)=>(i.has(e)||(e&&T(e.install)?(i.add(e),e.install(a,...t)):T(e)&&(i.add(e),e(a,...t))),a),mixin:e=>(r.mixins.includes(e)||r.mixins.push(e),a),component:(e,t)=>t?(r.components[e]=t,a):r.components[e],directive:(e,t)=>t?(r.directives[e]=t,a):r.directives[e],mount(i,l,c){if(!o){const u=Lr(n,s);return u.appContext=r,!0===c?c="svg":!1===c&&(c=void 0),l&&t?t(u,i):e(u,i,c),o=!0,a._container=i,i.__vue_app__=a,Jr(u.component)||u.component.proxy}},unmount(){o&&(e(null,a._container),delete a._container.__vue_app__)},provide:(e,t)=>(r.provides[e]=t,a),runWithContext(e){const t=js;js=a;try{return e()}finally{js=t}}};return a}}let js=null;function Bs(e,t){if(jr){let n=jr.provides;const s=jr.parent&&jr.parent.provides;s===n&&(n=jr.provides=Object.create(s)),n[e]=t}else;}function qs(e,t,n=!1){const s=jr||yn;if(s||js){const r=s?null==s.parent?s.vnode.appContext&&s.vnode.appContext.provides:s.parent.provides:js._context.provides;if(r&&e in r)return r[e];if(arguments.length>1)return n&&T(t)?t.call(s&&s.proxy):t}}const Ws={},Hs=()=>Object.create(Ws),Vs=e=>Object.getPrototypeOf(e)===Ws;function Ks(e,t,n,s){const[r,i]=e.propsOptions;let o,a=!1;if(t)for(let l in t){if(F(l))continue;const c=t[l];let u;r&&x(r,u=q(l))?i&&i.includes(u)?(o||(o={}))[u]=c:n[u]=c:vn(e.emitsOptions,l)||l in s&&c===s[l]||(s[l]=c,a=!0)}if(i){const t=$t(n),s=o||m;for(let o=0;o<i.length;o++){const a=i[o];n[a]=zs(r,t,a,s[a],e,!x(s,a))}}return a}function zs(e,t,n,s,r,i){const o=e[n];if(null!=o){const e=x(o,"default");if(e&&void 0===s){const e=o.default;if(o.type!==Function&&!o.skipFactory&&T(e)){const{propsDefaults:i}=r;if(n in i)s=i[n];else{const o=Hr(r);s=i[n]=e.call(null,t),o()}}else s=e}o[0]&&(i&&!e?s=!1:!o[1]||""!==s&&s!==H(n)||(s=!0))}return s}function Gs(e,t,n=!1){const s=t.propsCache,r=s.get(e);if(r)return r;const i=e.props,o={},a=[];let l=!1;if(!T(e)){const s=e=>{l=!0;const[n,s]=Gs(e,t,!0);w(o,n),s&&a.push(...s)};!n&&t.mixins.length&&t.mixins.forEach(s),e.extends&&s(e.extends),e.mixins&&e.mixins.forEach(s)}if(!i&&!l)return N(e)&&s.set(e,g),g;if(S(i))for(let u=0;u<i.length;u++){const e=q(i[u]);Ys(e)&&(o[e]=m)}else if(i)for(const u in i){const e=q(u);if(Ys(e)){const t=i[u],n=o[e]=S(t)||T(t)?{type:t}:w({},t);if(n){const t=Js(Boolean,n.type),s=Js(String,n.type);n[0]=t>-1,n[1]=s<0||t<s,(t>-1||x(n,"default"))&&a.push(e)}}}const c=[o,a];return N(e)&&s.set(e,c),c}function Ys(e){return"$"!==e[0]&&!F(e)}function Qs(e){if(null===e)return"null";if("function"==typeof e)return e.name||"";if("object"==typeof e){return e.constructor&&e.constructor.name||""}return""}function Xs(e,t){return Qs(e)===Qs(t)}function Js(e,t){return S(t)?t.findIndex((t=>Xs(t,e))):T(t)&&Xs(t,e)?0:-1}const Zs=e=>"_"===e[0]||"$stable"===e,er=e=>S(e)?e.map(Pr):[Pr(e)],tr=(e,t,n)=>{if(t._n)return t;const s=En(((...e)=>er(t(...e))),n);return s._c=!1,s},nr=(e,t,n)=>{const s=e._ctx;for(const r in e){if(Zs(r))continue;const n=e[r];if(T(n))t[r]=tr(0,n,s);else if(null!=n){const e=er(n);t[r]=()=>e}}},sr=(e,t)=>{const n=er(t);e.slots.default=()=>n},rr=(e,t)=>{const n=e.slots=Hs();if(32&e.vnode.shapeFlag){const e=t._;e?(w(n,t),Y(n,"_",e,!0)):nr(t,n)}else t&&sr(e,t)},ir=(e,t,n)=>{const{vnode:s,slots:r}=e;let i=!0,o=m;if(32&s.shapeFlag){const e=t._;e?n&&1===e?i=!1:(w(r,t),n||1!==e||delete r._):(i=!t.$stable,nr(t,r)),o=t}else t&&(sr(e,t),o={default:1});if(i)for(const a in r)Zs(a)||null!=o[a]||delete r[a]};function or(e,t,n,s,r=!1){if(S(e))return void e.forEach(((e,i)=>or(e,t&&(S(t)?t[i]:t),n,s,r)));if(Zn(s)&&!r)return;const i=4&s.shapeFlag?Jr(s.component)||s.component.proxy:s.el,o=r?null:i,{i:a,r:l}=e,c=t&&t.r,u=a.refs===m?a.refs={}:a.refs,d=a.setupState;if(null!=c&&c!==l&&(L(c)?(u[c]=null,x(d,c)&&(d[c]=null)):Rt(c)&&(c.value=null)),T(l))Gt(l,a,12,[o,u]);else{const t=L(l),s=Rt(l);if(t||s){const a=()=>{if(e.f){const n=t?x(d,l)?d[l]:u[l]:l.value;r?S(n)&&_(n,i):S(n)?n.includes(i)||n.push(i):t?(u[l]=[i],x(d,l)&&(d[l]=u[l])):(l.value=[i],e.k&&(u[e.k]=l.value))}else t?(u[l]=o,x(d,l)&&(d[l]=o)):s&&(l.value=o,e.k&&(u[e.k]=o))};o?(a.id=-1,ar(a,n)):a()}}}const ar=function(e,t){var n;t&&t.pendingBranch?S(e)?t.effects.push(...e):t.effects.push(e):(S(n=e)?tn.push(...n):nn&&nn.includes(n,n.allowRecurse?sn+1:sn)||tn.push(n),cn())};function lr(e){return function(e,t){Z().__VUE__=!0;const{insert:n,remove:s,patchProp:r,createElement:i,createText:o,createComment:a,setText:l,setElementText:c,parentNode:u,nextSibling:d,setScopeId:p=v,insertStaticContent:h}=e,f=(e,t,n,s=null,r=null,i=null,o=void 0,a=null,l=!!t.dynamicChildren)=>{if(e===t)return;e&&!Cr(e,t)&&(s=X(e),V(e,r,i,!0),e=null),-2===t.patchFlag&&(l=!1,t.dynamicChildren=null);const{type:c,ref:u,shapeFlag:d}=t;switch(c){case fr:y(e,t,n,s);break;case mr:k(e,t,n,s);break;case gr:null==e&&b(t,n,s,o);break;case hr:O(e,t,n,s,r,i,o,a,l);break;default:1&d?E(e,t,n,s,r,i,o,a,l):6&d?N(e,t,n,s,r,i,o,a,l):(64&d||128&d)&&c.process(e,t,n,s,r,i,o,a,l,te)}null!=u&&r&&or(u,e&&e.ref,i,t||e,!t)},y=(e,t,s,r)=>{if(null==e)n(t.el=o(t.children),s,r);else{const n=t.el=e.el;t.children!==e.children&&l(n,t.children)}},k=(e,t,s,r)=>{null==e?n(t.el=a(t.children||""),s,r):t.el=e.el},b=(e,t,n,s)=>{[e.el,e.anchor]=h(e.children,t,n,s,e.el,e.anchor)},w=({el:e,anchor:t},s,r)=>{let i;for(;e&&e!==t;)i=d(e),n(e,s,r),e=i;n(t,s,r)},_=({el:e,anchor:t})=>{let n;for(;e&&e!==t;)n=d(e),s(e),e=n;s(t)},E=(e,t,n,s,r,i,o,a,l)=>{"svg"===t.type?o="svg":"math"===t.type&&(o="mathml"),null==e?S(t,n,s,r,i,o,a,l):$(e,t,r,i,o,a,l)},S=(e,t,s,o,a,l,u,d)=>{let p,h;const{props:f,shapeFlag:m,transition:g,dirs:v}=e;if(p=e.el=i(e.type,l,f&&f.is,f),8&m?c(p,e.children):16&m&&A(e.children,p,null,o,a,cr(e,l),u,d),v&&jn(e,null,o,"created"),C(p,e,e.scopeId,u,o),f){for(const t in f)"value"===t||F(t)||r(p,t,null,f[t],l,e.children,o,a,Q);"value"in f&&r(p,"value",null,f.value,l),(h=f.onVnodeBeforeMount)&&Dr(h,o,e)}v&&jn(e,null,o,"beforeMount");const y=function(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}(a,g);y&&g.beforeEnter(p),n(p,t,s),((h=f&&f.onVnodeMounted)||y||v)&&ar((()=>{h&&Dr(h,o,e),y&&g.enter(p),v&&jn(e,null,o,"mounted")}),a)},C=(e,t,n,s,r)=>{if(n&&p(e,n),s)for(let i=0;i<s.length;i++)p(e,s[i]);if(r){if(t===r.subTree){const t=r.vnode;C(e,t,t.scopeId,t.slotScopeIds,r.parent)}}},A=(e,t,n,s,r,i,o,a,l=0)=>{for(let c=l;c<e.length;c++){const l=e[c]=a?Rr(e[c]):Pr(e[c]);f(null,l,t,n,s,r,i,o,a)}},$=(e,t,n,s,i,o,a)=>{const l=t.el=e.el;let{patchFlag:u,dynamicChildren:d,dirs:p}=t;u|=16&e.patchFlag;const h=e.props||m,f=t.props||m;let g;if(n&&ur(n,!1),(g=f.onVnodeBeforeUpdate)&&Dr(g,n,t,e),p&&jn(t,e,n,"beforeUpdate"),n&&ur(n,!0),d?T(e.dynamicChildren,d,l,n,s,cr(t,i),o):a||U(e,t,l,null,n,s,cr(t,i),o,!1),u>0){if(16&u)L(l,t,h,f,n,s,i);else if(2&u&&h.class!==f.class&&r(l,"class",null,f.class,i),4&u&&r(l,"style",h.style,f.style,i),8&u){const o=t.dynamicProps;for(let t=0;t<o.length;t++){const a=o[t],c=h[a],u=f[a];u===c&&"value"!==a||r(l,a,c,u,i,e.children,n,s,Q)}}1&u&&e.children!==t.children&&c(l,t.children)}else a||null!=d||L(l,t,h,f,n,s,i);((g=f.onVnodeUpdated)||p)&&ar((()=>{g&&Dr(g,n,t,e),p&&jn(t,e,n,"updated")}),s)},T=(e,t,n,s,r,i,o)=>{for(let a=0;a<t.length;a++){const l=e[a],c=t[a],d=l.el&&(l.type===hr||!Cr(l,c)||70&l.shapeFlag)?u(l.el):n;f(l,c,d,null,s,r,i,o,!0)}},L=(e,t,n,s,i,o,a)=>{if(n!==s){if(n!==m)for(const l in n)F(l)||l in s||r(e,l,n[l],null,a,t.children,i,o,Q);for(const l in s){if(F(l))continue;const c=s[l],u=n[l];c!==u&&"value"!==l&&r(e,l,u,c,a,t.children,i,o,Q)}"value"in s&&r(e,"value",n.value,s.value,a)}},O=(e,t,s,r,i,a,l,c,u)=>{const d=t.el=e?e.el:o(""),p=t.anchor=e?e.anchor:o("");let{patchFlag:h,dynamicChildren:f,slotScopeIds:m}=t;m&&(c=c?c.concat(m):m),null==e?(n(d,s,r),n(p,s,r),A(t.children||[],s,p,i,a,l,c,u)):h>0&&64&h&&f&&e.dynamicChildren?(T(e.dynamicChildren,f,s,i,a,l,c),(null!=t.key||i&&t===i.subTree)&&dr(e,t,!0)):U(e,t,s,p,i,a,l,c,u)},N=(e,t,n,s,r,i,o,a,l)=>{t.slotScopeIds=a,null==e?512&t.shapeFlag?r.ctx.activate(t,n,s,o,l):P(t,n,s,r,i,o,l):R(e,t,l)},P=(e,t,n,s,r,i,o)=>{const a=e.component=function(e,t,n){const s=e.type,r=(t?t.appContext:e.appContext)||Ur,i={uid:Fr++,vnode:e,type:s,parent:t,appContext:r,root:null,next:null,subTree:null,effect:null,update:null,scope:new me(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(r.provides),accessCache:null,renderCache:[],components:null,directives:null,propsOptions:Gs(s,r),emitsOptions:gn(s,r),emit:null,emitted:null,propsDefaults:m,inheritAttrs:s.inheritAttrs,ctx:m,data:m,props:m,attrs:m,slots:m,refs:m,setupState:m,setupContext:null,attrsProxy:null,slotsProxy: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};i.ctx={_:i},i.root=t?t.root:i,i.emit=mn.bind(null,i),e.ce&&e.ce(i);return i}(e,s,r);if(es(e)&&(a.ctx.renderer=te),function(e,t=!1){t&&Wr(t);const{props:n,children:s}=e.vnode,r=Kr(e);(function(e,t,n,s=!1){const r={},i=Hs();e.propsDefaults=Object.create(null),Ks(e,t,r,i);for(const o in e.propsOptions[0])o in r||(r[o]=void 0);n?e.props=s?r:wt(r):e.type.props?e.props=r:e.props=i,e.attrs=i})(e,n,r,t),rr(e,s);const i=r?function(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,Es);const{setup:s}=n;if(s){const n=e.setupContext=s.length>1?function(e){const t=t=>{e.exposed=t||{}};return{attrs:new Proxy(e.attrs,Xr),slots:e.slots,emit:e.emit,expose:t}}(e):null,r=Hr(e);Se();const i=Gt(s,e,0,[e.props,n]);if(Ce(),r(),I(i)){if(i.then(Vr,Vr),t)return i.then((n=>{Yr(e,n,t)})).catch((t=>{Qt(t,e,0)}));e.asyncDep=i}else Yr(e,i,t)}else Qr(e,t)}(e,t):void 0;t&&Wr(!1)}(a),a.asyncDep){if(r&&r.registerDep(a,M),!e.el){const e=a.subTree=Lr(mr);k(null,e,t,n)}}else M(a,e,t,n,r,i,o)},R=(e,t,n)=>{const s=t.component=e.component;if(function(e,t,n){const{props:s,children:r,component:i}=e,{props:o,children:a,patchFlag:l}=t,c=i.emitsOptions;if(t.dirs||t.transition)return!0;if(!(n&&l>=0))return!(!r&&!a||a&&a.$stable)||s!==o&&(s?!o||An(s,o,c):!!o);if(1024&l)return!0;if(16&l)return s?An(s,o,c):!!o;if(8&l){const e=t.dynamicProps;for(let t=0;t<e.length;t++){const n=e[t];if(o[n]!==s[n]&&!vn(c,n))return!0}}return!1}(e,t,n)){if(s.asyncDep&&!s.asyncResolved)return void D(s,t,n);s.next=t,function(e){const t=Zt.indexOf(e);t>en&&Zt.splice(t,1)}(s.update),s.effect.dirty=!0,s.update()}else t.el=e.el,s.vnode=t},M=(e,t,n,s,r,i,o)=>{const a=()=>{if(e.isMounted){let{next:t,bu:n,u:s,parent:l,vnode:c}=e;{const n=pr(e);if(n)return t&&(t.el=c.el,D(e,t,o)),void n.asyncDep.then((()=>{e.isUnmounted||a()}))}let d,p=t;ur(e,!1),t?(t.el=c.el,D(e,t,o)):t=c,n&&G(n),(d=t.props&&t.props.onVnodeBeforeUpdate)&&Dr(d,l,t,c),ur(e,!0);const h=xn(e),m=e.subTree;e.subTree=h,f(m,h,u(m.el),X(m),e,r,i),t.el=h.el,null===p&&function({vnode:e,parent:t},n){for(;t;){const s=t.subTree;if(s.suspense&&s.suspense.activeBranch===e&&(s.el=e.el),s!==e)break;(e=t.vnode).el=n,t=t.parent}}(e,h.el),s&&ar(s,r),(d=t.props&&t.props.onVnodeUpdated)&&ar((()=>Dr(d,l,t,c)),r)}else{let o;const{el:a,props:l}=t,{bm:c,m:u,parent:d}=e,p=Zn(t);if(ur(e,!1),c&&G(c),!p&&(o=l&&l.onVnodeBeforeMount)&&Dr(o,d,t),ur(e,!0),a&&se){const n=()=>{e.subTree=xn(e),se(a,e.subTree,e,r,null)};p?t.type.__asyncLoader().then((()=>!e.isUnmounted&&n())):n()}else{const o=e.subTree=xn(e);f(null,o,n,s,e,r,i),t.el=o.el}if(u&&ar(u,r),!p&&(o=l&&l.onVnodeMounted)){const e=t;ar((()=>Dr(o,d,e)),r)}(256&t.shapeFlag||d&&Zn(d.vnode)&&256&d.vnode.shapeFlag)&&e.a&&ar(e.a,r),e.isMounted=!0,t=n=s=null}},l=e.effect=new ye(a,v,(()=>ln(c)),e.scope),c=e.update=()=>{l.dirty&&l.run()};c.id=e.uid,ur(e,!0),c()},D=(e,t,n)=>{t.component=e;const s=e.vnode.props;e.vnode=t,e.next=null,function(e,t,n,s){const{props:r,attrs:i,vnode:{patchFlag:o}}=e,a=$t(r),[l]=e.propsOptions;let c=!1;if(!(s||o>0)||16&o){let s;Ks(e,t,r,i)&&(c=!0);for(const i in a)t&&(x(t,i)||(s=H(i))!==i&&x(t,s))||(l?!n||void 0===n[i]&&void 0===n[s]||(r[i]=zs(l,a,i,void 0,e,!0)):delete r[i]);if(i!==a)for(const e in i)t&&x(t,e)||(delete i[e],c=!0)}else if(8&o){const n=e.vnode.dynamicProps;for(let s=0;s<n.length;s++){let o=n[s];if(vn(e.emitsOptions,o))continue;const u=t[o];if(l)if(x(i,o))u!==i[o]&&(i[o]=u,c=!0);else{const t=q(o);r[t]=zs(l,a,t,u,e,!1)}else u!==i[o]&&(i[o]=u,c=!0)}}c&&De(e.attrs,"set","")}(e,t.props,s,n),ir(e,t.children,n),Se(),un(e),Ce()},U=(e,t,n,s,r,i,o,a,l=!1)=>{const u=e&&e.children,d=e?e.shapeFlag:0,p=t.children,{patchFlag:h,shapeFlag:f}=t;if(h>0){if(128&h)return void B(u,p,n,s,r,i,o,a,l);if(256&h)return void j(u,p,n,s,r,i,o,a,l)}8&f?(16&d&&Q(u,r,i),p!==u&&c(n,p)):16&d?16&f?B(u,p,n,s,r,i,o,a,l):Q(u,r,i,!0):(8&d&&c(n,""),16&f&&A(p,n,s,r,i,o,a,l))},j=(e,t,n,s,r,i,o,a,l)=>{t=t||g;const c=(e=e||g).length,u=t.length,d=Math.min(c,u);let p;for(p=0;p<d;p++){const s=t[p]=l?Rr(t[p]):Pr(t[p]);f(e[p],s,n,null,r,i,o,a,l)}c>u?Q(e,r,i,!0,!1,d):A(t,n,s,r,i,o,a,l,d)},B=(e,t,n,s,r,i,o,a,l)=>{let c=0;const u=t.length;let d=e.length-1,p=u-1;for(;c<=d&&c<=p;){const s=e[c],u=t[c]=l?Rr(t[c]):Pr(t[c]);if(!Cr(s,u))break;f(s,u,n,null,r,i,o,a,l),c++}for(;c<=d&&c<=p;){const s=e[d],c=t[p]=l?Rr(t[p]):Pr(t[p]);if(!Cr(s,c))break;f(s,c,n,null,r,i,o,a,l),d--,p--}if(c>d){if(c<=p){const e=p+1,d=e<u?t[e].el:s;for(;c<=p;)f(null,t[c]=l?Rr(t[c]):Pr(t[c]),n,d,r,i,o,a,l),c++}}else if(c>p)for(;c<=d;)V(e[c],r,i,!0),c++;else{const h=c,m=c,v=new Map;for(c=m;c<=p;c++){const e=t[c]=l?Rr(t[c]):Pr(t[c]);null!=e.key&&v.set(e.key,c)}let y,k=0;const b=p-m+1;let w=!1,_=0;const E=new Array(b);for(c=0;c<b;c++)E[c]=0;for(c=h;c<=d;c++){const s=e[c];if(k>=b){V(s,r,i,!0);continue}let u;if(null!=s.key)u=v.get(s.key);else for(y=m;y<=p;y++)if(0===E[y-m]&&Cr(s,t[y])){u=y;break}void 0===u?V(s,r,i,!0):(E[u-m]=c+1,u>=_?_=u:w=!0,f(s,t[u],n,null,r,i,o,a,l),k++)}const x=w?function(e){const t=e.slice(),n=[0];let s,r,i,o,a;const l=e.length;for(s=0;s<l;s++){const l=e[s];if(0!==l){if(r=n[n.length-1],e[r]<l){t[s]=r,n.push(s);continue}for(i=0,o=n.length-1;i<o;)a=i+o>>1,e[n[a]]<l?i=a+1:o=a;l<e[n[i]]&&(i>0&&(t[s]=n[i-1]),n[i]=s)}}i=n.length,o=n[i-1];for(;i-- >0;)n[i]=o,o=t[o];return n}(E):g;for(y=x.length-1,c=b-1;c>=0;c--){const e=m+c,d=t[e],p=e+1<u?t[e+1].el:s;0===E[c]?f(null,d,n,p,r,i,o,a,l):w&&(y<0||c!==x[y]?W(d,n,p,2):y--)}}},W=(e,t,s,r,i=null)=>{const{el:o,type:a,transition:l,children:c,shapeFlag:u}=e;if(6&u)return void W(e.component.subTree,t,s,r);if(128&u)return void e.suspense.move(t,s,r);if(64&u)return void a.move(e,t,s,te);if(a===hr){n(o,t,s);for(let e=0;e<c.length;e++)W(c[e],t,s,r);return void n(e.anchor,t,s)}if(a===gr)return void w(e,t,s);if(2!==r&&1&u&&l)if(0===r)l.beforeEnter(o),n(o,t,s),ar((()=>l.enter(o)),i);else{const{leave:e,delayLeave:r,afterLeave:i}=l,a=()=>n(o,t,s),c=()=>{e(o,(()=>{a(),i&&i()}))};r?r(o,a,c):c()}else n(o,t,s)},V=(e,t,n,s=!1,r=!1)=>{const{type:i,props:o,ref:a,children:l,dynamicChildren:c,shapeFlag:u,patchFlag:d,dirs:p}=e;if(null!=a&&or(a,null,n,e,!0),256&u)return void t.ctx.deactivate(e);const h=1&u&&p,f=!Zn(e);let m;if(f&&(m=o&&o.onVnodeBeforeUnmount)&&Dr(m,t,e),6&u)Y(e.component,n,s);else{if(128&u)return void e.suspense.unmount(n,s);h&&jn(e,null,t,"beforeUnmount"),64&u?e.type.remove(e,t,n,r,te,s):c&&(i!==hr||d>0&&64&d)?Q(c,t,n,!1,!0):(i===hr&&384&d||!r&&16&u)&&Q(l,t,n),s&&K(e)}(f&&(m=o&&o.onVnodeUnmounted)||h)&&ar((()=>{m&&Dr(m,t,e),h&&jn(e,null,t,"unmounted")}),n)},K=e=>{const{type:t,el:n,anchor:r,transition:i}=e;if(t===hr)return void z(n,r);if(t===gr)return void _(e);const o=()=>{s(n),i&&!i.persisted&&i.afterLeave&&i.afterLeave()};if(1&e.shapeFlag&&i&&!i.persisted){const{leave:t,delayLeave:s}=i,r=()=>t(n,o);s?s(e.el,o,r):r()}else o()},z=(e,t)=>{let n;for(;e!==t;)n=d(e),s(e),e=n;s(t)},Y=(e,t,n)=>{const{bum:s,scope:r,update:i,subTree:o,um:a}=e;s&&G(s),r.stop(),i&&(i.active=!1,V(o,e,t,n)),a&&ar(a,t),ar((()=>{e.isUnmounted=!0}),t),t&&t.pendingBranch&&!t.isUnmounted&&e.asyncDep&&!e.asyncResolved&&e.suspenseId===t.pendingId&&(t.deps--,0===t.deps&&t.resolve())},Q=(e,t,n,s=!1,r=!1,i=0)=>{for(let o=i;o<e.length;o++)V(e[o],t,n,s,r)},X=e=>6&e.shapeFlag?X(e.component.subTree):128&e.shapeFlag?e.suspense.next():d(e.anchor||e.el);let J=!1;const ee=(e,t,n)=>{null==e?t._vnode&&V(t._vnode,null,null,!0):f(t._vnode||null,e,t,null,null,null,n),J||(J=!0,un(),dn(),J=!1),t._vnode=e},te={p:f,um:V,m:W,r:K,mt:P,mc:A,pc:U,pbc:T,n:X,o:e};let ne,se;return{render:ee,hydrate:ne,createApp:Fs(ee,ne)}}(e)}function cr({type:e,props:t},n){return"svg"===n&&"foreignObject"===e||"mathml"===n&&"annotation-xml"===e&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function ur({effect:e,update:t},n){e.allowRecurse=t.allowRecurse=n}function dr(e,t,n=!1){const s=e.children,r=t.children;if(S(s)&&S(r))for(let i=0;i<s.length;i++){const e=s[i];let t=r[i];1&t.shapeFlag&&!t.dynamicChildren&&((t.patchFlag<=0||32===t.patchFlag)&&(t=r[i]=Rr(r[i]),t.el=e.el),n||dr(e,t)),t.type===fr&&(t.el=e.el)}}function pr(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:pr(t)}const hr=Symbol.for("v-fgt"),fr=Symbol.for("v-txt"),mr=Symbol.for("v-cmt"),gr=Symbol.for("v-stc"),vr=[];let yr=null;function kr(e=!1){vr.push(yr=e?null:[])}let br=1;function wr(e){br+=e}function _r(e){return e.dynamicChildren=br>0?yr||g:null,vr.pop(),yr=vr[vr.length-1]||null,br>0&&yr&&yr.push(e),e}function Er(e,t,n,s,r,i){return _r(Tr(e,t,n,s,r,i,!0))}function xr(e,t,n,s,r){return _r(Lr(e,t,n,s,r,!0))}function Sr(e){return!!e&&!0===e.__v_isVNode}function Cr(e,t){return e.type===t.type&&e.key===t.key}const Ar=({key:e})=>null!=e?e:null,$r=({ref:e,ref_key:t,ref_for:n})=>("number"==typeof e&&(e=""+e),null!=e?L(e)||Rt(e)||T(e)?{i:yn,r:e,k:t,f:!!n}:e:null);function Tr(e,t=null,n=null,s=0,r=null,i=(e===hr?0:1),o=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Ar(t),ref:t&&$r(t),scopeId:kn,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetAnchor:null,staticCount:0,shapeFlag:i,patchFlag:s,dynamicProps:r,dynamicChildren:null,appContext:null,ctx:yn};return a?(Mr(l,n),128&i&&e.normalize(l)):n&&(l.shapeFlag|=L(n)?8:16),br>0&&!o&&yr&&(l.patchFlag>0||6&i)&&32!==l.patchFlag&&yr.push(l),l}const Lr=function(e,t=null,n=null,s=0,r=null,i=!1){e&&e!==Tn||(e=mr);if(Sr(e)){const s=Or(e,t,!0);return n&&Mr(s,n),br>0&&!i&&yr&&(6&s.shapeFlag?yr[yr.indexOf(e)]=s:yr.push(s)),s.patchFlag|=-2,s}o=e,T(o)&&"__vccOpts"in o&&(e=e.__vccOpts);var o;if(t){t=function(e){return e?At(e)||Vs(e)?w({},e):e:null}(t);let{class:e,style:n}=t;e&&!L(e)&&(t.class=ie(e)),N(n)&&(At(n)&&!S(n)&&(n=w({},n)),t.style=ee(n))}const a=L(e)?1:(e=>e.__isSuspense)(e)?128:(e=>e.__isTeleport)(e)?64:N(e)?4:T(e)?2:0;return Tr(e,t,n,s,r,a,i,!0)};function Or(e,t,n=!1,s=!1){const{props:r,ref:i,patchFlag:o,children:a,transition:l}=e,c=t?function(...e){const t={};for(let n=0;n<e.length;n++){const s=e[n];for(const e in s)if("class"===e)t.class!==s.class&&(t.class=ie([t.class,s.class]));else if("style"===e)t.style=ee([t.style,s.style]);else if(k(e)){const n=t[e],r=s[e];!r||n===r||S(n)&&n.includes(r)||(t[e]=n?[].concat(n,r):r)}else""!==e&&(t[e]=s[e])}return t}(r||{},t):r,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:c,key:c&&Ar(c),ref:t&&t.ref?n&&i?S(i)?i.concat($r(t)):[i,$r(t)]:$r(t):i,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:a,target:e.target,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==hr?-1===o?16:16|o:o,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:l,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Or(e.ssContent),ssFallback:e.ssFallback&&Or(e.ssFallback),el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return l&&s&&(u.transition=l.clone(u)),u}function Nr(e=" ",t=0){return Lr(fr,null,e,t)}function Ir(e="",t=!1){return t?(kr(),xr(mr,null,e)):Lr(mr,null,e)}function Pr(e){return null==e||"boolean"==typeof e?Lr(mr):S(e)?Lr(hr,null,e.slice()):"object"==typeof e?Rr(e):Lr(fr,null,String(e))}function Rr(e){return null===e.el&&-1!==e.patchFlag||e.memo?e:Or(e)}function Mr(e,t){let n=0;const{shapeFlag:s}=e;if(null==t)t=null;else if(S(t))n=16;else if("object"==typeof t){if(65&s){const n=t.default;return void(n&&(n._c&&(n._d=!1),Mr(e,n()),n._c&&(n._d=!0)))}{n=32;const s=t._;s||Vs(t)?3===s&&yn&&(1===yn.slots._?t._=1:(t._=2,e.patchFlag|=1024)):t._ctx=yn}}else T(t)?(t={default:t,_ctx:yn},n=32):(t=String(t),64&s?(n=16,t=[Nr(t)]):n=8);e.children=t,e.shapeFlag|=n}function Dr(e,t,n,s=null){Yt(e,t,7,[n,s])}const Ur=Ds();let Fr=0;let jr=null;const Br=()=>jr||yn;let qr,Wr;{const e=Z(),t=(t,n)=>{let s;return(s=e[t])||(s=e[t]=[]),s.push(n),e=>{s.length>1?s.forEach((t=>t(e))):s[0](e)}};qr=t("__VUE_INSTANCE_SETTERS__",(e=>jr=e)),Wr=t("__VUE_SSR_SETTERS__",(e=>Gr=e))}const Hr=e=>{const t=jr;return qr(e),e.scope.on(),()=>{e.scope.off(),qr(t)}},Vr=()=>{jr&&jr.scope.off(),qr(null)};function Kr(e){return 4&e.vnode.shapeFlag}let zr,Gr=!1;function Yr(e,t,n){T(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:N(t)&&(e.setupState=qt(t)),Qr(e,n)}function Qr(e,t,n){const s=e.type;if(!e.render){if(!t&&zr&&!s.render){const t=s.template||Ts(e).template;if(t){const{isCustomElement:n,compilerOptions:r}=e.appContext.config,{delimiters:i,compilerOptions:o}=s,a=w(w({isCustomElement:n,delimiters:i},r),o);s.render=zr(t,a)}}e.render=s.render||v}{const t=Hr(e);Se();try{Cs(e)}finally{Ce(),t()}}}const Xr={get:(e,t)=>(Me(e,0,""),e[t])};function Jr(e){if(e.exposed)return e.exposeProxy||(e.exposeProxy=new Proxy(qt(Tt(e.exposed)),{get:(t,n)=>n in t?t[n]:n in ws?ws[n](e):void 0,has:(e,t)=>t in e||t in ws}))}function Zr(e,t=!0){return T(e)?e.displayName||e.name:e.name||t&&e.__name}const ei=(e,t)=>{const n=function(e,t,n=!1){let s,r;const i=T(e);return i?(s=e,r=v):(s=e.get,r=e.set),new Nt(s,r,i||!r,n)}(e,0,Gr);return n};function ti(e,t,n){const s=arguments.length;return 2===s?N(t)&&!S(t)?Sr(t)?Lr(e,null,[t]):Lr(e,t):Lr(e,null,t):(s>3?n=Array.prototype.slice.call(arguments,2):3===s&&Sr(n)&&(n=[n]),Lr(e,t,n))}const ni="3.4.26",si="undefined"!=typeof document?document:null,ri=si&&si.createElement("template"),ii={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,s)=>{const r="svg"===t?si.createElementNS("http://www.w3.org/2000/svg",e):"mathml"===t?si.createElementNS("http://www.w3.org/1998/Math/MathML",e):si.createElement(e,n?{is:n}:void 0);return"select"===e&&s&&null!=s.multiple&&r.setAttribute("multiple",s.multiple),r},createText:e=>si.createTextNode(e),createComment:e=>si.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>si.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,s,r,i){const o=n?n.previousSibling:t.lastChild;if(r&&(r===i||r.nextSibling))for(;t.insertBefore(r.cloneNode(!0),n),r!==i&&(r=r.nextSibling););else{ri.innerHTML="svg"===s?`<svg>${e}</svg>`:"mathml"===s?`<math>${e}</math>`:e;const r=ri.content;if("svg"===s||"mathml"===s){const e=r.firstChild;for(;e.firstChild;)r.appendChild(e.firstChild);r.removeChild(e)}t.insertBefore(r,n)}return[o?o.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},oi="transition",ai="animation",li=Symbol("_vtc"),ci=(e,{slots:t})=>ti(Vn,function(e){const t={};for(const w in e)w in ui||(t[w]=e[w]);if(!1===e.css)return t;const{name:n="v",type:s,duration:r,enterFromClass:i=`${n}-enter-from`,enterActiveClass:o=`${n}-enter-active`,enterToClass:a=`${n}-enter-to`,appearFromClass:l=i,appearActiveClass:c=o,appearToClass:u=a,leaveFromClass:d=`${n}-leave-from`,leaveActiveClass:p=`${n}-leave-active`,leaveToClass:h=`${n}-leave-to`}=e,f=function(e){if(null==e)return null;if(N(e))return[hi(e.enter),hi(e.leave)];{const t=hi(e);return[t,t]}}(r),m=f&&f[0],g=f&&f[1],{onBeforeEnter:v,onEnter:y,onEnterCancelled:k,onLeave:b,onLeaveCancelled:_,onBeforeAppear:E=v,onAppear:x=y,onAppearCancelled:S=k}=t,C=(e,t,n)=>{mi(e,t?u:a),mi(e,t?c:o),n&&n()},A=(e,t)=>{e._isLeaving=!1,mi(e,d),mi(e,h),mi(e,p),t&&t()},$=e=>(t,n)=>{const r=e?x:y,o=()=>C(t,e,n);di(r,[t,o]),gi((()=>{mi(t,e?l:i),fi(t,e?u:a),pi(r)||yi(t,s,m,o)}))};return w(t,{onBeforeEnter(e){di(v,[e]),fi(e,i),fi(e,o)},onBeforeAppear(e){di(E,[e]),fi(e,l),fi(e,c)},onEnter:$(!1),onAppear:$(!0),onLeave(e,t){e._isLeaving=!0;const n=()=>A(e,t);fi(e,d),fi(e,p),document.body.offsetHeight,gi((()=>{e._isLeaving&&(mi(e,d),fi(e,h),pi(b)||yi(e,s,g,n))})),di(b,[e,n])},onEnterCancelled(e){C(e,!1),di(k,[e])},onAppearCancelled(e){C(e,!0),di(S,[e])},onLeaveCancelled(e){A(e),di(_,[e])}})}(e),t);
|
||
/**
|
||
* @vue/runtime-dom v3.4.26
|
||
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
||
* @license MIT
|
||
**/ci.displayName="Transition";const ui={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String};ci.props=w({},Hn,ui);const di=(e,t=[])=>{S(e)?e.forEach((e=>e(...t))):e&&e(...t)},pi=e=>!!e&&(S(e)?e.some((e=>e.length>1)):e.length>1);function hi(e){return X(e)}function fi(e,t){t.split(/\s+/).forEach((t=>t&&e.classList.add(t))),(e[li]||(e[li]=new Set)).add(t)}function mi(e,t){t.split(/\s+/).forEach((t=>t&&e.classList.remove(t)));const n=e[li];n&&(n.delete(t),n.size||(e[li]=void 0))}function gi(e){requestAnimationFrame((()=>{requestAnimationFrame(e)}))}let vi=0;function yi(e,t,n,s){const r=e._endId=++vi,i=()=>{r===e._endId&&s()};if(n)return setTimeout(i,n);const{type:o,timeout:a,propCount:l}=function(e,t){const n=window.getComputedStyle(e),s=e=>(n[e]||"").split(", "),r=s(`${oi}Delay`),i=s(`${oi}Duration`),o=ki(r,i),a=s(`${ai}Delay`),l=s(`${ai}Duration`),c=ki(a,l);let u=null,d=0,p=0;t===oi?o>0&&(u=oi,d=o,p=i.length):t===ai?c>0&&(u=ai,d=c,p=l.length):(d=Math.max(o,c),u=d>0?o>c?oi:ai:null,p=u?u===oi?i.length:l.length:0);const h=u===oi&&/\b(transform|all)(,|$)/.test(s(`${oi}Property`).toString());return{type:u,timeout:d,propCount:p,hasTransform:h}}(e,t);if(!o)return s();const c=o+"end";let u=0;const d=()=>{e.removeEventListener(c,p),i()},p=t=>{t.target===e&&++u>=l&&d()};setTimeout((()=>{u<l&&d()}),a+1),e.addEventListener(c,p)}function ki(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map(((t,n)=>bi(t)+bi(e[n]))))}function bi(e){return"auto"===e?0:1e3*Number(e.slice(0,-1).replace(",","."))}const wi=Symbol("_vod"),_i=Symbol("_vsh"),Ei={beforeMount(e,{value:t},{transition:n}){e[wi]="none"===e.style.display?"":e.style.display,n&&t?n.beforeEnter(e):xi(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:s}){!t!=!n&&(s?t?(s.beforeEnter(e),xi(e,!0),s.enter(e)):s.leave(e,(()=>{xi(e,!1)})):xi(e,t))},beforeUnmount(e,{value:t}){xi(e,t)}};function xi(e,t){e.style.display=t?e[wi]:"none",e[_i]=!t}const Si=Symbol(""),Ci=/(^|;)\s*display\s*:/;const Ai=/\s*!important$/;function $i(e,t,n){if(S(n))n.forEach((n=>$i(e,t,n)));else if(null==n&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const s=function(e,t){const n=Li[t];if(n)return n;let s=q(t);if("filter"!==s&&s in e)return Li[t]=s;s=V(s);for(let r=0;r<Ti.length;r++){const n=Ti[r]+s;if(n in e)return Li[t]=n}return t}(e,t);Ai.test(n)?e.setProperty(H(s),n.replace(Ai,""),"important"):e[s]=n}}const Ti=["Webkit","Moz","ms"],Li={};const Oi="http://www.w3.org/1999/xlink";function Ni(e,t,n,s){e.addEventListener(t,n,s)}const Ii=Symbol("_vei");function Pi(e,t,n,s,r=null){const i=e[Ii]||(e[Ii]={}),o=i[t];if(s&&o)o.value=s;else{const[n,a]=function(e){let t;if(Ri.test(e)){let n;for(t={};n=e.match(Ri);)e=e.slice(0,e.length-n[0].length),t[n[0].toLowerCase()]=!0}const n=":"===e[2]?e.slice(3):H(e.slice(2));return[n,t]}(t);if(s){const o=i[t]=function(e,t){const n=e=>{if(e._vts){if(e._vts<=n.attached)return}else e._vts=Date.now();Yt(function(e,t){if(S(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map((e=>t=>!t._stopped&&e&&e(t)))}return t}(e,n.value),t,5,[e])};return n.value=e,n.attached=Ui(),n}(s,r);Ni(e,n,o,a)}else o&&(!function(e,t,n,s){e.removeEventListener(t,n,s)}(e,n,o,a),i[t]=void 0)}}const Ri=/(?:Once|Passive|Capture)$/;let Mi=0;const Di=Promise.resolve(),Ui=()=>Mi||(Di.then((()=>Mi=0)),Mi=Date.now());const Fi=e=>111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123;const ji=e=>{const t=e.props["onUpdate:modelValue"]||!1;return S(t)?e=>G(t,e):t};function Bi(e){e.target.composing=!0}function qi(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const Wi=Symbol("_assign"),Hi={created(e,{modifiers:{lazy:t,trim:n,number:s}},r){e[Wi]=ji(r);const i=s||r.props&&"number"===r.props.type;Ni(e,t?"change":"input",(t=>{if(t.target.composing)return;let s=e.value;n&&(s=s.trim()),i&&(s=Q(s)),e[Wi](s)})),n&&Ni(e,"change",(()=>{e.value=e.value.trim()})),t||(Ni(e,"compositionstart",Bi),Ni(e,"compositionend",qi),Ni(e,"change",qi))},mounted(e,{value:t}){e.value=null==t?"":t},beforeUpdate(e,{value:t,modifiers:{lazy:n,trim:s,number:r}},i){if(e[Wi]=ji(i),e.composing)return;const o=null==t?"":t;if((!r&&"number"!==e.type||/^0\d/.test(e.value)?e.value:Q(e.value))!==o){if(document.activeElement===e&&"range"!==e.type){if(n)return;if(s&&e.value.trim()===o)return}e.value=o}}},Vi={deep:!0,created(e,t,n){e[Wi]=ji(n),Ni(e,"change",(()=>{const t=e._modelValue,n=Yi(e),s=e.checked,r=e[Wi];if(S(t)){const e=ce(t,n),i=-1!==e;if(s&&!i)r(t.concat(n));else if(!s&&i){const n=[...t];n.splice(e,1),r(n)}}else if(A(t)){const e=new Set(t);s?e.add(n):e.delete(n),r(e)}else r(Qi(e,s))}))},mounted:Ki,beforeUpdate(e,t,n){e[Wi]=ji(n),Ki(e,t,n)}};function Ki(e,{value:t,oldValue:n},s){e._modelValue=t,S(t)?e.checked=ce(t,s.props.value)>-1:A(t)?e.checked=t.has(s.props.value):t!==n&&(e.checked=le(t,Qi(e,!0)))}const zi={deep:!0,created(e,{value:t,modifiers:{number:n}},s){const r=A(t);Ni(e,"change",(()=>{const t=Array.prototype.filter.call(e.options,(e=>e.selected)).map((e=>n?Q(Yi(e)):Yi(e)));e[Wi](e.multiple?r?new Set(t):t:t[0]),e._assigning=!0,an((()=>{e._assigning=!1}))})),e[Wi]=ji(s)},mounted(e,{value:t,modifiers:{number:n}}){Gi(e,t)},beforeUpdate(e,t,n){e[Wi]=ji(n)},updated(e,{value:t,modifiers:{number:n}}){e._assigning||Gi(e,t)}};function Gi(e,t,n){const s=e.multiple,r=S(t);if(!s||r||A(t)){for(let n=0,i=e.options.length;n<i;n++){const i=e.options[n],o=Yi(i);if(s)if(r){const e=typeof o;i.selected="string"===e||"number"===e?t.some((e=>String(e)===String(o))):ce(t,o)>-1}else i.selected=t.has(o);else if(le(Yi(i),t))return void(e.selectedIndex!==n&&(e.selectedIndex=n))}s||-1===e.selectedIndex||(e.selectedIndex=-1)}}function Yi(e){return"_value"in e?e._value:e.value}function Qi(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const Xi=["ctrl","shift","alt","meta"],Ji={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&0!==e.button,middle:e=>"button"in e&&1!==e.button,right:e=>"button"in e&&2!==e.button,exact:(e,t)=>Xi.some((n=>e[`${n}Key`]&&!t.includes(n)))},Zi=(e,t)=>{const n=e._withMods||(e._withMods={}),s=t.join(".");return n[s]||(n[s]=(n,...s)=>{for(let e=0;e<t.length;e++){const s=Ji[t[e]];if(s&&s(n,t))return}return e(n,...s)})},eo=w({patchProp:(e,t,n,s,r,i,o,a,l)=>{const c="svg"===r;"class"===t?function(e,t,n){const s=e[li];s&&(t=(t?[t,...s]:[...s]).join(" ")),null==t?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}(e,s,c):"style"===t?function(e,t,n){const s=e.style,r=L(n);let i=!1;if(n&&!r){if(t)if(L(t))for(const e of t.split(";")){const t=e.slice(0,e.indexOf(":")).trim();null==n[t]&&$i(s,t,"")}else for(const e in t)null==n[e]&&$i(s,e,"");for(const e in n)"display"===e&&(i=!0),$i(s,e,n[e])}else if(r){if(t!==n){const e=s[Si];e&&(n+=";"+e),s.cssText=n,i=Ci.test(n)}}else t&&e.removeAttribute("style");wi in e&&(e[wi]=i?s.display:"",e[_i]&&(s.display="none"))}(e,n,s):k(t)?b(t)||Pi(e,t,0,s,o):("."===t[0]?(t=t.slice(1),1):"^"===t[0]?(t=t.slice(1),0):function(e,t,n,s){if(s)return"innerHTML"===t||"textContent"===t||!!(t in e&&Fi(t)&&T(n));if("spellcheck"===t||"draggable"===t||"translate"===t)return!1;if("form"===t)return!1;if("list"===t&&"INPUT"===e.tagName)return!1;if("type"===t&&"TEXTAREA"===e.tagName)return!1;if("width"===t||"height"===t){const t=e.tagName;if("IMG"===t||"VIDEO"===t||"CANVAS"===t||"SOURCE"===t)return!1}if(Fi(t)&&L(n))return!1;return t in e}(e,t,s,c))?function(e,t,n,s,r,i,o){if("innerHTML"===t||"textContent"===t)return s&&o(s,r,i),void(e[t]=null==n?"":n);const a=e.tagName;if("value"===t&&"PROGRESS"!==a&&!a.includes("-")){const s=null==n?"":n;return("OPTION"===a?e.getAttribute("value")||"":e.value)===s&&"_value"in e||(e.value=s),null==n&&e.removeAttribute(t),void(e._value=n)}let l=!1;if(""===n||null==n){const s=typeof e[t];"boolean"===s?n=ae(n):null==n&&"string"===s?(n="",l=!0):"number"===s&&(n=0,l=!0)}try{e[t]=n}catch(c){}l&&e.removeAttribute(t)}(e,t,s,i,o,a,l):("true-value"===t?e._trueValue=s:"false-value"===t&&(e._falseValue=s),function(e,t,n,s,r){if(s&&t.startsWith("xlink:"))null==n?e.removeAttributeNS(Oi,t.slice(6,t.length)):e.setAttributeNS(Oi,t,n);else{const s=oe(t);null==n||s&&!ae(n)?e.removeAttribute(t):e.setAttribute(t,s?"":n)}}(e,t,s,c))}},ii);let to;
|
||
/*!
|
||
* pinia v2.1.7
|
||
* (c) 2023 Eduardo San Martin Morote
|
||
* @license MIT
|
||
*/
|
||
let no;const so=e=>no=e,ro=Symbol();function io(e){return e&&"object"==typeof e&&"[object Object]"===Object.prototype.toString.call(e)&&"function"!=typeof e.toJSON}var oo,ao;(ao=oo||(oo={})).direct="direct",ao.patchObject="patch object",ao.patchFunction="patch function";const lo=()=>{};function co(e,t,n,s=lo){e.push(t);const r=()=>{const n=e.indexOf(t);n>-1&&(e.splice(n,1),s())};var i;return!n&&ve()&&(i=r,he&&he.cleanups.push(i)),r}function uo(e,...t){e.slice().forEach((e=>{e(...t)}))}const po=e=>e();function ho(e,t){e instanceof Map&&t instanceof Map&&t.forEach(((t,n)=>e.set(n,t))),e instanceof Set&&t instanceof Set&&t.forEach(e.add,e);for(const n in t){if(!t.hasOwnProperty(n))continue;const s=t[n],r=e[n];io(r)&&io(s)&&e.hasOwnProperty(n)&&!Rt(s)&&!xt(s)?e[n]=ho(r,s):e[n]=s}return e}const fo=Symbol();const{assign:mo}=Object;function go(e,t,n={},s,r,i){let o;const a=mo({actions:{}},n),l={deep:!0};let c,u,d,p=[],h=[];const f=s.state.value[e];let m;function g(t){let n;c=u=!1,"function"==typeof t?(t(s.state.value[e]),n={type:oo.patchFunction,storeId:e,events:d}):(ho(s.state.value[e],t),n={type:oo.patchObject,payload:t,storeId:e,events:d});const r=m=Symbol();an().then((()=>{m===r&&(c=!0)})),u=!0,uo(p,n,s.state.value[e])}i||f||(s.state.value[e]={}),Mt({});const v=i?function(){const{state:e}=n,t=e?e():{};this.$patch((e=>{mo(e,t)}))}:lo;function y(t,n){return function(){so(s);const r=Array.from(arguments),i=[],o=[];let a;uo(h,{args:r,name:t,store:k,after:function(e){i.push(e)},onError:function(e){o.push(e)}});try{a=n.apply(this&&this.$id===e?this:k,r)}catch(l){throw uo(o,l),l}return a instanceof Promise?a.then((e=>(uo(i,e),e))).catch((e=>(uo(o,e),Promise.reject(e)))):(uo(i,a),a)}}const k=bt({_p:s,$id:e,$onAction:co.bind(null,h),$patch:g,$reset:v,$subscribe(t,n={}){const r=co(p,t,n.detached,(()=>i())),i=o.run((()=>Pn((()=>s.state.value[e]),(s=>{("sync"===n.flush?u:c)&&t({storeId:e,type:oo.direct,events:d},s)}),mo({},l,n))));return r},$dispose:function(){o.stop(),p=[],h=[],s._s.delete(e)}});s._s.set(e,k);const b=(s._a&&s._a.runWithContext||po)((()=>s._e.run((()=>(o=ge()).run(t)))));for(const E in b){const t=b[E];if(Rt(t)&&(!Rt(_=t)||!_.effect)||xt(t))i||(!f||io(w=t)&&w.hasOwnProperty(fo)||(Rt(t)?t.value=f[E]:ho(t,f[E])),s.state.value[e][E]=t);else if("function"==typeof t){const e=y(E,t);b[E]=e,a.actions[E]=t}}var w,_;return mo(k,b),mo($t(k),b),Object.defineProperty(k,"$state",{get:()=>s.state.value[e],set:e=>{g((t=>{mo(t,e)}))}}),s._p.forEach((e=>{mo(k,o.run((()=>e({store:k,app:s._a,pinia:s,options:a}))))})),f&&i&&n.hydrate&&n.hydrate(k.$state,f),c=!0,u=!0,k}function vo(e,t,n){let s,r;const i="function"==typeof t;function o(e,n){(e=e||(!!(jr||yn||js)?qs(ro,null):null))&&so(e),(e=no)._s.has(s)||(i?go(s,t,r,e):function(e,t,n,s){const{state:r,actions:i,getters:o}=t,a=n.state.value[e];let l;l=go(e,(function(){a||(n.state.value[e]=r?r():{});const t=Wt(n.state.value[e]);return mo(t,i,Object.keys(o||{}).reduce(((t,s)=>(t[s]=Tt(ei((()=>{so(n);const t=n._s.get(e);return o[s].call(t,t)}))),t)),{}))}),t,n,0,!0)}(s,r,e));return e._s.get(s)}return"string"==typeof e?(s=e,r=i?n:t):(r=e,s=e.id),o.$id=s,o}function yo(e){{e=$t(e);const t={};for(const n in e){const s=e[n];(Rt(s)||xt(s))&&(t[n]=Kt(e,n))}return t}}
|
||
/*!
|
||
* shared v9.13.1
|
||
* (c) 2024 kazuya kawaguchi
|
||
* Released under the MIT License.
|
||
*/const ko="undefined"!=typeof window,bo=(e,t=!1)=>t?Symbol.for(e):Symbol(e),wo=(e,t,n)=>_o({l:e,k:t,s:n}),_o=e=>JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),Eo=e=>"number"==typeof e&&isFinite(e),xo=e=>"[object Date]"===jo(e),So=e=>"[object RegExp]"===jo(e),Co=e=>Bo(e)&&0===Object.keys(e).length,Ao=Object.assign;let $o;const To=()=>$o||($o="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{});function Lo(e){return e.replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}const Oo=Object.prototype.hasOwnProperty;function No(e,t){return Oo.call(e,t)}const Io=Array.isArray,Po=e=>"function"==typeof e,Ro=e=>"string"==typeof e,Mo=e=>"boolean"==typeof e,Do=e=>null!==e&&"object"==typeof e,Uo=e=>Do(e)&&Po(e.then)&&Po(e.catch),Fo=Object.prototype.toString,jo=e=>Fo.call(e),Bo=e=>{if(!Do(e))return!1;const t=Object.getPrototypeOf(e);return null===t||t.constructor===Object};function qo(e){let t=e;return()=>++t}function Wo(e,t){"undefined"!=typeof console&&(console.warn("[intlify] "+e),t&&console.warn(t.stack))}const Ho=e=>!Do(e)||Io(e);function Vo(e,t){if(Ho(e)||Ho(t))throw new Error("Invalid value");const n=[{src:e,des:t}];for(;n.length;){const{src:e,des:t}=n.pop();Object.keys(e).forEach((s=>{Ho(e[s])||Ho(t[s])?t[s]=e[s]:n.push({src:e[s],des:t[s]})}))}}
|
||
/*!
|
||
* message-compiler v9.13.1
|
||
* (c) 2024 kazuya kawaguchi
|
||
* Released under the MIT License.
|
||
*/function Ko(e,t,n){return{start:e,end:t}}const zo=/\{([0-9a-zA-Z]+)\}/g;function Go(e,...t){return 1===t.length&&Xo(t[0])&&(t=t[0]),t&&t.hasOwnProperty||(t={}),e.replace(zo,((e,n)=>t.hasOwnProperty(n)?t[n]:""))}const Yo=Object.assign,Qo=e=>"string"==typeof e,Xo=e=>null!==e&&"object"==typeof e;function Jo(e,t=""){return e.reduce(((e,n,s)=>0===s?e+n:e+t+n),"")}const Zo={USE_MODULO_SYNTAX:1,__EXTEND_POINT__:2},ea={[Zo.USE_MODULO_SYNTAX]:"Use modulo before '{{0}}'."};const ta={EXPECTED_TOKEN:1,INVALID_TOKEN_IN_PLACEHOLDER:2,UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER:3,UNKNOWN_ESCAPE_SEQUENCE:4,INVALID_UNICODE_ESCAPE_SEQUENCE:5,UNBALANCED_CLOSING_BRACE:6,UNTERMINATED_CLOSING_BRACE:7,EMPTY_PLACEHOLDER:8,NOT_ALLOW_NEST_PLACEHOLDER:9,INVALID_LINKED_FORMAT:10,MUST_HAVE_MESSAGES_IN_PLURAL:11,UNEXPECTED_EMPTY_LINKED_MODIFIER:12,UNEXPECTED_EMPTY_LINKED_KEY:13,UNEXPECTED_LEXICAL_ANALYSIS:14,UNHANDLED_CODEGEN_NODE_TYPE:15,UNHANDLED_MINIFIER_NODE_TYPE:16,__EXTEND_POINT__:17},na={[ta.EXPECTED_TOKEN]:"Expected token: '{0}'",[ta.INVALID_TOKEN_IN_PLACEHOLDER]:"Invalid token in placeholder: '{0}'",[ta.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER]:"Unterminated single quote in placeholder",[ta.UNKNOWN_ESCAPE_SEQUENCE]:"Unknown escape sequence: \\{0}",[ta.INVALID_UNICODE_ESCAPE_SEQUENCE]:"Invalid unicode escape sequence: {0}",[ta.UNBALANCED_CLOSING_BRACE]:"Unbalanced closing brace",[ta.UNTERMINATED_CLOSING_BRACE]:"Unterminated closing brace",[ta.EMPTY_PLACEHOLDER]:"Empty placeholder",[ta.NOT_ALLOW_NEST_PLACEHOLDER]:"Not allowed nest placeholder",[ta.INVALID_LINKED_FORMAT]:"Invalid linked format",[ta.MUST_HAVE_MESSAGES_IN_PLURAL]:"Plural must have messages",[ta.UNEXPECTED_EMPTY_LINKED_MODIFIER]:"Unexpected empty linked modifier",[ta.UNEXPECTED_EMPTY_LINKED_KEY]:"Unexpected empty linked key",[ta.UNEXPECTED_LEXICAL_ANALYSIS]:"Unexpected lexical analysis in token: '{0}'",[ta.UNHANDLED_CODEGEN_NODE_TYPE]:"unhandled codegen node type: '{0}'",[ta.UNHANDLED_MINIFIER_NODE_TYPE]:"unhandled mimifier node type: '{0}'"};function sa(e,t,n={}){const{domain:s,messages:r,args:i}=n,o=Go((r||na)[e]||"",...i||[]),a=new SyntaxError(String(o));return a.code=e,t&&(a.location=t),a.domain=s,a}function ra(e){throw e}const ia=" ",oa="\r",aa="\n",la=String.fromCharCode(8232),ca=String.fromCharCode(8233);function ua(e){const t=e;let n=0,s=1,r=1,i=0;const o=e=>t[e]===oa&&t[e+1]===aa,a=e=>t[e]===ca,l=e=>t[e]===la,c=e=>o(e)||(e=>t[e]===aa)(e)||a(e)||l(e),u=e=>o(e)||a(e)||l(e)?aa:t[e];function d(){return i=0,c(n)&&(s++,r=0),o(n)&&n++,n++,r++,t[n]}return{index:()=>n,line:()=>s,column:()=>r,peekOffset:()=>i,charAt:u,currentChar:()=>u(n),currentPeek:()=>u(n+i),next:d,peek:function(){return o(n+i)&&i++,i++,t[n+i]},reset:function(){n=0,s=1,r=1,i=0},resetPeek:function(e=0){i=e},skipToPeek:function(){const e=n+i;for(;e!==n;)d();i=0}}}const da=void 0,pa="'",ha="tokenizer";function fa(e,t={}){const n=!1!==t.location,s=ua(e),r=()=>s.index(),i=()=>{return e=s.line(),t=s.column(),n=s.index(),{line:e,column:t,offset:n};var e,t,n},o=i(),a=r(),l={currentType:14,offset:a,startLoc:o,endLoc:o,lastType:14,lastOffset:a,lastStartLoc:o,lastEndLoc:o,braceNest:0,inLinked:!1,text:""},c=()=>l,{onError:u}=t;function d(e,t,s,...r){const i=c();if(t.column+=s,t.offset+=s,u){const s=sa(e,n?Ko(i.startLoc,t):null,{domain:ha,args:r});u(s)}}function p(e,t,s){e.endLoc=i(),e.currentType=t;const r={type:t};return n&&(r.loc=Ko(e.startLoc,e.endLoc)),null!=s&&(r.value=s),r}const h=e=>p(e,14);function f(e,t){return e.currentChar()===t?(e.next(),t):(d(ta.EXPECTED_TOKEN,i(),0,t),"")}function m(e){let t="";for(;e.currentPeek()===ia||e.currentPeek()===aa;)t+=e.currentPeek(),e.peek();return t}function g(e){const t=m(e);return e.skipToPeek(),t}function v(e){if(e===da)return!1;const t=e.charCodeAt(0);return t>=97&&t<=122||t>=65&&t<=90||95===t}function y(e,t){const{currentType:n}=t;if(2!==n)return!1;m(e);const s=function(e){if(e===da)return!1;const t=e.charCodeAt(0);return t>=48&&t<=57}("-"===e.currentPeek()?e.peek():e.currentPeek());return e.resetPeek(),s}function k(e){m(e);const t="|"===e.currentPeek();return e.resetPeek(),t}function b(e,t=!0){const n=(t=!1,s="",r=!1)=>{const i=e.currentPeek();return"{"===i?"%"!==s&&t:"@"!==i&&i?"%"===i?(e.peek(),n(t,"%",!0)):"|"===i?!("%"!==s&&!r)||!(s===ia||s===aa):i===ia?(e.peek(),n(!0,ia,r)):i!==aa||(e.peek(),n(!0,aa,r)):"%"===s||t},s=n();return t&&e.resetPeek(),s}function w(e,t){const n=e.currentChar();return n===da?da:t(n)?(e.next(),n):null}function _(e){const t=e.charCodeAt(0);return t>=97&&t<=122||t>=65&&t<=90||t>=48&&t<=57||95===t||36===t}function E(e){return w(e,_)}function x(e){const t=e.charCodeAt(0);return t>=97&&t<=122||t>=65&&t<=90||t>=48&&t<=57||95===t||36===t||45===t}function S(e){return w(e,x)}function C(e){const t=e.charCodeAt(0);return t>=48&&t<=57}function A(e){return w(e,C)}function $(e){const t=e.charCodeAt(0);return t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}function T(e){return w(e,$)}function L(e){let t="",n="";for(;t=A(e);)n+=t;return n}function O(e){let t="";for(;;){const n=e.currentChar();if("{"===n||"}"===n||"@"===n||"|"===n||!n)break;if("%"===n){if(!b(e))break;t+=n,e.next()}else if(n===ia||n===aa)if(b(e))t+=n,e.next();else{if(k(e))break;t+=n,e.next()}else t+=n,e.next()}return t}function N(e){return e!==pa&&e!==aa}function I(e){const t=e.currentChar();switch(t){case"\\":case"'":return e.next(),`\\${t}`;case"u":return P(e,t,4);case"U":return P(e,t,6);default:return d(ta.UNKNOWN_ESCAPE_SEQUENCE,i(),0,t),""}}function P(e,t,n){f(e,t);let s="";for(let r=0;r<n;r++){const n=T(e);if(!n){d(ta.INVALID_UNICODE_ESCAPE_SEQUENCE,i(),0,`\\${t}${s}${e.currentChar()}`);break}s+=n}return`\\${t}${s}`}function R(e){return"{"!==e&&"}"!==e&&e!==ia&&e!==aa}function M(e){g(e);const t=f(e,"|");return g(e),t}function D(e,t){let n=null;switch(e.currentChar()){case"{":return t.braceNest>=1&&d(ta.NOT_ALLOW_NEST_PLACEHOLDER,i(),0),e.next(),n=p(t,2,"{"),g(e),t.braceNest++,n;case"}":return t.braceNest>0&&2===t.currentType&&d(ta.EMPTY_PLACEHOLDER,i(),0),e.next(),n=p(t,3,"}"),t.braceNest--,t.braceNest>0&&g(e),t.inLinked&&0===t.braceNest&&(t.inLinked=!1),n;case"@":return t.braceNest>0&&d(ta.UNTERMINATED_CLOSING_BRACE,i(),0),n=U(e,t)||h(t),t.braceNest=0,n;default:{let s=!0,r=!0,o=!0;if(k(e))return t.braceNest>0&&d(ta.UNTERMINATED_CLOSING_BRACE,i(),0),n=p(t,1,M(e)),t.braceNest=0,t.inLinked=!1,n;if(t.braceNest>0&&(5===t.currentType||6===t.currentType||7===t.currentType))return d(ta.UNTERMINATED_CLOSING_BRACE,i(),0),t.braceNest=0,F(e,t);if(s=function(e,t){const{currentType:n}=t;if(2!==n)return!1;m(e);const s=v(e.currentPeek());return e.resetPeek(),s}(e,t))return n=p(t,5,function(e){g(e);let t="",n="";for(;t=S(e);)n+=t;return e.currentChar()===da&&d(ta.UNTERMINATED_CLOSING_BRACE,i(),0),n}(e)),g(e),n;if(r=y(e,t))return n=p(t,6,function(e){g(e);let t="";return"-"===e.currentChar()?(e.next(),t+=`-${L(e)}`):t+=L(e),e.currentChar()===da&&d(ta.UNTERMINATED_CLOSING_BRACE,i(),0),t}(e)),g(e),n;if(o=function(e,t){const{currentType:n}=t;if(2!==n)return!1;m(e);const s=e.currentPeek()===pa;return e.resetPeek(),s}(e,t))return n=p(t,7,function(e){g(e),f(e,"'");let t="",n="";for(;t=w(e,N);)n+="\\"===t?I(e):t;const s=e.currentChar();return s===aa||s===da?(d(ta.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,i(),0),s===aa&&(e.next(),f(e,"'")),n):(f(e,"'"),n)}(e)),g(e),n;if(!s&&!r&&!o)return n=p(t,13,function(e){g(e);let t="",n="";for(;t=w(e,R);)n+=t;return n}(e)),d(ta.INVALID_TOKEN_IN_PLACEHOLDER,i(),0,n.value),g(e),n;break}}return n}function U(e,t){const{currentType:n}=t;let s=null;const r=e.currentChar();switch(8!==n&&9!==n&&12!==n&&10!==n||r!==aa&&r!==ia||d(ta.INVALID_LINKED_FORMAT,i(),0),r){case"@":return e.next(),s=p(t,8,"@"),t.inLinked=!0,s;case".":return g(e),e.next(),p(t,9,".");case":":return g(e),e.next(),p(t,10,":");default:return k(e)?(s=p(t,1,M(e)),t.braceNest=0,t.inLinked=!1,s):function(e,t){const{currentType:n}=t;if(8!==n)return!1;m(e);const s="."===e.currentPeek();return e.resetPeek(),s}(e,t)||function(e,t){const{currentType:n}=t;if(8!==n&&12!==n)return!1;m(e);const s=":"===e.currentPeek();return e.resetPeek(),s}(e,t)?(g(e),U(e,t)):function(e,t){const{currentType:n}=t;if(9!==n)return!1;m(e);const s=v(e.currentPeek());return e.resetPeek(),s}(e,t)?(g(e),p(t,12,function(e){let t="",n="";for(;t=E(e);)n+=t;return n}(e))):function(e,t){const{currentType:n}=t;if(10!==n)return!1;const s=()=>{const t=e.currentPeek();return"{"===t?v(e.peek()):!("@"===t||"%"===t||"|"===t||":"===t||"."===t||t===ia||!t)&&(t===aa?(e.peek(),s()):b(e,!1))},r=s();return e.resetPeek(),r}(e,t)?(g(e),"{"===r?D(e,t)||s:p(t,11,function(e){const t=n=>{const s=e.currentChar();return"{"!==s&&"%"!==s&&"@"!==s&&"|"!==s&&"("!==s&&")"!==s&&s?s===ia?n:(n+=s,e.next(),t(n)):n};return t("")}(e))):(8===n&&d(ta.INVALID_LINKED_FORMAT,i(),0),t.braceNest=0,t.inLinked=!1,F(e,t))}}function F(e,t){let n={type:14};if(t.braceNest>0)return D(e,t)||h(t);if(t.inLinked)return U(e,t)||h(t);switch(e.currentChar()){case"{":return D(e,t)||h(t);case"}":return d(ta.UNBALANCED_CLOSING_BRACE,i(),0),e.next(),p(t,3,"}");case"@":return U(e,t)||h(t);default:{if(k(e))return n=p(t,1,M(e)),t.braceNest=0,t.inLinked=!1,n;const{isModulo:s,hasSpace:r}=function(e){const t=m(e),n="%"===e.currentPeek()&&"{"===e.peek();return e.resetPeek(),{isModulo:n,hasSpace:t.length>0}}(e);if(s)return r?p(t,0,O(e)):p(t,4,function(e){g(e);const t=e.currentChar();return"%"!==t&&d(ta.EXPECTED_TOKEN,i(),0,t),e.next(),"%"}(e));if(b(e))return p(t,0,O(e));break}}return n}return{nextToken:function(){const{currentType:e,offset:t,startLoc:n,endLoc:o}=l;return l.lastType=e,l.lastOffset=t,l.lastStartLoc=n,l.lastEndLoc=o,l.offset=r(),l.startLoc=i(),s.currentChar()===da?p(l,14):F(s,l)},currentOffset:r,currentPosition:i,context:c}}const ma="parser",ga=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g;function va(e,t,n){switch(e){case"\\\\":return"\\";case"\\'":return"'";default:{const e=parseInt(t||n,16);return e<=55295||e>=57344?String.fromCodePoint(e):"�"}}}function ya(e={}){const t=!1!==e.location,{onError:n,onWarn:s}=e;function r(e,s,r,i,...o){const a=e.currentPosition();if(a.offset+=i,a.column+=i,n){const e=sa(s,t?Ko(r,a):null,{domain:ma,args:o});n(e)}}function i(e,n,r,i,...o){const a=e.currentPosition();if(a.offset+=i,a.column+=i,s){const e=t?Ko(r,a):null;s(function(e,t,...n){const s=Go(ea[e],...n||[]),r={message:String(s),code:e};return t&&(r.location=t),r}(n,e,o))}}function o(e,n,s){const r={type:e};return t&&(r.start=n,r.end=n,r.loc={start:s,end:s}),r}function a(e,n,s,r){t&&(e.end=n,e.loc&&(e.loc.end=s))}function l(e,t){const n=e.context(),s=o(3,n.offset,n.startLoc);return s.value=t,a(s,e.currentOffset(),e.currentPosition()),s}function c(e,t){const n=e.context(),{lastOffset:s,lastStartLoc:r}=n,i=o(5,s,r);return i.index=parseInt(t,10),e.nextToken(),a(i,e.currentOffset(),e.currentPosition()),i}function u(e,t,n){const s=e.context(),{lastOffset:r,lastStartLoc:i}=s,l=o(4,r,i);return l.key=t,!0===n&&(l.modulo=!0),e.nextToken(),a(l,e.currentOffset(),e.currentPosition()),l}function d(e,t){const n=e.context(),{lastOffset:s,lastStartLoc:r}=n,i=o(9,s,r);return i.value=t.replace(ga,va),e.nextToken(),a(i,e.currentOffset(),e.currentPosition()),i}function p(e){const t=e.context(),n=o(6,t.offset,t.startLoc);let s=e.nextToken();if(9===s.type){const t=function(e){const t=e.nextToken(),n=e.context(),{lastOffset:s,lastStartLoc:i}=n,l=o(8,s,i);return 12!==t.type?(r(e,ta.UNEXPECTED_EMPTY_LINKED_MODIFIER,n.lastStartLoc,0),l.value="",a(l,s,i),{nextConsumeToken:t,node:l}):(null==t.value&&r(e,ta.UNEXPECTED_LEXICAL_ANALYSIS,n.lastStartLoc,0,ka(t)),l.value=t.value||"",a(l,e.currentOffset(),e.currentPosition()),{node:l})}(e);n.modifier=t.node,s=t.nextConsumeToken||e.nextToken()}switch(10!==s.type&&r(e,ta.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,0,ka(s)),s=e.nextToken(),2===s.type&&(s=e.nextToken()),s.type){case 11:null==s.value&&r(e,ta.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,0,ka(s)),n.key=function(e,t){const n=e.context(),s=o(7,n.offset,n.startLoc);return s.value=t,a(s,e.currentOffset(),e.currentPosition()),s}(e,s.value||"");break;case 5:null==s.value&&r(e,ta.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,0,ka(s)),n.key=u(e,s.value||"");break;case 6:null==s.value&&r(e,ta.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,0,ka(s)),n.key=c(e,s.value||"");break;case 7:null==s.value&&r(e,ta.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,0,ka(s)),n.key=d(e,s.value||"");break;default:{r(e,ta.UNEXPECTED_EMPTY_LINKED_KEY,t.lastStartLoc,0);const i=e.context(),l=o(7,i.offset,i.startLoc);return l.value="",a(l,i.offset,i.startLoc),n.key=l,a(n,i.offset,i.startLoc),{nextConsumeToken:s,node:n}}}return a(n,e.currentOffset(),e.currentPosition()),{node:n}}function h(e){const t=e.context(),n=o(2,1===t.currentType?e.currentOffset():t.offset,1===t.currentType?t.endLoc:t.startLoc);n.items=[];let s=null,h=null;do{const o=s||e.nextToken();switch(s=null,o.type){case 0:null==o.value&&r(e,ta.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,0,ka(o)),n.items.push(l(e,o.value||""));break;case 6:null==o.value&&r(e,ta.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,0,ka(o)),n.items.push(c(e,o.value||""));break;case 4:h=!0;break;case 5:null==o.value&&r(e,ta.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,0,ka(o)),n.items.push(u(e,o.value||"",!!h)),h&&(i(e,Zo.USE_MODULO_SYNTAX,t.lastStartLoc,0,ka(o)),h=null);break;case 7:null==o.value&&r(e,ta.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,0,ka(o)),n.items.push(d(e,o.value||""));break;case 8:{const t=p(e);n.items.push(t.node),s=t.nextConsumeToken||null;break}}}while(14!==t.currentType&&1!==t.currentType);return a(n,1===t.currentType?t.lastOffset:e.currentOffset(),1===t.currentType?t.lastEndLoc:e.currentPosition()),n}function f(e){const t=e.context(),{offset:n,startLoc:s}=t,i=h(e);return 14===t.currentType?i:function(e,t,n,s){const i=e.context();let l=0===s.items.length;const c=o(1,t,n);c.cases=[],c.cases.push(s);do{const t=h(e);l||(l=0===t.items.length),c.cases.push(t)}while(14!==i.currentType);return l&&r(e,ta.MUST_HAVE_MESSAGES_IN_PLURAL,n,0),a(c,e.currentOffset(),e.currentPosition()),c}(e,n,s,i)}return{parse:function(n){const s=fa(n,Yo({},e)),i=s.context(),l=o(0,i.offset,i.startLoc);return t&&l.loc&&(l.loc.source=n),l.body=f(s),e.onCacheKey&&(l.cacheKey=e.onCacheKey(n)),14!==i.currentType&&r(s,ta.UNEXPECTED_LEXICAL_ANALYSIS,i.lastStartLoc,0,n[i.offset]||""),a(l,s.currentOffset(),s.currentPosition()),l}}}function ka(e){if(14===e.type)return"EOF";const t=(e.value||"").replace(/\r?\n/gu,"\\n");return t.length>10?t.slice(0,9)+"…":t}function ba(e,t){for(let n=0;n<e.length;n++)wa(e[n],t)}function wa(e,t){switch(e.type){case 1:ba(e.cases,t),t.helper("plural");break;case 2:ba(e.items,t);break;case 6:wa(e.key,t),t.helper("linked"),t.helper("type");break;case 5:t.helper("interpolate"),t.helper("list");break;case 4:t.helper("interpolate"),t.helper("named")}}function _a(e,t={}){const n=function(e,t={}){const n={ast:e,helpers:new Set};return{context:()=>n,helper:e=>(n.helpers.add(e),e)}}(e);n.helper("normalize"),e.body&&wa(e.body,n);const s=n.context();e.helpers=Array.from(s.helpers)}function Ea(e){if(1===e.items.length){const t=e.items[0];3!==t.type&&9!==t.type||(e.static=t.value,delete t.value)}else{const t=[];for(let n=0;n<e.items.length;n++){const s=e.items[n];if(3!==s.type&&9!==s.type)break;if(null==s.value)break;t.push(s.value)}if(t.length===e.items.length){e.static=Jo(t);for(let t=0;t<e.items.length;t++){const n=e.items[t];3!==n.type&&9!==n.type||delete n.value}}}}const xa="minifier";function Sa(e){switch(e.t=e.type,e.type){case 0:{const t=e;Sa(t.body),t.b=t.body,delete t.body;break}case 1:{const t=e,n=t.cases;for(let e=0;e<n.length;e++)Sa(n[e]);t.c=n,delete t.cases;break}case 2:{const t=e,n=t.items;for(let e=0;e<n.length;e++)Sa(n[e]);t.i=n,delete t.items,t.static&&(t.s=t.static,delete t.static);break}case 3:case 9:case 8:case 7:{const t=e;t.value&&(t.v=t.value,delete t.value);break}case 6:{const t=e;Sa(t.key),t.k=t.key,delete t.key,t.modifier&&(Sa(t.modifier),t.m=t.modifier,delete t.modifier);break}case 5:{const t=e;t.i=t.index,delete t.index;break}case 4:{const t=e;t.k=t.key,delete t.key;break}default:throw sa(ta.UNHANDLED_MINIFIER_NODE_TYPE,null,{domain:xa,args:[e.type]})}delete e.type}const Ca="parser";function Aa(e,t){const{helper:n}=e;switch(t.type){case 0:!function(e,t){t.body?Aa(e,t.body):e.push("null")}(e,t);break;case 1:!function(e,t){const{helper:n,needIndent:s}=e;if(t.cases.length>1){e.push(`${n("plural")}([`),e.indent(s());const r=t.cases.length;for(let n=0;n<r&&(Aa(e,t.cases[n]),n!==r-1);n++)e.push(", ");e.deindent(s()),e.push("])")}}(e,t);break;case 2:!function(e,t){const{helper:n,needIndent:s}=e;e.push(`${n("normalize")}([`),e.indent(s());const r=t.items.length;for(let i=0;i<r&&(Aa(e,t.items[i]),i!==r-1);i++)e.push(", ");e.deindent(s()),e.push("])")}(e,t);break;case 6:!function(e,t){const{helper:n}=e;e.push(`${n("linked")}(`),Aa(e,t.key),t.modifier?(e.push(", "),Aa(e,t.modifier),e.push(", _type")):e.push(", undefined, _type"),e.push(")")}(e,t);break;case 8:case 7:case 9:case 3:e.push(JSON.stringify(t.value),t);break;case 5:e.push(`${n("interpolate")}(${n("list")}(${t.index}))`,t);break;case 4:e.push(`${n("interpolate")}(${n("named")}(${JSON.stringify(t.key)}))`,t);break;default:throw sa(ta.UNHANDLED_CODEGEN_NODE_TYPE,null,{domain:Ca,args:[t.type]})}}const $a=(e,t={})=>{const n=Qo(t.mode)?t.mode:"normal",s=Qo(t.filename)?t.filename:"message.intl",r=!!t.sourceMap,i=null!=t.breakLineCode?t.breakLineCode:"arrow"===n?";":"\n",o=t.needIndent?t.needIndent:"arrow"!==n,a=e.helpers||[],l=function(e,t){const{sourceMap:n,filename:s,breakLineCode:r,needIndent:i}=t,o=!1!==t.location,a={filename:s,code:"",column:1,line:1,offset:0,map:void 0,breakLineCode:r,needIndent:i,indentLevel:0};function l(e,t){a.code+=e}function c(e,t=!0){const n=t?r:"";l(i?n+" ".repeat(e):n)}return o&&e.loc&&(a.source=e.loc.source),{context:()=>a,push:l,indent:function(e=!0){const t=++a.indentLevel;e&&c(t)},deindent:function(e=!0){const t=--a.indentLevel;e&&c(t)},newline:function(){c(a.indentLevel)},helper:e=>`_${e}`,needIndent:()=>a.needIndent}}(e,{mode:n,filename:s,sourceMap:r,breakLineCode:i,needIndent:o});l.push("normal"===n?"function __msg__ (ctx) {":"(ctx) => {"),l.indent(o),a.length>0&&(l.push(`const { ${Jo(a.map((e=>`${e}: _${e}`)),", ")} } = ctx`),l.newline()),l.push("return "),Aa(l,e),l.deindent(o),l.push("}"),delete e.helpers;const{code:c,map:u}=l.context();return{ast:e,code:c,map:u?u.toJSON():void 0}};function Ta(e,t={}){const n=Yo({},t),s=!!n.jit,r=!!n.minify,i=null==n.optimize||n.optimize,o=ya(n).parse(e);return s?(i&&function(e){const t=e.body;2===t.type?Ea(t):t.cases.forEach((e=>Ea(e)))}(o),r&&Sa(o),{ast:o,code:""}):(_a(o,n),$a(o,n))}
|
||
/*!
|
||
* core-base v9.13.1
|
||
* (c) 2024 kazuya kawaguchi
|
||
* Released under the MIT License.
|
||
*/const La=[];La[0]={w:[0],i:[3,0],"[":[4],o:[7]},La[1]={w:[1],".":[2],"[":[4],o:[7]},La[2]={w:[2],i:[3,0],0:[3,0]},La[3]={i:[3,0],0:[3,0],w:[1,1],".":[2,1],"[":[4,1],o:[7,1]},La[4]={"'":[5,0],'"':[6,0],"[":[4,2],"]":[1,3],o:8,l:[4,0]},La[5]={"'":[4,0],o:8,l:[5,0]},La[6]={'"':[4,0],o:8,l:[6,0]};const Oa=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function Na(e){if(null==e)return"o";switch(e.charCodeAt(0)){case 91:case 93:case 46:case 34:case 39:return e;case 95:case 36:case 45:return"i";case 9:case 10:case 13:case 160:case 65279:case 8232:case 8233:return"w"}return"i"}function Ia(e){const t=e.trim();return("0"!==e.charAt(0)||!isNaN(parseInt(e)))&&(n=t,Oa.test(n)?function(e){const t=e.charCodeAt(0);return t!==e.charCodeAt(e.length-1)||34!==t&&39!==t?e:e.slice(1,-1)}(t):"*"+t);var n}const Pa=new Map;function Ra(e,t){return Do(e)?e[t]:null}const Ma=e=>e,Da=e=>"",Ua="text",Fa=e=>0===e.length?"":function(e,t=""){return e.reduce(((e,n,s)=>0===s?e+n:e+t+n),"")}(e),ja=e=>null==e?"":Io(e)||Bo(e)&&e.toString===Fo?JSON.stringify(e,null,2):String(e);function Ba(e,t){return e=Math.abs(e),2===t?e?e>1?1:0:1:e?Math.min(e,2):0}function qa(e={}){const t=e.locale,n=function(e){const t=Eo(e.pluralIndex)?e.pluralIndex:-1;return e.named&&(Eo(e.named.count)||Eo(e.named.n))?Eo(e.named.count)?e.named.count:Eo(e.named.n)?e.named.n:t:t}(e),s=Do(e.pluralRules)&&Ro(t)&&Po(e.pluralRules[t])?e.pluralRules[t]:Ba,r=Do(e.pluralRules)&&Ro(t)&&Po(e.pluralRules[t])?Ba:void 0,i=e.list||[],o=e.named||{};Eo(e.pluralIndex)&&function(e,t){t.count||(t.count=e),t.n||(t.n=e)}(n,o);function a(t){const n=Po(e.messages)?e.messages(t):!!Do(e.messages)&&e.messages[t];return n||(e.parent?e.parent.message(t):Da)}const l=Bo(e.processor)&&Po(e.processor.normalize)?e.processor.normalize:Fa,c=Bo(e.processor)&&Po(e.processor.interpolate)?e.processor.interpolate:ja,u={list:e=>i[e],named:e=>o[e],plural:e=>e[s(n,e.length,r)],linked:(t,...n)=>{const[s,r]=n;let i="text",o="";1===n.length?Do(s)?(o=s.modifier||o,i=s.type||i):Ro(s)&&(o=s||o):2===n.length&&(Ro(s)&&(o=s||o),Ro(r)&&(i=r||i));const l=a(t)(u),c="vnode"===i&&Io(l)&&o?l[0]:l;return o?(d=o,e.modifiers?e.modifiers[d]:Ma)(c,i):c;var d},message:a,type:Bo(e.processor)&&Ro(e.processor.type)?e.processor.type:Ua,interpolate:c,normalize:l,values:Ao({},i,o)};return u}let Wa=null;const Ha=Va("function:translate");function Va(e){return t=>Wa&&Wa.emit(e,t)}const Ka=Zo.__EXTEND_POINT__,za=qo(Ka),Ga={NOT_FOUND_KEY:Ka,FALLBACK_TO_TRANSLATE:za(),CANNOT_FORMAT_NUMBER:za(),FALLBACK_TO_NUMBER_FORMAT:za(),CANNOT_FORMAT_DATE:za(),FALLBACK_TO_DATE_FORMAT:za(),EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER:za(),__EXTEND_POINT__:za()},Ya=ta.__EXTEND_POINT__,Qa=qo(Ya),Xa={INVALID_ARGUMENT:Ya,INVALID_DATE_ARGUMENT:Qa(),INVALID_ISO_DATE_ARGUMENT:Qa(),NOT_SUPPORT_NON_STRING_MESSAGE:Qa(),NOT_SUPPORT_LOCALE_PROMISE_VALUE:Qa(),NOT_SUPPORT_LOCALE_ASYNC_FUNCTION:Qa(),NOT_SUPPORT_LOCALE_TYPE:Qa(),__EXTEND_POINT__:Qa()};function Ja(e){return sa(e,null,void 0)}function Za(e,t){return null!=t.locale?tl(t.locale):tl(e.locale)}let el;function tl(e){if(Ro(e))return e;if(Po(e)){if(e.resolvedOnce&&null!=el)return el;if("Function"===e.constructor.name){const t=e();if(Uo(t))throw Ja(Xa.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return el=t}throw Ja(Xa.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}throw Ja(Xa.NOT_SUPPORT_LOCALE_TYPE)}function nl(e,t,n){return[...new Set([n,...Io(t)?t:Do(t)?Object.keys(t):Ro(t)?[t]:[n]])]}function sl(e,t,n){const s=Ro(n)?n:cl,r=e;r.__localeChainCache||(r.__localeChainCache=new Map);let i=r.__localeChainCache.get(s);if(!i){i=[];let e=[n];for(;Io(e);)e=rl(i,e,t);const o=Io(t)||!Bo(t)?t:t.default?t.default:null;e=Ro(o)?[o]:o,Io(e)&&rl(i,e,!1),r.__localeChainCache.set(s,i)}return i}function rl(e,t,n){let s=!0;for(let r=0;r<t.length&&Mo(s);r++){const i=t[r];Ro(i)&&(s=il(e,t[r],n))}return s}function il(e,t,n){let s;const r=t.split("-");do{s=ol(e,r.join("-"),n),r.splice(-1,1)}while(r.length&&!0===s);return s}function ol(e,t,n){let s=!1;if(!e.includes(t)&&(s=!0,t)){s="!"!==t[t.length-1];const r=t.replace(/!/g,"");e.push(r),(Io(n)||Bo(n))&&n[r]&&(s=n[r])}return s}const al="9.13.1",ll=-1,cl="en-US",ul="",dl=e=>`${e.charAt(0).toLocaleUpperCase()}${e.substr(1)}`;let pl,hl,fl;function ml(e){pl=e}let gl=null;const vl=()=>gl;let yl=null;const kl=e=>{yl=e},bl=()=>yl;let wl=0;function _l(e={}){const t=Po(e.onWarn)?e.onWarn:Wo,n=Ro(e.version)?e.version:al,s=Ro(e.locale)||Po(e.locale)?e.locale:cl,r=Po(s)?cl:s,i=Io(e.fallbackLocale)||Bo(e.fallbackLocale)||Ro(e.fallbackLocale)||!1===e.fallbackLocale?e.fallbackLocale:r,o=Bo(e.messages)?e.messages:{[r]:{}},a=Bo(e.datetimeFormats)?e.datetimeFormats:{[r]:{}},l=Bo(e.numberFormats)?e.numberFormats:{[r]:{}},c=Ao({},e.modifiers||{},{upper:(e,t)=>"text"===t&&Ro(e)?e.toUpperCase():"vnode"===t&&Do(e)&&"__v_isVNode"in e?e.children.toUpperCase():e,lower:(e,t)=>"text"===t&&Ro(e)?e.toLowerCase():"vnode"===t&&Do(e)&&"__v_isVNode"in e?e.children.toLowerCase():e,capitalize:(e,t)=>"text"===t&&Ro(e)?dl(e):"vnode"===t&&Do(e)&&"__v_isVNode"in e?dl(e.children):e}),u=e.pluralRules||{},d=Po(e.missing)?e.missing:null,p=!Mo(e.missingWarn)&&!So(e.missingWarn)||e.missingWarn,h=!Mo(e.fallbackWarn)&&!So(e.fallbackWarn)||e.fallbackWarn,f=!!e.fallbackFormat,m=!!e.unresolving,g=Po(e.postTranslation)?e.postTranslation:null,v=Bo(e.processor)?e.processor:null,y=!Mo(e.warnHtmlMessage)||e.warnHtmlMessage,k=!!e.escapeParameter,b=Po(e.messageCompiler)?e.messageCompiler:pl,w=Po(e.messageResolver)?e.messageResolver:hl||Ra,_=Po(e.localeFallbacker)?e.localeFallbacker:fl||nl,E=Do(e.fallbackContext)?e.fallbackContext:void 0,x=e,S=Do(x.__datetimeFormatters)?x.__datetimeFormatters:new Map,C=Do(x.__numberFormatters)?x.__numberFormatters:new Map,A=Do(x.__meta)?x.__meta:{};wl++;const $={version:n,cid:wl,locale:s,fallbackLocale:i,messages:o,modifiers:c,pluralRules:u,missing:d,missingWarn:p,fallbackWarn:h,fallbackFormat:f,unresolving:m,postTranslation:g,processor:v,warnHtmlMessage:y,escapeParameter:k,messageCompiler:b,messageResolver:w,localeFallbacker:_,fallbackContext:E,onWarn:t,__meta:A};return $.datetimeFormats=a,$.numberFormats=l,$.__datetimeFormatters=S,$.__numberFormatters=C,__INTLIFY_PROD_DEVTOOLS__&&function(e,t,n){Wa&&Wa.emit("i18n:init",{timestamp:Date.now(),i18n:e,version:t,meta:n})}($,n,A),$}function El(e,t,n,s,r){const{missing:i,onWarn:o}=e;if(null!==i){const s=i(e,n,t,r);return Ro(s)?s:t}return t}function xl(e,t,n){e.__localeChainCache=new Map,e.localeFallbacker(e,n,t)}function Sl(e,t){const n=t.indexOf(e);if(-1===n)return!1;for(let i=n+1;i<t.length;i++)if(s=e,r=t[i],s!==r&&s.split("-")[0]===r.split("-")[0])return!0;var s,r;return!1}function Cl(e){return t=>function(e,t){const n=t.b||t.body;if(1===(n.t||n.type)){const t=n,s=t.c||t.cases;return e.plural(s.reduce(((t,n)=>[...t,Al(e,n)]),[]))}return Al(e,n)}(t,e)}function Al(e,t){const n=t.s||t.static;if(n)return"text"===e.type?n:e.normalize([n]);{const n=(t.i||t.items).reduce(((t,n)=>[...t,$l(e,n)]),[]);return e.normalize(n)}}function $l(e,t){const n=t.t||t.type;switch(n){case 3:{const e=t;return e.v||e.value}case 9:{const e=t;return e.v||e.value}case 4:{const n=t;return e.interpolate(e.named(n.k||n.key))}case 5:{const n=t;return e.interpolate(e.list(null!=n.i?n.i:n.index))}case 6:{const n=t,s=n.m||n.modifier;return e.linked($l(e,n.k||n.key),s?$l(e,s):void 0,e.type)}case 7:{const e=t;return e.v||e.value}case 8:{const e=t;return e.v||e.value}default:throw new Error(`unhandled node type on format message part: ${n}`)}}const Tl=e=>e;let Ll=Object.create(null);const Ol=e=>Do(e)&&(0===e.t||0===e.type)&&("b"in e||"body"in e);function Nl(e,t={}){let n=!1;const s=t.onError||ra;return t.onError=e=>{n=!0,s(e)},c(l({},Ta(e,t)),{detectError:n})}const Il=(e,t)=>{if(!Ro(e))throw Ja(Xa.NOT_SUPPORT_NON_STRING_MESSAGE);{!Mo(t.warnHtmlMessage)||t.warnHtmlMessage;const n=(t.onCacheKey||Tl)(e),s=Ll[n];if(s)return s;const{code:r,detectError:i}=Nl(e,t),o=new Function(`return ${r}`)();return i?o:Ll[n]=o}};const Pl=()=>"",Rl=e=>Po(e);function Ml(e,...t){const{fallbackFormat:n,postTranslation:s,unresolving:r,messageCompiler:i,fallbackLocale:o,messages:a}=e,[l,c]=Fl(...t),u=Mo(c.missingWarn)?c.missingWarn:e.missingWarn,d=Mo(c.fallbackWarn)?c.fallbackWarn:e.fallbackWarn,p=Mo(c.escapeParameter)?c.escapeParameter:e.escapeParameter,h=!!c.resolvedMessage,f=Ro(c.default)||Mo(c.default)?Mo(c.default)?i?l:()=>l:c.default:n?i?l:()=>l:"",m=n||""!==f,g=Za(e,c);p&&function(e){Io(e.list)?e.list=e.list.map((e=>Ro(e)?Lo(e):e)):Do(e.named)&&Object.keys(e.named).forEach((t=>{Ro(e.named[t])&&(e.named[t]=Lo(e.named[t]))}))}(c);let[v,y,k]=h?[l,g,a[g]||{}]:Dl(e,l,g,o,d,u),b=v,w=l;if(h||Ro(b)||Ol(b)||Rl(b)||m&&(b=f,w=b),!(h||(Ro(b)||Ol(b)||Rl(b))&&Ro(y)))return r?ll:l;let _=!1;const E=Rl(b)?b:Ul(e,l,y,b,w,(()=>{_=!0}));if(_)return b;const x=function(e,t,n,s){const{modifiers:r,pluralRules:i,messageResolver:o,fallbackLocale:a,fallbackWarn:l,missingWarn:c,fallbackContext:u}=e,d=s=>{let r=o(n,s);if(null==r&&u){const[,,e]=Dl(u,s,t,a,l,c);r=o(e,s)}if(Ro(r)||Ol(r)){let n=!1;const i=Ul(e,s,t,r,s,(()=>{n=!0}));return n?Pl:i}return Rl(r)?r:Pl},p={locale:t,modifiers:r,pluralRules:i,messages:d};e.processor&&(p.processor=e.processor);s.list&&(p.list=s.list);s.named&&(p.named=s.named);Eo(s.plural)&&(p.pluralIndex=s.plural);return p}(e,y,k,c),S=function(e,t,n){const s=t(n);return s}(0,E,qa(x)),C=s?s(S,l):S;if(__INTLIFY_PROD_DEVTOOLS__){const t={timestamp:Date.now(),key:Ro(l)?l:Rl(b)?b.key:"",locale:y||(Rl(b)?b.locale:""),format:Ro(b)?b:Rl(b)?b.source:"",message:C};t.meta=Ao({},e.__meta,vl()||{}),Ha(t)}return C}function Dl(e,t,n,s,r,i){const{messages:o,onWarn:a,messageResolver:l,localeFallbacker:c}=e,u=c(e,s,n);let d,p={},h=null;for(let f=0;f<u.length&&(d=u[f],p=o[d]||{},null===(h=l(p,t))&&(h=p[t]),!(Ro(h)||Ol(h)||Rl(h)));f++)if(!Sl(d,u)){const n=El(e,t,d,0,"translate");n!==t&&(h=n)}return[h,d,p]}function Ul(e,t,n,s,r,i){const{messageCompiler:o,warnHtmlMessage:a}=e;if(Rl(s)){const e=s;return e.locale=e.locale||n,e.key=e.key||t,e}if(null==o){const e=()=>s;return e.locale=n,e.key=t,e}const l=o(s,function(e,t,n,s,r,i){return{locale:t,key:n,warnHtmlMessage:r,onError:e=>{throw i&&i(e),e},onCacheKey:e=>wo(t,n,e)}}(0,n,r,0,a,i));return l.locale=n,l.key=t,l.source=s,l}function Fl(...e){const[t,n,s]=e,r={};if(!(Ro(t)||Eo(t)||Rl(t)||Ol(t)))throw Ja(Xa.INVALID_ARGUMENT);const i=Eo(t)?String(t):(Rl(t),t);return Eo(n)?r.plural=n:Ro(n)?r.default=n:Bo(n)&&!Co(n)?r.named=n:Io(n)&&(r.list=n),Eo(s)?r.plural=s:Ro(s)?r.default=s:Bo(s)&&Ao(r,s),[i,r]}function jl(e,...t){const{datetimeFormats:n,unresolving:s,fallbackLocale:r,onWarn:i,localeFallbacker:o}=e,{__datetimeFormatters:a}=e,[l,c,u,d]=ql(...t);Mo(u.missingWarn)?u.missingWarn:e.missingWarn;Mo(u.fallbackWarn)?u.fallbackWarn:e.fallbackWarn;const p=!!u.part,h=Za(e,u),f=o(e,r,h);if(!Ro(l)||""===l)return new Intl.DateTimeFormat(h,d).format(c);let m,g={},v=null;for(let b=0;b<f.length&&(m=f[b],g=n[m]||{},v=g[l],!Bo(v));b++)El(e,l,m,0,"datetime format");if(!Bo(v)||!Ro(m))return s?ll:l;let y=`${m}__${l}`;Co(d)||(y=`${y}__${JSON.stringify(d)}`);let k=a.get(y);return k||(k=new Intl.DateTimeFormat(m,Ao({},v,d)),a.set(y,k)),p?k.formatToParts(c):k.format(c)}const Bl=["localeMatcher","weekday","era","year","month","day","hour","minute","second","timeZoneName","formatMatcher","hour12","timeZone","dateStyle","timeStyle","calendar","dayPeriod","numberingSystem","hourCycle","fractionalSecondDigits"];function ql(...e){const[t,n,s,r]=e,i={};let o,a={};if(Ro(t)){const e=t.match(/(\d{4}-\d{2}-\d{2})(T|\s)?(.*)/);if(!e)throw Ja(Xa.INVALID_ISO_DATE_ARGUMENT);const n=e[3]?e[3].trim().startsWith("T")?`${e[1].trim()}${e[3].trim()}`:`${e[1].trim()}T${e[3].trim()}`:e[1].trim();o=new Date(n);try{o.toISOString()}catch(l){throw Ja(Xa.INVALID_ISO_DATE_ARGUMENT)}}else if(xo(t)){if(isNaN(t.getTime()))throw Ja(Xa.INVALID_DATE_ARGUMENT);o=t}else{if(!Eo(t))throw Ja(Xa.INVALID_ARGUMENT);o=t}return Ro(n)?i.key=n:Bo(n)&&Object.keys(n).forEach((e=>{Bl.includes(e)?a[e]=n[e]:i[e]=n[e]})),Ro(s)?i.locale=s:Bo(s)&&(a=s),Bo(r)&&(a=r),[i.key||"",o,i,a]}function Wl(e,t,n){const s=e;for(const r in n){const e=`${t}__${r}`;s.__datetimeFormatters.has(e)&&s.__datetimeFormatters.delete(e)}}function Hl(e,...t){const{numberFormats:n,unresolving:s,fallbackLocale:r,onWarn:i,localeFallbacker:o}=e,{__numberFormatters:a}=e,[l,c,u,d]=Kl(...t);Mo(u.missingWarn)?u.missingWarn:e.missingWarn;Mo(u.fallbackWarn)?u.fallbackWarn:e.fallbackWarn;const p=!!u.part,h=Za(e,u),f=o(e,r,h);if(!Ro(l)||""===l)return new Intl.NumberFormat(h,d).format(c);let m,g={},v=null;for(let b=0;b<f.length&&(m=f[b],g=n[m]||{},v=g[l],!Bo(v));b++)El(e,l,m,0,"number format");if(!Bo(v)||!Ro(m))return s?ll:l;let y=`${m}__${l}`;Co(d)||(y=`${y}__${JSON.stringify(d)}`);let k=a.get(y);return k||(k=new Intl.NumberFormat(m,Ao({},v,d)),a.set(y,k)),p?k.formatToParts(c):k.format(c)}const Vl=["localeMatcher","style","currency","currencyDisplay","currencySign","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","compactDisplay","notation","signDisplay","unit","unitDisplay","roundingMode","roundingPriority","roundingIncrement","trailingZeroDisplay"];function Kl(...e){const[t,n,s,r]=e,i={};let o={};if(!Eo(t))throw Ja(Xa.INVALID_ARGUMENT);const a=t;return Ro(n)?i.key=n:Bo(n)&&Object.keys(n).forEach((e=>{Vl.includes(e)?o[e]=n[e]:i[e]=n[e]})),Ro(s)?i.locale=s:Bo(s)&&(o=s),Bo(r)&&(o=r),[i.key||"",a,i,o]}function zl(e,t,n){const s=e;for(const r in n){const e=`${t}__${r}`;s.__numberFormatters.has(e)&&s.__numberFormatters.delete(e)}}"boolean"!=typeof __INTLIFY_PROD_DEVTOOLS__&&(To().__INTLIFY_PROD_DEVTOOLS__=!1),"boolean"!=typeof __INTLIFY_JIT_COMPILATION__&&(To().__INTLIFY_JIT_COMPILATION__=!1),"boolean"!=typeof __INTLIFY_DROP_MESSAGE_COMPILER__&&(To().__INTLIFY_DROP_MESSAGE_COMPILER__=!1);
|
||
/*!
|
||
* vue-i18n v9.13.1
|
||
* (c) 2024 kazuya kawaguchi
|
||
* Released under the MIT License.
|
||
*/
|
||
const Gl="9.13.1";const Yl=Ga.__EXTEND_POINT__,Ql=qo(Yl);Ql(),Ql(),Ql(),Ql(),Ql(),Ql(),Ql(),Ql(),Ql();const Xl=Xa.__EXTEND_POINT__,Jl=qo(Xl),Zl={UNEXPECTED_RETURN_TYPE:Xl,INVALID_ARGUMENT:Jl(),MUST_BE_CALL_SETUP_TOP:Jl(),NOT_INSTALLED:Jl(),NOT_AVAILABLE_IN_LEGACY_MODE:Jl(),REQUIRED_VALUE:Jl(),INVALID_VALUE:Jl(),CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN:Jl(),NOT_INSTALLED_WITH_PROVIDE:Jl(),UNEXPECTED_ERROR:Jl(),NOT_COMPATIBLE_LEGACY_VUE_I18N:Jl(),BRIDGE_SUPPORT_VUE_2_ONLY:Jl(),MUST_DEFINE_I18N_OPTION_IN_ALLOW_COMPOSITION:Jl(),NOT_AVAILABLE_COMPOSITION_IN_LEGACY:Jl(),__EXTEND_POINT__:Jl()};function ec(e,...t){return sa(e,null,void 0)}const tc=bo("__translateVNode"),nc=bo("__datetimeParts"),sc=bo("__numberParts"),rc=bo("__setPluralRules"),ic=bo("__injectWithOption"),oc=bo("__dispose");function ac(e){if(!Do(e))return e;for(const t in e)if(No(e,t))if(t.includes(".")){const n=t.split("."),s=n.length-1;let r=e,i=!1;for(let e=0;e<s;e++){if(n[e]in r||(r[n[e]]={}),!Do(r[n[e]])){i=!0;break}r=r[n[e]]}i||(r[n[s]]=e[t],delete e[t]),Do(r[n[s]])&&ac(r[n[s]])}else Do(e[t])&&ac(e[t]);return e}function lc(e,t){const{messages:n,__i18n:s,messageResolver:r,flatJson:i}=t,o=Bo(n)?n:Io(s)?{}:{[e]:{}};if(Io(s)&&s.forEach((e=>{if("locale"in e&&"resource"in e){const{locale:t,resource:n}=e;t?(o[t]=o[t]||{},Vo(n,o[t])):Vo(n,o)}else Ro(e)&&Vo(JSON.parse(e),o)})),null==r&&i)for(const a in o)No(o,a)&&ac(o[a]);return o}function cc(e){return e.type}function uc(e,t,n){let s=Do(t.messages)?t.messages:{};"__i18nGlobal"in n&&(s=lc(e.locale.value,{messages:s,__i18n:n.__i18nGlobal}));const r=Object.keys(s);if(r.length&&r.forEach((t=>{e.mergeLocaleMessage(t,s[t])})),Do(t.datetimeFormats)){const n=Object.keys(t.datetimeFormats);n.length&&n.forEach((n=>{e.mergeDateTimeFormat(n,t.datetimeFormats[n])}))}if(Do(t.numberFormats)){const n=Object.keys(t.numberFormats);n.length&&n.forEach((n=>{e.mergeNumberFormat(n,t.numberFormats[n])}))}}function dc(e){return Lr(fr,null,e,0)}const pc=()=>[],hc=()=>!1;let fc=0;function mc(e){return(t,n,s,r)=>e(n,s,Br()||void 0,r)}function gc(e={},t){const{__root:n,__injectWithOption:s}=e,r=void 0===n,i=e.flatJson,o=ko?Mt:Dt,a=!!e.translateExistCompatible;let l=!Mo(e.inheritLocale)||e.inheritLocale;const c=o(n&&l?n.locale.value:Ro(e.locale)?e.locale:cl),u=o(n&&l?n.fallbackLocale.value:Ro(e.fallbackLocale)||Io(e.fallbackLocale)||Bo(e.fallbackLocale)||!1===e.fallbackLocale?e.fallbackLocale:c.value),d=o(lc(c.value,e)),p=o(Bo(e.datetimeFormats)?e.datetimeFormats:{[c.value]:{}}),h=o(Bo(e.numberFormats)?e.numberFormats:{[c.value]:{}});let f=n?n.missingWarn:!Mo(e.missingWarn)&&!So(e.missingWarn)||e.missingWarn,m=n?n.fallbackWarn:!Mo(e.fallbackWarn)&&!So(e.fallbackWarn)||e.fallbackWarn,g=n?n.fallbackRoot:!Mo(e.fallbackRoot)||e.fallbackRoot,v=!!e.fallbackFormat,y=Po(e.missing)?e.missing:null,k=Po(e.missing)?mc(e.missing):null,b=Po(e.postTranslation)?e.postTranslation:null,w=n?n.warnHtmlMessage:!Mo(e.warnHtmlMessage)||e.warnHtmlMessage,_=!!e.escapeParameter;const E=n?n.modifiers:Bo(e.modifiers)?e.modifiers:{};let x,S=e.pluralRules||n&&n.pluralRules;x=(()=>{r&&kl(null);const t={version:Gl,locale:c.value,fallbackLocale:u.value,messages:d.value,modifiers:E,pluralRules:S,missing:null===k?void 0:k,missingWarn:f,fallbackWarn:m,fallbackFormat:v,unresolving:!0,postTranslation:null===b?void 0:b,warnHtmlMessage:w,escapeParameter:_,messageResolver:e.messageResolver,messageCompiler:e.messageCompiler,__meta:{framework:"vue"}};t.datetimeFormats=p.value,t.numberFormats=h.value,t.__datetimeFormatters=Bo(x)?x.__datetimeFormatters:void 0,t.__numberFormatters=Bo(x)?x.__numberFormatters:void 0;const n=_l(t);return r&&kl(n),n})(),xl(x,c.value,u.value);const C=ei({get:()=>c.value,set:e=>{c.value=e,x.locale=c.value}}),A=ei({get:()=>u.value,set:e=>{u.value=e,x.fallbackLocale=u.value,xl(x,c.value,e)}}),$=ei((()=>d.value)),T=ei((()=>p.value)),L=ei((()=>h.value));const O=(e,t,s,i,o,a)=>{let l;c.value,u.value,d.value,p.value,h.value;try{__INTLIFY_PROD_DEVTOOLS__,r||(x.fallbackContext=n?bl():void 0),l=e(x)}finally{__INTLIFY_PROD_DEVTOOLS__,r||(x.fallbackContext=void 0)}if("translate exists"!==s&&Eo(l)&&l===ll||"translate exists"===s&&!l){const[e,s]=t();return n&&g?i(n):o(e)}if(a(l))return l;throw ec(Zl.UNEXPECTED_RETURN_TYPE)};function N(...e){return O((t=>Reflect.apply(Ml,null,[t,...e])),(()=>Fl(...e)),"translate",(t=>Reflect.apply(t.t,t,[...e])),(e=>e),(e=>Ro(e)))}const I={normalize:function(e){return e.map((e=>Ro(e)||Eo(e)||Mo(e)?dc(String(e)):e))},interpolate:e=>e,type:"vnode"};function P(e){return d.value[e]||{}}fc++,n&&ko&&(Pn(n.locale,(e=>{l&&(c.value=e,x.locale=e,xl(x,c.value,u.value))})),Pn(n.fallbackLocale,(e=>{l&&(u.value=e,x.fallbackLocale=e,xl(x,c.value,u.value))})));const R={id:fc,locale:C,fallbackLocale:A,get inheritLocale(){return l},set inheritLocale(e){l=e,e&&n&&(c.value=n.locale.value,u.value=n.fallbackLocale.value,xl(x,c.value,u.value))},get availableLocales(){return Object.keys(d.value).sort()},messages:$,get modifiers(){return E},get pluralRules(){return S||{}},get isGlobal(){return r},get missingWarn(){return f},set missingWarn(e){f=e,x.missingWarn=f},get fallbackWarn(){return m},set fallbackWarn(e){m=e,x.fallbackWarn=m},get fallbackRoot(){return g},set fallbackRoot(e){g=e},get fallbackFormat(){return v},set fallbackFormat(e){v=e,x.fallbackFormat=v},get warnHtmlMessage(){return w},set warnHtmlMessage(e){w=e,x.warnHtmlMessage=e},get escapeParameter(){return _},set escapeParameter(e){_=e,x.escapeParameter=e},t:N,getLocaleMessage:P,setLocaleMessage:function(e,t){if(i){const n={[e]:t};for(const e in n)No(n,e)&&ac(n[e]);t=n[e]}d.value[e]=t,x.messages=d.value},mergeLocaleMessage:function(e,t){d.value[e]=d.value[e]||{};const n={[e]:t};if(i)for(const s in n)No(n,s)&&ac(n[s]);Vo(t=n[e],d.value[e]),x.messages=d.value},getPostTranslationHandler:function(){return Po(b)?b:null},setPostTranslationHandler:function(e){b=e,x.postTranslation=e},getMissingHandler:function(){return y},setMissingHandler:function(e){null!==e&&(k=mc(e)),y=e,x.missing=k},[rc]:function(e){S=e,x.pluralRules=S}};return R.datetimeFormats=T,R.numberFormats=L,R.rt=function(...e){const[t,n,s]=e;if(s&&!Do(s))throw ec(Zl.INVALID_ARGUMENT);return N(t,n,Ao({resolvedMessage:!0},s||{}))},R.te=function(e,t){return O((()=>{if(!e)return!1;const n=P(Ro(t)?t:c.value),s=x.messageResolver(n,e);return a?null!=s:Ol(s)||Rl(s)||Ro(s)}),(()=>[e]),"translate exists",(n=>Reflect.apply(n.te,n,[e,t])),hc,(e=>Mo(e)))},R.tm=function(e){const t=function(e){let t=null;const n=sl(x,u.value,c.value);for(let s=0;s<n.length;s++){const r=d.value[n[s]]||{},i=x.messageResolver(r,e);if(null!=i){t=i;break}}return t}(e);return null!=t?t:n&&n.tm(e)||{}},R.d=function(...e){return O((t=>Reflect.apply(jl,null,[t,...e])),(()=>ql(...e)),"datetime format",(t=>Reflect.apply(t.d,t,[...e])),(()=>ul),(e=>Ro(e)))},R.n=function(...e){return O((t=>Reflect.apply(Hl,null,[t,...e])),(()=>Kl(...e)),"number format",(t=>Reflect.apply(t.n,t,[...e])),(()=>ul),(e=>Ro(e)))},R.getDateTimeFormat=function(e){return p.value[e]||{}},R.setDateTimeFormat=function(e,t){p.value[e]=t,x.datetimeFormats=p.value,Wl(x,e,t)},R.mergeDateTimeFormat=function(e,t){p.value[e]=Ao(p.value[e]||{},t),x.datetimeFormats=p.value,Wl(x,e,t)},R.getNumberFormat=function(e){return h.value[e]||{}},R.setNumberFormat=function(e,t){h.value[e]=t,x.numberFormats=h.value,zl(x,e,t)},R.mergeNumberFormat=function(e,t){h.value[e]=Ao(h.value[e]||{},t),x.numberFormats=h.value,zl(x,e,t)},R[ic]=s,R[tc]=function(...e){return O((t=>{let n;const s=t;try{s.processor=I,n=Reflect.apply(Ml,null,[s,...e])}finally{s.processor=null}return n}),(()=>Fl(...e)),"translate",(t=>t[tc](...e)),(e=>[dc(e)]),(e=>Io(e)))},R[nc]=function(...e){return O((t=>Reflect.apply(jl,null,[t,...e])),(()=>ql(...e)),"datetime format",(t=>t[nc](...e)),pc,(e=>Ro(e)||Io(e)))},R[sc]=function(...e){return O((t=>Reflect.apply(Hl,null,[t,...e])),(()=>Kl(...e)),"number format",(t=>t[sc](...e)),pc,(e=>Ro(e)||Io(e)))},R}function vc(e={},t){{const t=gc(function(e){const t=Ro(e.locale)?e.locale:cl,n=Ro(e.fallbackLocale)||Io(e.fallbackLocale)||Bo(e.fallbackLocale)||!1===e.fallbackLocale?e.fallbackLocale:t,s=Po(e.missing)?e.missing:void 0,r=!Mo(e.silentTranslationWarn)&&!So(e.silentTranslationWarn)||!e.silentTranslationWarn,i=!Mo(e.silentFallbackWarn)&&!So(e.silentFallbackWarn)||!e.silentFallbackWarn,o=!Mo(e.fallbackRoot)||e.fallbackRoot,a=!!e.formatFallbackMessages,l=Bo(e.modifiers)?e.modifiers:{},c=e.pluralizationRules,u=Po(e.postTranslation)?e.postTranslation:void 0,d=!Ro(e.warnHtmlInMessage)||"off"!==e.warnHtmlInMessage,p=!!e.escapeParameterHtml,h=!Mo(e.sync)||e.sync;let f=e.messages;if(Bo(e.sharedMessages)){const t=e.sharedMessages;f=Object.keys(t).reduce(((e,n)=>{const s=e[n]||(e[n]={});return Ao(s,t[n]),e}),f||{})}const{__i18n:m,__root:g,__injectWithOption:v}=e,y=e.datetimeFormats,k=e.numberFormats,b=e.flatJson,w=e.translateExistCompatible;return{locale:t,fallbackLocale:n,messages:f,flatJson:b,datetimeFormats:y,numberFormats:k,missing:s,missingWarn:r,fallbackWarn:i,fallbackRoot:o,fallbackFormat:a,modifiers:l,pluralRules:c,postTranslation:u,warnHtmlMessage:d,escapeParameter:p,messageResolver:e.messageResolver,inheritLocale:h,translateExistCompatible:w,__i18n:m,__root:g,__injectWithOption:v}}(e)),{__extender:n}=e,s={id:t.id,get locale(){return t.locale.value},set locale(e){t.locale.value=e},get fallbackLocale(){return t.fallbackLocale.value},set fallbackLocale(e){t.fallbackLocale.value=e},get messages(){return t.messages.value},get datetimeFormats(){return t.datetimeFormats.value},get numberFormats(){return t.numberFormats.value},get availableLocales(){return t.availableLocales},get formatter(){return{interpolate:()=>[]}},set formatter(e){},get missing(){return t.getMissingHandler()},set missing(e){t.setMissingHandler(e)},get silentTranslationWarn(){return Mo(t.missingWarn)?!t.missingWarn:t.missingWarn},set silentTranslationWarn(e){t.missingWarn=Mo(e)?!e:e},get silentFallbackWarn(){return Mo(t.fallbackWarn)?!t.fallbackWarn:t.fallbackWarn},set silentFallbackWarn(e){t.fallbackWarn=Mo(e)?!e:e},get modifiers(){return t.modifiers},get formatFallbackMessages(){return t.fallbackFormat},set formatFallbackMessages(e){t.fallbackFormat=e},get postTranslation(){return t.getPostTranslationHandler()},set postTranslation(e){t.setPostTranslationHandler(e)},get sync(){return t.inheritLocale},set sync(e){t.inheritLocale=e},get warnHtmlInMessage(){return t.warnHtmlMessage?"warn":"off"},set warnHtmlInMessage(e){t.warnHtmlMessage="off"!==e},get escapeParameterHtml(){return t.escapeParameter},set escapeParameterHtml(e){t.escapeParameter=e},get preserveDirectiveContent(){return!0},set preserveDirectiveContent(e){},get pluralizationRules(){return t.pluralRules||{}},__composer:t,t(...e){const[n,s,r]=e,i={};let o=null,a=null;if(!Ro(n))throw ec(Zl.INVALID_ARGUMENT);const l=n;return Ro(s)?i.locale=s:Io(s)?o=s:Bo(s)&&(a=s),Io(r)?o=r:Bo(r)&&(a=r),Reflect.apply(t.t,t,[l,o||a||{},i])},rt:(...e)=>Reflect.apply(t.rt,t,[...e]),tc(...e){const[n,s,r]=e,i={plural:1};let o=null,a=null;if(!Ro(n))throw ec(Zl.INVALID_ARGUMENT);const l=n;return Ro(s)?i.locale=s:Eo(s)?i.plural=s:Io(s)?o=s:Bo(s)&&(a=s),Ro(r)?i.locale=r:Io(r)?o=r:Bo(r)&&(a=r),Reflect.apply(t.t,t,[l,o||a||{},i])},te:(e,n)=>t.te(e,n),tm:e=>t.tm(e),getLocaleMessage:e=>t.getLocaleMessage(e),setLocaleMessage(e,n){t.setLocaleMessage(e,n)},mergeLocaleMessage(e,n){t.mergeLocaleMessage(e,n)},d:(...e)=>Reflect.apply(t.d,t,[...e]),getDateTimeFormat:e=>t.getDateTimeFormat(e),setDateTimeFormat(e,n){t.setDateTimeFormat(e,n)},mergeDateTimeFormat(e,n){t.mergeDateTimeFormat(e,n)},n:(...e)=>Reflect.apply(t.n,t,[...e]),getNumberFormat:e=>t.getNumberFormat(e),setNumberFormat(e,n){t.setNumberFormat(e,n)},mergeNumberFormat(e,n){t.mergeNumberFormat(e,n)},getChoiceIndex:(e,t)=>-1};return s.__extender=n,s}}const yc={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:e=>"parent"===e||"global"===e,default:"parent"},i18n:{type:Object}};function kc(e){return hr}const bc=Jn({name:"i18n-t",props:Ao({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:e=>Eo(e)||!isNaN(e)}},yc),setup(e,t){const{slots:n,attrs:s}=t,r=e.i18n||Tc({useScope:e.scope,__useComponent:!0});return()=>{const i=Object.keys(n).filter((e=>"_"!==e)),o={};e.locale&&(o.locale=e.locale),void 0!==e.plural&&(o.plural=Ro(e.plural)?+e.plural:e.plural);const a=function({slots:e},t){if(1===t.length&&"default"===t[0])return(e.default?e.default():[]).reduce(((e,t)=>[...e,...t.type===hr?t.children:[t]]),[]);return t.reduce(((t,n)=>{const s=e[n];return s&&(t[n]=s()),t}),{})}(t,i),l=r[tc](e.keypath,a,o),c=Ao({},s);return ti(Ro(e.tag)||Do(e.tag)?e.tag:kc(),c,l)}}});function wc(e,t,n,s){const{slots:r,attrs:i}=t;return()=>{const t={part:!0};let o={};e.locale&&(t.locale=e.locale),Ro(e.format)?t.key=e.format:Do(e.format)&&(Ro(e.format.key)&&(t.key=e.format.key),o=Object.keys(e.format).reduce(((t,s)=>n.includes(s)?Ao({},t,{[s]:e.format[s]}):t),{}));const a=s(e.value,t,o);let l=[t.key];Io(a)?l=a.map(((e,t)=>{const n=r[e.type],s=n?n({[e.type]:e.value,index:t,parts:a}):[e.value];var i;return Io(i=s)&&!Ro(i[0])&&(s[0].key=`${e.type}-${t}`),s})):Ro(a)&&(l=[a]);const c=Ao({},i);return ti(Ro(e.tag)||Do(e.tag)?e.tag:kc(),c,l)}}const _c=Jn({name:"i18n-n",props:Ao({value:{type:Number,required:!0},format:{type:[String,Object]}},yc),setup(e,t){const n=e.i18n||Tc({useScope:e.scope,__useComponent:!0});return wc(e,t,Vl,((...e)=>n[sc](...e)))}}),Ec=Jn({name:"i18n-d",props:Ao({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},yc),setup(e,t){const n=e.i18n||Tc({useScope:e.scope,__useComponent:!0});return wc(e,t,Bl,((...e)=>n[nc](...e)))}});function xc(e){if(Ro(e))return{path:e};if(Bo(e)){if(!("path"in e))throw ec(Zl.REQUIRED_VALUE);return e}throw ec(Zl.INVALID_VALUE)}function Sc(e){const{path:t,locale:n,args:s,choice:r,plural:i}=e,o={},a=s||{};return Ro(n)&&(o.locale=n),Eo(r)&&(o.plural=r),Eo(i)&&(o.plural=i),[t,a,o]}function Cc(e,t,...n){const s=Bo(n[0])?n[0]:{},r=!!s.useI18nComponentName;(!Mo(s.globalInstall)||s.globalInstall)&&([r?"i18n":bc.name,"I18nT"].forEach((t=>e.component(t,bc))),[_c.name,"I18nN"].forEach((t=>e.component(t,_c))),[Ec.name,"I18nD"].forEach((t=>e.component(t,Ec)))),e.directive("t",function(e){const t=t=>{const{instance:n,modifiers:s,value:r}=t;if(!n||!n.$)throw ec(Zl.UNEXPECTED_ERROR);const i=function(e,t){const n=e;if("composition"===e.mode)return n.__getInstance(t)||e.global;{const s=n.__getInstance(t);return null!=s?s.__composer:e.global.__composer}}(e,n.$),o=xc(r);return[Reflect.apply(i.t,i,[...Sc(o)]),i]};return{created:(n,s)=>{const[r,i]=t(s);ko&&e.global===i&&(n.__i18nWatcher=Pn(i.locale,(()=>{s.instance&&s.instance.$forceUpdate()}))),n.__composer=i,n.textContent=r},unmounted:e=>{ko&&e.__i18nWatcher&&(e.__i18nWatcher(),e.__i18nWatcher=void 0,delete e.__i18nWatcher),e.__composer&&(e.__composer=void 0,delete e.__composer)},beforeUpdate:(e,{value:t})=>{if(e.__composer){const n=e.__composer,s=xc(t);e.textContent=Reflect.apply(n.t,n,[...Sc(s)])}},getSSRProps:e=>{const[n]=t(e);return{textContent:n}}}}(t))}function Ac(e,t){e.locale=t.locale||e.locale,e.fallbackLocale=t.fallbackLocale||e.fallbackLocale,e.missing=t.missing||e.missing,e.silentTranslationWarn=t.silentTranslationWarn||e.silentFallbackWarn,e.silentFallbackWarn=t.silentFallbackWarn||e.silentFallbackWarn,e.formatFallbackMessages=t.formatFallbackMessages||e.formatFallbackMessages,e.postTranslation=t.postTranslation||e.postTranslation,e.warnHtmlInMessage=t.warnHtmlInMessage||e.warnHtmlInMessage,e.escapeParameterHtml=t.escapeParameterHtml||e.escapeParameterHtml,e.sync=t.sync||e.sync,e.__composer[rc](t.pluralizationRules||e.pluralizationRules);const n=lc(e.locale,{messages:t.messages,__i18n:t.__i18n});return Object.keys(n).forEach((t=>e.mergeLocaleMessage(t,n[t]))),t.datetimeFormats&&Object.keys(t.datetimeFormats).forEach((n=>e.mergeDateTimeFormat(n,t.datetimeFormats[n]))),t.numberFormats&&Object.keys(t.numberFormats).forEach((n=>e.mergeNumberFormat(n,t.numberFormats[n]))),e}const $c=bo("global-vue-i18n");function Tc(e={}){const t=Br();if(null==t)throw ec(Zl.MUST_BE_CALL_SETUP_TOP);if(!t.isCE&&null!=t.appContext.app&&!t.appContext.app.__VUE_I18N_SYMBOL__)throw ec(Zl.NOT_INSTALLED);const n=function(e){{const t=qs(e.isCE?$c:e.appContext.app.__VUE_I18N_SYMBOL__);if(!t)throw ec(e.isCE?Zl.NOT_INSTALLED_WITH_PROVIDE:Zl.UNEXPECTED_ERROR);return t}}(t),s=function(e){return"composition"===e.mode?e.global:e.global.__composer}(n),r=cc(t),i=function(e,t){return Co(e)?"__i18n"in t?"local":"global":e.useScope?e.useScope:"local"}(e,r);if(__VUE_I18N_LEGACY_API__&&"legacy"===n.mode&&!e.__useComponent){if(!n.allowComposition)throw ec(Zl.NOT_AVAILABLE_IN_LEGACY_MODE);return function(e,t,n,s={}){const r="local"===t,i=Dt(null);if(r&&e.proxy&&!e.proxy.$options.i18n&&!e.proxy.$options.__i18n)throw ec(Zl.MUST_DEFINE_I18N_OPTION_IN_ALLOW_COMPOSITION);const o=Mo(s.inheritLocale)?s.inheritLocale:!Ro(s.locale),a=Mt(!r||o?n.locale.value:Ro(s.locale)?s.locale:cl),l=Mt(!r||o?n.fallbackLocale.value:Ro(s.fallbackLocale)||Io(s.fallbackLocale)||Bo(s.fallbackLocale)||!1===s.fallbackLocale?s.fallbackLocale:a.value),c=Mt(lc(a.value,s)),u=Mt(Bo(s.datetimeFormats)?s.datetimeFormats:{[a.value]:{}}),d=Mt(Bo(s.numberFormats)?s.numberFormats:{[a.value]:{}}),p=r?n.missingWarn:!Mo(s.missingWarn)&&!So(s.missingWarn)||s.missingWarn,h=r?n.fallbackWarn:!Mo(s.fallbackWarn)&&!So(s.fallbackWarn)||s.fallbackWarn,f=r?n.fallbackRoot:!Mo(s.fallbackRoot)||s.fallbackRoot,m=!!s.fallbackFormat,g=Po(s.missing)?s.missing:null,v=Po(s.postTranslation)?s.postTranslation:null,y=r?n.warnHtmlMessage:!Mo(s.warnHtmlMessage)||s.warnHtmlMessage,k=!!s.escapeParameter,b=r?n.modifiers:Bo(s.modifiers)?s.modifiers:{},w=s.pluralRules||r&&n.pluralRules;function _(){return[a.value,l.value,c.value,u.value,d.value]}const E=ei({get:()=>i.value?i.value.locale.value:a.value,set:e=>{i.value&&(i.value.locale.value=e),a.value=e}}),x=ei({get:()=>i.value?i.value.fallbackLocale.value:l.value,set:e=>{i.value&&(i.value.fallbackLocale.value=e),l.value=e}}),S=ei((()=>i.value?i.value.messages.value:c.value)),C=ei((()=>u.value)),A=ei((()=>d.value));function $(){return i.value?i.value.getPostTranslationHandler():v}function T(e){i.value&&i.value.setPostTranslationHandler(e)}function L(){return i.value?i.value.getMissingHandler():g}function O(e){i.value&&i.value.setMissingHandler(e)}function N(e){return _(),e()}function I(...e){return i.value?N((()=>Reflect.apply(i.value.t,null,[...e]))):N((()=>""))}function P(...e){return i.value?Reflect.apply(i.value.rt,null,[...e]):""}function R(...e){return i.value?N((()=>Reflect.apply(i.value.d,null,[...e]))):N((()=>""))}function M(...e){return i.value?N((()=>Reflect.apply(i.value.n,null,[...e]))):N((()=>""))}function D(e){return i.value?i.value.tm(e):{}}function U(e,t){return!!i.value&&i.value.te(e,t)}function F(e){return i.value?i.value.getLocaleMessage(e):{}}function j(e,t){i.value&&(i.value.setLocaleMessage(e,t),c.value[e]=t)}function B(e,t){i.value&&i.value.mergeLocaleMessage(e,t)}function q(e){return i.value?i.value.getDateTimeFormat(e):{}}function W(e,t){i.value&&(i.value.setDateTimeFormat(e,t),u.value[e]=t)}function H(e,t){i.value&&i.value.mergeDateTimeFormat(e,t)}function V(e){return i.value?i.value.getNumberFormat(e):{}}function K(e,t){i.value&&(i.value.setNumberFormat(e,t),d.value[e]=t)}function z(e,t){i.value&&i.value.mergeNumberFormat(e,t)}const G={get id(){return i.value?i.value.id:-1},locale:E,fallbackLocale:x,messages:S,datetimeFormats:C,numberFormats:A,get inheritLocale(){return i.value?i.value.inheritLocale:o},set inheritLocale(e){i.value&&(i.value.inheritLocale=e)},get availableLocales(){return i.value?i.value.availableLocales:Object.keys(c.value)},get modifiers(){return i.value?i.value.modifiers:b},get pluralRules(){return i.value?i.value.pluralRules:w},get isGlobal(){return!!i.value&&i.value.isGlobal},get missingWarn(){return i.value?i.value.missingWarn:p},set missingWarn(e){i.value&&(i.value.missingWarn=e)},get fallbackWarn(){return i.value?i.value.fallbackWarn:h},set fallbackWarn(e){i.value&&(i.value.missingWarn=e)},get fallbackRoot(){return i.value?i.value.fallbackRoot:f},set fallbackRoot(e){i.value&&(i.value.fallbackRoot=e)},get fallbackFormat(){return i.value?i.value.fallbackFormat:m},set fallbackFormat(e){i.value&&(i.value.fallbackFormat=e)},get warnHtmlMessage(){return i.value?i.value.warnHtmlMessage:y},set warnHtmlMessage(e){i.value&&(i.value.warnHtmlMessage=e)},get escapeParameter(){return i.value?i.value.escapeParameter:k},set escapeParameter(e){i.value&&(i.value.escapeParameter=e)},t:I,getPostTranslationHandler:$,setPostTranslationHandler:T,getMissingHandler:L,setMissingHandler:O,rt:P,d:R,n:M,tm:D,te:U,getLocaleMessage:F,setLocaleMessage:j,mergeLocaleMessage:B,getDateTimeFormat:q,setDateTimeFormat:W,mergeDateTimeFormat:H,getNumberFormat:V,setNumberFormat:K,mergeNumberFormat:z};function Y(e){e.locale.value=a.value,e.fallbackLocale.value=l.value,Object.keys(c.value).forEach((t=>{e.mergeLocaleMessage(t,c.value[t])})),Object.keys(u.value).forEach((t=>{e.mergeDateTimeFormat(t,u.value[t])})),Object.keys(d.value).forEach((t=>{e.mergeNumberFormat(t,d.value[t])})),e.escapeParameter=k,e.fallbackFormat=m,e.fallbackRoot=f,e.fallbackWarn=h,e.missingWarn=p,e.warnHtmlMessage=y}return as((()=>{if(null==e.proxy||null==e.proxy.$i18n)throw ec(Zl.NOT_AVAILABLE_COMPOSITION_IN_LEGACY);const n=i.value=e.proxy.$i18n.__composer;"global"===t?(a.value=n.locale.value,l.value=n.fallbackLocale.value,c.value=n.messages.value,u.value=n.datetimeFormats.value,d.value=n.numberFormats.value):r&&Y(n)})),G}(t,i,s,e)}if("global"===i)return uc(s,e,r),s;if("parent"===i){let r=function(e,t,n=!1){let s=null;const r=t.root;let i=function(e,t=!1){if(null==e)return null;return t&&e.vnode.ctx||e.parent}(t,n);for(;null!=i;){const t=e;if("composition"===e.mode)s=t.__getInstance(i);else if(__VUE_I18N_LEGACY_API__){const e=t.__getInstance(i);null!=e&&(s=e.__composer,n&&s&&!s[ic]&&(s=null))}if(null!=s)break;if(r===i)break;i=i.parent}return s}(n,t,e.__useComponent);return null==r&&(r=s),r}const o=n;let a=o.__getInstance(t);if(null==a){const n=Ao({},e);"__i18n"in r&&(n.__i18n=r.__i18n),s&&(n.__root=s),a=gc(n),o.__composerExtend&&(a[oc]=o.__composerExtend(a)),function(e,t,n){ls((()=>{}),t),ps((()=>{const s=n;e.__deleteInstance(t);const r=s[oc];r&&(r(),delete s[oc])}),t)}(o,t,a),o.__setInstance(t,a)}return a}const Lc=["locale","fallbackLocale","availableLocales"],Oc=["t","rt","d","n","tm","te"];var Nc;if("boolean"!=typeof __VUE_I18N_FULL_INSTALL__&&(To().__VUE_I18N_FULL_INSTALL__=!0),"boolean"!=typeof __VUE_I18N_LEGACY_API__&&(To().__VUE_I18N_LEGACY_API__=!0),"boolean"!=typeof __INTLIFY_JIT_COMPILATION__&&(To().__INTLIFY_JIT_COMPILATION__=!1),"boolean"!=typeof __INTLIFY_DROP_MESSAGE_COMPILER__&&(To().__INTLIFY_DROP_MESSAGE_COMPILER__=!1),"boolean"!=typeof __INTLIFY_PROD_DEVTOOLS__&&(To().__INTLIFY_PROD_DEVTOOLS__=!1),__INTLIFY_JIT_COMPILATION__?ml((function(e,t){if(__INTLIFY_JIT_COMPILATION__&&!__INTLIFY_DROP_MESSAGE_COMPILER__&&Ro(e)){!Mo(t.warnHtmlMessage)||t.warnHtmlMessage;const n=(t.onCacheKey||Tl)(e),s=Ll[n];if(s)return s;const{ast:r,detectError:i}=Nl(e,c(l({},t),{location:!1,jit:!0})),o=Cl(r);return i?o:Ll[n]=o}{const t=e.cacheKey;if(t){return Ll[t]||(Ll[t]=Cl(e))}return Cl(e)}})):ml(Il),hl=function(e,t){if(!Do(e))return null;let n=Pa.get(t);if(n||(n=function(e){const t=[];let n,s,r,i,o,a,l,c=-1,u=0,d=0;const p=[];function h(){const t=e[c+1];if(5===u&&"'"===t||6===u&&'"'===t)return c++,r="\\"+t,p[0](),!0}for(p[0]=()=>{void 0===s?s=r:s+=r},p[1]=()=>{void 0!==s&&(t.push(s),s=void 0)},p[2]=()=>{p[0](),d++},p[3]=()=>{if(d>0)d--,u=4,p[0]();else{if(d=0,void 0===s)return!1;if(s=Ia(s),!1===s)return!1;p[1]()}};null!==u;)if(c++,n=e[c],"\\"!==n||!h()){if(i=Na(n),l=La[u],o=l[i]||l.l||8,8===o)return;if(u=o[0],void 0!==o[1]&&(a=p[o[1]],a&&(r=n,!1===a())))return;if(7===u)return t}}(t),n&&Pa.set(t,n)),!n)return null;const s=n.length;let r=e,i=0;for(;i<s;){const e=r[n[i]];if(void 0===e)return null;if(Po(r))return null;r=e,i++}return r},fl=sl,__INTLIFY_PROD_DEVTOOLS__){const e=To();e.__INTLIFY__=!0,Nc=e.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__,Wa=Nc}var Ic,Pc,Rc,Mc,Dc=Object.defineProperty,Uc=Object.defineProperties,Fc=Object.getOwnPropertyDescriptors,jc=Object.getOwnPropertySymbols,Bc=Object.prototype.hasOwnProperty,qc=Object.prototype.propertyIsEnumerable,Wc=(e,t,n)=>t in e?Dc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Hc=(e,t)=>{for(var n in t||(t={}))Bc.call(t,n)&&Wc(e,n,t[n]);if(jc)for(var n of jc(t))qc.call(t,n)&&Wc(e,n,t[n]);return e},Vc=(e,t)=>Uc(e,Fc(t)),Kc=(e,t,n)=>(Wc(e,"symbol"!=typeof t?t+"":t,n),n),zc=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},Gc=(e,t,n)=>(((e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)})(e,t,"access private method"),n),Yc=(e,t,n)=>new Promise(((s,r)=>{var i=e=>{try{a(n.next(e))}catch(t){r(t)}},o=e=>{try{a(n.throw(e))}catch(t){r(t)}},a=e=>e.done?s(e.value):Promise.resolve(e.value).then(i,o);a((n=n.apply(e,t)).next())}));class Qc{constructor(e={}){Kc(this,"baseUrl","/api/v2"),Kc(this,"securityData",null),Kc(this,"securityWorker"),Kc(this,"abortControllers",new Map),Kc(this,"customFetch",((...e)=>fetch(...e))),Kc(this,"baseApiParams",{credentials:"same-origin",headers:{},redirect:"follow",referrerPolicy:"no-referrer"}),Kc(this,"setSecurityData",(e=>{this.securityData=e})),Kc(this,"contentFormatters",{"application/json":e=>null===e||"object"!=typeof e&&"string"!=typeof e?e:JSON.stringify(e),"text/plain":e=>null!==e&&"string"!=typeof e?JSON.stringify(e):e,"multipart/form-data":e=>Object.keys(e||{}).reduce(((t,n)=>{const s=e[n];return t.append(n,s instanceof Blob?s:"object"==typeof s&&null!==s?JSON.stringify(s):`${s}`),t}),new FormData),"application/x-www-form-urlencoded":e=>this.toQueryString(e)}),Kc(this,"createAbortSignal",(e=>{if(this.abortControllers.has(e)){const t=this.abortControllers.get(e);return t?t.signal:void 0}const t=new AbortController;return this.abortControllers.set(e,t),t.signal})),Kc(this,"abortRequest",(e=>{const t=this.abortControllers.get(e);t&&(t.abort(),this.abortControllers.delete(e))})),Kc(this,"request",(e=>Yc(this,null,(function*(){var t=e,{body:n,secure:s,path:r,type:i,query:o,format:a,baseUrl:l,cancelToken:c}=t,u=((e,t)=>{var n={};for(var s in e)Bc.call(e,s)&&t.indexOf(s)<0&&(n[s]=e[s]);if(null!=e&&jc)for(var s of jc(e))t.indexOf(s)<0&&qc.call(e,s)&&(n[s]=e[s]);return n})(t,["body","secure","path","type","query","format","baseUrl","cancelToken"]);const d=("boolean"==typeof s?s:this.baseApiParams.secure)&&this.securityWorker&&(yield this.securityWorker(this.securityData))||{},p=this.mergeRequestParams(u,d),h=o&&this.toQueryString(o),f=this.contentFormatters[i||"application/json"],m=a||p.format;return this.customFetch(`${l||this.baseUrl||""}${r}${h?`?${h}`:""}`,Vc(Hc({},p),{headers:Hc(Hc({},p.headers||{}),i&&"multipart/form-data"!==i?{"Content-Type":i}:{}),signal:(c?this.createAbortSignal(c):p.signal)||null,body:null==n?null:f(n)})).then((e=>Yc(this,null,(function*(){const t=e;t.data=null,t.error=null;const n=m?yield e[m]().then((e=>(t.ok?t.data=e:t.error=e,t))).catch((e=>(t.error=e,t))):t;if(c&&this.abortControllers.delete(c),!e.ok)throw n;return n}))))})))),Object.assign(this,e)}encodeQueryParam(e,t){return`${encodeURIComponent(e)}=${encodeURIComponent("number"==typeof t?t:`${t}`)}`}addQueryParam(e,t){return this.encodeQueryParam(t,e[t])}addArrayQueryParam(e,t){return e[t].map((e=>this.encodeQueryParam(t,e))).join("&")}toQueryString(e){const t=e||{};return Object.keys(t).filter((e=>void 0!==t[e])).map((e=>Array.isArray(t[e])?this.addArrayQueryParam(t,e):this.addQueryParam(t,e))).join("&")}addQueryParams(e){const t=this.toQueryString(e);return t?`?${t}`:""}mergeRequestParams(e,t){return Vc(Hc(Hc(Hc({},this.baseApiParams),e),t||{}),{headers:Hc(Hc(Hc({},this.baseApiParams.headers||{}),e.headers||{}),t&&t.headers||{})})}}
|
||
/**
|
||
* @title Artalk API
|
||
* @version 2.0
|
||
* @license MIT (https://github.com/ArtalkJS/Artalk/blob/master/LICENSE)
|
||
* @baseUrl /api/v2
|
||
* @contact API Support <artalkjs@gmail.com> (https://artalk.js.org)
|
||
*
|
||
* Artalk is a modern comment system based on Golang.
|
||
*/let Xc=class extends Qc{constructor(){super(...arguments),Kc(this,"auth",{loginByEmail:(e,t={})=>this.request(Hc({path:"/auth/email/login",method:"POST",body:e,type:"application/json",format:"json"},t)),registerByEmail:(e,t={})=>this.request(Hc({path:"/auth/email/register",method:"POST",body:e,type:"application/json",format:"json"},t)),sendVerifyEmail:(e,t={})=>this.request(Hc({path:"/auth/email/send",method:"POST",body:e,type:"application/json",format:"json"},t)),checkDataMerge:(e={})=>this.request(Hc({path:"/auth/merge",method:"GET",secure:!0,format:"json"},e)),applyDataMerge:(e,t={})=>this.request(Hc({path:"/auth/merge",method:"POST",body:e,secure:!0,type:"application/json",format:"json"},t))}),Kc(this,"cache",{flushCache:(e={})=>this.request(Hc({path:"/cache/flush",method:"POST",secure:!0,format:"json"},e)),warmUpCache:(e={})=>this.request(Hc({path:"/cache/warm_up",method:"POST",secure:!0,format:"json"},e))}),Kc(this,"captcha",{getCaptcha:(e={})=>this.request(Hc({path:"/captcha",method:"GET",format:"json"},e)),getCaptchaStatus:(e={})=>this.request(Hc({path:"/captcha/status",method:"GET",format:"json"},e)),verifyCaptcha:(e,t={})=>this.request(Hc({path:"/captcha/verify",method:"POST",body:e,type:"application/json",format:"json"},t))}),Kc(this,"comments",{getComments:(e,t={})=>this.request(Hc({path:"/comments",method:"GET",query:e,secure:!0,type:"application/json",format:"json"},t)),createComment:(e,t={})=>this.request(Hc({path:"/comments",method:"POST",body:e,secure:!0,type:"application/json",format:"json"},t)),getComment:(e,t={})=>this.request(Hc({path:`/comments/${e}`,method:"GET",type:"application/json",format:"json"},t)),updateComment:(e,t,n={})=>this.request(Hc({path:`/comments/${e}`,method:"PUT",body:t,secure:!0,type:"application/json",format:"json"},n)),deleteComment:(e,t={})=>this.request(Hc({path:`/comments/${e}`,method:"DELETE",secure:!0,format:"json"},t))}),Kc(this,"conf",{conf:(e={})=>this.request(Hc({path:"/conf",method:"GET",format:"json"},e)),getSocialLoginProviders:(e={})=>this.request(Hc({path:"/conf/auth/providers",method:"GET",format:"json"},e)),getDomain:(e,t={})=>this.request(Hc({path:"/conf/domain",method:"GET",query:e,format:"json"},t))}),Kc(this,"notifies",{getNotifies:(e,t={})=>this.request(Hc({path:"/notifies",method:"GET",query:e,type:"application/json",format:"json"},t)),markAllNotifyRead:(e,t={})=>this.request(Hc({path:"/notifies/read",method:"POST",body:e,type:"application/json",format:"json"},t)),markNotifyRead:(e,t,n={})=>this.request(Hc({path:`/notifies/${e}/${t}`,method:"POST",format:"json"},n))}),Kc(this,"pages",{getPages:(e,t={})=>this.request(Hc({path:"/pages",method:"GET",query:e,secure:!0,type:"application/json",format:"json"},t)),fetchAllPages:(e,t={})=>this.request(Hc({path:"/pages/fetch",method:"POST",body:e,secure:!0,type:"application/json",format:"json"},t)),getPageFetchStatus:(e={})=>this.request(Hc({path:"/pages/fetch/status",method:"GET",secure:!0,format:"json"},e)),logPv:(e,t={})=>this.request(Hc({path:"/pages/pv",method:"POST",body:e,type:"application/json",format:"json"},t)),updatePage:(e,t,n={})=>this.request(Hc({path:`/pages/${e}`,method:"PUT",body:t,secure:!0,type:"application/json",format:"json"},n)),deletePage:(e,t={})=>this.request(Hc({path:`/pages/${e}`,method:"DELETE",secure:!0,format:"json"},t)),fetchPage:(e,t={})=>this.request(Hc({path:`/pages/${e}/fetch`,method:"POST",secure:!0,type:"application/json",format:"json"},t))}),Kc(this,"sendEmail",{sendEmail:(e,t={})=>this.request(Hc({path:"/send_email",method:"POST",body:e,secure:!0,type:"application/json",format:"json"},t))}),Kc(this,"settings",{getSettings:(e={})=>this.request(Hc({path:"/settings",method:"GET",secure:!0,format:"json"},e)),applySettings:(e,t={})=>this.request(Hc({path:"/settings",method:"PUT",body:e,secure:!0,type:"application/json",format:"json"},t)),getSettingsTemplate:(e,t={})=>this.request(Hc({path:`/settings/template/${e}`,method:"GET",secure:!0,format:"json"},t))}),Kc(this,"sites",{getSites:(e={})=>this.request(Hc({path:"/sites",method:"GET",secure:!0,format:"json"},e)),createSite:(e,t={})=>this.request(Hc({path:"/sites",method:"POST",body:e,secure:!0,type:"application/json",format:"json"},t)),updateSite:(e,t,n={})=>this.request(Hc({path:`/sites/${e}`,method:"PUT",body:t,secure:!0,type:"application/json",format:"json"},n)),deleteSite:(e,t={})=>this.request(Hc({path:`/sites/${e}`,method:"DELETE",secure:!0,format:"json"},t))}),Kc(this,"stats",{getStats:(e,t,n={})=>this.request(Hc({path:`/stats/${e}`,method:"GET",query:t,type:"application/json",format:"json"},n))}),Kc(this,"transfer",{exportArtrans:(e={})=>this.request(Hc({path:"/transfer/export",method:"GET",secure:!0,format:"json"},e)),importArtrans:(e,t={})=>this.request(Hc({path:"/transfer/import",method:"POST",body:e,secure:!0,type:"application/json"},t)),uploadArtrans:(e,t={})=>this.request(Hc({path:"/transfer/upload",method:"POST",body:e,secure:!0,type:"multipart/form-data",format:"json"},t))}),Kc(this,"upload",{upload:(e,t={})=>this.request(Hc({path:"/upload",method:"POST",body:e,secure:!0,type:"multipart/form-data",format:"json"},t))}),Kc(this,"user",{getUser:(e,t={})=>this.request(Hc({path:"/user",method:"GET",query:e,secure:!0,format:"json"},t)),login:(e,t={})=>this.request(Hc({path:"/user/access_token",method:"POST",body:e,type:"application/json",format:"json"},t)),getUserStatus:(e,t={})=>this.request(Hc({path:"/user/status",method:"GET",query:e,secure:!0,format:"json"},t))}),Kc(this,"users",{createUser:(e,t={})=>this.request(Hc({path:"/users",method:"POST",body:e,secure:!0,type:"application/json",format:"json"},t)),updateUser:(e,t,n={})=>this.request(Hc({path:`/users/${e}`,method:"PUT",body:t,secure:!0,type:"application/json",format:"json"},n)),deleteUser:(e,t={})=>this.request(Hc({path:`/users/${e}`,method:"DELETE",secure:!0,format:"json"},t)),getUsers:(e,t,n={})=>this.request(Hc({path:`/users/${e}`,method:"GET",query:t,secure:!0,type:"application/json",format:"json"},n))}),Kc(this,"version",{getVersion:(e={})=>this.request(Hc({path:"/version",method:"GET",format:"json"},e))}),Kc(this,"votes",{syncVotes:(e={})=>this.request(Hc({path:"/votes/sync",method:"POST",secure:!0,format:"json"},e)),vote:(e,t,n,s={})=>this.request(Hc({path:`/votes/${e}/${t}`,method:"POST",body:n,type:"application/json",format:"json"},s))})}};var Jc="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Zc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}!function(){function e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function t(e,t){for(var n=0;n<t.length;n++){var s=t[n];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,s.key,s)}}function n(e,n,s){return n&&t(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&i(e,t)}function r(e){return(r=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function i(e,t){return(i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function o(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function a(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function l(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return a(e)}function c(e){var t=o();return function(){var n,s=r(e);if(t){var i=r(this).constructor;n=Reflect.construct(s,arguments,i)}else n=s.apply(this,arguments);return l(this,n)}}function u(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=r(e)););return e}function d(){return d="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var s=u(e,t);if(s){var r=Object.getOwnPropertyDescriptor(s,t);return r.get?r.get.call(arguments.length<3?e:n):r.value}},d.apply(this,arguments)}var p=function(){function t(){e(this,t),Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}return n(t,[{key:"addEventListener",value:function(e,t,n){e in this.listeners||(this.listeners[e]=[]),this.listeners[e].push({callback:t,options:n})}},{key:"removeEventListener",value:function(e,t){if(e in this.listeners)for(var n=this.listeners[e],s=0,r=n.length;s<r;s++)if(n[s].callback===t)return void n.splice(s,1)}},{key:"dispatchEvent",value:function(e){if(e.type in this.listeners){for(var t=this.listeners[e.type].slice(),n=0,s=t.length;n<s;n++){var r=t[n];try{r.callback.call(this,e)}catch(i){Promise.resolve().then((function(){throw i}))}r.options&&r.options.once&&this.removeEventListener(e.type,r.callback)}return!e.defaultPrevented}}}]),t}(),h=function(t){s(o,t);var i=c(o);function o(){var t;return e(this,o),(t=i.call(this)).listeners||p.call(a(t)),Object.defineProperty(a(t),"aborted",{value:!1,writable:!0,configurable:!0}),Object.defineProperty(a(t),"onabort",{value:null,writable:!0,configurable:!0}),Object.defineProperty(a(t),"reason",{value:void 0,writable:!0,configurable:!0}),t}return n(o,[{key:"toString",value:function(){return"[object AbortSignal]"}},{key:"dispatchEvent",value:function(e){"abort"===e.type&&(this.aborted=!0,"function"==typeof this.onabort&&this.onabort.call(this,e)),d(r(o.prototype),"dispatchEvent",this).call(this,e)}}]),o}(p),f=function(){function t(){e(this,t),Object.defineProperty(this,"signal",{value:new h,writable:!0,configurable:!0})}return n(t,[{key:"abort",value:function(e){var t;try{t=new Event("abort")}catch(s){"undefined"!=typeof document?document.createEvent?(t=document.createEvent("Event")).initEvent("abort",!1,!1):(t=document.createEventObject()).type="abort":t={type:"abort",bubbles:!1,cancelable:!1}}var n=e;if(void 0===n)if("undefined"==typeof document)(n=new Error("This operation was aborted")).name="AbortError";else try{n=new DOMException("signal is aborted without reason")}catch(r){(n=new Error("This operation was aborted")).name="AbortError"}this.signal.reason=n,this.signal.dispatchEvent(t)}},{key:"toString",value:function(){return"[object AbortController]"}}]),t}();function m(e){return e.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL?(console.log("__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL=true is set, will force install polyfill"),!0):"function"==typeof e.Request&&!e.Request.prototype.hasOwnProperty("signal")||!e.AbortController}function g(e){"function"==typeof e&&(e={fetch:e});var t=e,n=t.fetch,s=t.Request,r=void 0===s?n.Request:s,i=t.AbortController,o=t.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL,a=void 0!==o&&o;if(!m({fetch:n,Request:r,AbortController:i,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:a}))return{fetch:n,Request:l};var l=r;(l&&!l.prototype.hasOwnProperty("signal")||a)&&((l=function(e,t){var n;t&&t.signal&&(n=t.signal,delete t.signal);var s=new r(e,t);return n&&Object.defineProperty(s,"signal",{writable:!1,enumerable:!1,configurable:!0,value:n}),s}).prototype=r.prototype);var c=n;return{fetch:function(e,t){var n=l&&l.prototype.isPrototypeOf(e)?e.signal:t?t.signal:void 0;if(n){var s;try{s=new DOMException("Aborted","AbortError")}catch(i){(s=new Error("Aborted")).name="AbortError"}if(n.aborted)return Promise.reject(s);var r=new Promise((function(e,t){n.addEventListener("abort",(function(){return t(s)}),{once:!0})}));return t&&t.signal&&delete t.signal,Promise.race([r,c(e,t)])}return c(e,t)},Request:l}}"undefined"!=typeof Symbol&&Symbol.toStringTag&&(f.prototype[Symbol.toStringTag]="AbortController",h.prototype[Symbol.toStringTag]="AbortSignal"),function(e){if(m(e))if(e.fetch){var t=g(e),n=t.fetch,s=t.Request;e.fetch=n,e.Request=s,Object.defineProperty(e,"AbortController",{writable:!0,enumerable:!1,configurable:!0,value:f}),Object.defineProperty(e,"AbortSignal",{writable:!0,enumerable:!1,configurable:!0,value:h})}else console.warn("fetch() is not available, cannot install abortcontroller-polyfill")}("undefined"!=typeof self?self:Jc)}();const eu=(e,t,n)=>Yc(void 0,null,(function*(){const s=e.getApiToken&&e.getApiToken(),r=new Headers(Hc({Authorization:s?`Bearer ${s}`:""},null==n?void 0:n.headers));r.get("Authorization")||r.delete("Authorization");const i=yield fetch(t,Vc(Hc({},n),{headers:r}));if(!i.ok){const s=(yield i.json().catch((()=>{})))||{};let r=!1;if(e.handlers&&(yield e.handlers.get().reduce(((e,t)=>Yc(void 0,null,(function*(){yield e,!0===s[t.action]&&(yield t.handler(s),r=!0)}))),Promise.resolve())),r)return eu(e,t,n);throw function(e,t){const n=new tu;return n.message=t.msg||t.message||"fetch error",n.code=e,n.data=t,console.error(n),n}(i.status,s)}return i}));class tu extends Error{constructor(){super(...arguments),Kc(this,"code",0),Kc(this,"message","fetch error"),Kc(this,"data")}}class nu extends Xc{constructor(e){super({baseUrl:e.baseURL,customFetch:(t,n)=>eu(e,t,n)}),Kc(this,"_opts"),this._opts=e}getUserFields(){const e=this._opts.userInfo;if((null==e?void 0:e.name)&&(null==e?void 0:e.email))return{name:e.name,email:e.email}}}function su(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}let ru={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};function iu(e){ru=e}const ou=/[&<>"']/,au=new RegExp(ou.source,"g"),lu=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,cu=new RegExp(lu.source,"g"),uu={"&":"&","<":"<",">":">",'"':""","'":"'"},du=e=>uu[e];function pu(e,t){if(t){if(ou.test(e))return e.replace(au,du)}else if(lu.test(e))return e.replace(cu,du);return e}const hu=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;const fu=/(^|[^\[])\^/g;function mu(e,t){let n="string"==typeof e?e:e.source;t=t||"";const s={replace:(e,t)=>{let r="string"==typeof t?t:t.source;return r=r.replace(fu,"$1"),n=n.replace(e,r),s},getRegex:()=>new RegExp(n,t)};return s}function gu(e){try{e=encodeURI(e).replace(/%25/g,"%")}catch(t){return null}return e}const vu={exec:()=>null};function yu(e,t){const n=e.replace(/\|/g,((e,t,n)=>{let s=!1,r=t;for(;--r>=0&&"\\"===n[r];)s=!s;return s?"|":" |"})).split(/ \|/);let s=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length<t;)n.push("");for(;s<n.length;s++)n[s]=n[s].trim().replace(/\\\|/g,"|");return n}function ku(e,t,n){const s=e.length;if(0===s)return"";let r=0;for(;r<s;){const i=e.charAt(s-r-1);if(i!==t||n){if(i===t||!n)break;r++}else r++}return e.slice(0,s-r)}function bu(e,t,n,s){const r=t.href,i=t.title?pu(t.title):null,o=e[1].replace(/\\([\[\]])/g,"$1");if("!"!==e[0].charAt(0)){s.state.inLink=!0;const e={type:"link",raw:n,href:r,title:i,text:o,tokens:s.inlineTokens(o)};return s.state.inLink=!1,e}return{type:"image",raw:n,href:r,title:i,text:pu(o)}}class wu{constructor(e){Kc(this,"options"),Kc(this,"rules"),Kc(this,"lexer"),this.options=e||ru}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const e=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:ku(e,"\n")}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const e=t[0],n=function(e,t){const n=e.match(/^(\s+)(?:```)/);if(null===n)return t;const s=n[1];return t.split("\n").map((e=>{const t=e.match(/^\s+/);if(null===t)return e;const[n]=t;return n.length>=s.length?e.slice(s.length):e})).join("\n")}(e,t[3]||"");return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:n}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(/#$/.test(e)){const t=ku(e,"#");this.options.pedantic?e=t.trim():t&&!/ $/.test(t)||(e=t.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){let e=t[0].replace(/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,"\n $1");e=ku(e.replace(/^ *>[ \t]?/gm,""),"\n");const n=this.lexer.state.top;this.lexer.state.top=!0;const s=this.lexer.blockTokens(e);return this.lexer.state.top=n,{type:"blockquote",raw:t[0],tokens:s,text:e}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim();const s=n.length>1,r={type:"list",raw:"",ordered:s,start:s?+n.slice(0,-1):"",loose:!1,items:[]};n=s?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=s?n:"[*+-]");const i=new RegExp(`^( {0,3}${n})((?:[\t ][^\\n]*)?(?:\\n|$))`);let o="",a="",l=!1;for(;e;){let n=!1;if(!(t=i.exec(e)))break;if(this.rules.block.hr.test(e))break;o=t[0],e=e.substring(o.length);let s=t[2].split("\n",1)[0].replace(/^\t+/,(e=>" ".repeat(3*e.length))),c=e.split("\n",1)[0],u=0;this.options.pedantic?(u=2,a=s.trimStart()):(u=t[2].search(/[^ ]/),u=u>4?1:u,a=s.slice(u),u+=t[1].length);let d=!1;if(!s&&/^ *$/.test(c)&&(o+=c+"\n",e=e.substring(c.length+1),n=!0),!n){const t=new RegExp(`^ {0,${Math.min(3,u-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),n=new RegExp(`^ {0,${Math.min(3,u-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),r=new RegExp(`^ {0,${Math.min(3,u-1)}}(?:\`\`\`|~~~)`),i=new RegExp(`^ {0,${Math.min(3,u-1)}}#`);for(;e;){const l=e.split("\n",1)[0];if(c=l,this.options.pedantic&&(c=c.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),r.test(c))break;if(i.test(c))break;if(t.test(c))break;if(n.test(e))break;if(c.search(/[^ ]/)>=u||!c.trim())a+="\n"+c.slice(u);else{if(d)break;if(s.search(/[^ ]/)>=4)break;if(r.test(s))break;if(i.test(s))break;if(n.test(s))break;a+="\n"+c}d||c.trim()||(d=!0),o+=l+"\n",e=e.substring(l.length+1),s=c.slice(u)}}r.loose||(l?r.loose=!0:/\n *\n *$/.test(o)&&(l=!0));let p,h=null;this.options.gfm&&(h=/^\[[ xX]\] /.exec(a),h&&(p="[ ] "!==h[0],a=a.replace(/^\[[ xX]\] +/,""))),r.items.push({type:"list_item",raw:o,task:!!h,checked:p,loose:!1,text:a,tokens:[]}),r.raw+=o}r.items[r.items.length-1].raw=o.trimEnd(),r.items[r.items.length-1].text=a.trimEnd(),r.raw=r.raw.trimEnd();for(let e=0;e<r.items.length;e++)if(this.lexer.state.top=!1,r.items[e].tokens=this.lexer.blockTokens(r.items[e].text,[]),!r.loose){const t=r.items[e].tokens.filter((e=>"space"===e.type)),n=t.length>0&&t.some((e=>/\n.*\n/.test(e.raw)));r.loose=n}if(r.loose)for(let e=0;e<r.items.length;e++)r.items[e].loose=!0;return r}}html(e){const t=this.rules.block.html.exec(e);if(t){return{type:"html",block:!0,raw:t[0],pre:"pre"===t[1]||"script"===t[1]||"style"===t[1],text:t[0]}}}def(e){const t=this.rules.block.def.exec(e);if(t){const e=t[1].toLowerCase().replace(/\s+/g," "),n=t[2]?t[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",s=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:n,title:s}}}table(e){const t=this.rules.block.table.exec(e);if(!t)return;if(!/[:|]/.test(t[2]))return;const n=yu(t[1]),s=t[2].replace(/^\||\| *$/g,"").split("|"),r=t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split("\n"):[],i={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===s.length){for(const e of s)/^ *-+: *$/.test(e)?i.align.push("right"):/^ *:-+: *$/.test(e)?i.align.push("center"):/^ *:-+ *$/.test(e)?i.align.push("left"):i.align.push(null);for(const e of n)i.header.push({text:e,tokens:this.lexer.inline(e)});for(const e of r)i.rows.push(yu(e,i.header.length).map((e=>({text:e,tokens:this.lexer.inline(e)}))));return i}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const e="\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:pu(t[1])}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&/^<a /i.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const e=t[2].trim();if(!this.options.pedantic&&/^</.test(e)){if(!/>$/.test(e))return;const t=ku(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{const e=function(e,t){if(-1===e.indexOf(t[1]))return-1;let n=0;for(let s=0;s<e.length;s++)if("\\"===e[s])s++;else if(e[s]===t[0])n++;else if(e[s]===t[1]&&(n--,n<0))return s;return-1}(t[2],"()");if(e>-1){const n=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=""}}let n=t[2],s="";if(this.options.pedantic){const e=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(n);e&&(n=e[1],s=e[3])}else s=t[3]?t[3].slice(1,-1):"";return n=n.trim(),/^</.test(n)&&(n=this.options.pedantic&&!/>$/.test(e)?n.slice(1):n.slice(1,-1)),bu(t,{href:n?n.replace(this.rules.inline.anyPunctuation,"$1"):n,title:s?s.replace(this.rules.inline.anyPunctuation,"$1"):s},t[0],this.lexer)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){const e=t[(n[2]||n[1]).replace(/\s+/g," ").toLowerCase()];if(!e){const e=n[0].charAt(0);return{type:"text",raw:e,text:e}}return bu(n,e,n[0],this.lexer)}}emStrong(e,t,n=""){let s=this.rules.inline.emStrongLDelim.exec(e);if(!s)return;if(s[3]&&n.match(/[\p{L}\p{N}]/u))return;if(!(s[1]||s[2]||"")||!n||this.rules.inline.punctuation.exec(n)){const n=[...s[0]].length-1;let r,i,o=n,a=0;const l="*"===s[0][0]?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(l.lastIndex=0,t=t.slice(-1*e.length+n);null!=(s=l.exec(t));){if(r=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!r)continue;if(i=[...r].length,s[3]||s[4]){o+=i;continue}if((s[5]||s[6])&&n%3&&!((n+i)%3)){a+=i;continue}if(o-=i,o>0)continue;i=Math.min(i,i+o+a);const t=[...s[0]][0].length,l=e.slice(0,n+s.index+t+i);if(Math.min(n,i)%2){const e=l.slice(1,-1);return{type:"em",raw:l,text:e,tokens:this.lexer.inlineTokens(e)}}const c=l.slice(2,-2);return{type:"strong",raw:l,text:c,tokens:this.lexer.inlineTokens(c)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(/\n/g," ");const n=/[^ ]/.test(e),s=/^ /.test(e)&&/ $/.test(e);return n&&s&&(e=e.substring(1,e.length-1)),e=pu(e,!0),{type:"codespan",raw:t[0],text:e}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){const t=this.rules.inline.autolink.exec(e);if(t){let e,n;return"@"===t[2]?(e=pu(t[1]),n="mailto:"+e):(e=pu(t[1]),n=e),{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}url(e){var t,n;let s;if(s=this.rules.inline.url.exec(e)){let e,r;if("@"===s[2])e=pu(s[0]),r="mailto:"+e;else{let i;do{i=s[0],s[0]=null!=(n=null==(t=this.rules.inline._backpedal.exec(s[0]))?void 0:t[0])?n:""}while(i!==s[0]);e=pu(s[0]),r="www."===s[1]?"http://"+s[0]:s[0]}return{type:"link",raw:s[0],text:e,href:r,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){let e;return e=this.lexer.state.inRawBlock?t[0]:pu(t[0]),{type:"text",raw:t[0],text:e}}}}const _u=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Eu=/(?:[*+-]|\d{1,9}[.)])/,xu=mu(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,Eu).replace(/blockCode/g,/ {4}/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).getRegex(),Su=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Cu=/(?!\s*\])(?:\\.|[^\[\]\\])+/,Au=mu(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/).replace("label",Cu).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),$u=mu(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Eu).getRegex(),Tu="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Lu=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Ou=mu("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))","i").replace("comment",Lu).replace("tag",Tu).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Nu=mu(Su).replace("hr",_u).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Tu).getRegex(),Iu={blockquote:mu(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Nu).getRegex(),code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,def:Au,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,hr:_u,html:Ou,lheading:xu,list:$u,newline:/^(?: *(?:\n|$))+/,paragraph:Nu,table:vu,text:/^[^\n]+/},Pu=mu("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",_u).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Tu).getRegex(),Ru=Vc(Hc({},Iu),{table:Pu,paragraph:mu(Su).replace("hr",_u).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Pu).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Tu).getRegex()}),Mu=Vc(Hc({},Iu),{html:mu("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",Lu).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:vu,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:mu(Su).replace("hr",_u).replace("heading"," *#{1,6} *[^\n]").replace("lheading",xu).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()}),Du=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Uu=/^( {2,}|\\)\n(?!\s*$)/,Fu="\\p{P}\\p{S}",ju=mu(/^((?![*_])[\spunctuation])/,"u").replace(/punctuation/g,Fu).getRegex(),Bu=mu(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,"u").replace(/punct/g,Fu).getRegex(),qu=mu("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])","gu").replace(/punct/g,Fu).getRegex(),Wu=mu("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])","gu").replace(/punct/g,Fu).getRegex(),Hu=mu(/\\([punct])/,"gu").replace(/punct/g,Fu).getRegex(),Vu=mu(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Ku=mu(Lu).replace("(?:--\x3e|$)","--\x3e").getRegex(),zu=mu("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Ku).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Gu=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Yu=mu(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",Gu).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Qu=mu(/^!?\[(label)\]\[(ref)\]/).replace("label",Gu).replace("ref",Cu).getRegex(),Xu=mu(/^!?\[(ref)\](?:\[\])?/).replace("ref",Cu).getRegex(),Ju={_backpedal:vu,anyPunctuation:Hu,autolink:Vu,blockSkip:/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g,br:Uu,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,del:vu,emStrongLDelim:Bu,emStrongRDelimAst:qu,emStrongRDelimUnd:Wu,escape:Du,link:Yu,nolink:Xu,punctuation:ju,reflink:Qu,reflinkSearch:mu("reflink|nolink(?!\\()","g").replace("reflink",Qu).replace("nolink",Xu).getRegex(),tag:zu,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,url:vu},Zu=Vc(Hc({},Ju),{link:mu(/^!?\[(label)\]\((.*?)\)/).replace("label",Gu).getRegex(),reflink:mu(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Gu).getRegex()}),ed=Vc(Hc({},Ju),{escape:mu(Du).replace("])","~|])").getRegex(),url:mu(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/}),td=Vc(Hc({},ed),{br:mu(Uu).replace("{2,}","*").getRegex(),text:mu(ed.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()}),nd={normal:Iu,gfm:Ru,pedantic:Mu},sd={normal:Ju,gfm:ed,breaks:td,pedantic:Zu};class rd{constructor(e){Kc(this,"tokens"),Kc(this,"options"),Kc(this,"state"),Kc(this,"tokenizer"),Kc(this,"inlineQueue"),this.tokens=[],this.tokens.links=Object.create(null),this.options=e||ru,this.options.tokenizer=this.options.tokenizer||new wu,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const t={block:nd.normal,inline:sd.normal};this.options.pedantic?(t.block=nd.pedantic,t.inline=sd.pedantic):this.options.gfm&&(t.block=nd.gfm,this.options.breaks?t.inline=sd.breaks:t.inline=sd.gfm),this.tokenizer.rules=t}static get rules(){return{block:nd,inline:sd}}static lex(e,t){return new rd(t).lex(e)}static lexInline(e,t){return new rd(t).inlineTokens(e)}lex(e){e=e.replace(/\r\n|\r/g,"\n"),this.blockTokens(e,this.tokens);for(let t=0;t<this.inlineQueue.length;t++){const e=this.inlineQueue[t];this.inlineTokens(e.src,e.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[]){let n,s,r,i;for(e=this.options.pedantic?e.replace(/\t/g," ").replace(/^ +$/gm,""):e.replace(/^( *)(\t+)/gm,((e,t,n)=>t+" ".repeat(n.length)));e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some((s=>!!(n=s.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.space(e))e=e.substring(n.raw.length),1===n.raw.length&&t.length>0?t[t.length-1].raw+="\n":t.push(n);else if(n=this.tokenizer.code(e))e=e.substring(n.raw.length),s=t[t.length-1],!s||"paragraph"!==s.type&&"text"!==s.type?t.push(n):(s.raw+="\n"+n.raw,s.text+="\n"+n.text,this.inlineQueue[this.inlineQueue.length-1].src=s.text);else if(n=this.tokenizer.fences(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.heading(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.hr(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.blockquote(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.list(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.html(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.def(e))e=e.substring(n.raw.length),s=t[t.length-1],!s||"paragraph"!==s.type&&"text"!==s.type?this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title}):(s.raw+="\n"+n.raw,s.text+="\n"+n.raw,this.inlineQueue[this.inlineQueue.length-1].src=s.text);else if(n=this.tokenizer.table(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.lheading(e))e=e.substring(n.raw.length),t.push(n);else{if(r=e,this.options.extensions&&this.options.extensions.startBlock){let t=1/0;const n=e.slice(1);let s;this.options.extensions.startBlock.forEach((e=>{s=e.call({lexer:this},n),"number"==typeof s&&s>=0&&(t=Math.min(t,s))})),t<1/0&&t>=0&&(r=e.substring(0,t+1))}if(this.state.top&&(n=this.tokenizer.paragraph(r)))s=t[t.length-1],i&&"paragraph"===s.type?(s.raw+="\n"+n.raw,s.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=s.text):t.push(n),i=r.length!==e.length,e=e.substring(n.raw.length);else if(n=this.tokenizer.text(e))e=e.substring(n.raw.length),s=t[t.length-1],s&&"text"===s.type?(s.raw+="\n"+n.raw,s.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=s.text):t.push(n);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n,s,r,i,o,a,l=e;if(this.tokens.links){const e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(i=this.tokenizer.rules.inline.reflinkSearch.exec(l));)e.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(l=l.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(i=this.tokenizer.rules.inline.blockSkip.exec(l));)l=l.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(i=this.tokenizer.rules.inline.anyPunctuation.exec(l));)l=l.slice(0,i.index)+"++"+l.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;e;)if(o||(a=""),o=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some((s=>!!(n=s.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.escape(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.tag(e))e=e.substring(n.raw.length),s=t[t.length-1],s&&"text"===n.type&&"text"===s.type?(s.raw+=n.raw,s.text+=n.text):t.push(n);else if(n=this.tokenizer.link(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(n.raw.length),s=t[t.length-1],s&&"text"===n.type&&"text"===s.type?(s.raw+=n.raw,s.text+=n.text):t.push(n);else if(n=this.tokenizer.emStrong(e,l,a))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.codespan(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.br(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.del(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.autolink(e))e=e.substring(n.raw.length),t.push(n);else if(this.state.inLink||!(n=this.tokenizer.url(e))){if(r=e,this.options.extensions&&this.options.extensions.startInline){let t=1/0;const n=e.slice(1);let s;this.options.extensions.startInline.forEach((e=>{s=e.call({lexer:this},n),"number"==typeof s&&s>=0&&(t=Math.min(t,s))})),t<1/0&&t>=0&&(r=e.substring(0,t+1))}if(n=this.tokenizer.inlineText(r))e=e.substring(n.raw.length),"_"!==n.raw.slice(-1)&&(a=n.raw.slice(-1)),o=!0,s=t[t.length-1],s&&"text"===s.type?(s.raw+=n.raw,s.text+=n.text):t.push(n);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}else e=e.substring(n.raw.length),t.push(n);return t}}class id{constructor(e){Kc(this,"options"),this.options=e||ru}code(e,t,n){var s;const r=null==(s=(t||"").match(/^\S*/))?void 0:s[0];return e=e.replace(/\n$/,"")+"\n",r?'<pre><code class="language-'+pu(r)+'">'+(n?e:pu(e,!0))+"</code></pre>\n":"<pre><code>"+(n?e:pu(e,!0))+"</code></pre>\n"}blockquote(e){return`<blockquote>\n${e}</blockquote>\n`}html(e,t){return e}heading(e,t,n){return`<h${t}>${e}</h${t}>\n`}hr(){return"<hr>\n"}list(e,t,n){const s=t?"ol":"ul";return"<"+s+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"</"+s+">\n"}listitem(e,t,n){return`<li>${e}</li>\n`}checkbox(e){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph(e){return`<p>${e}</p>\n`}table(e,t){return t&&(t=`<tbody>${t}</tbody>`),"<table>\n<thead>\n"+e+"</thead>\n"+t+"</table>\n"}tablerow(e){return`<tr>\n${e}</tr>\n`}tablecell(e,t){const n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`</${n}>\n`}strong(e){return`<strong>${e}</strong>`}em(e){return`<em>${e}</em>`}codespan(e){return`<code>${e}</code>`}br(){return"<br>"}del(e){return`<del>${e}</del>`}link(e,t,n){const s=gu(e);if(null===s)return n;let r='<a href="'+(e=s)+'"';return t&&(r+=' title="'+t+'"'),r+=">"+n+"</a>",r}image(e,t,n){const s=gu(e);if(null===s)return n;let r=`<img src="${e=s}" alt="${n}"`;return t&&(r+=` title="${t}"`),r+=">",r}text(e){return e}}class od{strong(e){return e}em(e){return e}codespan(e){return e}del(e){return e}html(e){return e}text(e){return e}link(e,t,n){return""+n}image(e,t,n){return""+n}br(){return""}}class ad{constructor(e){Kc(this,"options"),Kc(this,"renderer"),Kc(this,"textRenderer"),this.options=e||ru,this.options.renderer=this.options.renderer||new id,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new od}static parse(e,t){return new ad(t).parse(e)}static parseInline(e,t){return new ad(t).parseInline(e)}parse(e,t=!0){let n="";for(let s=0;s<e.length;s++){const r=e[s];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[r.type]){const e=r,t=this.options.extensions.renderers[e.type].call({parser:this},e);if(!1!==t||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(e.type)){n+=t||"";continue}}switch(r.type){case"space":continue;case"hr":n+=this.renderer.hr();continue;case"heading":{const e=r;n+=this.renderer.heading(this.parseInline(e.tokens),e.depth,this.parseInline(e.tokens,this.textRenderer).replace(hu,((e,t)=>"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):"")));continue}case"code":{const e=r;n+=this.renderer.code(e.text,e.lang,!!e.escaped);continue}case"table":{const e=r;let t="",s="";for(let n=0;n<e.header.length;n++)s+=this.renderer.tablecell(this.parseInline(e.header[n].tokens),{header:!0,align:e.align[n]});t+=this.renderer.tablerow(s);let i="";for(let n=0;n<e.rows.length;n++){const t=e.rows[n];s="";for(let n=0;n<t.length;n++)s+=this.renderer.tablecell(this.parseInline(t[n].tokens),{header:!1,align:e.align[n]});i+=this.renderer.tablerow(s)}n+=this.renderer.table(t,i);continue}case"blockquote":{const e=r,t=this.parse(e.tokens);n+=this.renderer.blockquote(t);continue}case"list":{const e=r,t=e.ordered,s=e.start,i=e.loose;let o="";for(let n=0;n<e.items.length;n++){const t=e.items[n],s=t.checked,r=t.task;let a="";if(t.task){const e=this.renderer.checkbox(!!s);i?t.tokens.length>0&&"paragraph"===t.tokens[0].type?(t.tokens[0].text=e+" "+t.tokens[0].text,t.tokens[0].tokens&&t.tokens[0].tokens.length>0&&"text"===t.tokens[0].tokens[0].type&&(t.tokens[0].tokens[0].text=e+" "+t.tokens[0].tokens[0].text)):t.tokens.unshift({type:"text",text:e+" "}):a+=e+" "}a+=this.parse(t.tokens,i),o+=this.renderer.listitem(a,r,!!s)}n+=this.renderer.list(o,t,s);continue}case"html":{const e=r;n+=this.renderer.html(e.text,e.block);continue}case"paragraph":{const e=r;n+=this.renderer.paragraph(this.parseInline(e.tokens));continue}case"text":{let i=r,o=i.tokens?this.parseInline(i.tokens):i.text;for(;s+1<e.length&&"text"===e[s+1].type;)i=e[++s],o+="\n"+(i.tokens?this.parseInline(i.tokens):i.text);n+=t?this.renderer.paragraph(o):o;continue}default:{const e='Token with "'+r.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw new Error(e)}}}return n}parseInline(e,t){t=t||this.renderer;let n="";for(let s=0;s<e.length;s++){const r=e[s];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[r.type]){const e=this.options.extensions.renderers[r.type].call({parser:this},r);if(!1!==e||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(r.type)){n+=e||"";continue}}switch(r.type){case"escape":{const e=r;n+=t.text(e.text);break}case"html":{const e=r;n+=t.html(e.text);break}case"link":{const e=r;n+=t.link(e.href,e.title,this.parseInline(e.tokens,t));break}case"image":{const e=r;n+=t.image(e.href,e.title,e.text);break}case"strong":{const e=r;n+=t.strong(this.parseInline(e.tokens,t));break}case"em":{const e=r;n+=t.em(this.parseInline(e.tokens,t));break}case"codespan":{const e=r;n+=t.codespan(e.text);break}case"br":n+=t.br();break;case"del":{const e=r;n+=t.del(this.parseInline(e.tokens,t));break}case"text":{const e=r;n+=t.text(e.text);break}default:{const e='Token with "'+r.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw new Error(e)}}}return n}}class ld{constructor(e){Kc(this,"options"),this.options=e||ru}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}}Kc(ld,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"]));Ic=new WeakSet,Pc=function(e,t){return(n,s)=>{const r=Hc({},s),i=Hc(Hc({},this.defaults),r);!0===this.defaults.async&&!1===r.async&&(i.silent||console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored."),i.async=!0);const o=Gc(this,Rc,Mc).call(this,!!i.silent,!!i.async);if(null==n)return o(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof n)return o(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(i.hooks&&(i.hooks.options=i),i.async)return Promise.resolve(i.hooks?i.hooks.preprocess(n):n).then((t=>e(t,i))).then((e=>i.hooks?i.hooks.processAllTokens(e):e)).then((e=>i.walkTokens?Promise.all(this.walkTokens(e,i.walkTokens)).then((()=>e)):e)).then((e=>t(e,i))).then((e=>i.hooks?i.hooks.postprocess(e):e)).catch(o);try{i.hooks&&(n=i.hooks.preprocess(n));let s=e(n,i);i.hooks&&(s=i.hooks.processAllTokens(s)),i.walkTokens&&this.walkTokens(s,i.walkTokens);let r=t(s,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(a){return o(a)}}},Rc=new WeakSet,Mc=function(e,t){return n=>{if(n.message+="\nPlease report this to https://github.com/markedjs/marked.",e){const e="<p>An error occurred:</p><pre>"+pu(n.message+"",!0)+"</pre>";return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}};const cd=new class{constructor(...e){zc(this,Ic),zc(this,Rc),Kc(this,"defaults",{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}),Kc(this,"options",this.setOptions),Kc(this,"parse",Gc(this,Ic,Pc).call(this,rd.lex,ad.parse)),Kc(this,"parseInline",Gc(this,Ic,Pc).call(this,rd.lexInline,ad.parseInline)),Kc(this,"Parser",ad),Kc(this,"Renderer",id),Kc(this,"TextRenderer",od),Kc(this,"Lexer",rd),Kc(this,"Tokenizer",wu),Kc(this,"Hooks",ld),this.use(...e)}walkTokens(e,t){var n,s;let r=[];for(const i of e)switch(r=r.concat(t.call(this,i)),i.type){case"table":{const e=i;for(const n of e.header)r=r.concat(this.walkTokens(n.tokens,t));for(const n of e.rows)for(const e of n)r=r.concat(this.walkTokens(e.tokens,t));break}case"list":{const e=i;r=r.concat(this.walkTokens(e.items,t));break}default:{const e=i;(null==(s=null==(n=this.defaults.extensions)?void 0:n.childTokens)?void 0:s[e.type])?this.defaults.extensions.childTokens[e.type].forEach((n=>{const s=e[n].flat(1/0);r=r.concat(this.walkTokens(s,t))})):e.tokens&&(r=r.concat(this.walkTokens(e.tokens,t)))}}return r}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach((e=>{const n=Hc({},e);if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach((e=>{if(!e.name)throw new Error("extension name required");if("renderer"in e){const n=t.renderers[e.name];t.renderers[e.name]=n?function(...t){let s=e.renderer.apply(this,t);return!1===s&&(s=n.apply(this,t)),s}:e.renderer}if("tokenizer"in e){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");const n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&("block"===e.level?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:"inline"===e.level&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}"childTokens"in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)})),n.extensions=t),e.renderer){const t=this.defaults.renderer||new id(this.defaults);for(const n in e.renderer){if(!(n in t))throw new Error(`renderer '${n}' does not exist`);if("options"===n)continue;const s=n,r=e.renderer[s],i=t[s];t[s]=(...e)=>{let n=r.apply(t,e);return!1===n&&(n=i.apply(t,e)),n||""}}n.renderer=t}if(e.tokenizer){const t=this.defaults.tokenizer||new wu(this.defaults);for(const n in e.tokenizer){if(!(n in t))throw new Error(`tokenizer '${n}' does not exist`);if(["options","rules","lexer"].includes(n))continue;const s=n,r=e.tokenizer[s],i=t[s];t[s]=(...e)=>{let n=r.apply(t,e);return!1===n&&(n=i.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){const t=this.defaults.hooks||new ld;for(const n in e.hooks){if(!(n in t))throw new Error(`hook '${n}' does not exist`);if("options"===n)continue;const s=n,r=e.hooks[s],i=t[s];ld.passThroughHooks.has(n)?t[s]=e=>{if(this.defaults.async)return Promise.resolve(r.call(t,e)).then((e=>i.call(t,e)));const n=r.call(t,e);return i.call(t,n)}:t[s]=(...e)=>{let n=r.apply(t,e);return!1===n&&(n=i.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){const t=this.defaults.walkTokens,s=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(s.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults=Hc(Hc({},this.defaults),n)})),this}setOptions(e){return this.defaults=Hc(Hc({},this.defaults),e),this}lexer(e,t){return rd.lex(e,null!=t?t:this.defaults)}parser(e,t){return ad.parse(e,null!=t?t:this.defaults)}};function ud(e,t){return cd.parse(e,t)}ud.options=ud.setOptions=function(e){return cd.setOptions(e),ud.defaults=cd.defaults,iu(ud.defaults),ud},ud.getDefaults=su,ud.defaults=ru,ud.use=function(...e){return cd.use(...e),ud.defaults=cd.defaults,iu(ud.defaults),ud},ud.walkTokens=function(e,t){return cd.walkTokens(e,t)},ud.parseInline=cd.parseInline,ud.Parser=ad,ud.parser=ad.parse,ud.Renderer=id,ud.TextRenderer=od,ud.Lexer=rd,ud.lexer=rd.lex,ud.Tokenizer=wu,ud.Hooks=ld,ud.parse=ud,ud.options,ud.setOptions,ud.use,ud.walkTokens,ud.parseInline,ad.parse,rd.lex;var dd={"&":"&","<":"<",">":">",'"':""","'":"'"},pd={"&":"&","<":"<",">":">",""":'"',"'":"'"},hd=/(&|<|>|"|')/g,fd=/[&<>"']/g;function md(e){return dd[e]}function gd(e){return pd[e]}function vd(e){return null==e?"":String(e).replace(fd,md)}function yd(e){return null==e?"":String(e).replace(hd,gd)}vd.options=yd.options={};var kd={encode:vd,escape:vd,decode:yd,unescape:yd,version:"1.0.0-browser"};var bd=function e(t){for(var n,s,r=Array.prototype.slice.call(arguments,1);r.length;)for(s in n=r.shift())n.hasOwnProperty(s)&&("[object Object]"===Object.prototype.toString.call(t[s])?t[s]=e(t[s],n[s]):t[s]=n[s]);return t},wd=function(e){return"string"==typeof e?e.toLowerCase():e};function _d(e,t){return e[t]=!0,e}var Ed=function(e){return e.reduce(_d,{})},xd={uris:Ed(["background","base","cite","href","longdesc","src","usemap"])},Sd={voids:Ed(["area","br","col","hr","img","wbr","input","base","basefont","link","meta"])},Cd=kd,Ad=wd,$d=Sd,Td=/^<\s*([\w:-]+)((?:\s+[\w:-]+(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)\s*>/,Ld=/^<\s*\/\s*([\w:-]+)[^>]*>/,Od=/([\w:-]+)(?:\s*=\s*(?:(?:"((?:[^"])*)")|(?:'((?:[^'])*)')|([^>\s]+)))?/g,Nd=/^</,Id=/^<\s*\//;var Pd=kd,Rd=wd,Md=xd,Dd=Sd;var Ud=bd,Fd=function(e,t){for(var n,s=function(){var e=[];return e.lastItem=function(){return e[e.length-1]},e}(),r=e;e;)i();function i(){n=!0,function(){"\x3c!--"===e.substr(0,4)?(s=e.indexOf("--\x3e"))>=0&&(t.comment&&t.comment(e.substring(4,s)),e=e.substring(s+3),n=!1):Id.test(e)?o(Ld,l):Nd.test(e)&&o(Td,a);var s;!function(){if(!n)return;var s,r=e.indexOf("<");r>=0?(s=e.substring(0,r),e=e.substring(r)):(s=e,e="");t.chars&&t.chars(s)}()}();var s=e===r;r=e,s&&(e="")}function o(t,s){var r=e.match(t);r&&(e=e.substring(r[0].length),r[0].replace(t,s),n=!1)}function a(e,n,r,i){var o={},a=Ad(n),l=$d.voids[a]||!!i;r.replace(Od,(function(e,t,n,s,r){o[t]=void 0===n&&void 0===s&&void 0===r?void 0:Cd.decode(n||s||r||"")})),l||s.push(a),t.start&&t.start(a,o,l)}function l(e,n){var r,i=0,o=Ad(n);if(o)for(i=s.length-1;i>=0&&s[i]!==o;i--);if(i>=0){for(r=s.length-1;r>=i;r--)t.end&&t.end(s[r]);s.length=i}}l()},jd=function(e,t){var n,s=t||{};return a(),{start:function(e,t,o){var a=Rd(e);if(n.ignoring)return void i(a);if(-1===(s.allowedTags||[]).indexOf(a))return void i(a);if(s.filter&&!s.filter({tag:a,attrs:t}))return void i(a);r("<"),r(a),Object.keys(t).forEach((function(e){var n=t[e],i=(s.allowedClasses||{})[a]||[],o=(s.allowedAttributes||{})[a]||[],l=Rd(e);("class"===l&&-1===o.indexOf(l)?(n=n.split(" ").filter((function(e){return i&&-1!==i.indexOf(e)})).join(" ").trim()).length:-1!==o.indexOf(l)&&(!0!==Md.uris[l]||function(e){var t=e[0];if("#"===t||"/"===t)return!0;var n=e.indexOf(":");if(-1===n)return!0;var r=e.indexOf("?");if(-1!==r&&n>r)return!0;var i=e.indexOf("#");return-1!==i&&n>i||s.allowedSchemes.some(o);function o(t){return 0===e.indexOf(t+":")}}(n)))&&(r(" "),r(e),"string"==typeof n&&(r('="'),r(Pd.encode(n)),r('"')))})),r(o?"/>":">")},end:function(e){var t=Rd(e);-1!==(s.allowedTags||[]).indexOf(t)&&!1===n.ignoring?(r("</"),r(t),r(">")):o(t)},chars:function(e){!1===n.ignoring&&r(s.transformText?s.transformText(e):e)}};function r(t){e.push(t)}function i(e){Dd.voids[e]||(!1===n.ignoring?n={ignoring:e,depth:1}:n.ignoring===e&&n.depth++)}function o(e){n.ignoring===e&&--n.depth<=0&&a()}function a(){n={ignoring:!1,depth:0}}},Bd={allowedAttributes:{a:["href","name","target","title","aria-label"],iframe:["allowfullscreen","frameborder","src"],img:["src","alt","title","aria-label"]},allowedClasses:{},allowedSchemes:["http","https","mailto"],allowedTags:["a","abbr","article","b","blockquote","br","caption","code","del","details","div","em","h1","h2","h3","h4","h5","h6","hr","i","img","ins","kbd","li","main","mark","ol","p","pre","section","span","strike","strong","sub","summary","sup","table","tbody","td","th","thead","tr","u","ul"],filter:null};function qd(e,t,n){var s=[],r=!0===n?t:Ud({},Bd,t),i=jd(s,r);return Fd(e,i),s.join("")}qd.defaults=Bd;const Wd=Zc(qd),Hd={allowedClasses:{},allowedSchemes:["http","https","mailto","data"],allowedTags:["a","abbr","article","b","blockquote","br","caption","code","del","details","div","em","h1","h2","h3","h4","h5","h6","hr","i","img","ins","kbd","li","main","mark","ol","p","pre","section","span","strike","strong","sub","summary","sup","table","tbody","td","th","thead","tr","u","ul"],allowedAttributes:{"*":["title","accesskey"],a:["href","name","target","aria-label","rel"],img:["src","alt","title","atk-emoticon","aria-label","data-src","class","loading"],code:["class"],span:["class","style"]},filter:e=>([["code",/^hljs\W+language-(.*)$/],["span",/^(hljs-.*)$/],["img",/^lazyload$/]].forEach((([t,n])=>{e.tag===t&&e.attrs.class&&!n.test(e.attrs.class)&&delete e.attrs.class})),"span"===e.tag&&e.attrs.style&&!/^color:(\W+)?#[0-9a-f]{3,6};?$/i.test(e.attrs.style)&&delete e.attrs.style,!0)};function Vd(e){return Wd(e,Hd)}var Kd={exports:{}};const zd=Zc(Kd.exports=function(){function e(e,t){return e(t={exports:{}},t.exports),t.exports}var t=e((function(e){var t=e.exports=function(){return new RegExp("(?:"+t.line().source+")|(?:"+t.block().source+")","gm")};t.line=function(){return/(?:^|\s)\/\/(.+?)$/gm},t.block=function(){return/\/\*([\S\s]*?)\*\//gm}})),n=["23AC69","91C132","F19726","E8552D","1AAB8E","E1147F","2980C1","1BA1E6","9FA0A0","F19726","E30B20","E30B20","A3338B"];function s(e){return'<span style="color: slategray">'+e+"</span>"}return function(e,r){void 0===r&&(r={});var i=r.colors;void 0===i&&(i=n);var o=0,a={},l=new RegExp("("+/[\u4E00-\u9FFF\u3400-\u4dbf\uf900-\ufaff\u3040-\u309f\uac00-\ud7af\u0400-\u04FF]+|\w+/.source+"|"+/</.source+")|("+t().source+")","gmi");return e.replace(l,(function(e,t,n){if(n)return s(n);if("<"===t)return"<";var r;a[t]?r=a[t]:(r=i[o],a[t]=r);var l='<span style="color: #'+r+'">'+t+"</span>";return o=++o%i.length,l}))}}());function Gd(e){return zd(e)}function Yd(e){const t=new ud.Renderer;return t.link=Qd(t,t.link),t.code=Xd(),t.image=Jd(t,t.image,e),t}const Qd=(e,t)=>(n,s,r)=>{const i=(e=>{try{return new URL(e).origin}catch(t){return""}})(n)===window.location.origin;return t.call(e,n,s,r).replace(/^<a /,`<a target="_blank" ${i?"":'rel="noreferrer noopener nofollow"'} `)},Xd=()=>(e,t)=>{const n=t||"plaintext";let s=e;return window.hljs?n&&window.hljs.getLanguage(n)&&(s=window.hljs.highlight(n,e).value):s=Gd(e),`<pre rel="${n}">\n<code class="hljs language-${n}">${s.replace(/&/g,"&")}</code>\n</pre>`},Jd=(e,t,{imgLazyLoad:n})=>(s,r,i)=>{const o=t.call(e,s,r,i);return n?"native"===n||!0===n?o.replace(/^<img /,'<img class="lazyload" loading="lazy" '):"data-src"===n?o.replace(/^<img /,'<img class="lazyload" ').replace("src=","data-src="):o:o};let Zd,ep=[];const tp={gfm:!0,breaks:!0,async:!1};function np(){return Zd}function sp(e){var t;let n=null==(t=np())?void 0:t.parse(e);n||(n=function(e){return e.replace(/```\s*([^]+?.*?[^]+?[^]+?)```/g,((e,t)=>`<pre><code>${Gd(t)}</code></pre>`)).replace(/!\[(.*?)\]\((.*?)\)/g,((e,t,n)=>`<img src="${n}" alt="${t}" />`)).replace(/\[(.*?)\]\((.*?)\)/g,((e,t,n)=>`<a href="${n}" target="_blank">${t}</a>`)).replace(/\n/g,"<br>")}(e));let s=Vd(n);return ep.forEach((e=>{"function"==typeof e&&(s=e(s))})),s}function rp(...e){const t=e=>e&&"object"==typeof e&&e.constructor===Object;return e.reduce(((e,n)=>(Object.keys(null!=n?n:{}).forEach((s=>{if("__proto__"===s||"constructor"===s||"prototype"===s)return;const r=e[s],i=n[s];Array.isArray(r)&&Array.isArray(i)?e[s]=r.concat(...i):t(r)&&t(i)?e[s]=rp(r,i):e[s]=i})),e)),{})}class ip{constructor(e){Kc(this,"loading",!1),Kc(this,"listLastFetch"),Kc(this,"comments",[]),Kc(this,"notifies",[]),Kc(this,"page"),this.events=e}getLoading(){return this.loading}setLoading(e){this.loading=e}getListLastFetch(){return this.listLastFetch}setListLastFetch(e){this.listLastFetch=e}getComments(){return this.comments}fetchComments(e){this.events.trigger("list-fetch",e)}findComment(e){return this.comments.find((t=>t.id===e))}clearComments(){this.comments=[],this.events.trigger("list-loaded",this.comments)}loadComments(e){this.events.trigger("list-load",e),this.comments.push(...e),this.events.trigger("list-loaded",this.comments)}insertComment(e){this.comments.push(e),this.events.trigger("comment-inserted",e),this.events.trigger("list-loaded",this.comments)}updateComment(e){this.comments=this.comments.map((t=>t.id===e.id?e:t)),this.events.trigger("comment-updated",e),this.events.trigger("list-loaded",this.comments)}deleteComment(e){const t=this.comments.find((t=>t.id===e));if(!t)throw new Error(`Comment ${e} not found`);this.comments=this.comments.filter((t=>t.id!==e)),this.events.trigger("comment-deleted",t),this.events.trigger("list-loaded",this.comments)}getNotifies(){return this.notifies}updateNotifies(e){this.notifies=e,this.events.trigger("notifies-updated",this.notifies)}getPage(){return this.page}updatePage(e){this.page=e,this.events.trigger("page-loaded",e)}}function op(e=""){const t=document.createElement("div");return t.innerHTML=e.trim(),t.firstElementChild||t}function ap(e){const t=document.createElement("div");t.innerText=e;return t.innerHTML}function lp(e){const t=RegExp(`[?&]${e}=([^&]*)`).exec(window.location.search);return t&&decodeURIComponent(t[1].replace(/\+/g," "))}function cp(e,t){const n=e=>{const t=e.getBoundingClientRect(),n=window.pageXOffset||document.documentElement.scrollLeft,s=window.pageYOffset||document.documentElement.scrollTop;return{top:t.top+s,left:t.left+n}},s=n(e);if(!t)return s;const r=n(t);return{top:s.top-r.top,left:s.left-r.left}}function up(e,t){let n=e.toString();for(;n.length<t;)n=`0${n}`;return n}function dp(e,t=(e=>e)){try{const n=e.getTime(),s=(new Date).getTime()-n,r=Math.floor(s/864e5);if(0===r){const e=s%864e5,n=Math.floor(e/36e5);if(0===n){const n=e%36e5,s=Math.floor(n/6e4);if(0===s){const e=n%6e4,s=Math.round(e/1e3);return s<10?t("now"):`${s} ${t("seconds")}`}return`${s} ${t("minutes")}`}return`${n} ${t("hours")}`}return r<0?t("now"):r<8?`${r} ${t("days")}`:function(e){const t=up(e.getDate(),2),n=up(e.getMonth()+1,2);return`${up(e.getFullYear(),2)}-${n}-${t}`}(e)}catch(n){return console.error(n)," - "}}function pp(){return Yc(this,null,(function*(){const e=navigator.userAgent;if(!navigator.userAgentData||!navigator.userAgentData.getHighEntropyValues)return e;const t=navigator.userAgentData;let n=null;try{n=yield t.getHighEntropyValues(["platformVersion"])}catch(r){return console.error(r),e}const s=Number(n.platformVersion.split(".")[0]);return"Windows"===t.platform&&s>=13?e.replace(/Windows NT 10.0/,"Windows NT 11.0"):"macOS"===t.platform&&s>=11?e.replace(/(Mac OS X \d+_\d+_\d+|Mac OS X)/,`Mac OS X ${n.platformVersion.replace(/\./g,"_")}`):e}))}function hp(e){let t;try{t=new URL(e)}catch(n){return!1}return"http:"===t.protocol||"https:"===t.protocol}function fp(e){return t=e.base,n=e.path,`${t.replace(/\/$/,"")}/${n.replace(/^\//,"")}`;var t,n}const mp={placeholder:"Leave a comment",noComment:"No Comment",send:"Send",signIn:"Sign in",signUp:"Sign up",save:"Save",nick:"Nickname",email:"Email",link:"Website",emoticon:"Emoji",preview:"Preview",uploadImage:"Upload Image",uploadFail:"Upload Failed",commentFail:"Failed to comment",restoredMsg:"Content has been restored",onlyAdminCanReply:"Only admin can reply",uploadLoginMsg:"Please fill in your name and email to upload",counter:"{count} Comments",sortLatest:"Latest",sortOldest:"Oldest",sortBest:"Best",sortAuthor:"Author",openComment:"Open Comment",closeComment:"Close Comment",listLoadFailMsg:"Failed to load comments",listRetry:"Retry",loadMore:"Load More",admin:"Admin",reply:"Reply",voteUp:"Up",voteDown:"Down",voteFail:"Vote Failed",readMore:"Read More",actionConfirm:"Confirm",collapse:"Collapse",collapsed:"Collapsed",collapsedMsg:"This comment has been collapsed",expand:"Expand",approved:"Approved",pending:"Pending",pendingMsg:"Pending, visible only to commenter.",edit:"Edit",editCancel:"Cancel Edit",delete:"Delete",deleteConfirm:"Confirm",pin:"Pin",unpin:"Unpin",seconds:"seconds ago",minutes:"minutes ago",hours:"hours ago",days:"days ago",now:"just now",adminCheck:"Enter admin password:",captchaCheck:"Enter the CAPTCHA to continue:",confirm:"Confirm",cancel:"Cancel",msgCenter:"Messages",ctrlCenter:"Admin",noAccountPrompt:"Don't have an account?",haveAccountPrompt:"Already have an account?",forgetPassword:"Forget Password",resetPassword:"Reset Password",verificationCode:"Verification Code",verifySend:"Verify",verifyResend:"Resend",waitSeconds:"Wait {seconds}s",emailVerified:"Email has been verified",password:"Password",username:"Username",nextStep:"Next Step",skipNotVerify:"Skip, do not verify",logoutConfirm:"Are you sure to logout?",accountMergeNotice:"Your email has multiple accounts with different id.",accountMergeSelectOne:"Please select one you want to merge all the data into it.",accountMergeConfirm:"All data will be merged into one account, the id is {id}.",dismiss:"Dismiss",merge:"Merge",frontend:"Frontend",backend:"Backend",loading:"Loading",loadFail:"Load Failed",editing:"Editing",editFail:"Edit Failed",deleting:"Deleting",deleteFail:"Delete Failed",reqGot:"Request got",reqAborted:"Request timed out or terminated unexpectedly",updateMsg:"Please update Artalk {name} to get the best experience!",currentVersion:"Current Version",ignore:"Ignore",open:"Open",openName:"Open {name}"},gp="ArtalkI18n",vp={en:mp,"en-US":mp,"zh-CN":{placeholder:"键入内容...",noComment:"「此时无声胜有声」",send:"发送",signIn:"登录",signUp:"注册",save:"保存",nick:"昵称",email:"邮箱",link:"网址",emoticon:"表情",preview:"预览",uploadImage:"上传图片",uploadFail:"上传失败",commentFail:"评论失败",restoredMsg:"内容已自动恢复",onlyAdminCanReply:"仅管理员可评论",uploadLoginMsg:"填入你的名字邮箱才能上传哦",counter:"{count} 条评论",sortLatest:"最新",sortOldest:"最早",sortBest:"最热",sortAuthor:"作者",openComment:"打开评论",closeComment:"关闭评论",listLoadFailMsg:"无法获取评论列表数据",listRetry:"点击重新获取",loadMore:"加载更多",admin:"管理员",reply:"回复",voteUp:"赞同",voteDown:"反对",voteFail:"投票失败",readMore:"阅读更多",actionConfirm:"确认操作",collapse:"折叠",collapsed:"已折叠",collapsedMsg:"该评论已被系统或管理员折叠",expand:"展开",approved:"已审",pending:"待审",pendingMsg:"审核中,仅本人可见。",edit:"编辑",editCancel:"取消编辑",delete:"删除",deleteConfirm:"确认删除",pin:"置顶",unpin:"取消置顶",seconds:"秒前",minutes:"分钟前",hours:"小时前",days:"天前",now:"刚刚",adminCheck:"键入密码来验证管理员身份:",captchaCheck:"键入验证码继续:",confirm:"确认",cancel:"取消",msgCenter:"通知中心",ctrlCenter:"控制中心",noAccountPrompt:"没有账号?",haveAccountPrompt:"已有账号?",forgetPassword:"忘记密码",resetPassword:"重置密码",verificationCode:"验证码",verifySend:"发送验证码",verifyResend:"重新发送",waitSeconds:"等待 {seconds}秒",emailVerified:"邮箱已验证",password:"密码",username:"用户名",nextStep:"下一步",skipNotVerify:"跳过,不验证",logoutConfirm:"确定要退出登录吗?",accountMergeNotice:"您的电子邮件下有多个不同 ID 的账户。",accountMergeSelectOne:"请选择将所有数据合并到其中的一个。",accountMergeConfirm:"所有数据将合并到 ID 为 {id} 的账户中。",dismiss:"忽略",merge:"合并",frontend:"前端",backend:"后端",loading:"加载中",loadFail:"加载失败",editing:"修改中",editFail:"修改失败",deleting:"删除中",deleteFail:"删除失败",reqGot:"请求响应",reqAborted:"请求超时或意外终止",updateMsg:"请更新 Artalk {name} 以获得更好的体验!",currentVersion:"当前版本",ignore:"忽略",open:"打开",openName:"打开{name}"}};function yp(e){return e=e.replace(/^([a-zA-Z]+)(-[a-zA-Z]+)?$/,((e,t,n)=>t.toLowerCase()+(n||"").toUpperCase())),vp[e]?vp[e]:window[gp]&&window[gp][e]?window[gp][e]:vp.en}let kp="en",bp=yp(kp);function wp(e){e!==kp&&(kp=e,bp="string"==typeof e?yp(e):e)}function _p(e,t={}){let n=(null==bp?void 0:bp[e])||e;return n=n.replace(/\{\s*(\w+?)\s*\}/g,((e,n)=>t[n]||"")),ap(n)}class Ep{constructor(){Kc(this,"events",[])}on(e,t,n={}){this.events.push(Hc({name:e,handler:t},n))}off(e,t){t&&(this.events=this.events.filter((n=>!(n.name===e&&n.handler===t))))}trigger(e,t){this.events.slice(0).filter((t=>t.name===e&&"function"==typeof t.handler)).forEach((n=>{n.once&&this.off(e,n.handler),n.handler(t)}))}}const xp={el:"",pageKey:"",pageTitle:"",server:"",site:"",placeholder:"",noComment:"",sendBtn:"",darkMode:!1,editorTravel:!0,flatMode:"auto",nestMax:2,nestSort:"DATE_ASC",emoticons:"https://cdn.jsdelivr.net/gh/ArtalkJS/Emoticons/grps/default.json",vote:!0,voteDown:!1,uaBadge:!0,listSort:!0,preview:!0,countEl:".artalk-comment-count",pvEl:".artalk-pv-count",statPageKeyAttr:"data-page-key",gravatar:{mirror:"https://www.gravatar.com/avatar/",params:"sha256=1&d=mp&s=240"},pagination:{pageSize:20,readMore:!0,autoLoad:!0},heightLimit:{content:300,children:400,scrollable:!1},imgUpload:!0,reqTimeout:15e3,versionCheck:!0,useBackendConf:!0,locale:"en"};function Sp(e,t=!1){const n=t?rp(xp,e):e;if(n.el&&"string"==typeof n.el)try{const e=document.querySelector(n.el);if(!e)throw Error(`Target element "${n.el}" was not found.`);n.el=e}catch(s){throw console.error(s),new Error("Please check your Artalk `el` config.")}return""===n.pageKey&&(n.pageKey=`${window.location.pathname}`),""===n.pageTitle&&(n.pageTitle=`${document.title}`),n.server&&(n.server=n.server.replace(/\/$/,"").replace(/\/api\/?$/,"")),"auto"===n.locale&&(n.locale=navigator.language),"auto"===n.flatMode&&(n.flatMode=window.matchMedia("(max-width: 768px)").matches),"number"==typeof n.nestMax&&Number(n.nestMax)<=1&&(n.flatMode=!0),n}function Cp(e,t){return{baseURL:`${e.server}/api/v2`,siteName:e.site||"",pageKey:e.pageKey||"",pageTitle:e.pageTitle||"",timeout:e.reqTimeout,getApiToken:()=>null==t?void 0:t.get("user").getData().token,userInfo:(null==t?void 0:t.get("user").checkHasBasicUserInfo())?{name:null==t?void 0:t.get("user").getData().nick,email:null==t?void 0:t.get("user").getData().email}:void 0,handlers:null==t?void 0:t.getApiHandlers()}}function Ap(e,t,n){let s=null;const r=()=>{const r=(()=>{const n=e.getConf(),s={};return t.forEach((e=>{s[e]=n[e]})),s})();var i,o;(null==s||(i=s,o=r,!(JSON.stringify(i)===JSON.stringify(o))))&&(s=r,n(r))};e.on("mounted",r),e.on("updated",r)}class $p{constructor(e){Kc(this,"conf"),Kc(this,"data"),Kc(this,"$root"),Kc(this,"events",new Ep),Kc(this,"mounted",!1),Kc(this,"apiHandlers",null),Kc(this,"getCommentList",this.getCommentNodes),Kc(this,"getCommentDataList",this.getComments),this.conf=e,this.$root=e.el,this.$root.classList.add("artalk"),this.$root.innerHTML="",this.data=new ip(this.events),this.on("mounted",(()=>{this.mounted=!0}))}inject(e,t){this[e]=t}get(e){return this[e]}getApi(){return new nu(Cp(this.conf,this))}getApiHandlers(){return this.apiHandlers||(this.apiHandlers=function(e){const t=function(){const e=[];return{add:(t,n)=>{e.push({action:t,handler:n})},get:()=>e}}();return t.add("need_captcha",(t=>e.checkCaptcha(t))),t.add("need_login",(()=>e.checkAdmin({}))),t}(this)),this.apiHandlers}getData(){return this.data}replyComment(e,t){this.editor.setReply(e,t)}editComment(e,t){this.editor.setEditComment(e,t)}fetch(e){this.data.fetchComments(e)}reload(){this.data.fetchComments({offset:0})}listGotoFirst(){this.events.trigger("list-goto-first")}getCommentNodes(){return this.list.getCommentNodes()}getComments(){return this.data.getComments()}editorShowLoading(){this.editor.showLoading()}editorHideLoading(){this.editor.hideLoading()}editorShowNotify(e,t){this.editor.showNotify(e,t)}editorResetState(){this.editor.resetState()}showSidebar(e){this.sidebarLayer.show(e)}hideSidebar(){this.sidebarLayer.hide()}checkAdmin(e){return this.checkerLauncher.checkAdmin(e)}checkCaptcha(e){return this.checkerLauncher.checkCaptcha(e)}on(e,t){this.events.on(e,t)}off(e,t){this.events.off(e,t)}trigger(e,t){this.events.trigger(e,t)}$t(e,t={}){return _p(e,t)}setDarkMode(e){this.updateConf({darkMode:e})}updateConf(e){this.conf=rp(this.conf,Sp(e,!1)),this.mounted&&this.events.trigger("updated",this.conf)}getConf(){return this.conf}getEl(){return this.$root}getMarked(){return np()}watchConf(e,t){Ap(this,e,t)}}function Tp(e,t){let n=e.querySelector(":scope > .atk-loading");n||(n=op('<div class="atk-loading" style="display: none;">\n <div class="atk-loading-spinner">\n <svg viewBox="25 25 50 50"><circle cx="50" cy="50" r="20" fill="none" stroke-width="2" stroke-miterlimit="10"></circle></svg>\n </div>\n </div>'),(null==t?void 0:t.transparentBg)&&(n.style.background="transparent"),e.appendChild(n)),n.style.display="";const s=n.querySelector(".atk-loading-spinner");s&&(s.style.display="none",window.setTimeout((()=>{s.isConnected&&(s.style.display="")}),500))}function Lp(e){const t=e.querySelector(":scope > .atk-loading");t&&(t.style.display="none")}function Op(e,t){e?Tp(t):Lp(t)}function Np(e,t=!0,n){let s;if(n){const t=n.getBoundingClientRect();s=e.getBoundingClientRect().top-t.top+n.scrollTop-n.clientHeight/2+e.clientHeight/2}else{const t=e.getBoundingClientRect();s=t.top+window.scrollY-(window.innerHeight/2-t.height/2)}const r={top:s,left:0,behavior:"instant"};n?n.scroll(r):window.scroll(r)}function Ip(e,t){!function(e,t,n="in"){e.classList.add(`atk-fade-${n}`);const s=()=>{e.classList.remove(`atk-fade-${n}`),e.removeEventListener("animationend",s)};e.addEventListener("animationend",s)}(e,0,"in")}function Pp(e,t,n='<span class="atk-error-title">Artalk Error</span>'){let s=e.querySelector(".atk-error-layer");if(null===t)return void(null!==s&&s.remove());s||(s=op(`<div class="atk-error-layer">${n}<span class="atk-error-text"></span></div>`),e.appendChild(s));const r=s.querySelector(".atk-error-text");r.innerHTML="",null!==t&&(t instanceof HTMLElement?r.appendChild(t):r.innerText=t)}function Rp(e){const t=op('<div class="atk-checker-iframe-wrap"></div>'),n=op('<iframe class="atk-fade-in" referrerpolicy="strict-origin-when-cross-origin"></iframe>');n.style.display="none",Tp(t,{transparentBg:!0}),n.src=e.getOpts().getCaptchaIframeURL(),n.onload=()=>{n.style.display="",Lp(t)},t.append(n);const s=op('<div class="atk-close-btn"><i class="atk-icon atk-icon-close"></i></div>');t.append(s),e.hideInteractInput();let r=!1;return function t(){return Yc(this,null,(function*(){var n;if(yield(n=1e3,new Promise((e=>{window.setTimeout((()=>{e(null)}),n)}))),r)return;let s=!1;try{s=(yield e.getApi().captcha.getCaptchaStatus()).data.is_pass}catch(i){s=!1}s?e.triggerSuccess():t()}))}(),s.onclick=()=>{r=!0,e.cancel()},t}const Mp={request:(e,t)=>e.getApi().captcha.verifyCaptcha({value:t}),body:e=>e.get("iframe")?Rp(e):function(e){const t=op(`<span><img class="atk-captcha-img" src="${e.get("img_data")||""}">${_p("captchaCheck")}</span>`);return t.querySelector(".atk-captcha-img").onclick=()=>{const n=t.querySelector(".atk-captcha-img");e.getApi().captcha.getCaptcha().then((e=>{n.setAttribute("src",e.data.img_data)})).catch((e=>{console.error("Failed to get captcha image ",e)}))},t}(e),onSuccess(e,t,n,s){e.set("val",n)},onError(e,t,n,s){s.querySelector(".atk-captcha-img").click(),s.querySelector('input[type="text"]').value=""}},Dp={inputType:"password",request(e,t){return Yc(this,null,(function*(){return(yield e.getApi().user.login({name:e.getUser().getData().nick,email:e.getUser().getData().email,password:t})).data}))},body:e=>op(`<span>${_p("adminCheck")}</span>`),onSuccess(e,t,n,s){e.getUser().update({isAdmin:!0,token:t.token}),e.getOpts().onReload()},onError(e,t,n,s){}};class Up{constructor(e){Kc(this,"$el"),Kc(this,"$content"),Kc(this,"$actions"),this.$el=op('<div class="atk-layer-dialog-wrap">\n <div class="atk-layer-dialog">\n <div class="atk-layer-dialog-content"></div>\n <div class="atk-layer-dialog-actions"></div>\n </div>\n </div>'),this.$actions=this.$el.querySelector(".atk-layer-dialog-actions"),this.$content=this.$el.querySelector(".atk-layer-dialog-content"),this.$content.appendChild(e)}setYes(e){const t=op(`<button data-action="confirm">${_p("confirm")}</button>`);return t.onclick=this.onBtnClick(e),this.$actions.appendChild(t),this}setNo(e){const t=op(`<button data-action="cancel">${_p("cancel")}</button>`);return t.onclick=this.onBtnClick(e),this.$actions.appendChild(t),this}onBtnClick(e){return t=>{const n=e(t.currentTarget,this);void 0!==n&&!0!==n||this.$el.remove()}}}function Fp(e){return t=>new Promise(((n,s)=>{const r=t.onCancel;t.onCancel=()=>{r&&r(),s(new Error("user canceled the checker"))};const i=t.onSuccess;t.onSuccess=()=>{i&&i(),n()},e(t)}))}class jp{constructor(e){Kc(this,"checkCaptcha",Fp((e=>{this.fire(Mp,e,(t=>{t.set("img_data",e.img_data),t.set("iframe",e.iframe)}))}))),Kc(this,"checkAdmin",Fp((e=>{this.fire(Dp,e)}))),this.opts=e}fire(e,t,n){const s=this.opts.getCtx().get("layerManager").create(`checker-${(new Date).getTime()}`);s.show();const r=()=>{s.destroy()},i={};let o=!1;const a={set:(e,t)=>{i[e]=t},get:e=>i[e],getOpts:()=>this.opts,getUser:()=>this.opts.getCtx().get("user"),getApi:()=>this.opts.getApi(),hideInteractInput:()=>{o=!0},triggerSuccess:()=>{r(),e.onSuccess&&e.onSuccess(a,"","",l),t.onSuccess&&t.onSuccess()},cancel:()=>{r(),t.onCancel&&t.onCancel()}};n&&n(a);const l=op();l.appendChild(e.body(a));const c=op(`<input id="check" type="${e.inputType||"text"}" autocomplete="off" required placeholder="">`);let u;l.appendChild(c),setTimeout((()=>c.focus()),80),c.onkeyup=e=>{"Enter"!==e.key&&13!==e.keyCode||(e.preventDefault(),s.getEl().querySelector('button[data-action="confirm"]').click())};const d=new Up(l);d.setYes((n=>{const s=c.value.trim();u||(u=n.innerText);const i=()=>{n.innerText=u||"",n.classList.remove("error")};return n.innerText=`${_p("loading")}...`,e.request(a,s).then((n=>{r(),e.onSuccess&&e.onSuccess(a,n,s,l),t.onSuccess&&t.onSuccess()})).catch((t=>{var r;r=String(t.message||String(t)),n.innerText=r,n.classList.add("error"),e.onError&&e.onError(a,t,s,l);const o=setTimeout((()=>i()),3e3);c.onfocus=()=>{i(),clearTimeout(o)}})),!1})),d.setNo((()=>(r(),t.onCancel&&t.onCancel(),!1))),o&&(c.style.display="none",d.$el.querySelector(".atk-layer-dialog-actions").style.display="none"),s.getEl().append(d.$el),t.onMount&&t.onMount(d.$el)}}class Bp{constructor(e){Kc(this,"$el"),this.ctx=e}get conf(){return this.ctx.conf}getEl(){return this.$el}}const qp={$header:".atk-header",$nick:'.atk-header [name="nick"]',$email:'.atk-header [name="email"]',$link:'.atk-header [name="link"]',$textareaWrap:".atk-textarea-wrap",$textarea:".atk-textarea",$bottom:".atk-bottom",$submitBtn:".atk-send-btn",$notifyWrap:".atk-notify-wrap",$bottomLeft:".atk-bottom-left",$stateWrap:".atk-state-wrap",$plugBtnWrap:".atk-plug-btn-wrap",$plugPanelWrap:".atk-plug-panel-wrap"};class Wp{constructor(e){this.kit=e}useBtn(e="<div></div>"){return this.$btn=op(`<span class="atk-plug-btn">${e}</span>`),this.$btn}usePanel(e="<div></div>"){return this.$panel=op(e),this.$panel}useContentTransformer(e){this.contentTransformer=e}usePanelShow(e){this.kit.useEvents().on("panel-show",(t=>{t===this&&e()}))}usePanelHide(e){this.kit.useEvents().on("panel-hide",(t=>{t===this&&e()}))}useEditorStateEffect(e,t){this.editorStateEffectWhen=e,this.editorStateEffect=t}}class Hp extends Wp{constructor(){super(...arguments),Kc(this,"isMoved",!1)}move(e){if(this.isMoved)return;this.isMoved=!0;const t=this.kit.useUI().$el;t.after(op('<div class="atk-editor-travel-placeholder"></div>'));const n=op("<div></div>");e.after(n),n.replaceWith(t),t.classList.add("atk-fade-in"),t.classList.add("editor-traveling")}back(){var e;this.isMoved&&(this.isMoved=!1,null==(e=this.kit.useGlobalCtx().$root.querySelector(".atk-editor-travel-placeholder"))||e.replaceWith(this.kit.useUI().$el),this.kit.useUI().$el.classList.remove("editor-traveling"))}}class Vp{constructor(e){Kc(this,"stateCurt","normal"),Kc(this,"stateUnmountFn",null),this.editor=e}get(){return this.stateCurt}switch(e,t){var n,s,r,i,o;if(this.stateUnmountFn&&(this.stateUnmountFn(),this.stateUnmountFn=null,null==(s=null==(n=this.editor.getPlugs())?void 0:n.get(Hp))||s.back()),"normal"!==e&&t){let n=t.$comment;this.editor.conf.flatMode||(n=n.querySelector(".atk-footer")),null==(i=null==(r=this.editor.getPlugs())?void 0:r.get(Hp))||i.move(n);const s=this.editor.ctx.conf.scrollRelativeTo&&this.editor.ctx.conf.scrollRelativeTo();Np(this.editor.getUI().$el,!0,s);const a=null==(o=this.editor.getPlugs())?void 0:o.getPlugs().find((t=>t.editorStateEffectWhen===e));a&&a.editorStateEffect&&(this.stateUnmountFn=a.editorStateEffect(t.comment))}this.stateCurt=e}}class Kp extends Bp{constructor(e){super(e),Kc(this,"ui"),Kc(this,"state"),this.ui=function(){const e=op('<div class="atk-main-editor">\n <div class="atk-header">\n <input name="nick" class="atk-nick" type="text" required="required" />\n <input name="email" class="atk-email" type="email" required="required" />\n <input name="link" class="atk-link" type="url" />\n </div>\n <div class="atk-textarea-wrap">\n <textarea class="atk-textarea"></textarea>\n </div>\n <div class="atk-plug-panel-wrap" style="display: none"></div>\n <div class="atk-bottom">\n <div class="atk-item atk-bottom-left">\n <span class="atk-state-wrap"></span>\n <span class="atk-plug-btn-wrap"></span>\n </div>\n <div class="atk-item">\n <button type="button" class="atk-send-btn"></button>\n </div>\n </div>\n <div class="atk-notify-wrap"></div>\n</div>\n'),t={$el:e};return Object.entries(qp).forEach((([n,s])=>{t[n]=e.querySelector(s)})),t}(),this.$el=this.ui.$el,this.state=new Vp(this)}getUI(){return this.ui}getPlugs(){return this.ctx.get("editorPlugs")}getState(){return this.state.get()}getHeaderInputEls(){return{nick:this.ui.$nick,email:this.ui.$email,link:this.ui.$link}}getContentFinal(){let e=this.getContentRaw();const t=this.getPlugs();return t&&(e=t.getTransformedContent(e)),e}getContentRaw(){return this.ui.$textarea.value||""}getContentMarked(){return sp(this.getContentFinal())}setContent(e){var t;this.ui.$textarea.value=e,null==(t=this.getPlugs())||t.getEvents().trigger("content-updated",e)}insertContent(e){if(document.selection)this.ui.$textarea.focus(),document.selection.createRange().text=e,this.ui.$textarea.focus();else if(this.ui.$textarea.selectionStart||0===this.ui.$textarea.selectionStart){const t=this.ui.$textarea.selectionStart,n=this.ui.$textarea.selectionEnd,s=this.ui.$textarea.scrollTop;this.setContent(this.ui.$textarea.value.substring(0,t)+e+this.ui.$textarea.value.substring(n,this.ui.$textarea.value.length)),this.ui.$textarea.focus(),this.ui.$textarea.selectionStart=t+e.length,this.ui.$textarea.selectionEnd=t+e.length,this.ui.$textarea.scrollTop=s}else this.ui.$textarea.focus(),this.ui.$textarea.value+=e}focus(){this.ui.$textarea.focus()}reset(){this.setContent(""),this.resetState()}resetState(){this.state.switch("normal")}setReply(e,t){this.state.switch("reply",{comment:e,$comment:t})}setEditComment(e,t){this.state.switch("edit",{comment:e,$comment:t})}showNotify(e,t){!function(e,t,n){const s=op(`<div class="atk-notify atk-fade-in" style="background-color: ${{s:"#57d59f",e:"#ff6f6c",w:"#ffc721",i:"#2ebcfc"}[n]}"><span class="atk-notify-content"></span></div>`);s.querySelector(".atk-notify-content").innerHTML=ap(t).replace("\n","<br/>"),e.appendChild(s);const r=()=>{s.classList.add("atk-fade-out"),setTimeout((()=>{s.remove()}),200)};let i;i=window.setTimeout((()=>{r()}),3e3),s.addEventListener("click",(()=>{r(),window.clearTimeout(i)}))}(this.ui.$notifyWrap,e,t)}showLoading(){Tp(this.ui.$el)}hideLoading(){Lp(this.ui.$el)}submit(){const e=()=>this.ctx.trigger("editor-submit");this.ctx.conf.beforeSubmit?this.ctx.conf.beforeSubmit(this,e):e()}}class zp extends Bp{constructor(e){super(e),Kc(this,"layer"),Kc(this,"$header"),Kc(this,"$closeBtn"),Kc(this,"$iframeWrap"),Kc(this,"$iframe"),Kc(this,"refreshOnShow",!0),Kc(this,"animTimer"),this.$el=op('<div class="atk-sidebar-layer">\n <div class="atk-sidebar-inner">\n <div class="atk-sidebar-header">\n <div class="atk-sidebar-close">\n <i class="atk-icon atk-icon-close-slim"></i>\n </div>\n </div>\n <div class="atk-sidebar-iframe-wrap"></div>\n </div>\n</div>\n'),this.$header=this.$el.querySelector(".atk-sidebar-header"),this.$closeBtn=this.$header.querySelector(".atk-sidebar-close"),this.$iframeWrap=this.$el.querySelector(".atk-sidebar-iframe-wrap"),this.$closeBtn.onclick=()=>{this.hide()},this.ctx.on("user-changed",(()=>{this.refreshOnShow=!0}))}show(){return Yc(this,arguments,(function*(e={}){if(this.$el.style.transform="",this.initLayer(),this.layer.show(),this.refreshOnShow)this.refreshOnShow=!1,this.$iframeWrap.innerHTML="",this.$iframe=this.createIframe(e.view),this.$iframeWrap.append(this.$iframe);else{const e=this.$iframe,t=e.src;this.getDarkMode()!==t.includes("&darkMode=1")&&this.iframeLoad(e,this.getDarkMode()?t.concat("&darkMode=1"):t.replace("&darkMode=1",""))}this.authCheck({onSuccess:()=>this.show(e)}),this.animTimer=setTimeout((()=>{this.animTimer=void 0,this.$el.style.transform="translate(0, 0)",setTimeout((()=>{this.ctx.getData().updateNotifies([])}),0),this.ctx.trigger("sidebar-show")}),100)}))}hide(){var e;null==(e=this.layer)||e.hide()}authCheck(e){return Yc(this,null,(function*(){const t=(yield this.ctx.getApi().user.getUserStatus(Hc({},this.ctx.getApi().getUserFields()))).data;t.is_admin&&!t.is_login&&(this.refreshOnShow=!0,this.ctx.checkAdmin({onSuccess:()=>{setTimeout((()=>{e.onSuccess()}),500)},onCancel:()=>{this.hide()}}),this.hide())}))}initLayer(){this.layer||(this.layer=this.ctx.get("layerManager").create("sidebar",this.$el),this.layer.setOnAfterHide((()=>{this.ctx.editorResetState(),this.animTimer&&clearTimeout(this.animTimer),this.$el.style.transform="",this.ctx.trigger("sidebar-hide")})))}createIframe(e){const t=op('<iframe referrerpolicy="strict-origin-when-cross-origin"></iframe>'),n=fp({base:this.ctx.conf.server,path:"/sidebar/"}),s={pageKey:this.conf.pageKey,site:this.conf.site||"",user:JSON.stringify(this.ctx.get("user").getData()),time:+new Date};e&&(s.view=e),this.getDarkMode()&&(s.darkMode="1");const r=new URLSearchParams(s);return this.iframeLoad(t,`${n}?${r.toString()}`),t}getDarkMode(){return"auto"===this.conf.darkMode?window.matchMedia("(prefers-color-scheme: dark)").matches:this.conf.darkMode}iframeLoad(e,t){e.src=t,Tp(this.$iframeWrap),e.onload=()=>{Lp(this.$iframeWrap)}}}const Gp=e=>({import:t=>{(function(e,t="DATE_DESC",n=2){const s=[];e.filter((e=>0===e.rid)).forEach((t=>{const r={id:t.id,comment:t,children:[],level:1};r.parent=r,s.push(r),function t(s){const r=e.filter((e=>e.rid===s.id));0!==r.length&&(s.level>=n&&(s=s.parent),r.forEach((e=>{const n={id:e.id,comment:e,children:[],parent:s,level:s.level+1};s.children.push(n),t(n)})))}(r)}));const r=(n,s)=>{let r=n.id-s.id;return"DATE_ASC"===t?r=+new Date(n.comment.date)-+new Date(s.comment.date):"DATE_DESC"===t?r=+new Date(s.comment.date)-+new Date(n.comment.date):"SRC_INDEX"===t?r=e.indexOf(n.comment)-e.indexOf(s.comment):"VOTE_UP_DESC"===t&&(r=s.comment.vote_up-n.comment.vote_up),r};return function e(t){t.forEach((t=>{t.children=t.children.sort(r),e(t.children)}))}(s),s})(t,e.nestSortBy,e.nestMax).forEach((n=>{var s;const r=e.createCommentNode(n.comment);null==(s=e.$commentsWrap)||s.appendChild(r.getEl()),r.getRender().playFadeAnim();const i=(n,s)=>{s.children.forEach((s=>{const r=t.find((e=>e.id===s.comment.rid)),o=s.comment,a=e.createCommentNode(o,r);n.putChild(a),i(a,s)}))};i(r,n),r.getRender().checkHeightLimit()}))},insert:(t,n)=>{var s;const r=e.createCommentNode(t,n);if(0===t.rid)null==(s=e.$commentsWrap)||s.prepend(r.getEl());else{const n=e.findCommentNode(t.rid);n&&(n.putChild(r,"DATE_ASC"===e.nestSortBy?"append":"prepend"),r.getParents().forEach((e=>{e.getRender().heightLimitRemoveForChildren()})))}r.getRender().checkHeightLimit(),r.scrollIntoView(),r.getRender().playFadeAnim()}});function Yp(e,t,n,s){n.is_collapsed&&(n.is_allow_reply=!1);const r=e.createCommentNode(n,s);if(n.visible){const n=r.getEl(),s=e.$commentsWrap;"append"===t&&(null==s||s.append(n)),"prepend"===t&&(null==s||s.prepend(n)),r.getRender().playFadeAnim()}return r.getRender().checkHeightLimit(),r}class Qp{constructor(e){this.options=e}getStrategy(){return this.options.flatMode?(e=this.options,{import:t=>{t.forEach((n=>{const s=0===n.rid?void 0:t.find((e=>e.id===n.rid));Yp(e,"append",n,s)}))},insert:(t,n)=>{Yp(e,"prepend",t,n).scrollIntoView()}}):Gp(this.options);var e}import(e){this.getStrategy().import(e)}insert(e,t){this.getStrategy().insert(e,t)}}function Xp(e,t){t.forEach((({el:t,max:n,imgCheck:s})=>{if(!t)return;s&&(t.style.maxHeight=`${n+1}px`);let r=!1;const i=()=>{if(r)return;if(function(e){return parseFloat(getComputedStyle(e,null).height.replace("px",""))||0}(t)<=n)return;e.scrollable?function(e){if(!e.el)return;if(e.el.classList.contains(eh))return;e.el.classList.add(eh),e.el.style.height=`${e.max}px`}({el:t,max:n}):function(e){if(!e.el)return;if(!e.max)return;if(e.el.classList.contains(Jp))return;e.el.classList.add(Jp),e.el.style.height=`${e.max}px`,e.el.style.overflow="hidden";const t=op(`<div class="atk-height-limit-btn">${_p("readMore")}</span>`);t.onclick=t=>{t.stopPropagation(),Zp(e.el),e.afterExpandBtnClick&&e.afterExpandBtnClick(t)},e.el.append(t)}({el:t,max:n,afterExpandBtnClick:()=>{var t;r=!0,null==(t=e.afterExpandBtnClick)||t.call(e)}})};if(i(),s){const e=t.querySelectorAll(".atk-content img");0===e.length&&(t.style.maxHeight=""),e.forEach((e=>{e.onload=()=>i()}))}}))}const Jp="atk-height-limit";function Zp(e){e&&e.classList.contains(Jp)&&(e.classList.remove(Jp),Array.from(e.children).forEach((e=>{e.classList.contains("atk-height-limit-btn")&&e.remove()})),e.style.height="",e.style.maxHeight="",e.style.overflow="")}const eh="atk-height-limit-scroll";function th(e){if(e.$headerNick=e.$el.querySelector(".atk-nick"),e.data.link){const t=op('<a target="_blank" rel="noreferrer noopener nofollow"></a>');t.innerText=e.data.nick,t.href=hp(e.data.link)?e.data.link:`https://${e.data.link}`,e.$headerNick.append(t)}else e.$headerNick.innerText=e.data.nick}function nh(e){e.$headerBadgeWrap=e.$el.querySelector(".atk-badge-wrap"),e.$headerBadgeWrap.innerHTML="";const t=e.data.badge_name,n=e.data.badge_color;if(t){const s=op('<span class="atk-badge"></span>');s.innerText=t.replace("管理员",_p("admin")),s.style.backgroundColor=n||"",e.$headerBadgeWrap.append(s)}else if(e.data.is_verified){const t=op(`<span class="atk-verified-icon" title="${_p("emailVerified")}"></span>`);e.$headerBadgeWrap.append(t)}if(e.data.is_pinned){const t=op(`<span class="atk-pinned-badge">${_p("pin")}</span>`);e.$headerBadgeWrap.append(t)}}function sh(e){const t=e.$el.querySelector(".atk-date");t.innerText=e.comment.getDateFormatted(),t.setAttribute("data-atk-comment-date",String(+new Date(e.data.date)))}function rh(e){if(!e.opts.uaBadge&&!e.data.ip_region)return;let t=e.$header.querySelector("atk-ua-wrap");if(t||(t=op('<span class="atk-ua-wrap"></span>'),e.$header.append(t)),t.innerHTML="",e.data.ip_region){const n=op('<span class="atk-region-badge"></span>');n.innerText=e.data.ip_region,t.append(n)}if(e.opts.uaBadge){const{browser:n,os:s}=e.comment.getUserUA();if(String(n).trim()){const e=op('<span class="atk-ua ua-browser"></span>');e.innerText=n,t.append(e)}if(String(s).trim()){const e=op('<span class="atk-ua ua-os"></span>');e.innerText=s,t.append(e)}}}class ih{constructor(e){Kc(this,"opts"),Kc(this,"$el"),Kc(this,"isLoading",!1),Kc(this,"msgRecTimer"),Kc(this,"msgRecTimerFunc"),Kc(this,"isConfirming",!1),Kc(this,"confirmRecTimer"),this.$el=op('<span class="atk-common-action-btn"></span>'),this.opts="object"!=typeof e?{text:e}:e,this.$el.innerText=this.getText(),this.opts.adminOnly&&this.$el.setAttribute("atk-only-admin-show","")}get isMessaging(){return!!this.msgRecTimer}appendTo(e){return e.append(this.$el),this}getText(){return"string"==typeof this.opts.text?this.opts.text:this.opts.text()}setClick(e){this.$el.onclick=t=>{if(t.stopPropagation(),!this.isLoading){if(this.opts.confirm&&!this.isMessaging){const e=()=>{this.isConfirming=!1,this.$el.classList.remove("atk-btn-confirm"),this.$el.innerText=this.getText()};if(!this.isConfirming)return this.isConfirming=!0,this.$el.classList.add("atk-btn-confirm"),this.$el.innerText=this.opts.confirmText||_p("actionConfirm"),void(this.confirmRecTimer=window.setTimeout((()=>e()),5e3));this.confirmRecTimer&&window.clearTimeout(this.confirmRecTimer),e()}if(this.msgRecTimer)return this.fireMsgRecTimer(),void this.clearMsgRecTimer();e()}}}updateText(e){e&&(this.opts.text=e),this.setLoading(!1),this.$el.innerText=this.getText()}setLoading(e,t){this.isLoading!==e&&(this.isLoading=e,e?(this.$el.classList.add("atk-btn-loading"),this.$el.innerText=t||`${_p("loading")}...`):(this.$el.classList.remove("atk-btn-loading"),this.$el.innerText=this.getText()))}setError(e){this.setMsg(e,"atk-btn-error")}setWarn(e){this.setMsg(e,"atk-btn-warn")}setSuccess(e){this.setMsg(e,"atk-btn-success")}setMsg(e,t,n,s){this.setLoading(!1),t&&this.$el.classList.add(t),this.$el.innerText=e,this.setMsgRecTimer((()=>{this.$el.innerText=this.getText(),t&&this.$el.classList.remove(t),s&&s()}),n||2500)}setMsgRecTimer(e,t){this.fireMsgRecTimer(),this.clearMsgRecTimer(),this.msgRecTimerFunc=e,this.msgRecTimer=window.setTimeout((()=>{e(),this.clearMsgRecTimer()}),t)}fireMsgRecTimer(){this.msgRecTimerFunc&&this.msgRecTimerFunc()}clearMsgRecTimer(){this.msgRecTimer&&window.clearTimeout(this.msgRecTimer),this.msgRecTimer=void 0,this.msgRecTimerFunc=void 0}}function oh(e){e.opts.vote&&(e.voteBtnUp=new ih((()=>`${_p("voteUp")} (${e.data.vote_up||0})`)).appendTo(e.$actions),e.voteBtnUp.setClick((()=>{e.comment.getActions().vote("up")})),e.opts.voteDown&&(e.voteBtnDown=new ih((()=>`${_p("voteDown")} (${e.data.vote_down||0})`)).appendTo(e.$actions),e.voteBtnDown.setClick((()=>{e.comment.getActions().vote("down")}))))}function ah(e){if(!e.data.is_allow_reply)return;const t=op(`<span>${_p("reply")}</span>`);e.$actions.append(t),t.addEventListener("click",(t=>{t.stopPropagation(),e.opts.replyComment(e.data,e.$el)}))}function lh(e){const t=new ih({text:()=>e.data.is_collapsed?_p("expand"):_p("collapse"),adminOnly:!0});t.appendTo(e.$actions),t.setClick((()=>{e.comment.getActions().adminEdit("collapsed",t)}))}function ch(e){const t=new ih({text:()=>e.data.is_pending?_p("pending"):_p("approved"),adminOnly:!0});t.appendTo(e.$actions),t.setClick((()=>{e.comment.getActions().adminEdit("pending",t)}))}function uh(e){const t=new ih({text:()=>e.data.is_pinned?_p("unpin"):_p("pin"),adminOnly:!0});t.appendTo(e.$actions),t.setClick((()=>{e.comment.getActions().adminEdit("pinned",t)}))}function dh(e){const t=new ih({text:_p("edit"),adminOnly:!0});t.appendTo(e.$actions),t.setClick((()=>{e.opts.editComment(e.data,e.$el)}))}function ph(e){const t=new ih({text:_p("delete"),confirm:!0,confirmText:_p("deleteConfirm"),adminOnly:!0});t.appendTo(e.$actions),t.setClick((()=>{e.comment.getActions().adminDelete(t)}))}const hh={Avatar:function(e){const t=e.$el.querySelector(".atk-avatar"),n=op("<img />"),s=e.opts.avatarURLBuilder;if(n.src=s?s(e.data):e.comment.getGravatarURL(),e.data.link){const s=op('<a target="_blank" rel="noreferrer noopener nofollow"></a>');s.href=hp(e.data.link)?e.data.link:`https://${e.data.link}`,s.append(n),t.append(s)}else t.append(n)},Header:function(e){Object.entries({renderNick:th,renderVerifyBadge:nh,renderDate:sh,renderUABadge:rh}).forEach((([t,n])=>{n(e)}))},Content:function(e){if(!e.data.is_collapsed)return e.$content.innerHTML=e.comment.getContentMarked(),void e.$content.classList.remove("atk-hide","atk-collapsed");e.$content.classList.add("atk-hide","atk-type-collapsed");const t=op(`\n <div class="atk-collapsed">\n <span class="atk-text">${_p("collapsedMsg")}</span>\n <span class="atk-show-btn">${_p("expand")}</span>\n </div>`);e.$body.insertAdjacentElement("beforeend",t);const n=t.querySelector(".atk-show-btn");n.addEventListener("click",(t=>{t.stopPropagation(),e.$content.classList.contains("atk-hide")?(e.$content.innerHTML=e.comment.getContentMarked(),e.$content.classList.remove("atk-hide"),Ip(e.$content),n.innerText=_p("collapse")):(e.$content.innerHTML="",e.$content.classList.add("atk-hide"),n.innerText=_p("expand"))}))},ReplyAt:function(e){e.opts.flatMode||0===e.data.rid||e.opts.replyTo&&(e.$replyAt=op('<span class="atk-item atk-reply-at"><span class="atk-arrow"></span><span class="atk-nick"></span></span>'),e.$replyAt.querySelector(".atk-nick").innerText=`${e.opts.replyTo.nick}`,e.$replyAt.onclick=()=>{e.comment.getActions().goToReplyComment()},e.$headerBadgeWrap.insertAdjacentElement("afterend",e.$replyAt))},ReplyTo:function(e){if(!e.opts.flatMode)return;if(!e.opts.replyTo)return;e.$replyTo=op(`\n <div class="atk-reply-to">\n <div class="atk-meta">${_p("reply")} <span class="atk-nick"></span>:</div>\n <div class="atk-content"></div>\n </div>`);const t=e.$replyTo.querySelector(".atk-nick");t.innerText=`@${e.opts.replyTo.nick}`,t.onclick=()=>{e.comment.getActions().goToReplyComment()};let n=sp(e.opts.replyTo.content);e.opts.replyTo.is_collapsed&&(n=`[${_p("collapsed")}]`),e.$replyTo.querySelector(".atk-content").innerHTML=n,e.$body.prepend(e.$replyTo)},Pending:function(e){if(!e.data.is_pending)return;const t=op(`<div class="atk-pending">${_p("pendingMsg")}</div>`);e.$body.prepend(t)},Actions:function(e){Object.entries({renderVote:oh,renderReply:ah,renderCollapse:lh,renderModerator:ch,renderPin:uh,renderEdit:dh,renderDel:ph}).forEach((([t,n])=>{n(e)}))}};class fh{constructor(e){Kc(this,"comment"),Kc(this,"$el"),Kc(this,"$main"),Kc(this,"$header"),Kc(this,"$headerNick"),Kc(this,"$headerBadgeWrap"),Kc(this,"$body"),Kc(this,"$content"),Kc(this,"$childrenWrap"),Kc(this,"$actions"),Kc(this,"voteBtnUp"),Kc(this,"voteBtnDown"),Kc(this,"$replyTo"),Kc(this,"$replyAt"),this.comment=e}get data(){return this.comment.getData()}get opts(){return this.comment.getOpts()}render(){var e;return this.$el=op('<div class="atk-comment-wrap">\n <div class="atk-comment">\n <div class="atk-avatar"></div>\n <div class="atk-main">\n <div class="atk-header">\n <span class="atk-item atk-nick"></span>\n <span class="atk-badge-wrap"></span>\n <span class="atk-item atk-date"></span>\n </div>\n <div class="atk-body">\n <div class="atk-content"></div>\n </div>\n <div class="atk-footer">\n <div class="atk-actions"></div>\n </div>\n </div>\n </div>\n</div>\n'),this.$main=this.$el.querySelector(".atk-main"),this.$header=this.$el.querySelector(".atk-header"),this.$body=this.$el.querySelector(".atk-body"),this.$content=this.$body.querySelector(".atk-content"),this.$actions=this.$el.querySelector(".atk-actions"),this.$el.setAttribute("id",`atk-comment-${this.data.id}`),e=this,Object.entries(hh).forEach((([t,n])=>{n(e)})),this.$childrenWrap&&this.$main.append(this.$childrenWrap),this.$el}checkHeightLimit(){const e=this.opts.heightLimit;if(!e||!e.content||!e.children)return;const t=e.content,n=e.children;Xp({afterExpandBtnClick:()=>{const e=this.comment.getChildren();1===e.length&&Zp(e[0].getRender().$content)},scrollable:e.scrollable},[{el:this.$content,max:t,imgCheck:!0},{el:this.$replyTo,max:t,imgCheck:!0},{el:this.$childrenWrap,max:n,imgCheck:!1}])}heightLimitRemoveForChildren(){this.$childrenWrap&&Zp(this.$childrenWrap)}playFadeAnim(){Ip(this.comment.getRender().$el)}playFadeAnimForBody(){Ip(this.comment.getRender().$body)}playFlashAnim(){this.$el.classList.remove("atk-flash-once"),window.setTimeout((()=>{this.$el.classList.add("atk-flash-once")}),150)}getChildrenWrap(){return this.$childrenWrap||(this.$childrenWrap=op('<div class="atk-comment-children"></div>'),this.$main.append(this.$childrenWrap)),this.$childrenWrap}setUnread(e){e?this.$el.classList.add("atk-unread"):this.$el.classList.remove("atk-unread")}setOpenable(e){e?this.$el.classList.add("atk-openable"):this.$el.classList.remove("atk-openable")}setOpenURL(e){this.setOpenable(!0),this.$el.onclick=t=>{t.stopPropagation(),window.open(e)}}setOpenAction(e){this.setOpenable(!0),this.$el.onclick=t=>{t.stopPropagation(),e()}}}class mh{constructor(e){Kc(this,"comment"),this.comment=e}get data(){return this.comment.getData()}get opts(){return this.comment.getOpts()}getApi(){return this.comment.getOpts().getApi()}vote(e){const t="up"===e?this.comment.getRender().voteBtnUp:this.comment.getRender().voteBtnDown;this.getApi().votes.vote(`comment_${e}`,this.data.id,Hc({},this.getApi().getUserFields())).then((e=>{var t,n;this.data.vote_up=e.data.up,this.data.vote_down=e.data.down,null==(t=this.comment.getRender().voteBtnUp)||t.updateText(),null==(n=this.comment.getRender().voteBtnDown)||n.updateText()})).catch((e=>{null==t||t.setError(_p("voteFail")),console.error(e)}))}adminEdit(e,t){if(t.isLoading)return;t.setLoading(!0,`${_p("editing")}...`);const n=Hc({},this.data);"collapsed"===e?n.is_collapsed=!n.is_collapsed:"pending"===e?n.is_pending=!n.is_pending:"pinned"===e&&(n.is_pinned=!n.is_pinned),this.getApi().comments.updateComment(this.data.id,Hc({},n)).then((e=>{t.setLoading(!1),this.comment.setData(e.data)})).catch((e=>{console.error(e),t.setError(_p("editFail"))}))}adminDelete(e){e.isLoading||(e.setLoading(!0,`${_p("deleting")}...`),this.getApi().comments.deleteComment(this.data.id).then((()=>{e.setLoading(!1),this.opts.onDelete&&this.opts.onDelete(this.comment)})).catch((t=>{console.error(t),e.setError(_p("deleteFail"))})))}goToReplyComment(){const e=window.location.hash,t=`#atk-comment-${this.data.rid}`;window.location.hash=t,t===e&&window.dispatchEvent(new Event("hashchange"))}}class gh{constructor(e,t){Kc(this,"$el"),Kc(this,"renderInstance"),Kc(this,"actionInstance"),Kc(this,"data"),Kc(this,"opts"),Kc(this,"parent"),Kc(this,"children",[]),Kc(this,"nestCurt"),this.opts=t,this.data=Hc({},e),this.data.date=this.data.date.replace(/-/g,"/"),this.parent=null,this.nestCurt=1,this.actionInstance=new mh(this),this.renderInstance=new fh(this)}render(){const e=this.renderInstance.render();this.$el&&this.$el.replaceWith(e),this.$el=e,this.opts.onAfterRender&&this.opts.onAfterRender()}getActions(){return this.actionInstance}getRender(){return this.renderInstance}getData(){return this.data}setData(e){this.data=e,this.render(),this.getRender().playFadeAnimForBody()}getParent(){return this.parent}getChildren(){return this.children}getNestCurt(){return this.nestCurt}getIsRoot(){return 0===this.data.rid}getID(){return this.data.id}putChild(e,t="append"){e.parent=this,e.nestCurt=this.nestCurt+1,this.children.push(e);const n=this.getChildrenWrapEl(),s=e.getEl();"append"===t?n.append(s):"prepend"===t&&n.prepend(s),e.getRender().playFadeAnim(),e.getRender().checkHeightLimit()}getChildrenWrapEl(){return this.nestCurt>=this.opts.nestMax?this.parent.getChildrenWrapEl():this.getRender().getChildrenWrap()}getParents(){const e=[];let t=this.parent;for(;t;)e.push(t),t=t.getParent();return e}getEl(){if(!this.$el)throw new Error("comment element not initialized before `getEl()`");return this.$el}focus(){if(!this.$el)throw new Error("comment element not initialized before `focus()`");this.getParents().forEach((e=>{e.getRender().heightLimitRemoveForChildren()})),this.scrollIntoView(),this.getRender().playFlashAnim()}scrollIntoView(){this.$el&&Np(this.$el,!1,this.opts.scrollRelativeTo&&this.opts.scrollRelativeTo())}remove(){var e;null==(e=this.$el)||e.remove()}getGravatarURL(){return`${(e={mirror:this.opts.gravatar.mirror,params:this.opts.gravatar.params,emailHash:this.data.email_encrypted}).mirror.replace(/\/$/,"")}/${e.emailHash}?${e.params.replace(/^\?/,"")}`;var e}getContentMarked(){return sp(this.data.content)}getDateFormatted(){return dp(new Date(this.data.date),_p)}getUserUA(){const e=function(e){const t=window||{},n=navigator||{},s=String(e||n.userAgent),r={os:"",osVersion:"",engine:"",browser:"",device:"",language:"",version:""},i={Trident:s.includes("Trident")||s.includes("NET CLR"),Presto:s.includes("Presto"),WebKit:s.includes("AppleWebKit"),Gecko:s.includes("Gecko/")},o={Safari:s.includes("Safari"),Chrome:s.includes("Chrome")||s.includes("CriOS"),IE:s.includes("MSIE")||s.includes("Trident"),Edge:s.includes("Edge")||s.includes("Edg"),Firefox:s.includes("Firefox")||s.includes("FxiOS"),"Firefox Focus":s.includes("Focus"),Chromium:s.includes("Chromium"),Opera:s.includes("Opera")||s.includes("OPR"),Vivaldi:s.includes("Vivaldi"),Yandex:s.includes("YaBrowser"),Kindle:s.includes("Kindle")||s.includes("Silk/"),360:s.includes("360EE")||s.includes("360SE"),UC:s.includes("UC")||s.includes(" UBrowser"),QQBrowser:s.includes("QQBrowser"),QQ:s.includes("QQ/"),Baidu:s.includes("Baidu")||s.includes("BIDUBrowser"),Maxthon:s.includes("Maxthon"),Sogou:s.includes("MetaSr")||s.includes("Sogou"),LBBROWSER:s.includes("LBBROWSER"),"2345Explorer":s.includes("2345Explorer"),TheWorld:s.includes("TheWorld"),MIUI:s.includes("MiuiBrowser"),Quark:s.includes("Quark"),Qiyu:s.includes("Qiyu"),Wechat:s.includes("MicroMessenger"),Taobao:s.includes("AliApp(TB"),Alipay:s.includes("AliApp(AP"),Weibo:s.includes("Weibo"),Douban:s.includes("com.douban.frodo"),Suning:s.includes("SNEBUY-APP"),iQiYi:s.includes("IqiyiApp")},a={Windows:s.includes("Windows"),Linux:s.includes("Linux")||s.includes("X11"),macOS:s.includes("Macintosh"),Android:s.includes("Android")||s.includes("Adr"),Ubuntu:s.includes("Ubuntu"),FreeBSD:s.includes("FreeBSD"),Debian:s.includes("Debian"),"Windows Phone":s.includes("IEMobile")||s.includes("Windows Phone"),BlackBerry:s.includes("BlackBerry")||s.includes("RIM"),MeeGo:s.includes("MeeGo"),Symbian:s.includes("Symbian"),iOS:s.includes("like Mac OS X"),"Chrome OS":s.includes("CrOS"),WebOS:s.includes("hpwOS")},l={Mobile:s.includes("Mobi")||s.includes("iPh")||s.includes("480"),Tablet:s.includes("Tablet")||s.includes("Pad")||s.includes("Nexus 7")};l.Mobile?l.Mobile=!s.includes("iPad"):o.Chrome&&s.includes("Edg")?(o.Chrome=!1,o.Edge=!0):t.showModalDialog&&t.chrome&&(o.Chrome=!1,o[360]=!0),r.device="PC",r.language=(()=>{const e=(n.browserLanguage||n.language).split("-");return e[1]&&(e[1]=e[1].toUpperCase()),e.join("_")})();const c={engine:i,browser:o,os:a,device:l};Object.entries(c).forEach((([e,t])=>{Object.entries(t).forEach((([t,n])=>{!0===n&&(r[e]=t)}))}));const u={Windows:()=>{const e=s.replace(/^.*Windows NT ([\d.]+);.*$/,"$1");return{6.4:"10",6.3:"8.1",6.2:"8",6.1:"7","6.0":"Vista",5.2:"XP",5.1:"XP","5.0":"2000","10.0":"10","11.0":"11"}[e]||e},Android:()=>s.replace(/^.*Android ([\d.]+);.*$/,"$1"),iOS:()=>s.replace(/^.*OS ([\d_]+) like.*$/,"$1").replace(/_/g,"."),Debian:()=>s.replace(/^.*Debian\/([\d.]+).*$/,"$1"),"Windows Phone":()=>s.replace(/^.*Windows Phone( OS)? ([\d.]+);.*$/,"$2"),macOS:()=>s.replace(/^.*Mac OS X ([\d_]+).*$/,"$1").replace(/_/g,"."),WebOS:()=>s.replace(/^.*hpwOS\/([\d.]+);.*$/,"$1")};r.osVersion="",u[r.os]&&(r.osVersion=u[r.os](),r.osVersion===s&&(r.osVersion=""));const d={Safari:()=>s.replace(/^.*Version\/([\d.]+).*$/,"$1"),Chrome:()=>s.replace(/^.*Chrome\/([\d.]+).*$/,"$1").replace(/^.*CriOS\/([\d.]+).*$/,"$1"),IE:()=>s.replace(/^.*MSIE ([\d.]+).*$/,"$1").replace(/^.*rv:([\d.]+).*$/,"$1"),Edge:()=>s.replace(/^.*(Edge|Edg|Edg[A-Z]{1})\/([\d.]+).*$/,"$2"),Firefox:()=>s.replace(/^.*Firefox\/([\d.]+).*$/,"$1").replace(/^.*FxiOS\/([\d.]+).*$/,"$1"),"Firefox Focus":()=>s.replace(/^.*Focus\/([\d.]+).*$/,"$1"),Chromium:()=>s.replace(/^.*Chromium\/([\d.]+).*$/,"$1"),Opera:()=>s.replace(/^.*Opera\/([\d.]+).*$/,"$1").replace(/^.*OPR\/([\d.]+).*$/,"$1"),Vivaldi:()=>s.replace(/^.*Vivaldi\/([\d.]+).*$/,"$1"),Yandex:()=>s.replace(/^.*YaBrowser\/([\d.]+).*$/,"$1"),Kindle:()=>s.replace(/^.*Version\/([\d.]+).*$/,"$1"),Maxthon:()=>s.replace(/^.*Maxthon\/([\d.]+).*$/,"$1"),QQBrowser:()=>s.replace(/^.*QQBrowser\/([\d.]+).*$/,"$1"),QQ:()=>s.replace(/^.*QQ\/([\d.]+).*$/,"$1"),Baidu:()=>s.replace(/^.*BIDUBrowser[\s/]([\d.]+).*$/,"$1"),UC:()=>s.replace(/^.*UC?Browser\/([\d.]+).*$/,"$1"),Sogou:()=>s.replace(/^.*SE ([\d.X]+).*$/,"$1").replace(/^.*SogouMobileBrowser\/([\d.]+).*$/,"$1"),"2345Explorer":()=>s.replace(/^.*2345Explorer\/([\d.]+).*$/,"$1"),TheWorld:()=>s.replace(/^.*TheWorld ([\d.]+).*$/,"$1"),MIUI:()=>s.replace(/^.*MiuiBrowser\/([\d.]+).*$/,"$1"),Quark:()=>s.replace(/^.*Quark\/([\d.]+).*$/,"$1"),Qiyu:()=>s.replace(/^.*Qiyu\/([\d.]+).*$/,"$1"),Wechat:()=>s.replace(/^.*MicroMessenger\/([\d.]+).*$/,"$1"),Taobao:()=>s.replace(/^.*AliApp\(TB\/([\d.]+).*$/,"$1"),Alipay:()=>s.replace(/^.*AliApp\(AP\/([\d.]+).*$/,"$1"),Weibo:()=>s.replace(/^.*weibo__([\d.]+).*$/,"$1"),Douban:()=>s.replace(/^.*com.douban.frodo\/([\d.]+).*$/,"$1"),Suning:()=>s.replace(/^.*SNEBUY-APP([\d.]+).*$/,"$1"),iQiYi:()=>s.replace(/^.*IqiyiVersion\/([\d.]+).*$/,"$1")};return r.version="",d[r.browser]&&(r.version=d[r.browser](),r.version===s&&(r.version="")),r.version.indexOf(".")&&(r.version=r.version.substring(0,r.version.indexOf("."))),"iOS"===r.os&&s.includes("iPad")?r.os="iPadOS":"Edge"!==r.browser||s.includes("Edg")?"MIUI"===r.browser?r.os="Android":"Chrome"===r.browser&&Number(r.version)>27||"Opera"===r.browser&&Number(r.version)>12||"Yandex"===r.browser?r.engine="Blink":void 0===r.browser&&(r.browser="Unknow App"):r.engine="EdgeHTML",r}(this.data.ua);return{browser:`${e.browser} ${e.version}`,os:`${e.os} ${e.osVersion}`}}getOpts(){return this.opts}}class vh{constructor(e){Kc(this,"opts"),Kc(this,"$el"),Kc(this,"$loading"),Kc(this,"$text"),Kc(this,"offset",0),Kc(this,"total",0),Kc(this,"origText","Load More"),this.opts=e,this.origText=this.opts.text||this.origText,this.$el=op(`<div class="atk-list-read-more" style="display: none;">\n <div class="atk-list-read-more-inner">\n <div class="atk-loading-icon" style="display: none;"></div>\n <span class="atk-text">${this.origText}</span>\n </div>\n </div>`),this.$loading=this.$el.querySelector(".atk-loading-icon"),this.$text=this.$el.querySelector(".atk-text"),this.$el.onclick=()=>{this.click()}}get hasMore(){return this.total>this.offset+this.opts.pageSize}click(){this.hasMore&&this.opts.onClick(this.offset+this.opts.pageSize),this.checkDisabled()}show(){this.$el.style.display=""}hide(){this.$el.style.display="none"}setLoading(e){this.$loading.style.display=e?"":"none",this.$text.style.display=e?"none":""}showErr(e){this.setLoading(!1),this.$text.innerText=e,this.$el.classList.add("atk-err"),window.setTimeout((()=>{this.$text.innerText=this.origText,this.$el.classList.remove("atk-err")}),2e3)}update(e,t){this.offset=e,this.total=t,this.checkDisabled()}checkDisabled(){this.hasMore?this.show():this.hide()}}class yh{constructor(){Kc(this,"instance"),Kc(this,"onReachedBottom",null),Kc(this,"opt")}create(e){return this.opt=e,this.instance=new vh({pageSize:e.pageSize,onClick:t=>Yc(this,null,(function*(){e.ctx.fetch({offset:t})})),text:_p("loadMore")}),e.readMoreAutoLoad&&(this.onReachedBottom=()=>{this.instance.hasMore&&!this.opt.ctx.getData().getLoading()&&this.instance.click()},this.opt.ctx.on("list-reach-bottom",this.onReachedBottom)),this.instance.$el}setLoading(e){this.instance.setLoading(e)}update(e,t){this.instance.update(e,t)}showErr(e){this.instance.showErr(e)}next(){this.instance.click()}getHasMore(){return this.instance.hasMore}getIsClearComments(e){return 0===e.offset}dispose(){this.onReachedBottom&&this.opt.ctx.off("list-reach-bottom",this.onReachedBottom),this.instance.$el.remove()}}let kh=class{constructor(e,t){Kc(this,"opts"),Kc(this,"total"),Kc(this,"$el"),Kc(this,"$input"),Kc(this,"inputTimer"),Kc(this,"$prevBtn"),Kc(this,"$nextBtn"),Kc(this,"page",1),this.total=e,this.opts=t,this.$el=op('<div class="atk-pagination-wrap">\n <div class="atk-pagination">\n <div class="atk-btn atk-btn-prev" aria-label="Previous page">\n <svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 512 512" height="14px" width="14px" xmlns="http://www.w3.org/2000/svg"><path d="M217.9 256L345 129c9.4-9.4 9.4-24.6 0-33.9-9.4-9.4-24.6-9.3-34 0L167 239c-9.1 9.1-9.3 23.7-.7 33.1L310.9 417c4.7 4.7 10.9 7 17 7s12.3-2.3 17-7c9.4-9.4 9.4-24.6 0-33.9L217.9 256z"></path></svg>\n </div>\n <input type="text" class="atk-input" aria-label="Enter the number of page" />\n <div class="atk-btn atk-btn-next" aria-label="Next page">\n <svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 512 512" height="14px" width="14px" xmlns="http://www.w3.org/2000/svg"><path d="M294.1 256L167 129c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.3 34 0L345 239c9.1 9.1 9.3 23.7.7 33.1L201.1 417c-4.7 4.7-10.9 7-17 7s-12.3-2.3-17-7c-9.4-9.4-9.4-24.6 0-33.9l127-127.1z"></path></svg>\n </div>\n </div>\n </div>'),this.$input=this.$el.querySelector(".atk-input"),this.$input.value=`${this.page}`,this.$input.oninput=()=>this.input(),this.$input.onkeydown=e=>this.keydown(e),this.$prevBtn=this.$el.querySelector(".atk-btn-prev"),this.$nextBtn=this.$el.querySelector(".atk-btn-next"),this.$prevBtn.onclick=()=>this.prev(),this.$nextBtn.onclick=()=>this.next(),this.checkDisabled()}get pageSize(){return this.opts.pageSize}get offset(){return this.pageSize*(this.page-1)}get maxPage(){return Math.ceil(this.total/this.pageSize)}update(e,t){this.page=Math.ceil(e/this.pageSize)+1,this.total=t,this.setInput(this.page),this.checkDisabled()}setInput(e){this.$input.value=`${e}`}input(e=!1){window.clearTimeout(this.inputTimer);const t=this.$input.value.trim(),n=()=>{if(""===t)return void this.setInput(this.page);let e=Number(t);Number.isNaN(e)||e<1?this.setInput(this.page):(e>this.maxPage&&(this.setInput(this.maxPage),e=this.maxPage),this.change(e))};e?n():this.inputTimer=window.setTimeout((()=>n()),800)}prev(){const e=this.page-1;e<1||this.change(e)}next(){const e=this.page+1;e>this.maxPage||this.change(e)}getHasMore(){return this.page+1<=this.maxPage}change(e){this.page=e,this.opts.onChange(this.offset),this.setInput(e),this.checkDisabled()}checkDisabled(){this.page+1>this.maxPage?this.$nextBtn.classList.add("atk-disabled"):this.$nextBtn.classList.remove("atk-disabled"),this.page-1<1?this.$prevBtn.classList.add("atk-disabled"):this.$prevBtn.classList.remove("atk-disabled")}keydown(e){const t=e.keyCode||e.which;if(38===t){const e=Number(this.$input.value)+1;if(e>this.maxPage)return;this.setInput(e),this.input()}else if(40===t){const e=Number(this.$input.value)-1;if(e<1)return;this.setInput(e),this.input()}else 13===t&&this.input(!0)}setLoading(e){e?Tp(this.$el):Lp(this.$el)}};class bh{constructor(){Kc(this,"instance")}create(e){return this.instance=new kh(e.total,{pageSize:e.pageSize,onChange:t=>Yc(this,null,(function*(){e.ctx.editorResetState(),e.ctx.fetch({offset:t,onSuccess:()=>{e.ctx.listGotoFirst()}})}))}),this.instance.$el}setLoading(e){this.instance.setLoading(e)}update(e,t){this.instance.update(e,t)}next(){this.instance.next()}getHasMore(){return this.instance.getHasMore()}getIsClearComments(){return!0}dispose(){this.instance.$el.remove()}}function wh(e){const t=e.getData().getListLastFetch(),n={offset:0,total:0};return t?(n.offset=t.params.offset,t.data&&(n.total=t.params.flatMode?t.data.count:t.data.roots_count),n):n}const _h=e=>{let t=null;e.watchConf(["pagination","locale"],(n=>{const s=e.get("list");t&&t.dispose(),t=function(e){return e.pagination.readMore?new yh:new bh}(n);const{offset:r,total:i}=wh(e),o=t.create({ctx:e,pageSize:n.pagination.pageSize,total:i,readMoreAutoLoad:n.pagination.autoLoad});s.$commentsWrap.after(o),null==t||t.update(r,i)})),e.on("list-loaded",(n=>{const{offset:s,total:r}=wh(e);null==t||t.update(s,r)})),e.on("list-fetch",(n=>{e.getData().getComments().length>0&&(null==t?void 0:t.getIsClearComments(n))&&e.getData().clearComments()})),e.on("list-failed",(()=>{var e;null==(e=null==t?void 0:t.showErr)||e.call(t,_p("loadFail"))})),e.on("list-fetch",(e=>{null==t||t.setLoading(!0)})),e.on("list-fetched",(({params:e})=>{null==t||t.setLoading(!1)}))};class Eh extends Bp{constructor(e){super(e),Kc(this,"$commentsWrap"),Kc(this,"commentNodes",[]),this.$el=op('<div class="atk-list">\n <div class="atk-list-header">\n <div class="atk-comment-count">\n <div class="atk-text"></div>\n </div>\n <div class="atk-right-action">\n <span data-action="admin-close-comment" class="atk-hide" atk-only-admin-show></span>\n <span data-action="open-sidebar" class="atk-hide atk-on">\n <span class="atk-unread-badge" style="display: none"></span>\n <div class="atk-text"></div>\n </span>\n </div>\n </div>\n <div class="atk-list-body">\n <div class="atk-list-comments-wrap"></div>\n </div>\n <div class="atk-list-footer">\n <div class="atk-copyright"></div>\n </div>\n</div>\n'),this.$commentsWrap=this.$el.querySelector(".atk-list-comments-wrap"),_h(e),this.initCrudEvents()}getCommentsWrapEl(){return this.$commentsWrap}getCommentNodes(){return this.commentNodes}getListLayout({forceFlatMode:e}={}){return new Qp({$commentsWrap:this.$commentsWrap,nestSortBy:this.ctx.conf.nestSort,nestMax:this.ctx.conf.nestMax,flatMode:"boolean"==typeof e?e:this.ctx.conf.flatMode,createCommentNode:(t,n)=>{const s=function(e,t,n,s){const r=new gh(t,{onAfterRender:()=>{e.trigger("comment-rendered",r)},onDelete:t=>{e.getData().deleteComment(t.getID())},replyTo:n,flatMode:"boolean"==typeof(null==s?void 0:s.forceFlatMode)?null==s?void 0:s.forceFlatMode:e.conf.flatMode,gravatar:e.conf.gravatar,nestMax:e.conf.nestMax,heightLimit:e.conf.heightLimit,avatarURLBuilder:e.conf.avatarURLBuilder,scrollRelativeTo:e.conf.scrollRelativeTo,vote:e.conf.vote,voteDown:e.conf.voteDown,uaBadge:e.conf.uaBadge,getApi:()=>e.getApi(),replyComment:(t,n)=>e.replyComment(t,n),editComment:(t,n)=>e.editComment(t,n)});return r.render(),r}(this.ctx,t,n,{forceFlatMode:e});return this.commentNodes.push(s),s},findCommentNode:e=>this.commentNodes.find((t=>t.getID()===e))})}initCrudEvents(){this.ctx.on("list-load",(e=>{this.getListLayout().import(e)})),this.ctx.on("list-loaded",(e=>{0===e.length&&(this.commentNodes=[],this.$commentsWrap.innerHTML="")})),this.ctx.on("comment-inserted",(e=>{var t;const n=e.rid?null==(t=this.commentNodes.find((t=>t.getID()===e.rid)))?void 0:t.getData():void 0;this.getListLayout().insert(e,n)})),this.ctx.on("comment-deleted",(e=>{const t=this.commentNodes.find((t=>t.getID()===e.id));t?(t.remove(),this.commentNodes=this.commentNodes.filter((t=>t.getID()!==e.id))):console.error(`comment node id=${e.id} not found`)})),this.ctx.on("comment-updated",(e=>{const t=this.commentNodes.find((t=>t.getID()===e.id));t&&t.setData(e)}))}}let xh,Sh;function Ch(){return{init(){xh=document.body.style.overflow,Sh=document.body.style.paddingRight},unlock(){document.body.style.overflow=xh,document.body.style.paddingRight=Sh},lock(){document.body.style.overflow="hidden";const e=parseInt(window.getComputedStyle(document.body,null).getPropertyValue("padding-right"),10);document.body.style.paddingRight=`${function(){const e=document.createElement("p");e.style.width="100%",e.style.height="200px";const t=document.createElement("div");t.style.position="absolute",t.style.top="0px",t.style.left="0px",t.style.visibility="hidden",t.style.width="200px",t.style.height="150px",t.style.overflow="hidden",t.appendChild(e),document.body.appendChild(t);const n=e.offsetWidth;t.style.overflow="scroll";let s=e.offsetWidth;return n===s&&(s=t.clientWidth),document.body.removeChild(t),n-s}()+e||0}px`}}}class Ah{constructor(e,t){Kc(this,"allowMaskClose",!0),Kc(this,"onAfterHide"),this.$el=e,this.opts=t}setOnAfterHide(e){this.onAfterHide=e}setAllowMaskClose(e){this.allowMaskClose=e}getAllowMaskClose(){return this.allowMaskClose}getEl(){return this.$el}show(){this.opts.onShow(),this.$el.style.display=""}hide(){return Yc(this,null,(function*(){this.opts.onHide(),this.$el.style.display="none",this.onAfterHide&&this.onAfterHide()}))}destroy(){return Yc(this,null,(function*(){this.opts.onHide(),this.$el.remove(),this.onAfterHide&&this.onAfterHide()}))}}class $h{constructor(){Kc(this,"$wrap"),Kc(this,"$mask"),Kc(this,"items",[]),this.$wrap=op('<div class="atk-layer-wrap" style="display: none;"><div class="atk-layer-mask"></div></div>'),this.$mask=this.$wrap.querySelector(".atk-layer-mask")}createItem(e,t){(t=t||this.createItemElement(e)).setAttribute("data-layer-name",e),this.$wrap.appendChild(t);const n=new Ah(t,{onHide:()=>this.hideWrap(t),onShow:()=>this.showWrap()});return this.getMask().addEventListener("click",(()=>{n.getAllowMaskClose()&&n.hide()})),this.items.push(n),n}createItemElement(e){const t=document.createElement("div");return t.classList.add("atk-layer-item"),t.style.display="none",this.$wrap.appendChild(t),t}getWrap(){return this.$wrap}getMask(){return this.$mask}showWrap(){this.$wrap.style.display="block",this.$mask.style.display="block",this.$mask.classList.add("atk-fade-in"),Ch().lock()}hideWrap(e){this.items.map((e=>e.getEl())).filter((t=>t!==e&&t.isConnected&&"none"!==t.style.display)).length>0||(this.$wrap.style.display="none",Ch().unlock())}}class Th{constructor(e){Kc(this,"wrap"),this.wrap=new $h,document.body.appendChild(this.wrap.getWrap()),e.on("unmounted",(()=>{this.wrap.getWrap().remove()})),Ch().init()}getEl(){return this.wrap.getWrap()}create(e,t){return this.wrap.createItem(e,t)}}const Lh="ArtalkUser";class Oh{constructor(e){Kc(this,"data"),this.opts=e;const t=JSON.parse(window.localStorage.getItem(Lh)||"{}");this.data={nick:t.nick||"",email:t.email||"",link:t.link||"",token:t.token||"",isAdmin:t.isAdmin||!1}}getData(){return this.data}update(e={}){Object.entries(e).forEach((([e,t])=>{this.data[e]=t})),window.localStorage.setItem(Lh,JSON.stringify(this.data)),this.opts.onUserChanged&&this.opts.onUserChanged(this.data)}logout(){this.update({token:"",isAdmin:!1})}checkHasBasicUserInfo(){return!!this.data.nick&&!!this.data.email}}const Nh={i18n(e){wp(e.conf.locale),e.watchConf(["locale"],(e=>{wp(e.locale)}))},user:e=>new Oh({onUserChanged:t=>{e.trigger("user-changed",t)}}),layerManager:e=>new Th(e),checkerLauncher:e=>new jp({getCtx:()=>e,getApi:()=>e.getApi(),onReload:()=>e.reload(),getCaptchaIframeURL:()=>`${e.conf.server}/api/v2/captcha/?t=${+new Date}`}),editor(e){const t=new Kp(e);return e.$root.appendChild(t.$el),t},list(e){const t=new Eh(e);return e.$root.appendChild(t.$el),t},sidebarLayer:e=>new zp(e),editorPlugs(){}};function Ih(e){return Yc(this,null,(function*(){yield function(e){return Yc(this,null,(function*(){yield Ph({opt:e,query:"page_comment",containers:[e.countEl,"#ArtalkCount"]})}))}(e);const t=yield function(e){return Yc(this,null,(function*(){if(!e.pvAdd||!e.pageKey)return;const t=(yield e.getApi().pages.logPv({page_key:e.pageKey,page_title:e.pageTitle,site_name:e.siteName})).data.pv;return{[e.pageKey]:t}}))}(e);yield function(e,t){return Yc(this,null,(function*(){yield Ph({opt:e,query:"page_pv",containers:[e.pvEl,"#ArtalkPv"],cache:t})}))}(e,t)}))}function Ph(e){return Yc(this,null,(function*(){const{opt:t}=e;let n=e.cache||{};const s=function(e){const t=new Set;return new Set(e).forEach((e=>{document.querySelectorAll(e).forEach((e=>t.add(e)))})),t}(e.containers),r=function(e,t,n,s){const r=Array.from(e).map((e=>e.getAttribute(t)||n)).filter((e=>e&&"number"!=typeof s[e]));return[...new Set(r)]}(s,t.pageKeyAttr,t.pageKey,n);if(r.length>0){const s=(yield t.getApi().stats.getStats(e.query,{page_keys:r.join(","),site_name:t.siteName})).data.data;n=Hc(Hc({},n),s)}!function(e,t,n){e.forEach((e=>{const s=e.getAttribute("data-page-key"),r=s&&t[s]||n&&t[n]||0;e.innerText=`${Number(r)}`}))}(s,n,t.pageKey)}))}const Rh="ArtalkContent";class Mh{constructor(e){this.kit=e}reqAdd(){return Yc(this,null,(function*(){return(yield this.kit.useApi().comments.createComment(Hc({},yield this.getSubmitAddParams()))).data}))}getSubmitAddParams(){return Yc(this,null,(function*(){const{nick:e,email:t,link:n}=this.kit.useUser().getData(),s=this.kit.useConf();return{content:this.kit.useEditor().getContentFinal(),name:e,email:t,link:n,rid:0,page_key:s.pageKey,page_title:s.pageTitle,site_name:s.site,ua:yield pp()}}))}postSubmitAdd(e){this.kit.useGlobalCtx().getData().insertComment(e)}}class Dh extends Wp{constructor(e){super(e),Kc(this,"customs",[]),Kc(this,"defaultPreset"),this.defaultPreset=new Mh(this.kit);const t=()=>this.do();this.kit.useMounted((()=>{this.kit.useGlobalCtx().on("editor-submit",t)})),this.kit.useUnmounted((()=>{this.kit.useGlobalCtx().off("editor-submit",t)}))}registerCustom(e){this.customs.push(e)}do(){return Yc(this,null,(function*(){if(""===this.kit.useEditor().getContentFinal().trim())return void this.kit.useEditor().focus();const e=this.customs.find((e=>e.activeCond()));this.kit.useEditor().showLoading();try{let t;(null==e?void 0:e.pre)&&e.pre(),t=(null==e?void 0:e.req)?yield e.req():yield this.defaultPreset.reqAdd(),(null==e?void 0:e.post)?e.post(t):this.defaultPreset.postSubmitAdd(t)}catch(t){return console.error(t),void this.kit.useEditor().showNotify(`${_p("commentFail")}: ${t.message||String(t)}`,"e")}finally{this.kit.useEditor().hideLoading()}this.kit.useEditor().reset(),this.kit.useGlobalCtx().trigger("editor-submitted")}))}}class Uh extends Wp{constructor(e){super(e),Kc(this,"emoticons",[]),Kc(this,"loadingTask",null),Kc(this,"$grpWrap"),Kc(this,"$grpSwitcher"),Kc(this,"isListLoaded",!1),Kc(this,"isImgLoaded",!1),this.kit.useMounted((()=>{this.usePanel('<div class="atk-editor-plug-emoticons"></div>'),this.useBtn(`<i aria-label="${_p("emoticon")}"><svg fill="currentColor" aria-hidden="true" height="14" viewBox="0 0 14 14" width="14"><path d="m4.26829 5.29294c0-.94317.45893-1.7074 1.02439-1.7074.56547 0 1.02439.76423 1.02439 1.7074s-.45892 1.7074-1.02439 1.7074c-.56546 0-1.02439-.76423-1.02439-1.7074zm4.43903 1.7074c.56546 0 1.02439-.76423 1.02439-1.7074s-.45893-1.7074-1.02439-1.7074c-.56547 0-1.02439.76423-1.02439 1.7074s.45892 1.7074 1.02439 1.7074zm-1.70732 2.73184c-1.51883 0-2.06312-1.52095-2.08361-1.58173l-1.29551.43231c.03414.10244.868 2.51604 3.3798 2.51604 2.51181 0 3.34502-2.41291 3.37982-2.51604l-1.29484-.43573c-.02254.06488-.56683 1.58583-2.08498 1.58583zm7-2.73252c0 3.86004-3.1401 7.00034-7 7.00034s-7-3.1396-7-6.99966c0-3.86009 3.1401-7.00034 7-7.00034s7 3.14025 7 7.00034zm-1.3659 0c0-3.10679-2.5275-5.63442-5.6341-5.63442-3.10663 0-5.63415 2.52832-5.63415 5.6351 0 3.10676 2.52752 5.63446 5.63415 5.63446 3.1066 0 5.6341-2.5277 5.6341-5.63446z"/></svg></i>`)})),this.kit.useUnmounted((()=>{})),this.useContentTransformer((e=>this.transEmoticonImageText(e))),this.usePanelShow((()=>{(()=>{Yc(this,null,(function*(){yield this.loadEmoticonsData(),this.isImgLoaded||(this.initEmoticonsList(),this.isImgLoaded=!0),setTimeout((()=>{this.changeListHeight()}),30)}))})()})),this.usePanelHide((()=>{this.$panel.parentElement.style.height=""})),window.setTimeout((()=>{this.loadEmoticonsData()}),1e3)}loadEmoticonsData(){return Yc(this,null,(function*(){this.isListLoaded||(null===this.loadingTask?(this.loadingTask=(()=>Yc(this,null,(function*(){Tp(this.$panel),this.emoticons=yield this.handleData(this.kit.useConf().emoticons),Lp(this.$panel),this.loadingTask=null,this.isListLoaded=!0})))(),yield this.loadingTask):yield this.loadingTask)}))}handleData(e){return Yc(this,null,(function*(){if(!Array.isArray(e)&&["object","string"].includes(typeof e)&&(e=[e]),!Array.isArray(e))return Pp(this.$panel,`[${_p("emoticon")}] Data must be of Array/Object/String type`),Lp(this.$panel),[];const t=t=>{"object"==typeof t&&(t.name&&e.find((e=>e.name===t.name))||e.push(t))},n=e=>Yc(this,null,(function*(){yield Promise.all(e.map(((e,s)=>Yc(this,null,(function*(){if("object"!=typeof e||Array.isArray(e)){if(Array.isArray(e))yield n(e);else if("string"==typeof e){const s=yield this.remoteLoad(e);Array.isArray(s)?yield n(s):"object"==typeof s&&t(s)}}else t(e)})))))}));return yield n(e),e.forEach((e=>{if(this.isOwOFormat(e)){this.convertOwO(e).forEach((e=>{t(e)}))}else Array.isArray(e)&&e.forEach((e=>{t(e)}))})),e=e.filter((e=>"object"==typeof e&&!Array.isArray(e)&&!!e&&!!e.name)),this.solveNullKey(e),this.solveSameKey(e),e}))}remoteLoad(e){return Yc(this,null,(function*(){if(!e)return[];try{const t=yield fetch(e);return yield t.json()}catch(t){return Lp(this.$panel),console.error("[Emoticons] Load Failed:",t),Pp(this.$panel,`[${_p("emoticon")}] ${_p("loadFail")}: ${String(t)}`),[]}}))}solveNullKey(e){e.forEach((e=>{e.items.forEach(((t,n)=>{t.key||(t.key=`${e.name} ${n+1}`)}))}))}solveSameKey(e){const t={};e.forEach((e=>{e.items.forEach((e=>{e.key&&""!==String(e.key).trim()&&(t[e.key]?t[e.key]++:t[e.key]=1,t[e.key]>1&&(e.key=`${e.key} ${t[e.key]}`))}))}))}isOwOFormat(e){try{return"object"==typeof e&&!!Object.values(e).length&&Array.isArray(Object.keys(Object.values(e)[0].container))&&Object.keys(Object.values(e)[0].container[0]).includes("icon")}catch(t){return!1}}convertOwO(e){const t=[];return Object.entries(e).forEach((([e,n])=>{const s={name:e,type:n.type,items:[]};n.container.forEach(((t,n)=>{const r=t.icon;if(/<(img|IMG)/.test(r)){const e=/src=["'](.*?)["']/.exec(r);e&&e.length>1&&(t.icon=e[1])}s.items.push({key:t.text||`${e} ${n+1}`,val:t.icon})})),t.push(s)})),t}initEmoticonsList(){this.$grpWrap=op('<div class="atk-grp-wrap"></div>'),this.$panel.append(this.$grpWrap),this.emoticons.forEach(((e,t)=>{const n=op('<div class="atk-grp" style="display: none;"></div>');this.$grpWrap.append(n),n.setAttribute("data-index",String(t)),n.setAttribute("data-grp-name",e.name),n.setAttribute("data-type",e.type),e.items.forEach((t=>{const s=op('<span class="atk-item"></span>');if(n.append(s),t.key&&!new RegExp(`^(${e.name})?\\s?[0-9]+$`).test(t.key)&&s.setAttribute("title",t.key),"image"===e.type){const e=document.createElement("img");e.src=t.val,e.alt=t.key,s.append(e)}else s.innerText=t.val;s.onclick=()=>{"image"===e.type?this.kit.useEditor().insertContent(`:[${t.key}]`):this.kit.useEditor().insertContent(t.val||"")}}))})),this.emoticons.length>1&&(this.$grpSwitcher=op('<div class="atk-grp-switcher"></div>'),this.$panel.append(this.$grpSwitcher),this.emoticons.forEach(((e,t)=>{const n=op("<span />");n.innerText=e.name,n.setAttribute("data-index",String(t)),n.onclick=()=>this.openGrp(t),this.$grpSwitcher.append(n)}))),this.emoticons.length>0&&this.openGrp(0)}openGrp(e){var t,n,s;Array.from(this.$grpWrap.children).forEach((t=>{const n=t;n.getAttribute("data-index")!==String(e)?n.style.display="none":n.style.display=""})),null==(t=this.$grpSwitcher)||t.querySelectorAll("span.active").forEach((e=>e.classList.remove("active"))),null==(s=null==(n=this.$grpSwitcher)?void 0:n.querySelector(`span[data-index="${e}"]`))||s.classList.add("active"),this.changeListHeight()}changeListHeight(){}transEmoticonImageText(e){return this.emoticons&&Array.isArray(this.emoticons)?(this.emoticons.forEach((t=>{"image"===t.type&&Object.entries(t.items).forEach((([t,n])=>{e=e.split(`:[${n.key}]`).join(`<img src="${n.val}" atk-emoticon="${n.key}">`)}))})),e):e}}const Fh=["png","jpg","jpeg","gif","bmp","svg","webp"];class jh extends Wp{constructor(e){super(e),Kc(this,"$imgUploadInput"),this.kit.useMounted((()=>this.init())),this.initDragImg()}init(){this.$imgUploadInput=document.createElement("input"),this.$imgUploadInput.type="file",this.$imgUploadInput.style.display="none",this.$imgUploadInput.accept=Fh.map((e=>`.${e}`)).join(",");const e=this.useBtn(`<i aria-label="${_p("uploadImage")}"><svg fill="currentColor" aria-hidden="true" height="14" viewBox="0 0 14 14" width="14"><path d="m0 1.94444c0-1.074107.870333-1.94444 1.94444-1.94444h10.11116c1.0741 0 1.9444.870333 1.9444 1.94444v10.11116c0 1.0741-.8703 1.9444-1.9444 1.9444h-10.11116c-1.074107 0-1.94444-.8703-1.94444-1.9444zm1.94444-.38888c-.21466 0-.38888.17422-.38888.38888v7.06689l2.33333-2.33333 2.33333 2.33333 3.88888-3.88889 2.3333 2.33334v-5.51134c0-.21466-.1742-.38888-.3888-.38888zm10.49996 8.09977-2.3333-2.33333-3.88888 3.8889-2.33333-2.33334-2.33333 2.33334v.8447c0 .2146.17422.3888.38888.3888h10.11116c.2146 0 .3888-.1742.3888-.3888zm-7.1944-6.54422c-.75133 0-1.36111.60978-1.36111 1.36111 0 .75134.60978 1.36111 1.36111 1.36111s1.36111-.60977 1.36111-1.36111c0-.75133-.60978-1.36111-1.36111-1.36111z"/></svg></i>`);e.after(this.$imgUploadInput),e.onclick=()=>{const e=this.$imgUploadInput;e.onchange=()=>{(()=>{Yc(this,null,(function*(){if(!e.files||0===e.files.length)return;const t=e.files[0];this.uploadImg(t)}))})()},e.click()},this.kit.useConf().imgUpload||this.$btn.setAttribute("atk-only-admin-show","")}initDragImg(){const e=e=>{if(e)for(let t=0;t<e.length;t++){const n=e[t];this.uploadImg(n)}},t=e=>{e.stopPropagation(),e.preventDefault()},n=t=>{var n;const s=null==(n=t.dataTransfer)?void 0:n.files;(null==s?void 0:s.length)&&(t.preventDefault(),e(s))},s=t=>{var n;const s=null==(n=t.clipboardData)?void 0:n.files;(null==s?void 0:s.length)&&(t.preventDefault(),e(s))};this.kit.useMounted((()=>{this.kit.useUI().$textarea.addEventListener("dragover",t),this.kit.useUI().$textarea.addEventListener("drop",n),this.kit.useUI().$textarea.addEventListener("paste",s)})),this.kit.useUnmounted((()=>{this.kit.useUI().$textarea.removeEventListener("dragover",t),this.kit.useUI().$textarea.removeEventListener("drop",n),this.kit.useUI().$textarea.removeEventListener("paste",s)}))}uploadImg(e){return Yc(this,null,(function*(){const t=/[^.]+$/.exec(e.name);if(!t||!Fh.includes(String(t[0]).toLowerCase()))return;if(!this.kit.useUser().checkHasBasicUserInfo())return void this.kit.useEditor().showNotify(_p("uploadLoginMsg"),"w");let n="\n";""===this.kit.useUI().$textarea.value.trim()&&(n="");const s=`${n}`;let r;this.kit.useEditor().insertContent(s);try{const t=this.kit.useConf().imgUploader;r=t?{public_url:yield t(e)}:(yield this.kit.useApi().upload.upload({file:e})).data}catch(i){console.error(i),this.kit.useEditor().showNotify(`${_p("uploadFail")}: ${i.message}`,"e")}if(r&&r.public_url){let e=r.public_url;hp(e)||(e=fp({base:this.kit.useConf().server,path:e})),this.kit.useEditor().setContent(this.kit.useUI().$textarea.value.replace(s,`${n}`))}else this.kit.useEditor().setContent(this.kit.useUI().$textarea.value.replace(s,""))}))}}class Bh extends Wp{constructor(e){super(e),Kc(this,"isPlugPanelShow",!1),this.kit.useMounted((()=>{this.usePanel('<div class="atk-editor-plug-preview"></div>'),this.useBtn(`<i aria-label="${_p("preview")}"><svg fill="currentColor" aria-hidden="true" viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M14.85 3H1.15C.52 3 0 3.52 0 4.15v7.69C0 12.48.52 13 1.15 13h13.69c.64 0 1.15-.52 1.15-1.15v-7.7C16 3.52 15.48 3 14.85 3zM9 11H7V8L5.5 9.92 4 8v3H2V5h2l1.5 2L7 5h2v6zm2.99.5L9.5 8H11V5h2v3h1.5l-2.51 3.5z"></path></svg></i>`)})),this.kit.useUnmounted((()=>{})),this.kit.useEvents().on("content-updated",(e=>{this.isPlugPanelShow&&this.updateContent()})),this.usePanelShow((()=>{this.isPlugPanelShow=!0,this.updateContent()})),this.usePanelHide((()=>{this.isPlugPanelShow=!1}))}updateContent(){this.$panel.innerHTML=this.kit.useEditor().getContentMarked()}}const qh=[class extends Wp{constructor(e){super(e);const t=()=>{this.save()};this.kit.useMounted((()=>{const e=window.localStorage.getItem(Rh)||"";""!==e.trim()&&(this.kit.useEditor().showNotify(_p("restoredMsg"),"i"),this.kit.useEditor().setContent(e)),this.kit.useEvents().on("content-updated",t)})),this.kit.useUnmounted((()=>{this.kit.useEvents().off("content-updated",t)}))}save(){window.localStorage.setItem(Rh,this.kit.useEditor().getContentRaw().trim())}},class extends Wp{get $inputs(){return this.kit.useEditor().getHeaderInputEls()}constructor(e){super(e);const t={},n={},s=(e,t,n)=>()=>{this.kit.useEvents().trigger(e,{field:n,$input:t})};this.kit.useMounted((()=>{Object.entries(this.$inputs).forEach((([e,r])=>{r.addEventListener("input",t[e]=s("header-input",r,e)),r.addEventListener("change",n[e]=s("header-change",r,e))}))})),this.kit.useUnmounted((()=>{Object.entries(this.$inputs).forEach((([e,s])=>{s.removeEventListener("input",t[e]),s.removeEventListener("change",n[e])}))}))}},class extends Wp{constructor(e){super(e),Kc(this,"query",{timer:null,abortFn:null});const t=({$input:e,field:t})=>{"edit"!==this.kit.useEditor().getState()&&(this.kit.useUser().update({[t]:e.value.trim()}),"nick"!==t&&"email"!==t||this.fetchUserInfo())};this.kit.useMounted((()=>{Object.entries(this.kit.useEditor().getHeaderInputEls()).forEach((([e,t])=>{t.placeholder=`${_p(e)}`,t.value=this.kit.useUser().getData()[e]||""})),this.kit.useEvents().on("header-input",t)})),this.kit.useUnmounted((()=>{this.kit.useEvents().off("header-input",t)}))}fetchUserInfo(){this.kit.useUser().logout(),this.query.timer&&window.clearTimeout(this.query.timer),this.query.abortFn&&this.query.abortFn(),this.query.timer=window.setTimeout((()=>{this.query.timer=null;const e=this.kit.useApi(),t="getUserCancelToken";this.query.abortFn=()=>e.abortRequest(t),e.user.getUser(Hc({},e.getUserFields()),{cancelToken:t}).then((e=>this.onUserInfoFetched(e.data))).catch((e=>{})).finally((()=>{this.query.abortFn=null}))}),400)}onUserInfoFetched(e){var t;e.is_login||this.kit.useUser().logout(),this.kit.useGlobalCtx().getData().updateNotifies(e.notifies),this.kit.useUser().checkHasBasicUserInfo()&&!e.is_login&&(null==(t=e.user)?void 0:t.is_admin)&&this.kit.useGlobalCtx().checkAdmin({onSuccess:()=>{}}),e.user&&e.user.link&&(this.kit.useUI().$link.value=e.user.link,this.kit.useUser().update({link:e.user.link}))}},class extends Wp{constructor(e){super(e);const t=({field:e})=>{"link"===e&&this.onLinkInputChange()};this.kit.useMounted((()=>{this.kit.useEvents().on("header-change",t)})),this.kit.useUnmounted((()=>{this.kit.useEvents().off("header-change",t)}))}onLinkInputChange(){const e=this.kit.useUI().$link.value.trim();e&&!/^(http|https):\/\//.test(e)&&(this.kit.useUI().$link.value=`https://${e}`,this.kit.useUser().update({link:this.kit.useUI().$link.value}))}},class extends Wp{constructor(e){super(e);const t=e=>this.onKeydown(e),n=()=>this.onInput();this.kit.useMounted((()=>{this.kit.useUI().$textarea.placeholder=this.kit.useConf().placeholder||_p("placeholder"),this.kit.useUI().$textarea.addEventListener("keydown",t),this.kit.useUI().$textarea.addEventListener("input",n)})),this.kit.useUnmounted((()=>{this.kit.useUI().$textarea.removeEventListener("keydown",t),this.kit.useUI().$textarea.removeEventListener("input",n)})),this.kit.useEvents().on("content-updated",(()=>{window.setTimeout((()=>{this.adaptiveHeightByContent()}),80)}))}onKeydown(e){9===(e.keyCode||e.which)&&(e.preventDefault(),this.kit.useEditor().insertContent("\t"))}onInput(){this.kit.useEvents().trigger("content-updated",this.kit.useEditor().getContentRaw())}adaptiveHeightByContent(){const e=this.kit.useUI().$textarea.offsetHeight-this.kit.useUI().$textarea.clientHeight;this.kit.useUI().$textarea.style.height="0px",this.kit.useUI().$textarea.style.height=`${this.kit.useUI().$textarea.scrollHeight+e}px`}},Dh,class extends Wp{constructor(e){super(e);const t=()=>{this.kit.useEditor().submit()};this.kit.useMounted((()=>{this.kit.useUI().$submitBtn.innerText=this.kit.useConf().sendBtn||_p("send"),this.kit.useUI().$submitBtn.addEventListener("click",t)})),this.kit.useUnmounted((()=>{this.kit.useUI().$submitBtn.removeEventListener("click",t)}))}},Hp,class extends Wp{constructor(e){super(e),Kc(this,"comment"),this.useEditorStateEffect("reply",(e=>(this.setReply(e),()=>{this.cancelReply()}))),this.kit.useEvents().on("mounted",(()=>{const e=this.kit.useDeps(Dh);if(!e)throw Error("SubmitPlug not initialized");const t=new Mh(this.kit);e.registerCustom({activeCond:()=>!!this.comment,req:()=>Yc(this,null,(function*(){if(!this.comment)throw new Error("reply comment cannot be empty");return(yield this.kit.useApi().comments.createComment(Vc(Hc({},yield t.getSubmitAddParams()),{rid:this.comment.id,page_key:this.comment.page_key,page_title:void 0,site_name:this.comment.site_name}))).data})),post:e=>{const n=this.kit.useConf();e.page_key!==n.pageKey&&window.open(`${e.page_url}#atk-comment-${e.id}`),t.postSubmitAdd(e)}})}))}setReply(e){const t=this.kit.useUI();if(!t.$sendReplyBtn){const n=op(`<span class="atk-state-btn"><span class="atk-text-wrap">${_p("reply")} <span class="atk-text"></span></span><span class="atk-cancel atk-icon-close atk-icon"></span></span>`);n.querySelector(".atk-text").innerText=`@${e.nick}`,n.addEventListener("click",(()=>{this.kit.useEditor().resetState()})),t.$stateWrap.append(n),t.$sendReplyBtn=n}this.comment=e,t.$textarea.focus()}cancelReply(){if(!this.comment)return;const e=this.kit.useUI();e.$sendReplyBtn&&(e.$sendReplyBtn.remove(),e.$sendReplyBtn=void 0),this.comment=void 0}},class extends Wp{constructor(e){super(e),Kc(this,"comment"),Kc(this,"originalSubmitBtnText","Send"),this.useEditorStateEffect("edit",(e=>(this.edit(e),()=>{this.cancelEdit()}))),this.kit.useMounted((()=>{const e=this.kit.useDeps(Dh);if(!e)throw Error("SubmitPlug not initialized");e.registerCustom({activeCond:()=>!!this.comment,req:()=>Yc(this,null,(function*(){const e={content:this.kit.useEditor().getContentFinal(),nick:this.kit.useUI().$nick.value,email:this.kit.useUI().$email.value,link:this.kit.useUI().$link.value},t=this.comment;return(yield this.kit.useApi().comments.updateComment(t.id,Hc(Hc({},t),e))).data})),post:e=>{this.kit.useGlobalCtx().getData().updateComment(e)}})}))}edit(e){const t=this.kit.useUI();if(!t.$editCancelBtn){const e=op(`<span class="atk-state-btn"><span class="atk-text-wrap">${_p("editCancel")}</span><span class="atk-cancel atk-icon-close atk-icon"></span></span>`);e.onclick=()=>{this.kit.useEditor().resetState()},t.$stateWrap.append(e),t.$editCancelBtn=e}this.comment=e,t.$header.style.display="none",t.$nick.value=e.nick||"",t.$email.value=e.email||"",t.$link.value=e.link||"",this.kit.useEditor().setContent(e.content),t.$textarea.focus(),this.updateSubmitBtnText(_p("save"))}cancelEdit(){if(!this.comment)return;const e=this.kit.useUI();e.$editCancelBtn&&(e.$editCancelBtn.remove(),e.$editCancelBtn=void 0),this.comment=void 0;const{nick:t,email:n,link:s}=this.kit.useUser().getData();e.$nick.value=t,e.$email.value=n,e.$link.value=s,this.kit.useEditor().setContent(""),this.restoreSubmitBtnText(),e.$header.style.display=""}updateSubmitBtnText(e){this.originalSubmitBtnText=this.kit.useUI().$submitBtn.innerText,this.kit.useUI().$submitBtn.innerText=e}restoreSubmitBtnText(){this.kit.useUI().$submitBtn.innerText=this.originalSubmitBtnText}},class extends Wp{constructor(e){super(e);const t=()=>this.open(),n=()=>this.close();this.kit.useMounted((()=>{this.kit.useEvents().on("editor-open",t),this.kit.useEvents().on("editor-close",n)})),this.kit.useUnmounted((()=>{this.kit.useEvents().off("editor-open",t),this.kit.useEvents().off("editor-close",n)}))}open(){var e;null==(e=this.kit.useUI().$textareaWrap.querySelector(".atk-comment-closed"))||e.remove(),this.kit.useUI().$textarea.style.display="",this.kit.useUI().$bottom.style.display=""}close(){this.kit.useUI().$textareaWrap.querySelector(".atk-comment-closed")||this.kit.useUI().$textareaWrap.prepend(op(`<div class="atk-comment-closed">${_p("onlyAdminCanReply")}</div>`)),this.kit.useUser().getData().isAdmin?(this.kit.useUI().$textarea.style.display="",this.kit.useUI().$bottom.style.display=""):(this.kit.useUI().$textarea.style.display="none",this.kit.useEvents().trigger("panel-close"),this.kit.useUI().$bottom.style.display="none")}},Uh,jh,Bh];class Wh{constructor(e){this.plugs=e}useEditor(){return this.plugs.editor}useGlobalCtx(){return this.plugs.editor.ctx}useConf(){return this.plugs.editor.ctx.conf}useApi(){return this.plugs.editor.ctx.getApi()}useUser(){return this.plugs.editor.ctx.get("user")}useUI(){return this.plugs.editor.getUI()}useEvents(){return this.plugs.getEvents()}useMounted(e){this.useEvents().on("mounted",e)}useUnmounted(e){this.useEvents().on("unmounted",e)}useDeps(e){return this.plugs.get(e)}}class Hh{constructor(e){Kc(this,"plugs",[]),Kc(this,"openedPlug",null),Kc(this,"events",new Ep),this.editor=e;let t=!1;this.editor.ctx.watchConf(["imgUpload","emoticons","preview","editorTravel","locale"],(e=>{t&&this.getEvents().trigger("unmounted"),this.clear(),function(e){const t=new Map;return t.set(jh,e.imgUpload),t.set(Uh,e.emoticons),t.set(Bh,e.preview),t.set(Hp,e.editorTravel),qh.filter((e=>!t.has(e)||!!t.get(e)))}(e).forEach((e=>{const t=new Wh(this);this.plugs.push(new e(t))})),this.getEvents().trigger("mounted"),t=!0,this.loadPluginUI()})),this.events.on("panel-close",(()=>this.closePlugPanel()))}getPlugs(){return this.plugs}getEvents(){return this.events}clear(){this.plugs=[],this.events=new Ep,this.openedPlug&&this.closePlugPanel()}loadPluginUI(){this.editor.getUI().$plugPanelWrap.innerHTML="",this.editor.getUI().$plugPanelWrap.style.display="none",this.editor.getUI().$plugBtnWrap.innerHTML="",this.plugs.forEach((e=>this.loadPluginItem(e)))}loadPluginItem(e){const t=e.$btn;if(!t)return;this.editor.getUI().$plugBtnWrap.appendChild(t),!t.onclick&&(t.onclick=()=>{this.editor.getUI().$plugBtnWrap.querySelectorAll(".active").forEach((e=>e.classList.remove("active"))),e!==this.openedPlug?(this.openPlugPanel(e),t.classList.add("active")):this.closePlugPanel()});const n=e.$panel;n&&(n.style.display="none",this.editor.getUI().$plugPanelWrap.appendChild(n))}get(e){return this.plugs.find((t=>t instanceof e))}openPlugPanel(e){this.plugs.forEach((t=>{const n=t.$panel;n&&(t===e?(n.style.display="",this.events.trigger("panel-show",e)):(n.style.display="none",this.events.trigger("panel-hide",e)))})),this.editor.getUI().$plugPanelWrap.style.display="",this.openedPlug=e}closePlugPanel(){this.openedPlug&&(this.editor.getUI().$plugPanelWrap.style.display="none",this.events.trigger("panel-hide",this.openedPlug),this.openedPlug=null)}getTransformedContent(e){let t=e;return this.plugs.forEach((e=>{e.contentTransformer&&(t=e.contentTransformer(t))})),t}}const Vh="2.8.7";function Kh(e){const t=op('<span><span class="error-message"></span><br/><br/></span>');if(t.querySelector(".error-message").innerText=`${_p("listLoadFailMsg")}\n${e.errMsg}`,e.retryFn){const n=op(`<span style="cursor:pointer;">${_p("listRetry")}</span>`);n.onclick=()=>e.retryFn&&e.retryFn(),t.appendChild(n)}if(e.onOpenSidebar){const n=op(`<span atk-only-admin-show> | <span style="cursor:pointer;">${_p("openName",{name:_p("ctrlCenter")})}</span></span>`);t.appendChild(n),n.onclick=()=>e.onOpenSidebar&&e.onOpenSidebar()}Pp(e.$err,t)}let zh=!1;let Gh;function Yh(e,t){const n="atk-dark-mode";e.forEach((e=>{t?e.classList.add(n):e.classList.remove(n)}))}const Qh=[e=>{e.watchConf(["imgLazyLoad","markedOptions"],(t=>{!function(e){try{if(!ud.name)return}catch(t){return}ud.setOptions(Hc(Hc({renderer:Yd({imgLazyLoad:e.imgLazyLoad})},tp),e.markedOptions)),Zd=ud}({markedOptions:e.getConf().markedOptions,imgLazyLoad:e.getConf().imgLazyLoad})})),e.watchConf(["markedReplacers"],(e=>{var t;e.markedReplacers&&(t=e.markedReplacers,ep=t)}))},e=>{const t=e.get("editor"),n=new Hh(t);e.inject("editorPlugs",n)},e=>{const t=()=>{var t;t=e.get("user").getData().isAdmin,function(e){const t=[];e.$root.querySelectorAll("[atk-only-admin-show]").forEach((e=>t.push(e)));const n=document.querySelector(".atk-sidebar");return n&&n.querySelectorAll("[atk-only-admin-show]").forEach((e=>t.push(e))),t}({$root:e.$root}).forEach((e=>{t?e.classList.remove("atk-hide"):e.classList.add("atk-hide")}))};e.on("list-loaded",(()=>{t()})),e.on("user-changed",(e=>{t()}))},...[e=>{e.on("list-fetch",(t=>{if(e.getData().getLoading())return;e.getData().setLoading(!0);const n=Hc({offset:0,limit:e.conf.pagination.pageSize,flatMode:e.conf.flatMode,paramsModifier:e.conf.listFetchParamsModifier},t);e.getData().setListLastFetch({params:n});const s={limit:n.limit,offset:n.offset,flat_mode:n.flatMode,page_key:e.getConf().pageKey,site_name:e.getConf().site};n.paramsModifier&&n.paramsModifier(s),e.getApi().comments.getComments(Hc(Hc({},s),e.getApi().getUserFields())).then((({data:t})=>{e.getData().setListLastFetch({params:n,data:t}),e.getData().loadComments(t.comments),e.getData().updatePage(t.page),n.onSuccess&&n.onSuccess(t),e.trigger("list-fetched",{params:n,data:t})})).catch((t=>{const s={msg:t.msg||String(t),data:t.data};throw n.onError&&n.onError(s),e.trigger("list-failed",s),e.trigger("list-fetched",{params:n,error:s}),t})).finally((()=>{e.getData().setLoading(!1)}))}))},e=>{e.on("list-fetch",(t=>{const n=e.get("list");0===t.offset&&Op(!0,n.$el)})),e.on("list-fetched",(()=>{Op(!1,e.get("list").$el)}))},e=>{e.on("comment-rendered",(t=>{if(!0===e.conf.listUnreadHighlight){const n=e.getData().getNotifies(),s=n.find((e=>e.comment_id===t.getID()));s?(t.getRender().setUnread(!0),t.getRender().setOpenAction((()=>{window.open(s.read_link),e.getData().updateNotifies(n.filter((e=>e.comment_id!==t.getID())))}))):t.getRender().setUnread(!1)}})),e.on("list-goto",(t=>{const n=lp("atk_notify_key");n&&e.getApi().notifies.markNotifyRead(t,n).then((()=>{e.getData().updateNotifies(e.getData().getNotifies().filter((e=>e.comment_id!==t)))}))}))},e=>{let t;e.on("mounted",(()=>{const n=e.get("list");t=n.$el.querySelector('[data-action="admin-close-comment"]'),t.addEventListener("click",(()=>{const t=e.getData().getPage();if(!t)throw new Error("Page data not found");t.admin_only=!t.admin_only,function(e,t){e.editorShowLoading(),e.getApi().pages.updatePage(t.id,t).then((({data:t})=>{e.getData().updatePage(t)})).catch((t=>{e.editorShowNotify(`${_p("editFail")}: ${t.message||String(t)}`,"e")})).finally((()=>{e.editorHideLoading()}))}(e,t)}))})),e.on("page-loaded",(n=>{var s,r;const i=e.get("editor");!0===(null==n?void 0:n.admin_only)?(null==(s=i.getPlugs())||s.getEvents().trigger("editor-close"),t&&(t.innerText=_p("openComment"))):(null==(r=i.getPlugs())||r.getEvents().trigger("editor-open"),t&&(t.innerText=_p("closeComment")))})),e.on("list-loaded",(t=>{e.editorResetState()}))},e=>{e.on("list-loaded",(()=>{(()=>{var t,n;const s=e.get("list").$el.querySelector(".atk-comment-count .atk-text");if(!s)return;const r=ap(_p("counter",{count:`${Number(null==(n=null==(t=e.getData().getListLastFetch())?void 0:t.data)?void 0:n.count)||0}`}));s.innerHTML=r.replace(/(\d+)/,'<span class="atk-comment-count-num">$1</span>')})()})),e.on("comment-inserted",(()=>{const t=e.getData().getListLastFetch();(null==t?void 0:t.data)&&(t.data.count+=1)})),e.on("comment-deleted",(()=>{const t=e.getData().getListLastFetch();(null==t?void 0:t.data)&&(t.data.count-=1)}))},e=>{let t=null;const n=()=>{if(!t)return;const n=e.get("user").getData();if(n.nick&&n.email){t.classList.remove("atk-hide");const e=t.querySelector(".atk-text");e&&(e.innerText=n.isAdmin?_p("ctrlCenter"):_p("msgCenter"))}else t.classList.add("atk-hide")};e.watchConf(["locale"],(s=>{const r=e.get("list");t=r.$el.querySelector('[data-action="open-sidebar"]'),t&&(t.onclick=()=>{e.showSidebar()},n())})),e.on("user-changed",(e=>{n()}))},e=>{let t=null;e.on("mounted",(()=>{const n=e.get("list");t=n.$el.querySelector(".atk-unread-badge")})),e.on("notifies-updated",(e=>{var n;n=e.length||0,t&&(n>0?(t.innerText=`${Number(n||0)}`,t.style.display="block"):t.style.display="none")}))},e=>{const t=t=>{e.conf.listFetchParamsModifier=t,e.reload()},n=e=>{!function(e){const{$dropdownWrap:t,dropdownList:n}=e;if(t.querySelector(".atk-dropdown"))return;t.classList.add("atk-dropdown-wrap"),t.append(op('<span class="atk-arrow-down-icon"></span>'));let s=0;const r=(e,t,n,r)=>{r(),s=e,i.querySelectorAll(".active").forEach((e=>{e.classList.remove("active")})),t.classList.add("active"),i.style.display="none",setTimeout((()=>{i.style.display=""}),80)},i=op('<ul class="atk-dropdown atk-fade-in"></ul>');n.forEach(((e,t)=>{const[n,o]=e,a=op('<li class="atk-dropdown-item"><span></span></li>'),l=a.querySelector("span");l.innerText=n,l.onclick=()=>{r(t,a,n,o)},i.append(a),t===s&&a.classList.add("active")})),t.append(i)}({$dropdownWrap:e,dropdownList:[[_p("sortLatest"),()=>{t((e=>{e.sort_by="date_desc"}))}],[_p("sortBest"),()=>{t((e=>{e.sort_by="vote"}))}],[_p("sortOldest"),()=>{t((e=>{e.sort_by="date_asc"}))}],[_p("sortAuthor"),()=>{t((e=>{e.view_only_admin=!0}))}]]})};e.watchConf(["listSort","locale"],(t=>{const s=e.get("list").$el.querySelector(".atk-comment-count");s&&(t.listSort?n(s):function(e){var t,n;const{$dropdownWrap:s}=e;s.classList.remove("atk-dropdown-wrap"),null==(t=s.querySelector(".atk-arrow-down-icon"))||t.remove(),null==(n=s.querySelector(".atk-dropdown"))||n.remove()}({$dropdownWrap:s}))}))},e=>{let t=0;const n=({locker:n})=>{const s=function(){const e=window.location.hash.match(/#atk-comment-([0-9]+)/);let t=e&&e[1]&&!Number.isNaN(parseFloat(e[1]))?parseFloat(e[1]):null;t||(t=Number(lp("atk_comment")));return t||null}();s&&(n&&t===s||(t=s,e.trigger("list-goto",s)))},s=()=>n({locker:!1}),r=()=>n({locker:!0});e.on("mounted",(()=>{window.addEventListener("hashchange",s),e.on("list-loaded",r)})),e.on("unmounted",(()=>{window.removeEventListener("hashchange",s),e.off("list-loaded",r)}))},e=>{e.on("list-goto",(t=>Yc(void 0,null,(function*(){let n=e.getCommentNodes().find((e=>e.getID()===t));if(!n){const s=(yield e.getApi().comments.getComment(t)).data;e.get("list").getListLayout({forceFlatMode:!0}).insert(s.comment,s.reply_comment),n=e.getCommentNodes().find((e=>e.getID()===t))}n&&n.focus()}))))},e=>{e.on("list-loaded",(t=>{const n=e.get("list"),s=t.length<=0;let r=n.getCommentsWrapEl().querySelector(".atk-list-no-comment");s?r||(r=op('<div class="atk-list-no-comment"></div>'),r.innerHTML=Vd(n.ctx.conf.noComment||n.ctx.$t("noComment")),n.getCommentsWrapEl().appendChild(r)):null==r||r.remove()}))},e=>{e.on("mounted",(()=>{const t=e.get("list").$el.querySelector(".atk-copyright");t&&(t.innerHTML=`Powered By <a href="https://artalk.js.org" target="_blank" title="Artalk v${Vh}">Artalk</a>`)}))},e=>{let t=null;e.on("mounted",(()=>{t=window.setInterval((()=>{e.get("list").$el.querySelectorAll("[data-atk-comment-date]").forEach((t=>{const n=t.getAttribute("data-atk-comment-date");t.innerText=dp(new Date(Number(n)),e.$t)}))}),3e4)})),e.on("unmounted",(()=>{t&&window.clearInterval(t)}))},e=>{e.on("list-fetch",(()=>{Pp(e.get("list").$el,null)})),e.on("list-failed",(t=>{Kh({$err:e.get("list").$el,errMsg:t.msg,errData:t.data,retryFn:()=>e.fetch({offset:0})})}))},e=>{let t=null;const n=()=>{null==t||t.disconnect(),t=null};e.on("list-loaded",(()=>{n();const s=e.get("list").getCommentsWrapEl().childNodes,r=s.length>2?s[s.length-2]:null;r&&("IntersectionObserver"in window?(s=>{const r=e.conf.scrollRelativeTo&&e.conf.scrollRelativeTo()||null;t=new IntersectionObserver((([t])=>{t.isIntersecting&&(n(),e.trigger("list-reach-bottom"))}),{threshold:.9,root:r}),t.observe(s)})(r):console.warn("IntersectionObserver api not supported"))})),e.on("unmounted",(()=>{n()}))},e=>{const t=()=>{const t=e.get("list"),n=e.conf.scrollRelativeTo&&e.conf.scrollRelativeTo();(n||window).scroll({top:cp(t.$el,n).top,left:0})};e.on("mounted",(()=>{e.on("list-goto-first",t)})),e.on("unmounted",(()=>{e.off("list-goto-first",t)}))}],e=>{e.on("list-fetch",(t=>{if(0!==t.offset)return;const n=e.getApi().getUserFields();n&&e.getApi().notifies.getNotifies(n).then((t=>{e.getData().updateNotifies(t.data.notifies)}))}))},e=>{e.watchConf(["site","pageKey","pageTitle","countEl","pvEl","statPageKeyAttr"],(t=>{Ih({getApi:()=>e.getApi(),siteName:t.site,pageKey:t.pageKey,pageTitle:t.pageTitle,countEl:t.countEl,pvEl:t.pvEl,pageKeyAttr:t.statPageKeyAttr,pvAdd:"boolean"!=typeof e.conf.pvAdd||e.conf.pvAdd})}))},e=>{e.watchConf(["apiVersion","versionCheck"],(t=>{const n=e.get("list");t.apiVersion&&t.versionCheck&&!zh&&function(e,t,n){const s=function(e,t){const n=e.split("."),s=t.split(".");for(let r=0;r<3;r++){const e=Number(n[r]),t=Number(s[r]);if(e>t)return 1;if(t>e)return-1;if(!Number.isNaN(e)&&Number.isNaN(t))return 1;if(Number.isNaN(e)&&!Number.isNaN(t))return-1}return 0}(t,n);if(0===s)return;const r=op(`<div class="atk-version-check-notice">${_p("updateMsg",{name:_p(s<0?"frontend":"backend")})} <span class="atk-info">${_p("currentVersion")}: ${_p("frontend")} ${t} / ${_p("backend")} ${n}</span></div>`),i=op(`<span class="atk-ignore-btn">${_p("ignore")}</span>`);i.onclick=()=>{r.remove(),zh=!0},r.append(i),e.$el.parentElement.prepend(r)}(n,Vh,t.apiVersion)}))},e=>{let t;const n=n=>{const s=[e.$root,e.get("layerManager").getEl()];Gh||(Gh=window.matchMedia("(prefers-color-scheme: dark)")),"auto"===n?(t||(t=e=>Yh(s,e.matches),Gh.addEventListener("change",t)),Yh(s,Gh.matches)):(t&&(Gh.removeEventListener("change",t),t=void 0),Yh(s,n))};e.watchConf(["darkMode"],(e=>n(e.darkMode))),e.on("created",(()=>n(e.conf.darkMode))),e.on("unmounted",(()=>{t&&(null==Gh||Gh.removeEventListener("change",t)),t=void 0}))}],Xh=new Set([...Qh]);function Jh(e){return Yc(this,null,(function*(){var t;const n=new Set,s=t=>{t.forEach((t=>{"function"!=typeof t||n.has(t)||(t(e),n.add(t))}))};s(Xh);const{data:r}=yield e.getApi().conf.conf().catch((t=>{throw function(e,t){var n;let s="";if(null==(n=t.data)?void 0:n.err_no_site){const t={create_name:e.conf.site,create_urls:`${window.location.protocol}//${window.location.host}`};s=`sites|${JSON.stringify(t)}`}Kh({$err:e.get("list").$el,errMsg:t.msg||String(t),errData:t.data,retryFn:()=>Jh(e),onOpenSidebar:e.get("user").getData().isAdmin?()=>e.showSidebar({view:s}):void 0})}(e,t),t}));let i={apiVersion:null==(t=r.version)?void 0:t.version};if(e.conf.useBackendConf){if(!r.frontend_conf)throw new Error("The remote backend does not respond to the frontend conf, but `useBackendConf` conf is enabled");i=Hc(Hc({},i),function(e){const t=["el","pageKey","pageTitle","server","site","pvEl","countEl","statPageKeyAttr"];return Object.keys(e).forEach((n=>{t.includes(n)&&delete e[n],"darkMode"===n&&"auto"!==e[n]&&delete e[n]})),e.emoticons&&"string"==typeof e.emoticons&&(e.emoticons=e.emoticons.trim(),e.emoticons.startsWith("[")||e.emoticons.startsWith("{")?e.emoticons=JSON.parse(e.emoticons):"false"===e.emoticons&&(e.emoticons=!1)),e}(r.frontend_conf))}e.conf.remoteConfModifier&&e.conf.remoteConfModifier(i),i.pluginURLs&&(yield function(e,t){return Yc(this,null,(function*(){const n=new Set;if(!e||!Array.isArray(e))return n;const s=[];return e.forEach((e=>{/^(http|https):\/\//.test(e)||(e=`${t.replace(/\/$/,"")}/${e.replace(/^\//,"")}`),s.push(new Promise(((t,n)=>{if(document.querySelector(`script[src="${e}"]`))return void t();const s=document.createElement("script");s.src=e,document.head.appendChild(s),s.onload=()=>t(),s.onerror=e=>n(e)})))})),yield Promise.all(s),Object.values(window.ArtalkPlugins||{}).forEach((e=>{"function"==typeof e&&n.add(e)})),n}))}(i.pluginURLs,e.conf.server).then((e=>{s(e)})).catch((e=>{console.error("Failed to load plugin",e)}))),e.trigger("created"),e.updateConf(i),e.trigger("mounted"),e.conf.remoteConfModifier||e.fetch({offset:0})}))}class Zh{constructor(e){Kc(this,"ctx");const t=Sp(e,!0);this.ctx=new $p(t),Object.entries(Nh).forEach((([e,t])=>{const n=t(this.ctx);n&&this.ctx.inject(e,n)})),Jh(this.ctx)}getConf(){return this.ctx.getConf()}getEl(){return this.ctx.$root}update(e){return this.ctx.updateConf(e),this}reload(){this.ctx.reload()}destroy(){for(this.ctx.trigger("unmounted");this.ctx.$root.firstChild;)this.ctx.$root.removeChild(this.ctx.$root.firstChild)}on(e,t){this.ctx.on(e,t)}off(e,t){this.ctx.off(e,t)}trigger(e,t){this.ctx.trigger(e,t)}setDarkMode(e){this.ctx.setDarkMode(e)}static init(e){return new Zh(e)}static use(e){Xh.add(e)}static loadCountWidget(e){const t=Sp(e,!0);Ih({getApi:()=>new nu(Cp(t)),siteName:t.site,countEl:t.countEl,pvEl:t.pvEl,pageKeyAttr:t.statPageKeyAttr,pvAdd:!1})}get $root(){return this.ctx.$root}get conf(){return this.ctx.getConf()}}let ef=null;function tf(){return ef}const nf=function(){const e=new URLSearchParams(document.location.search);e.get("user")&&window.history.replaceState&&window.history.replaceState({},"",window.location.pathname);return{pageKey:e.get("pageKey")||"",site:e.get("site")||"",user:JSON.parse(e.get("user")||"{}"),view:e.get("view")||"",viewParams:null,darkMode:"1"===e.get("darkMode")}}();function sf(){var e;return!!(null==(e=nf.user)?void 0:e.email)}const rf=Jn({__name:"index",setup(e){const t=I_();return ls((()=>{if(nf.view){const e=nf.view.split("|");e[0]&&(nf.view=e[0]),e[1]&&(nf.viewParams=JSON.parse(e[1]))}t.replace({comments:"/comments",pages:"/pages",sites:"/sites",settings:"/settings"}[nf.view]||"/comments")})),(e,t)=>(kr(),Er("div"))}}),of={};"function"==typeof of&&of(rf);const af=vo("nav",(()=>{const e=Mt(""),t=Mt({}),n=Mt("comments"),s=Mt([]),r=Mt(!1),i=Mt(!1),o=Mt(null),a=Mt(null),l=Mt(!1),c=Mt(null);return{sites:s,curtPage:n,curtTab:e,tabs:t,siteSwitcherShow:r,scrollableArea:c,isPageLoading:l,updateTabs:(n,s)=>{t.value=n,s&&(e.value=s)},setTabActive:t=>{e.value=t},showSiteSwitcher:()=>{r.value=!0},hideSiteSwitcher:()=>{r.value=!1},toggleSiteSwitcher:()=>{r.value=!r.value},scrollPageToTop:()=>{var e;null==(e=c.value)||e.scrollTo(0,0)},scrollPageToEl:e=>{var t;null==(t=c.value)||t.scrollTo(0,e.offsetTop)},setPageLoading:e=>{l.value=e},refreshSites:()=>{null==ef||ef.ctx.getApi().sites.getSites().then((e=>{s.value=e.data.sites}))},isSearchEnabled:i,searchEvent:o,searchResetEvent:a,enableSearch:(e,t)=>{i.value=!0,o.value=e,a.value=t}}}));var lf="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function cf(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function uf(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var n=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var s=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,s.get?s:{enumerable:!0,get:function(){return e[t]}})})),n}var df={exports:{}};var pf={exports:{}};const hf=uf(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var ff,mf;function gf(){return ff||(ff=1,pf.exports=(e=e||function(e,t){var n;if("undefined"!=typeof window&&window.crypto&&(n=window.crypto),"undefined"!=typeof self&&self.crypto&&(n=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(n=globalThis.crypto),!n&&"undefined"!=typeof window&&window.msCrypto&&(n=window.msCrypto),!n&&void 0!==lf&&lf.crypto&&(n=lf.crypto),!n)try{n=hf}catch(m){}var s=function(){if(n){if("function"==typeof n.getRandomValues)try{return n.getRandomValues(new Uint32Array(1))[0]}catch(m){}if("function"==typeof n.randomBytes)try{return n.randomBytes(4).readInt32LE()}catch(m){}}throw new Error("Native crypto module could not be used to get secure random number.")},r=Object.create||function(){function e(){}return function(t){var n;return e.prototype=t,n=new e,e.prototype=null,n}}(),i={},o=i.lib={},a=o.Base=function(){return{extend:function(e){var t=r(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),l=o.WordArray=a.extend({init:function(e,n){e=this.words=e||[],this.sigBytes=n!=t?n:4*e.length},toString:function(e){return(e||u).stringify(this)},concat:function(e){var t=this.words,n=e.words,s=this.sigBytes,r=e.sigBytes;if(this.clamp(),s%4)for(var i=0;i<r;i++){var o=n[i>>>2]>>>24-i%4*8&255;t[s+i>>>2]|=o<<24-(s+i)%4*8}else for(var a=0;a<r;a+=4)t[s+a>>>2]=n[a>>>2];return this.sigBytes+=r,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=a.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],n=0;n<e;n+=4)t.push(s());return new l.init(t,e)}}),c=i.enc={},u=c.Hex={stringify:function(e){for(var t=e.words,n=e.sigBytes,s=[],r=0;r<n;r++){var i=t[r>>>2]>>>24-r%4*8&255;s.push((i>>>4).toString(16)),s.push((15&i).toString(16))}return s.join("")},parse:function(e){for(var t=e.length,n=[],s=0;s<t;s+=2)n[s>>>3]|=parseInt(e.substr(s,2),16)<<24-s%8*4;return new l.init(n,t/2)}},d=c.Latin1={stringify:function(e){for(var t=e.words,n=e.sigBytes,s=[],r=0;r<n;r++){var i=t[r>>>2]>>>24-r%4*8&255;s.push(String.fromCharCode(i))}return s.join("")},parse:function(e){for(var t=e.length,n=[],s=0;s<t;s++)n[s>>>2]|=(255&e.charCodeAt(s))<<24-s%4*8;return new l.init(n,t)}},p=c.Utf8={stringify:function(e){try{return decodeURIComponent(escape(d.stringify(e)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(e){return d.parse(unescape(encodeURIComponent(e)))}},h=o.BufferedBlockAlgorithm=a.extend({reset:function(){this._data=new l.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=p.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n,s=this._data,r=s.words,i=s.sigBytes,o=this.blockSize,a=i/(4*o),c=(a=t?e.ceil(a):e.max((0|a)-this._minBufferSize,0))*o,u=e.min(4*c,i);if(c){for(var d=0;d<c;d+=o)this._doProcessBlock(r,d);n=r.splice(0,c),s.sigBytes-=u}return new l.init(n,u)},clone:function(){var e=a.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0});o.Hasher=h.extend({cfg:a.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){h.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,n){return new e.init(n).finalize(t)}},_createHmacHelper:function(e){return function(t,n){return new f.HMAC.init(e,n).finalize(t)}}});var f=i.algo={};return i}(Math),e)),pf.exports;var e}const vf=cf(df.exports=(mf=gf(),function(e){var t=mf,n=t.lib,s=n.WordArray,r=n.Hasher,i=t.algo,o=[],a=[];!function(){function t(t){for(var n=e.sqrt(t),s=2;s<=n;s++)if(!(t%s))return!1;return!0}function n(e){return 4294967296*(e-(0|e))|0}for(var s=2,r=0;r<64;)t(s)&&(r<8&&(o[r]=n(e.pow(s,.5))),a[r]=n(e.pow(s,1/3)),r++),s++}();var l=[],c=i.SHA256=r.extend({_doReset:function(){this._hash=new s.init(o.slice(0))},_doProcessBlock:function(e,t){for(var n=this._hash.words,s=n[0],r=n[1],i=n[2],o=n[3],c=n[4],u=n[5],d=n[6],p=n[7],h=0;h<64;h++){if(h<16)l[h]=0|e[t+h];else{var f=l[h-15],m=(f<<25|f>>>7)^(f<<14|f>>>18)^f>>>3,g=l[h-2],v=(g<<15|g>>>17)^(g<<13|g>>>19)^g>>>10;l[h]=m+l[h-7]+v+l[h-16]}var y=s&r^s&i^r&i,k=(s<<30|s>>>2)^(s<<19|s>>>13)^(s<<10|s>>>22),b=p+((c<<26|c>>>6)^(c<<21|c>>>11)^(c<<7|c>>>25))+(c&u^~c&d)+a[h]+l[h];p=d,d=u,u=c,c=o+b|0,o=i,i=r,r=s,s=b+(k+y)|0}n[0]=n[0]+s|0,n[1]=n[1]+r|0,n[2]=n[2]+i|0,n[3]=n[3]+o|0,n[4]=n[4]+c|0,n[5]=n[5]+u|0,n[6]=n[6]+d|0,n[7]=n[7]+p|0},_doFinalize:function(){var t=this._data,n=t.words,s=8*this._nDataBytes,r=8*t.sigBytes;return n[r>>>5]|=128<<24-r%32,n[14+(r+64>>>9<<4)]=e.floor(s/4294967296),n[15+(r+64>>>9<<4)]=s,t.sigBytes=4*n.length,this._process(),this._hash},clone:function(){var e=r.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA256=r._createHelper(c),t.HmacSHA256=r._createHmacHelper(c)}(Math),mf.SHA256));var yf={exports:{}};yf.exports=function(e){return function(t){var n=e,s=n.lib,r=s.WordArray,i=s.Hasher,o=n.algo,a=[];!function(){for(var e=0;e<64;e++)a[e]=4294967296*t.abs(t.sin(e+1))|0}();var l=o.MD5=i.extend({_doReset:function(){this._hash=new r.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var n=0;n<16;n++){var s=t+n,r=e[s];e[s]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8)}var i=this._hash.words,o=e[t+0],l=e[t+1],h=e[t+2],f=e[t+3],m=e[t+4],g=e[t+5],v=e[t+6],y=e[t+7],k=e[t+8],b=e[t+9],w=e[t+10],_=e[t+11],E=e[t+12],x=e[t+13],S=e[t+14],C=e[t+15],A=i[0],$=i[1],T=i[2],L=i[3];A=c(A,$,T,L,o,7,a[0]),L=c(L,A,$,T,l,12,a[1]),T=c(T,L,A,$,h,17,a[2]),$=c($,T,L,A,f,22,a[3]),A=c(A,$,T,L,m,7,a[4]),L=c(L,A,$,T,g,12,a[5]),T=c(T,L,A,$,v,17,a[6]),$=c($,T,L,A,y,22,a[7]),A=c(A,$,T,L,k,7,a[8]),L=c(L,A,$,T,b,12,a[9]),T=c(T,L,A,$,w,17,a[10]),$=c($,T,L,A,_,22,a[11]),A=c(A,$,T,L,E,7,a[12]),L=c(L,A,$,T,x,12,a[13]),T=c(T,L,A,$,S,17,a[14]),A=u(A,$=c($,T,L,A,C,22,a[15]),T,L,l,5,a[16]),L=u(L,A,$,T,v,9,a[17]),T=u(T,L,A,$,_,14,a[18]),$=u($,T,L,A,o,20,a[19]),A=u(A,$,T,L,g,5,a[20]),L=u(L,A,$,T,w,9,a[21]),T=u(T,L,A,$,C,14,a[22]),$=u($,T,L,A,m,20,a[23]),A=u(A,$,T,L,b,5,a[24]),L=u(L,A,$,T,S,9,a[25]),T=u(T,L,A,$,f,14,a[26]),$=u($,T,L,A,k,20,a[27]),A=u(A,$,T,L,x,5,a[28]),L=u(L,A,$,T,h,9,a[29]),T=u(T,L,A,$,y,14,a[30]),A=d(A,$=u($,T,L,A,E,20,a[31]),T,L,g,4,a[32]),L=d(L,A,$,T,k,11,a[33]),T=d(T,L,A,$,_,16,a[34]),$=d($,T,L,A,S,23,a[35]),A=d(A,$,T,L,l,4,a[36]),L=d(L,A,$,T,m,11,a[37]),T=d(T,L,A,$,y,16,a[38]),$=d($,T,L,A,w,23,a[39]),A=d(A,$,T,L,x,4,a[40]),L=d(L,A,$,T,o,11,a[41]),T=d(T,L,A,$,f,16,a[42]),$=d($,T,L,A,v,23,a[43]),A=d(A,$,T,L,b,4,a[44]),L=d(L,A,$,T,E,11,a[45]),T=d(T,L,A,$,C,16,a[46]),A=p(A,$=d($,T,L,A,h,23,a[47]),T,L,o,6,a[48]),L=p(L,A,$,T,y,10,a[49]),T=p(T,L,A,$,S,15,a[50]),$=p($,T,L,A,g,21,a[51]),A=p(A,$,T,L,E,6,a[52]),L=p(L,A,$,T,f,10,a[53]),T=p(T,L,A,$,w,15,a[54]),$=p($,T,L,A,l,21,a[55]),A=p(A,$,T,L,k,6,a[56]),L=p(L,A,$,T,C,10,a[57]),T=p(T,L,A,$,v,15,a[58]),$=p($,T,L,A,x,21,a[59]),A=p(A,$,T,L,m,6,a[60]),L=p(L,A,$,T,_,10,a[61]),T=p(T,L,A,$,h,15,a[62]),$=p($,T,L,A,b,21,a[63]),i[0]=i[0]+A|0,i[1]=i[1]+$|0,i[2]=i[2]+T|0,i[3]=i[3]+L|0},_doFinalize:function(){var e=this._data,n=e.words,s=8*this._nDataBytes,r=8*e.sigBytes;n[r>>>5]|=128<<24-r%32;var i=t.floor(s/4294967296),o=s;n[15+(r+64>>>9<<4)]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8),n[14+(r+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),e.sigBytes=4*(n.length+1),this._process();for(var a=this._hash,l=a.words,c=0;c<4;c++){var u=l[c];l[c]=16711935&(u<<8|u>>>24)|4278255360&(u<<24|u>>>8)}return a},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});function c(e,t,n,s,r,i,o){var a=e+(t&n|~t&s)+r+o;return(a<<i|a>>>32-i)+t}function u(e,t,n,s,r,i,o){var a=e+(t&s|n&~s)+r+o;return(a<<i|a>>>32-i)+t}function d(e,t,n,s,r,i,o){var a=e+(t^n^s)+r+o;return(a<<i|a>>>32-i)+t}function p(e,t,n,s,r,i,o){var a=e+(n^(t|~s))+r+o;return(a<<i|a>>>32-i)+t}n.MD5=i._createHelper(l),n.HmacMD5=i._createHmacHelper(l)}(Math),e.MD5}(gf());const kf=cf(yf.exports),bf=vo("user",{state:()=>({site:nf.site||"",name:nf.user.nick||"",email:nf.user.email||"",isAdmin:nf.user.isAdmin||!1,token:nf.user.token||""}),actions:{logout(){var e;this.site="",this.name="",this.email="",this.isAdmin=!1,this.token="",null==(e=tf())||e.ctx.get("user").logout()},sync(){var e;const t=null==(e=tf())?void 0:e.ctx.get("user");if(!t)throw new Error("Artalk is not initialized");if(!t.checkHasBasicUserInfo())throw new Error("User is not logged in");const n=t.getData();this.site="",this.name=n.nick,this.email=n.email,this.isAdmin=n.isAdmin,this.token=n.token}},getters:{avatar:e=>function(e){var t,n;const s=null==(n=null==(t=tf())?void 0:t.ctx.conf)?void 0:n.gravatar;if(!s)return"";const r="string"==typeof s.params&&s.params.includes("sha256=1")?vf(e.toLowerCase()).toString():kf(e.toLowerCase()).toString();return`${s.mirror.replace(/\/$/,"")}/${r}?${s.params.replace(/^\?/,"")}`}(e.email)}});const wf=(e,t)=>{const n=e.__vccOpts||e;for(const[s,r]of t)n[s]=r;return n},_f=wf(Jn({__name:"comments",setup(e){const t=Mt(),n=Mt(),s=bf(),r=af(),{curtTab:i}=yo(r),{site:o}=yo(s);Tc();const a=Mt("");return ls((()=>{var e;s.isAdmin?r.updateTabs({all:"all",pending:"pending",personal_all:"personal"},"all"):r.updateTabs({all:"all",mentions:"mentions",mine:"mine",pending:"pending"},"all"),Pn(i,(e=>{ef.ctx.fetch({offset:0})})),Pn(o,(e=>{ef.ctx.reload()})),ef.ctx.on("comment-rendered",(e=>{const t=e.getData().page_url;e.getRender().setOpenURL(`${t}#atk-comment-${e.getID()}`)})),ef.ctx.updateConf({listFetchParamsModifier:e=>{e.site_name=o.value;let t=s.isAdmin?"site":"user",n=i.value;"personal_all"===i.value&&(t="user",n="all"),e.scope=t,e.type=n,a.value&&(e.search=a.value)},scrollRelativeTo:()=>t.value}),ef.reload();const l=ef.ctx.get("list").$el;l.querySelector(".atk-list-header").style.display="none",l.querySelector(".atk-list-footer").style.display="none",null==(e=n.value)||e.append(l),r.enableSearch((e=>{a.value=e,ef.reload()}),(()=>{""!==a.value&&(a.value="",ef.reload())}))})),(e,s)=>(kr(),Er("div",{ref_key:"wrapEl",ref:t,class:"comments-wrap"},[Tr("div",{ref_key:"listEl",ref:n},null,512)],512))}}),[["__scopeId","data-v-ae18da71"]]),Ef=e=>(wn("data-v-bcddeb94"),e=e(),_n(),e),xf={class:"login-dialog"},Sf=Ef((()=>Tr("a",{href:"https://artalk.js.org/",target:"_blank"},[Tr("img",{class:"logo",src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAPoAAAD6CAMAAAC/MqoPAAAArlBMVEVug5H///+e1+dicnmGrbzb4OSf2Oi3wciJlZtldn9oeoWxubxrf4t0j5nP7PRpfYj2+PiSoq1tgo/Y3N7t8PKSwtJjdHzJ0daAk593i5hmeIJ2hIrFys1se4Glsrq24u7Ayc+dp6u7w8abqrSJmqbO09WtusGAjZLl6evi5eansLSBpbKSnqOQv818nKnq9/rS2d3Z8Pan2+q1v8T2/P3L6fHI3+apytSMuMabsro76b/PAAAFxElEQVR42uzc6VLbQBAE4J0sYn3GkuwgycSOic2RmCNAzvd/sRxVVBKY9UjsIo9d/f3P0R4xah3GAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAbN2o55WbvTawfgOzx8qs4zPb8+gT8upYOzL7a05+fWt7ppEuZ2pUqiZS9PCt0TMqOdocvcHEVs7d95/oaN0XVUobjK3thn6KH63VeYJ0FC964lmVR0ajKhWiN/l/E8tanVvO0WbWWlPXiv/0lJ4fq1SOHniWfK90yy1IYBvsqII4J9YahUqSNDkzXRDn2HaNQkXU6MRJdW45ZugBJT4jzqnOLccMPaDJOv4vUFloSooa/RN/2KjccszQuVPTNOja12rcchkJ5CYrH0MfVF62JXGjL4nzVmOh4YaeclM7CtlyJxq3XMIkfx/QZBPinCu8bOOG3u+z0fet0HBDnzHRZ9bm+3XZlrEr6b5ukx118+H/zojjhh5597eW1oB8Ej4+WtaNPh0ePnJLnHeHPtfWbqfszNmhj5hj4fLJIVs55/pfXz/ymTi3r32+9Fu8pJOHbrI6TTajOM7bKzvy0OtFdxRF2uIGlIdusjolPqEoxi2WHXnoJqvTZFOKor+NslOxQ7d5veglxXG5jS3n2MOvx1QyrsQvKY5ZO1tOvgHdsTkTnWuyC4pi0t4lnTx0IXrkLXfaaqGRh25ILvEUx8dWt5w8dCPfjl5RHJ22LunkodeNfkZxbKHQLNihP0wgFUt8QVF8aH/LlbRp6CYRm+wFRfG+1/qprWDPM1NTN3pFccxN20r+1mG+Ifrb/0r8KmHwR0I6Ho8Tn5WRtTp0kwhNtskd/beqbk4JQxeiN319SNUteHbo/yZL2MZ59Lz70JqetmX80AebPxsrRkj1P21LpKEbJ0Rvch9a09M2ceh89GNr8+e8PqRpy3FDT2ddYWHJ75QsiHOp6Glbxt8mGoRF978+pOhpmzx0PvqJdOQSZ6Joy3mGPnoUnW+yu/360IQd+qODcumJvtOFZu4ZOjNBpsTv9OtDwtCZ6EKTlQqNmi0nDD0geskXGj3vFEyIf9YkRZdL/FJ5oZkT/6yJjS43WbnQnGjZchU79Lurq6v1+no4HNkHnebRE77QaNlyjhi3h/94c3V1sF4PR9S4xBMn1VJoqpQCME1WLjRaLtscRY4u3pfvK/lRbzR0vpiNmhYaJZdtAUOXm+xEc6Gp0tjR5fehlRSaRYTnwdOdLDQlBRCbrNNcaIoo0XfxPnQZ5Q23o10sNCFDl5vsSvFlW0nxo8uFRsWWKyiCc29BKfQWmowYgU1WLjQzDVsuednoFV9oNGw5ZujhJV7+gpeGyzZh6E2a7I4VmowfSv/eeRVydLnQKNhyCd83usKnxZX4bpPLtu1vuYyEB4yMTGqy8pYbK4g+Ic8DxrDo8s2prR/wcxIeO3AqTye39btcMd16mfMMXbh9Iv30ygv+5vDNwbDZitcw9GbRE2Ld/bm7fXBt6tMwdOM7XQ3qR7+5e7i5vx4OHuO2gI6hG7nJyo3p5u/3OV99v87tX21sgUoYerTovM83v766+e7Btx+XnT+O29j9Th46LxEuwIN68mULZ/wqFYbeOHpPfvwga+MbvM5zj3gUNbqjZlLur4k/dOlVAjm6XOcyaua0hUs657mO7sWNblISyL+UqaWh2zxy9IIErf+WyYV36DIn1LmQ+72zF99yJQlDD4gesuguXr7QFMLQA6IHHfLF0y2naejGCXUuIPsZ8/kpGroQneH0bDlh6NGjm7Lu4JkncZqGbrJnPEUrzy5Ilrz0lsuIVYb9eScea/OFdDGzMC/MJZz6/+wq4czrVals6ZxLPJYGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA9k1+fbCT1ibcwaud9AbRER3RER3RER3RER3REX0XITqiI/rPjXp91OujXh/1+qjXR70+zL0OADOjk25ATTBxAAAAAElFTkSuQmCC",alt:"logo",draggable:"false"})],-1))),Cf=["placeholder"],Af=["placeholder"],$f={key:0,class:"err-msg atk-fade-in"},Tf={type:"submit"},Lf={class:"copyright"},Of=Ef((()=>Tr("a",{href:"https://artalk.js.org",target:"_blank"},"Artalk",-1))),Nf={key:0,class:"layer"},If={class:"user-selector atk-fade-in"},Pf={class:"text"},Rf={class:"user-list"},Mf=["onClick"],Df=Jn({__name:"login",setup(e){const t=I_(),{t:n}=Tc();let s=Mt({email:"",password:""}),r=Mt(""),i=Mt(""),o=Mt(""),a=Mt(null);function l(){o.value=""}function c(e){o.value="";const r=tf();if(!r)throw new Error("Artalk instance not initialized");r.ctx.getApi().user.login({name:e||"",email:s.value.email,password:s.value.password}).then((e=>{const n=e.data.user;r.ctx.get("user").update({nick:n.name,email:n.email,link:n.link,isAdmin:n.is_admin,token:e.data.token}),bf().sync(),t.replace("/")})).catch((e=>{var t,s;(null==(t=e.data)?void 0:t.need_name_select)?a.value=null==(s=e.data)?void 0:s.need_name_select:o.value=e.message||n("loginFailure")}))}return ls((()=>{tf().ctx.getApi().version.getVersion().then((e=>{r.value=e.data.version,i.value=e.data.commit_hash}))})),(e,t)=>(kr(),Er("div",xf,[Sf,Tr("form",{class:"login-form",onSubmit:t[2]||(t[2]=Zi((e=>c()),["prevent"]))},[Fn(Tr("input",{"onUpdate:modelValue":t[0]||(t[0]=e=>jt(s).email=e),type:"text",placeholder:jt(n)("email"),onFocus:l},null,40,Cf),[[Hi,jt(s).email]]),Fn(Tr("input",{"onUpdate:modelValue":t[1]||(t[1]=e=>jt(s).password=e),type:"password",placeholder:jt(n)("password"),onFocus:l},null,40,Af),[[Hi,jt(s).password]]),jt(o)?(kr(),Er("div",$f,ue(jt(o)),1)):Ir("",!0),Tr("button",Tf,ue(jt(n)("login")),1)],32),Tr("div",Lf,[Nr(" Powered by "),Of,Nr(" (v"+ue(jt(r))+" / "+ue(jt(i))+") ",1)]),jt(a)?(kr(),Er("div",Nf,[Tr("div",If,[Tr("div",Pf,ue(jt(n)("loginSelectHint")),1),Tr("div",Rf,[(kr(!0),Er(hr,null,vs(jt(a),((e,t)=>(kr(),Er("div",{key:t,class:"item",onClick:t=>{return n=e,a.value=null,void c(n);var n}},ue(e),9,Mf)))),128))])])])):Ir("",!0)]))}});"function"==typeof of&&of(Df);const Uf=wf(Df,[["__scopeId","data-v-bcddeb94"]]),Ff=e=>(wn("data-v-062e733c"),e=e(),_n(),e),jf={class:"atk-item-text-editor-layer"},Bf={class:"atk-edit-form"},qf=["placeholder"],Wf={class:"atk-actions"},Hf=[Ff((()=>Tr("i",{class:"atk-icon atk-icon-yes"},null,-1)))],Vf=[Ff((()=>Tr("i",{class:"atk-icon atk-icon-no"},null,-1)))],Kf=wf(Jn({__name:"ItemTextEditor",props:{initValue:{},placeholder:{},validator:{type:Function}},emits:["yes","no","close"],setup(e,{emit:t}){const n=e,s=t,r=Mt(null),i=Mt(""),o=Mt(!1),{t:a}=Tc();function l(e){"Enter"!==e.key&&13!==e.keyCode||(e.preventDefault(),c("yes"))}function c(e){return d(this,null,(function*(){if("yes"==e&&o.value)return;let t;const n=s(e,i.value);t=n instanceof(()=>d(this,null,(function*(){}))).constructor?yield n:n,void 0!==t&&!0!==t||s("close")}))}return ls((()=>{i.value=n.initValue||"",window.setTimeout((()=>{var e;return null==(e=r.value)?void 0:e.focus()}),80)})),(e,t)=>(kr(),Er("div",jf,[Tr("div",Bf,[Fn(Tr("input",{ref_key:"inputEl",ref:r,"onUpdate:modelValue":t[0]||(t[0]=e=>Rt(i)?i.value=e:null),class:ie(["atk-main-input",{"atk-invalid":jt(o)}]),type:"text",placeholder:n.placeholder||jt(a)("inputHint"),autocomplete:"off",onInput:t[1]||(t[1]=e=>{n.validator&&(o.value=n.validator(i.value))}),onKeyup:l},null,42,qf),[[Hi,jt(i)]])]),Tr("div",Wf,[Tr("div",{class:ie(["atk-item atk-yes-btn",{"atk-disabled":jt(o)}]),onClick:t[2]||(t[2]=e=>c("yes"))},Hf,2),Tr("div",{class:"atk-item atk-no-btn",onClick:t[3]||(t[3]=e=>c("no"))},Vf)])]))}}),[["__scopeId","data-v-062e733c"]]),zf={key:0,class:"atk-loading-spinner"},Gf=[Tr("svg",{viewBox:"25 25 50 50"},[Tr("circle",{cx:"50",cy:"50",r:"20",fill:"none","stroke-width":"2","stroke-miterlimit":"10"})],-1)],Yf=Jn({__name:"LoadingLayer",props:{transparentBg:{type:Boolean},timeout:{}},setup(e){const t=e,n=Mt(!1);let s;return ls((()=>{s=window.setTimeout((()=>{n.value=!0,s=void 0}),t.timeout||700)})),ps((()=>{window.clearTimeout(s)})),(e,s)=>(kr(),Er("div",{class:"atk-loading atk-fade-in",style:ee({background:t.transparentBg?"transparent":void 0})},[jt(n)?(kr(),Er("div",zf,Gf)):Ir("",!0)],4))}}),Qf=e=>(wn("data-v-4e12f559"),e=e(),_n(),e),Xf={class:"atk-page-edit-layer"},Jf={class:"atk-page-main-actions"},Zf={class:"atk-page-actions"},em=[Qf((()=>Tr("i",{class:"atk-icon atk-icon-sync"},null,-1)))],tm=[Qf((()=>Tr("i",{class:"atk-icon atk-icon-del"},null,-1)))],nm=[Qf((()=>Tr("i",{class:"atk-icon atk-icon-close"},null,-1)))],sm=wf(Jn({__name:"PageEditor",props:{page:{}},emits:["close","update","remove"],setup(e,{emit:t}){const n=e,s=t,{page:r}=Wt(n),i=Mt(null),o=ei((()=>String(i.value&&r.value[i.value]||""))),a=Mt(!1),{t:u}=Tc();function p(){s("close")}function h(e){return d(this,null,(function*(){if(o.value!==e){let n;a.value=!0;try{n=(yield ef.ctx.getApi().pages.updatePage(r.value.id,c(l({},r.value),{[i.value]:e}))).data}catch(t){return alert(`修改失败:${t.message||"未知错误"}`),console.error(t),!1}finally{a.value=!1}s("update",n)}return i.value=null,p(),!0}))}function f(){i.value=null}return(e,t)=>{const n=Yf,m=Kf;return kr(),Er("div",Xf,[Tr("div",Jf,[Tr("div",{class:"atk-item atk-title-edit-btn",onClick:t[0]||(t[0]=e=>{i.value="title"})},ue(jt(u)("editTitle")),1),Tr("div",{class:"atk-item atk-key-edit-btn",onClick:t[1]||(t[1]=e=>{i.value="key"})},ue(jt(u)("switchKey")),1),Tr("div",{class:ie(["atk-item atk-admin-only-btn",jt(r).admin_only?"atk-yellow":"atk-green"]),onClick:t[2]||(t[2]=e=>function(){return d(this,null,(function*(){let e;a.value=!0;try{e=(yield ef.ctx.getApi().pages.updatePage(r.value.id,c(l({},r.value),{admin_only:!r.value.admin_only}))).data}catch(t){return alert(`修改失败:${t.message||"未知错误"}`),void console.error(t)}finally{a.value=!1}s("update",e)}))}())},ue(jt(r).admin_only?jt(u)("commentOnlyAdmin"):jt(u)("commentAllowAll")),3)]),Tr("div",Zf,[Tr("div",{class:"atk-item atk-sync-btn",onClick:t[3]||(t[3]=e=>function(){return d(this,null,(function*(){let e;a.value=!0;try{e=(yield ef.ctx.getApi().pages.fetchPage(r.value.id)).data}catch(t){return alert(`同步失败:${t.message||"未知错误"}`),void console.error(t)}finally{a.value=!1}s("update",e)}))}())},em),Tr("div",{class:"atk-item atk-del-btn",onClick:t[4]||(t[4]=e=>function(){window.confirm(`确认删除页面 "${r.value.title||r.value.key}"?将会删除所有相关数据`)&&(()=>{d(this,null,(function*(){a.value=!0;try{yield ef.ctx.getApi().pages.deletePage(r.value.id)}catch(e){return console.error(e),void alert(`删除失败 ${String(e)}`)}finally{a.value=!1}s("remove",r.value.id)}))})()}())},tm),Tr("div",{class:"atk-item atk-close-btn",onClick:t[5]||(t[5]=e=>p())},nm)]),jt(a)?(kr(),xr(n,{key:0,style:{"z-index":"1000"}})):Ir("",!0),jt(i)?(kr(),xr(m,{key:1,"init-value":jt(o),onYes:h,onNo:f},null,8,["init-value"])):Ir("",!0)])}}}),[["__scopeId","data-v-4e12f559"]]),rm=e=>(wn("data-v-276e63e9"),e=e(),_n(),e),im={class:"atk-pagination-wrap"},om={class:"atk-pagination"},am=[rm((()=>Tr("svg",{stroke:"currentColor",fill:"currentColor","stroke-width":"0",viewBox:"0 0 512 512",height:"14px",width:"14px",xmlns:"http://www.w3.org/2000/svg"},[Tr("path",{d:"M217.9 256L345 129c9.4-9.4 9.4-24.6 0-33.9-9.4-9.4-24.6-9.3-34 0L167 239c-9.1 9.1-9.3 23.7-.7 33.1L310.9 417c4.7 4.7 10.9 7 17 7s12.3-2.3 17-7c9.4-9.4 9.4-24.6 0-33.9L217.9 256z"})],-1)))],lm=["disabled"],cm=[rm((()=>Tr("svg",{stroke:"currentColor",fill:"currentColor","stroke-width":"0",viewBox:"0 0 512 512",height:"14px",width:"14px",xmlns:"http://www.w3.org/2000/svg"},[Tr("path",{d:"M294.1 256L167 129c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.3 34 0L345 239c9.1 9.1 9.3 23.7.7 33.1L201.1 417c-4.7 4.7-10.9 7-17 7s-12.3-2.3-17-7c-9.4-9.4-9.4-24.6 0-33.9l127-127.1z"})],-1)))],um=wf(Jn({__name:"Pagination",props:{total:{},pageSize:{},disabled:{type:Boolean}},emits:["change"],setup(e,{expose:t,emit:n}){const s=e,{pageSize:r,total:i,disabled:o}=Wt(s),a=n,l=Mt(1),c=ei((()=>r.value*(l.value-1))),u=ei((()=>Math.ceil(i.value/r.value))),d=ei((()=>l.value-1<1)),p=ei((()=>l.value+1>u.value)),h=Mt(String(l.value));let f;function m(e){l.value=e,a("change",c.value),y(e)}function g(){if(null==o?void 0:o.value)return;const e=l.value-1;e<1||m(e)}function v(){if(null==o?void 0:o.value)return;const e=l.value+1;e>u.value||m(e)}function y(e){h.value=String(e)}function k(){y(l.value)}function b(e=!1){window.clearTimeout(f);const t=h.value.trim(),n=()=>{if(""===t)return void k();let e=Number(t);Number.isNaN(e)||e<1?k():(e>u.value&&(e=u.value),m(e))};e?n():f=window.setTimeout((()=>n()),800)}function w(e){const t=e.keyCode||e.which;if(38===t){const e=Number(h.value)+1;if(e>u.value)return;y(e),b(!1)}else if(40===t){const e=Number(h.value)-1;if(e<1)return;y(e),b(!1)}else 13===t&&b(!0)}return t({prev:g,next:v,reset:function(){l.value=1,y(1)}}),(e,t)=>(kr(),Er("div",im,[Tr("div",om,[Tr("div",{class:ie(["atk-btn atk-btn-prev",{"atk-disabled":jt(o)||jt(d)}]),"aria-label":"Previous page",onClick:t[0]||(t[0]=e=>g())},am,2),Fn(Tr("input",{"onUpdate:modelValue":t[1]||(t[1]=e=>Rt(h)?h.value=e:null),type:"text",class:"atk-input","aria-label":"Enter the number of page",disabled:jt(o),onInput:t[2]||(t[2]=e=>b(!1)),onKeydown:w},null,40,lm),[[Hi,jt(h)]]),Tr("div",{class:ie(["atk-btn atk-btn-next",{"atk-disabled":jt(o)||jt(p)}]),"aria-label":"Next page",onClick:t[3]||(t[3]=e=>v())},cm,2)])]))}}),[["__scopeId","data-v-276e63e9"]]),dm={class:"atk-page-list-wrap"},pm={class:"atk-text"},hm={class:"atk-text"},fm={class:"atk-text"},mm={class:"atk-page-list"},gm={class:"atk-page-main"},vm=["onClick"],ym=["onClick"],km={class:"atk-page-actions"},bm=["onClick"],wm=[(e=>(wn("data-v-31858877"),e=e(),_n(),e))((()=>Tr("i",{class:"atk-icon atk-icon-edit"},null,-1)))],_m=wf(Jn({__name:"pages",setup(e){const t=af(),{site:n}=yo(bf()),s=Mt([]),r=Mt(null),{t:i}=Tc(),o=Mt(20),a=Mt(0),l=Mt(),c=Mt(!1),u=Mt({isRun:!1,statusText:""});function p(){c.value=t.scrollableArea.scrollTop>10}function h(e){t.setPageLoading(!0),null==ef||ef.ctx.getApi().pages.getPages({site_name:n.value,offset:e,limit:o.value}).then((e=>{a.value=e.data.count,s.value=e.data.pages,t.scrollPageToTop()})).finally((()=>{t.setPageLoading(!1)}))}function f(e){h(e)}function m(e){const t=s.value.findIndex((t=>t.id===e.id));if(-1!=t){const n=s.value[t];Object.keys(e).forEach((t=>{n[t]=e[t]}))}}function g(e){const t=s.value.findIndex((t=>t.id===e));s.value.splice(t,1)}function v(){return d(this,null,(function*(){return(yield ef.ctx.getApi().pages.getPageFetchStatus()).data}))}function y(){const e=window.setInterval((()=>d(this,null,(function*(){const t=yield v();if(!1===t.is_progress)return clearInterval(e),void k();u.value.statusText=t.msg}))),1e3)}function k(){u.value.statusText=i("updateComplete"),window.setTimeout((()=>{u.value.isRun=!1}),1500)}function b(e){window.open(e)}return ls((()=>{var e;t.updateTabs({},""),h(0),Pn(n,(e=>{var t;null==(t=l.value)||t.reset(),h(0)})),v().then((e=>{!0===e.is_progress&&(u.value.isRun=!0,u.value.statusText=e.msg,y())})),null==(e=t.scrollableArea)||e.addEventListener("scroll",p)})),ps((()=>{var e;null==(e=t.scrollableArea)||e.removeEventListener("scroll",p)})),(e,p)=>{const h=sm;return kr(),Er("div",dm,[Tr("div",{class:ie(["atk-header-action-bar",{bordered:jt(c)}])},[Tr("span",{class:"atk-update-all-title-btn",onClick:p[0]||(p[0]=e=>function(){return d(this,null,(function*(){if(!u.value.isRun){u.value.isRun=!0,u.value.statusText=i("updateReady");try{yield ef.ctx.getApi().pages.fetchAllPages({site_name:n.value})}catch(e){return alert(e.msg),void k()}y()}}))}())},[Tr("i",{class:ie(["atk-icon atk-icon-sync",{"atk-rotate":jt(u).isRun}])},null,2),Tr("span",pm,ue(jt(u).isRun?jt(u).statusText:jt(i)("updateTitle")),1)]),Tr("span",{class:"atk-cache-flush-all-btn",onClick:p[1]||(p[1]=e=>{ef.ctx.getApi().cache.flushCache().then((e=>alert(e.data.msg))).catch((()=>alert(i("opFailed"))))})},[Tr("span",hm,ue(jt(i)("cacheClear")),1)]),Tr("span",{class:"atk-cache-warm-up-btn",onClick:p[2]||(p[2]=e=>{ef.ctx.getApi().cache.warmUpCache().then((e=>alert(e.data.msg))).catch((()=>alert(i("opFailed"))))})},[Tr("span",fm,ue(jt(i)("cacheWarm")),1)])],2),Tr("div",mm,[(kr(!0),Er(hr,null,vs(jt(s),(e=>(kr(),Er("div",{key:e.id,class:"atk-page-item"},[Tr("div",gm,[Tr("div",{class:"atk-title",onClick:t=>b(e.url)},ue(e.title),9,vm),Tr("div",{class:"atk-sub",onClick:t=>b(e.url)},ue(e.url),9,ym)]),Tr("div",km,[Tr("div",{class:"atk-item atk-edit-btn",onClick:t=>function(e){r.value=e.id}(e)},wm,8,bm)]),jt(r)===e.id?(kr(),xr(h,{key:0,page:e,onClose:p[3]||(p[3]=e=>r.value=null),onUpdate:m,onRemove:g},null,8,["page"])):Ir("",!0)])))),128))]),Lr(um,{ref_key:"pagination",ref:l,"page-size":jt(o),total:jt(a),disabled:jt(t).isPageLoading,onChange:f},null,8,["page-size","total","disabled"])])}}}),[["__scopeId","data-v-31858877"]]),Em=Symbol.for("yaml.alias"),xm=Symbol.for("yaml.document"),Sm=Symbol.for("yaml.map"),Cm=Symbol.for("yaml.pair"),Am=Symbol.for("yaml.scalar"),$m=Symbol.for("yaml.seq"),Tm=Symbol.for("yaml.node.type"),Lm=e=>!!e&&"object"==typeof e&&e[Tm]===Em,Om=e=>!!e&&"object"==typeof e&&e[Tm]===xm,Nm=e=>!!e&&"object"==typeof e&&e[Tm]===Sm,Im=e=>!!e&&"object"==typeof e&&e[Tm]===Cm,Pm=e=>!!e&&"object"==typeof e&&e[Tm]===Am,Rm=e=>!!e&&"object"==typeof e&&e[Tm]===$m;function Mm(e){if(e&&"object"==typeof e)switch(e[Tm]){case Sm:case $m:return!0}return!1}function Dm(e){if(e&&"object"==typeof e)switch(e[Tm]){case Em:case Sm:case Am:case $m:return!0}return!1}const Um=e=>(Pm(e)||Mm(e))&&!!e.anchor,Fm=Symbol("break visit"),jm=Symbol("skip children"),Bm=Symbol("remove node");function qm(e,t){const n=Km(t);if(Om(e)){Wm(null,e.contents,n,Object.freeze([e]))===Bm&&(e.contents=null)}else Wm(null,e,n,Object.freeze([]))}function Wm(e,t,n,s){const r=zm(e,t,n,s);if(Dm(r)||Im(r))return Gm(e,s,r),Wm(e,r,n,s);if("symbol"!=typeof r)if(Mm(t)){s=Object.freeze(s.concat(t));for(let e=0;e<t.items.length;++e){const r=Wm(e,t.items[e],n,s);if("number"==typeof r)e=r-1;else{if(r===Fm)return Fm;r===Bm&&(t.items.splice(e,1),e-=1)}}}else if(Im(t)){s=Object.freeze(s.concat(t));const e=Wm("key",t.key,n,s);if(e===Fm)return Fm;e===Bm&&(t.key=null);const r=Wm("value",t.value,n,s);if(r===Fm)return Fm;r===Bm&&(t.value=null)}return r}function Hm(e,t){return d(this,null,(function*(){const n=Km(t);if(Om(e)){(yield Vm(null,e.contents,n,Object.freeze([e])))===Bm&&(e.contents=null)}else yield Vm(null,e,n,Object.freeze([]))}))}function Vm(e,t,n,s){return d(this,null,(function*(){const r=yield zm(e,t,n,s);if(Dm(r)||Im(r))return Gm(e,s,r),Vm(e,r,n,s);if("symbol"!=typeof r)if(Mm(t)){s=Object.freeze(s.concat(t));for(let e=0;e<t.items.length;++e){const r=yield Vm(e,t.items[e],n,s);if("number"==typeof r)e=r-1;else{if(r===Fm)return Fm;r===Bm&&(t.items.splice(e,1),e-=1)}}}else if(Im(t)){s=Object.freeze(s.concat(t));const e=yield Vm("key",t.key,n,s);if(e===Fm)return Fm;e===Bm&&(t.key=null);const r=yield Vm("value",t.value,n,s);if(r===Fm)return Fm;r===Bm&&(t.value=null)}return r}))}function Km(e){return"object"==typeof e&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function zm(e,t,n,s){var r,i,o,a,l;return"function"==typeof n?n(e,t,s):Nm(t)?null==(r=n.Map)?void 0:r.call(n,e,t,s):Rm(t)?null==(i=n.Seq)?void 0:i.call(n,e,t,s):Im(t)?null==(o=n.Pair)?void 0:o.call(n,e,t,s):Pm(t)?null==(a=n.Scalar)?void 0:a.call(n,e,t,s):Lm(t)?null==(l=n.Alias)?void 0:l.call(n,e,t,s):void 0}function Gm(e,t,n){const s=t[t.length-1];if(Mm(s))s.items[e]=n;else if(Im(s))"key"===e?s.key=n:s.value=n;else{if(!Om(s)){const e=Lm(s)?"alias":"scalar";throw new Error(`Cannot replace node with ${e} parent`)}s.contents=n}}qm.BREAK=Fm,qm.SKIP=jm,qm.REMOVE=Bm,Hm.BREAK=Fm,Hm.SKIP=jm,Hm.REMOVE=Bm;const Ym={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"};class Qm{constructor(e,t){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},Qm.defaultYaml,e),this.tags=Object.assign({},Qm.defaultTags,t)}clone(){const e=new Qm(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){const e=new Qm(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:Qm.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},Qm.defaultTags)}return e}add(e,t){this.atNextDocument&&(this.yaml={explicit:Qm.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},Qm.defaultTags),this.atNextDocument=!1);const n=e.trim().split(/[ \t]+/),s=n.shift();switch(s){case"%TAG":{if(2!==n.length&&(t(0,"%TAG directive should contain exactly two parts"),n.length<2))return!1;const[e,s]=n;return this.tags[e]=s,!0}case"%YAML":{if(this.yaml.explicit=!0,1!==n.length)return t(0,"%YAML directive should contain exactly one part"),!1;const[e]=n;if("1.1"===e||"1.2"===e)return this.yaml.version=e,!0;return t(6,`Unsupported YAML version ${e}`,/^\d+\.\d+$/.test(e)),!1}default:return t(0,`Unknown directive ${s}`,!0),!1}}tagName(e,t){if("!"===e)return"!";if("!"!==e[0])return t(`Not a valid tag: ${e}`),null;if("<"===e[1]){const n=e.slice(2,-1);return"!"===n||"!!"===n?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(">"!==e[e.length-1]&&t("Verbatim tags must end with a >"),n)}const[,n,s]=e.match(new RegExp("^(.*!)([^!]*)$","s"));s||t(`The ${e} tag has no suffix`);const r=this.tags[n];if(r)try{return r+decodeURIComponent(s)}catch(i){return t(String(i)),null}return"!"===n?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(const[t,n]of Object.entries(this.tags))if(e.startsWith(n))return t+e.substring(n.length).replace(/[!,[\]{}]/g,(e=>Ym[e]));return"!"===e[0]?e:`!<${e}>`}toString(e){const t=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],n=Object.entries(this.tags);let s;if(e&&n.length>0&&Dm(e.contents)){const t={};qm(e.contents,((e,n)=>{Dm(n)&&n.tag&&(t[n.tag]=!0)})),s=Object.keys(t)}else s=[];for(const[r,i]of n)"!!"===r&&"tag:yaml.org,2002:"===i||e&&!s.some((e=>e.startsWith(i)))||t.push(`%TAG ${r} ${i}`);return t.join("\n")}}function Xm(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){const t=JSON.stringify(e);throw new Error(`Anchor must not contain whitespace or control characters: ${t}`)}return!0}function Jm(e){const t=new Set;return qm(e,{Value(e,n){n.anchor&&t.add(n.anchor)}}),t}function Zm(e,t){for(let n=1;;++n){const s=`${e}${n}`;if(!t.has(s))return s}}function eg(e,t,n,s){if(s&&"object"==typeof s)if(Array.isArray(s))for(let r=0,i=s.length;r<i;++r){const t=s[r],n=eg(e,s,String(r),t);void 0===n?delete s[r]:n!==t&&(s[r]=n)}else if(s instanceof Map)for(const r of Array.from(s.keys())){const t=s.get(r),n=eg(e,s,r,t);void 0===n?s.delete(r):n!==t&&s.set(r,n)}else if(s instanceof Set)for(const r of Array.from(s)){const t=eg(e,s,r,r);void 0===t?s.delete(r):t!==r&&(s.delete(r),s.add(t))}else for(const[r,i]of Object.entries(s)){const t=eg(e,s,r,i);void 0===t?delete s[r]:t!==i&&(s[r]=t)}return e.call(t,n,s)}function tg(e,t,n){if(Array.isArray(e))return e.map(((e,t)=>tg(e,String(t),n)));if(e&&"function"==typeof e.toJSON){if(!n||!Um(e))return e.toJSON(t,n);const s={aliasCount:0,count:1,res:void 0};n.anchors.set(e,s),n.onCreate=e=>{s.res=e,delete n.onCreate};const r=e.toJSON(t,n);return n.onCreate&&n.onCreate(r),r}return"bigint"!=typeof e||(null==n?void 0:n.keep)?e:Number(e)}Qm.defaultYaml={explicit:!1,version:"1.2"},Qm.defaultTags={"!!":"tag:yaml.org,2002:"};class ng{constructor(e){Object.defineProperty(this,Tm,{value:e})}clone(){const e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:n,onAnchor:s,reviver:r}={}){if(!Om(e))throw new TypeError("A document argument is required");const i={anchors:new Map,doc:e,keep:!0,mapAsMap:!0===t,mapKeyWarned:!1,maxAliasCount:"number"==typeof n?n:100},o=tg(this,"",i);if("function"==typeof s)for(const{count:a,res:l}of i.anchors.values())s(l,a);return"function"==typeof r?eg(r,{"":o},"",o):o}}class sg extends ng{constructor(e){super(Em),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e){let t;return qm(e,{Node:(e,n)=>{if(n===this)return qm.BREAK;n.anchor===this.source&&(t=n)}}),t}toJSON(e,t){if(!t)return{source:this.source};const{anchors:n,doc:s,maxAliasCount:r}=t,i=this.resolve(s);if(!i){const e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(e)}let o=n.get(i);if(o||(tg(i,null,t),o=n.get(i)),!o||void 0===o.res){throw new ReferenceError("This should not happen: Alias anchor was not resolved?")}if(r>=0&&(o.count+=1,0===o.aliasCount&&(o.aliasCount=rg(s,i,n)),o.count*o.aliasCount>r)){throw new ReferenceError("Excessive alias count indicates a resource exhaustion attack")}return o.res}toString(e,t,n){const s=`*${this.source}`;if(e){if(Xm(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){const e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(e)}if(e.implicitKey)return`${s} `}return s}}function rg(e,t,n){if(Lm(t)){const s=t.resolve(e),r=n&&s&&n.get(s);return r?r.count*r.aliasCount:0}if(Mm(t)){let s=0;for(const r of t.items){const t=rg(e,r,n);t>s&&(s=t)}return s}if(Im(t)){const s=rg(e,t.key,n),r=rg(e,t.value,n);return Math.max(s,r)}return 1}const ig=e=>!e||"function"!=typeof e&&"object"!=typeof e;class og extends ng{constructor(e){super(Am),this.value=e}toJSON(e,t){return(null==t?void 0:t.keep)?this.value:tg(this.value,e,t)}toString(){return String(this.value)}}og.BLOCK_FOLDED="BLOCK_FOLDED",og.BLOCK_LITERAL="BLOCK_LITERAL",og.PLAIN="PLAIN",og.QUOTE_DOUBLE="QUOTE_DOUBLE",og.QUOTE_SINGLE="QUOTE_SINGLE";const ag="tag:yaml.org,2002:";function lg(e,t,n){var s,r,i;if(Om(e)&&(e=e.contents),Dm(e))return e;if(Im(e)){const t=null==(r=(s=n.schema[Sm]).createNode)?void 0:r.call(s,n.schema,null,n);return t.items.push(e),t}(e instanceof String||e instanceof Number||e instanceof Boolean||"undefined"!=typeof BigInt&&e instanceof BigInt)&&(e=e.valueOf());const{aliasDuplicateObjects:o,onAnchor:a,onTagObj:l,schema:c,sourceObjects:u}=n;let d;if(o&&e&&"object"==typeof e){if(d=u.get(e),d)return d.anchor||(d.anchor=a(e)),new sg(d.anchor);d={anchor:null,node:null},u.set(e,d)}(null==t?void 0:t.startsWith("!!"))&&(t=ag+t.slice(2));let p=function(e,t,n){var s;if(t){const e=n.filter((e=>e.tag===t)),r=null!=(s=e.find((e=>!e.format)))?s:e[0];if(!r)throw new Error(`Tag ${t} not found`);return r}return n.find((t=>{var n;return(null==(n=t.identify)?void 0:n.call(t,e))&&!t.format}))}(e,t,c.tags);if(!p){if(e&&"function"==typeof e.toJSON&&(e=e.toJSON()),!e||"object"!=typeof e){const t=new og(e);return d&&(d.node=t),t}p=e instanceof Map?c[Sm]:Symbol.iterator in Object(e)?c[$m]:c[Sm]}l&&(l(p),delete n.onTagObj);const h=(null==p?void 0:p.createNode)?p.createNode(n.schema,e,n):"function"==typeof(null==(i=null==p?void 0:p.nodeClass)?void 0:i.from)?p.nodeClass.from(n.schema,e,n):new og(e);return t?h.tag=t:p.default||(h.tag=p.tag),d&&(d.node=h),h}function cg(e,t,n){let s=n;for(let r=t.length-1;r>=0;--r){const e=t[r];if("number"==typeof e&&Number.isInteger(e)&&e>=0){const t=[];t[e]=s,s=t}else s=new Map([[e,s]])}return lg(s,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}const ug=e=>null==e||"object"==typeof e&&!!e[Symbol.iterator]().next().done;class dg extends ng{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){const t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map((t=>Dm(t)||Im(t)?t.clone(e):t)),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(ug(e))this.add(t);else{const[n,...s]=e,r=this.get(n,!0);if(Mm(r))r.addIn(s,t);else{if(void 0!==r||!this.schema)throw new Error(`Expected YAML collection at ${n}. Remaining path: ${s}`);this.set(n,cg(this.schema,s,t))}}}deleteIn(e){const[t,...n]=e;if(0===n.length)return this.delete(t);const s=this.get(t,!0);if(Mm(s))return s.deleteIn(n);throw new Error(`Expected YAML collection at ${t}. Remaining path: ${n}`)}getIn(e,t){const[n,...s]=e,r=this.get(n,!0);return 0===s.length?!t&&Pm(r)?r.value:r:Mm(r)?r.getIn(s,t):void 0}hasAllNullValues(e){return this.items.every((t=>{if(!Im(t))return!1;const n=t.value;return null==n||e&&Pm(n)&&null==n.value&&!n.commentBefore&&!n.comment&&!n.tag}))}hasIn(e){const[t,...n]=e;if(0===n.length)return this.has(t);const s=this.get(t,!0);return!!Mm(s)&&s.hasIn(n)}setIn(e,t){const[n,...s]=e;if(0===s.length)this.set(n,t);else{const e=this.get(n,!0);if(Mm(e))e.setIn(s,t);else{if(void 0!==e||!this.schema)throw new Error(`Expected YAML collection at ${n}. Remaining path: ${s}`);this.set(n,cg(this.schema,s,t))}}}}dg.maxFlowStringSingleLineLength=60;const pg=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function hg(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const fg=(e,t,n)=>e.endsWith("\n")?hg(n,t):n.includes("\n")?"\n"+hg(n,t):(e.endsWith(" ")?"":" ")+n,mg="flow",gg="block",vg="quoted";function yg(e,t,n="flow",{indentAtStart:s,lineWidth:r=80,minContentWidth:i=20,onFold:o,onOverflow:a}={}){if(!r||r<0)return e;const l=Math.max(1+i,1+r-t.length);if(e.length<=l)return e;const c=[],u={};let d,p,h=r-t.length;"number"==typeof s&&(s>r-Math.max(2,i)?c.push(0):h=r-s);let f=!1,m=-1,g=-1,v=-1;n===gg&&(m=kg(e,m,t.length),-1!==m&&(h=m+l));for(let k;k=e[m+=1];){if(n===vg&&"\\"===k){switch(g=m,e[m+1]){case"x":m+=3;break;case"u":m+=5;break;case"U":m+=9;break;default:m+=1}v=m}if("\n"===k)n===gg&&(m=kg(e,m,t.length)),h=m+t.length+l,d=void 0;else{if(" "===k&&p&&" "!==p&&"\n"!==p&&"\t"!==p){const t=e[m+1];t&&" "!==t&&"\n"!==t&&"\t"!==t&&(d=m)}if(m>=h)if(d)c.push(d),h=d+l,d=void 0;else if(n===vg){for(;" "===p||"\t"===p;)p=k,k=e[m+=1],f=!0;const t=m>v+1?m-2:g-1;if(u[t])return e;c.push(t),u[t]=!0,h=t+l,d=void 0}else f=!0}p=k}if(f&&a&&a(),0===c.length)return e;o&&o();let y=e.slice(0,c[0]);for(let k=0;k<c.length;++k){const s=c[k],r=c[k+1]||e.length;0===s?y=`\n${t}${e.slice(0,r)}`:(n===vg&&u[s]&&(y+=`${e[s]}\\`),y+=`\n${t}${e.slice(s+1,r)}`)}return y}function kg(e,t,n){let s=t,r=t+1,i=e[r];for(;" "===i||"\t"===i;)if(t<r+n)i=e[++t];else{do{i=e[++t]}while(i&&"\n"!==i);s=t,r=t+1,i=e[r]}return s}const bg=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),wg=e=>/^(%|---|\.\.\.)/m.test(e);function _g(e,t){const n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;const{implicitKey:s}=t,r=t.options.doubleQuotedMinMultiLineLength,i=t.indent||(wg(e)?" ":"");let o="",a=0;for(let l=0,c=n[l];c;c=n[++l])if(" "===c&&"\\"===n[l+1]&&"n"===n[l+2]&&(o+=n.slice(a,l)+"\\ ",l+=1,a=l,c="\\"),"\\"===c)switch(n[l+1]){case"u":{o+=n.slice(a,l);const e=n.substr(l+2,4);switch(e){case"0000":o+="\\0";break;case"0007":o+="\\a";break;case"000b":o+="\\v";break;case"001b":o+="\\e";break;case"0085":o+="\\N";break;case"00a0":o+="\\_";break;case"2028":o+="\\L";break;case"2029":o+="\\P";break;default:"00"===e.substr(0,2)?o+="\\x"+e.substr(2):o+=n.substr(l,6)}l+=5,a=l+1}break;case"n":if(s||'"'===n[l+2]||n.length<r)l+=1;else{for(o+=n.slice(a,l)+"\n\n";"\\"===n[l+2]&&"n"===n[l+3]&&'"'!==n[l+4];)o+="\n",l+=2;o+=i," "===n[l+2]&&(o+="\\"),l+=1,a=l+1}break;default:l+=1}return o=a?o+n.slice(a):n,s?o:yg(o,i,vg,bg(t,!1))}function Eg(e,t){if(!1===t.options.singleQuote||t.implicitKey&&e.includes("\n")||/[ \t]\n|\n[ \t]/.test(e))return _g(e,t);const n=t.indent||(wg(e)?" ":""),s="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&\n${n}`)+"'";return t.implicitKey?s:yg(s,n,mg,bg(t,!1))}function xg(e,t){const{singleQuote:n}=t.options;let s;if(!1===n)s=_g;else{const t=e.includes('"'),r=e.includes("'");s=t&&!r?Eg:r&&!t?_g:n?Eg:_g}return s(e,t)}let Sg;try{Sg=new RegExp("(^|(?<!\n))\n+(?!\n|$)","g")}catch(hE){Sg=/\n+(?!\n|$)/g}function Cg({comment:e,type:t,value:n},s,r,i){const{blockQuote:o,commentString:a,lineWidth:l}=s.options;if(!o||/\n[\t ]+$/.test(n)||/^\s*$/.test(n))return xg(n,s);const c=s.indent||(s.forceBlockIndent||wg(n)?" ":""),u="literal"===o||"folded"!==o&&t!==og.BLOCK_FOLDED&&(t===og.BLOCK_LITERAL||!function(e,t,n){if(!t||t<0)return!1;const s=t-n,r=e.length;if(r<=s)return!1;for(let i=0,o=0;i<r;++i)if("\n"===e[i]){if(i-o>s)return!0;if(o=i+1,r-o<=s)return!1}return!0}(n,l,c.length));if(!n)return u?"|\n":">\n";let d,p;for(p=n.length;p>0;--p){const e=n[p-1];if("\n"!==e&&"\t"!==e&&" "!==e)break}let h=n.substring(p);const f=h.indexOf("\n");-1===f?d="-":n===h||f!==h.length-1?(d="+",i&&i()):d="",h&&(n=n.slice(0,-h.length),"\n"===h[h.length-1]&&(h=h.slice(0,-1)),h=h.replace(Sg,`$&${c}`));let m,g=!1,v=-1;for(m=0;m<n.length;++m){const e=n[m];if(" "===e)g=!0;else{if("\n"!==e)break;v=m}}let y=n.substring(0,v<m?v+1:m);y&&(n=n.substring(y.length),y=y.replace(/\n+/g,`$&${c}`));let k=(u?"|":">")+(g?c?"2":"1":"")+d;if(e&&(k+=" "+a(e.replace(/ ?[\r\n]+/g," ")),r&&r()),u)return`${k}\n${c}${y}${n=n.replace(/\n+/g,`$&${c}`)}${h}`;return`${k}\n${c}${yg(`${y}${n=n.replace(/\n+/g,"\n$&").replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${c}`)}${h}`,c,gg,bg(s,!0))}`}function Ag(e,t,n,s){const{implicitKey:r,inFlow:i}=t,o="string"==typeof e.value?e:Object.assign({},e,{value:String(e.value)});let{type:a}=e;a!==og.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(a=og.QUOTE_DOUBLE);const l=e=>{switch(e){case og.BLOCK_FOLDED:case og.BLOCK_LITERAL:return r||i?xg(o.value,t):Cg(o,t,n,s);case og.QUOTE_DOUBLE:return _g(o.value,t);case og.QUOTE_SINGLE:return Eg(o.value,t);case og.PLAIN:return function(e,t,n,s){const{type:r,value:i}=e,{actualString:o,implicitKey:a,indent:l,indentStep:c,inFlow:u}=t;if(a&&i.includes("\n")||u&&/[[\]{},]/.test(i))return xg(i,t);if(!i||/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(i))return a||u||!i.includes("\n")?xg(i,t):Cg(e,t,n,s);if(!a&&!u&&r!==og.PLAIN&&i.includes("\n"))return Cg(e,t,n,s);if(wg(i)){if(""===l)return t.forceBlockIndent=!0,Cg(e,t,n,s);if(a&&l===c)return xg(i,t)}const d=i.replace(/\n+/g,`$&\n${l}`);if(o){const e=e=>{var t;return e.default&&"tag:yaml.org,2002:str"!==e.tag&&(null==(t=e.test)?void 0:t.test(d))},{compat:n,tags:s}=t.doc.schema;if(s.some(e)||(null==n?void 0:n.some(e)))return xg(i,t)}return a?d:yg(d,l,mg,bg(t,!1))}(o,t,n,s);default:return null}};let c=l(a);if(null===c){const{defaultKeyType:e,defaultStringType:n}=t.options,s=r&&e||n;if(c=l(s),null===c)throw new Error(`Unsupported default string type ${s}`)}return c}function $g(e,t){const n=Object.assign({blockQuote:!0,commentString:pg,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trueStr:"true",verifyAliasOrder:!0},e.schema.toStringOptions,t);let s;switch(n.collectionStyle){case"block":s=!1;break;case"flow":s=!0;break;default:s=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:"number"==typeof n.indent?" ".repeat(n.indent):" ",inFlow:s,options:n}}function Tg(e,t,n,s){var r,i;if(Im(e))return e.toString(t,n,s);if(Lm(e)){if(t.doc.directives)return e.toString(t);if(null==(r=t.resolvedAliases)?void 0:r.has(e))throw new TypeError("Cannot stringify circular structure without alias nodes");t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let o;const a=Dm(e)?e:t.doc.createNode(e,{onTagObj:e=>o=e});o||(o=function(e,t){var n,s,r,i;if(t.tag){const s=e.filter((e=>e.tag===t.tag));if(s.length>0)return null!=(n=s.find((e=>e.format===t.format)))?n:s[0]}let o,a;if(Pm(t)){a=t.value;const n=e.filter((e=>{var t;return null==(t=e.identify)?void 0:t.call(e,a)}));o=null!=(s=n.find((e=>e.format===t.format)))?s:n.find((e=>!e.format))}else a=t,o=e.find((e=>e.nodeClass&&a instanceof e.nodeClass));if(!o){const e=null!=(i=null==(r=null==a?void 0:a.constructor)?void 0:r.name)?i:typeof a;throw new Error(`Tag not resolved for ${e} value`)}return o}(t.doc.schema.tags,a));const l=function(e,t,{anchors:n,doc:s}){if(!s.directives)return"";const r=[],i=(Pm(e)||Mm(e))&&e.anchor;i&&Xm(i)&&(n.add(i),r.push(`&${i}`));const o=e.tag?e.tag:t.default?null:t.tag;return o&&r.push(s.directives.tagString(o)),r.join(" ")}(a,o,t);l.length>0&&(t.indentAtStart=(null!=(i=t.indentAtStart)?i:0)+l.length+1);const c="function"==typeof o.stringify?o.stringify(a,t,n,s):Pm(a)?Ag(a,t,n,s):a.toString(t,n,s);return l?Pm(a)||"{"===c[0]||"["===c[0]?`${l} ${c}`:`${l}\n${t.indent}${c}`:c}function Lg(e,t){"debug"!==e&&"warn"!==e||("undefined"!=typeof process&&process.emitWarning?process.emitWarning(t):console.warn(t))}function Og(e,t,{key:n,value:s}){if((null==e?void 0:e.doc.schema.merge)&&Ng(n))if(s=Lm(s)?s.resolve(e.doc):s,Rm(s))for(const r of s.items)Ig(e,t,r);else if(Array.isArray(s))for(const r of s)Ig(e,t,r);else Ig(e,t,s);else{const r=tg(n,"",e);if(t instanceof Map)t.set(r,tg(s,r,e));else if(t instanceof Set)t.add(r);else{const i=function(e,t,n){if(null===t)return"";if("object"!=typeof t)return String(t);if(Dm(e)&&(null==n?void 0:n.doc)){const t=$g(n.doc,{});t.anchors=new Set;for(const e of n.anchors.keys())t.anchors.add(e.anchor);t.inFlow=!0,t.inStringifyKey=!0;const s=e.toString(t);if(!n.mapKeyWarned){let e=JSON.stringify(s);e.length>40&&(e=e.substring(0,36)+'..."'),Lg(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${e}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return s}return JSON.stringify(t)}(n,r,e),o=tg(s,i,e);i in t?Object.defineProperty(t,i,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[i]=o}}return t}const Ng=e=>"<<"===e||Pm(e)&&"<<"===e.value&&(!e.type||e.type===og.PLAIN);function Ig(e,t,n){const s=e&&Lm(n)?n.resolve(e.doc):n;if(!Nm(s))throw new Error("Merge sources must be maps or map aliases");const r=s.toJSON(null,e,Map);for(const[i,o]of r)t instanceof Map?t.has(i)||t.set(i,o):t instanceof Set?t.add(i):Object.prototype.hasOwnProperty.call(t,i)||Object.defineProperty(t,i,{value:o,writable:!0,enumerable:!0,configurable:!0});return t}function Pg(e,t,n){const s=lg(e,void 0,n),r=lg(t,void 0,n);return new Rg(s,r)}class Rg{constructor(e,t=null){Object.defineProperty(this,Tm,{value:Cm}),this.key=e,this.value=t}clone(e){let{key:t,value:n}=this;return Dm(t)&&(t=t.clone(e)),Dm(n)&&(n=n.clone(e)),new Rg(t,n)}toJSON(e,t){return Og(t,(null==t?void 0:t.mapAsMap)?new Map:{},this)}toString(e,t,n){return(null==e?void 0:e.doc)?function({key:e,value:t},n,s,r){var i,o;const{allNullValues:a,doc:l,indent:c,indentStep:u,options:{commentString:d,indentSeq:p,simpleKeys:h}}=n;let f=Dm(e)&&e.comment||null;if(h){if(f)throw new Error("With simple keys, key nodes cannot have comments");if(Mm(e))throw new Error("With simple keys, collection cannot be used as a key value")}let m=!h&&(!e||f&&null==t&&!n.inFlow||Mm(e)||(Pm(e)?e.type===og.BLOCK_FOLDED||e.type===og.BLOCK_LITERAL:"object"==typeof e));n=Object.assign({},n,{allNullValues:!1,implicitKey:!m&&(h||!a),indent:c+u});let g,v,y,k=!1,b=!1,w=Tg(e,n,(()=>k=!0),(()=>b=!0));if(!m&&!n.inFlow&&w.length>1024){if(h)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");m=!0}if(n.inFlow){if(a||null==t)return k&&s&&s(),""===w?"?":m?`? ${w}`:w}else if(a&&!h||null==t&&m)return w=`? ${w}`,f&&!k?w+=fg(w,n.indent,d(f)):b&&r&&r(),w;k&&(f=null),m?(f&&(w+=fg(w,n.indent,d(f))),w=`? ${w}\n${c}:`):(w=`${w}:`,f&&(w+=fg(w,n.indent,d(f)))),Dm(t)?(g=!!t.spaceBefore,v=t.commentBefore,y=t.comment):(g=!1,v=null,y=null,t&&"object"==typeof t&&(t=l.createNode(t))),n.implicitKey=!1,m||f||!Pm(t)||(n.indentAtStart=w.length+1),b=!1,p||!(u.length>=2)||n.inFlow||m||!Rm(t)||t.flow||t.tag||t.anchor||(n.indent=n.indent.substring(2));let _=!1;const E=Tg(t,n,(()=>_=!0),(()=>b=!0));let x=" ";if(f||g||v)x=g?"\n":"",v&&(x+=`\n${hg(d(v),n.indent)}`),""!==E||n.inFlow?x+=`\n${n.indent}`:"\n"===x&&(x="\n\n");else if(!m&&Mm(t)){const e=E[0],s=E.indexOf("\n"),r=-1!==s,a=null!=(o=null!=(i=n.inFlow)?i:t.flow)?o:0===t.items.length;if(r||!a){let t=!1;if(r&&("&"===e||"!"===e)){let n=E.indexOf(" ");"&"===e&&-1!==n&&n<s&&"!"===E[n+1]&&(n=E.indexOf(" ",n+1)),(-1===n||s<n)&&(t=!0)}t||(x=`\n${n.indent}`)}}else""!==E&&"\n"!==E[0]||(x="");return w+=x+E,n.inFlow?_&&s&&s():y&&!_?w+=fg(w,n.indent,d(y)):b&&r&&r(),w}(this,e,t,n):JSON.stringify(this)}}function Mg(e,t,n){var s;return((null!=(s=t.inFlow)?s:e.flow)?Ug:Dg)(e,t,n)}function Dg({comment:e,items:t},n,{blockItemPrefix:s,flowChars:r,itemIndent:i,onChompKeep:o,onComment:a}){const{indent:l,options:{commentString:c}}=n,u=Object.assign({},n,{indent:i,type:null});let d=!1;const p=[];for(let f=0;f<t.length;++f){const e=t[f];let r=null;if(Dm(e))!d&&e.spaceBefore&&p.push(""),Fg(n,p,e.commentBefore,d),e.comment&&(r=e.comment);else if(Im(e)){const t=Dm(e.key)?e.key:null;t&&(!d&&t.spaceBefore&&p.push(""),Fg(n,p,t.commentBefore,d))}d=!1;let o=Tg(e,u,(()=>r=null),(()=>d=!0));r&&(o+=fg(o,i,c(r))),d&&r&&(d=!1),p.push(s+o)}let h;if(0===p.length)h=r.start+r.end;else{h=p[0];for(let e=1;e<p.length;++e){const t=p[e];h+=t?`\n${l}${t}`:"\n"}}return e?(h+="\n"+hg(c(e),l),a&&a()):d&&o&&o(),h}function Ug({items:e},t,{flowChars:n,itemIndent:s}){const{indent:r,indentStep:i,flowCollectionPadding:o,options:{commentString:a}}=t;s+=i;const l=Object.assign({},t,{indent:s,inFlow:!0,type:null});let c=!1,u=0;const d=[];for(let f=0;f<e.length;++f){const n=e[f];let r=null;if(Dm(n))n.spaceBefore&&d.push(""),Fg(t,d,n.commentBefore,!1),n.comment&&(r=n.comment);else if(Im(n)){const e=Dm(n.key)?n.key:null;e&&(e.spaceBefore&&d.push(""),Fg(t,d,e.commentBefore,!1),e.comment&&(c=!0));const s=Dm(n.value)?n.value:null;s?(s.comment&&(r=s.comment),s.commentBefore&&(c=!0)):null==n.value&&(null==e?void 0:e.comment)&&(r=e.comment)}r&&(c=!0);let i=Tg(n,l,(()=>r=null));f<e.length-1&&(i+=","),r&&(i+=fg(i,s,a(r))),!c&&(d.length>u||i.includes("\n"))&&(c=!0),d.push(i),u=d.length}const{start:p,end:h}=n;if(0===d.length)return p+h;if(!c){const e=d.reduce(((e,t)=>e+t.length+2),2);c=t.options.lineWidth>0&&e>t.options.lineWidth}if(c){let e=p;for(const t of d)e+=t?`\n${i}${r}${t}`:"\n";return`${e}\n${r}${h}`}return`${p}${o}${d.join(" ")}${o}${h}`}function Fg({indent:e,options:{commentString:t}},n,s,r){if(s&&r&&(s=s.replace(/^\n+/,"")),s){const r=hg(t(s),e);n.push(r.trimStart())}}function jg(e,t){const n=Pm(t)?t.value:t;for(const s of e)if(Im(s)){if(s.key===t||s.key===n)return s;if(Pm(s.key)&&s.key.value===n)return s}}class Bg extends dg{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(Sm,e),this.items=[]}static from(e,t,n){const{keepUndefined:s,replacer:r}=n,i=new this(e),o=(e,o)=>{if("function"==typeof r)o=r.call(t,e,o);else if(Array.isArray(r)&&!r.includes(e))return;(void 0!==o||s)&&i.items.push(Pg(e,o,n))};if(t instanceof Map)for(const[a,l]of t)o(a,l);else if(t&&"object"==typeof t)for(const a of Object.keys(t))o(a,t[a]);return"function"==typeof e.sortMapEntries&&i.items.sort(e.sortMapEntries),i}add(e,t){var n;let s;s=Im(e)?e:e&&"object"==typeof e&&"key"in e?new Rg(e.key,e.value):new Rg(e,null==e?void 0:e.value);const r=jg(this.items,s.key),i=null==(n=this.schema)?void 0:n.sortMapEntries;if(r){if(!t)throw new Error(`Key ${s.key} already set`);Pm(r.value)&&ig(s.value)?r.value.value=s.value:r.value=s.value}else if(i){const e=this.items.findIndex((e=>i(s,e)<0));-1===e?this.items.push(s):this.items.splice(e,0,s)}else this.items.push(s)}delete(e){const t=jg(this.items,e);if(!t)return!1;return this.items.splice(this.items.indexOf(t),1).length>0}get(e,t){var n;const s=jg(this.items,e),r=null==s?void 0:s.value;return null!=(n=!t&&Pm(r)?r.value:r)?n:void 0}has(e){return!!jg(this.items,e)}set(e,t){this.add(new Rg(e,t),!0)}toJSON(e,t,n){const s=n?new n:(null==t?void 0:t.mapAsMap)?new Map:{};(null==t?void 0:t.onCreate)&&t.onCreate(s);for(const r of this.items)Og(t,s,r);return s}toString(e,t,n){if(!e)return JSON.stringify(this);for(const s of this.items)if(!Im(s))throw new Error(`Map items must all be pairs; found ${JSON.stringify(s)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),Mg(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:n,onComment:t})}}const qg={collection:"map",default:!0,nodeClass:Bg,tag:"tag:yaml.org,2002:map",resolve:(e,t)=>(Nm(e)||t("Expected a mapping for this tag"),e),createNode:(e,t,n)=>Bg.from(e,t,n)};class Wg extends dg{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super($m,e),this.items=[]}add(e){this.items.push(e)}delete(e){const t=Hg(e);if("number"!=typeof t)return!1;return this.items.splice(t,1).length>0}get(e,t){const n=Hg(e);if("number"!=typeof n)return;const s=this.items[n];return!t&&Pm(s)?s.value:s}has(e){const t=Hg(e);return"number"==typeof t&&t<this.items.length}set(e,t){const n=Hg(e);if("number"!=typeof n)throw new Error(`Expected a valid index, not ${e}.`);const s=this.items[n];Pm(s)&&ig(t)?s.value=t:this.items[n]=t}toJSON(e,t){const n=[];(null==t?void 0:t.onCreate)&&t.onCreate(n);let s=0;for(const r of this.items)n.push(tg(r,String(s++),t));return n}toString(e,t,n){return e?Mg(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:n,onComment:t}):JSON.stringify(this)}static from(e,t,n){const{replacer:s}=n,r=new this(e);if(t&&Symbol.iterator in Object(t)){let e=0;for(let i of t){if("function"==typeof s){const n=t instanceof Set?i:String(e++);i=s.call(t,n,i)}r.items.push(lg(i,void 0,n))}}return r}}function Hg(e){let t=Pm(e)?e.value:e;return t&&"string"==typeof t&&(t=Number(t)),"number"==typeof t&&Number.isInteger(t)&&t>=0?t:null}const Vg={collection:"seq",default:!0,nodeClass:Wg,tag:"tag:yaml.org,2002:seq",resolve:(e,t)=>(Rm(e)||t("Expected a sequence for this tag"),e),createNode:(e,t,n)=>Wg.from(e,t,n)},Kg={identify:e=>"string"==typeof e,default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:(e,t,n,s)=>Ag(e,t=Object.assign({actualString:!0},t),n,s)},zg={identify:e=>null==e,createNode:()=>new og(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new og(null),stringify:({source:e},t)=>"string"==typeof e&&zg.test.test(e)?e:t.options.nullStr},Gg={identify:e=>"boolean"==typeof e,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new og("t"===e[0]||"T"===e[0]),stringify({source:e,value:t},n){if(e&&Gg.test.test(e)){if(t===("t"===e[0]||"T"===e[0]))return e}return t?n.options.trueStr:n.options.falseStr}};function Yg({format:e,minFractionDigits:t,tag:n,value:s}){if("bigint"==typeof s)return String(s);const r="number"==typeof s?s:Number(s);if(!isFinite(r))return isNaN(r)?".nan":r<0?"-.inf":".inf";let i=JSON.stringify(s);if(!e&&t&&(!n||"tag:yaml.org,2002:float"===n)&&/^\d/.test(i)){let e=i.indexOf(".");e<0&&(e=i.length,i+=".");let n=t-(i.length-e-1);for(;n-- >0;)i+="0"}return i}const Qg={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF|nan|NaN|NAN))$/,resolve:e=>"nan"===e.slice(-3).toLowerCase()?NaN:"-"===e[0]?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Yg},Xg={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():Yg(e)}},Jg={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){const t=new og(parseFloat(e)),n=e.indexOf(".");return-1!==n&&"0"===e[e.length-1]&&(t.minFractionDigits=e.length-n-1),t},stringify:Yg},Zg=e=>"bigint"==typeof e||Number.isInteger(e),ev=(e,t,n,{intAsBigInt:s})=>s?BigInt(e):parseInt(e.substring(t),n);function tv(e,t,n){const{value:s}=e;return Zg(s)&&s>=0?n+s.toString(t):Yg(e)}const nv={identify:e=>Zg(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>ev(e,2,8,n),stringify:e=>tv(e,8,"0o")},sv={identify:Zg,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>ev(e,0,10,n),stringify:Yg},rv={identify:e=>Zg(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>ev(e,2,16,n),stringify:e=>tv(e,16,"0x")},iv=[qg,Vg,Kg,zg,Gg,nv,sv,rv,Qg,Xg,Jg];function ov(e){return"bigint"==typeof e||Number.isInteger(e)}const av=({value:e})=>JSON.stringify(e),lv=[qg,Vg].concat([{identify:e=>"string"==typeof e,default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:av},{identify:e=>null==e,createNode:()=>new og(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:av},{identify:e=>"boolean"==typeof e,default:!0,tag:"tag:yaml.org,2002:bool",test:/^true|false$/,resolve:e=>"true"===e,stringify:av},{identify:ov,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>ov(e)?e.toString():JSON.stringify(e)},{identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:av}],{default:!0,tag:"",test:/^/,resolve:(e,t)=>(t(`Unresolved plain scalar ${JSON.stringify(e)}`),e)}),cv={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if("function"==typeof Buffer)return Buffer.from(e,"base64");if("function"==typeof atob){const t=atob(e.replace(/[\n\r]/g,"")),n=new Uint8Array(t.length);for(let e=0;e<t.length;++e)n[e]=t.charCodeAt(e);return n}return t("This environment does not support reading binary tags; either Buffer or atob is required"),e},stringify({comment:e,type:t,value:n},s,r,i){const o=n;let a;if("function"==typeof Buffer)a=o instanceof Buffer?o.toString("base64"):Buffer.from(o.buffer).toString("base64");else{if("function"!=typeof btoa)throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");{let e="";for(let t=0;t<o.length;++t)e+=String.fromCharCode(o[t]);a=btoa(e)}}if(t||(t=og.BLOCK_LITERAL),t!==og.QUOTE_DOUBLE){const e=Math.max(s.options.lineWidth-s.indent.length,s.options.minContentWidth),n=Math.ceil(a.length/e),r=new Array(n);for(let t=0,s=0;t<n;++t,s+=e)r[t]=a.substr(s,e);a=r.join(t===og.BLOCK_LITERAL?"\n":" ")}return Ag({comment:e,type:t,value:a},s,r,i)}};function uv(e,t){var n;if(Rm(e))for(let s=0;s<e.items.length;++s){let r=e.items[s];if(!Im(r)){if(Nm(r)){r.items.length>1&&t("Each pair must have its own sequence indicator");const e=r.items[0]||new Rg(new og(null));if(r.commentBefore&&(e.key.commentBefore=e.key.commentBefore?`${r.commentBefore}\n${e.key.commentBefore}`:r.commentBefore),r.comment){const t=null!=(n=e.value)?n:e.key;t.comment=t.comment?`${r.comment}\n${t.comment}`:r.comment}r=e}e.items[s]=Im(r)?r:new Rg(r)}}else t("Expected a sequence for this tag");return e}function dv(e,t,n){const{replacer:s}=n,r=new Wg(e);r.tag="tag:yaml.org,2002:pairs";let i=0;if(t&&Symbol.iterator in Object(t))for(let o of t){let e,a;if("function"==typeof s&&(o=s.call(t,String(i++),o)),Array.isArray(o)){if(2!==o.length)throw new TypeError(`Expected [key, value] tuple: ${o}`);e=o[0],a=o[1]}else if(o&&o instanceof Object){const t=Object.keys(o);if(1!==t.length)throw new TypeError(`Expected tuple with one key, not ${t.length} keys`);e=t[0],a=o[e]}else e=o;r.items.push(Pg(e,a,n))}return r}const pv={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:uv,createNode:dv};class hv extends Wg{constructor(){super(),this.add=Bg.prototype.add.bind(this),this.delete=Bg.prototype.delete.bind(this),this.get=Bg.prototype.get.bind(this),this.has=Bg.prototype.has.bind(this),this.set=Bg.prototype.set.bind(this),this.tag=hv.tag}toJSON(e,t){if(!t)return super.toJSON(e);const n=new Map;(null==t?void 0:t.onCreate)&&t.onCreate(n);for(const s of this.items){let e,r;if(Im(s)?(e=tg(s.key,"",t),r=tg(s.value,e,t)):e=tg(s,"",t),n.has(e))throw new Error("Ordered maps must not include duplicate keys");n.set(e,r)}return n}static from(e,t,n){const s=dv(e,t,n),r=new this;return r.items=s.items,r}}hv.tag="tag:yaml.org,2002:omap";const fv={collection:"seq",identify:e=>e instanceof Map,nodeClass:hv,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const n=uv(e,t),s=[];for(const{key:r}of n.items)Pm(r)&&(s.includes(r.value)?t(`Ordered maps must not include duplicate keys: ${r.value}`):s.push(r.value));return Object.assign(new hv,n)},createNode:(e,t,n)=>hv.from(e,t,n)};function mv({value:e,source:t},n){return t&&(e?gv:vv).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}const gv={identify:e=>!0===e,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new og(!0),stringify:mv},vv={identify:e=>!1===e,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new og(!1),stringify:mv},yv={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?\.(?:inf|Inf|INF|nan|NaN|NAN)$/,resolve:e=>"nan"===e.slice(-3).toLowerCase()?NaN:"-"===e[0]?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Yg},kv={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,"")),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():Yg(e)}},bv={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){const t=new og(parseFloat(e.replace(/_/g,""))),n=e.indexOf(".");if(-1!==n){const s=e.substring(n+1).replace(/_/g,"");"0"===s[s.length-1]&&(t.minFractionDigits=s.length)}return t},stringify:Yg},wv=e=>"bigint"==typeof e||Number.isInteger(e);function _v(e,t,n,{intAsBigInt:s}){const r=e[0];if("-"!==r&&"+"!==r||(t+=1),e=e.substring(t).replace(/_/g,""),s){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`}const t=BigInt(e);return"-"===r?BigInt(-1)*t:t}const i=parseInt(e,n);return"-"===r?-1*i:i}function Ev(e,t,n){const{value:s}=e;if(wv(s)){const e=s.toString(t);return s<0?"-"+n+e.substr(1):n+e}return Yg(e)}const xv={identify:wv,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>_v(e,2,2,n),stringify:e=>Ev(e,2,"0b")},Sv={identify:wv,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>_v(e,1,8,n),stringify:e=>Ev(e,8,"0")},Cv={identify:wv,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>_v(e,0,10,n),stringify:Yg},Av={identify:wv,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>_v(e,2,16,n),stringify:e=>Ev(e,16,"0x")};class $v extends Bg{constructor(e){super(e),this.tag=$v.tag}add(e){let t;t=Im(e)?e:e&&"object"==typeof e&&"key"in e&&"value"in e&&null===e.value?new Rg(e.key,null):new Rg(e,null);jg(this.items,t.key)||this.items.push(t)}get(e,t){const n=jg(this.items,e);return!t&&Im(n)?Pm(n.key)?n.key.value:n.key:n}set(e,t){if("boolean"!=typeof t)throw new Error("Expected boolean value for set(key, value) in a YAML set, not "+typeof t);const n=jg(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new Rg(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,n);throw new Error("Set items must all have null values")}static from(e,t,n){const{replacer:s}=n,r=new this(e);if(t&&Symbol.iterator in Object(t))for(let i of t)"function"==typeof s&&(i=s.call(t,i,i)),r.items.push(Pg(i,null,n));return r}}$v.tag="tag:yaml.org,2002:set";const Tv={collection:"map",identify:e=>e instanceof Set,nodeClass:$v,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>$v.from(e,t,n),resolve(e,t){if(Nm(e)){if(e.hasAllNullValues(!0))return Object.assign(new $v,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};function Lv(e,t){const n=e[0],s="-"===n||"+"===n?e.substring(1):e,r=e=>t?BigInt(e):Number(e),i=s.replace(/_/g,"").split(":").reduce(((e,t)=>e*r(60)+r(t)),r(0));return"-"===n?r(-1)*i:i}function Ov(e){let{value:t}=e,n=e=>e;if("bigint"==typeof t)n=e=>BigInt(e);else if(isNaN(t)||!isFinite(t))return Yg(e);let s="";t<0&&(s="-",t*=n(-1));const r=n(60),i=[t%r];return t<60?i.unshift(0):(t=(t-i[0])/r,i.unshift(t%r),t>=60&&(t=(t-i[0])/r,i.unshift(t))),s+i.map((e=>String(e).padStart(2,"0"))).join(":").replace(/000000\d*$/,"")}const Nv={identify:e=>"bigint"==typeof e||Number.isInteger(e),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:n})=>Lv(e,n),stringify:Ov},Iv={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>Lv(e,!1),stringify:Ov},Pv={identify:e=>e instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(e){const t=e.match(Pv.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,n,s,r,i,o,a]=t.map(Number),l=t[7]?Number((t[7]+"00").substr(1,3)):0;let c=Date.UTC(n,s-1,r,i||0,o||0,a||0,l);const u=t[8];if(u&&"Z"!==u){let e=Lv(u,!1);Math.abs(e)<30&&(e*=60),c-=6e4*e}return new Date(c)},stringify:({value:e})=>e.toISOString().replace(/((T00:00)?:00)?\.000Z$/,"")},Rv=[qg,Vg,Kg,zg,gv,vv,xv,Sv,Cv,Av,yv,kv,bv,cv,fv,pv,Tv,Nv,Iv,Pv],Mv=new Map([["core",iv],["failsafe",[qg,Vg,Kg]],["json",lv],["yaml11",Rv],["yaml-1.1",Rv]]),Dv={binary:cv,bool:Gg,float:Jg,floatExp:Xg,floatNaN:Qg,floatTime:Iv,int:sv,intHex:rv,intOct:nv,intTime:Nv,map:qg,null:zg,omap:fv,pairs:pv,seq:Vg,set:Tv,timestamp:Pv},Uv={"tag:yaml.org,2002:binary":cv,"tag:yaml.org,2002:omap":fv,"tag:yaml.org,2002:pairs":pv,"tag:yaml.org,2002:set":Tv,"tag:yaml.org,2002:timestamp":Pv};function Fv(e,t){let n=Mv.get(t);if(!n){if(!Array.isArray(e)){const e=Array.from(Mv.keys()).filter((e=>"yaml11"!==e)).map((e=>JSON.stringify(e))).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${e} or define customTags array`)}n=[]}if(Array.isArray(e))for(const s of e)n=n.concat(s);else"function"==typeof e&&(n=e(n.slice()));return n.map((e=>{if("string"!=typeof e)return e;const t=Dv[e];if(t)return t;const n=Object.keys(Dv).map((e=>JSON.stringify(e))).join(", ");throw new Error(`Unknown custom tag "${e}"; use one of ${n}`)}))}const jv=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0;class Bv{constructor({compat:e,customTags:t,merge:n,resolveKnownTags:s,schema:r,sortMapEntries:i,toStringDefaults:o}){this.compat=Array.isArray(e)?Fv(e,"compat"):e?Fv(null,e):null,this.merge=!!n,this.name="string"==typeof r&&r||"core",this.knownTags=s?Uv:{},this.tags=Fv(t,this.name),this.toStringOptions=null!=o?o:null,Object.defineProperty(this,Sm,{value:qg}),Object.defineProperty(this,Am,{value:Kg}),Object.defineProperty(this,$m,{value:Vg}),this.sortMapEntries="function"==typeof i?i:!0===i?jv:null}clone(){const e=Object.create(Bv.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}}class qv{constructor(e,t,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Tm,{value:xm});let s=null;"function"==typeof t||Array.isArray(t)?s=t:void 0===n&&t&&(n=t,t=void 0);const r=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,uniqueKeys:!0,version:"1.2"},n);this.options=r;let{version:i}=r;(null==n?void 0:n._directives)?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(i=this.directives.yaml.version)):this.directives=new Qm({version:i}),this.setSchema(i,n),this.contents=void 0===e?null:this.createNode(e,s,n)}clone(){const e=Object.create(qv.prototype,{[Tm]:{value:xm}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=Dm(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){Wv(this.contents)&&this.contents.add(e)}addIn(e,t){Wv(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){const n=Jm(this);e.anchor=!t||n.has(t)?Zm(t||"a",n):t}return new sg(e.anchor)}createNode(e,t,n){let s;if("function"==typeof t)e=t.call({"":e},"",e),s=t;else if(Array.isArray(t)){const e=e=>"number"==typeof e||e instanceof String||e instanceof Number,n=t.filter(e).map(String);n.length>0&&(t=t.concat(n)),s=t}else void 0===n&&t&&(n=t,t=void 0);const{aliasDuplicateObjects:r,anchorPrefix:i,flow:o,keepUndefined:a,onTagObj:l,tag:c}=null!=n?n:{},{onAnchor:u,setAnchors:d,sourceObjects:p}=function(e,t){const n=[],s=new Map;let r=null;return{onAnchor:s=>{n.push(s),r||(r=Jm(e));const i=Zm(t,r);return r.add(i),i},setAnchors:()=>{for(const e of n){const t=s.get(e);if("object"!=typeof t||!t.anchor||!Pm(t.node)&&!Mm(t.node)){const t=new Error("Failed to resolve repeated object (this should not happen)");throw t.source=e,t}t.node.anchor=t.anchor}},sourceObjects:s}}(this,i||"a"),h=lg(e,c,{aliasDuplicateObjects:null==r||r,keepUndefined:null!=a&&a,onAnchor:u,onTagObj:l,replacer:s,schema:this.schema,sourceObjects:p});return o&&Mm(h)&&(h.flow=!0),d(),h}createPair(e,t,n={}){const s=this.createNode(e,null,n),r=this.createNode(t,null,n);return new Rg(s,r)}delete(e){return!!Wv(this.contents)&&this.contents.delete(e)}deleteIn(e){return ug(e)?null!=this.contents&&(this.contents=null,!0):!!Wv(this.contents)&&this.contents.deleteIn(e)}get(e,t){return Mm(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return ug(e)?!t&&Pm(this.contents)?this.contents.value:this.contents:Mm(this.contents)?this.contents.getIn(e,t):void 0}has(e){return!!Mm(this.contents)&&this.contents.has(e)}hasIn(e){return ug(e)?void 0!==this.contents:!!Mm(this.contents)&&this.contents.hasIn(e)}set(e,t){null==this.contents?this.contents=cg(this.schema,[e],t):Wv(this.contents)&&this.contents.set(e,t)}setIn(e,t){ug(e)?this.contents=t:null==this.contents?this.contents=cg(this.schema,Array.from(e),t):Wv(this.contents)&&this.contents.setIn(e,t)}setSchema(e,t={}){let n;switch("number"==typeof e&&(e=String(e)),e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new Qm({version:"1.1"}),n={merge:!0,resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new Qm({version:e}),n={merge:!1,resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,n=null;break;default:{const t=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${t}`)}}if(t.schema instanceof Object)this.schema=t.schema;else{if(!n)throw new Error("With a null YAML version, the { schema: Schema } option is required");this.schema=new Bv(Object.assign(n,t))}}toJS({json:e,jsonArg:t,mapAsMap:n,maxAliasCount:s,onAnchor:r,reviver:i}={}){const o={anchors:new Map,doc:this,keep:!e,mapAsMap:!0===n,mapKeyWarned:!1,maxAliasCount:"number"==typeof s?s:100},a=tg(this.contents,null!=t?t:"",o);if("function"==typeof r)for(const{count:l,res:c}of o.anchors.values())r(c,l);return"function"==typeof i?eg(i,{"":a},"",a):a}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){const t=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${t}`)}return function(e,t){var n;const s=[];let r=!0===t.directives;if(!1!==t.directives&&e.directives){const t=e.directives.toString(e);t?(s.push(t),r=!0):e.directives.docStart&&(r=!0)}r&&s.push("---");const i=$g(e,t),{commentString:o}=i.options;if(e.commentBefore){1!==s.length&&s.unshift("");const t=o(e.commentBefore);s.unshift(hg(t,""))}let a=!1,l=null;if(e.contents){if(Dm(e.contents)){if(e.contents.spaceBefore&&r&&s.push(""),e.contents.commentBefore){const t=o(e.contents.commentBefore);s.push(hg(t,""))}i.forceBlockIndent=!!e.comment,l=e.contents.comment}const t=l?void 0:()=>a=!0;let n=Tg(e.contents,i,(()=>l=null),t);l&&(n+=fg(n,"",o(l))),"|"!==n[0]&&">"!==n[0]||"---"!==s[s.length-1]?s.push(n):s[s.length-1]=`--- ${n}`}else s.push(Tg(e.contents,i));if(null==(n=e.directives)?void 0:n.docEnd)if(e.comment){const t=o(e.comment);t.includes("\n")?(s.push("..."),s.push(hg(t,""))):s.push(`... ${t}`)}else s.push("...");else{let t=e.comment;t&&a&&(t=t.replace(/^\n+/,"")),t&&(a&&!l||""===s[s.length-1]||s.push(""),s.push(hg(o(t),"")))}return s.join("\n")+"\n"}(this,e)}}function Wv(e){if(Mm(e))return!0;throw new Error("Expected a YAML collection as document contents")}class Hv extends Error{constructor(e,t,n,s){super(),this.name=e,this.code=n,this.message=s,this.pos=t}}class Vv extends Hv{constructor(e,t,n){super("YAMLParseError",e,t,n)}}class Kv extends Hv{constructor(e,t,n){super("YAMLWarning",e,t,n)}}const zv=(e,t)=>n=>{if(-1===n.pos[0])return;n.linePos=n.pos.map((e=>t.linePos(e)));const{line:s,col:r}=n.linePos[0];n.message+=` at line ${s}, column ${r}`;let i=r-1,o=e.substring(t.lineStarts[s-1],t.lineStarts[s]).replace(/[\n\r]+$/,"");if(i>=60&&o.length>80){const e=Math.min(i-39,o.length-79);o="…"+o.substring(e),i-=e-1}if(o.length>80&&(o=o.substring(0,79)+"…"),s>1&&/^ *$/.test(o.substring(0,i))){let n=e.substring(t.lineStarts[s-2],t.lineStarts[s-1]);n.length>80&&(n=n.substring(0,79)+"…\n"),o=n+o}if(/[^ ]/.test(o)){let e=1;const t=n.linePos[1];t&&t.line===s&&t.col>r&&(e=Math.max(1,Math.min(t.col-r,80-i)));const a=" ".repeat(i)+"^".repeat(e);n.message+=`:\n\n${o}\n${a}\n`}};function Gv(e,{flow:t,indicator:n,next:s,offset:r,onError:i,startOnNewline:o}){let a=!1,l=o,c=o,u="",d="",p=!1,h=!1,f=!1,m=null,g=null,v=null,y=null,k=null;for(const _ of e)switch(f&&("space"!==_.type&&"newline"!==_.type&&"comma"!==_.type&&i(_.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),f=!1),_.type){case"space":!t&&l&&"doc-start"!==n&&"\t"===_.source[0]&&i(_,"TAB_AS_INDENT","Tabs are not allowed as indentation"),c=!0;break;case"comment":{c||i(_,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const e=_.source.substring(1)||" ";u?u+=d+e:u=e,d="",l=!1;break}case"newline":l?u?u+=_.source:a=!0:d+=_.source,l=!0,p=!0,(m||g)&&(h=!0),c=!0;break;case"anchor":m&&i(_,"MULTIPLE_ANCHORS","A node can have at most one anchor"),_.source.endsWith(":")&&i(_.offset+_.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),m=_,null===k&&(k=_.offset),l=!1,c=!1,f=!0;break;case"tag":g&&i(_,"MULTIPLE_TAGS","A node can have at most one tag"),g=_,null===k&&(k=_.offset),l=!1,c=!1,f=!0;break;case n:(m||g)&&i(_,"BAD_PROP_ORDER",`Anchors and tags must be after the ${_.source} indicator`),y&&i(_,"UNEXPECTED_TOKEN",`Unexpected ${_.source} in ${null!=t?t:"collection"}`),y=_,l=!1,c=!1;break;case"comma":if(t){v&&i(_,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),v=_,l=!1,c=!1;break}default:i(_,"UNEXPECTED_TOKEN",`Unexpected ${_.type} token`),l=!1,c=!1}const b=e[e.length-1],w=b?b.offset+b.source.length:r;return f&&s&&"space"!==s.type&&"newline"!==s.type&&"comma"!==s.type&&("scalar"!==s.type||""!==s.source)&&i(s.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),{comma:v,found:y,spaceBefore:a,comment:u,hasNewline:p,hasNewlineAfterProp:h,anchor:m,tag:g,end:w,start:null!=k?k:w}}function Yv(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes("\n"))return!0;if(e.end)for(const t of e.end)if("newline"===t.type)return!0;return!1;case"flow-collection":for(const t of e.items){for(const e of t.start)if("newline"===e.type)return!0;if(t.sep)for(const e of t.sep)if("newline"===e.type)return!0;if(Yv(t.key)||Yv(t.value))return!0}return!1;default:return!0}}function Qv(e,t,n){if("flow-collection"===(null==t?void 0:t.type)){const s=t.end[0];if(s.indent===e&&("]"===s.source||"}"===s.source)&&Yv(t)){n(s,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}}function Xv(e,t,n){const{uniqueKeys:s}=e.options;if(!1===s)return!1;const r="function"==typeof s?s:(t,n)=>t===n||Pm(t)&&Pm(n)&&t.value===n.value&&!("<<"===t.value&&e.schema.merge);return t.some((e=>r(e.key,n)))}const Jv="All mapping items must start at the same column";function Zv(e,t,n,s){let r="";if(e){let i=!1,o="";for(const a of e){const{source:e,type:l}=a;switch(l){case"space":i=!0;break;case"comment":{n&&!i&&s(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const t=e.substring(1)||" ";r?r+=o+t:r=t,o="";break}case"newline":r&&(o+=e),i=!0;break;default:s(a,"UNEXPECTED_TOKEN",`Unexpected ${l} at node end`)}t+=e.length}}return{comment:r,offset:t}}const ey="Block collections are not allowed within flow collections",ty=e=>e&&("block-map"===e.type||"block-seq"===e.type);function ny(e,t,n,s,r,i){const o="block-map"===n.type?function({composeNode:e,composeEmptyNode:t},n,s,r,i){var o,a;const l=new(null!=(o=null==i?void 0:i.nodeClass)?o:Bg)(n.schema);n.atRoot&&(n.atRoot=!1);let c=s.offset,u=null;for(const d of s.items){const{start:i,key:o,sep:p,value:h}=d,f=Gv(i,{indicator:"explicit-key-ind",next:null!=o?o:null==p?void 0:p[0],offset:c,onError:r,startOnNewline:!0}),m=!f.found;if(m){if(o&&("block-seq"===o.type?r(c,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in o&&o.indent!==s.indent&&r(c,"BAD_INDENT",Jv)),!f.anchor&&!f.tag&&!p){u=f.end,f.comment&&(l.comment?l.comment+="\n"+f.comment:l.comment=f.comment);continue}(f.hasNewlineAfterProp||Yv(o))&&r(null!=o?o:i[i.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else(null==(a=f.found)?void 0:a.indent)!==s.indent&&r(c,"BAD_INDENT",Jv);const g=f.end,v=o?e(n,o,f,r):t(n,g,i,null,f,r);n.schema.compat&&Qv(s.indent,o,r),Xv(n,l.items,v)&&r(g,"DUPLICATE_KEY","Map keys must be unique");const y=Gv(null!=p?p:[],{indicator:"map-value-ind",next:h,offset:v.range[2],onError:r,startOnNewline:!o||"block-scalar"===o.type});if(c=y.end,y.found){m&&("block-map"!==(null==h?void 0:h.type)||y.hasNewline||r(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&f.start<y.found.offset-1024&&r(v.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const i=h?e(n,h,y,r):t(n,c,p,null,y,r);n.schema.compat&&Qv(s.indent,h,r),c=i.range[2];const o=new Rg(v,i);n.options.keepSourceTokens&&(o.srcToken=d),l.items.push(o)}else{m&&r(v.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),y.comment&&(v.comment?v.comment+="\n"+y.comment:v.comment=y.comment);const e=new Rg(v);n.options.keepSourceTokens&&(e.srcToken=d),l.items.push(e)}}return u&&u<c&&r(u,"IMPOSSIBLE","Map comment with trailing content"),l.range=[s.offset,c,null!=u?u:c],l}(e,t,n,s,i):"block-seq"===n.type?function({composeNode:e,composeEmptyNode:t},n,s,r,i){var o;const a=new(null!=(o=null==i?void 0:i.nodeClass)?o:Wg)(n.schema);n.atRoot&&(n.atRoot=!1);let l=s.offset,c=null;for(const{start:u,value:d}of s.items){const i=Gv(u,{indicator:"seq-item-ind",next:d,offset:l,onError:r,startOnNewline:!0});if(!i.found){if(!(i.anchor||i.tag||d)){c=i.end,i.comment&&(a.comment=i.comment);continue}d&&"block-seq"===d.type?r(i.end,"BAD_INDENT","All sequence items must start at the same column"):r(l,"MISSING_CHAR","Sequence item without - indicator")}const o=d?e(n,d,i,r):t(n,i.end,u,null,i,r);n.schema.compat&&Qv(s.indent,d,r),l=o.range[2],a.items.push(o)}return a.range=[s.offset,l,null!=c?c:l],a}(e,t,n,s,i):function({composeNode:e,composeEmptyNode:t},n,s,r,i){var o,a;const l="{"===s.start.source,c=l?"flow map":"flow sequence",u=new(null!=(o=null==i?void 0:i.nodeClass)?o:l?Bg:Wg)(n.schema);u.flow=!0;const d=n.atRoot;d&&(n.atRoot=!1);let p=s.offset+s.start.source.length;for(let v=0;v<s.items.length;++v){const i=s.items[v],{start:o,key:d,sep:h,value:f}=i,m=Gv(o,{flow:c,indicator:"explicit-key-ind",next:null!=d?d:null==h?void 0:h[0],offset:p,onError:r,startOnNewline:!1});if(!m.found){if(!(m.anchor||m.tag||h||f)){0===v&&m.comma?r(m.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${c}`):v<s.items.length-1&&r(m.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${c}`),m.comment&&(u.comment?u.comment+="\n"+m.comment:u.comment=m.comment),p=m.end;continue}!l&&n.options.strict&&Yv(d)&&r(d,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(0===v)m.comma&&r(m.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${c}`);else if(m.comma||r(m.start,"MISSING_CHAR",`Missing , between ${c} items`),m.comment){let e="";e:for(const t of o)switch(t.type){case"comma":case"space":break;case"comment":e=t.source.substring(1);break e;default:break e}if(e){let t=u.items[u.items.length-1];Im(t)&&(t=null!=(a=t.value)?a:t.key),t.comment?t.comment+="\n"+e:t.comment=e,m.comment=m.comment.substring(e.length+1)}}if(l||h||m.found){const s=m.end,a=d?e(n,d,m,r):t(n,s,o,null,m,r);ty(d)&&r(a.range,"BLOCK_IN_FLOW",ey);const g=Gv(null!=h?h:[],{flow:c,indicator:"map-value-ind",next:f,offset:a.range[2],onError:r,startOnNewline:!1});if(g.found){if(!l&&!m.found&&n.options.strict){if(h)for(const e of h){if(e===g.found)break;if("newline"===e.type){r(e,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}m.start<g.found.offset-1024&&r(g.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else f&&("source"in f&&f.source&&":"===f.source[0]?r(f,"MISSING_CHAR",`Missing space after : in ${c}`):r(g.start,"MISSING_CHAR",`Missing , or : between ${c} items`));const v=f?e(n,f,g,r):g.found?t(n,g.end,h,null,g,r):null;v?ty(f)&&r(v.range,"BLOCK_IN_FLOW",ey):g.comment&&(a.comment?a.comment+="\n"+g.comment:a.comment=g.comment);const y=new Rg(a,v);if(n.options.keepSourceTokens&&(y.srcToken=i),l){const e=u;Xv(n,e.items,a)&&r(s,"DUPLICATE_KEY","Map keys must be unique"),e.items.push(y)}else{const e=new Bg(n.schema);e.flow=!0,e.items.push(y),u.items.push(e)}p=v?v.range[2]:g.end}else{const s=f?e(n,f,m,r):t(n,m.end,h,null,m,r);u.items.push(s),p=s.range[2],ty(f)&&r(s.range,"BLOCK_IN_FLOW",ey)}}const h=l?"}":"]",[f,...m]=s.end;let g=p;if(f&&f.source===h)g=f.offset+f.source.length;else{const e=c[0].toUpperCase()+c.substring(1);r(p,d?"MISSING_CHAR":"BAD_INDENT",d?`${e} must end with a ${h}`:`${e} in block collection must be sufficiently indented and end with a ${h}`),f&&1!==f.source.length&&m.unshift(f)}if(m.length>0){const e=Zv(m,g,n.options.strict,r);e.comment&&(u.comment?u.comment+="\n"+e.comment:u.comment=e.comment),u.range=[s.offset,g,e.offset]}else u.range=[s.offset,g,g];return u}(e,t,n,s,i),a=o.constructor;return"!"===r||r===a.tagName?(o.tag=a.tagName,o):(r&&(o.tag=r),o)}function sy(e,t,n){const s=e.offset,r=function({offset:e,props:t},n,s){if("block-scalar-header"!==t[0].type)return s(t[0],"IMPOSSIBLE","Block scalar header not found"),null;const{source:r}=t[0],i=r[0];let o=0,a="",l=-1;for(let p=1;p<r.length;++p){const t=r[p];if(a||"-"!==t&&"+"!==t){const n=Number(t);!o&&n?o=n:-1===l&&(l=e+p)}else a=t}-1!==l&&s(l,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${r}`);let c=!1,u="",d=r.length;for(let p=1;p<t.length;++p){const e=t[p];switch(e.type){case"space":c=!0;case"newline":d+=e.source.length;break;case"comment":if(n&&!c){s(e,"MISSING_CHAR","Comments must be separated from other tokens by white space characters")}d+=e.source.length,u=e.source.substring(1);break;case"error":s(e,"UNEXPECTED_TOKEN",e.message),d+=e.source.length;break;default:{s(e,"UNEXPECTED_TOKEN",`Unexpected token in block scalar header: ${e.type}`);const t=e.source;t&&"string"==typeof t&&(d+=t.length)}}}return{mode:i,indent:o,chomp:a,comment:u,length:d}}(e,t,n);if(!r)return{value:"",type:null,comment:"",range:[s,s,s]};const i=">"===r.mode?og.BLOCK_FOLDED:og.BLOCK_LITERAL,o=e.source?function(e){const t=e.split(/\n( *)/),n=t[0],s=n.match(/^( *)/),r=[(null==s?void 0:s[1])?[s[1],n.slice(s[1].length)]:["",n]];for(let i=1;i<t.length;i+=2)r.push([t[i],t[i+1]]);return r}(e.source):[];let a=o.length;for(let m=o.length-1;m>=0;--m){const e=o[m][1];if(""!==e&&"\r"!==e)break;a=m}if(0===a){const t="+"===r.chomp&&o.length>0?"\n".repeat(Math.max(1,o.length-1)):"";let n=s+r.length;return e.source&&(n+=e.source.length),{value:t,type:i,comment:r.comment,range:[s,n,n]}}let l=e.indent+r.indent,c=e.offset+r.length,u=0;for(let m=0;m<a;++m){const[e,t]=o[m];if(""!==t&&"\r"!==t){if(e.length<l){const t="Block scalars with more-indented leading empty lines must use an explicit indentation indicator";n(c+e.length,"MISSING_CHAR",t)}0===r.indent&&(l=e.length),u=m;break}0===r.indent&&e.length>l&&(l=e.length),c+=e.length+t.length+1}for(let m=o.length-1;m>=a;--m)o[m][0].length>l&&(a=m+1);let d="",p="",h=!1;for(let m=0;m<u;++m)d+=o[m][0].slice(l)+"\n";for(let m=u;m<a;++m){let[e,t]=o[m];c+=e.length+t.length+1;const s="\r"===t[t.length-1];if(s&&(t=t.slice(0,-1)),t&&e.length<l){const i=`Block scalar lines must not be less indented than their ${r.indent?"explicit indentation indicator":"first line"}`;n(c-t.length-(s?2:1),"BAD_INDENT",i),e=""}i===og.BLOCK_LITERAL?(d+=p+e.slice(l)+t,p="\n"):e.length>l||"\t"===t[0]?(" "===p?p="\n":h||"\n"!==p||(p="\n\n"),d+=p+e.slice(l)+t,p="\n",h=!0):""===t?"\n"===p?d+="\n":p="\n":(d+=p+t,p=" ",h=!1)}switch(r.chomp){case"-":break;case"+":for(let e=a;e<o.length;++e)d+="\n"+o[e][0].slice(l);"\n"!==d[d.length-1]&&(d+="\n");break;default:d+="\n"}const f=s+r.length+e.source.length;return{value:d,type:i,comment:r.comment,range:[s,f,f]}}function ry(e,t,n){const{offset:s,type:r,source:i,end:o}=e;let a,l;const c=(e,t,r)=>n(s+e,t,r);switch(r){case"scalar":a=og.PLAIN,l=function(e,t){let n="";switch(e[0]){case"\t":n="a tab character";break;case",":n="flow indicator character ,";break;case"%":n="directive indicator character %";break;case"|":case">":n=`block scalar indicator ${e[0]}`;break;case"@":case"`":n=`reserved character ${e[0]}`}n&&t(0,"BAD_SCALAR_START",`Plain value cannot start with ${n}`);return iy(e)}(i,c);break;case"single-quoted-scalar":a=og.QUOTE_SINGLE,l=function(e,t){"'"===e[e.length-1]&&1!==e.length||t(e.length,"MISSING_CHAR","Missing closing 'quote");return iy(e.slice(1,-1)).replace(/''/g,"'")}(i,c);break;case"double-quoted-scalar":a=og.QUOTE_DOUBLE,l=function(e,t){let n="";for(let s=1;s<e.length-1;++s){const r=e[s];if("\r"!==r||"\n"!==e[s+1])if("\n"===r){const{fold:t,offset:r}=oy(e,s);n+=t,s=r}else if("\\"===r){let r=e[++s];const i=ay[r];if(i)n+=i;else if("\n"===r)for(r=e[s+1];" "===r||"\t"===r;)r=e[1+ ++s];else if("\r"===r&&"\n"===e[s+1])for(r=e[1+ ++s];" "===r||"\t"===r;)r=e[1+ ++s];else if("x"===r||"u"===r||"U"===r){const i={x:2,u:4,U:8}[r];n+=ly(e,s+1,i,t),s+=i}else{const r=e.substr(s-1,2);t(s-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${r}`),n+=r}}else if(" "===r||"\t"===r){const t=s;let i=e[s+1];for(;" "===i||"\t"===i;)i=e[1+ ++s];"\n"===i||"\r"===i&&"\n"===e[s+2]||(n+=s>t?e.slice(t,s+1):r)}else n+=r}'"'===e[e.length-1]&&1!==e.length||t(e.length,"MISSING_CHAR",'Missing closing "quote');return n}(i,c);break;default:return n(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${r}`),{value:"",type:null,comment:"",range:[s,s+i.length,s+i.length]}}const u=s+i.length,d=Zv(o,u,t,n);return{value:l,type:a,comment:d.comment,range:[s,u,d.offset]}}function iy(e){var t;let n,s;try{n=new RegExp("(.*?)(?<![ \t])[ \t]*\r?\n","sy"),s=new RegExp("[ \t]*(.*?)(?:(?<![ \t])[ \t]*)?\r?\n","sy")}catch(c){n=new RegExp("(.*?)[ \\t]*\\r?\\n","sy"),s=new RegExp("[ \\t]*(.*?)[ \\t]*\\r?\\n","sy")}let r=n.exec(e);if(!r)return e;let i=r[1],o=" ",a=n.lastIndex;for(s.lastIndex=a;r=s.exec(e);)""===r[1]?"\n"===o?i+=o:o="\n":(i+=o+r[1],o=" "),a=s.lastIndex;const l=new RegExp("[ \\t]*(.*)","sy");return l.lastIndex=a,r=l.exec(e),i+o+(null!=(t=null==r?void 0:r[1])?t:"")}function oy(e,t){let n="",s=e[t+1];for(;!(" "!==s&&"\t"!==s&&"\n"!==s&&"\r"!==s||"\r"===s&&"\n"!==e[t+2]);)"\n"===s&&(n+="\n"),s=e[(t+=1)+1];return n||(n=" "),{fold:n,offset:t}}const ay={0:"\0",a:"",b:"\b",e:"",f:"\f",n:"\n",r:"\r",t:"\t",v:"\v",N:"
",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\","\t":"\t"};function ly(e,t,n,s){const r=e.substr(t,n),i=r.length===n&&/^[0-9a-fA-F]+$/.test(r)?parseInt(r,16):NaN;if(isNaN(i)){const r=e.substr(t-2,n+2);return s(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${r}`),r}return String.fromCodePoint(i)}function cy(e,t,n,s){const{value:r,type:i,comment:o,range:a}="block-scalar"===t.type?sy(t,e.options.strict,s):ry(t,e.options.strict,s),l=n?e.directives.tagName(n.source,(e=>s(n,"TAG_RESOLVE_FAILED",e))):null,c=n&&l?function(e,t,n,s,r){var i;if("!"===n)return e[Am];const o=[];for(const l of e.tags)if(!l.collection&&l.tag===n){if(!l.default||!l.test)return l;o.push(l)}for(const l of o)if(null==(i=l.test)?void 0:i.test(t))return l;const a=e.knownTags[n];if(a&&!a.collection)return e.tags.push(Object.assign({},a,{default:!1,test:void 0})),a;return r(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,"tag:yaml.org,2002:str"!==n),e[Am]}(e.schema,r,l,n,s):"scalar"===t.type?function({directives:e,schema:t},n,s,r){var i;const o=t.tags.find((e=>{var t;return e.default&&(null==(t=e.test)?void 0:t.test(n))}))||t[Am];if(t.compat){const a=null!=(i=t.compat.find((e=>{var t;return e.default&&(null==(t=e.test)?void 0:t.test(n))})))?i:t[Am];if(o.tag!==a.tag){r(s,"TAG_RESOLVE_FAILED",`Value may be parsed as either ${e.tagString(o.tag)} or ${e.tagString(a.tag)}`,!0)}}return o}(e,r,t,s):e.schema[Am];let u;try{const i=c.resolve(r,(e=>s(null!=n?n:t,"TAG_RESOLVE_FAILED",e)),e.options);u=Pm(i)?i:new og(i)}catch(d){const e=d instanceof Error?d.message:String(d);s(null!=n?n:t,"TAG_RESOLVE_FAILED",e),u=new og(r)}return u.range=a,u.source=r,i&&(u.type=i),l&&(u.tag=l),c.format&&(u.format=c.format),o&&(u.comment=o),u}function uy(e,t,n){if(t){null===n&&(n=t.length);for(let s=n-1;s>=0;--s){let n=t[s];switch(n.type){case"space":case"comment":case"newline":e-=n.source.length;continue}for(n=t[++s];"space"===(null==n?void 0:n.type);)e+=n.source.length,n=t[++s];break}}return e}const dy={composeNode:py,composeEmptyNode:hy};function py(e,t,n,s){const{spaceBefore:r,comment:i,anchor:o,tag:a}=n;let l,c=!0;switch(t.type){case"alias":l=function({options:e},{offset:t,source:n,end:s},r){const i=new sg(n.substring(1));""===i.source&&r(t,"BAD_ALIAS","Alias cannot be an empty string");i.source.endsWith(":")&&r(t+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const o=t+n.length,a=Zv(s,o,e.strict,r);i.range=[t,o,a.offset],a.comment&&(i.comment=a.comment);return i}(e,t,s),(o||a)&&s(t,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":l=cy(e,t,a,s),o&&(l.anchor=o.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":l=function(e,t,n,s,r){var i,o;const a=s?t.directives.tagName(s.source,(e=>r(s,"TAG_RESOLVE_FAILED",e))):null,l="block-map"===n.type?"map":"block-seq"===n.type?"seq":"{"===n.start.source?"map":"seq";if(!s||!a||"!"===a||a===Bg.tagName&&"map"===l||a===Wg.tagName&&"seq"===l||!l)return ny(e,t,n,r,a);let c=t.schema.tags.find((e=>e.tag===a&&e.collection===l));if(!c){const i=t.schema.knownTags[a];if(!i||i.collection!==l)return(null==i?void 0:i.collection)?r(s,"BAD_COLLECTION_TYPE",`${i.tag} used for ${l} collection, but expects ${i.collection}`,!0):r(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${a}`,!0),ny(e,t,n,r,a);t.schema.tags.push(Object.assign({},i,{default:!1})),c=i}const u=ny(e,t,n,r,a,c),d=null!=(o=null==(i=c.resolve)?void 0:i.call(c,u,(e=>r(s,"TAG_RESOLVE_FAILED",e)),t.options))?o:u,p=Dm(d)?d:new og(d);return p.range=u.range,p.tag=a,(null==c?void 0:c.format)&&(p.format=c.format),p}(dy,e,t,a,s),o&&(l.anchor=o.source.substring(1));break;default:s(t,"UNEXPECTED_TOKEN","error"===t.type?t.message:`Unsupported token (type: ${t.type})`),l=hy(e,t.offset,void 0,null,n,s),c=!1}return o&&""===l.anchor&&s(o,"BAD_ALIAS","Anchor cannot be an empty string"),r&&(l.spaceBefore=!0),i&&("scalar"===t.type&&""===t.source?l.comment=i:l.commentBefore=i),e.options.keepSourceTokens&&c&&(l.srcToken=t),l}function hy(e,t,n,s,{spaceBefore:r,comment:i,anchor:o,tag:a,end:l},c){const u=cy(e,{type:"scalar",offset:uy(t,n,s),indent:-1,source:""},a,c);return o&&(u.anchor=o.source.substring(1),""===u.anchor&&c(o,"BAD_ALIAS","Anchor cannot be an empty string")),r&&(u.spaceBefore=!0),i&&(u.comment=i,u.range[2]=l),u}function fy(e){if("number"==typeof e)return[e,e+1];if(Array.isArray(e))return 2===e.length?e:[e[0],e[1]];const{offset:t,source:n}=e;return[t,t+("string"==typeof n?n.length:1)]}function my(e){var t;let n="",s=!1,r=!1;for(let i=0;i<e.length;++i){const o=e[i];switch(o[0]){case"#":n+=(""===n?"":r?"\n\n":"\n")+(o.substring(1)||" "),s=!0,r=!1;break;case"%":"#"!==(null==(t=e[i+1])?void 0:t[0])&&(i+=1),s=!1;break;default:s||(r=!0),s=!1}}return{comment:n,afterEmptyLine:r}}class gy{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(e,t,n,s)=>{const r=fy(e);s?this.warnings.push(new Kv(r,t,n)):this.errors.push(new Vv(r,t,n))},this.directives=new Qm({version:e.version||"1.2"}),this.options=e}decorate(e,t){const{comment:n,afterEmptyLine:s}=my(this.prelude);if(n){const r=e.contents;if(t)e.comment=e.comment?`${e.comment}\n${n}`:n;else if(s||e.directives.docStart||!r)e.commentBefore=n;else if(Mm(r)&&!r.flow&&r.items.length>0){let e=r.items[0];Im(e)&&(e=e.key);const t=e.commentBefore;e.commentBefore=t?`${n}\n${t}`:n}else{const e=r.commentBefore;r.commentBefore=e?`${n}\n${e}`:n}}t?(Array.prototype.push.apply(e.errors,this.errors),Array.prototype.push.apply(e.warnings,this.warnings)):(e.errors=this.errors,e.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:my(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,n=-1){for(const s of e)yield*h(this.next(s));yield*h(this.end(t,n))}*next(e){switch(e.type){case"directive":this.directives.add(e.source,((t,n,s)=>{const r=fy(e);r[0]+=t,this.onError(r,"BAD_DIRECTIVE",n,s)})),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{const t=function(e,t,{offset:n,start:s,value:r,end:i},o){const a=Object.assign({_directives:t},e),l=new qv(void 0,a),c={atRoot:!0,directives:l.directives,options:l.options,schema:l.schema},u=Gv(s,{indicator:"doc-start",next:null!=r?r:null==i?void 0:i[0],offset:n,onError:o,startOnNewline:!0});u.found&&(l.directives.docStart=!0,!r||"block-map"!==r.type&&"block-seq"!==r.type||u.hasNewline||o(u.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),l.contents=r?py(c,r,u,o):hy(c,u.end,s,null,u,o);const d=l.contents.range[2],p=Zv(i,d,!1,o);return p.comment&&(l.comment=p.comment),l.range=[n,d,p.offset],l}(this.options,this.directives,e,this.onError);this.atDirectives&&!t.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(t,!1),this.doc&&(yield this.doc),this.doc=t,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{const t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,n=new Vv(fy(e),"UNEXPECTED_TOKEN",t);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case"doc-end":{if(!this.doc){const t="Unexpected doc-end without preceding document";this.errors.push(new Vv(fy(e),"UNEXPECTED_TOKEN",t));break}this.doc.directives.docEnd=!0;const t=Zv(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){const e=this.doc.comment;this.doc.comment=e?`${e}\n${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new Vv(fy(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){const e=Object.assign({_directives:this.directives},this.options),n=new qv(void 0,e);this.atDirectives&&this.onError(t,"MISSING_CHAR","Missing directives-end indicator line"),n.range=[0,t,t],this.decorate(n,!1),yield n}}}function vy(e,t){if(t)for(const n of t)switch(n.type){case"space":case"comment":e.push(n);break;case"newline":return e.push(n),!0}return!1}function yy(e,t,n){switch(e.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":e.type=n,e.source=t;break;case"block-scalar":{const s=e.props.slice(1);let r=t.length;"block-scalar-header"===e.props[0].type&&(r-=e.props[0].source.length);for(const e of s)e.offset+=r;delete e.props,Object.assign(e,{type:n,source:t,end:s});break}case"block-map":case"block-seq":{const s={type:"newline",offset:e.offset+t.length,indent:e.indent,source:"\n"};delete e.items,Object.assign(e,{type:n,source:t,end:[s]});break}default:{const s="indent"in e?e.indent:-1,r="end"in e&&Array.isArray(e.end)?e.end.filter((e=>"space"===e.type||"comment"===e.type||"newline"===e.type)):[];for(const t of Object.keys(e))"type"!==t&&"offset"!==t&&delete e[t];Object.assign(e,{type:n,indent:s,source:t,end:r})}}}function ky(e){switch(e.type){case"block-scalar":{let t="";for(const n of e.props)t+=ky(n);return t+e.source}case"block-map":case"block-seq":{let t="";for(const n of e.items)t+=by(n);return t}case"flow-collection":{let t=e.start.source;for(const n of e.items)t+=by(n);for(const n of e.end)t+=n.source;return t}case"document":{let t=by(e);if(e.end)for(const n of e.end)t+=n.source;return t}default:{let t=e.source;if("end"in e&&e.end)for(const n of e.end)t+=n.source;return t}}}function by({start:e,key:t,sep:n,value:s}){let r="";for(const i of e)r+=i.source;if(t&&(r+=ky(t)),n)for(const i of n)r+=i.source;return s&&(r+=ky(s)),r}const wy=Symbol("break visit"),_y=Symbol("skip children"),Ey=Symbol("remove item");function xy(e,t){"type"in e&&"document"===e.type&&(e={start:e.start,value:e.value}),Sy(Object.freeze([]),e,t)}function Sy(e,t,n){let s=n(t,e);if("symbol"==typeof s)return s;for(const r of["key","value"]){const i=t[r];if(i&&"items"in i){for(let t=0;t<i.items.length;++t){const s=Sy(Object.freeze(e.concat([[r,t]])),i.items[t],n);if("number"==typeof s)t=s-1;else{if(s===wy)return wy;s===Ey&&(i.items.splice(t,1),t-=1)}}"function"==typeof s&&"key"===r&&(s=s(t,e))}}return"function"==typeof s?s(t,e):s}xy.BREAK=wy,xy.SKIP=_y,xy.REMOVE=Ey,xy.itemAtPath=(e,t)=>{let n=e;for(const[s,r]of t){const e=null==n?void 0:n[s];if(!e||!("items"in e))return;n=e.items[r]}return n},xy.parentCollection=(e,t)=>{const n=xy.itemAtPath(e,t.slice(0,-1)),s=t[t.length-1][0],r=null==n?void 0:n[s];if(r&&"items"in r)return r;throw new Error("Parent collection not found")};const Cy="\ufeff",Ay="",$y="",Ty="";function Ly(e){switch(e){case Cy:return"byte-order-mark";case Ay:return"doc-mode";case $y:return"flow-error-end";case Ty:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case"\n":case"\r\n":return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(e[0]){case" ":case"\t":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}const Oy=Object.freeze(Object.defineProperty({__proto__:null,BOM:Cy,DOCUMENT:Ay,FLOW_END:$y,SCALAR:Ty,createScalarToken:function(e,t){var n;const{implicitKey:s=!1,indent:r,inFlow:i=!1,offset:o=-1,type:a="PLAIN"}=t,l=Ag({type:a,value:e},{implicitKey:s,indent:r>0?" ".repeat(r):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}}),c=null!=(n=t.end)?n:[{type:"newline",offset:-1,indent:r,source:"\n"}];switch(l[0]){case"|":case">":{const e=l.indexOf("\n"),t=l.substring(0,e),n=l.substring(e+1)+"\n",s=[{type:"block-scalar-header",offset:o,indent:r,source:t}];return vy(s,c)||s.push({type:"newline",offset:-1,indent:r,source:"\n"}),{type:"block-scalar",offset:o,indent:r,props:s,source:n}}case'"':return{type:"double-quoted-scalar",offset:o,indent:r,source:l,end:c};case"'":return{type:"single-quoted-scalar",offset:o,indent:r,source:l,end:c};default:return{type:"scalar",offset:o,indent:r,source:l,end:c}}},isCollection:e=>!!e&&"items"in e,isScalar:e=>!!e&&("scalar"===e.type||"single-quoted-scalar"===e.type||"double-quoted-scalar"===e.type||"block-scalar"===e.type),prettyToken:function(e){switch(e){case Cy:return"<BOM>";case Ay:return"<DOC>";case $y:return"<FLOW_END>";case Ty:return"<SCALAR>";default:return JSON.stringify(e)}},resolveAsScalar:function(e,t=!0,n){if(e){const s=(e,t,s)=>{const r="number"==typeof e?e:Array.isArray(e)?e[0]:e.offset;if(!n)throw new Vv([r,r+1],t,s);n(r,t,s)};switch(e.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return ry(e,t,s);case"block-scalar":return sy(e,t,s)}}return null},setScalarValue:function(e,t,n={}){let{afterKey:s=!1,implicitKey:r=!1,inFlow:i=!1,type:o}=n,a="indent"in e?e.indent:null;if(s&&"number"==typeof a&&(a+=2),!o)switch(e.type){case"single-quoted-scalar":o="QUOTE_SINGLE";break;case"double-quoted-scalar":o="QUOTE_DOUBLE";break;case"block-scalar":{const t=e.props[0];if("block-scalar-header"!==t.type)throw new Error("Invalid block scalar header");o=">"===t.source[0]?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:o="PLAIN"}const l=Ag({type:o,value:t},{implicitKey:r||null===a,indent:null!==a&&a>0?" ".repeat(a):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}});switch(l[0]){case"|":case">":!function(e,t){const n=t.indexOf("\n"),s=t.substring(0,n),r=t.substring(n+1)+"\n";if("block-scalar"===e.type){const t=e.props[0];if("block-scalar-header"!==t.type)throw new Error("Invalid block scalar header");t.source=s,e.source=r}else{const{offset:t}=e,n="indent"in e?e.indent:-1,i=[{type:"block-scalar-header",offset:t,indent:n,source:s}];vy(i,"end"in e?e.end:void 0)||i.push({type:"newline",offset:-1,indent:n,source:"\n"});for(const s of Object.keys(e))"type"!==s&&"offset"!==s&&delete e[s];Object.assign(e,{type:"block-scalar",indent:n,props:i,source:r})}}(e,l);break;case'"':yy(e,l,"double-quoted-scalar");break;case"'":yy(e,l,"single-quoted-scalar");break;default:yy(e,l,"scalar")}},stringify:e=>"type"in e?ky(e):by(e),tokenType:Ly,visit:xy},Symbol.toStringTag,{value:"Module"}));function Ny(e){switch(e){case void 0:case" ":case"\n":case"\r":case"\t":return!0;default:return!1}}const Iy="0123456789ABCDEFabcdef".split(""),Py="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()".split(""),Ry=",[]{}".split(""),My=" ,[]{}\n\r\t".split(""),Dy=e=>!e||My.includes(e);class Uy{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,t=!1){var n;e&&(this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null),this.atEnd=!t;let s=null!=(n=this.next)?n:"stream";for(;s&&(t||this.hasChars(1));)s=yield*h(this.parseNext(s))}atLineEnd(){let e=this.pos,t=this.buffer[e];for(;" "===t||"\t"===t;)t=this.buffer[++e];return!t||"#"===t||"\n"===t||"\r"===t&&"\n"===this.buffer[e+1]}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let t=this.buffer[e];if(this.indentNext>0){let n=0;for(;" "===t;)t=this.buffer[++n+e];if("\r"===t){const t=this.buffer[n+e+1];if("\n"===t||!t&&!this.atEnd)return e+n+1}return"\n"===t||n>=this.indentNext||!t&&!this.atEnd?e+n:-1}if("-"===t||"."===t){const t=this.buffer.substr(e,3);if(("---"===t||"..."===t)&&Ny(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return("number"!=typeof e||-1!==e&&e<this.pos)&&(e=this.buffer.indexOf("\n",this.pos),this.lineEndPos=e),-1===e?this.atEnd?this.buffer.substring(this.pos):null:("\r"===this.buffer[e-1]&&(e-=1),this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case"stream":return yield*h(this.parseStream());case"line-start":return yield*h(this.parseLineStart());case"block-start":return yield*h(this.parseBlockStart());case"doc":return yield*h(this.parseDocument());case"flow":return yield*h(this.parseFlowCollection());case"quoted-scalar":return yield*h(this.parseQuotedScalar());case"block-scalar":return yield*h(this.parseBlockScalar());case"plain-scalar":return yield*h(this.parsePlainScalar())}}*parseStream(){let e=this.getLine();if(null===e)return this.setNext("stream");if(e[0]===Cy&&(yield*h(this.pushCount(1)),e=e.substring(1)),"%"===e[0]){let t=e.length;const n=e.indexOf("#");if(-1!==n){const s=e[n-1];" "!==s&&"\t"!==s||(t=n-1)}for(;;){const n=e[t-1];if(" "!==n&&"\t"!==n)break;t-=1}const s=(yield*h(this.pushCount(t)))+(yield*h(this.pushSpaces(!0)));return yield*h(this.pushCount(e.length-s)),this.pushNewline(),"stream"}if(this.atLineEnd()){const t=yield*h(this.pushSpaces(!0));return yield*h(this.pushCount(e.length-t)),yield*h(this.pushNewline()),"stream"}return yield Ay,yield*h(this.parseLineStart())}*parseLineStart(){const e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext("line-start");if("-"===e||"."===e){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");const e=this.peek(3);if("---"===e&&Ny(this.charAt(3)))return yield*h(this.pushCount(3)),this.indentValue=0,this.indentNext=0,"doc";if("..."===e&&Ny(this.charAt(3)))return yield*h(this.pushCount(3)),"stream"}return this.indentValue=yield*h(this.pushSpaces(!1)),this.indentNext>this.indentValue&&!Ny(this.charAt(1))&&(this.indentNext=this.indentValue),yield*h(this.parseBlockStart())}*parseBlockStart(){const[e,t]=this.peek(2);if(!t&&!this.atEnd)return this.setNext("block-start");if(("-"===e||"?"===e||":"===e)&&Ny(t)){const e=(yield*h(this.pushCount(1)))+(yield*h(this.pushSpaces(!0)));return this.indentNext=this.indentValue+1,this.indentValue+=e,yield*h(this.parseBlockStart())}return"doc"}*parseDocument(){yield*h(this.pushSpaces(!0));const e=this.getLine();if(null===e)return this.setNext("doc");let t=yield*h(this.pushIndicators());switch(e[t]){case"#":yield*h(this.pushCount(e.length-t));case void 0:return yield*h(this.pushNewline()),yield*h(this.parseLineStart());case"{":case"[":return yield*h(this.pushCount(1)),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*h(this.pushCount(1)),"doc";case"*":return yield*h(this.pushUntil(Dy)),"doc";case'"':case"'":return yield*h(this.parseQuotedScalar());case"|":case">":return t+=(yield*h(this.parseBlockScalarHeader())),t+=(yield*h(this.pushSpaces(!0))),yield*h(this.pushCount(e.length-t)),yield*h(this.pushNewline()),yield*h(this.parseBlockScalar());default:return yield*h(this.parsePlainScalar())}}*parseFlowCollection(){let e,t,n=-1;do{e=yield*h(this.pushNewline()),e>0?(t=yield*h(this.pushSpaces(!1)),this.indentValue=n=t):t=0,t+=(yield*h(this.pushSpaces(!0)))}while(e+t>0);const s=this.getLine();if(null===s)return this.setNext("flow");if(-1!==n&&n<this.indentNext&&"#"!==s[0]||0===n&&(s.startsWith("---")||s.startsWith("..."))&&Ny(s[3])){if(!(n===this.indentNext-1&&1===this.flowLevel&&("]"===s[0]||"}"===s[0])))return this.flowLevel=0,yield $y,yield*h(this.parseLineStart())}let r=0;for(;","===s[r];)r+=(yield*h(this.pushCount(1))),r+=(yield*h(this.pushSpaces(!0))),this.flowKey=!1;switch(r+=(yield*h(this.pushIndicators())),s[r]){case void 0:return"flow";case"#":return yield*h(this.pushCount(s.length-r)),"flow";case"{":case"[":return yield*h(this.pushCount(1)),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*h(this.pushCount(1)),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*h(this.pushUntil(Dy)),"flow";case'"':case"'":return this.flowKey=!0,yield*h(this.parseQuotedScalar());case":":{const e=this.charAt(1);if(this.flowKey||Ny(e)||","===e)return this.flowKey=!1,yield*h(this.pushCount(1)),yield*h(this.pushSpaces(!0)),"flow"}default:return this.flowKey=!1,yield*h(this.parsePlainScalar())}}*parseQuotedScalar(){const e=this.charAt(0);let t=this.buffer.indexOf(e,this.pos+1);if("'"===e)for(;-1!==t&&"'"===this.buffer[t+1];)t=this.buffer.indexOf("'",t+2);else for(;-1!==t;){let e=0;for(;"\\"===this.buffer[t-1-e];)e+=1;if(e%2==0)break;t=this.buffer.indexOf('"',t+1)}const n=this.buffer.substring(0,t);let s=n.indexOf("\n",this.pos);if(-1!==s){for(;-1!==s;){const e=this.continueScalar(s+1);if(-1===e)break;s=n.indexOf("\n",e)}-1!==s&&(t=s-("\r"===n[s-1]?2:1))}if(-1===t){if(!this.atEnd)return this.setNext("quoted-scalar");t=this.buffer.length}return yield*h(this.pushToIndex(t+1,!1)),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){const t=this.buffer[++e];if("+"===t)this.blockScalarKeep=!0;else if(t>"0"&&t<="9")this.blockScalarIndent=Number(t)-1;else if("-"!==t)break}return yield*h(this.pushUntil((e=>Ny(e)||"#"===e)))}*parseBlockScalar(){let e,t=this.pos-1,n=0;e:for(let s=this.pos;e=this.buffer[s];++s)switch(e){case" ":n+=1;break;case"\n":t=s,n=0;break;case"\r":{const e=this.buffer[s+1];if(!e&&!this.atEnd)return this.setNext("block-scalar");if("\n"===e)break}default:break e}if(!e&&!this.atEnd)return this.setNext("block-scalar");if(n>=this.indentNext){-1===this.blockScalarIndent?this.indentNext=n:this.indentNext+=this.blockScalarIndent;do{const e=this.continueScalar(t+1);if(-1===e)break;t=this.buffer.indexOf("\n",e)}while(-1!==t);if(-1===t){if(!this.atEnd)return this.setNext("block-scalar");t=this.buffer.length}}if(!this.blockScalarKeep)for(;;){let e=t-1,s=this.buffer[e];"\r"===s&&(s=this.buffer[--e]);const r=e;for(;" "===s||"\t"===s;)s=this.buffer[--e];if(!("\n"===s&&e>=this.pos&&e+1+n>r))break;t=e}return yield Ty,yield*h(this.pushToIndex(t+1,!0)),yield*h(this.parseLineStart())}*parsePlainScalar(){const e=this.flowLevel>0;let t,n=this.pos-1,s=this.pos-1;for(;t=this.buffer[++s];)if(":"===t){const t=this.buffer[s+1];if(Ny(t)||e&&","===t)break;n=s}else if(Ny(t)){let r=this.buffer[s+1];if("\r"===t&&("\n"===r?(s+=1,t="\n",r=this.buffer[s+1]):n=s),"#"===r||e&&Ry.includes(r))break;if("\n"===t){const e=this.continueScalar(s+1);if(-1===e)break;s=Math.max(s,e-2)}}else{if(e&&Ry.includes(t))break;n=s}return t||this.atEnd?(yield Ty,yield*h(this.pushToIndex(n+1,!0)),e?"flow":"doc"):this.setNext("plain-scalar")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,t){const n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.length):(t&&(yield""),0)}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*h(this.pushTag()))+(yield*h(this.pushSpaces(!0)))+(yield*h(this.pushIndicators()));case"&":return(yield*h(this.pushUntil(Dy)))+(yield*h(this.pushSpaces(!0)))+(yield*h(this.pushIndicators()));case"-":case"?":case":":{const e=this.flowLevel>0,t=this.charAt(1);if(Ny(t)||e&&Ry.includes(t))return e?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,(yield*h(this.pushCount(1)))+(yield*h(this.pushSpaces(!0)))+(yield*h(this.pushIndicators()))}}return 0}*pushTag(){if("<"===this.charAt(1)){let e=this.pos+2,t=this.buffer[e];for(;!Ny(t)&&">"!==t;)t=this.buffer[++e];return yield*h(this.pushToIndex(">"===t?e+1:e,!1))}{let e=this.pos+1,t=this.buffer[e];for(;t;)if(Py.includes(t))t=this.buffer[++e];else{if("%"!==t||!Iy.includes(this.buffer[e+1])||!Iy.includes(this.buffer[e+2]))break;t=this.buffer[e+=3]}return yield*h(this.pushToIndex(e,!1))}}*pushNewline(){const e=this.buffer[this.pos];return"\n"===e?yield*h(this.pushCount(1)):"\r"===e&&"\n"===this.charAt(1)?yield*h(this.pushCount(2)):0}*pushSpaces(e){let t,n=this.pos-1;do{t=this.buffer[++n]}while(" "===t||e&&"\t"===t);const s=n-this.pos;return s>0&&(yield this.buffer.substr(this.pos,s),this.pos=n),s}*pushUntil(e){let t=this.pos,n=this.buffer[t];for(;!e(n);)n=this.buffer[++t];return yield*h(this.pushToIndex(t,!1))}}class Fy{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,n=this.lineStarts.length;for(;t<n;){const s=t+n>>1;this.lineStarts[s]<e?t=s+1:n=s}if(this.lineStarts[t]===e)return{line:t+1,col:1};if(0===t)return{line:0,col:e};return{line:t,col:e-this.lineStarts[t-1]+1}}}}function jy(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function By(e){for(let t=0;t<e.length;++t)switch(e[t].type){case"space":case"comment":case"newline":break;default:return t}return-1}function qy(e){switch(null==e?void 0:e.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function Wy(e){var t;switch(e.type){case"document":return e.start;case"block-map":{const n=e.items[e.items.length-1];return null!=(t=n.sep)?t:n.start}case"block-seq":return e.items[e.items.length-1].start;default:return[]}}function Hy(e){var t;if(0===e.length)return[];let n=e.length;e:for(;--n>=0;)switch(e[n].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;"space"===(null==(t=e[++n])?void 0:t.type););return e.splice(n,e.length)}function Vy(e){if("flow-seq-start"===e.start.type)for(const t of e.items)!t.sep||t.value||jy(t.start,"explicit-key-ind")||jy(t.sep,"map-value-ind")||(t.key&&(t.value=t.key),delete t.key,qy(t.value)?t.value.end?Array.prototype.push.apply(t.value.end,t.sep):t.value.end=t.sep:Array.prototype.push.apply(t.start,t.sep),delete t.sep)}class Ky{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new Uy,this.onNewLine=e}*parse(e,t=!1){this.onNewLine&&0===this.offset&&this.onNewLine(0);for(const n of this.lexer.lex(e,t))yield*h(this.next(n));t||(yield*h(this.end()))}*next(e){if(this.source=e,this.atScalar)return this.atScalar=!1,yield*h(this.step()),void(this.offset+=e.length);const t=Ly(e);if(t)if("scalar"===t)this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=t,yield*h(this.step()),t){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case"space":this.atNewLine&&" "===e[0]&&(this.indent+=e.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=e.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}else{const t=`Not a YAML token: ${e}`;yield*h(this.pop({type:"error",offset:this.offset,message:t,source:e})),this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*h(this.pop())}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){const e=this.peek(1);if("doc-end"!==this.type||e&&"doc-end"===e.type){if(!e)return yield*h(this.stream());switch(e.type){case"document":return yield*h(this.document(e));case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*h(this.scalar(e));case"block-scalar":return yield*h(this.blockScalar(e));case"block-map":return yield*h(this.blockMap(e));case"block-seq":return yield*h(this.blockSequence(e));case"flow-collection":return yield*h(this.flowCollection(e));case"doc-end":return yield*h(this.documentEnd(e))}yield*h(this.pop())}else{for(;this.stack.length>0;)yield*h(this.pop());this.stack.push({type:"doc-end",offset:this.offset,source:this.source})}}peek(e){return this.stack[this.stack.length-e]}*pop(e){const t=null!=e?e:this.stack.pop();if(t)if(0===this.stack.length)yield t;else{const e=this.peek(1);switch("block-scalar"===t.type?t.indent="indent"in e?e.indent:0:"flow-collection"===t.type&&"document"===e.type&&(t.indent=0),"flow-collection"===t.type&&Vy(t),e.type){case"document":e.value=t;break;case"block-scalar":e.props.push(t);break;case"block-map":{const n=e.items[e.items.length-1];if(n.value)return e.items.push({start:[],key:t,sep:[]}),void(this.onKeyLine=!0);if(!n.sep)return Object.assign(n,{key:t,sep:[]}),void(this.onKeyLine=!jy(n.start,"explicit-key-ind"));n.value=t;break}case"block-seq":{const n=e.items[e.items.length-1];n.value?e.items.push({start:[],value:t}):n.value=t;break}case"flow-collection":{const n=e.items[e.items.length-1];return void(!n||n.value?e.items.push({start:[],key:t,sep:[]}):n.sep?n.value=t:Object.assign(n,{key:t,sep:[]}))}default:yield*h(this.pop()),yield*h(this.pop(t))}if(!("document"!==e.type&&"block-map"!==e.type&&"block-seq"!==e.type||"block-map"!==t.type&&"block-seq"!==t.type)){const n=t.items[t.items.length-1];n&&!n.sep&&!n.value&&n.start.length>0&&-1===By(n.start)&&(0===t.indent||n.start.every((e=>"comment"!==e.type||e.indent<t.indent)))&&("document"===e.type?e.end=n.start:e.items.push({start:n.start}),t.items.splice(-1,1))}}else{const e="Tried to pop an empty stack";yield{type:"error",offset:this.offset,source:"",message:e}}}*stream(){switch(this.type){case"directive-line":return void(yield{type:"directive",offset:this.offset,source:this.source});case"byte-order-mark":case"space":case"comment":case"newline":return void(yield this.sourceToken);case"doc-mode":case"doc-start":{const e={type:"document",offset:this.offset,start:[]};return"doc-start"===this.type&&e.start.push(this.sourceToken),void this.stack.push(e)}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*h(this.lineEnd(e));switch(this.type){case"doc-start":return void(-1!==By(e.start)?(yield*h(this.pop()),yield*h(this.step())):e.start.push(this.sourceToken));case"anchor":case"tag":case"space":case"comment":case"newline":return void e.start.push(this.sourceToken)}const t=this.startBlockValue(e);t?this.stack.push(t):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if("map-value-ind"===this.type){const t=Hy(Wy(this.peek(2)));let n;e.end?(n=e.end,n.push(this.sourceToken),delete e.end):n=[this.sourceToken];const s={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:t,key:e,sep:n}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=s}else yield*h(this.lineEnd(e))}*blockScalar(e){switch(this.type){case"space":case"comment":case"newline":return void e.props.push(this.sourceToken);case"scalar":if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let e=this.source.indexOf("\n")+1;for(;0!==e;)this.onNewLine(this.offset+e),e=this.source.indexOf("\n",e)+1}yield*h(this.pop());break;default:yield*h(this.pop()),yield*h(this.step())}}*blockMap(e){var t;const n=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,n.value){const t="end"in n.value?n.value.end:void 0,s=Array.isArray(t)?t[t.length-1]:void 0;"comment"===(null==s?void 0:s.type)?null==t||t.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)e.items.push({start:[this.sourceToken]});else if(n.sep)n.sep.push(this.sourceToken);else{if(this.atIndentedComment(n.start,e.indent)){const s=e.items[e.items.length-2],r=null==(t=null==s?void 0:s.value)?void 0:t.end;if(Array.isArray(r))return Array.prototype.push.apply(r,n.start),r.push(this.sourceToken),void e.items.pop()}n.start.push(this.sourceToken)}return}if(this.indent>=e.indent){const t=!this.onKeyLine&&this.indent===e.indent&&n.sep&&"seq-item-ind"!==this.type;let s=[];if(t&&n.sep&&!n.value){const t=[];for(let s=0;s<n.sep.length;++s){const r=n.sep[s];switch(r.type){case"newline":t.push(s);break;case"space":break;case"comment":r.indent>e.indent&&(t.length=0);break;default:t.length=0}}t.length>=2&&(s=n.sep.splice(t[1]))}switch(this.type){case"anchor":case"tag":return void(t||n.value?(s.push(this.sourceToken),e.items.push({start:s}),this.onKeyLine=!0):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken));case"explicit-key-ind":return n.sep||jy(n.start,"explicit-key-ind")?t||n.value?(s.push(this.sourceToken),e.items.push({start:s})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]}):n.start.push(this.sourceToken),void(this.onKeyLine=!0);case"map-value-ind":if(jy(n.start,"explicit-key-ind"))if(n.sep)if(n.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(jy(n.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]});else if(qy(n.key)&&!jy(n.sep,"newline")){const e=Hy(n.start),t=n.key,s=n.sep;s.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:e,key:t,sep:s}]})}else s.length>0?n.sep=n.sep.concat(s,this.sourceToken):n.sep.push(this.sourceToken);else if(jy(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{const e=Hy(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:e,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||t?e.items.push({start:s,key:null,sep:[this.sourceToken]}):jy(n.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});return void(this.onKeyLine=!0);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const r=this.flowScalar(this.type);return void(t||n.value?(e.items.push({start:s,key:r,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(r):(Object.assign(n,{key:r,sep:[]}),this.onKeyLine=!0))}default:{const r=this.startBlockValue(e);if(r)return t&&"block-seq"!==r.type&&jy(n.start,"explicit-key-ind")&&e.items.push({start:s}),void this.stack.push(r)}}}yield*h(this.pop()),yield*h(this.step())}*blockSequence(e){var t;const n=e.items[e.items.length-1];switch(this.type){case"newline":if(n.value){const t="end"in n.value?n.value.end:void 0,s=Array.isArray(t)?t[t.length-1]:void 0;"comment"===(null==s?void 0:s.type)?null==t||t.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(n.start,e.indent)){const s=e.items[e.items.length-2],r=null==(t=null==s?void 0:s.value)?void 0:t.end;if(Array.isArray(r))return Array.prototype.push.apply(r,n.start),r.push(this.sourceToken),void e.items.pop()}n.start.push(this.sourceToken)}return;case"anchor":case"tag":if(n.value||this.indent<=e.indent)break;return void n.start.push(this.sourceToken);case"seq-item-ind":if(this.indent!==e.indent)break;return void(n.value||jy(n.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken))}if(this.indent>e.indent){const t=this.startBlockValue(e);if(t)return void this.stack.push(t)}yield*h(this.pop()),yield*h(this.step())}*flowCollection(e){const t=e.items[e.items.length-1];if("flow-error-end"===this.type){let e;do{yield*h(this.pop()),e=this.peek(1)}while(e&&"flow-collection"===e.type)}else if(0===e.end.length){switch(this.type){case"comma":case"explicit-key-ind":return void(!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken));case"map-value-ind":return void(!t||t.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]}));case"space":case"comment":case"newline":case"anchor":case"tag":return void(!t||t.value?e.items.push({start:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken));case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const n=this.flowScalar(this.type);return void(!t||t.value?e.items.push({start:[],key:n,sep:[]}):t.sep?this.stack.push(n):Object.assign(t,{key:n,sep:[]}))}case"flow-map-end":case"flow-seq-end":return void e.end.push(this.sourceToken)}const n=this.startBlockValue(e);n?this.stack.push(n):(yield*h(this.pop()),yield*h(this.step()))}else{const t=this.peek(2);if("block-map"===t.type&&("map-value-ind"===this.type&&t.indent===e.indent||"newline"===this.type&&!t.items[t.items.length-1].sep))yield*h(this.pop()),yield*h(this.step());else if("map-value-ind"===this.type&&"flow-collection"!==t.type){const n=Hy(Wy(t));Vy(e);const s=e.end.splice(1,e.end.length);s.push(this.sourceToken);const r={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:n,key:e,sep:s}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=r}else yield*h(this.lineEnd(e))}}flowScalar(e){if(this.onNewLine){let e=this.source.indexOf("\n")+1;for(;0!==e;)this.onNewLine(this.offset+e),e=this.source.indexOf("\n",e)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const t=Hy(Wy(e));return t.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:t}]}}case"map-value-ind":{this.onKeyLine=!0;const t=Hy(Wy(e));return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:t,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return"comment"===this.type&&(!(this.indent<=t)&&e.every((e=>"newline"===e.type||"space"===e.type)))}*documentEnd(e){"doc-mode"!==this.type&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],"newline"===this.type&&(yield*h(this.pop())))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*h(this.pop()),yield*h(this.step());break;case"newline":this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],"newline"===this.type&&(yield*h(this.pop()))}}}function zy(e){const t=!1!==e.prettyErrors;return{lineCounter:e.lineCounter||t&&new Fy||null,prettyErrors:t}}function Gy(e,t={}){const{lineCounter:n,prettyErrors:s}=zy(t),r=new Ky(null==n?void 0:n.addNewLine),i=new gy(t);let o=null;for(const a of i.compose(r.parse(e),!0,e.length))if(o){if("silent"!==o.options.logLevel){o.errors.push(new Vv(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}}else o=a;return s&&n&&(o.errors.forEach(zv(e,n)),o.warnings.forEach(zv(e,n))),o}const Yy=Object.freeze(Object.defineProperty({__proto__:null,Alias:sg,CST:Oy,Composer:gy,Document:qv,Lexer:Uy,LineCounter:Fy,Pair:Rg,Parser:Ky,Scalar:og,Schema:Bv,YAMLError:Hv,YAMLMap:Bg,YAMLParseError:Vv,YAMLSeq:Wg,YAMLWarning:Kv,isAlias:Lm,isCollection:Mm,isDocument:Om,isMap:Nm,isNode:Dm,isPair:Im,isScalar:Pm,isSeq:Rm,parse:function(e,t,n){let s;"function"==typeof t?s=t:void 0===n&&t&&"object"==typeof t&&(n=t);const r=Gy(e,n);if(!r)return null;if(r.warnings.forEach((e=>Lg(r.options.logLevel,e))),r.errors.length>0){if("silent"!==r.options.logLevel)throw r.errors[0];r.errors=[]}return r.toJS(Object.assign({reviver:s},n))},parseAllDocuments:function(e,t={}){const{lineCounter:n,prettyErrors:s}=zy(t),r=new Ky(null==n?void 0:n.addNewLine),i=new gy(t),o=Array.from(i.compose(r.parse(e)));if(s&&n)for(const a of o)a.errors.forEach(zv(e,n)),a.warnings.forEach(zv(e,n));return o.length>0?o:Object.assign([],{empty:!0},i.streamInfo())},parseDocument:Gy,stringify:function(e,t,n){var s;let r=null;if("function"==typeof t||Array.isArray(t)?r=t:void 0===n&&t&&(n=t),"string"==typeof n&&(n=n.length),"number"==typeof n){const e=Math.round(n);n=e<1?void 0:e>8?{indent:8}:{indent:e}}if(void 0===e){const{keepUndefined:e}=null!=(s=null!=n?n:t)?s:{};if(!e)return}return new qv(e,r,n).toString(n)},visit:qm,visitAsync:Hm},Symbol.toStringTag,{value:"Module"}));function Qy(e){var t;const n={name:"",path:"",title:"",level:0,type:"object",items:[]},s=(e,t=n,r=[],i)=>{e.forEach(((e,n)=>{var o,a,u;const d=null==(o=e.key)?void 0:o.value,p=(null==(a=e.value)?void 0:a.toJSON)?e.value.toJSON():void 0;if(!d)return;const h=[...r,d],f=function(e,t,n){var s,r;let i="";return i=0===t&&n?(null==(s=null==n?void 0:n.value)?void 0:s.commentBefore)||"":(null==(r=null==e?void 0:e.key)?void 0:r.commentBefore)||"",i}(e,n,i),m=(Array.isArray(p)?"array":["string","number","boolean","object"].find((e=>typeof p===e)))||void 0;if(!m)return;const g="object"!==m?p:void 0,v=c(l({name:d,path:h.join("."),level:t?t.level+1:0},function(e,t){t=t.trim(),t=t.replace(/--(.*?)--/gm,"");let n,s="",r="";const i=/\(.*?\)/gm;s=t.replace(i,"").trim();const o=i.exec(t);r=o?o[0].substring(1,o[0].length-1):"",s||(s=e.toLowerCase().replace(/([_][a-z]|^[a-z])/g,(e=>e.slice(-1).toUpperCase())));const a=/\[.*?\]/gm,l=a.exec(s);if(l){try{n=JSON.parse(l[0])}catch(c){console.error(c)}s=s.replace(a,"").trim()}return{title:s,subTitle:r,selector:n}}(d,f)),{default:g,type:m});"object"===m&&(null==(u=e.value)?void 0:u.items)&&(v.items=[],s(e.value.items,v,h,e)),t.items||(t.items=[]),t.items.push(v)}))};return s(null==(t=e.contents)?void 0:t.items),n}function Xy(e,t){switch(t.type){case"boolean":"true"===e?e=!0:"false"===e&&(e=!1);break;case"string":t.selector||(e=String(e).trim());break;case"number":isNaN(Number(e))||(e=Number(e));break;case"array":Array.isArray(e)&&(e=e.map((e=>"string"==typeof e?e.trim():e)))}return e}class Jy{constructor(e){u(this,"tree"),u(this,"flatten"),u(this,"customs",Dt()),this.tree=Qy(e),this.flatten=function(e){const t={},n=e=>{t[e.path]=e,e.items&&e.items.forEach(n)};return n(e),t}(this.tree)}getTree(){return this.tree}getNode(e){return this.flatten[e]}getCustoms(){return this.customs}setCustoms(e){this.customs.value=Yy.parseDocument(e)}getCustom(e){var t;return null==(t=this.customs.value)?void 0:t.getIn(e.split("."))}setCustom(e,t){var n;const s=e.split(".");this.makeSureObject(s),null==(n=this.customs.value)||n.setIn(s,t)}makeSureObject(e){var t,n;for(let s=e.length-1;s>=1;s--){const r=e.slice(0,-s);(null==(t=this.customs.value)?void 0:t.getIn(r))||null==(n=this.customs.value)||n.setIn(r,new Yy.YAMLMap)}}}let Zy;const ek=e=>Zy=new Jy(e),tk=()=>Zy,nk={class:"arr-grp"},sk=["value","onChange"],rk=["onClick"],ik={class:"act-grp"},ok=wf(Jn({__name:"PreferenceArr",props:{node:{}},setup(e){const t=e,n=Mt([]);function s(){const e=Xy(n.value,t.node);tk().setCustom(t.node.path,e)}return ls((()=>{!function(){const e=tk().getCustom(t.node.path);n.value=e&&"function"==typeof e.toJSON?e.toJSON():[]}()})),(e,t)=>(kr(),Er("div",nk,[(kr(!0),Er(hr,null,vs(jt(n),((e,t)=>(kr(),Er("div",{key:t,class:"arr-item"},[Tr("input",{type:"text",value:String(e),onChange:e=>function(e,t){n.value[e]=t,s()}(t,e.target.value)},null,40,sk),Tr("button",{class:"act-btn",onClick:e=>function(e){n.value.splice(e,1),s()}(t)},"-",8,rk)])))),128)),Tr("div",ik,[Tr("button",{class:"act-btn",onClick:t[0]||(t[0]=e=>(n.value.push(""),void s()))},"+")])]))}}),[["__scopeId","data-v-d883e604"]]),ak={class:"pf-item"},lk={class:"info"},ck={class:"title"},uk={key:0,class:"sub-title"},dk={class:"value"},pk=["value"],hk=wf(Jn({__name:"PreferenceItem",props:{node:{}},setup(e){const t=e,n=Mt("");function s(){const e=Xy(n.value,t.node);tk().setCustom(t.node.path,e)}return as((()=>{n.value=tk().getCustom(t.node.path)})),(e,t)=>{const r=ok;return kr(),Er("div",ak,[Tr("div",lk,[Tr("div",ck,ue(e.node.title),1),e.node.subTitle?(kr(),Er("div",uk,ue(e.node.subTitle),1)):Ir("",!0)]),Tr("div",dk,["array"===e.node.type?(kr(),xr(r,{key:0,node:e.node},null,8,["node"])):e.node.selector?Fn((kr(),Er("select",{key:1,"onUpdate:modelValue":t[0]||(t[0]=e=>Rt(n)?n.value=e:null),onChange:s},[(kr(!0),Er(hr,null,vs(e.node.selector,((e,t)=>(kr(),Er("option",{key:t,value:e},ue(e),9,pk)))),128))],544)),[[zi,jt(n)]]):"boolean"===e.node.type?Fn((kr(),Er("input",{key:2,"onUpdate:modelValue":t[1]||(t[1]=e=>Rt(n)?n.value=e:null),type:"checkbox",onChange:s},null,544)),[[Vi,jt(n)]]):Fn((kr(),Er("input",{key:3,"onUpdate:modelValue":t[2]||(t[2]=e=>Rt(n)?n.value=e:null),type:"text",onChange:s},null,544)),[[Hi,jt(n)]])])])}}}),[["__scopeId","data-v-c1bb48a4"]]),fk={class:"title"},mk={key:0,class:"sub-title"},gk={class:"pf-body"},vk=wf(Jn({__name:"PreferenceGrp",props:{node:{}},setup(e){const t=e,n=Mt(!0),s=ei((()=>1===t.node.level&&("object"===t.node.type||"array"===t.node.type)));function r(e){s.value&&(n.value?n.value=!1:n.value=!0)}ls((()=>{s.value&&(n.value=!1)}));const i=["admin_users"];return(e,t)=>{const s=$n("PreferenceGrp",!0),o=hk;return i.includes(e.node.name)?Ir("",!0):(kr(),Er("div",{key:0,class:ie(["pf-grp",[`level-${e.node.level}`,jt(n)?"expand":""]])},[e.node.level>0&&("object"===e.node.type||"array"===e.node.type)?(kr(),Er("div",{key:0,class:"pf-head",onClick:r},[Tr("div",fk,ue(e.node.title),1),e.node.subTitle?(kr(),Er("div",mk,ue(e.node.subTitle),1)):Ir("",!0)])):Ir("",!0),Fn(Tr("div",gk,[e.node.items?(kr(!0),Er(hr,{key:0},vs(e.node.items,(e=>(kr(),xr(s,{key:e.path,node:e},null,8,["node"])))),128)):(kr(),xr(o,{key:1,node:e.node},null,8,["node"]))],512),[[Ei,jt(n)]])],2))}}}),[["__scopeId","data-v-c898b3e2"]]),yk=e=>(wn("data-v-3fbb97ec"),e=e(),_n(),e),kk={class:"settings"},bk={class:"act-bar"},wk=yk((()=>Tr("div",{class:"status-text"},null,-1))),_k=yk((()=>Tr("i",{class:"atk-icon atk-icon-yes"},null,-1))),Ek={key:0,class:"pfs"},xk={class:"notice"},Sk=wf(Jn({__name:"settings",setup(e){const t=af(),n=I_(),{t:s}=Tc(),{curtTab:r}=yo(t),i=Mt(!1),o=Dt();return ls((()=>{t.updateTabs({sites:"site",transfer:"transfer"}),Pn(r,(e=>{"sites"===e?n.replace("/sites"):"transfer"===e&&n.replace("/transfer")})),Promise.all([ef.ctx.getApi().settings.getSettingsTemplate(""),ef.ctx.getApi().settings.getSettings()]).then((([e,t])=>{const n=Yy.parseDocument(e.data.yaml);o.value=ek(n).getTree(),tk().setCustoms(t.data.yaml)}))})),(e,t)=>{const n=vk;return kr(),Er("div",kk,[Tr("div",bk,[wk,Tr("button",{class:"save-btn",onClick:t[0]||(t[0]=e=>function(){var e;let t="";try{t=(null==(e=tk().getCustoms().value)?void 0:e.toString())||""}catch(n){return alert("YAML export error: "+n),void console.error(n)}t?i.value||(i.value=!0,ef.ctx.getApi().settings.applySettings({yaml:t}).then((()=>{alert(s("settingSaved"))})).catch((e=>{console.error(e),alert(s("settingSaveFailed")+": "+e)})).finally((()=>{i.value=!1}))):alert("YAML export error: data is empty")}())},[_k,Nr(" "+ue(jt(s)("apply")),1)]),jt(i)?(kr(),xr(Yf,{key:0})):Ir("",!0)]),o.value?(kr(),Er("div",Ek,[Lr(n,{node:o.value},null,8,["node"]),Tr("div",xk,ue(jt(s)("settingNotice")),1)])):Ir("",!0)])}}}),[["__scopeId","data-v-3fbb97ec"]]),Ck={class:"atk-site-edit"},Ak={class:"atk-header"},$k={class:"atk-site-info"},Tk={class:"atk-site-urls"},Lk=["onClick"],Ok=[Tr("i",{class:"atk-icon atk-icon-close"},null,-1)],Nk={class:"atk-main"},Ik={class:"atk-site-text-actions"},Pk={class:"atk-site-btn-actions"},Rk=[Tr("i",{class:"atk-icon atk-icon-del"},null,-1)],Mk=Jn({__name:"SiteEditor",props:{site:{}},emits:["close","update","remove"],setup(e,{emit:t}){const n=e,s=t,{site:r}=Wt(n),i=Mt(!1),o=Mt(null),a=ei((()=>"urls"===o.value?r.value.urls_raw||"":String(o.value&&r.value[o.value]||""))),{t:u}=Tc();function p(e){window.open(e)}function h(e){return d(this,null,(function*(){if(o.value){if(a.value!==e){let n;i.value=!0;try{let t=e;Array.isArray(r.value[o.value])&&(t=e.split(",").map((e=>e.trim())).filter((e=>!!e))),n=(yield ef.ctx.getApi().sites.updateSite(r.value.id,c(l({},r.value),{[o.value]:t}))).data}catch(t){return alert(`修改失败:${t.message||"未知错误"}`),console.error(t),!1}finally{i.value=!1}s("update",n)}return o.value=null,!0}}))}function f(){o.value=null}return(e,t)=>{const n=Yf,l=Kf;return kr(),Er("div",Ck,[Tr("div",Ak,[Tr("div",$k,[Tr("span",{class:"atk-site-name",onClick:t[0]||(t[0]=e=>!jt(r).first_url||p(jt(r).first_url))},ue(jt(r).name),1),Tr("span",Tk,[(kr(!0),Er(hr,null,vs(jt(r).urls,((e,t)=>(kr(),Er("div",{key:t,class:"atk-url-item",onClick:t=>p(e)},ue(e),9,Lk)))),128))])]),Tr("div",{class:"atk-close-btn",onClick:t[1]||(t[1]=e=>{s("close")})},Ok)]),Tr("div",Nk,[Tr("div",Ik,[Tr("div",{class:"atk-item atk-rename-btn",onClick:t[2]||(t[2]=e=>{o.value="name"})},ue(jt(u)("rename")),1),Tr("div",{class:"atk-item atk-edit-url-btn",onClick:t[3]||(t[3]=e=>{o.value="urls"})},ue(jt(u)("edit"))+" URL",1)]),Tr("div",Pk,[Tr("div",{class:"atk-item atk-del-btn",onClick:t[4]||(t[4]=e=>function(){window.confirm(`确认删除站点 "${r.value.name}"?将会删除所有相关数据`)&&(()=>{d(this,null,(function*(){i.value=!0;try{yield ef.ctx.getApi().sites.deleteSite(r.value.id)}catch(e){return console.error(e),void alert(`删除失败 ${String(e)}`)}finally{i.value=!1}s("remove",r.value.id)}))})()}())},Rk)]),jt(i)?(kr(),xr(n,{key:0,style:{"z-index":"1000"}})):Ir("",!0),jt(o)?(kr(),xr(l,{key:1,"init-value":jt(a),onYes:h,onNo:f},null,8,["init-value"])):Ir("",!0)])])}}}),Dk={class:"atk-site-add"},Uk={class:"atk-header"},Fk={class:"atk-title"},jk=[Tr("i",{class:"atk-icon atk-icon-close"},null,-1)],Bk=["placeholder"],qk=["placeholder"],Wk={type:"submit",class:"atk-btn",name:"AtkSubmit"},Hk=Jn({__name:"SiteCreate",props:{initVal:{}},emits:["close","done"],setup(e,{emit:t}){const{t:n}=Tc(),s=e,r=t,i=Mt(!1),o=Mt({name:"",urls:""});return ls((()=>{var e,t;o.value.name=(null==(e=s.initVal)?void 0:e.name)||"",o.value.urls=(null==(t=s.initVal)?void 0:t.urls)||""})),(e,t)=>{const s=Yf;return kr(),Er("div",Dk,[Tr("div",Uk,[Tr("div",Fk,ue(jt(n)("createSite")),1),Tr("div",{class:"atk-close-btn",onClick:t[0]||(t[0]=e=>{r("close")})},jk)]),Tr("form",{class:"atk-form",onSubmit:t[3]||(t[3]=Zi((e=>function(){return d(this,null,(function*(){const e=o.value.name.trim(),t=o.value.urls.trim().split(",").map((e=>e.trim())).filter((e=>!!e));if(""===e)return void alert("请输入站点名称");let n;i.value=!0;try{n=(yield ef.ctx.getApi().sites.createSite({name:e,urls:t})).data}catch(s){return window.alert(`创建失败:${s.message||""}`),void console.error(s)}finally{i.value=!1}r("done",n)}))}()),["prevent"]))},[Fn(Tr("input",{"onUpdate:modelValue":t[1]||(t[1]=e=>jt(o).name=e),type:"text",name:"AtkSiteName",placeholder:jt(n)("siteName"),autocomplete:"off"},null,8,Bk),[[Hi,jt(o).name]]),Fn(Tr("input",{"onUpdate:modelValue":t[2]||(t[2]=e=>jt(o).urls=e),type:"text",name:"AtkSiteUrls",placeholder:`${jt(n)("siteUrls")} (${jt(n)("multiSepHint")})`,autocomplete:"off"},null,8,qk),[[Hi,jt(o).urls]]),Tr("button",Wk,ue(jt(n)("add")),1)],32),jt(i)?(kr(),xr(s,{key:0})):Ir("",!0)])}}}),Vk={class:"atk-site-list"},Kk={class:"atk-header"},zk={class:"atk-title"},Gk={class:"atk-actions"},Yk=[(e=>(wn("data-v-fbca3931"),e=e(),_n(),e))((()=>Tr("i",{class:"atk-icon atk-icon-plus"},null,-1)))],Qk={class:"atk-site-rows-wrap"},Xk={class:"atk-site-row"},Jk=["onClick"],Zk={class:"atk-site-logo"},eb={class:"atk-site-name"},tb=wf(Jn({__name:"sites",setup(e){const t=af(),n=Mt([]),s=Mt(null),r=Mt(!1),i=Mt(),{t:o}=Tc();ls((()=>{t.updateTabs({},"sites"),t.setPageLoading(!0),null==ef||ef.ctx.getApi().sites.getSites().then((e=>{n.value=e.data.sites})).finally((()=>{t.setPageLoading(!1)}));const e=nf.viewParams;e&&e.create_name&&e.create_urls&&(i.value={name:e.create_name,urls:e.create_urls},r.value=!0,an((()=>{i.value=null,nf.viewParams=null})))}));const a=ei((()=>{if(0===n.value.length)return[];const e=[];let t=-1;for(let s=0;s<n.value.length;s++){const r=n.value[s];s%4==0&&(e.push([]),t++),e[t].push(r)}return e}));function l(e){n.value.push(e),r.value=!1,t.refreshSites()}function c(e){const s=n.value.findIndex((t=>t.id===e.id));if(-1!=s){const t=n.value[s];Object.keys(e).forEach((n=>{t[n]=e[n]}))}t.refreshSites()}function u(e){const s=n.value.findIndex((t=>t.id===e));n.value.splice(s,1),t.refreshSites()}return(e,t)=>{const d=Hk,p=Mk;return kr(),Er("div",Vk,[Tr("div",Kk,[Tr("div",zk,ue(jt(o)("siteCount",{count:jt(n).length})),1),Tr("div",Gk,[Tr("div",{class:"atk-item atk-site-add-btn",onClick:t[0]||(t[0]=e=>(s.value=null,void(r.value=!0)))},Yk)])]),jt(r)?(kr(),xr(d,{key:0,"init-val":jt(i),onClose:t[1]||(t[1]=e=>r.value=!1),onDone:l},null,8,["init-val"])):Ir("",!0),Tr("div",Qk,[(kr(!0),Er(hr,null,vs(jt(a),((e,n)=>(kr(),Er(hr,{key:n},[null!==jt(s)?(kr(),Er(hr,{key:0},[e.includes(jt(s))?(kr(),xr(p,{key:0,site:jt(s),onClose:t[2]||(t[2]=e=>s.value=null),onUpdate:c,onRemove:u},null,8,["site"])):Ir("",!0)],64)):Ir("",!0),Tr("div",Xk,[(kr(!0),Er(hr,null,vs(e,(e=>(kr(),Er("div",{key:e.id,class:ie(["atk-site-item",{"atk-active":jt(s)===e}]),onClick:t=>function(e){r.value=!1,s.value=e}(e)},[Tr("div",Zk,ue(e.name.substring(0,1)),1),Tr("div",eb,ue(e.name),1)],10,Jk)))),128))])],64)))),128))])])}}}),[["__scopeId","data-v-fbca3931"]]),nb={class:"atk-file-upload-group"},sb={class:"atk-file-input-wrap atk-fade-in"},rb={class:"atk-desc"},ib={class:"atk-uploading-wrap atk-fade-in"},ob={class:"atk-progress"},ab={class:"atk-status"},lb={class:"atk-curt"},cb=Jn({__name:"FileUploader",props:{apiUrl:{}},emits:["done"],setup(e,{emit:t}){const n=bf(),s=e,r=t,{apiUrl:i}=Wt(s);let o=null;const a=Mt(null),l=Mt(""),c=Mt(!1),u=Mt(0),p=Mt(!1);function h(){l.value="",c.value=!1,u.value=0,p.value=!1,a.value&&(a.value.value="")}function f(){var e;const t=null==(e=a.value)?void 0:e.files;t&&0!==t.length&&(c.value=!0,setTimeout((()=>d(this,null,(function*(){yield function(e){return d(this,null,(function*(){l.value="",o=new XMLHttpRequest,o.upload.addEventListener("progress",(t=>{if(t.loaded===t.total)return void(u.value=100);const n=e.size;t.loaded<=n&&(u.value=Math.round(t.loaded/n*100))}));const t=new FormData;t.append("file",e),t.append("token",n.token),o.open("post",i.value),o.timeout=3e5,o.send(t),o.onload=()=>{const e=e=>{h(),c.value=!1,alert(`File upload failed: ${e}`)};if(!o)return void e("xhr instance is null");if(!(o.status>=200&&o.status<=299))return void e(`Response HTTP Code: ${o.status}, Body: ${o.response}`);let t;try{t=JSON.parse(o.response)}catch(n){return console.error(n),void e(`JSON parse error: ${n}`)}t.filename?(p.value=!0,l.value=t.filename,c.value=!1,r("done",l.value)):e(`Response filename is empty: ${o.response}`)}}))}(t[0]),c.value=!1}))),80))}return(e,t)=>(kr(),Er("div",nb,[Fn(Tr("div",sb,[Tr("input",{ref_key:"fileInputEl",ref:a,type:"file",name:"AtkDataFile",accept:".artrans",onChange:t[0]||(t[0]=e=>f())},null,544),Tr("div",rb,[jt(p)?Ir("",!0):ys(e.$slots,"tip",{key:0}),jt(p)?ys(e.$slots,"done-msg",{key:1}):Ir("",!0)])],512),[[Ei,!jt(c)]]),Fn(Tr("div",ib,[Tr("div",ob,[Tr("div",{class:"atk-bar",style:ee({width:`${jt(u)}%`})},null,4)]),Tr("div",ab,[Nr(" 上传中 "),Tr("span",lb,ue(jt(u))+"%",1),Nr(" ... "),Tr("span",{class:"atk-abort",onClick:t[1]||(t[1]=e=>(null==o||o.abort(),h(),void(c.value=!1)))},"取消")])],512),[[Ei,jt(c)]])]))}}),ub={class:"atk-log-wrap"},db=wf(Jn({__name:"LogTerminal",props:{apiUrl:{},reqParams:{}},emits:["back"],setup(e,{emit:t}){const n=e,s=t,r=Mt(null);return ls((()=>{const e="f_"+ +new Date,t=document.createElement("iframe");t.className="atk-iframe",t.name=e,r.value.append(t),t.onload=()=>{af().refreshSites()};const s=document.createElement("form");s.style.display="none",s.setAttribute("method","post"),s.setAttribute("action",n.apiUrl),s.setAttribute("target",e),Object.entries(n.reqParams).forEach((([e,t])=>{const n=document.createElement("input");n.setAttribute("type","hidden"),n.setAttribute("name",e),n.value=t,s.appendChild(n)})),r.value.append(s),s.submit(),s.remove()})),(e,t)=>(kr(),Er("div",ub,[Tr("div",{class:"atk-log-back-btn",onClick:t[0]||(t[0]=e=>{s("back")})},"返回"),Tr("div",{ref_key:"logWrapEl",ref:r,class:"atk-log"},null,512)]))}}),[["__scopeId","data-v-6f6a89d2"]]),pb={class:"atk-form"},hb={class:"atk-label atk-data-file-label"},fb=["innerHTML"],mb={class:"atk-label"},gb=["placeholder"],vb={class:"atk-label"},yb=["placeholder"],kb={class:"atk-label"},bb={class:"atk-desc"},wb={href:"https://artalk.js.org/guide/transfer.html",target:"_blank"},_b=Jn({__name:"transfer",setup(e){const t=af(),n=bf(),{curtTab:s}=yo(t),{t:r}=Tc(),i=Mt({siteName:"",siteURL:"",payload:""}),o=Mt(!1),a=Mt(""),u=Mt(""),p=Mt(""),h=Mt(!1),f=Mt({}),m=Mt(!1);function g(e){window.alert(e)}function v(e){p.value=e}function y(e,t){let n=e.toString();for(;n.length<t;)n=`0${n}`;return n}ls((()=>{t.updateTabs({import:"import",export:"export"},"import"),Pn(s,(e=>{"export"===e&&(!function(){d(this,null,(function*(){if(!m.value){m.value=!0,o.value=!0;try{const e=yield ef.ctx.getApi().transfer.exportArtrans();!function(e,t){const n=document.createElement("a");n.setAttribute("href",`data:text/json;charset=utf-8,${encodeURIComponent(t)}`),n.setAttribute("download",e),n.style.display="none",document.body.appendChild(n),n.click(),document.body.removeChild(n)}(`backup-${function(){const e=new Date,t=e.getFullYear(),n=e.getMonth()+1,s=e.getDate(),r=e.getHours(),i=e.getMinutes(),o=e.getSeconds();return`${t}${n}${s}-${r}${y(i,2)}${y(o,2)}`}()}.artrans`,e.data.artrans)}catch(e){return console.error(e),void window.alert(`${String(e)}`)}finally{m.value=!1,o.value=!1}}}))}(),s.value="import")})),a.value=`${null==ef?void 0:ef.ctx.conf.server}/api/v2/transfer/upload`,u.value=`${null==ef?void 0:ef.ctx.conf.server}/api/v2/transfer/import`}));const k=ei((()=>r("artransferToolHint",{link:"__LINK__"}).replace("__LINK__",`<a href="https://artalk.js.org/guide/transfer.html" target="_blank">${r("artransfer")}</a>`)));return(e,t)=>{const s=Yf,d=db,m=cb;return kr(),Er(hr,null,[jt(o)?(kr(),xr(s,{key:0})):Ir("",!0),jt(h)?(kr(),xr(d,{key:1,"api-url":jt(u),"req-params":jt(f),onBack:t[0]||(t[0]=e=>{h.value=!1})},null,8,["api-url","req-params"])):Ir("",!0),Fn(Tr("div",pb,[Tr("div",hb,"Artrans "+ue(jt(r)("dataFile")),1),Lr(m,{"api-url":jt(a),onDone:v},{tip:En((()=>[Tr("span",{innerHTML:jt(k)},null,8,fb)])),"done-msg":En((()=>[Nr(ue(jt(r)("uploadReadyToImport")),1)])),_:1},8,["api-url"]),Tr("div",mb,ue(jt(r)("targetSiteName")),1),Fn(Tr("input",{"onUpdate:modelValue":t[1]||(t[1]=e=>jt(i).siteName=e),type:"text",name:"AtkSiteName",placeholder:jt(r)("inputHint"),autocomplete:"off"},null,8,gb),[[Hi,jt(i).siteName]]),Tr("div",vb,ue(jt(r)("targetSiteURL")),1),Fn(Tr("input",{"onUpdate:modelValue":t[2]||(t[2]=e=>jt(i).siteURL=e),type:"text",name:"AtkSiteURL",placeholder:jt(r)("inputHint"),autocomplete:"off"},null,8,yb),[[Hi,jt(i).siteURL]]),Tr("div",kb,ue(jt(r)("payload"))+" ("+ue(jt(r)("optional"))+")",1),Fn(Tr("textarea",{"onUpdate:modelValue":t[3]||(t[3]=e=>jt(i).payload=e),name:"AtkPayload"},null,512),[[Hi,jt(i).payload]]),Tr("span",bb,[Tr("a",wb,ue(jt(r)("moreDetails")),1)]),Tr("button",{class:"atk-btn",name:"AtkSubmit",onClick:t[4]||(t[4]=e=>function(){if(!p.value)return void g("Please upload a data file first");const e=i.value,t=e.siteName.trim(),s=e.siteURL.trim(),r=e.payload.trim();let o={};if(r){try{o=JSON.parse(r)}catch(a){return void g(`Payload JSON invalid: ${a}`)}if("object"!=typeof o||Array.isArray(o))return void g("Payload should be an object")}t&&(o.target_site_name=t),s&&(o.target_site_url=s),o.json_file=p.value,f.value=c(l({},o),{token:n.token}),h.value=!0}())},ue(jt(r)("import")),1)],512),[[Ei,!jt(h)]])],64)}}}),Eb={class:"user-editor-layer"},xb={class:"header"},Sb={class:"title"},Cb=[(e=>(wn("data-v-e420485f"),e=e(),_n(),e))((()=>Tr("i",{class:"atk-icon atk-icon-close"},null,-1)))],Ab={key:0,class:"user-log"},$b={class:"atk-label required"},Tb={class:"atk-label required"},Lb={class:"atk-label"},Ob={class:"atk-label"},Nb={class:"atk-label"},Ib={class:"atk-label required"},Pb={value:!1},Rb={value:!0},Mb={class:"atk-label required"},Db=["placeholder"],Ub={class:"atk-label required"},Fb={value:!0},jb={value:!1},Bb={type:"submit",class:"atk-btn"},qb=wf(Jn({__name:"UserEditor",props:{user:{}},emits:["close","update"],setup(e,{emit:t}){const{t:n}=Tc(),s=e,r=t,i=Mt(),o=Mt(!1),a=Mt(!1),u=Mt(!1);return as((()=>{s.user?i.value=c(l({},s.user),{password:""}):(a.value=!0,i.value={id:0,name:"",email:"",link:"",password:"",badge_name:"",badge_color:"",is_admin:!1,receive_email:!0})})),(e,t)=>{const s=Yf;return kr(),Er("div",Eb,[Tr("div",xb,[Tr("div",Sb,ue(jt(a)?jt(n)("userCreate"):jt(n)("userEdit")),1),jt(a)?Ir("",!0):(kr(),Er("div",{key:0,class:"close-btn",onClick:t[0]||(t[0]=e=>{r("close")})},Cb))]),jt(a)?Ir("",!0):(kr(),Er("div",Ab,[Tr("div",null,[Tr("span",null,ue(jt(n)("comments")),1),Nr(" "+ue(jt(i).comment_count),1)]),Tr("div",null,[Tr("span",null,ue(jt(n)("last"))+" IP",1),Nr(" "+ue(jt(i).last_ip||"-"),1)]),Tr("div",null,[Tr("span",null,ue(jt(n)("last"))+" UA",1),jt(u)||!jt(i).last_ua?(kr(),Er(hr,{key:0},[Nr(ue(jt(i).last_ua||"-"),1)],64)):(kr(),Er("span",{key:1,style:{cursor:"pointer",color:"var(--at-color-main)"},onClick:t[1]||(t[1]=e=>u.value=!0)},ue(jt(n)("Show")),1))])])),jt(i)?(kr(),Er("form",{key:1,class:"atk-form",onSubmit:t[10]||(t[10]=Zi((e=>function(){if(o.value=!0,""!==i.value.badge_name&&""===i.value.badge_color&&(i.value.badge_color="#0083ff"),a.value)ef.ctx.getApi().users.createUser(l({},i.value)).then((e=>{r("update",e.data)})).catch((e=>{alert("用户创建错误:"+e.message)})).finally((()=>{o.value=!1}));else{const e=i.value;ef.ctx.getApi().users.updateUser(e.id,l({},i.value)).then((e=>{r("update",e.data)})).catch((e=>{alert("用户保存错误:"+e.message)})).finally((()=>{o.value=!1}))}}()),["prevent"]))},[Tr("div",$b,ue(jt(n)("username")),1),Fn(Tr("input",{"onUpdate:modelValue":t[2]||(t[2]=e=>jt(i).name=e),type:"text",placeholder:"",autocomplete:"off"},null,512),[[Hi,jt(i).name]]),Tr("div",Tb,ue(jt(n)("email")),1),Fn(Tr("input",{"onUpdate:modelValue":t[3]||(t[3]=e=>jt(i).email=e),type:"text",placeholder:"",autocomplete:"off"},null,512),[[Hi,jt(i).email]]),Tr("div",Lb,ue(jt(n)("link")),1),Fn(Tr("input",{"onUpdate:modelValue":t[4]||(t[4]=e=>jt(i).link=e),type:"text",placeholder:"",autocomplete:"off"},null,512),[[Hi,jt(i).link]]),Tr("div",Ob,ue(jt(n)("badgeText")),1),Fn(Tr("input",{"onUpdate:modelValue":t[5]||(t[5]=e=>jt(i).badge_name=e),type:"text",placeholder:"",autocomplete:"off"},null,512),[[Hi,jt(i).badge_name]]),Tr("div",Nb,ue(jt(n)("badgeColor"))+" (Color Hex)",1),Fn(Tr("input",{"onUpdate:modelValue":t[6]||(t[6]=e=>jt(i).badge_color=e),type:"text",placeholder:"",autocomplete:"off"},null,512),[[Hi,jt(i).badge_color]]),Tr("div",Ib,ue(jt(n)("role")),1),Fn(Tr("select",{"onUpdate:modelValue":t[7]||(t[7]=e=>jt(i).is_admin=e)},[Tr("option",Pb,ue(jt(n)("normal")),1),Tr("option",Rb,ue(jt(n)("admin")),1)],512),[[zi,jt(i).is_admin]]),jt(i).is_admin?(kr(),Er(hr,{key:0},[Tr("div",Mb,ue(jt(n)("password")),1),Fn(Tr("input",{"onUpdate:modelValue":t[8]||(t[8]=e=>jt(i).password=e),type:"text",placeholder:jt(a)?"":`(${jt(n)("passwordEmptyHint")})`,autocomplete:"off"},null,8,Db),[[Hi,jt(i).password]])],64)):Ir("",!0),Tr("div",Ub,ue(jt(n)("emailNotify")),1),Fn(Tr("select",{"onUpdate:modelValue":t[9]||(t[9]=e=>jt(i).receive_email=e)},[Tr("option",Fb,ue(jt(n)("enabled")),1),Tr("option",jb,ue(jt(n)("disabled")),1)],512),[[zi,jt(i).receive_email]]),Tr("button",Bb,ue(jt(n)("save")),1)],32)):Ir("",!0),jt(o)?(kr(),xr(s,{key:2})):Ir("",!0)])}}}),[["__scopeId","data-v-e420485f"]]),Wb={class:"user-list-wrap"},Hb={class:"user-list"},Vb={class:"user-main"},Kb={class:"title"},zb={class:"badge-grp"},Gb=["title"],Yb=["title"],Qb={class:"sub"},Xb={class:"user-actions"},Jb=["onClick"],Zb=["onClick"],ew=[{path:"/",name:"/",component:rf,meta:{title:"Artalk Sidebar"}},{path:"/comments",name:"/comments",component:_f},{path:"/login",name:"/login",component:Uf,meta:{title:"Login - Artalk Sidebar"}},{path:"/pages",name:"/pages",component:_m},{path:"/settings",name:"/settings",component:Sk},{path:"/sites",name:"/sites",component:tb},{path:"/transfer",name:"/transfer",component:_b},{path:"/users",name:"/users",component:wf(Jn({__name:"users",setup(e){const t=af();I_();const{curtTab:n}=yo(t),s=Mt([]),{t:r}=Tc(),i=Mt(30),o=Mt(0),a=Mt(),l=Mt("all"),c=Mt(!1),u=Mt();function d(e){t.setPageLoading(!0),null==ef||ef.ctx.getApi().users.getUsers(l.value,{offset:e,limit:i.value}).then((e=>{o.value=e.data.count,s.value=e.data.users,t.scrollPageToTop()})).finally((()=>{t.setPageLoading(!1)}))}function p(e){d(e)}function h(e){const t=s.value.findIndex((t=>t.id===e.id));if(-1!=t){const n=s.value[t];Object.keys(e).forEach((t=>{n[t]=e[t]}))}else a.value.reset(),d(0);f()}function f(){c.value=!1,u.value=void 0}return ls((()=>{t.updateTabs({all:"all",admin:"admin",create:"create"},"all"),Pn(n,(e=>{var t;"create"===e?void 0!==u.value?(u.value=void 0,an((()=>{c.value=!0}))):c.value=!0:(c.value=!1,u.value=void 0,l.value=e,null==(t=a.value)||t.reset(),d(0))})),d(0)})),(e,n)=>{const l=qb;return kr(),Er("div",Wb,[Tr("div",Hb,[(kr(!0),Er(hr,null,vs(jt(s),(e=>(kr(),Er("div",{key:e.id,class:"user-item"},[Tr("div",Vb,[Tr("div",Kb,[Nr(ue(e.name)+" ",1),Tr("span",zb,[e.badge_name?(kr(),Er("span",{key:0,class:"badge",style:ee({backgroundColor:e.badge_color})},ue(e.badge_name),5)):e.is_admin?(kr(),Er("span",{key:1,class:"badge admin",title:jt(r)("userAdminHint")},ue(jt(r)("Admin")),9,Gb)):Ir("",!0),e.is_in_conf?(kr(),Er("span",{key:2,class:"badge in-conf",title:jt(r)("userInConfHint")},ue(jt(r)("Config")),9,Yb)):Ir("",!0)])]),Tr("div",Qb,ue(e.email),1)]),Tr("div",Xb,[Tr("span",{onClick:t=>function(e){e.is_in_conf?alert("暂不支持在线编辑配置文件中的用户,请手动修改配置文件"):(c.value=!1,u.value=e)}(e)},ue(jt(r)("edit")),9,Jb),Tr("span",null,ue(jt(r)("comment"))+" ("+ue(e.comment_count)+")",1),Tr("span",{onClick:t=>function(e){window.confirm(`该操作将删除 用户:"${e.name}" 邮箱:"${e.email}" 所有评论,包括其评论下面他人的回复评论,是否继续?`)&&ef.ctx.getApi().users.deleteUser(e.id).then((()=>{const t=s.value.findIndex((t=>t.id===e.id));s.value.splice(t,1),e.is_in_conf&&alert("用户已从数据库删除,请手动编辑配置文件并删除用户")})).catch((e=>{alert("删除失败:"+e.message)}))}(e)},ue(jt(r)("delete")),9,Zb)])])))),128))]),Lr(um,{ref_key:"pagination",ref:a,"page-size":jt(i),total:jt(o),disabled:jt(t).isPageLoading,onChange:p},null,8,["page-size","total","disabled"]),jt(c)||void 0!==jt(u)?(kr(),xr(l,{key:0,user:jt(u),onUpdate:h,onClose:f},null,8,["user"])):Ir("",!0)])}}}),[["__scopeId","data-v-5a0a80cb"]])}],tw="undefined"!=typeof document;const nw=Object.assign;function sw(e,t){const n={};for(const s in t){const r=t[s];n[s]=iw(r)?r.map(e):e(r)}return n}const rw=()=>{},iw=Array.isArray,ow=/#/g,aw=/&/g,lw=/\//g,cw=/=/g,uw=/\?/g,dw=/\+/g,pw=/%5B/g,hw=/%5D/g,fw=/%5E/g,mw=/%60/g,gw=/%7B/g,vw=/%7C/g,yw=/%7D/g,kw=/%20/g;function bw(e){return encodeURI(""+e).replace(vw,"|").replace(pw,"[").replace(hw,"]")}function ww(e){return bw(e).replace(dw,"%2B").replace(kw,"+").replace(ow,"%23").replace(aw,"%26").replace(mw,"`").replace(gw,"{").replace(yw,"}").replace(fw,"^")}function _w(e){return null==e?"":function(e){return bw(e).replace(ow,"%23").replace(uw,"%3F")}(e).replace(lw,"%2F")}function Ew(e){try{return decodeURIComponent(""+e)}catch(t){}return""+e}const xw=/\/$/,Sw=e=>e.replace(xw,"");function Cw(e,t,n="/"){let s,r={},i="",o="";const a=t.indexOf("#");let l=t.indexOf("?");return a<l&&a>=0&&(l=-1),l>-1&&(s=t.slice(0,l),i=t.slice(l+1,a>-1?a:t.length),r=e(i)),a>-1&&(s=s||t.slice(0,a),o=t.slice(a,t.length)),s=function(e,t){if(e.startsWith("/"))return e;if(!e)return t;const n=t.split("/"),s=e.split("/"),r=s[s.length-1];".."!==r&&"."!==r||s.push("");let i,o,a=n.length-1;for(i=0;i<s.length;i++)if(o=s[i],"."!==o){if(".."!==o)break;a>1&&a--}return n.slice(0,a).join("/")+"/"+s.slice(i).join("/")}(null!=s?s:t,n),{fullPath:s+(i&&"?")+i+o,path:s,query:r,hash:Ew(o)}}function Aw(e,t){return t&&e.toLowerCase().startsWith(t.toLowerCase())?e.slice(t.length)||"/":e}function $w(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function Tw(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(!Lw(e[n],t[n]))return!1;return!0}function Lw(e,t){return iw(e)?Ow(e,t):iw(t)?Ow(t,e):e===t}function Ow(e,t){return iw(t)?e.length===t.length&&e.every(((e,n)=>e===t[n])):1===e.length&&e[0]===t}var Nw,Iw,Pw,Rw;(Iw=Nw||(Nw={})).pop="pop",Iw.push="push",(Rw=Pw||(Pw={})).back="back",Rw.forward="forward",Rw.unknown="";const Mw=/^[^#]+#/;function Dw(e,t){return e.replace(Mw,"#")+t}const Uw=()=>({left:window.scrollX,top:window.scrollY});function Fw(e){let t;if("el"in e){const n=e.el,s="string"==typeof n&&n.startsWith("#"),r="string"==typeof n?s?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!r)return;t=function(e,t){const n=document.documentElement.getBoundingClientRect(),s=e.getBoundingClientRect();return{behavior:t.behavior,left:s.left-n.left-(t.left||0),top:s.top-n.top-(t.top||0)}}(r,e)}else t=e;"scrollBehavior"in document.documentElement.style?window.scrollTo(t):window.scrollTo(null!=t.left?t.left:window.scrollX,null!=t.top?t.top:window.scrollY)}function jw(e,t){return(history.state?history.state.position-t:-1)+e}const Bw=new Map;let qw=()=>location.protocol+"//"+location.host;function Ww(e,t){const{pathname:n,search:s,hash:r}=t,i=e.indexOf("#");if(i>-1){let t=r.includes(e.slice(i))?e.slice(i).length:1,n=r.slice(t);return"/"!==n[0]&&(n="/"+n),Aw(n,"")}return Aw(n,e)+s+r}function Hw(e,t,n,s=!1,r=!1){return{back:e,current:t,forward:n,replaced:s,position:window.history.length,scroll:r?Uw():null}}function Vw(e){const t=function(e){const{history:t,location:n}=window,s={value:Ww(e,n)},r={value:t.state};function i(s,i,o){const a=e.indexOf("#"),l=a>-1?(n.host&&document.querySelector("base")?e:e.slice(a))+s:qw()+e+s;try{t[o?"replaceState":"pushState"](i,"",l),r.value=i}catch(c){console.error(c),n[o?"replace":"assign"](l)}}return r.value||i(s.value,{back:null,current:s.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0),{location:s,state:r,push:function(e,n){const o=nw({},r.value,t.state,{forward:e,scroll:Uw()});i(o.current,o,!0),i(e,nw({},Hw(s.value,e,null),{position:o.position+1},n),!1),s.value=e},replace:function(e,n){i(e,nw({},t.state,Hw(r.value.back,e,r.value.forward,!0),n,{position:r.value.position}),!0),s.value=e}}}(e=function(e){if(!e)if(tw){const t=document.querySelector("base");e=(e=t&&t.getAttribute("href")||"/").replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return"/"!==e[0]&&"#"!==e[0]&&(e="/"+e),Sw(e)}(e)),n=function(e,t,n,s){let r=[],i=[],o=null;const a=({state:i})=>{const a=Ww(e,location),l=n.value,c=t.value;let u=0;if(i){if(n.value=a,t.value=i,o&&o===l)return void(o=null);u=c?i.position-c.position:0}else s(a);r.forEach((e=>{e(n.value,l,{delta:u,type:Nw.pop,direction:u?u>0?Pw.forward:Pw.back:Pw.unknown})}))};function l(){const{history:e}=window;e.state&&e.replaceState(nw({},e.state,{scroll:Uw()}),"")}return window.addEventListener("popstate",a),window.addEventListener("beforeunload",l,{passive:!0}),{pauseListeners:function(){o=n.value},listen:function(e){r.push(e);const t=()=>{const t=r.indexOf(e);t>-1&&r.splice(t,1)};return i.push(t),t},destroy:function(){for(const e of i)e();i=[],window.removeEventListener("popstate",a),window.removeEventListener("beforeunload",l)}}}(e,t.state,t.location,t.replace);const s=nw({location:"",base:e,go:function(e,t=!0){t||n.pauseListeners(),history.go(e)},createHref:Dw.bind(null,e)},t,n);return Object.defineProperty(s,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(s,"state",{enumerable:!0,get:()=>t.state.value}),s}function Kw(e){return"string"==typeof e||"symbol"==typeof e}const zw={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0},Gw=Symbol("");var Yw,Qw;function Xw(e,t){return nw(new Error,{type:e,[Gw]:!0},t)}function Jw(e,t){return e instanceof Error&&Gw in e&&(null==t||!!(e.type&t))}(Qw=Yw||(Yw={}))[Qw.aborted=4]="aborted",Qw[Qw.cancelled=8]="cancelled",Qw[Qw.duplicated=16]="duplicated";const Zw="[^/]+?",e_={sensitive:!1,strict:!1,start:!0,end:!0},t_=/[.+*?^${}()[\]/\\]/g;function n_(e,t){let n=0;for(;n<e.length&&n<t.length;){const s=t[n]-e[n];if(s)return s;n++}return e.length<t.length?1===e.length&&80===e[0]?-1:1:e.length>t.length?1===t.length&&80===t[0]?1:-1:0}function s_(e,t){let n=0;const s=e.score,r=t.score;for(;n<s.length&&n<r.length;){const e=n_(s[n],r[n]);if(e)return e;n++}if(1===Math.abs(r.length-s.length)){if(r_(s))return 1;if(r_(r))return-1}return r.length-s.length}function r_(e){const t=e[e.length-1];return e.length>0&&t[t.length-1]<0}const i_={type:0,value:""},o_=/[a-zA-Z0-9_]/;function a_(e,t,n){const s=function(e,t){const n=nw({},e_,t),s=[];let r=n.start?"^":"";const i=[];for(const l of e){const e=l.length?[]:[90];n.strict&&!l.length&&(r+="/");for(let t=0;t<l.length;t++){const s=l[t];let o=40+(n.sensitive?.25:0);if(0===s.type)t||(r+="/"),r+=s.value.replace(t_,"\\$&"),o+=40;else if(1===s.type){const{value:e,repeatable:n,optional:c,regexp:u}=s;i.push({name:e,repeatable:n,optional:c});const d=u||Zw;if(d!==Zw){o+=10;try{new RegExp(`(${d})`)}catch(a){throw new Error(`Invalid custom RegExp for param "${e}" (${d}): `+a.message)}}let p=n?`((?:${d})(?:/(?:${d}))*)`:`(${d})`;t||(p=c&&l.length<2?`(?:/${p})`:"/"+p),c&&(p+="?"),r+=p,o+=20,c&&(o+=-8),n&&(o+=-20),".*"===d&&(o+=-50)}e.push(o)}s.push(e)}if(n.strict&&n.end){const e=s.length-1;s[e][s[e].length-1]+=.7000000000000001}n.strict||(r+="/?"),n.end?r+="$":n.strict&&(r+="(?:/|$)");const o=new RegExp(r,n.sensitive?"":"i");return{re:o,score:s,keys:i,parse:function(e){const t=e.match(o),n={};if(!t)return null;for(let s=1;s<t.length;s++){const e=t[s]||"",r=i[s-1];n[r.name]=e&&r.repeatable?e.split("/"):e}return n},stringify:function(t){let n="",s=!1;for(const r of e){s&&n.endsWith("/")||(n+="/"),s=!1;for(const e of r)if(0===e.type)n+=e.value;else if(1===e.type){const{value:i,repeatable:o,optional:a}=e,l=i in t?t[i]:"";if(iw(l)&&!o)throw new Error(`Provided param "${i}" is an array but it is not repeatable (* or + modifiers)`);const c=iw(l)?l.join("/"):l;if(!c){if(!a)throw new Error(`Missing required param "${i}"`);r.length<2&&(n.endsWith("/")?n=n.slice(0,-1):s=!0)}n+=c}}return n||"/"}}}(function(e){if(!e)return[[]];if("/"===e)return[[i_]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(e){throw new Error(`ERR (${n})/"${c}": ${e}`)}let n=0,s=n;const r=[];let i;function o(){i&&r.push(i),i=[]}let a,l=0,c="",u="";function d(){c&&(0===n?i.push({type:0,value:c}):1===n||2===n||3===n?(i.length>1&&("*"===a||"+"===a)&&t(`A repeatable param (${c}) must be alone in its segment. eg: '/:ids+.`),i.push({type:1,value:c,regexp:u,repeatable:"*"===a||"+"===a,optional:"*"===a||"?"===a})):t("Invalid state to consume buffer"),c="")}function p(){c+=a}for(;l<e.length;)if(a=e[l++],"\\"!==a||2===n)switch(n){case 0:"/"===a?(c&&d(),o()):":"===a?(d(),n=1):p();break;case 4:p(),n=s;break;case 1:"("===a?n=2:o_.test(a)?p():(d(),n=0,"*"!==a&&"?"!==a&&"+"!==a&&l--);break;case 2:")"===a?"\\"==u[u.length-1]?u=u.slice(0,-1)+a:n=3:u+=a;break;case 3:d(),n=0,"*"!==a&&"?"!==a&&"+"!==a&&l--,u="";break;default:t("Unknown state")}else s=n,n=4;return 2===n&&t(`Unfinished custom RegExp for param "${c}"`),d(),o(),r}(e.path),n),r=nw(s,{record:e,parent:t,children:[],alias:[]});return t&&!r.record.aliasOf==!t.record.aliasOf&&t.children.push(r),r}function l_(e,t){const n=[],s=new Map;function r(e,n,s){const a=!s,l=function(e){return{path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:void 0,beforeEnter:e.beforeEnter,props:u_(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in e?e.components||null:e.component&&{default:e.component}}}(e);l.aliasOf=s&&s.record;const c=h_(t,e),u=[l];if("alias"in e){const t="string"==typeof e.alias?[e.alias]:e.alias;for(const e of t)u.push(nw({},l,{components:s?s.record.components:l.components,path:e,aliasOf:s?s.record:l}))}let d,p;for(const t of u){const{path:u}=t;if(n&&"/"!==u[0]){const e=n.record.path,s="/"===e[e.length-1]?"":"/";t.path=n.record.path+(u&&s+u)}if(d=a_(t,n,c),s?s.alias.push(d):(p=p||d,p!==d&&p.alias.push(d),a&&e.name&&!d_(d)&&i(e.name)),l.children){const e=l.children;for(let t=0;t<e.length;t++)r(e[t],d,s&&s.children[t])}s=s||d,(d.record.components&&Object.keys(d.record.components).length||d.record.name||d.record.redirect)&&o(d)}return p?()=>{i(p)}:rw}function i(e){if(Kw(e)){const t=s.get(e);t&&(s.delete(e),n.splice(n.indexOf(t),1),t.children.forEach(i),t.alias.forEach(i))}else{const t=n.indexOf(e);t>-1&&(n.splice(t,1),e.record.name&&s.delete(e.record.name),e.children.forEach(i),e.alias.forEach(i))}}function o(e){let t=0;for(;t<n.length&&s_(e,n[t])>=0&&(e.record.path!==n[t].record.path||!f_(e,n[t]));)t++;n.splice(t,0,e),e.record.name&&!d_(e)&&s.set(e.record.name,e)}return t=h_({strict:!1,end:!0,sensitive:!1},t),e.forEach((e=>r(e))),{addRoute:r,resolve:function(e,t){let r,i,o,a={};if("name"in e&&e.name){if(r=s.get(e.name),!r)throw Xw(1,{location:e});o=r.record.name,a=nw(c_(t.params,r.keys.filter((e=>!e.optional)).concat(r.parent?r.parent.keys.filter((e=>e.optional)):[]).map((e=>e.name))),e.params&&c_(e.params,r.keys.map((e=>e.name)))),i=r.stringify(a)}else if(null!=e.path)i=e.path,r=n.find((e=>e.re.test(i))),r&&(a=r.parse(i),o=r.record.name);else{if(r=t.name?s.get(t.name):n.find((e=>e.re.test(t.path))),!r)throw Xw(1,{location:e,currentLocation:t});o=r.record.name,a=nw({},t.params,e.params),i=r.stringify(a)}const l=[];let c=r;for(;c;)l.unshift(c.record),c=c.parent;return{name:o,path:i,params:a,matched:l,meta:p_(l)}},removeRoute:i,getRoutes:function(){return n},getRecordMatcher:function(e){return s.get(e)}}}function c_(e,t){const n={};for(const s of t)s in e&&(n[s]=e[s]);return n}function u_(e){const t={},n=e.props||!1;if("component"in e)t.default=n;else for(const s in e.components)t[s]="object"==typeof n?n[s]:n;return t}function d_(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function p_(e){return e.reduce(((e,t)=>nw(e,t.meta)),{})}function h_(e,t){const n={};for(const s in e)n[s]=s in t?t[s]:e[s];return n}function f_(e,t){return t.children.some((t=>t===e||f_(e,t)))}function m_(e){const t={};if(""===e||"?"===e)return t;const n=("?"===e[0]?e.slice(1):e).split("&");for(let s=0;s<n.length;++s){const e=n[s].replace(dw," "),r=e.indexOf("="),i=Ew(r<0?e:e.slice(0,r)),o=r<0?null:Ew(e.slice(r+1));if(i in t){let e=t[i];iw(e)||(e=t[i]=[e]),e.push(o)}else t[i]=o}return t}function g_(e){let t="";for(let n in e){const s=e[n];if(n=ww(n).replace(cw,"%3D"),null==s){void 0!==s&&(t+=(t.length?"&":"")+n);continue}(iw(s)?s.map((e=>e&&ww(e))):[s&&ww(s)]).forEach((e=>{void 0!==e&&(t+=(t.length?"&":"")+n,null!=e&&(t+="="+e))}))}return t}function v_(e){const t={};for(const n in e){const s=e[n];void 0!==s&&(t[n]=iw(s)?s.map((e=>null==e?null:""+e)):null==s?s:""+s)}return t}const y_=Symbol(""),k_=Symbol(""),b_=Symbol(""),w_=Symbol(""),__=Symbol("");function E_(){let e=[];return{add:function(t){return e.push(t),()=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)}},list:()=>e.slice(),reset:function(){e=[]}}}function x_(e,t,n,s,r,i=(e=>e())){const o=s&&(s.enterCallbacks[r]=s.enterCallbacks[r]||[]);return()=>new Promise(((a,l)=>{const c=e=>{var i;!1===e?l(Xw(4,{from:n,to:t})):e instanceof Error?l(e):"string"==typeof(i=e)||i&&"object"==typeof i?l(Xw(2,{from:t,to:e})):(o&&s.enterCallbacks[r]===o&&"function"==typeof e&&o.push(e),a())},u=i((()=>e.call(s&&s.instances[r],t,n,c)));let d=Promise.resolve(u);e.length<3&&(d=d.then(c)),d.catch((e=>l(e)))}))}function S_(e,t,n,s,r=(e=>e())){const i=[];for(const a of e)for(const e in a.components){let l=a.components[e];if("beforeRouteEnter"===t||a.instances[e])if("object"==typeof(o=l)||"displayName"in o||"props"in o||"__vccOpts"in o){const o=(l.__vccOpts||l)[t];o&&i.push(x_(o,n,s,a,e,r))}else{let o=l();i.push((()=>o.then((i=>{if(!i)return Promise.reject(new Error(`Couldn't resolve component "${e}" at "${a.path}"`));const o=(l=i).__esModule||"Module"===l[Symbol.toStringTag]?i.default:i;var l;a.components[e]=o;const c=(o.__vccOpts||o)[t];return c&&x_(c,n,s,a,e,r)()}))))}}var o;return i}function C_(e){const t=qs(b_),n=qs(w_),s=ei((()=>{const n=jt(e.to);return t.resolve(n)})),r=ei((()=>{const{matched:e}=s.value,{length:t}=e,r=e[t-1],i=n.matched;if(!r||!i.length)return-1;const o=i.findIndex($w.bind(null,r));if(o>-1)return o;const a=$_(e[t-2]);return t>1&&$_(r)===a&&i[i.length-1].path!==a?i.findIndex($w.bind(null,e[t-2])):o})),i=ei((()=>r.value>-1&&function(e,t){for(const n in t){const s=t[n],r=e[n];if("string"==typeof s){if(s!==r)return!1}else if(!iw(r)||r.length!==s.length||s.some(((e,t)=>e!==r[t])))return!1}return!0}(n.params,s.value.params))),o=ei((()=>r.value>-1&&r.value===n.matched.length-1&&Tw(n.params,s.value.params)));return{route:s,href:ei((()=>s.value.href)),isActive:i,isExactActive:o,navigate:function(n={}){return function(e){if(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)return;if(e.defaultPrevented)return;if(void 0!==e.button&&0!==e.button)return;if(e.currentTarget&&e.currentTarget.getAttribute){const t=e.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(t))return}e.preventDefault&&e.preventDefault();return!0}(n)?t[jt(e.replace)?"replace":"push"](jt(e.to)).catch(rw):Promise.resolve()}}}const A_=Jn({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"}},useLink:C_,setup(e,{slots:t}){const n=bt(C_(e)),{options:s}=qs(b_),r=ei((()=>({[T_(e.activeClass,s.linkActiveClass,"router-link-active")]:n.isActive,[T_(e.exactActiveClass,s.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive})));return()=>{const s=t.default&&t.default(n);return e.custom?s:ti("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:r.value},s)}}});function $_(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const T_=(e,t,n)=>null!=e?e:null!=t?t:n;function L_(e,t){if(!e)return null;const n=e(t);return 1===n.length?n[0]:n}const O_=Jn({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){const s=qs(__),r=ei((()=>e.route||s.value)),i=qs(k_,0),o=ei((()=>{let e=jt(i);const{matched:t}=r.value;let n;for(;(n=t[e])&&!n.components;)e++;return e})),a=ei((()=>r.value.matched[o.value]));Bs(k_,ei((()=>o.value+1))),Bs(y_,a),Bs(__,r);const l=Mt();return Pn((()=>[l.value,a.value,e.name]),(([e,t,n],[s,r,i])=>{t&&(t.instances[n]=e,r&&r!==t&&e&&e===s&&(t.leaveGuards.size||(t.leaveGuards=r.leaveGuards),t.updateGuards.size||(t.updateGuards=r.updateGuards))),!e||!t||r&&$w(t,r)&&s||(t.enterCallbacks[n]||[]).forEach((t=>t(e)))}),{flush:"post"}),()=>{const s=r.value,i=e.name,o=a.value,c=o&&o.components[i];if(!c)return L_(n.default,{Component:c,route:s});const u=o.props[i],d=u?!0===u?s.params:"function"==typeof u?u(s):u:null,p=ti(c,nw({},d,t,{onVnodeUnmounted:e=>{e.component.isUnmounted&&(o.instances[i]=null)},ref:l}));return L_(n.default,{Component:p,route:s})||p}}});function N_(e){const t=l_(e.routes,e),n=e.parseQuery||m_,s=e.stringifyQuery||g_,r=e.history,i=E_(),o=E_(),a=E_(),l=Dt(zw);let c=zw;tw&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const u=sw.bind(null,(e=>""+e)),d=sw.bind(null,_w),p=sw.bind(null,Ew);function h(e,i){if(i=nw({},i||l.value),"string"==typeof e){const s=Cw(n,e,i.path),o=t.resolve({path:s.path},i),a=r.createHref(s.fullPath);return nw(s,o,{params:p(o.params),hash:Ew(s.hash),redirectedFrom:void 0,href:a})}let o;if(null!=e.path)o=nw({},e,{path:Cw(n,e.path,i.path).path});else{const t=nw({},e.params);for(const e in t)null==t[e]&&delete t[e];o=nw({},e,{params:d(t)}),i.params=d(i.params)}const a=t.resolve(o,i),c=e.hash||"";a.params=u(p(a.params));const h=function(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}(s,nw({},e,{hash:(f=c,bw(f).replace(gw,"{").replace(yw,"}").replace(fw,"^")),path:a.path}));var f;const m=r.createHref(h);return nw({fullPath:h,hash:c,query:s===g_?v_(e.query):e.query||{}},a,{redirectedFrom:void 0,href:m})}function f(e){return"string"==typeof e?Cw(n,e,l.value.path):nw({},e)}function m(e,t){if(c!==e)return Xw(8,{from:t,to:e})}function g(e){return y(e)}function v(e){const t=e.matched[e.matched.length-1];if(t&&t.redirect){const{redirect:n}=t;let s="function"==typeof n?n(e):n;return"string"==typeof s&&(s=s.includes("?")||s.includes("#")?s=f(s):{path:s},s.params={}),nw({query:e.query,hash:e.hash,params:null!=s.path?{}:e.params},s)}}function y(e,t){const n=c=h(e),r=l.value,i=e.state,o=e.force,a=!0===e.replace,u=v(n);if(u)return y(nw(f(u),{state:"object"==typeof u?nw({},i,u.state):i,force:o,replace:a}),t||n);const d=n;let p;return d.redirectedFrom=t,!o&&function(e,t,n){const s=t.matched.length-1,r=n.matched.length-1;return s>-1&&s===r&&$w(t.matched[s],n.matched[r])&&Tw(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}(s,r,n)&&(p=Xw(16,{to:d,from:r}),O(r,r,!0,!1)),(p?Promise.resolve(p):w(d,r)).catch((e=>Jw(e)?Jw(e,2)?e:L(e):T(e,d,r))).then((e=>{if(e){if(Jw(e,2))return y(nw({replace:a},f(e.to),{state:"object"==typeof e.to?nw({},i,e.to.state):i,force:o}),t||d)}else e=E(d,r,!0,a,i);return _(d,r,e),e}))}function k(e,t){const n=m(e,t);return n?Promise.reject(n):Promise.resolve()}function b(e){const t=P.values().next().value;return t&&"function"==typeof t.runWithContext?t.runWithContext(e):e()}function w(e,t){let n;const[s,r,a]=function(e,t){const n=[],s=[],r=[],i=Math.max(t.matched.length,e.matched.length);for(let o=0;o<i;o++){const i=t.matched[o];i&&(e.matched.find((e=>$w(e,i)))?s.push(i):n.push(i));const a=e.matched[o];a&&(t.matched.find((e=>$w(e,a)))||r.push(a))}return[n,s,r]}(e,t);n=S_(s.reverse(),"beforeRouteLeave",e,t);for(const i of s)i.leaveGuards.forEach((s=>{n.push(x_(s,e,t))}));const l=k.bind(null,e,t);return n.push(l),M(n).then((()=>{n=[];for(const s of i.list())n.push(x_(s,e,t));return n.push(l),M(n)})).then((()=>{n=S_(r,"beforeRouteUpdate",e,t);for(const s of r)s.updateGuards.forEach((s=>{n.push(x_(s,e,t))}));return n.push(l),M(n)})).then((()=>{n=[];for(const s of a)if(s.beforeEnter)if(iw(s.beforeEnter))for(const r of s.beforeEnter)n.push(x_(r,e,t));else n.push(x_(s.beforeEnter,e,t));return n.push(l),M(n)})).then((()=>(e.matched.forEach((e=>e.enterCallbacks={})),n=S_(a,"beforeRouteEnter",e,t,b),n.push(l),M(n)))).then((()=>{n=[];for(const s of o.list())n.push(x_(s,e,t));return n.push(l),M(n)})).catch((e=>Jw(e,8)?e:Promise.reject(e)))}function _(e,t,n){a.list().forEach((s=>b((()=>s(e,t,n)))))}function E(e,t,n,s,i){const o=m(e,t);if(o)return o;const a=t===zw,c=tw?history.state:{};n&&(s||a?r.replace(e.fullPath,nw({scroll:a&&c&&c.scroll},i)):r.push(e.fullPath,i)),l.value=e,O(e,t,n,a),L()}let x;function S(){x||(x=r.listen(((e,t,n)=>{if(!R.listening)return;const s=h(e),i=v(s);if(i)return void y(nw(i,{replace:!0}),s).catch(rw);c=s;const o=l.value;var a,u;tw&&(a=jw(o.fullPath,n.delta),u=Uw(),Bw.set(a,u)),w(s,o).catch((e=>Jw(e,12)?e:Jw(e,2)?(y(e.to,s).then((e=>{Jw(e,20)&&!n.delta&&n.type===Nw.pop&&r.go(-1,!1)})).catch(rw),Promise.reject()):(n.delta&&r.go(-n.delta,!1),T(e,s,o)))).then((e=>{(e=e||E(s,o,!1))&&(n.delta&&!Jw(e,8)?r.go(-n.delta,!1):n.type===Nw.pop&&Jw(e,20)&&r.go(-1,!1)),_(s,o,e)})).catch(rw)})))}let C,A=E_(),$=E_();function T(e,t,n){L(e);const s=$.list();return s.length?s.forEach((s=>s(e,t,n))):console.error(e),Promise.reject(e)}function L(e){return C||(C=!e,S(),A.list().forEach((([t,n])=>e?n(e):t())),A.reset()),e}function O(t,n,s,r){const{scrollBehavior:i}=e;if(!tw||!i)return Promise.resolve();const o=!s&&function(e){const t=Bw.get(e);return Bw.delete(e),t}(jw(t.fullPath,0))||(r||!s)&&history.state&&history.state.scroll||null;return an().then((()=>i(t,n,o))).then((e=>e&&Fw(e))).catch((e=>T(e,t,n)))}const N=e=>r.go(e);let I;const P=new Set,R={currentRoute:l,listening:!0,addRoute:function(e,n){let s,r;return Kw(e)?(s=t.getRecordMatcher(e),r=n):r=e,t.addRoute(r,s)},removeRoute:function(e){const n=t.getRecordMatcher(e);n&&t.removeRoute(n)},hasRoute:function(e){return!!t.getRecordMatcher(e)},getRoutes:function(){return t.getRoutes().map((e=>e.record))},resolve:h,options:e,push:g,replace:function(e){return g(nw(f(e),{replace:!0}))},go:N,back:()=>N(-1),forward:()=>N(1),beforeEach:i.add,beforeResolve:o.add,afterEach:a.add,onError:$.add,isReady:function(){return C&&l.value!==zw?Promise.resolve():new Promise(((e,t)=>{A.add([e,t])}))},install(e){e.component("RouterLink",A_),e.component("RouterView",O_),e.config.globalProperties.$router=this,Object.defineProperty(e.config.globalProperties,"$route",{enumerable:!0,get:()=>jt(l)}),tw&&!I&&l.value===zw&&(I=!0,g(r.location).catch((e=>{})));const t={};for(const s in zw)Object.defineProperty(t,s,{get:()=>l.value[s],enumerable:!0});e.provide(b_,this),e.provide(w_,wt(t)),e.provide(__,l);const n=e.unmount;P.add(e),e.unmount=function(){P.delete(e),P.size<1&&(c=zw,x&&x(),x=null,l.value=zw,I=!1,C=!1),n()}}};function M(e){return e.reduce(((e,t)=>e.then((()=>b(t)))),Promise.resolve())}return R}function I_(){return qs(b_)}function P_(){return qs(w_)}const R_={en:{ctrlCenter:"Admin",msgCenter:"Messages",noContent:"No Content",searchHint:"Search by keywords...",allSites:"All Sites",siteManage:"Site Management",comment:"Comment",page:"Page",user:"User",site:"Site",transfer:"Transfer",settings:"Settings",all:"All",pending:"Pending",personal:"Personal",mentions:"Mentions",mine:"Mine",admin:"Admin",create:"Create",import:"Import",export:"Export",settingSaved:"Setting saved",settingSaveFailed:"Setting save failed",settingNotice:"Note: Some config options may require a manual reboot to take effect.",apply:"Apply",updateComplete:"Update complete",updateReady:"Ready to update...",opFailed:"Operation failed",updateTitle:"Fetch Title",cacheClear:"Cache Clear",cacheWarm:"Cache Warm",editTitle:"Edit Title",switchKey:"Switch Key",commentAllowAll:"Anyone Comment",commentOnlyAdmin:"Admin Comment Only",config:"Config",userAdminHint:"Admin user",userInConfHint:"This user is defined in config file",edit:"Edit",delete:"Delete",siteCount:"Total {count} Sites",createSite:"Create Site",siteName:"Site Name",siteUrls:"Site URLs",multiSepHint:"multiple separated by commas",add:"Add",rename:"Rename",inputHint:"Input text...",userCreate:"Create User",userEdit:"Edit User",comments:"Comments",last:"Last",show:"Show",username:"Username",email:"Email",link:"Link",badgeText:"Badge Text",badgeColor:"Badge Color",role:"Role",normal:"Normal",password:"Password",passwordEmptyHint:"leave blank not change your password",emailNotify:"Email notification",enabled:"Enabled",disabled:"Disabled",save:"Save",dataFile:"Data File",artransfer:"Artransfer",targetSiteName:"Target Site Name",targetSiteURL:"Target Site URL",payload:"Payload",optional:"Optional",uploadReadyToImport:"File uploaded and is ready for import",artransferToolHint:"Use the {link} to convert data to Artrans format.",moreDetails:"More details",loginFailure:"Login failure",login:"Login",logout:"Logout",logoutConfirm:"Are you sure you want to log out?",loginSelectHint:"Please select the account you wish to log into:"},"zh-CN":{ctrlCenter:"控制中心",msgCenter:"通知中心",noContent:"无内容",searchHint:"搜索关键字...",allSites:"所有站点",siteManage:"站点管理",comment:"评论",page:"页面",user:"用户",site:"站点",transfer:"迁移",settings:"设置",all:"全部",pending:"待审",personal:"个人",mentions:"提及",mine:"我的",admin:"管理员",create:"新增",import:"导入",export:"导出",settingSaved:"配置已保存",settingSaveFailed:"配置保存失败",settingNotice:"注:某些配置项可能需手动重启才能生效",apply:"应用",updateComplete:"更新完毕",updateReady:"开始更新...",opFailed:"操作失败",updateTitle:"更新标题",cacheClear:"缓存清除",cacheWarm:"缓存预热",editTitle:"标题修改",switchKey:"KEY 变更",commentAllowAll:"所有人可评",commentOnlyAdmin:"仅管理员可评",config:"配置文件",userAdminHint:"该用户具有管理员权限",userInConfHint:"该用户存在于配置文件中",edit:"编辑",delete:"删除",siteCount:"共 {count} 个站点",createSite:"新增站点",siteName:"站点名称",siteUrls:"站点 URLs",multiSepHint:"多个用逗号隔开",add:"新增",rename:"重命名",inputHint:"输入内容...",userCreate:"用户创建",userEdit:"用户编辑",comments:"评论",last:"近期",show:"展开",username:"用户名",email:"邮箱",link:"链接",badgeText:"徽章文字",badgeColor:"徽章颜色",role:"身份角色",normal:"普通",password:"密码",passwordEmptyHint:"留空不修改密码",emailNotify:"邮件通知",enabled:"开启",disabled:"关闭",save:"保存",dataFile:"数据文件",artransfer:"转换工具",targetSiteName:"目标站点名",targetSiteURL:"目标站点 URL",payload:"启动参数",optional:"可选",uploadReadyToImport:"文件已成功上传,可以开始导入",artransferToolHint:"使用 {link} 将评论数据转为 Artrans 格式",moreDetails:"查看详情",loginFailure:"登录发生异常",login:"登录",logout:"退出登录",logoutConfirm:"确定要退出登录吗?",loginSelectHint:"请选择您要登录的账户:"},"zh-TW":{ctrlCenter:"控制中心",msgCenter:"訊息中心",noContent:"無內容",searchHint:"關鍵字搜尋...",allSites:"所有網站",siteManage:"網站管理",comment:"評論",page:"頁面",user:"用戶",site:"網站",transfer:"轉移",settings:"設置",all:"全部",pending:"待審",personal:"個人",mentions:"提及",mine:"我的",admin:"管理員",create:"建立",import:"匯入",export:"匯出",settingSaved:"設定已儲存",settingSaveFailed:"設定儲存失敗",settingNotice:"注:某些設定選項可能需要手動重啟才能生效",apply:"套用",updateComplete:"更新完畢",updateReady:"準備更新...",opFailed:"操作失敗",updateTitle:"擷取標題",cacheClear:"清除快取",cacheWarm:"預熱快取",editTitle:"編輯標題",switchKey:"KEY 變更",commentAllowAll:"允許任何人評論",commentOnlyAdmin:"僅允許管理員評論",config:"配置文件",userAdminHint:"該用戶具有管理員權限",userInConfHint:"該用戶存在於配置文件中",edit:"編輯",delete:"刪除",siteCount:"共 {count} 個網站",createSite:"建立網站",siteName:"網站名稱",siteUrls:"網站 URLs",multiSepHint:"使用逗號分隔多個",add:"新增",rename:"重命名",inputHint:"輸入文字...",userCreate:"建立用戶",userEdit:"用戶編輯",comments:"評論",last:"最後",show:"展開",username:"用戶名",email:"郵箱",link:"連結",badgeText:"徽章文字",badgeColor:"徽章顏色",role:"身份角色",normal:"一般",password:"密碼",passwordEmptyHint:"留空表示不變更密碼",emailNotify:"郵件通知",enabled:"啟用",disabled:"停用",save:"儲存",dataFile:"資料檔案",artransfer:"轉移工具",targetSiteName:"目標網站名稱",targetSiteURL:"目標網站 URL",payload:"有效載荷",optional:"選填",uploadReadyToImport:"檔案已上傳並準備匯入",artransferToolHint:"使用 {link} 將評論數據轉換為 Artrans 格式。",moreDetails:"查看詳情",loginFailure:"登入失敗",login:"登入",logout:"登出",logoutConfirm:"確定要登出嗎?",loginSelectHint:"請選擇您要登入的帳號:"}},M_=e=>(wn("data-v-a11cb4ff"),e=e(),_n(),e),D_={class:"tab"},U_={key:0,class:"text"},F_=["onClick"],j_=["onClick"],B_=[M_((()=>Tr("div",{class:"icon arrow"},null,-1)))],q_=["placeholder"],W_=M_((()=>Tr("button",{type:"submit",class:"item search-btn"},null,-1))),H_=wf(Jn({__name:"Tab",setup(e){const t=I_();P_();const n=af(),{t:s}=Tc(),{curtPage:r,curtTab:i,tabs:o,isSearchEnabled:a}=yo(n),{isAdmin:l}=yo(bf()),c=Mt("tabs"),u=Mt(null),d=ei((()=>l.value?{comments:{label:"comment",link:"/comments"},pages:{label:"page",link:"/pages"},users:{label:"user",link:"/users"},sites:{label:"site",link:"/sites",hide:!0},transfer:{label:"transfer",link:"/transfer",hide:!0},settings:{label:"settings",link:"/settings"}}:{comments:{label:"comment",link:"/comments"}})),p=Mt(!1),h=Mt(""),f=Mt(null);function m(e){var t;""!==h.value.trim()?n.searchEvent&&n.searchEvent(h.value.trim()):null==(t=f.value)||t.focus()}return ls((()=>{u.value.addEventListener("wheel",(e=>{e.preventDefault(),u.value.scrollLeft+=e.deltaY}))})),t.beforeEach(((e,t)=>{a.value=!1})),t.afterEach(((e,t,n)=>{r.value=e.name.replace(/^\//,"")})),(e,l)=>{var g;return kr(),Er("div",D_,[Tr("div",{class:"page",onClick:l[0]||(l[0]=e=>{c.value="tabs"!==c.value?"tabs":"pages"})},[Tr("div",{class:ie(["icon","tabs"===jt(c)?"menu":"arrow"])},null,2),(null==(g=jt(d)[jt(r)])?void 0:g.label)?(kr(),Er("div",U_,ue(jt(s)(jt(d)[jt(r)].label)),1)):Ir("",!0)]),Tr("div",{ref_key:"tabListEl",ref:u,class:"tab-list"},["tabs"===jt(c)?(kr(),Er(hr,{key:0},[(kr(!0),Er(hr,null,vs(jt(o),((e,t)=>(kr(),Er("div",{key:t,class:ie(["item",{active:jt(i)===t}]),onClick:e=>function(e){i.value=e}(t)},ue(jt(s)(e)),11,F_)))),128)),jt(a)?(kr(),Er("div",{key:0,class:"item search-btn",onClick:l[1]||(l[1]=e=>(p.value=!0,void an((()=>{var e;null==(e=f.value)||e.focus()}))))})):Ir("",!0)],64)):(kr(!0),Er(hr,{key:1},vs(jt(d),((e,n)=>Fn((kr(),Er("div",{key:n,class:ie(["item",{active:n===jt(r)}]),onClick:e=>function(e){c.value="tabs",t.replace(d.value[e].link)}(n)},ue(jt(s)(e.label)),11,j_)),[[Ei,!e.hide]]))),128))],512),jt(p)?(kr(),Er("form",{key:0,class:"search-layer atk-fade-in",onSubmit:Zi(m,["prevent"])},[Tr("div",{class:"item back-btn",onClick:l[2]||(l[2]=e=>(p.value=!1,h.value="",void(n.searchResetEvent&&n.searchResetEvent())))},B_),Fn(Tr("input",{ref_key:"searchInputEl",ref:f,"onUpdate:modelValue":l[3]||(l[3]=e=>Rt(h)?h.value=e:null),type:"text",placeholder:jt(s)("searchHint"),required:""},null,8,q_),[[Hi,jt(h)]]),W_],32)):Ir("",!0)])}}}),[["__scopeId","data-v-a11cb4ff"]]),V_={class:"atk-sites"},K_=["onClick"],z_={class:"atk-site-logo"},G_={class:"atk-site-name"},Y_=(e=>(wn("data-v-f603391b"),e=e(),_n(),e))((()=>Tr("svg",{class:"atk-site-logo",stroke:"currentColor",fill:"currentColor","stroke-width":"0",viewBox:"-6 -6 36 36",xmlns:"http://www.w3.org/2000/svg"},[Tr("path",{d:"M5 22C4.44772 22 4 21.5523 4 21V3C4 2.44772 4.44772 2 5 2H19C19.5523 2 20 2.44772 20 3V6H18V4H6V20H18V18H20V21C20 21.5523 19.5523 22 19 22H5ZM18 16V13H11V11H18V8L23 12L18 16Z"})],-1))),Q_={class:"atk-site-name"},X_=wf(Jn({__name:"SiteSwitcher",setup(e){const t=Mt(null),n=af(),{siteSwitcherShow:s,sites:r}=yo(n),{site:i}=yo(bf()),o=I_(),{t:a}=Tc();ls((()=>{n.refreshSites()}));const l=ei((()=>{const e=[];return e.push({label:a("allSites"),name:"",logoText:"_"}),r.value.forEach((t=>{e.push({label:t.name,name:t.name,logoText:t.name.substring(0,1)})})),e.push({label:a("siteManage"),name:"__SITE_MANAGEMENT__",logoText:"+"}),e}));function c(e){var n;(null==(n=t.value)?void 0:n.contains(e.target))||(s.value=!1)}return Pn(s,(e=>{e?setTimeout((()=>{document.addEventListener("click",c)}),80):document.removeEventListener("click",c)})),(e,n)=>(kr(),xr(ci,null,{default:En((()=>[Fn(Tr("div",{ref_key:"el",ref:t,class:"atk-site-list-floater"},[Tr("div",V_,[(kr(!0),Er(hr,null,vs(jt(l),((e,t)=>(kr(),Er("div",{key:t,class:ie(["atk-site-item",{"atk-active":jt(i)===e.name}]),onClick:t=>{return"__SITE_MANAGEMENT__"===(n=e.name)?o.replace("/sites"):i.value=n,void(s.value=!1);var n}},[Tr("div",z_,ue(e.logoText),1),Tr("div",G_,ue(e.label),1)],10,K_)))),128)),jt(sf)()?Ir("",!0):(kr(),Er("div",{key:0,class:"atk-site-item",onClick:n[0]||(n[0]=e=>{window.confirm(a("logoutConfirm"))&&(bf().logout(),an((()=>{o.replace("/login")})))})},[Y_,Tr("div",Q_,ue(jt(a)("logout")),1)]))])],512),[[Ei,jt(s)]])])),_:1}))}}),[["__scopeId","data-v-f603391b"]]),J_={class:"header"},Z_={class:"site"},eE=["src"],tE={class:"title"},nE={class:"text"},sE=(e=>(wn("data-v-8b575263"),e=e(),_n(),e))((()=>Tr("div",{class:"close-btn"},null,-1))),rE=wf(Jn({__name:"Header",setup(e){const t=af(),n=I_(),s=bf(),{t:r}=Tc(),{site:i,isAdmin:o,avatar:a}=yo(s),l=()=>{sf()||c()},c=()=>{window.confirm(r("logoutConfirm"))&&(bf().logout(),an((()=>{n.replace("/login")})))};return(e,n)=>{const s=X_;return kr(),Er(hr,null,[Tr("div",J_,[jt(o)?(kr(),Er("div",{key:0,class:ie(["avatar clickable",{active:jt(t).siteSwitcherShow}]),onClick:n[0]||(n[0]=e=>jt(t).showSiteSwitcher())},[Tr("div",Z_,ue(jt(i).substring(0,1)||"_"),1)],2)):(kr(),Er("div",{key:1,class:"avatar",onClick:l},[Tr("img",{src:jt(a)},null,8,eE)])),Tr("div",tE,[Tr("div",nE,ue(jt(o)?jt(r)("ctrlCenter"):jt(r)("msgCenter")),1)]),sE]),jt(o)?(kr(),xr(s,{key:0})):Ir("",!0)],64)}}}),[["__scopeId","data-v-8b575263"]]),iE={class:"main"},oE=wf(Jn({__name:"App",setup(e){const t=af(),n=bf();P_();const s=I_(),{scrollableArea:r}=yo(t),i=Mt(!1);as((()=>{const e=tf();if(!e)throw new Error("Artalk instance not initialized");e.on("mounted",(()=>{i.value||(i.value=!0,function(e){var t;if(null==(t=nf.user)?void 0:t.email)e.ctx.get("user").update(nf.user);else try{bf().sync()}catch(hE){return void an((()=>{s.replace("/login")}))}const r=e.ctx.get("user"),i=r.getData();e.ctx.getApi().user.getUserStatus({email:i.email,name:i.nick}).then((t=>{t.data.is_admin&&!t.data.is_login?(n.logout(),an((()=>{s.replace("/login")}))):e.ctx.getApi().notifies.markAllNotifyRead({email:i.email,name:i.nick})}))}(e))}))}));const o=Mt(nf.darkMode);return function(){if(!window.matchMedia)return;window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",(e=>{o.value=e.matches}))}(),(e,n)=>{const s=rE,a=H_,l=$n("router-view"),c=Yf;return jt(i)?(kr(),Er("div",{key:0,class:ie(["app-wrap artalk atk-sidebar",{"atk-dark-mode":jt(o)}])},[Lr(s),Lr(a),Tr("div",iE,[Tr("div",{ref_key:"scrollableArea",ref:r,class:"atk-sidebar-inner"},[Lr(l)],512),jt(t).isPageLoading?(kr(),xr(c,{key:0})):Ir("",!0)])],2)):Ir("",!0)}}}),[["__scopeId","data-v-3f12ee3e"]]),aE=function(e={},t){const n=__VUE_I18N_LEGACY_API__&&Mo(e.legacy)?e.legacy:__VUE_I18N_LEGACY_API__,s=!Mo(e.globalInjection)||e.globalInjection,r=!__VUE_I18N_LEGACY_API__||!n||!!e.allowComposition,i=new Map,[o,a]=function(e,t,n){const s=ge();{const n=__VUE_I18N_LEGACY_API__&&t?s.run((()=>vc(e))):s.run((()=>gc(e)));if(null==n)throw ec(Zl.UNEXPECTED_ERROR);return[s,n]}}(e,n),l=bo("");{const e={get mode(){return __VUE_I18N_LEGACY_API__&&n?"legacy":"composition"},get allowComposition(){return r},install(t,...r){return d(this,null,(function*(){if(t.__VUE_I18N_SYMBOL__=l,t.provide(t.__VUE_I18N_SYMBOL__,e),Bo(r[0])){const t=r[0];e.__composerExtend=t.__composerExtend,e.__vueI18nExtend=t.__vueI18nExtend}let i=null;!n&&s&&(i=function(e,t){const n=Object.create(null);Lc.forEach((e=>{const s=Object.getOwnPropertyDescriptor(t,e);if(!s)throw ec(Zl.UNEXPECTED_ERROR);const r=Rt(s.value)?{get:()=>s.value.value,set(e){s.value.value=e}}:{get:()=>s.get&&s.get()};Object.defineProperty(n,e,r)})),e.config.globalProperties.$i18n=n,Oc.forEach((n=>{const s=Object.getOwnPropertyDescriptor(t,n);if(!s||!s.value)throw ec(Zl.UNEXPECTED_ERROR);Object.defineProperty(e.config.globalProperties,`$${n}`,s)}));const s=()=>{delete e.config.globalProperties.$i18n,Oc.forEach((t=>{delete e.config.globalProperties[`$${t}`]}))};return s}(t,e.global)),__VUE_I18N_FULL_INSTALL__&&Cc(t,e,...r),__VUE_I18N_LEGACY_API__&&n&&t.mixin(function(e,t,n){return{beforeCreate(){const s=Br();if(!s)throw ec(Zl.UNEXPECTED_ERROR);const r=this.$options;if(r.i18n){const s=r.i18n;if(r.__i18n&&(s.__i18n=r.__i18n),s.__root=t,this===this.$root)this.$i18n=Ac(e,s);else{s.__injectWithOption=!0,s.__extender=n.__vueI18nExtend,this.$i18n=vc(s);const e=this.$i18n;e.__extender&&(e.__disposer=e.__extender(this.$i18n))}}else if(r.__i18n)if(this===this.$root)this.$i18n=Ac(e,r);else{this.$i18n=vc({__i18n:r.__i18n,__injectWithOption:!0,__extender:n.__vueI18nExtend,__root:t});const e=this.$i18n;e.__extender&&(e.__disposer=e.__extender(this.$i18n))}else this.$i18n=e;r.__i18nGlobal&&uc(t,r,r),this.$t=(...e)=>this.$i18n.t(...e),this.$rt=(...e)=>this.$i18n.rt(...e),this.$tc=(...e)=>this.$i18n.tc(...e),this.$te=(e,t)=>this.$i18n.te(e,t),this.$d=(...e)=>this.$i18n.d(...e),this.$n=(...e)=>this.$i18n.n(...e),this.$tm=e=>this.$i18n.tm(e),n.__setInstance(s,this.$i18n)},mounted(){},unmounted(){const e=Br();if(!e)throw ec(Zl.UNEXPECTED_ERROR);const t=this.$i18n;delete this.$t,delete this.$rt,delete this.$tc,delete this.$te,delete this.$d,delete this.$n,delete this.$tm,t.__disposer&&(t.__disposer(),delete t.__disposer,delete t.__extender),n.__deleteInstance(e),delete this.$i18n}}}(a,a.__composer,e));const o=t.unmount;t.unmount=()=>{i&&i(),e.dispose(),o()}}))},get global(){return a},dispose(){o.stop()},__instances:i,__getInstance:function(e){return i.get(e)||null},__setInstance:function(e,t){i.set(e,t)},__deleteInstance:function(e){i.delete(e)}};return e}}({legacy:!1,locale:"en",fallbackLocale:"en",messages:R_});Zh.use((e=>{e.watchConf(["locale"],(e=>{"string"==typeof e.locale&&"auto"!==e.locale&&(aE.global.locale.value=e.locale)}))}));const lE=((...e)=>{const t=(to||(to=lr(eo))).createApp(...e),{mount:n}=t;return t.mount=e=>{const s=function(e){if(L(e)){return document.querySelector(e)}return e}(e);if(!s)return;const r=t._component;T(r)||r.render||r.template||(r.template=s.innerHTML),s.innerHTML="";const i=n(s,!1,function(e){if(e instanceof SVGElement)return"svg";if("function"==typeof MathMLElement&&e instanceof MathMLElement)return"mathml"}(s));return s instanceof Element&&(s.removeAttribute("v-cloak"),s.setAttribute("data-v-app","")),i},t})(oE);var cE;lE.use(aE),cE=function(){const e=document.createElement("div");return e.style.display="none",document.body.append(e),Zh.init({el:e,server:"../",pageKey:nf.pageKey,site:nf.site,darkMode:nf.darkMode,useBackendConf:!0,pvAdd:!1,remoteConfModifier:e=>{e.noComment='<div class="atk-sidebar-no-content">No Content</div>',e.flatMode=!0,e.pagination={pageSize:20,readMore:!1,autoLoad:!1},e.listUnreadHighlight=!0}})}(),ef=cE;const uE=function(e){const{extendRoutes:t}=e;return N_(Object.assign(e,{routes:"function"==typeof t?t(ew):ew}))}({history:((dE=location.host?dE||location.pathname+location.search:"").includes("#")||(dE+="#"),Vw(dE))});var dE;lE.use(uE);const pE=function(){const e=ge(!0),t=e.run((()=>Mt({})));let n=[],s=[];const r=Tt({install(e){so(r),r._a=e,e.provide(ro,r),e.config.globalProperties.$pinia=r,s.forEach((e=>n.push(e))),s=[]},use(e){return this._a?n.push(e):s.push(e),this},_p:n,_a:null,_e:e,_s:new Map,state:t});return r}();lE.use(pE),lE.mount("#app");
|