@heycater/qualification-funnel 1.3.2 → 1.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs.js CHANGED
@@ -1574,5 +1574,5 @@ object-assign
1574
1574
  display: none;
1575
1575
  }
1576
1576
 
1577
- `,hE="trustedshops_ratings",gE=3e5;let mE=null;exports.QualificationFunnel=function({apiEndpoint:e="https://api.heycater.com/graphql",googleMapsApiKey:s="",locale:u="de",storageKey:c="heycater-funnel",onBackground:d="light",highlightColor:f="primary",mode:p="embedded",onCancel:h}){const[g,m]=n.useState(null),[y,v]=n.useState(!1);if(n.useEffect(()=>{var t;(t={graphqlEndpoint:e,googleMapsApiKey:s,locale:u})&&(mu={...pu,...t}),"undefined"!=typeof window&&window.__HEYCATER_CONFIG__&&(mu={...mu,...window.__HEYCATER_CONFIG__}),v(!0)},[e,s,u]),n.useEffect(()=>{y&&(async()=>{if(mE&&Date.now()-mE.timestamp<gE)return mE.data;if("undefined"!=typeof window)try{const e=sessionStorage.getItem(hE);if(e){const t=JSON.parse(e);if(t.timestamp&&Date.now()-t.timestamp<gE)return mE=t,t.data}}catch{}const e=await fetch("https://integrations.etrusted.com/feeds/grades/v1/channels/chl-735bd2eb-de5a-4bf6-8510-55080217cff2/touchpoints/all/feed.json",{headers:{"Content-Type":"application/json"},method:"GET"}),t=(await e.json()).grades;if(t){const e={data:t,timestamp:Date.now()};if(mE=e,"undefined"!=typeof window)try{sessionStorage.setItem(hE,JSON.stringify(e))}catch{}}return t})().then(m).catch(console.error)},[y]),!y)return null;const b=((e={})=>{const t=e.locale||"de",n=e.locales||pg;return l.isInitialized||l.use(i.initReactI18next).init({lng:t,supportedLngs:n,preload:pg,fallbackLng:N_,resources:R_,interpolation:{escapeValue:!1},initImmediate:!1,react:{useSuspense:!1}}),l.language!==t&&l.changeLanguage(t),l})({locale:u}),C=(x=e,new a.Client({url:x,exchanges:[a.cacheExchange,a.mapExchange({onError:cE}),dE,a.fetchExchange],fetch:fE}));var x;return t.jsx(a.Provider,{value:C,children:t.jsx(i.I18nextProvider,{i18n:b,children:t.jsx(lu,{locale:u,children:t.jsx(o.ThemeProvider,{theme:uE,children:t.jsx(r.ThemeProvider,{theme:uE,children:t.jsxs(r.StylesProvider,{injectFirst:!0,children:[t.jsx(r.CssBaseline,{}),t.jsx(pE,{}),t.jsx(bf,{initialized:!0,storageKey:c,storage:"sessionStorage",children:t.jsx(V_,{onBackground:d,highlightColor:f,ratings:g,mode:p,onCancel:h})})]})})})})})})};
1577
+ `,hE="trustedshops_ratings",gE=3e5;let mE=null;exports.QualificationFunnel=function({apiEndpoint:e="https://api.heycater.com/graphql",googleMapsApiKey:s="",locale:u="de",storageKey:c="heycater-funnel",onBackground:d="light",highlightColor:f="primary",mode:p="embedded",onCancel:h}){const[g,m]=n.useState(null),[y,v]=n.useState(!1);if(n.useEffect(()=>{var t;(t={graphqlEndpoint:e,googleMapsApiKey:s,locale:u})&&(mu={...pu,...t}),"undefined"!=typeof window&&window.__HEYCATER_CONFIG__&&(mu={...mu,...window.__HEYCATER_CONFIG__}),v(!0)},[e,s,u]),n.useEffect(()=>{y&&(async()=>{if(mE&&Date.now()-mE.timestamp<gE)return mE.data;if("undefined"!=typeof window)try{const e=sessionStorage.getItem(hE);if(e){const t=JSON.parse(e);if(t.timestamp&&Date.now()-t.timestamp<gE)return mE=t,t.data}}catch{}const e=await fetch("https://integrations.etrusted.com/feeds/grades/v1/channels/chl-735bd2eb-de5a-4bf6-8510-55080217cff2/touchpoints/all/feed.json",{headers:{"Content-Type":"application/json"},method:"GET"}),t=(await e.json()).grades;if(t){const e={data:t,timestamp:Date.now()};if(mE=e,"undefined"!=typeof window)try{sessionStorage.setItem(hE,JSON.stringify(e))}catch{}}return t})().then(m).catch(console.error)},[y]),!y)return null;const b=((e={})=>{const t=e.locale||"de",n=e.locales||pg;return l.isInitialized?Object.entries(R_).forEach(([e,t])=>{Object.entries(t).forEach(([t,n])=>{l.hasResourceBundle(e,t)||l.addResourceBundle(e,t,n)})}):l.use(i.initReactI18next).init({lng:t,supportedLngs:n,preload:pg,fallbackLng:N_,resources:R_,interpolation:{escapeValue:!1},initImmediate:!1,react:{useSuspense:!1}}),l.language!==t&&l.changeLanguage(t),l})({locale:u}),C=(x=e,new a.Client({url:x,exchanges:[a.cacheExchange,a.mapExchange({onError:cE}),dE,a.fetchExchange],fetch:fE}));var x;return t.jsx(a.Provider,{value:C,children:t.jsx(i.I18nextProvider,{i18n:b,children:t.jsx(lu,{locale:u,children:t.jsx(o.ThemeProvider,{theme:uE,children:t.jsx(r.ThemeProvider,{theme:uE,children:t.jsxs(r.StylesProvider,{injectFirst:!0,children:[t.jsx(r.CssBaseline,{}),t.jsx(pE,{}),t.jsx(bf,{initialized:!0,storageKey:c,storage:"sessionStorage",children:t.jsx(V_,{onBackground:d,highlightColor:f,ratings:g,mode:p,onCancel:h})})]})})})})})})};
1578
1578
  //# sourceMappingURL=index.cjs.js.map