diff --git a/lollms_core b/lollms_core index 0025a367..d249a80f 160000 --- a/lollms_core +++ b/lollms_core @@ -1 +1 @@ -Subproject commit 0025a367756843ce0297e68ad7dd61dd66307d07 +Subproject commit d249a80fcd6cf058fd81f0a98a1ce4a5af25acbd diff --git a/web/dist/assets/index-8305b9d3.js b/web/dist/assets/index-3b1245a1.js similarity index 98% rename from web/dist/assets/index-8305b9d3.js rename to web/dist/assets/index-3b1245a1.js index 50143c15..614c4c07 100644 --- a/web/dist/assets/index-8305b9d3.js +++ b/web/dist/assets/index-3b1245a1.js @@ -97,7 +97,7 @@ License: MIT `:"\r"}(ee,k)),U=!1,R.delimiter)N(R.delimiter)&&(R.delimiter=R.delimiter(ee),te.meta.delimiter=R.delimiter);else{var B=function(le,ne,xe,we,V){var _e,ie,ae,M;V=V||[","," ","|",";",l.RECORD_SEP,l.UNIT_SEP];for(var I=0;I=L)return ze(!0)}else for(z=P,P++;;){if((z=q.indexOf(y,z+1))===-1)return re||me.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:J.length,index:P}),Te();if(z===te-1)return Te(q.substring(P,z).replace(I,y));if(y!==G||q[z+1]!==G){if(y===G||z===0||q[z-1]!==G){ae!==-1&&ae=L)return ze(!0);break}me.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:J.length,index:P}),z++}}else z++}return Te();function se(De){J.push(De),ye=P}function Re(De){var lt=0;if(De!==-1){var je=q.substring(z+1,De);je&&je.trim()===""&&(lt=je.length)}return lt}function Te(De){return re||(De===void 0&&(De=q.substring(P)),ee.push(De),P=te,se(ee),Ae&&st()),ze()}function Me(De){P=De,se(ee),ee=[],M=q.indexOf(U,P)}function ze(De){return{data:J,errors:me,meta:{delimiter:A,linebreak:U,aborted:j,truncated:!!De,cursor:ye+(Q||0)}}}function st(){K(ze()),J=[],me=[]}},this.abort=function(){j=!0},this.getCharIndex=function(){return P}}function v(R){var y=R.data,A=o[y.workerId],U=!1;if(y.error)A.userError(y.error,y.file);else if(y.results&&y.results.data){var F={abort:function(){U=!0,S(y.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:T,resume:T};if(N(A.userStep)){for(var K=0;Kn.text()).then(n=>{const{data:e}=Jet.parse(n,{header:!0});console.log("Recovered data"),console.log(e),this.faqs=e}).catch(n=>{console.error("Error loading FAQs:",n)})},parseMultiline(n){return n.replace(/\n/g,"
")}}},Ws=n=>(vo("data-v-b19a05a8"),n=n(),So(),n),ttt={class:"container flex-row mx-auto p-4 bg-bg-light-tone dark:bg-bg-dark-tone shadow-lg overflow-y-auto no-scrollbar p-2 pb-0 grid lg:grid-cols-1 md:grid-cols-2 gap-4"},ntt=Ws(()=>u("h2",{class:"text-2xl font-bold mb-2"},"About Lord of large Language Models",-1)),itt={class:"mb-4"},stt=Ws(()=>u("p",null,[Ze("Discord link: "),u("a",{class:"text-blue-500 hover:text-blue-400 duration-150",href:"https://discord.gg/YgnaFMAQ"},"https://discord.gg/YgnaFMAQ")],-1)),rtt=Ws(()=>u("h2",{class:"text-2xl font-bold mb-2"},"Frequently Asked Questions",-1)),ott={class:"list-disc pl-4"},att={class:"text-xl font-bold mb-1"},ltt=["innerHTML"],ctt=Ws(()=>u("h2",{class:"text-2xl font-bold mb-2"},"Contact Us",-1)),dtt=Ws(()=>u("p",{class:"mb-4"},"If you have any further questions or need assistance, feel free to reach out to me.",-1)),utt=Ws(()=>u("p",null,[Ze("Discord link: "),u("a",{class:"text-blue-500 hover:text-blue-400 duration-150",href:"https://discord.gg/YgnaFMAQ"},"https://discord.gg/YgnaFMAQ")],-1)),ptt=Ws(()=>u("h2",{class:"text-2xl font-bold mb-2"},"Credits",-1)),_tt=Ws(()=>u("p",{class:"mb-4"},[Ze("This project is developed by "),u("span",{class:"font-bold"},"ParisNeo"),Ze(" With help from the community.")],-1)),htt=Ws(()=>u("p",{class:"mb-4"},[u("span",{class:"font-bold"},[u("a",{href:"https://github.com/ParisNeo/lollms-webui/graphs/contributors"},"Check out the full list of developers here and show them some love.")])],-1)),ftt=["href"];function mtt(n,e,t,i,s,r){const o=gt("Card");return O(),D("div",ttt,[Ie(o,{disableHoverAnimation:!0,disableFocus:!0},{default:nt(()=>[ntt,u("p",itt," Lollms version "+ge(r.version),1),stt]),_:1}),Ie(o,{disableHoverAnimation:!0,disableFocus:!0},{default:nt(()=>[rtt,u("ul",ott,[(O(!0),D(Ke,null,pt(s.faqs,(a,l)=>(O(),D("li",{key:l},[u("h3",att,ge(a.question),1),u("p",{class:"mb-4",innerHTML:r.parseMultiline(a.answer)},null,8,ltt)]))),128))])]),_:1}),Ie(o,{disableHoverAnimation:!0,disableFocus:!0},{default:nt(()=>[ctt,dtt,utt]),_:1}),Ie(o,{disableHoverAnimation:!0,disableFocus:!0},{default:nt(()=>[ptt,_tt,htt,u("p",null,[Ze("Check out the project on "),u("a",{class:"text-blue-500 hover:text-blue-400 duration-150",href:s.githubLink,target:"_blank",rel:"noopener noreferrer"},"GitHub",8,ftt),Ze(".")])]),_:1})])}const gtt=vt(ett,[["render",mtt],["__scopeId","data-v-b19a05a8"]]);function ss(n,e=!0,t=1){const i=e?1e3:1024;if(Math.abs(n)=i&&r{qe.replace()})},executeCommand(n){this.isMenuOpen=!1,console.log("Selected"),console.log(n.value),typeof n.value=="function"&&(console.log("Command detected",n),n.value()),this.execute_cmd&&(console.log("executing generic command"),this.execute_cmd(n))},positionMenu(){var n;if(this.$refs.menuButton!=null){if(this.force_position==0||this.force_position==null){const e=this.$refs.menuButton.getBoundingClientRect(),t=window.innerHeight;n=e.bottom>t/2}else this.force_position==1?n=!0:n=!1;this.menuPosition.top=n?"auto":"calc(100% + 10px)",this.menuPosition.bottom=n?"100%":"auto"}}},mounted(){window.addEventListener("resize",this.positionMenu),this.positionMenu(),Ve(()=>{qe.replace()})},beforeDestroy(){window.removeEventListener("resize",this.positionMenu)},watch:{isMenuOpen:"positionMenu"}},Ett={class:"menu-container"},vtt=["title"],Stt=["src"],ytt=["data-feather"],Ttt={key:2,class:"w-5 h-5"},xtt={key:3,"data-feather":"menu"},Ctt={class:"flex-grow menu-ul"},Rtt=["onClick"],Att={key:0,"data-feather":"check"},wtt=["src","alt"],Ntt=["data-feather"],Ott={key:3,class:"menu-icon"};function Itt(n,e,t,i,s,r){return O(),D("div",Ett,[u("button",{onClick:e[0]||(e[0]=Ce((...o)=>r.toggleMenu&&r.toggleMenu(...o),["prevent"])),title:t.title,class:We([t.menuIconClass,"menu-button m-0 p-0 bg-blue-500 text-white dark:bg-blue-200 dark:text-gray-800 rounded flex items-center justify-center w-6 h-6 border-none cursor-pointer hover:bg-blue-400 w-8 h-8 object-fill text-red-700 border-2 active:scale-90 hover:z-20 hover:-translate-y-2 duration-150 border-gray-300 border-secondary cursor-pointer"]),ref:"menuButton"},[t.icon&&!t.icon.includes("#")&&!t.icon.includes("feather")?(O(),D("img",{key:0,src:t.icon,class:"w-5 h-5 p-0 m-0 shadow-lg bold"},null,8,Stt)):t.icon&&t.icon.includes("feather")?(O(),D("i",{key:1,"data-feather":t.icon.split(":")[1],class:"w-5 h-5"},null,8,ytt)):t.icon&&t.icon.includes("#")?(O(),D("p",Ttt,ge(t.icon.split("#")[1]),1)):(O(),D("i",xtt))],10,vtt),Ie(Gs,{name:"slide"},{default:nt(()=>[s.isMenuOpen?(O(),D("div",{key:0,class:"menu-list flex-grow",style:nn(s.menuPosition),ref:"menu"},[u("ul",Ctt,[(O(!0),D(Ke,null,pt(t.commands,(o,a)=>(O(),D("li",{key:a,onClick:Ce(l=>r.executeCommand(o),["prevent"]),class:"menu-command menu-li flex-grow hover:bg-blue-400"},[t.selected_entry==o.name?(O(),D("i",Att)):o.icon&&!o.icon.includes("feather")&&!o.is_file?(O(),D("img",{key:1,src:o.icon,alt:o.name,class:"menu-icon"},null,8,wtt)):W("",!0),o.icon&&o.icon.includes("feather")&&!o.is_file?(O(),D("i",{key:2,"data-feather":o.icon.split(":")[1],class:"mr-2"},null,8,Ntt)):(O(),D("span",Ott)),u("span",null,ge(o.name),1)],8,Rtt))),128))])],4)):W("",!0)]),_:1})])}const lp=vt(btt,[["render",Itt]]),Mtt={components:{InteractiveMenu:lp},props:{isInstalled:Boolean,onInstall:Function,onCancelInstall:Function,onUninstall:Function,onSelected:Function,onCopy:Function,onCopyLink:Function,selected:Boolean,model:Object,model_type:String},data(){return{progress:0,speed:0,total_size:0,downloaded_size:0,start_time:"",installing:!1,uninstalling:!1,failedToLoad:!1,linkNotValid:!1,selected_variant:""}},async mounted(){Ve(()=>{qe.replace()})},methods:{formatFileSize(n){return n<1024?n+" bytes":n<1024*1024?(n/1024).toFixed(2)+" KB":n<1024*1024*1024?(n/(1024*1024)).toFixed(2)+" MB":(n/(1024*1024*1024)).toFixed(2)+" GB"},computedFileSize(n){return ss(n)},getImgUrl(){return this.model.icon==null||this.model.icon==="/images/default_model.png"?Li:this.model.icon},defaultImg(n){n.target.src=Li},install(){this.onInstall(this)},uninstall(){this.isInstalled&&this.onUninstall(this)},toggleInstall(){this.isInstalled?(this.uninstalling=!0,this.onUninstall(this)):this.onInstall(this)},toggleSelected(n){if(n.target.classList.contains("child-element")){n.stopPropagation();return}this.onSelected(this),this.model.selected=!0,Ve(()=>{qe.replace()})},toggleCopy(){this.onCopy(this)},toggleCopyLink(){this.onCopyLink(this)},toggleCancelInstall(){this.onCancelInstall(this),this.installing=!1},handleSelection(){this.isInstalled&&!this.selected&&this.onSelected(this)},copyContentToClipboard(){this.$emit("copy","this.message.content")}},computed:{computed_classes(){return this.model.isInstalled?this.selected?"border-4 border-gray-200 bg-primary cursor-pointer":"border-0 border-primary bg-primary cursor-pointer":"border-transparent"},commandsList(){let n=[{name:this.model.isInstalled?"Install Extra":"Install",icon:"feather:settings",is_file:!1,value:this.install},{name:"Copy model info to clipboard",icon:"feather:settings",is_file:!1,value:this.toggleCopy}];return this.model.isInstalled&&n.push({name:"UnInstall",icon:"feather:settings",is_file:!1,value:this.uninstall}),this.selected&&n.push({name:"Reload",icon:"feather:refresh-ccw",is_file:!1,value:this.toggleSelected}),n},selected_computed(){return this.selected},fileSize:{get(){if(this.model&&this.model.variants&&this.model.variants.length>0){const n=this.model.variants[0].size;return this.formatFileSize(n)}return null}},speed_computed(){return ss(this.speed)},total_size_computed(){return ss(this.total_size)},downloaded_size_computed(){return ss(this.downloaded_size)}},watch:{linkNotValid(){Ve(()=>{qe.replace()})}}},Dtt=["title"],ktt={key:0,class:"flex flex-row"},Ltt={class:"max-w-[300px] overflow-x-auto"},Ptt={class:"flex gap-3 items-center grow"},Utt=["href"],Ftt=["src"],Btt={class:"flex-1 overflow-hidden"},Gtt={class:"font-bold font-large text-lg truncate"},ztt={key:1,class:"flex items-center flex-row gap-2 my-1"},Vtt={class:"flex grow items-center"},Htt=u("i",{"data-feather":"box",class:"w-5"},null,-1),qtt=u("span",{class:"sr-only"},"Custom model / local model",-1),Ytt=[Htt,qtt],$tt=u("span",{class:"sr-only"},"Remove",-1),Wtt={key:2,class:"absolute z-10 -m-4 p-5 shadow-md text-center rounded-lg w-full h-full bg-bg-light-tone-panel dark:bg-bg-dark-tone-panel bg-opacity-70 dark:bg-opacity-70 flex justify-center items-center"},Ktt={class:"relative flex flex-col items-center justify-center flex-grow h-full"},jtt=u("div",{role:"status",class:"justify-center"},[u("svg",{"aria-hidden":"true",class:"w-24 h-24 mr-2 text-gray-200 animate-spin dark:text-gray-600 fill-blue-600",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[u("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),u("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]),u("span",{class:"sr-only"},"Loading...")],-1),Qtt={class:"relative flex flex-row flex-grow items-center w-full h-full bottom-0"},Xtt={class:"w-full bg-bg-light-tone-panel dark:bg-bg-dark-tone-panel rounded-lg p-2"},Ztt={class:"flex justify-between mb-1"},Jtt=u("span",{class:"text-base font-medium text-blue-700 dark:text-white"},"Downloading",-1),ent={class:"text-sm font-medium text-blue-700 dark:text-white"},tnt={class:"w-full bg-gray-200 rounded-full h-2.5 dark:bg-gray-700"},nnt={class:"flex justify-between mb-1"},int={class:"text-base font-medium text-blue-700 dark:text-white"},snt={class:"text-sm font-medium text-blue-700 dark:text-white"},rnt={class:"flex flex-grow"},ont={class:"flex flex-row flex-grow gap-3"},ant={class:"p-2 text-center grow"},lnt={key:3},cnt={class:"flex flex-row items-center gap-3"},dnt=["src"],unt={class:"font-bold font-large text-lg truncate"},pnt=u("div",{class:"grow"},null,-1),_nt={class:"flex items-center flex-row-reverse gap-2 my-1"},hnt={class:"flex flex-row items-center"},fnt={key:0,class:"text-base text-red-600 flex items-center mt-1"},mnt=u("i",{"data-feather":"alert-triangle",class:"flex-shrink-0 mx-1"},null,-1),gnt=["title"],bnt={class:""},Ent={class:"flex flex-row items-center"},vnt=u("i",{"data-feather":"download",class:"w-5 m-1 flex-shrink-0"},null,-1),Snt=u("b",null,"Card: ",-1),ynt=["href","title"],Tnt=u("div",{class:"grow"},null,-1),xnt=u("i",{"data-feather":"clipboard",class:"w-5"},null,-1),Cnt=[xnt],Rnt={class:"flex items-center"},Ant=u("i",{"data-feather":"file",class:"w-5 m-1"},null,-1),wnt=u("b",null,"File size: ",-1),Nnt={class:"flex items-center"},Ont=u("i",{"data-feather":"key",class:"w-5 m-1"},null,-1),Int=u("b",null,"License: ",-1),Mnt={key:0,class:"flex items-center"},Dnt=u("i",{"data-feather":"user",class:"w-5 m-1"},null,-1),knt=u("b",null,"quantizer: ",-1),Lnt=["href"],Pnt={class:"flex items-center"},Unt=u("i",{"data-feather":"user",class:"w-5 m-1"},null,-1),Fnt=u("b",null,"Model creator: ",-1),Bnt=["href"],Gnt={class:"flex items-center"},znt=u("i",{"data-feather":"clock",class:"w-5 m-1"},null,-1),Vnt=u("b",null,"Release date: ",-1),Hnt={class:"flex items-center"},qnt=u("i",{"data-feather":"grid",class:"w-5 m-1"},null,-1),Ynt=u("b",null,"Category: ",-1),$nt=["href"];function Wnt(n,e,t,i,s,r){const o=gt("InteractiveMenu");return O(),D("div",{class:We(["relative items-start p-4 hover:bg-primary-light rounded-lg mb-2 shadow-lg border-2 select-none",r.computed_classes]),title:t.model.name,onClick:e[10]||(e[10]=Ce(a=>r.toggleSelected(a),["prevent"]))},[t.model.isCustomModel?(O(),D("div",ktt,[u("div",Ltt,[u("div",Ptt,[u("a",{href:t.model.model_creator_link,target:"_blank"},[u("img",{src:r.getImgUrl(),onError:e[0]||(e[0]=a=>r.defaultImg(a)),class:"w-10 h-10 rounded-lg object-fill"},null,40,Ftt)],8,Utt),u("div",Btt,[u("h3",Gtt,ge(t.model.name),1)])])])])):W("",!0),t.model.isCustomModel?(O(),D("div",ztt,[u("div",Vtt,[u("button",{type:"button",title:"Custom model / local model",class:"font-medium rounded-lg text-sm p-2 text-center inline-flex items-center",onClick:e[1]||(e[1]=Ce(()=>{},["stop"]))},Ytt),Ze(" Custom model ")]),u("div",null,[t.model.isInstalled?(O(),D("button",{key:0,title:"Delete file from disk",type:"button",onClick:e[2]||(e[2]=Ce((...a)=>r.uninstall&&r.uninstall(...a),["stop"])),class:"inline-flex items-center gap-2 px-3 py-2 text-xs font-medium text-center focus:outline-none text-white bg-red-700 hover:bg-red-800 focus:ring-4 focus:ring-red-300 rounded-lg dark:bg-red-600 dark:hover:bg-red-700 dark:focus:ring-red-900"},[Ze(" Uninstall "),$tt])):W("",!0)])])):W("",!0),s.installing?(O(),D("div",Wtt,[u("div",Ktt,[jtt,u("div",Qtt,[u("div",Xtt,[u("div",Ztt,[Jtt,u("span",ent,ge(Math.floor(s.progress))+"%",1)]),u("div",tnt,[u("div",{class:"bg-blue-600 h-2.5 rounded-full",style:nn({width:s.progress+"%"})},null,4)]),u("div",nnt,[u("span",int,"Download speed: "+ge(r.speed_computed)+"/s",1),u("span",snt,ge(r.downloaded_size_computed)+"/"+ge(r.total_size_computed),1)])])]),u("div",rnt,[u("div",ont,[u("div",ant,[u("button",{onClick:e[3]||(e[3]=Ce((...a)=>r.toggleCancelInstall&&r.toggleCancelInstall(...a),["stop"])),type:"button",title:"Cancel download",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"}," Cancel ")])])])])])):W("",!0),t.model.isCustomModel?W("",!0):(O(),D("div",lnt,[u("div",cnt,[u("img",{ref:"imgElement",src:r.getImgUrl(),onError:e[4]||(e[4]=a=>r.defaultImg(a)),class:We(["w-10 h-10 rounded-lg object-fill",s.linkNotValid?"grayscale":""])},null,42,dnt),u("h3",unt,ge(t.model.name),1),pnt,Ie(o,{commands:r.commandsList,force_position:2,title:"Menu"},null,8,["commands"])]),u("div",_nt,[u("div",hnt,[s.linkNotValid?(O(),D("div",fnt,[mnt,Ze(" Link is not valid ")])):W("",!0)])]),u("div",{class:"",title:t.model.isInstalled?t.model.name:"Not installed"},[u("div",bnt,[u("div",Ent,[vnt,Snt,u("a",{href:"https://huggingface.co/"+t.model.quantizer+"/"+t.model.name,target:"_blank",onClick:e[5]||(e[5]=Ce(()=>{},["stop"])),class:"m-1 flex items-center hover:text-secondary duration-75 active:scale-90 truncate",title:s.linkNotValid?"Link is not valid":"Download this manually (faster) and put it in the models/ folder then refresh"}," View full model card ",8,ynt),Tnt,u("button",{class:"hover:text-secondary duration-75 active:scale-90 font-medium rounded-lg text-sm p-2 text-center inline-flex items-center",title:"Copy link to clipboard",onClick:e[6]||(e[6]=Ce(a=>r.toggleCopyLink(),["stop"]))},Cnt)]),u("div",Rnt,[u("div",{class:We(["flex flex-shrink-0 items-center",s.linkNotValid?"text-red-600":""])},[Ant,wnt,Ze(" "+ge(r.fileSize),1)],2)]),u("div",Nnt,[Ont,Int,Ze(" "+ge(t.model.license),1)]),t.model.quantizer!="None"&&t.model.type!="transformers"?(O(),D("div",Mnt,[Dnt,knt,u("a",{href:"https://huggingface.co/"+t.model.quantizer,target:"_blank",rel:"noopener noreferrer",onClick:e[7]||(e[7]=Ce(()=>{},["stop"])),class:"flex hover:text-secondary duration-75 active:scale-90",title:"quantizer's profile"},ge(t.model.quantizer),9,Lnt)])):W("",!0),u("div",Pnt,[Unt,Fnt,u("a",{href:t.model.model_creator_link,target:"_blank",rel:"noopener noreferrer",onClick:e[8]||(e[8]=Ce(()=>{},["stop"])),class:"flex hover:text-secondary duration-75 active:scale-90",title:"quantizer's profile"},ge(t.model.model_creator),9,Bnt)]),u("div",Gnt,[znt,Vnt,Ze(" "+ge(t.model.last_commit_time),1)]),u("div",Hnt,[qnt,Ynt,u("a",{href:"https://huggingface.co/"+t.model.model_creator,target:"_blank",rel:"noopener noreferrer",onClick:e[9]||(e[9]=Ce(()=>{},["stop"])),class:"flex hover:text-secondary duration-75 active:scale-90",title:"quantizer's profile"},ge(t.model.category),9,$nt)])])],8,gnt)]))],10,Dtt)}const Knt=vt(Mtt,[["render",Wnt]]),jnt={data(){return{editMode:!1,avatar:"path/to/avatar.jpg",personalityName:"Personality Name",personalityAuthor:"Author Name",personalityDescription:"Personality Description",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}}},Qnt={class:"p-4"},Xnt={class:"flex items-center mb-4"},Znt=["src"],Jnt={class:"text-lg font-semibold"},eit=u("strong",null,"Author:",-1),tit=u("strong",null,"Description:",-1),nit=u("strong",null,"Category:",-1),iit={key:0},sit=u("strong",null,"Disclaimer:",-1),rit=u("strong",null,"Conditioning Text:",-1),oit=u("strong",null,"AI Prefix:",-1),ait=u("strong",null,"User Prefix:",-1),lit=u("strong",null,"Antiprompts:",-1);function cit(n,e,t,i,s,r){return O(),D("div",Qnt,[u("div",Xnt,[u("img",{src:s.avatar,class:"w-12 h-12 rounded-full mr-2",alt:"Avatar"},null,8,Znt),u("h2",Jnt,ge(s.personalityName),1)]),u("p",null,[eit,Ze(" "+ge(s.personalityAuthor),1)]),u("p",null,[tit,Ze(" "+ge(s.personalityDescription),1)]),u("p",null,[nit,Ze(" "+ge(s.personalityCategory),1)]),s.disclaimer?(O(),D("p",iit,[sit,Ze(" "+ge(s.disclaimer),1)])):W("",!0),u("p",null,[rit,Ze(" "+ge(s.conditioningText),1)]),u("p",null,[oit,Ze(" "+ge(s.aiPrefix),1)]),u("p",null,[ait,Ze(" "+ge(s.userPrefix),1)]),u("div",null,[lit,u("ul",null,[(O(!0),D(Ke,null,pt(s.antipromptsList,o=>(O(),D("li",{key:o.id},ge(o.text),1))),128))])]),u("button",{onClick:e[0]||(e[0]=o=>s.editMode=!0),class:"mt-4 bg-blue-500 text-white px-4 py-2 rounded"}," Edit "),s.editMode?(O(),D("button",{key:1,onClick:e[1]||(e[1]=(...o)=>r.commitChanges&&r.commitChanges(...o)),class:"mt-4 bg-green-500 text-white px-4 py-2 rounded"}," Commit ")):W("",!0)])}const dit=vt(jnt,[["render",cit]]),Sc="/assets/logo-9d653710.svg",uit="/",pit={props:{personality:{},select_language:Boolean,selected:Boolean,full_path:String,onTalk:Function,onSelected:Function,onMount:Function,onUnMount:Function,onRemount:Function,onCopyToCustom:Function,onEdit:Function,onReinstall:Function,onSettings:Function,onCopyPersonalityName:Function},components:{InteractiveMenu:lp},data(){return{isMounted:!1,name:this.personality.name}},computed:{commandsList(){let n=[{name:this.isMounted?"unmount":"mount",icon:"feather:settings",is_file:!1,value:this.isMounted?this.unmount:this.mount},{name:"reinstall",icon:"feather:terminal",is_file:!1,value:this.toggleReinstall}];return console.log("this.category",this.personality.category),this.personality.category=="custom_personalities"?n.push({name:"edit",icon:"feather:settings",is_file:!1,value:this.edit}):n.push({name:"Copy to custom personas folder for editing",icon:"feather:copy",is_file:!1,value:this.copyToCustom}),this.isMounted&&n.push({name:"remount",icon:"feather:refresh-ccw",is_file:!1,value:this.reMount}),this.selected&&this.personality.has_scripts&&n.push({name:"settings",icon:"feather:settings",is_file:!1,value:this.toggleSettings}),n},selected_computed(){return this.selected}},mounted(){this.isMounted=this.personality.isMounted,Ve(()=>{qe.replace()})},methods:{getImgUrl(){return uit+this.personality.avatar},defaultImg(n){n.target.src=Sc},toggleTalk(){this.onTalk(this)},toggleCopyLink(){this.onCopyPersonalityName(this)},toggleSelected(){this.isMounted&&this.onSelected(this)},edit(){this.onEdit(this)},copyToCustom(){this.onCopyToCustom(this)},reMount(){this.onRemount(this)},mount(){console.log("Mounting"),this.onMount(this)},unmount(){console.log("Unmounting"),console.log(this.onUnMount),this.onUnMount(this),this.isMounted=!1},toggleSettings(){this.onSettings(this)},toggleReinstall(){this.onReinstall(this)}},watch:{selected(){Ve(()=>{qe.replace()})}}},_it=["title"],hit={class:"flex flex-row items-center flex-shrink-0 gap-3"},fit=["src"],mit=u("i",{"data-feather":"clipboard",class:"w-5"},null,-1),git=[mit],bit={class:""},Eit={class:""},vit={class:"flex items-center"},Sit=u("i",{"data-feather":"user",class:"w-5 m-1"},null,-1),yit=u("b",null,"Author: ",-1),Tit={class:"flex items-center"},xit=u("i",{"data-feather":"git-commit",class:"w-5 m-1"},null,-1),Cit=u("b",null,"Version: ",-1),Rit={key:0,class:"flex items-center"},Ait=u("i",{"data-feather":"globe",class:"w-5 m-1"},null,-1),wit=u("b",null,"Languages: ",-1),Nit=["selected"],Oit={key:1,class:"flex items-center"},Iit=u("i",{"data-feather":"globe",class:"w-5 m-1"},null,-1),Mit=u("b",null,"Language: ",-1),Dit={class:"flex items-center"},kit=u("i",{"data-feather":"bookmark",class:"w-5 m-1"},null,-1),Lit=u("b",null,"Category: ",-1),Pit=u("div",{class:"flex items-center"},[u("i",{"data-feather":"info",class:"w-5 m-1"}),u("b",null,"Description: "),u("br")],-1),Uit=["title","innerHTML"],Fit={class:"rounded bg-blue-300"},Bit=u("i",{"data-feather":"check"},null,-1),Git=u("span",{class:"sr-only"},"Select",-1),zit=[Bit,Git],Vit=u("i",{"data-feather":"send",class:"w-5"},null,-1),Hit=u("span",{class:"sr-only"},"Talk",-1),qit=[Vit,Hit];function Yit(n,e,t,i,s,r){const o=gt("InteractiveMenu");return O(),D("div",{class:We(["min-w-96 items-start p-4 hover:bg-primary-light rounded-lg mb-2 shadow-lg border-2 cursor-pointer select-none",r.selected_computed?"border-2 border-primary-light":"border-transparent",s.isMounted?"bg-blue-200 dark:bg-blue-700":""]),tabindex:"-1",title:t.personality.installed?"":"Not installed"},[u("div",{class:We(t.personality.installed?"":"border-red-500")},[u("div",hit,[u("img",{onClick:e[0]||(e[0]=(...a)=>r.toggleSelected&&r.toggleSelected(...a)),ref:"imgElement",src:r.getImgUrl(),onError:e[1]||(e[1]=a=>r.defaultImg(a)),class:"w-10 h-10 rounded-full object-fill text-red-700 cursor-pointer"},null,40,fit),u("h3",{onClick:e[2]||(e[2]=(...a)=>r.toggleSelected&&r.toggleSelected(...a)),class:"font-bold font-large text-lg line-clamp-3 cursor-pointer"},ge(t.personality.name),1),u("button",{class:"hover:text-secondary duration-75 active:scale-90 font-medium rounded-lg text-sm p-2 text-center inline-flex items-center",title:"Copy link to clipboard",onClick:e[3]||(e[3]=Ce(a=>r.toggleCopyLink(),["stop"]))},git)]),u("div",bit,[u("div",Eit,[u("div",vit,[Sit,yit,Ze(" "+ge(t.personality.author),1)]),u("div",Tit,[xit,Cit,Ze(" "+ge(t.personality.version),1)]),t.personality.languages&&t.select_language?(O(),D("div",Rit,[Ait,wit,s.isMounted?W("",!0):de((O(),D("select",{key:0,id:"languages","onUpdate:modelValue":e[4]||(e[4]=a=>t.personality.language=a),class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},[(O(!0),D(Ke,null,pt(t.personality.languages,(a,l)=>(O(),D("option",{key:l,selected:a==t.personality.languages[0]},ge(a),9,Nit))),128))],512)),[[zn,t.personality.language]])])):W("",!0),t.personality.language?(O(),D("div",Oit,[Iit,Mit,Ze(" "+ge(t.personality.language),1)])):W("",!0),u("div",Dit,[kit,Lit,Ze(" "+ge(t.personality.category),1)])]),Pit,u("p",{class:"mx-1 opacity-80 h-20 overflow-y-auto scrollbar-thin scrollbar-track-bg-light-tone scrollbar-thumb-bg-light-tone-panel hover:scrollbar-thumb-primary dark:scrollbar-track-bg-dark-tone dark:scrollbar-thumb-bg-dark-tone-panel dark:hover:scrollbar-thumb-primary active:scrollbar-thumb-secondary",title:t.personality.description,innerHTML:t.personality.description},null,8,Uit)]),u("div",Fit,[s.isMounted?(O(),D("button",{key:0,type:"button",title:"Select",onClick:[e[5]||(e[5]=(...a)=>r.toggleSelected&&r.toggleSelected(...a)),e[6]||(e[6]=Ce(()=>{},["stop"]))],class:"hover:text-secondary duration-75 active:scale-90 font-medium rounded-lg text-sm p-2 text-center inline-flex items-center"},zit)):W("",!0),s.isMounted?(O(),D("button",{key:1,type:"button",title:"Talk",onClick:[e[7]||(e[7]=(...a)=>r.toggleTalk&&r.toggleTalk(...a)),e[8]||(e[8]=Ce(()=>{},["stop"]))],class:"hover:text-secondary duration-75 active:scale-90 font-medium rounded-lg text-sm p-2 text-center inline-flex items-center"},qit)):W("",!0),Ie(o,{commands:r.commandsList,force_position:2,title:"Menu"},null,8,["commands"])])],2)],10,_it)}const hO=vt(pit,[["render",Yit]]);const $it={props:{code:String},data(){return{evaluatedCode:"",componentKey:0}},watch:{code:{handler(n){console.log("Code changed"),this.evaluateScriptTags(n),this.componentKey++},immediate:!0}},methods:{evaluateScriptTags(n){const e=document.createElement("div");e.innerHTML=n,e.querySelectorAll("script").forEach(i=>{const s=document.createElement("script");s.textContent=i.textContent,document.body.appendChild(s),document.body.removeChild(s)}),this.evaluatedCode=e.innerHTML,console.log("evaluated code: "+this.evaluatedCode)}}},Wit=["innerHTML"];function Kit(n,e,t,i,s,r){return O(),D("div",{innerHTML:s.evaluatedCode,key:s.componentKey},null,8,Wit)}const fO=vt($it,[["render",Kit]]),jit="/",Qit={components:{DynamicUIRenderer:fO},props:{binding:{},onSelected:Function,onReinstall:Function,onInstall:Function,onUnInstall:Function,onSettings:Function,onReloadBinding:Function,selected:Boolean},data(){return{isTemplate:!1}},mounted(){Ve(()=>{qe.replace()})},methods:{getImgUrl(){return jit+this.binding.icon},defaultImg(n){n.target.src=Sc},toggleSelected(){this.onSelected(this)},toggleInstall(){this.onInstall(this)},toggleUnInstall(){this.onUnInstall(this)},toggleReinstall(){this.onReinstall(this)},toggleReloadBinding(){this.onReloadBinding(this)},toggleSettings(){this.onSettings(this)},getStatus(){(this.binding.folder==="backend_template"||this.binding.folder==="binding_template")&&(this.isTemplate=!0)}},watch:{selected(){Ve(()=>{qe.replace()})}}},Xit=["title"],Zit={class:"flex flex-row items-center gap-3"},Jit=["src"],est={class:"font-bold font-large text-lg truncate"},tst=u("div",{class:"grow"},null,-1),nst={class:"flex-none gap-1"},ist=u("i",{"data-feather":"refresh-cw",class:"w-5"},null,-1),sst=u("span",{class:"sr-only"},"Help",-1),rst=[ist,sst],ost={class:"flex items-center flex-row-reverse gap-2 my-1"},ast=u("span",{class:"sr-only"},"Click to install",-1),lst=u("span",{class:"sr-only"},"Reinstall",-1),cst=u("span",{class:"sr-only"},"UnInstall",-1),dst=u("span",{class:"sr-only"},"Settings",-1),ust={class:""},pst={class:""},_st={class:"flex items-center"},hst=u("i",{"data-feather":"user",class:"w-5 m-1"},null,-1),fst=u("b",null,"Author: ",-1),mst={class:"flex items-center"},gst=u("i",{"data-feather":"folder",class:"w-5 m-1"},null,-1),bst=u("b",null,"Folder: ",-1),Est={class:"flex items-center"},vst=u("i",{"data-feather":"git-merge",class:"w-5 m-1"},null,-1),Sst=u("b",null,"Version: ",-1),yst={class:"flex items-center"},Tst=u("i",{"data-feather":"github",class:"w-5 m-1"},null,-1),xst=u("b",null,"Link: ",-1),Cst=["href"],Rst=u("div",{class:"flex items-center"},[u("i",{"data-feather":"info",class:"w-5 m-1"}),u("b",null,"Description: "),u("br")],-1),Ast=["title","innerHTML"];function wst(n,e,t,i,s,r){const o=gt("DynamicUIRenderer");return O(),D("div",{class:We(["items-start p-4 hover:bg-primary-light hover:border-primary-light rounded-lg mb-2 shadow-lg border-2 cursor-pointer select-none",t.selected?" border-primary bg-primary":"border-transparent"]),onClick:e[7]||(e[7]=Ce((...a)=>r.toggleSelected&&r.toggleSelected(...a),["stop"])),title:t.binding.installed?t.binding.name:"Not installed"},[u("div",null,[u("div",Zit,[u("img",{ref:"imgElement",src:r.getImgUrl(),onError:e[0]||(e[0]=a=>r.defaultImg(a)),class:"w-10 h-10 rounded-full object-fill text-blue-700"},null,40,Jit),u("h3",est,ge(t.binding.name),1),tst,u("div",nst,[t.selected?(O(),D("button",{key:0,type:"button",title:"Reload binding",onClick:[e[1]||(e[1]=(...a)=>r.toggleReloadBinding&&r.toggleReloadBinding(...a)),e[2]||(e[2]=Ce(()=>{},["stop"]))],class:"hover:text-secondary duration-75 active:scale-90 font-medium rounded-lg text-sm p-2 text-center inline-flex items-center"},rst)):W("",!0)])]),u("div",ost,[t.binding.installed?W("",!0):(O(),D("button",{key:0,title:"Click to install",type:"button",onClick:e[3]||(e[3]=Ce((...a)=>r.toggleInstall&&r.toggleInstall(...a),["stop"])),class:"inline-flex items-center gap-2 px-3 py-2 text-xs font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"},[Ze(" Install "),ast])),t.binding.installed?(O(),D("button",{key:1,title:"Click to Reinstall binding",type:"button",onClick:e[4]||(e[4]=Ce((...a)=>r.toggleReinstall&&r.toggleReinstall(...a),["stop"])),class:"inline-flex items-center gap-2 px-3 py-2 text-xs font-medium text-center focus:outline-none text-white bg-green-700 hover:bg-red-800 focus:ring-4 focus:ring-green-300 rounded-lg dark:bg-green-600 dark:hover:bg-green-700 dark:focus:ring-red-900"},[Ze(" Reinstall "),lst])):W("",!0),t.binding.installed?(O(),D("button",{key:2,title:"Click to Reinstall binding",type:"button",onClick:e[5]||(e[5]=Ce((...a)=>r.toggleUnInstall&&r.toggleUnInstall(...a),["stop"])),class:"inline-flex items-center gap-2 px-3 py-2 text-xs font-medium text-center focus:outline-none text-white bg-red-700 hover:bg-red-800 focus:ring-4 focus:ring-red-300 rounded-lg dark:bg-red-600 dark:hover:bg-red-700 dark:focus:ring-red-900"},[Ze(" Uninstall "),cst])):W("",!0),t.selected?(O(),D("button",{key:3,title:"Click to open Settings",type:"button",onClick:e[6]||(e[6]=Ce((...a)=>r.toggleSettings&&r.toggleSettings(...a),["stop"])),class:"inline-flex items-center gap-2 px-3 py-2 text-xs font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"},[Ze(" Settings "),dst])):W("",!0)]),t.binding.ui?(O(),Mt(o,{key:0,class:"w-full h-full",code:t.binding.ui},null,8,["code"])):W("",!0),u("div",ust,[u("div",pst,[u("div",_st,[hst,fst,Ze(" "+ge(t.binding.author),1)]),u("div",mst,[gst,bst,Ze(" "+ge(t.binding.folder),1)]),u("div",Est,[vst,Sst,Ze(" "+ge(t.binding.version),1)]),u("div",yst,[Tst,xst,u("a",{href:t.binding.link,target:"_blank",class:"flex items-center hover:text-secondary duration-75 active:scale-90"},ge(t.binding.link),9,Cst)])]),Rst,u("p",{class:"mx-1 opacity-80 line-clamp-3",title:t.binding.description,innerHTML:t.binding.description},null,8,Ast)])])],10,Xit)}const Nst=vt(Qit,[["render",wst]]),Ost="/assets/extension-59119348.png",Ist={data(){return{show:!1,model_path:"",resolve:null}},methods:{cancel(){this.resolve(null)},openInputBox(){return new Promise(n=>{this.resolve=n})},hide(n){this.show=!1,this.resolve&&(this.resolve(n),this.resolve=null)},showDialog(n){return new Promise(e=>{this.model_path=n,this.show=!0,this.resolve=e})}}},Mst={key:0,class:"fixed top-0 left-0 right-0 bottom-0 flex items-center justify-center bg-black bg-opacity-50"},Dst={class:"relative w-full max-w-md max-h-full"},kst={class:"relative bg-white rounded-lg shadow dark:bg-gray-700"},Lst=u("svg",{"aria-hidden":"true",class:"w-5 h-5",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},[u("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),Pst=u("span",{class:"sr-only"},"Close modal",-1),Ust=[Lst,Pst],Fst={class:"p-4 text-center"},Bst=u("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"},[u("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),Gst={class:"p-4 text-center mx-auto mb-4"},zst=u("label",{class:"mr-2"},"Model path",-1);function Vst(n,e,t,i,s,r){return s.show?(O(),D("div",Mst,[u("div",Dst,[u("div",kst,[u("button",{type:"button",onClick:e[0]||(e[0]=o=>r.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"},Ust),u("div",Fst,[Bst,u("div",Gst,[zst,de(u("input",{"onUpdate:modelValue":e[1]||(e[1]=o=>s.model_path=o),class:"px-4 py-2 border border-gray-300 rounded-lg",type:"text"},null,512),[[Ue,s.model_path]])]),u("button",{onClick:e[2]||(e[2]=o=>r.hide(!0)),type:"button",class:"text-white bg-green-600 hover:bg-green-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"}," Add "),u("button",{onClick:e[3]||(e[3]=o=>r.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")])])])])):W("",!0)}const Hst=vt(Ist,[["render",Vst]]);const qst={props:{show:{type:Boolean,default:!1,required:!1},can_remove:{type:Boolean,default:!1},title:{type:String,default:"Select an option"},choices:{type:Array,required:!0}},data(){return{selectedChoice:null,showInput:!1,newFilename:""}},methods:{displayName(n){return console.log("choice:",n),typeof n=="string"?n:n&&n.name?n.name:""},selectChoice(n){this.selectedChoice=n,this.$emit("choice-selected",n)},closeDialog(){this.$emit("close-dialog")},validateChoice(){this.$emit("choice-validated",this.selectedChoice)},formatSize(n){return n<1024?n+" bytes":n<1024*1024?(n/1024).toFixed(2)+" KB":n<1024*1024*1024?(n/(1024*1024)).toFixed(2)+" MB":(n/(1024*1024*1024)).toFixed(2)+" GB"},toggleInput(){this.showInput=!this.showInput},addNewFilename(){const n=this.newFilename.trim();n!==""&&(this.choices.push(n),this.newFilename="",this.selectChoice(n)),this.showInput=!1},removeChoice(n,e){this.choices.splice(e,1),n===this.selectedChoice&&(this.selectedChoice=null),this.$emit("choice-removed",n)}}},Yst={key:0,class:"fixed inset-0 flex items-center justify-center bg-black bg-opacity-50"},$st={class:"bg-white dark:bg-gray-800 rounded-lg p-6 w-96"},Wst={class:"text-xl font-semibold mb-4"},Kst={class:"h-48 overflow-y-auto"},jst=["onClick"],Qst={class:"font-bold"},Xst=u("br",null,null,-1),Zst={key:0,class:"text-xs text-gray-500"},Jst=["onClick"],ert={key:0,class:"mt-4"},trt={class:"flex justify-end mt-4"},nrt=["disabled"];function irt(n,e,t,i,s,r){return O(),Mt(Gs,{name:"fade"},{default:nt(()=>[t.show?(O(),D("div",Yst,[u("div",$st,[u("h2",Wst,ge(t.title),1),u("div",Kst,[u("ul",null,[(O(!0),D(Ke,null,pt(t.choices,(o,a)=>(O(),D("li",{key:a,onClick:l=>r.selectChoice(o),class:We([{"selected-choice":o===s.selectedChoice},"py-2 px-4 cursor-pointer hover:bg-gray-200 dark:hover:bg-gray-700"])},[u("span",Qst,ge(r.displayName(o)),1),Xst,o.size?(O(),D("span",Zst,ge(r.formatSize(o.size)),1)):W("",!0),t.can_remove?(O(),D("button",{key:1,onClick:l=>r.removeChoice(o,a),class:"ml-2 text-red-500 hover:text-red-600"}," X ",8,Jst)):W("",!0)],10,jst))),128))])]),s.showInput?(O(),D("div",ert,[de(u("input",{"onUpdate:modelValue":e[0]||(e[0]=o=>s.newFilename=o),placeholder:"Enter a filename",class:"border border-gray-300 p-2 rounded-lg w-full"},null,512),[[Ue,s.newFilename]]),u("button",{onClick:e[1]||(e[1]=(...o)=>r.addNewFilename&&r.addNewFilename(...o)),class:"mt-2 py-2 px-4 bg-green-500 hover:bg-green-600 text-white rounded-lg transition duration-300"}," Add ")])):W("",!0),u("div",trt,[u("button",{onClick:e[2]||(e[2]=(...o)=>r.closeDialog&&r.closeDialog(...o)),class:"py-2 px-4 mr-2 bg-red-500 hover:bg-red-600 text-white rounded-lg transition duration-300"}," Cancel "),u("button",{onClick:e[3]||(e[3]=(...o)=>r.validateChoice&&r.validateChoice(...o)),class:We([{"bg-gray-400 cursor-not-allowed":!s.selectedChoice,"bg-blue-500 hover:bg-blue-600":s.selectedChoice,"text-white":s.selectedChoice,"text-gray-500":!s.selectedChoice},"py-2 px-4 rounded-lg transition duration-300"]),disabled:!s.selectedChoice}," Validate ",10,nrt),u("button",{onClick:e[4]||(e[4]=(...o)=>r.toggleInput&&r.toggleInput(...o)),class:"py-2 px-4 ml-2 bg-blue-500 hover:bg-blue-600 text-white rounded-lg transition duration-300"}," Add New ")])])])):W("",!0)]),_:1})}const AE=vt(qst,[["render",irt]]),srt={props:{radioOptions:{type:Array,required:!0},defaultValue:{type:String,default:0}},data(){return{selectedValue:this.defaultValue}},methods:{handleRadioChange(n){this.selectedValue!==null&&this.$emit("radio-selected",this.selectedValue,n)}}},rrt={class:"flex space-x-4"},ort=["value","onChange"],art={class:"text-gray-700"};function lrt(n,e,t,i,s,r){return O(),D("div",rrt,[(O(!0),D(Ke,null,pt(t.radioOptions,(o,a)=>(O(),D("label",{key:o.value,class:"flex items-center space-x-2"},[de(u("input",{type:"radio",value:o.value,"onUpdate:modelValue":e[0]||(e[0]=l=>s.selectedValue=l),onChange:l=>r.handleRadioChange(a),class:"text-blue-500 focus:ring-2 focus:ring-blue-200"},null,40,ort),[[z2,s.selectedValue]]),u("span",art,ge(o.label),1)]))),128))])}const crt=vt(srt,[["render",lrt]]),drt="/",urt={props:{extension:{},select_language:Boolean,selected:Boolean,full_path:String,onTalk:Function,onSelected:Function,onMount:Function,onUnMount:Function,onRemount:Function,onReinstall:Function,onSettings:Function},components:{InteractiveMenu:lp},data(){return{isMounted:!1,name:this.extension.name}},computed:{commandsList(){let n=[{name:this.isMounted?"unmount":"mount",icon:"feather:settings",is_file:!1,value:this.isMounted?this.unmount:this.mount},{name:"reinstall",icon:"feather:terminal",is_file:!1,value:this.toggleReinstall}];return this.isMounted&&n.push({name:"remount",icon:"feather:refresh-ccw",is_file:!1,value:this.reMount}),n.push({name:"settings",icon:"feather:settings",is_file:!1,value:this.toggleSettings}),n},selected_computed(){return this.selected}},mounted(){this.isMounted=this.extension.isMounted,Ve(()=>{qe.replace()})},methods:{getImgUrl(){return drt+this.extension.avatar},defaultImg(n){n.target.src=Sc},toggleTalk(){this.onTalk(this)},toggleSelected(){this.isMounted&&this.onSelected(this)},reMount(){this.onRemount(this)},mount(){console.log("Mounting"),this.onMount(this)},unmount(){console.log("Unmounting"),console.log(this.onUnMount),this.onUnMount(this)},toggleSettings(){this.onSettings(this)},toggleReinstall(){this.onReinstall(this)}},watch:{selected(){Ve(()=>{qe.replace()})}}},prt=["title"],_rt={class:"flex flex-row items-center flex-shrink-0 gap-3"},hrt=["src"],frt={class:""},mrt={class:""},grt={class:"flex items-center"},brt=u("i",{"data-feather":"user",class:"w-5 m-1"},null,-1),Ert=u("b",null,"Author: ",-1),vrt={class:"flex items-center"},Srt=u("i",{"data-feather":"bookmark",class:"w-5 m-1"},null,-1),yrt=u("b",null,"Based on: ",-1),Trt={key:0,class:"flex items-center"},xrt=u("i",{"data-feather":"globe",class:"w-5 m-1"},null,-1),Crt=u("b",null,"Languages: ",-1),Rrt=["selected"],Art={key:1,class:"flex items-center"},wrt=u("i",{"data-feather":"globe",class:"w-5 m-1"},null,-1),Nrt=u("b",null,"Language: ",-1),Ort={class:"flex items-center"},Irt=u("i",{"data-feather":"bookmark",class:"w-5 m-1"},null,-1),Mrt=u("b",null,"Category: ",-1),Drt=u("div",{class:"flex items-center"},[u("i",{"data-feather":"info",class:"w-5 m-1"}),u("b",null,"Description: "),u("br")],-1),krt=["title","innerHTML"],Lrt={class:"rounded bg-blue-300"},Prt=u("i",{"data-feather":"check"},null,-1),Urt=u("span",{class:"sr-only"},"Select",-1),Frt=[Prt,Urt],Brt=u("i",{"data-feather":"send",class:"w-5"},null,-1),Grt=u("span",{class:"sr-only"},"Talk",-1),zrt=[Brt,Grt];function Vrt(n,e,t,i,s,r){const o=gt("InteractiveMenu");return O(),D("div",{class:We(["min-w-96 items-start p-4 hover:bg-primary-light rounded-lg mb-2 shadow-lg border-2 cursor-pointer select-none",r.selected_computed?"border-2 border-primary-light":"border-transparent",s.isMounted?"bg-blue-200 dark:bg-blue-700":""]),tabindex:"-1",title:t.extension.installed?"":"Not installed"},[u("div",{class:We(t.extension.installed?"":"border-red-500")},[u("div",_rt,[u("img",{onClick:e[0]||(e[0]=(...a)=>r.toggleSelected&&r.toggleSelected(...a)),ref:"imgElement",src:r.getImgUrl(),onError:e[1]||(e[1]=a=>r.defaultImg(a)),class:"w-10 h-10 rounded-full object-fill text-red-700 cursor-pointer"},null,40,hrt),u("h3",{onClick:e[2]||(e[2]=(...a)=>r.toggleSelected&&r.toggleSelected(...a)),class:"font-bold font-large text-lg line-clamp-3 cursor-pointer"},ge(t.extension.name),1)]),u("div",frt,[u("div",mrt,[u("div",grt,[brt,Ert,Ze(" "+ge(t.extension.author),1)]),u("div",vrt,[Srt,yrt,Ze(" "+ge(t.extension.based_on),1)]),t.extension.languages&&t.select_language?(O(),D("div",Trt,[xrt,Crt,de(u("select",{id:"languages","onUpdate:modelValue":e[3]||(e[3]=a=>t.extension.language=a),class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},[(O(!0),D(Ke,null,pt(t.extension.languages,(a,l)=>(O(),D("option",{key:l,selected:a==t.extension.languages[0]},ge(a),9,Rrt))),128))],512),[[zn,t.extension.language]])])):W("",!0),t.extension.language?(O(),D("div",Art,[wrt,Nrt,Ze(" "+ge(t.extension.language),1)])):W("",!0),u("div",Ort,[Irt,Mrt,Ze(" "+ge(t.extension.category),1)])]),Drt,u("p",{class:"mx-1 opacity-80 h-20 overflow-y-auto scrollbar-thin scrollbar-track-bg-light-tone scrollbar-thumb-bg-light-tone-panel hover:scrollbar-thumb-primary dark:scrollbar-track-bg-dark-tone dark:scrollbar-thumb-bg-dark-tone-panel dark:hover:scrollbar-thumb-primary active:scrollbar-thumb-secondary",title:t.extension.description,innerHTML:t.extension.description},null,8,krt)]),u("div",Lrt,[s.isMounted?(O(),D("button",{key:0,type:"button",title:"Select",onClick:[e[4]||(e[4]=(...a)=>r.toggleSelected&&r.toggleSelected(...a)),e[5]||(e[5]=Ce(()=>{},["stop"]))],class:"hover:text-secondary duration-75 active:scale-90 font-medium rounded-lg text-sm p-2 text-center inline-flex items-center"},Frt)):W("",!0),s.isMounted?(O(),D("button",{key:1,type:"button",title:"Talk",onClick:[e[6]||(e[6]=(...a)=>r.toggleTalk&&r.toggleTalk(...a)),e[7]||(e[7]=Ce(()=>{},["stop"]))],class:"hover:text-secondary duration-75 active:scale-90 font-medium rounded-lg text-sm p-2 text-center inline-flex items-center"},zrt)):W("",!0),Ie(o,{commands:r.commandsList,force_position:2,title:"Menu"},null,8,["commands"])])],2)],10,prt)}const Hrt=vt(urt,[["render",Vrt]]),qrt="/assets/gpu-df72bf63.svg";const Yrt="/";Le.defaults.baseURL="/";const $rt={components:{AddModelDialog:Hst,ModelEntry:Knt,PersonalityViewer:dit,PersonalityEntry:hO,BindingEntry:Nst,ChoiceDialog:AE,Card:vc,RadioOptions:crt,ExtensionEntry:Hrt},data(){return{posts_headers:{accept:"application/json","Content-Type":"application/json"},defaultModelImgPlaceholder:Li,voices:[],voice_languages:{Arabic:"ar","Brazilian Portuguese":"pt",Chinese:"zh-cn",Czech:"cs",Dutch:"nl",English:"en",French:"fr",German:"de",Italian:"it",Polish:"pl",Russian:"ru",Spanish:"es",Turkish:"tr",Japanese:"ja",Korean:"ko",Hungarian:"hu",Hindi:"hi"},binding_changed:!1,SVGGPU:qrt,models_zoo:[],models_zoo_initialLoadCount:10,models_zoo_loadMoreCount:5,models_zoo_loadedEntries:[],models_zoo_scrollThreshold:200,sortOptions:[{label:"Sort by Date",value:0},{label:"Sort by Rank",value:1},{label:"Sort by Name",value:2},{label:"Sort by Maker",value:3},{label:"Sort by Quantizer",value:4}],show_only_installed_models:!1,reference_path:"",audioVoices:[],has_updates:!1,variant_choices:[],variantSelectionDialogVisible:!1,currenModelToInstall:null,loading_text:"",extension_category:"bound_extensions",personality_category:null,addModelDialogVisibility:!1,modelPath:"",personalitiesFiltered:[],modelsFiltered:[],extensionsFiltered:[],collapsedArr:[],all_collapsed:!0,servers_conf_collapsed:!0,minconf_collapsed:!0,bec_collapsed:!0,sort_type:0,is_loading_zoo:!1,mzc_collapsed:!0,mzdc_collapsed:!0,pzc_collapsed:!0,ezc_collapsed:!0,mep_collapsed:!0,bzc_collapsed:!0,pc_collapsed:!0,mc_collapsed:!0,sc_collapsed:!0,mzl_collapsed:!1,pzl_collapsed:!1,ezl_collapsed:!1,bzl_collapsed:!1,extCatgArr:[],persCatgArr:[],persArr:[],showConfirmation:!1,showToast:!1,isLoading:!1,settingsChanged:!1,isModelSelected:!1,isMounted:!1,bUrl:Yrt,searchPersonality:"",searchExtension:"",searchModel:"",searchPersonalityTimer:{},searchPersonalityTimerInterval:1500,searchModelTimerInterval:1500,searchPersonalityInProgress:!1,searchExtensionInProgress:!1,searchModelInProgress:!1,addModel:{},modelDownlaodInProgress:!1,uploadData:[]}},async created(){Xe.on("loading_text",this.on_loading_text),this.updateHasUpdates()},methods:{reinstallSDService(){Le.get("install_sd").then(n=>{}).catch(n=>{console.error(n)})},reinstallMotionCtrlService(){Le.get("install_motion_ctrl").then(n=>{}).catch(n=>{console.error(n)})},reinstallvLLMService(){Le.get("install_vllm").then(n=>{}).catch(n=>{console.error(n)})},startvLLMService(){Le.get("start_vllm").then(n=>{}).catch(n=>{console.error(n)})},startollamaService(){Le.get("start_ollama").then(n=>{}).catch(n=>{console.error(n)})},reinstallPetalsService(){Le.get("install_petals").then(n=>{}).catch(n=>{console.error(n)})},reinstallOLLAMAService(){Le.get("install_ollama").then(n=>{}).catch(n=>{console.error(n)})},reinstallAudioService(){Le.get("install_xtts").then(n=>{}).catch(n=>{console.error(n)})},reinstallElasticSearchService(){Le.get("install_vllm").then(n=>{}).catch(n=>{console.error(n)})},getSeviceVoices(){Le.get("list_voices").then(n=>{this.voices=n.data.voices}).catch(n=>{console.error(n)})},load_more_models(){this.models_zoo_initialLoadCount+10{qe.replace()}),this.binding_changed&&!this.mzc_collapsed&&(this.modelsZoo==null||this.modelsZoo.length==0)&&(console.log("Refreshing models"),await this.$store.dispatch("refreshConfig"),this.models_zoo=[],this.refreshModelsZoo(),this.binding_changed=!1)},async selectSortOption(n){this.$store.state.sort_type=n,this.updateModelsZoo(),console.log(`Selected sorting:${n}`),console.log(`models:${this.models_zoo}`)},handleRadioSelected(n){this.isLoading=!0,this.selectSortOption(n).then(()=>{this.isLoading=!1})},filter_installed(n){return console.log("filtering"),n.filter(e=>e.isInstalled===!0)},getVoices(){"speechSynthesis"in window&&(this.audioVoices=speechSynthesis.getVoices(),console.log("Voices:"+this.audioVoices),!this.audio_out_voice&&this.audioVoices.length>0&&(this.audio_out_voice=this.audioVoices[0].name),speechSynthesis.onvoiceschanged=()=>{})},async updateHasUpdates(){let n=await this.api_get_req("check_update");this.has_updates=n.update_availability,console.log("has_updates",this.has_updates)},onVariantChoiceSelected(n){this.selected_variant=n},oncloseVariantChoiceDialog(){this.variantSelectionDialogVisible=!1},onvalidateVariantChoice(n){this.variantSelectionDialogVisible=!1,this.currenModelToInstall.installing=!0;let e=this.currenModelToInstall;if(e.linkNotValid){e.installing=!1,this.$store.state.toast.showToast("Link is not valid, file does not exist",4,!1);return}let t="https://huggingface.co/"+e.model.quantizer+"/"+e.model.name+"/resolve/main/"+this.selected_variant.name;this.showProgress=!0,this.progress=0,this.addModel={model_name:this.selected_variant.name,binding_folder:this.configFile.binding_name,model_url:t},console.log("installing...",this.addModel);const i=s=>{if(console.log("received something"),s.status&&s.progress<=100){if(this.addModel=s,console.log("Progress",s),e.progress=s.progress,e.speed=s.speed,e.total_size=s.total_size,e.downloaded_size=s.downloaded_size,e.start_time=s.start_time,e.installing=!0,e.progress==100){const r=this.models_zoo.findIndex(o=>o.name===e.model.name);this.models_zoo[r].isInstalled=!0,this.showProgress=!1,e.installing=!1,console.log("Received succeeded"),Xe.off("install_progress",i),console.log("Installed successfully"),this.$store.state.toast.showToast(`Model: +`);var P=0,j=!1;this.parse=function(q,Q,re){if(typeof q!="string")throw new Error("Input must be a string");var te=q.length,Z=A.length,fe=U.length,ve=F.length,Ae=N(K),J=[],me=[],ee=[],ye=P=0;if(!q)return ze();if(R.header&&!Q){var Oe=q.split(U)[0].split(A),k=[],B={},Y=!1;for(var le in Oe){var ne=Oe[le];N(R.transformHeader)&&(ne=R.transformHeader(ne,le));var xe=ne,we=B[ne]||0;for(0=L)return ze(!0)}else for(z=P,P++;;){if((z=q.indexOf(y,z+1))===-1)return re||me.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:J.length,index:P}),Te();if(z===te-1)return Te(q.substring(P,z).replace(I,y));if(y!==G||q[z+1]!==G){if(y===G||z===0||q[z-1]!==G){ae!==-1&&ae=L)return ze(!0);break}me.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:J.length,index:P}),z++}}else z++}return Te();function se(De){J.push(De),ye=P}function Re(De){var lt=0;if(De!==-1){var je=q.substring(z+1,De);je&&je.trim()===""&&(lt=je.length)}return lt}function Te(De){return re||(De===void 0&&(De=q.substring(P)),ee.push(De),P=te,se(ee),Ae&&st()),ze()}function Me(De){P=De,se(ee),ee=[],M=q.indexOf(U,P)}function ze(De){return{data:J,errors:me,meta:{delimiter:A,linebreak:U,aborted:j,truncated:!!De,cursor:ye+(Q||0)}}}function st(){K(ze()),J=[],me=[]}},this.abort=function(){j=!0},this.getCharIndex=function(){return P}}function v(R){var y=R.data,A=o[y.workerId],U=!1;if(y.error)A.userError(y.error,y.file);else if(y.results&&y.results.data){var F={abort:function(){U=!0,S(y.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:T,resume:T};if(N(A.userStep)){for(var K=0;Kn.text()).then(n=>{const{data:e}=Jet.parse(n,{header:!0});console.log("Recovered data"),console.log(e),this.faqs=e}).catch(n=>{console.error("Error loading FAQs:",n)})},parseMultiline(n){return n.replace(/\n/g,"
")}}},Ws=n=>(vo("data-v-b19a05a8"),n=n(),So(),n),ttt={class:"container flex-row mx-auto p-4 bg-bg-light-tone dark:bg-bg-dark-tone shadow-lg overflow-y-auto no-scrollbar p-2 pb-0 grid lg:grid-cols-1 md:grid-cols-2 gap-4"},ntt=Ws(()=>u("h2",{class:"text-2xl font-bold mb-2"},"About Lord of large Language Models",-1)),itt={class:"mb-4"},stt=Ws(()=>u("p",null,[Ze("Discord link: "),u("a",{class:"text-blue-500 hover:text-blue-400 duration-150",href:"https://discord.gg/YgnaFMAQ"},"https://discord.gg/YgnaFMAQ")],-1)),rtt=Ws(()=>u("h2",{class:"text-2xl font-bold mb-2"},"Frequently Asked Questions",-1)),ott={class:"list-disc pl-4"},att={class:"text-xl font-bold mb-1"},ltt=["innerHTML"],ctt=Ws(()=>u("h2",{class:"text-2xl font-bold mb-2"},"Contact Us",-1)),dtt=Ws(()=>u("p",{class:"mb-4"},"If you have any further questions or need assistance, feel free to reach out to me.",-1)),utt=Ws(()=>u("p",null,[Ze("Discord link: "),u("a",{class:"text-blue-500 hover:text-blue-400 duration-150",href:"https://discord.gg/YgnaFMAQ"},"https://discord.gg/YgnaFMAQ")],-1)),ptt=Ws(()=>u("h2",{class:"text-2xl font-bold mb-2"},"Credits",-1)),_tt=Ws(()=>u("p",{class:"mb-4"},[Ze("This project is developed by "),u("span",{class:"font-bold"},"ParisNeo"),Ze(" With help from the community.")],-1)),htt=Ws(()=>u("p",{class:"mb-4"},[u("span",{class:"font-bold"},[u("a",{href:"https://github.com/ParisNeo/lollms-webui/graphs/contributors"},"Check out the full list of developers here and show them some love.")])],-1)),ftt=["href"];function mtt(n,e,t,i,s,r){const o=gt("Card");return O(),D("div",ttt,[Ie(o,{disableHoverAnimation:!0,disableFocus:!0},{default:nt(()=>[ntt,u("p",itt," Lollms version "+ge(r.version),1),stt]),_:1}),Ie(o,{disableHoverAnimation:!0,disableFocus:!0},{default:nt(()=>[rtt,u("ul",ott,[(O(!0),D(Ke,null,pt(s.faqs,(a,l)=>(O(),D("li",{key:l},[u("h3",att,ge(a.question),1),u("p",{class:"mb-4",innerHTML:r.parseMultiline(a.answer)},null,8,ltt)]))),128))])]),_:1}),Ie(o,{disableHoverAnimation:!0,disableFocus:!0},{default:nt(()=>[ctt,dtt,utt]),_:1}),Ie(o,{disableHoverAnimation:!0,disableFocus:!0},{default:nt(()=>[ptt,_tt,htt,u("p",null,[Ze("Check out the project on "),u("a",{class:"text-blue-500 hover:text-blue-400 duration-150",href:s.githubLink,target:"_blank",rel:"noopener noreferrer"},"GitHub",8,ftt),Ze(".")])]),_:1})])}const gtt=vt(ett,[["render",mtt],["__scopeId","data-v-b19a05a8"]]);function ss(n,e=!0,t=1){const i=e?1e3:1024;if(Math.abs(n)=i&&r{qe.replace()})},executeCommand(n){this.isMenuOpen=!1,console.log("Selected"),console.log(n.value),typeof n.value=="function"&&(console.log("Command detected",n),n.value()),this.execute_cmd&&(console.log("executing generic command"),this.execute_cmd(n))},positionMenu(){var n;if(this.$refs.menuButton!=null){if(this.force_position==0||this.force_position==null){const e=this.$refs.menuButton.getBoundingClientRect(),t=window.innerHeight;n=e.bottom>t/2}else this.force_position==1?n=!0:n=!1;this.menuPosition.top=n?"auto":"calc(100% + 10px)",this.menuPosition.bottom=n?"100%":"auto"}}},mounted(){window.addEventListener("resize",this.positionMenu),this.positionMenu(),Ve(()=>{qe.replace()})},beforeDestroy(){window.removeEventListener("resize",this.positionMenu)},watch:{isMenuOpen:"positionMenu"}},Ett={class:"menu-container"},vtt=["title"],Stt=["src"],ytt=["data-feather"],Ttt={key:2,class:"w-5 h-5"},xtt={key:3,"data-feather":"menu"},Ctt={class:"flex-grow menu-ul"},Rtt=["onClick"],Att={key:0,"data-feather":"check"},wtt=["src","alt"],Ntt=["data-feather"],Ott={key:3,class:"menu-icon"};function Itt(n,e,t,i,s,r){return O(),D("div",Ett,[u("button",{onClick:e[0]||(e[0]=Ce((...o)=>r.toggleMenu&&r.toggleMenu(...o),["prevent"])),title:t.title,class:We([t.menuIconClass,"menu-button m-0 p-0 bg-blue-500 text-white dark:bg-blue-200 dark:text-gray-800 rounded flex items-center justify-center w-6 h-6 border-none cursor-pointer hover:bg-blue-400 w-8 h-8 object-fill text-red-700 border-2 active:scale-90 hover:z-20 hover:-translate-y-2 duration-150 border-gray-300 border-secondary cursor-pointer"]),ref:"menuButton"},[t.icon&&!t.icon.includes("#")&&!t.icon.includes("feather")?(O(),D("img",{key:0,src:t.icon,class:"w-5 h-5 p-0 m-0 shadow-lg bold"},null,8,Stt)):t.icon&&t.icon.includes("feather")?(O(),D("i",{key:1,"data-feather":t.icon.split(":")[1],class:"w-5 h-5"},null,8,ytt)):t.icon&&t.icon.includes("#")?(O(),D("p",Ttt,ge(t.icon.split("#")[1]),1)):(O(),D("i",xtt))],10,vtt),Ie(Gs,{name:"slide"},{default:nt(()=>[s.isMenuOpen?(O(),D("div",{key:0,class:"menu-list flex-grow",style:nn(s.menuPosition),ref:"menu"},[u("ul",Ctt,[(O(!0),D(Ke,null,pt(t.commands,(o,a)=>(O(),D("li",{key:a,onClick:Ce(l=>r.executeCommand(o),["prevent"]),class:"menu-command menu-li flex-grow hover:bg-blue-400"},[t.selected_entry==o.name?(O(),D("i",Att)):o.icon&&!o.icon.includes("feather")&&!o.is_file?(O(),D("img",{key:1,src:o.icon,alt:o.name,class:"menu-icon"},null,8,wtt)):W("",!0),o.icon&&o.icon.includes("feather")&&!o.is_file?(O(),D("i",{key:2,"data-feather":o.icon.split(":")[1],class:"mr-2"},null,8,Ntt)):(O(),D("span",Ott)),u("span",null,ge(o.name),1)],8,Rtt))),128))])],4)):W("",!0)]),_:1})])}const lp=vt(btt,[["render",Itt]]),Mtt={components:{InteractiveMenu:lp},props:{isInstalled:Boolean,onInstall:Function,onCancelInstall:Function,onUninstall:Function,onSelected:Function,onCopy:Function,onCopyLink:Function,selected:Boolean,model:Object,model_type:String},data(){return{progress:0,speed:0,total_size:0,downloaded_size:0,start_time:"",installing:!1,uninstalling:!1,failedToLoad:!1,linkNotValid:!1,selected_variant:""}},async mounted(){Ve(()=>{qe.replace()})},methods:{formatFileSize(n){return n<1024?n+" bytes":n<1024*1024?(n/1024).toFixed(2)+" KB":n<1024*1024*1024?(n/(1024*1024)).toFixed(2)+" MB":(n/(1024*1024*1024)).toFixed(2)+" GB"},computedFileSize(n){return ss(n)},getImgUrl(){return this.model.icon==null||this.model.icon==="/images/default_model.png"?Li:this.model.icon},defaultImg(n){n.target.src=Li},install(){this.onInstall(this)},uninstall(){this.isInstalled&&this.onUninstall(this)},toggleInstall(){this.isInstalled?(this.uninstalling=!0,this.onUninstall(this)):this.onInstall(this)},toggleSelected(n){if(console.log("event.target.tagName.toLowerCase()"),console.log(n.target.tagName.toLowerCase()),n.target.tagName.toLowerCase()==="button"||n.target.tagName.toLowerCase()==="svg"){n.stopPropagation();return}this.onSelected(this),this.model.selected=!0,Ve(()=>{qe.replace()})},toggleCopy(){this.onCopy(this)},toggleCopyLink(){this.onCopyLink(this)},toggleCancelInstall(){this.onCancelInstall(this),this.installing=!1},handleSelection(){this.isInstalled&&!this.selected&&this.onSelected(this)},copyContentToClipboard(){this.$emit("copy","this.message.content")}},computed:{computed_classes(){return this.model.isInstalled?this.selected?"border-4 border-gray-200 bg-primary cursor-pointer":"border-0 border-primary bg-primary cursor-pointer":"border-transparent"},commandsList(){let n=[{name:this.model.isInstalled?"Install Extra":"Install",icon:"feather:settings",is_file:!1,value:this.install},{name:"Copy model info to clipboard",icon:"feather:settings",is_file:!1,value:this.toggleCopy}];return this.model.isInstalled&&n.push({name:"UnInstall",icon:"feather:settings",is_file:!1,value:this.uninstall}),this.selected&&n.push({name:"Reload",icon:"feather:refresh-ccw",is_file:!1,value:this.toggleSelected}),n},selected_computed(){return this.selected},fileSize:{get(){if(this.model&&this.model.variants&&this.model.variants.length>0){const n=this.model.variants[0].size;return this.formatFileSize(n)}return null}},speed_computed(){return ss(this.speed)},total_size_computed(){return ss(this.total_size)},downloaded_size_computed(){return ss(this.downloaded_size)}},watch:{linkNotValid(){Ve(()=>{qe.replace()})}}},Dtt=["title"],ktt={key:0,class:"flex flex-row"},Ltt={class:"max-w-[300px] overflow-x-auto"},Ptt={class:"flex gap-3 items-center grow"},Utt=["href"],Ftt=["src"],Btt={class:"flex-1 overflow-hidden"},Gtt={class:"font-bold font-large text-lg truncate"},ztt={key:1,class:"flex items-center flex-row gap-2 my-1"},Vtt={class:"flex grow items-center"},Htt=u("i",{"data-feather":"box",class:"w-5"},null,-1),qtt=u("span",{class:"sr-only"},"Custom model / local model",-1),Ytt=[Htt,qtt],$tt=u("span",{class:"sr-only"},"Remove",-1),Wtt={key:2,class:"absolute z-10 -m-4 p-5 shadow-md text-center rounded-lg w-full h-full bg-bg-light-tone-panel dark:bg-bg-dark-tone-panel bg-opacity-70 dark:bg-opacity-70 flex justify-center items-center"},Ktt={class:"relative flex flex-col items-center justify-center flex-grow h-full"},jtt=u("div",{role:"status",class:"justify-center"},[u("svg",{"aria-hidden":"true",class:"w-24 h-24 mr-2 text-gray-200 animate-spin dark:text-gray-600 fill-blue-600",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[u("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),u("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]),u("span",{class:"sr-only"},"Loading...")],-1),Qtt={class:"relative flex flex-row flex-grow items-center w-full h-full bottom-0"},Xtt={class:"w-full bg-bg-light-tone-panel dark:bg-bg-dark-tone-panel rounded-lg p-2"},Ztt={class:"flex justify-between mb-1"},Jtt=u("span",{class:"text-base font-medium text-blue-700 dark:text-white"},"Downloading",-1),ent={class:"text-sm font-medium text-blue-700 dark:text-white"},tnt={class:"w-full bg-gray-200 rounded-full h-2.5 dark:bg-gray-700"},nnt={class:"flex justify-between mb-1"},int={class:"text-base font-medium text-blue-700 dark:text-white"},snt={class:"text-sm font-medium text-blue-700 dark:text-white"},rnt={class:"flex flex-grow"},ont={class:"flex flex-row flex-grow gap-3"},ant={class:"p-2 text-center grow"},lnt={key:3},cnt={class:"flex flex-row items-center gap-3"},dnt=["src"],unt={class:"font-bold font-large text-lg truncate"},pnt=u("div",{class:"grow"},null,-1),_nt={class:"flex items-center flex-row-reverse gap-2 my-1"},hnt={class:"flex flex-row items-center"},fnt={key:0,class:"text-base text-red-600 flex items-center mt-1"},mnt=u("i",{"data-feather":"alert-triangle",class:"flex-shrink-0 mx-1"},null,-1),gnt=["title"],bnt={class:""},Ent={class:"flex flex-row items-center"},vnt=u("i",{"data-feather":"download",class:"w-5 m-1 flex-shrink-0"},null,-1),Snt=u("b",null,"Card: ",-1),ynt=["href","title"],Tnt=u("div",{class:"grow"},null,-1),xnt=u("i",{"data-feather":"clipboard",class:"w-5"},null,-1),Cnt=[xnt],Rnt={class:"flex items-center"},Ant=u("i",{"data-feather":"file",class:"w-5 m-1"},null,-1),wnt=u("b",null,"File size: ",-1),Nnt={class:"flex items-center"},Ont=u("i",{"data-feather":"key",class:"w-5 m-1"},null,-1),Int=u("b",null,"License: ",-1),Mnt={key:0,class:"flex items-center"},Dnt=u("i",{"data-feather":"user",class:"w-5 m-1"},null,-1),knt=u("b",null,"quantizer: ",-1),Lnt=["href"],Pnt={class:"flex items-center"},Unt=u("i",{"data-feather":"user",class:"w-5 m-1"},null,-1),Fnt=u("b",null,"Model creator: ",-1),Bnt=["href"],Gnt={class:"flex items-center"},znt=u("i",{"data-feather":"clock",class:"w-5 m-1"},null,-1),Vnt=u("b",null,"Release date: ",-1),Hnt={class:"flex items-center"},qnt=u("i",{"data-feather":"grid",class:"w-5 m-1"},null,-1),Ynt=u("b",null,"Category: ",-1),$nt=["href"];function Wnt(n,e,t,i,s,r){const o=gt("InteractiveMenu");return O(),D("div",{class:We(["relative items-start p-4 hover:bg-primary-light rounded-lg mb-2 shadow-lg border-2 select-none",r.computed_classes]),title:t.model.name,onClick:e[10]||(e[10]=Ce(a=>r.toggleSelected(a),["prevent"]))},[t.model.isCustomModel?(O(),D("div",ktt,[u("div",Ltt,[u("div",Ptt,[u("a",{href:t.model.model_creator_link,target:"_blank"},[u("img",{src:r.getImgUrl(),onError:e[0]||(e[0]=a=>r.defaultImg(a)),class:"w-10 h-10 rounded-lg object-fill"},null,40,Ftt)],8,Utt),u("div",Btt,[u("h3",Gtt,ge(t.model.name),1)])])])])):W("",!0),t.model.isCustomModel?(O(),D("div",ztt,[u("div",Vtt,[u("button",{type:"button",title:"Custom model / local model",class:"font-medium rounded-lg text-sm p-2 text-center inline-flex items-center",onClick:e[1]||(e[1]=Ce(()=>{},["stop"]))},Ytt),Ze(" Custom model ")]),u("div",null,[t.model.isInstalled?(O(),D("button",{key:0,title:"Delete file from disk",type:"button",onClick:e[2]||(e[2]=Ce((...a)=>r.uninstall&&r.uninstall(...a),["stop"])),class:"inline-flex items-center gap-2 px-3 py-2 text-xs font-medium text-center focus:outline-none text-white bg-red-700 hover:bg-red-800 focus:ring-4 focus:ring-red-300 rounded-lg dark:bg-red-600 dark:hover:bg-red-700 dark:focus:ring-red-900"},[Ze(" Uninstall "),$tt])):W("",!0)])])):W("",!0),s.installing?(O(),D("div",Wtt,[u("div",Ktt,[jtt,u("div",Qtt,[u("div",Xtt,[u("div",Ztt,[Jtt,u("span",ent,ge(Math.floor(s.progress))+"%",1)]),u("div",tnt,[u("div",{class:"bg-blue-600 h-2.5 rounded-full",style:nn({width:s.progress+"%"})},null,4)]),u("div",nnt,[u("span",int,"Download speed: "+ge(r.speed_computed)+"/s",1),u("span",snt,ge(r.downloaded_size_computed)+"/"+ge(r.total_size_computed),1)])])]),u("div",rnt,[u("div",ont,[u("div",ant,[u("button",{onClick:e[3]||(e[3]=Ce((...a)=>r.toggleCancelInstall&&r.toggleCancelInstall(...a),["stop"])),type:"button",title:"Cancel download",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"}," Cancel ")])])])])])):W("",!0),t.model.isCustomModel?W("",!0):(O(),D("div",lnt,[u("div",cnt,[u("img",{ref:"imgElement",src:r.getImgUrl(),onError:e[4]||(e[4]=a=>r.defaultImg(a)),class:We(["w-10 h-10 rounded-lg object-fill",s.linkNotValid?"grayscale":""])},null,42,dnt),u("h3",unt,ge(t.model.name),1),pnt,Ie(o,{commands:r.commandsList,force_position:2,title:"Menu"},null,8,["commands"])]),u("div",_nt,[u("div",hnt,[s.linkNotValid?(O(),D("div",fnt,[mnt,Ze(" Link is not valid ")])):W("",!0)])]),u("div",{class:"",title:t.model.isInstalled?t.model.name:"Not installed"},[u("div",bnt,[u("div",Ent,[vnt,Snt,u("a",{href:"https://huggingface.co/"+t.model.quantizer+"/"+t.model.name,target:"_blank",onClick:e[5]||(e[5]=Ce(()=>{},["stop"])),class:"m-1 flex items-center hover:text-secondary duration-75 active:scale-90 truncate",title:s.linkNotValid?"Link is not valid":"Download this manually (faster) and put it in the models/ folder then refresh"}," View full model card ",8,ynt),Tnt,u("button",{class:"hover:text-secondary duration-75 active:scale-90 font-medium rounded-lg text-sm p-2 text-center inline-flex items-center",title:"Copy link to clipboard",onClick:e[6]||(e[6]=Ce(a=>r.toggleCopyLink(),["stop"]))},Cnt)]),u("div",Rnt,[u("div",{class:We(["flex flex-shrink-0 items-center",s.linkNotValid?"text-red-600":""])},[Ant,wnt,Ze(" "+ge(r.fileSize),1)],2)]),u("div",Nnt,[Ont,Int,Ze(" "+ge(t.model.license),1)]),t.model.quantizer!="None"&&t.model.type!="transformers"?(O(),D("div",Mnt,[Dnt,knt,u("a",{href:"https://huggingface.co/"+t.model.quantizer,target:"_blank",rel:"noopener noreferrer",onClick:e[7]||(e[7]=Ce(()=>{},["stop"])),class:"flex hover:text-secondary duration-75 active:scale-90",title:"quantizer's profile"},ge(t.model.quantizer),9,Lnt)])):W("",!0),u("div",Pnt,[Unt,Fnt,u("a",{href:t.model.model_creator_link,target:"_blank",rel:"noopener noreferrer",onClick:e[8]||(e[8]=Ce(()=>{},["stop"])),class:"flex hover:text-secondary duration-75 active:scale-90",title:"quantizer's profile"},ge(t.model.model_creator),9,Bnt)]),u("div",Gnt,[znt,Vnt,Ze(" "+ge(t.model.last_commit_time),1)]),u("div",Hnt,[qnt,Ynt,u("a",{href:"https://huggingface.co/"+t.model.model_creator,target:"_blank",rel:"noopener noreferrer",onClick:e[9]||(e[9]=Ce(()=>{},["stop"])),class:"flex hover:text-secondary duration-75 active:scale-90",title:"quantizer's profile"},ge(t.model.category),9,$nt)])])],8,gnt)]))],10,Dtt)}const Knt=vt(Mtt,[["render",Wnt]]),jnt={data(){return{editMode:!1,avatar:"path/to/avatar.jpg",personalityName:"Personality Name",personalityAuthor:"Author Name",personalityDescription:"Personality Description",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}}},Qnt={class:"p-4"},Xnt={class:"flex items-center mb-4"},Znt=["src"],Jnt={class:"text-lg font-semibold"},eit=u("strong",null,"Author:",-1),tit=u("strong",null,"Description:",-1),nit=u("strong",null,"Category:",-1),iit={key:0},sit=u("strong",null,"Disclaimer:",-1),rit=u("strong",null,"Conditioning Text:",-1),oit=u("strong",null,"AI Prefix:",-1),ait=u("strong",null,"User Prefix:",-1),lit=u("strong",null,"Antiprompts:",-1);function cit(n,e,t,i,s,r){return O(),D("div",Qnt,[u("div",Xnt,[u("img",{src:s.avatar,class:"w-12 h-12 rounded-full mr-2",alt:"Avatar"},null,8,Znt),u("h2",Jnt,ge(s.personalityName),1)]),u("p",null,[eit,Ze(" "+ge(s.personalityAuthor),1)]),u("p",null,[tit,Ze(" "+ge(s.personalityDescription),1)]),u("p",null,[nit,Ze(" "+ge(s.personalityCategory),1)]),s.disclaimer?(O(),D("p",iit,[sit,Ze(" "+ge(s.disclaimer),1)])):W("",!0),u("p",null,[rit,Ze(" "+ge(s.conditioningText),1)]),u("p",null,[oit,Ze(" "+ge(s.aiPrefix),1)]),u("p",null,[ait,Ze(" "+ge(s.userPrefix),1)]),u("div",null,[lit,u("ul",null,[(O(!0),D(Ke,null,pt(s.antipromptsList,o=>(O(),D("li",{key:o.id},ge(o.text),1))),128))])]),u("button",{onClick:e[0]||(e[0]=o=>s.editMode=!0),class:"mt-4 bg-blue-500 text-white px-4 py-2 rounded"}," Edit "),s.editMode?(O(),D("button",{key:1,onClick:e[1]||(e[1]=(...o)=>r.commitChanges&&r.commitChanges(...o)),class:"mt-4 bg-green-500 text-white px-4 py-2 rounded"}," Commit ")):W("",!0)])}const dit=vt(jnt,[["render",cit]]),Sc="/assets/logo-9d653710.svg",uit="/",pit={props:{personality:{},select_language:Boolean,selected:Boolean,full_path:String,onTalk:Function,onSelected:Function,onMount:Function,onUnMount:Function,onRemount:Function,onCopyToCustom:Function,onEdit:Function,onReinstall:Function,onSettings:Function,onCopyPersonalityName:Function},components:{InteractiveMenu:lp},data(){return{isMounted:!1,name:this.personality.name}},computed:{commandsList(){let n=[{name:this.isMounted?"unmount":"mount",icon:"feather:settings",is_file:!1,value:this.isMounted?this.unmount:this.mount},{name:"reinstall",icon:"feather:terminal",is_file:!1,value:this.toggleReinstall}];return console.log("this.category",this.personality.category),this.personality.category=="custom_personalities"?n.push({name:"edit",icon:"feather:settings",is_file:!1,value:this.edit}):n.push({name:"Copy to custom personas folder for editing",icon:"feather:copy",is_file:!1,value:this.copyToCustom}),this.isMounted&&n.push({name:"remount",icon:"feather:refresh-ccw",is_file:!1,value:this.reMount}),this.selected&&this.personality.has_scripts&&n.push({name:"settings",icon:"feather:settings",is_file:!1,value:this.toggleSettings}),n},selected_computed(){return this.selected}},mounted(){this.isMounted=this.personality.isMounted,Ve(()=>{qe.replace()})},methods:{getImgUrl(){return uit+this.personality.avatar},defaultImg(n){n.target.src=Sc},toggleTalk(){this.onTalk(this)},toggleCopyLink(){this.onCopyPersonalityName(this)},toggleSelected(){this.isMounted&&this.onSelected(this)},edit(){this.onEdit(this)},copyToCustom(){this.onCopyToCustom(this)},reMount(){this.onRemount(this)},mount(){console.log("Mounting"),this.onMount(this)},unmount(){console.log("Unmounting"),console.log(this.onUnMount),this.onUnMount(this),this.isMounted=!1},toggleSettings(){this.onSettings(this)},toggleReinstall(){this.onReinstall(this)}},watch:{selected(){Ve(()=>{qe.replace()})}}},_it=["title"],hit={class:"flex flex-row items-center flex-shrink-0 gap-3"},fit=["src"],mit=u("i",{"data-feather":"clipboard",class:"w-5"},null,-1),git=[mit],bit={class:""},Eit={class:""},vit={class:"flex items-center"},Sit=u("i",{"data-feather":"user",class:"w-5 m-1"},null,-1),yit=u("b",null,"Author: ",-1),Tit={class:"flex items-center"},xit=u("i",{"data-feather":"git-commit",class:"w-5 m-1"},null,-1),Cit=u("b",null,"Version: ",-1),Rit={key:0,class:"flex items-center"},Ait=u("i",{"data-feather":"globe",class:"w-5 m-1"},null,-1),wit=u("b",null,"Languages: ",-1),Nit=["selected"],Oit={key:1,class:"flex items-center"},Iit=u("i",{"data-feather":"globe",class:"w-5 m-1"},null,-1),Mit=u("b",null,"Language: ",-1),Dit={class:"flex items-center"},kit=u("i",{"data-feather":"bookmark",class:"w-5 m-1"},null,-1),Lit=u("b",null,"Category: ",-1),Pit=u("div",{class:"flex items-center"},[u("i",{"data-feather":"info",class:"w-5 m-1"}),u("b",null,"Description: "),u("br")],-1),Uit=["title","innerHTML"],Fit={class:"rounded bg-blue-300"},Bit=u("i",{"data-feather":"check"},null,-1),Git=u("span",{class:"sr-only"},"Select",-1),zit=[Bit,Git],Vit=u("i",{"data-feather":"send",class:"w-5"},null,-1),Hit=u("span",{class:"sr-only"},"Talk",-1),qit=[Vit,Hit];function Yit(n,e,t,i,s,r){const o=gt("InteractiveMenu");return O(),D("div",{class:We(["min-w-96 items-start p-4 hover:bg-primary-light rounded-lg mb-2 shadow-lg border-2 cursor-pointer select-none",r.selected_computed?"border-2 border-primary-light":"border-transparent",s.isMounted?"bg-blue-200 dark:bg-blue-700":""]),tabindex:"-1",title:t.personality.installed?"":"Not installed"},[u("div",{class:We(t.personality.installed?"":"border-red-500")},[u("div",hit,[u("img",{onClick:e[0]||(e[0]=(...a)=>r.toggleSelected&&r.toggleSelected(...a)),ref:"imgElement",src:r.getImgUrl(),onError:e[1]||(e[1]=a=>r.defaultImg(a)),class:"w-10 h-10 rounded-full object-fill text-red-700 cursor-pointer"},null,40,fit),u("h3",{onClick:e[2]||(e[2]=(...a)=>r.toggleSelected&&r.toggleSelected(...a)),class:"font-bold font-large text-lg line-clamp-3 cursor-pointer"},ge(t.personality.name),1),u("button",{class:"hover:text-secondary duration-75 active:scale-90 font-medium rounded-lg text-sm p-2 text-center inline-flex items-center",title:"Copy link to clipboard",onClick:e[3]||(e[3]=Ce(a=>r.toggleCopyLink(),["stop"]))},git)]),u("div",bit,[u("div",Eit,[u("div",vit,[Sit,yit,Ze(" "+ge(t.personality.author),1)]),u("div",Tit,[xit,Cit,Ze(" "+ge(t.personality.version),1)]),t.personality.languages&&t.select_language?(O(),D("div",Rit,[Ait,wit,s.isMounted?W("",!0):de((O(),D("select",{key:0,id:"languages","onUpdate:modelValue":e[4]||(e[4]=a=>t.personality.language=a),class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},[(O(!0),D(Ke,null,pt(t.personality.languages,(a,l)=>(O(),D("option",{key:l,selected:a==t.personality.languages[0]},ge(a),9,Nit))),128))],512)),[[zn,t.personality.language]])])):W("",!0),t.personality.language?(O(),D("div",Oit,[Iit,Mit,Ze(" "+ge(t.personality.language),1)])):W("",!0),u("div",Dit,[kit,Lit,Ze(" "+ge(t.personality.category),1)])]),Pit,u("p",{class:"mx-1 opacity-80 h-20 overflow-y-auto scrollbar-thin scrollbar-track-bg-light-tone scrollbar-thumb-bg-light-tone-panel hover:scrollbar-thumb-primary dark:scrollbar-track-bg-dark-tone dark:scrollbar-thumb-bg-dark-tone-panel dark:hover:scrollbar-thumb-primary active:scrollbar-thumb-secondary",title:t.personality.description,innerHTML:t.personality.description},null,8,Uit)]),u("div",Fit,[s.isMounted?(O(),D("button",{key:0,type:"button",title:"Select",onClick:[e[5]||(e[5]=(...a)=>r.toggleSelected&&r.toggleSelected(...a)),e[6]||(e[6]=Ce(()=>{},["stop"]))],class:"hover:text-secondary duration-75 active:scale-90 font-medium rounded-lg text-sm p-2 text-center inline-flex items-center"},zit)):W("",!0),s.isMounted?(O(),D("button",{key:1,type:"button",title:"Talk",onClick:[e[7]||(e[7]=(...a)=>r.toggleTalk&&r.toggleTalk(...a)),e[8]||(e[8]=Ce(()=>{},["stop"]))],class:"hover:text-secondary duration-75 active:scale-90 font-medium rounded-lg text-sm p-2 text-center inline-flex items-center"},qit)):W("",!0),Ie(o,{commands:r.commandsList,force_position:2,title:"Menu"},null,8,["commands"])])],2)],10,_it)}const hO=vt(pit,[["render",Yit]]);const $it={props:{code:String},data(){return{evaluatedCode:"",componentKey:0}},watch:{code:{handler(n){console.log("Code changed"),this.evaluateScriptTags(n),this.componentKey++},immediate:!0}},methods:{evaluateScriptTags(n){const e=document.createElement("div");e.innerHTML=n,e.querySelectorAll("script").forEach(i=>{const s=document.createElement("script");s.textContent=i.textContent,document.body.appendChild(s),document.body.removeChild(s)}),this.evaluatedCode=e.innerHTML,console.log("evaluated code: "+this.evaluatedCode)}}},Wit=["innerHTML"];function Kit(n,e,t,i,s,r){return O(),D("div",{innerHTML:s.evaluatedCode,key:s.componentKey},null,8,Wit)}const fO=vt($it,[["render",Kit]]),jit="/",Qit={components:{DynamicUIRenderer:fO},props:{binding:{},onSelected:Function,onReinstall:Function,onInstall:Function,onUnInstall:Function,onSettings:Function,onReloadBinding:Function,selected:Boolean},data(){return{isTemplate:!1}},mounted(){Ve(()=>{qe.replace()})},methods:{getImgUrl(){return jit+this.binding.icon},defaultImg(n){n.target.src=Sc},toggleSelected(){this.onSelected(this)},toggleInstall(){this.onInstall(this)},toggleUnInstall(){this.onUnInstall(this)},toggleReinstall(){this.onReinstall(this)},toggleReloadBinding(){this.onReloadBinding(this)},toggleSettings(){this.onSettings(this)},getStatus(){(this.binding.folder==="backend_template"||this.binding.folder==="binding_template")&&(this.isTemplate=!0)}},watch:{selected(){Ve(()=>{qe.replace()})}}},Xit=["title"],Zit={class:"flex flex-row items-center gap-3"},Jit=["src"],est={class:"font-bold font-large text-lg truncate"},tst=u("div",{class:"grow"},null,-1),nst={class:"flex-none gap-1"},ist=u("i",{"data-feather":"refresh-cw",class:"w-5"},null,-1),sst=u("span",{class:"sr-only"},"Help",-1),rst=[ist,sst],ost={class:"flex items-center flex-row-reverse gap-2 my-1"},ast=u("span",{class:"sr-only"},"Click to install",-1),lst=u("span",{class:"sr-only"},"Reinstall",-1),cst=u("span",{class:"sr-only"},"UnInstall",-1),dst=u("span",{class:"sr-only"},"Settings",-1),ust={class:""},pst={class:""},_st={class:"flex items-center"},hst=u("i",{"data-feather":"user",class:"w-5 m-1"},null,-1),fst=u("b",null,"Author: ",-1),mst={class:"flex items-center"},gst=u("i",{"data-feather":"folder",class:"w-5 m-1"},null,-1),bst=u("b",null,"Folder: ",-1),Est={class:"flex items-center"},vst=u("i",{"data-feather":"git-merge",class:"w-5 m-1"},null,-1),Sst=u("b",null,"Version: ",-1),yst={class:"flex items-center"},Tst=u("i",{"data-feather":"github",class:"w-5 m-1"},null,-1),xst=u("b",null,"Link: ",-1),Cst=["href"],Rst=u("div",{class:"flex items-center"},[u("i",{"data-feather":"info",class:"w-5 m-1"}),u("b",null,"Description: "),u("br")],-1),Ast=["title","innerHTML"];function wst(n,e,t,i,s,r){const o=gt("DynamicUIRenderer");return O(),D("div",{class:We(["items-start p-4 hover:bg-primary-light hover:border-primary-light rounded-lg mb-2 shadow-lg border-2 cursor-pointer select-none",t.selected?" border-primary bg-primary":"border-transparent"]),onClick:e[7]||(e[7]=Ce((...a)=>r.toggleSelected&&r.toggleSelected(...a),["stop"])),title:t.binding.installed?t.binding.name:"Not installed"},[u("div",null,[u("div",Zit,[u("img",{ref:"imgElement",src:r.getImgUrl(),onError:e[0]||(e[0]=a=>r.defaultImg(a)),class:"w-10 h-10 rounded-full object-fill text-blue-700"},null,40,Jit),u("h3",est,ge(t.binding.name),1),tst,u("div",nst,[t.selected?(O(),D("button",{key:0,type:"button",title:"Reload binding",onClick:[e[1]||(e[1]=(...a)=>r.toggleReloadBinding&&r.toggleReloadBinding(...a)),e[2]||(e[2]=Ce(()=>{},["stop"]))],class:"hover:text-secondary duration-75 active:scale-90 font-medium rounded-lg text-sm p-2 text-center inline-flex items-center"},rst)):W("",!0)])]),u("div",ost,[t.binding.installed?W("",!0):(O(),D("button",{key:0,title:"Click to install",type:"button",onClick:e[3]||(e[3]=Ce((...a)=>r.toggleInstall&&r.toggleInstall(...a),["stop"])),class:"inline-flex items-center gap-2 px-3 py-2 text-xs font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"},[Ze(" Install "),ast])),t.binding.installed?(O(),D("button",{key:1,title:"Click to Reinstall binding",type:"button",onClick:e[4]||(e[4]=Ce((...a)=>r.toggleReinstall&&r.toggleReinstall(...a),["stop"])),class:"inline-flex items-center gap-2 px-3 py-2 text-xs font-medium text-center focus:outline-none text-white bg-green-700 hover:bg-red-800 focus:ring-4 focus:ring-green-300 rounded-lg dark:bg-green-600 dark:hover:bg-green-700 dark:focus:ring-red-900"},[Ze(" Reinstall "),lst])):W("",!0),t.binding.installed?(O(),D("button",{key:2,title:"Click to Reinstall binding",type:"button",onClick:e[5]||(e[5]=Ce((...a)=>r.toggleUnInstall&&r.toggleUnInstall(...a),["stop"])),class:"inline-flex items-center gap-2 px-3 py-2 text-xs font-medium text-center focus:outline-none text-white bg-red-700 hover:bg-red-800 focus:ring-4 focus:ring-red-300 rounded-lg dark:bg-red-600 dark:hover:bg-red-700 dark:focus:ring-red-900"},[Ze(" Uninstall "),cst])):W("",!0),t.selected?(O(),D("button",{key:3,title:"Click to open Settings",type:"button",onClick:e[6]||(e[6]=Ce((...a)=>r.toggleSettings&&r.toggleSettings(...a),["stop"])),class:"inline-flex items-center gap-2 px-3 py-2 text-xs font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800"},[Ze(" Settings "),dst])):W("",!0)]),t.binding.ui?(O(),Mt(o,{key:0,class:"w-full h-full",code:t.binding.ui},null,8,["code"])):W("",!0),u("div",ust,[u("div",pst,[u("div",_st,[hst,fst,Ze(" "+ge(t.binding.author),1)]),u("div",mst,[gst,bst,Ze(" "+ge(t.binding.folder),1)]),u("div",Est,[vst,Sst,Ze(" "+ge(t.binding.version),1)]),u("div",yst,[Tst,xst,u("a",{href:t.binding.link,target:"_blank",class:"flex items-center hover:text-secondary duration-75 active:scale-90"},ge(t.binding.link),9,Cst)])]),Rst,u("p",{class:"mx-1 opacity-80 line-clamp-3",title:t.binding.description,innerHTML:t.binding.description},null,8,Ast)])])],10,Xit)}const Nst=vt(Qit,[["render",wst]]),Ost="/assets/extension-59119348.png",Ist={data(){return{show:!1,model_path:"",resolve:null}},methods:{cancel(){this.resolve(null)},openInputBox(){return new Promise(n=>{this.resolve=n})},hide(n){this.show=!1,this.resolve&&(this.resolve(n),this.resolve=null)},showDialog(n){return new Promise(e=>{this.model_path=n,this.show=!0,this.resolve=e})}}},Mst={key:0,class:"fixed top-0 left-0 right-0 bottom-0 flex items-center justify-center bg-black bg-opacity-50"},Dst={class:"relative w-full max-w-md max-h-full"},kst={class:"relative bg-white rounded-lg shadow dark:bg-gray-700"},Lst=u("svg",{"aria-hidden":"true",class:"w-5 h-5",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},[u("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),Pst=u("span",{class:"sr-only"},"Close modal",-1),Ust=[Lst,Pst],Fst={class:"p-4 text-center"},Bst=u("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"},[u("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),Gst={class:"p-4 text-center mx-auto mb-4"},zst=u("label",{class:"mr-2"},"Model path",-1);function Vst(n,e,t,i,s,r){return s.show?(O(),D("div",Mst,[u("div",Dst,[u("div",kst,[u("button",{type:"button",onClick:e[0]||(e[0]=o=>r.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"},Ust),u("div",Fst,[Bst,u("div",Gst,[zst,de(u("input",{"onUpdate:modelValue":e[1]||(e[1]=o=>s.model_path=o),class:"px-4 py-2 border border-gray-300 rounded-lg",type:"text"},null,512),[[Ue,s.model_path]])]),u("button",{onClick:e[2]||(e[2]=o=>r.hide(!0)),type:"button",class:"text-white bg-green-600 hover:bg-green-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"}," Add "),u("button",{onClick:e[3]||(e[3]=o=>r.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")])])])])):W("",!0)}const Hst=vt(Ist,[["render",Vst]]);const qst={props:{show:{type:Boolean,default:!1,required:!1},can_remove:{type:Boolean,default:!1},title:{type:String,default:"Select an option"},choices:{type:Array,required:!0}},data(){return{selectedChoice:null,showInput:!1,newFilename:""}},methods:{displayName(n){return console.log("choice:",n),typeof n=="string"?n:n&&n.name?n.name:""},selectChoice(n){this.selectedChoice=n,this.$emit("choice-selected",n)},closeDialog(){this.$emit("close-dialog")},validateChoice(){this.$emit("choice-validated",this.selectedChoice)},formatSize(n){return n<1024?n+" bytes":n<1024*1024?(n/1024).toFixed(2)+" KB":n<1024*1024*1024?(n/(1024*1024)).toFixed(2)+" MB":(n/(1024*1024*1024)).toFixed(2)+" GB"},toggleInput(){this.showInput=!this.showInput},addNewFilename(){const n=this.newFilename.trim();n!==""&&(this.choices.push(n),this.newFilename="",this.selectChoice(n)),this.showInput=!1},removeChoice(n,e){this.choices.splice(e,1),n===this.selectedChoice&&(this.selectedChoice=null),this.$emit("choice-removed",n)}}},Yst={key:0,class:"fixed inset-0 flex items-center justify-center bg-black bg-opacity-50"},$st={class:"bg-white dark:bg-gray-800 rounded-lg p-6 w-96"},Wst={class:"text-xl font-semibold mb-4"},Kst={class:"h-48 overflow-y-auto"},jst=["onClick"],Qst={class:"font-bold"},Xst=u("br",null,null,-1),Zst={key:0,class:"text-xs text-gray-500"},Jst=["onClick"],ert={key:0,class:"mt-4"},trt={class:"flex justify-end mt-4"},nrt=["disabled"];function irt(n,e,t,i,s,r){return O(),Mt(Gs,{name:"fade"},{default:nt(()=>[t.show?(O(),D("div",Yst,[u("div",$st,[u("h2",Wst,ge(t.title),1),u("div",Kst,[u("ul",null,[(O(!0),D(Ke,null,pt(t.choices,(o,a)=>(O(),D("li",{key:a,onClick:l=>r.selectChoice(o),class:We([{"selected-choice":o===s.selectedChoice},"py-2 px-4 cursor-pointer hover:bg-gray-200 dark:hover:bg-gray-700"])},[u("span",Qst,ge(r.displayName(o)),1),Xst,o.size?(O(),D("span",Zst,ge(r.formatSize(o.size)),1)):W("",!0),t.can_remove?(O(),D("button",{key:1,onClick:l=>r.removeChoice(o,a),class:"ml-2 text-red-500 hover:text-red-600"}," X ",8,Jst)):W("",!0)],10,jst))),128))])]),s.showInput?(O(),D("div",ert,[de(u("input",{"onUpdate:modelValue":e[0]||(e[0]=o=>s.newFilename=o),placeholder:"Enter a filename",class:"border border-gray-300 p-2 rounded-lg w-full"},null,512),[[Ue,s.newFilename]]),u("button",{onClick:e[1]||(e[1]=(...o)=>r.addNewFilename&&r.addNewFilename(...o)),class:"mt-2 py-2 px-4 bg-green-500 hover:bg-green-600 text-white rounded-lg transition duration-300"}," Add ")])):W("",!0),u("div",trt,[u("button",{onClick:e[2]||(e[2]=(...o)=>r.closeDialog&&r.closeDialog(...o)),class:"py-2 px-4 mr-2 bg-red-500 hover:bg-red-600 text-white rounded-lg transition duration-300"}," Cancel "),u("button",{onClick:e[3]||(e[3]=(...o)=>r.validateChoice&&r.validateChoice(...o)),class:We([{"bg-gray-400 cursor-not-allowed":!s.selectedChoice,"bg-blue-500 hover:bg-blue-600":s.selectedChoice,"text-white":s.selectedChoice,"text-gray-500":!s.selectedChoice},"py-2 px-4 rounded-lg transition duration-300"]),disabled:!s.selectedChoice}," Validate ",10,nrt),u("button",{onClick:e[4]||(e[4]=(...o)=>r.toggleInput&&r.toggleInput(...o)),class:"py-2 px-4 ml-2 bg-blue-500 hover:bg-blue-600 text-white rounded-lg transition duration-300"}," Add New ")])])])):W("",!0)]),_:1})}const AE=vt(qst,[["render",irt]]),srt={props:{radioOptions:{type:Array,required:!0},defaultValue:{type:String,default:0}},data(){return{selectedValue:this.defaultValue}},methods:{handleRadioChange(n){this.selectedValue!==null&&this.$emit("radio-selected",this.selectedValue,n)}}},rrt={class:"flex space-x-4"},ort=["value","onChange"],art={class:"text-gray-700"};function lrt(n,e,t,i,s,r){return O(),D("div",rrt,[(O(!0),D(Ke,null,pt(t.radioOptions,(o,a)=>(O(),D("label",{key:o.value,class:"flex items-center space-x-2"},[de(u("input",{type:"radio",value:o.value,"onUpdate:modelValue":e[0]||(e[0]=l=>s.selectedValue=l),onChange:l=>r.handleRadioChange(a),class:"text-blue-500 focus:ring-2 focus:ring-blue-200"},null,40,ort),[[z2,s.selectedValue]]),u("span",art,ge(o.label),1)]))),128))])}const crt=vt(srt,[["render",lrt]]),drt="/",urt={props:{extension:{},select_language:Boolean,selected:Boolean,full_path:String,onTalk:Function,onSelected:Function,onMount:Function,onUnMount:Function,onRemount:Function,onReinstall:Function,onSettings:Function},components:{InteractiveMenu:lp},data(){return{isMounted:!1,name:this.extension.name}},computed:{commandsList(){let n=[{name:this.isMounted?"unmount":"mount",icon:"feather:settings",is_file:!1,value:this.isMounted?this.unmount:this.mount},{name:"reinstall",icon:"feather:terminal",is_file:!1,value:this.toggleReinstall}];return this.isMounted&&n.push({name:"remount",icon:"feather:refresh-ccw",is_file:!1,value:this.reMount}),n.push({name:"settings",icon:"feather:settings",is_file:!1,value:this.toggleSettings}),n},selected_computed(){return this.selected}},mounted(){this.isMounted=this.extension.isMounted,Ve(()=>{qe.replace()})},methods:{getImgUrl(){return drt+this.extension.avatar},defaultImg(n){n.target.src=Sc},toggleTalk(){this.onTalk(this)},toggleSelected(){this.isMounted&&this.onSelected(this)},reMount(){this.onRemount(this)},mount(){console.log("Mounting"),this.onMount(this)},unmount(){console.log("Unmounting"),console.log(this.onUnMount),this.onUnMount(this)},toggleSettings(){this.onSettings(this)},toggleReinstall(){this.onReinstall(this)}},watch:{selected(){Ve(()=>{qe.replace()})}}},prt=["title"],_rt={class:"flex flex-row items-center flex-shrink-0 gap-3"},hrt=["src"],frt={class:""},mrt={class:""},grt={class:"flex items-center"},brt=u("i",{"data-feather":"user",class:"w-5 m-1"},null,-1),Ert=u("b",null,"Author: ",-1),vrt={class:"flex items-center"},Srt=u("i",{"data-feather":"bookmark",class:"w-5 m-1"},null,-1),yrt=u("b",null,"Based on: ",-1),Trt={key:0,class:"flex items-center"},xrt=u("i",{"data-feather":"globe",class:"w-5 m-1"},null,-1),Crt=u("b",null,"Languages: ",-1),Rrt=["selected"],Art={key:1,class:"flex items-center"},wrt=u("i",{"data-feather":"globe",class:"w-5 m-1"},null,-1),Nrt=u("b",null,"Language: ",-1),Ort={class:"flex items-center"},Irt=u("i",{"data-feather":"bookmark",class:"w-5 m-1"},null,-1),Mrt=u("b",null,"Category: ",-1),Drt=u("div",{class:"flex items-center"},[u("i",{"data-feather":"info",class:"w-5 m-1"}),u("b",null,"Description: "),u("br")],-1),krt=["title","innerHTML"],Lrt={class:"rounded bg-blue-300"},Prt=u("i",{"data-feather":"check"},null,-1),Urt=u("span",{class:"sr-only"},"Select",-1),Frt=[Prt,Urt],Brt=u("i",{"data-feather":"send",class:"w-5"},null,-1),Grt=u("span",{class:"sr-only"},"Talk",-1),zrt=[Brt,Grt];function Vrt(n,e,t,i,s,r){const o=gt("InteractiveMenu");return O(),D("div",{class:We(["min-w-96 items-start p-4 hover:bg-primary-light rounded-lg mb-2 shadow-lg border-2 cursor-pointer select-none",r.selected_computed?"border-2 border-primary-light":"border-transparent",s.isMounted?"bg-blue-200 dark:bg-blue-700":""]),tabindex:"-1",title:t.extension.installed?"":"Not installed"},[u("div",{class:We(t.extension.installed?"":"border-red-500")},[u("div",_rt,[u("img",{onClick:e[0]||(e[0]=(...a)=>r.toggleSelected&&r.toggleSelected(...a)),ref:"imgElement",src:r.getImgUrl(),onError:e[1]||(e[1]=a=>r.defaultImg(a)),class:"w-10 h-10 rounded-full object-fill text-red-700 cursor-pointer"},null,40,hrt),u("h3",{onClick:e[2]||(e[2]=(...a)=>r.toggleSelected&&r.toggleSelected(...a)),class:"font-bold font-large text-lg line-clamp-3 cursor-pointer"},ge(t.extension.name),1)]),u("div",frt,[u("div",mrt,[u("div",grt,[brt,Ert,Ze(" "+ge(t.extension.author),1)]),u("div",vrt,[Srt,yrt,Ze(" "+ge(t.extension.based_on),1)]),t.extension.languages&&t.select_language?(O(),D("div",Trt,[xrt,Crt,de(u("select",{id:"languages","onUpdate:modelValue":e[3]||(e[3]=a=>t.extension.language=a),class:"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"},[(O(!0),D(Ke,null,pt(t.extension.languages,(a,l)=>(O(),D("option",{key:l,selected:a==t.extension.languages[0]},ge(a),9,Rrt))),128))],512),[[zn,t.extension.language]])])):W("",!0),t.extension.language?(O(),D("div",Art,[wrt,Nrt,Ze(" "+ge(t.extension.language),1)])):W("",!0),u("div",Ort,[Irt,Mrt,Ze(" "+ge(t.extension.category),1)])]),Drt,u("p",{class:"mx-1 opacity-80 h-20 overflow-y-auto scrollbar-thin scrollbar-track-bg-light-tone scrollbar-thumb-bg-light-tone-panel hover:scrollbar-thumb-primary dark:scrollbar-track-bg-dark-tone dark:scrollbar-thumb-bg-dark-tone-panel dark:hover:scrollbar-thumb-primary active:scrollbar-thumb-secondary",title:t.extension.description,innerHTML:t.extension.description},null,8,krt)]),u("div",Lrt,[s.isMounted?(O(),D("button",{key:0,type:"button",title:"Select",onClick:[e[4]||(e[4]=(...a)=>r.toggleSelected&&r.toggleSelected(...a)),e[5]||(e[5]=Ce(()=>{},["stop"]))],class:"hover:text-secondary duration-75 active:scale-90 font-medium rounded-lg text-sm p-2 text-center inline-flex items-center"},Frt)):W("",!0),s.isMounted?(O(),D("button",{key:1,type:"button",title:"Talk",onClick:[e[6]||(e[6]=(...a)=>r.toggleTalk&&r.toggleTalk(...a)),e[7]||(e[7]=Ce(()=>{},["stop"]))],class:"hover:text-secondary duration-75 active:scale-90 font-medium rounded-lg text-sm p-2 text-center inline-flex items-center"},zrt)):W("",!0),Ie(o,{commands:r.commandsList,force_position:2,title:"Menu"},null,8,["commands"])])],2)],10,prt)}const Hrt=vt(urt,[["render",Vrt]]),qrt="/assets/gpu-df72bf63.svg";const Yrt="/";Le.defaults.baseURL="/";const $rt={components:{AddModelDialog:Hst,ModelEntry:Knt,PersonalityViewer:dit,PersonalityEntry:hO,BindingEntry:Nst,ChoiceDialog:AE,Card:vc,RadioOptions:crt,ExtensionEntry:Hrt},data(){return{posts_headers:{accept:"application/json","Content-Type":"application/json"},defaultModelImgPlaceholder:Li,voices:[],voice_languages:{Arabic:"ar","Brazilian Portuguese":"pt",Chinese:"zh-cn",Czech:"cs",Dutch:"nl",English:"en",French:"fr",German:"de",Italian:"it",Polish:"pl",Russian:"ru",Spanish:"es",Turkish:"tr",Japanese:"ja",Korean:"ko",Hungarian:"hu",Hindi:"hi"},binding_changed:!1,SVGGPU:qrt,models_zoo:[],models_zoo_initialLoadCount:10,models_zoo_loadMoreCount:5,models_zoo_loadedEntries:[],models_zoo_scrollThreshold:200,sortOptions:[{label:"Sort by Date",value:0},{label:"Sort by Rank",value:1},{label:"Sort by Name",value:2},{label:"Sort by Maker",value:3},{label:"Sort by Quantizer",value:4}],show_only_installed_models:!1,reference_path:"",audioVoices:[],has_updates:!1,variant_choices:[],variantSelectionDialogVisible:!1,currenModelToInstall:null,loading_text:"",extension_category:"bound_extensions",personality_category:null,addModelDialogVisibility:!1,modelPath:"",personalitiesFiltered:[],modelsFiltered:[],extensionsFiltered:[],collapsedArr:[],all_collapsed:!0,servers_conf_collapsed:!0,minconf_collapsed:!0,bec_collapsed:!0,sort_type:0,is_loading_zoo:!1,mzc_collapsed:!0,mzdc_collapsed:!0,pzc_collapsed:!0,ezc_collapsed:!0,mep_collapsed:!0,bzc_collapsed:!0,pc_collapsed:!0,mc_collapsed:!0,sc_collapsed:!0,mzl_collapsed:!1,pzl_collapsed:!1,ezl_collapsed:!1,bzl_collapsed:!1,extCatgArr:[],persCatgArr:[],persArr:[],showConfirmation:!1,showToast:!1,isLoading:!1,settingsChanged:!1,isModelSelected:!1,isMounted:!1,bUrl:Yrt,searchPersonality:"",searchExtension:"",searchModel:"",searchPersonalityTimer:{},searchPersonalityTimerInterval:1500,searchModelTimerInterval:1500,searchPersonalityInProgress:!1,searchExtensionInProgress:!1,searchModelInProgress:!1,addModel:{},modelDownlaodInProgress:!1,uploadData:[]}},async created(){Xe.on("loading_text",this.on_loading_text),this.updateHasUpdates()},methods:{reinstallSDService(){Le.get("install_sd").then(n=>{}).catch(n=>{console.error(n)})},reinstallMotionCtrlService(){Le.get("install_motion_ctrl").then(n=>{}).catch(n=>{console.error(n)})},reinstallvLLMService(){Le.get("install_vllm").then(n=>{}).catch(n=>{console.error(n)})},startvLLMService(){Le.get("start_vllm").then(n=>{}).catch(n=>{console.error(n)})},startollamaService(){Le.get("start_ollama").then(n=>{}).catch(n=>{console.error(n)})},reinstallPetalsService(){Le.get("install_petals").then(n=>{}).catch(n=>{console.error(n)})},reinstallOLLAMAService(){Le.get("install_ollama").then(n=>{}).catch(n=>{console.error(n)})},reinstallAudioService(){Le.get("install_xtts").then(n=>{}).catch(n=>{console.error(n)})},reinstallElasticSearchService(){Le.get("install_vllm").then(n=>{}).catch(n=>{console.error(n)})},getSeviceVoices(){Le.get("list_voices").then(n=>{this.voices=n.data.voices}).catch(n=>{console.error(n)})},load_more_models(){this.models_zoo_initialLoadCount+10{qe.replace()}),this.binding_changed&&!this.mzc_collapsed&&(this.modelsZoo==null||this.modelsZoo.length==0)&&(console.log("Refreshing models"),await this.$store.dispatch("refreshConfig"),this.models_zoo=[],this.refreshModelsZoo(),this.binding_changed=!1)},async selectSortOption(n){this.$store.state.sort_type=n,this.updateModelsZoo(),console.log(`Selected sorting:${n}`),console.log(`models:${this.models_zoo}`)},handleRadioSelected(n){this.isLoading=!0,this.selectSortOption(n).then(()=>{this.isLoading=!1})},filter_installed(n){return console.log("filtering"),n.filter(e=>e.isInstalled===!0)},getVoices(){"speechSynthesis"in window&&(this.audioVoices=speechSynthesis.getVoices(),console.log("Voices:"+this.audioVoices),!this.audio_out_voice&&this.audioVoices.length>0&&(this.audio_out_voice=this.audioVoices[0].name),speechSynthesis.onvoiceschanged=()=>{})},async updateHasUpdates(){let n=await this.api_get_req("check_update");this.has_updates=n.update_availability,console.log("has_updates",this.has_updates)},onVariantChoiceSelected(n){this.selected_variant=n},oncloseVariantChoiceDialog(){this.variantSelectionDialogVisible=!1},onvalidateVariantChoice(n){this.variantSelectionDialogVisible=!1,this.currenModelToInstall.installing=!0;let e=this.currenModelToInstall;if(e.linkNotValid){e.installing=!1,this.$store.state.toast.showToast("Link is not valid, file does not exist",4,!1);return}let t="https://huggingface.co/"+e.model.quantizer+"/"+e.model.name+"/resolve/main/"+this.selected_variant.name;this.showProgress=!0,this.progress=0,this.addModel={model_name:this.selected_variant.name,binding_folder:this.configFile.binding_name,model_url:t},console.log("installing...",this.addModel);const i=s=>{if(console.log("received something"),s.status&&s.progress<=100){if(this.addModel=s,console.log("Progress",s),e.progress=s.progress,e.speed=s.speed,e.total_size=s.total_size,e.downloaded_size=s.downloaded_size,e.start_time=s.start_time,e.installing=!0,e.progress==100){const r=this.models_zoo.findIndex(o=>o.name===e.model.name);this.models_zoo[r].isInstalled=!0,this.showProgress=!1,e.installing=!1,console.log("Received succeeded"),Xe.off("install_progress",i),console.log("Installed successfully"),this.$store.state.toast.showToast(`Model: `+e.model.name+` installed!`,4,!0),this.$store.dispatch("refreshDiskUsage")}}else Xe.off("install_progress",i),console.log("Install failed"),e.installing=!1,this.showProgress=!1,console.error("Installation failed:",s.error),this.$store.state.toast.showToast(`Model: `+e.model.name+` diff --git a/web/dist/index.html b/web/dist/index.html index 3f219140..9fc6a53c 100644 --- a/web/dist/index.html +++ b/web/dist/index.html @@ -6,7 +6,7 @@ LoLLMS WebUI - Welcome - + diff --git a/web/src/components/ModelEntry.vue b/web/src/components/ModelEntry.vue index cf8cedd4..7a18bd8d 100644 --- a/web/src/components/ModelEntry.vue +++ b/web/src/components/ModelEntry.vue @@ -317,7 +317,9 @@ export default { } }, toggleSelected(event) { - if (event.target.classList.contains('child-element')) { + console.log("event.target.tagName.toLowerCase()") + console.log(event.target.tagName.toLowerCase()) + if (event.target.tagName.toLowerCase() === 'button' || event.target.tagName.toLowerCase() === 'svg') { event.stopPropagation(); return; } diff --git a/zoos/bindings_zoo b/zoos/bindings_zoo index af88028e..d205fe80 160000 --- a/zoos/bindings_zoo +++ b/zoos/bindings_zoo @@ -1 +1 @@ -Subproject commit af88028e352bd599b2a9fe49b31c8434a4307cbf +Subproject commit d205fe80c7cb65ef0b563977592a21e71de4ad73 diff --git a/zoos/models_zoo b/zoos/models_zoo index b5435513..b372f934 160000 --- a/zoos/models_zoo +++ b/zoos/models_zoo @@ -1 +1 @@ -Subproject commit b54355139c63d39f496eb89665852996ebf9c09d +Subproject commit b372f934da4c9cc5b261a9d8f36b5df6a7488b66