From e1869b207abeda97c5e5985182fe8532607bea45 Mon Sep 17 00:00:00 2001 From: physton Date: Tue, 26 Mar 2024 17:00:14 +0800 Subject: [PATCH] #317 [Bug] lost separators in prompt --- javascript/main.entry.js | 2 +- javascript/main.entry.js.map | 2 +- src/src/components/phystonPrompt.vue | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/javascript/main.entry.js b/javascript/main.entry.js index b6fd484..81fa758 100644 --- a/javascript/main.entry.js +++ b/javascript/main.entry.js @@ -49,7 +49,7 @@ ${$$1($n)}`),Nn}})}function J$1(_n){const Cn=Object.keys(_n),$n=Cn.filter(Bn=>{v `)this._appendTag(` `,` `,!1,-1,"wrap");else{let Hn=!1;for(let rr of In)if(rr.value===Dn){Hn=rr;break}const Wn=Hn?Hn.localValue:"",Xn=Hn?Hn.disabled:!1,Gn=this._appendTag(Dn,Wn,Xn,-1,"text");!Hn&&Gn!==-1&&Ln.push(Gn)}}if(this.autoTranslateToLocal&&_n){let Pn=!(this.tagCompleteFile&&this.onlyCsvOnAuto);Pn=!1,this.translates(Ln,!0,Pn).finally(()=>{this.updateTags()})}else this.updateTags()},_setTextareaFocus(){if(typeof get_uiCurrentTabContent!="function"||typeof activePromptTextarea!="object")return;const _n=get_uiCurrentTabContent();if(!_n)return;let Cn=_n.id.replace("tab_","");Cn&&(activePromptTextarea[Cn]=this.textarea)},copy(_n){this.$copyText(_n).then(()=>{this.$toastr.success(this.getLang("success"))}).catch(()=>{this.$toastr.error(this.getLang("failed"))})},genPrompt(_n=null,Cn=!1){_n=_n||this.tags;let $n=[],Nn=[];if(Cn)Nn=_n;else for(let Ln in _n)_n[Ln].disabled||Nn.push(_n[Ln]);let Bn=Nn.length;return Nn.forEach((Ln,In)=>{let Pn="";if(typeof Ln.type=="string"&&Ln.type==="wrap")Pn=` -`;else{let Dn=common$1.replaceTag(Ln.value);Dn!==Ln.value&&(Ln.value=Dn,this._setTag(Ln));let Hn=common$1.replaceTag(Ln.localValue);if(Hn!==Ln.localValue&&(Ln.localValue=Hn),(Ln.weightNum>0||Ln.weightNum<0)&&(Ln.weightNum=Number(parseFloat(Ln.weightNum).toFixed(6)),Ln.value=Ln.value.replace(common$1.weightNumRegex,"$1:"+Ln.weightNum),Ln.localValue!==""&&(Ln.localValue=Ln.localValue.replace(common$1.weightNumRegex,"$1:"+Ln.weightNum))),Ln.disabled&&!Cn)return;let Wn=","+(this.autoRemoveSpace?"":" "),Xn=Wn,Gn=null,rr=!1,nr=!1,Yo=!1,ei=!1;if(In+1=0){let Bn=this.tags[$n-1];typeof Bn.type=="string"&&Bn.type==="wrap"||_n.push($n)}if(this.autoBreakAfterWrap&&$n+10||Ln.weightNum<0)&&(Ln.weightNum=Number(parseFloat(Ln.weightNum).toFixed(6)),Ln.value=Ln.value.replace(common$1.weightNumRegex,"$1:"+Ln.weightNum),Ln.localValue!==""&&(Ln.localValue=Ln.localValue.replace(common$1.weightNumRegex,"$1:"+Ln.weightNum))),Ln.disabled&&!Cn)return;let Wn=","+(this.autoRemoveSpace?"":" "),Xn=Wn,Gn=null,rr=!1,nr=!1,Yo=!1,ei=!1;if(In+1=0){let Bn=this.tags[$n-1];typeof Bn.type=="string"&&Bn.type==="wrap"||_n.push($n)}if(this.autoBreakAfterWrap&&$n+1{const{token_count:$n,max_length:Nn}=Cn;this.counterText=`${$n}/${Nn}`}),this.tags.length&&this.gradioAPI.getLatestHistory(this.historyKey).then(Cn=>{Cn&&Cn.prompt===this.prompt?this.gradioAPI.setHistory(this.historyKey,Cn.id,this.tags,this.prompt,Cn.name).then($n=>{}).catch($n=>{}):this.gradioAPI.pushHistory(this.historyKey,this.tags,this.prompt).then($n=>{}).catch($n=>{})}).catch(Cn=>{}),this.$nextTick(()=>{for(let Cn=0;CnLn.getAttribute("data-id")===Nn);Bn&&$n.parentNode.insertBefore(Bn,$n.nextElementSibling)}})},onResize(){this.tags.forEach(_n=>{this._setTagHeight(_n)})},initSortable(){this.sortable=Sortable.create(this.$refs.promptTagsList,{animation:150,handle:".prompt-tag-value",draggable:".prompt-tag",onEnd:_n=>{if(this.dropTags.length){let $n=_n.item,Nn=$n.getAttribute("data-id"),Bn=this._getDropTagsEle(),Ln=Bn.findIndex(Dn=>Dn.getAttribute("data-id")===Nn),In=Bn.slice(0,Ln),Pn=Bn.slice(Ln+1).reverse();In.forEach(Dn=>{common$1.insertBefore(Dn,$n)}),Pn.forEach(Dn=>{common$1.insertAfter(Dn,$n)})}this._dropOver(),this.droping=!1;let Cn=[];for(let $n=0;$nCn.indexOf($n.id)-Cn.indexOf(Nn.id)),this.$forceUpdate(),this.updateTags()},onChoose:_n=>{if(console.log(_n),this.dropTags.length){let $n=_n.item.getAttribute("data-id");this._getDropTagsEle().forEach(Bn=>{Bn.getAttribute("data-id")!==$n&&(Bn.style.display="block",Bn.style.transition="transform 0.2s",Bn.style.transform="scale(0)",setTimeout(()=>{Bn.style.transition="",Bn.style.transform="",Bn.style.display="none"},300))})}this.editing={},this.isEditing=!1,this.droping=!0},onUnchoose:_n=>{if(this.droping=null,this.dropTags.length){let $n=_n.item.getAttribute("data-id");this._getDropTagsEle().forEach(Bn=>{Bn.getAttribute("data-id")!==$n&&(Bn.style.display="")})}}})},useHistory(_n){this.tags=[],_n.tags.forEach(Cn=>{this._appendTag(Cn.value,Cn.localValue,Cn.disabled,-1,Cn.type||"text")}),this.updateTags()},useFavorite(_n){this.useHistory(_n)},useChatgpt(_n){let Cn=common$1.splitTags(_n,this.autoBreakBeforeWrap,this.autoBreakAfterWrap);this.tags=[],Cn.forEach($n=>{this._appendTag($n,"",!1,-1,"text")}),this.updateTags()},onPromptMainClick(){this.autoLoadWebuiPrompt&&this.onTextareaChange(!0),this._setTextareaFocus(),this.showExtendId=""},translates(_n,Cn=!1,$n=!0){return new Promise((Nn,Bn)=>{if(this.languageCode==="en_US"||this.languageCode==="en_GB"){Nn();return}let Ln=[],In=(rr,nr)=>{rr.forEach(Yo=>{Pn(Yo,nr)})},Pn=(rr,nr)=>{this.canOneTranslate?(this.loading[rr.id+"_local"]=nr,this.loading[rr.id+"_en"]=nr):rr.toLocal?this.loading[rr.id+"_local"]=nr:this.loading[rr.id+"_en"]=nr},Dn=(rr,nr)=>{rr.toLocal?rr.localValue=nr:(rr.localValue=rr.value,rr.value=nr),this._setTagById(rr.id,rr.value,rr.localValue)},Hn=rr=>rr.isLora&&rr.loraExists?this.getExtraNetworkFullName(rr.loraName,"lora"):rr.isLyco&&rr.lycoExists?this.getExtraNetworkFullName(rr.lycoName,"lycoris"):rr.isEmbedding?this.getExtraNetworkFullName(rr.value,"textual inversion"):rr.value;_n.forEach(rr=>{var ei,ti,ui,mi;let nr=this.tags[rr],Yo=Hn(nr);if(Yo!==nr.value){nr.localValue=Yo;return}if(common$1.canTranslate(nr.value)){if(nr.isLora){if((ei=this.blacklist.translate)!=null&&ei.includes(nr.loraName.toLowerCase()))return}else if(nr.isLyco){if((ti=this.blacklist.translate)!=null&&ti.includes(nr.lycoName.toLowerCase()))return}else if(nr.isEmbedding){if((ui=this.blacklist.translate)!=null&&ui.includes(nr.embeddingName.toLowerCase()))return}else if((mi=this.blacklist.translate)!=null&&mi.includes(nr.originalValue.toLowerCase()))return;if(nr.isEnglish=common$1.isEnglishByLangCode(nr.value,this.languageCode),nr.isEnglish===-1)Cn?nr.toLocal=!0:nr.toLocal=!1;else if(nr.isEnglish===0)if(Cn)if(nr.localValue==="")nr.localValue=nr.value,nr.toLocal=!1;else{const Xo=nr.value;nr.value=nr.localValue,nr.localValue=Xo}else nr.toLocal=!1;else nr.toLocal=!0;Pn(nr,!0),Ln.push(nr)}});const Wn=rr=>{if(rr.length<=0){In(rr,!1),Nn();return}let nr={};rr.forEach((ei,ti)=>{let ui=ei.toLocal?"en_US":this.languageCode,mi=ei.toLocal?this.languageCode:"en_US",Xo=ui+"."+mi;nr[Xo]||(nr[Xo]={fromLang:ui,toLang:mi,tags:[]}),nr[Xo].tags.push(ei)});const Yo=()=>{let ei=nr[Object.keys(nr)[0]];if(!ei){Nn();return}let ti=ei.tags.map(ui=>Hn(ui));this.gradioAPI.translates(ti,ei.fromLang,ei.toLang,this.translateApi,this.translateApiConfig).then(ui=>{ui.success?(ui.translated_text.forEach((Xo,vi)=>{Xo=Xo.replace(/\.$/,"").trim(),common$1.isEnglish(Xo)&&Xo!==Xo.toUpperCase()&&(Xo=Xo.toLowerCase());let zn=ei.tags[vi];Xo!==""&&Dn(zn,Xo),Pn(zn,!1)}),delete nr[Object.keys(nr)[0]],Yo()):(In(rr,!1),this.$toastr.error(ui.message),Bn(ui.message))}).catch(ui=>{In(rr,!1),this.$toastr.error(ui.message),Bn(ui.message)})};Yo()};let Xn=rr=>{console.log("translateByCSV",rr.map(Yo=>Yo.value),{useNetwork:$n});let nr=[];rr.forEach(Yo=>{const ei=common$1.splitTag(Yo.value);ei.value!==Yo.value&&(Yo.value=ei.value,Yo.splits=ei),Yo.toLocal?nr.push(this.translateToLocalByCSV(Yo.value,void 0,void 0,$n)):nr.push(this.translateToEnByCSV(Yo.value))}),Promise.all(nr).then(Yo=>{let ei=[];Yo.forEach((ti,ui)=>{let mi=rr[ui];mi.splits&&(mi.value=mi.splits.left+mi.value+mi.splits.right),ti===""?ei.push(mi):(mi.splits&&(ti=mi.splits.left+ti+mi.splits.right),Pn(mi,!1),Dn(mi,ti))}),console.log("No translated keywords: ",ei.map(ti=>ti.value)),$n?Wn(ei):(In(ei,!1),Nn())}).catch(Yo=>{In(rr,!1),this.$toastr.error(Yo),Bn(Yo)})},Gn=rr=>{console.log("translateByGroupTags",rr.map(Yo=>Yo.value),{useNetwork:$n});let nr=[];rr.forEach(Yo=>{const ei=common$1.splitTag(Yo.value);ei.value!==Yo.value&&(Yo.value=ei.value,Yo.splits=ei),Yo.toLocal?nr.push(this.translateToLocalByGroupTags(Yo.value,$n)):nr.push(this.translateToEnByGroupTags(Yo.value,$n))}),Promise.allSettled(nr).then(Yo=>{let ei=[],ti=[];if(Yo.forEach((ui,mi)=>{var vi;let Xo=rr[mi];Xo.splits&&(Xo.value=Xo.splits.left+Xo.value+Xo.splits.right),ui.status!=="fulfilled"&&ei.push(ui.reason),!((vi=ui.value)!=null&&vi.length)||ui.status!=="fulfilled"?ti.push(Xo):(Xo.splits&&(ui.value=Xo.splits.left+ui.value+Xo.splits.right),Pn(Xo,!1),Dn(Xo,ui.value))}),console.log("No translated keywords: ",ti.map(ui=>ui.value)),this.tagCompleteFile)Xn(ti);else{if(ei.length){In(rr,!1),this.$toastr.error(ei[0]),Bn(ei[0]);return}$n?Wn(ti):(In(ti,!1),Nn())}}).catch(Yo=>{In(rr,!1),this.$toastr.error(Yo),Bn(Yo)})};this.groupTagsTranslate?Gn(Ln):this.tagCompleteFile?Xn(Ln):$n?Wn(Ln):(In(Ln,!1),Nn())})}}},_hoisted_1$d=["name"],_hoisted_2$c={class:"prompt-header"},_hoisted_3$c={class:"prompt-header-title"},_hoisted_4$c={class:"prompt-header-extend"},_hoisted_5$b={class:"extend-content"},_hoisted_6$a={class:"extend-btn-group"},_hoisted_7$9={key:0,class:"gradio-checkbox hover-scale-120"},_hoisted_8$9=["checked"],_hoisted_9$8={class:"gradio-checkbox hover-scale-120"},_hoisted_10$8=["checked"],_hoisted_11$8={class:"gradio-checkbox hover-scale-120"},_hoisted_12$8=["checked"],_hoisted_13$8={class:"gradio-checkbox hover-scale-120"},_hoisted_14$8=["checked"],_hoisted_15$8={class:"gradio-checkbox"},_hoisted_16$7={value:"disabled"},_hoisted_17$7={value:"last"},_hoisted_18$7=["label"],_hoisted_19$7=["value"],_hoisted_20$7={class:"prompt-header-extend"},_hoisted_21$7={class:"extend-content"},_hoisted_22$7={class:"extend-btn-group"},_hoisted_23$7={key:0,class:"prompt-header-extend"},_hoisted_24$6={class:"extend-content"},_hoisted_25$6={class:"extend-btn-group"},_hoisted_26$6={class:"prompt-header-extend"},_hoisted_27$6={class:"extend-content"},_hoisted_28$4={class:"extend-btn-group"},_hoisted_29$3={key:1,class:"prompt-header-extend"},_hoisted_30$2={class:"extend-content"},_hoisted_31$2={class:"extend-btn-group"},_hoisted_32$2={key:2,class:"prompt-header-extend"},_hoisted_33$2={class:"extend-content"},_hoisted_34$2={class:"extend-btn-group"},_hoisted_35$2={class:"prompt-header-extend prompt-append"},_hoisted_36$2={class:"extend-content"},_hoisted_37$2={class:"gradio-checkbox hover-scale-120"},_hoisted_38$2=["checked"],_hoisted_39$2={class:"gradio-checkbox hover-scale-120"},_hoisted_40$2={key:0},_hoisted_41$2=["checked"],_hoisted_42$1={key:1},_hoisted_43$1=["checked"],_hoisted_44$1=["placeholder"],_hoisted_45$1=["onClick"],_hoisted_46$1={class:"arrow-right"},_hoisted_47$1=["onMouseleave","onMouseenter","onClick"],_hoisted_48$1={key:0,class:"tags-name"},_hoisted_49$1={key:1,class:"tags-name"},_hoisted_50$1={class:"tags-detail"},_hoisted_51$1={class:"tags-list"},_hoisted_52$1={key:0,class:"item-wrap"},_hoisted_53$1={key:1,class:"tags-item"},_hoisted_54$1={class:"item-tag-value"},_hoisted_55$1={class:"item-tag-local-value"},_hoisted_56$1={class:"prompt-tags-list",ref:"promptTagsList"},_hoisted_57$1=["data-id"],_hoisted_58$1=["onMouseenter","onMousemove","onMouseleave"],_hoisted_59$1={class:"prompt-tag-edit"},_hoisted_60$1=["onClick","onDblclick","onContextmenu","innerHTML"],_hoisted_61$1=["placeholder","value","onBlur","onKeydown","onChange"],_hoisted_62$1=["onClick"],_hoisted_63$1=["onClick"],_hoisted_64=["onClick"],_hoisted_65=["onClick"],_hoisted_66=["onClick"],_hoisted_67=["onClick"],_hoisted_68=["onClick"],_hoisted_69=["onClick"],_hoisted_70=["onClick"],_hoisted_71=["onClick"],_hoisted_72=["onClick"],_hoisted_73={class:"prompt-local-language"},_hoisted_74=["onClick"],_hoisted_75={class:"local-language"},_hoisted_76=["data-id"],_hoisted_77={class:"btns-title"},_hoisted_78={class:"group-tabs"},_hoisted_79={class:"group-header",ref:"groupTabsHeader"},_hoisted_80=["onClick","data-name"],_hoisted_81={class:"group-body"},_hoisted_82={key:0,class:"sub-group-header"},_hoisted_83=["onClick","data-name"],_hoisted_84={key:1,class:"sub-group-body"},_hoisted_85={key:0,class:"group-tags"},_hoisted_86=["onClick","onMouseenter"],_hoisted_87=["src"],_hoisted_88={class:"extra-network-name"},_hoisted_89={key:0,class:"extra-network-loading"},_hoisted_90=["onClick"],_hoisted_91={class:"tag-en"},_hoisted_92={key:0,class:"tags-footer"},_hoisted_93={class:"tags-size"},_hoisted_94={class:"size-title"},_hoisted_95={class:"tags-size-item"},_hoisted_96=["value"],_hoisted_97={class:"size-title"},_hoisted_98={class:"tags-size-item"},_hoisted_99=["value"],_hoisted_100={class:"size-title"},_hoisted_101={key:1,class:"tags-footer"},_hoisted_102={class:"tags-color"},_hoisted_103={class:"tags-color-picker hover-scale-120",unaffected:"true"},_hoisted_104=["onClick"],_hoisted_105=["onClick"],_hoisted_106={class:"tags-copyright"};function _sfc_render$d(_n,Cn,$n,Nn,Bn,Ln){const In=resolveComponent("icon-svg"),Pn=resolveComponent("vue-number-input"),Dn=resolveComponent("color-picker"),Hn=resolveComponent("highlight-prompt"),Wn=resolveDirective("tooltip"),Xn=resolveDirective("animate");return openBlock(),createElementBlock("div",{class:"physton-prompt",name:$n.name},[createBaseVNode("div",{class:normalizeClass(["prompt-main",$n.hidePanel?"fold":""]),onClick:Cn[65]||(Cn[65]=(...Gn)=>Ln.onPromptMainClick&&Ln.onPromptMainClick(...Gn))},[createBaseVNode("div",_hoisted_2$c,[withDirectives((openBlock(),createElementBlock("div",{class:"prompt-unfold",onClick:Cn[0]||(Cn[0]=(...Gn)=>_n.onUnfoldClick&&_n.onUnfoldClick(...Gn))},[createVNode(In,{class:"hover-scale-120",name:"unfold"})])),[[Wn,_n.getLang($n.hidePanel?"show_panel":"hide_panel")]]),createBaseVNode("div",_hoisted_3$c,toDisplayString($n.neg?_n.getLang("negative_prompt"):_n.getLang("prompt")),1),withDirectives(createBaseVNode("div",{class:"prompt-header-counter"},"("+toDisplayString(Bn.counterText)+")",513),[[vShow,Bn.counterText]]),createBaseVNode("div",_hoisted_4$c,[createBaseVNode("div",_hoisted_5$b,[createBaseVNode("div",_hoisted_6$a,[withDirectives((openBlock(),createElementBlock("div",{class:"extend-btn-item",onClick:Cn[1]||(Cn[1]=Gn=>_n.$emit("click:selectLanguage",Gn))},[createVNode(In,{class:"hover-scale-120",name:"i18n"})])),[[Wn,"Language: "+_n.langName]]),createBaseVNode("div",{class:normalizeClass(["extend-btn-item",$n.isLatestVersion?"":"red-dot"])},[withDirectives(createVNode(In,{class:"hover-scale-120",name:"setting"},null,512),[[Wn,_n.getLang("setting_desc")]]),withDirectives((openBlock(),createElementBlock("div",{class:"setting-box",onMouseenter:Cn[15]||(Cn[15]=(...Gn)=>_n.onSettingBoxMouseEnter&&_n.onSettingBoxMouseEnter(...Gn))},[Ln.translateApiItem.name&&!Ln.isEnglish?withDirectives((openBlock(),createElementBlock("div",{key:0,class:"extend-btn-item",onClick:Cn[2]||(Cn[2]=Gn=>_n.$emit("click:translateApi",Gn))},[createVNode(In,{class:"hover-scale-120",name:"api"})])),[[Wn,_n.getLang("translate_api")+": "+Ln.translateApiItem.name]]):createCommentVNode("",!0),withDirectives((openBlock(),createElementBlock("div",{class:"extend-btn-item",onClick:Cn[3]||(Cn[3]=Gn=>_n.$emit("click:promptFormat",Gn))},[createVNode(In,{class:"hover-scale-120",name:"format"})])),[[Wn,_n.getLang("prompt_format")]]),withDirectives((openBlock(),createElementBlock("div",{class:"extend-btn-item",onClick:Cn[4]||(Cn[4]=Gn=>_n.$emit("click:blacklist",Gn))},[createVNode(In,{class:"hover-scale-120",name:"blacklist"})])),[[Wn,_n.getLang("keywords_blacklist")]]),withDirectives((openBlock(),createElementBlock("div",{class:"extend-btn-item",onClick:Cn[5]||(Cn[5]=Gn=>_n.$emit("click:hotkey",Gn))},[createVNode(In,{class:"hover-scale-120",name:"hotkey"})])),[[Wn,_n.getLang("hotkey_setting")]]),withDirectives((openBlock(),createElementBlock("div",{class:"extend-btn-item",onClick:Cn[6]||(Cn[6]=Gn=>_n.$emit("click:selectTheme",Gn))},[createVNode(In,{class:"hover-scale-120",name:"theme"})])),[[Wn,_n.getLang("theme_extension")]]),withDirectives((openBlock(),createElementBlock("div",{class:"extend-btn-item",onClick:Cn[7]||(Cn[7]=Gn=>_n.$emit("click:switchTheme",Gn))},[createVNode(In,{class:"hover-scale-120",name:$n.theme==="dark"?"sun":"moon"},null,8,["name"])])),[[Wn,_n.getLang($n.theme==="dark"?"switch_to_light_theme":"switch_to_dark_theme")]]),withDirectives((openBlock(),createElementBlock("div",{class:normalizeClass(["extend-btn-item",$n.isLatestVersion?"":"red-dot"]),onClick:Cn[8]||(Cn[8]=Gn=>_n.$emit("click:showAbout",Gn))},[createVNode(In,{class:"hover-scale-120",name:"about"})],2)),[[Wn,_n.getLang("about_desc")]]),Ln.isEnglish?createCommentVNode("",!0):(openBlock(),createElementBlock(Fragment,{key:1},[$n.canOneTranslate?(openBlock(),createElementBlock("div",_hoisted_7$9,[withDirectives((openBlock(),createElementBlock("label",null,[createBaseVNode("input",{type:"checkbox",name:"auto_translate",value:"1",checked:$n.autoTranslate,onChange:Cn[9]||(Cn[9]=Gn=>_n.$emit("update:autoTranslate",Gn.target.checked))},null,40,_hoisted_8$9),createVNode(In,{name:"translate"})])),[[Wn,_n.getLang("auto_translate")]])])):(openBlock(),createElementBlock(Fragment,{key:1},[createBaseVNode("div",_hoisted_9$8,[withDirectives((openBlock(),createElementBlock("label",null,[createBaseVNode("input",{type:"checkbox",name:"auto_translate_to_local_language",value:"1",checked:$n.autoTranslateToLocal,onChange:Cn[10]||(Cn[10]=Gn=>_n.$emit("update:autoTranslateToLocal",Gn.target.checked))},null,40,_hoisted_10$8),createVNode(In,{name:"translate"})])),[[Wn,_n.getLang("auto_translate_to_local_language")]])]),createBaseVNode("div",_hoisted_11$8,[withDirectives((openBlock(),createElementBlock("label",null,[createBaseVNode("input",{type:"checkbox",name:"auto_translate_to_english",value:"1",checked:$n.autoTranslateToEnglish,onChange:Cn[11]||(Cn[11]=Gn=>_n.$emit("update:autoTranslateToEnglish",Gn.target.checked))},null,40,_hoisted_12$8),createVNode(In,{name:"english"})])),[[Wn,_n.getLang("auto_translate_to_english")]])])],64))],64)),createBaseVNode("div",_hoisted_13$8,[withDirectives((openBlock(),createElementBlock("label",null,[createBaseVNode("input",{type:"checkbox",name:"enable_tooltip",value:"1",checked:$n.enableTooltip,onChange:Cn[12]||(Cn[12]=Gn=>_n.$emit("update:enableTooltip",Gn.target.checked))},null,40,_hoisted_14$8),createVNode(In,{name:"tooltip"})])),[[Wn,_n.getLang("whether_to_enable_tooltip")]])]),createBaseVNode("div",_hoisted_15$8,[withDirectives((openBlock(),createElementBlock("label",null,[withDirectives(createBaseVNode("select",{"onUpdate:modelValue":Cn[13]||(Cn[13]=Gn=>_n.autoInputPrompt=Gn),onChange:Cn[14]||(Cn[14]=(...Gn)=>_n.onAutoInputPromptChange&&_n.onAutoInputPromptChange(...Gn))},[createBaseVNode("option",_hoisted_16$7,toDisplayString(_n.getLang("auto_input_prompt"))+": "+toDisplayString(_n.getLang("disabled")),1),createBaseVNode("option",_hoisted_17$7,toDisplayString(_n.getLang("last_input_prompt")),1),(openBlock(!0),createElementBlock(Fragment,null,renderList(_n.getCurrentTypeFavorites(),Gn=>(openBlock(),createElementBlock("optgroup",{key:Gn.key,label:_n.getLang("favorite")+" / "+_n.getLang(Gn.name)},[(openBlock(!0),createElementBlock(Fragment,null,renderList(Gn.list,rr=>(openBlock(),createElementBlock("option",{value:rr.id},toDisplayString(rr.name||rr.prompt.substring(0,40)),9,_hoisted_19$7))),256))],8,_hoisted_18$7))),128))],544),[[vModelSelect,_n.autoInputPrompt]])])),[[Wn,_n.getLang("auto_input_prompt")]])])],32)),[[Xn,"fadeIn"]])],2)])])]),createBaseVNode("div",_hoisted_20$7,[createBaseVNode("div",_hoisted_21$7,[createBaseVNode("div",_hoisted_22$7,[withDirectives((openBlock(),createElementBlock("div",{class:"extend-btn-item",ref:"historyButton",onClick:Cn[16]||(Cn[16]=Gn=>_n.$emit("click:showHistory",Gn))},[createVNode(In,{class:"hover-scale-120",name:"history"})])),[[Wn,_n.getLang("history")]]),withDirectives((openBlock(),createElementBlock("div",{class:"extend-btn-item",ref:"favoriteButton",onClick:Cn[17]||(Cn[17]=Gn=>_n.$emit("click:showFavorite",Gn))},[createVNode(In,{class:"hover-scale-120",name:"favorite"})])),[[Wn,_n.getLang("favorite")]])])])]),Ln.isEnglish?createCommentVNode("",!0):(openBlock(),createElementBlock("div",_hoisted_23$7,[createBaseVNode("div",_hoisted_24$6,[createBaseVNode("div",_hoisted_25$6,[$n.canOneTranslate?withDirectives((openBlock(),createElementBlock("div",{key:0,class:"extend-btn-item",onClick:Cn[18]||(Cn[18]=(...Gn)=>_n.onTranslatesToLocalClick&&_n.onTranslatesToLocalClick(...Gn))},[Bn.loading.all_local?createCommentVNode("",!0):(openBlock(),createBlock(In,{key:0,class:"hover-scale-120",name:"translate"})),Bn.loading.all_local?(openBlock(),createBlock(In,{key:1,class:"hover-scale-120",name:"loading"})):createCommentVNode("",!0)])),[[Wn,_n.getLang("one_translate_all_keywords")]]):(openBlock(),createElementBlock(Fragment,{key:1},[withDirectives((openBlock(),createElementBlock("div",{class:"extend-btn-item",onClick:Cn[19]||(Cn[19]=(...Gn)=>_n.onTranslatesToLocalClick&&_n.onTranslatesToLocalClick(...Gn))},[Bn.loading.all_local?createCommentVNode("",!0):(openBlock(),createBlock(In,{key:0,class:"hover-scale-120",name:"translate"})),Bn.loading.all_local?(openBlock(),createBlock(In,{key:1,class:"hover-scale-120",name:"loading"})):createCommentVNode("",!0)])),[[Wn,_n.getLang("translate_keywords_to_local_language")]]),withDirectives((openBlock(),createElementBlock("div",{class:"extend-btn-item",onClick:Cn[20]||(Cn[20]=(...Gn)=>_n.onTranslatesToEnglishClick&&_n.onTranslatesToEnglishClick(...Gn))},[Bn.loading.all_en?createCommentVNode("",!0):(openBlock(),createBlock(In,{key:0,class:"hover-scale-120",name:"english"})),Bn.loading.all_en?(openBlock(),createBlock(In,{key:1,class:"hover-scale-120",name:"loading"})):createCommentVNode("",!0)])),[[Wn,_n.getLang("translate_all_keywords_to_english")]])],64))])])])),createBaseVNode("div",_hoisted_26$6,[createBaseVNode("div",_hoisted_27$6,[createBaseVNode("div",_hoisted_28$4,[withDirectives((openBlock(),createElementBlock("div",{class:"extend-btn-item",onClick:Cn[21]||(Cn[21]=(...Gn)=>_n.onCopyAllTagsClick&&_n.onCopyAllTagsClick(...Gn))},[createVNode(In,{class:"hover-scale-120",name:"copy"})])),[[Wn,_n.getLang("copy_keywords_to_clipboard")]]),withDirectives((openBlock(),createElementBlock("div",{class:"extend-btn-item",onClick:Cn[22]||(Cn[22]=(...Gn)=>_n.onDeleteAllTagsClick&&_n.onDeleteAllTagsClick(...Gn))},[createVNode(In,{class:"hover-scale-120",name:"remove"})])),[[Wn,_n.getLang("delete_all_keywords")]])])])]),$n.autoLoadWebuiPrompt?createCommentVNode("",!0):(openBlock(),createElementBlock("div",_hoisted_29$3,[createBaseVNode("div",_hoisted_30$2,[createBaseVNode("div",_hoisted_31$2,[withDirectives((openBlock(),createElementBlock("div",{class:"extend-btn-item",onClick:Cn[23]||(Cn[23]=(...Gn)=>_n.onClickLoadWebuiPrompt&&_n.onClickLoadWebuiPrompt(...Gn))},[createVNode(In,{class:"hover-scale-120",name:"load2"})])),[[Wn,_n.getLang("load_webui_prompt")]])])])])),$n.neg?createCommentVNode("",!0):(openBlock(),createElementBlock("div",_hoisted_32$2,[createBaseVNode("div",_hoisted_33$2,[createBaseVNode("div",_hoisted_34$2,[withDirectives((openBlock(),createElementBlock("div",{class:"extend-btn-item",onClick:Cn[24]||(Cn[24]=Gn=>_n.$emit("click:showChatgpt",Gn))},[createVNode(In,{class:"hover-scale-120",name:"chatgpt"})])),[[Wn,_n.getLang("use_chatgpt_gen_prompts")]])])])])),createBaseVNode("div",_hoisted_35$2,[createBaseVNode("div",_hoisted_36$2,[createBaseVNode("div",_hoisted_37$2,[withDirectives((openBlock(),createElementBlock("label",null,[createBaseVNode("input",{type:"checkbox",name:"auto_load_webui_prompt",value:"1",checked:$n.autoLoadWebuiPrompt,onChange:Cn[25]||(Cn[25]=Gn=>_n.$emit("update:autoLoadWebuiPrompt",Gn.target.checked))},null,40,_hoisted_38$2),createVNode(In,{name:"load"})])),[[Wn,_n.getLang("auto_load_webui_prompt")]])]),createBaseVNode("div",_hoisted_39$2,[$n.hideDefaultInput?withDirectives((openBlock(),createElementBlock("label",_hoisted_40$2,[createBaseVNode("input",{type:"checkbox",name:"hide_default_input",value:"1",checked:!$n.hideDefaultInput,onChange:Cn[26]||(Cn[26]=Gn=>_n.$emit("update:hideDefaultInput",!Gn.target.checked))},null,40,_hoisted_41$2),createVNode(In,{name:"input"})])),[[Wn,_n.getLang("show_default_input_box")]]):withDirectives((openBlock(),createElementBlock("label",_hoisted_42$1,[createBaseVNode("input",{type:"checkbox",name:"hide_default_input",value:"1",checked:!$n.hideDefaultInput,onChange:Cn[27]||(Cn[27]=Gn=>_n.$emit("update:hideDefaultInput",!Gn.target.checked))},null,40,_hoisted_43$1),createVNode(In,{name:"input"})])),[[Wn,_n.getLang("hide_default_input_box")]])]),withDirectives(createBaseVNode("textarea",{type:"text",class:"scroll-hide svelte-4xt1ch input-tag-append",ref:"promptTagAppend",placeholder:_n.getLang("please_enter_new_keyword"),onFocus:Cn[28]||(Cn[28]=(...Gn)=>_n.onAppendTagFocus&&_n.onAppendTagFocus(...Gn)),onBlur:Cn[29]||(Cn[29]=(...Gn)=>_n.onAppendTagBlur&&_n.onAppendTagBlur(...Gn)),onKeyup:Cn[30]||(Cn[30]=(...Gn)=>_n.onAppendTagKeyUp&&_n.onAppendTagKeyUp(...Gn)),onKeydown:Cn[31]||(Cn[31]=(...Gn)=>_n.onAppendTagKeyDown&&_n.onAppendTagKeyDown(...Gn))},null,40,_hoisted_44$1),[[Wn,_n.getLang("enter_to_add")]]),withDirectives(createBaseVNode("div",{class:"prompt-append-list",ref:"promptAppendList",style:normalizeStyle(_n.appendListStyle)},[(openBlock(!0),createElementBlock(Fragment,null,renderList(_n.appendList,(Gn,rr)=>(openBlock(),createElementBlock("div",{key:Gn.type,class:normalizeClass(["prompt-append-group",_n.appendListSelected===rr?"selected":""])},[createBaseVNode("div",{class:"append-group-name",onClick:nr=>_n.onAppendGroupClick(rr,null,nr)},[Gn.icon==="wrap"?(openBlock(),createBlock(In,{key:0,class:"name-icon",name:"wrap"})):Gn.icon==="history"?(openBlock(),createBlock(In,{key:1,class:"name-icon",name:"history"})):Gn.icon==="favorite"?(openBlock(),createBlock(In,{key:2,class:"name-icon",name:"favorite"})):createCommentVNode("",!0),createTextVNode(" "+toDisplayString(_n.appendListItemName(Gn))+" ",1),withDirectives(createBaseVNode("span",_hoisted_46$1,null,512),[[vShow,Gn.children.length>0]])],8,_hoisted_45$1),createVNode(Transition,{name:"fade"},{default:withCtx(()=>[withDirectives(createBaseVNode("div",{class:"append-group-list",ref_for:!0,ref:"promptAppendListChildren"},[(openBlock(!0),createElementBlock(Fragment,null,renderList(Gn.children,(nr,Yo)=>(openBlock(),createElementBlock("div",{key:Yo,ref_for:!0,ref:"promptAppendListChild",class:normalizeClass(["append-item",_n.appendListChildSelected===Yo?"selected":""]),onMouseleave:ei=>_n.onAppendListChildMouseLeave(rr,Yo,ei),onMouseenter:ei=>_n.onAppendListChildMouseEnter(rr,Yo,ei),onClick:ei=>_n.onAppendGroupClick(rr,Yo,ei)},[Gn.type==="favorite"||Gn.type==="history"?(openBlock(),createElementBlock(Fragment,{key:0},[nr.name?(openBlock(),createElementBlock("div",_hoisted_48$1,toDisplayString(nr.name),1)):(openBlock(),createElementBlock("div",_hoisted_49$1,toDisplayString(nr.prompt),1))],64)):createCommentVNode("",!0)],42,_hoisted_47$1))),128))],512),[[vShow,Gn.children.length>0]])]),_:2},1024),createVNode(Transition,{name:"fade"},{default:withCtx(()=>[withDirectives(createBaseVNode("div",_hoisted_50$1,[createBaseVNode("div",_hoisted_51$1,[(openBlock(!0),createElementBlock(Fragment,null,renderList(_n.appendListChildItemTags,(nr,Yo)=>(openBlock(),createElementBlock(Fragment,{key:Yo},[nr.type&&nr.type==="wrap"?(openBlock(),createElementBlock("div",_hoisted_52$1)):(openBlock(),createElementBlock("div",_hoisted_53$1,[createBaseVNode("div",_hoisted_54$1,toDisplayString(nr.value),1),createBaseVNode("div",_hoisted_55$1,toDisplayString(nr.localValue),1)]))],64))),128))])],512),[[vShow,_n.appendListSelected!==null&&_n.appendListChildSelected!==null&&_n.appendListSelected===rr&&(Gn.type==="favorite"||Gn.type==="history")]])]),_:2},1024)],2))),128))],4),[[vShow,_n.showAppendList]])])])]),createBaseVNode("div",{class:normalizeClass(["prompt-tags",Bn.droping?"droping":"",_n.dropIsSelecting||_n.dropIsEnd&&_n.dropTags.length?"selecting":""]),ref:"promptTags",onMousedown:Cn[56]||(Cn[56]=(...Gn)=>_n.onDropMouseDown&&_n.onDropMouseDown(...Gn)),onMousemove:Cn[57]||(Cn[57]=(...Gn)=>_n.onDropMouseMove&&_n.onDropMouseMove(...Gn)),onMouseup:Cn[58]||(Cn[58]=(...Gn)=>_n.onDropMouseUp&&_n.onDropMouseUp(...Gn))},[createBaseVNode("div",_hoisted_56$1,[(openBlock(!0),createElementBlock(Fragment,null,renderList(Bn.tags,(Gn,rr)=>(openBlock(),createElementBlock("div",{key:Gn.id,class:normalizeClass(["prompt-tag",Gn.disabled?"disabled":"",Gn.type==="wrap"?"wrap-tag":""]),ref_for:!0,ref:"promptTag-"+Gn.id,"data-id":Gn.id},[createBaseVNode("div",{class:"prompt-tag-main",onMouseenter:nr=>_n.onTagMouseEnter(Gn.id),onMousemove:withModifiers(nr=>_n.onTagMouseMove(Gn.id),["stop"]),onMouseleave:withModifiers(nr=>_n.onTagMouseLeave(Gn.id),["stop"])},[createBaseVNode("div",_hoisted_59$1,[Gn.type==="wrap"?withDirectives((openBlock(),createElementBlock("div",{key:0,class:"prompt-tag-value",ref_for:!0,ref:"promptTagValue-"+Gn.id,style:{width:"100%"}},[createVNode(In,{name:"wrap"})])),[[Wn,_n.getLang("line_break_character")+"
"+_n.getLang("drop_to_order")]]):(openBlock(),createElementBlock(Fragment,{key:1},[withDirectives(createBaseVNode("div",{class:normalizeClass(Gn.classes),style:normalizeStyle(_n.getTagColorStyle(Gn)),ref_for:!0,ref:"promptTagValue-"+Gn.id,onClick:nr=>_n.onTagClick(Gn.id,nr),onDblclick:nr=>_n.onTagDblclick(Gn.id),onContextmenu:withModifiers(nr=>_n.onTagRightClick(Gn.id,nr),["right","prevent"]),innerHTML:_n.renderTag(Gn.id)},null,46,_hoisted_60$1),[[vShow,!Bn.editing[Gn.id]],[Wn,Gn.isLora||Gn.isLyco?"":_n.getLang("click_to_edit")+"
"+_n.getLang("dblclick_to_disable")+"
"+_n.getLang("drop_to_order")]]),withDirectives(createBaseVNode("textarea",{type:"text",class:"scroll-hide svelte-4xt1ch input-tag-edit",ref_for:!0,ref:"promptTagEdit-"+Gn.id,placeholder:_n.getLang("enter_to_save"),value:Gn.value,onMousedown:Cn[32]||(Cn[32]=withModifiers(()=>{},["stop"])),onMousemove:Cn[33]||(Cn[33]=withModifiers(()=>{},["stop"])),onMouseup:Cn[34]||(Cn[34]=withModifiers(()=>{},["stop"])),onBlur:nr=>_n.onTagInputBlur(Gn.id),onKeydown:nr=>_n.onTagInputKeyDown(Gn.id,nr),onChange:nr=>_n.onTagInputChange(Gn.id,nr)},null,40,_hoisted_61$1),[[vShow,Bn.editing[Gn.id]]])],64)),createBaseVNode("div",{class:"btn-tag-delete",ref_for:!0,ref:"promptTagDelete-"+Gn.id,onClick:nr=>_n.onDeleteTagClick(Gn.id),onMousedown:Cn[35]||(Cn[35]=withModifiers(()=>{},["stop"])),onMousemove:Cn[36]||(Cn[36]=withModifiers(()=>{},["stop"])),onMouseup:Cn[37]||(Cn[37]=withModifiers(()=>{},["stop"]))},[createVNode(In,{name:"close"})],40,_hoisted_62$1)]),withDirectives((openBlock(),createElementBlock("div",{class:"btn-tag-extend",style:normalizeStyle({display:(Gn.type==="text"||!Gn.type)&&_n.showExtendId===Gn.id&&!this.editing[Gn.id]?"flex":"none"}),onClick:Cn[38]||(Cn[38]=withModifiers(()=>{},["stop"])),onMousedown:Cn[39]||(Cn[39]=withModifiers(()=>{},["stop"])),onMousemove:Cn[40]||(Cn[40]=withModifiers(()=>{},["stop"])),onMouseup:Cn[41]||(Cn[41]=withModifiers(()=>{},["stop"]))},[createVNode(Pn,{class:"input-number",name:"input-number","model-value":Gn.weightNum,center:"",controls:"",min:-100,step:.1,size:"small","onUpdate:modelValue":nr=>_n.onTagWeightNumChange(Gn.id,nr)},null,8,["model-value","step","onUpdate:modelValue"]),withDirectives((openBlock(),createElementBlock("button",{type:"button",name:"weight-parentheses-inc",onClick:nr=>_n.onIncWeightClick(Gn.id,1)},[createVNode(In,{name:$n.useNovelAiWeightSymbol?"weight-braces-inc":"weight-parentheses-inc"},null,8,["name"])],8,_hoisted_63$1)),[[Wn,_n.getLang("increase_weight_add_parentheses")]]),withDirectives((openBlock(),createElementBlock("button",{type:"button",name:"weight-parentheses-dec",onClick:nr=>_n.onIncWeightClick(Gn.id,-1)},[createVNode(In,{name:$n.useNovelAiWeightSymbol?"weight-braces-dec":"weight-parentheses-dec"},null,8,["name"])],8,_hoisted_64)),[[Wn,_n.getLang("increase_weight_subtract_parentheses")]]),withDirectives((openBlock(),createElementBlock("button",{type:"button",name:"weight-brackets-inc",onClick:nr=>_n.onDecWeightClick(Gn.id,1)},[createVNode(In,{name:"weight-brackets-inc"})],8,_hoisted_65)),[[Wn,_n.getLang("decrease_weight_add_brackets")]]),withDirectives((openBlock(),createElementBlock("button",{type:"button",name:"weight-brackets-dec",onClick:nr=>_n.onDecWeightClick(Gn.id,-1)},[createVNode(In,{name:"weight-brackets-dec"})],8,_hoisted_66)),[[Wn,_n.getLang("decrease_weight_subtract_brackets")]]),withDirectives((openBlock(),createElementBlock("button",{type:"button",name:"wrap",onClick:nr=>_n.onWrapTagClick(Gn.id)},[createVNode(In,{name:"wrap"})],8,_hoisted_67)),[[Wn,_n.getLang("line_break_character")]]),withDirectives((openBlock(),createElementBlock("button",{type:"button",name:"translate",onClick:nr=>_n.onTranslateToEnglishClick(Gn.id)},[Bn.loading[Gn.id+"_en"]?createCommentVNode("",!0):(openBlock(),createBlock(In,{key:0,name:"english"})),Bn.loading[Gn.id+"_en"]?(openBlock(),createBlock(In,{key:1,name:"loading"})):createCommentVNode("",!0)],8,_hoisted_68)),[[Wn,_n.getLang("translate_keyword_to_english")],[vShow,!Ln.isEnglish]]),withDirectives((openBlock(),createElementBlock("button",{type:"button",name:"copy",onClick:nr=>Ln.copy(Gn.value)},[createVNode(In,{name:"copy"})],8,_hoisted_69)),[[Wn,_n.getLang("copy_to_clipboard")]]),withDirectives((openBlock(),createElementBlock("button",{type:"button",name:"favorite",onClick:nr=>_n.onFavoriteTagClick(Gn.id)},[Gn.isFavorite?(openBlock(),createBlock(In,{key:0,name:"favorite-yes"})):createCommentVNode("",!0),Gn.isFavorite?createCommentVNode("",!0):(openBlock(),createBlock(In,{key:1,name:"favorite-no"}))],8,_hoisted_70)),[[Wn,_n.getLang(Gn.isFavorite?"remove_from_favorite":"add_to_favorite")]]),withDirectives((openBlock(),createElementBlock("button",{type:"button",name:"blacklist",onClick:nr=>_n.onBlacklistClick(Gn.id)},[createVNode(In,{name:"blacklist"})],8,_hoisted_71)),[[Wn,_n.getLang("add_blacklist")]]),withDirectives((openBlock(),createElementBlock("button",{type:"button",name:"enable",onClick:nr=>_n.onDisabledTagClick(Gn.id)},[Gn.disabled?createCommentVNode("",!0):(openBlock(),createBlock(In,{key:0,name:"disabled"})),Gn.disabled?(openBlock(),createBlock(In,{key:1,name:"enable"})):createCommentVNode("",!0)],8,_hoisted_72)),[[Wn,_n.getLang(Gn.disabled?"enable_keyword":"disable_keyword")]])],36)),[[Xn,"fadeIn"]])],40,_hoisted_58$1),withDirectives(createBaseVNode("div",_hoisted_73,[withDirectives((openBlock(),createElementBlock("div",{class:"translate-to-local hover-scale-120",onClick:nr=>_n.onTranslateToLocalClick(Gn.id),onMousedown:Cn[42]||(Cn[42]=withModifiers(()=>{},["stop"])),onMousemove:Cn[43]||(Cn[43]=withModifiers(()=>{},["stop"])),onMouseup:Cn[44]||(Cn[44]=withModifiers(()=>{},["stop"]))},[Bn.loading[Gn.id+"_local"]?createCommentVNode("",!0):(openBlock(),createBlock(In,{key:0,name:"translate"})),Bn.loading[Gn.id+"_local"]?(openBlock(),createBlock(In,{key:1,name:"loading"})):createCommentVNode("",!0)],40,_hoisted_74)),[[Wn,_n.getLang("translate_keyword_to_local_language")]]),createBaseVNode("div",_hoisted_75,toDisplayString(Gn.localValue),1)],512),[[vShow,!Ln.isEnglish&&(Gn.type==="text"||!Gn.type)]])],10,_hoisted_57$1))),128)),(openBlock(!0),createElementBlock(Fragment,null,renderList(Bn.tags,(Gn,rr)=>(openBlock(),createElementBlock("div",{key:Gn.id,class:normalizeClass(["prompt-wrap",Gn.type==="wrap"?"wrap-tag":""]),"data-id":Gn.id,ref_for:!0,ref:"promptTagWrap",onMousedown:Cn[45]||(Cn[45]=withModifiers(()=>{},["stop"])),onMousemove:Cn[46]||(Cn[46]=withModifiers(()=>{},["stop"])),onMouseup:Cn[47]||(Cn[47]=withModifiers(()=>{},["stop"]))},null,42,_hoisted_76))),128))],512),createBaseVNode("div",{class:"drop-select-bg",ref:"dropSelectBg",style:normalizeStyle({display:_n.dropIsStart?"block":"none"})},null,4),createBaseVNode("div",{class:"drop-select-box",ref:"dropSelectBox",style:normalizeStyle({display:_n.dropIsSelecting?"block":"none",top:_n.dropArea.top+"px",left:_n.dropArea.left+"px",width:_n.dropArea.width+"px",height:_n.dropArea.height+"px"})},null,4),createBaseVNode("div",{class:"drop-select-btns",ref:"dropSelectBtns",style:normalizeStyle({display:_n.dropIsEnd&&_n.dropTags.length?"flex":"none",top:_n.dropEndY-32+"px",left:_n.dropEndX+"px"}),onMousedown:Cn[53]||(Cn[53]=withModifiers(()=>{},["stop"])),onMousemove:Cn[54]||(Cn[54]=withModifiers(()=>{},["stop"])),onMouseup:Cn[55]||(Cn[55]=withModifiers(()=>{},["stop"]))},[createBaseVNode("div",_hoisted_77,toDisplayString(_n.getLang("batch_operation")),1),withDirectives((openBlock(),createElementBlock("button",{type:"button",onClick:Cn[48]||(Cn[48]=(...Gn)=>_n.onDropCopy&&_n.onDropCopy(...Gn))},[createVNode(In,{name:"copy"})])),[[Wn,_n.getLang("copy_to_clipboard")]]),withDirectives((openBlock(),createElementBlock("button",{type:"button",onClick:Cn[49]||(Cn[49]=(...Gn)=>_n.onDropFavorite&&_n.onDropFavorite(...Gn))},[createVNode(In,{name:"favorite-no"})])),[[Wn,_n.getLang("add_to_favorite")]]),withDirectives((openBlock(),createElementBlock("button",{type:"button",onClick:Cn[50]||(Cn[50]=(...Gn)=>_n.onDropDisable&&_n.onDropDisable(...Gn))},[createVNode(In,{name:"disabled"})])),[[Wn,_n.getLang("disable_keyword")]]),withDirectives((openBlock(),createElementBlock("button",{type:"button",onClick:Cn[51]||(Cn[51]=(...Gn)=>_n.onDropEnable&&_n.onDropEnable(...Gn))},[createVNode(In,{name:"enable"})])),[[Wn,_n.getLang("enable_keyword")]]),createBaseVNode("button",{type:"button",onClick:Cn[52]||(Cn[52]=(...Gn)=>_n.onDropDelete&&_n.onDropDelete(...Gn))},[createVNode(In,{name:"remove"})])],36)],34),_n.groupTagsProcessed.length?withDirectives((openBlock(),createElementBlock("div",{key:0,class:normalizeClass(["show-group-tags",$n.hideGroupTags?"hided":""]),onClick:Cn[59]||(Cn[59]=(...Gn)=>_n.onClickHideGroupTags&&_n.onClickHideGroupTags(...Gn))},[createVNode(In,{class:"hover-scale-120",name:"unfold"})],2)),[[Wn,_n.getLang($n.hideGroupTags?"show_group_tags":"hide_group_tags")]]):createCommentVNode("",!0),createVNode(Transition,{name:"fade"},{default:withCtx(()=>[withDirectives(createBaseVNode("div",_hoisted_78,[createBaseVNode("div",_hoisted_79,[(openBlock(!0),createElementBlock(Fragment,null,renderList(_n.groupTagsProcessed,(Gn,rr)=>(openBlock(),createElementBlock("div",{key:rr,class:normalizeClass(["group-tab",Gn.tabKey==_n.groupTagsActive?"active":""]),onClick:nr=>_n.activeGroupTab(rr),"data-name":Gn.name},toDisplayString(Gn.name),11,_hoisted_80))),128))],512),createBaseVNode("div",_hoisted_81,[(openBlock(!0),createElementBlock(Fragment,null,renderList(_n.groupTagsProcessed,(Gn,rr)=>(openBlock(),createElementBlock("div",{key:rr,class:normalizeClass(["group-main",Gn.tabKey==_n.groupTagsActive?"active":""])},[Gn.tabKey==_n.groupTagsActive?(openBlock(),createElementBlock("div",_hoisted_82,[(openBlock(!0),createElementBlock(Fragment,null,renderList(Gn.groups,(nr,Yo)=>(openBlock(),createElementBlock("div",{key:Yo,class:normalizeClass([nr.type&&nr.type==="wrap"?"sub-group-tag-wrap":"sub-group-tab",nr.tabKey==_n.subGroupTagsActive?"active":""]),onClick:ei=>_n.activeSubGroupTab(rr,Yo),"data-name":nr.name},toDisplayString(nr.name),11,_hoisted_83))),128))])):createCommentVNode("",!0),Gn.tabKey==_n.groupTagsActive?(openBlock(),createElementBlock("div",_hoisted_84,[(openBlock(!0),createElementBlock(Fragment,null,renderList(Gn.groups,(nr,Yo)=>(openBlock(),createElementBlock("div",{key:Yo,class:normalizeClass(["sub-group-main",nr.tabKey==_n.subGroupTagsActive?"active":""])},[createVNode(Transition,{name:"fade"},{default:withCtx(()=>[nr.tabKey==_n.subGroupTagsActive?(openBlock(),createElementBlock("div",_hoisted_85,[nr.type==="extraNetworks"?(openBlock(!0),createElementBlock(Fragment,{key:0},renderList(nr.datas,ei=>(openBlock(),createElementBlock("div",{class:"group-extra-network",key:ei.name,onClick:ti=>_n.onClickGroupTagExtraNetwork(ei,Gn,nr),onMouseenter:ti=>_n.onGroupExtraNetworkMouseEnter(ti,ei.name),onMousemove:Cn[60]||(Cn[60]=(...ti)=>_n.onGroupExtraNetworkMouseMove&&_n.onGroupExtraNetworkMouseMove(...ti)),onMouseleave:Cn[61]||(Cn[61]=(...ti)=>_n.onGroupExtraNetworkMouseLeave&&_n.onGroupExtraNetworkMouseLeave(...ti)),style:normalizeStyle(_n.getGroupTagExtraNetworkStyle(ei))},[createBaseVNode("img",{class:"extra-network-preview",src:ei.preview||"./file=html/card-no-preview.png"},null,8,_hoisted_87),createBaseVNode("div",_hoisted_88,toDisplayString(ei.name),1),ei.loading?(openBlock(),createElementBlock("div",_hoisted_89,[createVNode(In,{name:"loading"})])):createCommentVNode("",!0)],44,_hoisted_86))),128)):(openBlock(!0),createElementBlock(Fragment,{key:1},renderList(nr.tags,(ei,ti)=>withDirectives((openBlock(),createElementBlock("div",{class:"tag-item",ref_for:!0,ref:"groupTagItem",onClick:ui=>_n.onClickGroupTag(ei,ti,Gn,nr)},[ei&&ei!=ti?(openBlock(),createElementBlock(Fragment,{key:0},[createBaseVNode("div",{class:"tag-local",style:normalizeStyle(_n.getGroupTagStyle(Gn.name,nr.name,ti))},toDisplayString(ei),5),createBaseVNode("div",_hoisted_91,toDisplayString(ti),1)],64)):(openBlock(),createElementBlock("div",{key:1,class:"tag-local",style:normalizeStyle(_n.getGroupTagStyle(Gn.name,nr.name,ti))},toDisplayString(ti),5))],8,_hoisted_90)),[[Wn,_n.getGroupTagTooltip(ei,ti)]])),256))])):createCommentVNode("",!0)]),_:2},1024),Gn.type==="extraNetworks"?(openBlock(),createElementBlock("div",_hoisted_92,[createBaseVNode("div",_hoisted_93,[createBaseVNode("div",{class:"tags-size-item",onClick:Cn[62]||(Cn[62]=(...ei)=>_n.onClickGroupExtraNetworkRefresh&&_n.onClickGroupExtraNetworkRefresh(...ei))},[_n.extraNetworksRefreshing?(openBlock(),createBlock(In,{key:0,name:"loading"})):createCommentVNode("",!0),_n.extraNetworksRefreshing?createCommentVNode("",!0):(openBlock(),createBlock(In,{key:1,class:"hover-scale-120",name:"refresh"})),createBaseVNode("div",_hoisted_94,toDisplayString(this.getLang("refresh")),1)]),createBaseVNode("div",_hoisted_95,[createBaseVNode("input",{class:"size-number",type:"number",min:"10",max:"1000",step:"1",value:$n.extraNetworksWidth,onChange:Cn[63]||(Cn[63]=ei=>_n.$emit("update:extraNetworksWidth",ei.target.value))},null,40,_hoisted_96),createBaseVNode("div",_hoisted_97,toDisplayString(this.getLang("width")),1)]),createBaseVNode("div",_hoisted_98,[createBaseVNode("input",{class:"size-number",type:"number",min:"10",max:"1000",step:"1",value:$n.extraNetworksHeight,onChange:Cn[64]||(Cn[64]=ei=>_n.$emit("update:extraNetworksHeight",ei.target.value))},null,40,_hoisted_99),createBaseVNode("div",_hoisted_100,toDisplayString(this.getLang("height")),1)])])])):createCommentVNode("",!0),Gn.type!=="favorite"&&Gn.type!=="extraNetworks"?(openBlock(),createElementBlock("div",_hoisted_101,[createBaseVNode("div",_hoisted_102,[createBaseVNode("div",null,toDisplayString(_n.getLang("tags_color"))+":",1),withDirectives((openBlock(),createElementBlock("div",_hoisted_103,[createVNode(Dn,{theme:$n.theme=="dark"?"black":"white",pureColor:$n.groupTagsColor[_n.getTagsColorKey(Gn.name,nr.name)],"onUpdate:pureColor":ei=>$n.groupTagsColor[_n.getTagsColorKey(Gn.name,nr.name)]=ei,onPureColorChange:ei=>_n.onTagsColorChange(_n.getTagsColorKey(Gn.name,nr.name))},null,8,["theme","pureColor","onUpdate:pureColor","onPureColorChange"])])),[[Wn,$n.groupTagsColor[_n.getTagsColorKey(Gn.name,nr.name)]]]),withDirectives((openBlock(),createElementBlock("div",{class:"tags-color-reset hover-scale-120",onClick:ei=>_n.onClickResetTagsColor(_n.getTagsColorKey(Gn.name,nr.name))},[createVNode(In,{name:"reset"})],8,_hoisted_104)),[[Wn,_n.getLang("reset_default_color")]]),withDirectives((openBlock(),createElementBlock("div",{class:"tags-color-clear hover-scale-120",onClick:ei=>_n.onClickClearTagsColor(_n.getTagsColorKey(Gn.name,nr.name))},[createVNode(In,{name:"clear"})],8,_hoisted_105)),[[Wn,_n.getLang("clear_color")]])]),createBaseVNode("div",_hoisted_106,toDisplayString(_n.getLang("tags-copyright")),1)])):createCommentVNode("",!0)],2))),128))])):createCommentVNode("",!0)],2))),128))])],512),[[vShow,!$n.hideGroupTags&&_n.groupTagsProcessed.length]])]),_:1})],2),createVNode(Hn,{ref:"highlightPrompt",textarea:$n.textarea,"hide-default-input":$n.hideDefaultInput},null,8,["textarea","hide-default-input"])],8,_hoisted_1$d)}const PhystonPrompt=_export_sfc(_sfc_main$d,[["render",_sfc_render$d]]),_sfc_main$c={name:"TranslateSetting",components:{IconSvg},mixins:[LanguageMixin],props:{},data(){return{testText:"",translateSuccess:!1,errorMessage:"",translatedText:"",loading:!1,isOpen:!1,configs:[],apiKey:"",tagCompleteFiles:[],tagCompleteFilesLoading:!1,tagCompleteFileKey:"",tagCompleteResults:[],onlyCsvOnAutoValue:!1,groupTagsTranslateValue:!0,mbart50Loading:!1,mbart50Success:!1,mbart50Message:""}},computed:{apiItem(){return common$1.getTranslateApiItem(this.translateApis,this.apiKey)},supportApi(){if(!this.translateApis||this.translateApis.length<=0)return[];let _n=JSON.parse(JSON.stringify(this.translateApis));return _n.forEach(Cn=>{Cn.children.forEach($n=>{$n.disabled=!$n.support[this.languageCode]})}),_n}},mounted(){this.translateSuccess=!1,this.errorMessage="",this.translatedText="",this.loading=!1},emits:["update:translateApi","forceUpdate:translateApi","update:tagCompleteFile","update:onlyCsvOnAuto","update:groupTagsTranslate"],watch:{apiKey:{handler:function(_n,Cn){this.translateSuccess=!1,this.errorMessage="",this.translatedText="",this.loading=!1,this.configs=[],this.gradioAPI.getData("translate_api."+this.apiKey).then($n=>{const Nn=this.apiItem;if(Nn&&Nn.config){for(const Bn of this.apiItem.config)$n?Bn.value=$n[Bn.key]||Bn.default:Bn.value=Bn.default||"",this.configs.push(Bn);console.log(this.configs)}})},immediate:!1}},methods:{open(_n){this.testText=`Hi, this extension is developed by Physton. Welcome to use it! If you have any suggestions or opinions, please feel free to raise an issue or PR on Github. diff --git a/javascript/main.entry.js.map b/javascript/main.entry.js.map index 9078dba..c6869cf 100644 --- a/javascript/main.entry.js.map +++ b/javascript/main.entry.js.map @@ -1 +1 @@ -{"version":3,"file":"main.entry.js","sources":["../src/node_modules/@vue/shared/dist/shared.esm-bundler.js","../src/node_modules/@vue/reactivity/dist/reactivity.esm-bundler.js","../src/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js","../src/node_modules/@vue/runtime-dom/dist/runtime-dom.esm-bundler.js","../src/node_modules/sortablejs/modular/sortable.esm.js","../src/src/utils/splitTags.js","../src/globals.js","../src/node_modules/tinycolor2/esm/tinycolor.js","../src/src/utils/common.js","../src/node_modules/papaparse/papaparse.min.js","../src/src/mixins/languageMixin.js","../src/src/components/vue-number-input.vue","../src/src/mixins/phystonPrompt/headerMixin.js","../src/src/mixins/phystonPrompt/dropMixin.js","../src/node_modules/autosize-input/index.js","../src/src/mixins/phystonPrompt/tagMixin.js","../src/src/mixins/phystonPrompt/groupTagsMixin.js","../src/src/components/iconSvg.vue","../src/src/components/highlightPrompt.vue","../src/node_modules/@vueuse/shared/index.mjs","../src/node_modules/@vueuse/core/index.mjs","../src/node_modules/gradient-parser/build/node.js","../src/node_modules/@popperjs/core/lib/enums.js","../src/node_modules/@popperjs/core/lib/dom-utils/getNodeName.js","../src/node_modules/@popperjs/core/lib/dom-utils/getWindow.js","../src/node_modules/@popperjs/core/lib/dom-utils/instanceOf.js","../src/node_modules/@popperjs/core/lib/modifiers/applyStyles.js","../src/node_modules/@popperjs/core/lib/utils/getBasePlacement.js","../src/node_modules/@popperjs/core/lib/utils/math.js","../src/node_modules/@popperjs/core/lib/utils/userAgent.js","../src/node_modules/@popperjs/core/lib/dom-utils/isLayoutViewport.js","../src/node_modules/@popperjs/core/lib/dom-utils/getBoundingClientRect.js","../src/node_modules/@popperjs/core/lib/dom-utils/getLayoutRect.js","../src/node_modules/@popperjs/core/lib/dom-utils/contains.js","../src/node_modules/@popperjs/core/lib/dom-utils/getComputedStyle.js","../src/node_modules/@popperjs/core/lib/dom-utils/isTableElement.js","../src/node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js","../src/node_modules/@popperjs/core/lib/dom-utils/getParentNode.js","../src/node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js","../src/node_modules/@popperjs/core/lib/utils/getMainAxisFromPlacement.js","../src/node_modules/@popperjs/core/lib/utils/within.js","../src/node_modules/@popperjs/core/lib/utils/getFreshSideObject.js","../src/node_modules/@popperjs/core/lib/utils/mergePaddingObject.js","../src/node_modules/@popperjs/core/lib/utils/expandToHashMap.js","../src/node_modules/@popperjs/core/lib/modifiers/arrow.js","../src/node_modules/@popperjs/core/lib/utils/getVariation.js","../src/node_modules/@popperjs/core/lib/modifiers/computeStyles.js","../src/node_modules/@popperjs/core/lib/modifiers/eventListeners.js","../src/node_modules/@popperjs/core/lib/utils/getOppositePlacement.js","../src/node_modules/@popperjs/core/lib/utils/getOppositeVariationPlacement.js","../src/node_modules/@popperjs/core/lib/dom-utils/getWindowScroll.js","../src/node_modules/@popperjs/core/lib/dom-utils/getWindowScrollBarX.js","../src/node_modules/@popperjs/core/lib/dom-utils/getViewportRect.js","../src/node_modules/@popperjs/core/lib/dom-utils/getDocumentRect.js","../src/node_modules/@popperjs/core/lib/dom-utils/isScrollParent.js","../src/node_modules/@popperjs/core/lib/dom-utils/getScrollParent.js","../src/node_modules/@popperjs/core/lib/dom-utils/listScrollParents.js","../src/node_modules/@popperjs/core/lib/utils/rectToClientRect.js","../src/node_modules/@popperjs/core/lib/dom-utils/getClippingRect.js","../src/node_modules/@popperjs/core/lib/utils/computeOffsets.js","../src/node_modules/@popperjs/core/lib/utils/detectOverflow.js","../src/node_modules/@popperjs/core/lib/utils/computeAutoPlacement.js","../src/node_modules/@popperjs/core/lib/modifiers/flip.js","../src/node_modules/@popperjs/core/lib/modifiers/hide.js","../src/node_modules/@popperjs/core/lib/modifiers/offset.js","../src/node_modules/@popperjs/core/lib/modifiers/popperOffsets.js","../src/node_modules/@popperjs/core/lib/utils/getAltAxis.js","../src/node_modules/@popperjs/core/lib/modifiers/preventOverflow.js","../src/node_modules/@popperjs/core/lib/dom-utils/getHTMLElementScroll.js","../src/node_modules/@popperjs/core/lib/dom-utils/getNodeScroll.js","../src/node_modules/@popperjs/core/lib/dom-utils/getCompositeRect.js","../src/node_modules/@popperjs/core/lib/utils/orderModifiers.js","../src/node_modules/@popperjs/core/lib/utils/debounce.js","../src/node_modules/@popperjs/core/lib/utils/mergeByName.js","../src/node_modules/@popperjs/core/lib/createPopper.js","../src/node_modules/@popperjs/core/lib/popper.js","../src/node_modules/is-plain-object/dist/is-plain-object.mjs","../src/node_modules/vue-types/dist/vue-types.modern.js","../src/node_modules/@aesoper/normal-utils/NormalUtils.es.js","../src/node_modules/lodash-es/_freeGlobal.js","../src/node_modules/lodash-es/_root.js","../src/node_modules/lodash-es/_Symbol.js","../src/node_modules/lodash-es/_getRawTag.js","../src/node_modules/lodash-es/_objectToString.js","../src/node_modules/lodash-es/_baseGetTag.js","../src/node_modules/lodash-es/isObjectLike.js","../src/node_modules/lodash-es/isArray.js","../src/node_modules/lodash-es/isObject.js","../src/node_modules/lodash-es/identity.js","../src/node_modules/lodash-es/isFunction.js","../src/node_modules/lodash-es/_coreJsData.js","../src/node_modules/lodash-es/_isMasked.js","../src/node_modules/lodash-es/_toSource.js","../src/node_modules/lodash-es/_baseIsNative.js","../src/node_modules/lodash-es/_getValue.js","../src/node_modules/lodash-es/_getNative.js","../src/node_modules/lodash-es/_baseCreate.js","../src/node_modules/lodash-es/_apply.js","../src/node_modules/lodash-es/_copyArray.js","../src/node_modules/lodash-es/_shortOut.js","../src/node_modules/lodash-es/constant.js","../src/node_modules/lodash-es/_defineProperty.js","../src/node_modules/lodash-es/_baseSetToString.js","../src/node_modules/lodash-es/_setToString.js","../src/node_modules/lodash-es/_isIndex.js","../src/node_modules/lodash-es/_baseAssignValue.js","../src/node_modules/lodash-es/eq.js","../src/node_modules/lodash-es/_assignValue.js","../src/node_modules/lodash-es/_copyObject.js","../src/node_modules/lodash-es/_overRest.js","../src/node_modules/lodash-es/_baseRest.js","../src/node_modules/lodash-es/isLength.js","../src/node_modules/lodash-es/isArrayLike.js","../src/node_modules/lodash-es/_isIterateeCall.js","../src/node_modules/lodash-es/_createAssigner.js","../src/node_modules/lodash-es/_isPrototype.js","../src/node_modules/lodash-es/_baseTimes.js","../src/node_modules/lodash-es/_baseIsArguments.js","../src/node_modules/lodash-es/isArguments.js","../src/node_modules/lodash-es/stubFalse.js","../src/node_modules/lodash-es/isBuffer.js","../src/node_modules/lodash-es/_baseIsTypedArray.js","../src/node_modules/lodash-es/_baseUnary.js","../src/node_modules/lodash-es/_nodeUtil.js","../src/node_modules/lodash-es/isTypedArray.js","../src/node_modules/lodash-es/_arrayLikeKeys.js","../src/node_modules/lodash-es/_overArg.js","../src/node_modules/lodash-es/_nativeKeysIn.js","../src/node_modules/lodash-es/_baseKeysIn.js","../src/node_modules/lodash-es/keysIn.js","../src/node_modules/lodash-es/_nativeCreate.js","../src/node_modules/lodash-es/_hashClear.js","../src/node_modules/lodash-es/_hashDelete.js","../src/node_modules/lodash-es/_hashGet.js","../src/node_modules/lodash-es/_hashHas.js","../src/node_modules/lodash-es/_hashSet.js","../src/node_modules/lodash-es/_Hash.js","../src/node_modules/lodash-es/_listCacheClear.js","../src/node_modules/lodash-es/_assocIndexOf.js","../src/node_modules/lodash-es/_listCacheDelete.js","../src/node_modules/lodash-es/_listCacheGet.js","../src/node_modules/lodash-es/_listCacheHas.js","../src/node_modules/lodash-es/_listCacheSet.js","../src/node_modules/lodash-es/_ListCache.js","../src/node_modules/lodash-es/_Map.js","../src/node_modules/lodash-es/_mapCacheClear.js","../src/node_modules/lodash-es/_isKeyable.js","../src/node_modules/lodash-es/_getMapData.js","../src/node_modules/lodash-es/_mapCacheDelete.js","../src/node_modules/lodash-es/_mapCacheGet.js","../src/node_modules/lodash-es/_mapCacheHas.js","../src/node_modules/lodash-es/_mapCacheSet.js","../src/node_modules/lodash-es/_MapCache.js","../src/node_modules/lodash-es/_getPrototype.js","../src/node_modules/lodash-es/isPlainObject.js","../src/node_modules/lodash-es/_stackClear.js","../src/node_modules/lodash-es/_stackDelete.js","../src/node_modules/lodash-es/_stackGet.js","../src/node_modules/lodash-es/_stackHas.js","../src/node_modules/lodash-es/_stackSet.js","../src/node_modules/lodash-es/_Stack.js","../src/node_modules/lodash-es/_cloneBuffer.js","../src/node_modules/lodash-es/_Uint8Array.js","../src/node_modules/lodash-es/_cloneArrayBuffer.js","../src/node_modules/lodash-es/_cloneTypedArray.js","../src/node_modules/lodash-es/_initCloneObject.js","../src/node_modules/lodash-es/_createBaseFor.js","../src/node_modules/lodash-es/_baseFor.js","../src/node_modules/lodash-es/_assignMergeValue.js","../src/node_modules/lodash-es/isArrayLikeObject.js","../src/node_modules/lodash-es/_safeGet.js","../src/node_modules/lodash-es/toPlainObject.js","../src/node_modules/lodash-es/_baseMergeDeep.js","../src/node_modules/lodash-es/_baseMerge.js","../src/node_modules/lodash-es/merge.js","../src/node_modules/vue3-colorpicker/index.es.js","../src/src/components/phystonPrompt.vue","../src/src/components/translateSetting.vue","../src/src/components/selectLanguage.vue","../src/src/components/favorite.vue","../src/src/components/history.vue","../src/src/components/extensionCss.vue","../src/src/components/promptFormat.vue","../src/src/components/blacklist.vue","../src/src/components/packagesState.vue","../src/src/components/chatgptPrompt.vue","../src/src/components/about.vue","../src/node_modules/js-yaml/dist/js-yaml.mjs","../src/src/components/hotkey.vue","../src/src/components/extraNetworksPopup.vue","../src/src/App.vue","../src/node_modules/jquery/dist/jquery.js","../src/node_modules/toastr/toastr.js","../src/node_modules/clipboard/dist/clipboard.js","../src/node_modules/vue-clipboard3/dist/esm/index.js","../src/node_modules/axios/lib/helpers/bind.js","../src/node_modules/axios/lib/utils.js","../src/node_modules/axios/lib/core/AxiosError.js","../src/node_modules/axios/lib/helpers/null.js","../src/node_modules/axios/lib/helpers/toFormData.js","../src/node_modules/axios/lib/helpers/AxiosURLSearchParams.js","../src/node_modules/axios/lib/helpers/buildURL.js","../src/node_modules/axios/lib/core/InterceptorManager.js","../src/node_modules/axios/lib/defaults/transitional.js","../src/node_modules/axios/lib/platform/browser/classes/URLSearchParams.js","../src/node_modules/axios/lib/platform/browser/classes/FormData.js","../src/node_modules/axios/lib/platform/browser/classes/Blob.js","../src/node_modules/axios/lib/platform/browser/index.js","../src/node_modules/axios/lib/helpers/toURLEncodedForm.js","../src/node_modules/axios/lib/helpers/formDataToJSON.js","../src/node_modules/axios/lib/defaults/index.js","../src/node_modules/axios/lib/helpers/parseHeaders.js","../src/node_modules/axios/lib/core/AxiosHeaders.js","../src/node_modules/axios/lib/core/transformData.js","../src/node_modules/axios/lib/cancel/isCancel.js","../src/node_modules/axios/lib/cancel/CanceledError.js","../src/node_modules/axios/lib/core/settle.js","../src/node_modules/axios/lib/helpers/cookies.js","../src/node_modules/axios/lib/helpers/isAbsoluteURL.js","../src/node_modules/axios/lib/helpers/combineURLs.js","../src/node_modules/axios/lib/core/buildFullPath.js","../src/node_modules/axios/lib/helpers/isURLSameOrigin.js","../src/node_modules/axios/lib/helpers/parseProtocol.js","../src/node_modules/axios/lib/helpers/speedometer.js","../src/node_modules/axios/lib/adapters/xhr.js","../src/node_modules/axios/lib/adapters/adapters.js","../src/node_modules/axios/lib/core/dispatchRequest.js","../src/node_modules/axios/lib/core/mergeConfig.js","../src/node_modules/axios/lib/env/data.js","../src/node_modules/axios/lib/helpers/validator.js","../src/node_modules/axios/lib/core/Axios.js","../src/node_modules/axios/lib/cancel/CancelToken.js","../src/node_modules/axios/lib/helpers/spread.js","../src/node_modules/axios/lib/helpers/isAxiosError.js","../src/node_modules/axios/lib/helpers/HttpStatusCode.js","../src/node_modules/axios/lib/axios.js","../src/src/utils/gradioAPI.js","../src/src/mixins/commonMixin.js","../src/node_modules/tippy.js/dist/tippy.esm.js","../src/src/main.js"],"sourcesContent":["/**\n * Make a map and return a function for checking if a key\n * is in that map.\n * IMPORTANT: all calls of this function must be prefixed with\n * \\/\\*#\\_\\_PURE\\_\\_\\*\\/\n * So that rollup can tree-shake them if necessary.\n */\nfunction makeMap(str, expectsLowerCase) {\n const map = Object.create(null);\n const list = str.split(',');\n for (let i = 0; i < list.length; i++) {\n map[list[i]] = true;\n }\n return expectsLowerCase ? val => !!map[val.toLowerCase()] : val => !!map[val];\n}\n\n/**\n * dev only flag -> name mapping\n */\nconst PatchFlagNames = {\n [1 /* PatchFlags.TEXT */]: `TEXT`,\n [2 /* PatchFlags.CLASS */]: `CLASS`,\n [4 /* PatchFlags.STYLE */]: `STYLE`,\n [8 /* PatchFlags.PROPS */]: `PROPS`,\n [16 /* PatchFlags.FULL_PROPS */]: `FULL_PROPS`,\n [32 /* PatchFlags.HYDRATE_EVENTS */]: `HYDRATE_EVENTS`,\n [64 /* PatchFlags.STABLE_FRAGMENT */]: `STABLE_FRAGMENT`,\n [128 /* PatchFlags.KEYED_FRAGMENT */]: `KEYED_FRAGMENT`,\n [256 /* PatchFlags.UNKEYED_FRAGMENT */]: `UNKEYED_FRAGMENT`,\n [512 /* PatchFlags.NEED_PATCH */]: `NEED_PATCH`,\n [1024 /* PatchFlags.DYNAMIC_SLOTS */]: `DYNAMIC_SLOTS`,\n [2048 /* PatchFlags.DEV_ROOT_FRAGMENT */]: `DEV_ROOT_FRAGMENT`,\n [-1 /* PatchFlags.HOISTED */]: `HOISTED`,\n [-2 /* PatchFlags.BAIL */]: `BAIL`\n};\n\n/**\n * Dev only\n */\nconst slotFlagsText = {\n [1 /* SlotFlags.STABLE */]: 'STABLE',\n [2 /* SlotFlags.DYNAMIC */]: 'DYNAMIC',\n [3 /* SlotFlags.FORWARDED */]: 'FORWARDED'\n};\n\nconst GLOBALS_WHITE_LISTED = 'Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,' +\n 'decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,' +\n 'Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt';\nconst isGloballyWhitelisted = /*#__PURE__*/ makeMap(GLOBALS_WHITE_LISTED);\n\nconst range = 2;\nfunction generateCodeFrame(source, start = 0, end = source.length) {\n // Split the content into individual lines but capture the newline sequence\n // that separated each line. This is important because the actual sequence is\n // needed to properly take into account the full line length for offset\n // comparison\n let lines = source.split(/(\\r?\\n)/);\n // Separate the lines and newline sequences into separate arrays for easier referencing\n const newlineSequences = lines.filter((_, idx) => idx % 2 === 1);\n lines = lines.filter((_, idx) => idx % 2 === 0);\n let count = 0;\n const res = [];\n for (let i = 0; i < lines.length; i++) {\n count +=\n lines[i].length +\n ((newlineSequences[i] && newlineSequences[i].length) || 0);\n if (count >= start) {\n for (let j = i - range; j <= i + range || end > count; j++) {\n if (j < 0 || j >= lines.length)\n continue;\n const line = j + 1;\n res.push(`${line}${' '.repeat(Math.max(3 - String(line).length, 0))}| ${lines[j]}`);\n const lineLength = lines[j].length;\n const newLineSeqLength = (newlineSequences[j] && newlineSequences[j].length) || 0;\n if (j === i) {\n // push underline\n const pad = start - (count - (lineLength + newLineSeqLength));\n const length = Math.max(1, end > count ? lineLength - pad : end - start);\n res.push(` | ` + ' '.repeat(pad) + '^'.repeat(length));\n }\n else if (j > i) {\n if (end > count) {\n const length = Math.max(Math.min(end - count, lineLength), 1);\n res.push(` | ` + '^'.repeat(length));\n }\n count += lineLength + newLineSeqLength;\n }\n }\n break;\n }\n }\n return res.join('\\n');\n}\n\nfunction normalizeStyle(value) {\n if (isArray(value)) {\n const res = {};\n for (let i = 0; i < value.length; i++) {\n const item = value[i];\n const normalized = isString(item)\n ? parseStringStyle(item)\n : normalizeStyle(item);\n if (normalized) {\n for (const key in normalized) {\n res[key] = normalized[key];\n }\n }\n }\n return res;\n }\n else if (isString(value)) {\n return value;\n }\n else if (isObject(value)) {\n return value;\n }\n}\nconst listDelimiterRE = /;(?![^(]*\\))/g;\nconst propertyDelimiterRE = /:([^]+)/;\nconst styleCommentRE = /\\/\\*.*?\\*\\//gs;\nfunction parseStringStyle(cssText) {\n const ret = {};\n cssText\n .replace(styleCommentRE, '')\n .split(listDelimiterRE)\n .forEach(item => {\n if (item) {\n const tmp = item.split(propertyDelimiterRE);\n tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim());\n }\n });\n return ret;\n}\nfunction stringifyStyle(styles) {\n let ret = '';\n if (!styles || isString(styles)) {\n return ret;\n }\n for (const key in styles) {\n const value = styles[key];\n const normalizedKey = key.startsWith(`--`) ? key : hyphenate(key);\n if (isString(value) || typeof value === 'number') {\n // only render valid values\n ret += `${normalizedKey}:${value};`;\n }\n }\n return ret;\n}\nfunction normalizeClass(value) {\n let res = '';\n if (isString(value)) {\n res = value;\n }\n else if (isArray(value)) {\n for (let i = 0; i < value.length; i++) {\n const normalized = normalizeClass(value[i]);\n if (normalized) {\n res += normalized + ' ';\n }\n }\n }\n else if (isObject(value)) {\n for (const name in value) {\n if (value[name]) {\n res += name + ' ';\n }\n }\n }\n return res.trim();\n}\nfunction normalizeProps(props) {\n if (!props)\n return null;\n let { class: klass, style } = props;\n if (klass && !isString(klass)) {\n props.class = normalizeClass(klass);\n }\n if (style) {\n props.style = normalizeStyle(style);\n }\n return props;\n}\n\n// These tag configs are shared between compiler-dom and runtime-dom, so they\n// https://developer.mozilla.org/en-US/docs/Web/HTML/Element\nconst HTML_TAGS = 'html,body,base,head,link,meta,style,title,address,article,aside,footer,' +\n 'header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,' +\n 'figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,' +\n 'data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,' +\n 'time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,' +\n 'canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,' +\n 'th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,' +\n 'option,output,progress,select,textarea,details,dialog,menu,' +\n 'summary,template,blockquote,iframe,tfoot';\n// https://developer.mozilla.org/en-US/docs/Web/SVG/Element\nconst SVG_TAGS = 'svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,' +\n 'defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,' +\n 'feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,' +\n 'feDistantLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,' +\n 'feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,' +\n 'fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,' +\n 'foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,' +\n 'mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,' +\n 'polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,' +\n 'text,textPath,title,tspan,unknown,use,view';\nconst VOID_TAGS = 'area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr';\n/**\n * Compiler only.\n * Do NOT use in runtime code paths unless behind `(process.env.NODE_ENV !== 'production')` flag.\n */\nconst isHTMLTag = /*#__PURE__*/ makeMap(HTML_TAGS);\n/**\n * Compiler only.\n * Do NOT use in runtime code paths unless behind `(process.env.NODE_ENV !== 'production')` flag.\n */\nconst isSVGTag = /*#__PURE__*/ makeMap(SVG_TAGS);\n/**\n * Compiler only.\n * Do NOT use in runtime code paths unless behind `(process.env.NODE_ENV !== 'production')` flag.\n */\nconst isVoidTag = /*#__PURE__*/ makeMap(VOID_TAGS);\n\n/**\n * On the client we only need to offer special cases for boolean attributes that\n * have different names from their corresponding dom properties:\n * - itemscope -> N/A\n * - allowfullscreen -> allowFullscreen\n * - formnovalidate -> formNoValidate\n * - ismap -> isMap\n * - nomodule -> noModule\n * - novalidate -> noValidate\n * - readonly -> readOnly\n */\nconst specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;\nconst isSpecialBooleanAttr = /*#__PURE__*/ makeMap(specialBooleanAttrs);\n/**\n * The full list is needed during SSR to produce the correct initial markup.\n */\nconst isBooleanAttr = /*#__PURE__*/ makeMap(specialBooleanAttrs +\n `,async,autofocus,autoplay,controls,default,defer,disabled,hidden,` +\n `loop,open,required,reversed,scoped,seamless,` +\n `checked,muted,multiple,selected`);\n/**\n * Boolean attributes should be included if the value is truthy or ''.\n * e.g. `