@heycater/qualification-funnel 1.3.11 → 1.3.12
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/heycater-funnel.iife.js +1 -1
- package/dist/index.cjs.js +41 -41
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +14 -8
- package/dist/index.esm.js.map +1 -1
- package/dist/stats.html +1 -1
- package/package.json +1 -1
|
@@ -1674,4 +1674,4 @@
|
|
|
1674
1674
|
box-sizing: border-box;
|
|
1675
1675
|
}
|
|
1676
1676
|
|
|
1677
|
-
`,pW="trustedshops_ratings",hW=3e5;let mW=null;const gW=KP;function vW(){var e
|
|
1677
|
+
`,pW="trustedshops_ratings",hW=3e5;let mW=null;const gW=KP;function vW(){var e;const t=null==(e=window.location.pathname.split("/")[1])?void 0:e.toLowerCase();if(t&&gW.includes(t))return t}let yW=null;function bW(){const e=m.useMemo(()=>function(){const e="undefined"!=typeof window?window.__HEYCATER_CONFIG__:void 0;return{apiEndpoint:(null==e?void 0:e.graphqlEndpoint)||"https://api.heycater.com/graphql",googleMapsApiKey:(null==e?void 0:e.googleMapsApiKey)||"",locale:vW()||(null==e?void 0:e.locale)||"de",storageKey:"heycater-funnel",onBackground:"light",highlightColor:"primary",mode:(null==e?void 0:e.mode)||"embedded",onCancel:null==e?void 0:e.onCancel}}(),[]),[t,n]=m.useState(e.locale),[r,o]=m.useState(null);m.useEffect(()=>(yW=n,()=>{yW=null}),[]),m.useEffect(()=>{const e=new MutationObserver(e=>{var t;for(const r of e)if("lang"===r.attributeName){const e=null==(t=document.documentElement.lang)?void 0:t.toLowerCase();e&&gW.includes(e)&&n(e)}});return e.observe(document.documentElement,{attributes:!0,attributeFilter:["lang"]}),()=>e.disconnect()},[]),m.useEffect(()=>{const e=()=>{const e=(()=>{var e;const t=null==(e=window.location.pathname.split("/")[1])?void 0:e.toLowerCase();return t&&gW.includes(t)?t:void 0})();e&&n(e)};window.addEventListener("popstate",e);const t=history.pushState.bind(history),r=history.replaceState.bind(history);return history.pushState=(...n)=>{t(...n),e()},history.replaceState=(...t)=>{r(...t),e()},()=>{window.removeEventListener("popstate",e),history.pushState=t,history.replaceState=r}},[]),m.useEffect(()=>{var n;(n={graphqlEndpoint:e.apiEndpoint,googleMapsApiKey:e.googleMapsApiKey,locale:t})&&(aE={...rE,...n}),"undefined"!=typeof window&&window.__HEYCATER_CONFIG__&&(aE={...aE,...window.__HEYCATER_CONFIG__})},[t,e.apiEndpoint,e.googleMapsApiKey]),m.useEffect(()=>{(async()=>{if(mW&&Date.now()-mW.timestamp<hW)return mW.data;if("undefined"!=typeof window)try{const e=sessionStorage.getItem(pW);if(e){const t=JSON.parse(e);if(t.timestamp&&Date.now()-t.timestamp<hW)return mW=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(mW=e,"undefined"!=typeof window)try{sessionStorage.setItem(pW,JSON.stringify(e))}catch{}}return t})().then(o).catch(console.error)},[]);const i=((e={})=>{const t=e.locale||"de",n=e.locales||KP;return YS.isInitialized?Object.entries(AV).forEach(([e,t])=>{Object.entries(t).forEach(([t,n])=>{YS.addResourceBundle(e,t,n,!0,!1)})}):YS.use(vd).init({lng:t,supportedLngs:n,preload:KP,fallbackLng:IV,resources:AV,interpolation:{escapeValue:!1},initImmediate:!1,react:{useSuspense:!1}}),YS.language!==t&&YS.changeLanguage(t),YS})({locale:t}),a=m.useMemo(()=>{return t=e.apiEndpoint,new Xh({url:t,exchanges:[Yh,Qh({onError:uW}),cW,Gh],fetch:dW});var t},[e.apiEndpoint]);return x.jsx(rm,{value:a,children:x.jsx(Ed,{i18n:i,children:x.jsx(JS,{locale:t,children:x.jsx(Jf,{theme:lW,children:x.jsx(pa,{theme:lW,children:x.jsxs(Bi,{injectFirst:!0,children:[x.jsx(Zs,{}),x.jsx(fW,{}),x.jsx(xO,{initialized:!0,storageKey:e.storageKey,storage:"sessionStorage",children:x.jsx(UV,{onBackground:e.onBackground,highlightColor:e.highlightColor,ratings:r,mode:e.mode,onCancel:e.onCancel})})]})})})})})})}function wW(){document.querySelectorAll("[data-heycater-funnel]").forEach(e=>{W.render(x.jsx(bW,{}),e)})}"loading"===document.readyState?document.addEventListener("DOMContentLoaded",wW):wW(),window.HeycaterFunnel={mount:function(e){const t="string"==typeof e?document.querySelector(e):e;t&&W.render(x.jsx(bW,{}),t)},setLocale:function(e){yW&&yW(e)}};const xW=Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})),CW=Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"}))}();
|