lollms-webui/web/dist/assets/index-c75baf49.js

147 lines
920 KiB
JavaScript
Raw Normal View History

2023-08-04 22:28:36 +00:00
(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))s(o);new MutationObserver(o=>{for(const r of o)if(r.type==="childList")for(const i of r.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&s(i)}).observe(document,{childList:!0,subtree:!0});function n(o){const r={};return o.integrity&&(r.integrity=o.integrity),o.referrerPolicy&&(r.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?r.credentials="include":o.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function s(o){if(o.ep)return;o.ep=!0;const r=n(o);fetch(o.href,r)}})();function xl(t,e){const n=Object.create(null),s=t.split(",");for(let o=0;o<s.length;o++)n[s[o]]=!0;return e?o=>!!n[o.toLowerCase()]:o=>!!n[o]}function Ct(t){if(Ce(t)){const e={};for(let n=0;n<t.length;n++){const s=t[n],o=Je(s)?km(s):Ct(s);if(o)for(const r in o)e[r]=o[r]}return e}else{if(Je(t))return t;if(Ke(t))return t}}const vm=/;(?![^(]*\))/g,wm=/:([^]+)/,xm=/\/\*.*?\*\//gs;function km(t){const e={};return t.replace(xm,"").split(vm).forEach(n=>{if(n){const s=n.split(wm);s.length>1&&(e[s[0].trim()]=s[1].trim())}}),e}function Te(t){let e="";if(Je(t))e=t;else if(Ce(t))for(let n=0;n<t.length;n++){const s=Te(t[n]);s&&(e+=s+" ")}else if(Ke(t))for(const n in t)t[n]&&(e+=n+" ");return e.trim()}const Em="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",Cm=xl(Em);function $h(t){return!!t||t===""}function Am(t,e){if(t.length!==e.length)return!1;let n=!0;for(let s=0;n&&s<t.length;s++)n=No(t[s],e[s]);return n}function No(t,e){if(t===e)return!0;let n=Oc(t),s=Oc(e);if(n||s)return n&&s?t.getTime()===e.getTime():!1;if(n=po(t),s=po(e),n||s)return t===e;if(n=Ce(t),s=Ce(e),n||s)return n&&s?Am(t,e):!1;if(n=Ke(t),s=Ke(e),n||s){if(!n||!s)return!1;const o=Object.keys(t).length,r=Object.keys(e).length;if(o!==r)return!1;for(const i in t){const a=t.hasOwnProperty(i),l=e.hasOwnProperty(i);if(a&&!l||!a&&l||!No(t[i],e[i]))return!1}}return String(t)===String(e)}function kl(t,e){return t.findIndex(n=>No(n,e))}const H=t=>Je(t)?t:t==null?"":Ce(t)||Ke(t)&&(t.toString===Uh||!Re(t.toString))?JSON.stringify(t,jh,2):String(t),jh=(t,e)=>e&&e.__v_isRef?jh(t,e.value):bs(e)?{[`Map(${e.size})`]:[...e.entries()].reduce((n,[s,o])=>(n[`${s} =>`]=o,n),{})}:Bs(e)?{[`Set(${e.size})`]:[...e.values()]}:Ke(e)&&!Ce(e)&&!qh(e)?String(e):e,We={},_s=[],Pt=()=>{},Sm=()=>!1,Tm=/^on[^a-z]/,zr=t=>Tm.test(t),El=t=>t.startsWith("onUpdate:"),ot=Object.assign,Cl=(t,e)=>{const n=t.indexOf(e);n>-1&&t.splice(n,1)},Mm=Object.prototype.hasOwnProperty,Fe=(t,e)=>Mm.call(t,e),Ce=Array.isArray,bs=t=>$s(t)==="[object Map]",Bs=t=>$s(t)==="[object Set]",Oc=t=>$s(t)==="[object Date]",Om=t=>$s(t)==="[object RegExp]",Re=t=>typeof t=="function",Je=t=>typeof t=="string",po=t=>typeof t=="symbol",Ke=t=>t!==null&&typeof t=="object",zh=t=>Ke(t)&&Re(t.then)&&Re(t.catch),Uh=Object.prototype.toString,$s=t=>Uh.call(t),Rm=t=>$s(t).slice(8,-1),qh=t=>$s(t)==="[object Object]",Al=t=>Je(t)&&t!=="NaN"&&t[0]!=="-"&&""+parseInt(t,10)===t,or=xl(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Ur=t=>{const e=Object.create(null);return n=>e[n]||(e[n]=t(n))},Nm=/-(\w)/g,Zt=Ur(t=>t.replace(Nm,(e,n)=>n?n.toUpperCase():"")),Dm=/\B([A-Z])/g,ts=Ur(t=>t.replace(Dm,"-$1").toLowerCase()),qr=Ur(t=>t.charAt(0).toUpperCase()+t.slice(1)),ki=Ur(t=>t?`on${qr(t)}`:""),go=(t,e)=>!Object.is(t,e),ys=(t,e)=>{for(let n=0;n<t.length;n++)t[n](e)},_r=(t,e,n)=>{Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value:n})},br=t=>{const e=parseFloat(t);return isNaN(e)?t:e},Lm=t=>{const e=Je(t)?Number(t):NaN;return isNaN(e)?t:e};let Rc;const Im=()=>Rc||(Rc=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});let Nt;class Pm{constructor(e=!1){this.detached=e,this._active=!0,this.effects=[],this.cleanups=[],this.parent=Nt,!e&&Nt&&(this.index=(Nt.scopes||(Nt.scopes=[])).push(this)
2023-07-10 23:12:40 +00:00
* vuex v4.0.2
* (c) 2021 Evan You
* @license MIT
2023-08-02 23:26:02 +00:00
*/var a0="store";function qs(t,e){Object.keys(t).forEach(function(n){return e(t[n],n)})}function l0(t){return t!==null&&typeof t=="object"}function c0(t){return t&&typeof t.then=="function"}function u0(t,e){return function(){return t(e)}}function Kf(t,e,n){return e.indexOf(t)<0&&(n&&n.prepend?e.unshift(t):e.push(t)),function(){var s=e.indexOf(t);s>-1&&e.splice(s,1)}}function Wf(t,e){t._actions=Object.create(null),t._mutations=Object.create(null),t._wrappedGetters=Object.create(null),t._modulesNamespaceMap=Object.create(null);var n=t.state;ei(t,n,[],t._modules.root,!0),Vl(t,n,e)}function Vl(t,e,n){var s=t._state;t.getters={},t._makeLocalGettersCache=Object.create(null);var o=t._wrappedGetters,r={};qs(o,function(i,a){r[a]=u0(i,t),Object.defineProperty(t.getters,a,{get:function(){return r[a]()},enumerable:!0})}),t._state=Us({data:e}),t.strict&&g0(t),s&&n&&t._withCommit(function(){s.data=null})}function ei(t,e,n,s,o){var r=!n.length,i=t._modules.getNamespace(n);if(s.namespaced&&(t._modulesNamespaceMap[i],t._modulesNamespaceMap[i]=s),!r&&!o){var a=Gl(e,n.slice(0,-1)),l=n[n.length-1];t._withCommit(function(){a[l]=s.state})}var c=s.context=d0(t,i,n);s.forEachMutation(function(d,h){var f=i+h;h0(t,f,d,c)}),s.forEachAction(function(d,h){var f=d.root?h:i+h,g=d.handler||d;f0(t,f,g,c)}),s.forEachGetter(function(d,h){var f=i+h;p0(t,f,d,c)}),s.forEachChild(function(d,h){ei(t,e,n.concat(h),d,o)})}function d0(t,e,n){var s=e==="",o={dispatch:s?t.dispatch:function(r,i,a){var l=kr(r,i,a),c=l.payload,d=l.options,h=l.type;return(!d||!d.root)&&(h=e+h),t.dispatch(h,c)},commit:s?t.commit:function(r,i,a){var l=kr(r,i,a),c=l.payload,d=l.options,h=l.type;(!d||!d.root)&&(h=e+h),t.commit(h,c,d)}};return Object.defineProperties(o,{getters:{get:s?function(){return t.getters}:function(){return Zf(t,e)}},state:{get:function(){return Gl(t.state,n)}}}),o}function Zf(t,e){if(!t._makeLocalGettersCache[e]){var n={},s=e.length;Object.keys(t.getters).forEach(function(o){if(o.slice(0,s)===e){var r=o.slice(s);Object.defineProperty(n,r,{get:function(){return t.getters[o]},enumerable:!0})}}),t._makeLocalGettersCache[e]=n}return t._makeLocalGettersCache[e]}function h0(t,e,n,s){var o=t._mutations[e]||(t._mutations[e]=[]);o.push(function(i){n.call(t,s.state,i)})}function f0(t,e,n,s){var o=t._actions[e]||(t._actions[e]=[]);o.push(function(i){var a=n.call(t,{dispatch:s.dispatch,commit:s.commit,getters:s.getters,state:s.state,rootGetters:t.getters,rootState:t.state},i);return c0(a)||(a=Promise.resolve(a)),t._devtoolHook?a.catch(function(l){throw t._devtoolHook.emit("vuex:error",l),l}):a})}function p0(t,e,n,s){t._wrappedGetters[e]||(t._wrappedGetters[e]=function(r){return n(s.state,s.getters,r.state,r.getters)})}function g0(t){Wn(function(){return t._state.data},function(){},{deep:!0,flush:"sync"})}function Gl(t,e){return e.reduce(function(n,s){return n[s]},t)}function kr(t,e,n){return l0(t)&&t.type&&(n=e,e=t,t=t.type),{type:t,payload:e,options:n}}var m0="vuex bindings",fu="vuex:mutations",Ni="vuex:actions",cs="vuex",_0=0;function b0(t,e){i0({id:"org.vuejs.vuex",app:t,label:"Vuex",homepage:"https://next.vuex.vuejs.org/",logo:"https://vuejs.org/images/icons/favicon-96x96.png",packageName:"vuex",componentStateTypes:[m0]},function(n){n.addTimelineLayer({id:fu,label:"Vuex Mutations",color:pu}),n.addTimelineLayer({id:Ni,label:"Vuex Actions",color:pu}),n.addInspector({id:cs,label:"Vuex",icon:"storage",treeFilterPlaceholder:"Filter stores..."}),n.on.getInspectorTree(function(s){if(s.app===t&&s.inspectorId===cs)if(s.filter){var o=[];Xf(o,e._modules.root,s.filter,""),s.rootNodes=o}else s.rootNodes=[Qf(e._modules.root,"")]}),n.on.getInspectorState(function(s){if(s.app===t&&s.inspectorId===cs){var o=s.nodeId;Zf(e,o),s.state=w0(k0(e._modules,o),o==="root"?e.getters:e._makeLocalGettersCache,o)}}),n.on.editInspectorState(function(s){if(s.app===t&&s.inspectorId===cs){var o=s.nodeId,r=s.path;o!=="root"&&(r=o.split("/").filter(Boolean).concat(r)),e._withCommit(function(){s.set(e._state.data,r,s.state.value)})}}),e.subscribe(function(s,o){var r={};s.payload&&(r.payload=s.payload),r.state
`).forEach(function(i){o=i.indexOf(":"),n=i.substring(0,o).trim().toLowerCase(),s=i.substring(o+1).trim(),!(!n||e[n]&&bb[n])&&(n==="set-cookie"?e[n]?e[n].push(s):e[n]=[s]:e[n]=e[n]?e[n]+", "+s:s)}),e},vu=Symbol("internals");function Js(t){return t&&String(t).trim().toLowerCase()}function cr(t){return t===!1||t==null?t:K.isArray(t)?t.map(cr):String(t)}function vb(t){const e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let s;for(;s=n.exec(t);)e[s[1]]=s[2];return e}const wb=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function Li(t,e,n,s,o){if(K.isFunction(s))return s.call(this,e,n);if(o&&(e=n),!!K.isString(e)){if(K.isString(s))return e.indexOf(s)!==-1;if(K.isRegExp(s))return s.test(e)}}function xb(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,n,s)=>n.toUpperCase()+s)}function kb(t,e){const n=K.toCamelCase(" "+e);["get","set","has"].forEach(s=>{Object.defineProperty(t,s+n,{value:function(o,r,i){return this[s].call(this,e,o,r,i)},configurable:!0})})}class ri{constructor(e){e&&this.set(e)}set(e,n,s){const o=this;function r(a,l,c){const d=Js(l);if(!d)throw new Error("header name must be a non-empty string");const h=K.findKey(o,d);(!h||o[h]===void 0||c===!0||c===void 0&&o[h]!==!1)&&(o[h||l]=cr(a))}const i=(a,l)=>K.forEach(a,(c,d)=>r(c,d,l));return K.isPlainObject(e)||e instanceof this.constructor?i(e,n):K.isString(e)&&(e=e.trim())&&!wb(e)?i(yb(e),n):e!=null&&r(n,e,s),this}get(e,n){if(e=Js(e),e){const s=K.findKey(this,e);if(s){const o=this[s];if(!n)return o;if(n===!0)return vb(o);if(K.isFunction(n))return n.call(this,o,s);if(K.isRegExp(n))return n.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,n){if(e=Js(e),e){const s=K.findKey(this,e);return!!(s&&this[s]!==void 0&&(!n||Li(this,this[s],s,n)))}return!1}delete(e,n){const s=this;let o=!1;function r(i){if(i=Js(i),i){const a=K.findKey(s,i);a&&(!n||Li(s,s[a],a,n))&&(delete s[a],o=!0)}}return K.isArray(e)?e.forEach(r):r(e),o}clear(e){const n=Object.keys(this);let s=n.length,o=!1;for(;s--;){const r=n[s];(!e||Li(this,this[r],r,e,!0))&&(delete this[r],o=!0)}return o}normalize(e){const n=this,s={};return K.forEach(this,(o,r)=>{const i=K.findKey(s,r);if(i){n[i]=cr(o),delete n[r];return}const a=e?xb(r):String(r).trim();a!==r&&delete n[r],n[a]=cr(o),s[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const n=Object.create(null);return K.forEach(this,(s,o)=>{s!=null&&s!==!1&&(n[o]=e&&K.isArray(s)?s.join(", "):s)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,n])=>e+": "+n).join(`
2023-08-04 22:28:36 +00:00
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){const s=new this(e);return n.forEach(o=>s.set(o)),s}static accessor(e){const s=(this[vu]=this[vu]={accessors:{}}).accessors,o=this.prototype;function r(i){const a=Js(i);s[a]||(kb(o,i),s[a]=!0)}return K.isArray(e)?e.forEach(r):r(e),this}}ri.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);K.freezeMethods(ri.prototype);K.freezeMethods(ri);const on=ri;function Ii(t,e){const n=this||Jl,s=e||n,o=on.from(s.headers);let r=s.data;return K.forEach(t,function(a){r=a.call(n,r,o.normalize(),e?e.status:void 0)}),o.normalize(),r}function _p(t){return!!(t&&t.__CANCEL__)}function Lo(t,e,n){Be.call(this,t??"canceled",Be.ERR_CANCELED,e,n),this.name="CanceledError"}K.inherits(Lo,Be,{__CANCEL__:!0});function Eb(t,e,n){const s=n.config.validateStatus;!n.status||!s||s(n.status)?t(n):e(new Be("Request failed with status code "+n.status,[Be.ERR_BAD_REQUEST,Be.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}const Cb=qt.isStandardBrowserEnv?function(){return{write:function(n,s,o,r,i,a){const l=[];l.push(n+"="+encodeURIComponent(s)),K.isNumber(o)&&l.push("expires="+new Date(o).toGMTString()),K.isString(r)&&l.push("path="+r),K.isString(i)&&l.push("domain="+i),a===!0&&l.push("secure"),document.cookie=l.join("; ")},read:function(n){const s=document.cookie.match(new RegExp("(^|;\\s*)("+n+")=([^;]*)"));return s?decodeURIComponent(s[3]):null},remove:function(n){this.write(n,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}();function Ab(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function Sb(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}function bp(t,e){return t&&!Ab(e)?Sb(t,e):e}const Tb=qt.isStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let s;function o(r){let i=r;return e&&(n.setAttribute("href",i),i=n.href),n.setAttribute("href",i),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return s=o(window.location.href),function(i){const a=K.isString(i)?o(i):i;return a.protocol===s.protocol&&a.host===s.host}}():function(){return function(){return!0}}();function Mb(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function Ob(t,e){t=t||10;const n=new Array(t),s=new Array(t);let o=0,r=0,i;return e=e!==void 0?e:1e3,function(l){const c=Date.now(),d=s[r];i||(i=c),n[o]=l,s[o]=c;let h=r,f=0;for(;h!==o;)f+=n[h++],h=h%t;if(o=(o+1)%t,o===r&&(r=(r+1)%t),c-i<e)return;const g=d&&c-d;return g?Math.round(f*1e3/g):void 0}}function wu(t,e){let n=0;const s=Ob(50,250);return o=>{const r=o.loaded,i=o.lengthComputable?o.total:void 0,a=r-n,l=s(a),c=r<=i;n=r;const d={loaded:r,total:i,progress:i?r/i:void 0,bytes:a,rate:l||void 0,estimated:l&&i&&c?(i-r)/l:void 0,event:o};d[e?"download":"upload"]=!0,t(d)}}const Rb=typeof XMLHttpRequest<"u",Nb=Rb&&function(t){return new Promise(function(n,s){let o=t.data;const r=on.from(t.headers).normalize(),i=t.responseType;let a;function l(){t.cancelToken&&t.cancelToken.unsubscribe(a),t.signal&&t.signal.removeEventListener("abort",a)}K.isFormData(o)&&(qt.isStandardBrowserEnv||qt.isStandardBrowserWebWorkerEnv)&&r.setContentType(!1);let c=new XMLHttpRequest;if(t.auth){const g=t.auth.username||"",m=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";r.set("Authorization","Basic "+btoa(g+":"+m))}const d=bp(t.baseURL,t.url);c.open(t.method.toUpperCase(),pp(d,t.params,t.paramsSerializer),!0),c.timeout=t.timeout;function h(){if(!c)return;const g=on.from("getAllResponseHeaders"in c&&c.getAllResponseHeaders()),p={data:!i||i==="text"||i==="json"?c.responseText:c.response,status:c.status,statusText:c.statusText,headers:g,config:t,request:c};Eb(function(_){n(_),l()},function(_){s(_),l()
2023-07-10 23:12:40 +00:00
* vue-router v4.1.6
* (c) 2022 Eduardo San Martin Morote
* @license MIT
2023-08-02 23:26:02 +00:00
*/const fs=typeof window<"u";function $b(t){return t.__esModule||t[Symbol.toStringTag]==="Module"}const qe=Object.assign;function Fi(t,e){const n={};for(const s in e){const o=e[s];n[s]=Ft(o)?o.map(t):t(o)}return n}const io=()=>{},Ft=Array.isArray,jb=/\/$/,zb=t=>t.replace(jb,"");function Bi(t,e,n="/"){let s,o={},r="",i="";const a=e.indexOf("#");let l=e.indexOf("?");return a<l&&a>=0&&(l=-1),l>-1&&(s=e.slice(0,l),r=e.slice(l+1,a>-1?a:e.length),o=t(r)),a>-1&&(s=s||e.slice(0,a),i=e.slice(a,e.length)),s=Vb(s??e,n),{fullPath:s+(r&&"?")+r+i,path:s,query:o,hash:i}}function Ub(t,e){const n=e.query?t(e.query):"";return e.path+(n&&"?")+n+(e.hash||"")}function Cu(t,e){return!e||!t.toLowerCase().startsWith(e.toLowerCase())?t:t.slice(e.length)||"/"}function qb(t,e,n){const s=e.matched.length-1,o=n.matched.length-1;return s>-1&&s===o&&Os(e.matched[s],n.matched[o])&&wp(e.params,n.params)&&t(e.query)===t(n.query)&&e.hash===n.hash}function Os(t,e){return(t.aliasOf||t)===(e.aliasOf||e)}function wp(t,e){if(Object.keys(t).length!==Object.keys(e).length)return!1;for(const n in t)if(!Hb(t[n],e[n]))return!1;return!0}function Hb(t,e){return Ft(t)?Au(t,e):Ft(e)?Au(e,t):t===e}function Au(t,e){return Ft(e)?t.length===e.length&&t.every((n,s)=>n===e[s]):t.length===1&&t[0]===e}function Vb(t,e){if(t.startsWith("/"))return t;if(!t)return e;const n=e.split("/"),s=t.split("/");let o=n.length-1,r,i;for(r=0;r<s.length;r++)if(i=s[r],i!==".")if(i==="..")o>1&&o--;else break;return n.slice(0,o).join("/")+"/"+s.slice(r-(r===s.length?1:0)).join("/")}var Co;(function(t){t.pop="pop",t.push="push"})(Co||(Co={}));var ao;(function(t){t.back="back",t.forward="forward",t.unknown=""})(ao||(ao={}));function Gb(t){if(!t)if(fs){const e=document.querySelector("base");t=e&&e.getAttribute("href")||"/",t=t.replace(/^\w+:\/\/[^\/]+/,"")}else t="/";return t[0]!=="/"&&t[0]!=="#"&&(t="/"+t),zb(t)}const Kb=/^[^#]+#/;function Wb(t,e){return t.replace(Kb,"#")+e}function Zb(t,e){const n=document.documentElement.getBoundingClientRect(),s=t.getBoundingClientRect();return{behavior:e.behavior,left:s.left-n.left-(e.left||0),top:s.top-n.top-(e.top||0)}}const ii=()=>({left:window.pageXOffset,top:window.pageYOffset});function Yb(t){let e;if("el"in t){const n=t.el,s=typeof n=="string"&&n.startsWith("#"),o=typeof n=="string"?s?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!o)return;e=Zb(o,t)}else e=t;"scrollBehavior"in document.documentElement.style?window.scrollTo(e):window.scrollTo(e.left!=null?e.left:window.pageXOffset,e.top!=null?e.top:window.pageYOffset)}function Su(t,e){return(history.state?history.state.position-e:-1)+t}const ol=new Map;function Jb(t,e){ol.set(t,e)}function Qb(t){const e=ol.get(t);return ol.delete(t),e}let Xb=()=>location.protocol+"//"+location.host;function xp(t,e){const{pathname:n,search:s,hash:o}=e,r=t.indexOf("#");if(r>-1){let a=o.includes(t.slice(r))?t.slice(r).length:1,l=o.slice(a);return l[0]!=="/"&&(l="/"+l),Cu(l,"")}return Cu(n,t)+s+o}function ey(t,e,n,s){let o=[],r=[],i=null;const a=({state:f})=>{const g=xp(t,location),m=n.value,p=e.value;let b=0;if(f){if(n.value=g,e.value=f,i&&i===m){i=null;return}b=p?f.position-p.position:0}else s(g);o.forEach(_=>{_(n.value,m,{delta:b,type:Co.pop,direction:b?b>0?ao.forward:ao.back:ao.unknown})})};function l(){i=n.value}function c(f){o.push(f);const g=()=>{const m=o.indexOf(f);m>-1&&o.splice(m,1)};return r.push(g),g}function d(){const{history:f}=window;f.state&&f.replaceState(qe({},f.state,{scroll:ii()}),"")}function h(){for(const f of r)f();r=[],window.removeEventListener("popstate",a),window.removeEventListener("beforeunload",d)}return window.addEventListener("popstate",a),window.addEventListener("beforeunload",d),{pauseListeners:l,listen:c,destroy:h}}function Tu(t,e,n,s=!1,o=!1){return{back:t,current:e,forward:n,replaced:s,position:window.history.length,scroll:o?ii():null}}function ty(t){const{history:e,location:n}=window,s={value:xp(t,n)},o={value:e.state};o.value||r(s.value,{back:null,current:s.value,forward:null,position:e.length-1,replaced:!0,scroll:null},!0);function r(l,c,d){const h=t.indexOf("#"
2023-07-10 23:12:40 +00:00
Copyright (c) 2016 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
2023-08-02 23:41:58 +00:00
*/(function(){var a=function(){function l(){}l.prototype=Object.create(null);function c(_,y){for(var x=y.length,A=0;A<x;++A)p(_,y[A])}var d={}.hasOwnProperty;function h(_,y){_[y]=!0}function f(_,y){for(var x in y)d.call(y,x)&&(_[x]=!!y[x])}var g=/\s+/;function m(_,y){for(var x=y.split(g),A=x.length,R=0;R<A;++R)_[x[R]]=!0}function p(_,y){if(y){var x=typeof y;x==="string"?m(_,y):Array.isArray(y)?c(_,y):x==="object"?f(_,y):x==="number"&&h(_,y)}}function b(){for(var _=arguments.length,y=Array(_),x=0;x<_;x++)y[x]=arguments[x];var A=new l;c(A,y);var R=[];for(var O in A)A[O]&&R.push(O);return R.join(" ")}return b}();typeof n<"u"&&n.exports?n.exports=a:(r=[],i=function(){return a}.apply(s,r),i!==void 0&&(n.exports=i))})()},"./node_modules/core-js/es/array/from.js":function(n,s,o){o("./node_modules/core-js/modules/es.string.iterator.js"),o("./node_modules/core-js/modules/es.array.from.js");var r=o("./node_modules/core-js/internals/path.js");n.exports=r.Array.from},"./node_modules/core-js/internals/a-function.js":function(n,s){n.exports=function(o){if(typeof o!="function")throw TypeError(String(o)+" is not a function");return o}},"./node_modules/core-js/internals/an-object.js":function(n,s,o){var r=o("./node_modules/core-js/internals/is-object.js");n.exports=function(i){if(!r(i))throw TypeError(String(i)+" is not an object");return i}},"./node_modules/core-js/internals/array-from.js":function(n,s,o){var r=o("./node_modules/core-js/internals/bind-context.js"),i=o("./node_modules/core-js/internals/to-object.js"),a=o("./node_modules/core-js/internals/call-with-safe-iteration-closing.js"),l=o("./node_modules/core-js/internals/is-array-iterator-method.js"),c=o("./node_modules/core-js/internals/to-length.js"),d=o("./node_modules/core-js/internals/create-property.js"),h=o("./node_modules/core-js/internals/get-iterator-method.js");n.exports=function(g){var m=i(g),p=typeof this=="function"?this:Array,b=arguments.length,_=b>1?arguments[1]:void 0,y=_!==void 0,x=0,A=h(m),R,O,D,v;if(y&&(_=r(_,b>2?arguments[2]:void 0,2)),A!=null&&!(p==Array&&l(A)))for(v=A.call(m),O=new p;!(D=v.next()).done;x++)d(O,x,y?a(v,_,[D.value,x],!0):D.value);else for(R=c(m.length),O=new p(R);R>x;x++)d(O,x,y?_(m[x],x):m[x]);return O.length=x,O}},"./node_modules/core-js/internals/array-includes.js":function(n,s,o){var r=o("./node_modules/core-js/internals/to-indexed-object.js"),i=o("./node_modules/core-js/internals/to-length.js"),a=o("./node_modules/core-js/internals/to-absolute-index.js");n.exports=function(l){return function(c,d,h){var f=r(c),g=i(f.length),m=a(h,g),p;if(l&&d!=d){for(;g>m;)if(p=f[m++],p!=p)return!0}else for(;g>m;m++)if((l||m in f)&&f[m]===d)return l||m||0;return!l&&-1}}},"./node_modules/core-js/internals/bind-context.js":function(n,s,o){var r=o("./node_modules/core-js/internals/a-function.js");n.exports=function(i,a,l){if(r(i),a===void 0)return i;switch(l){case 0:return function(){return i.call(a)};case 1:return function(c){return i.call(a,c)};case 2:return function(c,d){return i.call(a,c,d)};case 3:return function(c,d,h){return i.call(a,c,d,h)}}return function(){return i.apply(a,arguments)}}},"./node_modules/core-js/internals/call-with-safe-iteration-closing.js":function(n,s,o){var r=o("./node_modules/core-js/internals/an-object.js");n.exports=function(i,a,l,c){try{return c?a(r(l)[0],l[1]):a(l)}catch(h){var d=i.return;throw d!==void 0&&r(d.call(i)),h}}},"./node_modules/core-js/internals/check-correctness-of-iteration.js":function(n,s,o){var r=o("./node_modules/core-js/internals/well-known-symbol.js"),i=r("iterator"),a=!1;try{var l=0,c={next:function(){return{done:!!l++}},return:function(){a=!0}};c[i]=function(){return this},Array.from(c,function(){throw 2})}catch{}n.exports=function(d,h){if(!h&&!a)return!1;var f=!1;try{var g={};g[i]=function(){return{next:function(){return{done:f=!0}}}},d(g)}catch{}return f}},"./node_modules/core-js/internals/classof-raw.js":function(n,s){var o={}.toString;n.exports=function(r){return o.call(r).slice(8,-1)}},"./node_modules/core-js/internals/classof.js":function(n,s,o){var r=o("./node_modules/core-js/internals/classof-r
2023-08-02 23:26:02 +00:00
h-87.51l-313.51,338.7l-253.31-338.7H283.94z M412.63,231.77h136.81l604.13,807.76h-136.81L412.63,231.77z`})],-1),n2=[t2],s2=u("i",{"data-feather":"sun"},null,-1),o2=[s2],r2=u("i",{"data-feather":"moon"},null,-1),i2=[r2],a2=u("body",null,null,-1),l2={name:"TopBar",computed:{isConnected(){return this.$store.state.isConnected}},data(){return{codeBlockStylesheet:"",sunIcon:document.querySelector(".sun"),moonIcon:document.querySelector(".moon"),userTheme:localStorage.getItem("theme"),systemTheme:window.matchMedia("prefers-color-scheme: dark").matches}},mounted(){this.sunIcon=document.querySelector(".sun"),this.moonIcon=document.querySelector(".moon"),this.userTheme=localStorage.getItem("theme"),this.systemTheme=window.matchMedia("prefers-color-scheme: dark").matches,this.themeCheck(),_e(()=>{we.replace()})},created(){this.sunIcon=document.querySelector(".sun"),this.moonIcon=document.querySelector(".moon"),this.userTheme=localStorage.getItem("theme"),this.systemTheme=window.matchMedia("prefers-color-scheme: dark").matches},methods:{themeCheck(){if(this.userTheme=="dark"||!this.userTheme&&this.systemTheme){document.documentElement.classList.add("dark"),this.moonIcon.classList.add("display-none"),_e(()=>{ji(()=>Promise.resolve({}),["assets/stackoverflow-dark-7e41bf22.css"])});return}_e(()=>{ji(()=>Promise.resolve({}),["assets/stackoverflow-light-b5b5e2eb.css"])}),this.sunIcon.classList.add("display-none")},themeSwitch(){if(document.documentElement.classList.contains("dark")){document.documentElement.classList.remove("dark"),localStorage.setItem("theme","light"),this.userTheme=="light",this.iconToggle();return}ji(()=>Promise.resolve({}),["assets/tokyo-night-dark-a847eb67.css"]),document.documentElement.classList.add("dark"),localStorage.setItem("theme","dark"),this.userTheme=="dark",this.iconToggle()},iconToggle(){this.sunIcon.classList.toggle("display-none"),this.moonIcon.classList.toggle("display-none")}},components:{Navigation:Ip}},c2=Object.assign(l2,{setup(t){return(e,n)=>(E(),S(Oe,null,[u("header",Ky,[u("nav",Wy,[fe(ht(vn),{to:{name:"discussions"}},{default:$e(()=>[Zy]),_:1}),u("div",Yy,[u("div",{title:"Connection status",class:Te(["dot",{"dot-green":e.isConnected,"dot-red":!e.isConnected}])},null,2),Jy,u("a",Qy,[u("div",Xy,[(E(),S("svg",e2,n2))])]),u("div",{class:"sun text-2xl w-6 hover:text-primary duration-150",title:"Swith to Light theme",onClick:n[0]||(n[0]=s=>e.themeSwitch())},o2),u("div",{class:"moon text-2xl w-6 hover:text-primary duration-150",title:"Swith to Dark theme",onClick:n[1]||(n[1]=s=>e.themeSwitch())},i2)])]),fe(Ip)]),a2],64))}}),u2={class:"flex flex-col h-screen font-sans bg-bg-light text-slate-950 dark:bg-bg-dark dark:text-slate-50"},d2={class:"flex overflow-hidden flex-grow"},h2={__name:"App",setup(t){return(e,n)=>(E(),S("div",u2,[fe(c2),u("div",d2,[fe(ht(Np),null,{default:$e(({Component:s})=>[(E(),nt(N_,null,[(E(),nt(U_(s)))],1024))]),_:1})])]))}};const Ue=(t,e)=>{const n=t.__vccOpts||t;for(const[s,o]of e)n[s]=o;return n},f2={data(){return{activeExtension:null}},computed:{activeExtensions(){return this.$store.state.extensionsZoo.filter(t=>t.is_active)}},methods:{showExtensionPage(t){this.activeExtension=t}}},p2={key:0},g2=["onClick"],m2={key:0},_2=["src"],b2={key:1},y2=u("p",null,"No extension is active. Please install and activate an extension.",-1),v2=[y2];function w2(t,e,n,s,o,r){return E(),S("div",null,[r.activeExtensions.length>0?(E(),S("div",p2,[(E(!0),S(Oe,null,Ze(r.activeExtensions,i=>(E(),S("div",{key:i.name,onClick:a=>r.showExtensionPage(i)},[u("div",{class:Te({"active-tab":i===o.activeExtension})},H(i.name),3)],8,g2))),128)),o.activeExtension?(E(),S("div",m2,[u("iframe",{src:o.activeExtension.page,width:"100%",height:"500px",frameborder:"0"},null,8,_2)])):B("",!0)])):(E(),S("div",b2,v2))])}const x2=Ue(f2,[["render",w2]]);var Pp={exports:{}};/* @license
2023-07-10 23:12:40 +00:00
Papa Parse
v5.4.1
https://github.com/mholt/PapaParse
License: MIT
2023-08-02 23:26:02 +00:00
*/(function(t,e){(function(n,s){t.exports=s()})(Dp,function n(){var s=typeof self<"u"?self:typeof window<"u"?window:s!==void 0?s:{},o=!s.document&&!!s.postMessage,r=s.IS_PAPA_WORKER||!1,i={},a=0,l={parse:function(v,k){var M=(k=k||{}).dynamicTyping||!1;if(D(M)&&(k.dynamicTypingFunction=M,M={}),k.dynamicTyping=M,k.transform=!!D(k.transform)&&k.transform,k.worker&&l.WORKERS_SUPPORTED){var L=function(){if(!l.WORKERS_SUPPORTED)return!1;var J=(ce=s.URL||s.webkitURL||null,Z=n.toString(),l.BLOB_URL||(l.BLOB_URL=ce.createObjectURL(new Blob(["var global = (function() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } return {}; })(); global.IS_PAPA_WORKER=true; ","(",Z,")();"],{type:"text/javascript"})))),I=new s.Worker(J),ce,Z;return I.onmessage=y,I.id=a++,i[I.id]=I}();return L.userStep=k.step,L.userChunk=k.chunk,L.userComplete=k.complete,L.userError=k.error,k.step=D(k.step),k.chunk=D(k.chunk),k.complete=D(k.complete),k.error=D(k.error),delete k.worker,void L.postMessage({input:v,config:k,workerId:L.id})}var F=null;return l.NODE_STREAM_INPUT,typeof v=="string"?(v=function(J){return J.charCodeAt(0)===65279?J.slice(1):J}(v),F=k.download?new h(k):new g(k)):v.readable===!0&&D(v.read)&&D(v.on)?F=new m(k):(s.File&&v instanceof File||v instanceof Object)&&(F=new f(k)),F.stream(v)},unparse:function(v,k){var M=!1,L=!0,F=",",J=`\r
2023-08-02 23:07:29 +00:00
`,I='"',ce=I+I,Z=!1,T=null,q=!1;(function(){if(typeof k=="object"){if(typeof k.delimiter!="string"||l.BAD_DELIMITERS.filter(function(ee){return k.delimiter.indexOf(ee)!==-1}).length||(F=k.delimiter),(typeof k.quotes=="boolean"||typeof k.quotes=="function"||Array.isArray(k.quotes))&&(M=k.quotes),typeof k.skipEmptyLines!="boolean"&&typeof k.skipEmptyLines!="string"||(Z=k.skipEmptyLines),typeof k.newline=="string"&&(J=k.newline),typeof k.quoteChar=="string"&&(I=k.quoteChar),typeof k.header=="boolean"&&(L=k.header),Array.isArray(k.columns)){if(k.columns.length===0)throw new Error("Option columns is empty");T=k.columns}k.escapeChar!==void 0&&(ce=k.escapeChar+I),(typeof k.escapeFormulae=="boolean"||k.escapeFormulae instanceof RegExp)&&(q=k.escapeFormulae instanceof RegExp?k.escapeFormulae:/^[=+\-@\t\r].*$/)}})();var G=new RegExp(b(I),"g");if(typeof v=="string"&&(v=JSON.parse(v)),Array.isArray(v)){if(!v.length||Array.isArray(v[0]))return ye(null,v,Z);if(typeof v[0]=="object")return ye(T||Object.keys(v[0]),v,Z)}else if(typeof v=="object")return typeof v.data=="string"&&(v.data=JSON.parse(v.data)),Array.isArray(v.data)&&(v.fields||(v.fields=v.meta&&v.meta.fields||T),v.fields||(v.fields=Array.isArray(v.data[0])?v.fields:typeof v.data[0]=="object"?Object.keys(v.data[0]):[]),Array.isArray(v.data[0])||typeof v.data[0]=="object"||(v.data=[v.data])),ye(v.fields||[],v.data||[],Z);throw new Error("Unable to serialize unrecognized input");function ye(ee,xe,Ae){var N="";typeof ee=="string"&&(ee=JSON.parse(ee)),typeof xe=="string"&&(xe=JSON.parse(xe));var Q=Array.isArray(ee)&&0<ee.length,V=!Array.isArray(xe[0]);if(Q&&L){for(var te=0;te<ee.length;te++)0<te&&(N+=F),N+=me(ee[te],te);0<xe.length&&(N+=J)}for(var X=0;X<xe.length;X++){var pe=Q?ee.length:xe[X].length,ue=!1,w=Q?Object.keys(xe[X]).length===0:xe[X].length===0;if(Ae&&!Q&&(ue=Ae==="greedy"?xe[X].join("").trim()==="":xe[X].length===1&&xe[X][0].length===0),Ae==="greedy"&&Q){for(var C=[],P=0;P<pe;P++){var $=V?ee[P]:P;C.push(xe[X][$])}ue=C.join("").trim()===""}if(!ue){for(var j=0;j<pe;j++){0<j&&!w&&(N+=F);var ne=Q&&V?ee[j]:j;N+=me(xe[X][ne],j)}X<xe.length-1&&(!Ae||0<pe&&!w)&&(N+=J)}}return N}function me(ee,xe){if(ee==null)return"";if(ee.constructor===Date)return JSON.stringify(ee).slice(1,25);var Ae=!1;q&&typeof ee=="string"&&q.test(ee)&&(ee="'"+ee,Ae=!0);var N=ee.toString().replace(G,ce);return(Ae=Ae||M===!0||typeof M=="function"&&M(ee,xe)||Array.isArray(M)&&M[xe]||function(Q,V){for(var te=0;te<V.length;te++)if(-1<Q.indexOf(V[te]))return!0;return!1}(N,l.BAD_DELIMITERS)||-1<N.indexOf(F)||N.charAt(0)===" "||N.charAt(N.length-1)===" ")?I+N+I:N}}};if(l.RECORD_SEP=String.fromCharCode(30),l.UNIT_SEP=String.fromCharCode(31),l.BYTE_ORDER_MARK="\uFEFF",l.BAD_DELIMITERS=["\r",`
`,'"',l.BYTE_ORDER_MARK],l.WORKERS_SUPPORTED=!o&&!!s.Worker,l.NODE_STREAM_INPUT=1,l.LocalChunkSize=10485760,l.RemoteChunkSize=5242880,l.DefaultDelimiter=",",l.Parser=_,l.ParserHandle=p,l.NetworkStreamer=h,l.FileStreamer=f,l.StringStreamer=g,l.ReadableStreamStreamer=m,s.jQuery){var c=s.jQuery;c.fn.parse=function(v){var k=v.config||{},M=[];return this.each(function(J){if(!(c(this).prop("tagName").toUpperCase()==="INPUT"&&c(this).attr("type").toLowerCase()==="file"&&s.FileReader)||!this.files||this.files.length===0)return!0;for(var I=0;I<this.files.length;I++)M.push({file:this.files[I],inputElem:this,instanceConfig:c.extend({},k)})}),L(),this;function L(){if(M.length!==0){var J,I,ce,Z,T=M[0];if(D(v.before)){var q=v.before(T.file,T.inputElem);if(typeof q=="object"){if(q.action==="abort")return J="AbortError",I=T.file,ce=T.inputElem,Z=q.reason,void(D(v.error)&&v.error({name:J},I,ce,Z));if(q.action==="skip")return void F();typeof q.config=="object"&&(T.instanceConfig=c.extend(T.instanceConfig,q.config))}else if(q==="skip")return void F()}var G=T.instanceConfig.complete;T.instanceConfig.complete=function(ye){D(G)&&G(ye,T.file,T.inputElem),F()},l.parse(T.file,T.instanceConfig)}else D(v.complete)&&v.complete()}function F(){M.splice(0,1),L()}}}function d(v){this._handle=null,this._finished=!1,this._completed=!1,this._halted=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},function(k){var M=R(k);M.chunkSize=parseInt(M.chunkSize),k.step||k.chunk||(M.chunkSize=null),this._handle=new p(M),(this._handle.streamer=this)._config=M}.call(this,v),this.parseChunk=function(k,M){if(this.isFirstChunk&&D(this._config.beforeFirstChunk)){var L=this._config.beforeFirstChunk(k);L!==void 0&&(k=L)}this.isFirstChunk=!1,this._halted=!1;var F=this._partialLine+k;this._partialLine="";var J=this._handle.parse(F,this._baseIndex,!this._finished);if(!this._handle.paused()&&!this._handle.aborted()){var I=J.meta.cursor;this._finished||(this._partialLine=F.substring(I-this._baseIndex),this._baseIndex=I),J&&J.data&&(this._rowCount+=J.data.length);var ce=this._finished||this._config.preview&&this._rowCount>=this._config.preview;if(r)s.postMessage({results:J,workerId:l.WORKER_ID,finished:ce});else if(D(this._config.chunk)&&!M){if(this._config.chunk(J,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);J=void 0,this._completeResults=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(J.data),this._completeResults.errors=this._completeResults.errors.concat(J.errors),this._completeResults.meta=J.meta),this._completed||!ce||!D(this._config.complete)||J&&J.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),ce||J&&J.meta.paused||this._nextChunk(),J}this._halted=!0},this._sendError=function(k){D(this._config.error)?this._config.error(k):r&&this._config.error&&s.postMessage({workerId:l.WORKER_ID,error:k,finished:!1})}}function h(v){var k;(v=v||{}).chunkSize||(v.chunkSize=l.RemoteChunkSize),d.call(this,v),this._nextChunk=o?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(M){this._input=M,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(k=new XMLHttpRequest,this._config.withCredentials&&(k.withCredentials=this._config.withCredentials),o||(k.onload=O(this._chunkLoaded,this),k.onerror=O(this._chunkError,this)),k.open(this._config.downloadRequestBody?"POST":"GET",this._input,!o),this._config.downloadRequestHeaders){var M=this._config.downloadRequestHeaders;for(var L in M)k.setRequestHeader(L,M[L])}if(this._config.chunkSize){var F=this._start+this._config.chunkSize-1;k.setRequestHeader("Range","bytes="+this._start+"-"+F)}try{k.send(this._config.downloadRequestBody)}catch(J){this._chunkError(J.message)}o&&k.status===0&&this._chunkError()}},this._chunkLoaded=function(){k.readyState===4&&(k.status<200||400<=k.status?th
2023-07-31 22:51:06 +00:00
`),se=1<z.length&&z[0].length<ae[0].length;if(ae.length===1||se)return`
`;for(var U=0,Y=0;Y<ae.length;Y++)ae[Y][0]===`
`&&U++;return U>=ae.length/2?`\r
2023-08-04 22:28:36 +00:00
`:"\r"}(X,w)),L=!1,v.delimiter)D(v.delimiter)&&(v.delimiter=v.delimiter(X),ee.meta.delimiter=v.delimiter);else{var C=function($,j,ne,ae,z){var se,U,Y,le;z=z||[","," ","|",";",l.RECORD_SEP,l.UNIT_SEP];for(var he=0;he<z.length;he++){var de=z[he],Ee=0,W=0,oe=0;Y=void 0;for(var ge=new _({comments:ae,delimiter:de,newline:j,preview:10}).parse($),Se=0;Se<ge.data.length;Se++)if(ne&&Ae(ge.data[Se]))oe++;else{var Pe=ge.data[Se].length;W+=Pe,Y!==void 0?0<Pe&&(Ee+=Math.abs(Pe-Y),Y=Pe):Y=Pe}0<ge.data.length&&(W/=ge.data.length-oe),(U===void 0||Ee<=U)&&(le===void 0||le<W)&&1.99<W&&(U=Ee,se=de,le=W)}return{successful:!!(v.delimiter=se),bestDelimiter:se}}(X,v.newline,v.skipEmptyLines,v.comments,v.delimitersToGuess);C.successful?v.delimiter=C.bestDelimiter:(L=!0,v.delimiter=l.DefaultDelimiter),ee.meta.delimiter=v.delimiter}var P=R(v);return v.preview&&v.header&&P.preview++,k=X,M=new _(P),ee=M.parse(k,pe,ue),N(),G?{meta:{paused:!0}}:ee||{meta:{paused:!1}}},this.paused=function(){return G},this.pause=function(){G=!0,M.abort(),k=D(v.chunk)?"":k.substring(M.getCharIndex())},this.resume=function(){Z.streamer._halted?(G=!1,Z.streamer.parseChunk(k,!0)):setTimeout(Z.resume,3)},this.aborted=function(){return ye},this.abort=function(){ye=!0,M.abort(),ee.meta.aborted=!0,D(v.complete)&&v.complete(ee),k=""}}function b(v){return v.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function _(v){var k,M=(v=v||{}).delimiter,L=v.newline,F=v.comments,J=v.step,I=v.preview,ce=v.fastMode,Z=k=v.quoteChar===void 0||v.quoteChar===null?'"':v.quoteChar;if(v.escapeChar!==void 0&&(Z=v.escapeChar),(typeof M!="string"||-1<l.BAD_DELIMITERS.indexOf(M))&&(M=","),F===M)throw new Error("Comment character same as delimiter");F===!0?F="#":(typeof F!="string"||-1<l.BAD_DELIMITERS.indexOf(F))&&(F=!1),L!==`
2023-07-10 23:12:40 +00:00
`&&L!=="\r"&&L!==`\r
`&&(L=`
2023-08-04 22:28:36 +00:00
`);var T=0,q=!1;this.parse=function(G,ye,me){if(typeof G!="string")throw new Error("Input must be a string");var ee=G.length,xe=M.length,Ae=L.length,N=F.length,Q=D(J),V=[],te=[],X=[],pe=T=0;if(!G)return Ge();if(v.header&&!ye){var ue=G.split(L)[0].split(M),w=[],C={},P=!1;for(var $ in ue){var j=ue[$];D(v.transformHeader)&&(j=v.transformHeader(j,$));var ne=j,ae=C[j]||0;for(0<ae&&(P=!0,ne=j+"_"+ae),C[j]=ae+1;w.includes(ne);)ne=ne+"_"+ae;w.push(ne)}if(P){var z=G.split(L);z[0]=w.join(M),G=z.join(L)}}if(ce||ce!==!1&&G.indexOf(k)===-1){for(var se=G.split(L),U=0;U<se.length;U++){if(X=se[U],T+=X.length,U!==se.length-1)T+=L.length;else if(me)return Ge();if(!F||X.substring(0,N)!==F){if(Q){if(V=[],oe(X.split(M)),Le(),q)return Ge()}else oe(X.split(M));if(I&&I<=U)return V=V.slice(0,I),Ge(!0)}}return Ge()}for(var Y=G.indexOf(M,T),le=G.indexOf(L,T),he=new RegExp(b(Z)+b(k),"g"),de=G.indexOf(k,T);;)if(G[T]!==k)if(F&&X.length===0&&G.substring(T,T+N)===F){if(le===-1)return Ge();T=le+Ae,le=G.indexOf(L,T),Y=G.indexOf(M,T)}else if(Y!==-1&&(Y<le||le===-1))X.push(G.substring(T,Y)),T=Y+xe,Y=G.indexOf(M,T);else{if(le===-1)break;if(X.push(G.substring(T,le)),Pe(le+Ae),Q&&(Le(),q))return Ge();if(I&&V.length>=I)return Ge(!0)}else for(de=T,T++;;){if((de=G.indexOf(k,de+1))===-1)return me||te.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:V.length,index:T}),Se();if(de===ee-1)return Se(G.substring(T,de).replace(he,k));if(k!==Z||G[de+1]!==Z){if(k===Z||de===0||G[de-1]!==Z){Y!==-1&&Y<de+1&&(Y=G.indexOf(M,de+1)),le!==-1&&le<de+1&&(le=G.indexOf(L,de+1));var Ee=ge(le===-1?Y:Math.min(Y,le));if(G.substr(de+1+Ee,xe)===M){X.push(G.substring(T,de).replace(he,k)),G[T=de+1+Ee+xe]!==k&&(de=G.indexOf(k,T)),Y=G.indexOf(M,T),le=G.indexOf(L,T);break}var W=ge(le);if(G.substring(de+1+W,de+1+W+Ae)===L){if(X.push(G.substring(T,de).replace(he,k)),Pe(de+1+W+Ae),Y=G.indexOf(M,T),de=G.indexOf(k,T),Q&&(Le(),q))return Ge();if(I&&V.length>=I)return Ge(!0);break}te.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:V.length,index:T}),de++}}else de++}return Se();function oe(Xe){V.push(Xe),pe=T}function ge(Xe){var tt=0;if(Xe!==-1){var lt=G.substring(de+1,Xe);lt&&lt.trim()===""&&(tt=lt.length)}return tt}function Se(Xe){return me||(Xe===void 0&&(Xe=G.substring(T)),X.push(Xe),T=ee,oe(X),Q&&Le()),Ge()}function Pe(Xe){T=Xe,oe(X),X=[],le=G.indexOf(L,T)}function Ge(Xe){return{data:V,errors:te,meta:{delimiter:M,linebreak:L,aborted:q,truncated:!!Xe,cursor:pe+(ye||0)}}}function Le(){J(Ge()),V=[],te=[]}},this.abort=function(){q=!0},this.getCharIndex=function(){return T}}function y(v){var k=v.data,M=i[k.workerId],L=!1;if(k.error)M.userError(k.error,k.file);else if(k.results&&k.results.data){var F={abort:function(){L=!0,x(k.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:A,resume:A};if(D(M.userStep)){for(var J=0;J<k.results.data.length&&(M.userStep({data:k.results.data[J],errors:k.results.errors,meta:k.results.meta},F),!L);J++);delete k.results}else D(M.userChunk)&&(M.userChunk(k.results,F,k.file),delete k.results)}k.finished&&!L&&x(k.workerId,k.results)}function x(v,k){var M=i[v];D(M.userComplete)&&M.userComplete(k),M.terminate(),delete i[v]}function A(){throw new Error("Not implemented.")}function R(v){if(typeof v!="object"||v===null)return v;var k=Array.isArray(v)?[]:{};for(var M in v)k[M]=R(v[M]);return k}function O(v,k){return function(){v.apply(k,arguments)}}function D(v){return typeof v=="function"}return r&&(s.onmessage=function(v){var k=v.data;if(l.WORKER_ID===void 0&&k&&(l.WORKER_ID=k.workerId),typeof k.input=="string")s.postMessage({workerId:l.WORKER_ID,results:l.parse(k.input,k.config),finished:!0});else if(s.File&&k.input instanceof File||k.input instanceof Object){var M=l.parse(k.input,k.config);M&&s.postMessage({workerId:l.WORKER_ID,results:M,finished:!0})}}),(h.prototype=Object.create(d.prototype)).constructor=h,(f.prototype=Object.create(d.prototype)).constructor=f,(g.prototype=Object.create(g.prototype)).constructor=g,(m.prototype=Object.create(d.prototype)).constructor=m,l})})(Pp);var k2=Pp.ex
2023-07-20 00:12:54 +00:00
`+t.title+`
2023-08-02 23:07:29 +00:00
installed!`,4,!0),this.$store.dispatch("refreshDiskUsage")}}else Me.off("install_progress",n),console.log("Install failed"),t.installing=!1,this.showProgress=!1,console.error("Installation failed:",s.error),this.$refs.toast.showToast(`Model:
2023-07-20 00:12:54 +00:00
`+t.title+`
2023-08-04 22:28:36 +00:00
failed to install!`,4,!1),this.$store.dispatch("refreshDiskUsage")};Me.on("install_progress",n),Me.emit("install_model",{path:e}),console.log("Started installation, please wait")},uploadAvatar(t){const e=t.target.files[0],n=new FormData;n.append("avatar",e),console.log("Uploading avatar"),ke.post("/upload_avatar",n).then(s=>{console.log("Avatar uploaded successfully"),this.$refs.toast.showToast("Avatar uploaded successfully!",4,!0);const o=s.data.fileName;console.log("response",s),this.user_avatar=o,this.update_setting("user_avatar",o,()=>{}).then(()=>{})}).catch(s=>{console.error("Error uploading avatar:",s)})},async update_software(){console.log("Posting");const t=await this.api_get_req("update_software");console.log("Posting done"),t.status?this.$refs.toast.showToast("Success!",4,!0):this.$refs.toast.showToast("Failure!",4,!1)},on_loading_text(t){console.log("Loading text",t),this.loading_text=t},async constructor(){for(this.isLoading=!0,_e(()=>{we.replace()});this.$store.state.ready===!1;)await new Promise(t=>setTimeout(t,100));this.configFile.model_name&&(this.isModelSelected=!0),this.persLangArr=await this.api_get_req("list_personalities_languages"),this.persCatgArr=await this.api_get_req("list_personalities_categories?language="+this.configFile.personality_language),this.persArr=await this.api_get_req("list_personalities?language="+this.configFile.personality_language+"&category"+this.configFile.personality_category),this.langArr=await this.api_get_req("list_languages"),this.bindingsArr.sort((t,e)=>t.name.localeCompare(e.name)),this.modelsArr.sort(),this.persLangArr.sort(),this.persCatgArr.sort(),this.persArr.sort(),this.langArr.sort(),this.personality_language=this.configFile.personality_language,this.personality_category=this.configFile.personality_category,this.personalitiesFiltered=this.personalities.filter(t=>t.category===this.configFile.personality_category&&t.language===this.configFile.personality_language),this.personalitiesFiltered.sort(),this.modelsFiltered=this.models,this.bindingsArr.sort((t,e)=>t.name.localeCompare(e.name)),this.isLoading=!1,this.isMounted=!0},async open_mzl(){this.mzl_collapsed=!this.mzl_collapsed,console.log("Fetching models")},async getVramUsage(){await this.api_get_req("vram_usage")},async progressListener(t){if(console.log("received something"),t.status==="progress"){if(this.$refs.modelZoo){const e=this.$refs.modelZoo.findIndex(s=>s.model.path==t.model_url&&s.model.title==t.model_name&&this.configFile.binding_name==t.binding_folder),n=this.models[e];n&&(console.log("model entry",n),n.installing=!0,n.progress=t.progress,console.log(`Progress = ${t.progress}`),t.progress>=100&&(n.installing=!1,n.isInstalled=!0))}}else if(t.status==="succeeded"){if(console.log("Received succeeded"),console.log("Installed successfully"),this.$refs.modelZoo){const e=this.$refs.modelZoo.findIndex(s=>s.model.path==t.model_url&&s.model.title==t.model_name&&this.configFile.binding_name==t.binding_folder),n=this.models[e];n&&(n.installing=!1,n.isInstalled=!0)}this.$refs.toast.showToast(`Model:
2023-07-10 23:12:40 +00:00
`+model_object.title+`
2023-07-10 23:28:47 +00:00
installed!`,4,!0),this.$store.dispatch("refreshDiskUsage")}else if(t.status==="failed"&&(console.log("Install failed"),this.$refs.modelZoo)){const e=this.$refs.modelZoo.findIndex(s=>s.model.path==t.model_url&&s.model.title==t.model_name&&this.configFile.binding_name==t.binding_folder),n=this.models[e];n&&(n.installing=!1,n.isInstalled=!1),console.error("Installation failed:",t.error),this.$refs.toast.showToast(`Model:
2023-07-10 23:12:40 +00:00
`+model_object.title+`
2023-08-02 23:07:29 +00:00
failed to install!`,4,!1),this.$store.dispatch("refreshDiskUsage")}},showAddModelDialog(){this.$refs.addmodeldialog.showDialog("").then(()=>{console.log(this.$refs.addmodeldialog.model_path);const t=this.$refs.addmodeldialog.model_path;Me.emit("install_model",{path:t},e=>{console.log("Model installation successful:",e)}),console.log(this.$refs.addmodeldialog.model_path)})},closeAddModelDialog(){this.addModelDialogVisibility=!1},collapseAll(t){this.minconf_collapsed=t,this.bec_collapsed=t,this.mzc_collapsed=t,this.pzc_collapsed=t,this.bzc_collapsed=t,this.pc_collapsed=t,this.mc_collapsed=t,this.sc_collapsed=t,this.mzdc_collapsed=t},fetchPersonalities(){this.api_get_req("list_personalities_categories").then(t=>{this.persCatgArr=t,this.persCatgArr.sort()}),this.api_get_req("list_personalities").then(t=>{this.persArr=t,this.persArr.sort(),console.log(`Listed personalities:
2023-07-14 12:02:53 +00:00
${t}`)})},fetchHardwareInfos(){this.$store.dispatch("refreshDiskUsage"),this.$store.dispatch("refreshRamUsage")},async onPersonalitySelected(t){if(console.log("on pers",t),this.isLoading&&this.$refs.toast.showToast("Loading... please wait",4,!1),this.isLoading=!0,console.log("ppa",t),t){if(t.selected){this.$refs.toast.showToast("Personality already selected",4,!0),this.isLoading=!1;return}if(t.isMounted&&this.configFile.personalities.includes(t.full_path)){const e=await this.select_personality(t);console.log("pers is mounted",e),e&&e.status&&e.active_personality_id>-1?this.$refs.toast.showToast(`Selected personality:
2023-07-10 23:12:40 +00:00
`+t.name,4,!0):this.$refs.toast.showToast(`Error on select personality:
2023-08-02 23:07:29 +00:00
`+t.name,4,!1),this.isLoading=!1}else console.log("mounting pers"),this.onPersonalityMounted(t);_e(()=>{we.replace()})}},onSelected(t){this.isLoading&&this.$refs.toast.showToast("Loading... please wait",4,!1),t&&(t.isInstalled?this.configFile.model_name!=t.title&&this.update_model(t.title).then(e=>{console.log("update_model",e),this.configFile.model_name=t.title,this.$refs.toast.showToast(`Selected model:
2023-07-10 23:28:47 +00:00
`+t.title,4,!0),this.settingsChanged=!0,this.isModelSelected=!0}):this.$refs.toast.showToast(`Model:
2023-07-10 23:12:40 +00:00
`+t.title+`
2023-08-02 23:07:29 +00:00
is not installed`,4,!1),_e(()=>{we.replace()}))},onCopy(t){let e;t.model.isCustomModel?e=`Model name: ${t.title}
2023-07-10 23:12:40 +00:00
File size: ${t.fileSize}
Manually downloaded model `:e=`Model name: ${t.title}
File size: ${t.fileSize}
Download: ${t.path}
License: ${t.license}
Owner: ${t.owner}
Website: ${t.owner_link}
2023-08-04 22:28:36 +00:00
Description: ${t.description}`,this.$refs.toast.showToast("Copied model info to clipboard!",4,!0),navigator.clipboard.writeText(e.trim())},onCopyLink(t){this.$refs.toast.showToast("Copied link to clipboard!",4,!0),navigator.clipboard.writeText(t.path)},onCancelInstall(){const t=this.addModel;console.log("cancel install",t),this.modelDownlaodInProgress=!1,this.addModel={},this.$refs.toast.showToast("Model installation aborted",4,!1),Me.emit("cancel_install",{model_name:t.model_name,binding_folder:t.binding_folder,model_url:t.model_url})},onInstall(t){this.variant_choices=t.model.variants,this.currenModelToInstall=t,console.log(this.variant_choices),this.variantSelectionDialogVisible=!0},onCreateReference(){ke.post("/add_reference_to_local_model",{path:this.reference_path}).then(t=>{t.status?(this.$refs.toast.showToast("Reference created",4,!0),this.fetchModels()):this.$refs.toast.showToast("Couldn't create reference",4,!1)})},onInstallAddModel(){if(!this.addModel.url){this.$refs.toast.showToast("Link is empty",4,!1);return}let t=this.addModel.url;this.addModel.progress=0,console.log("installing..."),console.log("value ",this.addModel.url),this.modelDownlaodInProgress=!0;const e=n=>{console.log("received something"),n.status&&n.progress<=100?(console.log("Progress",n),this.addModel=n,this.addModel.url=t,this.modelDownlaodInProgress=!0,this.addModel.progress==100&&(this.modelDownlaodInProgress=!1,console.log("Received succeeded"),Me.off("install_progress",e),console.log("Installed successfully"),this.addModel={},this.$refs.toast.showToast(`Model:
2023-07-10 23:12:40 +00:00
`+this.addModel.model_name+`
2023-08-02 23:07:29 +00:00
installed!`,4,!0),this.$store.dispatch("refreshDiskUsage"))):(Me.off("install_progress",e),console.log("Install failed"),this.modelDownlaodInProgress=!1,console.error("Installation failed:",n.error),this.$refs.toast.showToast(`Model:
2023-07-10 23:12:40 +00:00
`+this.addModel.model_name+`
2023-08-02 23:07:29 +00:00
failed to install!`,4,!1),this.$store.dispatch("refreshDiskUsage"))};Me.on("install_progress",e),Me.emit("install_model",{path:t}),console.log("Started installation, please wait")},uploadLocalModel(){if(this.uploadData.length==0){this.$refs.toast.showToast("No files to upload",4,!1);return}let t=this.addModel.url;this.addModel.progress=0,console.log("installing..."),console.log("value ",this.addModel.url),this.modelDownlaodInProgress=!0;const e=n=>{console.log("received something"),n.status&&n.progress<=100?(console.log("Progress",n),this.addModel=n,this.addModel.url=t,this.modelDownlaodInProgress=!0,this.addModel.progress==100&&(this.modelDownlaodInProgress=!1,console.log("Received succeeded"),Me.off("progress",e),console.log("Installed successfully"),this.addModel={},this.$refs.toast.showToast(`Model:
2023-07-10 23:12:40 +00:00
`+this.addModel.model_name+`
2023-08-02 23:07:29 +00:00
installed!`,4,!0),this.$store.dispatch("refreshDiskUsage"))):(Me.off("progress",e),console.log("Install failed"),this.modelDownlaodInProgress=!1,console.error("Installation failed:",n.error),this.$refs.toast.showToast(`Model:
2023-07-10 23:12:40 +00:00
`+this.addModel.model_name+`
2023-08-02 23:07:29 +00:00
failed to install!`,4,!1),this.$store.dispatch("refreshDiskUsage"))};Me.on("progress",e),console.log("Started installation, please wait")},setFileList(t){this.uploadData=t.target.files,console.log("set file list",this.uploadData)},onUninstall(t){this.$refs.yesNoDialog.askQuestion(`Are you sure you want to delete this model?
[`+t.title+"]","Yes","Cancel").then(e=>{if(e){console.log("uninstalling model...");const n=s=>{if(console.log("uninstalling res",s),s.status){console.log("uninstalling success",s),t.uninstalling=!1,Me.off("install_progress",n),this.showProgress=!1;const o=this.models.findIndex(r=>r.path===t.path);this.models[o].isInstalled=!1,t.model.isCustomModel&&(this.models=this.models.filter(r=>r.title!==t.title)),this.$refs.toast.showToast(`Model:
2023-07-10 23:12:40 +00:00
`+t.title+`
2023-08-02 23:07:29 +00:00
was uninstalled!`,4,!0),this.$store.dispatch("refreshDiskUsage")}else console.log("uninstalling failed",s),t.uninstalling=!1,this.showProgress=!1,Me.off("install_progress",n),console.error("Uninstallation failed:",message.error),this.$refs.toast.showToast(`Model:
2023-07-10 23:12:40 +00:00
`+t.title+`
2023-08-02 23:07:29 +00:00
failed to uninstall!`,4,!1),this.$store.dispatch("refreshDiskUsage")};Me.on("install_progress",n),Me.emit("uninstall_model",{path:t.path})}})},onSelectedBinding(t){if(console.log("Binding selected"),!t.binding.installed){this.$refs.toast.showToast(`Binding is not installed:
2023-08-04 22:28:36 +00:00
`+t.binding.name,4,!1);return}this.configFile.binding_name!=t.binding.folder&&this.update_binding(t.binding.folder)},onInstallBinding(t){this.configFile.binding_name!=t.binding.folder&&this.update_binding(t.binding.folder)},onReinstallBinding(t){this.isLoading=!0,ke.post("/reinstall_binding",{name:t.binding.folder}).then(e=>{if(e)return this.isLoading=!1,console.log("reinstall_binding",e),e.data.status?this.$refs.toast.showToast("Reinstalled binding successfully!",4,!0):this.$refs.toast.showToast("Could not reinstall binding",4,!1),e.data;this.isLoading=!1}).catch(e=>(this.isLoading=!1,this.$refs.toast.showToast(`Could not reinstall binding
`+e.message,4,!1),{status:!1}))},onSettingsBinding(t){try{this.isLoading=!0,ke.get("/get_active_binding_settings").then(e=>{this.isLoading=!1,e&&(console.log("binding sett",e),e.data&&Object.keys(e.data).length>0?this.$refs.universalForm.showForm(e.data,"Binding settings - "+t.binding.name,"Save changes","Cancel").then(n=>{try{ke.post("/set_active_binding_settings",n).then(s=>{s&&s.data?(console.log("binding set with new settings",s.data),this.$refs.toast.showToast("Binding settings updated successfully!",4,!0)):(this.$refs.toast.showToast(`Did not get binding settings responses.
2023-07-10 23:12:40 +00:00
`+s,4,!1),this.isLoading=!1)})}catch(s){this.$refs.toast.showToast(`Did not get binding settings responses.
2023-08-04 22:28:36 +00:00
Endpoint error: `+s.message,4,!1),this.isLoading=!1}}):(this.$refs.toast.showToast("Binding has no settings",4,!1),this.isLoading=!1))})}catch(e){this.isLoading=!1,this.$refs.toast.showToast("Could not open binding settings. Endpoint error: "+e.message,4,!1)}},onReloadBinding(t){this.isLoading=!0,ke.post("/reload_binding",{name:t.binding.folder}).then(e=>{if(e)return this.isLoading=!1,console.log("reload_binding",e),e.data.status?this.$refs.toast.showToast("Binding reloaded successfully!",4,!0):this.$refs.toast.showToast("Could not reinstall binding",4,!1),e.data;this.isLoading=!1}).catch(e=>(this.isLoading=!1,this.$refs.toast.showToast(`Could not reinstall binding
`+e.message,4,!1),{status:!1}))},onSettingsPersonality(t){try{this.isLoading=!0,ke.get("/get_active_personality_settings").then(e=>{this.isLoading=!1,e&&(console.log("pers sett",e),e.data&&Object.keys(e.data).length>0?this.$refs.universalForm.showForm(e.data,"Personality settings - "+t.personality.name,"Save changes","Cancel").then(n=>{try{ke.post("/set_active_personality_settings",n).then(s=>{s&&s.data?(console.log("personality set with new settings",s.data),this.$refs.toast.showToast("Personality settings updated successfully!",4,!0)):(this.$refs.toast.showToast(`Did not get Personality settings responses.
2023-07-10 23:12:40 +00:00
`+s,4,!1),this.isLoading=!1)})}catch(s){this.$refs.toast.showToast(`Did not get Personality settings responses.
2023-08-04 22:28:36 +00:00
Endpoint error: `+s.message,4,!1),this.isLoading=!1}}):(this.$refs.toast.showToast("Personality has no settings",4,!1),this.isLoading=!1))})}catch(e){this.isLoading=!1,this.$refs.toast.showToast("Could not open personality settings. Endpoint error: "+e.message,4,!1)}},onMessageBoxOk(){console.log("OK button clicked")},update_personality_language(t,e){this.personality_language=t,e()},update_personality_category(t,e){this.personality_category=t,e()},refresh(){console.log("Refreshing"),this.$store.dispatch("refreshConfig").then(()=>{console.log(this.personality_language),console.log(this.personality_category),this.api_get_req("list_personalities_categories?language="+this.personality_language).then(t=>{console.log("cats",t),this.persCatgArr=t,this.personalitiesFiltered=this.personalities.filter(e=>e.category===this.personality_category&&e.language===this.personality_language),this.personalitiesFiltered.sort()})})},toggleAccordion(){this.showAccordion=!this.showAccordion},async update_setting(t,e,n){console.log("Updating setting",t,":",e),this.isLoading=!0;const s={setting_name:t,setting_value:e};let o=await ke.post("/update_setting",s);if(o)return this.isLoading=!1,console.log("update_setting",o),o.status?this.$refs.toast.showToast(`Setting updated successfully.
2023-07-20 09:44:33 +00:00
Don't forget to save to keep the setting permanently.`,4,!0):this.$refs.toast.showToast(`Setting update failed.
2023-08-04 22:28:36 +00:00
Please view the console for more details.`,4,!1),n!==void 0&&n(o),o.data;this.isLoading=!1},update_binding(t){this.isLoading=!0,console.log("updating binding_name"),this.update_setting("binding_name",t,e=>{console.log("updated binding_name"),this.$store.dispatch("refreshModels");const n=this.bindingsArr.findIndex(o=>o.folder==t),s=this.bindingsArr[n];s&&(s.installed=!0),this.settingsChanged=!0,this.isLoading=!1,console.log("updating model"),this.update_model(null).then(()=>{console.log("updated model"),this.configFile.model_name=null,this.$store.dispatch("refreshConfig"),this.$store.dispatch("refreshModelsZoo"),this.$refs.toast.showToast("Binding changed.",4,!0),this.$forceUpdate()}),_e(()=>{we.replace()})})},async update_model(t){t||(this.isModelSelected=!1),this.isLoading=!0;let e=await this.update_setting("model_name",t);return this.isLoading=!1,e},applyConfiguration(){this.isLoading=!0,ke.post("/apply_settings").then(t=>{this.isLoading=!1,t.data.status?(this.$refs.toast.showToast("Configuration changed successfully.",4,!0),this.settingsChanged=!1):this.$refs.toast.showToast("Configuration change failed.",4,!1),_e(()=>{we.replace()})})},save_configuration(){this.showConfirmation=!1,ke.post("/save_settings",{}).then(t=>{if(t)return t.status||this.$refs.messageBox.showMessage("Error: Couldn't save settings!"),t.data}).catch(t=>(console.log(t.message,"save_configuration"),this.$refs.messageBox.showMessage("Couldn't save settings!"),{status:!1}))},reset_configuration(){this.$refs.yesNoDialog.askQuestion(`Are you sure?
This will delete all your configurations and get back to default configuration.`).then(t=>{t&&ke.post("/reset_settings",{}).then(e=>{if(e)return e.status?this.$refs.messageBox.showMessage("Settings have been reset correctly"):this.$refs.messageBox.showMessage("Couldn't reset settings!"),e.data}).catch(e=>(console.log(e.message,"reset_configuration"),this.$refs.messageBox.showMessage("Couldn't reset settings!"),{status:!1}))})},async api_get_req(t){try{const e=await ke.get("/"+t);if(e)return e.data}catch(e){console.log(e.message,"api_get_req - settings");return}},closeToast(){this.showToast=!1},async getPersonalitiesArr(){this.isLoading=!0,this.personalities=[];const t=await this.api_get_req("get_all_personalities"),e=this.$store.state.config,n=Object.keys(t);for(let s=0;s<n.length;s++){const o=n[s],r=t[o],i=Object.keys(r);for(let a=0;a<i.length;a++){const l=i[a],d=r[l].map(h=>{const f=e.personalities.includes(o+"/"+l+"/"+h.folder);let g={};return g=h,g.category=l,g.language=o,g.full_path=o+"/"+l+"/"+h.folder,g.isMounted=f,g});this.personalities.length==0?this.personalities=d:this.personalities=this.personalities.concat(d)}}this.personalities.sort((s,o)=>s.name.localeCompare(o.name)),this.personalitiesFiltered=this.personalities.filter(s=>s.category===this.configFile.personality_category&&s.language===this.configFile.personality_language),this.personalitiesFiltered.sort(),console.log("per filtered",this.personalitiesFiltered),this.isLoading=!1},async filterPersonalities(){if(!this.searchPersonality){this.personalitiesFiltered=this.personalities.filter(n=>n.category===this.configFile.personality_category&&n.language===this.configFile.personality_language),this.personalitiesFiltered.sort(),this.searchPersonalityInProgress=!1;return}const t=this.searchPersonality.toLowerCase(),e=this.personalities.filter(n=>{if(n.name&&n.name.toLowerCase().includes(t)||n.description&&n.description.toLowerCase().includes(t)||n.full_path&&n.full_path.toLowerCase().includes(t))return n});e.length>0?this.personalitiesFiltered=e.sort():(this.personalitiesFiltered=this.personalities.filter(n=>n.category===this.configFile.personality_category&&n.language===this.configFile.personality_language),this.personalitiesFiltered.sort()),this.searchPersonalityInProgress=!1},async filterModels(){if(!this.searchModel){console.log("Searching model"),this.modelsFiltered=this.models,this.modelsFiltered.sort(),this.searchModelInProgress=!1;return}const t=this.searchModel.toLowerCase(),e=this.models.filter(n=>{if(n.title&&n.title.toLowerCase().includes(t)||n.description&&n.description.toLowerCase().includes(t)||n.path&&n.path.toLowerCase().includes(t))return n});e.length>0?this.modelsFiltered=e.sort():(this.modelsFiltered=this.models,this.modelsFiltered.sort()),this.searchModelInProgress=!1},computedFileSize(t){return Ht(t)},async mount_personality(t){if(!t)return{status:!1,error:"no personality - mount_personality"};try{const e={language:t.language,category:t.category,folder:t.folder},n=await ke.post("/mount_personality",e);if(n)return n.data}catch(e){console.log(e.message,"mount_personality - settings");return}},async unmount_personality(t){if(!t)return{status:!1,error:"no personality - unmount_personality"};const e={language:t.language,category:t.category,folder:t.folder};try{const n=await ke.post("/unmount_personality",e);if(n)return n.data}catch(n){console.log(n.message,"unmount_personality - settings");return}},async select_personality(t){if(!t)return{status:!1,error:"no personality - select_personality"};console.log("select pers",t);const n={id:this.configFile.personalities.findIndex(s=>s===t.full_path)};try{const s=await ke.post("/select_personality",n);if(s)return this.$store.dispatch("refreshConfig").then(()=>{this.$store.dispatch("refreshPersonalitiesArr").then(()=>{this.$store.dispatch("refreshMountedPersonalities")})}),s.data}catch(s){console.log(s.message,"select_personality - settings");return}},async mountPersonality(t){if(this.isLoading=!0,console.log("mount pers",t),!t)return;if(this.configFile.personalities.includes(t.personality.full_path)){thi
2023-07-10 23:28:47 +00:00
`+t.personality.name,4,!0),this.$store.dispatch("refreshMountedPersonalities")):(t.isMounted=!1,this.$refs.toast.showToast(`Could not mount personality
2023-07-10 23:12:40 +00:00
Error: `+e.error+`
Response:
2023-07-10 23:28:47 +00:00
`+e,4,!1)),this.isLoading=!1},async unmountPersonality(t){if(this.isLoading=!0,!t)return;const e=await this.unmount_personality(t.personality||t);if(e.status){this.configFile.personalities=e.personalities,this.$refs.toast.showToast("Personality unmounted",4,!0);const n=this.personalities.findIndex(a=>a.full_path==t.full_path),s=this.personalitiesFiltered.findIndex(a=>a.full_path==t.full_path),o=this.$refs.personalitiesZoo.findIndex(a=>a.full_path==t.full_path);console.log("ppp",this.personalities[n]),this.personalities[n].isMounted=!1,s>-1&&(this.personalitiesFiltered[s].isMounted=!1),o>-1&&(this.$refs.personalitiesZoo[o].isMounted=!1),this.$store.dispatch("refreshMountedPersonalities");const r=this.mountedPersArr[this.mountedPersArr.length-1];console.log(r,this.mountedPersArr.length),(await this.select_personality(t.personality)).status&&this.$refs.toast.showToast(`Selected personality:
2023-07-10 23:12:40 +00:00
`+r.name,4,!0)}else this.$refs.toast.showToast(`Could not unmount personality
2023-08-04 22:28:36 +00:00
Error: `+e.error,4,!1);this.isLoading=!1},onPersonalityReinstall(t){console.log("on reinstall ",t),this.isLoading=!0,ke.post("/reinstall_personality",{name:t.personality.path}).then(e=>{if(e)return this.isLoading=!1,console.log("reinstall_personality",e),e.data.status?this.$refs.toast.showToast("Personality reinstalled successfully!",4,!0):this.$refs.toast.showToast("Could not reinstall personality",4,!1),e.data;this.isLoading=!1}).catch(e=>(this.isLoading=!1,this.$refs.toast.showToast(`Could not reinstall personality
2023-08-02 23:07:29 +00:00
`+e.message,4,!1),{status:!1}))},onPersonalityMounted(t){console.log("on sel ",t),this.configFile.personalities.includes(t.full_path)?this.configFile.personalities.length==1?this.$refs.toast.showToast("Can't unmount last personality",4,!1):this.unmountPersonality(t):this.mountPersonality(t)},personalityImgPlacehodler(t){t.target.src=Qn},searchPersonality_func(){clearTimeout(this.searchPersonalityTimer),this.searchPersonality&&(this.searchPersonalityInProgress=!0,setTimeout(this.filterPersonalities,this.searchPersonalityTimerInterval))},searchModel_func(){clearTimeout(this.searchModelTimer),this.searchModel&&(this.searchModelInProgress=!0,setTimeout(this.filterModels,this.searchModelTimer))}},async mounted(){this.constructor(),console.log("Getting voices"),this.getVoices()},activated(){this.isMounted&&this.constructor()},computed:{audio_out_voice:{get(){return this.$store.state.config.audio_out_voice},set(t){this.$store.state.config.audio_out_voice=t}},audioLanguages(){return[{code:"en-US",name:"English (US)"},{code:"en-GB",name:"English (UK)"},{code:"es-ES",name:"Spanish (Spain)"},{code:"es-MX",name:"Spanish (Mexico)"},{code:"fr-FR",name:"French (France)"},{code:"fr-CA",name:"French (Canada)"},{code:"de-DE",name:"German (Germany)"},{code:"it-IT",name:"Italian (Italy)"},{code:"pt-BR",name:"Portuguese (Brazil)"},{code:"pt-PT",name:"Portuguese (Portugal)"},{code:"ru-RU",name:"Russian (Russia)"},{code:"zh-CN",name:"Chinese (China)"},{code:"ja-JP",name:"Japanese (Japan)"},{code:"ar-SA",name:"Arabic (Saudi Arabia)"},{code:"tr-TR",name:"Turkish (Turkey)"},{code:"ms-MY",name:"Malay (Malaysia)"},{code:"ko-KR",name:"Korean (South Korea)"},{code:"nl-NL",name:"Dutch (Netherlands)"},{code:"sv-SE",name:"Swedish (Sweden)"},{code:"da-DK",name:"Danish (Denmark)"},{code:"fi-FI",name:"Finnish (Finland)"},{code:"no-NO",name:"Norwegian (Norway)"},{code:"pl-PL",name:"Polish (Poland)"},{code:"el-GR",name:"Greek (Greece)"},{code:"hu-HU",name:"Hungarian (Hungary)"},{code:"cs-CZ",name:"Czech (Czech Republic)"},{code:"th-TH",name:"Thai (Thailand)"},{code:"hi-IN",name:"Hindi (India)"},{code:"he-IL",name:"Hebrew (Israel)"},{code:"id-ID",name:"Indonesian (Indonesia)"},{code:"vi-VN",name:"Vietnamese (Vietnam)"},{code:"uk-UA",name:"Ukrainian (Ukraine)"},{code:"ro-RO",name:"Romanian (Romania)"},{code:"bg-BG",name:"Bulgarian (Bulgaria)"},{code:"hr-HR",name:"Croatian (Croatia)"},{code:"sr-RS",name:"Serbian (Serbia)"},{code:"sk-SK",name:"Slovak (Slovakia)"},{code:"sl-SI",name:"Slovenian (Slovenia)"},{code:"et-EE",name:"Estonian (Estonia)"},{code:"lv-LV",name:"Latvian (Latvia)"},{code:"lt-LT",name:"Lithuanian (Lithuania)"},{code:"ka-GE",name:"Georgian (Georgia)"},{code:"hy-AM",name:"Armenian (Armenia)"},{code:"az-AZ",name:"Azerbaijani (Azerbaijan)"},{code:"kk-KZ",name:"Kazakh (Kazakhstan)"},{code:"uz-UZ",name:"Uzbek (Uzbekistan)"},{code:"kkj-CM",name:"Kako (Cameroon)"},{code:"my-MM",name:"Burmese (Myanmar)"},{code:"ne-NP",name:"Nepali (Nepal)"},{code:"si-LK",name:"Sinhala (Sri Lanka)"}]},configFile:{get(){return this.$store.state.config},set(t){this.$store.commit("setConfig",t)}},userName:{get(){return this.$store.state.config.user_name},set(t){this.$store.state.config.user_name=t}},user_avatar:{get(){return"/user_infos/"+this.$store.state.config.user_avatar},set(t){this.$store.state.config.user_avatar=t}},enable_gpu:{get(){return this.$store.state.config.enable_gpu},set(t){this.$store.state.config.enable_gpu=t}},auto_update:{get(){return this.$store.state.config.auto_update},set(t){this.$store.state.config.auto_update=t}},auto_speak:{get(){return this.$store.state.config.auto_speak},set(t){this.$store.state.config.auto_speak=t}},audio_pitch:{get(){return this.$store.state.config.audio_pitch},set(t){this.$store.state.config.audio_pitch=t}},audio_in_language:{get(){return this.$store.state.config.audio_in_language},set(t){this.$store.state.config.audio_in_language=t}},use_user_name_in_discussions:{get(){return this.$store.state.config.use_user_name_in_discussions},set(t){this.$store.state.config.use_user_name_in_discussions=t}},db_path:{get(){return this.$s
2023-07-10 23:12:40 +00:00
You need to apply changes before you leave, or else.`,"Apply configuration","Cancel")&&this.applyConfiguration(),!1;if(!this.isModelSelected)return await this.$refs.yesNoDialog.askQuestion(`Did You forgot to select model?
2023-08-04 22:28:36 +00:00
You need to select model before you leave, or else.`,"Ok","Cancel"),!1}},ie=t=>(ns("data-v-1649041f"),t=t(),ss(),t),M5={class:"container overflow-y-scroll flex flex-col no-scrollbar shadow-lg p-10 pt-0"},O5={class:"sticky top-0 z-10 flex flex-row mb-2 p-3 gap-3 w-full rounded-b-lg bg-bg-light-tone dark:bg-bg-dark-tone shadow-lg"},R5={key:0,class:"flex gap-3 flex-1 items-center duration-75"},N5=ie(()=>u("i",{"data-feather":"x"},null,-1)),D5=[N5],L5=ie(()=>u("i",{"data-feather":"check"},null,-1)),I5=[L5],P5={key:1,class:"flex gap-3 flex-1 items-center"},F5=ie(()=>u("i",{"data-feather":"save"},null,-1)),B5=[F5],$5=ie(()=>u("i",{"data-feather":"refresh-ccw"},null,-1)),j5=[$5],z5=ie(()=>u("i",{"data-feather":"list"},null,-1)),U5=[z5],q5={class:"flex gap-3 flex-1 items-center justify-end"},H5={class:"flex gap-3 items-center"},V5={key:0,class:"flex gap-3 items-center"},G5=ie(()=>u("i",{"data-feather":"check"},null,-1)),K5=[G5],W5={key:1,role:"status"},Z5=ie(()=>u("svg",{"aria-hidden":"true",class:"w-6 h-6 animate-spin fill-secondary",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[u("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),u("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})],-1)),Y5=ie(()=>u("span",{class:"sr-only"},"Loading...",-1)),J5={class:"flex flex-col mb-2 rounded-lg bg-bg-light-tone dark:bg-bg-dark-tone hover:bg-bg-light-tone-panel hover:dark:bg-bg-dark-tone-panel duration-150 shadow-lg"},Q5={class:"flex flex-row p-3"},X5=ie(()=>u("i",{"data-feather":"chevron-right"},null,-1)),e4=[X5],t4=ie(()=>u("i",{"data-feather":"chevron-down"},null,-1)),n4=[t4],s4=ie(()=>u("h3",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," System status",-1)),o4=ie(()=>u("div",{class:"mr-2"},"|",-1)),r4={class:"text-base font-semibold cursor-pointer select-none items-center"},i4={class:"flex gap-2 items-center"},a4={key:0},l4={class:"flex gap-2 items-center"},c4=["title"],u4=os('<path d="M 5.9133057,14.000286 H 70.974329 a 8.9999999,8.9999999 0 0 1 8.999987,8.999998 V 47.889121 H 5.9133057 Z" style="fill:none;stroke:currentColor;stroke-width:2.5;stroke-opacity:1;" id="path1116" data-v-1649041f></path><path d="m 5.9133057,28.634282 h -2.244251 v -9.367697 h 2.244251 z" style="fill:none;stroke:currentColor;stroke-width:2.5;stroke-opacity:1;" id="path1118" data-v-1649041f></path><path d="M 5.9133057,42.648417 H 3.6690547 V 33.28072 h 2.244251 z" style="fill:none;stroke:currentColor;stroke-width:2.5;stroke-opacity:1;" id="path1120" data-v-1649041f></path><path d="m 5.9133057,47.889121 v 4.42369" style="fill:none;stroke:currentColor;stroke-width:2.5;stroke-opacity:1;" id="path1122" data-v-1649041f></path><path d="M 5.9133057,14.000286 H 2.3482707" style="fill:none;stroke:currentColor;stroke-width:2.5;stroke-opacity:1;" id="path1124" data-v-1649041f></path><path d="M 2.3482707,14.000286 V 10.006515" style="fill:none;stroke:currentColor;stroke-width:2.5;stroke-opacity:1;" id="path1126" data-v-1649041f></path><path d="m 74.31472,30.942798 a 11.594069,11.594069 0 0 0 -23.188136,0 11.594069,11.594069 0 0 0 23.188136,0 z" style="fill:none;stroke:currentColor;stroke-width:2.5;stroke-opacity:1;" id="path1
2023-08-02 23:26:02 +00:00
`,QV="∄",XV="∄",eG="𝔑",tG="𝔫",nG="≧̸",sG="≱",oG="≱",rG="≧̸",iG="⩾̸",aG="⩾̸",lG="⋙̸",cG="≵",uG="≫⃒",dG="≯",hG="≯",fG="≫̸",pG="↮",gG="⇎",mG="⫲",_G="∋",bG="⋼",yG="⋺",vG="∋",wG="Њ",xG="њ",kG="↚",EG="⇍",CG="‥",AG="≦̸",SG="≰",TG="↚",MG="⇍",OG="↮",RG="⇎",NG="≰",DG="≦̸",LG="⩽̸",IG="⩽̸",PG="≮",FG="⋘̸",BG="≴",$G="≪⃒",jG="≮",zG="⋪",UG="⋬",qG="≪̸",HG="∤",VG="",GG=" ",KG="𝕟",WG="",ZG="⫬",YG="¬",JG="≢",QG="≭",XG="∦",eK="∉",tK="≠",nK="≂̸",sK="∄",oK="≯",rK="≱",iK="≧̸",aK="≫̸",lK="≹",cK="⩾̸",uK="≵",dK="≎̸",hK="≏̸",fK="∉",pK="⋵̸",gK="⋹̸",mK="∉",_K="⋷",bK="⋶",yK="⧏̸",vK="⋪",wK="⋬",xK="≮",kK="≰",EK="≸",CK="≪̸",AK="⩽̸",SK="≴",TK="⪢̸",MK="⪡̸",OK="∌",RK="∌",NK="⋾",DK="⋽",LK="⊀",IK="⪯̸",PK="⋠",FK="∌",BK="⧐̸",$K="⋫",jK="⋭",zK="⊏̸",UK="⋢",qK="⊐̸",HK="⋣",VK="⊂⃒",GK="⊈",KK="⊁",WK="⪰̸",ZK="⋡",YK="≿̸",JK="⊃⃒",QK="⊉",XK="≁",eW="≄",tW="≇",nW="≉",sW="∤",oW="∦",rW="∦",iW="⫽⃥",aW="∂̸",lW="⨔",cW="⊀",uW="⋠",dW="⊀",hW="⪯̸",fW="⪯̸",pW="⤳̸",gW="↛",mW="⇏",_W="↝̸",bW="↛",yW="⇏",vW="⋫",wW="⋭",xW="⊁",kW="⋡",EW="⪰̸",CW="𝒩",AW="𝓃",SW="∤",TW="∦",MW="≁",OW="≄",RW="≄",NW="∤",DW="∦",LW="⋢",IW="⋣",PW="⊄",FW="⫅̸",BW="⊈",$W="⊂⃒",jW="⊈",zW="⫅̸",UW="⊁",qW="⪰̸",HW="⊅",VW="⫆̸",GW="⊉",KW="⊃⃒",WW="⊉",ZW="⫆̸",YW="≹",JW="Ñ",QW="ñ",XW="≸",eZ="⋪",tZ="⋬",nZ="⋫",sZ="⋭",oZ="Ν",rZ="ν",iZ="#",aZ="№",lZ="",cZ="≍⃒",uZ="⊬",dZ="⊭",hZ="⊮",fZ="⊯",pZ="≥⃒",gZ=">⃒",mZ="⤄",_Z="⧞",bZ="⤂",yZ="≤⃒",vZ="<⃒",wZ="⊴⃒",xZ="⤃",kZ="⊵⃒",EZ="∼⃒",CZ="⤣",AZ="↖",SZ="⇖",TZ="↖",MZ="⤧",OZ="Ó",RZ="ó",NZ="⊛",DZ="Ô",LZ="ô",IZ="⊚",PZ="О",FZ="о",BZ="⊝",$Z="Ő",jZ="ő",zZ="⨸",UZ="⊙",qZ="⦼",HZ="Œ",VZ="œ",GZ="⦿",KZ="𝔒",WZ="𝔬",ZZ="˛",YZ="Ò",JZ="ò",QZ="⧁",XZ="⦵",eY="Ω",tY="∮",nY="↺",sY="⦾",oY="⦻",rY="‾",iY="⧀",aY="Ō",lY="ō",cY="Ω",uY="ω",dY="Ο",hY="ο",fY="⦶",pY="⊖",gY="𝕆",mY="𝕠",_Y="⦷",bY="“",yY="",vY="⦹",wY="⊕",xY="↻",kY="⩔",EY="",CY="⩝",AY="",SY="",TY="ª",MY="º",OY="⊶",RY="⩖",NY="⩗",DY="⩛",LY="Ⓢ",IY="𝒪",PY="",FY="Ø",BY="ø",$Y="⊘",jY="Õ",zY="õ",UY="⨶",qY="⨷",HY="⊗",VY="Ö",GY="ö",KY="⌽",WY="‾",ZY="⏞",YY="⎴",JY="⏜",QY="¶",XY="∥",eJ="∥",tJ="⫳",nJ="⫽",sJ="∂",oJ="∂",rJ="П",iJ="п",aJ="%",lJ=".",cJ="‰",uJ="⊥",dJ="‱",hJ="𝔓",fJ="𝔭",pJ="Φ",gJ="φ",mJ="ϕ",_J="",bJ="☎",yJ="Π",vJ="π",wJ="⋔",xJ="ϖ",kJ="ℏ",EJ="",CJ="ℏ",AJ="⨣",SJ="⊞",TJ="⨢",MJ="+",OJ="∔",RJ="⨥",NJ="⩲",DJ="±",LJ="±",IJ="⨦",PJ="⨧",FJ="±",BJ="",$J="⨕",jJ="𝕡",zJ="",UJ="£",qJ="⪷",HJ="⪻",VJ="≺",GJ="≼",KJ="⪷",WJ="≺",ZJ="≼",YJ="≺",JJ="⪯",QJ="≼",XJ="≾",eQ="⪯",tQ="⪹",nQ="⪵",sQ="⋨",oQ="⪯",rQ="⪳",iQ="≾",aQ="",lQ="″",cQ="",uQ="⪹",dQ="⪵",hQ="⋨",fQ="∏",pQ="∏",gQ="⌮",mQ="⌒",_Q="⌓",bQ="∝",yQ="∝",vQ="∷",wQ="∝",xQ="≾",kQ="⊰",EQ="𝒫",CQ="𝓅",AQ="Ψ",SQ="ψ",TQ="",MQ="𝔔",OQ="𝔮",RQ="⨌",NQ="𝕢",DQ="",LQ="⁗",IQ="𝒬",PQ="𝓆",FQ="",BQ="⨖",$Q="?",jQ="≟",zQ='"',UQ='"',qQ="⇛",HQ="∽̱",VQ="Ŕ",GQ="ŕ",KQ="√",WQ="⦳",ZQ="⟩",YQ="⟫",JQ="⦒",QQ="⦥",XQ="⟩",eX="»",tX="⥵",nX="⇥",sX="⤠",oX="⤳",rX="→",iX="↠",aX="⇒",lX="⤞",cX="↪",uX="↬",dX="⥅",hX="⥴",fX="⤖",pX="↣",gX="↝",mX="⤚",_X="⤜",bX="",yX="",vX="⤍",wX="⤏",xX="⤐",kX="",EX="}",CX="]",AX="⦌",SX="⦎",TX="⦐",MX="Ř",OX="ř",RX="Ŗ",NX="ŗ",DX="⌉",LX="}",IX="Р",PX="р",FX="⤷",BX="⥩",$X="”",jX="”",zX="↳",UX="",qX="",HX="",VX="",GX="",KX="▭",WX="®",ZX="®",YX="∋",JX="⇋",QX="⥯",XX="⥽",eee="⌋",tee="𝔯",nee="",see="⥤",oee="⇁",ree="⇀",iee="⥬",aee="Ρ",lee="ρ",cee="ϱ",uee="⟩",dee="⇥",hee=
`," "],Jue=["{","}","|","\\","^","`"].concat(Yue),Que=["'"].concat(Jue),Qu=["%","/","?",";","#"].concat(Que),Xu=["/","?","#"],Xue=255,ed=/^[+a-z0-9A-Z_-]{0,63}$/,ede=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,td={javascript:!0,"javascript:":!0},nd={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function tde(t,e){if(t&&t instanceof Sr)return t;var n=new Sr;return n.parse(t,e),n}Sr.prototype.parse=function(t,e){var n,s,o,r,i,a=t;if(a=a.trim(),!e&&t.split("#").length===1){var l=Zue.exec(a);if(l)return this.pathname=l[1],l[2]&&(this.search=l[2]),this}var c=Kue.exec(a);if(c&&(c=c[0],o=c.toLowerCase(),this.protocol=c,a=a.substr(c.length)),(e||c||a.match(/^\/\/[^@\/]+@[^@\/]+/))&&(i=a.substr(0,2)==="//",i&&!(c&&td[c])&&(a=a.substr(2),this.slashes=!0)),!td[c]&&(i||c&&!nd[c])){var d=-1;for(n=0;n<Xu.length;n++)r=a.indexOf(Xu[n]),r!==-1&&(d===-1||r<d)&&(d=r);var h,f;for(d===-1?f=a.lastIndexOf("@"):f=a.lastIndexOf("@",d),f!==-1&&(h=a.slice(0,f),a=a.slice(f+1),this.auth=h),d=-1,n=0;n<Qu.length;n++)r=a.indexOf(Qu[n]),r!==-1&&(d===-1||r<d)&&(d=r);d===-1&&(d=a.length),a[d-1]===":"&&d--;var g=a.slice(0,d);a=a.slice(d),this.parseHost(g),this.hostname=this.hostname||"";var m=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!m){var p=this.hostname.split(/\./);for(n=0,s=p.length;n<s;n++){var b=p[n];if(b&&!b.match(ed)){for(var _="",y=0,x=b.length;y<x;y++)b.charCodeAt(y)>127?_+="x":_+=b[y];if(!_.match(ed)){var A=p.slice(0,n),R=p.slice(n+1),O=b.match(ede);O&&(A.push(O[1]),R.unshift(O[2])),R.length&&(a=R.join(".")+a),this.hostname=A.join(".");break}}}}this.hostname.length>Xue&&(this.hostname=""),m&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}var D=a.indexOf("#");D!==-1&&(this.hash=a.substr(D),a=a.slice(0,D));var v=a.indexOf("?");return v!==-1&&(this.search=a.substr(v),a=a.slice(0,v)),a&&(this.pathname=a),nd[o]&&this.hostname&&!this.pathname&&(this.pathname=""),this};Sr.prototype.parseHost=function(t){var e=Wue.exec(t);e&&(e=e[0],e!==":"&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)};var nde=tde;Gs.encode=que;Gs.decode=Vue;Gs.format=Gue;Gs.parse=nde;var Fn={},zi,sd;function rg(){return sd||(sd=1,zi=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/),zi}var Ui,od;function ig(){return od||(od=1,Ui=/[\0-\x1F\x7F-\x9F]/),Ui}var qi,rd;function sde(){return rd||(rd=1,qi=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/),qi}var Hi,id;function ag(){return id||(id=1,Hi=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/),Hi}var ad;function ode(){return ad||(ad=1,Fn.Any=rg(),Fn.Cc=ig(),Fn.Cf=sde(),Fn.P=ic,Fn.Z=ag()),Fn}(function(t){function e(I){return Object.prototype.toString.call(I)}function n(I){return e(I)==="[object String]"}var s=Object.prototype.hasOwnProperty;function o(I,ce){return s.call(I,ce)}function r(I){var ce=Array.prototype.slice.call(arguments,1);return ce.forEach(function(Z){if(Z){if(typeof Z!="object")throw new TypeError(Z+"must be object");Object.keys(Z).forEach(function(T){I[T]=Z[T]})}}),I}function i(I,ce,Z){return[].concat(I.slice(0,ce),Z,I.slice(ce+1))}function a(I){return!(I>=55296&&I<=57343||I>=64976&&I<=65007||(I&65535)===65535||(I&65535)===65534||I>=0&&I<=8||I===11||I>=14&&I<=31||I>=127&&I<=159||I>1114111)}function l(I){if(I>65535){I-=65536;var ce=55296+(I>>10),Z=56320+(I&1023);return String.fromCharCode(ce,Z)}return String.fromCharCode(I)}var c=/\\([!"#$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~])/g,d=/&([a-z#][a-z0-9]{1,31});/gi,h=new RegExp(c.source+"|"+d.source,"gi"),f=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))/i,g=og;function m(I,ce){var Z=0;return o(g,ce)?g[ce]:ce.charCodeAt(0)===35&&f.test(ce)&&(Z=ce[1].toLowerCase()==="x"?parseInt(ce.slice(2),16):parseInt(ce.slice(1),10),a(Z))?l(Z):I}function p(I){return I.indexOf("\\")<0?I:I.replace(c,"$1")}function b(I){return I.indexOf("\\"
`};Qt.fence=function(t,e,n,s,o){var r=t[e],i=r.info?ude(r.info).trim():"",a="",l="",c,d,h,f,g;return i&&(h=i.split(/(\s+)/g),a=h[0],l=h.slice(2).join("")),n.highlight?c=n.highlight(r.content,a,l)||Xn(r.content):c=Xn(r.content),c.indexOf("<pre")===0?c+`
2023-07-27 23:16:26 +00:00
`:i?(d=r.attrIndex("class"),f=r.attrs?r.attrs.slice():[],d<0?f.push(["class",n.langPrefix+a]):(f[d]=f[d].slice(),f[d][1]+=" "+n.langPrefix+a),g={attrs:f},"<pre><code"+o.renderAttrs(g)+">"+c+`</code></pre>
2023-07-10 23:12:40 +00:00
`):"<pre><code"+o.renderAttrs(r)+">"+c+`</code></pre>
2023-08-02 23:07:29 +00:00
`};Qt.image=function(t,e,n,s,o){var r=t[e];return r.attrs[r.attrIndex("alt")][1]=o.renderInlineAsText(r.children,n,s),o.renderToken(t,e,n)};Qt.hardbreak=function(t,e,n){return n.xhtmlOut?`<br />
2023-07-10 23:12:40 +00:00
`:`<br>
2023-08-02 23:07:29 +00:00
`};Qt.softbreak=function(t,e,n){return n.breaks?n.xhtmlOut?`<br />
2023-07-10 23:12:40 +00:00
`:`<br>
`:`
2023-08-02 23:26:02 +00:00
`};Qt.text=function(t,e){return Xn(t[e].content)};Qt.html_block=function(t,e){return t[e].content};Qt.html_inline=function(t,e){return t[e].content};function Ks(){this.rules=cde({},Qt)}Ks.prototype.renderAttrs=function(e){var n,s,o;if(!e.attrs)return"";for(o="",n=0,s=e.attrs.length;n<s;n++)o+=" "+Xn(e.attrs[n][0])+'="'+Xn(e.attrs[n][1])+'"';return o};Ks.prototype.renderToken=function(e,n,s){var o,r="",i=!1,a=e[n];return a.hidden?"":(a.block&&a.nesting!==-1&&n&&e[n-1].hidden&&(r+=`
2023-07-10 23:12:40 +00:00
`),r+=(a.nesting===-1?"</":"<")+a.tag,r+=this.renderAttrs(a),a.nesting===0&&s.xhtmlOut&&(r+=" /"),a.block&&(i=!0,a.nesting===1&&n+1<e.length&&(o=e[n+1],(o.type==="inline"||o.hidden||o.nesting===-1&&o.tag===a.tag)&&(i=!1))),r+=i?`>
2023-07-25 14:46:03 +00:00
`:">",r)};Ks.prototype.renderInline=function(t,e,n){for(var s,o="",r=this.rules,i=0,a=t.length;i<a;i++)s=t[i].type,typeof r[s]<"u"?o+=r[s](t,i,e,n,this):o+=this.renderToken(t,i,e);return o};Ks.prototype.renderInlineAsText=function(t,e,n){for(var s="",o=0,r=t.length;o<r;o++)t[o].type==="text"?s+=t[o].content:t[o].type==="image"?s+=this.renderInlineAsText(t[o].children,e,n):t[o].type==="softbreak"&&(s+=`
2023-08-02 23:26:02 +00:00
`);return s};Ks.prototype.render=function(t,e,n){var s,o,r,i="",a=this.rules;for(s=0,o=t.length;s<o;s++)r=t[s].type,r==="inline"?i+=this.renderInline(t[s].children,e,n):typeof a[r]<"u"?i+=a[t[s].type](t,s,e,n,this):i+=this.renderToken(t,s,e,n);return i};var dde=Ks;function $t(){this.__rules__=[],this.__cache__=null}$t.prototype.__find__=function(t){for(var e=0;e<this.__rules__.length;e++)if(this.__rules__[e].name===t)return e;return-1};$t.prototype.__compile__=function(){var t=this,e=[""];t.__rules__.forEach(function(n){n.enabled&&n.alt.forEach(function(s){e.indexOf(s)<0&&e.push(s)})}),t.__cache__={},e.forEach(function(n){t.__cache__[n]=[],t.__rules__.forEach(function(s){s.enabled&&(n&&s.alt.indexOf(n)<0||t.__cache__[n].push(s.fn))})})};$t.prototype.at=function(t,e,n){var s=this.__find__(t),o=n||{};if(s===-1)throw new Error("Parser rule not found: "+t);this.__rules__[s].fn=e,this.__rules__[s].alt=o.alt||[],this.__cache__=null};$t.prototype.before=function(t,e,n,s){var o=this.__find__(t),r=s||{};if(o===-1)throw new Error("Parser rule not found: "+t);this.__rules__.splice(o,0,{name:e,enabled:!0,fn:n,alt:r.alt||[]}),this.__cache__=null};$t.prototype.after=function(t,e,n,s){var o=this.__find__(t),r=s||{};if(o===-1)throw new Error("Parser rule not found: "+t);this.__rules__.splice(o+1,0,{name:e,enabled:!0,fn:n,alt:r.alt||[]}),this.__cache__=null};$t.prototype.push=function(t,e,n){var s=n||{};this.__rules__.push({name:t,enabled:!0,fn:e,alt:s.alt||[]}),this.__cache__=null};$t.prototype.enable=function(t,e){Array.isArray(t)||(t=[t]);var n=[];return t.forEach(function(s){var o=this.__find__(s);if(o<0){if(e)return;throw new Error("Rules manager: invalid rule name "+s)}this.__rules__[o].enabled=!0,n.push(s)},this),this.__cache__=null,n};$t.prototype.enableOnly=function(t,e){Array.isArray(t)||(t=[t]),this.__rules__.forEach(function(n){n.enabled=!1}),this.enable(t,e)};$t.prototype.disable=function(t,e){Array.isArray(t)||(t=[t]);var n=[];return t.forEach(function(s){var o=this.__find__(s);if(o<0){if(e)return;throw new Error("Rules manager: invalid rule name "+s)}this.__rules__[o].enabled=!1,n.push(s)},this),this.__cache__=null,n};$t.prototype.getRules=function(t){return this.__cache__===null&&this.__compile__(),this.__cache__[t]||[]};var ac=$t,hde=/\r\n?|\n/g,fde=/\0/g,pde=function(e){var n;n=e.src.replace(hde,`
`),n=n.replace(fde,"<22>"),e.src=n},gde=function(e){var n;e.inlineMode?(n=new e.Token("inline","",0),n.content=e.src,n.map=[0,1],n.children=[],e.tokens.push(n)):e.md.block.parse(e.src,e.md,e.env,e.tokens)},mde=function(e){var n=e.tokens,s,o,r;for(o=0,r=n.length;o<r;o++)s=n[o],s.type==="inline"&&e.md.inline.parse(s.content,e.md,e.env,s.children)},_de=ze.arrayReplaceAt;function bde(t){return/^<a[>\s]/i.test(t)}function yde(t){return/^<\/a\s*>/i.test(t)}var vde=function(e){var n,s,o,r,i,a,l,c,d,h,f,g,m,p,b,_,y=e.tokens,x;if(e.md.options.linkify){for(s=0,o=y.length;s<o;s++)if(!(y[s].type!=="inline"||!e.md.linkify.pretest(y[s].content)))for(r=y[s].children,m=0,n=r.length-1;n>=0;n--){if(a=r[n],a.type==="link_close"){for(n--;r[n].level!==a.level&&r[n].type!=="link_open";)n--;continue}if(a.type==="html_inline"&&(bde(a.content)&&m>0&&m--,yde(a.content)&&m++),!(m>0)&&a.type==="text"&&e.md.linkify.test(a.content)){for(d=a.content,x=e.md.linkify.match(d),l=[],g=a.level,f=0,x.length>0&&x[0].index===0&&n>0&&r[n-1].type==="text_special"&&(x=x.slice(1)),c=0;c<x.length;c++)p=x[c].url,b=e.md.normalizeLink(p),e.md.validateLink(b)&&(_=x[c].text,x[c].schema?x[c].schema==="mailto:"&&!/^mailto:/i.test(_)?_=e.md.normalizeLinkText("mailto:"+_).replace(/^mailto:/,""):_=e.md.normalizeLinkText(_):_=e.md.normalizeLinkText("http://"+_).replace(/^http:\/\//,""),h=x[c].index,h>f&&(i=new e.Token("text","",0),i.content=d.slice(f,h),i.level=g,l.push(i)),i=new e.Token("link_open","a",1),i.attrs=[["href",b]],i.level=g++,i.markup="linkify",i.info="auto",l.push(i),i=new e.Token("text","",0),i.content=_,i.level=g,l.push(i),i=new e.Token("link_close","a",-1),i.level=--g,i.markup="linkify",i.info="auto",l.push(i),f=x[c].lastIndex);f<d.length&&(i=new e.Token("text","",0),i.content=d.slice(f),i.level=g,l.push(i)),y[s].children=r=_de(r,n,l)}}}},lg=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,wde=/\((c|tm|r)\)/i,xde=/\((c|tm|r)\)/ig,kde={c:"©",r:"®",tm:"™"};function Ede(t,e){return kde[e.toLowerCase()]}function Cde(t){var e,n,s=0;for(e=t.length-1;e>=0;e--)n=t[e],n.type==="text"&&!s&&(n.content=n.content.replace(xde,Ede)),n.type==="link_open"&&n.info==="auto"&&s--,n.type==="link_close"&&n.info==="auto"&&s++}function Ade(t){var e,n,s=0;for(e=t.length-1;e>=0;e--)n=t[e],n.type==="text"&&!s&&lg.test(n.content)&&(n.content=n.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/mg,"$1—").replace(/(^|\s)--(?=\s|$)/mg,"$1").replace(/(^|[^-\s])--(?=[^-\s]|$)/mg,"$1")),n.type==="link_open"&&n.info==="auto"&&s--,n.type==="link_close"&&n.info==="auto"&&s++}var Sde=function(e){var n;if(e.md.options.typographer)for(n=e.tokens.length-1;n>=0;n--)e.tokens[n].type==="inline"&&(wde.test(e.tokens[n].content)&&Cde(e.tokens[n].children),lg.test(e.tokens[n].content)&&Ade(e.tokens[n].children))},cd=ze.isWhiteSpace,ud=ze.isPunctChar,dd=ze.isMdAsciiPunct,Tde=/['"]/,hd=/['"]/g,fd="";function Wo(t,e,n){return t.slice(0,e)+n+t.slice(e+1)}function Mde(t,e){var n,s,o,r,i,a,l,c,d,h,f,g,m,p,b,_,y,x,A,R,O;for(A=[],n=0;n<t.length;n++){for(s=t[n],l=t[n].level,y=A.length-1;y>=0&&!(A[y].level<=l);y--);if(A.length=y+1,s.type==="text"){o=s.content,i=0,a=o.length;e:for(;i<a&&(hd.lastIndex=i,r=hd.exec(o),!!r);){if(b=_=!0,i=r.index+1,x=r[0]==="'",d=32,r.index-1>=0)d=o.charCodeAt(r.index-1);else for(y=n-1;y>=0&&!(t[y].type==="softbreak"||t[y].type==="hardbreak");y--)if(t[y].content){d=t[y].content.charCodeAt(t[y].content.length-1);break}if(h=32,i<a)h=o.charCodeAt(i);else for(y=n+1;y<t.length&&!(t[y].type==="softbreak"||t[y].type==="hardbreak");y++)if(t[y].content){h=t[y].content.charCodeAt(0);break}if(f=dd(d)||ud(String.fromCharCode(d)),g=dd(h)||ud(String.fromCharCode(h)),m=cd(d),p=cd(h),p?b=!1:g&&(m||f||(b=!1)),m?_=!1:f&&(p||g||(_=!1)),h===34&&r[0]==='"'&&d>=48&&d<=57&&(_=b=!1),b&&_&&(b=f,_=g),!b&&!_){x&&(s.content=Wo(s.content,r.index,fd));continue}if(_){for(y=A.length-1;y>=0&&(c=A[y],!(A[y].level<l));y--)if(c.single===x&&A[y].level===l){c=A[y],x?(R=e.md.options.quotes[2],O=e.md.options.quotes[
`,i.map=[n,e.line],!0},Bde=function(e,n,s,o){var r,i,a,l,c,d,h,f=!1,g=e.bMarks[n]+e.tShift[n],m=e.eMarks[n];if(e.sCount[n]-e.blkIndent>=4||g+3>m||(r=e.src.charCodeAt(g),r!==126&&r!==96)||(c=g,g=e.skipChars(g,r),i=g-c,i<3)||(h=e.src.slice(c,g),a=e.src.slice(g,m),r===96&&a.indexOf(String.fromCharCode(r))>=0))return!1;if(o)return!0;for(l=n;l++,!(l>=s||(g=c=e.bMarks[l]+e.tShift[l],m=e.eMarks[l],g<m&&e.sCount[l]<e.blkIndent));)if(e.src.charCodeAt(g)===r&&!(e.sCount[l]-e.blkIndent>=4)&&(g=e.skipChars(g,r),!(g-c<i)&&(g=e.skipSpaces(g),!(g<m)))){f=!0;break}return i=e.sCount[n],e.line=l+(f?1:0),d=e.push("fence","code",0),d.info=a,d.content=e.getLines(n+1,l,i,!0),d.markup=h,d.map=[n,e.line],!0},gd=ze.isSpace,$de=function(e,n,s,o){var r,i,a,l,c,d,h,f,g,m,p,b,_,y,x,A,R,O,D,v,k=e.lineMax,M=e.bMarks[n]+e.tShift[n],L=e.eMarks[n];if(e.sCount[n]-e.blkIndent>=4||e.src.charCodeAt(M++)!==62)return!1;if(o)return!0;for(l=g=e.sCount[n]+1,e.src.charCodeAt(M)===32?(M++,l++,g++,r=!1,A=!0):e.src.charCodeAt(M)===9?(A=!0,(e.bsCount[n]+g)%4===3?(M++,l++,g++,r=!1):r=!0):A=!1,m=[e.bMarks[n]],e.bMarks[n]=M;M<L&&(i=e.src.charCodeAt(M),gd(i));){i===9?g+=4-(g+e.bsCount[n]+(r?1:0))%4:g++;M++}for(p=[e.bsCount[n]],e.bsCount[n]=e.sCount[n]+1+(A?1:0),d=M>=L,y=[e.sCount[n]],e.sCount[n]=g-l,x=[e.tShift[n]],e.tShift[n]=M-e.bMarks[n],O=e.md.block.ruler.getRules("blockquote"),_=e.parentType,e.parentType="blockquote",f=n+1;f<s&&(v=e.sCount[f]<e.blkIndent,M=e.bMarks[f]+e.tShift[f],L=e.eMarks[f],!(M>=L));f++){if(e.src.charCodeAt(M++)===62&&!v){for(l=g=e.sCount[f]+1,e.src.charCodeAt(M)===32?(M++,l++,g++,r=!1,A=!0):e.src.charCodeAt(M)===9?(A=!0,(e.bsCount[f]+g)%4===3?(M++,l++,g++,r=!1):r=!0):A=!1,m.push(e.bMarks[f]),e.bMarks[f]=M;M<L&&(i=e.src.charCodeAt(M),gd(i));){i===9?g+=4-(g+e.bsCount[f]+(r?1:0))%4:g++;M++}d=M>=L,p.push(e.bsCount[f]),e.bsCount[f]=e.sCount[f]+1+(A?1:0),y.push(e.sCount[f]),e.sCount[f]=g-l,x.push(e.tShift[f]),e.tShift[f]=M-e.bMarks[f];continue}if(d)break;for(R=!1,a=0,c=O.length;a<c;a++)if(O[a](e,f,s,!0)){R=!0;break}if(R){e.lineMax=f,e.blkIndent!==0&&(m.push(e.bMarks[f]),p.push(e.bsCount[f]),x.push(e.tShift[f]),y.push(e.sCount[f]),e.sCount[f]-=e.blkIndent);break}m.push(e.bMarks[f]),p.push(e.bsCount[f]),x.push(e.tShift[f]),y.push(e.sCount[f]),e.sCount[f]=-1}for(b=e.blkIndent,e.blkIndent=0,D=e.push("blockquote_open","blockquote",1),D.markup=">",D.map=h=[n,0],e.md.block.tokenize(e,n,f),D=e.push("blockquote_close","blockquote",-1),D.markup=">",e.lineMax=k,e.parentType=_,h[1]=e.line,a=0;a<x.length;a++)e.bMarks[a+n]=m[a],e.tShift[a+n]=x[a],e.sCount[a+n]=y[a],e.bsCount[a+n]=p[a];return e.blkIndent=b,!0},jde=ze.isSpace,zde=function(e,n,s,o){var r,i,a,l,c=e.bMarks[n]+e.tShift[n],d=e.eMarks[n];if(e.sCount[n]-e.blkIndent>=4||(r=e.src.charCodeAt(c++),r!==42&&r!==45&&r!==95))return!1;for(i=1;c<d;){if(a=e.src.charCodeAt(c++),a!==r&&!jde(a))return!1;a===r&&i++}return i<3?!1:(o||(e.line=n+1,l=e.push("hr","hr",0),l.map=[n,e.line],l.markup=Array(i+1).join(String.fromCharCode(r))),!0)},ug=ze.isSpace;function md(t,e){var n,s,o,r;return s=t.bMarks[e]+t.tShift[e],o=t.eMarks[e],n=t.src.charCodeAt(s++),n!==42&&n!==45&&n!==43||s<o&&(r=t.src.charCodeAt(s),!ug(r))?-1:s}function _d(t,e){var n,s=t.bMarks[e]+t.tShift[e],o=s,r=t.eMarks[e];if(o+1>=r||(n=t.src.charCodeAt(o++),n<48||n>57))return-1;for(;;){if(o>=r)return-1;if(n=t.src.charCodeAt(o++),n>=48&&n<=57){if(o-s>=10)return-1;continue}if(n===41||n===46)break;return-1}return o<r&&(n=t.src.charCodeAt(o),!ug(n))?-1:o}function Ude(t,e){var n,s,o=t.level+2;for(n=e+2,s=t.tokens.length-2;n<s;n++)t.tokens[n].level===o&&t.tokens[n].type==="paragraph_open"&&(t.tokens[n+2].hidden=!0,t.tokens[n].hidden=!0,n+=2)}var qde=function(e,n,s,o){var r,i,a,l,c,d,h,f,g,m,p,b,_,y,x,A,R,O,D,v,k,M,L,F,J,I,ce,Z,T=!1,q=!0;if(e.sCount[n]-e.blkIndent>=4||e.listIndent>=0&&e.sCount[n]-e.listIndent>=4&&e.sCount[n]<e.blkIndent)return!1;if(o&&e.parentType==="paragraph"&&e.sCount[n]>=e.blkIndent&&(T=!0),(L=_d(e,n))>=0){if(h=!0,J=e.bMarks[n]+e.tShift[n],_=Number(e.src.slice(J,L-1)),T&&_!==1)return!1}else if((L=md(e,n))>=0)h=!1;else return!1;if(T&&e.skipSpaces(L)>=e.
2023-07-27 23:16:26 +00:00
`})),s.tokens.splice(o+3+d.length+1,0,Object.assign(new s.Token("html_block","",0),{content:e.wrapper[1]+`
2023-08-02 23:26:02 +00:00
`})))});function Id(t,e,n,s){var o=t,r=s;if(n&&Object.prototype.hasOwnProperty.call(e,o))throw new Error("User defined `id` attribute `"+t+"` is not unique. Please fix it in your Markdown to continue.");for(;Object.prototype.hasOwnProperty.call(e,o);)o=t+"-"+r,r+=1;return e[o]=!0,o}function gs(t,e){e=Object.assign({},gs.defaults,e),t.core.ruler.push("anchor",function(n){for(var s,o={},r=n.tokens,i=Array.isArray(e.level)?(s=e.level,function(h){return s.includes(h)}):function(h){return function(f){return f>=h}}(e.level),a=0;a<r.length;a++){var l=r[a];if(l.type==="heading_open"&&i(Number(l.tag.substr(1)))){var c=e.getTokensText(r[a+1].children),d=l.attrGet("id");d=d==null?Id(e.slugify(c),o,!1,e.uniqueSlugStartIndex):Id(d,o,!0,e.uniqueSlugStartIndex),l.attrSet("id",d),e.tabIndex!==!1&&l.attrSet("tabindex",""+e.tabIndex),typeof e.permalink=="function"?e.permalink(d,e,n,a):(e.permalink||e.renderPermalink&&e.renderPermalink!==pl)&&e.renderPermalink(d,e,n,a),a=r.indexOf(l),e.callback&&e.callback(l,{slug:d,title:c})}}})}Object.assign(Ld.defaults,{style:"visually-hidden",space:!0,placement:"after",wrapper:null}),gs.permalink={__proto__:null,legacy:pl,renderHref:Cg,renderAttrs:Ag,makePermalink:Fo,linkInsideHeader:yi,ariaHidden:$n,headerLink:Sg,linkAfterHeader:Ld},gs.defaults={level:1,slugify:function(t){return encodeURIComponent(String(t).trim().toLowerCase().replace(/\s+/g,"-"))},uniqueSlugStartIndex:1,tabIndex:"-1",getTokensText:function(t){return t.filter(function(e){return["text","code_inline"].includes(e.type)}).map(function(e){return e.content}).join("")},permalink:!1,renderPermalink:pl,permalinkClass:$n.defaults.class,permalinkSpace:$n.defaults.space,permalinkSymbol:"¶",permalinkBefore:$n.defaults.placement==="before",permalinkHref:$n.defaults.renderHref,permalinkAttrs:$n.defaults.renderAttrs},gs.default=gs;var FFe=function(e,n){n=n||{};function s(o){for(var r=1,i=1,a=o.tokens.length;i<a-1;++i){var l=o.tokens[i];if(l.type==="inline"&&!(!l.children||l.children.length!==1&&l.children.length!==3)&&!(l.children.length===1&&l.children[0].type!=="image")&&!(l.children.length===3&&(l.children[0].type!=="link_open"||l.children[1].type!=="image"||l.children[2].type!=="link_close"))&&!(i!==0&&o.tokens[i-1].type!=="paragraph_open")&&!(i!==a-1&&o.tokens[i+1].type!=="paragraph_close")){var c=o.tokens[i-1];c.type="figure_open",c.tag="figure",o.tokens[i+1].type="figure_close",o.tokens[i+1].tag="figure",n.dataType==!0&&o.tokens[i-1].attrPush(["data-type","image"]);var d;if(n.link==!0&&l.children.length===1&&(d=l.children[0],l.children.unshift(new o.Token("link_open","a",1)),l.children[0].attrPush(["href",d.attrGet("src")]),l.children.push(new o.Token("link_close","a",-1))),d=l.children.length===1?l.children[0]:l.children[1],n.figcaption==!0&&d.children&&d.children.length&&(l.children.push(new o.Token("figcaption_open","figcaption",1)),l.children.splice(l.children.length,0,...d.children),l.children.push(new o.Token("figcaption_close","figcaption",-1)),d.children.length=0),n.copyAttrs&&d.attrs){const h=n.copyAttrs===!0?"":n.copyAttrs;c.attrs=d.attrs.filter(([f,g])=>f.match(h))}n.tabindex==!0&&(o.tokens[i-1].attrPush(["tabindex",r]),r++),n.lazyLoading==!0&&d.attrPush(["loading","lazy"])}}}e.core.ruler.before("linkify","implicit_figures",s)};const BFe=is(FFe);function Tg(t){return t instanceof Map?t.clear=t.delete=t.set=function(){throw new Error("map is read-only")}:t instanceof Set&&(t.add=t.clear=t.delete=function(){throw new Error("set is read-only")}),Object.freeze(t),Object.getOwnPropertyNames(t).forEach(e=>{const n=t[e],s=typeof n;(s==="object"||s==="function")&&!Object.isFrozen(n)&&Tg(n)}),t}class Pd{constructor(e){e.data===void 0&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function Mg(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function Sn(t,...e){const n=Object.create(null);for(const s in t)n[s]=t[s];return e.forEach(function(s){for(const o in s)n[o]=s[o]}),n}const $Fe="</span>",Fd=t=>!!t.scope,jFe=(t,{prefix:
2023-08-04 22:28:36 +00:00
https://github.com/highlightjs/highlight.js/issues/2277`),me=T,ye=q),G===void 0&&(G=!0);const ee={code:ye,language:me};ce("before:highlight",ee);const xe=ee.result?ee.result:h(ee.language,ee.code,G);return xe.code=ee.code,ce("after:highlight",xe),xe}function h(T,q,G,ye){const me=Object.create(null);function ee(W,oe){return W.keywords[oe]}function xe(){if(!z.keywords){U.addText(Y);return}let W=0;z.keywordPatternRe.lastIndex=0;let oe=z.keywordPatternRe.exec(Y),ge="";for(;oe;){ge+=Y.substring(W,oe.index);const Se=j.case_insensitive?oe[0].toLowerCase():oe[0],Pe=ee(z,Se);if(Pe){const[Ge,Le]=Pe;if(U.addText(ge),ge="",me[Se]=(me[Se]||0)+1,me[Se]<=OBe&&(le+=Le),Ge.startsWith("_"))ge+=oe[0];else{const Xe=j.classNameAliases[Ge]||Ge;Q(oe[0],Xe)}}else ge+=oe[0];W=z.keywordPatternRe.lastIndex,oe=z.keywordPatternRe.exec(Y)}ge+=Y.substring(W),U.addText(ge)}function Ae(){if(Y==="")return;let W=null;if(typeof z.subLanguage=="string"){if(!e[z.subLanguage]){U.addText(Y);return}W=h(z.subLanguage,Y,!0,se[z.subLanguage]),se[z.subLanguage]=W._top}else W=g(Y,z.subLanguage.length?z.subLanguage:null);z.relevance>0&&(le+=W.relevance),U.__addSublanguage(W._emitter,W.language)}function N(){z.subLanguage!=null?Ae():xe(),Y=""}function Q(W,oe){W!==""&&(U.startScope(oe),U.addText(W),U.endScope())}function V(W,oe){let ge=1;const Se=oe.length-1;for(;ge<=Se;){if(!W._emit[ge]){ge++;continue}const Pe=j.classNameAliases[W[ge]]||W[ge],Ge=oe[ge];Pe?Q(Ge,Pe):(Y=Ge,xe(),Y=""),ge++}}function te(W,oe){return W.scope&&typeof W.scope=="string"&&U.openNode(j.classNameAliases[W.scope]||W.scope),W.beginScope&&(W.beginScope._wrap?(Q(Y,j.classNameAliases[W.beginScope._wrap]||W.beginScope._wrap),Y=""):W.beginScope._multi&&(V(W.beginScope,oe),Y="")),z=Object.create(W,{parent:{value:z}}),z}function X(W,oe,ge){let Se=GFe(W.endRe,ge);if(Se){if(W["on:end"]){const Pe=new Pd(W);W["on:end"](oe,Pe),Pe.isMatchIgnored&&(Se=!1)}if(Se){for(;W.endsParent&&W.parent;)W=W.parent;return W}}if(W.endsWithParent)return X(W.parent,oe,ge)}function pe(W){return z.matcher.regexIndex===0?(Y+=W[0],1):(Ee=!0,0)}function ue(W){const oe=W[0],ge=W.rule,Se=new Pd(ge),Pe=[ge.__beforeBegin,ge["on:begin"]];for(const Ge of Pe)if(Ge&&(Ge(W,Se),Se.isMatchIgnored))return pe(oe);return ge.skip?Y+=oe:(ge.excludeBegin&&(Y+=oe),N(),!ge.returnBegin&&!ge.excludeBegin&&(Y=oe)),te(ge,W),ge.returnBegin?0:oe.length}function w(W){const oe=W[0],ge=q.substring(W.index),Se=X(z,W,ge);if(!Se)return Ud;const Pe=z;z.endScope&&z.endScope._wrap?(N(),Q(oe,z.endScope._wrap)):z.endScope&&z.endScope._multi?(N(),V(z.endScope,W)):Pe.skip?Y+=oe:(Pe.returnEnd||Pe.excludeEnd||(Y+=oe),N(),Pe.excludeEnd&&(Y=oe));do z.scope&&U.closeNode(),!z.skip&&!z.subLanguage&&(le+=z.relevance),z=z.parent;while(z!==Se.parent);return Se.starts&&te(Se.starts,W),Pe.returnEnd?0:oe.length}function C(){const W=[];for(let oe=z;oe!==j;oe=oe.parent)oe.scope&&W.unshift(oe.scope);W.forEach(oe=>U.openNode(oe))}let P={};function $(W,oe){const ge=oe&&oe[0];if(Y+=W,ge==null)return N(),0;if(P.type==="begin"&&oe.type==="end"&&P.index===oe.index&&ge===""){if(Y+=q.slice(oe.index,oe.index+1),!o){const Se=new Error(`0 width match regex (${T})`);throw Se.languageName=T,Se.badRule=P.rule,Se}return 1}if(P=oe,oe.type==="begin")return ue(oe);if(oe.type==="illegal"&&!G){const Se=new Error('Illegal lexeme "'+ge+'" for mode "'+(z.scope||"<unnamed>")+'"');throw Se.mode=z,Se}else if(oe.type==="end"){const Se=w(oe);if(Se!==Ud)return Se}if(oe.type==="illegal"&&ge==="")return 1;if(de>1e5&&de>oe.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Y+=ge,ge.length}const j=k(T);if(!j)throw Yn(r.replace("{}",T)),new Error('Unknown language: "'+T+'"');const ne=ABe(j);let ae="",z=ye||ne;const se={},U=new a.__emitter(a);C();let Y="",le=0,he=0,de=0,Ee=!1;try{if(j.__emitTokens)j.__emitTokens(q,U);else{for(z.matcher.considerAll();;){de++,Ee?Ee=!1:z.matcher.considerAll(),z.matcher.lastIndex=he;const W=z.matcher.exec(q);if(!W)break;const oe=q.substring(he,W.index),ge=$(oe,W);he=W.index+ge}$(q.substring(he))}return U.finalize(),ae=U.toHTML(),{language:T,value:ae,
2023-08-02 23:26:02 +00:00
`},m]}}return _a=o,_a}var ba,rh;function WBe(){if(rh)return ba;rh=1;const t=l=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:l.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[l.APOS_STRING_MODE,l.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:l.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z][A-Za-z0-9_-]*/}}),e=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],n=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"],s=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"],o=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],r=["align-content","align-items","align-self","all","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radiu
2023-08-04 22:28:36 +00:00
]`,m={scope:"string",variants:[d,c,h,f]},p={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},b=["false","null","true"],_=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],y=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],A={keyword:_,literal:(I=>{const ce=[];return I.forEach(Z=>{ce.push(Z),Z.toLowerCase()===Z?ce.push(Z.toUpperCase()):ce.push(Z.toLowerCase())}),ce})(b),built_in:y},R=I=>I.map(ce=>ce.replace(/\|\d+$/,"")),O={variants:[{match:[/new/,n.concat(g,"+"),n.concat("(?!",R(y).join("\\b|"),"\\b)"),r],scope:{1:"keyword",4:"title.class"}}]},D=n.concat(o,"\\b(?!\\()"),v={variants:[{match:[n.concat(/::/,n.lookahead(/(?!class\b)/)),D],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[r,n.concat(/::/,n.lookahead(/(?!class\b)/)),D],scope:{1:"title.class",3:"variable.constant"}},{match:[r,n.concat("::",n.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[r,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},k={scope:"attr",match:n.concat(o,n.lookahead(":"),n.lookahead(/(?!::)/))},M={relevance:0,begin:/\(/,end:/\)/,keywords:A,contains:[k,i,v,e.C_BLOCK_COMMENT_MODE,m,p,O]},L={relevance:0,match:[/\b/,n.concat("(?!fn\\b|function\\b|",R(_).join("\\b|"),"|",R(y).join("\\b|"),"\\b)"),o,n.concat(g,"*"),n.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[M]};M.contains.push(L);const F=[k,v,e.C_BLOCK_COMMENT_MODE,m,p,O],J={begin:n.concat(/#\[\s*/,r),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:b,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:b,keyword:["new","array"]},contains:["self",...F]},
2023-08-02 23:26:02 +00:00
{.a} softbreak then curly in start`,tests:[{shift:0,type:"inline",children:[{position:-2,type:"softbreak"},{position:-1,type:"text",content:De.hasDelimiters("only",t)}]}],transform:(n,s,o)=>{const r=n[s].children[o],i=De.getAttrs(r.content,0,t);let a=s+1;for(;n[a+1]&&n[a+1].nesting===-1;)a++;const l=De.getMatchingOpeningToken(n,a);De.addAttrs(i,l),n[s].children=n[s].children.slice(0,-2)}},{name:"horizontal rule",tests:[{shift:0,type:"paragraph_open"},{shift:1,type:"inline",children:n=>n.length===1,content:n=>n.match(e)!==null},{shift:2,type:"paragraph_close"}],transform:(n,s)=>{const o=n[s];o.type="hr",o.tag="hr",o.nesting=0;const r=n[s+1].content,i=r.lastIndexOf(t.leftDelimiter),a=De.getAttrs(r,i,t);De.addAttrs(a,o),o.markup=r,n.splice(s+1,2)}},{name:"end of block",tests:[{shift:0,type:"inline",children:[{position:-1,content:De.hasDelimiters("end",t),type:n=>n!=="code_inline"&&n!=="math_inline"}]}],transform:(n,s,o)=>{const r=n[s].children[o],i=r.content,a=De.getAttrs(i,i.lastIndexOf(t.leftDelimiter),t);let l=s+1;for(;n[l+1]&&n[l+1].nesting===-1;)l++;const c=De.getMatchingOpeningToken(n,l);De.addAttrs(a,c);const d=i.slice(0,i.lastIndexOf(t.leftDelimiter));r.content=Ch(d)!==" "?d:d.slice(0,-1)}}]};function Ch(t){return t.slice(-1)[0]}const v$e=y$e,w$e={leftDelimiter:"{",rightDelimiter:"}",allowedAttributes:[]};var x$e=function(e,n){let s=Object.assign({},w$e);s=Object.assign(s,n);const o=v$e(s);function r(i){const a=i.tokens;for(let l=0;l<a.length;l++)for(let c=0;c<o.length;c++){const d=o[c];let h=null;d.tests.every(g=>{const m=ml(a,l,g);return m.j!==null&&(h=m.j),m.match})&&(d.transform(a,l,h),(d.name==="inline attributes"||d.name==="inline nesting 0")&&c--)}}e.core.ruler.before("linkify","curly_attributes",r)};function ml(t,e,n){const s={match:!1,j:null},o=n.shift!==void 0?e+n.shift:n.position;if(n.shift!==void 0&&o<0)return s;const r=C$e(t,o);if(r===void 0)return s;for(const i of Object.keys(n))if(!(i==="shift"||i==="position")){if(r[i]===void 0)return s;if(i==="children"&&k$e(n.children)){if(r.children.length===0)return s;let a;const l=n.children,c=r.children;if(l.every(d=>d.position!==void 0)){if(a=l.every(d=>ml(c,d.position,d).match),a){const d=A$e(l).position;s.j=d>=0?d:c.length+d}}else for(let d=0;d<c.length;d++)if(a=l.every(h=>ml(c,d,h).match),a){s.j=d;break}if(a===!1)return s;continue}switch(typeof n[i]){case"boolean":case"number":case"string":if(r[i]!==n[i])return s;break;case"function":if(!n[i](r[i]))return s;break;case"object":if(E$e(n[i])){if(n[i].every(l=>l(r[i]))===!1)return s;break}default:throw new Error(`Unknown type of pattern test (key: ${i}). Test should be of type boolean, number, string, function or array of functions.`)}}return s.match=!0,s}function k$e(t){return Array.isArray(t)&&t.length&&t.every(e=>typeof e=="object")}function E$e(t){return Array.isArray(t)&&t.length&&t.every(e=>typeof e=="function")}function C$e(t,e){return e>=0?t[e]:t[t.length+e]}function A$e(t){return t.slice(-1)[0]||{}}const S$e=is(x$e);function T$e(){const t=Date.now().toString(),e=Math.floor(Math.random()*1e3).toString();return t+e}const Mo=new Rfe("commonmark",{html:!0,xhtmlOut:!0,breaks:!0,linkify:!0,typographer:!0,highlight:(t,e)=>{let n=T$e();if(e&&co.getLanguage(e))try{const o=co.highlight(e,t).value;return'<div class="bg-bg-light-tone-panel dark:bg-bg-dark-tone-panel p-2 rounded-lg shadow-sm">'+e+'<button class="px-2 py-1 ml-10 mb-2 text-left p-2 text-sm font-medium bg-bg-dark-tone-panel dark:bg-bg-dark-tone rounded-lg hover:bg-primary dark:hover:bg-primary text-white text-xs transition-colors duration-200"><span class="mr-1" id="copy-btn_'+n+'" onclick="copyContentToClipboard('+n+')">Copy</span><span class="hidden text-xs text-green-500" id="copyed-btn_'+n+'" onclick="copyContentToClipboard('+n+')">Copied!</span></button><pre class="hljs p-1 rounded-md break-all grid grid-cols-1"><code id="code_'+n+'" class="overflow-x-auto break-all scrollbar-thin scrollbar-track-bg-light-tone scrollbar-thumb-bg-light-tone-panel hover:scrollbar-thumb-primary dark:scrollbar-track-bg-dark-tone dark:scrollbar-thumb-bg-dark-tone-pan
2023-07-10 23:12:40 +00:00
// Your inline script code here
function copyContentToClipboard(id) {
console.log("copied");
const codeElement = document.getElementById('code_' + id);
const copybtnElement = document.getElementById('copy-btn_' + id);
const copyedbtnElement = document.getElementById('copyed-btn_' + id);
copybtnElement.classList.add('hidden');
copyedbtnElement.classList.remove('hidden');
const range = document.createRange();
range.selectNode(codeElement);
window.getSelection().removeAllRanges();
window.getSelection().addRange(range);
document.execCommand('copy');
window.getSelection().removeAllRanges();
}
2023-08-04 22:28:36 +00:00
`,t.async=!0,document.body.appendChild(t),this.renderedMarkdown=Mo.render(this.markdownText),_e(()=>{we.replace()})},methods:{},watch:{markdownText(t){this.renderedMarkdown=Mo.render(t),_e(()=>{we.replace()})}}},O$e={class:"break-all"},R$e=["innerHTML"];function N$e(t,e,n,s,o,r){return E(),S("div",O$e,[u("div",{innerHTML:o.renderedMarkdown,class:"markdown-content"},null,8,R$e)])}const D$e=Ue(M$e,[["render",N$e]]),L$e={props:{done:{type:Boolean,required:!0},message:{type:String,required:!0},status:{type:Boolean,required:!0}}},I$e={class:"step flex items-center mb-4"},P$e={class:"flex items-center justify-center w-6 h-6 mr-2"},F$e={key:0},B$e=u("i",{"data-feather":"square",class:"text-gray-400 w-4 h-4"},null,-1),$$e=[B$e],j$e={key:1},z$e=u("i",{"data-feather":"check-square",class:"text-green-500 w-4 h-4"},null,-1),U$e=[z$e],q$e={key:2},H$e=u("i",{"data-feather":"x-square",class:"text-red-500 w-4 h-4"},null,-1),V$e=[H$e],G$e={key:0,role:"status"},K$e=u("svg",{"aria-hidden":"true",class:"w-6 h-6 animate-spin fill-secondary",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[u("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),u("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})],-1),W$e=[K$e];function Z$e(t,e,n,s,o,r){return E(),S("div",I$e,[u("div",P$e,[n.done?B("",!0):(E(),S("div",F$e,$$e)),n.done&&n.status?(E(),S("div",j$e,U$e)):B("",!0),n.done&&!n.status?(E(),S("div",q$e,V$e)):B("",!0)]),n.done?B("",!0):(E(),S("div",G$e,W$e)),u("div",{class:Te(["content flex-1 px-2",{"text-green-500":n.done,"text-yellow-500":!n.done}])},H(n.message),3)])}const Y$e=Ue(L$e,[["render",Z$e]]);const J$e={props:{jsonData:{type:[Object,Array,String],default:null},jsonFormText:{type:String,default:"JSON Form"}},data(){return{collapsed:!0}},computed:{formattedJson(){return this.jsonData.replace(/\n/g,"<br>")},isObject(){return typeof this.jsonData=="object"&&this.jsonData!==null},isContentPresent(){return this.jsonData!==null&&(typeof this.jsonData!="string"||this.jsonData.trim()!=="")}},methods:{toggleCollapsed(){this.collapsed=!this.collapsed},toggleCollapsible(){this.isObject||(this.collapsed=!this.collapsed)}}},Q$e={key:0},X$e={class:"toggle-icon mr-1"},eje={key:0,class:"fas fa-plus-circle text-gray-600"},tje={key:1,class:"fas fa-minus-circle text-gray-600"},nje={class:"json-viewer max-h-64 overflow-auto p-4 bg-gray-100 border border-gray-300 rounded dark:bg-gray-600"},sje={key:0,class:"fas fa-plus-circle text-gray-600"},oje={key:1,class:"fas fa-minus-circle text-gray-600"},rje=["innerHTML"];function ije(t,e,n,s,o,r){return r.isContentPresent?(E(),S("div",Q$e,[u("div",{class:"collapsible-section cursor-pointer mb-4 font-bold hover:text-gray-900",onClick:e[0]||(e[0]=(...i)=>r.toggleCollapsible&&r.toggleCollapsible(...i))},[u("span",X$e,[o.collapsed?(E(),S("i",eje)):(E(),S("i",tje))]),be(" "+H(n.jsonFormText),1)]),ve(u("div",null,[u("div",nje,[r.isObject?(E(),S("span",{key:0,onClick:e[1]||(e[1]=(...i)=>r.toggleCollapsed&&r.toggleCollapsed(...i)),class:"toggle-icon cursor-pointer mr-1"},[o.collapsed?(E(),S("i",sje)):(E(),S("i",oje))])):B("",!0),u("pre",{innerHTML:r.formattedJson},null,8,rje)])],512),[[rt,!o.collapsed
2023-07-27 23:16:26 +00:00
`+s,4,!1)})}catch(s){this.$refs.toast.showToast(`Did not get Personality settings responses.
2023-08-04 22:28:36 +00:00
Endpoint error: `+s.message,4,!1)}}):this.$refs.toast.showToast("Personality has no settings",4,!1))})}catch(e){this.$refs.toast.showToast("Could not open personality settings. Endpoint error: "+e.message,4,!1)}},toggleShowPersList(){this.onShowPersList()},async constructor(){for(_e(()=>{we.replace()});this.$store.state.ready===!1;)await new Promise(t=>setTimeout(t,100));this.onReady()},async api_get_req(t){try{const e=await ke.get("/"+t);if(e)return e.data}catch(e){console.log(e.message,"api_get_req - mountedPersonalities");return}},personalityImgPlacehodler(t){t.target.src=Qn}}},hze={class:"w-fit select-none"},fze={key:0,class:"flex -space-x-4"},pze=["src","title"],gze={key:1,class:"flex -space-x-4"},mze=["src","title"],_ze={key:2,title:"Loading personalities"},bze=u("div",{role:"status"},[u("svg",{"aria-hidden":"true",class:"w-6 h-6 animate-spin fill-secondary",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[u("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),u("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]),u("span",{class:"sr-only"},"Loading...")],-1),yze=[bze];function vze(t,e,n,s,o,r){const i=Ye("UniversalForm");return E(),S(Oe,null,[u("div",hze,[r.mountedPersArr.length>1?(E(),S("div",fze,[u("img",{src:o.bUrl+r.mountedPers.avatar,onError:e[0]||(e[0]=(...a)=>r.personalityImgPlacehodler&&r.personalityImgPlacehodler(...a)),class:"w-8 h-8 rounded-full object-fill text-red-700 border-2 active:scale-90 hover:z-20 hover:-translate-y-2 duration-150 border-secondary cursor-pointer",title:"Active personality: "+r.mountedPers.name,onClick:e[1]||(e[1]=a=>r.onSettingsPersonality(r.mountedPers))},null,40,pze),u("div",{class:"flex items-center justify-center w-8 h-8 cursor-pointer text-xs font-medium bg-bg-light dark:bg-bg-dark border-2 hover:border-secondary rounded-full hover:bg-bg-light-tone dark:hover:bg-bg-dark-tone dark:border-gray-800 hover:z-20 hover:-translate-y-2 duration-150 active:scale-90",onClick:e[2]||(e[2]=re((...a)=>r.toggleShowPersList&&r.toggleShowPersList(...a),["stop"])),title:"Click to show more"},"+"+H(r.mountedPersArr.length-1),1)])):B("",!0),r.mountedPersArr.length==1?(E(),S("div",gze,[u("img",{src:o.bUrl+this.$store.state.mountedPers.avatar,onError:e[3]||(e[3]=(...a)=>r.personalityImgPlacehodler&&r.personalityImgPlacehodler(...a)),class:"w-8 h-8 rounded-full object-fill text-red-700 border-2 active:scale-90 hover:z-20 cursor-pointer border-secondary",title:"Active personality: "+this.$store.state.mountedPers.name,onClick:e[4]||(e[4]=re((...a)=>r.toggleShowPersList&&r.toggleShowPersList(...a),["stop"]))},null,40,mze)])):B("",!0),r.mountedPersArr.length==0?(E(),S("div",_ze,yze)):B("",!0)]),fe(i,{ref:"universalForm",class:"z-20"},null,512)],64)}const wze=Ue(dze,[["render",vze]]);const xze="/";ke.defaults.baseURL="/";const kze={props:{onTalk:Function,onMountUnmount:Function,discussionPersonalities:Array,onShowPersList:Function},components:{PersonalityEntry:Bp,Toast:li,UniversalForm:rc},name:"MountedPersonalitiesList",data(){return{bUrl:xze,isMounted:!1,isLoading:!1}},async mounted(){await this.constructor(),this.isMounted=!0},async activated(){this.isMounted&&await this.cons
2023-08-02 23:07:29 +00:00
`+e.message,4,!1),{status:!1}))},onPersonalityMounted(t){this.configFile.personalities.includes(t.full_path)?this.configFile.personalities.length==1?this.$refs.toast.showToast("Can't unmount last personality",4,!1):this.unmountPersonality(t):this.mountPersonality(t)},async handleOnTalk(t){if(we.replace(),console.log("ppa",t),t){if(t.isMounted){const e=await this.select_personality(t);e&&e.status&&(await this.constructor(),this.$refs.toast.showToast(`Selected personality:
`+t.name,4,!0))}else this.onPersonalityMounted(t);this.onTalk(t)}},async onPersonalitySelected(t){if(we.replace(),console.log("ppa",t),t){if(t.selected){this.$refs.toast.showToast("Personality already selected",4,!0);return}if(t.isMounted){const e=await this.select_personality(t);e&&e.status&&(await this.constructor(),this.$refs.toast.showToast(`Selected personality:
2023-08-04 22:28:36 +00:00
`+t.name,4,!0))}else this.onPersonalityMounted(t)}},onSettingsPersonality(t){try{ke.get("/get_active_personality_settings").then(e=>{e&&(console.log("pers sett",e),e.data&&Object.keys(e.data).length>0?this.$refs.universalForm.showForm(e.data,"Personality settings - "+t.personality.name,"Save changes","Cancel").then(n=>{try{ke.post("/set_active_personality_settings",n).then(s=>{s&&s.data?(console.log("personality set with new settings",s.data),this.$refs.toast.showToast("Personality settings updated successfully!",4,!0)):this.$refs.toast.showToast(`Did not get Personality settings responses.
2023-07-10 23:12:40 +00:00
`+s,4,!1)})}catch(s){this.$refs.toast.showToast(`Did not get Personality settings responses.
2023-08-04 22:28:36 +00:00
Endpoint error: `+s.message,4,!1)}}):this.$refs.toast.showToast("Personality has no settings",4,!1))})}catch(e){this.$refs.toast.showToast("Could not open personality settings. Endpoint error: "+e.message,4,!1)}},async mount_personality(t){if(!t)return{status:!1,error:"no personality - mount_personality"};try{const e={language:t.language,category:t.category,folder:t.folder},n=await ke.post("/mount_personality",e);if(n)return n.data}catch(e){console.log(e.message,"mount_personality - settings");return}},async unmount_personality(t){if(!t)return{status:!1,error:"no personality - unmount_personality"};const e={language:t.language,category:t.category,folder:t.folder};try{const n=await ke.post("/unmount_personality",e);if(n)return n.data}catch(n){console.log(n.message,"unmount_personality - settings");return}},async select_personality(t){if(!t)return{status:!1,error:"no personality - select_personality"};console.log("select pers",t);const n={id:this.configFile.personalities.findIndex(s=>s===t.full_path)};try{const s=await ke.post("/select_personality",n);if(s)return this.toggleMountUnmount(),this.$store.dispatch("refreshConfig").then(()=>{console.log("recovered config"),this.$store.dispatch("refreshPersonalitiesArr").then(()=>{this.$store.dispatch("refreshMountedPersonalities")})}),s.data}catch(s){console.log(s,"select_personality - settings");return}},async mountPersonality(t){if(console.log("mount pers",t),!t)return;if(this.configFile.personalities.includes(t.personality.full_path)){this.$refs.toast.showToast("Personality already mounted",4,!1);return}const e=await this.mount_personality(t.personality);console.log("mount_personality res",e),e.status?(this.configFile.personalities=e.personalities,this.$refs.toast.showToast("Personality mounted",4,!0),t.isMounted=!0,this.toggleMountUnmount(),(await this.select_personality(t.personality)).status&&this.$refs.toast.showToast(`Selected personality:
2023-07-10 23:12:40 +00:00
`+t.personality.name,4,!0),this.getMountedPersonalities()):(t.isMounted=!1,this.$refs.toast.showToast(`Could not mount personality
Error: `+e.error,4,!1))},async unmountPersonality(t){if(!t)return;const e=await this.unmount_personality(t.personality||t);if(e.status){this.toggleMountUnmount(),console.log("unmount response",e),this.configFile.active_personality_id=e.active_personality_id,this.configFile.personalities=e.personalities,this.$refs.toast.showToast("Personality unmounted",4,!0);const n=this.configFile.personalities[this.configFile.active_personality_id];console.log();const s=this.personalities.findIndex(a=>a.full_path==n),o=this.$refs.personalitiesZoo.findIndex(a=>a.full_path==t.full_path);console.log("ppp",this.personalities[s]);const r=this.personalities[s];r.isMounted=!1,r.selected=!0,this.$refs.personalitiesZoo[o].isMounted=!1,this.getMountedPersonalities(),(await this.select_personality(r)).status&&this.$refs.toast.showToast(`Selected personality:
`+r.name,4,!0)}else this.$refs.toast.showToast(`Could not unmount personality
2023-08-02 23:26:02 +00:00
Error: `+e.error,4,!1)},getMountedPersonalities(){this.isLoading=!0;let t=[];console.log(this.configFile.personalities.length);for(let e=0;e<this.configFile.personalities.length;e++){const n=this.configFile.personalities[e],s=this.personalities.findIndex(r=>r.full_path==n),o=this.personalities[s];if(o)console.log("adding from config"),t.push(o);else{console.log("adding default");const r=this.personalities.findIndex(a=>a.full_path=="english/generic/lollms"),i=this.personalities[r];t.push(i)}}if(this.mountedPersArr=[],this.mountedPersArr=t,console.log("discussionPersonalities",this.discussionPersonalities),this.discussionPersonalities!=null&&this.discussionPersonalities.length>0)for(let e=0;e<this.discussionPersonalities.length;e++){const n=this.discussionPersonalities[e];console.log("discussionPersonalities - per",n);const s=this.mountedPersArr.findIndex(o=>o.full_path==n);if(console.log("discussionPersonalities -includes",s),console.log("discussionPersonalities -mounted list",this.mountedPersArr),s==-1){const o=this.personalities.findIndex(i=>i.full_path==n),r=this.personalities[o];console.log("adding discucc121",r,n),r&&(this.mountedPersArr.push(r),console.log("adding discucc",r))}}this.isLoading=!1,console.log("getMountedPersonalities",this.mountedPersArr),console.log("fig",this.configFile)}}},vc=t=>(ns("data-v-e36401c9"),t=t(),ss(),t),Eze={class:"text-left overflow-visible text-base font-semibold cursor-pointer select-none items-center flex flex-col flex-grow w-full overflow-x-auto scrollbar-thin scrollbar-track-bg-light scrollbar-thumb-bg-light-tone hover:scrollbar-thumb-primary dark:scrollbar-track-bg-dark dark:scrollbar-thumb-bg-dark-tone dark:hover:scrollbar-thumb-primary active:scrollbar-thumb-secondary"},Cze={key:0,role:"status",class:"flex justify-center overflow-y-hidden"},Aze=vc(()=>u("svg",{"aria-hidden":"true",class:"w-6 h-6 animate-spin fill-secondary",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[u("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),u("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})],-1)),Sze=vc(()=>u("span",{class:"sr-only"},"Loading...",-1)),Tze=[Aze,Sze],Mze=vc(()=>u("i",{"data-feather":"chevron-down"},null,-1)),Oze=[Mze],Rze={class:"block my-2 text-sm font-medium text-gray-900 dark:text-white"},Nze={class:"overflow-y-auto no-scrollbar pb-0 grid lg:grid-cols-3 md:grid-cols-2 gap-4 max-h-96"};function Dze(t,e,n,s,o,r){const i=Ye("personality-entry"),a=Ye("Toast"),l=Ye("UniversalForm");return E(),S("div",Eze,[o.isLoading?(E(),S("div",Cze,Tze)):B("",!0),u("div",null,[r.mountedPersArr.length>0?(E(),S("div",{key:0,class:Te(o.isLoading?"pointer-events-none opacity-30 cursor-default":"")},[u("button",{class:"mt-0 w-full text-2xl hover:text-secondary duration-75 flex justify-center hover:bg-bg-light-tone hover:dark:bg-bg-dark-tone rounded-lg",title:"Close personality list",type:"button",onClick:e[0]||(e[0]=re((...c)=>r.toggleShowPersList&&r.toggleShowPersList(...c),["stop"]))},Oze),u("label",Rze," Mounted Personalities: ("+H(r.mountedPersArr.length)+") ",1),u("div",Nze,[fe(Ut,{name:"bounce"},{default:$e(()=>[(E(!0),S(Oe,null,Ze(this.$store.state.mountedPersArr,(c,d
`+s.error,4,!1),this.loading=!1,Me.off("file_received")}),Me.emit("send_file",n)},e.readAsDataURL(this.selectedFile)},async constructor(){nextTick(()=>{we.replace()})},toggleMenu(){this.showMenu=!this.showMenu},execute_cmd(t){this.showMenu=!this.showMenu,t.hasOwnProperty("is_file")?(console.log("Need to send a file."),this.selectFile(t.hasOwnProperty("file_types")?t.file_types:"*",()=>{this.selectedFile!=null&&this.uploadFile()})):this.sendCommand(t.value)},handleClickOutside(t){const e=this.$el.querySelector(".commands-menu-items-wrapper");e&&!e.contains(t.target)&&(this.showMenu=!1)}},mounted(){this.commands=this.commandsList,document.addEventListener("click",this.handleClickOutside)},beforeUnmount(){document.removeEventListener("click",this.handleClickOutside)}},Gze=t=>(ns("data-v-52cfa09c"),t=t(),ss(),t),Kze={key:0,title:"Loading..",class:"flex flex-row flex-grow justify-end"},Wze=Gze(()=>u("div",{role:"status"},[u("svg",{"aria-hidden":"true",class:"w-6 h-6 animate-spin fill-secondary",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[u("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),u("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]),u("span",{class:"sr-only"},"Loading...")],-1)),Zze=[Wze];function Yze(t,e,n,s,o,r){const i=Ye("InteractiveMenu");return o.loading?(E(),S("div",Kze,Zze)):(E(),nt(i,{key:1,commands:n.commandsList,execute_cmd:r.execute_cmd},null,8,["commands","execute_cmd"]))}const Jze=Ue(Vze,[["render",Yze],["__scopeId","data-v-52cfa09c"]]);const Qze={name:"ChatBox",emits:["messageSentEvent","stopGenerating"],props:{onTalk:Function,discussionList:Array,loading:!1,onShowToastMessage:Function},components:{MountedPersonalities:wze,MountedPersonalitiesList:Lze,PersonalitiesCommands:Jze},setup(){},data(){return{message:"",isVoiceActive:!1,fileList:[],totalSize:0,showFileList:!0,showPersonalities:!1,personalities_ready:!1}},computed:{config(){return this.$store.state.config},mountedPers(){return this.$store.state.mountedPers},allDiscussionPersonalities(){if(this.discussionList.length>0){let t=[];for(let e=0;e<this.discussionList.length;e++)!t.includes(this.discussionList[e].personality)&&!this.discussionList[e].personality==""&&t.push(this.discussionList[e].personality);return console.log("conputer pers",t),console.log("dis conputer pers",this.discussionList),t}}},methods:{startSpeechRecognition(){"SpeechRecognition"in window||"webkitSpeechRecognition"in window?(this.recognition=new(window.SpeechRecognition||window.webkitSpeechRecognition),this.recognition.lang=this.$store.state.config.audio_in_language,this.recognition.interimResults=!0,this.recognition.onstart=()=>{this.isVoiceActive=!0,this.silenceTimer=setTimeout(()=>{this.recognition.stop()},this.silenceTimeout)},this.recognition.onresult=t=>{let e="";for(let n=t.resultIndex;n<t.results.length;n++)e+=t.results[n][0].transcript;this.message=e,clearTimeout(this.silenceTimer),this.silenceTimer=setTimeout(()=>{this.recognition.stop()},this.silenceTimeout)},this.recognition.onerror=t=>{console.error("Speech recognition error:",t.error),this.isVoiceActive=!1,clearTimeout(this.silenceTimer)},this.recognition.onend=()=>{console.log("S
2023-07-10 23:12:40 +00:00
\r
\r
2023-08-04 22:28:36 +00:00
`,544),[[He,o.message]]),u("input",{type:"file",ref:"fileDialog",style:{display:"none"},onChange:e[6]||(e[6]=(...c)=>r.addFiles&&r.addFiles(...c)),multiple:""},null,544),u("button",{type:"button",onClick:e[7]||(e[7]=re(c=>t.$refs.fileDialog.click(),["stop"])),title:"Add files",class:"absolute inset-y-0 right-0 flex items-center mr-2 w-6 hover:text-secondary duration-75 active:scale-90"},PUe)]),u("div",FUe,[u("button",{type:"button",onClick:e[8]||(e[8]=(...c)=>r.startSpeechRecognition&&r.startSpeechRecognition(...c)),class:Te([{"text-red-500":o.isVoiceActive},"w-6 hover:text-secondary duration-75 active:scale-90 cursor-pointer"])},$Ue,2),n.loading?B("",!0):(E(),S("button",{key:0,type:"button",onClick:e[9]||(e[9]=(...c)=>r.submit&&r.submit(...c)),class:"w-6 hover:text-secondary duration-75 active:scale-90"},UUe)),n.loading?(E(),S("div",qUe,VUe)):B("",!0)])])])])])])}const Ug=Ue(Qze,[["render",GUe],["__scopeId","data-v-51ff0970"]]),KUe={name:"WelcomeComponent",setup(){return{}}},WUe={class:"flex flex-col text-center"},ZUe=os('<div class="flex flex-col text-center items-center"><div class="flex items-center gap-3 text-5xl drop-shadow-md align-middle pt-24"><img class="w-24 animate-bounce" title="LoLLMS WebUI" src="'+nc+'" alt="Logo"><div class="flex flex-col items-start"><p class="text-2xl">Lord of Large Language Models</p><p class="text-gray-400 text-base">One tool to rule them all</p></div></div><hr class="mt-1 w-96 h-1 mx-auto my-2 md:my-2 dark:bg-bg-dark-tone-panel bg-bg-light-tone-panel border-0 rounded"><p class="text-2xl">Welcome</p><p class="text-lg">Please create a new discussion or select existing one to start</p></div>',1),YUe=[ZUe];function JUe(t,e,n,s,o,r){return E(),S("div",WUe,YUe)}const qg=Ue(KUe,[["render",JUe]]);const QUe={setup(){return{}},name:"DragDrop",emits:["panelLeave","panelDrop"],data(){return{fileList:[],show:!1,dropRelease:!1}},mounted(){_e(()=>{we.replace()})},methods:{async panelDrop(t){const e="getAsFileSystemHandle"in DataTransferItem.prototype,n="webkitGetAsEntry"in DataTransferItem.prototype;if(!e&&!n)return;const s=[...t.dataTransfer.items].filter(r=>r.kind==="file").map(r=>e?r.getAsFileSystemHandle():r.webkitGetAsEntry());let o=[];for await(const r of s)(r.kind==="directory"||r.isDirectory)&&o.push(r.name);this.dropRelease=!0,t.dataTransfer.files.length>0&&[...t.dataTransfer.files].forEach(r=>{o.includes(r.name)||this.fileList.push(r)}),_e(()=>{we.replace()}),this.$emit("panelDrop",this.fileList),this.fileList=[],this.show=!1},panelLeave(){this.$emit("panelLeave"),console.log("exit/leave"),this.dropRelease=!1,this.show=!1,_e(()=>{we.replace()})}}},XUe={class:"text-4xl text-center"};function eqe(t,e,n,s,o,r){return E(),nt(Ut,{name:"list",tag:"div"},{default:$e(()=>[o.show?(E(),S("div",{key:"dropmenu",class:"select-none text-slate-50 absolute top-0 left-0 right-0 bottom-0 flex flex-col items-center justify-center bg-black bg-opacity-50 duration-200 backdrop-blur-sm",onDragleave:e[0]||(e[0]=re(i=>r.panelLeave(i),["prevent"])),onDrop:e[1]||(e[1]=re(i=>r.panelDrop(i),["stop","prevent"]))},[u("div",{class:Te(["flex flex-col items-center justify-center p-8 rounded-lg shadow-lg border-dashed border-4 border-secondary w-4/5 h-4/5",o.dropRelease?"":"pointer-events-none"])},[u("div",XUe,[wr(t.$slots,"default",{},()=>[be(" Drop your files here ")])])],2)],32)):B("",!0)]),_:3})}const _l=Ue(QUe,[["render",eqe]]);var tqe=function(){function t(e,n){n===void 0&&(n=[]),this._eventType=e,this._eventFunctions=n}return t.prototype.init=function(){var e=this;this._eventFunctions.forEach(function(n){typeof window<"u"&&window.addEventListener(e._eventType,n)})},t}(),Rr=globalThis&&globalThis.__assign||function(){return Rr=Object.assign||function(t){for(var e,n=1,s=arguments.length;n<s;n++){e=arguments[n];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t},Rr.apply(this,arguments)},Nr={alwaysOpen:!1,activeClasses:"bg-gray-100 dark:bg-gray-800 text-gray-900 dark:text-white",inactiveClasses:"text-gray-500 dark:text-gray-400",onOpen:function(){},onClose:functi
2023-07-10 23:12:40 +00:00
Personality: ${t.message.personality}`);let s="";t.created_at_parsed&&(s=`
Created: ${t.created_at_parsed}`);let o="";t.message.content&&(o=t.message.content);let r="";t.message.model&&(r=`Model: ${t.message.model}`);let i="";t.message.seed&&(i=`Seed: ${t.message.seed}`);let a="";t.time_spent&&(a=`
Time spent: ${t.time_spent}`);let l="";l=`${e} ${r} ${i} ${a}`.trim();const c=`${t.message.sender}${n}${s}
${o}
2023-08-02 23:07:29 +00:00
${l}`;navigator.clipboard.writeText(c),_e(()=>{we.replace()})},closeToast(){this.showToast=!1},saveJSONtoFile(t,e){e=e||"data.json";const n=document.createElement("a");n.href=URL.createObjectURL(new Blob([JSON.stringify(t,null,2)],{type:"text/plain"})),n.setAttribute("download",e),document.body.appendChild(n),n.click(),document.body.removeChild(n)},parseJsonObj(t){try{return JSON.parse(t)}catch(e){return this.$refs.toast.showToast(`Could not parse JSON.
2023-07-27 23:16:26 +00:00
`+e.message,4,!1),null}},async parseJsonFile(t){return new Promise((e,n)=>{const s=new FileReader;s.onload=o=>e(this.parseJsonObj(o.target.result)),s.onerror=o=>n(o),s.readAsText(t)})},async exportDiscussions(){const t=this.list.filter(e=>e.checkBoxValue==!0).map(e=>e.id);if(t.length>0){console.log("export",t);let e=new Date;const n=e.getFullYear(),s=(e.getMonth()+1).toString().padStart(2,"0"),o=e.getDate().toString().padStart(2,"0"),r=e.getHours().toString().padStart(2,"0"),i=e.getMinutes().toString().padStart(2,"0"),a=e.getSeconds().toString().padStart(2,"0"),c="discussions_export_"+(n+"."+s+"."+o+"."+r+i+a)+".json";this.loading=!0;const d=await this.export_multiple_discussions(t);d?(this.saveJSONtoFile(d,c),this.$refs.toast.showToast("Successfully exported",4,!0),this.isCheckbox=!1):this.$refs.toast.showToast("Failed to export discussions",4,!1),this.loading=!1}},async importDiscussions(t){const e=await this.parseJsonFile(t.target.files[0]);await this.import_multiple_discussions(e)?(this.$refs.toast.showToast("Successfully imported ("+e.length+")",4,!0),await this.list_discussions()):this.$refs.toast.showToast("Failed to import discussions",4,!1)},async getPersonalityAvatars(){for(;this.$store.state.personalities===null;)await new Promise(e=>setTimeout(e,100));let t=this.$store.state.personalities;this.personalityAvatars=t.map(e=>({name:e.name,avatar:e.avatar}))},getAvatar(t){if(t.toLowerCase().trim()==this.$store.state.config.user_name.toLowerCase().trim())return"user_infos/"+this.$store.state.config.user_avatar;const e=this.personalityAvatars.findIndex(s=>s.name===t),n=this.personalityAvatars[e];if(n)return console.log("Avatar",n.avatar),n.avatar},setFileListChat(t){try{this.$refs.chatBox.fileList=this.$refs.chatBox.fileList.concat(t)}catch(e){this.$refs.toast.showToast(`Failed to set filelist in chatbox
2023-08-04 22:28:36 +00:00
`+e.message,4,!1)}this.isDragOverChat=!1},setDropZoneChat(){this.isDragOverChat=!0,this.$refs.dragdropChat.show=!0},async setFileListDiscussion(t){if(t.length>1){this.$refs.toast.showToast("Failed to import discussions. Too many files",4,!1);return}const e=await this.parseJsonFile(t[0]);await this.import_multiple_discussions(e)?(this.$refs.toast.showToast("Successfully imported ("+e.length+")",4,!0),await this.list_discussions()):this.$refs.toast.showToast("Failed to import discussions",4,!1),this.isDragOverDiscussion=!1},setDropZoneDiscussion(){this.isDragOverDiscussion=!0,this.$refs.dragdropDiscussion.show=!0}},async created(){for(this.$store.state.isConnected=!1,ke.get("/get_lollms_webui_version",{}).then(t=>{t&&(this.version=t.data.version)}).catch(t=>{console.log("Error: Could not get generation status",t)}),this.$nextTick(()=>{we.replace()}),Me.onclose=t=>{console.log("WebSocket connection closed:",t.code,t.reason),this.socketIODisconnected()},Me.onerror=t=>{console.log("WebSocket connection error:",t.code,t.reason),this.socketIODisconnected(),Me.disconnect()},Me.on("connected",this.socketIOConnected),Me.on("disconnected",this.socketIODisconnected),console.log("Added events"),console.log("Waiting to be ready");this.$store.state.ready===!1;)await new Promise(t=>setTimeout(t,100));console.log("Setting title"),this.setPageTitle(),console.log("listing discussions"),await this.list_discussions(),console.log("loading last discussion"),this.loadLastUsedDiscussion(),console.log("Discussions view is ready"),Me.on("notification",this.notify),Me.on("new_message",this.new_message),Me.on("update_message",this.streamMessageContent),Me.on("close_message",this.finalMsgEvent),console.log("Setting events"),Me.onopen=()=>{console.log("WebSocket connection established."),this.currentDiscussion!=null&&(this.setPageTitle(item),localStorage.setItem("selected_discussion",this.currentDiscussion.id),this.load_discussion(item.id,()=>{this.discussionArr.length>1&&(this.currentDiscussion.title===""||this.currentDiscussion.title===null)&&this.changeTitleUsingUserMSG(this.currentDiscussion.id,this.discussionArr[1].content)}))},this.isCreated=!0},mounted(){this.$nextTick(()=>{we.replace()})},async activated(){await this.getPersonalityAvatars(),this.isCreated&&_e(()=>{const t=document.getElementById("messages-list");this.scrollBottom(t)})},components:{Discussion:sg,Message:zg,ChatBox:Ug,WelcomeComponent:qg,Toast:li,DragDrop:_l},watch:{filterTitle(t){t==""&&(this.filterInProgress=!0,this.list=this.tempList,this.filterInProgress=!1)},isCheckbox(t){_e(()=>{we.replace()}),t||(this.isSelectAll=!1)},socketConnected(t){console.log("Websocket connected (watch)",t)},showConfirmation(){_e(()=>{we.replace()})},isSearch(){_e(()=>{we.replace()})}},computed:{client_id(){return Me.id},isReady(){return console.log("verify ready",this.isCreated),this.isCreated},showPanel(){return this.$store.state.ready&&!this.panelCollapsed},socketConnected(){return console.log(" --- > Websocket connected"),this.$store.commit("setIsConnected",!0),!0},socketDisconnected(){return this.$store.commit("setIsConnected",!1),console.log(" --- > Websocket disconnected"),!0},selectedDiscussions(){return _e(()=>{we.replace()}),this.list.filter(t=>t.checkBoxValue==!0)}}},RVe=Object.assign(OVe,{__name:"DiscussionsView",setup(t){return Yr(()=>{aHe()}),ke.defaults.baseURL="/",(e,n)=>(E(),S(Oe,null,[fe(Ss,{name:"fade-and-fly"},{default:$e(()=>[e.isReady?B("",!0):(E(),S("div",cHe,[u("div",uHe,[u("div",dHe,[u("div",hHe,[fHe,u("div",pHe,[u("p",gHe,"Lord of Large Language Models v "+H(e.version),1),mHe])]),_He,bHe,yHe,vHe])])]))]),_:1}),e.isReady?(E(),S("button",{key:0,onClick:n[0]||(n[0]=(...s)=>e.togglePanel&&e.togglePanel(...s)),class:"absolute top-0 left-0 z-50 p-2 m-2 bg-white rounded-full shadow-md bg-bg-light-tone dark:bg-bg-dark-tone hover:bg-primary-light dark:hover:bg-primary"},[ve(u("div",null,xHe,512),[[rt,e.panelCollapsed]]),ve(u("div",null,EHe,512),[[rt,!e.panelCollapsed]])])):B("",!0),fe(Ss,{name:"slide-right"},{default:$e(()=>[e.showPanel?(E(),S("div",CHe,[u("div",{id:"leftPanel",cl