document.addEventListener("DOMContentLoaded",(()=>{const n=document.bubbleSettings;n.path_filter="^https:\\/\\/www\\.atome3d\\.com\\/pages\\/a-propos-de-nous$",n.custom_css="#whatsapp-icon img { opacity: 1; background-color: transparent !important; }",n.phone_number="33788096893";let t="";n.show_mobile_only&&(t+="\n @media (min-width: 768px) {\n #OJIAJ978617_coco-body {\n display: none !important;\n }\n }\n ");const e="full-coco-left"===n.tooltip_position?"left: 15px; right: auto;":"right: 15px; left: auto;",o=n.custom_css||"",i=n.disable_breathe?"":"animation: breathe 2s infinite ease-in-out;";let a=document.getElementById("OJIAJ978617_coco-body");a||(a=document.createElement("div"),a.id="OJIAJ978617_coco-body",document.body.appendChild(a));const s=`\n \n\n
\n ${n.whatsapp_message}\n ×\n
\n
\n WhatsApp\n
1
\n
\n\n
\n
\n
\n
\n Profile\n ${n.shop_name}\n
\n
\n ${n.status}\n
\n
\n
×
\n
\n
\n
\n \n \n \n
\n \n \n
\n
\n `;if(a.innerHTML=s,t){const n=document.createElement("style");n.type="text/css",n.innerText=t,document.head.appendChild(n)}const c={cocoBody:a,chatWidget:document.getElementById("OJIAJ978617_chat-widget-container"),whatsappIcon:document.getElementById("OJIAJ978617_whatsapp-icon"),notificationBubble:document.getElementById("OJIAJ978617_notification-bubble"),closeChat:document.getElementById("OJIAJ978617_chat-widget-close"),sendMessageButton:document.getElementById("OJIAJ978617_chat-widget-send"),messageInput:document.querySelector("#OJIAJ978617_chat-widget-footer input"),chatMessages:document.getElementById("OJIAJ978617_chat-messages"),closeAllMessages:document.getElementById("OJIAJ978617_notification-bubble-close"),notificationText:document.getElementById("OJIAJ978617_notification-bubble-text"),headerChatBox:document.getElementById("OJIAJ978617_chat-widget-header"),cartDrawer:document.querySelector(".drawer.is-empty"),poweredBy:document.getElementById("OJIAJ978617_powered-by"),messageNotification:document.getElementById("OJIAJ978617_message-notification"),chatWidgetContent:document.getElementById("OJIAJ978617_chat-widget-content")};if(setTimeout((()=>{c.cocoBody.style.display="block"}),n.delay),c.cartDrawer){new MutationObserver((n=>{n.forEach((n=>{if("class"===n.attributeName){const n=c.cartDrawer.classList.contains("active");c.cocoBody.style.display=n?"none":"block"}}))})).observe(c.cartDrawer,{attributes:!0})}function d(t){let e=n.phone_number;n.is_relayed&&(t=`@[${n.relaying_slug_name}]\n${t}`,e=n.relaying_phone_number);const o=`https://api.whatsapp.com/send/?phone=${e}&text=${encodeURIComponent(t)}`;window.open(o,"_blank")}function r(){const t=document.createElement("div");t.textContent="...",t.className="typing-indicator",c.chatMessages.appendChild(t),setTimeout((()=>{c.chatMessages.removeChild(t),function(){const t=document.createElement("div");t.textContent=n.whatsapp_message_inside,t.className="welcome-message",c.chatMessages.appendChild(t)}()}),2e3)}function l(t=!1){"block"===c.chatWidget.style.display?function(t=!1){c.chatWidget.style.display="none",c.notificationBubble.style.display="flex",localStorage.removeItem("notificationBubbleHidden"),c.chatMessages.innerHTML="",m(),n.show_notification_bubble||(c.notificationBubble.style.display="none");t&&localStorage.setItem("keepClosed","true")}(t):(c.chatWidget.style.display="block",function(n=!1){c.notificationBubble.style.display="none",n&&localStorage.setItem("notificationBubbleHidden","true")}(),r(),b&&(clearInterval(b),c.notificationText.textContent=n.whatsapp_message,b=null))}const p=window.location.href,g=n.path_filter,u=!g||function(n,t){try{return new RegExp(t).test(n)}catch(n){return console.error("Invalid regex pattern:",t),!1}}(p,g);c.notificationText.addEventListener("click",(()=>l())),c.headerChatBox.addEventListener("click",(()=>l())),c.closeAllMessages.addEventListener("click",(()=>{n.show_notification_bubble=!1,localStorage.setItem("notificationBubbleHidden","true"),c.notificationBubble.style.display="none"})),c.sendMessageButton.addEventListener("click",(()=>{const n=c.messageInput.value.trim();n&&(d(n),c.messageInput.value="")})),c.messageInput.addEventListener("keypress",(n=>{"Enter"===n.key&&(n.preventDefault(),c.sendMessageButton.click())})),n.hide_coco_mention&&c.poweredBy&&(c.poweredBy.style.display="none"),n.show_notification_bubble||(c.notificationBubble.style.display="none"),c.chatWidgetContent.addEventListener("click",(n=>{if("BUTTON"===n.target.tagName){d(n.target.getAttribute("data-message"))}})),c.whatsappIcon.addEventListener("click",(()=>l()));let b=null;function m(){if(b)return;let t=1;const e=[n.whatsapp_message,n.button_one,n.button_two,n.button_three];b=setInterval((()=>{c.notificationText.textContent=e[t],t=(t+1)%e.length}),3500)}m(),u||(c.cocoBody.style.display="none",c.whatsappIcon.style.display="none",c.messageNotification&&(c.messageNotification.style.display="none"),c.notificationBubble.style.display="none")}));