1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3651],{91359:function(e,t,o){"use strict";o.d(t,{Z:function(){return y}});var n=o(87462),a=o(63366),l=o(67294),r=o(86010),s=o(94780),i=o(81719),d=o(78884),c=o(1588),u=o(34867);function p(e){return(0,u.Z)("MuiCardContent",e)}(0,c.Z)("MuiCardContent",["root"]);var x=o(85893);let g=["className","component"],m=e=>{let{classes:t}=e;return(0,s.Z)({root:["root"]},p,t)},v=(0,i.ZP)("div",{name:"MuiCardContent",slot:"Root",overridesResolver:(e,t)=>t.root})(()=>({padding:16,"&:last-child":{paddingBottom:24}})),h=l.forwardRef(function(e,t){let o=(0,d.Z)({props:e,name:"MuiCardContent"}),{className:l,component:s="div"}=o,i=(0,a.Z)(o,g),c=(0,n.Z)({},o,{component:s}),u=m(c);return(0,x.jsx)(v,(0,n.Z)({as:s,className:(0,r.Z)(u.root,l),ownerState:c,ref:t},i))});var y=h},59742:function(e,t,o){"use strict";o.d(t,{Z:function(){return j}});var n=o(63366),a=o(87462),l=o(67294),r=o(86010),s=o(94780),i=o(29630),d=o(78884),c=o(81719),u=o(1588),p=o(34867);function x(e){return(0,p.Z)("MuiCardHeader",e)}let g=(0,u.Z)("MuiCardHeader",["root","avatar","action","content","title","subheader"]);var m=o(85893);let v=["action","avatar","className","component","disableTypography","subheader","subheaderTypographyProps","title","titleTypographyProps"],h=e=>{let{classes:t}=e;return(0,s.Z)({root:["root"],avatar:["avatar"],action:["action"],content:["content"],title:["title"],subheader:["subheader"]},x,t)},y=(0,c.ZP)("div",{name:"MuiCardHeader",slot:"Root",overridesResolver:(e,t)=>(0,a.Z)({[`& .${g.title}`]:t.title,[`& .${g.subheader}`]:t.subheader},t.root)})({display:"flex",alignItems:"center",padding:16}),Z=(0,c.ZP)("div",{name:"MuiCardHeader",slot:"Avatar",overridesResolver:(e,t)=>t.avatar})({display:"flex",flex:"0 0 auto",marginRight:16}),b=(0,c.ZP)("div",{name:"MuiCardHeader",slot:"Action",overridesResolver:(e,t)=>t.action})({flex:"0 0 auto",alignSelf:"flex-start",marginTop:-4,marginRight:-8,marginBottom:-4}),f=(0,c.ZP)("div",{name:"MuiCardHeader",slot:"Content",overridesResolver:(e,t)=>t.content})({flex:"1 1 auto"}),_=l.forwardRef(function(e,t){let o=(0,d.Z)({props:e,name:"MuiCardHeader"}),{action:l,avatar:s,className:c,component:u="div",disableTypography:p=!1,subheader:x,subheaderTypographyProps:g,title:_,titleTypographyProps:j}=o,w=(0,n.Z)(o,v),S=(0,a.Z)({},o,{component:u,disableTypography:p}),C=h(S),I=_;null==I||I.type===i.Z||p||(I=(0,m.jsx)(i.Z,(0,a.Z)({variant:s?"body2":"h5",className:C.title,component:"span",display:"block"},j,{children:I})));let P=x;return null==P||P.type===i.Z||p||(P=(0,m.jsx)(i.Z,(0,a.Z)({variant:s?"body2":"body1",className:C.subheader,color:"text.secondary",component:"span",display:"block"},g,{children:P}))),(0,m.jsxs)(y,(0,a.Z)({className:(0,r.Z)(C.root,c),as:u,ref:t,ownerState:S},w,{children:[s&&(0,m.jsx)(Z,{className:C.avatar,ownerState:S,children:s}),(0,m.jsxs)(f,{className:C.content,ownerState:S,children:[I,P]}),l&&(0,m.jsx)(b,{className:C.action,ownerState:S,children:l})]}))});var j=_},54162:function(e,t,o){(window.__NEXT_P=window.__NEXT_P||[]).push(["/account/billing/upgrade-addons",function(){return o(867)}])},867:function(e,t,o){"use strict";o.r(t);var n=o(85893),a=o(67294),l=o(11163),r=o(79072),s=o(49837),i=o(61953),d=o(91359),c=o(29630),u=o(44373),p=o(75084),x=o(70754),g=o(49746),m=o(68550),v=o(22640),h=o(62097),y=o(18424),Z=o(41429),b=o(30282),f=o(86501),_=o(57090);let j=()=>{var e;let t=(0,l.useRouter)(),o=(0,y.a)(),[j,w]=(0,a.useState)(!1),[S,C]=(0,a.useState)(!0),[I,P]=(0,a.useState)([]),[B,A]=(0,a.useState)([]),[N,T]=(0,a.useState)(!1),[W,k]=(0,a.useState)(""),[R,D]=(0,a.useState)(!0),F=window.localStorage.getItem("addressUpdated"),[L,M]=(0,a.useState)("yes"===F),[E,O]=(0,a.useState)(!1),[z,U]=(0,a.useState)([]),H=(0,g.getdataFromLocalStorage)("upgradeBrandIds"),$=window.localStorage.getItem("upgradeAllBrand"),J=(0,g.getdataFromLocalStorage)("upgradeBillingPlan"),X=(0,g.getdataFromLocalStorage)("upgradeBillingAddOns"),q=(0,g.getdataFromLocalStorage)("selectedLocation"),Y=(0,g.getdataFromLocalStorage)("upgradeBillingAddOnsResponseBy"),G=window.localStorage.getItem("selectedAddonForLocation"),K=(null==t?void 0:null===(e=t.query)||void 0===e?void 0:e.planId)||(null==J?void 0:J.planId),Q=(0,h.Z)(),V=(0,g.getUserCompanyData)(),ee=window.localStorage.getItem("userData"),et=(0,g.decryptData)(ee),eo=JSON.parse(et),en=()=>{var e,t;let o="".concat(m.Z.baseURL).concat(m.Z.getAddOnDetail),n={agency_id:null==V?void 0:V.id,brand_ids:H||[],all_brand:"all"===$?1:0,add_on_i
1ds:null==X?void 0:X.filter(e=>"0"!==e),response_by:null==Y?void 0:Y.response_by,response_by_value:null==Y?void 0:Y.response_by_value};(null==V?void 0:V.bundle_id)==="3"&&(null==V?void 0:null===(e=V.company_option)||void 0===e?void 0:e.who_will_pay)==="brand"&&(o="".concat(m.Z.baseURL).concat(m.Z.getBrandAddOnDetail),n={brand_id:null==V?void 0:V.id,store_ids:H||[],all_store:"all"===$?1:0,add_on_ids:null==X?void 0:X.filter(e=>"0"!==e),response_by:null==Y?void 0:Y.response_by,response_by_value:null==Y?void 0:Y.response_by_value}),null!=G&&""!==G&&(null==V?void 0:null===(t=V.company_option)||void 0===t?void 0:t.who_will_pay)==="location"&&(o="".concat(m.Z.baseURL).concat(m.Z.getBrandAddOnDetail),n={brand_id:null==V?void 0:V.id,store_ids:(null==q?void 0:q.value)?[null==q?void 0:q.value]:[],all_store:"all"===$?1:0,add_on_ids:null==X?void 0:X.filter(e=>"0"!==e),response_by:null==Y?void 0:Y.response_by,response_by_value:null==Y?void 0:Y.response_by_value}),v.v.getAllWithBody(o,n).then(e=>{P(null==e?void 0:e.plans),A(null==e?void 0:e.store_ids),k(null==e?void 0:e.total_amount),w(!1)}).catch(e=>{T(!0),(0,g.showErrorMessage)(e),w(!1),(0,g.dataDogLog)("error","Fetch billing data on checkout page","Fetch billing data on checkout page Error occurred",JSON.stringify(n),e)})};(0,a.useEffect)(()=>{S&&(C(!1),w(!0),(async()=>{w(!0),(null==H?void 0:H.length)>0||"all"===$||null!=G&&""!==G?en():(f.ZP.error("Something went wrong, please try again."),window.localStorage.removeItem("upgradeBrandIds"),window.localStorage.removeItem("upgradeAllBrand"),t.push("/account/sub-agency-brands"))})())},[K,S,H]);let ea=async()=>{await v.v.getListing("".concat(m.Z.baseURL).concat(m.Z.getCustomerBillingAddress,"?user_id=").concat(null==eo?void 0:eo.id)).then(e=>{U(null==e?void 0:e.data)}).catch(e=>{(0,g.showErrorMessage)(e),(0,g.dataDogLog)("error","Fetch billing address data on checkout page","Fetch billing address data on checkout page Error occurred","user_id=".concat(null==eo?void 0:eo.id),e)})};(0,a.useEffect)(()=>{R&&(D(!1),ea())},[R]);let[el,er]=(0,a.useState)(!1),es=e=>{er(!1),e&&(ea(),localStorage.setItem("addressUpdated","yes"),M(!0))},ei=()=>{L?eu():O(!0)},ed=e=>{O(!1),"yes"===e?eu():ec(!0)},ec=e=>{e&&er(!0)},eu=()=>{(async()=>{w(!0);try{let e="".concat(m.Z.baseURL).concat(m.Z.saveProratedAddons),n={store_ids:B,add_on_ids:null==X?void 0:X.filter(e=>"0"!==e),response_by:null==Y?void 0:Y.response_by,response_by_value:null==Y?void 0:Y.response_by_value};v.v.getAllWithBody(e,n).then(e=>{var n,a;f.ZP.success(null==e?void 0:e.message),window.localStorage.removeItem("whoWillPay"),window.localStorage.removeItem("upgradeBrandIds"),window.localStorage.removeItem("upgradeAllBrand"),window.localStorage.removeItem("upgradeBillingAddOns"),window.localStorage.removeItem("upgradeBillingAddOnsResponseBy"),window.localStorage.removeItem("onlyAddonProrated"),window.localStorage.removeItem("selectedAddonForLocation"),(null==V?void 0:V.bundle_id)==="3"&&(null==V?void 0:null===(n=V.company_option)||void 0===n?void 0:n.who_will_pay)==="brand"?(t.push({pathname:"/account/location-information"}),o.reInitialize()):null!=G&&""!==G&&(null==V?void 0:null===(a=V.company_option)||void 0===a?void 0:a.who_will_pay)==="location"?(t.push({pathname:"/account/billing"}),o.reInitialize()):(t.push({pathname:"/account/sub-agency-brands"}),o.reInitialize()),w(!1)}).catch(e=>{(0,g.showErrorMessage)(e),w(!1),(0,g.dataDogLog)("error","Make payment from checkout page","Make payment from checkout page Error occurred",JSON.stringify(n),e)})}catch(a){w(!1)}})()};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Z.Z,{title:"Add Prorated Add-on Plans",toolTipText:"",buttonText:"",buttonStyle:""}),j&&(0,n.jsxs)("div",{className:"loaderProgress",children:[(0,n.jsx)(x.Z,{})," "]}),(0,n.jsx)(r.ZP,{container:!0,spacing:5,children:(0,n.jsxs)(r.ZP,{item:!0,xs:12,md:12,xl:12,children:[(0,n.jsx)(s.Z,{children:(0,n.jsxs)(i.Z,{sx:{borderRadius:1,border:e=>"1px solid ".concat(e.palette.divider)},children:[(0,n.jsxs)(d.Z,{sx:{p:4},children:[(0,n.jsx)(c.Z,{sx:{mb:3.5,fontWeight:600,color:"text.secondary"},children:"New Plan Details"}),(null==I?void 0:I.length)>0&&(0,n.jsx)(i.Z,{sx:{display:"flex",flexDirection:"column"},children:null==I?void 0:I.map((e,t)=>{var o,l;return(0,n.jsxs)(a.Fragment,{children:[(0,n.jsxs)(i.Z,{sx:{gap:2,mb:2.5,display:"flex",flexWrap:"wrap",alignItems:"center",justifyContent:"space-between"},children:[(0,n.jsx)(c.Z,{sx:{color:"text.secondary"},children:"Plan Name"}),(0,n.jsx)(c.Z,{sx:{color:"text.secondary"},children:"".concat(null==e?void 0:e.title)})]}),(0,n.jsxs)(i.Z,{sx:{gap:2,mb:2.5,display:"flex",flexWrap:"wrap",alignItems:"center",justifyContent:"space-between"},children:[(0,n.jsx)(c.Z,{sx:{color:"text.secondary"},children:"Per Location Price"}),(0,n.jsx)(c.Z,{sx:{color:"text.secondary"},children:"$ ".concat(null==e?void 0:null===(o=e.per_location_price)||void 0===o?void 0:o.toFixed(2))})]}),(0,n.jsxs)(i.Z,{sx:{gap:2,mb:2.5,display:"flex",flexWrap:"wrap",alignItems:"center",justifyContent:"space-between"},children:[(0,n.jsx)(c.Z,{sx:{color:"text.secondary"},children:"Total Location"}),(0,n.jsx)(c.Z,{sx:{color:"text.secondary"},children:null==e?void 0:e.total_location})]}),(0,n.jsxs)(i.Z,{sx:{gap:2,mb:2.5,display:"flex",flexWrap:"wrap",alignItems:"center",justifyContent:"space-between"},children:[(0,n.jsx)(c.Z,{sx:{color:"text.secondary"},children:"Total Plan Price"}),(0,n.jsxs)(c.Z,{sx:{color:"text.secondary"},children:["$ ",null==e?void 0:null===(l=e.total_location_price)||void 0===l?void 0:l.toFixed(2)]})]}),(null==I?void 0:I.length)>t+1&&(0,n.jsx)(u.Z,{sx:{my:"0 !important",mt:"10px",mb:"10px"}})]},"planDetails".concat(t))})})]}),(0,n.jsx)(u.Z,{sx:{my:"0 !important"}}),(0,n.jsxs)(d.Z,{sx:{p:e=>"".concat(e.spacing(4)," !important")},children:[(0,n.jsxs)(i.Z,{sx:{mb:4,gap:2,display:"flex",flexWrap:"wrap",alignItems:"center",justifyContent:"space-between"},children:[(0,n.jsx)(c.Z,{sx:{fontWeight:700,color:"text.secondary"},children:"Sub Total"}),""!==W&&(0,n.jsxs)(c.Z,{sx:{fontWeight:600,color:"text.secondary"},children:["$",null==W?void 0:W.toFixed(2)]})]}),(0,n.jsxs)(i.Z,{sx:{mb:4,gap:2,display:"flex",flexWrap:"wrap",alignItems:"center",justifyContent:"space-between"},children:[(0,n.jsx)(c.Z,{sx:{fontWeight:700,color:"text.secondary"},children:"Total"}),""!==W&&(0,n.jsxs)(c.Z,{sx:{fontWeight:600,color:"text.secondary"},children:["$",null==W?void 0:W.toFixed(2)]})]})]}),(0,n.jsx)(u.Z,{sx:{my:"0 !important"}}),(0,n.jsxs)(d.Z,{sx:{p:e=>"".concat(e.spacing(4)," !important")},children:[(0,n.jsxs)(i.Z,{sx:{mb:4,gap:2,display:"flex",flexWrap:"wrap",alignItems:"center",justifyContent:"space-between"},children:[(0,n.jsx)(c.Z,{sx:{fontWeight:600,color:"text.secondary"},children:"Billing Address:"}),(0,n.jsx)(c.Z,{sx:{fontSize:"13px",color:Q.palette.error.main},children:"Please confirm this is the correct billing address. If not, please be sure to update before Checkout."})]}),(0,n.jsx)(c.Z,{sx:{color:"text.secondary"},children:(null==z?void 0:z.company)?"".concat(null==z?void 0:z.company,","):""}),(null==z?void 0:z.billing_address)&&(0,n.jsx)(c.Z,{sx:{color:"text.secondary"},children:(null==z?void 0:z.billing_address)?"".concat(null==z?void 0:z.billing_address,","):""}),(null==z?void 0:z.zipcode)&&(0,n.jsxs)(c.Z,{sx:{color:"text.secondary"},children:[(null==z?void 0:z.state)?"".concat(null==z?void 0:z.state,","):"",(null==z?void 0:z.country)?"".concat(null==z?void 0:z.country,","):"",null==z?void 0:z.zipcode]}),(null==z?void 0:z.mobile)&&(0,n.jsxs)(c.Z,{sx:{mb:4,color:"text.secondary"},children:["Mobile : ",null==z?void 0:z.mobile]}),(0,n.jsx)(c.Z,{onClick:()=>
1er(!0),sx:{color:"primary.main",textDecoration:"none"},children:"Change address"})]}),(0,n.jsx)(u.Z,{sx:{my:"0 !important"}}),(0,n.jsx)(d.Z,{sx:{p:e=>"".concat(e.spacing(4)," !important")},children:(0,n.jsx)(p.Z,{variant:"contained",onClick:ei,disabled:N,children:"Upgrade"})}),(0,n.jsx)(b.Z,{open:el,onClose:es})]})}),E&&(0,n.jsx)(_.Z,{openDialogAlert:E,onCloseDialogAlert:ed,rowData:"",confirmMessage:"Does the billing address listed is correct?",confirmButtonText:"Yes",declineButtonText:"No"})]})})]})};j.acl={action:"manage",subject:"billing-checkout"},t.default=j},30282:function(e,t,o){"use strict";var n=o(85893),a=o(1890),l=o(95398),r=o(72713),s=o(80562),i=o(75015);let d=e=>{let{open:t,onClose:o}=e,d=()=>o(!1),c=e=>{o(e)};return(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(a.Z,{fullWidth:!0,scroll:"body",maxWidth:"lg",open:t,onClose:d,children:(0,n.jsxs)(l.Z,{sx:{px:{xs:8,sm:15},py:{xs:8,sm:12.5},position:"relative"},children:[(0,n.jsx)(s.Z,{size:"small",onClick:d,sx:{position:"absolute",right:"1rem",top:"1rem"},children:(0,n.jsx)(r.Z,{icon:"bx:x"})}),(0,n.jsx)(i.Z,{handleSave:c})]})})})};t.Z=d},19939:function(e,t,o){"use strict";var n=o(85893),a=o(72389),l=o(44850),r=o(75084);let s=e=>{let{toolTipMessage:t,buttonText:o,buttonStyle:s,variant:i,color:d}=e;return(0,n.jsx)(a.Z,{TransitionComponent:l.Z,title:t,arrow:!0,enterTouchDelay:0,leaveTouchDelay:5e3,children:(0,n.jsx)(r.Z,{variant:i,color:d,className:"inputToolTipButton",sx:s||{"& svg":{mr:2},minWidth:"20px"},children:o})})};t.Z=s},41429:function(e,t,o){"use strict";var n=o(85893),a=o(79072),l=o(49837),r=o(61953),s=o(19939),i=o(29630);let d=e=>{let{title:t,subTitle:o,toolTipText:d,buttonText:c,buttonStyle:u}=e;return(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(l.Z,{sx:{width:"100%",marginBottom:"10px",padding:"15px 10px 5px 20px"},children:(0,n.jsx)(a.ZP,{container:!0,spacing:6,sx:{marginBottom:"10px"},children:(0,n.jsx)(a.ZP,{item:!0,xs:12,md:12,sm:12,lg:12,sx:{fontWeight:"bold",fontSize:"25px"},children:(0,n.jsxs)(r.Z,{sx:{fontSize:"1.5rem",fontWeight:"800",letterSpacing:"0.15px",display:"inline-block"},children:[t," ",""!==d?(0,n.jsx)(s.Z,{toolTipMessage:d,buttonText:c,buttonStyle:u,variant:"text",color:"primary"}):null,""!==o&&null!=o&&(0,n.jsx)(i.Z,{sx:{fontSize:"1rem",letterSpacing:"0.15px"},children:o})]})})})})})};t.Z=d},61310:function(){}},function(e){e.O(0,[9072,2389,7536,939,9491,2521,5015,9774,2888,179],function(){return e(e.s=54162)}),_N_E=e.O()}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.