@jiangxiaosheng/digital-agent-platform 1.0.4 → 1.0.5
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/.next/BUILD_ID +1 -1
- package/.next/app-build-manifest.json +63 -59
- package/.next/app-path-routes-manifest.json +1 -1
- package/.next/build-manifest.json +2 -2
- package/.next/cache/.tsbuildinfo +1 -1
- package/.next/cache/eslint/.cache_1bmmeh3 +1 -1
- package/.next/cache/webpack/client-production/0.pack +0 -0
- package/.next/cache/webpack/client-production/1.pack +0 -0
- package/.next/cache/webpack/client-production/5.pack +0 -0
- package/.next/cache/webpack/client-production/7.pack +0 -0
- package/.next/cache/webpack/client-production/8.pack +0 -0
- package/.next/cache/webpack/client-production/9.pack +0 -0
- package/.next/cache/webpack/client-production/index.pack +0 -0
- package/.next/cache/webpack/client-production/index.pack.old +0 -0
- package/.next/cache/webpack/edge-server-production/1.pack +0 -0
- package/.next/cache/webpack/edge-server-production/index.pack +0 -0
- package/.next/cache/webpack/edge-server-production/index.pack.old +0 -0
- package/.next/cache/webpack/server-production/0.pack +0 -0
- package/.next/cache/webpack/server-production/1.pack +0 -0
- package/.next/cache/webpack/server-production/3.pack +0 -0
- package/.next/cache/webpack/server-production/4.pack +0 -0
- package/.next/cache/webpack/server-production/5.pack +0 -0
- package/.next/cache/webpack/server-production/6.pack +0 -0
- package/.next/cache/webpack/server-production/7.pack +0 -0
- package/.next/cache/webpack/server-production/8.pack +0 -0
- package/.next/cache/webpack/server-production/index.pack +0 -0
- package/.next/cache/webpack/server-production/index.pack.old +0 -0
- package/.next/next-minimal-server.js.nft.json +1 -1
- package/.next/next-server.js.nft.json +1 -1
- package/.next/prerender-manifest.json +1 -1
- package/.next/server/app/[locale]/agents/[id]/chat/page_client-reference-manifest.js +1 -1
- package/.next/server/app/[locale]/agents/[id]/edit/page.js +1 -1
- package/.next/server/app/[locale]/agents/[id]/edit/page.js.nft.json +1 -1
- package/.next/server/app/[locale]/agents/[id]/edit/page_client-reference-manifest.js +1 -1
- package/.next/server/app/[locale]/agents/new/page.js +1 -1
- package/.next/server/app/[locale]/agents/new/page.js.nft.json +1 -1
- package/.next/server/app/[locale]/agents/new/page_client-reference-manifest.js +1 -1
- package/.next/server/app/[locale]/agents/page_client-reference-manifest.js +1 -1
- package/.next/server/app/[locale]/knowledge/page_client-reference-manifest.js +1 -1
- package/.next/server/app/[locale]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/[locale]/settings/page.js +1 -1
- package/.next/server/app/[locale]/settings/page.js.nft.json +1 -1
- package/.next/server/app/[locale]/settings/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_not-found.html +1 -1
- package/.next/server/app/_not-found.rsc +1 -1
- package/.next/server/app/api/agents/[id]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/agents/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/auth-config/test/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/bash-output/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/chat/[agentId]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/env-vars/[key]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/env-vars/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/env-vars/scan/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/file-serve/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/fs/browse/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/knowledge/[id]/documents/[docId]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/knowledge/[id]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/knowledge/[id]/upload/route.js +1 -1
- package/.next/server/app/api/knowledge/[id]/upload/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/knowledge/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/knowledge/search/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/models/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/models-config/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/models-config/test/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/sessions/[agentId]/[sessionId]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/sessions/[agentId]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/sessions/history/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/settings/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/skills/[name]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/skills/install/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/skills/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/skills/search/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/tts/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/voice-provider/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/workspace-files/route_client-reference-manifest.js +1 -1
- package/.next/server/app/index.html +1 -1
- package/.next/server/app/index.rsc +1 -1
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app-paths-manifest.json +12 -12
- package/.next/server/chunks/1354.js +1 -0
- package/.next/server/chunks/7420.js +1 -0
- package/.next/server/chunks/7555.js +1 -0
- package/.next/server/chunks/9576.js +1 -0
- package/.next/server/middleware-manifest.json +4 -4
- package/.next/server/pages/404.html +1 -1
- package/.next/server/pages/500.html +1 -1
- package/.next/server/pages/_error.js +1 -1
- package/.next/static/chunks/3763-85d191447a96df85.js +1 -0
- package/.next/static/chunks/5822-2ca912318cc34b52.js +1 -0
- package/.next/static/chunks/5964-cdb47df650c9e359.js +1 -0
- package/.next/static/chunks/6009-1f2b513c3fe454c1.js +1 -0
- package/.next/static/chunks/app/[locale]/agents/[id]/edit/{page-8d0cc73c7aff7774.js → page-74a70d27b56ead9b.js} +1 -1
- package/.next/static/chunks/app/[locale]/agents/new/{page-aeaa197c0ccfd2f9.js → page-11833508212d4d80.js} +1 -1
- package/.next/static/chunks/app/[locale]/knowledge/{page-7b4b6aa0a07d7da3.js → page-4928374e08e30a81.js} +1 -1
- package/.next/static/chunks/app/[locale]/settings/page-472b2cd8df49bf94.js +1 -0
- package/.next/trace +4 -4
- package/package.json +1 -1
- package/src/app/[locale]/settings/page.tsx +3 -3
- package/src/components/agents/model-selector.tsx +6 -0
- package/.next/server/chunks/1285.js +0 -1
- package/.next/server/chunks/2112.js +0 -1
- package/.next/server/chunks/4125.js +0 -1
- package/.next/static/chunks/2733-714d0e6cd51477c7.js +0 -1
- package/.next/static/chunks/3923-e04a628626d77a16.js +0 -1
- package/.next/static/chunks/6742-ad22486f7c4c8592.js +0 -1
- package/.next/static/chunks/app/[locale]/settings/page-71d67c3b9f712584.js +0 -1
- /package/.next/static/{0f9LzcIDG_ySmdh1lmd-C → rUwWYP4-J64RRKJv93Ihp}/_buildManifest.js +0 -0
- /package/.next/static/{0f9LzcIDG_ySmdh1lmd-C → rUwWYP4-J64RRKJv93Ihp}/_ssgManifest.js +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3763],{8453:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(7401).A)("Calculator",[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",key:"1nb95v"}],["line",{x1:"8",x2:"16",y1:"6",y2:"6",key:"x4nwl0"}],["line",{x1:"16",x2:"16",y1:"14",y2:"18",key:"wjye3r"}],["path",{d:"M16 10h.01",key:"1m94wz"}],["path",{d:"M12 10h.01",key:"1nrarc"}],["path",{d:"M8 10h.01",key:"19clt8"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M8 18h.01",key:"lrp35t"}]])},3518:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(7401).A)("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]])},1902:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(7401).A)("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]])},8501:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(7401).A)("FilePen",[["path",{d:"M12.5 22H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v9.5",key:"1couwa"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M13.378 15.626a1 1 0 1 0-3.004-3.004l-5.01 5.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z",key:"1y4qbx"}]])},4081:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(7401).A)("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]])},6308:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(7401).A)("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]])},5364:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(7401).A)("FolderSearch",[["path",{d:"M10.7 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v4.1",key:"1bw5m7"}],["path",{d:"m21 21-1.9-1.9",key:"1g2n9r"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}]])},7257:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(7401).A)("Folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]])},6507:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(7401).A)("House",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]])},5220:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(7401).A)("Volume2",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]])},5900:(e,t,n)=>{n.d(t,{CC:()=>_,Q6:()=>z,bL:()=>E,zi:()=>B});var r=n(2115),o=n(1786),l=n(3610),i=n(8068),a=n(8166),d=n(7924),u=n(4256),s=n(858),c=n(7510),f=n(3360),h=n(8050),m=n(5155),p=Object.defineProperty,g=(e,t)=>p(e,"name",{value:t,configurable:!0}),v=["PageUp","PageDown"],y=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],w={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},b="Slider",[S,x,k]=(0,h.N)(b),[M,A]=(0,a.A)(b,[k]),[P,D]=M(b),E=r.forwardRef(g(function(e,t){let{name:n,min:a=0,max:u=100,step:s=1,orientation:c="horizontal",disabled:f=!1,minStepsBetweenThumbs:h=0,defaultValue:p=[a],value:w,onValueChange:b=g(()=>{},"onValueChange"),onValueCommit:x=g(()=>{},"onValueCommit"),inverted:k=!1,form:M,...A}=e,D=r.useRef(new Set),E=r.useRef(0),j=r.useRef(!1),R="horizontal"===c,[C,_]=r.useState(null),T=(0,i.s)(t,_),[z=[],I]=(0,d.i)({prop:w,defaultProp:p,onChange:g(e=>{var t;null===(t=[...D.current][E.current])||void 0===t||t.focus({preventScroll:!0,focusVisible:j.current}),j.current=!1,b(e)},"onChange")}),K=r.useRef(z),F=r.useRef(z);function L(e){let t=X(z,e);N(e,t)}function q(e){N(e,E.current)}function B(){String(z)!==String(K.current)&&x(z)}function N(e,t){let{commit:n}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{commit:!1},r=W(s),l=$(Math.round((e-a)/s)*s+a,r),i=(0,o.q)(l,[a,u]);I(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=O(e,i,t);if(!Q(r,h*s))return e;{E.current=r.indexOf(i);let t=String(r)!==String(e);return t&&n&&x(r),t?r:e}})}return r.useEffect(()=>{let e=M?null==C?void 0:C.ownerDocument.getElementById(M):null==C?void 0:C.closest("form");if(e instanceof HTMLFormElement){let t=g(()=>I(F.current),"reset");return e.addEventListener("reset",t),()=>e.removeEventListener("reset",t)}},[C,M,I]),g(L,"handleSlideStart"),g(q,"handleSlideMove"),g(B,"handleSlideEnd"),g(N,"updateValues"),(0,m.jsx)(P,{scope:e.__scopeSlider,name:n,disabled:f,min:a,max:u,valueIndexToChangeRef:E,thumbs:D.current,values:z,orientation:c,form:M,children:(0,m.jsx)(S.Provider,{scope:e.__scopeSlider,children:(0,m.jsx)(S.Slot,{scope:e.__scopeSlider,children:(0,m.jsx)(R?H:V,{"aria-disabled":f,"data-disabled":f?"":void 0,...A,ref:T,onPointerDown:(0,l.mK)(A.onPointerDown,()=>{f||(K.current=z,j.current=!1)}),min:a,max:u,inverted:k,onSlideStart:f?void 0:L,onSlideMove:f?void 0:q,onSlideEnd:f?void 0:B,onHomeKeyDown:()=>{f||(j.current=!0,N(a,0,{commit:!0}))},onEndKeyDown:()=>{f||(j.current=!0,N(u,z.length-1,{commit:!0}))},onStepKeyDown:e=>{let{event:t,direction:n}=e;if(!f){j.current=!0;let e=v.includes(t.key)||t.shiftKey&&y.includes(t.key),r=E.current;N(ee(z[r],{min:a,step:s,direction:n,multiplier:e?10:1}),r,{commit:!0})}}})})})})},"Slider")),[j,R]=M(b,{startEdge:"left",endEdge:"right",size:"width",direction:1}),H=r.forwardRef(g(function(e,t){let{min:n,max:o,dir:l,inverted:a,onSlideStart:d,onSlideMove:s,onSlideEnd:c,onStepKeyDown:f,...h}=e,[p,v]=r.useState(null),y=(0,i.s)(t,v),b=r.useRef(void 0),S=(0,u.jH)(l),x="ltr"===S,k=x&&!a||!x&&a;function M(e){let t=b.current||p.getBoundingClientRect(),r=J([0,t.width],k?[n,o]:[o,n]);return b.current=t,r(e-t.left)}return g(M,"getValueFromPointer"),(0,m.jsx)(j,{scope:e.__scopeSlider,startEdge:k?"left":"right",endEdge:k?"right":"left",direction:k?1:-1,size:"width",children:(0,m.jsx)(C,{dir:S,"data-orientation":"horizontal",...h,ref:y,style:{...h.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:e=>{let t=M(e.clientX);null==d||d(t)},onSlideMove:e=>{let t=M(e.clientX);null==s||s(t)},onSlideEnd:()=>{b.current=void 0,null==c||c()},onStepKeyDown:e=>{let t=w[k?"from-left":"from-right"].includes(e.key);null==f||f({event:e,direction:t?-1:1})}})})},"SliderHorizontal")),V=r.forwardRef(g(function(e,t){let{min:n,max:o,inverted:l,onSlideStart:a,onSlideMove:d,onSlideEnd:u,onStepKeyDown:s,...c}=e,f=r.useRef(null),h=(0,i.s)(t,f),p=r.useRef(void 0),v=!l;function y(e){let t=p.current||f.current.getBoundingClientRect(),r=J([0,t.height],v?[o,n]:[n,o]);return p.current=t,r(e-t.top)}return g(y,"getValueFromPointer"),(0,m.jsx)(j,{scope:e.__scopeSlider,startEdge:v?"bottom":"top",endEdge:v?"top":"bottom",size:"height",direction:v?1:-1,children:(0,m.jsx)(C,{"data-orientation":"vertical",...c,ref:h,style:{...c.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:e=>{let t=y(e.clientY);null==a||a(t)},onSlideMove:e=>{let t=y(e.clientY);null==d||d(t)},onSlideEnd:()=>{p.current=void 0,null==u||u()},onStepKeyDown:e=>{let t=w[v?"from-bottom":"from-top"].includes(e.key);null==s||s({event:e,direction:t?-1:1})}})})},"SliderVertical")),C=r.forwardRef(g(function(e,t){let{__scopeSlider:n,onSlideStart:r,onSlideMove:o,onSlideEnd:i,onHomeKeyDown:a,onEndKeyDown:d,onStepKeyDown:u,...s}=e,c=D(b,n);return(0,m.jsx)(f.sG.span,{...s,ref:t,onKeyDown:(0,l.mK)(e.onKeyDown,e=>{"Home"===e.key?(a(e),e.preventDefault()):"End"===e.key?(d(e),e.preventDefault()):v.concat(y).includes(e.key)&&(u(e),e.preventDefault())}),onPointerDown:(0,l.mK)(e.onPointerDown,e=>{let t=e.target;t.setPointerCapture(e.pointerId),e.preventDefault(),c.thumbs.has(t)?t.focus({preventScroll:!0,focusVisible:!1}):r(e)}),onPointerMove:(0,l.mK)(e.onPointerMove,e=>{e.target.hasPointerCapture(e.pointerId)&&o(e)}),onPointerUp:(0,l.mK)(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&(t.releasePointerCapture(e.pointerId),i(e))})})},"SliderImpl")),_=r.forwardRef(g(function(e,t){let{__scopeSlider:n,...r}=e,o=D("SliderTrack",n);return(0,m.jsx)(f.sG.span,{"data-disabled":o.disabled?"":void 0,"data-orientation":o.orientation,...r,ref:t})},"SliderTrack")),T="SliderRange",z=r.forwardRef(g(function(e,t){let{__scopeSlider:n,...o}=e,l=D(T,n),a=R(T,n),d=r.useRef(null),u=(0,i.s)(t,d),s=l.values.length,c=l.values.map(e=>U(e,l.min,l.max)),h=s>1?Math.min(...c):0,p=100-Math.max(...c);return(0,m.jsx)(f.sG.span,{"data-orientation":l.orientation,"data-disabled":l.disabled?"":void 0,...o,ref:u,style:{...e.style,[a.startEdge]:h+"%",[a.endEdge]:p+"%"}})},"SliderRange")),[I,K]=M("SliderThumb");function F(e){let{__scopeSlider:t,name:n,children:o,internal_do_not_use_render:l}=e,i=D("SliderThumbProvider",t),a=x(t),[d,u]=r.useState(null),s=r.useMemo(()=>d?a().findIndex(e=>e.ref.current===d):-1,[a,d]),f=(0,c.X)(d),h=!d||!!i.form||!!d.closest("form"),p=i.values[s],g=null!=n?n:i.name?i.name+(i.values.length>1?"[]":""):void 0,v=void 0===p?0:U(p,i.min,i.max);r.useEffect(()=>{if(d)return i.thumbs.add(d),()=>{i.thumbs.delete(d)}},[d,i.thumbs]);let y={value:p,name:g,form:i.form,isFormControl:h,index:s,thumb:d,onThumbChange:u,percent:v,size:f};return(0,m.jsx)(I,{scope:t,...y,children:et(l)?l(y):o})}g(F,"SliderThumbProvider");var L="SliderThumbTrigger",q=r.forwardRef(g(function(e,t){let{__scopeSlider:n,...r}=e,o=D(L,n),a=R(L,n),{index:d,value:u,percent:s,size:c,onThumbChange:h}=K(L,n),p=(0,i.s)(t,h),g=G(d,o.values.length),v=null==c?void 0:c[a.size],y=v?Y(v,s,a.direction):0;return(0,m.jsx)("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[a.startEdge]:"calc(".concat(s,"% + ").concat(y,"px)")},children:(0,m.jsx)(S.ItemSlot,{scope:n,children:(0,m.jsx)(f.sG.span,{role:"slider","aria-label":e["aria-label"]||g,"aria-valuemin":o.min,"aria-valuenow":u,"aria-valuemax":o.max,"aria-orientation":o.orientation,"data-orientation":o.orientation,"data-disabled":o.disabled?"":void 0,tabIndex:o.disabled?void 0:0,...r,ref:p,style:void 0===u?{display:"none"}:e.style,onFocus:(0,l.mK)(e.onFocus,()=>{o.valueIndexToChangeRef.current=d})})})})},"SliderThumbTrigger")),B=r.forwardRef(g(function(e,t){let{__scopeSlider:n,name:r,...o}=e;return(0,m.jsx)(F,{__scopeSlider:n,name:r,internal_do_not_use_render:e=>{let{index:r,isFormControl:l}=e;return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(q,{...o,ref:t,__scopeSlider:n}),l?(0,m.jsx)(N,{__scopeSlider:n},r):null]})}})},"SliderThumb")),N=r.forwardRef(g(function(e,t){let{__scopeSlider:n,...o}=e,{value:l,name:a,form:d}=K("SliderBubbleInput",n),u=r.useRef(null),c=(0,i.s)(u,t),h=(0,s.Z)(l);return r.useEffect(()=>{let e=u.current;if(!e)return;let t=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"value").set;if(h!==l&&t){let n=new Event("input",{bubbles:!0});t.call(e,l),e.dispatchEvent(n)}},[h,l]),(0,m.jsx)(f.sG.input,{style:{display:"none"},name:a,form:d,...o,ref:c,defaultValue:l})},"SliderBubbleInput"));function O(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,r=[...e];return r[n]=t,r.sort((e,t)=>e-t)}function U(e,t,n){return(0,o.q)(100/(n-t)*(e-t),[0,100])}function G(e,t){return t>2?"Value ".concat(e+1," of ").concat(t):2===t?["Minimum","Maximum"][e]:void 0}function X(e,t){if(1===e.length)return 0;let n=e.map(e=>Math.abs(e-t)),r=Math.min(...n);return n.indexOf(r)}function Y(e,t,n){let r=e/2,o=J([0,50],[0,r]);return(r-o(t)*n)*n}function Z(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function Q(e,t){return!(t>0)||Math.min(...Z(e))>=t}function J(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function W(e){if(!Number.isFinite(e))return 0;let t=e.toString();if(t.includes("e")){let[e,n]=t.split("e"),r=e.split(".")[1]||"",o=Number(n);return Math.max(0,r.length-o)}let n=t.split(".")[1];return n?n.length:0}function $(e,t){let n=Math.pow(10,t);return Math.round(e*n)/n}function ee(e,t){let n,{min:r,step:o,direction:l,multiplier:i}=t,a=W(o),d=(e-r)/o,u=Math.round(d);return n=$(u*o+r,a)===$(e,a)?u+i*l:l>0?Math.ceil(d):Math.floor(d),$(n*o+r,a)}function et(e){return"function"==typeof e}g(O,"getNextSortedValues"),g(U,"convertValueToPercentage"),g(G,"getLabel"),g(X,"getClosestValueIndex"),g(Y,"getThumbInBoundsOffset"),g(Z,"getStepsBetweenValues"),g(Q,"hasMinStepsBetweenValues"),g(J,"linearScale"),g(W,"getDecimalCount"),g($,"roundValue"),g(ee,"getNextStepValue"),g(et,"isFunction")}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5822],{2935:(e,t,r)=>{r.d(t,{Bd:()=>w,Pi:()=>N,yU:()=>j});var a=r(5155),s=r(2115),n=r(1719),l=r(8867),i=r(853),d=r(4807),o=r(9257),c=r(8207),u=r(5027),m=r(3312),f=r(3900),p=r(7995),x=r(1344),h=r(1567);let b=null,g=null;function v(){return b?Promise.resolve(b):g||(g=fetch("/api/models").then(e=>e.json()).then(e=>(b=e,e)))}function N(){b=null,g=null}function y(e){return{supportsThinking:e.supportsThinking,supportsTemperature:e.supportsTemperature,thinkingLevels:e.thinkingLevels,contextWindow:e.contextWindow,maxTokens:e.maxTokens}}function j(e,t){let[r,a]=(0,s.useState)({supportsThinking:!1,supportsTemperature:!0,thinkingLevels:[],contextWindow:2e5,maxTokens:8192});return(0,s.useEffect)(()=>{e&&t&&v().then(r=>{var s;let n=null===(s=r.find(t=>t.id===e))||void 0===s?void 0:s.models.find(e=>e.id===t);n&&a(y(n))})},[e,t]),r}function w(e){var t;let{providerId:r,modelId:g,onChange:N}=e,[j,w]=(0,s.useState)(!1),[C,L]=(0,s.useState)(null!=b?b:[]),[R,T]=(0,s.useState)(!1),[z,A]=(0,s.useState)(""),[F,E]=(0,s.useState)(r||"anthropic");(0,s.useEffect)(()=>{if(b){L(b);return}T(!0),v().then(e=>L(e)).finally(()=>T(!1))},[]),(0,s.useEffect)(()=>{r&&E(r)},[r]);let U=(0,s.useCallback)(()=>{var e;E(r||(null===(e=C[0])||void 0===e?void 0:e.id)||"anthropic"),A(""),w(!0)},[r,C]),V=C.find(e=>e.id===r),D=null==V?void 0:V.models.find(e=>e.id===g),I=D?"".concat(null==V?void 0:V.name," / ").concat(D.name):r&&g?"".concat(r," / ").concat(g):"选择模型…",B=C.find(e=>e.id===F),J=(null!==(t=null==B?void 0:B.models)&&void 0!==t?t:[]).filter(e=>{if(!z)return!0;let t=z.toLowerCase();return e.id.toLowerCase().includes(t)||e.name.toLowerCase().includes(t)}),M=e=>{N(e.providerId,e.id,y(e)),w(!1),A("")};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(m.$,{type:"button",variant:"outline",onClick:U,className:"w-full justify-between font-normal h-10",children:[(0,a.jsx)("span",{className:"truncate text-sm",children:I}),(0,a.jsx)(n.A,{className:"ml-2 h-4 w-4 flex-shrink-0 opacity-50"})]}),(0,a.jsx)(x.lG,{open:j,onOpenChange:w,children:(0,a.jsxs)(x.Cf,{className:"max-w-2xl p-0 gap-0 overflow-hidden",children:[(0,a.jsx)(x.c7,{className:"px-4 pt-4 pb-3 border-b shrink-0",children:(0,a.jsx)(x.L3,{className:"text-base",children:"选择模型"})}),(0,a.jsxs)("div",{className:"flex",style:{height:520},children:[(0,a.jsxs)("div",{className:"w-48 shrink-0 border-r flex flex-col",children:[(0,a.jsx)("div",{className:"px-2 py-1.5 border-b",children:(0,a.jsx)("p",{className:"text-xs font-medium text-muted-foreground px-1",children:"提供商"})}),(0,a.jsx)(p.F,{className:"flex-1",children:(0,a.jsxs)("div",{className:"p-1.5 space-y-0.5",children:[R&&!C.length&&(0,a.jsx)("p",{className:"text-xs text-muted-foreground text-center py-6",children:"加载中…"}),C.map(e=>{let t=e.id===F,s=e.id===r;return(0,a.jsxs)("button",{type:"button",onClick:()=>{E(e.id),A("")},className:(0,h.cn)("w-full text-left rounded-md px-2.5 py-2 transition-colors",t?"bg-secondary":"hover:bg-secondary/40"),children:[(0,a.jsxs)("div",{className:"flex items-center gap-1.5",children:[s&&(0,a.jsx)(l.A,{className:"h-3 w-3 text-primary shrink-0"}),(0,a.jsx)("span",{className:(0,h.cn)("text-sm truncate",!t&&"text-muted-foreground"),children:e.name})]}),(0,a.jsxs)("span",{className:"text-[11px] text-muted-foreground pl-0",children:[e.models.length," 个模型"]})]},e.id)})]})})]}),(0,a.jsxs)("div",{className:"flex-1 flex flex-col min-w-0",children:[(0,a.jsx)("div",{className:"px-2 py-1.5 border-b shrink-0",children:(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)(i.A,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-muted-foreground"}),(0,a.jsx)(f.p,{placeholder:"搜索模型名称或 ID…",value:z,onChange:e=>A(e.target.value),className:"pl-8 h-8 text-sm",autoFocus:!0})]})}),(0,a.jsx)(p.F,{className:"flex-1",children:(0,a.jsxs)("div",{className:"p-2 space-y-1",children:[0===J.length&&(0,a.jsx)("p",{className:"text-sm text-muted-foreground text-center py-10",children:z?"无匹配模型":"该提供商暂无模型"}),J.map(e=>{var t;let s=e.providerId===r&&e.id===g;return(0,a.jsxs)("button",{type:"button",onClick:()=>M(e),className:(0,h.cn)("w-full text-left rounded-lg px-3 py-2.5 border transition-colors",s?"border-primary/50 bg-primary/5 dark:bg-primary/10":"border-transparent hover:border-border hover:bg-secondary/40"),children:[(0,a.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,a.jsx)("span",{className:"text-sm font-medium leading-tight",children:e.name}),s&&(0,a.jsx)(l.A,{className:"h-3.5 w-3.5 text-primary shrink-0"})]}),(0,a.jsx)("p",{className:"text-[11px] text-muted-foreground font-mono truncate mt-0.5",children:e.id})]}),void 0!==e.costInput&&(0,a.jsxs)("span",{className:"text-[11px] text-muted-foreground flex items-center gap-0.5 shrink-0 mt-0.5",children:[(0,a.jsx)(d.A,{className:"h-2.5 w-2.5"}),e.costInput,"/",e.costOutput,"/M"]})]}),(0,a.jsxs)("div",{className:"flex flex-wrap gap-1 mt-2",children:[(0,a.jsx)(k,{icon:(0,a.jsx)(o.A,{className:"h-2.5 w-2.5"}),label:(t=e.contextWindow)>=1e6?"".concat((t/1e6).toFixed(0),"M ctx"):t>=1e3?"".concat((t/1e3).toFixed(0),"K ctx"):"".concat(t," ctx")}),e.supportsThinking&&(0,a.jsx)(k,{icon:(0,a.jsx)(c.A,{className:"h-2.5 w-2.5"}),label:e.thinkingLevels.length>0?"Thinking (".concat(e.thinkingLevels.join("/"),")"):"Thinking",className:"text-purple-600 dark:text-purple-400 border-purple-300 dark:border-purple-700"}),!e.supportsTemperature&&(0,a.jsx)(k,{icon:(0,a.jsx)(u.A,{className:"h-2.5 w-2.5"}),label:"无 Temp",className:"text-amber-600 dark:text-amber-400 border-amber-300 dark:border-amber-700"}),e.inputTypes.includes("image")&&(0,a.jsx)(k,{label:"\uD83D\uDC41 Vision"})]})]},e.id)})]})})]})]})]})})]})}function k(e){let{icon:t,label:r,className:s}=e;return(0,a.jsxs)("span",{className:(0,h.cn)("inline-flex items-center gap-0.5 rounded border px-1.5 py-0.5 text-[10px] leading-none text-muted-foreground",s),children:[t,r]})}},5121:(e,t,r)=>{r.d(t,{E:()=>i});var a=r(5155);r(2115);var s=r(1027),n=r(1567);let l=(0,s.F)("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground",secondary:"border-transparent bg-secondary text-secondary-foreground",destructive:"border-transparent bg-destructive text-destructive-foreground",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function i(e){let{className:t,variant:r,...s}=e;return(0,a.jsx)("div",{className:(0,n.cn)(l({variant:r}),t),...s})}},3312:(e,t,r)=>{r.d(t,{$:()=>o});var a=r(5155),s=r(2115),n=r(2317),l=r(1027),i=r(1567);let d=(0,l.F)("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),o=s.forwardRef((e,t)=>{let{className:r,variant:s,size:l,asChild:o=!1,...c}=e,u=o?n.DX:"button";return(0,a.jsx)(u,{className:(0,i.cn)(d({variant:s,size:l,className:r})),ref:t,...c})});o.displayName="Button"},1344:(e,t,r)=>{r.d(t,{Cf:()=>m,Es:()=>p,L3:()=>x,c7:()=>f,lG:()=>d,rr:()=>h});var a=r(5155),s=r(2115),n=r(6217),l=r(767),i=r(1567);let d=n.bL;n.l9;let o=n.ZL,c=n.bm,u=s.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,a.jsx)(n.hJ,{ref:t,className:(0,i.cn)("fixed inset-0 z-50 bg-black/60 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",r),...s})});u.displayName=n.hJ.displayName;let m=s.forwardRef((e,t)=>{let{className:r,children:s,...d}=e;return(0,a.jsxs)(o,{children:[(0,a.jsx)(u,{}),(0,a.jsxs)(n.UC,{ref:t,className:(0,i.cn)("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 rounded-lg",r),...d,children:[s,(0,a.jsx)(c,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring disabled:pointer-events-none",children:(0,a.jsx)(l.A,{className:"h-4 w-4"})})]})]})});m.displayName=n.UC.displayName;let f=e=>{let{className:t,...r}=e;return(0,a.jsx)("div",{className:(0,i.cn)("flex flex-col space-y-1.5 text-center sm:text-left",t),...r})};f.displayName="DialogHeader";let p=e=>{let{className:t,...r}=e;return(0,a.jsx)("div",{className:(0,i.cn)("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...r})};p.displayName="DialogFooter";let x=s.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,a.jsx)(n.hE,{ref:t,className:(0,i.cn)("text-lg font-semibold leading-none tracking-tight",r),...s})});x.displayName=n.hE.displayName;let h=s.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,a.jsx)(n.VY,{ref:t,className:(0,i.cn)("text-sm text-muted-foreground",r),...s})});h.displayName=n.VY.displayName},3900:(e,t,r)=>{r.d(t,{p:()=>l});var a=r(5155),s=r(2115),n=r(1567);let l=s.forwardRef((e,t)=>{let{className:r,type:s,...l}=e;return(0,a.jsx)("input",{type:s,className:(0,n.cn)("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",r),ref:t,...l})});l.displayName="Input"},8986:(e,t,r)=>{r.d(t,{J:()=>i});var a=r(5155),s=r(2115),n=r(6195),l=r(1567);let i=s.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,a.jsx)(n.b,{ref:t,className:(0,l.cn)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",r),...s})});i.displayName=n.b.displayName},7995:(e,t,r)=>{r.d(t,{F:()=>i});var a=r(5155),s=r(2115),n=r(1868),l=r(1567);let i=s.forwardRef((e,t)=>{let{className:r,children:s,...i}=e;return(0,a.jsxs)(n.bL,{ref:t,className:(0,l.cn)("relative overflow-hidden",r),...i,children:[(0,a.jsx)(n.LM,{className:"h-full w-full rounded-[inherit]",children:s}),(0,a.jsx)(d,{}),(0,a.jsx)(n.OK,{})]})});i.displayName=n.bL.displayName;let d=s.forwardRef((e,t)=>{let{className:r,orientation:s="vertical",...i}=e;return(0,a.jsx)(n.VM,{ref:t,orientation:s,className:(0,l.cn)("flex touch-none select-none transition-colors","vertical"===s&&"h-full w-2.5 border-l border-l-transparent p-[1px]","horizontal"===s&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",r),...i,children:(0,a.jsx)(n.lr,{className:"relative flex-1 rounded-full bg-border"})})});d.displayName=n.VM.displayName},7528:(e,t,r)=>{r.d(t,{bq:()=>u,eb:()=>f,gC:()=>m,l6:()=>o,yv:()=>c});var a=r(5155),s=r(2115),n=r(965),l=r(1719),i=r(8867),d=r(1567);let o=n.bL;n.YJ;let c=n.WT,u=s.forwardRef((e,t)=>{let{className:r,children:s,...i}=e;return(0,a.jsxs)(n.l9,{ref:t,className:(0,d.cn)("flex h-9 w-full items-center justify-between rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50",r),...i,children:[s,(0,a.jsx)(n.In,{asChild:!0,children:(0,a.jsx)(l.A,{className:"h-4 w-4 opacity-50"})})]})});u.displayName=n.l9.displayName;let m=s.forwardRef((e,t)=>{let{className:r,children:s,position:l="popper",...i}=e;return(0,a.jsx)(n.ZL,{children:(0,a.jsx)(n.UC,{ref:t,className:(0,d.cn)("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-white dark:bg-zinc-800 text-foreground shadow-xl animate-in fade-in-0 zoom-in-95","popper"===l&&"translate-y-1",r),position:l,...i,children:(0,a.jsx)(n.LM,{className:(0,d.cn)("p-1","popper"===l&&"w-full min-w-[var(--radix-select-trigger-width)]"),children:s})})})});m.displayName=n.UC.displayName;let f=s.forwardRef((e,t)=>{let{className:r,children:s,...l}=e;return(0,a.jsxs)(n.q7,{ref:t,className:(0,d.cn)("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",r),...l,children:[(0,a.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,a.jsx)(n.VF,{children:(0,a.jsx)(i.A,{className:"h-4 w-4"})})}),(0,a.jsx)(n.p4,{children:s})]})});f.displayName=n.q7.displayName,s.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,a.jsx)(n.JU,{ref:t,className:(0,d.cn)("py-1.5 pl-8 pr-2 text-xs font-semibold",r),...s})}).displayName=n.JU.displayName,s.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,a.jsx)(n.wv,{ref:t,className:(0,d.cn)("-mx-1 my-1 h-px bg-muted",r),...s})}).displayName=n.wv.displayName},488:(e,t,r)=>{r.d(t,{d:()=>i});var a=r(5155),s=r(2115),n=r(2413),l=r(1567);let i=s.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,a.jsx)(n.bL,{className:(0,l.cn)("peer inline-flex h-[22px] w-10 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent","transition-colors duration-200","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50","data-[state=unchecked]:bg-zinc-300 dark:data-[state=unchecked]:bg-zinc-600","data-[state=checked]:bg-[#57BE6B]",r),...s,ref:t,children:(0,a.jsx)(n.zi,{className:(0,l.cn)("pointer-events-none block h-[16px] w-[16px] rounded-full bg-white shadow-md ring-0","transition-transform duration-200","data-[state=checked]:translate-x-[18px] data-[state=unchecked]:translate-x-0")})})});i.displayName=n.bL.displayName},2884:(e,t,r)=>{r.d(t,{Xi:()=>o,av:()=>c,j7:()=>d,tU:()=>i});var a=r(5155),s=r(2115),n=r(3078),l=r(1567);let i=n.bL,d=s.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,a.jsx)(n.B8,{ref:t,className:(0,l.cn)("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",r),...s})});d.displayName=n.B8.displayName;let o=s.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,a.jsx)(n.l9,{ref:t,className:(0,l.cn)("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",r),...s})});o.displayName=n.l9.displayName;let c=s.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,a.jsx)(n.UC,{ref:t,className:(0,l.cn)("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",r),...s})});c.displayName=n.UC.displayName},6754:(e,t,r)=>{r.d(t,{T:()=>l});var a=r(5155),s=r(2115),n=r(1567);let l=s.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,a.jsx)("textarea",{className:(0,n.cn)("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",r),ref:t,...s})});l.displayName="Textarea"},1567:(e,t,r)=>{r.d(t,{cn:()=>n});var a=r(3463),s=r(9795);function n(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return(0,s.QP)((0,a.$)(t))}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5964],{8207:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(7401).A)("Brain",[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z",key:"ep3f8r"}],["path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4",key:"1p4c4q"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375",key:"tmeiqw"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M19.938 10.5a4 4 0 0 1 .585.396",key:"1qfode"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M19.967 17.484A4 4 0 0 1 18 18",key:"159ez6"}]])},8867:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(7401).A)("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]])},1719:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(7401).A)("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]])},6967:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(7401).A)("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]])},9257:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(7401).A)("Cpu",[["rect",{width:"16",height:"16",x:"4",y:"4",rx:"2",key:"14l7u7"}],["rect",{width:"6",height:"6",x:"9",y:"9",rx:"1",key:"5aljv4"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]])},4807:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(7401).A)("DollarSign",[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]])},853:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(7401).A)("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]])},6609:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(7401).A)("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]])},5027:(e,t,n)=>{n.d(t,{A:()=>r});let r=(0,n(7401).A)("Thermometer",[["path",{d:"M14 4v10.54a4 4 0 1 1-4 0V4a2 2 0 0 1 4 0Z",key:"17jzev"}]])},8050:(e,t,n)=>{function r(e,t,n){if(!t.has(e))throw TypeError("attempted to "+n+" private field on non-instance");return t.get(e)}function o(e,t){var n=r(e,t,"get");return n.get?n.get.call(e):n.value}function i(e,t,n){var o=r(e,t,"set");return!function(e,t,n){if(t.set)t.set.call(e,n);else{if(!t.writable)throw TypeError("attempted to set read only private field");t.value=n}}(e,o,n),n}n.d(t,{N:()=>m});var l,a,u=n(2115),s=n(8166),c=n(8068),f=n(2317),d=n(5155),p=Object.defineProperty,h=(e,t)=>p(e,"name",{value:t,configurable:!0});function m(e){let t=e+"CollectionProvider",[n,r]=(0,s.A)(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),l=h(e=>{let{scope:t,children:n}=e,r=u.useRef(null),i=u.useRef(new Map).current;return(0,d.jsx)(o,{scope:t,itemMap:i,collectionRef:r,children:n})},"CollectionProvider");l.displayName=t;let a=e+"CollectionSlot",p=(0,f.TL)(a),m=u.forwardRef((e,t)=>{let{scope:n,children:r}=e,o=i(a,n),l=(0,c.s)(t,o.collectionRef);return(0,d.jsx)(p,{ref:l,children:r})});m.displayName=a;let v=e+"CollectionItemSlot",g="data-radix-collection-item",y=(0,f.TL)(v),w=u.forwardRef((e,t)=>{let{scope:n,children:r,...o}=e,l=u.useRef(null),a=(0,c.s)(t,l),s=i(v,n);return u.useEffect(()=>(s.itemMap.set(l,{ref:l,...o}),()=>void s.itemMap.delete(l))),(0,d.jsx)(y,{[g]:"",ref:a,children:r})});function x(t){let n=i(e+"CollectionConsumer",t);return u.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll("[".concat(g,"]")));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return w.displayName=v,h(x,"useCollection"),[{Provider:l,Slot:m,ItemSlot:w},x,r]}h(m,"createCollection");var v=new WeakMap,g=(l=new WeakMap,h(a=class e extends Map{set(e,t){return v.get(this)&&(this.has(e)?o(this,l)[o(this,l).indexOf(e)]=e:o(this,l).push(e)),super.set(e,t),this}insert(e,t,n){let r;let i=this.has(t),a=o(this,l).length,u=x(e),s=u>=0?u:a+u,c=s<0||s>=a?-1:s;if(c===this.size||i&&c===this.size-1||-1===c)return this.set(t,n),this;let f=this.size+(i?0:1);u<0&&s++;let d=[...o(this,l)],p=!1;for(let e=s;e<f;e++)if(s===e){let o=d[e];d[e]===t&&(o=d[e+1]),i&&this.delete(t),r=this.get(o),this.set(t,n)}else{p||d[e-1]!==t||(p=!0);let n=d[p?e:e-1],o=r;r=this.get(n),this.delete(n),this.set(n,o)}return this}with(t,n,r){let o=new e(this);return o.insert(t,n,r),o}before(e){let t=o(this,l).indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,n){let r=o(this,l).indexOf(e);return -1===r?this:this.insert(r,t,n)}after(e){let t=o(this,l).indexOf(e);if(-1!==(t=-1===t||t===this.size-1?-1:t+1))return this.entryAt(t)}setAfter(e,t,n){let r=o(this,l).indexOf(e);return -1===r?this:this.insert(r+1,t,n)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return i(this,l,[]),super.clear()}delete(e){let t=super.delete(e);return t&&o(this,l).splice(o(this,l).indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return void 0!==t&&this.delete(t)}at(e){let t=y(o(this,l),e);if(void 0!==t)return this.get(t)}entryAt(e){let t=y(o(this,l),e);if(void 0!==t)return[t,this.get(t)]}indexOf(e){return o(this,l).indexOf(e)}keyAt(e){return y(o(this,l),e)}from(e,t){let n=this.indexOf(e);if(-1===n)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.at(r)}keyFrom(e,t){let n=this.indexOf(e);if(-1===n)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.keyAt(r)}find(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return r;n++}}findIndex(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return n;n++}return -1}filter(t,n){let r=[],o=0;for(let e of this)Reflect.apply(t,n,[e,o,this])&&r.push(e),o++;return new e(r)}map(t,n){let r=[],o=0;for(let e of this)r.push([e[0],Reflect.apply(t,n,[e,o,this])]),o++;return new e(r)}reduce(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];let[r,o]=t,i=0,l=null!=o?o:this.at(0);for(let e of this)l=0===i&&1===t.length?e:Reflect.apply(r,this,[l,e,i,this]),i++;return l}reduceRight(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];let[r,o]=t,i=null!=o?o:this.at(-1);for(let e=this.size-1;e>=0;e--){let n=this.at(e);i=e===this.size-1&&1===t.length?n:Reflect.apply(r,this,[i,n,e,this])}return i}toSorted(t){return new e([...this.entries()].sort(t))}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let n=this.keyAt(e),r=this.get(n);t.set(n,r)}return t}toSpliced(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];let o=[...this.entries()];return o.splice(...n),new e(o)}slice(t,n){let r=new e,o=this.size-1;if(void 0===t)return r;t<0&&(t+=this.size),void 0!==n&&n>0&&(o=n-1);for(let e=t;e<=o;e++){let t=this.keyAt(e),n=this.get(t);r.set(t,n)}return r}every(e,t){let n=0;for(let r of this){if(!Reflect.apply(e,t,[r,n,this]))return!1;n++}return!0}some(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return!0;n++}return!1}constructor(e){super(e),function(e,t,n){(function(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.set(e,n)}(this,l,{writable:!0,value:void 0}),i(this,l,[...super.keys()]),v.set(this,!0)}},"OrderedDict"),a);function y(e,t){if("at"in Array.prototype)return Array.prototype.at.call(e,t);let n=w(e,t);return -1===n?void 0:e[n]}function w(e,t){let n=e.length,r=x(t),o=r>=0?r:n+r;return o<0||o>=n?-1:o}function x(e){return e!=e||0===e?0:Math.trunc(e)}function b(e,t){if(e===t)return!0;if("object"!=typeof e||"object"!=typeof t||null==e||null==t)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||e[r]!==t[r])return!1;return!0}function S(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}function R(e,t){return e[1].element&&t[1].element?S(e[1].element,t[1].element)?-1:1:0}function C(e){return new MutationObserver(t=>{for(let n of t)if("childList"===n.type){e();return}})}h(y,"at"),h(w,"toSafeIndex"),h(x,"toSafeInteger"),h(function(e){let t=e+"CollectionProvider",[n,r]=(0,s.A)(t),[o,i]=n(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new g,setItemMap:h(()=>void 0,"setItemMap")}),l=h(e=>{let{state:t,...n}=e;return t?(0,d.jsx)(p,{...n,state:t}):(0,d.jsx)(a,{...n})},"CollectionProvider");l.displayName=t;let a=h(e=>{let t=A();return(0,d.jsx)(p,{...e,state:t})},"CollectionInit");a.displayName=t+"Init";let p=h(e=>{let{scope:t,children:n,state:r}=e,i=u.useRef(null),[l,a]=u.useState(null),s=(0,c.s)(i,a),[f,p]=r;return u.useEffect(()=>{if(!l)return;let e=C(()=>{});return e.observe(l,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[l]),(0,d.jsx)(o,{scope:t,itemMap:f,setItemMap:p,collectionRef:s,collectionRefObject:i,collectionElement:l,children:n})},"CollectionProviderImpl");p.displayName=t+"Impl";let m=e+"CollectionSlot",v=(0,f.TL)(m),y=u.forwardRef((e,t)=>{let{scope:n,children:r}=e,o=i(m,n),l=(0,c.s)(t,o.collectionRef);return(0,d.jsx)(v,{ref:l,children:r})});y.displayName=m;let w=e+"CollectionItemSlot",x=(0,f.TL)(w),S=u.forwardRef((e,t)=>{let{scope:n,children:r,...o}=e,l=u.useRef(null),[a,s]=u.useState(null),f=(0,c.s)(t,l,s),{setItemMap:p}=i(w,n),h=u.useRef(o);b(h.current,o)||(h.current=o);let m=h.current;return u.useEffect(()=>(p(e=>a?e.has(a)?e.set(a,{...m,element:a}).toSorted(R):(e.set(a,{...m,element:a}),e.toSorted(R)):e),()=>{p(e=>a&&e.has(a)?(e.delete(a),new g(e)):e)}),[a,m,p]),(0,d.jsx)(x,{"data-radix-collection-item":"",ref:f,children:r})});function A(){return u.useState(new g)}function k(t){let{itemMap:n}=i(e+"CollectionConsumer",t);return n}return S.displayName=w,h(A,"useInitCollection"),h(k,"useCollection"),[{Provider:l,Slot:y,ItemSlot:S},{createCollectionScope:r,useCollection:k,useInitCollection:A}]},"createCollection"),h(b,"shallowEqual"),h(S,"isElementPreceding"),h(R,"sortByDocumentPosition"),h(C,"getChildListObserver")},6195:(e,t,n)=>{n.d(t,{b:()=>a});var r=n(2115),o=n(3360),i=n(5155),l=Object.defineProperty,a=r.forwardRef(l(function(e,t){return(0,i.jsx)(o.sG.label,{...e,ref:t,onMouseDown:t=>{var n;t.target.closest("button, input, select, textarea")||(null===(n=e.onMouseDown)||void 0===n||n.call(e,t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},"name",{value:"Label",configurable:!0}))},965:(e,t,n)=>{let r;n.d(t,{UC:()=>tP,YJ:()=>tW,In:()=>tA,q7:()=>tX,VF:()=>tJ,p4:()=>tY,JU:()=>tq,ZL:()=>tT,bL:()=>tS,wv:()=>tQ,l9:()=>tR,WT:()=>tC,LM:()=>tB});var o=n(2115),i=n(7650),l=n(1786),a=n(3610),u=n(8050),s=n(8068),c=n(8166),f=n(4256),d=n(3741),p=n(2292),h=n(196),m=n(7668);let v=["top","right","bottom","left"],g=Math.min,y=Math.max,w=Math.round,x=Math.floor,b=e=>({x:e,y:e}),S={left:"right",right:"left",bottom:"top",top:"bottom"};function R(e,t){return"function"==typeof e?e(t):e}function C(e){return e.split("-")[0]}function A(e){return e.split("-")[1]}function k(e){return"x"===e?"y":"x"}function j(e){return"y"===e?"height":"width"}function T(e){let t=e[0];return"t"===t||"b"===t?"y":"x"}function E(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}let P=["left","right"],M=["right","left"],I=["top","bottom"],O=["bottom","top"];function L(e){let t=C(e);return S[t]+e.slice(t.length)}function D(e){var t,n,r,o;return"number"!=typeof e?{top:null!=(t=e.top)?t:0,right:null!=(n=e.right)?n:0,bottom:null!=(r=e.bottom)?r:0,left:null!=(o=e.left)?o:0}:{top:e,right:e,bottom:e,left:e}}function F(e){let{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function H(e,t,n){let r,{reference:o,floating:i}=e,l=T(t),a=k(T(t)),u=j(a),s=C(t),c=o.x+o.width/2-i.width/2,f=o.y+o.height/2-i.height/2,d=o[u]/2-i[u]/2;switch(s){case"top":r={x:c,y:o.y-i.height};break;case"bottom":r={x:c,y:o.y+o.height};break;case"right":r={x:o.x+o.width,y:f};break;case"left":r={x:o.x-i.width,y:f};break;default:r={x:o.x,y:o.y}}let p=A(t);return p&&(r[a]+=d*("end"===p?1:-1)*(n&&"y"===l?-1:1)),r}async function K(e,t){var n;void 0===t&&(t={});let{x:r,y:o,platform:i,rects:l,elements:a,strategy:u}=e,{boundary:s="clippingAncestors",rootBoundary:c="viewport",elementContext:f="floating",altBoundary:d=!1,padding:p=0}=R(t,e),h=D(p),m=a[d?"floating"===f?"reference":"floating":f],v=F(await i.getClippingRect({element:null==(n=await (null==i.isElement?void 0:i.isElement(m)))||n?m:m.contextElement||await (null==i.getDocumentElement?void 0:i.getDocumentElement(a.floating)),boundary:s,rootBoundary:c,strategy:u})),g="floating"===f?{x:r,y:o,width:l.floating.width,height:l.floating.height}:l.reference,y=await (null==i.getOffsetParent?void 0:i.getOffsetParent(a.floating)),w=await (null==i.isElement?void 0:i.isElement(y))&&await (null==i.getScale?void 0:i.getScale(y))||{x:1,y:1},x=F(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:g,offsetParent:y,strategy:u}):g);return{top:(v.top-x.top+h.top)/w.y,bottom:(x.bottom-v.bottom+h.bottom)/w.y,left:(v.left-x.left+h.left)/w.x,right:(x.right-v.right+h.right)/w.x}}let N=async(e,t,n)=>{let{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:l}=n,a=l.detectOverflow?l:{...l,detectOverflow:K},u=await (null==l.isRTL?void 0:l.isRTL(t)),s=await l.getElementRects({reference:e,floating:t,strategy:o}),{x:c,y:f}=H(s,r,u),d=r,p=0,h={};for(let n=0;n<i.length;n++){let m=i[n];if(!m)continue;let{name:v,fn:g}=m,{x:y,y:w,data:x,reset:b}=await g({x:c,y:f,initialPlacement:r,placement:d,strategy:o,middlewareData:h,rects:s,platform:a,elements:{reference:e,floating:t}});c=null!=y?y:c,f=null!=w?w:f,h[v]={...h[v],...x},b&&p<50&&(p++,"object"==typeof b&&(b.placement&&(d=b.placement),b.rects&&(s=!0===b.rects?await l.getElementRects({reference:e,floating:t,strategy:o}):b.rects),{x:c,y:f}=H(s,d,u)),n=-1)}return{x:c,y:f,placement:d,strategy:o,middlewareData:h}};function z(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function B(e){return v.some(t=>e[t]>=0)}let G=new Set(["left","top"]);async function V(e,t){let{placement:n,platform:r,elements:o}=e,i=await (null==r.isRTL?void 0:r.isRTL(o.floating)),l=C(n),a=A(n),u="y"===T(n),s=G.has(l)?-1:1,c=i&&u?-1:1,f=R(t,e),{mainAxis:d,crossAxis:p,alignmentAxis:h}="number"==typeof f?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return a&&"number"==typeof h&&(p="end"===a?-1*h:h),u?{x:p*c,y:d*s}:{x:d*s,y:p*c}}function W(){return"undefined"!=typeof window}function q(e){return Z(e)?(e.nodeName||"").toLowerCase():"#document"}function _(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function U(e){var t;return null==(t=(Z(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function Z(e){return!!W()&&(e instanceof Node||e instanceof _(e).Node)}function X(e){return!!W()&&(e instanceof Element||e instanceof _(e).Element)}function $(e){return!!W()&&(e instanceof HTMLElement||e instanceof _(e).HTMLElement)}function Y(e){return!!W()&&"undefined"!=typeof ShadowRoot&&(e instanceof ShadowRoot||e instanceof _(e).ShadowRoot)}function J(e){let{overflow:t,overflowX:n,overflowY:r,display:o}=el(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&"inline"!==o&&"contents"!==o}function Q(e){try{if(e.matches(":popover-open"))return!0}catch(e){}try{return e.matches(":modal")}catch(e){return!1}}let ee=/transform|translate|scale|rotate|perspective|filter/,et=/paint|layout|strict|content/,en=e=>!!e&&"none"!==e;function er(e){let t=X(e)?el(e):e;return en(t.transform)||en(t.translate)||en(t.scale)||en(t.rotate)||en(t.perspective)||!eo()&&(en(t.backdropFilter)||en(t.filter))||ee.test(t.willChange||"")||et.test(t.contain||"")}function eo(){return null==r&&(r="undefined"!=typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),r}function ei(e){return/^(html|body|#document)$/.test(q(e))}function el(e){return _(e).getComputedStyle(e)}function ea(e){return X(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function eu(e){if("html"===q(e))return e;let t=e.assignedSlot||e.parentNode||Y(e)&&e.host||U(e);return Y(t)?t.host:t}function es(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);let o=function e(t){let n=eu(t);return ei(n)?(t.ownerDocument||t).body:$(n)&&J(n)?n:e(n)}(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),l=_(o);if(!i)return t.concat(o,es(o,[],n));{let e=ec(l);return t.concat(l,l.visualViewport||[],J(o)?o:[],e&&n?es(e):[])}}function ec(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function ef(e){let t=el(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,o=$(e),i=o?e.offsetWidth:n,l=o?e.offsetHeight:r,a=w(n)!==i||w(r)!==l;return a&&(n=i,r=l),{width:n,height:r,$:a}}function ed(e){return X(e)?e:e.contextElement}function ep(e){let t=ed(e);if(!$(t))return b(1);let n=t.getBoundingClientRect(),{width:r,height:o,$:i}=ef(t),l=(i?w(n.width):n.width)/r,a=(i?w(n.height):n.height)/o;return l&&Number.isFinite(l)||(l=1),a&&Number.isFinite(a)||(a=1),{x:l,y:a}}let eh=b(0);function em(e){let t=_(e);return eo()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:eh}function ev(e,t,n,r){var o;void 0===t&&(t=!1),void 0===n&&(n=!1);let i=e.getBoundingClientRect(),l=ed(e),a=b(1);t&&(r?X(r)&&(a=ep(r)):a=ep(e));let u=(void 0===(o=n)&&(o=!1),r&&o&&r===_(l))?em(l):b(0),s=(i.left+u.x)/a.x,c=(i.top+u.y)/a.y,f=i.width/a.x,d=i.height/a.y;if(l&&r){let e=_(l),t=X(r)?_(r):r,n=e,o=ec(n);for(;o&&t!==n;){let e=ep(o),t=o.getBoundingClientRect(),r=el(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,l=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;s*=e.x,c*=e.y,f*=e.x,d*=e.y,s+=i,c+=l,o=ec(n=_(o))}}return F({width:f,height:d,x:s,y:c})}function eg(e,t){let n=ea(e).scrollLeft;return t?t.left+n:ev(U(e)).left+n}function ey(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-eg(e,n),y:n.top+t.scrollTop}}function ew(e,t,n){let r;if("viewport"===t||"layoutViewport"===t)r=function(e,t,n){void 0===n&&(n="viewport");let r="layoutViewport"===n,o=_(e),i=U(e),l=o.visualViewport,a=i.clientWidth,u=i.clientHeight,s=0,c=0;if(l){let e=!eo()||"fixed"===t;r?e||(s=-l.offsetLeft,c=-l.offsetTop):(a=l.width,u=l.height,e&&(s=l.offsetLeft,c=l.offsetTop))}if(0>=eg(i)){let e=i.ownerDocument,t=e.body,n=getComputedStyle(t),r="CSS1Compat"===e.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(i.clientWidth-t.clientWidth-r),l="stable both-edges"===getComputedStyle(i).scrollbarGutter?o/2:o;l<=25&&(a-=l)}return{width:a,height:u,x:s,y:c}}(e,n,t);else if("document"===t)r=function(e){let t=ea(e),n=e.ownerDocument.body,r=y(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),o=y(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),i=-t.scrollLeft+eg(e),l=-t.scrollTop;return"rtl"===el(n).direction&&(i+=y(e.clientWidth,n.clientWidth)-r),{width:r,height:o,x:i,y:l}}(U(e));else if(X(t))r=function(e,t){let n=ev(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=ep(e),l=e.clientWidth*i.x;return{width:l,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}(t,n);else{let n=em(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return F(r)}function ex(e){return"static"===el(e).position}function eb(e,t){if(!$(e)||"fixed"===el(e).position)return null;if(t)return t(e);let n=e.offsetParent;return U(e)===n&&(n=n.ownerDocument.body),n}function eS(e,t){var n;let r=_(e);if(Q(e))return r;if(!$(e)){let t=eu(e);for(;t&&!ei(t);){if(X(t)&&!ex(t))return t;t=eu(t)}return r}let o=eb(e,t);for(;o&&(n=o,/^(table|td|th)$/.test(q(n)))&&ex(o);)o=eb(o,t);return o&&ei(o)&&ex(o)&&!er(o)?r:o||function(e){let t=eu(e);for(;$(t)&&!ei(t);){if(er(t))return t;if(Q(t))break;t=eu(t)}return null}(e)||r}let eR=async function(e){let t=this.getOffsetParent||eS,n=this.getDimensions,r=await n(e.floating);return{reference:function(e,t,n){let r=$(t),o=U(t),i="fixed"===n,l=ev(e,!0,i,t),a={scrollLeft:0,scrollTop:0},u=b(0);if((r||!i)&&(("body"!==q(t)||J(o))&&(a=ea(t)),r)){let e=ev(t,!0,i,t);u.x=e.x+t.clientLeft,u.y=e.y+t.clientTop}!r&&o&&(u.x=eg(o));let s=!o||r||i?b(0):ey(o,a);return{x:l.left+a.scrollLeft-u.x-s.x,y:l.top+a.scrollTop-u.y-s.y,width:l.width,height:l.height}}(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},eC={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e,i="fixed"===o,l=U(r),a=!!t&&Q(t.floating);if(r===l||a&&i)return n;let u={scrollLeft:0,scrollTop:0},s=b(1),c=b(0),f=$(r);if((f||!i)&&(("body"!==q(r)||J(l))&&(u=ea(r)),f)){let e=ev(r);s=ep(r),c.x=e.x+r.clientLeft,c.y=e.y+r.clientTop}let d=!l||f||i?b(0):ey(l,u);return{width:n.width*s.x,height:n.height*s.y,x:n.x*s.x-u.scrollLeft*s.x+c.x+d.x,y:n.y*s.y-u.scrollTop*s.y+c.y+d.y}},getDocumentElement:U,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e,i=[..."clippingAncestors"===n?Q(t)?[]:function(e,t){let n=t.get(e);if(n)return n;let r=es(e,[],!1).filter(e=>X(e)&&"body"!==q(e)),o=null,i="fixed"===el(e).position,l=i?eu(e):e;for(;X(l)&&!ei(l);){let e=el(l),t=er(l),n=o?o.position:i?"fixed":"";t||"fixed"!==n&&("absolute"!==n||"static"!==e.position)?o=e:r=r.filter(e=>e!==l),l=eu(l)}return t.set(e,r),r}(t,this._c):[].concat(n),r],l=ew(t,i[0],o),a=l.top,u=l.right,s=l.bottom,c=l.left;for(let e=1;e<i.length;e++){let n=ew(t,i[e],o);a=y(n.top,a),u=g(n.right,u),s=g(n.bottom,s),c=y(n.left,c)}return{width:u-c,height:s-a,x:c,y:a}},getOffsetParent:eS,getElementRects:eR,getClientRects:function(e){return e.getClientRects?Array.from(e.getClientRects()):[]},getDimensions:function(e){let{width:t,height:n}=ef(e);return{width:t,height:n}},getScale:ep,isElement:X,isRTL:function(e){return"rtl"===el(e).direction}};function eA(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}let ek=e=>({name:"arrow",options:e,async fn(t){let{x:n,y:r,placement:o,rects:i,platform:l,elements:a,middlewareData:u}=t,{element:s,padding:c=0}=R(e,t)||{};if(null==s)return{};let f=D(c),d={x:n,y:r},p=k(T(o)),h=j(p),m=await l.getDimensions(s),v="y"===p,w=v?"clientHeight":"clientWidth",x=i.reference[h]+i.reference[p]-d[p]-i.floating[h],b=d[p]-i.reference[p],S=await (null==l.getOffsetParent?void 0:l.getOffsetParent(s)),C=S?S[w]:0;C&&await (null==l.isElement?void 0:l.isElement(S))||(C=a.floating[w]||i.floating[h]);let E=C/2-m[h]/2-1,P=g(f[v?"top":"left"],E),M=g(f[v?"bottom":"right"],E),I=C-m[h]-M,O=C/2-m[h]/2+(x/2-b/2),L=y(P,g(O,I)),F=!u.arrow&&null!=A(o)&&O!==L&&i.reference[h]/2-(O<P?P:M)-m[h]/2<0,H=F?O<P?O-P:O-I:0;return{[p]:d[p]+H,data:{[p]:L,centerOffset:O-L-H,...F&&{alignmentOffset:H}},reset:F}}}),ej=(e,t,n)=>{let r=new Map,o=null!=n?n:{},i={...eC,...o.platform,_c:r};return N(e,t,{...o,platform:i})};var eT="undefined"!=typeof document?o.useLayoutEffect:function(){};function eE(e,t){let n,r,o;if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if((n=e.length)!==t.length)return!1;for(r=n;0!=r--;)if(!eE(e[r],t[r]))return!1;return!0}if((n=(o=Object.keys(e)).length)!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!({}).hasOwnProperty.call(t,o[r]))return!1;for(r=n;0!=r--;){let n=o[r];if(("_owner"!==n||!e.$$typeof)&&!eE(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function eP(e){return"undefined"==typeof window?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function eM(e,t){let n=eP(e);return Math.round(t*n)/n}function eI(e){let t=o.useRef(e);return eT(()=>{t.current=e}),t}let eO=e=>({name:"arrow",options:e,fn(t){let{element:n,padding:r}="function"==typeof e?e(t):e;return n&&({}).hasOwnProperty.call(n,"current")?null!=n.current?ek({element:n.current,padding:r}).fn(t):{}:n?ek({element:n,padding:r}).fn(t):{}}}),eL=(e,t)=>{let n=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;let{x:o,y:i,placement:l,middlewareData:a}=t,u=await V(t,e);return l===(null==(n=a.offset)?void 0:n.placement)&&null!=(r=a.arrow)&&r.alignmentOffset?{}:{x:o+u.x,y:i+u.y,data:{...u,placement:l}}}}}(e);return{name:n.name,fn:n.fn,options:[e,t]}},eD=(e,t)=>{let n=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){let{x:n,y:r,placement:o,platform:i}=t,{mainAxis:l=!0,crossAxis:a=!1,limiter:u={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...s}=R(e,t),c={x:n,y:r},f=await i.detectOverflow(t,s),d=T(o),p=k(d),h=c[p],m=c[d],v=(e,t)=>y(t+f["y"===e?"top":"left"],g(t,t-f["y"===e?"bottom":"right"]));l&&(h=v(p,h)),a&&(m=v(d,m));let w=u.fn({...t,[p]:h,[d]:m});return{...w,data:{x:w.x-n,y:w.y-r,enabled:{[p]:l,[d]:a}}}}}}(e);return{name:n.name,fn:n.fn,options:[e,t]}},eF=(e,t)=>({fn:function(e){return void 0===e&&(e={}),{options:e,fn(t){var n,r,o,i;let{x:l,y:a,placement:u,rects:s,middlewareData:c}=t,{offset:f=0,mainAxis:d=!0,crossAxis:p=!0}=R(e,t),h={x:l,y:a},m=T(u),v=k(m),g=h[v],y=h[m],w=R(f,t),x="number"==typeof w?{mainAxis:w,crossAxis:0}:{mainAxis:null!=(n=w.mainAxis)?n:0,crossAxis:null!=(r=w.crossAxis)?r:0};if(d){let e="y"===v?"height":"width",t=s.reference[v]-s.floating[e]+x.mainAxis,n=s.reference[v]+s.reference[e]-x.mainAxis;g<t?g=t:g>n&&(g=n)}if(p){let e="y"===v?"width":"height",t=G.has(C(u)),n=s.reference[m]-s.floating[e]+(t&&(null==(o=c.offset)?void 0:o[m])||0)+(t?0:x.crossAxis),r=s.reference[m]+s.reference[e]+(t?0:(null==(i=c.offset)?void 0:i[m])||0)-(t?x.crossAxis:0);y<n?y=n:y>r&&(y=r)}return{[v]:g,[m]:y}}}}(e).fn,options:[e,t]}),eH=(e,t)=>{let n=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r,o,i,l;let{placement:a,middlewareData:u,rects:s,initialPlacement:c,platform:f,elements:d}=t,{mainAxis:p=!0,crossAxis:h=!0,fallbackPlacements:m,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:y=!0,...w}=R(e,t);if(null!=(n=u.arrow)&&n.alignmentOffset)return{};let x=C(a),b=T(c),S=C(c)===c,D=await (null==f.isRTL?void 0:f.isRTL(d.floating)),F=m||(S||!y?[L(c)]:function(e){let t=L(e);return[E(e),t,E(t)]}(c)),H="none"!==g;!m&&H&&F.push(...function(e,t,n,r){let o=A(e),i=function(e,t,n){switch(e){case"top":case"bottom":if(n)return t?M:P;return t?P:M;case"left":case"right":return t?I:O;default:return[]}}(C(e),"start"===n,r);return o&&(i=i.map(e=>e+"-"+o),t&&(i=i.concat(i.map(E)))),i}(c,y,g,D));let K=[c,...F],N=await f.detectOverflow(t,w),z=[],B=(null==(r=u.flip)?void 0:r.overflows)||[];if(p&&z.push(N[x]),h){let e=function(e,t,n){void 0===n&&(n=!1);let r=A(e),o=k(T(e)),i=j(o),l="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(l=L(l)),[l,L(l)]}(a,s,D);z.push(N[e[0]],N[e[1]])}if(B=[...B,{placement:a,overflows:z}],!z.every(e=>e<=0)){let e=((null==(o=u.flip)?void 0:o.index)||0)+1,t=K[e];if(t&&(!("alignment"===h&&b!==T(t))||B.every(e=>T(e.placement)!==b||e.overflows[0]>0)))return{data:{index:e,overflows:B},reset:{placement:t}};let n=null==(i=B.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:i.placement;if(!n)switch(v){case"bestFit":{let e=null==(l=B.filter(e=>{if(H){let t=T(e.placement);return t===b||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:l[0];e&&(n=e);break}case"initialPlacement":n=c}if(a!==n)return{reset:{placement:n}}}return{}}}}(e);return{name:n.name,fn:n.fn,options:[e,t]}},eK=(e,t)=>{let n=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){let n,r;let{placement:o,rects:i,platform:l,elements:a}=t,{apply:u=()=>{},...s}=R(e,t),c=await l.detectOverflow(t,s),f=C(o),d=A(o),p="y"===T(o),{width:h,height:m}=i.floating;"top"===f||"bottom"===f?(n=f,r=d===(await (null==l.isRTL?void 0:l.isRTL(a.floating))?"start":"end")?"left":"right"):(r=f,n="end"===d?"top":"bottom");let v=m-c.top-c.bottom,w=h-c.left-c.right,x=g(m-c[n],v),b=g(h-c[r],w),S=t.middlewareData.shift,k=!S,j=x,E=b;null!=S&&S.enabled.x&&(E=w),null!=S&&S.enabled.y&&(j=v),k&&!d&&(p?E=h-2*y(c.left,c.right):j=m-2*y(c.top,c.bottom)),await u({...t,availableWidth:E,availableHeight:j});let P=await l.getDimensions(a.floating);return h!==P.width||m!==P.height?{reset:{rects:!0}}:{}}}}(e);return{name:n.name,fn:n.fn,options:[e,t]}},eN=(e,t)=>{let n=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:o="referenceHidden",...i}=R(e,t);switch(o){case"referenceHidden":{let e=z(await r.detectOverflow(t,{...i,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:B(e)}}}case"escaped":{let e=z(await r.detectOverflow(t,{...i,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:B(e)}}}default:return{}}}}}(e);return{name:n.name,fn:n.fn,options:[e,t]}},ez=(e,t)=>{let n=eO(e);return{name:n.name,fn:n.fn,options:[e,t]}};var eB=n(3360),eG=n(1524),eV=n(6611),eW=n(7510),eq=n(5155),e_=Object.defineProperty,eU=(e,t)=>e_(e,"name",{value:t,configurable:!0}),eZ="Popper",[eX,e$]=(0,c.A)(eZ),[eY,eJ]=eX(eZ),eQ=eU(e=>{let{__scopePopper:t,children:n}=e,[r,i]=o.useState(null),[l,a]=o.useState(void 0);return(0,eq.jsx)(eY,{scope:t,anchor:r,onAnchorChange:i,placementState:l,setPlacementState:a,children:n})},"Popper"),e0=o.forwardRef(eU(function(e,t){let{__scopePopper:n,virtualRef:r,...i}=e,l=eJ("PopperAnchor",n),a=o.useRef(null),u=l.onAnchorChange,c=o.useCallback(e=>{a.current=e,e&&u(e)},[u]),f=(0,s.s)(t,c),d=o.useRef(null);o.useEffect(()=>{if(!r)return;let e=d.current;d.current=r.current,e!==d.current&&u(d.current)});let p=l.placementState&&e8(l.placementState),h=null==p?void 0:p[0],m=null==p?void 0:p[1];return r?null:(0,eq.jsx)(eB.sG.div,{"data-radix-popper-side":h,"data-radix-popper-align":m,...i,ref:f})},"PopperAnchor")),e1="PopperContent",[e2,e5]=eX(e1),e6=o.forwardRef(eU(function(e,t){var n,r,l,a,u,c,f,d,p;let{__scopePopper:h,side:m="bottom",sideOffset:v=0,align:w="center",alignOffset:b=0,arrowPadding:S=0,avoidCollisions:R=!0,collisionBoundary:C=[],collisionPadding:A=0,sticky:k="partial",hideWhenDetached:j=!1,updatePositionStrategy:T="optimized",onPlaced:E,...P}=e,M=eJ(e1,h),[I,O]=o.useState(null),L=(0,s.s)(t,O),[D,F]=o.useState(null),H=(0,eW.X)(D),K=null!==(d=null==H?void 0:H.width)&&void 0!==d?d:0,N=null!==(p=null==H?void 0:H.height)&&void 0!==p?p:0,z="number"==typeof A?A:{top:0,right:0,bottom:0,left:0,...A},B=Array.isArray(C)?C:[C],G=B.length>0,V={padding:z,boundary:B.filter(e4),altBoundary:G},{refs:W,floatingStyles:q,placement:Z,isPositioned:X,middlewareData:$}=function(e){void 0===e&&(e={});let{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:l,elements:{reference:a,floating:u}={},transform:s=!0,whileElementsMounted:c,open:f}=e,[d,p]=o.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,m]=o.useState(r);eE(h,r)||m(r);let[v,g]=o.useState(null),[y,w]=o.useState(null),x=o.useCallback(e=>{e!==C.current&&(C.current=e,g(e))},[]),b=o.useCallback(e=>{e!==A.current&&(A.current=e,w(e))},[]),S=a||v,R=u||y,C=o.useRef(null),A=o.useRef(null),k=o.useRef(d),j=null!=c,T=eI(c),E=eI(l),P=eI(f),M=o.useCallback(()=>{if(!C.current||!A.current)return;let e={placement:t,strategy:n,middleware:h};E.current&&(e.platform=E.current),ej(C.current,A.current,e).then(e=>{let t={...e,isPositioned:!1!==P.current};I.current&&!eE(k.current,t)&&(k.current=t,i.flushSync(()=>{p(t)}))})},[h,t,n,E,P]);eT(()=>{!1===f&&k.current.isPositioned&&(k.current.isPositioned=!1,p(e=>({...e,isPositioned:!1})))},[f]);let I=o.useRef(!1);eT(()=>(I.current=!0,()=>{I.current=!1}),[]),eT(()=>{if(S&&(C.current=S),R&&(A.current=R),S&&R){if(T.current)return T.current(S,R,M);M()}},[S,R,M,T,j]);let O=o.useMemo(()=>({reference:C,floating:A,setReference:x,setFloating:b}),[x,b]),L=o.useMemo(()=>({reference:S,floating:R}),[S,R]),D=o.useMemo(()=>{let e={position:n,left:0,top:0};if(!L.floating)return e;let t=eM(L.floating,d.x),r=eM(L.floating,d.y);return s?{...e,transform:"translate("+t+"px, "+r+"px)",...eP(L.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}},[n,s,L.floating,d.x,d.y]);return o.useMemo(()=>({...d,update:M,refs:O,elements:L,floatingStyles:D}),[d,M,O,L,D])}({strategy:"fixed",placement:m+("center"!==w?"-"+w:""),whileElementsMounted:eU(function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e,t,n,r){let o;void 0===r&&(r={});let{ancestorScroll:i=!0,ancestorResize:l=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:u="function"==typeof IntersectionObserver,animationFrame:s=!1}=r,c=ed(e),f=i||l?[...c?es(c):[],...t?es(t):[]]:[];f.forEach(e=>{i&&e.addEventListener("scroll",n),l&&e.addEventListener("resize",n)});let d=c&&u?function(e,t,n){let r,o=null,i=U(e);function l(){var e;clearTimeout(r),null==(e=o)||e.disconnect(),o=null}function a(n,u){void 0===n&&(n=!1),void 0===u&&(u=1),l();let s=e.getBoundingClientRect(),{left:c,top:f,width:d,height:p}=s;if(n||t(),!d||!p)return;let h=x(f),m=x(i.clientWidth-(c+d)),v={rootMargin:-h+"px "+-m+"px "+-x(i.clientHeight-(f+p))+"px "+-x(c)+"px",threshold:y(0,g(1,u))||1},w=!0;function b(t){let n=t[0].intersectionRatio;if(!eA(s,e.getBoundingClientRect()))return a();if(n!==u){if(!w)return a();n?a(!1,n):r=setTimeout(()=>{a(!1,1e-7)},1e3)}w=!1}try{o=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch(e){o=new IntersectionObserver(b,v)}o.observe(e)}let u=_(e),s=()=>a(n);return u.addEventListener("resize",s),a(!0),()=>{u.removeEventListener("resize",s),l()}}(c,n,l):null,p=-1,h=null;a&&(h=new ResizeObserver(e=>{let[r]=e;r&&r.target===c&&h&&t&&(h.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var e;null==(e=h)||e.observe(t)})),n()}),c&&!s&&h.observe(c),t&&h.observe(t));let m=s?ev(e):null;return s&&function t(){let r=ev(e);m&&!eA(m,r)&&n(),m=r,o=requestAnimationFrame(t)}(),n(),()=>{var e;f.forEach(e=>{i&&e.removeEventListener("scroll",n),l&&e.removeEventListener("resize",n)}),null==d||d(),null==(e=h)||e.disconnect(),h=null,s&&cancelAnimationFrame(o)}}(...t,{animationFrame:"always"===T})},"whileElementsMounted"),elements:{reference:M.anchor},middleware:[eL({mainAxis:v+N,alignmentAxis:b}),R&&eD({mainAxis:!0,crossAxis:!1,limiter:"partial"===k?eF():void 0,...V}),R&&eH({...V}),eK({...V,apply:eU(e=>{let{elements:t,rects:n,availableWidth:r,availableHeight:o}=e,{width:i,height:l}=n.reference,a=t.floating.style;a.setProperty("--radix-popper-available-width","".concat(r,"px")),a.setProperty("--radix-popper-available-height","".concat(o,"px")),a.setProperty("--radix-popper-anchor-width","".concat(i,"px")),a.setProperty("--radix-popper-anchor-height","".concat(l,"px"))},"apply")}),D&&ez({element:D,padding:S}),e7({arrowWidth:K,arrowHeight:N}),j&&eN({strategy:"referenceHidden",...V,boundary:G?V.boundary:void 0})]}),Y=M.setPlacementState;(0,eV.N)(()=>(Y(Z),()=>{Y(void 0)}),[Z,Y]);let[J,Q]=e8(Z),ee=(0,eG.c)(E);(0,eV.N)(()=>{X&&(null==ee||ee())},[X,ee]);let et=null===(n=$.arrow)||void 0===n?void 0:n.x,en=null===(r=$.arrow)||void 0===r?void 0:r.y,er=(null===(l=$.arrow)||void 0===l?void 0:l.centerOffset)!==0,[eo,ei]=o.useState();return(0,eV.N)(()=>{I&&ei(window.getComputedStyle(I).zIndex)},[I]),(0,eq.jsx)("div",{ref:W.setFloating,"data-radix-popper-content-wrapper":"",style:{...q,transform:X?q.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:eo,"--radix-popper-transform-origin":[null===(a=$.transformOrigin)||void 0===a?void 0:a.x,null===(u=$.transformOrigin)||void 0===u?void 0:u.y].join(" "),...(null===(c=$.hide)||void 0===c?void 0:c.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:(0,eq.jsx)(e2,{scope:h,placedSide:J,placedAlign:Q,onArrowChange:F,arrowX:et,arrowY:en,shouldHideArrow:er,children:(0,eq.jsx)(eB.sG.div,{"data-side":J,"data-align":Q,...P,ref:L,style:{...P.style,animation:X?null===(f=P.style)||void 0===f?void 0:f.animation:"none"}})})})},"PopperContent"));function e4(e){return null!==e}eU(e4,"isNotNull");var e7=eU(e=>({name:"transformOrigin",options:e,fn(t){var n,r,o,i,l;let{placement:a,rects:u,middlewareData:s}=t,c=(null===(n=s.arrow)||void 0===n?void 0:n.centerOffset)!==0,f=c?0:e.arrowWidth,d=c?0:e.arrowHeight,[p,h]=e8(a),m={start:"0%",center:"50%",end:"100%"}[h],v=(null!==(i=null===(r=s.arrow)||void 0===r?void 0:r.x)&&void 0!==i?i:0)+f/2,g=(null!==(l=null===(o=s.arrow)||void 0===o?void 0:o.y)&&void 0!==l?l:0)+d/2,y="",w="";return"bottom"===p?(y=c?m:"".concat(v,"px"),w="".concat(-d,"px")):"top"===p?(y=c?m:"".concat(v,"px"),w="".concat(u.floating.height+d,"px")):"right"===p?(y="".concat(-d,"px"),w=c?m:"".concat(g,"px")):"left"===p&&(y="".concat(u.floating.width+d,"px"),w=c?m:"".concat(g,"px")),{data:{x:y,y:w}}}}),"transformOrigin");function e8(e){let[t,n="center"]=e.split("-");return[t,n]}eU(e8,"getSideAndAlignFromPlacement");var e3=n(7323),e9=n(7028),te=n(2317),tt=n(7924),tn=n(858),tr=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),to=n(5587),ti=n(2431),tl=Object.defineProperty,ta=(e,t)=>tl(e,"name",{value:t,configurable:!0}),tu=[" ","Enter","ArrowUp","ArrowDown"],ts=[" ","Enter"],tc="Select",[tf,td,tp]=(0,u.N)(tc),[th,tm]=(0,c.A)(tc,[tp,e$]),tv=e$(),[tg,ty]=th(tc),[tw,tx]=th(tc);function tb(e){let{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:l,value:a,defaultValue:u,onValueChange:s,dir:c,name:d,autoComplete:p,disabled:h,required:v,form:g,internal_do_not_use_render:y}=e,w=tv(t),[x,b]=o.useState(null),[S,R]=o.useState(null),[C,A]=o.useState(!1),k=(0,f.jH)(c),[j,T]=(0,tt.i)({prop:r,defaultProp:null!=i&&i,onChange:l,caller:tc}),[E,P]=(0,tt.i)({prop:a,defaultProp:u,onChange:s,caller:tc}),M=o.useRef(null),I=o.useRef(E);o.useEffect(()=>{let e=g?null==x?void 0:x.ownerDocument.getElementById(g):null==x?void 0:x.form;if(e instanceof HTMLFormElement){let t=ta(()=>P(I.current),"reset");return e.addEventListener("reset",t),()=>e.removeEventListener("reset",t)}},[g,x,P]);let O=!x||!!g||!!x.closest("form"),[L,D]=o.useState(new Set),F=(0,m.B)(),H=Array.from(L).map(e=>e.props.value).join(";"),K=o.useCallback(e=>{D(t=>new Set(t).add(e))},[]),N=o.useCallback(e=>{D(t=>{let n=new Set(t);return n.delete(e),n})},[]),z={required:v,trigger:x,onTriggerChange:b,valueNode:S,onValueNodeChange:R,valueNodeHasChildren:C,onValueNodeHasChildrenChange:A,contentId:F,value:E,onValueChange:P,open:j,onOpenChange:T,dir:k,triggerPointerDownPosRef:M,disabled:h,name:d,autoComplete:p,form:g,nativeOptions:L,nativeSelectKey:H,isFormControl:O};return(0,eq.jsx)(eQ,{...w,children:(0,eq.jsx)(tg,{scope:t,...z,children:(0,eq.jsx)(tf.Provider,{scope:t,children:(0,eq.jsx)(tw,{scope:t,onNativeOptionAdd:K,onNativeOptionRemove:N,children:t1(y)?y(z):n})})})})}ta(tb,"SelectProvider");var tS=ta(e=>{let{__scopeSelect:t,children:n,...r}=e;return(0,eq.jsx)(tb,{__scopeSelect:t,...r,internal_do_not_use_render:e=>{let{isFormControl:r}=e;return(0,eq.jsxs)(eq.Fragment,{children:[n,r?(0,eq.jsx)(t0,{__scopeSelect:t}):null]})}})},"Select"),tR=o.forwardRef(ta(function(e,t){let{__scopeSelect:n,disabled:r=!1,...i}=e,l=tv(n),u=ty("SelectTrigger",n),c=u.disabled||r,f=(0,s.s)(t,u.onTriggerChange),d=td(n),p=o.useRef("touch"),[h,m,v]=t5(e=>{let t=d().filter(e=>!e.disabled),n=t.find(e=>e.value===u.value),r=t6(t,e,n);void 0!==r&&u.onValueChange(r.value)}),g=ta(e=>{c||(u.onOpenChange(!0),v()),e&&(u.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})},"handleOpen");return(0,eq.jsx)(e0,{asChild:!0,...l,children:(0,eq.jsx)(eB.sG.button,{type:"button",role:"combobox","aria-controls":u.open?u.contentId:void 0,"aria-expanded":u.open,"aria-required":u.required,"aria-autocomplete":"none",dir:u.dir,"data-state":u.open?"open":"closed",disabled:c,"data-disabled":c?"":void 0,"data-placeholder":t2(u.value)?"":void 0,...i,ref:f,onClick:(0,a.mK)(i.onClick,e=>{e.currentTarget.focus(),"mouse"!==p.current&&g(e)}),onPointerDown:(0,a.mK)(i.onPointerDown,e=>{p.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),0===e.button&&!1===e.ctrlKey&&"mouse"===e.pointerType&&(g(e),e.preventDefault())}),onKeyDown:(0,a.mK)(i.onKeyDown,e=>{let t=""!==h.current;e.ctrlKey||e.altKey||e.metaKey||1!==e.key.length||m(e.key),(!t||" "!==e.key)&&tu.includes(e.key)&&(g(),e.preventDefault())})})})},"SelectTrigger")),tC=o.forwardRef(ta(function(e,t){let{__scopeSelect:n,className:r,style:i,children:l,placeholder:a="",...u}=e,c=ty("SelectValue",n),{onValueNodeHasChildrenChange:f}=c,d=void 0!==l,p=(0,s.s)(t,c.onValueNodeChange);(0,eV.N)(()=>{f(d)},[f,d]);let h=t2(c.value);return(0,eq.jsx)(eB.sG.span,{...u,asChild:!h&&u.asChild,ref:p,style:{pointerEvents:"none"},children:(0,eq.jsx)(o.Fragment,{children:h?a:l},h?"placeholder":"value")})},"SelectValue")),tA=o.forwardRef(ta(function(e,t){let{__scopeSelect:n,children:r,...o}=e;return(0,eq.jsx)(eB.sG.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})},"SelectIcon")),[tk,tj]=th("SelectPortal",{forceMount:void 0}),tT=ta(e=>{let{__scopeSelect:t,forceMount:n,...r}=e;return(0,eq.jsx)(tk,{scope:e.__scopeSelect,forceMount:n,children:(0,eq.jsx)(e3.Z,{asChild:!0,...r})})},"SelectPortal"),tE="SelectContent",tP=o.forwardRef(ta(function(e,t){let n=tj(tE,e.__scopeSelect),{forceMount:r=n.forceMount,...i}=e,l=ty(tE,e.__scopeSelect),[a,u]=o.useState();return(0,eV.N)(()=>{u(new DocumentFragment)},[]),(0,eq.jsx)(e9.C,{present:r||l.open,children:e=>{let{present:n}=e;return n?(0,eq.jsx)(tD,{...i,ref:t}):(0,eq.jsx)(tM,{...i,fragment:a})}})},"SelectContent")),tM=o.forwardRef(ta(function(e,t){let{__scopeSelect:n,children:r,fragment:o}=e;return o?i.createPortal((0,eq.jsx)(tI,{scope:n,children:(0,eq.jsx)(tf.Slot,{scope:n,children:(0,eq.jsx)("div",{ref:t,children:r})})}),o):null},"SelectContentFragment")),[tI,tO]=th(tE),tL=(0,te.TL)("SelectContent.RemoveScroll"),tD=o.forwardRef(ta(function(e,t){let{__scopeSelect:n}=e,{position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:l,onPointerDownOutside:u,side:c,sideOffset:f,align:m,alignOffset:v,arrowPadding:g,collisionBoundary:y,collisionPadding:w,sticky:x,hideWhenDetached:b,avoidCollisions:S,...R}=e,C=ty(tE,n),[A,k]=o.useState(null),[j,T]=o.useState(null),E=(0,s.s)(t,k),[P,M]=o.useState(null),[I,O]=o.useState(null),L=td(n),[D,F]=o.useState(!1),H=o.useRef(!1);o.useEffect(()=>{if(A)return(0,to.Eq)(A)},[A]),(0,p.Oh)();let K=o.useCallback(e=>{let[t,...n]=L().map(e=>e.ref.current),[r]=n.slice(-1),o=document.activeElement;for(let n of e)if(n===o||(null==n||n.scrollIntoView({block:"nearest"}),n===t&&j&&(j.scrollTop=0),n===r&&j&&(j.scrollTop=j.scrollHeight),null==n||n.focus(),document.activeElement!==o))return},[L,j]),N=o.useCallback(()=>K([P,A]),[K,P,A]);o.useEffect(()=>{D&&N()},[D,N]);let{onOpenChange:z,triggerPointerDownPosRef:B}=C;o.useEffect(()=>{if(A){let e={x:0,y:0},t=ta(t=>{var n,r,o,i;e={x:Math.abs(Math.round(t.pageX)-(null!==(o=null===(n=B.current)||void 0===n?void 0:n.x)&&void 0!==o?o:0)),y:Math.abs(Math.round(t.pageY)-(null!==(i=null===(r=B.current)||void 0===r?void 0:r.y)&&void 0!==i?i:0))}},"handlePointerMove"),n=ta(n=>{e.x<=10&&e.y<=10?n.preventDefault():n.composedPath().includes(A)||z(!1),document.removeEventListener("pointermove",t),B.current=null},"handlePointerUp");return null!==B.current&&(document.addEventListener("pointermove",t),document.addEventListener("pointerup",n,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",n,{capture:!0})}}},[A,z,B]),o.useEffect(()=>{let e=ta(()=>z(!1),"close");return window.addEventListener("blur",e),window.addEventListener("resize",e),()=>{window.removeEventListener("blur",e),window.removeEventListener("resize",e)}},[z]);let[G,V]=t5(e=>{let t=L().filter(e=>!e.disabled),n=t.find(e=>e.ref.current===document.activeElement),r=t6(t,e,n);r&&setTimeout(()=>{var e;return null===(e=r.ref.current)||void 0===e?void 0:e.focus()})}),W=o.useCallback((e,t,n)=>{let r=!H.current&&!n;(void 0!==C.value&&C.value===t||r)&&(M(e),r&&(H.current=!0))},[C.value]),q=o.useCallback(()=>null==A?void 0:A.focus(),[A]),_=o.useCallback((e,t,n)=>{let r=!H.current&&!n;(void 0!==C.value&&C.value===t||r)&&O(e)},[C.value]),U="popper"===r?tH:tF;return(0,eq.jsx)(tI,{scope:n,content:A,viewport:j,onViewportChange:T,itemRefCallback:W,selectedItem:P,onItemLeave:q,itemTextRefCallback:_,focusSelectedItem:N,selectedItemText:I,position:r,isPositioned:D,searchRef:G,children:(0,eq.jsx)(ti.A,{as:tL,allowPinchZoom:!0,children:(0,eq.jsx)(h.n,{asChild:!0,trapped:C.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:(0,a.mK)(i,e=>{var t;null===(t=C.trigger)||void 0===t||t.focus({preventScroll:!0}),e.preventDefault()}),children:(0,eq.jsx)(d.qW,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>C.onOpenChange(!1),children:(0,eq.jsx)(U,{role:"listbox",id:C.contentId,"data-state":C.open?"open":"closed",dir:C.dir,onContextMenu:e=>e.preventDefault(),...R,...U===tH?{side:c,sideOffset:f,align:m,alignOffset:v,arrowPadding:g,collisionBoundary:y,collisionPadding:w,sticky:x,hideWhenDetached:b,avoidCollisions:S}:{},onPlaced:()=>F(!0),ref:E,style:{display:"flex",flexDirection:"column",outline:"none",...R.style},onKeyDown:(0,a.mK)(R.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if("Tab"===e.key&&e.preventDefault(),t||1!==e.key.length||V(e.key),["ArrowUp","ArrowDown","Home","End"].includes(e.key)){let t=L().filter(e=>!e.disabled).map(e=>e.ref.current);if(["ArrowUp","End"].includes(e.key)&&(t=t.slice().reverse()),["ArrowUp","ArrowDown"].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>K(t)),e.preventDefault()}})})})})})})},"SelectContentImpl")),tF=o.forwardRef(ta(function(e,t){let{__scopeSelect:n,onPlaced:r,...i}=e,a=ty(tE,n),u=tO(tE,n),[c,f]=o.useState(null),[d,p]=o.useState(null),h=(0,s.s)(t,p),m=td(n),v=o.useRef(!1),g=o.useRef(!0),{viewport:y,selectedItem:w,selectedItemText:x,focusSelectedItem:b}=u,S=o.useCallback(()=>{if(a.trigger&&a.valueNode&&c&&d&&y&&w&&x){let e=a.trigger.getBoundingClientRect(),t=d.getBoundingClientRect(),n=a.valueNode.getBoundingClientRect(),o=x.getBoundingClientRect();if("rtl"!==a.dir){let r=o.left-t.left,i=n.left-r,a=e.left-i,u=e.width+a,s=Math.max(u,t.width),f=window.innerWidth-10,d=(0,l.q)(i,[10,Math.max(10,f-s)]);c.style.minWidth=u+"px",c.style.left=d+"px"}else{let r=t.right-o.right,i=window.innerWidth-n.right-r,a=window.innerWidth-e.right-i,u=e.width+a,s=Math.max(u,t.width),f=window.innerWidth-10,d=(0,l.q)(i,[10,Math.max(10,f-s)]);c.style.minWidth=u+"px",c.style.right=d+"px"}let i=m(),u=window.innerHeight-20,s=y.scrollHeight,f=window.getComputedStyle(d),p=parseInt(f.borderTopWidth,10),h=parseInt(f.paddingTop,10),g=parseInt(f.borderBottomWidth,10),b=p+h+s+parseInt(f.paddingBottom,10)+g,S=Math.min(5*w.offsetHeight,b),R=window.getComputedStyle(y),C=parseInt(R.paddingTop,10),A=parseInt(R.paddingBottom,10),k=e.top+e.height/2-10,j=w.offsetHeight/2,T=p+h+(w.offsetTop+j);if(T<=k){let e=i.length>0&&w===i[i.length-1].ref.current;c.style.bottom="0px";let t=Math.max(u-k,j+(e?A:0)+(d.clientHeight-y.offsetTop-y.offsetHeight)+g);c.style.height=T+t+"px"}else{let e=i.length>0&&w===i[0].ref.current;c.style.top="0px";let t=Math.max(k,p+y.offsetTop+(e?C:0)+j);c.style.height=t+(b-T)+"px",y.scrollTop=T-k+y.offsetTop}c.style.margin="".concat(10,"px 0"),c.style.minHeight=S+"px",c.style.maxHeight=u+"px",null==r||r(),requestAnimationFrame(()=>v.current=!0)}},[m,a.trigger,a.valueNode,c,d,y,w,x,a.dir,r]);(0,eV.N)(()=>S(),[S]);let[R,C]=o.useState();(0,eV.N)(()=>{d&&C(window.getComputedStyle(d).zIndex)},[d]);let A=o.useCallback(e=>{e&&!0===g.current&&(S(),null==b||b(),g.current=!1)},[S,b]);return(0,eq.jsx)(tK,{scope:n,contentWrapper:c,shouldExpandOnScrollRef:v,onScrollButtonChange:A,children:(0,eq.jsx)("div",{ref:f,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:R},children:(0,eq.jsx)(eB.sG.div,{...i,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})},"SelectItemAlignedPosition")),tH=o.forwardRef(ta(function(e,t){let{__scopeSelect:n,align:r="start",collisionPadding:o=10,...i}=e,l=tv(n);return(0,eq.jsx)(e6,{...l,...i,ref:t,align:r,collisionPadding:o,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})},"SelectPopperPosition")),[tK,tN]=th(tE,{}),tz="SelectViewport",tB=o.forwardRef(ta(function(e,t){let{__scopeSelect:n,nonce:r,...i}=e,l=tO(tz,n),u=tN(tz,n),c=(0,s.s)(t,l.onViewportChange),f=o.useRef(0);return(0,eq.jsxs)(eq.Fragment,{children:[(0,eq.jsx)("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),(0,eq.jsx)(tf.Slot,{scope:n,children:(0,eq.jsx)(eB.sG.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:(0,a.mK)(i.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=u;if((null==r?void 0:r.current)&&n){let e=Math.abs(f.current-t.scrollTop);if(e>0){let r=window.innerHeight-20,o=Math.max(parseFloat(n.style.minHeight),parseFloat(n.style.height));if(o<r){let i=o+e,l=Math.min(r,i),a=i-l;n.style.height=l+"px","0px"===n.style.bottom&&(t.scrollTop=a>0?a:0,n.style.justifyContent="flex-end")}}}f.current=t.scrollTop})})})]})},"SelectViewport")),[tG,tV]=th("SelectGroup"),tW=o.forwardRef(ta(function(e,t){let{__scopeSelect:n,...r}=e,o=(0,m.B)();return(0,eq.jsx)(tG,{scope:n,id:o,children:(0,eq.jsx)(eB.sG.div,{role:"group","aria-labelledby":o,...r,ref:t})})},"SelectGroup")),tq=o.forwardRef(ta(function(e,t){let{__scopeSelect:n,...r}=e,o=tV("SelectLabel",n);return(0,eq.jsx)(eB.sG.div,{id:o.id,...r,ref:t})},"SelectLabel")),t_="SelectItem",[tU,tZ]=th(t_),tX=o.forwardRef(ta(function(e,t){let{__scopeSelect:n,value:r,disabled:i=!1,textValue:l,...u}=e,c=ty(t_,n),f=tO(t_,n),d=c.value===r,[p,h]=o.useState(null!=l?l:""),[v,g]=o.useState(!1),y=(0,eG.c)(e=>{var t;return null===(t=f.itemRefCallback)||void 0===t?void 0:t.call(f,e,r,i)}),w=(0,s.s)(t,y),x=(0,m.B)(),b=o.useRef("touch"),S=ta(()=>{i||(c.onValueChange(r),c.onOpenChange(!1))},"handleSelect");return(0,eq.jsx)(tU,{scope:n,value:r,disabled:i,textId:x,isSelected:d,onItemTextChange:o.useCallback(e=>{h(t=>{var n;return t||(null!==(n=null==e?void 0:e.textContent)&&void 0!==n?n:"").trim()})},[]),children:(0,eq.jsx)(tf.ItemSlot,{scope:n,value:r,disabled:i,textValue:p,children:(0,eq.jsx)(eB.sG.div,{role:"option","aria-labelledby":x,"data-highlighted":v?"":void 0,"aria-selected":d&&v,"data-state":d?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...u,ref:w,onFocus:(0,a.mK)(u.onFocus,()=>g(!0)),onBlur:(0,a.mK)(u.onBlur,()=>g(!1)),onClick:(0,a.mK)(u.onClick,()=>{"mouse"!==b.current&&S()}),onPointerUp:(0,a.mK)(u.onPointerUp,()=>{"mouse"===b.current&&S()}),onPointerDown:(0,a.mK)(u.onPointerDown,e=>{b.current=e.pointerType}),onPointerMove:(0,a.mK)(u.onPointerMove,e=>{if(b.current=e.pointerType,i){var t;null===(t=f.onItemLeave)||void 0===t||t.call(f)}else"mouse"===b.current&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:(0,a.mK)(u.onPointerLeave,e=>{if(e.currentTarget===document.activeElement){var t;null===(t=f.onItemLeave)||void 0===t||t.call(f)}}),onKeyDown:(0,a.mK)(u.onKeyDown,e=>{var t;i||e.target!==e.currentTarget||(null===(t=f.searchRef)||void 0===t?void 0:t.current)!==""&&" "===e.key||(ts.includes(e.key)&&S()," "===e.key&&e.preventDefault())})})})})},"SelectItem")),t$="SelectItemText",tY=o.forwardRef(ta(function(e,t){let{__scopeSelect:n,className:r,style:l,...a}=e,u=ty(t$,n),c=tO(t$,n),f=tZ(t$,n),d=tx(t$,n),[p,h]=o.useState(null),m=(0,eG.c)(e=>{var t;return null===(t=c.itemTextRefCallback)||void 0===t?void 0:t.call(c,e,f.value,f.disabled)}),v=(0,s.s)(t,h,f.onItemTextChange,m),g=null==p?void 0:p.textContent,y=o.useMemo(()=>(0,eq.jsx)("option",{value:f.value,disabled:f.disabled,children:g},f.value),[f.disabled,f.value,g]),{onNativeOptionAdd:w,onNativeOptionRemove:x}=d;return(0,eV.N)(()=>(w(y),()=>x(y)),[w,x,y]),(0,eq.jsxs)(eq.Fragment,{children:[(0,eq.jsx)(eB.sG.span,{id:f.textId,...a,ref:v}),f.isSelected&&u.valueNode&&!u.valueNodeHasChildren&&!t2(u.value)?i.createPortal(a.children,u.valueNode):null]})},"SelectItemText")),tJ=o.forwardRef(ta(function(e,t){let{__scopeSelect:n,...r}=e;return tZ("SelectItemIndicator",n).isSelected?(0,eq.jsx)(eB.sG.span,{"aria-hidden":!0,...r,ref:t}):null},"SelectItemIndicator")),tQ=o.forwardRef(ta(function(e,t){let{__scopeSelect:n,...r}=e;return(0,eq.jsx)(eB.sG.div,{"aria-hidden":!0,...r,ref:t})},"SelectSeparator")),t0=o.forwardRef(ta(function(e,t){let{__scopeSelect:n,...r}=e,i=ty("SelectBubbleInput",n),{value:l,onValueChange:a,required:u,disabled:c,name:f,autoComplete:d,form:p}=i,{nativeOptions:h,nativeSelectKey:m}=i,v=o.useRef(null),g=(0,s.s)(t,v),y=null!=l?l:"",w=(0,tn.Z)(y),x=Array.from(h).some(e=>{var t;return(null!==(t=e.props.value)&&void 0!==t?t:"")===""});return o.useEffect(()=>{let e=v.current;if(!e)return;let t=Object.getOwnPropertyDescriptor(window.HTMLSelectElement.prototype,"value").set;if(w!==y&&t){let n=new Event("change",{bubbles:!0});t.call(e,y),e.dispatchEvent(n)}},[w,y]),(0,eq.jsxs)(eB.sG.select,{"aria-hidden":!0,required:u,tabIndex:-1,name:f,autoComplete:d,disabled:c,form:p,onChange:e=>a(e.target.value),...r,style:{...tr,...r.style},ref:g,defaultValue:y,children:[t2(l)&&!x?(0,eq.jsx)("option",{value:""}):null,Array.from(h)]},m)},"SelectBubbleInput"));function t1(e){return"function"==typeof e}function t2(e){return""===e||void 0===e}function t5(e){let t=(0,eG.c)(e),n=o.useRef(""),r=o.useRef(0),i=o.useCallback(e=>{t(n.current+e)},[t]),l=o.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return o.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,l]}function t6(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,o=n?e.indexOf(n):-1,i=t4(e,Math.max(o,0));1===r.length&&(i=i.filter(e=>e!==n));let l=i.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return l!==n?l:void 0}function t4(e,t){return e.map((n,r)=>e[(t+r)%e.length])}ta(t1,"isFunction"),ta(t2,"shouldShowPlaceholder"),ta(t5,"useTypeaheadSearch"),ta(t6,"findNextItem"),ta(t4,"wrapArray")},2413:(e,t,n)=>{n.d(t,{bL:()=>x,zi:()=>b});var r=n(2115),o=n(3610),i=n(8068),l=n(8166),a=n(7924),u=n(7510),s=n(3360),c=n(5155),f=Object.defineProperty,d=(e,t)=>f(e,"name",{value:t,configurable:!0}),p="Switch",[h,m]=(0,l.A)(p),[v,g]=h(p);function y(e){let{__scopeSwitch:t,checked:n,children:o,defaultChecked:i,disabled:l,form:u,name:s,onCheckedChange:f,required:d,value:h="on",internal_do_not_use_render:m}=e,[g,y]=(0,a.i)({prop:n,defaultProp:null!=i&&i,onChange:f,caller:p}),[w,x]=r.useState(null),[b,S]=r.useState(null),C=r.useRef(!1),[A,k]=r.useReducer(e=>e+1,0),j=!w||!!u||!!w.closest("form"),T={checked:g,setChecked:y,disabled:l,control:w,setControl:x,name:s,form:u,value:h,hasConsumerStoppedPropagationRef:C,userInteractionCount:A,onUserInteraction:k,required:d,defaultChecked:i,isFormControl:j,bubbleInput:b,setBubbleInput:S};return(0,c.jsx)(v,{scope:t,...T,children:R(m)?m(T):o})}d(y,"SwitchProvider");var w=r.forwardRef(d(function(e,t){let{__scopeSwitch:n,onClick:l,...a}=e,{control:u,form:f,value:p,disabled:h,checked:m,required:v,setControl:y,setChecked:w,hasConsumerStoppedPropagationRef:x,onUserInteraction:b,isFormControl:S,bubbleInput:R}=g("SwitchTrigger",n),A=(0,i.s)(t,y),k=r.useRef(m);return r.useEffect(()=>{let e=f?null==u?void 0:u.ownerDocument.getElementById(f):null==u?void 0:u.form;if(e instanceof HTMLFormElement){let t=d(()=>w(k.current),"reset");return e.addEventListener("reset",t),()=>e.removeEventListener("reset",t)}},[u,f,w]),(0,c.jsx)(s.sG.button,{type:"button",role:"switch","aria-checked":m,"aria-required":v,"data-state":C(m),"data-disabled":h?"":void 0,disabled:h,value:p,...a,ref:A,onClick:(0,o.mK)(l,e=>{b(),w(e=>!e),R&&S&&(x.current=e.isPropagationStopped(),x.current||e.stopPropagation())})})},"SwitchTrigger")),x=r.forwardRef(d(function(e,t){let{__scopeSwitch:n,name:r,checked:o,defaultChecked:i,required:l,disabled:a,value:u,onCheckedChange:s,form:f,...d}=e;return(0,c.jsx)(y,{__scopeSwitch:n,checked:o,defaultChecked:i,disabled:a,required:l,onCheckedChange:s,name:r,form:f,value:u,internal_do_not_use_render:e=>{let{isFormControl:r}=e;return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(w,{...d,ref:t,__scopeSwitch:n}),r&&(0,c.jsx)(S,{__scopeSwitch:n})]})}})},"Switch")),b=r.forwardRef(d(function(e,t){let{__scopeSwitch:n,...r}=e,o=g("SwitchThumb",n);return(0,c.jsx)(s.sG.span,{"data-state":C(o.checked),"data-disabled":o.disabled?"":void 0,...r,ref:t})},"SwitchThumb")),S=r.forwardRef(d(function(e,t){let{__scopeSwitch:n,onClick:l,...a}=e,{control:f,hasConsumerStoppedPropagationRef:d,userInteractionCount:p,checked:h,defaultChecked:m,required:v,disabled:y,name:w,value:x,form:b,bubbleInput:S,setBubbleInput:R}=g("SwitchBubbleInput",n),C=(0,i.s)(t,R),A=(0,u.X)(f),k=r.useRef(!1),j=r.useRef(h),T=r.useRef(p);r.useEffect(()=>{if(!S)return;let e=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set,t=p!==T.current;T.current=p;let n=j.current!==h;j.current=h;let r=!(t&&d.current);if(n&&e){k.current=!t;let n=new Event("click",{bubbles:r});e.call(S,h),S.dispatchEvent(n),k.current=!1}},[S,h,d,p]);let E=r.useRef(h);return(0,c.jsx)(s.sG.input,{type:"checkbox","aria-hidden":!0,defaultChecked:null!=m?m:E.current,required:v,disabled:y,name:w,value:x,form:b,...a,tabIndex:-1,ref:C,onClick:(0,o.mK)(l,e=>{k.current&&e.stopPropagation()}),style:{...a.style,...A,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"SwitchBubbleInput"));function R(e){return"function"==typeof e}function C(e){return e?"checked":"unchecked"}d(R,"isFunction"),d(C,"getState")},3078:(e,t,n)=>{n.d(t,{UC:()=>eu,B8:()=>el,bL:()=>ei,l9:()=>ea});var r=n(2115),o=n.t(r,2),i=n(3610),l=n(8166),a=n(8050),u=n(8068),s=n(7668),c=n(3360),f=n(1524),d=n(7924),p=n(4256),h=n(6611),m=Object.defineProperty,v=(e,t)=>m(e,"name",{value:t,configurable:!0}),g=!1;function y(){let[e,t]=r.useState(g);return r.useEffect(()=>{g||(g=!0,t(!0))},[]),e}v(y,"useIsHydrated");var w=o[" useSyncExternalStore ".trim().toString()];function x(){return()=>{}}function b(){return w(x,()=>!0,()=>!1)}v(x,"subscribe"),v(b,"useIsHydratedModern");var S="function"==typeof w?b:y,R=n(5155),C=Object.defineProperty,A=(e,t)=>C(e,"name",{value:t,configurable:!0}),k="rovingFocusGroup.onEntryFocus",j={bubbles:!1,cancelable:!0},T="RovingFocusGroup",[E,P,M]=(0,a.N)(T),[I,O]=(0,l.A)(T,[M]),[L,D]=I(T),F=r.forwardRef(A(function(e,t){return(0,R.jsx)(E.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,R.jsx)(E.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,R.jsx)(H,{...e,ref:t})})})},"RovingFocusGroup")),H=r.forwardRef(A(function(e,t){let{__scopeRovingFocusGroup:n,orientation:o,loop:l=!1,dir:a,currentTabStopId:s,defaultCurrentTabStopId:h,onCurrentTabStopIdChange:m,onEntryFocus:v,preventScrollOnEntryFocus:g=!1,...y}=e,w=r.useRef(null),x=(0,u.s)(t,w),b=(0,p.jH)(a),[S,C]=(0,d.i)({prop:s,defaultProp:null!=h?h:null,onChange:m,caller:T}),[A,E]=r.useState(!1),M=(0,f.c)(v),I=P(n),O=r.useRef(!1),[D,F]=r.useState(0);return r.useEffect(()=>{let e=w.current;if(e)return e.addEventListener(k,M),()=>e.removeEventListener(k,M)},[M]),(0,R.jsx)(L,{scope:n,orientation:o,dir:b,loop:l,currentTabStopId:S,onItemFocus:r.useCallback(e=>C(e),[C]),onItemShiftTab:r.useCallback(()=>E(!0),[]),onFocusableItemAdd:r.useCallback(()=>F(e=>e+1),[]),onFocusableItemRemove:r.useCallback(()=>F(e=>e-1),[]),children:(0,R.jsx)(c.sG.div,{tabIndex:A||0===D?-1:0,"data-orientation":o,...y,ref:x,style:{outline:"none",...e.style},onMouseDown:(0,i.mK)(e.onMouseDown,()=>{O.current=!0}),onFocus:(0,i.mK)(e.onFocus,e=>{let t=!O.current;if(e.target===e.currentTarget&&t&&!A){let t=new CustomEvent(k,j);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=I().filter(e=>e.focusable);G([e.find(e=>e.active),e.find(e=>e.id===S),...e].filter(Boolean).map(e=>e.ref.current),g)}}O.current=!1}),onBlur:(0,i.mK)(e.onBlur,()=>E(!1))})})},"RovingFocusGroupImpl")),K=r.forwardRef(A(function(e,t){let{__scopeRovingFocusGroup:n,focusable:o=!0,active:l=!1,tabStopId:a,children:u,...f}=e,d=(0,s.B)(),p=a||d,m=D("RovingFocusGroupItem",n),v=m.currentTabStopId===p,g=P(n),{onFocusableItemAdd:y,onFocusableItemRemove:w,currentTabStopId:x}=m,b=S();return(0,h.N)(()=>{if(b&&o)return y(),()=>w()},[b,o,y,w]),r.useEffect(()=>{if(!b&&o)return y(),()=>w()},[b,o,y,w]),(0,R.jsx)(E.ItemSlot,{scope:n,id:p,focusable:o,active:l,children:(0,R.jsx)(c.sG.span,{tabIndex:v?0:-1,"data-orientation":m.orientation,...f,ref:t,onMouseDown:(0,i.mK)(e.onMouseDown,e=>{o?m.onItemFocus(p):e.preventDefault()}),onFocus:(0,i.mK)(e.onFocus,()=>m.onItemFocus(p)),onKeyDown:(0,i.mK)(e.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey){m.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=B(e,m.orientation,m.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=g().filter(e=>e.focusable).map(e=>e.ref.current);if("last"===t)n.reverse();else if("prev"===t||"next"===t){"prev"===t&&n.reverse();let r=n.indexOf(e.currentTarget);n=m.loop?V(n,r+1):n.slice(r+1)}setTimeout(()=>G(n))}}),children:"function"==typeof u?u({isCurrentTabStop:v,hasTabStop:null!=x}):u})})},"RovingFocusGroupItem")),N={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function z(e,t){return"rtl"!==t?e:"ArrowLeft"===e?"ArrowRight":"ArrowRight"===e?"ArrowLeft":e}function B(e,t,n){let r=z(e.key,n);if(!("vertical"===t&&["ArrowLeft","ArrowRight"].includes(r))&&!("horizontal"===t&&["ArrowUp","ArrowDown"].includes(r)))return N[r]}function G(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function V(e,t){return e.map((n,r)=>e[(t+r)%e.length])}A(z,"getDirectionAwareKey"),A(B,"getFocusIntent"),A(G,"focusFirst"),A(V,"wrapArray");var W=n(7028),q=Object.defineProperty,_=(e,t)=>q(e,"name",{value:t,configurable:!0}),U="Tabs",[Z,X]=(0,l.A)(U,[O]),$=O(),[Y,J]=Z(U),Q=r.forwardRef(_(function(e,t){let{__scopeTabs:n,value:r,onValueChange:o,defaultValue:i,orientation:l="horizontal",dir:a,activationMode:u="automatic",...f}=e,h=(0,p.jH)(a),[m,v]=(0,d.i)({prop:r,onChange:o,defaultProp:null!=i?i:"",caller:U});return(0,R.jsx)(Y,{scope:n,baseId:(0,s.B)(),value:m,onValueChange:v,orientation:l,dir:h,activationMode:u,children:(0,R.jsx)(c.sG.div,{dir:h,"data-orientation":l,...f,ref:t})})},"Tabs")),ee=r.forwardRef(_(function(e,t){let{__scopeTabs:n,loop:r=!0,...o}=e,i=J("TabsList",n),l=$(n);return(0,R.jsx)(F,{asChild:!0,...l,orientation:i.orientation,dir:i.dir,loop:r,children:(0,R.jsx)(c.sG.div,{role:"tablist","aria-orientation":i.orientation,...o,ref:t})})},"TabsList")),et=r.forwardRef(_(function(e,t){let{__scopeTabs:n,value:r,disabled:o=!1,...l}=e,a=J("TabsTrigger",n),u=$(n),s=er(a.baseId,r),f=eo(a.baseId,r),d=r===a.value;return(0,R.jsx)(K,{asChild:!0,...u,focusable:!o,active:d,children:(0,R.jsx)(c.sG.button,{type:"button",role:"tab","aria-selected":d,"aria-controls":f,"data-state":d?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:s,...l,ref:t,onMouseDown:(0,i.mK)(e.onMouseDown,e=>{o||0!==e.button||!1!==e.ctrlKey?e.preventDefault():a.onValueChange(r)}),onKeyDown:(0,i.mK)(e.onKeyDown,e=>{!o&&e.target===e.currentTarget&&[" ","Enter"].includes(e.key)&&a.onValueChange(r)}),onFocus:(0,i.mK)(e.onFocus,()=>{let e="manual"!==a.activationMode;d||o||!e||a.onValueChange(r)})})})},"TabsTrigger")),en=r.forwardRef(_(function(e,t){let{__scopeTabs:n,value:o,forceMount:i,children:l,...a}=e,u=J("TabsContent",n),s=er(u.baseId,o),f=eo(u.baseId,o),d=o===u.value,p=r.useRef(d);return r.useEffect(()=>{let e=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,R.jsx)(W.C,{present:i||d,children:n=>{let{present:r}=n;return(0,R.jsx)(c.sG.div,{"data-state":d?"active":"inactive","data-orientation":u.orientation,role:"tabpanel","aria-labelledby":s,hidden:!r,id:f,tabIndex:0,...a,ref:t,style:{...e.style,animationDuration:p.current?"0s":void 0},children:r&&l})}})},"TabsContent"));function er(e,t){return"".concat(e,"-trigger-").concat(t)}function eo(e,t){return"".concat(e,"-content-").concat(t)}_(er,"makeTriggerId"),_(eo,"makeContentId");var ei=Q,el=ee,ea=et,eu=en},858:(e,t,n)=>{n.d(t,{Z:()=>o});var r=n(2115);function o(e){let t=r.useRef({value:e,previous:e});return r.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}(0,Object.defineProperty)(o,"name",{value:"usePrevious",configurable:!0})},7510:(e,t,n)=>{n.d(t,{X:()=>i});var r=n(2115),o=n(6611);function i(e){let[t,n]=r.useState(void 0);return(0,o.N)(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{let r,o;if(!Array.isArray(t)||!t.length)return;let i=t[0];if("borderBoxSize"in i){let e=i.borderBoxSize,t=Array.isArray(e)?e[0]:e;r=t.inlineSize,o=t.blockSize}else r=e.offsetWidth,o=e.offsetHeight;n({width:r,height:o})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}n(void 0)},[e]),t}(0,Object.defineProperty)(i,"name",{value:"useSize",configurable:!0})}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6009],{6009:(e,s,t)=>{t.d(s,{S:()=>I});var a=t(5155),l=t(2115);t(8173);var r=t(7266),n=t(6609),o=t(4081),i=t(8501),d=t(853),c=t(5364),x=t(8453),m=t(5220),h=t(3312),u=t(3900),p=t(6754),g=t(8986),b=t(488),j=t(5900),f=t(1567);let v=l.forwardRef((e,s)=>{let{className:t,...l}=e;return(0,a.jsxs)(j.bL,{ref:s,className:(0,f.cn)("relative flex w-full touch-none select-none items-center",t),...l,children:[(0,a.jsx)(j.CC,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-zinc-200 dark:bg-zinc-600",children:(0,a.jsx)(j.Q6,{className:"absolute h-full bg-[#57BE6B]"})}),(0,a.jsx)(j.zi,{className:(0,f.cn)("block h-4 w-4 rounded-full bg-white shadow-md ring-0 transition-all","border-2 border-[#57BE6B]","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#57BE6B] focus-visible:ring-offset-2","hover:scale-110","disabled:pointer-events-none disabled:opacity-50")})]})});v.displayName=j.bL.displayName;var k=t(5121),y=t(2884),N=t(7528),w=t(2935),C=t(6308),B=t(6507),T=t(6967),E=t(1902),A=t(7257),K=t(8867),S=t(1344),J=t(7995);function L(e){let{value:s,onChange:t,placeholder:r}=e,[n,o]=(0,l.useState)(!1),[i,d]=(0,l.useState)(null),[c,x]=(0,l.useState)(!1),[m,p]=(0,l.useState)(""),g=(0,l.useCallback)(async e=>{x(!0);try{let s=await fetch("/api/fs/browse?path=".concat(encodeURIComponent(e))),t=await s.json();d(t)}catch(e){}finally{x(!1)}},[]);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(u.p,{value:s,onChange:e=>t(e.target.value),placeholder:null!=r?r:"~/projects/my-project",className:"font-mono text-sm flex-1"}),(0,a.jsxs)(h.$,{type:"button",variant:"outline",size:"sm",onClick:()=>{let e=(null==s?void 0:s.trim().replace(/^~/,"~"))||"~";p(s||""),g(e.replace(/^~/,"")?e:"~"),o(!0)},className:"shrink-0 gap-1.5",children:[(0,a.jsx)(C.A,{className:"h-4 w-4"}),"浏览"]})]}),(0,a.jsx)(S.lG,{open:n,onOpenChange:o,children:(0,a.jsxs)(S.Cf,{className:"max-w-lg p-0 gap-0",children:[(0,a.jsx)(S.c7,{className:"px-4 pt-4 pb-3 border-b",children:(0,a.jsx)(S.L3,{className:"text-base",children:"选择工作区目录"})}),(0,a.jsxs)("div",{className:"flex items-center gap-1 px-3 py-2 border-b bg-secondary/30 flex-wrap",children:[(0,a.jsx)("button",{type:"button",onClick:()=>g("~"),className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:(0,a.jsx)(B.A,{className:"h-3.5 w-3.5"})}),null==i?void 0:i.breadcrumb.slice(1).map((e,s)=>(0,a.jsxs)("span",{className:"flex items-center gap-1",children:[(0,a.jsx)(T.A,{className:"h-3 w-3 text-muted-foreground"}),(0,a.jsx)("button",{type:"button",onClick:()=>g(e.path),className:"text-xs text-muted-foreground hover:text-foreground transition-colors max-w-[120px] truncate",children:e.label})]},s))]}),(0,a.jsx)(J.F,{className:"h-64",children:(0,a.jsxs)("div",{className:"p-2 space-y-0.5",children:[(null==i?void 0:i.canGoUp)&&(0,a.jsxs)("button",{type:"button",onClick:()=>g(i.parent),className:"w-full flex items-center gap-2.5 rounded-lg px-3 py-2 text-sm text-muted-foreground hover:bg-secondary/60 transition-colors",children:[(0,a.jsx)(E.A,{className:"h-4 w-4"}),(0,a.jsx)("span",{className:"text-xs",children:"返回上级"})]}),c&&!i&&(0,a.jsx)("p",{className:"text-sm text-muted-foreground text-center py-8",children:"加载中…"}),!c&&(null==i?void 0:i.entries.length)===0&&(0,a.jsx)("p",{className:"text-sm text-muted-foreground text-center py-8",children:"此目录为空"}),null==i?void 0:i.entries.map(e=>{let s=m===e.path;return(0,a.jsxs)("div",{className:"flex items-center group",children:[(0,a.jsxs)("button",{type:"button",onClick:()=>p(e.path),onDoubleClick:()=>g(e.path),className:(0,f.cn)("flex-1 flex items-center gap-2.5 rounded-lg px-3 py-2 text-sm transition-colors text-left",s?"bg-[#57BE6B]/15 dark:bg-[#57BE6B]/20 border border-[#57BE6B]/40":"hover:bg-secondary/60 border border-transparent"),children:[(0,a.jsx)(A.A,{className:(0,f.cn)("h-4 w-4 shrink-0",s?"text-[#57BE6B]":"text-amber-500")}),(0,a.jsx)("span",{className:"truncate font-medium",children:e.name}),s&&(0,a.jsx)(K.A,{className:"ml-auto h-3.5 w-3.5 text-[#57BE6B] shrink-0"})]}),(0,a.jsx)("button",{type:"button",onClick:()=>g(e.path),className:"opacity-0 group-hover:opacity-100 p-2 text-muted-foreground hover:text-foreground transition-all",title:"进入目录",children:(0,a.jsx)(T.A,{className:"h-4 w-4"})})]},e.path)})]})}),(0,a.jsx)("div",{className:"px-4 py-2.5 border-t bg-secondary/20",children:(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"text-xs text-muted-foreground shrink-0",children:"选中:"}),(0,a.jsx)("code",{className:"text-xs font-mono text-foreground truncate flex-1",children:m||(null==i?void 0:i.current)||"未选择"})]})}),(0,a.jsxs)(S.Es,{className:"px-4 py-3 border-t",children:[(0,a.jsx)(h.$,{variant:"outline",onClick:()=>o(!1),children:"取消"}),(0,a.jsxs)(h.$,{onClick:()=>{t(m||(null==i?void 0:i.current)||""),o(!1)},disabled:!m&&!(null==i?void 0:i.current),children:[(0,a.jsx)(C.A,{className:"mr-2 h-4 w-4"}),"选择此目录"]})]})]})})]})}var P=t(3701);let z={off:"关闭",minimal:"最低",low:"低",medium:"中等",high:"高",xhigh:"极高",max:"最大"},F=[{key:"bash",icon:n.A,color:"bg-orange-100 text-orange-600 dark:bg-orange-900/40 dark:text-orange-400",labelKey:"bash",hintKey:"bashHint"},{key:"fileRead",icon:o.A,color:"bg-blue-100 text-blue-600 dark:bg-blue-900/40 dark:text-blue-400",labelKey:"fileRead",hintKey:"fileReadHint"},{key:"fileWrite",icon:i.A,color:"bg-violet-100 text-violet-600 dark:bg-violet-900/40 dark:text-violet-400",labelKey:"fileWrite",hintKey:"fileWriteHint"},{key:"grep",icon:d.A,color:"bg-green-100 text-green-600 dark:bg-green-900/40 dark:text-green-400",labelKey:"grep",hintKey:"grepHint"},{key:"find",icon:c.A,color:"bg-teal-100 text-teal-600 dark:bg-teal-900/40 dark:text-teal-400",labelKey:"find",hintKey:"findHint"},{key:"calculator",icon:x.A,color:"bg-yellow-100 text-yellow-600 dark:bg-yellow-900/40 dark:text-yellow-400",labelKey:"calculator",hintKey:"calculatorHint"}];function I(e){var s,t,n;let{initialValues:o,onSave:i,saving:d,submitLabel:c}=e,x=(0,r.useTranslations)("agents.form"),j=(0,r.useTranslations)("common"),[C,B]=(0,l.useState)({...o}),[T,E]=(0,l.useState)([]),A=(0,w.yU)(C.model.provider,C.model.modelId),[K,S]=(0,l.useState)(A);(0,l.useEffect)(()=>{S(A)},[A.supportsThinking,A.supportsTemperature,A.contextWindow,A.maxTokens]),(0,l.useEffect)(()=>{fetch("/api/knowledge").then(e=>e.json()).then(E).catch(()=>{})},[]);let J=(e,s)=>B(t=>({...t,[e]:s})),I=(e,s)=>B(t=>({...t,model:{...t.model,[e]:s}})),R=(e,s)=>B(t=>({...t,persona:{...t.persona,[e]:s}})),W=e=>B(s=>({...s,tools:{...s.tools,[e]:!s.tools[e]}})),U=e=>B(s=>({...s,knowledgeBases:s.knowledgeBases.includes(e)?s.knowledgeBases.filter(s=>s!==e):[...s.knowledgeBases,e]})),V=K.supportsThinking&&K.thinkingLevels.length>0?K.thinkingLevels:K.supportsThinking?["low","medium","high","xhigh","max"]:[],q=V.includes(C.model.thinkingLevel)?C.model.thinkingLevel:null!==(s=V[0])&&void 0!==s?s:"off",X=Object.values(C.tools).filter(Boolean).length,$=(null!==(t=C.enabledSkills)&&void 0!==t?t:[]).length;return(0,a.jsxs)("form",{onSubmit:e=>{e.preventDefault(),i(C)},children:[(0,a.jsxs)(y.tU,{defaultValue:"basic",children:[(0,a.jsxs)(y.j7,{className:"mb-6 w-full grid grid-cols-5 h-10",children:[(0,a.jsx)(y.Xi,{value:"basic",className:"text-xs",children:"基本信息"}),(0,a.jsx)(y.Xi,{value:"model",className:"text-xs",children:x("modelConfig")}),(0,a.jsxs)(y.Xi,{value:"tools",className:"text-xs relative",children:[x("toolsConfig"),X>0&&(0,a.jsx)("span",{className:"ml-1 inline-flex items-center justify-center h-4 w-4 rounded-full bg-primary text-primary-foreground text-[9px] font-bold",children:X})]}),(0,a.jsxs)(y.Xi,{value:"skills",className:"text-xs relative",children:["Skills",$>0&&(0,a.jsx)("span",{className:"ml-1 inline-flex items-center justify-center h-4 w-4 rounded-full bg-purple-500 text-white text-[9px] font-bold",children:$})]})]}),(0,a.jsxs)(y.av,{value:"basic",className:"space-y-5",children:[(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(g.J,{children:x("avatar")}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:P.B.map(e=>(0,a.jsx)("button",{type:"button",onClick:()=>J("avatar",e),className:(0,f.cn)("h-10 w-10 rounded-xl text-xl transition-all hover:scale-110",C.avatar===e&&"ring-2 ring-primary ring-offset-2 bg-secondary"),children:e},e))})]}),(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,a.jsxs)("div",{className:"space-y-1.5",children:[(0,a.jsxs)(g.J,{htmlFor:"name",children:[x("name")," *"]}),(0,a.jsx)(u.p,{id:"name",required:!0,value:C.name,onChange:e=>J("name",e.target.value),placeholder:x("namePlaceholder")})]}),(0,a.jsxs)("div",{className:"space-y-1.5",children:[(0,a.jsx)(g.J,{htmlFor:"desc",children:x("description")}),(0,a.jsx)(u.p,{id:"desc",value:C.description,onChange:e=>J("description",e.target.value),placeholder:x("descriptionPlaceholder")})]})]}),(0,a.jsxs)("div",{className:"space-y-1.5",children:[(0,a.jsx)(g.J,{htmlFor:"prompt",children:x("systemPrompt")}),(0,a.jsx)(p.T,{id:"prompt",rows:8,value:C.systemPrompt,onChange:e=>J("systemPrompt",e.target.value),placeholder:x("systemPromptPlaceholder")})]}),(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,a.jsxs)("div",{className:"space-y-1.5",children:[(0,a.jsx)(g.J,{children:x("tone")}),(0,a.jsxs)(N.l6,{value:C.persona.tone,onValueChange:e=>R("tone",e),children:[(0,a.jsx)(N.bq,{children:(0,a.jsx)(N.yv,{})}),(0,a.jsx)(N.gC,{children:["formal","casual","friendly","professional"].map(e=>(0,a.jsx)(N.eb,{value:e,children:x("tones.".concat(e))},e))})]})]}),(0,a.jsxs)("div",{className:"space-y-1.5",children:[(0,a.jsx)(g.J,{children:x("language")}),(0,a.jsxs)(N.l6,{value:C.persona.language,onValueChange:e=>R("language",e),children:[(0,a.jsx)(N.bq,{children:(0,a.jsx)(N.yv,{})}),(0,a.jsxs)(N.gC,{children:[(0,a.jsx)(N.eb,{value:"zh-CN",children:"中文(简体)"}),(0,a.jsx)(N.eb,{value:"zh-TW",children:"中文(繁體)"}),(0,a.jsx)(N.eb,{value:"en-US",children:"English"}),(0,a.jsx)(N.eb,{value:"ja-JP",children:"日本語"}),(0,a.jsx)(N.eb,{value:"ko-KR",children:"한국어"})]})]})]})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(g.J,{className:"text-gray-700 dark:text-gray-300",children:x("knowledgeConfig")}),(0,a.jsx)("p",{className:"text-xs text-gray-600 dark:text-muted-foreground",children:x("knowledgeHint")}),0===T.length?(0,a.jsx)("p",{className:"text-sm text-gray-600 dark:text-muted-foreground py-2",children:x("noKnowledge")}):T.map(e=>(0,a.jsxs)("div",{className:"neo-card flex items-center gap-3 rounded-lg p-3 bg-white dark:bg-slate-800/50 hover:scale-[1.01] transition-transform",children:[(0,a.jsx)(b.d,{id:"kb-".concat(e.id),checked:C.knowledgeBases.includes(e.id),onCheckedChange:()=>U(e.id)}),(0,a.jsxs)(g.J,{htmlFor:"kb-".concat(e.id),className:"cursor-pointer font-normal flex-1 text-gray-800 dark:text-white",children:[e.name,(0,a.jsxs)("span",{className:"ml-2 text-xs text-gray-600 dark:text-muted-foreground",children:[e.documentCount," 文档 \xb7 ",e.chunkCount," 块"]})]})]},e.id))]}),(0,a.jsxs)("div",{className:"space-y-1.5",children:[(0,a.jsxs)(g.J,{className:"flex items-center gap-1.5",children:["工作区目录",(0,a.jsx)("span",{className:"text-xs text-muted-foreground font-normal",children:"(可选)"})]}),(0,a.jsx)(L,{value:null!==(n=C.workspacePath)&&void 0!==n?n:"",onChange:e=>J("workspacePath",e),placeholder:"~/projects/my-project (留空使用默认工作区)"}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:"数字人使用工具时(bash/read/write)的根目录。留空则自动创建专属工作区。"})]})]}),(0,a.jsxs)(y.av,{value:"model",className:"space-y-5",children:[(0,a.jsxs)("div",{className:"space-y-1.5",children:[(0,a.jsx)(g.J,{children:x("modelId")}),(0,a.jsx)(w.Bd,{providerId:C.model.provider,modelId:C.model.modelId,onChange:(e,s,t)=>{S(t),B(a=>{var l;return{...a,model:{...a.model,provider:e,modelId:s,thinkingLevel:t.supportsThinking?"off"!==a.model.thinkingLevel?a.model.thinkingLevel:null!==(l=t.thinkingLevels[0])&&void 0!==l?l:"medium":"off"}}})}}),(0,a.jsxs)("div",{className:"flex flex-wrap gap-1.5 pt-1",children:[(0,a.jsxs)(k.E,{variant:"secondary",className:"text-xs font-normal",children:["上下文 ",D(K.contextWindow)]}),(0,a.jsxs)(k.E,{variant:"secondary",className:"text-xs font-normal",children:["输出最大 ",D(K.maxTokens)]}),K.supportsThinking&&(0,a.jsx)(k.E,{className:"text-xs font-normal bg-purple-100 text-purple-700 dark:bg-purple-900/50 dark:text-purple-300 border-0 hover:bg-purple-100",children:"\uD83E\uDDE0 支持 Thinking"}),!K.supportsTemperature&&(0,a.jsx)(k.E,{variant:"outline",className:"text-xs font-normal text-amber-600 dark:text-amber-400 border-amber-300 dark:border-amber-600",children:"\uD83C\uDF21 无 Temperature"})]})]}),K.supportsThinking&&V.length>0&&(0,a.jsxs)("div",{className:"space-y-1.5",children:[(0,a.jsx)(g.J,{children:x("thinkingLevel")}),(0,a.jsxs)(N.l6,{value:q,onValueChange:e=>I("thinkingLevel",e),children:[(0,a.jsx)(N.bq,{children:(0,a.jsx)(N.yv,{})}),(0,a.jsx)(N.gC,{children:V.map(e=>{var s;return(0,a.jsx)(N.eb,{value:e,children:null!==(s=z[e])&&void 0!==s?s:e},e)})})]}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:"思考深度越高,推理越准确,Token 消耗也会增加。"})]}),K.supportsTemperature&&(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)(g.J,{children:x("temperature")}),(0,a.jsx)("span",{className:"text-sm tabular-nums text-muted-foreground",children:C.model.temperature.toFixed(2)})]}),(0,a.jsx)(v,{min:0,max:1,step:.01,value:[C.model.temperature],onValueChange:e=>{let[s]=e;return I("temperature",s)}}),(0,a.jsxs)("div",{className:"flex justify-between text-[11px] text-muted-foreground px-0.5",children:[(0,a.jsx)("span",{children:"精确 0.00"}),(0,a.jsx)("span",{children:"平衡 0.70"}),(0,a.jsx)("span",{children:"创意 1.00"})]})]}),(0,a.jsxs)("div",{className:"space-y-1.5",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)(g.J,{children:x("maxTokens")}),(0,a.jsxs)("span",{className:"text-xs text-muted-foreground",children:["上限 ",D(K.maxTokens)]})]}),(0,a.jsx)(u.p,{type:"number",min:256,max:K.maxTokens||2e5,value:C.model.maxTokens,onChange:e=>I("maxTokens",Math.min(Number(e.target.value),K.maxTokens||2e5))})]})]}),(0,a.jsxs)(y.av,{value:"tools",className:"space-y-3",children:[(0,a.jsx)("p",{className:"text-xs text-gray-600 dark:text-muted-foreground",children:"开启后数字人可在对话中使用对应工具。点击卡片切换。"}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-2",children:[F.map(e=>{let{key:s,icon:t,color:l,labelKey:r,hintKey:n}=e,o=C.tools[s];return(0,a.jsxs)("button",{type:"button",onClick:()=>W(s),className:(0,f.cn)("flex items-center gap-4 rounded-xl p-4 text-left transition-all",o?"neo-card-inset border-2 border-blue-200 bg-blue-50 dark:border-[#57BE6B]/60 dark:bg-[#57BE6B]/20 shadow-sm":"neo-button bg-white dark:bg-transparent border border-gray-200 dark:border-border hover:border-blue-300 dark:hover:border-zinc-600 hover:scale-[1.01]"),children:[(0,a.jsx)("div",{className:(0,f.cn)("h-10 w-10 rounded-xl flex items-center justify-center shrink-0",l),children:(0,a.jsx)(t,{className:"h-5 w-5"})}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"text-sm font-medium text-gray-800 dark:text-white",children:x("tools.".concat(r))}),(0,a.jsx)("p",{className:"text-xs text-gray-600 dark:text-muted-foreground mt-0.5",children:x("tools.".concat(n))})]}),(0,a.jsx)(H,{enabled:o})]},s)}),(0,a.jsxs)("button",{type:"button",onClick:()=>B(e=>({...e,voice:{enabled:!e.voice.enabled}})),className:(0,f.cn)("flex items-center gap-4 rounded-xl p-4 text-left transition-all",C.voice.enabled?"neo-card-inset border-2 border-green-200 bg-green-50 dark:border-green-500/60 dark:bg-green-500/20 shadow-sm":"neo-button bg-white dark:bg-transparent border border-gray-200 dark:border-border hover:border-green-300 dark:hover:border-zinc-600 hover:scale-[1.01]"),children:[(0,a.jsx)("div",{className:(0,f.cn)("h-10 w-10 rounded-xl flex items-center justify-center shrink-0",C.voice.enabled?"bg-green-500 text-white":"bg-gray-100 text-gray-500 dark:bg-muted dark:text-muted-foreground"),children:(0,a.jsx)(m.A,{className:"h-5 w-5"})}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("p",{className:"text-sm font-semibold text-gray-800 dark:text-white",children:"语音功能"}),(0,a.jsx)("p",{className:"text-xs text-gray-600 dark:text-muted-foreground mt-0.5",children:"启用语音朗读功能(全局供应商在设置中配置)"})]}),(0,a.jsx)(H,{enabled:C.voice.enabled})]})]})]}),(0,a.jsx)(y.av,{value:"skills",className:"space-y-3",children:(0,a.jsx)("div",{className:"neo-card flex items-start gap-3 rounded-xl border-2 border-purple-200 dark:border-purple-800 bg-purple-50 dark:bg-purple-900/20 p-4",children:(0,a.jsx)("div",{className:"flex-1",children:(0,a.jsx)("p",{className:"text-sm text-gray-700 dark:text-gray-300",children:"Skills 功能允许agent使用自定义工具和能力。"})})})})]}),(0,a.jsx)("div",{className:"mt-6 flex justify-end",children:(0,a.jsx)(h.$,{type:"submit",disabled:d||!C.name.trim(),className:"neo-button bg-gradient-to-r from-blue-500 to-indigo-500 dark:from-cyan-600 dark:to-blue-600 hover:from-blue-600 hover:to-indigo-600 dark:hover:from-cyan-500 dark:hover:to-blue-500 text-white",children:d?j("loading"):null!=c?c:j("save")})})]})}function D(e){return e>=1e6?"".concat((e/1e6).toFixed(0),"M"):e>=1e3?"".concat((e/1e3).toFixed(0),"K"):String(e)}function H(e){let{enabled:s,color:t="default"}=e;return(0,a.jsx)("div",{className:(0,f.cn)("h-[22px] w-10 rounded-full transition-colors duration-200 shrink-0 relative",s?"bg-[#57BE6B]":"bg-zinc-300 dark:bg-zinc-600"),children:(0,a.jsx)("div",{className:(0,f.cn)("absolute top-[3px] h-4 w-4 rounded-full bg-white shadow-md transition-transform duration-200",s?"translate-x-[19px]":"translate-x-[3px]")})})}},3701:(e,s,t)=>{t.d(s,{B:()=>l,k:()=>a});let a={name:"",avatar:"\uD83E\uDD16",description:"",systemPrompt:"",persona:{tone:"friendly",language:"zh-CN"},model:{provider:"anthropic",modelId:"claude-opus-4-5",temperature:.7,maxTokens:8192,thinkingLevel:"medium"},voice:{enabled:!1},tools:{bash:!1,fileRead:!1,fileWrite:!1,grep:!1,find:!1,calculator:!1},knowledgeBases:[],enabledSkills:[],workspacePath:""},l=["\uD83E\uDD16","\uD83E\uDDE0","\uD83D\uDCA1","\uD83C\uDFAF","\uD83C\uDF1F","\uD83E\uDDBE","\uD83D\uDC7E","\uD83C\uDFAD","\uD83D\uDC68\uD83D\uDCBC","\uD83D\uDC69\uD83D\uDCBC","\uD83D\uDC68\uD83C\uDFEB","\uD83D\uDC69\uD83C\uDFEB","\uD83D\uDC68\uD83D\uDCBB","\uD83D\uDC69\uD83D\uDCBB","\uD83E\uDDD1\uD83C\uDFA8","\uD83E\uDDD1\uD83D\uDD2C","\uD83D\uDC09","\uD83E\uDD8A","\uD83D\uDC3C","\uD83E\uDD81","\uD83D\uDC2C","\uD83E\uDD8B","\uD83C\uDF08","⚡"]}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3627],{5311:(e,t,a)=>{Promise.resolve().then(a.bind(a,260))},260:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>u});var s=a(5155),n=a(2115),i=a(6046),l=a(7266),r=a(3518),o=a(
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3627],{5311:(e,t,a)=>{Promise.resolve().then(a.bind(a,260))},260:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>u});var s=a(5155),n=a(2115),i=a(6046),l=a(7266),r=a(3518),o=a(6009),c=a(3312);function u(e){let{params:t}=e,a=(0,l.useTranslations)("agents"),u=(0,l.useTranslations)("common"),d=(0,l.useLocale)(),h=(0,i.useRouter)(),[f,m]=(0,n.useState)(null),[x,g]=(0,n.useState)(!1);(0,n.useEffect)(()=>{t.then(e=>{let{id:t}=e;return fetch("/api/agents/".concat(t)).then(e=>e.json()).then(m)})},[t]);let b=async e=>{if(f){g(!0);try{await fetch("/api/agents/".concat(f.id),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),h.push("/".concat(d,"/agents"))}finally{g(!1)}}};return f?(0,s.jsxs)("div",{className:"p-6 max-w-2xl mx-auto min-h-full bg-gradient-to-br from-gray-50 to-gray-100 dark:from-slate-900 dark:to-slate-900",children:[(0,s.jsxs)("div",{className:"mb-6 flex items-center gap-3",children:[(0,s.jsx)(c.$,{variant:"ghost",size:"icon",onClick:()=>h.back(),className:"neo-button hover:scale-110 transition-transform",children:(0,s.jsx)(r.A,{className:"h-5 w-5"})}),(0,s.jsx)("h1",{className:"text-2xl font-bold text-gray-800 dark:text-white",children:a("editConfig")})]}),(0,s.jsx)(o.S,{initialValues:f,onSave:b,saving:x,submitLabel:u("save")})]}):(0,s.jsx)("div",{className:"flex items-center justify-center h-full text-gray-600 dark:text-muted-foreground",children:u("loading")})}}},e=>{var t=t=>e(e.s=t);e.O(0,[8313,1868,3259,8173,5964,3763,5822,6009,8441,1517,7358],()=>t(5311)),_N_E=e.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2469],{6109:(a,e,s)=>{Promise.resolve().then(s.bind(s,1594))},1594:(a,e,s)=>{"use strict";s.r(e),s.d(e,{default:()=>h});var t=s(5155),n=s(2115),i=s(6046),r=s(7266),l=s(3518),o=s(
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2469],{6109:(a,e,s)=>{Promise.resolve().then(s.bind(s,1594))},1594:(a,e,s)=>{"use strict";s.r(e),s.d(e,{default:()=>h});var t=s(5155),n=s(2115),i=s(6046),r=s(7266),l=s(3518),o=s(6009),c=s(3312),d=s(3701);function h(){let a=(0,r.useTranslations)("agents"),e=(0,r.useTranslations)("common"),s=(0,r.useLocale)(),h=(0,i.useRouter)(),[u,m]=(0,n.useState)(!1),x=async a=>{m(!0);try{let e=await fetch("/api/agents",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)}),t=await e.json();h.push("/".concat(s,"/agents/").concat(t.id,"/chat"))}finally{m(!1)}};return(0,t.jsxs)("div",{className:"p-6 max-w-2xl mx-auto min-h-full bg-gradient-to-br from-gray-50 to-gray-100 dark:from-slate-900 dark:to-slate-900",children:[(0,t.jsxs)("div",{className:"mb-6 flex items-center gap-3",children:[(0,t.jsx)(c.$,{variant:"ghost",size:"icon",onClick:()=>h.back(),className:"neo-button hover:scale-110 transition-transform",children:(0,t.jsx)(l.A,{className:"h-5 w-5"})}),(0,t.jsx)("div",{children:(0,t.jsx)("h1",{className:"text-2xl font-bold text-gray-800 dark:text-white",children:a("new")})})]}),(0,t.jsx)(o.S,{initialValues:d.k,onSave:x,saving:u,submitLabel:e("create")})]})}}},a=>{var e=e=>a(a.s=e);a.O(0,[8313,1868,3259,8173,5964,3763,5822,6009,8441,1517,7358],()=>e(6109)),_N_E=a.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[886],{910:(e,t,a)=>{Promise.resolve().then(a.bind(a,6037))},3467:(e,t,a)=>{"use strict";a.d(t,{A:()=>r});let r=(0,a(7401).A)("BookOpen",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]])},4081:(e,t,a)=>{"use strict";a.d(t,{A:()=>r});let r=(0,a(7401).A)("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]])},3473:(e,t,a)=>{"use strict";a.d(t,{A:()=>r});let r=(0,a(7401).A)("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},853:(e,t,a)=>{"use strict";a.d(t,{A:()=>r});let r=(0,a(7401).A)("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]])},5686:(e,t,a)=>{"use strict";a.d(t,{A:()=>r});let r=(0,a(7401).A)("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]])},6037:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>y});var r=a(5155),s=a(2115),n=a(7266),l=a(3473),d=a(3467),i=a(5686);let o=(0,a(7401).A)("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);var c=a(4081),u=a(853),x=a(3312),m=a(3900),h=a(8986),f=a(6754),p=a(1344),g=a(7995),b=a(1567);function y(){let e=(0,n.useTranslations)("knowledge"),t=(0,n.useTranslations)("common"),[a,y]=(0,s.useState)([]),[v,j]=(0,s.useState)(null),[k,N]=(0,s.useState)([]),[w,C]=(0,s.useState)(!1),[A,E]=(0,s.useState)(""),[M,T]=(0,s.useState)(""),[S,z]=(0,s.useState)(!1),[R,P]=(0,s.useState)(""),[D,O]=(0,s.useState)([]),[L,H]=(0,s.useState)(!1),J=(0,s.useRef)(null),V=(0,s.useRef)(null);(0,s.useEffect)(()=>{fetch("/api/knowledge").then(e=>e.json()).then(y)},[]),(0,s.useEffect)(()=>{if(!v)return;let e=()=>fetch("/api/knowledge/".concat(v.id)).then(e=>e.json()).then(t=>{N(t.documents),t.documents.some(e=>"processing"===e.status)&&(V.current=setTimeout(e,2e3))});return e(),()=>{V.current&&clearTimeout(V.current)}},[v]);let $=async()=>{let e=await fetch("/api/knowledge",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:A,description:M})}),t=await e.json();y(e=>[t,...e]),E(""),T(""),C(!1),j(t)},B=async e=>{await fetch("/api/knowledge/".concat(e),{method:"DELETE"}),y(t=>t.filter(t=>t.id!==e)),(null==v?void 0:v.id)===e&&j(null)},F=async e=>{if(!v)return;z(!0);let t=new FormData;t.append("file",e),await fetch("/api/knowledge/".concat(v.id,"/upload"),{method:"POST",body:t}),z(!1),fetch("/api/knowledge/".concat(v.id)).then(e=>e.json()).then(e=>N(e.documents))},_=async e=>{await fetch("/api/knowledge/".concat(v.id,"/documents/").concat(e),{method:"DELETE"}),N(t=>t.filter(t=>t.id!==e))},q=async()=>{if(!v||!R.trim())return;H(!0);let e=await fetch("/api/knowledge/search",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({kbIds:[v.id],query:R})});O(await e.json()),H(!1)};return(0,r.jsxs)("div",{className:"flex h-full bg-white dark:bg-slate-900",children:[(0,r.jsxs)("div",{className:"w-64 flex-shrink-0 border-r border-gray-200 dark:border-slate-700/50 flex flex-col bg-[hsl(var(--neo-bg))] dark:bg-slate-900/95",children:[(0,r.jsxs)("div",{className:"p-3 border-b border-gray-200 dark:border-slate-700/50 flex items-center justify-between",children:[(0,r.jsx)("h2",{className:"font-semibold text-sm text-gray-800 dark:text-white",children:e("title")}),(0,r.jsx)(x.$,{size:"icon",variant:"ghost",className:"h-7 w-7 neo-button hover:scale-110 transition-transform",onClick:()=>C(!0),children:(0,r.jsx)(l.A,{className:"h-4 w-4"})})]}),(0,r.jsx)(g.F,{className:"flex-1",children:(0,r.jsx)("div",{className:"p-2 space-y-1",children:0===a.length?(0,r.jsxs)("div",{className:"py-8 text-center",children:[(0,r.jsx)("div",{className:"neo-card w-12 h-12 mx-auto rounded-xl bg-white dark:bg-slate-800/50 flex items-center justify-center mb-2",children:(0,r.jsx)(d.A,{className:"h-6 w-6 text-gray-400 dark:text-muted-foreground"})}),(0,r.jsx)("p",{className:"text-xs text-gray-600 dark:text-muted-foreground",children:e("empty")})]}):a.map(t=>(0,r.jsxs)("div",{className:(0,b.cn)("group relative flex items-center justify-between rounded-lg px-3 py-2.5 cursor-pointer transition-all",(null==v?void 0:v.id)===t.id?"neo-card-inset bg-blue-50 dark:bg-[#57BE6B]/20 border border-blue-200 dark:border-[#57BE6B]/60 shadow-sm":"neo-button border border-transparent hover:border-gray-300 dark:hover:border-zinc-700 hover:scale-[1.02]"),onClick:()=>j(t),children:[(null==v?void 0:v.id)===t.id&&(0,r.jsx)("span",{className:"absolute left-0 top-1/2 -translate-y-1/2 w-[3px] h-5 rounded-r-full bg-blue-500 dark:bg-[#57BE6B]"}),(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsx)("p",{className:"text-sm font-medium truncate text-gray-800 dark:text-white",children:t.name}),(0,r.jsxs)("p",{className:"text-xs text-gray-600 dark:text-muted-foreground",children:[t.documentCount," ",e("documents")]})]}),(0,r.jsx)(x.$,{size:"icon",variant:"ghost",className:"h-6 w-6 opacity-0 group-hover:opacity-100 text-destructive hover:text-destructive flex-shrink-0 hover:scale-110 transition-all",onClick:e=>{e.stopPropagation(),B(t.id)},children:(0,r.jsx)(i.A,{className:"h-3 w-3"})})]},t.id))})})]}),(0,r.jsx)("div",{className:"flex-1 min-w-0 overflow-auto bg-gradient-to-br from-gray-50 to-gray-100 dark:from-slate-900 dark:via-slate-900 dark:to-slate-900",children:v?(0,r.jsxs)("div",{className:"p-6 space-y-6 max-w-3xl",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("h2",{className:"text-xl font-bold text-gray-800 dark:text-white",children:v.name}),(0,r.jsxs)("p",{className:"text-sm text-gray-600 dark:text-muted-foreground",children:[v.documentCount," ",e("documents")," \xb7 ",v.chunkCount," ",e("chunks")]})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("input",{ref:J,type:"file",accept:".pdf,.docx,.txt,.md",className:"hidden",onChange:e=>{var t;let a=null===(t=e.target.files)||void 0===t?void 0:t[0];a&&F(a)}}),(0,r.jsxs)(x.$,{variant:"outline",disabled:S,onClick:()=>{var e;return null===(e=J.current)||void 0===e?void 0:e.click()},className:"neo-button bg-gradient-to-r from-blue-500 to-indigo-500 dark:from-cyan-600 dark:to-blue-600 hover:from-blue-600 hover:to-indigo-600 dark:hover:from-cyan-500 dark:hover:to-blue-500 text-white border-0",children:[(0,r.jsx)(o,{className:"mr-2 h-4 w-4"}),S?t("loading"):e("uploadDoc")]})]})]}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(h.J,{className:"text-gray-700 dark:text-gray-300",children:e("documents")}),0===k.length?(0,r.jsxs)("div",{className:"neo-card rounded-lg border-2 border-dashed border-gray-300 dark:border-slate-700 p-8 text-center bg-white dark:bg-slate-800/30",children:[(0,r.jsx)("div",{className:"neo-card w-12 h-12 mx-auto rounded-xl bg-white dark:bg-slate-800/50 flex items-center justify-center mb-2",children:(0,r.jsx)(c.A,{className:"h-6 w-6 text-gray-400 dark:text-muted-foreground"})}),(0,r.jsx)("p",{className:"text-sm text-gray-600 dark:text-muted-foreground",children:e("uploadHint")})]}):k.map(t=>(0,r.jsxs)("div",{className:"neo-card flex items-center gap-3 rounded-lg px-4 py-2.5 bg-white dark:bg-slate-800/50 hover:scale-[1.01] transition-transform",children:[(0,r.jsx)(c.A,{className:"h-4 w-4 text-blue-500 dark:text-cyan-400 flex-shrink-0"}),(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsx)("p",{className:"text-sm font-medium truncate text-gray-800 dark:text-white",children:t.filename}),(0,r.jsx)("p",{className:"text-xs text-gray-600 dark:text-muted-foreground",children:"processing"===t.status?(0,r.jsx)("span",{className:"animate-pulse",children:e("processing")}):"".concat(t.chunkCount," chunks")})]}),(0,r.jsx)(x.$,{size:"icon",variant:"ghost",className:"h-7 w-7 text-destructive hover:text-destructive hover:scale-110 transition-transform",onClick:()=>_(t.id),children:(0,r.jsx)(i.A,{className:"h-3 w-3"})})]},t.id))]}),(0,r.jsxs)("div",{className:"space-y-3",children:[(0,r.jsx)(h.J,{className:"text-gray-700 dark:text-gray-300",children:e("searchTest")}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(m.p,{value:R,onChange:e=>P(e.target.value),placeholder:e("searchPlaceholder"),onKeyDown:e=>"Enter"===e.key&&q(),className:"neo-card bg-white dark:bg-slate-800/50"}),(0,r.jsx)(x.$,{variant:"outline",onClick:q,disabled:L,className:"neo-button hover:scale-105 transition-transform",children:(0,r.jsx)(u.A,{className:"h-4 w-4"})})]}),D.length>0&&(0,r.jsx)("div",{className:"space-y-2",children:D.map((t,a)=>(0,r.jsxs)("div",{className:"neo-card rounded-lg p-3 text-sm bg-white dark:bg-slate-800/50",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,r.jsx)("span",{className:"text-xs text-gray-600 dark:text-muted-foreground",children:t.filename}),(0,r.jsxs)("span",{className:"text-xs text-blue-600 dark:text-cyan-400 font-medium",children:[e("relevance"),": ",(100*t.score).toFixed(1),"%"]})]}),(0,r.jsx)("p",{className:"text-sm text-gray-700 dark:text-gray-300 line-clamp-4",children:t.content})]},a))}),0===D.length&&R&&!L&&(0,r.jsx)("p",{className:"text-sm text-gray-600 dark:text-muted-foreground",children:e("noResults")})]})]}):(0,r.jsx)("div",{className:"flex h-full items-center justify-center text-center",children:(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"neo-card w-20 h-20 mx-auto rounded-2xl bg-white dark:bg-slate-800/50 flex items-center justify-center mb-3",children:(0,r.jsx)(d.A,{className:"h-10 w-10 text-gray-400 dark:text-muted-foreground"})}),(0,r.jsx)("p",{className:"text-gray-600 dark:text-muted-foreground",children:e("emptyHint")})]})})}),(0,r.jsx)(p.lG,{open:w,onOpenChange:C,children:(0,r.jsxs)(p.Cf,{children:[(0,r.jsx)(p.c7,{children:(0,r.jsx)(p.L3,{children:e("new")})}),(0,r.jsxs)("div",{className:"space-y-3",children:[(0,r.jsxs)("div",{className:"space-y-1.5",children:[(0,r.jsx)(h.J,{children:e("form.name")}),(0,r.jsx)(m.p,{value:A,onChange:e=>E(e.target.value),placeholder:e("form.namePlaceholder")})]}),(0,r.jsxs)("div",{className:"space-y-1.5",children:[(0,r.jsx)(h.J,{children:t("description")}),(0,r.jsx)(f.T,{value:M,onChange:e=>T(e.target.value),placeholder:e("form.descriptionPlaceholder"),rows:3})]})]}),(0,r.jsxs)(p.Es,{children:[(0,r.jsx)(x.$,{variant:"outline",onClick:()=>C(!1),className:"neo-button",children:t("cancel")}),(0,r.jsx)(x.$,{onClick:$,disabled:!A.trim(),className:"neo-button bg-gradient-to-r from-blue-500 to-indigo-500 dark:from-cyan-600 dark:to-blue-600 hover:from-blue-600 hover:to-indigo-600 dark:hover:from-cyan-500 dark:hover:to-blue-500 text-white",children:t("create")})]})]})})]})}},3312:(e,t,a)=>{"use strict";a.d(t,{$:()=>o});var r=a(5155),s=a(2115),n=a(2317),l=a(1027),d=a(1567);let i=(0,l.F)("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),o=s.forwardRef((e,t)=>{let{className:a,variant:s,size:l,asChild:o=!1,...c}=e,u=o?n.DX:"button";return(0,r.jsx)(u,{className:(0,d.cn)(i({variant:s,size:l,className:a})),ref:t,...c})});o.displayName="Button"},1344:(e,t,a)=>{"use strict";a.d(t,{Cf:()=>x,Es:()=>h,L3:()=>f,c7:()=>m,lG:()=>i,rr:()=>p});var r=a(5155),s=a(2115),n=a(6217),l=a(767),d=a(1567);let i=n.bL;n.l9;let o=n.ZL,c=n.bm,u=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)(n.hJ,{ref:t,className:(0,d.cn)("fixed inset-0 z-50 bg-black/60 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",a),...s})});u.displayName=n.hJ.displayName;let x=s.forwardRef((e,t)=>{let{className:a,children:s,...i}=e;return(0,r.jsxs)(o,{children:[(0,r.jsx)(u,{}),(0,r.jsxs)(n.UC,{ref:t,className:(0,d.cn)("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 rounded-lg",a),...i,children:[s,(0,r.jsx)(c,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring disabled:pointer-events-none",children:(0,r.jsx)(l.A,{className:"h-4 w-4"})})]})]})});x.displayName=n.UC.displayName;let m=e=>{let{className:t,...a}=e;return(0,r.jsx)("div",{className:(0,d.cn)("flex flex-col space-y-1.5 text-center sm:text-left",t),...a})};m.displayName="DialogHeader";let h=e=>{let{className:t,...a}=e;return(0,r.jsx)("div",{className:(0,d.cn)("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...a})};h.displayName="DialogFooter";let f=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)(n.hE,{ref:t,className:(0,d.cn)("text-lg font-semibold leading-none tracking-tight",a),...s})});f.displayName=n.hE.displayName;let p=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)(n.VY,{ref:t,className:(0,d.cn)("text-sm text-muted-foreground",a),...s})});p.displayName=n.VY.displayName},3900:(e,t,a)=>{"use strict";a.d(t,{p:()=>l});var r=a(5155),s=a(2115),n=a(1567);let l=s.forwardRef((e,t)=>{let{className:a,type:s,...l}=e;return(0,r.jsx)("input",{type:s,className:(0,n.cn)("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",a),ref:t,...l})});l.displayName="Input"},8986:(e,t,a)=>{"use strict";a.d(t,{J:()=>d});var r=a(5155),s=a(2115),n=a(6195),l=a(1567);let d=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)(n.b,{ref:t,className:(0,l.cn)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",a),...s})});d.displayName=n.b.displayName},7995:(e,t,a)=>{"use strict";a.d(t,{F:()=>d});var r=a(5155),s=a(2115),n=a(1868),l=a(1567);let d=s.forwardRef((e,t)=>{let{className:a,children:s,...d}=e;return(0,r.jsxs)(n.bL,{ref:t,className:(0,l.cn)("relative overflow-hidden",a),...d,children:[(0,r.jsx)(n.LM,{className:"h-full w-full rounded-[inherit]",children:s}),(0,r.jsx)(i,{}),(0,r.jsx)(n.OK,{})]})});d.displayName=n.bL.displayName;let i=s.forwardRef((e,t)=>{let{className:a,orientation:s="vertical",...d}=e;return(0,r.jsx)(n.VM,{ref:t,orientation:s,className:(0,l.cn)("flex touch-none select-none transition-colors","vertical"===s&&"h-full w-2.5 border-l border-l-transparent p-[1px]","horizontal"===s&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",a),...d,children:(0,r.jsx)(n.lr,{className:"relative flex-1 rounded-full bg-border"})})});i.displayName=n.VM.displayName},6754:(e,t,a)=>{"use strict";a.d(t,{T:()=>l});var r=a(5155),s=a(2115),n=a(1567);let l=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)("textarea",{className:(0,n.cn)("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",a),ref:t,...s})});l.displayName="Textarea"},1567:(e,t,a)=>{"use strict";a.d(t,{cn:()=>n});var r=a(3463),s=a(9795);function n(){for(var e=arguments.length,t=Array(e),a=0;a<e;a++)t[a]=arguments[a];return(0,s.QP)((0,r.$)(t))}},6195:(e,t,a)=>{"use strict";a.d(t,{b:()=>d});var r=a(2115),s=a(3360),n=a(5155),l=Object.defineProperty,d=r.forwardRef(l(function(e,t){return(0,n.jsx)(s.sG.label,{...e,ref:t,onMouseDown:t=>{var a;t.target.closest("button, input, select, textarea")||(null===(a=e.onMouseDown)||void 0===a||a.call(e,t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},"name",{value:"Label",configurable:!0}))}},e=>{var t=t=>e(e.s=t);e.O(0,[8313,3259,1868,8441,1517,7358],()=>t(910)),_N_E=e.O()}]);
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[886],{910:(e,t,a)=>{Promise.resolve().then(a.bind(a,6037))},3467:(e,t,a)=>{"use strict";a.d(t,{A:()=>r});let r=(0,a(7401).A)("BookOpen",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]])},4081:(e,t,a)=>{"use strict";a.d(t,{A:()=>r});let r=(0,a(7401).A)("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]])},3473:(e,t,a)=>{"use strict";a.d(t,{A:()=>r});let r=(0,a(7401).A)("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},853:(e,t,a)=>{"use strict";a.d(t,{A:()=>r});let r=(0,a(7401).A)("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]])},5686:(e,t,a)=>{"use strict";a.d(t,{A:()=>r});let r=(0,a(7401).A)("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]])},6037:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>y});var r=a(5155),s=a(2115),n=a(7266),l=a(3473),d=a(3467),i=a(5686);let o=(0,a(7401).A)("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);var c=a(4081),u=a(853),x=a(3312),m=a(3900),h=a(8986),f=a(6754),p=a(1344),g=a(7995),b=a(1567);function y(){let e=(0,n.useTranslations)("knowledge"),t=(0,n.useTranslations)("common"),[a,y]=(0,s.useState)([]),[v,j]=(0,s.useState)(null),[k,N]=(0,s.useState)([]),[w,C]=(0,s.useState)(!1),[A,E]=(0,s.useState)(""),[M,T]=(0,s.useState)(""),[S,z]=(0,s.useState)(!1),[R,P]=(0,s.useState)(""),[D,O]=(0,s.useState)([]),[L,H]=(0,s.useState)(!1),J=(0,s.useRef)(null),V=(0,s.useRef)(null);(0,s.useEffect)(()=>{fetch("/api/knowledge").then(e=>e.json()).then(y)},[]),(0,s.useEffect)(()=>{if(!v)return;let e=()=>fetch("/api/knowledge/".concat(v.id)).then(e=>e.json()).then(t=>{N(t.documents),t.documents.some(e=>"processing"===e.status)&&(V.current=setTimeout(e,2e3))});return e(),()=>{V.current&&clearTimeout(V.current)}},[v]);let $=async()=>{let e=await fetch("/api/knowledge",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:A,description:M})}),t=await e.json();y(e=>[t,...e]),E(""),T(""),C(!1),j(t)},B=async e=>{await fetch("/api/knowledge/".concat(e),{method:"DELETE"}),y(t=>t.filter(t=>t.id!==e)),(null==v?void 0:v.id)===e&&j(null)},F=async e=>{if(!v)return;z(!0);let t=new FormData;t.append("file",e),await fetch("/api/knowledge/".concat(v.id,"/upload"),{method:"POST",body:t}),z(!1),fetch("/api/knowledge/".concat(v.id)).then(e=>e.json()).then(e=>N(e.documents))},_=async e=>{await fetch("/api/knowledge/".concat(v.id,"/documents/").concat(e),{method:"DELETE"}),N(t=>t.filter(t=>t.id!==e))},q=async()=>{if(!v||!R.trim())return;H(!0);let e=await fetch("/api/knowledge/search",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({kbIds:[v.id],query:R})});O(await e.json()),H(!1)};return(0,r.jsxs)("div",{className:"flex h-full bg-white dark:bg-slate-900",children:[(0,r.jsxs)("div",{className:"w-64 flex-shrink-0 border-r border-gray-200 dark:border-slate-700/50 flex flex-col bg-[hsl(var(--neo-bg))] dark:bg-slate-900/95",children:[(0,r.jsxs)("div",{className:"p-3 border-b border-gray-200 dark:border-slate-700/50 flex items-center justify-between",children:[(0,r.jsx)("h2",{className:"font-semibold text-sm text-gray-800 dark:text-white",children:e("title")}),(0,r.jsx)(x.$,{size:"icon",variant:"ghost",className:"h-7 w-7 neo-button hover:scale-110 transition-transform",onClick:()=>C(!0),children:(0,r.jsx)(l.A,{className:"h-4 w-4"})})]}),(0,r.jsx)(g.F,{className:"flex-1",children:(0,r.jsx)("div",{className:"p-2 space-y-1",children:0===a.length?(0,r.jsxs)("div",{className:"py-8 text-center",children:[(0,r.jsx)("div",{className:"neo-card w-12 h-12 mx-auto rounded-xl bg-white dark:bg-slate-800/50 flex items-center justify-center mb-2",children:(0,r.jsx)(d.A,{className:"h-6 w-6 text-gray-400 dark:text-muted-foreground"})}),(0,r.jsx)("p",{className:"text-xs text-gray-600 dark:text-muted-foreground",children:e("empty")})]}):a.map(t=>(0,r.jsxs)("div",{className:(0,b.cn)("group relative flex items-center justify-between rounded-lg px-3 py-2.5 cursor-pointer transition-all",(null==v?void 0:v.id)===t.id?"neo-card-inset bg-blue-50 dark:bg-[#57BE6B]/20 border border-blue-200 dark:border-[#57BE6B]/60 shadow-sm":"neo-button border border-transparent hover:border-gray-300 dark:hover:border-zinc-700 hover:scale-[1.02]"),onClick:()=>j(t),children:[(null==v?void 0:v.id)===t.id&&(0,r.jsx)("span",{className:"absolute left-0 top-1/2 -translate-y-1/2 w-[3px] h-5 rounded-r-full bg-blue-500 dark:bg-[#57BE6B]"}),(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsx)("p",{className:"text-sm font-medium truncate text-gray-800 dark:text-white",children:t.name}),(0,r.jsxs)("p",{className:"text-xs text-gray-600 dark:text-muted-foreground",children:[t.documentCount," ",e("documents")]})]}),(0,r.jsx)(x.$,{size:"icon",variant:"ghost",className:"h-6 w-6 opacity-0 group-hover:opacity-100 text-destructive hover:text-destructive flex-shrink-0 hover:scale-110 transition-all",onClick:e=>{e.stopPropagation(),B(t.id)},children:(0,r.jsx)(i.A,{className:"h-3 w-3"})})]},t.id))})})]}),(0,r.jsx)("div",{className:"flex-1 min-w-0 overflow-auto bg-gradient-to-br from-gray-50 to-gray-100 dark:from-slate-900 dark:via-slate-900 dark:to-slate-900",children:v?(0,r.jsxs)("div",{className:"p-6 space-y-6 max-w-3xl",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("h2",{className:"text-xl font-bold text-gray-800 dark:text-white",children:v.name}),(0,r.jsxs)("p",{className:"text-sm text-gray-600 dark:text-muted-foreground",children:[v.documentCount," ",e("documents")," \xb7 ",v.chunkCount," ",e("chunks")]})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("input",{ref:J,type:"file",accept:".pdf,.docx,.txt,.md",className:"hidden",onChange:e=>{var t;let a=null===(t=e.target.files)||void 0===t?void 0:t[0];a&&F(a)}}),(0,r.jsxs)(x.$,{variant:"outline",disabled:S,onClick:()=>{var e;return null===(e=J.current)||void 0===e?void 0:e.click()},className:"neo-button bg-gradient-to-r from-blue-500 to-indigo-500 dark:from-cyan-600 dark:to-blue-600 hover:from-blue-600 hover:to-indigo-600 dark:hover:from-cyan-500 dark:hover:to-blue-500 text-white border-0",children:[(0,r.jsx)(o,{className:"mr-2 h-4 w-4"}),S?t("loading"):e("uploadDoc")]})]})]}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(h.J,{className:"text-gray-700 dark:text-gray-300",children:e("documents")}),0===k.length?(0,r.jsxs)("div",{className:"neo-card rounded-lg border-2 border-dashed border-gray-300 dark:border-slate-700 p-8 text-center bg-white dark:bg-slate-800/30",children:[(0,r.jsx)("div",{className:"neo-card w-12 h-12 mx-auto rounded-xl bg-white dark:bg-slate-800/50 flex items-center justify-center mb-2",children:(0,r.jsx)(c.A,{className:"h-6 w-6 text-gray-400 dark:text-muted-foreground"})}),(0,r.jsx)("p",{className:"text-sm text-gray-600 dark:text-muted-foreground",children:e("uploadHint")})]}):k.map(t=>(0,r.jsxs)("div",{className:"neo-card flex items-center gap-3 rounded-lg px-4 py-2.5 bg-white dark:bg-slate-800/50 hover:scale-[1.01] transition-transform",children:[(0,r.jsx)(c.A,{className:"h-4 w-4 text-blue-500 dark:text-cyan-400 flex-shrink-0"}),(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsx)("p",{className:"text-sm font-medium truncate text-gray-800 dark:text-white",children:t.filename}),(0,r.jsx)("p",{className:"text-xs text-gray-600 dark:text-muted-foreground",children:"processing"===t.status?(0,r.jsx)("span",{className:"animate-pulse",children:e("processing")}):"".concat(t.chunkCount," chunks")})]}),(0,r.jsx)(x.$,{size:"icon",variant:"ghost",className:"h-7 w-7 text-destructive hover:text-destructive hover:scale-110 transition-transform",onClick:()=>_(t.id),children:(0,r.jsx)(i.A,{className:"h-3 w-3"})})]},t.id))]}),(0,r.jsxs)("div",{className:"space-y-3",children:[(0,r.jsx)(h.J,{className:"text-gray-700 dark:text-gray-300",children:e("searchTest")}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(m.p,{value:R,onChange:e=>P(e.target.value),placeholder:e("searchPlaceholder"),onKeyDown:e=>"Enter"===e.key&&q(),className:"neo-card bg-white dark:bg-slate-800/50"}),(0,r.jsx)(x.$,{variant:"outline",onClick:q,disabled:L,className:"neo-button hover:scale-105 transition-transform",children:(0,r.jsx)(u.A,{className:"h-4 w-4"})})]}),D.length>0&&(0,r.jsx)("div",{className:"space-y-2",children:D.map((t,a)=>(0,r.jsxs)("div",{className:"neo-card rounded-lg p-3 text-sm bg-white dark:bg-slate-800/50",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,r.jsx)("span",{className:"text-xs text-gray-600 dark:text-muted-foreground",children:t.filename}),(0,r.jsxs)("span",{className:"text-xs text-blue-600 dark:text-cyan-400 font-medium",children:[e("relevance"),": ",(100*t.score).toFixed(1),"%"]})]}),(0,r.jsx)("p",{className:"text-sm text-gray-700 dark:text-gray-300 line-clamp-4",children:t.content})]},a))}),0===D.length&&R&&!L&&(0,r.jsx)("p",{className:"text-sm text-gray-600 dark:text-muted-foreground",children:e("noResults")})]})]}):(0,r.jsx)("div",{className:"flex h-full items-center justify-center text-center",children:(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"neo-card w-20 h-20 mx-auto rounded-2xl bg-white dark:bg-slate-800/50 flex items-center justify-center mb-3",children:(0,r.jsx)(d.A,{className:"h-10 w-10 text-gray-400 dark:text-muted-foreground"})}),(0,r.jsx)("p",{className:"text-gray-600 dark:text-muted-foreground",children:e("emptyHint")})]})})}),(0,r.jsx)(p.lG,{open:w,onOpenChange:C,children:(0,r.jsxs)(p.Cf,{children:[(0,r.jsx)(p.c7,{children:(0,r.jsx)(p.L3,{children:e("new")})}),(0,r.jsxs)("div",{className:"space-y-3",children:[(0,r.jsxs)("div",{className:"space-y-1.5",children:[(0,r.jsx)(h.J,{children:e("form.name")}),(0,r.jsx)(m.p,{value:A,onChange:e=>E(e.target.value),placeholder:e("form.namePlaceholder")})]}),(0,r.jsxs)("div",{className:"space-y-1.5",children:[(0,r.jsx)(h.J,{children:t("description")}),(0,r.jsx)(f.T,{value:M,onChange:e=>T(e.target.value),placeholder:e("form.descriptionPlaceholder"),rows:3})]})]}),(0,r.jsxs)(p.Es,{children:[(0,r.jsx)(x.$,{variant:"outline",onClick:()=>C(!1),className:"neo-button",children:t("cancel")}),(0,r.jsx)(x.$,{onClick:$,disabled:!A.trim(),className:"neo-button bg-gradient-to-r from-blue-500 to-indigo-500 dark:from-cyan-600 dark:to-blue-600 hover:from-blue-600 hover:to-indigo-600 dark:hover:from-cyan-500 dark:hover:to-blue-500 text-white",children:t("create")})]})]})})]})}},3312:(e,t,a)=>{"use strict";a.d(t,{$:()=>o});var r=a(5155),s=a(2115),n=a(2317),l=a(1027),d=a(1567);let i=(0,l.F)("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),o=s.forwardRef((e,t)=>{let{className:a,variant:s,size:l,asChild:o=!1,...c}=e,u=o?n.DX:"button";return(0,r.jsx)(u,{className:(0,d.cn)(i({variant:s,size:l,className:a})),ref:t,...c})});o.displayName="Button"},1344:(e,t,a)=>{"use strict";a.d(t,{Cf:()=>x,Es:()=>h,L3:()=>f,c7:()=>m,lG:()=>i,rr:()=>p});var r=a(5155),s=a(2115),n=a(6217),l=a(767),d=a(1567);let i=n.bL;n.l9;let o=n.ZL,c=n.bm,u=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)(n.hJ,{ref:t,className:(0,d.cn)("fixed inset-0 z-50 bg-black/60 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",a),...s})});u.displayName=n.hJ.displayName;let x=s.forwardRef((e,t)=>{let{className:a,children:s,...i}=e;return(0,r.jsxs)(o,{children:[(0,r.jsx)(u,{}),(0,r.jsxs)(n.UC,{ref:t,className:(0,d.cn)("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 rounded-lg",a),...i,children:[s,(0,r.jsx)(c,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring disabled:pointer-events-none",children:(0,r.jsx)(l.A,{className:"h-4 w-4"})})]})]})});x.displayName=n.UC.displayName;let m=e=>{let{className:t,...a}=e;return(0,r.jsx)("div",{className:(0,d.cn)("flex flex-col space-y-1.5 text-center sm:text-left",t),...a})};m.displayName="DialogHeader";let h=e=>{let{className:t,...a}=e;return(0,r.jsx)("div",{className:(0,d.cn)("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...a})};h.displayName="DialogFooter";let f=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)(n.hE,{ref:t,className:(0,d.cn)("text-lg font-semibold leading-none tracking-tight",a),...s})});f.displayName=n.hE.displayName;let p=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)(n.VY,{ref:t,className:(0,d.cn)("text-sm text-muted-foreground",a),...s})});p.displayName=n.VY.displayName},3900:(e,t,a)=>{"use strict";a.d(t,{p:()=>l});var r=a(5155),s=a(2115),n=a(1567);let l=s.forwardRef((e,t)=>{let{className:a,type:s,...l}=e;return(0,r.jsx)("input",{type:s,className:(0,n.cn)("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",a),ref:t,...l})});l.displayName="Input"},8986:(e,t,a)=>{"use strict";a.d(t,{J:()=>d});var r=a(5155),s=a(2115),n=a(6195),l=a(1567);let d=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)(n.b,{ref:t,className:(0,l.cn)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",a),...s})});d.displayName=n.b.displayName},7995:(e,t,a)=>{"use strict";a.d(t,{F:()=>d});var r=a(5155),s=a(2115),n=a(1868),l=a(1567);let d=s.forwardRef((e,t)=>{let{className:a,children:s,...d}=e;return(0,r.jsxs)(n.bL,{ref:t,className:(0,l.cn)("relative overflow-hidden",a),...d,children:[(0,r.jsx)(n.LM,{className:"h-full w-full rounded-[inherit]",children:s}),(0,r.jsx)(i,{}),(0,r.jsx)(n.OK,{})]})});d.displayName=n.bL.displayName;let i=s.forwardRef((e,t)=>{let{className:a,orientation:s="vertical",...d}=e;return(0,r.jsx)(n.VM,{ref:t,orientation:s,className:(0,l.cn)("flex touch-none select-none transition-colors","vertical"===s&&"h-full w-2.5 border-l border-l-transparent p-[1px]","horizontal"===s&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",a),...d,children:(0,r.jsx)(n.lr,{className:"relative flex-1 rounded-full bg-border"})})});i.displayName=n.VM.displayName},6754:(e,t,a)=>{"use strict";a.d(t,{T:()=>l});var r=a(5155),s=a(2115),n=a(1567);let l=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)("textarea",{className:(0,n.cn)("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",a),ref:t,...s})});l.displayName="Textarea"},1567:(e,t,a)=>{"use strict";a.d(t,{cn:()=>n});var r=a(3463),s=a(9795);function n(){for(var e=arguments.length,t=Array(e),a=0;a<e;a++)t[a]=arguments[a];return(0,s.QP)((0,r.$)(t))}},6195:(e,t,a)=>{"use strict";a.d(t,{b:()=>d});var r=a(2115),s=a(3360),n=a(5155),l=Object.defineProperty,d=r.forwardRef(l(function(e,t){return(0,n.jsx)(s.sG.label,{...e,ref:t,onMouseDown:t=>{var a;t.target.closest("button, input, select, textarea")||(null===(a=e.onMouseDown)||void 0===a||a.call(e,t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},"name",{value:"Label",configurable:!0}))}},e=>{var t=t=>e(e.s=t);e.O(0,[8313,1868,3259,8441,1517,7358],()=>t(910)),_N_E=e.O()}]);
|