@workflow/web 4.0.1-beta.16 → 4.0.1-beta.17

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 (73) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/build-manifest.json +2 -2
  3. package/.next/fallback-build-manifest.json +2 -2
  4. package/.next/prerender-manifest.json +3 -3
  5. package/.next/server/app/_global-error.html +2 -2
  6. package/.next/server/app/_global-error.rsc +1 -1
  7. package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  8. package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  9. package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  10. package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  11. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  12. package/.next/server/app/_not-found/page/server-reference-manifest.json +44 -14
  13. package/.next/server/app/_not-found/page.js.nft.json +1 -1
  14. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  15. package/.next/server/app/page/server-reference-manifest.json +44 -14
  16. package/.next/server/app/page.js.nft.json +1 -1
  17. package/.next/server/app/page_client-reference-manifest.js +1 -1
  18. package/.next/server/app/run/[runId]/page/server-reference-manifest.json +44 -14
  19. package/.next/server/app/run/[runId]/page.js.nft.json +1 -1
  20. package/.next/server/app/run/[runId]/page_client-reference-manifest.js +1 -1
  21. package/.next/server/chunks/ssr/[root-of-the-server]__2168651f._.js +1 -1
  22. package/.next/server/chunks/ssr/[root-of-the-server]__2168651f._.js.map +1 -1
  23. package/.next/server/chunks/ssr/[root-of-the-server]__25c4ca9a._.js +1 -1
  24. package/.next/server/chunks/ssr/[root-of-the-server]__25c4ca9a._.js.map +1 -1
  25. package/.next/server/chunks/ssr/[root-of-the-server]__60fbc36b._.js +19 -6
  26. package/.next/server/chunks/ssr/[root-of-the-server]__60fbc36b._.js.map +1 -1
  27. package/.next/server/chunks/ssr/{[root-of-the-server]__81561467._.js → [root-of-the-server]__698f0f8c._.js} +21 -21
  28. package/.next/server/chunks/ssr/[root-of-the-server]__698f0f8c._.js.map +1 -0
  29. package/.next/server/chunks/ssr/[root-of-the-server]__d416fa5e._.js +1 -1
  30. package/.next/server/chunks/ssr/[root-of-the-server]__d416fa5e._.js.map +1 -1
  31. package/.next/server/chunks/ssr/_05140f17._.js +3 -0
  32. package/.next/server/chunks/ssr/_05140f17._.js.map +1 -0
  33. package/.next/server/chunks/ssr/_af28dabd._.js +1 -1
  34. package/.next/server/chunks/ssr/_af28dabd._.js.map +1 -1
  35. package/.next/server/chunks/ssr/_ba81ec07._.js +3 -0
  36. package/.next/server/chunks/ssr/_ba81ec07._.js.map +1 -0
  37. package/.next/server/chunks/ssr/packages_web_src_app_page_tsx_cd282e82._.js +1 -1
  38. package/.next/server/chunks/ssr/packages_web_src_app_page_tsx_cd282e82._.js.map +1 -1
  39. package/.next/server/chunks/ssr/packages_web_src_app_run_[runId]_page_tsx_c7d0b139._.js +3 -3
  40. package/.next/server/chunks/ssr/packages_web_src_app_run_[runId]_page_tsx_c7d0b139._.js.map +1 -1
  41. package/.next/server/chunks/ssr/packages_web_src_components_ui_select_tsx_7c5238ef._.js +3 -0
  42. package/.next/server/chunks/ssr/packages_web_src_components_ui_select_tsx_7c5238ef._.js.map +1 -0
  43. package/.next/server/pages/500.html +2 -2
  44. package/.next/server/server-reference-manifest.js +1 -1
  45. package/.next/server/server-reference-manifest.json +73 -15
  46. package/.next/static/chunks/0aeb3c102cae6574.js +154 -0
  47. package/.next/static/chunks/150101e4f4427b25.js +60 -0
  48. package/.next/static/chunks/45692dd1e99a17eb.js +1 -0
  49. package/.next/static/chunks/5a7f5a6ef31c8dcf.js +1 -0
  50. package/.next/static/chunks/665d0d9b32cf3823.css +3 -0
  51. package/.next/static/chunks/a14e6cc676939e77.js +14 -0
  52. package/.next/static/chunks/f137c380e66ba08c.js +1 -0
  53. package/.next/trace +1 -1
  54. package/.next/trace-build +1 -1
  55. package/package.json +3 -3
  56. package/.next/server/chunks/ssr/[root-of-the-server]__81561467._.js.map +0 -1
  57. package/.next/server/chunks/ssr/_2d77ccc1._.js +0 -3
  58. package/.next/server/chunks/ssr/_2d77ccc1._.js.map +0 -1
  59. package/.next/server/chunks/ssr/_b3bb46c8._.js +0 -3
  60. package/.next/server/chunks/ssr/_b3bb46c8._.js.map +0 -1
  61. package/.next/server/chunks/ssr/packages_web_src_components_ui_dropdown-menu_tsx_5a66d33b._.js +0 -3
  62. package/.next/server/chunks/ssr/packages_web_src_components_ui_dropdown-menu_tsx_5a66d33b._.js.map +0 -1
  63. package/.next/static/chunks/0ff56607785b9aeb.js +0 -1
  64. package/.next/static/chunks/305721f95cde213c.js +0 -60
  65. package/.next/static/chunks/9398c91f1c29ccb3.js +0 -154
  66. package/.next/static/chunks/9dd0f6590d960e73.css +0 -3
  67. package/.next/static/chunks/9e9332c359101685.js +0 -1
  68. package/.next/static/chunks/e0cee8c3bee3bbd2.js +0 -14
  69. package/.next/static/chunks/e8e526c24f4be83f.js +0 -1
  70. package/.next/static/chunks/f7453b1dc7a98709.js +0 -1
  71. /package/.next/static/{MMW1g0DsSeOFKmGS3ZWGM → JrXXjEQ6B0cLGAHZgjQl3}/_buildManifest.js +0 -0
  72. /package/.next/static/{MMW1g0DsSeOFKmGS3ZWGM → JrXXjEQ6B0cLGAHZgjQl3}/_clientMiddlewareManifest.json +0 -0
  73. /package/.next/static/{MMW1g0DsSeOFKmGS3ZWGM → JrXXjEQ6B0cLGAHZgjQl3}/_ssgManifest.js +0 -0
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,330997,e=>{"use strict";var s=e.i(666426),r=e.i(868924),t=e.i(519303);e.i(169764);var a=e.i(531875),l=e.i(387205),o=e.i(687602),n=e.i(886288);let d=(0,n.default)("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);var i=e.i(524914),c=e.i(495566),h=e.i(525449),u=e.i(846220),x=e.i(811735),m=e.i(686107),j=e.i(806746),f=e.i(456944),p=e.i(260218),g=e.i(212603),w=e.i(414576),k=e.i(949245);let b=m.forwardRef(({className:e,href:r,children:t,...a},l)=>{let o=r.startsWith("http")?r:`https://useworkflow.dev/docs/${r.replace(/^\//,"")}`;return(0,s.jsx)(w.default,{href:o,className:(0,k.cn)("font-medium underline underline-offset-4 transition-colors",e),style:{color:"var(--ds-blue-600)"},target:"_blank",rel:"noopener noreferrer",ref:l,...a,children:t})});b.displayName="DocsLink";var N=e.i(917955);let v=m.forwardRef(({className:e,...r},t)=>(0,s.jsx)("div",{className:"relative w-full overflow-auto",children:(0,s.jsx)("table",{ref:t,className:(0,k.cn)("w-full caption-bottom text-sm",e),...r})}));v.displayName="Table";let y=m.forwardRef(({className:e,...r},t)=>(0,s.jsx)("thead",{ref:t,className:(0,k.cn)("[&_tr]:border-b",e),...r}));y.displayName="TableHeader";let C=m.forwardRef(({className:e,...r},t)=>(0,s.jsx)("tbody",{ref:t,className:(0,k.cn)("[&_tr:last-child]:border-0",e),...r}));C.displayName="TableBody",m.forwardRef(({className:e,...r},t)=>(0,s.jsx)("tfoot",{ref:t,className:(0,k.cn)("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...r})).displayName="TableFooter";let S=m.forwardRef(({className:e,...r},t)=>(0,s.jsx)("tr",{ref:t,className:(0,k.cn)("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...r}));S.displayName="TableRow";let T=m.forwardRef(({className:e,...r},t)=>(0,s.jsx)("th",{ref:t,className:(0,k.cn)("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...r}));T.displayName="TableHead";let R=m.forwardRef(({className:e,...r},t)=>(0,s.jsx)("td",{ref:t,className:(0,k.cn)("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...r}));R.displayName="TableCell",m.forwardRef(({className:e,...r},t)=>(0,s.jsx)("caption",{ref:t,className:(0,k.cn)("mt-4 text-sm text-muted-foreground",e),...r})).displayName="TableCaption";var I=e.i(638322),M=e.i(620486),A=e.i(241245),_=e.i(719402),D=e.i(613087);function z({rows:e=k.DEFAULT_PAGE_SIZE,variant:r="runs"}){return(0,s.jsx)(g.Card,{className:"overflow-hidden mt-4 bg-background",children:(0,s.jsxs)(g.CardContent,{className:"p-0",children:[(()=>{switch(r){case"runs":return(0,s.jsxs)("div",{className:"grid grid-cols-[1fr_1.5fr_0.8fr_1fr_1fr_40px] items-center gap-4 py-3 px-4 border-b",children:[(0,s.jsx)(D.Skeleton,{className:"h-4 w-20"}),(0,s.jsx)(D.Skeleton,{className:"h-4 w-14"}),(0,s.jsx)(D.Skeleton,{className:"h-4 w-12"}),(0,s.jsx)(D.Skeleton,{className:"h-4 w-14"}),(0,s.jsx)(D.Skeleton,{className:"h-4 w-20"}),(0,s.jsx)("div",{className:"w-6"})]});case"hooks":return(0,s.jsxs)("div",{className:"grid grid-cols-[1.2fr_1.2fr_0.8fr_1fr_0.5fr_40px] items-center gap-4 py-3 px-4 border-b",children:[(0,s.jsx)(D.Skeleton,{className:"h-4 w-16"}),(0,s.jsx)(D.Skeleton,{className:"h-4 w-14"}),(0,s.jsx)(D.Skeleton,{className:"h-4 w-12"}),(0,s.jsx)(D.Skeleton,{className:"h-4 w-14"}),(0,s.jsx)(D.Skeleton,{className:"h-4 w-20"}),(0,s.jsx)("div",{className:"w-6"})]});case"workflows":return(0,s.jsxs)("div",{className:"grid grid-cols-[1fr_1.5fr_0.5fr] items-center gap-4 py-3 px-4 border-b",children:[(0,s.jsx)(D.Skeleton,{className:"h-4 w-20"}),(0,s.jsx)(D.Skeleton,{className:"h-4 w-10"}),(0,s.jsx)(D.Skeleton,{className:"h-4 w-12 mx-auto"})]});default:return null}})(),Array.from({length:e},(e,t)=>(e=>{switch(r){case"runs":return(0,s.jsxs)("div",{className:"grid grid-cols-[1fr_1.5fr_0.8fr_1fr_1fr_40px] items-center gap-4 py-3 px-4",children:[(0,s.jsx)(D.Skeleton,{className:"h-4 w-3/4"}),(0,s.jsx)(D.Skeleton,{className:"h-4 w-4/5"}),(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsx)(D.Skeleton,{className:"h-3 w-14"}),(0,s.jsx)(D.Skeleton,{className:"h-2 w-8"})]}),(0,s.jsx)(D.Skeleton,{className:"h-3 w-3/4"}),(0,s.jsx)(D.Skeleton,{className:"h-3 w-3/4"}),(0,s.jsx)(D.Skeleton,{className:"h-6 w-6 rounded"})]},`skeleton-row-${e}`);case"hooks":return(0,s.jsxs)("div",{className:"grid grid-cols-[1.2fr_1.2fr_0.8fr_1fr_0.5fr_40px] items-center gap-4 py-3 px-4",children:[(0,s.jsx)(D.Skeleton,{className:"h-4 w-4/5"}),(0,s.jsx)(D.Skeleton,{className:"h-4 w-4/5"}),(0,s.jsx)(D.Skeleton,{className:"h-4 w-3/4"}),(0,s.jsx)(D.Skeleton,{className:"h-3 w-3/4"}),(0,s.jsx)(D.Skeleton,{className:"h-4 w-8"}),(0,s.jsx)(D.Skeleton,{className:"h-6 w-6 rounded"})]},`skeleton-row-${e}`);case"workflows":return(0,s.jsxs)("div",{className:"grid grid-cols-[1fr_1.5fr_0.5fr] items-center gap-4 py-3 px-4",children:[(0,s.jsx)(D.Skeleton,{className:"h-4 w-3/4"}),(0,s.jsx)(D.Skeleton,{className:"h-4 w-4/5"}),(0,s.jsx)(D.Skeleton,{className:"h-5 w-16 rounded-full mx-auto"})]},`skeleton-row-${e}`);default:return null}})(t))]})})}function P({config:e,runId:r,onHookClick:t,selectedHookId:n}){let[w,k]=(0,m.useState)(()=>new Date),D=(0,m.useMemo)(()=>(0,M.worldConfigToEnvMap)(e),[e]),{data:P,error:E,nextPage:F,previousPage:$,hasNextPage:B,hasPreviousPage:U,reload:W,pageInfo:L}=(0,a.useWorkflowHooks)(D,{runId:r,sortOrder:"desc"}),H=P.isLoading,V=P.data??[],[O,Z]=(0,m.useState)(new Map);return(0,m.useEffect)(()=>{V.length&&(async()=>{let e=new Map;for(let s of V)e.set(s.hookId,{count:0,hasMore:!1,loading:!0});Z(e);let s=await Promise.allSettled(V.map(async e=>{try{let s=await (0,l.fetchEventsByCorrelationId)(D,e.hookId,{sortOrder:"asc",limit:100});if(!s.success)return{hookId:e.hookId,count:Error(s.error?.message||"Failed to fetch events"),hasMore:!1};let r=s.data,t=r.data.filter(e=>"hook_received"===e.eventType).length;return{hookId:e.hookId,count:t,hasMore:r.hasMore}}catch(s){return{hookId:e.hookId,count:s,hasMore:!1}}}));Z(e=>{let r=new Map(e);for(let e=0;e<s.length;e++){let t=s[e],a=V[e].hookId;"fulfilled"===t.status?r.set(t.value.hookId,{count:t.value.count,hasMore:t.value.hasMore,loading:!1}):r.set(a,{count:0,hasMore:!1,loading:!1})}return r})})()},[V,D]),(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{className:"flex items-end gap-2",children:[(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:"Last refreshed"}),w&&(0,s.jsx)(_.RelativeTime,{date:w,className:"text-sm text-muted-foreground",type:"distance"})]}),(0,s.jsx)("div",{className:"flex items-center gap-4",children:(0,s.jsxs)(I.Tooltip,{children:[(0,s.jsx)(I.TooltipTrigger,{asChild:!0,children:(0,s.jsxs)(p.Button,{variant:"outline",size:"sm",onClick:()=>{k(()=>new Date),W()},disabled:H,children:[(0,s.jsx)(h.RefreshCw,{className:H?"animate-spin":""}),"Refresh"]})}),(0,s.jsx)(I.TooltipContent,{children:"Note that this resets pages"})]})})]}),E?(0,s.jsxs)(f.Alert,{variant:"destructive",children:[(0,s.jsx)(o.AlertCircle,{className:"h-4 w-4"}),(0,s.jsx)(f.AlertTitle,{children:"Error loading hooks"}),(0,s.jsx)(f.AlertDescription,{children:(0,a.getErrorMessage)(E)})]}):H||V&&0!==V.length?H&&!P?.data?(0,s.jsx)(z,{variant:"hooks"}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(g.Card,{className:"overflow-hidden mt-4 bg-background",children:(0,s.jsx)(g.CardContent,{className:"p-0 max-h-[calc(100vh-280px)] overflow-auto",children:(0,s.jsxs)(v,{children:[(0,s.jsx)(y,{children:(0,s.jsxs)(S,{children:[(0,s.jsx)(T,{className:"sticky top-0 bg-background z-10 border-b shadow-sm h-10",children:"Hook ID"}),(0,s.jsx)(T,{className:"sticky top-0 bg-background z-10 border-b shadow-sm h-10",children:"Run ID"}),(0,s.jsx)(T,{className:"sticky top-0 bg-background z-10 border-b shadow-sm h-10",children:"Token"}),(0,s.jsx)(T,{className:"sticky top-0 bg-background z-10 border-b shadow-sm h-10",children:"Created"}),(0,s.jsx)(T,{className:"sticky top-0 bg-background z-10 border-b shadow-sm h-10",children:"Invocations"}),(0,s.jsx)(T,{className:"sticky top-0 bg-background z-10 border-b shadow-sm h-10 w-10"})]})}),(0,s.jsx)(C,{children:V.map(e=>(0,s.jsxs)(S,{className:"cursor-pointer group relative",onClick:()=>t(e.hookId,e.runId),"data-selected":e.hookId===n,children:[(0,s.jsx)(R,{className:"font-mono text-xs py-2",children:(0,s.jsx)(A.CopyableText,{text:e.hookId,overlay:!0,children:e.hookId})}),(0,s.jsx)(R,{className:"font-mono text-xs py-2",children:(0,s.jsx)(A.CopyableText,{text:e.runId,overlay:!0,children:e.runId})}),(0,s.jsx)(R,{className:"font-mono text-xs py-2",children:(0,s.jsx)(A.CopyableText,{text:e.token,overlay:!0,children:(0,s.jsx)("span",{className:"text-muted-foreground",children:"••••••••••••"})})}),(0,s.jsx)(R,{className:"py-2 text-muted-foreground text-xs",children:e.createdAt?(0,s.jsx)(_.RelativeTime,{date:e.createdAt}):"-"}),(0,s.jsx)(R,{className:"py-2",children:(e=>{let r=O.get(e.hookId);if(!r||r.loading)return(0,s.jsx)("span",{className:"text-muted-foreground text-xs",children:"..."});if(r.count instanceof Error)return(0,s.jsx)("span",{className:"text-muted-foreground",children:"Error"});if(0===r.count)return(0,s.jsx)("span",{className:"text-muted-foreground",children:"0"});let t=r.hasMore?`${r.count}+`:`${r.count}`;return r.hasMore?(0,s.jsxs)(I.Tooltip,{children:[(0,s.jsx)(I.TooltipTrigger,{asChild:!0,children:(0,s.jsx)("span",{className:"font-semibold cursor-help",children:t})}),(0,s.jsx)(I.TooltipContent,{children:(0,s.jsx)("div",{className:"text-xs",children:"Showing first 100 invocations. There may be more."})})]}):(0,s.jsx)("span",{className:"font-semibold",children:t})})(e)}),(0,s.jsx)(R,{className:"py-2",children:(0,s.jsxs)(N.DropdownMenu,{children:[(0,s.jsx)(N.DropdownMenuTrigger,{asChild:!0,children:(0,s.jsx)(p.Button,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:e=>e.stopPropagation(),children:(0,s.jsx)(c.MoreHorizontal,{className:"h-4 w-4"})})}),(0,s.jsxs)(N.DropdownMenuContent,{align:"end",children:[(0,s.jsxs)(N.DropdownMenuItem,{onClick:async s=>{s.stopPropagation();try{let s=await (0,a.recreateRun)(D,e.runId);j.toast.success("New run started",{description:`Run ID: ${s}`}),W()}catch(e){j.toast.error("Failed to re-run",{description:e instanceof Error?e.message:"Unknown error"})}},children:[(0,s.jsx)(u.RotateCw,{className:"h-4 w-4 mr-2"}),"Re-run"]}),(0,s.jsxs)(N.DropdownMenuItem,{onClick:async s=>{s.stopPropagation();try{await (0,a.cancelRun)(D,e.runId),j.toast.success("Run cancelled"),W()}catch(e){j.toast.error("Failed to cancel",{description:e instanceof Error?e.message:"Unknown error"})}},children:[(0,s.jsx)(x.XCircle,{className:"h-4 w-4 mr-2"}),"Cancel"]})]})]})})]},e.hookId))})]})})}),(0,s.jsxs)("div",{className:"flex items-center justify-between mt-4",children:[(0,s.jsx)("div",{className:"text-sm text-muted-foreground",children:L}),(0,s.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,s.jsxs)(p.Button,{variant:"outline",size:"sm",onClick:$,disabled:!U,children:[(0,s.jsx)(d,{}),"Previous"]}),(0,s.jsxs)(p.Button,{variant:"outline",size:"sm",onClick:F,disabled:!B,children:["Next",(0,s.jsx)(i.ChevronRight,{})]})]})]})]}):(0,s.jsxs)("div",{className:"text-center py-8 text-muted-foreground",children:["No active hooks found. ",(0,s.jsx)("br",{}),(0,s.jsx)(b,{href:"https://useworkflow.dev/docs/api-reference/workflow/create-hook",children:"Learn how to create a hook"})]})]})}var E=e.i(360088);let F=(0,n.default)("ArrowDownAZ",[["path",{d:"m3 16 4 4 4-4",key:"1co6wj"}],["path",{d:"M7 20V4",key:"1yoxec"}],["path",{d:"M20 8h-5",key:"1vsyxs"}],["path",{d:"M15 10V6.5a2.5 2.5 0 0 1 5 0V10",key:"ag13bf"}],["path",{d:"M15 14h5l-5 6h5",key:"ur5jdg"}]]),$=(0,n.default)("ArrowUpAZ",[["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}],["path",{d:"M20 8h-5",key:"1vsyxs"}],["path",{d:"M15 10V6.5a2.5 2.5 0 0 1 5 0V10",key:"ag13bf"}],["path",{d:"M15 14h5l-5 6h5",key:"ur5jdg"}]]);var B=e.i(346131),U=e.i(451675);let W={pending:{label:"Pending",color:"bg-neutral-600 dark:bg-neutral-400"},running:{label:"Running",color:"bg-blue-600 dark:bg-blue-400"},completed:{label:"Completed",color:"bg-green-600 dark:bg-green-400"},failed:{label:"Failed",color:"bg-red-600 dark:bg-red-400"},paused:{label:"Paused",color:"bg-yellow-600 dark:bg-yellow-400"},cancelled:{label:"Cancelled",color:"bg-gray-600 dark:bg-gray-400"}};function L({workflowNameFilter:e,status:r,seenWorkflowNames:t,sortOrder:a,loading:l,statusFilterRequiresWorkflowNameFilter:o,onWorkflowChange:n,onStatusChange:d,onSortToggle:i,onRefresh:c,lastRefreshTime:u}){return(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{className:"flex items-end gap-2",children:[(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:"Last refreshed"}),u&&(0,s.jsx)(_.RelativeTime,{date:u,className:"text-sm text-muted-foreground",type:"distance"})]}),(0,s.jsxs)("div",{className:"flex items-center gap-4",children:[(0,s.jsxs)(B.Select,{value:e??"all",onValueChange:n,disabled:l,children:[(0,s.jsx)(B.SelectTrigger,{className:"w-[180px] h-9",children:(0,s.jsx)(B.SelectValue,{placeholder:"Filter by workflow"})}),(0,s.jsxs)(B.SelectContent,{children:[(0,s.jsx)(B.SelectItem,{value:"all",children:"All Workflows"}),Array.from(t).sort().map(e=>(0,s.jsx)(B.SelectItem,{value:e,children:(0,E.parseWorkflowName)(e)?.shortName||e},e))]})]}),(0,s.jsxs)(I.Tooltip,{children:[(0,s.jsx)(I.TooltipTrigger,{asChild:!0,children:(0,s.jsx)("div",{children:(0,s.jsxs)(B.Select,{value:r||"all",onValueChange:d,disabled:l||o&&!e,children:[(0,s.jsx)(B.SelectTrigger,{className:"w-[140px] h-9",children:(0,s.jsx)(B.SelectValue,{placeholder:"Filter by status"})}),(0,s.jsxs)(B.SelectContent,{children:[(0,s.jsx)(B.SelectItem,{value:"all",children:"Any status"}),Object.entries(W).map(([e,{label:r,color:t}])=>(0,s.jsx)(B.SelectItem,{value:e,children:(0,s.jsxs)("div",{className:"flex items-center",children:[(0,s.jsx)("span",{className:`${t} size-1.5 rounded-full mr-2`}),r]})},e))]})]})})}),(0,s.jsx)(I.TooltipContent,{children:o&&"all"===e?"Select a workflow first to filter by status":"Filter runs by status"})]}),(0,s.jsxs)(I.Tooltip,{children:[(0,s.jsx)(I.TooltipTrigger,{asChild:!0,children:(0,s.jsxs)(p.Button,{variant:"outline",size:"sm",onClick:i,disabled:l,children:["desc"===a?(0,s.jsx)(F,{className:"h-4 w-4"}):(0,s.jsx)($,{className:"h-4 w-4"}),"desc"===a?"Newest":"Oldest"]})}),(0,s.jsx)(I.TooltipContent,{children:"desc"===a?"Showing newest first":"Showing oldest first"})]}),(0,s.jsxs)(I.Tooltip,{children:[(0,s.jsx)(I.TooltipTrigger,{asChild:!0,children:(0,s.jsxs)(p.Button,{variant:"outline",size:"sm",onClick:c,disabled:l,children:[(0,s.jsx)(h.RefreshCw,{className:l?"animate-spin":""}),"Refresh"]})}),(0,s.jsx)(I.TooltipContent,{children:"Note that this resets pages"})]})]})]})}function H({config:e,onRunClick:t}){let l,n,h,w,k,I,D=(0,r.useSearchParams)(),P=(l=(0,r.useRouter)(),n=(0,r.usePathname)(),h=(0,r.useSearchParams)(),(0,m.useCallback)(e=>{let s=new URLSearchParams(h.toString());"all"===e?(s.delete("workflow"),s.delete("status")):s.set("workflow",e),l.push(`${n}?${s.toString()}`)},[l,n,h])),F=(w=(0,r.useRouter)(),k=(0,r.usePathname)(),I=(0,r.useSearchParams)(),(0,m.useCallback)(e=>{let s=new URLSearchParams(I.toString());"all"===e?s.delete("status"):s.set("status",e),w.push(`${k}?${s.toString()}`)},[w,k,I])),$=D.get("status"),B=Object.keys(W),H="all"===$||$&&B.includes($)?$:void 0,V=D.get("workflow"),[O,Z]=(0,m.useState)("desc"),[K,X]=(0,m.useState)(()=>new Date),q=(0,m.useMemo)(()=>(0,M.worldConfigToEnvMap)(e),[e]),G=e.backend?.includes("vercel")||!1,[Q,J]=(0,m.useState)(new Set),{data:Y,error:ee,nextPage:es,previousPage:er,hasNextPage:et,hasPreviousPage:ea,reload:el,pageInfo:eo}=(0,a.useWorkflowRuns)(q,{sortOrder:O,workflowName:"all"===V?void 0:V,status:"all"===H?void 0:H});(0,m.useEffect)(()=>{if(Y.data&&Y.data.length>0){let e=new Set(Y.data.map(e=>e.workflowName));J(s=>{let r=new Set(s);for(let s of e)r.add(s);return r})}},[Y.data]);let en=Y.isLoading;return(0,s.jsxs)("div",{children:[(0,s.jsx)(L,{workflowNameFilter:V,status:H,seenWorkflowNames:Q,sortOrder:O,loading:en,statusFilterRequiresWorkflowNameFilter:G,onWorkflowChange:P,onStatusChange:F,onSortToggle:()=>{Z(e=>"desc"===e?"asc":"desc")},onRefresh:()=>{X(()=>new Date),el()},lastRefreshTime:K}),ee?(0,s.jsxs)(f.Alert,{variant:"destructive",children:[(0,s.jsx)(o.AlertCircle,{className:"h-4 w-4"}),(0,s.jsx)(f.AlertTitle,{children:"Error loading runs"}),(0,s.jsx)(f.AlertDescription,{children:(0,a.getErrorMessage)(ee)})]}):en&&!Y?.data?(0,s.jsx)(z,{}):en||Y.data&&0!==Y.data.length?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(g.Card,{className:"overflow-hidden mt-4 bg-background",children:(0,s.jsx)(g.CardContent,{className:"p-0 max-h-[calc(100vh-280px)] overflow-auto",children:(0,s.jsxs)(v,{children:[(0,s.jsx)(y,{children:(0,s.jsxs)(S,{children:[(0,s.jsx)(T,{className:"sticky top-0 bg-background z-10 border-b shadow-sm h-10",children:"Workflow"}),(0,s.jsx)(T,{className:"sticky top-0 bg-background z-10 border-b shadow-sm h-10",children:"Run ID"}),(0,s.jsx)(T,{className:"sticky top-0 bg-background z-10 border-b shadow-sm h-10",children:"Status"}),(0,s.jsx)(T,{className:"sticky top-0 bg-background z-10 border-b shadow-sm h-10",children:"Started"}),(0,s.jsx)(T,{className:"sticky top-0 bg-background z-10 border-b shadow-sm h-10",children:"Completed"}),(0,s.jsx)(T,{className:"sticky top-0 bg-background z-10 border-b shadow-sm h-10 w-10"})]})}),(0,s.jsx)(C,{children:Y.data?.map(e=>(0,s.jsxs)(S,{className:"cursor-pointer group relative",onClick:()=>t(e.runId),children:[(0,s.jsx)(R,{className:"py-2",children:(0,s.jsx)(A.CopyableText,{text:e.workflowName,overlay:!0,children:(0,E.parseWorkflowName)(e.workflowName)?.shortName||"?"})}),(0,s.jsx)(R,{className:"font-mono text-xs py-2",children:(0,s.jsx)(A.CopyableText,{text:e.runId,overlay:!0,children:e.runId})}),(0,s.jsx)(R,{className:"py-2",children:(0,s.jsx)(U.StatusBadge,{status:e.status,context:e,durationMs:e.startedAt?(e.completedAt?new Date(e.completedAt).getTime():Date.now())-new Date(e.startedAt).getTime():void 0})}),(0,s.jsx)(R,{className:"py-2 text-muted-foreground text-xs",children:e.startedAt?(0,s.jsx)(_.RelativeTime,{date:e.startedAt}):"-"}),(0,s.jsx)(R,{className:"py-2 text-muted-foreground text-xs",children:e.completedAt?(0,s.jsx)(_.RelativeTime,{date:e.completedAt}):"-"}),(0,s.jsx)(R,{className:"py-2",children:(0,s.jsxs)(N.DropdownMenu,{children:[(0,s.jsx)(N.DropdownMenuTrigger,{asChild:!0,children:(0,s.jsx)(p.Button,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:e=>e.stopPropagation(),children:(0,s.jsx)(c.MoreHorizontal,{className:"h-4 w-4"})})}),(0,s.jsxs)(N.DropdownMenuContent,{align:"end",children:[(0,s.jsxs)(N.DropdownMenuItem,{onClick:async s=>{s.stopPropagation();try{let s=await (0,a.recreateRun)(q,e.runId);j.toast.success("New run started",{description:`Run ID: ${s}`}),el()}catch(e){j.toast.error("Failed to re-run",{description:e instanceof Error?e.message:"Unknown error"})}},children:[(0,s.jsx)(u.RotateCw,{className:"h-4 w-4 mr-2"}),"Re-run"]}),(0,s.jsxs)(N.DropdownMenuItem,{onClick:async s=>{if(s.stopPropagation(),"pending"!==e.status)return void j.toast.error("Cannot cancel",{description:"Only pending runs can be cancelled"});try{await (0,a.cancelRun)(q,e.runId),j.toast.success("Run cancelled"),el()}catch(e){j.toast.error("Failed to cancel",{description:e instanceof Error?e.message:"Unknown error"})}},disabled:"pending"!==e.status,children:[(0,s.jsx)(x.XCircle,{className:"h-4 w-4 mr-2"}),"Cancel"]})]})]})})]},e.runId))})]})})}),(0,s.jsxs)("div",{className:"flex items-center justify-between mt-4",children:[(0,s.jsx)("div",{className:"text-sm text-muted-foreground",children:eo}),(0,s.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,s.jsxs)(p.Button,{variant:"outline",size:"sm",onClick:er,disabled:!ea,children:[(0,s.jsx)(d,{}),"Previous"]}),(0,s.jsxs)(p.Button,{variant:"outline",size:"sm",onClick:es,disabled:!et,children:["Next",(0,s.jsx)(i.ChevronRight,{})]})]})]})]}):(0,s.jsxs)("div",{className:"text-center py-8 text-muted-foreground",children:["No workflow runs found. ",(0,s.jsx)("br",{}),(0,s.jsx)(b,{href:"https://useworkflow.dev/docs/foundations/workflows-and-steps",children:"Learn how to create a workflow"})]})]})}var V=e.i(889840),O=e.i(480462);function Z(){let e=(0,r.useRouter)(),a=(0,M.useQueryParamConfig)(),[l]=(0,O.useSidebarState)(),[o]=(0,O.useHookIdState)(),[n,d]=(0,O.useTabState)();return(0,s.jsx)("div",{className:"max-w-7xl mx-auto px-4",children:(0,s.jsxs)(V.Tabs,{value:n,onValueChange:d,className:"w-full",children:[(0,s.jsxs)(V.TabsList,{className:"mb-4",children:[(0,s.jsx)(V.TabsTrigger,{value:"runs",children:"Runs"}),(0,s.jsx)(V.TabsTrigger,{value:"hooks",children:"Hooks"})]}),(0,s.jsx)(V.TabsContent,{value:"runs",children:(0,s.jsx)(t.ErrorBoundary,{title:"Runs Error",description:"Failed to load workflow runs. Please try refreshing the page.",children:(0,s.jsx)(H,{config:a,onRunClick:(s,r)=>{r?e.push((0,M.buildUrlWithConfig)(`/run/${s}/streams/${r}`,a)):e.push((0,M.buildUrlWithConfig)(`/run/${s}`,a))}})})}),(0,s.jsx)(V.TabsContent,{value:"hooks",children:(0,s.jsx)(t.ErrorBoundary,{title:"Hooks Error",description:"Failed to load hooks. Please try refreshing the page.",children:(0,s.jsx)(P,{config:a,onHookClick:(s,r)=>{s?e.push((0,M.buildUrlWithConfig)(`/run/${r}`,a,{sidebar:"hook",hookId:s})):e.push((0,M.buildUrlWithConfig)(`/run/${r}`,a))},selectedHookId:"hook"===l&&o?o:void 0})})})]})})}e.s(["default",()=>Z],330997)}]);
@@ -1,60 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,51379,e=>{"use strict";function t(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var r=t(),s={exec:()=>null};function n(e,t=""){let r="string"==typeof e?e:e.source,s={replace:(e,t)=>{let n="string"==typeof t?t:t.source;return n=n.replace(l.caret,"$1"),r=r.replace(e,n),s},getRegex:()=>new RegExp(r,t)};return s}var l={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i")},i=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,a=/(?:[*+-]|\d{1,9}[.)])/,o=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,c=n(o).replace(/bull/g,a).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),h=n(o).replace(/bull/g,a).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),u=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,p=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,d=n(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",p).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),g=n(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,a).getRegex(),f="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",k=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,x=n("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",k).replace("tag",f).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),m=n(u).replace("hr",i).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",f).getRegex(),b={blockquote:n(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",m).getRegex(),code:/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,def:d,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,hr:i,html:x,lheading:c,list:g,newline:/^(?:[ \t]*(?:\n|$))+/,paragraph:m,table:s,text:/^[^\n]+/},w=n("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",i).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",f).getRegex(),y={...b,lheading:h,table:w,paragraph:n(u).replace("hr",i).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",w).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",f).getRegex()},v={...b,html:n(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",k).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:s,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:n(u).replace("hr",i).replace("heading",` *#{1,6} *[^
2
- ]`).replace("lheading",c).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},j=/^( {2,}|\\)\n(?!\s*$)/,S=/[\p{P}\p{S}]/u,C=/[\s\p{P}\p{S}]/u,$=/[^\s\p{P}\p{S}]/u,T=n(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,C).getRegex(),R=/(?!~)[\p{P}\p{S}]/u,N=n(/link|code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<!`)(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("code",/(?<!`)(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),L=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,A=n(L,"u").replace(/punct/g,S).getRegex(),z=n(L,"u").replace(/punct/g,R).getRegex(),P="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",I=n(P,"gu").replace(/notPunctSpace/g,$).replace(/punctSpace/g,C).replace(/punct/g,S).getRegex(),_=n(P,"gu").replace(/notPunctSpace/g,/(?:[^\s\p{P}\p{S}]|~)/u).replace(/punctSpace/g,/(?!~)[\s\p{P}\p{S}]/u).replace(/punct/g,R).getRegex(),E=n("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,$).replace(/punctSpace/g,C).replace(/punct/g,S).getRegex(),M=n(/\\(punct)/,"gu").replace(/punct/g,S).getRegex(),q=n(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),H=n(k).replace("(?:-->|$)","-->").getRegex(),B=n("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",H).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),V=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,D=n(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",V).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Z=n(/^!?\[(label)\]\[(ref)\]/).replace("label",V).replace("ref",p).getRegex(),U=n(/^!?\[(ref)\](?:\[\])?/).replace("ref",p).getRegex(),O=n("reflink|nolink(?!\\()","g").replace("reflink",Z).replace("nolink",U).getRegex(),F=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,W={_backpedal:s,anyPunctuation:M,autolink:q,blockSkip:N,br:j,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,del:s,emStrongLDelim:A,emStrongRDelimAst:I,emStrongRDelimUnd:E,escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,link:D,nolink:U,punctuation:T,reflink:Z,reflinkSearch:O,tag:B,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,url:s},Q={...W,link:n(/^!?\[(label)\]\((.*?)\)/).replace("label",V).getRegex(),reflink:n(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",V).getRegex()},G={...W,emStrongRDelimAst:_,emStrongLDelim:z,url:n(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",F).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:n(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",F).getRegex()},K={...G,br:n(j).replace("{2,}","*").getRegex(),text:n(G.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},X={normal:b,gfm:y,pedantic:v},J={normal:W,gfm:G,breaks:K,pedantic:Q},Y={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},ee=e=>Y[e];function et(e,t){if(t){if(l.escapeTest.test(e))return e.replace(l.escapeReplace,ee)}else if(l.escapeTestNoEncode.test(e))return e.replace(l.escapeReplaceNoEncode,ee);return e}function er(e){try{e=encodeURI(e).replace(l.percentDecode,"%")}catch{return null}return e}function es(e,t){let r=e.replace(l.findPipe,(e,t,r)=>{let s=!1,n=t;for(;--n>=0&&"\\"===r[n];)s=!s;return s?"|":" |"}).split(l.splitPipe),s=0;if(r[0].trim()||r.shift(),r.length>0&&!r.at(-1)?.trim()&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;s<r.length;s++)r[s]=r[s].trim().replace(l.slashPipe,"|");return r}function en(e,t,r){let s=e.length;if(0===s)return"";let n=0;for(;n<s;){let l=e.charAt(s-n-1);if(l!==t||r)if(l!==t&&r)n++;else break;else n++}return e.slice(0,s-n)}function el(e,t,r,s,n){let l=t.href,i=t.title||null,a=e[1].replace(n.other.outputLinkReplace,"$1");s.state.inLink=!0;let o={type:"!"===e[0].charAt(0)?"image":"link",raw:r,href:l,title:i,text:a,tokens:s.inlineTokens(a)};return s.state.inLink=!1,o}var ei=class{options;rules;lexer;constructor(e){this.options=e||r}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:en(e,`
3
- `)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],r=function(e,t,r){let s=e.match(r.other.indentCodeCompensation);if(null===s)return t;let n=s[1];return t.split(`
4
- `).map(e=>{let t=e.match(r.other.beginningSpace);if(null===t)return e;let[s]=t;return s.length>=n.length?e.slice(n.length):e}).join(`
5
- `)}(e,t[3]||"",this.rules);return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:r}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=en(e,"#");(this.options.pedantic||!t||this.rules.other.endingSpaceChar.test(t))&&(e=t.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:en(t[0],`
6
- `)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=en(t[0],`
7
- `).split(`
8
- `),r="",s="",n=[];for(;e.length>0;){let t=!1,l=[],i;for(i=0;i<e.length;i++)if(this.rules.other.blockquoteStart.test(e[i]))l.push(e[i]),t=!0;else if(t)break;else l.push(e[i]);e=e.slice(i);let a=l.join(`
9
- `),o=a.replace(this.rules.other.blockquoteSetextReplace,`
10
- $1`).replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}
11
- ${a}`:a,s=s?`${s}
12
- ${o}`:o;let c=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(o,n,!0),this.lexer.state.top=c,0===e.length)break;let h=n.at(-1);if(h?.type==="code")break;if(h?.type==="blockquote"){let t=h.raw+`
13
- `+e.join(`
14
- `),l=this.blockquote(t);n[n.length-1]=l,r=r.substring(0,r.length-h.raw.length)+l.raw,s=s.substring(0,s.length-h.text.length)+l.text;break}if(h?.type==="list"){let t=h.raw+`
15
- `+e.join(`
16
- `),l=this.list(t);n[n.length-1]=l,r=r.substring(0,r.length-h.raw.length)+l.raw,s=s.substring(0,s.length-h.raw.length)+l.raw,e=t.substring(n.at(-1).raw.length).split(`
17
- `);continue}}return{type:"blockquote",raw:r,tokens:n,text:s}}}list(e){let t=this.rules.block.list.exec(e);if(t){let r=t[1].trim(),s=r.length>1,n={type:"list",raw:"",ordered:s,start:s?+r.slice(0,-1):"",loose:!1,items:[]};r=s?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=s?r:"[*+-]");let l=this.rules.other.listItemRegex(r),i=!1;for(;e;){let r=!1,s="",a="";if(!(t=l.exec(e))||this.rules.block.hr.test(e))break;s=t[0],e=e.substring(s.length);let o=t[2].split(`
18
- `,1)[0].replace(this.rules.other.listReplaceTabs,e=>" ".repeat(3*e.length)),c=e.split(`
19
- `,1)[0],h=!o.trim(),u=0;if(this.options.pedantic?(u=2,a=o.trimStart()):h?u=t[1].length+1:(u=(u=t[2].search(this.rules.other.nonSpaceChar))>4?1:u,a=o.slice(u),u+=t[1].length),h&&this.rules.other.blankLine.test(c)&&(s+=c+`
20
- `,e=e.substring(c.length+1),r=!0),!r){let t=this.rules.other.nextBulletRegex(u),r=this.rules.other.hrRegex(u),n=this.rules.other.fencesBeginRegex(u),l=this.rules.other.headingBeginRegex(u),i=this.rules.other.htmlBeginRegex(u);for(;e;){let p=e.split(`
21
- `,1)[0],d;if(c=p,d=this.options.pedantic?c=c.replace(this.rules.other.listReplaceNesting," "):c.replace(this.rules.other.tabCharGlobal," "),n.test(c)||l.test(c)||i.test(c)||t.test(c)||r.test(c))break;if(d.search(this.rules.other.nonSpaceChar)>=u||!c.trim())a+=`
22
- `+d.slice(u);else{if(h||o.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||n.test(o)||l.test(o)||r.test(o))break;a+=`
23
- `+c}h||c.trim()||(h=!0),s+=p+`
24
- `,e=e.substring(p.length+1),o=d.slice(u)}}n.loose||(i?n.loose=!0:this.rules.other.doubleBlankLine.test(s)&&(i=!0));let p=null,d;this.options.gfm&&(p=this.rules.other.listIsTask.exec(a))&&(d="[ ] "!==p[0],a=a.replace(this.rules.other.listReplaceTask,"")),n.items.push({type:"list_item",raw:s,task:!!p,checked:d,loose:!1,text:a,tokens:[]}),n.raw+=s}let a=n.items.at(-1);if(!a)return;a.raw=a.raw.trimEnd(),a.text=a.text.trimEnd(),n.raw=n.raw.trimEnd();for(let e=0;e<n.items.length;e++)if(this.lexer.state.top=!1,n.items[e].tokens=this.lexer.blockTokens(n.items[e].text,[]),!n.loose){let t=n.items[e].tokens.filter(e=>"space"===e.type);n.loose=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw))}if(n.loose)for(let e=0;e<n.items.length;e++)n.items[e].loose=!0;return n}}html(e){let t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:"pre"===t[1]||"script"===t[1]||"style"===t[1],text:t[0]}}def(e){let t=this.rules.block.def.exec(e);if(t){let e=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",s=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:r,title:s}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let r=es(t[1]),s=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),n=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
25
- `):[],l={type:"table",raw:t[0],header:[],align:[],rows:[]};if(r.length===s.length){for(let e of s)this.rules.other.tableAlignRight.test(e)?l.align.push("right"):this.rules.other.tableAlignCenter.test(e)?l.align.push("center"):this.rules.other.tableAlignLeft.test(e)?l.align.push("left"):l.align.push(null);for(let e=0;e<r.length;e++)l.header.push({text:r[e],tokens:this.lexer.inline(r[e]),header:!0,align:l.align[e]});for(let e of n)l.rows.push(es(e,l.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:l.align[t]})));return l}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e=t[1].charAt(t[1].length-1)===`
26
- `?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let e=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;let t=en(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{let e=function(e,t){if(-1===e.indexOf(")"))return -1;let r=0;for(let t=0;t<e.length;t++)if("\\"===e[t])t++;else if("("===e[t])r++;else if(")"===e[t]&&--r<0)return t;return r>0?-2:-1}(t[2],0);if(-2===e)return;if(e>-1){let r=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,r).trim(),t[3]=""}}let r=t[2],s="";if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(r);e&&(r=e[1],s=e[3])}else s=t[3]?t[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(r=this.options.pedantic&&!this.rules.other.endAngleBracket.test(e)?r.slice(1):r.slice(1,-1)),el(t,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:s&&s.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let r;if((r=this.rules.inline.reflink.exec(e))||(r=this.rules.inline.nolink.exec(e))){let e=t[(r[2]||r[1]).replace(this.rules.other.multipleSpaceGlobal," ").toLowerCase()];if(!e){let e=r[0].charAt(0);return{type:"text",raw:e,text:e}}return el(r,e,r[0],this.lexer,this.rules)}}emStrong(e,t,r=""){let s=this.rules.inline.emStrongLDelim.exec(e);if(!(!s||s[3]&&r.match(this.rules.other.unicodeAlphaNumeric))&&(!(s[1]||s[2])||!r||this.rules.inline.punctuation.exec(r))){let r=[...s[0]].length-1,n,l,i=r,a=0,o="*"===s[0][0]?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(o.lastIndex=0,t=t.slice(-1*e.length+r);null!=(s=o.exec(t));){if(!(n=s[1]||s[2]||s[3]||s[4]||s[5]||s[6]))continue;if(l=[...n].length,s[3]||s[4]){i+=l;continue}if((s[5]||s[6])&&r%3&&!((r+l)%3)){a+=l;continue}if((i-=l)>0)continue;l=Math.min(l,l+i+a);let t=[...s[0]][0].length,o=e.slice(0,r+s.index+t+l);if(Math.min(r,l)%2){let e=o.slice(1,-1);return{type:"em",raw:o,text:e,tokens:this.lexer.inlineTokens(e)}}let c=o.slice(2,-2);return{type:"strong",raw:o,text:c,tokens:this.lexer.inlineTokens(c)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal," "),r=this.rules.other.nonSpaceChar.test(e),s=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return r&&s&&(e=e.substring(1,e.length-1)),{type:"codespan",raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){let t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,r;return r="@"===t[2]?"mailto:"+(e=t[1]):e=t[1],{type:"link",raw:t[0],text:e,href:r,tokens:[{type:"text",raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,r;if("@"===t[2])r="mailto:"+(e=t[0]);else{let s;do s=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??"";while(s!==t[0])e=t[0],r="www."===t[1]?"http://"+t[0]:t[0]}return{type:"link",raw:t[0],text:e,href:r,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:e}}}},ea=class e{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||r,this.options.tokenizer=this.options.tokenizer||new ei,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={other:l,block:X.normal,inline:J.normal};this.options.pedantic?(t.block=X.pedantic,t.inline=J.pedantic):this.options.gfm&&(t.block=X.gfm,this.options.breaks?t.inline=J.breaks:t.inline=J.gfm),this.tokenizer.rules=t}static get rules(){return{block:X,inline:J}}static lex(t,r){return new e(r).lex(t)}static lexInline(t,r){return new e(r).inlineTokens(t)}lex(e){e=e.replace(l.carriageReturn,`
27
- `),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],r=!1){for(this.options.pedantic&&(e=e.replace(l.tabCharGlobal," ").replace(l.spaceLine,""));e;){let s;if(this.options.extensions?.block?.some(r=>!!(s=r.call({lexer:this},e,t))&&(e=e.substring(s.raw.length),t.push(s),!0)))continue;if(s=this.tokenizer.space(e)){e=e.substring(s.raw.length);let r=t.at(-1);1===s.raw.length&&void 0!==r?r.raw+=`
28
- `:t.push(s);continue}if(s=this.tokenizer.code(e)){e=e.substring(s.raw.length);let r=t.at(-1);r?.type==="paragraph"||r?.type==="text"?(r.raw+=(r.raw.endsWith(`
29
- `)?"":`
30
- `)+s.raw,r.text+=`
31
- `+s.text,this.inlineQueue.at(-1).src=r.text):t.push(s);continue}if((s=this.tokenizer.fences(e))||(s=this.tokenizer.heading(e))||(s=this.tokenizer.hr(e))||(s=this.tokenizer.blockquote(e))||(s=this.tokenizer.list(e))||(s=this.tokenizer.html(e))){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.def(e)){e=e.substring(s.raw.length);let r=t.at(-1);r?.type==="paragraph"||r?.type==="text"?(r.raw+=(r.raw.endsWith(`
32
- `)?"":`
33
- `)+s.raw,r.text+=`
34
- `+s.raw,this.inlineQueue.at(-1).src=r.text):this.tokens.links[s.tag]||(this.tokens.links[s.tag]={href:s.href,title:s.title},t.push(s));continue}if((s=this.tokenizer.table(e))||(s=this.tokenizer.lheading(e))){e=e.substring(s.raw.length),t.push(s);continue}let n=e;if(this.options.extensions?.startBlock){let t=1/0,r=e.slice(1),s;this.options.extensions.startBlock.forEach(e=>{"number"==typeof(s=e.call({lexer:this},r))&&s>=0&&(t=Math.min(t,s))}),t<1/0&&t>=0&&(n=e.substring(0,t+1))}if(this.state.top&&(s=this.tokenizer.paragraph(n))){let l=t.at(-1);r&&l?.type==="paragraph"?(l.raw+=(l.raw.endsWith(`
35
- `)?"":`
36
- `)+s.raw,l.text+=`
37
- `+s.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=l.text):t.push(s),r=n.length!==e.length,e=e.substring(s.raw.length);continue}if(s=this.tokenizer.text(e)){e=e.substring(s.raw.length);let r=t.at(-1);r?.type==="text"?(r.raw+=(r.raw.endsWith(`
38
- `)?"":`
39
- `)+s.raw,r.text+=`
40
- `+s.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=r.text):t.push(s);continue}if(e){let t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let r=e,s=null;if(this.tokens.links){let e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(s=this.tokenizer.rules.inline.reflinkSearch.exec(r));)e.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(s=this.tokenizer.rules.inline.anyPunctuation.exec(r));)r=r.slice(0,s.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;null!=(s=this.tokenizer.rules.inline.blockSkip.exec(r));)r=r.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);r=this.options.hooks?.emStrongMask?.call({lexer:this},r)??r;let n=!1,l="";for(;e;){let s;if(n||(l=""),n=!1,this.options.extensions?.inline?.some(r=>!!(s=r.call({lexer:this},e,t))&&(e=e.substring(s.raw.length),t.push(s),!0)))continue;if((s=this.tokenizer.escape(e))||(s=this.tokenizer.tag(e))||(s=this.tokenizer.link(e))){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(s.raw.length);let r=t.at(-1);"text"===s.type&&r?.type==="text"?(r.raw+=s.raw,r.text+=s.text):t.push(s);continue}if((s=this.tokenizer.emStrong(e,r,l))||(s=this.tokenizer.codespan(e))||(s=this.tokenizer.br(e))||(s=this.tokenizer.del(e))||(s=this.tokenizer.autolink(e))||!this.state.inLink&&(s=this.tokenizer.url(e))){e=e.substring(s.raw.length),t.push(s);continue}let i=e;if(this.options.extensions?.startInline){let t=1/0,r=e.slice(1),s;this.options.extensions.startInline.forEach(e=>{"number"==typeof(s=e.call({lexer:this},r))&&s>=0&&(t=Math.min(t,s))}),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(s=this.tokenizer.inlineText(i)){e=e.substring(s.raw.length),"_"!==s.raw.slice(-1)&&(l=s.raw.slice(-1)),n=!0;let r=t.at(-1);r?.type==="text"?(r.raw+=s.raw,r.text+=s.text):t.push(s);continue}if(e){let t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw Error(t)}}return t}},eo=class{options;parser;constructor(e){this.options=e||r}space(e){return""}code({text:e,lang:t,escaped:r}){let s=(t||"").match(l.notSpaceStart)?.[0],n=e.replace(l.endingNewline,"")+`
41
- `;return s?'<pre><code class="language-'+et(s)+'">'+(r?n:et(n,!0))+`</code></pre>
42
- `:"<pre><code>"+(r?n:et(n,!0))+`</code></pre>
43
- `}blockquote({tokens:e}){return`<blockquote>
44
- ${this.parser.parse(e)}</blockquote>
45
- `}html({text:e}){return e}def(e){return""}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
46
- `}hr(e){return`<hr>
47
- `}list(e){let t=e.ordered,r=e.start,s="";for(let t=0;t<e.items.length;t++){let r=e.items[t];s+=this.listitem(r)}let n=t?"ol":"ul";return"<"+n+(t&&1!==r?' start="'+r+'"':"")+`>
48
- `+s+"</"+n+`>
49
- `}listitem(e){let t="";if(e.task){let r=this.checkbox({checked:!!e.checked});e.loose?e.tokens[0]?.type==="paragraph"?(e.tokens[0].text=r+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&"text"===e.tokens[0].tokens[0].type&&(e.tokens[0].tokens[0].text=r+" "+et(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:"text",raw:r+" ",text:r+" ",escaped:!0}):t+=r+" "}return t+=this.parser.parse(e.tokens,!!e.loose),`<li>${t}</li>
50
- `}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
51
- `}table(e){let t="",r="";for(let t=0;t<e.header.length;t++)r+=this.tablecell(e.header[t]);t+=this.tablerow({text:r});let s="";for(let t=0;t<e.rows.length;t++){let n=e.rows[t];r="";for(let e=0;e<n.length;e++)r+=this.tablecell(n[e]);s+=this.tablerow({text:r})}return s&&(s=`<tbody>${s}</tbody>`),`<table>
52
- <thead>
53
- `+t+`</thead>
54
- `+s+`</table>
55
- `}tablerow({text:e}){return`<tr>
56
- ${e}</tr>
57
- `}tablecell(e){let t=this.parser.parseInline(e.tokens),r=e.header?"th":"td";return(e.align?`<${r} align="${e.align}">`:`<${r}>`)+t+`</${r}>
58
- `}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${et(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:r}){let s=this.parser.parseInline(r),n=er(e);if(null===n)return s;let l='<a href="'+(e=n)+'"';return t&&(l+=' title="'+et(t)+'"'),l+=">"+s+"</a>"}image({href:e,title:t,text:r,tokens:s}){s&&(r=this.parser.parseInline(s,this.parser.textRenderer));let n=er(e);if(null===n)return et(r);e=n;let l=`<img src="${e}" alt="${r}"`;return t&&(l+=` title="${et(t)}"`),l+=">"}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:et(e.text)}},ec=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}},eh=class e{options;renderer;textRenderer;constructor(e){this.options=e||r,this.options.renderer=this.options.renderer||new eo,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new ec}static parse(t,r){return new e(r).parse(t)}static parseInline(t,r){return new e(r).parseInline(t)}parse(e,t=!0){let r="";for(let s=0;s<e.length;s++){let n=e[s];if(this.options.extensions?.renderers?.[n.type]){let e=this.options.extensions.renderers[n.type].call({parser:this},n);if(!1!==e||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(n.type)){r+=e||"";continue}}switch(n.type){case"space":r+=this.renderer.space(n);continue;case"hr":r+=this.renderer.hr(n);continue;case"heading":r+=this.renderer.heading(n);continue;case"code":r+=this.renderer.code(n);continue;case"table":r+=this.renderer.table(n);continue;case"blockquote":r+=this.renderer.blockquote(n);continue;case"list":r+=this.renderer.list(n);continue;case"html":r+=this.renderer.html(n);continue;case"def":r+=this.renderer.def(n);continue;case"paragraph":r+=this.renderer.paragraph(n);continue;case"text":{let l=n,i=this.renderer.text(l);for(;s+1<e.length&&"text"===e[s+1].type;)l=e[++s],i+=`
59
- `+this.renderer.text(l);t?r+=this.renderer.paragraph({type:"paragraph",raw:i,text:i,tokens:[{type:"text",raw:i,text:i,escaped:!0}]}):r+=i;continue}default:{let e='Token with "'+n.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw Error(e)}}}return r}parseInline(e,t=this.renderer){let r="";for(let s=0;s<e.length;s++){let n=e[s];if(this.options.extensions?.renderers?.[n.type]){let e=this.options.extensions.renderers[n.type].call({parser:this},n);if(!1!==e||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(n.type)){r+=e||"";continue}}switch(n.type){case"escape":case"text":r+=t.text(n);break;case"html":r+=t.html(n);break;case"link":r+=t.link(n);break;case"image":r+=t.image(n);break;case"strong":r+=t.strong(n);break;case"em":r+=t.em(n);break;case"codespan":r+=t.codespan(n);break;case"br":r+=t.br(n);break;case"del":r+=t.del(n);break;default:{let e='Token with "'+n.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw Error(e)}}}return r}},eu=class{options;block;constructor(e){this.options=e||r}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(){return this.block?ea.lex:ea.lexInline}provideParser(){return this.block?eh.parse:eh.parseInline}},ep=new class{defaults=t();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=eh;Renderer=eo;TextRenderer=ec;Lexer=ea;Tokenizer=ei;Hooks=eu;constructor(...e){this.use(...e)}walkTokens(e,t){let r=[];for(let s of e)switch(r=r.concat(t.call(this,s)),s.type){case"table":for(let e of s.header)r=r.concat(this.walkTokens(e.tokens,t));for(let e of s.rows)for(let s of e)r=r.concat(this.walkTokens(s.tokens,t));break;case"list":r=r.concat(this.walkTokens(s.items,t));break;default:{let e=s;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(s=>{let n=e[s].flat(1/0);r=r.concat(this.walkTokens(n,t))}):e.tokens&&(r=r.concat(this.walkTokens(e.tokens,t)))}}return r}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let r={...e};if(r.async=this.defaults.async||r.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error("extension name required");if("renderer"in e){let r=t.renderers[e.name];r?t.renderers[e.name]=function(...t){let s=e.renderer.apply(this,t);return!1===s&&(s=r.apply(this,t)),s}:t.renderers[e.name]=e.renderer}if("tokenizer"in e){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw Error("extension level must be 'block' or 'inline'");let r=t[e.level];r?r.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&("block"===e.level?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:"inline"===e.level&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}"childTokens"in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),r.extensions=t),e.renderer){let t=this.defaults.renderer||new eo(this.defaults);for(let r in e.renderer){if(!(r in t))throw Error(`renderer '${r}' does not exist`);if(["options","parser"].includes(r))continue;let s=e.renderer[r],n=t[r];t[r]=(...e)=>{let r=s.apply(t,e);return!1===r&&(r=n.apply(t,e)),r||""}}r.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new ei(this.defaults);for(let r in e.tokenizer){if(!(r in t))throw Error(`tokenizer '${r}' does not exist`);if(["options","rules","lexer"].includes(r))continue;let s=e.tokenizer[r],n=t[r];t[r]=(...e)=>{let r=s.apply(t,e);return!1===r&&(r=n.apply(t,e)),r}}r.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new eu;for(let r in e.hooks){if(!(r in t))throw Error(`hook '${r}' does not exist`);if(["options","block"].includes(r))continue;let s=e.hooks[r],n=t[r];eu.passThroughHooks.has(r)?t[r]=e=>{if(this.defaults.async&&eu.passThroughHooksRespectAsync.has(r))return(async()=>{let r=await s.call(t,e);return n.call(t,r)})();let l=s.call(t,e);return n.call(t,l)}:t[r]=(...e)=>{if(this.defaults.async)return(async()=>{let r=await s.apply(t,e);return!1===r&&(r=await n.apply(t,e)),r})();let r=s.apply(t,e);return!1===r&&(r=n.apply(t,e)),r}}r.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,s=e.walkTokens;r.walkTokens=function(e){let r=[];return r.push(s.call(this,e)),t&&(r=r.concat(t.call(this,e))),r}}this.defaults={...this.defaults,...r}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return ea.lex(e,t??this.defaults)}parser(e,t){return eh.parse(e,t??this.defaults)}parseMarkdown(e){return(t,r)=>{let s={...r},n={...this.defaults,...s},l=this.onError(!!n.silent,!!n.async);if(!0===this.defaults.async&&!1===s.async)return l(Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof t>"u"||null===t)return l(Error("marked(): input parameter is undefined or null"));if("string"!=typeof t)return l(Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));if(n.hooks&&(n.hooks.options=n,n.hooks.block=e),n.async)return(async()=>{let r=n.hooks?await n.hooks.preprocess(t):t,s=await (n.hooks?await n.hooks.provideLexer():e?ea.lex:ea.lexInline)(r,n),l=n.hooks?await n.hooks.processAllTokens(s):s;n.walkTokens&&await Promise.all(this.walkTokens(l,n.walkTokens));let i=await (n.hooks?await n.hooks.provideParser():e?eh.parse:eh.parseInline)(l,n);return n.hooks?await n.hooks.postprocess(i):i})().catch(l);try{n.hooks&&(t=n.hooks.preprocess(t));let r=(n.hooks?n.hooks.provideLexer():e?ea.lex:ea.lexInline)(t,n);n.hooks&&(r=n.hooks.processAllTokens(r)),n.walkTokens&&this.walkTokens(r,n.walkTokens);let s=(n.hooks?n.hooks.provideParser():e?eh.parse:eh.parseInline)(r,n);return n.hooks&&(s=n.hooks.postprocess(s)),s}catch(e){return l(e)}}}onError(e,t){return r=>{if(r.message+=`
60
- Please report this to https://github.com/markedjs/marked.`,e){let e="<p>An error occurred:</p><pre>"+et(r.message+"",!0)+"</pre>";return t?Promise.resolve(e):e}if(t)return Promise.reject(r);throw r}}};function ed(e,t){return ep.parse(e,t)}ed.options=ed.setOptions=function(e){return ep.setOptions(e),ed.defaults=ep.defaults,r=ed.defaults,ed},ed.getDefaults=t,ed.defaults=r,ed.use=function(...e){return ep.use(...e),ed.defaults=ep.defaults,r=ed.defaults,ed},ed.walkTokens=function(e,t){return ep.walkTokens(e,t)},ed.parseInline=ep.parseInline,ed.Parser=eh,ed.parser=eh.parse,ed.Renderer=eo,ed.TextRenderer=ec,ed.Lexer=ea,ed.lexer=ea.lex,ed.Tokenizer=ei,ed.Hooks=eu,ed.parse=ed,ed.options,ed.setOptions,ed.use,ed.walkTokens,ed.parseInline,eh.parse,ea.lex,e.s(["Lexer",()=>ea,"marked",()=>ed])},170349,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"warnOnce",{enumerable:!0,get:function(){return s}});let s=e=>{}},809737,e=>{e.v("/_next/static/media/worker.e575ad4f.js")},693144,e=>{"use strict";var t=e.i(349011),r=e.i(610062);function s(){(0,t.c)("[nuqs] Aborting queues"),r.t.abortAll(),r.n.abort().forEach(e=>r.t.queuedQuerySync.emit(e))}var n=e.i(686107),l=e.i(868924);let i=0;function a(){i=0,s()}function o(){--i<=0&&(i=0,queueMicrotask(s))}function c(){return(0,n.useEffect)(()=>(!function(){var e;if(e="next/app","undefined"==typeof history||(history.nuqs?.version&&"2.8.3"!==history.nuqs.version?(console.error((0,t.s)(409),history.nuqs.version,"2.8.3",e),!0):!!history.nuqs?.adapters?.includes(e)))return;let r=history.replaceState,s=history.pushState;history.replaceState=function(e,t,s){return o(),r.call(history,e,t,s)},history.pushState=function(e,t,r){return o(),s.call(history,e,t,r)},history.nuqs=history.nuqs??{version:"2.8.3",adapters:[]},history.nuqs.adapters.push("next/app")}(),window.addEventListener("popstate",a),()=>window.removeEventListener("popstate",a)),[]),null}let h=(0,t.n)(function(){let e=(0,l.useRouter)(),[r,s]=(0,n.useOptimistic)((0,l.useSearchParams)());return{searchParams:r,updateUrl:(0,n.useCallback)((r,l)=>{(0,n.startTransition)(()=>{l.shallow||s(r);let n=function(e){let{origin:r,pathname:s,hash:n}=location;return r+s+(0,t.o)(e)+n}(r);(0,t.c)("[nuqs next/app] Updating url: %s",n);let a="push"===l.history?history.pushState:history.replaceState;i=3,a.call(history,null,"",n),l.scroll&&window.scrollTo(0,0),l.shallow||e.replace(n,{scroll:!1})})},[]),rateLimitFactor:3,autoResetQueueOnUpdate:!1}});function u({children:e,...t}){return(0,n.createElement)(h,{...t,children:[(0,n.createElement)(n.Suspense,{key:"nuqs-adapter-suspense-navspy",children:(0,n.createElement)(c)}),e]})}e.s(["NuqsAdapter",()=>u],693144)},608576,e=>{"use strict";var t=e.i(666426),r=e.i(912738),s=e.i(414576),n=e.i(868924),l=e.i(686107),i=(e,t,r,s,n,l,i,a)=>{let o=document.documentElement,c=["light","dark"];function h(t){var r;(Array.isArray(e)?e:[e]).forEach(e=>{let r="class"===e,s=r&&l?n.map(e=>l[e]||e):n;r?(o.classList.remove(...s),o.classList.add(l&&l[t]?l[t]:t)):o.setAttribute(e,t)}),r=t,a&&c.includes(r)&&(o.style.colorScheme=r)}if(s)h(s);else try{let e=localStorage.getItem(t)||r,s=i&&"system"===e?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e;h(s)}catch(e){}},a=["light","dark"],o="(prefers-color-scheme: dark)",c="undefined"==typeof window,h=l.createContext(void 0),u={setTheme:e=>{},themes:[]},p=()=>{var e;return null!=(e=l.useContext(h))?e:u},d=e=>l.useContext(h)?l.createElement(l.Fragment,null,e.children):l.createElement(f,{...e}),g=["light","dark"],f=({forcedTheme:e,disableTransitionOnChange:t=!1,enableSystem:r=!0,enableColorScheme:s=!0,storageKey:n="theme",themes:i=g,defaultTheme:c=r?"system":"light",attribute:u="data-theme",value:p,children:d,nonce:f,scriptProps:w})=>{let[y,v]=l.useState(()=>x(n,c)),[j,S]=l.useState(()=>"system"===y?b():y),C=p?Object.values(p):i,$=l.useCallback(e=>{let n=e;if(!n)return;"system"===e&&r&&(n=b());let l=p?p[n]:n,i=t?m(f):null,o=document.documentElement,h=e=>{"class"===e?(o.classList.remove(...C),l&&o.classList.add(l)):e.startsWith("data-")&&(l?o.setAttribute(e,l):o.removeAttribute(e))};if(Array.isArray(u)?u.forEach(h):h(u),s){let e=a.includes(c)?c:null,t=a.includes(n)?n:e;o.style.colorScheme=t}null==i||i()},[f]),T=l.useCallback(e=>{let t="function"==typeof e?e(y):e;v(t);try{localStorage.setItem(n,t)}catch(e){}},[y]),R=l.useCallback(t=>{S(b(t)),"system"===y&&r&&!e&&$("system")},[y,e]);l.useEffect(()=>{let e=window.matchMedia(o);return e.addListener(R),R(e),()=>e.removeListener(R)},[R]),l.useEffect(()=>{let e=e=>{e.key===n&&(e.newValue?v(e.newValue):T(c))};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)},[T]),l.useEffect(()=>{$(null!=e?e:y)},[e,y]);let N=l.useMemo(()=>({theme:y,setTheme:T,forcedTheme:e,resolvedTheme:"system"===y?j:y,themes:r?[...i,"system"]:i,systemTheme:r?j:void 0}),[y,T,e,j,r,i]);return l.createElement(h.Provider,{value:N},l.createElement(k,{forcedTheme:e,storageKey:n,attribute:u,enableSystem:r,enableColorScheme:s,defaultTheme:c,value:p,themes:i,nonce:f,scriptProps:w}),d)},k=l.memo(({forcedTheme:e,storageKey:t,attribute:r,enableSystem:s,enableColorScheme:n,defaultTheme:a,value:o,themes:c,nonce:h,scriptProps:u})=>{let p=JSON.stringify([r,t,a,e,c,o,s,n]).slice(1,-1);return l.createElement("script",{...u,suppressHydrationWarning:!0,nonce:"undefined"==typeof window?h:"",dangerouslySetInnerHTML:{__html:`(${i.toString()})(${p})`}})}),x=(e,t)=>{let r;if(!c){try{r=localStorage.getItem(e)||void 0}catch(e){}return r||t}},m=e=>{let t=document.createElement("style");return e&&t.setAttribute("nonce",e),t.appendChild(document.createTextNode("*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(t),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(t)},1)}},b=e=>(e||(e=window.matchMedia(o)),e.matches?"dark":"light"),w=e.i(886288);let y=(0,w.default)("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);var v=e.i(638322);function j({config:e}){let{provider:r,parts:s}=((e,t)=>{if("vercel"===e){let e=[];return t.env&&e.push(`env: ${t.env}`),t.project&&e.push(`project: ${t.project}`),t.team&&e.push(`team: ${t.team}`),{provider:"Vercel",parts:e}}if("local"===e){let e=[];return t.dataDir&&e.push(`dir: ${t.dataDir}`),t.port&&e.push(`port: ${t.port}`),{provider:"Local",parts:e}}return{provider:t.backend||"unknown",parts:[]}})(e.backend||"local",e);return(0,t.jsxs)("div",{className:"text-sm text-muted-foreground flex items-center gap-2",children:[(0,t.jsxs)("span",{className:"font-medium",children:["Connected to: ",r]}),(0,t.jsxs)(v.Tooltip,{children:[(0,t.jsx)(v.TooltipTrigger,{asChild:!0,children:(0,t.jsx)(y,{className:"w-4 h-4"})}),(0,t.jsx)(v.TooltipContent,{children:(0,t.jsx)("div",{className:"flex flex-col gap-1",children:s.map(e=>(0,t.jsx)("span",{children:e},e))})})]})]})}let S=(0,w.default)("ExternalLink",[["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"}]]),C=(0,w.default)("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"}]]),$=(0,w.default)("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]),T=(0,w.default)("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]),R=(0,w.default)("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);var N=e.i(260218),L=e.i(917955),A=e.i(949245);function z({value:e,onValueChange:r,options:s,className:n}){return(0,t.jsx)("div",{className:(0,A.cn)("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",n),children:s.map(s=>(0,t.jsxs)("button",{type:"button",onClick:()=>r(s.value),className:(0,A.cn)("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",e===s.value?"bg-background text-foreground shadow":"hover:bg-background/50"),children:[s.icon,s.label&&(0,t.jsx)("span",{className:"ml-2",children:s.label})]},s.value))})}var P=e.i(687602);let I=(0,w.default)("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),_=(0,w.default)("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);var E=e.i(456944);let M=l.forwardRef(({className:e,type:r,...s},n)=>(0,t.jsx)("input",{type:r,className:(0,A.cn)("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:n,...s}));M.displayName="Input";var q=e.i(692792),H=l.forwardRef((e,r)=>(0,t.jsx)(q.Primitive.label,{...e,ref:r,onMouseDown:t=>{t.target.closest("button, input, select, textarea")||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));H.displayName="Label";let B=(0,e.i(294237).cva)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),V=l.forwardRef(({className:e,...r},s)=>(0,t.jsx)(H,{ref:s,className:(0,A.cn)(B(),e),...r}));V.displayName=H.displayName;var D=e.i(346131),Z=e.i(620486),U=e.i(202311),O=(0,U.createServerReference)("40d7b530182243ca8d2ba0b039c142204c06a3829a",U.callServer,void 0,U.findSourceMapURL,"validateWorldConfig"),F=e.i(335468),W=(0,U.createServerReference)("008cc17a3a3d9269df3092b9e338d14b43dedce618",U.callServer,void 0,U.findSourceMapURL,"checkWorldsAvailability");function Q({open:e,onOpenChange:r}={}){let s,n=(0,Z.useQueryParamConfig)(),i=(0,Z.useUpdateConfigQueryParams)(),[a,o]=(0,l.useState)(!1),c=r||o,[h,u]=(0,l.useState)(n),[p,d]=(0,l.useState)([]),[g,f]=(0,l.useState)(!1),{data:k=[],isLoading:x}=(0,F.default)("worlds-availability",W,{revalidateOnFocus:!1}),m=h.backend||"local",b="local"===m,w="postgres"===m;(0,l.useEffect)(()=>{u(n)},[n]);let y=async()=>{f(!0);try{let e=await O(h);d(e),0===e.length&&(i(h),c(!1))}catch(e){console.error("Validation error:",e),d([{field:"general",message:e instanceof Error?e.message:"Unknown error"}])}finally{f(!1)}},v=(e,t)=>{u(r=>({...r,[e]:t})),d(t=>t.filter(t=>t.field!==e))},j=e=>p.find(t=>t.field===e)?.message,S=JSON.stringify(h)!==JSON.stringify(n)||p.length>0;return(0,t.jsxs)(t.Fragment,{children:[void 0===e&&(0,t.jsx)("button",{type:"button",onClick:()=>c(!0),className:"p-2 rounded-full hover:bg-accent transition-colors",title:"Configuration",children:(0,t.jsx)(T,{className:"h-6 w-6"})}),(void 0!==e?e:a)&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("button",{type:"button",className:"fixed inset-0 bg-black/50 z-40 cursor-default",onClick:()=>c(!1),"aria-label":"Close configuration panel"}),(0,t.jsx)("div",{className:"fixed top-0 right-0 h-full w-96 bg-background border-l shadow-lg z-50 overflow-y-auto",children:(0,t.jsxs)("div",{className:"p-6",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-6",children:[(0,t.jsx)("h2",{className:"text-2xl font-bold",children:"Configuration"}),(0,t.jsx)(N.Button,{type:"button",onClick:()=>c(!1),variant:"outline",size:"icon",children:(0,t.jsx)(_,{className:"h-5 w-5"})})]}),(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(V,{htmlFor:"backend",children:"Backend"}),(0,t.jsxs)(D.Select,{value:h.backend||"local",onValueChange:e=>v("backend",e),children:[(0,t.jsx)(D.SelectTrigger,{id:"backend",children:(0,t.jsx)(D.SelectValue,{placeholder:"Select backend"})}),(0,t.jsx)(D.SelectContent,{children:x?(0,t.jsx)(D.SelectItem,{value:"loading",disabled:!0,children:"Loading worlds..."}):k.length>0?k.map(e=>(0,t.jsx)(D.SelectItem,{value:e.id,children:e.displayName},e.id)):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(D.SelectItem,{value:"local",children:"Local"}),(0,t.jsx)(D.SelectItem,{value:"vercel",children:"Vercel"}),(0,t.jsx)(D.SelectItem,{value:"postgres",children:"PostgreSQL"})]})})]}),(s=k.find(e=>e.id===m))&&!s.isInstalled?(0,t.jsxs)("div",{className:"flex items-start gap-2 p-2 rounded-md bg-amber-500/10 border border-amber-500/20 text-amber-600 dark:text-amber-400",children:[(0,t.jsx)(I,{className:"h-4 w-4 mt-0.5 shrink-0"}),(0,t.jsxs)("div",{className:"text-xs",children:[(0,t.jsx)("p",{className:"font-medium",children:"Package not installed"}),(0,t.jsxs)("p",{className:"mt-1 text-muted-foreground",children:["Run:"," ",(0,t.jsx)("code",{className:"bg-muted px-1 py-0.5 rounded",children:s.installCommand})]})]})]}):null]}),b&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(V,{htmlFor:"port",children:"Port"}),(0,t.jsx)(M,{id:"port",value:h.port||"",onChange:e=>v("port",e.target.value),placeholder:"3001",className:j("port")?"border-destructive":""}),j("port")&&(0,t.jsx)("p",{className:"text-sm text-destructive break-words",children:j("port")})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(V,{htmlFor:"dataDir",children:"Data Directory"}),(0,t.jsx)(M,{id:"dataDir",value:h.dataDir||"",onChange:e=>v("dataDir",e.target.value),placeholder:".workflow-data or .next/workflow-data",className:j("dataDir")?"border-destructive":""}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Path to the workflow data directory. Can be relative or absolute."})]})]}),w&&(0,t.jsx)(t.Fragment,{children:(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(V,{htmlFor:"postgresUrl",children:"Connection URL"}),(0,t.jsx)(M,{id:"postgresUrl",value:h.postgresUrl||"",onChange:e=>v("postgresUrl",e.target.value),placeholder:"postgres://user:pass@host:5432/db",className:j("postgresUrl")?"border-destructive":""}),j("postgresUrl")&&(0,t.jsx)("p",{className:"text-sm text-destructive",children:j("postgresUrl")})]})}),!b&&!w&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(V,{htmlFor:"env",children:"Environment"}),(0,t.jsx)(M,{id:"env",value:h.env||"production",onChange:e=>v("env",e.target.value),placeholder:"production or preview"})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(V,{htmlFor:"authToken",children:"Auth Token"}),(0,t.jsx)(M,{id:"authToken",type:"password",value:h.authToken||"",onChange:e=>v("authToken",e.target.value),placeholder:"Vercel auth token"})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(V,{htmlFor:"project",children:"Project ID"}),(0,t.jsx)(M,{id:"project",value:h.project||"",onChange:e=>v("project",e.target.value),placeholder:"prj_..."})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(V,{htmlFor:"team",children:"Team ID"}),(0,t.jsx)(M,{id:"team",value:h.team||"",onChange:e=>v("team",e.target.value),placeholder:"team_..."})]})]}),p.length>0&&(0,t.jsxs)(E.Alert,{variant:"destructive",className:"!bg-destructive/10 !border-destructive",children:[(0,t.jsx)(P.AlertCircle,{className:"h-4 w-4"}),(0,t.jsx)(E.AlertTitle,{children:"Configuration Error"}),(0,t.jsx)(E.AlertDescription,{children:(0,t.jsx)("ul",{className:"list-disc list-inside space-y-1",children:p.map((e,r)=>(0,t.jsxs)("li",{className:"break-words",children:["general"!==e.field&&(0,t.jsxs)("strong",{children:[e.field,":"]})," ",e.message]},`error-${r}`))})})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-2 pt-4",children:[(0,t.jsx)(N.Button,{onClick:y,disabled:g||!S||k.some(e=>e.id===m&&!e.isInstalled),className:"w-full",children:g?"Validating...":"Apply Configuration"}),(0,t.jsx)(N.Button,{variant:"outline",onClick:()=>{u(n),d([]),c(!1)},className:"w-full",children:"Cancel"})]})]})]})})]})]})}function G({open:e,onOpenChange:r}){return(0,t.jsx)(Q,{open:e,onOpenChange:r})}function K(){let[e,r]=(0,l.useState)(!1),{theme:s,setTheme:n}=p();return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(L.DropdownMenu,{children:[(0,t.jsx)(L.DropdownMenuTrigger,{asChild:!0,children:(0,t.jsxs)(N.Button,{variant:"outline",size:"icon",children:[(0,t.jsx)(T,{className:"h-[1.2rem] w-[1.2rem]"}),(0,t.jsx)("span",{className:"sr-only",children:"Settings"})]})}),(0,t.jsxs)(L.DropdownMenuContent,{align:"end",className:"w-56",children:[(0,t.jsxs)("div",{className:"px-2 py-1.5 flex items-center gap-3",children:[(0,t.jsx)(L.DropdownMenuLabel,{className:"px-0 mb-0",children:"Theme"}),(0,t.jsx)(z,{value:s||"system",onValueChange:n,options:[{value:"system",icon:(0,t.jsx)(C,{className:"h-4 w-4"})},{value:"light",icon:(0,t.jsx)(R,{className:"h-4 w-4"})},{value:"dark",icon:(0,t.jsx)($,{className:"h-4 w-4"})}]})]}),(0,t.jsx)(L.DropdownMenuSeparator,{}),(0,t.jsxs)(L.DropdownMenuItem,{onSelect:()=>r(!0),children:[(0,t.jsx)("span",{children:"Configuration"}),(0,t.jsx)(T,{className:"ml-auto h-4 w-4"})]}),(0,t.jsx)(L.DropdownMenuItem,{asChild:!0,children:(0,t.jsxs)("a",{href:"https://useworkflow.dev/docs/getting-started",target:"_blank",rel:"noopener noreferrer",children:[(0,t.jsx)("span",{children:"Docs"}),(0,t.jsx)(S,{className:"ml-auto h-4 w-4"})]})})]})]}),(0,t.jsx)(G,{open:e,onOpenChange:r})]})}var X=e.i(806746);let J=({...e})=>{let{theme:r="system"}=p();return(0,t.jsx)(X.Toaster,{theme:r,className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground",error:"group-[.toaster]:bg-destructive group-[.toaster]:text-destructive-foreground group-[.toaster]:border-destructive",success:"group-[.toaster]:bg-green-600 group-[.toaster]:text-white group-[.toaster]:border-green-600"}},...e})};function Y({className:e}={}){return(0,t.jsxs)("svg",{viewBox:"0 0 1792 240",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e||"h-6 w-auto",role:"img","aria-label":"Workflow Logo",children:[(0,t.jsx)("title",{children:"Workflow Logo"}),(0,t.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M753.933 55.627C806.249 55.627 840.685 91.718 840.685 147.345C840.685 202.971 806.249 239.062 753.933 239.062C701.286 239.062 666.851 202.971 666.851 147.345C666.851 91.7181 701.286 55.6271 753.933 55.627ZM753.933 90.0625C726.451 90.0626 710.889 111.254 710.889 147.345C710.889 183.436 726.451 204.627 753.933 204.627C781.084 204.627 796.978 183.436 796.978 147.345C796.978 111.254 781.084 90.0625 753.933 90.0625Z",className:"fill-foreground"}),(0,t.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1445.65 55.627C1497.96 55.627 1532.4 91.718 1532.4 147.345C1532.4 202.971 1497.96 239.062 1445.65 239.062C1393 239.062 1358.56 202.971 1358.56 147.345C1358.56 91.718 1393 55.627 1445.65 55.627ZM1445.65 90.0625C1418.16 90.0625 1402.6 111.254 1402.6 147.345C1402.6 183.436 1418.16 204.627 1445.65 204.627C1472.8 204.627 1488.69 183.436 1488.69 147.345C1488.69 111.254 1472.8 90.0626 1445.65 90.0625Z",className:"fill-foreground"}),(0,t.jsx)("path",{d:"M902.473 94.0361C909.095 70.8584 922.34 59.5997 944.855 59.5996H961.079V92.3799H944.524C916.38 92.38 904.128 106.949 904.128 135.094V235.089H861.746V59.5996H901.48L902.473 94.0361Z",className:"fill-foreground"}),(0,t.jsx)("path",{d:"M1019.25 138.735L1091.11 59.5996H1143.09L1074.55 132.113L1146.4 235.089H1098.72L1046.74 157.609L1019.25 187.078V235.089H976.872V0H1019.25V138.735Z",className:"fill-foreground"}),(0,t.jsx)("path",{d:"M1263.63 32.7803H1235.82C1224.89 32.7803 1217.28 41.3893 1217.28 54.9648V59.5996H1260.98V92.3799H1217.28V235.089H1174.56V92.3799H1149.4V59.5996H1174.56V54.9648C1174.56 19.5359 1191.78 0 1230.85 0H1263.63V32.7803Z",className:"fill-foreground"}),(0,t.jsx)("path",{d:"M1322.58 189.396C1322.58 197.673 1327.22 202.309 1335.5 202.31H1348.74V235.089H1324.57C1298.08 235.089 1280.2 218.534 1280.2 191.052V0H1322.58V189.396Z",className:"fill-foreground"}),(0,t.jsx)("path",{d:"M1604.59 186.416L1641.02 59.5996H1677.77L1713.86 186.416L1749.95 59.5996H1791.34L1737.7 235.089H1694.32L1659.56 116.883L1624.79 235.089H1581.42L1527.77 59.5996H1568.83L1604.59 186.416Z",className:"fill-foreground"}),(0,t.jsx)("path",{d:"M472.173 174.847L514.895 0.671875H554.66L598.038 174.847L640.432 0.671875H685.454L623.015 234H575.692L534.942 77.5713L493.863 234H446.869L384.1 0.671875H429.122L472.173 174.847Z",className:"fill-foreground"}),(0,t.jsx)("path",{d:"M125.776 0C120.929 1.64945e-05 117 3.9291 117 8.77539V61.4248C117 66.2711 120.929 70.2002 125.776 70.2002H160.875L161.253 70.2051C169.032 70.4023 175.301 76.6734 175.495 84.4531L175.5 84.8252V143.325C175.5 148.171 179.429 152.101 184.276 152.101H219.375L219.753 152.105C227.53 152.303 233.798 158.571 233.995 166.348L234 166.726V225.225C234 230.071 237.929 234 242.776 234H295.425C300.271 234 304.2 230.071 304.2 225.225V172.575C304.2 167.729 300.271 163.8 295.425 163.8H260.25C252.334 163.76 245.905 157.43 245.705 149.553L245.7 149.176V90.6758C245.7 85.8295 241.771 81.9004 236.925 81.9004H201.825C193.874 81.9004 187.405 75.5551 187.205 67.6523L187.2 67.2754V8.77539C187.2 3.9291 183.271 1.64951e-05 178.425 0H125.776Z",className:"fill-foreground"}),(0,t.jsx)("path",{d:"M67.2755 81.9004C62.4293 81.9004 58.5002 85.8295 58.5002 90.6758V143.325C58.5004 148.171 62.4294 152.101 67.2755 152.101H102.375L102.753 152.105C110.53 152.303 116.798 158.571 116.995 166.348L117 166.726V225.225C117 230.071 120.929 234 125.776 234H178.425C183.271 234 187.2 230.071 187.2 225.225V172.575C187.2 167.729 183.271 163.8 178.425 163.8H143.25C135.334 163.76 128.905 157.43 128.705 149.553L128.7 149.176V90.6758C128.7 85.8295 124.771 81.9004 119.925 81.9004H67.2755Z",className:"fill-foreground"}),(0,t.jsx)("path",{d:"M8.77454 163.8C3.92844 163.8 0.00012207 167.729 0.00012207 172.575V225.225C0.00012207 230.071 3.92844 234 8.77454 234H61.4249C66.2712 234 70.2003 230.071 70.2003 225.225V172.575C70.2003 167.729 66.2712 163.8 61.4249 163.8H8.77454Z",className:"fill-foreground"})]})}function ee({children:e}){let i=(0,n.useRouter)(),a=(0,n.usePathname)(),o=(0,n.useSearchParams)(),c=(0,Z.useQueryParamConfig)(),{setTheme:h}=p(),u=o.get("id"),d=o.get("runId"),g=o.get("stepId"),f=o.get("hookId"),k=o.get("resource"),x=o.get("theme"),m=(0,l.useRef)(!1);return(0,l.useEffect)(()=>{x&&("light"===x||"dark"===x||"system"===x)&&h(x)},[x,h]),(0,l.useEffect)(()=>{let e;if("/"===a||!m.current){if(a.startsWith("/run/")){m.current=!0;return}if(!k){if(d){let e;e=g?(0,Z.buildUrlWithConfig)(`/run/${d}`,c,{sidebar:"step",stepId:g}):f?(0,Z.buildUrlWithConfig)(`/run/${d}`,c,{sidebar:"hook",hookId:f}):(0,Z.buildUrlWithConfig)(`/run/${d}`,c),m.current=!0,i.push(e)}return}if(u){if("run"===k)e=(0,Z.buildUrlWithConfig)(`/run/${u}`,c);else if("step"===k&&d)e=(0,Z.buildUrlWithConfig)(`/run/${d}`,c,{sidebar:"step",stepId:u});else if("stream"===k&&d)e=(0,Z.buildUrlWithConfig)(`/run/${d}`,c,{sidebar:"stream",streamId:u});else if("event"===k&&d)e=(0,Z.buildUrlWithConfig)(`/run/${d}`,c,{sidebar:"event",eventId:u});else if("hook"===k&&d)e=(0,Z.buildUrlWithConfig)(`/run/${d}`,c,{sidebar:"hook",hookId:u});else{if("hook"!==k||d)return void console.warn(`Can't deep-link to ${k} ${u}.`);e=(0,Z.buildUrlWithConfig)("/",c,{sidebar:"hook",hookId:u})}m.current=!0,i.push(e)}}},[k,u,d,g,f,i,c,a]),(0,t.jsxs)("div",{className:"min-h-screen flex flex-col",children:[(0,t.jsxs)(r.TooltipProvider,{delayDuration:0,children:[(0,t.jsx)("div",{className:"sticky top-0 z-50 bg-background border-b px-6 py-4",children:(0,t.jsxs)("div",{className:"flex items-center justify-between w-full",children:[(0,t.jsx)(s.default,{href:(0,Z.buildUrlWithConfig)("/",c),children:(0,t.jsx)("h1",{className:"flex items-center gap-2",title:"Workflow Observability",children:(0,t.jsx)(Y,{})})}),(0,t.jsxs)("div",{className:"ml-auto flex items-center gap-2",children:[(0,t.jsx)(j,{config:c}),(0,t.jsx)(K,{})]})]})}),(0,t.jsx)("div",{className:"flex-1 px-6 pt-6",children:e})]}),(0,t.jsx)(J,{})]})}function et({children:e}){return(0,t.jsx)(d,{attribute:"class",defaultTheme:"system",enableSystem:!0,disableTransitionOnChange:!0,storageKey:"workflow-theme",children:(0,t.jsx)(ee,{children:e})})}e.s(["LayoutClient",()=>et],608576)}]);