1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3231],{43231:(e,t,r)=>{"use strict";r.d(t,{A:()=>eB});var n=r(14232),a=r(2171),i=r(63857),l=r(67251),s=r(46126),o=r(29898),d=r(30291),c=r(76966),m=r(42969),u=r(43081),f=r.n(u),p=r(86032),h=r(60419),b=r(54253),x=r(47559),g=r(64277),_=r(1002),j=r(15039),v=r.n(j),y=r(62623),A=r(97968),N=r(83721),w=r.n(N),P=r(37876);let C=function(e){var t=e.userProfile,r=e.avatar,n=t.attributes,a=n.updated_fname,i=n.updated_lname;return(0,P.jsx)(y.default,{className:"".concat(w()["profile-pic-container"]," text-center mb-4"),id:"profile-pic-wrapper",children:(0,P.jsx)(y.default.Body,{className:"mt-md-4 mb-md-4",children:(0,P.jsxs)(h.A,{className:w()["flex-direction"],children:[(0,P.jsx)(b.A,{children:(0,P.jsx)(A.A,{children:function(e){return(0,P.jsx)(y.default.Img,{variant:"top",className:v()(w()["profile-pic"],"mb-2"),src:r||"/static/images/default-avatar.svg",onClick:e})}})}),(0,P.jsx)(b.A,{className:w()["profile-text-blk"],children:(0,P.jsxs)(y.default.Title,{className:"mt-3 fs-12 font-weight-medium",children:[a," ",i]})})]})})})};var E=r(72560),O=r(58001),D=r(26978),k=r.n(D),S=r(39324),B=r.n(S),U=r(42264),z=r.n(U),M=r(55370),I=r(10841),F=r.n(I),T=/^[A-Za-z][0-9][A-Za-z][\s-][0-9][A-Za-z][0-9]$/,L=function(e,t,r,n){var a=r.zippattern,i=r.minvalue;return t?M.Yj().matches(T,e.get("error-zip-code-ca-invalid")).min(e.get("zip-min-length"),e.get("error-zip-code-ca-length")).required(e.get("error-zip-code-required")).nullable():n?M.Yj().min(i,e.get("error-zip-code-length")).matches(a,e.get("error-zip-code-invalid")).required(e.get("error-zip-code-required")).nullable():M.Yj().nullable()},R=function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",a=arguments.length>4&&void 0!==arguments[4]&&arguments[4],i=arguments.length>5?arguments[5]:void 0,l=a?16:e.get("age-limit");return M.Ik().shape({updated_fname:M.Yj().required(e.get("error-first-name-required")),updated_lname:M.Yj().required(e.get("error-last-name-required")),zip:L(e,t,r,i),email:M.Yj().email(e.get("error-invalid-email")).required(e.get("error-email-invalid")),phone:M.Yj().min(e.get("phone-length"),e.get("error-phone-length")).required(e.get("error-phone-required")).matches(n,e.get("error-phone-regex")).nullable(),birthday:t?M.Yj().nullable():M.Yj().test("birthday",e.get("age-validation-message").replace("{{age-limit}}",l),function(e){return F()().diff(F()(e),"years")>=l}).nullable()})},Y=r(86131),H=r.n(Y),G=r(79492),q=r(58458),X=r(81074);function V(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function Z(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?V(Object(r),!0).forEach(function(t){(0,m.A)(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):V(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var Q=B()().publicRuntimeConfig;let W=function(e){var t=e.userProfile,r=e.handleFormSubmit,i=e.handleEdit,l=e.loader,s=(e.editable,e.i18n),o=e.domainCheck,d=e.arabicDomain,c=(0,a.useSelector)(function(e){return e.domainReducer}
1).domains,m=(0,n.useState)(null),u=m[0],f=m[1],p=(0,n.useState)(null),x=p[0],j=p[1],A=X.regionHelper.getDomainHash(o),N=A&&"myinv_uk"===A.override_url||!1,C=A&&"myinv_ca"===A.override_url||!1;(0,n.useEffect)(function(){if(G.A.init("XdDmMyY9"),c){var e=c.find(function(e){return e.domain===window.location.hostname});f(e),t.attributes.phone&&""!==t.attributes.phone||j(e&&e.countryCode?e.countryCode:"us")}},[]);var D=u&&u.countryCode===x?u&&u.phoneRegexp:"",S=s.custom("page.myprofile").zipcode,B=R(s,C,S,D,N,"EMEA"!==Q.APP_REGION),U=Z(Z({},t.attributes),t.attributes.birthday&&{birthday:F()(t.attributes.birthday,"DD-MM-YYYY")});return(0,P.jsxs)(y.default,{className:w()["profile-form-container"],id:"profile-form-wrapper",children:[(0,P.jsx)(y.default.Header,{className:"".concat(w()["card-header"]," pl-0 pr-0"),children:(0,P.jsxs)("div",{className:"row",children:[(0,P.jsx)(b.A,{className:(w()["card-header"],d&&"myinv_sa"===d?"order-2 text-left":"order-2 text-right"),children:(0,P.jsx)(g.A,{className:v()(w()["sa-edit-btn2"],w()["edit-btn"],"pl-0 pr-0 fs-14"),href:"/change_password",variant:"link",id:"change-pwd",children:s.get("change-password")})}),(0,P.jsx)(b.A,{className:d&&"myinv_sa"===d?v()(w()["sa-edit-2"],"order-1 text-right"):"order-1 text-left",children:(0,P.jsx)("p",{className:"mb-0 mt-2 fs-14",children:s.get("edit-profile")})})]})}),(0,P.jsx)(y.default.Body,{className:"mb-3 mt-3 pt-3",children:(0,P.jsx)(O.l1,{validationSchema:B,onSubmit:r,initialValues:U,children:function(e){var t=e.handleSubmit,r=e.handleChange,n=e.handleBlur,a=e.values,o=e.touched,c=e.errors,m=e.setFieldValue;return(0,P.jsx)("div",{children:(0,P.jsxs)(E.A,{onSubmit:t,id:"edit-profile-form",className:d&&"myinv_sa"===d&&"arabic-prof-form-warpper",children:[(0,P.jsxs)(h.A,{className:"mb-3",children:[(0,P.jsx)(b.A,{md:6,sm:12,className:"mb-3",children:(0,P.jsx)(y.default,{className:"p-3",children:(0,P.jsxs)(E.A.Group,{controlId:"form-updated-fname",children:[(0,P.jsx)(E.A.Label,{children:s.get("form-label-first-name")}),(0,P.jsx)(E.A.Control,{type:"text",name:"updated_fname",onChange:r,onBlur:n,value:a.updated_fname}),o.updated_fname&&c.updated_fname?(0,P.jsx)(E.A.Control.Feedback,{type:"invalid",className:"invalid",children:c.updated_fname}):null]})})}),(0,P.jsx)(b.A,{md:6,sm:12,className:"mb-3",children:(0,P.jsx)(y.default,{className:"p-3",children:(0,P.jsxs)(E.A.Group,{controlId:"form-updated-lname",children:[(0,P.jsx)(E.A.Label,{children:s.get("form-label-last-name")}),(0,P.jsx)(E.A.Control,{type:"text",name:"updated_lname",onChange:r,onBlur:n,value:a.updated_lname}),o.updated_lname&&c.updated_lname?(0,P.jsx)(E.A.Control.Feedback,{type:"invalid",className:"invalid",children:c.updated_lname}):null]})})}),(0,P.jsx)(b.A,{md:6,sm:12,className:"mb-3",children:(0,P.jsx)(y.default,{className:"p-3",children:(0,P.jsxs)(E.A.Group,{controlId:"form-phone",children:[(0,P.jsx)(E.A.Label,{children:s.get("phone")}),(0,P.jsx)(z(),{name:"phone",type:"text",country:x||"",value:a.phone,onChange:function(e,t){var r,n=t.countryCode;e===(null==a||null==(r=a.phone)?void 0:r.substring(1))&&e?j(n):m("phone",e)},onBlur:n}),o.phone&&c.phone?(0,P.jsx)(E.A.Control.Feedback,{type:"invalid",className:"invalid",children:c.phone}):null]})})}),(0,P.jsx)(b.A,{md:6,sm:12,className:"mb-3",children:(0,P.jsx)(y.default,{className:"p-3",children:(0,P.jsxs)(E.A.Group,{controlId:"form-email",children:[(0,P.jsx)(E.A.Label,{children:s.get("form-label-email-address")}),(0,P.jsx)(E.A.Control,{type:"email",name:"email",onChange:r,onBlur:n,value:a.email}),o.email&&c.email?(0,P.jsx)(E.A.Control.Feedback,{type:"invalid",className:"invalid",children:c.email}):null]})})}),A&&"myinv_ca"!==A.override_url&&(0,P.jsx)(b.A,{md:6,sm:12,className:"mb-3",children:(0,P.jsx)(y.default,{className:"p-3",children:(0,P.jsxs)(E.A.Group,{controlId:"form-birthday",className:"form-birthday",children:[(0,P.jsx)(E.A.Label,{children:s.get("form-label-date-of-birth")}),(0,P.jsx)("div",{className:w()["form-birthday"],children:(0,P.jsx)(q.A,{name:"birthday",value:a.birthday?H().getDateFormat(a.birthday,"MM/DD/YYYY"):null,onChange:m,dateFormat:s.get("profile-date-format"),id:"form-birthday",minDate:!0,className:"form-control",showMonthDropdown:!0,showYearDropdown:!0,placeholderText:s.get("form-placeholder-date-of-birth"),maxDate:!0,locale:s.get("form-birthday-locale")}
1)}),o.birthday&&c.birthday?(0,P.jsx)(E.A.Control.Feedback,{type:"invalid",className:"invalid",children:c.birthday}):null,(0,P.jsx)("span",{id:"form-birthdayMask",className:"labelMask","aria-hidden":"true"})]})})}),"EMEA"!==Q.APP_REGION&&(0,P.jsx)(b.A,{md:6,sm:12,className:"mb-3",children:(0,P.jsx)(y.default,{className:"p-3",children:(0,P.jsxs)(E.A.Group,{controlId:"form-zip",children:[(0,P.jsx)(E.A.Label,{children:s.get("form-label-zip-code")}),A&&"myinv_ca"===A.override_url?(0,P.jsx)(k(),{type:"tel",name:"zip",onChange:r,onBlur:n,value:a.zip,className:"form-control",maskChar:null,placeholder:"XXX XXX",mask:"a9a 9a9"}):(0,P.jsx)(E.A.Control,{type:"text",name:"zip",onChange:r,onBlur:n,value:a.zip,className:S.className,"form-placeholder":S.placeholder}),o.zip&&c.zip?(0,P.jsx)(E.A.Control.Feedback,{type:"invalid",className:"invalid",children:c.zip}):null]})})})]}),(0,P.jsxs)(h.A,{className:"btn-cont",children:[(0,P.jsx)(b.A,{md:3}),(0,P.jsxs)(b.A,{md:9,sm:12,children:[(0,P.jsxs)(g.A,{variant:"primary",className:v()(w()["save-btn"],"float-right"),type:"submit",disabled:l,id:"save-btn",children:[l&&(0,P.jsx)(_.A,{as:"span",animation:"border",size:"sm",role:"status","aria-hidden":"true",className:"mr-2"}),s.get("save-changes")]}),(0,P.jsx)(g.A,{variant:"light",id:"candel-btn",className:v()(w()["cancel-btn"],"float-right"),onClick:function(){return i("editable")},children:s.get("cancel")})]})]})]})})}})})]})};var J=r(57328),K=r.n(J),$=B()().publicRuntimeConfig;let ee=function(e){var t=e.handleEdit,r=e.userProfile,n=e.i18n,a=e.domain,i=e.isPatient,l=void 0!==i&&i,s=r.attributes,o=s.updated_fname,d=s.updated_lname,c=s.phone,m=s.zip,u=s.email,f=s.birthday,p=X.regionHelper.getDomainHash(a);return(0,P.jsxs)(y.default,{className:v()(K()["profile-details-container"],"mb-4"),id:"profile-details-wrapper",children:[(0,P.jsx)(y.default.Header,{className:v()(K()["card-header"],"pl-0 pr-0"),children:p&&"myinv_sa"===p.override_url&&!l?(0,P.jsxs)("div",{className:"row",children:[(0,P.jsx)(b.A,{children:(0,P.jsx)("p",{className:"mb-0 mt-2 fs-14",children:n.get("profile-details")})}),(0,P.jsx)(b.A,{children:(0,P.jsx)(g.A,{className:v()(K()["sa-edit-btn"],K()["edit-btn"],"pl-0 pr-0 fs-12"),onClick:function(){return t("editable")},variant:"link",id:"edit-btn",children:n.get("edit-profile")})})]}):(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)("p",{className:"mb-0 mt-2 float-left fs-14",children:n.get("profile-details")}),(0,P.jsx)(g.A,{className:v()(K()["edit-btn"],"text-md-right pr-0 float-right fs-12"),onClick:function(){return t("editable")},variant:"link",id:"edit-btn",children:n.get("edit-profile")})]})}),(0,P.jsx)(y.default.Body,{className:K()["card-body"],children:(0,P.jsxs)(h.A,{className:"mt-3",children:[(0,P.jsx)(b.A,{md:6,sm:12,className:"mb-3",children:(0,P.jsxs)(y.default,{className:"p-3",children:[(0,P.jsx)(y.default.Text,{children:n.get("first-name")}),(0,P.jsx)(y.default.Text,{className:K()["field-text"],children:o})]})}),(0,P.jsx)(b.A,{md:6,sm:12,className:"mb-3",children:(0,P.jsxs)(y.default,{className:"p-3",children:[(0,P.jsx)(y.default.Text,{children:n.get("last-name")}),(0,P.jsx)(y.default.Text,{className:K()["field-text"],children:d})]})}),(0,P.jsx)(b.A,{md:6,sm:12,className:"mb-3",children:(0,P.jsxs)(y.default,{className:"p-3",children:[(0,P.jsx)(y.default.Text,{children:n.get(l?"phone":"consumer-phone")}),(0,P.jsx)(y.default.Text,{className:K()["field-text"],children:c})]})}),(0,P.jsx)(b.A,{md:6,sm:12,className:"mb-3",children:(0,P.jsxs)(y.default,{className:"p-3",children:[(0,P.jsx)(y.default.Text,{children:n.get("email-address")}),(0,P.jsx)(y.default.Text,{className:K()["field-text"],children:u})]})}),p&&"myinv_ca"!==p.override_url&&(0,P.jsx)(b.A,{md:6,sm:12,className:"mb-3",children:(0,P.jsxs)(y.default,{className:"p-3",children:[(0,P.jsx)(y.default.Text,{children:n.get("date-of-birth")}),(0,P.jsx)(y.default.Text,{className:K()["field-text"],children:H().getDateFormat(f,n.get("form-placeholder-date-of-birth"),n.get("submit-api-dob-format"))})]})}),"EMEA"!==$.APP_REGION&&(0,P.jsx)(b.A,{md:6,sm:12,className:"mb-3",children:(0,P.jsxs)(y.default,{className:"p-3",children:[(0,P.jsx)(y.default.Text,{children:n.get("zip-code")}),(0,P.jsx)(y.default.Text,{className:K()["field-text"],children:m})]})})]})}),(0,P.jsx)(g.A,{className:v()(K()["delete-btn"],!l&&p&&"myinv_sa"===p.override_url?"text-left ml-2":"text-right"),onClick:function(){return t("deleteProfile")},variant:"link",children:n.get("delete-account")}
1)]})};var et=r(21385),er=r(81604),en=function(e,t){var r=(0,a.useSelector)(function(e){var t,r;return null==(t=e.domainReducer)||null==(r=t.activeDomain)?void 0:r.override_url});if(!r||"myinv_cs"!==r||0===e)return t.get("days");if(1===e)return t.get("days-1");if(2===e||3===e||4===e)return t.get("days-2-4");if(e>=5)return t.get("days-5+");else return t.get("days")},ea=function(e){var t=e.onClick;return(0,P.jsx)("span",{className:w()["icon-info"],onClick:t,role:"button"})};let ei=function(e){var t=e.handleEdit,r=e.settingsEditable,n=e.i18n,a=e.myInvisalignData,i=e.loading,l=e.arabicDomain,s=e.domainCheck,o=a&&a.active_aligner_plan,d=a&&a.attributes,c=(null==d?void 0:d.aligner_settings_enabled)||(null==d?void 0:d.aligner_settings_revamp_enabled);return s&&"myinv_cn"===s&&F().updateLocale("zh-CN",{meridiem:function(e,t,r){return e<12?"ä¸å":"ä¸å"}}),(0,P.jsxs)(y.default,{className:w()["aligner-details-container"],id:"aligner-details-wrapper",children:[(0,P.jsxs)(y.default.Header,{className:v()(w()["card-header"],"pl-0 pr-0",l&&"myinv_sa"===l&&w()["card-header-sa"]),children:[(0,P.jsx)("p",{className:"mb-0 mt-2 float-left text-dark fs-14",children:n.get("aligner-settings")}),!i&&((null==d?void 0:d.remote_care_invite_status)==="accepted"&&c?(0,P.jsx)(et.A,{placement:"right",delay:{show:250,hide:400},overlay:(0,P.jsx)(er.A,{id:"button-tooltip",children:n.get("manage-aligners-tooltip")}),children:(0,P.jsx)("span",{className:(w()["edit-btn"],"pr-0 mb-0 fs-12"),children:(0,P.jsx)(ea,{})})}):(0,P.jsx)(g.A,{className:v()(w()["edit-btn"],"text-md-right pr-0 float-right fs-12"),onClick:function(){return t("settingsEditable")},variant:"link",children:r?"".concat(n.get("cancel")):"".concat(n.get("edit"))}))]}),(0,P.jsx)(y.default.Body,{className:w()["card-body"],children:(0,P.jsxs)(h.A,{className:"mt-3",children:[(0,P.jsx)(b.A,{md:8,sm:6,xs:7,className:"pr-0",children:(0,P.jsx)("p",{children:n.get("total-aligner-stages")})}),(0,P.jsx)(b.A,{md:4,sm:6,xs:5,className:"text-right pl-0",children:(0,P.jsx)("p",{children:o&&o.total_aligners})}),(0,P.jsx)(b.A,{md:8,sm:6,xs:7,className:"pr-0",children:(0,P.jsx)("p",{children:n.get("current-aligner-stage")})}),(0,P.jsx)(b.A,{md:4,sm:6,xs:5,className:"text-right pl-0",children:(0,P.jsx)("p",{children:o&&o.current_aligner_number})}),(0,P.jsx)(b.A,{md:8,sm:6,xs:7,className:"pr-0",children:(0,P.jsx)("p",{children:n.get("days-of-wear")})}),(0,P.jsx)(b.A,{md:4,sm:6,xs:5,className:"text-right pl-0",children:(0,P.jsx)("p",{children:o&&"".concat(o.interval," ").concat(en(null==o?void 0:o.interval,n))})}),(0,P.jsx)(b.A,{md:8,sm:6,xs:7,className:"pr-0",children:(0,P.jsx)("p",{children:n.get("next-change-date")})}),(0,P.jsx)(b.A,{md:4,sm:6,xs:5,className:"text-right pl-0",children:(0,P.jsx)("p",{children:o&&F()(o.next_aligner_change_at).format(n.get("aligner-date-format"))})}),(0,P.jsx)(b.A,{md:8,sm:6,xs:7,className:"pr-0",children:(0,P.jsx)("p",{children:n.get("notify-me-at")})}),(0,P.jsx)(b.A,{md:4,sm:6,xs:5,className:"text-right pl-0",children:(0,P.jsx)("p",{children:o&&F()(o.next_aligner_change_at).locale(n.get("date-locale")).format(n.get("aligner-time-format"))})}),(0,P.jsx)(b.A,{md:12,className:"mt-2",children:(0,P.jsx)("p",{id:"settings-small-text",className:v()(w()["settings-small-text"],"mb-0 ml-md-3 ml-sm-0"),children:n.get("settings-text")})})]})})]})};r(8921);var el=function(e){for(var t=[(0,P.jsxs)("option",{value:"1 ".concat(e.get("day")),children:["1 ",e.get("day")]},"1 ".concat(e.get("day")))],r=2;r<31;r+=1)t.push((0,P.jsx)("option",{value:"".concat(r),children:"".concat(r," ").concat(e.get("days"))},"".concat(r," ").concat(e.get("days"))));return t},es=function(){for(var e=[],t=0;t<99;t++)e.push((0,P.jsx)("option",{value:t+1,children:t+1},t+1));return e};let eo=function(e){var t=e.onCancel,r=e.handleFormSubmit,n=e.loader,a=e.i18n,i=e.activeAlignerPlan;return i.next_rem_time=i.next_aligner_change_at,(0,P.jsx)("div",{children:(0,P.jsx)(O.l1,{enableReinitialize:!0,initialValues:i,onSubmit:r,children:function(e){var r=e.handleSubmit,l=e.handleChange,s=e.handleBlur,o=e.setFieldValue,d=(e.enableReinitialize,e.values),c=e.touched,m=(e.isValid,e.errors);return(0,P.jsxs)(E.A,{noValidate:!0,onSubmit:r,id:"aligner-plan-form",children:[(0,P.jsxs)(h.A,{className:w()["edit-aligner-blk"],children:[(0,P.jsx)(b.A,{xs:6,sm:6,md:6,className:"pt-2",children:(0,P.jsx)("p",{children:a.get("total-aligner-stages")})}),(0,P.jsx)(E.A.Group,{as:b.A,xs:6,md:6,controlId:"form-number-of-occurrences",children:(0,P.jsx)(E.A.Control,{as:"select",name:"total_aligners",value:i&&d.total_aligners,isInvalid:c.total_aligners&&m.total_aligners,onBlur:s,onChange:l,children:es()})}),(0,P.jsx)(b.A,{xs:6,sm:6,md:6,className:"pt-2",children:(0,P.jsx)("p",{children:a.get("current-aligner-stage")})}),(0,P.jsxs)(E.A.Group,{as:b.A,xs:6,md:6,controlId:"form-current-aligner-number",children:[(0,P.jsx)(E.A.Control,{as:"select",name:"current_aligner_number",value:i&&d.current_aligner_number,isInvalid:c.current_aligner_number&&m.current_aligner_number,onBlur:s,onChange:l,children:es()}),parseInt(d.current_aligner_number,10)>parseInt(d.total_aligners,10)?(0,P.jsx)(E.A.Control.Feedback,{type:"invalid",className:"invalid",children:a.get("error-selecting-aligner-stage")}):null]}),(0,P.jsx)(b.A,{xs:6,sm:6,md:6,className:"pt-2",children:(0,P.jsx)("p",{children:a.get("days-of-wear")})}),(0,P.jsx)(E.A.Group,{as:b.A,xs:6,md:6,controlId:"form-interval",children:(0,P.jsx)(E.A.Control,{as:"select",name:"interval",value:i&&"".concat(d.interval),isInvalid:c.interval&&m.interval,onBlur:s,onChange:l,children:el(a)})}),(0,P.jsx)(b.A,{xs:6,sm:6,md:6,className:"pt-2",children:(0,P.jsx)("p",{children:a.get("next-change-date")})}),(0,P.jsx)(b.A,{xs:6,sm:6,md:6,children:(0,P.jsx)(E.A.Group,{className:"next-date",controlId:"form-next-change-date",children:(0,P.jsx)(q.A,{name:"next_aligner_change_at",value:i&&d.next_aligner_change_at,onChange:o,dateFormat:a.get("form-calendar-date-locale"),id:"form-next-change-date",locale:a.get("form-calendar-locale")}
1)})}),(0,P.jsx)(b.A,{xs:6,sm:6,md:6,className:"pt-2",children:(0,P.jsx)("p",{children:a.get("notify-me-at")})}),(0,P.jsx)(E.A.Group,{as:b.A,xs:6,md:6,controlId:"form-notify-me-at",children:(0,P.jsx)(q.A,{name:"next_rem_time",onChange:o,onBlur:s,value:i&&d.next_rem_time,dateFormat:a.get("form-calendar-time-locale"),showTimeSelect:!0,showTimeSelectOnly:!0,isInvalid:c.next_rem_time&&m.next_rem_time,id:"form-reminder-time",locale:a.get("form-calendar-locale")})})]}),(0,P.jsxs)(h.A,{className:"mb-4 mt-4 justify-content-center",children:[(0,P.jsx)(b.A,{xs:5,sm:5,md:4,children:(0,P.jsx)(g.A,{block:!0,variant:"light",type:"button",size:"md",disabled:!1,onClick:function(){return t("settingsEditable")},className:"cancel-btn",id:"cancel-btn",children:a.get("cancel")})}),(0,P.jsx)(b.A,{xs:5,sm:5,md:4,children:(0,P.jsxs)(g.A,{variant:"primary",type:"submit",size:"md",block:!0,id:"save-btn",disabled:parseInt(d.current_aligner_number,10)>parseInt(d.total_aligners,10),children:[n&&(0,P.jsx)(_.A,{as:"span",animation:"border",size:"sm",role:"status","aria-hidden":"true",className:"mr-2"}),a.get("save")]})})]})]})}})})};var ed=r(80913),ec=r(76878),em=r.n(ec),eu=r(41201),ef=r(96428),ep=r(96037),eh=r.n(ep);let eb=function(e){var t,r=e.open,a=void 0!==r&&r,l=e.email,s=e.i18n,o=e.onHide,d=e.onSave,c=(0,n.useRef)(null),m=(0,n.useState)("form"),u=m[0],p=m[1];(0,n.useEffect)(function(){c.current&&a&&c.current.focus(),a||"form"===u||p("form")},[a]);var j=(t=(0,i.A)(f().mark(function e(t,r){var n,a;return f().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=r.setFieldError,e.next=3,d(t);case 3:(a=e.sent).success||("Authentication"===a.error?n("password",s.get("error-invalid-password")):"00000"===a.error&&p("error"));case 5:case"end":return e.stop()}},e)})),function(e,r){return t.apply(this,arguments)});return(0,P.jsx)(x.A,{show:a,centered:!0,onHide:o,children:(0,P.jsx)(x.A.Body,{className:eh().container,children:"form"!==u?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)("div",{className:eh().title,children:s.get("mail-id-already-used-title")}),(0,P.jsx)("div",{className:eh()["sub-title"],children:s.get("mail-id-already-used-subtitle")}),(0,P.jsxs)(h.A,{children:[(0,P.jsx)(b.A,{className:eh()["btn-container"],children:(0,P.jsx)(g.A,{type:"submit",variant:"primary",block:!0,as:"a",href:"/logout",children:s.get("sign-in")})}),(0,P.jsx)(b.A,{children:(0,P.jsx)(g.A,{variant:"outline-secondary",block:!0,onClick:function(){return p("form")},children:s.get("try-again")})})]})]}):(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)("div",{className:eh().title,children:s.get("update-email-title")}),(0,P.jsx)("div",{className:eh()["sub-title"],children:s.get("update-email-subtitle")}),(0,P.jsx)(O.l1,{onSubmit:j,initialValues:{email:void 0===l?"":l,password:""},validationSchema:function(){return M.Ik().shape({email:M.Yj().email(s.get("error-invalid-email")).required(s.get("error-email-invalid")),password:M.Yj().required(s.get("error-password-required"))})},children:function(e){var t=e.handleSubmit,r=e.handleChange,n=e.handleBlur,a=e.values,i=e.touched,l=e.errors,d=e.isSubmitting,m=e.isValid;return(0,P.jsxs)(E.A,{onSubmit:t,children:[(0,P.jsxs)(E.A.Group,{controlId:"modal-form-email",children:[(0,P.jsx)(E.A.Label,{className:eh().label,children:s.get("new-email-address")}),(0,P.jsx)(E.A.Control,{name:"email",onChange:r,onBlur:n,value:a.email}),i.email&&l.email&&(0,P.jsx)(E.A.Control.Feedback,{type:"invalid",className:"invalid",children:l.email})]}),(0,P.jsxs)(E.A.Group,{controlId:"modal-form-password",children:[(0,P.jsx)(E.A.Label,{className:eh().label,children:s.get("current-password")}),(0,P.jsx)(E.A.Control,{ref:c,type:"password",name:"password",onChange:r,onBlur:n,value:a.password}),i.password&&l.password&&(0,P.jsx)(E.A.Control.Feedback,{type:"invalid",className:"invalid",children:l.password})]}),(0,P.jsxs)(h.A,{children:[(0,P.jsx)(b.A,{className:eh()["btn-container"],children:(0,P.jsx)(g.A,{variant:"outline-secondary",block:!0,onClick:o,children:s.get("cancel")})}),(0,P.jsx)(b.A,{children:(0,P.jsxs)(g.A,{type:"submit",variant:"primary",block:!0,disabled:d||!m,children:[d&&(0,P.jsx)(_.A,{as:"span",animation:"border",size:"sm",role:"status","aria-hidden":"true",className:"mr-2"}),s.get("save")]})})]})]})}})]})})})};function ex(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function eg(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};
1t%2?ex(Object(r),!0).forEach(function(t){(0,m.A)(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ex(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function e_(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(e_=function(){return!!e})()}var ej=function(e){function t(e){var r,n,a,s;return(0,l.A)(this,t),n=t,a=[e],n=(0,d.A)(n),r=(0,o.A)(this,e_()?Reflect.construct(n,a||[],(0,d.A)(this).constructor):n.apply(this,a)),(0,m.A)(r,"componentDidMount",function(){(0,r.props.getDashboardData)(),r.setState({domain:window.location.hostname})}),(0,m.A)(r,"onDeleteProfile",function(){var e=r.props.deleteProfileFunc;r.setState({loader:!0}),e().then(function(e){if(e.success){var t=r.state.deleteProfile;r.setState({deleteProfile:!t,loader:!1}),window.location.href="/logout"}}).catch(function(e){if(e.error){var t=r.state.deleteProfile;r.setState({deleteProfile:!t,loader:!1})}})}),(0,m.A)(r,"cancelDeleteProfile",function(){var e=r.state.deleteProfile;r.setState({deleteProfile:!e})}),(0,m.A)(r,"handleFormSubmit",function(e){if(e){var n=r.props.userProfile,a=(null==n?void 0:n.attributes).email;if(e.phone&&!e.phone.includes("+")&&(e.phone="+".concat(e.phone)),e.email!==a)return void r.setState({newEmail:e.email,showUpdateEmail:!0,changes:e});r.setState({loader:!0});var i=r.props,l=i.updateUserProfile,s=i.constants,o=i.showAlert,d=i.getUserProfile,c=new(em())(s,t.MODULE_NAME);l(e,c).then(function(e){r.setState(function(e,t){return{loader:!1,editable:!e.editable}}),e&&e.data&&e.data.success?(o({type:"success",title:"",content:c.get("success-profile-submitted"),confirmBtnText:c.get("btn-text"),timeout:4e3,showConfirm:!1,confirmBtnCssClass:"primary-button"}),d(e.data).then(function(e){return e?null:o({type:"danger",title:"",content:c.get("re-login"),timeout:4e3,confirmBtnText:c.get("btn-text"),showConfirm:!0,onConfirm:function(){window.location.href="/logout"},confirmBtnCssClass:"primary-button"})}),H().addEventToDataLayer("profile_updated")):o({type:"danger",title:"",content:c.get("error-profile-submitted"),timeout:4e3,confirmBtnText:c.get("btn-text"),showConfirm:!0,onConfirm:function(){window.location.href="/logout"},confirmBtnCssClass:"primary-button"})})}}),(0,m.A)(r,"handleEdit",function(e){r.setState(function(t,r){return(0,m.A)({},e,!t[e])})}),(0,m.A)(r,"handleEmailUpdate",(s=(0,i.A)(f().mark(function e(n){var a,i,l,s,o,d,c,m;return f().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return a=r.state.changes,l=(i=r.props).constants,s=i.onUpdateUserProfileWithEmail,o=i.userProfile,d=i.getUserProfile,c=i.showAlert,m=new(em())(l,t.MODULE_NAME),e.prev=3,e.next=6,s(eg(eg(eg({},a),n),{},{oldEmail:o.attributes.email}),m);case 6:if(!e.sent){e.next=13;break}return e.next=10,d();case 10:return c({type:"success",title:"",content:m.get("success-profile-submitted"),confirmBtnText:m.get("btn-text"),timeout:4e3,showConfirm:!1,confirmBtnCssClass:"primary-button"}),r.setState({editable:!1,showUpdateEmail:!1,changes:null,newEmail:""}),e.abrupt("return",{success:!0});case 13:return c({type:"danger",title:"",content:m.get("error-profile-submitted"),confirmBtnText:m.get("btn-text"),timeout:4e3,showConfirm:!0,onConfirm:function(){window.location.href="/logout"},confirmBtnCssClass:"primary-button"}),e.abrupt("return",{error:"",success:!1});case 17:return e.prev=17,e.t0=e.catch(3),e.abrupt("return",{error:null===e.t0||void 0===e.t0?void 0:e.t0.message,success:!1});case 20:case"end":return e.stop()}},e,null,[[3,17]])})),function(e){return s.apply(this,arguments)})),(0,m.A)(r,"submitAlignerSettings",function(e){if(e&&e){r.setState({loader:!0});var n=r.props,a=n.updateAlignerSettings,i=n.showAlert,l=n.getDashboardData,s=n.constants,o=new(em())(s,t.MODULE_NAME);a(e).then(function(e){r.setState(function(e,t){return{loader:!1,settingsEditable:!e.settingsEditable}}),l(),e&&e.data.active?(i({type:"success",title:"",content:o.get("success-aligner-plan-submitted"),timeout:4e3,showConfirm:!1,confirmBtnCssClass:"primary-button"}),H().addEventToDataLayer("aligner_setting_updated")):i({type:"danger",title:"",content:o.get("error-aligner-plan-submitted"),timeout:4e3,showConfirm:!1,confirmBtnCssClass:"primary-button"})})}}),r.state={editable:!1,settingsEditable:!1,deleteProfile:!1,errors:{}
1,loader:!1,domain:"",showUpdateEmail:!1,changes:null,newEmail:""},r}return(0,c.A)(t,e),(0,s.A)(t,[{key:"render",value:function(){var e=this,r=this.state,n=r.errors,a=r.loader,i=r.editable,l=r.settingsEditable,s=r.deleteProfile,o=(r.domainshowUpdateEmail,r.newEmail),d=r.domain,c=r.showUpdateEmail,m=this.handleFormSubmit,u=this.handleEdit,f=this.submitAlignerSettings,j=this.handleEmailUpdate,y=this.props,A=y.userProfile,N=y.alignerData,E=y.constants,O=y.avatar,D=y.dashboardData,k=new(em())(E,t.MODULE_NAME),S=X.regionHelper.getDomainHash(d)&&X.regionHelper.getDomainHash(d).override_url;return(0,P.jsxs)(p.A,{fluid:!0,children:[(0,P.jsxs)(h.A,{className:"mt-3 mt-md-4 mb-4",children:[(0,P.jsx)(b.A,{md:3,children:(0,P.jsx)(C,{userProfile:A,avatar:O})}),(0,P.jsx)(b.A,{md:6,children:i?(0,P.jsx)(W,{userProfile:A,handleFormSubmit:m,handleEdit:function(e){return u(e)},loader:a,errors:n,i18n:k,domainCheck:d,arabicDomain:S}):(0,P.jsx)(ee,{userProfile:A,handleEdit:function(e){return u(e)},i18n:k,domain:d,isPatient:!0})}),(0,P.jsx)(b.A,{md:3,children:(0,P.jsx)(ei,{alignerData:N,handleEdit:function(e){return u(e)},i18n:k,settingsEditable:l,myInvisalignData:D&&D.myInvisalign,loading:D.loading,domainCheck:S})})]}),(0,P.jsxs)(x.A,{size:"md",centered:!0,show:l,onHide:function(){return u("settingsEditable")},children:[(0,P.jsx)(x.A.Header,{className:v()(S&&"myinv_sa"===S&&w()["sa-aligner-edit-wrapper"]),closeButton:!0,children:(0,P.jsx)(x.A.Title,{children:k.get("header-aligner-settings")})}),(0,P.jsx)(x.A.Body,{className:w()["aligner-plan-body"],children:(0,P.jsx)("div",{children:(0,P.jsx)(eo,{settingsEditable:l,onCancel:function(e){return u(e)},handleFormSubmit:f,loader:a,i18n:k,activeAlignerPlan:D&&D.myInvisalign&&D.myInvisalign.active_aligner_plan,domainCheck:S})})})]}),(0,P.jsxs)(x.A,{className:v()(S&&"myinv_sa"===S&&w()["sa-aliner-delete-wrapper"]),size:"md",centered:!0,show:s,onHide:function(){return u("deleteProfile")},children:[(0,P.jsx)(x.A.Header,{className:w()["delete-profile-header"],closeButton:!0}),(0,P.jsx)(x.A.Body,{className:w()["aligner-plan-body"],children:(0,P.jsxs)("div",{className:w()["profile-delete-font"],children:[S&&"myinv_jp"!==S?(0,P.jsxs)("p",{children:[k.get("profile-delete-info"),(0,P.jsx)("a",{className:w()["privacy-email"],href:"mailto:'".concat(k.get("href-privacy-email-id"),"'"),children:k.get("privacy-email")}),"."]}):(0,P.jsxs)("p",{children:[" ",k.get("profile-delete-info")]}),(0,P.jsx)("p",{children:k.get("delete-profile-continue")})]})}),(0,P.jsx)(p.A,{children:(0,P.jsxs)(h.A,{children:[(0,P.jsx)(b.A,{className:w()["delete-btn-align"],xs:6,sm:6,md:6,children:(0,P.jsxs)(g.A,{block:!0,variant:"primary",onClick:this.onDeleteProfile,size:"md",disabled:a,className:w()["delete-profile-btn"],id:"delete-btn",children:[a&&(0,P.jsx)(_.A,{as:"span",animation:"border",size:"sm",role:"status","aria-hidden":"true",className:"mr-2"}),k.get("delete-profile-btn")]})}),(0,P.jsx)(b.A,{xs:6,sm:6,md:6,children:(0,P.jsx)(g.A,{block:!0,variant:"light",type:"button",size:"md",onClick:this.cancelDeleteProfile,disabled:!1,className:w()["delete-profile-btn"],id:"cancel-btn",children:k.get("cancel")})})]})})]}),(0,P.jsx)(eb,{open:c,email:o,i18n:k,onHide:function(){return e.setState({showUpdateEmail:!1})},onSave:j})]})}}])}(n.Component);(0,m.A)(ej,"MODULE_NAME","page.myprofile");let ev=(0,a.connect)(function(e){return{userProfile:e.authReducer.user,alignerData:e.authReducer.events,constants:e.contentfulReducer,avatar:e.authReducer.avatar,dashboardData:e.patientReducer}},function(e){return{updateUserProfile:function(t,r){return e((0,eu.vE)(t,r))},onUpdateUserProfileWithEmail:function(t,r){return e((0,eu.yO)(t,r))},getUserProfile:function(t){return e((0,eu.UJ)(t))},getDashboardData:function(t){return e((0,ef.A)(t))},updateAlignerSettings:function(t){return e((0,eu.yu)(t))},showAlert:function(t){return e((0,ed.S)(t))},deleteProfileFunc:function(){return e((0,eu.wU)())}}})(ej);var ey=r(11480);function eA(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function eN(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};
1t%2?eA(Object(r),!0).forEach(function(t){(0,m.A)(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):eA(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var ew=B()().publicRuntimeConfig;let eP=function(e){var t=e.userProfile,r=e.handleFormSubmit,i=e.handleEdit,l=e.loader,s=(e.editable,e.i18n),o=e.domainCheck,d=(0,a.useSelector)(function(e){return e.domainReducer}).domains,c=(0,n.useState)(null),m=c[0],u=c[1],f=(0,n.useState)(null),p=f[0],x=f[1],j=(0,ey.useRouter)().query.site_name,A=X.regionHelper.getDomainHash(o),N=A&&"myinv_uk"===A.override_url||!1,w=A&&"myinv_ca"===A.override_url||!1;(0,n.useEffect)(function(){if(G.A.init("XdDmMyY9"),d){var e=d.find(function(e){return e.domain===window.location.hostname});u(e),t.attributes.phone&&""!==t.attributes.phone||x(e&&e.countryCode?e.countryCode:"us")}},[]);var C=m&&m.countryCode===p?m&&m.phoneRegexp:"",D=s.custom("page.myprofile").zipcode,S=R(s,w,D,C,N,"EMEA"!==ew.APP_REGION),B=eN(eN({},t.attributes),t.attributes.birthday&&{birthday:F()(t.attributes.birthday,"DD-MM-YYYY")});return(0,P.jsxs)(y.default,{className:K()["profile-form-container"],id:"profile-form-wrapper",children:[(0,P.jsx)(y.default.Header,{className:"".concat(K()["card-header"]," pl-0 pr-0"),children:(0,P.jsxs)("div",{className:"row",children:[(0,P.jsx)(b.A,{className:A&&"myinv_sa"===A.override_url?"order-2 text-left":"order-2 text-right",children:(0,P.jsx)(g.A,{className:v()(K()["sa-edit-btn2"],K()["edit-btn"],"pl-0 pr-0 fs-14"),onClick:function(){"lead"===(t&&t.attributes).user_type&&H().addEventToDataLayer("consumer_change_pwd")},href:j&&"/".concat(j,"/change_password")||"/change_password",variant:"link",id:"change-pwd",children:s.get("change-password")})}),(0,P.jsx)(b.A,{className:A&&"myinv_sa"===A.override_url?"order-1 text-right":v()(K()["sa-edit-2"],"order-1 text-left"),children:(0,P.jsx)("p",{className:"mb-0 mt-2 fs-14",children:s.get("edit-profile")})})]})}),(0,P.jsx)(y.default.Body,{className:"mb-3 mt-4 pt-0",children:(0,P.jsx)(O.l1,{validationSchema:S,onSubmit:r,initialValues:B,children:function(e){var t=e.handleSubmit,r=e.handleChange,n=e.handleBlur,a=e.values,o=e.touched,d=e.errors,c=e.setFieldValue;return(0,P.jsx)("div",{children:(0,P.jsxs)(E.A,{onSubmit:t,id:"edit-profile-form",children:[(0,P.jsxs)(h.A,{className:"mb-3 mt-2",children:[(0,P.jsx)(b.A,{md:6,sm:12,className:"mb-3",children:(0,P.jsx)(y.default,{className:"p-3",children:(0,P.jsxs)(E.A.Group,{controlId:"form-updated-fname",children:[(0,P.jsx)(E.A.Label,{children:s.get("form-label-first-name")}),(0,P.jsx)(E.A.Control,{type:"text",name:"updated_fname",onChange:r,onBlur:n,value:a.updated_fname}),o.updated_fname&&d.updated_fname?(0,P.jsx)(E.A.Control.Feedback,{type:"invalid",className:"invalid",children:d.updated_fname}):null]})})}),(0,P.jsx)(b.A,{md:6,sm:12,className:"mb-3",children:(0,P.jsx)(y.default,{className:"p-3",children:(0,P.jsxs)(E.A.Group,{controlId:"form-updated-lname",children:[(0,P.jsx)(E.A.Label,{children:s.get("form-label-last-name")}),(0,P.jsx)(E.A.Control,{type:"text",name:"updated_lname",onChange:r,onBlur:n,value:a.updated_lname}),o.updated_lname&&d.updated_lname?(0,P.jsx)(E.A.Control.Feedback,{type:"invalid",className:"invalid",children:d.updated_lname}):null]})})}),(0,P.jsx)(b.A,{md:6,sm:12,className:"mb-3",children:(0,P.jsx)(y.default,{className:v()("p-3",A&&"myinv_sa"===A.override_url?"sa-phone-wrapper":K()["phone-wrapper"]),children:(0,P.jsxs)(E.A.Group,{controlId:"form-phone",children:[(0,P.jsx)(E.A.Label,{children:s.get("phone")}),(0,P.jsx)(z(),{name:"phone",type:"text",country:p||"",value:a.phone,onChange:function(e,t){var r,n=t.countryCode;e===(null==a||null==(r=a.phone)?void 0:r.substring(1))&&e?x(n):c("phone",e)},onBlur:n}),o.phone&&d.phone?(0,P.jsx)(E.A.Control.Feedback,{type:"invalid",className:"invalid",children:d.phone}):null]})})}),(0,P.jsx)(b.A,{md:6,sm:12,className:"mb-3",children:(0,P.jsx)(y.default,{className:"p-3",children:(0,P.jsxs)(E.A.Group,{controlId:"form-email",children:[(0,P.jsx)(E.A.Label,{children:s.get("form-label-email-address")}),(0,P.jsx)(E.A.Control,{type:"email",name:"email",onChange:r,onBlur:n,value:a.email}),o.email&&d.email?(0,P.jsx)(E.A.Control.Feedback,{type:"invalid",className:"invalid",children:d.email}):null]})})}),A&&"myinv_ca"!==A.override_url&&(0,P.jsx)(b.A,{md:6,sm:12,className:"mb-3",children:(0,P.jsx)(y.default,{className:"p-3",children:(0,P.jsxs)(E.A.Group,{controlId:"form-birthday",className:"form-birthday",children:[(0,P.jsx)(E.A.Label,{children:s.get("form-label-date-of-birth")}),(0,P.jsx)("div",{className:K()["form-birthday"],children:(0,P.jsx)(q.A,{name:"birthday",value:a.birthday?H().getDateFormat(a.birthday,"MM/DD/YYYY"):null,onChange:c,dateFormat:s.get("profile-date-format"),id:"form-birthday",minDate:!0,className:"form-control",showMonthDropdown:!0,showYearDropdown:!0,placeholderText:s.get("form-placeholder-date-of-birth"),maxDate:!0,locale:s.get("form-birthday-locale")}
1)}),o.birthday&&d.birthday?(0,P.jsx)(E.A.Control.Feedback,{type:"invalid",className:"invalid",children:d.birthday}):null,(0,P.jsx)("span",{id:"form-birthdayMask",className:"labelMask","aria-hidden":"true"})]})})}),"EMEA"!==ew.APP_REGION&&(0,P.jsx)(b.A,{md:6,sm:12,className:"mb-3",children:(0,P.jsx)(y.default,{className:"p-3",children:(0,P.jsxs)(E.A.Group,{controlId:"form-zip",children:[(0,P.jsx)(E.A.Label,{children:s.get("consumer-form-label-zip-code")}),A&&"myinv_ca"===A.override_url?(0,P.jsx)(k(),{type:"tel",name:"zip",onChange:r,onBlur:n,value:a.zip,className:"form-control",maskChar:null,placeholder:"XXX XXX",mask:"a9a 9a9"}):(0,P.jsx)(E.A.Control,{type:"text",name:"zip",onChange:r,onBlur:n,value:a.zip,className:D.className,"form-placeholder":D.placeholder}),o.zip&&d.zip?(0,P.jsx)(E.A.Control.Feedback,{type:"invalid",className:"invalid",children:d.zip}):null]})})})]}),(0,P.jsxs)(h.A,{children:[(0,P.jsx)(b.A,{md:3}),(0,P.jsxs)(b.A,{md:9,sm:12,children:[(0,P.jsxs)(g.A,{variant:"primary",className:v()(K()["save-btn"],A&&"myinv_sa"===A.override_url?"float-left mr-4":"float-right"),type:"submit",disabled:l,id:"save-btn",children:[l&&(0,P.jsx)(_.A,{as:"span",animation:"border",size:"sm",role:"status","aria-hidden":"true",className:"mr-2"}),s.get("save-changes")]}),(0,P.jsx)(g.A,{variant:"light",id:"candel-btn",className:v()(K()["cancel-btn"],A&&"myinv_sa"===A.override_url?"float-left ml-2":"float-right"),onClick:function(){return i("editable")},children:s.get("cancel")})]})]})]})})}})})]})},eC=(0,a.connect)(function(e){return{constants:e.contentfulReducer,dashboardData:e.patientReducer}},null)(function(e){var t=e.i18n,r=e.constants,n=e.dashboardData,a=e.handleEdit,i=new(em())(r,"comp.consumerRegFlow").get("custom"),l=(n||"").myInvisalign,s=l&&l.attributes||"",o=s.primary_goal__c,d=s.primary_goal_reason__c,c=s.top_questions_about_invisalign__c,m=c?c.includes(";")?c.split(";"):[c]:[];return(0,P.jsxs)(y.default,{className:v()(K()["profile-details-container"],"mb-4"),id:"profile-details-wrapper",children:[(0,P.jsxs)(y.default.Header,{className:v()(K()["card-header"],"pl-0 pr-0"),children:[(0,P.jsx)("p",{className:"mb-0 mt-2 float-left fs-14",children:t.get("about-me")}),(0,P.jsx)(g.A,{className:v()(K()["edit-btn"],"text-md-right pr-0 float-right fs-12"),onClick:function(){return a("aboutme")},variant:"link",id:"about-edit-btn",children:t.get("edit")})]}),(0,P.jsx)(y.default.Body,{className:K()["card-body"],children:(0,P.jsx)(h.A,{className:"mt-3",children:(0,P.jsxs)(b.A,{className:"about-me-col",children:[i&&(0,P.jsx)("p",{dangerouslySetInnerHTML:{__html:i.questions[0].question_name}}),o&&(0,P.jsx)("p",{className:K().answer,children:o}),d&&(0,P.jsx)("p",{className:K().answer,children:d}),(0,P.jsx)("p",{children:i&&i.questions[1].question_name}),c&&m&&m.map(function(e,t){return(0,P.jsx)("p",{className:K().answer,children:e},e)})]})})})]})});function eE(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function eO(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?eE(Object(r),!0).forEach(function(t){(0,m.A)(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):eE(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function eD(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(eD=function(){return!!e})()}var ek=function(e){function t(e){var r,n,a,s;return(0,l.A)(this,t),n=t,a=[e],n=(0,d.A)(n),r=(0,o.A)(this,eD()?Reflect.construct(n,a||[],(0,d.A)(this).constructor):n.apply(this,a)),(0,m.A)(r,"componentDidMount",function(){(0,r.props.getDashboardData)(),r.setState({domain:window.location.hostname})}),(0,m.A)(r,"onDeleteProfile",function(){var e=r.props,t=e.deleteProfileFunc,n=e.userProfile;"lead"===(n&&n.attributes).user_type&&H().addEventToDataLayer("consumer_del_submit"),r.setState({loader:!0}),t().then(function(e){if(e.success){var t=r.state.deleteProfile;r.setState({deleteProfile:!t,loader:!1}),window.location.href="/logout"}}
1).catch(function(e){if(e.error){var t=r.state.deleteProfile;r.setState({deleteProfile:!t,loader:!1})}})}),(0,m.A)(r,"cancelDeleteProfile",function(){var e=r.state.deleteProfile,t=r.props.userProfile;"lead"===(t&&t.attributes).user_type&&H().addEventToDataLayer("consumer_del_cancel"),r.setState({deleteProfile:!e})}),(0,m.A)(r,"handleFormSubmit",function(e){if(e){var n=r.props.userProfile,a=(null==n?void 0:n.attributes).email;if(e.phone&&!e.phone.includes("+")&&(e.phone="+".concat(e.phone)),e.email!==a)return void r.setState({newEmail:e.email,showUpdateEmail:!0,changes:e});r.setState({loader:!0});var i=r.props,l=i.updateUserProfile,s=i.constants,o=i.showAlert,d=i.getUserProfile,c=new(em())(s,t.MODULE_NAME);l(e,c).then(function(e){r.setState(function(e,t){return{loader:!1,editable:!e.editable}}),e&&e.data&&e.data.success?(o({type:"success",title:"",content:c.get("success-profile-submitted"),confirmBtnText:c.get("btn-text"),timeout:4e3,showConfirm:!1,confirmBtnCssClass:"primary-button"}),d(e.data).then(function(e){return e?null:o({type:"danger",title:"",content:c.get("re-login"),confirmBtnText:c.get("btn-text"),timeout:4e3,showConfirm:!0,onConfirm:function(){window.location.href="/logout"},confirmBtnCssClass:"primary-button"})}),H().addEventToDataLayer("profile_updated")):o({type:"danger",title:"",content:c.get("error-profile-submitted"),confirmBtnText:c.get("btn-text"),timeout:4e3,showConfirm:!0,onConfirm:function(){window.location.href="/logout"},confirmBtnCssClass:"primary-button"})})}}),(0,m.A)(r,"handleEmailUpdate",(s=(0,i.A)(f().mark(function e(n){var a,i,l,s,o,d,c,m;return f().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return a=r.state.changes,l=(i=r.props).constants,s=i.onUpdateUserProfileWithEmail,o=i.userProfile,d=i.getUserProfile,c=i.showAlert,m=new(em())(l,t.MODULE_NAME),e.prev=3,e.next=6,s(eO(eO(eO({},a),n),{},{oldEmail:o.attributes.email}),m);case 6:if(!e.sent){e.next=13;break}return e.next=10,d();case 10:return c({type:"success",title:"",content:m.get("success-profile-submitted"),confirmBtnText:m.get("btn-text"),timeout:4e3,showConfirm:!1,confirmBtnCssClass:"primary-button"}),r.setState({editable:!1,showUpdateEmail:!1,changes:null,newEmail:""}),e.abrupt("return",{success:!0});case 13:return c({type:"danger",title:"",content:m.get("error-profile-submitted"),confirmBtnText:m.get("btn-text"),timeout:4e3,showConfirm:!0,onConfirm:function(){window.location.href="/logout"},confirmBtnCssClass:"primary-button"}),e.abrupt("return",{error:"",success:!1});case 17:return e.prev=17,e.t0=e.catch(3),e.abrupt("return",{error:null===e.t0||void 0===e.t0?void 0:e.t0.message,success:!1});case 20:case"end":return e.stop()}},e,null,[[3,17]])})),function(e){return s.apply(this,arguments)})),(0,m.A)(r,"handleEdit",function(e){var t=r.props.userProfile,n=(t&&t.attributes).user_type;r.state[e]||"aboutme"===e||"lead"!==n||H().addEventToDataLayer("consumer_edit_profile"),"deleteProfile"===e&&"lead"===n&&H().addEventToDataLayer("consumer_delete_profile"),"aboutme"===e&&("lead"===n&&H().addEventToDataLayer("consumer_edit_about_me"),"prospect"===n&&H().addEventToDataLayer("prospect_edit_about_me"),window.location.href="/about_me"),r.setState(function(t,r){return(0,m.A)({},e,!t[e])})}),r.state={editable:!1,deleteProfile:!1,errors:{},loader:!1,domain:"",showUpdateEmail:!1,changes:null,newEmail:""},r}return(0,c.A)(t,e),(0,s.A)(t,[{key:"render",value:function(){var e=this,r=this.state,n=r.errors,a=r.loader,i=r.editable,l=r.deleteProfile,s=r.domain,o=r.showUpdateEmail,d=r.newEmail,c=this.handleFormSubmit,m=this.handleEdit,u=this.handleEmailUpdate,f=this.props,j=f.userProfile,y=f.constants,A=f.scanOfficeName,N=(j&&j.attributes||"").lead_id,w=j.attributes.e_card,C=j.attributes.user_journey.includes("vivera"),E=new(em())(y,t.MODULE_NAME),O=X.regionHelper.getDomainHash(s);return(0,P.jsxs)(p.A,{fluid:!0,className:O&&"myinv_sa"===O.override_url&&"rtl text-right",children:[(0,P.jsxs)(h.A,{className:"mt-3 mt-md-4 mb-4",children:[(0,P.jsx)(b.A,{md:N&&null!==N&&!C&&(O&&"myinv_us"===O.override_url||O&&"myinv_ca"===O.override_url||A)?2:3}),(0,P.jsx)(b.A,{md:6,children:i?(0,P.jsx)(eP,{userProfile:j,handleFormSubmit:c,handleEdit:function(e){return m(e)},loader:a,errors:n,i18n:E,domainCheck:s}):(0,P.jsx)(ee,{userProfile:j,handleEdit:function(e){return m(e)},i18n:E,domain:s})}),N&&null!==N&&(O&&"myinv_us"===O.override_url||O&&"myinv_ca"===O.override_url||A)&&!w&&!C&&(0,P.jsx)(b.A,{md:4,children:(0,P.jsx)(eC,{i18n:E,handleEdit:function(e){return m(e)}})})]}),(0,P.jsxs)(x.A,{className:"delete-modal",size:"md",centered:!0,show:l,onHide:function(){return m("deleteProfile")},children:[(0,P.jsx)(x.A.Header,{className:K()["delete-profile-header"],closeButton:!0}),(0,P.jsx)(x.A.Body,{className:v()(K()["aligner-plan-body"],O&&"myinv_sa"===O.override_url&&"text-right"),children:(0,P.jsxs)("div",{className:K()["profile-delete-font"],children:[O&&"myinv_jp"!==O.override_url?(0,P.jsxs)("p",{children:[E.get("profile-delete-info"),(0,P.jsx)("a",{className:K()["privacy-email"],href:"mailto:'".concat(E.get("href-privacy-email-id"),"'"),children:E.get("privacy-email")}),"."]}):(0,P.jsx)("p",{children:E.get("profile-delete-info")}),(0,P.jsx)("p",{children:E.get("delete-profile-continue")})]})}),(0,P.jsx)(p.A,{children:(0,P.jsxs)(h.A,{children:[(0,P.jsx)(b.A,{className:v()(O&&"myinv_sa"===O.override_url?"order-2":"order-1",K()["delete-btn-align"]),xs:6,sm:6,md:6,children:(0,P.jsxs)(g.A,{block:!0,variant:"primary",onClick:this.onDeleteProfile,size:"md",disabled:a,className:K()["delete-profile-btn"],id:"delete-btn",children:[a&&(0,P.jsx)(_.A,{as:"span",animation:"border",size:"sm",role:"status","aria-hidden":"true",className:"mr-2"}),E.get("delete-profile-btn")]})}),(0,P.jsx)(b.A,{className:v()(O&&"myinv_sa"===O.override_url?"order-1":"order-2","text-center"),xs:6,sm:6,md:6,children:(0,P.jsx)(g.A,{block:!0,variant:"light",type:"button",size:"md",onClick:this.cancelDeleteProfile,disabled:!1,className:K()["delete-profile-btn"],id:"cancel-btn",children:E.get("cancel")})})]})})]}),(0,P.jsx)(eb,{open:o,email:d,i18n:E,onHide:function(){return e.setState({showUpdateEmail:!1})},onSave:u})]})}}])}(n.Component);(0,m.A)(ek,"MODULE_NAME","page.myprofile");let eS=(0,a.connect)(function(e){return{userProfile:e.authReducer.user,constants:e.contentfulReducer,avatar:e.authReducer.avatar,dashboardData:e.patientReducer}},function(e){return{updateUserProfile:function(t,r){return e((0,eu.vE)(t,r))},onUpdateUserProfileWithEmail:function(t,r){return e((0,eu.yO)(t,r))},getUserProfile:function(t){return e((0,eu.UJ)(t))},getDashboardData:function(t){return e((0,ef.A)(t))},showAlert:function(t){return e((0,ed.S)(t))},deleteProfileFunc:function(){return e((0,eu.wU)())}}})(ek),eB=(0,a.connect)(function(e){return{userType:e.authReducer.user.attributes.user_t
1ype}},null)(function(e){var t=e.userType,r=e.scanOfficeName,n=e.arabicDomain;return"patient"===t?(0,P.jsx)(ev,{arabicDomain:n}):"lead"===t||"prospect"===t?(0,P.jsx)(eS,{scanOfficeName:r}):(0,P.jsx)("div",{})})},57328:e=>{e.exports={round:"ConsumerProfile_round__Z2IQZ","edit-btn":"ConsumerProfile_edit-btn__ucsUt","save-btn":"ConsumerProfile_save-btn__cgbGc","profile-details-container":"ConsumerProfile_profile-details-container__LDRuL","field-text":"ConsumerProfile_field-text__c_iw_","delete-profile":"ConsumerProfile_delete-profile__tIDfi","delete-btn":"ConsumerProfile_delete-btn__XSrMf","card-header":"ConsumerProfile_card-header__nl_Up","card-body":"ConsumerProfile_card-body__HpNmx",answer:"ConsumerProfile_answer__eE8QZ","profile-form-container":"ConsumerProfile_profile-form-container__X7NIs","cancel-btn":"ConsumerProfile_cancel-btn__kZURY",disabled:"ConsumerProfile_disabled__jMULs","blue-text":"ConsumerProfile_blue-text__mK7oP","change-pwd-blk":"ConsumerProfile_change-pwd-blk__f7nhQ","save-blk":"ConsumerProfile_save-blk__HS76A","profile-delete-font":"ConsumerProfile_profile-delete-font__hxEUC","delete-btn-align":"ConsumerProfile_delete-btn-align__oKDWW","delete-profile-header":"ConsumerProfile_delete-profile-header__E_R_y","privacy-email":"ConsumerProfile_privacy-email__46w3j","sa-edit-btn":"ConsumerProfile_sa-edit-btn___bFPH","delete-profile-btn":"ConsumerProfile_delete-profile-btn__h2PCE","phone-wrapper":"ConsumerProfile_phone-wrapper__Z6z8c"}},83721:e=>{e.exports={round:"Profile_round__36eOK","edit-btn":"Profile_edit-btn__59w_u","save-btn":"Profile_save-btn__M_IIZ","profile-details-container":"Profile_profile-details-container__I7VZ_","field-text":"Profile_field-text__B00vG","delete-profile":"Profile_delete-profile__sjlpA","delete-btn":"Profile_delete-btn__2BuVF","card-header":"Profile_card-header__3RXST","card-body":"Profile_card-body__uoH8G","aligner-details-container":"Profile_aligner-details-container__QogKw","settings-small-text":"Profile_settings-small-text__oO1hu","profile-form-container":"Profile_profile-form-container___PqPL","cancel-btn":"Profile_cancel-btn__P3tev",disabled:"Profile_disabled__5zOvm","blue-text":"Profile_blue-text__Ukx5s","change-pwd-blk":"Profile_change-pwd-blk__09QbI","save-blk":"Profile_save-blk__lJn_Q","profile-pic-container":"Profile_profile-pic-container__d7ard","flex-direction":"Profile_flex-direction__6P4lJ","profile-pic":"Profile_profile-pic__J62Yd","profile-text-blk":"Profile_profile-text-blk___YT_t","profile-subtext":"Profile_profile-subtext__T3hxC","icon-info":"Profile_icon-info__nujz6","edit-aligner-blk":"Profile_edit-aligner-blk__yQee_","aligner-plan-header":"Profile_aligner-plan-header__W7CrQ","aligner-plan-body":"Profile_aligner-plan-body__rQoW3","profile-delete-font":"Profile_profile-delete-font__ZA7B3","delete-btn-align":"Profile_delete-btn-align__8qerx","delete-profile-header":"Profile_delete-profile-header__EUauO","privacy-email":"Profile_privacy-email__KfkI9","sa-aliner-delete-wrapper":"Profile_sa-aliner-delete-wrapper__TzfYC","sa-aligner-edit-wrapper":"Profile_sa-aligner-edit-wrapper__QuDmd","delete-profile-btn":"Profile_delete-profile-btn__gessW"}},96037:e=>{e.exports={container:"ChangeEmailModal_container__HM__8",title:"ChangeEmailModal_title__xmtgo","sub-title":"ChangeEmailModal_sub-title__Ftm9l",label:"ChangeEmailModal_label__MW2vY","btn-container":"ChangeEmailModal_btn-container__n_e2O"}},97968:(e,t,r)=>{"use strict";r.d(t,{A:()=>h});var n=r(42969),a=r(14232),i=r(1002),l=r(2171),s=r(79531),o=r(41201),d=r(86131),c=r.n(d),m=r(37876);function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function f(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?u(Object(r),!0).forEach(function(t){(0,n.A)(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var p=function(e){return f(f({},e),{},{asset_type:"profile"})};let h=(0,l.connect)(function(e){return{getUser:e.patientReducer}},function(e){return{getAvatar:function(){return e((0,o.$v)())}}})(function(e){var t=e.children,r=e.getAvatar,n=e.getUser,l=(0,a.useState)(!1),o=l[0],d=l[1],u=(0,a.useState)(!1),f=u[0],h=u[1],b=function(e,t){"upload_success"===t&&("lead"===e&&c().addEventToDataLayer("consumer_upload_success"),"patient"===e&&c().addEventToDataLayer("patient_upload_success"),"prospect"===e&&c().addEventToDataLayer("prospect_upload_success"))};return(0,m.jsxs)(m.Fragment,{children:[o?(0,m.jsx)(i.A,{variant:"primary",animation:"border"}):t(function(){return h(!0)}),f&&(0,m.jsx)(s.A,{enableFaceDetect:!1,onUploaded:function(){var e,t,a=null==n||null==(e=n.myInvisalign)||null==(t=e.attributes)?void 0:t.user_type;r(),b(a,"upload_success"),d(!1)},onUploading:function(){d(!0),h(!1)},onClose:function(){return h(!1)},constructPayload:p})]})})}}]);
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.