diff --git a/app.py b/app.py index e0936c7c..b2d073ea 100644 --- a/app.py +++ b/app.py @@ -141,6 +141,8 @@ class LoLLMsWebUI(LoLLMsAPPI): self.add_endpoint("/personalities/", "serve_personalities", self.serve_personalities, methods=["GET"]) self.add_endpoint("/outputs/", "serve_outputs", self.serve_outputs, methods=["GET"]) self.add_endpoint("/data/", "serve_data", self.serve_data, methods=["GET"]) + self.add_endpoint("/help/", "serve_help", self.serve_help, methods=["GET"]) + self.add_endpoint("/uploads/", "serve_uploads", self.serve_uploads, methods=["GET"]) @@ -643,7 +645,15 @@ class LoLLMsWebUI(LoLLMsAPPI): fn = filename.split("/")[-1] return send_from_directory(path, fn) - + + def serve_help(self, filename): + root_dir = Path(__file__).parent/f"help" + root_dir.mkdir(exist_ok=True, parents=True) + path = str(root_dir/"/".join(filename.split("/")[:-1])) + + fn = filename.split("/")[-1] + return send_from_directory(path, fn) + def serve_data(self, filename): root_dir = lollms_personal_path / "data" root_dir.mkdir(exist_ok=True, parents=True) diff --git a/help/faqs.csv b/help/faqs.csv new file mode 100644 index 00000000..9b0e2f8b --- /dev/null +++ b/help/faqs.csv @@ -0,0 +1,2 @@ +question,answer +What is Lollms?,Lollms (Lord of Large Language Model) is a library that is aiming on \ No newline at end of file diff --git a/web/dist/assets/index-86ab464e.js b/web/dist/assets/index-c0068976.js similarity index 96% rename from web/dist/assets/index-86ab464e.js rename to web/dist/assets/index-c0068976.js index 12abaf7b..01d95404 100644 --- a/web/dist/assets/index-86ab464e.js +++ b/web/dist/assets/index-c0068976.js @@ -20,9 +20,9 @@ License: MIT `:"\r"}(Z,y)),D=!1,b.delimiter)M(b.delimiter)&&(b.delimiter=b.delimiter(Z),ee.meta.delimiter=b.delimiter);else{var N=function(U,B,te,se,G){var ne,Y,j,ae;G=G||[","," ","|",";",l.RECORD_SEP,l.UNIT_SEP];for(var ue=0;ue=P)return Fe(!0)}else for(ce=A,A++;;){if((ce=H.indexOf(C,ce+1))===-1)return _e||X.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:V.length,index:A}),be();if(ce===ee-1)return be(H.substring(A,ce).replace(ue,C));if(C!==z||H[ce+1]!==z){if(C===z||ce===0||H[ce-1]!==z){j!==-1&&j=P)return Fe(!0);break}X.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:V.length,index:A}),ce++}}else ce++}return be();function re(ze){V.push(ze),de=A}function pe(ze){var We=0;if(ze!==-1){var Ze=H.substring(ce+1,ze);Ze&&Ze.trim()===""&&(We=Ze.length)}return We}function be(ze){return _e||(ze===void 0&&(ze=H.substring(A)),Z.push(ze),A=ee,re(Z),$&&Ne()),Fe()}function Ae(ze){A=ze,re(Z),Z=[],ae=H.indexOf(D,A)}function Fe(ze){return{data:V,errors:X,meta:{delimiter:I,linebreak:D,aborted:q,truncated:!!ze,cursor:de+(me||0)}}}function Ne(){W(Fe()),V=[],X=[]}},this.abort=function(){q=!0},this.getCharIndex=function(){return A}}function S(b){var C=b.data,I=s[C.workerId],D=!1;if(C.error)I.userError(C.error,C.file);else if(C.results&&C.results.data){var k={abort:function(){D=!0,T(C.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:R,resume:R};if(M(I.userStep)){for(var W=0;Wt.text()).then(t=>{const{data:e}=kO.parse(t,{header:!0});this.faqs=e}).catch(t=>{console.error("Error loading FAQs:",t)})}}},FO={class:"container mx-auto p-4 bg-bg-light-tone dark:bg-bg-dark-tone shadow-lg"},UO={class:"mb-8"},BO=m("h2",{class:"text-2xl font-bold mb-2"},"Frequently Asked Questions",-1),GO={class:"list-disc pl-4"},qO={class:"text-xl font-bold mb-1"},YO={class:"mb-4"},HO=m("div",null,[m("h2",{class:"text-2xl font-bold mb-2"},"Contact Us"),m("p",{class:"mb-4"},"If you have any further questions or need assistance, feel free to reach out to us."),m("p",null,[ke("Discord link: "),m("a",{class:"text-blue-500 hover:text-blue-400 duration-150",href:"https://discord.gg/C73K7hjy"},"https://discord.gg/C73K7hjy")])],-1),VO={class:"mt-8"},zO=GE('

Credits

This project is developed by ParisNeo With help from the community.

Check out the full list of developers here and show them some love.

',3),$O=["href"];function WO(t,e,n,r,o,i){return J(),oe("div",FO,[m("div",UO,[BO,m("ul",GO,[(J(!0),oe(Be,null,At(o.faqs,(s,a)=>(J(),oe("li",{key:a},[m("h3",qO,fe(s.question),1),m("p",YO,fe(s.answer),1)]))),128))])]),HO,m("div",VO,[zO,m("p",null,[ke("Check out the project on "),m("a",{class:"text-blue-500 hover:text-blue-400 duration-150",href:o.githubLink,target:"_blank",rel:"noopener noreferrer"},"GitHub",8,$O),ke(".")])])])}const KO=et(PO,[["render",WO]]);function Jo(t,e=!0,n=1){const r=e?1e3:1024;if(Math.abs(t)=r&&ie=>{const n=QO.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),nn=t=>(t=t.toLowerCase(),e=>Di(e)===t),Mi=t=>e=>typeof e===t,{isArray:br}=Array,Jr=Mi("undefined");function jO(t){return t!==null&&!Jr(t)&&t.constructor!==null&&!Jr(t.constructor)&&Jt(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const fS=nn("ArrayBuffer");function XO(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&fS(t.buffer),e}const ZO=Mi("string"),Jt=Mi("function"),hS=Mi("number"),du=t=>t!==null&&typeof t=="object",JO=t=>t===!0||t===!1,Uo=t=>{if(Di(t)!=="object")return!1;const e=cu(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},eN=nn("Date"),tN=nn("File"),nN=nn("Blob"),rN=nn("FileList"),oN=t=>du(t)&&Jt(t.pipe),iN=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||Jt(t.append)&&((e=Di(t))==="formdata"||e==="object"&&Jt(t.toString)&&t.toString()==="[object FormData]"))},sN=nn("URLSearchParams"),aN=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function ao(t,e,{allOwnKeys:n=!1}={}){if(t===null||typeof t>"u")return;let r,o;if(typeof t!="object"&&(t=[t]),br(t))for(r=0,o=t.length;r0;)if(o=n[r],e===o.toLowerCase())return o;return null}const SS=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),bS=t=>!Jr(t)&&t!==SS;function yd(){const{caseless:t}=bS(this)&&this||{},e={},n=(r,o)=>{const i=t&&ES(e,o)||o;Uo(e[i])&&Uo(r)?e[i]=yd(e[i],r):Uo(r)?e[i]=yd({},r):br(r)?e[i]=r.slice():e[i]=r};for(let r=0,o=arguments.length;r(ao(e,(o,i)=>{n&&Jt(o)?t[i]=gS(o,n):t[i]=o},{allOwnKeys:r}),t),cN=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),dN=(t,e,n,r)=>{t.prototype=Object.create(e.prototype,r),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},uN=(t,e,n,r)=>{let o,i,s;const a={};if(e=e||{},t==null)return e;do{for(o=Object.getOwnPropertyNames(t),i=o.length;i-- >0;)s=o[i],(!r||r(s,t,e))&&!a[s]&&(e[s]=t[s],a[s]=!0);t=n!==!1&&cu(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},_N=(t,e,n)=>{t=String(t),(n===void 0||n>t.length)&&(n=t.length),n-=e.length;const r=t.indexOf(e,n);return r!==-1&&r===n},pN=t=>{if(!t)return null;if(br(t))return t;let e=t.length;if(!hS(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},mN=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&cu(Uint8Array)),gN=(t,e)=>{const r=(t&&t[Symbol.iterator]).call(t);let o;for(;(o=r.next())&&!o.done;){const i=o.value;e.call(t,i[0],i[1])}},fN=(t,e)=>{let n;const r=[];for(;(n=t.exec(e))!==null;)r.push(n);return r},hN=nn("HTMLFormElement"),EN=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,o){return r.toUpperCase()+o}),$_=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),SN=nn("RegExp"),TS=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),r={};ao(n,(o,i)=>{e(o,i,t)!==!1&&(r[i]=o)}),Object.defineProperties(t,r)},bN=t=>{TS(t,(e,n)=>{if(Jt(t)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=t[n];if(Jt(r)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},TN=(t,e)=>{const n={},r=o=>{o.forEach(i=>{n[i]=!0})};return br(t)?r(t):r(String(t).split(e)),n},yN=()=>{},vN=(t,e)=>(t=+t,Number.isFinite(t)?t:e),cs="abcdefghijklmnopqrstuvwxyz",W_="0123456789",yS={DIGIT:W_,ALPHA:cs,ALPHA_DIGIT:cs+cs.toUpperCase()+W_},CN=(t=16,e=yS.ALPHA_DIGIT)=>{let n="";const{length:r}=e;for(;t--;)n+=e[Math.random()*r|0];return n};function RN(t){return!!(t&&Jt(t.append)&&t[Symbol.toStringTag]==="FormData"&&t[Symbol.iterator])}const ON=t=>{const e=new Array(10),n=(r,o)=>{if(du(r)){if(e.indexOf(r)>=0)return;if(!("toJSON"in r)){e[o]=r;const i=br(r)?[]:{};return ao(r,(s,a)=>{const l=n(s,o+1);!Jr(l)&&(i[a]=l)}),e[o]=void 0,i}}return r};return n(t,0)},Q={isArray:br,isArrayBuffer:fS,isBuffer:jO,isFormData:iN,isArrayBufferView:XO,isString:ZO,isNumber:hS,isBoolean:JO,isObject:du,isPlainObject:Uo,isUndefined:Jr,isDate:eN,isFile:tN,isBlob:nN,isRegExp:SN,isFunction:Jt,isStream:oN,isURLSearchParams:sN,isTypedArray:mN,isFileList:rN,forEach:ao,merge:yd,extend:lN,trim:aN,stripBOM:cN,inherits:dN,toFlatObject:uN,kindOf:Di,kindOfTest:nn,endsWith:_N,toArray:pN,forEachEntry:gN,matchAll:fN,isHTMLForm:hN,hasOwnProperty:$_,hasOwnProp:$_,reduceDescriptors:TS,freezeMethods:bN,toObjectSet:TN,toCamelCase:EN,noop:yN,toFiniteNumber:vN,findKey:ES,global:SS,isContextDefined:bS,ALPHABET:yS,generateString:CN,isSpecCompliantForm:RN,toJSONObject:ON};function De(t,e,n,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o)}Q.inherits(De,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Q.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const vS=De.prototype,CS={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{CS[t]={value:t}});Object.defineProperties(De,CS);Object.defineProperty(vS,"isAxiosError",{value:!0});De.from=(t,e,n,r,o,i)=>{const s=Object.create(vS);return Q.toFlatObject(t,s,function(l){return l!==Error.prototype},a=>a!=="isAxiosError"),De.call(s,t.message,e,n,r,o),s.cause=t,s.name=t.name,i&&Object.assign(s,i),s};const NN=null;function vd(t){return Q.isPlainObject(t)||Q.isArray(t)}function RS(t){return Q.endsWith(t,"[]")?t.slice(0,-2):t}function K_(t,e,n){return t?t.concat(e).map(function(o,i){return o=RS(o),!n&&i?"["+o+"]":o}).join(n?".":""):e}function AN(t){return Q.isArray(t)&&!t.some(vd)}const IN=Q.toFlatObject(Q,{},null,function(e){return/^is[A-Z]/.test(e)});function Li(t,e,n){if(!Q.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,n=Q.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(f,E){return!Q.isUndefined(E[f])});const r=n.metaTokens,o=n.visitor||d,i=n.dots,s=n.indexes,l=(n.Blob||typeof Blob<"u"&&Blob)&&Q.isSpecCompliantForm(e);if(!Q.isFunction(o))throw new TypeError("visitor must be a function");function c(g){if(g===null)return"";if(Q.isDate(g))return g.toISOString();if(!l&&Q.isBlob(g))throw new De("Blob is not supported. Use a Buffer instead.");return Q.isArrayBuffer(g)||Q.isTypedArray(g)?l&&typeof Blob=="function"?new Blob([g]):Buffer.from(g):g}function d(g,f,E){let h=g;if(g&&!E&&typeof g=="object"){if(Q.endsWith(f,"{}"))f=r?f:f.slice(0,-2),g=JSON.stringify(g);else if(Q.isArray(g)&&AN(g)||(Q.isFileList(g)||Q.endsWith(f,"[]"))&&(h=Q.toArray(g)))return f=RS(f),h.forEach(function(T,R){!(Q.isUndefined(T)||T===null)&&e.append(s===!0?K_([f],R,i):s===null?f:f+"[]",c(T))}),!1}return vd(g)?!0:(e.append(K_(E,f,i),c(g)),!1)}const _=[],u=Object.assign(IN,{defaultVisitor:d,convertValue:c,isVisitable:vd});function p(g,f){if(!Q.isUndefined(g)){if(_.indexOf(g)!==-1)throw Error("Circular reference detected in "+f.join("."));_.push(g),Q.forEach(g,function(h,S){(!(Q.isUndefined(h)||h===null)&&o.call(e,h,Q.isString(S)?S.trim():S,f,u))===!0&&p(h,f?f.concat(S):[S])}),_.pop()}}if(!Q.isObject(t))throw new TypeError("data must be an object");return p(t),e}function Q_(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(r){return e[r]})}function uu(t,e){this._pairs=[],t&&Li(t,this,e)}const OS=uu.prototype;OS.append=function(e,n){this._pairs.push([e,n])};OS.toString=function(e){const n=e?function(r){return e.call(this,r,Q_)}:Q_;return this._pairs.map(function(o){return n(o[0])+"="+n(o[1])},"").join("&")};function xN(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function NS(t,e,n){if(!e)return t;const r=n&&n.encode||xN,o=n&&n.serialize;let i;if(o?i=o(e,n):i=Q.isURLSearchParams(e)?e.toString():new uu(e,n).toString(r),i){const s=t.indexOf("#");s!==-1&&(t=t.slice(0,s)),t+=(t.indexOf("?")===-1?"?":"&")+i}return t}class wN{constructor(){this.handlers=[]}use(e,n,r){return this.handlers.push({fulfilled:e,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){Q.forEach(this.handlers,function(r){r!==null&&e(r)})}}const j_=wN,AS={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},DN=typeof URLSearchParams<"u"?URLSearchParams:uu,MN=typeof FormData<"u"?FormData:null,LN=typeof Blob<"u"?Blob:null,kN=(()=>{let t;return typeof navigator<"u"&&((t=navigator.product)==="ReactNative"||t==="NativeScript"||t==="NS")?!1:typeof window<"u"&&typeof document<"u"})(),PN=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),Pt={isBrowser:!0,classes:{URLSearchParams:DN,FormData:MN,Blob:LN},isStandardBrowserEnv:kN,isStandardBrowserWebWorkerEnv:PN,protocols:["http","https","file","blob","url","data"]};function FN(t,e){return Li(t,new Pt.classes.URLSearchParams,Object.assign({visitor:function(n,r,o,i){return Pt.isNode&&Q.isBuffer(n)?(this.append(r,n.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)}},e))}function UN(t){return Q.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function BN(t){const e={},n=Object.keys(t);let r;const o=n.length;let i;for(r=0;r=n.length;return s=!s&&Q.isArray(o)?o.length:s,l?(Q.hasOwnProp(o,s)?o[s]=[o[s],r]:o[s]=r,!a):((!o[s]||!Q.isObject(o[s]))&&(o[s]=[]),e(n,r,o[s],i)&&Q.isArray(o[s])&&(o[s]=BN(o[s])),!a)}if(Q.isFormData(t)&&Q.isFunction(t.entries)){const n={};return Q.forEachEntry(t,(r,o)=>{e(UN(r),o,n,0)}),n}return null}const GN={"Content-Type":void 0};function qN(t,e,n){if(Q.isString(t))try{return(e||JSON.parse)(t),Q.trim(t)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(t)}const ki={transitional:AS,adapter:["xhr","http"],transformRequest:[function(e,n){const r=n.getContentType()||"",o=r.indexOf("application/json")>-1,i=Q.isObject(e);if(i&&Q.isHTMLForm(e)&&(e=new FormData(e)),Q.isFormData(e))return o&&o?JSON.stringify(IS(e)):e;if(Q.isArrayBuffer(e)||Q.isBuffer(e)||Q.isStream(e)||Q.isFile(e)||Q.isBlob(e))return e;if(Q.isArrayBufferView(e))return e.buffer;if(Q.isURLSearchParams(e))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return FN(e,this.formSerializer).toString();if((a=Q.isFileList(e))||r.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return Li(a?{"files[]":e}:e,l&&new l,this.formSerializer)}}return i||o?(n.setContentType("application/json",!1),qN(e)):e}],transformResponse:[function(e){const n=this.transitional||ki.transitional,r=n&&n.forcedJSONParsing,o=this.responseType==="json";if(e&&Q.isString(e)&&(r&&!this.responseType||o)){const s=!(n&&n.silentJSONParsing)&&o;try{return JSON.parse(e)}catch(a){if(s)throw a.name==="SyntaxError"?De.from(a,De.ERR_BAD_RESPONSE,this,null,this.response):a}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Pt.classes.FormData,Blob:Pt.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};Q.forEach(["delete","get","head"],function(e){ki.headers[e]={}});Q.forEach(["post","put","patch"],function(e){ki.headers[e]=Q.merge(GN)});const _u=ki,YN=Q.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),HN=t=>{const e={};let n,r,o;return t&&t.split(` +`);var A=0,q=!1;this.parse=function(H,me,_e){if(typeof H!="string")throw new Error("Input must be a string");var ee=H.length,ge=I.length,Ee=D.length,L=k.length,$=M(W),V=[],X=[],Z=[],de=A=0;if(!H)return Fe();if(b.header&&!me){var le=H.split(D)[0].split(I),y=[],N={},F=!1;for(var U in le){var B=le[U];M(b.transformHeader)&&(B=b.transformHeader(B,U));var te=B,se=N[B]||0;for(0=P)return Fe(!0)}else for(ce=A,A++;;){if((ce=H.indexOf(C,ce+1))===-1)return _e||X.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:V.length,index:A}),be();if(ce===ee-1)return be(H.substring(A,ce).replace(ue,C));if(C!==z||H[ce+1]!==z){if(C===z||ce===0||H[ce-1]!==z){j!==-1&&j=P)return Fe(!0);break}X.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:V.length,index:A}),ce++}}else ce++}return be();function re(ze){V.push(ze),de=A}function pe(ze){var We=0;if(ze!==-1){var Ze=H.substring(ce+1,ze);Ze&&Ze.trim()===""&&(We=Ze.length)}return We}function be(ze){return _e||(ze===void 0&&(ze=H.substring(A)),Z.push(ze),A=ee,re(Z),$&&Ne()),Fe()}function Ae(ze){A=ze,re(Z),Z=[],ae=H.indexOf(D,A)}function Fe(ze){return{data:V,errors:X,meta:{delimiter:I,linebreak:D,aborted:q,truncated:!!ze,cursor:de+(me||0)}}}function Ne(){W(Fe()),V=[],X=[]}},this.abort=function(){q=!0},this.getCharIndex=function(){return A}}function S(b){var C=b.data,I=s[C.workerId],D=!1;if(C.error)I.userError(C.error,C.file);else if(C.results&&C.results.data){var k={abort:function(){D=!0,T(C.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:R,resume:R};if(M(I.userStep)){for(var W=0;Wt.text()).then(t=>{const{data:e}=kO.parse(t,{header:!0});console.log(e),this.faqs=e}).catch(t=>{console.error("Error loading FAQs:",t)})}}},FO={class:"container mx-auto p-4 bg-bg-light-tone dark:bg-bg-dark-tone shadow-lg"},UO={class:"mb-8"},BO=m("h2",{class:"text-2xl font-bold mb-2"},"Frequently Asked Questions",-1),GO={class:"list-disc pl-4"},qO={class:"text-xl font-bold mb-1"},YO={class:"mb-4"},HO=m("div",null,[m("h2",{class:"text-2xl font-bold mb-2"},"Contact Us"),m("p",{class:"mb-4"},"If you have any further questions or need assistance, feel free to reach out to us."),m("p",null,[ke("Discord link: "),m("a",{class:"text-blue-500 hover:text-blue-400 duration-150",href:"https://discord.gg/C73K7hjy"},"https://discord.gg/C73K7hjy")])],-1),VO={class:"mt-8"},zO=GE('

Credits

This project is developed by ParisNeo With help from the community.

Check out the full list of developers here and show them some love.

',3),$O=["href"];function WO(t,e,n,r,o,i){return J(),oe("div",FO,[m("div",UO,[BO,m("ul",GO,[(J(!0),oe(Be,null,At(o.faqs,(s,a)=>(J(),oe("li",{key:a},[m("h3",qO,fe(s.question),1),m("p",YO,fe(s.answer),1)]))),128))])]),HO,m("div",VO,[zO,m("p",null,[ke("Check out the project on "),m("a",{class:"text-blue-500 hover:text-blue-400 duration-150",href:o.githubLink,target:"_blank",rel:"noopener noreferrer"},"GitHub",8,$O),ke(".")])])])}const KO=et(PO,[["render",WO]]);function Jo(t,e=!0,n=1){const r=e?1e3:1024;if(Math.abs(t)=r&&ie=>{const n=QO.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),nn=t=>(t=t.toLowerCase(),e=>Di(e)===t),Mi=t=>e=>typeof e===t,{isArray:br}=Array,Jr=Mi("undefined");function jO(t){return t!==null&&!Jr(t)&&t.constructor!==null&&!Jr(t.constructor)&&Jt(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const fS=nn("ArrayBuffer");function XO(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&fS(t.buffer),e}const ZO=Mi("string"),Jt=Mi("function"),hS=Mi("number"),du=t=>t!==null&&typeof t=="object",JO=t=>t===!0||t===!1,Uo=t=>{if(Di(t)!=="object")return!1;const e=cu(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},eN=nn("Date"),tN=nn("File"),nN=nn("Blob"),rN=nn("FileList"),oN=t=>du(t)&&Jt(t.pipe),iN=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||Jt(t.append)&&((e=Di(t))==="formdata"||e==="object"&&Jt(t.toString)&&t.toString()==="[object FormData]"))},sN=nn("URLSearchParams"),aN=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function ao(t,e,{allOwnKeys:n=!1}={}){if(t===null||typeof t>"u")return;let r,o;if(typeof t!="object"&&(t=[t]),br(t))for(r=0,o=t.length;r0;)if(o=n[r],e===o.toLowerCase())return o;return null}const SS=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),bS=t=>!Jr(t)&&t!==SS;function yd(){const{caseless:t}=bS(this)&&this||{},e={},n=(r,o)=>{const i=t&&ES(e,o)||o;Uo(e[i])&&Uo(r)?e[i]=yd(e[i],r):Uo(r)?e[i]=yd({},r):br(r)?e[i]=r.slice():e[i]=r};for(let r=0,o=arguments.length;r(ao(e,(o,i)=>{n&&Jt(o)?t[i]=gS(o,n):t[i]=o},{allOwnKeys:r}),t),cN=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),dN=(t,e,n,r)=>{t.prototype=Object.create(e.prototype,r),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},uN=(t,e,n,r)=>{let o,i,s;const a={};if(e=e||{},t==null)return e;do{for(o=Object.getOwnPropertyNames(t),i=o.length;i-- >0;)s=o[i],(!r||r(s,t,e))&&!a[s]&&(e[s]=t[s],a[s]=!0);t=n!==!1&&cu(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},_N=(t,e,n)=>{t=String(t),(n===void 0||n>t.length)&&(n=t.length),n-=e.length;const r=t.indexOf(e,n);return r!==-1&&r===n},pN=t=>{if(!t)return null;if(br(t))return t;let e=t.length;if(!hS(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},mN=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&cu(Uint8Array)),gN=(t,e)=>{const r=(t&&t[Symbol.iterator]).call(t);let o;for(;(o=r.next())&&!o.done;){const i=o.value;e.call(t,i[0],i[1])}},fN=(t,e)=>{let n;const r=[];for(;(n=t.exec(e))!==null;)r.push(n);return r},hN=nn("HTMLFormElement"),EN=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,o){return r.toUpperCase()+o}),$_=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),SN=nn("RegExp"),TS=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),r={};ao(n,(o,i)=>{e(o,i,t)!==!1&&(r[i]=o)}),Object.defineProperties(t,r)},bN=t=>{TS(t,(e,n)=>{if(Jt(t)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=t[n];if(Jt(r)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},TN=(t,e)=>{const n={},r=o=>{o.forEach(i=>{n[i]=!0})};return br(t)?r(t):r(String(t).split(e)),n},yN=()=>{},vN=(t,e)=>(t=+t,Number.isFinite(t)?t:e),cs="abcdefghijklmnopqrstuvwxyz",W_="0123456789",yS={DIGIT:W_,ALPHA:cs,ALPHA_DIGIT:cs+cs.toUpperCase()+W_},CN=(t=16,e=yS.ALPHA_DIGIT)=>{let n="";const{length:r}=e;for(;t--;)n+=e[Math.random()*r|0];return n};function RN(t){return!!(t&&Jt(t.append)&&t[Symbol.toStringTag]==="FormData"&&t[Symbol.iterator])}const ON=t=>{const e=new Array(10),n=(r,o)=>{if(du(r)){if(e.indexOf(r)>=0)return;if(!("toJSON"in r)){e[o]=r;const i=br(r)?[]:{};return ao(r,(s,a)=>{const l=n(s,o+1);!Jr(l)&&(i[a]=l)}),e[o]=void 0,i}}return r};return n(t,0)},Q={isArray:br,isArrayBuffer:fS,isBuffer:jO,isFormData:iN,isArrayBufferView:XO,isString:ZO,isNumber:hS,isBoolean:JO,isObject:du,isPlainObject:Uo,isUndefined:Jr,isDate:eN,isFile:tN,isBlob:nN,isRegExp:SN,isFunction:Jt,isStream:oN,isURLSearchParams:sN,isTypedArray:mN,isFileList:rN,forEach:ao,merge:yd,extend:lN,trim:aN,stripBOM:cN,inherits:dN,toFlatObject:uN,kindOf:Di,kindOfTest:nn,endsWith:_N,toArray:pN,forEachEntry:gN,matchAll:fN,isHTMLForm:hN,hasOwnProperty:$_,hasOwnProp:$_,reduceDescriptors:TS,freezeMethods:bN,toObjectSet:TN,toCamelCase:EN,noop:yN,toFiniteNumber:vN,findKey:ES,global:SS,isContextDefined:bS,ALPHABET:yS,generateString:CN,isSpecCompliantForm:RN,toJSONObject:ON};function De(t,e,n,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o)}Q.inherits(De,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Q.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const vS=De.prototype,CS={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{CS[t]={value:t}});Object.defineProperties(De,CS);Object.defineProperty(vS,"isAxiosError",{value:!0});De.from=(t,e,n,r,o,i)=>{const s=Object.create(vS);return Q.toFlatObject(t,s,function(l){return l!==Error.prototype},a=>a!=="isAxiosError"),De.call(s,t.message,e,n,r,o),s.cause=t,s.name=t.name,i&&Object.assign(s,i),s};const NN=null;function vd(t){return Q.isPlainObject(t)||Q.isArray(t)}function RS(t){return Q.endsWith(t,"[]")?t.slice(0,-2):t}function K_(t,e,n){return t?t.concat(e).map(function(o,i){return o=RS(o),!n&&i?"["+o+"]":o}).join(n?".":""):e}function AN(t){return Q.isArray(t)&&!t.some(vd)}const IN=Q.toFlatObject(Q,{},null,function(e){return/^is[A-Z]/.test(e)});function Li(t,e,n){if(!Q.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,n=Q.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(f,E){return!Q.isUndefined(E[f])});const r=n.metaTokens,o=n.visitor||d,i=n.dots,s=n.indexes,l=(n.Blob||typeof Blob<"u"&&Blob)&&Q.isSpecCompliantForm(e);if(!Q.isFunction(o))throw new TypeError("visitor must be a function");function c(g){if(g===null)return"";if(Q.isDate(g))return g.toISOString();if(!l&&Q.isBlob(g))throw new De("Blob is not supported. Use a Buffer instead.");return Q.isArrayBuffer(g)||Q.isTypedArray(g)?l&&typeof Blob=="function"?new Blob([g]):Buffer.from(g):g}function d(g,f,E){let h=g;if(g&&!E&&typeof g=="object"){if(Q.endsWith(f,"{}"))f=r?f:f.slice(0,-2),g=JSON.stringify(g);else if(Q.isArray(g)&&AN(g)||(Q.isFileList(g)||Q.endsWith(f,"[]"))&&(h=Q.toArray(g)))return f=RS(f),h.forEach(function(T,R){!(Q.isUndefined(T)||T===null)&&e.append(s===!0?K_([f],R,i):s===null?f:f+"[]",c(T))}),!1}return vd(g)?!0:(e.append(K_(E,f,i),c(g)),!1)}const _=[],u=Object.assign(IN,{defaultVisitor:d,convertValue:c,isVisitable:vd});function p(g,f){if(!Q.isUndefined(g)){if(_.indexOf(g)!==-1)throw Error("Circular reference detected in "+f.join("."));_.push(g),Q.forEach(g,function(h,S){(!(Q.isUndefined(h)||h===null)&&o.call(e,h,Q.isString(S)?S.trim():S,f,u))===!0&&p(h,f?f.concat(S):[S])}),_.pop()}}if(!Q.isObject(t))throw new TypeError("data must be an object");return p(t),e}function Q_(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(r){return e[r]})}function uu(t,e){this._pairs=[],t&&Li(t,this,e)}const OS=uu.prototype;OS.append=function(e,n){this._pairs.push([e,n])};OS.toString=function(e){const n=e?function(r){return e.call(this,r,Q_)}:Q_;return this._pairs.map(function(o){return n(o[0])+"="+n(o[1])},"").join("&")};function xN(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function NS(t,e,n){if(!e)return t;const r=n&&n.encode||xN,o=n&&n.serialize;let i;if(o?i=o(e,n):i=Q.isURLSearchParams(e)?e.toString():new uu(e,n).toString(r),i){const s=t.indexOf("#");s!==-1&&(t=t.slice(0,s)),t+=(t.indexOf("?")===-1?"?":"&")+i}return t}class wN{constructor(){this.handlers=[]}use(e,n,r){return this.handlers.push({fulfilled:e,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){Q.forEach(this.handlers,function(r){r!==null&&e(r)})}}const j_=wN,AS={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},DN=typeof URLSearchParams<"u"?URLSearchParams:uu,MN=typeof FormData<"u"?FormData:null,LN=typeof Blob<"u"?Blob:null,kN=(()=>{let t;return typeof navigator<"u"&&((t=navigator.product)==="ReactNative"||t==="NativeScript"||t==="NS")?!1:typeof window<"u"&&typeof document<"u"})(),PN=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),Pt={isBrowser:!0,classes:{URLSearchParams:DN,FormData:MN,Blob:LN},isStandardBrowserEnv:kN,isStandardBrowserWebWorkerEnv:PN,protocols:["http","https","file","blob","url","data"]};function FN(t,e){return Li(t,new Pt.classes.URLSearchParams,Object.assign({visitor:function(n,r,o,i){return Pt.isNode&&Q.isBuffer(n)?(this.append(r,n.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)}},e))}function UN(t){return Q.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function BN(t){const e={},n=Object.keys(t);let r;const o=n.length;let i;for(r=0;r=n.length;return s=!s&&Q.isArray(o)?o.length:s,l?(Q.hasOwnProp(o,s)?o[s]=[o[s],r]:o[s]=r,!a):((!o[s]||!Q.isObject(o[s]))&&(o[s]=[]),e(n,r,o[s],i)&&Q.isArray(o[s])&&(o[s]=BN(o[s])),!a)}if(Q.isFormData(t)&&Q.isFunction(t.entries)){const n={};return Q.forEachEntry(t,(r,o)=>{e(UN(r),o,n,0)}),n}return null}const GN={"Content-Type":void 0};function qN(t,e,n){if(Q.isString(t))try{return(e||JSON.parse)(t),Q.trim(t)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(t)}const ki={transitional:AS,adapter:["xhr","http"],transformRequest:[function(e,n){const r=n.getContentType()||"",o=r.indexOf("application/json")>-1,i=Q.isObject(e);if(i&&Q.isHTMLForm(e)&&(e=new FormData(e)),Q.isFormData(e))return o&&o?JSON.stringify(IS(e)):e;if(Q.isArrayBuffer(e)||Q.isBuffer(e)||Q.isStream(e)||Q.isFile(e)||Q.isBlob(e))return e;if(Q.isArrayBufferView(e))return e.buffer;if(Q.isURLSearchParams(e))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return FN(e,this.formSerializer).toString();if((a=Q.isFileList(e))||r.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return Li(a?{"files[]":e}:e,l&&new l,this.formSerializer)}}return i||o?(n.setContentType("application/json",!1),qN(e)):e}],transformResponse:[function(e){const n=this.transitional||ki.transitional,r=n&&n.forcedJSONParsing,o=this.responseType==="json";if(e&&Q.isString(e)&&(r&&!this.responseType||o)){const s=!(n&&n.silentJSONParsing)&&o;try{return JSON.parse(e)}catch(a){if(s)throw a.name==="SyntaxError"?De.from(a,De.ERR_BAD_RESPONSE,this,null,this.response):a}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Pt.classes.FormData,Blob:Pt.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};Q.forEach(["delete","get","head"],function(e){ki.headers[e]={}});Q.forEach(["post","put","patch"],function(e){ki.headers[e]=Q.merge(GN)});const _u=ki,YN=Q.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),HN=t=>{const e={};let n,r,o;return t&&t.split(` `).forEach(function(s){o=s.indexOf(":"),n=s.substring(0,o).trim().toLowerCase(),r=s.substring(o+1).trim(),!(!n||e[n]&&YN[n])&&(n==="set-cookie"?e[n]?e[n].push(r):e[n]=[r]:e[n]=e[n]?e[n]+", "+r:r)}),e},X_=Symbol("internals");function Ar(t){return t&&String(t).trim().toLowerCase()}function Bo(t){return t===!1||t==null?t:Q.isArray(t)?t.map(Bo):String(t)}function VN(t){const e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(t);)e[r[1]]=r[2];return e}const zN=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function ds(t,e,n,r,o){if(Q.isFunction(r))return r.call(this,e,n);if(o&&(e=n),!!Q.isString(e)){if(Q.isString(r))return e.indexOf(r)!==-1;if(Q.isRegExp(r))return r.test(e)}}function $N(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,n,r)=>n.toUpperCase()+r)}function WN(t,e){const n=Q.toCamelCase(" "+e);["get","set","has"].forEach(r=>{Object.defineProperty(t,r+n,{value:function(o,i,s){return this[r].call(this,e,o,i,s)},configurable:!0})})}class Pi{constructor(e){e&&this.set(e)}set(e,n,r){const o=this;function i(a,l,c){const d=Ar(l);if(!d)throw new Error("header name must be a non-empty string");const _=Q.findKey(o,d);(!_||o[_]===void 0||c===!0||c===void 0&&o[_]!==!1)&&(o[_||l]=Bo(a))}const s=(a,l)=>Q.forEach(a,(c,d)=>i(c,d,l));return Q.isPlainObject(e)||e instanceof this.constructor?s(e,n):Q.isString(e)&&(e=e.trim())&&!zN(e)?s(HN(e),n):e!=null&&i(n,e,r),this}get(e,n){if(e=Ar(e),e){const r=Q.findKey(this,e);if(r){const o=this[r];if(!n)return o;if(n===!0)return VN(o);if(Q.isFunction(n))return n.call(this,o,r);if(Q.isRegExp(n))return n.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,n){if(e=Ar(e),e){const r=Q.findKey(this,e);return!!(r&&this[r]!==void 0&&(!n||ds(this,this[r],r,n)))}return!1}delete(e,n){const r=this;let o=!1;function i(s){if(s=Ar(s),s){const a=Q.findKey(r,s);a&&(!n||ds(r,r[a],a,n))&&(delete r[a],o=!0)}}return Q.isArray(e)?e.forEach(i):i(e),o}clear(e){const n=Object.keys(this);let r=n.length,o=!1;for(;r--;){const i=n[r];(!e||ds(this,this[i],i,e,!0))&&(delete this[i],o=!0)}return o}normalize(e){const n=this,r={};return Q.forEach(this,(o,i)=>{const s=Q.findKey(r,i);if(s){n[s]=Bo(o),delete n[i];return}const a=e?$N(i):String(i).trim();a!==i&&delete n[i],n[a]=Bo(o),r[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const n=Object.create(null);return Q.forEach(this,(r,o)=>{r!=null&&r!==!1&&(n[o]=e&&Q.isArray(r)?r.join(", "):r)}),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 r=new this(e);return n.forEach(o=>r.set(o)),r}static accessor(e){const r=(this[X_]=this[X_]={accessors:{}}).accessors,o=this.prototype;function i(s){const a=Ar(s);r[a]||(WN(o,s),r[a]=!0)}return Q.isArray(e)?e.forEach(i):i(e),this}}Pi.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);Q.freezeMethods(Pi.prototype);Q.freezeMethods(Pi);const jt=Pi;function us(t,e){const n=this||_u,r=e||n,o=jt.from(r.headers);let i=r.data;return Q.forEach(t,function(a){i=a.call(n,i,o.normalize(),e?e.status:void 0)}),o.normalize(),i}function xS(t){return!!(t&&t.__CANCEL__)}function lo(t,e,n){De.call(this,t??"canceled",De.ERR_CANCELED,e,n),this.name="CanceledError"}Q.inherits(lo,De,{__CANCEL__:!0});function KN(t,e,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?t(n):e(new De("Request failed with status code "+n.status,[De.ERR_BAD_REQUEST,De.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}const QN=Pt.isStandardBrowserEnv?function(){return{write:function(n,r,o,i,s,a){const l=[];l.push(n+"="+encodeURIComponent(r)),Q.isNumber(o)&&l.push("expires="+new Date(o).toGMTString()),Q.isString(i)&&l.push("path="+i),Q.isString(s)&&l.push("domain="+s),a===!0&&l.push("secure"),document.cookie=l.join("; ")},read:function(n){const r=document.cookie.match(new RegExp("(^|;\\s*)("+n+")=([^;]*)"));return r?decodeURIComponent(r[3]):null},remove:function(n){this.write(n,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}();function jN(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function XN(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}function wS(t,e){return t&&!jN(e)?XN(t,e):e}const ZN=Pt.isStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let r;function o(i){let s=i;return e&&(n.setAttribute("href",s),s=n.href),n.setAttribute("href",s),{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 r=o(window.location.href),function(s){const a=Q.isString(s)?o(s):s;return a.protocol===r.protocol&&a.host===r.host}}():function(){return function(){return!0}}();function JN(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function eA(t,e){t=t||10;const n=new Array(t),r=new Array(t);let o=0,i=0,s;return e=e!==void 0?e:1e3,function(l){const c=Date.now(),d=r[i];s||(s=c),n[o]=l,r[o]=c;let _=i,u=0;for(;_!==o;)u+=n[_++],_=_%t;if(o=(o+1)%t,o===i&&(i=(i+1)%t),c-s{const i=o.loaded,s=o.lengthComputable?o.total:void 0,a=i-n,l=r(a),c=i<=s;n=i;const d={loaded:i,total:s,progress:s?i/s:void 0,bytes:a,rate:l||void 0,estimated:l&&s&&c?(s-i)/l:void 0,event:o};d[e?"download":"upload"]=!0,t(d)}}const tA=typeof XMLHttpRequest<"u",nA=tA&&function(t){return new Promise(function(n,r){let o=t.data;const i=jt.from(t.headers).normalize(),s=t.responseType;let a;function l(){t.cancelToken&&t.cancelToken.unsubscribe(a),t.signal&&t.signal.removeEventListener("abort",a)}Q.isFormData(o)&&(Pt.isStandardBrowserEnv||Pt.isStandardBrowserWebWorkerEnv)&&i.setContentType(!1);let c=new XMLHttpRequest;if(t.auth){const p=t.auth.username||"",g=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";i.set("Authorization","Basic "+btoa(p+":"+g))}const d=wS(t.baseURL,t.url);c.open(t.method.toUpperCase(),NS(d,t.params,t.paramsSerializer),!0),c.timeout=t.timeout;function _(){if(!c)return;const p=jt.from("getAllResponseHeaders"in c&&c.getAllResponseHeaders()),f={data:!s||s==="text"||s==="json"?c.responseText:c.response,status:c.status,statusText:c.statusText,headers:p,config:t,request:c};KN(function(h){n(h),l()},function(h){r(h),l()},f),c=null}if("onloadend"in c?c.onloadend=_:c.onreadystatechange=function(){!c||c.readyState!==4||c.status===0&&!(c.responseURL&&c.responseURL.indexOf("file:")===0)||setTimeout(_)},c.onabort=function(){c&&(r(new De("Request aborted",De.ECONNABORTED,t,c)),c=null)},c.onerror=function(){r(new De("Network Error",De.ERR_NETWORK,t,c)),c=null},c.ontimeout=function(){let g=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded";const f=t.transitional||AS;t.timeoutErrorMessage&&(g=t.timeoutErrorMessage),r(new De(g,f.clarifyTimeoutError?De.ETIMEDOUT:De.ECONNABORTED,t,c)),c=null},Pt.isStandardBrowserEnv){const p=(t.withCredentials||ZN(d))&&t.xsrfCookieName&&QN.read(t.xsrfCookieName);p&&i.set(t.xsrfHeaderName,p)}o===void 0&&i.setContentType(null),"setRequestHeader"in c&&Q.forEach(i.toJSON(),function(g,f){c.setRequestHeader(f,g)}),Q.isUndefined(t.withCredentials)||(c.withCredentials=!!t.withCredentials),s&&s!=="json"&&(c.responseType=t.responseType),typeof t.onDownloadProgress=="function"&&c.addEventListener("progress",Z_(t.onDownloadProgress,!0)),typeof t.onUploadProgress=="function"&&c.upload&&c.upload.addEventListener("progress",Z_(t.onUploadProgress)),(t.cancelToken||t.signal)&&(a=p=>{c&&(r(!p||p.type?new lo(null,t,c):p),c.abort(),c=null)},t.cancelToken&&t.cancelToken.subscribe(a),t.signal&&(t.signal.aborted?a():t.signal.addEventListener("abort",a)));const u=JN(d);if(u&&Pt.protocols.indexOf(u)===-1){r(new De("Unsupported protocol "+u+":",De.ERR_BAD_REQUEST,t));return}c.send(o||null)})},Go={http:NN,xhr:nA};Q.forEach(Go,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const rA={getAdapter:t=>{t=Q.isArray(t)?t:[t];const{length:e}=t;let n,r;for(let o=0;ot instanceof jt?t.toJSON():t;function ur(t,e){e=e||{};const n={};function r(c,d,_){return Q.isPlainObject(c)&&Q.isPlainObject(d)?Q.merge.call({caseless:_},c,d):Q.isPlainObject(d)?Q.merge({},d):Q.isArray(d)?d.slice():d}function o(c,d,_){if(Q.isUndefined(d)){if(!Q.isUndefined(c))return r(void 0,c,_)}else return r(c,d,_)}function i(c,d){if(!Q.isUndefined(d))return r(void 0,d)}function s(c,d){if(Q.isUndefined(d)){if(!Q.isUndefined(c))return r(void 0,c)}else return r(void 0,d)}function a(c,d,_){if(_ in e)return r(c,d);if(_ in t)return r(void 0,c)}const l={url:i,method:i,data:i,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(c,d)=>o(ep(c),ep(d),!0)};return Q.forEach(Object.keys(t).concat(Object.keys(e)),function(d){const _=l[d]||o,u=_(t[d],e[d],d);Q.isUndefined(u)&&_!==a||(n[d]=u)}),n}const DS="1.3.6",pu={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{pu[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}});const tp={};pu.transitional=function(e,n,r){function o(i,s){return"[Axios v"+DS+"] Transitional option '"+i+"'"+s+(r?". "+r:"")}return(i,s,a)=>{if(e===!1)throw new De(o(s," has been removed"+(n?" in "+n:"")),De.ERR_DEPRECATED);return n&&!tp[s]&&(tp[s]=!0,console.warn(o(s," has been deprecated since v"+n+" and will be removed in the near future"))),e?e(i,s,a):!0}};function oA(t,e,n){if(typeof t!="object")throw new De("options must be an object",De.ERR_BAD_OPTION_VALUE);const r=Object.keys(t);let o=r.length;for(;o-- >0;){const i=r[o],s=e[i];if(s){const a=t[i],l=a===void 0||s(a,i,t);if(l!==!0)throw new De("option "+i+" must be "+l,De.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new De("Unknown option "+i,De.ERR_BAD_OPTION)}}const Cd={assertOptions:oA,validators:pu},an=Cd.validators;class ei{constructor(e){this.defaults=e,this.interceptors={request:new j_,response:new j_}}request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=ur(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:i}=n;r!==void 0&&Cd.assertOptions(r,{silentJSONParsing:an.transitional(an.boolean),forcedJSONParsing:an.transitional(an.boolean),clarifyTimeoutError:an.transitional(an.boolean)},!1),o!=null&&(Q.isFunction(o)?n.paramsSerializer={serialize:o}:Cd.assertOptions(o,{encode:an.function,serialize:an.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let s;s=i&&Q.merge(i.common,i[n.method]),s&&Q.forEach(["delete","get","head","post","put","patch","common"],g=>{delete i[g]}),n.headers=jt.concat(s,i);const a=[];let l=!0;this.interceptors.request.forEach(function(f){typeof f.runWhen=="function"&&f.runWhen(n)===!1||(l=l&&f.synchronous,a.unshift(f.fulfilled,f.rejected))});const c=[];this.interceptors.response.forEach(function(f){c.push(f.fulfilled,f.rejected)});let d,_=0,u;if(!l){const g=[J_.bind(this),void 0];for(g.unshift.apply(g,a),g.push.apply(g,c),u=g.length,d=Promise.resolve(n);_{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](o);r._listeners=null}),this.promise.then=o=>{let i;const s=new Promise(a=>{r.subscribe(a),i=a}).then(o);return s.cancel=function(){r.unsubscribe(i)},s},e(function(i,s,a){r.reason||(r.reason=new lo(i,s,a),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}static source(){let e;return{token:new mu(function(o){e=o}),cancel:e}}}const iA=mu;function sA(t){return function(n){return t.apply(null,n)}}function aA(t){return Q.isObject(t)&&t.isAxiosError===!0}const Rd={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Rd).forEach(([t,e])=>{Rd[e]=t});const lA=Rd;function MS(t){const e=new qo(t),n=gS(qo.prototype.request,e);return Q.extend(n,qo.prototype,e,{allOwnKeys:!0}),Q.extend(n,e,null,{allOwnKeys:!0}),n.create=function(o){return MS(ur(t,o))},n}const Xe=MS(_u);Xe.Axios=qo;Xe.CanceledError=lo;Xe.CancelToken=iA;Xe.isCancel=xS;Xe.VERSION=DS;Xe.toFormData=Li;Xe.AxiosError=De;Xe.Cancel=Xe.CanceledError;Xe.all=function(e){return Promise.all(e)};Xe.spread=sA;Xe.isAxiosError=aA;Xe.mergeConfig=ur;Xe.AxiosHeaders=jt;Xe.formToJSON=t=>IS(Q.isHTMLForm(t)?new FormData(t):t);Xe.HttpStatusCode=lA;Xe.default=Xe;const qe=Xe,cA={data(){return{show:!1,message:""}},methods:{hide(){this.show=!1,this.$emit("ok")},showMessage(t){this.message=t,this.show=!0}}},dA={key:0,class:"fixed top-0 left-0 right-0 bottom-0 flex items-center justify-center bg-black bg-opacity-50"},uA={class:"bg-bg-light dark:bg-bg-dark p-8 rounded-lg shadow-lg"},_A={class:"text-lg font-medium"},pA={class:"mt-4 flex justify-center"};function mA(t,e,n,r,o,i){return o.show?(J(),oe("div",dA,[m("div",uA,[m("h3",_A,fe(o.message),1),m("div",pA,[m("button",{onClick:e[0]||(e[0]=(...s)=>i.hide&&i.hide(...s)),class:"bg-primary hover:bg-primary-light active:scale-95 duration-150 text-white px-4 py-2 rounded-lg shadow-lg hover:bg-secondary-dark"}," OK ")])])])):he("",!0)}const gA=et(cA,[["render",mA]]),fA={data(){return{show:!1,message:"",resolve:null}},methods:{hide(t){this.show=!1,this.resolve&&(this.resolve(t),this.resolve=null)},askQuestion(t){return new Promise(e=>{this.message=t,this.show=!0,this.resolve=e})}}},hA={key:0,class:"fixed top-0 left-0 right-0 bottom-0 flex items-center justify-center bg-black bg-opacity-50"},EA={class:"relative w-full max-w-md max-h-full"},SA={class:"relative bg-white rounded-lg shadow dark:bg-gray-700"},bA=m("svg",{"aria-hidden":"true",class:"w-5 h-5",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},[m("path",{"fill-rule":"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z","clip-rule":"evenodd"})],-1),TA=m("span",{class:"sr-only"},"Close modal",-1),yA=[bA,TA],vA={class:"p-4 text-center"},CA=m("svg",{"aria-hidden":"true",class:"mx-auto mb-4 text-gray-400 w-14 h-14 dark:text-gray-200",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[m("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})],-1),RA={class:"mb-5 text-lg font-normal text-gray-500 dark:text-gray-400 select-none"};function OA(t,e,n,r,o,i){return o.show?(J(),oe("div",hA,[m("div",EA,[m("div",SA,[m("button",{type:"button",onClick:e[0]||(e[0]=s=>i.hide(!1)),class:"absolute top-3 right-2.5 text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 ml-auto inline-flex items-center dark:hover:bg-gray-800 dark:hover:text-white"},yA),m("div",vA,[CA,m("h3",RA,fe(o.message),1),m("button",{onClick:e[1]||(e[1]=s=>i.hide(!0)),type:"button",class:"text-white bg-red-600 hover:bg-red-800 focus:ring-4 focus:outline-none focus:ring-red-300 dark:focus:ring-red-800 font-medium rounded-lg text-sm inline-flex items-center px-5 py-2.5 text-center mr-2"}," Yes, I'm sure "),m("button",{onClick:e[2]||(e[2]=s=>i.hide(!1)),type:"button",class:"text-gray-500 bg-white hover:bg-gray-100 focus:ring-4 focus:outline-none focus:ring-gray-200 rounded-lg border border-gray-200 text-sm font-medium px-5 py-2.5 hover:text-gray-900 focus:z-10 dark:bg-gray-700 dark:text-gray-300 dark:border-gray-500 dark:hover:text-white dark:hover:bg-gray-600 dark:focus:ring-gray-600"},"No, cancel")])])])])):he("",!0)}const NA=et(fA,[["render",OA]]);const AA={name:"Toast",props:{},data(){return{show:!1,success:!0,message:"",toastArr:[]}},methods:{close(t){this.toastArr=this.toastArr.filter(e=>e.id!=t)},showToast(t,e=3,n=!0){const r=parseInt((new Date().getTime()*Math.random()).toString()).toString(),o={id:r,success:n,message:t,show:!0};this.toastArr.push(o),Te(()=>{Ce.replace()}),setTimeout(()=>{this.toastArr=this.toastArr.filter(i=>i.id!=r)},e*1e3)}},watch:{}},Tr=t=>(vi("data-v-aac71c39"),t=t(),Ci(),t),IA={class:"absolute bottom-16 right-2 z-20 flex flex-col gap-3 min-w-[300px]"},xA={class:"flex items-center w-full max-w-xs p-4 mb-4 text-gray-500 bg-white rounded-lg shadow dark:text-gray-400 dark:bg-gray-800",role:"alert"},wA={class:"flex flex-row items-center"},DA={key:0,class:"inline-flex items-center justify-center flex-shrink-0 w-8 h-8 text-green-500 bg-green-100 rounded-lg dark:bg-green-800 dark:text-green-200"},MA=Tr(()=>m("i",{"data-feather":"check"},null,-1)),LA=Tr(()=>m("span",{class:"sr-only"},"Check icon",-1)),kA=[MA,LA],PA={key:1,class:"inline-flex items-center justify-center flex-shrink-0 w-8 h-8 text-red-500 bg-red-100 rounded-lg dark:bg-red-800 dark:text-red-200"},FA=Tr(()=>m("i",{"data-feather":"x"},null,-1)),UA=Tr(()=>m("span",{class:"sr-only"},"Cross icon",-1)),BA=[FA,UA],GA={class:"ml-3 text-sm font-normal whitespace-pre-wrap"},qA=["onClick"],YA=Tr(()=>m("span",{class:"sr-only"},"Close",-1)),HA=Tr(()=>m("svg",{"aria-hidden":"true",class:"w-5 h-5",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},[m("path",{"fill-rule":"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z","clip-rule":"evenodd"})],-1)),VA=[YA,HA];function zA(t,e,n,r,o,i){return J(),oe("div",IA,[Ie(Sn,{name:"toastItem",tag:"div"},{default:nt(()=>[(J(!0),oe(Be,null,At(o.toastArr,s=>(J(),oe("div",{key:s.id},[m("div",xA,[m("div",wA,[AE(t.$slots,"default",{},()=>[s.success?(J(),oe("div",DA,kA)):he("",!0),s.success?he("",!0):(J(),oe("div",PA,BA)),m("div",GA,fe(s.message),1)],!0)]),m("button",{type:"button",onClick:a=>i.close(s.id),class:"ml-auto -mx-1.5 -my-1.5 bg-white text-gray-400 hover:text-gray-900 rounded-lg focus:ring-2 focus:ring-gray-300 p-1.5 hover:bg-gray-100 inline-flex h-8 w-8 dark:text-gray-500 dark:hover:text-white dark:bg-gray-800 dark:hover:bg-gray-700"},VA,8,qA)])]))),128))]),_:3})])}const gu=et(AA,[["render",zA],["__scopeId","data-v-aac71c39"]]),Od="/assets/default_model-9e24e852.png",$A={props:{title:String,icon:String,path:String,owner:String,owner_link:String,license:String,description:String,isInstalled:Boolean,onInstall:Function,onUninstall:Function,onSelected:Function,onCopy:Function,selected:Boolean,model:Object,model_type:String},data(){return{progress:0,installing:!1,uninstalling:!1,failedToLoad:!1,fileSize:"",linkNotValid:!1}},async mounted(){this.fileSize=await this.getFileSize(this.model.path),Te(()=>{Ce.replace()})},methods:{computedFileSize(t){return Jo(t)},async getFileSize(t){if(this.model_type!="api")try{const e=await qe.head(t);return e?e.headers["content-length"]?this.computedFileSize(e.headers["content-length"]):this.model.filesize?this.computedFileSize(this.model.filesize):"Could not be determined":this.model.filesize?this.computedFileSize(this.model.filesize):"Could not be determined"}catch(e){return console.log(e.message,"getFileSize"),this.linkNotValid=!0,"Could not be determined"}},getImgUrl(){return this.icon==="/images/default_model.png"?Od:this.icon},defaultImg(t){t.target.src=Od},toggleInstall(){this.isInstalled?(this.uninstalling=!0,this.onUninstall(this)):(this.installing=!0,this.onInstall(this))},toggleSelected(){this.onSelected(this)},toggleCopy(){this.onCopy(this)},handleSelection(){this.isInstalled&&!this.selected&&this.onSelected(this)},copyContentToClipboard(){console.log("asdasdas"),this.$emit("copy","this.message.content")}},watch:{linkNotValid(){Te(()=>{Ce.replace()})}}},WA={key:0,class:"flex-1"},KA={class:"flex gap-3 items-center"},QA=["src"],jA={class:"font-bold font-large text-lg"},XA={key:1,class:"flex-1"},ZA={class:"flex flex-row gap-3 items-center"},JA=["src"],eI={class:"font-bold font-large text-lg"},tI=m("div",{class:"flex-grow"},null,-1),nI={class:"flex flex-shrink-0 items-center"},rI=m("i",{"data-feather":"download",class:"w-5 m-1"},null,-1),oI=m("b",null,"Manual download: ",-1),iI=["href"],sI={class:"flex flex-shrink-0 items-center"},aI=m("i",{"data-feather":"file",class:"w-5 m-1"},null,-1),lI=m("b",null,"File size: ",-1),cI={class:"flex flex-shrink-0 items-center"},dI=m("i",{"data-feather":"key",class:"w-5 m-1"},null,-1),uI=m("b",null,"License: ",-1),_I={class:"flex flex-shrink-0 items-center"},pI=m("i",{"data-feather":"user",class:"w-5 m-1"},null,-1),mI=m("b",null,"Owner: ",-1),gI=["href"],fI=m("div",{class:"flex items-center"},[m("i",{"data-feather":"info",class:"w-5 m-1"}),m("b",null,"Description: "),m("br")],-1),hI={class:"mx-1 opacity-80"},EI={class:"flex flex-row flex-shrink-0 items-center"},SI=m("i",{"data-feather":"clipboard"},null,-1),bI=[SI],TI=["disabled"],yI={key:0,class:"flex items-center space-x-2"},vI={class:"h-2 w-20 bg-gray-300 rounded"},CI={key:1,class:"flex items-center space-x-2"},RI={class:"h-2 w-20 bg-gray-300 rounded"},OI=m("span",null,"Uninstalling...",-1);function NI(t,e,n,r,o,i){return J(),oe("div",{class:Le(["flex items-center p-4 hover:bg-primary-light rounded-lg mb-2 shadow-lg border-2 cursor-pointer active:opacity-80 duration-75",n.selected?" border-primary-light":"border-transparent"]),onClick:e[6]||(e[6]=ye((...s)=>i.toggleSelected&&i.toggleSelected(...s),["stop"]))},[n.model.isCustomModel?(J(),oe("div",WA,[m("div",KA,[m("img",{src:i.getImgUrl(),onError:e[0]||(e[0]=s=>i.defaultImg(s)),class:"w-10 h-10 rounded-lg object-fill"},null,40,QA),m("h3",jA,fe(n.title),1)])])):he("",!0),n.model.isCustomModel?he("",!0):(J(),oe("div",XA,[m("div",ZA,[m("img",{ref:"imgElement",src:i.getImgUrl(),onError:e[1]||(e[1]=s=>i.defaultImg(s)),class:Le(["w-10 h-10 rounded-lg object-fill",o.linkNotValid?"grayscale":""])},null,42,JA),m("h3",eI,fe(n.title),1),tI]),m("div",nI,[rI,oI,m("a",{href:n.path,onClick:e[2]||(e[2]=ye(()=>{},["stop"])),class:"flex items-center hover:text-secondary duration-75 active:scale-90",title:"Download this manually (faster) and put it in the models/ folder then refresh"},fe(n.title),9,iI)]),m("div",sI,[m("div",{class:Le(["flex flex-shrink-0 items-center",o.linkNotValid?"text-red-600":""])},[aI,lI,ke(" "+fe(o.fileSize),1)],2)]),m("div",cI,[dI,uI,ke(" "+fe(n.license),1)]),m("div",_I,[pI,mI,m("a",{href:n.owner_link,target:"_blank",rel:"noopener noreferrer",onClick:e[3]||(e[3]=ye(()=>{},["stop"])),class:"flex hover:text-secondary duration-75 active:scale-90",title:"Owner's profile"},fe(n.owner),9,gI)]),fI,m("p",hI,fe(n.description),1)])),m("div",EI,[m("button",{class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2",title:"Copy model info to clipboard",onClick:e[4]||(e[4]=ye(s=>i.toggleCopy(),["stop"]))},bI),n.model_type!=="api"?(J(),oe("button",{key:0,class:Le(["px-4 py-2 rounded-md text-white font-bold transition-colors duration-300",[n.isInstalled?"bg-red-500 hover:bg-red-600":o.linkNotValid?"bg-gray-500 hover:bg-gray-600":"bg-green-500 hover:bg-green-600"]]),disabled:o.installing||o.uninstalling,onClick:e[5]||(e[5]=ye((...s)=>i.toggleInstall&&i.toggleInstall(...s),["stop"]))},[o.installing?(J(),oe("div",yI,[m("div",vI,[m("div",{style:bn({width:o.progress+"%"}),class:"h-full bg-red-500 rounded"},null,4)]),m("span",null,"Installing..."+fe(Math.floor(o.progress))+"%",1)])):o.uninstalling?(J(),oe("div",CI,[m("div",RI,[m("div",{style:bn({width:o.progress+"%"}),class:"h-full bg-green-500"},null,4)]),OI])):(J(),oe(Be,{key:2},[ke(fe(n.isInstalled?n.model.isCustomModel?"Delete":"Uninstall":o.linkNotValid?"Link is not valid":"Install"),1)],64))],10,TI)):he("",!0)])],2)}const AI=et($A,[["render",NI]]),II={data(){return{editMode:!1,avatar:"path/to/avatar.jpg",personalityName:"Personality Name",personalityAuthor:"Author Name",personalityDescription:"Personality Description",personalityLanguage:"English",personalityCategory:"Category",disclaimer:"Disclaimer text",conditioningText:"Conditioning Text",aiPrefix:"AI Prefix",userPrefix:"User Prefix",antipromptsList:[{id:1,text:"Antiprompt 1"},{id:2,text:"Antiprompt 2"},{id:3,text:"Antiprompt 3"}]}},methods:{commitChanges(){console.log("Personality changes committed"),this.editMode=!1}}},xI={class:"p-4"},wI={class:"flex items-center mb-4"},DI=["src"],MI={class:"text-lg font-semibold"},LI=m("strong",null,"Author:",-1),kI=m("strong",null,"Description:",-1),PI=m("strong",null,"Language:",-1),FI=m("strong",null,"Category:",-1),UI={key:0},BI=m("strong",null,"Disclaimer:",-1),GI=m("strong",null,"Conditioning Text:",-1),qI=m("strong",null,"AI Prefix:",-1),YI=m("strong",null,"User Prefix:",-1),HI=m("strong",null,"Antiprompts:",-1);function VI(t,e,n,r,o,i){return J(),oe("div",xI,[m("div",wI,[m("img",{src:o.avatar,class:"w-12 h-12 rounded-full mr-2",alt:"Avatar"},null,8,DI),m("h2",MI,fe(o.personalityName),1)]),m("p",null,[LI,ke(" "+fe(o.personalityAuthor),1)]),m("p",null,[kI,ke(" "+fe(o.personalityDescription),1)]),m("p",null,[PI,ke(" "+fe(o.personalityLanguage),1)]),m("p",null,[FI,ke(" "+fe(o.personalityCategory),1)]),o.disclaimer?(J(),oe("p",UI,[BI,ke(" "+fe(o.disclaimer),1)])):he("",!0),m("p",null,[GI,ke(" "+fe(o.conditioningText),1)]),m("p",null,[qI,ke(" "+fe(o.aiPrefix),1)]),m("p",null,[YI,ke(" "+fe(o.userPrefix),1)]),m("div",null,[HI,m("ul",null,[(J(!0),oe(Be,null,At(o.antipromptsList,s=>(J(),oe("li",{key:s.id},fe(s.text),1))),128))])]),m("button",{onClick:e[0]||(e[0]=s=>o.editMode=!0),class:"mt-4 bg-blue-500 text-white px-4 py-2 rounded"}," Edit "),o.editMode?(J(),oe("button",{key:1,onClick:e[1]||(e[1]=(...s)=>i.commitChanges&&i.commitChanges(...s)),class:"mt-4 bg-green-500 text-white px-4 py-2 rounded"}," Commit ")):he("",!0)])}const zI=et(II,[["render",VI]]),$I="/assets/default_user-17642e5a.svg",WI="/",KI={props:{personality:{},onSelected:Function,selected:Boolean},data(){return{}},mounted(){Te(()=>{Ce.replace()})},methods:{getImgUrl(){return WI+this.personality.avatar},defaultImg(t){t.target.src=Yn},toggleSelected(){this.onSelected(this)}}},QI={class:"flex flex-row items-center flex-shrink-0 gap-3"},jI=["src"],XI={class:"font-bold font-large text-lg line-clamp-3"},ZI={class:""},JI={class:""},ex={class:"flex items-center"},tx=m("i",{"data-feather":"user",class:"w-5 m-1"},null,-1),nx=m("b",null,"Author: ",-1),rx=m("div",{class:"flex items-center"},[m("i",{"data-feather":"info",class:"w-5 m-1"}),m("b",null,"Description: "),m("br")],-1),ox=["title"];function ix(t,e,n,r,o,i){return J(),oe("div",{class:Le(["items-start p-4 hover:bg-primary-light rounded-lg mb-2 shadow-lg border-2 cursor-pointer active:scale-95 duration-75 select-none",n.selected?" border-primary-light":"border-transparent"]),onClick:e[1]||(e[1]=ye((...s)=>i.toggleSelected&&i.toggleSelected(...s),["stop"]))},[m("div",QI,[m("img",{ref:"imgElement",src:i.getImgUrl(),onError:e[0]||(e[0]=s=>i.defaultImg(s)),class:"w-10 h-10 rounded-full object-fill text-red-700"},null,40,jI),m("h3",XI,fe(n.personality.name),1)]),m("div",ZI,[m("div",JI,[m("div",ex,[tx,nx,ke(" "+fe(n.personality.author),1)])]),rx,m("p",{class:"mx-1 opacity-80 line-clamp-3",title:n.personality.description},fe(n.personality.description),9,ox)])],2)}const sx=et(KI,[["render",ix]]),ax="/",lx={props:{binding:{},onSelected:Function,selected:Boolean},data(){return{isTemplate:!1,hasAdvancedSettings:!1}},mounted(){Te(()=>{Ce.replace()})},methods:{getImgUrl(){return ax+this.binding.icon},defaultImg(t){t.target.src=Yn},toggleSelected(){this.onSelected(this)},getStatus(){(this.binding.folder==="backend_template"||this.binding.folder==="binding_template")&&(this.isTemplate=!0)}}},cx={class:"flex flex-row items-center gap-3"},dx=["src"],ux={class:"font-bold font-large text-lg truncate"},_x=m("div",{class:"grow"},null,-1),px={key:0,class:"flex-none"},mx=m("i",{"data-feather":"sliders",class:"w-5 m-1"},null,-1),gx=m("span",{class:"sr-only"},"Icon description",-1),fx=[mx,gx],hx={class:""},Ex={class:""},Sx={class:"flex items-center"},bx=m("i",{"data-feather":"user",class:"w-5 m-1"},null,-1),Tx=m("b",null,"Author: ",-1),yx={class:"flex items-center"},vx=m("i",{"data-feather":"folder",class:"w-5 m-1"},null,-1),Cx=m("b",null,"Folder: ",-1),Rx={class:"flex items-center"},Ox=m("i",{"data-feather":"git-merge",class:"w-5 m-1"},null,-1),Nx=m("b",null,"Version: ",-1),Ax=["href"],Ix=m("i",{"data-feather":"github",class:"w-5 m-1"},null,-1),xx=m("b",null,"Link: ",-1),wx=m("div",{class:"flex items-center"},[m("i",{"data-feather":"info",class:"w-5 m-1"}),m("b",null,"Description: "),m("br")],-1),Dx=["title"];function Mx(t,e,n,r,o,i){return J(),oe("div",{class:Le(["items-start p-4 hover:bg-primary-light rounded-lg mb-2 shadow-lg border-2 cursor-pointer active:scale-95 duration-75 select-none",n.selected?" border-primary-light":"border-transparent"]),onClick:e[2]||(e[2]=ye((...s)=>i.toggleSelected&&i.toggleSelected(...s),["stop"]))},[m("div",{class:Le(o.isTemplate?"opacity-50":"")},[m("div",cx,[m("img",{ref:"imgElement",src:i.getImgUrl(),onError:e[0]||(e[0]=s=>i.defaultImg(s)),class:"w-10 h-10 rounded-full object-fill text-blue-700"},null,40,dx),m("h3",ux,fe(n.binding.name),1),_x,o.hasAdvancedSettings?(J(),oe("div",px,[m("button",{type:"button",title:"Not implemented",class:"hover:text-secondary duration-75 active:scale-90 font-medium rounded-lg text-sm p-2 text-center inline-flex items-center",onClick:e[1]||(e[1]=ye(()=>{},["stop"]))},fx)])):he("",!0)]),m("div",hx,[m("div",Ex,[m("div",Sx,[bx,Tx,ke(" "+fe(n.binding.author),1)]),m("div",yx,[vx,Cx,ke(" "+fe(n.binding.folder),1)]),m("div",Rx,[Ox,Nx,ke(" "+fe(n.binding.version),1)]),m("a",{href:n.binding.link,target:"_blank",class:"flex items-center"},[Ix,xx,ke(" "+fe(n.binding.link),1)],8,Ax)]),wx,m("p",{class:"mx-1 opacity-80 line-clamp-3",title:n.binding.description},fe(n.binding.description),9,Dx)])],2)],2)}const Lx=et(lx,[["render",Mx]]),Yt=Object.create(null);Yt.open="0";Yt.close="1";Yt.ping="2";Yt.pong="3";Yt.message="4";Yt.upgrade="5";Yt.noop="6";const Yo=Object.create(null);Object.keys(Yt).forEach(t=>{Yo[Yt[t]]=t});const kx={type:"error",data:"parser error"},Px=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",Fx=typeof ArrayBuffer=="function",Ux=t=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(t):t&&t.buffer instanceof ArrayBuffer,LS=({type:t,data:e},n,r)=>Px&&e instanceof Blob?n?r(e):np(e,r):Fx&&(e instanceof ArrayBuffer||Ux(e))?n?r(e):np(new Blob([e]),r):r(Yt[t]+(e||"")),np=(t,e)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];e("b"+(r||""))},n.readAsDataURL(t)},rp="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Mr=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let t=0;t{let e=t.length*.75,n=t.length,r,o=0,i,s,a,l;t[t.length-1]==="="&&(e--,t[t.length-2]==="="&&e--);const c=new ArrayBuffer(e),d=new Uint8Array(c);for(r=0;r>4,d[o++]=(s&15)<<4|a>>2,d[o++]=(a&3)<<6|l&63;return c},Gx=typeof ArrayBuffer=="function",kS=(t,e)=>{if(typeof t!="string")return{type:"message",data:PS(t,e)};const n=t.charAt(0);return n==="b"?{type:"message",data:qx(t.substring(1),e)}:Yo[n]?t.length>1?{type:Yo[n],data:t.substring(1)}:{type:Yo[n]}:kx},qx=(t,e)=>{if(Gx){const n=Bx(t);return PS(n,e)}else return{base64:!0,data:t}},PS=(t,e)=>{switch(e){case"blob":return t instanceof ArrayBuffer?new Blob([t]):t;case"arraybuffer":default:return t}},FS=String.fromCharCode(30),Yx=(t,e)=>{const n=t.length,r=new Array(n);let o=0;t.forEach((i,s)=>{LS(i,!1,a=>{r[s]=a,++o===n&&e(r.join(FS))})})},Hx=(t,e)=>{const n=t.split(FS),r=[];for(let o=0;otypeof self<"u"?self:typeof window<"u"?window:Function("return this")())();function BS(t,...e){return e.reduce((n,r)=>(t.hasOwnProperty(r)&&(n[r]=t[r]),n),{})}const zx=ht.setTimeout,$x=ht.clearTimeout;function Fi(t,e){e.useNativeTimers?(t.setTimeoutFn=zx.bind(ht),t.clearTimeoutFn=$x.bind(ht)):(t.setTimeoutFn=ht.setTimeout.bind(ht),t.clearTimeoutFn=ht.clearTimeout.bind(ht))}const Wx=1.33;function Kx(t){return typeof t=="string"?Qx(t):Math.ceil((t.byteLength||t.size)*Wx)}function Qx(t){let e=0,n=0;for(let r=0,o=t.length;r=57344?n+=3:(r++,n+=4);return n}class jx extends Error{constructor(e,n,r){super(e),this.description=n,this.context=r,this.type="TransportError"}}class GS extends je{constructor(e){super(),this.writable=!1,Fi(this,e),this.opts=e,this.query=e.query,this.socket=e.socket}onError(e,n,r){return super.emitReserved("error",new jx(e,n,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(e){this.readyState==="open"&&this.write(e)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){const n=kS(e,this.socket.binaryType);this.onPacket(n)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}pause(e){}}const qS="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),Nd=64,Xx={};let op=0,yo=0,ip;function sp(t){let e="";do e=qS[t%Nd]+e,t=Math.floor(t/Nd);while(t>0);return e}function YS(){const t=sp(+new Date);return t!==ip?(op=0,ip=t):t+"."+sp(op++)}for(;yo{this.readyState="paused",e()};if(this.polling||!this.writable){let r=0;this.polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}poll(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};Hx(e,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this.polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this.poll())}doClose(){const e=()=>{this.write([{type:"close"}])};this.readyState==="open"?e():this.once("open",e)}write(e){this.writable=!1,Yx(e,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){let e=this.query||{};const n=this.opts.secure?"https":"http";let r="";this.opts.timestampRequests!==!1&&(e[this.opts.timestampParam]=YS()),!this.supportsBinary&&!e.sid&&(e.b64=1),this.opts.port&&(n==="https"&&Number(this.opts.port)!==443||n==="http"&&Number(this.opts.port)!==80)&&(r=":"+this.opts.port);const o=HS(e),i=this.opts.hostname.indexOf(":")!==-1;return n+"://"+(i?"["+this.opts.hostname+"]":this.opts.hostname)+r+this.opts.path+(o.length?"?"+o:"")}request(e={}){return Object.assign(e,{xd:this.xd,xs:this.xs},this.opts),new Bt(this.uri(),e)}doWrite(e,n){const r=this.request({method:"POST",data:e});r.on("success",n),r.on("error",(o,i)=>{this.onError("xhr post error",o,i)})}doPoll(){const e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=e}}class Bt extends je{constructor(e,n){super(),Fi(this,n),this.opts=n,this.method=n.method||"GET",this.uri=e,this.async=n.async!==!1,this.data=n.data!==void 0?n.data:null,this.create()}create(){const e=BS(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");e.xdomain=!!this.opts.xd,e.xscheme=!!this.opts.xs;const n=this.xhr=new zS(e);try{n.open(this.method,this.uri,this.async);try{if(this.opts.extraHeaders){n.setDisableHeaderCheck&&n.setDisableHeaderCheck(!0);for(let r in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(r)&&n.setRequestHeader(r,this.opts.extraHeaders[r])}}catch{}if(this.method==="POST")try{n.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{n.setRequestHeader("Accept","*/*")}catch{}"withCredentials"in n&&(n.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(n.timeout=this.opts.requestTimeout),n.onreadystatechange=()=>{n.readyState===4&&(n.status===200||n.status===1223?this.onLoad():this.setTimeoutFn(()=>{this.onError(typeof n.status=="number"?n.status:0)},0))},n.send(this.data)}catch(r){this.setTimeoutFn(()=>{this.onError(r)},0);return}typeof document<"u"&&(this.index=Bt.requestsCount++,Bt.requests[this.index]=this)}onError(e){this.emitReserved("error",e,this.xhr),this.cleanup(!0)}cleanup(e){if(!(typeof this.xhr>"u"||this.xhr===null)){if(this.xhr.onreadystatechange=ew,e)try{this.xhr.abort()}catch{}typeof document<"u"&&delete Bt.requests[this.index],this.xhr=null}}onLoad(){const e=this.xhr.responseText;e!==null&&(this.emitReserved("data",e),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}}Bt.requestsCount=0;Bt.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",ap);else if(typeof addEventListener=="function"){const t="onpagehide"in ht?"pagehide":"unload";addEventListener(t,ap,!1)}}function ap(){for(let t in Bt.requests)Bt.requests.hasOwnProperty(t)&&Bt.requests[t].abort()}const $S=(()=>typeof Promise=="function"&&typeof Promise.resolve=="function"?e=>Promise.resolve().then(e):(e,n)=>n(e,0))(),vo=ht.WebSocket||ht.MozWebSocket,lp=!0,rw="arraybuffer",cp=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class ow extends GS{constructor(e){super(e),this.supportsBinary=!e.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const e=this.uri(),n=this.opts.protocols,r=cp?{}:BS(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=lp&&!cp?n?new vo(e,n):new vo(e):new vo(e,n,r)}catch(o){return this.emitReserved("error",o)}this.ws.binaryType=this.socket.binaryType||rw,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let n=0;n{const s={};try{lp&&this.ws.send(i)}catch{}o&&$S(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.close(),this.ws=null)}uri(){let e=this.query||{};const n=this.opts.secure?"wss":"ws";let r="";this.opts.port&&(n==="wss"&&Number(this.opts.port)!==443||n==="ws"&&Number(this.opts.port)!==80)&&(r=":"+this.opts.port),this.opts.timestampRequests&&(e[this.opts.timestampParam]=YS()),this.supportsBinary||(e.b64=1);const o=HS(e),i=this.opts.hostname.indexOf(":")!==-1;return n+"://"+(i?"["+this.opts.hostname+"]":this.opts.hostname)+r+this.opts.path+(o.length?"?"+o:"")}check(){return!!vo}}const iw={websocket:ow,polling:nw},sw=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,aw=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Ad(t){const e=t,n=t.indexOf("["),r=t.indexOf("]");n!=-1&&r!=-1&&(t=t.substring(0,n)+t.substring(n,r).replace(/:/g,";")+t.substring(r,t.length));let o=sw.exec(t||""),i={},s=14;for(;s--;)i[aw[s]]=o[s]||"";return n!=-1&&r!=-1&&(i.source=e,i.host=i.host.substring(1,i.host.length-1).replace(/;/g,":"),i.authority=i.authority.replace("[","").replace("]","").replace(/;/g,":"),i.ipv6uri=!0),i.pathNames=lw(i,i.path),i.queryKey=cw(i,i.query),i}function lw(t,e){const n=/\/{2,9}/g,r=e.replace(n,"/").split("/");return(e.slice(0,1)=="/"||e.length===0)&&r.splice(0,1),e.slice(-1)=="/"&&r.splice(r.length-1,1),r}function cw(t,e){const n={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,o,i){o&&(n[o]=i)}),n}let WS=class Xn extends je{constructor(e,n={}){super(),this.writeBuffer=[],e&&typeof e=="object"&&(n=e,e=null),e?(e=Ad(e),n.hostname=e.host,n.secure=e.protocol==="https"||e.protocol==="wss",n.port=e.port,e.query&&(n.query=e.query)):n.host&&(n.hostname=Ad(n.host).host),Fi(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=n.transports||["polling","websocket"],this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!0},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=Zx(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,typeof addEventListener=="function"&&(this.opts.closeOnBeforeunload&&(this.beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this.beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(e){const n=Object.assign({},this.opts.query);n.EIO=US,n.transport=e,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts.transportOptions[e],this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port});return new iw[e](r)}open(){let e;if(this.opts.rememberUpgrade&&Xn.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)e="websocket";else if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}else e=this.transports[0];this.readyState="opening";try{e=this.createTransport(e)}catch{this.transports.shift(),this.open();return}e.open(),this.setTransport(e)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",n=>this.onClose("transport close",n))}probe(e){let n=this.createTransport(e),r=!1;Xn.priorWebsocketSuccess=!1;const o=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",_=>{if(!r)if(_.type==="pong"&&_.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;Xn.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(d(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const u=new Error("probe error");u.transport=n.name,this.emitReserved("upgradeError",u)}}))};function i(){r||(r=!0,d(),n.close(),n=null)}const s=_=>{const u=new Error("probe error: "+_);u.transport=n.name,i(),this.emitReserved("upgradeError",u)};function a(){s("transport closed")}function l(){s("socket closed")}function c(_){n&&_.name!==n.name&&i()}const d=()=>{n.removeListener("open",o),n.removeListener("error",s),n.removeListener("close",a),this.off("close",l),this.off("upgrading",c)};n.once("open",o),n.once("error",s),n.once("close",a),this.once("close",l),this.once("upgrading",c),n.open()}onOpen(){if(this.readyState="open",Xn.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush(),this.readyState==="open"&&this.opts.upgrade){let e=0;const n=this.upgrades.length;for(;e{this.onClose("ping timeout")},this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const e=this.getWritablePackets();this.transport.send(e),this.prevBufferLen=e.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r0&&n>this.maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}write(e,n,r){return this.sendPacket("message",e,n,r),this}send(e,n,r){return this.sendPacket("message",e,n,r),this}sendPacket(e,n,r,o){if(typeof n=="function"&&(o=n,n=void 0),typeof r=="function"&&(o=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const i={type:e,data:n,options:r};this.emitReserved("packetCreate",i),this.writeBuffer.push(i),o&&this.once("flush",o),this.flush()}close(){const e=()=>{this.onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),e()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():e()}):this.upgrading?r():e()),this}onError(e){Xn.priorWebsocketSuccess=!1,this.emitReserved("error",e),this.onClose("transport error",e)}onClose(e,n){(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")&&(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),typeof removeEventListener=="function"&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",e,n),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(e){const n=[];let r=0;const o=e.length;for(;rtypeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(t):t.buffer instanceof ArrayBuffer,KS=Object.prototype.toString,pw=typeof Blob=="function"||typeof Blob<"u"&&KS.call(Blob)==="[object BlobConstructor]",mw=typeof File=="function"||typeof File<"u"&&KS.call(File)==="[object FileConstructor]";function fu(t){return uw&&(t instanceof ArrayBuffer||_w(t))||pw&&t instanceof Blob||mw&&t instanceof File}function Ho(t,e){if(!t||typeof t!="object")return!1;if(Array.isArray(t)){for(let n=0,r=t.length;n=0&&t.num{delete this.acks[e];for(let s=0;s{this.io.clearTimeoutFn(i),n.apply(this,[null,...s])}}emitWithAck(e,...n){const r=this.flags.timeout!==void 0||this._opts.ackTimeout!==void 0;return new Promise((o,i)=>{n.push((s,a)=>r?s?i(s):o(a):o(s)),this.emit(e,...n)})}_addToQueue(e){let n;typeof e[e.length-1]=="function"&&(n=e.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push((o,...i)=>r!==this._queue[0]?void 0:(o!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(o)):(this._queue.shift(),n&&n(null,...i)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(e=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!e||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){typeof this.auth=="function"?this.auth(e=>{this._sendConnectPacket(e)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:xe.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,n)}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case xe.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case xe.EVENT:case xe.BINARY_EVENT:this.onevent(e);break;case xe.ACK:case xe.BINARY_ACK:this.onack(e);break;case xe.DISCONNECT:this.ondisconnect();break;case xe.CONNECT_ERROR:this.destroy();const r=new Error(e.data.message);r.data=e.data.data,this.emitReserved("connect_error",r);break}}onevent(e){const n=e.data||[];e.id!=null&&n.push(this.ack(e.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,e)}super.emit.apply(this,e),this._pid&&e.length&&typeof e[e.length-1]=="string"&&(this._lastOffset=e[e.length-1])}ack(e){const n=this;let r=!1;return function(...o){r||(r=!0,n.packet({type:xe.ACK,id:e,data:o}))}}onack(e){const n=this.acks[e.id];typeof n=="function"&&(n.apply(this,e.data),delete this.acks[e.id])}onconnect(e,n){this.id=e,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(e=>this.emitEvent(e)),this.receiveBuffer=[],this.sendBuffer.forEach(e=>{this.notifyOutgoingListeners(e),this.packet(e)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(e=>e()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:xe.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){const n=this._anyListeners;for(let r=0;r0&&t.jitter<=1?t.jitter:0,this.attempts=0}yr.prototype.duration=function(){var t=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),n=Math.floor(e*this.jitter*t);t=Math.floor(e*10)&1?t+n:t-n}return Math.min(t,this.max)|0};yr.prototype.reset=function(){this.attempts=0};yr.prototype.setMin=function(t){this.ms=t};yr.prototype.setMax=function(t){this.max=t};yr.prototype.setJitter=function(t){this.jitter=t};class wd extends je{constructor(e,n){var r;super(),this.nsps={},this.subs=[],e&&typeof e=="object"&&(n=e,e=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,Fi(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new yr({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=e;const o=n.parser||bw;this.encoder=new o.Encoder,this.decoder=new o.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,this):this._reconnection}reconnectionAttempts(e){return e===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var n;return e===void 0?this._reconnectionDelay:(this._reconnectionDelay=e,(n=this.backoff)===null||n===void 0||n.setMin(e),this)}randomizationFactor(e){var n;return e===void 0?this._randomizationFactor:(this._randomizationFactor=e,(n=this.backoff)===null||n===void 0||n.setJitter(e),this)}reconnectionDelayMax(e){var n;return e===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,(n=this.backoff)===null||n===void 0||n.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new WS(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const o=Ot(n,"open",function(){r.onopen(),e&&e()}),i=Ot(n,"error",s=>{r.cleanup(),r._readyState="closed",this.emitReserved("error",s),e?e(s):r.maybeReconnectOnOpen()});if(this._timeout!==!1){const s=this._timeout;s===0&&o();const a=this.setTimeoutFn(()=>{o(),n.close(),n.emit("error",new Error("timeout"))},s);this.opts.autoUnref&&a.unref(),this.subs.push(function(){clearTimeout(a)})}return this.subs.push(o),this.subs.push(i),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const e=this.engine;this.subs.push(Ot(e,"ping",this.onping.bind(this)),Ot(e,"data",this.ondata.bind(this)),Ot(e,"error",this.onerror.bind(this)),Ot(e,"close",this.onclose.bind(this)),Ot(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(n){this.onclose("parse error",n)}}ondecoded(e){$S(()=>{this.emitReserved("packet",e)},this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,n){let r=this.nsps[e];return r?this._autoConnect&&!r.active&&r.connect():(r=new QS(this,e,n),this.nsps[e]=r),r}_destroy(e){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(e){const n=this.encoder.encode(e);for(let r=0;re()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(e,n){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),!e.skipReconnect&&e.open(o=>{o?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",o)):e.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(function(){clearTimeout(r)})}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}const Ir={};function Vo(t,e){typeof t=="object"&&(e=t,t=void 0),e=e||{};const n=dw(t,e.path||"/socket.io"),r=n.source,o=n.id,i=n.path,s=Ir[o]&&i in Ir[o].nsps,a=e.forceNew||e["force new connection"]||e.multiplex===!1||s;let l;return a?l=new wd(r,e):(Ir[o]||(Ir[o]=new wd(r,e)),l=Ir[o]),n.query&&!e.query&&(e.query=n.queryKey),l.socket(n.path,e)}Object.assign(Vo,{Manager:wd,Socket:QS,io:Vo,connect:Vo});const yw=void 0,Qe=new Vo(yw);Qe.onopen=()=>{console.log("WebSocket connection established.")};Qe.onclose=t=>{console.log("WebSocket connection closed:",t.code,t.reason)};Qe.onerror=t=>{console.error("WebSocket error:",t),Qe.disconnect()};Qe.on("connect",()=>{console.log("WebSocket connected (websocket)")});Qe.on("disconnect",()=>{console.log("WebSocket disonnected (websocket)")});const jS=ZE();jS.config.globalProperties.$socket=Qe;jS.mount();qe.defaults.baseURL="/";const vw={components:{MessageBox:gA,YesNoDialog:NA,ModelEntry:AI,PersonalityViewer:zI,Toast:gu,PersonalityEntry:sx,BindingEntry:Lx},data(){return{models:[],personalities:[],personalitiesFiltered:[],bindings:[],collapsedArr:[],all_collapsed:!0,bec_collapsed:!0,mzc_collapsed:!0,pzc_collapsed:!0,bzc_collapsed:!0,pc_collapsed:!0,mc_collapsed:!0,sc_collapsed:!0,mzl_collapsed:!1,pzl_collapsed:!1,bzl_collapsed:!1,bindingsArr:[],modelsArr:[],persLangArr:[],persCatgArr:[],persArr:[],langArr:[],configFile:{},showConfirmation:!1,showToast:!1,isLoading:!1,settingsChanged:!1,isModelSelected:!1,diskUsage:{},ramUsage:{},isMounted:!1}},created(){},methods:{collapseAll(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},fetchModels(){qe.get("/get_available_models").then(t=>{this.models=t.data,this.fetchCustomModels()}).catch(t=>{console.log(t.message,"fetchModels")})},fetchCustomModels(){qe.get("/list_models").then(t=>{for(let e=0;eo.title==n)==-1){let o={};o.title=n,o.path=n,o.isCustomModel=!0,o.isInstalled=!0,this.models.push(o)}}}).catch(t=>{console.log(t.message,"fetchCustomModels")})},onPersonalitySelected(t){this.isLoading&&this.$refs.toast.showToast("Loading... please wait",4,!1),t.personality&&(this.configFile.personality_folder!=t.personality.folder&&(this.settingsChanged=!0,this.update_setting("personality_folder",t.personality.folder,()=>{this.$refs.toast.showToast(`Selected personality: +`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){const r=new this(e);return n.forEach(o=>r.set(o)),r}static accessor(e){const r=(this[X_]=this[X_]={accessors:{}}).accessors,o=this.prototype;function i(s){const a=Ar(s);r[a]||(WN(o,s),r[a]=!0)}return Q.isArray(e)?e.forEach(i):i(e),this}}Pi.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);Q.freezeMethods(Pi.prototype);Q.freezeMethods(Pi);const jt=Pi;function us(t,e){const n=this||_u,r=e||n,o=jt.from(r.headers);let i=r.data;return Q.forEach(t,function(a){i=a.call(n,i,o.normalize(),e?e.status:void 0)}),o.normalize(),i}function xS(t){return!!(t&&t.__CANCEL__)}function lo(t,e,n){De.call(this,t??"canceled",De.ERR_CANCELED,e,n),this.name="CanceledError"}Q.inherits(lo,De,{__CANCEL__:!0});function KN(t,e,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?t(n):e(new De("Request failed with status code "+n.status,[De.ERR_BAD_REQUEST,De.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}const QN=Pt.isStandardBrowserEnv?function(){return{write:function(n,r,o,i,s,a){const l=[];l.push(n+"="+encodeURIComponent(r)),Q.isNumber(o)&&l.push("expires="+new Date(o).toGMTString()),Q.isString(i)&&l.push("path="+i),Q.isString(s)&&l.push("domain="+s),a===!0&&l.push("secure"),document.cookie=l.join("; ")},read:function(n){const r=document.cookie.match(new RegExp("(^|;\\s*)("+n+")=([^;]*)"));return r?decodeURIComponent(r[3]):null},remove:function(n){this.write(n,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}();function jN(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function XN(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}function wS(t,e){return t&&!jN(e)?XN(t,e):e}const ZN=Pt.isStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let r;function o(i){let s=i;return e&&(n.setAttribute("href",s),s=n.href),n.setAttribute("href",s),{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 r=o(window.location.href),function(s){const a=Q.isString(s)?o(s):s;return a.protocol===r.protocol&&a.host===r.host}}():function(){return function(){return!0}}();function JN(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function eA(t,e){t=t||10;const n=new Array(t),r=new Array(t);let o=0,i=0,s;return e=e!==void 0?e:1e3,function(l){const c=Date.now(),d=r[i];s||(s=c),n[o]=l,r[o]=c;let _=i,u=0;for(;_!==o;)u+=n[_++],_=_%t;if(o=(o+1)%t,o===i&&(i=(i+1)%t),c-s{const i=o.loaded,s=o.lengthComputable?o.total:void 0,a=i-n,l=r(a),c=i<=s;n=i;const d={loaded:i,total:s,progress:s?i/s:void 0,bytes:a,rate:l||void 0,estimated:l&&s&&c?(s-i)/l:void 0,event:o};d[e?"download":"upload"]=!0,t(d)}}const tA=typeof XMLHttpRequest<"u",nA=tA&&function(t){return new Promise(function(n,r){let o=t.data;const i=jt.from(t.headers).normalize(),s=t.responseType;let a;function l(){t.cancelToken&&t.cancelToken.unsubscribe(a),t.signal&&t.signal.removeEventListener("abort",a)}Q.isFormData(o)&&(Pt.isStandardBrowserEnv||Pt.isStandardBrowserWebWorkerEnv)&&i.setContentType(!1);let c=new XMLHttpRequest;if(t.auth){const p=t.auth.username||"",g=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";i.set("Authorization","Basic "+btoa(p+":"+g))}const d=wS(t.baseURL,t.url);c.open(t.method.toUpperCase(),NS(d,t.params,t.paramsSerializer),!0),c.timeout=t.timeout;function _(){if(!c)return;const p=jt.from("getAllResponseHeaders"in c&&c.getAllResponseHeaders()),f={data:!s||s==="text"||s==="json"?c.responseText:c.response,status:c.status,statusText:c.statusText,headers:p,config:t,request:c};KN(function(h){n(h),l()},function(h){r(h),l()},f),c=null}if("onloadend"in c?c.onloadend=_:c.onreadystatechange=function(){!c||c.readyState!==4||c.status===0&&!(c.responseURL&&c.responseURL.indexOf("file:")===0)||setTimeout(_)},c.onabort=function(){c&&(r(new De("Request aborted",De.ECONNABORTED,t,c)),c=null)},c.onerror=function(){r(new De("Network Error",De.ERR_NETWORK,t,c)),c=null},c.ontimeout=function(){let g=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded";const f=t.transitional||AS;t.timeoutErrorMessage&&(g=t.timeoutErrorMessage),r(new De(g,f.clarifyTimeoutError?De.ETIMEDOUT:De.ECONNABORTED,t,c)),c=null},Pt.isStandardBrowserEnv){const p=(t.withCredentials||ZN(d))&&t.xsrfCookieName&&QN.read(t.xsrfCookieName);p&&i.set(t.xsrfHeaderName,p)}o===void 0&&i.setContentType(null),"setRequestHeader"in c&&Q.forEach(i.toJSON(),function(g,f){c.setRequestHeader(f,g)}),Q.isUndefined(t.withCredentials)||(c.withCredentials=!!t.withCredentials),s&&s!=="json"&&(c.responseType=t.responseType),typeof t.onDownloadProgress=="function"&&c.addEventListener("progress",Z_(t.onDownloadProgress,!0)),typeof t.onUploadProgress=="function"&&c.upload&&c.upload.addEventListener("progress",Z_(t.onUploadProgress)),(t.cancelToken||t.signal)&&(a=p=>{c&&(r(!p||p.type?new lo(null,t,c):p),c.abort(),c=null)},t.cancelToken&&t.cancelToken.subscribe(a),t.signal&&(t.signal.aborted?a():t.signal.addEventListener("abort",a)));const u=JN(d);if(u&&Pt.protocols.indexOf(u)===-1){r(new De("Unsupported protocol "+u+":",De.ERR_BAD_REQUEST,t));return}c.send(o||null)})},Go={http:NN,xhr:nA};Q.forEach(Go,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const rA={getAdapter:t=>{t=Q.isArray(t)?t:[t];const{length:e}=t;let n,r;for(let o=0;ot instanceof jt?t.toJSON():t;function ur(t,e){e=e||{};const n={};function r(c,d,_){return Q.isPlainObject(c)&&Q.isPlainObject(d)?Q.merge.call({caseless:_},c,d):Q.isPlainObject(d)?Q.merge({},d):Q.isArray(d)?d.slice():d}function o(c,d,_){if(Q.isUndefined(d)){if(!Q.isUndefined(c))return r(void 0,c,_)}else return r(c,d,_)}function i(c,d){if(!Q.isUndefined(d))return r(void 0,d)}function s(c,d){if(Q.isUndefined(d)){if(!Q.isUndefined(c))return r(void 0,c)}else return r(void 0,d)}function a(c,d,_){if(_ in e)return r(c,d);if(_ in t)return r(void 0,c)}const l={url:i,method:i,data:i,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(c,d)=>o(ep(c),ep(d),!0)};return Q.forEach(Object.keys(t).concat(Object.keys(e)),function(d){const _=l[d]||o,u=_(t[d],e[d],d);Q.isUndefined(u)&&_!==a||(n[d]=u)}),n}const DS="1.3.6",pu={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{pu[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}});const tp={};pu.transitional=function(e,n,r){function o(i,s){return"[Axios v"+DS+"] Transitional option '"+i+"'"+s+(r?". "+r:"")}return(i,s,a)=>{if(e===!1)throw new De(o(s," has been removed"+(n?" in "+n:"")),De.ERR_DEPRECATED);return n&&!tp[s]&&(tp[s]=!0,console.warn(o(s," has been deprecated since v"+n+" and will be removed in the near future"))),e?e(i,s,a):!0}};function oA(t,e,n){if(typeof t!="object")throw new De("options must be an object",De.ERR_BAD_OPTION_VALUE);const r=Object.keys(t);let o=r.length;for(;o-- >0;){const i=r[o],s=e[i];if(s){const a=t[i],l=a===void 0||s(a,i,t);if(l!==!0)throw new De("option "+i+" must be "+l,De.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new De("Unknown option "+i,De.ERR_BAD_OPTION)}}const Cd={assertOptions:oA,validators:pu},an=Cd.validators;class ei{constructor(e){this.defaults=e,this.interceptors={request:new j_,response:new j_}}request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=ur(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:i}=n;r!==void 0&&Cd.assertOptions(r,{silentJSONParsing:an.transitional(an.boolean),forcedJSONParsing:an.transitional(an.boolean),clarifyTimeoutError:an.transitional(an.boolean)},!1),o!=null&&(Q.isFunction(o)?n.paramsSerializer={serialize:o}:Cd.assertOptions(o,{encode:an.function,serialize:an.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let s;s=i&&Q.merge(i.common,i[n.method]),s&&Q.forEach(["delete","get","head","post","put","patch","common"],g=>{delete i[g]}),n.headers=jt.concat(s,i);const a=[];let l=!0;this.interceptors.request.forEach(function(f){typeof f.runWhen=="function"&&f.runWhen(n)===!1||(l=l&&f.synchronous,a.unshift(f.fulfilled,f.rejected))});const c=[];this.interceptors.response.forEach(function(f){c.push(f.fulfilled,f.rejected)});let d,_=0,u;if(!l){const g=[J_.bind(this),void 0];for(g.unshift.apply(g,a),g.push.apply(g,c),u=g.length,d=Promise.resolve(n);_{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](o);r._listeners=null}),this.promise.then=o=>{let i;const s=new Promise(a=>{r.subscribe(a),i=a}).then(o);return s.cancel=function(){r.unsubscribe(i)},s},e(function(i,s,a){r.reason||(r.reason=new lo(i,s,a),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}static source(){let e;return{token:new mu(function(o){e=o}),cancel:e}}}const iA=mu;function sA(t){return function(n){return t.apply(null,n)}}function aA(t){return Q.isObject(t)&&t.isAxiosError===!0}const Rd={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Rd).forEach(([t,e])=>{Rd[e]=t});const lA=Rd;function MS(t){const e=new qo(t),n=gS(qo.prototype.request,e);return Q.extend(n,qo.prototype,e,{allOwnKeys:!0}),Q.extend(n,e,null,{allOwnKeys:!0}),n.create=function(o){return MS(ur(t,o))},n}const Xe=MS(_u);Xe.Axios=qo;Xe.CanceledError=lo;Xe.CancelToken=iA;Xe.isCancel=xS;Xe.VERSION=DS;Xe.toFormData=Li;Xe.AxiosError=De;Xe.Cancel=Xe.CanceledError;Xe.all=function(e){return Promise.all(e)};Xe.spread=sA;Xe.isAxiosError=aA;Xe.mergeConfig=ur;Xe.AxiosHeaders=jt;Xe.formToJSON=t=>IS(Q.isHTMLForm(t)?new FormData(t):t);Xe.HttpStatusCode=lA;Xe.default=Xe;const qe=Xe,cA={data(){return{show:!1,message:""}},methods:{hide(){this.show=!1,this.$emit("ok")},showMessage(t){this.message=t,this.show=!0}}},dA={key:0,class:"fixed top-0 left-0 right-0 bottom-0 flex items-center justify-center bg-black bg-opacity-50"},uA={class:"bg-bg-light dark:bg-bg-dark p-8 rounded-lg shadow-lg"},_A={class:"text-lg font-medium"},pA={class:"mt-4 flex justify-center"};function mA(t,e,n,r,o,i){return o.show?(J(),oe("div",dA,[m("div",uA,[m("h3",_A,fe(o.message),1),m("div",pA,[m("button",{onClick:e[0]||(e[0]=(...s)=>i.hide&&i.hide(...s)),class:"bg-primary hover:bg-primary-light active:scale-95 duration-150 text-white px-4 py-2 rounded-lg shadow-lg hover:bg-secondary-dark"}," OK ")])])])):he("",!0)}const gA=et(cA,[["render",mA]]),fA={data(){return{show:!1,message:"",resolve:null}},methods:{hide(t){this.show=!1,this.resolve&&(this.resolve(t),this.resolve=null)},askQuestion(t){return new Promise(e=>{this.message=t,this.show=!0,this.resolve=e})}}},hA={key:0,class:"fixed top-0 left-0 right-0 bottom-0 flex items-center justify-center bg-black bg-opacity-50"},EA={class:"relative w-full max-w-md max-h-full"},SA={class:"relative bg-white rounded-lg shadow dark:bg-gray-700"},bA=m("svg",{"aria-hidden":"true",class:"w-5 h-5",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},[m("path",{"fill-rule":"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z","clip-rule":"evenodd"})],-1),TA=m("span",{class:"sr-only"},"Close modal",-1),yA=[bA,TA],vA={class:"p-4 text-center"},CA=m("svg",{"aria-hidden":"true",class:"mx-auto mb-4 text-gray-400 w-14 h-14 dark:text-gray-200",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},[m("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})],-1),RA={class:"mb-5 text-lg font-normal text-gray-500 dark:text-gray-400 select-none"};function OA(t,e,n,r,o,i){return o.show?(J(),oe("div",hA,[m("div",EA,[m("div",SA,[m("button",{type:"button",onClick:e[0]||(e[0]=s=>i.hide(!1)),class:"absolute top-3 right-2.5 text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 ml-auto inline-flex items-center dark:hover:bg-gray-800 dark:hover:text-white"},yA),m("div",vA,[CA,m("h3",RA,fe(o.message),1),m("button",{onClick:e[1]||(e[1]=s=>i.hide(!0)),type:"button",class:"text-white bg-red-600 hover:bg-red-800 focus:ring-4 focus:outline-none focus:ring-red-300 dark:focus:ring-red-800 font-medium rounded-lg text-sm inline-flex items-center px-5 py-2.5 text-center mr-2"}," Yes, I'm sure "),m("button",{onClick:e[2]||(e[2]=s=>i.hide(!1)),type:"button",class:"text-gray-500 bg-white hover:bg-gray-100 focus:ring-4 focus:outline-none focus:ring-gray-200 rounded-lg border border-gray-200 text-sm font-medium px-5 py-2.5 hover:text-gray-900 focus:z-10 dark:bg-gray-700 dark:text-gray-300 dark:border-gray-500 dark:hover:text-white dark:hover:bg-gray-600 dark:focus:ring-gray-600"},"No, cancel")])])])])):he("",!0)}const NA=et(fA,[["render",OA]]);const AA={name:"Toast",props:{},data(){return{show:!1,success:!0,message:"",toastArr:[]}},methods:{close(t){this.toastArr=this.toastArr.filter(e=>e.id!=t)},showToast(t,e=3,n=!0){const r=parseInt((new Date().getTime()*Math.random()).toString()).toString(),o={id:r,success:n,message:t,show:!0};this.toastArr.push(o),Te(()=>{Ce.replace()}),setTimeout(()=>{this.toastArr=this.toastArr.filter(i=>i.id!=r)},e*1e3)}},watch:{}},Tr=t=>(vi("data-v-aac71c39"),t=t(),Ci(),t),IA={class:"absolute bottom-16 right-2 z-20 flex flex-col gap-3 min-w-[300px]"},xA={class:"flex items-center w-full max-w-xs p-4 mb-4 text-gray-500 bg-white rounded-lg shadow dark:text-gray-400 dark:bg-gray-800",role:"alert"},wA={class:"flex flex-row items-center"},DA={key:0,class:"inline-flex items-center justify-center flex-shrink-0 w-8 h-8 text-green-500 bg-green-100 rounded-lg dark:bg-green-800 dark:text-green-200"},MA=Tr(()=>m("i",{"data-feather":"check"},null,-1)),LA=Tr(()=>m("span",{class:"sr-only"},"Check icon",-1)),kA=[MA,LA],PA={key:1,class:"inline-flex items-center justify-center flex-shrink-0 w-8 h-8 text-red-500 bg-red-100 rounded-lg dark:bg-red-800 dark:text-red-200"},FA=Tr(()=>m("i",{"data-feather":"x"},null,-1)),UA=Tr(()=>m("span",{class:"sr-only"},"Cross icon",-1)),BA=[FA,UA],GA={class:"ml-3 text-sm font-normal whitespace-pre-wrap"},qA=["onClick"],YA=Tr(()=>m("span",{class:"sr-only"},"Close",-1)),HA=Tr(()=>m("svg",{"aria-hidden":"true",class:"w-5 h-5",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},[m("path",{"fill-rule":"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z","clip-rule":"evenodd"})],-1)),VA=[YA,HA];function zA(t,e,n,r,o,i){return J(),oe("div",IA,[Ie(Sn,{name:"toastItem",tag:"div"},{default:nt(()=>[(J(!0),oe(Be,null,At(o.toastArr,s=>(J(),oe("div",{key:s.id},[m("div",xA,[m("div",wA,[AE(t.$slots,"default",{},()=>[s.success?(J(),oe("div",DA,kA)):he("",!0),s.success?he("",!0):(J(),oe("div",PA,BA)),m("div",GA,fe(s.message),1)],!0)]),m("button",{type:"button",onClick:a=>i.close(s.id),class:"ml-auto -mx-1.5 -my-1.5 bg-white text-gray-400 hover:text-gray-900 rounded-lg focus:ring-2 focus:ring-gray-300 p-1.5 hover:bg-gray-100 inline-flex h-8 w-8 dark:text-gray-500 dark:hover:text-white dark:bg-gray-800 dark:hover:bg-gray-700"},VA,8,qA)])]))),128))]),_:3})])}const gu=et(AA,[["render",zA],["__scopeId","data-v-aac71c39"]]),Od="/assets/default_model-9e24e852.png",$A={props:{title:String,icon:String,path:String,owner:String,owner_link:String,license:String,description:String,isInstalled:Boolean,onInstall:Function,onUninstall:Function,onSelected:Function,onCopy:Function,selected:Boolean,model:Object,model_type:String},data(){return{progress:0,installing:!1,uninstalling:!1,failedToLoad:!1,fileSize:"",linkNotValid:!1}},async mounted(){this.fileSize=await this.getFileSize(this.model.path),Te(()=>{Ce.replace()})},methods:{computedFileSize(t){return Jo(t)},async getFileSize(t){if(this.model_type!="api")try{const e=await qe.head(t);return e?e.headers["content-length"]?this.computedFileSize(e.headers["content-length"]):this.model.filesize?this.computedFileSize(this.model.filesize):"Could not be determined":this.model.filesize?this.computedFileSize(this.model.filesize):"Could not be determined"}catch(e){return console.log(e.message,"getFileSize"),this.linkNotValid=!0,"Could not be determined"}},getImgUrl(){return this.icon==="/images/default_model.png"?Od:this.icon},defaultImg(t){t.target.src=Od},toggleInstall(){this.isInstalled?(this.uninstalling=!0,this.onUninstall(this)):(this.installing=!0,this.onInstall(this))},toggleSelected(){this.onSelected(this)},toggleCopy(){this.onCopy(this)},handleSelection(){this.isInstalled&&!this.selected&&this.onSelected(this)},copyContentToClipboard(){console.log("asdasdas"),this.$emit("copy","this.message.content")}},watch:{linkNotValid(){Te(()=>{Ce.replace()})}}},WA={key:0,class:"flex-1"},KA={class:"flex gap-3 items-center"},QA=["src"],jA={class:"font-bold font-large text-lg"},XA={key:1,class:"flex-1"},ZA={class:"flex flex-row gap-3 items-center"},JA=["src"],eI={class:"font-bold font-large text-lg"},tI=m("div",{class:"flex-grow"},null,-1),nI={class:"flex flex-shrink-0 items-center"},rI=m("i",{"data-feather":"download",class:"w-5 m-1"},null,-1),oI=m("b",null,"Manual download: ",-1),iI=["href"],sI={class:"flex flex-shrink-0 items-center"},aI=m("i",{"data-feather":"file",class:"w-5 m-1"},null,-1),lI=m("b",null,"File size: ",-1),cI={class:"flex flex-shrink-0 items-center"},dI=m("i",{"data-feather":"key",class:"w-5 m-1"},null,-1),uI=m("b",null,"License: ",-1),_I={class:"flex flex-shrink-0 items-center"},pI=m("i",{"data-feather":"user",class:"w-5 m-1"},null,-1),mI=m("b",null,"Owner: ",-1),gI=["href"],fI=m("div",{class:"flex items-center"},[m("i",{"data-feather":"info",class:"w-5 m-1"}),m("b",null,"Description: "),m("br")],-1),hI={class:"mx-1 opacity-80"},EI={class:"flex flex-row flex-shrink-0 items-center"},SI=m("i",{"data-feather":"clipboard"},null,-1),bI=[SI],TI=["disabled"],yI={key:0,class:"flex items-center space-x-2"},vI={class:"h-2 w-20 bg-gray-300 rounded"},CI={key:1,class:"flex items-center space-x-2"},RI={class:"h-2 w-20 bg-gray-300 rounded"},OI=m("span",null,"Uninstalling...",-1);function NI(t,e,n,r,o,i){return J(),oe("div",{class:Le(["flex items-center p-4 hover:bg-primary-light rounded-lg mb-2 shadow-lg border-2 cursor-pointer active:opacity-80 duration-75",n.selected?" border-primary-light":"border-transparent"]),onClick:e[6]||(e[6]=ye((...s)=>i.toggleSelected&&i.toggleSelected(...s),["stop"]))},[n.model.isCustomModel?(J(),oe("div",WA,[m("div",KA,[m("img",{src:i.getImgUrl(),onError:e[0]||(e[0]=s=>i.defaultImg(s)),class:"w-10 h-10 rounded-lg object-fill"},null,40,QA),m("h3",jA,fe(n.title),1)])])):he("",!0),n.model.isCustomModel?he("",!0):(J(),oe("div",XA,[m("div",ZA,[m("img",{ref:"imgElement",src:i.getImgUrl(),onError:e[1]||(e[1]=s=>i.defaultImg(s)),class:Le(["w-10 h-10 rounded-lg object-fill",o.linkNotValid?"grayscale":""])},null,42,JA),m("h3",eI,fe(n.title),1),tI]),m("div",nI,[rI,oI,m("a",{href:n.path,onClick:e[2]||(e[2]=ye(()=>{},["stop"])),class:"flex items-center hover:text-secondary duration-75 active:scale-90",title:"Download this manually (faster) and put it in the models/ folder under your home directory/Documents/lollms folder then refresh"},fe(n.title),9,iI)]),m("div",sI,[m("div",{class:Le(["flex flex-shrink-0 items-center",o.linkNotValid?"text-red-600":""])},[aI,lI,ke(" "+fe(o.fileSize),1)],2)]),m("div",cI,[dI,uI,ke(" "+fe(n.license),1)]),m("div",_I,[pI,mI,m("a",{href:n.owner_link,target:"_blank",rel:"noopener noreferrer",onClick:e[3]||(e[3]=ye(()=>{},["stop"])),class:"flex hover:text-secondary duration-75 active:scale-90",title:"Owner's profile"},fe(n.owner),9,gI)]),fI,m("p",hI,fe(n.description),1)])),m("div",EI,[m("button",{class:"text-lg hover:text-secondary duration-75 active:scale-90 p-2",title:"Copy model info to clipboard",onClick:e[4]||(e[4]=ye(s=>i.toggleCopy(),["stop"]))},bI),n.model_type!=="api"?(J(),oe("button",{key:0,class:Le(["px-4 py-2 rounded-md text-white font-bold transition-colors duration-300",[n.isInstalled?"bg-red-500 hover:bg-red-600":o.linkNotValid?"bg-gray-500 hover:bg-gray-600":"bg-green-500 hover:bg-green-600"]]),disabled:o.installing||o.uninstalling,onClick:e[5]||(e[5]=ye((...s)=>i.toggleInstall&&i.toggleInstall(...s),["stop"]))},[o.installing?(J(),oe("div",yI,[m("div",vI,[m("div",{style:bn({width:o.progress+"%"}),class:"h-full bg-red-500 rounded"},null,4)]),m("span",null,"Installing..."+fe(Math.floor(o.progress))+"%",1)])):o.uninstalling?(J(),oe("div",CI,[m("div",RI,[m("div",{style:bn({width:o.progress+"%"}),class:"h-full bg-green-500"},null,4)]),OI])):(J(),oe(Be,{key:2},[ke(fe(n.isInstalled?n.model.isCustomModel?"Delete":"Uninstall":o.linkNotValid?"Link is not valid":"Install"),1)],64))],10,TI)):he("",!0)])],2)}const AI=et($A,[["render",NI]]),II={data(){return{editMode:!1,avatar:"path/to/avatar.jpg",personalityName:"Personality Name",personalityAuthor:"Author Name",personalityDescription:"Personality Description",personalityLanguage:"English",personalityCategory:"Category",disclaimer:"Disclaimer text",conditioningText:"Conditioning Text",aiPrefix:"AI Prefix",userPrefix:"User Prefix",antipromptsList:[{id:1,text:"Antiprompt 1"},{id:2,text:"Antiprompt 2"},{id:3,text:"Antiprompt 3"}]}},methods:{commitChanges(){console.log("Personality changes committed"),this.editMode=!1}}},xI={class:"p-4"},wI={class:"flex items-center mb-4"},DI=["src"],MI={class:"text-lg font-semibold"},LI=m("strong",null,"Author:",-1),kI=m("strong",null,"Description:",-1),PI=m("strong",null,"Language:",-1),FI=m("strong",null,"Category:",-1),UI={key:0},BI=m("strong",null,"Disclaimer:",-1),GI=m("strong",null,"Conditioning Text:",-1),qI=m("strong",null,"AI Prefix:",-1),YI=m("strong",null,"User Prefix:",-1),HI=m("strong",null,"Antiprompts:",-1);function VI(t,e,n,r,o,i){return J(),oe("div",xI,[m("div",wI,[m("img",{src:o.avatar,class:"w-12 h-12 rounded-full mr-2",alt:"Avatar"},null,8,DI),m("h2",MI,fe(o.personalityName),1)]),m("p",null,[LI,ke(" "+fe(o.personalityAuthor),1)]),m("p",null,[kI,ke(" "+fe(o.personalityDescription),1)]),m("p",null,[PI,ke(" "+fe(o.personalityLanguage),1)]),m("p",null,[FI,ke(" "+fe(o.personalityCategory),1)]),o.disclaimer?(J(),oe("p",UI,[BI,ke(" "+fe(o.disclaimer),1)])):he("",!0),m("p",null,[GI,ke(" "+fe(o.conditioningText),1)]),m("p",null,[qI,ke(" "+fe(o.aiPrefix),1)]),m("p",null,[YI,ke(" "+fe(o.userPrefix),1)]),m("div",null,[HI,m("ul",null,[(J(!0),oe(Be,null,At(o.antipromptsList,s=>(J(),oe("li",{key:s.id},fe(s.text),1))),128))])]),m("button",{onClick:e[0]||(e[0]=s=>o.editMode=!0),class:"mt-4 bg-blue-500 text-white px-4 py-2 rounded"}," Edit "),o.editMode?(J(),oe("button",{key:1,onClick:e[1]||(e[1]=(...s)=>i.commitChanges&&i.commitChanges(...s)),class:"mt-4 bg-green-500 text-white px-4 py-2 rounded"}," Commit ")):he("",!0)])}const zI=et(II,[["render",VI]]),$I="/assets/default_user-17642e5a.svg",WI="/",KI={props:{personality:{},onSelected:Function,selected:Boolean},data(){return{}},mounted(){Te(()=>{Ce.replace()})},methods:{getImgUrl(){return WI+this.personality.avatar},defaultImg(t){t.target.src=Yn},toggleSelected(){this.onSelected(this)}}},QI={class:"flex flex-row items-center flex-shrink-0 gap-3"},jI=["src"],XI={class:"font-bold font-large text-lg line-clamp-3"},ZI={class:""},JI={class:""},ex={class:"flex items-center"},tx=m("i",{"data-feather":"user",class:"w-5 m-1"},null,-1),nx=m("b",null,"Author: ",-1),rx=m("div",{class:"flex items-center"},[m("i",{"data-feather":"info",class:"w-5 m-1"}),m("b",null,"Description: "),m("br")],-1),ox=["title"];function ix(t,e,n,r,o,i){return J(),oe("div",{class:Le(["items-start p-4 hover:bg-primary-light rounded-lg mb-2 shadow-lg border-2 cursor-pointer active:scale-95 duration-75 select-none",n.selected?" border-primary-light":"border-transparent"]),onClick:e[1]||(e[1]=ye((...s)=>i.toggleSelected&&i.toggleSelected(...s),["stop"]))},[m("div",QI,[m("img",{ref:"imgElement",src:i.getImgUrl(),onError:e[0]||(e[0]=s=>i.defaultImg(s)),class:"w-10 h-10 rounded-full object-fill text-red-700"},null,40,jI),m("h3",XI,fe(n.personality.name),1)]),m("div",ZI,[m("div",JI,[m("div",ex,[tx,nx,ke(" "+fe(n.personality.author),1)])]),rx,m("p",{class:"mx-1 opacity-80 line-clamp-3",title:n.personality.description},fe(n.personality.description),9,ox)])],2)}const sx=et(KI,[["render",ix]]),ax="/",lx={props:{binding:{},onSelected:Function,selected:Boolean},data(){return{isTemplate:!1,hasAdvancedSettings:!1}},mounted(){Te(()=>{Ce.replace()})},methods:{getImgUrl(){return ax+this.binding.icon},defaultImg(t){t.target.src=Yn},toggleSelected(){this.onSelected(this)},getStatus(){(this.binding.folder==="backend_template"||this.binding.folder==="binding_template")&&(this.isTemplate=!0)}}},cx={class:"flex flex-row items-center gap-3"},dx=["src"],ux={class:"font-bold font-large text-lg truncate"},_x=m("div",{class:"grow"},null,-1),px={key:0,class:"flex-none"},mx=m("i",{"data-feather":"sliders",class:"w-5 m-1"},null,-1),gx=m("span",{class:"sr-only"},"Icon description",-1),fx=[mx,gx],hx={class:""},Ex={class:""},Sx={class:"flex items-center"},bx=m("i",{"data-feather":"user",class:"w-5 m-1"},null,-1),Tx=m("b",null,"Author: ",-1),yx={class:"flex items-center"},vx=m("i",{"data-feather":"folder",class:"w-5 m-1"},null,-1),Cx=m("b",null,"Folder: ",-1),Rx={class:"flex items-center"},Ox=m("i",{"data-feather":"git-merge",class:"w-5 m-1"},null,-1),Nx=m("b",null,"Version: ",-1),Ax=["href"],Ix=m("i",{"data-feather":"github",class:"w-5 m-1"},null,-1),xx=m("b",null,"Link: ",-1),wx=m("div",{class:"flex items-center"},[m("i",{"data-feather":"info",class:"w-5 m-1"}),m("b",null,"Description: "),m("br")],-1),Dx=["title"];function Mx(t,e,n,r,o,i){return J(),oe("div",{class:Le(["items-start p-4 hover:bg-primary-light rounded-lg mb-2 shadow-lg border-2 cursor-pointer active:scale-95 duration-75 select-none",n.selected?" border-primary-light":"border-transparent"]),onClick:e[2]||(e[2]=ye((...s)=>i.toggleSelected&&i.toggleSelected(...s),["stop"]))},[m("div",{class:Le(o.isTemplate?"opacity-50":"")},[m("div",cx,[m("img",{ref:"imgElement",src:i.getImgUrl(),onError:e[0]||(e[0]=s=>i.defaultImg(s)),class:"w-10 h-10 rounded-full object-fill text-blue-700"},null,40,dx),m("h3",ux,fe(n.binding.name),1),_x,o.hasAdvancedSettings?(J(),oe("div",px,[m("button",{type:"button",title:"Not implemented",class:"hover:text-secondary duration-75 active:scale-90 font-medium rounded-lg text-sm p-2 text-center inline-flex items-center",onClick:e[1]||(e[1]=ye(()=>{},["stop"]))},fx)])):he("",!0)]),m("div",hx,[m("div",Ex,[m("div",Sx,[bx,Tx,ke(" "+fe(n.binding.author),1)]),m("div",yx,[vx,Cx,ke(" "+fe(n.binding.folder),1)]),m("div",Rx,[Ox,Nx,ke(" "+fe(n.binding.version),1)]),m("a",{href:n.binding.link,target:"_blank",class:"flex items-center"},[Ix,xx,ke(" "+fe(n.binding.link),1)],8,Ax)]),wx,m("p",{class:"mx-1 opacity-80 line-clamp-3",title:n.binding.description},fe(n.binding.description),9,Dx)])],2)],2)}const Lx=et(lx,[["render",Mx]]),Yt=Object.create(null);Yt.open="0";Yt.close="1";Yt.ping="2";Yt.pong="3";Yt.message="4";Yt.upgrade="5";Yt.noop="6";const Yo=Object.create(null);Object.keys(Yt).forEach(t=>{Yo[Yt[t]]=t});const kx={type:"error",data:"parser error"},Px=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",Fx=typeof ArrayBuffer=="function",Ux=t=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(t):t&&t.buffer instanceof ArrayBuffer,LS=({type:t,data:e},n,r)=>Px&&e instanceof Blob?n?r(e):np(e,r):Fx&&(e instanceof ArrayBuffer||Ux(e))?n?r(e):np(new Blob([e]),r):r(Yt[t]+(e||"")),np=(t,e)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];e("b"+(r||""))},n.readAsDataURL(t)},rp="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Mr=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let t=0;t{let e=t.length*.75,n=t.length,r,o=0,i,s,a,l;t[t.length-1]==="="&&(e--,t[t.length-2]==="="&&e--);const c=new ArrayBuffer(e),d=new Uint8Array(c);for(r=0;r>4,d[o++]=(s&15)<<4|a>>2,d[o++]=(a&3)<<6|l&63;return c},Gx=typeof ArrayBuffer=="function",kS=(t,e)=>{if(typeof t!="string")return{type:"message",data:PS(t,e)};const n=t.charAt(0);return n==="b"?{type:"message",data:qx(t.substring(1),e)}:Yo[n]?t.length>1?{type:Yo[n],data:t.substring(1)}:{type:Yo[n]}:kx},qx=(t,e)=>{if(Gx){const n=Bx(t);return PS(n,e)}else return{base64:!0,data:t}},PS=(t,e)=>{switch(e){case"blob":return t instanceof ArrayBuffer?new Blob([t]):t;case"arraybuffer":default:return t}},FS=String.fromCharCode(30),Yx=(t,e)=>{const n=t.length,r=new Array(n);let o=0;t.forEach((i,s)=>{LS(i,!1,a=>{r[s]=a,++o===n&&e(r.join(FS))})})},Hx=(t,e)=>{const n=t.split(FS),r=[];for(let o=0;otypeof self<"u"?self:typeof window<"u"?window:Function("return this")())();function BS(t,...e){return e.reduce((n,r)=>(t.hasOwnProperty(r)&&(n[r]=t[r]),n),{})}const zx=ht.setTimeout,$x=ht.clearTimeout;function Fi(t,e){e.useNativeTimers?(t.setTimeoutFn=zx.bind(ht),t.clearTimeoutFn=$x.bind(ht)):(t.setTimeoutFn=ht.setTimeout.bind(ht),t.clearTimeoutFn=ht.clearTimeout.bind(ht))}const Wx=1.33;function Kx(t){return typeof t=="string"?Qx(t):Math.ceil((t.byteLength||t.size)*Wx)}function Qx(t){let e=0,n=0;for(let r=0,o=t.length;r=57344?n+=3:(r++,n+=4);return n}class jx extends Error{constructor(e,n,r){super(e),this.description=n,this.context=r,this.type="TransportError"}}class GS extends je{constructor(e){super(),this.writable=!1,Fi(this,e),this.opts=e,this.query=e.query,this.socket=e.socket}onError(e,n,r){return super.emitReserved("error",new jx(e,n,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(e){this.readyState==="open"&&this.write(e)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){const n=kS(e,this.socket.binaryType);this.onPacket(n)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}pause(e){}}const qS="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),Nd=64,Xx={};let op=0,yo=0,ip;function sp(t){let e="";do e=qS[t%Nd]+e,t=Math.floor(t/Nd);while(t>0);return e}function YS(){const t=sp(+new Date);return t!==ip?(op=0,ip=t):t+"."+sp(op++)}for(;yo{this.readyState="paused",e()};if(this.polling||!this.writable){let r=0;this.polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}poll(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};Hx(e,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this.polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this.poll())}doClose(){const e=()=>{this.write([{type:"close"}])};this.readyState==="open"?e():this.once("open",e)}write(e){this.writable=!1,Yx(e,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){let e=this.query||{};const n=this.opts.secure?"https":"http";let r="";this.opts.timestampRequests!==!1&&(e[this.opts.timestampParam]=YS()),!this.supportsBinary&&!e.sid&&(e.b64=1),this.opts.port&&(n==="https"&&Number(this.opts.port)!==443||n==="http"&&Number(this.opts.port)!==80)&&(r=":"+this.opts.port);const o=HS(e),i=this.opts.hostname.indexOf(":")!==-1;return n+"://"+(i?"["+this.opts.hostname+"]":this.opts.hostname)+r+this.opts.path+(o.length?"?"+o:"")}request(e={}){return Object.assign(e,{xd:this.xd,xs:this.xs},this.opts),new Bt(this.uri(),e)}doWrite(e,n){const r=this.request({method:"POST",data:e});r.on("success",n),r.on("error",(o,i)=>{this.onError("xhr post error",o,i)})}doPoll(){const e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=e}}class Bt extends je{constructor(e,n){super(),Fi(this,n),this.opts=n,this.method=n.method||"GET",this.uri=e,this.async=n.async!==!1,this.data=n.data!==void 0?n.data:null,this.create()}create(){const e=BS(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");e.xdomain=!!this.opts.xd,e.xscheme=!!this.opts.xs;const n=this.xhr=new zS(e);try{n.open(this.method,this.uri,this.async);try{if(this.opts.extraHeaders){n.setDisableHeaderCheck&&n.setDisableHeaderCheck(!0);for(let r in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(r)&&n.setRequestHeader(r,this.opts.extraHeaders[r])}}catch{}if(this.method==="POST")try{n.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{n.setRequestHeader("Accept","*/*")}catch{}"withCredentials"in n&&(n.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(n.timeout=this.opts.requestTimeout),n.onreadystatechange=()=>{n.readyState===4&&(n.status===200||n.status===1223?this.onLoad():this.setTimeoutFn(()=>{this.onError(typeof n.status=="number"?n.status:0)},0))},n.send(this.data)}catch(r){this.setTimeoutFn(()=>{this.onError(r)},0);return}typeof document<"u"&&(this.index=Bt.requestsCount++,Bt.requests[this.index]=this)}onError(e){this.emitReserved("error",e,this.xhr),this.cleanup(!0)}cleanup(e){if(!(typeof this.xhr>"u"||this.xhr===null)){if(this.xhr.onreadystatechange=ew,e)try{this.xhr.abort()}catch{}typeof document<"u"&&delete Bt.requests[this.index],this.xhr=null}}onLoad(){const e=this.xhr.responseText;e!==null&&(this.emitReserved("data",e),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}}Bt.requestsCount=0;Bt.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",ap);else if(typeof addEventListener=="function"){const t="onpagehide"in ht?"pagehide":"unload";addEventListener(t,ap,!1)}}function ap(){for(let t in Bt.requests)Bt.requests.hasOwnProperty(t)&&Bt.requests[t].abort()}const $S=(()=>typeof Promise=="function"&&typeof Promise.resolve=="function"?e=>Promise.resolve().then(e):(e,n)=>n(e,0))(),vo=ht.WebSocket||ht.MozWebSocket,lp=!0,rw="arraybuffer",cp=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class ow extends GS{constructor(e){super(e),this.supportsBinary=!e.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const e=this.uri(),n=this.opts.protocols,r=cp?{}:BS(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=lp&&!cp?n?new vo(e,n):new vo(e):new vo(e,n,r)}catch(o){return this.emitReserved("error",o)}this.ws.binaryType=this.socket.binaryType||rw,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let n=0;n{const s={};try{lp&&this.ws.send(i)}catch{}o&&$S(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.close(),this.ws=null)}uri(){let e=this.query||{};const n=this.opts.secure?"wss":"ws";let r="";this.opts.port&&(n==="wss"&&Number(this.opts.port)!==443||n==="ws"&&Number(this.opts.port)!==80)&&(r=":"+this.opts.port),this.opts.timestampRequests&&(e[this.opts.timestampParam]=YS()),this.supportsBinary||(e.b64=1);const o=HS(e),i=this.opts.hostname.indexOf(":")!==-1;return n+"://"+(i?"["+this.opts.hostname+"]":this.opts.hostname)+r+this.opts.path+(o.length?"?"+o:"")}check(){return!!vo}}const iw={websocket:ow,polling:nw},sw=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,aw=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Ad(t){const e=t,n=t.indexOf("["),r=t.indexOf("]");n!=-1&&r!=-1&&(t=t.substring(0,n)+t.substring(n,r).replace(/:/g,";")+t.substring(r,t.length));let o=sw.exec(t||""),i={},s=14;for(;s--;)i[aw[s]]=o[s]||"";return n!=-1&&r!=-1&&(i.source=e,i.host=i.host.substring(1,i.host.length-1).replace(/;/g,":"),i.authority=i.authority.replace("[","").replace("]","").replace(/;/g,":"),i.ipv6uri=!0),i.pathNames=lw(i,i.path),i.queryKey=cw(i,i.query),i}function lw(t,e){const n=/\/{2,9}/g,r=e.replace(n,"/").split("/");return(e.slice(0,1)=="/"||e.length===0)&&r.splice(0,1),e.slice(-1)=="/"&&r.splice(r.length-1,1),r}function cw(t,e){const n={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,o,i){o&&(n[o]=i)}),n}let WS=class Xn extends je{constructor(e,n={}){super(),this.writeBuffer=[],e&&typeof e=="object"&&(n=e,e=null),e?(e=Ad(e),n.hostname=e.host,n.secure=e.protocol==="https"||e.protocol==="wss",n.port=e.port,e.query&&(n.query=e.query)):n.host&&(n.hostname=Ad(n.host).host),Fi(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=n.transports||["polling","websocket"],this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!0},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=Zx(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,typeof addEventListener=="function"&&(this.opts.closeOnBeforeunload&&(this.beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this.beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(e){const n=Object.assign({},this.opts.query);n.EIO=US,n.transport=e,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts.transportOptions[e],this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port});return new iw[e](r)}open(){let e;if(this.opts.rememberUpgrade&&Xn.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)e="websocket";else if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}else e=this.transports[0];this.readyState="opening";try{e=this.createTransport(e)}catch{this.transports.shift(),this.open();return}e.open(),this.setTransport(e)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",n=>this.onClose("transport close",n))}probe(e){let n=this.createTransport(e),r=!1;Xn.priorWebsocketSuccess=!1;const o=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",_=>{if(!r)if(_.type==="pong"&&_.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;Xn.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(d(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const u=new Error("probe error");u.transport=n.name,this.emitReserved("upgradeError",u)}}))};function i(){r||(r=!0,d(),n.close(),n=null)}const s=_=>{const u=new Error("probe error: "+_);u.transport=n.name,i(),this.emitReserved("upgradeError",u)};function a(){s("transport closed")}function l(){s("socket closed")}function c(_){n&&_.name!==n.name&&i()}const d=()=>{n.removeListener("open",o),n.removeListener("error",s),n.removeListener("close",a),this.off("close",l),this.off("upgrading",c)};n.once("open",o),n.once("error",s),n.once("close",a),this.once("close",l),this.once("upgrading",c),n.open()}onOpen(){if(this.readyState="open",Xn.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush(),this.readyState==="open"&&this.opts.upgrade){let e=0;const n=this.upgrades.length;for(;e{this.onClose("ping timeout")},this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const e=this.getWritablePackets();this.transport.send(e),this.prevBufferLen=e.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r0&&n>this.maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}write(e,n,r){return this.sendPacket("message",e,n,r),this}send(e,n,r){return this.sendPacket("message",e,n,r),this}sendPacket(e,n,r,o){if(typeof n=="function"&&(o=n,n=void 0),typeof r=="function"&&(o=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const i={type:e,data:n,options:r};this.emitReserved("packetCreate",i),this.writeBuffer.push(i),o&&this.once("flush",o),this.flush()}close(){const e=()=>{this.onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),e()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():e()}):this.upgrading?r():e()),this}onError(e){Xn.priorWebsocketSuccess=!1,this.emitReserved("error",e),this.onClose("transport error",e)}onClose(e,n){(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")&&(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),typeof removeEventListener=="function"&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",e,n),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(e){const n=[];let r=0;const o=e.length;for(;rtypeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(t):t.buffer instanceof ArrayBuffer,KS=Object.prototype.toString,pw=typeof Blob=="function"||typeof Blob<"u"&&KS.call(Blob)==="[object BlobConstructor]",mw=typeof File=="function"||typeof File<"u"&&KS.call(File)==="[object FileConstructor]";function fu(t){return uw&&(t instanceof ArrayBuffer||_w(t))||pw&&t instanceof Blob||mw&&t instanceof File}function Ho(t,e){if(!t||typeof t!="object")return!1;if(Array.isArray(t)){for(let n=0,r=t.length;n=0&&t.num{delete this.acks[e];for(let s=0;s{this.io.clearTimeoutFn(i),n.apply(this,[null,...s])}}emitWithAck(e,...n){const r=this.flags.timeout!==void 0||this._opts.ackTimeout!==void 0;return new Promise((o,i)=>{n.push((s,a)=>r?s?i(s):o(a):o(s)),this.emit(e,...n)})}_addToQueue(e){let n;typeof e[e.length-1]=="function"&&(n=e.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push((o,...i)=>r!==this._queue[0]?void 0:(o!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(o)):(this._queue.shift(),n&&n(null,...i)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(e=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!e||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){typeof this.auth=="function"?this.auth(e=>{this._sendConnectPacket(e)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:xe.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,n)}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case xe.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case xe.EVENT:case xe.BINARY_EVENT:this.onevent(e);break;case xe.ACK:case xe.BINARY_ACK:this.onack(e);break;case xe.DISCONNECT:this.ondisconnect();break;case xe.CONNECT_ERROR:this.destroy();const r=new Error(e.data.message);r.data=e.data.data,this.emitReserved("connect_error",r);break}}onevent(e){const n=e.data||[];e.id!=null&&n.push(this.ack(e.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,e)}super.emit.apply(this,e),this._pid&&e.length&&typeof e[e.length-1]=="string"&&(this._lastOffset=e[e.length-1])}ack(e){const n=this;let r=!1;return function(...o){r||(r=!0,n.packet({type:xe.ACK,id:e,data:o}))}}onack(e){const n=this.acks[e.id];typeof n=="function"&&(n.apply(this,e.data),delete this.acks[e.id])}onconnect(e,n){this.id=e,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(e=>this.emitEvent(e)),this.receiveBuffer=[],this.sendBuffer.forEach(e=>{this.notifyOutgoingListeners(e),this.packet(e)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(e=>e()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:xe.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){const n=this._anyListeners;for(let r=0;r0&&t.jitter<=1?t.jitter:0,this.attempts=0}yr.prototype.duration=function(){var t=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),n=Math.floor(e*this.jitter*t);t=Math.floor(e*10)&1?t+n:t-n}return Math.min(t,this.max)|0};yr.prototype.reset=function(){this.attempts=0};yr.prototype.setMin=function(t){this.ms=t};yr.prototype.setMax=function(t){this.max=t};yr.prototype.setJitter=function(t){this.jitter=t};class wd extends je{constructor(e,n){var r;super(),this.nsps={},this.subs=[],e&&typeof e=="object"&&(n=e,e=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,Fi(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new yr({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=e;const o=n.parser||bw;this.encoder=new o.Encoder,this.decoder=new o.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,this):this._reconnection}reconnectionAttempts(e){return e===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var n;return e===void 0?this._reconnectionDelay:(this._reconnectionDelay=e,(n=this.backoff)===null||n===void 0||n.setMin(e),this)}randomizationFactor(e){var n;return e===void 0?this._randomizationFactor:(this._randomizationFactor=e,(n=this.backoff)===null||n===void 0||n.setJitter(e),this)}reconnectionDelayMax(e){var n;return e===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,(n=this.backoff)===null||n===void 0||n.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new WS(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const o=Ot(n,"open",function(){r.onopen(),e&&e()}),i=Ot(n,"error",s=>{r.cleanup(),r._readyState="closed",this.emitReserved("error",s),e?e(s):r.maybeReconnectOnOpen()});if(this._timeout!==!1){const s=this._timeout;s===0&&o();const a=this.setTimeoutFn(()=>{o(),n.close(),n.emit("error",new Error("timeout"))},s);this.opts.autoUnref&&a.unref(),this.subs.push(function(){clearTimeout(a)})}return this.subs.push(o),this.subs.push(i),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const e=this.engine;this.subs.push(Ot(e,"ping",this.onping.bind(this)),Ot(e,"data",this.ondata.bind(this)),Ot(e,"error",this.onerror.bind(this)),Ot(e,"close",this.onclose.bind(this)),Ot(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(n){this.onclose("parse error",n)}}ondecoded(e){$S(()=>{this.emitReserved("packet",e)},this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,n){let r=this.nsps[e];return r?this._autoConnect&&!r.active&&r.connect():(r=new QS(this,e,n),this.nsps[e]=r),r}_destroy(e){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(e){const n=this.encoder.encode(e);for(let r=0;re()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(e,n){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),!e.skipReconnect&&e.open(o=>{o?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",o)):e.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(function(){clearTimeout(r)})}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}const Ir={};function Vo(t,e){typeof t=="object"&&(e=t,t=void 0),e=e||{};const n=dw(t,e.path||"/socket.io"),r=n.source,o=n.id,i=n.path,s=Ir[o]&&i in Ir[o].nsps,a=e.forceNew||e["force new connection"]||e.multiplex===!1||s;let l;return a?l=new wd(r,e):(Ir[o]||(Ir[o]=new wd(r,e)),l=Ir[o]),n.query&&!e.query&&(e.query=n.queryKey),l.socket(n.path,e)}Object.assign(Vo,{Manager:wd,Socket:QS,io:Vo,connect:Vo});const yw=void 0,Qe=new Vo(yw);Qe.onopen=()=>{console.log("WebSocket connection established.")};Qe.onclose=t=>{console.log("WebSocket connection closed:",t.code,t.reason)};Qe.onerror=t=>{console.error("WebSocket error:",t),Qe.disconnect()};Qe.on("connect",()=>{console.log("WebSocket connected (websocket)")});Qe.on("disconnect",()=>{console.log("WebSocket disonnected (websocket)")});const jS=ZE();jS.config.globalProperties.$socket=Qe;jS.mount();qe.defaults.baseURL="/";const vw={components:{MessageBox:gA,YesNoDialog:NA,ModelEntry:AI,PersonalityViewer:zI,Toast:gu,PersonalityEntry:sx,BindingEntry:Lx},data(){return{models:[],personalities:[],personalitiesFiltered:[],bindings:[],collapsedArr:[],all_collapsed:!0,bec_collapsed:!0,mzc_collapsed:!0,pzc_collapsed:!0,bzc_collapsed:!0,pc_collapsed:!0,mc_collapsed:!0,sc_collapsed:!0,mzl_collapsed:!1,pzl_collapsed:!1,bzl_collapsed:!1,bindingsArr:[],modelsArr:[],persLangArr:[],persCatgArr:[],persArr:[],langArr:[],configFile:{},showConfirmation:!1,showToast:!1,isLoading:!1,settingsChanged:!1,isModelSelected:!1,diskUsage:{},ramUsage:{},isMounted:!1}},created(){},methods:{collapseAll(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},fetchModels(){qe.get("/get_available_models").then(t=>{this.models=t.data,this.fetchCustomModels()}).catch(t=>{console.log(t.message,"fetchModels")})},fetchCustomModels(){qe.get("/list_models").then(t=>{for(let e=0;eo.title==n)==-1){let o={};o.title=n,o.path=n,o.isCustomModel=!0,o.isInstalled=!0,this.models.push(o)}}}).catch(t=>{console.log(t.message,"fetchCustomModels")})},onPersonalitySelected(t){this.isLoading&&this.$refs.toast.showToast("Loading... please wait",4,!1),t.personality&&(this.configFile.personality_folder!=t.personality.folder&&(this.settingsChanged=!0,this.update_setting("personality_folder",t.personality.folder,()=>{this.$refs.toast.showToast(`Selected personality: `+t.personality.name,4,!0),this.configFile.personalities[configFile.active_personality_id]=t.personality.language+"/"+t.personality.category+"/"+t.personality.name})),Te(()=>{Ce.replace()}))},onSelected(t){this.isLoading&&this.$refs.toast.showToast("Loading... please wait",4,!1),t&&(t.isInstalled?this.configFile.model_name!=t.title&&(this.update_model(t.title),this.configFile.model_name=t.title,this.$refs.toast.showToast(`Selected model: `+t.title,4,!0),this.settingsChanged=!0,this.isModelSelected=!0):this.$refs.toast.showToast(`Model: `+t.title+` diff --git a/web/dist/index.html b/web/dist/index.html index a43b3fe2..3dc99186 100644 --- a/web/dist/index.html +++ b/web/dist/index.html @@ -6,7 +6,7 @@ GPT4All - WEBUI - + diff --git a/web/src/views/HelpView.vue b/web/src/views/HelpView.vue index 3f601918..2de61a33 100644 --- a/web/src/views/HelpView.vue +++ b/web/src/views/HelpView.vue @@ -41,10 +41,12 @@ methods: { loadFAQs() { // Fetch and parse the CSV file - fetch('/data/faqs.csv') + fetch('/help/faqs.csv') .then((response) => response.text()) .then((csv) => { const { data } = Papa.parse(csv, { header: true }); // Parse the CSV and extract data + console.log("Recovered data") + console.log(data) this.faqs = data; // Assign the parsed data to the faqs array }) .catch((error) => {