(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1736],{4600:function(e,n,o){"use strict";o.r(n),o.d(n,{default:function(){return RegionModal_RegionModal}});var t=o(4988),i=o(4235),a=o(3888),l=o.n(a),r=o(4194),s=o(6652),u=o(2614),d=o(3412),c=o(31),p=o(4064),g=o(5947),b=o.n(g),m=o(1549),f=["isValidating"],h=l()(()=>Promise.all([o.e(7498),o.e(3465),o.e(5906)]).then(o.bind(o,3465)).then(e=>e.RegionModal),{ssr:!1,loadableGenerated:{webpack:()=>[null]}}),RegionModal_RegionModal=function(e){var n,{title:o,description:a,closeButtonAriaLabel:l,inputField:{label:g,errorMessage:P,noProductsAvailableErrorMessage:k,buttonActionText:v},idkPostalCodeLink:{text:M,to:_,icon:{icon:x,alt:y}}}=e,C=(0,r.useRef)(null),R=(0,c.kP)(),{isValidating:A}=R,E=(0,i.Z)(R,f),{modal:L,closeModal:j}=(0,s.l)(),{0:w,1:S}=(0,r.useState)(""),{loading:Z,setRegion:F,regionError:N,setRegionError:T}=(0,p.Z)(),B=(n=(0,t.Z)(function*(){A||(yield F({session:E,onSuccess:()=>{S(""),j()},postalCode:w,errorMessage:P,noProductsAvailableErrorMessage:k}))}),function(){return n.apply(this,arguments)}),O=!!(!(null!==d.deliveryPromise&&void 0!==d.deliveryPromise&&d.deliveryPromise.mandatory)||E.postalCode),V={href:_,children:(0,m.jsxs)(m.Fragment,{children:[M,!!x&&(0,m.jsx)(u.Z,{name:x,"aria-label":y,width:20,height:20})]})};return(0,m.jsx)(m.Fragment,{children:L&&(0,m.jsx)(h,{title:o,description:a,overlayProps:{className:"section ".concat(b().section," section-region-modal")},closeButtonAriaLabel:l,inputRef:C,inputValue:w,inputLabel:g,errorMessage:N,idkPostalCodeLinkProps:_?V:null,onInput:e=>{""!==N&&T(""),S(e.currentTarget.value)},onSubmit:B,fadeOutOnSubmit:!1,onClear:()=>{S(""),T("")},inputButtonActionText:Z?"...":v,dismissible:O})})}},5947:function(e){e.exports={section:"section_section__DLuEd"}}}]);