@qredence/fleet 0.5.9 → 0.5.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/web/client/assets/{artifacts-panel-N4k9VcJr.js → artifacts-panel-CObI-DMt.js} +1 -1
  3. package/dist/web/client/assets/{button-BV9NafmI.js → button-BR2WWrFo.js} +1 -1
  4. package/dist/web/client/assets/{chat-DdPRGn-U.js → chat-C8XDWWXz.js} +1 -1
  5. package/dist/web/client/assets/{chat-command-palette-C_HgND2N.js → chat-command-palette-DfYSPPXI.js} +1 -1
  6. package/dist/web/client/assets/{command-Cx-UYeQ9.js → command-DPfiaYUL.js} +1 -1
  7. package/dist/web/client/assets/{dialog-Dh7WpGIu.js → dialog-BEZuZhzk.js} +1 -1
  8. package/dist/web/client/assets/{fleet-message-queue-DPBMIZSU.js → fleet-message-queue-zWM5-y18.js} +1 -1
  9. package/dist/web/client/assets/{fleet-pi-tool-renderer-DMjrKLi2.js → fleet-pi-tool-renderer-AJoMbXBa.js} +1 -1
  10. package/dist/web/client/assets/{fork-picker-dialog-CAhWx0G5.js → fork-picker-dialog-CkcSekBl.js} +1 -1
  11. package/dist/web/client/assets/{generative-text-renderer-CzwNIs3b.js → generative-text-renderer-CDKHv-v_.js} +3 -3
  12. package/dist/web/client/assets/globals-DisQPFtV.css +2 -0
  13. package/dist/web/client/assets/{index-CwtZA4hF.js → index-DlnHLDpx.js} +3 -3
  14. package/dist/web/client/assets/{input-Bol3TP4v.js → input-0wwjWjKq.js} +1 -1
  15. package/dist/web/client/assets/{input-group-D5gi9zBK.js → input-group-BFDsCVS9.js} +1 -1
  16. package/dist/web/client/assets/{model-selector-list-CJY9pyt2.js → model-selector-list-DQaPFUYt.js} +1 -1
  17. package/dist/web/client/assets/{notify-BnNaNaBU.js → notify-DgMKgZZW.js} +1 -1
  18. package/dist/web/client/assets/{openui-renderer-nuOkzdau.js → openui-renderer-DwYFJdbe.js} +1 -1
  19. package/dist/web/client/assets/prompt-input-DZ4cho_e.js +1 -0
  20. package/dist/web/client/assets/{provider-catalog-CO1GxLYe.js → provider-catalog-D8G66gwc.js} +1 -1
  21. package/dist/web/client/assets/{provider-label-B0E-wWFV.js → provider-label-BCJh04J5.js} +1 -1
  22. package/dist/web/client/assets/{right-panel-registry-DOyEvIMD.js → right-panel-registry-VVRPktV3.js} +2 -2
  23. package/dist/web/client/assets/routes-DAikUNzO.js +16 -0
  24. package/dist/web/client/assets/{settings-dialog-B6rt69m_.js → settings-dialog-DS64KmwC.js} +1 -1
  25. package/dist/web/client/assets/{subagent-chat-panel-Ck06wcIJ.js → subagent-chat-panel-DseoO31p.js} +1 -1
  26. package/dist/web/client/assets/{subagent-transcript-BwCv3nTL.js → subagent-transcript-cxVKYnh9.js} +1 -1
  27. package/dist/web/client/assets/{subagents-panel-BkOorzzy.js → subagents-panel-CHC96I68.js} +1 -1
  28. package/dist/web/client/assets/{switch-J2Lvo_tF.js → switch-9rTeg6J6.js} +1 -1
  29. package/dist/web/client/assets/{toast-BzAKULar.js → toast-Bt9p2OL4.js} +1 -1
  30. package/dist/web/client/assets/{tool-result-Cp13oeRn.js → tool-result-Baj3CdL_.js} +3 -3
  31. package/dist/web/client/bundle-budget.json +5 -5
  32. package/dist/web/server/{_tanstack-start-manifest_v-DkghjPW8-5E6WBVI6.js → _tanstack-start-manifest_v-Cdx6hy2i-I7A5YJRU.js} +15 -15
  33. package/dist/web/server/{artifacts-panel-D20iI9ud-YGBYV6NF.js → artifacts-panel-DLMK1O8P-42T45JMA.js} +9 -9
  34. package/dist/web/server/{chat-command-palette-DmDvAEZe-CONFK6YH.js → chat-command-palette-CdYwoTMe-4LBAZF7K.js} +7 -7
  35. package/dist/web/server/{chunk-IFHABBJO.js → chunk-3PIUR75R.js} +10 -2
  36. package/dist/web/server/{chunk-WVBBA2VV.js → chunk-6AW2XFTZ.js} +3 -3
  37. package/dist/web/server/{chunk-VMYYWXF4.js → chunk-AGFRJQZ7.js} +2 -2
  38. package/dist/web/server/{chunk-TFHXOWFX.js → chunk-AJJ2S5FF.js} +2 -2
  39. package/dist/web/server/{chunk-EFNPNSDO.js → chunk-EOVMHQ2H.js} +3 -3
  40. package/dist/web/server/{chunk-ZVL6TBG5.js → chunk-GM32R7JW.js} +5 -3
  41. package/dist/web/server/{chunk-FZMWPQNE.js → chunk-KNJUSMBT.js} +3 -3
  42. package/dist/web/server/{chunk-WQDG5ZM2.js → chunk-KOUEJ3NU.js} +2 -2
  43. package/dist/web/server/{chunk-JICJWC33.js → chunk-LZ4Q5KUJ.js} +10 -10
  44. package/dist/web/server/{chunk-BTXNB4CP.js → chunk-M564UIEY.js} +7 -7
  45. package/dist/web/server/{chunk-MLPLZVON.js → chunk-OB5OSYJK.js} +4 -4
  46. package/dist/web/server/{chunk-X6RKK47S.js → chunk-P6UMR32I.js} +2 -2
  47. package/dist/web/server/{chunk-QJQZLBLU.js → chunk-P7H2OPKF.js} +3 -3
  48. package/dist/web/server/{chunk-W6IZDM2G.js → chunk-TCH3U26B.js} +4 -4
  49. package/dist/web/server/{chunk-ZCJXHV2R.js → chunk-UAPNEWCA.js} +4 -4
  50. package/dist/web/server/{chunk-TGZIE2T6.js → chunk-WM4PUT6M.js} +4 -4
  51. package/dist/web/server/{chunk-56NGD3FN.js → chunk-WYL2DW5R.js} +2 -2
  52. package/dist/web/server/{chunk-IMK45Q23.js → chunk-XKKXXG6N.js} +3 -3
  53. package/dist/web/server/{fleet-message-queue-BvMcWtLo-6CMMI73U.js → fleet-message-queue-BxycG26e-2XLOTCLP.js} +4 -4
  54. package/dist/web/server/{fleet-pi-tool-renderer-CgbmlIoe-7MSJLEGU.js → fleet-pi-tool-renderer-RIeVlM9J-D6MISCQC.js} +2 -2
  55. package/dist/web/server/{fork-picker-dialog-DfSRzUI5-EBRK5HNO.js → fork-picker-dialog-B9yGc8Au-IL63F2DN.js} +3 -3
  56. package/dist/web/server/{model-selector-list-wCp4_UWC-2NQUCAM3.js → model-selector-list-cb2-ewoA-KIVU6LD3.js} +6 -6
  57. package/dist/web/server/{openui-renderer-BNLpfzyj-JUPJXUWF.js → openui-renderer-Czy5Vo2L-BLXPJD65.js} +7 -7
  58. package/dist/web/server/{router-dnEmu1cU-LUH74TAC.js → router-CgSWrAYc-5UBYSZTJ.js} +5 -5
  59. package/dist/web/server/{routes-Ci5_8lws-F54KB46D.js → routes-CP_BBhD0-BAWQYGKY.js} +31 -28
  60. package/dist/web/server/server.js +2 -2
  61. package/dist/web/server/{settings-dialog-CdFpyzR--JVYIS5OD.js → settings-dialog-CxHe8nym-KKXDPTIW.js} +10 -10
  62. package/dist/web/server/{subagent-chat-panel-DVgf-whR-6G2ASMGU.js → subagent-chat-panel-DlSsM59d-DBW7DI3T.js} +9 -9
  63. package/dist/web/server/{subagents-panel-D2CN0IYy-3L6ZNQ3Q.js → subagents-panel-Txzk8oDb-NRKLASYN.js} +8 -8
  64. package/package.json +1 -1
  65. package/dist/web/client/assets/globals-C7ovVTh2.css +0 -2
  66. package/dist/web/client/assets/prompt-input-BpuTiX7Z.js +0 -1
  67. package/dist/web/client/assets/routes-DkefU9yA.js +0 -16
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t}from"./bundle-mjs-DKHVkVWu.js";import{t as n}from"./jsx-runtime-NZYk81nU.js";import{g as r,h as i,n as a}from"./button-BV9NafmI.js";import{O as o,f as s,j as c,nt as l,rt as u,st as ee,t as te,v as ne,y as re}from"./createBaseUIEventDetails-DV0dQrBX.js";import{p as d}from"./provider-catalog-CO1GxLYe.js";import{t as f}from"./useBaseUiId-CHqXB2UQ.js";import{t as p}from"./utils-Eg7xtNmV.js";import{t as ie}from"./useControlled-CJJ9BOQB.js";import{a as m,i as h,n as ae,o as oe,r as se,s as g}from"./input-Bol3TP4v.js";var _=n(),v=e(t(),1);function y(e,t,n,r=!0,i){let[a,o]=v.useState(),s=f(i?`${i}-label`:void 0),c=e??t??a;return u(()=>{let i=e||t||!r?void 0:b(n.current,s);a!==i&&o(i)}),c}function b(e,t){let n=x(e);if(n)return!n.id&&t&&(n.id=t),n.id||void 0}function x(e){if(!e)return;let t=e.parentElement;if(t&&t.tagName===`LABEL`)return t;let n=e.id;if(n){let t=e.nextElementSibling;if(t&&t.htmlFor===n)return t}let r=e.labels;return r&&r[0]}var S=a(`group/alert relative grid w-full gap-0.5 rounded-lg border px-2.5 py-2 text-left text-sm has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pr-18 has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-2 *:[svg]:row-span-2 *:[svg]:translate-y-0.5 *:[svg]:text-current *:[svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-card text-card-foreground`,destructive:`bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90 *:[svg]:text-current`}},defaultVariants:{variant:`default`}});function C({className:e,variant:t,...n}){return(0,_.jsx)(`div`,{"data-slot":`alert`,role:`alert`,className:p(S({variant:t}),e),...n})}function w({className:e,...t}){return(0,_.jsx)(`div`,{"data-slot":`alert-title`,className:p(`font-medium group-has-[>svg]/alert:col-start-2 [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground`,e),...t})}function T({className:e,...t}){return(0,_.jsx)(`div`,{"data-slot":`alert-description`,className:p(`text-sm text-balance text-muted-foreground md:text-pretty [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground [&_p:not(:last-child)]:mb-4`,e),...t})}function E({className:e,...t}){return(0,_.jsx)(`label`,{"data-slot":`label`,className:p(`flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50`,e),...t})}var D=v.forwardRef(function(e,t){let{className:n,render:r,orientation:i=`horizontal`,style:a,...s}=e;return o(`div`,e,{state:{orientation:i},ref:t,props:[{role:`separator`,"aria-orientation":i},s]})});function ce({className:e,orientation:t=`horizontal`,...n}){return(0,_.jsx)(D,{"data-slot":`separator`,orientation:t,className:p(`shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch`,e),...n})}function O({className:e,...t}){return(0,_.jsx)(`div`,{"data-slot":`field-group`,className:p(`group/field-group @container/field-group flex w-full flex-col gap-5 data-[slot=checkbox-group]:gap-3 *:data-[slot=field-group]:gap-4`,e),...t})}var k=a(`group/field flex w-full gap-2 data-[invalid=true]:text-destructive`,{variants:{orientation:{vertical:`flex-col *:w-full [&>.sr-only]:w-auto`,horizontal:`flex-row items-center has-[>[data-slot=field-content]]:items-start *:data-[slot=field-label]:flex-auto has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`,responsive:`flex-col *:w-full @md/field-group:flex-row @md/field-group:items-center @md/field-group:*:w-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:*:data-[slot=field-label]:flex-auto [&>.sr-only]:w-auto @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`}},defaultVariants:{orientation:`vertical`}});function A({className:e,orientation:t=`vertical`,...n}){return(0,_.jsx)(`div`,{role:`group`,"data-slot":`field`,"data-orientation":t,className:p(k({orientation:t}),e),...n})}function j({className:e,...t}){return(0,_.jsx)(E,{"data-slot":`field-label`,className:p(`group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50 has-data-checked:border-primary/30 has-data-checked:bg-primary/5 has-[>[data-slot=field]]:rounded-lg has-[>[data-slot=field]]:border *:data-[slot=field]:p-2.5 dark:has-data-checked:border-primary/20 dark:has-data-checked:bg-primary/10`,`has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col`,e),...t})}function M({className:e,...t}){return(0,_.jsx)(`p`,{"data-slot":`field-description`,className:p(`text-left text-sm leading-normal font-normal text-muted-foreground group-has-data-horizontal/field:text-balance [[data-variant=legend]+&]:-mt-1.5`,`last:mt-0 nth-last-2:-mt-1`,`[&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary`,e),...t})}var N=v.createContext(void 0);function P(){let e=v.useContext(N);if(e===void 0)throw Error(l(63));return e}var F={...g,checked(e){return e?{"data-checked":``}:{"data-unchecked":``}}},I=v.forwardRef(function(e,t){let{checked:n,className:a,defaultChecked:l,"aria-labelledby":p,form:g,id:b,inputRef:x,name:S,nativeButton:C=!1,onCheckedChange:w,readOnly:T=!1,required:E=!1,disabled:D=!1,render:ce,uncheckedValue:O,value:k,style:A,...j}=e,{clearErrors:M}=ae(),{state:P,setTouched:I,setDirty:L,validityData:R,setFilled:z,setFocused:B,validationMode:V,disabled:H,name:U,validation:W}=oe(),{labelId:le}=h(),G=H||D,K=U??S,q=v.useRef(null),ue=c(q,x,W.inputRef),J=v.useRef(null),Y=f(),X=se({id:b,implicit:!1,controlRef:J}),Z=C?void 0:X,[Q,de]=ie({controlled:n,default:!!l,name:`Switch`,state:`checked`});m(J,Y,Q,void 0,!G,S),u(()=>{q.current&&z(q.current.checked)},[z]),d(Q,()=>{M(K),L(Q!==R.initialValue),z(Q),W.change(Q)});let{getButtonProps:fe,buttonRef:pe}=ne({disabled:G,native:C}),me=y(p,le,q,!C,Z),he={id:C?X:Y,role:`switch`,"aria-checked":Q,"aria-readonly":T||void 0,"aria-required":E||void 0,"aria-labelledby":me,onFocus(){G||B(!0)},onBlur(){let e=q.current;!e||G||(I(!0),B(!1),V===`onBlur`&&W.commit(e.checked))},onClick(e){if(T||G)return;e.preventDefault();let t=q.current;t&&re(t,e)}},ge={...W.getValidationProps(G),checked:Q,disabled:G,form:g,id:Z,name:K,required:E,style:K?r:i,tabIndex:-1,type:`checkbox`,"aria-hidden":!0,ref:ue,onChange(e){if(e.nativeEvent.defaultPrevented)return;if(T){e.preventDefault();return}let t=e.currentTarget.checked,n=te(s,e.nativeEvent);w?.(t,n),!n.isCanceled&&de(t)},onClick(e){e.stopPropagation()},onFocus(){J.current?.focus()},...k===void 0?ee:{value:k}},$=v.useMemo(()=>({...P,checked:Q,disabled:G,readOnly:T,required:E}),[P,Q,G,T,E]),_e=o(`span`,e,{state:$,ref:[t,J,pe],props:[he,j,fe,e=>W.getValidationProps(G,e)],stateAttributesMapping:F});return(0,_.jsxs)(N.Provider,{value:$,children:[_e,!Q&&K&&O!==void 0&&(0,_.jsx)(`input`,{type:`hidden`,form:g,name:K,value:O,disabled:G}),(0,_.jsx)(`input`,{...ge,suppressHydrationWarning:!0})]})}),L=v.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,s=P();return o(`span`,e,{state:s,ref:t,stateAttributesMapping:F,props:a})});function R({className:e,...t}){return(0,_.jsx)(I,{"data-slot":`switch`,className:p(`inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border border-transparent bg-input transition-colors outline-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 dark:bg-input/80 data-checked:bg-primary data-disabled:cursor-not-allowed data-disabled:opacity-50`,e),...t,children:(0,_.jsx)(L,{"data-slot":`switch-thumb`,className:`pointer-events-none block size-4 translate-x-0.5 rounded-full bg-background shadow-sm transition-transform dark:bg-foreground data-checked:translate-x-4`})})}export{j as a,T as c,O as i,w as l,A as n,ce as o,M as r,C as s,R as t};
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t}from"./bundle-mjs-DKHVkVWu.js";import{t as n}from"./jsx-runtime-NZYk81nU.js";import{g as r,h as i,n as a}from"./button-BR2WWrFo.js";import{O as o,f as s,j as c,nt as l,rt as u,st as ee,t as te,v as ne,y as re}from"./createBaseUIEventDetails-DV0dQrBX.js";import{p as d}from"./provider-catalog-D8G66gwc.js";import{t as f}from"./useBaseUiId-CHqXB2UQ.js";import{t as p}from"./utils-Eg7xtNmV.js";import{t as ie}from"./useControlled-CJJ9BOQB.js";import{a as m,i as h,n as ae,o as oe,r as se,s as g}from"./input-0wwjWjKq.js";var _=n(),v=e(t(),1);function y(e,t,n,r=!0,i){let[a,o]=v.useState(),s=f(i?`${i}-label`:void 0),c=e??t??a;return u(()=>{let i=e||t||!r?void 0:b(n.current,s);a!==i&&o(i)}),c}function b(e,t){let n=x(e);if(n)return!n.id&&t&&(n.id=t),n.id||void 0}function x(e){if(!e)return;let t=e.parentElement;if(t&&t.tagName===`LABEL`)return t;let n=e.id;if(n){let t=e.nextElementSibling;if(t&&t.htmlFor===n)return t}let r=e.labels;return r&&r[0]}var S=a(`group/alert relative grid w-full gap-0.5 rounded-lg border px-2.5 py-2 text-left text-sm has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pr-18 has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-2 *:[svg]:row-span-2 *:[svg]:translate-y-0.5 *:[svg]:text-current *:[svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-card text-card-foreground`,destructive:`bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90 *:[svg]:text-current`}},defaultVariants:{variant:`default`}});function C({className:e,variant:t,...n}){return(0,_.jsx)(`div`,{"data-slot":`alert`,role:`alert`,className:p(S({variant:t}),e),...n})}function w({className:e,...t}){return(0,_.jsx)(`div`,{"data-slot":`alert-title`,className:p(`font-medium group-has-[>svg]/alert:col-start-2 [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground`,e),...t})}function T({className:e,...t}){return(0,_.jsx)(`div`,{"data-slot":`alert-description`,className:p(`text-sm text-balance text-muted-foreground md:text-pretty [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground [&_p:not(:last-child)]:mb-4`,e),...t})}function E({className:e,...t}){return(0,_.jsx)(`label`,{"data-slot":`label`,className:p(`flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50`,e),...t})}var D=v.forwardRef(function(e,t){let{className:n,render:r,orientation:i=`horizontal`,style:a,...s}=e;return o(`div`,e,{state:{orientation:i},ref:t,props:[{role:`separator`,"aria-orientation":i},s]})});function ce({className:e,orientation:t=`horizontal`,...n}){return(0,_.jsx)(D,{"data-slot":`separator`,orientation:t,className:p(`shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch`,e),...n})}function O({className:e,...t}){return(0,_.jsx)(`div`,{"data-slot":`field-group`,className:p(`group/field-group @container/field-group flex w-full flex-col gap-5 data-[slot=checkbox-group]:gap-3 *:data-[slot=field-group]:gap-4`,e),...t})}var k=a(`group/field flex w-full gap-2 data-[invalid=true]:text-destructive`,{variants:{orientation:{vertical:`flex-col *:w-full [&>.sr-only]:w-auto`,horizontal:`flex-row items-center has-[>[data-slot=field-content]]:items-start *:data-[slot=field-label]:flex-auto has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`,responsive:`flex-col *:w-full @md/field-group:flex-row @md/field-group:items-center @md/field-group:*:w-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:*:data-[slot=field-label]:flex-auto [&>.sr-only]:w-auto @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`}},defaultVariants:{orientation:`vertical`}});function A({className:e,orientation:t=`vertical`,...n}){return(0,_.jsx)(`div`,{role:`group`,"data-slot":`field`,"data-orientation":t,className:p(k({orientation:t}),e),...n})}function j({className:e,...t}){return(0,_.jsx)(E,{"data-slot":`field-label`,className:p(`group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50 has-data-checked:border-primary/30 has-data-checked:bg-primary/5 has-[>[data-slot=field]]:rounded-lg has-[>[data-slot=field]]:border *:data-[slot=field]:p-2.5 dark:has-data-checked:border-primary/20 dark:has-data-checked:bg-primary/10`,`has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col`,e),...t})}function M({className:e,...t}){return(0,_.jsx)(`p`,{"data-slot":`field-description`,className:p(`text-left text-sm leading-normal font-normal text-muted-foreground group-has-data-horizontal/field:text-balance [[data-variant=legend]+&]:-mt-1.5`,`last:mt-0 nth-last-2:-mt-1`,`[&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary`,e),...t})}var N=v.createContext(void 0);function P(){let e=v.useContext(N);if(e===void 0)throw Error(l(63));return e}var F={...g,checked(e){return e?{"data-checked":``}:{"data-unchecked":``}}},I=v.forwardRef(function(e,t){let{checked:n,className:a,defaultChecked:l,"aria-labelledby":p,form:g,id:b,inputRef:x,name:S,nativeButton:C=!1,onCheckedChange:w,readOnly:T=!1,required:E=!1,disabled:D=!1,render:ce,uncheckedValue:O,value:k,style:A,...j}=e,{clearErrors:M}=ae(),{state:P,setTouched:I,setDirty:L,validityData:R,setFilled:z,setFocused:B,validationMode:V,disabled:H,name:U,validation:W}=oe(),{labelId:le}=h(),G=H||D,K=U??S,q=v.useRef(null),ue=c(q,x,W.inputRef),J=v.useRef(null),Y=f(),X=se({id:b,implicit:!1,controlRef:J}),Z=C?void 0:X,[Q,de]=ie({controlled:n,default:!!l,name:`Switch`,state:`checked`});m(J,Y,Q,void 0,!G,S),u(()=>{q.current&&z(q.current.checked)},[z]),d(Q,()=>{M(K),L(Q!==R.initialValue),z(Q),W.change(Q)});let{getButtonProps:fe,buttonRef:pe}=ne({disabled:G,native:C}),me=y(p,le,q,!C,Z),he={id:C?X:Y,role:`switch`,"aria-checked":Q,"aria-readonly":T||void 0,"aria-required":E||void 0,"aria-labelledby":me,onFocus(){G||B(!0)},onBlur(){let e=q.current;!e||G||(I(!0),B(!1),V===`onBlur`&&W.commit(e.checked))},onClick(e){if(T||G)return;e.preventDefault();let t=q.current;t&&re(t,e)}},ge={...W.getValidationProps(G),checked:Q,disabled:G,form:g,id:Z,name:K,required:E,style:K?r:i,tabIndex:-1,type:`checkbox`,"aria-hidden":!0,ref:ue,onChange(e){if(e.nativeEvent.defaultPrevented)return;if(T){e.preventDefault();return}let t=e.currentTarget.checked,n=te(s,e.nativeEvent);w?.(t,n),!n.isCanceled&&de(t)},onClick(e){e.stopPropagation()},onFocus(){J.current?.focus()},...k===void 0?ee:{value:k}},$=v.useMemo(()=>({...P,checked:Q,disabled:G,readOnly:T,required:E}),[P,Q,G,T,E]),_e=o(`span`,e,{state:$,ref:[t,J,pe],props:[he,j,fe,e=>W.getValidationProps(G,e)],stateAttributesMapping:F});return(0,_.jsxs)(N.Provider,{value:$,children:[_e,!Q&&K&&O!==void 0&&(0,_.jsx)(`input`,{type:`hidden`,form:g,name:K,value:O,disabled:G}),(0,_.jsx)(`input`,{...ge,suppressHydrationWarning:!0})]})}),L=v.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,s=P();return o(`span`,e,{state:s,ref:t,stateAttributesMapping:F,props:a})});function R({className:e,...t}){return(0,_.jsx)(I,{"data-slot":`switch`,className:p(`inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border border-transparent bg-input transition-colors outline-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 dark:bg-input/80 data-checked:bg-primary data-disabled:cursor-not-allowed data-disabled:opacity-50`,e),...t,children:(0,_.jsx)(L,{"data-slot":`switch-thumb`,className:`pointer-events-none block size-4 translate-x-0.5 rounded-full bg-background shadow-sm transition-transform dark:bg-foreground data-checked:translate-x-4`})})}export{j as a,T as c,O as i,w as l,A as n,ce as o,M as r,C as s,R as t};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t}from"./bundle-mjs-DKHVkVWu.js";import{t as n}from"./react-dom-Bwxum3ti.js";import{t as r}from"./jsx-runtime-NZYk81nU.js";import{$ as i,B as a,Q as o,R as s,V as c,d as l,et as u,h as d,i as f,m as p,nt as m,p as h,s as g,t as _,tt as v,z as y}from"./button-BV9NafmI.js";import{C as b,D as x,O as S,P as C,S as w,U as T,at as E,et as ee,it as te,nt as D,rt as O,v as k}from"./createBaseUIEventDetails-DV0dQrBX.js";import{t as A}from"./utils-Eg7xtNmV.js";import{t as j}from"./createLucideIcon-DwxZHm0M.js";import{n as M,t as N}from"./loader-circle-DjfHXUPB.js";import{t as ne}from"./triangle-alert-CU-gd7ui.js";import{t as P}from"./x-CsRC_tCI.js";var F=e(t(),1),I=F.createContext(void 0);function L(){let e=F.useContext(I);if(!e)throw Error(D(73));return e}var R=0;function z(e){return R+=1,`${e}-${Math.random().toString(36).slice(2,6)}-${R}`}function B(e,t){if(typeof e==`string`)return{description:e};if(typeof e==`function`){let n=e(t);return typeof n==`string`?{description:n}:n}return e}function V(e){let t=new Map,n=0,r=0;return e.forEach((e,i)=>{let a=e.transitionStatus===`ending`;t.set(e.id,{value:e,domIndex:i,visibleIndex:a?-1:n,offsetY:r}),r+=e.height||0,a||(n+=1)}),t}function H(e,t){let n=0;return e.map(e=>{if(e.transitionStatus===`ending`)return e;let r=n>=t;return n+=1,e.limited===r?e:{...e,limited:r}})}var U={toasts:e=>e.toasts,isEmpty:e=>e.toasts.length===0,toast:(e,t)=>e.toastMetadata.get(t)?.value,toastIndex:(e,t)=>e.toastMetadata.get(t)?.domIndex??-1,toastOffsetY:(e,t)=>e.toastMetadata.get(t)?.offsetY??0,toastVisibleIndex:(e,t)=>e.toastMetadata.get(t)?.visibleIndex??-1,focused:e=>e.focused,expanded:e=>e.hovering||e.focused,expandedOrOutOfFocus:e=>e.hovering||e.focused||!e.isWindowFocused,prevFocusElement:e=>e.prevFocusElement},W=class extends m{timers=new Map;areTimersPaused=!1;constructor(e){super({...e,toastMetadata:V(e.toasts)},{},U)}setViewport=e=>{this.set(`viewport`,e)};syncProviderProps(e,t){let n=this.state.limit!==t;if(this.state.timeout===e&&!n)return;let r={timeout:e,limit:t};if(n){let e=H(this.state.toasts,t);r.toasts=e,r.toastMetadata=V(e)}this.update(r)}disposeEffect=()=>()=>{this.timers.forEach(e=>{e.timeout?.clear()}),this.timers.clear()};removeToast(e,t=!1){let n=U.toastIndex(this.state,e);if(n===-1)return;let r=this.state.toasts[n];t||r?.onRemove?.();let i=[...this.state.toasts];i.splice(n,1),this.setToasts(i)}addToast=e=>{let{timeout:t,limit:n}=this.state,r=e.id||z(`toast`);if(e.id){let t=U.toast(this.state,e.id);if(t){if(t.transitionStatus===`ending`)this.removeToast(e.id,!0);else{let{id:t,transitionStatus:n,...r}=e;return this.updateToastInternal(e.id,r,!0,!0),e.id}}}let i={...e,id:r,updateKey:0,transitionStatus:`starting`},a=[i,...this.state.toasts];this.setToasts(H(a,n));let o=i.timeout??t;return i.type!==`loading`&&o>0&&this.scheduleTimer(r,o,()=>this.closeToast(r)),U.expandedOrOutOfFocus(this.state)&&this.pauseTimers(),r};updateToast=(e,t)=>{this.updateToastInternal(e,t,!1,!0)};updateToastInternal=(e,t,n=!1,r=!1)=>{let{timeout:i,toasts:a}=this.state,o=U.toast(this.state,e);if(!o||o.transitionStatus===`ending`)return;let s={...o,...t,...r&&{updateKey:o.updateKey+1}};this.setToasts(a.map(t=>t.id===e?s:t));let c=s.timeout??i,l=o.timeout??i,u=Object.hasOwn(t,`timeout`),d=s.transitionStatus!==`ending`&&s.type!==`loading`&&c>0,f=this.timers.has(e),p=l!==c,m=o.type===`loading`;if(!d&&f){this.clearTimer(e);return}d&&(!f||p||u||m||n)&&(this.clearTimer(e),this.scheduleTimer(e,c,()=>this.closeToast(e)),U.expandedOrOutOfFocus(this.state)&&this.pauseTimers())};closeToast=e=>{let t=e===void 0,{limit:n,toasts:r}=this.state,i;if(t)i=r,this.clearTimers();else{let t=U.toast(this.state,e);if(!t)return;i=[t],this.clearTimer(e)}let a=H(r.map(n=>t||n.id===e?{...n,transitionStatus:`ending`,height:0}:n),n);this.setToasts(a,!a.some(e=>e.transitionStatus!==`ending`)),i.forEach(e=>{e.transitionStatus!==`ending`&&e.onClose?.()}),this.handleFocusManagement(e)};promiseToast=(e,t)=>{let n=B(t.loading),r=this.addToast({...n,type:`loading`}),i=e.then(e=>{let n=B(t.success,e);return this.updateToast(r,{...n,type:`success`,timeout:n.timeout}),e}).catch(e=>{let n=B(t.error,e);return this.updateToast(r,{...n,type:`error`,timeout:n.timeout}),Promise.reject(e)});return{}.hasOwnProperty.call(t,`setPromise`)&&t.setPromise(i),i};pauseTimers(){this.areTimersPaused||(this.areTimersPaused=!0,this.timers.forEach(e=>{e.timeout&&(e.timeout.clear(),e.remaining=Math.max(e.remaining-(Date.now()-e.start),0))}))}resumeTimers(){this.areTimersPaused&&(this.areTimersPaused=!1,this.timers.forEach((e,t)=>{e.remaining=e.remaining>0?e.remaining:e.delay,e.timeout??=o.create(),e.timeout.start(e.remaining,()=>{this.handleTimerFired(t),e.callback()}),e.start=Date.now()}))}restoreFocusToPrevElement(){this.state.prevFocusElement?.focus({preventScroll:!0})}handleDocumentPointerDown=e=>{if(e.pointerType!==`touch`)return;let t=c(e);a(this.state.viewport,t)||(this.resumeTimers(),this.update({hovering:!1,focused:!1}))};scheduleTimer(e,t,n){let r=Date.now(),i=U.expandedOrOutOfFocus(this.state)?void 0:o.create();i?.start(t,()=>{this.handleTimerFired(e),n()}),this.timers.set(e,{timeout:i,start:r,delay:t,remaining:t,callback:n})}clearTimers(){this.timers.forEach(e=>{e.timeout?.clear()}),this.timers.clear(),this.areTimersPaused=!1}clearTimer(e){this.timers.get(e)?.timeout?.clear(),this.timers.delete(e),this.resetPausedStateIfNoTimersRemain()}handleTimerFired(e){this.timers.delete(e),this.resetPausedStateIfNoTimersRemain()}resetPausedStateIfNoTimersRemain(){this.timers.size===0&&(this.areTimersPaused=!1)}setToasts(e,t=e.length===0){let n={toasts:e,toastMetadata:V(e)};t&&(n.hovering=!1,n.focused=!1),this.update(n)}handleFocusManagement(e){let t=y(u(this.state.viewport));if(!this.state.viewport||!a(this.state.viewport,t)||!s(t))return;if(e===void 0){this.restoreFocusToPrevElement();return}let n=U.toasts(this.state),r=U.toastIndex(this.state,e),i=(e,t)=>{for(let r=e;r>=0&&r<n.length;r+=t)if(n[r].transitionStatus!==`ending`)return n[r];return null},o=i(r+1,1)??i(r-1,-1);o?o.ref?.current?.focus():this.restoreFocusToPrevElement()}},G=r(),re=function(e){let{children:t,timeout:n=5e3,limit:r=3,toastManager:i}=e,a=te(()=>new W({timeout:n,limit:r,viewport:null,toasts:[],hovering:!1,focused:!1,isWindowFocused:!0,prevFocusElement:null})).current;return E(a.disposeEffect),F.useEffect(function(){if(i)return i[` subscribe`](({action:e,options:t})=>{let n=t.id;e===`promise`&&t.promise?a.promiseToast(t.promise,t):e===`update`&&n?a.updateToast(n,t):e===`close`?a.closeToast(n):a.addToast(t)})},[a,i]),(0,G.jsxs)(I.Provider,{value:a,children:[(0,G.jsx)(ie,{store:a,timeout:n,limit:r}),t]})};function ie(e){let{store:t,timeout:n,limit:r}=e;return O(()=>{t.syncProviderProps(n,r)},[t,n,r]),null}var K=F.forwardRef(function(e,t){let{render:n,className:r,style:o,children:l,...f}=e,m=L(),h=i(),g=F.useRef(!1),_=F.useRef(!1),b=F.useRef(!1),x=m.useState(`isEmpty`),w=m.useState(`toasts`),E=m.useState(`focused`),ee=m.useState(`expanded`),te=m.useState(`prevFocusElement`),D=w[0]?.height,O=w.some(e=>e.transitionStatus===`ending`),k=w.filter(e=>e.priority===`high`);F.useEffect(()=>{let e=m.state.viewport;if(!e||x)return;let t=T(e),n=u(e);function r(t){t.key===`F6`&&c(t)!==e&&(t.preventDefault(),m.set(`prevFocusElement`,y(n)),e?.focus({preventScroll:!0}),m.pauseTimers(),m.set(`focused`,!0))}function i(e){c(e)===t&&(m.set(`isWindowFocused`,!1),m.pauseTimers())}function o(n){if(n.relatedTarget)return;let r=c(n),i=y(u(e));(r===t||!a(e,r)||!s(i))&&m.resumeTimers(),h.start(0,()=>m.set(`isWindowFocused`,!0))}return v(C(t,`keydown`,r),C(t,`blur`,i,!0),C(t,`focus`,o,!0),C(n,`pointerdown`,m.handleDocumentPointerDown,!0))},[m,h,x]);function A(e){g.current=!0;let t=e.relatedTarget===m.state.viewport?w.find(e=>e.transitionStatus!==`ending`&&!e.limited):void 0;t?t.ref?.current?.focus():m.restoreFocusToPrevElement()}function j(e){e.key===`Tab`&&e.shiftKey&&c(e.nativeEvent)===m.state.viewport&&(e.preventDefault(),m.restoreFocusToPrevElement())}function M(){m.state.toasts.some(e=>e.transitionStatus===`ending`)||b.current||!_.current||(m.state.isWindowFocused&&m.resumeTimers(),m.set(`hovering`,!1),_.current=!1)}F.useEffect(M,[O,m]);function N(){m.pauseTimers(),m.set(`hovering`,!0),_.current=!1}function ne(){m.state.isWindowFocused&&m.resumeTimers()}function P(){_.current=!0,M()}function I(e){e.pointerType===`touch`&&(b.current=!0)}function R(e){e.pointerType===`touch`&&(b.current=!1,M())}function z(){if(g.current){g.current=!1;return}E||s(y(u(m.state.viewport)))&&(m.set(`focused`,!0),m.pauseTimers())}function B(e){!E||a(m.state.viewport,e.relatedTarget)||(m.set(`focused`,!1),ne())}let V={tabIndex:-1,role:`region`,"aria-live":`polite`,"aria-atomic":!1,"aria-relevant":`additions text`,"aria-label":`Notifications`,onMouseEnter:N,onMouseMove:N,onMouseLeave:P,onFocus:z,onBlur:B,onKeyDown:j,onClick:z,onPointerDown:I,onPointerUp:R,onPointerCancel:R,style:{"--toast-frontmost-height":D?`${D}px`:void 0}},H={expanded:ee},U=!x&&te&&(0,G.jsx)(p,{onFocus:A}),W=S(`div`,e,{ref:[t,m.setViewport],state:H,props:[V,f,{children:(0,G.jsxs)(F.Fragment,{children:[U,l,U]})}]});return(0,G.jsxs)(F.Fragment,{children:[U,W,!E&&k.length>0&&(0,G.jsx)(`div`,{style:d,children:k.map(e=>(0,G.jsxs)(`div`,{role:`alert`,"aria-atomic":!0,children:[(0,G.jsx)(`div`,{children:e.title}),(0,G.jsx)(`div`,{children:e.description})]},e.id))})]})}),ae=e(n(),1),oe=F.createContext(void 0);function q(){let e=F.useContext(oe);if(!e)throw Error(D(66));return e}function se(e,t,n){switch(e){case`up`:return-n;case`down`:return n;case`left`:return-t;case`right`:return t;default:return 0}}function ce(e){let t=T(e).getComputedStyle(e).transform,n=0,r=0,i=1;if(t&&t!==`none`){let e=t.match(/matrix(?:3d)?\(([^)]+)\)/);if(e){let t=e[1].split(`, `).map(parseFloat);t.length===6?(n=t[4],r=t[5],i=Math.sqrt(t[0]*t[0]+t[1]*t[1])):t.length===16&&(n=t[12],r=t[13],i=t[0])}}return{x:n,y:r,scale:i}}var le={...x,swipeDirection(e){return e?{"data-swipe-direction":e}:null}},ue=40,de=10,fe=.5,pe=1,me=`${g},${l}`,he=F.forwardRef(function(e,t){let{toast:n,render:r,className:i,swipeDirection:o=[`down`,`right`],style:s,...l}=e,d=n.positionerProps?.anchor!==void 0,f=[];d||(f=Array.isArray(o)?o:[o]);let p=f.length>0,m=L(),[g,_]=F.useState(void 0),[v,x]=F.useState(!1),[w,T]=F.useState(!1),[E,te]=F.useState({x:0,y:0}),[D,k]=F.useState({x:0,y:0,scale:1}),[A,j]=F.useState(),[M,N]=F.useState(),[ne,P]=F.useState(null),I=F.useRef(null),R=F.useRef(void 0),z=F.useRef({x:0,y:0}),B=F.useRef({x:0,y:0,scale:1}),V=F.useRef(void 0),H=F.useRef(0),U=F.useRef(!1),W=F.useRef({x:0,y:0}),re=F.useRef(!1),ie=F.useRef({x:0,y:0}),K=F.useRef(null),q=F.useRef(null),he=m.useState(`toastIndex`,n.id),J=m.useState(`toastVisibleIndex`,n.id),ge=m.useState(`toastOffsetY`,n.id),_e=m.useState(`focused`),Y=m.useState(`expanded`);b({open:n.transitionStatus!==`ending`,ref:I,onComplete(){n.transitionStatus===`ending`&&m.removeToast(n.id)}});let X=ee((e=!1)=>{let t=I.current;if(!t)return;let r=t.style.height;t.style.height=`auto`;let i=t.offsetHeight;t.style.height=r;function a(){m.updateToastInternal(n.id,{ref:I,height:i,transitionStatus:void 0})}e?ae.flushSync(a):a()});O(()=>{let e=R.current;(n.transitionStatus===`starting`||e!==n.id)&&(e!==void 0&&(_(void 0),k({x:0,y:0,scale:1}),Z({x:0,y:0})),R.current=n.id,X())},[X,n.id,n.transitionStatus]);function Z(e){ie.current=e,te(e)}O(()=>()=>{q.current?.abort()},[]);function ve(e,t){let n=e=>e>0?e**fe:-(Math.abs(e)**fe),r=e>0&&!f.includes(`right`)||e<0&&!f.includes(`left`),i=t>0&&!f.includes(`down`)||t<0&&!f.includes(`up`);return{x:r?n(e):e,y:i?n(t):t}}let Q=ee(e=>{if(e.pointerId!==K.current)return;K.current=null,q.current?.abort(),q.current=null,x(!1),T(!1),P(null);let t=B.current;if(e.type===`pointercancel`||U.current){Z({x:t.x,y:t.y}),_(void 0);return}let r=ie.current,i=r.x-t.x,a=r.y-t.y,o;for(let e of f)if(se(e,i,a)>ue){o=e;break}o?(_(o),m.closeToast(n.id)):(Z({x:t.x,y:t.y}),_(void 0))});function ye(e){if(e.button!==0||(e.pointerType===`touch`&&m.pauseTimers(),c(e.nativeEvent)?.closest(`button,a,input,textarea,[role="button"],${me}`)))return;U.current=!1,V.current=void 0,H.current=0,K.current=e.pointerId,z.current={x:e.clientX,y:e.clientY},W.current=z.current;let t=e.currentTarget,n=ce(t);B.current=n,k(n),Z({x:n.x,y:n.y}),m.set(`hovering`,!0),x(!0),T(!1),P(null),re.current=!0,q.current?.abort();let r=new AbortController;q.current=r;let i=u(t);i.addEventListener(`pointerup`,Q,{signal:r.signal}),i.addEventListener(`pointercancel`,Q,{signal:r.signal}),t.setPointerCapture?.(e.pointerId)}function $(e){if(e.pointerId!==K.current)return;e.preventDefault(),re.current&&=(z.current={x:e.clientX,y:e.clientY},!1);let{clientY:t,clientX:n,movementX:r,movementY:i}=e;(i<0&&t>W.current.y||i>0&&t<W.current.y)&&(W.current={x:W.current.x,y:t}),(r<0&&n>W.current.x||r>0&&n<W.current.x)&&(W.current={x:n,y:W.current.y});let a=n-z.current.x,o=t-z.current.y,s=t-W.current.y,c=n-W.current.x,l=ne;if(!w&&Math.sqrt(a*a+o*o)>=pe){T(!0);let e=f.includes(`left`)||f.includes(`right`),t=f.includes(`up`)||f.includes(`down`);e&&t&&(l=Math.abs(a)>Math.abs(o)?`horizontal`:`vertical`,P(l))}let u;if(!V.current)l===`vertical`?o>0?u=`down`:o<0&&(u=`up`):l===`horizontal`?a>0?u=`right`:a<0&&(u=`left`):u=Math.abs(a)>=Math.abs(o)?a>0?`right`:`left`:o>0?`down`:`up`,u&&f.includes(u)&&(V.current=u,H.current=se(u,a,o),_(u));else{let e=V.current,t=se(e,c,s);t>ue?(U.current=!1,_(e)):!(f.includes(`left`)&&f.includes(`right`))&&!(f.includes(`up`)&&f.includes(`down`))&&H.current-t>=de&&(U.current=!0)}let d=ve(a,o),p=B.current.x,m=B.current.y,h=f.includes(`left`)||f.includes(`right`),g=f.includes(`up`)||f.includes(`down`);l!==`vertical`&&h&&(p+=d.x),l!==`horizontal`&&g&&(m+=d.y),Z({x:p,y:m})}function be(e){if(e.key===`Escape`){if(!I.current||!a(I.current,y(u(I.current))))return;m.closeToast(n.id)}}F.useEffect(()=>{let e=I.current;if(!p||!e)return;function t(t){K.current===null||!a(e,c(t))||t.preventDefault()}return C(e,`touchmove`,t,{passive:!1})},[p]);function xe(){let e=E.x-D.x,t=E.y-D.y;return{transition:v?`none`:void 0,transform:v?`translateX(${E.x}px) translateY(${E.y}px) scale(${D.scale})`:void 0,"--toast-swipe-movement-x":`${e}px`,"--toast-swipe-movement-y":`${t}px`}}let Se=n.priority===`high`,Ce={role:Se?`alertdialog`:`dialog`,tabIndex:0,"aria-modal":!1,"aria-labelledby":A,"aria-describedby":M,"aria-hidden":Se&&!_e?!0:void 0,onPointerDown:p?ye:void 0,onPointerMove:p?$:void 0,onPointerUp:p?Q:void 0,onPointerCancel:p?Q:void 0,onKeyDown:be,inert:h(n.limited),style:{...xe(),"--toast-index":n.transitionStatus===`ending`?he:J,"--toast-offset-y":`${ge}px`,"--toast-height":n.height?`${n.height}px`:void 0}},we=F.useMemo(()=>({toast:n,setTitleId:j,setDescriptionId:N,recalculateHeight:X,visibleIndex:J,expanded:Y}),[n,j,N,X,J,Y]),Te={transitionStatus:n.transitionStatus,expanded:Y,limited:n.limited||!1,type:n.type,swiping:v,swipeDirection:g},Ee=S(`div`,e,{ref:[t,I],state:Te,stateAttributesMapping:le,props:[Ce,l]});return(0,G.jsx)(oe.Provider,{value:we,children:Ee})}),J=F.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{visibleIndex:o,expanded:s,recalculateHeight:c}=q(),l=F.useRef(null);return O(()=>{c();let e=l.current;if(!e||typeof ResizeObserver!=`function`||typeof MutationObserver!=`function`)return;let t=new ResizeObserver(()=>c(!0)),n=new MutationObserver(()=>c(!0));return t.observe(e),n.observe(e,{childList:!0,subtree:!0,characterData:!0}),()=>{t.disconnect(),n.disconnect()}},[c]),S(`div`,e,{ref:[t,l],state:{expanded:s,behind:o>0},props:a})});function ge(e){return e==null||typeof e==`boolean`||e===``?!1:!Array.isArray(e)||e.some(ge)}function _e(e){return F.isValidElement(e)&&ge(e.props.children)}function Y(e,t,n){let{toast:r,setTitleId:i,setDescriptionId:a}=q(),o=n===`title`?i:a,s=t??(n===`title`?r.title:r.description);return{id:w(e),children:s,type:r.type,setId:o}}function X(e,t,n){let r=_e(e);return O(()=>{if(r)return n(t),()=>{n(e=>e===t?void 0:e)}},[r,t,n]),r?e:null}var Z=F.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,children:o,...s}=e,{id:c,children:l,type:u,setId:d}=Y(a,o,`description`);return X(S(`p`,e,{ref:t,state:{type:u},props:{...s,id:c,children:l}}),c,d)}),ve=F.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,children:o,...s}=e,{id:c,children:l,type:u,setId:d}=Y(a,o,`title`);return X(S(`h2`,e,{ref:t,state:{type:u},props:{...s,id:c,children:l}}),c,d)}),Q=F.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a,nativeButton:o=!0,...s}=e,c=L(),{toast:l,expanded:u}=q(),[d,f]=F.useState(!1),{getButtonProps:p,buttonRef:m}=k({disabled:a,native:o}),h={type:l.type};return S(`button`,e,{ref:[t,m],state:h,props:[{"aria-hidden":!u&&!d,onClick(){c.closeToast(l.id)},onFocus(){f(!0)},onBlur(){f(!1)}},s,p]})}),ye=F.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a,nativeButton:o=!0,...s}=e,{toast:c}=q(),l=c.actionProps?.children??s.children,{getButtonProps:u,buttonRef:d}=k({disabled:a,native:o}),f={type:c.type},p=S(`button`,e,{ref:[t,d],state:f,props:[s,c.actionProps,u,{children:l}]});return _e(p)?p:null}),$=F.forwardRef(function(e,t){let{children:n,container:r,className:i,render:a,style:o,...s}=e,{node:c,subtree:l}=f({container:r,ref:t,componentProps:e,elementProps:s});return!l&&!c?null:(0,G.jsxs)(F.Fragment,{children:[l,c&&ae.createPortal(n,c)]})}),be=F.forwardRef(function(e,t){return(0,G.jsx)($,{ref:t,...e})});function xe(){let e=L(),t=e.useState(`toasts`);return F.useMemo(()=>({toasts:t,add:e.addToast,close:e.closeToast,update:e.updateToast,promise:e.promiseToast}),[t,e])}function Se(){let e=new Set;function t(t){e.forEach(e=>e(t))}return{" subscribe":function(t){return e.add(t),()=>{e.delete(t)}},add(e){let n=e.id||z(`toast`);return t({action:`add`,options:{...e,id:n,transitionStatus:`starting`}}),n},close(e){t({action:`close`,options:{id:e}})},update(e,n){t({action:`update`,options:{...n,id:e}})},promise(e,n){let r=e;return t({action:`promise`,options:{...n,promise:e,setPromise(e){r=e}}}),r}}}var Ce=j(`info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),we=j(`octagon-x`,[[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z`,key:`2d38gg`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),Te=Se();function Ee({...e}){return(0,G.jsx)(re,{...e})}function De({...e}){return(0,G.jsx)(be,{"data-slot":`toast-portal`,...e})}function Oe({className:e,...t}){return(0,G.jsx)(K,{"data-slot":`toast-viewport`,className:A(`pointer-events-none fixed inset-x-4 bottom-4 z-50 mx-auto w-auto max-w-sm outline-none sm:right-4 sm:left-auto sm:mx-0 sm:w-full`,e),...t})}function ke({className:e,...t}){return(0,G.jsx)(he,{"data-slot":`toast`,className:A(`group/toast pointer-events-auto absolute right-0 bottom-0 z-[calc(1000-var(--toast-index))] w-full origin-bottom rounded-2xl text-popover-foreground will-change-transform outline-none select-none focus-visible:ring-[3px] focus-visible:ring-ring/50`,`bg-surface-3 shadow-surface-3`,`[--gap:0.75rem] [--height:var(--toast-frontmost-height,var(--toast-height))] [--offset-y:calc(var(--toast-offset-y)*-1+calc(var(--toast-index)*var(--gap)*-1)+var(--toast-swipe-movement-y))] [--peek:0.75rem] [--scale:calc(max(0,1-(var(--toast-index)*0.1)))] [--shrink:calc(1-var(--scale))]`,`h-(--height) [transform:translateX(var(--toast-swipe-movement-x))_translateY(calc(var(--toast-swipe-movement-y)-(var(--toast-index)*var(--peek))-(var(--shrink)*var(--height))))_scale(var(--scale))] [transition:transform_500ms_cubic-bezier(0.22,1,0.36,1),opacity_500ms,height_150ms]`,`after:absolute after:top-full after:left-0 after:h-[calc(var(--gap)+1px)] after:w-full after:content-['']`,`data-expanded:h-(--toast-height) data-expanded:[transform:translateX(var(--toast-swipe-movement-x))_translateY(var(--offset-y))]`,`data-limited:opacity-0 data-starting-style:[transform:translateY(150%)]`,`[&[data-ending-style]:not([data-limited]):not([data-swipe-direction])]:[transform:translateY(150%)]`,`data-ending-style:data-[swipe-direction=down]:[transform:translateY(calc(var(--toast-swipe-movement-y)+150%))]`,`data-ending-style:data-[swipe-direction=left]:[transform:translateX(calc(var(--toast-swipe-movement-x)-150%))_translateY(var(--offset-y))]`,`data-ending-style:data-[swipe-direction=right]:[transform:translateX(calc(var(--toast-swipe-movement-x)+150%))_translateY(var(--offset-y))]`,`data-ending-style:data-[swipe-direction=up]:[transform:translateY(calc(var(--toast-swipe-movement-y)-150%))]`,`data-expanded:data-ending-style:data-[swipe-direction=down]:[transform:translateY(calc(var(--toast-swipe-movement-y)+150%))]`,`data-expanded:data-ending-style:data-[swipe-direction=left]:[transform:translateX(calc(var(--toast-swipe-movement-x)-150%))_translateY(var(--offset-y))]`,`data-expanded:data-ending-style:data-[swipe-direction=right]:[transform:translateX(calc(var(--toast-swipe-movement-x)+150%))_translateY(var(--offset-y))]`,`data-expanded:data-ending-style:data-[swipe-direction=up]:[transform:translateY(calc(var(--toast-swipe-movement-y)-150%))]`,e),...t})}function Ae({className:e,...t}){return(0,G.jsx)(J,{"data-slot":`toast-content`,className:A(`flex h-full items-center gap-3 overflow-hidden p-4 transition-opacity duration-250 ease-[cubic-bezier(0.22,1,0.36,1)] data-behind:opacity-0 data-expanded:opacity-100`,e),...t})}function je({className:e,...t}){return(0,G.jsx)(ve,{"data-slot":`toast-title`,className:A(`text-sm font-medium`,e),...t})}function Me({className:e,...t}){return(0,G.jsx)(Z,{"data-slot":`toast-description`,className:A(`text-sm text-muted-foreground`,e),...t})}function Ne({className:e,render:t=(0,G.jsx)(_,{variant:`outline`,size:`sm`}),...n}){return(0,G.jsx)(ye,{"data-slot":`toast-action`,render:t,className:A(`shrink-0`,e),...n})}function Pe({className:e,children:t,render:n=(0,G.jsx)(_,{variant:`ghost`,size:`icon-sm`}),...r}){return(0,G.jsx)(Q,{"data-slot":`toast-close`,"aria-label":`Close toast`,render:n,className:A(`relative shrink-0 text-muted-foreground after:absolute after:-inset-2 after:content-[''] hover:text-foreground`,e),...r,children:t??(0,G.jsx)(P,{"aria-hidden":`true`})})}function Fe({type:e}){let t=null;return e===`success`&&(t=(0,G.jsx)(M,{"aria-hidden":`true`})),e===`info`&&(t=(0,G.jsx)(Ce,{"aria-hidden":`true`})),e===`warning`&&(t=(0,G.jsx)(ne,{"aria-hidden":`true`})),e===`error`&&(t=(0,G.jsx)(we,{className:`text-destructive`,"aria-hidden":`true`})),e===`loading`&&(t=(0,G.jsx)(N,{className:`animate-spin`,"aria-hidden":`true`})),t?(0,G.jsx)(`span`,{"data-slot":`toast-icon`,className:`shrink-0 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4`,children:t}):null}function Ie(){let{toasts:e}=xe();return e.map(e=>(0,G.jsx)(ke,{toast:e,children:(0,G.jsxs)(Ae,{children:[(0,G.jsx)(Fe,{type:e.type}),(0,G.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,G.jsx)(je,{}),(0,G.jsx)(Me,{})]}),(0,G.jsx)(Ne,{}),(0,G.jsx)(Pe,{})]})},e.id))}function Le({children:e,toastManager:t=Te,...n}){return(0,G.jsxs)(Ee,{toastManager:t,...n,children:[e,(0,G.jsx)(De,{children:(0,G.jsx)(Oe,{children:(0,G.jsx)(Ie,{})})})]})}export{$ as i,Te as n,Ce as r,Le as t};
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t}from"./bundle-mjs-DKHVkVWu.js";import{t as n}from"./react-dom-Bwxum3ti.js";import{t as r}from"./jsx-runtime-NZYk81nU.js";import{$ as i,B as a,Q as o,R as s,V as c,d as l,et as u,h as d,i as f,m as p,nt as m,p as h,s as g,t as _,tt as v,z as y}from"./button-BR2WWrFo.js";import{C as b,D as x,O as S,P as C,S as w,U as T,at as E,et as ee,it as te,nt as D,rt as O,v as k}from"./createBaseUIEventDetails-DV0dQrBX.js";import{t as A}from"./utils-Eg7xtNmV.js";import{t as j}from"./createLucideIcon-DwxZHm0M.js";import{n as M,t as N}from"./loader-circle-DjfHXUPB.js";import{t as ne}from"./triangle-alert-CU-gd7ui.js";import{t as P}from"./x-CsRC_tCI.js";var F=e(t(),1),I=F.createContext(void 0);function L(){let e=F.useContext(I);if(!e)throw Error(D(73));return e}var R=0;function z(e){return R+=1,`${e}-${Math.random().toString(36).slice(2,6)}-${R}`}function B(e,t){if(typeof e==`string`)return{description:e};if(typeof e==`function`){let n=e(t);return typeof n==`string`?{description:n}:n}return e}function V(e){let t=new Map,n=0,r=0;return e.forEach((e,i)=>{let a=e.transitionStatus===`ending`;t.set(e.id,{value:e,domIndex:i,visibleIndex:a?-1:n,offsetY:r}),r+=e.height||0,a||(n+=1)}),t}function H(e,t){let n=0;return e.map(e=>{if(e.transitionStatus===`ending`)return e;let r=n>=t;return n+=1,e.limited===r?e:{...e,limited:r}})}var U={toasts:e=>e.toasts,isEmpty:e=>e.toasts.length===0,toast:(e,t)=>e.toastMetadata.get(t)?.value,toastIndex:(e,t)=>e.toastMetadata.get(t)?.domIndex??-1,toastOffsetY:(e,t)=>e.toastMetadata.get(t)?.offsetY??0,toastVisibleIndex:(e,t)=>e.toastMetadata.get(t)?.visibleIndex??-1,focused:e=>e.focused,expanded:e=>e.hovering||e.focused,expandedOrOutOfFocus:e=>e.hovering||e.focused||!e.isWindowFocused,prevFocusElement:e=>e.prevFocusElement},W=class extends m{timers=new Map;areTimersPaused=!1;constructor(e){super({...e,toastMetadata:V(e.toasts)},{},U)}setViewport=e=>{this.set(`viewport`,e)};syncProviderProps(e,t){let n=this.state.limit!==t;if(this.state.timeout===e&&!n)return;let r={timeout:e,limit:t};if(n){let e=H(this.state.toasts,t);r.toasts=e,r.toastMetadata=V(e)}this.update(r)}disposeEffect=()=>()=>{this.timers.forEach(e=>{e.timeout?.clear()}),this.timers.clear()};removeToast(e,t=!1){let n=U.toastIndex(this.state,e);if(n===-1)return;let r=this.state.toasts[n];t||r?.onRemove?.();let i=[...this.state.toasts];i.splice(n,1),this.setToasts(i)}addToast=e=>{let{timeout:t,limit:n}=this.state,r=e.id||z(`toast`);if(e.id){let t=U.toast(this.state,e.id);if(t){if(t.transitionStatus===`ending`)this.removeToast(e.id,!0);else{let{id:t,transitionStatus:n,...r}=e;return this.updateToastInternal(e.id,r,!0,!0),e.id}}}let i={...e,id:r,updateKey:0,transitionStatus:`starting`},a=[i,...this.state.toasts];this.setToasts(H(a,n));let o=i.timeout??t;return i.type!==`loading`&&o>0&&this.scheduleTimer(r,o,()=>this.closeToast(r)),U.expandedOrOutOfFocus(this.state)&&this.pauseTimers(),r};updateToast=(e,t)=>{this.updateToastInternal(e,t,!1,!0)};updateToastInternal=(e,t,n=!1,r=!1)=>{let{timeout:i,toasts:a}=this.state,o=U.toast(this.state,e);if(!o||o.transitionStatus===`ending`)return;let s={...o,...t,...r&&{updateKey:o.updateKey+1}};this.setToasts(a.map(t=>t.id===e?s:t));let c=s.timeout??i,l=o.timeout??i,u=Object.hasOwn(t,`timeout`),d=s.transitionStatus!==`ending`&&s.type!==`loading`&&c>0,f=this.timers.has(e),p=l!==c,m=o.type===`loading`;if(!d&&f){this.clearTimer(e);return}d&&(!f||p||u||m||n)&&(this.clearTimer(e),this.scheduleTimer(e,c,()=>this.closeToast(e)),U.expandedOrOutOfFocus(this.state)&&this.pauseTimers())};closeToast=e=>{let t=e===void 0,{limit:n,toasts:r}=this.state,i;if(t)i=r,this.clearTimers();else{let t=U.toast(this.state,e);if(!t)return;i=[t],this.clearTimer(e)}let a=H(r.map(n=>t||n.id===e?{...n,transitionStatus:`ending`,height:0}:n),n);this.setToasts(a,!a.some(e=>e.transitionStatus!==`ending`)),i.forEach(e=>{e.transitionStatus!==`ending`&&e.onClose?.()}),this.handleFocusManagement(e)};promiseToast=(e,t)=>{let n=B(t.loading),r=this.addToast({...n,type:`loading`}),i=e.then(e=>{let n=B(t.success,e);return this.updateToast(r,{...n,type:`success`,timeout:n.timeout}),e}).catch(e=>{let n=B(t.error,e);return this.updateToast(r,{...n,type:`error`,timeout:n.timeout}),Promise.reject(e)});return{}.hasOwnProperty.call(t,`setPromise`)&&t.setPromise(i),i};pauseTimers(){this.areTimersPaused||(this.areTimersPaused=!0,this.timers.forEach(e=>{e.timeout&&(e.timeout.clear(),e.remaining=Math.max(e.remaining-(Date.now()-e.start),0))}))}resumeTimers(){this.areTimersPaused&&(this.areTimersPaused=!1,this.timers.forEach((e,t)=>{e.remaining=e.remaining>0?e.remaining:e.delay,e.timeout??=o.create(),e.timeout.start(e.remaining,()=>{this.handleTimerFired(t),e.callback()}),e.start=Date.now()}))}restoreFocusToPrevElement(){this.state.prevFocusElement?.focus({preventScroll:!0})}handleDocumentPointerDown=e=>{if(e.pointerType!==`touch`)return;let t=c(e);a(this.state.viewport,t)||(this.resumeTimers(),this.update({hovering:!1,focused:!1}))};scheduleTimer(e,t,n){let r=Date.now(),i=U.expandedOrOutOfFocus(this.state)?void 0:o.create();i?.start(t,()=>{this.handleTimerFired(e),n()}),this.timers.set(e,{timeout:i,start:r,delay:t,remaining:t,callback:n})}clearTimers(){this.timers.forEach(e=>{e.timeout?.clear()}),this.timers.clear(),this.areTimersPaused=!1}clearTimer(e){this.timers.get(e)?.timeout?.clear(),this.timers.delete(e),this.resetPausedStateIfNoTimersRemain()}handleTimerFired(e){this.timers.delete(e),this.resetPausedStateIfNoTimersRemain()}resetPausedStateIfNoTimersRemain(){this.timers.size===0&&(this.areTimersPaused=!1)}setToasts(e,t=e.length===0){let n={toasts:e,toastMetadata:V(e)};t&&(n.hovering=!1,n.focused=!1),this.update(n)}handleFocusManagement(e){let t=y(u(this.state.viewport));if(!this.state.viewport||!a(this.state.viewport,t)||!s(t))return;if(e===void 0){this.restoreFocusToPrevElement();return}let n=U.toasts(this.state),r=U.toastIndex(this.state,e),i=(e,t)=>{for(let r=e;r>=0&&r<n.length;r+=t)if(n[r].transitionStatus!==`ending`)return n[r];return null},o=i(r+1,1)??i(r-1,-1);o?o.ref?.current?.focus():this.restoreFocusToPrevElement()}},G=r(),re=function(e){let{children:t,timeout:n=5e3,limit:r=3,toastManager:i}=e,a=te(()=>new W({timeout:n,limit:r,viewport:null,toasts:[],hovering:!1,focused:!1,isWindowFocused:!0,prevFocusElement:null})).current;return E(a.disposeEffect),F.useEffect(function(){if(i)return i[` subscribe`](({action:e,options:t})=>{let n=t.id;e===`promise`&&t.promise?a.promiseToast(t.promise,t):e===`update`&&n?a.updateToast(n,t):e===`close`?a.closeToast(n):a.addToast(t)})},[a,i]),(0,G.jsxs)(I.Provider,{value:a,children:[(0,G.jsx)(ie,{store:a,timeout:n,limit:r}),t]})};function ie(e){let{store:t,timeout:n,limit:r}=e;return O(()=>{t.syncProviderProps(n,r)},[t,n,r]),null}var K=F.forwardRef(function(e,t){let{render:n,className:r,style:o,children:l,...f}=e,m=L(),h=i(),g=F.useRef(!1),_=F.useRef(!1),b=F.useRef(!1),x=m.useState(`isEmpty`),w=m.useState(`toasts`),E=m.useState(`focused`),ee=m.useState(`expanded`),te=m.useState(`prevFocusElement`),D=w[0]?.height,O=w.some(e=>e.transitionStatus===`ending`),k=w.filter(e=>e.priority===`high`);F.useEffect(()=>{let e=m.state.viewport;if(!e||x)return;let t=T(e),n=u(e);function r(t){t.key===`F6`&&c(t)!==e&&(t.preventDefault(),m.set(`prevFocusElement`,y(n)),e?.focus({preventScroll:!0}),m.pauseTimers(),m.set(`focused`,!0))}function i(e){c(e)===t&&(m.set(`isWindowFocused`,!1),m.pauseTimers())}function o(n){if(n.relatedTarget)return;let r=c(n),i=y(u(e));(r===t||!a(e,r)||!s(i))&&m.resumeTimers(),h.start(0,()=>m.set(`isWindowFocused`,!0))}return v(C(t,`keydown`,r),C(t,`blur`,i,!0),C(t,`focus`,o,!0),C(n,`pointerdown`,m.handleDocumentPointerDown,!0))},[m,h,x]);function A(e){g.current=!0;let t=e.relatedTarget===m.state.viewport?w.find(e=>e.transitionStatus!==`ending`&&!e.limited):void 0;t?t.ref?.current?.focus():m.restoreFocusToPrevElement()}function j(e){e.key===`Tab`&&e.shiftKey&&c(e.nativeEvent)===m.state.viewport&&(e.preventDefault(),m.restoreFocusToPrevElement())}function M(){m.state.toasts.some(e=>e.transitionStatus===`ending`)||b.current||!_.current||(m.state.isWindowFocused&&m.resumeTimers(),m.set(`hovering`,!1),_.current=!1)}F.useEffect(M,[O,m]);function N(){m.pauseTimers(),m.set(`hovering`,!0),_.current=!1}function ne(){m.state.isWindowFocused&&m.resumeTimers()}function P(){_.current=!0,M()}function I(e){e.pointerType===`touch`&&(b.current=!0)}function R(e){e.pointerType===`touch`&&(b.current=!1,M())}function z(){if(g.current){g.current=!1;return}E||s(y(u(m.state.viewport)))&&(m.set(`focused`,!0),m.pauseTimers())}function B(e){!E||a(m.state.viewport,e.relatedTarget)||(m.set(`focused`,!1),ne())}let V={tabIndex:-1,role:`region`,"aria-live":`polite`,"aria-atomic":!1,"aria-relevant":`additions text`,"aria-label":`Notifications`,onMouseEnter:N,onMouseMove:N,onMouseLeave:P,onFocus:z,onBlur:B,onKeyDown:j,onClick:z,onPointerDown:I,onPointerUp:R,onPointerCancel:R,style:{"--toast-frontmost-height":D?`${D}px`:void 0}},H={expanded:ee},U=!x&&te&&(0,G.jsx)(p,{onFocus:A}),W=S(`div`,e,{ref:[t,m.setViewport],state:H,props:[V,f,{children:(0,G.jsxs)(F.Fragment,{children:[U,l,U]})}]});return(0,G.jsxs)(F.Fragment,{children:[U,W,!E&&k.length>0&&(0,G.jsx)(`div`,{style:d,children:k.map(e=>(0,G.jsxs)(`div`,{role:`alert`,"aria-atomic":!0,children:[(0,G.jsx)(`div`,{children:e.title}),(0,G.jsx)(`div`,{children:e.description})]},e.id))})]})}),ae=e(n(),1),oe=F.createContext(void 0);function q(){let e=F.useContext(oe);if(!e)throw Error(D(66));return e}function se(e,t,n){switch(e){case`up`:return-n;case`down`:return n;case`left`:return-t;case`right`:return t;default:return 0}}function ce(e){let t=T(e).getComputedStyle(e).transform,n=0,r=0,i=1;if(t&&t!==`none`){let e=t.match(/matrix(?:3d)?\(([^)]+)\)/);if(e){let t=e[1].split(`, `).map(parseFloat);t.length===6?(n=t[4],r=t[5],i=Math.sqrt(t[0]*t[0]+t[1]*t[1])):t.length===16&&(n=t[12],r=t[13],i=t[0])}}return{x:n,y:r,scale:i}}var le={...x,swipeDirection(e){return e?{"data-swipe-direction":e}:null}},ue=40,de=10,fe=.5,pe=1,me=`${g},${l}`,he=F.forwardRef(function(e,t){let{toast:n,render:r,className:i,swipeDirection:o=[`down`,`right`],style:s,...l}=e,d=n.positionerProps?.anchor!==void 0,f=[];d||(f=Array.isArray(o)?o:[o]);let p=f.length>0,m=L(),[g,_]=F.useState(void 0),[v,x]=F.useState(!1),[w,T]=F.useState(!1),[E,te]=F.useState({x:0,y:0}),[D,k]=F.useState({x:0,y:0,scale:1}),[A,j]=F.useState(),[M,N]=F.useState(),[ne,P]=F.useState(null),I=F.useRef(null),R=F.useRef(void 0),z=F.useRef({x:0,y:0}),B=F.useRef({x:0,y:0,scale:1}),V=F.useRef(void 0),H=F.useRef(0),U=F.useRef(!1),W=F.useRef({x:0,y:0}),re=F.useRef(!1),ie=F.useRef({x:0,y:0}),K=F.useRef(null),q=F.useRef(null),he=m.useState(`toastIndex`,n.id),J=m.useState(`toastVisibleIndex`,n.id),ge=m.useState(`toastOffsetY`,n.id),_e=m.useState(`focused`),Y=m.useState(`expanded`);b({open:n.transitionStatus!==`ending`,ref:I,onComplete(){n.transitionStatus===`ending`&&m.removeToast(n.id)}});let X=ee((e=!1)=>{let t=I.current;if(!t)return;let r=t.style.height;t.style.height=`auto`;let i=t.offsetHeight;t.style.height=r;function a(){m.updateToastInternal(n.id,{ref:I,height:i,transitionStatus:void 0})}e?ae.flushSync(a):a()});O(()=>{let e=R.current;(n.transitionStatus===`starting`||e!==n.id)&&(e!==void 0&&(_(void 0),k({x:0,y:0,scale:1}),Z({x:0,y:0})),R.current=n.id,X())},[X,n.id,n.transitionStatus]);function Z(e){ie.current=e,te(e)}O(()=>()=>{q.current?.abort()},[]);function ve(e,t){let n=e=>e>0?e**fe:-(Math.abs(e)**fe),r=e>0&&!f.includes(`right`)||e<0&&!f.includes(`left`),i=t>0&&!f.includes(`down`)||t<0&&!f.includes(`up`);return{x:r?n(e):e,y:i?n(t):t}}let Q=ee(e=>{if(e.pointerId!==K.current)return;K.current=null,q.current?.abort(),q.current=null,x(!1),T(!1),P(null);let t=B.current;if(e.type===`pointercancel`||U.current){Z({x:t.x,y:t.y}),_(void 0);return}let r=ie.current,i=r.x-t.x,a=r.y-t.y,o;for(let e of f)if(se(e,i,a)>ue){o=e;break}o?(_(o),m.closeToast(n.id)):(Z({x:t.x,y:t.y}),_(void 0))});function ye(e){if(e.button!==0||(e.pointerType===`touch`&&m.pauseTimers(),c(e.nativeEvent)?.closest(`button,a,input,textarea,[role="button"],${me}`)))return;U.current=!1,V.current=void 0,H.current=0,K.current=e.pointerId,z.current={x:e.clientX,y:e.clientY},W.current=z.current;let t=e.currentTarget,n=ce(t);B.current=n,k(n),Z({x:n.x,y:n.y}),m.set(`hovering`,!0),x(!0),T(!1),P(null),re.current=!0,q.current?.abort();let r=new AbortController;q.current=r;let i=u(t);i.addEventListener(`pointerup`,Q,{signal:r.signal}),i.addEventListener(`pointercancel`,Q,{signal:r.signal}),t.setPointerCapture?.(e.pointerId)}function $(e){if(e.pointerId!==K.current)return;e.preventDefault(),re.current&&=(z.current={x:e.clientX,y:e.clientY},!1);let{clientY:t,clientX:n,movementX:r,movementY:i}=e;(i<0&&t>W.current.y||i>0&&t<W.current.y)&&(W.current={x:W.current.x,y:t}),(r<0&&n>W.current.x||r>0&&n<W.current.x)&&(W.current={x:n,y:W.current.y});let a=n-z.current.x,o=t-z.current.y,s=t-W.current.y,c=n-W.current.x,l=ne;if(!w&&Math.sqrt(a*a+o*o)>=pe){T(!0);let e=f.includes(`left`)||f.includes(`right`),t=f.includes(`up`)||f.includes(`down`);e&&t&&(l=Math.abs(a)>Math.abs(o)?`horizontal`:`vertical`,P(l))}let u;if(!V.current)l===`vertical`?o>0?u=`down`:o<0&&(u=`up`):l===`horizontal`?a>0?u=`right`:a<0&&(u=`left`):u=Math.abs(a)>=Math.abs(o)?a>0?`right`:`left`:o>0?`down`:`up`,u&&f.includes(u)&&(V.current=u,H.current=se(u,a,o),_(u));else{let e=V.current,t=se(e,c,s);t>ue?(U.current=!1,_(e)):!(f.includes(`left`)&&f.includes(`right`))&&!(f.includes(`up`)&&f.includes(`down`))&&H.current-t>=de&&(U.current=!0)}let d=ve(a,o),p=B.current.x,m=B.current.y,h=f.includes(`left`)||f.includes(`right`),g=f.includes(`up`)||f.includes(`down`);l!==`vertical`&&h&&(p+=d.x),l!==`horizontal`&&g&&(m+=d.y),Z({x:p,y:m})}function be(e){if(e.key===`Escape`){if(!I.current||!a(I.current,y(u(I.current))))return;m.closeToast(n.id)}}F.useEffect(()=>{let e=I.current;if(!p||!e)return;function t(t){K.current===null||!a(e,c(t))||t.preventDefault()}return C(e,`touchmove`,t,{passive:!1})},[p]);function xe(){let e=E.x-D.x,t=E.y-D.y;return{transition:v?`none`:void 0,transform:v?`translateX(${E.x}px) translateY(${E.y}px) scale(${D.scale})`:void 0,"--toast-swipe-movement-x":`${e}px`,"--toast-swipe-movement-y":`${t}px`}}let Se=n.priority===`high`,Ce={role:Se?`alertdialog`:`dialog`,tabIndex:0,"aria-modal":!1,"aria-labelledby":A,"aria-describedby":M,"aria-hidden":Se&&!_e?!0:void 0,onPointerDown:p?ye:void 0,onPointerMove:p?$:void 0,onPointerUp:p?Q:void 0,onPointerCancel:p?Q:void 0,onKeyDown:be,inert:h(n.limited),style:{...xe(),"--toast-index":n.transitionStatus===`ending`?he:J,"--toast-offset-y":`${ge}px`,"--toast-height":n.height?`${n.height}px`:void 0}},we=F.useMemo(()=>({toast:n,setTitleId:j,setDescriptionId:N,recalculateHeight:X,visibleIndex:J,expanded:Y}),[n,j,N,X,J,Y]),Te={transitionStatus:n.transitionStatus,expanded:Y,limited:n.limited||!1,type:n.type,swiping:v,swipeDirection:g},Ee=S(`div`,e,{ref:[t,I],state:Te,stateAttributesMapping:le,props:[Ce,l]});return(0,G.jsx)(oe.Provider,{value:we,children:Ee})}),J=F.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{visibleIndex:o,expanded:s,recalculateHeight:c}=q(),l=F.useRef(null);return O(()=>{c();let e=l.current;if(!e||typeof ResizeObserver!=`function`||typeof MutationObserver!=`function`)return;let t=new ResizeObserver(()=>c(!0)),n=new MutationObserver(()=>c(!0));return t.observe(e),n.observe(e,{childList:!0,subtree:!0,characterData:!0}),()=>{t.disconnect(),n.disconnect()}},[c]),S(`div`,e,{ref:[t,l],state:{expanded:s,behind:o>0},props:a})});function ge(e){return e==null||typeof e==`boolean`||e===``?!1:!Array.isArray(e)||e.some(ge)}function _e(e){return F.isValidElement(e)&&ge(e.props.children)}function Y(e,t,n){let{toast:r,setTitleId:i,setDescriptionId:a}=q(),o=n===`title`?i:a,s=t??(n===`title`?r.title:r.description);return{id:w(e),children:s,type:r.type,setId:o}}function X(e,t,n){let r=_e(e);return O(()=>{if(r)return n(t),()=>{n(e=>e===t?void 0:e)}},[r,t,n]),r?e:null}var Z=F.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,children:o,...s}=e,{id:c,children:l,type:u,setId:d}=Y(a,o,`description`);return X(S(`p`,e,{ref:t,state:{type:u},props:{...s,id:c,children:l}}),c,d)}),ve=F.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,children:o,...s}=e,{id:c,children:l,type:u,setId:d}=Y(a,o,`title`);return X(S(`h2`,e,{ref:t,state:{type:u},props:{...s,id:c,children:l}}),c,d)}),Q=F.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a,nativeButton:o=!0,...s}=e,c=L(),{toast:l,expanded:u}=q(),[d,f]=F.useState(!1),{getButtonProps:p,buttonRef:m}=k({disabled:a,native:o}),h={type:l.type};return S(`button`,e,{ref:[t,m],state:h,props:[{"aria-hidden":!u&&!d,onClick(){c.closeToast(l.id)},onFocus(){f(!0)},onBlur(){f(!1)}},s,p]})}),ye=F.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a,nativeButton:o=!0,...s}=e,{toast:c}=q(),l=c.actionProps?.children??s.children,{getButtonProps:u,buttonRef:d}=k({disabled:a,native:o}),f={type:c.type},p=S(`button`,e,{ref:[t,d],state:f,props:[s,c.actionProps,u,{children:l}]});return _e(p)?p:null}),$=F.forwardRef(function(e,t){let{children:n,container:r,className:i,render:a,style:o,...s}=e,{node:c,subtree:l}=f({container:r,ref:t,componentProps:e,elementProps:s});return!l&&!c?null:(0,G.jsxs)(F.Fragment,{children:[l,c&&ae.createPortal(n,c)]})}),be=F.forwardRef(function(e,t){return(0,G.jsx)($,{ref:t,...e})});function xe(){let e=L(),t=e.useState(`toasts`);return F.useMemo(()=>({toasts:t,add:e.addToast,close:e.closeToast,update:e.updateToast,promise:e.promiseToast}),[t,e])}function Se(){let e=new Set;function t(t){e.forEach(e=>e(t))}return{" subscribe":function(t){return e.add(t),()=>{e.delete(t)}},add(e){let n=e.id||z(`toast`);return t({action:`add`,options:{...e,id:n,transitionStatus:`starting`}}),n},close(e){t({action:`close`,options:{id:e}})},update(e,n){t({action:`update`,options:{...n,id:e}})},promise(e,n){let r=e;return t({action:`promise`,options:{...n,promise:e,setPromise(e){r=e}}}),r}}}var Ce=j(`info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),we=j(`octagon-x`,[[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z`,key:`2d38gg`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),Te=Se();function Ee({...e}){return(0,G.jsx)(re,{...e})}function De({...e}){return(0,G.jsx)(be,{"data-slot":`toast-portal`,...e})}function Oe({className:e,...t}){return(0,G.jsx)(K,{"data-slot":`toast-viewport`,className:A(`pointer-events-none fixed inset-x-4 bottom-4 z-50 mx-auto w-auto max-w-sm outline-none sm:right-4 sm:left-auto sm:mx-0 sm:w-full`,e),...t})}function ke({className:e,...t}){return(0,G.jsx)(he,{"data-slot":`toast`,className:A(`group/toast pointer-events-auto absolute right-0 bottom-0 z-[calc(1000-var(--toast-index))] w-full origin-bottom rounded-2xl text-popover-foreground will-change-transform outline-none select-none focus-visible:ring-[3px] focus-visible:ring-ring/50`,`bg-surface-3 shadow-surface-3`,`[--gap:0.75rem] [--height:var(--toast-frontmost-height,var(--toast-height))] [--offset-y:calc(var(--toast-offset-y)*-1+calc(var(--toast-index)*var(--gap)*-1)+var(--toast-swipe-movement-y))] [--peek:0.75rem] [--scale:calc(max(0,1-(var(--toast-index)*0.1)))] [--shrink:calc(1-var(--scale))]`,`h-(--height) [transform:translateX(var(--toast-swipe-movement-x))_translateY(calc(var(--toast-swipe-movement-y)-(var(--toast-index)*var(--peek))-(var(--shrink)*var(--height))))_scale(var(--scale))] [transition:transform_500ms_cubic-bezier(0.22,1,0.36,1),opacity_500ms,height_150ms]`,`after:absolute after:top-full after:left-0 after:h-[calc(var(--gap)+1px)] after:w-full after:content-['']`,`data-expanded:h-(--toast-height) data-expanded:[transform:translateX(var(--toast-swipe-movement-x))_translateY(var(--offset-y))]`,`data-limited:opacity-0 data-starting-style:[transform:translateY(150%)]`,`[&[data-ending-style]:not([data-limited]):not([data-swipe-direction])]:[transform:translateY(150%)]`,`data-ending-style:data-[swipe-direction=down]:[transform:translateY(calc(var(--toast-swipe-movement-y)+150%))]`,`data-ending-style:data-[swipe-direction=left]:[transform:translateX(calc(var(--toast-swipe-movement-x)-150%))_translateY(var(--offset-y))]`,`data-ending-style:data-[swipe-direction=right]:[transform:translateX(calc(var(--toast-swipe-movement-x)+150%))_translateY(var(--offset-y))]`,`data-ending-style:data-[swipe-direction=up]:[transform:translateY(calc(var(--toast-swipe-movement-y)-150%))]`,`data-expanded:data-ending-style:data-[swipe-direction=down]:[transform:translateY(calc(var(--toast-swipe-movement-y)+150%))]`,`data-expanded:data-ending-style:data-[swipe-direction=left]:[transform:translateX(calc(var(--toast-swipe-movement-x)-150%))_translateY(var(--offset-y))]`,`data-expanded:data-ending-style:data-[swipe-direction=right]:[transform:translateX(calc(var(--toast-swipe-movement-x)+150%))_translateY(var(--offset-y))]`,`data-expanded:data-ending-style:data-[swipe-direction=up]:[transform:translateY(calc(var(--toast-swipe-movement-y)-150%))]`,e),...t})}function Ae({className:e,...t}){return(0,G.jsx)(J,{"data-slot":`toast-content`,className:A(`flex h-full items-center gap-3 overflow-hidden p-4 transition-opacity duration-250 ease-[cubic-bezier(0.22,1,0.36,1)] data-behind:opacity-0 data-expanded:opacity-100`,e),...t})}function je({className:e,...t}){return(0,G.jsx)(ve,{"data-slot":`toast-title`,className:A(`text-sm font-medium`,e),...t})}function Me({className:e,...t}){return(0,G.jsx)(Z,{"data-slot":`toast-description`,className:A(`text-sm text-muted-foreground`,e),...t})}function Ne({className:e,render:t=(0,G.jsx)(_,{variant:`outline`,size:`sm`}),...n}){return(0,G.jsx)(ye,{"data-slot":`toast-action`,render:t,className:A(`shrink-0`,e),...n})}function Pe({className:e,children:t,render:n=(0,G.jsx)(_,{variant:`ghost`,size:`icon-sm`}),...r}){return(0,G.jsx)(Q,{"data-slot":`toast-close`,"aria-label":`Close toast`,render:n,className:A(`relative shrink-0 text-muted-foreground after:absolute after:-inset-2 after:content-[''] hover:text-foreground`,e),...r,children:t??(0,G.jsx)(P,{"aria-hidden":`true`})})}function Fe({type:e}){let t=null;return e===`success`&&(t=(0,G.jsx)(M,{"aria-hidden":`true`})),e===`info`&&(t=(0,G.jsx)(Ce,{"aria-hidden":`true`})),e===`warning`&&(t=(0,G.jsx)(ne,{"aria-hidden":`true`})),e===`error`&&(t=(0,G.jsx)(we,{className:`text-destructive`,"aria-hidden":`true`})),e===`loading`&&(t=(0,G.jsx)(N,{className:`animate-spin`,"aria-hidden":`true`})),t?(0,G.jsx)(`span`,{"data-slot":`toast-icon`,className:`shrink-0 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4`,children:t}):null}function Ie(){let{toasts:e}=xe();return e.map(e=>(0,G.jsx)(ke,{toast:e,children:(0,G.jsxs)(Ae,{children:[(0,G.jsx)(Fe,{type:e.type}),(0,G.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,G.jsx)(je,{}),(0,G.jsx)(Me,{})]}),(0,G.jsx)(Ne,{}),(0,G.jsx)(Pe,{})]})},e.id))}function Le({children:e,toastManager:t=Te,...n}){return(0,G.jsxs)(Ee,{toastManager:t,...n,children:[e,(0,G.jsx)(De,{children:(0,G.jsx)(Oe,{children:(0,G.jsx)(Ie,{})})})]})}export{$ as i,Te as n,Ce as r,Le as t};
@@ -1,4 +1,4 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/dist-CZDnnosQ.js","assets/rolldown-runtime-hePW80VL.js","assets/preload-helper-Czpn1I53.js","assets/lib-ChrQ49PO.js","assets/character-entities-legacy-Wut6vMuj.js"])))=>i.map(i=>d[i]);
2
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t}from"./bundle-mjs-DKHVkVWu.js";import{t as n}from"./jsx-runtime-NZYk81nU.js";import{d as r,l as i,u as a}from"./ease-u56MhKYS.js";import{t as o}from"./use-reduced-motion-eORd7fqW.js";import{t as s}from"./utils-Eg7xtNmV.js";import{t as c}from"./createLucideIcon-DwxZHm0M.js";import{t as l}from"./check-JjHKAZas.js";import{t as u}from"./chevron-down-BEVGmnSb.js";import{n as d,t as f}from"./loader-circle-DjfHXUPB.js";import{t as p}from"./circle-x-CkKCB__4.js";import{n as m,r as h,t as g}from"./action-swap-roll-BB8DFMuf.js";import{t as _}from"./rotate-ccw-WNFNkKQD.js";import{t as v}from"./square-terminal-BYTN_I86.js";import{t as y}from"./wrench-BJNNe07k.js";import{t as b}from"./preload-helper-Czpn1I53.js";import{t as x}from"./agent-disclosure-B8SnhQXL.js";var S=c(`ban`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M4.929 4.929 19.07 19.071`,key:`196cmz`}]]),C=c(`braces`,[[`path`,{d:`M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1`,key:`ezmyqa`}],[`path`,{d:`M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1`,key:`e1hn23`}]]),w=e(t(),1),T=n(),E=`github-light-high-contrast`,D=`github-dark-high-contrast`,O=null,k=new Map,A=()=>b(()=>import(`./dist-CZDnnosQ.js`).then(e=>e.t),__vite__mapDeps([0,1,2,3,4]));function j(){return O||=A().then(({createHighlighter:e})=>e({themes:[E,D],langs:[`bash`,`diff`,`json`,`python`,`tsx`,`typescript`]})),O}function M(e,t){return`${t}\u0000${e}`}function N(e,t){let n=M(e,t),r=k.get(n),[i,a]=(0,w.useState)(r?{key:n,code:e,language:t,lines:r}:null);return(0,w.useEffect)(()=>{let r=k.get(n);if(r){a({key:n,code:e,language:t,lines:r});return}let i=!1;return j().then(r=>{if(i)return;let o=r.codeToTokensWithThemes(e,{lang:t,themes:{light:E,dark:D}}).map(e=>e.map(e=>({content:e.content,offset:e.offset,light:e.variants.light?.color,dark:e.variants.dark?.color})));k.set(n,o),a({key:n,code:e,language:t,lines:o})}),()=>{i=!0}},[e,n,t]),i?.key===n||i?.language===t&&e.startsWith(i.code)?i.lines:null}function P({code:e,tokens:t,className:n}){return(0,T.jsx)(`span`,{className:n,children:t?t.map(e=>(0,T.jsx)(`span`,{style:{"--agent-code-light":e.light??`currentColor`,"--agent-code-dark":e.dark??e.light??`currentColor`},className:`text-[var(--agent-code-light)] dark:text-[var(--agent-code-dark)]`,children:e.content},`${e.offset}-${e.content}`)):e})}var F=[];function I({code:e,language:t=`typescript`,languageLabel:n,filename:a,status:c=`complete`,showStatus:u=!0,showLineNumbers:d=!0,highlightLines:p=F,maxHeight:g=280,wrap:_=!1,copyable:v=!0,onCopy:y,className:b}){let x=o()??!1,S=(0,w.useRef)(null),C=(0,w.useRef)(void 0),[E,D]=(0,w.useState)(!1),O=c===`streaming`,k=N(e,t),A=(0,w.useMemo)(()=>new Set(p),[p]),j=0,M=e.split(`
3
- `).map(e=>{let t={content:e,offset:j};return j+=e.length+1,t}),I=n??{bash:`Bash`,diff:`Diff`,json:`JSON`,python:`Python`,text:`Text`,tsx:`TSX`,typescript:`TypeScript`}[t];(0,w.useEffect)(()=>()=>{C.current&&window.clearTimeout(C.current)},[]),(0,w.useLayoutEffect)(()=>{let e=S.current;if(!e||!O)return;let t=requestAnimationFrame(()=>{e.scrollHeight<=e.clientHeight||(typeof e.scrollTo==`function`?e.scrollTo({top:e.scrollHeight,behavior:x?`auto`:`smooth`}):e.scrollTop=e.scrollHeight)});return()=>cancelAnimationFrame(t)});let L=(0,w.useCallback)(async()=>{y?await y():await navigator.clipboard?.writeText(e),D(!0),C.current&&window.clearTimeout(C.current),C.current=window.setTimeout(()=>D(!1),1600)},[e,y]);return(0,T.jsxs)(`div`,{"data-state":c,"aria-busy":O,className:s(`w-full overflow-hidden rounded-2xl bg-muted/80 text-sm`,b),children:[(0,T.jsxs)(`div`,{className:`flex h-10 items-center gap-2.5 px-3`,children:[(0,T.jsx)(m,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground/70`}),a?(0,T.jsx)(`span`,{className:`min-w-0 truncate font-mono text-xs text-foreground/80`,children:a}):null,(0,T.jsx)(`span`,{className:`text-[10px] font-medium uppercase tracking-wide text-muted-foreground/55`,children:I}),u?(0,T.jsxs)(`span`,{className:s(`ml-auto inline-flex shrink-0 items-center gap-1 text-[10px] font-medium`,O?`text-blue-600 dark:text-blue-400`:`text-emerald-600 dark:text-emerald-400`),children:[O?(0,T.jsx)(f,{className:s(`size-3`,!x&&`animate-spin`)}):(0,T.jsx)(l,{className:`size-3`}),O?`Writing`:`Ready`]}):null,v||y?(0,T.jsx)(r.button,{type:`button`,"aria-label":E?`Copied`:`Copy code`,title:E?`Copied`:`Copy code`,onClick:L,whileTap:x?void 0:{scale:.9},transition:i,className:s(`grid size-7 shrink-0 place-items-center rounded-full text-muted-foreground outline-none transition-colors hover:bg-background/70 hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring`,!u&&`ml-auto`),children:E?(0,T.jsx)(l,{className:`size-3.5`}):(0,T.jsx)(h,{className:`size-3.5`})}):null]}),(0,T.jsx)(`div`,{ref:S,role:O?`log`:void 0,"aria-live":O?`polite`:void 0,className:`overflow-auto border-t border-foreground/[0.06] py-2 [scrollbar-color:color-mix(in_oklab,var(--muted-foreground)_35%,transparent)_transparent] [scrollbar-width:thin]`,style:{maxHeight:g},children:(0,T.jsx)(`pre`,{className:`m-0 min-w-max font-mono text-xs leading-5 text-foreground/85`,children:(0,T.jsx)(`code`,{children:M.map((e,t)=>{let n=t+1;return(0,T.jsxs)(`span`,{className:s(`grid min-h-5`,d?`grid-cols-[2.75rem_minmax(0,1fr)]`:`grid-cols-1`,A.has(n)&&`bg-blue-500/[0.07]`),children:[d?(0,T.jsx)(`span`,{className:`select-none pr-3 text-right tabular-nums text-muted-foreground/35`,children:n}):null,(0,T.jsx)(P,{code:e.content,tokens:k?.[t],className:s(`pr-4`,d?`pl-1`:`pl-4`,_?`whitespace-pre-wrap break-words`:`whitespace-pre`)})]},e.offset)})})})})]})}function L({value:e,type:t}){return e?(0,T.jsxs)(`span`,{className:s(`font-mono text-xs tabular-nums`,t===`added`?`text-emerald-600 dark:text-emerald-400`:`text-rose-600 dark:text-rose-400`),children:[t===`added`?`+`:`−`,e]}):null}function R({file:e,lines:t,status:n=`streaming`,open:c,defaultOpen:d=!0,onOpenChange:g,collapseOnComplete:_=!0,maxHeight:v=220,language:y=`typescript`,copyText:b,onCopy:C,className:E}){let D=o()??!1,O=(0,w.useId)(),k=`${O}-trigger`,A=`${O}-content`,j=(0,w.useRef)(null),M=(0,w.useRef)(n),F=(0,w.useRef)(void 0),[I,R]=(0,w.useState)(!1),[z,B]=(0,w.useState)(d),V=c??z,H=n===`streaming`,U=t.filter(e=>e.type===`added`).length,W=t.filter(e=>e.type===`removed`).length,G=!!(b||C),K=N(t.map(e=>e.content).join(`
4
- `),y),q=(0,w.useCallback)(e=>{c===void 0&&B(e),g?.(e)},[g,c]);(0,w.useEffect)(()=>{M.current!==`streaming`&&n===`streaming`&&q(!0),M.current===`streaming`&&n!==`streaming`&&_&&q(!1),M.current=n},[_,q,n]),(0,w.useEffect)(()=>()=>{F.current&&window.clearTimeout(F.current)},[]),(0,w.useLayoutEffect)(()=>{let e=j.current;if(!e||!V||!H)return;let t=requestAnimationFrame(()=>{e.scrollHeight<=e.clientHeight||(typeof e.scrollTo==`function`?e.scrollTo({top:e.scrollHeight,behavior:D?`auto`:`smooth`}):e.scrollTop=e.scrollHeight)});return()=>cancelAnimationFrame(t)});let J=(0,w.useCallback)(async()=>{C?await C():b&&await navigator.clipboard?.writeText(b),R(!0),F.current&&window.clearTimeout(F.current),F.current=window.setTimeout(()=>R(!1),1600)},[b,C]);return(0,T.jsxs)(`div`,{"data-state":n,"aria-busy":H,className:s(`w-full text-sm`,E),children:[(0,T.jsxs)(`button`,{id:k,type:`button`,"aria-expanded":V,"aria-controls":A,onClick:()=>q(!V),className:`group flex min-h-9 w-full items-center gap-2 rounded-md py-1 text-left outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background`,children:[(0,T.jsx)(m,{"aria-hidden":`true`,className:`size-4 shrink-0 text-muted-foreground`}),(0,T.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-xs text-foreground/80`,children:e}),(0,T.jsxs)(`span`,{className:`flex shrink-0 items-center gap-2`,children:[(0,T.jsx)(L,{value:U,type:`added`}),(0,T.jsx)(L,{value:W,type:`removed`})]}),(0,T.jsx)(`span`,{className:`grid size-4 shrink-0 place-items-center text-muted-foreground/60`,children:H?(0,T.jsx)(f,{"aria-label":`Applying changes`,className:s(`size-3.5`,!D&&`animate-spin`)}):n===`error`?(0,T.jsx)(p,{"aria-label":`Changes failed`,className:`size-3.5`}):n===`cancelled`?(0,T.jsx)(S,{"aria-label":`Changes cancelled`,className:`size-3.5`}):(0,T.jsx)(l,{"aria-label":`Changes applied`,className:`size-3.5`})}),(0,T.jsx)(r.span,{"aria-hidden":`true`,animate:{rotate:V?180:0},transition:D?{duration:0}:a,className:`shrink-0 text-muted-foreground/45 transition-colors group-hover:text-muted-foreground`,children:(0,T.jsx)(u,{className:`size-3.5`})})]}),(0,T.jsx)(x,{id:A,role:`region`,"aria-labelledby":k,open:V,children:(0,T.jsx)(`div`,{className:`pl-6 pt-1.5`,children:(0,T.jsxs)(`div`,{className:`overflow-hidden rounded-xl bg-muted/80`,children:[(0,T.jsx)(`div`,{ref:j,"data-slot":`file-diff-viewport`,"aria-live":`polite`,className:`scrollbar-hide overflow-auto`,style:{maxHeight:v},children:(0,T.jsxs)(`div`,{className:`font-mono text-xs leading-5`,children:[(0,T.jsx)(`span`,{className:`sr-only`,children:`File changes`}),t.map((e,t)=>{let n=e.type??`context`;return(0,T.jsxs)(`div`,{className:s(`grid grid-cols-[2.25rem_2.25rem_1rem_minmax(0,1fr)]`,n===`added`&&`bg-emerald-500/[0.07]`,n===`removed`&&`bg-rose-500/[0.07]`),children:[(0,T.jsx)(`span`,{className:`select-none pr-2 text-right tabular-nums text-muted-foreground/40`,children:e.oldLine}),(0,T.jsx)(`span`,{className:`select-none pr-2 text-right tabular-nums text-muted-foreground/40`,children:e.newLine}),(0,T.jsx)(`span`,{className:s(`select-none text-center text-muted-foreground/45`,n===`added`&&`text-emerald-600 dark:text-emerald-400`,n===`removed`&&`text-rose-600 dark:text-rose-400`),children:n===`added`?`+`:n===`removed`?`−`:``}),(0,T.jsx)(P,{code:e.content,tokens:K?.[t],className:`min-w-0 whitespace-pre px-1.5`})]},e.id)})]})}),G?(0,T.jsx)(`div`,{className:`flex justify-end px-2 pb-1.5 pt-1`,children:(0,T.jsx)(r.button,{type:`button`,"aria-label":I?`Copied`:`Copy diff`,title:I?`Copied`:`Copy diff`,onClick:J,whileTap:D?void 0:{scale:.9},transition:i,className:`grid size-7 place-items-center rounded-md text-muted-foreground outline-none transition-colors hover:bg-background/70 hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring`,children:I?(0,T.jsx)(l,{className:`size-3.5`}):(0,T.jsx)(h,{className:`size-3.5`})})}):null]})})})]})}function z(e){return e===`running`?`Running`:e===`success`?`Completed`:e===`error`?`Failed`:`Cancelled`}function B(e,t){return typeof e==`string`||typeof e==`number`?String(e):t}function V(e){return e===`running`?`text-blue-600 dark:text-blue-400`:e===`success`?`text-emerald-600 dark:text-emerald-400`:e===`error`?`text-rose-600 dark:text-rose-400`:`text-muted-foreground`}function H({kind:e}){return e===`terminal`?(0,T.jsx)(v,{className:`size-4`}):e===`request`?(0,T.jsx)(C,{className:`size-4`}):(0,T.jsx)(y,{className:`size-4`})}function U({status:e,reduce:t}){return e===`running`?(0,T.jsx)(f,{className:s(`size-3`,!t&&`animate-spin`)}):e===`success`?(0,T.jsx)(d,{className:`size-3`}):e===`error`?(0,T.jsx)(p,{className:`size-3`}):(0,T.jsx)(S,{className:`size-3`})}function W({label:e,onClick:t,children:n}){let a=o()??!1;return(0,T.jsx)(r.button,{type:`button`,"aria-label":e,title:e,onClick:t,whileTap:a?void 0:{scale:.9},transition:i,className:`grid size-7 place-items-center rounded-md text-muted-foreground outline-none transition-colors hover:bg-muted hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring`,children:n})}function G({children:e,language:t=`bash`,label:n,className:r}){return(0,T.jsxs)(`div`,{className:`space-y-1.5`,children:[n?(0,T.jsx)(`div`,{className:`px-0.5 text-[10px] font-medium uppercase tracking-[0.12em] text-muted-foreground/60`,children:n}):null,(0,T.jsx)(`pre`,{className:s(`m-0 whitespace-pre-wrap break-words font-mono text-xs leading-5 text-foreground/80`,r),children:(0,T.jsx)(`code`,{children:e})})]})}function K({tool:e,title:t,children:n,status:i=`running`,kind:c=`custom`,meta:d,icon:f,open:p,defaultOpen:m=!0,onOpenChange:v,collapseOnComplete:y=!0,maxHeight:b=220,copyText:S,onCopy:C,onRetry:E,className:D,contentClassName:O}){let k=o()??!1,A=(0,w.useId)(),j=`${A}-trigger`,M=`${A}-content`,N=(0,w.useRef)(null),P=(0,w.useRef)(i),F=(0,w.useRef)(void 0),[I,L]=(0,w.useState)(!1),[R,G]=(0,w.useState)(m),K=p??R,q=i===`running`,J=!!(S||C),Y=B(t,i),X=B(d,`${i}-meta`),Z=B(e,`${i}-tool`),Q=z(i),$=(0,w.useCallback)(e=>{p===void 0&&G(e),v?.(e)},[v,p]);(0,w.useEffect)(()=>{P.current!==`running`&&i===`running`&&$(!0),P.current===`running`&&i!==`running`&&y&&$(!1),P.current=i},[y,$,i]),(0,w.useEffect)(()=>()=>{F.current&&window.clearTimeout(F.current)},[]),(0,w.useLayoutEffect)(()=>{let e=N.current;if(!e||!K||!q)return;let t=requestAnimationFrame(()=>{typeof e.scrollTo==`function`?e.scrollTo({top:e.scrollHeight,behavior:k?`auto`:`smooth`}):e.scrollTop=e.scrollHeight});return()=>cancelAnimationFrame(t)});let ee=(0,w.useCallback)(async()=>{C?await C():S&&await navigator.clipboard?.writeText(S),L(!0),F.current&&window.clearTimeout(F.current),F.current=window.setTimeout(()=>L(!1),1600)},[S,C]);return(0,T.jsxs)(`div`,{"data-state":i,"aria-busy":q,className:s(`w-full text-sm`,D),children:[(0,T.jsxs)(`button`,{id:j,type:`button`,"aria-expanded":K,"aria-controls":M,onClick:()=>$(!K),className:`group flex min-h-9 w-full items-center gap-2 rounded-md py-1 text-left outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background`,children:[(0,T.jsx)(`span`,{"aria-hidden":`true`,className:`grid size-4 shrink-0 place-items-center text-muted-foreground`,children:f??(0,T.jsx)(H,{kind:c})}),(0,T.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-baseline gap-2`,children:[(0,T.jsx)(`span`,{className:`min-w-0 truncate font-medium text-foreground/90`,children:(0,T.jsx)(g,{value:Y,children:t})}),d?(0,T.jsx)(`span`,{className:`shrink-0 text-xs text-muted-foreground/60`,children:(0,T.jsx)(g,{value:X,children:d})}):null,(0,T.jsx)(`span`,{className:`min-w-0 truncate font-mono text-[11px] text-muted-foreground/55`,children:(0,T.jsx)(g,{value:Z,children:e})})]}),(0,T.jsxs)(`span`,{className:s(`inline-flex shrink-0 items-center gap-1 text-[11px] font-medium`,V(i)),children:[(0,T.jsx)(U,{status:i,reduce:k}),(0,T.jsx)(g,{value:i,children:Q})]}),(0,T.jsx)(r.span,{"aria-hidden":`true`,animate:{rotate:K?180:0},transition:k?{duration:0}:a,className:`shrink-0 text-muted-foreground/50 transition-colors group-hover:text-muted-foreground`,children:(0,T.jsx)(u,{className:`size-3.5`})})]}),(0,T.jsx)(x,{id:M,role:`region`,"aria-labelledby":j,open:K,children:(0,T.jsx)(`div`,{className:`pl-6 pt-1.5`,children:(0,T.jsxs)(`div`,{className:`overflow-hidden rounded-xl bg-muted/80`,children:[(0,T.jsx)(`div`,{ref:N,role:`log`,"aria-live":`polite`,className:`scrollbar-hide overflow-y-auto`,style:{maxHeight:b},children:(0,T.jsx)(`div`,{className:s(`p-3`,O),children:n})}),J||E?(0,T.jsxs)(`div`,{className:`flex items-center gap-0.5 px-2 pb-1.5`,children:[J?(0,T.jsx)(W,{label:I?`Copied`:`Copy result`,onClick:ee,children:I?(0,T.jsx)(l,{className:`size-3.5`}):(0,T.jsx)(h,{className:`size-3.5`})}):null,E?(0,T.jsx)(W,{label:`Run again`,onClick:E,children:(0,T.jsx)(_,{className:`size-3.5`})}):null,(0,T.jsx)(`span`,{className:`ml-auto text-[11px] text-muted-foreground/55`,children:(0,T.jsx)(g,{value:i,children:Q})})]}):null]})})})]})}export{I as i,G as n,R as r,K as t};
2
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t}from"./bundle-mjs-DKHVkVWu.js";import{t as n}from"./jsx-runtime-NZYk81nU.js";import{d as r,l as i,u as a}from"./ease-u56MhKYS.js";import{t as o}from"./use-reduced-motion-eORd7fqW.js";import{t as s}from"./utils-Eg7xtNmV.js";import{t as c}from"./createLucideIcon-DwxZHm0M.js";import{t as l}from"./check-JjHKAZas.js";import{t as u}from"./chevron-down-BEVGmnSb.js";import{n as d,t as f}from"./loader-circle-DjfHXUPB.js";import{t as p}from"./circle-x-CkKCB__4.js";import{n as m,r as h,t as g}from"./action-swap-roll-BB8DFMuf.js";import{t as _}from"./rotate-ccw-WNFNkKQD.js";import{t as v}from"./square-terminal-BYTN_I86.js";import{t as y}from"./wrench-BJNNe07k.js";import{t as b}from"./preload-helper-Czpn1I53.js";import{t as x}from"./agent-disclosure-B8SnhQXL.js";var S=c(`ban`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M4.929 4.929 19.07 19.071`,key:`196cmz`}]]),C=c(`braces`,[[`path`,{d:`M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1`,key:`ezmyqa`}],[`path`,{d:`M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1`,key:`e1hn23`}]]),w=e(t(),1),T=n(),E=`github-light-high-contrast`,D=`github-dark-high-contrast`,O=null,k=new Map,A=500;function j(e,t){if(k.size>=A){let e=k.keys().next().value;e!==void 0&&k.delete(e)}k.set(e,t)}var M=()=>b(()=>import(`./dist-CZDnnosQ.js`).then(e=>e.t),__vite__mapDeps([0,1,2,3,4]));function N(){return O||=M().then(({createHighlighter:e})=>e({themes:[E,D],langs:[`bash`,`diff`,`json`,`python`,`tsx`,`typescript`]})),O}function P(e,t){return`${t}\u0000${e}`}function F(e,t){let n=P(e,t),r=k.get(n),[i,a]=(0,w.useState)(r?{key:n,code:e,language:t,lines:r}:null);return(0,w.useEffect)(()=>{let r=k.get(n);if(r){a({key:n,code:e,language:t,lines:r});return}let i=!1;return N().then(r=>{if(i)return;let o=r.codeToTokensWithThemes(e,{lang:t,themes:{light:E,dark:D}}).map(e=>e.map(e=>({content:e.content,offset:e.offset,light:e.variants.light?.color,dark:e.variants.dark?.color})));j(n,o),a({key:n,code:e,language:t,lines:o})}),()=>{i=!0}},[e,n,t]),i?.key===n||i?.language===t&&e.startsWith(i.code)?i.lines:null}function I({code:e,tokens:t,className:n}){return(0,T.jsx)(`span`,{className:n,children:t?t.map(e=>(0,T.jsx)(`span`,{style:{"--agent-code-light":e.light??`currentColor`,"--agent-code-dark":e.dark??e.light??`currentColor`},className:`text-[var(--agent-code-light)] dark:text-[var(--agent-code-dark)]`,children:e.content},`${e.offset}-${e.content}`)):e})}var L=[];function R({code:e,language:t=`typescript`,languageLabel:n,filename:a,status:c=`complete`,showStatus:u=!0,showLineNumbers:d=!0,highlightLines:p=L,maxHeight:g=280,wrap:_=!1,copyable:v=!0,onCopy:y,className:b}){let x=o()??!1,S=(0,w.useRef)(null),C=(0,w.useRef)(void 0),[E,D]=(0,w.useState)(!1),O=c===`streaming`,k=F(e,t),A=(0,w.useMemo)(()=>new Set(p),[p]),j=0,M=e.split(`
3
+ `).map(e=>{let t={content:e,offset:j};return j+=e.length+1,t}),N=n??{bash:`Bash`,diff:`Diff`,json:`JSON`,python:`Python`,text:`Text`,tsx:`TSX`,typescript:`TypeScript`}[t];(0,w.useEffect)(()=>()=>{C.current&&window.clearTimeout(C.current)},[]),(0,w.useLayoutEffect)(()=>{let e=S.current;if(!e||!O)return;let t=requestAnimationFrame(()=>{e.scrollHeight<=e.clientHeight||(typeof e.scrollTo==`function`?e.scrollTo({top:e.scrollHeight,behavior:x?`auto`:`smooth`}):e.scrollTop=e.scrollHeight)});return()=>cancelAnimationFrame(t)});let P=(0,w.useCallback)(async()=>{y?await y():await navigator.clipboard?.writeText(e),D(!0),C.current&&window.clearTimeout(C.current),C.current=window.setTimeout(()=>D(!1),1600)},[e,y]);return(0,T.jsxs)(`div`,{"data-state":c,"aria-busy":O,className:s(`w-full overflow-hidden rounded-2xl bg-muted/80 text-sm`,b),children:[(0,T.jsxs)(`div`,{className:`flex h-10 items-center gap-2.5 px-3`,children:[(0,T.jsx)(m,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground/70`}),a?(0,T.jsx)(`span`,{className:`min-w-0 truncate font-mono text-xs text-foreground/80`,children:a}):null,(0,T.jsx)(`span`,{className:`text-[10px] font-medium uppercase tracking-wide text-muted-foreground/55`,children:N}),u?(0,T.jsxs)(`span`,{className:s(`ml-auto inline-flex shrink-0 items-center gap-1 text-[10px] font-medium`,O?`text-blue-600 dark:text-blue-400`:`text-emerald-600 dark:text-emerald-400`),children:[O?(0,T.jsx)(f,{className:s(`size-3`,!x&&`animate-spin`)}):(0,T.jsx)(l,{className:`size-3`}),O?`Writing`:`Ready`]}):null,v||y?(0,T.jsx)(r.button,{type:`button`,"aria-label":E?`Copied`:`Copy code`,title:E?`Copied`:`Copy code`,onClick:P,whileTap:x?void 0:{scale:.9},transition:i,className:s(`grid size-7 shrink-0 place-items-center rounded-full text-muted-foreground outline-none transition-colors hover:bg-background/70 hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring`,!u&&`ml-auto`),children:E?(0,T.jsx)(l,{className:`size-3.5`}):(0,T.jsx)(h,{className:`size-3.5`})}):null]}),(0,T.jsx)(`div`,{ref:S,role:O?`log`:void 0,"aria-live":O?`polite`:void 0,className:`overflow-auto border-t border-foreground/[0.06] py-2 [scrollbar-color:color-mix(in_oklab,var(--muted-foreground)_35%,transparent)_transparent] [scrollbar-width:thin]`,style:{maxHeight:g},children:(0,T.jsx)(`pre`,{className:`m-0 min-w-max font-mono text-xs leading-5 text-foreground/85`,children:(0,T.jsx)(`code`,{children:M.map((e,t)=>{let n=t+1;return(0,T.jsxs)(`span`,{className:s(`grid min-h-5`,d?`grid-cols-[2.75rem_minmax(0,1fr)]`:`grid-cols-1`,A.has(n)&&`bg-blue-500/[0.07]`),children:[d?(0,T.jsx)(`span`,{className:`select-none pr-3 text-right tabular-nums text-muted-foreground/35`,children:n}):null,(0,T.jsx)(I,{code:e.content,tokens:k?.[t],className:s(`pr-4`,d?`pl-1`:`pl-4`,_?`whitespace-pre-wrap break-words`:`whitespace-pre`)})]},e.offset)})})})})]})}function z({value:e,type:t}){return e?(0,T.jsxs)(`span`,{className:s(`font-mono text-xs tabular-nums`,t===`added`?`text-emerald-600 dark:text-emerald-400`:`text-rose-600 dark:text-rose-400`),children:[t===`added`?`+`:`−`,e]}):null}function B({file:e,lines:t,status:n=`streaming`,open:c,defaultOpen:d=!0,onOpenChange:g,collapseOnComplete:_=!0,maxHeight:v=220,language:y=`typescript`,copyText:b,onCopy:C,className:E}){let D=o()??!1,O=(0,w.useId)(),k=`${O}-trigger`,A=`${O}-content`,j=(0,w.useRef)(null),M=(0,w.useRef)(n),N=(0,w.useRef)(void 0),[P,L]=(0,w.useState)(!1),[R,B]=(0,w.useState)(d),V=c??R,H=n===`streaming`,U=t.filter(e=>e.type===`added`).length,W=t.filter(e=>e.type===`removed`).length,G=!!(b||C),K=F(t.map(e=>e.content).join(`
4
+ `),y),q=(0,w.useCallback)(e=>{c===void 0&&B(e),g?.(e)},[g,c]);(0,w.useEffect)(()=>{M.current!==`streaming`&&n===`streaming`&&q(!0),M.current===`streaming`&&n!==`streaming`&&_&&q(!1),M.current=n},[_,q,n]),(0,w.useEffect)(()=>()=>{N.current&&window.clearTimeout(N.current)},[]),(0,w.useLayoutEffect)(()=>{let e=j.current;if(!e||!V||!H)return;let t=requestAnimationFrame(()=>{e.scrollHeight<=e.clientHeight||(typeof e.scrollTo==`function`?e.scrollTo({top:e.scrollHeight,behavior:D?`auto`:`smooth`}):e.scrollTop=e.scrollHeight)});return()=>cancelAnimationFrame(t)});let J=(0,w.useCallback)(async()=>{C?await C():b&&await navigator.clipboard?.writeText(b),L(!0),N.current&&window.clearTimeout(N.current),N.current=window.setTimeout(()=>L(!1),1600)},[b,C]);return(0,T.jsxs)(`div`,{"data-state":n,"aria-busy":H,className:s(`w-full text-sm`,E),children:[(0,T.jsxs)(`button`,{id:k,type:`button`,"aria-expanded":V,"aria-controls":A,onClick:()=>q(!V),className:`group flex min-h-9 w-full items-center gap-2 rounded-md py-1 text-left outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background`,children:[(0,T.jsx)(m,{"aria-hidden":`true`,className:`size-4 shrink-0 text-muted-foreground`}),(0,T.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-xs text-foreground/80`,children:e}),(0,T.jsxs)(`span`,{className:`flex shrink-0 items-center gap-2`,children:[(0,T.jsx)(z,{value:U,type:`added`}),(0,T.jsx)(z,{value:W,type:`removed`})]}),(0,T.jsx)(`span`,{className:`grid size-4 shrink-0 place-items-center text-muted-foreground/60`,children:H?(0,T.jsx)(f,{"aria-label":`Applying changes`,className:s(`size-3.5`,!D&&`animate-spin`)}):n===`error`?(0,T.jsx)(p,{"aria-label":`Changes failed`,className:`size-3.5`}):n===`cancelled`?(0,T.jsx)(S,{"aria-label":`Changes cancelled`,className:`size-3.5`}):(0,T.jsx)(l,{"aria-label":`Changes applied`,className:`size-3.5`})}),(0,T.jsx)(r.span,{"aria-hidden":`true`,animate:{rotate:V?180:0},transition:D?{duration:0}:a,className:`shrink-0 text-muted-foreground/45 transition-colors group-hover:text-muted-foreground`,children:(0,T.jsx)(u,{className:`size-3.5`})})]}),(0,T.jsx)(x,{id:A,role:`region`,"aria-labelledby":k,open:V,children:(0,T.jsx)(`div`,{className:`pl-6 pt-1.5`,children:(0,T.jsxs)(`div`,{className:`overflow-hidden rounded-xl bg-muted/80`,children:[(0,T.jsx)(`div`,{ref:j,"data-slot":`file-diff-viewport`,"aria-live":`polite`,className:`scrollbar-hide overflow-auto`,style:{maxHeight:v},children:(0,T.jsxs)(`div`,{className:`font-mono text-xs leading-5`,children:[(0,T.jsx)(`span`,{className:`sr-only`,children:`File changes`}),t.map((e,t)=>{let n=e.type??`context`;return(0,T.jsxs)(`div`,{className:s(`grid grid-cols-[2.25rem_2.25rem_1rem_minmax(0,1fr)]`,n===`added`&&`bg-emerald-500/[0.07]`,n===`removed`&&`bg-rose-500/[0.07]`),children:[(0,T.jsx)(`span`,{className:`select-none pr-2 text-right tabular-nums text-muted-foreground/40`,children:e.oldLine}),(0,T.jsx)(`span`,{className:`select-none pr-2 text-right tabular-nums text-muted-foreground/40`,children:e.newLine}),(0,T.jsx)(`span`,{className:s(`select-none text-center text-muted-foreground/45`,n===`added`&&`text-emerald-600 dark:text-emerald-400`,n===`removed`&&`text-rose-600 dark:text-rose-400`),children:n===`added`?`+`:n===`removed`?`−`:``}),(0,T.jsx)(I,{code:e.content,tokens:K?.[t],className:`min-w-0 whitespace-pre px-1.5`})]},e.id)})]})}),G?(0,T.jsx)(`div`,{className:`flex justify-end px-2 pb-1.5 pt-1`,children:(0,T.jsx)(r.button,{type:`button`,"aria-label":P?`Copied`:`Copy diff`,title:P?`Copied`:`Copy diff`,onClick:J,whileTap:D?void 0:{scale:.9},transition:i,className:`grid size-7 place-items-center rounded-md text-muted-foreground outline-none transition-colors hover:bg-background/70 hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring`,children:P?(0,T.jsx)(l,{className:`size-3.5`}):(0,T.jsx)(h,{className:`size-3.5`})})}):null]})})})]})}function V(e){return e===`running`?`Running`:e===`success`?`Completed`:e===`error`?`Failed`:`Cancelled`}function H(e,t){return typeof e==`string`||typeof e==`number`?String(e):t}function U(e){return e===`running`?`text-blue-600 dark:text-blue-400`:e===`success`?`text-emerald-600 dark:text-emerald-400`:e===`error`?`text-rose-600 dark:text-rose-400`:`text-muted-foreground`}function W({kind:e}){return e===`terminal`?(0,T.jsx)(v,{className:`size-4`}):e===`request`?(0,T.jsx)(C,{className:`size-4`}):(0,T.jsx)(y,{className:`size-4`})}function G({status:e,reduce:t}){return e===`running`?(0,T.jsx)(f,{className:s(`size-3`,!t&&`animate-spin`)}):e===`success`?(0,T.jsx)(d,{className:`size-3`}):e===`error`?(0,T.jsx)(p,{className:`size-3`}):(0,T.jsx)(S,{className:`size-3`})}function K({label:e,onClick:t,children:n}){let a=o()??!1;return(0,T.jsx)(r.button,{type:`button`,"aria-label":e,title:e,onClick:t,whileTap:a?void 0:{scale:.9},transition:i,className:`grid size-7 place-items-center rounded-md text-muted-foreground outline-none transition-colors hover:bg-muted hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring`,children:n})}function q({children:e,language:t=`bash`,label:n,className:r}){return(0,T.jsxs)(`div`,{className:`space-y-1.5`,children:[n?(0,T.jsx)(`div`,{className:`px-0.5 text-[10px] font-medium uppercase tracking-[0.12em] text-muted-foreground/60`,children:n}):null,(0,T.jsx)(`pre`,{className:s(`m-0 whitespace-pre-wrap break-words font-mono text-xs leading-5 text-foreground/80`,r),children:(0,T.jsx)(`code`,{children:e})})]})}function J({tool:e,title:t,children:n,status:i=`running`,kind:c=`custom`,meta:d,icon:f,open:p,defaultOpen:m=!0,onOpenChange:v,collapseOnComplete:y=!0,maxHeight:b=220,copyText:S,onCopy:C,onRetry:E,className:D,contentClassName:O}){let k=o()??!1,A=(0,w.useId)(),j=`${A}-trigger`,M=`${A}-content`,N=(0,w.useRef)(null),P=(0,w.useRef)(i),F=(0,w.useRef)(void 0),[I,L]=(0,w.useState)(!1),[R,z]=(0,w.useState)(m),B=p??R,q=i===`running`,J=!!(S||C),Y=H(t,i),X=H(d,`${i}-meta`),Z=H(e,`${i}-tool`),Q=V(i),$=(0,w.useCallback)(e=>{p===void 0&&z(e),v?.(e)},[v,p]);(0,w.useEffect)(()=>{P.current!==`running`&&i===`running`&&$(!0),P.current===`running`&&i!==`running`&&y&&$(!1),P.current=i},[y,$,i]),(0,w.useEffect)(()=>()=>{F.current&&window.clearTimeout(F.current)},[]),(0,w.useLayoutEffect)(()=>{let e=N.current;if(!e||!B||!q)return;let t=requestAnimationFrame(()=>{typeof e.scrollTo==`function`?e.scrollTo({top:e.scrollHeight,behavior:k?`auto`:`smooth`}):e.scrollTop=e.scrollHeight});return()=>cancelAnimationFrame(t)});let ee=(0,w.useCallback)(async()=>{C?await C():S&&await navigator.clipboard?.writeText(S),L(!0),F.current&&window.clearTimeout(F.current),F.current=window.setTimeout(()=>L(!1),1600)},[S,C]);return(0,T.jsxs)(`div`,{"data-state":i,"aria-busy":q,className:s(`w-full text-sm`,D),children:[(0,T.jsxs)(`button`,{id:j,type:`button`,"aria-expanded":B,"aria-controls":M,onClick:()=>$(!B),className:`group flex min-h-9 w-full items-center gap-2 rounded-md py-1 text-left outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background`,children:[(0,T.jsx)(`span`,{"aria-hidden":`true`,className:`grid size-4 shrink-0 place-items-center text-muted-foreground`,children:f??(0,T.jsx)(W,{kind:c})}),(0,T.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-baseline gap-2`,children:[(0,T.jsx)(`span`,{className:`min-w-0 truncate font-medium text-foreground/90`,children:(0,T.jsx)(g,{value:Y,children:t})}),d?(0,T.jsx)(`span`,{className:`shrink-0 text-xs text-muted-foreground/60`,children:(0,T.jsx)(g,{value:X,children:d})}):null,(0,T.jsx)(`span`,{className:`min-w-0 truncate font-mono text-[11px] text-muted-foreground/55`,children:(0,T.jsx)(g,{value:Z,children:e})})]}),(0,T.jsxs)(`span`,{className:s(`inline-flex shrink-0 items-center gap-1 text-[11px] font-medium`,U(i)),children:[(0,T.jsx)(G,{status:i,reduce:k}),(0,T.jsx)(g,{value:i,children:Q})]}),(0,T.jsx)(r.span,{"aria-hidden":`true`,animate:{rotate:B?180:0},transition:k?{duration:0}:a,className:`shrink-0 text-muted-foreground/50 transition-colors group-hover:text-muted-foreground`,children:(0,T.jsx)(u,{className:`size-3.5`})})]}),(0,T.jsx)(x,{id:M,role:`region`,"aria-labelledby":j,open:B,children:(0,T.jsx)(`div`,{className:`pl-6 pt-1.5`,children:(0,T.jsxs)(`div`,{className:`overflow-hidden rounded-xl bg-muted/80`,children:[(0,T.jsx)(`div`,{ref:N,role:`log`,"aria-live":`polite`,className:`scrollbar-hide overflow-y-auto`,style:{maxHeight:b},children:(0,T.jsx)(`div`,{className:s(`p-3`,O),children:n})}),J||E?(0,T.jsxs)(`div`,{className:`flex items-center gap-0.5 px-2 pb-1.5`,children:[J?(0,T.jsx)(K,{label:I?`Copied`:`Copy result`,onClick:ee,children:I?(0,T.jsx)(l,{className:`size-3.5`}):(0,T.jsx)(h,{className:`size-3.5`})}):null,E?(0,T.jsx)(K,{label:`Run again`,onClick:E,children:(0,T.jsx)(_,{className:`size-3.5`})}):null,(0,T.jsx)(`span`,{className:`ml-auto text-[11px] text-muted-foreground/55`,children:(0,T.jsx)(g,{value:i,children:Q})})]}):null]})})})]})}export{R as i,q as n,B as r,J as t};
@@ -1,10 +1,10 @@
1
1
  {
2
- "timestamp": "2026-09-09T03:22:20.715Z",
3
- "routeEntry": "routes-DkefU9yA.js",
4
- "routeEntryGzipBytes": 95459,
5
- "routeEntryReduction": 0.9098196184534459,
2
+ "timestamp": "2026-09-10T02:57:32.416Z",
3
+ "routeEntry": "routes-DAikUNzO.js",
4
+ "routeEntryGzipBytes": 95497,
5
+ "routeEntryReduction": 0.9097837197482556,
6
6
  "eagerFiles": 66,
7
- "eagerGzipBytes": 364230,
7
+ "eagerGzipBytes": 364290,
8
8
  "passed": true,
9
9
  "violations": []
10
10
  }
@@ -1,6 +1,6 @@
1
1
  import "./chunk-MLKGABMK.js";
2
2
 
3
- // web/app/dist/server/assets/_tanstack-start-manifest_v-DkghjPW8.js
3
+ // web/app/dist/server/assets/_tanstack-start-manifest_v-Cdx6hy2i.js
4
4
  var tsrStartManifest = () => ({ routes: {
5
5
  __root__: {
6
6
  filePath: "/home/circleci/prime-agent/web/app/src/routes/__root.tsx",
@@ -15,15 +15,15 @@ var tsrStartManifest = () => ({ routes: {
15
15
  "/api/workspace/tree"
16
16
  ],
17
17
  preloads: [
18
- "/assets/index-CwtZA4hF.js",
18
+ "/assets/index-DlnHLDpx.js",
19
19
  "/assets/rolldown-runtime-hePW80VL.js",
20
20
  "/assets/bundle-mjs-DKHVkVWu.js",
21
21
  "/assets/react-dom-Bwxum3ti.js",
22
22
  "/assets/jsx-runtime-NZYk81nU.js",
23
23
  "/assets/analytics-stub-Cas1He0w.js",
24
- "/assets/button-BV9NafmI.js",
24
+ "/assets/button-BR2WWrFo.js",
25
25
  "/assets/layout-gyLzPvVv.js",
26
- "/assets/toast-BzAKULar.js",
26
+ "/assets/toast-Bt9p2OL4.js",
27
27
  "/assets/card-BKl76a3R.js",
28
28
  "/assets/ui-preferences-DUEFuJFj.js",
29
29
  "/assets/preload-helper-Czpn1I53.js"
@@ -31,31 +31,31 @@ var tsrStartManifest = () => ({ routes: {
31
31
  scripts: [{ attrs: {
32
32
  type: "module",
33
33
  async: true,
34
- src: "/assets/index-CwtZA4hF.js"
34
+ src: "/assets/index-DlnHLDpx.js"
35
35
  } }]
36
36
  },
37
37
  "/": {
38
38
  filePath: "/home/circleci/prime-agent/web/app/src/routes/index.tsx",
39
39
  children: void 0,
40
40
  preloads: [
41
- "/assets/routes-DkefU9yA.js",
41
+ "/assets/routes-DAikUNzO.js",
42
42
  "/assets/ease-u56MhKYS.js",
43
- "/assets/prompt-input-BpuTiX7Z.js",
43
+ "/assets/prompt-input-DZ4cho_e.js",
44
44
  "/assets/use-reduced-motion-eORd7fqW.js",
45
45
  "/assets/createBaseUIEventDetails-DV0dQrBX.js",
46
- "/assets/dialog-Dh7WpGIu.js",
47
- "/assets/provider-catalog-CO1GxLYe.js",
46
+ "/assets/dialog-BEZuZhzk.js",
47
+ "/assets/provider-catalog-D8G66gwc.js",
48
48
  "/assets/useBaseUiId-CHqXB2UQ.js",
49
- "/assets/provider-label-B0E-wWFV.js",
49
+ "/assets/provider-label-BCJh04J5.js",
50
50
  "/assets/utils-Eg7xtNmV.js",
51
51
  "/assets/createLucideIcon-DwxZHm0M.js",
52
- "/assets/right-panel-registry-DOyEvIMD.js",
52
+ "/assets/right-panel-registry-VVRPktV3.js",
53
53
  "/assets/citations-BQ_pr_9_.js",
54
54
  "/assets/resource-helpers-Q2T0YCMO.js",
55
55
  "/assets/bot-Bs7QWJ2q.js",
56
56
  "/assets/check-JjHKAZas.js",
57
57
  "/assets/chevron-down-BEVGmnSb.js",
58
- "/assets/generative-text-renderer-CzwNIs3b.js",
58
+ "/assets/generative-text-renderer-CDKHv-v_.js",
59
59
  "/assets/chevron-right-DrJxToLs.js",
60
60
  "/assets/chevron-up-CnSvySGH.js",
61
61
  "/assets/circle-alert-CONlFReH.js",
@@ -75,15 +75,15 @@ var tsrStartManifest = () => ({ routes: {
75
75
  "/assets/triangle-alert-CU-gd7ui.js",
76
76
  "/assets/x-CsRC_tCI.js",
77
77
  "/assets/cn-C8c0S2mI.js",
78
- "/assets/notify-BnNaNaBU.js",
78
+ "/assets/notify-DgMKgZZW.js",
79
79
  "/assets/workspace-path-nav-C0AQNZyy.js",
80
80
  "/assets/useControlled-CJJ9BOQB.js",
81
81
  "/assets/agent-disclosure-B8SnhQXL.js",
82
82
  "/assets/surfaces-cW-gp56p.js",
83
83
  "/assets/prime-agent-artifacts-C-g1VPiW.js",
84
- "/assets/chat-DdPRGn-U.js",
84
+ "/assets/chat-C8XDWWXz.js",
85
85
  "/assets/right-panel-context-DHlNWJsF.js",
86
- "/assets/input-Bol3TP4v.js",
86
+ "/assets/input-0wwjWjKq.js",
87
87
  "/assets/artifacts-utils-N_kUFbz2.js"
88
88
  ]
89
89
  }
@@ -9,7 +9,7 @@ import {
9
9
  FileDiff,
10
10
  ToolResult,
11
11
  ToolResultOutput
12
- } from "./chunk-IFHABBJO.js";
12
+ } from "./chunk-3PIUR75R.js";
13
13
  import "./chunk-2ATMSG7U.js";
14
14
  import "./chunk-HFQTI7AX.js";
15
15
  import {
@@ -30,25 +30,25 @@ import "./chunk-FAGDMGLK.js";
30
30
  import {
31
31
  GenerativeTextRenderer,
32
32
  OpenUIHtmlArtifactView
33
- } from "./chunk-BTXNB4CP.js";
33
+ } from "./chunk-M564UIEY.js";
34
34
  import {
35
35
  UiErrorBoundary
36
- } from "./chunk-FZMWPQNE.js";
36
+ } from "./chunk-KNJUSMBT.js";
37
37
  import "./chunk-K5ESTT4A.js";
38
38
  import "./chunk-NRDG2ISJ.js";
39
- import "./chunk-ZCJXHV2R.js";
40
- import "./chunk-TGZIE2T6.js";
39
+ import "./chunk-UAPNEWCA.js";
40
+ import "./chunk-WM4PUT6M.js";
41
41
  import "./chunk-RJOANOT4.js";
42
42
  import "./chunk-NFRJDPB3.js";
43
43
  import "./chunk-OZO5ARFA.js";
44
44
  import "./chunk-L46H6IDX.js";
45
45
  import "./chunk-WWJF4RO2.js";
46
46
  import "./chunk-7PQTPSEE.js";
47
- import "./chunk-X6RKK47S.js";
48
- import "./chunk-VMYYWXF4.js";
47
+ import "./chunk-P6UMR32I.js";
48
+ import "./chunk-AGFRJQZ7.js";
49
49
  import {
50
50
  Button
51
- } from "./chunk-JICJWC33.js";
51
+ } from "./chunk-LZ4Q5KUJ.js";
52
52
  import "./chunk-4QD4PCVP.js";
53
53
  import "./chunk-S3PQ6HKH.js";
54
54
  import "./chunk-7SR6WDM2.js";
@@ -71,7 +71,7 @@ import "./chunk-JDCCC7A7.js";
71
71
  import "./chunk-L547YHC4.js";
72
72
  import "./chunk-MLKGABMK.js";
73
73
 
74
- // web/app/dist/server/assets/artifacts-panel-D20iI9ud.js
74
+ // web/app/dist/server/assets/artifacts-panel-DLMK1O8P.js
75
75
  import { useEffect, useMemo, useRef, useState } from "react";
76
76
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
77
77
  var LayoutTemplate = createLucideIcon("layout-template", [
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  RIGHT_PANEL_LAUNCHER_DEFINITIONS
3
- } from "./chunk-EFNPNSDO.js";
3
+ } from "./chunk-EOVMHQ2H.js";
4
4
  import {
5
5
  Keyboard,
6
6
  Monitor,
@@ -24,13 +24,13 @@ import {
24
24
  CommandItem,
25
25
  CommandList,
26
26
  CommandSeparator
27
- } from "./chunk-IMK45Q23.js";
28
- import "./chunk-QJQZLBLU.js";
27
+ } from "./chunk-XKKXXG6N.js";
28
+ import "./chunk-P7H2OPKF.js";
29
29
  import "./chunk-JIULUYHT.js";
30
30
  import "./chunk-7PQTPSEE.js";
31
- import "./chunk-X6RKK47S.js";
32
- import "./chunk-VMYYWXF4.js";
33
- import "./chunk-JICJWC33.js";
31
+ import "./chunk-P6UMR32I.js";
32
+ import "./chunk-AGFRJQZ7.js";
33
+ import "./chunk-LZ4Q5KUJ.js";
34
34
  import "./chunk-4QD4PCVP.js";
35
35
  import "./chunk-S3PQ6HKH.js";
36
36
  import "./chunk-7SR6WDM2.js";
@@ -47,7 +47,7 @@ import "./chunk-JDCCC7A7.js";
47
47
  import "./chunk-L547YHC4.js";
48
48
  import "./chunk-MLKGABMK.js";
49
49
 
50
- // web/app/dist/server/assets/chat-command-palette-DmDvAEZe.js
50
+ // web/app/dist/server/assets/chat-command-palette-CdYwoTMe.js
51
51
  import { useState } from "react";
52
52
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
53
53
  var RotateCcwClock = createLucideIcon("rotate-ccw-clock", [
@@ -43,7 +43,7 @@ import {
43
43
  cn
44
44
  } from "./chunk-DJMHPJBP.js";
45
45
 
46
- // web/app/dist/server/assets/tool-result-BysJAIj3.js
46
+ // web/app/dist/server/assets/tool-result-BBMNKQkY.js
47
47
  import { useCallback, useEffect, useId, useLayoutEffect, useMemo, useRef, useState } from "react";
48
48
  import { jsx, jsxs } from "react/jsx-runtime";
49
49
  var Ban = createLucideIcon("ban", [["circle", {
@@ -66,6 +66,14 @@ var LIGHT_THEME = "github-light-high-contrast";
66
66
  var DARK_THEME = "github-dark-high-contrast";
67
67
  var agentCodeHighlighter = null;
68
68
  var tokenCache = /* @__PURE__ */ new Map();
69
+ var MAX_TOKEN_CACHE_SIZE = 500;
70
+ function setCachedTokens(key, lines) {
71
+ if (tokenCache.size >= MAX_TOKEN_CACHE_SIZE) {
72
+ const firstKey = tokenCache.keys().next().value;
73
+ if (firstKey !== void 0) tokenCache.delete(firstKey);
74
+ }
75
+ tokenCache.set(key, lines);
76
+ }
69
77
  var loadShiki = () => import("./dist-BUHRHX7E-XCYWFUBC.js").then((n) => n.t);
70
78
  function getAgentCodeHighlighter() {
71
79
  if (!agentCodeHighlighter) agentCodeHighlighter = loadShiki().then(({ createHighlighter }) => createHighlighter({
@@ -119,7 +127,7 @@ function useAgentCodeTokens(code, language) {
119
127
  light: token.variants.light?.color,
120
128
  dark: token.variants.dark?.color
121
129
  })));
122
- tokenCache.set(key, lines);
130
+ setCachedTokens(key, lines);
123
131
  setResult({
124
132
  key,
125
133
  code,
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-FJV6EQDW.js";
4
4
  import {
5
5
  notify
6
- } from "./chunk-56NGD3FN.js";
6
+ } from "./chunk-WYL2DW5R.js";
7
7
  import {
8
8
  LazyMarkdown,
9
9
  useHoverCapable
@@ -42,7 +42,7 @@ import {
42
42
  cn
43
43
  } from "./chunk-DJMHPJBP.js";
44
44
 
45
- // web/app/dist/server/assets/generative-text-renderer-CdDBV74a.js
45
+ // web/app/dist/server/assets/generative-text-renderer-B3H8tWzp.js
46
46
  import { Suspense, cloneElement, createContext, lazy, memo, useCallback, useContext, useEffect, useEffectEvent, useId, useLayoutEffect, useMemo, useRef, useState } from "react";
47
47
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
48
48
  import { createPortal } from "react-dom";
@@ -1487,7 +1487,7 @@ function groupMessages(messages) {
1487
1487
  if (current) turns.push(current);
1488
1488
  return turns;
1489
1489
  }
1490
- var LazyGenerativeTextRenderer = lazy(() => import("./openui-renderer-BNLpfzyj-JUPJXUWF.js").then((n) => n.n).then(({ GenerativeTextRenderer }) => ({ default: GenerativeTextRenderer })));
1490
+ var LazyGenerativeTextRenderer = lazy(() => import("./openui-renderer-Czy5Vo2L-BLXPJD65.js").then((n) => n.n).then(({ GenerativeTextRenderer }) => ({ default: GenerativeTextRenderer })));
1491
1491
  function PlainTextFallback({ className, content }) {
1492
1492
  return /* @__PURE__ */ jsx("div", {
1493
1493
  className: className ? `${className} whitespace-pre-wrap` : "whitespace-pre-wrap",
@@ -30,7 +30,7 @@ import {
30
30
  usePortalContext,
31
31
  useTimeout,
32
32
  webkit
33
- } from "./chunk-JICJWC33.js";
33
+ } from "./chunk-LZ4Q5KUJ.js";
34
34
  import {
35
35
  useBaseUiId,
36
36
  useTransitionStatus,
@@ -80,7 +80,7 @@ import {
80
80
  cn
81
81
  } from "./chunk-DJMHPJBP.js";
82
82
 
83
- // web/app/dist/server/assets/dialog-6pQWhLHm.js
83
+ // web/app/dist/server/assets/dialog-D2wc3OZf.js
84
84
  import * as React$1 from "react";
85
85
  import { createContext as createContext2, useContext as useContext2 } from "react";
86
86
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -47,7 +47,7 @@ import {
47
47
  FileDiff,
48
48
  ToolResult,
49
49
  ToolResultOutput
50
- } from "./chunk-IFHABBJO.js";
50
+ } from "./chunk-3PIUR75R.js";
51
51
  import {
52
52
  ActionSwapRollText,
53
53
  FileCodeCorner
@@ -126,7 +126,7 @@ import {
126
126
  __exportAll
127
127
  } from "./chunk-L547YHC4.js";
128
128
 
129
- // web/app/dist/server/assets/fleet-pi-tool-renderer-CgbmlIoe.js
129
+ // web/app/dist/server/assets/fleet-pi-tool-renderer-RIeVlM9J.js
130
130
  import React, { createContext, memo, useCallback, useContext, useEffect, useId, useInsertionEffect, useLayoutEffect, useMemo, useRef, useState } from "react";
131
131
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
132
132
  var ChevronsDown = createLucideIcon("chevrons-down", [["path", {
@@ -21,7 +21,7 @@ import {
21
21
  createLucideIcon
22
22
  } from "./chunk-4ZIEVI5O.js";
23
23
 
24
- // web/app/dist/server/assets/right-panel-registry-DS4op1ha.js
24
+ // web/app/dist/server/assets/right-panel-registry-Belw-Qdn.js
25
25
  import { Suspense, lazy } from "react";
26
26
  import { jsx, jsxs } from "react/jsx-runtime";
27
27
  var Activity = createLucideIcon("activity", [["path", {
@@ -46,11 +46,11 @@ var Library = createLucideIcon("library", [
46
46
  key: "6qkkli"
47
47
  }]
48
48
  ]);
49
- var LazyArtifactsPanel = lazy(() => import("./artifacts-panel-D20iI9ud-YGBYV6NF.js").then(({ ArtifactsPanelContent }) => ({ default: ArtifactsPanelContent })));
49
+ var LazyArtifactsPanel = lazy(() => import("./artifacts-panel-DLMK1O8P-42T45JMA.js").then(({ ArtifactsPanelContent }) => ({ default: ArtifactsPanelContent })));
50
50
  var LazyResourcesPanel = lazy(() => import("./resources-panel-j4fAIi9g-5C267IXV.js").then(({ ResourcesPanelContent }) => ({ default: ResourcesPanelContent })));
51
51
  var LazySessionInsightsPanel = lazy(() => import("./session-insights-panel-BHZyKDTo-LRMAMA3O.js").then(({ SessionInsightsPanel }) => ({ default: SessionInsightsPanel })));
52
52
  var LazyReplPanel = lazy(() => import("./repl-panel-yyxhwe4c-7U6HXYPS.js").then(({ ReplPanelContent }) => ({ default: ReplPanelContent })));
53
- var LazySubagentsPanel = lazy(() => import("./subagents-panel-D2CN0IYy-3L6ZNQ3Q.js").then(({ SubagentsPanelContent }) => ({ default: SubagentsPanelContent })));
53
+ var LazySubagentsPanel = lazy(() => import("./subagents-panel-Txzk8oDb-NRKLASYN.js").then(({ SubagentsPanelContent }) => ({ default: SubagentsPanelContent })));
54
54
  var LazyWorkspacePanel = lazy(() => import("./workspace-panel-BOs-58Cv-SWQBMZSB.js").then(({ WorkspacePanelContent }) => ({ default: WorkspacePanelContent })));
55
55
  function PanelFallback() {
56
56
  return /* @__PURE__ */ jsxs("div", {
@@ -50,7 +50,7 @@ import {
50
50
  cn
51
51
  } from "./chunk-DJMHPJBP.js";
52
52
 
53
- // web/app/dist/server/assets/prompt-input-DPazIuDx.js
53
+ // web/app/dist/server/assets/prompt-input-JtVsQDA2.js
54
54
  import { cloneElement, createContext, forwardRef, isValidElement, useCallback, useContext, useEffect, useEffectEvent, useId, useInsertionEffect, useLayoutEffect, useMemo, useRef, useState, useSyncExternalStore } from "react";
55
55
  import { jsx, jsxs } from "react/jsx-runtime";
56
56
  import { createPortal } from "react-dom";
@@ -1058,13 +1058,15 @@ function PromptInput({ value, defaultValue = "", onValueChange, models = [], mod
1058
1058
  useLayoutEffect(() => {
1059
1059
  resizeTextarea();
1060
1060
  }, [resizeTextarea]);
1061
+ const resizeRef = useRef(resizeTextarea);
1062
+ resizeRef.current = resizeTextarea;
1061
1063
  useEffect(() => {
1062
1064
  const textarea = textareaRef.current;
1063
1065
  if (!textarea || typeof ResizeObserver === "undefined") return;
1064
- const observer = new ResizeObserver(resizeTextarea);
1066
+ const observer = new ResizeObserver(() => resizeRef.current());
1065
1067
  observer.observe(textarea);
1066
1068
  return () => observer.disconnect();
1067
- }, [resizeTextarea]);
1069
+ }, []);
1068
1070
  const setValue = (next) => {
1069
1071
  if (value === void 0) setInternalValue(next);
1070
1072
  onValueChange?.(next);
@@ -3,10 +3,10 @@ import {
3
3
  } from "./chunk-NRDG2ISJ.js";
4
4
  import {
5
5
  useRender
6
- } from "./chunk-TGZIE2T6.js";
6
+ } from "./chunk-WM4PUT6M.js";
7
7
  import {
8
8
  cva
9
- } from "./chunk-JICJWC33.js";
9
+ } from "./chunk-LZ4Q5KUJ.js";
10
10
  import {
11
11
  mergeProps
12
12
  } from "./chunk-C5X6G26O.js";
@@ -14,7 +14,7 @@ import {
14
14
  cn
15
15
  } from "./chunk-DJMHPJBP.js";
16
16
 
17
- // web/app/dist/server/assets/open-panel-action-message-CDTCq_xK.js
17
+ // web/app/dist/server/assets/open-panel-action-message-D1DsbE-5.js
18
18
  import { Component, createContext, createElement } from "react";
19
19
  import { jsx, jsxs } from "react/jsx-runtime";
20
20
  var h = createContext(null);