progon-agent 1.3.1 → 1.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/extension-bundle.json +3 -3
  2. package/extension-dist/background/background.js +82 -82
  3. package/extension-dist/card/card.html +7 -7
  4. package/extension-dist/card/card.js +3 -3
  5. package/extension-dist/chunks/shared-9kMbf8PO.js +1 -0
  6. package/extension-dist/chunks/shared-Bi_ASAsl.js +377 -0
  7. package/extension-dist/chunks/{shared-CwW6XlwM.js → shared-Bts1WtwM.js} +1 -1
  8. package/extension-dist/chunks/shared-BvwA-cm2.css +1 -0
  9. package/extension-dist/chunks/shared-Bwk7ZjOr.js +21 -0
  10. package/extension-dist/chunks/{shared-BJIubFtc.js → shared-CInXPYm9.js} +1 -1
  11. package/extension-dist/chunks/shared-CX8XGwZc.js +1 -0
  12. package/extension-dist/chunks/shared-CZrS2BT6.js +111 -0
  13. package/extension-dist/chunks/{shared-SnJc3X_h.js → shared-C_dmgeUK.js} +12 -18
  14. package/extension-dist/chunks/shared-CeuPJn47.js +227 -0
  15. package/extension-dist/chunks/{shared-Bdgj5eQ5.js → shared-CiEEQWpw.js} +1 -1
  16. package/extension-dist/chunks/shared-Cxo909tK.js +1 -0
  17. package/extension-dist/chunks/shared-DyRhAmgo.js +51 -0
  18. package/extension-dist/chunks/shared-Xq2emDMe.js +98 -0
  19. package/extension-dist/chunks/shared-_jlBqdBD.css +1 -0
  20. package/extension-dist/content/content.css +1 -1
  21. package/extension-dist/content/content.js +211 -211
  22. package/extension-dist/manifest.json +23 -23
  23. package/extension-dist/offscreen/offscreen.html +2 -2
  24. package/extension-dist/offscreen/offscreen.js +1 -1
  25. package/extension-dist/popup/popup.html +7 -7
  26. package/extension-dist/popup/popup.js +3 -3
  27. package/extension-dist/sidepanel/sidepanel.html +10 -10
  28. package/extension-dist/sidepanel/sidepanel.js +1 -1
  29. package/extension-dist/workspace/workspace.html +11 -11
  30. package/extension-dist/workspace/workspace.js +56 -55
  31. package/package.json +1 -1
  32. package/extension-dist/chunks/shared-B3hsjAeB.js +0 -371
  33. package/extension-dist/chunks/shared-BJOAkaqO.js +0 -1
  34. package/extension-dist/chunks/shared-BUQXvbGJ.css +0 -1
  35. package/extension-dist/chunks/shared-BiDh2lEA.js +0 -1
  36. package/extension-dist/chunks/shared-Ccz3X65G.js +0 -51
  37. package/extension-dist/chunks/shared-CdkSNWvx.js +0 -21
  38. package/extension-dist/chunks/shared-DCs5uS1P.js +0 -1
  39. package/extension-dist/chunks/shared-DdJtX3_m.js +0 -105
  40. package/extension-dist/chunks/shared-O0OgUhxM.js +0 -227
  41. package/extension-dist/chunks/shared-UK_0TOj7.js +0 -98
  42. package/extension-dist/chunks/shared-c_EHmnKR.css +0 -1
@@ -1,51 +0,0 @@
1
- import{r as e}from"./shared-hePW80VL.js";import{$r as t,Fi as n,Hi as r,Qi as i,Ur as a,Xr as o,bi as s,ca as c,ei as l,ma as u,pa as d,rr as f,sa as p,ur as m,wa as h,wo as g,yi as _}from"./shared-O0OgUhxM.js";import{$n as v,Bn as y,Gn as b,Mn as x,Vn as S,Xn as C,jn as w,kn as T,t as ee}from"./shared-UK_0TOj7.js"
2
- /**
3
- * @license lucide-react v0.574.0 - ISC
4
- *
5
- * This source code is licensed under the ISC license.
6
- * See the LICENSE file in the root directory of this source tree.
7
- */
8
- ;var E=_(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),D=_(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),O=_(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),te=_(`file-text`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]),ne=_(`folder`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),k=_(`message-circle`,[[`path`,{d:`M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719`,key:`1sd12s`}]]),A=_(`monitor`,[[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`,key:`48i651`}],[`line`,{x1:`8`,x2:`16`,y1:`21`,y2:`21`,key:`1svkeh`}],[`line`,{x1:`12`,x2:`12`,y1:`17`,y2:`21`,key:`vw1qmm`}]]),j=_(`wifi-off`,[[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M8.5 16.429a5 5 0 0 1 7 0`,key:`1bycff`}],[`path`,{d:`M5 12.859a10 10 0 0 1 5.17-2.69`,key:`1dl1wf`}],[`path`,{d:`M19 12.859a10 10 0 0 0-2.007-1.523`,key:`4k23kn`}],[`path`,{d:`M2 8.82a15 15 0 0 1 4.177-2.643`,key:`1grhjp`}],[`path`,{d:`M22 8.82a15 15 0 0 0-11.288-3.764`,key:`z3jwby`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),M=/* @__PURE__ */ e(c(),1),N=p(),re=[`M28 5 L52 16 L28 27 Z`,`M59 28 L48 52 L37 28 Z`,`M36 59 L12 48 L36 37 Z`,`M5 36 L16 12 L27 36 Z`],ie={brand:[`var(--color-primary-300)`,`var(--color-primary-400)`,`var(--color-secondary)`,`var(--color-primary)`],"primary-ramp":[`var(--color-primary-300)`,`var(--color-primary-400)`,`var(--color-primary-500)`,`var(--color-primary-600)`]}
9
- /**
10
- * @license lucide-react v0.574.0 - ISC
11
- *
12
- * This source code is licensed under the ISC license.
13
- * See the LICENSE file in the root directory of this source tree.
14
- */
15
- /**
16
- * @license lucide-react v0.574.0 - ISC
17
- *
18
- * This source code is licensed under the ISC license.
19
- * See the LICENSE file in the root directory of this source tree.
20
- */
21
- /**
22
- * @license lucide-react v0.574.0 - ISC
23
- *
24
- * This source code is licensed under the ISC license.
25
- * See the LICENSE file in the root directory of this source tree.
26
- */
27
- /**
28
- * @license lucide-react v0.574.0 - ISC
29
- *
30
- * This source code is licensed under the ISC license.
31
- * See the LICENSE file in the root directory of this source tree.
32
- */
33
- /**
34
- * @license lucide-react v0.574.0 - ISC
35
- *
36
- * This source code is licensed under the ISC license.
37
- * See the LICENSE file in the root directory of this source tree.
38
- */
39
- /**
40
- * @license lucide-react v0.574.0 - ISC
41
- *
42
- * This source code is licensed under the ISC license.
43
- * See the LICENSE file in the root directory of this source tree.
44
- */
45
- /**
46
- * @license lucide-react v0.574.0 - ISC
47
- *
48
- * This source code is licensed under the ISC license.
49
- * See the LICENSE file in the root directory of this source tree.
50
- */
51
- ;function P({className:e,palette:t=`brand`}){let n=ie[t];return/* @__PURE__ */ (0,N.jsx)(`svg`,{viewBox:`0 0 64 64`,"aria-hidden":`true`,className:e,children:re.map((e,t)=>/* @__PURE__ */ (0,N.jsx)(`path`,{d:e,fill:n[t],stroke:n[t],strokeWidth:`4`,strokeLinejoin:`round`},e))})}var ae=ee(`pgs-3273faf788`);function oe({subtitle:e,footer:t}){let{t:i}=n(),s=a(),c=(0,M.useId)(),[l,u]=(0,M.useState)(``),[d,p]=(0,M.useState)(``),[g,_]=(0,M.useState)(!1),[v,y]=(0,M.useState)(null),b=(0,M.useRef)(!1),x=async e=>{if(e.preventDefault(),!b.current){b.current=!0,_(!0);try{let e=await h.auth.login({email:l.trim(),password:d});y(null),s.signedIn(e.user)}catch(e){y(se(e))}finally{b.current=!1,_(!1)}}},S=(v==null?void 0:v.kind)===`refused`;return/* @__PURE__ */ (0,N.jsxs)(`form`,{className:`grid content-start gap-4.5 px-5 pt-7 pb-4`,"aria-labelledby":c,noValidate:!0,onSubmit:e=>{x(e)},"data-testid":`shell-sign-in`,children:[/* @__PURE__ */ (0,N.jsxs)(`div`,{className:`grid justify-items-center gap-1.5 text-center`,children:[/* @__PURE__ */ (0,N.jsx)(`span`,{className:`mb-1 grid size-16 place-items-center rounded-full bg-[radial-gradient(circle_at_50%_45%,color-mix(in_srgb,var(--color-primary)_24%,transparent)_0%,transparent_68%)]`,children:/* @__PURE__ */ (0,N.jsx)(P,{className:`size-10`})}),/* @__PURE__ */ (0,N.jsx)(`h1`,{id:c,className:`m-0 text-(length:--text-window-title) leading-(--leading-window-title) font-semibold tracking-(--tracking-window-title) text-fg-primary`,children:i(`shell.signIn.title`)}),/* @__PURE__ */ (0,N.jsx)(`p`,{className:`m-0 text-body-sm text-fg-muted`,children:e})]}),/* @__PURE__ */ (0,N.jsxs)(`div`,{className:`grid gap-3`,children:[/* @__PURE__ */ (0,N.jsx)(f,{type:`email`,label:i(`shell.signIn.email`),autoComplete:`username`,placeholder:i(`shell.signIn.emailPlaceholder`),value:l,onValueChange:u,invalid:S,autoFocus:!0}),/* @__PURE__ */ (0,N.jsx)(f,{type:`password`,label:i(`shell.signIn.password`),autoComplete:`current-password`,placeholder:i(`shell.signIn.passwordPlaceholder`),value:d,onValueChange:p,invalid:S}),v!==null&&/* @__PURE__ */ (0,N.jsx)(m,{tone:`error`,icon:v.kind===`noAnswer`?/* @__PURE__ */ (0,N.jsx)(j,{"aria-hidden":`true`}):void 0,title:v.kind===`noAnswer`?i(`shell.signIn.noAnswer`):v.message,"data-testid":`shell-sign-in-error`}),/* @__PURE__ */ (0,N.jsx)(o,{type:`submit`,size:`lg`,fullWidth:!0,loading:g,"data-testid":`shell-sign-in-submit`,children:i(`shell.signIn.submit`)}),/* @__PURE__ */ (0,N.jsxs)(`div`,{className:`flex justify-between gap-2`,children:[/* @__PURE__ */ (0,N.jsx)(F,{onOpen:()=>r(`/forgot-password`),children:i(`shell.signIn.forgotPassword`)}),/* @__PURE__ */ (0,N.jsx)(F,{onOpen:()=>r(`/register`),external:!0,children:i(`shell.signIn.createAccount`)})]})]}),t!==void 0&&/* @__PURE__ */ (0,N.jsx)(`div`,{className:`flex justify-center border-t border-stroke-light pt-3.5`,children:t})]})}function F({onOpen:e,external:t=!1,children:n}){return/* @__PURE__ */ (0,N.jsxs)(`a`,{href:`#`,className:`rounded-xs px-0.5 py-1 text-body-sm font-medium text-fg-link no-underline hover:underline hover:underline-offset-3 focus-visible:outline-2 focus-visible:outline-stroke-focus`,onClick:t=>{t.preventDefault(),e()},children:[n,t&&/* @__PURE__ */ (0,N.jsx)(O,{"aria-hidden":`true`,className:`ml-0.75 inline size-3 align-[-1px]`})]})}function se(e){return e instanceof g&&e.status!==0?{kind:`refused`,message:d(u,e,`shell.signIn.refused`)}:(ae.error(`pgm-53794f16d4`,{error:e instanceof Error?e.message:String(e)}),{kind:`noAnswer`})}function ce({user:e,project:t,children:n}){let{id:r,number:a}=t,o=(0,M.useMemo)(()=>({projectId:r,projectNumber:a,user:e}),[r,a,e]);return/* @__PURE__ */ (0,N.jsx)(i,{value:o,children:n})}function le({label:e,loadingLabel:n,loading:r,onLoadMore:i,className:a,"data-testid":o}){return/* @__PURE__ */ (0,N.jsx)(`button`,{type:`button`,onClick:i,disabled:r,"aria-busy":r||void 0,"data-testid":o,className:l(`flex h-9 w-full items-center justify-center gap-2 rounded-md border border-dashed border-stroke-hover bg-transparent text-(length:--text-body-sm) font-medium text-fg-secondary transition-colors duration-(--motion-short) ease-out hover-enabled:border-solid hover-enabled:bg-surface-hover-layer hover-enabled:text-fg-primary focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-stroke-focus aria-busy:cursor-progress`,a),children:r?/* @__PURE__ */ (0,N.jsxs)(N.Fragment,{children:[/* @__PURE__ */ (0,N.jsx)(t,{}),n]}):e})}var I=6e4,L=Date.now(),R=/* @__PURE__ */ new Set,z;function B(e){return R.add(e),z===void 0&&(L=Date.now(),z=setInterval(()=>{L=Date.now(),R.forEach(e=>e())},I)),()=>{R.delete(e),R.size===0&&z!==void 0&&(clearInterval(z),z=void 0)}}function V(){return L}function H(){return(0,M.useSyncExternalStore)(B,V,V)}var U=`relative inline-block shrink-0 rounded-full bg-surface-active-layer shadow-[inset_0_0_0_1px_var(--color-border-hairline)] [transition:background-color_var(--motion-short)_var(--ease-out)] peer-checked:bg-primary after:absolute after:rounded-full after:bg-toggle-thumb after:shadow-toggle-thumb after:content-[''] after:[transition:translate_var(--motion-short)_var(--ease-out)]`,W=`peer-checked:bg-primary/40`,ue={md:`h-5 w-9 after:top-0.75 after:left-0.75 after:size-3.5 peer-checked:after:translate-x-4`,sm:`h-3.75 w-6.5 after:top-0.5 after:left-0.5 after:size-2.75 peer-checked:after:translate-x-2.75`},de={md:`peer-checked:*:translate-x-4`,sm:`peer-checked:*:translate-x-2.75`},fe={md:`top-0.75 left-0.75 size-3.5 [&>[data-slot=spinner]]:size-2.5`,sm:`top-0.5 left-0.5 size-2.75 [&>[data-slot=spinner]]:size-2 [&>[data-slot=spinner]]:border`},pe={md:`peer-focus-visible:outline-2 peer-focus-visible:outline-offset-2 peer-focus-visible:outline-stroke-focus`,sm:``},me={md:`gap-2.5 text-body-sm text-fg-primary`,sm:`h-8 gap-2 rounded-full px-2.5 text-xs font-medium text-fg-secondary [transition:background-color_var(--motion-short)_var(--ease-out)] has-focus-visible:outline-2 has-focus-visible:outline-offset-2 has-focus-visible:outline-stroke-focus`},he={md:``,sm:`hover:bg-surface-hover-layer`};function G({checked:e,onChange:n,disabled:r=!1,saving:i=!1,muted:a=!1,size:o=`md`,id:s,className:c,label:u,"aria-label":d,"aria-describedby":f,"aria-keyshortcuts":p,"data-testid":m,...h}){let g=r||i;return/* @__PURE__ */ (0,N.jsxs)(`label`,{...h,className:l(`relative inline-flex select-none items-center`,me[o],r?`cursor-not-allowed opacity-disabled`:i?`cursor-progress`:l(`cursor-pointer`,he[o]),c),children:[/* @__PURE__ */ (0,N.jsx)(`input`,{type:`checkbox`,role:`switch`,id:s,checked:e,"aria-checked":e,disabled:g,"aria-busy":i||void 0,"aria-label":d,"aria-describedby":f,"aria-keyshortcuts":p,"data-testid":m,onChange:e=>n(e.target.checked),className:`peer sr-only`}),/* @__PURE__ */ (0,N.jsx)(`span`,{"aria-hidden":`true`,className:l(U,ue[o],pe[o],a&&W,i&&de[o]),children:i&&/* @__PURE__ */ (0,N.jsx)(`span`,{className:l(`absolute z-1 grid place-items-center text-(--color-primary-text) [transition:translate_var(--motion-short)_var(--ease-out)]`,fe[o]),children:/* @__PURE__ */ (0,N.jsx)(t,{})})}),u]})}function ge({hint:e,shortcut:t,ref:n,...r}){return e===void 0?/* @__PURE__ */ (0,N.jsx)(G,{...r,ref:n}):/* @__PURE__ */ (0,N.jsx)(s,{relationship:`description`,content:e,shortcut:t,children:/* @__PURE__ */ (0,N.jsx)(G,{...r,ref:n})})}S({maxEdgePx:y().int().min(1),patchPx:y().int().min(1).nullable(),maxPatches:y().int().min(1).nullable()}).refine(e=>e.patchPx===null==(e.maxPatches===null),{message:`patchPx and maxPatches are null together`});var _e=S({width:y().int().min(1),height:y().int().min(1)});function ve(e,t){return Math.ceil(e.width/t.patchPx)*Math.ceil(e.height/t.patchPx)}var K=T([`image/png`,`image/jpeg`,`image/webp`,`application/pdf`,`text/plain`,`text/markdown`]),ye=[`image/png`,`image/jpeg`,`image/webp`],be=[`text/plain`,`text/markdown`];function q(e){return ye.includes(e)}function xe(e){return be.includes(e)}var Se={"image/png":5e7,"image/jpeg":5e7,"image/webp":5e7,"application/pdf":5e7,"text/plain":4e6,"text/markdown":4e6},Ce=_e,we=T([`pending`,`sent`]),Te=S({id:C(),projectId:C(),fileName:b().min(1).max(255),mediaType:K,byteSize:y().int().min(1),pageCount:y().int().min(1).nullable(),image:Ce.nullable(),state:we,createdAt:v()}).strict().superRefine((e,t)=>{e.mediaType===`application/pdf`!=(e.pageCount!==null)&&t.addIssue({code:`custom`,message:`pageCount is set exactly for application/pdf`,path:[`pageCount`]}),q(e.mediaType)!==(e.image!==null)&&t.addIssue({code:`custom`,message:`image is set exactly for an image media type`,path:[`image`]})}),Ee=T([`media_type`,`file_bytes`,`image_bytes`,`image_edge`,`image_patches`,`pdf_pages`,`request_bytes`,`files_bytes`,`images_count`,`many_images_edge`,`context_window`]),De=S({requestMaxBytes:y().int().min(1).nullable(),fileMaxBytes:y().int().min(1).nullable(),filesMaxBytesPerRequest:y().int().min(1).nullable(),imageMaxBase64Bytes:y().int().min(1).nullable(),imageMaxEdgePx:y().int().min(1).nullable(),imageMaxPatches:S({patchPx:y().int().min(1),maxPatches:y().int().min(1)}).nullable(),manyImages:S({over:y().int().min(1),maxEdgePx:y().int().min(1)}).nullable(),imagesMaxPerRequest:y().int().min(1).nullable(),pdfMaxPagesPerRequest:y().int().min(1).nullable()}),Oe=S({mediaTypes:w(K).min(1),facts:De}).nullable();function ke(e){return 4*Math.ceil(e/3)}function Ae(e,t){let n=J(e,t);if(!n.ok||t===null)return n;if(e.mediaType===`application/pdf`){if(e.pageCount===null)throw Error(`checkAttachmentFitsModel: an application/pdf attachment has no page count`);let{pdfMaxPagesPerRequest:n}=t.facts;if(n!==null&&e.pageCount>n)return{ok:!1,fact:`pdf_pages`}}return{ok:!0}}function J(e,t){if(t===null||!t.mediaTypes.includes(e.mediaType))return{ok:!1,fact:`media_type`};let{facts:n}=t,r=q(e.mediaType),i=ke(e.byteSize);if(!r&&n.fileMaxBytes!==null&&e.byteSize>n.fileMaxBytes)return{ok:!1,fact:`file_bytes`};if(r&&n.imageMaxBase64Bytes!==null&&i>n.imageMaxBase64Bytes)return{ok:!1,fact:`image_bytes`};if(n.requestMaxBytes!==null&&i>n.requestMaxBytes)return{ok:!1,fact:`request_bytes`};if(r){let{image:t}=e;if(t===null)throw Error(`checkAttachmentFitsModel: an ${e.mediaType} attachment has no image size`);if(n.imageMaxEdgePx!==null&&Math.max(t.width,t.height)>n.imageMaxEdgePx)return{ok:!1,fact:`image_edge`};let r=n.imageMaxPatches;if(r!==null&&ve(t,r)>r.maxPatches)return{ok:!1,fact:`image_patches`}}return{ok:!0}}var je={invalidFileName:`chat_attachments.invalid_file_name`,emptyFile:`chat_attachments.empty_file`,contentMismatch:`chat_attachments.content_mismatch`,textNotUtf8:`chat_attachments.text_not_utf8`,pdfEncrypted:`chat_attachments.pdf_encrypted`,pdfUnreadable:`chat_attachments.pdf_unreadable`,imageUnreadable:`chat_attachments.image_unreadable`,notFound:`chat_attachments.not_found`,alreadySent:`chat_attachments.already_sent`,unsupportedByModel:`chat_attachments.unsupported_by_model`};S({declared:K}).strict(),S({attachmentIds:w(C()).min(1)}).strict();var Me=S({modelId:b().min(1),attachmentIds:w(C()).min(1),fact:Ee,factValue:y().nullable()}).strict(),Y=e=>encodeURIComponent(e);function X(e,t){let n=t.toString();return n===``?e:`${e}?${n}`}var Z={conversationList:{method:`GET`,path:e=>{let t=new URLSearchParams;return t.set(`projectId`,e.projectId),t.set(`limit`,String(e.limit)),e.cursor!==null&&t.set(`cursor`,e.cursor),e.search!==null&&t.set(`search`,e.search),X(`/assistant/conversations`,t)}},conversationCreate:{method:`POST`,path:()=>`/assistant/conversations`},conversationDelete:{method:`DELETE`,path:e=>`/assistant/conversations/${Y(e)}`},conversationPermissionMode:{method:`PATCH`,path:e=>`/assistant/conversations/${Y(e)}`},lastPermissionModeRead:{method:`GET`,path:()=>`/assistant/permission-mode`},lastPermissionModeWrite:{method:`PATCH`,path:()=>`/assistant/permission-mode`},conversationMessages:{method:`GET`,path:(e,t)=>{let n=new URLSearchParams({limit:String(t.limit),offset:String(t.offset)});return t.decisionLaneId!==void 0&&n.set(`decisionLaneId`,t.decisionLaneId),X(`/assistant/conversations/${Y(e)}/messages`,n)}},browserApiHostActionResolve:{method:`POST`,path:(e,t)=>`/assistant/conversations/${Y(e)}/host-actions/${Y(t)}/resolve`},browserApiHostActionPersist:{method:`POST`,path:(e,t)=>`/assistant/conversations/${Y(e)}/host-actions/${Y(t)}/persist`},hostActionRefusal:{method:`POST`,path:(e,t)=>`/assistant/conversations/${Y(e)}/host-actions/${Y(t)}/refusal`},availableModels:{method:`GET`,path:()=>`/ai-settings/available-models`},subscription:{method:`GET`,path:()=>`/subscription`},aiSettingsUser:{method:`GET`,path:()=>`/ai-settings/user`},agentList:{method:`GET`,path:e=>X(`/agents`,new URLSearchParams({limit:String(e.limit),offset:String(e.offset)}))},myLiveBrowserTasks:{method:`GET`,path:(e,t)=>X(`/test-runs`,new URLSearchParams({projectId:e,assignedToMe:`true`,launchKind:`preset`,status:`in_progress`,executor:`browser`,limit:String(t.limit),offset:String(t.offset)}))},workflowCancel:{method:`POST`,path:e=>`/workflows/${Y(e)}/cancel`},attachmentUpload:{method:`POST`,path:(e,t)=>`/assistant/projects/${Y(e)}/attachments?fileName=${encodeURIComponent(t)}`},attachmentDelete:{method:`DELETE`,path:e=>`/assistant/attachments/${Y(e)}`},attachmentContent:{method:`GET`,path:e=>`/assistant/attachments/${Y(e)}/content`},changeSetSnapshot:{method:`GET`,path:(e,t)=>`/assistant/projects/${Y(e)}/change-sets/${Y(t)}`},changeSetCommand:{method:`POST`,path:(e,t,n)=>`/assistant/projects/${Y(e)}/change-sets/${Y(t)}/${n}`},changeSetUndo:{method:`POST`,path:e=>`/assistant/change-sets/${Y(e)}/undo`},changeSetSecretHandoff:{method:`POST`,path:(e,t)=>`/assistant/projects/${Y(e)}/change-sets/${Y(t)}/handoff-token`},agentJobStatus:{method:`GET`,path:e=>`/agent-jobs/${Y(e)}/status`},agentJobCommand:{method:`POST`,path:(e,t)=>`/agent-jobs/${Y(e)}/${t}`},scenarioSteps:{method:`GET`,path:(e,t)=>X(`/scenarios/${Y(e)}/steps`,new URLSearchParams({limit:String(t.limit),offset:String(t.offset)}))},scenarioRuns:{method:`GET`,path:(e,t)=>X(`/scenario-runs/scenario/${Y(e)}`,new URLSearchParams({limit:String(t.limit),offset:String(t.offset),includeOutdated:`true`}))},searchPage:{method:`GET`,path:(e,t,n)=>{let r=new URLSearchParams;r.set(`q`,t.query);for(let e of t.entityTypes)r.append(`entityTypes`,e);return r.set(`limit`,String(n.limit)),r.set(`cursor`,n.cursor),X(`/assistant/projects/${Y(e)}/search`,r)}}};function Q(e){return e.selectable&&e.sendable}var Ne=[`fastest`,`balanced`,`smartest`],Pe=[`managed`,`company`,`personal`],Fe=S({id:b().min(1),name:b(),selectionId:b().min(1),selectable:x(),sendable:x(),disabledReason:T([`key_invalid`,`no_key`]).nullable(),tier:b(),reasoning:x(),attachments:Oe}),Ie=S({defaultSelectionId:b().nullable(),policyVersion:b(),providers:w(S({type:b(),models:w(Fe)}))}),Le=S({plan:b()});function $(e){return Pe.includes(e)}function Re(e){return Ne.includes(e)}var ze=[`Claude `,`Anthropic `];function Be(e){for(let t of ze)if(e.startsWith(t)){let n=e.slice(t.length).trim();if(n!==``)return n}return e}function Ve(e,t){let n=/* @__PURE__ */ new Map,r=[],i=[];for(let t of e.providers){if(!$(t.type)){r.push({type:t.type,modelIds:t.models.map(e=>e.id)});continue}let e=t.type,a=t.models.flatMap(t=>Re(t.tier)?[{id:t.id,name:t.name,shortName:Be(t.name),selectionId:t.selectionId,selectable:t.selectable,sendable:t.sendable,disabledReason:t.disabledReason,tier:t.tier,reasoning:t.reasoning,attachments:t.attachments}]:(i.push({type:e,modelId:t.id,tier:t.tier}),[]));if(a.length===0)continue;let o=n.get(e);n.set(e,o===void 0?{source:e,models:a}:{...o,models:[...o.models,...a]})}return(r.length>0||i.length>0)&&t.warn(`available-models: wire values outside the client contract were dropped`,{policyVersion:e.policyVersion,droppedBuckets:r,droppedModels:i}),{groups:[...n.values()],defaultSelectionId:e.defaultSelectionId}}function He(e,t){let n=e.groups.find(e=>e.source===t.keySource);if(n===void 0)return null;let r=n.models.find(e=>e.id===t.modelId);return r===void 0||!Q(r)?null:r.selectionId}function Ue(e,t,n){let{groups:r,defaultSelectionId:i}=e,a=e=>{for(let t of r){let n=t.models.find(t=>t.selectionId===e);if(n!==void 0)return{model:n,source:t.source}}return null};if(t!==null){let e=a(t);if(e!==null)return e}if(n!==null){let e=r.find(e=>e.source===n.provider),t=e==null?void 0:e.models.find(e=>e.id===n.model);if(e!==void 0&&t!==void 0)return{model:t,source:e.source}}if(i!==null){let e=a(i);if(e!==null&&Q(e.model))return e}return null}function We(e){let{http:t,logger:n}=e;return{async load(){let[e,r]=await Promise.all([t.request({method:Z.availableModels.method,path:Z.availableModels.path(),schema:Ie}),t.request({method:Z.subscription.method,path:Z.subscription.path(),schema:Le})]),i=Ve(e,n);return{groups:i.groups,defaultSelectionId:i.defaultSelectionId,isEnterprise:r.plan===`enterprise`}}}}var Ge=class extends Error{constructor(e){super(e.message),this.name=`ChatHttpError`,this.status=e.status,this.errorCode=e.errorCode,this.params=e.params}};export{k as C,D,O as E,E as O,A as S,te as T,le as _,He as a,P as b,Se as c,Ae as d,J as f,H as g,ge as h,Q as i,Te as l,xe as m,We as n,Z as o,q as p,Ue as r,je as s,Ge as t,Me as u,ce as v,ne as w,j as x,oe as y};
@@ -1,21 +0,0 @@
1
- import{r as e}from"./shared-hePW80VL.js";import{$r as t,Dr as n,Ea as r,Jr as i,Kr as a,Lr as o,Pa as s,Qn as c,Ta as l,Xr as u,bi as d,ca as f,ei as p,er as m,gi as h,hi as g,ii as _,mi as v,sa as y,si as b,tr as x,vi as S,wo as C,yi as w}from"./shared-O0OgUhxM.js";import{$n as T,Bn as E,Gn as D,Vn as ee,jn as te,t as O}from"./shared-UK_0TOj7.js";import{C as ne,D as k,E as A,T as re,_ as ie,g as ae,h as oe,t as j,x as se}from"./shared-Ccz3X65G.js"
2
- /**
3
- * @license lucide-react v0.574.0 - ISC
4
- *
5
- * This source code is licensed under the ISC license.
6
- * See the LICENSE file in the root directory of this source tree.
7
- */
8
- ;var M=w(`bell-off`,[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M17 17H4a1 1 0 0 1-.74-1.673C4.59 13.956 6 12.499 6 8a6 6 0 0 1 .258-1.742`,key:`178tsu`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M8.668 3.01A6 6 0 0 1 18 8c0 2.687.77 4.653 1.707 6.05`,key:`1hqiys`}]]),N=w(`bell`,[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}]]),P=w(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),ce=O(`pgs-c323e6f59d`)
9
- /**
10
- * @license lucide-react v0.574.0 - ISC
11
- *
12
- * This source code is licensed under the ISC license.
13
- * See the LICENSE file in the root directory of this source tree.
14
- */
15
- /**
16
- * @license lucide-react v0.574.0 - ISC
17
- *
18
- * This source code is licensed under the ISC license.
19
- * See the LICENSE file in the root directory of this source tree.
20
- */
21
- ;function le(){return{start(e,t){let n=!1,r=null,i=null,a=0,o=e=>{n||(ce.error(`pgm-9dc91cfaa1`,{windowId:r,error:e.message}),t(e))},s=t=>{n||t===i||(i=t,e(t))},c=()=>{if(r===null)return;let e=++a;chrome.tabs.query({active:!0,windowId:r}).then(t=>{var n;if(e!==a)return;let i=(n=t[0])==null?void 0:n.id;if(i===void 0){o(/* @__PURE__ */ Error(`The window ${String(r)} of this document has no active tab`));return}s(i)},e=>{o(F(e))})},l=e=>{e.windowId===r&&(a+=1,s(e.tabId))},u=e=>{e===r&&c()};return chrome.windows.getCurrent().then(e=>{if(!n){if(e.id===void 0){o(/* @__PURE__ */ Error(`chrome.windows.getCurrent() answered a window without an id`));return}r=e.id,chrome.tabs.onActivated.addListener(l),chrome.windows.onFocusChanged.addListener(u),c()}},e=>{o(F(e))}),()=>{n=!0,chrome.tabs.onActivated.removeListener(l),chrome.windows.onFocusChanged.removeListener(u)}}}}function F(e){return e instanceof Error?e:Error(String(e))}var I=O(`pgs-1f4abfc72f`);function L(e){return e instanceof Error?e.message:String(e)}function ue(e,t){r.call(`OPEN_NOTIFICATION_TARGET`,{notificationId:e.id,target:e.target,windowId:t}).then(t=>{t.success||I.error(`pgm-9d95f41149`,{notificationId:e.id,error:t.error})},t=>{I.error(`pgm-75d229efd3`,{notificationId:e.id,error:L(t)})})}function de(e){r.call(`NOTIFICATIONS_REFRESH`).then(t=>{t.success||I.warn(`pgm-f7016cc548`,{cause:e,error:t.error})},t=>{I.error(`pgm-da30882b0d`,{cause:e,error:L(t)})})}var R=/* @__PURE__ */ e(f(),1),z=`notifications:snapshot`,B=T({offset:!0}),fe=ee({userId:D().min(1),waitingCount:E().int().min(0),unseenCount:E().int().min(0),attentionToken:D().min(1),disabledGroups:te(D().min(1)),nextExpiryAt:B.nullable(),fetchedAt:B}).strict();function V(e){return e===void 0?null:fe.parse(e)}function pe(e,t){if(e.length!==t.length)return!1;let n=new Set(e);return t.every(e=>n.has(e))}function me(e){let t=(t,n)=>{if(n!==`local`)return;let r=t[z];r!==void 0&&e(V(r.newValue))};return chrome.storage.onChanged.addListener(t),()=>chrome.storage.onChanged.removeListener(t)}var he=O(`pgs-f455a5ff56`);function ge(e,t){return e===null||t===null?e!==t:e.userId!==t.userId||e.attentionToken!==t.attentionToken||t.unseenCount>e.unseenCount||!pe(e.disabledGroups,t.disabledGroups)}function _e(e){let[t,n]=(0,R.useState)({status:`loading`});if((0,R.useEffect)(()=>{let e=!0,t=!1,r=e=>{n(t=>t.status===`ready`?{status:`ready`,snapshot:e,revision:ge(t.snapshot,e)?t.revision+1:t.revision}:{status:`ready`,snapshot:e,revision:0})},i=t=>{if(!e)return;let r=t instanceof Error?t:Error(String(t));he.error(`pgm-bbac8e31b8`,{error:r.message}),n({status:`failed`,error:r})},a=me(n=>{e&&(t=!0,r(n))});return chrome.storage.local.get(z).then(n=>{if(e&&!t)try{r(V(n[z]))}catch(e){i(e)}},e=>{i(e)}),()=>{e=!1,a()}},[]),t.status===`failed`)throw t.error;return t.status===`loading`||t.snapshot===null||t.snapshot.userId===e?t:{status:`ready`,snapshot:null,revision:t.revision}}var ve=O(`pgs-c9315bb341`);function ye(){let[e,t]=(0,R.useState)({status:`loading`});if((0,R.useEffect)(()=>{let e=!0;return chrome.windows.getCurrent().then(n=>{if(e){if(n.id===void 0){t({status:`failed`,error:/* @__PURE__ */ Error(`chrome.windows.getCurrent() answered a window without an id`)});return}t({status:`ready`,windowId:n.id})}},n=>{if(!e)return;let r=n instanceof Error?n:Error(String(n));ve.error(`pgm-2ad602d0e7`,{error:r.message}),t({status:`failed`,error:r})}),()=>{e=!1}},[]),e.status===`failed`)throw e.error;return e.status===`ready`?e.windowId:void 0}var H=y(),U=99,be={web:`chrome`,popup:`notification-window`,panel:`notification-window`};function xe(e,t){if(t===null)return e(`notifications.bell.name`);let n=[];return t.waitingCount>0&&n.push(e(`notifications.bell.waiting`,{count:t.waitingCount})),t.unseenCount>0&&n.push(e(`notifications.bell.unseen`,{count:t.unseenCount})),n.length===0?e(`notifications.bell.name`):e(`notifications.bell.nameWithCounts`,{counts:n.join(`, `)})}function Se({host:e,t,counts:n,onClick:r,popoverOpen:i,ref:a}){let o=n===null?0:n.waitingCount+n.unseenCount,[s,c]=(0,R.useState)(o),[l,u]=(0,R.useState)(0);o!==s&&(c(o),o>s&&u(e=>e+1));let f=xe(t,n),m=i===!0,h=n!==null&&n.waitingCount>0,g=/* @__PURE__ */ (0,H.jsxs)(`button`,{ref:a,type:`button`,onClick:r,...i===void 0?{}:{"aria-haspopup":`dialog`,"aria-expanded":m},...m?{"aria-label":f}:{},className:p(`relative inline-grid size-8 flex-none cursor-pointer place-items-center rounded-full border-0 bg-transparent p-0 transition-[background-color,color,transform] duration-(--motion-short) ease-(--ease-out) hover:bg-surface-hover-layer hover:text-fg-primary focus-visible:outline-2 focus-visible:outline-stroke-focus active:scale-[.94] active:duration-(--motion-instant)`,o>0?`text-fg-primary`:`text-fg-muted`,m?`bg-surface-active-layer text-fg-primary`:``),children:[/* @__PURE__ */ (0,H.jsx)(N,{"aria-hidden":`true`,className:p(`size-[18px] origin-[50%_2px]`,l>0?`animate-notification-bell-ring motion-reduce:animate-none`:``)},l),o>0?/* @__PURE__ */ (0,H.jsx)(x,{tone:h?`primary`:`quiet`,ring:be[e],children:o>U?`${U}+`:o}):null]});return/* @__PURE__ */ (0,H.jsx)(d,{relationship:`label`,content:f,placement:`bottom-end`,disabled:m,children:g})}var W={conversation:ne,page:re},Ce={answered:S,cancelled:_,expired:k},we={neutral:null,positive:v,negative:g},Te={answered:`notifications.resolution.answered`,cancelled:`notifications.resolution.cancelled`,expired:`notifications.resolution.expired`};function G(e){if(e.class===`action_required`)return e.resolution===null?W[e.target.kind]:Ce[e.resolution];let t=we[e.tone];return t===null?W[e.target.kind]:t}function Ee(e){return e.class!==`informational`||e.tone===`neutral`?null:e.tone}function De(e,t,n){return t.kind===`conversation`?{label:e(`notifications.action.openChat`),mark:/* @__PURE__ */ (0,H.jsx)(h,{"aria-hidden":`true`}),external:!1}:n===`web`?{label:e(`notifications.action.go`),mark:/* @__PURE__ */ (0,H.jsx)(h,{"aria-hidden":`true`}),external:!1}:{label:e(`notifications.action.openInWeb`),mark:/* @__PURE__ */ (0,H.jsx)(A,{"aria-hidden":`true`}),external:!0}}var Oe=6e4,K=60,q=1440;function J(e,t){let n=Math.floor(t/Oe);return n<1?e(`notifications.duration.lessThanMinute`):n<K?e(`notifications.duration.minutes`,{count:n}):n<q?e(`notifications.duration.hours`,{count:Math.floor(n/K)}):e(`notifications.duration.days`,{count:Math.floor(n/q)})}function Y(e,t){return t.project!==null&&t.body!==``?e(`notifications.projectLine`,{project:t.project.name,body:t.body}):t.project===null?t.body===``?null:t.body:t.project.name}var ke=[`today`,`yesterday`,`earlier`],Ae={today:`notifications.feed.today`,yesterday:`notifications.feed.yesterday`,earlier:`notifications.feed.earlier`};function je(e,t){return e(Ae[t])}function X(e,t){let n=new Date(e);return new Date(n.getFullYear(),n.getMonth(),n.getDate()-t).getTime()}function Me(e,t){let n=Date.parse(e);return n>=X(t,0)?`today`:n>=X(t,1)?`yesterday`:`earlier`}var Ne=/* @__PURE__ */ new Map,Pe=/* @__PURE__ */ new Map;function Fe(e){let t=Ne.get(e);return t===void 0&&(t=new Intl.DateTimeFormat(e,{hour:`2-digit`,minute:`2-digit`}),Ne.set(e,t)),t}function Ie(e,t){let n=`${e}:${t?`y`:`-`}`,r=Pe.get(n);return r===void 0&&(r=new Intl.DateTimeFormat(e,t?{day:`numeric`,month:`short`,year:`numeric`}:{day:`numeric`,month:`short`}),Pe.set(n,r)),r}function Le(e,t,n,r){let i=Date.parse(n);switch(Me(n,r)){case`today`:return J(e,r-i);case`yesterday`:return Fe(t).format(i);case`earlier`:return Ie(t,new Date(i).getFullYear()!==new Date(r).getFullYear()).format(i)}}var Re=`overflow-hidden rounded-lg border border-[color-mix(in_srgb,var(--color-primary)_var(--notification-deck-edge),var(--color-border))] bg-[color-mix(in_srgb,var(--color-primary)_var(--notification-deck-tint),var(--nf-surface))] shadow-[var(--shadow-md),var(--glow-primary-sm)] animate-notification-deck-in motion-reduce:animate-none`,ze=`border-0 border-t border-t-[color-mix(in_srgb,var(--color-primary)_20%,transparent)]`,Be=`hover:bg-[color-mix(in_srgb,var(--color-primary)_10%,transparent)] active:bg-[color-mix(in_srgb,var(--color-primary)_15%,transparent)]`;function Ve({entries:e,count:t,host:n,t:r,now:i,onOpen:a,onLeft:o,footer:s,className:c}){let l=(0,R.useId)();return/* @__PURE__ */ (0,H.jsxs)(`section`,{"aria-labelledby":l,className:p(Re,c),children:[/* @__PURE__ */ (0,H.jsxs)(`div`,{className:`flex items-center gap-2 pt-[9px] pr-3 pb-[7px] pl-[calc(var(--nf-x)-1px)]`,children:[/* @__PURE__ */ (0,H.jsx)(`i`,{"aria-hidden":`true`,className:`size-2 flex-none rounded-full bg-(--color-primary-400) shadow-[0_0_0_3px_var(--color-ring-primary-25)] animate-pulse-dot`}),/* @__PURE__ */ (0,H.jsx)(`h3`,{id:l,className:`m-0 text-(length:--text-body-sm) leading-5 font-semibold tracking-[-0.1px] text-fg-on-primary-tint`,children:r(`notifications.deck.title`)}),/* @__PURE__ */ (0,H.jsx)(`span`,{className:`h-5 min-w-5 rounded-full bg-primary px-1.5 text-center text-(length:--text-caption) leading-5 font-semibold text-fg-on-accent tabular-nums`,children:t})]}),e.map(e=>/* @__PURE__ */ (0,H.jsx)(He,{entry:e,host:n,t:r,now:i,onOpen:a,onLeft:o},e.item.id)),s===void 0?null:/* @__PURE__ */ (0,H.jsxs)(`button`,{type:`button`,onClick:s.onClick,className:`flex h-9 w-full cursor-pointer items-center gap-1.5 bg-transparent pr-2.5 pl-[calc(var(--nf-x)-1px)] text-left text-(length:--text-body-sm) font-medium text-(--color-primary-text) focus-visible:rounded-md focus-visible:outline-2 focus-visible:-outline-offset-3 focus-visible:outline-stroke-focus [&_svg]:ml-auto [&_svg]:size-3.5 ${ze} hover:bg-[color-mix(in_srgb,var(--color-primary)_10%,transparent)]`,children:[s.label,/* @__PURE__ */ (0,H.jsx)(h,{"aria-hidden":`true`})]})]})}function He({entry:e,host:t,t:n,now:r,onOpen:i,onLeft:a}){let{item:o,leaving:s}=e,c=G(o),l=Y(n,o),u=De(n,o.target,t),d=Ue(o,r);return/* @__PURE__ */ (0,H.jsxs)(`button`,{type:`button`,"data-feed-row":``,onClick:()=>i(o),onAnimationEnd:e=>{s&&e.target===e.currentTarget&&a(o.id)},className:p(`group relative grid w-full cursor-pointer grid-cols-[32px_minmax(0,1fr)_auto] items-center gap-x-3 bg-transparent pt-2.5 pr-2 pb-3 pl-[calc(var(--nf-x)-1px)] text-left text-inherit transition-[background-color] duration-(--motion-short) ease-(--ease-out) focus-visible:rounded-md focus-visible:outline-2 focus-visible:-outline-offset-3 focus-visible:outline-stroke-focus @max-[350px]:gap-x-2.5`,ze,Be,s?`animate-notification-leave motion-reduce:[animation-duration:1ms]`:``),children:[/* @__PURE__ */ (0,H.jsx)(`span`,{"aria-hidden":`true`,className:`grid size-8 place-items-center self-start rounded-md border border-[color-mix(in_srgb,var(--color-primary)_40%,transparent)] bg-surface-primary-tint-15 text-(--color-primary-text) [&_svg]:size-[15px]`,children:/* @__PURE__ */ (0,H.jsx)(c,{})}),/* @__PURE__ */ (0,H.jsxs)(`span`,{className:`grid min-w-0 gap-px`,children:[/* @__PURE__ */ (0,H.jsx)(`span`,{className:`text-sm leading-[1.35] font-semibold tracking-[-0.15px] text-fg-primary [overflow-wrap:anywhere]`,children:o.title}),l===null?null:/* @__PURE__ */ (0,H.jsx)(`span`,{className:`text-(length:--text-notification-detail) leading-[1.45] text-fg-secondary [overflow-wrap:anywhere]`,children:l}),/* @__PURE__ */ (0,H.jsx)(`span`,{className:`mt-[3px] flex items-center gap-[5px] text-xs leading-4 text-fg-secondary tabular-nums [&_svg]:size-3`,children:d===null?/* @__PURE__ */ (0,H.jsx)(`span`,{children:n(`notifications.deck.waitingFor`,{duration:J(n,r-Date.parse(o.createdAt))})}):/* @__PURE__ */ (0,H.jsxs)(H.Fragment,{children:[/* @__PURE__ */ (0,H.jsx)(k,{"aria-hidden":`true`}),/* @__PURE__ */ (0,H.jsx)(`span`,{children:n(`notifications.deck.timeLeft`,{duration:J(n,d.left)})})]})})]}),/* @__PURE__ */ (0,H.jsxs)(`span`,{className:`inline-flex h-7 items-center gap-0.5 rounded-sm pr-1 pl-2.5 text-(length:--text-body-sm) font-medium whitespace-nowrap text-(--color-primary-text) transition-[background-color] duration-(--motion-short) ease-(--ease-out) group-hover:bg-surface-primary-tint-15 [&_svg]:size-3.5 [&_svg]:transition-transform [&_svg]:duration-(--motion-medium) [&_svg]:ease-(--ease-out) @max-[350px]:w-6 @max-[350px]:justify-center @max-[350px]:p-0`,children:[/* @__PURE__ */ (0,H.jsx)(`span`,{className:`@max-[350px]:sr-only`,children:u.label}),/* @__PURE__ */ (0,H.jsx)(`span`,{className:p(`inline-flex`,u.external?``:`group-hover:[&_svg]:translate-x-0.5`),children:u.mark})]}),d===null?null:/* @__PURE__ */ (0,H.jsx)(`span`,{"aria-hidden":`true`,className:`absolute right-3 bottom-1 left-[calc(var(--nf-x)-1px)] h-0.5 overflow-hidden rounded-full bg-[color-mix(in_srgb,var(--color-primary)_20%,transparent)]`,children:/* @__PURE__ */ (0,H.jsx)(`i`,{className:`block h-full rounded-[inherit] bg-(--color-primary-400)`,style:{width:`${d.fraction*100}%`}})})]})}function Ue(e,t){if(e.expiresAt===null)return null;let n=Date.parse(e.expiresAt),r=n-Date.parse(e.createdAt),i=Math.max(0,n-t);return{left:i,fraction:r>0?Math.min(1,i/r):0}}var We=`grid grid-cols-[32px_1fr_40px] items-center gap-3`,Ge=[`w-[70%]`,`w-[58%]`],Ke=[`w-[82%]`,`w-[64%]`,`w-[74%]`,`w-[52%]`];function qe({width:e,inDeck:t}){return/* @__PURE__ */ (0,H.jsxs)(`div`,{className:t?We:`${We} py-2 pr-2 pl-(--nf-x)`,children:[/* @__PURE__ */ (0,H.jsx)(n,{className:`size-7 rounded-sm`}),/* @__PURE__ */ (0,H.jsxs)(`div`,{className:`grid gap-1.5`,children:[/* @__PURE__ */ (0,H.jsx)(n,{className:`h-3 ${e}`}),/* @__PURE__ */ (0,H.jsx)(n,{className:`h-2.5 w-[34%]`})]}),/* @__PURE__ */ (0,H.jsx)(n,{className:`h-2.5 w-9`})]})}function Je({label:e}){return/* @__PURE__ */ (0,H.jsxs)(`div`,{role:`status`,"aria-label":e,children:[/* @__PURE__ */ (0,H.jsxs)(`div`,{className:`mt-0.5 mb-2.5 grid gap-3 rounded-lg border border-stroke pt-3 pr-3 pb-3.5 pl-[calc(var(--nf-x)-1px)]`,children:[/* @__PURE__ */ (0,H.jsx)(n,{className:`h-3 w-[84px]`}),Ge.map(e=>/* @__PURE__ */ (0,H.jsx)(qe,{width:e,inDeck:!0},e))]}),/* @__PURE__ */ (0,H.jsx)(n,{className:`mt-3 mb-1.5 ml-(--nf-x) h-2.5 w-[60px]`}),Ke.map(e=>/* @__PURE__ */ (0,H.jsx)(qe,{width:e,inDeck:!1},e))]})}function Ye({entries:e,t,locale:n,now:r,onOpen:i,onLanded:a}){let o=/* @__PURE__ */ new Map;for(let t of e){let e=Me(t.item.createdAt,r),n=o.get(e);n===void 0?o.set(e,[t]):n.push(t)}return/* @__PURE__ */ (0,H.jsx)(H.Fragment,{children:ke.map(e=>{let s=o.get(e);return s===void 0?null:/* @__PURE__ */ (0,H.jsx)(Xe,{title:je(t,e),rows:s,t,locale:n,now:r,onOpen:i,onLanded:a},e)})})}function Xe({title:e,rows:t,...n}){let r=(0,R.useId)();return/* @__PURE__ */ (0,H.jsxs)(H.Fragment,{children:[/* @__PURE__ */ (0,H.jsx)(`h3`,{id:r,className:`m-0 pt-2.5 pr-2 pb-[3px] pl-(--nf-x) text-xs leading-4 font-medium tracking-normal text-fg-muted`,children:e}),/* @__PURE__ */ (0,H.jsx)(`ul`,{"aria-labelledby":r,className:`m-0 grid list-none gap-px p-0`,children:t.map(e=>/* @__PURE__ */ (0,H.jsx)(`li`,{children:/* @__PURE__ */ (0,H.jsx)(nt,{entry:e,...n})},e.item.id))})]})}var Ze={new:`font-semibold text-fg-primary`,seen:`font-medium text-fg-primary`,read:`font-normal text-fg-secondary`},Qe=`border-stroke bg-surface-hover-layer text-fg-secondary`,$e=`border-stroke bg-surface-hover-layer text-fg-success`,et=p(i.error.edge,i.error.fill,i.error.ink),tt=`border-dashed border-stroke-hover bg-transparent text-fg-muted`;function nt({entry:e,t,locale:n,now:r,onOpen:i,onLanded:a}){let{item:o,reading:s,landed:c}=e,l=G(o),u=Y(t,o),d=o.class===`action_required`?o.resolution:null,f=Ee(o),m=d===null?f===`negative`?et:f===`positive`?$e:Qe:tt;return/* @__PURE__ */ (0,H.jsxs)(`button`,{type:`button`,"data-feed-row":``,"data-state":s,"data-tone":f===null?void 0:f,"data-closed":d===null?void 0:``,onClick:()=>i(o),onAnimationEnd:e=>{c&&e.target===e.currentTarget&&a(o.id)},className:p(`group grid w-full cursor-pointer grid-cols-[32px_minmax(0,1fr)_auto] items-start gap-x-3 rounded-md border-0 bg-transparent py-2 pr-2 pl-(--nf-x) text-left text-inherit transition-[background-color] duration-(--motion-instant) ease-(--ease-out) hover:bg-surface-hover-layer active:bg-surface-active-layer focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-stroke-focus @max-[350px]:gap-x-2.5`,c?`animate-notification-land motion-reduce:[animation-duration:1ms]`:``),children:[/* @__PURE__ */ (0,H.jsx)(`span`,{"aria-hidden":`true`,className:`mt-px grid size-7 place-items-center justify-self-start rounded-sm border [&_svg]:size-3.5 ${m}`,children:/* @__PURE__ */ (0,H.jsx)(l,{})}),/* @__PURE__ */ (0,H.jsxs)(`span`,{className:`grid min-w-0 gap-px`,children:[/* @__PURE__ */ (0,H.jsx)(`span`,{className:`text-(length:--text-notification-title) leading-[1.35] tracking-[-0.1px] [overflow-wrap:anywhere] ${Ze[s]}`,children:o.title}),u===null?null:/* @__PURE__ */ (0,H.jsx)(`span`,{className:`text-(length:--text-notification-detail) leading-[1.45] text-fg-muted [overflow-wrap:anywhere] group-hover:text-fg-secondary`,children:u}),d===null?null:/* @__PURE__ */ (0,H.jsx)(`span`,{className:`mt-1 inline-flex items-center gap-1 text-xs leading-4 text-fg-muted`,children:t(Te[d])})]}),/* @__PURE__ */ (0,H.jsxs)(`span`,{className:`flex items-center gap-[7px] pt-0.5 text-xs leading-[18px] whitespace-nowrap text-fg-muted tabular-nums group-hover:text-fg-secondary`,children:[Le(t,n,o.createdAt,r),s===`new`?/* @__PURE__ */ (0,H.jsxs)(H.Fragment,{children:[/* @__PURE__ */ (0,H.jsx)(`span`,{"aria-hidden":`true`,className:`size-2 flex-none rounded-full bg-(--color-primary-400) shadow-[0_0_0_3px_var(--color-ring-primary-25)]`}),/* @__PURE__ */ (0,H.jsx)(`span`,{className:`sr-only`,children:t(`notifications.feed.new`)})]}):null]})]})}function rt({children:e,align:t=`start`,className:n}){return/* @__PURE__ */ (0,H.jsxs)(`div`,{role:`alert`,className:p(`flex gap-1.5 text-xs leading-[1.45] text-fg-error [&>svg]:size-3.5 [&>svg]:flex-none`,t===`start`?`items-start [&>svg]:mt-px`:`items-center`,n),children:[/* @__PURE__ */ (0,H.jsx)(g,{"aria-hidden":`true`}),e]})}function it({onClick:e,children:t,size:n=`md`,className:r}){return/* @__PURE__ */ (0,H.jsx)(`button`,{type:`button`,onClick:e,className:p(`cursor-pointer rounded-xs border-0 bg-transparent px-0.5 font-medium text-(--color-primary-text) no-underline hover:underline hover:underline-offset-3 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-stroke-focus [&_svg]:ml-[3px] [&_svg]:inline [&_svg]:size-3 [&_svg]:align-[-1px]`,n===`md`?`py-1 text-(length:--text-body-sm)`:`py-0 text-xs`,r),children:t})}function at(e,t){let n=e=>e.class===`action_required`&&e.open?0:1;return n(e)-n(t)||Date.parse(t.createdAt)-Date.parse(e.createdAt)||(e.id<t.id?-1:+(e.id>t.id))}function ot(e){return e.map(e=>e.id).join(`|`)}function st(e){let t=e.filter(s),n=ot(t),[r,i]=(0,R.useState)(t),[a,o]=(0,R.useState)(n),[c,l]=(0,R.useState)(()=>/* @__PURE__ */ new Map),[u,d]=(0,R.useState)(()=>/* @__PURE__ */ new Set);if(a!==n){let a=new Set(t.map(e=>e.id)),c=new Set(e.filter(e=>!s(e)).map(e=>e.id)),u=r.filter(e=>!a.has(e.id)&&c.has(e.id));o(n),i(t),u.length>0&&l(e=>new Map([...e,...u.map(e=>[e.id,e])]))}let f=new Set(t.map(e=>e.id));return{deck:[...t.map(e=>({item:e,leaving:!1})),...[...c.values()].filter(e=>!f.has(e.id)).map(e=>({item:e,leaving:!0}))].sort((e,t)=>at(e.item,t.item)),openCount:t.length,history:e.filter(e=>!s(e)&&!c.has(e.id)),landedIds:u,onLeft:e=>{l(t=>{let n=new Map(t);return n.delete(e),n}),d(t=>/* @__PURE__ */ new Set([...t,e]))},onLanded:e=>{d(t=>{let n=new Set(t);return n.delete(e),n})}}}function ct(e,t){let n=new Set(e.map(e=>e.id));return[...e,...t.filter(e=>!n.has(e.id))]}async function lt(e,t,n,r){let i=[],a=0,o=0;for(;o<n;){let s=await e.list({locale:t,signal:r,limit:Math.min(500,n-o),offset:o});if(i=ct(i,s.items),a=s.total,o+=s.items.length,o>=s.total||s.items.length===0)break}return{items:i,total:a,nextOffset:o}}function ut(e,t){let n=[];for(let r=0;r<e.length;r+=t)n.push(e.slice(r,r+t));return n}var dt=2**31-1;function ft({api:e,locale:t,revision:n,logger:r,onSeen:i}){let[a,o]=(0,R.useState)({status:`loading`}),[c,l]=(0,R.useState)(0),[u,d]=(0,R.useState)(0),[f,p]=(0,R.useState)(()=>/* @__PURE__ */ new Set),m=ae(),h=(0,R.useRef)(null),g=(0,R.useRef)(null),_=(0,R.useRef)(/* @__PURE__ */ new Set),v=(0,R.useRef)(i),y=(0,R.useRef)(r);(0,R.useEffect)(()=>{v.current=i,y.current=r});let b=(0,R.useCallback)(e=>{h.current=e,o({status:`ready`,data:e,more:`idle`})},[]);(0,R.useEffect)(()=>{var n;let r=new AbortController;(n=g.current)==null||n.abort();let i=h.current;return(async()=>{if(i===null){let[n,i]=await Promise.all([e.list({locale:t,signal:r.signal}),e.listGroups({locale:t,signal:r.signal})]);return{items:n.items,total:n.total,nextOffset:n.items.length,pageLimit:n.limit,groups:i.items}}let[n,a]=await Promise.all([lt(e,t,Math.max(i.nextOffset,i.pageLimit),r.signal),e.listGroups({locale:t,signal:r.signal})]);return{...n,pageLimit:i.pageLimit,groups:a.items}})().then(e=>{r.signal.aborted||b(e)},e=>{if(!r.signal.aborted){if(i===null){o({status:`error`,retrying:!1});return}y.current.error(`notification feed: re-read failed`,{error:e}),o({status:`ready`,data:i,more:`idle`})}}),()=>r.abort()},[e,t,n,c,u,b]);let x=(0,R.useCallback)(()=>{o({status:`error`,retrying:!0}),l(e=>e+1)},[]),S=(0,R.useCallback)(()=>{var n;let r=h.current;if(r===null)throw Error(`notification feed: \u00AB\u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C \u0435\u0449\u0451\u00BB before the first page`);(n=g.current)==null||n.abort();let i=new AbortController;g.current=i,o({status:`ready`,data:r,more:`busy`}),e.list({locale:t,signal:i.signal,limit:r.pageLimit,offset:r.nextOffset}).then(e=>{if(i.signal.aborted)return;let t=h.current;t!==null&&b({...t,items:ct(t.items,e.items),total:e.total,nextOffset:t.nextOffset+e.items.length})},e=>{if(i.signal.aborted)return;y.current.error(`notification feed: next page failed`,{offset:r.nextOffset,error:e});let t=h.current;t!==null&&o({status:`ready`,data:t,more:`error`})})},[e,t,b]),C=a.status===`ready`?a.data.items:null;(0,R.useEffect)(()=>{if(C===null)return;let t=C.filter(e=>e.seenAt===null&&!_.current.has(e.id)).map(e=>e.id);if(t.length!==0){for(let e of t)_.current.add(e);p(e=>/* @__PURE__ */ new Set([...e,...t]));for(let n of ut(t,500))e.markSeen(n).then(e=>{var t;return(t=v.current)==null?void 0:t.call(v,e)},e=>{for(let e of n)_.current.delete(e);y.current.error(`notification feed: marking seen failed`,{count:n.length,error:e})})}},[e,C]);let w=C===null?null:C.reduce((e,t)=>{if(!s(t)||t.expiresAt===null)return e;let n=Date.parse(t.expiresAt);return e===null||n<e?n:e},null),T=(0,R.useRef)(null);return(0,R.useEffect)(()=>{if(w===null)return;let e=`${w}@${m}`;if(T.current===e)return;let t=w-Date.now();if(t>dt)return;let n=setTimeout(()=>{T.current=e,d(e=>e+1)},t);return()=>clearTimeout(n)},[w,m]),{load:a,freshIds:f,now:m,retry:x,loadMore:S}}var pt={web:`px-2 pt-1 pb-2.5`,popup:`px-2 pt-1.5 pb-3`,panel:`px-2.5 pt-2 pb-3.5`},mt=/* @__PURE__ */ new Set([`ArrowDown`,`ArrowUp`,`Home`,`End`]);function ht(e){var t;if(!mt.has(e.key))return;let n=[...e.currentTarget.querySelectorAll(`[data-feed-row]`)],r=n.findIndex(e=>e===document.activeElement);if(r===-1)return;let i=e.key===`Home`?0:e.key===`End`?n.length-1:e.key===`ArrowDown`?Math.min(n.length-1,r+1):Math.max(0,r-1);e.preventDefault(),(t=n[i])==null||t.focus()}function gt(e){let{api:t,locale:n,t:r,revision:i,logger:s,onSeen:c,host:l,onOpenSettings:u}=e,f=ft({api:t,locale:n,revision:i,logger:s,onSeen:c}),{load:p}=f;return/* @__PURE__ */ (0,H.jsxs)(`div`,{"data-host":l,className:`@container flex min-h-0 min-w-0 flex-col text-left [--nf-x:13px] ${l===`web`?`[--nf-surface:var(--color-bg-elevated)]`:`flex-1 [--nf-surface:var(--color-bg-notification-window)]`}`,children:[e.host===`web`?/* @__PURE__ */ (0,H.jsxs)(`div`,{className:`flex flex-none items-center gap-2 pt-3 pr-2.5 pb-1.5 pl-[calc(8px+var(--nf-x))]`,children:[/* @__PURE__ */ (0,H.jsx)(`h2`,{id:e.headingId,className:`m-0 mr-auto text-base leading-6 font-semibold tracking-[-0.35px] text-fg-primary`,children:r(`notifications.feed.title`)}),/* @__PURE__ */ (0,H.jsx)(d,{relationship:`label`,content:r(`notifications.feed.settings`),children:/* @__PURE__ */ (0,H.jsx)(a,{size:`sm`,icon:/* @__PURE__ */ (0,H.jsx)(P,{"aria-hidden":`true`}),onClick:u})})]}):null,/* @__PURE__ */ (0,H.jsx)(`div`,{onKeyDown:ht,className:`min-h-0 flex-1 overflow-y-auto [scrollbar-color:var(--scrollbar-thumb)_transparent] [scrollbar-width:thin] ${pt[l]}`,children:p.status===`loading`?/* @__PURE__ */ (0,H.jsx)(Je,{label:r(`notifications.feed.loading`)}):p.status===`error`?/* @__PURE__ */ (0,H.jsx)(_t,{host:l,children:/* @__PURE__ */ (0,H.jsx)(o,{icon:/* @__PURE__ */ (0,H.jsx)(se,{"aria-hidden":`true`}),title:r(`notifications.feed.errorTitle`),description:r(`notifications.feed.errorText`),retry:{label:r(`common.retry`),onRetry:f.retry,pending:p.retrying,pendingLabel:r(`common.loading`)},className:`[&_p]:max-w-70`})}):/* @__PURE__ */ (0,H.jsx)(vt,{...e,data:p.data,more:p.more,freshIds:f.freshIds,now:f.now,onLoadMore:f.loadMore})}),p.status===`ready`?/* @__PURE__ */ (0,H.jsx)(yt,{host:l,t:r,data:p.data,onOpenSettings:u}):null]})}function _t({host:e,children:t}){return/* @__PURE__ */ (0,H.jsx)(`div`,{className:p(`grid flex-1 content-center p-2`,e===`popup`?`min-h-80`:`min-h-[300px]`),children:t})}function vt({host:e,t,locale:n,data:r,more:i,freshIds:a,now:o,onLoadMore:s,onOpenTarget:c,onOpenSettings:l,focusFirstRow:d}){let f=st(r.items),[p,h]=(0,R.useState)(()=>/* @__PURE__ */ new Set),g=(0,R.useRef)(null),_=(0,R.useRef)(!1),v=r.items.length>0;(0,R.useEffect)(()=>{var e;d===!0&&!_.current&&v&&(_.current=!0,(e=g.current)==null||(e=e.querySelector(`[data-feed-row]`))==null||e.focus())},[d,v]);let y=e=>{h(t=>/* @__PURE__ */ new Set([...t,e.id])),c(e)},b=e=>e.readAt!==null||p.has(e.id)?`read`:e.seenAt===null||a.has(e.id)?`new`:`seen`;if(!v&&f.deck.length===0){let n=r.groups.length>0&&r.groups.every(e=>!e.enabled);return/* @__PURE__ */ (0,H.jsx)(_t,{host:e,children:n?/* @__PURE__ */ (0,H.jsx)(m,{icon:/* @__PURE__ */ (0,H.jsx)(M,{"aria-hidden":`true`}),title:t(`notifications.feed.allOffTitle`),description:t(`notifications.feed.allOffText`),className:`[&_p]:max-w-70`,action:/* @__PURE__ */ (0,H.jsx)(u,{variant:`primary`,onClick:l,children:e===`panel`?/* @__PURE__ */ (0,H.jsxs)(H.Fragment,{children:[t(`notifications.feed.configureInWeb`),/* @__PURE__ */ (0,H.jsx)(A,{"aria-hidden":`true`})]}):t(`notifications.feed.openSettings`)})}):/* @__PURE__ */ (0,H.jsx)(m,{icon:/* @__PURE__ */ (0,H.jsx)(N,{"aria-hidden":`true`}),title:t(`notifications.feed.emptyTitle`),description:t(`notifications.feed.emptyText`),className:`[&_p]:max-w-70`})})}return/* @__PURE__ */ (0,H.jsxs)(`div`,{ref:g,children:[f.deck.length>0?/* @__PURE__ */ (0,H.jsx)(Ve,{entries:f.deck,count:f.openCount,host:e,t,now:o,onOpen:y,onLeft:f.onLeft,className:`mt-0.5 mb-1.5`}):null,/* @__PURE__ */ (0,H.jsx)(Ye,{entries:f.history.map(e=>({item:e,reading:b(e),landed:f.landedIds.has(e.id)})),t,locale:n,now:o,onOpen:y,onLanded:f.onLanded}),r.nextOffset<r.total?/* @__PURE__ */ (0,H.jsxs)(`div`,{className:`mt-2 mb-0.5`,children:[i===`error`?/* @__PURE__ */ (0,H.jsx)(rt,{className:`mb-1.5 ml-(--nf-x)`,children:/* @__PURE__ */ (0,H.jsx)(`span`,{children:t(`notifications.feed.loadMoreFailed`)})}):null,/* @__PURE__ */ (0,H.jsx)(ie,{label:t(i===`error`?`common.retry`:`notifications.feed.loadMore`),loadingLabel:t(`notifications.feed.loadMore`),loading:i===`busy`,onLoadMore:s})]}):null]})}function yt({host:e,t,data:n,onOpenSettings:r}){let i=n.groups.filter(e=>!e.enabled);return i.length===0||i.length===n.groups.length?null:/* @__PURE__ */ (0,H.jsxs)(`div`,{className:`flex min-h-10 flex-none items-center gap-2 border-t border-stroke-light py-1.5 pr-2.5 pl-[calc(8px+var(--nf-x))] text-(length:--text-notification-detail) leading-[1.4] text-fg-secondary`,children:[/* @__PURE__ */ (0,H.jsx)(M,{"aria-hidden":`true`,className:`size-3.5 flex-none text-fg-muted`}),/* @__PURE__ */ (0,H.jsxs)(`p`,{className:`m-0 min-w-0 flex-1`,children:[t(`notifications.feed.disabled`),` `,/* @__PURE__ */ (0,H.jsx)(`b`,{className:`font-medium text-fg-primary`,children:i.map(e=>e.title).join(`, `)})]}),/* @__PURE__ */ (0,H.jsx)(it,{onClick:r,className:`flex-none`,children:e===`panel`?/* @__PURE__ */ (0,H.jsxs)(H.Fragment,{children:[t(`notifications.feed.configureInWeb`),/* @__PURE__ */ (0,H.jsx)(A,{"aria-hidden":`true`})]}):t(`notifications.feed.configure`)})]})}function bt({api:e,locale:t,t:n,waitingCount:r,revision:i,logger:a,onOpenTarget:o,onOpenFeed:c,onSeen:l,className:u}){let[d,f]=(0,R.useState)(null),m=ae(),h=(0,R.useRef)(a),g=(0,R.useRef)(l);if((0,R.useEffect)(()=>{h.current=a,g.current=l}),(0,R.useEffect)(()=>{if(r===0)return;let n=new AbortController;return e.list({locale:t,limit:2,offset:0,signal:n.signal}).then(t=>{if(n.signal.aborted)return;let r=t.items.filter(s);f(r);let i=r.filter(e=>e.seenAt===null).map(e=>e.id);i.length!==0&&e.markSeen(i).then(e=>{var t;return(t=g.current)==null?void 0:t.call(g,e)},e=>h.current.error(`waiting strip: marking seen failed`,{count:i.length,error:e}))},e=>{n.signal.aborted||h.current.error(`waiting strip: read failed`,{error:e})}),()=>n.abort()},[e,t,r,i]),r===0||d===null||d.length===0)return null;let _=r-d.length;return/* @__PURE__ */ (0,H.jsx)(`div`,{className:p(`@container flex-none [--nf-x:13px] [--nf-surface:var(--color-bg-notification-window)]`,u),children:/* @__PURE__ */ (0,H.jsx)(Ve,{entries:d.map(e=>({item:e,leaving:!1})),count:r,host:`popup`,t:n,now:m,onOpen:o,onLeft:()=>void 0,footer:{label:_>0?n(`notifications.deck.moreAndAll`,{count:_}):n(`notifications.deck.all`),onClick:c}})})}var xt=[[`w-[38%]`,`w-[74%]`],[`w-[52%]`,`w-[86%]`],[`w-[44%]`,`w-[68%]`]];function St({api:e,locale:r,t:i,logger:a,onChanged:o}){let[s,l]=(0,R.useState)({status:`loading`}),[d,f]=(0,R.useState)(0),[p,m]=(0,R.useState)(()=>/* @__PURE__ */ new Map),h=(0,R.useRef)(/* @__PURE__ */ new Map),_=(0,R.useRef)(a),v=(0,R.useRef)(o);(0,R.useEffect)(()=>{_.current=a,v.current=o});let y=(0,R.useRef)(!0);(0,R.useEffect)(()=>{y.current=!0;let e=h.current;return()=>{y.current=!1;for(let t of e.values())t.next=null}},[]),(0,R.useEffect)(()=>{let t=new AbortController;return e.listGroups({locale:r,signal:t.signal}).then(e=>{t.signal.aborted||l({status:`ready`,groups:e.items})},()=>{t.signal.aborted||l({status:`error`,retrying:!1})}),()=>t.abort()},[e,r,d]);let x=(0,R.useCallback)((e,t)=>{m(n=>{let r=new Map(n);return t===null?r.delete(e):r.set(e,t),r})},[]),S=(0,R.useCallback)((t,n)=>{let i=h.current.get(t);i===void 0&&(i={inFlight:!1,next:null},h.current.set(t,i));let a=i;a.inFlight=!0,x(t,{shown:n,busy:!0,failed:null});let o=e=>{if(a.inFlight=!1,y.current){if(a.next!==null){let e=a.next;a.next=null,S(t,e);return}x(t,e===null?null:{shown:!e,busy:!1,failed:e})}};e.setGroupEnabled(t,n,{locale:r}).then(e=>{var t;l(t=>t.status===`ready`?{status:`ready`,groups:t.groups.map(t=>t.key===e.key?e:t)}:t),y.current&&((t=v.current)==null||t.call(v,e)),o(null)},e=>{_.current.error(`notification groups: save failed`,{key:t,enabled:n,error:e}),o(n)})},[e,r,x]),C=(e,t)=>{let n=h.current.get(e);if((n==null?void 0:n.inFlight)===!0){n.next=t,x(e,{shown:t,busy:!0,failed:null});return}S(e,t)};return s.status===`loading`?/* @__PURE__ */ (0,H.jsx)(H.Fragment,{children:xt.map(([e,t],r)=>/* @__PURE__ */ (0,H.jsxs)(c,{end:/* @__PURE__ */ (0,H.jsx)(n,{className:`h-5 w-9 rounded-full`}),children:[r===0?/* @__PURE__ */ (0,H.jsx)(`span`,{role:`status`,className:`sr-only`,children:i(`notifications.groups.loading`)}):null,/* @__PURE__ */ (0,H.jsxs)(`span`,{"aria-hidden":`true`,className:`grid gap-1.5`,children:[/* @__PURE__ */ (0,H.jsx)(n,{className:`h-3.25 ${e}`}),/* @__PURE__ */ (0,H.jsx)(n,{className:`h-2.75 ${t}`})]})]},e))}):s.status===`error`?/* @__PURE__ */ (0,H.jsx)(c,{children:/* @__PURE__ */ (0,H.jsxs)(`div`,{role:`alert`,className:`grid justify-items-start gap-2.5`,children:[/* @__PURE__ */ (0,H.jsxs)(`p`,{className:`m-0 flex gap-1.5 text-(length:--text-body-sm) leading-normal text-fg-error [&>svg]:mt-0.5 [&>svg]:size-3.5 [&>svg]:flex-none`,children:[/* @__PURE__ */ (0,H.jsx)(g,{"aria-hidden":`true`}),/* @__PURE__ */ (0,H.jsx)(`span`,{children:i(`notifications.groups.loadFailed`)})]}),/* @__PURE__ */ (0,H.jsx)(u,{variant:`secondary`,size:`sm`,icon:/* @__PURE__ */ (0,H.jsx)(b,{"aria-hidden":`true`}),loading:s.retrying,loadingLabel:i(`common.loading`),onClick:()=>{l({status:`error`,retrying:!0}),f(e=>e+1)},children:i(`common.retry`)})]})}):/* @__PURE__ */ (0,H.jsx)(H.Fragment,{children:s.groups.map(e=>{let n=p.get(e.key),r=n!==void 0&&n.busy?n.shown:e.enabled;return/* @__PURE__ */ (0,H.jsx)(c,{"data-on":String(r),title:e.title,caption:e.description===``?void 0:e.description,end:/* @__PURE__ */ (0,H.jsxs)(`span`,{className:`inline-flex items-center gap-2 text-fg-muted`,children:[n!==void 0&&n.busy?/* @__PURE__ */ (0,H.jsx)(t,{}):null,/* @__PURE__ */ (0,H.jsx)(oe,{checked:r,onChange:t=>C(e.key,t),"aria-label":e.title})]}),children:n!==void 0&&n.failed!==null?/* @__PURE__ */ (0,H.jsxs)(rt,{align:`center`,className:`mt-1.5`,children:[/* @__PURE__ */ (0,H.jsx)(`span`,{children:i(`notifications.groups.saveFailed`)}),/* @__PURE__ */ (0,H.jsx)(it,{size:`sm`,onClick:()=>C(e.key,n.failed===!0),children:i(`common.retry`)})]}):null},e.key)})})}var Ct=`animate-[extension-view-in_var(--motion-medium)_var(--ease-out)_both]`,wt=`animate-[extension-view-back_var(--motion-medium)_var(--ease-out)_both]`;function Tt(e){let{url:t,headers:n,contentType:r,bytes:i,signal:a,onProgress:o}=e;return a.aborted?Promise.reject(a.reason):new Promise((e,s)=>{let c=new XMLHttpRequest,l=()=>{c.abort(),s(a.reason)},u=()=>{a.removeEventListener(`abort`,l)};c.open(`POST`,t);for(let[e,t]of Object.entries(n))c.setRequestHeader(e,t);c.setRequestHeader(`Content-Type`,r),c.upload.addEventListener(`progress`,e=>{o(e.loaded)}),c.upload.addEventListener(`load`,()=>{o(i.byteLength)}),c.addEventListener(`load`,()=>{u(),e({status:c.status,body:c.responseText})}),c.addEventListener(`error`,()=>{u(),s(new j({status:0,errorCode:null,params:null,message:`POST ${t}: no HTTP answer`}))}),a.addEventListener(`abort`,l,{once:!0}),o(0),c.send(i)})}var Et=401;async function Dt(e){let{contentType:t,bytes:n,signal:r,onProgress:i,authorize:a,refuse:o}=e,s=async()=>{let{url:e,headers:o}=await a();return Tt({url:e,headers:o,contentType:t,bytes:n,signal:r,onProgress:i})},c=await s();return c.status===Et&&(c=await s()),c.status<200||c.status>=300?o(c):JSON.parse(c.body)}function Ot(e,t){return(t==null?void 0:t.aborted)===!0?t.reason:e instanceof TypeError?new j({status:0,errorCode:null,params:null,message:e.message}):e}async function Z(e,t){try{return await e()}catch(e){throw Ot(e,t)}}var kt=401;async function At(e,t){let n=await r.call(`API_DIRECT_AUTHORIZE`,{path:t});if(`error`in n)throw new C(n.error,n.status,{method:e,path:t});return{url:n.url,headers:n.headers}}async function Q(e,t,n,i){let a=await r.call(`API_DIRECT_REFUSED`,{path:t,status:n,body:i});throw new C(a.error,a.status,{method:e,path:t})}function jt(e){let{path:t,contentType:n,bytes:r,signal:i,onProgress:a}=e;return Dt({contentType:n,bytes:r,signal:i,onProgress:a,authorize:()=>At(`POST`,t),refuse:({status:e,body:n})=>Q(`POST`,t,e,n)})}async function Mt(e){let{path:t,signal:n}=e,r=async()=>{let{url:e,headers:r}=await At(`GET`,t);return Z(()=>fetch(e,{headers:r,...n!==void 0&&{signal:n}}),n)},i=await r();if(i.status===kt&&(i=await r()),!i.ok){let e=await Z(()=>i.text(),n);return Q(`GET`,t,i.status,e)}let a=i.headers.get(`content-type`);if(a===null)throw Error(`GET ${t} answered ${String(i.status)} without a Content-Type`);let o=await Z(()=>i.arrayBuffer(),n);return{contentType:a,bytes:new Uint8Array(o)}}function Nt(){return{async request({method:e,path:t,body:n,schema:r}){let i=await $(l(t,{method:e,...n!==void 0&&{body:JSON.stringify(n)}}));return r.parse(i)},async upload({path:e,contentType:t,bytes:n,schema:r,signal:i,onProgress:a}){let o=await $(jt({path:e,contentType:t,bytes:n,signal:i,onProgress:a}));return r.parse(o)},download({path:e,signal:t}){return $(Mt({path:e,signal:t}))}}}async function $(e){try{return await e}catch(e){throw e instanceof C?Pt(e):e}}function Pt(e){let t=typeof e.payload.message==`string`&&e.payload.message!==``?e.payload.message:`Chat request failed with HTTP ${String(e.status)}`;return new j({status:e.status,errorCode:e.errorCode??null,params:e.params??null,message:t})}export{bt as a,ye as c,de as d,le as f,St as i,_e as l,wt as n,gt as o,P as p,Ct as r,Se as s,Nt as t,ue as u};
@@ -1 +0,0 @@
1
- import{Bn as e,Gn as t,Mn as n,Vn as r,Xn as i,kn as a,zt as o}from"./shared-UK_0TOj7.js";var s=a([`mapper`,`mapper_fallback`,`user`,`imported`,`agentic`]),c=r({id:t().uuid(),runId:t().uuid(),stepId:t().uuid(),proposedElementId:t().uuid().nullable(),confidence:e(),source:s,createdAt:t(),updatedAt:t(),elementAccessibleName:t(),elementRole:t(),pageUrl:t(),targetPageId:t().uuid().optional(),shadowLineage:o.optional()}),l=a([`high`,`grey`,`low`]);r({mappingId:i(),source:s,confidence:e().min(0).max(1),confidenceTier:l,pendingRemap:n()});export{c as t};
@@ -1,105 +0,0 @@
1
- import{r as e}from"./shared-hePW80VL.js";import{An as t,At as n,Cn as r,Ct as i,D as a,Da as o,Dt as s,Et as c,Gn as l,Gt as u,Hn as d,J as f,K as p,Kn as m,Mt as h,Ni as g,Nt as _,O as v,Ot as y,Pt as b,Q as x,Rt as S,St as C,U as ee,Vt as te,X as w,Y as ne,_i as T,_r as E,_t as D,aa as O,an as k,bi as A,bt as j,ca as M,ci as N,cn as re,ct as ie,dt as ae,ei as P,et as oe,fn as F,ft as se,gt as I,ht as L,it as ce,jt as R,kt as le,mt as ue,nt as de,pt as fe,qn as pe,ra as me,rt as he,sa as ge,sn as _e,st as ve,tt as ye,un as be,ut as xe,vi as Se,vt as Ce,wn as we,wr as z,wt as Te,xt as Ee,yi as B,yn as De,yt as Oe,zt as ke}from"./shared-O0OgUhxM.js";import{Bn as V,D as Ae,Gn as H,Jn as je,Ln as U,Lt as W,Nn as G,O as Me,Un as Ne,Vn as K,Xn as q,jn as Pe,k as Fe,kn as J,o as Ie,pt as Le,qn as Re,x as ze}from"./shared-UK_0TOj7.js";var Be=/\u200B/g,Ve=/\s+/g;function He(e){return e.replace(Be,``).replace(Ve,` `).trim()}
2
- /**
3
- * @license lucide-react v0.574.0 - ISC
4
- *
5
- * This source code is licensed under the ISC license.
6
- * See the LICENSE file in the root directory of this source tree.
7
- */
8
- var Ue=B(`arrow-right`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),We=B(`crosshair`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`22`,x2:`18`,y1:`12`,y2:`12`,key:`l9bcsi`}],[`line`,{x1:`6`,x2:`2`,y1:`12`,y2:`12`,key:`13hhkx`}],[`line`,{x1:`12`,x2:`12`,y1:`6`,y2:`2`,key:`10w3f3`}],[`line`,{x1:`12`,x2:`12`,y1:`22`,y2:`18`,key:`15g9kq`}]]),Ge=B(`ellipsis`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]]),Ke=B(`eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),qe=B(`frame`,[[`line`,{x1:`22`,x2:`2`,y1:`6`,y2:`6`,key:`15w7dq`}],[`line`,{x1:`22`,x2:`2`,y1:`18`,y2:`18`,key:`1ip48p`}],[`line`,{x1:`6`,x2:`6`,y1:`2`,y2:`22`,key:`a2lnyx`}],[`line`,{x1:`18`,x2:`18`,y1:`2`,y2:`22`,key:`8vb6jd`}]]),Je=B(`history`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]]),Ye=B(`keyboard`,[[`path`,{d:`M10 8h.01`,key:`1r9ogq`}],[`path`,{d:`M12 12h.01`,key:`1mp3jc`}],[`path`,{d:`M14 8h.01`,key:`1primd`}],[`path`,{d:`M16 12h.01`,key:`1l6xoz`}],[`path`,{d:`M18 8h.01`,key:`emo2bl`}],[`path`,{d:`M6 8h.01`,key:`x9i8wu`}],[`path`,{d:`M7 16h10`,key:`wp8him`}],[`path`,{d:`M8 12h.01`,key:`czm47f`}],[`rect`,{width:`20`,height:`16`,x:`2`,y:`4`,rx:`2`,key:`18n3k1`}]]),Xe=B(`layers`,[[`path`,{d:`M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z`,key:`zw3jo`}],[`path`,{d:`M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12`,key:`1wduqc`}],[`path`,{d:`M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17`,key:`kqbvx6`}]]),Ze=B(`list-checks`,[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`m3 7 2 2 4-4`,key:`1obspn`}]]),Qe=B(`list`,[[`path`,{d:`M3 5h.01`,key:`18ugdj`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M3 19h.01`,key:`noohij`}],[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M8 12h13`,key:`1za7za`}],[`path`,{d:`M8 19h13`,key:`m83p4d`}]]),$e=B(`lock`,[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`,key:`fwvmzm`}]]),et=B(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),tt=B(`mouse-pointer-click`,[[`path`,{d:`M14 4.1 12 6`,key:`ita8i4`}],[`path`,{d:`m5.1 8-2.9-.8`,key:`1go3kf`}],[`path`,{d:`m6 12-1.9 2`,key:`mnht97`}],[`path`,{d:`M7.2 2.2 8 5.1`,key:`1cfko1`}],[`path`,{d:`M9.037 9.69a.498.498 0 0 1 .653-.653l11 4.5a.5.5 0 0 1-.074.949l-4.349 1.041a1 1 0 0 0-.74.739l-1.04 4.35a.5.5 0 0 1-.95.074z`,key:`s0h3yz`}]]),nt=B(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),rt=B(`send`,[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`,key:`1ffxy3`}],[`path`,{d:`m21.854 2.147-10.94 10.939`,key:`12cjpa`}]]),it=B(`target`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`circle`,{cx:`12`,cy:`12`,r:`6`,key:`1vlfrh`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}]]),at=B(`variable`,[[`path`,{d:`M8 21s-4-3-4-9 4-9 4-9`,key:`uto9ud`}],[`path`,{d:`M16 3s4 3 4 9-4 9-4 9`,key:`4w2vsq`}],[`line`,{x1:`15`,x2:`9`,y1:`9`,y2:`15`,key:`f7djnv`}],[`line`,{x1:`9`,x2:`15`,y1:`9`,y2:`15`,key:`1shsy8`}]]),Y=/* @__PURE__ */ e(M(),1),X=ge(),ot=`peer m-0 size-3.75 shrink-0 cursor-pointer appearance-none rounded-xs border-(length:--checkbox-border-width) border-solid border-stroke-strong bg-transparent [transition:background-color_var(--motion-short)_var(--ease-out),border-color_var(--motion-short)_var(--ease-out)] hover:not-checked:not-indeterminate:border-primary-400 group-hover/check:not-checked:not-indeterminate:border-primary-400 checked:border-primary checked:bg-primary indeterminate:border-primary indeterminate:bg-primary focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-stroke-focus disabled:cursor-not-allowed disabled:opacity-disabled`,st=`pointer-events-none absolute size-2.75 scale-[.6] text-fg-on-accent opacity-0 [transition:opacity_var(--motion-short)_var(--ease-out),scale_var(--motion-medium)_var(--ease-out)]`
9
- /**
10
- * @license lucide-react v0.574.0 - ISC
11
- *
12
- * This source code is licensed under the ISC license.
13
- * See the LICENSE file in the root directory of this source tree.
14
- */
15
- /**
16
- * @license lucide-react v0.574.0 - ISC
17
- *
18
- * This source code is licensed under the ISC license.
19
- * See the LICENSE file in the root directory of this source tree.
20
- */
21
- /**
22
- * @license lucide-react v0.574.0 - ISC
23
- *
24
- * This source code is licensed under the ISC license.
25
- * See the LICENSE file in the root directory of this source tree.
26
- */
27
- /**
28
- * @license lucide-react v0.574.0 - ISC
29
- *
30
- * This source code is licensed under the ISC license.
31
- * See the LICENSE file in the root directory of this source tree.
32
- */
33
- /**
34
- * @license lucide-react v0.574.0 - ISC
35
- *
36
- * This source code is licensed under the ISC license.
37
- * See the LICENSE file in the root directory of this source tree.
38
- */
39
- /**
40
- * @license lucide-react v0.574.0 - ISC
41
- *
42
- * This source code is licensed under the ISC license.
43
- * See the LICENSE file in the root directory of this source tree.
44
- */
45
- /**
46
- * @license lucide-react v0.574.0 - ISC
47
- *
48
- * This source code is licensed under the ISC license.
49
- * See the LICENSE file in the root directory of this source tree.
50
- */
51
- /**
52
- * @license lucide-react v0.574.0 - ISC
53
- *
54
- * This source code is licensed under the ISC license.
55
- * See the LICENSE file in the root directory of this source tree.
56
- */
57
- /**
58
- * @license lucide-react v0.574.0 - ISC
59
- *
60
- * This source code is licensed under the ISC license.
61
- * See the LICENSE file in the root directory of this source tree.
62
- */
63
- /**
64
- * @license lucide-react v0.574.0 - ISC
65
- *
66
- * This source code is licensed under the ISC license.
67
- * See the LICENSE file in the root directory of this source tree.
68
- */
69
- /**
70
- * @license lucide-react v0.574.0 - ISC
71
- *
72
- * This source code is licensed under the ISC license.
73
- * See the LICENSE file in the root directory of this source tree.
74
- */
75
- /**
76
- * @license lucide-react v0.574.0 - ISC
77
- *
78
- * This source code is licensed under the ISC license.
79
- * See the LICENSE file in the root directory of this source tree.
80
- */
81
- /**
82
- * @license lucide-react v0.574.0 - ISC
83
- *
84
- * This source code is licensed under the ISC license.
85
- * See the LICENSE file in the root directory of this source tree.
86
- */
87
- /**
88
- * @license lucide-react v0.574.0 - ISC
89
- *
90
- * This source code is licensed under the ISC license.
91
- * See the LICENSE file in the root directory of this source tree.
92
- */
93
- /**
94
- * @license lucide-react v0.574.0 - ISC
95
- *
96
- * This source code is licensed under the ISC license.
97
- * See the LICENSE file in the root directory of this source tree.
98
- */
99
- /**
100
- * @license lucide-react v0.574.0 - ISC
101
- *
102
- * This source code is licensed under the ISC license.
103
- * See the LICENSE file in the root directory of this source tree.
104
- */
105
- ;function ct({checked:e,onChange:t,indeterminate:n=!1,disabled:r=!1,label:i,id:a,describedBy:o,...s}){let c=(0,Y.useRef)(null);(0,Y.useEffect)(()=>{c.current!==null&&(c.current.indeterminate=n)});let l=/* @__PURE__ */ (0,X.jsxs)(`span`,{className:`relative inline-grid size-3.75 shrink-0 place-items-center`,children:[/* @__PURE__ */ (0,X.jsx)(`input`,{ref:c,type:`checkbox`,id:a,checked:e,disabled:r,"aria-checked":n?`mixed`:void 0,"aria-label":s[`aria-label`],"aria-describedby":o,"data-testid":s[`data-testid`],onChange:e=>t(e.target.checked),className:ot}),n?/* @__PURE__ */ (0,X.jsx)(et,{"aria-hidden":`true`,strokeWidth:3,className:P(st,`peer-indeterminate:scale-100 peer-indeterminate:opacity-100`)}):/* @__PURE__ */ (0,X.jsx)(Se,{"aria-hidden":`true`,strokeWidth:3,className:P(st,`peer-checked:scale-100 peer-checked:opacity-100`)})]});return i===void 0?l:/* @__PURE__ */ (0,X.jsxs)(`label`,{className:P(`group/check inline-flex select-none items-center gap-2.5 text-body-sm text-fg-primary`,r?`cursor-not-allowed`:`cursor-pointer`),children:[l,i]})}var lt=/*#__PURE__*/ Y.createContext(void 0);function Z(e){let t=Y.useContext(lt);if(t===void 0&&!e)throw Error(z(47));return t}var ut=/* @__PURE__ */ e(O(),1),dt={...se,disabled:e=>e.disabled,instantType:e=>e.instantType,openMethod:e=>e.openMethod,openChangeReason:e=>e.openChangeReason,modal:e=>e.modal,focusManagerModal:e=>e.focusManagerModal,stickIfOpen:e=>e.stickIfOpen,titleElementId:e=>e.titleElementId,descriptionElementId:e=>e.descriptionElementId,openOnHover:e=>e.openOnHover,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin},ft=class extends c{constructor(e,t,n){let r=new fe;super(pt(e,r,t,n),mt(r),dt),o(this,`setOpen`,(e,t)=>{var n,r;let i=t.reason===d,a=t.reason===`trigger-press`&&t.event.detail===0,o=!e&&(t.reason===`escape-key`||t.reason==null),s=I(t),c=this.select(`activeTriggerId`);if(!e&&t.reason===`close-press`&&t.trigger==null&&c!=null&&(t.trigger=this.context.triggerElements.getById(c)??this.select(`activeTriggerElement`)??void 0),(n=(r=this.context).onOpenChange)==null||n.call(r,e,t),t.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,t);let l=()=>{let n=Ce(this.state,e,t.trigger,s());n.openChangeReason=t.reason,this.update(n)};i?(this.set(`stickIfOpen`,!0),this.context.stickIfOpenTimeout.start(500,()=>{this.set(`stickIfOpen`,!1)}),ut.flushSync(l)):l();let u;a?u=`click`:o?u=`dismiss`:t.reason===`focus-out`&&(u=`focus`),this.set(`instantType`,u)})}};function pt(e,t,n,r=!1){let i={...ae(t,n,r),disabled:!1,modal:!1,focusManagerModal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,openOnHover:!1,closeDelay:0,adaptiveOrigin:void 0,...e};return i.open&&(e==null?void 0:e.mounted)===void 0&&(i.mounted=!0),i}function mt(e){return{popupRef:/*#__PURE__*/ Y.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:/*#__PURE__*/ Y.createRef(),beforeContentFocusGuardRef:/*#__PURE__*/ Y.createRef(),stickIfOpenTimeout:new k,triggerElements:e}}var ht=s(function({props:e}){let{children:n,open:r,defaultOpen:a=!1,onOpenChange:o,onOpenChangeComplete:s,modal:c=!1,handle:l,triggerId:u,defaultTriggerId:d=null}=e,f=_t(l,{modal:c,open:a,openProp:r,activeTriggerId:d,triggerIdProp:u});f.useControlledProp(`openProp`,r),f.useControlledProp(`triggerIdProp`,u);let p=f.useState(`open`),m=f.useState(`mounted`),h=f.useState(`payload`);f.useContextCallback(`onOpenChange`,o),f.useContextCallback(`onOpenChangeComplete`,s),i(f,p),Oe(f);let{forceUnmount:g}=j(p,f,()=>{f.update({stickIfOpen:!0,openChangeReason:null})});f.useSyncedValues({modal:c}),Y.useEffect(()=>{p||f.context.stickIfOpenTimeout.clear()},[f,p]),Y.useImperativeHandle(e.actionsRef,()=>({unmount:g,close:()=>f.setOpen(!1,be(t))}),[g,f]);let _=p||m;return/*#__PURE__*/ (0,X.jsxs)(lt.Provider,{value:f,children:[l&&/*#__PURE__*/ (0,X.jsx)(L,{handle:l,store:f}),_&&/*#__PURE__*/ (0,X.jsx)(vt,{store:f,modal:c}),typeof n==`function`?n({payload:h}):n]})});function gt(e){return Z(!0)?/*#__PURE__*/ (0,X.jsx)(ht,{props:e}):/*#__PURE__*/ (0,X.jsx)(_,{children:/*#__PURE__*/ (0,X.jsx)(ht,{props:e})})}function _t(e,t){let n=C((e,n)=>new ft(t,e,n));return Y.useEffect(()=>n.context.stickIfOpenTimeout.disposeEffect(),[n]),n}function vt({store:e,modal:t}){let n=e.useState(`floatingRootContext`),r=le(n,{outsidePressEvent:{mouse:t===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}}),i=r.reference,a=r.floating;return Ee(e,{activeTriggerProps:i,inactiveTriggerProps:i,popupProps:a}),null}var yt=y(function(e,t){let{render:r,className:i,style:a,disabled:o=!1,nativeButton:s=!0,handle:c,payload:l,openOnHover:d=!1,delay:f=300,closeDelay:h=0,id:g,..._}=e,v=Z(!0),y=xe(c)??v;if(!y)throw Error(z(74));let b=F(g),x=y.useState(`isTriggerActive`,b),S=y.useState(`floatingRootContext`),C=y.useState(`isOpenedByTrigger`,b),te=y.useState(`triggerPopupId`,b),w=Y.useRef(null),{registerTrigger:ne,isMountedByThisTrigger:T}=Te(b,w,y,{payload:l,disabled:o,openOnHover:d,closeDelay:h}),D=y.useState(`openChangeReason`),O=y.useState(`stickIfOpen`),k=y.useState(`openMethod`),A=y.useState(`focusManagerModal`),j=ve(S,{enabled:!o&&d&&(k!==`touch`||D!==`trigger-press`),mouseOnly:!0,move:!1,handleClose:ce(),restMs:f,delay:{close:h},triggerElementRef:w,isActiveTrigger:x,isClosing:()=>y.select(`transitionStatus`)===`ending`}),M=n(S,{stickIfOpen:O}),N=p(()=>y.select(`open`),e=>{y.set(`openMethod`,e)}),re=y.useState(`triggerProps`,T),{getButtonProps:ie,buttonRef:ae}=De({disabled:o,native:s}),P={open(e){return e&&D===`trigger-press`?m.open(e):pe.open(e)}},{preFocusGuardRef:oe,handlePreFocusGuardFocus:se,handleFocusTargetFocus:I}=ee(y,w),L=E(`button`,e,{state:{disabled:o,open:C},ref:[ae,t,ne,w],props:[M.reference,j,re,N,{[ke]:``,id:b,"aria-haspopup":`dialog`,"aria-expanded":C,"aria-controls":te},_,ie],stateAttributesMapping:P}),R=/*#__PURE__*/ (0,X.jsx)(Y.Fragment,{children:L},b);return T&&!A?/*#__PURE__*/ (0,X.jsxs)(Y.Fragment,{children:[/*#__PURE__*/ (0,X.jsx)(u,{ref:oe,onFocus:se}),R,/*#__PURE__*/ (0,X.jsx)(u,{ref:y.context.triggerFocusTargetRef,onFocus:I})]}):R}),bt=/*#__PURE__*/ Y.createContext(void 0);function xt(){let e=Y.useContext(bt);if(e===void 0)throw Error(z(45));return e}var St=/*#__PURE__*/ Y.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return Z().useState(`mounted`)||n?/*#__PURE__*/ (0,X.jsx)(bt.Provider,{value:n,children:/*#__PURE__*/ (0,X.jsx)(S,{ref:t,...r})}):null}),Ct=/*#__PURE__*/ Y.createContext(void 0);function wt(){let e=Y.useContext(Ct);if(!e)throw Error(z(46));return e}var Tt=/*#__PURE__*/ Y.forwardRef(function(e,t){let{render:n,className:i,style:a,anchor:o,positionMethod:s,side:c,align:l,sideOffset:u,alignOffset:d,collisionBoundary:p=`clipping-ancestors`,collisionPadding:m,arrowPadding:g,sticky:_,disableAnchorTracking:v=!1,collisionAvoidance:y=te,...S}=e,C=Z(),ee=xt(),T=b(),E=C.useState(`floatingRootContext`),D=C.useState(`mounted`),O=C.useState(`open`),k=C.useState(`openChangeReason`),A=C.useState(`activeTriggerElement`),j=C.useState(`modal`),M=C.useState(`openMethod`),N=C.useState(`positionerElement`),ie=C.useState(`instantType`),ae=C.useState(`transitionStatus`),P=C.useState(`adaptiveOrigin`),F=Y.useRef(null),se=re(N),I=x({anchor:o,floatingRootContext:E,positionMethod:s,mounted:D,side:c,sideOffset:u,align:l,alignOffset:d,arrowPadding:g,collisionBoundary:p,collisionPadding:m,sticky:_,disableAnchorTracking:v,keepMounted:ee,nodeId:T,collisionAvoidance:y,adaptiveOrigin:P}),L=E.useState(`domReferenceElement`);r(()=>{let e=L,t=F.current;if(e&&(F.current=e),t&&e&&e!==t){C.set(`instantType`,void 0);let e=new AbortController;return se(()=>{C.set(`instantType`,`trigger-change`)},e.signal),()=>{e.abort()}}},[L,se,C]);let ce=j===!0&&k!==`trigger-hover`;f(O&&ce,M===`touch`,N,A);let R=C.useStateSetter(`positionerElement`),le={open:O,side:I.side,align:I.align,anchorHidden:I.anchorHidden,instant:ie},ue=ne(e,le,{styles:I.positionerStyles,transitionStatus:ae,props:S,refs:[t,R],hidden:!D,inert:!O});return/*#__PURE__*/ (0,X.jsxs)(Ct.Provider,{value:I,children:[D&&ce&&/*#__PURE__*/ (0,X.jsx)(w,{inert:oe(!O),cutout:A}),/*#__PURE__*/ (0,X.jsx)(h,{id:T,children:ue})]})}),Et=/*#__PURE__*/ Y.createContext(void 0);function Dt(){let[e,t]=Y.useState(0),n=we(()=>(t(e=>e+1),()=>{t(e=>Math.max(0,e-1))}));return{context:Y.useMemo(()=>({register:n}),[n]),hasClosePart:e>0}}var Ot=/*#__PURE__*/ Y.forwardRef(function(e,t){let{render:n,className:r,style:i,initialFocus:a,finalFocus:o,...s}=e,c=Z(),u=wt(),d=he(!0)!=null,{context:f,hasClosePart:p}=Dt(),m=c.useState(`open`),h=c.useState(`openMethod`),_=c.useState(`instantType`),v=c.useState(`transitionStatus`),y=c.useState(`popupProps`),b=c.useState(`titleElementId`),x=c.useState(`descriptionElementId`),S=c.useState(`modal`),C=c.useState(`mounted`),ee=c.useState(`openChangeReason`),te=c.useState(`activeTriggerElement`),w=c.useState(`floatingRootContext`),ne=w.useState(`floatingId`),T=c.useState(`disabled`),O=c.useState(`openOnHover`),k=c.useState(`closeDelay`);_e({open:m,ref:c.context.popupRef,onComplete(){if(m){var e,t;(e=(t=c.context).onOpenChangeComplete)==null||e.call(t,!0)}}}),ie(w,{enabled:O&&!T,closeDelay:k});let A=a===void 0?D(c.context.popupRef):a,j=S!==!1&&p;c.useSyncedValue(`focusManagerModal`,j);let M=c.useStateSetter(`popupElement`),N={open:m,side:u.side,align:u.align,instant:_,transitionStatus:v},re=E(`div`,e,{state:N,ref:[t,c.context.popupRef,M],props:[y,{id:ne,role:`dialog`,...ue,"aria-labelledby":b,"aria-describedby":x,onKeyDown(e){d&&de.has(e.key)&&e.stopPropagation()}},ye(v),s],stateAttributesMapping:l});return/*#__PURE__*/ (0,X.jsx)(R,{context:w,openInteractionType:h,modal:j,disabled:!C||ee===`trigger-hover`,initialFocus:A,returnFocus:o,restoreFocus:`popup`,previousFocusableElement:g(te)?te:void 0,nextFocusableElement:c.context.triggerFocusTargetRef,beforeContentFocusGuardRef:c.context.beforeContentFocusGuardRef,children:/*#__PURE__*/ (0,X.jsx)(Et.Provider,{value:f,children:re})})}),kt=/*#__PURE__*/ Y.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=Z(),s=F(a.id);return o.useSyncedValueWithCleanup(`titleElementId`,s),E(`h2`,e,{ref:t,props:[{id:s},a]})}),At=/*#__PURE__*/ Y.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=Z(),s=F(a.id);return o.useSyncedValueWithCleanup(`descriptionElementId`,s),E(`p`,e,{ref:t,props:[{id:s},a]})}),jt={fallbackAxisSide:`none`},Mt=8;function Nt(e){switch(e){case`escape-key`:return`escape`;case`outside-press`:return`outside`;case`trigger-press`:return`trigger`;case`focus-out`:return`focus-out`;default:return`other`}}function Pt({title:e,description:t,footerStart:n,footerEnd:r,side:i=`bottom`,align:o=`start`,collisionAvoidance:s,titleVisible:c=!0,className:l,initialFocusRef:u,trapFocus:d=!1,"data-testid":f,children:p,trigger:m,triggerTooltip:h,positionAnchor:g,anchor:_,open:y,onOpenChange:b}){let x=me(),S=`flex flex-col p-3 ${v}`;return/* @__PURE__ */ (0,X.jsxs)(gt,{open:y,modal:d?`trap-focus`:!1,onOpenChange:b===void 0?void 0:(e,t)=>{(e||!a(_,t.reason,t.event))&&b(e,Nt(t.reason))},children:[m===void 0?null:h===void 0?/* @__PURE__ */ (0,X.jsx)(yt,{render:m}):/* @__PURE__ */ (0,X.jsx)(A,{relationship:h.relationship,content:h.content,children:/* @__PURE__ */ (0,X.jsx)(yt,{render:m})}),/* @__PURE__ */ (0,X.jsx)(St,{container:x,children:/* @__PURE__ */ (0,X.jsx)(Tt,{anchor:g===void 0?_:g,side:i,align:o,collisionAvoidance:s,sideOffset:Mt,collisionPadding:8,positionMethod:`fixed`,className:`z-popover`,children:/* @__PURE__ */ (0,X.jsxs)(Ot,{initialFocus:u,finalFocus:_===void 0?void 0:()=>_,"data-testid":f,className:l===void 0?`w-[280px] ${S}`:`${S} ${l}`,children:[/* @__PURE__ */ (0,X.jsxs)(`div`,{className:c?`grid gap-0.5`:`sr-only`,children:[/* @__PURE__ */ (0,X.jsx)(kt,{className:`m-0 text-[length:var(--text-body-sm)] leading-normal font-semibold text-fg-primary`,children:e}),t===void 0?null:/* @__PURE__ */ (0,X.jsx)(At,{className:`m-0 text-xs leading-normal text-fg-muted`,children:t})]}),/* @__PURE__ */ (0,X.jsx)(`div`,{className:P(`grid gap-2`,c&&`mt-2.5`),children:p}),n!==void 0||r!==void 0?/* @__PURE__ */ (0,X.jsxs)(`div`,{className:`mt-3 flex items-center justify-between gap-2 border-t border-stroke-light pt-2.5`,children:[/* @__PURE__ */ (0,X.jsx)(`div`,{className:`flex items-center gap-2`,children:n}),/* @__PURE__ */ (0,X.jsx)(`div`,{className:`flex items-center gap-2`,children:r})]}):null]})})})]})}var Ft=[`text_contains`,`text_equals`,`text_free`,`element_visible`,`element_exists`,`element_not_exists`,`input_value`],It={text_contains:{labelKey:`checkTypes.text_contains`,icon:[[`path`,{d:`M17 6.1H3`}],[`path`,{d:`M21 12.1H3`}],[`path`,{d:`M15.1 18H3`}]]},text_equals:{labelKey:`checkTypes.text_equals`,icon:[[`path`,{d:`M5 9h14`}],[`path`,{d:`M5 15h14`}]]},text_free:{labelKey:`checkTypes.text_free`,icon:[[`path`,{d:`M12 20h9`}],[`path`,{d:`M16.376 3.622a1 1 0 0 1 3.002 3.002L7.368 18.635a2 2 0 0 1-.855.506l-2.872.838a.5.5 0 0 1-.62-.62l.838-2.872a2 2 0 0 1 .506-.854z`}]]},element_visible:{labelKey:`checkTypes.element_visible`,icon:[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`}]]},element_exists:{labelKey:`checkTypes.element_exists`,icon:[[`path`,{d:`M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z`}],[`path`,{d:`m3.3 7 8.7 5 8.7-5`}],[`path`,{d:`M12 22V12`}]]},element_not_exists:{labelKey:`checkTypes.element_not_exists`,icon:[[`path`,{d:`M5 3a2 2 0 0 0-2 2`}],[`path`,{d:`M19 3a2 2 0 0 1 2 2`}],[`path`,{d:`M21 19a2 2 0 0 1-2 2`}],[`path`,{d:`M5 21a2 2 0 0 1-2-2`}],[`path`,{d:`M9 3h1`}],[`path`,{d:`M9 21h1`}],[`path`,{d:`M14 3h1`}],[`path`,{d:`M14 21h1`}],[`path`,{d:`M3 9v1`}],[`path`,{d:`M21 9v1`}],[`path`,{d:`M3 14v1`}],[`path`,{d:`M21 14v1`}]]},input_value:{labelKey:`checkTypes.input_value`,icon:[[`path`,{d:`M5 4h1a3 3 0 0 1 3 3 3 3 0 0 1 3-3h1`}],[`path`,{d:`M13 20h-1a3 3 0 0 1-3-3 3 3 0 0 1-3 3H5`}],[`path`,{d:`M5 16H4a2 2 0 0 1-2-2v-4a2 2 0 0 1 2-2h1`}],[`path`,{d:`M13 8h7a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-7`}],[`path`,{d:`M9 7v10`}]]}},Lt=`checkTypes.assert_text`;function Rt(e){return!Fe(e)}function zt(e){if(!Rt(e))throw Error(`Check type "${e}" is legacy and read-only: it has no catalog entry`);let t=It[e];if(t===void 0)throw Error(`Unknown check type: ${String(e)}`);return t}function Bt(e){return Rt(e)?zt(e).labelKey:Lt}function Vt(e){return zt(e).icon}function Ht(e){return zt(e),ze[Me(e)].filter(t=>t===e||Ae(e,t))}var Ut=`gap-0! rounded-lg! border-solid! border-(--color-border-strong)! bg-(--color-bg-modal)! p-1.5! shadow-(--shadow-menu)!`,Wt=`w-[320px] max-w-[calc(100vw-16px)] ${Ut}`,Gt=`w-(--anchor-width) ${Ut}`,Kt=(0,Y.createContext)(null);function qt(){return(0,Y.useContext)(Kt)}var Jt=`grid size-7 shrink-0 place-items-center rounded-md border border-solid border-stroke bg-surface-secondary p-0 text-fg-primary transition-[border-color,background-color] duration-(--motion-short) ease-(--ease-out) enabled:hover:border-stroke-hover enabled:hover:bg-surface-hover focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-(--color-border-focus) disabled:cursor-default disabled:opacity-disabled [&>svg]:size-4`;function Yt({value:e,maxAgents:t,onValueChange:n,copy:r,settingsLink:i,disabled:a=!1,className:o}){return/* @__PURE__ */ (0,X.jsxs)(`div`,{role:`group`,"aria-label":r.groupLabel,"data-testid":`effort-agents-stepper`,className:P(`flex items-center gap-3 rounded-md border border-solid border-stroke-light bg-(--color-bg-modal-inset) px-3 py-2 text-xs text-fg-primary [animation:var(--animation-slide-down)] motion-reduce:[animation:none]`,o),children:[/* @__PURE__ */ (0,X.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[r.label,/* @__PURE__ */ (0,X.jsxs)(`small`,{className:`block text-caption text-fg-muted`,children:[r.limit(t),`\u00A0`,i]})]}),/* @__PURE__ */ (0,X.jsx)(`button`,{type:`button`,className:Jt,"aria-label":r.fewer,disabled:a||e<=1,onClick:()=>n(e-1),"data-testid":`effort-agents-fewer`,children:/* @__PURE__ */ (0,X.jsx)(et,{"aria-hidden":`true`})}),/* @__PURE__ */ (0,X.jsx)(`span`,{className:`min-w-7 text-center text-lg font-semibold tracking-[-0.3px] tabular-nums`,"data-testid":`effort-agents-value`,children:/* @__PURE__ */ (0,X.jsx)(`span`,{className:`inline-block [animation:var(--animation-effort-tick)] motion-reduce:[animation:none]`,children:e},e)}),/* @__PURE__ */ (0,X.jsx)(`button`,{type:`button`,className:Jt,"aria-label":r.more,disabled:a||e>=t,onClick:()=>n(e+1),"data-testid":`effort-agents-more`,children:/* @__PURE__ */ (0,X.jsx)(N,{"aria-hidden":`true`})})]})}var Xt=[`h-[5px]`,`h-2`,`h-[11px]`],Zt=[``,`[animation-delay:40ms]`,`[animation-delay:80ms]`];function Qt({level:e,look:t,rise:n=!1,className:r}){return/* @__PURE__ */ (0,X.jsx)(`span`,{"aria-hidden":`true`,className:P(`inline-flex flex-none items-end`,t===`line`?`h-3 gap-[1.5px]`:`h-[11px] gap-0.5`,r),children:Xt.map((r,i)=>{let a=i<e;return/* @__PURE__ */ (0,X.jsx)(`i`,{className:P(`w-[3px] origin-bottom rounded-[1px]`,r,!a&&t!==`line`&&`bg-current opacity-25`,!a&&t===`line`&&`bg-(--color-text-disabled)`,a&&t===`line`&&`bg-(--color-primary-text)`,a&&t===`quiet`&&`bg-current opacity-70`,a&&t===`lit`&&`bg-primary`,a&&t===`lit`&&n&&`[animation:var(--animation-effort-rise)]`,a&&t===`lit`&&n&&Zt[i])},r)})})}var $t={effort:`normal`},en={kind:`none`};function tn(e,t){switch(t.kind){case`none`:return!0;case`place`:return e!==`max`}}function nn(e,t){return Math.min(Math.max(e,1),t)}function rn(e,t){return e===`max`?{effort:`max`,maxAgents:t}:{effort:e}}function an(e,t,n){return e.effort===`max`?{effort:`max`,maxAgents:nn(t,n)}:e}function on(e,t){return e.effort===`max`||t.effort===`max`?e.effort===`max`&&t.effort===`max`&&e.maxAgents===t.maxAgents:e.effort===t.effort}function sn(e,t){return tn(e.effort,t.block)?e.effort===`max`?{effort:`max`,maxAgents:nn(e.maxAgents,t.maxAgents)}:e:$t}var cn={kind:`chip`},ln=[`normal`,`thinking`,`max`],un={normal:1,thinking:2,max:3},dn=`qa-ai-chat-effort inline-flex h-7 items-center gap-1.5 whitespace-nowrap rounded-full border border-solid pr-[7px] pl-[9px] text-xs font-medium transition-[border-color,background-color,color,box-shadow] duration-(--motion-short) focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-(--color-border-focus) disabled:cursor-default disabled:opacity-50`;function fn({choice:e,facts:t,onChoose:n,onAgentsChange:r,onOpenSettings:i,copy:a,look:o,disabled:s=!1}){let[c,l]=(0,Y.useState)(!1),[u,d]=(0,Y.useState)(null),f=(0,Y.useRef)(null),p=qt(),m=t===null||s,h=c&&!m,g=e.effort===`max`?a.long.max(e.maxAgents):a.long[e.effort],_=u!==null&&on(u,e)?a.chipLabel(g):``,v=e=>t!==null&&tn(e,t.block),y=e=>{v(e)&&t!==null&&(n(e),d(rn(e,t.maxAgents)))},b=n=>{t!==null&&(r(n),d(an(e,n,t.maxAgents)))},x=e=>{let t=[...e.currentTarget.querySelectorAll(`[role="radio"]`)].filter(e=>e.getAttribute(`aria-disabled`)!==`true`),n=t.findIndex(e=>e===document.activeElement),r=n=>{let r=t[n];if(r===void 0)return;e.preventDefault(),r.focus();let i=r.dataset.value,a=ln.find(e=>e===i);a!==void 0&&y(a)};switch(e.key){case`ArrowDown`:case`ArrowRight`:r((n+1)%t.length);break;case`ArrowUp`:case`ArrowLeft`:r((n-1+t.length)%t.length);break;case`Home`:r(0);break;case`End`:r(t.length-1)}},S=e=>t!==null&&t.block.kind===`place`&&!tn(e,t.block)?a.reasonPlace:null,C=o.kind===`setting`?/* @__PURE__ */ (0,X.jsxs)(`button`,{type:`button`,className:`qa-ai-chat-set`,"aria-label":a.chipLabel(g),disabled:m,"data-effort":e.effort,"data-testid":`ai-chat-effort-chip`,children:[/* @__PURE__ */ (0,X.jsx)(Qt,{level:un[e.effort],look:`line`}),/* @__PURE__ */ (0,X.jsxs)(`span`,{className:`qa-ai-chat-set-value`,children:[/* @__PURE__ */ (0,X.jsx)(`span`,{className:`qa-ai-chat-set-long`,children:e.effort===`max`?a.chipMax(e.maxAgents):a.levels[e.effort]}),/* @__PURE__ */ (0,X.jsx)(`span`,{className:`qa-ai-chat-set-short`,children:e.effort===`max`?o.chipMaxShort(e.maxAgents):a.levels[e.effort]})]})]}):/* @__PURE__ */ (0,X.jsxs)(`button`,{type:`button`,className:P(dn,e.effort===`max`?`border-[color-mix(in_srgb,var(--color-primary)_45%,transparent)] bg-(--color-bg-primary-tint-10) text-(--color-primary-text)`:`border-(--color-border) bg-transparent text-fg-secondary enabled:hover:border-(--color-border-hover) enabled:hover:text-fg-primary`,h&&`border-(--color-border-focus) shadow-(--glow-primary-sm)`),"aria-label":a.chipLabel(g),disabled:m,"data-effort":e.effort,"data-testid":`ai-chat-effort-chip`,children:[/* @__PURE__ */ (0,X.jsx)(Qt,{level:un[e.effort],look:`lit`,className:`w-3.5 justify-center`}),/* @__PURE__ */ (0,X.jsx)(`span`,{children:e.effort===`max`?a.chipMax(e.maxAgents):a.levels[e.effort]}),/* @__PURE__ */ (0,X.jsx)(T,{"aria-hidden":`true`,className:P(`size-3 transition-transform duration-(--motion-medium) ease-(--ease-out)`,h&&`rotate-180`)})]});return/* @__PURE__ */ (0,X.jsxs)(X.Fragment,{children:[/* @__PURE__ */ (0,X.jsx)(Pt,{title:a.name,titleVisible:!1,trigger:C,open:h,onOpenChange:e=>l(e&&!m),side:`top`,collisionAvoidance:jt,...p===null?{}:{positionAnchor:p},initialFocusRef:f,className:p===null?Wt:Gt,"data-testid":`ai-chat-effort-popover`,children:t!==null&&/* @__PURE__ */ (0,X.jsxs)(`div`,{className:`flex flex-col`,children:[/* @__PURE__ */ (0,X.jsxs)(`div`,{"aria-hidden":`true`,className:`flex items-baseline justify-between gap-2 px-2 py-1.5`,children:[/* @__PURE__ */ (0,X.jsx)(`b`,{className:`text-xs font-semibold tracking-[-0.1px] text-fg-primary`,children:a.name}),a.note!==null&&/* @__PURE__ */ (0,X.jsx)(`small`,{className:`text-caption text-fg-muted`,children:a.note})]}),/* @__PURE__ */ (0,X.jsx)(`div`,{role:`radiogroup`,"aria-label":a.name,className:`flex flex-col gap-px`,onKeyDown:x,children:ln.map(t=>{let n=e.effort===t,r=!v(t),i=S(t);return/* @__PURE__ */ (0,X.jsxs)(`button`,{ref:n?f:void 0,type:`button`,role:`radio`,"aria-checked":n,"aria-disabled":r||void 0,tabIndex:n?0:-1,"data-value":t,"data-testid":`ai-chat-effort-${t}`,onClick:()=>y(t),className:P(`grid w-full grid-cols-[16px_minmax(0,1fr)_16px] items-center gap-2.5 rounded-md border-0 bg-transparent px-2 py-[7px] text-left text-fg-secondary`,`focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-(--color-border-focus)`,r?`cursor-not-allowed text-fg-muted opacity-55`:`hover:bg-(--color-bg-elevated-hover) focus-visible:bg-(--color-bg-elevated-hover)`),children:[/* @__PURE__ */ (0,X.jsx)(Qt,{level:un[t],look:n?`lit`:`quiet`}),/* @__PURE__ */ (0,X.jsxs)(`span`,{children:[/* @__PURE__ */ (0,X.jsx)(`b`,{className:`block text-body-sm font-medium text-fg-primary`,children:a.levels[t]}),/* @__PURE__ */ (0,X.jsx)(`small`,{className:`block text-caption leading-[1.4] text-fg-muted`,"data-testid":i===null?void 0:`ai-chat-effort-withheld`,children:i===null?a.rows[t]:i})]}),/* @__PURE__ */ (0,X.jsx)(Se,{"aria-hidden":`true`,className:P(`size-3.5 text-(--color-primary-text)`,!n&&`invisible`)})]},t)})}),e.effort===`max`&&/* @__PURE__ */ (0,X.jsx)(Yt,{className:`mx-1 mb-1`,value:e.maxAgents,maxAgents:t.maxAgents,onValueChange:b,copy:a.agents,settingsLink:/* @__PURE__ */ (0,X.jsx)(`button`,{type:`button`,className:`inline border-0 bg-transparent p-0 text-left text-caption text-fg-muted underline-offset-2 hover:text-(--color-primary-text) hover:underline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-(--color-border-focus)`,onClick:i,children:a.agents.settingsLink})}),a.footer!==null&&/* @__PURE__ */ (0,X.jsx)(`div`,{className:`mt-1 border-0 border-t border-solid border-(--color-border-light) px-2 pt-2 pb-1 text-caption text-fg-muted`,children:a.footer})]})}),/* @__PURE__ */ (0,X.jsx)(`span`,{className:`sr-only`,"aria-live":`polite`,children:_})]})}var Q=5e3;function pn(e,t,n){return H().min(1).max(n).refine(e=>e===He(e),{message:`${e} must be the ${t} with whitespace collapsed: no leading or trailing whitespace, no line breaks, tabs or repeated spaces, no zero-width spaces`})}var $=pn(`targetName`,`element name`,200).nullable().optional(),mn=K({}),hn=K({expectedText:H().min(1).max(Q),targetName:$}),gn=K({expectedText:H().min(1).max(Q),targetName:$}),_n=K({targetName:$}),vn=K({targetName:$}),yn=K({targetText:pn(`targetText`,`element text`,Q).nullable().optional(),targetName:$}),bn=K({expectedValue:H().max(Q),targetName:$}),xn={text_free:mn,text_contains:hn,text_equals:gn,assert_text:K({mode:J([`equals`,`contains`,`matches`,`starts_with`,`ends_with`]),value:H().max(Q)}),element_visible:_n,element_exists:vn,element_not_exists:yn,input_value:bn};function Sn(e,t){return xn[e].safeParse(t)}var Cn=`frame-page-path-shape-v1`,wn=[`url`,`page_text`,`screenshot`],Tn=[`content_script`,`service_worker`,`playback_runtime`],En=H().regex(/^[0-9a-f]{64}$/),Dn=H().min(1).max(128).regex(/^[A-Za-z0-9][A-Za-z0-9._:-]*$/),On=K({mode:U(Cn),originSha256:En,pathnameShapeSha256:En}).strict(),kn=K({...W.shape,pageId:q(),sortOrder:V().int().nonnegative(),sourceType:U(`url_pathname`),kind:U(`segment`),segmentIndex:V().int().min(0).max(50),applicability:On}).strict(),An=K({...W.shape,pageId:q(),sortOrder:V().int().nonnegative(),sourceType:U(`url_href`),kind:U(`regex`),regexPattern:H().min(1).max(500).refine(e=>e.trim().length>0,`regexPattern must not be blank`),regexGroup:V().int().min(0).max(20)}).strict(),jn=G(`sourceType`,[kn,An]);K({maskContractVersion:U(2),frameRevision:Dn,activeStepIndex:V().int().nonnegative(),activeStepId:q(),activePageId:q(),activeNextPageId:q().nullable(),rules:Pe(jn),rulesDigest:En}).strict(),K({fieldPath:H().min(1).max(512),kind:J(wn),pageId:q(),stepId:W.shape.stepId.nullable(),occurrence:W.shape.occurrence.nullable(),urlEpoch:V().int().nonnegative().nullable(),provenance:J(Tn)}).strict().superRefine((e,t)=>{e.stepId===null!=(e.occurrence===null)&&t.addIssue({code:`custom`,path:[`occurrence`],message:`URL secret surface context occurrence must be null exactly when stepId is null`})});var Mn=`WORKFLOW_LAUNCH`,Nn=`WORKFLOW_HOST_ATTACH`;K({type:U(Mn),clientRequestId:q(),projectId:q(),surface:J([`extension_atlas_card`,`extension_make_auto_modal`]),launch:Ie,maxAgents:Le,accessHint:H().min(1).nullable()}).strict(),K({type:U(Nn),workflowId:q(),accessHint:H().min(1).nullable()}).strict();var Pn=G(`kind`,[K({kind:U(`attached`),epoch:V().int()}).strict(),K({kind:U(`pending`),detail:H()}).strict(),K({kind:U(`refused`),outcome:H(),detail:H().nullable()}).strict(),K({kind:U(`unreadable`),outcome:H(),detail:H().nullable()}).strict()]),Fn=G(`ok`,[K({ok:U(!0),result:Pn}).strict(),K({ok:U(!1),refusal:G(`kind`,[K({kind:U(`malformed_message`)}).strict(),K({kind:U(`no_launch_window`)}).strict(),K({kind:U(`attach_failed`),detail:H()}).strict()])}).strict()]),In=G(`ok`,[K({ok:U(!0),workflowId:q(),attach:Re([Pn,K({kind:U(`attach_failed`),detail:H()}).strict()])}).strict(),K({ok:U(!1),refusal:G(`kind`,[K({kind:U(`malformed_message`)}).strict(),K({kind:U(`no_launch_window`)}).strict(),K({kind:U(`refused`),status:V().int(),errorCode:H(),params:Ne(H(),je()).nullable()}).strict(),K({kind:U(`unreachable`),detail:H(),errorCode:H().nullable()}).strict(),K({kind:U(`protocol_error`),detail:H()}).strict()])}).strict()]);export{Bt as A,tt as B,Qt as C,Gt as D,Wt as E,ct as F,Xe as G,$e as H,at as I,qe as J,Ye as K,it as L,Rt as M,jt as N,Ft as O,Pt as P,Ue as Q,rt as R,an as S,qt as T,Qe as U,et as V,Ze as W,Ge as X,Ke as Y,We as Z,cn as _,En as a,rn as b,xn as c,_n as d,bn as f,fn as g,Sn as h,In as i,Ht as j,Vt as k,vn as l,gn as m,Mn as n,Dn as o,hn as p,Je as q,Fn as r,jn as s,Nn as t,yn as u,$t as v,Kt as w,sn as x,en as y,nt as z};