@yinuo-ngm/server 1.0.5 → 1.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/LICENSE +15 -0
  2. package/package.json +38 -38
  3. package/www/browser/{chunk-X7DKZB43.js → chunk-2PBA7FNM.js} +2 -2
  4. package/www/browser/chunk-35COW2FA.js +1 -0
  5. package/www/browser/{chunk-IGJYBE5M.js → chunk-3N7T4ZJF.js} +1 -1
  6. package/www/browser/{chunk-6ZXMOHQD.js → chunk-5IUYSJVD.js} +1 -1
  7. package/www/browser/{chunk-CF64VPDQ.js → chunk-5MHC25IS.js} +1 -1
  8. package/www/browser/chunk-7U5ZOE34.js +1 -0
  9. package/www/browser/{chunk-GKOCPXFS.js → chunk-A2SBXP7A.js} +1 -1
  10. package/www/browser/chunk-CJISJEP3.js +1 -0
  11. package/www/browser/chunk-CPA2B3DD.js +1 -0
  12. package/www/browser/{chunk-TN5O5PXP.js → chunk-DUC7XBYN.js} +1 -1
  13. package/www/browser/{chunk-UIDFNBD4.js → chunk-DV7BEQJD.js} +1 -1
  14. package/www/browser/{chunk-ZGEEPU7F.js → chunk-EAYGWAZB.js} +1 -1
  15. package/www/browser/{chunk-GNFBCMLE.js → chunk-EC33AXSR.js} +1 -1
  16. package/www/browser/{chunk-K6ZRTM2Q.js → chunk-FL6BUQ4M.js} +1 -1
  17. package/www/browser/{chunk-A6CKMRBS.js → chunk-FPDGZ3ZC.js} +1 -1
  18. package/www/browser/{chunk-ECWYTW7Q.js → chunk-IXHH6ENJ.js} +1 -1
  19. package/www/browser/chunk-KKLLU6U7.js +3 -0
  20. package/www/browser/chunk-MN4WB67T.js +1 -0
  21. package/www/browser/{chunk-ZJKBRM7K.js → chunk-POZS3PD3.js} +1 -1
  22. package/www/browser/{chunk-J43J3F2V.js → chunk-PTMJ422K.js} +6 -6
  23. package/www/browser/{chunk-HT3VTKOZ.js → chunk-PYGKDDJK.js} +1 -1
  24. package/www/browser/{chunk-34QRY4VA.js → chunk-ROB7EMN5.js} +13 -13
  25. package/www/browser/chunk-TLFV3T3W.js +1 -0
  26. package/www/browser/chunk-U7FBNFSB.js +1 -0
  27. package/www/browser/chunk-UWKUE7CZ.js +11 -0
  28. package/www/browser/{chunk-R7E5ZK2M.js → chunk-V6LX42JA.js} +1 -1
  29. package/www/browser/dark.css +1 -1
  30. package/www/browser/default.css +1 -1
  31. package/www/browser/index.html +1 -1
  32. package/www/browser/main-IIW5QQA5.js +29 -0
  33. package/www/browser/chunk-5RKAWOOJ.js +0 -1
  34. package/www/browser/chunk-ACZLOZZH.js +0 -1
  35. package/www/browser/chunk-C3KAVW4L.js +0 -1
  36. package/www/browser/chunk-CKWTUTVS.js +0 -1
  37. package/www/browser/chunk-QC33YQSO.js +0 -11
  38. package/www/browser/chunk-U76AMP2X.js +0 -3
  39. package/www/browser/main-F763G7F7.js +0 -29
@@ -0,0 +1 @@
1
+ import{a as Me}from"./chunk-7U5ZOE34.js";import{a as xe,e as ke,f as ve}from"./chunk-DV7BEQJD.js";import{a as he}from"./chunk-PYGKDDJK.js";import"./chunk-5IUYSJVD.js";import"./chunk-CJISJEP3.js";import{d as be,e as ye}from"./chunk-35COW2FA.js";import"./chunk-SIVPP74B.js";import"./chunk-POZS3PD3.js";import{b as ze}from"./chunk-3N7T4ZJF.js";import"./chunk-HZ73CM45.js";import{b as S,c as ge,d as E}from"./chunk-5MHC25IS.js";import{f as F}from"./chunk-DUC7XBYN.js";import{a as A,e as de}from"./chunk-ROB7EMN5.js";import{c as _e,d as Ce}from"./chunk-A2SBXP7A.js";import"./chunk-SNCDDYQR.js";import{H as ue,I as fe}from"./chunk-FPDGZ3ZC.js";import{Ab as ce,Bb as me,Cb as N,Fb as I,Hb as D,M as h,N as f,T as oe,U as x,V as P,W as ae,Y as O,Z as k,jb as se,lb as re,pb as le,vb as v,yb as pe,z as ie}from"./chunk-PTMJ422K.js";import"./chunk-HFZLJHYR.js";import{i as C}from"./chunk-53YRDYLS.js";import{$b as K,Ca as G,Eb as u,Fc as te,Ic as d,Jc as M,Kc as z,Q as H,U as Q,Vb as T,Xb as w,_b as J,ac as c,bc as o,cc as a,dc as l,g as b,gd as ne,kc as X,l as U,mb as r,qc as m,ra as g,tc as _,xa as W,xc as Y,ya as q,yb as y,yc as Z,zc as ee}from"./chunk-SJG2JCPL.js";var L=class n{constructor(t,e,i){this.stream=t;this.clipboard=e;this.notify=i;this.resizeSub.add(this.resize$.pipe(H(350),Q((s,p)=>s.cols===p.cols&&s.rows===p.rows),ie(this.destroyRef)).subscribe(s=>{this._taskId&&this.stream.resize(this._taskId,s.cols,s.rows)}))}_taskId="";destroyRef=g(G);set taskId(t){let e=(t??"").trim();e&&e!==this._taskId&&(this._taskId&&(this.stream.unsubscribeTask(this._taskId),this.term?.clear()),this._taskId=e,this.bind(e))}get taskId(){return this._taskId}tail=200;follow=!0;status={status:"idle"};term;sub=new b;resizeSub=new b;resize$=new U;bind(t){this.stream.subscribeTask(t,this.tail),this.sub.unsubscribe(),this.sub=new b,this.sub.add(this.stream.output$(t).subscribe(e=>{this.term&&(this.term.follow=this.follow,this.term.write(e.payload.text))})),this.sub.add(this.stream.status$(t).subscribe(e=>this.status=e))}ngOnDestroy(){this._taskId&&this.stream.unsubscribeTask(this._taskId),this.sub.unsubscribe(),this.resizeSub.unsubscribe()}toggleFollow(){this.follow=!this.follow,this.follow&&this.term?.scrollToBottom()}clear(){this.term?.clear()}toBottom(){this.term?.scrollToBottom()}async copy(){let t=this.term?.copyAll()??"";if(!t)return;this.clipboard.copy(t)?this.notify.success("Console output copied to clipboard."):this.notify.error("Failed to copy console output.")}onTermResized(t){this.resize$.next(t)}static \u0275fac=function(e){return new(e||n)(y(ge),y(be),y(ue))};static \u0275cmp=u({type:n,selectors:[["app-task-console"]],viewQuery:function(e,i){if(e&1&&Y(A,5),e&2){let s;Z(s=ee())&&(i.term=s.first)}},inputs:{taskId:"taskId",tail:"tail"},decls:16,vars:1,consts:[[1,"console-card"],[1,"header"],[1,"title"],["nzType","desktop","nzTheme","outline"],[1,"id"],[1,"actions"],["nzAlign","center"],["nz-button","","nz-tooltip","\u6E05\u7A7A\u65E5\u5FD7",3,"click"],["nzType","clear","nzTheme","outline"],["nz-button","","nz-tooltip","\u590D\u5236\u65E5\u5FD7",3,"click"],["nzType","copy","nzTheme","outline"],["nz-button","","nz-tooltip","\u6EDA\u52A8\u5230\u5E95\u90E8",3,"click"],["nzType","vertical-align-bottom","nzTheme","outline"],[1,"viewport"],[3,"resized","follow"]],template:function(e,i){e&1&&(o(0,"div",0)(1,"div",1)(2,"div",2),l(3,"nz-icon",3),o(4,"div",4),d(5,"\u8F93\u51FA"),a()(),o(6,"div",5)(7,"nz-space",6)(8,"button",7),m("click",function(){return i.clear()}),l(9,"nz-icon",8),a(),o(10,"button",9),m("click",function(){return i.copy()}),l(11,"nz-icon",10),a(),o(12,"button",11),m("click",function(){return i.toBottom()}),l(13,"nz-icon",12),a()()()(),o(14,"div",13)(15,"app-terminal-view",14),m("resized",function(p){return i.onTermResized(p)}),a()()()),e&2&&(r(15),c("follow",i.follow))},dependencies:[v,k,O,P,ae,x,oe,f,h,D,I,A,ye],styles:[".console-card[_ngcontent-%COMP%]{height:100%;display:flex;flex-direction:column;border:1px solid rgba(255,255,255,.08);border-radius:8px;overflow:hidden;min-height:0}.header[_ngcontent-%COMP%]{flex:0 0 auto;display:flex;align-items:center;justify-content:space-between;padding:8px 12px}.header[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px}.header[_ngcontent-%COMP%] .title[_ngcontent-%COMP%] .status[_ngcontent-%COMP%]{margin-left:8px;font-size:12px}.header[_ngcontent-%COMP%] .title[_ngcontent-%COMP%] .status[_ngcontent-%COMP%] .running[_ngcontent-%COMP%]{opacity:.9}.header[_ngcontent-%COMP%] .title[_ngcontent-%COMP%] .status[_ngcontent-%COMP%] .stopped[_ngcontent-%COMP%]{opacity:.8}.header[_ngcontent-%COMP%] .title[_ngcontent-%COMP%] .status[_ngcontent-%COMP%] .idle[_ngcontent-%COMP%]{opacity:.6}.viewport[_ngcontent-%COMP%]{flex:1 1 auto;min-height:0;overflow:hidden;padding:8px;background:#000;border-radius:8px}"]})};var j=class n{name;description;command;static \u0275fac=function(e){return new(e||n)};static \u0275cmp=u({type:n,selectors:[["app-task-header"]],inputs:{name:"name",description:"description",command:"command"},decls:7,vars:3,consts:[[1,"name"],["nzType","appstore"],[1,"description"],[1,"command"]],template:function(e,i){e&1&&(o(0,"div",0),l(1,"nz-icon",1),d(2),a(),o(3,"div",2),d(4),a(),o(5,"div",3),d(6),a()),e&2&&(r(2),z(" ",i.name||"\u672A\u9009\u62E9\u4EFB\u52A1"),r(2),M(i.description||"-"),r(2),M(i.command||"-"))},dependencies:[C,f,h],styles:["[_nghost-%COMP%]{padding:0 16px;display:flex;flex-direction:row;align-items:center}[_nghost-%COMP%] .name[_ngcontent-%COMP%]{font-size:22px;position:relative;top:-1px}[_nghost-%COMP%] .description[_ngcontent-%COMP%]{flex:1;color:var(--app-text-secondary);font-size:15px;margin:0 16px;overflow:hidden;-ms-text-overflow:ellipsis;text-overflow:ellipsis;white-space:nowrap}[_nghost-%COMP%] .command[_ngcontent-%COMP%]{font-family:Roboto Mono,monospace;font-size:13px;background:var(--app-primary-3);height:32px;line-height:32px;padding:0 12px;border-radius:3px;overflow:hidden;-ms-text-overflow:ellipsis;text-overflow:ellipsis;white-space:nowrap;box-sizing:border-box}"]})};var Ne=(n,t)=>t.spec.id;function Ie(n,t){n&1&&(o(0,"div",7),d(1,"Loading..."),a())}function De(n,t){if(n&1&&(o(0,"div",7),d(1),a()),n&2){let e=_(2);r(),z("No tasks for project: ",e.projectId())}}function Ee(n,t){n&1&&l(0,"nz-badge",14)}function Fe(n,t){n&1&&l(0,"nz-badge",15)}function Le(n,t){n&1&&l(0,"nz-badge",16)}function je(n,t){if(n&1){let e=X();o(0,"div",10),m("click",function(){let s=W(e).$implicit,p=_(3);return q(p.state.select(s.spec.id))}),o(1,"div",11)(2,"div",12),l(3,"nz-icon",13),T(4,Ee,1,0,"nz-badge",14)(5,Fe,1,0,"nz-badge",15)(6,Le,1,0,"nz-badge",16),a(),o(7,"div",17)(8,"div",18),d(9),a(),o(10,"div",19),d(11),a()()()()}if(n&2){let e=t.$implicit,i=_(3);te("active",e.spec.id===i.selectedId()),r(),c("nz-tooltip",e.spec.description||""),r(3),w((e==null||e.runtime==null?null:e.runtime.status)==="running"?4:(e==null||e.runtime==null?null:e.runtime.status)==="stopping"?5:6),r(4),c("title",e.spec.name),r(),M(e.spec.name),r(2),z(" ",(e.runtime==null?null:e.runtime.status)==="running"?"\u8FD0\u884C\u4E2D":(e.runtime==null?null:e.runtime.status)==="stopping"?"\u505C\u6B62\u4E2D":(e.runtime==null?null:e.runtime.status)==="stopped"?"\u5DF2\u505C\u6B62":e.spec.description||"\u7A7A\u95F2\u4E2D"," ")}}function Be(n,t){if(n&1&&(o(0,"div",8),J(1,je,12,7,"div",9,Ne),a()),n&2){let e=_(2);r(),K(e.list())}}function Re(n,t){if(n&1&&T(0,De,2,1,"div",7)(1,Be,3,0,"div",8),n&2){let e=_();w(e.list().length===0?0:1)}}var B=class n{state=g(E);keyword=this.state.keyword;loading=this.state.loading;list=this.state.rowsViewFiltered;selectedId=this.state.selectedTaskId;projectId=this.state.projectId;badge(t){return t??""}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=u({type:n,selectors:[["app-task-list"]],decls:10,vars:2,consts:[[1,"wrap"],[1,"header"],["nzInputPrefix","","nzType","search",1,"search-icon"],["nz-input","","placeholder","\u641C\u7D22\u4EFB\u52A1",3,"ngModelChange","ngModel"],["nz-button","","nzType","text",3,"click"],["nz-icon","","nzType","reload"],[1,"body"],[1,"hint"],[1,"items"],[1,"item",3,"active"],[1,"item",3,"click"],["nzTooltipPlacement","right",1,"row",3,"nz-tooltip"],[1,"icon"],["nzType","codepen-circle","nzTheme","outline"],["nzStatus","processing"],["nzStatus","warning"],["nzStatus","default"],[1,"info"],[1,"name",3,"title"],[1,"description"]],template:function(e,i){e&1&&(o(0,"div",0)(1,"div",1)(2,"nz-input-wrapper"),l(3,"nz-icon",2),o(4,"input",3),m("ngModelChange",function(p){return i.keyword.set(p)}),a()(),o(5,"button",4),m("click",function(){return i.state.refresh()}),l(6,"span",5),a()(),o(7,"div",6),T(8,Ie,2,0,"div",7)(9,Re,2,1),a()()),e&2&&(r(4),c("ngModel",i.keyword()),r(4),w(i.loading()?8:9))},dependencies:[C,v,se,re,le,k,O,P,f,h,S,x,F,N,ce,me,pe,D,I,Ce,_e],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;width:320px;flex:0 0 320px}.wrap[_ngcontent-%COMP%]{height:100%;display:flex;flex-direction:column;border:1px solid rgba(0,0,0,.12);border-radius:12px;overflow:hidden}.header[_ngcontent-%COMP%]{width:100%;padding:10px 12px;display:flex;gap:10px;align-items:center;justify-content:space-between;border-bottom:1px solid rgba(0,0,0,.12);flex:0 0 auto}.header[_ngcontent-%COMP%] nz-input-wrapper[_ngcontent-%COMP%]{width:100%;border-radius:18px}.body[_ngcontent-%COMP%]{flex:1 1 auto;height:0;display:flex;flex-direction:column}.error[_ngcontent-%COMP%]{padding:10px 12px;color:#b42318;flex:0 0 auto}.hint[_ngcontent-%COMP%]{padding:12px;opacity:.7;flex:0 0 auto}.items[_ngcontent-%COMP%]{flex:1 1 auto;overflow:auto;padding:8px;display:flex;flex-direction:column;gap:8px;height:100%;overflow-x:hidden;overflow-y:auto}.item[_ngcontent-%COMP%]{border-radius:3px;padding:10px;cursor:pointer}.item[_ngcontent-%COMP%]:hover, .item.active[_ngcontent-%COMP%]{background:var(--app-primary-3)}.item[_ngcontent-%COMP%] .row[_ngcontent-%COMP%]{display:flex;gap:10px;align-items:center;overflow:hidden;justify-content:space-between}.item[_ngcontent-%COMP%] .row[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{font-size:42px;flex:0 0 auto;position:relative}.item[_ngcontent-%COMP%] .row[_ngcontent-%COMP%] .info[_ngcontent-%COMP%]{flex:1 1 auto;display:flex;flex-direction:column;gap:4px;overflow:hidden}.item[_ngcontent-%COMP%] .row[_ngcontent-%COMP%] .info[_ngcontent-%COMP%] .name[_ngcontent-%COMP%]{font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.item[_ngcontent-%COMP%] .row[_ngcontent-%COMP%] .info[_ngcontent-%COMP%] .description[_ngcontent-%COMP%]{font-size:13px;color:var(--app-text-secondary);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.item[_ngcontent-%COMP%] .badge[_ngcontent-%COMP%]{font-size:12px;padding:2px 8px;border-radius:999px;border:1px solid rgba(0,0,0,.2);opacity:.85}.item[_ngcontent-%COMP%] .badge[data-status=running][_ngcontent-%COMP%]{font-weight:700}.item[_ngcontent-%COMP%] .badge[data-status=stopped][_ngcontent-%COMP%]{opacity:.7}.item[_ngcontent-%COMP%] .badge[data-status=failed][_ngcontent-%COMP%]{font-weight:700}.item[_ngcontent-%COMP%] .meta[_ngcontent-%COMP%]{margin-top:6px;font-size:12px;opacity:.75;display:flex;align-items:center;gap:6px}.item[_ngcontent-%COMP%] .meta[_ngcontent-%COMP%] .mono[_ngcontent-%COMP%]{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,Liberation Mono,monospace}.item[_ngcontent-%COMP%] .meta[_ngcontent-%COMP%] .sep[_ngcontent-%COMP%]{opacity:.5}"]})};var we=class n{projectState=g(fe);taskState=g(E);selectedTask=this.taskState.selectedRow;constructor(){ne(async()=>{let t=this.projectState.currentProjectId();t&&await this.taskState.setProject(t)})}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=u({type:n,selectors:[["app-tasks"]],decls:7,vars:9,consts:[[3,"title","isFullscreen"],[1,"page"],[1,"content"],[3,"name","description","command"],[3,"toggle","isStopping","isRunning","isStopped"],[3,"taskId"]],template:function(e,i){if(e&1&&(o(0,"app-page-layout",0)(1,"nz-layout",1),l(2,"app-task-list"),o(3,"nz-content",2),l(4,"app-task-header",3),o(5,"app-task-actions",4),m("toggle",function(){return i.taskState.toggleTask()}),a(),l(6,"app-task-console",5),a()()()),e&2){let s,p,R;c("title","\u4EFB\u52A1")("isFullscreen",!0),r(4),c("name",(s=i.selectedTask())==null||s.spec==null?null:s.spec.name)("description",(p=i.selectedTask())==null||p.spec==null?null:p.spec.description)("command",(R=i.selectedTask())==null||R.spec==null?null:R.spec.command),r(),c("isStopping",i.taskState.isStopping())("isRunning",i.taskState.isRunning())("isStopped",i.taskState.isStopped()),r(),c("taskId",i.taskState.selectedTaskId())}},dependencies:[C,v,x,F,k,N,Me,S,ze,f,ve,ke,xe,L,B,he,j,de],styles:[".page[_ngcontent-%COMP%]{height:100%;display:flex;flex-direction:row;overflow:hidden;gap:16px;padding:0 16px}.content[_ngcontent-%COMP%]{flex:1 1 auto;width:0;display:flex;flex-direction:column;gap:16px;height:100%;overflow:hidden}app-task-header[_ngcontent-%COMP%], app-task-actions[_ngcontent-%COMP%]{flex:0 0 auto}app-task-console[_ngcontent-%COMP%]{flex:1 1 auto;display:block;height:0}"]})};export{we as TasksComponent};
@@ -0,0 +1 @@
1
+ import{e as vn,f as yn}from"./chunk-DV7BEQJD.js";import{a as tt,b as Re}from"./chunk-5IUYSJVD.js";import{b as rt,c as lt,d as at}from"./chunk-MN4WB67T.js";import{a as ln,b as an,c as Je}from"./chunk-EC33AXSR.js";import{a as nt,b as it,d as xn,e as wn}from"./chunk-35COW2FA.js";import"./chunk-SIVPP74B.js";import{a as ot,b as De}from"./chunk-POZS3PD3.js";import{a as ve,b as ye}from"./chunk-3N7T4ZJF.js";import{a as Ue}from"./chunk-HZ73CM45.js";import{d as fe,e as he,f as te}from"./chunk-DUC7XBYN.js";import{e as pn,f as Ge,g as Qe}from"./chunk-ROB7EMN5.js";import"./chunk-SNCDDYQR.js";import{G as Se,I as hn,g as dn,l as Ie,n as Pe,p as mn,q as Ye,r as un,s as _n,t as Cn,u as gn,v as fn,w as Xe,x as et}from"./chunk-FPDGZ3ZC.js";import{Ab as H,Bb as ge,Cb as O,Fb as ke,G as Xt,H as It,Hb as qe,La as rn,M as J,N as U,O as en,P as tn,T as nn,U as on,V as D,W as X,Y as V,Z as I,jb as $,lb as B,pb as K,rb as sn,ub as cn,vb as P,x as Qt,yb as Ze,z as Yt}from"./chunk-PTMJ422K.js";import"./chunk-HFZLJHYR.js";import{B as qt,d as We,i as N,o as pe}from"./chunk-53YRDYLS.js";import{$b as R,Ca as Bt,Dc as Q,Eb as E,Ec as Ht,Fb as Ne,Fc as Y,Ha as A,Ic as m,Jc as k,Kb as W,Kc as le,Lc as Wt,Mc as ae,Nc as se,Oa as ee,Oc as ce,Vb as g,Vc as He,Wc as Ke,Xb as f,Xc as Jt,Zb as ue,_b as S,a as x,ac as d,ad as Ce,b as M,bc as l,cc as a,dc as h,e as Fe,f as At,fd as v,gd as kt,hc as oe,ic as re,jc as _e,kc as w,ld as je,ma as Ee,mb as s,na as Ae,pd as Zt,qc as C,r as Nt,ra as q,rb as y,rd as Gt,s as Be,tc as c,uc as Kt,vc as jt,vd as Le,xa as u,xc as Lt,ya as _,yc as Ut,z as j,zc as $t}from"./chunk-SJG2JCPL.js";var Ln=(i,t)=>t.id;function Un(i,t){i&1&&h(0,"nz-spin")}function $n(i,t){if(i&1&&(l(0,"nz-tag"),m(1),a()),i&2){let e=c().$implicit;s(),le("HTTP ",e.response.status)}}function Hn(i,t){i&1&&(l(0,"nz-tag",8),m(1,"ERR"),a())}function Wn(i,t){if(i&1){let e=w();l(0,"button",10),C("click",function(){u(e);let o=c().$implicit,r=c(3);return _(r.copy(o.resolved.curl.bash))}),m(1,"curl"),a()}}function Jn(i,t){if(i&1){let e=w();l(0,"div",3)(1,"div",5)(2,"nz-tag"),m(3),a(),l(4,"span",6),m(5),a()(),l(6,"div",7)(7,"span"),m(8),a(),g(9,$n,2,1,"nz-tag"),g(10,Hn,2,0,"nz-tag",8),a(),l(11,"div",9)(12,"button",10),C("click",function(){let o=u(e).$implicit,r=c(3);return _(r.replay.emit(o))}),m(13,"\u91CD\u653E"),a(),g(14,Wn,2,0,"button",11),a()()}if(i&2){let e=t.$implicit;s(3),k(e.requestSnapshot.method),s(2),k(e.requestSnapshot.url),s(3),le("",e.metrics.durationMs," ms"),s(),f(e.response?9:-1),s(),f(e.error?10:-1),s(4),f(e.resolved.curl?14:-1)}}function Zn(i,t){i&1&&(l(0,"div",4),m(1,"\u6682\u65E0\u5386\u53F2\u8BB0\u5F55"),a())}function Gn(i,t){if(i&1&&(l(0,"div",2),S(1,Jn,15,6,"div",3,Ln),g(3,Zn,2,0,"div",4),a()),i&2){let e=c(2);s(),R(e.histories),s(2),f(e.histories.length?-1:3)}}function Qn(i,t){if(i&1&&(oe(0),g(1,Un,1,0,"nz-spin")(2,Gn,4,1,"div",2),re()),i&2){let e=c();s(),f(e.loading?1:2)}}var st=class i{loading=!1;histories=[];close=new y;replay=new y;copy(t){navigator.clipboard.writeText(t)}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=E({type:i,selectors:[["app-api-history-drawer"]],inputs:{loading:"loading",histories:"histories"},outputs:{close:"close",replay:"replay"},decls:2,vars:2,consts:[["nzTitle","\u8BF7\u6C42\u5386\u53F2","nzPlacement","right",3,"nzOnClose","nzVisible","nzWidth"],[4,"nzDrawerContent"],[1,"list"],[1,"item"],[1,"empty"],[1,"row"],[1,"url"],[1,"meta"],["nzColor","red"],[1,"actions"],["nz-button","","nzSize","small",3,"click"],["nz-button","","nzSize","small"]],template:function(e,n){e&1&&(l(0,"nz-drawer",0),C("nzOnClose",function(){return n.close.emit()}),W(1,Qn,3,1,"ng-container",1),a()),e&2&&d("nzVisible",!0)("nzWidth",520)},dependencies:[N,Je,an,ln,I,V,D,X,De,ot,ye,ve],styles:[".list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:12px}.item[_ngcontent-%COMP%]{border:1px solid #f0f0f0;border-radius:8px;padding:10px}.row[_ngcontent-%COMP%]{display:flex;gap:8px;align-items:center;font-weight:500}.url[_ngcontent-%COMP%]{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.meta[_ngcontent-%COMP%]{margin-top:6px;display:flex;gap:8px;font-size:12px;opacity:.7}.actions[_ngcontent-%COMP%]{margin-top:8px;display:flex;gap:8px}.empty[_ngcontent-%COMP%]{padding:16px;opacity:.6;text-align:center}"]})};var ei=["*"];function ti(i,t){if(i&1){let e=w();l(0,"button",12),C("click",function(o){u(e);let r=c();return r.toggle.emit(r.node.key),_(o.stopPropagation())}),h(1,"nz-icon",13),a()}if(i&2){let e=c();s(),d("nzType",e.hasChildren?e.expanded?"down":"right":"minus")}}function ni(i,t){if(i&1&&(l(0,"nz-tag",5),m(1),a()),i&2){let e=c();s(),k(e.node.method||"")}}function ii(i,t){if(i&1&&(l(0,"div",8),m(1),a()),i&2){let e=c();s(),k(e.node.subtitle)}}function oi(i,t){if(i&1){let e=w();l(0,"li",16),C("click",function(){u(e);let o=c(3);return o.createFolder.emit(o.node.id),_(o.visible=!1)}),h(1,"nz-icon",22),l(2,"span"),m(3,"\u65B0\u5EFA\u76EE\u5F55"),a()()}}function ri(i,t){if(i&1){let e=w();l(0,"li",16),C("click",function(){u(e);let o=c(3);return o.move.emit(o.node.id),_(o.visible=!1)}),h(1,"nz-icon",22),l(2,"span"),m(3,"\u79FB\u52A8\u5230"),a()()}}function li(i,t){if(i&1){let e=w();g(0,oi,4,0,"li",15),l(1,"li",16),C("click",function(){u(e);let o=c(2);return o.createRequest.emit(o.node.id),_(o.visible=!1)}),h(2,"nz-icon",17),l(3,"span"),m(4,"\u65B0\u5EFA\u8BF7\u6C42"),a()(),g(5,ri,4,0,"li",15),l(6,"li",16),C("click",function(){u(e);let o=c(2);return o.rename.emit(o.node.id),_(o.visible=!1)}),h(7,"nz-icon",18),l(8,"span"),m(9,"\u91CD\u547D\u540D"),a()(),h(10,"li",19),l(11,"li",20),C("nzOnConfirm",function(){u(e);let o=c(2);return _(o.delete.emit(o.node.id))}),h(12,"nz-icon",21),l(13,"span"),m(14,"\u5220\u9664"),a()()}if(i&2){let e=c(2);f(e.node.kind==="collection"?0:-1),s(5),f(e.node.kind==="folder"?5:-1)}}function ai(i,t){if(i&1){let e=w();l(0,"li",16),C("click",function(){u(e);let o=c(2);return o.move.emit(o.node.id),_(o.visible=!1)}),h(1,"nz-icon",22),l(2,"span"),m(3,"\u79FB\u52A8\u5230"),a()(),l(4,"li",16),C("click",function(){u(e);let o=c(2);return o.rename.emit(o.node.id),_(o.visible=!1)}),h(5,"nz-icon",18),l(6,"span"),m(7,"\u91CD\u547D\u540D"),a()(),h(8,"li",19),l(9,"li",20),C("nzOnConfirm",function(){u(e);let o=c(2);return _(o.delete.emit(o.node.id))}),h(10,"nz-icon",21),l(11,"span"),m(12,"\u5220\u9664"),a()()}}function si(i,t){if(i&1&&(l(0,"ul",14),g(1,li,15,2)(2,ai,13,0),a()),i&2){let e=c();s(),f(e.node.kind!=="request"?1:2)}}function ci(i,t){i&1&&(l(0,"div",11),jt(1),a())}var ct=class i{node;expanded=!1;activeKey=null;toggle=new y;selectRequest=new y;selectCollection=new y;createRequest=new y;createFolder=new y;rename=new y;move=new y;copyCurl=new y;delete=new y;visible=!1;get hasChildren(){return(this.node.children?.length??0)>0}get iconType(){return this.node.kind==="request"?"api":this.node.kind==="folder"?"folder":"database"}onClick(){this.node.kind==="request"?this.selectRequest.emit(this.node.id):this.selectCollection.emit(this.node.id)}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=E({type:i,selectors:[["app-collection-tree-item"]],hostVars:2,hostBindings:function(e,n){e&2&&Y("ctree-item",!0)},inputs:{node:"node",expanded:"expanded",activeKey:"activeKey"},outputs:{toggle:"toggle",selectRequest:"selectRequest",selectCollection:"selectCollection",createRequest:"createRequest",createFolder:"createFolder",rename:"rename",move:"move",copyCurl:"copyCurl",delete:"delete"},ngContentSelectors:ei,decls:14,vars:11,consts:[["menuTpl",""],[1,"row"],["nz-button","","nzType","text","nzSize","small",1,"chev"],[1,"main",3,"click"],[1,"icon",3,"nzType"],[1,"method"],[1,"texts"],[1,"title"],[1,"sub"],["nz-button","","nzType","text","nzSize","small","nz-popover","","nzPopoverTrigger","click","nzPopover","","nzPopoverPlacement","right",1,"more",3,"click","nzPopoverVisibleChange","nzPopoverVisible","nzPopoverContent","nzPopoverOverlayClassName"],["nzType","more","nzTheme","outline"],[1,"children"],["nz-button","","nzType","text","nzSize","small",1,"chev",3,"click"],[3,"nzType"],["nz-menu",""],["nz-menu-item",""],["nz-menu-item","",3,"click"],["nzType","plus"],["nzType","edit"],["nz-menu-divider",""],["nz-menu-item","","nzDanger","","nz-popconfirm","","nzPopconfirmTitle","\u786E\u8BA4\u5220\u9664\u5417\uFF1F",3,"nzOnConfirm"],["nzType","delete"],["nzType","folder"]],template:function(e,n){if(e&1){let o=w();Kt(),l(0,"div",1),g(1,ti,2,1,"button",2),l(2,"div",3),C("click",function(){return u(o),_(n.onClick())}),h(3,"nz-icon",4),g(4,ni,2,1,"nz-tag",5),l(5,"div",6)(6,"div",7),m(7),a(),g(8,ii,2,1,"div",8),a()(),l(9,"button",9),C("click",function(p){return u(o),_(p.stopPropagation())}),ce("nzPopoverVisibleChange",function(p){return u(o),se(n.visible,p)||(n.visible=p),_(p)}),h(10,"nz-icon",10),a(),W(11,si,3,1,"ng-template",null,0,Ce),a(),g(13,ci,2,0,"div",11)}if(e&2){let o=Q(12);Y("active",n.activeKey===n.node.key),s(),f(n.hasChildren?1:-1),s(2),d("nzType",n.iconType),s(),f(n.node.kind==="request"?4:-1),s(3),k(n.node.title),s(),f(n.node.subtitle?8:-1),s(),ae("nzPopoverVisible",n.visible),d("nzPopoverContent",o)("nzPopoverOverlayClassName","project-item-popover"),s(4),f(n.hasChildren&&n.expanded?13:-1)}},dependencies:[N,I,V,D,P,U,J,Qe,Ge,Ye,Pe,Ie,mn,ye,ve,Re,tt],styles:[".item[_nghost-%COMP%]{display:block}.row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:6px;padding:6px 8px;border:1px solid #f0f0f0;border-radius:10px;cursor:pointer;transition:background .15s,border-color .15s}.row.active[_ngcontent-%COMP%]{background:#f5f5f5;border-color:#d9d9d9}.chev[_ngcontent-%COMP%]{flex:0 0 auto}.chev[_ngcontent-%COMP%] nz-icon[_ngcontent-%COMP%]{font-size:12px;transition:transform .15s}.main[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;flex:1;min-width:0}.icon[_ngcontent-%COMP%]{opacity:.75}.method[_ngcontent-%COMP%]{flex:0 0 auto}.texts[_ngcontent-%COMP%]{flex:1;min-width:0}.title[_ngcontent-%COMP%]{font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sub[_ngcontent-%COMP%]{font-size:12px;opacity:.65;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.more[_ngcontent-%COMP%]{flex:0 0 auto;visibility:hidden}.row[_ngcontent-%COMP%]:hover .more[_ngcontent-%COMP%]{visibility:visible}.children[_ngcontent-%COMP%]{margin-left:18px;padding-top:6px;display:flex;flex-direction:column;gap:6px}"]})};var zn=i=>({$implicit:i}),Mn=(i,t)=>t.key;function di(i,t){if(i&1&&_e(0,1),i&2){let e=t.$implicit;c();let n=Q(4);d("ngTemplateOutlet",n)("ngTemplateOutletContext",Ke(2,zn,e))}}function mi(i,t){i&1&&(l(0,"div",2),m(1,"\u6682\u65E0\u8BF7\u6C42"),a())}function ui(i,t){if(i&1&&_e(0,1),i&2){let e=t.$implicit;c(2);let n=Q(4);d("ngTemplateOutlet",n)("ngTemplateOutletContext",Ke(2,zn,e))}}function _i(i,t){if(i&1){let e=w();l(0,"app-collection-tree-item",3),C("toggle",function(o){u(e);let r=c();return _(r.toggle(o))})("selectRequest",function(o){u(e);let r=c();return _(r.onSelectRequest(o))})("selectCollection",function(o){u(e);let r=c();return _(r.onSelectCollection(o))})("createRequest",function(o){u(e);let r=c();return _(r.createRequest.emit({collectionId:o}))})("createFolder",function(o){u(e);let r=c();return _(r.createFolder.emit({collectionId:o}))})("rename",function(o){let r=u(e).$implicit,p=c();return _(p.rename.emit({id:o,kind:r.kind}))})("move",function(o){let r=u(e).$implicit,p=c();return _(p.move.emit({id:o,kind:r.kind}))})("copyCurl",function(o){u(e);let r=c();return _(r.copyCurl.emit(o))})("delete",function(o){let r=u(e).$implicit,p=c();return _(p.delete.emit({id:o,kind:r.kind}))}),S(1,ui,1,4,"ng-container",1,Mn),a()}if(i&2){let e=t.$implicit,n=c();d("node",e)("expanded",n.expanded(e.key))("activeKey",n.activeKey()),s(),R(e.children)}}var pt=class i{nodes=[];activeRequestId=je(null);selectRequest=new y;selectCollection=new y;createRequest=new y;createFolder=new y;rename=new y;move=new y;copyCurl=new y;delete=new y;activeKey=v(()=>this.activeRequestId()?`r:${this.activeRequestId()}`:null);_activeCollectionId=A(null);activeCollectionId=v(()=>this._activeCollectionId());expandedMap=A({});expanded(t){return!!this.expandedMap()[t]}toggle(t){let e=x({},this.expandedMap());e[t]=!e[t],this.expandedMap.set(e)}onSelectRequest(t){this.selectRequest.emit(t)}onSelectCollection(t){this._activeCollectionId.set(t),this.selectCollection.emit(t);let e=`c:${t}`,n=x({},this.expandedMap());n[e]=!0,this.expandedMap.set(n)}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=E({type:i,selectors:[["app-collection-tree"]],hostVars:2,hostBindings:function(e,n){e&2&&Y("tree-body",!0)},inputs:{nodes:"nodes",activeRequestId:[1,"activeRequestId"]},outputs:{selectRequest:"selectRequest",selectCollection:"selectCollection",createRequest:"createRequest",createFolder:"createFolder",rename:"rename",move:"move",copyCurl:"copyCurl",delete:"delete"},decls:5,vars:1,consts:[["nodeTpl",""],[3,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"empty"],[3,"toggle","selectRequest","selectCollection","createRequest","createFolder","rename","move","copyCurl","delete","node","expanded","activeKey"]],template:function(e,n){e&1&&(S(0,di,1,4,"ng-container",1,Mn),g(2,mi,2,0,"div",2),W(3,_i,3,3,"ng-template",null,0,Ce)),e&2&&(R(n.nodes),s(2),f(n.nodes.length?-1:2))},dependencies:[N,We,P,O,U,I,ct],styles:[".tree-body[_nghost-%COMP%]{flex:1 1 auto;height:0;overflow:auto;padding:10px;display:flex;flex-direction:column;gap:8px}.tree-body[_nghost-%COMP%] .empty[_ngcontent-%COMP%]{padding:16px;opacity:.6;text-align:center}"]})};function Ci(i,t){if(i&1){let e=w();l(0,"ul",11)(1,"li",12),C("click",function(){u(e);let o=c();return o.createRequest.emit({collectionId:null}),_(o.visible=!1)}),h(2,"nz-icon",13),l(3,"span"),m(4,"\u65B0\u5EFA\u8BF7\u6C42"),a()(),l(5,"li",12),C("click",function(){u(e);let o=c();return _(o.createCollection.emit())}),h(6,"nz-icon",14),l(7,"span"),m(8,"\u65B0\u5EFA\u96C6\u5408"),a()()()}}var dt=class i{nodes=je([]);q=Zt("");activeId=je(null);loading=!1;select=new y;createRequest=new y;createCollection=new y;createFolder=new y;reload=new y;delete=new y;rename=new y;move=new y;visible=!1;static \u0275fac=function(e){return new(e||i)};static \u0275cmp=E({type:i,selectors:[["app-request-collections"]],inputs:{nodes:[1,"nodes"],q:[1,"q"],activeId:[1,"activeId"],loading:"loading"},outputs:{q:"qChange",select:"select",createRequest:"createRequest",createCollection:"createCollection",createFolder:"createFolder",reload:"reload",delete:"delete",rename:"rename",move:"move"},decls:13,vars:7,consts:[["menuTpl",""],[1,"wrap"],[1,"header"],["nzInputPrefix","","nzType","search",1,"search-icon"],["nz-input","","placeholder","\u641C\u7D22",3,"ngModelChange","ngModel"],["nz-button","","nzType","text",3,"click"],["nzTheme","outline",3,"nzType"],["nz-button","","nz-popover","","nzPopoverTrigger","click","nzPopoverPlacement","bottomCenter","nzType","text",3,"nzPopoverVisibleChange","nzPopoverVisible","nzPopoverContent","nzPopoverOverlayClassName"],["nzType","plus","nzTheme","outline"],[1,"body"],[3,"selectRequest","createRequest","createFolder","rename","move","delete","nodes","activeRequestId"],["nz-menu",""],["nz-menu-item","",1,"item",3,"click"],["nzType","api"],["nzType","folder-add"]],template:function(e,n){if(e&1){let o=w();l(0,"div",1)(1,"div",2)(2,"nz-input-wrapper"),h(3,"nz-icon",3),l(4,"input",4),ce("ngModelChange",function(p){return u(o),se(n.q,p)||(n.q=p),_(p)}),a()(),l(5,"button",5),C("click",function(){return u(o),_(n.reload.emit())}),h(6,"nz-icon",6),a(),l(7,"button",7),ce("nzPopoverVisibleChange",function(p){return u(o),se(n.visible,p)||(n.visible=p),_(p)}),h(8,"nz-icon",8),a()(),l(9,"div",9)(10,"app-collection-tree",10),C("selectRequest",function(p){return u(o),_(n.select.emit(p))})("createRequest",function(p){return u(o),_(n.createRequest.emit({collectionId:p.collectionId}))})("createFolder",function(p){return u(o),_(n.createFolder.emit({collectionId:p.collectionId??null}))})("rename",function(p){return u(o),_(n.rename.emit(p))})("move",function(p){return u(o),_(n.move.emit(p))})("delete",function(p){return u(o),_(n.delete.emit({id:p.id,kind:p.kind}))}),a()()(),W(11,Ci,9,0,"ng-template",null,0,Ce)}if(e&2){let o=Q(12);s(4),ae("ngModel",n.q),s(2),d("nzType",n.loading?"loading":"reload"),s(),ae("nzPopoverVisible",n.visible),d("nzPopoverContent",o)("nzPopoverOverlayClassName","project-item-popover"),s(3),d("nodes",n.nodes())("activeRequestId",n.activeId())}},dependencies:[N,P,$,B,K,I,V,D,O,H,ge,Ze,U,J,Ye,Pe,Ie,Qe,Ge,pt],styles:["[_nghost-%COMP%]{height:100%;display:flex;flex-direction:column;width:320px;flex:0 0 320px}.wrap[_ngcontent-%COMP%]{height:100%;display:flex;flex-direction:column;border:1px solid rgba(0,0,0,.12);border-radius:12px;overflow:hidden}.header[_ngcontent-%COMP%]{width:100%;padding:10px 12px;display:flex;gap:10px;align-items:center;justify-content:space-between;border-bottom:1px solid rgba(0,0,0,.12);flex:0 0 auto}.header[_ngcontent-%COMP%] nz-input-wrapper[_ngcontent-%COMP%]{width:100%;border-radius:18px}.body[_ngcontent-%COMP%]{flex:1 1 auto;height:0;display:flex;flex-direction:column}"]})};function gi(i,t){i&1&&_e(0)}function fi(i,t){if(i&1&&W(0,gi,1,0,"ng-container",7),i&2){let e=c(3);d("nzStringTemplateOutlet",e.nzIcon)}}function hi(i,t){if(i&1&&h(0,"nz-icon",6),i&2){let e=c(3);d("nzType",e.nzIconType||e.inferredIconType)("nzTheme",e.iconTheme)}}function vi(i,t){if(i&1&&(l(0,"div",2),g(1,fi,1,1,"ng-container")(2,hi,1,2,"nz-icon",6),a()),i&2){let e=c(2);s(),f(e.nzIcon?1:2)}}function yi(i,t){if(i&1&&(oe(0),m(1),re()),i&2){let e=c(4);s(),k(e.nzMessage)}}function xi(i,t){if(i&1&&(l(0,"span",8),W(1,yi,2,1,"ng-container",7),a()),i&2){let e=c(3);s(),d("nzStringTemplateOutlet",e.nzMessage)}}function wi(i,t){if(i&1&&(oe(0),m(1),re()),i&2){let e=c(4);s(),k(e.nzDescription)}}function bi(i,t){if(i&1&&(l(0,"span",9),W(1,wi,2,1,"ng-container",7),a()),i&2){let e=c(3);s(),d("nzStringTemplateOutlet",e.nzDescription)}}function zi(i,t){if(i&1&&(l(0,"div",3),g(1,xi,2,1,"span",8),g(2,bi,2,1,"span",9),a()),i&2){let e=c(2);s(),f(e.nzMessage?1:-1),s(),f(e.nzDescription?2:-1)}}function Mi(i,t){if(i&1&&(oe(0),m(1),re()),i&2){let e=c(3);s(),k(e.nzAction)}}function Ti(i,t){if(i&1&&(l(0,"div",4),W(1,Mi,2,1,"ng-container",7),a()),i&2){let e=c(2);s(),d("nzStringTemplateOutlet",e.nzAction)}}function Ei(i,t){if(i&1&&(oe(0),l(1,"span",12),m(2),a(),re()),i&2){let e=c(4);s(2),k(e.nzCloseText)}}function Ai(i,t){if(i&1&&W(0,Ei,3,1,"ng-container",7),i&2){let e=c(3);d("nzStringTemplateOutlet",e.nzCloseText)}}function Ni(i,t){i&1&&h(0,"nz-icon",11)}function ki(i,t){if(i&1){let e=w();l(0,"button",10),C("click",function(){u(e);let o=c(2);return _(o.closeAlert())}),g(1,Ai,1,1,"ng-container")(2,Ni,1,0,"nz-icon",11),a()}if(i&2){let e=c(2);s(),f(e.nzCloseText?1:2)}}function qi(i,t){if(i&1){let e=w();l(0,"div",1),C("@slideAlertMotion.done",function(){u(e);let o=c();return _(o.onFadeAnimationDone())}),g(1,vi,3,1,"div",2),g(2,zi,3,2,"div",3),g(3,Ti,2,1,"div",4),g(4,ki,3,1,"button",5),a()}if(i&2){let e=c();Y("ant-alert-rtl",e.dir==="rtl")("ant-alert-success",e.nzType==="success")("ant-alert-info",e.nzType==="info")("ant-alert-warning",e.nzType==="warning")("ant-alert-error",e.nzType==="error")("ant-alert-no-icon",!e.nzShowIcon)("ant-alert-banner",e.nzBanner)("ant-alert-closable",e.nzCloseable)("ant-alert-with-description",!!e.nzDescription),d("@.disabled",e.nzNoAnimation)("@slideAlertMotion",void 0),s(),f(e.nzShowIcon?1:-1),s(),f(e.nzMessage||e.nzDescription?2:-1),s(),f(e.nzAction?3:-1),s(),f(e.nzCloseable||e.nzCloseText?4:-1)}}var Tn="alert",Me=(()=>{var p;let i,t=[],e=[],n,o=[],r=[];return p=class{cdr=q(Gt);directionality=q(Qt);destroyRef=q(Bt);_nzModuleName=Tn;nzAction=null;nzCloseText=null;nzIconType=null;nzMessage=null;nzDescription=null;nzType="info";nzCloseable=Be(this,t,!1);nzShowIcon=(Be(this,e),Be(this,o,!1));nzBanner=(Be(this,r),!1);nzNoAnimation=!1;nzIcon=null;nzOnClose=new y;closed=!1;iconTheme="fill";inferredIconType="info-circle";dir="ltr";isTypeSet=!1;isShowIconSet=!1;constructor(){Xt(Tn,()=>this.cdr.markForCheck())}ngOnInit(){this.directionality.change?.pipe(Yt(this.destroyRef)).subscribe(T=>{this.dir=T,this.cdr.detectChanges()}),this.dir=this.directionality.value}closeAlert(){this.closed=!0}onFadeAnimationDone(){this.closed&&this.nzOnClose.emit(!0)}ngOnChanges(T){let{nzShowIcon:z,nzDescription:L,nzType:G,nzBanner:Tt}=T;if(z&&(this.isShowIconSet=!0),G)switch(this.isTypeSet=!0,this.nzType){case"error":this.inferredIconType="close-circle";break;case"success":this.inferredIconType="check-circle";break;case"info":this.inferredIconType="info-circle";break;case"warning":this.inferredIconType="exclamation-circle";break}L&&(this.iconTheme=this.nzDescription?"outline":"fill"),Tt&&(this.isTypeSet||(this.nzType="warning"),this.isShowIconSet||(this.nzShowIcon=!0))}},(()=>{let T=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;i=[It()],n=[It()],Nt(null,null,i,{kind:"field",name:"nzCloseable",static:!1,private:!1,access:{has:z=>"nzCloseable"in z,get:z=>z.nzCloseable,set:(z,L)=>{z.nzCloseable=L}},metadata:T},t,e),Nt(null,null,n,{kind:"field",name:"nzShowIcon",static:!1,private:!1,access:{has:z=>"nzShowIcon"in z,get:z=>z.nzShowIcon,set:(z,L)=>{z.nzShowIcon=L}},metadata:T},o,r),T&&Object.defineProperty(p,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:T})})(),At(p,"\u0275fac",function(z){return new(z||p)}),At(p,"\u0275cmp",E({type:p,selectors:[["nz-alert"]],inputs:{nzAction:"nzAction",nzCloseText:"nzCloseText",nzIconType:"nzIconType",nzMessage:"nzMessage",nzDescription:"nzDescription",nzType:"nzType",nzCloseable:[2,"nzCloseable","nzCloseable",Le],nzShowIcon:[2,"nzShowIcon","nzShowIcon",Le],nzBanner:[2,"nzBanner","nzBanner",Le],nzNoAnimation:[2,"nzNoAnimation","nzNoAnimation",Le],nzIcon:"nzIcon"},outputs:{nzOnClose:"nzOnClose"},exportAs:["nzAlert"],features:[ee],decls:1,vars:1,consts:[[1,"ant-alert",3,"ant-alert-rtl","ant-alert-success","ant-alert-info","ant-alert-warning","ant-alert-error","ant-alert-no-icon","ant-alert-banner","ant-alert-closable","ant-alert-with-description"],[1,"ant-alert"],[1,"ant-alert-icon"],[1,"ant-alert-content"],[1,"ant-alert-action"],["type","button","tabindex","0",1,"ant-alert-close-icon"],[3,"nzType","nzTheme"],[4,"nzStringTemplateOutlet"],[1,"ant-alert-message"],[1,"ant-alert-description"],["type","button","tabindex","0",1,"ant-alert-close-icon",3,"click"],["nzType","close"],[1,"ant-alert-close-text"]],template:function(z,L){z&1&&g(0,qi,5,24,"div",0),z&2&&f(L.closed?-1:0)},dependencies:[U,J,tn,en],encapsulation:2,data:{animation:[rn]},changeDetection:0})),p})(),Ve=(()=>{class i{static \u0275fac=function(n){return new(n||i)};static \u0275mod=Ne({type:i});static \u0275inj=Ae({imports:[Me]})}return i})();function Ii(i,t){if(i&1&&h(0,"nz-option",3),i&2){let e=t.$implicit;d("nzValue",e)("nzLabel",e)}}function Pi(i,t){if(i&1){let e=w();l(0,"nz-select",8),C("ngModelChange",function(o){u(e);let r=c();return _(r.setApiKeyIn(o))}),h(1,"nz-option",9)(2,"nz-option",10),a()}if(i&2){let e=c();d("ngModel",e.apiKeyIn())}}function Si(i,t){i&1&&(l(0,"div",6),m(1,"\u65E0\u9274\u6743"),a())}function Ri(i,t){if(i&1){let e=w();l(0,"div",7)(1,"div",11)(2,"div",12),m(3,"Username"),a(),l(4,"input",13),C("ngModelChange",function(o){u(e);let r=c();return _(r.setBasicUsername(o))}),a()(),l(5,"div",11)(6,"div",12),m(7,"Password"),a(),l(8,"input",14),C("ngModelChange",function(o){u(e);let r=c();return _(r.setBasicPassword(o))}),a()()()}if(i&2){let e=c();s(4),d("ngModel",e.basicUsername()),s(4),d("ngModel",e.basicPassword())}}function Di(i,t){if(i&1){let e=w();l(0,"div",7)(1,"div",11)(2,"div",12),m(3,"Token"),a(),l(4,"input",15),C("ngModelChange",function(o){u(e);let r=c();return _(r.setBearerToken(o))}),a()()()}if(i&2){let e=c();s(4),d("ngModel",e.bearerToken())}}function Vi(i,t){i&1&&h(0,"nz-alert",18)}function Oi(i,t){i&1&&h(0,"nz-alert",19)}function Fi(i,t){if(i&1){let e=w();l(0,"div",7)(1,"div",11)(2,"div",12),m(3,"Key"),a(),l(4,"input",16),C("ngModelChange",function(o){u(e);let r=c();return _(r.setApiKeyKey(o))}),a()(),l(5,"div",11)(6,"div",12),m(7,"Value"),a(),l(8,"input",17),C("ngModelChange",function(o){u(e);let r=c();return _(r.setApiKeyValue(o))}),a()(),g(9,Vi,1,0,"nz-alert",18),g(10,Oi,1,0,"nz-alert",19),a()}if(i&2){let e=c();s(4),d("ngModel",e.apiKeyKey()),s(4),d("ngModel",e.apiKeyValue()),s(),f(e.apiKeyIn()==="query"?9:-1),s(),f(e.apiKeyIn()==="header"?10:-1)}}var mt=class i{auth;authChange=new y;types=["none","basic","bearer","apikey"];type=v(()=>this.auth?.type??"none");basicUsername=v(()=>this.auth?.type==="basic"?this.auth.basic?.username??"":"");basicPassword=v(()=>this.auth?.type==="basic"?this.auth.basic?.password??"":"");bearerToken=v(()=>this.auth?.type==="bearer"?this.auth.bearer?.token??"":"");apiKeyIn=v(()=>this.auth?.type!=="apikey"?"header":this.auth.apikey?.in??"header");apiKeyKey=v(()=>this.auth?.type==="apikey"?this.auth.apikey?.key??"":"");apiKeyValue=v(()=>this.auth?.type==="apikey"?this.auth.apikey?.value??"":"");setType(t){if(t==="none"){this.authChange.emit({type:"none"});return}if(t==="basic"){this.authChange.emit({type:"basic",basic:{username:"",password:""}});return}if(t==="bearer"){this.authChange.emit({type:"bearer",bearer:{token:""}});return}if(t==="apikey"){this.authChange.emit({type:"apikey",apikey:{in:"header",key:"",value:""}});return}}setBasicUsername(t){let e=M(x({},this.auth??{type:"basic"}),{type:"basic",basic:M(x({},this.auth?.basic),{username:t})});this.authChange.emit(e)}setBasicPassword(t){let e=M(x({},this.auth??{type:"basic"}),{type:"basic",basic:M(x({},this.auth?.basic),{password:t})});this.authChange.emit(e)}setBearerToken(t){let e=M(x({},this.auth??{type:"bearer"}),{type:"bearer",bearer:M(x({},this.auth?.bearer),{token:t})});this.authChange.emit(e)}setApiKeyIn(t){let e=M(x({},this.auth??{type:"apikey"}),{type:"apikey",apikey:M(x({},this.auth?.apikey),{in:t,key:this.apiKeyKey(),value:this.apiKeyValue()})});this.authChange.emit(e)}setApiKeyKey(t){let e=M(x({},this.auth??{type:"apikey"}),{type:"apikey",apikey:M(x({},this.auth?.apikey),{in:this.apiKeyIn(),key:t,value:this.apiKeyValue()})});this.authChange.emit(e)}setApiKeyValue(t){let e=M(x({},this.auth??{type:"apikey"}),{type:"apikey",apikey:M(x({},this.auth?.apikey),{in:this.apiKeyIn(),key:this.apiKeyKey(),value:t})});this.authChange.emit(e)}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=E({type:i,selectors:[["app-auth-editor"]],inputs:{auth:"auth"},outputs:{authChange:"authChange"},decls:11,vars:3,consts:[[1,"wrap"],[1,"bar"],[1,"type",3,"ngModelChange","ngModel"],[3,"nzValue","nzLabel"],[1,"in",3,"ngModel"],[1,"main"],[1,"empty"],[1,"grid"],[1,"in",3,"ngModelChange","ngModel"],["nzValue","header","nzLabel","in: header"],["nzValue","query","nzLabel","in: query"],[1,"row"],[1,"label"],["nz-input","","placeholder","username",3,"ngModelChange","ngModel"],["nz-input","","placeholder","password","type","password",3,"ngModelChange","ngModel"],["nz-input","","placeholder","Bearer token",3,"ngModelChange","ngModel"],["nz-input","","placeholder","x-api-key / api_key",3,"ngModelChange","ngModel"],["nz-input","","placeholder","value",3,"ngModelChange","ngModel"],["nzType","info","nzShowIcon","","nzMessage","\u63D0\u793A\uFF1Aquery \u578B API Key \u4E0D\u4F1A\u5199\u5165\u8BF7\u6C42\u5934\uFF0C\u4F1A\u5728\u53D1\u9001\u65F6\u62FC\u63A5\u5230 URL \u67E5\u8BE2\u53C2\u6570\u4E2D\u3002"],["nzType","info","nzShowIcon","","nzMessage","\u63D0\u793A\uFF1Aheader \u578B API Key \u4F1A\u5728\u53D1\u9001\u65F6\u5199\u5165\u8BF7\u6C42\u5934\u3002"]],template:function(e,n){if(e&1&&(l(0,"div",0)(1,"div",1)(2,"nz-select",2),C("ngModelChange",function(r){return n.setType(r)}),S(3,Ii,1,2,"nz-option",3,ue),a(),g(5,Pi,3,1,"nz-select",4),a(),l(6,"div",5),g(7,Si,2,0,"div",6)(8,Ri,9,2,"div",7)(9,Di,5,1,"div",7)(10,Fi,11,4,"div",7),a()()),e&2){let o;s(2),d("ngModel",n.type()),s(),R(n.types),s(2),f(n.type()==="apikey"?5:-1),s(2),f((o=n.type())==="none"?7:o==="basic"?8:o==="bearer"?9:o==="apikey"?10:-1)}},dependencies:[N,P,$,B,K,te,fe,he,O,H,Ve,Me],styles:[".wrap[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%;min-height:220px}.bar[_ngcontent-%COMP%]{display:flex;gap:10px;align-items:center;padding:8px 0;border-bottom:1px solid #f0f0f0}.type[_ngcontent-%COMP%]{width:160px}.in[_ngcontent-%COMP%]{width:140px}.main[_ngcontent-%COMP%]{flex:1 1 auto;overflow:auto;padding-top:10px}.empty[_ngcontent-%COMP%]{padding:12px;opacity:.7}.grid[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:10px}.row[_ngcontent-%COMP%]{display:grid;grid-template-columns:100px 1fr;align-items:center;gap:10px}.label[_ngcontent-%COMP%]{font-size:12px;opacity:.8}"]})};var An=Fe(Ue());var Ki=(i,t)=>t.id;function ji(i,t){if(i&1){let e=w();l(0,"label",10),C("ngModelChange",function(o){u(e);let r=c();return _(r.toggleEnabled(o))}),a()}if(i&2){let e=c();d("ngModel",e.isAllEnabled())}}function Li(i,t){if(i&1){let e=w();l(0,"div",9)(1,"div",2)(2,"label",11),C("ngModelChange",function(o){let r=u(e).$index,p=c();return _(p.setEnabled(r,o))}),a()(),l(3,"div",12)(4,"input",13),C("ngModelChange",function(o){let r=u(e).$index,p=c();return _(p.setKey(r,o))}),a()(),l(5,"div",5)(6,"input",14),C("ngModelChange",function(o){let r=u(e).$index,p=c();return _(p.setValue(r,o))}),a()(),l(7,"div",6)(8,"input",14),C("ngModelChange",function(o){let r=u(e).$index,p=c();return _(p.setDescription(r,o))}),a()(),l(9,"div",7)(10,"button",15),C("click",function(){let o=u(e).$index,r=c();return _(r.removeRow(o))}),h(11,"nz-icon",16),a()()()}if(i&2){let e=t.$implicit,n=c();s(2),d("ngModel",e.enabled)("nzDisabled",!n.keepTrailingBlank),s(),d("nz-tooltip",n.keepTrailingBlank?"":"\u81EA\u52A8\u63D0\u53D6Url \u4E2D\u7684 Path \u53C2\u6570\uFF0C\u652F\u6301{param} \u4E0E :param"),s(),d("readonly",!n.keepTrailingBlank)("placeholder",n.keyPlaceholder)("ngModel",e.key),s(2),d("placeholder",n.valuePlaceholder)("ngModel",e.value),s(2),d("placeholder",n.descriptionLabel)("ngModel",e.description)}}var we=class i{ngOnChanges(t){t.rows&&(this.rows=this.withTrailingBlank(this.rows))}rows=[];rowsChange=new y;keyLabel="Key";valueLabel="Value";keyPlaceholder="key";valuePlaceholder="value";descriptionLabel="Description";keepTrailingBlank=!0;enabledCount=v(()=>this.rows.filter(t=>t.enabled).length);isAllEnabled(){return this.rows.length>0&&this.rows.every(t=>t.enabled)}toggleEnabled(t){let e=this.rows.map(n=>M(x({},n),{enabled:t}));this.emit(e)}emit(t){this.rowsChange.emit(t)}withTrailingBlank(t){return this.keepTrailingBlank?this.ensureTrailingBlank(t):t}createBlankRow(){return{id:(0,An.uniqueId)(),key:"",value:"",description:"",enabled:!0}}isBlankRow(t){if(!t)return!0;let e=(t.key??"").trim(),n=(t.value??"").trim(),o=(t.description??"").trim();return!e&&!n&&!o}ensureTrailingBlank(t){let e=Array.isArray(t)?t:[];if(e.length===0)return[this.createBlankRow()];let n=e[e.length-1];return this.isBlankRow(n)?e:[...e,this.createBlankRow()]}sameRowsRefOrContent(t,e){if(t===e)return!0;if(t.length!==e.length)return!1;let n=this.isBlankRow(t[t.length-1]),o=this.isBlankRow(e[e.length-1]);return n===o}removeRow(t){let e=this.rows.filter((n,o)=>o!==t);this.emit(this.withTrailingBlank(e))}setEnabled(t,e){let n=this.rows.map((o,r)=>r===t?M(x({},o),{enabled:e}):o);this.emit(n)}setValue(t,e){this.patchRow(t,{value:e})}setKey(t,e){this.patchRow(t,{key:e})}setDescription(t,e){this.patchRow(t,{description:e})}patchRow(t,e){let n=this.rows.map((o,r)=>r===t?x(x({},o),e):o);this.emit(this.withTrailingBlank(n))}addRow(){let t=[...this.rows,this.createBlankRow()];this.emit(this.withTrailingBlank(t))}clearDisabled(){let t=this.rows.filter(e=>e.enabled);this.emit(this.withTrailingBlank(t))}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=E({type:i,selectors:[["app-kv-table"]],inputs:{rows:"rows",keyLabel:"keyLabel",valueLabel:"valueLabel",keyPlaceholder:"keyPlaceholder",valuePlaceholder:"valuePlaceholder",descriptionLabel:"descriptionLabel",keepTrailingBlank:"keepTrailingBlank"},outputs:{rowsChange:"rowsChange"},features:[ee],decls:14,vars:4,consts:[[1,"kv-wrap"],[1,"kv-head"],[1,"c-check"],["nz-checkbox","",3,"ngModel"],[1,"c-key"],[1,"c-val"],[1,"c-des"],[1,"c-op"],[1,"kv-body"],[1,"kv-row"],["nz-checkbox","",3,"ngModelChange","ngModel"],["nz-checkbox","",3,"ngModelChange","ngModel","nzDisabled"],[1,"c-key",3,"nz-tooltip"],["nz-input","",3,"ngModelChange","readonly","placeholder","ngModel"],["nz-input","",3,"ngModelChange","placeholder","ngModel"],["nz-button","","nzType","text","nz-tooltip","","nzTooltipTitle","\u5220\u9664",3,"click"],["nzType","minus-circle","nzTheme","outline"]],template:function(e,n){e&1&&(l(0,"div",0)(1,"div",1)(2,"div",2),g(3,ji,1,1,"label",3),a(),l(4,"div",4),m(5),a(),l(6,"div",5),m(7),a(),l(8,"div",6),m(9),a(),h(10,"div",7),a(),l(11,"div",8),S(12,Li,12,10,"div",9,Ki),a()()),e&2&&(s(3),f(n.keepTrailingBlank?3:-1),s(2),k(n.keyLabel),s(2),k(n.valueLabel),s(2),k(n.descriptionLabel),s(3),R(n.rows))},dependencies:[N,P,$,B,K,I,V,D,it,nt,O,H,U,J,qe,ke],styles:[".kv-wrap[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%}.kv-toolbar[_ngcontent-%COMP%]{padding:8px 0;display:flex;justify-content:space-between;align-items:center;gap:10px}.kv-toolbar[_ngcontent-%COMP%] .left[_ngcontent-%COMP%], .kv-toolbar[_ngcontent-%COMP%] .right[_ngcontent-%COMP%]{display:flex;gap:8px;align-items:center}.hint[_ngcontent-%COMP%]{font-size:12px;opacity:.7}.kv-head[_ngcontent-%COMP%]{display:grid;grid-template-columns:40px 1fr 1fr 2fr 44px;gap:8px;padding:6px 0;font-size:14px;border-bottom:1px solid #f0f0f0;align-items:center}.kv-head[_ngcontent-%COMP%] .c-key[_ngcontent-%COMP%], .kv-head[_ngcontent-%COMP%] .c-val[_ngcontent-%COMP%], .kv-head[_ngcontent-%COMP%] .c-des[_ngcontent-%COMP%]{opacity:.75}.kv-body[_ngcontent-%COMP%]{flex:1 1 auto;overflow:auto;padding:8px 0}.kv-row[_ngcontent-%COMP%]{display:grid;grid-template-columns:40px 1fr 1fr 2fr 44px;gap:8px;align-items:center;padding:6px 0;border-bottom:1px dashed #f0f0f0}.c-check[_ngcontent-%COMP%], .c-op[_ngcontent-%COMP%]{display:flex;justify-content:center}.kv-empty[_ngcontent-%COMP%]{padding:16px;opacity:.75;display:flex;align-items:center;justify-content:space-between;border:1px dashed #e8e8e8;border-radius:8px;margin-top:8px}"]})};var Nn=Fe(Ue());function Ui(i,t){if(i&1&&h(0,"nz-option",3),i&2){let e=t.$implicit;d("nzValue",e)("nzLabel",e)}}function $i(i,t){if(i&1){let e=w();l(0,"button",10),C("click",function(){u(e);let o=c();return _(o.formatJson())}),m(1,"\u683C\u5F0F\u5316 JSON"),a()}}function Hi(i,t){i&1&&(l(0,"div",7),m(1,"\u65E0 Body"),a())}function Wi(i,t){if(i&1){let e=w();l(0,"textarea",11),C("ngModelChange",function(o){u(e);let r=c();return _(r.setTextBody(o))}),a()}if(i&2){let e=c();d("ngModel",e.textBody())}}function Ji(i,t){if(i&1&&(l(0,"div",13),m(1),a()),i&2){let e=c(2);s(),k(e.jsonError())}}function Zi(i,t){if(i&1){let e=w();l(0,"textarea",12),C("ngModelChange",function(o){u(e);let r=c();return _(r.setJsonText(o))}),a(),g(1,Ji,2,1,"div",13)}if(i&2){let e=c();d("ngModel",e.jsonText()),s(),f(e.jsonError()?1:-1)}}function Gi(i,t){if(i&1){let e=w();l(0,"app-kv-table",14),C("rowsChange",function(o){u(e);let r=c();return _(r.setUrlRows(o))}),a()}if(i&2){let e=c();d("rows",e.urlRows())}}function Qi(i,t){i&1&&(l(0,"div",7),m(1,"MVP \u4EC5\u652F\u6301 none/json/text/urlencoded"),a())}var ut=class i{msg=q(Se);body;bodyChange=new y;bodySig=A(void 0);modes=["none","json","text","urlencoded","form","binary"];_jsonText=A("");mode=v(()=>this.bodySig()?.mode??"none");contentType=v(()=>this.bodySig()?.contentType??"");jsonText=v(()=>{if(this.mode()!=="json")return"";let t=this.body?.content;if(typeof t=="string")return t;if(t==null)return this._jsonText()||"";try{return JSON.stringify(t,null,2)}catch{return this._jsonText()||""}});jsonError=A("");textBody=v(()=>this.body?.mode==="text"?String(this.body?.content??""):"");urlRows=v(()=>{if(this.body?.mode!=="urlencoded")return[];let t=this.body?.content;return!t||typeof t!="object"||Array.isArray(t)?[]:Object.entries(t).map(([e,n])=>({key:e,value:String(n??""),enabled:!0,id:(0,Nn.uniqueId)()}))});setMode(t){let e=this.body,n=M(x({},e??{}),{mode:t});if(n.contentType||(t==="json"&&(n.contentType="application/json; charset=utf-8"),t==="text"&&(n.contentType="text/plain; charset=utf-8"),t==="urlencoded"&&(n.contentType="application/x-www-form-urlencoded; charset=utf-8"),t==="none"&&(n.contentType=void 0)),t==="none"){this.bodyChange.emit({mode:"none"});return}t==="json"&&e?.mode!=="json"&&(n.content={}),t==="text"&&e?.mode!=="text"&&(n.content=""),t==="urlencoded"&&e?.mode!=="urlencoded"&&(n.content={}),this.bodyChange.emit(n)}ngOnChanges(t){if(t.body){let e=t.body.currentValue;this.bodySig.set(e),e?.mode==="json"&&(typeof e.content=="string"?this._jsonText.set(e.content):this._jsonText.set(e.content?JSON.stringify(e.content,null,2):""),this.jsonError.set(""))}}setContentType(t){let e=this.mode(),n=M(x({},this.body??{mode:e}),{contentType:t});this.bodyChange.emit(n)}setTextBody(t){let e=M(x({},this.body??{mode:"text"}),{mode:"text",content:t});this.bodyChange.emit(e)}setJsonText(t){this._jsonText.set(t),this.jsonError.set("");try{let e=t.trim()?JSON.parse(t):{},n=M(x({},this.body??{mode:"json"}),{mode:"json",content:e});this.bodyChange.emit(n)}catch{this.jsonError.set("JSON \u4E0D\u5408\u6CD5\uFF08\u7EE7\u7EED\u8F93\u5165\u5373\u53EF\uFF09")}}formatJson(){if(this.mode()!=="json")return;let e=this.body?.content;try{let n=JSON.stringify(e??{},null,2);this._jsonText.set(n),this.jsonError.set("");let o=M(x({},this.body??{mode:"json"}),{mode:"json",content:e??{}});this.bodyChange.emit(o),this.msg.success("\u5DF2\u683C\u5F0F\u5316")}catch{this.msg.error("\u683C\u5F0F\u5316\u5931\u8D25")}}setUrlRows(t){let e={};for(let o of t){if(!o.enabled)continue;let r=(o.key??"").trim();r&&(e[r]=String(o.value??""))}let n=M(x({},this.body??{mode:"urlencoded"}),{mode:"urlencoded",content:e});this.bodyChange.emit(n)}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=E({type:i,selectors:[["app-body-editor"]],inputs:{body:"body"},outputs:{bodyChange:"bodyChange"},features:[ee],decls:13,vars:4,consts:[[1,"wrap"],[1,"bar"],[1,"mode",3,"ngModelChange","ngModel"],[3,"nzValue","nzLabel"],["nz-input","","placeholder","content-type\uFF08\u53EF\u9009\uFF09",1,"ctype",3,"ngModelChange","ngModel"],["nz-button","","nzType","default"],[1,"main"],[1,"empty"],["nz-input","","placeholder","\u6587\u672C\u5185\u5BB9",1,"ta",3,"ngModel"],["keyLabel","Key","valueLabel","Value","keyPlaceholder","a","valuePlaceholder","1",3,"rows"],["nz-button","","nzType","default",3,"click"],["nz-input","","placeholder","\u6587\u672C\u5185\u5BB9",1,"ta",3,"ngModelChange","ngModel"],["nz-input","","placeholder","{ }",1,"ta",3,"ngModelChange","ngModel"],[1,"err"],["keyLabel","Key","valueLabel","Value","keyPlaceholder","a","valuePlaceholder","1",3,"rowsChange","rows"]],template:function(e,n){if(e&1&&(l(0,"div",0)(1,"div",1)(2,"nz-select",2),C("ngModelChange",function(r){return n.setMode(r)}),S(3,Ui,1,2,"nz-option",3,ue),a(),l(5,"input",4),C("ngModelChange",function(r){return n.setContentType(r)}),a(),g(6,$i,2,0,"button",5),a(),l(7,"div",6),g(8,Hi,2,0,"div",7)(9,Wi,1,1,"textarea",8)(10,Zi,2,2)(11,Gi,1,1,"app-kv-table",9)(12,Qi,2,0,"div",7),a()()),e&2){let o;s(2),d("ngModel",n.mode()),s(),R(n.modes),s(2),d("ngModel",n.contentType()),s(),f(n.mode()==="json"?6:-1),s(2),f((o=n.mode())==="none"?8:o==="text"?9:o==="json"?10:o==="urlencoded"?11:12)}},dependencies:[N,P,$,B,K,I,V,D,X,O,H,te,fe,he,we],styles:[".wrap[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%;min-height:260px}.bar[_ngcontent-%COMP%]{display:flex;gap:10px;align-items:center;padding:8px 0;border-bottom:1px solid #f0f0f0}.mode[_ngcontent-%COMP%]{width:140px}.ctype[_ngcontent-%COMP%]{flex:1 1 auto}.main[_ngcontent-%COMP%]{flex:1 1 auto;overflow:auto;padding-top:10px}.ta[_ngcontent-%COMP%]{width:100%;height:100%;min-height:240px;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:12px}.empty[_ngcontent-%COMP%]{padding:12px;opacity:.7}.err[_ngcontent-%COMP%]{margin-top:8px;color:#a8071a;font-size:12px}"]})};var _t=class i{http=q(dn);base="/api/client";async listRequests(t,e){let n=new pe().set("scope",t);return e&&(n=n.set("projectId",e)),await j(this.http.get(`${this.base}/requests`,n))}async saveRequest(t,e,n){return await j(this.http.post(`${this.base}/requests`,{scope:t,projectId:e,request:n}))}async updateRequest(t,e,n){return await j(this.http.post(`${this.base}/requests/update`,{scope:t,projectId:e,request:n}))}async deleteRequest(t,e,n){let o=new pe().set("scope",e);return n&&(o=o.set("projectId",n)),await j(this.http.delete(`${this.base}/requests/${t}`,o))}async send(t){return await j(this.http.post(`${this.base}/send`,t))}async listHistory(t,e){let n=new pe().set("scope",t);return e&&(n=n.set("projectId",e)),await j(this.http.get(`${this.base}/history`,n))}async listEnvs(t,e){let n=new pe().set("scope",t);return e&&(n=n.set("projectId",e)),await j(this.http.get(`${this.base}/envs`,n))}async saveEnv(t,e,n){return await j(this.http.post(`${this.base}/envs`,{scope:t,projectId:e,env:n}))}async deleteEnv(t,e,n){let o=new pe().set("scope",e);return n&&(o=o.set("projectId",n)),await j(this.http.delete(`${this.base}/envs/${t}`,o))}async listCollections(t,e){let n=new pe().set("scope",t);return e&&(n=n.set("projectId",e)),await j(this.http.get(`${this.base}/collections`,n))}async createCollection(t){return await j(this.http.post(`${this.base}/collections`,t))}async updateCollection(t,e,n,o){let r=new pe().set("scope",n).set("projectId",o??"");return await j(this.http.post(`${this.base}/collections/${t}`,e,r))}async deleteCollection(t,e,n){let o=new pe().set("scope",e).set("projectId",n??"");return await j(this.http.delete(`${this.base}/collections/${t}`,o))}static \u0275fac=function(e){return new(e||i)};static \u0275prov=Ee({token:i,factory:i.\u0275fac,providedIn:"root"})};var Yi=/\{\{\s*([a-zA-Z0-9_.-]+)\s*\}\}/g;function kn(i=[]){let t={};for(let e of i)e.enabled&&(t[e.key]=String(e.value??""));return t}function Xi(i,t){let e=new Set;return{out:i.replace(Yi,(o,r)=>r in t?String(t[r]??""):(e.add(r),`{{${r}}}`)),missing:[...e]}}function qn(i,t){let e=new Set;for(let n of i){if(!n)continue;let{missing:o}=Xi(n,t);o.forEach(r=>e.add(r))}return[...e]}var In=Fe(Ue());function Oe(i){if(!i)return[];let t=i;try{t=new URL(i).pathname||""}catch{t=i.split("?")[0].split("#")[0]||"";let b=t.indexOf("/");b>=0&&(t=t.slice(b))}let e=eo(t),n=[],o=/(?:^|\/):([A-Za-z_][A-Za-z0-9_]*)/g,r;for(;r=o.exec(e);)n.push(r[1]);let p=/\{([A-Za-z_][A-Za-z0-9_]*)\}/g;for(;r=p.exec(e);)n.push(r[1]);return n}function eo(i){try{return decodeURIComponent(i)}catch{return i}}function Dt(i,t){let e=Oe(i),n=Array.isArray(t)?t:[],o=new Map;for(let p of n){let b=(p.key??"").trim();b&&(o.has(b)||o.set(b,p))}return e.map(p=>{let b=o.get(p);return b?M(x({},b),{key:p,enabled:!0}):{key:p,value:"",description:"",enabled:!0,id:(0,In.uniqueId)()}})}var Pn=Fe(Ue());function Vt(i){return(i??[]).map(t=>({key:t.key,value:t.value,enabled:t.enabled,id:(0,Pn.uniqueId)(),description:t.description}))}function Sn(i,t){let e=new Map(t?.map(n=>[n.key,n]));return i.filter(n=>n.key?.trim()).map(n=>({key:n.key.trim(),value:String(n.value??""),enabled:n.enabled!==!1,secret:e.get(n.key)?.secret}))}function to(i,t){if(!t)return!0;let e=(i.name??"").toLowerCase(),n=(i.url??"").toLowerCase();return e.includes(t)||n.includes(t)}function Ot(i,t,e){let n=e?.trim().toLowerCase()||"",o=new Map;for(let z of i??[]){let L=z.parentId??null,G=o.get(L)??[];G.push(z),o.set(L,G)}let r=new Map;for(let z of t??[]){if(!to(z,n))continue;let L=z.collectionId??null,G=r.get(L)??[];G.push(z),r.set(L,G)}let p=(z,L)=>{let G=String(z.id),Tt=z.kind??"collection",Fn=z.name??"\u672A\u547D\u540D",Et=`c:${G}`,Bn=o.get(G)??[],Kn=r.get(G)??[];return{key:Et,kind:Tt,id:G,title:Fn,name:z.name,parentKey:L,children:[...Bn.map(me=>p(me,Et)),...Kn.map(me=>({key:`r:${String(me.id)}`,kind:"request",id:me.id,title:me.name??"\u672A\u547D\u540D",name:me.name,subtitle:me.url??"",method:me.method??"",parentKey:Et,children:[]}))]}},b=o.get(null)??[],T=r.get(null)??[];return[...b.map(z=>p(z,null)),...T.map(z=>({key:`r:${String(z.id)}`,kind:"request",id:String(z.id),title:z.name??"\u672A\u547D\u540D",name:z.name,subtitle:z.url??"",method:z.method??"",parentKey:null,children:[]}))]}var Dn=Fe(Ue());var no=i=>({$implicit:i,level:0}),io=(i,t)=>({$implicit:i,level:t}),Rn=(i,t)=>t.key;function oo(i,t){if(i&1&&(l(0,"div",8),m(1),a()),i&2){let e=c(2);s(),k(e.nameErr())}}function ro(i,t){if(i&1){let e=w();l(0,"label",5),m(1,"\u540D\u79F0"),a(),l(2,"nz-input-wrapper")(3,"input",6),C("ngModelChange",function(o){u(e);let r=c();return _(r.name.set(o))}),a(),h(4,"nz-icon",7),a(),g(5,oo,2,1,"div",8)}if(i&2){let e=c();s(3),d("ngModel",e.name()),s(),d("nzType",e.iconForKind()),s(),f(e.nameErr()?5:-1)}}function lo(i,t){if(i&1&&_e(0,12),i&2){let e=t.$implicit;c(2);let n=Q(9);d("ngTemplateOutlet",n)("ngTemplateOutletContext",Ke(2,no,e))}}function ao(i,t){i&1&&(l(0,"div",13),m(1,"\u6682\u65E0\u76EE\u5F55"),a())}function so(i,t){if(i&1&&(l(0,"div",8),m(1),a()),i&2){let e=c(2);s(),k(e.moveErr())}}function co(i,t){if(i&1){let e=w();l(0,"div",9)(1,"div",10),C("click",function(){u(e);let o=c();return _(o.select(null))}),h(2,"nz-icon",11),l(3,"span"),m(4,"\u6839\u76EE\u5F55"),a()(),S(5,lo,1,4,"ng-container",12,Rn),g(7,ao,2,0,"div",13),a(),g(8,so,2,1,"div",8)}if(i&2){let e=c();s(),Y("selected",e.selectedKey()===null),s(4),R(e.filteredNodes()),s(2),f(e.filteredNodes().length?-1:7),s(),f(e.moveErr()?8:-1)}}function po(i,t){if(i&1&&_e(0,12),i&2){let e=t.$implicit,n=c(2).level;c();let o=Q(9);d("ngTemplateOutlet",o)("ngTemplateOutletContext",Jt(2,io,e,n+1))}}function mo(i,t){if(i&1&&S(0,po,1,5,"ng-container",12,Rn),i&2){let e=c().$implicit;R(e.children)}}function uo(i,t){if(i&1){let e=w();l(0,"div",14),C("click",function(){let o=u(e).$implicit,r=c();return _(r.select(o.key))}),l(1,"button",15),C("click",function(o){let r=u(e).$implicit;return c().toggle(r.key),_(o.stopPropagation())}),h(2,"nz-icon",16),a(),h(3,"nz-icon",17),l(4,"span",18),m(5),a()(),g(6,mo,2,0)}if(i&2){let e=t.$implicit,n=t.level,o=c();Ht("padding-left",8+n*16,"px"),Y("selected",o.selectedKey()===e.key),s(),d("disabled",!(e.children!=null&&e.children.length)),s(),d("nzType",e.children!=null&&e.children.length?o.expanded(e.key)?"down":"right":"minus"),s(),d("nzType",e.kind==="folder"?"folder":"database"),s(2),k(e.title),s(),f(((e.children==null?null:e.children.length)??0)&&o.expanded(e.key)?6:-1)}}function _o(i){return i?`c:${i}`:null}function Co(i){return i&&i.startsWith("c:")?i.slice(2):null}var Te=class i{data=q(fn);modalRef=q(Xe);q=A("");name=A("");selectedKey=A(null);expandedMap=A({});mode=v(()=>this.data.mode??this.data.handleType);showParentPicker=v(()=>this.mode()==="move"||this.mode()==="pick");showName=v(()=>this.mode()==="create"||this.mode()==="rename");iconForKind=v(()=>{let t=this.data.kind??this.data.createBody?.kind??"collection";return t==="folder"?"folder":t==="request"?"api":"database"});ngOnInit(){let t=this.mode();if(t==="create"){let r=this.data.createBody;this.name.set(r?.name??""),this.selectedKey.set(null);return}if(t==="rename"||t==="update"){let r=this.data;this.name.set(r?.initialName??""),this.selectedKey.set(null);return}let e=this.data.initialParentId;this.selectedKey.set(e?e.startsWith("c:")?e:_o(e):null);let n=this.data.nodes??[],o={};for(let r of n)o[r.key]=!0;this.expandedMap.set(o)}expanded(t){return!!this.expandedMap()[t]}toggle(t){let e=x({},this.expandedMap());e[t]=!e[t],this.expandedMap.set(e)}select(t){this.selectedKey.set(t)}forbiddenKeys=v(()=>{if(this.mode()!=="move"||this.mode()!=="pick")return new Set;let t=this.data.target;if(!t||t.kind==="request")return new Set;let e=`c:${t.id}`,n=new Set([e]),o=this.data.nodes??[],r=b=>{for(let T of b.children??[])T.kind!=="request"&&(n.add(T.key),r(T))},p=b=>{for(let T of b)T.key===e?r(T):T.children?.length&&p(T.children)};return p(o),n});nodesForPicker=v(()=>{let t=(this.data.nodes??[]).filter(o=>o.kind!=="request"),e=this.forbiddenKeys(),n=o=>{let r=[];for(let p of o){if(p.kind==="request"||e.has(p.key))continue;let b=n(p.children??[]);r.push(M(x({},p),{children:b}))}return r};return n(t)});filteredNodes=v(()=>{if(!this.showParentPicker())return[];let t=this.q().trim().toLowerCase();if(!t)return this.nodesForPicker();let e=b=>(b.title??"").toLowerCase().includes(t),n=b=>{let T=[];for(let z of b){let L=n(z.children??[]);(e(z)||L.length)&&T.push(M(x({},z),{children:L}))}return T},o=n(this.nodesForPicker()),r=x({},this.expandedMap()),p=b=>{for(let T of b)T.children?.length&&(r[T.key]=!0),T.children?.length&&p(T.children)};return p(o),this.expandedMap.set(r),o});nameErr=v(()=>{if(!this.showName())return"";let t=(this.name()??"").trim();return t?t.length>50?"\u540D\u79F0\u8FC7\u957F\uFF08<= 50\uFF09":"":"\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A"});moveErr=v(()=>(this.showParentPicker(),""));canSubmit=v(()=>this.showName()&&this.nameErr()?!1:(this.showParentPicker(),!0));ok(){let t=this.mode();if(t==="rename"||t==="update"){let n={name:(this.name()??"").trim()};this.modalRef.close(n);return}if(t==="create"){let n=this.data.createBody,o=M(x({},n),{name:(this.name()??"").trim(),parentId:n.parentId??null});this.modalRef.close(o);return}let e=Co(this.selectedKey());this.modalRef.close({parentId:e})}cancel(){this.modalRef.close(null)}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=E({type:i,selectors:[["app-collection-modal"]],decls:10,vars:3,consts:[["nodeTpl",""],[1,"modal-body"],[1,"footer"],["nz-button","",3,"click"],["nz-button","","nzType","primary",3,"click","disabled"],[1,"label"],["nz-input","","placeholder","\u8BF7\u8F93\u5165\u540D\u79F0","autofocus","",3,"ngModelChange","ngModel"],["nzInputPrefix","","nzTheme","outline",3,"nzType"],[1,"hint","err"],[1,"picker"],[1,"row","root",3,"click"],["nzType","home"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"empty"],[1,"row",3,"click"],["nz-button","","nzType","text","nzSize","small",1,"chev",3,"click","disabled"],[3,"nzType"],[1,"icon",3,"nzType"],[1,"title"]],template:function(e,n){if(e&1){let o=w();l(0,"div",1),g(1,ro,6,3),g(2,co,9,4),a(),l(3,"div",2)(4,"button",3),C("click",function(){return u(o),_(n.cancel())}),m(5,"\u53D6\u6D88"),a(),l(6,"button",4),C("click",function(){return u(o),_(n.ok())}),m(7," \u786E\u5B9A "),a()(),W(8,uo,7,9,"ng-template",null,0,Ce)}e&2&&(s(),f(n.showName()?1:-1),s(),f(n.showParentPicker()?2:-1),s(4),d("disabled",!n.canSubmit()))},dependencies:[N,We,P,$,B,K,O,H,ge,Ze,I,V,D,X,U,J],styles:[".modal-body[_ngcontent-%COMP%]{display:grid;gap:12px}.label[_ngcontent-%COMP%]{font-weight:600}.hint[_ngcontent-%COMP%]{font-size:12px;opacity:.75}.hint.err[_ngcontent-%COMP%]{color:#cf1322;opacity:1}.picker[_ngcontent-%COMP%]{max-height:52vh;overflow:auto;border:1px solid rgba(0,0,0,.08);border-radius:12px;padding:8px;display:flex;flex-direction:column;gap:6px}.row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;padding:8px;border-radius:10px;cursor:pointer;-webkit-user-select:none;user-select:none;transition:background .15s;border:1px solid transparent}.row[_ngcontent-%COMP%]:hover{background:#0000000a}.row.selected[_ngcontent-%COMP%]{background:#00000014;border-color:#00000014}.row.root[_ngcontent-%COMP%]{font-weight:600}.chev[_ngcontent-%COMP%]{flex:0 0 auto}.chev[_ngcontent-%COMP%] nz-icon[_ngcontent-%COMP%]{font-size:12px;transition:transform .15s}.icon[_ngcontent-%COMP%]{opacity:.75}.title[_ngcontent-%COMP%]{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.empty[_ngcontent-%COMP%]{padding:16px;opacity:.6;text-align:center}.footer[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;gap:8px;margin-top:16px}"]})};var Ct=class i{modal=q(et);async createCollection(t){let e=this.modal.create({nzTitle:t.kind==="folder"?"\u65B0\u5EFA\u76EE\u5F55":"\u65B0\u5EFA\u96C6\u5408",nzContent:Te,nzFooter:null,nzWidth:520,nzMaskClosable:!1,nzData:{mode:"create",createBody:t.createBody,nodes:t.nodes}});return await j(e.afterClose)}async renameCollection(t){let e=this.modal.create({nzTitle:"\u91CD\u547D\u540D",nzContent:Te,nzFooter:null,nzWidth:520,nzMaskClosable:!1,nzData:{mode:"rename",kind:t.kind,nodes:t.nodes,targetId:t.targetId,initialName:t.initialName}});return await j(e.afterClose)}async moveTarget(t){let e=this.modal.create({nzTitle:"\u79FB\u52A8\u5230",nzContent:Te,nzFooter:null,nzWidth:520,nzMaskClosable:!1,nzData:{mode:"move",nodes:t.nodes,target:t.target,initialParentId:t.initialParentId??null}});return await j(e.afterClose)}async pickCollection(t){let e=this.modal.create({nzTitle:"\u9009\u62E9\u96C6\u5408/\u76EE\u5F55",nzContent:Te,nzFooter:null,nzWidth:520,nzMaskClosable:!1,nzData:{mode:"pick",nodes:t.nodes}});return await j(e.afterClose)}static \u0275fac=function(e){return new(e||i)};static \u0275prov=Ee({token:i,factory:i.\u0275fac,providedIn:"root"})};function go(){return Date.now()}function fo(i){let t=Math.random().toString(16).slice(2,10);return`${i}_${t}_${Date.now().toString(16)}`}var be=class i{api=q(_t);msg=q(Se);projectState=q(hn);collectionModal=q(Ct);scope=A("project");loading=A(!1);q=A("");sending=A(!1);requests=A([]);activeRequestId=A(null);collections=A([]);activeCollectionId=A(null);nodes=v(()=>Ot(this.collections(),this.requests(),"").filter(t=>t.kind!=="request"));filteredNodes=v(()=>{let t=this.q().toLowerCase();return t?Ot(this.collections(),this.requests(),t):this.nodes()});historyOpen=A(!1);historyLoading=A(!1);histories=A([]);envs=A([]);envLoading=A(!1);activeEnvId=A(null);lastResult=A(null);projectId=v(()=>this.projectState.currentProject()?.id??"");activeRequest=A(null);activeEnv=v(()=>{let t=this.activeEnvId();return t?this.envs().find(e=>e.id===t)??null:null});envVarRecord=v(()=>{let t=this.activeEnv();return t?kn(t.variables):{}});collectionPath=v(()=>{let t=this.activeCollectionId();if(!t)return null;let e=this.collections().find(r=>r.id===t);if(!e)return null;let n=[],o=`${e.id}`;for(;o;){let r=this.collections().find(p=>p.id===o);r?(n.unshift(r.name||"\u672A\u547D\u540D"),o=r.parentId?`${r.parentId}`:null):o=null}return n.join(" / ")});projectCtx=v(()=>{let t=this.projectState.currentProject();return t?{scope:"project",projectId:t.id}:null});constructor(){kt(()=>{this.scope()!=="project"||!this.projectId()||this.loadAll()}),kt(()=>{if(this.scope()!=="project"){this.loadEnvs();return}this.projectId()&&this.loadEnvs()})}async loadAll(){let t=this.projectCtx();if(t){this.loading.set(!0);try{let[e,n]=await Promise.all([this.api.listCollections(t.scope,t.projectId),this.api.listRequests(t.scope,t.projectId)]);this.collections.set(e??[]),this.requests.set(n??[])}finally{this.loading.set(!1)}}}async reloadCollections(){let t=this.projectCtx();if(!t)return;let e=await this.api.listCollections(t.scope,t.projectId);this.collections.set(e??[])}async reloadRequests(){let t=this.projectCtx();if(!t)return;let e=await this.api.listRequests(t.scope,t.projectId);this.requests.set(e??[])}async loadRequests(){let t=this.projectCtx();if(t){this.loading.set(!0);try{let e=await this.api.listRequests(t.scope,t.projectId);this.requests.set(e);let n=this.activeRequestId();if(n&&e.some(o=>o.id===n))return;e.length?this.setActive(e[0]):(this.setActive(null),this.activeRequestId.set(null),this.lastResult.set(null),this.newRequest())}catch(e){this.msg.error(e?.message??"\u52A0\u8F7D\u8BF7\u6C42\u5931\u8D25")}finally{this.loading.set(!1)}}}selectRequest(t){let e=this.requests().find(n=>n.id===t)||null;this.setActive(e),this.activeCollectionId.set(e?.collectionId??null)}selectCollection(t){this.activeCollectionId.set(t)}async newCollection(t){let e=this.projectCtx();if(!e)return;let n={scope:e.scope,projectId:e.projectId,name:t.name??"",kind:t.kind??"collection",parentId:t.parentId??null},o=this.nodes(),r=await this.collectionModal.createCollection({createBody:n,nodes:o,kind:n.kind,initialParentId:n.parentId??null});if(r){let p=await this.api.createCollection(r);this.msg.success("\u521B\u5EFA\u6210\u529F"),this.collections.update(b=>[...b,p]),this.activeCollectionId.set(p.id)}}async deleteCollection(t,e){if(e==="request"){this.removeRequest(t);return}if(await this.api.deleteCollection(t,this.scope(),this.projectId()),this.msg.success("\u5DF2\u5220\u9664"),this.collections.update(n=>n.filter(o=>o.id!==t)),this.activeCollectionId()===t){let n=this.collections()[0];this.activeCollectionId.set(n?.id??null)}}async moveCollection(t,e){let n="";if(e=="request"){let p=this.requests().find(b=>b.id===t);if(!p){this.msg.error("\u8BF7\u6C42\u4E0D\u5B58\u5728");return}n=p.collectionId??""}else{let p=this.collections().find(b=>b.id===t);if(!p){this.msg.error("\u96C6\u5408\u4E0D\u5B58\u5728");return}n=p.parentId??""}let o=this.nodes(),{parentId:r}=await this.collectionModal.moveTarget({nodes:o,target:{kind:e,id:t},initialParentId:n})||{};if(r!==void 0)if(e==="request"){let p=this.requests().find(T=>T.id===t);if(!p){this.msg.error("\u8BF7\u6C42\u4E0D\u5B58\u5728");return}let b={collectionId:r??null,id:p.id};p.collectionId=r??null,await this.api.updateRequest(this.scope(),this.projectId(),b),this.requests.update(T=>T.map(z=>z.id===t?M(x({},z),{collectionId:r??null}):z)),this.setActive(p.id===this.activeRequestId()?M(x({},p),{collectionId:r??null}):p),this.msg.success("\u4FEE\u6539\u6210\u529F")}else{let p={parentId:r??null},b=await this.api.updateCollection(t,p,this.scope(),this.projectId());this.collections.update(T=>T.map(z=>z.id===t?b:z)),this.activeCollectionId.set(b.id),this.msg.success("\u4FEE\u6539\u6210\u529F")}}async renameCollection(t,e){let n="";if(e=="request"){let p=this.requests().find(b=>b.id===t);if(!p){this.msg.error("\u8BF7\u6C42\u4E0D\u5B58\u5728");return}n=p.name??""}else{let p=this.collections().find(b=>b.id===t);if(!p){this.msg.error("\u96C6\u5408\u4E0D\u5B58\u5728");return}n=p.name??""}let o=this.nodes(),r=await this.collectionModal.renameCollection({nodes:o,kind:e,targetId:t,initialName:n});if(r)if(e==="request")await this.api.updateRequest(this.scope(),this.projectId(),{id:t,name:r.name}),this.requests.update(p=>p.map(b=>b.id===t?M(x({},b),{name:r.name??b.name}):b)),this.msg.success("\u4FEE\u6539\u6210\u529F"),this.reloadRequests();else{let p=await this.api.updateCollection(t,r,this.scope(),this.projectId());this.collections.update(b=>b.map(T=>T.id===t?p:T)),this.msg.success("\u4FEE\u6539\u6210\u529F"),this.reloadCollections()}}newRequest(t={}){let e=this.projectId();if(this.scope()==="project"&&!e){this.msg.warning("\u8BF7\u5148\u9009\u62E9\u9879\u76EE");return}let n=go(),o={id:fo("req"),name:"",method:"GET",url:"",collectionId:t.collectionId??null,query:[],pathParams:[],headers:[],body:{mode:"none"},auth:{type:"none"},options:{followRedirects:!0,timeoutMs:3e4},tags:[],createdAt:n,updatedAt:n};this.setActive(o),this.activeCollectionId.set(t.collectionId??null)}patchActive(t){let e=this.activeRequest();if(!e)return;let n=M(x(x({},e),t),{updatedAt:Date.now()});this.activeRequest.set(n)}async saveActive(){let t=this.activeRequest();if(!t)return;let e=this.scope(),n=e==="project"?this.projectId():void 0;if(e==="project"&&!n)throw new Error("projectId missing");if(!t.name?.trim()){this.msg.warning("\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A");return}if(!t.url?.trim()){this.msg.warning("URL \u4E0D\u80FD\u4E3A\u7A7A");return}if(!t.collectionId){let o=this.nodes(),{parentId:r}=await this.collectionModal.pickCollection({nodes:o})||{};t.collectionId=r??null}this.loading.set(!0);try{await this.api.saveRequest(e,n,t),this.msg.success("\u5DF2\u4FDD\u5B58"),this.activeRequest.set(x({},t)),await this.loadRequests()}catch(o){this.msg.error(o?.message??"\u4FDD\u5B58\u5931\u8D25")}finally{this.loading.set(!1)}}async sendActive(){let t=this.activeRequest();t&&await this.sendResolvedRequest(t)}async removeRequest(t){await this.api.deleteRequest(t,this.scope(),this.projectId()),this.msg.success("\u5DF2\u5220\u9664");let e=this.requests().filter(n=>n.id!==t);if(this.requests.set(e),this.activeRequestId()===t){let n=e[0]?.id??null;this.activeRequestId.set(n)}}setActive(t){!t||!t.id||t.id===this.activeRequestId()||(t.headers.length&&(t.headers=this.ensureKvId(t.headers)),t.query.length&&(t.query=this.ensureKvId(t.query)),t.pathParams.length&&(t.pathParams=this.ensureKvId(t.pathParams)),this.activeRequest.set(t),this.activeRequestId.set(t.id),this.lastResult.set(null))}ensureKvId(t){return t.map(e=>(e.id||(e.id=(0,Dn.uniqueId)()),e))}openHistory(){this.historyOpen.set(!0),this.loadHistory()}closeHistory(){this.historyOpen.set(!1)}async loadHistory(){this.historyLoading.set(!0);try{let t=await this.api.listHistory(this.scope(),this.projectId());this.histories.set(t)}finally{this.historyLoading.set(!1)}}async replayHistory(t){await this.sendResolvedRequest(t.requestSnapshot)}async sendResolvedRequest(t){let e=this.scope(),n=e==="project"?this.projectId():void 0;if(e==="project"&&!n){this.msg.warning("\u8BF7\u5148\u9009\u62E9\u9879\u76EE");return}this.sending.set(!0),this.lastResult.set(null);try{let o=await this.api.send({scope:e,projectId:n||void 0,request:t,envId:this.activeEnvId()??void 0,projectRoot:this.projectState.currentProject()?.root});this.lastResult.set(o),o.error?this.msg.error(`${o.error.code}: ${o.error.message}`):this.msg.success(`HTTP ${o.response?.status??""} (${o.metrics.durationMs}ms)`)}catch(o){this.msg.error(o?.message??"\u53D1\u9001\u5931\u8D25")}finally{this.sending.set(!1)}}async loadEnvs(){let t=this.scope(),e=t==="project"?this.projectId():void 0;if(!(t==="project"&&!e)){this.envLoading.set(!0);try{let n=await this.api.listEnvs(t,e);this.envs.set(n);let o=this.activeEnvId();if(o&&n.some(r=>r.id===o))return;this.activeEnvId.set(n[0]?.id??null)}finally{this.envLoading.set(!1)}}}setActiveEnv(t){this.activeEnvId.set(t)}async saveEnv(t){let e=this.scope(),n=e==="project"?this.projectId():void 0;await this.api.saveEnv(e,n||void 0,t),await this.loadEnvs()}async deleteEnv(t){await this.api.deleteEnv(t,this.scope(),this.projectId()),this.activeEnvId()===t&&this.activeEnvId.set(null),await this.loadEnvs()}static \u0275fac=function(e){return new(e||i)};static \u0275prov=Ee({token:i,factory:i.\u0275fac,providedIn:"root"})};var ho=["class","component"],vo=(i,t)=>t.id;function yo(i,t){if(i&1){let e=w();l(0,"div",9),C("click",function(){let o=u(e).$implicit,r=c();return _(r.selectEditEnv(o.id))}),l(1,"div",10),m(2),a(),l(3,"div",11),m(4),a()()}if(i&2){let e,n=t.$implicit,o=c();Y("active",n.id===((e=o.draft())==null?null:e.id)),s(2),k(n.name),s(2),le("",n.variables.length," vars")}}function xo(i,t){i&1&&(l(0,"div",6),m(1,"\u6682\u65E0\u73AF\u5883"),a())}function wo(i,t){i&1&&(l(0,"div",6),m(1,"\u9009\u62E9\u4E00\u4E2A\u73AF\u5883\u8FDB\u884C\u7F16\u8F91"),a())}function bo(i,t){if(i&1){let e=w();l(0,"div",8)(1,"div",12)(2,"div",13),m(3,"\u540D\u79F0"),a(),l(4,"input",14),C("ngModelChange",function(o){u(e);let r=c();return _(r.setName(o))}),a()(),l(5,"div",12)(6,"div",13),m(7,"\u524D\u7F6EURL"),a(),l(8,"input",14),C("ngModelChange",function(o){u(e);let r=c();return _(r.setBaseUrl(o))}),a()(),l(9,"div",15)(10,"app-kv-table",16),C("rowsChange",function(o){u(e);let r=c();return _(r.varsRows.set(o))}),a()(),l(11,"div",17)(12,"button",3),C("click",function(){u(e);let o=c();return _(o.save())}),m(13,"\u4FDD\u5B58"),a(),l(14,"button",18),C("nzOnConfirm",function(){u(e);let o=c();return _(o.remove())}),m(15," \u5220\u9664 "),a(),l(16,"button",19),C("click",function(){u(e);let o=c();return _(o.useThisEnv())}),m(17,"\u8BBE\u4E3A\u5F53\u524D"),a()()()}if(i&2){let e=c();s(4),d("ngModel",e.draft().name),s(4),d("ngModel",e.draft().baseUrl),s(2),d("rows",e.varsRows())}}function Vn(){return Date.now()}function zo(i){let t=Math.random().toString(16).slice(2,10);return`${i}_${t}_${Date.now().toString(16)}`}var gt=class i{envChange=new y;store=q(be);modalRef=q(Xe);msg=q(Se);draft=A(null);varsRows=A([]);selectEditEnv(t){this.store.activeEnvId.set(t);let e=this.store.envs().find(n=>n.id===t);e&&(this.draft.set(M(x({},e),{variables:e.variables})),this.varsRows.set(Vt(e.variables)))}createEnv(){let t=Vn(),e={id:zo("env"),scope:"project",name:"\u672A\u547D\u540D\u73AF\u5883",variables:[],createdAt:t,updatedAt:t};this.draft.set(e),this.varsRows.set(Vt(e.variables))}setName(t){let e=this.draft();e&&this.draft.set(M(x({},e),{name:t}))}setBaseUrl(t){let e=this.draft();e&&this.draft.set(M(x({},e),{baseUrl:t}))}async save(){let t=this.draft();if(!t)return;let e=M(x({},t),{variables:Sn(this.varsRows(),t.variables),updatedAt:Vn()});await this.store.saveEnv(e),this.store.activeEnvId.set(e.id),this.msg.success("\u73AF\u5883\u53D8\u91CF\u4FDD\u5B58\u6210\u529F"),this.draft.set(e)}async remove(){let t=this.store.activeEnvId();t&&(await this.store.deleteEnv(t),this.store.activeEnvId.set(null),this.draft.set(null),this.varsRows.set([]),this.msg.success("\u73AF\u5883\u53D8\u91CF\u5220\u9664\u6210\u529F"))}useThisEnv(){let t=this.store.activeEnvId();t&&this.store.setActiveEnv(t)}close(){this.modalRef.close()}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=E({type:i,selectors:[["app-env-modal",8,"component"]],outputs:{envChange:"envChange"},attrs:ho,decls:12,vars:2,consts:[[1,"drawer"],[1,"left"],[1,"toolbar"],["nz-button","","nzType","primary",3,"click"],[1,"env-list"],[1,"env-item",3,"active"],[1,"empty"],[1,"right"],[1,"form"],[1,"env-item",3,"click"],[1,"name"],[1,"meta"],[1,"row"],[1,"label"],["nz-input","",3,"ngModelChange","ngModel"],[1,"vars"],["keyLabel","Key","valueLabel","Value","keyPlaceholder","TOKEN","valuePlaceholder","xxx",3,"rowsChange","rows"],[1,"actions"],["nz-button","","nzType","default","nzDanger","","nz-popconfirm","","nzPopconfirmTitle","\u786E\u8BA4\u5220\u9664\u8BE5\u73AF\u5883\uFF1F",3,"nzOnConfirm"],["nz-button","","nzType","default",3,"click"]],template:function(e,n){if(e&1&&(l(0,"div",0)(1,"div",1)(2,"div",2)(3,"button",3),C("click",function(){return n.createEnv()}),m(4,"\u65B0\u5EFA"),a()(),l(5,"div",4),S(6,yo,5,4,"div",5,vo),g(8,xo,2,0,"div",6),a()(),l(9,"div",7),g(10,wo,2,0,"div",6)(11,bo,18,3,"div",8),a()()),e&2){let o;s(6),R(n.store.envs()),s(2),f(n.store.envs().length?-1:8),s(2),f((o=n.draft())!=null&&o.id?11:10)}},dependencies:[N,P,$,B,K,we,I,V,D,X,O,H,Re,tt],styles:[".drawer[_ngcontent-%COMP%]{display:grid;grid-template-columns:180px 1fr;gap:12px;height:100%}.left[_ngcontent-%COMP%]{border-right:1px solid #f0f0f0;padding-right:12px}.toolbar[_ngcontent-%COMP%]{padding-bottom:10px}.env-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:8px}.env-item[_ngcontent-%COMP%]{padding:8px;border:1px solid #f0f0f0;border-radius:8px;cursor:pointer}.env-item.active[_ngcontent-%COMP%]{background:#f5f5f5}.name[_ngcontent-%COMP%]{font-weight:600}.meta[_ngcontent-%COMP%]{font-size:12px;opacity:.7}.right[_ngcontent-%COMP%]{min-width:0}.empty[_ngcontent-%COMP%]{padding:12px;opacity:.7}.row[_ngcontent-%COMP%]{display:grid;grid-template-columns:70px 1fr;gap:10px;align-items:center;margin-bottom:10px}.label[_ngcontent-%COMP%]{font-size:14px;opacity:.8}.vars[_ngcontent-%COMP%]{height:420px}.actions[_ngcontent-%COMP%]{display:flex;gap:8px;margin-top:12px}"]})};var Mo=(i,t)=>t.id;function To(i,t){if(i&1&&h(0,"nz-option",2),i&2){let e=t.$implicit;d("nzValue",e.id)("nzLabel",e.name)}}var ft=class i{store=q(be);modalService=q(et);openEnvModal(){let t=this.modalService.create({nzTitle:"\u73AF\u5883\u53D8\u91CF",nzFooter:null,nzMaskClosable:!1,nzContent:gt,nzWidth:"1020px",nzCentered:!0});t.afterOpen.subscribe(()=>{let e=t.getContentComponent();e&&this.store.activeEnvId()?e.selectEditEnv(this.store.activeEnvId()??""):e.createEnv()})}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=E({type:i,selectors:[["app-env-picker"]],decls:6,vars:3,consts:[[1,"picker"],[1,"sel",3,"ngModelChange","nzPlaceHolder","ngModel","nzAllowClear"],[3,"nzValue","nzLabel"],["nz-button","","nzType","text","nz-tooltip","","nzTooltipTitle","\u7BA1\u7406\u73AF\u5883\u53D8\u91CF",3,"click"],["nzType","setting","nzTheme","outline"]],template:function(e,n){e&1&&(l(0,"div",0)(1,"nz-select",1),C("ngModelChange",function(r){return n.store.setActiveEnv(r)}),S(2,To,1,2,"nz-option",2,Mo),a(),l(4,"button",3),C("click",function(){return n.openEnvModal()}),h(5,"nz-icon",4),a()()),e&2&&(s(),d("nzPlaceHolder","Env")("ngModel",n.store.activeEnvId())("nzAllowClear",!0),s(),R(n.store.envs()))},dependencies:[N,P,B,K,te,fe,he,I,V,D,Je,O,qe,ke,U,J,Re],styles:[".picker[_ngcontent-%COMP%]{display:flex;gap:8px;align-items:center}.sel[_ngcontent-%COMP%]{width:160px}"]})};var ht=class i{options;optionsChange=new y;timeoutMs=v(()=>this.options?.timeoutMs??3e4);followRedirects=v(()=>this.options?.followRedirects??!0);insecureTLS=v(()=>this.options?.insecureTLS??!1);proxy=v(()=>this.options?.proxy??"");emit(t){this.optionsChange.emit(t)}setTimeout(t){let e=Number(t);this.emit(M(x({},this.options??{}),{timeoutMs:isNaN(e)?void 0:e}))}setFollowRedirects(t){this.emit(M(x({},this.options??{}),{followRedirects:t}))}setInsecureTLS(t){this.emit(M(x({},this.options??{}),{insecureTLS:t}))}setProxy(t){this.emit(M(x({},this.options??{}),{proxy:t||void 0}))}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=E({type:i,selectors:[["app-advanced-editor"]],inputs:{options:"options"},outputs:{optionsChange:"optionsChange"},decls:25,vars:4,consts:[[1,"wrap"],[1,"grid"],[1,"row"],[1,"label"],["nz-input","","type","number","min","0","placeholder","30000",3,"ngModelChange","ngModel"],[1,"desc"],[1,"row","checkbox"],["nz-checkbox","",3,"ngModelChange","ngModel"],["nz-input","","placeholder","http://127.0.0.1:7890",3,"ngModelChange","ngModel"],[1,"desc","muted"],["nzType","info","nzShowIcon","","nzMessage","\u8BF4\u660E\uFF1AProxy \u914D\u7F6E\u5DF2\u4FDD\u5B58\uFF0C\u4F46\u5F53\u524D NodeHttpClient \u5C1A\u672A\u5B9E\u73B0\u4EE3\u7406\u652F\u6301\uFF0C\u8BF7\u52FF\u4F9D\u8D56\u8BE5\u9009\u9879\u8FDB\u884C\u8C03\u8BD5\u3002"]],template:function(e,n){e&1&&(l(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),m(4,"Timeout (ms)"),a(),l(5,"input",4),C("ngModelChange",function(r){return n.setTimeout(r)}),a(),l(6,"div",5),m(7,"\u8BF7\u6C42\u8D85\u65F6\u65F6\u95F4\uFF0C\u5355\u4F4D\u6BEB\u79D2\uFF080 \u8868\u793A\u4E0D\u8D85\u65F6\uFF09"),a()(),l(8,"div",6)(9,"label",7),C("ngModelChange",function(r){return n.setFollowRedirects(r)}),m(10," Follow Redirects "),a(),l(11,"div",5),m(12,"\u662F\u5426\u81EA\u52A8\u8DDF\u968F HTTP \u91CD\u5B9A\u5411\uFF08302 / 301\uFF09"),a()(),l(13,"div",6)(14,"label",7),C("ngModelChange",function(r){return n.setInsecureTLS(r)}),m(15," Insecure TLS "),a(),l(16,"div",5),m(17,"\u8DF3\u8FC7 TLS \u8BC1\u4E66\u6821\u9A8C\uFF08\u4EC5\u5728 Node \u73AF\u5883\u4E0B\u5C3D\u529B\u652F\u6301\uFF09"),a()(),l(18,"div",2)(19,"div",3),m(20,"Proxy"),a(),l(21,"input",8),C("ngModelChange",function(r){return n.setProxy(r)}),a(),l(22,"div",9),m(23,"\u4EE3\u7406\u5730\u5740\uFF08\u5F53\u524D\u7248\u672C\u4EC5\u4FDD\u5B58\uFF0C\u4E0D\u53C2\u4E0E\u5B9E\u9645\u8BF7\u6C42\uFF09"),a()(),h(24,"nz-alert",10),a()()),e&2&&(s(5),d("ngModel",n.timeoutMs()),s(4),d("ngModel",n.followRedirects()),s(5),d("ngModel",n.insecureTLS()),s(7),d("ngModel",n.proxy()))},dependencies:[N,P,$,sn,B,cn,K,it,nt,O,H,Ve,Me],styles:[".wrap[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%;min-height:240px}.grid[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:14px;padding-top:10px}.row[_ngcontent-%COMP%]{display:grid;grid-template-columns:140px 1fr;align-items:center;gap:10px}.row.checkbox[_ngcontent-%COMP%]{grid-template-columns:1fr}.label[_ngcontent-%COMP%]{font-size:12px;opacity:.8}.desc[_ngcontent-%COMP%]{grid-column:2 / span 1;font-size:12px;opacity:.65}.row.checkbox[_ngcontent-%COMP%] .desc[_ngcontent-%COMP%]{grid-column:1 / span 1;margin-left:24px}.muted[_ngcontent-%COMP%]{color:#999}"]})};var Ft=()=>[];function Ao(i,t){if(i&1){let e=w();l(0,"div",3)(1,"div",4),m(2,"Path \u53C2\u6570"),a(),l(3,"app-kv-table",14),C("rowsChange",function(o){u(e);let r=c();return _(r.patch.emit({pathParams:o}))}),a()()}if(i&2){let e=c();s(3),d("keepTrailingBlank",!1)("rows",(e.req==null?null:e.req.pathParams)||He(2,Ft))}}var vt=class i{req=null;patch=new y;static \u0275fac=function(e){return new(e||i)};static \u0275cmp=E({type:i,selectors:[["app-request-tabs"]],inputs:{req:"req"},outputs:{patch:"patch"},decls:20,vars:8,consts:[[1,"tabs"],["nzTitle","Params"],[1,"tab"],[1,"item"],[1,"title"],["keyLabel","\u53C2\u6570\u540D","valueLabel","\u53C2\u6570\u503C","descriptionLabel","\u8BF4\u660E","keyPlaceholder","param","valuePlaceholder","value",3,"rowsChange","rows"],["nzTitle","Headers"],["keyLabel","Header","valueLabel","Value","keyPlaceholder","x-header","valuePlaceholder","value",3,"rowsChange","rows"],["nzTitle","Body"],[3,"bodyChange","body"],["nzTitle","Auth"],[3,"authChange","auth"],["nzTitle","Advanced"],[3,"optionsChange","options"],["keyLabel","\u53C2\u6570\u540D","valueLabel","\u53C2\u6570\u503C","descriptionLabel","\u8BF4\u660E","keyPlaceholder","param","valuePlaceholder","value",3,"rowsChange","keepTrailingBlank","rows"]],template:function(e,n){e&1&&(l(0,"nz-tabs",0)(1,"nz-tab",1)(2,"div",2)(3,"div",3)(4,"div",4),m(5,"Query \u53C2\u6570"),a(),l(6,"app-kv-table",5),C("rowsChange",function(r){return n.patch.emit({query:r})}),a()(),g(7,Ao,4,3,"div",3),a()(),l(8,"nz-tab",6)(9,"div",2)(10,"app-kv-table",7),C("rowsChange",function(r){return n.patch.emit({headers:r})}),a()()(),l(11,"nz-tab",8)(12,"div",2)(13,"app-body-editor",9),C("bodyChange",function(r){return n.patch.emit({body:r})}),a()()(),l(14,"nz-tab",10)(15,"div",2)(16,"app-auth-editor",11),C("authChange",function(r){return n.patch.emit({auth:r})}),a()()(),l(17,"nz-tab",12)(18,"div",2)(19,"app-advanced-editor",13),C("optionsChange",function(r){return n.patch.emit({options:r})}),a()()()()),e&2&&(s(6),d("rows",(n.req==null?null:n.req.query)||He(6,Ft)),s(),f(!(n.req==null||n.req.pathParams==null)&&n.req.pathParams.length?7:-1),s(3),d("rows",(n.req==null?null:n.req.headers)||He(7,Ft)),s(3),d("body",n.req==null?null:n.req.body),s(3),d("auth",n.req==null?null:n.req.auth),s(3),d("options",n.req==null?null:n.req.options))},dependencies:[at,lt,rt,we,ut,mt,ht],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;height:100%;min-height:0}app-kv-table[_ngcontent-%COMP%]{display:block;height:100%}.tabs[_ngcontent-%COMP%]{flex:1 1 auto;overflow:hidden;height:100%}.tab[_ngcontent-%COMP%]{height:100%;overflow:hidden auto} nz-tabs.tabs .ant-tabs-content{height:100%} nz-tabs.tabs .ant-tabs-content .ant-tabs-tabpane{height:100%}"]})};function No(i,t){if(i&1&&h(0,"nz-option",2),i&2){let e=t.$implicit;d("nzValue",e)("nzLabel",e)}}function ko(i,t){if(i&1){let e=w();l(0,"div",7)(1,"nz-tag",8),m(2),a(),l(3,"a",9),C("click",function(){u(e);let o=c();return _(o.openEnv())}),m(4,"\u53BB\u914D\u7F6E"),a()()}if(i&2){let e=c();s(2),le(" \u672A\u89E3\u6790\u53D8\u91CF\uFF1A",e.missingVars().join(", ")," ")}}var yt=class i{envVars={};openEnv;method="GET";url="";sending=!1;envName=null;baseUrl=null;methodChange=new y;urlChange=new y;urlCommit=new y;send=new y;save=new y;methods=["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"];missingVars=v(()=>qn([this.draftUrl],this.envVars));draftUrl="";t;ngOnChanges(t){t.url&&(this.draftUrl=this.url??"")}onDraftChange(t){this.draftUrl=t??"",this.t&&window.clearTimeout(this.t),this.t=window.setTimeout(()=>{this.urlChange.emit(this.draftUrl)},250)}commit(){this.t&&(window.clearTimeout(this.t),this.t=void 0),this.urlChange.emit(this.draftUrl),this.urlCommit.emit(this.draftUrl)}placeholder=v(()=>this.baseUrl?'"/"\u5F00\u5934':"http://...");previewUrl=v(()=>{let t=(this.url??"").trim();if(!t||qo(t))return"";let e=(this.baseUrl??"").trim();if(!e)return"";try{return new URL(t,e).toString()}catch{return""}});static \u0275fac=function(e){return new(e||i)};static \u0275cmp=E({type:i,selectors:[["app-request-urlbar"]],inputs:{envVars:"envVars",openEnv:"openEnv",method:"method",url:"url",sending:"sending",envName:"envName",baseUrl:"baseUrl"},outputs:{methodChange:"methodChange",urlChange:"urlChange",urlCommit:"urlCommit",send:"send",save:"save"},features:[ee],decls:11,vars:6,consts:[[1,"bar"],[1,"method",3,"ngModelChange","ngModel"],[1,"m",3,"nzValue","nzLabel"],[1,"url",3,"nzAddonBefore"],["nz-input","",3,"ngModelChange","blur","keydown.enter","placeholder","ngModel"],["nz-button","","nzType","primary",3,"click","nzLoading"],["nz-button","","nzType","default",3,"click"],[1,"var-hint"],["nzColor","warning"],[3,"click"]],template:function(e,n){e&1&&(l(0,"div",0)(1,"nz-select",1),C("ngModelChange",function(r){return n.methodChange.emit(r)}),S(2,No,1,2,"nz-option",2,ue),a(),l(4,"nz-input-wrapper",3)(5,"input",4),C("ngModelChange",function(r){return n.onDraftChange(r)})("blur",function(){return n.commit()})("keydown.enter",function(){return n.commit()}),a()(),l(6,"button",5),C("click",function(){return n.send.emit()}),m(7,"\u53D1\u9001"),a(),l(8,"button",6),C("click",function(){return n.save.emit()}),m(9,"\u4FDD\u5B58"),a()(),g(10,ko,5,1,"div",7)),e&2&&(s(),d("ngModel",n.method),s(),R(n.methods),s(2),d("nzAddonBefore",n.baseUrl?n.baseUrl+" ":void 0),s(),d("placeholder",n.placeholder())("ngModel",n.draftUrl),s(),d("nzLoading",n.sending),s(4),f(n.missingVars().length?10:-1))},dependencies:[N,P,$,B,K,I,V,D,X,O,H,ge,te,fe,he,ye,ve],styles:[".bar[_ngcontent-%COMP%]{display:flex;gap:10px;padding:10px;border-bottom:1px solid #f0f0f0;align-items:center}.method[_ngcontent-%COMP%]{width:120px}.url[_ngcontent-%COMP%]{flex:1 1 auto}.var-hint[_ngcontent-%COMP%]{padding:4px 10px 8px;font-size:12px;display:flex;gap:8px;align-items:center}"]})};function qo(i){return/^https?:\/\//i.test(i)}function Io(i,t){if(i&1){let e=w();l(0,"app-request-urlbar",0),C("methodChange",function(o){u(e);let r=c();return _(r.patch.emit({method:o}))})("urlChange",function(o){u(e);let r=c();return _(r.onUrlChange(o))})("urlCommit",function(o){u(e);let r=c();return _(r.onUrlCommit(o))})("send",function(){u(e);let o=c();return _(o.send.emit())})("save",function(){u(e);let o=c();return _(o.save.emit())}),a(),l(1,"div",1)(2,"nz-input-wrapper",2)(3,"input",3),C("ngModelChange",function(o){u(e);let r=c();return _(r.patch.emit({name:o}))}),a()()(),l(4,"app-request-tabs",4),C("patch",function(o){u(e);let r=c();return _(r.patch.emit(o))}),a()}if(i&2){let e=c();d("method",e.request.method)("baseUrl",e.baseUrl)("envVars",e.envVars)("openEnv",e.openEnv)("url",e.request.url)("sending",e.sending),s(2),d("nzAddonBefore",e.collectionPath||"\u672A\u5206\u7C7B"),s(),d("ngModel",e.request.name),s(),d("req",e.request)}}var xt=class i{request=null;sending=!1;envVars={};openEnv;baseUrl=null;patch=new y;send=new y;save=new y;collectionPath=null;methods=["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"];onUrlCommit(t){let e=this.request;if(!e)return;let n=Dt(t,e.pathParams),o=Oe(e.url??""),r=Oe(t??"");(o.length!==r.length||o.some((b,T)=>b!==r[T]))&&this.patch.emit({pathParams:n})}onUrlChange(t){let e=this.request;if(!e){this.patch.emit({url:t});return}let n=Dt(t,e.pathParams),o=Oe(e.url??""),r=Oe(t??"");o.length!==r.length||o.some((b,T)=>b!==r[T])?this.patch.emit({url:t,pathParams:n}):this.patch.emit({url:t})}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=E({type:i,selectors:[["app-request-editor"]],inputs:{request:"request",sending:"sending",envVars:"envVars",openEnv:"openEnv",baseUrl:"baseUrl",collectionPath:"collectionPath"},outputs:{patch:"patch",send:"send",save:"save"},decls:1,vars:1,consts:[[3,"methodChange","urlChange","urlCommit","send","save","method","baseUrl","envVars","openEnv","url","sending"],[1,"name"],[3,"nzAddonBefore"],["nz-input","","placeholder","\u672A\u547D\u540D\u63A5\u53E3\u540D\u79F0",3,"ngModelChange","ngModel"],[1,"tabs",3,"patch","req"]],template:function(e,n){e&1&&g(0,Io,5,9),e&2&&f(n.request?0:-1)},dependencies:[N,P,$,B,K,I,O,H,ge,te,De,vt,yt],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column}.name[_ngcontent-%COMP%]{padding:10px;border-bottom:1px solid #f0f0f0}.tabs[_ngcontent-%COMP%]{flex:1 1 auto;overflow:hidden;padding:0 10px}app-request-tabs[_ngcontent-%COMP%]{flex:1 1 auto;height:0}"]})};var wt=class i{clipboard=q(xn);curl=null;copy(t){this.clipboard.copy(t)}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=E({type:i,selectors:[["app-curl-actions"]],inputs:{curl:"curl"},decls:17,vars:5,consts:[["menu","nzDropdownMenu"],[1,"wrap"],["nz-button","","nz-dropdown","","nzType","default","nzTrigger","hover","nzPlacement","bottomCenter",3,"disabled","nzDropdownMenu"],["nzType","copy","nzTheme","outline"],["nz-menu",""],["nz-menu-item",""],["nz-button","","nzType","text",3,"click","disabled"]],template:function(e,n){if(e&1){let o=w();l(0,"div",1)(1,"nz-space")(2,"button",2),h(3,"nz-icon",3),m(4," cURL "),a()(),l(5,"nz-dropdown-menu",null,0)(7,"ul",4)(8,"li",5)(9,"button",6),C("click",function(){return u(o),_(n.copy(n.curl.bash))}),m(10," cURL (Bash) "),a()(),l(11,"li",5)(12,"button",6),C("click",function(){return u(o),_(n.copy(n.curl.powershell))}),m(13," cURL (PS) "),a()(),l(14,"li",5)(15,"button",6),C("click",function(){return u(o),_(n.copy(n.curl.cmd))}),m(16," cURL (CMD) "),a()()()()()}if(e&2){let o=Q(6);s(2),d("disabled",!n.curl)("nzDropdownMenu",o),s(7),d("disabled",!(n.curl!=null&&n.curl.bash)),s(3),d("disabled",!(n.curl!=null&&n.curl.powershell)),s(3),d("disabled",!(n.curl!=null&&n.curl.cmd))}},dependencies:[N,wn,on,nn,I,V,D,X,U,J,gn,Pe,Ie,un,Cn,_n],encapsulation:2})};function Po(i,t){if(i&1&&(l(0,"nz-tag",11),m(1),a(),l(2,"span",4),m(3),a()),i&2){let e,n,o=c();d("nzColor",o.statusColor()),s(),Wt(" ",(e=o.response())==null?null:e.status," ",((e=o.response())==null?null:e.statusText)||""," "),s(2),le("",(n=o.response())==null?null:n.bodySize," bytes")}}function So(i,t){i&1&&(l(0,"span",4),m(1,"-"),a())}function Ro(i,t){i&1&&(l(0,"div",7),h(1,"nz-spin"),a())}function Do(i,t){if(i&1&&h(0,"nz-alert",8),i&2){let e=c();d("nzMessage",e.error())}}function Vo(i,t){i&1&&(l(0,"div",9),m(1,"\u53D1\u9001\u8BF7\u6C42\u540E\u5728\u6B64\u67E5\u770B\u54CD\u5E94"),a())}function Oo(i,t){if(i&1&&(l(0,"pre",15),m(1),a()),i&2){let e=c(2);s(),k(e.prettyJson())}}function Fo(i,t){if(i&1&&(l(0,"pre",15),m(1),a()),i&2){let e,n=c(2);s(),k((e=n.response())==null?null:e.bodyText)}}function Bo(i,t){if(i&1&&(l(0,"div",18)(1,"div",20),m(2),a(),l(3,"div",21),m(4),a()()),i&2){let e,n=t.$implicit,o=c(2);s(2),k(n),s(2),k((e=o.response())==null||e.headers==null?null:e.headers[n])}}function Ko(i,t){if(i&1){let e=w();l(0,"nz-tabs",12),ce("nzSelectedIndexChange",function(o){u(e);let r=c();return se(r.tabIndex,o)||(r.tabIndex=o),_(o)}),l(1,"nz-tab",13)(2,"div",14),g(3,Oo,2,1,"pre",15)(4,Fo,2,1,"pre",15),a()(),l(5,"nz-tab",16)(6,"div",14)(7,"div",17),S(8,Bo,5,2,"div",18,ue),a()()(),l(10,"nz-tab",19)(11,"div",14)(12,"pre",15),m(13),a()()()()}if(i&2){let e=c();ae("nzSelectedIndex",e.tabIndex),s(3),f(e.isJson()?3:4),s(5),R(e.headerKeys()),s(5),k(e.rawDump())}}var bt=class i{sending=!1;result=null;resultSig=A(null);tabIndex=0;ngOnChanges(t){if(t.result){let e=t.result.currentValue;this.resultSig.set(e)}}error=v(()=>{let t=this.resultSig();return t&&t.error?t.error.message:null});curl=v(()=>{let t=this.resultSig();return t&&t.curl?t.curl:null});response=v(()=>{let t=this.resultSig();return t?t.response:null});headerKeys=v(()=>{let t=this.response()?.headers??{};return Object.keys(t).sort((e,n)=>e.localeCompare(n))});statusColor=v(()=>{let t=this.response()?.status??0;return t?t>=200&&t<300?"green":t>=300&&t<400?"blue":t>=400&&t<500?"orange":"red":"default"});isJson=v(()=>{let t=this.response();if(!t)return!1;if((t.headers?.["content-type"]??t.headers?.["Content-Type"]??"").toLowerCase().includes("application/json"))return!0;let n=(t.bodyText??"").trim();return n.startsWith("{")&&n.endsWith("}")||n.startsWith("[")&&n.endsWith("]")});prettyJson=v(()=>{let t=(this.response()?.bodyText??"").trim();try{let e=JSON.parse(t);return JSON.stringify(e,null,2)}catch{return this.response()?.bodyText??""}});rawDump=v(()=>this.response()?JSON.stringify(this.response(),null,2):"");static \u0275fac=function(e){return new(e||i)};static \u0275cmp=E({type:i,selectors:[["app-response-viewer"]],inputs:{sending:"sending",result:"result"},features:[ee],decls:13,vars:3,consts:[[1,"wrap"],[1,"top"],[1,"left"],[1,"title"],[1,"meta"],[1,"right"],[3,"curl"],[1,"loading"],["nzType","error","nzShowIcon","",3,"nzMessage"],[1,"empty"],[1,"tabs",3,"nzSelectedIndex"],[3,"nzColor"],[1,"tabs",3,"nzSelectedIndexChange","nzSelectedIndex"],["nzTitle","Body"],[1,"pane"],[1,"code"],["nzTitle","Headers"],[1,"hlist"],[1,"hrow"],["nzTitle","Raw"],[1,"hk"],[1,"hv"]],template:function(e,n){e&1&&(l(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),m(4,"Response"),a(),g(5,Po,4,4)(6,So,2,0,"span",4),a(),l(7,"div",5),h(8,"app-curl-actions",6),a()(),g(9,Ro,2,0,"div",7)(10,Do,1,1,"nz-alert",8)(11,Vo,2,0,"div",9)(12,Ko,14,3,"nz-tabs",10),a()),e&2&&(s(5),f(n.response()?5:6),s(3),d("curl",n.curl()),s(),f(n.sending?9:n.error()?10:n.response()?12:11))},dependencies:[N,at,lt,rt,ye,ve,De,ot,Ve,Me,wt],styles:["[_nghost-%COMP%]{display:flex;height:100%;min-height:0}.wrap[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%;min-height:0;width:100%}.top[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;padding:10px 12px;border-bottom:1px solid #f0f0f0}.left[_ngcontent-%COMP%]{display:flex;gap:10px;align-items:center}.title[_ngcontent-%COMP%]{font-weight:700}.meta[_ngcontent-%COMP%]{font-size:12px;opacity:.65}.loading[_ngcontent-%COMP%]{padding:16px}.empty[_ngcontent-%COMP%]{padding:16px;opacity:.6}.tabs[_ngcontent-%COMP%]{flex:1 1 auto;min-height:0}.pane[_ngcontent-%COMP%]{height:100%;min-height:0;overflow:auto;padding:10px 12px}.code[_ngcontent-%COMP%]{margin:0;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:12px;line-height:1.5;white-space:pre-wrap;word-break:break-word}.hlist[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:8px}.hrow[_ngcontent-%COMP%]{display:grid;grid-template-columns:200px 1fr;gap:10px;padding:8px;border:1px solid #f0f0f0;border-radius:8px}.hk[_ngcontent-%COMP%]{font-weight:600;font-size:12px}.hv[_ngcontent-%COMP%]{font-size:12px;opacity:.85;word-break:break-word}"]})};var jo=["envPicker"],Lo=["class","component"];function Uo(i,t){if(i&1){let e=w();l(0,"app-request-editor",8),C("patch",function(o){u(e);let r=c();return _(r.store.patchActive(o))})("save",function(){u(e);let o=c();return _(o.store.saveActive())})("send",function(){u(e);let o=c();return _(o.store.sendActive())}),a(),h(1,"app-response-viewer",9)}if(i&2){let e,n=c();d("collectionPath",n.store.collectionPath())("baseUrl",((e=n.store.activeEnv())==null?null:e.baseUrl)??null)("request",n.store.activeRequest())("sending",n.store.sending())("envVars",n.store.envVarRecord())("openEnv",n.openEnv),s(),d("sending",n.store.sending())("result",n.store.lastResult())}}function $o(i,t){if(i&1){let e=w();l(0,"app-api-history-drawer",10),C("close",function(){u(e);let o=c();return _(o.store.closeHistory())})("replay",function(o){u(e);let r=c();return _(r.store.replayHistory(o))}),a()}if(i&2){let e=c();d("loading",e.store.historyLoading())("histories",e.store.histories())}}var zt=class i{store=q(be);envPicker;openEnv=()=>{this.envPicker.openEnvModal()};static \u0275fac=function(e){return new(e||i)};static \u0275cmp=E({type:i,selectors:[["app-api-client",8,"component"]],viewQuery:function(e,n){if(e&1&&Lt(jo,5),e&2){let o;Ut(o=$t())&&(n.envPicker=o.first)}},attrs:Lo,decls:10,vars:10,consts:[[3,"title","loading","isFullscreen","isOverflowYAuto"],["ngProjectAs","actions",5,["actions"]],["nz-button","","nzType","text","nz-tooltip","","nzTooltipTitle","\u5386\u53F2\u8BB0\u5F55",3,"click"],["nzType","history","nzTheme","outline"],[1,"page"],[3,"qChange","select","createRequest","createCollection","createFolder","reload","delete","rename","move","nodes","q","activeId","loading"],[1,"content"],[3,"loading","histories"],[3,"patch","save","send","collectionPath","baseUrl","request","sending","envVars","openEnv"],[3,"sending","result"],[3,"close","replay","loading","histories"]],template:function(e,n){e&1&&(l(0,"app-page-layout",0),oe(1,1),h(2,"app-env-picker"),l(3,"button",2),C("click",function(){return n.store.openHistory()}),h(4,"nz-icon",3),a(),re(),l(5,"nz-layout",4)(6,"app-request-collections",5),ce("qChange",function(r){return se(n.store.q,r)||(n.store.q=r),r}),C("select",function(r){return n.store.selectRequest(r)})("createRequest",function(r){return n.store.newRequest({collectionId:r.collectionId})})("createCollection",function(){return n.store.newCollection({kind:"collection"})})("createFolder",function(r){return n.store.newCollection({kind:"folder",parentId:r.collectionId})})("reload",function(){return n.store.loadAll()})("delete",function(r){return n.store.deleteCollection(r.id,r.kind)})("rename",function(r){return n.store.renameCollection(r.id,r.kind)})("move",function(r){return n.store.moveCollection(r.id,r.kind)}),a(),l(7,"div",6),g(8,Uo,2,8),a()()(),g(9,$o,1,2,"app-api-history-drawer",7)),e&2&&(d("title","API \u8BF7\u6C42")("loading",n.store.loading())("isFullscreen",!0)("isOverflowYAuto",!1),s(6),d("nodes",n.store.filteredNodes()),ae("q",n.store.q),d("activeId",n.store.activeRequestId())("loading",n.store.loading()),s(2),f(n.store.activeRequest()?8:-1),s(),f(n.store.historyOpen()?9:-1))},dependencies:[N,pn,I,V,D,U,J,yn,vn,qe,ke,dt,xt,bt,st,ft],styles:[".page[_ngcontent-%COMP%]{height:100%;display:flex;flex-direction:row;overflow:hidden;gap:16px;padding:0 16px}.content[_ngcontent-%COMP%]{flex:1 1 auto;width:0;display:flex;flex-direction:column;height:100%;overflow:hidden}app-request-editor[_ngcontent-%COMP%]{flex:0 0 auto;height:50%}app-response-viewer[_ngcontent-%COMP%]{flex:0 0 auto;height:50%;overflow:auto}"]})};var Ho=[{path:"",component:zt}],Mt=class i{static \u0275fac=function(e){return new(e||i)};static \u0275mod=Ne({type:i});static \u0275inj=Ae({imports:[qt.forChild(Ho),qt]})};var On=class i{static \u0275fac=function(e){return new(e||i)};static \u0275mod=Ne({type:i});static \u0275inj=Ae({imports:[N,Mt]})};export{On as ApiClientModule};
@@ -0,0 +1,11 @@
1
+ import{a as an}from"./chunk-7U5ZOE34.js";import{f as on}from"./chunk-DV7BEQJD.js";import{e as sn}from"./chunk-IXHH6ENJ.js";import"./chunk-CJISJEP3.js";import{d as rn}from"./chunk-35COW2FA.js";import"./chunk-POZS3PD3.js";import{a as yn}from"./chunk-HZ73CM45.js";import{d as Se,e as Ne,f as Ie}from"./chunk-DUC7XBYN.js";import{e as Wt,g as qt,h as Ut}from"./chunk-ROB7EMN5.js";import{A as Xt,B as Yt,C as en,D as De,G as tn,I as nn,c as ze,g as Zt,q as Ht,x as Kt,y as Jt,z as Gt}from"./chunk-FPDGZ3ZC.js";import{Ab as ce,Bb as Qt,Cb as Z,F as Vt,Fb as nt,H as ae,Hb as me,I as kt,M as ee,N as $,O as et,P as tt,T as Ft,U as Rt,V as ve,W as Ee,Xa as jt,Y as be,Ya as Bt,Z as Te,Za as $t,jb as Me,lb as re,pb as se,q as Xe,r as Ot,vb as le,w as Ye,wb as At,x as Pt,xb as we,yb as Lt,z as B}from"./chunk-PTMJ422K.js";import"./chunk-HFZLJHYR.js";import{B as Ge,d as It,i as O}from"./chunk-53YRDYLS.js";import{$b as N,Aa as Ct,Ab as xt,Ba as gt,Ca as _e,Dc as Mt,Eb as w,Ec as ye,Fb as Q,Fc as de,Gb as zt,Ha as I,Ic as m,Jc as V,Kb as J,Kc as F,Mc as Ze,Nc as He,Oa as Ue,Oc as Ke,Ra as he,Tb as vt,Vb as y,Vc as Y,W as ut,Wc as wt,Xb as x,Yb as Et,_b as S,a as H,ac as f,ad as Dt,b as K,bc as s,cc as l,da as qe,dc as T,e as hn,f as We,fd as j,g as dt,gd as St,hc as G,ic as X,kc as v,ld as Je,m as mt,ma as ft,mb as p,na as L,qc as C,r as ie,ra as u,rb as b,rd as xe,s as P,sb as _t,tc as r,ub as ht,uc as bt,vc as Tt,vd as oe,wd as Nt,xa as _,xb as yt,xc as W,ya as h,yc as q,z as ge,zc as U}from"./chunk-SJG2JCPL.js";var it=(()=>{class t{static \u0275fac=function(i){return new(i||t)};static \u0275dir=zt({type:t,selectors:[["button","nz-trans-button",""]],hostVars:8,hostBindings:function(i,o){i&2&&ye("border","0")("background","transparent")("padding","0")("line-height","inherit")}})}return t})(),ot=(()=>{class t{static \u0275fac=function(i){return new(i||t)};static \u0275mod=Q({type:t});static \u0275inj=L({})}return t})();function vn(t,n){if(t&1&&(G(0),T(1,"nz-icon",2),X()),t&2){let e=n.$implicit;p(),f("nzType",e)}}var En=["textarea"];function bn(t,n){if(t&1){let e=v();s(0,"textarea",2,0),C("blur",function(){_(e);let o=r();return h(o.confirm())}),l(),s(2,"button",3),C("click",function(){_(e);let o=r();return h(o.confirm())}),T(3,"nz-icon",4),l()}}function Tn(t,n){if(t&1&&(G(0),T(1,"nz-icon",7),X()),t&2){let e=n.$implicit;p(),f("nzType",e)}}function Mn(t,n){if(t&1){let e=v();s(0,"button",5),C("click",function(){_(e);let o=r();return h(o.onClick())}),J(1,Tn,2,1,"ng-container",6),l()}if(t&2){let e=r();f("nzTooltipTitle",e.tooltip===null?null:e.tooltip||(e.locale==null?null:e.locale.edit)),p(),f("nzStringTemplateOutlet",e.icon)}}var wn=["ellipsisContainer"],Dn=["expandable"],Sn=["contentTemplate"],Nn=["*"],In=t=>({content:t});function On(t,n){t&1&&Tt(0)}function Pn(t,n){if(t&1&&(y(0,On,1,0),m(1)),t&2){let e=n.content;x(e?-1:0),p(),F(" ",e," ")}}function Vn(t,n){}function kn(t,n){if(t&1&&m(0),t&2){let e=r(3);F(" ",e.nzSuffix," ")}}function Fn(t,n){if(t&1&&(J(0,Vn,0,0,"ng-template",5),y(1,kn,1,1)),t&2){let e=r(2),i=Mt(1);f("ngTemplateOutlet",i)("ngTemplateOutletContext",wt(3,In,e.nzContent)),p(),x(e.nzSuffix?1:-1)}}function Rn(t,n){if(t&1&&m(0),t&2){let e=r(3);F(" ",e.ellipsisStr," ")}}function jn(t,n){if(t&1&&m(0),t&2){let e=r(3);F(" ",e.nzSuffix," ")}}function Bn(t,n){if(t&1){let e=v();s(0,"a",7,2),C("click",function(){_(e);let o=r(3);return h(o.onExpand())}),m(2),l()}if(t&2){let e=r(3);p(2),F(" ",e.locale==null?null:e.locale.expand," ")}}function $n(t,n){if(t&1&&(T(0,"span",null,1),y(2,Rn,1,1),y(3,jn,1,1),y(4,Bn,3,1,"a",6)),t&2){let e=r(2);p(2),x(e.isEllipsis?2:-1),p(),x(e.nzSuffix?3:-1),p(),x(e.nzExpandable&&e.isEllipsis?4:-1)}}function An(t,n){if(t&1&&y(0,Fn,2,5)(1,$n,5,3),t&2){let e=r();x(e.expanded||!e.hasOperationsWithEllipsis&&e.nzEllipsisRows===1&&!e.hasEllipsisObservers||e.canCssEllipsis||e.nzSuffix&&e.expanded?0:1)}}function Ln(t,n){if(t&1){let e=v();s(0,"nz-text-edit",8),C("endEditing",function(o){_(e);let a=r();return h(a.onEndEditing(o))})("startEditing",function(){_(e);let o=r();return h(o.onStartEditing())}),l()}if(t&2){let e=r();f("text",e.nzContent)("icon",e.nzEditIcon)("tooltip",e.nzEditTooltip)}}function Qn(t,n){if(t&1){let e=v();s(0,"nz-text-copy",9),C("textCopy",function(o){_(e);let a=r();return h(a.onTextCopy(o))}),l()}if(t&2){let e=r();f("text",e.copyText)("tooltips",e.nzCopyTooltips)("icons",e.nzCopyIcons)}}var at=(()=>{class t{cdr=u(xe);clipboard=u(rn);i18n=u(ze);destroyRef=u(_e);copied=!1;copyId;locale;nativeElement=u(he).nativeElement;copyTooltip=null;copedTooltip=null;copyIcon="copy";copedIcon="check";text;tooltips;icons=["copy","check"];textCopy=new b;constructor(){this.destroyRef.onDestroy(()=>{clearTimeout(this.copyId)})}ngOnInit(){this.i18n.localeChange.pipe(B(this.destroyRef)).subscribe(()=>{this.locale=this.i18n.getLocaleData("Text"),this.updateTooltips(),this.cdr.markForCheck()})}ngOnChanges(e){let{tooltips:i,icons:o}=e;i&&this.updateTooltips(),o&&this.updateIcons()}onClick(){if(this.copied)return;this.copied=!0,this.cdr.detectChanges();let e=this.text;this.textCopy.emit(e),this.clipboard.copy(e),this.onCopied()}onCopied(){clearTimeout(this.copyId),this.copyId=setTimeout(()=>{this.copied=!1,this.cdr.detectChanges()},3e3)}updateTooltips(){if(this.tooltips===null)this.copedTooltip=null,this.copyTooltip=null;else if(Array.isArray(this.tooltips)){let[e,i]=this.tooltips;this.copyTooltip=e||this.locale?.copy,this.copedTooltip=i||this.locale?.copied}else this.copyTooltip=this.locale?.copy,this.copedTooltip=this.locale?.copied;this.cdr.markForCheck()}updateIcons(){let[e,i]=this.icons;this.copyIcon=e,this.copedIcon=i,this.cdr.markForCheck()}static \u0275fac=function(i){return new(i||t)};static \u0275cmp=w({type:t,selectors:[["nz-text-copy"]],inputs:{text:"text",tooltips:"tooltips",icons:"icons"},outputs:{textCopy:"textCopy"},exportAs:["nzTextCopy"],features:[Ue],decls:2,vars:4,consts:[["type","button","nz-tooltip","","nz-trans-button","",1,"ant-typography-copy",3,"click","nzTooltipTitle"],[4,"nzStringTemplateOutlet"],[3,"nzType"]],template:function(i,o){i&1&&(s(0,"button",0),C("click",function(){return o.onClick()}),J(1,vn,2,1,"ng-container",1),l()),i&2&&(de("ant-typography-copy-success",o.copied),f("nzTooltipTitle",o.copied?o.copedTooltip:o.copyTooltip),p(),f("nzStringTemplateOutlet",o.copied?o.copedIcon:o.copyIcon))},dependencies:[me,nt,ot,it,$,ee,tt,et],encapsulation:2,changeDetection:0})}return t})(),rt=(()=>{class t{ngZone=u(_t);cdr=u(xe);i18n=u(ze);destroyRef=u(_e);editing=!1;locale;text;icon="edit";tooltip;startEditing=new b;endEditing=new b(!0);set textarea(e){this.textarea$.next(e)}autosizeDirective;beforeText;currentText;nativeElement=u(he).nativeElement;textarea$=new mt(null);injector=u(Ct);ngOnInit(){this.i18n.localeChange.pipe(B(this.destroyRef)).subscribe(()=>{this.locale=this.i18n.getLocaleData("Text"),this.cdr.markForCheck()}),this.textarea$.pipe(qe(e=>Ye(e?.nativeElement,"keydown")),B(this.destroyRef)).subscribe(e=>{e.keyCode!==27&&e.keyCode!==13||this.ngZone.run(()=>{e.keyCode===27?this.onCancel():this.onEnter(e),this.cdr.markForCheck()})}),this.textarea$.pipe(qe(e=>Ye(e?.nativeElement,"input")),B(this.destroyRef)).subscribe(e=>{this.currentText=e.target.value})}onClick(){this.beforeText=this.text,this.currentText=this.beforeText,this.editing=!0,this.startEditing.emit(),this.focusAndSetValue()}confirm(){this.editing=!1,this.endEditing.emit(this.currentText)}onEnter(e){e.stopPropagation(),e.preventDefault(),this.confirm()}onCancel(){this.currentText=this.beforeText,this.confirm()}focusAndSetValue(){let{injector:e}=this;ht(()=>{this.textarea$.pipe(ut(i=>i!=null),B(this.destroyRef)).subscribe(i=>{i.nativeElement.focus(),i.nativeElement.value=this.currentText||"",this.autosizeDirective.resizeToFitContent(),this.cdr.markForCheck()})},{injector:e})}static \u0275fac=function(i){return new(i||t)};static \u0275cmp=w({type:t,selectors:[["nz-text-edit"]],viewQuery:function(i,o){if(i&1&&(W(En,5),W(we,5)),i&2){let a;q(a=U())&&(o.textarea=a.first),q(a=U())&&(o.autosizeDirective=a.first)}},inputs:{text:"text",icon:"icon",tooltip:"tooltip"},outputs:{startEditing:"startEditing",endEditing:"endEditing"},exportAs:["nzTextEdit"],decls:2,vars:1,consts:[["textarea",""],["nz-tooltip","","nz-trans-button","",1,"ant-typography-edit",3,"nzTooltipTitle"],["nz-input","","nzAutosize","",3,"blur"],["nz-trans-button","",1,"ant-typography-edit-content-confirm",3,"click"],["nzType","enter"],["nz-tooltip","","nz-trans-button","",1,"ant-typography-edit",3,"click","nzTooltipTitle"],[4,"nzStringTemplateOutlet"],[3,"nzType"]],template:function(i,o){i&1&&y(0,bn,4,0)(1,Mn,2,2,"button",1),i&2&&x(o.editing?0:1)},dependencies:[Z,ce,we,ot,it,$,ee,me,nt,tt,et],encapsulation:2,changeDetection:0})}return t})(),Wn="typography",qn="ant-typography-expand",Un=(()=>{var k;let t,n=[],e=[],i,o=[],a=[],E,D=[],z=[],R,fe=[],Ce=[],lt,ct=[],pt=[];return k=class{_nzModuleName=Wn;nzConfigService=u(Vt);el=u(he).nativeElement;cdr=u(xe);viewContainerRef=u(xt);renderer=u(yt);platform=u(kt);i18n=u(ze);resizeService=u($t);directionality=u(Pt);document=u(gt);destroyRef=u(_e);nzCopyable=!1;nzEditable=!1;nzDisabled=!1;nzExpandable=!1;nzEllipsis=!1;nzCopyTooltips=P(this,n,void 0);nzCopyIcons=(P(this,e),P(this,o,["copy","check"]));nzEditTooltip=(P(this,a),P(this,D,void 0));nzEditIcon=(P(this,z),P(this,fe,"edit"));nzContent=P(this,Ce);nzEllipsisRows=P(this,ct,1);nzType=P(this,pt);nzCopyText;nzSuffix;nzContentChange=new b;nzCopy=new b;nzExpandChange=new b;nzOnEllipsis=new b;textEditRef;textCopyRef;ellipsisContainer;expandableBtn;contentTemplate;locale;expandableBtnElementCache=null;editing=!1;ellipsisText;cssEllipsis=!1;isEllipsis=!0;expanded=!1;ellipsisStr="...";dir="ltr";get hasEllipsisObservers(){return this.nzOnEllipsis.observers.length>0}get canCssEllipsis(){return this.nzEllipsis&&this.cssEllipsis&&!this.expanded&&!this.hasEllipsisObservers}get hasOperationsWithEllipsis(){return(this.nzCopyable||this.nzEditable||this.nzExpandable)&&this.nzEllipsis}viewInit=!1;requestId=-1;windowResizeSubscription=dt.EMPTY;get copyText(){return typeof this.nzCopyText=="string"?this.nzCopyText:this.nzContent}constructor(){this.destroyRef.onDestroy(()=>{this.expandableBtnElementCache=null,this.windowResizeSubscription.unsubscribe()})}onTextCopy(g){this.nzCopy.emit(g)}onStartEditing(){this.editing=!0}onEndEditing(g){this.editing=!1,this.nzContentChange.emit(g),this.nzContent===g&&this.renderOnNextFrame(),this.cdr.markForCheck()}onExpand(){this.isEllipsis=!1,this.expanded=!0,this.nzExpandChange.emit(),this.nzOnEllipsis.emit(!1)}canUseCSSEllipsis(){return this.nzEditable||this.nzCopyable||this.nzExpandable||this.nzSuffix||this.hasEllipsisObservers?!1:this.nzEllipsisRows===1?Xe("textOverflow"):Xe("webkitLineClamp")}renderOnNextFrame(){Bt(this.requestId),!(!this.viewInit||!this.nzEllipsis||this.nzEllipsisRows<0||this.expanded||!this.platform.isBrowser)&&(this.requestId=jt(()=>this.syncEllipsis()))}getOriginContentViewRef(){let g=this.viewContainerRef.createEmbeddedView(this.contentTemplate,{content:this.nzContent});return g.detectChanges(),{viewRef:g,removeView:()=>this.viewContainerRef.remove(this.viewContainerRef.indexOf(g))}}syncEllipsis(){if(this.cssEllipsis)return;let{viewRef:g,removeView:d}=this.getOriginContentViewRef(),c=[this.textCopyRef,this.textEditRef].filter(ne=>ne&&ne.nativeElement).map(ne=>ne.nativeElement),M=this.getExpandableBtnElement();M&&c.push(M);let{contentNodes:Le,text:Qe,ellipsis:pe}=Ot(this.el,this.nzEllipsisRows,g.rootNodes,c,this.ellipsisStr,this.nzSuffix);d(),this.ellipsisText=Qe,pe!==this.isEllipsis&&(this.isEllipsis=pe,this.nzOnEllipsis.emit(pe));let te=this.ellipsisContainer.nativeElement;for(;te.firstChild;)this.renderer.removeChild(te,te.firstChild);Le.forEach(ne=>{this.renderer.appendChild(te,ne.cloneNode(!0))}),this.cdr.markForCheck()}getExpandableBtnElement(){if(this.nzExpandable){let g=this.locale?this.locale.expand:"",d=this.expandableBtnElementCache;if(!d||d.innerText===g){let c=this.document.createElement("a");c.className=qn,c.innerText=g,this.expandableBtnElementCache=c}return this.expandableBtnElementCache}else return this.expandableBtnElementCache=null,null}renderAndSubscribeWindowResize(){this.platform.isBrowser&&(this.windowResizeSubscription.unsubscribe(),this.cssEllipsis=this.canUseCSSEllipsis(),this.renderOnNextFrame(),this.windowResizeSubscription=this.resizeService.connect().pipe(B(this.destroyRef)).subscribe(()=>this.renderOnNextFrame()))}ngOnInit(){this.i18n.localeChange.pipe(B(this.destroyRef)).subscribe(()=>{this.locale=this.i18n.getLocaleData("Text"),this.cdr.markForCheck()}),this.directionality.change?.pipe(B(this.destroyRef)).subscribe(g=>{this.dir=g,this.cdr.detectChanges()}),this.dir=this.directionality.value}ngAfterViewInit(){this.viewInit=!0,this.renderAndSubscribeWindowResize()}ngOnChanges(g){let{nzCopyable:d,nzEditable:c,nzExpandable:M,nzEllipsis:Le,nzContent:Qe,nzEllipsisRows:pe,nzSuffix:te}=g;(d||c||M||Le||Qe||pe||te)&&this.nzEllipsis&&(this.expanded?this.windowResizeSubscription.unsubscribe():this.renderAndSubscribeWindowResize())}},(()=>{let g=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;t=[ae()],i=[ae()],E=[ae()],R=[ae()],lt=[ae()],ie(null,null,t,{kind:"field",name:"nzCopyTooltips",static:!1,private:!1,access:{has:d=>"nzCopyTooltips"in d,get:d=>d.nzCopyTooltips,set:(d,c)=>{d.nzCopyTooltips=c}},metadata:g},n,e),ie(null,null,i,{kind:"field",name:"nzCopyIcons",static:!1,private:!1,access:{has:d=>"nzCopyIcons"in d,get:d=>d.nzCopyIcons,set:(d,c)=>{d.nzCopyIcons=c}},metadata:g},o,a),ie(null,null,E,{kind:"field",name:"nzEditTooltip",static:!1,private:!1,access:{has:d=>"nzEditTooltip"in d,get:d=>d.nzEditTooltip,set:(d,c)=>{d.nzEditTooltip=c}},metadata:g},D,z),ie(null,null,R,{kind:"field",name:"nzEditIcon",static:!1,private:!1,access:{has:d=>"nzEditIcon"in d,get:d=>d.nzEditIcon,set:(d,c)=>{d.nzEditIcon=c}},metadata:g},fe,Ce),ie(null,null,lt,{kind:"field",name:"nzEllipsisRows",static:!1,private:!1,access:{has:d=>"nzEllipsisRows"in d,get:d=>d.nzEllipsisRows,set:(d,c)=>{d.nzEllipsisRows=c}},metadata:g},ct,pt),g&&Object.defineProperty(k,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:g})})(),We(k,"\u0275fac",function(d){return new(d||k)}),We(k,"\u0275cmp",w({type:k,selectors:[["nz-typography"],["","nz-typography",""],["p","nz-paragraph",""],["span","nz-text",""],["h1","nz-title",""],["h2","nz-title",""],["h3","nz-title",""],["h4","nz-title",""]],viewQuery:function(d,c){if(d&1&&(W(rt,5),W(at,5),W(wn,5),W(Dn,5),W(Sn,5)),d&2){let M;q(M=U())&&(c.textEditRef=M.first),q(M=U())&&(c.textCopyRef=M.first),q(M=U())&&(c.ellipsisContainer=M.first),q(M=U())&&(c.expandableBtn=M.first),q(M=U())&&(c.contentTemplate=M.first)}},hostVars:26,hostBindings:function(d,c){d&2&&(ye("-webkit-line-clamp",c.canCssEllipsis&&c.nzEllipsisRows>1?c.nzEllipsisRows:null),de("ant-typography",!c.editing)("ant-typography-rtl",c.dir==="rtl")("ant-typography-edit-content",c.editing)("ant-typography-secondary",c.nzType==="secondary")("ant-typography-warning",c.nzType==="warning")("ant-typography-danger",c.nzType==="danger")("ant-typography-success",c.nzType==="success")("ant-typography-disabled",c.nzDisabled)("ant-typography-ellipsis",c.nzEllipsis&&!c.expanded)("ant-typography-single-line",c.nzEllipsis&&c.nzEllipsisRows===1)("ant-typography-ellipsis-single-line",c.canCssEllipsis&&c.nzEllipsisRows===1)("ant-typography-ellipsis-multiple-line",c.canCssEllipsis&&c.nzEllipsisRows>1))},inputs:{nzCopyable:[2,"nzCopyable","nzCopyable",oe],nzEditable:[2,"nzEditable","nzEditable",oe],nzDisabled:[2,"nzDisabled","nzDisabled",oe],nzExpandable:[2,"nzExpandable","nzExpandable",oe],nzEllipsis:[2,"nzEllipsis","nzEllipsis",oe],nzCopyTooltips:"nzCopyTooltips",nzCopyIcons:"nzCopyIcons",nzEditTooltip:"nzEditTooltip",nzEditIcon:"nzEditIcon",nzContent:"nzContent",nzEllipsisRows:[2,"nzEllipsisRows","nzEllipsisRows",Nt],nzType:"nzType",nzCopyText:"nzCopyText",nzSuffix:"nzSuffix"},outputs:{nzContentChange:"nzContentChange",nzCopy:"nzCopy",nzExpandChange:"nzExpandChange",nzOnEllipsis:"nzOnEllipsis"},exportAs:["nzTypography"],features:[Ue],ngContentSelectors:Nn,decls:5,vars:3,consts:[["contentTemplate",""],["ellipsisContainer",""],["expandable",""],[3,"text","icon","tooltip"],[3,"text","tooltips","icons"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"ant-typography-expand"],[1,"ant-typography-expand",3,"click"],[3,"endEditing","startEditing","text","icon","tooltip"],[3,"textCopy","text","tooltips","icons"]],template:function(d,c){d&1&&(bt(),J(0,Pn,2,2,"ng-template",null,0,Dt),y(2,An,2,1),y(3,Ln,1,3,"nz-text-edit",3),y(4,Qn,1,3,"nz-text-copy",4)),d&2&&(p(2),x(c.editing?-1:2),p(),x(c.nzEditable?3:-1),p(),x(c.nzCopyable&&!c.editing?4:-1))},dependencies:[It,rt,at],encapsulation:2,changeDetection:0})),k})(),pn=(()=>{class t{static \u0275fac=function(i){return new(i||t)};static \u0275mod=Q({type:t});static \u0275inj=L({imports:[Un,at,rt]})}return t})();var ue=hn(yn());function Jn(t,n){if(t&1){let e=v();s(0,"div",0)(1,"span",1),m(2,"\u6709\u672A\u4FDD\u5B58\u66F4\u6539"),l(),s(3,"button",2),C("click",function(){_(e);let o=r();return h(o.diff.emit())}),m(4,"Diff"),l(),s(5,"button",2),C("click",function(){_(e);let o=r();return h(o.reset.emit())}),m(6,"\u91CD\u7F6E"),l(),s(7,"button",3),C("click",function(){_(e);let o=r();return h(o.save.emit())}),m(8,"\u4FDD\u5B58"),l()()}}var Oe=class t{dirty=!1;diff=new b;reset=new b;save=new b;static \u0275fac=function(e){return new(e||t)};static \u0275cmp=w({type:t,selectors:[["app-config-change-bar-component"]],inputs:{dirty:"dirty"},outputs:{diff:"diff",reset:"reset",save:"save"},decls:1,vars:1,consts:[[1,"change-bar"],[1,"hint"],["nz-button","",3,"click"],["nz-button","","nzType","primary",3,"click"]],template:function(e,i){e&1&&y(0,Jn,9,0,"div",0),e&2&&x(i.dirty?0:-1)},dependencies:[O,Te,be,ve,Ee],styles:[".change-bar[_ngcontent-%COMP%]{width:100%;padding:10px 20px;display:flex;justify-content:flex-end;align-items:center;gap:10px;box-shadow:0 -2px 8px #0000000f;background:var(--app-component-bg);border:1px solid var(--app-border-color)}.hint[_ngcontent-%COMP%]{margin-right:auto;opacity:.75}"]})};var Gn=(t,n)=>n.id;function Xn(t,n){if(t&1){let e=v();s(0,"div",6),C("click",function(){let o=_(e).$implicit,a=r();return h(a.selectDomain(o))}),s(1,"div",7)(2,"div",8),T(3,"nz-icon",9),l(),s(4,"div",10)(5,"div",11),m(6),l(),s(7,"div",12),m(8),l()()()()}if(t&2){let e=n.$implicit,i=r();de("active",e.id===i.activeDomainId()),p(3),f("nzType",e.icon||"setting"),p(3),V(e.label),p(2),V(e.description)}}var Ve=class t{keyword=I("");nodes=Je([]);activeDomainId=Je("");domainSelect=new b;selectDomain(n){this.domainSelect.emit(n.id)}filtered=j(()=>{let n=this.keyword().trim().toLowerCase();return n?this.nodes().map(e=>K(H({},e),{children:(e.children??[]).filter(i=>(i.label??"").toLowerCase().includes(n)||(i.relPath??"").toLowerCase().includes(n))})).filter(e=>(e.children?.length??0)>0):this.nodes()});static \u0275fac=function(e){return new(e||t)};static \u0275cmp=w({type:t,selectors:[["app-config-nav-component"]],inputs:{nodes:[1,"nodes"],activeDomainId:[1,"activeDomainId"]},outputs:{domainSelect:"domainSelect"},decls:8,vars:1,consts:[[1,"list"],[1,"topbar"],["nzInputPrefix","","nzType","search",1,"search-icon"],["nz-input","","placeholder","",3,"ngModelChange","ngModel"],[1,"items"],[1,"item",3,"active"],[1,"item",3,"click"],[1,"row"],[1,"icon"],["nzTheme","outline",1,"project-suffix-icon",3,"nzType"],[1,"info"],[1,"name"],[1,"description"]],template:function(e,i){e&1&&(s(0,"div",0)(1,"div",1)(2,"nz-input-wrapper"),T(3,"nz-icon",2),s(4,"input",3),C("ngModelChange",function(a){return i.keyword.set(a)}),l()()(),s(5,"div",4),S(6,Xn,9,5,"div",5,Gn),l()()),e&2&&(p(4),f("ngModel",i.keyword()),p(2),N(i.filtered()))},dependencies:[O,le,Me,re,se,Z,ce,Qt,Lt,$,ee],styles:[".list[_ngcontent-%COMP%]{height:100%;width:100%;display:flex;flex-direction:column}.list[_ngcontent-%COMP%] .topbar[_ngcontent-%COMP%]{flex:0 0 auto;display:flex;align-items:center;justify-content:space-between;padding:10px 16px}.list[_ngcontent-%COMP%] .topbar[_ngcontent-%COMP%] nz-input-wrapper[_ngcontent-%COMP%]{width:100%;border-radius:18px}.list[_ngcontent-%COMP%] .items[_ngcontent-%COMP%]{flex:1 1 auto;overflow:auto;height:0;display:flex;flex-direction:column;gap:8px;padding:8px}.list[_ngcontent-%COMP%] .items[_ngcontent-%COMP%] .item[_ngcontent-%COMP%]{border-radius:3px;padding:10px;cursor:pointer}.list[_ngcontent-%COMP%] .items[_ngcontent-%COMP%] .item[_ngcontent-%COMP%]:hover, .list[_ngcontent-%COMP%] .items[_ngcontent-%COMP%] .item.active[_ngcontent-%COMP%]{background:var(--app-primary-2)}.list[_ngcontent-%COMP%] .items[_ngcontent-%COMP%] .item[_ngcontent-%COMP%] .row[_ngcontent-%COMP%]{display:flex;gap:10px;align-items:center;overflow:hidden;justify-content:space-between}.list[_ngcontent-%COMP%] .items[_ngcontent-%COMP%] .item[_ngcontent-%COMP%] .row[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{font-size:42px;flex:0 0 auto;position:relative}.list[_ngcontent-%COMP%] .items[_ngcontent-%COMP%] .item[_ngcontent-%COMP%] .row[_ngcontent-%COMP%] .info[_ngcontent-%COMP%]{flex:1 1 auto;display:flex;flex-direction:column;gap:4px;overflow:hidden}.list[_ngcontent-%COMP%] .items[_ngcontent-%COMP%] .item[_ngcontent-%COMP%] .row[_ngcontent-%COMP%] .info[_ngcontent-%COMP%] .name[_ngcontent-%COMP%]{font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.list[_ngcontent-%COMP%] .items[_ngcontent-%COMP%] .item[_ngcontent-%COMP%] .row[_ngcontent-%COMP%] .info[_ngcontent-%COMP%] .description[_ngcontent-%COMP%]{font-size:13px;color:var(--app-text-secondary);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}"]})};function ke(t,n){return n.split(".").reduce((e,i)=>e?e[i]:void 0,t)}function mn(t,n,e){let i=n.split("."),o=i.pop(),a=t;for(let E of i)a[E]??={},a=a[E];a[o]=e}function un(t){return t.sort((n,e)=>(n.domain?.nav?.order??0)-(e.domain?.nav?.order??0)).map(n=>({id:n.domain.id,type:"domain",label:n.domain.label,icon:n.domain.icon,description:n.domain.description,children:(n.docs??[]).map(e=>({id:e.spec.id,type:"doc",label:e.spec.title,docId:e.spec.id,relPath:e.chosen?.relPath,codec:e.chosen?.codec,exists:e.exists}))}))}var fn=t=>t!=null&&typeof t=="object"&&!Array.isArray(t);function Fe(t,n,e,i=""){if(e===void 0)return[];if(!fn(e))return[{scope:t,target:n,path:i||"/",value:e}];let o=[],a=Object.keys(e);if(a.length===0)return o.push({scope:t,target:n,path:i||"/",value:{}}),o;for(let E of a){let D=i?`${i}.${E}`:E,z=e[E];fn(z)?o.push(...Fe(t,n,z,D)):o.push({scope:t,target:n,path:D,value:z})}return o}var Cn=(t,n)=>n.value,ei=(t,n)=>n.key;function ti(t,n){if(t&1&&(s(0,"div",3),m(1),l()),t&2){let e=r();p(),F(" ",e.item.desc," ")}}function ni(t,n){if(t&1){let e=v();s(0,"input",8),C("ngModelChange",function(o){_(e);let a=r();return h(a.emit(o))}),l()}if(t&2){let e=r();f("ngModel",e.value)}}function ii(t,n){if(t&1){let e=v();s(0,"input",8),C("ngModelChange",function(o){_(e);let a=r();return h(a.emit(o))}),l()}if(t&2){let e=r();f("ngModel",e.value)}}function oi(t,n){if(t&1&&(s(0,"span"),m(1),l()),t&2){let e=r();p(),V(e.value)}}function ai(t,n){if(t&1&&(s(0,"nz-space",6),T(1,"nz-icon",9),s(2,"span"),m(3),l()()),t&2){let e=r();p(3),V(e.value)}}function ri(t,n){if(t&1){let e=v();s(0,"nz-switch",10),C("ngModelChange",function(o){_(e);let a=r();return h(a.emit(o))}),l()}if(t&2){let e=r();f("ngModel",e.value)}}function si(t,n){if(t&1&&T(0,"nz-option",11),t&2){let e=n.$implicit;f("nzValue",e.value)("nzLabel",e.label)}}function li(t,n){if(t&1){let e=v();s(0,"nz-select",10),C("ngModelChange",function(o){_(e);let a=r();return h(a.emit(o))}),S(1,si,1,2,"nz-option",11,Cn),l()}if(t&2){let e=r();f("ngModel",e.value),p(),N(e.options)}}function ci(t,n){if(t&1&&(s(0,"span"),m(1),l()),t&2){let e=r().$index;p(),V(e+1)}}function pi(t,n){t&1&&T(0,"nz-icon",12)}function di(t,n){if(t&1&&(T(0,"nz-icon",9),s(1,"span"),m(2),l(),y(3,pi,1,0,"nz-icon",12)),t&2){let e=n.$implicit,i=r().$implicit,o=r(3);p(2),F(" ",i==null?null:i[e.key]," "),p(),x(e!==o.arrayFields()[o.arrayFields().length-1]?3:-1)}}function mi(t,n){if(t&1&&(s(0,"nz-space"),y(1,ci,2,1,"span"),S(2,di,4,2,null,null,ei),l()),t&2){let e=r(3);p(),x(e.arrayValue().length>1?1:-1),p(),N(e.arrayFields())}}function ui(t,n){if(t&1&&S(0,mi,4,1,"nz-space",null,Et),t&2){let e=r(2);N(e.arrayValue())}}function fi(t,n){t&1&&(s(0,"span"),m(1,"\u6570\u7EC4\u7C7B\u578B\u914D\u7F6E\u9879\uFF0C\u6682\u4E0D\u652F\u6301\u8868\u5355\u7F16\u8F91"),l())}function Ci(t,n){if(t&1&&y(0,ui,2,0)(1,fi,2,0,"span"),t&2){let e=r();x(e.isArrayObjectEditor()?0:1)}}function gi(t,n){if(t&1&&(s(0,"nz-space")(1,"span",2),m(2),l(),s(3,"span",14),m(4),l()()),t&2){let e=n.$implicit;p(2),F("",e.label,":"),p(2),V(e.value)}}function _i(t,n){if(t&1&&(s(0,"div",13),S(1,gi,5,2,"nz-space",null,Cn),l()),t&2){let e=r(2);p(),N(e.objectKv())}}function hi(t,n){if(t&1&&y(0,_i,3,0,"div",13),t&2){let e=r();x(e.isObjectEditor()?0:-1)}}var Re=class t{item;value;valueChange=new b;options=[];emit(n){this.valueChange.emit(n)}isObjectEditor(){return this.item?.type==="object"}objectKv(){let n=this.value??{};return Object.values(n).map((e,i)=>typeof e=="string"?{label:Object.keys(n)[i],value:e}:{label:Object.keys(n)[i],value:JSON.stringify(e)})}isArrayObjectEditor(){return this.item?.type==="array"&&this.item?.item?.type==="object"&&Array.isArray(this.item?.item?.fields)&&this.item.item.fields.length>0}arrayFields(){return this.item?.item?.fields??[]}arrayValue(){return Array.isArray(this.value)?this.value:[]}addRow(){let n=this.arrayFields(),e={};for(let o of n)o.key&&(e[o.key]=o.default??"");let i=[...this.arrayValue(),e];this.emit(i)}removeRow(n){let i=this.arrayValue().filter((o,a)=>a!==n);this.emit(i)}updateCell(n,e,i){let a=this.arrayValue().map((E,D)=>D!==n?E:K(H({},E??{}),{[e]:i}));this.emit(a)}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=w({type:t,selectors:[["app-config-item-component"]],inputs:{item:"item",value:"value",options:"options"},outputs:{valueChange:"valueChange"},decls:14,vars:3,consts:[[1,"config-item"],[1,"meta"],[1,"label"],[1,"desc"],[1,"control"],["nz-input","",3,"ngModel"],["nzAlign","center"],[3,"ngModel"],["nz-input","",3,"ngModelChange","ngModel"],["nzType","file","nzTheme","fill"],[3,"ngModelChange","ngModel"],[3,"nzValue","nzLabel"],["nzType","arrow-right","nzTheme","outline"],[1,"kv"],[1,"value"]],template:function(e,i){if(e&1&&(s(0,"div",0)(1,"div",1)(2,"div",2),m(3),l(),y(4,ti,2,1,"div",3),l(),s(5,"div",4),y(6,ni,1,1,"input",5)(7,ii,1,1,"input",5)(8,oi,2,1,"span")(9,ai,4,1,"nz-space",6)(10,ri,1,1,"nz-switch",7)(11,li,3,1,"nz-select",7)(12,Ci,2,1)(13,hi,1,1),l()()),e&2){let o;p(3),V(i.item.label),p(),x(i.item.desc?4:-1),p(2),x((o=i.item.type)==="input"?6:o==="path"?7:o==="string"?8:o==="file"?9:o==="boolean"?10:o==="select"?11:o==="array"?12:o==="object"?13:-1)}},dependencies:[O,le,Me,re,se,$,ee,De,en,Z,ce,Ie,Se,Ne,Rt,Ft,an],styles:[".config-item[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;padding:12px 16px}.config-item[_ngcontent-%COMP%]:hover{background:var(--app-primary-2)}.config-item[_ngcontent-%COMP%] .meta[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{font-weight:500;opacity:.75}.config-item[_ngcontent-%COMP%] .meta[_ngcontent-%COMP%] .desc[_ngcontent-%COMP%]{font-size:14px;margin-top:4px;opacity:.55}.config-item[_ngcontent-%COMP%] .control[_ngcontent-%COMP%]{min-width:200px;max-width:600px;width:60%}.config-item[_ngcontent-%COMP%] .control[_ngcontent-%COMP%] input[nz-input][_ngcontent-%COMP%], .config-item[_ngcontent-%COMP%] .control[_ngcontent-%COMP%] nz-select[_ngcontent-%COMP%]{width:100%}.config-item[_ngcontent-%COMP%] .control[_ngcontent-%COMP%] .kv[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:6px;width:100%}"]})};var st=()=>[],yi=(t,n)=>n.id,gn=(t,n)=>n.key;function xi(t,n){if(t&1){let e=v();s(0,"app-config-item-component",3),C("valueChange",function(o){let a=_(e).$implicit,E=r(5);return h(E.onValueChange(o,a))}),l()}if(t&2){let e=n.$implicit,i=r(2).$implicit,o=r(3);f("item",e)("options",e.options||o.options[e.optionsRef==null?null:e.optionsRef.key]||Y(3,st))("value",o.getChild(e,i))}}function zi(t,n){if(t&1&&S(0,xi,1,4,"app-config-item-component",4,gn),t&2){let e=r().$implicit;N(e.children)}}function vi(t,n){if(t&1){let e=v();s(0,"app-config-item-component",3),C("valueChange",function(o){let a=_(e).$implicit,E=r(3);return h(E.onValueChange(o,a))}),l(),y(1,zi,2,0)}if(t&2){let e=n.$implicit,i=r(3);f("item",e)("options",e.options||i.options[e.optionsRef==null?null:e.optionsRef.key]||Y(4,st))("value",i.get(e)),p(),x(e.children!=null&&e.children.length?1:-1)}}function Ei(t,n){if(t&1&&(s(0,"section",1)(1,"h3",2),m(2),l(),S(3,vi,2,5,null,null,gn),l()),t&2){let e=n.$implicit;vt("id",e.id),p(2),V(e.label),p(),N(e.items)}}function bi(t,n){if(t&1&&S(0,Ei,5,2,"section",1,yi),t&2){let e=r().schema.sections||Y(0,st);N(e)}}function Ti(t,n){t&1&&(s(0,"div",0),m(1," \u8BE5\u914D\u7F6E\u6682\u4E0D\u652F\u6301\u8868\u5355\u6A21\u5F0F\uFF08\u53EF\u5207\u6362 Raw / \u6216\u7A0D\u540E\u5B9E\u73B0 provider\uFF09 "),l())}var je=class t{schema;vm;options={};vmChange=new b;get(n){let e=ke(this.vm,n.key);return e??n.default}getChild(n,e){let i=this.get(e);if(i==null||i==="")return n.default;let o=this.resolveDynamicPath(n.key,e.key,i),a=ke(this.vm,o);return a??n.default}onValueChange(n,e){let i=this.resolvePathForWrite(e);this.update(i,n)}resolvePathForWrite(n){let e=n.key||"",i=e.match(/<([^>]+)>/);if(!i)return e;let o=i[1],a=ke(this.vm,o);return this.resolveDynamicPath(e,o,a)}resolveDynamicPath(n,e,i){let o=`<${e}>`;return n.replace(o,String(i??""))}update(n,e){let i=structuredClone(this.vm);mn(i,n,e),this.vmChange.emit(i)}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=w({type:t,selectors:[["app-config-section-component"]],inputs:{schema:"schema",vm:"vm",options:"options"},outputs:{vmChange:"vmChange"},decls:2,vars:1,consts:[[1,"empty"],[1,"section"],[1,"section-title"],[3,"valueChange","item","options","value"],[3,"item","options","value"]],template:function(e,i){e&1&&y(0,bi,2,1)(1,Ti,2,0,"div",0),e&2&&x(i.schema?0:1)},dependencies:[O,Re],styles:[".section[_ngcontent-%COMP%]{padding:0}.section[_ngcontent-%COMP%]:last-child{border-bottom:none}.section-title[_ngcontent-%COMP%]{margin:0 0 10px;font-size:24px;opacity:.85;font-weight:500;padding:0 16px}.empty[_ngcontent-%COMP%]{padding:12px 14px}"]})};var Be=class t{api=u(Zt);getCatalog(n){return this.api.get(`/api/config/catalog/${n}`)}openInEditor(n,e){return this.api.post(`/api/config/openInEditor/${n}/${encodeURIComponent(e)}`,{})}writeDomainSchema(n,e,i){return this.api.post(`/api/config/writeSchema/${n}/${e}`,{vm:i})}getDomainSchemas(n,e){return this.api.get(`/api/config/getDomainSchema/${n}/${e}`)}diffDomainSchema(n,e,i){return this.api.post(`/api/config/diffSchema/${n}/${e}`,{vm:i})}static \u0275fac=function(e){return new(e||t)};static \u0275prov=ft({token:t,factory:t.\u0275fac,providedIn:"root"})};var Mi=["class","component"],wi=()=>({}),Di=()=>[],Si=(t,n)=>n.docId;function Ni(t,n){if(t&1&&T(0,"nz-option",13),t&2){let e=n.$implicit;f("nzLabel",e.title)("nzValue",e.docId)}}function Ii(t,n){if(t&1){let e=v();G(0),s(1,"div",11)(2,"label"),m(3,"\u9009\u62E9\u914D\u7F6E\u6587\u4EF6"),l(),s(4,"nz-select",12),Ke("ngModelChange",function(o){_(e);let a=r();return He(a.selectedDocId,o)||(a.selectedDocId=o),h(o)}),S(5,Ni,1,2,"nz-option",13,Si),l()(),X()}if(t&2){let e=r();p(4),Ze("ngModel",e.selectedDocId),p(),N(e.activeDocsMeta()||Y(1,Di))}}function Oi(t,n){if(t&1){let e=v();G(0),s(1,"button",14),C("click",function(){_(e);let o=r();return h(o.openConfig())}),m(2," \u6253\u5F00\u914D\u7F6E\u6587\u4EF6 "),l(),X()}if(t&2){let e=r();p(),f("disabled",!e.selectedDocId())}}var $e=class t{api=u(Be);projectState=u(nn);msg=u(tn);modal=u(Kt);projectId=j(()=>this.projectState.currentProjectId()||"");loading=I(!1);isModalVisible=I(!1);catalog=I(null);navNodes=j(()=>un(this.catalog()??[]));activeDomainId=I(null);selectedDocId=I(null);docStates=I({});domainSchema=I(null);domainVM=I(null);baselineDomainVM=I(null);activeDomain=j(()=>{let n=this.activeDomainId();return(this.catalog()??[]).find(e=>e.domain.id===n)??null});activeDocs=j(()=>this.activeDomain()?.docs??[]);activeDocsMeta=j(()=>{let n=this.activeDomain();return n?(n.docs??[]).map(e=>({docId:e.spec.id,title:e.spec.title,exists:e.exists,relPath:e.chosen?.relPath,codec:e.chosen?.codec})):[]});domainDirty=j(()=>{let n=this.baselineDomainVM(),e=this.domainVM();return!n||!e?!1:!ue.isEqual(n,e)});constructor(){St(()=>{this.projectId()&&this.getCatalog()})}getCatalog(){let n=this.projectId();n&&(this.loading.set(!0),this.api.getCatalog(n).subscribe({next:e=>{this.catalog.set(e);let i=e[0]?.domain?.id??"";i&&(this.activeDomainId.set(i),this.loadDomainSchema(i))},error:e=>{console.error(e),this.msg.error("\u52A0\u8F7D\u914D\u7F6E\u76EE\u5F55\u5931\u8D25")},complete:()=>this.loading.set(!1)}))}onDomainSelect(n){this.activeDomainId.set(n),n==="angular"?this.loadDomainSchema(n):this.domainVM.set(null)}async loadDomainSchema(n){let e=this.projectId();if(e){this.loading.set(!0);try{let i=await ge(this.api.getDomainSchemas(e,n));this.domainSchema.set(i),this.domainVM.set(i.vm),this.baselineDomainVM.set(ue.cloneDeep(i.vm))}catch(i){console.error(i),this.msg.error("\u52A0\u8F7D\u914D\u7F6E\u6A21\u578B\u5931\u8D25"),this.domainVM.set(null),this.baselineDomainVM.set(null)}finally{this.loading.set(!1)}}}async onDiff(){let n=this.projectId(),e=this.activeDomainId(),i=this.domainVM();if(!(!n||!e||!i)){this.loading.set(!0);try{let o=await ge(this.api.diffDomainSchema(n,e,i)),a=o?.docPatch??{},E=o?.filePatch??[],D=[];for(let[z,R]of Object.entries(a))D.push(...Fe("doc",z,R));for(let z of E)D.push(...Fe("file",z.relPath,z.patch));if(D.length===0){this.msg.info("\u6CA1\u6709\u53EF\u5199\u56DE\u7684\u53D8\u66F4");return}D.sort((z,R)=>{if(z.scope!==R.scope)return z.scope.localeCompare(R.scope);let fe=`${z.target}:${z.path}`,Ce=`${R.target}:${R.path}`;return fe.localeCompare(Ce)}),this.modal.create({nzTitle:"\u53D8\u66F4",nzContent:`
2
+ <div style="max-height:60vh; overflow:auto;">
3
+ ${D.map(z=>`
4
+ <div style="padding:8px 0; border-bottom:1px solid #f0f0f0;">
5
+ <div style="font-weight:600;">[${z.scope}] ${z.target}</div>
6
+ <div style="opacity:.85; margin-top:4px;">${z.path}</div>
7
+ <pre style="margin:6px 0;">after : ${this.safeStringify(z.value)}</pre>
8
+ </div>
9
+ `).join("")}
10
+ </div>
11
+ `,nzFooter:null,nzWidth:900})}catch(o){console.error(o),this.msg.error("\u751F\u6210 Diff \u5931\u8D25")}finally{this.loading.set(!1)}}}safeStringify(n){try{return JSON.stringify(n,null,2)}catch{return String(n)}}onReset(){let n=this.baselineDomainVM();n&&(this.domainVM.set(ue.cloneDeep(n)),this.msg.success("\u5DF2\u91CD\u7F6E\u4E3A\u672A\u4FEE\u6539\u72B6\u6001"))}onRawChange(n){let e=this.docStates(),i=e[n.docId];if(!i)return;let o=i.baselineRaw??"",a=n.raw!==o;this.docStates.set(K(H({},e),{[n.docId]:K(H({},i),{raw:n.raw,dirty:a})}))}onValuesChange(n){}async saveActive(){let n=this.projectId(),e=this.activeDomainId(),i=this.domainVM();if(!(!n||!e||!i)){this.loading.set(!0);try{await ge(this.api.writeDomainSchema(n,e,i)),this.msg.success("\u4FDD\u5B58\u6210\u529F"),await this.loadDomainSchema(e)}catch(o){console.error(o),this.msg.error("\u4FDD\u5B58\u5931\u8D25")}finally{this.loading.set(!1)}}}openConfig(){if(!this.selectedDocId()){this.msg.warning("\u8BF7\u5148\u9009\u62E9\u914D\u7F6E\u6587\u4EF6");return}this.api.openInEditor(this.projectId(),this.selectedDocId()).subscribe(n=>{this.msg.success("\u5DF2\u5728\u9ED8\u8BA4\u7F16\u8F91\u5668\u4E2D\u6253\u5F00\u8BE5\u914D\u7F6E\u6587\u4EF6"),this.isModalVisible.set(!1)})}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=w({type:t,selectors:[["app-project-conf",8,"component"]],attrs:Mi,decls:13,vars:11,consts:[[3,"title","loading"],["ngProjectAs","actions",5,["actions"]],["nz-button","","nzType","primary",3,"click"],[1,"panel"],[3,"domainSelect","nodes","activeDomainId"],[1,"content"],[3,"vmChange","schema","vm","options"],[3,"diff","reset","save","dirty"],["nzTitle","\u914D\u7F6E",3,"nzVisibleChange","nzOnCancel","nzVisible","nzMaskClosable"],[4,"nzModalContent"],[4,"nzModalFooter"],[1,"modal-body"],["nzPlaceHolder","\u8BF7\u9009\u62E9\u914D\u7F6E\u6587\u4EF6",2,"width","100%",3,"ngModelChange","ngModel"],[3,"nzLabel","nzValue"],["nz-button","","nzType","primary",3,"click","disabled"]],template:function(e,i){if(e&1&&(s(0,"app-page-layout",0),G(1,1),s(2,"button",2),C("click",function(){return i.isModalVisible.set(!0)}),m(3,"\u6253\u5F00\u914D\u7F6E\u6587\u4EF6"),l(),T(4,"app-ng-devtool"),X(),s(5,"div",3)(6,"app-config-nav-component",4),C("domainSelect",function(a){return i.onDomainSelect(a)}),l(),s(7,"div",5)(8,"app-config-section-component",6),C("vmChange",function(a){return i.domainVM.set(a)}),l(),s(9,"app-config-change-bar-component",7),C("diff",function(){return i.onDiff()})("reset",function(){return i.onReset()})("save",function(){return i.saveActive()}),l()()()(),s(10,"nz-modal",8),Ke("nzVisibleChange",function(a){return He(i.isModalVisible,a)||(i.isModalVisible=a),a}),C("nzOnCancel",function(){return i.isModalVisible.set(!1)}),J(11,Ii,7,2,"ng-container",9)(12,Oi,3,1,"ng-container",10),l()),e&2){let o,a;f("title","\u9879\u76EE\u914D\u7F6E")("loading",i.loading()),p(6),f("nodes",i.navNodes())("activeDomainId",i.activeDomainId()??""),p(2),f("schema",(o=i.domainSchema())==null?null:o.schema)("vm",i.domainVM())("options",((a=i.domainSchema())==null?null:a.options)??Y(10,wi)),p(),f("dirty",i.domainDirty()),p(),Ze("nzVisible",i.isModalVisible),f("nzMaskClosable",!1)}},dependencies:[O,le,re,se,At,on,Ht,sn,Z,Ie,Se,Ne,De,Te,be,ve,Ee,pn,qt,me,Ut,$,Ve,Oe,Yt,Xt,Gt,Jt,je,Wt],styles:[".panel[_ngcontent-%COMP%]{border-radius:10px;box-shadow:0 2px 8px #0000000f;display:flex}.panel[_ngcontent-%COMP%] app-config-nav-component[_ngcontent-%COMP%]{flex:0 0 300px}.panel[_ngcontent-%COMP%] .content[_ngcontent-%COMP%]{flex:1 1 auto;display:flex;flex-direction:column;padding:8px 16px}.panel[_ngcontent-%COMP%] .content[_ngcontent-%COMP%] app-config-section-component[_ngcontent-%COMP%]{flex:1 1 auto;overflow:hidden}.panel[_ngcontent-%COMP%] .content[_ngcontent-%COMP%] app-config-change-bar-component[_ngcontent-%COMP%]{flex:0 0 auto;position:sticky;bottom:0}"]})};var Pi=[{path:"",component:$e}],Ae=class t{static \u0275fac=function(e){return new(e||t)};static \u0275mod=Q({type:t});static \u0275inj=L({imports:[Ge.forChild(Pi),Ge]})};var _n=class t{static \u0275fac=function(e){return new(e||t)};static \u0275mod=Q({type:t});static \u0275inj=L({imports:[O,Ae]})};export{_n as ConfigurationModule};
@@ -1 +1 @@
1
- import{a as Ie,b as Oe}from"./chunk-6ZXMOHQD.js";import"./chunk-SIVPP74B.js";import{b as je}from"./chunk-ZJKBRM7K.js";import{a as Se,b as Fe}from"./chunk-IGJYBE5M.js";import"./chunk-HZ73CM45.js";import{b as ce,c as de,d as ue,e as De,g as Pe,h as Te}from"./chunk-34QRY4VA.js";import"./chunk-SNCDDYQR.js";import{G as be,I as Ne,g as we}from"./chunk-A6CKMRBS.js";import{Cb as ye,Eb as Me,M as oe,N as re,O as ae,P as pe,V as se,Y as le,Z as me,ib as ge,kb as fe,ob as _e,sb as ze,vb as Ce,xb as ve,yb as he,zb as xe}from"./chunk-J43J3F2V.js";import"./chunk-HFZLJHYR.js";import{B as U,d as ie,i as E}from"./chunk-53YRDYLS.js";import{$b as J,B as q,Dc as K,Eb as O,Fb as y,Fc as Q,Ha as z,Ic as s,Jc as b,Kb as M,Kc as F,Mc as X,Nc as Y,Oc as Z,Tc as ee,Ub as W,V as P,Vb as C,Wc as $,Xb as v,_b as H,a as d,ac as c,ad as te,b as u,bc as r,cc as a,dc as g,fd as N,gd as ne,hc as j,ic as S,jc as R,kc as T,ma as G,mb as p,na as h,qc as w,ra as _,tc as l,vd as A,xa as x,ya as D}from"./chunk-SJG2JCPL.js";function Ve(n,t){if(n&1&&(j(0),s(1),S()),n&2){let e=l(2);p(),b(e.nzText)}}function Be(n,t){if(n&1&&(r(0,"span",0),M(1,Ve,2,1,"ng-container",1),a()),n&2){let e=l();p(),c("nzStringTemplateOutlet",e.nzText)}}var L=(()=>{class n{nzText;nzType="horizontal";nzOrientation="center";nzVariant="solid";nzSize;nzDashed=!1;nzPlain=!1;static \u0275fac=function(o){return new(o||n)};static \u0275cmp=O({type:n,selectors:[["nz-divider"]],hostAttrs:[1,"ant-divider"],hostVars:22,hostBindings:function(o,i){o&2&&Q("ant-divider-horizontal",i.nzType==="horizontal")("ant-divider-vertical",i.nzType==="vertical")("ant-divider-with-text",i.nzText)("ant-divider-plain",i.nzPlain)("ant-divider-with-text-left",i.nzText&&i.nzOrientation==="left")("ant-divider-with-text-right",i.nzText&&i.nzOrientation==="right")("ant-divider-with-text-center",i.nzText&&i.nzOrientation==="center")("ant-divider-dashed",i.nzDashed||i.nzVariant==="dashed")("ant-divider-dotted",i.nzVariant==="dotted")("ant-divider-sm",i.nzSize==="small")("ant-divider-md",i.nzSize==="middle")},inputs:{nzText:"nzText",nzType:"nzType",nzOrientation:"nzOrientation",nzVariant:"nzVariant",nzSize:"nzSize",nzDashed:[2,"nzDashed","nzDashed",A],nzPlain:[2,"nzPlain","nzPlain",A]},exportAs:["nzDivider"],decls:1,vars:1,consts:[[1,"ant-divider-inner-text"],[4,"nzStringTemplateOutlet"]],template:function(o,i){o&1&&C(0,Be,2,1,"span",0),o&2&&v(i.nzText?0:-1)},dependencies:[pe,ae],encapsulation:2,changeDetection:0})}return n})(),Ee=(()=>{class n{static \u0275fac=function(o){return new(o||n)};static \u0275mod=y({type:n});static \u0275inj=h({imports:[L]})}return n})();var I=class n{api=_(we);getDeps(t){return this.api.get(`/api/deps/list/${t}`).pipe(q(e=>({items:[...e.dependencies.map(i=>u(d({},i),{group:"dependencies"})),...e.devDependencies.map(i=>u(d({},i),{group:"devDependencies"}))],meta:e.meta})))}install(t,e){return this.api.post(`/api/deps/install/${t}`,e)}uninstall(t,e){return this.api.post(`/api/deps/uninstall/${t}`,e)}installDevtools(t){return this.api.post(`/api/deps/devtools/install/${t}`,{tool:"devtools"})}static \u0275fac=function(e){return new(e||n)};static \u0275prov=G({token:n,factory:n.\u0275fac,providedIn:"root"})};var $e=["class","component"],Ae=n=>({$implicit:n,title:"\u8FD0\u884C\u4F9D\u8D56"}),Ue=n=>({$implicit:n,title:"\u5F00\u53D1\u4F9D\u8D56"});function Le(n,t){n&1&&R(0)}function qe(n,t){n&1&&R(0)}function Ge(n,t){n&1&&(r(0,"nz-tag",20),s(1,"\u5DF2\u5B89\u88C5"),a())}function We(n,t){n&1&&(r(0,"nz-tag",21),s(1,"\u672A\u5B89\u88C5"),a())}function He(n,t){if(n&1){let e=T();r(0,"button",27),w("click",function(){x(e);let i=l().$implicit,m=l(2);return D(m.installOrUpdate(i))}),g(1,"nz-icon",28),a()}if(n&2){let e=l().$implicit,o=l(2);c("nzLoading",o.installing()[e.name])("nz-tooltip",e.hasUpdate?"\u66F4\u65B0\u5230\u6700\u65B0\u7248\u672C":"\u5B89\u88C5\u4F9D\u8D56")}}function Je(n,t){if(n&1){let e=T();r(0,"button",29),w("nzOnConfirm",function(){x(e);let i=l().$implicit,m=l(2);return D(m.uninstall(i))}),g(1,"nz-icon",30),a()}if(n&2){let e=l().$implicit;c("nzPopconfirmTitle",ee("\u786E\u5B9A\u5378\u8F7D ",e.name,"\uFF1F")),p(),c("nz-tooltip","\u5378\u8F7D"+e.name)}}function Ke(n,t){if(n&1){let e=T();r(0,"div",9)(1,"div",11)(2,"div",12)(3,"div",13),g(4,"span",14),a(),r(5,"div",15)(6,"div",16),s(7),a(),r(8,"div",17)(9,"span"),s(10),a(),r(11,"span",18),s(12,"\xB7"),a(),r(13,"span"),s(14),a(),r(15,"span",18),s(16,"\xB7"),a(),r(17,"span"),s(18),a()()()(),r(19,"div",19),C(20,Ge,2,0,"nz-tag",20)(21,We,2,0,"nz-tag",21),r(22,"a",22),w("click",function(){let i=x(e).$implicit,m=l(2);return D(m.openDetail(i))}),g(23,"span",23),s(24," \u67E5\u770B\u8BE6\u60C5 "),a()(),r(25,"div",24),C(26,He,2,2,"button",25),C(27,Je,2,3,"button",26),a()()()}if(n&2){let e=t.$implicit;p(7),b(e.name),p(3),F("\u7248\u672C ",e.current||"-"),p(4),F("\u8981\u6C42 ",e.required||"-"),p(4),F("\u6700\u65B0 ",e.latest||"-"),p(2),v(e.installed?20:21),p(6),v(e.hasUpdate||!e.installed?26:-1),p(),v(e.installed?27:-1)}}function Qe(n,t){n&1&&(r(0,"div",10),s(1,"\u65E0\u6570\u636E"),a())}function Xe(n,t){if(n&1&&(r(0,"div",7),s(1),a(),r(2,"div",8),H(3,Ke,28,7,"div",9,W().trackByName,!0),C(5,Qe,2,0,"div",10),a()),n&2){let e=t.$implicit,o=t.title;p(),b(o),p(2),J(e),p(2),v(e.length===0?5:-1)}}var V=class n{api=_(I);msg=_(be);projectId=N(()=>this.projectState.currentProjectId()||"");loading=z(!1);keyword=z("");items=z([]);meta=z(null);installing=z({});uninstalling=z({});runtimeItems=N(()=>this.filterItems(this.items().filter(t=>t.group==="dependencies")));devItems=N(()=>this.filterItems(this.items().filter(t=>t.group==="devDependencies")));runningCount=N(()=>this.items().filter(t=>t.hasUpdate).length);projectState=_(Ne);depsState=_(I);constructor(){ne(async()=>{this.refresh()})}filterItems(t){let e=this.keyword().trim().toLowerCase();return e?t.filter(o=>o.name.toLowerCase().includes(e)):t}refresh(){this.loading.set(!0),this.api.getDeps(this.projectId()).pipe(P(()=>this.loading.set(!1))).subscribe({next:({items:t,meta:e})=>{this.items.set(t),this.meta.set(e)},error:t=>this.msg.error(t?.message||"\u52A0\u8F7D\u4F9D\u8D56\u5931\u8D25")})}openDetail(t){t.homepage?window.open(t.homepage,"_blank"):window.open(`https://www.npmjs.com/package/${encodeURIComponent(t.name)}`,"_blank")}installOrUpdate(t){let e=t.name;this.installing.set(u(d({},this.installing()),{[e]:!0}));let o=t.installed&&t.hasUpdate?"latest":"required",i=t.installed&&t.hasUpdate?"\u5DF2\u66F4\u65B0":"\u5DF2\u5B89\u88C5";this.api.install(this.projectId(),{name:t.name,group:t.group,target:o}).pipe(P(()=>this.installing.set(u(d({},this.installing()),{[e]:!1})))).subscribe({next:()=>{this.msg.success(i),this.refresh()}})}uninstall(t){let e=t.name;this.uninstalling.set(u(d({},this.uninstalling()),{[e]:!0})),this.api.uninstall(this.projectId(),{name:t.name,group:t.group}).pipe(P(()=>this.uninstalling.set(u(d({},this.uninstalling()),{[e]:!1})))).subscribe({next:()=>{this.msg.success("\u5DF2\u5378\u8F7D"),this.refresh()}})}installDevtools(){this.loading.set(!0),this.api.installDevtools(this.projectId()).pipe(P(()=>this.loading.set(!1))).subscribe({next:()=>{this.msg.success("devtools \u5DF2\u5B89\u88C5"),this.refresh()},error:t=>this.msg.error(t?.message||"devtools \u5B89\u88C5\u5931\u8D25")})}installAll(){let t=this.items().filter(o=>!o.installed);if(!t.length){this.msg.info("\u6CA1\u6709\u9700\u8981\u5B89\u88C5\u7684\u4F9D\u8D56");return}(async()=>{this.loading.set(!0);try{for(let o of t)await new Promise((i,m)=>{this.api.install(this.projectId(),{name:o.name,group:o.group,target:"required"}).subscribe({next:()=>i(),error:f=>m(f)})});this.msg.success("\u5DF2\u5B8C\u6210\u5B89\u88C5"),this.refresh()}catch{this.msg.error("\u6279\u91CF\u5B89\u88C5\u5931\u8D25")}finally{this.loading.set(!1)}})()}trackByName(t,e){return e.group+":"+e.name}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=O({type:n,selectors:[["app-project-deps",8,"component"]],attrs:$e,decls:12,vars:11,consts:[["contentTemplate",""],[3,"title","loading"],["ngProjectAs","actions",5,["actions"]],["nz-input","","placeholder","\u641C\u7D22",1,"search",3,"ngModelChange","ngModel"],["nzType","search","nzInputPrefix",""],[1,"panel"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"group-title"],[1,"list"],[1,"row"],[1,"empty"],["nz-row","","nzAlign","middle",1,"row-inner"],["nz-col","","nzFlex","400px",1,"left"],[1,"pkg-icon"],["nz-icon","","nzType","appstore"],[1,"pkg"],[1,"name"],[1,"sub"],[1,"sep"],["nz-col","","nzFlex","auto",1,"mid"],["nzColor","success"],["nzColor","warning"],[1,"detail",3,"click"],["nz-icon","","nzType","link"],["nz-col","","nzFlex","180px",1,"right"],["nz-button","","nzType","text",3,"nzLoading","nz-tooltip"],["nz-button","","nzType","text","nz-popconfirm","",3,"nzPopconfirmTitle"],["nz-button","","nzType","text",3,"click","nzLoading","nz-tooltip"],["nzType","download"],["nz-button","","nzType","text","nz-popconfirm","",3,"nzOnConfirm","nzPopconfirmTitle"],["nzType","delete","nzTheme","fill",3,"nz-tooltip"]],template:function(e,o){if(e&1){let i=T();r(0,"page-layout",1),j(1,2),g(2,"app-ng-devtool"),r(3,"nz-input-wrapper")(4,"input",3),Z("ngModelChange",function(f){return x(i),Y(o.keyword,f)||(o.keyword=f),D(f)}),w("ngModelChange",function(f){return x(i),D(o.keyword.set(f))}),a(),g(5,"nz-icon",4),a(),S(),r(6,"div",5),M(7,Le,1,0,"ng-container",6),g(8,"nz-divider"),M(9,qe,1,0,"ng-container",6),a()(),M(10,Xe,6,2,"ng-template",null,0,te)}if(e&2){let i=K(11);c("title","\u9879\u76EE\u914D\u7F6E")("loading",o.loading()),p(4),X("ngModel",o.keyword),p(3),c("ngTemplateOutlet",i)("ngTemplateOutletContext",$(7,Ae,o.runtimeItems())),p(2),c("ngTemplateOutlet",i)("ngTemplateOutletContext",$(9,Ue,o.devItems()))}},dependencies:[E,ie,ze,ge,fe,_e,ue,de,ce,me,le,se,xe,ve,he,Ce,re,oe,Me,ye,Fe,Se,je,Ee,L,Oe,Ie,Pe,Te,De],styles:[".panel[_ngcontent-%COMP%]{border-radius:10px;padding:16px 18px;box-shadow:0 2px 8px #0000000f}.group-title[_ngcontent-%COMP%]{font-size:18px;font-weight:600;margin:6px 0 12px;opacity:.65}.list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:10px}.row[_ngcontent-%COMP%]{border-radius:10px}.row[_ngcontent-%COMP%]:hover{box-shadow:0 4px 12px #0000001a;background:var(--app-primary-3)}.row-inner[_ngcontent-%COMP%]{padding:10px 12px}.left[_ngcontent-%COMP%]{display:flex;align-items:center;gap:12px}.left[_ngcontent-%COMP%] .pkg-icon[_ngcontent-%COMP%]{width:34px;height:34px;border-radius:8px;opacity:.65;display:inline-flex;align-items:center;justify-content:center}.left[_ngcontent-%COMP%] .pkg[_ngcontent-%COMP%] .name[_ngcontent-%COMP%]{font-weight:600;line-height:18px}.left[_ngcontent-%COMP%] .pkg[_ngcontent-%COMP%] .sub[_ngcontent-%COMP%]{margin-top:2px;font-size:12px;opacity:.55}.left[_ngcontent-%COMP%] .pkg[_ngcontent-%COMP%] .sub[_ngcontent-%COMP%] .sep[_ngcontent-%COMP%]{margin:0 6px}.mid[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;gap:8px}.mid[_ngcontent-%COMP%] .detail[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:4px;color:var(--text-color-primary)}.right[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:flex-end;gap:6px}.empty[_ngcontent-%COMP%]{padding:16px 0;text-align:center}"]})};var Ye=[{path:"",component:V}],B=class n{static \u0275fac=function(e){return new(e||n)};static \u0275mod=y({type:n});static \u0275inj=h({imports:[U.forChild(Ye),U]})};var ke=class n{static \u0275fac=function(e){return new(e||n)};static \u0275mod=y({type:n});static \u0275inj=h({imports:[E,B]})};export{ke as DependenciesModule};
1
+ import{a as Ie,b as Oe}from"./chunk-5IUYSJVD.js";import"./chunk-SIVPP74B.js";import{b as je}from"./chunk-POZS3PD3.js";import{a as Se,b as Fe}from"./chunk-3N7T4ZJF.js";import"./chunk-HZ73CM45.js";import{b as ce,c as de,d as ue,e as De,g as Pe,h as Te}from"./chunk-ROB7EMN5.js";import"./chunk-SNCDDYQR.js";import{G as be,I as Ne,g as we}from"./chunk-FPDGZ3ZC.js";import{Ab as ve,Bb as he,Cb as xe,Fb as ye,Hb as Me,M as oe,N as re,O as ae,P as pe,V as se,Y as le,Z as me,jb as ge,lb as fe,pb as _e,vb as ze,yb as Ce}from"./chunk-PTMJ422K.js";import"./chunk-HFZLJHYR.js";import{B as U,d as ie,i as E}from"./chunk-53YRDYLS.js";import{$b as J,B as q,Dc as K,Eb as O,Fb as y,Fc as Q,Ha as z,Ic as s,Jc as b,Kb as M,Kc as F,Mc as X,Nc as Y,Oc as Z,Tc as ee,Ub as W,V as P,Vb as C,Wc as $,Xb as v,_b as H,a as d,ac as c,ad as te,b as u,bc as r,cc as a,dc as g,fd as N,gd as ne,hc as j,ic as S,jc as R,kc as T,ma as G,mb as p,na as h,qc as w,ra as _,tc as l,vd as A,xa as x,ya as D}from"./chunk-SJG2JCPL.js";function Ve(n,t){if(n&1&&(j(0),s(1),S()),n&2){let e=l(2);p(),b(e.nzText)}}function Be(n,t){if(n&1&&(r(0,"span",0),M(1,Ve,2,1,"ng-container",1),a()),n&2){let e=l();p(),c("nzStringTemplateOutlet",e.nzText)}}var L=(()=>{class n{nzText;nzType="horizontal";nzOrientation="center";nzVariant="solid";nzSize;nzDashed=!1;nzPlain=!1;static \u0275fac=function(o){return new(o||n)};static \u0275cmp=O({type:n,selectors:[["nz-divider"]],hostAttrs:[1,"ant-divider"],hostVars:22,hostBindings:function(o,i){o&2&&Q("ant-divider-horizontal",i.nzType==="horizontal")("ant-divider-vertical",i.nzType==="vertical")("ant-divider-with-text",i.nzText)("ant-divider-plain",i.nzPlain)("ant-divider-with-text-left",i.nzText&&i.nzOrientation==="left")("ant-divider-with-text-right",i.nzText&&i.nzOrientation==="right")("ant-divider-with-text-center",i.nzText&&i.nzOrientation==="center")("ant-divider-dashed",i.nzDashed||i.nzVariant==="dashed")("ant-divider-dotted",i.nzVariant==="dotted")("ant-divider-sm",i.nzSize==="small")("ant-divider-md",i.nzSize==="middle")},inputs:{nzText:"nzText",nzType:"nzType",nzOrientation:"nzOrientation",nzVariant:"nzVariant",nzSize:"nzSize",nzDashed:[2,"nzDashed","nzDashed",A],nzPlain:[2,"nzPlain","nzPlain",A]},exportAs:["nzDivider"],decls:1,vars:1,consts:[[1,"ant-divider-inner-text"],[4,"nzStringTemplateOutlet"]],template:function(o,i){o&1&&C(0,Be,2,1,"span",0),o&2&&v(i.nzText?0:-1)},dependencies:[pe,ae],encapsulation:2,changeDetection:0})}return n})(),Ee=(()=>{class n{static \u0275fac=function(o){return new(o||n)};static \u0275mod=y({type:n});static \u0275inj=h({imports:[L]})}return n})();var I=class n{api=_(we);getDeps(t){return this.api.get(`/api/deps/list/${t}`).pipe(q(e=>({items:[...e.dependencies.map(i=>u(d({},i),{group:"dependencies"})),...e.devDependencies.map(i=>u(d({},i),{group:"devDependencies"}))],meta:e.meta})))}install(t,e){return this.api.post(`/api/deps/install/${t}`,e)}uninstall(t,e){return this.api.post(`/api/deps/uninstall/${t}`,e)}installDevtools(t){return this.api.post(`/api/deps/devtools/install/${t}`,{tool:"devtools"})}static \u0275fac=function(e){return new(e||n)};static \u0275prov=G({token:n,factory:n.\u0275fac,providedIn:"root"})};var $e=["class","component"],Ae=n=>({$implicit:n,title:"\u8FD0\u884C\u4F9D\u8D56"}),Ue=n=>({$implicit:n,title:"\u5F00\u53D1\u4F9D\u8D56"});function Le(n,t){n&1&&R(0)}function qe(n,t){n&1&&R(0)}function Ge(n,t){n&1&&(r(0,"nz-tag",20),s(1,"\u5DF2\u5B89\u88C5"),a())}function We(n,t){n&1&&(r(0,"nz-tag",21),s(1,"\u672A\u5B89\u88C5"),a())}function He(n,t){if(n&1){let e=T();r(0,"button",27),w("click",function(){x(e);let i=l().$implicit,m=l(2);return D(m.installOrUpdate(i))}),g(1,"nz-icon",28),a()}if(n&2){let e=l().$implicit,o=l(2);c("nzLoading",o.installing()[e.name])("nz-tooltip",e.hasUpdate?"\u66F4\u65B0\u5230\u6700\u65B0\u7248\u672C":"\u5B89\u88C5\u4F9D\u8D56")}}function Je(n,t){if(n&1){let e=T();r(0,"button",29),w("nzOnConfirm",function(){x(e);let i=l().$implicit,m=l(2);return D(m.uninstall(i))}),g(1,"nz-icon",30),a()}if(n&2){let e=l().$implicit;c("nzPopconfirmTitle",ee("\u786E\u5B9A\u5378\u8F7D ",e.name,"\uFF1F")),p(),c("nz-tooltip","\u5378\u8F7D"+e.name)}}function Ke(n,t){if(n&1){let e=T();r(0,"div",9)(1,"div",11)(2,"div",12)(3,"div",13),g(4,"span",14),a(),r(5,"div",15)(6,"div",16),s(7),a(),r(8,"div",17)(9,"span"),s(10),a(),r(11,"span",18),s(12,"\xB7"),a(),r(13,"span"),s(14),a(),r(15,"span",18),s(16,"\xB7"),a(),r(17,"span"),s(18),a()()()(),r(19,"div",19),C(20,Ge,2,0,"nz-tag",20)(21,We,2,0,"nz-tag",21),r(22,"a",22),w("click",function(){let i=x(e).$implicit,m=l(2);return D(m.openDetail(i))}),g(23,"span",23),s(24," \u67E5\u770B\u8BE6\u60C5 "),a()(),r(25,"div",24),C(26,He,2,2,"button",25),C(27,Je,2,3,"button",26),a()()()}if(n&2){let e=t.$implicit;p(7),b(e.name),p(3),F("\u7248\u672C ",e.current||"-"),p(4),F("\u8981\u6C42 ",e.required||"-"),p(4),F("\u6700\u65B0 ",e.latest||"-"),p(2),v(e.installed?20:21),p(6),v(e.hasUpdate||!e.installed?26:-1),p(),v(e.installed?27:-1)}}function Qe(n,t){n&1&&(r(0,"div",10),s(1,"\u65E0\u6570\u636E"),a())}function Xe(n,t){if(n&1&&(r(0,"div",7),s(1),a(),r(2,"div",8),H(3,Ke,28,7,"div",9,W().trackByName,!0),C(5,Qe,2,0,"div",10),a()),n&2){let e=t.$implicit,o=t.title;p(),b(o),p(2),J(e),p(2),v(e.length===0?5:-1)}}var V=class n{api=_(I);msg=_(be);projectId=N(()=>this.projectState.currentProjectId()||"");loading=z(!1);keyword=z("");items=z([]);meta=z(null);installing=z({});uninstalling=z({});runtimeItems=N(()=>this.filterItems(this.items().filter(t=>t.group==="dependencies")));devItems=N(()=>this.filterItems(this.items().filter(t=>t.group==="devDependencies")));runningCount=N(()=>this.items().filter(t=>t.hasUpdate).length);projectState=_(Ne);depsState=_(I);constructor(){ne(async()=>{this.refresh()})}filterItems(t){let e=this.keyword().trim().toLowerCase();return e?t.filter(o=>o.name.toLowerCase().includes(e)):t}refresh(){this.loading.set(!0),this.api.getDeps(this.projectId()).pipe(P(()=>this.loading.set(!1))).subscribe({next:({items:t,meta:e})=>{this.items.set(t),this.meta.set(e)},error:t=>this.msg.error(t?.message||"\u52A0\u8F7D\u4F9D\u8D56\u5931\u8D25")})}openDetail(t){t.homepage?window.open(t.homepage,"_blank"):window.open(`https://www.npmjs.com/package/${encodeURIComponent(t.name)}`,"_blank")}installOrUpdate(t){let e=t.name;this.installing.set(u(d({},this.installing()),{[e]:!0}));let o=t.installed&&t.hasUpdate?"latest":"required",i=t.installed&&t.hasUpdate?"\u5DF2\u66F4\u65B0":"\u5DF2\u5B89\u88C5";this.api.install(this.projectId(),{name:t.name,group:t.group,target:o}).pipe(P(()=>this.installing.set(u(d({},this.installing()),{[e]:!1})))).subscribe({next:()=>{this.msg.success(i),this.refresh()}})}uninstall(t){let e=t.name;this.uninstalling.set(u(d({},this.uninstalling()),{[e]:!0})),this.api.uninstall(this.projectId(),{name:t.name,group:t.group}).pipe(P(()=>this.uninstalling.set(u(d({},this.uninstalling()),{[e]:!1})))).subscribe({next:()=>{this.msg.success("\u5DF2\u5378\u8F7D"),this.refresh()}})}installDevtools(){this.loading.set(!0),this.api.installDevtools(this.projectId()).pipe(P(()=>this.loading.set(!1))).subscribe({next:()=>{this.msg.success("devtools \u5DF2\u5B89\u88C5"),this.refresh()},error:t=>this.msg.error(t?.message||"devtools \u5B89\u88C5\u5931\u8D25")})}installAll(){let t=this.items().filter(o=>!o.installed);if(!t.length){this.msg.info("\u6CA1\u6709\u9700\u8981\u5B89\u88C5\u7684\u4F9D\u8D56");return}(async()=>{this.loading.set(!0);try{for(let o of t)await new Promise((i,m)=>{this.api.install(this.projectId(),{name:o.name,group:o.group,target:"required"}).subscribe({next:()=>i(),error:f=>m(f)})});this.msg.success("\u5DF2\u5B8C\u6210\u5B89\u88C5"),this.refresh()}catch{this.msg.error("\u6279\u91CF\u5B89\u88C5\u5931\u8D25")}finally{this.loading.set(!1)}})()}trackByName(t,e){return e.group+":"+e.name}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=O({type:n,selectors:[["app-project-deps",8,"component"]],attrs:$e,decls:12,vars:11,consts:[["contentTemplate",""],[3,"title","loading"],["ngProjectAs","actions",5,["actions"]],["nz-input","","placeholder","\u641C\u7D22",1,"search",3,"ngModelChange","ngModel"],["nzType","search","nzInputPrefix",""],[1,"panel"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"group-title"],[1,"list"],[1,"row"],[1,"empty"],["nz-row","","nzAlign","middle",1,"row-inner"],["nz-col","","nzFlex","400px",1,"left"],[1,"pkg-icon"],["nz-icon","","nzType","appstore"],[1,"pkg"],[1,"name"],[1,"sub"],[1,"sep"],["nz-col","","nzFlex","auto",1,"mid"],["nzColor","success"],["nzColor","warning"],[1,"detail",3,"click"],["nz-icon","","nzType","link"],["nz-col","","nzFlex","180px",1,"right"],["nz-button","","nzType","text",3,"nzLoading","nz-tooltip"],["nz-button","","nzType","text","nz-popconfirm","",3,"nzPopconfirmTitle"],["nz-button","","nzType","text",3,"click","nzLoading","nz-tooltip"],["nzType","download"],["nz-button","","nzType","text","nz-popconfirm","",3,"nzOnConfirm","nzPopconfirmTitle"],["nzType","delete","nzTheme","fill",3,"nz-tooltip"]],template:function(e,o){if(e&1){let i=T();r(0,"app-page-layout",1),j(1,2),g(2,"app-ng-devtool"),r(3,"nz-input-wrapper")(4,"input",3),Z("ngModelChange",function(f){return x(i),Y(o.keyword,f)||(o.keyword=f),D(f)}),w("ngModelChange",function(f){return x(i),D(o.keyword.set(f))}),a(),g(5,"nz-icon",4),a(),S(),r(6,"div",5),M(7,Le,1,0,"ng-container",6),g(8,"nz-divider"),M(9,qe,1,0,"ng-container",6),a()(),M(10,Xe,6,2,"ng-template",null,0,te)}if(e&2){let i=K(11);c("title","\u9879\u76EE\u914D\u7F6E")("loading",o.loading()),p(4),X("ngModel",o.keyword),p(3),c("ngTemplateOutlet",i)("ngTemplateOutletContext",$(7,Ae,o.runtimeItems())),p(2),c("ngTemplateOutlet",i)("ngTemplateOutletContext",$(9,Ue,o.devItems()))}},dependencies:[E,ie,ze,ge,fe,_e,ue,de,ce,me,le,se,xe,ve,he,Ce,re,oe,Me,ye,Fe,Se,je,Ee,L,Oe,Ie,Pe,Te,De],styles:[".panel[_ngcontent-%COMP%]{border-radius:10px;padding:16px 18px;box-shadow:0 2px 8px #0000000f}.group-title[_ngcontent-%COMP%]{font-size:18px;font-weight:600;margin:6px 0 12px;opacity:.65}.list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:10px}.row[_ngcontent-%COMP%]{border-radius:10px}.row[_ngcontent-%COMP%]:hover{box-shadow:0 4px 12px #0000001a;background:var(--app-primary-3)}.row-inner[_ngcontent-%COMP%]{padding:10px 12px}.left[_ngcontent-%COMP%]{display:flex;align-items:center;gap:12px}.left[_ngcontent-%COMP%] .pkg-icon[_ngcontent-%COMP%]{width:34px;height:34px;border-radius:8px;opacity:.65;display:inline-flex;align-items:center;justify-content:center}.left[_ngcontent-%COMP%] .pkg[_ngcontent-%COMP%] .name[_ngcontent-%COMP%]{font-weight:600;line-height:18px}.left[_ngcontent-%COMP%] .pkg[_ngcontent-%COMP%] .sub[_ngcontent-%COMP%]{margin-top:2px;font-size:12px;opacity:.55}.left[_ngcontent-%COMP%] .pkg[_ngcontent-%COMP%] .sub[_ngcontent-%COMP%] .sep[_ngcontent-%COMP%]{margin:0 6px}.mid[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;gap:8px}.mid[_ngcontent-%COMP%] .detail[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:4px;color:var(--text-color-primary)}.right[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:flex-end;gap:6px}.empty[_ngcontent-%COMP%]{padding:16px 0;text-align:center}"]})};var Ye=[{path:"",component:V}],B=class n{static \u0275fac=function(e){return new(e||n)};static \u0275mod=y({type:n});static \u0275inj=h({imports:[U.forChild(Ye),U]})};var ke=class n{static \u0275fac=function(e){return new(e||n)};static \u0275mod=y({type:n});static \u0275inj=h({imports:[E,B]})};export{ke as DependenciesModule};