"use strict";(self.webpackChunkapi_notification_com=self.webpackChunkapi_notification_com||[]).push([[524],{4028:(e,n,t)=>{t(6280),t(6918),t(3792),t(4743),t(1745),t(8309),t(739),t(3110),t(9085),t(6099),t(3362),t(7495),t(2781),t(5440),t(1489),t(8140),t(1630),t(2170),t(5044),t(1920),t(1694),t(9955),t(1903),t(1134),t(3206),t(4496),t(6651),t(2887),t(9369),t(6812),t(8995),t(1575),t(6072),t(8747),t(8845),t(9423),t(7301),t(373),t(6614),t(1405),t(3684),t(3250),t(149),t(4082),t(2945),t(5815),t(4979),t(9739),t(4692);t(9336),t(5336),t(1414),t(102),document.addEventListener("launchServiceWorker",(function(){var e=apiKey;console.log(event);var n=event.detail.url,t=event.detail.isTest;console.log(e),console.log(n);if(event.detail.valid){if(console.log("Validité confirmée, script exécuté."),"undefined"==typeof defaultInvitation||defaultInvitation?t?navigator.serviceWorker.ready.then((function(e){return e.pushManager.getSubscription()})).then((function(e){e||a()})):a():Swal.fire({title,text:description,icon,showCancelButton,confirmButtonText,cancelButtonText}).then((function(e){e.isConfirmed?a():(o("computing"),navigator.serviceWorker.ready.then((function(e){return e.pushManager.getSubscription()})).then((function(e){if(e)return e;o("disabled")})).then((function(e){return e.unsubscribe()})).then((function(){return o("disabled")})).catch((function(e){console.error("Error when unsubscribing the user",e),o("disabled")})),console.log("L'utilisateur a refusé l'invitation."))})),!("serviceWorker"in navigator))return console.warn("Service workers are not supported by this browser"),void o("incompatible");if(!("PushManager"in window))return console.warn("Push notifications are not supported by this browser"),void o("incompatible");if(!("showNotification"in ServiceWorkerRegistration.prototype))return console.warn("Notifications are not supported by this browser"),void o("incompatible");if("denied"===Notification.permission)return console.warn("Notifications are denied by the user"),void o("incompatible");console.log(Notification.permission);var i=new CustomEvent("ExecuteServiceWorker",{detail:{valid:!0,url:n}});document.dispatchEvent(i)}function o(e){var n=document.querySelector("#push-subscription-button");if(n)switch(e){case"enabled":n.disabled=!1,n.textContent="Disable Push notifications";break;case"disabled":n.disabled=!1,n.textContent="Enable Push notifications";break;case"computing":n.disabled=!0,n.textContent="Loading...";break;case"incompatible":n.disabled=!0,n.textContent="Push notifications are not compatible with this browser";break;default:console.error("Unhandled push button state",e)}}function r(e){for(var n=(e+"=".repeat((4-e.length%4)%4)).replace(/\-/g,"+").replace(/_/g,"/"),t=window.atob(n),i=new Uint8Array(t.length),o=0;o{e.O(0,[130],(()=>{return n=4028,e(e.s=n);var n}));e.O()}]);