1/*! For license information please see foodCostCalculator-components-MetricToggle.chunk.e5c393e0f500d74f8c22.js.LICENSE.txt */ 2"use strict";(globalThis.webpackChunklightspeed_marketing=globalThis.webpackChunklightspeed_marketing||[]).push([[2829,4853,7229,8126],{81658(e,t,o){o.r(t),o.d(t,{MetricToggle:()=>r});var c=o(96540),n=o(70283);const r=({name:e="default",toggleLabel:t="Enable Metric system",heading:o=null})=>{const{isMetric:r,setMetric:a,geoLocation:i}=(0,n.useAppState)();return(0,c.useEffect)(()=>{"US"===i.country_code&&a(!1)},[i,a]),c.createElement("div",{className:"toggle-switch toggle toggle-".concat(e)},o&&c.createElement("p",null,o),c.createElement("div",{id:"toggle-switch",className:"toggle-switch gb-flex gb-flex--center-vertical gb-flex--center-horizontal","data-toggle-switch":"container"},c.createElement("label",{className:"toggle-switch__switch"},c.createElement("input",{className:"toggle-switch__switch__input",type:"checkbox",role:"switch","aria-checked":r,checked:r,onChange:()=>a(!r)}),c.createElement("span",{className:"toggle-switch__switch__container gb-flex gb-flex--center-vertical"},c.createElement("span",{className:"toggle-switch__switch__label toggle-switch__label-on","aria-label":t},t),c.createElement("span",{className:"toggle-switch__switch__button"})))))}},70283(e,t,o){o.r(t),o.d(t,{AppProvider:()=>s,useAppState:()=>l});var c=o(96540),n=o(18987),r=o(55731),a=o(56923);const i=(0,c.createContext)({}),s=({children:e,lexiconData:t})=>{const[o,s]=(0,c.useState)(""),[l,g]=(0,r.useLocalStorage)("kfcc_email",""),{isToggled:u,setToggle:d,toggle:h}=(0,a.useToggle)(!0),[p,m]=(0,c.useState)(!1),[f,_]=(0,c.useState)({country:"",country_code:""});(0,c.useEffect)(()=>{const e=window.location.hostname,t=e.includes("local");if(s("https://"+e),m(t),t)_({country:"Australia",country_code:"AU"});else try{_(JSON.parse(n.A.get("geoConfig")||"{}"))}catch(e){_({country:"",country_code:""})}},[]);const{settings_global:w,header:b,signup_section:v,calculator_section:y,margin_section:C,summary_section:x,error_section:E}=t||{};return c.createElement(i.Provider,{value:{email:l,setEmail:g,isMetric:u,setMetric:d,toggleMetric:h,lexiconData:t,globalData:w,headerData:b,signupData:v,calculatorData:y,marginData:C,summaryData:x,errorData:E,domain:o,isDevEnv:p,geoLocation:f}},e)},l=()=>(0,c.useContext)(i)},55731(e,t,o){o.r(t),o.d(t,{useLocalStorage:()=>n});var c=o(96540);function n(e,t){const[o,n]=(0,c.useState)(t);return(0,c.useEffect)(()=>{try{const t=window.localStorage.getItem(e);t&&n(JSON.parse(t))}catch(e){console.error(e)}},[e]),[o,(0,c.useCallback)(t=>{try{n(o=>{const c=t instanceof Function?t(o):t;return window.localStorage.setItem(e,JSON.stringify(c)),c})}catch(e){console.error(e)}},[e])]}},56923(e,t,o){o.r(t),o.d(t,{useToggle:()=>n});var c=o(96540);const n=e=>{const[t,o]=(0,c.useState)(e);return{isToggled:t,setToggle:o,toggle:()=>o(e=>!e)}}},18987(e,t,o){function c(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var c in o)e[c]=o[c]}return e}o.d(t,{A:()=>n});var n=function e(t,o){function n(e,n,r){if("undefined"!=typeof document){"number"==typeof(r=c({},o,r)).expires&&(r.expires=new Date(Date.now()+864e5*r.expires)),r.expires&&(r.expires=r.expires.toUTCString()),e=encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var a="";for(var i in r)r[i]&&(a+="; "+i,!0!==r[i]&&(a+="="+r[i].split(";")[0]));return document.cookie=e+"="+t.write(n,e)+a}}return Object.create({set:n,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var o=document.cookie?document.cookie.split("; "):[],c={},n=0;n<o.length;n++){var r=o[n].split("="),a=r.slice(1).join("=");try{var i=decodeURIComponent(r[0]);if(c[i]=t.read(a,i),e===i)break}catch(e){}}return e?c[e]:c}},remove:function(e,t){n(e,"",c({},t,{expires:-1}))},withAttributes:function(t){return e(this.converter,c({},this.attributes,t))},withConverter:function(t){return e(c({},this.converter,t),this.attributes)}},{attributes:{value:Object.freeze(o)},converter:{value:Object.freeze(t)}})}({read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decode
2URIComponent)}},{path:"/"})}}]); 3//# sourceMappingURL=foodCostCalculator-components-MetricToggle.chunk.e5c393e0f500d74f8c22.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.