!function(){const t={iframe:null,contentContainer:null,fps:10,initElements(t){let{iframe:e}=t;e&&(this.iframe=e,this.contentContainer=e.contentWindow.document.body.querySelector(".content-container"),this.contentContainer&&this.loop())},loop(){this.recalcHeight({iframe:this.iframe,contentContainer:this.contentContainer}),setTimeout((()=>{this.loop()}),1e3/this.fps)},recalcHeight(t){let{iframe:e,contentContainer:n}=t;e.style.height="".concat(n.offsetHeight,"px")}},e={state:{analytics:!1,debug:!1},checkAnalytics(){const t=this.getScript();t.dataset.analytics&&(this.state.analytics=!0),t.dataset.debug&&(this.state.debug=!0)},getScript:()=>document.querySelector("[data-widget-clinic]"),scrollBackToTop(){const t=document.querySelector("#vetowidget");t&&t.scrollIntoView(!0)},handleEvent(t){this.state.debug&&console.log("Handling event",t),this.state.analytics&&window.dataLayer&&window.dataLayer.push&&(console.log("Pushing to datalayer"),dataLayer.push(t))}};!function(){const n=document.currentScript.src;window.addEventListener("load",(()=>{!function(n){let{currentScript:o}=n;const c=document.querySelector("#vetowidget");if(!c)return;const a=e.getScript();let i=a.dataset.primaryColor||"",s=a.dataset.secondaryColor||"";const r=a.dataset.customer||"";let d=parseInt(a.dataset.widgetClinic,10);const l=a.dataset.chv,h=a.dataset.confirmUrl||"";let u=a.dataset.locale||navigator.language||"fr";u=u.split("-")[0].toLowerCase(),["fr","en","es","de","it"].includes(u)||(u="fr");const p=document.createElement("iframe");p.style.border="none",p.style.width="100%",p.style.height="500px",c.appendChild(p);const m=function(){const t=window.location.search.substring(1),e={},n=("?"===t[0]?t.substr(1):t).split("&");for(let t=0;t<n.length;t++){const o=n[t].split("=");e[decodeURIComponent(o[0])]=decodeURIComponent(o[1]||"")}return e}();m.clinic&&(d=m.clinic),m.primaryColor&&(i=m.primaryColor),m.secondaryColor&&(s=m.secondaryColor);const w=document.querySelector('script[src*="widget.monrendezvousveto"][data-widget-clinic]');let g,y="fr";w&&w.src.includes("quebec")&&(y="quebec");const f=a.dataset.mode;if(f)g="prod"===f?"https://www.monrendezvousveto.".concat(y):"https://recette.monrendezvousveto.".concat(y);else if(m.baseURL)g=m.baseURL;else if(o)try{const t=new URL(o).origin;t.includes("widget.monrendezvousveto")||(g=t)}catch(t){}g||(g="https://www.monrendezvousveto.".concat(y)),console.log("current script",g),e.checkAnalytics();const v="\n    <head>\n        <script>\n            (function(h,o,t,j,a,r){\n                h.hj=h.hj||function(){(h.hj.q=h.hj.q||[]).push(arguments)};\n                h._hjSettings={hjid:2072395,hjsv:6};\n                a=o.getElementsByTagName('head')[0];\n                r=o.createElement('script');r.async=1;\n                r.src=t+h._hjSettings.hjid+j+h._hjSettings.hjsv;\n                a.appendChild(r);\n            })(window,document,'https://static.hotjar.com/c/hotjar-','.js?sv=');\n        <\/script>\n    </head>\n    <body class=\"widget-mrdvv\">\n        <div id=\"vetowidget\"></div>\n        <script>\n        window.currentLocale = \"".concat(u,'";\n        window.fallbackLocale = "').concat("fr",'";\n        const globalVars = {\n            clinic: ').concat(d,",\n            url: '").concat(g,"',\n            colors: {\n                primary: '").concat(i,"',\n                secondary: '").concat(s,"'\n            },\n            customer: '").concat(r,"',\n            isCHV: ").concat(!!l,",\n            confirmUrl: '").concat(h,"'\n        };\n        <\/script>\n        ").concat("",'\n        <script src="').concat(g,'/bundles/app/assets/js/new/widget.entry.js"><\/script>\n    </body>\n    ');p.contentWindow.document.open(),p.contentWindow.document.write(v),p.contentWindow.document.close(),p.addEventListener("load",(()=>{t.initElements({iframe:p})}))}({currentScript:n})})),window.addEventListener("message",(t=>{t.data&&t.data.id&&("ar_redirect"===t.data.id&&(window.location=t.data.url),"forgotten_redirect"===t.data.id&&window.open(t.data.url,"blank"),"scroll"===t.data.id&&e.scrollBackToTop(),"event"===t.data.id&&t.data.event&&e.handleEvent(t.data.event))}))}()}();