(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[139],{67053:function(n,e,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/[...path]",function(){return r(65404)}])},65404:function(n,e,r){"use strict";r.r(e),r.d(e,{default:function(){return c}});var t=r(85893),l=r(67294),u=r(9008),i=r.n(u),o=r(11163),s=r(55739),a=r(23800);function c(){let n=(0,o.useRouter)(),e=(0,l.useRef)(null),[r,u]=(0,l.useState)(null),c=function(n){var e;let r=null==n?void 0:null===(e=n.query)||void 0===e?void 0:e.path;if(!r)return null;let t=(Array.isArray(r)?r:[r]).filter(Boolean);return t.length?"/".concat(t.join("/")):null}(n),d=(0,a.t6)(c),h=(0,a.t6)(c?"/plugins".concat(c):null),f=d||h;(0,l.useEffect)(()=>{let n;let r=e.current;if(f&&r){u(null);try{n=f.mount({container:r,route:f})}catch(n){console.error("[SkyDashboardPlugin] Failed to mount plugin route:",f.id,n),u("Failed to render the plugin page. Check the browser console for details.")}return()=>{if("function"==typeof n)try{n()}catch(n){console.warn("[SkyDashboardPlugin] Error during plugin route cleanup:",n)}else if(f.unmount)try{f.unmount({container:r,route:f})}catch(n){console.warn("[SkyDashboardPlugin] Error during plugin unmount:",n)}r&&(r.innerHTML="")}}},[f,c]);let g=(null==f?void 0:f.title)?"".concat(f.title," | SkyPilot Dashboard"):"Plugin | SkyPilot Dashboard";return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(i(),{children:(0,t.jsx)("title",{children:g})}),(0,t.jsx)("div",{className:"min-h-[50vh]",children:r?(0,t.jsx)("div",{className:"max-w-3xl mx-auto p-6 bg-red-50 text-red-700 rounded-lg border border-red-200",children:r}):(0,t.jsxs)(t.Fragment,{children:[!f&&(0,t.jsxs)("div",{className:"flex justify-center items-center h-64",children:[(0,t.jsx)(s.Z,{size:20}),(0,t.jsx)("span",{className:"ml-2 text-gray-500",children:n.isReady?"Loading plugin resources...":"Preparing plugin route..."})]}),(0,t.jsx)("div",{ref:e})]})})]})}},9008:function(n,e,r){n.exports=r(37219)}},function(n){n.O(0,[739,888,774,179],function(){return n(n.s=67053)}),_N_E=n.O()}]);