'use strict';if(window.dotclear===undefined)window.dotclear={};if(!dotclear?.util_loaded){Object.assign(dotclear,{DOMready(fn){document.addEventListener('DOMContentLoaded',()=>{fn();});},ready(fn){if(document.readyState!=='complete'){window.addEventListener('load',fn);}else{fn();}},getData(id,clear=true,remove=true){let data={};const element=document.getElementById(`${id}-data`);if(element){try{data=JSON.parse(element.textContent);if(clear&&remove){element.remove();}else if(clear){element.innerHTML='';}}catch(e){}}
return data;},isObject(item){return item&&typeof item==='object'&&!Array.isArray(item);},isEmptyObject(item){return this.isObject(item)&&Object.keys(item).length===0;},mergeDeep(target,...sources){if(!sources.length)return target;const source=sources.shift();if(this.isObject(target)&&this.isObject(source)){for(const key in source){if(this.isObject(source[key])){if(!target[key])
Object.assign(target,{[key]:{},});this.mergeDeep(target[key],source[key]);}else{Object.assign(target,{[key]:source[key],});}}}
return this.mergeDeep(target,...sources);},getCookie(name){const matches=document.cookie.match(new RegExp(`(?:^|; )${name.replace(/([.$?*|{}()[\]\\/+^])/g, '\\$1')}=([^;]*)`));return matches?decodeURIComponent(matches[1]):false;},setCookie(name,value,options={}){if(typeof options.expires==='number'){options.expires=new Date(Date.now()+options.expires*864e5);}
if(options.expires instanceof Date){options.expires=options.expires.toUTCString();}
let updatedCookie=`${encodeURIComponent(name)}=${encodeURIComponent(value)}`;for(const optionKey in options){updatedCookie+=`; ${optionKey}`;const optionValue=options[optionKey];if(optionValue!==true){updatedCookie+=`=${optionValue}`;}}
if(options.sameSite===undefined){updatedCookie+='; sameSite=Lax';}
document.cookie=updatedCookie;},deleteCookie(name){this.setCookie(name,'',{expires:-1,});},});dotclear.util_loaded=true;}