/*! @version pwa-studio: 14.1.0, @magento/venia-ui: ~11.5.0, @magento/pwa-theme-venia: ~2.4.0, @magento/pwa-buildpack: ~11.5.3, @magento/peregrine: ~14.4.1, @magento/pagebuilder: ~9.3.2, @magento/eslint-config: ~1.5.0, @magento/babel-preset-peregrine: ~1.3.3, @apollo/client: ~3.5.0 */
(window.webpackJsonp=window.webpackJsonp||[]).push([[89],{"8izY":function(e,t,o){"use strict"
var n=o("PBB4"),r=o.n(n),a=o("mLYv"),c=r()(function(e){return e[1]})
c.i(a.a,"",!0),c.push([e.i,".geoLocationPopup-root-0qn {\n}\n\n.geoLocationPopup-backdrop-9-3 {\n}\n\n.geoLocationPopup-panel-wW2 {\n}\n\n.geoLocationPopup-content-3Ln {\n}\n\n.geoLocationPopup-text-zeT {\n}\n\n.geoLocationPopup-title-7Rx {\n}\n\n.geoLocationPopup-description-n-N {\n}\n\n.geoLocationPopup-actions-FUm {\n}\n\n.geoLocationPopup-switchButton-OyL {\n}\n\n.geoLocationPopup-switchButtonInner-68N {\n}\n\n.geoLocationPopup-switchLabel-E1J {\n}\n\n.geoLocationPopup-mapIcon-oQc {\n}\n\n.geoLocationPopup-switchTarget-qIl {\n}\n\n.geoLocationPopup-closeButton-6ue {\n}\n\n.geoLocationPopup-closeIcon-gA6 {\n}\n\n.geoLocationPopup-detectedLocation-BEs {\n}\n",""]),c.locals={root:"geoLocationPopup-root-0qn fixed inset-0 z-dialog pointer-events-none lg_top-auto lg_bottom-0 lg_left-0 lg_right-0",backdrop:"geoLocationPopup-backdrop-9-3 absolute inset-0 bg-black opacity-0 pointer-events-auto",panel:"geoLocationPopup-panel-wW2 absolute bottom-0 left-0 right-0 bg-white rounded-t-2xl px-4 pt-12 pb-6 pointer-events-auto border-t border-t-light-grey lg_relative lg_rounded-none lg_p-8",content:"geoLocationPopup-content-3Ln flex flex-col gap-4 mx-auto lg_flex-row lg_items-center lg_justify-center lg_gap-8",text:"geoLocationPopup-text-zeT flex flex-col gap-2 text-center lg_text-left",title:"geoLocationPopup-title-7Rx font-bold text-sm lg_text-base lg_leading-heading lg_whitespace-nowrap lg_overflow-hidden lg_text-ellipsis",description:"geoLocationPopup-description-n-N text-xs lg_text-sm lg_whitespace-nowrap lg_overflow-hidden lg_text-ellipsis",actions:"geoLocationPopup-actions-FUm flex flex-col gap-2 lg_flex-row lg_items-center lg_gap-4",switchButton:"geoLocationPopup-switchButton-OyL "+a.a.locals.root_highPrioritySize_medium+" !min-w-auto",switchButtonInner:"geoLocationPopup-switchButtonInner-68N flex items-center gap-2",switchLabel:"geoLocationPopup-switchLabel-E1J font-bold whitespace-nowrap",mapIcon:"geoLocationPopup-mapIcon-oQc flex items-center justify-center rounded-full w-5 h-5 shrink-0",switchTarget:"geoLocationPopup-switchTarget-qIl font-bold",closeButton:"geoLocationPopup-closeButton-6ue absolute right-0 top-0",closeIcon:"geoLocationPopup-closeIcon-gA6 w-6 h-6 m-3",detectedLocation:"geoLocationPopup-detectedLocation-BEs text-xs text-center lg_text-left lg_text-sm"},t.a=c},ANGM:function(e,t,n){"use strict"
n.r(t),n.d(t,"default",function(){return R})
var r=n("ERkP"),a=n.n(r),c=n("aWzz"),s=n("KgAZ"),u=n("kQwz"),l=n("31Ou"),p=n("X5qW"),g=n("nQjY"),d=n("ddV6"),m=n.n(d),b=n("8aoe"),h=n("P7m1"),y=n("Lgxs"),_=n("VhC9"),O=n("SRwh"),v=n("cbiG"),L=n.n(v)
function _regenerator(){var e,t,o="function"==typeof Symbol?Symbol:{},n=o.iterator||"@@iterator",r=o.toStringTag||"@@toStringTag"
function i(o,n,r,c){var i=n&&n.prototype instanceof Generator?n:Generator,s=Object.create(i.prototype)
return _regeneratorDefine2(s,"_invoke",function(o,n,r){var c,i,s,u=0,l=r||[],p=!1,g={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function d(t,o){return c=t,i=0,s=e,g.n=o,a}}
function d(o,n){for(i=o,s=n,t=0;!p&&u&&!r&&t<l.length;t++){var r,c=l[t],f=g.p,d=c[2]
o>3?(r=d===n)&&(s=c[(i=c[4])?5:(i=3,3)],c[4]=c[5]=e):c[0]<=f&&((r=o<2&&f<c[1])?(i=0,g.v=n,g.n=c[1]):f<d&&(r=o<3||c[0]>n||n>d)&&(c[4]=o,c[5]=n,g.n=d,i=0))}if(r||o>1)return a
throw p=!0,n}return function(r,l,f){if(u>1)throw TypeError("Generator is already running")
for(p&&1===l&&d(l,f),i=l,s=f;(t=i<2?e:s)||!p;){c||(i?i<3?(i>1&&(g.n=-1),d(i,s)):g.n=s:g.v=s)
try{if(u=2,c){if(i||(r="next"),t=c[r]){if(!(t=t.call(c,s)))throw TypeError("iterator result is not an object")
if(!t.done)return t
s=t.value,i<2&&(i=0)}else 1===i&&(t=c.return)&&t.call(c),i<2&&(s=TypeError("The iterator does not provide a '"+r+"' method"),i=1)
c=e}else if((t=(p=g.n<0)?s:o.call(n,g))!==a)break}catch(t){c=e,i=1,s=t}finally{u=1}}return{value:t,done:p}}}(o,r,c),!0),s}var a={}
function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}t=Object.getPrototypeOf
var c=[][n]?t(t([][n]())):(_regeneratorDefine2(t={},n,function(){return this}),t),s=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(c)
function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,GeneratorFunctionPrototype):(e.__proto__=GeneratorFunctionPrototype,_regeneratorDefine2(e,r,"GeneratorFunction")),e.prototype=Object.create(s),e}return GeneratorFunction.prototype=GeneratorFunctionPrototype,_regeneratorDefine2(s,"constructor",GeneratorFunctionPrototype),_regeneratorDefine2(GeneratorFunctionPrototype,"constructor",GeneratorFunction),GeneratorFunction.displayName="GeneratorFunction",_regeneratorDefine2(GeneratorFunctionPrototype,r,"GeneratorFunction"),_regeneratorDefine2(s),_regeneratorDefine2(s,r,"Generator"),_regeneratorDefine2(s,n,function(){return this}),_regeneratorDefine2(s,"toString",function(){return"[object Generator]"}),(_regenerator=function _regenerator(){return{w:i,m:f}})()}function _regeneratorDefine2(e,t,n,r){var a=Object.defineProperty
try{a({},"",{})}catch(e){a=0}(_regeneratorDefine2=function _regeneratorDefine(e,t,n,r){function o(t,o){_regeneratorDefine2(e,t,function(e){return this._invoke(t,o,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))})(e,t,n,r)}var w="/api/geo-country",P="geo_detected_country",j="PL",N=6e3
function _detectUserCountry(){return(_detectUserCountry=L()(_regenerator().m(function _callee(){var e,t,o,n,r,a,c,i,s,u,l,p
return _regenerator().w(function(g){for(;;)switch(g.p=g.n){case 0:if(globalThis.document){g.n=1
break}return g.a(2,j)
case 1:if(g.p=1,!(e=new URLSearchParams(globalThis.location.search).get("geo"))||!/^[A-Z]{2}$/i.test(e)){g.n=2
break}t=e.toUpperCase()
try{globalThis.sessionStorage.removeItem(P),globalThis.sessionStorage.setItem(P,t)}catch(e){}return g.a(2,t)
case 2:g.n=4
break
case 3:g.p=3,g.v
case 4:if(g.p=4,!(o=globalThis.sessionStorage.getItem(P))){g.n=5
break}return g.a(2,o)
case 5:g.n=7
break
case 6:g.p=6,g.v
case 7:return g.p=7,n=new AbortController,r=setTimeout(function(){return n.abort()},N),g.n=8,fetch(w,{method:"GET",headers:{Accept:"application/json"},signal:n.signal})
case 8:if(a=g.v,clearTimeout(r),!a.ok){g.n=10
break}return g.n=9,a.json()
case 9:if(c=g.v,!(i=c.countryCode)||!/^[A-Z]{2}$/i.test(i)){g.n=10
break}s=i.toUpperCase()
try{globalThis.sessionStorage.setItem(P,s)}catch(e){}return g.a(2,s)
case 10:g.n=12
break
case 11:g.p=11,g.v
case 12:if(g.p=12,null==(l=globalThis.navigator.language||(null===(u=globalThis.navigator.languages)||void 0===u?void 0:u[0]))||!l.includes("-")){g.n=13
break}if(p=l.split("-")[1].toUpperCase(),!/^[A-Z]{2}$/.test(p)){g.n=13
break}try{globalThis.sessionStorage.setItem(P,p)}catch(e){}return g.a(2,p)
case 13:g.n=15
break
case 14:g.p=14,g.v
case 15:return g.a(2,j)}},_callee,null,[[12,14],[7,11],[4,6],[1,3]])}))).apply(this,arguments)}var S=n("KEM+"),E=n.n(S),T=n("0DP7")
function ownKeys(e,t){var o=Object.keys(e)
if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e)
t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),o.push.apply(o,n)}return o}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{}
t%2?ownKeys(Object(o),!0).forEach(function(t){E()(e,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):ownKeys(Object(o)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))})}return e}var x={DIRECT_MATCH:"DIRECT_MATCH",GLOBAL_FALLBACK:"GLOBAL_FALLBACK",UNKNOWN:"UNKNOWN",NONE:"NONE"},C="us_four_fstore_com",k="USD"
var G=n("gFMt"),D="geo_location_popup_dismissed",I=new y.a,B=function useGeoLocationPopup(){var e=Object(r.useState)(null),t=m()(e,2),o=t[0],n=t[1],a=Object(r.useState)(!1),c=m()(a,2),i=c[0],s=c[1],l=Object(h.a)(),p=l.availableStores,g=l.currentStore,f=l.handleSwitchStore,d=Object(_.b)().openStoreSwitcher,y=Object(b.b)(),v=m()(y,2)[1].toggleDrawer,L=Object(O.a)().isMobile,w=Object(u.a)(),P=w.formatDisplayName,j=w.formatMessage,N=Object(r.useState)(function(){return!!I.getItem(D)}),S=m()(N,1)[0],E=Object(r.useMemo)(function(){if(!o)return null
try{var e=P(o,{type:"region"})
return e&&e!==o?e:null}catch(e){return null}},[o,P]),B=Object(r.useMemo)(function(){return function resolveRecommendedStore(e,t,o){if(!e||!t||0===t.size)return{path:x.NONE,recommendedStore:null}
var n=T.a[e]
if(n){if(n===o)return{path:x.NONE,recommendedStore:null}
var r=t.get(n)
if(r)return{path:x.DIRECT_MATCH,recommendedStore:r}}var a=T.b[e]
if(a){var c=a.storeCode,i=a.currency
if(c===o)return{path:x.NONE,recommendedStore:null}
var s=t.get(c)
if(s)return{path:x.GLOBAL_FALLBACK,recommendedStore:_objectSpread(_objectSpread({},s),{},{currency:i||s.currency})}}var u=t.get(C)
return u?C===o?{path:x.NONE,recommendedStore:null}:{path:x.UNKNOWN,recommendedStore:_objectSpread(_objectSpread({},u),{},{currency:k})}:{path:x.NONE,recommendedStore:null}}(o,p,null==g?void 0:g.storeCode)},[o,p,g]),A=B.path,M=B.recommendedStore,F=j(Object(G.a)(null==M?void 0:M.storeCode)),U=Object(r.useCallback)(function(){I.setItem(D,"1",31536e3),s(!1)},[]),K=Object(r.useCallback)(function(){U(),null!=M&&M.storeCode&&f(M.storeCode)},[U,f,M]),z=Object(r.useCallback)(function(){U(),d(),L&&v("nav")},[U,d,v,L]),R=Object(r.useCallback)(function(){I.setItem(D,"1",604800),s(!1)},[])
return Object(r.useEffect)(function(){if(!S){var e=!1
return function detectUserCountry(){return _detectUserCountry.apply(this,arguments)}().then(function(t){!e&&t&&n(t)}),function(){e=!0}}},[S]),Object(r.useEffect)(function(){if(!S&&A!==x.NONE&&M){var e=setTimeout(function(){return s(!0)},1e3)
return function(){return clearTimeout(e)}}},[S,A,M]),{isOpen:i,path:A,recommendedStore:M,countryCode:o,countryDisplayName:E,languageName:F,handleConfirm:K,handleOpenSelector:z,handleDismiss:R}},A=n("vB0K"),M=n.n(A),F=n("8izY"),U={injectType:"singletonStyleTag",insert:"head",singleton:!0},K=(M()(F.a,U),F.a.locals||{}),z=function GeoLocationPopup(e){var t=Object(l.a)(K,e.classes),o=Object(u.a)().formatMessage,n=B(),c=n.isOpen,i=n.path,f=n.recommendedStore,d=n.handleConfirm,m=n.handleOpenSelector,b=n.handleDismiss,h=n.countryDisplayName,y=n.languageName,_=i===x.DIRECT_MATCH,O=Object(r.useMemo)(function(){return h?o({id:"geoLocationPopup.detectedLocation",defaultMessage:"We detected your location: {country}"},{country:h}):null},[h,o]),v=Object(r.useMemo)(function(){return o({id:"geoLocationPopup.secondary",defaultMessage:"Select another country"})},[o]),L=Object(r.useMemo)(function(){return o({id:"geoLocationPopup.closeAria",defaultMessage:"Close"})},[o]),w=Object(r.useMemo)(function(){return o(_?{id:"geoLocationPopup.title",defaultMessage:"A version of the website matching your location is available!"}:{id:"geoLocationPopup.titleGlobal",defaultMessage:"You can switch to the English version of the site for easier browsing and shopping."})},[_,o]),P=Object(r.useMemo)(function(){return _?o({id:"geoLocationPopup.description",defaultMessage:"To shop more conveniently, switch to the appropriate language version of the site"}):null},[_,o]),j=o({id:"geoLocationPopup.changeTo",defaultMessage:"Change to:"})
if(!f||i===x.NONE)return null
if(!c)return null
var N=f.storeCode,S=f.currency,E=Object(G.b)(N)
return a.a.createElement("div",{className:t.root},null,a.a.createElement("div",{className:t.panel},a.a.createElement(g.a,{className:t.closeButton,action:b,"aria-label":L},a.a.createElement(s.l,{className:t.closeIcon})),a.a.createElement("div",{className:t.content},a.a.createElement("div",{className:t.text},!_&&O&&a.a.createElement("span",{className:t.detectedLocation},O),a.a.createElement("strong",{className:t.title},w),_?a.a.createElement("span",{className:t.description},P):null),a.a.createElement("div",{className:t.actions},a.a.createElement(p.a,{priority:"high",onClick:d,className:t.switchButton},a.a.createElement("span",{className:t.switchButtonInner},a.a.createElement("span",{className:t.switchLabel},j),E&&a.a.createElement(E,{className:t.mapIcon}),a.a.createElement("span",{className:t.switchTarget},y,"/",S))),a.a.createElement(p.a,{priority:"normal",onClick:m},v)))))}
z.propTypes={classes:Object(c.shape)({root:c.string,backdrop:c.string,panel:c.string,closeButton:c.string,closeIcon:c.string,content:c.string,text:c.string,detectedLocation:c.string,title:c.string,description:c.string,actions:c.string,switchButton:c.string,switchButtonInner:c.string,switchLabel:c.string,mapIcon:c.string,switchTarget:c.string})}
var R=z}}])

//# sourceMappingURL=89.0104e2db3574b15f8d8a.js.map