@kafca/agentdock 0.1.22 → 0.1.23
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.
- package/README.md +3 -0
- package/dist/renderer/assets/{Badge-B_rgzxYO.js → Badge-C2K5apfV.js} +1 -1
- package/dist/renderer/assets/{Chat-CYtp6m7T.js → Chat-DI2YeVKb.js} +1 -1
- package/dist/renderer/assets/{ChatMarkdown-DOBMwa9d.js → ChatMarkdown-DMAr15Oi.js} +1 -1
- package/dist/renderer/assets/{Config-DppMSPHF.js → Config-7rP3EuUf.js} +1 -1
- package/dist/renderer/assets/{CronList-BDtB1SuA.js → CronList-81QslYE8.js} +1 -1
- package/dist/renderer/assets/{Dashboard-iFlRnd7Y.js → Dashboard-Db2T7rSZ.js} +2 -2
- package/dist/renderer/assets/{EmptyState-bKDt_T88.js → EmptyState-BBJ3cTvB.js} +1 -1
- package/dist/renderer/assets/{KnowledgeDetail-CKPhKPIg.js → KnowledgeDetail-Dz_6flG3.js} +2 -2
- package/dist/renderer/assets/{KnowledgeHome-CFeJre6i.js → KnowledgeHome-DIh046mN.js} +3 -3
- package/dist/renderer/assets/{Logs-CyxSVOFK.js → Logs-BXBtHJLf.js} +1 -1
- package/dist/renderer/assets/{Modal-CxPnk1Ey.js → Modal-BB2Av_Xs.js} +1 -1
- package/dist/renderer/assets/{Page-kU9vubzj.js → Page-DPSdvMgU.js} +1 -1
- package/dist/renderer/assets/{ProjectDetail-D9FY9NWZ.js → ProjectDetail-C6EWGvGg.js} +1 -1
- package/dist/renderer/assets/{ProjectList-DIwr2TXg.js → ProjectList-BBo5ygnS.js} +1 -1
- package/dist/renderer/assets/{Select-BaWoz5Dn.js → Select-CNX-Tx_O.js} +1 -1
- package/dist/renderer/assets/{SessionChat-Cm9CW8Zx.js → SessionChat-BIn46jqZ.js} +1 -1
- package/dist/renderer/assets/{SessionList-UPnWlXXO.js → SessionList-CZt6f1Rd.js} +1 -1
- package/dist/renderer/assets/{ThreadChat-YvVsACW3.js → ThreadChat-BotD0gKQ.js} +1 -1
- package/dist/renderer/assets/Workspace-C_4tdpjX.js +14 -0
- package/dist/renderer/assets/{arrow-left-BmZAVGV7.js → arrow-left-cHr5wkpq.js} +1 -1
- package/dist/renderer/assets/{book-open-DZ3GXFgI.js → book-open-4nx5C8T-.js} +1 -1
- package/dist/renderer/assets/{check-CeVSvDCv.js → check-exTS-R-x.js} +1 -1
- package/dist/renderer/assets/{chevron-down-yryuMoQ-.js → chevron-down-DSvxXQa0.js} +1 -1
- package/dist/renderer/assets/{circle-eASsFISH.js → circle-DyvEovdw.js} +1 -1
- package/dist/renderer/assets/desktop-B-KVT10D.js +1 -0
- package/dist/renderer/assets/{desktop-Che1cbpE.js → desktop-CVibRyAw.js} +3 -3
- package/dist/renderer/assets/{funnel-pwAe2Ixp.js → funnel-DA9qVdTy.js} +1 -1
- package/dist/renderer/assets/{heart-B2Sp-bCm.js → heart-DuEV0ZRJ.js} +1 -1
- package/dist/renderer/assets/{index-Cse2Br64.js → index-BgflqkCN.js} +3 -3
- package/dist/renderer/assets/{index-BC3MWbS1.js → index-Biz-aexG.js} +39 -39
- package/dist/renderer/assets/{pencil-BfEunUF3.js → pencil-DBDxeNmO.js} +1 -1
- package/dist/renderer/assets/{play-Dcs9Lj_Z.js → play-IzlP83_7.js} +1 -1
- package/dist/renderer/assets/{plug-B_YschQe.js → plug-CuT-qFnW.js} +1 -1
- package/dist/renderer/assets/{plus-Pqo-cXHQ.js → plus-DEqgkn63.js} +1 -1
- package/dist/renderer/assets/projects-DDtDN1rc.js +1 -0
- package/dist/renderer/assets/{save-BKM5yi1A.js → save-D4sRo07y.js} +1 -1
- package/dist/renderer/assets/{search-BU42h10M.js → search-DbPZLuV8.js} +1 -1
- package/dist/renderer/assets/{server-DA5t3Rtr.js → server-D1jUQmwN.js} +1 -1
- package/dist/renderer/assets/{session-utils-Cr9VhNSq.js → session-utils-Aife8ep2.js} +1 -1
- package/dist/renderer/assets/{sessions-bvV8ZMfX.js → sessions-DaH3H7gC.js} +1 -1
- package/dist/renderer/assets/{shield-check-BeOJKur_.js → shield-check-BGwUFWNr.js} +1 -1
- package/dist/renderer/assets/{trash-2-CQ7HKO3q.js → trash-2-CIFBioBa.js} +1 -1
- package/dist/renderer/assets/{user-CtFjY9SV.js → user-CnKcvHdo.js} +1 -1
- package/dist/renderer/assets/{wifi-off-Ci5m0ysf.js → wifi-off-ClO53WGa.js} +1 -1
- package/dist/renderer/index.html +1 -1
- package/dist-electron/electron/local-core-refactor.test.js +505 -0
- package/dist-electron/electron/plugin-kernel.test.js +74 -14
- package/dist-electron/packages/core-sdk/src/index.js +40 -20
- package/dist-electron/services/local-ai-core/src/acp/local-core-acp-turn-coordinator.js +5 -1
- package/dist-electron/services/local-ai-core/src/acp/workspace-acp-permissions.js +55 -3
- package/dist-electron/services/local-ai-core/src/channel/lark/cards.js +210 -0
- package/dist-electron/services/local-ai-core/src/channel/lark/config.js +54 -0
- package/dist-electron/services/local-ai-core/src/channel/lark/local-core-lark-gateway.js +212 -471
- package/dist-electron/services/local-ai-core/src/channel/lark/registration.js +50 -0
- package/dist-electron/services/local-ai-core/src/channel/lark/runtime-state.js +191 -0
- package/dist-electron/services/local-ai-core/src/channel/lark/types.js +2 -0
- package/dist-electron/services/local-ai-core/src/channel/shared/plugin.js +31 -0
- package/dist-electron/services/local-ai-core/src/channel/weixin/config.js +125 -0
- package/dist-electron/services/local-ai-core/src/channel/weixin/local-core-weixin-gateway.js +141 -324
- package/dist-electron/services/local-ai-core/src/channel/weixin/transport.js +169 -0
- package/dist-electron/services/local-ai-core/src/channel/weixin/types.js +2 -0
- package/dist-electron/services/local-ai-core/src/kernel/bootstrap.js +5 -0
- package/dist-electron/services/local-ai-core/src/plugins/builtin/channel-lark-plugin.js +18 -39
- package/dist-electron/services/local-ai-core/src/plugins/builtin/channel-weixin-plugin.js +18 -39
- package/dist-electron/services/local-ai-core/src/runtime/local-core-controller.js +55 -44
- package/dist-electron/services/local-ai-core/src/runtime/server.js +10 -8
- package/dist-electron/shared/desktop.js +10 -0
- package/package.json +1 -1
- package/dist/renderer/assets/Workspace-ST7V8u6T.js +0 -14
- package/dist/renderer/assets/desktop-DkrP_s-b.js +0 -1
- package/dist/renderer/assets/projects-BCj0k_Gy.js +0 -1
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import{c as Pt,y as _,t as Rt,r as N,j as r,B as I,I as z,S as At}from"./index-Biz-aexG.js";import{M as et}from"./Modal-BB2Av_Xs.js";import{S as ge}from"./Select-CNX-Tx_O.js";import{E as ye}from"./EmptyState-BBJ3cTvB.js";import{P as _t,S as tt,a as nt}from"./Page-DPSdvMgU.js";import{c as It,e as Lt,t as Ot,d as Ce,f as Tt,h as Dt,i as zt,j as st}from"./desktop-B-KVT10D.js";import{D as ke,c as lt,g as Ee,d as Ft,e as Bt}from"./desktop-CVibRyAw.js";import{T as Ne}from"./trash-2-CIFBioBa.js";import{P as ue}from"./plus-DEqgkn63.js";import{S as rt}from"./save-D4sRo07y.js";import"./index-BgflqkCN.js";import"./chevron-down-DSvxXQa0.js";import"./check-exTS-R-x.js";/**
|
|
2
|
+
* @license lucide-react v0.487.0 - ISC
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the ISC license.
|
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/const Ut=[["rect",{width:"5",height:"5",x:"3",y:"3",rx:"1",key:"1tu5fj"}],["rect",{width:"5",height:"5",x:"16",y:"3",rx:"1",key:"1v8r4q"}],["rect",{width:"5",height:"5",x:"3",y:"16",rx:"1",key:"1x03jg"}],["path",{d:"M21 16h-3a2 2 0 0 0-2 2v3",key:"177gqh"}],["path",{d:"M21 21v.01",key:"ents32"}],["path",{d:"M12 7v3a2 2 0 0 1-2 2H7",key:"8crl2c"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M12 3h.01",key:"n36tog"}],["path",{d:"M12 16v.01",key:"133mhm"}],["path",{d:"M16 12h1",key:"1slzba"}],["path",{d:"M21 12v.01",key:"1lwtk9"}],["path",{d:"M12 21v-1",key:"1880an"}]],at=Pt("qr-code",Ut);var $t=Object.defineProperty,xe=Object.getOwnPropertySymbols,ct=Object.prototype.hasOwnProperty,dt=Object.prototype.propertyIsEnumerable,ot=(c,d,i)=>d in c?$t(c,d,{enumerable:!0,configurable:!0,writable:!0,value:i}):c[d]=i,je=(c,d)=>{for(var i in d||(d={}))ct.call(d,i)&&ot(c,i,d[i]);if(xe)for(var i of xe(d))dt.call(d,i)&&ot(c,i,d[i]);return c},Pe=(c,d)=>{var i={};for(var h in c)ct.call(c,h)&&d.indexOf(h)<0&&(i[h]=c[h]);if(c!=null&&xe)for(var h of xe(c))d.indexOf(h)<0&&dt.call(c,h)&&(i[h]=c[h]);return i};/**
|
|
7
|
+
* @license QR Code generator library (TypeScript)
|
|
8
|
+
* Copyright (c) Project Nayuki.
|
|
9
|
+
* SPDX-License-Identifier: MIT
|
|
10
|
+
*/var ne;(c=>{const d=class k{constructor(e,s,n,o){if(this.version=e,this.errorCorrectionLevel=s,this.modules=[],this.isFunction=[],e<k.MIN_VERSION||e>k.MAX_VERSION)throw new RangeError("Version value out of range");if(o<-1||o>7)throw new RangeError("Mask value out of range");this.size=e*4+17;let u=[];for(let f=0;f<this.size;f++)u.push(!1);for(let f=0;f<this.size;f++)this.modules.push(u.slice()),this.isFunction.push(u.slice());this.drawFunctionPatterns();const l=this.addEccAndInterleave(n);if(this.drawCodewords(l),o==-1){let f=1e9;for(let p=0;p<8;p++){this.applyMask(p),this.drawFormatBits(p);const w=this.getPenaltyScore();w<f&&(o=p,f=w),this.applyMask(p)}}b(0<=o&&o<=7),this.mask=o,this.applyMask(o),this.drawFormatBits(o),this.isFunction=[]}static encodeText(e,s){const n=c.QrSegment.makeSegments(e);return k.encodeSegments(n,s)}static encodeBinary(e,s){const n=c.QrSegment.makeBytes(e);return k.encodeSegments([n],s)}static encodeSegments(e,s,n=1,o=40,u=-1,l=!0){if(!(k.MIN_VERSION<=n&&n<=o&&o<=k.MAX_VERSION)||u<-1||u>7)throw new RangeError("Invalid value");let f,p;for(f=n;;f++){const m=k.getNumDataCodewords(f,s)*8,E=j.getTotalBits(e,f);if(E<=m){p=E;break}if(f>=o)throw new RangeError("Data too long")}for(const m of[k.Ecc.MEDIUM,k.Ecc.QUARTILE,k.Ecc.HIGH])l&&p<=k.getNumDataCodewords(f,m)*8&&(s=m);let w=[];for(const m of e){i(m.mode.modeBits,4,w),i(m.numChars,m.mode.numCharCountBits(f),w);for(const E of m.getData())w.push(E)}b(w.length==p);const L=k.getNumDataCodewords(f,s)*8;b(w.length<=L),i(0,Math.min(4,L-w.length),w),i(0,(8-w.length%8)%8,w),b(w.length%8==0);for(let m=236;w.length<L;m^=253)i(m,8,w);let M=[];for(;M.length*8<w.length;)M.push(0);return w.forEach((m,E)=>M[E>>>3]|=m<<7-(E&7)),new k(f,s,M,u)}getModule(e,s){return 0<=e&&e<this.size&&0<=s&&s<this.size&&this.modules[s][e]}getModules(){return this.modules}drawFunctionPatterns(){for(let n=0;n<this.size;n++)this.setFunctionModule(6,n,n%2==0),this.setFunctionModule(n,6,n%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);const e=this.getAlignmentPatternPositions(),s=e.length;for(let n=0;n<s;n++)for(let o=0;o<s;o++)n==0&&o==0||n==0&&o==s-1||n==s-1&&o==0||this.drawAlignmentPattern(e[n],e[o]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(e){const s=this.errorCorrectionLevel.formatBits<<3|e;let n=s;for(let u=0;u<10;u++)n=n<<1^(n>>>9)*1335;const o=(s<<10|n)^21522;b(o>>>15==0);for(let u=0;u<=5;u++)this.setFunctionModule(8,u,h(o,u));this.setFunctionModule(8,7,h(o,6)),this.setFunctionModule(8,8,h(o,7)),this.setFunctionModule(7,8,h(o,8));for(let u=9;u<15;u++)this.setFunctionModule(14-u,8,h(o,u));for(let u=0;u<8;u++)this.setFunctionModule(this.size-1-u,8,h(o,u));for(let u=8;u<15;u++)this.setFunctionModule(8,this.size-15+u,h(o,u));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let e=this.version;for(let n=0;n<12;n++)e=e<<1^(e>>>11)*7973;const s=this.version<<12|e;b(s>>>18==0);for(let n=0;n<18;n++){const o=h(s,n),u=this.size-11+n%3,l=Math.floor(n/3);this.setFunctionModule(u,l,o),this.setFunctionModule(l,u,o)}}drawFinderPattern(e,s){for(let n=-4;n<=4;n++)for(let o=-4;o<=4;o++){const u=Math.max(Math.abs(o),Math.abs(n)),l=e+o,f=s+n;0<=l&&l<this.size&&0<=f&&f<this.size&&this.setFunctionModule(l,f,u!=2&&u!=4)}}drawAlignmentPattern(e,s){for(let n=-2;n<=2;n++)for(let o=-2;o<=2;o++)this.setFunctionModule(e+o,s+n,Math.max(Math.abs(o),Math.abs(n))!=1)}setFunctionModule(e,s,n){this.modules[s][e]=n,this.isFunction[s][e]=!0}addEccAndInterleave(e){const s=this.version,n=this.errorCorrectionLevel;if(e.length!=k.getNumDataCodewords(s,n))throw new RangeError("Invalid argument");const o=k.NUM_ERROR_CORRECTION_BLOCKS[n.ordinal][s],u=k.ECC_CODEWORDS_PER_BLOCK[n.ordinal][s],l=Math.floor(k.getNumRawDataModules(s)/8),f=o-l%o,p=Math.floor(l/o);let w=[];const L=k.reedSolomonComputeDivisor(u);for(let m=0,E=0;m<o;m++){let D=e.slice(E,E+p-u+(m<f?0:1));E+=D.length;const W=k.reedSolomonComputeRemainder(D,L);m<f&&D.push(0),w.push(D.concat(W))}let M=[];for(let m=0;m<w[0].length;m++)w.forEach((E,D)=>{(m!=p-u||D>=f)&&M.push(E[m])});return b(M.length==l),M}drawCodewords(e){if(e.length!=Math.floor(k.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let s=0;for(let n=this.size-1;n>=1;n-=2){n==6&&(n=5);for(let o=0;o<this.size;o++)for(let u=0;u<2;u++){const l=n-u,p=(n+1&2)==0?this.size-1-o:o;!this.isFunction[p][l]&&s<e.length*8&&(this.modules[p][l]=h(e[s>>>3],7-(s&7)),s++)}}b(s==e.length*8)}applyMask(e){if(e<0||e>7)throw new RangeError("Mask value out of range");for(let s=0;s<this.size;s++)for(let n=0;n<this.size;n++){let o;switch(e){case 0:o=(n+s)%2==0;break;case 1:o=s%2==0;break;case 2:o=n%3==0;break;case 3:o=(n+s)%3==0;break;case 4:o=(Math.floor(n/3)+Math.floor(s/2))%2==0;break;case 5:o=n*s%2+n*s%3==0;break;case 6:o=(n*s%2+n*s%3)%2==0;break;case 7:o=((n+s)%2+n*s%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[s][n]&&o&&(this.modules[s][n]=!this.modules[s][n])}}getPenaltyScore(){let e=0;for(let u=0;u<this.size;u++){let l=!1,f=0,p=[0,0,0,0,0,0,0];for(let w=0;w<this.size;w++)this.modules[u][w]==l?(f++,f==5?e+=k.PENALTY_N1:f>5&&e++):(this.finderPenaltyAddHistory(f,p),l||(e+=this.finderPenaltyCountPatterns(p)*k.PENALTY_N3),l=this.modules[u][w],f=1);e+=this.finderPenaltyTerminateAndCount(l,f,p)*k.PENALTY_N3}for(let u=0;u<this.size;u++){let l=!1,f=0,p=[0,0,0,0,0,0,0];for(let w=0;w<this.size;w++)this.modules[w][u]==l?(f++,f==5?e+=k.PENALTY_N1:f>5&&e++):(this.finderPenaltyAddHistory(f,p),l||(e+=this.finderPenaltyCountPatterns(p)*k.PENALTY_N3),l=this.modules[w][u],f=1);e+=this.finderPenaltyTerminateAndCount(l,f,p)*k.PENALTY_N3}for(let u=0;u<this.size-1;u++)for(let l=0;l<this.size-1;l++){const f=this.modules[u][l];f==this.modules[u][l+1]&&f==this.modules[u+1][l]&&f==this.modules[u+1][l+1]&&(e+=k.PENALTY_N2)}let s=0;for(const u of this.modules)s=u.reduce((l,f)=>l+(f?1:0),s);const n=this.size*this.size,o=Math.ceil(Math.abs(s*20-n*10)/n)-1;return b(0<=o&&o<=9),e+=o*k.PENALTY_N4,b(0<=e&&e<=2568888),e}getAlignmentPatternPositions(){if(this.version==1)return[];{const e=Math.floor(this.version/7)+2,s=this.version==32?26:Math.ceil((this.version*4+4)/(e*2-2))*2;let n=[6];for(let o=this.size-7;n.length<e;o-=s)n.splice(1,0,o);return n}}static getNumRawDataModules(e){if(e<k.MIN_VERSION||e>k.MAX_VERSION)throw new RangeError("Version number out of range");let s=(16*e+128)*e+64;if(e>=2){const n=Math.floor(e/7)+2;s-=(25*n-10)*n-55,e>=7&&(s-=36)}return b(208<=s&&s<=29648),s}static getNumDataCodewords(e,s){return Math.floor(k.getNumRawDataModules(e)/8)-k.ECC_CODEWORDS_PER_BLOCK[s.ordinal][e]*k.NUM_ERROR_CORRECTION_BLOCKS[s.ordinal][e]}static reedSolomonComputeDivisor(e){if(e<1||e>255)throw new RangeError("Degree out of range");let s=[];for(let o=0;o<e-1;o++)s.push(0);s.push(1);let n=1;for(let o=0;o<e;o++){for(let u=0;u<s.length;u++)s[u]=k.reedSolomonMultiply(s[u],n),u+1<s.length&&(s[u]^=s[u+1]);n=k.reedSolomonMultiply(n,2)}return s}static reedSolomonComputeRemainder(e,s){let n=s.map(o=>0);for(const o of e){const u=o^n.shift();n.push(0),s.forEach((l,f)=>n[f]^=k.reedSolomonMultiply(l,u))}return n}static reedSolomonMultiply(e,s){if(e>>>8||s>>>8)throw new RangeError("Byte out of range");let n=0;for(let o=7;o>=0;o--)n=n<<1^(n>>>7)*285,n^=(s>>>o&1)*e;return b(n>>>8==0),n}finderPenaltyCountPatterns(e){const s=e[1];b(s<=this.size*3);const n=s>0&&e[2]==s&&e[3]==s*3&&e[4]==s&&e[5]==s;return(n&&e[0]>=s*4&&e[6]>=s?1:0)+(n&&e[6]>=s*4&&e[0]>=s?1:0)}finderPenaltyTerminateAndCount(e,s,n){return e&&(this.finderPenaltyAddHistory(s,n),s=0),s+=this.size,this.finderPenaltyAddHistory(s,n),this.finderPenaltyCountPatterns(n)}finderPenaltyAddHistory(e,s){s[0]==0&&(e+=this.size),s.pop(),s.unshift(e)}};d.MIN_VERSION=1,d.MAX_VERSION=40,d.PENALTY_N1=3,d.PENALTY_N2=3,d.PENALTY_N3=40,d.PENALTY_N4=10,d.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]],d.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]],c.QrCode=d;function i(C,e,s){if(e<0||e>31||C>>>e)throw new RangeError("Value out of range");for(let n=e-1;n>=0;n--)s.push(C>>>n&1)}function h(C,e){return(C>>>e&1)!=0}function b(C){if(!C)throw new Error("Assertion error")}const y=class P{constructor(e,s,n){if(this.mode=e,this.numChars=s,this.bitData=n,s<0)throw new RangeError("Invalid argument");this.bitData=n.slice()}static makeBytes(e){let s=[];for(const n of e)i(n,8,s);return new P(P.Mode.BYTE,e.length,s)}static makeNumeric(e){if(!P.isNumeric(e))throw new RangeError("String contains non-numeric characters");let s=[];for(let n=0;n<e.length;){const o=Math.min(e.length-n,3);i(parseInt(e.substring(n,n+o),10),o*3+1,s),n+=o}return new P(P.Mode.NUMERIC,e.length,s)}static makeAlphanumeric(e){if(!P.isAlphanumeric(e))throw new RangeError("String contains unencodable characters in alphanumeric mode");let s=[],n;for(n=0;n+2<=e.length;n+=2){let o=P.ALPHANUMERIC_CHARSET.indexOf(e.charAt(n))*45;o+=P.ALPHANUMERIC_CHARSET.indexOf(e.charAt(n+1)),i(o,11,s)}return n<e.length&&i(P.ALPHANUMERIC_CHARSET.indexOf(e.charAt(n)),6,s),new P(P.Mode.ALPHANUMERIC,e.length,s)}static makeSegments(e){return e==""?[]:P.isNumeric(e)?[P.makeNumeric(e)]:P.isAlphanumeric(e)?[P.makeAlphanumeric(e)]:[P.makeBytes(P.toUtf8ByteArray(e))]}static makeEci(e){let s=[];if(e<0)throw new RangeError("ECI assignment value out of range");if(e<128)i(e,8,s);else if(e<16384)i(2,2,s),i(e,14,s);else if(e<1e6)i(6,3,s),i(e,21,s);else throw new RangeError("ECI assignment value out of range");return new P(P.Mode.ECI,0,s)}static isNumeric(e){return P.NUMERIC_REGEX.test(e)}static isAlphanumeric(e){return P.ALPHANUMERIC_REGEX.test(e)}getData(){return this.bitData.slice()}static getTotalBits(e,s){let n=0;for(const o of e){const u=o.mode.numCharCountBits(s);if(o.numChars>=1<<u)return 1/0;n+=4+u+o.bitData.length}return n}static toUtf8ByteArray(e){e=encodeURI(e);let s=[];for(let n=0;n<e.length;n++)e.charAt(n)!="%"?s.push(e.charCodeAt(n)):(s.push(parseInt(e.substring(n+1,n+3),16)),n+=2);return s}};y.NUMERIC_REGEX=/^[0-9]*$/,y.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,y.ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:";let j=y;c.QrSegment=y})(ne||(ne={}));(c=>{(d=>{const i=class{constructor(b,y){this.ordinal=b,this.formatBits=y}};i.LOW=new i(0,1),i.MEDIUM=new i(1,0),i.QUARTILE=new i(2,3),i.HIGH=new i(3,2),d.Ecc=i})(c.QrCode||(c.QrCode={}))})(ne||(ne={}));(c=>{(d=>{const i=class{constructor(b,y){this.modeBits=b,this.numBitsCharCount=y}numCharCountBits(b){return this.numBitsCharCount[Math.floor((b+7)/17)]}};i.NUMERIC=new i(1,[10,12,14]),i.ALPHANUMERIC=new i(2,[9,11,13]),i.BYTE=new i(4,[8,16,16]),i.KANJI=new i(8,[8,10,12]),i.ECI=new i(7,[0,0,0]),d.Mode=i})(c.QrSegment||(c.QrSegment={}))})(ne||(ne={}));var ie=ne;/**
|
|
11
|
+
* @license qrcode.react
|
|
12
|
+
* Copyright (c) Paul O'Shannessy
|
|
13
|
+
* SPDX-License-Identifier: ISC
|
|
14
|
+
*/var Qt={L:ie.QrCode.Ecc.LOW,M:ie.QrCode.Ecc.MEDIUM,Q:ie.QrCode.Ecc.QUARTILE,H:ie.QrCode.Ecc.HIGH},ut=128,mt="L",ht="#FFFFFF",ft="#000000",gt=!1,pt=1,Gt=4,Ht=0,Yt=.1;function xt(c,d=0){const i=[];return c.forEach(function(h,b){let y=null;h.forEach(function(j,C){if(!j&&y!==null){i.push(`M${y+d} ${b+d}h${C-y}v1H${y+d}z`),y=null;return}if(C===h.length-1){if(!j)return;y===null?i.push(`M${C+d},${b+d} h1v1H${C+d}z`):i.push(`M${y+d},${b+d} h${C+1-y}v1H${y+d}z`);return}j&&y===null&&(y=C)})}),i.join("")}function vt(c,d){return c.slice().map((i,h)=>h<d.y||h>=d.y+d.h?i:i.map((b,y)=>y<d.x||y>=d.x+d.w?b:!1))}function Wt(c,d,i,h){if(h==null)return null;const b=c.length+i*2,y=Math.floor(d*Yt),j=b/d,C=(h.width||y)*j,e=(h.height||y)*j,s=h.x==null?c.length/2-C/2:h.x*j,n=h.y==null?c.length/2-e/2:h.y*j,o=h.opacity==null?1:h.opacity;let u=null;if(h.excavate){let f=Math.floor(s),p=Math.floor(n),w=Math.ceil(C+s-f),L=Math.ceil(e+n-p);u={x:f,y:p,w,h:L}}const l=h.crossOrigin;return{x:s,y:n,h:e,w:C,excavation:u,opacity:o,crossOrigin:l}}function Vt(c,d){return d!=null?Math.max(Math.floor(d),0):c?Gt:Ht}function wt({value:c,level:d,minVersion:i,includeMargin:h,marginSize:b,imageSettings:y,size:j,boostLevel:C}){let e=_.useMemo(()=>{const f=(Array.isArray(c)?c:[c]).reduce((p,w)=>(p.push(...ie.QrSegment.makeSegments(w)),p),[]);return ie.QrCode.encodeSegments(f,Qt[d],i,void 0,void 0,C)},[c,d,i,C]);const{cells:s,margin:n,numCells:o,calculatedImageSettings:u}=_.useMemo(()=>{let l=e.getModules();const f=Vt(h,b),p=l.length+f*2,w=Wt(l,j,f,y);return{cells:l,margin:f,numCells:p,calculatedImageSettings:w}},[e,j,y,h,b]);return{qrcode:e,margin:n,cells:s,numCells:o,calculatedImageSettings:u}}var Kt=(function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0})(),Xt=_.forwardRef(function(d,i){const h=d,{value:b,size:y=ut,level:j=mt,bgColor:C=ht,fgColor:e=ft,includeMargin:s=gt,minVersion:n=pt,boostLevel:o,marginSize:u,imageSettings:l}=h,p=Pe(h,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","marginSize","imageSettings"]),{style:w}=p,L=Pe(p,["style"]),M=l==null?void 0:l.src,m=_.useRef(null),E=_.useRef(null),D=_.useCallback(U=>{m.current=U,typeof i=="function"?i(U):i&&(i.current=U)},[i]),[W,he]=_.useState(!1),{margin:X,cells:se,numCells:re,calculatedImageSettings:O}=wt({value:b,level:j,minVersion:n,boostLevel:o,includeMargin:s,marginSize:u,imageSettings:l,size:y});_.useEffect(()=>{if(m.current!=null){const U=m.current,$=U.getContext("2d");if(!$)return;let ce=se;const G=E.current,H=O!=null&&G!==null&&G.complete&&G.naturalHeight!==0&&G.naturalWidth!==0;H&&O.excavation!=null&&(ce=vt(se,O.excavation));const x=window.devicePixelRatio||1;U.height=U.width=y*x;const de=y/re*x;$.scale(de,de),$.fillStyle=C,$.fillRect(0,0,re,re),$.fillStyle=e,Kt?$.fill(new Path2D(xt(ce,X))):se.forEach(function(B,J){B.forEach(function(ve,ae){ve&&$.fillRect(ae+X,J+X,1,1)})}),O&&($.globalAlpha=O.opacity),H&&$.drawImage(G,O.x+X,O.y+X,O.w,O.h)}}),_.useEffect(()=>{he(!1)},[M]);const A=je({height:y,width:y},w);let le=null;return M!=null&&(le=_.createElement("img",{src:M,key:M,style:{display:"none"},onLoad:()=>{he(!0)},ref:E,crossOrigin:O==null?void 0:O.crossOrigin})),_.createElement(_.Fragment,null,_.createElement("canvas",je({style:A,height:y,width:y,ref:D,role:"img"},L)),le)});Xt.displayName="QRCodeCanvas";var Re=_.forwardRef(function(d,i){const h=d,{value:b,size:y=ut,level:j=mt,bgColor:C=ht,fgColor:e=ft,includeMargin:s=gt,minVersion:n=pt,boostLevel:o,title:u,marginSize:l,imageSettings:f}=h,p=Pe(h,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","title","marginSize","imageSettings"]),{margin:w,cells:L,numCells:M,calculatedImageSettings:m}=wt({value:b,level:j,minVersion:n,boostLevel:o,includeMargin:s,marginSize:l,imageSettings:f,size:y});let E=L,D=null;f!=null&&m!=null&&(m.excavation!=null&&(E=vt(L,m.excavation)),D=_.createElement("image",{href:f.src,height:m.h,width:m.w,x:m.x+w,y:m.y+w,preserveAspectRatio:"none",opacity:m.opacity,crossOrigin:m.crossOrigin}));const W=xt(E,w);return _.createElement("svg",je({height:y,width:y,viewBox:`0 0 ${M} ${M}`,ref:i,role:"img"},p),!!u&&_.createElement("title",null,u),_.createElement("path",{fill:C,d:`M0,0 h${M}v${M}H0z`,shapeRendering:"crispEdges"}),_.createElement("path",{fill:e,d:W,shapeRendering:"crispEdges"}),D)});Re.displayName="QRCodeSVG";const q="__custom__",Se=["weixin","lark"],Ae=[{id:"openai",label:"OpenAI",name:"openai",base_url:"https://api.openai.com/v1",model:"gpt-4.1-mini"},{id:"openrouter",label:"OpenRouter",name:"openrouter",base_url:"https://openrouter.ai/api/v1",model:"openai/gpt-4.1-mini"},{id:"anthropic",label:"Anthropic",name:"anthropic",base_url:"https://api.anthropic.com/v1",model:"claude-3-5-haiku-latest"},{id:"minimax",label:"Minimax",name:"minimax",base_url:"https://api.minimax.chat/v1",model:"MiniMax-M2.5"},{id:"ollama",label:"Ollama",name:"ollama",base_url:"http://127.0.0.1:11434/v1",model:"qwen2.5-coder:7b"}];function F(c){return JSON.parse(JSON.stringify(c))}function oe(c){return Array.isArray(c.projects)||(c.projects=[]),c.projects}function qt(c){const d=new Set(c.map(h=>h.name).filter(Boolean));let i=c.length+1;for(;d.has(`project-${i}`);)i+=1;return{name:`project-${i}`,agentType:Bt,workDir:"",model:""}}function me(c){var d,i,h,b,y;return{...c,agent:{...c.agent,options:{...((d=c.agent)==null?void 0:d.options)||{},model:lt((i=c.agent)==null?void 0:i.type,String(((b=(h=c.agent)==null?void 0:h.options)==null?void 0:b.model)||""))},providers:((y=c.agent)==null?void 0:y.providers)||[]},platforms:c.platforms||[]}}function it(c,d){return d.includes(c)?c:q}function Jt(c){var d;return((d=Ae.find(i=>c.name===i.name||i.base_url&&c.base_url===i.base_url||i.model&&c.model===i.model&&c.name===i.name))==null?void 0:d.id)||q}function Zt(c,d){const i=Ae.find(h=>h.id===d);return i?{...c,name:i.name,base_url:i.base_url,model:i.model}:c}function Me(c="weixin"){var d;return{type:c,options:{instance_id:`${c}-${((d=crypto.randomUUID)==null?void 0:d.call(crypto))||Date.now().toString(36)}`}}}function te(c){var d;return String(((d=c==null?void 0:c.options)==null?void 0:d.instance_id)||"").trim()||"default"}function pe(c){const d=c.type==="feishu"?"lark":c.type,i=c.options&&typeof c.options=="object"?{...c.options}:{};return d==="weixin"?{type:d,options:{...i,instance_id:String(i.instance_id||"").trim()}}:d==="lark"?{type:d,options:{...i,instance_id:String(i.instance_id||"").trim(),app_id:String(i.app_id||"").trim(),app_secret:String(i.app_secret||"").trim(),card_actions:i.card_actions===!0}}:{type:d,options:i}}function en(c){var d;if(c.type==="weixin")return"WeChat QR login";if(c.type==="lark"){const i=String(((d=c.options)==null?void 0:d.app_id)||"").trim();return i?`App ID ${i}`:"App ID and secret required"}return"Custom platform"}function tn(c){var h,b;const d=String(((b=(h=c.agent)==null?void 0:h.options)==null?void 0:b.work_dir)||"").trim();return d?d.replace(/\/+$/,"").split("/").filter(Boolean).pop()||d:"No work directory"}function nn(c){return c==="success"?"border-primary/20 bg-primary/10 text-primary dark:border-primary/25 dark:bg-primary/10 dark:text-blue-200":c==="warning"?"border-amber-200 bg-amber-50 text-amber-700 dark:border-amber-400/20 dark:bg-amber-500/10 dark:text-amber-200":"border-red-200 bg-red-50 text-red-700 dark:border-red-400/20 dark:bg-red-500/10 dark:text-red-200"}function wn(){var Oe,Te,De,ze,Fe,Be,Ue,$e,Qe,Ge,He,Ye,We,Ve,Ke;const[c,d]=Rt(),i=c.get("project")||"",[h,b]=N.useState(null),[y,j]=N.useState(null),[C,e]=N.useState(0),[s,n]=N.useState("basic"),[o,u]=N.useState(null),[l,f]=N.useState(null),[p,w]=N.useState(null),[L,M]=N.useState(!1),[m,E]=N.useState(null),[D,W]=N.useState(!1),[he,X]=N.useState(!0),[se,re]=N.useState(""),[O,A]=N.useState(null),le=N.useRef(null),U=N.useRef(null),$=N.useRef(C),ce=N.useRef(""),G=N.useCallback(async(t="")=>{X(!0);try{const a=await It(),g=F(a.parsed||{});if(g.projects=oe(g).map(v=>me(v)),b(g),j(F(g)),t){const v=(g.projects||[]).findIndex(R=>R.name===t);e(v>=0?v:0)}}catch(a){A({tone:"error",message:a instanceof Error?a.message:String(a)})}finally{X(!1)}},[]);N.useEffect(()=>{G(i)},[G]);const H=(h==null?void 0:h.projects)||[],x=H[C]||null,de=JSON.stringify(h||{})!==JSON.stringify(y||{});N.useEffect(()=>{le.current=h},[h]),N.useEffect(()=>{U.current=l},[l]),N.useEffect(()=>{$.current=C,ce.current=(x==null?void 0:x.name)||""},[C,x==null?void 0:x.name]),N.useEffect(()=>{if(!h||!i)return;const t=H.findIndex(a=>a.name===i);t>=0&&t!==C&&e(t)},[h,H,i,C]);const B=N.useCallback(t=>{b(a=>{if(!a)return a;const g=F(a),v=oe(g),R=v[C];return R?(v[C]=me(t(R)),g):a})},[C]),J=N.useCallback((t,a)=>{B(g=>{const v=[...g.agent.providers||[]],R=v[t];return R?(v[t]=a(R),{...g,agent:{...g.agent,providers:v}}):g})},[B]),ve=()=>{u(qt(H))},ae=t=>{u(a=>a&&{...a,...t})},bt=()=>{if(!o)return;const t=o.name.trim(),a=o.agentType.trim(),g=o.workDir.trim(),v=o.model.trim();if(!t||!a||!g){A({tone:"warning",message:"Project name, agent type, and work directory are required."});return}if(H.some(Y=>Y.name===t)){A({tone:"warning",message:`Project "${t}" already exists.`});return}const R=me({name:t,agent:{type:a,options:{model:v||Ee(a),work_dir:g},providers:[]},platforms:[],admin_from:"",disabled_commands:[]}),V=H.length;b(Y=>{const T=F(Y||{});return oe(T).push(R),T}),e(V),d({project:t}),u(null),A(null)},yt=t=>{b(a=>{if(!a)return a;const g=F(a),v=oe(g);return v.splice(t,1),e(Math.max(0,Math.min(t,v.length-1))),g})},_e=t=>{var g;if(w(null),E(null),t===null){f({index:t,draft:Me()});return}const a=(g=x==null?void 0:x.platforms)==null?void 0:g[t];a&&f({index:t,draft:F(a)})},Z=t=>{f(a=>a&&{...a,draft:t(a.draft)})},Ct=()=>{if(!l)return;const t=pe(l.draft);B(a=>{const g=[...a.platforms||[]];return l.index===null?g.push(t):g[l.index]=t,{...a,platforms:g}}),f(null),w(null),E(null)},Ie=async()=>{if(!l||!h)return l==null?void 0:l.draft;const t=F(h),a=oe(t),g=a[C];if(!g)return l.draft;const v=[...g.platforms||[]],R=pe(l.draft);l.index===null?v.push(R):v[l.index]=R,a[C]=me({...g,platforms:v});const V=await Ce(t),Y=F(V.parsed||t);return j(Y),b(F(Y)),f(T=>T&&{index:T.index??v.length-1,draft:R}),R},kt=async()=>{if(!(!(x!=null&&x.name)||!h)){M(!0);try{await Ie();const t=await Tt(x.name,te(l==null?void 0:l.draft));w({...t,status:"wait",createdAt:Date.now()}),A(null)}catch(t){A({tone:"error",message:t instanceof Error?t.message:String(t)})}finally{M(!1)}}},Et=async()=>{if(!(!(x!=null&&x.name)||!h)){W(!0);try{await Ie();const t=await Dt(x.name,te(l==null?void 0:l.draft));E({...t,status:"wait",createdAt:Date.now()}),A(null)}catch(t){A({tone:"error",message:t instanceof Error?t.message:String(t)})}finally{W(!1)}}},Nt=async()=>{if(!(!(x!=null&&x.name)||!(p!=null&&p.ticket))){M(!0);try{const t=await zt(x.name,p.ticket,te(l==null?void 0:l.draft));w(a=>a&&{...a,status:t.status}),t.status==="confirmed"&&A({tone:"success",message:"WeChat QR code confirmed."})}catch(t){A({tone:"error",message:t instanceof Error?t.message:String(t)})}finally{M(!1)}}},Le=N.useCallback(async(t,a)=>{const g=await Lt(t,a);if(g.status!=="running"||g.connected!==!0)throw new Error(g.lastError||"Lark bot credentials were saved, but the gateway is not connected yet.");const v=await Ot(t,a);if(!v.success)throw new Error(v.error||"Lark bot credentials were saved, but the connection test failed.")},[]),we=N.useCallback(async t=>{var qe,Je,Ze;const a=ce.current,g=te((qe=U.current)==null?void 0:qe.draft),v=le.current;if(!v)return;const R=F(v),V=oe(R),Y=$.current,T=V[Y];if(!T)return;const S=[...T.platforms||[]],Q=U.current,K=(Q==null?void 0:Q.index)??S.findIndex(ee=>pe(ee).type==="lark"&&te(ee)===g),fe=K>=0?S[K]:(Q==null?void 0:Q.draft)||Me("lark"),be=pe({...fe,type:"lark",options:{...fe.options||{},instance_id:g,app_id:t.appId,app_secret:t.appSecret,verification_token:t.verificationToken||((Je=fe.options)==null?void 0:Je.verification_token)||"",encrypt_key:t.encryptKey||((Ze=fe.options)==null?void 0:Ze.encrypt_key)||"",card_actions:!0,subscribed_events:"im.message.receive_v1 card.action.trigger",subscribed_callbacks:"card.action.trigger"}});K>=0?S[K]=be:S.push(be),V[Y]=me({...T,platforms:S});const jt=await Ce(R),Xe=F(jt.parsed||R);j(Xe),b(F(Xe)),f(ee=>ee&&{...ee,index:ee.index??(K>=0?K:S.length-1),draft:be}),await Le(a,g),A({tone:"success",message:"Lark bot bound, saved, and ready to send messages."}),await G(a)},[Le,G]),St=async()=>{if(!(!(x!=null&&x.name)||!(m!=null&&m.ticket)||!h)){W(!0);try{const t=await st(x.name,m.ticket,te(l==null?void 0:l.draft));E(a=>{var g;return a&&{...a,status:t.status,botName:(g=t.credentials)==null?void 0:g.botName}}),t.status==="confirmed"&&t.credentials?await we(t.credentials):t.status==="expired"&&A({tone:"warning",message:"Lark QR code expired. Generate a new QR code and scan again."})}catch(t){A({tone:"error",message:t instanceof Error?t.message:String(t)})}finally{W(!1)}}};N.useEffect(()=>{if(!(x!=null&&x.name)||!(m!=null&&m.ticket)||(l==null?void 0:l.draft.type)!=="lark"||m.status&&!["wait","signed"].includes(m.status))return;let t=!1,a;const v=(m.createdAt||Date.now())+Math.max(m.expiresIn||0,1)*1e3,R=Math.max(3,Math.min(Number(m.interval||5)||5,15))*1e3,V=T=>{a=window.setTimeout(()=>{Y()},T)},Y=async()=>{var T;if(!t){if(Date.now()>=v){E(S=>(S==null?void 0:S.ticket)===m.ticket?{...S,status:"expired"}:S),A({tone:"warning",message:"Lark QR code expired. Generate a new QR code and scan again."});return}try{const S=await st(x.name,m.ticket,te((T=U.current)==null?void 0:T.draft));if(t)return;if(E(Q=>{var K;return(Q==null?void 0:Q.ticket)===m.ticket?{...Q,status:S.status,botName:(K=S.credentials)==null?void 0:K.botName}:Q}),S.status==="confirmed"&&S.credentials){await we(S.credentials);return}if(S.status==="expired"){A({tone:"warning",message:"Lark QR code expired. Generate a new QR code and scan again."});return}V(R)}catch(S){if(t)return;A({tone:"error",message:S instanceof Error?S.message:String(S)})}}};return V(Math.min(2e3,R)),()=>{t=!0,a&&window.clearTimeout(a)}},[m==null?void 0:m.createdAt,m==null?void 0:m.expiresIn,m==null?void 0:m.interval,m==null?void 0:m.status,m==null?void 0:m.ticket,l==null?void 0:l.draft.type,we,x==null?void 0:x.name]);const Mt=async()=>{if(h){re("config");try{const t=await Ce(h);j(F(t.parsed||h)),b(F(t.parsed||h)),A({tone:"success",message:"Project changes saved."}),await G()}catch(t){A({tone:"error",message:t instanceof Error?t.message:String(t)})}finally{re("")}}};return he&&!h?r.jsx("div",{className:"flex h-64 items-center justify-center text-sm text-slate-400 animate-pulse",children:"Loading workspace..."}):r.jsxs("div",{className:"space-y-6 animate-fade-in",children:[r.jsx(_t,{title:"工作区",description:"创建项目,配置 Agent、工作目录、Provider 和平台接入。"}),O?r.jsx("div",{role:"status",className:`rounded-xl border px-4 py-3 text-sm ${nn(O.tone)}`,children:O.message}):null,de?r.jsx("div",{className:"rounded-xl border border-amber-200 bg-amber-50 px-4 py-3 text-sm text-amber-700 dark:border-amber-400/20 dark:bg-amber-500/10 dark:text-amber-200",children:"You have unsaved project changes."}):null,r.jsxs("div",{className:"grid min-w-0 grid-cols-1 gap-4 lg:grid-cols-[340px_minmax(0,1fr)]",children:[r.jsx(tt,{title:"项目",actions:r.jsxs(I,{size:"sm",onClick:ve,children:[r.jsx(ue,{size:14})," 新建项目"]}),className:"lg:self-start",children:H.length===0?r.jsx(ye,{message:"还没有项目。"}):r.jsx("div",{className:"space-y-2",children:H.map((t,a)=>{var g,v;return r.jsxs("div",{className:`flex items-center justify-between gap-2 rounded-xl border px-3 py-2 transition-colors ${a===C?"border-accent/30 bg-accent/10":"border-black/10 hover:bg-black/[0.04] dark:border-white/[0.08] dark:hover:bg-white/[0.06]"}`,children:[r.jsxs("button",{type:"button",onClick:()=>{e(a),d(t.name?{project:t.name}:{})},className:"min-w-0 flex-1 text-left",children:[r.jsx("p",{className:"truncate text-sm font-medium text-slate-950 dark:text-white",children:t.name||`Project ${a+1}`}),r.jsxs("p",{className:"mt-0.5 truncate text-xs text-muted-foreground",children:[((g=t.agent)==null?void 0:g.type)||"unknown"," · ",tn(t)," · ",((v=t.platforms)==null?void 0:v.length)||0," platforms"]})]}),r.jsx(I,{variant:"ghost",size:"sm",onClick:()=>yt(a),"aria-label":`Remove ${t.name}`,children:r.jsx(Ne,{size:14})})]},`${t.name}-${a}`)})})}),r.jsx(tt,{title:(x==null?void 0:x.name)||"Project details",description:x?r.jsxs("span",{className:"break-all",children:[((Oe=x.agent)==null?void 0:Oe.type)||"unknown"," · ",String(((De=(Te=x.agent)==null?void 0:Te.options)==null?void 0:De.work_dir)||"No work directory")]}):void 0,children:x?r.jsxs("div",{className:"space-y-6",children:[r.jsx("div",{className:"flex gap-2 overflow-x-auto border-b border-black/10 pb-4 [scrollbar-width:none] dark:border-white/[0.08] [&::-webkit-scrollbar]:hidden sm:flex-wrap",children:[["basic","基本信息"],["providers","Provider"],["platforms","平台接入"]].map(([t,a])=>r.jsx("button",{type:"button",onClick:()=>n(t),className:`shrink-0 rounded-lg px-3 py-1.5 text-sm font-medium transition-colors ${s===t?"bg-accent text-white":"bg-black/[0.04] text-muted-foreground hover:bg-black/[0.07] hover:text-foreground dark:bg-white/[0.05] dark:hover:bg-white/[0.08]"}`,children:a},t))}),s==="basic"?r.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:[r.jsx(z,{label:"Project name",value:x.name,onChange:t=>B(a=>({...a,name:t.target.value}))}),r.jsxs(ge,{label:"Agent type",value:it(((ze=x.agent)==null?void 0:ze.type)||"",ke),onChange:t=>B(a=>{var v;const g=t.target.value===q?a.agent.type:t.target.value;return{...a,agent:{...a.agent,type:g,options:{...a.agent.options||{},model:lt(g,String(((v=a.agent.options)==null?void 0:v.model)||""))}}}}),children:[ke.map(t=>r.jsx("option",{value:t,children:t},t)),r.jsx("option",{value:q,children:"custom"})]}),r.jsx(z,{label:"Work directory",value:String(((Be=(Fe=x.agent)==null?void 0:Fe.options)==null?void 0:Be.work_dir)||""),onChange:t=>B(a=>({...a,agent:{...a.agent,options:{...a.agent.options||{},work_dir:t.target.value}}}))}),r.jsx(z,{label:"Default model",value:String((($e=(Ue=x.agent)==null?void 0:Ue.options)==null?void 0:$e.model)||""),onChange:t=>B(a=>({...a,agent:{...a.agent,options:{...a.agent.options||{},model:t.target.value}}})),placeholder:Ee((Qe=x.agent)==null?void 0:Qe.type)||"Use agent default model"})]}):null,s==="providers"?r.jsxs("section",{className:"space-y-3",children:[r.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[r.jsxs("div",{children:[r.jsx("h3",{className:"text-sm font-semibold text-slate-950 dark:text-white",children:"Providers"}),r.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Basic endpoint and default model only."})]}),r.jsxs(I,{size:"sm",variant:"secondary",onClick:()=>B(t=>({...t,agent:{...t.agent,providers:[...t.agent.providers||[],{name:`provider-${(t.agent.providers||[]).length+1}`}]}})),children:[r.jsx(ue,{size:14})," Provider"]})]}),(x.agent.providers||[]).length===0?r.jsxs("div",{className:"flex flex-col gap-3 rounded-xl border border-black/10 px-4 py-4 dark:border-white/[0.08] sm:flex-row sm:items-center sm:justify-between",children:[r.jsx("p",{className:"text-sm text-muted-foreground",children:"No providers configured."}),r.jsxs(I,{size:"sm",variant:"secondary",onClick:()=>B(t=>({...t,agent:{...t.agent,providers:[...t.agent.providers||[],{name:`provider-${(t.agent.providers||[]).length+1}`}]}})),children:[r.jsx(ue,{size:14})," Add provider"]})]}):r.jsx("div",{className:"space-y-3",children:(x.agent.providers||[]).map((t,a)=>r.jsx("div",{className:"rounded-xl border border-black/10 p-4 dark:border-white/[0.08]",children:r.jsxs("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2",children:[r.jsxs(ge,{label:"Preset",value:Jt(t),onChange:g=>{g.target.value!==q&&J(a,v=>Zt(v,g.target.value))},children:[Ae.map(g=>r.jsx("option",{value:g.id,children:g.label},g.id)),r.jsx("option",{value:q,children:"custom"})]}),r.jsx(z,{label:"Name",value:t.name||"",onChange:g=>J(a,v=>({...v,name:g.target.value}))}),r.jsx(z,{label:"API key",type:"password",value:t.api_key||"",onChange:g=>J(a,v=>({...v,api_key:g.target.value}))}),r.jsx(z,{label:"Base URL",value:t.base_url||"",onChange:g=>J(a,v=>({...v,base_url:g.target.value}))}),r.jsx(z,{label:"Default model",value:t.model||"",onChange:g=>J(a,v=>({...v,model:g.target.value}))}),r.jsx("div",{className:"flex items-end",children:r.jsxs(I,{variant:"danger",size:"sm",onClick:()=>B(g=>{const v=[...g.agent.providers||[]];return v.splice(a,1),{...g,agent:{...g.agent,providers:v}}}),children:[r.jsx(Ne,{size:14})," Remove"]})})]})},`${t.name}-${a}`))})]}):null,s==="platforms"?r.jsxs("section",{className:"space-y-3",children:[r.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[r.jsxs("div",{children:[r.jsx("h3",{className:"text-sm font-semibold text-slate-950 dark:text-white",children:"Platforms"}),r.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Configure each platform with its own required connection fields."})]}),r.jsxs(I,{size:"sm",variant:"secondary",onClick:()=>_e(null),children:[r.jsx(ue,{size:14})," Platform"]})]}),(x.platforms||[]).length===0?r.jsx(ye,{message:"No platforms configured."}):r.jsx("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2",children:(x.platforms||[]).map((t,a)=>r.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-xl border border-black/10 p-3 dark:border-white/[0.08]",children:[r.jsxs("div",{className:"min-w-0",children:[r.jsx("p",{className:"truncate text-sm font-medium text-slate-950 dark:text-white",children:t.type}),r.jsx("p",{className:"mt-1 truncate text-xs text-muted-foreground",children:en(t)})]}),r.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[r.jsx(I,{variant:"secondary",size:"sm",onClick:()=>_e(a),"aria-label":`Configure ${t.type}`,children:r.jsx(At,{size:14})}),r.jsx(I,{variant:"danger",size:"sm",onClick:()=>B(g=>{const v=[...g.platforms||[]];return v.splice(a,1),{...g,platforms:v}}),children:r.jsx(Ne,{size:14})})]})]},`${t.type}-${a}`))})]}):null,r.jsx("div",{className:"flex flex-wrap gap-2 border-t border-black/10 pt-5 dark:border-white/[0.08]",children:r.jsxs(I,{className:"w-full sm:w-auto",onClick:()=>void Mt(),loading:se==="config",disabled:!de&&se!=="config",children:[r.jsx(rt,{size:14})," 保存更改"]})})]}):r.jsx(ye,{message:"选择或新建项目后开始配置。"})})]}),r.jsx(et,{open:!!o,onClose:()=>u(null),title:"新建项目",children:o?r.jsxs("div",{className:"space-y-4",children:[r.jsx(z,{label:"Project name",value:o.name,onChange:t=>ae({name:t.target.value}),autoFocus:!0}),r.jsx(ge,{label:"Agent type",value:o.agentType,onChange:t=>{const a=t.target.value;ae({agentType:a})},children:ke.map(t=>r.jsx("option",{value:t,children:t},t))}),r.jsx(z,{label:"Work directory",value:o.workDir,onChange:t=>ae({workDir:t.target.value}),placeholder:"/Users/yinyin/code/my-project"}),r.jsx(z,{label:"Default model",value:o.model,onChange:t=>ae({model:t.target.value}),placeholder:Ee(o.agentType)||"Use agent default model"}),r.jsxs("div",{className:"flex flex-col-reverse gap-2 pt-2 sm:flex-row sm:justify-end",children:[r.jsx(I,{className:"w-full sm:w-auto",variant:"secondary",onClick:()=>u(null),children:"Cancel"}),r.jsxs(I,{className:"w-full sm:w-auto",onClick:bt,children:[r.jsx(ue,{size:14})," 新建项目"]})]})]}):null}),r.jsx(et,{open:!!l,onClose:()=>{f(null),w(null),E(null)},title:(l==null?void 0:l.index)===null?"Add platform":"Configure platform",children:l?r.jsxs("div",{className:"space-y-4",children:[r.jsxs(ge,{label:"Platform",value:it(l.draft.type,[...Se]),onChange:t=>{const a=t.target.value===q?l.draft.type:t.target.value;Z(()=>Me(a)),w(null),E(null)},children:[Se.map(t=>r.jsx("option",{value:t,children:t},t)),Ft.filter(t=>!Se.includes(t)).map(t=>r.jsx("option",{value:t,children:t},t)),r.jsx("option",{value:q,children:"custom"})]}),l.draft.type==="lark"?r.jsxs("div",{className:"grid grid-cols-1 gap-3",children:[m!=null&&m.qrCodeUrl?r.jsxs("div",{className:"flex flex-col items-center gap-3 rounded-lg border border-black/10 p-4 dark:border-white/[0.08]",children:[r.jsx("div",{className:"rounded-lg border border-black/10 bg-white p-3",children:r.jsx(Re,{value:m.qrCodeUrl,size:176,includeMargin:!0})}),r.jsx(nt,{tone:m.status==="confirmed"?"success":m.status==="expired"?"danger":"warning",children:m.botName||m.status||"wait"})]}):null,r.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:flex-wrap",children:[r.jsxs(I,{className:"w-full sm:w-auto",variant:"secondary",onClick:()=>void Et(),loading:D,children:[r.jsx(at,{size:14})," Generate QR"]}),r.jsx(I,{className:"w-full sm:w-auto",variant:"secondary",onClick:()=>void St(),loading:D,disabled:!(m!=null&&m.ticket),children:"Check status"})]}),r.jsx(z,{label:"App ID",value:String(((Ge=l.draft.options)==null?void 0:Ge.app_id)||""),onChange:t=>Z(a=>({...a,options:{...a.options||{},app_id:t.target.value}})),placeholder:"cli_xxx"}),r.jsx(z,{label:"App Secret",type:"password",value:String(((He=l.draft.options)==null?void 0:He.app_secret)||""),onChange:t=>Z(a=>({...a,options:{...a.options||{},app_secret:t.target.value}}))}),r.jsx(z,{label:"Verification token",value:String(((Ye=l.draft.options)==null?void 0:Ye.verification_token)||""),onChange:t=>Z(a=>({...a,options:{...a.options||{},verification_token:t.target.value}}))}),r.jsx(z,{label:"Encrypt key",value:String(((We=l.draft.options)==null?void 0:We.encrypt_key)||""),onChange:t=>Z(a=>({...a,options:{...a.options||{},encrypt_key:t.target.value}}))}),r.jsxs("label",{className:"flex items-center gap-3 text-sm text-foreground",children:[r.jsx("input",{type:"checkbox",checked:((Ve=l.draft.options)==null?void 0:Ve.auto_approve)===!0,onChange:t=>Z(a=>({...a,options:{...a.options||{},auto_approve:t.target.checked}}))}),"Auto-approve Lark users"]}),r.jsxs("label",{className:"flex items-center gap-3 text-sm text-foreground",children:[r.jsx("input",{type:"checkbox",checked:((Ke=l.draft.options)==null?void 0:Ke.card_actions)===!0,onChange:t=>Z(a=>({...a,options:{...a.options||{},card_actions:t.target.checked}}))}),"Enable Lark card action buttons"]})]}):null,l.draft.type==="weixin"?r.jsxs("div",{className:"space-y-3",children:[r.jsx("div",{className:"rounded-lg border border-black/10 bg-black/[0.03] px-3 py-3 text-sm text-muted-foreground dark:border-white/[0.08] dark:bg-white/[0.04]",children:"WeChat does not need an App ID or secret. Save this platform, then generate a QR code and scan it to finish login."}),p!=null&&p.qrCodeUrl?r.jsxs("div",{className:"flex flex-col items-center gap-3 rounded-lg border border-black/10 p-4 dark:border-white/[0.08]",children:[r.jsx("div",{className:"rounded-lg border border-black/10 bg-white p-3",children:r.jsx(Re,{value:p.qrCodeUrl,size:176,includeMargin:!0})}),r.jsx(nt,{tone:p.status==="confirmed"?"success":p.status==="expired"?"danger":"warning",children:p.status||"wait"})]}):null,r.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:flex-wrap",children:[r.jsxs(I,{className:"w-full sm:w-auto",variant:"secondary",onClick:()=>void kt(),loading:L,children:[r.jsx(at,{size:14})," Generate QR"]}),r.jsx(I,{className:"w-full sm:w-auto",variant:"secondary",onClick:()=>void Nt(),loading:L,disabled:!(p!=null&&p.ticket),children:"Check status"})]})]}):null,l.draft.type!=="lark"&&l.draft.type!=="weixin"?r.jsx("div",{className:"rounded-lg border border-black/10 bg-black/[0.03] px-3 py-3 text-sm text-muted-foreground dark:border-white/[0.08] dark:bg-white/[0.04]",children:"This platform has no daily UI fields yet. Existing advanced options are preserved in config."}):null,r.jsxs("div",{className:"flex flex-col-reverse gap-2 border-t border-black/10 pt-4 dark:border-white/[0.08] sm:flex-row sm:justify-end",children:[r.jsx(I,{className:"w-full sm:w-auto",variant:"secondary",onClick:()=>f(null),children:"Cancel"}),r.jsxs(I,{className:"w-full sm:w-auto",onClick:Ct,children:[r.jsx(rt,{size:14})," Apply"]})]})]}):null})]})}export{wn as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{V as l,P as d,X as c,Y as u,_ as h,$ as C,a0 as k,a1 as w,a2 as p,a3 as v,a4 as S,a5 as m,a6 as L,a7 as y,a8 as P,a9 as f,aa as R,ab as b,ac as G,ad as Q,ae as B,af as A,ag as F,ah as E,ai as I,aj as W,ak as D,al as K,am as T,an as x,ao as $,ap as j,aq as U,m as i,i as z,ar as _,as as q,at as M,au as V,av as X,aw as Y,ax as H,ay as J,g as N}from"./index-Biz-aexG.js";function s(){if(!window.desktop)throw new Error("Desktop APIs are unavailable in the browser build");return window.desktop}const O={getRuntimeStatus:()=>s().getRuntimeStatus(),startService:()=>s().startService(),stopService:()=>s().stopService(),restartService:()=>s().restartService(),getLogs:e=>s().getLogs(e),listInstalledAgentRuntimes:()=>x().then(e=>e.runtimes),refreshInstalledAgentRuntimes:()=>T().then(e=>e.runtimes),readConfigFile:()=>s().readConfigFile(),saveRawConfigFile:e=>s().saveRawConfigFile(e),saveStructuredConfigFile:e=>s().saveStructuredConfigFile(e),getThreadKnowledgeBases:(e,a)=>s().getThreadKnowledgeBases(e,a),updateThreadKnowledgeBases:(e,a,t)=>s().updateThreadKnowledgeBases(e,a,t),deleteThreadKnowledgeBases:(e,a)=>s().deleteThreadKnowledgeBases(e,a),saveSettings:e=>s().saveSettings(e),getCapabilitySnapshot:()=>K(),getPluginDiagnostics:()=>D(),listChannelGateways:e=>W(e).then(a=>a.gateways),getChannelGatewayStatus:(e,a,t)=>I(e,a,t),testChannelConnection:(e,a,t)=>E(e,a,t),enableChannelGateway:(e,a,t)=>F(e,a,t),disableChannelGateway:(e,a,t)=>A(e,a,t),listChannelPendingPairings:(e,a)=>B(e,a).then(t=>t.pairings),approveChannelPairing:(e,a)=>Q(e,a),rejectChannelPairing:(e,a)=>G(e,a),listChannelAuthorizedUsers:(e,a)=>b(e,a).then(t=>t.users),getChannelQrCode:(e,a,t)=>R(e,a,t),checkChannelQrCodeStatus:(e,a,t,r)=>f(e,a,t,r),getWeixinQrCode:(e,a)=>P(e,a),checkWeixinQrCodeStatus:(e,a,t)=>y(e,a,t),getLarkQrCode:(e,a)=>L(e,a),checkLarkQrCodeStatus:(e,a,t)=>m(e,a,t),listLarkGateways:()=>S().then(e=>e.gateways),getLarkGatewayStatus:(e,a)=>v(e,a),testLarkConnection:(e,a)=>p(e,a),enableLarkGateway:(e,a)=>w(e,a),disableLarkGateway:(e,a)=>k(e,a),listLarkPendingPairings:e=>C(e).then(a=>a.pairings),approveLarkPairing:e=>h(e),rejectLarkPairing:e=>u(e),listLarkAuthorizedUsers:e=>c(e).then(a=>a.users),probeWorkspaceStreaming:e=>s().probeWorkspaceStreaming(e),onRuntimeEvent:e=>s().onRuntimeEvent(e),onRuntimeDetectionEvent:e=>d(a=>{(a.type.startsWith("runtime.detect.")||a.type==="runtime.status.changed")&&e(a)}),onBridgeEvent:e=>l(e)},o={getRuntimeStatus:()=>J(),startService:()=>H(),stopService:()=>Y(),restartService:()=>X(),getLogs:e=>V(e),listInstalledAgentRuntimes:()=>x().then(e=>e.runtimes),refreshInstalledAgentRuntimes:()=>T().then(e=>e.runtimes),readConfigFile:()=>M(),saveRawConfigFile:e=>q(e),saveStructuredConfigFile:e=>_(e),getThreadKnowledgeBases:(e,a)=>z(a).then(t=>t.selectedKnowledgeBaseIds||[]),updateThreadKnowledgeBases:(e,a,t)=>i(a,t).then(r=>r.knowledgeBaseIds),deleteThreadKnowledgeBases:(e,a)=>i(a,[]).then(()=>({deleted:!0})),saveSettings:e=>U(e),getCapabilitySnapshot:()=>K(),getPluginDiagnostics:()=>D(),listChannelGateways:e=>W(e).then(a=>a.gateways),getChannelGatewayStatus:(e,a,t)=>I(e,a,t),testChannelConnection:(e,a,t)=>E(e,a,t),enableChannelGateway:(e,a,t)=>F(e,a,t),disableChannelGateway:(e,a,t)=>A(e,a,t),listChannelPendingPairings:(e,a)=>B(e,a).then(t=>t.pairings),approveChannelPairing:(e,a)=>Q(e,a),rejectChannelPairing:(e,a)=>G(e,a),listChannelAuthorizedUsers:(e,a)=>b(e,a).then(t=>t.users),getChannelQrCode:(e,a,t)=>R(e,a,t),checkChannelQrCodeStatus:(e,a,t,r)=>f(e,a,t,r),getWeixinQrCode:(e,a)=>P(e,a),checkWeixinQrCodeStatus:(e,a,t)=>y(e,a,t),getLarkQrCode:(e,a)=>L(e,a),checkLarkQrCodeStatus:(e,a,t)=>m(e,a,t),listLarkGateways:()=>S().then(e=>e.gateways),getLarkGatewayStatus:(e,a)=>v(e,a),testLarkConnection:(e,a)=>p(e,a),enableLarkGateway:(e,a)=>w(e,a),disableLarkGateway:(e,a)=>k(e,a),listLarkPendingPairings:e=>C(e).then(a=>a.pairings),approveLarkPairing:e=>h(e),rejectLarkPairing:e=>u(e),listLarkAuthorizedUsers:e=>c(e).then(a=>a.users),probeWorkspaceStreaming:e=>j(e),onRuntimeEvent:e=>$(e),onRuntimeDetectionEvent:e=>d(a=>{(a.type.startsWith("runtime.detect.")||a.type==="runtime.status.changed")&&e(a)}),onBridgeEvent:e=>l(e)};let g=null;function Z(e){return e==="electron"&&window.desktop?O:o}function n(){const e=g||Z(N());if(!e)throw new Error("Managed desktop APIs are unavailable in this build");return g=e,e}const ae=()=>n().getRuntimeStatus(),te=()=>n().startService(),ne=()=>n().listInstalledAgentRuntimes(),se=()=>n().refreshInstalledAgentRuntimes(),re=()=>n().readConfigFile(),ie=e=>n().saveStructuredConfigFile(e),oe=(e,a,t)=>n().updateThreadKnowledgeBases(e,a,t),ge=e=>n().saveSettings(e),le=()=>n().getPluginDiagnostics(),de=(e,a)=>n().getWeixinQrCode(e,a),ce=(e,a,t)=>n().checkWeixinQrCodeStatus(e,a,t),ue=(e,a)=>n().getLarkQrCode(e,a),he=(e,a,t)=>n().checkLarkQrCodeStatus(e,a,t),Ce=(e,a)=>n().testLarkConnection(e,a),ke=(e,a)=>n().enableLarkGateway(e,a),we=e=>n().onRuntimeEvent(e),pe=e=>n().onRuntimeDetectionEvent(e),ve=e=>n().onBridgeEvent(e);export{pe as a,ve as b,re as c,ie as d,ke as e,de as f,ae as g,ue as h,ce as i,he as j,le as k,ne as l,ge as m,we as o,se as r,te as s,Ce as t,oe as u};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const h="opencode",
|
|
1
|
+
const h="opencode",s="opencode/minimax-m2.5-free";const w=["opencode","codex","claudecode","cursor","gemini","qoder","iflow","localcore-acp"],_=["telegram","feishu","lark","discord","slack","dingtalk","wecom","weixin","qq","qqbot","line"],n=["opencode","codex","claudecode","acp","localcore-acp"],c="localcore-acp",i=["[Scheduler Tools]","If the user asks to create, view, edit, delete, or manually run a scheduled task for this conversation, use the Bash tool to run the local scheduler CLI.","Use these commands:",'lac scheduler add --cron "<5-field cron>" --message "<exact message to send>" --desc "<short label>" [--execution-mode same-thread|side-thread]',"lac scheduler list","lac scheduler list --thread","lac scheduler info <job-id>",'lac scheduler edit <job-id> [--cron "<5-field cron>"] [--message "<exact message>"] [--desc "<short label>"] [--enabled true|false] [--execution-mode same-thread|side-thread]',"lac scheduler del <job-id>","lac scheduler run <job-id>","Environment variables LOCAL_AI_WORKSPACE_ID, LOCAL_AI_THREAD_ID, LOCAL_AI_PLATFORM, LOCAL_AI_CHAT_ID, and LOCAL_AI_PLATFORM_USER_ID are already set when available.","Prefer relying on those variables instead of inventing your own route or creating session-only cron jobs.","By default, `lac scheduler list` shows all scheduled tasks in the current workspace. Use `lac scheduler list --thread` to show only the current conversation thread.","Use `--execution-mode same-thread` to reuse the current thread, or `--execution-mode side-thread` to run in a dedicated scheduled thread.","Only use the scheduler CLI when the user explicitly asks for scheduled automation.","[/Scheduler Tools]"].join(`
|
|
2
2
|
`),d=["[Channel Tools]","If the user asks you to send a local file back through the current channel conversation, use the Bash tool to run the local channel CLI.","Use this command:",'lac channel send-file --path "<absolute-or-workdir-relative-file-path>" [--target "<channel-chat-or-user-id>"]',"By default, the file is sent to the current platform conversation from LOCAL_AI_CHAT_ID.","Use --target only when the user explicitly names a different channel chat or user id.","The CLI accepts absolute paths. Check that the file exists before sending when practical.","Only use the channel CLI when the user explicitly asks to send a file through the channel.","[/Channel Tools]"].join(`
|
|
3
|
-
`),u={allow:"allow",deny:"deny","allow all":"allow all",allowall:"allow all","perm:allow":"allow","perm:deny":"deny","perm:allow_all":"allow all"};function
|
|
4
|
-
`)}function
|
|
3
|
+
`),u={allow:"allow",deny:"deny","allow all":"allow all",allowall:"allow all",allow_all:"allow all",allow_always:"allow all",always:"allow all",always_allow:"allow all","always allow":"allow all","allow always":"allow all",始终允许:"allow all",永久允许:"allow all","perm:allow":"allow","perm:deny":"deny","perm:allow_all":"allow all","perm:allow_always":"allow all","perm:always":"allow all"};function f(e,a=[]){return[i,"",d,...a.flatMap(l=>l?["",l]:[]),"","[User Message]",e,"[/User Message]"].join(`
|
|
4
|
+
`)}function m(e){switch(String(e||"").trim().toLowerCase()){case"opencode":return s;case"claudecode":return"";default:return""}}function O(e,a){const l=String(e||"").trim().toLowerCase(),t=String(a||"").trim();return l?l==="opencode"?t||s:l==="claudecode"&&t.startsWith("opencode/")?"":t:t}function r(e){return e&&u[String(e).trim().toLowerCase()]||null}function T(e){return!!r(e==null?void 0:e.data)}function E(e){if(!e||typeof e!="object")return null;const a=e,l=typeof a.text=="string"?a.text:typeof a.Text=="string"?a.Text:"",t=typeof a.data=="string"?a.data:typeof a.Data=="string"?a.Data:"";if(!l||!t)return null;const o=r(t);return o?{text:o,data:o}:{text:l,data:t}}function p(e){return e?n.includes(String(e).trim().toLowerCase()):!1}function L(e){const a=String(e||"").trim().toLowerCase();return a==="acp"||a==="opencode"||a==="codex"||a==="claudecode"||a===c}export{w as D,r as a,L as b,O as c,_ as d,h as e,m as g,T as i,E as n,p as s,f as w};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{G as Le,aG as Ne,r as c,j as x,aH as pe,aI as Ae,aw as te}from"./index-BC3MWbS1.js";var ye=Ne();const De=Le(ye);function H(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function Jt(e,t){const n=c.createContext(t),r=i=>{const{children:s,...a}=i,h=c.useMemo(()=>a,Object.values(a));return x.jsx(n.Provider,{value:h,children:s})};r.displayName=e+"Provider";function o(i){const s=c.useContext(n);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[r,o]}function en(e,t=[]){let n=[];function r(i,s){const a=c.createContext(s),h=n.length;n=[...n,s];const l=d=>{var p;const{scope:v,children:y,...w}=d,u=((p=v==null?void 0:v[e])==null?void 0:p[h])||a,m=c.useMemo(()=>w,Object.values(w));return x.jsx(u.Provider,{value:m,children:y})};l.displayName=i+"Provider";function f(d,v){var u;const y=((u=v==null?void 0:v[e])==null?void 0:u[h])||a,w=c.useContext(y);if(w)return w;if(s!==void 0)return s;throw new Error(`\`${d}\` must be used within \`${i}\``)}return[l,f]}const o=()=>{const i=n.map(s=>c.createContext(s));return function(a){const h=(a==null?void 0:a[e])||i;return c.useMemo(()=>({[`__scope${e}`]:{...a,[e]:h}}),[a,h])}};return o.scopeName=e,[r,ke(o,...t)]}function ke(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=r.reduce((a,{useScope:h,scopeName:l})=>{const d=h(i)[`__scope${l}`];return{...a,...d}},{});return c.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}var ne=globalThis!=null&&globalThis.document?c.useLayoutEffect:()=>{},Fe=pe[" useId ".trim().toString()]||(()=>{}),Me=0;function tn(e){const[t,n]=c.useState(Fe());return ne(()=>{n(r=>r??String(Me++))},[e]),e||(t?`radix-${t}`:"")}var Ie=pe[" useInsertionEffect ".trim().toString()]||ne;function nn({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,i,s]=We({defaultProp:t,onChange:n}),a=e!==void 0,h=a?e:o;{const f=c.useRef(e!==void 0);c.useEffect(()=>{const d=f.current;d!==a&&console.warn(`${r} is changing from ${d?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),f.current=a},[a,r])}const l=c.useCallback(f=>{var d;if(a){const v=Be(f)?f(e):f;v!==e&&((d=s.current)==null||d.call(s,v))}else i(f)},[a,e,i,s]);return[h,l]}function We({defaultProp:e,onChange:t}){const[n,r]=c.useState(e),o=c.useRef(n),i=c.useRef(t);return Ie(()=>{i.current=t},[t]),c.useEffect(()=>{var s;o.current!==n&&((s=i.current)==null||s.call(i,n),o.current=n)},[n,o]),[n,r,i]}function Be(e){return typeof e=="function"}function _e(e){const t=je(e),n=c.forwardRef((r,o)=>{const{children:i,...s}=r,a=c.Children.toArray(i),h=a.find($e);if(h){const l=h.props.children,f=a.map(d=>d===h?c.Children.count(l)>1?c.Children.only(null):c.isValidElement(l)?l.props.children:null:d);return x.jsx(t,{...s,ref:o,children:c.isValidElement(l)?c.cloneElement(l,void 0,f):null})}return x.jsx(t,{...s,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}function je(e){const t=c.forwardRef((n,r)=>{const{children:o,...i}=n;if(c.isValidElement(o)){const s=Ke(o),a=Ve(i,o.props);return o.type!==c.Fragment&&(a.ref=r?Ae(r,s):s),c.cloneElement(o,a)}return c.Children.count(o)>1?c.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Ue=Symbol("radix.slottable");function $e(e){return c.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Ue}function Ve(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{const h=i(...a);return o(...a),h}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function Ke(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var He=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],V=He.reduce((e,t)=>{const n=_e(`Primitive.${t}`),r=c.forwardRef((o,i)=>{const{asChild:s,...a}=o,h=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),x.jsx(h,{...a,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Xe(e,t){e&&ye.flushSync(()=>e.dispatchEvent(t))}function M(e){const t=c.useRef(e);return c.useEffect(()=>{t.current=e}),c.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function Ye(e,t=globalThis==null?void 0:globalThis.document){const n=M(e);c.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var ze="DismissableLayer",J="dismissableLayer.update",Ge="dismissableLayer.pointerDownOutside",Ze="dismissableLayer.focusOutside",oe,Ee=c.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),qe=c.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,onDismiss:a,...h}=e,l=c.useContext(Ee),[f,d]=c.useState(null),v=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,y]=c.useState({}),w=te(t,E=>d(E)),u=Array.from(l.layers),[m]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),p=u.indexOf(m),g=f?u.indexOf(f):-1,b=l.layersWithOutsidePointerEventsDisabled.size>0,S=g>=p,C=et(E=>{const T=E.target,L=[...l.branches].some(F=>F.contains(T));!S||L||(o==null||o(E),s==null||s(E),E.defaultPrevented||a==null||a())},v),P=tt(E=>{const T=E.target;[...l.branches].some(F=>F.contains(T))||(i==null||i(E),s==null||s(E),E.defaultPrevented||a==null||a())},v);return Ye(E=>{g===l.layers.size-1&&(r==null||r(E),!E.defaultPrevented&&a&&(E.preventDefault(),a()))},v),c.useEffect(()=>{if(f)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(oe=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(f)),l.layers.add(f),ae(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(v.body.style.pointerEvents=oe)}},[f,v,n,l]),c.useEffect(()=>()=>{f&&(l.layers.delete(f),l.layersWithOutsidePointerEventsDisabled.delete(f),ae())},[f,l]),c.useEffect(()=>{const E=()=>y({});return document.addEventListener(J,E),()=>document.removeEventListener(J,E)},[]),x.jsx(V.div,{...h,ref:w,style:{pointerEvents:b?S?"auto":"none":void 0,...e.style},onFocusCapture:H(e.onFocusCapture,P.onFocusCapture),onBlurCapture:H(e.onBlurCapture,P.onBlurCapture),onPointerDownCapture:H(e.onPointerDownCapture,C.onPointerDownCapture)})});qe.displayName=ze;var Qe="DismissableLayerBranch",Je=c.forwardRef((e,t)=>{const n=c.useContext(Ee),r=c.useRef(null),o=te(t,r);return c.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),x.jsx(V.div,{...e,ref:o})});Je.displayName=Qe;function et(e,t=globalThis==null?void 0:globalThis.document){const n=M(e),r=c.useRef(!1),o=c.useRef(()=>{});return c.useEffect(()=>{const i=a=>{if(a.target&&!r.current){let h=function(){ge(Ge,n,l,{discrete:!0})};const l={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=h,t.addEventListener("click",o.current,{once:!0})):h()}else t.removeEventListener("click",o.current);r.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function tt(e,t=globalThis==null?void 0:globalThis.document){const n=M(e),r=c.useRef(!1);return c.useEffect(()=>{const o=i=>{i.target&&!r.current&&ge(Ze,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function ae(){const e=new CustomEvent(J);document.dispatchEvent(e)}function ge(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?Xe(o,i):o.dispatchEvent(i)}var X="focusScope.autoFocusOnMount",Y="focusScope.autoFocusOnUnmount",ce={bubbles:!1,cancelable:!0},nt="FocusScope",rt=c.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=e,[a,h]=c.useState(null),l=M(o),f=M(i),d=c.useRef(null),v=te(t,u=>h(u)),y=c.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;c.useEffect(()=>{if(r){let u=function(b){if(y.paused||!a)return;const S=b.target;a.contains(S)?d.current=S:O(d.current,{select:!0})},m=function(b){if(y.paused||!a)return;const S=b.relatedTarget;S!==null&&(a.contains(S)||O(d.current,{select:!0}))},p=function(b){if(document.activeElement===document.body)for(const C of b)C.removedNodes.length>0&&O(a)};document.addEventListener("focusin",u),document.addEventListener("focusout",m);const g=new MutationObserver(p);return a&&g.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",u),document.removeEventListener("focusout",m),g.disconnect()}}},[r,a,y.paused]),c.useEffect(()=>{if(a){se.add(y);const u=document.activeElement;if(!a.contains(u)){const p=new CustomEvent(X,ce);a.addEventListener(X,l),a.dispatchEvent(p),p.defaultPrevented||(ot(ut(be(a)),{select:!0}),document.activeElement===u&&O(a))}return()=>{a.removeEventListener(X,l),setTimeout(()=>{const p=new CustomEvent(Y,ce);a.addEventListener(Y,f),a.dispatchEvent(p),p.defaultPrevented||O(u??document.body,{select:!0}),a.removeEventListener(Y,f),se.remove(y)},0)}}},[a,l,f,y]);const w=c.useCallback(u=>{if(!n&&!r||y.paused)return;const m=u.key==="Tab"&&!u.altKey&&!u.ctrlKey&&!u.metaKey,p=document.activeElement;if(m&&p){const g=u.currentTarget,[b,S]=at(g);b&&S?!u.shiftKey&&p===S?(u.preventDefault(),n&&O(b,{select:!0})):u.shiftKey&&p===b&&(u.preventDefault(),n&&O(S,{select:!0})):p===g&&u.preventDefault()}},[n,r,y.paused]);return x.jsx(V.div,{tabIndex:-1,...s,ref:v,onKeyDown:w})});rt.displayName=nt;function ot(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(O(r,{select:t}),document.activeElement!==n)return}function at(e){const t=be(e),n=ie(t,e),r=ie(t.reverse(),e);return[n,r]}function be(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function ie(e,t){for(const n of e)if(!ct(n,{upTo:t}))return n}function ct(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function it(e){return e instanceof HTMLInputElement&&"select"in e}function O(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&it(e)&&t&&e.select()}}var se=st();function st(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=ue(e,t),e.unshift(t)},remove(t){var n;e=ue(e,t),(n=e[0])==null||n.resume()}}}function ue(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function ut(e){return e.filter(t=>t.tagName!=="A")}var lt="Portal",ft=c.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[o,i]=c.useState(!1);ne(()=>i(!0),[]);const s=n||o&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return s?De.createPortal(x.jsx(V.div,{...r,ref:t}),s):null});ft.displayName=lt;var z=0;function rn(){c.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??le()),document.body.insertAdjacentElement("beforeend",e[1]??le()),z++,()=>{z===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),z--}},[])}function le(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var R=function(){return R=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},R.apply(this,arguments)};function Se(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function dt(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,i;r<o;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}var U="right-scroll-bar-position",$="width-before-scroll-bar",vt="with-scroll-bars-hidden",ht="--removed-body-scroll-bar-size";function G(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function mt(e,t){var n=c.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var pt=typeof window<"u"?c.useLayoutEffect:c.useEffect,fe=new WeakMap;function yt(e,t){var n=mt(null,function(r){return e.forEach(function(o){return G(o,r)})});return pt(function(){var r=fe.get(n);if(r){var o=new Set(r),i=new Set(e),s=n.current;o.forEach(function(a){i.has(a)||G(a,null)}),i.forEach(function(a){o.has(a)||G(a,s)})}fe.set(n,e)},[e]),n}function Et(e){return e}function gt(e,t){t===void 0&&(t=Et);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(i){var s=t(i,r);return n.push(s),function(){n=n.filter(function(a){return a!==s})}},assignSyncMedium:function(i){for(r=!0;n.length;){var s=n;n=[],s.forEach(i)}n={push:function(a){return i(a)},filter:function(){return n}}},assignMedium:function(i){r=!0;var s=[];if(n.length){var a=n;n=[],a.forEach(i),s=n}var h=function(){var f=s;s=[],f.forEach(i)},l=function(){return Promise.resolve().then(h)};l(),n={push:function(f){s.push(f),l()},filter:function(f){return s=s.filter(f),n}}}};return o}function bt(e){e===void 0&&(e={});var t=gt(null);return t.options=R({async:!0,ssr:!1},e),t}var we=function(e){var t=e.sideCar,n=Se(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return c.createElement(r,R({},n))};we.isSideCarExport=!0;function St(e,t){return e.useMedium(t),we}var Ce=bt(),Z=function(){},K=c.forwardRef(function(e,t){var n=c.useRef(null),r=c.useState({onScrollCapture:Z,onWheelCapture:Z,onTouchMoveCapture:Z}),o=r[0],i=r[1],s=e.forwardProps,a=e.children,h=e.className,l=e.removeScrollBar,f=e.enabled,d=e.shards,v=e.sideCar,y=e.noRelative,w=e.noIsolation,u=e.inert,m=e.allowPinchZoom,p=e.as,g=p===void 0?"div":p,b=e.gapMode,S=Se(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=v,P=yt([n,t]),E=R(R({},S),o);return c.createElement(c.Fragment,null,f&&c.createElement(C,{sideCar:Ce,removeScrollBar:l,shards:d,noRelative:y,noIsolation:w,inert:u,setCallbacks:i,allowPinchZoom:!!m,lockRef:n,gapMode:b}),s?c.cloneElement(c.Children.only(a),R(R({},E),{ref:P})):c.createElement(g,R({},E,{className:h,ref:P}),a))});K.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};K.classNames={fullWidth:$,zeroRight:U};var wt=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Ct(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=wt();return t&&e.setAttribute("nonce",t),e}function Pt(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Rt(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var xt=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Ct())&&(Pt(t,n),Rt(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Ot=function(){var e=xt();return function(t,n){c.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Pe=function(){var e=Ot(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},Tt={left:0,top:0,right:0,gap:0},q=function(e){return parseInt(e||"",10)||0},Lt=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[q(n),q(r),q(o)]},Nt=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Tt;var t=Lt(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},At=Pe(),k="data-scroll-locked",Dt=function(e,t,n,r){var o=e.left,i=e.top,s=e.right,a=e.gap;return n===void 0&&(n="margin"),`
|
|
1
|
+
import{G as Te,aK as Ae,r as c,j as x,aL as pe,aM as Ne,aA as te}from"./index-Biz-aexG.js";var ye=Ae();const De=Te(ye);function X(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function Jt(e,t){const n=c.createContext(t),r=i=>{const{children:s,...a}=i,h=c.useMemo(()=>a,Object.values(a));return x.jsx(n.Provider,{value:h,children:s})};r.displayName=e+"Provider";function o(i){const s=c.useContext(n);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[r,o]}function en(e,t=[]){let n=[];function r(i,s){const a=c.createContext(s),h=n.length;n=[...n,s];const l=d=>{var p;const{scope:v,children:y,...w}=d,u=((p=v==null?void 0:v[e])==null?void 0:p[h])||a,m=c.useMemo(()=>w,Object.values(w));return x.jsx(u.Provider,{value:m,children:y})};l.displayName=i+"Provider";function f(d,v){var u;const y=((u=v==null?void 0:v[e])==null?void 0:u[h])||a,w=c.useContext(y);if(w)return w;if(s!==void 0)return s;throw new Error(`\`${d}\` must be used within \`${i}\``)}return[l,f]}const o=()=>{const i=n.map(s=>c.createContext(s));return function(a){const h=(a==null?void 0:a[e])||i;return c.useMemo(()=>({[`__scope${e}`]:{...a,[e]:h}}),[a,h])}};return o.scopeName=e,[r,ke(o,...t)]}function ke(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=r.reduce((a,{useScope:h,scopeName:l})=>{const d=h(i)[`__scope${l}`];return{...a,...d}},{});return c.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}var ne=globalThis!=null&&globalThis.document?c.useLayoutEffect:()=>{},Me=pe[" useId ".trim().toString()]||(()=>{}),Fe=0;function tn(e){const[t,n]=c.useState(Me());return ne(()=>{n(r=>r??String(Fe++))},[e]),e||(t?`radix-${t}`:"")}var Ie=pe[" useInsertionEffect ".trim().toString()]||ne;function nn({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,i,s]=We({defaultProp:t,onChange:n}),a=e!==void 0,h=a?e:o;{const f=c.useRef(e!==void 0);c.useEffect(()=>{const d=f.current;d!==a&&console.warn(`${r} is changing from ${d?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),f.current=a},[a,r])}const l=c.useCallback(f=>{var d;if(a){const v=Be(f)?f(e):f;v!==e&&((d=s.current)==null||d.call(s,v))}else i(f)},[a,e,i,s]);return[h,l]}function We({defaultProp:e,onChange:t}){const[n,r]=c.useState(e),o=c.useRef(n),i=c.useRef(t);return Ie(()=>{i.current=t},[t]),c.useEffect(()=>{var s;o.current!==n&&((s=i.current)==null||s.call(i,n),o.current=n)},[n,o]),[n,r,i]}function Be(e){return typeof e=="function"}function _e(e){const t=je(e),n=c.forwardRef((r,o)=>{const{children:i,...s}=r,a=c.Children.toArray(i),h=a.find($e);if(h){const l=h.props.children,f=a.map(d=>d===h?c.Children.count(l)>1?c.Children.only(null):c.isValidElement(l)?l.props.children:null:d);return x.jsx(t,{...s,ref:o,children:c.isValidElement(l)?c.cloneElement(l,void 0,f):null})}return x.jsx(t,{...s,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}function je(e){const t=c.forwardRef((n,r)=>{const{children:o,...i}=n;if(c.isValidElement(o)){const s=Ke(o),a=Ve(i,o.props);return o.type!==c.Fragment&&(a.ref=r?Ne(r,s):s),c.cloneElement(o,a)}return c.Children.count(o)>1?c.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Ue=Symbol("radix.slottable");function $e(e){return c.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Ue}function Ve(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{const h=i(...a);return o(...a),h}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function Ke(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Xe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],V=Xe.reduce((e,t)=>{const n=_e(`Primitive.${t}`),r=c.forwardRef((o,i)=>{const{asChild:s,...a}=o,h=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),x.jsx(h,{...a,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Ye(e,t){e&&ye.flushSync(()=>e.dispatchEvent(t))}function F(e){const t=c.useRef(e);return c.useEffect(()=>{t.current=e}),c.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function He(e,t=globalThis==null?void 0:globalThis.document){const n=F(e);c.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var ze="DismissableLayer",J="dismissableLayer.update",Ge="dismissableLayer.pointerDownOutside",Ze="dismissableLayer.focusOutside",oe,Ee=c.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),qe=c.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,onDismiss:a,...h}=e,l=c.useContext(Ee),[f,d]=c.useState(null),v=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,y]=c.useState({}),w=te(t,E=>d(E)),u=Array.from(l.layers),[m]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),p=u.indexOf(m),g=f?u.indexOf(f):-1,b=l.layersWithOutsidePointerEventsDisabled.size>0,S=g>=p,C=et(E=>{const L=E.target,T=[...l.branches].some(M=>M.contains(L));!S||T||(o==null||o(E),s==null||s(E),E.defaultPrevented||a==null||a())},v),P=tt(E=>{const L=E.target;[...l.branches].some(M=>M.contains(L))||(i==null||i(E),s==null||s(E),E.defaultPrevented||a==null||a())},v);return He(E=>{g===l.layers.size-1&&(r==null||r(E),!E.defaultPrevented&&a&&(E.preventDefault(),a()))},v),c.useEffect(()=>{if(f)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(oe=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(f)),l.layers.add(f),ae(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(v.body.style.pointerEvents=oe)}},[f,v,n,l]),c.useEffect(()=>()=>{f&&(l.layers.delete(f),l.layersWithOutsidePointerEventsDisabled.delete(f),ae())},[f,l]),c.useEffect(()=>{const E=()=>y({});return document.addEventListener(J,E),()=>document.removeEventListener(J,E)},[]),x.jsx(V.div,{...h,ref:w,style:{pointerEvents:b?S?"auto":"none":void 0,...e.style},onFocusCapture:X(e.onFocusCapture,P.onFocusCapture),onBlurCapture:X(e.onBlurCapture,P.onBlurCapture),onPointerDownCapture:X(e.onPointerDownCapture,C.onPointerDownCapture)})});qe.displayName=ze;var Qe="DismissableLayerBranch",Je=c.forwardRef((e,t)=>{const n=c.useContext(Ee),r=c.useRef(null),o=te(t,r);return c.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),x.jsx(V.div,{...e,ref:o})});Je.displayName=Qe;function et(e,t=globalThis==null?void 0:globalThis.document){const n=F(e),r=c.useRef(!1),o=c.useRef(()=>{});return c.useEffect(()=>{const i=a=>{if(a.target&&!r.current){let h=function(){ge(Ge,n,l,{discrete:!0})};const l={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=h,t.addEventListener("click",o.current,{once:!0})):h()}else t.removeEventListener("click",o.current);r.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function tt(e,t=globalThis==null?void 0:globalThis.document){const n=F(e),r=c.useRef(!1);return c.useEffect(()=>{const o=i=>{i.target&&!r.current&&ge(Ze,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function ae(){const e=new CustomEvent(J);document.dispatchEvent(e)}function ge(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?Ye(o,i):o.dispatchEvent(i)}var Y="focusScope.autoFocusOnMount",H="focusScope.autoFocusOnUnmount",ce={bubbles:!1,cancelable:!0},nt="FocusScope",rt=c.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=e,[a,h]=c.useState(null),l=F(o),f=F(i),d=c.useRef(null),v=te(t,u=>h(u)),y=c.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;c.useEffect(()=>{if(r){let u=function(b){if(y.paused||!a)return;const S=b.target;a.contains(S)?d.current=S:O(d.current,{select:!0})},m=function(b){if(y.paused||!a)return;const S=b.relatedTarget;S!==null&&(a.contains(S)||O(d.current,{select:!0}))},p=function(b){if(document.activeElement===document.body)for(const C of b)C.removedNodes.length>0&&O(a)};document.addEventListener("focusin",u),document.addEventListener("focusout",m);const g=new MutationObserver(p);return a&&g.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",u),document.removeEventListener("focusout",m),g.disconnect()}}},[r,a,y.paused]),c.useEffect(()=>{if(a){se.add(y);const u=document.activeElement;if(!a.contains(u)){const p=new CustomEvent(Y,ce);a.addEventListener(Y,l),a.dispatchEvent(p),p.defaultPrevented||(ot(ut(be(a)),{select:!0}),document.activeElement===u&&O(a))}return()=>{a.removeEventListener(Y,l),setTimeout(()=>{const p=new CustomEvent(H,ce);a.addEventListener(H,f),a.dispatchEvent(p),p.defaultPrevented||O(u??document.body,{select:!0}),a.removeEventListener(H,f),se.remove(y)},0)}}},[a,l,f,y]);const w=c.useCallback(u=>{if(!n&&!r||y.paused)return;const m=u.key==="Tab"&&!u.altKey&&!u.ctrlKey&&!u.metaKey,p=document.activeElement;if(m&&p){const g=u.currentTarget,[b,S]=at(g);b&&S?!u.shiftKey&&p===S?(u.preventDefault(),n&&O(b,{select:!0})):u.shiftKey&&p===b&&(u.preventDefault(),n&&O(S,{select:!0})):p===g&&u.preventDefault()}},[n,r,y.paused]);return x.jsx(V.div,{tabIndex:-1,...s,ref:v,onKeyDown:w})});rt.displayName=nt;function ot(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(O(r,{select:t}),document.activeElement!==n)return}function at(e){const t=be(e),n=ie(t,e),r=ie(t.reverse(),e);return[n,r]}function be(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function ie(e,t){for(const n of e)if(!ct(n,{upTo:t}))return n}function ct(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function it(e){return e instanceof HTMLInputElement&&"select"in e}function O(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&it(e)&&t&&e.select()}}var se=st();function st(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=ue(e,t),e.unshift(t)},remove(t){var n;e=ue(e,t),(n=e[0])==null||n.resume()}}}function ue(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function ut(e){return e.filter(t=>t.tagName!=="A")}var lt="Portal",ft=c.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[o,i]=c.useState(!1);ne(()=>i(!0),[]);const s=n||o&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return s?De.createPortal(x.jsx(V.div,{...r,ref:t}),s):null});ft.displayName=lt;var z=0;function rn(){c.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??le()),document.body.insertAdjacentElement("beforeend",e[1]??le()),z++,()=>{z===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),z--}},[])}function le(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var R=function(){return R=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},R.apply(this,arguments)};function Se(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function dt(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,i;r<o;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}var U="right-scroll-bar-position",$="width-before-scroll-bar",vt="with-scroll-bars-hidden",ht="--removed-body-scroll-bar-size";function G(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function mt(e,t){var n=c.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var pt=typeof window<"u"?c.useLayoutEffect:c.useEffect,fe=new WeakMap;function yt(e,t){var n=mt(null,function(r){return e.forEach(function(o){return G(o,r)})});return pt(function(){var r=fe.get(n);if(r){var o=new Set(r),i=new Set(e),s=n.current;o.forEach(function(a){i.has(a)||G(a,null)}),i.forEach(function(a){o.has(a)||G(a,s)})}fe.set(n,e)},[e]),n}function Et(e){return e}function gt(e,t){t===void 0&&(t=Et);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(i){var s=t(i,r);return n.push(s),function(){n=n.filter(function(a){return a!==s})}},assignSyncMedium:function(i){for(r=!0;n.length;){var s=n;n=[],s.forEach(i)}n={push:function(a){return i(a)},filter:function(){return n}}},assignMedium:function(i){r=!0;var s=[];if(n.length){var a=n;n=[],a.forEach(i),s=n}var h=function(){var f=s;s=[],f.forEach(i)},l=function(){return Promise.resolve().then(h)};l(),n={push:function(f){s.push(f),l()},filter:function(f){return s=s.filter(f),n}}}};return o}function bt(e){e===void 0&&(e={});var t=gt(null);return t.options=R({async:!0,ssr:!1},e),t}var we=function(e){var t=e.sideCar,n=Se(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return c.createElement(r,R({},n))};we.isSideCarExport=!0;function St(e,t){return e.useMedium(t),we}var Ce=bt(),Z=function(){},K=c.forwardRef(function(e,t){var n=c.useRef(null),r=c.useState({onScrollCapture:Z,onWheelCapture:Z,onTouchMoveCapture:Z}),o=r[0],i=r[1],s=e.forwardProps,a=e.children,h=e.className,l=e.removeScrollBar,f=e.enabled,d=e.shards,v=e.sideCar,y=e.noRelative,w=e.noIsolation,u=e.inert,m=e.allowPinchZoom,p=e.as,g=p===void 0?"div":p,b=e.gapMode,S=Se(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=v,P=yt([n,t]),E=R(R({},S),o);return c.createElement(c.Fragment,null,f&&c.createElement(C,{sideCar:Ce,removeScrollBar:l,shards:d,noRelative:y,noIsolation:w,inert:u,setCallbacks:i,allowPinchZoom:!!m,lockRef:n,gapMode:b}),s?c.cloneElement(c.Children.only(a),R(R({},E),{ref:P})):c.createElement(g,R({},E,{className:h,ref:P}),a))});K.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};K.classNames={fullWidth:$,zeroRight:U};var wt=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Ct(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=wt();return t&&e.setAttribute("nonce",t),e}function Pt(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Rt(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var xt=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Ct())&&(Pt(t,n),Rt(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Ot=function(){var e=xt();return function(t,n){c.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Pe=function(){var e=Ot(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},Lt={left:0,top:0,right:0,gap:0},q=function(e){return parseInt(e||"",10)||0},Tt=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[q(n),q(r),q(o)]},At=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Lt;var t=Tt(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Nt=Pe(),k="data-scroll-locked",Dt=function(e,t,n,r){var o=e.left,i=e.top,s=e.right,a=e.gap;return n===void 0&&(n="margin"),`
|
|
2
2
|
.`.concat(vt,` {
|
|
3
3
|
overflow: hidden `).concat(r,`;
|
|
4
4
|
padding-right: `).concat(a,"px ").concat(r,`;
|
|
@@ -35,7 +35,7 @@ import{G as Le,aG as Ne,r as c,j as x,aH as pe,aI as Ae,aw as te}from"./index-BC
|
|
|
35
35
|
body[`).concat(k,`] {
|
|
36
36
|
`).concat(ht,": ").concat(a,`px;
|
|
37
37
|
}
|
|
38
|
-
`)},de=function(){var e=parseInt(document.body.getAttribute(k)||"0",10);return isFinite(e)?e:0},kt=function(){c.useEffect(function(){return document.body.setAttribute(k,(de()+1).toString()),function(){var e=de()-1;e<=0?document.body.removeAttribute(k):document.body.setAttribute(k,e.toString())}},[])},
|
|
38
|
+
`)},de=function(){var e=parseInt(document.body.getAttribute(k)||"0",10);return isFinite(e)?e:0},kt=function(){c.useEffect(function(){return document.body.setAttribute(k,(de()+1).toString()),function(){var e=de()-1;e<=0?document.body.removeAttribute(k):document.body.setAttribute(k,e.toString())}},[])},Mt=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;kt();var i=c.useMemo(function(){return At(o)},[o]);return c.createElement(Nt,{styles:Dt(i,!t,o,n?"":"!important")})},ee=!1;if(typeof window<"u")try{var W=Object.defineProperty({},"passive",{get:function(){return ee=!0,!0}});window.addEventListener("test",W,W),window.removeEventListener("test",W,W)}catch{ee=!1}var A=ee?{passive:!1}:!1,Ft=function(e){return e.tagName==="TEXTAREA"},Re=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Ft(e)&&n[t]==="visible")},It=function(e){return Re(e,"overflowY")},Wt=function(e){return Re(e,"overflowX")},ve=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=xe(e,r);if(o){var i=Oe(e,r),s=i[1],a=i[2];if(s>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Bt=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},_t=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},xe=function(e,t){return e==="v"?It(t):Wt(t)},Oe=function(e,t){return e==="v"?Bt(t):_t(t)},jt=function(e,t){return e==="h"&&t==="rtl"?-1:1},Ut=function(e,t,n,r,o){var i=jt(e,window.getComputedStyle(t).direction),s=i*r,a=n.target,h=t.contains(a),l=!1,f=s>0,d=0,v=0;do{if(!a)break;var y=Oe(e,a),w=y[0],u=y[1],m=y[2],p=u-m-i*w;(w||p)&&xe(e,a)&&(d+=p,v+=w);var g=a.parentNode;a=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!h&&a!==document.body||h&&(t.contains(a)||t===a));return(f&&Math.abs(d)<1||!f&&Math.abs(v)<1)&&(l=!0),l},B=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},he=function(e){return[e.deltaX,e.deltaY]},me=function(e){return e&&"current"in e?e.current:e},$t=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Vt=function(e){return`
|
|
39
39
|
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
40
40
|
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
41
|
-
`)},Kt=0,
|
|
41
|
+
`)},Kt=0,N=[];function Xt(e){var t=c.useRef([]),n=c.useRef([0,0]),r=c.useRef(),o=c.useState(Kt++)[0],i=c.useState(Pe)[0],s=c.useRef(e);c.useEffect(function(){s.current=e},[e]),c.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var u=dt([e.lockRef.current],(e.shards||[]).map(me),!0).filter(Boolean);return u.forEach(function(m){return m.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),u.forEach(function(m){return m.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=c.useCallback(function(u,m){if("touches"in u&&u.touches.length===2||u.type==="wheel"&&u.ctrlKey)return!s.current.allowPinchZoom;var p=B(u),g=n.current,b="deltaX"in u?u.deltaX:g[0]-p[0],S="deltaY"in u?u.deltaY:g[1]-p[1],C,P=u.target,E=Math.abs(b)>Math.abs(S)?"h":"v";if("touches"in u&&E==="h"&&P.type==="range")return!1;var L=window.getSelection(),T=L&&L.anchorNode,M=T?T===P||T.contains(P):!1;if(M)return!1;var I=ve(E,P);if(!I)return!0;if(I?C=E:(C=E==="v"?"h":"v",I=ve(E,P)),!I)return!1;if(!r.current&&"changedTouches"in u&&(b||S)&&(r.current=C),!C)return!0;var re=r.current||C;return Ut(re,m,u,re==="h"?b:S)},[]),h=c.useCallback(function(u){var m=u;if(!(!N.length||N[N.length-1]!==i)){var p="deltaY"in m?he(m):B(m),g=t.current.filter(function(C){return C.name===m.type&&(C.target===m.target||m.target===C.shadowParent)&&$t(C.delta,p)})[0];if(g&&g.should){m.cancelable&&m.preventDefault();return}if(!g){var b=(s.current.shards||[]).map(me).filter(Boolean).filter(function(C){return C.contains(m.target)}),S=b.length>0?a(m,b[0]):!s.current.noIsolation;S&&m.cancelable&&m.preventDefault()}}},[]),l=c.useCallback(function(u,m,p,g){var b={name:u,delta:m,target:p,should:g,shadowParent:Yt(p)};t.current.push(b),setTimeout(function(){t.current=t.current.filter(function(S){return S!==b})},1)},[]),f=c.useCallback(function(u){n.current=B(u),r.current=void 0},[]),d=c.useCallback(function(u){l(u.type,he(u),u.target,a(u,e.lockRef.current))},[]),v=c.useCallback(function(u){l(u.type,B(u),u.target,a(u,e.lockRef.current))},[]);c.useEffect(function(){return N.push(i),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:v}),document.addEventListener("wheel",h,A),document.addEventListener("touchmove",h,A),document.addEventListener("touchstart",f,A),function(){N=N.filter(function(u){return u!==i}),document.removeEventListener("wheel",h,A),document.removeEventListener("touchmove",h,A),document.removeEventListener("touchstart",f,A)}},[]);var y=e.removeScrollBar,w=e.inert;return c.createElement(c.Fragment,null,w?c.createElement(i,{styles:Vt(o)}):null,y?c.createElement(Mt,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Yt(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Ht=St(Ce,Xt);var zt=c.forwardRef(function(e,t){return c.createElement(K,R({},e,{ref:t,sideCar:Ht}))});zt.classNames=K.classNames;var Gt=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},D=new WeakMap,_=new WeakMap,j={},Q=0,Le=function(e){return e&&(e.host||Le(e.parentNode))},Zt=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Le(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},qt=function(e,t,n,r){var o=Zt(t,Array.isArray(e)?e:[e]);j[n]||(j[n]=new WeakMap);var i=j[n],s=[],a=new Set,h=new Set(o),l=function(d){!d||a.has(d)||(a.add(d),l(d.parentNode))};o.forEach(l);var f=function(d){!d||h.has(d)||Array.prototype.forEach.call(d.children,function(v){if(a.has(v))f(v);else try{var y=v.getAttribute(r),w=y!==null&&y!=="false",u=(D.get(v)||0)+1,m=(i.get(v)||0)+1;D.set(v,u),i.set(v,m),s.push(v),u===1&&w&&_.set(v,!0),m===1&&v.setAttribute(n,"true"),w||v.setAttribute(r,"true")}catch(p){console.error("aria-hidden: cannot operate on ",v,p)}})};return f(t),a.clear(),Q++,function(){s.forEach(function(d){var v=D.get(d)-1,y=i.get(d)-1;D.set(d,v),i.set(d,y),v||(_.has(d)||d.removeAttribute(r),_.delete(d)),y||d.removeAttribute(n)}),Q--,Q||(D=new WeakMap,D=new WeakMap,_=new WeakMap,j={})}},on=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=Gt(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),qt(r,o,n,"aria-hidden")):function(){return null}};export{qe as D,rt as F,V as P,zt as R,_e as a,F as b,en as c,nn as d,tn as e,X as f,ft as g,on as h,rn as i,Jt as j,ye as r,ne as u};
|