1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8420],{37989:function(e,r,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/master/school/new",function(){return n(69931)}])},69303:function(e,r,n){"use strict";n.d(r,{V:function(){return s}});var i=n(85893),t=n(87357),o=n(94932),s=(n(67294),function(e){var r=e.isHidden,n=e.onChange;return(0,i.jsx)(t.Z,{className:"HideSchoolSwitch",children:(0,i.jsx)(o.Hx,{variant:"tempered",options:["Hidden","Active"],selection:r?"Hidden":"Active",onChange:n})})})},79869:function(e,r,n){"use strict";n.d(r,{n:function(){return s}});var i=n(2330),t=n(81876),o=n(1604),s=o.Ry({name:o.Z_().nonempty(t.XO.Required),isHidden:o.O7().default(!1),websiteUrl:o.Z_().regex(/^.*:\/\/.*$/,"Include protocol (https:// or http://)").nonempty(t.XO.Required).url(),streetAddress:o.Z_().nonempty(t.XO.Required),city:o.Z_().nonempty(t.XO.Required),state:o.jb(i.P),zipCode:o.Z_().regex(/^\d{5}$/,t.XO.ZipCode.INVALID),domainName:o.Z_().nonempty(t.XO.Required).regex(/^[^A-Z]*$/,"Please enter a lowercase domain name").regex(/^([a-z0-9-]+\.)+edu/,"Please enter a .edu domain name"),aliases:o.IX(o.Ry({value:o.Z_().nonempty(t.XO.Required)})).optional(),slug:o.Z_().nonempty(t.XO.Required),termsUrl:o.Z_().url({message:"Enter a valid URL"}).nonempty(t.XO.Required),termsDisplayName:o.Z_().nonempty(t.XO.Required)})},69931:function(e,r,n){"use strict";n.r(r),n.d(r,{default:function(){return E}});var i=n(28520),t=n.n(i),o=n(85893),s=n(54971),l=n(2330),a=n(87357),d=n(15861),c=n(81458),u=n(84373),m=n(86093),h=n(94932),x=n(83987),g=n(31533),f=n(68360),p=n(22896),v=n(96391),j=n(67294),y=n(47452),b=n(87536),S=n(79869),Z=n(83744),w=n(90896),C=n(11163),k=n(81876),I=n(69303);function P(e,r,n,i,t,o,s){try{var l=e[o](s),a=l.value}catch(d){return void n(d)}l.done?r(a):Promise.resolve(a).then(i,t)}function O(e,r,n){return r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function _(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{},i=Object.keys(n);"function"===typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),i.forEach((function(r){O(e,r,n[r])}))}return e}function N(e,r){if(null==e)return{};var n,i,t=function(e,r){if(null==e)return{};var n,i,t={},o=Object.keys(e);for(i=0;i<o.length;i++)n=o[i],r.indexOf(n)>=0||(t[n]=e[n]);return t}(e,r);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)n=o[i],r.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(t[n]=e[n])}return t}var z=function(e){var r=e.register,n=e.name,i=e.label,t=e.defaultValue,s=e.error,l=e.autoComplete,d=void 0===l?"off":l,c=e.minWidth,u=void 0===c?262:c;return(0,o.jsxs)(a.Z,{minWidth:u,children:[(0,o.jsx)(h.oi,_({},r(n),{autoComplete:d,label:i,defaultValue:t})),s&&(0,o.jsx)(h._o,{children:s})]})},U=function(e){var r=e.title,n=e.imageUrl,i=e.onOpenSelector,t=e.uploadProgress,s=e.maxFileSize,l=e.recommendedSize,x=e.width,g=void 0===x?70:x,f=e.height,p=void 0===f?70:f,v=e.style;return(0,o.jsxs)(h.Tg,{mt:40,mr:18,noInnerPadding:!0,position:"relative",overflow:"hidden",children:[(0,o.jsx)(d.Z,{sx:{fontSize:"1.125em",fontWeight:600},children:r}),(0,o.jsxs)(a.Z,{mt:6,mb:5,display:"flex",children:[(0,o.jsxs)(a.Z,{mt:6,flex:1,children:[(0,o.jsx)(m.rU,{onClick:i,children:(0,o.jsxs)(a.Z,{display:"flex",alignItems:"center",tabIndex:0,className:"keyboardFocus",onKeyPress:function(e){return" "===e.key&&i()},children:[(0,o.jsx)(a.Z,{mr:10,lineHeight:0,children:(0,o.jsx)(u.Te,{})}),(0,o.jsx)(d.Z,{sx:{fontWeight:600},children:"Click Here To Upload Image"})]})}),(0,o.jsx)(a.Z,{mt:6,children:(0,o.jsxs)(d.Z,{sx:{fontSize:"0.875em"},children:["JPEG or PNG. File size no larger than ",s,"MB.",(0,o.jsx)("br",{}),"Recommended ",l,"."]})})]}),(0,o.jsx)(a.Z,{mt:-20,flex:1,display:"flex",justifyContent:"center",alignItems:"center",children:n?(0,o.jsx)(a.Z,{lineHeight:0,style:{cursor:"pointer",WebkitTapHighlightColor:"rgba(0,0,0,0)"},onClick:i,children:(0,o.jsx)(m.Ee,{src:n,width:g,height:p,alt:"Uploaded Image",style:_({objectFit:"cover"},v)})}):(0,o.jsx)(a.Z,{py:10,px:10,lineHeight:0,style:{background:"#efefef",color:"#d5d5d5",cursor:"pointer",WebkitTapHighlightColor:"rgba(0,0,0,0)"},onClick:i,children:(0,o.jsx)(u.XB,{style:{fontSize:52}})})})]}),t&&(0,o.jsx)(c.Z,{variant:"determinate",value:t,style:{position:"absolute",bottom:0,left:0,right:0,height:8}})]})},H=function(e){var r=e.bannerUrl,n=e.onOpenSelector,i=e.uploadProgress;return(0,o.jsxs)(h.Tg,{mt:40,mr:18,noInnerPadding:!0,position:"relative",overflow:"hidden",children:[(0,o.jsx)(d.Z,{sx:{fontSize:"1.125em",fontWeight:600},children:"School Banner Image"}),(0,o.jsx)(a.Z,{mt:12,children:(0,o.jsx)(m.rU,{onClick:n,children:(0,o.jsxs)(a.Z,{display:"flex",alignItems:"center",tabIndex:0,className:"keyboardFocus",onKeyPress:function(e){return" "===e.key&&n()},children:[(0,o.jsx)(a.Z,{mr:10,lineHeight:0,children:(0,o.jsx)(u.Te,{})}),(0,o.jsx)(d.Z,{sx:{fontWeight:600},children:"Click Here To Upload Image"})]})})}),(0,o.jsx)(a.Z,{mt:12,maxWidth:625,tabIndex:0,onClick:n,onKeyPress:function(e){" "!==e.key&&"Enter"!==e.key||(n(),e.preventDefault())},className:"keyboardFocus",lineHeight:0,children:r?(0,o.jsx)(m.Ee,{src:r,alt:"School Banner",width:625,height:250,style:{objectFit:"cover",cursor:"pointer"}}):(0,o.jsxs)(a.Z,{height:250,display:"flex",justifyContent:"center",alignItems:"center",flexDirection:"column",lineHeight:0,style:{background:"#efefef",color:"#d5d5d5",cursor:"pointer"},children:[(0,o.jsx)(u.XB,{style:{fontSize:80}}),(0,o.jsx)(d.Z,{color:"primary",style:{fontSize:"0.875em",fontWeight:600},children:"Click Here To Upload Image"}),(0,o.jsxs)(d.Z,{color:"textPrimary",align:"center",style:{fontSize:"0.875em"},children:["JPEG or PNG. File size no larger than ",10," MB. Recommended ",(0,s.u)(1250)," x ",(0,s.u)(500)," pixels."]})]})}),i&&(0,o.jsx)(c.Z,{variant:"determinate",value:i,style:{position:"absolute",bottom:0,left:0,right:0,height:8}})]})},W=function(e){var r=e.field,n=e.index,i=e.register,t=e.onRemove,s=e.error,l=e.getValues;return(0,o.jsxs)(j.Fragment,{children:[(0,o.jsxs)(a.Z,{mt:0===n?20:0,width:300,display:"flex",alignItems:"flex-end",children:[(0,o.jsx)(a.Z,{mb:16,pr:10,lineHeight:0,style:{cursor:"pointer"},onClick:t,children:(0,o.jsx)(u.uS,{color:"error",style:{fontSize:"1.125em"}})}),(0,o.jsx)(h.oi,_({label:0===n?"School Alias":void 0,autoComplete:"off",defaultValue:l("aliases.".concat(n,".value"))},i("aliases.".concat(n,".value"))))]}),(0,o.jsx)(a.Z,{pb:20,children:s&&(0,o.jsx)(a.Z,{pl:30,children:(0,o.jsx)(h._o,{children:s})})})]},r.id)};function E(){var e,r,n,i,s,c,u,m,O,E,M=(0,g.Un)().loading,R=(0,g.WL)();(0,g.NX)("master");var A=(0,Z.Mf)(),T=(0,w.Ds)().enqueueSnackbar,X=(0,C.useRouter)(),q=function(e){return{validateImages:function(r,n,i){return r?n?!!i||(e("Please upload a banner",{variant:"error"}),!1):(e("Please upload a logo",{variant:"error"}),!1):(e("Please upload an icon",{variant:"error"}),!1)}}}(T).validateImages,D=(0,g.hN)(S.n,{defaultValues:{aliases:[]},mode:"all"}
1),F=D.formState.errors,V=N(D,["formState"]),L=(0,j.useState)(null),B=L[0],G=L[1],K=(0,j.useState)(null),J=K[0],$=K[1],Q=(0,j.useState)(null),Y=Q[0],ee=Q[1],re=(0,f.i)({maxMb:5}),ne=(0,f.i)({maxMb:5}),ie=(0,f.i)({maxMb:10});(0,j.useEffect)((function(){$(ne.url)}),[ne.url]),(0,j.useEffect)((function(){G(re.url)}),[re.url]),(0,j.useEffect)((function(){ee(ie.url)}),[ie.url]);var te,oe=(te=t().mark((function e(r){var n,i,o,s,l;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(q(J,B,Y)){e.next=3;break}return e.abrupt("return");case 3:return e.next=6,A.createSchool(_({},r,{iconUrl:null!==J&&void 0!==J?J:"",logoUrl:null!==B&&void 0!==B?B:"",bannerUrl:null!==Y&&void 0!==Y?Y:"",aliases:null!==(i=null===(n=r.aliases)||void 0===n?void 0:n.map((function(e){return e.value})))&&void 0!==i?i:[]}));case 6:if((o=e.sent).success){e.next=11;break}return T(null===(s=o.error.response)||void 0===s?void 0:s.data.message,{variant:"error"}),e.abrupt("return");case 11:return l=o.value.id,T("Successfully created school",{variant:"success"}),e.next=15,X.push(y.Z.master.school(l));case 15:case"end":return e.stop()}}),e)})),function(){var e=this,r=arguments;return new Promise((function(n,i){var t=te.apply(e,r);function o(e){P(t,n,i,o,s,"next",e)}function s(e){P(t,n,i,o,s,"throw",e)}o(void 0)}))}),se=(0,b.Dq)({control:V.control,name:"aliases"});(0,b.qo)({control:V.control,name:"aliases"});var le,ae,de,ce=((0,b.qo)({control:V.control,name:"state"})||"state").toLowerCase().replace(/\s+/g,"-");return M||!R?(0,o.jsx)(p.C,{title:"Create School",active:"schools",children:""}):(0,o.jsx)(p.C,{title:"Create School",active:"schools",actions:(0,o.jsx)(b.Qr,{control:V.control,name:"isHidden",render:function(e){var r=e.field,n=r.value,i=r.onChange;return(0,o.jsx)(I.V,{isHidden:!!n,onChange:function(){return i(!n)}})}}),children:(0,o.jsx)("form",{onSubmit:V.handleSubmit(oe),children:(0,o.jsxs)(a.Z,{maxWidth:892,children:[(0,o.jsxs)(h.Tg,{mt:20,mr:18,noInnerPadding:!0,children:[(0,o.jsx)(d.Z,{sx:{fontSize:"1.125em",fontWeight:600},children:"School Information"}),(0,o.jsxs)(a.Z,{my:20,display:"flex",flexWrap:"wrap",style:{rowGap:40,columnGap:50},children:[(0,o.jsx)(z,{register:V.register,name:"name",label:"School Name",error:null===(e=F.name)||void 0===e?void 0:e.message}),(0,o.jsx)(z,{register:V.register,name:"websiteUrl",label:"School Website",error:null===(r=F.websiteUrl)||void 0===r?void 0:r.message}),(0,o.jsx)(z,{register:V.register,name:"streetAddress",label:"Street Address",error:null===(n=F.streetAddress)||void 0===n?void 0:n.message}),(0,o.jsx)(z,{register:V.register,name:"city",label:"City",error:null===(i=F.city)||void 0===i?void 0:i.message}),(0,o.jsxs)(a.Z,{minWidth:262,children:[(0,o.jsxs)(x.P,_({},V.register("state"),{label:"State",children:[(0,o.jsx)("option",{}),l.P.map((function(e){return(0,o.jsx)("option",{value:e,children:e},e)}))]})),(null===(s=F.state)||void 0===s?void 0:s.message)&&(0,o.jsx)(h._o,{children:k.XO.Required})]}),(0,o.jsx)(z,{register:V.register,name:"zipCode",label:"Zip Code",error:null===(c=F.zipCode)||void 0===c?void 0:c.message}),(0,o.jsx)(z,{register:V.register,name:"termsUrl",label:"T&C URL",error:null===(u=F.termsUrl)||void 0===u?void 0:u.message}
1),(0,o.jsx)(z,{register:V.register,name:"termsDisplayName",label:"T&C Display Name",error:null===(m=F.termsDisplayName)||void 0===m?void 0:m.message})]})]}),(0,o.jsxs)(h.Tg,{mt:40,mr:18,noInnerPadding:!0,children:[(0,o.jsx)(d.Z,{sx:{fontSize:"1.125em",fontWeight:600},children:"School Email Domain"}),(0,o.jsx)(d.Z,{sx:{fontSize:"0.875em"},children:"Users who register with emails from this domain will be associated with this school"}),(0,o.jsx)(a.Z,{maxWidth:300,children:(0,o.jsx)(h.oi,_({},V.register("domainName")))}),(null===(O=F.domainName)||void 0===O?void 0:O.message)&&(0,o.jsx)(h._o,{children:null===(E=F.domainName)||void 0===E?void 0:E.message})]}),(0,o.jsxs)(h.Tg,{mt:40,mr:18,noInnerPadding:!0,children:[(0,o.jsx)(d.Z,{sx:{fontSize:"1.125em",fontWeight:600},children:"Alternative School Names"}),se.fields.map((function(e,r){var n,i,t;return(0,o.jsx)(W,{field:e,index:r,register:V.register,onRemove:function(){return se.remove(r)},error:null===F||void 0===F||null===(n=F.aliases)||void 0===n||null===(i=n[r])||void 0===i||null===(t=i.value)||void 0===t?void 0:t.message,getValues:V.getValues},e.id)})),(0,o.jsx)(a.Z,{mt:10,children:(0,o.jsx)(h.r9,{onClick:function(){return se.append({value:""})},children:"Add Alias"})})]}),(0,o.jsxs)(h.Tg,{mt:40,mr:18,noInnerPadding:!0,children:[(0,o.jsx)(d.Z,{sx:{fontSize:"1.125em",fontWeight:600},children:"Custom CampusLush URL Slug"}),(0,o.jsxs)(a.Z,{my:10,display:"flex",alignItems:"center",style:{gap:2},children:[(0,o.jsxs)(d.Z,{children:[window.location.host,"/",ce,"/"]}),(0,o.jsx)(h.oi,_({},V.register("slug")))]})]}),(0,o.jsx)(U,{title:"School Icon",imageUrl:J,onOpenSelector:ne.open,uploadProgress:null!==(le=ne.progress)&&void 0!==le?le:0,maxFileSize:v.MAX_IMAGE_FILE_SIZE_MB,recommendedSize:"200 x 200 pixels"}),(0,o.jsx)(U,{title:"School Logo",imageUrl:B,onOpenSelector:re.open,uploadProgress:null!==(ae=re.progress)&&void 0!==ae?ae:0,maxFileSize:v.MAX_IMAGE_FILE_SIZE_MB,recommendedSize:"340 x 120 pixels",width:"100%",height:50}),(0,o.jsx)(H,{bannerUrl:Y,onOpenSelector:ie.open,uploadProgress:null!==(de=ie.progress)&&void 0!==de?de:0}),(0,o.jsxs)(a.Z,{mt:40,display:"flex",children:[(0,o.jsx)(a.Z,{mr:30,children:(0,o.jsx)(h.ZP,{inverted:!0,minHeight:50,href:y.Z.master.schools(),children:"Back"})}),(0,o.jsx)(h.zx,{variant:"vibrant",minHeight:50,type:"submit",disabled:!B||!Y||!J,children:"Save School"})]})]})})})}},2330:function(e,r,n){"use strict";n.d(r,{P:function(){return i}});var i=["Alabama","Alaska","Arizona","Arkansas","California","Colorado","Connecticut","Delaware","Florida","Georgia","Hawaii","Idaho","Illinois","Indiana","Iowa","Kansas","Kentucky","Louisiana","Maine","Maryland","Massachusetts","Michigan","Minnesota","Mississippi","Missouri","Montana","Nebraska","Nevada","New Hampshire","New Jersey","New Mexico","New York","North Carolina","North Dakota","Ohio","Oklahoma","Oregon","Pennsylvania","Rhode Island","South Carolina","South Dakota","Tennessee","Texas","Utah","Vermont","Virginia","Washington","West Virginia","Wisconsin","Wyoming"]}},function(e){e.O(0,[5675,9807,8434,2896,6872,2132,6391,9774,2888,179],(function(){return r=37989,e(e.s=r);var r}));var r=e.O();_N_E=r}]); 2//# sourceMappingURL=new-969076395569308f.js.map
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.