skypilot-nightly 1.0.0.dev20250523__py3-none-any.whl → 1.0.0.dev20250526__py3-none-any.whl
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.
- sky/__init__.py +2 -2
- sky/backends/backend_utils.py +62 -45
- sky/backends/cloud_vm_ray_backend.py +3 -1
- sky/check.py +335 -170
- sky/cli.py +56 -13
- sky/client/cli.py +56 -13
- sky/client/sdk.py +54 -10
- sky/clouds/gcp.py +19 -3
- sky/core.py +5 -2
- sky/dashboard/out/404.html +1 -1
- sky/dashboard/out/_next/static/7GEgRyZKRaSnYZCV1Jwol/_buildManifest.js +1 -0
- sky/dashboard/out/_next/static/chunks/25-062253ea41fb8eec.js +6 -0
- sky/dashboard/out/_next/static/chunks/480-5a0de8b6570ea105.js +1 -0
- sky/dashboard/out/_next/static/chunks/488-50d843fdb5396d32.js +15 -0
- sky/dashboard/out/_next/static/chunks/498-d7722313e5e5b4e6.js +21 -0
- sky/dashboard/out/_next/static/chunks/573-f17bd89d9f9118b3.js +66 -0
- sky/dashboard/out/_next/static/chunks/578-d351125af46c293f.js +6 -0
- sky/dashboard/out/_next/static/chunks/734-a6e01d7f98904741.js +1 -0
- sky/dashboard/out/_next/static/chunks/937.f97f83652028e944.js +1 -0
- sky/dashboard/out/_next/static/chunks/938-59956af3950b02ed.js +1 -0
- sky/dashboard/out/_next/static/chunks/9f96d65d-5a3e4af68c26849e.js +1 -0
- sky/dashboard/out/_next/static/chunks/pages/_app-96a715a6fb01e228.js +1 -0
- sky/dashboard/out/_next/static/chunks/pages/clusters/[cluster]/[job]-3b5aad09a25f64b7.js +1 -0
- sky/dashboard/out/_next/static/chunks/pages/clusters/[cluster]-9529d9e882a0e75c.js +16 -0
- sky/dashboard/out/_next/static/chunks/pages/clusters-9e6d1ec6e1ac5b29.js +1 -0
- sky/dashboard/out/_next/static/chunks/pages/infra-abb7d744ecf15109.js +1 -0
- sky/dashboard/out/_next/static/chunks/pages/jobs/[job]-48dc8d67d4b60be1.js +1 -0
- sky/dashboard/out/_next/static/chunks/pages/jobs-73d5e0c369d00346.js +16 -0
- sky/dashboard/out/_next/static/chunks/pages/users-b8acf6e6735323a2.js +1 -0
- sky/dashboard/out/_next/static/chunks/pages/workspace/new-bbf436f41381e169.js +1 -0
- sky/dashboard/out/_next/static/chunks/pages/workspaces/[name]-7733c960685b4385.js +1 -0
- sky/dashboard/out/_next/static/chunks/pages/workspaces-5ed48b3201b998c8.js +1 -0
- sky/dashboard/out/_next/static/chunks/webpack-deda68c926e8d0bc.js +1 -0
- sky/dashboard/out/_next/static/css/28558d57108b05ae.css +3 -0
- sky/dashboard/out/clusters/[cluster]/[job].html +1 -1
- sky/dashboard/out/clusters/[cluster].html +1 -1
- sky/dashboard/out/clusters.html +1 -1
- sky/dashboard/out/index.html +1 -1
- sky/dashboard/out/infra.html +1 -1
- sky/dashboard/out/jobs/[job].html +1 -1
- sky/dashboard/out/jobs.html +1 -1
- sky/dashboard/out/users.html +1 -0
- sky/dashboard/out/workspace/new.html +1 -0
- sky/dashboard/out/workspaces/[name].html +1 -0
- sky/dashboard/out/workspaces.html +1 -0
- sky/data/storage.py +1 -1
- sky/global_user_state.py +606 -543
- sky/jobs/constants.py +1 -1
- sky/jobs/server/core.py +72 -56
- sky/jobs/state.py +26 -5
- sky/jobs/utils.py +65 -13
- sky/optimizer.py +6 -3
- sky/provision/fluidstack/instance.py +1 -0
- sky/serve/server/core.py +9 -6
- sky/server/html/token_page.html +6 -1
- sky/server/requests/executor.py +1 -0
- sky/server/requests/payloads.py +28 -0
- sky/server/server.py +59 -5
- sky/setup_files/dependencies.py +1 -0
- sky/skylet/constants.py +4 -1
- sky/skypilot_config.py +107 -11
- sky/utils/cli_utils/status_utils.py +18 -8
- sky/utils/db_utils.py +53 -0
- sky/utils/kubernetes/config_map_utils.py +133 -0
- sky/utils/kubernetes/deploy_remote_cluster.py +166 -147
- sky/utils/kubernetes/kubernetes_deploy_utils.py +49 -5
- sky/utils/kubernetes/ssh-tunnel.sh +20 -28
- sky/utils/log_utils.py +4 -0
- sky/utils/schemas.py +54 -0
- sky/workspaces/__init__.py +0 -0
- sky/workspaces/core.py +295 -0
- sky/workspaces/server.py +62 -0
- {skypilot_nightly-1.0.0.dev20250523.dist-info → skypilot_nightly-1.0.0.dev20250526.dist-info}/METADATA +2 -1
- {skypilot_nightly-1.0.0.dev20250523.dist-info → skypilot_nightly-1.0.0.dev20250526.dist-info}/RECORD +79 -63
- sky/dashboard/out/_next/static/ECKwDNS9v9y3_IKFZ2lpp/_buildManifest.js +0 -1
- sky/dashboard/out/_next/static/chunks/236-1a3a9440417720eb.js +0 -6
- sky/dashboard/out/_next/static/chunks/312-c3c8845990db8ffc.js +0 -15
- sky/dashboard/out/_next/static/chunks/37-d584022b0da4ac3b.js +0 -6
- sky/dashboard/out/_next/static/chunks/393-e1eaa440481337ec.js +0 -1
- sky/dashboard/out/_next/static/chunks/480-f28cd152a98997de.js +0 -1
- sky/dashboard/out/_next/static/chunks/582-683f4f27b81996dc.js +0 -59
- sky/dashboard/out/_next/static/chunks/pages/_app-8cfab319f9fb3ae8.js +0 -1
- sky/dashboard/out/_next/static/chunks/pages/clusters/[cluster]/[job]-33bc2bec322249b1.js +0 -1
- sky/dashboard/out/_next/static/chunks/pages/clusters/[cluster]-e2fc2dd1955e6c36.js +0 -1
- sky/dashboard/out/_next/static/chunks/pages/clusters-3a748bd76e5c2984.js +0 -1
- sky/dashboard/out/_next/static/chunks/pages/infra-abf08c4384190a39.js +0 -1
- sky/dashboard/out/_next/static/chunks/pages/jobs/[job]-70756c2dad850a7e.js +0 -1
- sky/dashboard/out/_next/static/chunks/pages/jobs-ecd804b9272f4a7c.js +0 -1
- sky/dashboard/out/_next/static/chunks/webpack-830f59b8404e96b8.js +0 -1
- sky/dashboard/out/_next/static/css/7e7ce4ff31d3977b.css +0 -3
- /sky/dashboard/out/_next/static/{ECKwDNS9v9y3_IKFZ2lpp → 7GEgRyZKRaSnYZCV1Jwol}/_ssgManifest.js +0 -0
- {skypilot_nightly-1.0.0.dev20250523.dist-info → skypilot_nightly-1.0.0.dev20250526.dist-info}/WHEEL +0 -0
- {skypilot_nightly-1.0.0.dev20250523.dist-info → skypilot_nightly-1.0.0.dev20250526.dist-info}/entry_points.txt +0 -0
- {skypilot_nightly-1.0.0.dev20250523.dist-info → skypilot_nightly-1.0.0.dev20250526.dist-info}/licenses/LICENSE +0 -0
- {skypilot_nightly-1.0.0.dev20250523.dist-info → skypilot_nightly-1.0.0.dev20250526.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,6 @@
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[578],{9037:function(e,s,t){"use strict";t.d(s,{Cc:function(){return S},GV:function(){return z}});var r=t(5893),n=t(7294),l=t(1163),a=t(8799),c=t(6989),i=t(1664),o=t.n(i),d=t(803),h=t(7673),x=t(8764),u=t(3266),p=t(7324),j=t(4545),m=t(3626),f=t(998);/**
|
2
|
+
* @license lucide-react v0.407.0 - ISC
|
3
|
+
*
|
4
|
+
* This source code is licensed under the ISC license.
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
6
|
+
*/let w=(0,f.Z)("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]),k=(0,f.Z)("SquareCode",[["path",{d:"M10 9.5 8 12l2 2.5",key:"3mjy60"}],["path",{d:"m14 9.5 2 2.5-2 2.5",key:"1bir2l"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);var g=t(9470),y=t(9284),N=t(9307),v=t(3001),b=t(8950);let C="__ALL_WORKSPACES__";function S(){let e=(0,l.useRouter)(),[s,t]=(0,n.useState)(!1),i=n.useRef(null),[h,x]=(0,n.useState)(!1),[j,f]=(0,n.useState)(!1),[w,k]=(0,n.useState)(null),[N,S]=(0,n.useState)(C),[M,L]=(0,n.useState)([]),O=(0,v.X)();return(0,n.useEffect)(()=>{e.isReady&&e.query.workspace&&S(Array.isArray(e.query.workspace)?e.query.workspace[0]:e.query.workspace)},[e.isReady,e.query.workspace]),(0,n.useEffect)(()=>{(async()=>{try{let e=await (0,p.fX)(),s=Object.keys(e),t=await (0,u.zd)(),r=[...new Set(t.map(e=>e.workspace||"default").filter(e=>e))],n=new Set(s);r.includes("default")&&n.has("default"),r.forEach(e=>n.add(e)),L(Array.from(n).sort())}catch(e){console.error("Error fetching data for workspace filter:",e),L(["default"])}})()},[]),(0,r.jsxs)(g.A,{highlighted:"clusters",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between mb-4 h-5",children:[(0,r.jsxs)("div",{className:"text-base flex items-center",children:[(0,r.jsx)(o(),{href:"/clusters",className:"text-sky-blue hover:underline leading-none",children:"Sky Clusters"}),(0,r.jsxs)(b.Ph,{value:N,onValueChange:S,children:[(0,r.jsx)(b.i4,{className:"h-8 w-48 ml-4 mr-2 text-sm border-none focus:ring-0 focus:outline-none",children:(0,r.jsx)(b.ki,{placeholder:"Filter by workspace...",children:N===C?"All Workspaces":N})}),(0,r.jsxs)(b.Bw,{children:[(0,r.jsx)(b.Ql,{value:C,children:"All Workspaces"}),M.map(e=>(0,r.jsx)(b.Ql,{value:e,children:e},e))]})]})]}),(0,r.jsxs)("div",{className:"flex items-center",children:[s&&(0,r.jsxs)("div",{className:"flex items-center mr-2",children:[(0,r.jsx)(a.Z,{size:15,className:"mt-0"}),(0,r.jsx)("span",{className:"ml-2 text-gray-500",children:"Loading..."})]}),(0,r.jsxs)(d.z,{variant:"ghost",onClick:()=>{i.current&&i.current()},disabled:s,className:"text-sky-blue hover:text-sky-blue-bright flex items-center",children:[(0,r.jsx)(m.Z,{className:"h-4 w-4 mr-1.5"}),!O&&(0,r.jsx)("span",{children:"Refresh"})]})]})]}),(0,r.jsx)(_,{refreshInterval:c.yc,setLoading:t,refreshDataRef:i,workspaceFilter:N,onOpenSSHModal:e=>{k(e),x(!0)},onOpenVSCodeModal:e=>{k(e),f(!0)}}),(0,r.jsx)(y.Oh,{isOpen:h,onClose:()=>x(!1),cluster:w}),(0,r.jsx)(y._R,{isOpen:j,onClose:()=>f(!1),cluster:w})]})}function _(e){let{refreshInterval:s,setLoading:t,refreshDataRef:l,workspaceFilter:i,onOpenSSHModal:p,onOpenVSCodeModal:m}=e,[f,w]=(0,n.useState)([]),[k,g]=(0,n.useState)({key:null,direction:"ascending"}),[y,v]=(0,n.useState)(!1),[b,S]=(0,n.useState)(!0),[_,M]=(0,n.useState)(1),[L,O]=(0,n.useState)(10),R=n.useCallback(async()=>{t(!0),v(!0),w(await (0,u.zd)()),t(!1),v(!1),S(!1)},[t]),E=n.useMemo(()=>{let e=f;return i&&i!==C&&(e=f.filter(e=>(e.workspace||"default").toLowerCase()===i.toLowerCase())),(0,j.R0)(e,k.key,k.direction)},[f,k,i]);n.useEffect(()=>{l&&(l.current=R)},[l,R]),(0,n.useEffect)(()=>{w([]);let e=!0;R();let t=setInterval(()=>{e&&R()},s);return()=>{e=!1,clearInterval(t)}},[s,R]),(0,n.useEffect)(()=>{M(1)},[f.length]);let V=e=>{let s="ascending";k.key===e&&"ascending"===k.direction&&(s="descending"),g({key:e,direction:s})},A=e=>k.key===e?"ascending"===k.direction?" ↑":" ↓":"",W=Math.ceil(E.length/L),q=(_-1)*L,I=q+L,Z=E.slice(q,I);return(0,r.jsxs)("div",{children:[(0,r.jsx)(h.Zb,{children:(0,r.jsxs)(x.iA,{children:[(0,r.jsx)(x.xD,{children:(0,r.jsxs)(x.SC,{children:[(0,r.jsxs)(x.ss,{className:"sortable whitespace-nowrap",onClick:()=>V("status"),children:["Status",A("status")]}),(0,r.jsxs)(x.ss,{className:"sortable whitespace-nowrap",onClick:()=>V("cluster"),children:["Cluster",A("cluster")]}),(0,r.jsxs)(x.ss,{className:"sortable whitespace-nowrap",onClick:()=>V("user"),children:["User",A("user")]}),(0,r.jsxs)(x.ss,{className:"sortable whitespace-nowrap",onClick:()=>V("workspace"),children:["Workspace",A("workspace")]}),(0,r.jsxs)(x.ss,{className:"sortable whitespace-nowrap",onClick:()=>V("infra"),children:["Infra",A("infra")]}),(0,r.jsxs)(x.ss,{className:"sortable whitespace-nowrap",onClick:()=>V("resources_str"),children:["Resources",A("resources_str")]}),(0,r.jsxs)(x.ss,{className:"sortable whitespace-nowrap",onClick:()=>V("time"),children:["Started",A("time")]}),(0,r.jsx)(x.ss,{children:"Actions"})]})}),(0,r.jsx)(x.RM,{children:y&&b?(0,r.jsx)(x.SC,{children:(0,r.jsx)(x.pj,{colSpan:8,className:"text-center py-6 text-gray-500",children:(0,r.jsxs)("div",{className:"flex justify-center items-center",children:[(0,r.jsx)(a.Z,{size:20,className:"mr-2"}),(0,r.jsx)("span",{children:"Loading..."})]})})}):Z.length>0?Z.map((e,s)=>(0,r.jsxs)(x.SC,{children:[(0,r.jsx)(x.pj,{children:(0,r.jsx)(N.OE,{status:e.status})}),(0,r.jsx)(x.pj,{children:(0,r.jsx)(o(),{href:"/clusters/".concat(e.cluster),className:"text-blue-600",children:e.cluster})}),(0,r.jsx)(x.pj,{children:e.user}),(0,r.jsx)(x.pj,{children:(0,r.jsx)(o(),{href:"/workspaces",className:"text-blue-600 hover:underline",children:e.workspace||"default"})}),(0,r.jsx)(x.pj,{children:(0,r.jsx)(c.Md,{content:e.full_infra||e.infra,className:"text-sm text-muted-foreground",children:(0,r.jsxs)("span",{children:[(0,r.jsx)(o(),{href:"/infra",className:"text-blue-600 hover:underline",children:e.cloud}),e.infra.includes("(")&&(0,r.jsx)("span",{children:" "+e.infra.substring(e.infra.indexOf("("))})]})})}),(0,r.jsx)(x.pj,{children:(0,r.jsx)(c.Md,{content:e.resources_str_full||e.resources_str,className:"text-sm text-muted-foreground",children:(0,r.jsx)("span",{children:e.resources_str})})}),(0,r.jsx)(x.pj,{children:(0,c.GV)(e.time)}),(0,r.jsx)(x.pj,{className:"text-left",children:(0,r.jsx)(z,{cluster:e.cluster,status:e.status,onOpenSSHModal:p,onOpenVSCodeModal:m})})]},s)):(0,r.jsx)(x.SC,{children:(0,r.jsx)(x.pj,{colSpan:8,className:"text-center py-6 text-gray-500",children:"No active clusters"})})})]})}),f.length>0&&(0,r.jsx)("div",{className:"flex justify-end items-center py-2 px-4 text-sm text-gray-700",children:(0,r.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,r.jsxs)("div",{className:"flex items-center",children:[(0,r.jsx)("span",{className:"mr-2",children:"Rows per page:"}),(0,r.jsxs)("div",{className:"relative inline-block",children:[(0,r.jsxs)("select",{value:L,onChange:e=>{O(parseInt(e.target.value,10)),M(1)},className:"py-1 pl-2 pr-6 appearance-none outline-none cursor-pointer border-none bg-transparent",style:{minWidth:"40px"},children:[(0,r.jsx)("option",{value:10,children:"10"}),(0,r.jsx)("option",{value:30,children:"30"}),(0,r.jsx)("option",{value:50,children:"50"}),(0,r.jsx)("option",{value:100,children:"100"}),(0,r.jsx)("option",{value:200,children:"200"})]}),(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 text-gray-500 absolute right-0 top-1/2 transform -translate-y-1/2 pointer-events-none",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})]}),(0,r.jsxs)("div",{children:[q+1," – ",Math.min(I,f.length)," of"," ",f.length]}),(0,r.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,r.jsx)(d.z,{variant:"ghost",size:"icon",onClick:()=>{M(e=>Math.max(e-1,1))},disabled:1===_,className:"text-gray-500 h-8 w-8 p-0",children:(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"chevron-left",children:(0,r.jsx)("path",{d:"M15 18l-6-6 6-6"})})}),(0,r.jsx)(d.z,{variant:"ghost",size:"icon",onClick:()=>{M(e=>Math.min(e+1,W))},disabled:_===W||0===W,className:"text-gray-500 h-8 w-8 p-0",children:(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"chevron-right",children:(0,r.jsx)("path",{d:"M9 18l6-6-6-6"})})})]})]})})]})}let M=(e,s)=>{s&&s(e)},L=(e,s)=>{s?s(e):window.open("ssh://".concat(e))},O=e=>"RUNNING"===e?["connect","VSCode"]:[],R={connect:(0,r.jsx)(w,{className:"w-4 h-4 text-gray-500 inline-block"}),VSCode:(0,r.jsx)(k,{className:"w-4 h-4 text-gray-500 inline-block"})};function z(e){let{withLabel:s=!1,cluster:t,status:n,onOpenSSHModal:l,onOpenVSCodeModal:a}=e,i=O(n),o=(0,v.X)(),d=e=>{switch(e){case"connect":L(t,l);break;case"VSCode":M(t,a);break;default:return}};return(0,r.jsx)(r.Fragment,{children:(0,r.jsx)("div",{className:"flex items-center space-x-4",children:Object.entries(R).map(e=>{let t,n,[l,a]=e;switch(l){case"connect":t="Connect",n="Connect with SSH";break;case"VSCode":t="VSCode",n="Open in VS Code"}return(s||(t=""),i.includes(l))?(0,r.jsx)(c.WH,{content:n,className:"capitalize text-sm text-muted-foreground",children:(0,r.jsxs)("button",{onClick:()=>d(l),className:"text-sky-blue hover:text-sky-blue-bright font-medium inline-flex items-center",children:[a,!o&&(0,r.jsx)("span",{className:"ml-1.5",children:t})]})},l):(0,r.jsx)(c.WH,{content:n,className:"capitalize text-sm text-muted-foreground",children:(0,r.jsxs)("span",{className:"opacity-30 flex items-center cursor-not-allowed text-sm",title:l,children:[a,!o&&(0,r.jsx)("span",{className:"ml-1.5",children:t})]})},l)})})})}},9008:function(e,s,t){e.exports=t(7219)}}]);
|
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[734],{9307:function(e,t,r){r.d(t,{Cl:function(){return c},OE:function(){return u}});var a=r(5893);r(7294);var s=r(8799),o=r(6989),n=r(3850);let c=e=>{switch(e){case"LAUNCHING":return"bg-blue-100 text-sky-blue";case"RUNNING":return"bg-green-50 text-green-700";case"STOPPED":return"bg-yellow-100 text-yellow-800";case"TERMINATED":default:return"bg-gray-100 text-gray-800";case"PENDING":case"CANCELLED":case"CANCELLING":return"bg-yellow-50 text-yellow-700";case"SUCCEEDED":return"bg-blue-50 text-blue-700";case"FAILED":case"FAILED_PRECHECKS":case"FAILED_NO_RESOURCE":case"FAILED_CONTROLLER":return"bg-red-50 text-red-700";case"RECOVERING":return"bg-orange-50 text-orange-700";case"SUBMITTED":return"bg-indigo-50 text-indigo-700";case"STARTING":return"bg-cyan-50 text-cyan-700";case"FAILED_SETUP":return"bg-pink-50 text-pink-700"}},l=e=>{switch(e){case"LAUNCHING":case"STARTING":return(0,a.jsx)(s.Z,{size:12,className:"w-3 h-3 mr-1"});case"RUNNING":default:return(0,a.jsx)(n.W2,{className:"w-3 h-3 mr-1"});case"STOPPED":return(0,a.jsx)(n.fp,{className:"w-3 h-3 mr-1"});case"TERMINATED":case"FAILED":case"CANCELLED":return(0,a.jsx)(n.Ps,{className:"w-3 h-3 mr-1"});case"SUCCEEDED":return(0,a.jsx)(n.Ye,{className:"w-3 h-3 mr-1"});case"PENDING":case"RECOVERING":case"SUBMITTED":case"CANCELLING":case"FAILED_SETUP":case"FAILED_PRECHECKS":case"FAILED_NO_RESOURCE":case"FAILED_CONTROLLER":return(0,a.jsx)(n.J$,{className:"w-3 h-3 mr-1"})}},i=e=>{let t=c(e),r=l(e);return(0,a.jsxs)("span",{className:"".concat("inline-flex items-center px-2 py-1 rounded-full text-sm"," ").concat(t),children:[r,e]})},u=e=>{let{status:t}=e;return(0,a.jsx)(o.WH,{content:t,className:"text-muted-foreground text-sm",children:(0,a.jsx)("span",{children:i(t)})})}},9284:function(e,t,r){r.d(t,{Oh:function(){return f},_R:function(){return p},cV:function(){return m}});var a=r(5893),s=r(7294),o=r(326),n=r(803),c=r(7673),l=r(8671),i=r(6989),u=r(3225),d=r(3001);function f(e){let{isOpen:t,onClose:r,cluster:u}=e,[d,f]=s.useState(!1),p=e=>{navigator.clipboard.writeText(e),f(!0),setTimeout(()=>f(!1),2e3)},m=["sky status ".concat(u),"ssh ".concat(u)],h=m.join("\n");return(0,a.jsx)(o.Vq,{open:t,onOpenChange:r,children:(0,a.jsxs)(o.cZ,{className:"sm:max-w-md",children:[(0,a.jsxs)(o.fK,{children:[(0,a.jsxs)(o.$N,{children:["Connect to: ",(0,a.jsx)("span",{className:"font-light",children:u})]}),(0,a.jsx)(o.Be,{children:"Use these instructions to connect to your cluster via SSH."})]}),(0,a.jsxs)("div",{className:"flex flex-col space-y-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"text-sm font-medium mb-2",children:"SSH Command"}),(0,a.jsx)(c.Zb,{className:"p-3 bg-gray-50",children:(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("pre",{className:"text-sm w-full whitespace-pre-wrap",children:m.map((e,t)=>(0,a.jsx)("code",{className:"block",children:e},t))}),(0,a.jsx)(i.WH,{content:d?"Copied!":"Copy command",children:(0,a.jsx)(n.z,{variant:"ghost",size:"icon",onClick:()=>p(h),className:"h-8 w-8 rounded-full",children:(0,a.jsx)(l.Z,{className:"h-4 w-4"})})})]})})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"text-sm font-medium mb-2",children:"Additional Information"}),(0,a.jsxs)("p",{className:"text-sm text-secondary-foreground",children:["Make sure to run"," ",(0,a.jsxs)("code",{className:"text-sm",children:["sky status ",u]})," first to have SkyPilot set up the SSH access."]})]})]})]})})}function p(e){let{isOpen:t,onClose:r,cluster:s}=e,f=(0,d.X)();return(0,a.jsx)(o.Vq,{open:t,onOpenChange:r,children:(0,a.jsx)(o.cZ,{className:"sm:max-w-3xl",children:(0,a.jsxs)(o.fK,{children:[(0,a.jsxs)(o.$N,{children:["Connect to: ",(0,a.jsx)("span",{className:"font-light",children:s})]}),(0,a.jsx)(o.Be,{children:(0,a.jsxs)("div",{className:"flex flex-col space-y-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"text-sm font-medium mb-2 my-2",children:"Setup SSH access"}),(0,a.jsx)(c.Zb,{className:"p-3 bg-gray-50",children:(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("pre",{className:"text-sm",children:(0,a.jsxs)("code",{children:["sky status ",s]})}),(0,a.jsx)(i.WH,{content:"Copy command",children:(0,a.jsx)(n.z,{variant:"ghost",size:"icon",onClick:()=>navigator.clipboard.writeText("sky status ".concat(s)),className:"h-8 w-8 rounded-full",children:(0,a.jsx)(l.Z,{className:"h-4 w-4"})})})]})})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"text-sm font-medium mb-2 my-2",children:"Connect with VSCode/Cursor"}),(0,a.jsx)(c.Zb,{className:"p-3 bg-gray-50",children:(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("pre",{className:"text-sm",children:(0,a.jsxs)("code",{children:["code --remote ssh-remote+",s]})}),(0,a.jsx)(i.WH,{content:"Copy command",children:(0,a.jsx)(n.z,{variant:"ghost",size:"icon",onClick:()=>navigator.clipboard.writeText("code --remote ssh-remote+".concat(s)),className:"h-8 w-8 rounded-full",children:(0,a.jsx)(l.Z,{className:"h-4 w-4"})})})]})})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"text-sm font-medium",children:"Or use the GUI to connect"}),(0,a.jsx)("div",{className:"relative ".concat(f?"-mt-5":"-mt-10"),style:{paddingBottom:"70%"},children:(0,a.jsxs)("video",{className:"absolute top-0 left-0 w-full h-full rounded-lg",controls:!0,autoPlay:!0,muted:!0,preload:"metadata",children:[(0,a.jsx)("source",{src:"".concat(u.GW,"/videos/cursor-small.mp4"),type:"video/mp4"}),"Your browser does not support the video tag."]})})]})]})})]})})})}function m(e){let{isOpen:t,onClose:r,onConfirm:s,title:c,message:l,confirmText:i="Confirm",confirmVariant:u="destructive"}=e;return(0,a.jsx)(o.Vq,{open:t,onOpenChange:r,children:(0,a.jsxs)(o.cZ,{className:"sm:max-w-md",children:[(0,a.jsxs)(o.fK,{children:[(0,a.jsx)(o.$N,{children:c}),(0,a.jsx)(o.Be,{children:l})]}),(0,a.jsxs)(o.cN,{className:"flex justify-end gap-2 pt-4",children:[(0,a.jsx)(n.z,{variant:"outline",onClick:r,children:"Cancel"}),(0,a.jsx)(n.z,{variant:u,onClick:()=>{s(),r()},children:i})]})]})})}},803:function(e,t,r){r.d(t,{z:function(){return i}});var a=r(5893),s=r(7294),o=r(8426),n=r(2003),c=r(2350);let l=(0,n.j)("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),i=s.forwardRef((e,t)=>{let{className:r,variant:s,size:n,asChild:i=!1,...u}=e,d=i?o.g7:"button";return(0,a.jsx)(d,{className:(0,c.cn)(l({variant:s,size:n,className:r})),ref:t,...u})});i.displayName="Button"},7673:function(e,t,r){r.d(t,{Ol:function(){return i},Zb:function(){return l},aY:function(){return f},eW:function(){return p},ll:function(){return u}});var a=r(5893),s=r(7294),o=r(5697),n=r.n(o),c=r(2350);let l=s.forwardRef((e,t)=>{let{className:r,children:s,...o}=e;return(0,a.jsx)("div",{ref:t,className:(0,c.cn)("rounded-lg border bg-card text-card-foreground shadow-sm",r),...o,children:s})});l.displayName="Card",l.propTypes={className:n().string,children:n().node};let i=s.forwardRef((e,t)=>{let{className:r,children:s,...o}=e;return(0,a.jsx)("div",{ref:t,className:(0,c.cn)("flex flex-col space-y-1.5 p-6",r),...o,children:s})});i.displayName="CardHeader",i.propTypes={className:n().string,children:n().node};let u=s.forwardRef((e,t)=>{let{className:r,children:s,...o}=e;return(0,a.jsx)("h3",{ref:t,className:(0,c.cn)("text-2xl font-semibold leading-none tracking-tight",r),...o,children:s})});u.displayName="CardTitle",u.propTypes={className:n().string,children:n().node};let d=s.forwardRef((e,t)=>{let{className:r,children:s,...o}=e;return(0,a.jsx)("p",{ref:t,className:(0,c.cn)("text-sm text-muted-foreground",r),...o,children:s})});d.displayName="CardDescription",d.propTypes={className:n().string,children:n().node};let f=s.forwardRef((e,t)=>{let{className:r,children:s,...o}=e;return(0,a.jsx)("div",{ref:t,className:(0,c.cn)("p-6 pt-0",r),...o,children:s})});f.displayName="CardContent",f.propTypes={className:n().string,children:n().node};let p=s.forwardRef((e,t)=>{let{className:r,children:s,...o}=e;return(0,a.jsx)("div",{ref:t,className:(0,c.cn)("flex items-center p-6 pt-0",r),...o,children:s})});p.displayName="CardFooter",p.propTypes={className:n().string,children:n().node}},326:function(e,t,r){r.d(t,{$N:function(){return m},Be:function(){return h},Vq:function(){return l},cN:function(){return p},cZ:function(){return d},fK:function(){return f}});var a=r(5893),s=r(7294),o=r(6327),n=r(2350),c=r(3767);let l=o.fC;o.xz;let i=o.h_;o.x8;let u=s.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,a.jsx)(o.aV,{ref:t,className:(0,n.cn)("fixed inset-0 z-50 bg-black/50 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",r),...s})});u.displayName=o.aV.displayName;let d=s.forwardRef((e,t)=>{let{className:r,children:s,...l}=e;return(0,a.jsxs)(i,{children:[(0,a.jsx)(u,{}),(0,a.jsxs)(o.VY,{ref:t,className:(0,n.cn)("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border border-gray-200 bg-white p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",r),...l,children:[s,(0,a.jsxs)(o.x8,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-white transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-gray-400 focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-gray-100 data-[state=open]:text-gray-500",children:[(0,a.jsx)(c.Z,{className:"h-4 w-4"}),(0,a.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})});d.displayName=o.VY.displayName;let f=e=>{let{className:t,...r}=e;return(0,a.jsx)("div",{className:(0,n.cn)("flex flex-col space-y-1.5 text-center sm:text-left",t),...r})};f.displayName="DialogHeader";let p=e=>{let{className:t,...r}=e;return(0,a.jsx)("div",{className:(0,n.cn)("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...r})};p.displayName="DialogFooter";let m=s.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,a.jsx)(o.Dx,{ref:t,className:(0,n.cn)("text-lg font-semibold leading-none tracking-tight",r),...s})});m.displayName=o.Dx.displayName;let h=s.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,a.jsx)(o.dk,{ref:t,className:(0,n.cn)("text-sm text-gray-500",r),...s})});h.displayName=o.dk.displayName},8764:function(e,t,r){r.d(t,{RM:function(){return l},SC:function(){return i},iA:function(){return n},pj:function(){return d},ss:function(){return u},xD:function(){return c}});var a=r(5893),s=r(7294),o=r(2350);let n=s.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,a.jsx)("div",{className:"relative w-full overflow-auto",children:(0,a.jsx)("table",{ref:t,className:(0,o.cn)("w-full caption-bottom text-base",r),...s})})});n.displayName="Table";let c=s.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,a.jsx)("thead",{ref:t,className:(0,o.cn)("[&_tr]:border-b",r),...s})});c.displayName="TableHeader";let l=s.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,a.jsx)("tbody",{ref:t,className:(0,o.cn)("[&_tr:last-child]:border-0",r),...s})});l.displayName="TableBody",s.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,a.jsx)("tfoot",{ref:t,className:(0,o.cn)("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",r),...s})}).displayName="TableFooter";let i=s.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,a.jsx)("tr",{ref:t,className:(0,o.cn)("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",r),...s})});i.displayName="TableRow";let u=s.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,a.jsx)("th",{ref:t,className:(0,o.cn)("h-12 px-4 text-left align-middle font-medium text-[hsl(var(--text-strong))] [&:has([role=checkbox])]:pr-0",r),...s})});u.displayName="TableHead";let d=s.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,a.jsx)("td",{ref:t,className:(0,o.cn)("p-4 align-middle [&:has([role=checkbox])]:pr-0",r),...s})});d.displayName="TableCell",s.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,a.jsx)("caption",{ref:t,className:(0,o.cn)("mt-4 text-base text-muted-foreground",r),...s})}).displayName="TableCaption"},3266:function(e,t,r){r.d(t,{QL:function(){return u},Sl:function(){return l},zd:function(){return c}});var a=r(7294),s=r(5821),o=r(3225);let n={UP:"RUNNING",STOPPED:"STOPPED",INIT:"LAUNCHING",null:"TERMINATED"};async function c(){let{clusterNames:e=null}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{let t=await fetch("".concat(o.f4,"/status"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cluster_names:e,all_users:!0})}),r=t.headers.get("X-Skypilot-Request-ID")||t.headers.get("X-Request-ID"),a=await fetch("".concat(o.f4,"/api/get?request_id=").concat(r)),s=await a.json();return(s.return_value?JSON.parse(s.return_value):[]).map(e=>{let t="",r=t=e.zone?e.zone:e.region;return t&&t.length>25&&(t=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:15;if(!e||e.length<=t)return e;if(t<=3)return"...";let r=Math.floor((t-3)/2),a=r+(t-3)%2;return 0===r?e.substring(0,a)+"...":e.substring(0,a)+"..."+e.substring(e.length-r)}(t,25)),{status:n[e.status],cluster:e.name,user:e.user_name,user_hash:e.user_hash,cloud:e.cloud,infra:t?e.cloud+" ("+t+")":e.cloud,full_infra:r?"".concat(e.cloud," (").concat(r,")"):e.cloud,cpus:e.cpus,mem:e.memory,gpus:e.accelerators,resources_str:e.resources_str,resources_str_full:e.resources_str_full,time:new Date(1e3*e.launched_at),num_nodes:e.nodes,workspace:e.workspace,jobs:[],events:[{time:new Date(1e3*e.launched_at),event:"Cluster created."}]}})}catch(e){return console.error("Error fetching clusters:",e),[]}}async function l(e){let{clusterName:t,jobId:r,onNewLog:a,workspace:n}=e;try{let e=(await fetch("".concat(o.f4,"/logs"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({follow:!1,cluster_name:t,job_id:r,override_skypilot_config:{active_workspace:n||"default"}})})).body.getReader();for(;;){let{done:t,value:r}=await e.read();if(t)break;let s=new TextDecoder().decode(r);a(s)}}catch(e){console.error("Error in streamClusterJobLogs:",e),(0,s.C)("Error in streamClusterJobLogs: ".concat(e.message),"error")}}async function i(e){let{clusterName:t,workspace:r}=e;try{let e=await fetch("".concat(o.f4,"/queue"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cluster_name:t,all_users:!0,override_skypilot_config:{active_workspace:r}})}),a=e.headers.get("X-Skypilot-Request-ID")||e.headers.get("X-Request-ID"),s=await fetch("".concat(o.f4,"/api/get?request_id=").concat(a)),n=await s.json();return JSON.parse(n.return_value).map(e=>{let r=e.end_at?e.end_at:Date.now()/1e3,a=0,s=0;return e.submitted_at&&(a=r-e.submitted_at),e.start_at&&(s=r-e.start_at),{id:e.job_id,status:e.status,job:e.job_name,user:e.username,gpus:e.accelerators||{},submitted_at:e.submitted_at?new Date(1e3*e.submitted_at):null,resources:e.resources,cluster:t,total_duration:a,job_duration:s,infra:"",logs:""}})}catch(e){return console.error("Error fetching cluster jobs:",e),[]}}function u(e){let{cluster:t,job:r=null}=e,[s,o]=(0,a.useState)(null),[n,l]=(0,a.useState)(null),[u,d]=(0,a.useState)(!0),[f,p]=(0,a.useState)(!0),m=(0,a.useCallback)(async()=>{if(t)try{d(!0);let e=await c({clusterNames:[t]});return o(e[0]),e[0]}catch(e){console.error("Error fetching cluster data:",e)}finally{d(!1)}return null},[t]),h=(0,a.useCallback)(async e=>{if(t)try{p(!0);let r=await i({clusterName:t,workspace:e||"default"});l(r)}catch(e){console.error("Error fetching cluster job data:",e)}finally{p(!1)}},[t]),g=(0,a.useCallback)(async()=>{let e=await m();e&&await h(e.workspace)},[m,h]);return(0,a.useEffect)(()=>{(async()=>{let e=await m();e&&await h(e.workspace)})()},[t,r,m,h]),{clusterData:s,clusterJobData:n,loading:u||f,refreshData:g}}},7324:function(e,t,r){r.d(t,{MB:function(){return l},eA:function(){return c},fX:function(){return s},yz:function(){return o},zl:function(){return i}});var a=r(3225);async function s(){try{let e=await fetch("".concat(a.f4,"/workspaces"));if(!e.ok)throw Error("Error scheduling getWorkspaces: ".concat(e.statusText," (status ").concat(e.status,")"));let t=e.headers.get("X-Skypilot-Request-ID");if(!t){console.warn("X-Skypilot-Request-ID header not found in /workspaces response. Attempting to find request_id in response body as a fallback.");try{let r=await e.json();if(r&&r.request_id)t=r.request_id,console.log("Found request_id in /workspaces response body (fallback):",t);else throw Error("X-Skypilot-Request-ID header not found AND request_id not found in parsed response body from /workspaces.")}catch(t){let e=t.message||"Error processing fallback for request_id from /workspaces response body.";throw console.error("Error in /workspaces request_id fallback logic:",e),Error("X-Skypilot-Request-ID header not found, and fallback to read request_id from body failed: ".concat(e))}}if(!t)throw Error("Failed to obtain X-Skypilot-Request-ID from /workspaces response (checked header and attempted body fallback, but ID is still missing).");console.log("Fetching workspace data with request_id: ".concat(t));let r=await fetch("".concat(a.f4,"/api/get?request_id=").concat(t));if(!r.ok){let e="Error fetching workspace data for request ID ".concat(t,": ").concat(r.statusText," (status ").concat(r.status,")");try{let a=await r.json();if(a&&a.detail){let r=a.detail;try{let e=JSON.parse(r);e&&e.error?r=e.error:e&&e.result&&e.result.error&&(r=e.result.error)}catch(e){}e="Error fetching workspace data for request ID ".concat(t,": ").concat(r)}}catch(e){}throw Error(e)}let s=await r.json();if(console.log("[Connector Debug] Full resultData from /api/get:",s),"FAILED"===s.status){let e="Unknown error during task execution";if(s.error)"string"==typeof s.error?e=s.error:"object"==typeof s.error&&(e=s.error.message||s.error.detail||JSON.stringify(s.error));else if(s.result&&s.result.error)"string"==typeof s.result.error?e=s.result.error:"object"==typeof s.result.error&&(e=s.result.error.message||s.result.error.detail||JSON.stringify(s.result.error));else if(s.return_value)try{let t=JSON.parse(s.return_value);t.error&&(e="string"==typeof t.error?t.error:t.error.message||t.error.detail||JSON.stringify(t.error))}catch(t){(s.return_value.includes("Error")||s.return_value.includes("Cannot"))&&(e=s.return_value)}throw Error(e)}let o={};if("SUCCEEDED"===s.status&&s.return_value)try{o=JSON.parse(s.return_value),console.log("Successfully parsed workspace data from return_value:",o)}catch(e){throw console.error("Failed to parse workspace data from return_value:",e,"Raw return_value:",s.return_value),Error("Failed to parse workspace data for request ID ".concat(t,": ").concat(e.message))}else s.result&&(console.warn("Using resultData.result as fallback for status ".concat(s.status)),o=s.result);return console.log("Effectively fetched workspace data (to be returned):",o),o||{}}catch(e){throw console.error("Failed to fetch workspaces (in getWorkspaces function):",e.message,e.stack),e}}async function o(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;try{let t="".concat(a.f4,"/enabled_clouds");e&&(t+="?workspace=".concat(encodeURIComponent(e)));let r=await fetch(t,{method:"GET",headers:{"Content-Type":"application/json"}});if(!r.ok)throw Error("Error scheduling getEnabledClouds: ".concat(r.statusText," (status ").concat(r.status,")"));let s=r.headers.get("X-Skypilot-Request-ID");if(!s){console.warn("X-Skypilot-Request-ID header not found in /enabled_clouds response. Attempting to find request_id in response body as a fallback.");try{let e=await r.json();if(e&&e.request_id)s=e.request_id,console.log("Found request_id in /enabled_clouds response body (fallback):",s);else throw Error("X-Skypilot-Request-ID header not found AND request_id not found in parsed response body from /enabled_clouds.")}catch(t){let e=t.message||"Error processing fallback for request_id from /enabled_clouds response body.";throw console.error("Error in /enabled_clouds request_id fallback logic:",e),Error("X-Skypilot-Request-ID header not found, and fallback to read request_id from body failed: ".concat(e))}}if(!s)throw Error("Failed to obtain X-Skypilot-Request-ID from /enabled_clouds response (checked header and attempted body fallback, but ID is still missing).");console.log("Fetching enabled_clouds data with request_id: ".concat(s));let o=await fetch("".concat(a.f4,"/api/get?request_id=").concat(s));if(!o.ok){let e="Error fetching enabled_clouds data for request ID ".concat(s,": ").concat(o.statusText," (status ").concat(o.status,")");try{let t=await o.json();if(t&&t.detail){let r=t.detail;try{let e=JSON.parse(r);e&&e.error?r=e.error:e&&e.result&&e.result.error&&(r=e.result.error)}catch(e){}e="Error fetching enabled_clouds data for request ID ".concat(s,": ").concat(r)}}catch(e){}throw Error(e)}let n=await o.json();if(console.log("[Connector Debug] Full resultData from /api/get for enabled_clouds:",n),"FAILED"===n.status){let e=n.error||n.result&&n.result.error||"Unknown error during task execution for enabled_clouds";throw Error("Fetching enabled_clouds data failed for request ID ".concat(s,": ").concat(e))}let c=[];if("SUCCEEDED"===n.status&&n.return_value)try{c=JSON.parse(n.return_value),console.log("Successfully parsed enabled_clouds data from return_value:",c)}catch(e){throw console.error("Failed to parse enabled_clouds data from return_value:",e,"Raw return_value:",n.return_value),Error("Failed to parse enabled_clouds data for request ID ".concat(s,": ").concat(e.message))}else n.result&&(console.warn("Using resultData.result as fallback for enabled_clouds status ".concat(n.status)),c=n.result);return Array.isArray(c)?c:[]}catch(e){throw console.error("Failed to fetch enabled_clouds (in getEnabledClouds function):",e.message,e.stack),e}}async function n(e,t){console.log("Polling for ".concat(t," task completion with request_id: ").concat(e));let r=await fetch("".concat(a.f4,"/api/get?request_id=").concat(e));if(!r.ok){let a="Error fetching ".concat(t," data for request ID ").concat(e,": ").concat(r.statusText," (status ").concat(r.status,")");try{let e=await r.json();if(console.error("[Error Debug] ".concat(t," HTTP error response:"),JSON.stringify(e,null,2)),e&&e.detail){if("object"==typeof e.detail&&e.detail.error)try{let r=JSON.parse(e.detail.error);if(r&&r.message)a="".concat(t," failed: ").concat(r.message);else if(r&&"object"==typeof r){let e=r.type||JSON.stringify(r);a="".concat(t," failed: ").concat(e)}}catch(r){a="".concat(t," failed: ").concat(e.detail.error)}else if("string"==typeof e.detail)a="".concat(t," failed: ").concat(e.detail);else{let r=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if("string"==typeof e&&(e.includes("Cannot")||e.includes("Error")||e.includes("Failed")))return e;if("object"==typeof e&&null!==e)for(let[a,s]of Object.entries(e)){let e=r(s,t?"".concat(t,".").concat(a):a);if(e)return e}return null},s=r(e.detail);s&&(a="".concat(t," failed: ").concat(s))}}}catch(e){console.error("[Error Debug] Failed to parse error response:",e)}throw Error(a)}let s=await r.json();if(console.log("[Connector Debug] ".concat(t," resultData:"),s),"FAILED"===s.status){console.error("[Error Debug] ".concat(t," failed. Full resultData:"),JSON.stringify(s,null,2)),console.error("[Error Debug] resultData.error:",s.error),console.error("[Error Debug] resultData.result:",s.result),console.error("[Error Debug] resultData.return_value:",s.return_value);let e="Unknown error during ".concat(t," task execution");if(s.error)"string"==typeof s.error?e=s.error:"object"==typeof s.error&&(e=s.error.message||s.error.detail||JSON.stringify(s.error));else if(s.result&&s.result.error)"string"==typeof s.result.error?e=s.result.error:"object"==typeof s.result.error&&(e=s.result.error.message||s.result.error.detail||JSON.stringify(s.result.error));else if(s.return_value)try{let t=JSON.parse(s.return_value);t.error&&(e="string"==typeof t.error?t.error:t.error.message||t.error.detail||JSON.stringify(t.error))}catch(t){s.return_value&&(s.return_value.includes("Error")||s.return_value.includes("Cannot"))&&(e=s.return_value)}if(e==="Unknown error during ".concat(t," task execution")){let t=function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if("string"==typeof e&&(e.includes("Cannot")||e.includes("Error")||e.includes("Failed")))return e;if("object"==typeof e&&null!==e)for(let[a,s]of Object.entries(e)){let e=t(s,r?"".concat(r,".").concat(a):a);if(e)return e}return null},r=t(s);r&&(e=r)}throw Error(e)}let o={};if("SUCCEEDED"===s.status&&s.return_value)try{o=JSON.parse(s.return_value),console.log("Successfully parsed ".concat(t," data:"),o)}catch(r){throw console.error("Failed to parse ".concat(t," data from return_value:"),r,"Raw return_value:",s.return_value),Error("Failed to parse ".concat(t," data for request ID ").concat(e,": ").concat(r.message))}else s.result&&(console.warn("Using resultData.result as fallback for ".concat(t," status ").concat(s.status)),o=s.result);return o}async function c(e,t){try{console.log("Updating workspace ".concat(e," with config:"),t);let r=await fetch("".concat(a.f4,"/workspaces/update"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({workspace_name:e,config:t})});if(!r.ok)throw Error("Error scheduling updateWorkspace: ".concat(r.statusText," (status ").concat(r.status,")"));let s=r.headers.get("X-Skypilot-Request-ID");if(!s)throw Error("Failed to obtain request ID for updateWorkspace");return await n(s,"updateWorkspace")}catch(e){throw console.error("Failed to update workspace:",e),e}}let l=async(e,t)=>{try{let r=await fetch("".concat(a.f4,"/workspaces/create"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({workspace_name:e,config:t})});if(!r.ok)throw await r.text(),Error("Error scheduling createWorkspace: ".concat(r.statusText," (status ").concat(r.status,")"));let s=r.headers.get("X-Skypilot-Request-ID");if(!s)throw Error("Failed to obtain request ID for createWorkspace");return await n(s,"createWorkspace")}catch(e){throw console.error("Failed to create workspace:",e),e}};async function i(e){try{console.log("Deleting workspace ".concat(e));let t=await fetch("".concat(a.f4,"/workspaces/delete"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({workspace_name:e})});if(!t.ok)throw Error("Error scheduling deleteWorkspace: ".concat(t.statusText," (status ").concat(t.status,")"));let r=t.headers.get("X-Skypilot-Request-ID");if(!r)throw Error("Failed to obtain request ID for deleteWorkspace");console.log("[Delete Debug] Got request ID for deleteWorkspace: ".concat(r));try{let e=await n(r,"deleteWorkspace");return console.log("[Delete Debug] deleteWorkspace completed successfully:",e),e}catch(e){throw console.error("[Delete Debug] deleteWorkspace failed with error:",e),console.error("[Delete Debug] Error message:",e.message),e}}catch(e){throw console.error("Failed to delete workspace:",e),e}}},4545:function(e,t,r){function a(e){return e.startsWith("sky-jobs-controller-")}function s(e,t,r){return null===t?e:[...e].sort((e,a)=>e[t]<a[t]?"ascending"===r?-1:1:e[t]>a[t]?"ascending"===r?1:-1:0)}r.d(t,{R0:function(){return s},Ym:function(){return a}})}}]);
|
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[937],{3937:function(t,e,i){let n;i.r(e),i.d(e,{default:function(){return i1}});var s=i(2445),r=i(9432);function a(t,e,i){let n=t.getProps();return(0,r.o)(n,e,void 0!==i?i:n.custom,t)}function o(t,e){return t?.[e]??t?.default??t}let l=t=>t,{schedule:u,cancel:h,state:d,steps:p}=(0,i(3674).Z)("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:l,!0);var c=i(9354);let m=new Set(["width","height","top","left","right","bottom",...c._]);class f{constructor(){this.subscriptions=[]}add(t){var e;return -1===(e=this.subscriptions).indexOf(t)&&e.push(t),()=>(function(t,e){let i=t.indexOf(e);i>-1&&t.splice(i,1)})(this.subscriptions,t)}notify(t,e,i){let n=this.subscriptions.length;if(n){if(1===n)this.subscriptions[0](t,e,i);else for(let s=0;s<n;s++){let n=this.subscriptions[s];n&&n(t,e,i)}}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}var v=i(2218);function y(){n=void 0}let g={now:()=>(void 0===n&&g.set(d.isProcessing||v.c.useManualTiming?d.timestamp:performance.now()),n),set:t=>{n=t,queueMicrotask(y)}},b=t=>!isNaN(parseFloat(t)),w={current:void 0};class T{constructor(t,e={}){this.version="__VERSION__",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(t,e=!0)=>{let i=g.now();if(this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(let t of this.dependents)t.dirty();e&&this.events.renderRequest?.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){this.current=t,this.updatedAt=g.now(),null===this.canTrackVelocity&&void 0!==t&&(this.canTrackVelocity=b(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new f);let i=this.events[t].add(e);return"change"===t?()=>{i(),u.read(()=>{this.events.change.getSize()||this.stop()})}:i}clearListeners(){for(let t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t,e=!0){e&&this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t,e)}setWithVelocity(t,e,i){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-i}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return w.current&&w.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){var t;let e=g.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||e-this.updatedAt>30)return 0;let i=Math.min(this.updatedAt-this.prevUpdatedAt,30);return t=parseFloat(this.current)-parseFloat(this.prevFrameValue),i?1e3/i*t:0}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function S(t,e){return new T(t,e)}let A=t=>Array.isArray(t);var M=i(406),V=i(8588);let x=(t,e)=>i=>e(t(i)),C=(...t)=>t.reduce(x);var k=i(488);let E=t=>1e3*t,F=t=>t/1e3,P={mainThread:0,waapi:0},O=()=>{},D=()=>{};var I=i(1219),N=i(7958);let R=t=>Math.round(1e5*t)/1e5,L=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu,B=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,$=(t,e)=>i=>!!("string"==typeof i&&B.test(i)&&i.startsWith(t)||e&&null!=i&&Object.prototype.hasOwnProperty.call(i,e)),j=(t,e,i)=>n=>{if("string"!=typeof n)return n;let[s,r,a,o]=n.match(L);return{[t]:parseFloat(s),[e]:parseFloat(r),[i]:parseFloat(a),alpha:void 0!==o?parseFloat(o):1}},K=t=>(0,k.u)(0,255,t),q={...N.Rx,transform:t=>Math.round(K(t))},_={test:$("rgb","red"),parse:j("red","green","blue"),transform:({red:t,green:e,blue:i,alpha:n=1})=>"rgba("+q.transform(t)+", "+q.transform(e)+", "+q.transform(i)+", "+R(N.Fq.transform(n))+")"},U={test:$("#"),parse:function(t){let e="",i="",n="",s="";return t.length>5?(e=t.substring(1,3),i=t.substring(3,5),n=t.substring(5,7),s=t.substring(7,9)):(e=t.substring(1,2),i=t.substring(2,3),n=t.substring(3,4),s=t.substring(4,5),e+=e,i+=i,n+=n,s+=s),{red:parseInt(e,16),green:parseInt(i,16),blue:parseInt(n,16),alpha:s?parseInt(s,16)/255:1}},transform:_.transform};var W=i(7259);let Y={test:$("hsl","hue"),parse:j("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:i,alpha:n=1})=>"hsla("+Math.round(t)+", "+W.aQ.transform(R(e))+", "+W.aQ.transform(R(i))+", "+R(N.Fq.transform(n))+")"},z={test:t=>_.test(t)||U.test(t)||Y.test(t),parse:t=>_.test(t)?_.parse(t):Y.test(t)?Y.parse(t):U.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?_.transform(t):Y.transform(t)},G=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,H="number",X="color",Z=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Q(t){let e=t.toString(),i=[],n={color:[],number:[],var:[]},s=[],r=0,a=e.replace(Z,t=>(z.test(t)?(n.color.push(r),s.push(X),i.push(z.parse(t))):t.startsWith("var(")?(n.var.push(r),s.push("var"),i.push(t)):(n.number.push(r),s.push(H),i.push(parseFloat(t))),++r,"${}")).split("${}");return{values:i,split:a,indexes:n,types:s}}function J(t){return Q(t).values}function tt(t){let{split:e,types:i}=Q(t),n=e.length;return t=>{let s="";for(let r=0;r<n;r++)if(s+=e[r],void 0!==t[r]){let e=i[r];e===H?s+=R(t[r]):e===X?s+=z.transform(t[r]):s+=t[r]}return s}}let te=t=>"number"==typeof t?0:t,ti={test:function(t){return isNaN(t)&&"string"==typeof t&&(t.match(L)?.length||0)+(t.match(G)?.length||0)>0},parse:J,createTransformer:tt,getAnimatableNone:function(t){let e=J(t);return tt(t)(e.map(te))}};function tn(t,e,i){return(i<0&&(i+=1),i>1&&(i-=1),i<1/6)?t+(e-t)*6*i:i<.5?e:i<2/3?t+(e-t)*(2/3-i)*6:t}function ts(t,e){return i=>i>0?e:t}let tr=(t,e,i)=>t+(e-t)*i,ta=(t,e,i)=>{let n=t*t,s=i*(e*e-n)+n;return s<0?0:Math.sqrt(s)},to=[U,_,Y],tl=t=>to.find(e=>e.test(t));function tu(t){let e=tl(t);if(O(!!e,`'${t}' is not an animatable color. Use the equivalent color code instead.`),!e)return!1;let i=e.parse(t);return e===Y&&(i=function({hue:t,saturation:e,lightness:i,alpha:n}){t/=360,i/=100;let s=0,r=0,a=0;if(e/=100){let n=i<.5?i*(1+e):i+e-i*e,o=2*i-n;s=tn(o,n,t+1/3),r=tn(o,n,t),a=tn(o,n,t-1/3)}else s=r=a=i;return{red:Math.round(255*s),green:Math.round(255*r),blue:Math.round(255*a),alpha:n}}(i)),i}let th=(t,e)=>{let i=tu(t),n=tu(e);if(!i||!n)return ts(t,e);let s={...i};return t=>(s.red=ta(i.red,n.red,t),s.green=ta(i.green,n.green,t),s.blue=ta(i.blue,n.blue,t),s.alpha=tr(i.alpha,n.alpha,t),_.transform(s))},td=new Set(["none","hidden"]);function tp(t,e){return i=>tr(t,e,i)}function tc(t){return"number"==typeof t?tp:"string"==typeof t?(0,I.t)(t)?ts:z.test(t)?th:tv:Array.isArray(t)?tm:"object"==typeof t?z.test(t)?th:tf:ts}function tm(t,e){let i=[...t],n=i.length,s=t.map((t,i)=>tc(t)(t,e[i]));return t=>{for(let e=0;e<n;e++)i[e]=s[e](t);return i}}function tf(t,e){let i={...t,...e},n={};for(let s in i)void 0!==t[s]&&void 0!==e[s]&&(n[s]=tc(t[s])(t[s],e[s]));return t=>{for(let e in n)i[e]=n[e](t);return i}}let tv=(t,e)=>{let i=ti.createTransformer(e),n=Q(t),s=Q(e);return n.indexes.var.length===s.indexes.var.length&&n.indexes.color.length===s.indexes.color.length&&n.indexes.number.length>=s.indexes.number.length?td.has(t)&&!s.values.length||td.has(e)&&!n.values.length?td.has(t)?i=>i<=0?t:e:i=>i>=1?e:t:C(tm(function(t,e){let i=[],n={color:0,var:0,number:0};for(let s=0;s<e.values.length;s++){let r=e.types[s],a=t.indexes[r][n[r]],o=t.values[a]??0;i[s]=o,n[r]++}return i}(n,s),s.values),i):(O(!0,`Complex values '${t}' and '${e}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`),ts(t,e))};function ty(t,e,i){return"number"==typeof t&&"number"==typeof e&&"number"==typeof i?tr(t,e,i):tc(t)(t,e)}let tg=t=>{let e=({timestamp:e})=>t(e);return{start:(t=!0)=>u.update(e,t),stop:()=>h(e),now:()=>d.isProcessing?d.timestamp:g.now()}},tb=(t,e,i=10)=>{let n="",s=Math.max(Math.round(e/i),2);for(let e=0;e<s;e++)n+=t(e/(s-1))+", ";return`linear(${n.substring(0,n.length-2)})`};function tw(t){let e=0,i=t.next(e);for(;!i.done&&e<2e4;)e+=50,i=t.next(e);return e>=2e4?1/0:e}function tT(t,e,i){var n,s;let r=Math.max(e-5,0);return n=i-t(r),(s=e-r)?1e3/s*n:0}let tS={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function tA(t,e){return t*Math.sqrt(1-e*e)}let tM=["duration","bounce"],tV=["stiffness","damping","mass"];function tx(t,e){return e.some(e=>void 0!==t[e])}function tC(t=tS.visualDuration,e=tS.bounce){let i;let n="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:e}:t,{restSpeed:s,restDelta:r}=n,a=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],l={done:!1,value:a},{stiffness:u,damping:h,mass:d,duration:p,velocity:c,isResolvedFromDuration:m}=function(t){let e={velocity:tS.velocity,stiffness:tS.stiffness,damping:tS.damping,mass:tS.mass,isResolvedFromDuration:!1,...t};if(!tx(t,tV)&&tx(t,tM)){if(t.visualDuration){let i=2*Math.PI/(1.2*t.visualDuration),n=i*i,s=2*(0,k.u)(.05,1,1-(t.bounce||0))*Math.sqrt(n);e={...e,mass:tS.mass,stiffness:n,damping:s}}else{let i=function({duration:t=tS.duration,bounce:e=tS.bounce,velocity:i=tS.velocity,mass:n=tS.mass}){let s,r;O(t<=E(tS.maxDuration),"Spring duration must be 10 seconds or less");let a=1-e;a=(0,k.u)(tS.minDamping,tS.maxDamping,a),t=(0,k.u)(tS.minDuration,tS.maxDuration,F(t)),a<1?(s=e=>{let n=e*a,s=n*t;return .001-(n-i)/tA(e,a)*Math.exp(-s)},r=e=>{let n=e*a*t,r=Math.pow(a,2)*Math.pow(e,2)*t,o=tA(Math.pow(e,2),a);return(n*i+i-r)*Math.exp(-n)*(-s(e)+.001>0?-1:1)/o}):(s=e=>-.001+Math.exp(-e*t)*((e-i)*t+1),r=e=>t*t*(i-e)*Math.exp(-e*t));let o=function(t,e,i){let n=i;for(let i=1;i<12;i++)n-=t(n)/e(n);return n}(s,r,5/t);if(t=E(t),isNaN(o))return{stiffness:tS.stiffness,damping:tS.damping,duration:t};{let e=Math.pow(o,2)*n;return{stiffness:e,damping:2*a*Math.sqrt(n*e),duration:t}}}(t);(e={...e,...i,mass:tS.mass}).isResolvedFromDuration=!0}}return e}({...n,velocity:-F(n.velocity||0)}),f=c||0,v=h/(2*Math.sqrt(u*d)),y=o-a,g=F(Math.sqrt(u/d)),b=5>Math.abs(y);if(s||(s=b?tS.restSpeed.granular:tS.restSpeed.default),r||(r=b?tS.restDelta.granular:tS.restDelta.default),v<1){let t=tA(g,v);i=e=>o-Math.exp(-v*g*e)*((f+v*g*y)/t*Math.sin(t*e)+y*Math.cos(t*e))}else if(1===v)i=t=>o-Math.exp(-g*t)*(y+(f+g*y)*t);else{let t=g*Math.sqrt(v*v-1);i=e=>{let i=Math.exp(-v*g*e),n=Math.min(t*e,300);return o-i*((f+v*g*y)*Math.sinh(n)+t*y*Math.cosh(n))/t}}let w={calculatedDuration:m&&p||null,next:t=>{let e=i(t);if(m)l.done=t>=p;else{let n=0===t?f:0;v<1&&(n=0===t?E(f):tT(i,t,e));let a=Math.abs(n)<=s,u=Math.abs(o-e)<=r;l.done=a&&u}return l.value=l.done?o:e,l},toString:()=>{let t=Math.min(tw(w),2e4),e=tb(e=>w.next(t*e).value,t,30);return t+"ms "+e},toTransition:()=>{}};return w}function tk({keyframes:t,velocity:e=0,power:i=.8,timeConstant:n=325,bounceDamping:s=10,bounceStiffness:r=500,modifyTarget:a,min:o,max:l,restDelta:u=.5,restSpeed:h}){let d,p;let c=t[0],m={done:!1,value:c},f=t=>void 0!==o&&t<o||void 0!==l&&t>l,v=t=>void 0===o?l:void 0===l?o:Math.abs(o-t)<Math.abs(l-t)?o:l,y=i*e,g=c+y,b=void 0===a?g:a(g);b!==g&&(y=b-c);let w=t=>-y*Math.exp(-t/n),T=t=>b+w(t),S=t=>{let e=w(t),i=T(t);m.done=Math.abs(e)<=u,m.value=m.done?b:i},A=t=>{f(m.value)&&(d=t,p=tC({keyframes:[m.value,v(m.value)],velocity:tT(T,t,m.value),damping:s,stiffness:r,restDelta:u,restSpeed:h}))};return A(0),{calculatedDuration:null,next:t=>{let e=!1;return(p||void 0!==d||(e=!0,S(t),A(t)),void 0!==d&&t>=d)?p.next(t-d):(e||S(t),m)}}}tC.applyToOptions=t=>{let e=function(t,e=100,i){let n=i({...t,keyframes:[0,e]}),s=Math.min(tw(n),2e4);return{type:"keyframes",ease:t=>n.next(s*t).value/e,duration:F(s)}}(t,100,tC);return t.ease=e.ease,t.duration=E(e.duration),t.type="keyframes",t};let tE=(t,e,i)=>(((1-3*i+3*e)*t+(3*i-6*e))*t+3*e)*t;function tF(t,e,i,n){if(t===e&&i===n)return l;let s=e=>(function(t,e,i,n,s){let r,a;let o=0;do(r=tE(a=e+(i-e)/2,n,s)-t)>0?i=a:e=a;while(Math.abs(r)>1e-7&&++o<12);return a})(e,0,1,t,i);return t=>0===t||1===t?t:tE(s(t),e,n)}let tP=tF(.42,0,1,1),tO=tF(0,0,.58,1),tD=tF(.42,0,.58,1),tI=t=>Array.isArray(t)&&"number"!=typeof t[0],tN=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,tR=t=>e=>1-t(1-e),tL=tF(.33,1.53,.69,.99),tB=tR(tL),t$=tN(tB),tj=t=>(t*=2)<1?.5*tB(t):.5*(2-Math.pow(2,-10*(t-1))),tK=t=>1-Math.sin(Math.acos(t)),tq=tR(tK),t_=tN(tK),tU=t=>Array.isArray(t)&&"number"==typeof t[0],tW={linear:l,easeIn:tP,easeInOut:tD,easeOut:tO,circIn:tK,circInOut:t_,circOut:tq,backIn:tB,backInOut:t$,backOut:tL,anticipate:tj},tY=t=>"string"==typeof t,tz=t=>{if(tU(t)){D(4===t.length,"Cubic bezier arrays must contain four numerical values.");let[e,i,n,s]=t;return tF(e,i,n,s)}return tY(t)?(D(void 0!==tW[t],`Invalid easing type '${t}'`),tW[t]):t},tG=(t,e,i)=>{let n=e-t;return 0===n?1:(i-t)/n};function tH({duration:t=300,keyframes:e,times:i,ease:n="easeInOut"}){let s=tI(n)?n.map(tz):tz(n),r={done:!1,value:e[0]},a=function(t,e,{clamp:i=!0,ease:n,mixer:s}={}){let r=t.length;if(D(r===e.length,"Both input and output ranges must be the same length"),1===r)return()=>e[0];if(2===r&&e[0]===e[1])return()=>e[1];let a=t[0]===t[1];t[0]>t[r-1]&&(t=[...t].reverse(),e=[...e].reverse());let o=function(t,e,i){let n=[],s=i||v.c.mix||ty,r=t.length-1;for(let i=0;i<r;i++){let r=s(t[i],t[i+1]);e&&(r=C(Array.isArray(e)?e[i]||l:e,r)),n.push(r)}return n}(e,n,s),u=o.length,h=i=>{if(a&&i<t[0])return e[0];let n=0;if(u>1)for(;n<t.length-2&&!(i<t[n+1]);n++);let s=tG(t[n],t[n+1],i);return o[n](s)};return i?e=>h((0,k.u)(t[0],t[r-1],e)):h}((i&&i.length===e.length?i:function(t){let e=[0];return function(t,e){let i=t[t.length-1];for(let n=1;n<=e;n++){let s=tG(0,e,n);t.push(tr(i,1,s))}}(e,t.length-1),e}(e)).map(e=>e*t),e,{ease:Array.isArray(s)?s:e.map(()=>s||tD).splice(0,e.length-1)});return{calculatedDuration:t,next:e=>(r.value=a(e),r.done=e>=t,r)}}let tX=t=>null!==t;function tZ(t,{repeat:e,repeatType:i="loop"},n,s=1){let r=t.filter(tX),a=s<0||e&&"loop"!==i&&e%2==1?0:r.length-1;return a&&void 0!==n?n:r[a]}let tQ={decay:tk,inertia:tk,tween:tH,keyframes:tH,spring:tC};function tJ(t){"string"==typeof t.type&&(t.type=tQ[t.type])}class t0{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,e){return this.finished.then(t,e)}}let t1=t=>t/100;class t2 extends t0{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=(t=!0)=>{if(t){let{motionValue:t}=this.options;t&&t.updatedAt!==g.now()&&this.tick(g.now())}this.isStopped=!0,"idle"!==this.state&&(this.teardown(),this.options.onStop?.())},P.mainThread++,this.options=t,this.initAnimation(),this.play(),!1===t.autoplay&&this.pause()}initAnimation(){let{options:t}=this;tJ(t);let{type:e=tH,repeat:i=0,repeatDelay:n=0,repeatType:s,velocity:r=0}=t,{keyframes:a}=t,o=e||tH;o!==tH&&"number"!=typeof a[0]&&(this.mixKeyframes=C(t1,ty(a[0],a[1])),a=[0,100]);let l=o({...t,keyframes:a});"mirror"===s&&(this.mirroredGenerator=o({...t,keyframes:[...a].reverse(),velocity:-r})),null===l.calculatedDuration&&(l.calculatedDuration=tw(l));let{calculatedDuration:u}=l;this.calculatedDuration=u,this.resolvedDuration=u+n,this.totalDuration=this.resolvedDuration*(i+1)-n,this.generator=l}updateTime(t){let e=Math.round(t-this.startTime)*this.playbackSpeed;null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=e}tick(t,e=!1){let{generator:i,totalDuration:n,mixKeyframes:s,mirroredGenerator:r,resolvedDuration:a,calculatedDuration:o}=this;if(null===this.startTime)return i.next(0);let{delay:l=0,keyframes:u,repeat:h,repeatType:d,repeatDelay:p,type:c,onUpdate:m,finalKeyframe:f}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-n/this.speed,this.startTime)),e?this.currentTime=t:this.updateTime(t);let v=this.currentTime-l*(this.playbackSpeed>=0?1:-1),y=this.playbackSpeed>=0?v<0:v>n;this.currentTime=Math.max(v,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=n);let g=this.currentTime,b=i;if(h){let t=Math.min(this.currentTime,n)/a,e=Math.floor(t),i=t%1;!i&&t>=1&&(i=1),1===i&&e--,(e=Math.min(e,h+1))%2&&("reverse"===d?(i=1-i,p&&(i-=p/a)):"mirror"===d&&(b=r)),g=(0,k.u)(0,1,i)*a}let w=y?{done:!1,value:u[0]}:b.next(g);s&&(w.value=s(w.value));let{done:T}=w;y||null===o||(T=this.playbackSpeed>=0?this.currentTime>=n:this.currentTime<=0);let S=null===this.holdTime&&("finished"===this.state||"running"===this.state&&T);return S&&c!==tk&&(w.value=tZ(u,this.options,f,this.speed)),m&&m(w.value),S&&this.finish(),w}then(t,e){return this.finished.then(t,e)}get duration(){return F(this.calculatedDuration)}get time(){return F(this.currentTime)}set time(t){t=E(t),this.currentTime=t,null===this.startTime||null!==this.holdTime||0===this.playbackSpeed?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(g.now());let e=this.playbackSpeed!==t;this.playbackSpeed=t,e&&(this.time=F(this.currentTime))}play(){if(this.isStopped)return;let{driver:t=tg,startTime:e}=this.options;this.driver||(this.driver=t(t=>this.tick(t))),this.options.onPlay?.();let i=this.driver.now();"finished"===this.state?(this.updateFinished(),this.startTime=i):null!==this.holdTime?this.startTime=i-this.holdTime:this.startTime||(this.startTime=e??i),"finished"===this.state&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(g.now()),this.holdTime=this.currentTime}complete(){"running"!==this.state&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null,P.mainThread--}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}let t5=t=>180*t/Math.PI,t3=t=>t6(t5(Math.atan2(t[1],t[0]))),t4={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:t3,rotateZ:t3,skewX:t=>t5(Math.atan(t[1])),skewY:t=>t5(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},t6=t=>((t%=360)<0&&(t+=360),t),t9=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),t8=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),t7={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:t9,scaleY:t8,scale:t=>(t9(t)+t8(t))/2,rotateX:t=>t6(t5(Math.atan2(t[6],t[5]))),rotateY:t=>t6(t5(Math.atan2(-t[2],t[0]))),rotateZ:t3,rotate:t3,skewX:t=>t5(Math.atan(t[4])),skewY:t=>t5(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function et(t){return t.includes("scale")?1:0}function ee(t,e){let i,n;if(!t||"none"===t)return et(e);let s=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);if(s)i=t7,n=s;else{let e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);i=t4,n=e}if(!n)return et(e);let r=i[e],a=n[1].split(",").map(en);return"function"==typeof r?r(a):a[r]}let ei=(t,e)=>{let{transform:i="none"}=getComputedStyle(t);return ee(i,e)};function en(t){return parseFloat(t.trim())}let es=t=>t===N.Rx||t===W.px,er=new Set(["x","y","z"]),ea=c._.filter(t=>!er.has(t)),eo={width:({x:t},{paddingLeft:e="0",paddingRight:i="0"})=>t.max-t.min-parseFloat(e)-parseFloat(i),height:({y:t},{paddingTop:e="0",paddingBottom:i="0"})=>t.max-t.min-parseFloat(e)-parseFloat(i),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>ee(e,"x"),y:(t,{transform:e})=>ee(e,"y")};eo.translateX=eo.x,eo.translateY=eo.y;let el=new Set,eu=!1,eh=!1,ed=!1;function ep(){if(eh){let t=Array.from(el).filter(t=>t.needsMeasurement),e=new Set(t.map(t=>t.element)),i=new Map;e.forEach(t=>{let e=function(t){let e=[];return ea.forEach(i=>{let n=t.getValue(i);void 0!==n&&(e.push([i,n.get()]),n.set(i.startsWith("scale")?1:0))}),e}(t);e.length&&(i.set(t,e),t.render())}),t.forEach(t=>t.measureInitialState()),e.forEach(t=>{t.render();let e=i.get(t);e&&e.forEach(([e,i])=>{t.getValue(e)?.set(i)})}),t.forEach(t=>t.measureEndState()),t.forEach(t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)})}eh=!1,eu=!1,el.forEach(t=>t.complete(ed)),el.clear()}function ec(){el.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(eh=!0)})}class em{constructor(t,e,i,n,s,r=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=i,this.motionValue=n,this.element=s,this.isAsync=r}scheduleResolve(){this.state="scheduled",this.isAsync?(el.add(this),eu||(eu=!0,u.read(ec),u.resolveKeyframes(ep))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:t,name:e,element:i,motionValue:n}=this;if(null===t[0]){let s=n?.get(),r=t[t.length-1];if(void 0!==s)t[0]=s;else if(i&&e){let n=i.readValue(e,r);null!=n&&(t[0]=n)}void 0===t[0]&&(t[0]=r),n&&void 0===s&&n.set(t[0])}!function(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),el.delete(this)}cancel(){"scheduled"===this.state&&(el.delete(this),this.state="pending")}resume(){"pending"===this.state&&this.scheduleResolve()}}let ef=t=>t.startsWith("--");function ev(t){let e;return()=>(void 0===e&&(e=t()),e)}let ey=ev(()=>void 0!==window.ScrollTimeline);var eg=i(7275);let eb={},ew=function(t,e){let i=ev(t);return()=>eb[e]??i()}(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),eT=([t,e,i,n])=>`cubic-bezier(${t}, ${e}, ${i}, ${n})`,eS={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:eT([0,.65,.55,1]),circOut:eT([.55,0,1,.45]),backIn:eT([.31,.01,.66,-.59]),backOut:eT([.33,1.53,.69,.99])};function eA(t){return"function"==typeof t&&"applyToOptions"in t}class eM extends t0{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,!t)return;let{element:e,name:i,keyframes:n,pseudoElement:s,allowFlatten:r=!1,finalKeyframe:a,onComplete:o}=t;this.isPseudoElement=!!s,this.allowFlatten=r,this.options=t,D("string"!=typeof t.type,'animateMini doesn\'t support "type" as a string. Did you mean to import { spring } from "motion"?');let l=function({type:t,...e}){return eA(t)&&ew()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}(t);this.animation=function(t,e,i,{delay:n=0,duration:s=300,repeat:r=0,repeatType:a="loop",ease:o="easeOut",times:l}={},u){let h={[e]:i};l&&(h.offset=l);let d=function t(e,i){if(e)return"function"==typeof e?ew()?tb(e,i):"ease-out":tU(e)?eT(e):Array.isArray(e)?e.map(e=>t(e,i)||eS.easeOut):eS[e]}(o,s);Array.isArray(d)&&(h.easing=d),eg.f.value&&P.waapi++;let p={delay:n,duration:s,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:r+1,direction:"reverse"===a?"alternate":"normal"};u&&(p.pseudoElement=u);let c=t.animate(h,p);return eg.f.value&&c.finished.finally(()=>{P.waapi--}),c}(e,i,n,l,s),!1===l.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!s){let t=tZ(n,this.options,a,this.speed);this.updateMotionValue?this.updateMotionValue(t):ef(i)?e.style.setProperty(i,t):e.style[i]=t,this.animation.cancel()}o?.(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(t){}}stop(){if(this.isStopped)return;this.isStopped=!0;let{state:t}=this;"idle"!==t&&"finished"!==t&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){return F(Number(this.animation.effect?.getComputedTiming?.().duration||0))}get time(){return F(Number(this.animation.currentTime)||0)}set time(t){this.finishedTime=null,this.animation.currentTime=E(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(t){this.animation.startTime=t}attachTimeline({timeline:t,observe:e}){return(this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&ey())?(this.animation.timeline=t,l):e(this)}}let eV={anticipate:tj,backInOut:t$,circInOut:t_};class ex extends eM{constructor(t){"string"==typeof t.ease&&t.ease in eV&&(t.ease=eV[t.ease]),tJ(t),super(t),t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){let{motionValue:e,onUpdate:i,onComplete:n,element:s,...r}=this.options;if(!e)return;if(void 0!==t){e.set(t);return}let a=new t2({...r,autoplay:!1}),o=E(this.finishedTime??this.time);e.setWithVelocity(a.sample(o-10).value,a.sample(o).value,10),a.stop()}}let eC=(t,e)=>"zIndex"!==e&&!!("number"==typeof t||Array.isArray(t)||"string"==typeof t&&(ti.test(t)||"0"===t)&&!t.startsWith("url(")),ek=new Set(["opacity","clipPath","filter","transform"]),eE=ev(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));class eF extends t0{constructor({autoplay:t=!0,delay:e=0,type:i="keyframes",repeat:n=0,repeatDelay:s=0,repeatType:r="loop",keyframes:a,name:o,motionValue:l,element:u,...h}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=g.now();let d={autoplay:t,delay:e,type:i,repeat:n,repeatDelay:s,repeatType:r,name:o,motionValue:l,element:u,...h},p=u?.KeyframeResolver||em;this.keyframeResolver=new p(a,(t,e,i)=>this.onKeyframesResolved(t,e,d,!i),o,l,u),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,e,i,n){this.keyframeResolver=void 0;let{name:s,type:r,velocity:a,delay:o,isHandoff:u,onUpdate:h}=i;this.resolvedAt=g.now(),!function(t,e,i,n){let s=t[0];if(null===s)return!1;if("display"===e||"visibility"===e)return!0;let r=t[t.length-1],a=eC(s,e),o=eC(r,e);return O(a===o,`You are trying to animate ${e} from "${s}" to "${r}". ${s} is not an animatable value - to enable this animation set ${s} to a value animatable to ${r} via the \`style\` property.`),!!a&&!!o&&(function(t){let e=t[0];if(1===t.length)return!0;for(let i=0;i<t.length;i++)if(t[i]!==e)return!0}(t)||("spring"===i||eA(i))&&n)}(t,s,r,a)&&((v.c.instantAnimations||!o)&&h?.(tZ(t,i,e)),t[0]=t[t.length-1],i.duration=0,i.repeat=0);let d={startTime:n?this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt:void 0,finalKeyframe:e,...i,keyframes:t},p=!u&&function(t){let{motionValue:e,name:i,repeatDelay:n,repeatType:s,damping:r,type:a}=t;if(!e||!e.owner||!(e.owner.current instanceof HTMLElement))return!1;let{onUpdate:o,transformTemplate:l}=e.owner.getProps();return eE()&&i&&ek.has(i)&&("transform"!==i||!l)&&!o&&!n&&"mirror"!==s&&0!==r&&"inertia"!==a}(d)?new ex({...d,element:d.motionValue.owner.current}):new t2(d);p.finished.then(()=>this.notifyFinished()).catch(l),this.pendingTimeline&&(this.stopTimeline=p.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=p}get finished(){return this._animation?this.animation.finished:this._finished}then(t,e){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),ed=!0,ec(),ep(),ed=!1),this._animation}get duration(){return this.animation.duration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}let eP=t=>null!==t,eO={type:"spring",stiffness:500,damping:25,restSpeed:10},eD=t=>({type:"spring",stiffness:550,damping:0===t?2*Math.sqrt(550):30,restSpeed:10}),eI={type:"keyframes",duration:.8},eN={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},eR=(t,{keyframes:e})=>e.length>2?eI:c.G.has(t)?t.startsWith("scale")?eD(e[1]):eO:eN,eL=(t,e,i,n={},s,r)=>a=>{let l=o(n,t)||{},h=l.delay||n.delay||0,{elapsed:d=0}=n;d-=E(h);let p={keyframes:Array.isArray(i)?i:[null,i],ease:"easeOut",velocity:e.getVelocity(),...l,delay:-d,onUpdate:t=>{e.set(t),l.onUpdate&&l.onUpdate(t)},onComplete:()=>{a(),l.onComplete&&l.onComplete()},name:t,motionValue:e,element:r?void 0:s};!function({when:t,delay:e,delayChildren:i,staggerChildren:n,staggerDirection:s,repeat:r,repeatType:a,repeatDelay:o,from:l,elapsed:u,...h}){return!!Object.keys(h).length}(l)&&Object.assign(p,eR(t,p)),p.duration&&(p.duration=E(p.duration)),p.repeatDelay&&(p.repeatDelay=E(p.repeatDelay)),void 0!==p.from&&(p.keyframes[0]=p.from);let c=!1;if(!1!==p.type&&(0!==p.duration||p.repeatDelay)||(p.duration=0,0!==p.delay||(c=!0)),(v.c.instantAnimations||v.c.skipAnimations)&&(c=!0,p.duration=0,p.delay=0),p.allowFlatten=!l.type&&!l.ease,c&&!r&&void 0!==e.get()){let t=function(t,{repeat:e,repeatType:i="loop"},n){let s=t.filter(eP),r=e&&"loop"!==i&&e%2==1?0:s.length-1;return s[r]}(p.keyframes,l);if(void 0!==t){u.update(()=>{p.onUpdate(t),p.onComplete()});return}}return l.isSync?new t2(p):new eF(p)};function eB(t,e,{delay:i=0,transitionOverride:n,type:s}={}){let{transition:r=t.getDefaultTransition(),transitionEnd:l,...h}=e;n&&(r=n);let d=[],p=s&&t.animationState&&t.animationState.getState()[s];for(let e in h){let n=t.getValue(e,t.latestValues[e]??null),s=h[e];if(void 0===s||p&&function({protectedKeys:t,needsAnimating:e},i){let n=t.hasOwnProperty(i)&&!0!==e[i];return e[i]=!1,n}(p,e))continue;let a={delay:i,...o(r||{},e)},l=n.get();if(void 0!==l&&!n.isAnimating&&!Array.isArray(s)&&s===l&&!a.velocity)continue;let c=!1;if(window.MotionHandoffAnimation){let i=t.props[V.M];if(i){let t=window.MotionHandoffAnimation(i,e,u);null!==t&&(a.startTime=t,c=!0)}}!function(t,e){let i=t.getValue("willChange");if((0,M.i)(i)&&i.add)return i.add(e);if(!i&&v.c.WillChange){let i=new v.c.WillChange("auto");t.addValue("willChange",i),i.add(e)}}(t,e),n.start(eL(e,n,s,t.shouldReduceMotion&&m.has(e)?{type:!1}:a,t,c));let f=n.animation;f&&d.push(f)}return l&&Promise.all(d).then(()=>{u.update(()=>{l&&function(t,e){let{transitionEnd:i={},transition:n={},...s}=a(t,e)||{};for(let e in s={...s,...i}){var r;let i=A(r=s[e])?r[r.length-1]||0:r;t.hasValue(e)?t.getValue(e).set(i):t.addValue(e,S(i))}}(t,l)})}),d}function e$(t,e,i={}){let n=a(t,e,"exit"===i.type?t.presenceContext?.custom:void 0),{transition:s=t.getDefaultTransition()||{}}=n||{};i.transitionOverride&&(s=i.transitionOverride);let r=n?()=>Promise.all(eB(t,n,i)):()=>Promise.resolve(),o=t.variantChildren&&t.variantChildren.size?(n=0)=>{let{delayChildren:r=0,staggerChildren:a,staggerDirection:o}=s;return function(t,e,i=0,n=0,s=1,r){let a=[],o=(t.variantChildren.size-1)*n,l=1===s?(t=0)=>t*n:(t=0)=>o-t*n;return Array.from(t.variantChildren).sort(ej).forEach((t,n)=>{t.notify("AnimationStart",e),a.push(e$(t,e,{...r,delay:i+l(n)}).then(()=>t.notify("AnimationComplete",e)))}),Promise.all(a)}(t,e,r+n,a,o,i)}:()=>Promise.resolve(),{when:l}=s;if(!l)return Promise.all([r(),o(i.delay)]);{let[t,e]="beforeChildren"===l?[r,o]:[o,r];return t().then(()=>e())}}function ej(t,e){return t.sortNodePosition(e)}function eK(t,e){if(!Array.isArray(e))return!1;let i=e.length;if(i!==t.length)return!1;for(let n=0;n<i;n++)if(e[n]!==t[n])return!1;return!0}var eq=i(7732),e_=i(2963);let eU=e_.V.length,eW=[...e_.e].reverse(),eY=e_.e.length;function ez(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function eG(){return{animate:ez(!0),whileInView:ez(),whileHover:ez(),whileTap:ez(),whileDrag:ez(),whileFocus:ez(),exit:ez()}}class eH{constructor(t){this.isMounted=!1,this.node=t}update(){}}class eX extends eH{constructor(t){super(t),t.animationState||(t.animationState=function(t){let e=e=>Promise.all(e.map(({animation:e,options:i})=>(function(t,e,i={}){let n;if(t.notify("AnimationStart",e),Array.isArray(e))n=Promise.all(e.map(e=>e$(t,e,i)));else if("string"==typeof e)n=e$(t,e,i);else{let s="function"==typeof e?a(t,e,i.custom):e;n=Promise.all(eB(t,s,i))}return n.then(()=>{t.notify("AnimationComplete",e)})})(t,e,i))),i=eG(),n=!0,r=e=>(i,n)=>{let s=a(t,n,"exit"===e?t.presenceContext?.custom:void 0);if(s){let{transition:t,transitionEnd:e,...n}=s;i={...i,...n,...e}}return i};function o(o){let{props:l}=t,u=function t(e){if(!e)return;if(!e.isControllingVariants){let i=e.parent&&t(e.parent)||{};return void 0!==e.props.initial&&(i.initial=e.props.initial),i}let i={};for(let t=0;t<eU;t++){let n=e_.V[t],s=e.props[n];((0,eq.$)(s)||!1===s)&&(i[n]=s)}return i}(t.parent)||{},h=[],d=new Set,p={},c=1/0;for(let e=0;e<eY;e++){var m;let a=eW[e],f=i[a],v=void 0!==l[a]?l[a]:u[a],y=(0,eq.$)(v),g=a===o?f.isActive:null;!1===g&&(c=e);let b=v===u[a]&&v!==l[a]&&y;if(b&&n&&t.manuallyAnimateOnMount&&(b=!1),f.protectedKeys={...p},!f.isActive&&null===g||!v&&!f.prevProp||(0,s.H)(v)||"boolean"==typeof v)continue;let w=(m=f.prevProp,"string"==typeof v?v!==m:!!Array.isArray(v)&&!eK(v,m)),T=w||a===o&&f.isActive&&!b&&y||e>c&&y,S=!1,M=Array.isArray(v)?v:[v],V=M.reduce(r(a),{});!1===g&&(V={});let{prevResolvedValues:x={}}=f,C={...x,...V},k=e=>{T=!0,d.has(e)&&(S=!0,d.delete(e)),f.needsAnimating[e]=!0;let i=t.getValue(e);i&&(i.liveStyle=!1)};for(let t in C){let e=V[t],i=x[t];if(!p.hasOwnProperty(t))(A(e)&&A(i)?eK(e,i):e===i)?void 0!==e&&d.has(t)?k(t):f.protectedKeys[t]=!0:null!=e?k(t):d.add(t)}f.prevProp=v,f.prevResolvedValues=V,f.isActive&&(p={...p,...V}),n&&t.blockInitialAnimation&&(T=!1);let E=!(b&&w)||S;T&&E&&h.push(...M.map(t=>({animation:t,options:{type:a}})))}if(d.size){let e={};if("boolean"!=typeof l.initial){let i=a(t,Array.isArray(l.initial)?l.initial[0]:l.initial);i&&i.transition&&(e.transition=i.transition)}d.forEach(i=>{let n=t.getBaseTarget(i),s=t.getValue(i);s&&(s.liveStyle=!0),e[i]=n??null}),h.push({animation:e})}let f=!!h.length;return n&&(!1===l.initial||l.initial===l.animate)&&!t.manuallyAnimateOnMount&&(f=!1),n=!1,f?e(h):Promise.resolve()}return{animateChanges:o,setActive:function(e,n){if(i[e].isActive===n)return Promise.resolve();t.variantChildren?.forEach(t=>t.animationState?.setActive(e,n)),i[e].isActive=n;let s=o(e);for(let t in i)i[t].protectedKeys={};return s},setAnimateFunction:function(i){e=i(t)},getState:()=>i,reset:()=>{i=eG(),n=!0}}}(t))}updateAnimationControlsSubscription(){let{animate:t}=this.node.getProps();(0,s.H)(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:t}=this.node.getProps(),{animate:e}=this.node.prevProps||{};t!==e&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let eZ=0;class eQ extends eH{constructor(){super(...arguments),this.id=eZ++}update(){if(!this.node.presenceContext)return;let{isPresent:t,onExitComplete:e}=this.node.presenceContext,{isPresent:i}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===i)return;let n=this.node.animationState.setActive("exit",!t);e&&!t&&n.then(()=>{e(this.id)})}mount(){let{register:t,onExitComplete:e}=this.node.presenceContext||{};e&&e(this.id),t&&(this.unmount=t(this.id))}unmount(){}}let eJ={x:!1,y:!1};function e0(t,e){let i=function(t,e,i){if(t instanceof EventTarget)return[t];if("string"==typeof t){let e=document,i=(void 0)??e.querySelectorAll(t);return i?Array.from(i):[]}return Array.from(t)}(t),n=new AbortController;return[i,{passive:!0,...e,signal:n.signal},()=>n.abort()]}function e1(t){return!("touch"===t.pointerType||eJ.x||eJ.y)}function e2(t){return{point:{x:t.pageX,y:t.pageY}}}function e5(t,e,i){let{props:n}=t;t.animationState&&n.whileHover&&t.animationState.setActive("whileHover","Start"===i);let s=n["onHover"+i];s&&u.postRender(()=>s(e,e2(e)))}class e3 extends eH{mount(){let{current:t}=this.node;t&&(this.unmount=function(t,e,i={}){let[n,s,r]=e0(t,i),a=t=>{if(!e1(t))return;let{target:i}=t,n=e(i,t);if("function"!=typeof n||!i)return;let r=t=>{e1(t)&&(n(t),i.removeEventListener("pointerleave",r))};i.addEventListener("pointerleave",r,s)};return n.forEach(t=>{t.addEventListener("pointerenter",a,s)}),r}(t,(t,e)=>(e5(this.node,e,"Start"),t=>e5(this.node,t,"End"))))}unmount(){}}function e4(t,e,i,n={passive:!0}){return t.addEventListener(e,i,n),()=>t.removeEventListener(e,i)}class e6 extends eH{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch(e){t=!0}t&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=C(e4(this.node.current,"focus",()=>this.onFocus()),e4(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}let e9=(t,e)=>!!e&&(t===e||e9(t,e.parentElement)),e8=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary,e7=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]),it=new WeakSet;function ie(t){return e=>{"Enter"===e.key&&t(e)}}function ii(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}let is=(t,e)=>{let i=t.currentTarget;if(!i)return;let n=ie(()=>{if(it.has(i))return;ii(i,"down");let t=ie(()=>{ii(i,"up")});i.addEventListener("keyup",t,e),i.addEventListener("blur",()=>ii(i,"cancel"),e)});i.addEventListener("keydown",n,e),i.addEventListener("blur",()=>i.removeEventListener("keydown",n),e)};function ir(t){return e8(t)&&!(eJ.x||eJ.y)}function ia(t,e,i){let{props:n}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&n.whileTap&&t.animationState.setActive("whileTap","Start"===i);let s=n["onTap"+("End"===i?"":i)];s&&u.postRender(()=>s(e,e2(e)))}class io extends eH{mount(){let{current:t}=this.node;t&&(this.unmount=function(t,e,i={}){let[n,s,r]=e0(t,i),a=t=>{let n=t.currentTarget;if(!ir(t))return;it.add(n);let r=e(n,t),a=(t,e)=>{window.removeEventListener("pointerup",o),window.removeEventListener("pointercancel",l),it.has(n)&&it.delete(n),ir(t)&&"function"==typeof r&&r(t,{success:e})},o=t=>{a(t,n===window||n===document||i.useGlobalTarget||e9(n,t.target))},l=t=>{a(t,!1)};window.addEventListener("pointerup",o,s),window.addEventListener("pointercancel",l,s)};return n.forEach(t=>{(i.useGlobalTarget?window:t).addEventListener("pointerdown",a,s),t instanceof HTMLElement&&(t.addEventListener("focus",t=>is(t,s)),e7.has(t.tagName)||-1!==t.tabIndex||t.hasAttribute("tabindex")||(t.tabIndex=0))}),r}(t,(t,e)=>(ia(this.node,e,"Start"),(t,{success:e})=>ia(this.node,t,e?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}let il=new WeakMap,iu=new WeakMap,ih=t=>{let e=il.get(t.target);e&&e(t)},id=t=>{t.forEach(ih)},ip={some:0,all:1};class ic extends eH{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();let{viewport:t={}}=this.node.getProps(),{root:e,margin:i,amount:n="some",once:s}=t,r={root:e?e.current:void 0,rootMargin:i,threshold:"number"==typeof n?n:ip[n]};return function(t,e,i){let n=function({root:t,...e}){let i=t||document;iu.has(i)||iu.set(i,{});let n=iu.get(i),s=JSON.stringify(e);return n[s]||(n[s]=new IntersectionObserver(id,{root:t,...e})),n[s]}(e);return il.set(t,i),n.observe(t),()=>{il.delete(t),n.unobserve(t)}}(this.node.current,r,t=>{let{isIntersecting:e}=t;if(this.isInView===e||(this.isInView=e,s&&!e&&this.hasEnteredView))return;e&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",e);let{onViewportEnter:i,onViewportLeave:n}=this.node.getProps(),r=e?i:n;r&&r(t)})}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;let{props:t,prevProps:e}=this.node;["amount","margin","root"].some(function({viewport:t={}},{viewport:e={}}={}){return i=>t[i]!==e[i]}(t,e))&&this.startObserver()}unmount(){}}var im=i(7294);let iv=t=>e=>e.test(t),iy=[N.Rx,W.px,W.aQ,W.RW,W.vw,W.vh,{test:t=>"auto"===t,parse:t=>t}],ig=t=>iy.find(iv(t)),ib=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),iw=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u,iT=t=>/^0[^.\s]+$/u.test(t),iS=new Set(["brightness","contrast","saturate","opacity"]);function iA(t){let[e,i]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;let[n]=i.match(L)||[];if(!n)return t;let s=i.replace(n,""),r=iS.has(e)?1:0;return n!==i&&(r*=100),e+"("+r+s+")"}let iM=/\b([a-z-]*)\(.*?\)/gu,iV={...ti,getAnimatableNone:t=>{let e=t.match(iM);return e?e.map(iA).join(" "):t}},ix={...i(354).j,color:z,backgroundColor:z,outlineColor:z,fill:z,stroke:z,borderColor:z,borderTopColor:z,borderRightColor:z,borderBottomColor:z,borderLeftColor:z,filter:iV,WebkitFilter:iV},iC=t=>ix[t];function ik(t,e){let i=iC(t);return i!==iV&&(i=ti),i.getAnimatableNone?i.getAnimatableNone(e):void 0}let iE=new Set(["auto","none","0"]);class iF extends em{constructor(t,e,i,n,s){super(t,e,i,n,s,!0)}readKeyframes(){let{unresolvedKeyframes:t,element:e,name:i}=this;if(!e||!e.current)return;super.readKeyframes();for(let i=0;i<t.length;i++){let n=t[i];if("string"==typeof n&&(n=n.trim(),(0,I.t)(n))){let s=function t(e,i,n=1){D(n<=4,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`);let[s,r]=function(t){let e=iw.exec(t);if(!e)return[,];let[,i,n,s]=e;return[`--${i??n}`,s]}(e);if(!s)return;let a=window.getComputedStyle(i).getPropertyValue(s);if(a){let t=a.trim();return ib(t)?parseFloat(t):t}return(0,I.t)(r)?t(r,i,n+1):r}(n,e.current);void 0!==s&&(t[i]=s),i===t.length-1&&(this.finalKeyframe=n)}}if(this.resolveNoneKeyframes(),!m.has(i)||2!==t.length)return;let[n,s]=t,r=ig(n),a=ig(s);if(r!==a){if(es(r)&&es(a))for(let e=0;e<t.length;e++){let i=t[e];"string"==typeof i&&(t[e]=parseFloat(i))}else eo[i]&&(this.needsMeasurement=!0)}}resolveNoneKeyframes(){let{unresolvedKeyframes:t,name:e}=this,i=[];for(let e=0;e<t.length;e++){var n;(null===t[e]||("number"==typeof(n=t[e])?0===n:null===n||"none"===n||"0"===n||iT(n)))&&i.push(e)}i.length&&function(t,e,i){let n,s=0;for(;s<t.length&&!n;){let e=t[s];"string"==typeof e&&!iE.has(e)&&Q(e).values.length&&(n=t[s]),s++}if(n&&i)for(let s of e)t[s]=ik(i,n)}(t,i,e)}measureInitialState(){let{element:t,unresolvedKeyframes:e,name:i}=this;if(!t||!t.current)return;"height"===i&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=eo[i](t.measureViewportBox(),window.getComputedStyle(t.current)),e[0]=this.measuredOrigin;let n=e[e.length-1];void 0!==n&&t.getValue(i,n).jump(n,!1)}measureEndState(){let{element:t,name:e,unresolvedKeyframes:i}=this;if(!t||!t.current)return;let n=t.getValue(e);n&&n.jump(this.measuredOrigin,!1);let s=i.length-1,r=i[s];i[s]=eo[e](t.measureViewportBox(),window.getComputedStyle(t.current)),null!==r&&void 0===this.finalKeyframe&&(this.finalKeyframe=r),this.removedTransforms?.length&&this.removedTransforms.forEach(([e,i])=>{t.getValue(e).set(i)}),this.resolveNoneKeyframes()}}let iP=[...iy,z,ti],iO=t=>iP.find(iv(t));var iD=i(9442);let iI=()=>({min:0,max:0}),iN=()=>({x:iI(),y:iI()});var iR=i(1741);let iL={current:null},iB={current:!1},i$=new WeakMap;var ij=i(7504);let iK=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class iq{scrapeMotionValuesFromProps(t,e,i){return{}}constructor({parent:t,props:e,presenceContext:i,reducedMotionConfig:n,blockInitialAnimation:s,visualState:r},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=em,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{let t=g.now();this.renderScheduledAt<t&&(this.renderScheduledAt=t,u.render(this.render,!1,!0))};let{latestValues:o,renderState:l}=r;this.latestValues=o,this.baseTarget={...o},this.initialValues=e.initial?{...o}:{},this.renderState=l,this.parent=t,this.props=e,this.presenceContext=i,this.depth=t?t.depth+1:0,this.reducedMotionConfig=n,this.options=a,this.blockInitialAnimation=!!s,this.isControllingVariants=(0,ij.G)(e),this.isVariantNode=(0,ij.M)(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);let{willChange:h,...d}=this.scrapeMotionValuesFromProps(e,{},this);for(let t in d){let e=d[t];void 0!==o[t]&&(0,M.i)(e)&&e.set(o[t],!1)}}mount(t){this.current=t,i$.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((t,e)=>this.bindToMotionValue(e,t)),iB.current||function(){if(iB.current=!0,iR.j){if(window.matchMedia){let t=window.matchMedia("(prefers-reduced-motion)"),e=()=>iL.current=t.matches;t.addListener(e),e()}else iL.current=!1}}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||iL.current),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){for(let t in this.projection&&this.projection.unmount(),h(this.notifyUpdate),h(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this),this.events)this.events[t].clear();for(let t in this.features){let e=this.features[t];e&&(e.unmount(),e.isMounted=!1)}this.current=null}bindToMotionValue(t,e){let i;this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();let n=c.G.has(t);n&&this.onBindTransform&&this.onBindTransform();let s=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&u.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0)}),r=e.on("renderRequest",this.scheduleRender);window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,t,e)),this.valueSubscriptions.set(t,()=>{s(),r(),i&&i(),e.owner&&e.stop()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}updateFeatures(){let t="animation";for(t in iD.featureDefinitions){let e=iD.featureDefinitions[t];if(!e)continue;let{isEnabled:i,Feature:n}=e;if(!this.features[t]&&n&&i(this.props)&&(this.features[t]=new n(this)),this.features[t]){let e=this.features[t];e.isMounted?e.update():(e.mount(),e.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):iN()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}update(t,e){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let e=0;e<iK.length;e++){let i=iK[e];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);let n=t["on"+i];n&&(this.propEventSubscriptions[i]=this.on(i,n))}this.prevMotionValues=function(t,e,i){for(let n in e){let s=e[n],r=i[n];if((0,M.i)(s))t.addValue(n,s);else if((0,M.i)(r))t.addValue(n,S(s,{owner:t}));else if(r!==s){if(t.hasValue(n)){let e=t.getValue(n);!0===e.liveStyle?e.jump(s):e.hasAnimated||e.set(s)}else{let e=t.getStaticValue(n);t.addValue(n,S(void 0!==e?e:s,{owner:t}))}}}for(let n in i)void 0===e[n]&&t.removeValue(n);return e}(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){let e=this.getClosestVariantNode();if(e)return e.variantChildren&&e.variantChildren.add(t),()=>e.variantChildren.delete(t)}addValue(t,e){let i=this.values.get(t);e!==i&&(i&&this.removeValue(t),this.bindToMotionValue(t,e),this.values.set(t,e),this.latestValues[t]=e.get())}removeValue(t){this.values.delete(t);let e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let i=this.values.get(t);return void 0===i&&void 0!==e&&(i=S(null===e?void 0:e,{owner:this}),this.addValue(t,i)),i}readValue(t,e){let i=void 0===this.latestValues[t]&&this.current?this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];return null!=i&&("string"==typeof i&&(ib(i)||iT(i))?i=parseFloat(i):!iO(i)&&ti.test(e)&&(i=ik(t,e)),this.setBaseTarget(t,(0,M.i)(i)?i.get():i)),(0,M.i)(i)?i.get():i}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){let e;let{initial:i}=this.props;if("string"==typeof i||"object"==typeof i){let n=(0,r.o)(this.props,i,this.presenceContext?.custom);n&&(e=n[t])}if(i&&void 0!==e)return e;let n=this.getBaseTargetFromProps(this.props,t);return void 0===n||(0,M.i)(n)?void 0!==this.initialValues[t]&&void 0===e?void 0:this.baseTarget[t]:n}on(t,e){return this.events[t]||(this.events[t]=new f),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}}class i_ extends iq{constructor(){super(...arguments),this.KeyframeResolver=iF}sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){return t.style?t.style[e]:void 0}removeValueFromRenderState(t,{vars:e,style:i}){delete e[t],delete i[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:t}=this.props;(0,M.i)(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}}var iU=i(1069);function iW(t,{style:e,vars:i},n,s){for(let r in Object.assign(t.style,e,s&&s.getProjectionStyles(n)),i)t.style.setProperty(r,i[r])}var iY=i(189);class iz extends i_{constructor(){super(...arguments),this.type="html",this.renderInstance=iW}readValueFromInstance(t,e){if(c.G.has(e))return ei(t,e);{let i=window.getComputedStyle(t),n=((0,I.f)(e)?i.getPropertyValue(e):i[e])||0;return"string"==typeof n?n.trim():n}}measureInstanceViewportBox(t,{transformPagePoint:e}){return function({top:t,left:e,right:i,bottom:n}){return{x:{min:e,max:i},y:{min:t,max:n}}}(function(t,e){if(!e)return t;let i=e({x:t.left,y:t.top}),n=e({x:t.right,y:t.bottom});return{top:i.y,left:i.x,bottom:n.y,right:n.x}}(t.getBoundingClientRect(),e))}build(t,e,i){(0,iU.r)(t,e,i.transformTemplate)}scrapeMotionValuesFromProps(t,e,i){return(0,iY.U)(t,e,i)}}var iG=i(3193),iH=i(2617);let iX=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);var iZ=i(9854),iQ=i(6832);class iJ extends i_{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=iN}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(c.G.has(e)){let t=iC(e);return t&&t.default||0}return e=iX.has(e)?e:(0,iG.D)(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,i){return(0,iQ.U)(t,e,i)}build(t,e,i){(0,iH.i)(t,e,this.isSVGTag,i.transformTemplate,i.style)}renderInstance(t,e,i,n){!function(t,e,i,n){for(let i in iW(t,e,void 0,n),e.attrs)t.setAttribute(iX.has(i)?i:(0,iG.D)(i),e.attrs[i])}(t,e,0,n)}mount(t){this.isSVGTag=(0,iZ.a)(t.tagName),super.mount(t)}}var i0=i(2627),i1={renderer:(t,e)=>(0,i0.q)(t)?new iJ(e):new iz(e,{allowProjection:t!==im.Fragment}),animation:{Feature:eX},exit:{Feature:eQ},inView:{Feature:ic},tap:{Feature:io},focus:{Feature:e6},hover:{Feature:e3}}}}]);
|
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[938],{938:function(e,s,t){t.d(s,{L4:function(){return D},Nk:function(){return L},x2:function(){return _}});var r=t(5893),n=t(7294),a=t(1163),l=t(1664),c=t.n(l),i=t(8799),o=t(803),d=t(7673),u=t(8764),h=t(6989),x=t(8969),m=t(3266),p=t(7324),j=t(9470),f=t(3626),g=t(3293),b=t(6521),w=t(3610),y=t(9284),N=t(4545),v=t(9307),k=t(3001),C=t(8950);let _={active:["PENDING","RUNNING","RECOVERING","SUBMITTED","STARTING","CANCELLING"],finished:["SUCCEEDED","FAILED","CANCELLED","FAILED_SETUP","FAILED_PRECHECKS","FAILED_NO_RESOURCE","FAILED_CONTROLLER"]},S="__ALL_WORKSPACES__",E=e=>{if(!e)return"-";let s=(0,h.GV)(e);if(n.isValidElement(s)&&s.props&&s.props.children&&(s=n.isValidElement(s.props.children)&&s.props.children.props&&s.props.children.props.children?s.props.children.props.children:s.props.children),"string"!=typeof s)return s;if("just now"===s)return"now";let t=s.match(/^About\s+(\d+)\s+(\w+)\s+ago$/);if(t){let e=t[1],s=t[2],r={second:"sec",seconds:"secs",minute:"min",minutes:"mins",hour:"hr",hours:"hrs",day:"d",days:"d",month:"mo",months:"mos",year:"yr",years:"yrs"};if(r[s])return"~ ".concat(e," ").concat(r[s]," ago")}let r=s.match(/^a[n]?\s+(\w+)\s+ago$/);if(r){let e=r[1],s={second:"sec",minute:"min",hour:"hr",day:"d",month:"mo",year:"yr"};if(s[e])return"1 ".concat(s[e]," ago")}let a=s.match(/^(\d+)\s+(\w+)\s+ago$/);if(a){let e=a[1],s=a[2],t={seconds:"secs",minutes:"mins",hours:"hrs",days:"d",months:"mo",years:"yr"};if(t[s])return"".concat(e," ").concat(t[s]," ago")}return s};function L(){let e=(0,a.useRouter)(),[s,t]=(0,n.useState)(!1),l=n.useRef(null),[d,u]=(0,n.useState)({isOpen:!1,title:"",message:"",onConfirm:null}),m=(0,k.X)(),[g,b]=(0,n.useState)(S),[w,N]=(0,n.useState)([]);return(0,n.useEffect)(()=>{e.isReady&&e.query.workspace&&b(Array.isArray(e.query.workspace)?e.query.workspace[0]:e.query.workspace)},[e.isReady,e.query.workspace]),(0,n.useEffect)(()=>{(async()=>{try{let e=await (0,p.fX)(),s=Object.keys(e),t=(await (0,x.Vp)()).jobs||[],r=[...new Set(t.map(e=>e.workspace||"default").filter(e=>e))],n=new Set(s);r.forEach(e=>n.add(e)),N(Array.from(n).sort())}catch(e){console.error("Error fetching data for workspace filter:",e),N(["default"])}})()},[]),(0,r.jsxs)(j.A,{highlighted:"jobs",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between mb-4 h-5",children:[(0,r.jsxs)("div",{className:"text-base flex items-center",children:[(0,r.jsx)(c(),{href:"/jobs",className:"text-sky-blue hover:underline leading-none",children:"Managed Jobs"}),(0,r.jsxs)(C.Ph,{value:g,onValueChange:b,children:[(0,r.jsx)(C.i4,{className:"h-8 w-48 ml-4 mr-2 text-sm border-none focus:ring-0 focus:outline-none",children:(0,r.jsx)(C.ki,{placeholder:"Filter by workspace...",children:g===S?"All Workspaces":g})}),(0,r.jsxs)(C.Bw,{children:[(0,r.jsx)(C.Ql,{value:S,children:"All Workspaces"}),w.map(e=>(0,r.jsx)(C.Ql,{value:e,children:e},e))]})]})]}),(0,r.jsxs)("div",{className:"flex items-center space-x-2",children:[s&&(0,r.jsxs)("div",{className:"flex items-center mr-2",children:[(0,r.jsx)(i.Z,{size:15,className:"mt-0"}),(0,r.jsx)("span",{className:"ml-2 text-gray-500 text-sm",children:"Loading..."})]}),(0,r.jsxs)(o.z,{variant:"ghost",size:"sm",onClick:()=>{l.current&&l.current()},disabled:s,className:"text-sky-blue hover:text-sky-blue-bright",title:"Refresh",children:[(0,r.jsx)(f.Z,{className:"h-4 w-4 mr-1.5"}),!m&&(0,r.jsx)("span",{children:"Refresh"})]})]})]}),(0,r.jsx)(R,{refreshInterval:h.yc,setLoading:t,refreshDataRef:l,workspaceFilter:g}),(0,r.jsx)(y.cV,{isOpen:d.isOpen,onClose:()=>u({...d,isOpen:!1}),onConfirm:d.onConfirm,title:d.title,message:d.message})]})}function R(e){let{refreshInterval:s,setLoading:t,refreshDataRef:a,workspaceFilter:l}=e,[p,j]=(0,n.useState)([]),[f,b]=(0,n.useState)({key:null,direction:"ascending"}),[w,k]=(0,n.useState)(!1),[C,L]=(0,n.useState)(!0),[R,D]=(0,n.useState)(1),[A,z]=(0,n.useState)(10),[J,P]=(0,n.useState)(null),T=(0,n.useRef)(null),[W,q]=(0,n.useState)([]),[F,U]=(0,n.useState)({}),[V,Z]=(0,n.useState)(!1),[B,G]=(0,n.useState)(!1),[H,X]=(0,n.useState)(!1),[$,K]=(0,n.useState)("active"),[Q,Y]=(0,n.useState)(!0),[ee,es]=(0,n.useState)({isOpen:!1,title:"",message:"",onConfirm:null}),et=async()=>{es({isOpen:!0,title:"Restart Controller",message:"Are you sure you want to restart the controller? This will temporarily interrupt job management.",onConfirm:async()=>{try{X(!0),k(!0),await (0,x.Ce)("restartcontroller"),await er()}catch(e){console.error("Error restarting controller:",e)}finally{X(!1),k(!1)}}})},er=n.useCallback(async()=>{k(!0),t(!0);try{let[e,s]=await Promise.all([(0,x.Vp)(),(0,m.zd)()]),{jobs:t,controllerStopped:r}=e,n=s.find(e=>(0,N.Ym)(e.cluster)),a=n?n.status:"NOT_FOUND",l=!1;"STOPPED"==a&&r&&(l=!0),"LAUNCHING"==a?G(!0):G(!1),j(t),Z(l)}catch(e){console.error("Error fetching data:",e),j([])}finally{k(!1),t(!1),L(!1)}},[t]);n.useEffect(()=>{a&&(a.current=er)},[a,er]),(0,n.useEffect)(()=>{j([]);let e=!0;er();let t=setInterval(()=>{e&&er()},s);return()=>{e=!1,clearInterval(t)}},[s,er]),(0,n.useEffect)(()=>{D(1)},[$,p.length]),(0,n.useEffect)(()=>{q([]),Y(!0)},[$]);let en=e=>{let s="ascending";f.key===e&&"ascending"===f.direction&&(s="descending"),b({key:e,direction:s})},ea=e=>f.key===e?"ascending"===f.direction?" ↑":" ↓":"";n.useMemo(()=>({active:p.filter(e=>_.active.includes(e.status)).length,finished:p.filter(e=>_.finished.includes(e.status)).length}),[p]);let el=e=>W.length>0?W.includes(e):_[$].includes(e),ec=n.useMemo(()=>{let e=l&&l!==S?p.filter(e=>(e.workspace||"default").toLowerCase()===l.toLowerCase()):p;return W.length>0?e.filter(e=>W.includes(e.status)):Q?e.filter(e=>_[$].includes(e.status)):[]},[p,$,W,Q,_,l]),ei=n.useMemo(()=>f.key?[...ec].sort((e,s)=>e[f.key]<s[f.key]?"ascending"===f.direction?-1:1:e[f.key]>s[f.key]?"ascending"===f.direction?1:-1:0):ec,[ec,f]),eo=Math.ceil(ei.length/A),ed=(R-1)*A,eu=ed+A,eh=ei.slice(ed,eu),ex=e=>{if(W.includes(e)){let s=W.filter(s=>s!==e);0===s.length?(Y(!0),q([])):(q(s),Y(!1))}else q([...W,e]),Y(!1)};return(0,n.useEffect)(()=>{U(p.reduce((e,s)=>(e[s.status]=(e[s.status]||0)+1,e),{}))},[p]),(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)("div",{className:"flex flex-col space-y-1 mb-1",children:(0,r.jsxs)("div",{className:"flex flex-wrap items-center text-sm mb-1",children:[(0,r.jsx)("span",{className:"mr-2 text-sm font-medium",children:"Statuses:"}),(0,r.jsxs)("div",{className:"flex flex-wrap gap-2 items-center",children:[!w&&0===p.length&&!C&&(0,r.jsx)("span",{className:"text-gray-500 mr-2",children:"No jobs found"}),Object.entries(F).map(e=>{let[s,t]=e;return(0,r.jsxs)("button",{onClick:()=>ex(s),className:"px-3 py-1 rounded-full flex items-center space-x-2 ".concat(el(s)||W.includes(s)?(0,v.Cl)(s):"bg-gray-50 text-gray-600 hover:bg-gray-100"),children:[(0,r.jsx)("span",{children:s}),(0,r.jsx)("span",{className:"text-xs ".concat(el(s)||W.includes(s)?"bg-white/50":"bg-gray-200"," px-1.5 py-0.5 rounded"),children:t})]},s)}),p.length>0&&(0,r.jsxs)("div",{className:"flex items-center ml-2 gap-2",children:[(0,r.jsx)("span",{className:"text-gray-500",children:"("}),(0,r.jsx)("button",{onClick:()=>{K("active"),q([]),Y(!0)},className:"text-sm font-medium ".concat("active"===$&&Q?"text-green-700 underline":"text-gray-600 hover:text-green-700 hover:underline"),children:"show all active jobs"}),(0,r.jsx)("span",{className:"text-gray-500 mx-1",children:"|"}),(0,r.jsx)("button",{onClick:()=>{K("finished"),q([]),Y(!0)},className:"text-sm font-medium ".concat("finished"===$&&Q?"text-blue-700 underline":"text-gray-600 hover:text-blue-700 hover:underline"),children:"show all finished jobs"}),(0,r.jsx)("span",{className:"text-gray-500",children:")"})]})]})]})}),(0,r.jsx)(d.Zb,{children:(0,r.jsxs)(u.iA,{children:[(0,r.jsx)(u.xD,{children:(0,r.jsxs)(u.SC,{children:[(0,r.jsxs)(u.ss,{className:"sortable whitespace-nowrap",onClick:()=>en("id"),children:["ID",ea("id")]}),(0,r.jsxs)(u.ss,{className:"sortable whitespace-nowrap",onClick:()=>en("name"),children:["Name",ea("name")]}),(0,r.jsxs)(u.ss,{className:"sortable whitespace-nowrap",onClick:()=>en("user"),children:["User",ea("user")]}),(0,r.jsxs)(u.ss,{className:"sortable whitespace-nowrap",onClick:()=>en("workspace"),children:["Workspace",ea("workspace")]}),(0,r.jsxs)(u.ss,{className:"sortable whitespace-nowrap",onClick:()=>en("submitted_at"),children:["Submitted",ea("submitted_at")]}),(0,r.jsxs)(u.ss,{className:"sortable whitespace-nowrap",onClick:()=>en("job_duration"),children:["Duration",ea("job_duration")]}),(0,r.jsxs)(u.ss,{className:"sortable whitespace-nowrap",onClick:()=>en("status"),children:["Status",ea("status")]}),(0,r.jsxs)(u.ss,{className:"sortable whitespace-nowrap",onClick:()=>en("resources_str"),children:["Requested",ea("resources_str")]}),(0,r.jsxs)(u.ss,{className:"sortable whitespace-nowrap",onClick:()=>en("infra"),children:["Infra",ea("infra")]}),(0,r.jsxs)(u.ss,{className:"sortable whitespace-nowrap",onClick:()=>en("cluster"),children:["Resources",ea("cluster")]}),(0,r.jsxs)(u.ss,{className:"sortable whitespace-nowrap",onClick:()=>en("recoveries"),children:["Recoveries",ea("recoveries")]}),(0,r.jsx)(u.ss,{children:"Details"}),(0,r.jsx)(u.ss,{children:"Logs"})]})}),(0,r.jsx)(u.RM,{children:w&&C?(0,r.jsx)(u.SC,{children:(0,r.jsx)(u.pj,{colSpan:12,className:"text-center py-6 text-gray-500",children:(0,r.jsxs)("div",{className:"flex justify-center items-center",children:[(0,r.jsx)(i.Z,{size:20,className:"mr-2"}),(0,r.jsx)("span",{children:"Loading..."})]})})}):eh.length>0?(0,r.jsx)(r.Fragment,{children:eh.map(e=>(0,r.jsxs)(n.Fragment,{children:[(0,r.jsxs)(u.SC,{children:[(0,r.jsx)(u.pj,{children:(0,r.jsx)(c(),{href:"/jobs/".concat(e.id),className:"text-blue-600",children:e.id})}),(0,r.jsx)(u.pj,{children:(0,r.jsx)(c(),{href:"/jobs/".concat(e.id),className:"text-blue-600",children:e.name})}),(0,r.jsx)(u.pj,{children:e.user}),(0,r.jsx)(u.pj,{children:(0,r.jsx)(c(),{href:"/workspaces",className:"text-blue-600 hover:underline",children:e.workspace||"default"})}),(0,r.jsx)(u.pj,{children:E(e.submitted_at)}),(0,r.jsx)(u.pj,{children:(0,h.LU)(e.job_duration)}),(0,r.jsx)(u.pj,{children:(0,r.jsx)(v.OE,{status:e.status})}),(0,r.jsx)(u.pj,{children:e.requested_resources}),(0,r.jsx)(u.pj,{children:e.infra&&"-"!==e.infra?(0,r.jsx)(h.Md,{content:e.full_infra||e.infra,className:"text-sm text-muted-foreground",children:(0,r.jsxs)("span",{children:[(0,r.jsx)(c(),{href:"/infra",className:"text-blue-600 hover:underline",children:e.cloud||e.infra.split("(")[0].trim()}),e.infra.includes("(")&&(0,r.jsx)("span",{children:" "+e.infra.substring(e.infra.indexOf("("))})]})}):(0,r.jsx)("span",{children:e.infra||"-"})}),(0,r.jsx)(u.pj,{children:(0,r.jsx)(h.Md,{content:e.resources_str_full||e.resources_str,className:"text-sm text-muted-foreground",children:(0,r.jsx)("span",{children:e.resources_str})})}),(0,r.jsx)(u.pj,{children:e.recoveries}),(0,r.jsx)(u.pj,{children:e.details?(0,r.jsx)(M,{text:e.details,rowId:e.id,expandedRowId:J,setExpandedRowId:P}):"-"}),(0,r.jsx)(u.pj,{children:(0,r.jsx)(O,{jobParent:"/jobs",jobId:e.id,managed:!0})})]}),J===e.id&&(0,r.jsx)(I,{text:e.details,colSpan:12,innerRef:T})]},e.id))}):(0,r.jsx)(u.SC,{children:(0,r.jsx)(u.pj,{colSpan:12,className:"text-center py-6",children:(0,r.jsxs)("div",{className:"flex flex-col items-center space-y-4",children:[B&&(0,r.jsxs)("div",{className:"flex flex-col items-center space-y-2",children:[(0,r.jsx)("p",{className:"text-gray-700",children:"The managed job controller is launching. Please wait for it to be ready."}),(0,r.jsxs)("div",{className:"flex items-center",children:[(0,r.jsx)(i.Z,{size:12,className:"mr-2"}),(0,r.jsx)("span",{className:"text-gray-500",children:"Launching..."})]})]}),!V&&!B&&(0,r.jsx)("p",{className:"text-gray-500",children:"No active jobs"}),V&&(0,r.jsxs)("div",{className:"flex flex-col items-center space-y-2",children:[(0,r.jsx)("p",{className:"text-gray-700",children:"The managed job controller has been stopped. Please restart it to check the latest job status."}),(0,r.jsx)(o.z,{variant:"outline",size:"sm",onClick:et,className:"text-sky-blue hover:text-sky-blue-bright",disabled:w||H,children:H?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(i.Z,{size:12,className:"mr-2"}),"Restarting..."]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(g.Z,{className:"h-4 w-4 mr-2"}),"Restart Controller"]})})]})]})})})})]})}),ei.length>0&&(0,r.jsx)("div",{className:"flex justify-end items-center py-2 px-4 text-sm text-gray-700",children:(0,r.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,r.jsxs)("div",{className:"flex items-center",children:[(0,r.jsx)("span",{className:"mr-2",children:"Rows per page:"}),(0,r.jsxs)("div",{className:"relative inline-block",children:[(0,r.jsxs)("select",{value:A,onChange:e=>{z(parseInt(e.target.value,10)),D(1)},className:"py-1 pl-2 pr-6 appearance-none outline-none cursor-pointer border-none bg-transparent",style:{minWidth:"40px"},children:[(0,r.jsx)("option",{value:10,children:"10"}),(0,r.jsx)("option",{value:30,children:"30"}),(0,r.jsx)("option",{value:50,children:"50"}),(0,r.jsx)("option",{value:100,children:"100"}),(0,r.jsx)("option",{value:200,children:"200"})]}),(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 text-gray-500 absolute right-0 top-1/2 transform -translate-y-1/2 pointer-events-none",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})]}),(0,r.jsxs)("div",{children:[ed+1," – ",Math.min(eu,ei.length)," of"," ",ei.length]}),(0,r.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,r.jsx)(o.z,{variant:"ghost",size:"icon",onClick:()=>{D(e=>Math.max(e-1,1))},disabled:1===R,className:"text-gray-500 h-8 w-8 p-0",children:(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"chevron-left",children:(0,r.jsx)("path",{d:"M15 18l-6-6 6-6"})})}),(0,r.jsx)(o.z,{variant:"ghost",size:"icon",onClick:()=>{D(e=>Math.min(e+1,eo))},disabled:R===eo||0===eo,className:"text-gray-500 h-8 w-8 p-0",children:(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"chevron-right",children:(0,r.jsx)("path",{d:"M9 18l6-6-6-6"})})})]})]})}),(0,r.jsx)(y.cV,{isOpen:ee.isOpen,onClose:()=>es({...ee,isOpen:!1}),onConfirm:ee.onConfirm,title:ee.title,message:ee.message})]})}function O(e){let{withLabel:s=!1,jobParent:t,jobId:n,managed:l}=e,c=(0,a.useRouter)(),i=(e,s)=>{e.preventDefault(),e.stopPropagation(),c.push({pathname:"".concat(t,"/").concat(n),query:{tab:s}})};return(0,r.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,r.jsx)(h.WH,{content:"View Job Logs",className:"capitalize text-sm text-muted-foreground",children:(0,r.jsxs)("button",{onClick:e=>i(e,"logs"),className:"text-sky-blue hover:text-sky-blue-bright font-medium inline-flex items-center h-8",children:[(0,r.jsx)(b.Z,{className:"w-4 h-4"}),s&&(0,r.jsx)("span",{className:"ml-1.5",children:"Logs"})]})},"logs"),l&&(0,r.jsx)(h.WH,{content:"View Controller Logs",className:"capitalize text-sm text-muted-foreground",children:(0,r.jsxs)("button",{onClick:e=>i(e,"controllerlogs"),className:"text-sky-blue hover:text-sky-blue-bright font-medium inline-flex items-center h-8",children:[(0,r.jsx)(w.Z,{className:"w-4 h-4"}),s&&(0,r.jsx)("span",{className:"ml-2",children:"Controller Logs"})]})},"controllerlogs")]})}function D(e){let{clusterName:s,clusterJobData:t,loading:a}=e,[l,x]=(0,n.useState)(null),[m,p]=(0,n.useState)({key:null,direction:"ascending"}),[j,f]=(0,n.useState)(1),[g,b]=(0,n.useState)(10),w=(0,n.useRef)(null),[y,N]=(0,n.useState)(null);(0,n.useEffect)(()=>{let e=e=>{l&&w.current&&!w.current.contains(e.target)&&x(null)};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[l]);let k=n.useMemo(()=>t||[],[t]);(0,n.useEffect)(()=>{JSON.stringify(t)!==JSON.stringify(y)&&N(t)},[t,y]);let C=n.useMemo(()=>m.key?[...k].sort((e,s)=>e[m.key]<s[m.key]?"ascending"===m.direction?-1:1:e[m.key]>s[m.key]?"ascending"===m.direction?1:-1:0):k,[k,m]),_=e=>{let s="ascending";m.key===e&&"ascending"===m.direction&&(s="descending"),p({key:e,direction:s})},S=e=>m.key===e?"ascending"===m.direction?" ↑":" ↓":"",L=Math.ceil(C.length/g),R=(j-1)*g,D=R+g,A=C.slice(R,D);return(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsxs)(d.Zb,{children:[(0,r.jsxs)("div",{className:"flex items-center justify-between p-4",children:[(0,r.jsx)("h3",{className:"text-lg font-semibold",children:"Cluster Jobs"}),a&&(0,r.jsxs)("div",{className:"flex items-center mr-2",children:[(0,r.jsx)(i.Z,{size:15,className:"mt-0"}),(0,r.jsx)("span",{className:"ml-2 text-gray-500 text-sm",children:"Loading..."})]})]}),(0,r.jsxs)(u.iA,{children:[(0,r.jsx)(u.xD,{children:(0,r.jsxs)(u.SC,{children:[(0,r.jsxs)(u.ss,{className:"sortable whitespace-nowrap",onClick:()=>_("id"),children:["ID",S("id")]}),(0,r.jsxs)(u.ss,{className:"sortable whitespace-nowrap",onClick:()=>_("job"),children:["Name",S("job")]}),(0,r.jsxs)(u.ss,{className:"sortable whitespace-nowrap",onClick:()=>_("user"),children:["User",S("user")]}),(0,r.jsxs)(u.ss,{className:"sortable whitespace-nowrap",onClick:()=>_("workspace"),children:["Workspace",S("workspace")]}),(0,r.jsxs)(u.ss,{className:"sortable whitespace-nowrap",onClick:()=>_("submitted_at"),children:["Submitted",S("submitted_at")]}),(0,r.jsxs)(u.ss,{className:"sortable whitespace-nowrap",onClick:()=>_("job_duration"),children:["Duration",S("job_duration")]}),(0,r.jsxs)(u.ss,{className:"sortable whitespace-nowrap",onClick:()=>_("status"),children:["Status",S("status")]}),(0,r.jsxs)(u.ss,{className:"sortable whitespace-nowrap",onClick:()=>_("resources"),children:["Resources",S("resources")]}),(0,r.jsx)(u.ss,{className:"whitespace-nowrap",children:"Logs"})]})}),(0,r.jsx)(u.RM,{children:A.length>0?A.map(e=>(0,r.jsxs)(n.Fragment,{children:[(0,r.jsxs)(u.SC,{className:l===e.id?"selected-row":"",children:[(0,r.jsx)(u.pj,{children:(0,r.jsx)(c(),{href:"/clusters/".concat(s,"/").concat(e.id),className:"text-blue-600",children:e.id})}),(0,r.jsx)(u.pj,{children:(0,r.jsx)(c(),{href:"/clusters/".concat(s,"/").concat(e.id),className:"text-blue-600",children:(0,r.jsx)(M,{text:e.job||"Unnamed job",rowId:e.id,expandedRowId:l,setExpandedRowId:x})})}),(0,r.jsx)(u.pj,{children:e.user}),(0,r.jsx)(u.pj,{children:(0,r.jsx)(c(),{href:"/workspaces",className:"text-blue-600 hover:underline",children:e.workspace||"default"})}),(0,r.jsx)(u.pj,{children:E(e.submitted_at)}),(0,r.jsx)(u.pj,{children:(0,h.LU)(e.job_duration)}),(0,r.jsx)(u.pj,{children:(0,r.jsx)(v.OE,{status:e.status})}),(0,r.jsx)(u.pj,{children:e.resources}),(0,r.jsx)(u.pj,{className:"flex content-center items-center",children:(0,r.jsx)(O,{jobParent:"/clusters/".concat(s),jobId:e.id,managed:!1})})]}),l===e.id&&(0,r.jsx)(I,{text:e.job||"Unnamed job",colSpan:9,innerRef:w})]},e.id)):(0,r.jsx)(u.SC,{children:(0,r.jsx)(u.pj,{colSpan:9,className:"text-center py-6 text-gray-500",children:"No jobs found"})})})]})]}),C.length>0&&(0,r.jsx)("div",{className:"flex justify-end items-center py-2 px-4 text-sm text-gray-700",children:(0,r.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,r.jsxs)("div",{className:"flex items-center",children:[(0,r.jsx)("span",{className:"mr-2",children:"Rows per page:"}),(0,r.jsxs)("div",{className:"relative inline-block",children:[(0,r.jsxs)("select",{value:g,onChange:e=>{b(parseInt(e.target.value,10)),f(1)},className:"py-1 pl-2 pr-6 appearance-none outline-none cursor-pointer border-none bg-transparent",style:{minWidth:"40px"},children:[(0,r.jsx)("option",{value:5,children:"5"}),(0,r.jsx)("option",{value:10,children:"10"}),(0,r.jsx)("option",{value:20,children:"20"}),(0,r.jsx)("option",{value:50,children:"50"})]}),(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 text-gray-500 absolute right-0 top-1/2 transform -translate-y-1/2 pointer-events-none",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})]}),(0,r.jsxs)("div",{children:[R+1," – ",Math.min(D,C.length)," of"," ",C.length]}),(0,r.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,r.jsx)(o.z,{variant:"ghost",size:"icon",onClick:()=>{f(e=>Math.max(e-1,1))},disabled:1===j,className:"text-gray-500 h-8 w-8 p-0",children:(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"chevron-left",children:(0,r.jsx)("path",{d:"M15 18l-6-6 6-6"})})}),(0,r.jsx)(o.z,{variant:"ghost",size:"icon",onClick:()=>{f(e=>Math.min(e+1,L))},disabled:j===L||0===L,className:"text-gray-500 h-8 w-8 p-0",children:(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"chevron-right",children:(0,r.jsx)("path",{d:"M9 18l6-6-6-6"})})})]})]})})]})}function I(e){let{text:s,colSpan:t,innerRef:n}=e;return(0,r.jsx)(u.SC,{className:"expanded-details",children:(0,r.jsx)(u.pj,{colSpan:t,children:(0,r.jsx)("div",{className:"p-4 bg-gray-50 rounded-md border border-gray-200",ref:n,children:(0,r.jsx)("div",{className:"flex justify-between items-start",children:(0,r.jsxs)("div",{className:"flex-1",children:[(0,r.jsx)("p",{className:"text-sm font-medium text-gray-900",children:"Full Details"}),(0,r.jsx)("p",{className:"mt-1 text-sm text-gray-700",style:{whiteSpace:"pre-wrap"},children:s})]})})})})})}function M(e){let{text:s,rowId:t,expandedRowId:a,setExpandedRowId:l}=e,c=s.length>50,i=a===t,o=c?"".concat(s.substring(0,50)):s,d=(0,n.useRef)(null);return(0,r.jsxs)("div",{className:"truncated-details relative max-w-full flex items-center",children:[(0,r.jsx)("span",{className:"truncate",children:o}),c&&(0,r.jsx)("button",{ref:d,type:"button",onClick:e=>{e.preventDefault(),e.stopPropagation(),l(i?null:t)},className:"text-blue-600 hover:text-blue-800 font-medium ml-1 flex-shrink-0","data-button-type":"show-more-less",children:i?"... show less":"... show more"})]})}},8969:function(e,s,t){t.d(s,{Ce:function(){return o},NJ:function(){return i},Pr:function(){return c},Vp:function(){return l}});var r=t(7294),n=t(5821),a=t(3225);async function l(){let{allUsers:e=!0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{let s=(await fetch("".concat(a.f4,"/jobs/queue"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({all_users:e})})).headers.get("X-Skypilot-Request-ID"),t=await fetch("".concat(a.f4,"/api/get?request_id=").concat(s));if(500===t.status){try{let e=await t.json();if(e.detail&&e.detail.error)try{let s=JSON.parse(e.detail.error);if(s.type&&s.type===a.iW)return{jobs:[],controllerStopped:!0}}catch(e){console.error("Error parsing JSON:",e)}}catch(e){console.error("Error parsing JSON:",e)}return{jobs:[],controllerStopped:!1}}let r=await t.json();return{jobs:(r.return_value?JSON.parse(r.return_value):[]).map(e=>{let s=[];e.submitted_at&&s.push({time:new Date(1e3*e.submitted_at),event:"Job submitted."}),e.start_at&&s.push({time:new Date(1e3*e.start_at),event:"Job started."}),e.end_at&&("CANCELLING"==e.status||"CANCELLED"==e.status?s.push({time:new Date(1e3*e.end_at),event:"Job cancelled."}):s.push({time:new Date(1e3*e.end_at),event:"Job completed."})),e.last_recovered_at&&e.last_recovered_at!=e.start_at&&s.push({time:new Date(1e3*e.last_recovered_at),event:"Job recovered."});let t=(e.end_at?e.end_at:Date.now()/1e3)-e.submitted_at,r=e.cloud,n=e.cluster_resources;if(!r){if(e.cluster_resources&&"-"!==e.cluster_resources)try{r=e.cluster_resources.split("(")[0].split("x").pop().trim(),n=e.cluster_resources.replace("".concat(r,"("),"(").replace("x ","x")}catch(e){r="Unknown"}else r="Unknown"}let a="",l=a=e.zone?e.zone:e.region;a&&a.length>15&&(a=a.substring(0,15)+"...");let c=r+" ("+a+")";"-"===a&&(c=r);let i=r+" ("+l+")";return"-"===l&&(i=r),{id:e.job_id,task:e.task_name,name:e.job_name,job_duration:e.job_duration,total_duration:t,workspace:e.workspace,status:e.status,requested_resources:e.resources,resources_str:n,resources_str_full:e.cluster_resources_full||n,cloud:r,infra:c,full_infra:i,recoveries:e.recovery_count,details:e.failure_reason,user:e.user_name,user_hash:e.user_hash,submitted_at:e.submitted_at?new Date(1e3*e.submitted_at):null,events:s}}),controllerStopped:!1}}catch(e){return console.error("Error fetching managed job data:",e),{jobs:[],controllerStopped:!1}}}function c(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,[s,t]=(0,r.useState)(null),[n,a]=(0,r.useState)(!0);return(0,r.useEffect)(()=>{(async function(){try{a(!0);let e=await l({allUsers:!0});t(e)}catch(e){console.error("Error fetching managed job data:",e)}finally{a(!1)}})()},[e]),{jobData:s,loading:n}}async function i(e){let{jobId:s,controller:t=!1,signal:r,onNewLog:l}=e,c=new Promise(e=>{setTimeout(()=>{e({timeout:!0})},1e4)}),i=(async()=>{try{let e=(await fetch("".concat(a.f4,"/jobs/logs"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({controller:t,follow:!1,job_id:s}),...r?{signal:r}:{}})).body.getReader();try{for(;;){let{done:s,value:t}=await e.read();if(s)break;let r=new TextDecoder().decode(t);l(r)}}finally{e.cancel()}return{timeout:!1}}catch(e){if("AbortError"===e.name)return{timeout:!1};throw e}})();if((await Promise.race([i,c])).timeout){(0,n.C)("Log request for job ".concat(s," timed out after ").concat(1e4,"ms"),"error");return}}async function o(e,s,t){let r="",l="",c="",i={};if("restartcontroller"===e)r="Restarting",l="restarted",c="jobs/queue",i={all_users:!0,refresh:!0},s="controller";else throw Error("Invalid action: ".concat(e));(0,n.C)("".concat(r," job ").concat(s,"..."),"info");try{try{let e=(await fetch("".concat(a.f4,"/").concat(c),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)})).headers.get("X-Skypilot-Request-ID"),o=await fetch("".concat(a.f4,"/api/get?request_id=").concat(e));if(200===o.status)(0,n.C)("Job ".concat(s," ").concat(l," successfully."),"success");else if(500===o.status)try{let e=await o.json();if(e.detail&&e.detail.error)try{let l=JSON.parse(e.detail.error);l.type&&l.type===a.Bo?(0,n.C)("".concat(r," job ").concat(s," is not supported!"),"error",1e4):l.type&&l.type===a.mF?(0,n.C)("Cluster ".concat(t," does not exist."),"error"):l.type&&l.type===a.iW?(0,n.C)("Cluster ".concat(t," is not up."),"error"):(0,n.C)("".concat(r," job ").concat(s," failed: ").concat(l.type),"error")}catch(t){(0,n.C)("".concat(r," job ").concat(s," failed: ").concat(e.detail.error),"error")}else(0,n.C)("".concat(r," job ").concat(s," failed with no details."),"error")}catch(e){(0,n.C)("".concat(r," job ").concat(s," failed with parse error."),"error")}else(0,n.C)("".concat(r," job ").concat(s," failed with status ").concat(o.status,"."),"error")}catch(e){console.error("Fetch error:",e),(0,n.C)("Network error ".concat(r," job ").concat(s,": ").concat(e.message),"error")}}catch(e){console.error("Error in handleStop:",e),(0,n.C)("Critical error ".concat(r," job ").concat(s,": ").concat(e.message),"error")}}}}]);
|