document.addEventListener("DOMContentLoaded",(()=>{const n=document.bubbleSettings;n.custom_css="#coco-body { z-index:1000 !important; } #notification-bubble { z-index:1000 !important; } #chat-widget-container { z-index:1000 !important; } #chat-widget-header{ z-index:1000 !important; transform: none !important; overflow: visible !important; }",n.phone_number="33979601799";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 d={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((()=>{d.cocoBody.style.display="block"}),n.delay),d.cartDrawer){new MutationObserver((n=>{n.forEach((n=>{if("class"===n.attributeName){const n=d.cartDrawer.classList.contains("active");d.cocoBody.style.display=n?"none":"block"}}))})).observe(d.cartDrawer,{attributes:!0})}function c(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",d.chatMessages.appendChild(t),setTimeout((()=>{d.chatMessages.removeChild(t),function(){const t=document.createElement("div");t.textContent=n.whatsapp_message_inside,t.className="welcome-message",d.chatMessages.appendChild(t)}()}),2e3)}function l(t=!1){"block"===d.chatWidget.style.display?function(t=!1){d.chatWidget.style.display="none",d.notificationBubble.style.display="flex",localStorage.removeItem("notificationBubbleHidden"),d.chatMessages.innerHTML="",m(),n.show_notification_bubble||(d.notificationBubble.style.display="none");t&&localStorage.setItem("keepClosed","true")}(t):(d.chatWidget.style.display="block",function(n=!1){d.notificationBubble.style.display="none",n&&localStorage.setItem("notificationBubbleHidden","true")}(),r(),u&&(clearInterval(u),d.notificationText.textContent=n.whatsapp_message,u=null))}const p=window.location.href,g=n.path_filter,b=!g||function(n,t){try{return new RegExp(t).test(n)}catch(n){return console.error("Invalid regex pattern:",t),!1}}(p,g);d.notificationText.addEventListener("click",(()=>l())),d.headerChatBox.addEventListener("click",(()=>l())),d.closeAllMessages.addEventListener("click",(()=>{n.show_notification_bubble=!1,localStorage.setItem("notificationBubbleHidden","true"),d.notificationBubble.style.display="none"})),d.sendMessageButton.addEventListener("click",(()=>{const n=d.messageInput.value.trim();n&&(c(n),d.messageInput.value="")})),d.messageInput.addEventListener("keypress",(n=>{"Enter"===n.key&&(n.preventDefault(),d.sendMessageButton.click())})),n.hide_coco_mention&&d.poweredBy&&(d.poweredBy.style.display="none"),n.show_notification_bubble||(d.notificationBubble.style.display="none"),d.chatWidgetContent.addEventListener("click",(n=>{if("BUTTON"===n.target.tagName){c(n.target.getAttribute("data-message"))}})),d.whatsappIcon.addEventListener("click",(()=>l()));let u=null;function m(){if(u)return;let t=1;const e=[n.whatsapp_message,n.button_one,n.button_two,n.button_three];u=setInterval((()=>{d.notificationText.textContent=e[t],t=(t+1)%e.length}),3500)}m(),b||(d.cocoBody.style.display="none",d.whatsappIcon.style.display="none",d.messageNotification&&(d.messageNotification.style.display="none"),d.notificationBubble.style.display="none")}));