1try{let e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="5bdd1be7-1fa4-43b1-8bd6-80769f7668a1",e._sentryDebugIdIdentifier="sentry-dbid-5bdd1be7-1fa4-43b1-8bd6-80769f7668a1")}catch(e){}("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{}).SENTRY_RELEASE={id:"a1914b02daa8c613ead1e27da03d97f802f0ebde"};(self.webpackChunkinvisiblefence=self.webpackChunkinvisiblefence||[]).push([[3899],{35567:function(e,t,n){var a=n(14041),l=n(28610),s=n(22949);const o={default:"bg-[#f7f7f7]",error:"bg-[#ffdddd]",info:"bg-[#e0edfc]",notify:"bg-[#feebcb]",success:"bg-[#d5ffd8]"},r={error:"fill-destructive",info:"fill-primary",notify:"fill-primary",success:"fill-green"},i=e=>(e=>"object"==typeof e&&null!==e&&!a.isValidElement(e)&&"error"in e)(e)?e.error:e;t.A=({messageList:e,type:t="default"})=>{const{tt:n}=(0,l.useUiComponentsInternationalContext)();return(null==e?void 0:e.length)>0?a.createElement("div",{className:`flex gap-2 items-center p-4 w-auto mb-4 text-base text-black rounded-sm ${o[t]}`},"default"!==t&&a.createElement("div",{className:"w-6 h-6"},a.createElement(s.eXv,{className:`${r[t]} size-6`})),a.createElement("ul",{className:"m-0 p-0 list-none"},e.map((e,l)=>{const s=i(e);return a.createElement("li",{className:"mb-4 p-0 list-none last:mb-0",key:`${t}-${l}`},"Failed to read the 'localStorage' property from 'Window': Access is denied for this document."===s?n(e=>e.formMessageBoxComponent.enableCookiesForLoginMessage):s)}))):null}},94591:function(e,t,n){n.r(t),n.d(t,{default:function(){return L}});var a=n(14041),l=n(41204),s=n(93910),o=n(11352),r=n(2359),i=n(35567),c=n(24440),m=n(87983),u=n(32868),d=n(38475),f=n(28610),g=n(45655),p=n(80435),b=n(14606),h=n(59501),v=n(28414),E=n(13313),N=n(16230),y=n(34064);const C=a.lazy(()=>n.e(1725).then(n.bind(n,68645)));var x=function({context:e,updatePasswordServiceUrl:t="https://login.radiosystemscorporation.com",brand:n="default",onError:l=()=>{},onSuccess:s=()=>{}}){var o,r,i,x,w,A,k,S;const{tt:F,locale:L}=(0,f.useUiComponentsInternationalContext)(),I=(0,v.Zg)(),{0:D,1:M}=(0,a.useState)({acceptsMarketing:(null==e||null===(o=e.customer)||void 0===o?void 0:o.acceptsMarketing)||!1,firstName:(null==e||null===(r=e.customer)||void 0===r?void 0:r.firstName)||"",lastName:(null==e||null===(i=e.customer)||void 0===i?void 0:i.lastName)||"",phone:(null==e||null===(x=e.customer)||void 0===x?void 0:x.phone)||""}),{0:V,1:$}=(0,a.useState)(!1),P=void 0===globalThis.location,T=({label:e})=>F(e=>e.accountFormCommon.fieldRequiredValidationMessage,{label:e}),U=I.object({firstName:I.string().trim().requiredLocalized(T).label(F(e=>e.accountFormCommon.firstNameLabel)),lastName:I.string().trim().requiredLocalized(T).label(F(e=>e.accountFormCommon.lastNameLabel)),phone:I.string().testLocalized("",({label:e})=>F(e=>e.accountFormCommon.fieldInvalidValueValidationMessage,{label:e}),()=>{var e;return!((null==D||null===(e=D.phone)||void 0===e?void 0:e.length)>0)||(0,u.h1)(D.phone)}).label(F(e=>e.accountFormCommon.phoneNumberLabel)).nullable()}),{register:z,handleSubmit:_,setValue:j,formState:{errors:H}}=(0,c.mN)({mode:"all",resolver:(0,m.t)(U)}),O=e=>{M({...D,[e.target.name]:e.target.value})};return V?a.createElement(y.A,{className:"sso-login-spinner-container"},a.createElement(d.wC,{height:60,width:60,wrapperClass:"[&>svg]:stroke-primary"})):a.createElement("div",null,a.createElement("h2",null,F(e=>e.accountSettingsCommon.userDetailsHeader)),a.createElement(E.A,{onSubmit:_(async(t,n)=>{var a;n.preventDefault();const o=t;o.phone=null==o||null===(a=o.phone)||void 0===a?void 0:a.replaceAll(" ",""),o.phone||(o.phone=null),$(!0);try{await e.updateCustomer(o),s()}catch(r){console.error(r),l()}$(!1)}),className:"mb-10"},a.createElement("div",{className:"my-4 md:max-w-[60%]"},a.createElement(b.J,{htmlFor:"firstName",className:"flex flex-col gap-1 text-lg"},a.createElement("span",null,F(e=>e.accountFormCommon.firstNameLabel)," ",a.createElement("span",{className:"asterisk"}," *")),a.createElement(h.p,Object.assign({type:"text",name:"firstName",id:"firstName",defaultValue:e.customer.firstName},z("firstName"),{onChange:O}))),(null===(w=H.firstName)||void 0===w?void 0:w.message)&&a.createElement(N.X,null,null===(A=H.firstName)||void 0===A?void 0:A.message)),a.createElement("div",{className:"my-4 md:max-w-[60%]"},a.createElement(b.J,{htmlFor:"lastName",className:"flex flex-col gap-1 text-lg"},a.createElement("span",null,F(e=>e.accountFormCommon.lastNameLabel)," ",a.createElement("span",{className:"asterisk"}," *")),a.createElement(h.p,Object.assign({type:"text",name:"lastName",id:"lastName",defaultValue:e.customer.lastName},z("lastName"),{onChange:O}))),(null===(k=H.lastName)||void 0===k?void 0:k.message)&&a.createElement(N.X,null,null===(S=H.lastName)||void 0===S?void 0:S.message)),a.createElement("div",{className:"my-4 md:max-w-[60%]"},a.createElement(b.J,{htmlFor:"phone",className:"flex flex-col gap-1 text-lg"},a.createElement("span",null,F(e=>
1e.accountFormCommon.phoneNumberLabel)),a.createElement(u.Ay,Object.assign({inputComponent:h.p,placeholder:F(e=>e.accountFormCommon.phoneNumPlaceholder),name:"phone",id:"phone",value:e.customer.phone},z("phone"),{onChange:e=>j("phone",e,{shouldValidate:!0})})))),a.createElement("div",{className:"my-4 md:max-w-[60%]"},a.createElement(p.$,{type:"submit",disabled:V},F(e=>e.accountSettingsCommon.updateDetailsButton)))),a.createElement("br",null),a.createElement("h2",null,F(e=>e.accountSettingsCommon.updatePasswordHeader)),!P&&a.createElement(a.Suspense,{fallback:a.createElement("div",null,F(e=>e.fallbackCommon.loadingFallback))},a.createElement(C,{src:`${t}${(0,g.getLocalizedPagePath)("/",L)}account/update-password?brand=${n}&iframe=true`,style:{width:"1px",minWidth:"100%",border:"0"}})))},w=n(36923),A=n(58361),k=n(48222),S=n(80832);function F({customerUserErrors:e,successMessage:t}){const{siteSettings:n}=(0,a.useContext)(o.O),{currency:r}=(0,a.useContext)(l.U6),c=(0,a.useContext)(s.C);return a.createElement(w.A,null,a.createElement("h1",null,n.settingsPageHeadline),a.createElement("p",null,n.settingsPageSubHeadline),t&&a.createElement(i.A,{messageList:[t],type:"success"}),(null==e?void 0:e.length)>0&&a.createElement(i.A,{messageList:e,type:"error"}),a.createElement(x,{context:c,brand:"CAD"===r?"invisiblefence_canada":"invisiblefence"}))}var L=function({location:e}){var t,n;const l=(0,a.useContext)(s.C);return l.isAuthenticated(),a.createElement(S.A,{location:e,headTagData:{title:"Account - Settings | Invisible Fence",description:"",meta:(0,r.A)({title:"Account - Settings | Invisible Fence",description:"",url:"/account/settings"},"invisiblefence")}},l.customer.isAuthenticated&&a.createElement(a.Fragment,null,a.createElement(A.A,null,a.createElement(k.A,{elements:[{text:"Home",link:"/"},{text:"Account",link:"/account"},{text:"Settings",link:"/account/settings"}]})),a.createElement(F,{customerUserErrors:null==e||null===(t=e.state)||void 0===t?void 0:t.customerUserErrors,successMessage:null==e||null===(n=e.state)||void 0===n?void 0:n.successMessage})),!l.customer.isAuthenticated&&a.createElement("div",null,"Loading..."))}}}]); 2//# sourceMappingURL=component---src-page-templates-account-settings-tsx-f619ef08edf21b812e66.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.