import{C as _n,a as kn,P as ht,V as xn,N as $n,c as bt}from"./styles-CWIKR29E.js";import{n as Y,D as On,d as nt,r as L,s as Nt,v as Re,al as zn,am as En,a as he,L as Ze,M as Ct,q as wt,an as An,p as St,ao as In,T as Qe,ap as Dn,aq as Pn,ar as Bn,y as p,ab as Nn,as as Cn,at as ve,o as $,b as I,f as o,w as d,a4 as _t,au as M,av as Vt,e as b,aw as Ge,ax as je,c as W,t as N,ay as Vn,a7 as jt,aj as le,g as h,az as Lt,aA as jn,u as Ln,W as Rn,aB as Un,a5 as z,K as Mn,k as kt,h as u,a6 as ie,ak as ye,a3 as Le,B as Hn,aC as qn,S as xt,ai as $t,a8 as Fn}from"./index-U-PhABqT.js";import{c as Wn}from"./copyToClipboard-IgTO06Xi.js";import{t as Jn,e as Kn,Z as Gn,d as Rt,b as Yn,B as O,s as Tn,p as Xn,h as Zn,c as Qn,f as ea,$ as ta,g as na,i as aa,j as ra,k as sa,l as ia,T as oe,M as S,D as q,I as ge,a as Ot,O as zt}from"./index-C1Is5pBl.js";import{P as oa,T as V,a as Ye,G as la,L as Et}from"./index-Bt1l5oAA.js";import{G as ua,S as At}from"./index-DKlJvwwh.js";import{S as da}from"./index-AuG6PAVy.js";import{T as fa,a as It}from"./index-CjMUOgce.js";import{N as ca,a as pa}from"./Flex-Df34YDea.js";import{r as ma,N as va,a as Dt,b as ya,s as Te}from"./remove-DwSpLI4X.js";import{g as F,i as ga,t as ha,a as ba}from"./get-BbDDeVzm.js";import"./vue.runtime.esm-bundler-CQYuvFJ3.js";import"./get-slot-Bk_rJcZu.js";const wa=Y("input-group-label",`
 position: relative;
 user-select: none;
 -webkit-user-select: none;
 box-sizing: border-box;
 padding: 0 12px;
 display: inline-block;
 border-radius: var(--n-border-radius);
 background-color: var(--n-group-label-color);
 color: var(--n-group-label-text-color);
 font-size: var(--n-font-size);
 line-height: var(--n-height);
 height: var(--n-height);
 flex-shrink: 0;
 white-space: nowrap;
 transition: 
 color .3s var(--n-bezier),
 background-color .3s var(--n-bezier),
 box-shadow .3s var(--n-bezier);
`,[On("border",`
 position: absolute;
 left: 0;
 right: 0;
 top: 0;
 bottom: 0;
 border-radius: inherit;
 border: var(--n-group-label-border);
 transition: border-color .3s var(--n-bezier);
 `)]),Sa=Object.assign(Object.assign({},Re.props),{size:String,bordered:{type:Boolean,default:void 0}}),_a=nt({name:"InputGroupLabel",props:Sa,setup(e){const{mergedBorderedRef:n,mergedClsPrefixRef:a,inlineThemeDisabled:r,mergedComponentPropsRef:c}=Nt(e),f=Re("Input","-input-group-label",wa,zn,e,a),{mergedSizeRef:s}=En(e,{mergedSize(g){var k,x;if(e.size!==void 0)return e.size;if(g)return g.mergedSize.value;const w=(x=(k=c?.value)===null||k===void 0?void 0:k.Input)===null||x===void 0?void 0:x.size;return w||"medium"}}),m=he(()=>{const{value:g}=s,{common:{cubicBezierEaseInOut:k},self:{groupLabelColor:x,borderRadius:w,groupLabelTextColor:E,lineHeight:B,groupLabelBorder:X,[Ze("fontSize",g)]:Z,[Ze("height",g)]:R}}=f.value;return{"--n-bezier":k,"--n-group-label-color":x,"--n-group-label-border":X,"--n-border-radius":w,"--n-group-label-text-color":E,"--n-font-size":Z,"--n-line-height":B,"--n-height":R}}),v=r?Ct("input-group-label",he(()=>s.value[0]),m,e):void 0;return{mergedClsPrefix:a,mergedBordered:n,cssVars:r?void 0:m,themeClass:v?.themeClass,onRender:v?.onRender}},render(){var e,n,a;const{mergedClsPrefix:r}=this;return(e=this.onRender)===null||e===void 0||e.call(this),L("div",{class:[`${r}-input-group-label`,this.themeClass],style:this.cssVars},(a=(n=this.$slots).default)===null||a===void 0?void 0:a.call(n),this.mergedBordered?L("div",{class:`${r}-input-group-label__border`}):null)}}),ka=wt([wt("@keyframes spin-rotate",`
 from {
 transform: rotate(0);
 }
 to {
 transform: rotate(360deg);
 }
 `),Y("spin-container",`
 position: relative;
 `,[Y("spin-body",`
 position: absolute;
 top: 50%;
 left: 50%;
 transform: translateX(-50%) translateY(-50%);
 `,[An()])]),Y("spin-body",`
 display: inline-flex;
 align-items: center;
 justify-content: center;
 flex-direction: column;
 `),Y("spin",`
 display: inline-flex;
 height: var(--n-size);
 width: var(--n-size);
 font-size: var(--n-size);
 color: var(--n-color);
 `,[St("rotate",`
 animation: spin-rotate 2s linear infinite;
 `)]),Y("spin-description",`
 display: inline-block;
 font-size: var(--n-font-size);
 color: var(--n-text-color);
 transition: color .3s var(--n-bezier);
 margin-top: 8px;
 `),Y("spin-content",`
 opacity: 1;
 transition: opacity .3s var(--n-bezier);
 pointer-events: all;
 `,[St("spinning",`
 user-select: none;
 -webkit-user-select: none;
 pointer-events: none;
 opacity: var(--n-opacity-spinning);
 `)])]),xa={small:20,medium:18,large:16},$a=Object.assign(Object.assign(Object.assign({},Re.props),{contentClass:String,contentStyle:[Object,String],description:String,size:{type:[String,Number],default:"medium"},show:{type:Boolean,default:!0},rotate:{type:Boolean,default:!0},spinning:{type:Boolean,validator:()=>!0,default:void 0},delay:Number}),Cn),Oa=nt({name:"Spin",props:$a,slots:Object,setup(e){const{mergedClsPrefixRef:n,inlineThemeDisabled:a}=Nt(e),r=Re("Spin","-spin",ka,Dn,e,n),c=he(()=>{const{size:v}=e,{common:{cubicBezierEaseInOut:g},self:k}=r.value,{opacitySpinning:x,color:w,textColor:E}=k,B=typeof v=="number"?Pn(v):k[Ze("size",v)];return{"--n-bezier":g,"--n-opacity-spinning":x,"--n-size":B,"--n-color":w,"--n-text-color":E}}),f=a?Ct("spin",he(()=>{const{size:v}=e;return typeof v=="number"?String(v):v[0]}),c,e):void 0,s=Bn(e,["spinning","show"]),m=p(!1);return Nn(v=>{let g;if(s.value){const{delay:k}=e;if(k){g=window.setTimeout(()=>{m.value=!0},k),v(()=>{clearTimeout(g)});return}}m.value=s.value}),{mergedClsPrefix:n,active:m,mergedStrokeWidth:he(()=>{const{strokeWidth:v}=e;if(v!==void 0)return v;const{size:g}=e;return xa[typeof g=="number"?"medium":g]}),cssVars:a?void 0:c,themeClass:f?.themeClass,onRender:f?.onRender}},render(){var e,n;const{$slots:a,mergedClsPrefix:r,description:c}=this,f=a.icon&&this.rotate,s=(c||a.description)&&L("div",{class:`${r}-spin-description`},c||((e=a.description)===null||e===void 0?void 0:e.call(a))),m=a.icon?L("div",{class:[`${r}-spin-body`,this.themeClass]},L("div",{class:[`${r}-spin`,f&&`${r}-spin--rotate`],style:a.default?"":this.cssVars},a.icon()),s):L("div",{class:[`${r}-spin-body`,this.themeClass]},L(In,{clsPrefix:r,style:a.default?"":this.cssVars,stroke:this.stroke,"stroke-width":this.mergedStrokeWidth,radius:this.radius,scale:this.scale,class:`${r}-spin`}),s);return(n=this.onRender)===null||n===void 0||n.call(this),a.default?L("div",{class:[`${r}-spin-container`,this.themeClass],style:this.cssVars},L("div",{class:[`${r}-spin-content`,this.active&&`${r}-spin-content--spinning`,this.contentClass],style:this.contentStyle},a),L(Qe,{name:"fade-in-transition"},{default:()=>this.active?m:null})):m}}),za=({state:e,designConfig:n,props:a,constants:r})=>()=>{var c;return e.width?e.width+"px":a.width||((c=n?.constants)==null?void 0:c.DEFAULT_WIDTH)||r.DEFAULT_WIDTH},Ea=({state:e,designConfig:n,props:a,constants:r})=>()=>{var c;return e.height?e.height+"px":a.height||((c=n?.constants)==null?void 0:c.DEFAULT_HEIGHT)||r.DEFAULT_HEIGHT},Aa=({api:e})=>(n=!0)=>{e.handleClose("close",typeof n=="boolean"?n:!1)},Ia=({state:e,api:n})=>a=>{a?n.open():n.close()},Da=({state:e,emit:n,vm:a})=>()=>{e.visible||setTimeout(()=>{e.visible=!0,n("open",a),n("update:visible",!0)},0)},Pa=({api:e})=>()=>{e.handleClose("confirm")},Ba=({emit:e,props:n,state:a})=>(r,c)=>{const f=r==="mask"&&!n.maskClosable,s=!c&&typeof n.beforeClose=="function"&&n.beforeClose(r)===!1;f||s||a.visible&&(a.visible=!1,setTimeout(()=>{e("update:visible",!1),e(["close","confirm"].includes(r)?r:"close")},200))},Na=({api:e,state:n,props:a})=>r=>{n.visible&&a.closeOnPressEscape&&(r.key==="Escape"||r.key==="Esc")&&e.handleClose("esc",!0)},Ca=({api:e})=>()=>{document.addEventListener("keydown",e.keydown)},Va=({api:e})=>()=>{document.removeEventListener("keydown",e.keydown)},ja=({state:e,vm:n})=>a=>{a.preventDefault();const r=a.touches?a.touches[0]:a,c=n.$refs.drawerBox;e.dragEvent.isDrag=!0,e.dragEvent.x=r.clientX,e.dragEvent.y=r.clientY,e.dragEvent.offsetWidth=c.offsetWidth,e.dragEvent.offsetHeight=c.offsetHeight},La=({state:e,props:n,emit:a})=>Gn(1,r=>{if(!e.dragEvent.isDrag)return;r.preventDefault();const{placement:c}=n,{dragEvent:{x:f,y:s,offsetWidth:m,offsetHeight:v}}=e,{touches:g,targetTouches:k,changedTouches:x}=r,w=g&&g[0]||k&&k[0]||x&&x[0],{clientX:E,clientY:B}=w||r,X=E-f,Z=B-s;if(c==="left")e.width=m+X;else if(c==="right")e.width=m-X;else if(c==="top"){const R=v+Z;e.height=R>10?R:10}else if(c==="bottom"){const R=v-Z;e.height=R>10?R:10}a("drag",{width:e.width,height:e.height})}),Ra=({state:e})=>n=>{e.dragEvent.isDrag&&(n.preventDefault(),e.dragEvent.isDrag=!1)},Ua=({api:e,vm:n})=>()=>{const a=n.$refs.dragBar;a.addEventListener("mousedown",e.mousedown),document.addEventListener("mousemove",e.mousemove),document.addEventListener("mouseup",e.mouseup),a.addEventListener("touchstart",e.mousedown),a.addEventListener("touchmove",e.mousemove),a.addEventListener("touchend",e.mouseup)},Ma=({api:e,vm:n})=>()=>{const a=n.$refs.dragBar;a.removeEventListener("mousedown",e.mousedown),document.removeEventListener("mousemove",e.mousemove),document.removeEventListener("mouseup",e.mouseup),a.removeEventListener("touchstart",e.mousedown),a.removeEventListener("touchmove",e.mousemove),a.removeEventListener("touchend",e.mouseup)},Ha=e=>()=>{Kn(document.body,e)},qa=e=>()=>{Jn(document.body,e)},Fa=["state","close","confirm","handleClose","open"],Wa=(e,{reactive:n,watch:a,onMounted:r,onBeforeUnmount:c,computed:f},{emit:s,vm:m,mode:v,constants:g,designConfig:k})=>{const x=g.SCROLL_LOCK_CLASS(v),w={},E=n({visible:!1,width:0,height:0,dragEvent:{x:0,y:0,isDrag:!1,offsetWidth:0,offsetHeight:0},computedWidth:f(()=>w.computedWidth()),computedHeight:f(()=>w.computedHeight())});return Object.assign(w,{state:E,open:Da({state:E,emit:s,vm:m}),confirm:Pa({api:w}),close:Aa({api:w}),handleClose:Ba({emit:s,props:e,state:E}),mousedown:ja({state:E,vm:m}),mousemove:La({state:E,props:e,emit:s}),mouseup:Ra({state:E}),keydown:Na({api:w,state:E,props:e}),addKeydownEvent:Ca({api:w}),removeKeydownEvent:Va({api:w}),addDragEvent:Ua({api:w,vm:m}),removeDragEvent:Ma({api:w,vm:m}),watchVisible:Ia({state:E,api:w}),showScrollbar:Ha(x),hideScrollbar:qa(x),computedWidth:za({state:E,designConfig:k,props:e,constants:g}),computedHeight:Ea({state:E,designConfig:k,props:e,constants:g})}),r(()=>{e.dragable&&w.addDragEvent(),w.addKeydownEvent(),e.lockScroll&&e.visible&&w.showScrollbar()}),c(()=>{e.dragable&&w.removeDragEvent(),w.removeKeydownEvent(),e.lockScroll&&w.hideScrollbar()}),a(()=>e.visible,w.watchVisible,{immediate:!0}),a(()=>e.width,()=>E.width=0),w};function Ja(e,n){var a=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(a)return(a=a.call(e)).next.bind(a);if(Array.isArray(e)||(a=Ka(e))||n){a&&(e=a);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ka(e,n){if(e){if(typeof e=="string")return Pt(e,n);var a={}.toString.call(e).slice(8,-1);return a==="Object"&&e.constructor&&(a=e.constructor.name),a==="Map"||a==="Set"?Array.from(e):a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?Pt(e,n):void 0}}function Pt(e,n){(n==null||n>e.length)&&(n=e.length);for(var a=0,r=Array(n);a<n;a++)r[a]=e[a];return r}var Ga=function(n,a){for(var r=n.__vccOpts||n,c=Ja(a),f;!(f=c()).done;){var s=f.value,m=s[0],v=s[1];r[m]=v}return r},Ya=Rt({components:{TinyButton:O,TinyTooltip:Yn,IconClose:ea(),IconHelpCircle:Qn(),SlotWrapper:{props:["node"],render:function(){var n=this.node;return typeof n=="function"?n(Zn):n}}},props:[].concat(Xn,["visible","title","showHeader","showFooter","customClass","placement","width","height","mask","dragable","maskClosable","lockScroll","flex","showClose","zIndex","beforeClose","tipsProps","customSlots","closeOnPressEscape"]),emits:["update:visible","open","close","confirm","drag"],setup:function(n,a){return Tn({props:n,context:a,renderless:Wa,api:Fa})}}),Ta={"data-tag":"tiny-drawer",class:"tiny-drawer"},Xa={class:"tiny-drawer__box"},Za={key:0,"data-tag":"drawer-header",ref:"header",class:"tiny-drawer__header-wrapper"},Qa={key:1,class:"tiny-drawer__header"},er={class:"tiny-drawer__header-left"},tr={key:0,class:"tiny-drawer__title"},nr={class:"tiny-drawer__header-right"},ar={key:1,"data-tag":"drawer-footer",ref:"footer",class:"tiny-drawer__footer"};function rr(e,n,a,r,c,f){var s=ve("slot-wrapper"),m=ve("icon-help-circle"),v=ve("tiny-tooltip"),g=ve("icon-close"),k=ve("tiny-button");return $(),I("div",Ta,[o(Qe,{name:"drawer-fade"},{default:d(function(){return[e.mask&&e.state.visible?($(),I("div",{key:0,ref:"mask",class:"tiny-drawer__mask show-bg-color",style:_t({zIndex:e.zIndex}),onClick:n[0]||(n[0]=function(x){return e.handleClose("mask")})},null,4)):M("v-if",!0)]}),_:1}),o(Qe,{name:"drawer-slide-"+e.placement,persisted:""},{default:d(function(){return[Vt(b("div",{"data-tag":"tiny-drawer-main",ref:"drawerBox",class:Ge(["tiny-drawer__main",{"is-left":e.placement==="left","is-right":e.placement==="right","is-top":e.placement==="top","is-bottom":e.placement==="bottom","drag-effects":!e.state.dragEvent.isDrag,toggle:e.state.visible},"tiny-drawer-main",e.customClass]),style:_t({width:["left","right"].includes(e.placement)?e.state.computedWidth:null,height:["top","bottom","left","right"].includes(e.placement)||e.dragable?e.state.computedHeight:null,zIndex:e.zIndex,transform:e.state.visible?"none":null})},[e.dragable?($(),I("div",{key:0,"data-tag":"drawer-drag-bar",ref:"dragBar",class:Ge(["tiny-drawer__drag-bar",["left","right"].includes(e.placement)&&"p-left-Right",["top","bottom"].includes(e.placement)&&"p-top-Bottom",e.placement==="left"&&"p-left",e.placement==="right"&&"p-right",e.placement==="top"&&"p-top",e.placement==="bottom"&&"p-bottom"])},null,2)):M("v-if",!0),b("div",Xa,[e.showHeader?($(),I("div",Za,[je(e.$slots,"header",{},function(){var x;return[(x=e.customSlots)!=null&&x.header?($(),W(s,{key:0,node:e.customSlots.header},null,8,["node"])):($(),I("div",Qa,[b("div",er,[e.title?($(),I("div",tr,N(e.title),1)):M("v-if",!0),e.tipsProps?($(),W(v,Vn(jt({key:1},e.tipsProps)),{default:d(function(){return[o(m,{class:"tiny-drawer__help-icon"})]}),_:1},16)):M("v-if",!0)]),b("div",nr,[je(e.$slots,"header-right",{},function(){var w;return[(w=e.customSlots)!=null&&w.headerRight?($(),W(s,{key:0,node:e.customSlots.headerRight},null,8,["node"])):M("v-if",!0)]})])]))]}),e.showClose?($(),I("button",{key:0,type:"button",class:"tiny-drawer__headerbtn","aria-label":"Close",onClick:n[1]||(n[1]=function(x){return e.handleClose("close")})},[o(g,{class:"tiny-svg-size tiny-drawer__close"})])):M("v-if",!0)],512)):M("v-if",!0),b("div",{"data-tag":"drawer-body",ref:"body",class:Ge(["tiny-drawer__body",{"flex flex-col":e.flex},"drawer-body"])},[je(e.$slots,"default",{},function(){var x;return[o(s,{node:(x=e.customSlots)==null?void 0:x.default},null,8,["node"])]})],2),e.showFooter?($(),I("div",ar,[je(e.$slots,"footer",{},function(){var x;return[(x=e.customSlots)!=null&&x.footer?($(),W(s,{key:0,node:e.customSlots.footer},null,8,["node"])):($(),I(le,{key:1},[o(k,{class:"tiny-drawer__cancel-btn",onClick:n[2]||(n[2]=function(w){return e.handleClose("cancel")})},{default:d(function(){return[h(N(e.t("ui.button.cancel")),1)]}),_:1}),o(k,{type:"primary",class:"tiny-drawer__confirm-btn",onClick:n[3]||(n[3]=function(w){return e.handleClose("confirm")})},{default:d(function(){return[h(N(e.t("ui.button.confirm")),1)]}),_:1})],64))]})],512)):M("v-if",!0)])],6),[[Lt,e.state.visible]])]}),_:3},8,["name"])])}var Xe=Ga(Ya,[["render",rr]]),sr={TINY_MODE:"pc"};function be(){return be=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var a=arguments[n];for(var r in a)({}).hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},be.apply(null,arguments)}var ir=function(n){var a,r=typeof process=="object"?(a=sr)==null?void 0:a.TINY_MODE:null;return Xe},Ut={SCROLL_LOCK_CLASS:function(n){var a={"mobile-first":"overflow-hidden",pc:"popup-parent--hidden dialog-box__scroll-lock"};return a[n]||""},DEFAULT_WIDTH:"500px",DEFAULT_HEIGHT:"100vh"},or=be({},aa,{_constants:{type:Object,default:function(){return Ut}},visible:{type:Boolean,default:!1},customClass:[String,Object,Array],placement:{type:String,default:"right"},width:{type:String},height:{type:String},title:String,showClose:{type:Boolean,default:!0},showHeader:{type:Boolean,default:!0},showFooter:{type:Boolean,default:!1},mask:{type:Boolean,default:!0},maskClosable:{type:Boolean,default:!0},dragable:Boolean,lockScroll:{type:Boolean,default:!0},flex:{type:Boolean,default:!1},zIndex:{type:Number,default:2e3},beforeClose:Function,tipsProps:Object,customSlots:Object}),J=Rt({name:na+"Drawer",props:or,setup:function(n,a){return ta({props:n,context:a,template:ir})}}),lr={customClass:null,placement:"right",width:null,height:null,title:"",showClose:!0,showHeader:!0,showFooter:!1,mask:!0,maskClosable:!0,dragable:!1,lockScroll:!0,flex:!1,zIndex:2e3,beforeClose:null,tipsProps:null},Mt=function(n){var a;n===void 0&&(n={});var r={onOpen:function(v){var g;typeof((g=n.events)==null?void 0:g.open)=="function"&&n.events.open(v)},onClose:function(v){var g;typeof((g=n.events)==null?void 0:g.close)=="function"&&n.events.close(v)},onConfirm:function(v){var g;typeof((g=n.events)==null?void 0:g.confirm)=="function"&&n.events.confirm(v)}},c=be({},lr,n,r),f=sa({component:J,propsData:be({},c,{_constants:Ut,tiny_mode:n.tiny_mode||((a=ia().tiny_mode)==null?void 0:a.value)}),el:document.createElement("div")}),s=document.body;return s.appendChild(f.$el),jn(function(){f.open()}),f},ur="3.undefined";J.model={prop:"visible",event:"update:visible"};J.service=Mt;J.install=function(e){e.component(J.name,J)};J.version=ur;ra.TINYDrawer={init:function(n){var a=n.$apiPrefix||"$";n[a+"drawer"]=Mt}};function Ht(e){return e}function dr(e){return function(n){return F(n,e)}}function fr(e){return e!==null&&(typeof e=="object"||typeof e=="function")}function et(e){return e==null||typeof e!="object"&&typeof e!="function"}function Bt(e,n){return e===n||Number.isNaN(e)&&Number.isNaN(n)}function qt(e,n,a){return typeof a!="function"?qt(e,n,()=>{}):tt(e,n,function r(c,f,s,m,v,g){const k=a(c,f,s,m,v,g);return k!==void 0?!!k:tt(c,f,r,g)},new Map)}function tt(e,n,a,r){if(n===e)return!0;switch(typeof n){case"object":return cr(e,n,a,r);case"function":return Object.keys(n).length>0?tt(e,{...n},a,r):Bt(e,n);default:return fr(e)?typeof n=="string"?n==="":!0:Bt(e,n)}}function cr(e,n,a,r){if(n==null)return!0;if(Array.isArray(n))return Ft(e,n,a,r);if(n instanceof Map)return pr(e,n,a,r);if(n instanceof Set)return mr(e,n,a,r);const c=Object.keys(n);if(e==null||et(e))return c.length===0;if(c.length===0)return!0;if(r?.has(n))return r.get(n)===e;r?.set(n,e);try{for(let f=0;f<c.length;f++){const s=c[f];if(!et(e)&&!(s in e)||n[s]===void 0&&e[s]!==void 0||n[s]===null&&e[s]!==null||!a(e[s],n[s],s,e,n,r))return!1}return!0}finally{r?.delete(n)}}function pr(e,n,a,r){if(n.size===0)return!0;if(!(e instanceof Map))return!1;for(const[c,f]of n.entries()){const s=e.get(c);if(a(s,f,c,e,n,r)===!1)return!1}return!0}function Ft(e,n,a,r){if(n.length===0)return!0;if(!Array.isArray(e))return!1;const c=new Set;for(let f=0;f<n.length;f++){const s=n[f];let m=!1;for(let v=0;v<e.length;v++){if(c.has(v))continue;const g=e[v];let k=!1;if(a(g,s,f,e,n,r)&&(k=!0),k){c.add(v),m=!0;break}}if(!m)return!1}return!0}function mr(e,n,a,r){return n.size===0?!0:e instanceof Set?Ft([...e],[...n],a,r):!1}function Wt(e,n){return qt(e,n,()=>{})}function vr(e){return Object.getOwnPropertySymbols(e).filter(n=>Object.prototype.propertyIsEnumerable.call(e,n))}function at(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const yr="[object RegExp]",Jt="[object String]",Kt="[object Number]",Gt="[object Boolean]",Yt="[object Arguments]",gr="[object Symbol]",hr="[object Date]",br="[object Map]",wr="[object Set]",Sr="[object Array]",_r="[object ArrayBuffer]",Tt="[object Object]",kr="[object DataView]",xr="[object Uint8Array]",$r="[object Uint8ClampedArray]",Or="[object Uint16Array]",zr="[object Uint32Array]",Er="[object Int8Array]",Ar="[object Int16Array]",Ir="[object Int32Array]",Dr="[object Float32Array]",Pr="[object Float64Array]";function Br(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Nr(e,n){return T(e,void 0,e,new Map,n)}function T(e,n,a,r=new Map,c=void 0){const f=c?.(e,n,a,r);if(f!==void 0)return f;if(et(e))return e;if(r.has(e))return r.get(e);if(Array.isArray(e)){const s=new Array(e.length);r.set(e,s);for(let m=0;m<e.length;m++)s[m]=T(e[m],m,a,r,c);return Object.hasOwn(e,"index")&&(s.index=e.index),Object.hasOwn(e,"input")&&(s.input=e.input),s}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp){const s=new RegExp(e.source,e.flags);return s.lastIndex=e.lastIndex,s}if(e instanceof Map){const s=new Map;r.set(e,s);for(const[m,v]of e)s.set(m,T(v,m,a,r,c));return s}if(e instanceof Set){const s=new Set;r.set(e,s);for(const m of e)s.add(T(m,void 0,a,r,c));return s}if(typeof Buffer<"u"&&Buffer.isBuffer(e))return e.subarray();if(Br(e)){const s=new(Object.getPrototypeOf(e)).constructor(e.length);r.set(e,s);for(let m=0;m<e.length;m++)s[m]=T(e[m],m,a,r,c);return s}if(e instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer)return e.slice(0);if(e instanceof DataView){const s=new DataView(e.buffer.slice(0),e.byteOffset,e.byteLength);return r.set(e,s),j(s,e,a,r,c),s}if(typeof File<"u"&&e instanceof File){const s=new File([e],e.name,{type:e.type});return r.set(e,s),j(s,e,a,r,c),s}if(typeof Blob<"u"&&e instanceof Blob){const s=new Blob([e],{type:e.type});return r.set(e,s),j(s,e,a,r,c),s}if(e instanceof Error){const s=new e.constructor;return r.set(e,s),s.message=e.message,s.name=e.name,s.stack=e.stack,s.cause=e.cause,j(s,e,a,r,c),s}if(e instanceof Boolean){const s=new Boolean(e.valueOf());return r.set(e,s),j(s,e,a,r,c),s}if(e instanceof Number){const s=new Number(e.valueOf());return r.set(e,s),j(s,e,a,r,c),s}if(e instanceof String){const s=new String(e.valueOf());return r.set(e,s),j(s,e,a,r,c),s}if(typeof e=="object"&&Cr(e)){const s=Object.create(Object.getPrototypeOf(e));return r.set(e,s),j(s,e,a,r,c),s}return e}function j(e,n,a=e,r,c){const f=[...Object.keys(n),...vr(n)];for(let s=0;s<f.length;s++){const m=f[s],v=Object.getOwnPropertyDescriptor(e,m);(v==null||v.writable)&&(e[m]=T(n[m],m,a,r,c))}}function Cr(e){switch(at(e)){case Yt:case Sr:case _r:case kr:case Gt:case hr:case Dr:case Pr:case Er:case Ar:case Ir:case br:case Kt:case Tt:case yr:case wr:case Jt:case gr:case xr:case $r:case Or:case zr:return!0;default:return!1}}function Vr(e){return T(e,void 0,e,new Map,void 0)}function jr(e){return e=Vr(e),n=>Wt(n,e)}function Lr(e,n){return Nr(e,(a,r,c,f)=>{if(typeof e=="object"){if(at(e)===Tt&&typeof e.constructor!="function"){const s={};return f.set(e,s),j(s,e,c,f),s}switch(Object.prototype.toString.call(e)){case Kt:case Jt:case Gt:{const s=new e.constructor(e?.valueOf());return j(s,e),s}case Yt:{const s={};return j(s,e),s.length=e.length,s[Symbol.iterator]=e[Symbol.iterator],s}default:return}}})}function Rr(e){return Lr(e)}const Ur=/^(?:0|[1-9]\d*)$/;function Mr(e,n=Number.MAX_SAFE_INTEGER){switch(typeof e){case"number":return Number.isInteger(e)&&e>=0&&e<n;case"symbol":return!1;case"string":return Ur.test(e)}}function Hr(e){return e!==null&&typeof e=="object"&&at(e)==="[object Arguments]"}function qr(e,n){let a;if(Array.isArray(n)?a=n:typeof n=="string"&&ga(n)&&e?.[n]==null?a=ha(n):a=[n],a.length===0)return!1;let r=e;for(let c=0;c<a.length;c++){const f=a[c];if((r==null||!Object.hasOwn(r,f))&&!((Array.isArray(r)||Hr(r))&&Mr(f)&&f<r.length))return!1;r=r[f]}return!0}function Fr(e,n){switch(typeof e){case"object":{Object.is(e?.valueOf(),-0)&&(e="-0");break}case"number":{e=ba(e);break}}return n=Rr(n),function(a){const r=F(a,e);return r===void 0?qr(a,e):n===void 0?r===void 0:Wt(r,n)}}function Wr(e){if(e==null)return Ht;switch(typeof e){case"function":return e;case"object":return Array.isArray(e)&&e.length===2?Fr(e[0],e[1]):jr(e);case"string":case"symbol":case"number":return dr(e)}}function Jr(e,n=Ht){return ma(e,Wr(n))}const Kr={style:{width:"40%","margin-bottom":"10px",display:"flex"}},Gr={style:{"margin-right":"10px",width:"90vw"}},Yr={style:{height:"250px"}},Tr={style:{"margin-top":"10px"}},Xr={style:{width:"30%","margin-bottom":"10px",display:"flex"}},Zr={style:{"margin-right":"10px"}},Qr={style:{height:"90%"}},es={id:"tiny-basic-loading",style:{width:"100%",height:"100%"}},ts={class:"split-v-model"},ns={style:{padding:"10px"}},as={style:{height:"35vh"}},rs={style:{height:"35vh"}},ss={style:{height:"35vh"}},is={style:{"margin-top":"10px","margin-left":"10px"}},os={style:{"margin-top":"5px"}},ls={style:{"margin-top":"10px"}},us={style:{"margin-top":"10px"}},ds={style:{"margin-top":"5px"}},fs={style:{"margin-top":"10px"}},cs={style:{"margin-top":"5px"}},ps={key:0,style:{"margin-top":"15px"}},ms={style:{"max-height":"60vh"}},vs=nt({name:"apimanager",__name:"index",setup(e){const{routerPushByKey:n}=Ln(),{protocol:a,hostname:r,port:c}=Rn(),f=`${a}://${r}:${c}`,s={automaticLayout:!0,formatOnType:!0,formatOnPaste:!0};p("// some code...");const m=Un(),v=l=>m.value=l,g=p(!1),k={name:[{required:!0,message:"名称必填"},{min:3,max:50,message:"名称长度在 3 到 50 个字符"}],parames:[{required:!0,message:"参数必填"}]},x=p(1),w=p({seqSerial:!0,editConfig:{trigger:"click",mode:"cell",showStatus:!0},editRules:k,validConfig:{message:"tooltip"},fetchData:{api:Z},toolbar:{size:"small",resizable:!0,component:ua,buttons:[{code:"reload",name:"刷新",type:"info"},{code:"copy",name:"复制"},{code:"delete",name:"删除"},{code:"cancel",name:"取消选择"},{code:"save",name:"保存"},{code:"debug",name:"运行",type:"success"},{code:"mcp",name:"发布为智能体工具",type:"success"}]},events:{toolbarButtonClick:R},pager:{component:oa,attrs:{currentPage:1,pageSize:10,pageSizes:[10,20,50],total:0,layout:"total, sizes, prev, pager, next, jumper"}},columns:[{type:"selection",width:"50"},{field:"name",title:"名称",showOverflow:!0,editor:{component:"input",autoselect:!0},width:"250"},{field:"code",title:"编码"},{field:"typeName",title:"类型",renderer:{component:oe,attrs:{size:"small ",effect:"dark"}}},{field:"detail",title:"",renderer:{component:O,attrs:{type:"success",text:"查看",size:"small"}},width:"120"},{field:"edit",title:"",renderer:{component:O,attrs:{type:"info",text:"再次编辑",size:"small"}},width:"140"},{field:"addbiz",title:"",renderer:{component:O,attrs:{type:"success",text:"加入业务模块",size:"small"}}}]}),E=p(""),B=p();function X(l){x.value=l.currentPage}function Z({page:l}){const{currentPage:t,pageSize:_}=l,y=(t-1)*_;return new Promise(async D=>{const P=await z({url:`${f}/api/apimanager/queryPage`,method:"get",params:{limit:_,offset:y,searchVal:E.value,type:"all"}});P.data.forEach(i=>{i.type=="1"||i.type=="2"?i.typeName="数据组件":i.typeName="工作流"}),B.value.clearScroll(),D({result:P.data,page:{total:P.response.data.total}})})}async function R({code:l,$grid:t}){const _=t.getData(),y=t.getSelectRecords(),D=t.getUpdateRecords().concat(t.getInsertRecords());switch(l){case"reload":{t.handleFetch("reload"),S.success("刷新成功");break}case"insert":B.value.insert({});break;case"copy":{if(y.length===0){V.alert("请至少选中一条记录");break}y.forEach(P=>{delete P._RID,delete P.code}),t.insert(y),S.success("复制成功");break}case"cancel":{t.clearSelection();break}case"delete":{if(y.length===0){V.alert("请至少选中一条记录");break}g.value=!0;try{y.forEach(async P=>{await z({url:`${f}/api/apimanager/delete`,method:"post",data:{code:P.code}})}),g.value=!1}catch{g.value=!1}S.success("删除成功"),t.removeSelecteds();break}case"save":{if(D.length===0){V.alert("没有修改记录");break}B.value.validate(P=>{if(P){g.value=!0;try{D.forEach(async i=>{await z({url:`${f}/api/apimanager/save`,method:"post",data:i})}),g.value=!1}catch{g.value=!1}S.success("保存成功")}else V.alert("校验不通过")});break}case"debug":{if(de.value=!1,y.length===0||y.length>1){V.alert("请选中一条记录");break}const P=JSON.parse(y[0].parames);Q.value=JSON.stringify(P,null,4),_e.value=y[0].code,y[0].simplify&&y[0].simplify.length>0?C.value=dt(JSON.parse(y[0].simplify)):C.value=[],H.value=!0;break}case"code":{if(y.length===0||y.length>1){V.alert("请选中一条记录");break}ue.value=!0;break}case"edit":break;case"export":{B.value.exportCsv({filename:"table.csv",original:!0,isHeader:!1,useTabs:!1,data:_});break}case"mcp":{if(y.length===0||y.length>1){V.alert("请选中一条记录");break}ae.value="",pe.value="",ne.value=!0;break}}}function Xt(){B.value.handleFetch("reload")}const Ue=p(!1);function Zt(){Ue.value=!1}function rt(l){if(typeof l=="string")try{const t=JSON.parse(l);return!!(typeof t=="object"&&t)}catch{return!1}}const we=p(""),st=p({}),it=p();function Qt(){rt(we.value)&&(st.value=JSON.parse(we.value),it.value=bt.createId())}const Se=p(""),ot=p({}),lt=p();function en(l){rt(Se.value)&&(ot.value=l,lt.value=bt.createId(),Ce.value=Se.value)}const ue=p(!1),H=p(!1),ut=p(.4),_e=p(""),Q=p(""),U=p(null),de=p(!1);async function tn(){if(!de.value){const l=B.value.getSelectRecords();if(l.length===0||l.length>1){V.alert("请选中一条记录");return}}try{U.value=Et.service({target:document.getElementById("tiny-basic-loading")});let l=null,t=!1,_="";try{const y={inputs:JSON.parse(Q.value)};let D=!0;$t(C.value)&&C.value.forEach(i=>{(!i.key||i.key.length==0)&&(D=!1),(!i.value||i.value.length==0)&&(D=!1)}),D&&(Te(y,"inputs",ce(C.value)),Se.value=JSON.stringify(ce(C.value))),en(ce(C.value)),l=(await z({url:de.value?`${f}/api/proxy/${pt.value}/${mt.value}`:`${f}/api/execution/${_e.value}`,method:"post",data:y})).response.data}catch(y){t=!0,_=y}t?we.value=JSON.stringify({message:_}):(we.value=JSON.stringify(l),Ve.value=JSON.stringify(l)),Qt(),U.value.close()}catch{U.value.close(),S.error("失败")}}const ee=p(!1),te=p(""),ke=p(""),Me=p(""),xe=p(!1),$e=p("0"),fe=p(""),He=p("");function nn(l){if(te.value=l.row.code,ke.value=l.row.parames,$e.value=l.row.type,fe.value=l.row.sourceType,He.value="execution",l.columnIndex==4){if(xe.value=!1,$e.value=="2"){xe.value=!0;const t=JSON.parse(l.row.flow_data);Me.value=`数据源编码：${t.poolCode}  语句：${t.sql}`}ee.value=!0}l.columnIndex==5&&($e.value=="3"?an():V.alert("此类型不支持编辑")),l.columnIndex==6&&(vn(),G.value="",De.value=!0)}const Oe=l=>{Wn(l)};function an(){n("flowedit",{query:{code:te.value}})}Mn(()=>{B.value.clearScroll(),K()});const C=p([]);async function rn(){try{if(U.value=Et.service({target:document.getElementById("tiny-basic-loading")}),!$t(C.value)){V.alert("请先填写简化参数池"),U.value.close();return}let l=!0;if(C.value.forEach(_=>{(!_.key||_.key.length==0)&&(l=!1),(!_.value||_.value.length==0)&&(l=!1)}),!l){V.alert("存在空值，请检查"),U.value.close();return}if(de.value){await z({url:`${f}/api/apimanager/save`,method:"post",data:{code:_e.value,simplify:JSON.stringify(ce(C.value))}}),U.value.close();return}const t=B.value.getSelectRecords();if(t.length===0||t.length>1){V.alert("请选中一条记录");return}Te(t[0],"simplify",JSON.stringify(ce(C.value))),Te(t[0],"parames",Q.value),await z({url:`${f}/api/apimanager/save`,method:"post",data:t[0]}),B.value.handleFetch(),H.value=!H.value,U.value.close()}catch{U.value.close()}}function ce(l){return l.reduce((t,_)=>(t[_.key]=_.value,t),{})}function dt(l){return Object.entries(l).map(([t,_])=>({key:t,value:_}))}const ne=p(!1),ae=p(""),pe=p("");async function sn(){if(ae.value.length==0){S.info("请输入名称");return}if(pe.value.length==0){S.info("请输入描述");return}try{const l=B.value.getSelectRecords();let t;!l[0].simplify||l[0].simplify.length==0||l[0].simplify=="[]"?t="{}":t=l[0].simplify;const y=(await z({url:`${f}/api/openai/transText`,method:"post",data:{textInput:ae.value}})).data.res;if(!y||y.length==0){S.info("保存失败，请检查大模型配置");return}await z({url:`${f}/api/mcpmanager/save`,method:"post",data:{name:ae.value,description:pe.value,paramsSchema:t,code:l[0].code,transText:y}}),S.success("保存成功")}catch{S.error("保存失败")}ne.value=!1}const qe=p("biz"),ze=p(1),re=p(!1),ft=p([]);kt(qe,(l,t)=>{l=="biz"&&t=="all"&&K()});async function K(){re.value=!0;try{const l=await z({url:`${f}/api/apiProxymanager/queryPage`,method:"get",params:{searchVal:Fe.value,limit:6,offset:(ze.value-1)*6}});re.value=!1,l.data&&(ft.value=l.data);const t=l.response.data.total;t&&(ct.value=t<=6?1:Math.floor(t/6)+1)}catch{re.value=!1,S.error("查询失败")}}kt(ze,(l,t)=>{K()});const Ee=p(""),Ae=p(""),se=p(!1),ct=p(1);async function on(){if(Ee.value.length==0){S.info("请输入模块名称");return}if(Ae.value.length==0){S.info("请输入一级路径");return}try{await z({url:`${f}/api/apiProxymanager/save`,method:"post",data:{name:Ee.value,path1:Ae.value}}),S.success("保存成功")}catch{S.error("保存失败")}se.value=!1,K()}const Fe=p("");function ln(){K()}const me=p(!1),We=p([]);async function un(l){G.value=l;try{const t=await z({url:`${f}/api/apiProxyDetail/queryAll`,method:"get",params:{path1:l}});t.data&&(We.value=t.data),me.value=!0}catch{S.error("查询失败")}}async function dn(l,t,_){try{const y=await z({url:`${f}/api/apimanager/queryByCode`,method:"post",data:{code:l}});y.data&&(te.value=_,ke.value=y.data[0].parames,$e.value=y.data[0].type,fe.value=y.data[0].sourceType,He.value=`proxy/${t}`,xe.value=!1,ee.value=!0)}catch{S.error("查询失败")}}const pt=p(""),mt=p("");async function fn(l,t,_,y){de.value=!0,Ne.value=null,Ce.value="",Ve.value="";try{const D=await z({url:`${f}/api/apimanager/queryByCode`,method:"post",data:{code:l}});if(D.data){const P=JSON.parse(D.data[0].parames);Q.value=JSON.stringify(P,null,4),_e.value=D.data[0].code,pt.value=t,mt.value=_,D.data[0].simplify&&D.data[0].simplify.length>0?C.value=dt(JSON.parse(D.data[0].simplify)):C.value=[],Ne.value=y,H.value=!0}}catch{S.error("查询失败")}}async function cn(l){try{const t=await z({url:`${f}/api/apimanager/queryByCode`,method:"post",data:{code:l}});if(t.data&&t.data[0].sourceType&&t.data[0].sourceType.length>0){S.info("数据组件类型暂不支持编辑");return}}catch{S.error("查询失败")}n("flowedit",{query:{code:l}})}async function pn(l,t,_){try{await z({url:`${f}/api/apiProxyDetail/save`,method:"post",data:{id:l,path2:t,name:_}}),S.success("保存成功")}catch{S.error("保存失败")}}async function mn(l){try{await z({url:`${f}/api/apiProxyDetail/delete`,method:"post",data:{id:l}}),S.success("删除成功"),Jr(We.value,{id:l})}catch{S.error("删除失败")}}const G=p(""),Je=p([]),Ie=p(""),De=p(!1);async function vn(){Je.value=[];const l=await z({url:`${f}/api/apiProxymanager/queryAll`,method:"get",params:{}});l.data&&l.data.forEach(t=>{Je.value.push({value:F(t,"path1"),label:F(t,"name"),disabled:!1})})}async function yn(){if(G.value.length==0){S.info("请选择业务模块");return}if(Ie.value.length==0){S.info("请输入接口二级路径");return}try{const l=await z({url:`${f}/api/apimanager/queryByCode`,method:"post",data:{code:te.value}});l.data&&(await z({url:`${f}/api/apimanager/saveToProxy`,method:"post",data:{name:l.data[0].name,code:l.data[0].code,path1:G.value,path2:Ie.value}}),De.value=!1,S.info("添加成功"))}catch{S.error("添加失败")}}async function gn(l){re.value=!0;try{await z({url:`${f}/api/apiProxymanager/deleteAll`,method:"post",data:{path1:l}}),K(),re.value=!1,S.info("删除成功")}catch{S.error("删除失败")}}const Pe=p(""),Be=p(!1),vt=p(),yt=p(),Ke=p([]);async function hn(l,t){vt.value=l,yt.value=t,Be.value=!0,wn()}async function bn(){if(Pe.value.length==0){S.warning("请选择AppId/AppSecret");return}try{const t=await(await fetch(`${f}/api/openapi/exportMarkDown`,{method:"POST",headers:{"Content-Type":"application/json;charset=utf-8"},body:JSON.stringify({base:f,port:c,path1:vt.value,toSelectAppId:Pe.value})})).blob(),_=URL.createObjectURL(t),y=document.createElement("a");y.href=_,y.download=`${yt.value}-接口文档.md`,document.body.appendChild(y),y.click(),document.body.removeChild(y),URL.revokeObjectURL(_),Be.value=!1}catch{}}async function wn(){Ke.value=[];const l=await z({url:`${f}/api/appmanager/queryPage`,method:"get",params:{limit:1e3,offset:0}});l.data&&l.data.forEach(t=>{Ke.value.push({value:`${F(t,"appId")}-${F(t,"appSecret")}`,label:`${F(t,"appId")}#${F(t,"remark")}`,disabled:!1})})}const Ne=p(),Ce=p(""),Ve=p("");async function Sn(){if(!Ne.value||Ce.value.length==0||Ve.value.length==0){S.warning("请先点击 [运行] 完成测试");return}try{await z({url:`${f}/api/apiProxyDetail/save`,method:"post",data:{id:Ne.value,parames:Ce.value,resp:Ve.value}}),S.success("保存成功")}catch{S.error("保存失败")}}return(l,t)=>{const _=Hn,y=kn,D=_n,P=_a;return $(),I("div",null,[o(u(Le),null,{default:d(()=>[o(u(ie),null,{default:d(()=>[o(u(fa),{modelValue:qe.value,"onUpdate:modelValue":t[5]||(t[5]=i=>qe.value=i),"tab-style":"button-card"},{default:d(()=>[o(u(It),{title:"业务模块",name:"biz"},{default:d(()=>[b("div",Kr,[o(u(At),{modelValue:Fe.value,"onUpdate:modelValue":t[0]||(t[0]=i=>Fe.value=i),placeholder:"请输入模块名称/一级路径进行搜索",onSearch:ln,clearable:""},null,8,["modelValue"]),o(u(O),{type:"success",style:{"margin-left":"10px"},onClick:K},{default:d(()=>t[35]||(t[35]=[h("刷 新")])),_:1,__:[35]}),o(u(O),{type:"success",style:{"margin-left":"10px"},onClick:t[1]||(t[1]=i=>se.value=!0)},{default:d(()=>t[36]||(t[36]=[h("创建模块")])),_:1,__:[36]})]),b("div",Gr,[o(u(Oa),{show:re.value,style:{height:"680px"}},{default:d(()=>[o(u(ca),null,{default:d(()=>[($(!0),I(le,null,ye(ft.value,i=>($(),I("div",{style:{"min-width":"400px"},key:i.id},[o(u(Le),{title:i.name,"content-scrollable":"",style:{height:"320px"},segmented:"",embedded:"",hoverable:""},{footer:d(()=>[o(u(O),{type:"info",onClick:A=>un(i.path1)},{default:d(()=>t[41]||(t[41]=[h("编辑")])),_:2,__:[41]},1032,["onClick"]),o(u(Ye),{style:{"margin-left":"10px"},title:"确认删除？",type:"info",trigger:"click",onConfirm:A=>gn(i.path1)},{reference:d(()=>[o(u(O),{type:"danger"},{default:d(()=>t[42]||(t[42]=[h("删除")])),_:1,__:[42]})]),_:2},1032,["onConfirm"]),o(u(Ye),{style:{"margin-left":"10px"},title:"没有示例参数的接口不会导出，确认？",type:"info",trigger:"click",onConfirm:A=>hn(i.path1,i.name)},{reference:d(()=>[o(u(O),{type:"success"},{default:d(()=>t[43]||(t[43]=[h("导出MD")])),_:1,__:[43]})]),_:2},1032,["onConfirm"])]),default:d(()=>[b("div",Yr,[($(!0),I(le,null,ye(i.details,A=>($(),I("div",{key:A.id,style:{"margin-bottom":"10px"}},[h(" /"+N(A.path1)+"/"+N(A.path2)+" ",1),o(_,{strong:"",secondary:"",round:"",size:"tiny",style:{"margin-left":"10px"},onClick:gt=>dn(A.target,A.path1,A.path2)},{default:d(()=>t[37]||(t[37]=[h("查看")])),_:2,__:[37]},1032,["onClick"]),o(_,{strong:"",secondary:"",round:"",size:"tiny",style:{"margin-left":"10px"},onClick:gt=>fn(A.target,A.path1,A.path2,A.id)},{default:d(()=>t[38]||(t[38]=[h("调试")])),_:2,__:[38]},1032,["onClick"]),o(_,{strong:"",secondary:"",round:"",size:"tiny",style:{"margin-left":"10px"},onClick:gt=>cn(A.target)},{default:d(()=>t[39]||(t[39]=[h("编辑")])),_:2,__:[39]},1032,["onClick"]),t[40]||(t[40]=b("br",null,null,-1))]))),128))])]),_:2},1032,["title"])]))),128))]),_:1})]),_:1},8,["show"]),b("div",Tr,[o(u(pa),{page:ze.value,"onUpdate:page":t[2]||(t[2]=i=>ze.value=i),"page-count":ct.value},null,8,["page","page-count"])])])]),_:1}),o(u(It),{title:"全部",name:"all"},{default:d(()=>[b("div",Xr,[o(u(At),{modelValue:E.value,"onUpdate:modelValue":t[3]||(t[3]=i=>E.value=i),placeholder:"请输入名称/编码进行搜索",onSearch:Xt,clearable:""},null,8,["modelValue"])]),b("div",Zr,[o(u(la),jt({height:"auto",resizable:"",ref_key:"basicGridRef",ref:B},w.value,{loading:g.value,onCellClick:t[4]||(t[4]=i=>{nn(i)}),onPageChange:X,"column-width":220,size:"small","auto-resize":!0}),null,16,["loading"])])]),_:1})]),_:1},8,["modelValue"])]),_:1})]),_:1}),o(u(J),{title:"响应数据",visible:Ue.value,"onUpdate:visible":t[6]||(t[6]=i=>Ue.value=i),onConfirm:Zt},{default:d(()=>[b("div",Qr,[o(u(ie))])]),_:1},8,["visible"]),o(u(q),{visible:ue.value,"onUpdate:visible":t[8]||(t[8]=i=>ue.value=i),title:"API",width:"50%"},{footer:d(()=>[o(u(O),{type:"primary",onClick:t[7]||(t[7]=i=>ue.value=!ue.value)},{default:d(()=>t[44]||(t[44]=[h("确 定")])),_:1,__:[44]})]),default:d(()=>[t[45]||(t[45]=b("div",null,null,-1))]),_:1,__:[45]},8,["visible"]),o(u(q),{visible:H.value,"onUpdate:visible":t[14]||(t[14]=i=>H.value=i),title:"调试",width:"85vw",top:"50","max-height":"92vh"},{footer:d(()=>[o(u(O),{type:"success",onClick:tn},{default:d(()=>t[52]||(t[52]=[h("运 行")])),_:1,__:[52]}),o(u(O),{type:"primary",onClick:t[13]||(t[13]=i=>H.value=!H.value)},{default:d(()=>t[53]||(t[53]=[h("关 闭")])),_:1,__:[53]})]),default:d(()=>[b("div",es,[b("div",ts,[o(u(da),{modelValue:ut.value,"onUpdate:modelValue":t[12]||(t[12]=i=>ut.value=i)},{left:d(()=>[o(u(ie),null,{default:d(()=>[b("div",ns,[o(u(va),{"default-expanded-names":"1",accordion:""},{default:d(()=>[o(u(Dt),{title:"参数池",name:"1"},{"header-extra":d(()=>t[47]||(t[47]=[b("div",{style:{color:"green"}},"点击展开",-1)])),default:d(()=>[b("div",as,[o(u(xn),{value:Q.value,"onUpdate:value":t[9]||(t[9]=i=>Q.value=i),language:"json",options:s,onMount:v,style:{height:"35vh"}},{default:d(()=>t[46]||(t[46]=[h(" 初始化... ")])),_:1,__:[46]},8,["value"])])]),_:1}),o(u(Dt),{title:"简化参数池",name:"2"},{"header-extra":d(()=>t[49]||(t[49]=[b("div",{style:{color:"green"}},"点击展开",-1)])),default:d(()=>[b("div",rs,[o(u($n),{value:C.value,"onUpdate:value":t[10]||(t[10]=i=>C.value=i),preset:"pair","key-placeholder":"参数名","value-placeholder":"参数值"},null,8,["value"]),o(u(O),{type:"primary",style:{padding:"10px","margin-top":"5px"},onClick:rn},{default:d(()=>t[48]||(t[48]=[h("保存简化参数池")])),_:1,__:[48]})])]),_:1})]),_:1})])]),_:1})]),right:d(()=>[b("div",null,[o(D,{"default-active-key":["2"]},{default:d(()=>[o(y,{header:"请求参数",key:"1"},{default:d(()=>[b("div",null,[o(_,{strong:"",secondary:"",round:"",type:"info",onClick:t[11]||(t[11]=i=>Oe(Se.value))},{default:d(()=>t[50]||(t[50]=[h(" 复制 ")])),_:1,__:[50]}),($(),W(u(ht),{key:lt.value,data:ot.value},null,8,["data"]))])]),_:1}),o(y,{header:"返回结果",key:"2"},{default:d(()=>[b("div",ss,[o(u(ie),null,{default:d(()=>[($(),W(u(ht),{key:it.value,data:st.value},null,8,["data"]))]),_:1})])]),_:1})]),_:1}),b("div",is,[o(u(O),{type:"primary",onClick:Sn},{default:d(()=>t[51]||(t[51]=[h("保存为示例参数")])),_:1,__:[51]})])])]),_:1},8,["modelValue"])])])]),_:1},8,["visible"]),o(u(q),{visible:ee.value,"onUpdate:visible":t[19]||(t[19]=i=>ee.value=i),title:"详情",width:"68vw",top:"50","max-height":"92vh"},{footer:d(()=>[o(u(O),{type:"primary",onClick:t[18]||(t[18]=i=>ee.value=!ee.value)},{default:d(()=>t[62]||(t[62]=[h("关 闭")])),_:1,__:[62]})]),default:d(()=>[b("div",null,[o(u(Le),null,{default:d(()=>[o(u(ie),null,{default:d(()=>[b("div",null,[o(u(oe),{size:"medium",type:"success"},{default:d(()=>t[54]||(t[54]=[h(" API地址 ")])),_:1,__:[54]})]),b("div",os,[h(N(u(a))+"://"+N(u(r))+":"+N(u(c))+"/api/"+N(He.value)+"/"+N(te.value)+" ",1),o(u(O),{type:"info",size:"mini",style:{"margin-left":"5px"},onClick:t[15]||(t[15]=i=>Oe(`${u(a)}://${u(r)}:${u(c)}/api/{{cellPath1}}/${te.value}`))},{default:d(()=>t[55]||(t[55]=[h("复制")])),_:1,__:[55]})]),b("div",ls,[o(u(oe),{size:"medium",type:"success"},{default:d(()=>t[56]||(t[56]=[h(" 请求类型 ")])),_:1,__:[56]})]),t[61]||(t[61]=b("div",{style:{"margin-top":"5px"}},"POST",-1)),b("div",us,[o(u(oe),{size:"medium",type:"success"},{default:d(()=>t[57]||(t[57]=[h(" 请求参数 ")])),_:1,__:[57]})]),b("div",ds,[h(N(ke.value)+" ",1),o(u(O),{type:"info",size:"mini",style:{"margin-left":"5px"},onClick:t[16]||(t[16]=i=>Oe(ke.value))},{default:d(()=>t[58]||(t[58]=[h("复制")])),_:1,__:[58]})]),Vt(b("div",null,[b("div",fs,[o(u(oe),{size:"medium",type:"success"},{default:d(()=>t[59]||(t[59]=[h(" 配置 ")])),_:1,__:[59]})]),b("div",cs,[h(N(Me.value)+" ",1),o(u(O),{type:"info",size:"mini",style:{"margin-left":"5px"},onClick:t[17]||(t[17]=i=>Oe(Me.value))},{default:d(()=>t[60]||(t[60]=[h("复制")])),_:1,__:[60]})])],512),[[Lt,xe.value]]),fe.value&&fe.value.length>0?($(),I("div",ps,[o(u(oe),{effect:"dark",size:"medium "},{default:d(()=>[h(N(fe.value),1)]),_:1})])):M("",!0)]),_:1,__:[61]})]),_:1})])]),_:1},8,["visible"]),o(u(q),{visible:ne.value,"onUpdate:visible":t[23]||(t[23]=i=>ne.value=i),title:"发布智能体工具",width:"50vw",top:"50","max-height":"92vh"},{footer:d(()=>[o(u(O),{type:"success",onClick:sn},{default:d(()=>t[63]||(t[63]=[h("发 布")])),_:1,__:[63]}),o(u(O),{type:"primary",onClick:t[22]||(t[22]=i=>ne.value=!ne.value)},{default:d(()=>t[64]||(t[64]=[h("关 闭")])),_:1,__:[64]})]),default:d(()=>[b("div",null,[o(u(ge),{modelValue:ae.value,"onUpdate:modelValue":t[20]||(t[20]=i=>ae.value=i),placeholder:"输入名称"},null,8,["modelValue"]),o(u(ge),{modelValue:pe.value,"onUpdate:modelValue":t[21]||(t[21]=i=>pe.value=i),placeholder:"输入描述",style:{"margin-top":"10px"},type:"textarea"},null,8,["modelValue"])])]),_:1},8,["visible"]),o(u(q),{visible:se.value,"onUpdate:visible":t[27]||(t[27]=i=>se.value=i),title:"新建业务模块",width:"40vw",top:"50","max-height":"92vh"},{footer:d(()=>[o(u(O),{type:"success",onClick:on},{default:d(()=>t[65]||(t[65]=[h("确 定")])),_:1,__:[65]}),o(u(O),{type:"primary",onClick:t[26]||(t[26]=i=>se.value=!se.value)},{default:d(()=>t[66]||(t[66]=[h("关 闭")])),_:1,__:[66]})]),default:d(()=>[b("div",null,[o(u(ge),{modelValue:Ee.value,"onUpdate:modelValue":t[24]||(t[24]=i=>Ee.value=i),placeholder:"输入模块名称"},null,8,["modelValue"]),o(u(ge),{modelValue:Ae.value,"onUpdate:modelValue":t[25]||(t[25]=i=>Ae.value=i),placeholder:"输入接口一级路径",style:{"margin-top":"10px"}},null,8,["modelValue"])])]),_:1},8,["visible"]),o(u(q),{visible:me.value,"onUpdate:visible":t[29]||(t[29]=i=>me.value=i),title:"模块编辑",width:"68vw",top:"50","max-height":"80vh"},{footer:d(()=>[o(u(O),{type:"primary",onClick:t[28]||(t[28]=i=>me.value=!me.value)},{default:d(()=>t[72]||(t[72]=[h("关 闭")])),_:1,__:[72]})]),default:d(()=>[b("div",ms,[o(u(ya),{"show-icon":!1,style:{"margin-bottom":"10px"},type:"info"},{default:d(()=>[t[67]||(t[67]=h(" base url:")),t[68]||(t[68]=b("br",null,null,-1)),h(" "+N(u(a))+"://"+N(u(r))+":"+N(u(c))+"/api/proxy/"+N(G.value)+"/ ",1)]),_:1,__:[67,68]}),o(u(Le),null,{default:d(()=>[o(u(ie),null,{default:d(()=>[($(!0),I(le,null,ye(We.value,i=>($(),I("div",{key:i.id,style:{"margin-bottom":"20px"}},[o(u(qn),{style:{width:"65%","margin-left":"20px"}},{default:d(()=>[o(u(xt),{value:i.name,"onUpdate:value":A=>i.name=A,style:{width:"50%"}},null,8,["value","onUpdate:value"]),o(P,null,{default:d(()=>t[69]||(t[69]=[h("base url")])),_:1,__:[69]}),o(u(xt),{value:i.path2,"onUpdate:value":A=>i.path2=A,style:{width:"35%"}},null,8,["value","onUpdate:value"])]),_:2},1024),o(_,{type:"success",size:"small",style:{"margin-left":"20px"},onClick:A=>pn(i.id,i.path2,i.name)},{default:d(()=>t[70]||(t[70]=[h("保存")])),_:2,__:[70]},1032,["onClick"]),o(u(Ye),{style:{"margin-left":"20px"},title:"确认删除？",type:"info",trigger:"click",onConfirm:A=>mn(i.id)},{reference:d(()=>[o(u(O),{type:"danger",size:"small"},{default:d(()=>t[71]||(t[71]=[h("删除")])),_:1,__:[71]})]),_:2},1032,["onConfirm"])]))),128))]),_:1})]),_:1})])]),_:1},8,["visible"]),o(u(q),{visible:De.value,"onUpdate:visible":t[32]||(t[32]=i=>De.value=i),title:"加入到业务模块",width:"30%"},{footer:d(()=>[o(u(O),{type:"primary",onClick:yn},{default:d(()=>t[73]||(t[73]=[h("确 定")])),_:1,__:[73]})]),default:d(()=>[t[74]||(t[74]=b("p",{style:{"margin-top":"20px"}},"选择加入已有的业务模块",-1)),o(u(Ot),{clearable:"",modelValue:G.value,"onUpdate:modelValue":t[30]||(t[30]=i=>G.value=i),style:{"margin-top":"10px"},searchable:!0,placeholder:"选择业务模块"},{default:d(()=>[($(!0),I(le,null,ye(Je.value,i=>($(),W(u(zt),{key:i.value,label:i.label,value:i.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"]),o(u(ge),{modelValue:Ie.value,"onUpdate:modelValue":t[31]||(t[31]=i=>Ie.value=i),placeholder:"输入接口二级路径",style:{"margin-top":"10px"}},null,8,["modelValue"])]),_:1,__:[74]},8,["visible"]),o(u(q),{visible:Be.value,"onUpdate:visible":t[34]||(t[34]=i=>Be.value=i),title:"选择使用的AppId/AppSecret",width:"30%"},{footer:d(()=>[o(u(O),{type:"primary",onClick:bn},{default:d(()=>t[75]||(t[75]=[h("确 定")])),_:1,__:[75]})]),default:d(()=>[o(u(Ot),{clearable:"",modelValue:Pe.value,"onUpdate:modelValue":t[33]||(t[33]=i=>Pe.value=i),style:{"margin-top":"10px"},searchable:!0},{default:d(()=>[($(!0),I(le,null,ye(Ke.value,i=>($(),W(u(zt),{key:i.value,label:i.label,value:i.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1},8,["visible"])])}}}),As=Fn(vs,[["__scopeId","data-v-af285da3"]]);export{As as default};
