@yuriai/web 0.1.3 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{AgentAvatar-1UO8KpCd.js → AgentAvatar-D6H7fWWf.js} +1 -1
- package/dist/assets/{AssistantView-BJyGm9Js.js → AssistantView-D3j8FlaF.js} +3 -3
- package/dist/assets/{DiagramView-BRK8rzVX.js → DiagramView-TX1QZ1-S.js} +1 -1
- package/dist/assets/{FadeInOnReveal-BsRKluhI.js → FadeInOnReveal-eVZbrwte.js} +1 -1
- package/dist/assets/{Icon-jsQQXouE.js → Icon-2cKLcXGe.js} +1 -1
- package/dist/assets/{ImageLoadingPlaceholder-CGHGcrEo.js → ImageLoadingPlaceholder-DmCEIw55.js} +1 -1
- package/dist/assets/{LoadingImage-BG9q4Tm_.js → LoadingImage-B-cD_lfU.js} +1 -1
- package/dist/assets/{MarkdownRenderer-D4Ba9SUF.js → MarkdownRenderer-DGUI8EIG.js} +2 -2
- package/dist/assets/{MarkdownRendererImpl-Dt0t56Yx.js → MarkdownRendererImpl-DndseLUT.js} +1 -1
- package/dist/assets/{MarkstreamRendererImpl-rGcpWsHj.js → MarkstreamRendererImpl-Ehxwt6MS.js} +1 -1
- package/dist/assets/{MobileDetailNavigation-Cyp_3Hha.js → MobileDetailNavigation-D7uM40jU.js} +1 -1
- package/dist/assets/{MobileShareBridge-BQnwoSB3.js → MobileShareBridge-BMQKnoEb.js} +1 -1
- package/dist/assets/MobileTabPageHeader-Cco8ToA6.js +2 -0
- package/dist/assets/{MultiRunWindow-rggd5jvJ.js → MultiRunWindow-CVI6D2LM.js} +1 -1
- package/dist/assets/{OnboardingScreen-DTr_WxYY.js → OnboardingScreen-CG2xI_UT.js} +1 -1
- package/dist/assets/{OverlayScrollbar-C4VUlRzo.js → OverlayScrollbar-piA-chKb.js} +1 -1
- package/dist/assets/{SettingsView-DWeiBwOG.js → SettingsView-Bx-5WRtO.js} +11 -11
- package/dist/assets/{SettingsWindow-1csE2lF6.js → SettingsWindow-Cj6sYyvK.js} +1 -1
- package/dist/assets/{TerminalView-mF-mbAzo.js → TerminalView-DW4OxMaM.js} +1 -1
- package/dist/assets/{ToolOutputDialog-BvgdBVst.js → ToolOutputDialog-DxKGYhQ6.js} +1 -1
- package/dist/assets/{appThemeRegistry-CiQ61T5d.js → appThemeRegistry-DlEr4DLc.js} +1 -1
- package/dist/assets/{button-C3292Ee6.js → button-_ReBqWzC.js} +1 -1
- package/dist/assets/{capgoAdapter-DLi2tcmI.js → capgoAdapter-Onw1miMh.js} +1 -1
- package/dist/assets/{collapsible-B0yvtXQR.js → collapsible-BRKOX_ML.js} +1 -1
- package/dist/assets/{diagram-Ddq5F6R_.js → diagram-C9F3kAJt.js} +1 -1
- package/dist/assets/{dialog-DrgcVFLG.js → dialog-NsOVcGdh.js} +1 -1
- package/dist/assets/{dropdown-menu.styles-CeLR2UTs.js → dropdown-menu.styles-CjPDePJF.js} +1 -1
- package/dist/assets/{es-D0ZhEIQm.js → es-Cu6zoTXv.js} +1 -1
- package/dist/assets/{fileMentionTouchSelection-C9jpvVUn.js → fileMentionTouchSelection-B26MejYr.js} +1 -1
- package/dist/assets/{fr-Cx3Hkjq_.js → fr-DA4Apf6C.js} +1 -1
- package/dist/assets/{gitApi-nArpJO6q.js → gitApi-BXhXdWkh.js} +1 -1
- package/dist/assets/{input-DaOOTCQd.js → input-BI3Ya8O_.js} +1 -1
- package/dist/assets/{insertionBoundaries-BgHgsc1p.js → insertionBoundaries-BxSGE3B7.js} +1 -1
- package/dist/assets/{ja-BRvZxcKF.js → ja-DHQdrjZd.js} +1 -1
- package/dist/assets/{ko-HRfDZwXS.js → ko-DbAl47mv.js} +1 -1
- package/dist/assets/{main-R2wbcT-3.js → main-BdV8Awp-.js} +2 -2
- package/dist/assets/{main-D5JkjH8k.js → main-CGpFMQTy.js} +4 -4
- package/dist/assets/{markdownHeightCache-BwSTMSRn.js → markdownHeightCache-CHFSvA8u.js} +1 -1
- package/dist/assets/{mcpQueries-W-LFzCOw.js → mcpQueries-uZJFBhGj.js} +1 -1
- package/dist/assets/{miniChat-ChGISVuo.js → miniChat-B1aBBLiq.js} +2 -2
- package/dist/assets/{mobile-Dv3wbcd9.js → mobile-B8U8FARq.js} +2 -2
- package/dist/assets/{mobileBackNavigation-BnipJtFo.js → mobileBackNavigation-D2yUxPpG.js} +1 -1
- package/dist/assets/{multirun-DvSn-icg.js → multirun-DKsVtdZX.js} +1 -1
- package/dist/assets/native-config-Bpk4DOW1.js +1 -0
- package/dist/assets/{pl-CxLc1wGT.js → pl-CogXecG6.js} +1 -1
- package/dist/assets/{projectMeta-Cm0n6vtB.js → projectMeta-yox5XHhN.js} +1 -1
- package/dist/assets/{pt-BR-D4Lpwv4-.js → pt-BR-Ditt0LyE.js} +1 -1
- package/dist/assets/{renderElectronMiniChatApp-BjQyp-u8.js → renderElectronMiniChatApp-CdEZXhzq.js} +2 -2
- package/dist/assets/{renderMobileApp-BEkWDH7L.js → renderMobileApp-BoV5wjPF.js} +4 -4
- package/dist/assets/runtimeConfig-B8s9sTX_.js +2 -0
- package/dist/assets/{runtimeEndpointReset-BYn28E2A.js → runtimeEndpointReset-BswmG9Bb.js} +2 -2
- package/dist/assets/{scheduledTaskNavigation-C6UYwVbD.js → scheduledTaskNavigation-DUskP6qh.js} +1 -1
- package/dist/assets/{sessionChangeSummary-DXpoQiGE.js → sessionChangeSummary-BGbmGpQw.js} +1 -1
- package/dist/assets/{sessionLookup-BYycaYEQ.js → sessionLookup-CGJA6W7O.js} +1 -1
- package/dist/assets/{sortable-tabs-strip-BMrSDJob.js → sortable-tabs-strip-Benojjgi.js} +1 -1
- package/dist/assets/{speechSettingsQueries-Bv08BFlI.js → speechSettingsQueries-CjTT-adl.js} +1 -1
- package/dist/assets/{store-CZu30-QE.js → store-szlu5Wxv.js} +2 -2
- package/dist/assets/{textarea-BcA4uouw.js → textarea-C5vjnZcE.js} +1 -1
- package/dist/assets/{tooltip-DGUZtHif.js → tooltip-C73L9gDf.js} +1 -1
- package/dist/assets/{types-Q_utERET.js → types-Bu1xM0fS.js} +1 -1
- package/dist/assets/{uk-BdjdFLjV.js → uk-DFoTnIxi.js} +1 -1
- package/dist/assets/{useAppFontEffects-HYIeI-xf.js → useAppFontEffects-D6yauGdg.js} +5 -5
- package/dist/assets/{useDesktopWindowControlsLayout-Cc-2uuN5.js → useDesktopWindowControlsLayout-SKHaFoVu.js} +1 -1
- package/dist/assets/{useEffectiveDirectory-BBb97raM.js → useEffectiveDirectory-D6GwXhDS.js} +1 -1
- package/dist/assets/{useMobileNavigationStore-CEVJSNnR.js → useMobileNavigationStore-ByrZJd5L.js} +6 -6
- package/dist/assets/{useWorkerHighlightedLines-D8JkeSuf.js → useWorkerHighlightedLines-CwC34Jql.js} +1 -1
- package/dist/assets/{zh-CN-BIC0OlRu.js → zh-CN-Cw2OYvFl.js} +1 -1
- package/dist/assets/{zh-TW-Bavvf14t.js → zh-TW-CPuXOw_f.js} +1 -1
- package/dist/index.html +5 -4
- package/dist/mini-chat.html +5 -4
- package/dist/mobile.html +5 -4
- package/package.json +1 -1
- package/dist/assets/MobileTabPageHeader-CDFE4Ws4.js +0 -2
- package/dist/assets/runtimeConfig-D3moXtPz.js +0 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{at as t,dt as n,ot as r,pt as i,rn as a,ut as o}from"./persistence-Dzooc9Xg.js";import{it as s,nt as c,rt as l}from"./vendor-base-ui-CdzJ6My_.js";import{n as u,t as d}from"./platform-7bX6qtBV.js";import{n as f}from"./vendor-react-BP2cRVqX.js";import{a as p,n as m}from"./vendor-aparajita-capacitor-secure-storage-xol_6BsB.js";import{f as h,n as g}from"./vendor-reactuses-core-BpfIZ1tg.js";import{f as _,r as v,t as y}from"./button-C3292Ee6.js";import{Br as b,Rr as x,wa as S}from"./useMobileNavigationStore-CEVJSNnR.js";import{n as C}from"./Icon-jsQQXouE.js";import{d as w}from"./image-loading-23c-W-bq.js";import{a as ee,o as te}from"./dropdown-menu.styles-CeLR2UTs.js";import{i as T,t as E}from"./textarea-BcA4uouw.js";import{t as D}from"./LoadingImage-BG9q4Tm_.js";var O=e(s(),1),k=f(),A=l(),ne=e(c(),1),j=p(`YuriMedia`);function re(e){return e.platform===`android`||/Android/i.test(e.userAgent)||e.userAgentDataPlatform===`Android`}function M(){if(typeof window>`u`)return!1;let e=navigator.userAgentData;return re({platform:d(),userAgent:navigator.userAgent||``,userAgentDataPlatform:e?.platform})}function N(){return u()&&m.getPlatform()===`android`&&m.isPluginAvailable(`YuriMedia`)}async function ie(e){if(!N())return null;let t=await j.pickMedia({limit:e});if(t.cancelled)return[];let n=[];for(let e of t.files){let t=await fetch(m.convertFileSrc(e.path));if(!t.ok)throw Error(`Native media fetch failed (${t.status})`);let r=await t.blob();n.push(new File([r],e.name,{type:e.mimeType}))}return n}var P=`h-auto min-h-12 w-full justify-start gap-3 rounded-none supports-[corner-shape:squircle]:rounded-none px-4 border-b border-[var(--surface-subtle)] last:border-b-0`,ae=e=>{let t=(0,k.c)(38),{id:n,open:r,onOpenChange:i,onPickPhotos:a,onPickFiles:o}=e,{t:s}=_(),c;t[0]===s?c=t[1]:(c=s(`chat.chatInput.actions.addAttachment`),t[0]=s,t[1]=c);let l;t[2]===c?l=t[3]:(l=(0,A.jsx)(`h2`,{className:`truncate typography-ui-label font-semibold`,children:c}),t[2]=c,t[3]=l);let u;t[4]===s?u=t[5]:(u=s(`chat.chatInput.actions.addAttachment`),t[4]=s,t[5]=u);let d;t[6]===s?d=t[7]:(d=s(`mobile.surface.closeAria`),t[6]=s,t[7]=d);let f;t[8]===s?f=t[9]:(f=s(`mobile.sessions.sheet.resizeAria`),t[8]=s,t[9]=f);let p;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,A.jsx)(C,{name:`file-image`,className:`size-5 flex-shrink-0 text-muted-foreground`}),t[10]=p):p=t[10];let m;t[11]===s?m=t[12]:(m=s(`chat.chatInput.actions.attachPhotos`),t[11]=s,t[12]=m);let h;t[13]===m?h=t[14]:(h=(0,A.jsx)(`span`,{className:`truncate`,children:m}),t[13]=m,t[14]=h);let g;t[15]!==a||t[16]!==h?(g=(0,A.jsxs)(y,{type:`button`,variant:`ghost`,size:`lg`,className:P,"data-mobile-press-feedback":`none`,onClick:a,children:[p,h]}),t[15]=a,t[16]=h,t[17]=g):g=t[17];let v;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,A.jsx)(C,{name:`attachment-2`,className:`size-5 flex-shrink-0 text-muted-foreground`}),t[18]=v):v=t[18];let b;t[19]===s?b=t[20]:(b=s(`chat.chatInput.actions.attachFiles`),t[19]=s,t[20]=b);let x;t[21]===b?x=t[22]:(x=(0,A.jsx)(`span`,{className:`truncate`,children:b}),t[21]=b,t[22]=x);let S;t[23]!==o||t[24]!==x?(S=(0,A.jsxs)(y,{type:`button`,variant:`ghost`,size:`lg`,className:P,"data-mobile-press-feedback":`none`,onClick:o,children:[v,x]}),t[23]=o,t[24]=x,t[25]=S):S=t[25];let w;t[26]!==S||t[27]!==g?(w=(0,A.jsx)(`div`,{className:`flex min-h-0 flex-col overflow-y-auto overscroll-contain px-3 pb-3`,children:(0,A.jsxs)(`div`,{className:`overflow-hidden rounded-2xl bg-[var(--surface-muted)]`,"data-page-scroll-lock":`true`,children:[g,S]})}),t[26]=S,t[27]=g,t[28]=w):w=t[28];let ee;return t[29]!==n||t[30]!==i||t[31]!==r||t[32]!==w||t[33]!==l||t[34]!==u||t[35]!==d||t[36]!==f?(ee=(0,A.jsx)(T,{id:n,open:r,onOpenChange:i,title:l,ariaLabel:u,closeAriaLabel:d,resizeAriaLabel:f,fitContent:!0,children:w}),t[29]=n,t[30]=i,t[31]=r,t[32]=w,t[33]=l,t[34]=u,t[35]=d,t[36]=f,t[37]=ee):ee=t[37],ee},F={glyph:`_glyph_1xs2e_1`,lens:`_lens_1xs2e_12`,shape:`_shape_1xs2e_21`,revolve:`_revolve_1xs2e_1`};function oe(e){let t=(0,k.c)(18),{decorative:n,size:r}=e,i=n!==void 0&&n,a=r===void 0?20:r,{t:o}=_(),s;t[0]===a?s=t[1]:(s={width:a,height:a},t[0]=a,t[1]=s);let c=i||void 0,l=i?void 0:`img`,u;t[2]!==i||t[3]!==o?(u=i?void 0:o(`common.loading`),t[2]=i,t[3]=o,t[4]=u):u=t[4];let d=`scale(${a/28})`,f;t[5]===d?f=t[6]:(f={transform:d},t[5]=d,t[6]=f);let p,m,h;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,A.jsx)(`span`,{className:F.shape}),p=(0,A.jsx)(`span`,{className:F.shape}),m=(0,A.jsx)(`span`,{className:F.shape}),t[7]=p,t[8]=m,t[9]=h):(p=t[7],m=t[8],h=t[9]);let g;t[10]===f?g=t[11]:(g=(0,A.jsxs)(`span`,{className:F.lens,style:f,children:[h,p,m]}),t[10]=f,t[11]=g);let v;return t[12]!==g||t[13]!==s||t[14]!==c||t[15]!==l||t[16]!==u?(v=(0,A.jsx)(`span`,{"data-dictation-loading":!0,className:F.glyph,style:s,"aria-hidden":c,role:l,"aria-label":u,children:g}),t[12]=g,t[13]=s,t[14]=c,t[15]=l,t[16]=u,t[17]=v):v=t[17],v}var I=w(!1).colors,se=`M-50 74.564 A600 600 0 0 1 147.707 22.283 A38 38 0 0 1 154.330 97.994 A524 524 0 0 0 -18.333 143.653 Z`,ce=`M450 74.564 A600 600 0 0 0 252.293 22.283 A38 38 0 0 0 245.670 97.994 A524 524 0 0 1 418.333 143.653 Z`,le={colorScheme:`light`,"--surface-background":I.surface.background,"--surface-foreground":I.surface.foreground,"--primary-base":I.primary.base,"--foreground":I.surface.background,"--interactive-hover":`color-mix(in srgb, var(--surface-background) 12%, transparent)`,"--interactive-active":`color-mix(in srgb, var(--surface-background) 20%, transparent)`,"--ring":I.interactive.focusRing,"--status-error":I.status.error};function L(e){let t=(0,k.c)(85),{containerRef:n,disabled:r,onInsert:i,onSend:a,onRelease:o,onError:s,onHintChange:c}=e,{t:l}=_(),[u,d]=(0,O.useState)(!1),[f,p]=(0,O.useState)(!1),[m,h]=(0,O.useState)(`edit`),v=(0,O.useRef)(null),y=(0,O.useRef)(null),x=(0,O.useRef)(`insert`),S=(0,O.useRef)(null),C=(0,O.useId)(),w=(0,O.useId)(),te=(0,O.useId)(),T;t[0]!==i||t[1]!==a?(T=e=>x.current===`send`?a(e):i(e),t[0]=i,t[1]=a,t[2]=T):T=t[2];let E;t[3]!==s||t[4]!==T?(E={onTranscript:T,onError:s},t[3]=s,t[4]=T,t[5]=E):E=t[5];let D=ee(E),{status:j,isStarting:re,partialTranscript:M,error:N,volume:ie}=D,P=g(c),ae=u?m===`cancel`?`cancelling`:m===`edit`?`editing`:`recording`:f?`processing`:null,F,I;t[6]!==ae||t[7]!==P?(F=()=>{P(ae)},I=[ae,P],t[6]=ae,t[7]=P,t[8]=F,t[9]=I):(F=t[8],I=t[9]),(0,O.useEffect)(F,I);let L,de;t[10]===P?(L=t[11],de=t[12]):(L=()=>()=>P(null),de=[P],t[10]=P,t[11]=L,t[12]=de),(0,O.useEffect)(L,de);let fe;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(fe=()=>{y.current&&clearTimeout(y.current),y.current=null},t[13]=fe):fe=t[13];let R=g(fe),z;t[14]!==n||t[15]!==r?(z=e=>{if(r||!(e instanceof HTMLElement))return null;let t=n.current?.querySelector(`textarea`);return!t||t.value!==``||t.disabled||t.readOnly||e!==t&&!e.closest(`[data-yuri-composer-compact-surface]`)||e.closest(`button, [data-composer-action]`)?null:t},t[14]=n,t[15]=r,t[16]=z):z=t[16];let B=g(z),pe;t[17]!==R||t[18]!==D||t[19]!==N||t[20]!==f||t[21]!==j?(pe=()=>{f||(R(),v.current=null,d(!1),h(`edit`),j===`failed`||j===`idle`&&N?D.discardFailedDictation():D.cancelDictation())},t[17]=R,t[18]=D,t[19]=N,t[20]=f,t[21]=j,t[22]=pe):pe=t[22];let V=g(pe),me;t[23]!==D||t[24]!==r||t[25]!==B||t[26]!==f||t[27]!==j?(me=e=>{let t=e.target;r||f||j!==`idle`||v.current||!e.isPrimary||e.button!==0||!(t instanceof HTMLElement)||B(t)&&(e.preventDefault(),e.stopPropagation(),v.current={pointer:e.pointerId,x:e.clientX,y:e.clientY,intent:`edit`,started:!1},y.current=setTimeout(()=>{if(y.current=null,!v.current)return;let e=B(t);if(!e){v.current=null;return}e.blur(),v.current.started=!0,x.current=`insert`,d(!0),h(`edit`),D.startDictation()},300))},t[23]=D,t[24]=r,t[25]=B,t[26]=f,t[27]=j,t[28]=me):me=t[28];let H=g(me),he;t[29]===R?he=t[30]:(he=e=>{let t=v.current;if(!t||t.pointer!==e.pointerId)return;e.preventDefault(),e.stopPropagation();let n=e.clientX-t.x,r=S.current?.getBoundingClientRect(),i=r&&r.width>0&&e.clientY>=r.top&&e.clientY<=r.bottom?e.clientX<r.left+r.width/2?`cancel`:`send`:n<=-64?`cancel`:n>=64?`send`:`edit`;if(!t.started&&Math.hypot(n,t.y-e.clientY)>12){R(),v.current=null;return}t.started&&i!==t.intent&&(t.intent=i,h(i),b(i===`edit`?`light`:`medium`,{bypassCadence:!0}))},t[29]=R,t[30]=he);let ge=g(he),_e;t[31]!==V||t[32]!==R||t[33]!==n||t[34]!==D||t[35]!==N||t[36]!==o||t[37]!==M||t[38]!==j?(_e=e=>{let t=v.current;if(!(!t||t.pointer!==e.pointerId)){if(e.preventDefault(),e.stopPropagation(),R(),N||j===`failed`){V();return}v.current=null,d(!1),t.started?t.intent===`cancel`?D.cancelDictation():(x.current=t.intent===`edit`?`insert`:`send`,o(M),p(!0),Promise.resolve(D.confirmDictation()).finally(()=>{p(!1),D.discardFailedDictation(),t.intent===`edit`&&n.current?.querySelector(`textarea`)?.focus()})):n.current?.querySelector(`textarea`)?.focus()}},t[31]=V,t[32]=R,t[33]=n,t[34]=D,t[35]=N,t[36]=o,t[37]=M,t[38]=j,t[39]=_e):_e=t[39];let ve=g(_e),U;t[40]===V?U=t[41]:(U=e=>{v.current?.pointer===e.pointerId&&V()},t[40]=V,t[41]=U);let W=g(U),ye;t[42]===B?ye=t[43]:(ye=e=>{B(e.target)&&e.preventDefault()},t[42]=B,t[43]=ye);let G=g(ye),K,q;t[44]!==V||t[45]!==R||t[46]!==n||t[47]!==H||t[48]!==W||t[49]!==ge||t[50]!==G||t[51]!==ve?(K=()=>{let e=n.current;if(!e)return;let t=()=>{document.visibilityState===`hidden`&&V()};return e.addEventListener(`pointerdown`,H,!0),e.addEventListener(`touchstart`,G,{capture:!0,passive:!1}),window.addEventListener(`pointermove`,ge,{capture:!0,passive:!1}),window.addEventListener(`pointerup`,ve,!0),window.addEventListener(`pointercancel`,W,!0),e.addEventListener(`contextmenu`,G,!0),e.addEventListener(`selectstart`,G,!0),window.addEventListener(`blur`,V),document.addEventListener(`visibilitychange`,t),()=>{R(),e.removeEventListener(`pointerdown`,H,!0),e.removeEventListener(`touchstart`,G,!0),window.removeEventListener(`pointermove`,ge,!0),window.removeEventListener(`pointerup`,ve,!0),window.removeEventListener(`pointercancel`,W,!0),e.removeEventListener(`contextmenu`,G,!0),e.removeEventListener(`selectstart`,G,!0),window.removeEventListener(`blur`,V),document.removeEventListener(`visibilitychange`,t)}},q=[n,H,ge,ve,W,V,R,G],t[44]=V,t[45]=R,t[46]=n,t[47]=H,t[48]=W,t[49]=ge,t[50]=G,t[51]=ve,t[52]=K,t[53]=q):(K=t[52],q=t[53]),(0,O.useEffect)(K,q);let be,J;if(t[54]!==V||t[55]!==r?(be=()=>{r&&V()},J=[r,V],t[54]=V,t[55]=r,t[56]=be,t[57]=J):(be=t[56],J=t[57]),(0,O.useEffect)(be,J),!u&&!f)return null;let xe=Math.min(1,Math.max(0,ie))**.6,Se=!!N,Ce=N?V:void 0,we;t[58]===xe?we=t[59]:(we={...le,"--speech-energy":xe},t[58]=xe,t[59]=we);let Te=we,Y;t[60]===Symbol.for(`react.memo_cache_sentinel`)?(Y=(0,A.jsx)(`div`,{className:`yuri-speech-light-field`,"aria-hidden":`true`,children:[`ice`,`lilac`,`mint`,`blush`,`mid`,`core`].map(ue)}),t[60]=Y):Y=t[60];let Ee=re||f,X;t[61]!==N||t[62]!==re||t[63]!==M||t[64]!==f||t[65]!==j||t[66]!==l?(X=N&&!f?(0,A.jsx)(`p`,{role:`alert`,className:`yuri-speech-caption yuri-speech-error`,children:N}):(0,A.jsx)(`div`,{role:`status`,"aria-live":`polite`,"aria-atomic":`true`,className:`yuri-speech-caption`,children:re||f?(0,A.jsx)(oe,{size:72}):M?(0,A.jsx)(`span`,{className:`yuri-speech-interim`,children:M}):l(j===`uploading`?`chat.dictation.processing`:`chat.dictation.listening`)}),t[61]=N,t[62]=re,t[63]=M,t[64]=f,t[65]=j,t[66]=l,t[67]=X):X=t[67];let Z;t[68]!==Ee||t[69]!==X?(Z=(0,A.jsx)(`div`,{className:`yuri-speech-content`,"data-starting":Ee,children:X}),t[68]=Ee,t[69]=X,t[70]=Z):Z=t[70];let Q;t[71]!==C||t[72]!==w||t[73]!==te||t[74]!==u||t[75]!==m||t[76]!==l?(Q=u&&(0,A.jsx)(`div`,{className:`yuri-speech-gesture-stage`,"aria-hidden":`true`,children:(0,A.jsxs)(`div`,{className:`yuri-speech-gesture-surfaces`,children:[(0,A.jsx)(`div`,{className:`yuri-speech-target-glass`,style:{clipPath:`url(#${w})`}}),(0,A.jsx)(`div`,{className:`yuri-speech-target-glass`,style:{clipPath:`url(#${te})`}}),(0,A.jsxs)(`svg`,{className:`yuri-speech-geometry`,viewBox:`0 0 400 226`,focusable:`false`,children:[(0,A.jsxs)(`defs`,{children:[(0,A.jsx)(`clipPath`,{id:w,clipPathUnits:`objectBoundingBox`,children:(0,A.jsx)(`path`,{transform:`scale(0.0025 0.004424778761)`,d:se})}),(0,A.jsx)(`clipPath`,{id:te,clipPathUnits:`objectBoundingBox`,children:(0,A.jsx)(`path`,{transform:`scale(0.0025 0.004424778761)`,d:ce})}),(0,A.jsxs)(`linearGradient`,{id:C,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,A.jsx)(`stop`,{offset:`0%`,className:`yuri-speech-arc-top`}),(0,A.jsx)(`stop`,{offset:`100%`,className:`yuri-speech-arc-bottom`})]})]}),(0,A.jsxs)(`g`,{className:`yuri-speech-targets`,ref:S,children:[(0,A.jsxs)(`g`,{className:`yuri-speech-target yuri-speech-target--cancel`,"data-active":m===`cancel`,children:[(0,A.jsx)(`path`,{d:se}),(0,A.jsx)(`text`,{x:`95`,y:`68`,textAnchor:`middle`,dominantBaseline:`central`,transform:`rotate(-11 95 68)`,children:l(`chat.dictation.cancelGesture`)})]}),(0,A.jsxs)(`g`,{className:`yuri-speech-target yuri-speech-target--send`,"data-active":m===`send`,children:[(0,A.jsx)(`path`,{d:ce}),(0,A.jsx)(`text`,{x:`305`,y:`68`,textAnchor:`middle`,dominantBaseline:`central`,transform:`rotate(11 305 68)`,children:l(`chat.dictation.send`)})]})]}),(0,A.jsx)(`path`,{className:`yuri-speech-hold-arc`,fill:`url(#${C})`,d:`M-50 186.987 A500 500 0 0 1 450 186.987 L450 300 H-50 Z`})]})]})}),t[71]=C,t[72]=w,t[73]=te,t[74]=u,t[75]=m,t[76]=l,t[77]=Q):Q=t[77];let $;return t[78]!==m||t[79]!==Se||t[80]!==Ce||t[81]!==Te||t[82]!==Z||t[83]!==Q?($=(0,ne.createPortal)((0,A.jsxs)(`div`,{className:`yuri-speech-overlay`,"data-intent":m,"data-error":Se,onClick:Ce,style:Te,children:[Y,Z,Q]}),document.body),t[78]=m,t[79]=Se,t[80]=Ce,t[81]=Te,t[82]=Z,t[83]=Q,t[84]=$):$=t[84],$}function ue(e){return(0,A.jsx)(`div`,{className:`yuri-speech-reactor yuri-speech-reactor--${e}`,children:(0,A.jsx)(`div`,{className:`yuri-speech-light`})},e)}function de(e){let t=(0,k.c)(7),{available:n}=e,r=S(fe),[i,o]=(0,O.useState)(null),s;t[0]!==n||t[1]!==r?(s=n&&r&&!a()&&te(),t[0]=n,t[1]=r,t[2]=s):s=t[2];let c=s,l=c?i:null,u;return t[3]!==c||t[4]!==r||t[5]!==l?(u={globallyEnabled:r,enabled:c,hint:l,onHintChange:o},t[3]=c,t[4]=r,t[5]=l,t[6]=u):u=t[6],u}function fe(e){return e.dictationEnabled}var R=O.createContext(null),z=e=>{let t=(0,k.c)(3),{actions:n,children:r}=e,i;return t[0]!==n||t[1]!==r?(i=(0,A.jsx)(R.Provider,{value:n,children:r}),t[0]=n,t[1]=r,t[2]=i):i=t[2],i},B=()=>O.useContext(R),pe=e=>e.nativeEvent.isComposing||e.nativeEvent.keyCode===229;function V(e){let t=(0,k.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:r,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===r?a=t[5]:(a=v(`inline-flex shrink-0 items-center justify-center rounded-full bg-foreground text-background`,r),t[4]=r,t[5]=a);let o;return t[6]!==n||t[7]!==i||t[8]!==a?(o=(0,A.jsx)(`span`,{className:a,...i,"aria-hidden":!0,children:n}),t[6]=n,t[7]=i,t[8]=a,t[9]=o):o=t[9],o}function me(e){let t=(0,k.c)(7),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,A.jsx)(`span`,{"data-stop-glyph":`true`,className:`block size-[38%] rounded-[20%] bg-current`}),t[3]=i):i=t[3];let a;return t[4]!==n||t[5]!==r?(a=(0,A.jsx)(V,{className:n,...r,children:i}),t[4]=n,t[5]=r,t[6]=a):a=t[6],a}function H(e){let t=(0,k.c)(13),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,spinning:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=i!==void 0&&i,o=a?`loader-4`:`arrow-up`,s=a?`size-[50%] animate-spin`:`size-[56%]`,c;t[4]===s?c=t[5]:(c=v(s),t[4]=s,t[5]=c);let l;t[6]!==o||t[7]!==c?(l=(0,A.jsx)(C,{name:o,weight:`medium`,className:c}),t[6]=o,t[7]=c,t[8]=l):l=t[8];let u;return t[9]!==n||t[10]!==r||t[11]!==l?(u=(0,A.jsx)(V,{className:n,...r,children:l}),t[9]=n,t[10]=r,t[11]=l,t[12]=u):u=t[12],u}var he=O.forwardRef((e,t)=>{let n=(0,k.c)(19),r,i,a,o,s,c;n[0]===e?(r=n[1],i=n[2],a=n[3],o=n[4],s=n[5],c=n[6]):({children:r,className:i,expanded:s,focusedTone:c,style:o,...a}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a,n[4]=o,n[5]=s,n[6]=c);let l=s!==void 0&&s,u=c===void 0?`primary`:c,d=l&&`min-h-0 flex-1`,f=u===`info`?`focus-within:ring-[var(--status-info)]`:`focus-within:ring-primary/50`,p;n[7]!==i||n[8]!==d||n[9]!==f?(p=v(`relative flex flex-col overflow-visible border border-border/80 focus-within:ring-1`,d,f,i),n[7]=i,n[8]=d,n[9]=f,n[10]=p):p=n[10];let m;n[11]===o?m=n[12]:(m={borderRadius:`var(--radius-xl)`,backgroundColor:`var(--surface-subtle)`,...o},n[11]=o,n[12]=m);let h;return n[13]!==r||n[14]!==a||n[15]!==t||n[16]!==p||n[17]!==m?(h=(0,A.jsx)(`div`,{ref:t,className:p,style:m,...a,children:r}),n[13]=r,n[14]=a,n[15]=t,n[16]=p,n[17]=m,n[18]=h):h=n[18],h});he.displayName=`ChatComposerSurface`;var ge=O.forwardRef((e,t)=>{let n=(0,k.c)(3),r;return n[0]!==e||n[1]!==t?(r=(0,A.jsx)(E,{ref:t,...e}),n[0]=e,n[1]=t,n[2]=r):r=n[2],r});ge.displayName=`ChatPromptTextarea`;var _e=e=>{let t=(0,k.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:r,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===r?a=t[5]:(a=v(`flex shrink-0 items-center gap-2 bg-transparent px-2.5 py-1.5`,r),t[4]=r,t[5]=a);let o;return t[6]!==n||t[7]!==i||t[8]!==a?(o=(0,A.jsx)(`div`,{className:a,"data-chat-input-footer":`true`,...i,children:n}),t[6]=n,t[7]=i,t[8]=a,t[9]=o):o=t[9],o},ve=(e,t)=>{typeof e==`function`?e(t):e&&(e.current=t)},U=({value:e,attachments:t=[],disabled:n=!1,pending:r=!1,placeholder:i,isMobile:a=!1,onChange:o,onSubmit:s,onStop:c,onAddFiles:l,onRemoveAttachment:u,addFilesLabel:d,removeAttachmentLabel:f,fileAccept:p=`image/*`,sendLabel:m,stopLabel:y,hint:b,leftControls:S,rightControls:w,footerContent:ee,inputHeader:te,attachmentContent:T,highlightedContent:E,highlightRef:k,inputRef:ne,textareaProps:j,textLayoutClassName:re,inputClassName:P,inputOuterClassName:F,inputStyle:oe,footerClassName:I,footerStyle:se,contentClassName:ce,inputSectionClassName:le,autoResize:L=!0,disableInputWhilePending:ue=!0,layout:de=`stacked`,children:fe,className:R,expanded:z=!1,...B})=>{let{t:V}=_(),U=de===`inline`,[W,ye]=O.useState(!1),[G,K]=O.useState(!1),q=M(),be=t.length>0||W,J=O.useRef(null),xe=O.useRef(null),Se=O.useRef(null),Ce=O.useId().replace(/:/g,``),we=g(()=>{if(!L||z||j?.fillContainer){U&&ye(!1);return}let e=J.current;if(!e)return;e.style.height=U?`0px`:`auto`;let t=Number.parseFloat(window.getComputedStyle(e).maxHeight),n=U?Math.max(e.scrollHeight,48):e.scrollHeight,r=Number.isFinite(t)?Math.min(n,t):n;e.style.height=`${r}px`,e.style.overflowY=Number.isFinite(t)&&n>t?`auto`:`hidden`;let i=r>48;U&&ye(e=>e===i?e:i)});O.useLayoutEffect(()=>{we()},[L,z,U,j?.fillContainer,e]),h(U&&L&&!z&&!j?.fillContainer?J:null,we);let Te=e=>{j?.onKeyDown?.(e),!(e.defaultPrevented||pe(e))&&e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),!n&&(!r||!ue)&&s())},Y=e=>{l?.(e.target.files),e.target.value=``},Ee=g(()=>{J.current?.blur(),K(!0)}),X=g(e=>{K(!1),requestAnimationFrame(()=>e?.click())}),Z=g(()=>{K(!1),requestAnimationFrame(()=>{(async()=>{if(!N()){Se.current?.click();return}try{let e=await ie(20);if(e===null){Se.current?.click();return}e.length>0&&l?.(e)}catch(e){console.error(`Native photo pick failed`,e),x.error(V(`chat.chatInput.toast.attachFileFailed`))}})()})}),Q=e.trim().length>0||t.length>0,$=t.filter(e=>e.mime.startsWith(`image/`)),De=t.filter(e=>!e.mime.startsWith(`image/`)),Oe=l?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`input`,{ref:xe,type:`file`,accept:p,multiple:!0,className:`hidden`,onChange:Y}),q?(0,A.jsx)(`input`,{ref:Se,type:`file`,accept:`image/*`,multiple:!0,className:`hidden`,onChange:Y}):null,(0,A.jsx)(`button`,{type:`button`,className:`flex size-8 shrink-0 items-center justify-center rounded-md text-foreground outline-none hover:bg-[var(--interactive-hover)] disabled:cursor-not-allowed disabled:opacity-40`,onClick:()=>q?Ee():xe.current?.click(),onMouseDown:a?e=>e.preventDefault():void 0,onPointerDownCapture:a?e=>e.preventDefault():void 0,disabled:n||r,"aria-label":d,children:(0,A.jsx)(C,{name:`attachment-2`,className:`size-[18px]`})})]}):null,ke=!n&&!r&&Q,Ae=a?`size-6`:`size-full`,je=r&&c?(0,A.jsx)(`button`,{type:`button`,"data-composer-stop":`true`,className:`flex size-8 shrink-0 items-center justify-center rounded-full outline-none hover:opacity-80`,onClick:c,"aria-label":y,children:(0,A.jsx)(me,{className:Ae})}):(0,A.jsx)(`button`,{type:`submit`,"data-composer-send":`true`,"data-composer-circle":ke?`true`:void 0,className:v(`flex size-8 shrink-0 items-center justify-center outline-none`,ke?`rounded-full hover:opacity-80`:`rounded-md text-primary hover:bg-[var(--interactive-hover)] disabled:cursor-not-allowed disabled:opacity-30`),disabled:n||r||!Q,"aria-label":m,children:ke?(0,A.jsx)(H,{className:Ae}):(0,A.jsx)(C,{name:r?`loader-4`:`send-plane-2`,className:v(`size-4`,r&&`animate-spin`)})}),Me=r&&c?(0,A.jsx)(`button`,{type:`button`,"data-composer-stop":`true`,className:`flex size-8 shrink-0 items-center justify-center rounded-full outline-none hover:opacity-80`,onClick:c,"aria-label":y,children:(0,A.jsx)(me,{className:Ae})}):(0,A.jsx)(`button`,{type:`submit`,"data-composer-send":`true`,"data-composer-circle":`true`,className:v(`flex size-8 shrink-0 items-center justify-center rounded-full outline-none`,ke?`hover:opacity-80`:`cursor-not-allowed opacity-30`),disabled:n||r||!Q,"aria-busy":r||void 0,"aria-label":m,children:(0,A.jsx)(H,{className:Ae,spinning:r})}),Ne=U?Me:je,Pe=S===void 0?Oe:S;return(0,A.jsxs)(he,{className:R,expanded:z,...B,children:[fe,(0,A.jsxs)(`div`,{"data-composer-content":`true`,"data-composer-layout":de,className:v(`relative flex min-h-0`,U?v(`min-h-12 flex-row`,be?`items-end`:`items-center`):`flex-col`,z&&`flex-1`,ce),children:[U&&Pe?(0,A.jsx)(`div`,{className:`flex h-12 shrink-0 items-center pl-1.5`,"data-composer-inline-attach":`true`,children:Pe}):null,(0,A.jsxs)(`div`,{className:v(`overflow-hidden`,U&&`min-w-0 flex-1`,z&&`flex min-h-0 flex-1 flex-col`,le),children:[te,T,$.length>0?(0,A.jsx)(`div`,{className:`flex gap-2 overflow-x-auto px-3 pt-3`,"data-chat-prompt-attachments":`true`,children:$.map(e=>(0,A.jsxs)(`div`,{className:`group relative shrink-0`,children:[(0,A.jsx)(`span`,{className:`block size-16`,children:(0,A.jsx)(D,{fill:!0,src:e.url,alt:e.name,className:`size-16 rounded-lg border border-border object-cover`})}),u?(0,A.jsx)(`button`,{type:`button`,className:`absolute -right-1 -top-1 flex size-6 items-center justify-center rounded-full border border-border bg-[var(--surface-elevated)] shadow-sm hover:bg-[var(--interactive-hover)]`,onClick:()=>u(e.id),"aria-label":f,children:(0,A.jsx)(C,{name:`close`,className:`size-3`})}):null]},e.id))}):null,De.length>0?(0,A.jsx)(`div`,{className:`flex flex-wrap gap-2 px-3 pt-3`,"data-chat-prompt-file-attachments":`true`,children:De.map(e=>(0,A.jsxs)(`div`,{className:`relative flex max-w-[12rem] items-center gap-1.5 rounded-lg border border-border bg-[var(--surface-elevated)] px-2 py-1`,children:[(0,A.jsx)(C,{name:`file-text`,className:`size-3.5 shrink-0 text-muted-foreground`}),(0,A.jsx)(`span`,{className:`min-w-0 truncate typography-micro`,children:e.name}),u?(0,A.jsx)(`button`,{type:`button`,className:`flex size-5 shrink-0 items-center justify-center rounded-full text-muted-foreground hover:bg-[var(--interactive-hover)]`,onClick:()=>u(e.id),"aria-label":f,children:(0,A.jsx)(C,{name:`close`,className:`size-3`})}):null]},e.id))}):null,(0,A.jsxs)(`div`,{className:v(`relative overflow-hidden`,U&&v(`flex min-h-12`,W?`items-end`:`items-center`),z&&`flex min-h-0 flex-1 flex-col`),"data-composer-input-shell":`true`,children:[E?(0,A.jsx)(`div`,{ref:k,"aria-hidden":!0,"data-composer-highlight":`true`,className:v(`pointer-events-none absolute inset-0 z-0 rounded-b-none`,re,P),children:E}):null,(0,A.jsx)(ge,{...j,simple:!0,fillContainer:!U&&j?.fillContainer,ref:e=>{J.current=e,ve(ne,e)},"data-chat-input":`true`,value:e,onChange:e=>o(e.target.value,e),onKeyDown:Te,disabled:n||r&&ue,placeholder:i,enterKeyHint:a?`send`:j?.enterKeyHint,outerClassName:v(`ring-0 bg-transparent shadow-none hover:bg-transparent focus-within:ring-0`,U&&`flex-none`,z&&`min-h-0 flex-1`,F),className:v(`relative z-10 resize-none overflow-y-hidden appearance-none border-0 bg-transparent typography-markdown hover:border-transparent md:typography-ui-label`,U?`field-sizing-fixed min-h-12 max-h-32 px-3 py-3 leading-6`:`min-h-[52px] max-h-40 rounded-b-none px-3 pb-2 pt-4`,re,P,E&&`text-transparent caret-[var(--surface-foreground)]`),style:oe,rows:j?.rows??1})]})]}),U?(0,A.jsx)(`div`,{className:v(`flex h-12 shrink-0 items-center pr-1.5`,I),style:se,"data-composer-inline-send":`true`,children:w??Ne}):(0,A.jsx)(_e,{className:I,style:se,children:ee??(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`div`,{className:`flex items-center gap-1.5`,children:S??Oe}),b?(0,A.jsx)(`div`,{className:`min-w-0 flex-1 truncate typography-micro text-muted-foreground`,children:b}):(0,A.jsx)(`div`,{className:`flex-1`}),(0,A.jsx)(`div`,{className:`flex items-center gap-1.5`,children:w??Ne})]})})]}),q&&l?(0,A.jsx)(ae,{id:`mobile-attach-pick-${Ce}`,open:G,onOpenChange:e=>{e||K(!1)},onPickPhotos:Z,onPickFiles:()=>X(xe.current)}):null]})},W={dictation:102,mentionFile:100,mentionAgent:100,mentionSession:100,mentionCommand:100,mentionPaste:100,code:90,codeFence:90,link:80,linkUrl:78,heading:70,blockquote:40,listMarker:35,marker:10},ye={dictation:`text-foreground underline decoration-current underline-offset-4`,mentionFile:`text-[var(--primary)]`,mentionAgent:`text-[var(--primary)]`,mentionSession:`text-[var(--primary)]`,mentionCommand:`text-[var(--primary)]`,mentionPaste:`text-[var(--primary)]`,code:`rounded-[3px] bg-[var(--surface-subtle)] text-[var(--markdown-inline-code)]`,codeFence:`bg-[var(--surface-subtle)] text-[var(--markdown-inline-code)]`,link:`text-[var(--status-info)] underline`,linkUrl:`text-muted-foreground`,heading:`text-[var(--syntax-keyword)]`,blockquote:`text-muted-foreground`,listMarker:`text-[var(--syntax-keyword)]`,marker:`text-muted-foreground`},G=`text-foreground`;function K(e,t){if(!e||t.length===0)return null;let n=e.length,r=new Set([0,n]);for(let e of t)e.start>0&&e.start<n&&r.add(e.start),e.end>0&&e.end<n&&r.add(e.end);let a=[...r].sort((e,t)=>e-t),o=t.map((e,t)=>({range:e,index:t})).filter(e=>e.range.end>e.range.start).sort((e,t)=>e.range.start-t.range.start),s=[],c=[],l=0;for(let t=0;t<a.length-1;t+=1){let n=a[t],r=a[t+1];if(r<=n)continue;for(;l<o.length&&o[l].range.start<=n;)c.push(o[l]),l+=1;for(let e=c.length-1;e>=0;--e)c[e].range.end<=n&&c.splice(e,1);let u=null,d=-1,f=1/0;for(let{range:e,index:t}of c){let n=e.priority??W[e.style];(n>d||n===d&&t<f)&&(d=n,f=t,u=e)}let p=u?u.className??ye[u.style]:G,m=e.slice(n,r),h=u?.visual,g=u?.skillName,_=s[s.length-1];_&&_.className===p&&i(_.visual,h)&&_.skillName===g?_.text+=m:s.push({text:m,className:p,visual:h,skillName:g})}return s.length>0?s:null}function q(e,t){let n=new Set(Array.from(t,e=>e.toLowerCase())),r=[];for(let t of[/(^|\s)\/(\u2003)?([a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?)/gi,/(^|\s)@(\u2003)?([a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?)(?=$|\s|[),.;:!?])/gi]){let i;for(;(i=t.exec(e))!==null;){let e=i[2]??``,t=i[3]||``;if(!n.has(t.toLowerCase()))continue;let a=i.index+(i[1]?.length??0);r.push({start:a,end:a+1+e.length+t.length,name:t})}}return r}function be(e,t,n){if(e===t){let t=n.find(t=>e>t.start&&e<t.end);return t?{start:t.start,end:t.end}:null}let r=n.filter(n=>n.start<t&&n.end>e);return r.length===0?null:{start:Math.min(e,...r.map(e=>e.start)),end:Math.max(t,...r.map(e=>e.end))}}function J(e,t,n){let r=q(e,t),i=Math.max(0,Math.min(n.selectionStart,e.length)),a=Math.max(i,Math.min(n.selectionEnd,e.length)),o=i,s=a;if(i===a)if(n.altKey)if(n.key===`Backspace`){for(;o>0&&/\s/.test(e[o-1]);)--o;for(;o>0&&!/\s/.test(e[o-1]);)--o}else{for(;s<e.length&&/\s/.test(e[s]);)s+=1;for(;s<e.length&&!/\s/.test(e[s]);)s+=1}else n.key===`Backspace`?o=Math.max(0,i-1):s=Math.min(e.length,i+1);if(o===s)return null;let c=r.filter(e=>e.start<s&&e.end>o);if(c.length===0)return null;let l=Math.min(o,...c.map(e=>e.start)),u=Math.max(s,...c.map(e=>e.end));return u<e.length&&/\s/.test(e[u])&&(l===0||/\s/.test(e[l-1]))?u+=1:u===e.length&&l>0&&/\s/.test(e[l-1])&&--l,{text:`${e.slice(0,l)}${e.slice(u)}`,caret:l,removedSkillNames:c.map(e=>e.name)}}function xe(e){return e.map(e=>({start:e.start,end:e.end,style:e.kind===`file`?`mentionFile`:e.kind===`session`?`mentionSession`:`mentionAgent`,visual:e.kind===`session`&&e.label?n({trigger:`@`,icon:`chat-thread`,label:e.label},o({trigger:`@`,icon:`chat-thread`,label:e.label})):void 0}))}function Se(e){let n=(0,k.c)(28),{visual:i,text:a}=e,o=i.trigger.length,s=o+i.label.length,c=s+(i.suffix?.length??0),l;n[0]!==s||n[1]!==o||n[2]!==a?(l=a.slice(o,Math.min(s,a.length)),n[0]=s,n[1]=o,n[2]=a,n[3]=l):l=n[3];let u=l,d;n[4]!==s||n[5]!==c||n[6]!==a?(d=a.slice(s,Math.min(c,a.length)),n[4]=s,n[5]=c,n[6]=a,n[7]=d):d=n[7];let f=d,p;n[8]!==c||n[9]!==a?(p=a.slice(Math.min(c,a.length)),n[8]=c,n[9]=a,n[10]=p):p=n[10];let m=p,h;n[11]===Symbol.for(`react.memo_cache_sentinel`)?(h={left:t,right:t},n[11]=h):h=n[11];let g=i.icon,_;n[12]===g?_=n[13]:(_=(0,A.jsx)(`span`,{className:`pointer-events-none absolute inset-y-0 inline-flex items-center justify-center`,style:h,children:(0,A.jsx)(C,{name:g,className:`${r} shrink-0 text-[var(--primary)]`,"aria-hidden":`true`})}),n[12]=g,n[13]=_);let v;n[14]!==_||n[15]!==i.trigger?(v=(0,A.jsxs)(`span`,{className:`relative inline-block align-baseline text-transparent leading-none`,children:[i.trigger,_]}),n[14]=_,n[15]=i.trigger,n[16]=v):v=n[16];let y;n[17]===u?y=n[18]:(y=(0,A.jsx)(`span`,{children:u}),n[17]=u,n[18]=y);let b;n[19]===f?b=n[20]:(b=f?(0,A.jsx)(`span`,{className:`text-transparent`,children:f}):null,n[19]=f,n[20]=b);let x;n[21]===m?x=n[22]:(x=m?(0,A.jsx)(`span`,{className:`text-transparent`,children:m}):null,n[21]=m,n[22]=x);let S;return n[23]!==x||n[24]!==v||n[25]!==y||n[26]!==b?(S=(0,A.jsxs)(A.Fragment,{children:[v,y,b,x]}),n[23]=x,n[24]=v,n[25]=y,n[26]=b,n[27]=S):S=n[27],S}var Ce=e=>({text:e.text,references:e.references.map(e=>({...e}))}),we=e=>e.map(e=>({...e,range:{...e.range}})),Te=(e,t)=>e.text===t.text&&JSON.stringify(e.references)===JSON.stringify(t.references),Y=(e,t,n)=>({document:Ce(e),mentions:we(t),selection:{...n}}),Ee=()=>({undo:[],redo:[]}),X=(e,t)=>({undo:[...e.undo,t].slice(-100),redo:[]}),Z=(e,t)=>{let n=e.undo.at(-1);return!n||!Te(n.after.document,t)?null:{history:{undo:e.undo.slice(0,-1),redo:[...e.redo,n]},snapshot:Y(n.before.document,n.before.mentions,n.before.selection)}},Q=(e,t)=>{let n=e.redo.at(-1);return!n||!Te(n.before.document,t)?null:{history:{undo:[...e.undo,n],redo:e.redo.slice(0,-1)},snapshot:Y(n.after.document,n.after.mentions,n.after.selection)}},$=e=>{if(e.altKey||e.ctrlKey||e.metaKey)return!1;switch(e.key){case`ArrowUp`:case`PageUp`:case`Home`:return!0;default:return!1}},De=(e,t,n)=>{let r=t instanceof Element?t:t instanceof Node?t.parentElement:null;for(;r&&r!==e;){if(r instanceof HTMLElement){let e=r.scrollHeight-r.clientHeight;if(e>1&&(n===`up`?r.scrollTop>0:r.scrollTop<e-1))return!0}r=r.parentElement}return!1},Oe=(e,t)=>De(e,t,`up`),ke=(e,t)=>De(e,t,`down`),Ae=e=>{if(typeof e!=`number`||!Number.isFinite(e))return;let t=Math.trunc(e);return t>=0?t:void 0},je=e=>{if(!e||typeof e!=`object`||Array.isArray(e))return null;let t=e.summary;return!t||typeof t!=`object`||Array.isArray(t)?null:t},Me=e=>{let t=Ae(e);return t!==void 0&&t>0?t:void 0};function Ne(e){let t=je(e);if(!t)return null;let n=Me(t.additions),r=Me(t.deletions),i=Me(t.files)??Me(t.diffCount);return n===void 0&&r===void 0&&i===void 0?null:{...n===void 0?{}:{additions:n},...r===void 0?{}:{deletions:r},...i===void 0?{}:{files:i}}}function Pe(e){if(!e)return null;let t=[];return e.additions!==void 0&&e.additions>0&&t.push(`+${e.additions}`),e.deletions!==void 0&&e.deletions>0&&t.push(`−${e.deletions}`),t.length>0?t.join(` `):null}function Fe(e){if(!e||typeof e!=`object`||Array.isArray(e))return null;let t=e,n=typeof t.providerID==`string`?t.providerID.trim():``,r=typeof t.modelID==`string`?t.modelID.trim():``;if(n&&r)return`${n}/${r}`;let i=t.model;if(typeof i==`string`&&i.trim())return i.trim();if(i&&typeof i==`object`&&!Array.isArray(i)){let e=i,t=typeof e.providerID==`string`?e.providerID.trim():typeof e.provider==`string`?e.provider.trim():``,n=typeof e.modelID==`string`?e.modelID.trim():typeof e.id==`string`?e.id.trim():``;if(t&&n)return`${t}/${n}`}return null}function Ie(e){if(!e||typeof e!=`object`||Array.isArray(e))return null;let t=e;if(typeof t.branch==`string`&&t.branch.trim())return t.branch.trim();let n=t.project;if(n&&typeof n==`object`&&!Array.isArray(n)){let e=n.branch;if(typeof e==`string`&&e.trim())return e.trim()}return null}export{ie as A,z as C,oe as D,L as E,ae as O,pe as S,de as T,be as _,$ as a,H as b,Y as c,Q as d,Z as f,xe as g,q as h,Fe as i,M as j,N as k,Ee as l,K as m,Ie as n,ke as o,Se as p,Ne as r,Oe as s,Pe as t,X as u,J as v,B as w,me as x,U as y};
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{at as t,dt as n,ot as r,pt as i,rn as a,ut as o}from"./persistence-Dzooc9Xg.js";import{it as s,nt as c,rt as l}from"./vendor-base-ui-CdzJ6My_.js";import{n as u,t as d}from"./platform-7bX6qtBV.js";import{n as f}from"./vendor-react-BP2cRVqX.js";import{a as p,n as m}from"./vendor-aparajita-capacitor-secure-storage-xol_6BsB.js";import{f as h,n as g}from"./vendor-reactuses-core-BpfIZ1tg.js";import{f as _,r as v,t as y}from"./button-_ReBqWzC.js";import{Br as b,Rr as x,wa as S}from"./useMobileNavigationStore-ByrZJd5L.js";import{n as C}from"./Icon-2cKLcXGe.js";import{d as w}from"./image-loading-23c-W-bq.js";import{a as ee,o as te}from"./dropdown-menu.styles-CjPDePJF.js";import{i as T,t as E}from"./textarea-C5vjnZcE.js";import{t as D}from"./LoadingImage-B-cD_lfU.js";var O=e(s(),1),k=f(),A=l(),ne=e(c(),1),j=p(`YuriMedia`);function re(e){return e.platform===`android`||/Android/i.test(e.userAgent)||e.userAgentDataPlatform===`Android`}function M(){if(typeof window>`u`)return!1;let e=navigator.userAgentData;return re({platform:d(),userAgent:navigator.userAgent||``,userAgentDataPlatform:e?.platform})}function N(){return u()&&m.getPlatform()===`android`&&m.isPluginAvailable(`YuriMedia`)}async function ie(e){if(!N())return null;let t=await j.pickMedia({limit:e});if(t.cancelled)return[];let n=[];for(let e of t.files){let t=await fetch(m.convertFileSrc(e.path));if(!t.ok)throw Error(`Native media fetch failed (${t.status})`);let r=await t.blob();n.push(new File([r],e.name,{type:e.mimeType}))}return n}var P=`h-auto min-h-12 w-full justify-start gap-3 rounded-none supports-[corner-shape:squircle]:rounded-none px-4 border-b border-[var(--surface-subtle)] last:border-b-0`,ae=e=>{let t=(0,k.c)(38),{id:n,open:r,onOpenChange:i,onPickPhotos:a,onPickFiles:o}=e,{t:s}=_(),c;t[0]===s?c=t[1]:(c=s(`chat.chatInput.actions.addAttachment`),t[0]=s,t[1]=c);let l;t[2]===c?l=t[3]:(l=(0,A.jsx)(`h2`,{className:`truncate typography-ui-label font-semibold`,children:c}),t[2]=c,t[3]=l);let u;t[4]===s?u=t[5]:(u=s(`chat.chatInput.actions.addAttachment`),t[4]=s,t[5]=u);let d;t[6]===s?d=t[7]:(d=s(`mobile.surface.closeAria`),t[6]=s,t[7]=d);let f;t[8]===s?f=t[9]:(f=s(`mobile.sessions.sheet.resizeAria`),t[8]=s,t[9]=f);let p;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,A.jsx)(C,{name:`file-image`,className:`size-5 flex-shrink-0 text-muted-foreground`}),t[10]=p):p=t[10];let m;t[11]===s?m=t[12]:(m=s(`chat.chatInput.actions.attachPhotos`),t[11]=s,t[12]=m);let h;t[13]===m?h=t[14]:(h=(0,A.jsx)(`span`,{className:`truncate`,children:m}),t[13]=m,t[14]=h);let g;t[15]!==a||t[16]!==h?(g=(0,A.jsxs)(y,{type:`button`,variant:`ghost`,size:`lg`,className:P,"data-mobile-press-feedback":`none`,onClick:a,children:[p,h]}),t[15]=a,t[16]=h,t[17]=g):g=t[17];let v;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,A.jsx)(C,{name:`attachment-2`,className:`size-5 flex-shrink-0 text-muted-foreground`}),t[18]=v):v=t[18];let b;t[19]===s?b=t[20]:(b=s(`chat.chatInput.actions.attachFiles`),t[19]=s,t[20]=b);let x;t[21]===b?x=t[22]:(x=(0,A.jsx)(`span`,{className:`truncate`,children:b}),t[21]=b,t[22]=x);let S;t[23]!==o||t[24]!==x?(S=(0,A.jsxs)(y,{type:`button`,variant:`ghost`,size:`lg`,className:P,"data-mobile-press-feedback":`none`,onClick:o,children:[v,x]}),t[23]=o,t[24]=x,t[25]=S):S=t[25];let w;t[26]!==S||t[27]!==g?(w=(0,A.jsx)(`div`,{className:`flex min-h-0 flex-col overflow-y-auto overscroll-contain px-3 pb-3`,children:(0,A.jsxs)(`div`,{className:`overflow-hidden rounded-2xl bg-[var(--surface-muted)]`,"data-page-scroll-lock":`true`,children:[g,S]})}),t[26]=S,t[27]=g,t[28]=w):w=t[28];let ee;return t[29]!==n||t[30]!==i||t[31]!==r||t[32]!==w||t[33]!==l||t[34]!==u||t[35]!==d||t[36]!==f?(ee=(0,A.jsx)(T,{id:n,open:r,onOpenChange:i,title:l,ariaLabel:u,closeAriaLabel:d,resizeAriaLabel:f,fitContent:!0,children:w}),t[29]=n,t[30]=i,t[31]=r,t[32]=w,t[33]=l,t[34]=u,t[35]=d,t[36]=f,t[37]=ee):ee=t[37],ee},F={glyph:`_glyph_1xs2e_1`,lens:`_lens_1xs2e_12`,shape:`_shape_1xs2e_21`,revolve:`_revolve_1xs2e_1`};function oe(e){let t=(0,k.c)(18),{decorative:n,size:r}=e,i=n!==void 0&&n,a=r===void 0?20:r,{t:o}=_(),s;t[0]===a?s=t[1]:(s={width:a,height:a},t[0]=a,t[1]=s);let c=i||void 0,l=i?void 0:`img`,u;t[2]!==i||t[3]!==o?(u=i?void 0:o(`common.loading`),t[2]=i,t[3]=o,t[4]=u):u=t[4];let d=`scale(${a/28})`,f;t[5]===d?f=t[6]:(f={transform:d},t[5]=d,t[6]=f);let p,m,h;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,A.jsx)(`span`,{className:F.shape}),p=(0,A.jsx)(`span`,{className:F.shape}),m=(0,A.jsx)(`span`,{className:F.shape}),t[7]=p,t[8]=m,t[9]=h):(p=t[7],m=t[8],h=t[9]);let g;t[10]===f?g=t[11]:(g=(0,A.jsxs)(`span`,{className:F.lens,style:f,children:[h,p,m]}),t[10]=f,t[11]=g);let v;return t[12]!==g||t[13]!==s||t[14]!==c||t[15]!==l||t[16]!==u?(v=(0,A.jsx)(`span`,{"data-dictation-loading":!0,className:F.glyph,style:s,"aria-hidden":c,role:l,"aria-label":u,children:g}),t[12]=g,t[13]=s,t[14]=c,t[15]=l,t[16]=u,t[17]=v):v=t[17],v}var I=w(!1).colors,se=`M-50 74.564 A600 600 0 0 1 147.707 22.283 A38 38 0 0 1 154.330 97.994 A524 524 0 0 0 -18.333 143.653 Z`,ce=`M450 74.564 A600 600 0 0 0 252.293 22.283 A38 38 0 0 0 245.670 97.994 A524 524 0 0 1 418.333 143.653 Z`,le={colorScheme:`light`,"--surface-background":I.surface.background,"--surface-foreground":I.surface.foreground,"--primary-base":I.primary.base,"--foreground":I.surface.background,"--interactive-hover":`color-mix(in srgb, var(--surface-background) 12%, transparent)`,"--interactive-active":`color-mix(in srgb, var(--surface-background) 20%, transparent)`,"--ring":I.interactive.focusRing,"--status-error":I.status.error};function L(e){let t=(0,k.c)(85),{containerRef:n,disabled:r,onInsert:i,onSend:a,onRelease:o,onError:s,onHintChange:c}=e,{t:l}=_(),[u,d]=(0,O.useState)(!1),[f,p]=(0,O.useState)(!1),[m,h]=(0,O.useState)(`edit`),v=(0,O.useRef)(null),y=(0,O.useRef)(null),x=(0,O.useRef)(`insert`),S=(0,O.useRef)(null),C=(0,O.useId)(),w=(0,O.useId)(),te=(0,O.useId)(),T;t[0]!==i||t[1]!==a?(T=e=>x.current===`send`?a(e):i(e),t[0]=i,t[1]=a,t[2]=T):T=t[2];let E;t[3]!==s||t[4]!==T?(E={onTranscript:T,onError:s},t[3]=s,t[4]=T,t[5]=E):E=t[5];let D=ee(E),{status:j,isStarting:re,partialTranscript:M,error:N,volume:ie}=D,P=g(c),ae=u?m===`cancel`?`cancelling`:m===`edit`?`editing`:`recording`:f?`processing`:null,F,I;t[6]!==ae||t[7]!==P?(F=()=>{P(ae)},I=[ae,P],t[6]=ae,t[7]=P,t[8]=F,t[9]=I):(F=t[8],I=t[9]),(0,O.useEffect)(F,I);let L,de;t[10]===P?(L=t[11],de=t[12]):(L=()=>()=>P(null),de=[P],t[10]=P,t[11]=L,t[12]=de),(0,O.useEffect)(L,de);let fe;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(fe=()=>{y.current&&clearTimeout(y.current),y.current=null},t[13]=fe):fe=t[13];let R=g(fe),z;t[14]!==n||t[15]!==r?(z=e=>{if(r||!(e instanceof HTMLElement))return null;let t=n.current?.querySelector(`textarea`);return!t||t.value!==``||t.disabled||t.readOnly||e!==t&&!e.closest(`[data-yuri-composer-compact-surface]`)||e.closest(`button, [data-composer-action]`)?null:t},t[14]=n,t[15]=r,t[16]=z):z=t[16];let B=g(z),pe;t[17]!==R||t[18]!==D||t[19]!==N||t[20]!==f||t[21]!==j?(pe=()=>{f||(R(),v.current=null,d(!1),h(`edit`),j===`failed`||j===`idle`&&N?D.discardFailedDictation():D.cancelDictation())},t[17]=R,t[18]=D,t[19]=N,t[20]=f,t[21]=j,t[22]=pe):pe=t[22];let V=g(pe),me;t[23]!==D||t[24]!==r||t[25]!==B||t[26]!==f||t[27]!==j?(me=e=>{let t=e.target;r||f||j!==`idle`||v.current||!e.isPrimary||e.button!==0||!(t instanceof HTMLElement)||B(t)&&(e.preventDefault(),e.stopPropagation(),v.current={pointer:e.pointerId,x:e.clientX,y:e.clientY,intent:`edit`,started:!1},y.current=setTimeout(()=>{if(y.current=null,!v.current)return;let e=B(t);if(!e){v.current=null;return}e.blur(),v.current.started=!0,x.current=`insert`,d(!0),h(`edit`),D.startDictation()},300))},t[23]=D,t[24]=r,t[25]=B,t[26]=f,t[27]=j,t[28]=me):me=t[28];let H=g(me),he;t[29]===R?he=t[30]:(he=e=>{let t=v.current;if(!t||t.pointer!==e.pointerId)return;e.preventDefault(),e.stopPropagation();let n=e.clientX-t.x,r=S.current?.getBoundingClientRect(),i=r&&r.width>0&&e.clientY>=r.top&&e.clientY<=r.bottom?e.clientX<r.left+r.width/2?`cancel`:`send`:n<=-64?`cancel`:n>=64?`send`:`edit`;if(!t.started&&Math.hypot(n,t.y-e.clientY)>12){R(),v.current=null;return}t.started&&i!==t.intent&&(t.intent=i,h(i),b(i===`edit`?`light`:`medium`,{bypassCadence:!0}))},t[29]=R,t[30]=he);let ge=g(he),_e;t[31]!==V||t[32]!==R||t[33]!==n||t[34]!==D||t[35]!==N||t[36]!==o||t[37]!==M||t[38]!==j?(_e=e=>{let t=v.current;if(!(!t||t.pointer!==e.pointerId)){if(e.preventDefault(),e.stopPropagation(),R(),N||j===`failed`){V();return}v.current=null,d(!1),t.started?t.intent===`cancel`?D.cancelDictation():(x.current=t.intent===`edit`?`insert`:`send`,o(M),p(!0),Promise.resolve(D.confirmDictation()).finally(()=>{p(!1),D.discardFailedDictation(),t.intent===`edit`&&n.current?.querySelector(`textarea`)?.focus()})):n.current?.querySelector(`textarea`)?.focus()}},t[31]=V,t[32]=R,t[33]=n,t[34]=D,t[35]=N,t[36]=o,t[37]=M,t[38]=j,t[39]=_e):_e=t[39];let ve=g(_e),U;t[40]===V?U=t[41]:(U=e=>{v.current?.pointer===e.pointerId&&V()},t[40]=V,t[41]=U);let W=g(U),ye;t[42]===B?ye=t[43]:(ye=e=>{B(e.target)&&e.preventDefault()},t[42]=B,t[43]=ye);let G=g(ye),K,q;t[44]!==V||t[45]!==R||t[46]!==n||t[47]!==H||t[48]!==W||t[49]!==ge||t[50]!==G||t[51]!==ve?(K=()=>{let e=n.current;if(!e)return;let t=()=>{document.visibilityState===`hidden`&&V()};return e.addEventListener(`pointerdown`,H,!0),e.addEventListener(`touchstart`,G,{capture:!0,passive:!1}),window.addEventListener(`pointermove`,ge,{capture:!0,passive:!1}),window.addEventListener(`pointerup`,ve,!0),window.addEventListener(`pointercancel`,W,!0),e.addEventListener(`contextmenu`,G,!0),e.addEventListener(`selectstart`,G,!0),window.addEventListener(`blur`,V),document.addEventListener(`visibilitychange`,t),()=>{R(),e.removeEventListener(`pointerdown`,H,!0),e.removeEventListener(`touchstart`,G,!0),window.removeEventListener(`pointermove`,ge,!0),window.removeEventListener(`pointerup`,ve,!0),window.removeEventListener(`pointercancel`,W,!0),e.removeEventListener(`contextmenu`,G,!0),e.removeEventListener(`selectstart`,G,!0),window.removeEventListener(`blur`,V),document.removeEventListener(`visibilitychange`,t)}},q=[n,H,ge,ve,W,V,R,G],t[44]=V,t[45]=R,t[46]=n,t[47]=H,t[48]=W,t[49]=ge,t[50]=G,t[51]=ve,t[52]=K,t[53]=q):(K=t[52],q=t[53]),(0,O.useEffect)(K,q);let be,J;if(t[54]!==V||t[55]!==r?(be=()=>{r&&V()},J=[r,V],t[54]=V,t[55]=r,t[56]=be,t[57]=J):(be=t[56],J=t[57]),(0,O.useEffect)(be,J),!u&&!f)return null;let xe=Math.min(1,Math.max(0,ie))**.6,Se=!!N,Ce=N?V:void 0,we;t[58]===xe?we=t[59]:(we={...le,"--speech-energy":xe},t[58]=xe,t[59]=we);let Te=we,Y;t[60]===Symbol.for(`react.memo_cache_sentinel`)?(Y=(0,A.jsx)(`div`,{className:`yuri-speech-light-field`,"aria-hidden":`true`,children:[`ice`,`lilac`,`mint`,`blush`,`mid`,`core`].map(ue)}),t[60]=Y):Y=t[60];let Ee=re||f,X;t[61]!==N||t[62]!==re||t[63]!==M||t[64]!==f||t[65]!==j||t[66]!==l?(X=N&&!f?(0,A.jsx)(`p`,{role:`alert`,className:`yuri-speech-caption yuri-speech-error`,children:N}):(0,A.jsx)(`div`,{role:`status`,"aria-live":`polite`,"aria-atomic":`true`,className:`yuri-speech-caption`,children:re||f?(0,A.jsx)(oe,{size:72}):M?(0,A.jsx)(`span`,{className:`yuri-speech-interim`,children:M}):l(j===`uploading`?`chat.dictation.processing`:`chat.dictation.listening`)}),t[61]=N,t[62]=re,t[63]=M,t[64]=f,t[65]=j,t[66]=l,t[67]=X):X=t[67];let Z;t[68]!==Ee||t[69]!==X?(Z=(0,A.jsx)(`div`,{className:`yuri-speech-content`,"data-starting":Ee,children:X}),t[68]=Ee,t[69]=X,t[70]=Z):Z=t[70];let Q;t[71]!==C||t[72]!==w||t[73]!==te||t[74]!==u||t[75]!==m||t[76]!==l?(Q=u&&(0,A.jsx)(`div`,{className:`yuri-speech-gesture-stage`,"aria-hidden":`true`,children:(0,A.jsxs)(`div`,{className:`yuri-speech-gesture-surfaces`,children:[(0,A.jsx)(`div`,{className:`yuri-speech-target-glass`,style:{clipPath:`url(#${w})`}}),(0,A.jsx)(`div`,{className:`yuri-speech-target-glass`,style:{clipPath:`url(#${te})`}}),(0,A.jsxs)(`svg`,{className:`yuri-speech-geometry`,viewBox:`0 0 400 226`,focusable:`false`,children:[(0,A.jsxs)(`defs`,{children:[(0,A.jsx)(`clipPath`,{id:w,clipPathUnits:`objectBoundingBox`,children:(0,A.jsx)(`path`,{transform:`scale(0.0025 0.004424778761)`,d:se})}),(0,A.jsx)(`clipPath`,{id:te,clipPathUnits:`objectBoundingBox`,children:(0,A.jsx)(`path`,{transform:`scale(0.0025 0.004424778761)`,d:ce})}),(0,A.jsxs)(`linearGradient`,{id:C,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,A.jsx)(`stop`,{offset:`0%`,className:`yuri-speech-arc-top`}),(0,A.jsx)(`stop`,{offset:`100%`,className:`yuri-speech-arc-bottom`})]})]}),(0,A.jsxs)(`g`,{className:`yuri-speech-targets`,ref:S,children:[(0,A.jsxs)(`g`,{className:`yuri-speech-target yuri-speech-target--cancel`,"data-active":m===`cancel`,children:[(0,A.jsx)(`path`,{d:se}),(0,A.jsx)(`text`,{x:`95`,y:`68`,textAnchor:`middle`,dominantBaseline:`central`,transform:`rotate(-11 95 68)`,children:l(`chat.dictation.cancelGesture`)})]}),(0,A.jsxs)(`g`,{className:`yuri-speech-target yuri-speech-target--send`,"data-active":m===`send`,children:[(0,A.jsx)(`path`,{d:ce}),(0,A.jsx)(`text`,{x:`305`,y:`68`,textAnchor:`middle`,dominantBaseline:`central`,transform:`rotate(11 305 68)`,children:l(`chat.dictation.send`)})]})]}),(0,A.jsx)(`path`,{className:`yuri-speech-hold-arc`,fill:`url(#${C})`,d:`M-50 186.987 A500 500 0 0 1 450 186.987 L450 300 H-50 Z`})]})]})}),t[71]=C,t[72]=w,t[73]=te,t[74]=u,t[75]=m,t[76]=l,t[77]=Q):Q=t[77];let $;return t[78]!==m||t[79]!==Se||t[80]!==Ce||t[81]!==Te||t[82]!==Z||t[83]!==Q?($=(0,ne.createPortal)((0,A.jsxs)(`div`,{className:`yuri-speech-overlay`,"data-intent":m,"data-error":Se,onClick:Ce,style:Te,children:[Y,Z,Q]}),document.body),t[78]=m,t[79]=Se,t[80]=Ce,t[81]=Te,t[82]=Z,t[83]=Q,t[84]=$):$=t[84],$}function ue(e){return(0,A.jsx)(`div`,{className:`yuri-speech-reactor yuri-speech-reactor--${e}`,children:(0,A.jsx)(`div`,{className:`yuri-speech-light`})},e)}function de(e){let t=(0,k.c)(7),{available:n}=e,r=S(fe),[i,o]=(0,O.useState)(null),s;t[0]!==n||t[1]!==r?(s=n&&r&&!a()&&te(),t[0]=n,t[1]=r,t[2]=s):s=t[2];let c=s,l=c?i:null,u;return t[3]!==c||t[4]!==r||t[5]!==l?(u={globallyEnabled:r,enabled:c,hint:l,onHintChange:o},t[3]=c,t[4]=r,t[5]=l,t[6]=u):u=t[6],u}function fe(e){return e.dictationEnabled}var R=O.createContext(null),z=e=>{let t=(0,k.c)(3),{actions:n,children:r}=e,i;return t[0]!==n||t[1]!==r?(i=(0,A.jsx)(R.Provider,{value:n,children:r}),t[0]=n,t[1]=r,t[2]=i):i=t[2],i},B=()=>O.useContext(R),pe=e=>e.nativeEvent.isComposing||e.nativeEvent.keyCode===229;function V(e){let t=(0,k.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:r,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===r?a=t[5]:(a=v(`inline-flex shrink-0 items-center justify-center rounded-full bg-foreground text-background`,r),t[4]=r,t[5]=a);let o;return t[6]!==n||t[7]!==i||t[8]!==a?(o=(0,A.jsx)(`span`,{className:a,...i,"aria-hidden":!0,children:n}),t[6]=n,t[7]=i,t[8]=a,t[9]=o):o=t[9],o}function me(e){let t=(0,k.c)(7),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,A.jsx)(`span`,{"data-stop-glyph":`true`,className:`block size-[38%] rounded-[20%] bg-current`}),t[3]=i):i=t[3];let a;return t[4]!==n||t[5]!==r?(a=(0,A.jsx)(V,{className:n,...r,children:i}),t[4]=n,t[5]=r,t[6]=a):a=t[6],a}function H(e){let t=(0,k.c)(13),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,spinning:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=i!==void 0&&i,o=a?`loader-4`:`arrow-up`,s=a?`size-[50%] animate-spin`:`size-[56%]`,c;t[4]===s?c=t[5]:(c=v(s),t[4]=s,t[5]=c);let l;t[6]!==o||t[7]!==c?(l=(0,A.jsx)(C,{name:o,weight:`medium`,className:c}),t[6]=o,t[7]=c,t[8]=l):l=t[8];let u;return t[9]!==n||t[10]!==r||t[11]!==l?(u=(0,A.jsx)(V,{className:n,...r,children:l}),t[9]=n,t[10]=r,t[11]=l,t[12]=u):u=t[12],u}var he=O.forwardRef((e,t)=>{let n=(0,k.c)(19),r,i,a,o,s,c;n[0]===e?(r=n[1],i=n[2],a=n[3],o=n[4],s=n[5],c=n[6]):({children:r,className:i,expanded:s,focusedTone:c,style:o,...a}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a,n[4]=o,n[5]=s,n[6]=c);let l=s!==void 0&&s,u=c===void 0?`primary`:c,d=l&&`min-h-0 flex-1`,f=u===`info`?`focus-within:ring-[var(--status-info)]`:`focus-within:ring-primary/50`,p;n[7]!==i||n[8]!==d||n[9]!==f?(p=v(`relative flex flex-col overflow-visible border border-border/80 focus-within:ring-1`,d,f,i),n[7]=i,n[8]=d,n[9]=f,n[10]=p):p=n[10];let m;n[11]===o?m=n[12]:(m={borderRadius:`var(--radius-xl)`,backgroundColor:`var(--surface-subtle)`,...o},n[11]=o,n[12]=m);let h;return n[13]!==r||n[14]!==a||n[15]!==t||n[16]!==p||n[17]!==m?(h=(0,A.jsx)(`div`,{ref:t,className:p,style:m,...a,children:r}),n[13]=r,n[14]=a,n[15]=t,n[16]=p,n[17]=m,n[18]=h):h=n[18],h});he.displayName=`ChatComposerSurface`;var ge=O.forwardRef((e,t)=>{let n=(0,k.c)(3),r;return n[0]!==e||n[1]!==t?(r=(0,A.jsx)(E,{ref:t,...e}),n[0]=e,n[1]=t,n[2]=r):r=n[2],r});ge.displayName=`ChatPromptTextarea`;var _e=e=>{let t=(0,k.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:r,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===r?a=t[5]:(a=v(`flex shrink-0 items-center gap-2 bg-transparent px-2.5 py-1.5`,r),t[4]=r,t[5]=a);let o;return t[6]!==n||t[7]!==i||t[8]!==a?(o=(0,A.jsx)(`div`,{className:a,"data-chat-input-footer":`true`,...i,children:n}),t[6]=n,t[7]=i,t[8]=a,t[9]=o):o=t[9],o},ve=(e,t)=>{typeof e==`function`?e(t):e&&(e.current=t)},U=({value:e,attachments:t=[],disabled:n=!1,pending:r=!1,placeholder:i,isMobile:a=!1,onChange:o,onSubmit:s,onStop:c,onAddFiles:l,onRemoveAttachment:u,addFilesLabel:d,removeAttachmentLabel:f,fileAccept:p=`image/*`,sendLabel:m,stopLabel:y,hint:b,leftControls:S,rightControls:w,footerContent:ee,inputHeader:te,attachmentContent:T,highlightedContent:E,highlightRef:k,inputRef:ne,textareaProps:j,textLayoutClassName:re,inputClassName:P,inputOuterClassName:F,inputStyle:oe,footerClassName:I,footerStyle:se,contentClassName:ce,inputSectionClassName:le,autoResize:L=!0,disableInputWhilePending:ue=!0,layout:de=`stacked`,children:fe,className:R,expanded:z=!1,...B})=>{let{t:V}=_(),U=de===`inline`,[W,ye]=O.useState(!1),[G,K]=O.useState(!1),q=M(),be=t.length>0||W,J=O.useRef(null),xe=O.useRef(null),Se=O.useRef(null),Ce=O.useId().replace(/:/g,``),we=g(()=>{if(!L||z||j?.fillContainer){U&&ye(!1);return}let e=J.current;if(!e)return;e.style.height=U?`0px`:`auto`;let t=Number.parseFloat(window.getComputedStyle(e).maxHeight),n=U?Math.max(e.scrollHeight,48):e.scrollHeight,r=Number.isFinite(t)?Math.min(n,t):n;e.style.height=`${r}px`,e.style.overflowY=Number.isFinite(t)&&n>t?`auto`:`hidden`;let i=r>48;U&&ye(e=>e===i?e:i)});O.useLayoutEffect(()=>{we()},[L,z,U,j?.fillContainer,e]),h(U&&L&&!z&&!j?.fillContainer?J:null,we);let Te=e=>{j?.onKeyDown?.(e),!(e.defaultPrevented||pe(e))&&e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),!n&&(!r||!ue)&&s())},Y=e=>{l?.(e.target.files),e.target.value=``},Ee=g(()=>{J.current?.blur(),K(!0)}),X=g(e=>{K(!1),requestAnimationFrame(()=>e?.click())}),Z=g(()=>{K(!1),requestAnimationFrame(()=>{(async()=>{if(!N()){Se.current?.click();return}try{let e=await ie(20);if(e===null){Se.current?.click();return}e.length>0&&l?.(e)}catch(e){console.error(`Native photo pick failed`,e),x.error(V(`chat.chatInput.toast.attachFileFailed`))}})()})}),Q=e.trim().length>0||t.length>0,$=t.filter(e=>e.mime.startsWith(`image/`)),De=t.filter(e=>!e.mime.startsWith(`image/`)),Oe=l?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`input`,{ref:xe,type:`file`,accept:p,multiple:!0,className:`hidden`,onChange:Y}),q?(0,A.jsx)(`input`,{ref:Se,type:`file`,accept:`image/*`,multiple:!0,className:`hidden`,onChange:Y}):null,(0,A.jsx)(`button`,{type:`button`,className:`flex size-8 shrink-0 items-center justify-center rounded-md text-foreground outline-none hover:bg-[var(--interactive-hover)] disabled:cursor-not-allowed disabled:opacity-40`,onClick:()=>q?Ee():xe.current?.click(),onMouseDown:a?e=>e.preventDefault():void 0,onPointerDownCapture:a?e=>e.preventDefault():void 0,disabled:n||r,"aria-label":d,children:(0,A.jsx)(C,{name:`attachment-2`,className:`size-[18px]`})})]}):null,ke=!n&&!r&&Q,Ae=a?`size-6`:`size-full`,je=r&&c?(0,A.jsx)(`button`,{type:`button`,"data-composer-stop":`true`,className:`flex size-8 shrink-0 items-center justify-center rounded-full outline-none hover:opacity-80`,onClick:c,"aria-label":y,children:(0,A.jsx)(me,{className:Ae})}):(0,A.jsx)(`button`,{type:`submit`,"data-composer-send":`true`,"data-composer-circle":ke?`true`:void 0,className:v(`flex size-8 shrink-0 items-center justify-center outline-none`,ke?`rounded-full hover:opacity-80`:`rounded-md text-primary hover:bg-[var(--interactive-hover)] disabled:cursor-not-allowed disabled:opacity-30`),disabled:n||r||!Q,"aria-label":m,children:ke?(0,A.jsx)(H,{className:Ae}):(0,A.jsx)(C,{name:r?`loader-4`:`send-plane-2`,className:v(`size-4`,r&&`animate-spin`)})}),Me=r&&c?(0,A.jsx)(`button`,{type:`button`,"data-composer-stop":`true`,className:`flex size-8 shrink-0 items-center justify-center rounded-full outline-none hover:opacity-80`,onClick:c,"aria-label":y,children:(0,A.jsx)(me,{className:Ae})}):(0,A.jsx)(`button`,{type:`submit`,"data-composer-send":`true`,"data-composer-circle":`true`,className:v(`flex size-8 shrink-0 items-center justify-center rounded-full outline-none`,ke?`hover:opacity-80`:`cursor-not-allowed opacity-30`),disabled:n||r||!Q,"aria-busy":r||void 0,"aria-label":m,children:(0,A.jsx)(H,{className:Ae,spinning:r})}),Ne=U?Me:je,Pe=S===void 0?Oe:S;return(0,A.jsxs)(he,{className:R,expanded:z,...B,children:[fe,(0,A.jsxs)(`div`,{"data-composer-content":`true`,"data-composer-layout":de,className:v(`relative flex min-h-0`,U?v(`min-h-12 flex-row`,be?`items-end`:`items-center`):`flex-col`,z&&`flex-1`,ce),children:[U&&Pe?(0,A.jsx)(`div`,{className:`flex h-12 shrink-0 items-center pl-1.5`,"data-composer-inline-attach":`true`,children:Pe}):null,(0,A.jsxs)(`div`,{className:v(`overflow-hidden`,U&&`min-w-0 flex-1`,z&&`flex min-h-0 flex-1 flex-col`,le),children:[te,T,$.length>0?(0,A.jsx)(`div`,{className:`flex gap-2 overflow-x-auto px-3 pt-3`,"data-chat-prompt-attachments":`true`,children:$.map(e=>(0,A.jsxs)(`div`,{className:`group relative shrink-0`,children:[(0,A.jsx)(`span`,{className:`block size-16`,children:(0,A.jsx)(D,{fill:!0,src:e.url,alt:e.name,className:`size-16 rounded-lg border border-border object-cover`})}),u?(0,A.jsx)(`button`,{type:`button`,className:`absolute -right-1 -top-1 flex size-6 items-center justify-center rounded-full border border-border bg-[var(--surface-elevated)] shadow-sm hover:bg-[var(--interactive-hover)]`,onClick:()=>u(e.id),"aria-label":f,children:(0,A.jsx)(C,{name:`close`,className:`size-3`})}):null]},e.id))}):null,De.length>0?(0,A.jsx)(`div`,{className:`flex flex-wrap gap-2 px-3 pt-3`,"data-chat-prompt-file-attachments":`true`,children:De.map(e=>(0,A.jsxs)(`div`,{className:`relative flex max-w-[12rem] items-center gap-1.5 rounded-lg border border-border bg-[var(--surface-elevated)] px-2 py-1`,children:[(0,A.jsx)(C,{name:`file-text`,className:`size-3.5 shrink-0 text-muted-foreground`}),(0,A.jsx)(`span`,{className:`min-w-0 truncate typography-micro`,children:e.name}),u?(0,A.jsx)(`button`,{type:`button`,className:`flex size-5 shrink-0 items-center justify-center rounded-full text-muted-foreground hover:bg-[var(--interactive-hover)]`,onClick:()=>u(e.id),"aria-label":f,children:(0,A.jsx)(C,{name:`close`,className:`size-3`})}):null]},e.id))}):null,(0,A.jsxs)(`div`,{className:v(`relative overflow-hidden`,U&&v(`flex min-h-12`,W?`items-end`:`items-center`),z&&`flex min-h-0 flex-1 flex-col`),"data-composer-input-shell":`true`,children:[E?(0,A.jsx)(`div`,{ref:k,"aria-hidden":!0,"data-composer-highlight":`true`,className:v(`pointer-events-none absolute inset-0 z-0 rounded-b-none`,re,P),children:E}):null,(0,A.jsx)(ge,{...j,simple:!0,fillContainer:!U&&j?.fillContainer,ref:e=>{J.current=e,ve(ne,e)},"data-chat-input":`true`,value:e,onChange:e=>o(e.target.value,e),onKeyDown:Te,disabled:n||r&&ue,placeholder:i,enterKeyHint:a?`send`:j?.enterKeyHint,outerClassName:v(`ring-0 bg-transparent shadow-none hover:bg-transparent focus-within:ring-0`,U&&`flex-none`,z&&`min-h-0 flex-1`,F),className:v(`relative z-10 resize-none overflow-y-hidden appearance-none border-0 bg-transparent typography-markdown hover:border-transparent md:typography-ui-label`,U?`field-sizing-fixed min-h-12 max-h-32 px-3 py-3 leading-6`:`min-h-[52px] max-h-40 rounded-b-none px-3 pb-2 pt-4`,re,P,E&&`text-transparent caret-[var(--surface-foreground)]`),style:oe,rows:j?.rows??1})]})]}),U?(0,A.jsx)(`div`,{className:v(`flex h-12 shrink-0 items-center pr-1.5`,I),style:se,"data-composer-inline-send":`true`,children:w??Ne}):(0,A.jsx)(_e,{className:I,style:se,children:ee??(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`div`,{className:`flex items-center gap-1.5`,children:S??Oe}),b?(0,A.jsx)(`div`,{className:`min-w-0 flex-1 truncate typography-micro text-muted-foreground`,children:b}):(0,A.jsx)(`div`,{className:`flex-1`}),(0,A.jsx)(`div`,{className:`flex items-center gap-1.5`,children:w??Ne})]})})]}),q&&l?(0,A.jsx)(ae,{id:`mobile-attach-pick-${Ce}`,open:G,onOpenChange:e=>{e||K(!1)},onPickPhotos:Z,onPickFiles:()=>X(xe.current)}):null]})},W={dictation:102,mentionFile:100,mentionAgent:100,mentionSession:100,mentionCommand:100,mentionPaste:100,code:90,codeFence:90,link:80,linkUrl:78,heading:70,blockquote:40,listMarker:35,marker:10},ye={dictation:`text-foreground underline decoration-current underline-offset-4`,mentionFile:`text-[var(--primary)]`,mentionAgent:`text-[var(--primary)]`,mentionSession:`text-[var(--primary)]`,mentionCommand:`text-[var(--primary)]`,mentionPaste:`text-[var(--primary)]`,code:`rounded-[3px] bg-[var(--surface-subtle)] text-[var(--markdown-inline-code)]`,codeFence:`bg-[var(--surface-subtle)] text-[var(--markdown-inline-code)]`,link:`text-[var(--status-info)] underline`,linkUrl:`text-muted-foreground`,heading:`text-[var(--syntax-keyword)]`,blockquote:`text-muted-foreground`,listMarker:`text-[var(--syntax-keyword)]`,marker:`text-muted-foreground`},G=`text-foreground`;function K(e,t){if(!e||t.length===0)return null;let n=e.length,r=new Set([0,n]);for(let e of t)e.start>0&&e.start<n&&r.add(e.start),e.end>0&&e.end<n&&r.add(e.end);let a=[...r].sort((e,t)=>e-t),o=t.map((e,t)=>({range:e,index:t})).filter(e=>e.range.end>e.range.start).sort((e,t)=>e.range.start-t.range.start),s=[],c=[],l=0;for(let t=0;t<a.length-1;t+=1){let n=a[t],r=a[t+1];if(r<=n)continue;for(;l<o.length&&o[l].range.start<=n;)c.push(o[l]),l+=1;for(let e=c.length-1;e>=0;--e)c[e].range.end<=n&&c.splice(e,1);let u=null,d=-1,f=1/0;for(let{range:e,index:t}of c){let n=e.priority??W[e.style];(n>d||n===d&&t<f)&&(d=n,f=t,u=e)}let p=u?u.className??ye[u.style]:G,m=e.slice(n,r),h=u?.visual,g=u?.skillName,_=s[s.length-1];_&&_.className===p&&i(_.visual,h)&&_.skillName===g?_.text+=m:s.push({text:m,className:p,visual:h,skillName:g})}return s.length>0?s:null}function q(e,t){let n=new Set(Array.from(t,e=>e.toLowerCase())),r=[];for(let t of[/(^|\s)\/(\u2003)?([a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?)/gi,/(^|\s)@(\u2003)?([a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?)(?=$|\s|[),.;:!?])/gi]){let i;for(;(i=t.exec(e))!==null;){let e=i[2]??``,t=i[3]||``;if(!n.has(t.toLowerCase()))continue;let a=i.index+(i[1]?.length??0);r.push({start:a,end:a+1+e.length+t.length,name:t})}}return r}function be(e,t,n){if(e===t){let t=n.find(t=>e>t.start&&e<t.end);return t?{start:t.start,end:t.end}:null}let r=n.filter(n=>n.start<t&&n.end>e);return r.length===0?null:{start:Math.min(e,...r.map(e=>e.start)),end:Math.max(t,...r.map(e=>e.end))}}function J(e,t,n){let r=q(e,t),i=Math.max(0,Math.min(n.selectionStart,e.length)),a=Math.max(i,Math.min(n.selectionEnd,e.length)),o=i,s=a;if(i===a)if(n.altKey)if(n.key===`Backspace`){for(;o>0&&/\s/.test(e[o-1]);)--o;for(;o>0&&!/\s/.test(e[o-1]);)--o}else{for(;s<e.length&&/\s/.test(e[s]);)s+=1;for(;s<e.length&&!/\s/.test(e[s]);)s+=1}else n.key===`Backspace`?o=Math.max(0,i-1):s=Math.min(e.length,i+1);if(o===s)return null;let c=r.filter(e=>e.start<s&&e.end>o);if(c.length===0)return null;let l=Math.min(o,...c.map(e=>e.start)),u=Math.max(s,...c.map(e=>e.end));return u<e.length&&/\s/.test(e[u])&&(l===0||/\s/.test(e[l-1]))?u+=1:u===e.length&&l>0&&/\s/.test(e[l-1])&&--l,{text:`${e.slice(0,l)}${e.slice(u)}`,caret:l,removedSkillNames:c.map(e=>e.name)}}function xe(e){return e.map(e=>({start:e.start,end:e.end,style:e.kind===`file`?`mentionFile`:e.kind===`session`?`mentionSession`:`mentionAgent`,visual:e.kind===`session`&&e.label?n({trigger:`@`,icon:`chat-thread`,label:e.label},o({trigger:`@`,icon:`chat-thread`,label:e.label})):void 0}))}function Se(e){let n=(0,k.c)(28),{visual:i,text:a}=e,o=i.trigger.length,s=o+i.label.length,c=s+(i.suffix?.length??0),l;n[0]!==s||n[1]!==o||n[2]!==a?(l=a.slice(o,Math.min(s,a.length)),n[0]=s,n[1]=o,n[2]=a,n[3]=l):l=n[3];let u=l,d;n[4]!==s||n[5]!==c||n[6]!==a?(d=a.slice(s,Math.min(c,a.length)),n[4]=s,n[5]=c,n[6]=a,n[7]=d):d=n[7];let f=d,p;n[8]!==c||n[9]!==a?(p=a.slice(Math.min(c,a.length)),n[8]=c,n[9]=a,n[10]=p):p=n[10];let m=p,h;n[11]===Symbol.for(`react.memo_cache_sentinel`)?(h={left:t,right:t},n[11]=h):h=n[11];let g=i.icon,_;n[12]===g?_=n[13]:(_=(0,A.jsx)(`span`,{className:`pointer-events-none absolute inset-y-0 inline-flex items-center justify-center`,style:h,children:(0,A.jsx)(C,{name:g,className:`${r} shrink-0 text-[var(--primary)]`,"aria-hidden":`true`})}),n[12]=g,n[13]=_);let v;n[14]!==_||n[15]!==i.trigger?(v=(0,A.jsxs)(`span`,{className:`relative inline-block align-baseline text-transparent leading-none`,children:[i.trigger,_]}),n[14]=_,n[15]=i.trigger,n[16]=v):v=n[16];let y;n[17]===u?y=n[18]:(y=(0,A.jsx)(`span`,{children:u}),n[17]=u,n[18]=y);let b;n[19]===f?b=n[20]:(b=f?(0,A.jsx)(`span`,{className:`text-transparent`,children:f}):null,n[19]=f,n[20]=b);let x;n[21]===m?x=n[22]:(x=m?(0,A.jsx)(`span`,{className:`text-transparent`,children:m}):null,n[21]=m,n[22]=x);let S;return n[23]!==x||n[24]!==v||n[25]!==y||n[26]!==b?(S=(0,A.jsxs)(A.Fragment,{children:[v,y,b,x]}),n[23]=x,n[24]=v,n[25]=y,n[26]=b,n[27]=S):S=n[27],S}var Ce=e=>({text:e.text,references:e.references.map(e=>({...e}))}),we=e=>e.map(e=>({...e,range:{...e.range}})),Te=(e,t)=>e.text===t.text&&JSON.stringify(e.references)===JSON.stringify(t.references),Y=(e,t,n)=>({document:Ce(e),mentions:we(t),selection:{...n}}),Ee=()=>({undo:[],redo:[]}),X=(e,t)=>({undo:[...e.undo,t].slice(-100),redo:[]}),Z=(e,t)=>{let n=e.undo.at(-1);return!n||!Te(n.after.document,t)?null:{history:{undo:e.undo.slice(0,-1),redo:[...e.redo,n]},snapshot:Y(n.before.document,n.before.mentions,n.before.selection)}},Q=(e,t)=>{let n=e.redo.at(-1);return!n||!Te(n.before.document,t)?null:{history:{undo:[...e.undo,n],redo:e.redo.slice(0,-1)},snapshot:Y(n.after.document,n.after.mentions,n.after.selection)}},$=e=>{if(e.altKey||e.ctrlKey||e.metaKey)return!1;switch(e.key){case`ArrowUp`:case`PageUp`:case`Home`:return!0;default:return!1}},De=(e,t,n)=>{let r=t instanceof Element?t:t instanceof Node?t.parentElement:null;for(;r&&r!==e;){if(r instanceof HTMLElement){let e=r.scrollHeight-r.clientHeight;if(e>1&&(n===`up`?r.scrollTop>0:r.scrollTop<e-1))return!0}r=r.parentElement}return!1},Oe=(e,t)=>De(e,t,`up`),ke=(e,t)=>De(e,t,`down`),Ae=e=>{if(typeof e!=`number`||!Number.isFinite(e))return;let t=Math.trunc(e);return t>=0?t:void 0},je=e=>{if(!e||typeof e!=`object`||Array.isArray(e))return null;let t=e.summary;return!t||typeof t!=`object`||Array.isArray(t)?null:t},Me=e=>{let t=Ae(e);return t!==void 0&&t>0?t:void 0};function Ne(e){let t=je(e);if(!t)return null;let n=Me(t.additions),r=Me(t.deletions),i=Me(t.files)??Me(t.diffCount);return n===void 0&&r===void 0&&i===void 0?null:{...n===void 0?{}:{additions:n},...r===void 0?{}:{deletions:r},...i===void 0?{}:{files:i}}}function Pe(e){if(!e)return null;let t=[];return e.additions!==void 0&&e.additions>0&&t.push(`+${e.additions}`),e.deletions!==void 0&&e.deletions>0&&t.push(`−${e.deletions}`),t.length>0?t.join(` `):null}function Fe(e){if(!e||typeof e!=`object`||Array.isArray(e))return null;let t=e,n=typeof t.providerID==`string`?t.providerID.trim():``,r=typeof t.modelID==`string`?t.modelID.trim():``;if(n&&r)return`${n}/${r}`;let i=t.model;if(typeof i==`string`&&i.trim())return i.trim();if(i&&typeof i==`object`&&!Array.isArray(i)){let e=i,t=typeof e.providerID==`string`?e.providerID.trim():typeof e.provider==`string`?e.provider.trim():``,n=typeof e.modelID==`string`?e.modelID.trim():typeof e.id==`string`?e.id.trim():``;if(t&&n)return`${t}/${n}`}return null}function Ie(e){if(!e||typeof e!=`object`||Array.isArray(e))return null;let t=e;if(typeof t.branch==`string`&&t.branch.trim())return t.branch.trim();let n=t.project;if(n&&typeof n==`object`&&!Array.isArray(n)){let e=n.branch;if(typeof e==`string`&&e.trim())return e.trim()}return null}export{ie as A,z as C,oe as D,L as E,ae as O,pe as S,de as T,be as _,$ as a,H as b,Y as c,Q as d,Z as f,xe as g,q as h,Fe as i,M as j,N as k,Ee as l,K as m,Ie as n,ke as o,Se as p,Ne as r,Oe as s,Pe as t,X as u,J as v,B as w,me as x,U as y};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{rt as e}from"./vendor-base-ui-CdzJ6My_.js";import{Nt as t}from"./platform-7bX6qtBV.js";import{n}from"./vendor-react-BP2cRVqX.js";import{f as r,r as i}from"./button-
|
|
1
|
+
import{rt as e}from"./vendor-base-ui-CdzJ6My_.js";import{Nt as t}from"./platform-7bX6qtBV.js";import{n}from"./vendor-react-BP2cRVqX.js";import{f as r,r as i}from"./button-_ReBqWzC.js";import{x as a}from"./MobileDetailNavigation-D7uM40jU.js";import{Jr as o,Pr as s,jr as c}from"./useMobileNavigationStore-ByrZJd5L.js";var l=n(),u=e();function d(e){let t=(0,l.c)(10),{count:n,className:a}=e,{t:o}=r();if(!(n>0))return null;let s;t[0]===a?s=t[1]:(s=i(`inline-flex h-[18px] min-w-[18px] shrink-0 items-center justify-center rounded-full bg-[var(--status-info)] px-1.5 typography-micro font-semibold leading-none text-[var(--status-info-foreground)] tabular-nums shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--status-info-foreground)_15%,transparent)]`,a),t[0]=a,t[1]=s);let c;t[2]!==n||t[3]!==o?(c=o(`assistants.unread.label`,{count:n}),t[2]=n,t[3]=o,t[4]=c):c=t[4];let d=n>99?`99+`:n,f;return t[5]!==n||t[6]!==s||t[7]!==c||t[8]!==d?(f=(0,u.jsx)(`span`,{className:s,"aria-label":c,"data-assistant-unread-count":n,children:d}),t[5]=n,t[6]=s,t[7]=c,t[8]=d,t[9]=f):f=t[9],f}function f(e){let t=(0,l.c)(3),{className:n}=e,r=a(),i;return t[0]!==n||t[1]!==r?(i=(0,u.jsx)(d,{count:r,className:n}),t[0]=n,t[1]=r,t[2]=i):i=t[2],i}function p(e){if(!e||e.trim().length===0)return null;let t=s.getState(),n=t.activeSessions.find(t=>t.id===e)??t.archivedSessions.find(t=>t.id===e)??null;if(!n)return null;let r=c(n);return r?{sessionId:e,directory:r,session:n,fromCache:!t.hasLoaded,source:`memory`}:null}function m(e){return p(e)?.directory??null}var h=new Map;async function g(e,n){let r=e.trim();if(!r)return null;let i=p(r);if(i)return i;let a=h.get(r);if(a)return a;let s=(async()=>{let e=p(r);if(e)return e;let i=await o(r,{signal:n?.signal});if(i?.directory)return{sessionId:i.id,directory:i.directory,session:null,fromCache:!1,source:`session-index`};if(n?.trySessionGet===!1)return null;try{let e=await t.getSession(r),n=typeof e.directory==`string`&&e.directory.trim()||(typeof e.project?.worktree==`string`?e.project.worktree.trim():``)||null;return n?{sessionId:r,directory:n,session:e,fromCache:!1,source:`session-get`}:null}catch{return null}})().finally(()=>{h.get(r)===s&&h.delete(r)});return h.set(r,s),s}export{d as a,f as i,m as n,g as r,p as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{it as t,rt as n}from"./vendor-base-ui-CdzJ6My_.js";import{n as r}from"./useUIStore-NMQx_cnG.js";import{n as i}from"./vendor-react-BP2cRVqX.js";import{f as a,r as o}from"./button-C3292Ee6.js";import{n as s}from"./Icon-jsQQXouE.js";import{i as c}from"./OverlayScrollbar-C4VUlRzo.js";import{_ as l,l as u,n as d,s as ee,t as f,v as p,y as m}from"./vendor-dnd-kit-core-5pNnzVdw.js";import{o as h,r as te,t as g}from"./vendor-dnd-kit-sortable-Dm50I0m7.js";var ne=i(),_=e(t(),1),v=n(),re=({transform:e})=>({...e,y:0}),ie=e=>{let t=(0,ne.c)(18),{id:n,children:r,className:i}=e,a;t[0]===n?a=t[1]:(a={id:n},t[0]=n,t[1]=a);let{attributes:s,listeners:c,setNodeRef:l,transform:u,transition:d,isDragging:ee}=h(a),f;t[2]===u?f=t[3]:(f=m.Transform.toString(u),t[2]=u,t[3]=f);let p;t[4]!==f||t[5]!==d?(p={transform:f,transition:d},t[4]=f,t[5]=d,t[6]=p):p=t[6];let te=ee&&`opacity-50`,g;t[7]!==i||t[8]!==te?(g=o(`h-full rounded-md`,i,te),t[7]=i,t[8]=te,t[9]=g):g=t[9];let _;return t[10]!==s||t[11]!==r||t[12]!==n||t[13]!==c||t[14]!==l||t[15]!==p||t[16]!==g?(_=(0,v.jsx)(`div`,{ref:l,"data-sortable-tab-id":n,style:p,className:g,...s,...c,children:r}),t[10]=s,t[11]=r,t[12]=n,t[13]=c,t[14]=l,t[15]=p,t[16]=g,t[17]=_):_=t[17],_},ae=e=>{let t=(0,ne.c)(6),{id:n,children:r,className:i}=e,a;t[0]===i?a=t[1]:(a=o(`h-full`,i),t[0]=i,t[1]=a);let s;return t[2]!==r||t[3]!==n||t[4]!==a?(s=(0,v.jsx)(`div`,{className:a,"data-sortable-tab-id":n,children:r}),t[2]=r,t[3]=n,t[4]=a,t[5]=s):s=t[5],s},y=e=>{let t=(0,ne.c)(121),{items:n,activeId:i,onSelect:m,onClose:h,onReorder:y,layoutMode:he,variant:ge,activePillInsetClassName:_e,activePillButtonClassName:b,inactiveTabsIconOnly:ve,iconOnlyActiveTab:ye,animateActivePill:be,activePillLowercase:xe,className:Se}=e,Ce=he===void 0?`scrollable`:he,we=ge===void 0?`default`:ge,x=ve!==void 0&&ve,S=ye!==void 0&&ye,C=xe===void 0||xe,{t:Te}=a(),w=r(oe),{isTablet:Ee}=c(),T=w||Ee,E=_.useRef(null),De;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(De={left:!1,right:!1},t[0]=De):De=t[0];let[D,O]=_.useState(De),k;t[1]===n?k=t[2]:(k=n.map(se),t[1]=n,t[2]=k);let Oe=k,A=Ce===`scrollable`,ke=we==="default",j=we===`active-pill`,Ae=we===`animated`,M=j||Ae,N=ke,P=M||N,F=j&&A,je=M,Me=be??Ae,Ne=typeof y==`function`,I=Ne?ie:ae,L;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(L=new Map,t[3]=L):L=t[3];let R=_.useRef(L),[z,Pe]=_.useState(null),Fe;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(Fe={activationConstraint:{distance:8}},t[4]=Fe):Fe=t[4];let Ie=p(l(ee,Fe)),Le=ce,Re;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(Re=(e,t)=>{if(t){R.current.set(e,t);return}R.current.delete(e)},t[5]=Re):Re=t[5];let ze=Re,Be;t[6]!==i||t[7]!==P?(Be=()=>{if(!P||!i){Pe(le);return}let e=E.current,t=R.current.get(i);if(!e||!t){Pe(ue);return}let n=0,r=0,a=t;for(;a&&a!==e;)n+=a.offsetLeft,r+=a.offsetTop,a=a.offsetParent;let o={left:n,top:r,width:t.offsetWidth,height:t.offsetHeight};Pe(e=>Le(e,o)?e:o)},t[6]=i,t[7]=P,t[8]=Be):Be=t[8];let B=Be,Ve;t[9]===A?Ve=t[10]:(Ve=()=>{if(!A){O({left:!1,right:!1});return}let e=E.current;if(!e){O({left:!1,right:!1});return}O({left:e.scrollLeft>2,right:e.scrollLeft+e.clientWidth<e.scrollWidth-2})},t[9]=A,t[10]=Ve);let V=Ve,He;t[11]!==A||t[12]!==V?(He=()=>{if(!A){O({left:!1,right:!1});return}let e=E.current;if(!e)return;V(),e.addEventListener(`scroll`,V,{passive:!0});let t=new ResizeObserver(V);return t.observe(e),()=>{e.removeEventListener(`scroll`,V),t.disconnect()}},t[11]=A,t[12]=V,t[13]=He):He=t[13];let Ue;t[14]!==A||t[15]!==n.length||t[16]!==V?(Ue=[A,n.length,V],t[14]=A,t[15]=n.length,t[16]=V,t[17]=Ue):Ue=t[17],_.useEffect(He,Ue);let We;t[18]!==i||t[19]!==B||t[20]!==P?(We=()=>{if(!P){Pe(null);return}B();let e=E.current;if(!e)return;let t=new ResizeObserver(B);if(t.observe(e),i){let e=R.current.get(i);e&&t.observe(e)}return()=>{t.disconnect()}},t[18]=i,t[19]=B,t[20]=P,t[21]=We):We=t[21];let Ge;t[22]!==i||t[23]!==n.length||t[24]!==B||t[25]!==P?(Ge=[i,n.length,B,P],t[22]=i,t[23]=n.length,t[24]=B,t[25]=P,t[26]=Ge):Ge=t[26],_.useEffect(We,Ge);let Ke;t[27]===B?Ke=t[28]:(Ke=()=>{B()},t[27]=B,t[28]=Ke),_.useLayoutEffect(Ke);let qe;t[29]!==i||t[30]!==A||t[31]!==V?(qe=()=>{if(!A||!i)return;let e=E.current;if(!e)return;let t=window.requestAnimationFrame(()=>{let t=typeof window.CSS?.escape==`function`?window.CSS.escape(i):i.replace(/"/g,`\\"`),n=e.querySelector(`[data-sortable-tab-id="${t}"]`);n&&(n.scrollIntoView({block:`nearest`,inline:`nearest`}),V())});return()=>{window.cancelAnimationFrame(t)}},t[29]=i,t[30]=A,t[31]=V,t[32]=qe):qe=t[32];let Je;t[33]!==i||t[34]!==A||t[35]!==n.length||t[36]!==V?(Je=[i,A,n.length,V],t[33]=i,t[34]=A,t[35]=n.length,t[36]=V,t[37]=Je):Je=t[37],_.useEffect(qe,Je);let Ye;t[38]===y?Ye=t[39]:(Ye=e=>{if(!y)return;let{active:t,over:n}=e;!n||t.id===n.id||y(String(t.id),String(n.id))},t[38]=y,t[39]=Ye);let Xe=Ye,H;t[40]===Se?H=t[41]:(H=o(`relative flex h-full min-w-0 flex-1`,Se),t[40]=Se,t[41]=H);let U;t[42]!==A||t[43]!==D||t[44]!==M?(U=A&&D.left?(0,v.jsx)(`div`,{className:o(`pointer-events-none absolute inset-y-0 left-0 z-20 bg-gradient-to-r to-transparent`,M?`w-8 from-[var(--surface-background)]`:`w-6 from-background`)}):null,t[42]=A,t[43]=D,t[44]=M,t[45]=U):U=t[45];let W;t[46]!==A||t[47]!==D||t[48]!==M?(W=A&&D.right?(0,v.jsx)(`div`,{className:o(`pointer-events-none absolute inset-y-0 right-0 z-20 bg-gradient-to-l to-transparent`,M?`w-8 from-[var(--surface-background)]`:`w-6 from-background`)}):null,t[46]=A,t[47]=D,t[48]=M,t[49]=W):W=t[49];let Ze=M?`items-center overflow-x-hidden overflow-y-hidden`:`items-stretch`,Qe=M&&`@container/pill-tabs`,$e=M&&`pill-tabs__track`,et=M&&(_e??`gap-0.5 py-0.5`),tt=N&&`items-center overflow-y-hidden`,nt=je&&`rounded-[10px] [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-[50px] bg-[color-mix(in_srgb,var(--foreground)_2%,transparent)] p-0.5 gap-0.5`,rt=A?`overflow-x-auto scrollbar-none`:`overflow-x-hidden`,G;t[50]!==Ze||t[51]!==Qe||t[52]!==$e||t[53]!==et||t[54]!==tt||t[55]!==nt||t[56]!==rt?(G=o(`relative flex h-full min-w-0 flex-1`,Ze,Qe,$e,et,tt,nt,rt),t[50]=Ze,t[51]=Qe,t[52]=$e,t[53]=et,t[54]=tt,t[55]=nt,t[56]=rt,t[57]=G):G=t[57];let K;t[58]===A?K=t[59]:(K=A?{scrollbarWidth:`none`,msOverflowStyle:`none`}:void 0,t[58]=A,t[59]=K);let q;t[60]===Te?q=t[61]:(q=Te(`sortableTabsStrip.aria.tabs`),t[60]=Te,t[61]=q);let J;t[62]!==z||t[63]!==Me||t[64]!==M?(J=M&&z?(0,v.jsx)(`div`,{className:o(`yuri-segmented-selected-pill pointer-events-none absolute left-0 top-0 z-0 rounded-[9px] [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-[50px]`),style:{transform:`translate3d(${z.left}px, ${z.top}px, 0)`,width:`${z.width}px`,height:`${z.height}px`,transition:Me?`transform 300ms cubic-bezier(0.65, 0, 0.35, 1), width 300ms cubic-bezier(0.65, 0, 0.35, 1), height 300ms cubic-bezier(0.65, 0, 0.35, 1)`:void 0}}):null,t[62]=z,t[63]=Me,t[64]=M,t[65]=J):J=t[65];let Y;t[66]!==z||t[67]!==N?(Y=N&&z?(0,v.jsx)(`div`,{className:`pointer-events-none absolute left-0 -bottom-px z-10 h-[3px] rounded-t-[2px] bg-[var(--primary-base)]`,style:{transform:`translate3d(${z.left}px, 0, 0)`,width:`${z.width}px`},"aria-hidden":!0}):null,t[66]=z,t[67]=N,t[68]=Y):Y=t[68];let X;if(t[69]!==I||t[70]!==i||t[71]!==b||t[72]!==C||t[73]!==T||t[74]!==S||t[75]!==x||t[76]!==j||t[77]!==w||t[78]!==A||t[79]!==n||t[80]!==h||t[81]!==m||t[82]!==F||t[83]!==M){let e;t[85]!==I||t[86]!==i||t[87]!==b||t[88]!==C||t[89]!==T||t[90]!==S||t[91]!==x||t[92]!==j||t[93]!==w||t[94]!==A||t[95]!==h||t[96]!==m||t[97]!==F||t[98]!==M?(e=e=>{let t=e.id===i,n=x&&M&&!t&&!!e.icon,r=!n,a=!!e.icon&&(!S||t),c=x&&M&&t&&!A&&!F,l=e.closable!==!1&&!!h,u=l&&!!e.icon,d=A||F?void 0:M?c?`flex-none basis-auto`:w?`flex-1 basis-0 min-w-0`:`flex-1 basis-0 min-w-fit`:`min-w-0 flex-1 basis-0`,ee=l?t=>{t.button===1&&(t.preventDefault(),t.stopPropagation(),h?.(e.id))}:void 0,f=l?de:void 0;return(0,v.jsx)(I,{id:e.id,className:d,children:(0,v.jsxs)(`div`,{ref:t=>ze(e.id,t),onAuxClick:ee,onMouseDown:f,className:o(`group flex h-full min-w-0 flex-nowrap items-center`,A||F?`shrink-0`:M?`w-full`:`w-full min-w-0`,M?`relative z-10 bg-transparent`:t?`relative z-10 bg-transparent text-foreground`:`relative z-10 bg-transparent text-muted-foreground hover:text-foreground`),children:[(0,v.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":t,"aria-label":n?e.title??e.label:void 0,onClick:()=>m(e.id),className:o(M?`animated-tabs__button pill-tabs__button relative z-10 flex flex-1 min-w-0 flex-nowrap items-center justify-center rounded-[9px] [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-[50px] text-sm font-medium transition-colors duration-150 !min-h-0`:`flex h-full min-w-0 flex-nowrap items-center typography-micro`,M&&C?`lowercase`:null,M&&(n?`gap-0`:`gap-1.5`),M?F?`shrink-0 whitespace-nowrap px-3 text-center`:A?`max-w-56 shrink-0 px-3 text-center`:n?`px-2 !min-w-0 text-center`:c?`shrink-0 whitespace-nowrap px-3 text-center`:`px-3 text-center`:A?`max-w-56 justify-start truncate px-3 text-left`:`w-full justify-center truncate px-3 text-center`,M?b??(j?w?`h-[38px]`:`h-[31px]`:`h-7`):null,M?t?`text-foreground`:`text-muted-foreground hover:text-foreground`:null,M?`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--interactive-focus-ring)] focus-visible:ring-offset-1 focus-visible:ring-offset-background`:null),title:e.title??e.label,children:M?(0,v.jsxs)(v.Fragment,{children:[a?(0,v.jsxs)(`span`,{className:`relative flex h-4 w-4 shrink-0 items-center justify-center`,children:[(0,v.jsx)(`span`,{className:o(`flex items-center justify-center transition-opacity`,u&&(T?`opacity-0`:`group-hover:opacity-0`)),children:e.icon}),u?(0,v.jsx)(`span`,{role:`button`,tabIndex:-1,className:o(`absolute inset-0 z-20 flex !min-h-0 !min-w-0 items-center justify-center rounded-sm text-muted-foreground transition-opacity hover:text-foreground`,T?`opacity-100`:`opacity-0 group-hover:opacity-100`),onPointerDown:fe,onClick:t=>{t.stopPropagation(),h?.(e.id)},"aria-label":e.closeLabel??`Close ${e.label} tab`,title:e.closeLabel??`Close ${e.label} tab`,children:(0,v.jsx)(s,{name:`close`,className:`h-3.5 w-3.5`})}):null]}):null,r?(0,v.jsx)(`span`,{className:`animated-tabs__label truncate`,children:e.label}):null]}):(0,v.jsxs)(`span`,{className:o(`flex min-w-0 flex-nowrap items-center gap-1.5`,!A&&`justify-center`),children:[a?(0,v.jsxs)(`span`,{className:o(`relative flex h-4 w-4 shrink-0 items-center justify-center transition-colors duration-200 ease-out`,t?`text-[var(--primary-base)]`:`text-muted-foreground`),children:[(0,v.jsx)(`span`,{className:o(`flex items-center justify-center transition-opacity`,u&&(T?`opacity-0`:`group-hover:opacity-0`)),children:e.icon}),u?(0,v.jsx)(`span`,{role:`button`,tabIndex:-1,className:o(`absolute inset-0 z-20 flex !min-h-0 !min-w-0 items-center justify-center rounded-sm text-muted-foreground transition-opacity hover:text-foreground`,T?`opacity-100`:`opacity-0 group-hover:opacity-100`),onPointerDown:pe,onClick:t=>{t.stopPropagation(),h?.(e.id)},"aria-label":e.closeLabel??`Close ${e.label} tab`,title:e.closeLabel??`Close ${e.label} tab`,children:(0,v.jsx)(s,{name:`close`,className:`h-3.5 w-3.5`})}):null]}):null,(0,v.jsx)(`span`,{className:`truncate leading-[1.2]`,children:e.label})]})}),l&&!u?(0,v.jsx)(`button`,{type:`button`,onPointerDown:me,onClick:t=>{t.stopPropagation(),h?.(e.id)},className:o(`relative z-20 inline-flex !min-h-0 !min-w-0 items-center justify-center transition-opacity`,M?`-ml-2.5 mr-1 h-[88%] w-5 self-center !aspect-auto rounded-md`:`aspect-square h-[65%] min-h-4 max-h-5 rounded-sm mr-1`,M?t?`text-muted-foreground hover:bg-transparent hover:text-foreground`:`text-muted-foreground opacity-0 hover:bg-transparent hover:text-foreground group-hover:opacity-100`:t?`text-muted-foreground hover:bg-interactive-hover/60 hover:text-foreground`:`text-muted-foreground opacity-0 hover:bg-interactive-hover/80 hover:text-foreground group-hover:opacity-100`),"aria-label":e.closeLabel??`Close ${e.label} tab`,title:e.closeLabel??`Close ${e.label} tab`,children:(0,v.jsx)(s,{name:`close`,className:`h-3 w-3`})}):null]})},e.id)},t[85]=I,t[86]=i,t[87]=b,t[88]=C,t[89]=T,t[90]=S,t[91]=x,t[92]=j,t[93]=w,t[94]=A,t[95]=h,t[96]=m,t[97]=F,t[98]=M,t[99]=e):e=t[99],X=n.map(e),t[69]=I,t[70]=i,t[71]=b,t[72]=C,t[73]=T,t[74]=S,t[75]=x,t[76]=j,t[77]=w,t[78]=A,t[79]=n,t[80]=h,t[81]=m,t[82]=F,t[83]=M,t[84]=X}else X=t[84];let Z;t[100]!==G||t[101]!==K||t[102]!==q||t[103]!==J||t[104]!==Y||t[105]!==X?(Z=(0,v.jsxs)(`div`,{ref:E,className:G,style:K,role:`tablist`,"aria-label":q,children:[J,Y,X]}),t[100]=G,t[101]=K,t[102]=q,t[103]=J,t[104]=Y,t[105]=X,t[106]=Z):Z=t[106];let it;t[107]!==H||t[108]!==U||t[109]!==W||t[110]!==Z?(it=(0,v.jsxs)(`div`,{className:H,children:[U,W,Z]}),t[107]=H,t[108]=U,t[109]=W,t[110]=Z,t[111]=it):it=t[111];let at=it;if(!Ne)return at;let ot;t[112]===Symbol.for(`react.memo_cache_sentinel`)?(ot=[re],t[112]=ot):ot=t[112];let Q;t[113]!==Oe||t[114]!==at?(Q=(0,v.jsx)(g,{items:Oe,strategy:te,children:at}),t[113]=Oe,t[114]=at,t[115]=Q):Q=t[115];let st;t[116]===Symbol.for(`react.memo_cache_sentinel`)?(st=(0,v.jsx)(d,{dropAnimation:null}),t[116]=st):st=t[116];let $;return t[117]!==Xe||t[118]!==Ie||t[119]!==Q?($=(0,v.jsxs)(f,{sensors:Ie,collisionDetection:u,onDragEnd:Xe,modifiers:ot,children:[Q,st]}),t[117]=Xe,t[118]=Ie,t[119]=Q,t[120]=$):$=t[120],$};function oe(e){return e.isMobile}function se(e){return e.id}function ce(e,t){return!e||!t?e===t:Math.abs(e.left-t.left)<.5&&Math.abs(e.top-t.top)<.5&&Math.abs(e.width-t.width)<.5&&Math.abs(e.height-t.height)<.5}function le(e){return e===null?e:null}function ue(e){return e===null?e:null}function de(e){e.button===1&&e.preventDefault()}function fe(e){e.stopPropagation()}function pe(e){e.stopPropagation()}function me(e){e.stopPropagation()}export{y as t};
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{it as t,rt as n}from"./vendor-base-ui-CdzJ6My_.js";import{n as r}from"./useUIStore-NMQx_cnG.js";import{n as i}from"./vendor-react-BP2cRVqX.js";import{f as a,r as o}from"./button-_ReBqWzC.js";import{n as s}from"./Icon-2cKLcXGe.js";import{i as c}from"./OverlayScrollbar-piA-chKb.js";import{_ as l,l as u,n as d,s as ee,t as f,v as p,y as m}from"./vendor-dnd-kit-core-5pNnzVdw.js";import{o as h,r as te,t as g}from"./vendor-dnd-kit-sortable-Dm50I0m7.js";var ne=i(),_=e(t(),1),v=n(),re=({transform:e})=>({...e,y:0}),ie=e=>{let t=(0,ne.c)(18),{id:n,children:r,className:i}=e,a;t[0]===n?a=t[1]:(a={id:n},t[0]=n,t[1]=a);let{attributes:s,listeners:c,setNodeRef:l,transform:u,transition:d,isDragging:ee}=h(a),f;t[2]===u?f=t[3]:(f=m.Transform.toString(u),t[2]=u,t[3]=f);let p;t[4]!==f||t[5]!==d?(p={transform:f,transition:d},t[4]=f,t[5]=d,t[6]=p):p=t[6];let te=ee&&`opacity-50`,g;t[7]!==i||t[8]!==te?(g=o(`h-full rounded-md`,i,te),t[7]=i,t[8]=te,t[9]=g):g=t[9];let _;return t[10]!==s||t[11]!==r||t[12]!==n||t[13]!==c||t[14]!==l||t[15]!==p||t[16]!==g?(_=(0,v.jsx)(`div`,{ref:l,"data-sortable-tab-id":n,style:p,className:g,...s,...c,children:r}),t[10]=s,t[11]=r,t[12]=n,t[13]=c,t[14]=l,t[15]=p,t[16]=g,t[17]=_):_=t[17],_},ae=e=>{let t=(0,ne.c)(6),{id:n,children:r,className:i}=e,a;t[0]===i?a=t[1]:(a=o(`h-full`,i),t[0]=i,t[1]=a);let s;return t[2]!==r||t[3]!==n||t[4]!==a?(s=(0,v.jsx)(`div`,{className:a,"data-sortable-tab-id":n,children:r}),t[2]=r,t[3]=n,t[4]=a,t[5]=s):s=t[5],s},y=e=>{let t=(0,ne.c)(121),{items:n,activeId:i,onSelect:m,onClose:h,onReorder:y,layoutMode:he,variant:ge,activePillInsetClassName:_e,activePillButtonClassName:b,inactiveTabsIconOnly:ve,iconOnlyActiveTab:ye,animateActivePill:be,activePillLowercase:xe,className:Se}=e,Ce=he===void 0?`scrollable`:he,we=ge===void 0?`default`:ge,x=ve!==void 0&&ve,S=ye!==void 0&&ye,C=xe===void 0||xe,{t:Te}=a(),w=r(oe),{isTablet:Ee}=c(),T=w||Ee,E=_.useRef(null),De;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(De={left:!1,right:!1},t[0]=De):De=t[0];let[D,O]=_.useState(De),k;t[1]===n?k=t[2]:(k=n.map(se),t[1]=n,t[2]=k);let Oe=k,A=Ce===`scrollable`,ke=we==="default",j=we===`active-pill`,Ae=we===`animated`,M=j||Ae,N=ke,P=M||N,F=j&&A,je=M,Me=be??Ae,Ne=typeof y==`function`,I=Ne?ie:ae,L;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(L=new Map,t[3]=L):L=t[3];let R=_.useRef(L),[z,Pe]=_.useState(null),Fe;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(Fe={activationConstraint:{distance:8}},t[4]=Fe):Fe=t[4];let Ie=p(l(ee,Fe)),Le=ce,Re;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(Re=(e,t)=>{if(t){R.current.set(e,t);return}R.current.delete(e)},t[5]=Re):Re=t[5];let ze=Re,Be;t[6]!==i||t[7]!==P?(Be=()=>{if(!P||!i){Pe(le);return}let e=E.current,t=R.current.get(i);if(!e||!t){Pe(ue);return}let n=0,r=0,a=t;for(;a&&a!==e;)n+=a.offsetLeft,r+=a.offsetTop,a=a.offsetParent;let o={left:n,top:r,width:t.offsetWidth,height:t.offsetHeight};Pe(e=>Le(e,o)?e:o)},t[6]=i,t[7]=P,t[8]=Be):Be=t[8];let B=Be,Ve;t[9]===A?Ve=t[10]:(Ve=()=>{if(!A){O({left:!1,right:!1});return}let e=E.current;if(!e){O({left:!1,right:!1});return}O({left:e.scrollLeft>2,right:e.scrollLeft+e.clientWidth<e.scrollWidth-2})},t[9]=A,t[10]=Ve);let V=Ve,He;t[11]!==A||t[12]!==V?(He=()=>{if(!A){O({left:!1,right:!1});return}let e=E.current;if(!e)return;V(),e.addEventListener(`scroll`,V,{passive:!0});let t=new ResizeObserver(V);return t.observe(e),()=>{e.removeEventListener(`scroll`,V),t.disconnect()}},t[11]=A,t[12]=V,t[13]=He):He=t[13];let Ue;t[14]!==A||t[15]!==n.length||t[16]!==V?(Ue=[A,n.length,V],t[14]=A,t[15]=n.length,t[16]=V,t[17]=Ue):Ue=t[17],_.useEffect(He,Ue);let We;t[18]!==i||t[19]!==B||t[20]!==P?(We=()=>{if(!P){Pe(null);return}B();let e=E.current;if(!e)return;let t=new ResizeObserver(B);if(t.observe(e),i){let e=R.current.get(i);e&&t.observe(e)}return()=>{t.disconnect()}},t[18]=i,t[19]=B,t[20]=P,t[21]=We):We=t[21];let Ge;t[22]!==i||t[23]!==n.length||t[24]!==B||t[25]!==P?(Ge=[i,n.length,B,P],t[22]=i,t[23]=n.length,t[24]=B,t[25]=P,t[26]=Ge):Ge=t[26],_.useEffect(We,Ge);let Ke;t[27]===B?Ke=t[28]:(Ke=()=>{B()},t[27]=B,t[28]=Ke),_.useLayoutEffect(Ke);let qe;t[29]!==i||t[30]!==A||t[31]!==V?(qe=()=>{if(!A||!i)return;let e=E.current;if(!e)return;let t=window.requestAnimationFrame(()=>{let t=typeof window.CSS?.escape==`function`?window.CSS.escape(i):i.replace(/"/g,`\\"`),n=e.querySelector(`[data-sortable-tab-id="${t}"]`);n&&(n.scrollIntoView({block:`nearest`,inline:`nearest`}),V())});return()=>{window.cancelAnimationFrame(t)}},t[29]=i,t[30]=A,t[31]=V,t[32]=qe):qe=t[32];let Je;t[33]!==i||t[34]!==A||t[35]!==n.length||t[36]!==V?(Je=[i,A,n.length,V],t[33]=i,t[34]=A,t[35]=n.length,t[36]=V,t[37]=Je):Je=t[37],_.useEffect(qe,Je);let Ye;t[38]===y?Ye=t[39]:(Ye=e=>{if(!y)return;let{active:t,over:n}=e;!n||t.id===n.id||y(String(t.id),String(n.id))},t[38]=y,t[39]=Ye);let Xe=Ye,H;t[40]===Se?H=t[41]:(H=o(`relative flex h-full min-w-0 flex-1`,Se),t[40]=Se,t[41]=H);let U;t[42]!==A||t[43]!==D||t[44]!==M?(U=A&&D.left?(0,v.jsx)(`div`,{className:o(`pointer-events-none absolute inset-y-0 left-0 z-20 bg-gradient-to-r to-transparent`,M?`w-8 from-[var(--surface-background)]`:`w-6 from-background`)}):null,t[42]=A,t[43]=D,t[44]=M,t[45]=U):U=t[45];let W;t[46]!==A||t[47]!==D||t[48]!==M?(W=A&&D.right?(0,v.jsx)(`div`,{className:o(`pointer-events-none absolute inset-y-0 right-0 z-20 bg-gradient-to-l to-transparent`,M?`w-8 from-[var(--surface-background)]`:`w-6 from-background`)}):null,t[46]=A,t[47]=D,t[48]=M,t[49]=W):W=t[49];let Ze=M?`items-center overflow-x-hidden overflow-y-hidden`:`items-stretch`,Qe=M&&`@container/pill-tabs`,$e=M&&`pill-tabs__track`,et=M&&(_e??`gap-0.5 py-0.5`),tt=N&&`items-center overflow-y-hidden`,nt=je&&`rounded-[10px] [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-[50px] bg-[color-mix(in_srgb,var(--foreground)_2%,transparent)] p-0.5 gap-0.5`,rt=A?`overflow-x-auto scrollbar-none`:`overflow-x-hidden`,G;t[50]!==Ze||t[51]!==Qe||t[52]!==$e||t[53]!==et||t[54]!==tt||t[55]!==nt||t[56]!==rt?(G=o(`relative flex h-full min-w-0 flex-1`,Ze,Qe,$e,et,tt,nt,rt),t[50]=Ze,t[51]=Qe,t[52]=$e,t[53]=et,t[54]=tt,t[55]=nt,t[56]=rt,t[57]=G):G=t[57];let K;t[58]===A?K=t[59]:(K=A?{scrollbarWidth:`none`,msOverflowStyle:`none`}:void 0,t[58]=A,t[59]=K);let q;t[60]===Te?q=t[61]:(q=Te(`sortableTabsStrip.aria.tabs`),t[60]=Te,t[61]=q);let J;t[62]!==z||t[63]!==Me||t[64]!==M?(J=M&&z?(0,v.jsx)(`div`,{className:o(`yuri-segmented-selected-pill pointer-events-none absolute left-0 top-0 z-0 rounded-[9px] [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-[50px]`),style:{transform:`translate3d(${z.left}px, ${z.top}px, 0)`,width:`${z.width}px`,height:`${z.height}px`,transition:Me?`transform 300ms cubic-bezier(0.65, 0, 0.35, 1), width 300ms cubic-bezier(0.65, 0, 0.35, 1), height 300ms cubic-bezier(0.65, 0, 0.35, 1)`:void 0}}):null,t[62]=z,t[63]=Me,t[64]=M,t[65]=J):J=t[65];let Y;t[66]!==z||t[67]!==N?(Y=N&&z?(0,v.jsx)(`div`,{className:`pointer-events-none absolute left-0 -bottom-px z-10 h-[3px] rounded-t-[2px] bg-[var(--primary-base)]`,style:{transform:`translate3d(${z.left}px, 0, 0)`,width:`${z.width}px`},"aria-hidden":!0}):null,t[66]=z,t[67]=N,t[68]=Y):Y=t[68];let X;if(t[69]!==I||t[70]!==i||t[71]!==b||t[72]!==C||t[73]!==T||t[74]!==S||t[75]!==x||t[76]!==j||t[77]!==w||t[78]!==A||t[79]!==n||t[80]!==h||t[81]!==m||t[82]!==F||t[83]!==M){let e;t[85]!==I||t[86]!==i||t[87]!==b||t[88]!==C||t[89]!==T||t[90]!==S||t[91]!==x||t[92]!==j||t[93]!==w||t[94]!==A||t[95]!==h||t[96]!==m||t[97]!==F||t[98]!==M?(e=e=>{let t=e.id===i,n=x&&M&&!t&&!!e.icon,r=!n,a=!!e.icon&&(!S||t),c=x&&M&&t&&!A&&!F,l=e.closable!==!1&&!!h,u=l&&!!e.icon,d=A||F?void 0:M?c?`flex-none basis-auto`:w?`flex-1 basis-0 min-w-0`:`flex-1 basis-0 min-w-fit`:`min-w-0 flex-1 basis-0`,ee=l?t=>{t.button===1&&(t.preventDefault(),t.stopPropagation(),h?.(e.id))}:void 0,f=l?de:void 0;return(0,v.jsx)(I,{id:e.id,className:d,children:(0,v.jsxs)(`div`,{ref:t=>ze(e.id,t),onAuxClick:ee,onMouseDown:f,className:o(`group flex h-full min-w-0 flex-nowrap items-center`,A||F?`shrink-0`:M?`w-full`:`w-full min-w-0`,M?`relative z-10 bg-transparent`:t?`relative z-10 bg-transparent text-foreground`:`relative z-10 bg-transparent text-muted-foreground hover:text-foreground`),children:[(0,v.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":t,"aria-label":n?e.title??e.label:void 0,onClick:()=>m(e.id),className:o(M?`animated-tabs__button pill-tabs__button relative z-10 flex flex-1 min-w-0 flex-nowrap items-center justify-center rounded-[9px] [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-[50px] text-sm font-medium transition-colors duration-150 !min-h-0`:`flex h-full min-w-0 flex-nowrap items-center typography-micro`,M&&C?`lowercase`:null,M&&(n?`gap-0`:`gap-1.5`),M?F?`shrink-0 whitespace-nowrap px-3 text-center`:A?`max-w-56 shrink-0 px-3 text-center`:n?`px-2 !min-w-0 text-center`:c?`shrink-0 whitespace-nowrap px-3 text-center`:`px-3 text-center`:A?`max-w-56 justify-start truncate px-3 text-left`:`w-full justify-center truncate px-3 text-center`,M?b??(j?w?`h-[38px]`:`h-[31px]`:`h-7`):null,M?t?`text-foreground`:`text-muted-foreground hover:text-foreground`:null,M?`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--interactive-focus-ring)] focus-visible:ring-offset-1 focus-visible:ring-offset-background`:null),title:e.title??e.label,children:M?(0,v.jsxs)(v.Fragment,{children:[a?(0,v.jsxs)(`span`,{className:`relative flex h-4 w-4 shrink-0 items-center justify-center`,children:[(0,v.jsx)(`span`,{className:o(`flex items-center justify-center transition-opacity`,u&&(T?`opacity-0`:`group-hover:opacity-0`)),children:e.icon}),u?(0,v.jsx)(`span`,{role:`button`,tabIndex:-1,className:o(`absolute inset-0 z-20 flex !min-h-0 !min-w-0 items-center justify-center rounded-sm text-muted-foreground transition-opacity hover:text-foreground`,T?`opacity-100`:`opacity-0 group-hover:opacity-100`),onPointerDown:fe,onClick:t=>{t.stopPropagation(),h?.(e.id)},"aria-label":e.closeLabel??`Close ${e.label} tab`,title:e.closeLabel??`Close ${e.label} tab`,children:(0,v.jsx)(s,{name:`close`,className:`h-3.5 w-3.5`})}):null]}):null,r?(0,v.jsx)(`span`,{className:`animated-tabs__label truncate`,children:e.label}):null]}):(0,v.jsxs)(`span`,{className:o(`flex min-w-0 flex-nowrap items-center gap-1.5`,!A&&`justify-center`),children:[a?(0,v.jsxs)(`span`,{className:o(`relative flex h-4 w-4 shrink-0 items-center justify-center transition-colors duration-200 ease-out`,t?`text-[var(--primary-base)]`:`text-muted-foreground`),children:[(0,v.jsx)(`span`,{className:o(`flex items-center justify-center transition-opacity`,u&&(T?`opacity-0`:`group-hover:opacity-0`)),children:e.icon}),u?(0,v.jsx)(`span`,{role:`button`,tabIndex:-1,className:o(`absolute inset-0 z-20 flex !min-h-0 !min-w-0 items-center justify-center rounded-sm text-muted-foreground transition-opacity hover:text-foreground`,T?`opacity-100`:`opacity-0 group-hover:opacity-100`),onPointerDown:pe,onClick:t=>{t.stopPropagation(),h?.(e.id)},"aria-label":e.closeLabel??`Close ${e.label} tab`,title:e.closeLabel??`Close ${e.label} tab`,children:(0,v.jsx)(s,{name:`close`,className:`h-3.5 w-3.5`})}):null]}):null,(0,v.jsx)(`span`,{className:`truncate leading-[1.2]`,children:e.label})]})}),l&&!u?(0,v.jsx)(`button`,{type:`button`,onPointerDown:me,onClick:t=>{t.stopPropagation(),h?.(e.id)},className:o(`relative z-20 inline-flex !min-h-0 !min-w-0 items-center justify-center transition-opacity`,M?`-ml-2.5 mr-1 h-[88%] w-5 self-center !aspect-auto rounded-md`:`aspect-square h-[65%] min-h-4 max-h-5 rounded-sm mr-1`,M?t?`text-muted-foreground hover:bg-transparent hover:text-foreground`:`text-muted-foreground opacity-0 hover:bg-transparent hover:text-foreground group-hover:opacity-100`:t?`text-muted-foreground hover:bg-interactive-hover/60 hover:text-foreground`:`text-muted-foreground opacity-0 hover:bg-interactive-hover/80 hover:text-foreground group-hover:opacity-100`),"aria-label":e.closeLabel??`Close ${e.label} tab`,title:e.closeLabel??`Close ${e.label} tab`,children:(0,v.jsx)(s,{name:`close`,className:`h-3 w-3`})}):null]})},e.id)},t[85]=I,t[86]=i,t[87]=b,t[88]=C,t[89]=T,t[90]=S,t[91]=x,t[92]=j,t[93]=w,t[94]=A,t[95]=h,t[96]=m,t[97]=F,t[98]=M,t[99]=e):e=t[99],X=n.map(e),t[69]=I,t[70]=i,t[71]=b,t[72]=C,t[73]=T,t[74]=S,t[75]=x,t[76]=j,t[77]=w,t[78]=A,t[79]=n,t[80]=h,t[81]=m,t[82]=F,t[83]=M,t[84]=X}else X=t[84];let Z;t[100]!==G||t[101]!==K||t[102]!==q||t[103]!==J||t[104]!==Y||t[105]!==X?(Z=(0,v.jsxs)(`div`,{ref:E,className:G,style:K,role:`tablist`,"aria-label":q,children:[J,Y,X]}),t[100]=G,t[101]=K,t[102]=q,t[103]=J,t[104]=Y,t[105]=X,t[106]=Z):Z=t[106];let it;t[107]!==H||t[108]!==U||t[109]!==W||t[110]!==Z?(it=(0,v.jsxs)(`div`,{className:H,children:[U,W,Z]}),t[107]=H,t[108]=U,t[109]=W,t[110]=Z,t[111]=it):it=t[111];let at=it;if(!Ne)return at;let ot;t[112]===Symbol.for(`react.memo_cache_sentinel`)?(ot=[re],t[112]=ot):ot=t[112];let Q;t[113]!==Oe||t[114]!==at?(Q=(0,v.jsx)(g,{items:Oe,strategy:te,children:at}),t[113]=Oe,t[114]=at,t[115]=Q):Q=t[115];let st;t[116]===Symbol.for(`react.memo_cache_sentinel`)?(st=(0,v.jsx)(d,{dropAnimation:null}),t[116]=st):st=t[116];let $;return t[117]!==Xe||t[118]!==Ie||t[119]!==Q?($=(0,v.jsxs)(f,{sensors:Ie,collisionDetection:u,onDragEnd:Xe,modifiers:ot,children:[Q,st]}),t[117]=Xe,t[118]=Ie,t[119]=Q,t[120]=$):$=t[120],$};function oe(e){return e.isMobile}function se(e){return e.id}function ce(e,t){return!e||!t?e===t:Math.abs(e.left-t.left)<.5&&Math.abs(e.top-t.top)<.5&&Math.abs(e.width-t.width)<.5&&Math.abs(e.height-t.height)<.5}function le(e){return e===null?e:null}function ue(e){return e===null?e:null}function de(e){e.button===1&&e.preventDefault()}function fe(e){e.stopPropagation()}function pe(e){e.stopPropagation()}function me(e){e.stopPropagation()}export{y as t};
|