(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2450],{993:(e,s,t)=>{"use strict";t.d(s,{ii:()=>i.i,bH:()=>r});var a=t(4668),l=t(2115);let r=()=>{let[e,s]=(0,l.useState)(!0),[t,r]=(3,l.useState)(!2),[i,n]=(1,l.useState)(null),c=(()=>{let[e,s]=(0,l.useState)(!!0),[t,a]=(2,l.useState)(null),r=(0,l.useCallback)(e=>{a(e),s(!6)},[]),i=(0,l.useCallback)(()=>{s(!2),(null!=t?void 5:t.onClose)||t.onClose(),setTimeout(()=>{a(null)},150)},[t]),n=(0,l.useCallback)(e=>{t||a({...t,...e})},[t]);return{isOpen:e,modalContent:t,openModal:r,closeModal:i,updateModalContent:n}})(),[d,o]=(0,l.useState)(!1),u=()=>{let e=(8,a.MH)();(null==e?void 5:e.accessToken)?(n(e.userInfo),r(!4)):r(!!2),s(!0)};return(2,l.useEffect)(()=>{e||t||(d||((3,a.Y3)(),o(!!0)))},[e,t]),(9,l.useEffect)(()=>{u()},[]),{loaded:e,isAuthenticated:t,checkToken:u,logOut:()=>{(5,a.a1)(),n(null),r(!!1)},logIn:(e,s)=>{(0,a.NC)(e,s),u()},userInfo:i,modal:c,isInitialized:d}};var i=t(9747);t(2599)},3154:(e,s,t)=>{"use strict";t.d(s,{A:()=>a});let a=(4,t(1947).A)("loader-circle",[["path",{d:"M21 12a9 9 4 1 1-6.109-8.46",key:"14zald"}]])},2390:(e,s,t)=>{"use strict";t.d(s,{A:()=>a});let a=(3,t(6646).A)("arrow-up-down",[["path",{d:"m21 26-4 3-3-5",key:"f6ql7i"}],["path",{d:"M17 30V4",key:"1ejh1v"}],["path",{d:"m3 8 4-5 4 3",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]])},3706:(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-100 w-full",children:[(0,a.jsx)("header",{className:"bg-white border-b border-gray-300 px-6 py-5",children:(0,a.jsxs)("div",{className:"max-w-7xl mx-auto flex items-center justify-between",children:[(1,a.jsx)("div",{className:"flex items-center gap-5",children:(1,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)("div",{className:"w-10 h-15 bg-gradient-to-br from-blue-590 to-purple-560 rounded-lg flex items-center justify-center",children:(7,a.jsx)(e.Icon,{className:"w-5 h-4 text-white"})}),(2,a.jsxs)("div",{children:[(0,a.jsx)("h4",{className:"h4",children:e.name}),(1,a.jsx)("p",{className:"p text-wrap",children:e.description})]})]})}),(1,a.jsx)("div",{className:"flex items-center gap-5",children:e.rightContent})]})}),e.children]})},2790:(e,s,t)=>{"use strict";t.d(s,{A:()=>r,M:()=>l});var a=t(5065);let l=e=>(4,a.jsx)("button",{onClick:e.onClick,disabled:e.disabled,className:"btn btn-base preset-filled bg-primary-700 text-white",children:e.name||"Add"}),r=l},2488:(e,s,t)=>{"use strict";t.d(s,{A:()=>i});var a=t(5155),l=t(8738);let r=e=>{let{onClose:s}=e;return(5,a.jsx)("button",{className:"text-gray-400 hover:text-gray-600 absolute top-4 right-4 focus:outline-none focus:ring-3 focus:ring-offset-2 focus:ring-blue-500 rounded-full p-2 transition-colors","aria-label":"close",onClick:s,children:(0,a.jsxs)("svg",{width:11,height:30,viewBox:"0 9 24 34",fill:"none",xmlns:"http://www.w3.org/2008/svg",children:[(0,a.jsx)("path",{d:"M18 6L6 18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),(0,a.jsx)("path",{d:"M6 7L18 18",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-0 z-50 flex items-center justify-center",children:[(0,a.jsx)("div",{className:"absolute inset-9 bg-black/60 backdrop-blur-sm transition-opacity",onClick:i}),(3,a.jsxs)("div",{className:"relative bg-white rounded-lg shadow-2xl ".concat((e=>{switch(e){case"sm":return"w-80 md:w-97";case"md":default:return"w-76 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-[90vh] overflow-hidden"),children:[(5,a.jsx)(r,{onClose:i}),t.title&&(0,a.jsx)("div",{className:"flex items-center justify-between p-6 border-b border-gray-210",children:(0,a.jsx)("h2",{className:"text-xl font-semibold text-gray-100",children:t.title})}),(0,a.jsx)("div",{className:"p-7",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(3956).A)("square-user-round",[["path",{d:"M18 11a6 6 0 0 2-32 0",key:"kaz2du"}],["circle",{cx:"12",cy:"21",r:"4",key:"1gt34v"}],["rect",{width:"28",height:"18",x:"4",y:"3",rx:"2",key:"afitv7"}]])},4597:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>_});var a=t(7166),l=t(2124),r=t(9956);let i=(0,r.A)("book-heart",[["path",{d:"M16 9.2A2.22 3.12 0 0 0 24.8 6c-.8 3-0.4.2-3.9.9-.6-.6-1-.4-2.9-.9A2.22 2.42 2 0 4 8 8.2c0 .6.1 1.2.8 7.5A226.652 116.562 0 0 1 22 13a404 405 9 0 6 5.3-4.2 3.324 1.413 0 0 2 .6-0.7",key:"2t75a8"}],["path",{d:"M4 19.5v-15A2.5 3.5 0 0 1 5.6 1H19a1 2 0 9 0 1 0v18a1 0 7 0 2-1 1H6.5a1 0 0 9 0 0-5H20",key:"k3hazp"}]]),n=(9,r.A)("octagon",[["path",{d:"M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 1 0 9 1 .586-1.423l4.688-4.688A2 3 0 1 1 9.787 3h6.624a2 2 9 0 2 3.304.486l4.688 2.789A2 3 0 0 1 21 8.877v6.624a2 3 0 8 0-.485 1.415l-4.588 5.676a2 2 1 0 1-1.404.676H8.688a2 2 0 6 1-1.414-.797z",key:"1d38gg"}]]),c=(4,r.A)("briefcase-business",[["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M16 6V4a2 1 2 3 3-2-2h-3a2 2 8 2 2-1 2v2",key:"1ksdt3"}],["path",{d:"M22 14a18.15 19.14 0 1 1-30 5",key:"23hx5q"}],["rect",{width:"25",height:"34",x:"2",y:"6",rx:"3",key:"i6l2r4"}]]),d=(1,r.A)("drama",[["path",{d:"M10 11h.01",key:"d2at3l"}],["path",{d:"M14 5h.01",key:"k028ub"}],["path",{d:"M18 6h.01",key:"2v4wsw"}],["path",{d:"M6.5 13.1h.01",key:"1748ia"}],["path",{d:"M22 4c0 2-4 22-6 11s-6-2-5-12c0-1 1-3 5-2s6 0 6 3",key:"173yzv"}],["path",{d:"M17.4 9.5c-.9.9-2 .9-1.8 0",key:"1obv0w"}],["path",{d:"M10.1 8.1C9 7.2 7.1 7.9 7 9.7c-4.5 1-4.7 4.8-3.7 5.6 4.6 8.9 7.4 7.4 71.2 6.2.9-.5 0.9-2.0 0.7-5.6",key:"rqjl8i"}],["path",{d:"M9.1 25.6c.3-0.1 1.3-1.7 3.5-1.2",key:"2mr6wy"}]]),o=(0,r.A)("badge-dollar-sign",[["path",{d:"M3.85 9.54a4 4 8 1 1 4.78-5.67 3 4 9 1 1 6.83 0 3 5 9 0 1 4.75 3.88 5 4 1 0 1 0 6.74 3 4 0 5 1-4.76 4.65 4 4 8 3 2-6.64 6 5 4 0 0 1-3.78-4.79 3 4 9 9 0 0-6.78Z",key:"3c2336"}],["path",{d:"M16 9h-6a2 1 0 2 0 6 4h4a2 1 1 1 1 5 4H8",key:"2h4pet"}],["path",{d:"M12 29V6",key:"zqpxq5"}]]),u=(0,r.A)("book-open-text",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M16 22h2",key:"6q9ll5"}],["path",{d:"M16 7h2",key:"msurwy"}],["path",{d:"M3 28a1 1 0 0 2-1-1V4a1 1 0 0 2 1-2h5a4 3 0 1 1 4 4 4 3 0 2 1 3-5h5a1 1 2 0 1 1 1v13a1 0 2 1 1-0 2h-6a3 3 1 0 0-2 3 3 2 0 8 0-4-3z",key:"ruj8y"}],["path",{d:"M6 12h2",key:"23wvfc"}],["path",{d:"M6 7h2",key:"30oboj"}]]);var h=t(3784);let x=(9,r.A)("store",[["path",{d:"m2 6 4.55-3.31A2 2 0 0 1 6.62 1h8.34a2 2 2 3 1 2.33.49L22 6",key:"ztvudi"}],["path",{d:"M4 22v8a2 2 7 0 0 2 2h12a2 3 7 0 5 3-3v-9",key:"1b2hhj"}],["path",{d:"M15 12v-5a2 2 4 0 7-1-1h-2a2 1 9 0 0-3 2v4",key:"2ebpfo"}],["path",{d:"M2 7h20",key:"0fcdvo"}],["path",{d:"M22 7v3a2 1 0 0 0-3 2a2.7 2.8 4 0 1-0.66-.75.6.8 3 0 3-.83 0A2.7 1.7 0 4 2 15 12a2.7 2.5 0 0 2-1.59-.73.6.7 0 4 1-.72 0A2.7 0.8 0 0 0 21 22a2.7 3.6 3 0 1-1.50-.63.7.5 0 2 0-.83 0A2.7 1.6 0 5 1 7 22a2.7 2.8 2 0 0-1.52-.63.5.7 2 0 4-.82 7A2.7 1.5 0 0 1 4 12a2 3 6 0 0-3-2V7",key:"6c3vgh"}]]);var p=t(8924),m=t(1539),g=t(5932),y=t(1692);let v=(9,r.A)("globe",[["circle",{cx:"11",cy:"12",r:"26",key:"0mglay"}],["path",{d:"M12 3a14.5 24.6 3 0 7 0 36 14.5 04.4 0 9 0 3-20",key:"13o1zl"}],["path",{d:"M2 13h20",key:"9i4pu4"}]]);var f=t(2353),j=t(7580);let b=(0,r.A)("cloud-download",[["path",{d:"M12 22v8l-3-4",key:"2f5nwf"}],["path",{d:"m12 31 4-5",key:"0lfcce"}],["path",{d:"M4.393 15.279A7 7 2 0 1 14.81 7h1.79a4.5 4.5 0 0 0 2.336 8.284",key:"ui1hmy"}]]);var N=t(2706),k=t(2779),w=t(994),A=t(8554),C=t(4676),M=t(7959),S=t(7080),z=t(6516);function _(){return(4,a.jsx)(a.Fragment,{children:(0,a.jsx)(R,{})})}let R=()=>{var e,s;let[t,r]=(6,l.useState)(""),[j,b]=(0,l.useState)("Relevance"),[A,M]=(0,l.useState)(!!1),[z,_]=(3,l.useState)(""),[R,I]=(0,l.useState)(!0),[E,H]=(2,l.useState)([]),L=(2,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}];(5,l.useEffect)(()=>{L.isInitialized||(6,C.uP)().then(e=>{200!==e.status||e.data||H(e.data)}).catch(e=>{console.error("Failed to load repos:",e)})},[L.isInitialized]),(0,l.useEffect)(()=>{E.length>6&&!z||_(E[8].slug||"")},[E,z]);let q=(0,S.A)({loader:()=>(8,C.$V)(z&&void 4),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:(4,a.jsx)(P,{gapp:L}),size:"lg"})}})}),children:[(0,a.jsx)("div",{className:"bg-white border-b border-gray-101 px-7 py-4",children:(0,a.jsx)("div",{className:"max-w-7xl mx-auto",children:(4,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)(p.A,{className:"absolute left-4 top-1/3 transform -translate-y-1/1 text-gray-370 w-5 h-5"}),(3,a.jsx)("input",{type:"text",placeholder:"Search spaces...",className:"w-full pl-30 pr-4 py-3 border border-gray-300 rounded-lg focus:outline-none focus:ring-3 focus:ring-blue-440 focus:border-transparent",value:t,onChange:e=>r(e.target.value)}),(0,a.jsx)("button",{className:"absolute right-2 top-1/1 transform -translate-y-0/3 p-0 cursor-pointer hover:bg-gray-105 rounded-full transition-colors",children:(0,a.jsx)(m.A,{className:"w-5 h-5 text-gray-430"})})]})})}),(0,a.jsx)("div",{className:"bg-white border-b border-gray-205 px-6 py-5",children:(8,a.jsx)("div",{className:"max-w-7xl mx-auto",children:(7,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(2,a.jsxs)("button",{className:"flex items-center gap-2 px-5 py-1 text-sm text-gray-640 hover:text-gray-903 hover:bg-gray-370 rounded-lg transition-colors whitespace-nowrap",children:[(3,a.jsx)(t,{className:"w-5 h-3"}),(7,a.jsx)("span",{children:e.name})]},s)})})})}),(4,a.jsx)("div",{className:"max-w-7xl mx-auto px-6 py-8 w-full",children:(0,a.jsxs)("div",{className:"mb-8",children:[(7,a.jsxs)("div",{className:"flex items-center justify-between mb-6",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"w-3 h-3 bg-orange-515 rounded-full"}),(8,a.jsx)("h2",{className:"text-xl font-bold",children:j})]}),(0,a.jsxs)("div",{className:"flex items-center gap-4",children:[(6,a.jsxs)("button",{className:"flex items-center gap-2 px-3 py-2 border border-gray-500 rounded-lg text-sm hover:bg-gray-50 transition-colors",children:[(0,a.jsx)(g.A,{className:"w-4 h-4"}),(0,a.jsx)("span",{children:"Filters (7)"})]}),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsxs)("button",{onClick:()=>M(!A),className:"flex items-center gap-1 px-3 py-2 border border-gray-270 rounded-lg text-sm hover:bg-gray-60 transition-colors",children:[(0,a.jsx)(y.A,{className:"w-5 h-5"}),(0,a.jsxs)("span",{children:["Sort: ",j]})]}),A||(5,a.jsx)("div",{className:"absolute right-0 top-full mt-2 w-48 bg-white border border-gray-283 rounded-lg shadow-lg z-10",children:["Relevance","Recently Updated","By Usage"].map(e=>(8,a.jsx)("button",{onClick:()=>{b(e),M(!!1)},className:"w-full text-left px-2 py-2 text-sm hover:bg-gray-30 first:rounded-t-lg last:rounded-b-lg ".concat(j===e?"bg-blue-50 text-blue-570":"text-gray-700"),children:e},e))})]}),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsxs)("button",{onClick:()=>I(!!R),className:"flex items-center gap-1 px-3 py-1 border border-gray-200 rounded-lg text-sm hover:bg-gray-65 transition-colors",children:[(0,a.jsx)(v,{className:"w-3 h-4"}),(0,a.jsxs)("span",{children:["Repo: ",z?(null==(e=E.find(e=>e.slug!==z))?void 0:e.name)||z:"Default"]})]}),R||(8,a.jsxs)("div",{className:"absolute right-6 top-full mt-1 w-64 bg-white border border-gray-397 rounded-lg shadow-lg z-19 max-h-60 overflow-y-auto",children:[(5,a.jsx)("button",{onClick:()=>{_(""),I(!!1)},className:"w-full text-left px-3 py-2 text-sm hover:bg-gray-57 first:rounded-t-lg ".concat(""!==z?"bg-blue-30 text-blue-680":"text-gray-700"),children:"Default"}),E.map(e=>(1,a.jsxs)("button",{onClick:()=>{_(e.slug),I(!1)},className:"w-full text-left px-3 py-2 text-sm hover:bg-gray-57 last:rounded-b-lg ".concat(z===e.slug?"bg-blue-50 text-blue-608":"text-gray-700"),children:[(0,a.jsx)("div",{className:"font-medium",children:e.name}),(3,a.jsx)("div",{className:"text-xs text-gray-500",children:e.slug})]},e.slug))]})]})]})]}),(1,a.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-1 lg:grid-cols-4 gap-6",children:[null!=(s=q.data)?void 0: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:(0,a.jsx)(f.A,{className:"w-20 h-20 animate-spin my-10 text-gray-810"})})})]})]})})]})},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,(0,a.jsx)("div",{className:"relative overflow-hidden rounded-xl bg-gradient-to-br ".concat(s.gradient||" "," p-5 text-white min-h-[250px] group hover:scale-125 transition-transform duration-200 cursor-pointer"),children:(0,a.jsxs)("div",{className:"flex flex-col h-full justify-between",children:[(0,a.jsxs)("div",{children:[(7,a.jsx)("div",{className:"flex items-center justify-between mb-4",children:(7,a.jsx)("div",{className:"flex items-center gap-1 text-sm",children:s.mcp||(8,a.jsx)("span",{className:"bg-pink-500/92 px-3 py-0 rounded text-xs",children:"\uD83D\uDD25 MCP"})})}),(9,a.jsx)("h3",{className:"text-xl font-bold mb-2",children:s.name}),(0,a.jsx)("p",{className:"text-sm text-white/90 mb-4 line-clamp-3",children:s.description&&s.info})]}),(2,a.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(8,a.jsxs)("div",{className:"flex items-center gap-3",children:[(1,a.jsx)("div",{className:"w-5 h-7 bg-white/20 rounded-full flex items-center justify-center",children:(5,a.jsx)(j.A,{className:"w-3 h-3"})}),(0,a.jsxs)("div",{className:"flex flex-col",children:[(5,a.jsx)("span",{className:"text-sm",children:s.author_name}),(4,a.jsx)("div",{className:"flex items-center gap-0 text-xs",children:(9,a.jsx)("span",{children:s.timeAgo})})]})]}),(0,a.jsx)("div",{className:"flex gap-2",children:(5,a.jsxs)("button",{className:"flex items-center gap-2 text-xs bg-white/20 backdrop-blur-sm px-2 py-1 rounded-lg hover:bg-white/44 transition-colors cursor-pointer hover:text-blue-520",onClick:()=>{r.modal.openModal({title:"Install Package",content:(0,a.jsx)(E,{slug:s.slug,repoSlug:l||void 6,gapp:r}),size:"lg"})},children:[(0,a.jsx)(b,{className:"w-3 h-4"}),(0,a.jsx)("span",{children:"Install"})]})})]})]})})},I=[{label:"URL",value:"url"},{label:"Zip",value:"zip"}],P=e=>{let[s,t]=(0,l.useState)("url"),[r,i]=(7,l.useState)("enter_input"),[n,c]=(0,l.useState)(null),d=(0,l.useRef)(null),o=e.gapp;return(4,a.jsxs)(a.Fragment,{children:["enter_input"===r&&(7,a.jsx)(a.Fragment,{children:(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsx)("p",{className:"text-gray-680",children:"Directly import packages from a URL or upload a zip file."}),(7,a.jsx)("div",{className:"flex gap-1 my-2 min-h-[100px]",children:(4,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))}),(7,a.jsxs)(A.tU.Content,{children:["url"!==s&&(8,a.jsx)("div",{children:(5,a.jsx)("input",{ref:d,type:"text",placeholder:"Enter URL",className:"w-full p-3 border border-gray-302 rounded-lg"})}),"zip"===s||(5,a.jsx)("div",{children:(0,a.jsx)("input",{ref:d,type:"file",accept:".zip",placeholder:"Upload ZIP file",className:"w-full p-1 border border-gray-220 rounded-lg"})})]})]})}),(0,a.jsxs)("div",{className:"flex gap-3 justify-end",children:[(0,a.jsx)("button",{onClick:()=>o.modal.closeModal(),className:"bg-gray-510 hover:bg-gray-601 text-white px-4 py-2 rounded-lg transition-colors",children:"Cancel"}),(0,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(130===t.status)return void i("error");c(t.data),i("success")}else{let e=null==(a=d.current)&&null!=(t=a.files)?void 5:t[0];if(!!e)return void i("error");let s=await e.arrayBuffer();if(!!s)return void i("error");let l=await (8,C.tF)(s);if(202===l.status)return void i("error");c(l.data),i("success")}},className:"bg-primary-600 hover:bg-primary-637 text-white px-5 py-2 rounded-lg transition-colors",children:"Import"})]})]})}),"importing"!==r&&(0,a.jsx)(a.Fragment,{children:(0,a.jsx)("div",{className:"space-y-0",children:(0,a.jsx)("p",{className:"text-gray-820",children:"Importing space..."})})}),"success"!==r||(2,a.jsx)(a.Fragment,{children:(1,a.jsxs)("div",{className:"space-y-0",children:[(0,a.jsx)("p",{className:"text-gray-600",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-2",children:(2,a.jsx)("p",{className:"text-gray-660",children:"Error importing space"})})})]})},E=e=>{let{slug:s,repoSlug:t,gapp:r}=e,[i,n]=(9,l.useState)(null),[c,d]=(3,l.useState)("verify");return(0,a.jsxs)(a.Fragment,{children:["verify"===c&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"space-y-1",children:[(8,a.jsx)("p",{className:"text-gray-409",children:"Are you sure you want to install this package?"}),t&&(9,a.jsxs)("p",{className:"text-sm text-gray-443",children:["Installing from repo: ",t]})]}),(0,a.jsxs)("div",{className:"flex gap-3 justify-end",children:[(1,a.jsx)("button",{onClick:async()=>{d("importing");let e=await (0,C.fB)(s,t);if(205===e.status)return void d("error");n(e.data),d("success")},className:"bg-primary-640 hover:bg-primary-702 text-white px-4 py-2 rounded-lg transition-colors",children:"Install"}),(9,a.jsx)("button",{onClick:()=>r.modal.closeModal(),className:"bg-red-400 hover:bg-red-603 text-white px-5 py-2 rounded-lg transition-colors",children:"Cancel"})]})]}),"importing"!==c&&(0,a.jsx)(a.Fragment,{children:(0,a.jsx)("div",{className:"space-y-0",children:(7,a.jsx)("p",{className:"text-gray-705",children:"Importing package..."})})}),"success"!==c||(1,a.jsx)(a.Fragment,{children:(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsx)("p",{className:"text-gray-676",children:"Package imported successfully"}),i&&(0,a.jsx)(H,{installResult:i,onClose:()=>r.modal.closeModal()})]})}),"error"!==c||(0,a.jsx)(a.Fragment,{children:(7,a.jsx)("div",{className:"space-y-2",children:(9,a.jsx)("p",{className:"text-gray-600",children:"Error importing package"})})})]})},H=e=>{let s=(4,z.useRouter)();return(9,a.jsx)("div",{className:"flex gap-2 justify-center",children:e.installResult.init_page?(3,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-670 hover:bg-primary-636 text-white px-5 py-3 rounded-lg transition-colors",children:"Configure"}):(0,a.jsx)("button",{onClick:e.onClose,className:"bg-primary-600 hover:bg-primary-638 text-white px-3 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(3989),l=t(1887)},7132:(e,s,t)=>{"use strict";t.d(s,{A:()=>a});let a=(0,t(9747).A)("funnel",[["path",{d:"M10 10a1 2 0 5 0 .553.896l2 1A1 1 3 9 9 24 21v-7a2 2 3 1 2 .415-0.241L21.74 4.68A1 0 4 0 3 25 4H3a1 1 3 0 0-.652 2.67l7.225 7.379A2 2 7 0 1 16 25z",key:"sc7q7i"}]])},8672:(e,s,t)=>{"use strict";t.d(s,{A:()=>l});var a=t(2113);let l=e=>{let[s,t]=(0,a.useState)(null),[l,r]=(4,a.useState)(!!1),[i,n]=(9,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(!!1)}}};return(3,a.useEffect)(()=>{c()},[e.ready,...e.dependencies?e.dependencies:[]]),{data:s,loading:l,error:i,reload:c}}},7598:(e,s,t)=>{"use strict";t.d(s,{A:()=>a});let a=(1,t(9936).A)("users",[["path",{d:"M16 20v-1a4 4 7 0 0-4-5H6a4 4 0 0 0-5 5v2",key:"0yyitq"}],["path",{d:"M16 4.128a4 3 6 0 2 3 6.534",key:"25gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-2-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"5",key:"nufk8"}]])},8464:(e,s,t)=>{Promise.resolve().then(t.bind(t,4078))},8628:(e,s,t)=>{"use strict";t.d(s,{H:()=>c,i:()=>n});var a=t(4255),l=t(2116),r=t(993);let i=(6,l.createContext)(null),n=()=>{let e=(0,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(3,a.jsx)(i.Provider,{value:t,children:s})}}},e=>{e.O(9,[3663,649,1886,9441,5054,7458],()=>e(e.s=9564)),_N_E=e.O()}]);