203 lines
991 KiB
JavaScript
Raw Normal View History

(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 El(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 yt(t){if(Te(t)){const e={};for(let n=0;n<t.length;n++){const s=t[n],o=et(s)?Mm(s):yt(s);if(o)for(const r in o)e[r]=o[r]}return e}else{if(et(t))return t;if(Ye(t))return t}}const Am=/;(?![^(]*\))/g,Sm=/:([^]+)/,Tm=/\/\*.*?\*\//gs;function Mm(t){const e={};return t.replace(Tm,"").split(Am).forEach(n=>{if(n){const s=n.split(Sm);s.length>1&&(e[s[0].trim()]=s[1].trim())}}),e}function ke(t){let e="";if(et(t))e=t;else if(Te(t))for(let n=0;n<t.length;n++){const s=ke(t[n]);s&&(e+=s+" ")}else if(Ye(t))for(const n in t)t[n]&&(e+=n+" ");return e.trim()}const Om="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",Rm=El(Om);function Hh(t){return!!t||t===""}function Nm(t,e){if(t.length!==e.length)return!1;let n=!0;for(let s=0;n&&s<t.length;s++)n=ns(t[s],e[s]);return n}function ns(t,e){if(t===e)return!0;let n=Dc(t),s=Dc(e);if(n||s)return n&&s?t.getTime()===e.getTime():!1;if(n=vo(t),s=vo(e),n||s)return t===e;if(n=Te(t),s=Te(e),n||s)return n&&s?Nm(t,e):!1;if(n=Ye(t),s=Ye(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||!ns(t[i],e[i]))return!1}}return String(t)===String(e)}function Cl(t,e){return t.findIndex(n=>ns(n,e))}const z=t=>et(t)?t:t==null?"":Te(t)||Ye(t)&&(t.toString===Kh||!De(t.toString))?JSON.stringify(t,Vh,2):String(t),Vh=(t,e)=>e&&e.__v_isRef?Vh(t,e.value):xs(e)?{[`Map(${e.size})`]:[...e.entries()].reduce((n,[s,o])=>(n[`${s} =>`]=o,n),{})}:Us(e)?{[`Set(${e.size})`]:[...e.values()]}:Ye(e)&&!Te(e)&&!Zh(e)?String(e):e,Je={},vs=[],Ft=()=>{},Dm=()=>!1,Lm=/^on[^a-z]/,Gr=t=>Lm.test(t),Al=t=>t.startsWith("onUpdate:"),it=Object.assign,Sl=(t,e)=>{const n=t.indexOf(e);n>-1&&t.splice(n,1)},Im=Object.prototype.hasOwnProperty,je=(t,e)=>Im.call(t,e),Te=Array.isArray,xs=t=>js(t)==="[object Map]",Us=t=>js(t)==="[object Set]",Dc=t=>js(t)==="[object Date]",Pm=t=>js(t)==="[object RegExp]",De=t=>typeof t=="function",et=t=>typeof t=="string",vo=t=>typeof t=="symbol",Ye=t=>t!==null&&typeof t=="object",Gh=t=>Ye(t)&&De(t.then)&&De(t.catch),Kh=Object.prototype.toString,js=t=>Kh.call(t),Fm=t=>js(t).slice(8,-1),Zh=t=>js(t)==="[object Object]",Tl=t=>et(t)&&t!=="NaN"&&t[0]!=="-"&&""+parseInt(t,10)===t,cr=El(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Kr=t=>{const e=Object.create(null);return n=>e[n]||(e[n]=t(n))},Bm=/-(\w)/g,Yt=Kr(t=>t.replace(Bm,(e,n)=>n?n.toUpperCase():"")),zm=/\B([A-Z])/g,rs=Kr(t=>t.replace(zm,"-$1").toLowerCase()),Zr=Kr(t=>t.charAt(0).toUpperCase()+t.slice(1)),Ai=Kr(t=>t?`on${Zr(t)}`:""),xo=(t,e)=>!Object.is(t,e),ws=(t,e)=>{for(let n=0;n<t.length;n++)t[n](e)},wr=(t,e,n)=>{Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value:n})},kr=t=>{const e=parseFloat(t);return isNaN(e)?t:e},$m=t=>{const e=et(t)?Number(t):NaN;return isNaN(e)?t:e};let Lc;const Um=()=>Lc||(Lc=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});let Nt;class jm{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)
* vuex v4.0.2
* (c) 2021 Evan You
* @license MIT
*/var p0="store";function Ks(t,e){Object.keys(t).forEach(function(n){return e(t[n],n)})}function g0(t){return t!==null&&typeof t=="object"}function m0(t){return t&&typeof t.then=="function"}function _0(t,e){return function(){return t(e)}}function Qf(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 Xf(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;ri(t,n,[],t._modules.root,!0),Kl(t,n,e)}function Kl(t,e,n){var s=t._state;t.getters={},t._makeLocalGettersCache=Object.create(null);var o=t._wrappedGetters,r={};Ks(o,function(i,a){r[a]=_0(i,t),Object.defineProperty(t.getters,a,{get:function(){return r[a]()},enumerable:!0})}),t._state=Vs({data:e}),t.strict&&w0(t),s&&n&&t._withCommit(function(){s.data=null})}function ri(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=Zl(e,n.slice(0,-1)),l=n[n.length-1];t._withCommit(function(){a[l]=s.state})}var d=s.context=b0(t,i,n);s.forEachMutation(function(u,h){var f=i+h;y0(t,f,u,d)}),s.forEachAction(function(u,h){var f=u.root?h:i+h,g=u.handler||u;v0(t,f,g,d)}),s.forEachGetter(function(u,h){var f=i+h;x0(t,f,u,d)}),s.forEachChild(function(u,h){ri(t,e,n.concat(h),u,o)})}function b0(t,e,n){var s=e==="",o={dispatch:s?t.dispatch:function(r,i,a){var l=Mr(r,i,a),d=l.payload,u=l.options,h=l.type;return(!u||!u.root)&&(h=e+h),t.dispatch(h,d)},commit:s?t.commit:function(r,i,a){var l=Mr(r,i,a),d=l.payload,u=l.options,h=l.type;(!u||!u.root)&&(h=e+h),t.commit(h,d,u)}};return Object.defineProperties(o,{getters:{get:s?function(){return t.getters}:function(){return ep(t,e)}},state:{get:function(){return Zl(t.state,n)}}}),o}function ep(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 y0(t,e,n,s){var o=t._mutations[e]||(t._mutations[e]=[]);o.push(function(i){n.call(t,s.state,i)})}function v0(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 m0(a)||(a=Promise.resolve(a)),t._devtoolHook?a.catch(function(l){throw t._devtoolHook.emit("vuex:error",l),l}):a})}function x0(t,e,n,s){t._wrappedGetters[e]||(t._wrappedGetters[e]=function(r){return n(s.state,s.getters,r.state,r.getters)})}function w0(t){Qn(function(){return t._state.data},function(){},{deep:!0,flush:"sync"})}function Zl(t,e){return e.reduce(function(n,s){return n[s]},t)}function Mr(t,e,n){return g0(t)&&t.type&&(n=e,e=t,t=t.type),{type:t,payload:e,options:n}}var k0="vuex bindings",md="vuex:mutations",Ii="vuex:actions",hs="vuex",E0=0;function C0(t,e){f0({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:[k0]},function(n){n.addTimelineLayer({id:md,label:"Vuex Mutations",color:_d}),n.addTimelineLayer({id:Ii,label:"Vuex Actions",color:_d}),n.addInspector({id:hs,label:"Vuex",icon:"storage",treeFilterPlaceholder:"Filter stores..."}),n.on.getInspectorTree(function(s){if(s.app===t&&s.inspectorId===hs)if(s.filter){var o=[];op(o,e._modules.root,s.filter,""),s.rootNodes=o}else s.rootNodes=[sp(e._modules.root,"")]}),n.on.getInspectorState(function(s){if(s.app===t&&s.inspectorId===hs){var o=s.nodeId;ep(e,o),s.state=T0(O0(e._modules,o),o==="root"?e.getters:e._makeLocalGettersCache,o)}}),n.on.editInspectorState(function(s){if(s.app===t&&s.inspectorId===hs){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]&&Cb[n])&&(n==="set-cookie"?e[n]?e[n].push(s):e[n]=[s]:e[n]=e[n]?e[n]+", "+s:s)}),e},kd=Symbol("internals");function no(t){return t&&String(t).trim().toLowerCase()}function pr(t){return t===!1||t==null?t:K.isArray(t)?t.map(pr):String(t)}function Sb(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 Tb=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function Fi(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 Mb(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,n,s)=>n.toUpperCase()+s)}function Ob(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 di{constructor(e){e&&this.set(e)}set(e,n,s){const o=this;function r(a,l,d){const u=no(l);if(!u)throw new Error("header name must be a non-empty string");const h=K.findKey(o,u);(!h||o[h]===void 0||d===!0||d===void 0&&o[h]!==!1)&&(o[h||l]=pr(a))}const i=(a,l)=>K.forEach(a,(d,u)=>r(d,u,l));return K.isPlainObject(e)||e instanceof this.constructor?i(e,n):K.isString(e)&&(e=e.trim())&&!Tb(e)?i(Ab(e),n):e!=null&&r(n,e,s),this}get(e,n){if(e=no(e),e){const s=K.findKey(this,e);if(s){const o=this[s];if(!n)return o;if(n===!0)return Sb(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=no(e),e){const s=K.findKey(this,e);return!!(s&&this[s]!==void 0&&(!n||Fi(this,this[s],s,n)))}return!1}delete(e,n){const s=this;let o=!1;function r(i){if(i=no(i),i){const a=K.findKey(s,i);a&&(!n||Fi(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||Fi(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]=pr(o),delete n[r];return}const a=e?Mb(r):String(r).trim();a!==r&&delete n[r],n[a]=pr(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(`
`)}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[kd]=this[kd]={accessors:{}}).accessors,o=this.prototype;function r(i){const a=no(i);s[a]||(Ob(o,i),s[a]=!0)}return K.isArray(e)?e.forEach(r):r(e),this}}di.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);K.freezeMethods(di.prototype);K.freezeMethods(di);const cn=di;function Bi(t,e){const n=this||Xl,s=e||n,o=cn.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 wp(t){return!!(t&&t.__CANCEL__)}function Fo(t,e,n){qe.call(this,t??"canceled",qe.ERR_CANCELED,e,n),this.name="CanceledError"}K.inherits(Fo,qe,{__CANCEL__:!0});function Rb(t,e,n){const s=n.config.validateStatus;!n.status||!s||s(n.status)?t(n):e(new qe("Request failed with status code "+n.status,[qe.ERR_BAD_REQUEST,qe.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}const Nb=Ht.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 Db(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function Lb(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}function kp(t,e){return t&&!Db(e)?Lb(t,e):e}const Ib=Ht.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 Pb(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function Fb(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 d=Date.now(),u=s[r];i||(i=d),n[o]=l,s[o]=d;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),d-i<e)return;const g=u&&d-u;return g?Math.round(f*1e3/g):void 0}}function Ed(t,e){let n=0;const s=Fb(50,250);return o=>{const r=o.loaded,i=o.lengthComputable?o.total:void 0,a=r-n,l=s(a),d=r<=i;n=r;const u={loaded:r,total:i,progress:i?r/i:void 0,bytes:a,rate:l||void 0,estimated:l&&i&&d?(i-r)/l:void 0,event:o};u[e?"download":"upload"]=!0,t(u)}}const Bb=typeof XMLHttpRequest<"u",zb=Bb&&function(t){return new Promise(function(n,s){let o=t.data;const r=cn.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)&&(Ht.isStandardBrowserEnv||Ht.isStandardBrowserWebWorkerEnv)&&r.setContentType(!1);let d=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 u=kp(t.baseURL,t.url);d.open(t.method.toUpperCase(),yp(u,t.params,t.paramsSerializer),!0),d.timeout=t.timeout;function h(){if(!d)return;const g=cn.from("getAllResponseHeaders"in d&&d.getAllResponseHeaders()),_={data:!i||i==="text"||i==="json"?d.responseText:d.response,status:d.status,statusText:d.statusText,headers:g,config:t,request:d};Rb(function(b){n(b),l()},function(b){s(b),l()
* vue-router v4.1.6
* (c) 2022 Eduardo San Martin Morote
* @license MIT
*/const ms=typeof window<"u";function Gb(t){return t.__esModule||t[Symbol.toStringTag]==="Module"}const Ge=Object.assign;function $i(t,e){const n={};for(const s in e){const o=e[s];n[s]=Bt(o)?o.map(t):t(o)}return n}const ho=()=>{},Bt=Array.isArray,Kb=/\/$/,Zb=t=>t.replace(Kb,"");function Ui(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=Qb(s??e,n),{fullPath:s+(r&&"?")+r+i,path:s,query:o,hash:i}}function Wb(t,e){const n=e.query?t(e.query):"";return e.path+(n&&"?")+n+(e.hash||"")}function Td(t,e){return!e||!t.toLowerCase().startsWith(e.toLowerCase())?t:t.slice(e.length)||"/"}function Yb(t,e,n){const s=e.matched.length-1,o=n.matched.length-1;return s>-1&&s===o&&Ds(e.matched[s],n.matched[o])&&Ap(e.params,n.params)&&t(e.query)===t(n.query)&&e.hash===n.hash}function Ds(t,e){return(t.aliasOf||t)===(e.aliasOf||e)}function Ap(t,e){if(Object.keys(t).length!==Object.keys(e).length)return!1;for(const n in t)if(!Jb(t[n],e[n]))return!1;return!0}function Jb(t,e){return Bt(t)?Md(t,e):Bt(e)?Md(e,t):t===e}function Md(t,e){return Bt(e)?t.length===e.length&&t.every((n,s)=>n===e[s]):t.length===1&&t[0]===e}function Qb(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 Oo;(function(t){t.pop="pop",t.push="push"})(Oo||(Oo={}));var fo;(function(t){t.back="back",t.forward="forward",t.unknown=""})(fo||(fo={}));function Xb(t){if(!t)if(ms){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 ey=/^[^#]+#/;function ty(t,e){return t.replace(ey,"#")+e}function ny(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 ui=()=>({left:window.pageXOffset,top:window.pageYOffset});function sy(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=ny(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 Od(t,e){return(history.state?history.state.position-e:-1)+t}const rl=new Map;function oy(t,e){rl.set(t,e)}function ry(t){const e=rl.get(t);return rl.delete(t),e}let iy=()=>location.protocol+"//"+location.host;function Sp(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),Td(l,"")}return Td(n,t)+s+o}function ay(t,e,n,s){let o=[],r=[],i=null;const a=({state:f})=>{const g=Sp(t,location),m=n.value,_=e.value;let w=0;if(f){if(n.value=g,e.value=f,i&&i===m){i=null;return}w=_?f.position-_.position:0}else s(g);o.forEach(b=>{b(n.value,m,{delta:w,type:Oo.pop,direction:w?w>0?fo.forward:fo.back:fo.unknown})})};function l(){i=n.value}function d(f){o.push(f);const g=()=>{const m=o.indexOf(f);m>-1&&o.splice(m,1)};return r.push(g),g}function u(){const{history:f}=window;f.state&&f.replaceState(Ge({},f.state,{scroll:ui()}),"")}function h(){for(const f of r)f();r=[],window.removeEventListener("popstate",a),window.removeEventListener("beforeunload",u)}return window.addEventListener("popstate",a),window.addEventListener("beforeunload",u),{pauseListeners:l,listen:d,destroy:h}}function Rd(t,e,n,s=!1,o=!1){return{back:t,current:e,forward:n,replaced:s,position:window.history.length,scroll:o?ui():null}}function ly(t){const{history:e,location:n}=window,s={value:Sp(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,d,u){const h=t.indexOf("#"
Copyright (c) 2016 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/(function(){var a=function(){function l(){}l.prototype=Object.create(null);function d(b,p){for(var x=p.length,A=0;A<x;++A)_(b,p[A])}var u={}.hasOwnProperty;function h(b,p){b[p]=!0}function f(b,p){for(var x in p)u.call(p,x)&&(b[x]=!!p[x])}var g=/\s+/;function m(b,p){for(var x=p.split(g),A=x.length,N=0;N<A;++N)b[x[N]]=!0}function _(b,p){if(p){var x=typeof p;x==="string"?m(b,p):Array.isArray(p)?d(b,p):x==="object"?f(b,p):x==="number"&&h(b,p)}}function w(){for(var b=arguments.length,p=Array(b),x=0;x<b;x++)p[x]=arguments[x];var A=new l;d(A,p);var N=[];for(var O in A)A[O]&&N.push(O);return N.join(" ")}return w}();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"),d=o("./node_modules/core-js/internals/to-length.js"),u=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),_=typeof this=="function"?this:Array,w=arguments.length,b=w>1?arguments[1]:void 0,p=b!==void 0,x=0,A=h(m),N,O,L,y;if(p&&(b=r(b,w>2?arguments[2]:void 0,2)),A!=null&&!(_==Array&&l(A)))for(y=A.call(m),O=new _;!(L=y.next()).done;x++)u(O,x,p?a(y,b,[L.value,x],!0):L.value);else for(N=d(m.length),O=new _(N);N>x;x++)u(O,x,p?b(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(d,u,h){var f=r(d),g=i(f.length),m=a(h,g),_;if(l&&u!=u){for(;g>m;)if(_=f[m++],_!=_)return!0}else for(;g>m;m++)if((l||m in f)&&f[m]===u)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(d){return i.call(a,d)};case 2:return function(d,u){return i.call(a,d,u)};case 3:return function(d,u,h){return i.call(a,d,u,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,d){try{return d?a(r(l)[0],l[1]):a(l)}catch(h){var u=i.return;throw u!==void 0&&r(u.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,d={next:function(){return{done:!!l++}},return:function(){a=!0}};d[i]=function(){return this},Array.from(d,function(){throw 2})}catch{}n.exports=function(u,h){if(!h&&!a)return!1;var f=!1;try{var g={};g[i]=function(){return{next:function(){return{done:f=!0}}}},u(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
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),g2=[p2],m2=c("i",{"data-feather":"sun"},null,-1),_2=[m2],b2=c("i",{"data-feather":"moon"},null,-1),y2=[b2],v2=c("body",null,null,-1),x2={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(()=>{ye.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(()=>{qi(()=>Promise.resolve({}),["assets/stackoverflow-dark-7e41bf22.css"])});return}_e(()=>{qi(()=>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}qi(()=>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:$p}},w2=Object.assign(x2,{setup(t){return(e,n)=>(v(),E(Ae,null,[c("header",e2,[c("nav",t2,[le(dt(rn),{to:{name:"discussions"}},{default:Ne(()=>[n2]),_:1}),c("div",s2,[e.isConnected?(v(),E("div",o2,i2)):R("",!0),e.isConnected?R("",!0):(v(),E("div",a2,c2)),d2,c("a",u2,[c("div",h2,[(v(),E("svg",f2,g2))])]),c("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())},_2),c("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())},y2)])]),le($p)]),v2],64))}}),k2={class:"flex flex-col h-screen font-sans bg-bg-light text-slate-950 dark:bg-bg-dark dark:text-slate-50 overflow-y-scroll w-full dark:bg-bg-dark 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-panel dark:hover:scrollbar-thumb-primary active:scrollbar-thumb-secondary"},E2={class:"flex overflow-hidden flex-grow"},C2={__name:"App",setup(t){return(e,n)=>(v(),E("div",k2,[le(w2),c("div",E2,[le(dt(Fp),null,{default:Ne(({Component:s})=>[(v(),Xe(B_,null,[(v(),Xe(Z_(s)))],1024))]),_:1})])]))}},Jt=Object.create(null);Jt.open="0";Jt.close="1";Jt.ping="2";Jt.pong="3";Jt.message="4";Jt.upgrade="5";Jt.noop="6";const _r=Object.create(null);Object.keys(Jt).forEach(t=>{_r[Jt[t]]=t});const A2={type:"error",data:"parser error"},S2=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",T2=typeof ArrayBuffer=="function",M2=t=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(t):t&&t.buffer instanceof ArrayBuffer,Up=({type:t,data:e},n,s)=>S2&&e instanceof Blob?n?s(e):Vd(e,s):T2&&(e instanceof ArrayBuffer||M2(e))?n?s(e):Vd(new Blob([e]),s):s(Jt[t]+(e||"")),Vd=(t,e)=>{const n=new FileReader;return n.onload=function(){const s=n.result.split(",")[1];e("b"+(s||""))},n.readAsDataURL(t)},Gd="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",lo=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let t=0;
`,uL="∄",hL="∄",fL="𝔑",pL="𝔫",gL="≧̸",mL="≱",_L="≱",bL="≧̸",yL="⩾̸",vL="⩾̸",xL="⋙̸",wL="≵",kL="≫⃒",EL="≯",CL="≯",AL="≫̸",SL="↮",TL="⇎",ML="⫲",OL="∋",RL="⋼",NL="⋺",DL="∋",LL="Њ",IL="њ",PL="↚",FL="⇍",BL="‥",zL="≦̸",$L="≰",UL="↚",jL="⇍",qL="↮",HL="⇎",VL="≰",GL="≦̸",KL="⩽̸",ZL="⩽̸",WL="≮",YL="⋘̸",JL="≴",QL="≪⃒",XL="≮",eI="⋪",tI="⋬",nI="≪̸",sI="∤",oI="",rI=" ",iI="𝕟",aI="",lI="⫬",cI="¬",dI="≢",uI="≭",hI="∦",fI="∉",pI="≠",gI="≂̸",mI="∄",_I="≯",bI="≱",yI="≧̸",vI="≫̸",xI="≹",wI="⩾̸",kI="≵",EI="≎̸",CI="≏̸",AI="∉",SI="⋵̸",TI="⋹̸",MI="∉",OI="⋷",RI="⋶",NI="⧏̸",DI="⋪",LI="⋬",II="≮",PI="≰",FI="≸",BI="≪̸",zI="⩽̸",$I="≴",UI="⪢̸",jI="⪡̸",qI="∌",HI="∌",VI="⋾",GI="⋽",KI="⊀",ZI="⪯̸",WI="⋠",YI="∌",JI="⧐̸",QI="⋫",XI="⋭",eP="⊏̸",tP="⋢",nP="⊐̸",sP="⋣",oP="⊂⃒",rP="⊈",iP="⊁",aP="⪰̸",lP="⋡",cP="≿̸",dP="⊃⃒",uP="⊉",hP="≁",fP="≄",pP="≇",gP="≉",mP="∤",_P="∦",bP="∦",yP="⫽⃥",vP="∂̸",xP="⨔",wP="⊀",kP="⋠",EP="⊀",CP="⪯̸",AP="⪯̸",SP="⤳̸",TP="↛",MP="⇏",OP="↝̸",RP="↛",NP="⇏",DP="⋫",LP="⋭",IP="⊁",PP="⋡",FP="⪰̸",BP="𝒩",zP="𝓃",$P="∤",UP="∦",jP="≁",qP="≄",HP="≄",VP="∤",GP="∦",KP="⋢",ZP="⋣",WP="⊄",YP="⫅̸",JP="⊈",QP="⊂⃒",XP="⊈",eF="⫅̸",tF="⊁",nF="⪰̸",sF="⊅",oF="⫆̸",rF="⊉",iF="⊃⃒",aF="⊉",lF="⫆̸",cF="≹",dF="Ñ",uF="ñ",hF="≸",fF="⋪",pF="⋬",gF="⋫",mF="⋭",_F="Ν",bF="ν",yF="#",vF="№",xF="",wF="≍⃒",kF="⊬",EF="⊭",CF="⊮",AF="⊯",SF="≥⃒",TF=">⃒",MF="⤄",OF="⧞",RF="⤂",NF="≤⃒",DF="<⃒",LF="⊴⃒",IF="⤃",PF="⊵⃒",FF="∼⃒",BF="⤣",zF="↖",$F="⇖",UF="↖",jF="⤧",qF="Ó",HF="ó",VF="⊛",GF="Ô",KF="ô",ZF="⊚",WF="О",YF="о",JF="⊝",QF="Ő",XF="ő",eB="⨸",tB="⊙",nB="⦼",sB="Œ",oB="œ",rB="⦿",iB="𝔒",aB="𝔬",lB="˛",cB="Ò",dB="ò",uB="⧁",hB="⦵",fB="Ω",pB="∮",gB="↺",mB="⦾",_B="⦻",bB="‾",yB="⧀",vB="Ō",xB="ō",wB="Ω",kB="ω",EB="Ο",CB="ο",AB="⦶",SB="⊖",TB="𝕆",MB="𝕠",OB="⦷",RB="“",NB="",DB="⦹",LB="⊕",IB="↻",PB="⩔",FB="",BB="⩝",zB="",$B="",UB="ª",jB="º",qB="⊶",HB="⩖",VB="⩗",GB="⩛",KB="Ⓢ",ZB="𝒪",WB="",YB="Ø",JB="ø",QB="⊘",XB="Õ",ez="õ",tz="⨶",nz="⨷",sz="⊗",oz="Ö",rz="ö",iz="⌽",az="‾",lz="⏞",cz="⎴",dz="⏜",uz="¶",hz="∥",fz="∥",pz="⫳",gz="⫽",mz="∂",_z="∂",bz="П",yz="п",vz="%",xz=".",wz="‰",kz="⊥",Ez="‱",Cz="𝔓",Az="𝔭",Sz="Φ",Tz="φ",Mz="ϕ",Oz="",Rz="☎",Nz="Π",Dz="π",Lz="⋔",Iz="ϖ",Pz="ℏ",Fz="",Bz="ℏ",zz="⨣",$z="⊞",Uz="⨢",jz="+",qz="∔",Hz="⨥",Vz="⩲",Gz="±",Kz="±",Zz="⨦",Wz="⨧",Yz="±",Jz="",Qz="⨕",Xz="𝕡",e$="",t$="£",n$="⪷",s$="⪻",o$="≺",r$="≼",i$="⪷",a$="≺",l$="≼",c$="≺",d$="⪯",u$="≼",h$="≾",f$="⪯",p$="⪹",g$="⪵",m$="⋨",_$="⪯",b$="⪳",y$="≾",v$="",x$="″",w$="",k$="⪹",E$="⪵",C$="⋨",A$="∏",S$="∏",T$="⌮",M$="⌒",O$="⌓",R$="∝",N$="∝",D$="∷",L$="∝",I$="≾",P$="⊰",F$="𝒫",B$="𝓅",z$="Ψ",$$="ψ",U$="",j$="𝔔",q$="𝔮",H$="⨌",V$="𝕢",G$="",K$="⁗",Z$="𝒬",W$="𝓆",Y$="",J$="⨖",Q$="?",X$="≟",eU='"',tU='"',nU="⇛",sU="∽̱",oU="Ŕ",rU="ŕ",iU="√",aU="⦳",lU="⟩",cU="⟫",dU="⦒",uU="⦥",hU="⟩",fU="»",pU="⥵",gU="⇥",mU="⤠",_U="⤳",bU="→",yU="↠",vU="⇒",xU="⤞",wU="↪",kU="↬",EU="⥅",CU="⥴",AU="⤖",SU="↣",TU="↝",MU="⤚",OU="⤜",RU="",NU="",DU="⤍",LU="⤏",IU="⤐",PU="",FU="}",BU="]",zU="⦌",$U="⦎",UU="⦐",jU="Ř",qU="ř",HU="Ŗ",VU="ŗ",GU="⌉",KU="}",ZU="Р",WU="р",YU="⤷",JU="⥩",QU="”",XU="”",ej="↳",tj="",nj="",sj="",oj="",rj="",ij="▭",aj="®",lj="®",cj="∋",dj="⇋",uj="⥯",hj="⥽",fj="⌋",pj="𝔯",gj="",mj="⥤",_j="⇁",bj="⇀",yj="⥬",vj="Ρ",xj="ρ",wj="ϱ",kj="⟩",Ej="⇥",Cj="→",Aj="→
`," "],dX=["{","}","|","\\","^","`"].concat(cX),uX=["'"].concat(dX),tu=["%","/","?",";","#"].concat(uX),nu=["/","?","#"],hX=255,su=/^[+a-z0-9A-Z_-]{0,63}$/,fX=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,ou={javascript:!0,"javascript:":!0},ru={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function pX(t,e){if(t&&t instanceof Nr)return t;var n=new Nr;return n.parse(t,e),n}Nr.prototype.parse=function(t,e){var n,s,o,r,i,a=t;if(a=a.trim(),!e&&t.split("#").length===1){var l=lX.exec(a);if(l)return this.pathname=l[1],l[2]&&(this.search=l[2]),this}var d=iX.exec(a);if(d&&(d=d[0],o=d.toLowerCase(),this.protocol=d,a=a.substr(d.length)),(e||d||a.match(/^\/\/[^@\/]+@[^@\/]+/))&&(i=a.substr(0,2)==="//",i&&!(d&&ou[d])&&(a=a.substr(2),this.slashes=!0)),!ou[d]&&(i||d&&!ru[d])){var u=-1;for(n=0;n<nu.length;n++)r=a.indexOf(nu[n]),r!==-1&&(u===-1||r<u)&&(u=r);var h,f;for(u===-1?f=a.lastIndexOf("@"):f=a.lastIndexOf("@",u),f!==-1&&(h=a.slice(0,f),a=a.slice(f+1),this.auth=h),u=-1,n=0;n<tu.length;n++)r=a.indexOf(tu[n]),r!==-1&&(u===-1||r<u)&&(u=r);u===-1&&(u=a.length),a[u-1]===":"&&u--;var g=a.slice(0,u);a=a.slice(u),this.parseHost(g),this.hostname=this.hostname||"";var m=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!m){var _=this.hostname.split(/\./);for(n=0,s=_.length;n<s;n++){var w=_[n];if(w&&!w.match(su)){for(var b="",p=0,x=w.length;p<x;p++)w.charCodeAt(p)>127?b+="x":b+=w[p];if(!b.match(su)){var A=_.slice(0,n),N=_.slice(n+1),O=w.match(fX);O&&(A.push(O[1]),N.unshift(O[2])),N.length&&(a=N.join(".")+a),this.hostname=A.join(".");break}}}}this.hostname.length>hX&&(this.hostname=""),m&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}var L=a.indexOf("#");L!==-1&&(this.hash=a.substr(L),a=a.slice(0,L));var y=a.indexOf("?");return y!==-1&&(this.search=a.substr(y),a=a.slice(0,y)),a&&(this.pathname=a),ru[o]&&this.hostname&&!this.pathname&&(this.pathname=""),this};Nr.prototype.parseHost=function(t){var e=aX.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 gX=pX;Js.encode=nX;Js.decode=oX;Js.format=rX;Js.parse=gX;var Un={},Hi,iu;function og(){return iu||(iu=1,Hi=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/),Hi}var Vi,au;function rg(){return au||(au=1,Vi=/[\0-\x1F\x7F-\x9F]/),Vi}var Gi,lu;function mX(){return lu||(lu=1,Gi=/[\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]/),Gi}var Ki,cu;function ig(){return cu||(cu=1,Ki=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/),Ki}var du;function _X(){return du||(du=1,Un.Any=og(),Un.Cc=rg(),Un.Cf=mX(),Un.P=ac,Un.Z=ig()),Un}(function(t){function e(P){return Object.prototype.toString.call(P)}function n(P){return e(P)==="[object String]"}var s=Object.prototype.hasOwnProperty;function o(P,ue){return s.call(P,ue)}function r(P){var ue=Array.prototype.slice.call(arguments,1);return ue.forEach(function(Y){if(Y){if(typeof Y!="object")throw new TypeError(Y+"must be object");Object.keys(Y).forEach(function(T){P[T]=Y[T]})}}),P}function i(P,ue,Y){return[].concat(P.slice(0,ue),Y,P.slice(ue+1))}function a(P){return!(P>=55296&&P<=57343||P>=64976&&P<=65007||(P&65535)===65535||(P&65535)===65534||P>=0&&P<=8||P===11||P>=14&&P<=31||P>=127&&P<=159||P>1114111)}function l(P){if(P>65535){P-=65536;var ue=55296+(P>>10),Y=56320+(P&1023);return String.fromCharCode(ue,Y)}return String.fromCharCode(P)}var d=/\\([!"#$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~])/g,u=/&([a-z#][a-z0-9]{1,31});/gi,h=new RegExp(d.source+"|"+u.source,"gi"),f=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))/i,g=sg;function m(P,ue){var Y=0;return o(g,ue)?g[ue]:ue.charCodeAt(0)===35&&f.test(ue)&&(Y=ue[1].toLowerCase()==="x"?parseInt(ue.slice(2),16):parseInt(ue.slice(1),10),a(Y))?l(Y):P}function _(P){return P.indexOf("\\")<0?P:P.replace(d,"$1")}function w(P){return P.indexOf("\\")<0&&P.indexOf("&")<0?
`};Xt.fence=function(t,e,n,s,o){var r=t[e],i=r.info?kX(r.info).trim():"",a="",l="",d,u,h,f,g;return i&&(h=i.split(/(\s+)/g),a=h[0],l=h.slice(2).join("")),n.highlight?d=n.highlight(r.content,a,l)||ss(r.content):d=ss(r.content),d.indexOf("<pre")===0?d+`
`:i?(u=r.attrIndex("class"),f=r.attrs?r.attrs.slice():[],u<0?f.push(["class",n.langPrefix+a]):(f[u]=f[u].slice(),f[u][1]+=" "+n.langPrefix+a),g={attrs:f},"<pre><code"+o.renderAttrs(g)+">"+d+`</code></pre>
`):"<pre><code"+o.renderAttrs(r)+">"+d+`</code></pre>
`};Xt.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)};Xt.hardbreak=function(t,e,n){return n.xhtmlOut?`<br />
`:`<br>
`};Xt.softbreak=function(t,e,n){return n.breaks?n.xhtmlOut?`<br />
`:`<br>
`:`
`};Xt.text=function(t,e){return ss(t[e].content)};Xt.html_block=function(t,e){return t[e].content};Xt.html_inline=function(t,e){return t[e].content};function Qs(){this.rules=wX({},Xt)}Qs.prototype.renderAttrs=function(e){var n,s,o;if(!e.attrs)return"";for(o="",n=0,s=e.attrs.length;n<s;n++)o+=" "+ss(e.attrs[n][0])+'="'+ss(e.attrs[n][1])+'"';return o};Qs.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+=`
`),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?`>
`:">",r)};Qs.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};Qs.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+=`
`);return s};Qs.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 EX=Qs;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 lc=$t,CX=/\r\n?|\n/g,AX=/\0/g,SX=function(e){var n;n=e.src.replace(CX,`
`),n=n.replace(AX,"<22>"),e.src=n},TX=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)},MX=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)},OX=Ve.arrayReplaceAt;function RX(t){return/^<a[>\s]/i.test(t)}function NX(t){return/^<\/a\s*>/i.test(t)}var DX=function(e){var n,s,o,r,i,a,l,d,u,h,f,g,m,_,w,b,p=e.tokens,x;if(e.md.options.linkify){for(s=0,o=p.length;s<o;s++)if(!(p[s].type!=="inline"||!e.md.linkify.pretest(p[s].content)))for(r=p[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"&&(RX(a.content)&&m>0&&m--,NX(a.content)&&m++),!(m>0)&&a.type==="text"&&e.md.linkify.test(a.content)){for(u=a.content,x=e.md.linkify.match(u),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)),d=0;d<x.length;d++)_=x[d].url,w=e.md.normalizeLink(_),e.md.validateLink(w)&&(b=x[d].text,x[d].schema?x[d].schema==="mailto:"&&!/^mailto:/i.test(b)?b=e.md.normalizeLinkText("mailto:"+b).replace(/^mailto:/,""):b=e.md.normalizeLinkText(b):b=e.md.normalizeLinkText("http://"+b).replace(/^http:\/\//,""),h=x[d].index,h>f&&(i=new e.Token("text","",0),i.content=u.slice(f,h),i.level=g,l.push(i)),i=new e.Token("link_open","a",1),i.attrs=[["href",w]],i.level=g++,i.markup="linkify",i.info="auto",l.push(i),i=new e.Token("text","",0),i.content=b,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[d].lastIndex);f<u.length&&(i=new e.Token("text","",0),i.content=u.slice(f),i.level=g,l.push(i)),p[s].children=r=OX(r,n,l)}}}},ag=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,LX=/\((c|tm|r)\)/i,IX=/\((c|tm|r)\)/ig,PX={c:"©",r:"®",tm:"™"};function FX(t,e){return PX[e.toLowerCase()]}function BX(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(IX,FX)),n.type==="link_open"&&n.info==="auto"&&s--,n.type==="link_close"&&n.info==="auto"&&s++}function zX(t){var e,n,s=0;for(e=t.length-1;e>=0;e--)n=t[e],n.type==="text"&&!s&&ag.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 $X=function(e){var n;if(e.md.options.typographer)for(n=e.tokens.length-1;n>=0;n--)e.tokens[n].type==="inline"&&(LX.test(e.tokens[n].content)&&BX(e.tokens[n].children),ag.test(e.tokens[n].content)&&zX(e.tokens[n].children))},hu=Ve.isWhiteSpace,fu=Ve.isPunctChar,pu=Ve.isMdAsciiPunct,UX=/['"]/,gu=/['"]/g,mu="";function Xo(t,e,n){return t.slice(0,e)+n+t.slice(e+1)}function jX(t,e){var n,s,o,r,i,a,l,d,u,h,f,g,m,_,w,b,p,x,A,N,O;for(A=[],n=0;n<t.length;n++){for(s=t[n],l=t[n].level,p=A.length-1;p>=0&&!(A[p].level<=l);p--);if(A.length=p+1,s.type==="text"){o=s.content,i=0,a=o.length;e:for(;i<a&&(gu.lastIndex=i,r=gu.exec(o),!!r);){if(w=b=!0,i=r.index+1,x=r[0]==="'",u=32,r.index-1>=0)u=o.charCodeAt(r.index-1);else for(p=n-1;p>=0&&!(t[p].type==="softbreak"||t[p].type==="hardbreak");p--)if(t[p].content){u=t[p].content.charCodeAt(t[p].content.length-1);break}if(h=32,i<a)h=o.charCodeAt(i);else for(p=n+1;p<t.length&&!(t[p].type==="softbreak"||t[p].type==="hardbreak");p++)if(t[p].content){h=t[p].content.charCodeAt(0);break}if(f=pu(u)||fu(String.fromCharCode(u)),g=pu(h)||fu(String.fromCharCode(h)),m=hu(u),_=hu(h),_?w=!1:g&&(m||f||(w=!1)),m?b=!1:f&&(_||g||(b=!1)),h===34&&r[0]==='"'&&u>=48&&u<=57&&(b=w=!1),w&&b&&(w=f,b=g),!w&&!b){x&&(s.content=Xo(s.content,r.index,mu));continue}if(b){for(p=A.length-1;p>=0&&(d=A[p],!(A[p].level<l));p--)if(d.single===x&&A[p].level===l){d=A[p],x?(N=e.md.options.quotes[2],O=e.md.options.quotes[3]):(N=e.md.options.quote
`,i.map=[n,e.line],!0},JX=function(e,n,s,o){var r,i,a,l,d,u,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)||(d=g,g=e.skipChars(g,r),i=g-d,i<3)||(h=e.src.slice(d,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=d=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-d<i)&&(g=e.skipSpaces(g),!(g<m)))){f=!0;break}return i=e.sCount[n],e.line=l+(f?1:0),u=e.push("fence","code",0),u.info=a,u.content=e.getLines(n+1,l,i,!0),u.markup=h,u.map=[n,e.line],!0},bu=Ve.isSpace,QX=function(e,n,s,o){var r,i,a,l,d,u,h,f,g,m,_,w,b,p,x,A,N,O,L,y,C=e.lineMax,M=e.bMarks[n]+e.tShift[n],I=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<I&&(i=e.src.charCodeAt(M),bu(i));){i===9?g+=4-(g+e.bsCount[n]+(r?1:0))%4:g++;M++}for(_=[e.bsCount[n]],e.bsCount[n]=e.sCount[n]+1+(A?1:0),u=M>=I,p=[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"),b=e.parentType,e.parentType="blockquote",f=n+1;f<s&&(y=e.sCount[f]<e.blkIndent,M=e.bMarks[f]+e.tShift[f],I=e.eMarks[f],!(M>=I));f++){if(e.src.charCodeAt(M++)===62&&!y){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<I&&(i=e.src.charCodeAt(M),bu(i));){i===9?g+=4-(g+e.bsCount[f]+(r?1:0))%4:g++;M++}u=M>=I,_.push(e.bsCount[f]),e.bsCount[f]=e.sCount[f]+1+(A?1:0),p.push(e.sCount[f]),e.sCount[f]=g-l,x.push(e.tShift[f]),e.tShift[f]=M-e.bMarks[f];continue}if(u)break;for(N=!1,a=0,d=O.length;a<d;a++)if(O[a](e,f,s,!0)){N=!0;break}if(N){e.lineMax=f,e.blkIndent!==0&&(m.push(e.bMarks[f]),_.push(e.bsCount[f]),x.push(e.tShift[f]),p.push(e.sCount[f]),e.sCount[f]-=e.blkIndent);break}m.push(e.bMarks[f]),_.push(e.bsCount[f]),x.push(e.tShift[f]),p.push(e.sCount[f]),e.sCount[f]=-1}for(w=e.blkIndent,e.blkIndent=0,L=e.push("blockquote_open","blockquote",1),L.markup=">",L.map=h=[n,0],e.md.block.tokenize(e,n,f),L=e.push("blockquote_close","blockquote",-1),L.markup=">",e.lineMax=C,e.parentType=b,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]=p[a],e.bsCount[a+n]=_[a];return e.blkIndent=w,!0},XX=Ve.isSpace,eee=function(e,n,s,o){var r,i,a,l,d=e.bMarks[n]+e.tShift[n],u=e.eMarks[n];if(e.sCount[n]-e.blkIndent>=4||(r=e.src.charCodeAt(d++),r!==42&&r!==45&&r!==95))return!1;for(i=1;d<u;){if(a=e.src.charCodeAt(d++),a!==r&&!XX(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)},cg=Ve.isSpace;function yu(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),!cg(r))?-1:s}function vu(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),!cg(n))?-1:o}function tee(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 nee=function(e,n,s,o){var r,i,a,l,d,u,h,f,g,m,_,w,b,p,x,A,N,O,L,y,C,M,I,B,X,P,ue,Y,T=!1,H=!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),(I=vu(e,n))>=0){if(h=!0,X=e.bMarks[n]+e.tShift[n],b=Number(e.src.slice(X,I-1)),T&&b!==1)return!1}else if((I=yu(e,n))>=0)h=!1;else return!1;if(T&&e.skipSpaces(I)>=e.eMar
`})),s.tokens.splice(o+3+u.length+1,0,Object.assign(new s.Token("html_block","",0),{content:e.wrapper[1]+`
`})))});function Bu(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 bs(t,e){e=Object.assign({},bs.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 d=e.getTokensText(r[a+1].children),u=l.attrGet("id");u=u==null?Bu(e.slugify(d),o,!1,e.uniqueSlugStartIndex):Bu(u,o,!0,e.uniqueSlugStartIndex),l.attrSet("id",u),e.tabIndex!==!1&&l.attrSet("tabindex",""+e.tabIndex),typeof e.permalink=="function"?e.permalink(u,e,n,a):(e.permalink||e.renderPermalink&&e.renderPermalink!==gl)&&e.renderPermalink(u,e,n,a),a=r.indexOf(l),e.callback&&e.callback(l,{slug:u,title:d})}}})}Object.assign(Fu.defaults,{style:"visually-hidden",space:!0,placement:"after",wrapper:null}),bs.permalink={__proto__:null,legacy:gl,renderHref:Eg,renderAttrs:Cg,makePermalink:$o,linkInsideHeader:wi,ariaHidden:qn,headerLink:Ag,linkAfterHeader:Fu},bs.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:gl,permalinkClass:qn.defaults.class,permalinkSpace:qn.defaults.space,permalinkSymbol:"¶",permalinkBefore:qn.defaults.placement==="before",permalinkHref:qn.defaults.renderHref,permalinkAttrs:qn.defaults.renderAttrs},bs.default=bs;var Y7e=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 d=o.tokens[i-1];d.type="figure_open",d.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 u;if(n.link==!0&&l.children.length===1&&(u=l.children[0],l.children.unshift(new o.Token("link_open","a",1)),l.children[0].attrPush(["href",u.attrGet("src")]),l.children.push(new o.Token("link_close","a",-1))),u=l.children.length===1?l.children[0]:l.children[1],n.figcaption==!0&&u.children&&u.children.length&&(l.children.push(new o.Token("figcaption_open","figcaption",1)),l.children.splice(l.children.length,0,...u.children),l.children.push(new o.Token("figcaption_close","figcaption",-1)),u.children.length=0),n.copyAttrs&&u.attrs){const h=n.copyAttrs===!0?"":n.copyAttrs;d.attrs=u.attrs.filter(([f,g])=>f.match(h))}n.tabindex==!0&&(o.tokens[i-1].attrPush(["tabindex",r]),r++),n.lazyLoading==!0&&u.attrPush(["loading","lazy"])}}}e.core.ruler.before("linkify","implicit_figures",s)};const J7e=cs(Y7e);function Sg(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)&&Sg(n)}),t}class zu{constructor(e){e.data===void 0&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function Tg(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function Mn(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 Q7e="</span>",$u=t=>!!t.scope,X7e=(t,{prefix:
https://github.com/highlightjs/highlight.js/issues/2277`),be=T,we=H),G===void 0&&(G=!0);const ne={code:we,language:be};ue("before:highlight",ne);const Ee=ne.result?ne.result:h(ne.language,ne.code,G);return Ee.code=ne.code,ue("after:highlight",Ee),Ee}function h(T,H,G,we){const be=Object.create(null);function ne(W,ie){return W.keywords[ie]}function Ee(){if(!j.keywords){q.addText(J);return}let W=0;j.keywordPatternRe.lastIndex=0;let ie=j.keywordPatternRe.exec(J),me="";for(;ie;){me+=J.substring(W,ie.index);const Oe=U.case_insensitive?ie[0].toLowerCase():ie[0],$e=ne(j,Oe);if($e){const[Ze,Fe]=$e;if(q.addText(me),me="",be[Oe]=(be[Oe]||0)+1,be[Oe]<=qAe&&(de+=Fe),Ze.startsWith("_"))me+=ie[0];else{const nt=U.classNameAliases[Ze]||Ze;ee(ie[0],nt)}}else me+=ie[0];W=j.keywordPatternRe.lastIndex,ie=j.keywordPatternRe.exec(J)}me+=J.substring(W),q.addText(me)}function Me(){if(J==="")return;let W=null;if(typeof j.subLanguage=="string"){if(!e[j.subLanguage]){q.addText(J);return}W=h(j.subLanguage,J,!0,re[j.subLanguage]),re[j.subLanguage]=W._top}else W=g(J,j.subLanguage.length?j.subLanguage:null);j.relevance>0&&(de+=W.relevance),q.__addSublanguage(W._emitter,W.language)}function D(){j.subLanguage!=null?Me():Ee(),J=""}function ee(W,ie){W!==""&&(q.startScope(ie),q.addText(W),q.endScope())}function V(W,ie){let me=1;const Oe=ie.length-1;for(;me<=Oe;){if(!W._emit[me]){me++;continue}const $e=U.classNameAliases[W[me]]||W[me],Ze=ie[me];$e?ee(Ze,$e):(J=Ze,Ee(),J=""),me++}}function se(W,ie){return W.scope&&typeof W.scope=="string"&&q.openNode(U.classNameAliases[W.scope]||W.scope),W.beginScope&&(W.beginScope._wrap?(ee(J,U.classNameAliases[W.beginScope._wrap]||W.beginScope._wrap),J=""):W.beginScope._multi&&(V(W.beginScope,ie),J="")),j=Object.create(W,{parent:{value:j}}),j}function te(W,ie,me){let Oe=rAe(W.endRe,me);if(Oe){if(W["on:end"]){const $e=new zu(W);W["on:end"](ie,$e),$e.isMatchIgnored&&(Oe=!1)}if(Oe){for(;W.endsParent&&W.parent;)W=W.parent;return W}}if(W.endsWithParent)return te(W.parent,ie,me)}function ge(W){return j.matcher.regexIndex===0?(J+=W[0],1):(Se=!0,0)}function he(W){const ie=W[0],me=W.rule,Oe=new zu(me),$e=[me.__beforeBegin,me["on:begin"]];for(const Ze of $e)if(Ze&&(Ze(W,Oe),Oe.isMatchIgnored))return ge(ie);return me.skip?J+=ie:(me.excludeBegin&&(J+=ie),D(),!me.returnBegin&&!me.excludeBegin&&(J=ie)),se(me,W),me.returnBegin?0:ie.length}function k(W){const ie=W[0],me=H.substring(W.index),Oe=te(j,W,me);if(!Oe)return Vu;const $e=j;j.endScope&&j.endScope._wrap?(D(),ee(ie,j.endScope._wrap)):j.endScope&&j.endScope._multi?(D(),V(j.endScope,W)):$e.skip?J+=ie:($e.returnEnd||$e.excludeEnd||(J+=ie),D(),$e.excludeEnd&&(J=ie));do j.scope&&q.closeNode(),!j.skip&&!j.subLanguage&&(de+=j.relevance),j=j.parent;while(j!==Oe.parent);return Oe.starts&&se(Oe.starts,W),$e.returnEnd?0:ie.length}function S(){const W=[];for(let ie=j;ie!==U;ie=ie.parent)ie.scope&&W.unshift(ie.scope);W.forEach(ie=>q.openNode(ie))}let F={};function $(W,ie){const me=ie&&ie[0];if(J+=W,me==null)return D(),0;if(F.type==="begin"&&ie.type==="end"&&F.index===ie.index&&me===""){if(J+=H.slice(ie.index,ie.index+1),!o){const Oe=new Error(`0 width match regex (${T})`);throw Oe.languageName=T,Oe.badRule=F.rule,Oe}return 1}if(F=ie,ie.type==="begin")return he(ie);if(ie.type==="illegal"&&!G){const Oe=new Error('Illegal lexeme "'+me+'" for mode "'+(j.scope||"<unnamed>")+'"');throw Oe.mode=j,Oe}else if(ie.type==="end"){const Oe=k(ie);if(Oe!==Vu)return Oe}if(ie.type==="illegal"&&me==="")return 1;if(fe>1e5&&fe>ie.index*3)throw new Error("potential infinite loop, way more iterations than matches");return J+=me,me.length}const U=C(T);if(!U)throw es(r.replace("{}",T)),new Error('Unknown language: "'+T+'"');const oe=zAe(U);let ce="",j=we||oe;const re={},q=new a.__emitter(a);S();let J="",de=0,pe=0,fe=0,Se=!1;try{if(U.__emitTokens)U.__emitTokens(H,q);else{for(j.matcher.considerAll();;){fe++,Se?Se=!1:j.matcher.considerAll(),j.matcher.lastIndex=pe;const W=j.matcher.exec(H);if(!W)break;const ie=H.substring(pe,W.index),me=$(ie,W);pe=W.index+me}$(H.substring(pe))}return q.finalize(),ce=q.toHTML(),{language:T,v
`},m]}}return va=o,va}var xa,lh;function aSe(){if(lh)return xa;lh=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
]`,m={scope:"string",variants:[u,d,h,f]},_={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},w=["false","null","true"],b=["__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"],p=["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:b,literal:(P=>{const ue=[];return P.forEach(Y=>{ue.push(Y),Y.toLowerCase()===Y?ue.push(Y.toUpperCase()):ue.push(Y.toLowerCase())}),ue})(w),built_in:p},N=P=>P.map(ue=>ue.replace(/\|\d+$/,"")),O={variants:[{match:[/new/,n.concat(g,"+"),n.concat("(?!",N(p).join("\\b|"),"\\b)"),r],scope:{1:"keyword",4:"title.class"}}]},L=n.concat(o,"\\b(?!\\()"),y={variants:[{match:[n.concat(/::/,n.lookahead(/(?!class\b)/)),L],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[r,n.concat(/::/,n.lookahead(/(?!class\b)/)),L],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"}}]},C={scope:"attr",match:n.concat(o,n.lookahead(":"),n.lookahead(/(?!::)/))},M={relevance:0,begin:/\(/,end:/\)/,keywords:A,contains:[C,i,y,e.C_BLOCK_COMMENT_MODE,m,_,O]},I={relevance:0,match:[/\b/,n.concat("(?!fn\\b|function\\b|",N(b).join("\\b|"),"|",N(p).join("\\b|"),"\\b)"),o,n.concat(g,"*"),n.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[M]};M.contains.push(I);const B=[C,y,e.C_BLOCK_COMMENT_MODE,m,_,O],X={begin:n.concat(/#\[\s*/,r),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:w,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:w,keyword:["new","array"]},contains:["self",...B]},
{.a} softbreak then curly in start`,tests:[{shift:0,type:"inline",children:[{position:-2,type:"softbreak"},{position:-1,type:"text",content:Pe.hasDelimiters("only",t)}]}],transform:(n,s,o)=>{const r=n[s].children[o],i=Pe.getAttrs(r.content,0,t);let a=s+1;for(;n[a+1]&&n[a+1].nesting===-1;)a++;const l=Pe.getMatchingOpeningToken(n,a);Pe.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=Pe.getAttrs(r,i,t);Pe.addAttrs(a,o),o.markup=r,n.splice(s+1,2)}},{name:"end of block",tests:[{shift:0,type:"inline",children:[{position:-1,content:Pe.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=Pe.getAttrs(i,i.lastIndexOf(t.leftDelimiter),t);let l=s+1;for(;n[l+1]&&n[l+1].nesting===-1;)l++;const d=Pe.getMatchingOpeningToken(n,l);Pe.addAttrs(a,d);const u=i.slice(0,i.lastIndexOf(t.leftDelimiter));r.content=Th(u)!==" "?u:u.slice(0,-1)}}]};function Th(t){return t.slice(-1)[0]}const DSe=NSe,LSe={leftDelimiter:"{",rightDelimiter:"}",allowedAttributes:[]};var ISe=function(e,n){let s=Object.assign({},LSe);s=Object.assign(s,n);const o=DSe(s);function r(i){const a=i.tokens;for(let l=0;l<a.length;l++)for(let d=0;d<o.length;d++){const u=o[d];let h=null;u.tests.every(g=>{const m=_l(a,l,g);return m.j!==null&&(h=m.j),m.match})&&(u.transform(a,l,h),(u.name==="inline attributes"||u.name==="inline nesting 0")&&d--)}}e.core.ruler.before("linkify","curly_attributes",r)};function _l(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=BSe(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"&&PSe(n.children)){if(r.children.length===0)return s;let a;const l=n.children,d=r.children;if(l.every(u=>u.position!==void 0)){if(a=l.every(u=>_l(d,u.position,u).match),a){const u=zSe(l).position;s.j=u>=0?u:d.length+u}}else for(let u=0;u<d.length;u++)if(a=l.every(h=>_l(d,u,h).match),a){s.j=u;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(FSe(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 PSe(t){return Array.isArray(t)&&t.length&&t.every(e=>typeof e=="object")}function FSe(t){return Array.isArray(t)&&t.length&&t.every(e=>typeof e=="function")}function BSe(t,e){return e>=0?t[e]:t[t.length+e]}function zSe(t){return t.slice(-1)[0]||{}}const $Se=cs(ISe);function USe(){const t=Date.now().toString(),e=Math.floor(Math.random()*1e3).toString();return t+e}const bl=new Hte("commonmark",{html:!0,xhtmlOut:!0,breaks:!0,linkify:!0,typographer:!0,highlight:(t,e)=>{let n=USe();if(e&&go.getLanguage(e))try{const r=go.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><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="exec-btn_'+n+'" onclick="executeCode('+n+')">Execute</span><
// 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();
}
function executeCode(id) {
const codeElement = document.getElementById('code_' + id);
const codeExecElement = document.getElementById('code_exec_' + id);
const preExecElement = document.getElementById('pre_exec_' + id);
const code = codeElement.innerText
const json = JSON.stringify({ 'code': code })
console.log(json)
fetch('http://localhost:9600/execute_python_code', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: json
}).then(response=>{
// Parse the JSON data from the response body
return response.json();
})
.then(jsonData => {
// Now you can work with the JSON data
console.log(jsonData);
preExecElement.classList.remove('hidden');
codeExecElement.innerHTML = jsonData.output
})
.catch(error => {
// Handle any errors that occurred during the fetch process
console.error('Fetch error:', error);
});
}
`,t.async=!0,document.body.appendChild(t),this.markdownText?this.renderedMarkdown=bl.render(this.markdownText):this.renderedMarkdown="",_e(()=>{ye.replace()})},methods:{},watch:{markdownText(t){this.renderedMarkdown=bl.render(t),_e(()=>{ye.replace()})}}},qSe={class:"break-all"},HSe=["innerHTML"];function VSe(t,e,n,s,o,r){return v(),E("div",qSe,[c("div",{innerHTML:o.renderedMarkdown,class:"markdown-content"},null,8,HSe)])}const zg=ze(jSe,[["render",VSe]]);const GSe={props:{value:String,inputType:{type:String,default:"text",validator:t=>["text","email","password","file","path","integer","float"].includes(t)},fileAccept:String},data(){return{inputValue:this.value,placeholderText:this.getPlaceholderText()}},watch:{value(t){console.log("Changing value to ",t),this.inputValue=t}},mounted(){_e(()=>{ye.replace()}),console.log("Changing value to ",this.value),this.inputValue=this.value},methods:{handleSliderInput(t){this.inputValue=t.target.value,this.$emit("input",t.target.value)},getPlaceholderText(){switch(this.inputType){case"text":return"Enter text here";case"email":return"Enter your email";case"password":return"Enter your password";case"file":case"path":return"Choose a file";case"integer":return"Enter an integer";case"float":return"Enter a float";default:return"Enter value here"}},handleInput(t){if(this.inputType==="integer"){const e=t.target.value.replace(/[^0-9]/g,"");this.inputValue=e}console.log("handling input : ",t.target.value),this.$emit("input",t.target.value)},async pasteFromClipboard(){try{const t=await navigator.clipboard.readText();this.handleClipboardData(t)}catch(t){console.error("Failed to read from clipboard:",t)}},handlePaste(t){const e=t.clipboardData.getData("text");this.handleClipboardData(e)},handleClipboardData(t){switch(this.inputType){case"email":this.inputValue=this.isValidEmail(t)?t:"";break;case"password":this.inputValue=t;break;case"file":case"path":this.inputValue="";break;case"integer":this.inputValue=this.parseInteger(t);break;case"float":this.inputValue=this.parseFloat(t);break;default:this.inputValue=t;break}},isValidEmail(t){return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t)},parseInteger(t){const e=parseInt(t);return isNaN(e)?"":e},parseFloat(t){const e=parseFloat(t);return isNaN(e)?"":e},openFileInput(){this.$refs.fileInput.click()},handleFileInputChange(t){const e=t.target.files[0];e&&(this.inputValue=e.name)}}},KSe={class:"flex items-center space-x-2"},ZSe=["value","type","placeholder"],WSe=["value","min","max"],YSe=c("i",{"data-feather":"clipboard"},null,-1),JSe=[YSe],QSe=c("i",{"data-feather":"upload"},null,-1),XSe=[QSe],eTe=["accept"];function tTe(t,e,n,s,o,r){return v(),E("div",KSe,[t.useSlider?(v(),E("input",{key:1,type:"range",value:parseInt(o.inputValue),min:t.minSliderValue,max:t.maxSliderValue,onInput:e[2]||(e[2]=(...i)=>r.handleSliderInput&&r.handleSliderInput(...i)),class:"flex-1 px-4 py-2 text-lg border dark:bg-gray-600 border-gray-300 rounded-md focus:outline-none focus:ring focus:border-blue-500"},null,40,WSe)):(v(),E("input",{key:0,value:o.inputValue,type:n.inputType,placeholder:o.placeholderText,onInput:e[0]||(e[0]=(...i)=>r.handleInput&&r.handleInput(...i)),onPaste:e[1]||(e[1]=(...i)=>r.handlePaste&&r.handlePaste(...i)),class:"flex-1 px-4 py-2 text-lg dark:bg-gray-600 border border-gray-300 rounded-md focus:outline-none focus:ring focus:border-blue-500"},null,40,ZSe)),c("button",{onClick:e[3]||(e[3]=(...i)=>r.pasteFromClipboard&&r.pasteFromClipboard(...i)),class:"p-2 bg-blue-500 dark:bg-gray-600 text-white rounded-md hover:bg-blue-600 focus:outline-none focus:ring focus:border-blue-300"},JSe),n.inputType==="file"?(v(),E("button",{key:2,onClick:e[4]||(e[4]=(...i)=>r.openFileInput&&r.openFileInput(...i)),class:"p-2 bg-blue-500 text-white rounded-md hover:bg-blue-600 focus:outline-none focus:ring focus:border-blue-300"},XSe)):R("",!0),n.inputType==="file"?(v(),E("input",{key:3,ref:"fileInput",type:"file",style:{display:"none"},accept:n.fileAccept,onChange:e[5]||(e[5]=(...i)=>r.handleFileInputChange&&r.handleFileInputChange(...i))},null,40,eTe)):R("",!0)])}const xc=ze(GSe,[
<div class="bg-white p-6 rounded-md shadow-md w-80">
<h2 class="text-lg font-semibold mb-3">${t}</h2>
<textarea id="replacementInput" class="w-full h-32 border rounded p-2 mb-3">${e}</textarea>
<div class="flex justify-end">
<button id="cancelButton" class="mr-2 px-4 py-2 border rounded">Cancel</button>
<button id="okButton" class="px-4 py-2 bg-blue-500 text-white rounded">OK</button>
</div>
</div>
`:r.innerHTML=`
<div class="bg-white p-6 rounded-md shadow-md w-80">
<h2 class="text-lg font-semibold mb-3">${t}</h2>
<select id="options_selector" class="form-control w-full h-25 border rounded p-2 mb-3">
${n.map(l=>`<option value="${l}">${l}</option>`)}
</select>
<div class="flex justify-end">
<button id="cancelButton" class="mr-2 px-4 py-2 border rounded">Cancel</button>
<button id="okButton" class="px-4 py-2 bg-blue-500 text-white rounded">OK</button>
</div>
</div>
`,document.body.appendChild(r);const i=r.querySelector("#cancelButton"),a=r.querySelector("#okButton");i.addEventListener("click",()=>{document.body.removeChild(r),s(null)}),a.addEventListener("click",()=>{if(n.length===0){const d=r.querySelector("#replacementInput").value.trim();document.body.removeChild(r),s(d)}else{const d=r.querySelector("#options_selector").value.trim();document.body.removeChild(r),s(d)}})})}function iTe(t,e){console.log(t);let n={},s=/@<([^>]+)>@/g,o=[],r;for(;(r=s.exec(t))!==null;)o.push("@<"+r[1]+">@");console.log("matches"),console.log(o),o=[...new Set(o)];async function i(l){console.log(l);let d=l.toLowerCase().substring(2,l.length-2);if(d!=="generation_placeholder")if(d.includes(":")){Object.entries({all_language_options:"english:french:german:chinese:japanese:spanish:italian:russian:portuguese:swedish:danish:dutch:norwegian:slovak:czech:hungarian:polish:ukrainian:bulgarian:latvian:lithuanian:estonian:maltese:irish:galician:basque:welsh:breton:georgian:turkmen:kazakh:uzbek:tajik:afghan:sri-lankan:filipino:vietnamese:lao:cambodian:thai:burmese:kenyan:botswanan:zimbabwean:malawian:mozambican:angolan:namibian:south-african:madagascan:seychellois:mauritian:haitian:peruvian:ecuadorian:bolivian:paraguayan:chilean:argentinean:uruguayan:brazilian:colombian:venezuelan:puerto-rican:cuban:dominican:honduran:nicaraguan:salvadorean:guatemalan:el-salvadoran:belizean:panamanian:costa-rican:antiguan:barbudan:dominica's:grenada's:st-lucia's:st-vincent's:gibraltarian:faroe-islander:greenlandic:icelandic:jamaican:trinidadian:tobagonian:barbadian:anguillan:british-virgin-islander:us-virgin-islander:turkish:israeli:palestinian:lebanese:egyptian:libyan:tunisian:algerian:moroccan:bahraini:kuwaiti:saudi-arabian:yemeni:omani:irani:iraqi:afghanistan's:pakistani:indian:nepalese:sri-lankan:maldivan:burmese:thai:lao:vietnamese:kampuchean:malaysian:bruneian:indonesian:australian:new-zealanders:fijians:tongans:samoans:vanuatuans:wallisians:kiribatians:tuvaluans:solomon-islanders:marshallese:micronesians:hawaiians",all_programming_language_options:"python:c:c++:java:javascript:php:ruby:go:swift:kotlin:rust:haskell:erlang:lisp:scheme:prolog:cobol:fortran:pascal:delphi:d:eiffel:h:basic:visual_basic:smalltalk:objective-c:html5:node.js:vue.js:svelte:react:angular:ember:clipper:stex:arduino:brainfuck:r:assembly:mason:lepton:seacat:bbc_microbit:raspberry_pi_gpio:raspberry_pi_spi:raspberry_pi_i2c:raspberry_pi_uart:raspberry_pi_adc:raspberry_pi_ddio"}).forEach(([w,b])=>{console.log(`Key: ${w}, Value: ${b}`);function p(N){return N.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}const x=p(w),A=new RegExp(x,"g");d=d.replace(A,b)});let h=d.split(":"),f=h[0],g=h[1]||"",m=[];h.length>2&&(m=h.slice(1));let _=await Mh(f,g,m);_!==null&&(n[l]=_)}else{let u=await Mh(d);u!==null&&(n[l]=u)}}let a=Promise.resolve();o.forEach(l=>{a=a.then(()=>i(l)).then(d=>{console.log(d)})}),a.then(()=>{Object.entries(n).forEach(([l,d])=>{console.log(`Key: ${l}, Value: ${d}`);function u(g){return g.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}const h=u(l),f=new RegExp(h,"g");t=t.replace(f,d)}),e(t)})}const aTe={name:"PlayGroundView",data(){return{selecting_model:!1,tab_id:"source",generating:!1,isSpeaking:!1,voices:[],isLesteningToVoice:!1,presets:[],selectedPreset:"",cursorPosition:0,text:"",pre_text:"",post_text:"",temperature:.1,top_k:50,top_p:.9,repeat_penalty:1.3,repeat_last_n:50,n_crop:-1,n_predicts:2e3,seed:-1,silenceTimeout:5e3}},components:{Toast:Ys,MarkdownRenderer:zg,ClipBoardTextInput:xc,Card:Uo},mounted(){ve.get("./get_presets").then(t=>{console.log(t.data),this.presets=t.data,this.selectedPreset=this.presets[0]}).catch(t=>{this.$refs.toast.showToast(`Error: ${t}`,4,!1)}),Ce.on("text_chunk",t=>{this.appendToOutput(t.chunk)}),Ce.on("text_generated",t=>{this.generating=!1}),Ce.on("generation_error",t=>{console.log("generation_error:",t),this.$refs.toast.showToast(`Error: ${t}`,4,!1),this.generating=!1}),Ce.on("connect",()=>{console.log("Connected to LoLLMs server"),this.$store.state.isConnected=!0,this.generating=!1}),Ce.on("buzzy",t=>{console.error("Server is
`];let a=-1;return i.forEach(l=>{const d=r.lastIndexOf(l);d>a&&(a=d)}),a==-1&&(a=r.length),console.log(a),a+o+1},s=()=>{const o=n(t),r=this.text.substring(t,o);this.msg.text=r,t=o+1,this.msg.onend=i=>{t<this.text.length-2?setTimeout(()=>{s()},1):(this.isSpeaking=!1,console.log("voice off :",this.text.length," ",o))},this.speechSynthesis.speak(this.msg)};s()},getCursorPosition(){return this.cursorPosition},appendToOutput(t){this.pre_text+=t,this.text=this.pre_text+this.post_text},generate_in_placeholder(){console.log("Finding cursor position");let t=this.text.indexOf("@<generation_placeholder>@");if(t<0){this.$refs.toast.showToast("No generation placeholder found",4,!1);return}this.text=this.text.substring(0,t)+this.text.substring(t+26,this.text.length),this.pre_text=this.text.substring(0,t),this.post_text=this.text.substring(t,this.text.length);var e=this.text.substring(0,t);console.log(e),Ce.emit("generate_text",{prompt:e,personality:-1,n_predicts:this.n_predicts,n_crop:this.n_crop,parameters:{temperature:this.temperature,top_k:this.top_k,top_p:this.top_p,repeat_penalty:this.repeat_penalty,repeat_last_n:this.repeat_last_n,seed:parseInt(this.seed)}}),this.generating=!0},generate(){console.log("Finding cursor position"),this.pre_text=this.text.substring(0,this.getCursorPosition()),this.post_text=this.text.substring(this.getCursorPosition(),this.text.length);var t=this.text.substring(0,this.getCursorPosition());console.log(t),Ce.emit("generate_text",{prompt:t,personality:-1,n_predicts:this.n_predicts,n_crop:this.n_crop,parameters:{temperature:this.temperature,top_k:this.top_k,top_p:this.top_p,repeat_penalty:this.repeat_penalty,repeat_last_n:this.repeat_last_n,seed:parseInt(this.seed)}}),this.generating=!0},stopGeneration(){Ce.emit("cancel_text_generation",{})},exportText(){const t=this.text,e=document.createElement("a"),n=new Blob([t],{type:"text/plain"});e.href=URL.createObjectURL(n),e.download="exported_text.txt",document.body.appendChild(e),e.click(),document.body.removeChild(e)},importText(){const t=document.getElementById("import-input");t&&(t.addEventListener("change",e=>{if(e.target.files&&e.target.files[0]){const n=new FileReader;n.onload=()=>{this.text=n.result},n.readAsText(e.target.files[0])}else alert("Please select a file.")}),t.click())},setPreset(){console.log("Setting preset"),console.log(this.selectedPreset),this.tab_id="render",this.text=iTe(this.selectedPreset.content,t=>{console.log("Done"),console.log(t),this.text=t})},addPreset(){let t=prompt("Enter the title of the preset:");this.presets[t]={name:t,content:this.text},ve.post("./add_preset",this.presets[t]).then(e=>{console.log(e.data)}).catch(e=>{this.$refs.toast.showToast(`Error: ${e}`,4,!1)})},removePreset(){this.selectedPreset&&delete this.presets[this.selectedPreset.name]},reloadPresets(){ve.get("./get_presets").then(t=>{console.log(t.data),this.presets=t.data,this.selectedPreset=this.presets[0]}).catch(t=>{this.$refs.toast.showToast(`Error: ${t}`,4,!1)})},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.isLesteningToVoice=!0,this.silenceTimer=setTimeout(()=>{this.recognition.stop()},this.silenceTimeout)},this.pre_text=this.text.substring(0,this.getCursorPosition()),this.post_text=this.text.substring(this.getCursorPosition(),this.text.length),this.recognition.onresult=t=>{this.generated="";for(let e=t.resultIndex;e<t.results.length;e++)this.generated+=t.results[e][0].transcript;this.text=this.pre_text+this.generated+this.post_text,this.cursorPosition=this.pre_text.length+this.generated.length,clearTimeout(this.silenceTimer),this.silenceTimer=setTimeout(()=>{this.recognition.stop()},this.silenceTimeout)},this.recognition.onerror=t=>{console.error("Speech recognition error:",t.error),this.isLesteningToVoice=!1,clearTimeout(this.silenceTimer)},this.recognition.onend=()=>{console.log("Speech recog
Papa Parse
v5.4.1
https://github.com/mholt/PapaParse
License: MIT
*/(function(t,e){(function(n,s){t.exports=s()})(Bp,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(y,C){var M=(C=C||{}).dynamicTyping||!1;if(L(M)&&(C.dynamicTypingFunction=M,M={}),C.dynamicTyping=M,C.transform=!!L(C.transform)&&C.transform,C.worker&&l.WORKERS_SUPPORTED){var I=function(){if(!l.WORKERS_SUPPORTED)return!1;var X=(ue=s.URL||s.webkitURL||null,Y=n.toString(),l.BLOB_URL||(l.BLOB_URL=ue.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; ","(",Y,")();"],{type:"text/javascript"})))),P=new s.Worker(X),ue,Y;return P.onmessage=p,P.id=a++,i[P.id]=P}();return I.userStep=C.step,I.userChunk=C.chunk,I.userComplete=C.complete,I.userError=C.error,C.step=L(C.step),C.chunk=L(C.chunk),C.complete=L(C.complete),C.error=L(C.error),delete C.worker,void I.postMessage({input:y,config:C,workerId:I.id})}var B=null;return l.NODE_STREAM_INPUT,typeof y=="string"?(y=function(X){return X.charCodeAt(0)===65279?X.slice(1):X}(y),B=C.download?new h(C):new g(C)):y.readable===!0&&L(y.read)&&L(y.on)?B=new m(C):(s.File&&y instanceof File||y instanceof Object)&&(B=new f(C)),B.stream(y)},unparse:function(y,C){var M=!1,I=!0,B=",",X=`\r
`,P='"',ue=P+P,Y=!1,T=null,H=!1;(function(){if(typeof C=="object"){if(typeof C.delimiter!="string"||l.BAD_DELIMITERS.filter(function(ne){return C.delimiter.indexOf(ne)!==-1}).length||(B=C.delimiter),(typeof C.quotes=="boolean"||typeof C.quotes=="function"||Array.isArray(C.quotes))&&(M=C.quotes),typeof C.skipEmptyLines!="boolean"&&typeof C.skipEmptyLines!="string"||(Y=C.skipEmptyLines),typeof C.newline=="string"&&(X=C.newline),typeof C.quoteChar=="string"&&(P=C.quoteChar),typeof C.header=="boolean"&&(I=C.header),Array.isArray(C.columns)){if(C.columns.length===0)throw new Error("Option columns is empty");T=C.columns}C.escapeChar!==void 0&&(ue=C.escapeChar+P),(typeof C.escapeFormulae=="boolean"||C.escapeFormulae instanceof RegExp)&&(H=C.escapeFormulae instanceof RegExp?C.escapeFormulae:/^[=+\-@\t\r].*$/)}})();var G=new RegExp(w(P),"g");if(typeof y=="string"&&(y=JSON.parse(y)),Array.isArray(y)){if(!y.length||Array.isArray(y[0]))return we(null,y,Y);if(typeof y[0]=="object")return we(T||Object.keys(y[0]),y,Y)}else if(typeof y=="object")return typeof y.data=="string"&&(y.data=JSON.parse(y.data)),Array.isArray(y.data)&&(y.fields||(y.fields=y.meta&&y.meta.fields||T),y.fields||(y.fields=Array.isArray(y.data[0])?y.fields:typeof y.data[0]=="object"?Object.keys(y.data[0]):[]),Array.isArray(y.data[0])||typeof y.data[0]=="object"||(y.data=[y.data])),we(y.fields||[],y.data||[],Y);throw new Error("Unable to serialize unrecognized input");function we(ne,Ee,Me){var D="";typeof ne=="string"&&(ne=JSON.parse(ne)),typeof Ee=="string"&&(Ee=JSON.parse(Ee));var ee=Array.isArray(ne)&&0<ne.length,V=!Array.isArray(Ee[0]);if(ee&&I){for(var se=0;se<ne.length;se++)0<se&&(D+=B),D+=be(ne[se],se);0<Ee.length&&(D+=X)}for(var te=0;te<Ee.length;te++){var ge=ee?ne.length:Ee[te].length,he=!1,k=ee?Object.keys(Ee[te]).length===0:Ee[te].length===0;if(Me&&!ee&&(he=Me==="greedy"?Ee[te].join("").trim()==="":Ee[te].length===1&&Ee[te][0].length===0),Me==="greedy"&&ee){for(var S=[],F=0;F<ge;F++){var $=V?ne[F]:F;S.push(Ee[te][$])}he=S.join("").trim()===""}if(!he){for(var U=0;U<ge;U++){0<U&&!k&&(D+=B);var oe=ee&&V?ne[U]:U;D+=be(Ee[te][oe],U)}te<Ee.length-1&&(!Me||0<ge&&!k)&&(D+=X)}}return D}function be(ne,Ee){if(ne==null)return"";if(ne.constructor===Date)return JSON.stringify(ne).slice(1,25);var Me=!1;H&&typeof ne=="string"&&H.test(ne)&&(ne="'"+ne,Me=!0);var D=ne.toString().replace(G,ue);return(Me=Me||M===!0||typeof M=="function"&&M(ne,Ee)||Array.isArray(M)&&M[Ee]||function(ee,V){for(var se=0;se<V.length;se++)if(-1<ee.indexOf(V[se]))return!0;return!1}(D,l.BAD_DELIMITERS)||-1<D.indexOf(B)||D.charAt(0)===" "||D.charAt(D.length-1)===" ")?P+D+P:D}}};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=b,l.ParserHandle=_,l.NetworkStreamer=h,l.FileStreamer=f,l.StringStreamer=g,l.ReadableStreamStreamer=m,s.jQuery){var d=s.jQuery;d.fn.parse=function(y){var C=y.config||{},M=[];return this.each(function(X){if(!(d(this).prop("tagName").toUpperCase()==="INPUT"&&d(this).attr("type").toLowerCase()==="file"&&s.FileReader)||!this.files||this.files.length===0)return!0;for(var P=0;P<this.files.length;P++)M.push({file:this.files[P],inputElem:this,instanceConfig:d.extend({},C)})}),I(),this;function I(){if(M.length!==0){var X,P,ue,Y,T=M[0];if(L(y.before)){var H=y.before(T.file,T.inputElem);if(typeof H=="object"){if(H.action==="abort")return X="AbortError",P=T.file,ue=T.inputElem,Y=H.reason,void(L(y.error)&&y.error({name:X},P,ue,Y));if(H.action==="skip")return void B();typeof H.config=="object"&&(T.instanceConfig=d.extend(T.instanceConfig,H.config))}else if(H==="skip")return void B()}var G=T.instanceConfig.complete;T.instanceConfig.complete=function(we){L(G)&&G(we,T.file,T.inputElem),B()},l.parse(T.file,T.instanceConfig)}else L(y.complete)&&y.complete()}function B(){M.splice(0,1),I()}}}function u(y){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(C){var M=N(C);M.chunkSize=parseInt(M.chunkSize),C.step||C.chunk||(M.chunkSize=null),this._handle=new _(M),(this._handle.streamer=this)._config=M}.call(this,y),this.parseChunk=function(C,M){if(this.isFirstChunk&&L(this._config.beforeFirstChunk)){var I=this._config.beforeFirstChunk(C);I!==void 0&&(C=I)}this.isFirstChunk=!1,this._halted=!1;var B=this._partialLine+C;this._partialLine="";var X=this._handle.parse(B,this._baseIndex,!this._finished);if(!this._handle.paused()&&!this._handle.aborted()){var P=X.meta.cursor;this._finished||(this._partialLine=B.substring(P-this._baseIndex),this._baseIndex=P),X&&X.data&&(this._rowCount+=X.data.length);var ue=this._finished||this._config.preview&&this._rowCount>=this._config.preview;if(r)s.postMessage({results:X,workerId:l.WORKER_ID,finished:ue});else if(L(this._config.chunk)&&!M){if(this._config.chunk(X,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);X=void 0,this._completeResults=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(X.data),this._completeResults.errors=this._completeResults.errors.concat(X.errors),this._completeResults.meta=X.meta),this._completed||!ue||!L(this._config.complete)||X&&X.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),ue||X&&X.meta.paused||this._nextChunk(),X}this._halted=!0},this._sendError=function(C){L(this._config.error)?this._config.error(C):r&&this._config.error&&s.postMessage({workerId:l.WORKER_ID,error:C,finished:!1})}}function h(y){var C;(y=y||{}).chunkSize||(y.chunkSize=l.RemoteChunkSize),u.call(this,y),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(C=new XMLHttpRequest,this._config.withCredentials&&(C.withCredentials=this._config.withCredentials),o||(C.onload=O(this._chunkLoaded,this),C.onerror=O(this._chunkError,this)),C.open(this._config.downloadRequestBody?"POST":"GET",this._input,!o),this._config.downloadRequestHeaders){var M=this._config.downloadRequestHeaders;for(var I in M)C.setRequestHeader(I,M[I])}if(this._config.chunkSize){var B=this._start+this._config.chunkSize-1;C.setRequestHeader("Range","bytes="+this._start+"-"+B)}try{C.send(this._config.downloadRequestBody)}catch(X){this._chunkError(X.message)}o&&C.status===0&&this._chunkError()}},this._chunkLoaded=function(){C.readyState===4&&(C.status<200||400<=C.status?th
`),re=1<j.length&&j[0].length<ce[0].length;if(ce.length===1||re)return`
`;for(var q=0,J=0;J<ce.length;J++)ce[J][0]===`
`&&q++;return q>=ce.length/2?`\r
`:"\r"}(te,k)),I=!1,y.delimiter)L(y.delimiter)&&(y.delimiter=y.delimiter(te),ne.meta.delimiter=y.delimiter);else{var S=function($,U,oe,ce,j){var re,q,J,de;j=j||[","," ","|",";",l.RECORD_SEP,l.UNIT_SEP];for(var pe=0;pe<j.length;pe++){var fe=j[pe],Se=0,W=0,ie=0;J=void 0;for(var me=new b({comments:ce,delimiter:fe,newline:U,preview:10}).parse($),Oe=0;Oe<me.data.length;Oe++)if(oe&&Me(me.data[Oe]))ie++;else{var $e=me.data[Oe].length;W+=$e,J!==void 0?0<$e&&(Se+=Math.abs($e-J),J=$e):J=$e}0<me.data.length&&(W/=me.data.length-ie),(q===void 0||Se<=q)&&(de===void 0||de<W)&&1.99<W&&(q=Se,re=fe,de=W)}return{successful:!!(y.delimiter=re),bestDelimiter:re}}(te,y.newline,y.skipEmptyLines,y.comments,y.delimitersToGuess);S.successful?y.delimiter=S.bestDelimiter:(I=!0,y.delimiter=l.DefaultDelimiter),ne.meta.delimiter=y.delimiter}var F=N(y);return y.preview&&y.header&&F.preview++,C=te,M=new b(F),ne=M.parse(C,ge,he),D(),G?{meta:{paused:!0}}:ne||{meta:{paused:!1}}},this.paused=function(){return G},this.pause=function(){G=!0,M.abort(),C=L(y.chunk)?"":C.substring(M.getCharIndex())},this.resume=function(){Y.streamer._halted?(G=!1,Y.streamer.parseChunk(C,!0)):setTimeout(Y.resume,3)},this.aborted=function(){return we},this.abort=function(){we=!0,M.abort(),ne.meta.aborted=!0,L(y.complete)&&y.complete(ne),C=""}}function w(y){return y.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function b(y){var C,M=(y=y||{}).delimiter,I=y.newline,B=y.comments,X=y.step,P=y.preview,ue=y.fastMode,Y=C=y.quoteChar===void 0||y.quoteChar===null?'"':y.quoteChar;if(y.escapeChar!==void 0&&(Y=y.escapeChar),(typeof M!="string"||-1<l.BAD_DELIMITERS.indexOf(M))&&(M=","),B===M)throw new Error("Comment character same as delimiter");B===!0?B="#":(typeof B!="string"||-1<l.BAD_DELIMITERS.indexOf(B))&&(B=!1),I!==`
`&&I!=="\r"&&I!==`\r
`&&(I=`
`);var T=0,H=!1;this.parse=function(G,we,be){if(typeof G!="string")throw new Error("Input must be a string");var ne=G.length,Ee=M.length,Me=I.length,D=B.length,ee=L(X),V=[],se=[],te=[],ge=T=0;if(!G)return Ze();if(y.header&&!we){var he=G.split(I)[0].split(M),k=[],S={},F=!1;for(var $ in he){var U=he[$];L(y.transformHeader)&&(U=y.transformHeader(U,$));var oe=U,ce=S[U]||0;for(0<ce&&(F=!0,oe=U+"_"+ce),S[U]=ce+1;k.includes(oe);)oe=oe+"_"+ce;k.push(oe)}if(F){var j=G.split(I);j[0]=k.join(M),G=j.join(I)}}if(ue||ue!==!1&&G.indexOf(C)===-1){for(var re=G.split(I),q=0;q<re.length;q++){if(te=re[q],T+=te.length,q!==re.length-1)T+=I.length;else if(be)return Ze();if(!B||te.substring(0,D)!==B){if(ee){if(V=[],ie(te.split(M)),Fe(),H)return Ze()}else ie(te.split(M));if(P&&P<=q)return V=V.slice(0,P),Ze(!0)}}return Ze()}for(var J=G.indexOf(M,T),de=G.indexOf(I,T),pe=new RegExp(w(Y)+w(C),"g"),fe=G.indexOf(C,T);;)if(G[T]!==C)if(B&&te.length===0&&G.substring(T,T+D)===B){if(de===-1)return Ze();T=de+Me,de=G.indexOf(I,T),J=G.indexOf(M,T)}else if(J!==-1&&(J<de||de===-1))te.push(G.substring(T,J)),T=J+Ee,J=G.indexOf(M,T);else{if(de===-1)break;if(te.push(G.substring(T,de)),$e(de+Me),ee&&(Fe(),H))return Ze();if(P&&V.length>=P)return Ze(!0)}else for(fe=T,T++;;){if((fe=G.indexOf(C,fe+1))===-1)return be||se.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:V.length,index:T}),Oe();if(fe===ne-1)return Oe(G.substring(T,fe).replace(pe,C));if(C!==Y||G[fe+1]!==Y){if(C===Y||fe===0||G[fe-1]!==Y){J!==-1&&J<fe+1&&(J=G.indexOf(M,fe+1)),de!==-1&&de<fe+1&&(de=G.indexOf(I,fe+1));var Se=me(de===-1?J:Math.min(J,de));if(G.substr(fe+1+Se,Ee)===M){te.push(G.substring(T,fe).replace(pe,C)),G[T=fe+1+Se+Ee]!==C&&(fe=G.indexOf(C,T)),J=G.indexOf(M,T),de=G.indexOf(I,T);break}var W=me(de);if(G.substring(fe+1+W,fe+1+W+Me)===I){if(te.push(G.substring(T,fe).replace(pe,C)),$e(fe+1+W+Me),J=G.indexOf(M,T),fe=G.indexOf(C,T),ee&&(Fe(),H))return Ze();if(P&&V.length>=P)return Ze(!0);break}se.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:V.length,index:T}),fe++}}else fe++}return Oe();function ie(nt){V.push(nt),ge=T}function me(nt){var ot=0;if(nt!==-1){var ct=G.substring(fe+1,nt);ct&&ct.trim()===""&&(ot=ct.length)}return ot}function Oe(nt){return be||(nt===void 0&&(nt=G.substring(T)),te.push(nt),T=ne,ie(te),ee&&Fe()),Ze()}function $e(nt){T=nt,ie(te),te=[],de=G.indexOf(I,T)}function Ze(nt){return{data:V,errors:se,meta:{delimiter:M,linebreak:I,aborted:H,truncated:!!nt,cursor:ge+(we||0)}}}function Fe(){X(Ze()),V=[],se=[]}},this.abort=function(){H=!0},this.getCharIndex=function(){return T}}function p(y){var C=y.data,M=i[C.workerId],I=!1;if(C.error)M.userError(C.error,C.file);else if(C.results&&C.results.data){var B={abort:function(){I=!0,x(C.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:A,resume:A};if(L(M.userStep)){for(var X=0;X<C.results.data.length&&(M.userStep({data:C.results.data[X],errors:C.results.errors,meta:C.results.meta},B),!I);X++);delete C.results}else L(M.userChunk)&&(M.userChunk(C.results,B,C.file),delete C.results)}C.finished&&!I&&x(C.workerId,C.results)}function x(y,C){var M=i[y];L(M.userComplete)&&M.userComplete(C),M.terminate(),delete i[y]}function A(){throw new Error("Not implemented.")}function N(y){if(typeof y!="object"||y===null)return y;var C=Array.isArray(y)?[]:{};for(var M in y)C[M]=N(y[M]);return C}function O(y,C){return function(){y.apply(C,arguments)}}function L(y){return typeof y=="function"}return r&&(s.onmessage=function(y){var C=y.data;if(l.WORKER_ID===void 0&&C&&(l.WORKER_ID=C.workerId),typeof C.input=="string")s.postMessage({workerId:l.WORKER_ID,results:l.parse(C.input,C.config),finished:!0});else if(s.File&&C.input instanceof File||C.input instanceof Object){var M=l.parse(C.input,C.config);M&&s.postMessage({workerId:l.WORKER_ID,results:M,finished:!0})}}),(h.prototype=Object.create(u.prototype)).constructor=h,(f.prototype=Object.create(u.prototype)).constructor=f,(g.prototype=Object.create(g.prototype)).constructor=g,(m.prototype=Object.create(u.prototype)).constructor=m,l}
`+t.model.name+`
installed!`,4,!0),this.$store.dispatch("refreshDiskUsage")}}else Ce.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:
`+t.model.name+`
failed to install!`,4,!1),this.$store.dispatch("refreshDiskUsage");console.log("Here")};Ce.on("install_progress",n),Ce.emit("install_model",{path:e,type:t.model.type}),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"),ve.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(console.log("Constructing"),this.isLoading=!0,_e(()=>{ye.replace()});this.isReady===!1;)await new Promise(t=>setTimeout(t,100));console.log("Ready"),this.configFile.model_name&&(this.isModelSelected=!0),this.persCatgArr=await this.api_get_req("list_personalities_categories"),this.persArr=await this.api_get_req("list_personalities?category="+this.configFile.personality_category),console.log("category");try{this.extCatgArr=await this.api_get_req("list_extensions_categories"),console.log(this.extCatgArr)}catch{console.log("Couldn't list catergories"),this.extCatgArr=[]}try{this.extArr=await this.api_get_req("list_extensions?category="+this.extension_category)}catch{console.log("Couldn't list extensions"),this.extCatgArr=[]}console.log("models_zoo:"),console.log(this.models),this.personality_category=this.configFile.personality_category,this.personalitiesFiltered=this.personalities.filter(t=>t.category===this.configFile.personality_category),this.modelsFiltered=this.models,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.name==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.name==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:
`+model_object.name+`
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.name==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:
`+model_object.name+`
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;Ce.emit("install_model",{path:t,type:this.models_zoo[0].type},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:
${t}`)})},fetchExtensions(){this.api_get_req("list_extensions_categories").then(t=>{this.extCatgArr=t,this.extCatgArr.sort()}),this.api_get_req("list_extensions").then(t=>{this.extArr=t,this.extArr.sort(),console.log(`Listed extensions:
${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:
`+t.name,4,!0):this.$refs.toast.showToast(`Error on select personality:
`+t.name,4,!1),this.isLoading=!1}else console.log("mounting pers"),this.mountPersonality(t);_e(()=>{ye.replace()})}},onSelected(t,e=!1){if(this.isLoading){this.$refs.toast.showToast("Loading... please wait",4,!1);return}t&&(t.isInstalled?(this.configFile.model_name!=t.model.name||e)&&this.update_model(t.model.name).then(n=>{console.log("update_model",n),this.configFile.model_name=t.model.name,n.status?this.$refs.toast.showToast(`Selected model:
`+t.name,4,!0):this.$refs.toast.showToast(`Couldn't select model:
`+t.name,4,!1),this.settingsChanged=!0,this.isModelSelected=!0}):this.$refs.toast.showToast(`Model:
`+t.model.name+`
is not installed`,4,!1),_e(()=>{ye.replace()}))},onCopy(t){let e;t.model.isCustomModel?e=`Model name: ${t.name}
File size: ${t.fileSize}
Manually downloaded model `:e=`Model name: ${t.name}
File size: ${t.fileSize}
Download: ${"https://huggingface.co/"+t.quantizer+"/"+t.name}
License: ${t.license}
Owner: ${t.quantizer}
Website: ${"https://huggingface.co/"+t.quantizer}
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("https://huggingface.co/"+t.model.quantizer+"/"+t.model.name)},onCancelInstall(){const t=this.addModel;console.log("cancel install",t),this.modelDownlaodInProgress=!1,this.addModel={},Ce.emit("cancel_install",{model_name:t.model_name,binding_folder:t.binding_folder,model_url:t.model_url,patreon:model.patreon?model.patreon:"None"}),this.$refs.toast.showToast("Model installation aborted",4,!1)},onInstall(t){this.variant_choices=t.model.variants,this.currenModelToInstall=t,console.log("variant_choices"),console.log(this.variant_choices),console.log(t),this.variantSelectionDialogVisible=!0},onCreateReference(){ve.post("/add_reference_to_local_model",{path:this.reference_path}).then(t=>{t.status?(this.$refs.toast.showToast("Reference created",4,!0),this.refreshModelsZoo().then(e=>{this.$store.dispatch("refreshModels"),console.log("Models refreshed")})):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.addModel.progress==100&&(this.modelDownlaodInProgress=!1,console.log("Received succeeded"),Ce.off("install_progress",e),console.log("Installed successfully"),this.addModel={},this.$refs.toast.showToast(`Model:
`+this.addModel.model_name+`
installed!`,4,!0),this.$store.dispatch("refreshDiskUsage"))):(Ce.off("install_progress",e),console.log("Install failed"),this.modelDownlaodInProgress=!1,console.error("Installation failed:",n.error),this.$refs.toast.showToast(`Model:
`+this.addModel.model_name+`
failed to install!`,4,!1),this.$store.dispatch("refreshDiskUsage"))};Ce.on("install_progress",e),Ce.emit("install_model",{path:t,type:this.models_zoo[0].type}),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.addModel.progress==100&&(this.modelDownlaodInProgress=!1,console.log("Received succeeded"),Ce.off("progress",e),console.log("Installed successfully"),this.addModel={},this.$refs.toast.showToast(`Model:
`+this.addModel.model_name+`
installed!`,4,!0),this.$store.dispatch("refreshDiskUsage"))):(Ce.off("progress",e),console.log("Install failed"),this.modelDownlaodInProgress=!1,console.error("Installation failed:",n.error),this.$refs.toast.showToast(`Model:
`+this.addModel.model_name+`
failed to install!`,4,!1),this.$store.dispatch("refreshDiskUsage"))};Ce.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.name+"]","Yes","Cancel").then(e=>{if(e){console.log("uninstalling model...");const n=s=>{console.log("uninstalling res",s),s.status?(console.log("uninstalling success",s),t.uninstalling=!1,Ce.off("install_progress",n),this.showProgress=!1,this.refreshModelsZoo().then(o=>{this.$store.dispatch("refreshModels"),console.log("Models refreshed")}),this.modelsFiltered=this.models,this.$refs.toast.showToast(`Model:
`+t.model.name+`
was uninstalled!`,4,!0),this.$store.dispatch("refreshDiskUsage")):(console.log("uninstalling failed",s),t.uninstalling=!1,this.showProgress=!1,Ce.off("uninstall_progress",n),console.error("Uninstallation failed:",s.error),this.$refs.toast.showToast(`Model:
`+t.model.name+`
failed to uninstall!`,4,!1),this.$store.dispatch("refreshDiskUsage"))};Ce.on("uninstall_progress",n),self.selected_variant!=null?Ce.emit("uninstall_model",{path:"https://huggingface.co/"+t.model.quantizer+"/"+t.model.name+"/resolve/main/"+this.selected_variant.name,type:t.model.type}):Ce.emit("uninstall_model",{path:"https://huggingface.co/"+t.model.quantizer+"/"+t.model.name,type:t.model.type})}})},onSelectedBinding(t){if(console.log("Binding selected"),this.mzc_collapsed=!0,!t.binding.installed){this.$refs.toast.showToast(`Binding is not installed:
`+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&&(t.disclaimer?(this.$refs.yesNoDialog.askQuestion(t.disclaimer,"Proceed","Cancel"),res&&this.update_binding(t.binding.folder)):this.update_binding(t.binding.folder))},onUnInstallBinding(t){this.isLoading=!0,ve.post("/unInstall_binding",{name:t.binding.folder}).then(e=>{if(e)return this.isLoading=!1,console.log("unInstall_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,t.isInstalled=False}).catch(e=>(this.isLoading=!1,this.$refs.toast.showToast(`Could not reinstall binding
`+e.message,4,!1),{status:!1}))},onReinstallBinding(t){this.isLoading=!0,ve.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}))},upgrade2GPU(){this.isLoading=!0;try{ve.get("/upgrade_to_gpu").then(t=>{this.isLoading=!1,t&&(t.status?(this.$refs.toast.showToast("Upgraded to GPU",4,!0),this.configFile.enable_gpu=!0):this.$refs.toast.showToast("Could not upgrade to GPU. Endpoint error: "+t.error,4,!1))})}catch(t){this.isLoading=!1,this.$refs.toast.showToast("Could not open binding settings. Endpoint error: "+t.message,4,!1)}},onSettingsBinding(t){try{this.isLoading=!0,ve.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{ve.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.
`+s,4,!1),this.isLoading=!1)})}catch(s){this.$refs.toast.showToast(`Did not get binding settings responses.
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,ve.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,ve.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{ve.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.
`+s,4,!1),this.isLoading=!1)})}catch(s){this.$refs.toast.showToast(`Did not get Personality settings responses.
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_category(t,e){this.personality_category=t,e()},update_extension_category(t,e){this.extension_category=t,e()},refresh(){console.log("Refreshing"),this.$store.dispatch("refreshConfig").then(()=>{console.log(this.personality_category),this.api_get_req("list_personalities_categories").then(t=>{console.log("cats",t),this.persCatgArr=t,this.personalitiesFiltered=this.personalities.filter(e=>e.category===this.personality_category),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 ve.post("/update_setting",s);if(o)return this.isLoading=!1,console.log("update_setting",o),o.status?this.$refs.toast.showToast(`Setting updated successfully.
Don't forget to save to keep the setting permanently.`,4,!0):this.$refs.toast.showToast(`Setting update failed.
Please view the console for more details.`,4,!1),n!==void 0&&n(o),o.data;this.isLoading=!1},async refreshModelsZoo(){let e=(await ve.get("/get_available_models")).data;e=e.filter(n=>n.variants&&n.variants.length>0),console.log(`REFRESHING models using sorting ${this.sort_type}`),e.length>1?(this.sort_type==0?(e.sort((n,s)=>{const o=new Date(n.last_commit_time);return new Date(s.last_commit_time)-o}),console.log("Sorted")):this.sort_type==1?e.sort((n,s)=>s.rank-n.rank):this.sort_type==2?e.sort((n,s)=>n.name.localeCompare(s.name)):this.sort_type==3&&e.sort((n,s)=>n.name.localeCompare(s.name)),console.log("Sorted")):console.log("No sorting needed"),console.log("models_zoo"),e.forEach(n=>{n.name==this.$store.state.config.model_name?n.selected=!0:n.selected=!1}),this.models_zoo=e,console.log("models_zoo"),console.log(this.models_zoo);for(let n=0;n<this.$store.state.modelsArr.length;n++){const s=this.$store.state.modelsArr[n];let o=this.models_zoo.findIndex(r=>r.name==s);if(o==-1)for(let r=0;r<this.models_zoo.length;r++){let i=this.models_zoo[r].variants;if(i!=null&&(o=i.findIndex(a=>a.name==s),o!=-1)){o=r,console.log(`Found ${s} at index ${o}`);break}}if(o==-1){let r={};r.name=s,r.icon="",r.isCustomModel=!0,r.isInstalled=!0,this.models_zoo.push(r)}else this.models_zoo[o].isInstalled=!0}this.models_zoo.sort((n,s)=>n.isInstalled&&!s.isInstalled?-1:!n.isInstalled&&s.isInstalled?1:0)},update_binding(t){this.isLoading=!0,console.log("updating binding_name"),this.update_setting("binding_name",t,e=>{console.log("updated binding_name");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.refreshModelsZoo().then(o=>{this.$store.dispatch("refreshModels"),console.log("Models refreshed")}),this.$forceUpdate(),this.$refs.toast.showToast("Binding changed.",4,!0)}),_e(()=>{ye.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,ve.post("/apply_settings",{config:this.configFile}).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(()=>{ye.replace()})})},save_configuration(){this.showConfirmation=!1,ve.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&&ve.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 ve.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],i=catdictionary[o].map(a=>{const l=e.personalities.includes(o+"/"+a.folder);let d={};return d=a,d.category=o,d.language=langkey,d.full_path=o+"/"+a.folder,d.isMounted=l,d});this.personalities.length==0?this.personalities=i:this.personalities=this.personalities.concat(i)}this.personalities.sort((s,o)=>s.name.localeCompare(o.name)),this.personalitiesFiltered=this.personalities.filter(s=>s.category===this.configFile.personality_category),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),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),this.personalitiesFiltered.sort()),this.searchPersonalityInProgress=!1},async filterExtensions(){if(!this.searchExtension){this.personalitiesFiltered=this.extensions.filter(n=>n.category===this.extension_category),this.personalitiesFiltered.sort(),this.searchExtensionInProgress=!1;return}const t=this.searchExtension.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),this.personalitiesFiltered.sort()),this.searchExtensionInProgress=!1},async filterModels(){if(!this.searchModel){console.log("Searching model"),this.modelsFiltered=this.models,this.searchModelInProgress=!1;return}const t=this.searchModel.toLowerCase();this.is_loading_zoo=!0,console.log("filtering models");const e=this.models.filter(n=>{if(n.name&&n.name.toLowerCase().includes(t)||n.description&&n.description.toLowerCase().includes(t)||n.category&&n.category.toLowerCase().includes(t))return n});this.is_loading_zoo=!1,e.length>0?this.modelsFiltered=e:this.modelsFiltered=this.models,this.searchModelInProgress=!1},computedFileSize(t){return Kt(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 ve.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 ve.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"};const n={id:this.configFile.personalities.findIndex(s=>s===t.full_pat
`+t.personality.name,4,!0),this.$store.dispatch("refreshMountedPersonalities")):(t.isMounted=!1,this.$refs.toast.showToast(`Could not mount personality
Error: `+e.error+`
Response:
`+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:
`+r.name,4,!0)}else this.$refs.toast.showToast(`Could not unmount personality
Error: `+e.error,4,!1);this.isLoading=!1},async remountPersonality(t){await this.unmountPersonality(t),await this.mountPersonality(t)},onPersonalityReinstall(t){console.log("on reinstall ",t),this.isLoading=!0,ve.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
`+e.message,4,!1),{status:!1}))},personalityImgPlacehodler(t){t.target.src=Ln},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:{isReady:{get(){return this.$store.state.ready}},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.$store.state.config.db_path},set(t){this.$store.state.config.db_path=t}},personalities:{get(){return this.$store.state.personalities},set(t){this.$store.commit("setPersonalities",t)}},mountedPersArr:{get(){return t
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?
You need to select model before you leave, or else.`,"Ok","Cancel"),!1}},Z=t=>(is("data-v-3f0e9da4"),t=t(),as(),t),PIe={class:"container overflow-y-scroll flex flex-col shadow-lg p-10 pt-0 overflow-y-scroll w-full dark:bg-bg-dark 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-panel dark:hover:scrollbar-thumb-primary active:scrollbar-thumb-secondary"},FIe={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"},BIe={key:0,class:"flex gap-3 flex-1 items-center duration-75"},zIe=Z(()=>c("i",{"data-feather":"x"},null,-1)),$Ie=[zIe],UIe=Z(()=>c("i",{"data-feather":"check"},null,-1)),jIe=[UIe],qIe={key:1,class:"flex gap-3 flex-1 items-center"},HIe=Z(()=>c("i",{"data-feather":"save"},null,-1)),VIe=[HIe],GIe=Z(()=>c("i",{"data-feather":"refresh-ccw"},null,-1)),KIe=[GIe],ZIe=Z(()=>c("i",{"data-feather":"list"},null,-1)),WIe=[ZIe],YIe={class:"flex gap-3 flex-1 items-center justify-end"},JIe=Z(()=>c("i",{"data-feather":"trash-2"},null,-1)),QIe=[JIe],XIe=Z(()=>c("i",{"data-feather":"refresh-ccw"},null,-1)),ePe=[XIe],tPe=Z(()=>c("i",{"data-feather":"arrow-up-circle"},null,-1)),nPe={key:0},sPe=Z(()=>c("i",{"data-feather":"alert-circle"},null,-1)),oPe=[sPe],rPe={class:"flex gap-3 items-center"},iPe={key:0,class:"flex gap-3 items-center"},aPe=Z(()=>c("i",{"data-feather":"check"},null,-1)),lPe=[aPe],cPe={key:1,role:"status"},dPe=Z(()=>c("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"},[c("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"}),c("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)),uPe=Z(()=>c("span",{class:"sr-only"},"Loading...",-1)),hPe={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"},fPe={class:"flex flex-row p-3"},pPe=Z(()=>c("i",{"data-feather":"chevron-right"},null,-1)),gPe=[pPe],mPe=Z(()=>c("i",{"data-feather":"chevron-down"},null,-1)),_Pe=[mPe],bPe=Z(()=>c("h3",{class:"text-lg font-semibold cursor-pointer select-none mr-2"}," System status",-1)),yPe=Z(()=>c("div",{class:"mr-2"},"|",-1)),vPe={class:"text-base font-semibold cursor-pointer select-none items-center"},xPe={class:"flex gap-2 items-center"},wPe={key:0},kPe={class:"flex gap-2 items-center"},EPe=["title"],CPe=Gs('<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-3f0e9da4></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-3f0e9da4></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-3f0e9da4></path><path d="m 5.9133057,47.889121 v 4.42369" style="fill:none;stroke:curre
`];let a=-1;return i.forEach(l=>{const d=r.lastIndexOf(l);d>a&&(a=d)}),a==-1&&(a=r.length),console.log(a),a+o+1},s=()=>{if(this.message.content.includes(".")){const o=n(t),r=this.message.content.substring(t,o);this.msg.text=r,t=o+1,this.msg.onend=i=>{t<this.message.content.length-2?setTimeout(()=>{s()},1):(this.isSpeaking=!1,console.log("voice off :",this.message.content.length," ",o))},this.speechSynthesis.speak(this.msg)}else setTimeout(()=>{s()},1)};s()},toggleModel(){this.expanded=!this.expanded},copyContentToClipboard(){this.$emit("copy",this)},deleteMsg(){this.$emit("delete",this.message.id),this.deleteMsgMode=!1},rankUp(){this.$emit("rankUp",this.message.id)},rankDown(){this.$emit("rankDown",this.message.id)},updateMessage(){this.$emit("updateMessage",this.message.id,this.message.content),this.editMsgMode=!1},resendMessage(){this.$emit("resendMessage",this.message.id,this.message.content)},continueMessage(){this.$emit("continueMessage",this.message.id,this.message.content)},getImgUrl(){return this.avatar?Kqe+this.avatar:Ln},defaultImg(t){t.target.src=Ln},parseDate(t){let e=new Date(Date.parse(t)),s=Math.floor((new Date-e)/1e3);return s<=1?"just now":s<20?s+" seconds ago":s<40?"half a minute ago":s<60?"less than a minute ago":s<=90?"one minute ago":s<=3540?Math.round(s/60)+" minutes ago":s<=5400?"1 hour ago":s<=86400?Math.round(s/3600)+" hours ago":s<=129600?"1 day ago":s<604800?Math.round(s/86400)+" days ago":s<=777600?"1 week ago":t},prettyDate(t){let e=new Date((t||"").replace(/-/g,"/").replace(/[TZ]/g," ")),n=(new Date().getTime()-e.getTime())/1e3,s=Math.floor(n/86400);if(!(isNaN(s)||s<0||s>=31))return s==0&&(n<60&&"just now"||n<120&&"1 minute ago"||n<3600&&Math.floor(n/60)+" minutes ago"||n<7200&&"1 hour ago"||n<86400&&Math.floor(n/3600)+" hours ago")||s==1&&"Yesterday"||s<7&&s+" days ago"||s<31&&Math.ceil(s/7)+" weeks ago"},checkForFullSentence(){if(this.message.content.trim().split(" ").length>3){this.speak();return}}},watch:{"message.content":function(t){this.$store.state.config.auto_speak&&(this.isSpeaking||this.checkForFullSentence())},"message.ui":function(t){console.log("ui changed"),console.log(this.message_ui)},showConfirmation(){_e(()=>{ye.replace()})},editMsgMode(t){_e(()=>{ye.replace()})},deleteMsgMode(){_e(()=>{ye.replace()})}},computed:{message_ui:{get(){return this.message.ui}},isTalking:{get(){return this.isSpeaking}},created_at(){return this.prettyDate(this.message.created_at)},created_at_parsed(){return new Date(Date.parse(this.message.created_at)).toLocaleString()},finished_generating_at_parsed(){return new Date(Date.parse(this.message.finished_generating_at)).toLocaleString()},time_spent(){const t=new Date(Date.parse(this.message.created_at)),e=new Date(Date.parse(this.message.finished_generating_at));if(e.getTime()===t.getTime()||!e.getTime())return;let s=e.getTime()-t.getTime();const o=Math.floor(s/(1e3*60*60));s-=o*(1e3*60*60);const r=Math.floor(s/(1e3*60));s-=r*(1e3*60);const i=Math.floor(s/1e3);s-=i*1e3;function a(d){return d<10&&(d="0"+d),d}return a(o)+"h:"+a(r)+"m:"+a(i)+"s"}}},Wqe={class:"relative group rounded-lg m-2 shadow-lg hover:border-primary dark:hover:border-primary hover:border-solid hover:border-2 border-2 border-transparent even:bg-bg-light-discussion-odd dark:even:bg-bg-dark-discussion-odd flex flex-col flex-grow flex-wrap overflow-visible p-4 pb-2"},Yqe={class:"flex flex-row gap-2"},Jqe={class:"flex-shrink-0"},Qqe={class:"group/avatar"},Xqe=["src","data-popover-target"],eHe={class:"flex flex-col w-full flex-grow-0"},tHe={class:"flex flex-row flex-grow items-start"},nHe={class:"flex flex-col mb-2"},sHe={class:"drop-shadow-sm text-lg text-opacity-95 font-bold grow"},oHe=["title"],rHe=c("div",{class:"flex-grow"},null,-1),iHe={class:"flex-row justify-end mx-2"},aHe={class:"invisible group-hover:visible flex flex-row"},lHe={key:0,class:"flex items-center duration-75"},cHe=c("i",{"data-feather":"x"},null,-1),dHe=[cHe],uHe=c("i",{"data-feather":"check"},null,-1),hHe=[uHe],fHe=c("i",{"data-feather":"edit"},null,-1),pHe=[fHe],gHe=c("i",{"data-feather":"copy"},null,-1),mHe=[gHe
`+s,4,!1)})}catch(s){this.$refs.toast.showToast(`Did not get Personality settings responses.
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(()=>{ye.replace()});this.$store.state.ready===!1;)await new Promise(t=>setTimeout(t,100));this.onReady()},async api_get_req(t){try{const e=await ve.get("/"+t);if(e)return e.data}catch(e){console.log(e.message,"api_get_req - mountedPersonalities");return}},personalityImgPlacehodler(t){t.target.src=Ln}}},XHe={class:"w-fit select-none"},eVe={key:0,class:"flex -space-x-4"},tVe=["src","title"],nVe={key:1,class:"flex -space-x-4"},sVe=["src","title"],oVe={key:2,title:"Loading personalities"},rVe=c("div",{role:"status"},[c("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"},[c("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"}),c("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"})]),c("span",{class:"sr-only"},"Loading...")],-1),iVe=[rVe];function aVe(t,e,n,s,o,r){const i=Ie("UniversalForm");return v(),E(Ae,null,[c("div",XHe,[r.mountedPersArr.length>1?(v(),E("div",eVe,[c("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,tVe),c("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]=ae((...a)=>r.toggleShowPersList&&r.toggleShowPersList(...a),["stop"])),title:"Click to show more"},"+"+z(r.mountedPersArr.length-1),1)])):R("",!0),r.mountedPersArr.length==1?(v(),E("div",nVe,[c("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]=ae((...a)=>r.toggleShowPersList&&r.toggleShowPersList(...a),["stop"]))},null,40,sVe)])):R("",!0),r.mountedPersArr.length==0?(v(),E("div",oVe,iVe)):R("",!0)]),le(i,{ref:"universalForm",class:"z-20"},null,512)],64)}const lVe=ze(QHe,[["render",aVe]]);const cVe="/";ve.defaults.baseURL="/";const dVe={props:{onTalk:Function,onMounted:Function,onUnmounted:Function,onRemounted:Function,discussionPersonalities:Array,onShowPersList:Function},components:{PersonalityEntry:jg,Toast:Ys,UniversalForm:wc},name:"MountedPersonalitiesList",data(){return{bUrl:cVe,isMounted:!1,isLoading:!1}},async mounted(){await this.constructor(),this.isMounted=!0},async activa
`+e.message,4,!1),{status:!1}))},onPersonalityMounted(t){this.mountPersonality(t)},onPersonalityUnMounted(t){this.unmountPersonality(t)},onPersonalityRemount(t){this.reMountPersonality(t)},async handleOnTalk(t){if(ye.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(ye.replace(),console.log("Selected personality : ",JSON.stringify(t.personality)),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:
`+t.name,4,!0))}else this.onPersonalityMounted(t)}},onSettingsPersonality(t){try{ve.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{ve.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.
`+s,4,!1)})}catch(s){this.$refs.toast.showToast(`Did not get Personality settings responses.
2023-10-04 15:37:42 +02: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={category:t.category,folder:t.folder,language:t.language},n=await ve.post("/mount_personality",e);if(n)return n.data}catch(e){console.log(e.message,"mount_personality - settings");return}},async remount_personality(t){if(!t)return{status:!1,error:"no personality - mount_personality"};try{const e={category:t.category,folder:t.folder,language:t.language},n=await ve.post("/remount_personality",e);if(n)return n.data}catch(e){console.log(e.message,"remount_personality - settings");return}},async unmount_personality(t){if(!t)return{status:!1,error:"no personality - unmount_personality"};const e={category:t.category,folder:t.folder,language:t.language};try{const n=await ve.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"};let e=-1;if(console.log("Personality full path : ",t.full_path),console.log("Personality language : ",t.personality.language),t.personality.language!=null&&t.personality.language!=null?(console.log("Mounting a localized version of personality"),console.log("Mounted personalities :",JSON.stringify(this.configFile.personalities)),console.log("Personality to select: ",t.full_path+":"+t.personality.language),e=this.configFile.personalities.findIndex(n=>n===t.full_path+":"+t.personality.language)):(console.log("Mounted personalities :",JSON.stringify(this.configFile.personalities)),e=this.configFile.personalities.findIndex(n=>n===t.full_path)),e>-1){console.log("Selecting personality with id:",JSON.stringify(e));const n={id:e};try{const s=await ve.post("/select_personality",n);if(s)return this.$store.dispatch("refreshConfig").then(()=>{console.log("recovered config",this.configFile.active_personality_id),this.$store.dispatch("refreshPersonalitiesArr").then(()=>{this.$store.dispatch("refreshMountedPersonalities")})}),s.data}catch(s){console.log(s,"select_personality - settings");return}}else return console.log("Personality id is wrong"),this.$refs.toast.showToast("Personality id is wrong!",4,!1),{status:!1,error:"Personality id is wrong"}},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.onMounted(this),(await this.select_personality(t.personality)).status&&this.$refs.toast.showToast(`Selected personality:
`+t.personality.name,4,!0),this.getMountedPersonalities()):(t.isMounted=!1,this.$refs.toast.showToast(`Could not mount personality
Error: `+e.error,4,!1))},async reMountPersonality(t){if(console.log("remount pers",t),!t)return;if(!this.configFile.personalities.includes(t.personality.full_path)){this.$refs.toast.showToast("Personality not mounted",4,!1);return}const e=await this.remount_personality(t.personality);console.log("remount_personality res",e),e.status?(this.configFile.personalities=e.personalities,this.$refs.toast.showToast("Personality remounted",4,!0),t.isMounted=!0,this.onMounted(this),(await this.select_personality(t.personality)).status&&this.$refs.toast.showToast(`Selected personality:
`+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;console.log(`Unmounting ${JSON.stringify(t.personality)}`);const e=await this.unmount_personality(t.personality);if(e.status){console.log("unmount response",e),this.configFile.active_personality_id=e.active_personality_id,this.configFile.personalities=e.personalities;const n=this.configFile.personalities[this.configFile.active_personality_id],s=this.personalities.findIndex(a=>a.full_path==n),o=this.$refs.personalitiesZoo.findIndex(a=>a.full_path==t.full_path),r=this.personalities[s];r.isMounted=!1,r.selected=!0,this.$refs.personalitiesZoo[o].isMounted=!1,this.getMountedPersonalities(),(await this.select_personality(r)).status&&ye.replace(),this.$refs.toast.showToast("Personality unmounted",4,!0),this.onUnMounted(this)}else this.$refs.toast.showToast(`Could not unmount personality
2023-10-04 15:37:42 +02: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)}}},kc=t=>(is("data-v-430515e1"),t=t(),as(),t),uVe={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"},hVe={key:0,role:"status",class:"flex justify-center overflow-y-hidden"},fVe=kc(()=>c("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"},[c("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"}),c("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)),pVe=kc(()=>c("span",{class:"sr-only"},"Loading...",-1)),gVe=[fVe,pVe],mVe=kc(()=>c("i",{"data-feather":"chevron-down"},null,-1)),_Ve=[mVe],bVe={class:"block my-2 text-sm font-medium text-gray-900 dark:text-white"},yVe={class:"overflow-y-auto no-scrollbar pb-0 grid lg:grid-cols-3 md:grid-cols-2 gap-4 max-h-96"};function vVe(t,e,n,s,o,r){const i=Ie("personality-entry"),a=Ie("Toast"),l=Ie("UniversalForm");return v(),E("div",uVe,[o.isLoading?(v(),E("div",hVe,gVe)):R("",!0),c("div",null,[r.mountedPersArr.length>0?(v(),E("div",{key:0,class:ke(o.isLoading?"pointer-events-none opacity-30 cursor-default":"")},[c("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]=ae((...d)=>r.toggleShowPersList&&r.toggleShowPersList(...d),["stop"]))},_Ve),c("label",bVe," Mounted Personalities: ("+z(r.mountedPersArr.length)+") ",1),c("div",yVe,[le(It,{name:"bounce"},{default:Ne(()=>[(v(!0),E(Ae,null,Ue(this.$store.state.mountedPersArr,(d,u
`+s.error,4,!1),this.loading=!1,Ce.off("file_received")}),Ce.emit("send_file",n)},e.readAsDataURL(this.selectedFile)},async constructor(){nextTick(()=>{ye.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)}},kVe=t=>(is("data-v-52cfa09c"),t=t(),as(),t),EVe={key:0,title:"Loading..",class:"flex flex-row flex-grow justify-end"},CVe=kVe(()=>c("div",{role:"status"},[c("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"},[c("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"}),c("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"})]),c("span",{class:"sr-only"},"Loading...")],-1)),AVe=[CVe];function SVe(t,e,n,s,o,r){const i=Ie("InteractiveMenu");return o.loading?(v(),E("div",EVe,AVe)):(v(),Xe(i,{key:1,commands:n.commandsList,execute_cmd:r.execute_cmd},null,8,["commands","execute_cmd"]))}const TVe=ze(wVe,[["render",SVe],["__scopeId","data-v-52cfa09c"]]);const MVe={name:"ChatBox",emits:["messageSentEvent","stopGenerating","loaded"],props:{onTalk:Function,discussionList:Array,loading:!1,onShowToastMessage:Function},components:{Toast:Ys,MountedPersonalities:lVe,MountedPersonalitiesList:xVe,PersonalitiesCommands:TVe,InteractiveMenu:jo},setup(){},data(){return{message:"",selecting_model:!1,selectedModel:"",models:{},isLesteningToVoice:!1,filesList:[],isFileSentList:[],totalSize:0,showfilesList:!0,showPersonalities:!1,personalities_ready:!1,models_menu_icon:"#M"}},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:{emitloaded(){this.$emit("loaded")},showModels(t){t.preventDefault();const e=this.$refs.modelsSelectionList;console.log(e);const n=new MouseEvent("click");e.dispatchEvent(n)},commandify(t){let e=[];for(var n=0;n<t.length;n++){let s={};s.name=t[n],s.value=t[n],e.push(s)}return e},setModel(t){console.log("Setting model to "+t),this.selecting_model=!0,this.selectedModel=t,ve.post("/update_setting",{setting_name:"model_name",setting_value:t.value}).then(e=>{console.log(e),this.$refs.toast.showToast(`Model changed to ${t.value}`,4,!0),this.selecting_model=!1}).catch(e=>{this.$refs.toast.showToast(`Error ${e}`,4,!0),this.selecting_model=!1})},clear_files(){ve.get("/clear_personality_files_lis
`+o.error,4,!1);try{this.filesList.removeItem(t)}catch{}}Ce.off("file_received")}),Ce.emit("send_file",s)},n.readAsDataURL(t)},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.isLesteningToVoice=!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.isLesteningToVoice=!1,clearTimeout(this.silenceTimer)},this.recognition.onend=()=>{console.log("Speech recognition ended."),this.isLesteningToVoice=!1,clearTimeout(this.silenceTimer),this.submit()},this.recognition.start()):console.error("Speech recognition is not supported in this browser.")},onPersonalitiesReadyFun(){this.personalities_ready=!0},onShowPersListFun(t){this.showPersonalities=!this.showPersonalities},handleOnTalk(t){this.showPersonalities=!1,this.onTalk(t)},onMountFun(t){console.log("Mounting personality"),this.$refs.mountedPers.constructor()},onUnmountFun(t){console.log("Unmounting personality"),this.$refs.mountedPers.constructor()},onRemount(t){console.log("Remounting chat"),this.$refs.mountedPers.constructor()},computedFileSize(t){return _e(()=>{ye.replace()}),Kt(t)},removeItem(t){this.filesList=this.filesList.filter(e=>e!=t)},sendMessageEvent(t){this.filesList=[],this.$emit("messageSentEvent",t)},submitOnEnter(t){t.which===13&&(t.preventDefault(),t.repeat||(this.sendMessageEvent(this.message),this.message=""))},submit(){this.message&&(this.sendMessageEvent(this.message),this.message="")},stopGenerating(){this.$emit("stopGenerating")},addFiles(t){console.log("Adding file"),this.filesList=this.filesList.concat([...t.target.files]),console.log(`Files_list : ${this.filesList}`),this.isFileSentList=this.isFileSentList.concat([!1]*this.filesList.length),this.send_file(this.filesList[this.filesList.length-1])}},watch:{showfilesList(){_e(()=>{ye.replace()})},loading(t,e){_e(()=>{ye.replace()})},filesList:{handler(t,e){let n=0;if(t.length>0)for(let s=0;s<t.length;s++)n=n+parseInt(t[s].size);this.totalSize=Kt(n,!0),console.log("filesList changed")},deep:!0},discussionList(t){console.log("discussion arr",t)}},mounted(){ve.get("list_models").then(t=>{console.log("List models "+t.data),this.models=t.data,ve.get("get_active_model").then(e=>{console.log("Active model "+JSON.stringify(e.data)),e.data!=null&&(this.selectedModel=e.data.model)}).catch(e=>{this.$refs.toast.showToast(`Error: ${e}`,4,!1)})}).catch(t=>{this.$refs.toast.showToast(`Error: ${t}`,4,!1)}),this.emitloaded(),_e(()=>{ye.replace()})},activated(){_e(()=>{ye.replace()})}},ft=t=>(is("data-v-21d74680"),t=t(),as(),t),OVe={class:"absolute bottom-0 min-w-96 w-full justify-center text-center p-4"},RVe={key:0,class:"flex items-center justify-center w-full"},NVe={class:"flex flex-row p-2 rounded-t-lg"},DVe=ft(()=>c("label",{for:"chat",class:"sr-only"},"Send message",-1)),LVe={class:"px-3 py-3 rounded-lg bg-bg-light-tone-panel dark:bg-bg-dark-tone-panel shadow-lg"},IVe={class:"flex flex-col gap-2"},PVe={class:"flex"},FVe=["title"],BVe=ft(()=>c("i",{"data-feather":"list"},null,-1)),zVe=[BVe],$Ve={key:0},UVe={class:"flex flex-col max-h-64"},jVe=["title"],qVe={class:"flex flex-row items-center gap-1 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"},HVe={key:0,filesList:"",role:"status"},VVe=ft(()=>c("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"},[c("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908
\r
\r
`,544),[[Re,o.message]]),c("input",{type:"file",ref:"fileDialog",style:{display:"none"},onChange:e[5]||(e[5]=(...h)=>r.addFiles&&r.addFiles(...h)),multiple:""},null,544),c("button",{type:"button",onClick:e[6]||(e[6]=ae(h=>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"},mGe)]),c("div",_Ge,[c("button",{type:"button",onClick:e[7]||(e[7]=(...h)=>r.startSpeechRecognition&&r.startSpeechRecognition(...h)),class:ke([{"text-red-500":o.isLesteningToVoice},"w-6 hover:text-secondary duration-75 active:scale-90 cursor-pointer"])},yGe,2),n.loading?R("",!0):(v(),E("button",{key:0,type:"button",onClick:e[8]||(e[8]=(...h)=>r.submit&&r.submit(...h)),class:"w-6 hover:text-secondary duration-75 active:scale-90"},wGe)),n.loading?(v(),E("div",kGe,CGe)):R("",!0)])])])])])]),le(u,{ref:"toast"},null,512)],64)}const Gg=ze(MVe,[["render",AGe],["__scopeId","data-v-21d74680"]]),SGe={name:"WelcomeComponent",setup(){return{}}},TGe={class:"flex flex-col text-center"},MGe=Gs('<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="'+oc+'" 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),OGe=[MGe];function RGe(t,e,n,s,o,r){return v(),E("div",TGe,OGe)}const Kg=ze(SGe,[["render",RGe]]);const NGe={setup(){return{}},name:"DragDrop",emits:["panelLeave","panelDrop"],data(){return{fileList:[],show:!1,dropRelease:!1}},mounted(){_e(()=>{ye.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(()=>{ye.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(()=>{ye.replace()})}}},DGe={class:"text-4xl text-center"};function LGe(t,e,n,s,o,r){return v(),Xe(It,{name:"list",tag:"div"},{default:Ne(()=>[o.show?(v(),E("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]=ae(i=>r.panelLeave(i),["prevent"])),onDrop:e[1]||(e[1]=ae(i=>r.panelDrop(i),["stop","prevent"]))},[c("div",{class:ke(["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"])},[c("div",DGe,[Ar(t.$slots,"default",{},()=>[xe(" Drop your files here ")])])],2)],32)):R("",!0)]),_:3})}const yl=ze(NGe,[["render",LGe]]);var IGe=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}(),Pr=globalThis&&globalThis.__assign||function(){return Pr=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},Pr.apply(this,arguments)},Fr={alwaysOpen:!1,activeClasses:"bg-gray-100 dark:bg-gray-800 text-gray-900 dark:text-white",inactiveClasses:"text-gray-500 dark:text-gray-
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 d=`${t.message.sender}${n}${s}
${o}
${l}`;navigator.clipboard.writeText(d),_e(()=>{ye.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.
`+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"),d="discussions_export_"+(n+"."+s+"."+o+"."+r+i+a)+".json";this.loading=!0;const u=await this.export_multiple_discussions(t);u?(this.saveJSONtoFile(u,d),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
`+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.$nextTick(()=>{ye.replace()}),Ce.onclose=t=>{console.log("WebSocket connection closed:",t.code,t.reason),this.socketIODisconnected()},Ce.onerror=t=>{console.log("WebSocket connection error:",t.code,t.reason),this.socketIODisconnected(),Ce.disconnect()},Ce.on("connected",this.socketIOConnected),Ce.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(this.$store.state.ready);console.log("Ready"),this.setPageTitle(),await this.list_discussions(),this.loadLastUsedDiscussion(),Ce.on("notification",this.notify),Ce.on("new_message",this.new_message),Ce.on("update_message",this.streamMessageContent),Ce.on("close_message",this.finalMsgEvent),Ce.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},async mounted(){this.$nextTick(()=>{ye.replace()})},async activated(){await this.getPersonalityAvatars(),this.isCreated&&_e(()=>{const t=document.getElementById("messages-list");this.scrollBottom(t)})},components:{Discussion:Hg,Message:Vg,ChatBox:Gg,WelcomeComponent:Kg,Toast:Ys,DragDrop:yl},watch:{filterTitle(t){t==""&&(this.filterInProgress=!0,this.list=this.tempList,this.filterInProgress=!1)},isCheckbox(t){_e(()=>{ye.replace()}),t||(this.isSelectAll=!1)},socketConnected(t){console.log("Websocket connected (watch)",t)},showConfirmation(){_e(()=>{ye.replace()})},isSearch(){_e(()=>{ye.replace()})}},computed:{client_id(){return Ce.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(()=>{ye.replace()}),this.list.filter(t=>t.checkBoxValue==!0)}}},hWe=Object.assign(uWe,{__name:"DiscussionsView",setup(t){return ti(()=>{UKe()}),ve.defaults.baseURL="/",(e,n)=>(v(),E(Ae,null,[le(Os,{name:"fade-and-fly"},{default:Ne(()=>[e.isReady?R("",!0):(v(),E("div",qKe,[c("div",HKe,[c("div",VKe,[c("div",GKe,[KKe,c("div",ZKe,[c("p",WKe,"Lord of Large Language Models v "+z(dt(Em).state.version),1),YKe,JKe])]),QKe,XKe,eZe,tZe])])]))]),_:1}),e.isReady?(v(),E("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"},[Q(c("div",null,sZe,512),[[We,e.panelCollapsed]]),Q(c("div",null,rZe,512),[[We,!e.panelCollapsed]])])):R("",!0),le(Os,{name:"slide-right"},{default:Ne(()=>[e.showPanel?(v(),E("div",iZe,[c("div",{id:"leftPanel",class:"flex flex-col flex-grow overflow-y-scroll no-scrollbar",onDragover:n[19]||(n[19]=ae(s=>e.setDropZoneDiscussion(),["stop","prevent"]))},[c("div",aZe,[c("div",lZe,[c("button",{class:"text-2xl hover:text-secondary duration-75 active:scale-90",title:"Create new discussion",type:"