/**
 * Minified by jsDelivr using Terser v5.37.0.
 * Original file: /npm/shuutils@10.6.0/dist/shuutils.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
async function sleep(e=1e3){return new Promise((n=>{setTimeout((()=>{n(e)}),e)}))}function hasOwn(e,n){return Object.hasOwn(e,n)}function functionReturningVoid(){}function functionReturningUndefined(){}function toastHide(e,n=200){e.style.opacity="0",e.style.transform="translateX(300px)",setTimeout((()=>{e.remove()}),n)}function toastShow(e,n=100){document.body.append(e),setTimeout((()=>{e.style.opacity="1",e.style.transform="translateX(0)"}),n)}function toastStyle(e){return"success"===e?{backgrounds:["MediumSeaGreen","SeaGreen"],icon:"&check;",iconStyle:"line-height: 21px; text-indent: 1px;"}:"error"===e?{backgrounds:["FireBrick","Brown"],icon:"x",iconStyle:"line-height: 21.5px;"}:{backgrounds:["DodgerBlue","RoyalBlue"],icon:"i",iconStyle:"line-height: 21px;"}}function toastAdd(e,n="",t=0,r=14){const o=document.createElement("div");o.setAttribute("class","shu-toast");const i=document.querySelector(".shu-toast:nth-last-child(1 of .shu-toast)")?.getBoundingClientRect().top,a=void 0===i?0:globalThis.innerHeight-i,{backgrounds:s,icon:c,iconStyle:u}=toastStyle(e);o.style=`position: fixed; display: flex; align-items: center; gap: 9px; bottom: ${a+r}px; right: ${r}px; z-index: 99999; padding: 12px 20px 11px 14px; background: linear-gradient(45deg, ${s[0]}, 20%, ${s[1]}); color: white; border-radius: 5px; box-shadow: 0 3px 7px 0 rgba(0,0,0,.5); font-size: 18px; opacity: 0; transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out; transform: translateX(300px);`,o.innerHTML=`<span style="${u}border-radius: 50%; color: ${s[1]}; background-color: #ffffff90; width: 20px; height: 20px; text-align: center; font-weight: bolder; font-size: 12px;">${c}</span><span style="margin-top: -1px;">${n}</span>`,console["error"===e?"error":"log"](`toast ${e} : ${n}`),toastShow(o),t>0&&setTimeout((()=>{toastHide(o)}),t)}function toastError(e,n=4e3){toastAdd("error",e,n)}function toastInfo(e,n=2e3){toastAdd("info",e,n)}function toastSuccess(e,n=2e3){toastAdd("success",e,n)}function isFirefox(){return void 0!==globalThis.navigator&&globalThis.navigator.userAgent.includes("Firefox")}function addColorCode(e,n,t){return isFirefox()?t:`[${e}m${t}[${n}m`}function reset(e){return addColorCode(0,0,e)}function bold(e){return addColorCode(1,22,e)}function dim(e){return addColorCode(2,22,e)}function italic(e){return addColorCode(3,23,e)}function underline(e){return addColorCode(4,24,e)}function overline(e){return addColorCode(53,55,e)}function inverse(e){return addColorCode(7,27,e)}function strikeThrough(e){return addColorCode(9,29,e)}function black(e){return addColorCode(30,39,e)}function red(e){return addColorCode(31,39,e)}function green(e){return addColorCode(32,39,e)}function yellow(e){return addColorCode(33,39,e)}function blue(e){return addColorCode(34,39,e)}function magenta(e){return addColorCode(35,39,e)}function cyan(e){return addColorCode(36,39,e)}function white(e){return addColorCode(37,39,e)}function gray(e){return addColorCode(90,39,e)}function bgBlack(e){return addColorCode(40,49,e)}function bgRed(e){return addColorCode(41,49,e)}function bgGreen(e){return addColorCode(42,49,e)}function bgYellow(e){return addColorCode(43,49,e)}function bgBlue(e){return addColorCode(44,49,e)}function bgMagenta(e){return addColorCode(45,49,e)}function bgCyan(e){return addColorCode(46,49,e)}function bgWhite(e){return addColorCode(47,49,e)}function bgGray(e){return addColorCode(100,49,e)}var nbMsInSecond=1e3,nbSecondsInMinute=60,nbSecondsInHour=3600,nbMsInMinute=6e4,nbMinutesInHour=60,nbMsInHour=36e5,nbHoursInDay=24,nbMsInDay=864e5,nbDaysInWeek=7,nbMsInWeek=6048e5,nbDaysInMonth=30,nbMsInMonth=2592e6,nbDaysInYear=365,nbMsInYear=31536e6,nbAfter=1,nbAscending=1,nbBackward=-1,nbBefore=-1,nbDescending=-1,nbEven=2,nbFirst=0,nbForward=1,nbLast=-1,nbNext=1,nbNoIndex=-1,nbNone=0,nbOdd=1,nbPrevious=-1,nbSecond=1,nbThird=2,nbFourth=3,nbFifth=4,nbSixth=5,nbSeventh=6,nbOneSixth=.16,nbOneQuarter=.25,nbOneThird=.33,nbOneHalf=.5,nbTwoThirds=.66,nbThreeQuarters=.75,nbFiveSixths=.83,nbShortHex=4,nbLongHex=7,nbRgbMin=0,nbRgbMax=255,nbSaturationMax=100,nbLightnessMax=100,nbHslMin=0,nbHueStep=60,nbHueMax=360,nbSpacesIndent=2,nbPercentMin=0,nbPercentMax=100,nbPixelXs=320,nbPixelSm=640,nbPixelMd=768,nbPixelLg=1024,nbPixelXl=1280,nbPixel2Xl=1536;function dateToIsoString(e,n=!1){let t=new Date(e.getTime()-e.getTimezoneOffset()*nbMsInMinute).toISOString();return n&&t.toLowerCase().endsWith("z")&&(t=t.slice(0,Math.max(0,t.length-1))),t}function dateIso10(e=new Date){return String(e.toISOString().split("T")[0])}function formatDate(e,n,t="en-US"){return n.replace(/y{4}|yy|M{4}|MM|dd|d|e{4}|e{3}|HH|mm|ss|\s/gu,(n=>"yyyy"===n?e.toLocaleDateString(t,{year:"numeric"}):"yy"===n?e.toLocaleDateString(t,{year:"2-digit"}):"MMMM"===n?e.toLocaleDateString(t,{month:"long"}):"MM"===n?e.toLocaleDateString(t,{month:"2-digit"}):"dd"===n?e.toLocaleDateString(t,{day:"2-digit"}):"d"===n?e.toLocaleDateString(t,{day:"numeric"}):"eeee"===n?e.toLocaleDateString(t,{weekday:"long"}):"eee"===n?e.toLocaleDateString(t,{weekday:"short"}):"HH"===n?e.getHours().toString().padStart(n.length,"0"):"mm"===n?e.getMinutes().toString().padStart(n.length,"0"):"ss"===n?e.getSeconds().toString().padStart(n.length,"0"):n))}function readableTime(e,n=!0){const t="number"==typeof e?e:Date.now()-e.getTime(),r=(e,t,r)=>`${Math.floor(e)}${n?" "+(t+(Math.floor(e)>1?"s":"")):r}`;return t<nbMsInSecond?r(t,"millisecond","ms"):t<nbMsInMinute?r(t/nbMsInSecond,"second","s"):t<nbMsInHour?r(t/nbMsInMinute,"minute","min"):t<nbMsInDay?r(t/nbMsInHour,"hour","h"):t<nbMsInMonth?r(t/nbMsInDay,"day","d"):t<nbMsInYear?r(t/nbMsInMonth,"month","mon"):r(t/nbMsInYear,"year","y")}function isTestEnvironment(){if(["jest","mocha","__vitest_environment__","__vitest_required__"].some((e=>e in globalThis)))return!0;return"Bun"in globalThis&&globalThis.Bun.argv.join(" ").includes(".test.")}function isBrowserEnvironment(){return!globalThis.navigator.userAgent.includes("HappyDOM")&&("undefined"!=typeof document&&void 0!==globalThis.matchMedia)}function hasOption(e){return"undefined"!=typeof process&&((process.argv??[]).includes(`--${e}`)||"true"===(process.env?.[e]??"").toString())}function isVerbose(){return hasOption("v")||hasOption("verbose")||hasOption("VERBOSE")||hasOption("debug")||hasOption("DEBUG")}function clean(...e){return e.map((e=>"object"==typeof e?JSON.stringify(e):String(e))).join(" ").replace(/[\u001B\u009B][#();?[]*(?:\d{1,4}(?:;\d{0,4})*)?[\d<=>A-ORZcf-nqry]/gu,"").replace(/"/gu,"'")}var Logger=class{#e=0;#n=["1-debug","2-test","3-info","4-fix","5-warn","6-good","7-error"];#t;#r=7;clean=clean;inMemoryLogs=[];options={isActive:!0,minimumLevel:isVerbose()?"1-debug":"3-info",willLogDate:!1,willLogDelay:!0,willLogTime:!1,willOutputToConsole:!0,willOutputToMemory:!1};constructor(e){e&&(this.options={...this.options,...e}),this.#t=Math.max(...this.#n.map((e=>e.length-2)))}__getDelay(){const e=Date.now();if(0===this.#e)return this.#e=e,gray("init".padStart(this.#r));const n=e-this.#e;return this.#e=e,gray(`+${readableTime(n,!1)}`.padStart(this.#r))}__log(e,n){const t=[e];this.options.willLogTime&&t.unshift(formatDate(new Date,"HH:mm:ss")),this.options.willLogDate&&t.unshift(formatDate(new Date,"yyyy-MM-dd")),this.options.willLogDelay&&t.unshift(this.__getDelay()),this.options.willOutputToConsole&&console.log(t.join(" "),...n),this.options.willOutputToMemory&&this.addToMemoryLogs(...t,...n)}__logIf(e,n,t,r){this.__shouldLog(n)&&this.__log(r(e.padStart(this.#t)),t)}__shouldLog(e){return this.options.isActive&&this.#n.indexOf(e)>=this.#n.indexOf(this.options.minimumLevel)}addToMemoryLogs(...e){this.inMemoryLogs.push(clean(...e))}debug(...e){this.__logIf("debug","1-debug",e,gray)}disable(){this.options.isActive=!1}enable(){this.options.isActive=!0}error(...e){const n=e.map((e=>e instanceof Error?e.message:e));this.__logIf("error","7-error",n,red)}fix(...e){this.__logIf("fix","4-fix",e,cyan)}good(...e){this.__logIf("good","6-good",e,green)}info(...e){this.__logIf("info","3-info",e,blue)}showError(...e){this.error(...e),isBrowserEnvironment()&&toastError(clean(...e))}showInfo(...e){this.info(...e),isBrowserEnvironment()&&toastInfo(clean(...e))}showSuccess(...e){this.success(...e),isBrowserEnvironment()&&toastSuccess(clean(...e))}success(...e){this.good(...e)}test(e,...n){if(!this.__shouldLog("2-test"))return;const t=Boolean(e)?bgGreen(" ✓ "):bgRed(" ✗ "),r=" ".repeat(this.#t-3);this.__log(r+t,n)}warn(...e){this.__logIf("warn","5-warn",e,yellow)}},Analytics=class{$app="";$instance=void 0;$logger=new Logger;pile=[];identify(e,n){if(void 0===this.$instance)throw new Error("analytics : identify failed, analytics not setup");this.$logger.info(`analytics : identify user "${e}" on app "${this.$app}"`),this.$instance.identify(e,n)}page(){if(void 0===this.$instance)throw new Error("analytics : track page failed, analytics not setup");this.$logger.debug(`analytics : track page for app "${this.$app}"`),this.$instance.page()}setupInMemory(e){this.$app=e;const n=async(n,t)=>{this.$logger.debug(`analytics : add "${n}" to pile`,t),await sleep(1),this.pile.push(n),this.$logger.debug(`analytics : pile for app "${e}"`,this.pile)};this.$instance={identify:async(e,t)=>{await n(`identify:${e}`,t)},page:async()=>{await n("page")},track:async(e,t)=>{await n(`track:${e}`,t)}},this.$logger.info(`analytics : setup app "${e}" with in memory tracking`)}track(e,n){if(void 0===this.$instance)throw new Error("analytics : track event failed, analytics not setup");this.$logger.debug(`analytics : track event "${e}" for app "${this.$app}"`),this.$instance.track(e,n)}};function arraySort(e,n){const t=[];for(let r of e)null!=r&&(Array.isArray(r)?r=arraySort(r,n):"object"==typeof r&&(r=objectSort(r,n))),t.push(r);return t}function objectSort(e,n){const t={},r=Object.keys(e).sort(n);for(const o of r){let r=e[o];null!=r&&(Array.isArray(r)?r=arraySort(r,n):"object"==typeof r&&(r=objectSort(r,n))),t[o]=r}return t}function replacer(e,n){return void 0===n?{__strUndefined__:!0}:n instanceof RegExp?{__strRegexFlags__:n.flags,__strRegexSource__:n.source}:"function"==typeof n?{__strFunction__:n.toString()}:this[e]instanceof Date?{__strDate__:this[e].toISOString()}:n}function reviver(e,n){return null==n||"object"!=typeof n?n:"__strRegexFlags__"in n&&"__strRegexSource__"in n?new RegExp(n.__strRegexSource__,n.__strRegexFlags__):"__strFunction__"in n?new Function(`return ${n.__strFunction__}`)():"__strDate__"in n?new Date(n.__strDate__):"__strUndefined__"in n?void 0:n}function objectSerialize(e,n=!1){return JSON.stringify(n?objectSort(e):e,replacer)}function objectDeserialize(e){return JSON.parse(e,reviver)}function clone(e){try{return structuredClone(e)}catch{return objectDeserialize(objectSerialize(e))}}function insertValueAfterItem(e,n,t){const r=e.indexOf(n);if(r===nbNoIndex)return e;const o=clone(e),i=Math.min(r+nbAfter,o.length);return o.splice(i,0,t),o}function pickOne(e){if(0===e.length)throw new Error("Array is empty");return e[Math.floor(Math.random()*e.length)]}function removeValueFromArray(e,n){if(!e.includes(n))return e;const t=clone(e);return t.splice(t.indexOf(n),1),t}function shuffleArray(e){const n=clone(e);for(let e=n.length-1;e>0;e+=nbPrevious){const t=Math.floor(Math.random()*(e+1)),r=n[e];n[e]=n[t],n[t]=r}return n}function arrayUnique(e){return Array.from(new Set(e))}function flatten(e,n="",t="."){return Object.keys(e).reduce(((r,o)=>{const i=e[o],a=Array.isArray(e)?`${n}[${o}]`:[n,o].filter(Boolean).join(t);return["object"==typeof i,null!==i,!(i instanceof Date),!(i instanceof RegExp),!(Array.isArray(i)&&0===i.length)].every(Boolean)?{...r,...flatten(i,a,t)}:{...r,[a]:i}}),{})}function removeAccents(e){return e.normalize("NFD").replace(/[\u0300-\u036F]/gu,"")}function sanitize(e,n=!0){const t=removeAccents(e).trim().replace(/<[^>]+>/gu," ").replace(/[/'’-]/gu," ").replace(/[^\d\sa-z]/giu,"").replace(/\s+/gu," ").trim();return n?t.toLowerCase():t}function slugify(e){return sanitize(e).replace(/\W+/giu,"-").replace(/^-+/u,"").replace(/-+$/u,"")}function fillTemplate(e,n){let t="object"==typeof e?JSON.stringify(e,void 0,nbSpacesIndent):e;if(void 0===n)return t;if(0===t.length)return t;const r=flatten(n);for(const[e,n]of Object.entries(r)){const r=new RegExp(`(/?\\*?{{?\\s*${e}\\s*}?}\\*?/?)`,"g");t=t.replace(r,String(n))}return t}function capitalize(e,n=!1){return n?e.charAt(0).toUpperCase()+e.slice(1).toLowerCase():e.charAt(0).toUpperCase()+e.slice(1)}function ellipsisWords(e="",n=5){const t=e.split(" ").splice(0,n).join(" ");return t===e?e:`${t}...`}function ellipsis(e="",n=50){const t=e.slice(0,n);return t===e?e:`${t}...`}var jsonStartRegex=/^(?:\[\s*)?\{\s*"/u;function isJson(e){if(!jsonStartRegex.test(e))return!1;try{JSON.parse(e)}catch{return!1}return!0}function createCrc32Table(e=256){const n=Array.from({length:e});for(let t=0;t<e;t+=1){let e=t;for(let n=0;n<8;n+=1)e=1&e?3988292384^e>>>1:e>>>1;n[t]=e}return n}function crc32(e){const n=createCrc32Table();let t=-1;for(let r=0;r<e.length;r+=1){const o=n[255&((e.codePointAt(r)??0)^t)];void 0!==o&&0!==o&&(t=o^t>>>8)}return~t>>>0}function stringSum(e){return crc32(e)}function isString(e){return"string"==typeof e}var base64Regex=/^(?:data:)?[\w/]+;base64,[\w+/=]+$/u;function isBase64(e){return base64Regex.test(e)}var base64TypeRegex=/[^:]\w+\/[\w+.-]+(?=;|,)/u;function parseBase64(e){const n={base64:"",size:0,type:""};if(!isBase64(e))return n;const t=base64TypeRegex.exec(e);t&&"string"==typeof t[0]&&([n.type]=t);const r=e.split("base64,");return r.length>1&&"string"==typeof r[1]&&([,n.base64]=r),n.size=Math.round(3*n.base64.length/4),n}function parseJson(e){let n="",t={};if(""!==e)try{t=objectDeserialize(e)}catch(e){n=`JSON invalide : ${e.message}`}return{error:n,value:t}}function isHtml(e){return/<[^>]+>/u.test(e)}function injectMark(e,n,t){return e.replace(new RegExp(`__${n}__`,"gu"),t).replace(new RegExp(`{{1,2}${n}}{1,2}`,"g"),t).replace(new RegExp(`(<[a-z]+ .*id="${n}"[^>]*>)[^<]*(</[a-z]+>)`,"u"),`$1${t}$2`).replace(new RegExp(`(<meta name="${n}" content=")[^"]*(")`,"u"),`$1${t}$2`)}async function copyToClipboard(e,n=!1){const t="string"==typeof e?e:JSON.stringify(e);n&&console.log(`copying to clipboard : ${ellipsis(t)}`),await navigator.clipboard.writeText(t)}async function readClipboard(e=!1){e&&console.log("reading clipboard...");const n=await navigator.clipboard.readText();return e&&console.log(`got this text from clipboard : ${ellipsis(n)}`),n}function randomString(){return pickOne("Bar Alto,Sin Seguritat,Lorem Ipsum,Ciao,Sit dolor,Por erestet,Tchu la Comida,Amet Inn,Aqualeris baked,Bouquet,Zu Amarillo,Ploject,Ruhe animals,Mah Plizure,Baacon pasty,Vinci mador,Alan Awake,Malohe Sutur,A priore sur,Quel memento,Kalitat arae".split(","))}function randomBoolean(){return Math.random()>.5}function randomEmail(e,n){const t=pickOne(["gmail.com","yahoo.de","hotmail.fr","outlook.com","protonmail.com"]);return`${randomBoolean()?e[0]?.toLocaleLowerCase():e.toLocaleLowerCase()}.${n.toLocaleLowerCase()}@${t}`}function randomNumber(e=0,n=100){return Math.floor(Math.random()*(n-e+1)+e)}function randomPerson(){const e=pickOne(["Michael","Dwight","Jim","Pam","Ryan","Andy","Kevin","Angela","Oscar","Toby"]),n=pickOne(["Scott","Schrute","Halpert","Beesly","Howard","Bernard","Malone","Martin","Martinez","Flenderson"]);return{age:randomNumber(18,65),email:randomEmail(e,n),firstName:e,income:randomNumber(1e3,1e4),lastName:n}}async function fillLikeHuman(e,n){e.focus();for(const t of n)e.value+=t,await sleep(randomNumber(40,80));e.dispatchEvent(new Event("input",{bubbles:!0})),e.dispatchEvent(new Event("change",{bubbles:!0})),e.dispatchEvent(new Event("blur",{bubbles:!0})),e.blur()}function injectStyles(e=""){0!==e.length?e.includes("://")&&!e.includes("\n")&&e.includes(".css")?document.querySelector("head")?.insertAdjacentHTML("beforeend",`<link rel="stylesheet" href="${e}" />`):document.body.insertAdjacentHTML("beforeend",`<style>${e}</style>`):console.log("injectStyles : cannot inject empty styles")}function onPageChangeDefaultCallback(e){console.log(`location changed : ${e} but onPageChange callback is empty`)}async function onPageChange(e=onPageChangeDefaultCallback,n=1e3,t=""){await sleep(n);const r=document.location.href;r!==t&&e(r),onPageChange(e,n,r)}function removeExtraSlashes(e){return e.replace(/\/{2,}/gu,"/")}function getPath(e="",n=""){let t=""===e&&isBrowserEnvironment()?document.location.pathname:e;return"blank"===t&&(t=""),t=removeExtraSlashes(t),t=t.replace(/^\/[a-z]{2}\//u,"/"),""!==n&&(t=`/${n}/${t}`),removeExtraSlashes(t)}function getPage(e=""){const n=getPath(e).slice(1);return""===n?"index":n.split(".")[0]??""}var browsers={Edge:/edge/iu,Chrome:/chrome|chromium|crios/iu,Firefox:/firefox|fxios/iu,"Internet Explorer":/msie|trident/iu,Safari:/safari/iu,"Unknown browser":/./u},operatingSystems={Android:/android/iu,"Chrome OS":/CrOS/iu,iOS:/iphone/iu,Linux:/linux/iu,"Mac OS":/MacIntel|Macintosh|MacPPC/iu,Windows:/Win32|Win64|Windows/iu,"Unknown OS":/./u},versions={MSIE:/MSIE (?<version>[\d.]+)/iu,Edge:/Edge\/(?<version>[\d.]+)/iu,Chrome:/Chrome\/(?<version>[\d.]+)/iu,Firefox:/Firefox\/(?<version>[\d.]+)/iu,generic:/Version\/(?<version>[\d.]+)/iu,rv:/rv:(?<version>[\d.]+)/iu};function getUserAgent(){return isBrowserEnvironment()?globalThis.navigator.userAgent:"Unknown user agent"}function getVersion(e=getUserAgent()){for(const[n,t]of Object.entries(versions))if(t.test(e))return t.exec(e)?.groups?.version??`Unknown ${n} version`;return"Unknown version"}function getBrowser(e=getUserAgent()){for(const[n,t]of Object.entries(browsers))if(t.test(e))return n;return"Unknown browser"}function getOperatingSystem(e=getUserAgent()){for(const[n,t]of Object.entries(operatingSystems))if(t.test(e))return n;return"Unknown OS"}function isMobile(e=getUserAgent()){if(e.includes("Mobile"))return!0;const n=getBrowser(e);return["Android"].includes(n)}function browserReport(e){return`\n - Browser : ${e.browser} ${e.version}\n - Language : ${e.language}\n - OS : ${e.os}\n - Platform : ${e.platform}\n - Is mobile : ${String(e.isMobile)}\n - Screen : ${e.screenWidth}x${e.screenHeight}\n - Url : ${e.url}\n - User agent : ${e.userAgent}\n `}function browserContext(){const e=isBrowserEnvironment(),n=getUserAgent(),t=getBrowser(n);return{browser:t,isInternetExplorer:"Internet Explorer"===t,isMobile:isMobile(n),language:e?globalThis.navigator.language:"Unknown language",os:getOperatingSystem(n),platform:e?globalThis.navigator.userAgentData?.platform??"Unknown platform":"Unknown platform",screenHeight:e?globalThis.screen.height:0,screenWidth:e?globalThis.screen.width:0,url:e?globalThis.location.href:"Unknown url",userAgent:n,version:getVersion(n)}}function cn(...e){return e.filter(Boolean).join(" ")}function hexToRgb(e){if(e.length===nbShortHex)return{colorBlue:Number(`0x${e[nbFourth]}${e[nbFourth]}`),colorGreen:Number(`0x${e[nbThird]}${e[nbThird]}`),colorRed:Number(`0x${e[nbSecond]}${e[nbSecond]}`)};if(e.length===nbLongHex)return{colorBlue:Number(`0x${e[nbSixth]}${e[nbSeventh]}`),colorGreen:Number(`0x${e[nbFourth]}${e[nbFifth]}`),colorRed:Number(`0x${e[nbSecond]}${e[nbThird]}`)};throw new Error(`Invalid HEX color provided : ${e}, should have a length of ${nbShortHex} or ${nbLongHex} instead of : ${e.length}`)}function hexToHsl(e){let{colorBlue:n,colorGreen:t,colorRed:r}=hexToRgb(e);r/=nbRgbMax,t/=nbRgbMax,n/=nbRgbMax;const o=Math.min(r,t,n),i=Math.max(r,t,n),a=i-o;let s=nbHslMin,c=nbHslMin,u=nbHslMin;return s=0===a?nbHslMin:i===r?(t-n)/a%nbSeventh:i===t?(n-r)/a+nbThird:(r-t)/a+nbFifth,s=Math.round(s*nbHueStep),s<0&&(s+=nbHueMax),u=(i+o)/nbThird,c=0===a?0:a/(1-Math.abs(nbThird*u-1)),c=Math.round(c*nbSaturationMax),u=Math.round(u*nbLightnessMax),{hue:s,lightness:u,saturation:c}}var timeAgoTuples=[[nbMsInMinute,nbMsInSecond,"second"],[nbMsInHour,nbMsInMinute,"minute"],[nbMsInDay,nbMsInHour,"hour"],[nbMsInWeek,nbMsInDay,"day"],[nbMsInMonth,nbMsInWeek,"week"],[nbMsInYear,nbMsInMonth,"month"]];function readableTimeAgo(e,n="en"){const t=new Intl.RelativeTimeFormat(n,{numeric:"auto"}),r="number"==typeof e?e:Date.now()-e.getTime();for(const[e,n,o]of timeAgoTuples)if(r<e)return t.format(-Math.floor(r/n),o);return t.format(-Math.floor(r/nbMsInYear),"year")}function daysAgo(e=0){const n=new Date;return n.setDate(n.getDate()-e),n}function daysFromNow(e=0){return daysAgo(-e)}function daysAgoIso10(e=0){return dateIso10(daysAgo(e))}var debounce=(e,n)=>{let t;return async(...r)=>new Promise((o=>{clearTimeout(t),t=setTimeout((()=>{o(e(...r))}),n)}))};function dom(e,n="",t=""){const r=document.createElement(e);if(r.className=n,"string"==typeof t)r.innerHTML=t;else if(t instanceof Node)r.append(t);else for(const e of t)r.append(e);return r}function img(e,n,t){const r=dom("img",e);return r.alt=t,r.src=n,r}function icon(e=""){return dom("i",`icon ${e}`)}function link(e,n,t,r=!1){const o=dom("a",e,n);return o.href=t,r&&(o.target="_blank"),o}function text(e,n=""){return dom("p",e,n)}function strong(e,n=""){return dom("strong",e,n)}function em(e,n=""){return dom("em",e,n)}function small(e,n=""){return dom("small",e,n)}function h1(e,n=""){return dom("h1",e,n)}function h2(e,n=""){return dom("h2",e,n)}function h3(e,n=""){return dom("h3",e,n)}function ul(e,n=""){return dom("ul",e,n)}function li(e,n=""){return dom("li",e,n)}function div(e,n=""){return dom("div",e,n)}function css(e){const n=dom("link");return n.href=e,n.rel="stylesheet",n.type="text/css",n}function findOne(e,n=document){return n.querySelector(e)}function findAll(e,n=document){return Array.from(n.querySelectorAll(e))}async function waitToDetect(e,n=500,t=0,r=5,o=!1){await sleep(n);const i=findOne(e);return i||(t>r?void(o&&console.log(`stop searching after 5 fails to detect : "${e}"`)):waitToDetect(e,n,t+1,r))}async function scrollToHeightSync(e){const n=e.style.height;e.style.height="inherit";const t=e.scrollHeight+2;e.style.height=n,await sleep(10),e.style.height=`${t}px`}function backdrop(e){return div(`backdrop ${e} fixed top-0 left-0 z-10 w-full h-full opacity-0 pointer-events-none`)}function tw(e){return"string"==typeof e?e:e.join(" ")}function emit(e,n,t=globalThis){void 0===n?t.dispatchEvent(new CustomEvent(e)):t.dispatchEvent(new CustomEvent(e,{detail:n}))}function on(e,n,t=globalThis){function r(e){return n(e instanceof CustomEvent?e.detail:e,e)}return t.addEventListener(e,r,{passive:!0}),{callback:r,media:t,name:e}}function off({callback:e,media:n,name:t}){n.removeEventListener(t,e)}function expectType(e){return e}function expectEqualTypes(e,n){return{thingA:e,thingB:n}}function memoize(e){if("function"!=typeof e)throw new Error("memoize callback parameter should be a function");const n={};function t(...t){const r=JSON.stringify(t);return r in n||(n[r]=e(...t)),n[r]}return t.cache=n,t}function round(e,n=2){return Math.round(e*10**n)/10**n}function rangedScore({isHigherBetter:e,scoreMax:n,scoreMin:t,valueMax:r,valueMin:o},i){const a=(t-n)/(o-r),s=i*a+(n-r*a);if(s<t)return e?t:n;if(s>n)return e?n:t;return round(e?s:n-s,n-t>10?0:2)}function capNesting(e,n=3){return function e(t,r){if(r>n)return"...";if("object"!=typeof t||null===t)return t;const o=Array.isArray(t)?[]:{};for(const n in t)Object.hasOwn(t,n)&&(o[n]=e(t[n],r+1));return o}(e,1)}function objectEqual(e,n,t=!1){return objectSerialize(e,t)===objectSerialize(n,t)}function access(e,n){return flatten(e)[n]}function byProperty(e,n=""){if(""===n)return()=>0;const t="asc"===n?nbAscending:nbDescending;return(n,r)=>{const o=n[e],i=r[e];if(!o&&i)return t;if(o&&!i)return-t;if(o===i)return 0;return(o<i?nbDescending:nbAscending)*t}}function isRecord(e){return null!==e&&("object"==typeof e||"function"==typeof e)&&!Array.isArray(e)}function objectSum(e,n=!1){return stringSum(objectSerialize(e,n))}function genClassObjectKeys(e,n,t){const r=0===n.length?Object.keys(e):clone(n);for(const n of r){const r=e[n];"boolean"==typeof r&&r?t.push(n):"string"==typeof r&&r.length>0?t.push(`${n}-${r}`):Array.isArray(r)&&r.length>0&&t.push(`has-${n}`)}}function genClass(e,n=[],t=[]){const r=clone(t);return null==e?r.unshift(""):"object"!=typeof e?r.unshift(...String(e).split(" ")):Array.isArray(e)?r.unshift(...e.filter(Boolean).join(" ").split(" ")):genClassObjectKeys(e,n,r),arrayUnique(r.map(String)).join(" ").trim().replace(/\s+/gu," ")}function safeAssign(e,...n){if(0===n.length)return e;const t=n.shift();if(isRecord(e)&&isRecord(t))for(const n in t)isRecord(t[n])?(e[n]||Object.assign(e,{[n]:{}}),safeAssign(e[n],t[n])):null!==t[n]&&void 0!==t[n]&&Object.assign(e,{[n]:t[n]});return safeAssign(e,...n)}var Ok=class{value;ok=!0;constructor(e){this.value=e}},Err=class{error;ok=!1;constructor(e){this.error=e}};function ok(e){return new Ok(e)}function err(e){return new Err(e)}function trySafe(e){if(e instanceof Promise)return e.then(ok).catch(err);try{return ok(e())}catch(e){return err(e)}}function unwrap(e){return e.ok?{value:e.value,error:void 0}:{value:void 0,error:e.error}}var Result={error:err,ok:ok,trySafe:trySafe,unwrap:unwrap};function createState(e,n,t=[]){const r=e=>void 0!==n&&(0===t.length||t.includes(e)),o={},i=new Proxy(e,{get(e,t){const o=Reflect.get(e,t);return r(t)?n?.get(t.toString(),o):o},set(e,t,i){Reflect.set(e,t,i),r(t)&&n?.set(t.toString(),i);const a=o[t]??[];for(const e of a)e(t.toString(),i);return!0}});return{state:i,watchState:function(e,n){const t=Object.keys(i),r=Array.isArray(e)?e:[e],a="*"===e?t:r;for(const e of a){const t=o[e];void 0===t?o[e]=[n]:t.push(n)}}}}function get(e,n){const t=storage.prefix+e,r=storage.media[t];if(null==r||""===r)return n;const{error:o,value:i}=parseJson(r);return o?r:i}function set(e,n){const t=storage.prefix+e,r="string"==typeof n?n:JSON.stringify(n);return Reflect.set(storage.media,t,r),n}function has(e){return void 0!==get(e)}function clear(e){const n=storage.prefix+e;delete storage.media[n]}var storage={clear:clear,get:get,has:has,media:"undefined"==typeof localStorage?{}:localStorage,prefix:"",set:set};function kebabToPascalCase(e,n=""){return e.split("-").map((e=>e.charAt(0).toUpperCase()+e.slice(1))).join(n)}function toUnixPath(e){return e.replace(/\\+/giu,"/")}function alignForSnap(e){return("string"==typeof e?e:JSON.stringify(e,void 0,2)).replace(/\d{2}\/\d{2}\/\d{4} \d{2}:\d{2}:\d{2}/gu,"xx/xx/xxxx xx:xx:xx").replace(/\d{1,2}\/\d{1,2}\/\d{4}, \d{1,2}:\d{2}:\d{2} [ap]m/giu,"xx/xx/xxxx xx:xx:xx").replace(/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z/gu,"xxxx-xx-xxTxx:xx:xx.000Z").replace(/\\+(?<letter>[^"])/gu,"/$<letter>")}function throttle(e,n){let t=!0;return(...r)=>{t&&(t=!1,e(...r),setTimeout((()=>{t=!0}),n))}}function getTimestamp(e=new Date){return Math.round(e.getTime()/1e3)}function getTimestampMs(e=new Date){return e.getTime()}var handledLangs=["en","fr"],langRegex=/^\/(en|fr)\//u,defaultLang="en";function getLangFromPath(e){return"fr"===(langRegex.exec(e)?.[1]??defaultLang)?"fr":defaultLang}function handlePlural(e,n){if(!e.includes("|"))return fillTemplate(e,n);const t=Number.parseInt(String(n?.count??"1"),10),[r="",o="",i=""]=e.split(" | ");return i.length>0&&t>1?fillTemplate(i,n):i.length>0&&1===t||o.length>0&&t>1?fillTemplate(o,n):fillTemplate(r,n)}function translate(e,n,t){const r="string"==typeof n?n:n[e];return void 0===r?`missing translation for message "${JSON.stringify(n)}" and lang "${e}"`:handlePlural(r,t)}function localePath(e,n=defaultLang){if(!handledLangs.includes(n))throw new Error(`unsupported lang "${n}", cannot translate path "${e}"`);return getPath(e,n===defaultLang?"":n)}function getTranslator(e){return(n,t)=>translate(e,n,t)}export{Analytics,Logger,Result,access,addColorCode,alignForSnap,arraySort,arrayUnique,backdrop,base64Regex,base64TypeRegex,bgBlack,bgBlue,bgCyan,bgGray,bgGreen,bgMagenta,bgRed,bgWhite,bgYellow,black,blue,bold,browserContext,browserReport,byProperty,capNesting,capitalize,clone,cn,copyToClipboard,crc32,createCrc32Table,createState,css,cyan,dateIso10,dateToIsoString,daysAgo,daysAgoIso10,daysFromNow,debounce,dim,div,dom,ellipsis,ellipsisWords,em,emit,err,expectEqualTypes,expectType,fillLikeHuman,fillTemplate,findAll,findOne,flatten,formatDate,functionReturningUndefined,functionReturningVoid,genClass,getBrowser,getLangFromPath,getOperatingSystem,getPage,getPath,getTimestamp,getTimestampMs,getTranslator,getUserAgent,getVersion,gray,green,h1,h2,h3,handlePlural,hasOption,hasOwn,hexToHsl,hexToRgb,icon,img,injectMark,injectStyles,insertValueAfterItem,inverse,isBase64,isBrowserEnvironment,isFirefox,isHtml,isJson,isMobile,isRecord,isString,isTestEnvironment,isVerbose,italic,jsonStartRegex,kebabToPascalCase,li,link,localePath,magenta,memoize,nbAfter,nbAscending,nbBackward,nbBefore,nbDaysInMonth,nbDaysInWeek,nbDaysInYear,nbDescending,nbEven,nbFifth,nbFirst,nbFiveSixths,nbForward,nbFourth,nbHoursInDay,nbHslMin,nbHueMax,nbHueStep,nbLast,nbLightnessMax,nbLongHex,nbMinutesInHour,nbMsInDay,nbMsInHour,nbMsInMinute,nbMsInMonth,nbMsInSecond,nbMsInWeek,nbMsInYear,nbNext,nbNoIndex,nbNone,nbOdd,nbOneHalf,nbOneQuarter,nbOneSixth,nbOneThird,nbPercentMax,nbPercentMin,nbPixel2Xl,nbPixelLg,nbPixelMd,nbPixelSm,nbPixelXl,nbPixelXs,nbPrevious,nbRgbMax,nbRgbMin,nbSaturationMax,nbSecond,nbSecondsInHour,nbSecondsInMinute,nbSeventh,nbShortHex,nbSixth,nbSpacesIndent,nbThird,nbThreeQuarters,nbTwoThirds,objectDeserialize,objectEqual,objectSerialize,objectSort,objectSum,off,ok,on,onPageChange,overline,parseBase64,parseJson,pickOne,randomBoolean,randomEmail,randomNumber,randomPerson,randomString,rangedScore,readClipboard,readableTime,readableTimeAgo,red,removeAccents,removeValueFromArray,reset,round,safeAssign,sanitize,scrollToHeightSync,shuffleArray,sleep,slugify,small,storage,strikeThrough,stringSum,strong,text,throttle,toUnixPath,toastError,toastInfo,toastSuccess,translate,trySafe,tw,ul,underline,unwrap,waitToDetect,white,yellow};
//# sourceMappingURL=/sm/406a94aa556fb056c0e4e347fe98b111f203daec557d08cdddb0d0ca5deaedc9.map