PageSourceSearch

https://www.sgkb.ch/.mod/static/Confinity.CookieConsent/dist/CCent.js?v4

js sgkb.ch collected 2026-10-02 07:33:38 UTC 7,250 bytes, 1 lines download raw bytes

1(()=>{"use strict";var e,t=function(e,t,n,o){return new(n||(n=Promise))((function(i,s){function r(e){try{a(o.next(e))}catch(e){s(e)}}function c(e){try{a(o.throw(e))}catch(e){s(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,c)}a((o=o.apply(e,t||[])).next())}))},n=function(e,t){var n,o,i,s,r={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function c(c){return function(a){return function(c){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,c[0]&&(r=0)),r;)try{if(n=1,o&&(i=2&c[0]?o.return:c[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,c[1])).done)return i;switch(o=0,i&&(c=[2&c[0],i.value]),c[0]){case 0:case 1:i=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,o=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(!((i=(i=r.trys).length>0&&i[i.length-1])||6!==c[0]&&2!==c[0])){r=0;continue}if(3===c[0]&&(!i||c[1]>i[0]&&c[1]<i[3])){r.label=c[1];break}if(6===c[0]&&r.label<i[1]){r.label=i[1],i=c;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(c);break}i[2]&&r.ops.pop(),r.trys.pop();continue}c=t.call(e,r)}catch(e){c=[6,e],o=0}finally{n=i=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([c,a])}}},o=function(){function e(e){this.apiEndpoint=e}return e.prototype.saveConsentSettings=function(e){return this.apiEndpoint?fetch(this.apiEndpoint,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}).then((function(e){return e.json()})):(console.error("Unknown consent api endpoint",this.apiEndpoint),Promise.reject())},e.prototype.deleteCookie=function(e){return t(this,void 0,void 0,(function(){var t,o,i;return n(this,(function(n){switch(n.label){case 0:if(t=window.cookieStore,o=this.getCookieDeletionDomains(),!t)return[3,4];n.label=1;case 1:return n.trys.push([1,3,,4]),[4,this.deleteCookieWithCookieStore(t,e,o)];case 2:return n.sent(),console.debug("Cookie ".concat(e," deleted successfully")),[2];case 3:return i=n.sent(),console.error("Failed to delete cookie: ".concat(i)),[2,Promise.reject()];case 4:return this.deleteCookieWithDocumentCookie(e,o),[2]}}))}))},e.prototype.getCookieDeletionDomains=function(){return window.location.hostname.split(".").map((function(e,t,n){return n.slice(t).join(".")})).filter((function(e){return e.includes(".")}))},e.prototype.deleteCookieWithCookieStore=function(e,o,i){return t(this,void 0,void 0,(function(){var t,s,r;return n(this,(function(n){switch(n.label){case 0:return[4,e.delete(o)];case 1:n.sent(),t=0,s=i,n.label=2;case 2:return t<s.length?(r=s[t],[4,e.delete({name:o,domain:r,path:"/"})]):[3,5];case 3:n.sent(),n.label=4;case 4:return t++,[3,2];case 5:return[2]}}
1))}))},e.prototype.deleteCookieWithDocumentCookie=function(e,t){document.cookie="".concat(e,"=; Path=/; Expires=Thu, 01 Jan 1970 00:00:01 GMT;");for(var n=0,o=t;n<o.length;n++){var i=o[n];document.cookie="".concat(e,"=; Domain=").concat(i,"; Path=/; Expires=Thu, 01 Jan 1970 00:00:01 GMT;")}},e}(),i=function(){function e(e,t){var n=this;this.checkboxesOnly=!1,this.consentBannerElement=t,this.settings=e,this.consentApi=new o(e.apiEndpoint);var i=e.apiEndpoint;if(window.__cfyCookieConsentApi||(window.__cfyCookieConsentApi=new o(i)),this.consentBannerElement){var s=this.consentBannerElement.querySelector("[data-cfy-consent-accept-button]");this.checkboxesOnly=this.consentBannerElement.hasAttribute("data-cfy-consent-checkboxes-only"),s&&s.addEventListener("click",(function(e){return n.onSaveButtonClicked(e)})),this.checkboxesOnly&&this.getConsentCheckboxes().forEach((function(e){e.addEventListener("change",(function(e){return n.onCheckboxChanged(e)}))}))}this.deleteCookies()}return e.prototype.onCheckboxChanged=function(e){var t=this.getCheckboxState(e.target);t.category&&(this.settings.consents[t.category]=t.active),this.saveConsent().then((function(){var t;null===(t=e.target)||void 0===t||t.dispatchEvent(new CustomEvent("Confinity.CookieConsent.CategoryChangeSaved"))})).catch((function(){var t;null===(t=e.target)||void 0===t||t.dispatchEvent(new CustomEvent("Confinity.CookieConsent.CategoryChangeSaveError"))}))},e.prototype.onSaveButtonClicked=function(e){var t=this;e.preventDefault(),this.getConsentCheckboxes().forEach((function(e){var n=t.getCheckboxState(e);n.category&&(t.settings.consents[n.category]=n.active)})),this.saveConsent()},e.prototype.createEmptySettingsObject=function(){return{consents:{}}},e.prototype.getCheckboxState=function(e){return{active:e.checked,category:e.dataset.cfyConsentCategory}},e.prototype.saveConsent=function(){var e=this;try{for(var t in this.settings.consents)this.settings.consents[t]&&window.dispatchEvent(new CustomEvent("_cfy_consent_"+t))}catch(e){console.warn("unable to set consent "+this.settings)}return this.deleteCookies(),this.consentApi.saveConsentSettings(this.settings).then((function(t){return e.checkboxesOnly||e.closeBanner(),window.dispatchEvent(new CustomEvent("Confinity.CookieConsent.Change",{detail:t})),t}))},e.prototype.getConsentCheckboxes=function(){var e;return null===(e=this.consentBannerElement)||void 0===e?void 0:e.querySelectorAll('input[type="checkbox"][data-cfy-consent-category]')},e.prototype.closeBanner=function(){var e;null===(e=this.consentBannerElement)||void 0===e||e.remove()},e.prototype.deleteCookies=function(){if(this.settings.deleteCookiesOnFrontend){for(var e=document.cookie.split(";").filter((function(e){return""!==e.trim()})),t=[],n=0,o=e;n<o.length;n++){var i=(a=o[n]).indexOf("="),s=i>-1?a.slice(0,i).trim():a.trim();this.shouldDeleteCookie(s)&&t.push(s)}console.debug("Cookies to delete:",t);for(var r=0,c=t;r<c.length;r++){var a=c[r];this.consentApi.deleteCookie(a)}}else console.debug("Cookies deletion on frontend disabled")},e.prototype.shouldDeleteCookie=function(e){var t,n,o,i,s,r,c,a;if(this.isCookieOfCategory(e,null!==(n=null===(t=this.settings.cookies)||void 0===t?void 0:t.essential)&&void 0!==n?n:[]))return!1;var u=this.settings.consents.analytics,l=this.settings.consents.marketing,h=this.settings.consents.personalisation;return this.isCookieOfCategory(e,null!==(i=null===(o=this.settings.cookies)||void 0===o?void 0:o.analytics)&&void 0!==i?i:[])?!u:this.isCookieOfCategory(e,null!==(r=null===(s=this.settings.cookies)||void 0===s?void 0:s.marketing)&&void 0!==r?r:[])?!l:this.isCookieOfCategory(e,null!==(a=null===(c=this.settings.cookies)||void 0===c?void 0:c.personalisation)&&void 0!==a?a:[])?!h:this.settings.deleteUnknownCookies||!1},e.prototype.isCookieOfCategory=function(e,t){for(var n=e.toLowerCase(),o=0,i=t;o<i.length;o++){var s=i[o].toLowerCase();if(s.includes("*")){var r=s.replace(/\*/g,"(.*?)");if(new RegExp(r).test(n))return!0}else if(s===n)return!0}return!1},e}();e=function(){var e=function(){var e=window.__cfyCookieConsentSettings;if(!e)throw new Error("Cookie consent settings not found");return e}();console.debug("Cookie consent settings:",e),document.querySelectorAll("[data-cfy-consent-banner]").forEach((function(t){return new i(e,t)}))},"interactive"===document.readyState?e():document.addEventListener("DOMContentLoaded",e)})();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.