jishushell 0.4.2-beta2 → 0.4.10

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 (75) hide show
  1. package/Dockerfile.openclaw-slim +58 -0
  2. package/INSTALL-NOTICE +7 -1
  3. package/dist/auth.js +3 -3
  4. package/dist/auth.js.map +1 -1
  5. package/dist/cli.js +517 -1
  6. package/dist/cli.js.map +1 -1
  7. package/dist/config.d.ts +21 -4
  8. package/dist/config.js +88 -54
  9. package/dist/config.js.map +1 -1
  10. package/dist/control.js +5 -5
  11. package/dist/control.js.map +1 -1
  12. package/dist/doctor.js +47 -14
  13. package/dist/doctor.js.map +1 -1
  14. package/dist/install.d.ts +1 -1
  15. package/dist/install.js +15 -29
  16. package/dist/install.js.map +1 -1
  17. package/dist/routes/backup.d.ts +2 -0
  18. package/dist/routes/backup.js +370 -0
  19. package/dist/routes/backup.js.map +1 -0
  20. package/dist/routes/instances.d.ts +1 -0
  21. package/dist/routes/instances.js +51 -11
  22. package/dist/routes/instances.js.map +1 -1
  23. package/dist/routes/setup.js +3 -5
  24. package/dist/routes/setup.js.map +1 -1
  25. package/dist/server.js +29 -1
  26. package/dist/server.js.map +1 -1
  27. package/dist/services/backup-manager.d.ts +253 -0
  28. package/dist/services/backup-manager.js +2014 -0
  29. package/dist/services/backup-manager.js.map +1 -0
  30. package/dist/services/backup-verify.d.ts +26 -0
  31. package/dist/services/backup-verify.js +240 -0
  32. package/dist/services/backup-verify.js.map +1 -0
  33. package/dist/services/instance-manager.d.ts +24 -4
  34. package/dist/services/instance-manager.js +218 -49
  35. package/dist/services/instance-manager.js.map +1 -1
  36. package/dist/services/nomad-manager.js +72 -131
  37. package/dist/services/nomad-manager.js.map +1 -1
  38. package/dist/services/process-manager.js +4 -3
  39. package/dist/services/process-manager.js.map +1 -1
  40. package/dist/services/setup-manager.d.ts +4 -2
  41. package/dist/services/setup-manager.js +268 -129
  42. package/dist/services/setup-manager.js.map +1 -1
  43. package/dist/utils/fs.d.ts +85 -0
  44. package/dist/utils/fs.js +111 -0
  45. package/dist/utils/fs.js.map +1 -0
  46. package/dist/utils/safe-json.d.ts +2 -0
  47. package/dist/utils/safe-json.js +22 -16
  48. package/dist/utils/safe-json.js.map +1 -1
  49. package/install/jishu-install-china.sh +3092 -0
  50. package/install/jishu-install.sh +310 -108
  51. package/install/jishu-uninstall.sh +276 -391
  52. package/install/post-install.sh +9 -0
  53. package/openclaw-entry.sh +15 -0
  54. package/package.json +4 -1
  55. package/public/assets/Dashboard-DhsrzJ4F.js +1 -0
  56. package/public/assets/{InitPassword-CslWYy8G.js → InitPassword-BjubiVdd.js} +1 -1
  57. package/public/assets/InstanceDetail-DMcywsof.js +17 -0
  58. package/public/assets/{Login-d45wtgVA.js → Login-CUoEZOWR.js} +1 -1
  59. package/public/assets/NewInstance-Bk0G4EiJ.js +1 -0
  60. package/public/assets/Settings-D5tHL_h5.js +1 -0
  61. package/public/assets/Setup-4t6E3Rut.js +1 -0
  62. package/public/assets/index-BJ47MWpF.css +1 -0
  63. package/public/assets/index-DbX85irc.js +16 -0
  64. package/public/assets/{usePolling-CqQ8hrNc.js → usePolling-CK0DfI4h.js} +1 -1
  65. package/public/assets/{vendor-i18n-Bvxxh8Di.js → vendor-i18n-CfW0RvgE.js} +1 -1
  66. package/public/assets/vendor-react-B1-3Yrt-.js +59 -0
  67. package/public/index.html +4 -4
  68. package/public/assets/Dashboard-Dxsq690N.js +0 -1
  69. package/public/assets/InstanceDetail-DmEkMj-t.js +0 -14
  70. package/public/assets/NewInstance-Czp5-AJe.js +0 -1
  71. package/public/assets/Settings-BKMGck05.js +0 -1
  72. package/public/assets/Setup-D3rfLWjZ.js +0 -1
  73. package/public/assets/index-77Ug7feY.css +0 -1
  74. package/public/assets/index-DkDnIohs.js +0 -16
  75. package/public/assets/vendor-react-DONn7uBV.js +0 -59
@@ -1,14 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-DkDnIohs.js","assets/vendor-react-DONn7uBV.js","assets/vendor-i18n-Bvxxh8Di.js","assets/index-77Ug7feY.css"])))=>i.map(i=>d[i]);
2
- import{j as e,y as ts,z as As,I as Is,a as Ps,_ as Rs,A as Ht,B as ss,C as rs,D as ns,E as as,F as Ls,l as ls,G as Ts,h as Ds,k as Os,H as Te,J as ct,K as $s,M as Us,N as zt,O as Wt,P as Kt,Q as _s,R as qs,S as Jt,U as Bs,V as Vt,W as Qt,X as Hs,Y as zs,q as Ws,Z as Ks,$ as Js,v as Vs,w as Qs,x as Gt,a0 as Gs,a1 as Ys}from"./index-DkDnIohs.js";import{e as K,r as w,d as Xs,u as Zs}from"./vendor-react-DONn7uBV.js";import{u as er}from"./usePolling-CqQ8hrNc.js";import{P as He}from"./providers-lBSOjUWy.js";import{u as we,i as tr}from"./vendor-i18n-Bvxxh8Di.js";var sr=Object.defineProperty,Ke=Object.getOwnPropertySymbols,os=Object.prototype.hasOwnProperty,is=Object.prototype.propertyIsEnumerable,Yt=(r,i,o)=>i in r?sr(r,i,{enumerable:!0,configurable:!0,writable:!0,value:o}):r[i]=o,ut=(r,i)=>{for(var o in i||(i={}))os.call(i,o)&&Yt(r,o,i[o]);if(Ke)for(var o of Ke(i))is.call(i,o)&&Yt(r,o,i[o]);return r},mt=(r,i)=>{var o={};for(var x in r)os.call(r,x)&&i.indexOf(x)<0&&(o[x]=r[x]);if(r!=null&&Ke)for(var x of Ke(r))i.indexOf(x)<0&&is.call(r,x)&&(o[x]=r[x]);return o};/**
3
- * @license QR Code generator library (TypeScript)
4
- * Copyright (c) Project Nayuki.
5
- * SPDX-License-Identifier: MIT
6
- */var Ce;(r=>{const i=class R{constructor(n,a,s,d){if(this.version=n,this.errorCorrectionLevel=a,this.modules=[],this.isFunction=[],n<R.MIN_VERSION||n>R.MAX_VERSION)throw new RangeError("Version value out of range");if(d<-1||d>7)throw new RangeError("Mask value out of range");this.size=n*4+17;let h=[];for(let g=0;g<this.size;g++)h.push(!1);for(let g=0;g<this.size;g++)this.modules.push(h.slice()),this.isFunction.push(h.slice());this.drawFunctionPatterns();const N=this.addEccAndInterleave(s);if(this.drawCodewords(N),d==-1){let g=1e9;for(let C=0;C<8;C++){this.applyMask(C),this.drawFormatBits(C);const j=this.getPenaltyScore();j<g&&(d=C,g=j),this.applyMask(C)}}t(0<=d&&d<=7),this.mask=d,this.applyMask(d),this.drawFormatBits(d),this.isFunction=[]}static encodeText(n,a){const s=r.QrSegment.makeSegments(n);return R.encodeSegments(s,a)}static encodeBinary(n,a){const s=r.QrSegment.makeBytes(n);return R.encodeSegments([s],a)}static encodeSegments(n,a,s=1,d=40,h=-1,N=!0){if(!(R.MIN_VERSION<=s&&s<=d&&d<=R.MAX_VERSION)||h<-1||h>7)throw new RangeError("Invalid value");let g,C;for(g=s;;g++){const S=R.getNumDataCodewords(g,a)*8,F=m.getTotalBits(n,g);if(F<=S){C=F;break}if(g>=d)throw new RangeError("Data too long")}for(const S of[R.Ecc.MEDIUM,R.Ecc.QUARTILE,R.Ecc.HIGH])N&&C<=R.getNumDataCodewords(g,S)*8&&(a=S);let j=[];for(const S of n){o(S.mode.modeBits,4,j),o(S.numChars,S.mode.numCharCountBits(g),j);for(const F of S.getData())j.push(F)}t(j.length==C);const $=R.getNumDataCodewords(g,a)*8;t(j.length<=$),o(0,Math.min(4,$-j.length),j),o(0,(8-j.length%8)%8,j),t(j.length%8==0);for(let S=236;j.length<$;S^=253)o(S,8,j);let L=[];for(;L.length*8<j.length;)L.push(0);return j.forEach((S,F)=>L[F>>>3]|=S<<7-(F&7)),new R(g,a,L,h)}getModule(n,a){return 0<=n&&n<this.size&&0<=a&&a<this.size&&this.modules[a][n]}getModules(){return this.modules}drawFunctionPatterns(){for(let s=0;s<this.size;s++)this.setFunctionModule(6,s,s%2==0),this.setFunctionModule(s,6,s%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);const n=this.getAlignmentPatternPositions(),a=n.length;for(let s=0;s<a;s++)for(let d=0;d<a;d++)s==0&&d==0||s==0&&d==a-1||s==a-1&&d==0||this.drawAlignmentPattern(n[s],n[d]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(n){const a=this.errorCorrectionLevel.formatBits<<3|n;let s=a;for(let h=0;h<10;h++)s=s<<1^(s>>>9)*1335;const d=(a<<10|s)^21522;t(d>>>15==0);for(let h=0;h<=5;h++)this.setFunctionModule(8,h,x(d,h));this.setFunctionModule(8,7,x(d,6)),this.setFunctionModule(8,8,x(d,7)),this.setFunctionModule(7,8,x(d,8));for(let h=9;h<15;h++)this.setFunctionModule(14-h,8,x(d,h));for(let h=0;h<8;h++)this.setFunctionModule(this.size-1-h,8,x(d,h));for(let h=8;h<15;h++)this.setFunctionModule(8,this.size-15+h,x(d,h));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let n=this.version;for(let s=0;s<12;s++)n=n<<1^(n>>>11)*7973;const a=this.version<<12|n;t(a>>>18==0);for(let s=0;s<18;s++){const d=x(a,s),h=this.size-11+s%3,N=Math.floor(s/3);this.setFunctionModule(h,N,d),this.setFunctionModule(N,h,d)}}drawFinderPattern(n,a){for(let s=-4;s<=4;s++)for(let d=-4;d<=4;d++){const h=Math.max(Math.abs(d),Math.abs(s)),N=n+d,g=a+s;0<=N&&N<this.size&&0<=g&&g<this.size&&this.setFunctionModule(N,g,h!=2&&h!=4)}}drawAlignmentPattern(n,a){for(let s=-2;s<=2;s++)for(let d=-2;d<=2;d++)this.setFunctionModule(n+d,a+s,Math.max(Math.abs(d),Math.abs(s))!=1)}setFunctionModule(n,a,s){this.modules[a][n]=s,this.isFunction[a][n]=!0}addEccAndInterleave(n){const a=this.version,s=this.errorCorrectionLevel;if(n.length!=R.getNumDataCodewords(a,s))throw new RangeError("Invalid argument");const d=R.NUM_ERROR_CORRECTION_BLOCKS[s.ordinal][a],h=R.ECC_CODEWORDS_PER_BLOCK[s.ordinal][a],N=Math.floor(R.getNumRawDataModules(a)/8),g=d-N%d,C=Math.floor(N/d);let j=[];const $=R.reedSolomonComputeDivisor(h);for(let S=0,F=0;S<d;S++){let O=n.slice(F,F+C-h+(S<g?0:1));F+=O.length;const T=R.reedSolomonComputeRemainder(O,$);S<g&&O.push(0),j.push(O.concat(T))}let L=[];for(let S=0;S<j[0].length;S++)j.forEach((F,O)=>{(S!=C-h||O>=g)&&L.push(F[S])});return t(L.length==N),L}drawCodewords(n){if(n.length!=Math.floor(R.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let a=0;for(let s=this.size-1;s>=1;s-=2){s==6&&(s=5);for(let d=0;d<this.size;d++)for(let h=0;h<2;h++){const N=s-h,C=(s+1&2)==0?this.size-1-d:d;!this.isFunction[C][N]&&a<n.length*8&&(this.modules[C][N]=x(n[a>>>3],7-(a&7)),a++)}}t(a==n.length*8)}applyMask(n){if(n<0||n>7)throw new RangeError("Mask value out of range");for(let a=0;a<this.size;a++)for(let s=0;s<this.size;s++){let d;switch(n){case 0:d=(s+a)%2==0;break;case 1:d=a%2==0;break;case 2:d=s%3==0;break;case 3:d=(s+a)%3==0;break;case 4:d=(Math.floor(s/3)+Math.floor(a/2))%2==0;break;case 5:d=s*a%2+s*a%3==0;break;case 6:d=(s*a%2+s*a%3)%2==0;break;case 7:d=((s+a)%2+s*a%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[a][s]&&d&&(this.modules[a][s]=!this.modules[a][s])}}getPenaltyScore(){let n=0;for(let h=0;h<this.size;h++){let N=!1,g=0,C=[0,0,0,0,0,0,0];for(let j=0;j<this.size;j++)this.modules[h][j]==N?(g++,g==5?n+=R.PENALTY_N1:g>5&&n++):(this.finderPenaltyAddHistory(g,C),N||(n+=this.finderPenaltyCountPatterns(C)*R.PENALTY_N3),N=this.modules[h][j],g=1);n+=this.finderPenaltyTerminateAndCount(N,g,C)*R.PENALTY_N3}for(let h=0;h<this.size;h++){let N=!1,g=0,C=[0,0,0,0,0,0,0];for(let j=0;j<this.size;j++)this.modules[j][h]==N?(g++,g==5?n+=R.PENALTY_N1:g>5&&n++):(this.finderPenaltyAddHistory(g,C),N||(n+=this.finderPenaltyCountPatterns(C)*R.PENALTY_N3),N=this.modules[j][h],g=1);n+=this.finderPenaltyTerminateAndCount(N,g,C)*R.PENALTY_N3}for(let h=0;h<this.size-1;h++)for(let N=0;N<this.size-1;N++){const g=this.modules[h][N];g==this.modules[h][N+1]&&g==this.modules[h+1][N]&&g==this.modules[h+1][N+1]&&(n+=R.PENALTY_N2)}let a=0;for(const h of this.modules)a=h.reduce((N,g)=>N+(g?1:0),a);const s=this.size*this.size,d=Math.ceil(Math.abs(a*20-s*10)/s)-1;return t(0<=d&&d<=9),n+=d*R.PENALTY_N4,t(0<=n&&n<=2568888),n}getAlignmentPatternPositions(){if(this.version==1)return[];{const n=Math.floor(this.version/7)+2,a=this.version==32?26:Math.ceil((this.version*4+4)/(n*2-2))*2;let s=[6];for(let d=this.size-7;s.length<n;d-=a)s.splice(1,0,d);return s}}static getNumRawDataModules(n){if(n<R.MIN_VERSION||n>R.MAX_VERSION)throw new RangeError("Version number out of range");let a=(16*n+128)*n+64;if(n>=2){const s=Math.floor(n/7)+2;a-=(25*s-10)*s-55,n>=7&&(a-=36)}return t(208<=a&&a<=29648),a}static getNumDataCodewords(n,a){return Math.floor(R.getNumRawDataModules(n)/8)-R.ECC_CODEWORDS_PER_BLOCK[a.ordinal][n]*R.NUM_ERROR_CORRECTION_BLOCKS[a.ordinal][n]}static reedSolomonComputeDivisor(n){if(n<1||n>255)throw new RangeError("Degree out of range");let a=[];for(let d=0;d<n-1;d++)a.push(0);a.push(1);let s=1;for(let d=0;d<n;d++){for(let h=0;h<a.length;h++)a[h]=R.reedSolomonMultiply(a[h],s),h+1<a.length&&(a[h]^=a[h+1]);s=R.reedSolomonMultiply(s,2)}return a}static reedSolomonComputeRemainder(n,a){let s=a.map(d=>0);for(const d of n){const h=d^s.shift();s.push(0),a.forEach((N,g)=>s[g]^=R.reedSolomonMultiply(N,h))}return s}static reedSolomonMultiply(n,a){if(n>>>8||a>>>8)throw new RangeError("Byte out of range");let s=0;for(let d=7;d>=0;d--)s=s<<1^(s>>>7)*285,s^=(a>>>d&1)*n;return t(s>>>8==0),s}finderPenaltyCountPatterns(n){const a=n[1];t(a<=this.size*3);const s=a>0&&n[2]==a&&n[3]==a*3&&n[4]==a&&n[5]==a;return(s&&n[0]>=a*4&&n[6]>=a?1:0)+(s&&n[6]>=a*4&&n[0]>=a?1:0)}finderPenaltyTerminateAndCount(n,a,s){return n&&(this.finderPenaltyAddHistory(a,s),a=0),a+=this.size,this.finderPenaltyAddHistory(a,s),this.finderPenaltyCountPatterns(s)}finderPenaltyAddHistory(n,a){a[0]==0&&(n+=this.size),a.pop(),a.unshift(n)}};i.MIN_VERSION=1,i.MAX_VERSION=40,i.PENALTY_N1=3,i.PENALTY_N2=3,i.PENALTY_N3=40,i.PENALTY_N4=10,i.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],i.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],r.QrCode=i;function o(y,n,a){if(n<0||n>31||y>>>n)throw new RangeError("Value out of range");for(let s=n-1;s>=0;s--)a.push(y>>>s&1)}function x(y,n){return(y>>>n&1)!=0}function t(y){if(!y)throw new Error("Assertion error")}const f=class W{constructor(n,a,s){if(this.mode=n,this.numChars=a,this.bitData=s,a<0)throw new RangeError("Invalid argument");this.bitData=s.slice()}static makeBytes(n){let a=[];for(const s of n)o(s,8,a);return new W(W.Mode.BYTE,n.length,a)}static makeNumeric(n){if(!W.isNumeric(n))throw new RangeError("String contains non-numeric characters");let a=[];for(let s=0;s<n.length;){const d=Math.min(n.length-s,3);o(parseInt(n.substring(s,s+d),10),d*3+1,a),s+=d}return new W(W.Mode.NUMERIC,n.length,a)}static makeAlphanumeric(n){if(!W.isAlphanumeric(n))throw new RangeError("String contains unencodable characters in alphanumeric mode");let a=[],s;for(s=0;s+2<=n.length;s+=2){let d=W.ALPHANUMERIC_CHARSET.indexOf(n.charAt(s))*45;d+=W.ALPHANUMERIC_CHARSET.indexOf(n.charAt(s+1)),o(d,11,a)}return s<n.length&&o(W.ALPHANUMERIC_CHARSET.indexOf(n.charAt(s)),6,a),new W(W.Mode.ALPHANUMERIC,n.length,a)}static makeSegments(n){return n==""?[]:W.isNumeric(n)?[W.makeNumeric(n)]:W.isAlphanumeric(n)?[W.makeAlphanumeric(n)]:[W.makeBytes(W.toUtf8ByteArray(n))]}static makeEci(n){let a=[];if(n<0)throw new RangeError("ECI assignment value out of range");if(n<128)o(n,8,a);else if(n<16384)o(2,2,a),o(n,14,a);else if(n<1e6)o(6,3,a),o(n,21,a);else throw new RangeError("ECI assignment value out of range");return new W(W.Mode.ECI,0,a)}static isNumeric(n){return W.NUMERIC_REGEX.test(n)}static isAlphanumeric(n){return W.ALPHANUMERIC_REGEX.test(n)}getData(){return this.bitData.slice()}static getTotalBits(n,a){let s=0;for(const d of n){const h=d.mode.numCharCountBits(a);if(d.numChars>=1<<h)return 1/0;s+=4+h+d.bitData.length}return s}static toUtf8ByteArray(n){n=encodeURI(n);let a=[];for(let s=0;s<n.length;s++)n.charAt(s)!="%"?a.push(n.charCodeAt(s)):(a.push(parseInt(n.substring(s+1,s+3),16)),s+=2);return a}};f.NUMERIC_REGEX=/^[0-9]*$/,f.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,f.ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:";let m=f;r.QrSegment=f})(Ce||(Ce={}));(r=>{(i=>{const o=class{constructor(t,f){this.ordinal=t,this.formatBits=f}};o.LOW=new o(0,1),o.MEDIUM=new o(1,0),o.QUARTILE=new o(2,3),o.HIGH=new o(3,2),i.Ecc=o})(r.QrCode||(r.QrCode={}))})(Ce||(Ce={}));(r=>{(i=>{const o=class{constructor(t,f){this.modeBits=t,this.numBitsCharCount=f}numCharCountBits(t){return this.numBitsCharCount[Math.floor((t+7)/17)]}};o.NUMERIC=new o(1,[10,12,14]),o.ALPHANUMERIC=new o(2,[9,11,13]),o.BYTE=new o(4,[8,16,16]),o.KANJI=new o(8,[8,10,12]),o.ECI=new o(7,[0,0,0]),i.Mode=o})(r.QrSegment||(r.QrSegment={}))})(Ce||(Ce={}));var Ae=Ce;/**
7
- * @license qrcode.react
8
- * Copyright (c) Paul O'Shannessy
9
- * SPDX-License-Identifier: ISC
10
- */var rr={L:Ae.QrCode.Ecc.LOW,M:Ae.QrCode.Ecc.MEDIUM,Q:Ae.QrCode.Ecc.QUARTILE,H:Ae.QrCode.Ecc.HIGH},cs=128,ds="L",us="#FFFFFF",ms="#000000",hs=!1,xs=1,nr=4,ar=0,lr=.1;function fs(r,i=0){const o=[];return r.forEach(function(x,t){let f=null;x.forEach(function(m,y){if(!m&&f!==null){o.push(`M${f+i} ${t+i}h${y-f}v1H${f+i}z`),f=null;return}if(y===x.length-1){if(!m)return;f===null?o.push(`M${y+i},${t+i} h1v1H${y+i}z`):o.push(`M${f+i},${t+i} h${y+1-f}v1H${f+i}z`);return}m&&f===null&&(f=y)})}),o.join("")}function ps(r,i){return r.slice().map((o,x)=>x<i.y||x>=i.y+i.h?o:o.map((t,f)=>f<i.x||f>=i.x+i.w?t:!1))}function or(r,i,o,x){if(x==null)return null;const t=r.length+o*2,f=Math.floor(i*lr),m=t/i,y=(x.width||f)*m,n=(x.height||f)*m,a=x.x==null?r.length/2-y/2:x.x*m,s=x.y==null?r.length/2-n/2:x.y*m,d=x.opacity==null?1:x.opacity;let h=null;if(x.excavate){let g=Math.floor(a),C=Math.floor(s),j=Math.ceil(y+a-g),$=Math.ceil(n+s-C);h={x:g,y:C,w:j,h:$}}const N=x.crossOrigin;return{x:a,y:s,h:n,w:y,excavation:h,opacity:d,crossOrigin:N}}function ir(r,i){return i!=null?Math.max(Math.floor(i),0):r?nr:ar}function gs({value:r,level:i,minVersion:o,includeMargin:x,marginSize:t,imageSettings:f,size:m,boostLevel:y}){let n=K.useMemo(()=>{const g=(Array.isArray(r)?r:[r]).reduce((C,j)=>(C.push(...Ae.QrSegment.makeSegments(j)),C),[]);return Ae.QrCode.encodeSegments(g,rr[i],o,void 0,void 0,y)},[r,i,o,y]);const{cells:a,margin:s,numCells:d,calculatedImageSettings:h}=K.useMemo(()=>{let N=n.getModules();const g=ir(x,t),C=N.length+g*2,j=or(N,m,g,f);return{cells:N,margin:g,numCells:C,calculatedImageSettings:j}},[n,m,f,x,t]);return{qrcode:n,margin:s,cells:a,numCells:d,calculatedImageSettings:h}}var cr=function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0}(),dr=K.forwardRef(function(i,o){const x=i,{value:t,size:f=cs,level:m=ds,bgColor:y=us,fgColor:n=ms,includeMargin:a=hs,minVersion:s=xs,boostLevel:d,marginSize:h,imageSettings:N}=x,C=mt(x,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","marginSize","imageSettings"]),{style:j}=C,$=mt(C,["style"]),L=N==null?void 0:N.src,S=K.useRef(null),F=K.useRef(null),O=K.useCallback(Y=>{S.current=Y,typeof o=="function"?o(Y):o&&(o.current=Y)},[o]),[T,q]=K.useState(!1),{margin:J,cells:xe,numCells:fe,calculatedImageSettings:B}=gs({value:t,level:m,minVersion:s,boostLevel:d,includeMargin:a,marginSize:h,imageSettings:N,size:f});K.useEffect(()=>{if(S.current!=null){const Y=S.current,X=Y.getContext("2d");if(!X)return;let ne=xe;const G=F.current,pe=B!=null&&G!==null&&G.complete&&G.naturalHeight!==0&&G.naturalWidth!==0;pe&&B.excavation!=null&&(ne=ps(xe,B.excavation));const oe=window.devicePixelRatio||1;Y.height=Y.width=f*oe;const ge=f/fe*oe;X.scale(ge,ge),X.fillStyle=y,X.fillRect(0,0,fe,fe),X.fillStyle=n,cr?X.fill(new Path2D(fs(ne,J))):xe.forEach(function(c,b){c.forEach(function(E,U){E&&X.fillRect(U+J,b+J,1,1)})}),B&&(X.globalAlpha=B.opacity),pe&&X.drawImage(G,B.x+J,B.y+J,B.w,B.h)}}),K.useEffect(()=>{q(!1)},[L]);const Fe=ut({height:f,width:f},j);let ee=null;return L!=null&&(ee=K.createElement("img",{src:L,key:L,style:{display:"none"},onLoad:()=>{q(!0)},ref:F,crossOrigin:B==null?void 0:B.crossOrigin})),K.createElement(K.Fragment,null,K.createElement("canvas",ut({style:Fe,height:f,width:f,ref:O,role:"img"},$)),ee)});dr.displayName="QRCodeCanvas";var Je=K.forwardRef(function(i,o){const x=i,{value:t,size:f=cs,level:m=ds,bgColor:y=us,fgColor:n=ms,includeMargin:a=hs,minVersion:s=xs,boostLevel:d,title:h,marginSize:N,imageSettings:g}=x,C=mt(x,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","title","marginSize","imageSettings"]),{margin:j,cells:$,numCells:L,calculatedImageSettings:S}=gs({value:t,level:m,minVersion:s,boostLevel:d,includeMargin:a,marginSize:N,imageSettings:g,size:f});let F=$,O=null;g!=null&&S!=null&&(S.excavation!=null&&(F=ps($,S.excavation)),O=K.createElement("image",{href:g.src,height:S.h,width:S.w,x:S.x+j,y:S.y+j,preserveAspectRatio:"none",opacity:S.opacity,crossOrigin:S.crossOrigin}));const T=fs(F,j);return K.createElement("svg",ut({height:f,width:f,viewBox:`0 0 ${L} ${L}`,ref:o,role:"img"},C),!!h&&K.createElement("title",null,h),K.createElement("path",{fill:y,d:`M0,0 h${L}v${L}H0z`,shapeRendering:"crispEdges"}),K.createElement("path",{fill:n,d:T,shapeRendering:"crispEdges"}),O)});Je.displayName="QRCodeSVG";const Oe=[{id:"feishu",labelKey:"configForm.channel.feishu",fields:[],defaults:{connectionMode:"websocket"}},{id:"openclaw-weixin",labelKey:"configForm.channel.openclaw-weixin",fields:[],defaults:{}},{id:"telegram",labelKey:"configForm.channel.telegram",fields:[{key:"botToken",label:"Bot Token",type:"password",placeholder:"From @BotFather"}]},{id:"discord",labelKey:"configForm.channel.discord",fields:[{key:"token",label:"Bot Token",type:"password",placeholder:"From Discord Developer Portal"}]},{id:"slack",labelKey:"configForm.channel.slack",fields:[{key:"botToken",label:"Bot Token (xoxb-...)",type:"password",placeholder:"xoxb-..."},{key:"appToken",label:"App Token (xapp-...)",type:"password",placeholder:"xapp-..."}]},{id:"whatsapp",labelKey:"configForm.channel.whatsapp",fields:[],defaults:{}},{id:"msteams",labelKey:"configForm.channel.msteams",fields:[{key:"appId",label:"App ID",placeholder:"Azure App Registration ID"},{key:"appPassword",label:"App Password",type:"password",placeholder:"Azure App Secret"},{key:"tenantId",label:"Tenant ID",placeholder:"Azure AD Tenant ID"}]},{id:"signal",labelKey:"configForm.channel.signal",fields:[{key:"account",label:"Phone (E.164)",placeholder:"+8613800138000"}]},{id:"line",labelKey:"configForm.channel.line",fields:[{key:"channelAccessToken",label:"Channel Access Token",type:"password",placeholder:"From LINE Developers"},{key:"channelSecret",label:"Channel Secret",type:"password",placeholder:"LINE Channel Secret"}]},{id:"googlechat",labelKey:"configForm.channel.googlechat",fields:[{key:"serviceAccountFile",label:"Service Account JSON Path",placeholder:"/path/to/service-account.json"}]}];function he(r,i,o){const x=structuredClone(r),t=i.split(".");let f=x;for(let m=0;m<t.length-1;m++)f[t[m]]===void 0&&(f[t[m]]={}),f=f[t[m]];return f[t[t.length-1]]=o,x}const bs="w-full bg-[var(--input-bg)] border border-[var(--border)] rounded-md px-3 py-2 text-sm text-foreground placeholder-[var(--muted)] focus:outline-none focus:ring-1 focus:ring-[#0066FF]/60 focus:border-[#0066FF]/60 transition-colors duration-200",ur="w-full bg-background border border-[var(--border)] rounded-md px-3 py-2 text-sm text-foreground focus:outline-none focus:ring-1 focus:ring-[#0066FF]/60 focus:border-[#0066FF]/60 transition-colors duration-200";function Q({label:r,hint:i,children:o}){return e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-muted mb-1.5",children:r}),o,i&&e.jsx("p",{className:"text-xs text-muted mt-1 opacity-60",children:i})]})}function mr({value:r,saved:i,onChange:o,placeholder:x}){const{t}=we("instance"),[f,m]=w.useState(!1),y="••••••••••••••••••••••••••••••";return i&&!f&&!r?e.jsx("div",{className:"relative",children:e.jsx("input",{type:"password",value:y,readOnly:!0,onFocus:()=>m(!0),className:`${bs} cursor-text`,title:t("config.clickToEdit")})}):e.jsx(le,{value:r,onChange:o,placeholder:x,type:"password",mono:!0})}function le({value:r,onChange:i,placeholder:o,type:x="text",mono:t}){const[f,m]=w.useState(!1),y=x==="password";return e.jsxs("div",{className:"relative",children:[e.jsx("input",{type:y&&!f?"password":"text",value:r||"",onChange:n=>i(n.target.value),placeholder:o,className:`${bs} ${t?"font-mono text-[13px]":""} ${y?"pr-9":""}`}),y&&e.jsx("button",{type:"button",onClick:()=>m(!f),className:"absolute right-2.5 top-1/2 -translate-y-1/2 text-muted hover:text-foreground",children:f?e.jsx(Is,{className:"w-3.5 h-3.5"}):e.jsx(Ps,{className:"w-3.5 h-3.5"})})]})}function De({value:r,onChange:i,children:o}){return e.jsx("select",{value:r||"",onChange:x=>i(x.target.value),className:ur,children:o})}function Xt({checked:r,onChange:i,label:o}){return e.jsxs("label",{className:"flex items-center gap-2.5 cursor-pointer",children:[e.jsx("button",{type:"button",role:"switch","aria-checked":r,onClick:()=>i(!r),className:`w-9 h-5 rounded-full relative transition-colors duration-200 ${r?"bg-[#0066FF]":"bg-[var(--input-bg)]"}`,children:e.jsx("div",{className:`w-3.5 h-3.5 bg-white rounded-full absolute top-[3px] transition-transform duration-200 ${r?"left-[18px]":"left-[3px]"}`})}),e.jsx("span",{className:"text-sm text-muted",children:o})]})}function Zt({title:r,defaultOpen:i=!0,id:o,children:x}){const[t,f]=w.useState(i);return e.jsxs("div",{id:o,className:"bg-[var(--card)] border border-[var(--border)] rounded-xl overflow-hidden hover:border-[var(--border-hover)] transition-colors duration-200",children:[e.jsxs("button",{type:"button",onClick:()=>f(!t),className:"w-full px-4 py-3 flex items-center justify-between text-left hover:bg-[var(--card-hover)] transition-colors duration-150",children:[e.jsx("span",{className:"text-sm font-medium text-foreground",children:r}),t?e.jsx(ts,{className:"w-4 h-4 text-muted"}):e.jsx(As,{className:"w-4 h-4 text-muted"})]}),t&&e.jsx("div",{className:"px-4 pb-4 space-y-4 border-t border-[var(--border)] pt-4",children:x})]})}const dt=["feishu","openclaw-weixin"],hr={feishu:"feishu",lark:"feishu","openclaw-weixin":"openclaw-weixin"};function xr({config:r,onChange:i,instanceId:o,isRunning:x=!1,pluginStatuses:t={},onInstallPlugin:f}){var pe,oe,ge;const{t:m}=we(["instance","common"]),y=(c,b)=>i(he(r,c,b)),n=((pe=r==null?void 0:r["x-jishushell"])==null?void 0:pe.proxy)||{},a=n.upstream||{},s=a.providerId||"",d=He.find(c=>c.id===s),h=a.models||[],N=d?d.models.map(c=>({id:c.id,name:c.name,contextWindow:c.contextWindow})):h.map(c=>({id:c.id,name:c.name||c.id,contextWindow:c.contextWindow})),g=a.selectedModelId||((oe=N[0])==null?void 0:oe.id)||"",C=N.find(c=>c.id===g)||N[0]||{},j=h.find(c=>c.id===g)||(C.id?C:{id:"",name:"",contextWindow:0}),$=n.proxy||{},L=c=>{var U;const b=He.find(H=>H.id===c);if(!b||a.apiKey&&!window.confirm(m("configForm.switchProviderConfirm")))return;const E=JSON.parse(JSON.stringify(r));E["x-jishushell"]||(E["x-jishushell"]={}),E["x-jishushell"].proxy||(E["x-jishushell"].proxy={}),E["x-jishushell"].proxy.upstream={providerId:b.id,baseUrl:b.baseUrl,api:b.api,authHeader:b.authHeader===!0,headers:b.headers||{},models:b.models.map(H=>({id:H.id,name:H.name,contextWindow:H.contextWindow})),selectedModelId:((U=b.models[0])==null?void 0:U.id)||"",apiKey:"",hasApiKey:!1,clearApiKey:!1},i(E)},S=c=>{y("x-jishushell.proxy.upstream.selectedModelId",c)},F=(c,b)=>{y(`x-jishushell.proxy.upstream.${c}`,b)},O=(r==null?void 0:r.channels)||{},T=Object.keys(O),q=(c,b,E)=>y(`channels.${c}.${b}`,E),J={},xe=c=>{const b=Oe.find(H=>H.id===c),E=JSON.parse(JSON.stringify(r));E.channels||(E.channels={});const U=J[c]||c;if(b){const H={enabled:!0,...b.defaults};b.fields.forEach(te=>{H[te.key]=""}),E.channels[U]=H}else E.channels[U]={enabled:!0};i(E)},fe=c=>{const b=JSON.parse(JSON.stringify(r));delete b.channels[c],i(b)},[B,Fe]=w.useState(!1),[ee,Y]=w.useState(!(a.hasApiKey&&s)),X={"moonshot-coding":"configForm.hint.moonshot-coding",volcengine:"configForm.hint.volcengine",byteplus:"configForm.hint.byteplus",openrouter:"configForm.hint.openrouter",ollama:"configForm.hint.ollama",vllm:"configForm.hint.vllm",sglang:"configForm.hint.sglang"},ne=X[s]?m(X[s]):void 0,G=[...new Set(He.map(c=>c.group))];return e.jsxs("div",{className:"space-y-4",children:[e.jsxs(Zt,{title:m("configForm.modelConfig"),children:[e.jsxs("div",{className:"bg-[var(--card)] border border-[var(--border)] rounded-lg p-3 text-sm text-muted",children:[e.jsx("div",{className:"font-medium text-foreground mb-1",children:m("configForm.proxyChain")}),e.jsx("p",{children:m("configForm.proxyChainDesc")}),e.jsxs("div",{className:"mt-2 text-xs text-muted opacity-60 space-y-1",children:[e.jsxs("div",{children:[m("configForm.proxyAddress")," ",e.jsx("span",{className:"font-mono",children:$.proxyBaseUrl||m("configForm.notConfigured")})]}),e.jsxs("div",{children:[m("configForm.proxyStatus")," ",$.running?m("configForm.running"):m("configForm.notRunning"),m("configForm.virtualKeyLabel")," ",$.hasVirtualKey?m("configForm.generated"):m("configForm.notGenerated")]})]})]}),!ee&&e.jsx("button",{type:"button",onClick:()=>Y(!0),className:"text-xs text-[#0066FF] hover:text-[#0066FF]/80 transition-colors",children:m("configForm.editModelConfig")}),ee&&e.jsx(Q,{label:m("configForm.upstreamProvider"),hint:m("configForm.upstreamProviderHint"),children:e.jsxs(De,{value:s,onChange:L,children:[e.jsx("option",{value:"",children:m("configForm.selectProvider")}),!d&&s&&e.jsxs("option",{value:s,children:[s," ",m("configForm.custom")]}),G.map(c=>e.jsx("optgroup",{label:m(`configForm.providerGroup.${c}`,{defaultValue:c}),children:He.filter(b=>b.group===c).map(b=>e.jsx("option",{value:b.id,children:m(`configForm.providerLabel.${b.id}`,{defaultValue:b.label})},b.id))},c))]})}),ee&&ne&&e.jsxs("div",{className:"flex items-start gap-2 bg-amber-500/10 border border-amber-500/20 rounded-lg px-3 py-2.5 text-xs text-amber-400",children:[e.jsx("span",{className:"shrink-0 mt-0.5",children:"⚠"}),e.jsx("span",{children:ne})]}),ee&&!["ollama","vllm","sglang"].includes(s)&&s&&e.jsxs(e.Fragment,{children:[e.jsxs(Q,{label:m("configForm.upstreamApiKey"),hint:a.hasApiKey&&!a.clearApiKey?m("configForm.apiKeyHintSaved"):m("configForm.apiKeyHintNew"),children:[e.jsx(mr,{value:a.apiKey||"",saved:a.hasApiKey&&!a.clearApiKey,onChange:c=>{let b=he(r,"x-jishushell.proxy.upstream.apiKey",c);c&&(b=he(b,"x-jishushell.proxy.upstream.clearApiKey",!1)),i(b)},placeholder:m("configForm.enterApiKey")}),a.hasApiKey&&e.jsx("button",{type:"button",onClick:()=>{let c=he(r,"x-jishushell.proxy.upstream.apiKey","");c=he(c,"x-jishushell.proxy.upstream.clearApiKey",!a.clearApiKey),i(c)},className:`mt-2 text-xs ${a.clearApiKey?"text-red-400":"text-muted hover:text-foreground"} transition-colors`,children:a.clearApiKey?m("configForm.markedForClear"):m("configForm.clearSavedApiKey")})]}),N.length>0&&e.jsx(Q,{label:m("configForm.upstreamModel"),hint:m("configForm.upstreamModelHint"),children:e.jsx(De,{value:g,onChange:S,children:N.map(c=>e.jsxs("option",{value:c.id,children:[c.name," (",Math.round(c.contextWindow/1e3),"K)"]},c.id))})})]}),ee&&["ollama","vllm","sglang"].includes(s)&&e.jsxs("div",{className:"space-y-4 border-t border-[var(--border)] pt-4",children:[e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[e.jsx(Q,{label:"Base URL",hint:m("configForm.localServiceAddress"),children:e.jsx(le,{value:a.baseUrl||"",onChange:c=>F("baseUrl",c),placeholder:"http://127.0.0.1:11434",mono:!0})}),e.jsx(Q,{label:m("configForm.apiProtocol"),children:e.jsxs(De,{value:a.api||"openai-completions",onChange:c=>F("api",c),children:[e.jsx("option",{value:"openai-completions",children:"OpenAI Compatible"}),e.jsx("option",{value:"ollama",children:"Ollama"})]})})]}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-4",children:[e.jsx(Q,{label:m("configForm.modelId"),hint:m("configForm.modelIdHint"),children:e.jsx(le,{value:j.id==="default"?"":j.id,onChange:c=>{const b=[...h],E=b.findIndex(H=>H.id===g);E>=0?b[E]={...j,id:c||"default"}:b.push({id:c||"default",name:c||"default",contextWindow:j.contextWindow||0});let U=he(r,"x-jishushell.proxy.upstream.models",b);U=he(U,"x-jishushell.proxy.upstream.selectedModelId",c||"default"),i(U)},placeholder:"llama3",mono:!0})}),e.jsx(Q,{label:m("configForm.modelName"),children:e.jsx(le,{value:j.name==="default"?"":j.name||"",onChange:c=>{const b=[...h],E=b.findIndex(U=>U.id===g);E>=0?b[E]={...j,name:c||j.id}:b.push({id:j.id||"default",name:c||"default",contextWindow:j.contextWindow||0}),F("models",b)},placeholder:m("configForm.modelNamePlaceholder")})}),e.jsx(Q,{label:m("configForm.contextWindow"),children:e.jsx(le,{value:String(j.contextWindow||""),onChange:c=>{const b=[...h],E=b.findIndex(U=>U.id===g);E>=0?b[E]={...j,contextWindow:parseInt(c)||0}:b.push({id:j.id||"default",name:j.name||"default",contextWindow:parseInt(c)||0}),F("models",b)},placeholder:"128000",mono:!0})})]})]}),ee&&!["ollama","vllm","sglang"].includes(s)&&e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",onClick:()=>Fe(!B),className:"text-xs text-muted hover:text-foreground transition-colors",children:m(B?"configForm.collapseAdvanced":"configForm.advancedOptions")}),B&&e.jsxs("div",{className:"space-y-4 border-t border-[var(--border)] pt-4",children:[e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[e.jsx(Q,{label:m("configForm.upstreamBaseUrl"),children:e.jsx(le,{value:a.baseUrl||"",onChange:c=>F("baseUrl",c),placeholder:m("configForm.baseUrlPlaceholder"),mono:!0})}),e.jsx(Q,{label:m("configForm.upstreamApiProtocol"),children:e.jsxs(De,{value:a.api||"openai-completions",onChange:c=>F("api",c),children:[e.jsx("option",{value:"openai-completions",children:"OpenAI Compatible"}),e.jsx("option",{value:"openai-responses",children:"OpenAI Responses"}),e.jsx("option",{value:"anthropic-messages",children:"Anthropic Messages"}),e.jsx("option",{value:"google-generative-ai",children:"Google Generative AI"}),e.jsx("option",{value:"ollama",children:"Ollama"})]})})]}),s&&e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-4",children:[e.jsx(Q,{label:m("configForm.modelId"),children:e.jsx(le,{value:j.id,onChange:c=>{const b=[...h],E=b.findIndex(H=>H.id===g);E>=0?b[E]={...j,id:c}:b.push({...j,id:c});let U=he(r,"x-jishushell.proxy.upstream.models",b);U=he(U,"x-jishushell.proxy.upstream.selectedModelId",c),i(U)},placeholder:"model-id",mono:!0})}),e.jsx(Q,{label:m("configForm.modelName"),children:e.jsx(le,{value:j.name||"",onChange:c=>{const b=[...h],E=b.findIndex(U=>U.id===g);E>=0?b[E]={...j,name:c}:b.push({...j,name:c}),F("models",b)},placeholder:"Model Name"})}),e.jsx(Q,{label:m("configForm.contextWindow"),children:e.jsx(le,{value:String(j.contextWindow||""),onChange:c=>{const b=[...h],E=b.findIndex(U=>U.id===g);E>=0?b[E]={...j,contextWindow:parseInt(c)||0}:b.push({...j,contextWindow:parseInt(c)||0}),F("models",b)},placeholder:"200000",mono:!0})})]}),e.jsx("div",{className:"text-xs text-muted bg-[var(--card)] border border-[var(--border)] rounded-md p-3",children:m("configForm.proxyNote")})]})]})]}),e.jsxs(Zt,{title:m("configForm.imChannelConfig"),id:"im-channel-section",children:[e.jsx(Q,{label:m("configForm.sessionIsolation"),hint:m("configForm.sessionIsolationHint"),children:e.jsxs(De,{value:((ge=r==null?void 0:r.session)==null?void 0:ge.dmScope)||"main",onChange:c=>y("session.dmScope",c),children:[e.jsx("option",{value:"main",children:m("configForm.sessionMain")}),e.jsx("option",{value:"per-peer",children:m("configForm.sessionPerPeer")}),e.jsx("option",{value:"per-channel-peer",children:m("configForm.sessionPerChannelPeer")}),e.jsx("option",{value:"per-account-channel-peer",children:m("configForm.sessionPerAccountChannelPeer")})]})}),dt.map(c=>{Oe.find(z=>z.id===c);const b=m(`configForm.channel.${c}`,{defaultValue:c}),E=O[c]||{enabled:!0},U=E.enabled!==!1,H=hr[c]||c,te=t[H],P=c==="openclaw-weixin"?"#07C160":"#3370FF";return e.jsxs("div",{className:"border border-[var(--border)] rounded-lg p-4 space-y-3 bg-[var(--card)]",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm font-medium text-foreground",children:b}),e.jsx("span",{className:"text-[11px] text-muted font-mono",children:c})]}),e.jsx(Xt,{checked:U,onChange:z=>{O[c]||xe(c),q(c,"enabled",z)},label:m(U?"common:label.enabled":"common:label.disabled")})]}),U&&(te==="installing"?e.jsx("div",{className:"rounded-md px-4 py-3",style:{background:`${P}10`,borderColor:`${P}30`,borderWidth:1,borderStyle:"solid"},children:e.jsxs("div",{className:"flex items-center gap-2 text-sm",style:{color:P},children:[e.jsx("div",{className:"w-4 h-4 border-2 rounded-full animate-spin",style:{borderColor:`${P}30`,borderTopColor:P}}),e.jsx("span",{children:m("configForm.pluginInstalling",{label:b})})]})}):te!=="installed"?e.jsxs("div",{className:"rounded-md px-4 py-3",style:{background:`${P}08`,borderColor:`${P}30`,borderWidth:1,borderStyle:"dashed"},children:[e.jsx("button",{onClick:()=>f==null?void 0:f(H),className:"px-4 py-2 text-white rounded-md text-xs font-medium hover:opacity-90 transition-opacity",style:{background:P},children:m("configForm.installPlugin",{label:b})}),e.jsx("p",{className:"text-xs text-muted mt-2",children:m("configForm.installPluginHint",{label:b})})]}):e.jsxs(e.Fragment,{children:[(c==="feishu"||c==="lark")&&e.jsx(fr,{instanceId:o,channelKey:c,existingAppId:E.appId,existingDomain:E.domain||c,onConfigured:()=>{o&&Rs(async()=>{const{getConfig:z}=await import("./index-DkDnIohs.js").then(se=>se.a6);return{getConfig:z}},__vite__mapDeps([0,1,2,3])).then(({getConfig:z})=>{z(o).then(se=>{se&&i(se)})})}}),c==="openclaw-weixin"&&e.jsx(pr,{instanceId:o})]}))]},c)}),T.filter(c=>!dt.includes(c)).map(c=>{const b=O[c],E=Oe.find(P=>P.id===c),U=m(`configForm.channel.${c}`,{defaultValue:c}),H=(E==null?void 0:E.fields)||[],te=E?[]:Object.keys(b).filter(P=>P!=="enabled"&&typeof b[P]=="string");return e.jsxs("div",{className:"border border-[var(--border)] rounded-lg p-4 space-y-3 bg-[var(--card)]",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm font-medium text-foreground",children:U}),E&&e.jsx("span",{className:"text-[11px] text-muted font-mono",children:c})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(Xt,{checked:b.enabled!==!1,onChange:P=>q(c,"enabled",P),label:b.enabled!==!1?m("common:label.enabled"):m("common:label.disabled")}),e.jsx("button",{onClick:()=>fe(c),className:"text-xs text-red-400 hover:text-red-300 transition-colors",children:m("configForm.remove")})]})]}),b.enabled!==!1&&H.length>0&&e.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:H.map(P=>e.jsx(Q,{label:P.label,children:e.jsx(le,{value:b[P.key]||"",onChange:z=>q(c,P.key,z),placeholder:P.placeholder,type:P.type||"text",mono:!0})},P.key))}),b.enabled!==!1&&te.length>0&&e.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:te.map(P=>e.jsx(Q,{label:P,children:e.jsx(le,{value:b[P]||"",onChange:z=>q(c,P,z),placeholder:P,type:P.toLowerCase().includes("secret")||P.toLowerCase().includes("token")||P.toLowerCase().includes("password")?"password":"text",mono:!0})},P))}),b.enabled!==!1&&c==="whatsapp"&&H.length===0&&e.jsxs("div",{className:"bg-amber-500/10 border border-amber-500/20 rounded-md px-3 py-2 text-xs text-amber-400",children:[e.jsx("p",{className:"font-medium mb-1",children:m("configForm.whatsappTitle")}),e.jsx("p",{children:m("configForm.whatsappHint")})]})]},c)}),e.jsxs("div",{className:"pt-2",children:[e.jsx("p",{className:"text-xs text-muted mb-2",children:m("configForm.addImChannel")}),e.jsx("div",{className:"flex flex-wrap gap-2",children:Oe.filter(c=>{if(dt.includes(c.id))return!1;const b=J[c.id]||c.id;return!T.includes(b)&&!T.includes(c.id)}).map(c=>e.jsxs("button",{onClick:()=>xe(c.id),className:"px-3 py-1.5 text-xs border border-dashed rounded-md transition-colors duration-150 border-[var(--border)] text-muted hover:border-[var(--border-hover)] hover:text-foreground",children:["+ ",m(c.labelKey,{defaultValue:c.id})]},c.id))})]})]})]})}function fr({instanceId:r,channelKey:i,existingAppId:o,existingDomain:x,onConfigured:t}){const{t:f}=we(["instance","common"]);(i||x)==="lark"||f("configForm.feishu.platformFeishu");const[y,n]=w.useState(""),[a,s]=w.useState(""),[d,h]=w.useState("idle"),[N,g]=w.useState(""),[C,j]=w.useState(""),$=w.useRef(!1),L=w.useRef(!1),S=async()=>{if(r){L.current=!1,h("loading"),g(""),n("");try{let T=null;for(let q=0;q<3;q++){if(L.current)return;try{if(T=await ss(r,i),T!=null&&T.qrcodeUrl)break}catch{q<2&&await new Promise(J=>setTimeout(J,1500))}}if(L.current)return;T!=null&&T.qrcodeUrl?(n(T.qrcodeUrl),s(T.sessionKey),h("waiting"),g(f("configForm.feishu.scanHint")),F(T.sessionKey)):(h("error"),g(f("qr.getFailed")))}catch{L.current||(h("error"),g(f("qr.getFailed")))}}},F=T=>{if(!r||$.current)return;$.current=!0;const q=async()=>{if($.current)try{const J=await ns(r,T);if(J.connected){$.current=!1,h("confirmed"),g(J.message||f("qr.loginSuccess")),j(J.domain||"feishu"),n(""),t==null||t();return}if(J.status==="expired"){$.current=!1,h("error"),g(J.message||f("qr.expired"));return}setTimeout(q,3e3)}catch{$.current&&setTimeout(q,3e3)}};q()};if(w.useEffect(()=>()=>{$.current=!1},[]),d==="confirmed")return e.jsxs("div",{className:"bg-emerald-500/10 border border-emerald-500/20 rounded-md px-4 py-3 text-sm",children:[e.jsxs("div",{className:"flex items-center gap-2 text-emerald-400",children:[e.jsx("span",{className:"text-lg",children:"✓"}),e.jsx("span",{className:"font-medium",children:N})]}),e.jsx("p",{className:"text-xs text-muted mt-1",children:f("configForm.feishu.platform",{platform:f(C==="lark"?"configForm.feishu.platformLark":"configForm.feishu.platformFeishu")})})]});if(d==="idle"||d==="error")return e.jsxs("div",{className:"bg-[var(--card-hover)] rounded-md px-4 py-3 space-y-3",children:[o&&e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-muted mb-1",children:f("configForm.feishu.added")}),e.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[e.jsx("span",{className:"text-emerald-400",children:"✓"}),e.jsx("code",{className:"font-mono text-foreground/70",children:o}),e.jsx("span",{className:"text-muted opacity-60",children:x==="lark"?"Lark":f("configForm.feishu.platformFeishu")})]})]}),e.jsxs("div",{children:[e.jsx("button",{onClick:S,className:"px-4 py-2 bg-[#3370FF] text-white rounded-md text-xs font-medium hover:bg-[#3370FF]/90 transition-colors",children:f("configForm.feishu.addBot")}),e.jsx("p",{className:"text-xs text-muted mt-2",children:f("configForm.feishu.addBotHint")})]})]});const O=()=>{L.current=!0,$.current=!1,h("idle"),g(""),n(""),s("")};return e.jsx("div",{className:"bg-[var(--card-hover)] rounded-md px-4 py-4",children:e.jsxs("div",{className:"flex flex-col items-center gap-3",children:[y?e.jsx(Je,{value:y,size:192,className:"rounded-lg"}):e.jsx("div",{className:"w-48 h-48 flex items-center justify-center",children:e.jsx("div",{className:"w-6 h-6 border-2 border-[#3370FF]/30 border-t-[#3370FF] rounded-full animate-spin"})}),e.jsx("div",{className:"text-sm text-muted",children:d==="loading"?f("configForm.feishu.gettingQr"):N}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("button",{onClick:O,className:"px-3 py-1.5 text-xs text-white bg-red-500 rounded-md hover:bg-red-500/90 transition-colors",children:f("configForm.feishu.cancel")}),e.jsx("button",{onClick:()=>{O(),setTimeout(S,100)},className:"px-3 py-1.5 text-xs text-white bg-[#0066FF] rounded-md hover:bg-[#0066FF]/90 transition-colors",children:f("configForm.feishu.refresh")})]})]})})}function pr({instanceId:r}){const{t:i,i18n:o}=we(["instance","common"]),[x,t]=w.useState(""),[f,m]=w.useState(""),[y,n]=w.useState("idle"),[a,s]=w.useState(""),[d,h]=w.useState(""),[N,g]=w.useState([]),C=w.useRef(!1),j=w.useRef(!1);w.useEffect(()=>{r&&Ht(r).then(F=>{var O;(O=F==null?void 0:F.accounts)!=null&&O.length&&g(F.accounts)}).catch(()=>{})},[r]);const $=async()=>{if(r){j.current=!1,n("loading"),s(""),t("");try{let F=null;for(let O=0;O<3;O++){if(j.current)return;try{if(F=await rs(r),F!=null&&F.qrcodeUrl)break}catch{O<2&&await new Promise(T=>setTimeout(T,1500))}}if(j.current)return;F!=null&&F.qrcodeUrl?(t(F.qrcodeUrl),m(F.sessionKey),n("waiting"),s(i("configForm.weixin.scanHint")),L(F.sessionKey)):(n("error"),s(i("qr.getFailed")))}catch{j.current||(n("error"),s(i("qr.getFailed")))}}},L=F=>{if(!r||C.current)return;C.current=!0;const O=async()=>{if(C.current)try{const T=await as(r,F);if(T.connected){C.current=!1,n("confirmed"),s(T.message||i("qr.loginSuccess")),h(T.accountId||""),t(""),r&&Ht(r).then(q=>{q!=null&&q.accounts&&g(q.accounts)}).catch(()=>{});return}if(T.status==="scaned")n("scaned"),s(T.message||i("qr.scaned"));else if(T.status==="refreshed"&&T.qrcodeUrl)t(T.qrcodeUrl),n("waiting"),s(i("qr.refreshed"));else if(T.status==="expired"){C.current=!1,n("error"),s(T.message||i("qr.expired"));return}setTimeout(O,2e3)}catch{C.current&&setTimeout(O,3e3)}};O()};if(w.useEffect(()=>()=>{C.current=!1},[]),y==="confirmed")return e.jsxs("div",{className:"bg-emerald-500/10 border border-emerald-500/20 rounded-md px-4 py-3 text-sm",children:[e.jsxs("div",{className:"flex items-center gap-2 text-emerald-400",children:[e.jsx("span",{className:"text-lg",children:"✓"}),e.jsx("span",{className:"font-medium",children:a})]}),d&&e.jsxs("p",{className:"text-xs text-muted mt-1",children:[i("configForm.weixin.accountId")," ",e.jsx("code",{className:"font-mono",children:d})]}),e.jsx("p",{className:"text-xs text-muted mt-1",children:i("configForm.weixin.restartHint")}),e.jsx("button",{onClick:$,className:"mt-2 px-3 py-1 text-xs border border-emerald-500/30 rounded text-emerald-400 hover:bg-emerald-500/10 transition-colors",children:i("configForm.weixin.addAnother")})]});if(y==="idle"||y==="error")return e.jsxs("div",{className:"bg-[var(--card-hover)] rounded-md px-4 py-3 space-y-3",children:[N.length>0&&e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-muted mb-1.5",children:i("configForm.weixin.added")}),N.map(F=>e.jsxs("div",{className:"flex items-center gap-2 text-xs py-1",children:[e.jsx("span",{className:"text-emerald-400",children:"✓"}),e.jsx("code",{className:"font-mono text-foreground/70",children:F.accountId}),F.savedAt&&e.jsx("span",{className:"text-muted opacity-60",children:new Date(F.savedAt).toLocaleDateString(o.language==="zh"?"zh-CN":"en-US")})]},F.accountId))]}),e.jsxs("div",{children:[e.jsx("button",{onClick:$,className:"px-4 py-2 bg-[#07C160] text-white rounded-md text-xs font-medium hover:bg-[#07C160]/90 transition-colors",children:i("configForm.weixin.addClawBot")}),e.jsx("p",{className:"text-xs text-muted mt-2",children:i("configForm.weixin.addClawBotHint",{extra:N.length>0?i("configForm.weixin.addClawBotHintRestart"):i("configForm.weixin.addClawBotHintMulti")})})]})]});const S=()=>{j.current=!0,C.current=!1,n("idle"),s(""),t(""),m("")};return e.jsx("div",{className:"bg-[var(--card-hover)] rounded-md px-4 py-4",children:e.jsxs("div",{className:"flex flex-col items-center gap-3",children:[x?e.jsx(Je,{value:x,size:192,className:"rounded-lg"}):e.jsx("div",{className:"w-48 h-48 flex items-center justify-center",children:e.jsx("div",{className:"w-6 h-6 border-2 border-[#07C160]/30 border-t-[#07C160] rounded-full animate-spin"})}),e.jsx("div",{className:"flex items-center gap-2 text-sm",children:y==="scaned"?e.jsxs("span",{className:"text-[#07C160] font-medium",children:["👀 ",a]}):y==="loading"?e.jsx("span",{className:"text-muted",children:i("configForm.weixin.gettingQr")}):e.jsx("span",{className:"text-muted",children:a})}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("button",{onClick:S,className:"px-3 py-1.5 text-xs text-white bg-red-500 rounded-md hover:bg-red-500/90 transition-colors",children:i("configForm.weixin.cancel")}),e.jsx("button",{onClick:()=>{S(),setTimeout($,100)},className:"px-3 py-1.5 text-xs text-white bg-[#0066FF] rounded-md hover:bg-[#0066FF]/90 transition-colors",children:i("configForm.weixin.refresh")})]})]})})}const gr="im",br="即时通讯",vr="💬",wr=[{id:"feishu",label:"飞书 / Lark",desc:"飞书机器人(WebSocket 模式)"},{id:"openclaw-weixin",label:"微信",desc:"微信扫码接入"}],jr={id:gr,label:br,emoji:vr,items:wr},yr="skills",Nr="常用 Skill",kr="⚡",Cr=[{id:"hubs",label:"热门Hub",emoji:"🌐",skills:[{id:"clawhub",type:"hub",label:"ClawHub",desc:"OpenClaw 官方 Skill 市场",url:"https://clawhub.ai/",installMsg:""},{id:"skillhub-tencent",type:"hub",label:"腾讯 SkillHub",desc:"腾讯技能中心,官方出品",url:"https://skillhub.tencent.com/",installMsg:""},{id:"skills-sh",type:"hub",label:"Skills.sh",desc:"第三方 Skill 聚合社区",url:"https://skills.sh/",installMsg:""},{id:"lobehub-skills",type:"hub",label:"LobeHub Skills",desc:"LobeHub 社区 Skill 市场",url:"https://lobehub.com/skills",installMsg:""},{id:"findskills",type:"hub",label:"FindSkills.org",desc:"开源 Skill 搜索与聚合平台",url:"https://www.findskills.org/",installMsg:""},{id:"playbooks-skills",type:"hub",label:"Playbooks Skills",desc:"Playbooks 社区 Skill 目录",url:"https://playbooks.com/skills",installMsg:""}]},{id:"general",label:"通用基础",emoji:"🧠",skills:[{id:"skill-vetter",label:"Skill Vetter",desc:"安全审计 Skill,安装前建议先审查",installMsg:"根据以下链接安装skill:https://clawhub.ai/spclaudehome/skill-vetter",autoInstall:!0,slashCmd:"/skill-vetter",checkDirs:["skill-vetter","Skill Vetter","SkillVetter","vetter"]},{id:"self-improving-agent-cn",label:"Self-Improving CN Agent",desc:"自我优化的 Agent,持续改进任务执行",installMsg:"根据以下链接安装skill:https://clawhub.ai/zhengxinjipai/self-improving-agent-cn",autoInstall:!0,slashCmd:"/self-improving-agent-cn",checkDirs:["self-improving-agent-cn","SelfImprovingAgentCn","self_improving_agent_cn"]},{id:"proactive-agent",label:"Proactive Agent",desc:"主动式 Agent,自动感知并提前完成任务",installMsg:"根据以下链接安装skill:https://clawhub.ai/bestrocky/proactive-agent-lite",autoInstall:!0,slashCmd:"/proactive-agent",checkDirs:["proactive-agent-lite","proactive-agent","ProactiveAgent","proactive_agent"]},{id:"multi-search-engine",label:"Multi Search Engine",desc:"多搜索引擎聚合搜索",installMsg:"根据以下链接安装skill:https://clawhub.ai/gpyangyoujun/multi-search-engine",autoInstall:!0,slashCmd:"/multi-search-engine",checkDirs:["multi-search-engine","MultiSearchEngine","multi_search_engine"]},{id:"exa-web-search-free",label:"Exa Web Search Free",desc:"免费 Exa 网页语义搜索",installMsg:"根据以下链接安装skill:https://clawhub.ai/whiteknight07/exa-web-search-free",autoInstall:!0,slashCmd:"/exa-web-search-free",checkDirs:["exa-web-search-free","ExaWebSearchFree","exa_web_search_free"]},{id:"filesystem",label:"Filesystem",desc:"本地文件系统读写与管理",installMsg:"根据以下链接安装skill:https://clawhub.ai/steipete/filesystem",autoInstall:!0,slashCmd:"/filesystem",checkDirs:["filesystem","steipete-filesystem"]},{id:"summarize",label:"Summarize",desc:"内容摘要与总结提炼",installMsg:"根据以下链接安装skill:https://clawhub.ai/steipete/summarize",autoInstall:!0,slashCmd:"/summarize",checkDirs:["summarize","steipete-summarize"]},{id:"baidu-search",label:"百度搜索",desc:"百度搜索引擎集成",installMsg:"根据以下链接安装skill:https://clawhub.ai/ide-rea/baidu-search",autoInstall:!0,slashCmd:"/baidu-search",checkDirs:["baidu-search","BaiduSearch"]},{id:"agent-browser-clawdbot",label:"Agent Browser",desc:"AI 驱动的网页浏览与自动化操作",installMsg:"根据以下链接安装skill:https://clawhub.ai/matrixy/agent-browser-clawdbot",autoInstall:!0,slashCmd:"/agent-browser-clawdbot",checkDirs:["agent-browser-clawdbot","agent-browser","AgentBrowser"]},{id:"automation-workflows",label:"Automation Workflows",desc:"自动化工作流编排与执行",installMsg:"根据以下链接安装skill:https://clawhub.ai/jk-0001/automation-workflows",autoInstall:!0,slashCmd:"/automation-workflows",checkDirs:["automation-workflows","AutomationWorkflows"]},{id:"evolver",label:"Evolver",desc:"Agent 自动进化与能力迭代",installMsg:"根据以下链接安装skill:https://clawhub.ai/autogame-17/evolver",autoInstall:!0,slashCmd:"/evolver",checkDirs:["evolver","autogame-evolver"]}]},{id:"productivity",label:"工作效率",emoji:"💼",skills:[{id:"pdf-reader",label:"PDF Reader",desc:"PDF 文档读取与分析",installMsg:"根据以下链接安装skill:https://clawhub.ai/awspace/pdf",autoInstall:!0,slashCmd:"/pdf",checkDirs:["pdf","pdf-reader","awspace-pdf"]},{id:"powerpoint-pptx",label:"PowerPoint / PPTX",desc:"PPT 演示文稿生成与编辑",installMsg:"根据以下链接安装skill:https://clawhub.ai/ivangdavila/powerpoint-pptx",autoInstall:!0,slashCmd:"/powerpoint-pptx",checkDirs:["powerpoint-pptx","powerpoint","pptx"]},{id:"word-docx",label:"Word / DOCX",desc:"Word 文档生成与编辑",installMsg:"根据以下链接安装skill:https://clawhub.ai/ivangdavila/word-docx",autoInstall:!0,slashCmd:"/word-docx",checkDirs:["word-docx","word","docx"]},{id:"excel-xlsx",label:"Excel / XLSX",desc:"Excel 表格生成与数据处理",installMsg:"根据以下链接安装skill:https://clawhub.ai/ivangdavila/excel-xlsx",autoInstall:!0,slashCmd:"/excel-xlsx",checkDirs:["excel-xlsx","excel","xlsx"]},{id:"ai-ppt-generator",label:"AI PPT Generator",desc:"AI 自动生成 PPT 演示文稿",installMsg:"根据以下链接安装skill:https://clawhub.ai/ide-rea/ai-ppt-generator",autoInstall:!0,slashCmd:"/ai-ppt-generator",checkDirs:["ai-ppt-generator","AiPptGenerator"]},{id:"nano-banana-pro",label:"Nano Banana Pro",desc:"轻量高效的任务执行与流程优化",installMsg:"根据以下链接安装skill:https://clawhub.ai/steipete/nano-banana-pro",autoInstall:!0,slashCmd:"/nano-banana-pro",checkDirs:["nano-banana-pro","NanoBananaPro"]},{id:"ppt-generator",label:"PPT Generator",desc:"PPT 演示文稿智能生成",installMsg:"根据以下链接安装skill:https://clawhub.ai/wwlyzzyorg/ppt-generator",autoInstall:!0,slashCmd:"/ppt-generator",checkDirs:["ppt-generator","PptGenerator"]},{id:"marketing-mode",label:"Marketing Mode",desc:"营销文案与推广内容创作",installMsg:"根据以下链接安装skill:https://clawhub.ai/thesethrose/marketing-mode",autoInstall:!0,slashCmd:"/marketing-mode",checkDirs:["marketing-mode","MarketingMode"]},{id:"data-analysis",label:"Data Analysis",desc:"数据分析与可视化报告生成",installMsg:"根据以下链接安装skill:https://clawhub.ai/ivangdavila/data-analysis",autoInstall:!0,slashCmd:"/data-analysis",checkDirs:["data-analysis","DataAnalysis"]}]},{id:"life",label:"生活辅助",emoji:"🏠",skills:[{id:"todo-manager",label:"Todo Manager",desc:"任务与待办事项管理",installMsg:"根据以下链接安装skill:https://clawhub.ai/aeoleader/todo-manager",autoInstall:!0,slashCmd:"/todo-manager",checkDirs:["todo-manager","todo","TodoManager"]},{id:"12306",label:"12306 火车票",desc:"查询与购买 12306 火车票",installMsg:"根据以下链接安装skill:https://clawhub.ai/kirorab/12306",autoInstall:!0,slashCmd:"/12306",checkDirs:["12306","kirorab-12306"]},{id:"youtube-watcher",label:"YouTube Watcher",desc:"YouTube 视频摘要与内容分析",installMsg:"根据以下链接安装skill:https://clawhub.ai/michaelgathara/youtube-watcher",autoInstall:!0,slashCmd:"/youtube-watcher",checkDirs:["youtube-watcher","youtube","YoutubeWatcher"]},{id:"xiaohongshu-cn",label:"小红书助手",desc:"小红书内容创作与运营辅助",installMsg:"根据以下链接安装skill:https://clawhub.ai/guohongbin-git/xiaohongshu-cn",autoInstall:!0,slashCmd:"/xiaohongshu-cn",checkDirs:["xiaohongshu-cn","xiaohongshu","XiaohongshuCn"]},{id:"wechat-mp-cn",label:"微信公众号助手",desc:"微信公众号内容创作与发布辅助",installMsg:"根据以下链接安装skill:https://clawhub.ai/guohongbin-git/wechat-mp-cn",autoInstall:!0,slashCmd:"/wechat-mp-cn",checkDirs:["wechat-mp-cn","wechat-mp","WechatMpCn"]},{id:"weather",label:"Weather",desc:"实时天气查询与预报",installMsg:"根据以下链接安装skill:https://clawhub.ai/steipete/weather",autoInstall:!0,slashCmd:"/weather",checkDirs:["weather","steipete-weather"]},{id:"stock-analysis",label:"Stock Analysis",desc:"股票行情分析与投资参考",installMsg:"根据以下链接安装skill:https://clawhub.ai/udiedrichsen/stock-analysis",autoInstall:!0,slashCmd:"/stock-analysis",checkDirs:["stock-analysis","StockAnalysis"]},{id:"news-summary",label:"News Summary",desc:"新闻资讯聚合与摘要生成",installMsg:"根据以下链接安装skill:https://clawhub.ai/joargp/news-summary",autoInstall:!0,slashCmd:"/news-summary",checkDirs:["news-summary","NewsSummary"]}]},{id:"dev",label:"开发工具",emoji:"🛠️",skills:[{id:"github",label:"GitHub",desc:"GitHub 仓库管理与代码协作",installMsg:"根据以下链接安装skill:https://clawhub.ai/steipete/github",autoInstall:!0,slashCmd:"/github",checkDirs:["github","GitHub","steipete-github"]},{id:"gemini",label:"Gemini",desc:"Google Gemini 模型接入与调用",installMsg:"根据以下链接安装skill:https://clawhub.ai/steipete/gemini",autoInstall:!0,slashCmd:"/gemini",checkDirs:["gemini","Gemini","steipete-gemini"]},{id:"api-gateway",label:"API Gateway",desc:"API 接口管理与请求代理",installMsg:"根据以下链接安装skill:https://clawhub.ai/byungkyu/api-gateway",autoInstall:!0,slashCmd:"/api-gateway",checkDirs:["api-gateway","ApiGateway"]},{id:"mcporter",label:"MCPorter",desc:"MCP 服务器管理工具",installMsg:"根据以下链接安装skill:https://clawhub.ai/steipete/mcporter",autoInstall:!0,slashCmd:"/mcporter",checkDirs:["mcporter","MCPorter","steipete-mcporter"]},{id:"session-logs",label:"Session Logs",desc:"会话日志记录与回放分析",installMsg:"根据以下链接安装skill:https://clawhub.ai/guogang1024/session-logs",autoInstall:!0,slashCmd:"/session-logs",checkDirs:["session-logs","SessionLogs"]}]}],ze={id:yr,label:Nr,emoji:kr,groups:Cr},Fr="mcp",Sr="常用 MCP",Mr="🔌",Er=[{id:"12306-mcp",label:"12306-MCP车票查询工具",desc:"12306-MCP车票查询工具",mcpJson:{"12306-mcp":{command:"npx",args:["-y","12306-mcp"]}}},{id:"bing-search",label:"Bing 搜索",desc:"必应搜索引擎 MCP 接入",mcpJson:{"bing-search":{command:"npx",args:["-y","bing-cn-mcp"]}}},{id:"fxbaogao-mcp",label:"发现报告",desc:"发现报告研究报告检索与阅读",mcpJson:{"fxbaogao-mcp":{command:"uvx",args:["fxbaogao-mcp@latest"]}}}],Ar={id:Fr,label:Sr,emoji:Mr,items:Er},Ir="slash",Pr="常用 /命令",Rr="/",Lr=[{label:"会话",items:[{id:"slash-new",label:"/new",desc:"开启新会话",cmd:"/new",send:!0},{id:"slash-reset",label:"/reset",desc:"重置当前会话",cmd:"/reset",send:!0},{id:"slash-compact",label:"/compact",desc:"压缩会话上下文",cmd:"/compact",send:!0},{id:"slash-stop",label:"/stop",desc:"停止当前运行",cmd:"/stop",send:!0},{id:"slash-clear",label:"/clear",desc:"清空聊天记录",cmd:"/clear",send:!0},{id:"slash-focus",label:"/focus",desc:"切换专注模式",cmd:"/focus",send:!0}]},{label:"模型",items:[{id:"slash-model",label:"/model <name>",desc:"查看或切换模型",cmd:"/model ",send:!1},{id:"slash-think",label:"/think <level>",desc:"设置思考深度",cmd:"/think ",send:!1},{id:"slash-verbose",label:"/verbose <on|off|full>",desc:"切换详细输出模式",cmd:"/verbose ",send:!1},{id:"slash-fast",label:"/fast <status|on|off>",desc:"切换快速模式",cmd:"/fast ",send:!1}]},{label:"工具",items:[{id:"slash-help",label:"/help",desc:"查看可用命令",cmd:"/help",send:!0},{id:"slash-status",label:"/status",desc:"显示会话状态(agent)",cmd:"/status",send:!0},{id:"slash-export",label:"/export",desc:"导出会话为 Markdown",cmd:"/export",send:!0},{id:"slash-usage",label:"/usage",desc:"显示 Token 用量",cmd:"/usage",send:!0}]}],Tr={id:Ir,label:Pr,emoji:Rr,groups:Lr};function Dr({gatewayLaunchUrl:r,gatewayReady:i,isRunning:o,isPending:x,iframeLoaded:t,actionLoading:f,onAction:m,onReload:y,onIframeLoad:n}){const{t:a}=we("instance");return e.jsx("div",{className:"overflow-hidden rounded-[22px] border border-[var(--border)] bg-[var(--card)] shadow-[0_18px_48px_rgba(15,23,42,0.06)]",children:e.jsxs("div",{className:"relative",style:{height:"calc(100vh - 160px)",minHeight:"500px"},children:[(!o||!i||!t)&&e.jsx("div",{className:`absolute inset-0 w-full h-full bg-[var(--card)] flex flex-col items-center justify-center z-10 transition-opacity duration-300 ${t?"opacity-0 pointer-events-none":"opacity-100"}`,children:o?i?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"w-5 h-5 border-2 border-[#0066FF]/30 border-t-[#0066FF] rounded-full animate-spin mb-3"}),e.jsx("div",{className:"text-sm text-foreground/60",children:a("chat.loadingChat")})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"w-5 h-5 border-2 border-[#0066FF]/30 border-t-[#0066FF] rounded-full animate-spin mb-3"}),e.jsx("div",{className:"text-sm text-foreground/60",children:a("chat.waitingGateway")})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"text-4xl mb-4 opacity-40",children:"💬"}),e.jsx("div",{className:"text-sm text-foreground/60 font-medium mb-1",children:a("chat.notReady")}),e.jsx("div",{className:"text-xs text-muted mb-4",children:a("chat.startHint")}),e.jsx("button",{onClick:()=>m("start"),disabled:!!f||x,className:"px-4 py-2 bg-[#0066FF] text-white rounded-md text-xs font-medium hover:bg-[#0066FF]/90 disabled:opacity-40 transition-all duration-200",children:a(f==="start"||x?"action.starting":"chat.startInstance")})]})}),i&&r&&e.jsx("iframe",{id:"gateway-iframe",src:r,className:"w-full h-full",sandbox:"allow-scripts allow-same-origin allow-forms allow-popups allow-downloads allow-modals",allow:"microphone; camera; clipboard-write",onLoad:n})]})})}function Or({logs:r,logSearch:i,logType:o,logsEndRef:x,onSearchChange:t,onLogTypeChange:f,onRefresh:m,onCopy:y}){const{t:n}=we("instance"),a=i?r.filter(s=>s.toLowerCase().includes(i.toLowerCase())):r;return e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsxs("div",{className:"relative flex-1 min-w-[200px]",children:[e.jsx(Ls,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-muted"}),e.jsx("input",{type:"text",value:i,onChange:s=>t(s.target.value),placeholder:n("logs.searchPlaceholder"),className:"w-full bg-[var(--input-bg)] border border-[var(--border)] rounded-md pl-9 pr-3 py-1.5 text-sm text-foreground placeholder-[var(--muted)] focus:outline-none focus:ring-1 focus:ring-[#0066FF]/60 focus:border-[#0066FF]/60 transition-colors"})]}),e.jsx("div",{className:"flex items-center gap-1",children:["stderr","stdout"].map(s=>e.jsx("button",{onClick:()=>f(s),className:`px-2.5 py-1.5 text-xs rounded-md transition-colors duration-150 ${o===s?"bg-[#0066FF] text-white":"text-muted hover:bg-[var(--card-hover)]"}`,children:s},s))}),e.jsx("button",{onClick:m,className:"p-1.5 border border-[var(--border)] rounded-md text-muted hover:text-foreground hover:bg-[var(--card-hover)] transition-colors",title:n("common:action.refresh"),children:e.jsx(ls,{className:"w-3.5 h-3.5"})}),e.jsx("button",{onClick:y,className:"p-1.5 border border-[var(--border)] rounded-md text-muted hover:text-foreground hover:bg-[var(--card-hover)] transition-colors",title:n("common:action.copyAll"),children:e.jsx(Ts,{className:"w-3.5 h-3.5"})})]}),e.jsxs("div",{className:"bg-black/60 border border-[var(--border)] rounded-xl font-mono text-[13px] p-4 min-h-[400px] lg:min-h-[500px] overflow-auto max-h-[70vh]",children:[a.length===0?e.jsx("p",{className:"text-muted",children:n("logs.empty")}):a.map((s,d)=>{const h=/error|ERR|panic|fatal/i.test(s),N=/warn|WARN/i.test(s);return e.jsx("div",{className:`whitespace-pre-wrap break-all leading-5 ${h?"text-red-400 bg-red-950/20":N?"text-amber-400":"text-foreground opacity-70"}`,children:s},`${d}-${s.slice(0,32)}`)}),e.jsx("div",{ref:x})]})]})}function $r({usage:r,onRefresh:i}){const{t:o}=we("instance");if(!r)return e.jsx("div",{className:"space-y-4",children:e.jsxs("div",{className:"animate-pulse space-y-4",children:[e.jsx("div",{className:"grid grid-cols-3 gap-3",children:[1,2,3].map(t=>e.jsx("div",{className:"h-20 bg-[var(--card)] rounded-lg"},t))}),e.jsx("div",{className:"h-60 bg-[var(--card)] rounded-lg"})]})});const x=tr.language==="zh"?"zh-CN":"en-US";return e.jsxs("div",{className:"space-y-4",children:[r.totals.totalTokens===0&&r.totals.messages>0&&e.jsx("div",{className:"bg-[var(--card)] border border-[var(--border)] text-muted text-sm rounded-lg px-4 py-3",children:o("usage.noTokenData")}),e.jsx("div",{className:"grid grid-cols-2 lg:grid-cols-3 gap-3",children:[{label:o("usage.messages"),value:r.totals.messages.toLocaleString()},{label:o("usage.totalTokens"),value:r.totals.totalTokens.toLocaleString()},{label:o("usage.totalCost"),value:`$${r.totals.costTotal.toFixed(4)}`}].map(t=>e.jsxs("div",{className:"bg-[var(--card)] border border-[var(--border)] rounded-xl p-4 hover:border-[var(--border-hover)] transition-colors",children:[e.jsx("div",{className:"text-xs text-muted mb-1",children:t.label}),e.jsx("div",{className:"text-2xl font-semibold text-foreground",children:t.value})]},t.label))}),e.jsxs("div",{className:"bg-[var(--card)] border border-[var(--border)] rounded-xl overflow-hidden",children:[e.jsxs("div",{className:"px-4 py-3 border-b border-[var(--border)] flex items-center justify-between",children:[e.jsxs("span",{className:"text-sm font-medium text-foreground",children:[o("usage.sessions")," (",r.sessions.length,")"]}),e.jsx("button",{onClick:i,className:"text-xs text-muted hover:text-foreground transition-colors",children:o("common:action.refresh")})]}),r.sessions.length===0?e.jsx("p",{className:"text-muted text-sm p-4",children:o("usage.noSessions")}):e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"text-xs text-muted border-b border-[var(--border)]",children:[e.jsx("th",{className:"text-left font-medium px-4 py-2",children:o("usage.time")}),e.jsx("th",{className:"text-left font-medium px-4 py-2",children:o("usage.model")}),e.jsx("th",{className:"text-left font-medium px-4 py-2",children:o("usage.source")}),e.jsx("th",{className:"text-right font-medium px-4 py-2",children:o("usage.messagesShort")}),e.jsx("th",{className:"text-right font-medium px-4 py-2",children:o("usage.input")}),e.jsx("th",{className:"text-right font-medium px-4 py-2",children:o("usage.output")}),e.jsx("th",{className:"text-right font-medium px-4 py-2",children:o("usage.tokens")}),e.jsx("th",{className:"text-right font-medium px-4 py-2",children:o("usage.cost")})]})}),e.jsx("tbody",{className:"divide-y divide-[var(--border)]",children:r.sessions.map(t=>e.jsxs("tr",{className:"hover:bg-[var(--card-hover)] transition-colors",children:[e.jsx("td",{className:"px-4 py-2 text-muted whitespace-nowrap",children:t.lastMessage?new Date(t.lastMessage).toLocaleString(x,{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}):"-"}),e.jsx("td",{className:"px-4 py-2 font-mono text-xs text-muted",children:t.model||"-"}),e.jsxs("td",{className:"px-4 py-2 text-muted",children:[t.channel&&e.jsx("span",{className:"inline-block bg-[var(--card-hover)] text-muted text-[11px] px-1.5 py-0.5 rounded mr-1 font-medium",children:t.channel}),e.jsx("span",{className:"text-xs text-muted opacity-60",children:t.origin?t.origin.length>20?t.origin.slice(0,20)+"...":t.origin:""})]}),e.jsx("td",{className:"px-4 py-2 text-right tabular-nums text-muted",children:t.usage.messages}),e.jsx("td",{className:"px-4 py-2 text-right font-mono text-xs tabular-nums text-muted",children:t.usage.input.toLocaleString()}),e.jsx("td",{className:"px-4 py-2 text-right font-mono text-xs tabular-nums text-muted",children:t.usage.output.toLocaleString()}),e.jsx("td",{className:"px-4 py-2 text-right font-mono text-xs tabular-nums text-muted",children:t.usage.totalTokens.toLocaleString()}),e.jsxs("td",{className:"px-4 py-2 text-right font-mono text-xs tabular-nums text-muted",children:["$",t.usage.costTotal.toFixed(4)]})]},t.key))})]})})]})]})}function Ur(r,i){if(r==null)return"-";const o=Math.floor(r/86400),x=Math.floor(r%86400/3600),t=Math.floor(r%3600/60);return o>0?i("instance:uptime.days",{d:o,h:x}):x>0?i("instance:uptime.hours",{h:x,m:t}):i("instance:uptime.minutes",{m:t})}const We=[jr,ze,Ar,Tr];function _r(r){for(const i of We){const o=t=>(t==null?void 0:t.find(f=>f.id===r))??null;if(i.groups)for(const t of i.groups){const f=o(t.items);if(f)return f}const x=o(i.items);if(x)return x}return null}function es(r,i){const o=JSON.parse(JSON.stringify(r??{})),x=Oe.find(m=>m.id===i);if(x){if(o.channels||(o.channels={}),o.plugins||(o.plugins={}),o.plugins.entries||(o.plugins.entries={}),o.channels[i])o.channels[i].enabled=!0;else{const m={enabled:!0,...x.defaults??{}};x.fields.forEach(y=>{y.key in m||(m[y.key]="")}),o.channels[i]=m}return o.plugins.entries[i]||(o.plugins.entries[i]={enabled:!0}),o}const t={"skill-vetter":{"skill-vetter":{enabled:!0}},"skill-finder":{"skill-finder":{enabled:!0}},"skill-browser":{"skill-browser":{enabled:!0}}};if(i in t)return o.skills||(o.skills={}),Object.assign(o.skills,t[i]),o;const f={};return i in f&&(o.mcp||(o.mcp={}),o.mcp.servers||(o.mcp.servers={}),Object.assign(o.mcp.servers,f[i])),o}function qr(r){var x,t,f;const i=(t=(x=r==null?void 0:r.runtime)==null?void 0:x.env)==null?void 0:t.OPENCLAW_GATEWAY_PORT;if(i)return String(i);const o=((f=r==null?void 0:r.runtime)==null?void 0:f.args)||[];for(let m=0;m<o.length;m++){if(o[m]==="--port"&&m+1<o.length)return String(o[m+1]);if(typeof o[m]=="string"&&o[m].startsWith("--port="))return String(o[m].slice(7))}return"-"}function Qr(){var Tt,Dt,Ot,$t,Ut,_t,qt;const{id:r,tab:i}=Xs(),o=Zs(),{showToast:x}=Ds(),{t}=we(["instance","common","data"]),[f,m]=w.useState(null),[y,n]=w.useState(i==="overview"?"chat":i||"chat"),[a,s]=w.useState(null),[d,h]=w.useState(!1),[N,g]=w.useState(""),[C,j]=w.useState(!1),[$,L]=w.useState(""),[S,F]=w.useState([]),[O,T]=w.useState("stderr"),[q,J]=w.useState(""),[xe,fe]=w.useState(null),[B,Fe]=w.useState(""),[ee,Y]=w.useState(!1),[X,ne]=w.useState(!1),[G,pe]=w.useState(""),[oe,ge]=w.useState(!1),[c,b]=w.useState(!1),[E,U]=w.useState(""),[H,te]=w.useState(!1),[P,z]=w.useState(!1),[se,vs]=w.useState("im"),[Ie,$e]=w.useState("general"),[D,je]=w.useState(null),[ws,Ve]=w.useState({}),[Se,Qe]=w.useState(""),[Ge,ht]=w.useState(""),[xt,ye]=w.useState(""),[Ne,ie]=w.useState({servers:[],installed:!1,loading:!1}),[V,ae]=w.useState(null),ue=w.useRef(!1),ce=w.useRef(!1),[Ye,ft]=w.useState(!1),[me,pt]=w.useState(null),[gt,bt]=w.useState(!1),Xe=w.useRef(null),Ze=w.useRef(null),[vt,wt]=w.useState(!1),[et,jt]=w.useState(null),[yt,Nt]=w.useState(!1),[kt,Ct]=w.useState(null),[Ft,Ue]=w.useState(null),St=w.useRef(r),tt=w.useRef(Ye);St.current=r,tt.current=Ye,w.useEffect(()=>{Os().then(l=>{l.hasUpdate&&pt({currentVersion:l.currentVersion,latestVersion:l.latestVersion})}).catch(()=>{})},[]);const js=async()=>{if(window.confirm(t("update.confirm",{currentVersion:me==null?void 0:me.currentVersion,latestVersion:me==null?void 0:me.latestVersion}))){bt(!0);try{await Ws(),x(t("update.started"),"success"),pt(null)}catch(l){x(l.message||t("update.failed"),"error")}finally{bt(!1)}}};w.useEffect(()=>{P&&r&&Te(r).then(je).catch(()=>{})},[P,r]),w.useEffect(()=>{P&&se==="mcp"&&r&&(ie(l=>({...l,loading:!0})),ct(r).then(l=>ie({servers:l.servers,installed:l.installed,loading:!1})).catch(()=>ie(l=>({...l,loading:!1}))))},[P,se,r]),w.useEffect(()=>{i&&n(i==="overview"?"chat":i)},[i]),w.useEffect(()=>{vt&&y==="config"&&a&&(wt(!1),j(!1),setTimeout(()=>{const l=document.getElementById("im-channel-section");l?l.scrollIntoView({behavior:"smooth",block:"start"}):window.scrollTo({top:document.body.scrollHeight,behavior:"smooth"})},200))},[vt,y,a]);const Pe=w.useCallback(()=>{const l=St.current;l&&!tt.current&&$s(l).then(m).catch(()=>{})},[x]);w.useEffect(()=>{Pe(),r&&(ne(!1),Us(r).then(u=>{const p=typeof(u==null?void 0:u.url)=="string"?u.url.trim():"";if(!p)throw new Error("No gateway launch URL returned");Fe(p)}).catch(u=>{Fe(""),x((u==null?void 0:u.message)||t("gatewayLaunchFailed"),"error")}));const l=setInterval(Pe,5e3);return()=>clearInterval(l)},[r,Pe]);const Mt=((Tt=f==null?void 0:f.service)==null?void 0:Tt.status)==="running",Et=w.useRef(!1);Et.current=ee,w.useEffect(()=>{if(!B||!Mt){Y(!1),ne(!1);return}if(Et.current)return;let l=!1,u=0;const p=60,v=()=>{l||u>=p||(u++,fetch(B,{method:"HEAD",credentials:"include"}).then(k=>{!l&&k.ok&&Y(!0)}).catch(()=>{}))};v();const I=setInterval(v,3e3);return()=>{l=!0,clearInterval(I)}},[B,Mt]);const[re,st]=w.useState({}),At=Object.values(re).includes("installing"),_e=w.useRef(new Set),rt=w.useRef(x);rt.current=x;const nt=w.useRef(t);nt.current=t,w.useEffect(()=>{if(!r||!(y==="config"||At))return;let u=!1;const p=()=>{u||zt(r).then(I=>{var M;if(u)return;const k={};for(const[A,_]of Object.entries(I.plugins))k[A]=_.status;for(const A of _e.current){const _=k[A];if(_==="installed")rt.current(nt.current(A==="feishu"?"feishu.pluginInstalled":"weixin.pluginInstalled"),"success"),_e.current.delete(A);else if(_==="failed"||_==="not_installed"){const Z=(M=I.plugins[A])==null?void 0:M.error;rt.current(nt.current(A==="feishu"?"feishu.pluginFailed":"weixin.pluginFailed")+(Z?": "+Z:""),"error"),_e.current.delete(A)}}st(k)}).catch(()=>{})};p();const v=setInterval(p,3e3);return()=>{u=!0,clearInterval(v)}},[r,y,At]),w.useEffect(()=>{P&&r&&zt(r).then(l=>{const u={};for(const[p,v]of Object.entries(l.plugins))u[p]=v.status;st(u)}).catch(()=>{})},[P,r]);const It=l=>{r&&(Ks(r,l).catch(()=>{}),st(u=>({...u,[l]:"installing"})),_e.current.add(l),x(t(l==="feishu"?"feishu.installing":"weixin.installing"),"info"))};w.useEffect(()=>{if(!d)return;const l=u=>{u.preventDefault()};return window.addEventListener("beforeunload",l),()=>window.removeEventListener("beforeunload",l)},[d]),w.useEffect(()=>{y==="config"&&r&&Wt(r).then(l=>{const u=Ze.current;Ze.current=null;const p=u?es(l,u):l;s(p),L(JSON.stringify(p,null,2)),h(!!u)}).catch(()=>{}),y==="usage"&&r&&Kt(r).then(fe).catch(()=>{})},[y,r]);const at=()=>{r&&Js(r,200,O).then(l=>{var p;F(l.lines);const u=(p=Xe.current)==null?void 0:p.parentElement;u&&u.scrollHeight-u.scrollTop-u.clientHeight<80&&setTimeout(()=>{var I;return(I=Xe.current)==null?void 0:I.scrollIntoView({behavior:"smooth"})},100)}).catch(()=>{})};er(at,3e3,y==="logs"&&!!r),w.useEffect(()=>{y==="logs"&&at()},[O]);const qe=async l=>{if(r){pe(l);try{l==="start"&&await Vs(r),l==="stop"&&await Qs(r),l==="restart"&&await Gt(r),x(t(l==="start"?"action.startHint":l==="stop"?"action.stopDone":"action.restartHint"),l==="stop"?"success":"info"),(l==="start"||l==="restart")&&o(`/instances/${r}`),setTimeout(Pe,1e3)}catch(u){x(u.message||t("common:error.operationFailed"),"error")}finally{pe("")}}},Pt=async l=>{if(!r)return;z(!1),ue.current=!1;const u=l==="feishu"?"feishu":"openclaw-weixin",p=re[u];if(p==="installing"){x(t(l==="feishu"?"feishu.waitingInstall":"weixin.waitingInstall"),"info");return}if(p!=="installed"){It(u);return}ce.current=!1,ae({type:l,qrUrl:"",sessionKey:"",status:"loading",message:t("qr.gettingQr")});try{let v=null;for(let k=0;k<3;k++){if(ce.current)return;try{if(v=l==="feishu"?await ss(r):await rs(r),v!=null&&v.qrcodeUrl)break}catch{k<2&&await new Promise(M=>setTimeout(M,1500))}}if(ce.current)return;if(!(v!=null&&v.qrcodeUrl)){ae(k=>k?{...k,status:"error",message:t("qr.getFailed")}:null);return}ae({type:l,qrUrl:v.qrcodeUrl,sessionKey:v.sessionKey,status:"waiting",message:t(l==="feishu"?"qr.scanFeishu":"qr.scanWeixin")}),ue.current=!0;const I=async k=>{if(!(!ue.current||ce.current))try{const M=l==="feishu"?await ns(r,k):await as(r,k);if(ce.current)return;if(M.connected){ue.current=!1,ae(A=>A?{...A,qrUrl:"",status:"confirmed",message:M.message||t("qr.loginSuccess")}:null);return}if(M.status==="expired"){ue.current=!1,ae(A=>A?{...A,status:"error",message:M.message||t("qr.expired")}:null);return}M.status==="refreshed"&&M.qrcodeUrl?ae(A=>A?{...A,qrUrl:M.qrcodeUrl,message:t("qr.refreshed")}:null):M.status==="scaned"&&ae(A=>A?{...A,status:"scaned",message:M.message||t("qr.scaned")}:null),setTimeout(()=>I(k),2e3)}catch{ue.current&&!ce.current&&setTimeout(()=>I(k),3e3)}};setTimeout(()=>I(v.sessionKey),2e3)}catch{ce.current||ae(v=>v?{...v,status:"error",message:t("qr.getFailed")}:null)}},ke=(l,u)=>{let p=0;const v=()=>{var I;try{const k=document.getElementById("gateway-iframe");if(!k){++p<50&&setTimeout(v,200);return}const M=k.contentDocument;if(!M||M.readyState==="loading"){++p<50&&setTimeout(v,200);return}const A=M.querySelector("openclaw-app");if(!A){++p<50&&setTimeout(v,200);return}if(u){if(!A.connected&&++p<50){setTimeout(v,200);return}A.handleSendChat(l)}else A.chatMessage=l}catch{const k=document.getElementById("gateway-iframe");(I=k==null?void 0:k.contentWindow)==null||I.postMessage({type:"jishu:inject-cmd",cmd:l,send:u},"*")}};y!=="chat"?(be("chat"),setTimeout(v,800)):setTimeout(v,100)},Be=l=>{if(z(!1),l==="feishu"||l==="openclaw-weixin"){Pt(l==="feishu"?"feishu":"weixin");return}const u=_r(l);if(u&&u.cmd!==void 0){ke(u.cmd,u.send!==!1);return}if(a!==null&&y==="config"){const p=es(a,l);s(p),L(JSON.stringify(p,null,2)),h(!0),x(t("config.presetAdded"),"info")}else Ze.current=l,be("config"),x(t("config.navigatingToConfig"),"info")},ys=l=>{s(l),L(JSON.stringify(l,null,2)),h(!0)},Ns=l=>{L(l),h(!0);try{s(JSON.parse(l)),g("")}catch{g(t("config.jsonError"))}},ks=l=>{var I,k,M;if(!l)return"{}";const u=JSON.parse(JSON.stringify(l)),p=(I=u==null?void 0:u.models)==null?void 0:I.providers;if(p&&typeof p=="object")for(const[A,_]of Object.entries(p))A.startsWith("js-")&&(_!=null&&_.apiKey)&&(_.apiKey="(proxy token, auto-managed)");const v=(M=(k=u==null?void 0:u["x-jishushell"])==null?void 0:k.proxy)==null?void 0:M.upstream;return v&&v.apiKey===""&&v.hasApiKey&&(v.apiKey="(saved, leave empty to keep, enter new value to update)"),JSON.stringify(u,null,2)},Rt=l=>{var I,k,M;const u=JSON.parse(l),p=(k=(I=u==null?void 0:u["x-jishushell"])==null?void 0:I.proxy)==null?void 0:k.upstream;(p==null?void 0:p.apiKey)==="(saved, leave empty to keep, enter new value to update)"&&delete p.apiKey;const v=(M=u==null?void 0:u.models)==null?void 0:M.providers;if(v&&typeof v=="object")for(const[A,_]of Object.entries(v))A.startsWith("js-")&&(_==null?void 0:_.apiKey)==="(proxy token, auto-managed)"&&delete _.apiKey;return u},Lt=async l=>{if(!(!r||!a)){g(""),ge(!0);try{const u=Rt(C?$:JSON.stringify(a)),p=await Gs(r,u);if(p!=null&&p.config&&(s(p.config),L(JSON.stringify(p.config,null,2))),h(!1),l)try{await Gt(r),x(t("config.savedAndRestarted"),"success"),n("chat"),o(`/instances/${r}`,{replace:!0})}catch(v){x(t("config.savedButRestartFailed",{error:v.message||""}),"error"),g(t("config.restartFailed",{error:v.message||""}))}else x(t("config.saved"),"success");setTimeout(Pe,1e3)}catch(u){g(u instanceof SyntaxError?t("config.jsonParseError",{error:u.message}):u.message||t("common:error.saveFailed"))}finally{ge(!1)}}},Cs=async()=>{var l;if(!(!r||E.trim()!==((l=f==null?void 0:f.name)==null?void 0:l.trim())||Ye)){tt.current=!0,ft(!0);try{await Ys(r),o("/",{replace:!0})}catch(u){x(u.message||t("common:error.deleteFailed"),"error"),ft(!1)}}},be=l=>{if(d&&y==="config"&&l!=="config"){if(!window.confirm(t("config.unsavedWarning")))return;h(!1)}n(l),o(`/instances/${r}/${l}`,{replace:!0})};if(!f)return e.jsx("div",{className:"p-6 max-w-5xl mx-auto",children:e.jsxs("div",{className:"animate-pulse space-y-4",children:[e.jsx("div",{className:"h-6 w-48 bg-[var(--card)] rounded"}),e.jsx("div",{className:"h-10 w-full bg-[var(--card)] rounded"}),e.jsx("div",{className:"h-40 bg-[var(--card)] rounded-lg"})]})});const Me=((Dt=f.service)==null?void 0:Dt.status)||"stopped",Re=Me==="running",Ee=Me==="pending",lt=Me==="failed"||Me==="dead",Le=Re&&ee,Fs=t(Le?"common:status.running":Re||Ee?"common:status.starting":Me==="failed"?"common:status.failed":Me==="dead"?"common:status.crashed":"common:status.stopped"),Ss=Le?"text-emerald-400":Re||Ee?"text-amber-400":lt?"text-red-400":"text-muted",Ms=Le?"bg-emerald-500 shadow-[0_0_6px_rgba(16,185,129,0.6)]":Re||Ee?"bg-amber-400 animate-pulse shadow-[0_0_6px_rgba(251,191,36,0.5)]":lt?"bg-red-500 shadow-[0_0_6px_rgba(239,68,68,0.6)]":"bg-[var(--muted)] opacity-40";return e.jsxs("div",{className:"p-6 max-w-5xl mx-auto",children:[me&&e.jsxs("div",{className:"mb-4 flex items-center justify-between gap-3 bg-amber-500/10 border border-amber-500/30 rounded-lg px-4 py-2.5",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[e.jsx("svg",{className:"w-4 h-4 text-amber-400 shrink-0",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,children:e.jsx("path",{d:"M12 2v6m0 0 2-2m-2 2-2-2M4.93 10.93A10 10 0 1 0 21 12"})}),e.jsxs("span",{className:"text-amber-300",children:[t("update.found"),e.jsx("span",{className:"font-mono text-amber-200 ml-1",children:me.currentVersion}),e.jsx("span",{className:"mx-1 text-amber-500",children:"→"}),e.jsx("span",{className:"font-mono text-amber-200",children:me.latestVersion})]})]}),e.jsx("button",{onClick:js,disabled:gt,className:"shrink-0 bg-amber-500 hover:bg-amber-400 disabled:opacity-50 text-black text-xs font-semibold px-3 py-1 rounded-md transition-colors",children:t(gt?"update.upgrading":"update.upgradeNow")})]}),e.jsxs("div",{className:"flex items-center justify-between mb-1",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("h1",{className:"text-lg font-semibold text-foreground",children:f.name}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:`w-2 h-2 rounded-full ${Ms}`}),e.jsx("span",{className:`text-xs font-medium ${Ss}`,children:Fs})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[y==="chat"&&e.jsxs(e.Fragment,{children:[e.jsx("a",{href:B||void 0,target:"_blank",rel:"noopener noreferrer","aria-disabled":!B,title:t("openInWindow"),className:`p-1.5 border border-[var(--border)] rounded-md transition-all duration-150 ${B?"text-muted hover:text-foreground hover:bg-[var(--card-hover)] cursor-pointer":"pointer-events-none text-muted opacity-30"}`,children:e.jsx(_s,{className:"w-4 h-4"})}),e.jsx("button",{onClick:()=>{Y(!1),ne(!1)},disabled:!B,title:t("reload"),className:"p-1.5 border border-[var(--border)] rounded-md text-muted hover:text-foreground hover:bg-[var(--card-hover)] disabled:opacity-30 transition-all duration-150",children:e.jsx(ls,{className:"w-4 h-4"})})]}),e.jsxs("button",{onClick:()=>be("config"),title:t("tab.config"),className:"p-1.5 border border-[var(--border)] rounded-md text-muted hover:text-foreground hover:bg-[var(--card-hover)] transition-all duration-150 relative",children:[e.jsx(qs,{className:"w-4 h-4"}),d&&e.jsx("span",{className:"absolute -top-0.5 -right-0.5 w-1.5 h-1.5 rounded-full bg-amber-400"})]}),e.jsxs("div",{className:"relative",children:[e.jsxs("button",{onClick:()=>z(l=>!l),title:t("quickSkill"),className:"flex items-center gap-1 px-2.5 py-1.5 border border-[#0066FF]/30 rounded-md text-xs font-medium text-[#0066FF] bg-[#0066FF]/5 hover:bg-[#0066FF]/10 transition-all duration-150",children:[e.jsx("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("polygon",{points:"13 2 3 14 12 14 11 22 21 10 12 10 13 2"})}),e.jsx("span",{className:"hidden sm:inline",children:t("quickSkill")}),e.jsx(ts,{className:`w-3 h-3 transition-transform duration-150 ${P?"rotate-180":""}`})]}),P&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"fixed inset-0 z-10",onClick:()=>z(!1)}),e.jsxs("div",{className:"absolute right-0 top-full mt-1 w-80 bg-background border border-[var(--border)] rounded-lg shadow-2xl z-20 overflow-hidden",children:[e.jsx("div",{className:"flex border-b border-[var(--border)]",children:["im","skills","mcp","slash"].map(l=>{const u={im:{emoji:"💬",label:t("quickSkill.im")},skills:{emoji:"⚡",label:t("quickSkill.skills")},mcp:{emoji:"🔌",label:t("quickSkill.mcp")},slash:{emoji:"/",label:t("quickSkill.slash")}}[l];return e.jsxs("button",{onClick:p=>{p.stopPropagation(),vs(l)},className:`flex-1 py-2 flex flex-col items-center gap-0.5 text-[10px] font-medium transition-colors border-b-2 ${se===l?"text-[#0066FF] border-[#0066FF] bg-[#0066FF]/5":"text-muted border-transparent hover:text-foreground hover:bg-[var(--card-hover)]"}`,children:[e.jsx("span",{className:"text-sm leading-none",children:u.emoji}),e.jsx("span",{children:u.label})]},l)})}),e.jsxs("div",{className:"max-h-[480px] overflow-y-auto",children:[se==="im"&&e.jsxs("div",{className:"p-3 space-y-2",children:[e.jsxs("button",{onClick:()=>Be("feishu"),className:"w-full flex items-center gap-3 px-4 py-3 rounded-lg border border-[#3370FF]/30 bg-[#3370FF]/5 hover:bg-[#3370FF]/10 transition-all duration-150",children:[e.jsx("img",{src:"https://s1.aigei.com/src/img/png/5a/5ad236651e0c4a6b940d2e1d2bf29749.png?imageMogr2/auto-orient/thumbnail/!282x282r/gravity/Center/crop/282x282/quality/85/%7CimageView2/2/w/282&e=2051020800&token=P7S2Xpzfz11vAkASLTkfHN7Fw-oOZBecqeJaxypL:bcW1ujPdX64WlxeEm9SpuJ5H2KY=",alt:t("channel.feishu"),className:"w-8 h-8 rounded-md flex-shrink-0",onError:l=>{l.target.style.display="none"}}),e.jsxs("div",{className:"text-left flex-1",children:[e.jsx("div",{className:"text-sm font-semibold text-[#3370FF]",children:t("channel.feishu")}),e.jsx("div",{className:"text-[11px] text-muted mt-0.5",children:re.feishu==="installing"?t("quickSkill.pluginInstalling"):re.feishu!=="installed"?t("quickSkill.clickToInstall"):D!=null&&D.im.feishu?`✓ ${t("quickSkill.bound")}`:t("quickSkill.scanToBind")})]}),re.feishu==="installing"&&e.jsx("div",{className:"w-4 h-4 border-2 border-[#3370FF]/30 border-t-[#3370FF] rounded-full animate-spin flex-shrink-0"}),re.feishu==="installed"&&(D==null?void 0:D.im.feishu)&&e.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded-full bg-emerald-500/15 text-emerald-400 font-medium flex-shrink-0",children:t("quickSkill.bound")})]}),re.feishu==="installed"&&(D==null?void 0:D.im.feishu)&&e.jsxs("div",{className:"mx-1 mb-1 rounded-lg border border-[#3370FF]/20 bg-[#3370FF]/5 px-3 py-2 space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-[11px] font-semibold text-[#3370FF]",children:t("pairing.title")}),e.jsxs("button",{disabled:yt,onClick:async()=>{if(r){Nt(!0),Ue(null);try{const l=await Jt(r);jt(l.output??"")}catch{Ue(t("pairing.fetchFail"))}finally{Nt(!1)}}},className:"flex items-center gap-1 text-[10px] px-2 py-0.5 rounded bg-[#3370FF]/10 text-[#3370FF] hover:bg-[#3370FF]/20 disabled:opacity-40 transition-colors",children:[yt?e.jsx("div",{className:"w-3 h-3 border border-[#3370FF]/40 border-t-[#3370FF] rounded-full animate-spin"}):e.jsx("svg",{className:"w-3 h-3",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,children:e.jsx("path",{d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),t("pairing.refresh")]})]}),Ft&&e.jsx("div",{className:"text-[10px] text-red-400",children:Ft}),et!==null&&(()=>{const l=Array.from(new Set(et.match(/[A-Z0-9]{4,16}/g)??[])).slice(0,1);return l.length===0?e.jsx("div",{className:"text-[10px] text-muted",children:et.split(`
11
- `).find(u=>u.trim())||t("pairing.noPending")}):e.jsx("div",{className:"flex flex-wrap gap-1.5",children:l.map(u=>e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"font-mono text-[11px] px-1.5 py-0.5 rounded bg-[var(--bg)] border border-[var(--border)] text-foreground",children:u}),e.jsx("button",{disabled:!!kt,onClick:async()=>{if(r){Ct(u),Ue(null);try{await Bs(r,"feishu",u),x(t("pairing.approveOk",{code:u}),"success");const p=await Jt(r);jt(p.output??"")}catch(p){Ue((p==null?void 0:p.message)||t("pairing.approveFail"))}finally{Ct(null)}}},className:"text-[10px] px-1.5 py-0.5 rounded bg-emerald-500/10 text-emerald-400 hover:bg-emerald-500/20 disabled:opacity-40 transition-colors",children:t(kt===u?"pairing.approving":"pairing.approve")})]},u))})})()]}),e.jsxs("button",{onClick:()=>Be("openclaw-weixin"),className:"w-full flex items-center gap-3 px-4 py-3 rounded-lg border border-[#07C160]/30 bg-[#07C160]/5 hover:bg-[#07C160]/10 transition-all duration-150",children:[e.jsx("img",{src:"https://sgnewres.wechat.com/t/ofs-wechat/newsroom-web/res/_next/static/media/wechat-with-color.7a890de8.svg",alt:t("channel.weixin"),className:"w-8 h-8 rounded-md flex-shrink-0",onError:l=>{l.target.style.display="none"}}),e.jsxs("div",{className:"text-left flex-1",children:[e.jsx("div",{className:"text-sm font-semibold text-[#07C160]",children:t("channel.weixin")}),e.jsx("div",{className:"text-[11px] text-muted mt-0.5",children:re["openclaw-weixin"]==="installing"?t("quickSkill.pluginInstalling"):re["openclaw-weixin"]!=="installed"?t("quickSkill.clickToInstall"):D!=null&&D.im.weixin?`✓ ${t("quickSkill.bound")}`:t("quickSkill.scanToBind")})]}),re["openclaw-weixin"]==="installing"&&e.jsx("div",{className:"w-4 h-4 border-2 border-[#07C160]/30 border-t-[#07C160] rounded-full animate-spin flex-shrink-0"}),re["openclaw-weixin"]==="installed"&&(D==null?void 0:D.im.weixin)&&e.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded-full bg-emerald-500/15 text-emerald-400 font-medium flex-shrink-0",children:t("quickSkill.bound")})]}),e.jsxs("button",{onClick:()=>{z(!1),be("config"),wt(!0)},className:"w-full flex items-center justify-center gap-1.5 px-4 py-2 rounded-lg text-[11px] text-muted hover:text-foreground hover:bg-[var(--card-hover)] border border-dashed border-[var(--border)] transition-all duration-150",children:[e.jsx("span",{children:t("quickSkill.moreImConfig")}),e.jsx("svg",{className:"w-3 h-3",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,children:e.jsx("path",{d:"M9 18l6-6-6-6"})})]})]}),se==="skills"&&e.jsxs("div",{className:"flex flex-col",children:[e.jsxs("div",{className:"px-3 py-2 border-b border-[var(--border)]/60 flex gap-1.5 flex-shrink-0",children:[e.jsx("input",{type:"text",value:Se,onChange:l=>Qe(l.target.value),onKeyDown:l=>{l.key==="Enter"&&Se.trim()&&(z(!1),ke(`安装 ${Se.trim()}`,!0),Qe(""))},placeholder:t("quickSkill.customSkillPlaceholder"),className:"flex-1 min-w-0 text-[11px] bg-[var(--bg)] border border-[var(--border)] rounded px-2 py-1 text-foreground placeholder:text-muted outline-none focus:border-[#0066FF]/60"}),e.jsx("button",{disabled:!Se.trim(),onClick:()=>{Se.trim()&&(z(!1),ke(`安装 ${Se.trim()}`,!0),Qe(""))},className:"flex-shrink-0 text-[11px] px-2 py-1 rounded bg-[#0066FF]/10 text-[#0066FF] hover:bg-[#0066FF]/20 transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:t("quickSkill.install")})]}),e.jsxs("div",{className:"flex",style:{height:"380px"},children:[e.jsxs("div",{className:"flex flex-col border-r border-[var(--border)]/60 bg-[var(--card)] flex-shrink-0",style:{width:"72px"},children:[ze.groups.map(l=>e.jsxs("button",{onMouseEnter:u=>{u.stopPropagation(),$e(l.id)},onClick:u=>{u.stopPropagation(),$e(l.id)},className:`flex flex-col items-center justify-center gap-0.5 py-3 px-1 text-center transition-colors border-l-2 flex-shrink-0 ${Ie===l.id?"border-[#0066FF] bg-[#0066FF]/5 text-foreground":"border-transparent text-muted hover:text-foreground hover:bg-[var(--card-hover)]"}`,children:[e.jsx("span",{className:"text-base leading-none",children:l.emoji}),e.jsx("span",{className:"text-[9px] font-medium leading-tight mt-0.5 whitespace-pre-wrap break-all",children:t(`data:skills.group.${l.id}`,{defaultValue:l.label})})]},l.id)),e.jsxs("button",{onMouseEnter:l=>{l.stopPropagation(),$e("installed")},onClick:l=>{l.stopPropagation(),$e("installed")},className:`flex flex-col items-center justify-center gap-0.5 py-3 px-1 text-center transition-colors border-l-2 flex-shrink-0 ${Ie==="installed"?"border-[#0066FF] bg-[#0066FF]/5 text-foreground":"border-transparent text-muted hover:text-foreground hover:bg-[var(--card-hover)]"}`,children:[e.jsx("span",{className:"text-base leading-none",children:"📦"}),e.jsx("span",{className:"text-[9px] font-medium leading-tight mt-0.5 whitespace-pre-wrap break-all",children:t("quickSkill.allInstalled")})]})]}),e.jsxs("div",{className:"flex-1 min-w-0 overflow-y-auto",children:[Ie==="installed"&&(()=>{if(D===null)return e.jsx("div",{className:"px-3 py-6 text-center text-[11px] text-muted",children:t("quickSkill.loading")});const l=D.installedSkillDirs??[],u={};return ze.groups.forEach(p=>{p.skills.forEach(v=>{var I;(I=v.checkDirs)==null||I.forEach(k=>{u[k.toLowerCase()]=p.label})})}),l.length===0?e.jsx("div",{className:"px-3 py-6 text-center text-[11px] text-muted",children:t("quickSkill.noInstalled")}):e.jsx(e.Fragment,{children:l.map(p=>{const v=u[p.toLowerCase()];return e.jsxs("div",{className:"w-full px-3 py-2 flex items-center gap-2 border-b border-[var(--border)]/30",children:[e.jsxs("button",{className:"flex-1 min-w-0 text-left",onClick:()=>{z(!1),ke(`/skill ${p} `,!1)},children:[e.jsx("div",{className:"text-xs font-semibold text-foreground font-mono truncate",children:p}),v&&e.jsx("div",{className:"text-[10px] text-muted mt-0.5",children:v})]}),e.jsx("span",{className:"flex-shrink-0 text-[10px] px-1.5 py-0.5 rounded-full font-medium bg-emerald-500/15 text-emerald-400",children:t("quickSkill.installed")}),e.jsx("button",{onClick:async()=>{if(!(!r||!window.confirm(t("delete.skillConfirm",{name:p}))))try{await Vt(r,p);const I=await Te(r);je(I)}catch(I){x(I.message||t("common:error.deleteFailed"),"error")}},className:"flex-shrink-0 text-[10px] px-1.5 py-0.5 rounded-full font-medium bg-red-500/10 text-red-400 hover:bg-red-500/20 transition-colors",children:t("common:action.delete")})]},p)})})})(),Ie!=="installed"&&(()=>{const l=ze.groups.find(v=>v.id===Ie),u=(l==null?void 0:l.skills)??[];if(u.length===0)return e.jsx("div",{className:"px-3 py-6 text-center text-[11px] text-muted",children:t("quickSkill.noSkills")});const p=((D==null?void 0:D.installedSkillDirs)??[]).map(v=>v.toLowerCase());return e.jsx(e.Fragment,{children:u.map(v=>{var A;if(v.type==="hub")return e.jsxs("div",{className:"w-full px-3 py-2 flex items-center gap-2 border-b border-[var(--border)]/30",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-xs font-semibold text-foreground break-words",children:t(`data:skills.${v.id}.label`,{defaultValue:v.label})}),e.jsx("div",{className:"text-[10px] text-muted leading-tight mt-0.5 break-words",children:t(`data:skills.${v.id}.desc`,{defaultValue:v.desc})}),e.jsx("div",{className:"text-[9px] text-muted/60 leading-tight mt-0.5 break-all",children:v.url})]}),e.jsx("a",{href:v.url,target:"_blank",rel:"noopener noreferrer",onClick:_=>_.stopPropagation(),title:"在新标签页打开",className:"flex-shrink-0 text-[11px] px-1.5 py-0.5 rounded-full font-medium bg-[var(--border)] text-muted hover:bg-[#0066FF]/15 hover:text-[#0066FF] transition-colors no-underline",children:"🔗"})]},v.id);const I=D!==null&&v.checkDirs.some(_=>p.includes(_.toLowerCase())),k=ws[v.id]??!1,M=((A=D==null?void 0:D.installedSkillDirs)==null?void 0:A.find(_=>v.checkDirs.some(Z=>Z.toLowerCase()===_.toLowerCase())))??v.id;return e.jsxs("button",{disabled:k,onClick:()=>{if(z(!1),I)ke(`/skill ${M} `,!1);else{Ve(de=>({...de,[v.id]:!0})),ke(v.installMsg,v.autoInstall!==!1);let _=0;const Z=setInterval(async()=>{_+=5e3;try{const de=await Te(r);je(de);const ot=((de==null?void 0:de.installedSkillDirs)??[]).map(ve=>ve.toLowerCase());v.checkDirs.some(ve=>ot.includes(ve.toLowerCase()))&&(clearInterval(Z),Ve(ve=>({...ve,[v.id]:!1})))}catch{}_>=6e4&&(clearInterval(Z),Ve(de=>({...de,[v.id]:!1})))},5e3)}},className:"w-full text-left px-3 py-2 hover:bg-[var(--card-hover)] transition-colors flex items-center gap-2 disabled:opacity-60 border-b border-[var(--border)]/30",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-xs font-semibold text-foreground break-words",children:t(`data:skills.${v.id}.label`,{defaultValue:v.label})}),e.jsx("div",{className:"text-[10px] text-muted leading-tight mt-0.5 break-words",children:t(`data:skills.${v.id}.desc`,{defaultValue:v.desc})})]}),e.jsx("span",{className:`flex-shrink-0 text-[10px] px-1.5 py-0.5 rounded-full font-medium ${k?"bg-amber-500/15 text-amber-400":D===null?"bg-[var(--border)] text-muted":I?"bg-emerald-500/15 text-emerald-400":"bg-[#0066FF]/10 text-[#0066FF]"}`,children:k?t("quickSkill.installing"):D===null?"…":t(I?"quickSkill.installed":"quickSkill.install")}),I&&!k&&e.jsx("button",{onClick:async _=>{if(_.stopPropagation(),!(!r||!window.confirm(t("delete.skillConfirm",{name:M}))))try{await Vt(r,M);const Z=await Te(r);je(Z)}catch(Z){x(Z.message||t("common:error.deleteFailed"),"error")}},className:"flex-shrink-0 text-[10px] px-1.5 py-0.5 rounded-full font-medium bg-red-500/10 text-red-400 hover:bg-red-500/20 transition-colors",children:t("common:action.delete")})]},v.id)})})})()]})]})]}),se==="mcp"&&e.jsxs("div",{className:"py-1",children:[(()=>{const l=!!(D!=null&&D.mcporterInstalled||Ne.installed),u=D===null&&Ne.loading;return e.jsxs("button",{onClick:()=>{l||(z(!1),ke("安装 https://clawhub.ai/steipete/mcporter",!0))},className:"w-full text-left px-3 py-2.5 hover:bg-[var(--card-hover)] transition-colors flex items-center gap-2",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-xs font-semibold text-foreground",children:"MCPorter"}),e.jsx("div",{className:"text-[11px] text-muted leading-tight mt-0.5",children:t("quickSkill.mcporterDesc")})]}),e.jsx("span",{className:`flex-shrink-0 text-[10px] px-1.5 py-0.5 rounded-full font-medium ${u?"bg-[var(--border)] text-muted":l?"bg-emerald-500/15 text-emerald-400":"bg-[#0066FF]/10 text-[#0066FF]"}`,children:u?"…":t(l?"quickSkill.installed":"quickSkill.install")})]})})(),e.jsxs("div",{className:"px-3 py-2 border-t border-[var(--border)]/40",children:[e.jsx("div",{className:"text-[10px] text-muted mb-1.5",children:t("quickSkill.mcpJsonLabel")}),e.jsx("textarea",{rows:3,value:Ge,onChange:l=>{ht(l.target.value),ye("")},placeholder:`{
12
- "serverName": { "command": "npx", "args": [...] }
13
- }`,className:"w-full text-[11px] font-mono bg-[var(--bg)] border border-[var(--border)] rounded px-2 py-1.5 text-foreground placeholder:text-muted/50 outline-none focus:border-[#0066FF]/60 resize-none"}),xt&&e.jsx("div",{className:"text-[10px] text-red-400 mt-1",children:xt}),e.jsx("button",{disabled:!Ge.trim()||!r,onClick:async()=>{let l;try{const u=JSON.parse(Ge.trim());if(typeof u!="object"||Array.isArray(u)||u===null)throw new Error("not-object");if(u.mcpServers&&typeof u.mcpServers=="object"&&!Array.isArray(u.mcpServers)?l=u.mcpServers:u.servers&&typeof u.servers=="object"&&!Array.isArray(u.servers)?l=u.servers:l=u,Object.keys(l).length===0)throw new Error("empty");for(const[p,v]of Object.entries(l)){if(typeof v!="object"||Array.isArray(v)||v===null)throw new Error(t("quickSkill.mcpJsonValueNotObject",{name:p}));const I=v;if(!I.command&&!I.baseUrl&&!I.url)throw new Error(t("quickSkill.mcpJsonMissingField",{name:p}))}}catch(u){const p=u==null?void 0:u.message;p==="not-object"?ye(t("quickSkill.mcpJsonNotObject")):p==="empty"?ye(t("quickSkill.mcpJsonEmpty")):p!=null&&p.startsWith('"')?ye(p):ye(t("quickSkill.mcpJsonParseFailed",{error:p||""}));return}try{const u=await Qt(r,l);ht(""),ye(""),x(t("quickSkill.mcpWritten"),"success"),je(p=>p&&{...p,mcporterServers:u.mcpServers}),ie(p=>({...p,loading:!0})),ct(r).then(p=>ie({servers:p.servers,installed:p.installed,loading:!1})).catch(()=>ie(p=>({...p,loading:!1})))}catch(u){ye(u.message||t("quickSkill.mcpWriteFailed"))}},className:"mt-1.5 w-full text-[11px] px-2 py-1 rounded bg-[#0066FF]/10 text-[#0066FF] hover:bg-[#0066FF]/20 transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:t("quickSkill.addToConfig")})]}),(((Ot=We.find(l=>l.id==="mcp"))==null?void 0:Ot.items)??[]).map(l=>{const u=Object.keys((D==null?void 0:D.mcporterServers)??{}),p=Ne.servers.map(k=>k.name),v=l.mcpJson?Object.keys(l.mcpJson):[],I=v.length>0&&v.some(k=>u.includes(k)||p.includes(k));return e.jsxs("button",{onClick:async()=>{if(l.mcpJson&&r)try{const k=await Qt(r,l.mcpJson);x(t("quickSkill.mcpAdded",{label:l.label}),"success"),je(M=>M&&{...M,mcporterServers:k.mcpServers}),ie(M=>({...M,loading:!0})),ct(r).then(M=>ie({servers:M.servers,installed:M.installed,loading:!1})).catch(()=>ie(M=>({...M,loading:!1})))}catch(k){x(k.message||t("quickSkill.mcpAddFailed"),"error")}else Be(l.id)},className:"w-full text-left px-3 py-2.5 hover:bg-[var(--card-hover)] transition-colors border-t border-[var(--border)]/40 flex items-center gap-2",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-xs font-semibold text-foreground",children:t(`data:mcp.${l.id}.label`,{defaultValue:l.label})}),e.jsx("div",{className:"text-[11px] text-muted leading-tight mt-0.5",children:t(`data:mcp.${l.id}.desc`,{defaultValue:l.desc})})]}),l.mcpJson&&e.jsx("span",{className:`flex-shrink-0 text-[10px] px-1.5 py-0.5 rounded-full font-medium ${I?"bg-emerald-500/15 text-emerald-400":"bg-[#0066FF]/10 text-[#0066FF]"}`,children:t(I?"quickSkill.configured":"quickSkill.oneClickConfig")})]},l.id)}),(()=>{var I;const l=(D==null?void 0:D.mcporterServers)??{},u=new Set((((I=We.find(k=>k.id==="mcp"))==null?void 0:I.items)??[]).flatMap(k=>k.mcpJson?Object.keys(k.mcpJson):[])),p=Object.keys(l).filter(k=>!u.has(k));if(p.length===0)return null;const v={};for(const k of Ne.servers)v[k.name]=k;return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"px-3 pt-2 pb-0.5 text-[9px] font-semibold text-muted/60 uppercase tracking-widest border-t border-[var(--border)]/40 mt-1",children:t("quickSkill.mcporterConfigured")}),p.map(k=>{var ve;const M=l[k],A=v[k],_=(A==null?void 0:A.transport)??(M!=null&&M.baseUrl?`HTTP ${M.baseUrl}`:M!=null&&M.command?`${M.command} ${(M.args??[]).join(" ")}`.trim():""),Z=(A==null?void 0:A.status)==="ok",de=A?Z?"bg-emerald-500/15 text-emerald-400":"bg-red-500/15 text-red-400":(Ne.loading,"bg-[var(--border)] text-muted"),ot=Ne.loading&&!A?t("quickSkill.detecting"):A?Z?(ve=A.tools)!=null&&ve.length?t("quickSkill.statusNormalWithTools",{count:A.tools.length}):t("quickSkill.statusNormal"):A.status:t("quickSkill.configured");return e.jsxs("div",{className:"w-full px-3 py-2 flex items-center gap-2",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-xs font-semibold text-foreground font-mono",children:k}),_&&e.jsx("div",{className:"text-[11px] text-muted leading-tight mt-0.5 truncate",children:_})]}),e.jsxs("span",{className:`flex-shrink-0 text-[10px] px-1.5 py-0.5 rounded-full font-medium ${de} flex items-center gap-1`,children:[Ne.loading&&!A&&e.jsx("span",{className:"w-2 h-2 border border-muted/40 border-t-muted rounded-full animate-spin"}),ot]}),e.jsx("button",{onClick:async()=>{if(!(!r||!window.confirm(t("delete.mcpConfirm",{name:k}))))try{await Hs(r,k);const it=await Te(r);je(it),ie(Bt=>({...Bt,servers:Bt.servers.filter(Es=>Es.name!==k)}))}catch(it){x(it.message||t("common:error.deleteFailed"),"error")}},className:"flex-shrink-0 text-[10px] px-1.5 py-0.5 rounded-full font-medium bg-red-500/10 text-red-400 hover:bg-red-500/20 transition-colors",children:t("common:action.delete")})]},k)})]})})()]}),se==="slash"&&e.jsx("div",{className:"py-1",children:((($t=We.find(l=>l.id==="slash"))==null?void 0:$t.groups)??[]).map((l,u)=>e.jsxs("div",{children:[u>0&&e.jsx("div",{className:"border-t border-[var(--border)]/40 mx-3 my-0.5"}),e.jsx("div",{className:"px-3 pt-1.5 pb-0.5 text-[9px] font-semibold text-muted/60 uppercase tracking-widest",children:t(`data:slash.group.${l.label}`,{defaultValue:l.label})}),l.items.map(p=>e.jsxs("button",{onClick:()=>Be(p.id),className:"w-full text-left px-3 py-1 hover:bg-[var(--card-hover)] transition-colors",children:[e.jsx("div",{className:"text-xs font-medium text-foreground font-mono",children:p.label}),e.jsx("div",{className:"text-[11px] text-muted leading-tight",children:t(`data:slash.${p.id}.desc`,{defaultValue:p.desc})})]},p.id))]},l.label))})]})]})]})]}),Re||Ee?e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:()=>qe("restart"),disabled:!!G||Ee,className:"px-3 py-1.5 bg-[#0066FF] text-white rounded-md text-xs font-medium hover:bg-[#0066FF]/90 disabled:opacity-40 transition-all duration-200",children:t(G==="restart"?"action.restarting":"common:action.restart")}),e.jsx("button",{onClick:()=>qe("stop"),disabled:!!G,className:"px-3 py-1.5 bg-red-600 text-white rounded-md text-xs font-medium hover:bg-red-700 disabled:opacity-40 transition-all duration-200",children:t(G==="stop"?"action.stopping":"common:action.stop")})]}):e.jsx("button",{onClick:()=>qe("start"),disabled:!!G,className:"px-3 py-1.5 bg-[#0066FF] text-white rounded-md text-xs font-medium hover:bg-[#0066FF]/90 disabled:opacity-40 transition-all duration-200",children:t(G==="start"?"action.starting":"common:action.start")}),e.jsxs("div",{className:"relative",children:[e.jsx("button",{onClick:()=>te(!H),className:"p-1.5 border border-[var(--border)] rounded-md text-muted hover:text-foreground hover:bg-[var(--card-hover)] transition-all duration-150",children:e.jsx(zs,{className:"w-4 h-4"})}),H&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"fixed inset-0 z-10",onClick:()=>te(!1)}),e.jsxs("div",{className:"absolute right-0 top-full mt-1 w-40 bg-background border border-[var(--border)] rounded-lg shadow-2xl py-1 z-20",children:[e.jsx("button",{onClick:()=>{te(!1),be("logs")},className:"w-full text-left px-3 py-2 text-sm text-foreground hover:bg-[var(--card-hover)] transition-colors",children:t("tab.logs")}),e.jsx("button",{onClick:()=>{te(!1),be("usage")},className:"w-full text-left px-3 py-2 text-sm text-foreground hover:bg-[var(--card-hover)] transition-colors",children:t("tab.usage")}),e.jsx("div",{className:"border-t border-[var(--border)] my-1"}),e.jsx("button",{onClick:()=>{te(!1),b(!0)},className:"w-full text-left px-3 py-2 text-sm text-red-400 hover:bg-red-500/10 transition-colors",children:t("delete.title")})]})]})]})]})]}),e.jsxs("div",{className:"flex items-center gap-4 text-xs text-muted mb-3",children:[e.jsx("button",{onClick:()=>o("/"),className:"hover:text-foreground transition-colors",children:t("backToOverview")}),e.jsx("span",{className:"opacity-40",children:"·"}),e.jsxs("span",{children:["📊 ",((Ut=f.service)==null?void 0:Ut.memory_mb)!=null?`${f.service.memory_mb} MB`:"-"]}),e.jsx("span",{className:"opacity-40",children:"·"}),e.jsxs("span",{children:["⏱ ",Ur((_t=f.service)==null?void 0:_t.uptime,t)]}),e.jsx("span",{className:"opacity-40",children:"·"}),e.jsxs("span",{children:["🔌 ",t("port",{port:qr(f)})]})]}),lt&&e.jsxs("div",{className:"bg-red-500/10 border border-red-500/20 text-red-400 text-sm rounded-lg px-4 py-3 flex items-center justify-between mb-3",children:[e.jsx("span",{children:t("failedHint")}),e.jsx("button",{onClick:()=>be("logs"),className:"text-red-400 underline text-sm font-medium",children:t("viewLogs")})]}),y!=="chat"&&e.jsx("button",{onClick:()=>be("chat"),className:"flex items-center gap-1 text-xs text-[#0066FF] hover:text-[#0066FF]/80 mb-3 transition-colors",children:t("backToChat")}),y==="chat"&&e.jsx(Dr,{gatewayLaunchUrl:B,gatewayReady:ee,isRunning:Le,isPending:Ee,iframeLoaded:X,actionLoading:G,onAction:qe,onReload:()=>{Y(!1),ne(!1)},onIframeLoad:()=>ne(!0)}),y==="config"&&a&&e.jsxs("div",{className:"space-y-4",children:[d&&e.jsxs("div",{className:"bg-amber-500/10 border border-amber-500/20 text-amber-400 text-sm rounded-lg px-4 py-2.5 flex items-center justify-between",children:[e.jsx("span",{children:t("config.modified")}),e.jsx("button",{onClick:()=>{s(null),Wt(r).then(l=>{s(l),L(JSON.stringify(l,null,2)),h(!1)})},className:"text-xs text-amber-400 hover:underline",children:t("config.discard")})]}),N&&e.jsx("div",{className:"bg-red-500/10 border border-red-500/20 text-red-400 text-sm rounded-lg px-4 py-2.5",children:N}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("button",{onClick:()=>j(!1),className:`px-3 py-1.5 text-xs rounded-md transition-colors duration-150 ${C?"text-muted hover:bg-[var(--card-hover)]":"bg-[#0066FF] text-white"}`,children:t("config.form")}),e.jsx("button",{onClick:()=>{L(ks(a)),j(!0)},className:`px-3 py-1.5 text-xs rounded-md transition-colors duration-150 ${C?"bg-[#0066FF] text-white":"text-muted hover:bg-[var(--card-hover)]"}`,children:t("config.json")})]}),C?e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"bg-[#0066FF]/10 border border-[#0066FF]/20 rounded-lg px-3 py-2 text-xs text-[#0066FF]/80 space-y-1",children:[e.jsx("div",{className:"font-medium text-[#0066FF]/90",children:t("config.jsonHelp")}),e.jsxs("ul",{className:"list-disc list-inside space-y-0.5",children:[e.jsx("li",{dangerouslySetInnerHTML:{__html:t("config.jsonHelp1")}}),e.jsx("li",{dangerouslySetInnerHTML:{__html:t("config.jsonHelp2")}}),e.jsx("li",{dangerouslySetInnerHTML:{__html:t("config.jsonHelp3")}})]})]}),e.jsxs("div",{className:"bg-[var(--card)] border border-[var(--border)] rounded-xl overflow-hidden",children:[e.jsx("div",{className:"border-b border-[var(--border)] px-4 py-2 flex items-center justify-between",children:e.jsx("span",{className:"text-xs font-medium text-muted",children:"openclaw.json"})}),e.jsx("textarea",{value:$,onChange:l=>Ns(l.target.value),className:"w-full font-mono text-[13px] p-4 min-h-[400px] lg:min-h-[500px] focus:outline-none resize-y text-foreground bg-transparent",spellCheck:!1})]})]}):e.jsx(xr,{config:a,onChange:ys,instanceId:r,isRunning:Le,pluginStatuses:re,onInstallPlugin:It}),e.jsxs("div",{className:"flex gap-2 sticky bottom-0 backdrop-blur-sm py-3 -mx-6 px-6 border-t border-[var(--border)] mt-4",style:{background:"color-mix(in srgb, var(--background) 85%, transparent)"},children:[e.jsx("button",{onClick:()=>Lt(!1),disabled:!d||oe,className:"px-4 py-2 border border-[var(--border)] text-muted rounded-md text-sm font-medium hover:bg-[var(--card-hover)] hover:text-foreground disabled:opacity-40 transition-all duration-200",children:t(oe?"config.saving":"config.save")}),e.jsx("button",{onClick:()=>Lt(!0),disabled:oe,className:"px-4 py-2 bg-[#0066FF] text-white rounded-md text-sm font-medium hover:bg-[#0066FF]/90 disabled:opacity-40 transition-all duration-200",children:t(oe?"config.processing":"config.saveAndRestart")})]})]}),y==="logs"&&e.jsx(Or,{logs:S,logSearch:q,logType:O,logsEndRef:Xe,onSearchChange:J,onLogTypeChange:T,onRefresh:at,onCopy:()=>{const l=q?S.filter(u=>u.toLowerCase().includes(q.toLowerCase())):S;navigator.clipboard.writeText(l.join(`
14
- `)).then(()=>x(t("logs.copied"),"success")).catch(()=>x(t("logs.copyFailed"),"error"))}}),y==="usage"&&e.jsx($r,{usage:xe,onRefresh:()=>Kt(r).then(fe).catch(()=>{})}),V&&e.jsx("div",{className:"fixed inset-0 bg-black/60 backdrop-blur-sm flex items-center justify-center z-50 p-4",onClick:()=>{ce.current=!0,ue.current=!1,ae(null)},children:e.jsxs("div",{className:"bg-background border border-[var(--border)] rounded-xl p-6 w-full max-w-xs shadow-2xl",onClick:l=>l.stopPropagation(),children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsx("h3",{className:"text-base font-semibold text-foreground",children:t(V.type==="feishu"?"qr.feishuTitle":"qr.weixinTitle")}),e.jsx("button",{onClick:()=>{ce.current=!0,ue.current=!1,ae(null)},className:"text-muted hover:text-foreground transition-colors text-lg leading-none",children:"✕"})]}),e.jsx("div",{className:"flex flex-col items-center gap-3",children:V.status==="confirmed"?e.jsxs("div",{className:"bg-emerald-500/10 border border-emerald-500/20 rounded-md px-4 py-5 text-center w-full",children:[e.jsx("div",{className:"text-3xl mb-2",children:"✓"}),e.jsx("div",{className:"text-emerald-400 font-medium text-sm",children:V.message}),e.jsx("p",{className:"text-xs text-muted mt-1",children:t("qr.credSaved")})]}):V.status==="loading"?e.jsx("div",{className:"w-48 h-48 flex items-center justify-center",children:e.jsx("div",{className:`w-8 h-8 border-2 rounded-full animate-spin ${V.type==="feishu"?"border-[#3370FF]/30 border-t-[#3370FF]":"border-[#07C160]/30 border-t-[#07C160]"}`})}):V.status==="error"?e.jsxs("div",{className:"bg-red-500/10 border border-red-500/20 rounded-md px-4 py-4 text-center w-full",children:[e.jsx("div",{className:"text-red-400 text-sm",children:V.message}),e.jsx("button",{onClick:l=>{l.stopPropagation(),Pt(V.type)},className:`mt-3 px-4 py-1.5 text-white rounded-md text-xs font-medium transition-colors ${V.type==="feishu"?"bg-[#3370FF] hover:bg-[#3370FF]/90":"bg-[#07C160] hover:bg-[#07C160]/90"}`,children:t("qr.retry")})]}):e.jsxs(e.Fragment,{children:[V.qrUrl?e.jsx(Je,{value:V.qrUrl,size:192,className:"rounded-lg"}):e.jsx("div",{className:"w-48 h-48 flex items-center justify-center",children:e.jsx("div",{className:`w-8 h-8 border-2 rounded-full animate-spin ${V.type==="feishu"?"border-[#3370FF]/30 border-t-[#3370FF]":"border-[#07C160]/30 border-t-[#07C160]"}`})}),e.jsx("div",{className:"flex items-center gap-2 text-sm",children:V.status==="scaned"?e.jsxs("span",{className:`font-medium ${V.type==="weixin"?"text-[#07C160]":"text-[#3370FF]"}`,children:["👀 ",V.message]}):e.jsx("span",{className:"text-muted",children:V.message})})]})}),V.status==="confirmed"&&e.jsx("button",{onClick:()=>{ce.current=!0,ue.current=!1,ae(null)},className:"mt-4 w-full py-2 bg-[#0066FF] text-white rounded-md text-sm font-medium hover:bg-[#0066FF]/90 transition-colors",children:t("common:action.close")})]})}),c&&e.jsx("div",{className:"fixed inset-0 bg-black/60 backdrop-blur-sm flex items-center justify-center z-50 p-4",onClick:()=>b(!1),children:e.jsxs("div",{className:"bg-background border border-[var(--border)] rounded-xl p-6 w-full max-w-sm shadow-2xl",onClick:l=>l.stopPropagation(),children:[e.jsx("h3",{className:"text-base font-semibold text-foreground mb-2",children:t("delete.title")}),e.jsxs("p",{className:"text-sm text-muted mb-4",children:[t("delete.warningBefore"),e.jsx("strong",{className:"text-foreground",children:f.name}),t("delete.warningAfter")]}),e.jsx("p",{className:"text-sm text-muted mb-3",children:t("delete.confirmHint")}),e.jsx("input",{type:"text",value:E,onChange:l=>U(l.target.value),className:"w-full bg-[var(--input-bg)] border border-[var(--border)] rounded-md px-3 py-2 text-sm text-foreground mb-4 focus:outline-none focus:ring-1 focus:ring-red-500/60 focus:border-red-500/60 transition-colors",placeholder:f.name}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("button",{onClick:()=>{b(!1),U("")},className:"flex-1 py-2 border border-[var(--border)] text-muted rounded-md text-sm font-medium hover:bg-[var(--card-hover)] hover:text-foreground transition-all duration-150",children:t("common:action.cancel")}),e.jsx("button",{onClick:Cs,disabled:E.trim()!==((qt=f.name)==null?void 0:qt.trim()),className:"flex-1 py-2 bg-red-600 text-white rounded-md text-sm font-medium hover:bg-red-700 disabled:opacity-40 transition-colors",children:t("delete.confirm")})]})]})})]})}export{Qr as default};
@@ -1 +0,0 @@
1
- import{o as S,j as e,a2 as I}from"./index-DkDnIohs.js";import{r as a,u as C}from"./vendor-react-DONn7uBV.js";import{u as E}from"./vendor-i18n-Bvxxh8Di.js";function _(t){return t.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"").slice(0,63)}const o="w-full bg-[var(--input-bg)] border border-[var(--border)] rounded-md px-3 py-2 text-sm text-foreground placeholder-[var(--muted)] focus:outline-none focus:ring-1 focus:ring-[#0066FF]/60 focus:border-[#0066FF]/60 transition-colors duration-200";function L(){const{t}=E("newInstance"),[r,h]=a.useState(""),[n,d]=a.useState(""),[g,f]=a.useState(!1),[i,v]=a.useState(""),[c,j]=a.useState(""),[m,N]=a.useState([]),[u,x]=a.useState(""),[b,p]=a.useState(!1),w=C();a.useEffect(()=>{S().then(N).catch(()=>{})},[]);const y=s=>{h(s),g||d(_(s))},F=async s=>{if(s.preventDefault(),!(!n||!r)){x(""),p(!0);try{const l=await I({id:n,name:r,description:i,clone_from:c||void 0});w(l!=null&&l.autoStarted?`/instances/${n}`:`/instances/${n}/config`)}catch(l){x(l.message||t("failed"))}finally{p(!1)}}};return e.jsxs("div",{className:"p-6 max-w-lg mx-auto",children:[e.jsxs("div",{className:"mb-6",children:[e.jsx("h1",{className:"text-lg font-semibold text-foreground",children:t("title")}),e.jsx("p",{className:"text-sm text-muted mt-0.5",children:t("subtitle")})]}),e.jsxs("form",{onSubmit:F,className:"space-y-4",children:[u&&e.jsx("div",{className:"bg-red-500/10 border border-red-500/20 text-red-400 text-sm rounded-lg px-3 py-2.5",children:u}),e.jsxs("div",{className:"bg-card border border-[var(--border)] rounded-xl p-5 space-y-4",children:[e.jsx("div",{className:"text-xs text-muted bg-card border border-[var(--border)] rounded-md p-3",children:t("info")}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-muted mb-1.5",children:t("name.label")}),e.jsx("input",{type:"text",value:r,onChange:s=>y(s.target.value),placeholder:t("name.placeholder"),className:o,autoFocus:!0})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-muted mb-1.5",children:t("id.label")}),e.jsx("input",{type:"text",value:n,onChange:s=>{d(s.target.value),f(!0)},placeholder:t("id.placeholder"),className:`${o} font-mono text-[13px]`}),e.jsx("p",{className:"text-xs text-muted mt-1",children:r&&!n?e.jsx("span",{className:"text-amber-400",children:t("id.invalid")}):t("id.hint")})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-muted mb-1.5",children:t("description.label")}),e.jsx("input",{type:"text",value:i,onChange:s=>v(s.target.value),placeholder:t("description.placeholder"),className:o})]}),m.length>0&&e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-muted mb-1.5",children:t("clone.label")}),e.jsxs("select",{value:c,onChange:s=>j(s.target.value),className:`${o} appearance-none`,children:[e.jsx("option",{value:"",className:"bg-background text-foreground",children:t("clone.none")}),m.map(s=>e.jsx("option",{value:s.id,className:"bg-background text-foreground",children:s.name},s.id))]})]})]}),e.jsx("button",{type:"submit",disabled:b||!n||!r,className:"w-full bg-[#0066FF] text-white rounded-md py-2.5 text-sm font-medium hover:bg-[#0066FF]/90 disabled:opacity-40 disabled:cursor-not-allowed transition-all duration-200 shadow-[0_0_20px_rgba(0,102,255,0.3)] hover:shadow-[0_0_28px_rgba(0,102,255,0.45)]",children:b?e.jsxs("span",{className:"inline-flex items-center gap-2",children:[e.jsx("span",{className:"w-3.5 h-3.5 border-2 border-white/30 border-t-white rounded-full animate-spin"}),t("loading")]}):t("submit")})]})]})}export{L as default};
@@ -1 +0,0 @@
1
- import{a3 as L,a4 as R,j as e,I as K,a as E,e as G,a5 as H,s as O}from"./index-DkDnIohs.js";import{r as d}from"./vendor-react-DONn7uBV.js";import{P as p}from"./providers-lBSOjUWy.js";import{u as U}from"./vendor-i18n-Bvxxh8Di.js";function z(){const{t:s}=U(["settings","setup","instance"]),{system:a,showToast:m}=L(),[x,y]=d.useState(""),[h,N]=d.useState(""),[u,M]=d.useState(!1),[o,w]=d.useState(""),[b,v]=d.useState(""),[f,_]=d.useState(!1),[S,g]=d.useState(""),[P,F]=d.useState(!1),[A,k]=d.useState(!1),[$,j]=d.useState(!1);d.useEffect(()=>{R().then(t=>{t.configured&&t.providerId&&(w(t.providerId),g(t.selectedModelId||""),j(!!t.hasApiKey)),k(!0)}).catch(()=>k(!0))},[]);const D=async()=>{var l;if(!o)return;const t=p.find(n=>n.id===o);if(t){F(!0);try{await G({providerId:t.id,baseUrl:t.baseUrl,api:t.api,authHeader:t.authHeader||!1,models:t.models,selectedModelId:S||((l=t.models[0])==null?void 0:l.id)||"",apiKey:b||""}),m(s("setup:provider.saved"),"success"),v(""),j(!0)}catch(n){m(n.message||s("setup:provider.saveFailed"),"error")}finally{F(!1)}}},T=async t=>{t.preventDefault();try{const l=await H(x,h);l.token&&O(l.token),m(s("password.updated"),"success"),y(""),N("")}catch(l){m(l.message||s("password.failed"),"error")}},c="w-full bg-[var(--input-bg)] border border-[var(--border)] rounded-md px-3 py-2 text-sm text-foreground placeholder-[var(--muted)] focus:outline-none focus:ring-1 focus:ring-[#0066FF]/60 focus:border-[#0066FF]/60 transition-colors duration-200";return e.jsxs("div",{className:"p-6 max-w-4xl mx-auto",children:[e.jsxs("div",{className:"mb-5",children:[e.jsx("h1",{className:"text-lg font-semibold text-foreground",children:s("title")}),e.jsx("p",{className:"text-sm text-muted mt-0.5",children:s("subtitle")})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"bg-[var(--card)] border border-[var(--border)] rounded-xl p-4",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-sm font-medium text-foreground",children:s("proxy.title")}),e.jsx("p",{className:"text-sm text-muted mt-1",children:s("proxy.desc")})]}),e.jsx("div",{className:"mt-3 bg-red-500/10 border border-red-500/20 text-red-400 text-sm rounded-lg px-4 py-3",children:s("proxy.status")})]}),A&&(()=>{var I;const t=p.find(r=>r.id===o),l=[...new Set(p.map(r=>r.group))],n=(t==null?void 0:t.models)||[],C=["ollama","vllm","sglang"].includes(o),B=o&&(C||b.trim()||$);return e.jsxs("div",{className:"bg-[var(--card)] border border-[var(--border)] rounded-xl p-4",children:[e.jsx("h2",{className:"text-sm font-medium text-foreground mb-1",children:s("setup:provider.title")}),e.jsx("p",{className:"text-sm text-muted mb-3",children:s("setup:provider.desc")}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-muted mb-1.5",children:s("setup:provider.label")}),e.jsxs("select",{value:o,onChange:r=>{w(r.target.value),g(""),v(""),j(!1)},className:c,children:[e.jsx("option",{value:"",children:s("setup:provider.placeholder")}),l.map(r=>e.jsx("optgroup",{label:s(`instance:configForm.providerGroup.${r}`,{defaultValue:r}),children:p.filter(i=>i.group===r).map(i=>e.jsx("option",{value:i.id,children:s(`instance:configForm.providerLabel.${i.id}`,{defaultValue:i.label})},i.id))},r))]})]}),o&&!C&&e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-muted mb-1.5",children:s("setup:provider.apiKey")}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{type:f?"text":"password",value:b,onChange:r=>v(r.target.value),placeholder:s($?"setup:provider.apiKeyConfigured":"setup:provider.apiKeyPlaceholder"),className:`${c} pr-9 font-mono`}),e.jsx("button",{type:"button",onClick:()=>_(!f),className:"absolute right-2.5 top-1/2 -translate-y-1/2 text-muted hover:text-foreground transition-colors",children:f?e.jsx(K,{className:"w-3.5 h-3.5"}):e.jsx(E,{className:"w-3.5 h-3.5"})})]})]}),t&&n.length>0&&e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-muted mb-1.5",children:s("setup:provider.defaultModel")}),e.jsx("select",{value:S||((I=n[0])==null?void 0:I.id)||"",onChange:r=>g(r.target.value),className:c,children:n.map(r=>e.jsxs("option",{value:r.id,children:[r.name," (",Math.round(r.contextWindow/1e3),"K)"]},r.id))})]}),e.jsx("button",{onClick:D,disabled:!B||P,className:"px-4 py-2 bg-[#0066FF] text-white rounded-md text-sm font-medium hover:bg-[#0066FF]/90 disabled:opacity-40 transition-all duration-200",children:s(P?"setup:provider.saving":"setup:provider.save")})]})]})})(),e.jsxs("div",{className:"bg-[var(--card)] border border-[var(--border)] rounded-xl p-4",children:[e.jsx("h2",{className:"text-sm font-medium text-foreground mb-3",children:s("password.title")}),e.jsxs("form",{onSubmit:T,className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm text-muted mb-1.5",children:s("password.current")}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{type:u?"text":"password",value:x,onChange:t=>y(t.target.value),placeholder:s("password.currentPlaceholder"),className:`${c} pr-9`}),e.jsx("button",{type:"button",onClick:()=>M(!u),className:"absolute right-2.5 top-1/2 -translate-y-1/2 text-muted hover:text-foreground transition-colors",children:u?e.jsx(K,{className:"w-3.5 h-3.5"}):e.jsx(E,{className:"w-3.5 h-3.5"})})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm text-muted mb-1.5",children:s("password.new")}),e.jsx("input",{type:u?"text":"password",value:h,onChange:t=>N(t.target.value),placeholder:s("password.newPlaceholder"),className:c})]}),e.jsx("button",{type:"submit",disabled:!x||h.length<8,className:"px-4 py-2 bg-[#0066FF] text-white rounded-md text-sm font-medium hover:bg-[#0066FF]/90 disabled:opacity-40 transition-all duration-200",children:s("password.submit")})]})]}),a&&e.jsxs("div",{className:"bg-[var(--card)] border border-[var(--border)] rounded-xl p-4",children:[e.jsx("h2",{className:"text-sm font-medium text-foreground mb-3",children:s("system.title")}),e.jsxs("div",{className:"space-y-3",children:[[{label:s("system.cpuUsage"),value:`${a.cpu_percent}%`,percent:a.cpu_percent,warn:a.cpu_percent>90,color:"bg-[#0066FF]"},{label:s("system.memory"),value:`${a.memory.used_mb}MB / ${a.memory.total_mb}MB (${a.memory.percent}%)`,percent:a.memory.percent,warn:!1,color:"bg-[#00D4AA]"},{label:s("system.disk"),value:`${a.disk.used_gb}GB / ${a.disk.total_gb}GB (${a.disk.percent}%)`,percent:a.disk.percent,warn:a.disk.percent>90,color:"bg-[#0066FF]"}].map(t=>e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between text-sm mb-1.5",children:[e.jsx("span",{className:"text-muted",children:t.label}),e.jsx("span",{className:`font-medium font-mono text-[13px] ${t.warn?"text-red-400":"text-foreground"}`,children:t.value})]}),e.jsx("div",{className:"w-full bg-[var(--input-bg)] rounded-full h-1.5",children:e.jsx("div",{className:`h-1.5 rounded-full transition-all duration-500 ${t.warn?"bg-red-500":t.color}`,style:{width:`${t.percent}%`}})})]},t.label)),a.temperature&&e.jsxs("div",{className:"flex justify-between text-sm pt-2 border-t border-[var(--border)]",children:[e.jsx("span",{className:"text-muted",children:s("system.cpuTemp")}),e.jsxs("span",{className:"font-medium font-mono text-[13px] text-foreground",children:[a.temperature,"°C"]})]})]})]}),e.jsxs("div",{className:"bg-[var(--card)] border border-[var(--border)] rounded-xl p-4",children:[e.jsx("h2",{className:"text-sm font-medium text-foreground mb-2",children:s("about.title")}),e.jsx("div",{className:"text-sm text-muted space-y-1",children:e.jsxs("p",{children:["JishuShell ","0.4.2-beta2"]})})]})]})]})}export{z as default};
@@ -1 +0,0 @@
1
- import{g as Z,d as pe,j as e,T as be,e as ee,i as N,f as he,r as ge,u as fe}from"./index-DkDnIohs.js";import{r as c}from"./vendor-react-DONn7uBV.js";import{P as T}from"./providers-lBSOjUWy.js";import{u as te}from"./vendor-i18n-Bvxxh8Di.js";const F=[{id:"check",label:"环境检测"},{id:"node",label:"Node.js"},{id:"docker",label:"Docker"},{id:"nomad",label:"Nomad"},{id:"openclaw",label:"OpenClaw"},{id:"provider",label:"模型配置"},{id:"done",label:"完成"}];function ve({ok:l}){return l?e.jsx("span",{className:"inline-block w-2 h-2 rounded-full bg-emerald-500 shadow-[0_0_6px_rgba(16,185,129,0.7)]"}):e.jsx("span",{className:"inline-block w-2 h-2 rounded-full bg-[var(--border)]"})}function D({dep:l,label:s,required:t,extra:S}){const{t:i}=te("setup"),f=l.needsUpgrade;return e.jsxs("div",{className:"flex items-center justify-between py-2.5 border-b border-[var(--border)] last:border-0",children:[e.jsxs("div",{className:"flex items-center gap-2.5",children:[f?e.jsx("span",{className:"inline-block w-2 h-2 rounded-full bg-amber-400 shadow-[0_0_6px_rgba(251,191,36,0.6)]"}):e.jsx(ve,{ok:l.installed}),e.jsx("span",{className:"text-sm text-foreground",children:s||l.name}),f&&e.jsx("span",{className:"text-xs text-amber-400",children:i("versionTooOld")}),t&&!l.installed&&!f&&e.jsx("span",{className:"text-xs text-red-400",children:i("required")})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[S,e.jsx("span",{className:"text-xs text-muted font-mono",children:l.installed?l.version||"installed":"not installed"})]})]})}function y(){return e.jsx("span",{className:"w-3.5 h-3.5 border-2 border-white/30 border-t-white rounded-full animate-spin"})}function se(l){return/失败|error|denied|forbidden|unauthorized/i.test(l)?"error":/完成|已就绪|已启动|已存在|成功|built|installed/i.test(l)?"success":/正在|等待|下载|安装|构建|启动|升级|progress|exporting|transferring/i.test(l)?"progress":"info"}function je(l){switch(l){case"progress":return{dot:"bg-sky-400 shadow-[0_0_8px_rgba(56,189,248,0.55)]",text:"text-sky-100"};case"success":return{dot:"bg-emerald-400 shadow-[0_0_8px_rgba(52,211,153,0.55)]",text:"text-emerald-100"};case"error":return{dot:"bg-red-400 shadow-[0_0_8px_rgba(248,113,113,0.55)]",text:"text-red-200"};default:return{dot:"bg-slate-500 shadow-[0_0_8px_rgba(148,163,184,0.35)]",text:"text-slate-200/90"}}}function Fe({onDone:l}){var J,Q,X,Y;const{t:s}=te(["setup","common","instance"]),[t,S]=c.useState(null),[i,f]=c.useState("check"),[u,k]=c.useState(null),[R,M]=c.useState([]),[_,v]=c.useState(""),[O,B]=c.useState(!1),[g,re]=c.useState(""),[E,ne]=c.useState(""),[P,ae]=c.useState(!1),[$,A]=c.useState(""),[q,z]=c.useState(!1),K=c.useRef(new Set),W=c.useCallback((n,r)=>{if(K.current.has(n))return;K.current.add(n);const a=r==="openclaw-docker"?s("setup:dockerImageBuild"):r==="docker"?s("setup:dockerInstall"):r==="openclaw"?s("setup:openclawInstall"):r;k(r),p(s("setup:resumeTask",{label:a}),"progress"),U(n,a).then(()=>{x(!0)}).catch(o=>{v(o.message||s("setup:taskFailed"))}).finally(()=>{k(null)})},[]),x=c.useCallback((n=!1)=>{Z().then(r=>{var a;if(S(r),(a=r.runningTasks)!=null&&a.length)for(const o of r.runningTasks)W(o.id,o.name);if(!n&&r.ready){f("provider");return}}).catch(()=>{})},[l,W]);c.useEffect(()=>{x()},[x]),c.useEffect(()=>{var r,a;if(i!=="nomad"||!((r=t==null?void 0:t.nomad)!=null&&r.installed)||(a=t==null?void 0:t.nomad)!=null&&a.running)return;const n=setInterval(()=>{x(!0)},3e3);return()=>clearInterval(n)},[i,(J=t==null?void 0:t.nomad)==null?void 0:J.installed,(Q=t==null?void 0:t.nomad)==null?void 0:Q.running,x]);const p=(n,r=se(n))=>M(a=>[...a,{message:n,tone:r}].slice(-200)),de=(n,r)=>r.type==="progress"&&typeof r.progress=="number"?`${n}: ${r.message} [${r.progress}%]`:r.type==="done"?`${n}: ${r.message}`:r.type==="error"?s("setup:taskErrorPrefix",{label:n,message:r.message}):r.message,U=async(n,r)=>{let a=0,o=0,d=s("setup:taskCompleted",{label:r});const b=Date.now()+30*60*1e3;for(;Date.now()<b;){try{const m=await pe(n);o=0;const h=m.events.slice(a);a=m.events.length;for(const j of h){const xe=j.type==="done"?"success":j.type==="error"?"error":j.type==="progress"?"progress":se(j.message);p(de(r,j),xe),j.message&&(d=j.message)}if(m.status==="done")return d;if(m.status==="error")throw new Error(d)}catch(m){if(o+=1,o>=5)throw new Error((m==null?void 0:m.message)||s("setup:taskStatusFailed",{label:r}))}const L=Math.min(1e3+a*200,3e3);await new Promise(m=>setTimeout(m,L))}throw new Error(s("setup:taskTimeout",{label:r}))},w=async(n,r,a)=>{k(n),v(""),p(s("setup:installing",{label:r}),"progress");try{const o=await a();let d=o.message||s("setup:taskStarted",{label:r});return o!=null&&o.taskId?d=await U(o.taskId,r):p(`${r}: ${d}`,"success"),x(!0),!0}catch(o){const d=o.message||s("setup:defaultInstallFailed");return p(s("setup:installFailed",{label:r,error:d}),"error"),v(d),!1}finally{k(null)}},V=async()=>{await w("node","Node.js",()=>fe())},oe=async()=>{await w("docker","Docker",()=>N("docker"))},[H,G]=c.useState(!1),le=async()=>{if(await w("openclaw","OpenClaw",()=>N("openclaw"))){const r=await w("openclaw-docker",s("setup:dockerImageBuild"),()=>N("openclaw-docker"));G(r),x(!0)}},ie=async()=>{const n=await w("openclaw-docker",s("setup:dockerImageBuild"),()=>N("openclaw-docker"));G(n),x(!0)},ce=async()=>{var r;if(await w("nomad","Nomad",()=>N("nomad"))){p(s("setup:configuringNomadSystemd"),"progress"),k("nomad-systemd");try{await N("nomad-systemd"),p(s("setup:nomadServiceStarted"),"success")}catch{try{await he("nomad"),p(s("setup:nomadStarted"),"success")}catch(a){p(s("setup:nomadStartFailed",{error:a.message}),"error"),v(a.message)}}k(null),p(s("setup:waitingNomad"),"progress");for(let a=0;a<10;a++){await new Promise(d=>setTimeout(d,2e3));const o=await Z();if((r=o.nomad)!=null&&r.running){S(o),p(s("setup:nomadReady"),"success");return}}x(!0)}},I=!!((X=t==null?void 0:t.node)!=null&&X.installed)&&!((Y=t==null?void 0:t.node)!=null&&Y.needsUpgrade),C=async()=>{var o,d,b,L,m;const n=F.findIndex(h=>h.id===i);if(n>=F.length-1)return;let r=n+1;for(;r<F.length-1;){const h=F[r].id;if(h==="node"&&I){r++;continue}if(h==="docker"&&((o=t==null?void 0:t.docker)!=null&&o.installed)&&((d=t==null?void 0:t.docker)!=null&&d.running)){r++;continue}if(h==="nomad"&&((b=t==null?void 0:t.nomad)!=null&&b.installed)&&((L=t==null?void 0:t.nomad)!=null&&L.running)){r++;continue}if(h==="openclaw"&&((m=t==null?void 0:t.openclaw)!=null&&m.installed)&&(t!=null&&t.dockerImageReady)){r++;continue}break}const a=F[r].id;if(v(""),M([]),a==="done"){f("done"),B(!0);try{await ge({installNomad:!1,installOpenclaw:!1,buildDockerImage:!1})}catch(h){v(h.message||s("setup:configWriteFailed"))}finally{B(!1)}}else f(a)},ue=n=>{if(!t)return!1;switch(n){case"check":return I;case"node":return I;case"docker":return t.docker.installed&&t.docker.running;case"nomad":return t.nomad.installed&&t.nomad.running;case"openclaw":return t.openclaw.installed&&(H||t.dockerImageReady);case"provider":return!0;case"done":return!0;default:return!1}},me=async()=>{var r;if(!g)return!1;const n=T.find(a=>a.id===g);if(!n)return!1;z(!0);try{return await ee({providerId:n.id,baseUrl:n.baseUrl,api:n.api,authHeader:n.authHeader||!1,models:n.models,selectedModelId:$||((r=n.models[0])==null?void 0:r.id)||"",apiKey:E||""}),!0}catch(a){return v(a.message||s("setup:saveFailed")),!1}finally{z(!1)}};return t?e.jsxs("div",{className:"min-h-screen flex items-center justify-center p-4 bg-background relative overflow-hidden",children:[e.jsx("div",{className:"grid-bg absolute inset-0 pointer-events-none"}),e.jsx("div",{className:"absolute top-1/3 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[600px] h-[400px] rounded-full bg-[#0066FF]/[0.06] blur-[100px] pointer-events-none"}),e.jsxs("div",{className:"w-full max-w-lg relative z-10",children:[e.jsxs("div",{className:"text-center mb-8",children:[e.jsx(be,{className:"w-48 h-48 mx-auto mb-4 object-contain"}),e.jsx("p",{className:"text-sm text-muted mt-1",children:s("setup:title")})]}),e.jsxs("div",{className:"bg-card border border-[var(--border)] rounded-xl p-6 backdrop-blur-sm",children:[i==="check"&&e.jsxs("div",{children:[e.jsx("h2",{className:"text-base font-medium text-foreground mb-1",children:s("setup:check.title")}),e.jsx("p",{className:"text-sm text-muted mb-4",children:s("setup:check.desc")}),e.jsx("p",{className:"text-xs text-muted mb-1.5 font-medium",children:s("setup:check.requiredComponents")}),e.jsxs("div",{className:"bg-card rounded-md border border-[var(--border)] px-4",children:[e.jsx(D,{dep:t.node,label:"Node.js",required:!0,extra:t.node.needsUpgrade?e.jsx("button",{onClick:V,disabled:!!u,className:"text-xs bg-amber-500/20 text-amber-400 border border-amber-500/30 rounded px-2 py-0.5 hover:bg-amber-500/30 disabled:opacity-40 transition-colors duration-200",children:s(u==="node"?"setup:check.upgrading":"setup:check.upgrade")}):void 0}),e.jsx(D,{dep:t.docker,label:"Docker",required:!0}),e.jsx(D,{dep:t.nomad,label:"Nomad",required:!0}),e.jsx(D,{dep:t.openclaw,label:"OpenClaw",required:!0})]})]}),i==="node"&&e.jsxs("div",{children:[e.jsx("h2",{className:"text-base font-medium text-foreground mb-1",children:s("setup:node.title")}),e.jsx("p",{className:"text-sm text-muted mb-4",children:s("setup:node.desc")}),I?e.jsx("div",{className:"bg-emerald-500/10 border border-emerald-500/20 text-emerald-400 text-sm rounded-md px-3 py-2.5",children:s("setup:node.ready",{version:t.node.version})}):t.hasSudo?e.jsxs("div",{className:"space-y-3",children:[e.jsx("div",{className:"bg-amber-500/10 border border-amber-500/20 text-amber-400 text-sm rounded-md px-3 py-2.5",children:s("setup:node.currentVersion",{version:t.node.version})}),e.jsx("button",{onClick:V,disabled:!!u,className:"bg-[#0066FF] text-white rounded-md px-4 py-2 text-sm font-medium hover:bg-[#0066FF]/90 disabled:opacity-40 transition-all duration-200",children:u?e.jsxs("span",{className:"inline-flex items-center gap-2",children:[e.jsx(y,{}),s("setup:node.upgrading")]}):s("setup:node.upgradeBtn")}),e.jsx("p",{className:"text-xs text-muted",children:s("setup:node.sudoRequired")})]}):e.jsxs("div",{className:"space-y-3",children:[e.jsx("div",{className:"bg-amber-500/10 border border-amber-500/20 text-amber-400 text-sm rounded-md px-3 py-2.5",children:s("setup:node.noSudo",{version:t.node.version})}),e.jsxs("div",{className:"bg-card border border-[var(--border)] rounded-md p-3",children:[e.jsx("p",{className:"text-xs text-muted mb-1.5",children:s("setup:node.contactAdmin")}),e.jsx("code",{className:"text-xs text-foreground font-mono block whitespace-pre-wrap",children:"curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash - && sudo apt-get install -y nodejs"})]}),e.jsx("button",{onClick:()=>x(!0),className:"text-xs text-muted hover:text-foreground underline transition-colors duration-200",children:s("setup:node.refreshAfterInstall")})]})]}),i==="docker"&&e.jsxs("div",{children:[e.jsx("h2",{className:"text-base font-medium text-foreground mb-1",children:s("setup:docker.title")}),e.jsx("p",{className:"text-sm text-muted mb-4",children:s("setup:docker.desc")}),t.docker.installed&&t.docker.running?e.jsx("div",{className:"bg-emerald-500/10 border border-emerald-500/20 text-emerald-400 text-sm rounded-md px-3 py-2.5",children:s("setup:docker.running",{version:t.docker.version})}):t.docker.installed&&!t.docker.running?e.jsxs("div",{className:"space-y-3",children:[e.jsx("div",{className:"bg-amber-500/10 border border-amber-500/20 text-amber-400 text-sm rounded-md px-3 py-2.5",children:s("setup:docker.notRunning")}),e.jsx("div",{className:"bg-card border border-[var(--border)] rounded-md p-3",children:e.jsx("code",{className:"text-xs text-foreground font-mono block",children:"sudo systemctl start docker"})}),e.jsx("button",{onClick:()=>x(!0),className:"text-xs text-muted hover:text-foreground underline transition-colors duration-200",children:s("setup:docker.refreshAfterStart")})]}):t.hasSudo?e.jsxs("div",{className:"space-y-3",children:[e.jsx("button",{onClick:oe,disabled:!!u,className:"bg-[#0066FF] text-white rounded-md px-4 py-2 text-sm font-medium hover:bg-[#0066FF]/90 disabled:opacity-40 transition-all duration-200",children:u?e.jsxs("span",{className:"inline-flex items-center gap-2",children:[e.jsx(y,{}),s("setup:docker.installing")]}):s("setup:docker.installBtn")}),e.jsx("p",{className:"text-xs text-muted",children:s("setup:docker.sudoRequired")})]}):e.jsxs("div",{className:"space-y-3",children:[e.jsx("div",{className:"bg-amber-500/10 border border-amber-500/20 text-amber-400 text-sm rounded-md px-3 py-2.5",children:s("setup:docker.noSudo")}),e.jsxs("div",{className:"bg-card border border-[var(--border)] rounded-md p-3",children:[e.jsx("p",{className:"text-xs text-muted mb-1.5",children:s("setup:docker.contactAdmin")}),e.jsx("code",{className:"text-xs text-foreground font-mono block",children:"curl -fsSL https://get.docker.com | sh"})]}),e.jsx("button",{onClick:()=>x(!0),className:"text-xs text-muted hover:text-foreground underline transition-colors duration-200",children:s("setup:docker.refreshAfterInstall")})]})]}),i==="nomad"&&e.jsxs("div",{children:[e.jsx("h2",{className:"text-base font-medium text-foreground mb-1",children:s("setup:nomad.title")}),e.jsx("p",{className:"text-sm text-muted mb-4",children:s("setup:nomad.desc")}),t.nomad.installed&&t.nomad.running?e.jsx("div",{className:"bg-emerald-500/10 border border-emerald-500/20 text-emerald-400 text-sm rounded-md px-3 py-2.5",children:s("setup:nomad.running",{version:t.nomad.version})}):t.nomad.installed?e.jsx("div",{className:"space-y-3",children:e.jsxs("div",{className:"flex items-center gap-2 bg-amber-500/10 border border-amber-500/20 text-amber-400 text-sm rounded-md px-3 py-2.5",children:[e.jsx(y,{}),e.jsx("span",{children:s("setup:nomad.starting")})]})}):e.jsx("button",{onClick:ce,disabled:!!u,className:"bg-[#0066FF] text-white rounded-md px-4 py-2 text-sm font-medium hover:bg-[#0066FF]/90 disabled:opacity-40 transition-all duration-200",children:u?e.jsxs("span",{className:"inline-flex items-center gap-2",children:[e.jsx(y,{}),s("setup:nomad.installing")]}):s("setup:nomad.installBtn")})]}),i==="openclaw"&&e.jsxs("div",{children:[e.jsx("h2",{className:"text-base font-medium text-foreground mb-1",children:s("setup:openclaw.title")}),e.jsx("p",{className:"text-sm text-muted mb-4",children:s("setup:openclaw.desc")}),t.openclaw.installed?e.jsxs("div",{className:"space-y-3",children:[e.jsx("div",{className:"bg-emerald-500/10 border border-emerald-500/20 text-emerald-400 text-sm rounded-md px-3 py-2.5",children:s("setup:openclaw.installed",{version:t.openclaw.version})}),u==="openclaw-docker"?e.jsxs("div",{className:"flex items-center gap-2 bg-amber-500/10 border border-amber-500/20 text-amber-400 text-sm rounded-md px-3 py-2.5",children:[e.jsx(y,{}),e.jsx("span",{children:s("setup:openclaw.buildingImage")})]}):!H&&!t.dockerImageReady?e.jsx("button",{onClick:ie,disabled:!!u,className:"bg-[#0066FF] text-white rounded-md px-4 py-2 text-sm font-medium hover:bg-[#0066FF]/90 disabled:opacity-40 transition-all duration-200",children:s("setup:openclaw.buildImageBtn")}):null]}):e.jsxs("div",{className:"space-y-3",children:[e.jsx("button",{onClick:le,disabled:!!u,className:"bg-[#0066FF] text-white rounded-md px-4 py-2 text-sm font-medium hover:bg-[#0066FF]/90 disabled:opacity-40 transition-all duration-200",children:u?e.jsxs("span",{className:"inline-flex items-center gap-2",children:[e.jsx(y,{}),s("setup:openclaw.installing")]}):s("setup:openclaw.installBtn")}),e.jsx("p",{className:"text-xs text-muted",children:s("setup:openclaw.npmHint")})]})]}),i==="done"&&e.jsx("div",{className:"text-center py-4",children:O?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"w-12 h-12 mx-auto mb-3 flex items-center justify-center",children:e.jsx("div",{className:"w-8 h-8 border-2 border-white/10 border-t-[#0066FF] rounded-full animate-spin"})}),e.jsx("h2",{className:"text-base font-medium text-foreground mb-1",children:s("setup:done.finalizing")}),e.jsx("p",{className:"text-sm text-muted",children:s("setup:done.finalizingDesc")})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"w-12 h-12 mx-auto mb-3 rounded-full bg-emerald-500/10 border border-emerald-500/20 flex items-center justify-center",children:e.jsx("svg",{className:"w-6 h-6 text-emerald-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})})}),e.jsx("h2",{className:"text-base font-medium text-foreground mb-1",children:s("setup:done.complete")}),e.jsx("p",{className:"text-sm text-muted",children:s("setup:done.completeDesc")})]})}),i==="provider"&&(()=>{var o;const n=T.find(d=>d.id===g),r=[...new Set(T.map(d=>d.group))],a=(n==null?void 0:n.models)||[];return e.jsxs("div",{children:[e.jsx("h2",{className:"text-base font-medium text-foreground mb-1",children:s("setup:provider.title")}),e.jsx("p",{className:"text-sm text-muted mb-4",children:s("setup:provider.desc")}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-muted mb-1.5",children:s("setup:provider.label")}),e.jsxs("select",{value:g,onChange:d=>{re(d.target.value),A("")},className:"w-full bg-background border border-[var(--border)] rounded-md px-3 py-2 text-sm text-foreground focus:outline-none focus:ring-1 focus:ring-[#0066FF]/60",children:[e.jsx("option",{value:"",children:s("setup:provider.placeholder")}),r.map(d=>e.jsx("optgroup",{label:s(`instance:configForm.providerGroup.${d}`,{defaultValue:d}),children:T.filter(b=>b.group===d).map(b=>e.jsx("option",{value:b.id,children:s(`instance:configForm.providerLabel.${b.id}`,{defaultValue:b.label})},b.id))},d))]})]}),g&&!["ollama","vllm","sglang"].includes(g)&&e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-muted mb-1.5",children:s("setup:provider.apiKey")}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{type:P?"text":"password",value:E,onChange:d=>ne(d.target.value),placeholder:s("setup:provider.apiKeyPlaceholder"),className:"w-full bg-[var(--input-bg)] border border-[var(--border)] rounded-md px-3 py-2 pr-9 text-sm text-foreground font-mono placeholder-[var(--muted)] focus:outline-none focus:ring-1 focus:ring-[#0066FF]/60"}),e.jsx("button",{type:"button",onClick:()=>ae(!P),className:"absolute right-2.5 top-1/2 -translate-y-1/2 text-muted hover:text-foreground",children:e.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:P?e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.878 9.878L3 3m6.878 6.878L21 21"}):e.jsxs(e.Fragment,{children:[e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}),e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"})]})})})]})]}),n&&a.length>0&&e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-muted mb-1.5",children:s("setup:provider.defaultModel")}),e.jsx("select",{value:$||((o=a[0])==null?void 0:o.id)||"",onChange:d=>A(d.target.value),className:"w-full bg-background border border-[var(--border)] rounded-md px-3 py-2 text-sm text-foreground focus:outline-none focus:ring-1 focus:ring-[#0066FF]/60",children:a.map(d=>e.jsxs("option",{value:d.id,children:[d.name," (",Math.round(d.contextWindow/1e3),"K)"]},d.id))})]})]})]})})(),R.length>0&&i!=="done"&&e.jsxs("div",{className:"mt-4 rounded-lg border border-[var(--border)] bg-[linear-gradient(180deg,rgba(2,6,23,0.96),rgba(15,23,42,0.92))] p-3 shadow-[inset_0_1px_0_rgba(255,255,255,0.04)] max-h-40 overflow-y-auto",children:[R.map((n,r)=>{const a=je(n.tone);return e.jsxs("div",{className:"flex items-start gap-2 py-0.5",children:[e.jsx("span",{className:`mt-1.5 h-1.5 w-1.5 shrink-0 rounded-full ${a.dot}`}),e.jsx("div",{className:`min-w-0 whitespace-pre-wrap break-words text-xs font-mono leading-5 ${a.text}`,children:n.message})]},r)}),e.jsx("div",{className:"pointer-events-none sticky bottom-0 h-4 bg-gradient-to-t from-slate-950/85 to-transparent"})]}),_&&e.jsx("div",{className:"mt-4 bg-red-500/10 border border-red-500/20 text-red-400 text-sm rounded-md px-3 py-2.5",children:_})]}),e.jsx("div",{className:"flex justify-between mt-6",children:i==="provider"?(()=>{const n=["ollama","vllm","sglang"].includes(g),r=g&&(n||E.trim());return e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:async()=>{await ee({skipped:!0}).catch(()=>{}),C()},className:"bg-[var(--card)] border border-[var(--border)] text-foreground rounded-md px-6 py-2 text-sm font-medium hover:bg-[var(--card-hover)] transition-all duration-200",children:s("setup:provider.skip")}),e.jsx("button",{onClick:async()=>{await me()&&C()},disabled:!r||q,className:"bg-[#0066FF] text-white rounded-md px-6 py-2 text-sm font-medium hover:bg-[#0066FF]/90 disabled:opacity-40 disabled:cursor-not-allowed transition-all duration-200 shadow-[0_0_20px_rgba(0,102,255,0.3)]",children:s(q?"setup:provider.saving":"setup:provider.saveAndContinue")})]})})():i!=="done"?e.jsxs(e.Fragment,{children:[e.jsx("div",{}),e.jsx("button",{onClick:C,disabled:!ue(i)||!!u,className:"bg-[#0066FF] text-white rounded-md px-6 py-2 text-sm font-medium hover:bg-[#0066FF]/90 disabled:opacity-40 disabled:cursor-not-allowed transition-all duration-200 shadow-[0_0_20px_rgba(0,102,255,0.3)] hover:shadow-[0_0_28px_rgba(0,102,255,0.45)]",children:s("setup:nav.next")})]}):e.jsx("button",{onClick:_?()=>C():l,disabled:O,className:"w-full bg-[#0066FF] text-white rounded-md py-2.5 text-sm font-medium hover:bg-[#0066FF]/90 disabled:opacity-40 disabled:cursor-not-allowed transition-all duration-200 shadow-[0_0_20px_rgba(0,102,255,0.3)]",children:s(_?"setup:nav.retry":"setup:nav.enterPanel")})})]})]}):e.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background",children:e.jsx("div",{className:"w-5 h-5 border-2 border-[var(--border)] border-t-foreground rounded-full animate-spin"})})}export{Fe as default};
@@ -1 +0,0 @@
1
- @import"https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Geist:wght@400;500;600;700&family=Geist+Mono:wght@400;500&display=swap";*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:Geist,Inter,-apple-system,BlinkMacSystemFont,PingFang SC,Microsoft YaHei,sans-serif;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:Geist Mono,JetBrains Mono,SF Mono,Fira Code,ui-monospace,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}:root{--background: #F8FAFC;--foreground: #0F172A;--muted: #64748B;--card: rgba(0,0,0,.03);--card-hover: rgba(0,0,0,.055);--border: rgba(0,0,0,.09);--border-hover: rgba(0, 102, 255, .35);--primary: #0066FF;--primary-hover: #0052CC;--accent: #00D4AA;--sidebar-bg: #F1F5F9;--input-bg: rgba(0,0,0,.04)}@media (prefers-color-scheme: dark){:root{--background: #0A0A0F;--foreground: #FAFAFA;--muted: rgba(255,255,255,.5);--card: rgba(255,255,255,.04);--card-hover: rgba(255,255,255,.07);--border: rgba(255,255,255,.08);--border-hover: rgba(0, 102, 255, .5);--primary: #0066FF;--primary-hover: #3385FF;--accent: #00D4AA;--sidebar-bg: rgba(255,255,255,.025);--input-bg: rgba(255,255,255,.06)}}html{font-family:Geist,Inter,-apple-system,BlinkMacSystemFont,PingFang SC,Microsoft YaHei,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}body{background-color:var(--background);color:var(--foreground)}.font-mono{font-family:Geist Mono,JetBrains Mono,SF Mono,Fira Code,ui-monospace,monospace}.container{width:100%}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}.visible{visibility:visible}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{top:0;right:0;bottom:0;left:0}.-right-0\.5{right:-.125rem}.-top-0\.5{top:-.125rem}.bottom-0{bottom:0}.left-0{left:0}.left-1\/2{left:50%}.left-3{left:.75rem}.left-\[18px\]{left:18px}.left-\[3px\]{left:3px}.right-0{right:0}.right-2\.5{right:.625rem}.right-3{right:.75rem}.right-4{right:1rem}.top-0{top:0}.top-1\/2{top:50%}.top-1\/3{top:33.333333%}.top-1\/4{top:25%}.top-3{top:.75rem}.top-4{top:1rem}.top-\[3px\]{top:3px}.top-full{top:100%}.z-10{z-index:10}.z-20{z-index:20}.z-40{z-index:40}.z-50{z-index:50}.-mx-6{margin-left:-1.5rem;margin-right:-1.5rem}.mx-1{margin-left:.25rem;margin-right:.25rem}.mx-2{margin-left:.5rem;margin-right:.5rem}.mx-3{margin-left:.75rem;margin-right:.75rem}.mx-auto{margin-left:auto;margin-right:auto}.my-0\.5{margin-top:.125rem;margin-bottom:.125rem}.my-1{margin-top:.25rem;margin-bottom:.25rem}.mb-1{margin-bottom:.25rem}.mb-1\.5{margin-bottom:.375rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-5{margin-bottom:1.25rem}.mb-6{margin-bottom:1.5rem}.mb-8{margin-bottom:2rem}.ml-1{margin-left:.25rem}.ml-2{margin-left:.5rem}.mr-1{margin-right:.25rem}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-1\.5{margin-top:.375rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-6{margin-top:1.5rem}.block{display:block}.inline-block{display:inline-block}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.hidden{display:none}.h-1\.5{height:.375rem}.h-10{height:2.5rem}.h-11{height:2.75rem}.h-12{height:3rem}.h-16{height:4rem}.h-2{height:.5rem}.h-20{height:5rem}.h-3{height:.75rem}.h-3\.5{height:.875rem}.h-4{height:1rem}.h-40{height:10rem}.h-48{height:12rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-60{height:15rem}.h-8{height:2rem}.h-\[300px\]{height:300px}.h-\[400px\]{height:400px}.h-\[600px\]{height:600px}.h-full{height:100%}.h-screen{height:100vh}.max-h-40{max-height:10rem}.max-h-\[480px\]{max-height:480px}.max-h-\[70vh\]{max-height:70vh}.min-h-\[400px\]{min-height:400px}.min-h-screen{min-height:100vh}.w-1\.5{width:.375rem}.w-12{width:3rem}.w-16{width:4rem}.w-2{width:.5rem}.w-20{width:5rem}.w-3{width:.75rem}.w-3\.5{width:.875rem}.w-4{width:1rem}.w-40{width:10rem}.w-48{width:12rem}.w-5{width:1.25rem}.w-52{width:13rem}.w-6{width:1.5rem}.w-60{width:15rem}.w-8{width:2rem}.w-80{width:20rem}.w-9{width:2.25rem}.w-\[500px\]{width:500px}.w-\[600px\]{width:600px}.w-full{width:100%}.min-w-0{min-width:0px}.min-w-\[200px\]{min-width:200px}.max-w-4xl{max-width:56rem}.max-w-5xl{max-width:64rem}.max-w-lg{max-width:32rem}.max-w-md{max-width:28rem}.max-w-sm{max-width:24rem}.max-w-xs{max-width:20rem}.flex-1{flex:1 1 0%}.flex-shrink-0,.shrink-0{flex-shrink:0}.-translate-x-1\/2{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-180{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-pointer{cursor:pointer}.cursor-text{cursor:text}.resize-none{resize:none}.resize-y{resize:vertical}.list-inside{list-style-position:inside}.list-disc{list-style-type:disc}.appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-0\.5{gap:.125rem}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-2\.5{gap:.625rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.space-y-0\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.125rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.125rem * var(--tw-space-y-reverse))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse: 0;border-top-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(1px * var(--tw-divide-y-reverse))}.divide-\[var\(--border\)\]>:not([hidden])~:not([hidden]){border-color:var(--border)}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.rounded{border-radius:.25rem}.rounded-\[22px\]{border-radius:22px}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-xl{border-radius:.75rem}.border{border-width:1px}.border-2{border-width:2px}.border-b{border-bottom-width:1px}.border-b-2{border-bottom-width:2px}.border-l-2{border-left-width:2px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-dashed{border-style:dashed}.border-\[\#0066FF\]{--tw-border-opacity: 1;border-color:rgb(0 102 255 / var(--tw-border-opacity, 1))}.border-\[\#0066FF\]\/20{border-color:#06f3}.border-\[\#0066FF\]\/30{border-color:#0066ff4d}.border-\[\#07C160\]\/30{border-color:#07c1604d}.border-\[\#3370FF\]\/20{border-color:#3370ff33}.border-\[\#3370FF\]\/30{border-color:#3370ff4d}.border-\[\#3370FF\]\/40{border-color:#3370ff66}.border-\[var\(--border\)\]{border-color:var(--border)}.border-\[var\(--primary\)\]{border-color:var(--primary)}.border-amber-500\/20{border-color:#f59e0b33}.border-amber-500\/30{border-color:#f59e0b4d}.border-emerald-500\/20{border-color:#10b98133}.border-emerald-500\/30{border-color:#10b9814d}.border-red-500\/20{border-color:#ef444433}.border-transparent{border-color:transparent}.border-white\/10{border-color:#ffffff1a}.border-white\/30{border-color:#ffffff4d}.border-l-\[\#0066FF\]{--tw-border-opacity: 1;border-left-color:rgb(0 102 255 / var(--tw-border-opacity, 1))}.border-l-\[\#00D4AA\]{--tw-border-opacity: 1;border-left-color:rgb(0 212 170 / var(--tw-border-opacity, 1))}.border-l-red-400{--tw-border-opacity: 1;border-left-color:rgb(248 113 113 / var(--tw-border-opacity, 1))}.border-t-\[\#0066FF\]{--tw-border-opacity: 1;border-top-color:rgb(0 102 255 / var(--tw-border-opacity, 1))}.border-t-\[\#07C160\]{--tw-border-opacity: 1;border-top-color:rgb(7 193 96 / var(--tw-border-opacity, 1))}.border-t-\[\#3370FF\]{--tw-border-opacity: 1;border-top-color:rgb(51 112 255 / var(--tw-border-opacity, 1))}.border-t-foreground{border-top-color:var(--foreground)}.border-t-muted{border-top-color:var(--muted)}.border-t-white{--tw-border-opacity: 1;border-top-color:rgb(255 255 255 / var(--tw-border-opacity, 1))}.bg-\[\#0066FF\]{--tw-bg-opacity: 1;background-color:rgb(0 102 255 / var(--tw-bg-opacity, 1))}.bg-\[\#0066FF\]\/10{background-color:#0066ff1a}.bg-\[\#0066FF\]\/5{background-color:#0066ff0d}.bg-\[\#0066FF\]\/\[0\.06\]{background-color:#0066ff0f}.bg-\[\#0066FF\]\/\[0\.07\]{background-color:#0066ff12}.bg-\[\#00D4AA\]{--tw-bg-opacity: 1;background-color:rgb(0 212 170 / var(--tw-bg-opacity, 1))}.bg-\[\#07C160\]{--tw-bg-opacity: 1;background-color:rgb(7 193 96 / var(--tw-bg-opacity, 1))}.bg-\[\#07C160\]\/5{background-color:#07c1600d}.bg-\[\#3370FF\]{--tw-bg-opacity: 1;background-color:rgb(51 112 255 / var(--tw-bg-opacity, 1))}.bg-\[\#3370FF\]\/10{background-color:#3370ff1a}.bg-\[\#3370FF\]\/5{background-color:#3370ff0d}.bg-\[var\(--bg\)\]{background-color:var(--bg)}.bg-\[var\(--border\)\]{background-color:var(--border)}.bg-\[var\(--card\)\]{background-color:var(--card)}.bg-\[var\(--card-hover\)\]{background-color:var(--card-hover)}.bg-\[var\(--input-bg\)\]{background-color:var(--input-bg)}.bg-\[var\(--muted\)\]{background-color:var(--muted)}.bg-amber-400{--tw-bg-opacity: 1;background-color:rgb(251 191 36 / var(--tw-bg-opacity, 1))}.bg-amber-500{--tw-bg-opacity: 1;background-color:rgb(245 158 11 / var(--tw-bg-opacity, 1))}.bg-amber-500\/10{background-color:#f59e0b1a}.bg-amber-500\/15{background-color:#f59e0b26}.bg-amber-500\/20{background-color:#f59e0b33}.bg-background{background-color:var(--background)}.bg-black\/60{background-color:#0009}.bg-card{background-color:var(--card)}.bg-emerald-400{--tw-bg-opacity: 1;background-color:rgb(52 211 153 / var(--tw-bg-opacity, 1))}.bg-emerald-500{--tw-bg-opacity: 1;background-color:rgb(16 185 129 / var(--tw-bg-opacity, 1))}.bg-emerald-500\/10{background-color:#10b9811a}.bg-emerald-500\/15{background-color:#10b98126}.bg-red-400{--tw-bg-opacity: 1;background-color:rgb(248 113 113 / var(--tw-bg-opacity, 1))}.bg-red-500{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity, 1))}.bg-red-500\/10{background-color:#ef44441a}.bg-red-500\/15{background-color:#ef444426}.bg-red-500\/5{background-color:#ef44440d}.bg-red-600{--tw-bg-opacity: 1;background-color:rgb(220 38 38 / var(--tw-bg-opacity, 1))}.bg-red-950\/20{background-color:#450a0a33}.bg-sky-400{--tw-bg-opacity: 1;background-color:rgb(56 189 248 / var(--tw-bg-opacity, 1))}.bg-slate-500{--tw-bg-opacity: 1;background-color:rgb(100 116 139 / var(--tw-bg-opacity, 1))}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-\[linear-gradient\(180deg\,rgba\(2\,6\,23\,0\.96\)\,rgba\(15\,23\,42\,0\.92\)\)\]{background-image:linear-gradient(180deg,#020617f5,#0f172aeb)}.bg-\[radial-gradient\(circle\,rgba\(0\,102\,255\,0\.08\)_0\%\,transparent_70\%\)\]{background-image:radial-gradient(circle,rgba(0,102,255,.08) 0%,transparent 70%)}.bg-gradient-to-t{background-image:linear-gradient(to top,var(--tw-gradient-stops))}.from-slate-950\/85{--tw-gradient-from: rgb(2 6 23 / .85) var(--tw-gradient-from-position);--tw-gradient-to: rgb(2 6 23 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.to-transparent{--tw-gradient-to: transparent var(--tw-gradient-to-position)}.object-contain{-o-object-fit:contain;object-fit:contain}.p-1{padding:.25rem}.p-1\.5{padding:.375rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-5{padding:1.25rem}.p-6{padding:1.5rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-12{padding-top:3rem;padding-bottom:3rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-5{padding-top:1.25rem;padding-bottom:1.25rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.pb-0\.5{padding-bottom:.125rem}.pb-4{padding-bottom:1rem}.pl-9{padding-left:2.25rem}.pl-\[6px\]{padding-left:6px}.pr-10{padding-right:2.5rem}.pr-3{padding-right:.75rem}.pr-9{padding-right:2.25rem}.pt-1\.5{padding-top:.375rem}.pt-2{padding-top:.5rem}.pt-4{padding-top:1rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.font-mono{font-family:Geist Mono,JetBrains Mono,SF Mono,Fira Code,ui-monospace,monospace}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-4xl{font-size:2.25rem;line-height:2.5rem}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.text-\[13px\]{font-size:13px}.text-\[9px\]{font-size:9px}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-medium{font-weight:500}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.tabular-nums{--tw-numeric-spacing: tabular-nums;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.leading-5{line-height:1.25rem}.leading-none{line-height:1}.leading-tight{line-height:1.25}.tracking-wider{letter-spacing:.05em}.tracking-widest{letter-spacing:.1em}.text-\[\#0066FF\]{--tw-text-opacity: 1;color:rgb(0 102 255 / var(--tw-text-opacity, 1))}.text-\[\#0066FF\]\/80{color:#06fc}.text-\[\#0066FF\]\/90{color:#0066ffe6}.text-\[\#00D4AA\]{--tw-text-opacity: 1;color:rgb(0 212 170 / var(--tw-text-opacity, 1))}.text-\[\#07C160\]{--tw-text-opacity: 1;color:rgb(7 193 96 / var(--tw-text-opacity, 1))}.text-\[\#3370FF\]{--tw-text-opacity: 1;color:rgb(51 112 255 / var(--tw-text-opacity, 1))}.text-amber-200{--tw-text-opacity: 1;color:rgb(253 230 138 / var(--tw-text-opacity, 1))}.text-amber-300{--tw-text-opacity: 1;color:rgb(252 211 77 / var(--tw-text-opacity, 1))}.text-amber-400{--tw-text-opacity: 1;color:rgb(251 191 36 / var(--tw-text-opacity, 1))}.text-amber-500{--tw-text-opacity: 1;color:rgb(245 158 11 / var(--tw-text-opacity, 1))}.text-black{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity, 1))}.text-current{color:currentColor}.text-emerald-100{--tw-text-opacity: 1;color:rgb(209 250 229 / var(--tw-text-opacity, 1))}.text-emerald-400{--tw-text-opacity: 1;color:rgb(52 211 153 / var(--tw-text-opacity, 1))}.text-foreground{color:var(--foreground)}.text-muted{color:var(--muted)}.text-red-200{--tw-text-opacity: 1;color:rgb(254 202 202 / var(--tw-text-opacity, 1))}.text-red-400{--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.text-sky-100{--tw-text-opacity: 1;color:rgb(224 242 254 / var(--tw-text-opacity, 1))}.text-slate-200\/90{color:#e2e8f0e6}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.underline{text-decoration-line:underline}.no-underline{text-decoration-line:none}.placeholder-\[var\(--muted\)\]::-moz-placeholder{color:var(--muted)}.placeholder-\[var\(--muted\)\]::placeholder{color:var(--muted)}.opacity-0{opacity:0}.opacity-100{opacity:1}.opacity-30{opacity:.3}.opacity-40{opacity:.4}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.opacity-80{opacity:.8}.shadow-2xl{--tw-shadow: 0 25px 50px -12px rgb(0 0 0 / .25);--tw-shadow-colored: 0 25px 50px -12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[0_0_12px_rgba\(0\,102\,255\,0\.3\)\]{--tw-shadow: 0 0 12px rgba(0,102,255,.3);--tw-shadow-colored: 0 0 12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[0_0_20px_rgba\(0\,102\,255\,0\.3\)\]{--tw-shadow: 0 0 20px rgba(0,102,255,.3);--tw-shadow-colored: 0 0 20px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[0_0_6px_rgba\(16\,185\,129\,0\.6\)\]{--tw-shadow: 0 0 6px rgba(16,185,129,.6);--tw-shadow-colored: 0 0 6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[0_0_6px_rgba\(16\,185\,129\,0\.7\)\]{--tw-shadow: 0 0 6px rgba(16,185,129,.7);--tw-shadow-colored: 0 0 6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[0_0_6px_rgba\(239\,68\,68\,0\.6\)\]{--tw-shadow: 0 0 6px rgba(239,68,68,.6);--tw-shadow-colored: 0 0 6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[0_0_6px_rgba\(251\,191\,36\,0\.5\)\]{--tw-shadow: 0 0 6px rgba(251,191,36,.5);--tw-shadow-colored: 0 0 6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[0_0_6px_rgba\(251\,191\,36\,0\.6\)\]{--tw-shadow: 0 0 6px rgba(251,191,36,.6);--tw-shadow-colored: 0 0 6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[0_0_8px_rgba\(148\,163\,184\,0\.35\)\]{--tw-shadow: 0 0 8px rgba(148,163,184,.35);--tw-shadow-colored: 0 0 8px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[0_0_8px_rgba\(248\,113\,113\,0\.55\)\]{--tw-shadow: 0 0 8px rgba(248,113,113,.55);--tw-shadow-colored: 0 0 8px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[0_0_8px_rgba\(52\,211\,153\,0\.55\)\]{--tw-shadow: 0 0 8px rgba(52,211,153,.55);--tw-shadow-colored: 0 0 8px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[0_0_8px_rgba\(56\,189\,248\,0\.55\)\]{--tw-shadow: 0 0 8px rgba(56,189,248,.55);--tw-shadow-colored: 0 0 8px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[0_18px_48px_rgba\(15\,23\,42\,0\.06\)\]{--tw-shadow: 0 18px 48px rgba(15,23,42,.06);--tw-shadow-colored: 0 18px 48px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[inset_0_1px_0_rgba\(255\,255\,255\,0\.04\)\]{--tw-shadow: inset 0 1px 0 rgba(255,255,255,.04);--tw-shadow-colored: inset 0 1px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.blur-\[100px\]{--tw-blur: blur(100px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.blur-\[90px\]{--tw-blur: blur(90px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur-sm{--tw-backdrop-blur: blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.backdrop-blur-xl{--tw-backdrop-blur: blur(24px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-150{transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.duration-500{transition-duration:.5s}::-webkit-scrollbar{width:6px;height:6px}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{background:var(--border);border-radius:3px}::-webkit-scrollbar-thumb:hover{background:#8080804d}.sidebar-scroll::-webkit-scrollbar{width:4px}.sidebar-scroll::-webkit-scrollbar-thumb{background:var(--border);border-radius:2px}.grid-bg{background-image:linear-gradient(to right,var(--border) 1px,transparent 1px),linear-gradient(to bottom,var(--border) 1px,transparent 1px);background-size:40px 40px}.glow-blue{background:radial-gradient(circle,rgba(0,102,255,.08) 0%,transparent 70%)}.placeholder\:text-muted::-moz-placeholder{color:var(--muted)}.placeholder\:text-muted::placeholder{color:var(--muted)}.last\:border-0:last-child{border-width:0px}.hover\:border-\[var\(--border-hover\)\]:hover{border-color:var(--border-hover)}.hover\:bg-\[\#0066FF\]\/10:hover{background-color:#0066ff1a}.hover\:bg-\[\#0066FF\]\/15:hover{background-color:#0066ff26}.hover\:bg-\[\#0066FF\]\/20:hover{background-color:#06f3}.hover\:bg-\[\#0066FF\]\/90:hover{background-color:#0066ffe6}.hover\:bg-\[\#07C160\]\/10:hover{background-color:#07c1601a}.hover\:bg-\[\#07C160\]\/90:hover{background-color:#07c160e6}.hover\:bg-\[\#3370FF\]\/10:hover{background-color:#3370ff1a}.hover\:bg-\[\#3370FF\]\/20:hover{background-color:#3370ff33}.hover\:bg-\[\#3370FF\]\/90:hover{background-color:#3370ffe6}.hover\:bg-\[var\(--card\)\]:hover{background-color:var(--card)}.hover\:bg-\[var\(--card-hover\)\]:hover{background-color:var(--card-hover)}.hover\:bg-amber-400:hover{--tw-bg-opacity: 1;background-color:rgb(251 191 36 / var(--tw-bg-opacity, 1))}.hover\:bg-amber-500\/30:hover{background-color:#f59e0b4d}.hover\:bg-emerald-500\/10:hover{background-color:#10b9811a}.hover\:bg-emerald-500\/20:hover{background-color:#10b98133}.hover\:bg-red-500\/10:hover{background-color:#ef44441a}.hover\:bg-red-500\/15:hover{background-color:#ef444426}.hover\:bg-red-500\/20:hover{background-color:#ef444433}.hover\:bg-red-500\/90:hover{background-color:#ef4444e6}.hover\:bg-red-700:hover{--tw-bg-opacity: 1;background-color:rgb(185 28 28 / var(--tw-bg-opacity, 1))}.hover\:text-\[\#0066FF\]:hover{--tw-text-opacity: 1;color:rgb(0 102 255 / var(--tw-text-opacity, 1))}.hover\:text-\[\#0066FF\]\/80:hover{color:#06fc}.hover\:text-emerald-400:hover{--tw-text-opacity: 1;color:rgb(52 211 153 / var(--tw-text-opacity, 1))}.hover\:text-foreground:hover{color:var(--foreground)}.hover\:text-red-300:hover{--tw-text-opacity: 1;color:rgb(252 165 165 / var(--tw-text-opacity, 1))}.hover\:text-red-400:hover{--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-100:hover{opacity:1}.hover\:opacity-90:hover{opacity:.9}.hover\:shadow-\[0_0_28px_rgba\(0\,102\,255\,0\.45\)\]:hover{--tw-shadow: 0 0 28px rgba(0,102,255,.45);--tw-shadow-colored: 0 0 28px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.focus\:border-\[\#0066FF\]\/60:focus{border-color:#06f9}.focus\:border-red-500\/60:focus{border-color:#ef444499}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-1:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-\[\#0066FF\]\/60:focus{--tw-ring-color: rgb(0 102 255 / .6)}.focus\:ring-red-500\/60:focus{--tw-ring-color: rgb(239 68 68 / .6)}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-30:disabled{opacity:.3}.disabled\:opacity-40:disabled{opacity:.4}.disabled\:opacity-50:disabled{opacity:.5}.disabled\:opacity-60:disabled{opacity:.6}@media (min-width: 640px){.sm\:inline{display:inline}.sm\:table-cell{display:table-cell}}@media (min-width: 768px){.md\:table-cell{display:table-cell}}@media (min-width: 1024px){.lg\:flex{display:flex}.lg\:hidden{display:none}.lg\:min-h-\[500px\]{min-height:500px}.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}