1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5103],{83286:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/client-admin/cohorts/edit/[id]",function(){return n(8096)}])},1745:function(e,t,n){"use strict";var a=n(96415),r=n(52676);t.Z=(0,a.Z)((0,r.jsx)("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z"}),"Add")},72401:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});let a=(0,n(34619).Z)("CircleArrowLeft",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M16 12H8",key:"1fr5h0"}],["path",{d:"m12 8-4 4 4 4",key:"15vm53"}]])},70103:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});let a=(0,n(34619).Z)("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},88618:function(e,t,n){"use strict";var a=n(52676),r=n(75271),i=n(72401),o=n(91779),c=n(93726),s=n(59080);t.Z=e=>{let{backUrl:t="",title:n,pageKey:u,onBackClick:l,forceHardNavigation:d=!1}=e,m=(0,c.useRouter)(),{setPage:f}=(0,s.w)();return(0,r.useEffect)(()=>{f(u&&u.trim().length>0?u:n.replace(/\s+/g,"_").toLowerCase())},[n,u,f]),(0,a.jsxs)("div",{className:"flex flex-row items-center border-solid border-b-[0.2px] border-light pb-2 border-opacity-15 text-light",children:[(0,a.jsx)(i.Z,{className:"mr-3 cursor-pointer",onClick:()=>{if(l&&l(),d&&t){window.location.assign(t);return}m.push(t)}}),(0,a.jsx)(o.Z,{title:n,classes:"!text-3xl tracking-wide !mb-0"})]})}},91779:function(e,t,n){"use strict";var a=n(52676);n(75271);var r=n(41017),i=n(98199),o=n.n(i),c=n(1745),s=n(59080),u=n(52671),l=n(26365);t.Z=e=>{let{title:t,classes:n="",action:i,isDashboard:d=!1,triggerPromt:m}=e,{page:f,setIsAssistantOpen:p}=(0,s.w)()||{},{handleClick:h}
1=(0,u.o)(),g=(0,l.E)();return(0,a.jsxs)("div",{className:"flex flex-row items-center mb-4 text-lg ".concat(n),id:t,children:[(0,a.jsxs)("div",{className:"flex flex-row items-center",children:[(0,a.jsx)("h2",{className:"mr-3 font-semibold",children:t}),d&&(0,a.jsx)("div",{className:"text-lg ml-3 bg-sky hover:bg-skyHover rounded-full flex items-center justify-center w-[18px] h-[18px] cursor-pointer",onClick:i,children:(0,a.jsx)(c.Z,{className:"!text-base text-dark "})})]}),!g&&(0,a.jsx)("div",{className:"flex justify-center items-center rounded-full border-solid border-[1px] border-opacity-0 border-yellowAcc p-1 hover:border-opacity-100 cursor-pointer transition-all duration-200 w-[30px] h-[30px]",children:(0,a.jsx)(o(),{src:r.Z,alt:"Manu AI Icon",className:"cursor-pointer",onClick:()=>{p(!0),h({p:m||"Explain the ".concat(t," section."),flag:!1,page:f,triggerSource:"dashboard_section",triggerId:t})}})})]})}},77608:function(e,t,n){"use strict";n.d(t,{$:function(){return o}});var a=n(75271),r=n(93726),i=n(64932);function o(e,t){let n=(0,r.useRouter)(),{isAuthenticated:o,routerReady:c}=null!=t?t:{};(0,a.useEffect)(()=>{if(!1===o&&!0===c){n.replace("/auth/login?redirect=client-admin");return}e.isError&&(0,i.H4)(e.error)&&n.replace("/auth/login?redirect=client-admin")},[e.isError,e.error,n,o,c])}},318:function(e,t,n){"use strict";n.d(t,{A:function(){return v},A$:function(){return j},C_:function(){return h},FY:function(){return b},GW:function(){return s},Iq:function(){return q},Jy:function(){return z},Ld:function(){return Z},M_:function(){return p},Ml:function(){return U},Nq:function(){return f},Ny:function(){return l},PX:function(){return g},SU:function(){return c},TY:function(){return P},Ub:function(){return $},Vc:function(){return k},_2:function(){return m},_P:function(){return S},dr:function(){return A},jQ:function(){return D},kO:function(){return L},kY:function(){return K},lf:function(){return _},ll:function(){return O},mC:function(){return I},p:function(){return x},rB:function(){return F},rL:function(){return w},se:function(){return R},tu:function(){return T},u:function(){return u},ut:function(){return N},uy:function(){return E},vt:function(){return o},y5:function(){return d}});var a=n(30656),r=n(71161);let i=()=>"".concat((0,r.RU)(),"/v1/org-onboarding");async function o(){var e;return null!==(e=(await a.default.get("".concat(i(),"/programs"))).data)&&void 0!==e?e:[]}async function c(e){return(await a.default.get("".concat(i(),"/programs/").concat(encodeURIComponent(e)))).data}async function s(e){return(await a.default.post("".concat(i(),"/checkout/quote"),e)).data}async function u(e,t,n){return(await a.default.post("".concat(i(),"/checkout/quote/apply-promo"),{order_id:e,email:t,promo_code:n})).data}async function l(e,t){return(await a.default.post("".concat(i(),"/checkout/quote/remove-promo"),{order_id:e,email:t})).data}async function d(e,t,n,r){return(await a.default.post("".concat(i(),"/checkout/payment-intent"),{order_id:r,program_slug:e,organization_name:t.organization_name,industry:t.industry,country_region:t.country_region,admin_first_name:t.admin_first_name,admin_last_name:t.admin_last_name,admin_email:t.admin_email,admin_phone:t.admin_phone,workspace_manager:t.workspace_manager,currency:t.currency,seat_quantity:n})).data}async function m(e){return(await a.default.get("".concat(i(),"/orders/").concat(encodeURIComponent(e)))).data}async function f(e){return(await a.default.get("".concat(i(),"/provisioning-status/").concat(encodeURIComponent(e)))).data}async function p(e){return(await e.get("".concat((0,r.RU)(),"/v1/client-admin/organization"))).data}async function h(e){let t=await e.get("".concat((0,r.RU)(),"/v1/client-admin/seats/pools"));return Array.isArray(t.data)?t.data:[]}async function g(e){var t;return null!==(t=(await e.get("".concat((0,r.RU)(),"/v1/client-admin/stats"))).data)&&void 0!==t?t:{}}function y(e){var t,n;let a=new URLSearchParams;return(null!==(t=null==e?void 0:e.programSlugs)&&void 0!==t?t:[]).forEach(e=>a.append("program_slug",e)),(null!==(n=null==e?void 0:e.cohortIds)&&void 0!==n?n:[]).forEac
1h(e=>a.append("cohort_id",e)),a}async function x(e,t){var n;return null!==(n=(await e.get("".concat((0,r.RU)(),"/v1/client-admin/domain-mastery"),{params:y(t)})).data)&&void 0!==n?n:{}}async function b(e,t){var n;return null!==(n=(await e.get("".concat((0,r.RU)(),"/v1/client-admin/trainees-by-program-stats"),{params:y(t)})).data)&&void 0!==n?n:{}}async function v(e){let t=await e.get("".concat((0,r.RU)(),"/v1/client-admin/cohorts"));return Array.isArray(t.data)?t.data:[]}async function w(e,t){return(await e.post("".concat((0,r.RU)(),"/v1/client-admin/cohorts"),t)).data}async function _(e,t){return(await e.get("".concat((0,r.RU)(),"/v1/client-admin/cohorts/").concat(encodeURIComponent(t)))).data}async function j(e,t){let n=await e.get("".concat((0,r.RU)(),"/v1/client-admin/cohorts/").concat(encodeURIComponent(t),"/users"));return Array.isArray(n.data)?n.data:[]}async function N(e,t,n){return(await e.patch("".concat((0,r.RU)(),"/v1/client-admin/cohorts/").concat(encodeURIComponent(t)),n)).data}let C=()=>"".concat((0,r.RU)(),"/v1/client-admin");async function q(e,t){var n;return null!==(n=(await e.get("".concat(C(),"/users/metadata"),{params:{email:t}})).data)&&void 0!==n?n:{}}async function P(e,t){await e.post("".concat(C(),"/users"),t)}async function k(e,t){await e.post("".concat(C(),"/users/edit"),t)}async function R(e,t,n){return(await e.post("".concat(C(),"/seats/purchase/").concat(encodeURIComponent(t),"/quote"),n)).data}async function U(e,t,n,a){return(await e.post("".concat(C(),"/seats/purchase/quote/apply-promo"),{order_id:t,email:n,promo_code:a})).data}async function I(e,t,n){return(await e.post("".concat(C(),"/seats/purchase/quote/remove-promo"),{order_id:t,email:n})).data}async function A(e,t,n){return(await e.post("".concat(C(),"/seats/purchase/").concat(encodeURIComponent(t),"/payment-intent"),n)).data}async function F(e,t){return(await e.get("".concat(C(),"/seats/purchase/orders/").concat(encodeURIComponent(t)))).data}async function O(e){return(await e.get("".concat(C(),"/admin-licenses/pool"))).data}async function S(e){return(await e.get("".concat(C(),"/admin-licenses/pricing"))).data}async function E(e,t){return(await e.post("".concat(C(),"/admin-licenses/purchase/quote"),t)).data}async function z(e,t,n,a){return(await e.post("".concat(C(),"/admin-licenses/purchase/quote/apply-promo"),{order_id:t,email:n,promo_code:a})).data}async function T(e,t,n){return(await e.post("".concat(C(),"/admin-licenses/purchase/quote/remove-promo"),{order_id:t,email:n})).data}async function Z(e,t){return(await e.post("".concat(C(),"/admin-licenses/purchase/payment-intent"),t)).data}async function D(e,t){return(await e.get("".concat(C(),"/admin-licenses/purchase/orders/").concat(encodeURIComponent(t)))).data}async function L(e,t){return(await e.post("".concat(C(),"/licences/purchase/quote"),t)).data}async function $(e,t){return(await e.post("".concat(C(),"/licences/purchase/payment-intent"),t)).data}async function K(e,t){return(await e.get("".concat(C(),"/licences/purchase/orders/").concat(encodeURIComponent(t)))).data}},30362:function(e,t,n){"use strict";n.d(t,{hs:function(){return l},mX:function(){return f},sj:function(){return p},uE:function(){return m},xr:function(){return d}});var a=n(2284),r=n(26547),i=n(10226),o=n(83574),c=n(318);let s=e=>["client-admin","cohort",e],u=e=>["client-admin","cohort",e,"users"];function l(e){var t;let{client:n,clientReady:r}=(0,o.l$)();return(0,a.a)({queryKey:["client-admin","cohorts"],queryFn:()=>(0,c.A)(n),enabled:(null===(t=null==e?void 0:e.enabled)||void 0===t||t)&&r,staleTime:3e4})}function d(e){let{client:t,clientReady:n}=(0,o.l$)();return(0,a.a)({enabled:!!e&&n,queryKey:s(e),queryFn:()=>(0,c.lf)(t,e),staleTime:0,refetchOnMount:"always",refetchOnWindowFocus:!1,gcTime:9e5})}function m(e){let{client:t,clientReady:n}=(0,o.l$)();return(0,a.a)({enabled:!!e&&n,queryKey:u(e),queryFn:()=>(0,c.A$)(t,e),staleTime:0,refetchOnMount:"always",refetchOnWindowFocus:!1,gcTime:9e5})}function f(){let{client:e}=(0,o.l$)(),t=(0,r.NL)();return(0,i.D)({mutationFn:t=>(0,c.rL)(e,t),onSuccess:()=>{t.invalidateQueries({queryKey:["client-admin","cohorts"]})}})}function p(){let{client:e}=(0,o.l$)(),t=(0,r.NL)();return(0,i.D)({mutationFn:t=>{let{cohortId:n,payload:a}=t;return(0,c.ut)(e,n,a)},onSuccess:(e,n)=>{t.invalidateQueries({queryKey:["client-admin","cohorts"]}),t.invalidateQueries({queryKey:s(n.cohortId)})}})}},91049:function(e,t,n){"use strict";n.d(t,{C1:function(){return c},PF:function(){return s},Yp:function(){return u},jq:function(){return l}});var a=n(2284),r=n(83574),i=n(64932),o=n(318);function c(e){var t;let{client:n,clientReady:c}=(0,r.l$)();return(0,a.a)({queryKey:["client-admin","organization"],queryFn:()=>(0,o.M_)(n),enabled:(null===(t=null==e?void 0:e.enabled)||void 0===t||t)&&c,staleTime:6e4,retry:(e,t)=>(0,i.IJ)(t)&&e<2})}function s(e){var t;let{client:n,clientReady:i}=(0,r.l$)();return(0,a.a)({queryKey:["client-admin","seat-pools"],queryFn:()=>(0,o.C_)(n),enabled:(null===(t=null==e?void 0:e.enabled)||void 0===t||t)&&i,staleTime:3e4})}function u(e){var t;let{client:n,clientReady:i}=(0,r.l$)();return(0,a.a)({queryKey:["client-admin","admin-license-pool"],queryFn:()=>(0,o.ll)(n),enabled:(null===(t=null==e?void 0:e.enabled)||void 0===t||t)&&i,staleTime:3e4})}function l(e){var t;let{client:n,clientReady:i}=(0,r.l$)();return(0,a.a)({queryKey:["client-admin","stats"],queryFn:()=>(0,o.PX)(n),enabled:(null===(t=null==e?void 0:e.enabled)||void 0===t||t)&&i,staleTime:6e4})}},8096:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return x}});
1var a=n(52676),r=n(75271),i=n(93726),o=n(65211),c=n(88618),s=n(70103),u=n(30362),l=n(91049);let d="w-full rounded-lg border border-white/[0.08] bg-white/[0.03] px-3 py-2 text-sm text-white outline-none placeholder:text-white/35 transition-colors hover:border-white/[0.12] focus:border-brandAmber/50 disabled:opacity-50 disabled:cursor-not-allowed",m="block text-sm font-medium tracking-tight text-white/70 mb-1",f={name:"",id:"",organization:"",numberOfParticipants:"",startDate:"",lead:"",trainer:"",assessment_cutoff:""},p=e=>{var t,n;let{cohortId:o}=e,c=(0,i.useRouter)(),p=(0,l.C1)(),{data:h,isLoading:g}=(0,u.xr)(o),y=(0,u.sj)(),[x,b]=(0,r.useState)(f),[v,w]=(0,r.useState)(null),_=(0,r.useRef)(!1);(0,r.useEffect)(()=>{if(!h||_.current)return;let e={};["name","id","organization","numberOfParticipants","startDate","lead","trainer","assessment_cutoff"].forEach(t=>{let n=h[t];if("startDate"===t&&n){let a=new Date(n);e[t]=Number.isNaN(a.getTime())?"":a.toISOString().split("T")[0]}else if("numberOfParticipants"===t){var a,r;let n=null!==(r=null!==(a=h.maxParticipants)&&void 0!==a?a:h.numberOfParticipants)&&void 0!==r?r:"";e[t]=null!=n?n:""}else e[t]=null!=n?String(n):""}),void 0!==h.assessment_cutoff&&null!==h.assessment_cutoff&&(e.assessment_cutoff=h.assessment_cutoff),b(t=>({...t,...e})),_.current=!0},[h]),(0,r.useEffect)(()=>{var e;(null===(e=p.data)||void 0===e?void 0:e.org_id)&&!x.organization&&b(e=>({...e,organization:p.data.org_id}))},[x.organization,null===(t=p.data)||void 0===t?void 0:t.org_id]);let j=e=>{let{name:t,value:n}=e.target;if("assessment_cutoff"===t){let e=n.replace(/[^0-9]/g,"");if(""!==e&&parseInt(e,10)>99)return;b(n=>({...n,[t]:""===e?null:parseInt(e,10)}))}else"numberOfParticipants"===t?b(e=>({...e,[t]:""===n?"":parseInt(n,10)||0})):b(e=>({...e,[t]:n}))},N=async e=>{e.preventDefault(),w(null);try{await y.mutateAsync({cohortId:o,payload:{name:x.name.trim(),start_date:x.startDate||void 0,lead:x.lead,trainer:x.trainer,assessment_cutoff:""===x.assessment_cutoff||null===x.assessment_cutoff?null:Number(x.assessment_cutoff),number_of_participants:""===x.numberOfParticipants?null:Number(x.numberOfParticipants)}}),c.push("/client-admin/cohorts")}catch(e){w("Failed to update cohort. Please try again.")}};if(g||!h)return(0,a.jsxs)("div",{className:"flex min-h-[200px] flex-col items-center justify-center gap-4 roun
1ded-md border border-white/[0.06] bg-brandSurface p-6 shadow-[0_8px_32px_rgba(0,0,0,0.2)]",children:[(0,a.jsx)(s.Z,{size:24,className:"animate-spin text-brandAmber"}),(0,a.jsx)("p",{className:"text-sm text-white/50",children:"Loading cohort..."})]});let C=(null===(n=p.data)||void 0===n?void 0:n.name)||x.organization;return(0,a.jsxs)("form",{onSubmit:N,className:"flex flex-col gap-6",children:[(0,a.jsxs)("section",{className:"flex flex-col gap-5 rounded-md border border-white/[0.06] bg-brandSurface p-6 shadow-[0_8px_32px_rgba(0,0,0,0.2)]",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"text-base font-semibold tracking-tight text-white",children:"Cohort Details"}),(0,a.jsx)("p",{className:"mt-0.5 text-sm text-white/50",children:"Update the information for this cohort"})]}),(0,a.jsxs)("div",{className:"grid grid-cols-4 gap-x-4 gap-y-4 sm:grid-cols-1",children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("label",{htmlFor:"name",className:m,children:["Name ",(0,a.jsx)("span",{className:"text-brandAmber",children:"*"})]}),(0,a.jsx)("input",{type:"text",id:"name",placeholder:"Cohort name",name:"name",value:x.name,onChange:j,required:!0,disabled:y.isPending,className:d})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{htmlFor:"organization",className:m,children:"Organisation"}),(0,a.jsx)("input",{type:"text",id:"organization",name:"organization",value:C,disabled:!0,className:"w-full rounded-lg border border-white/[0.08] bg-white/[0.02] px-3 py-2 text-sm text-white/45 outline-none cursor-not-allowed"})]})]}),(0,a.jsxs)("div",{className:"grid grid-cols-4 gap-x-4 gap-y-4 sm:grid-cols-1",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{htmlFor:"numberOfParticipants",className:m,children:"Participants"}),(0,a.jsx)("input",{type:"number",id:"numberOfParticipants",name:"numberOfParticipants",placeholder:"Number of participants",value:x.numberOfParticipants,onChange:j,disabled:y.isPending,className:"".concat(d," no-spinner [appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none")})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{htmlFor:"startDate",className:m,children:"Start Date"}),(0,a.jsx)("input",{type:"date",max:new Date().toISOString().split("T")[0],id:"startDate",name:"startDate",value:x.startDate,onChange:j,disabled:y.isPending,className:d})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{htmlFor:"lead",className:m,children:"Lead"}),(0,a.jsx)("input",{type:"text",id:"lead",name:"lead",placeholder:"Lead name",value:x.lead,onChange:j,disabled:y.isPending,className:d})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{htmlFor:"trainer",className:m,children:"Trainer"}),(0,a.jsx)("input",{type:"text",id:"trainer",name:"trainer",placeholder:"Trainer name",value:x.trainer,onChange:j,disabled:y.isPending,className:d})]})]}),(0,a.jsx)("div",{className:"grid grid-cols-4 gap-x-4 gap-y-4 sm:grid-cols-1",children:(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{htmlFor:"assessment_cutoff",className:m,children:"Assessment Cutoff"}),(0,a.jsx)("input",{type:"text",inputMode:"numeric",pattern:"[0-9]*",id:"assessment_cutoff",name:"assessment_cutoff",placeholder:"0â99",value:null===x.assessment_cutoff||""===x.assessment_cutoff?"":x.assessment_cutoff,onChange:j,disabled:y.isPending,className:d})]})}),v?(0,a.jsx)("p",{className:"text-sm text-red-400",children:v}):null]}),(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("button",{type:"button",disabled:y.isPending,onClick:()=>c.push("/client-admin/cohorts"),className:"rounded-lg border border-white/[0.12] px-5 py-2.5 text-sm font-medium text-white transition-colors hover:bg-white/[0.06] disabled:cursor-not-allowed disabled:opacity-50",children:"Cancel"}),(0,a.jsxs)("button",{type:"submit",disabled:y.isPending,className:"flex items-center gap-2 rounded-lg bg-brandAmberVibrant px-6 py-2.5 text-sm font-medium text-black transition-colors hover:bg-brandAmber disabled:cursor-not-allowed disabled:opacity-50",children:[y.isPending?(0,a.jsx)(s.Z,{size:16,className:"animate-spin"}):null,y.isPending?"Saving...":"Save Changes"]})]})]})};var h=n(59080),g=n(21582),y=n(77608);function x(){let{id:e}=(0,i.useRouter)().query,t="string"==typeof e?e:void 0,{setPage:n}=(0,h.w)(),{setActiveClientAdminTab:s}=(0,g.u)(),u=(0,l.C1)();return(0,r.useEffect)(()=>{s("Cohorts"),n("client_admin_edit_cohort")}
1,[s,n]),(0,y.$)(u),(0,a.jsx)(o.Z,{isPlatform:!1,children:(0,a.jsxs)("div",{className:"flex flex-grow flex-col !text-light pb-10",children:[(0,a.jsx)(c.Z,{title:"Edit Cohort",backUrl:"/client-admin/cohorts",pageKey:"client_admin_edit_cohort"}),t?(0,a.jsx)(p,{cohortId:t}):(0,a.jsx)("div",{className:"rounded-md border border-white/[0.06] bg-brandSurface p-8 text-center text-white/50",children:"Invalid cohort."})]})})}}},function(e){e.O(0,[2592,8199,6415,4435,5211,2888,9774,179],function(){return e(e.s=83286)}),_N_E=e.O()}]);
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.