PageSourceSearch

https://www.matcotools.com/_next/static/chunks/9749-286616898198c84c.js

js matcotools.com collected 2026-10-04 00:31:24 UTC 37,625 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9749],{39749:function(e,t,r){r.d(t,{oH:function(){return ge},GR:function(){return Y},A:function(){return Ie},PW:function(){return F}});var s=r(59499),n=r(67294),a=r(16523),i=r(21165),l=r(39233),o=r(22834),d=r(45704),c=r(25988),u=r(13037),m=r(11163),p=r(88767),f=r(41664),x=r.n(f),h=r(85893),b=function(){return(0,h.jsxs)("div",{className:"text-tiny text-blackHole",children:["Not sure who your distributor is and if you have one?"," ",(0,h.jsx)(x(),{href:"/find-a-distributor",passHref:!0,children:(0,h.jsx)("a",{className:"text-blue-500 underline hover:cursor-pointer",children:"Click here"})})]})},g=r(64431),v=r(19759),j=r(4898),y=r(86010),w={firstName:{label:"First Name",placeholder:"Your First Name"},middleName:{label:"Middle Name (Optional)",placeholder:"Your Middle Name"},lastName:{label:"Last Name",placeholder:"Your Last Name"},email:{label:"Email",placeholder:"Your Email",type:"email"},phone:{label:"Phone Number (Optional)",placeholder:"Your Phone Number"},companyName:{label:"Company / Shop (Optional)",placeholder:"Your Company Or Shop Name"},distributorName:{label:"Distributor Name (Optional)",placeholder:"Your Distributor Name"}},N=function(e){var t=e.infoComponent,r=e.valuesToDisplay,s=e.name,a=e.detailData,i=e.editingItem,l=e.setEditingItem,o=e.control,d=e.resetDetailItem,c=e.handleSubmit,u=e.onSubmit,m=e.clientValidationErrors,p=e.serverValidationErrors,f=e.children,x=e.disabledEdit,b=void 0!==x&&x,N="Phone Number"===s,O="Profile Status"===s,P=(0,n.useRef)(!1),C=(0,n.useRef)(!1),D=(0,n.useMemo)((function(){return r.reduce((function(e,t){var r=(null===a||void 0===a?void 0:a[t])||"",s=N?(0,g.u)(r):r;if(O){var n=null!==a&&void 0!==a&&a[t]||null===a||void 0===a||!a.emailVerified?"Not Verified":"Verified";return P.current=(null===a||void 0===a?void 0:a.student)||!1,C.current=(null===a||void 0===a?void 0:a.isInstructor)||!1,"".concat(e).concat(n," ")}return"".concat(e).concat(s," ")}),"")}),[a,N,r,O]),S=i===s;return!O||O&&(P.current||C.current)?S?(0,h.jsxs)("div",{"data-testid":"edit-".concat(s.toLowerCase()),className:"mt-6 rounded-lg border-1 border-grey-500 px-4 py-8 lg:mt-8 lg:p-8",children:[(0,h.jsxs)("div",{className:"text-2xl font-bold text-black",children:["Edit ",s]}),(0,h.jsx)("div",{className:"mt-4 flex flex-wrap gap-4",children:null===r||void 0===r?void 0:r.map((function(e){var t,r,s;return(0,h.jsx)("div",{className:"w-full max-w-[400px] shrink",children:(0,h.jsx)(v.M,{type:"phone"===e?"tel":"text",name:e,control:o,placeholder:null===w||void 0===w||null===(t=w[e])||void 0===t?void 0:t.placeholder,label:null===w||void 0===w||null===(r=w[e])||void 0===r?void 0:r.label,error:(null===m||void 0===m||null===(s=m[null!==e&&void 0!==e?e:""])||void 0===s?void 0:s.message)||(null===p||void 0===p?void 0:p[null!==e&&void 0!==e?e:""])||"",formatHandler:"phone"===e?function(e){return e.replace(/\D/g,"")}:void 0})},e)}))}),(0,h.jsxs)("div",{className:"mt-6 flex lg:mt-8",children:[(0,h.jsx)(j.z,{onClick:c(u),className:"shrink basis-[360px]",children:"Save"}),(0,h.jsx)(j.z,{onClick:function(){l(null),d(s)},kind:"tag",className:"ml-2 shrink basis-[360px]",children:"Cancel"})]})]}):(0,h.jsxs)("div",{className:"mt-4 border-b-1 border-grey-500 first:mt-0 last:border-none",children:[f,(0,h.jsxs)("div",{className:(0,y.Z)(" hover:bg-blue-100 lg:px-4 lg:py-2.5",{"mb-3.5":!t,"lg:pb-1":!!t}),children:[(0,h.jsx)("div",{className:"text-tiny text-grey-900",children:s}),(0,h.jsxs)("div",{className:"mt-2 flex",children:[(0,h.jsx)("div",{className:"min-w-0 flex-1 overflow-hidden text-ellipsis text-xl text-black",children:D.trim()||"Not specified"}),!O&&(0,h.jsx)("div",{className:"whitespace-nowrap",children:(0,h.jsx)("button",{type:"button",onClick:function(){l((function(e){return e&&d(e),s}))},disabled:b,children:(0,h.jsx)("span",{className:(0,y.Z)("font-medium text-blue-500",{"text-grey-600":b}),children:"Edit"})})})]})]}),t&&(0,h.jsx)("div",{className:"mt-1 lg:px-4 lg:py-2",children:t})]}):null},O=r(7258),P=r(65024);function C(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,s)}return r}function D(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};
1t%2?C(Object(r),!0).forEach((function(t){(0,s.Z)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):C(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var S=D(D({},r(41536).I),{},{middleName:O.string().notRequired().max(P.v6.maxLengths.middleName,P.dX.middleName.maxLength),phone:O.string().test("len",P.dX.phoneNumber.length,(function(e){var t;return(null===e||void 0===e||null===(t=e.toString())||void 0===t?void 0:t.length)===P.v6.lengths.phoneNumber||!e})).notRequired(),companyName:O.string().notRequired().max(P.v6.maxLengths.companyName,P.dX.companyName.maxLength)});function k(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,s)}return r}var E=O.object().shape(function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?k(Object(r),!0).forEach((function(t){(0,s.Z)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):k(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},S),[["phone","phone"]]),A=function(){var e=(0,a.useRendererContext)().gqlClient,t=(0,u.useMyCustomerQuery)(e),r=t.data,s=t.isLoading,n=(0,u.useCreateVerificationTokenMutation)(e),i=n.mutate,o=n.isLoading,d=n.isSuccess,c=n.data,m=((null===r||void 0===r?void 0:r.getCustomerInformation)||{}).customer,p=null===m||void 0===m?void 0:m.verificationPending,f=null===m||void 0===m?void 0:m.student,x=null===m||void 0===m?void 0:m.isInstructor,b=null===m||void 0===m?void 0:m.emailVerified;return f||x?b||s?(0,h.jsx)("div",{className:"text-tiny text-blackHole",children:p&&!s?(0,h.jsxs)(h.Fragment,{children:["Email"," ",(0,h.jsx)("a",{className:"text-blue-500 underline hover:cursor-pointer",href:"mailto: [email protected]",children:"[email protected]"})," ","a piece of information with your name and your school's name displayed to get student prices"]}):(0,h.jsx)("div",{children:"Your Profile is verified."})}):(0,h.jsxs)("div",{className:"text-tiny text-blackHole",children:[d&&(0,h.jsx)(h.Fragment,{children:"A email has been sent to verify your account."}),o&&(0,h.jsx)(l.$,{}),!c&&!o&&(0,h.jsxs)(h.Fragment,{children:["Please ",(0,h.jsx)("a",{className:"text-blue-500 underline hover:cursor-pointer",onClick:function(){return i({})},children:"click here"})," ","to send a email to verify your account"]})]}):null};function L(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,s)}return r}function M(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?L(Object(r),!0).forEach((function(t){(0,s.Z)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):L(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var T=[{name:"Name",valuesToDisplay:["firstName","middleName","lastName"]},{name:"Email",valuesToDisplay:["email"]},{name:"Phone Number",valuesToDisplay:["phone"]},{name:"Company / Shop",valuesToDisplay:["companyName"]},{name:"Distributor name",valuesToDisplay:["distributorName"],infoComponent:(0,h.jsx)(b,{})},{name:"Profile Status",valuesToDisplay:["verificationPending"],infoComponent:(0,h.jsx)(A,{})}],I={mode:"all",defaultValues:{email:"",firstName:"",middleName:"",lastName:"",companyName:"",distributorName:"",phone:"",verificationPending:!1,student:!1,isInstructor:!1,emailVerified:!1}},F=function(e){var t,r=e.accountMenu,s=(0,n.useState)(null),f=s[0],x=s[1],b=(0,n.useState)(null),g=b[0],v=b[1],j=(0,a.useRendererContext)().gqlClient,y=(0,p.useQueryClient)(),w=(0,m.useRouter)().push,O=(0,u.useMyCustomerQuery)(j),P=O.data,C=O.isLoading,D=!(null===P||void 0===P||null===(t=P.getCustomerInformation.customer)||void 0===t||!t.id)&&i.z.getIsRegistered(),S=((null===P||void 0===P?void 0:P.getCustomerInformation)||{}).customer,k="Personal & Contact Details",A=(0,u.getViewId)(),L=(0,n.useMemo)((function(){var e=M({},I.defaultValues);
1return Object.keys(I.defaultValues).forEach((function(t){e[t]=null===S||void 0===S?void 0:S[t]})),e}),[S]),F={Name:u.useUpdateCustomerNameMutation,Email:u.useUpdateCustomerEmailMutation,"Phone Number":u.useUpdateCustomerPhoneMutation,"Company / Shop":u.useUpdateCustomerCompanyNameMutation,"Distributor name":u.useUpdateCustomerDistributorNameMutation}[f||"Name"],B=function(e){var t,r,s,n="Failed to update ".concat(f.toLowerCase(),". Please try again."),a=null===e||void 0===e||null===(t=e.response)||void 0===t||null===(r=t.errors)||void 0===r||null===(s=r[0])||void 0===s?void 0:s.extensions;a&&a.errors&&a.errors.length>0&&(n=a.errors[0].message),v({name:f,status:"error",message:n}),x(null),y.invalidateQueries(u.useMyCustomerQuery.getKey())},V=(0,a.useValidation)(F,(function(){v({name:f,status:"success",message:"Your ".concat(f.toLowerCase()," has been changed!")}),x(null),y.invalidateQueries(u.useMyCustomerQuery.getKey())}),E,I),q=V.control,Z=V.mutation,z=V.setValue,R=V.clientValidationErrors,Y=V.serverValidationErrors,_=V.setServerValidationErrors,U=V.clearErrors,Q=V.handleSubmit,G=function(e){var t={};T.find((function(e){return e.name===f})).valuesToDisplay.forEach((function(r){t[r]=e[r]})),t.version=S.version,Z.mutate(t,{onError:B})},H=function(e){var t;v(null),U(),_(void 0);var r=null===(t=T.find((function(t){return t.name===e})))||void 0===t?void 0:t.valuesToDisplay;null===r||void 0===r||r.forEach((function(e){z(e,null===L||void 0===L?void 0:L[e])}))};return(0,n.useEffect)((function(){L&&Object.entries(L).forEach((function(e){z(e[0],e[1]||"")}))}),[L,z]),(0,n.useEffect)((function(){C||D||w("/account/signin")}),[C,D,w]),(0,h.jsx)("div",{className:"w-full pb-8 lg:pb-14",children:C?(0,h.jsx)("div",{className:"flex h-full w-full items-center justify-center",children:(0,h.jsx)(l.$,{})}):(0,h.jsx)(h.Fragment,{children:D&&(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(o.z,{lastCrumbTitle:k}),(0,h.jsxs)("div",{className:"flex w-full",children:[(0,h.jsx)(d.B,{menuItems:r,type:"account"}),(0,h.jsxs)("div",{className:"w-full lg:ml-8 lg:grow",children:[(0,h.jsx)("h1",{className:"text-2xl font-bold text-black lg:text-3.5xl lg:font-medium",children:k}),(0,h.jsx)("form",{className:"mt-6",children:T.map((function(e){return(0,h.jsx)(N,M(M({clientValidationErrors:R,serverValidationErrors:Y,control:q,resetDetailItem:H,handleSubmit:Q,onSubmit:G,editingItem:f,setEditingItem:x},e),{},{detailData:L,disabledEdit:e.valuesToDisplay.includes("email")&&A.some((function(e){return e.includes("TYPE06")})),children:(null===g||void 0===g?void 0:g.name)===e.name&&(0,h.jsx)(c.R,{timeToDisplayInMs:4e3,className:"mb-6",status:g.status,message:g.message})}),e.name)}))})]})]})]})})})},B=r(50029),V=r(87794),q=r.n(V),Z=r(48349),z={mode:"all",defaultValues:{currentPassword:"",newPassword:""}},R=O.object().shape({currentPassword:O.string().required(P.g0.password.required),newPassword:P.Dx}),Y=function(e){var t=e.accountMenu,r="Change Password",s=function(){var e=(0,B.Z)(q().mark((function e(){return q().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),i=(0,a.useValidation)(u.useChangeMyPasswordMutation,s,R,z),l=i.handleSubmit,m=i.renderErrorMessage,p=i.control,f=i.mutation,x=i.serverValidationErrors;return(0,n.useEffect)((function(){null===f||void 0===f||!f.isError||null!==x&&void 0!==x&&x.general||(0,Z.x)("error",{errorMessage:"Error while updating password"})}),[null===f||void 0===f?void 0:f.isError,x.general]),(0,h.jsxs)("div",{className:"w-full pb-8 lg:pb-14",children:[(0,h.jsx)(o.z,{lastCrumbTitle:r}),(0,h.jsxs)("div",{className:"flex w-full",children:[(0,h.jsx)(d.B,{menuItems:t,type:"account"}),(0,h.jsxs)("div",{className:"my-8 w-full lg:ml-8 lg:grow",children:[(null===f||void 0===f?void 0:f.isSuccess)&&(0,h.jsx)(c.R,{timeToDisplayInMs:5e3,className:"mb-5",status:"success",message:"Your password has been changed"}),(0,h.jsxs)("div",{className:"rounded-lg border-1 border-1 border-grey-500 bg-white py-2 px-4 py-6 px-4 md:px-8",children:[(0,h.jsx)("h1",{className:"mb-8 text-2xl font-bold text-black lg:text-3.5xl lg:font-medium",children:r}),(0,h.jsxs)("form",{className:"max-w-[490px]",children:[(0,h.jsx)("div",{className:"mb-6",children:(0,h.jsx)(v.M,{required:!0,label:"Current Password","data-testid":"currentPassword",placeholder:"Current password",requiredSymbol:!1,type:"password",withPasswordIcon:!0,name:"currentPassword",control:p,error:m("currentPassword")})}),(0,h.jsxs)("div",{className:"mb-6",children:[(0,h.jsx)(v.M,{required:!0,label:"New Password","data-testid":"newPassword",placeholder:"New password",requiredSymbol:!1,type:"password",withPasswordIcon:!0,name:"newPassword",control:p,error:m("newPassword"),withTooltip:!0}),f.isError&&(0,h.jsx)("p",{className:"mt-2 px-1 text-tiny text-red-600",children:x.general||"Error while updating password"})]}),(0,h.jsx)("div",{children:(0,h.jsx)(j.z,{kind:"primary","data-testid":"submit",onClick:l((function(e){var t=e.currentPassword,r=e.newPassword;f.mutate({currentPassword:t,newPassword:r})})),isLoading:null===f||void 0===f?void 0:f.isLoading,uppercase:!0,className:"flex w-full items-center justify-center disabled:text-grey-900",children:"Save"})})]})]})]})]})]})},_=r(49808),U=r(9396),Q=r(4730),G=r(84651),H=r(33616),$=r(16168),W=r(20920),K=r(45863),X=r(27601),J=r(17001),ee=r(20270),te=r(51897),re=r(77467),se=r(20175),ne=r(15350);function ae(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,s)}return r}function ie(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};
1t%2?ae(Object(r),!0).forEach((function(t){(0,s.Z)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ae(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var le=function(e){return(0,X.Z)(e)?"":e},oe=(0,J.Z)(te.$1),de=function(e){var t=e.handleCloseForm,r=e.handleDelete,s=e.addressData,n=e.isBilling,a=!(null===s||void 0===s||!s.id),i=a?function(e){return ie(ie({},e),{},{firstName:le(null===e||void 0===e?void 0:e.firstName),lastName:le(null===e||void 0===e?void 0:e.lastName),phone:(0,g.u)((null===e||void 0===e?void 0:e.phone)||""),state:oe[e.state]||e.state,isManualAddressLookup:!0,streetAddress:e.streetName,isDefault:e.isDefaultAddress,copyAddress:e.isShippingAndBilingAddress})}(s):{},l=(0,p.useQueryClient)(),o=function(){var e=(0,B.Z)(q().mark((function e(){return q().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,l.invalidateQueries(u.useMyCustomerQuery.getKey());case 2:t();case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),d=a?u.useChangeCustomerAddressMutation:u.useAddCustomerAddressMutation,c=(0,se.N)({mutation:d,formOptions:{mode:"all",defaultValues:i},initializedSchema:ee.initializedAddressBookSchema,onSuccess:o}),m=c.getValues,f=c.handleSubmit,x=c.watch,b=c.mutation,v=function(){var e=(0,B.Z)(q().mark((function e(t){var r,i,l;return q().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.state,i=t.isDefault,l=void 0!==i&&i,e.prev=1,e.next=4,b.mutateAsync(ie(ie({},t),{},{state:2!==(null===r||void 0===r?void 0:r.length)?te.$1[r]:r,isDefault:l,type:n?"billingAddress":"shippingAddress"},a&&{addressId:s.id}));case 4:e.next=9;break;case 6:e.prev=6,e.t0=e.catch(1),ne.k.error({error:e.t0},"useShippingAddressFormValidation error");case 9:case"end":return e.stop()}}),e,null,[[1,6]])})));return function(t){return e.apply(this,arguments)}}(),y=m().isManualAddressLookup;return x("isManualAddressLookup"),(0,h.jsxs)("form",{className:"flex flex-col gap-6 rounded-lg border-1 border-solid border-grey-500 p-4 sm:p-8",onSubmit:f(v),children:[(0,h.jsxs)("div",{className:"flex items-center justify-between",children:[(0,h.jsx)("div",{children:(0,h.jsx)("h2",{className:"text-2xl font-black text-black",children:a?"Edit address":"Add new ".concat(n?"billing":"shipping"," address")})}),(0,h.jsx)("button",{type:"button","data-testid":"trash-icon-button",onClick:a&&r?r:t,children:(0,h.jsx)($.Z,{})})]}),(0,h.jsx)("div",{className:"flex max-w-[804px] flex-col gap-6",children:(0,h.jsx)(re.bJ,{validationProps:c,isManualAddressLookup:y})}),(0,h.jsxs)("div",{className:"my-2 flex flex-col items-start gap-4",children:[(0,h.jsx)("div",{children:(0,re.y_)(c)({name:"copyAddress",label:"Use as shipping and billing address",type:"checkbox",isDisabled:a&&!(null===s||void 0===s||!s.isShippingAndBilingAddress)})}),(0,h.jsx)("div",{children:(0,re.y_)(c)({name:"isDefault",label:"Use as default address",type:"checkbox"})})]}),(0,h.jsxs)("div",{className:"flex flex-col items-center gap-2 sm:flex-row",children:[(0,h.jsx)(j.z,{kind:"primary",uppercase:!0,buttonType:"submit",size:"h48",className:"flex w-full items-center gap-1.5 !font-medium md:w-6/12 md:max-w-[360px]",isLoading:b.isLoading,children:"Save"}),(0,h.jsx)(j.z,{kind:"stroke",uppercase:!0,size:"h48",className:"flex w-full items-center gap-1.5 !font-medium md:w-6/12 md:max-w-[360px]",onClick:t,children:"Cancel"})]})]})},ce=["setDefaultAddress"],ue=function(){return(0,h.jsxs)("div",{className:"flex items-center gap-1",children:[(0,h.jsx)(G.Z,{width:16,height:16,viewBox:"0 0 25 25"}),(0,h.jsx)("span",{className:"text-tiny font-bold text-green-700",children:"Default address"})]})},me=function(e){var t=e.onClick;return(0,h.jsx)("div",{className:"flex items-start",children:(0,h.jsx)("button",{type:"button",className:"text-tiny text-black underline",onClick:t,children:"Use as default"})})},pe=function(e){var t=e.setDefaultAddress,r=(0,Q.Z)(e,ce),s=r.id,i=r.firstName,l=r.lastName,o=r.streetName,d=r.city,c=r.state,u=r.postalCode,m=r.email,p=r.phone,f=r.isDefaultAddress,x=r.additionalAddressInfo,b=(0,n.use
1State)(!1),g=b[0],v=b[1],j=(0,n.useState)(!1),y=j[0],w=j[1],N=(0,a.useAddressActions)().removeCustomerAddress,O=function(){return w(!0)};if(!s)return null;var P=[];m&&P.push((0,H.SV)({email:m})),p&&P.push((0,H.Dw)({phone:p})),o&&d&&u&&P.push((0,H.Hm)({streetName:o,city:d,postalCode:u,state:c||void 0,additionalAddressInfo:null!==x&&void 0!==x?x:void 0}));var C=(0,h.jsxs)("div",{className:"flex items-center justify-between sm:mb-2",children:[(0,h.jsxs)("div",{children:[(0,h.jsxs)("span",{className:"mr-4 text-2xl font-black text-black",children:[i," ",l]}),(0,h.jsx)("button",{type:"button",className:"text-base font-bold text-blue-500",onClick:function(){return v(!0)},children:"Edit"})]}),(0,h.jsx)("button",{type:"button",onClick:O,"data-testid":"delete-button",children:(0,h.jsx)($.Z,{})})]}),D=(0,h.jsxs)("article",{className:"flex flex-col gap-3 rounded-lg border-1 border-solid border-grey-500 p-4 sm:gap-4 sm:p-8",children:[(0,h.jsx)(W.i,{className:"gap-2",header:C,summaryItems:P}),f?(0,h.jsx)(ue,{}):(0,h.jsx)(me,{onClick:function(){return t(s)}})]});return g&&(D=(0,h.jsx)(de,{handleCloseForm:function(){return v(!1)},addressData:r,handleDelete:O})),(0,h.jsxs)(h.Fragment,{children:[D,y&&(0,h.jsx)(K.u,{onBack:function(){return w(!1)},onRemove:function(){return N(s)},show:y,type:"remove",description:"This address will be deleted permanently.",title:"Delete address?",removeButtonText:"DELETE",backButtonText:"BACK TO ADDRESS BOOK"})]})};function fe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,s)}return r}function xe(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?fe(Object(r),!0).forEach((function(t){(0,s.Z)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):fe(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var he=function(e){var t=e.children;return(0,h.jsx)(_.O,{as:n.Fragment,children:function(e){var r=e.selected;return(0,h.jsx)("button",{type:"button",className:(0,y.Z)("w-full py-4 text-sm font-bold uppercase sm:w-max sm:px-8",{"text-black":!r,"border-b-2 border-solid border-blue-500 text-blue-500":r}),children:t})}})},be=function(e){var t=e.addresses,r=e.isFormOpen,s=e.isBilling,n=e.setDefaultAddress,a=e.handleCloseForm,i=r||null!==t&&void 0!==t&&t.length?(0,h.jsx)("div",{className:"flex flex-col gap-6 sm:gap-8",children:null===t||void 0===t?void 0:t.map((function(e,t){return(0,h.jsx)(pe,xe(xe({},e),{},{setDefaultAddress:n,isBilling:s}),(null===e||void 0===e?void 0:e.id)||t)}))}):(0,h.jsx)("div",{className:"flex h-80 items-center justify-center sm:h-52",children:(0,h.jsx)("span",{className:"text-sm uppercase text-grey-700",children:"You have no saved addresses yet"})});return(0,h.jsxs)(_.O.Panel,{children:[r&&(0,h.jsx)("div",{className:"mb-6 sm:mb-8",children:(0,h.jsx)(de,{handleCloseForm:a,isBilling:s})}),i]})},ge=function(e){var t=e.accountMenu,r=e.user,s=r||{},i=s.shippingAddresses,c=void 0===i?[]:i,u=s.billingAddresses,m=void 0===u?[]:u,p=(0,n.useState)(!1),f=p[0],x=p[1],b=function(){return x(!1)},g=(0,a.useAddressActions)(),v=g.setDefaultShippingAddress,y=g.setDefaultBillingAddress;return(0,h.jsx)("div",{className:"w-full pb-8 lg:pb-14",children:r?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(o.z,{lastCrumbTitle:"My Profile"}),(0,h.jsxs)("div",{className:"flex w-full",children:[(0,h.jsx)(d.B,{menuItems:t,type:"account"}),(0,h.jsxs)("div",{className:"mt-8 w-full sm:mt-0 lg:ml-8 lg:grow",children:[(0,h.jsxs)("div",{className:"mb-6 flex flex-col items-start justify-between gap-6 sm:mb-8 sm:flex-row sm:items-center",children:[(0,h.jsx)("h1",{className:"text-2xl font-bold text-black lg:text-3.5xl lg:font-medium",children:"Address Book"}),(0,h.jsxs)(j.z,{className:"gap-2",size:"s",onClick:function(){return x(!0)},children:[(0,h.jsx)(U.Z,{className:"stroke-white"}),"ADD NEW ADDRESS"]})]}),(0,h.jsxs)(_.O.Group,{onChange:b,children:[(0,h.jsxs)(_.O.List,{className:"mb-6 flex items-end border-b-1 border-solid border-grey-500 sm:mb-8",children:[(0,h.jsx)(he,{children:"Shipping Address"}),(0,h.jsx)(he,{children:"Billing Address"})]}),(0,h.jsxs)(_.O.Panels,{children:[(0,h.jsx)(be,{addresses:c,isFormOpen:f,setDefaultAddress:v,handleCloseForm:b}),(0,h.jsx)(be,{isFormOpen:f,addresses:m,setDefaultAddress:y,handleCloseForm:b,isBilling:!0})]})]})]})]})]}):(0,h.jsx)("div",{className:"flex h-full w-full items-center justify-center",children:(0,h.jsx)(l.$,{})})})},ve=r(65409),je=r(6386),ye=r(25742),we=new Intl.DateTimeFormat("en",{month:"short"}),Ne=new Date,Oe=(0,n.memo)((function(e){var t=e.firstName,r=e.lastName,s=e.isStudent,n=e.graduationMonth,a=e.graduationYear,i=e.isInstructor,l=s?"Student":"Instructor";return(0,h.jsxs)("div",{className:"flex justify-between gap-5",children:[(0,h.jsxs)("div",{children:[(0,h.jsxs)("h3",{className:"mb-2 text-3.5xl font-bold",children:["Welcome, ",t," ",r,"!"]}),s&&(0,h.jsxs)("p",{className:"text-xl",children:["Graduation Date: ",we.format(new Date(2e3,Number(n)-1))," ",a]})]}),(s||i)&&(0,h.jsx)("div",{className:"self-start rounded-3xl bg-blue-500 py-2.5 px-6 text-sm uppercase text-white",children:l})]})})),Pe=(0,n.memo)((function(e){var t=e.graduationMonthCount,r=e.percentElapsed,s=e.graduationCta;return(0,h.jsxs)("div",{className:"my-3 flex flex-col items-center gap-3 rounded-lg border-1 border-grey-500 bg-white px-5 py-4 md:flex-col lg:flex-row ",children:[(0,h.jsxs)("h4",{className:"text-2xl font-bold",children:[t<2?"Less than 1 month to graduation":"".concat(t," Months To Graduation")," "]}),(0,h.jsx)("div",{className:"h-2.5 w-full w-full max-w-[370px] rounded-full bg-[#E3F2FA]",children:(0,h.jsx)("div",{className:"h-2.5 max-w-full rounded-full bg-blue-500",style:{width:"".concat(r,"%")}})}),s.href&&(0,h.jsx)(x(),{kind:"secondary",href:s.href,children:(0,h.jsx)("a",{className:"flex flex-1 items-center justify-center border-1 border-grey-300 bg-grey-300 p-4 text-sm font-bold uppercase text-black hover:border-blue-500 hover:text-blue-500 active:border-grey-400 active:bg-grey-400 active:text-black disabled:border-grey-200 disabled:bg-grey-200 disabled:text-[#737373]",children:s.title})})]})})),Ce=r(55345),De=r(40760),Se=r(5902);function ke(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,s)}return r}function Ee(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};
1t%2?ke(Object(r),!0).forEach((function(t){(0,s.Z)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ke(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Ae=(0,n.memo)((function(e){var t=e.title,r=e.tooltipText,s=e.sectionTitle,n=e.currentSpendCap,i=e.subtitle,l=(0,a.useStudentOrderTotalLimit)();return(0,h.jsxs)("div",{className:"mb-6",children:[(0,h.jsx)("h3",{className:"mb-6 text-3.5xl font-bold md:text-5xl",children:s}),(0,h.jsxs)("div",{className:"flex flex-col gap-3 lg:flex-row",children:[(0,h.jsxs)("div",{className:"flex h-[133px] flex-col justify-center rounded border-2 border-blue-500 bg-white text-center lg:flex-1",children:[(0,h.jsx)("p",{className:"mb-2 text-3.5xl font-bold text-blue-500 md:text-5xl",children:t}),(0,h.jsx)("p",{className:"text-xs text-blue-500",children:i})]}),(0,h.jsxs)("div",{className:"relative flex h-[133px] flex-col justify-center rounded border-2 border-blue-500 bg-white text-center lg:flex-1",children:[(0,h.jsxs)("p",{className:"my-0 mx-auto mb-2 flex items-center text-5xl font-bold text-blue-500",children:[(0,Ce._)(n&&(null===n||void 0===n?void 0:n.formattedAmount)>0?Ee(Ee({},n),{},{formattedAmount:l.formattedAmount-n.formattedAmount>0?l.formattedAmount-n.formattedAmount:0}):l)," ",r&&(0,h.jsx)(De.u,{body:r,trigger:(0,h.jsx)(Se.Z,{className:"ml-1 block"}),bottomStyle:"bottom-2"})]}),(0,h.jsx)("p",{className:"text-xs text-blue-500",children:"order limit left "})]})]})]})})),Le=r(81676);function Me(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,s)}return r}function Te(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Me(Object(r),!0).forEach((function(t){(0,s.Z)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Me(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Ie=function(e){var t,r,s,i,c,m,p,f,x,b,g,v,w,N,O=e.accountMenu,P=e.user,C=e.isStudent,D=e.isInstructor,S=e.isLoading,k=e.cmsPageData,E=e.verificationPending,A=new Date((0,ye.Z)(P.graduationYear),(0,ye.Z)(P.graduationMonth),1),L=C&&function(e,t){return 12*(t.getFullYear()-e.getFullYear())+(t.getMonth()-e.getMonth())}(new Date,A),M=C&&function(e){var t=new Date(Ne.getFullYear(),Ne.getMonth()-24,Ne.getDate()),r=(new Date).getTime(),s=t.getTime(),n=new Date(e).getTime()-s,a=Math.max(0,r-s);return Math.round(a/n*100)}(A),T=a.carouselsMap.wishlist_carousel,I="".concat((new Date).toISOString().slice(0,10),"T23:59:59.999Z"),F=(0,Le.getSetDate)((0,Le.getFromDate)("all"),0,0,0),B=(0,a.useRendererContext)().gqlClient,V=(0,u.useGetMyOrdersQuery)(B,{limit:3,offset:0,startDate:F,endDate:I,sort:["createdAt desc"]}),q=V.data,Z=V.isLoading,z=null===q||void 0===q||null===(t=q.getMyOrders)||void 0===t||null===(r=t.orders)||void 0===r?void 0:r.results,R=(C||D)&&(!(null!==P&&void 0!==P&&P.emailVerified)||E);return S||Z?(0,h.jsx)(l.$,{}):(0,h.jsxs)("div",{className:"w-full pb-8 lg:pb-14",children:[(0,h.jsx)(o.z,{lastCrumbTitle:"Dashboard"}),(0,h.jsxs)("div",{className:"flex w-full",children:[(0,h.jsx)(d.B,{menuItems:O,type:"account"}),(0,h.jsxs)("div",{className:"w-full lg:ml-8 lg:grow",children:[(0,h.jsx)("div",{className:"mb-8",children:(0,h.jsx)(Oe,{firstName:P.firstName,lastName:P.lastName,isStudent:C,isInstructor:D,graduationYear:P.graduationYear,graduationMonth:P.graduationMonth})}),R&&E&&(0,h.jsx)(a.TextBlockComponent,Te({},null===(s=k.emailVerify)||void 0===s?void 0:s[0])),R&&!(null!==P&&void 0!==P&&P.emailVerified)&&(0,h.jsx)(a.DocumentReview,Te({},null===(i=k.documentPending)||void 0===i?void 0:i[0])),!D&&!C&&!R&&(0,h.jsx)("div",{className:"mb-6 flex w-full","data-testid":"regularUsersBanner",children:(0,h.jsx)(ve.j,Te({},null===(c=k.regularUsersBanner)||void 0===c||null===(m=c[0])||void 0===m?void 0:m.contents))}),(C||D)&&!R&&(0,h.jsxs)("div",{className:"mb-8 bg-grey-100 p-6",children:[C&&
1(0,h.jsx)(Ae,{title:k.benefitBanner.title,subtitle:k.benefitBanner.subtitle,sectionTitle:k.benefitBanner.benefitsSectionTitle,tooltipText:k.benefitBanner.tooltipText,currentSpendCap:null===P||void 0===P?void 0:P.accumulatedOrderSubtotal}),(null===(p=k.studentGraduationBanner)||void 0===p||null===(f=p[0])||void 0===f?void 0:f.contents)&&(0,h.jsx)("div",{className:"mb-6 flex w-full","data-testid":"studentGraduationBanner",children:(0,h.jsx)(ve.j,Te({},null===(x=k.studentGraduationBanner)||void 0===x||null===(b=x[0])||void 0===b?void 0:b.contents))}),C&&(0,h.jsx)(Pe,{graduationMonthCount:L,percentElapsed:M,graduationCta:k.graduationCta})]}),(C||D)&&!R&&(0,h.jsx)("div",{className:(0,y.Z)("grid grid-cols-1 gap-7 self-end pb-6 lg:grid-cols-[1fr_2fr] lg:pb-8"),children:(0,h.jsxs)(h.Fragment,{children:[(null===(g=k.studentAndInstructorUsersBanner)||void 0===g||null===(v=g[0])||void 0===v?void 0:v.contents)&&(0,h.jsx)("div",{className:"dashboard-instructor__banner relative flex h-full w-full","data-testid":"studentAndInstructorUsersBanner",children:(0,h.jsx)(ve.j,Te({},null===(w=k.studentAndInstructorUsersBanner)||void 0===w||null===(N=w[0])||void 0===N?void 0:N.contents))}),(0,h.jsx)("div",{className:"flex items-end","data-testid":"studentSpecialCarousel",children:function(){var e,t;if(!C&&!D||null===(e=k.studentSpecialCarousel)||void 0===e||!e.length)return null;var r=null===(t=k.studentSpecialCarousel)||void 0===t?void 0:t[0],s=a.carouselsMap[null===r||void 0===r?void 0:r.contentTypeUid];return(0,h.jsx)(s,Te(Te({},r),{},{breakPoints:[{width:1,itemsToShow:r.mobileElementsPerPage,itemsToScroll:r.mobileElementsPerPage},{width:425,itemsToShow:2,itemsToScroll:2},{width:900,itemsToShow:3,itemsToScroll:3},{width:1200,itemsToShow:4,itemsToScroll:4}]}))||null}()})]})}),(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)("div",{className:"pb-6 lg:pb-8",children:(0,h.jsx)(T,{})}),(0,h.jsx)("div",{className:"bg-white",children:(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)("h4",{className:"font-bold",children:"Latest orders"}),(0,h.jsx)("div",{className:"grid-col-1 grid gap-6 py-6 md:gap-8 md:py-8",children:(null===z||void 0===z?void 0:z.map((function(e,t){return(0,n.createElement)(Le.OrderCard,Te(Te({},e),{},{key:"dashboard-order-card-".concat(t+1),isButtonWithLockIcon:!0}))})))||(0,h.jsx)(Le.NoOrders,{})}),(null===z||void 0===z?void 0:z.length)&&(0,h.jsx)(je.x,{className:"hover:cursor-pointer",href:{pathname:"/account/my-orders"},passHref:!0,children:(0,h.jsx)(j.z,{className:"m-auto shrink-0 items-center !py-4 !px-12 text-xs hover:text-blue-500 lg:m-0",size:"se",type:"rounded",kind:"bright",fullWidth:"mobileOnly",children:(0,h.jsx)("span",{className:"uppercase",children:"VIEW ALL ORDERS"})})})]})})]})]})]})]})}},41536:function(e,t,r){r.d(t,{I:function(){return a}});var s=r(7258),n=r(65024),a={firstName:s.string().max(n.l9.maxLengths.firstName,n.g0.firstName.maxLength).required(n.g0.firstName.required),lastName:s.string().max(n.l9.maxLengths.lastName,n.g0.lastName.maxLength).required(n.g0.lastName.required),email:s.string().email(n.g0.email.format).required(n.g0.email.required).typeError(n.g0.email.format)}},65024:function(e,t,r){r.d(t,{Dx:function(){return p},dX:function(){return u},g0:function(){return c},l9:function(){return o},lX:function(){return m},v6:function(){return d}});var s=r(59499),n=r(54003),a=r(7258);function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,s)}return r}function l(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?i(Object(r),!0).forEach((function(t){(0,s.Z)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var o={maxLengths:{firstName:30,lastName:30,distributorName:100,zipCode:5,password:64,schoolCity:30,schoolName:100,instructorName:100,schoolProgram:100},minLengths:{zipCode:5,password:8,schoolCity:1,schoolName:1,instructorName:1,schoolProgram:1}},d={maxLengths:{middleName:30,companyName:100},minLengths:{middleName:1},lengths:{phoneNumber:10}},c=l(l({},{firstName:{required:"First Name is required",maxLength:"First Name must not exceed 30 characters"},lastName:{required:"Last Name is required",maxLength:"Last Name must not exceed 30 characters"},email:{required:"Email Address is required",format:"Email Address is not val
1id"},distributorName:{maxLength:"Distributor must not exceed 100 characters"}}),{},{password:{required:"Password is required",minLength:"Password must be more than 8 characters",maxLength:"Password name must not exceed 64 characters",lowerCaseSymbols:"Must contain at least one lowercase character",upperCaseSymbols:"Must contain at least one uppercase character",specialSymbols:"Must contain at least one special symbol"},zipCode:{required:"ZIP Code is required",requiredLength:"ZIP Code must be 5 digits"}}),u={middleName:{maxLength:"Middle Name must not exceed 30 characters"},phoneNumber:{length:"Phone number must be 10 digits length"},companyName:{maxLength:"Company name must not exceed 100 characters"}},m=["graduationYear","schoolId","schoolStateAbbr","schoolCity","schoolName","termsConditions","instructorName","graduationMonth","groupCode","schoolProgram"].reduce((function(e,t){var r=(0,n.Z)(function(e){return"schoolStateAbbr"===e?"schoolState":"schoolId"===e?"school":e}(t)),a=o.minLengths[t],i=o.maxLengths[t];return l(l({},e),{},(0,s.Z)({},t,l(l({required:"".concat(r," is required")},a&&{minLength:"".concat(r," must be ").concat(a," characters")}),i&&{maxLength:"".concat(r," must not exceed ").concat(i," characters")})))}),{}),p=a.string().required(c.password.required).min(o.minLengths.password,c.password.minLength).max(o.maxLengths.password,c.password.maxLength).matches(/^(?=.*[a-z])/,c.password.lowerCaseSymbols).matches(/^(?=.*[A-Z])/,c.password.upperCaseSymbols).matches(/[ !"#$%&'()*+,-./:;<=>?@[\\\]^_`{|}~]/,c.password.specialSymbols)},45863:function(e,t,r){r.d(t,{u:function(){return u}});var s=r(67294),n=r(86010),a=r(91799),i=r(90598),l=r(4898),o=r(11355),d=r(82299),c=r(85893),u=function(e){var t=e.show,r=e.onClose,u=void 0===r?function(){}:r,m=e.onBack,p=e.onRemove,f=e.title,x=e.removeButtonText,h=e.backButtonText,b=e.description,g=e.type;return(0,c.jsx)(a.h,{children:(0,c.jsx)(o.u,{appear:!0,show:t,as:s.Fragment,children:(0,c.jsxs)(d.V,{as:"div",className:"relative z-40",onClose:u,children:[(0,c.jsx)(o.u.Child,{as:s.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"ease-in duration-200",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,c.jsx)("div",{className:"fixed inset-0 bg-[#00000033]"})}),(0,c.jsx)("div",{className:"fixed inset-0 top-34 overflow-y-auto lg:top-60",children:(0,c.jsx)("div",{className:"flex items-center justify-center p-4 text-center",children:(0,c.jsx)(o.u.Child,{as:s.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"ease-in duration-200",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,c.jsxs)(d.V.Panel,{className:(0,n.Z)("relative flex w-full transform flex-col items-center gap-10 overflow-hidden rounded-lg bg-white p-6 py-8 px-4 text-left align-middle shadow-[0_4px_10px_rgba(0,0,0,0.1)] transition-all lg:p-14 lg:p-13",{"max-w-lg":"remove"===g,"max-w-xl":"sellable"===g}),children:[(0,c.jsx)(i.Z,{title:"Close",onClick:m,className:"absolute right-5 top-5 h-3.5 w-3.5 cursor-pointer"}),(0,c.jsx)(d.V.Title,{as:"h2",className:"text-center text-3.5xl  font-medium capitalize text-black  lg:text-4xl",children:f}),b&&(0,c.jsx)(d.V.Description,{className:"text-center text-xl",children:b}),(0,c.jsxs)("div",{className:"flex w-full flex-col gap-4 lg:flex-row",children:[(0,c.jsx)(l.z,{onClick:m,className:"order-last flex w-full items-center justify-center outline-none lg:order-none",kind:"bright",children:h}),(0,c.jsx)(l.z,{onClick:p,className:"flex w-full items-center justify-center",children:x})]})]})})})})]})})})}}}]);

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.