import{E as I}from"./index-BjEW7-SA.js";import{E as q}from"./el-card-CApHJ1Gj.js";import{b as L,a5 as g,R as v,d as E,a as M,o as p,e as d,w as r,h as P,al as V,n as w,r as D,j as _,F as J,l as K,B as U,ak as T,a3 as W,ag as G,q as n,s as m,c as S,ad as O,aa as b,f as h,bt as H,M as R,aL as B,x as Q,v as X,A as C}from"./index-BKKvzUDD.js";import{E as Y}from"./el-empty-B4M99-0a.js";import{E as Z}from"./index-dNo5H1ie.js";import{P as z}from"./PageCard-BoKXOzst.js";import{u as tt}from"./tools-BSjcVinb.js";import{_ as et}from"./_plugin-vue_export-helper-DlAUqK2U.js";import"./index-CWUnzf90.js";import"./validator-Fn0bm4xU.js";import"./index-CQXVR1Ud.js";import"./clamp-CbbY8h6F.js";import"./toNumber-Dkj3QRv9.js";import"./index-DfyOU94W.js";import"./scroll-BkzZKETR.js";import"./raf-C-x62Pcl.js";import"./index-TFUf94PZ.js";import"./index-DLzof2Fz.js";import"./index-GAnQrJsQ.js";const st=L({tag:{type:String,default:"div"},span:{type:Number,default:24},offset:{type:Number,default:0},pull:{type:Number,default:0},push:{type:Number,default:0},xs:{type:v([Number,Object]),default:()=>g({})},sm:{type:v([Number,Object]),default:()=>g({})},md:{type:v([Number,Object]),default:()=>g({})},lg:{type:v([Number,Object]),default:()=>g({})},xl:{type:v([Number,Object]),default:()=>g({})}}),ot=["start","center","end","space-around","space-between","space-evenly"],at=["top","middle","bottom"],lt=L({tag:{type:String,default:"div"},gutter:{type:Number,default:0},justify:{type:String,values:ot,default:"start"},align:{type:String,values:at}}),A=Symbol("rowContextKey");var nt=E({name:"ElRow",__name:"row",props:lt,setup(f){const t=f,u=M("row");J(A,{gutter:_(()=>t.gutter)});const i=_(()=>{const c={};return t.gutter&&(c.marginRight=c.marginLeft=`-${t.gutter/2}px`),c}),y=_(()=>[u.b(),u.is(`justify-${t.justify}`,t.justify!=="start"),u.is(`align-${t.align}`,!!t.align)]);return(c,o)=>(p(),d(D(f.tag),{class:w(y.value),style:V(i.value)},{default:r(()=>[P(c.$slots,"default")]),_:3},8,["class","style"]))}}),rt=nt;const it=K(rt);var ut=E({name:"ElCol",__name:"col",props:st,setup(f){const t=f,{gutter:u}=U(A,{gutter:_(()=>0)}),i=M("col"),y=_(()=>{const o={};return u.value&&(o.paddingLeft=o.paddingRight=`${u.value/2}px`),o}),c=_(()=>{const o=[];return["span","offset","pull","push"].forEach(s=>{const e=t[s];T(e)&&(s==="span"?o.push(i.b(`${t[s]}`)):e>0&&o.push(i.b(`${s}-${t[s]}`)))}),["xs","sm","md","lg","xl"].forEach(s=>{T(t[s])?o.push(i.b(`${s}-${t[s]}`)):W(t[s])&&Object.entries(t[s]).forEach(([e,a])=>{o.push(e!=="span"?i.b(`${s}-${e}-${a}`):i.b(`${s}-${a}`))})}),u.value&&o.push(i.is("guttered")),[i.b(),o]});return(o,s)=>(p(),d(D(f.tag),{class:w(c.value),style:V(y.value)},{default:r(()=>[P(o.$slots,"default")]),_:3},8,["class","style"]))}}),ct=ut;const pt=K(ct),dt={class:"tool-icon"},ft={class:"tool-name"},mt={class:"tool-desc"},_t={class:"tool-actions"},yt={class:"tool-icon"},gt={class:"tool-name"},vt={class:"tool-desc"},bt=E({__name:"ToolsView",setup(f){const t=X(),u=tt(),{tools:i}=G(u);function y(e){e==="data-generate"?C.info("数据生成工具开发中..."):e==="json2jsonl"?t.push("/data-convert"):e==="md-convert"&&C.info("转换Markdown 工具开发中...")}function c(e){e.url.startsWith("http")?window.open(e.url,"_blank"):t.push(e.url)}function o(e){t.push(`/tools/${e.id}/edit`)}async function s(e){await Z.confirm("确定要删除这个自定义工具吗？","确认删除",{type:"warning"}),u.removeTool(e.id),C.success("删除成功")}return(e,a)=>{const $=I,x=q,j=pt,N=it,F=Y;return p(),d(z,{title:"其他工具"},{extra:r(()=>[m($,{type:"primary",onClick:a[0]||(a[0]=l=>h(t).push("/tools/create"))},{default:r(()=>[...a[1]||(a[1]=[n("i",{class:"fa fa-plus",style:{"margin-right":"4px"}},null,-1),Q("添加自定义工具 ",-1)])]),_:1})]),default:r(()=>[a[4]||(a[4]=n("h3",{class:"section-title"},"默认工具",-1)),m(N,{gutter:16,style:{"margin-bottom":"24px"}},{default:r(()=>[(p(!0),S(R,null,O(h(H),l=>(p(),d(j,{key:l.id,span:8},{default:r(()=>[m(x,{shadow:"hover",class:"tool-card",onClick:k=>y(l.id)},{default:r(()=>[n("div",dt,[n("i",{class:w(["fa",l.icon])},null,2)]),n("h4",ft,b(l.name),1),n("p",mt,b(l.description),1)]),_:2},1032,["onClick"])]),_:2},1024))),128))]),_:1}),a[5]||(a[5]=n("h3",{class:"section-title"},"自定义工具",-1)),h(i).length?(p(),d(N,{key:0,gutter:16},{default:r(()=>[(p(!0),S(R,null,O(h(i),l=>(p(),d(j,{key:l.id,span:8},{default:r(()=>[m(x,{shadow:"hover",class:"tool-card",onClick:k=>c(l)},{default:r(()=>[n("div",_t,[m($,{link:"",size:"small",onClick:B(k=>o(l),["stop"])},{default:r(()=>[...a[2]||(a[2]=[n("i",{class:"fa fa-pencil"},null,-1)])]),_:1},8,["onClick"]),m($,{link:"",type:"danger",size:"small",onClick:B(k=>s(l),["stop"])},{default:r(()=>[...a[3]||(a[3]=[n("i",{class:"fa fa-times"},null,-1)])]),_:1},8,["onClick"])]),n("div",yt,[n("i",{class:w(["fa",l.icon])},null,2)]),n("h4",gt,b(l.name),1),n("p",vt,b(l.description),1)]),_:2},1032,["onClick"])]),_:2},1024))),128))]),_:1})):(p(),d(F,{key:1,description:"暂无自定义工具，点击右上角添加"}))]),_:1})}}}),Kt=et(bt,[["__scopeId","data-v-891c28dc"]]);export{Kt as default};
