1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2428],{25201:function(e,t,n){var a=n(24246),r=n(19762),c=n(70490),o=n(3753),i=n(55697),s=n(58910),u=n(27378),l=n(2750);t.Z=function(e){var t=e.category,n=e.config,d=e.title,p=e.mode,m=(0,c.nT)().model,f=(0,u.useMemo)(function(){return new r.w(m,n)},[n,m]);return(0,a.jsxs)(i.Z,{id:null!=t?t:"form",children:[d&&(0,a.jsx)(l.Z,{component:"span",variant:"h1",children:d}),"tabs"===p?(0,a.jsx)(o.default,{selection:f}):(0,a.jsx)(s.Z,{category:t,selection:f})]})}},76353:function(e,t,n){n.r(t);var a=n(15243),r=n(10426),c=n(12369),o=n(85556),i=n(24246),s=n(30306),u=n(79607),l=n(56325),d=n(29114),p=n(61642),m=n(87287),f=n(86677),h=n(95008),j=n(39281),y=n(64630),g=n(25201),v=n(55697),x=n(94598),b=n(61470),Z=n(27378),k=n(22215),w=n(72946);function C(){var e=(0,c._)(["\n width: 100%;\n display: flex;\n gap: ",";\n justify-content: center;\n"]);return C=function(){return e},e}var _=k.Z.div(C(),w.ZP.spacing(3));t.default=function(e){var t=e.onCancel,n=(0,f.useRouter)(),c=n.query.spaceId,k=n.replace,w=(0,h.$G)().t,C=(0,d.aC)().refreshWebToken,N=(0,r._)((0,Z.useState)(!1),2),S=N[0],T=N[1],V=(0,r._)((0,Z.useState)([]),1)[0],q=(0,m.Z)(),D=(0,r._)((0,Z.useState)(),2),E=(D[0],D[1]),M=(0,Z.useMemo)(function(){return{displayName:"Project",type:"project",props:{name:{displayName:w("Name"),defaultValue:"",type:"text",category:"info",required:!0,message:w("The project name is required")},description:{displayName:w("Description"),defaultValue:"<p><br/></p>",type:"html",category:"info"},authStrategy:{type:"picker",defaultValue:"restricted",displayName:w("Authentication Strategy"),options:[{label:w("Restricted"),value:"restricted"},{label:w("Open"),value:"open"}]}
1,media:{displayName:w("Background"),type:"media",landscape:!0}}}},[w]),P=(0,p.h)(function(){return new u.t({type:"project",data:{}})});(0,Z.useEffect)(function(){return P.subscribeToDataChange(function(e){var t=e.newValue;t&&t.data&&E(null==t?void 0:t.data)})},[P]);var W=(0,Z.useCallback)((0,a._)(function(){var e,t,n;return(0,o.Jh)(this,function(a){switch(a.label){case 0:T(!0),a.label=1;case 1:return a.trys.push([1,4,,5]),[4,q.createProject({name:P.component.data.name,description:P.component.data.description,authStrategy:P.component.data.authStrategy,media:P.component.data.media,keyWords:V.reduce(function(e,t){return e?"".concat(e,", ").concat(t):t},"")})];case 2:return e=a.sent(),[4,C()];case 3:return a.sent(),k(t="/".concat(c,"/").concat(e._id,"/"),t,{shallow:!0}),[3,5];case 4:return n=a.sent(),T(!1),(0,j.p)(n,function(e){alert(e.message)}),console.error(n),[3,5];case 5:return[2]}})}),[V,P.component.data.authStrategy,P.component.data.description,P.component.data.media,P.component.data.name,q,C,k,c]),R=(0,Z.useCallback)(function(e){e.preventDefault(),null==t||t()},[t]);return S?(0,i.jsx)(v.Z,{id:"project-form",maxWidth:!0,title:w("creating-project"),children:(0,i.jsx)(b.Z,{loaderTitle:""})}):(0,i.jsxs)(v.Z,{id:"project-form",title:w("create-project"),children:[(0,i.jsx)(s.K,{model:P,children:(0,i.jsx)(l.j,{children:(0,i.jsx)(g.Z,{config:M})})}),(0,i.jsx)(x.Z,{withTopMargin:!0,children:(0,i.jsxs)(_,{children:[(0,i.jsx)(y.Z,{onClick:R,children:w("Cancel")}),(0,i.jsx)(y.Z,{variant:"contained",disabled:""===P.component.data.name||void 0===P.component.data.name,onClick:W,children:w("create-project")})]})})]})}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.