import{W as Q,av as X,ay as R,aw as G,aA as q,D as J,az as Y,j as Z,aC as ee,O as H,I as A,P as te,c4 as ne,F as L,bK as M,bP as oe,r as z,u as re,bQ as u,bV as w,bM as r,b_ as I,bW as f,bR as k,bS as n,bT as e,k as ae,bm as le,bo as se,bU as S,bX as T,i as ie,bu as ce,bp as ue,c3 as de}from"./_plugin-vue_export-helper.js";import{_ as _e,a as pe}from"./Play.js";import{_ as me}from"./TrashOutline.js";let W=!1;function he(){if(Q&&window.CSS&&!W&&(W=!0,"registerProperty"in(window==null?void 0:window.CSS)))try{CSS.registerProperty({name:"--n-color-start",syntax:"<color>",inherits:!1,initialValue:"#0000"}),CSS.registerProperty({name:"--n-color-end",syntax:"<color>",inherits:!1,initialValue:"#0000"})}catch{}}function fe(s){const{heightSmall:i,heightMedium:a,heightLarge:t,borderRadius:l}=s;return{color:"#eee",colorEnd:"#ddd",borderRadius:l,heightSmall:i,heightMedium:a,heightLarge:t}}const ve={name:"Skeleton",common:X,self:fe},we=R([G("skeleton",`
 height: 1em;
 width: 100%;
 transition:
 --n-color-start .3s var(--n-bezier),
 --n-color-end .3s var(--n-bezier),
 background-color .3s var(--n-bezier);
 animation: 2s skeleton-loading infinite cubic-bezier(0.36, 0, 0.64, 1);
 background-color: var(--n-color-start);
 `),R("@keyframes skeleton-loading",`
 0% {
 background: var(--n-color-start);
 }
 40% {
 background: var(--n-color-end);
 }
 80% {
 background: var(--n-color-start);
 }
 100% {
 background: var(--n-color-start);
 }
 `)]),ke=Object.assign(Object.assign({},q.props),{text:Boolean,round:Boolean,circle:Boolean,height:[String,Number],width:[String,Number],size:String,repeat:{type:Number,default:1},animated:{type:Boolean,default:!0},sharp:{type:Boolean,default:!0}}),ge=J({name:"Skeleton",inheritAttrs:!1,props:ke,setup(s){he();const{mergedClsPrefixRef:i}=Y(s),a=q("Skeleton","-skeleton",we,ve,s,i);return{mergedClsPrefix:i,style:Z(()=>{var t,l;const y=a.value,{common:{cubicBezierEaseInOut:N}}=y,x=y.self,{color:V,colorEnd:j,borderRadius:O}=x;let b;const{circle:o,sharp:m,round:$,width:_,height:d,size:p,text:B,animated:v}=s;p!==void 0&&(b=x[ee("height",p)]);const c=o?(t=_??d)!==null&&t!==void 0?t:b:_,h=(l=o?_??d:d)!==null&&l!==void 0?l:b;return{display:B?"inline-block":"",verticalAlign:B?"-0.125em":"",borderRadius:o?"50%":$?"4096px":m?"":O,width:typeof c=="number"?H(c):c,height:typeof h=="number"?H(h):h,animation:v?"":"none","--n-bezier":N,"--n-color-start":V,"--n-color-end":j}})}},render(){const{repeat:s,style:i,mergedClsPrefix:a,$attrs:t}=this,l=A("div",te({class:`${a}-skeleton`,style:i},t));return s>1?A(L,null,ne(s,null).map(y=>[l,`
`])):l}});var D={};Object.defineProperty(D,"__esModule",{value:!0});const E=M,ye={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},be=(0,E.createElementVNode)("path",{fill:"none",stroke:"currentColor","stroke-linecap":"square","stroke-miterlimit":"10","stroke-width":"44",d:"M416 128L192 384l-96-96"},null,-1),Ce=[be];var xe=D.default=(0,E.defineComponent)({name:"CheckmarkSharp",render:function(i,a){return(0,E.openBlock)(),(0,E.createElementBlock)("svg",ye,Ce)}}),F={};Object.defineProperty(F,"__esModule",{value:!0});const P=M,$e={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},Be=(0,P.createElementVNode)("path",{d:"M400 145.49L366.51 112L256 222.51L145.49 112L112 145.49L222.51 256L112 366.51L145.49 400L256 289.49L366.51 400L400 366.51L289.49 256L400 145.49z",fill:"currentColor"},null,-1),ze=[Be];var Se=F.default=(0,P.defineComponent)({name:"CloseSharp",render:function(i,a){return(0,P.openBlock)(),(0,P.createElementBlock)("svg",$e,ze)}}),K={};Object.defineProperty(K,"__esModule",{value:!0});const g=M,Le={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},Ee=(0,g.createElementVNode)("circle",{cx:"256",cy:"256",r:"48",fill:"currentColor"},null,-1),Pe=(0,g.createElementVNode)("circle",{cx:"416",cy:"256",r:"48",fill:"currentColor"},null,-1),Me=(0,g.createElementVNode)("circle",{cx:"96",cy:"256",r:"48",fill:"currentColor"},null,-1),Ne=[Ee,Pe,Me];var Ve=K.default=(0,g.defineComponent)({name:"EllipsisHorizontal",render:function(i,a){return(0,g.openBlock)(),(0,g.createElementBlock)("svg",Le,Ne)}}),U={};Object.defineProperty(U,"__esModule",{value:!0});const C=M,je={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},Oe=(0,C.createElementVNode)("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"44",d:"M358.62 129.28L86.49 402.08L70 442l39.92-16.49l272.8-272.13l-24.1-24.1z"},null,-1),Re=(0,C.createElementVNode)("path",{d:"M413.07 74.84l-11.79 11.78l24.1 24.1l11.79-11.79a16.51 16.51 0 0 0 0-23.34l-.75-.75a16.51 16.51 0 0 0-23.35 0z",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"44"},null,-1),He=[Oe,Re];var Ae=U.default=(0,C.defineComponent)({name:"Pencil",render:function(i,a){return(0,C.openBlock)(),(0,C.createElementBlock)("svg",je,He)}});const Ie={class:"mower-list"},Te={class:"header"},We={class:"header"},qe={key:0},De={key:3,class:"expand"},Fe={class:"folder"},Ke={class:"folder-content"},Ue={__name:"MowerManager",setup(s){const i=z(!0),a=z([]),t=z(-1),l=z("");re(()=>{window.addEventListener("pywebviewready",async()=>{a.value=await pywebview.api.get_instances(),i.value=!1})});async function y(){a.value.push({name:"新实例",path:""}),await pywebview.api.add("新实例","")}async function N(o){a.value.splice(o,1),await pywebview.api.remove(o)}function x(o){t.value=o,l.value=a.value[o].name}async function V(){const o=t.value;t.value=-1,a.value[o].name=l.value,await pywebview.api.rename(o,l.value)}function j(){t.value=-1}async function O(o){const m=await pywebview.api.select_path(o);m&&(a.value[o].path=m)}async function b(o){await pywebview.api.start(o)}return(o,m)=>{const $=ge,_=ce,d=le,p=se,B=ue;return u(),w("div",Ie,[r(i)?(u(),w(L,{key:0},I(3,v=>e(_,{size:"small",key:v},{header:n(()=>[S("div",Te,[e($,{text:"",width:"40%"})])]),default:n(()=>[e($,{text:""})]),_:2},1024)),64)):f("",!0),(u(!0),w(L,null,I(r(a),(v,c)=>(u(),k(_,{size:"small",key:c},{header:n(()=>[S("div",We,[r(t)!=c?(u(),w("div",qe,T(v.name),1)):f("",!0),r(t)==-1?(u(),k(p,{key:1,size:"tiny",onClick:h=>x(c)},{icon:n(()=>[e(d,null,{default:n(()=>[e(r(Ae))]),_:1})]),_:2},1032,["onClick"])):f("",!0),r(t)==-1?(u(),k(p,{key:2,type:"error",ghost:"",size:"tiny",onClick:h=>N(c)},{icon:n(()=>[e(d,null,{default:n(()=>[e(r(me))]),_:1})]),_:2},1032,["onClick"])):f("",!0),r(t)!=c?(u(),w("div",De)):f("",!0),r(t)==-1?(u(),k(p,{key:4,type:"primary",size:"small",disabled:!v.path,onClick:h=>b(c)},{icon:n(()=>[e(d,null,{default:n(()=>[e(r(pe))]),_:1})]),_:2},1032,["disabled","onClick"])):f("",!0),r(t)==c?(u(),w(L,{key:5},[e(B,{placeholder:"实例名称",value:r(l),"onUpdate:value":m[0]||(m[0]=h=>ie(l)?l.value=h:null)},null,8,["value"]),e(p,{type:"primary",size:"tiny",circle:"",onClick:V},{icon:n(()=>[e(d,null,{default:n(()=>[e(r(xe))]),_:1})]),_:1}),e(p,{type:"error",size:"tiny",circle:"",onClick:j},{icon:n(()=>[e(d,null,{default:n(()=>[e(r(Se))]),_:1})]),_:1})],64)):f("",!0)])]),default:n(()=>[S("div",Fe,[S("code",Ke,T(v.path||"请选择该实例配置文件的保存路径"),1),r(t)==-1?(u(),k(p,{key:0,size:"tiny",onClick:h=>O(c)},{icon:n(()=>[e(d,null,{default:n(()=>[e(r(Ve))]),_:1})]),_:2},1032,["onClick"])):f("",!0)])]),_:2},1024))),128)),r(i)?f("",!0):(u(),k(p,{key:1,size:"large",dashed:"",onClick:y},{icon:n(()=>[e(d,null,{default:n(()=>[e(r(_e))]),_:1})]),default:n(()=>[m[1]||(m[1]=ae(" 添加实例 "))]),_:1}))])}}},Qe=oe(Ue,[["__scopeId","data-v-ac66f2e7"]]),Xe=de(Qe);Xe.mount("#app");
