PageSourceSearch

https://substore-my.hf.space/chunks/actionsToPorcess-2c604506.js

js substore-my.hf.space collected 2026-10-03 17:25:27 UTC 48,742 bytes, 1 lines download raw bytes

1var e=Object.defineProperty,o=Object.defineProperties,a=Object.getOwnPropertyDescriptors,t=Object.getOwnPropertySymbols,l=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable,s=(o,a,t)=>a in o?e(o,a,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[a]=t,i=(e,o)=>{for(var a in o||(o={}))l.call(o,a)&&s(e,a,o[a]);if(t)for(var a of t(o))n.call(o,a)&&s(e,a,o[a]);return e},r=(e,o,a)=>new Promise((t,l)=>{var n=e=>{try{i(a.next(e))}catch(o){l(o)}},s=e=>{try{i(a.throw(e))}catch(o){l(o)}},i=e=>e.done?t(e.value):Promise.resolve(e.value).then(n,s);i((a=a.apply(e,o)).next())});import{d as c,ag as u,a as d,R as p,c as m,r as g,w as v,X as f,e as y,f as b,B as h,E as k,v as C,D as $,g as P,J as x,x as A,j as w,N as V,F as O,A as T,L as _,M as U,y as N,q as E,p as S,i as R,n as I,a8 as F,o as D,ac as j,aq as B,a3 as M,a7 as z,U as q}from"./vue-vendor-22929d76.js";import{a as L,B as J,al as H,_ as K,m as Y,u as X,ae as G,af as W,aj as Q,d as Z,a3 as ee}from"./main-958e31e1.js";import{t as oe,h as ae}from"./nutui-9e59ce95.js";import{u as te}from"./i18n-dbec228d.js";import{a as le,b as ne}from"./editorTabState-724d419c.js";const se={class:"form-block-wrapper"},ie={key:0,class:"sticky-title-wrapper actions-title-wrapper"},re={class:"title-text left"},ce=["onClick"],ue={class:"input-wrapper"},de={class:"right"},pe={class:"list-group-item-icons icon-button__input"},me={class:"action-switch"},ge=["onClick"],ve=["onMouseenter","onMouseleave","onFocusin","onFocusout"],fe=["onClick"],ye={class:"preview-switch-tooltip"},be={key:1,class:"preview-switch"},he=["onClick"],ke={class:"icon-button"},Ce={class:"icon-button"},$e={class:"delete"},Pe={class:"drag-handler"},xe={class:"list-group-item-titlesa"},Ae={class:"horizontal-button-container"},we=["onClick"],Ve={class:"horizontal-button-container"},Oe="Add Proxies From Subscription Operator",Te=K(c({__name:"ActionBlock",props:{checked:{},list:{},sourceType:{}},emits:["addAction","deleteAction","updateCustomNameModeFlag","toggleAction"],setup(e,{expose:s,emit:c}){const{copy:F,isSupported:D}=u(),{toClipboard:j}=L(),{t:B}=te(),M=d(""),z=d(!1),q=d(!0),K=d("1"===localStorage.getItem("actions-block-collapsed")),Y=d([]),X=p("form"),G=[Oe,"Script Operator","Response Transformer"],W=m(()=>"file"===e.sourceType&&"mihomoProfile"===(null==X?void 0:X.type)),Q=m(()=>Object.keys(H.editorPage.subConfig.nodeActions).map(e=>({text:B(`editorPage.subConfig.nodeActions['${e}'].label`),value:e}))),Z=m(()=>{if("file"!==e.sourceType)return Q.value.filter(e=>e.value!==Oe);return(W.value?G:G.filter(e=>e!==Oe)).map(e=>Q.value.find(o=>o.value===e)).filter(Boolean)});K.value?Y.value=e.list.map(e=>e.id):Y.value=[];const ee=o=>{K.value=o,o?(localStorage.setItem("actions-block-collapsed","1"),Y.value=e.list.map(e=>e.id)):(localStorage.removeItem("actions-block-collapsed"),Y.value=[])},le=o=>{Y.value.includes(o)?Y.value=Y.value.filter(e=>e!==o):Y.value.push(o),Y.value.length===e.list.length?ee(!0):0===Y.value.length?ee(!1):K.value=!1},ne=o=>r(this,null,function*(){const a=X.process.find(e=>e.id===o.id),t=JSON.stringify({source:e.sourceType,data:a});D?yield F(t):yield j(t),oe.text("已复制数据 可用于导入")}),Te=()=>r(this,null,function*(){z.value=!1,M.value=""}),_e=()=>r(this,null,function*(){var t,l,n,s,r;try{let n,u="";if(z.value)u=M.value,z.value=!1,M.value="";else try{u=yield navigator.clipboard.readText()}catch(c){return M.value="",void(z.value=!0)}try{n=JSON.parse(u)}catch(c){}if(!(null==(t=null==n?void 0:n.data)?void 0:t.id)||!(null==(l=null==n?void 0:n.data)?void 0:l.type))throw new Error("数据格式错误");{if((null==n?void 0:n.source)!==e.sourceType)throw new Error("文件操作与订阅操作不通用");if(n.data.type===Oe&&!W.value)throw new Error("该操作仅适用于 Mihomo 配置文件");const t=[(s=i({},n.data),r={value:n.data.type},o(s,a(r)))];Ue("addAction",t)}}catch(c){oe.text(`导入失败 ${null!=(n=c.message)?n:c}`)}}),Ue=c,Ne=e=>"Response Transformer"===e.type,Ee=g({}),Se=e=>{Ee[e]=!0},Re=e=>{Ee[e]=!1},Ie=o=>e.checked.find(e=>e[0]===o),Fe=()=>{ae({title:B("editorPage.subConfig.pop.helpTitle"),content:B("editorPage.subConfig.pop.helpContent"),popClass:"auto-dialog",noCancelBtn:!0,closeOnClickOverlay:!0})},De=e=>{var o;return(null==(o=Q.value.find(o=>o.value===e))?void 0:o.text)||e},je=e=>{const o=e,{tipsDes:a,component:s}=o,r=((e,o)=>{var a={};for(var s in e)l.call(e,s)&&o.indexOf(s)<0&&(a[s]=e[s]);if(null!=e&&t)for(var s of t(e))o.indexOf(s)<0&&n.call(e,s)&&(a[s]=e[s]);return a})(o,["tipsDes","component"]);return i({defaultName:De(r.type),oldCustomName:r.customName,isEditing:!1},r)},Be=g(e.list.map(je)),Me=m(()=>Be.map(e=>e.isEditing).includes(!0));v(()=>e.list,e=>{if(Be.length>e.length){Be.filter(o=>!e.some(e=>
1e.id===o.id)).forEach(e=>{const o=Be.findIndex(o=>o.id===e.id);-1!==o&&Be.splice(o,1)})}else{e.filter(e=>!Be.some(o=>o.id===e.id)).forEach(e=>{Be.push(je(e))})}},{deep:!0}),v(Me,e=>{Ue("updateCustomNameModeFlag",e)});const ze=e=>Be.find(o=>o.id===e.id),qe=e=>{const o=Be.find(o=>o.id===e.id);o.isEditing=!1,/^\s*$/.test(o.customName)&&(o.customName=""),o.oldCustomName=o.customName,X.process.find(o=>o.id===e.id).customName=o.customName},Le=e=>{const o=Be.find(o=>o.id===e.id);o.isEditing=!1,o.oldCustomName!==o.customName&&(o.customName=o.oldCustomName)};return s({exitAllEditName:()=>{Be.forEach(e=>{e.isEditing&&Le(e)})}}),(o,a)=>{const t=f("font-awesome-icon"),l=f("nut-icon"),n=f("nut-input"),s=f("nut-checkbox"),i=f("nut-popover"),r=f("nut-cell"),c=f("nut-textarea"),u=f("nut-form-item"),d=f("nut-form");return y(),b("div",se,["file"!==e.sourceType?(y(),b("div",ie,[h("p",null,k(o.$t("editorPage.subConfig.actions.label")),1),K.value?(y(),C(t,{key:0,onClick:a[0]||(a[0]=$(e=>ee(!1),["stop"])),class:"toggle fa-toggle",icon:"fa-solid fa-toggle-on "})):(y(),C(t,{key:1,onClick:a[1]||(a[1]=$(e=>ee(!0),["stop"])),class:"toggle fa-toggle",icon:"fa-solid fa-toggle-off"})),h("button",{onClick:Fe},[P(t,{icon:"fa-solid fa-circle-question"}),x(" "+k(o.$t("editorPage.subConfig.basic.nodeActionsHelp")),1)])])):A("",!0),e.list.length>0?(y(),C(S(J),E({key:1,class:"list-group",tag:"ul","component-data":{tag:"ul",name:q.value?"flip-list":null},"scroll-sensitivity":200,"force-fallback":!0,scroll:!0,list:e.list,scrollSpeed:8},{animation:200,disabled:!1,ghostClass:"ghost",chosenClass:"chosen",dragClass:"dragging",delay:0,handle:".drag-handler"},{onEnd:a[3]||(a[3]=e=>q.value=!1),onStart:a[4]||(a[4]=e=>q.value=!0),"item-key":"id"}),{item:w(({element:c,index:u})=>[P(r,{class:"list-group-item","aria-hidden":"true"},{default:w(()=>[h("div",{class:T({"list-group-item-title":!0,collapsed:Y.value.includes(c.id)})},[h("div",re,[h("span",{class:"collapsed",onClick:e=>le(c.id)},[Y.value.includes(c.id)?A("",!0):(y(),C(l,{key:0,name:"rect-down",size:"12px"})),Y.value.includes(c.id)?(y(),C(l,{key:1,name:"rect-right",size:"12px"})):A("",!0)],8,ce),h("div",ue,[P(n,{id:`action-input-${c.id}`,onClick:[a[2]||(a[2]=$(()=>{},["stop"])),e=>{var o;ze(o=c).isEditing||le(o.id)}],modelValue:ze(c).customName,"onUpdate:modelValue":e=>ze(c).customName=e,class:"custom-name-input",type:"text",readonly:!ze(c).isEditing,placeholder:ze(c).defaultName,onBlur:e=>qe(c),onKeyup:V(e=>qe(c),["enter"])},null,8,["id","modelValue","onUpdate:modelValue","readonly","placeholder","onBlur","onKeyup","onClick"])])]),h("div",de,[h("div",pe,[ze(c).isEditing?(y(),b(O,{key:1},[P(t,{icon:"fa-solid fa-floppy-disk",onClick:$(e=>qe(c),["stop"])},null,8,["onClick"]),P(t,{icon:"fa-solid fa-ban",onClick:$(e=>Le(c),["stop"])},null,8,["onClick"])],64)):(y(),C(t,{key:0,icon:"fa-solid fa-pen-to-square",onClick:$(e=>(e=>{const o=Be.find(o=>o.id===e.id);Be.forEach(e=>{e.isEditing&&e.id!==o.id&&Le(e)}),o.isEditing=!0,I(()=>{const o=document.getElementById(`action-input-${e.id}`),a=null==o?void 0:o.querySelector("input");a&&a.focus()})})(c),["stop"])},null,8,["onClick"]))]),h("div",me,[P(s,{modelValue:c.enabled,"onUpdate:modelValue":e=>c.enabled=e,class:"my-switch"},null,8,["modelValue","onUpdate:modelValue"]),h("span",{onClick:e=>{return o=c.id,void Ue("toggleAction",o);var o}},k(o.$t("editorPage.subConfig.actions.enable")),9,ge)]),Ne(c)?(y(),b("div",{key:0,class:"preview-switch-popover",onMouseenter:e=>Se(c.id),onMouseleave:e=>Re(c.id),onFocusin:e=>Se(c.id),onFocusout:e=>Re(c.id)},[P(i,{visible:Ee[c.id],"onUpdate:visible":e=>Ee[c.id]=e,location:"top",theme:"dark","custom-class":"preview-switch-nut-popover",overlay:!1,"close-on-click-outside":!0},{reference:w(()=>[h("div",{class:"preview-switch preview-switch--disabled",onClick:$(e=>Se(c.id),["stop"])},[P(s,{modelValue:Ie(c.id)[1],"onUpdate:modelValue":e=>Ie(c.id)[1]=e,disabled:"",class:"my-switch"},null,8,["modelValue","onUpdate:modelValue"]),h("span",null,k(o.$t("editorPage.subConfig.basic.previewSwitch")),1)],8,fe)]),content:w(()=>[h("span",ye,k(o.$t("editorPage.subConfig.basic.previewDisabledResponseOnlyTips")),1)]),_:2},1032,["visible","onUpdate:visible"])],40,ve)):(y(),b("div",be,[P(s,{modelValue:Ie(c.id)[1],"onUpdate:modelValue":e=>Ie(c.id)[1]=e,class:"my-switch"},null,8,["modelValue","onUpdate:modelValue"]),h("span",{onClick:e=>(e=>{if(Ne(e))return;const o=Ie(e.id);return o[1]=!o[1]})(c)},k(o.$t("editorPage.subConfig.basic.previewSwitch")),9,he)])),h("div",ke,[P(t,{icon:"fa-solid fa-circle-question",onClick:$(e=>{return o=c.type,a=c.tipsDes,void ae({title:B(`editorPage.subConfig.nodeActions['${o}'].tipsTitle`),content:a,popClass:"auto-dialog",noCancelBtn:!0,closeOnClickOverlay:!0});var o,a},["stop"])},null,8,["onClick"])]),h("div",Ce,[P(t,{icon:"fa-solid fa-clone",onClick:e=>ne(c)}
1,null,8,["onClick"])]),h("div",$e,[P(t,{icon:"fa-solid fa-trash-can",onClick:e=>{return o=c.id,void ae({title:B("editorPage.subConfig.pop.deleteTitle"),content:B("editorPage.subConfig.pop.deleteDes"),popClass:"auto-dialog",okText:B("editorPage.subConfig.pop.deleteConfirm"),cancelText:B("editorPage.subConfig.pop.deleteCancel"),onOk:()=>{Ue("deleteAction",o)},closeOnClickOverlay:!0});var o}},null,8,["onClick"])]),h("div",Pe,[P(t,{icon:"fa-solid fa-grip",class:"fa-lg"})])])],2),_((y(),C(N(c.component),{type:c.type,id:c.id,sourceType:e.sourceType},null,8,["type","id","sourceType"])),[[U,!Y.value.includes(c.id)]])]),_:2},1024)]),_:1},16,["component-data","list"])):A("",!0),P(r,{class:"list-group-itemsa","aria-hidden":"true"},{default:w(()=>[h("div",xe,[h("span",null,k(o.$t("editorPage.subConfig.actions.addAction.title")),1),"file"!==e.sourceType?(y(),C(t,{key:0,onClick:Fe,icon:"fa-solid fa-circle-question"})):A("",!0)]),h("div",Ae,[(y(!0),b(O,null,R(Z.value,(e,o)=>(y(),b("button",{key:o,onClick:o=>(e=>{Ue("addAction",[e])})(e),class:"custom-button"},k(e.text),9,we))),128)),h("button",{onClick:_e,class:"custom-button"},k(o.$t("editorPage.subConfig.actions.pasteAction.label")),1)])]),_:1}),z.value?(y(),C(d,{key:2,class:"paste-action"},{default:w(()=>[P(u,null,{default:w(()=>[P(c,{class:"textarea-wrapper",modelValue:M.value,"onUpdate:modelValue":a[5]||(a[5]=e=>M.value=e),autosize:{maxHeight:110,minHeight:50},placeholder:o.$t("editorPage.subConfig.actions.pasteAction.placeholder"),"text-align":"center"},null,8,["modelValue","placeholder"]),h("div",Ve,[h("button",{onClick:Te,class:"custom-button"},k(o.$t("editorPage.subConfig.actions.addAction.cancel")),1),h("button",{onClick:_e,class:"custom-button"},k(o.$t("editorPage.subConfig.actions.pasteAction.label")),1)])]),_:1})]),_:1})):A("",!0)])}}}),[["__scopeId","data-v-10f750f5"]]),_e="/images/tw.png",Ue={class:"editor-action-card"},Ne={class:"des-label"},Ee={class:"radio-wrapper options-radio"},Se={key:0,class:"radio-wrapper options-radio custom-dns-input-option"},Re={class:"input-wrapper compact-input-wrapper compact-input-wrapper--custom-dns"},Ie={class:"radio-wrapper options-radio edns-input-option"},Fe={class:"input-wrapper compact-input-wrapper compact-input-wrapper--edns"},De={class:"radio-wrapper options-radio inline-input-option"},je={class:"des-label"},Be={class:"input-wrapper compact-input-wrapper compact-input-wrapper--concurrency"},Me={class:"radio-wrapper options-radio"},ze={class:"radio-wrapper options-radio"},qe={class:"radio-wrapper options-radio"},Le={key:1,class:"radio-wrapper options-radio"},Je=["src"],He=K(c({__name:"ActionRadio",props:{type:{},id:{}},setup(e){const o=Y(),{showNotify:a}=X();F(o);const t=p("form"),l={"Flag Operator":["add","remove"],"Sort Operator":["asc","desc","random"],"Resolve Domain Operator":["Google","IP-API","Cloudflare","Ali","Tencent","Custom"]},n=["cn","ws","tw"],s=["IPv4","IPv6"],i=["disabled","removeFailed","IPOnly","IPv4Only","IPv6Only"],c=["enabled","disabled"],u=d(),m=d(!0),g=d(!0),$=d("cn"),V=d("IPv4"),T=d("disabled"),_=d("enabled"),U=d(""),N=d(""),E=d(""),I=()=>{oe.text("免责声明: 本操作仅将 Emoji 旗帜进行替换以便于显示, 不包含任何政治意味")},j=()=>{ae({title:"IP4P 地址格式",content:"🆕 当选择解析类型为 IPv6 时\n将自动转换其中的 IP4P 地址\n\n来自 NATMap, 将 IPv4 地址和端口同时编码在 DNS AAAA 记录中\n\n使用场景: STUN 内网穿透, 无需公网服务器即可获
1得 IPv4 公网地址",popClass:"auto-dialog",okText:"更多说明",cancelText:"取消",closeOnClickOverlay:!0,onOk:()=>r(this,null,function*(){window.open("https://github.com/heiher/natmap/wiki/faq#%E5%9F%9F%E5%90%8D%E8%AE%BF%E9%97%AE%E6%98%AF%E5%A6%82%E4%BD%95%E5%AE%9E%E7%8E%B0%E7%9A%84")}),closeOnPopstate:!0,lockScroll:!1})};return D(()=>{var o,a,l,n,s,i,r,c,d,p,m,g,v,f,y,b,h;const k=t.process.find(o=>o.id===e.id);if(k)switch(e.type){case"Flag Operator":u.value=null!=(a=null==(o=k.args)?void 0:o.mode)?a:"add",$.value=null!=(n=null==(l=k.args)?void 0:l.tw)?n:"cn";break;case"Sort Operator":u.value=null!=(s=k.args)?s:"asc";break;case"Resolve Domain Operator":u.value=null!=(r=null==(i=k.args)?void 0:i.provider)?r:"Google",V.value=null!=(d=null==(c=k.args)?void 0:c.type)?d:"IPv4","IP4P"===V.value&&(V.value="IPv6"),T.value=null!=(m=null==(p=k.args)?void 0:p.filter)?m:"disabled",_.value=null!=(v=null==(g=k.args)?void 0:g.cache)?v:"enabled",U.value=null!=(y=null==(f=k.args)?void 0:f.url)?y:"",N.value=null==(b=k.args)?void 0:b.edns,E.value=`${null!=(C=null==(h=k.args)?void 0:h.concurrency)?C:""}`.trim()}var C}),v([u,T,_,U,N,E,V,$],()=>{["IPv6","IP4P"].includes(V.value)&&["IP-API"].includes(u.value)&&a({title:`${u.value} 不支持 ${V.value}`,type:"danger"});const o=t.process.find(o=>o.id===e.id);switch(e.type){case"Flag Operator":o.args={mode:u.value,tw:$.value};break;case"Sort Operator":o.args=u.value;break;case"Resolve Domain Operator":o.args={provider:u.value,type:V.value,filter:T.value,cache:_.value,url:U.value,edns:N.value,concurrency:`${null!=(l=E.value)?l:""}`.trim()||void 0}}var l}),(o,a)=>{const t=f("nut-radio"),r=f("nut-radiogroup"),d=f("nut-input"),p=f("font-awesome-icon"),v=f("nut-icon");return y(),b("div",Ue,[h("p",Ne,k(o.$t(`editorPage.subConfig.nodeActions['${e.type}'].des`)),1),h("div",Ee,[P(r,{direction:"horizontal",modelValue:u.value,"onUpdate:modelValue":a[0]||(a[0]=e=>u.value=e)},{default:w(()=>[(y(!0),b(O,null,R(l[e.type],(a,l)=>(y(),C(t,{label:a,key:l},{default:w(()=>[h("div",null,k(o.$t(`editorPage.subConfig.nodeActions['${e.type}'].options[${l}]`)),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"])]),"Resolve Domain Operator"===e.type&&m.value?(y(),b(O,{key:0},["Custom"===u.value?(y(),b("div",Se,[a[8]||(a[8]=h("p",{class:"des-label"},"自定义 DNS(全平台支持 DoH, Node.js 额外支持 TCP/UDP DNS)",-1)),h("div",Re,[P(d,{placeholder:"请输入 DoH 或 [udp://]1.1.1.1[:53] 或 tcp://1.1.1.1[:53] (括号内可省略)",modelValue:U.value,"onUpdate:modelValue":a[1]||(a[1]=e=>U.value=e)},null,8,["modelValue"])])])):A("",!0),h("div",Ie,[a[9]||(a[9]=h("p",{class:"des-label"},"EDNS(Google, Ali, Tencent, 自定义 DNS 会携带此参数, 可能会影响解析结果)",-1)),h("div",Fe,[P(d,{placeholder:"请输入纯 IP, 默认为 223.6.6.6",modelValue:N.value,"onUpdate:modelValue":a[2]||(a[2]=e=>N.value=e)},null,8,["modelValue"])])]),h("div",De,[h("p",je,k(o.$t(`editorPage.subConfig.nodeActions['${e.type}'].concurrency`)),1),h("div",Be,[P(d,{type:"number",placeholder:o.$t(`editorPage.subConfig.nodeActions['${e.type}'].concurrencyPlaceholder`),modelValue:E.value,"onUpdate:modelValue":a[3]||(a[3]=e=>E.value=e)},null,8,["placeholder","modelValue"])])]),h("div",Me,[h("p",{class:"des-label",style:{cursor:"pointer"},onClick:j},[a[10]||(a[10]=x("解析类型(IPv6 兼容 IP4P ",-1)),P(p,{icon:"fa-solid fa-circle-question"}),a[11]||(a[11]=x(")",-1))]),P(r,{direction:"horizontal",modelValue:V.value,"onUpdate:modelValue":a[4]||(a[4]=e=>V.value=e)},{default:w(()=>[(y(),b(O,null,R(s,(a,l)=>P(t,{label:a,key:l},{default:w(()=>[x(k(o.$t(`editorPage.subConfig.nodeActions['${e.type}'].types[${l}]`)),1)]),_:2},1032,["label"])),64))]),_:1},8,["modelValue"])]),h("div",ze,[a[12]||(a[12]=h("p",{class:"des-label"},"过滤结果",-1)),P(r,{direction:"horizontal",modelValue:T.value,"onUpdate:modelValue":a[5]||(a[5]=e=>T.value=e)},{default:w(()=>[(y(),b(O,null,R(i,(a,l)=>P(t,{label:a,key:l},{default:w(()=>[x(k(o.$t(`editorPage.subConfig.nodeActions['${e.type}'].filters[${l}]`)),1)]),_:2},1032,["label"])),64))]),_:1},8,["modelValue"])]),h("div",qe,[a[13]||(a[13]=h("p",{class:"des-label"},"缓存",-1)),P(r,{direction:"horizontal",modelValue:_.value,"onUpdate:modelValue":a[6]||(a[6]=e=>_.value=e)},{default:w(()=>[(y(),b(O,null,R(c,(a,l)=>P(t,{label:a,key:l},{default:w(()=>[x(k(o.$t(`editorPage.subConfig.nodeActions['${e.type}'].cache[${l}]`)),1)]),_:2},1032,["label"])),64))]),_:1},8,["modelValue"])])],64)):A("",!0),"Flag Operator"===e.type&&g.value&&"add"===u.value?(y(),b("div",Le,[h("p",{class:"des-label flag-operator",onClick:I},[a[14]||(a[14]=h("span",null,"识别为",-1)),h("img",{src:S(_e),alt:""},null,8,Je),a[15]||(a[15]=h("span",null,"时",-1)),P(v,{name:"tips",size:"12px"})]),P(r,{direction:"horizontal",modelValue:$.value,"onUpdate:modelValue":a[7]||(a[7]=e=>$.value=e)},{default:w(()=>[(y(),b(O,null,R(n,(a,l)=>P(t,{label:a,key:l},{default:w(()=>[x(k(o.$t(`editorPage.subConfig.nodeActions['${e.type}'].twOptions[${l}]`)),1)]),_:2},1032,["label"])),64))]),_:1},8,["modelValue"])])):A("",!0)])}}}
1),[["__scopeId","data-v-eb442fe3"]]),Ke={class:"editor-action-card"},Ye={class:"des-label"},Xe={class:"des-label"},Ge={key:0,class:"item"},We=["src"],Qe={key:1},Ze=K(c({__name:"FilterSelect",props:{type:{},id:{}},setup(e){const o=Y();F(o),X();const a=p("form"),t={"Region Filter":{mode:[0,1],value:["HK","TW","SG","JP","UK","US","DE","KR"]},"Type Filter":{mode:[0,1],value:["ss","ssr","vmess","vless","trojan","http","h2-connect","socks5","snell","tuic","hysteria","hysteria2","juicity","mieru","sudoku","masque","naive","anytls","trusttunnel","openvpn","gost-relay","tailscale","wireguard","ssh","external","direct"]}},l=d([]),n=d();return D(()=>{var o,t,s;const i=a.process.find(o=>o.id===e.id);if(i){let e=(null==(o=i.args)?void 0:o.value)||i.args;Array.isArray(e)||(e=[]);const a=null==(s=null==(t=i.args)?void 0:t.keep)||s;i.args={keep:a,value:e},l.value=i.args.value,n.value=i.args.keep?0:1}}),v(n,()=>{a.process.find(o=>o.id===e.id).args.keep=!n.value}),(o,a)=>{const s=f("nut-radio"),i=f("nut-radiogroup"),r=f("nut-checkbox"),c=f("nut-checkboxgroup");return y(),b("div",Ke,[h("p",Ye,k(o.$t(`editorPage.subConfig.nodeActions['${e.type}'].des[1]`)),1),P(i,{direction:"horizontal",modelValue:n.value,"onUpdate:modelValue":a[0]||(a[0]=e=>n.value=e)},{default:w(()=>[(y(!0),b(O,null,R(t[e.type].mode,(a,t)=>(y(),C(s,{label:a,key:t},{default:w(()=>[x(k(o.$t(`editorPage.subConfig.nodeActions['${e.type}'].modeOptions[${t}]`)),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"]),h("p",Xe,k(o.$t(`editorPage.subConfig.nodeActions['${e.type}'].des[0]`)),1),P(c,{class:"checkbox-group",modelValue:l.value,"onUpdate:modelValue":a[1]||(a[1]=e=>l.value=e)},{default:w(()=>[(y(!0),b(O,null,R(t[e.type].value,(a,t)=>(y(),C(r,{"icon-size":16,key:a,label:a},{default:w(()=>["Region Filter"===e.type&&"TW"===a?(y(),b("span",Ge,[h("img",{src:S(_e),alt:""},null,8,We),x(" "+k(a),1)])):(y(),b("span",Qe,k(o.$t(`editorPage.subConfig.nodeActions['${e.type}'].options[${t}]`)),1))]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"])])}}}),[["__scopeId","data-v-fcf701e8"]]),eo={class:"editor-action-card"},oo={class:"des-label"},ao={class:"des-label"},to={class:"des-label"},lo={class:"tag-wrapper"},no={class:"input-wrapper"},so=K(c({__name:"Regex",props:{type:{},id:{}},setup(e){const{t:o}=te();j();const a=p("form"),t={"Regex Filter":[0,1],"Regex Sort Operator":["asc","desc","original"]},l=d(""),n=d(""),s=d(),i=d(),c=m({get:()=>Array.isArray(i.value)?i.value.map((e,o)=>({id:o+JSON.stringify(e),value:e})):[],set(e){e.map((e,o)=>{i.value[o]=e.value})}}),u=e=>{const a=[...e.currentTarget.parentElement.children].indexOf(e.currentTarget);l.value||n.value?ae({title:o("editorPage.subConfig.pop.clickTag.title"),content:o("editorPage.subConfig.pop.clickTag.content"),popClass:"auto-dialog",okText:o("editorPage.subConfig.pop.clickTag.confirm"),cancelText:o("editorPage.subConfig.pop.clickTag.cancel"),onOk:()=>g(a),closeOnClickOverlay:!0}):g(a)},g=o=>{const a=i.value[o];i.value.splice(o,1),"Regex Rename Operator"===e.type?(l.value=a.expr,n.value=a.now):l.value=a},$=()=>{l.value&&("Regex Rename Operator"===e.type?i.value.push({expr:l.value,now:n.value}):i.value.push(l.value),l.value="",n.value="")};D(()=>{var o,t;const l=a.process.find(o=>o.id===e.id);if(l)switch(e.type){case"Regex Filter":i.value=l.args.regex,s.value=l.args.keep?0:1;break;case"Regex Sort Operator":const e=(null==(o=l.args)?void 0:o.order)||"asc";let a=null==(t=l.args)?void 0:t.expressions;Array.isArray(l.args)&&(a=l.args),Array.isArray(a)||(a=[]),l.args={order:e,expressions:a},i.value=l.args.expressions,s.value=l.args.order;break;default:i.value=l.args}}),v(s,()=>{const o=a.process.find(o=>o.id===e.id);o&&"Regex Filter"===e.type&&(o.args.keep=!s.value),o&&"Regex Sort Operator"===e.type&&(o.args.order=s.value)});return B((e,a,t)=>r(this,null,function*(){if(l.value||n.value){const e=yield new Promise(e=>{ae({title:o("editorPage.subConfig.pop.leaveConfirmTitle"),content:o("editorPage.subConfig.pop.leaveContent"),popClass:"auto-dialog",okText:o("editorPage.subConfig.pop.leaveConfirm"),cancelText:o("editorPage.subConfig.pop.leaveCancel"),onOk:()=>{e(!0)},onCancel:()=>e(!1),closeOnClickOverlay:!0})});t(e)}t()}
1)),(o,a)=>{const r=f("nut-radio"),d=f("nut-radiogroup"),p=f("nut-tag"),m=f("nut-input"),g=f("font-awesome-icon");return y(),b("div",eo,["Regex Filter"===e.type?(y(),b(O,{key:0},[h("p",oo,k(o.$t(`editorPage.subConfig.nodeActions['${e.type}'].des[1]`)),1),P(d,{direction:"horizontal",modelValue:s.value,"onUpdate:modelValue":a[0]||(a[0]=e=>s.value=e)},{default:w(()=>[(y(!0),b(O,null,R(t[e.type],(a,t)=>(y(),C(r,{label:a,key:t},{default:w(()=>[x(k(o.$t(`editorPage.subConfig.nodeActions['${e.type}'].options[${t}]`)),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"])],64)):A("",!0),"Regex Sort Operator"===e.type?(y(),b(O,{key:1},[h("p",ao,k(o.$t(`editorPage.subConfig.nodeActions['${e.type}'].des[1]`)),1),P(d,{direction:"horizontal",modelValue:s.value,"onUpdate:modelValue":a[1]||(a[1]=e=>s.value=e)},{default:w(()=>[(y(!0),b(O,null,R(t[e.type],(a,t)=>(y(),C(r,{label:a,key:t},{default:w(()=>[x(k(o.$t(`editorPage.subConfig.nodeActions['${e.type}'].options[${t}]`)),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"])],64)):A("",!0),h("p",to,k(o.$t(`editorPage.subConfig.nodeActions['${e.type}'].des[0]`)),1),h("div",lo,[P(S(J),E({"item-key":"id",modelValue:c.value,"onUpdate:modelValue":a[2]||(a[2]=e=>c.value=e),"force-fallback":!0,scroll:!0},{chosenClass:"chosentag"}),{item:w(({element:o,index:a})=>[P(p,{onClick:u,class:"tag-item",closeable:"",onClose:e=>(e=>{i.value.splice(e,1)})(a)},{default:w(()=>[h("span",null,k("Regex Rename Operator"===e.type?`${o.value.expr}  ⇒  ${o.value.now}`:o.value),1)]),_:2},1032,["onClose"])]),_:1},16,["modelValue"])]),h("div",no,[P(m,{class:"custom-input",label:"",placeholder:o.$t(`editorPage.subConfig.nodeActions['${e.type}'].placeholder[0]`),modelValue:l.value,"onUpdate:modelValue":a[3]||(a[3]=e=>l.value=e)},null,8,["placeholder","modelValue"]),"Regex Rename Operator"===e.type?(y(),C(m,{key:0,label:"",placeholder:o.$t(`editorPage.subConfig.nodeActions['${e.type}'].placeholder[1]`),modelValue:n.value,"onUpdate:modelValue":a[4]||(a[4]=e=>n.value=e)},null,8,["placeholder","modelValue"])):A("",!0),P(g,{onClick:$,icon:"fa-solid fa-location-arrow"})])])}}}),[["__scopeId","data-v-5a11b40d"]]),io={class:"editor-action-card"},ro={class:"des-label"},co={class:"tag-wrapper"},uo={class:"input-wrapper"},po={class:"des-label"},mo={class:"des-label"},go={class:"des-label"},vo={class:"input-wrapper"},fo={class:"des-label"},yo={class:"input-wrapper"},bo=K(c({__name:"HandleDuplicate",props:{type:{},id:{}},setup(e){const{t:o}=te(),a=d(""),t=p("form"),l=["rename","delete"],n=["front","back"],s=g({action:"",position:"",template:"",link:"",field:[]}),i=m({get:()=>Array.isArray(s.field)?s.field.map((e,o)=>({id:o+JSON.stringify(e),value:e})):[],set(e){e.map((e,o)=>{s.field[o]=e.value})}}),r=e=>{const t=[...e.currentTarget.parentElement.children].indexOf(e.currentTarget);a.value?ae({title:o("editorPage.subConfig.pop.clickTag.title"),content:o("editorPage.subConfig.pop.clickTag.content"),popClass:"auto-dialog",okText:o("editorPage.subConfig.pop.clickTag.confirm"),cancelText:o("editorPage.subConfig.pop.clickTag.cancel"),onOk:()=>c(t),closeOnClickOverlay:!0}):c(t)},c=e=>{const o=s.field[e];s.field.splice(e,1),a.value=o},u=()=>{a.value&&(s.field.push(a.value),a.value="")};return D(()=>{const o=t.process.find(o=>o.id===e.id);o&&(s.action=o.args.action,s.position=o.args.position,s.template=o.args.template,s.link=o.args.link,s.field=o.args.field||["name"])}),v(s,()=>{const o=t.process.find(o=>o.id===e.id);o&&(o.args=M(s))}),(o,t)=>{const c=f("nut-tag"),d=f("nut-input"),p=f("font-awesome-icon"),m=f("nut-radio"),g=f("nut-radiogroup");return y(),b("div",io,[h("p",ro,k(o.$t(`editorPage.subConfig.nodeActions['${e.type}'].field.des`)),1),h("div",co,[P(S(J),E({"item-key":"id",modelValue:i.value,"onUpdate:modelValue":t[0]||(t[0]=e=>i.value=e),"force-fallback":!0,scroll:!0},{chosenClass:"chosentag"}),{item:w(({element:e,index:o})=>[P(c,{onClick:r,class:"tag-item",closeable:"",onClose:e=>(e=>{s.field.splice(e,1)})(o)},{default:w(()=>[h("span",null,k(e.value),1)]),_:2},1032,["onClose"])]),_:1}
1,16,["modelValue"])]),h("div",uo,[P(d,{class:"custom-input",label:"",placeholder:o.$t(`editorPage.subConfig.nodeActions['${e.type}'].field.placeholder`),modelValue:a.value,"onUpdate:modelValue":t[1]||(t[1]=e=>a.value=e)},null,8,["placeholder","modelValue"]),P(p,{onClick:u,icon:"fa-solid fa-location-arrow"})]),h("p",po,k(o.$t(`editorPage.subConfig.nodeActions['${e.type}'].action.des`)),1),P(g,{direction:"horizontal",modelValue:s.action,"onUpdate:modelValue":t[2]||(t[2]=e=>s.action=e)},{default:w(()=>[(y(),b(O,null,R(l,(a,t)=>P(m,{label:a,key:t},{default:w(()=>[x(k(o.$t(`editorPage.subConfig.nodeActions['${e.type}'].action.options[${t}]`)),1)]),_:2},1032,["label"])),64))]),_:1},8,["modelValue"]),"rename"===s.action?(y(),b(O,{key:0},[h("p",mo,k(o.$t(`editorPage.subConfig.nodeActions['${e.type}'].position.des`)),1),P(g,{direction:"horizontal",modelValue:s.position,"onUpdate:modelValue":t[3]||(t[3]=e=>s.position=e)},{default:w(()=>[(y(),b(O,null,R(n,(a,t)=>P(m,{label:a,key:t},{default:w(()=>[x(k(o.$t(`editorPage.subConfig.nodeActions['${e.type}'].position.options[${t}]`)),1)]),_:2},1032,["label"])),64))]),_:1},8,["modelValue"]),h("p",go,k(o.$t(`editorPage.subConfig.nodeActions['${e.type}'].template.des`)),1),h("div",vo,[P(d,{label:"",placeholder:o.$t(`editorPage.subConfig.nodeActions['${e.type}'].template.placeholder`),modelValue:s.template,"onUpdate:modelValue":t[4]||(t[4]=e=>s.template=e)},null,8,["placeholder","modelValue"])]),h("p",fo,k(o.$t(`editorPage.subConfig.nodeActions['${e.type}'].link.des`)),1),h("div",yo,[P(d,{label:"",placeholder:o.$t(`editorPage.subConfig.nodeActions['${e.type}'].link.placeholder`),modelValue:s.link,"onUpdate:modelValue":t[5]||(t[5]=e=>s.link=e)},null,8,["placeholder","modelValue"])])],64)):A("",!0)])}}}),[["__scopeId","data-v-2cfc6596"]]),ho={key:0,class:"key-value-container"},ko={class:"key-value-box"},Co={class:"header"},$o={class:"item"},Po={class:"content"},xo={class:"item"},Ao={class:"input-container"},wo={key:0,class:"duplicate-key-tip"},Vo={class:"item"},Oo={class:"item key-value-operation"},To=["onClick"],_o={key:0,class:"empty-tips"},Uo=K(c({__name:"ParamsEditor",props:{paramsArguments:{type:Array,default:()=>[]},visible:{type:Boolean,default:!1},type:{type:String,required:!0}},emits:["update:paramsArguments","add-parameter"],setup(e,{emit:o}){const a=e,t=o,{t:l}=te(),n=m({get:()=>a.paramsArguments,set:e=>t("update:paramsArguments",e)}),s=d({}),i=e=>{const o={};e.forEach(e=>{e.key&&""!==e.key.trim()&&(o[e.key]=(o[e.key]||0)+1)}),s.value=o},r=e=>e&&s.value[e]>1;v(()=>a.paramsArguments,e=>{i(e)},{deep:!0,immediate:!0});const c=m(()=>l(`editorPage.subConfig.nodeActions['${a.type}'].paramsOptions`)),u=m(()=>l(`editorPage.subConfig.nodeActions['${a.type}'].paramsDelete`)),p=m(()=>l(`editorPage.subConfig.nodeActions['${a.type}'].paramsEmpty`));return(o,l)=>{const s=f("nut-textarea");return y(),b("div",null,[e.visible?(y(),b("div",ho,[h("div",ko,[h("div",Co,[l[0]||(l[0]=h("div",{class:"item"},"key",-1)),l[1]||(l[1]=h("div",{class:"item"},"value",-1)),h("div",$o,k(c.value),1)]),h("div",Po,[(y(!0),b(O,null,R(n.value,(e,l)=>(y(),b("div",{key:l,class:T(["key-value-row",{"duplicate-key-row":r(e.key)}])},[h("div",xo,[h("div",Ao,[P(s,{modelValue:e.key,"onUpdate:modelValue":o=>e.key=o,border:!1,placeholder:"key",type:"text",rows:1,autosize:"",class:T({"duplicate-key-input":r(e.key)}),onBlur:o=>(e=>{((e,o)=>{e[o]&&"string"==typeof e[o]&&(e[o]=e[o].replace(/\s+/g,""))})(e,"key"),i(a.paramsArguments)})(e)},null,8,["modelValue","onUpdate:modelValue","class","onBlur"]),r(e.key)&&e.key?(y(),b("div",wo,k(o.$t(`editorPage.subConfig.nodeActions['${a.type}'].duplicateKeyWarning`)),1)):A("",!0)])]),h("div",Vo,[P(s,{modelValue:e.value,"onUpdate:modelValue":o=>e.value=o,border:!1,placeholder:"value",type:"text",rows:1,autosize:""},null,8,["modelValue","onUpdate:modelValue"])]),h("div",Oo,[h("div",{onClick:e=>(e=>{const o=[...a.paramsArguments];o.splice(e,1),t("update:paramsArguments",o),i(o)})(l)},k(u.value),9,To)])],2))),128)),n.value.length?A("",!0):(y(),b("div",_o,[h("p",null,k(p.value),1)]))])])])):A("",!0)])}}}),[["__scopeId","data-v-f3178537"]]),No={class:"editor-action-card"},Eo={class:"type-row"},So=["aria-expanded","aria-label"],Ro={class:"doc-link",href:"https://github.com/sub-store-org/Sub-Store/wiki/%E8%84%9A%E6%9C%AC%E4%BD%BF%E7%94%A8%E8%AF%B4%E6%98%8E",target:"_blank"},Io={key:0,class:"input-wrapper"},Fo={key:1,class:"local-content-section"},Do={class:"input-wrapper-title"},jo={class:"title-label"},Bo={key:0,class:"title-label"},Mo={key:1,class:"title-label"},zo={key:2,class:"button"},qo="script-local-content-fold",Lo=K(c({__name:"Script",props:{type:{},id:{},sourceType:{}}
1,setup(e){const o=G(),{t:a}=te(),t=z(),l=p("form"),n=["link","script"],s=(o=t.path)=>[o,e.sourceType||"default",e.type,e.id].join(":"),i=d(le(qo,s(),!1)),r=()=>{i.value=!i.value,ne(qo,s(),i.value)},c=d(!1),u=d(!0),m=g({url:"",arguments:{},noCache:!1,insecure:!1}),C=d([]),V=d(),T=()=>l.process.find(o=>o.id===e.id),N=e=>{V.value=e;const o=T();(null==o?void 0:o.args)&&(e?o.args.editorLanguage=e:delete o.args.editorLanguage)},E=e=>{let o={},a={},t=!1,l=!1,n=(null==e?void 0:e.trim())||"";if(!n)return{url:"",arguments:{},noCache:!1,insecure:!1};const s=n.split("#");try{if(s.length>1)try{o=JSON.parse(decodeURIComponent(s[1]))}catch(i){for(const e of s[1].split("&")){const a=e.split("=")[0],t=e.split("=")[1];o[a]=null==t||""===t||decodeURIComponent(t)}}}catch(i){o={}}try{if(s.length>2){for(const e of s[2].split("&")){const o=e.split("=")[0],t=e.split("=")[1];a[o]=null==t||""===t||decodeURIComponent(t)}t=null==a?void 0:a.noCache,l=null==a?void 0:a.insecure}else null==(null==o?void 0:o.noCache)&&null==(null==o?void 0:o.insecure)||(t=null==o?void 0:o.noCache,l=null==o?void 0:o.insecure,null==o||delete o.noCache,null==o||delete o.insecure)}catch(i){}return{url:n.split("#")[0],arguments:o,noCache:t,insecure:l}},S=(e,o,a,t)=>{if(!e)return a&&t?"##noCache&insecure":a?"##noCache":t?"##insecure":"";const l=o&&"object"==typeof o&&Object.keys(o).length>0;if(!l&&!a&&!t)return e;let n=[];l&&(n=Object.entries(o).filter(([e])=>e&&"string"==typeof e).sort(([e],[o])=>e.localeCompare(o)).map(([e,o])=>{if(!0===o)return e;const a=null==o?"":o.toString();return`${e}=${encodeURIComponent(a)}`}));let s=e;return n.length>0&&(s+=`#${n.join("&")}`),a&&t?s+="#noCache&insecure":a?s+="#noCache":t&&(s+="#insecure"),s},I=d(!1);
1W(I);const F=g({mode:"",content:"",code:""}),j=()=>{const e=[...C.value,{key:"",value:""}];C.value=e},B=()=>{c.value=!c.value},M=()=>{m.noCache=!m.noCache},q=()=>{m.insecure=!m.insecure},L=()=>{ae({title:a(`editorPage.subConfig.nodeActions['${e.type}'].helpTitle`),content:a(`editorPage.subConfig.nodeActions['${e.type}'].noCacheTips`),popClass:"auto-dialog",okText:"OK",noCancelBtn:!0,closeOnClickOverlay:!0})},J=()=>{ae({title:a(`editorPage.subConfig.nodeActions['${e.type}'].helpTitle`),content:a(`editorPage.subConfig.nodeActions['${e.type}'].insecureTips`),popClass:"auto-dialog",okText:"OK",noCancelBtn:!0,closeOnClickOverlay:!0})},H=()=>{ae({title:a(`editorPage.subConfig.nodeActions['${e.type}'].helpTitle`),content:a(`editorPage.subConfig.nodeActions['${e.type}'].paramsEditTips`),popClass:"auto-dialog",okText:"OK",noCancelBtn:!0,closeOnClickOverlay:!0})},K=()=>{if("link"===F.mode)try{const e=E(F.content);m.url=e.url,m.noCache=e.noCache,m.insecure=e.insecure,m.arguments=e.arguments||{},C.value=Object.entries(m.arguments).map(([e,o])=>({key:e,value:!0===o?"":o})),u.value=!0}catch(e){}};let Y;const X="file"===e.sourceType&&"mihomoProfile"===(null==l?void 0:l.type);return Y="Response Transformer"===e.type?"// Modify Response\n// 1. shortcut script\n$res.status = 200\n$res.header['X-Custom'] = 'new'\n$res.header['X-Powered-By'] = undefined // removeHeader\n$res.body = $res.body\n\n// 2. transform function\nasync function transformFunction(res, context) {\n  // res.status: HTTP status code\n  // res.header / res.headers: response headers\n  // res.body: response body\n  // context is shared by response transformers in this run.\n  // Use context.process to control later response transformers by customName.\n  // This control does not cross with Script Operator/File Script context.process.\n  // context.process = { type: 'disable', customNames: ['branch-b'] }\n  // type: 'disable' skips listed customName; type: 'enable' only runs listed customName.\n  return res\n}":"file"===e.sourceType?(X?"// Mihomo Profile Override\n// $content already contains the base mihomo config generated from the selected source.\n// YAML and JavaScript override formats are supported.\n// YAML override docs: https://clashparty.org/docs/guide/override/yaml\n// JavaScript override docs: https://clashparty.org/docs/guide/override/javascript\n\n":"")+"// Example:\n// $files: ['0', '1']\n// $content: '0\\n1'\n\n// produce proxies\n// backend version(>2.14.156):\nlet singboxProxies = await produceArtifact({\n    type: 'subscription', // type: 'subscription' 或 'collection'\n    name: 'sub', // subscription name\n    platform: 'sing-box', // target platform\n    produceType: 'internal' // 'internal' produces an Array, otherwise produces a String( JSON.parse('JSON String') )\n})\n\nlet clashMetaProxies = await produceArtifact({\n    type: 'subscription',\n    name: 'sub',\n    platform: 'ClashMeta',\n    produceType: 'internal' // 'internal' produces an Array, otherwise produces a String( ProxyUtils.yaml.safeLoad('YAML String').proxies )\n})\n\n// Base64 encode\n// $content = ProxyUtils.Base64.encode($content ?? $files[0])\n\n// YAML parse/stringify\n// ProxyUtils.yaml.load('YAML String')\n// ProxyUtils.yaml.safeLoad('YAML String')\n// $content = ProxyUtils.yaml.safeDump({})\n// $content = ProxyUtils.yaml.dump({})\n\n// Example: insert proxies into YAML\n// const yaml = ProxyUtils.yaml.safeLoad($content ?? $files[0])\n// let clashMetaProxies = await produceArtifact({\n//     type: 'collection',\n//     name: '机场',\n//     platform: 'ClashMeta',\n//     produceType: 'internal'\n// })\n// yaml.proxies.unshift(...clashMetaProxies)\n// $content = ProxyUtils.yaml.dump(yaml)\n\n// https://clashparty.org/docs/guide/urlscheme#profile-update-interval\n// if ($options){\n//   $options._res = {\n//     headers: {\n//       'profile-update-interval': 24\n//     }\n//   }\n// } \n\n\n// JSON\n$content = JSON.stringify({}, null, 2)\n\n// { $content, $files, $options } will be passed to the next operator\n// $content is the final content of the file\n// context is shared by later operators in this run.\n// Use context.process to control later actions by customName.\n// This control does not cross with Response Transformer context.process.\n// context.process = { type: 'disable', customNames: ['branch-b'] }\n// type: 'disable' skips listed customName; type: 'enable' only runs listed customName.\n":"Script Operator"===e.type?"// Example:\n// Script Operator\n// 1. shortcut script\n$server.name = 'prefix-' + $server.name\n$server.ecn = true\n$server['test-url'] = 'http://1.0.0.1/generate_204'\n// 2. operator function\nasync function operator(proxies, targetPlatform, context) {\n  // context is shared by later operators in this run.\n  // Use context.process to control later actions by customName.\n  // This control does not cross with Response Transformer context.process.\n  // context.process = { type: 'disable', customNames: ['branch-b'] }\n  // type: 'disable' skips listed customName; type: 'enable' only runs listed customName.\n  // if ($options) {\n  //   const { headers, url, path } = $options?._req || {}\n  //   const ua = headers?.['user-agent'] || headers?.['User-Agent']\n  //   console.log(ua)\n  //   $options._res = {\n  //     headers: {\n  //       'X-Custom': 'new',\n  //       'X-Powered-By': undefined, // removeHeader\n  //     }\n  //   }\n  // }\n  return proxies.map(proxy => {\n    // Change proxy information here\n\n    return proxy;\n  });\n}":"// Script Filter\n// 1. shortcut script\nconst port = Number($server.port)\nreturn [80].includes(port)\n\n// 2. filter function\nasync function filter(proxies, targetPlatform) {\n  return proxies.map( proxy => {\n    // Return true if the current proxy is selected\n\n    return true;\n  });\n}",D(()=>{const a=T();if(a)if(a.args=a.args||{},V.value=a.args.editorLanguage,F.mode=a.args.mode,"script"===a.args.mode)F.code=a.args.content,o.setEditCode(e.id,a.args.content?a.args.content:Y),(t=a.args.arguments)&&"object"==typeof t&&Object.keys(t).length>0&&(m.arguments=a.args.arguments,C.value=Object.entries(m.arguments).map(([e,o])=>({key:e,value:o})),c.value=!0);else{F.content=a.args.content;const e=E(F.content);m.url=e.url,m.arguments=e.arguments,m.noCache=e.noCache,m.insecure=e.insecure,C.value=Object.entries(m.arguments).map(([e,o])=>({key:e,value:o}))}var t}),v(C,o=>{m.arguments=o.reduce((e,o)=>(o.key&&(e[o.key]=o.value),e),{}),"link"===F.mode&&(F.content=S(m.url,m.arguments,m.noCache,m.insecure));l.process.find(o=>o.id===e.id).args.arguments=m.arguments},{deep:!0}),v(F,()=>{const a=T();if(a.args.mode=F.mode,"script"===a.args.mode)a.args.content=F.code,!o.CodeClear[e.id]&&o.setEditCode(e.id,a.args.content?a.args.content:Y),Y=" ",a.args.arguments=m.arguments;else{delete a.args.editorLanguage,V.value=void 0,a.args.content=F.content;const e=E(F.content);m.url=e.url,m.arguments=e.arguments,m.noCache=e.noCache,m.insecure=e.insecure,u.value||(C.value=Object.entries(m.arguments).map(([e,o])=>({key:e,value:o})),u.value=!0)}}),v(()=>m.noCache,e=>{"link"===F.mode&&(F.content=S(m.url,m.arguments,e,m.insecure))}),v(()=>m.insecure,e=>{"link"===F.mode&&(F.content=S(m.url,m.arguments,m.noCache,e))}),v(()=>m.url,e=>{"link"===F.mode&&(F.content=S(e,m.arguments,m.noCache,m.insecure))}),v(()=>t.path,e=>{i.value=le(qo,s(e),!1)}),v(()=>o.EditCode[e.id],e=>{F.code=e}),(o,a)=>{const t=f("nut-icon"),l=f("nut-radio"),s=f("nut-radiogroup"),u=f("nut-textarea"),d=f("nut-checkbox"),p=f("font-awesome-icon");return y(),b("div",No,[h("div",Eo,[h("button",{type:"button",class:"content-fold-toggle","aria-expanded":!i.value,"aria-label":i.value?o.$t("moreSettingPage.editorDisplayMode.expanded"):o.$t("moreSettingPage.editorDisplayMode.collapsed"),onClick:r},[P(t,{name:i.value?"rect-right":"rect-down",size:"12px"},null,8,["name"]),h("span",null,k(o.$t(`editorPage.subConfig.nodeActions['${e.type}'].des[0]`)),1)],8,So),h("a",Ro,k(o.$t("subPage.panel.tips.ok")),1)]),_(h("div",null,[P(s,{modelValue:F.mode,"onUpdate:modelValue":a[0]||(a[0]=e=>F.mode=e),direction:"horizontal"},{default:w(()=>[(y(),b(O,null,R(n,(a,t)=>P(l,{key:t,label:a},{default:w(()=>[x(k(o.$t(`editorPage.subConfig.nodeActions['${e.type}'].options[${t}]`)),1)]),_:2},1032,["label"])),64))]),_:1},8,["modelValue"]),"link"===F.mode?(y(),b("div",Io,[P(u,{modelValue:F.c
1ontent,"onUpdate:modelValue":a[1]||(a[1]=e=>F.content=e),placeholder:o.$t(`editorPage.subConfig.nodeActions['${e.type}'].placeholder`),rows:5,autosize:"",onBlur:K},null,8,["modelValue","placeholder"])])):A("",!0),"script"===F.mode?(y(),b("div",Fo,[P(Q,{id:e.id,"is-read-only":!1,"editor-language":V.value,"onUpdate:editorLanguage":N},null,8,["id","editor-language"])])):A("",!0)],512),[[U,!i.value]]),h("div",Do,[h("div",jo,[P(d,{modelValue:c.value,"onUpdate:modelValue":a[2]||(a[2]=e=>c.value=e),class:"my-switch"},null,8,["modelValue"]),h("button",{class:"switch-label",type:"button",onClick:B},k(o.$t(`editorPage.subConfig.nodeActions['${e.type}'].paramsEdit`)),1),P(p,{class:"icon",icon:"fa-solid fa-circle-question",onClick:$(H,["stop"])})]),"link"===F.mode?(y(),b("div",Bo,[P(d,{modelValue:m.noCache,"onUpdate:modelValue":a[3]||(a[3]=e=>m.noCache=e),class:"my-switch"},null,8,["modelValue"]),h("button",{class:"switch-label",type:"button",onClick:M},k(o.$t(`editorPage.subConfig.nodeActions['${e.type}'].noCache`)),1),P(p,{class:"icon",icon:"fa-solid fa-circle-question",onClick:$(L,["stop"])})])):A("",!0),"link"===F.mode?(y(),b("div",Mo,[P(d,{modelValue:m.insecure,"onUpdate:modelValue":a[4]||(a[4]=e=>m.insecure=e),class:"my-switch"},null,8,["modelValue"]),h("button",{class:"switch-label",type:"button",onClick:q},k(o.$t(`editorPage.subConfig.nodeActions['${e.type}'].insecure`)),1),P(p,{class:"icon",icon:"fa-solid fa-circle-question",onClick:$(J,["stop"])})])):A("",!0),c.value?(y(),b("div",zo,[h("div",{onClick:j},k(o.$t(`editorPage.subConfig.nodeActions['${e.type}'].paramsAdd`)),1)])):A("",!0)]),P(Uo,{paramsArguments:C.value,"onUpdate:paramsArguments":a[5]||(a[5]=e=>C.value=e),visible:c.value,type:e.type},null,8,["paramsArguments","visible","type"])])}}}),[["__scopeId","data-v-15307d32"]]),Jo={class:"editor-action-card"},Ho={class:"des-label"},Ko={class:"radio-wrapper source-radio"},Yo={class:"source-name-row"},Xo={class:"checkbox-row"},Go={class:"des-label"},Wo={class:"radio-wrapper position-radio"},Qo=K(c({__name:"AddProxiesFromSubscription",props:{type:{},id:{}},setup(e){const o=p("form"),a=Z(),t=["subscription","collection"],l=["replace","front","back"],n=d("subscription"),s=d(""),i=d(!1),r=d("replace"),c=d([]),u=d(!1),g=m(()=>"collection"===n.value?a.collections:a.subs),A=m(()=>(g.value||[]).map(e=>({text:e.displayName?`${e.displayName}`:e.name,value:e.name}))),V=()=>o.process.find(o=>o.id===e.id),T=()=>{const e=V();e&&(e.args={sourceType:n.value,sourceName:s.value,includeUnsupportedProxy:i.value,position:r.value})},_=()=>{c.value=s.value?[s.value]:[],u.value=!0},U=({selectedValue:e})=>{s.value=(null==e?void 0:e[0])||"",u.value=!1},N=()=>{window.open("https://github.com/sub-store-org/Sub-Store/wiki/%E9%93%BE%E6%8E%A5%E5%8F%82%E6%95%B0%E8%AF%B4%E6%98%8E")},E=()=>{i.value=!i.value};return D(()=>{var e,a,l,c;const u=V();if(!u)return;const d=t.includes(null==o?void 0:o.sourceType)&&"none"!==(null==o?void 0:o.sourceType)?o.sourceType:"subscription";n.value=(null==(e=u.args)?void 0:e.sourceType)||d,s.value=(null==(a=u.args)?void 0:a.sourceName)||(n.value===(null==o?void 0:o.sourceType)?null==o?void 0:o.sourceName:"")||"",i.value="boolean"==typeof(null==(l=u.args)?void 0:l.includeUnsupportedProxy)&&u.args.includeUnsupportedProxy,r.value=(null==(c=u.args)?void 0:c.position)||"replace",T()}),v([n,s,i,r],T,{immediate:!0}),(o,a)=>{const d=f("nut-radio"),p=f("nut-radiogroup"),m=f("nut-input"),g=f("nut-checkbox"),v=f("nut-icon");return y(),b("div",Jo,[h("p",Ho,k(o.$t(`editorPage.subConfig.nodeActions['${e.type}'].des.source`)),1),h("div",Ko,[P(p,{modelValue:n.value,"onUpdate:modelValue":a[0]||(a[0]=e=>n.value=e),direction:"horizontal"},{default:w(()=>[(y(),b(O,null,R(t,(a,t)=>P(d,{key:a,label:a},{default:w(()=>[x(k(o.$t(`editorPage.subConfig.nodeActions['${e.type}'].sourceOptions[${t}]`)),1)]),_:2},1032,["label"])),64))]),_:1},8,["modelValue"])]),h("div",Yo,[P(m,{modelValue:s.value,"onUpdate:modelValue":a[1]||(a[1]=e=>s.value=e),modelModifiers:{trim:!0},placeholder:o.$t(`editorPage.subConfig.nodeActions['${e.type}'].sourceNamePlaceholder`),"right-icon":"rect-right",onClickRightIcon:_},null,8,["modelValue","placeholder"])]),h("div",Xo,[P(g,{modelValue:i.value,"onUpdate:modelValue":a[2]||(a[2]=e=>i.value=e),class:"my-switch"},null,8,["modelValue"]),h("button",{class:"checkbox-label",type:"button",onClick:E},k(o.$t(`editorPage.subConfig.nodeActions['${e.type}'].des.includeUnsupportedProxy`)),1),h("button",{class:"checkbox-tip",type:"button",onClick:$(N,["stop"])},[P(v,{class:"checkbox-info",name:"tips"})])]),h("p",Go,k(o.$t(`editorPage.subConfig.nodeActions['${e.type}'].des.position`)),1),h("div",Wo,[P(p,{modelValue:r.value,"onUpdate:modelValue":a[3]||(a[3]=e=>r.value=e),direction:"horizontal"},{default:w(()=>[(y(),b(O,null,R(l,(a,t)=>P(d,{key:a,label:a},{default:w(()=>[x(k(o.$t(`editorPage.subConfig.nodeActions['${e.type}'].positionOptions[${t}]`)),1)]),_:2},1032,["label"])),64))]),_:1},8,["modelValue"])]),(y(),C(ee,{key:`${n.value}-${A.value.length}`,modelValue:c.value,"onUpdate:modelValue":a[4]||(a[4]=e=>c.value=e),visible:u.value,"onUpdate:visible":a[5]||(a[5]=e=>u.value=e),columns:A.value,title:o.$t("editorPage.subConfig.sourceNamePicker.title"),"cancel-text":o.$t("editorPage.subConfig.sourceNamePicker.cancel"),"ok-text":o.$t("editorPage.subConfig.sourceNamePicker.confirm"),onConfirm:U},null,8,["modelValue","visible","columns","title","cancel-text","ok-text"]))])}}}),[["__scopeId","data-v-adacfcee"]]),Zo=(e,o,a,t,l)=>{const n=1e8*Math.random()+"",s=t[0].value,i=t[0].args,r="Response Transformer"!==s,c=t[0].customName||"",u={id:n,customName:c,type:s,tipsDes:l(`editorPage.subConfig.nodeActions['${s}'].tipsDes`),component:null,enabled:!0};switch(a.push([n,r]),s){case"Flag Operator":case"Sort Operator":case"Resolve Domain Operator":u.component=q(He),e.process.push({id:n,type:s,args:null!=i?i:null,customName:c}
1);break;case"Region Filter":case"Type Filter":u.component=q(Ze),e.process.push({id:n,type:s,args:null!=i?i:[],customName:c});break;case"Regex Filter":u.component=q(so),e.process.push({id:n,type:s,args:null!=i?i:{keep:!0,regex:[]},customName:c});break;case"Regex Sort Operator":case"Regex Delete Operator":case"Regex Rename Operator":u.component=q(so),e.process.push({id:n,type:s,args:null!=i?i:[],customName:c});break;case"Handle Duplicate Operator":u.component=q(bo),e.process.push({id:n,type:s,args:null!=i?i:{action:"rename",link:"-",position:"back",template:"0 1 2 3 4 5 6 7 8 9",field:["name"]},customName:c});break;case"Script Filter":case"Script Operator":case"Response Transformer":u.component=q(Lo),e.process.push({id:n,type:s,args:null!=i?i:{content:"",mode:"link"},customName:c});break;case"Add Proxies From Subscription Operator":u.component=q(Qo),e.process.push({id:n,type:s,args:null!=i?i:{sourceType:"subscription",sourceName:"",includeUnsupportedProxy:!1,position:"replace"},customName:c})}o.push(u),I(()=>{const e=document.querySelector(".app-layout-wrapper"),o=e.scrollTop+90;e.scrollTo({top:o,left:0,behavior:"smooth"})})},ea=(e,o,a,t)=>{const l=e.process.findIndex(e=>e.id===t),n=o.findIndex(e=>e.id===t),s=a.findIndex(e=>e[0]===t);e.process.splice(l,1),o.splice(n,1),a.splice(s,1)},oa=(e,o)=>{const a=e.findIndex(e=>e.id===o);e[a].enabled=!e[a].enabled},aa=(e,o,a)=>{const t=o=>e.find(e=>e.id===o),l=e.filter(e=>{if(a.includes(e.type))return e});return o.forEach(e=>{l.push({type:e.type,args:t(e.id).args,customName:t(e.id).customName,id:e.id,disabled:!e.enabled})}),l};export{Te as A,Ze as F,bo as H,so as R,Lo as S,aa as a,Qo as b,Zo as c,ea as d,He as e,oa as t};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.