-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhlp.js
1 lines (1 loc) · 45.7 KB
/
hlp.js
1
!function t(e,r,n){function i(a,s){if(!r[a]){if(!e[a]){var l="function"==typeof require&&require;if(!s&&l)return l(a,!0);if(o)return o(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var u=r[a]={exports:{}};e[a][0].call(u.exports,(function(t){return i(e[a][1][t]||t)}),u,u.exports,t,e,r,n)}return r[a].exports}for(var o="function"==typeof require&&require,a=0;a<n.length;a++)i(n[a]);return i}({1:[function(t,e,r){(function(t){(function(){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;class e{static x(t){if("function"==typeof t)try{return t=t(),this.x(t)}catch(t){return!1}return!(null===t||!1===t||"string"==typeof t&&""==t.trim()||"object"==typeof t&&0===Object.keys(t).length&&t.constructor===Object||void 0===t||Array.isArray(t)&&0===t.length||Array.isArray(t)&&1===t.length&&""===t[0])}static nx(t){return!this.x(t)}static true(t){if("function"==typeof t)try{return t=t(),this.true(t)}catch(t){return!1}return void 0!==t&&(null!==t&&(!1!==t&&((!Array.isArray(t)||0!==t.length)&&((!Array.isArray(t)||""!==e.first(t))&&(("object"!=typeof t||0!==Object.keys(t).length||t.constructor!==Object)&&(0!==t&&("0"!==t&&(""!==t&&(" "!==t&&("null"!==t&&"false"!==t))))))))))}static false(t){if("function"==typeof t)try{return t=t(),this.false(t)}catch(t){return!1}return void 0!==t&&(null!==t&&(!1===t||(!Array.isArray(t)||0!==t.length)&&((!Array.isArray(t)||""!==e.first(t))&&(("object"!=typeof t||0!==Object.keys(t).length||t.constructor!==Object)&&(0===t||("0"===t||""!==t&&(" "!==t&&("null"!==t&&"false"===t))))))))}static v(){if(this.nx(arguments))return"";for(let t=0;t<arguments.length;t++)if(this.x(arguments[t]))return arguments[t];return""}static loop(t,e){if(this.nx(t))return null;Array.isArray(t)?t.forEach(((t,r)=>{e(t,r)})):"object"==typeof t&&Object.entries(t).forEach((t=>{let[r,n]=t;e(n,r)}))}static map(t,e,r){return Object.keys(t).reduce(((n,i)=>(n[i]=e.call(r||null,i,t[i]),n)),{})}static first(t){if(Array.isArray(t)){var e=null;return t.forEach(((t,r)=>{null===e&&(e=t)})),e}if("object"==typeof t){e=null;return Object.entries(t).forEach((t=>{let[r,n]=t;null===e&&(e=n)})),e}return null}static last(t){if(Array.isArray(t)){let e=null;return t.forEach(((t,r)=>{e=t})),e}if("object"==typeof t){let e=null;return Object.entries(t).forEach((t=>{let[r,n]=t;e=n})),e}return null}static rand(t){return Array.isArray(t)?t[Math.floor(Math.random()*t.length)]:"object"==typeof t?(t=Object.values(t))[Math.floor(Math.random()*t.length)]:null}static random_string(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:8,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;null===e&&(e="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ");let r=e.length,n="";for(let i=0;i<t;i++)n+=e[0+~~(Math.random()*(r-1-0+1))];return n}static round(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return Number(Math.round(t+"e"+e)+"e-"+e)}static isInteger(t){return!isNaN(t)&&parseInt(Number(t))==t&&!isNaN(parseInt(t,10))}static random_int(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:99999;return!(!this.isInteger(t)||!this.isInteger(e))&&(t>e&&([t,e]=[e,t]),~~(Math.random()*(e-t+1))+t)}static capitalize(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return null===t||""===t?t:t.charAt(0).toUpperCase()+t.slice(1)}static cookieExists(t){return void 0!==document.cookie&&null!==this.cookieGet(t)}static cookieGet(t){var e=document.cookie.match(new RegExp(t+"=([^;]+)"));return e?decodeURIComponent(e[1]):null}static cookieSet(t,e,r){let n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],i="";window.location.protocol.indexOf("https")>-1&&(i="; SameSite=None; Secure"),document.cookie=t+"="+encodeURIComponent(e)+"; expires="+new Date((new Date).getTime()+24*r*60*60*1e3).toUTCString()+"; path=/"+i+"; domain="+(!0===n?this.urlHostTopLevel():"")}static cookieDelete(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r="";window.location.protocol.indexOf("https")>-1&&(r="; SameSite=None; Secure"),document.cookie=t+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/"+r+"; domain="+(!0===e?this.urlHostTopLevel():"")}static localStorageSet(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;r*=864e5;let n={value:e,expiry:(new Date).getTime()+r};localStorage.setItem(t,JSON.stringify(n))}static localStorageGet(t){let e=localStorage.getItem(t);if(!e)return null;let r=JSON.parse(e);return(new Date).getTime()>r.expiry?(localStorage.removeItem(t),null):r.value}static localStorageDelete(t){localStorage.removeItem(t)}static localStorageExists(t){return null!==this.localStorageGet(t)}static getParam(t){let e=window.location.search;if(this.nx(e))return null;let r=e.substring(1).split("&");for(var n=0;n<r.length;n++){var i=r[n].split("=");if(i[0]==t&&this.x(i[1]))return i[1]}return null}static getDevice(){return this.isPhone()?"phone":this.isTablet()?"tablet":"desktop"}static isPhone(){let t=navigator.userAgent||navigator.vendor||window.opera;return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substr(0,4))}static isTablet(){let t=navigator.userAgent||navigator.vendor||window.opera;return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substr(0,4))}static isDesktop(){return!this.isPhone()&&!this.isTablet()}static isMobile(){return!!(window.innerWidth<750||this.isPhone())}static isTouch(){return"ontouchstart"in window||navigator.maxTouchPoints||!1}static isMac(){return"mac"===e.getOs()}static isLinux(){return"linux"===e.getOs()}static isWindows(){return"windows"===e.getOs()}static getOs(){let t=window.navigator.userAgent,e=window.navigator.platform,r="unknown";return-1!==["Macintosh","MacIntel","MacPPC","Mac68K"].indexOf(e)||-1!==["iPhone","iPad","iPod"].indexOf(e)?r="mac":-1!==["Win32","Win64","Windows","WinCE"].indexOf(e)?r="windows":(/Android/.test(t)||/Linux/.test(e))&&(r="linux"),r}static getBrowser(){let t="",e=!!!document.documentMode&&!!window.StyleMedia;return t=-1!=navigator.userAgent.indexOf("Opera")||-1!=navigator.userAgent.indexOf("OPR")?"opera":-1==navigator.userAgent.indexOf("Chrome")||e?-1==navigator.userAgent.indexOf("Safari")||e?-1!=navigator.userAgent.indexOf("Firefox")?"firefox":-1!=navigator.userAgent.indexOf("MSIE")||1==!!document.documentMode?"ie":e?"edge":"unknown":"safari":"chrome",t}static isObject(t){return!!t&&t.constructor===Object}static isArray(t){return!!t&&t.constructor===Array}static isString(t){return"string"==typeof t||t instanceof String}static isDate(t){if(this.nx(t))return!1;if("[object Date]"===Object.prototype.toString.call(t))return!0;if(!this.isString(t))return!1;if(3!==t.split("-").length)return!1;let e=parseInt(t.split("-")[2]),r=parseInt(t.split("-")[1]),n=parseInt(t.split("-")[0]),i=new Date;return i.setFullYear(n,r-1,e),i.getFullYear()==n&&i.getMonth()+1==r&&i.getDate()==e}static formatNumber(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".",n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:",";t=(t+"").replace(/[^0-9+\-Ee.]/g,"");var i=isFinite(+t)?+t:0,o=isFinite(+e)?Math.abs(e):0,a=void 0===n?",":n,s=void 0===r?".":r,l="";return l=(o?function(t,e){var r=Math.pow(10,e);return""+Math.round(t*r)/r}(i,o):""+Math.round(i)).split("."),l[0].length>3&&(l[0]=l[0].replace(/\B(?=(?:\d{3})+(?!\d))/g,a)),(l[1]||"").length<o&&(l[1]=l[1]||"",l[1]+=new Array(o-l[1].length+1).join("0")),l.join(s)}static formatDate(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;!1===e||!0===e||null===e||""===e?e=new Date:"object"!=typeof e&&(e=new Date(e.replace(/-/g,"/").replace(/T|Z/g," ")));let r="",n=e.getMonth(),i=n+1,o=e.getDay(),a=e.getDate(),s=e.getFullYear(),l=e.getHours(),c=e.getMinutes(),u=e.getSeconds();for(let d=0,h=t.length;d<h;d++)switch(t[d]){case"j":r+=a;break;case"d":r+=a<10?"0"+a:a;break;case"l":let h=Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");r+=h[o];break;case"w":r+=o;break;case"D":h=Array("Sun","Mon","Tue","Wed","Thr","Fri","Sat"),r+=h[o];break;case"m":r+=i<10?"0"+i:i;break;case"n":r+=i;break;case"F":let g=Array("January","February","March","April","May","June","July","August","September","October","November","December");r+=g[n];break;case"M":g=Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"),r+=g[n];break;case"Y":r+=s;break;case"y":r+=s.toString().slice(-2);break;case"H":r+=l<10?"0"+l:l;break;case"g":let m=0===l?12:l;r+=m>12?m-12:m;break;case"h":m=0===l?12:l,m=m>12?m-12:m,r+=m<10?"0"+m:m;break;case"a":r+=l<12?"am":"pm";break;case"i":r+=c<10?"0"+c:c;break;case"s":r+=u<10?"0"+u:u;break;case"c":r+=e.toISOString();break;default:r+=t[d]}return r}static deepCopy(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new WeakMap;if(Object(t)!==t)return t;if(r.has(t))return r.get(t);const n=t instanceof Date?new Date(t):t instanceof RegExp?new RegExp(t.source,t.flags):t.constructor?new t.constructor:Object.create(null);return r.set(t,n),t instanceof Map&&Array.from(t,(t=>{let[i,o]=t;return n.set(i,e.deepCopy(o,r))})),Object.assign(n,...Object.keys(t).map((n=>({[n]:e.deepCopy(t[n],r)}))))}static jsonStringToObject(t){if(this.nx(t)||!this.isString(t))return null;try{return JSON.parse(t)}catch(t){return null}}static isJsonString(t){if(this.nx(t)||!this.isString(t))return!1;try{JSON.parse(t);return!0}catch(t){return!1}}static jsonObjectToString(t){try{return JSON.stringify(t)}catch(t){return null}}static uuid(){function t(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return t()+t()+"-"+t()+"-"+t()+"-"+t()+"-"+t()+t()+t()}static guid(){return this.uuid()}static replaceAll(t,e,r){return t.split(e).join(r)}static replaceLast(t,e,r){let n=t.lastIndexOf(e);return t=t.slice(0,n)+t.slice(n).replace(e,r)}static replaceFirst(t,e,r){return t.replace(e,r)}static findAllPositions(t,e){let r,n=t.length,i=0,o=[];if(0==n)return[];for(;(r=e.indexOf(t,i))>-1;)o.push(r),i=r+n;return o}static findAllPositionsCaseInsensitive(t,e){let r,n=t.length,i=0,o=[];if(0==n)return[];for(;(r=this.indexOfCaseInsensitive(t,e,i))>-1;)o.push(r),i=r+n;return o}static countAllOccurences(t,e){let r=new RegExp(t,"g");return(e.match(r)||[]).length}static countAllOccurencesCaseInsensitive(t,e){let r=new RegExp(t,"gi");return(e.match(r)||[]).length}static indexOfCaseInsensitive(t,e,r){return e.toLowerCase().indexOf(t.toLowerCase(),r)}static highlight(t,e){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:500;if(this.nx(t)||this.nx(e))return t;if(!0===r){let r="...",i=this.findAllPositionsCaseInsensitive(e,t),o=t.split(" "),a=0;for(o.forEach(((t,s)=>{let l=!0;i.forEach((t=>{a>=t-n&&a<=t+e.length+n-1&&(l=!1)})),!0===l&&(o[s]=r),a+=t.length+1})),t=o.join(" ");t.indexOf(r+" "+r)>-1;)t=this.replaceAll(t,r+" "+r,r);t=t.trim()}let i=this.findAllPositionsCaseInsensitive(e,t),o='<strong class="highlight">',a="</strong>";for(let r=0;r<i.length;r++){t=t.substring(0,i[r])+o+t.substring(i[r],i[r]+e.length)+a+t.substring(i[r]+e.length);for(let t=r+1;t<i.length;t++)i[t]=i[t]+26+9}return t}static get(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return this.call("GET",t,e)}static post(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return this.call("POST",t,e)}static call(t,r){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return null===n&&(n={}),"data"in n||(n.data={}),"headers"in n||(n.headers=null),"throttle"in n||(n.throttle=0),"allow_errors"in n||(n.allow_errors=!0),new Promise(((i,o)=>{setTimeout((()=>{0!==r.indexOf("http")&&(r=e.baseUrl()+"/"+r);let a=new XMLHttpRequest;a.open(t,r,!0),"POST"===t&&(!("data"in n)||null===n.data||"object"!=typeof n.data||n.data instanceof FormData||(a.setRequestHeader("Content-Type","application/json;charset=UTF-8"),n.data=JSON.stringify(n.data)),a.setRequestHeader("X-Requested-With","XMLHttpRequest")),this.x(n.headers)&&Object.entries(n.headers).forEach((t=>{let[e,r]=t;a.setRequestHeader(e,r)})),a.onload=()=>{(4!=a.readyState||!0!==n.allow_errors&&200!=a.status&&304!=a.status)&&(this.isJsonString(a.responseText)?o(this.jsonStringToObject(a.responseText)):o(a.responseText)),this.isJsonString(a.responseText)?i(this.jsonStringToObject(a.responseText)):i(a.responseText)},a.onerror=()=>{o([a.readyState,a.status,a.statusText])},"GET"===t&&a.send(null),"POST"===t&&a.send(n.data)}),n.throttle)}))}static onResizeHorizontal(t){let e,r,n=window.innerWidth;window.addEventListener("resize",(()=>{e=window.innerWidth,e!=n&&(n=e,r&&clearTimeout(r),r=window.setTimeout((()=>{t()}),50))})),t()}static onResizeVertical(t){var e,r,n=window.innerHeight;window.addEventListener("resize",(()=>{(e=window.innerHeight)!=n&&(n=e,r&&clearTimeout(r),r=window.setTimeout((()=>{t()}),50))})),t()}static removeEmpty(t){return this.nx(t)||!Array.isArray(t)?t:t=t.filter((t=>this.x(t)))}static uniqueArray(t){let e={},r=[];for(let n=0;n<t.length;n++)t[n]in e||(r.push(t[n]),e[t[n]]=!0);return r}static powerset(t){return Array.isArray(t)?t.reduce(((t,e)=>t.concat(t.map((t=>[...t,e])))),[[]]):t}static charToInt(t){let e,r,n="ABCDEFGHIJKLMNOPQRSTUVWXYZ",i=0;for(e=0,r=(t=t.toUpperCase()).length-1;e<t.length;e+=1,r-=1)i+=Math.pow(26,r)*(n.indexOf(t[e])+1);return i}static intToChar(t){for(var e="",r=1,n=26;(t-=r)>=0;r=n,n*=26)e=String.fromCharCode(parseInt(t%n/r)+65)+e;return e}static slugify(t){return t.toString().toLowerCase().trim().split("ä").join("ae").split("ö").join("oe").split("ü").join("ue").split("ß").join("ss").replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}static incChar(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return this.intToChar(this.charToInt(t)+e)}static decChar(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return this.intToChar(this.charToInt(t)-e)}static range(t,e){let r=[],n=typeof t,i=typeof e,o=1;if("undefined"==n||"undefined"==i||n!=i)return null;if(e<t&&(o=-o),"number"==n)for(;o>0?e>=t:e<=t;)r.push(t),t+=o;else{if("string"!=n)return null;if(1!=t.length||1!=e.length)return null;for(t=t.charCodeAt(0),e=e.charCodeAt(0);o>0?e>=t:e<=t;)r.push(String.fromCharCode(t)),t+=o}return r}static dateToWeek(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;null===t&&(t=new Date),t=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate())),t.setUTCDate(t.getUTCDate()+4-(t.getUTCDay()||7));let e=new Date(Date.UTC(t.getUTCFullYear(),0,1));return Math.ceil(((t-e)/864e5+1)/7)}static weekToDate(t,e){null==e&&(e=(new Date).getFullYear());let r=new Date;r.setYear(e),r.setDate(1),r.setMonth(0),r.setHours(0),r.setMinutes(0),r.setSeconds(0),r.setMilliseconds(0);let n=r.getDay();n=0===n?7:n;let i=1-n;7-n+1<4&&(i+=7),r=new Date(r.getTime()+24*i*60*60*1e3);let o=6048e5*(t-1),a=r.getTime()+o;return r.setTime(a),r.setHours(0),r.setMinutes(0),r.setSeconds(0),r.setMilliseconds(0),r}static addDays(t,e){var r=new Date(t);return r.setDate(r.getDate()+e),r}static objectsAreEqual(t,e){var r=this;if(null==t||null==e)return t===e;if(t.constructor!==e.constructor)return!1;if(t instanceof Function)return t===e;if(t instanceof RegExp)return t===e;if(t===e||t.valueOf()===e.valueOf())return!0;if(Array.isArray(t)&&t.length!==e.length)return!1;if(t instanceof Date)return!1;if(!(t instanceof Object))return!1;if(!(e instanceof Object))return!1;var n=Object.keys(t);return Object.keys(e).every((function(t){return-1!==n.indexOf(t)}))&&n.every((function(n){return r.objectsAreEqual(t[n],e[n])}))}static containsObject(t,e){var r;for(r in e)if(e.hasOwnProperty(r)&&this.objectsAreEqual(e[r],t))return!0;return!1}static fadeOut(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3;return e<=25&&(e=25),new Promise((r=>{t.style.opacity=1,function n(){(t.style.opacity-=25/e)<0?(t.style.display="none",r()):requestAnimationFrame(n)}()}))}static fadeIn(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3;return e<=25&&(e=25),new Promise((r=>{t.style.opacity=0,t.style.display="block",function n(){var i=parseFloat(t.style.opacity);(i+=25/e)>1?r():(t.style.opacity=i,requestAnimationFrame(n))}()}))}static scrollTop(){let t=document.documentElement;return(window.pageYOffset||t.scrollTop)-(t.clientTop||0)}static scrollLeft(){let t=document.documentElement;return(window.pageXOffset||t.scrollLeft)-(t.clientLeft||0)}static closestScrollable(t){let e=t instanceof HTMLElement&&window.getComputedStyle(t).overflowY,r=e&&!(e.includes("hidden")||e.includes("visible"));return t?r&&t.scrollHeight>=t.clientHeight?t:this.closestScrollable(t.parentNode)||document.scrollingElement||document.body:null}static offsetTop(t){return t.getBoundingClientRect().top+window.pageYOffset-document.documentElement.clientTop}static offsetLeft(t){return t.getBoundingClientRect().left+window.pageXOffset-document.documentElement.clientLeft}static offsetRight(t){return t.getBoundingClientRect().left+window.pageXOffset-document.documentElement.clientLeft+t.offsetWidth}static offsetBottom(t){return t.getBoundingClientRect().top+window.pageYOffset-document.documentElement.clientTop+t.offsetHeight}static offsetTopWithMargin(t){return this.offsetTop(t)-parseInt(getComputedStyle(t).marginTop)}static offsetLeftWithMargin(t){return this.offsetLeft(t)-parseInt(getComputedStyle(t).marginLeft)}static offsetRightWithMargin(t){return this.offsetRight(t)+parseInt(getComputedStyle(t).marginRight)}static offsetBottomWithMargin(t){return this.offsetBottom(t)+parseInt(getComputedStyle(t).marginBottom)}static documentHeight(){return Math.max(document.body.offsetHeight,document.body.scrollHeight,document.documentElement.clientHeight,document.documentElement.offsetHeight,document.documentElement.scrollHeight)}static documentWidth(){return document.documentElement.clientWidth||document.body.clientWidth}static windowWidth(){return window.innerWidth}static windowHeight(){return window.innerHeight}static windowWidthWithoutScrollbar(){return document.documentElement.clientWidth||document.body.clientWidth}static windowHeightWithoutScrollbar(){return document.documentElement.clientHeight||document.body.clientHeight}static outerWidthWithMargin(t){return t.offsetWidth+parseInt(getComputedStyle(t).marginLeft)+parseInt(getComputedStyle(t).marginRight)}static outerHeightWithMargin(t){return t.offsetHeight+parseInt(getComputedStyle(t).marginTop)+parseInt(getComputedStyle(t).marginBottom)}static async cursorPosition(){document.head.insertAdjacentHTML("afterbegin",'\n <style type="text/css">\n .find-pointer-quad {\n --hit: 0;\n position: fixed;\n\t z-index:2147483647;\n transform: translateZ(0);\n &:hover { --hit: 1; }\n }\n </style>\n '),window.cursorPositionDelay=50,window.cursorPositionQuads=[];return window.cursorPositionQuads=[1,2,3,4].map(((t,e)=>{let r=document.createElement("a");r.classList.add("find-pointer-quad");let{style:n}=r;return n.top=e<2?0:"10%",n.left=e%2==0?0:"10%",n.width=n.height="10%",document.body.appendChild(r),r})),this.cursorPositionBisect(10)}static cursorPositionBisect(t){let e;if(window.cursorPositionQuads.some((t=>{let r=getComputedStyle(t);if("1"===r.getPropertyValue("--hit"))return e={style:r,a:t}})),!e){let[e]=window.cursorPositionQuads,r=Math.abs(t)>1e4,n=parseFloat(e.style.top)-t/2,i=parseFloat(e.style.left)-t/2;return window.cursorPositionQuads.forEach(((e,o)=>{let{style:a}=e;r?(a.top=o<2?0:`${t}%`,a.left=o%2==0?0:`${t}%`,a.width=a.height=`${t}%`):(a.top=o<2?`${n}%`:`${n+t}%`,a.left=o%2==0?`${i}%`:`${i+t}%`,a.width=`${t}%`,a.height=`${t}%`)})),new Promise((e=>{setTimeout((()=>e(this.cursorPositionBisect(r?t:2*t))),window.cursorPositionDelay)}))}let{style:r,a:n}=e,{top:i,left:o,width:a,height:s}=n.getBoundingClientRect();if(a<3)return window.cursorPositionQuads.forEach((t=>t.remove())),{x:Math.round(o+a/2+window.scrollX),y:Math.round(i+s/2+window.scrollY)};let l=n.style.left,c=n.style.top,u=t/2;return window.cursorPositionQuads.forEach(((t,e)=>{let{style:r}=t;r.top=e<2?c:`${u+parseFloat(c)}%`,r.left=e%2==0?l:`${u+parseFloat(l)}%`,r.width=`${u}%`,r.height=`${u}%`})),new Promise((t=>{setTimeout((()=>t(this.cursorPositionBisect(u))),window.cursorPositionDelay)}))}static scrollTo(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]&&arguments[4];return new Promise((a=>{null===n&&(n=document.scrollingElement||document.documentElement),e.isNumeric(t)||(t=n===(document.scrollingElement||documentElement)?this.offsetTopWithMargin(t):t.getBoundingClientRect().top-parseInt(getComputedStyle(t).marginTop)-(n.getBoundingClientRect().top-n.scrollTop-parseInt(getComputedStyle(n).marginTop)));let s=0;Array.isArray(i)||(i=[i]),i.forEach((t=>{e.isNumeric(t)?s+=t:null!==t&&"fixed"===window.getComputedStyle(t).position&&(s+=-1*t.offsetHeight)})),t+=s;const l=n.scrollTop,c=t-l,u=+new Date,d=function(){const e=+new Date-u;var i,o,s;n.scrollTop=parseInt((i=e,o=l,s=c,(i/=r/2)<1?-s/2*(Math.sqrt(1-i*i)-1)+o:(i-=2,s/2*(Math.sqrt(1-i*i)+1)+o))),e<r?requestAnimationFrame(d):(n.scrollTop=t,a())};!0===o&&c>0?a():d()}))}static loadJs(t){e.isArray(t)||(t=[t]);let r=[];return e.loop(t,((t,e)=>{r.push(new Promise(((e,r)=>{let n=document.createElement("script");n.src=t,n.onload=()=>{e()},document.head.appendChild(n)})))})),Promise.all(r)}static async loadJsSequentially(t){e.isArray(t)||(t=[t]);for(let r of t)await e.loadJs(r)}static triggerAfterAllImagesLoaded(t,e,r){window.addEventListener("load",(n=>{null!==document.querySelector(t+" "+e)&&document.querySelectorAll(t+" "+e).forEach((n=>{this.triggerAfterAllImagesLoadedBindLoadEvent(n,t,e,r)}))})),document.addEventListener("DOMContentLoaded",(()=>{null!==document.querySelector(t)&&new MutationObserver((n=>{n.forEach((n=>{"childList"===n.type&&n.addedNodes.length>0?n.addedNodes.forEach((n=>{this.triggerAfterAllImagesLoadedHandleEl(n,t,e,r)})):"attributes"===n.type&&"src"===n.attributeName&&n.target.classList.contains(e.replace(".",""))&&n.oldValue!==n.target.getAttribute("src")&&this.triggerAfterAllImagesLoadedHandleEl(n.target,t,e,r)}))})).observe(document.querySelector(t),{attributes:!0,childList:!0,characterData:!1,subtree:!0,attributeOldValue:!0,characterDataOldValue:!1})}))}static triggerAfterAllImagesLoadedHandleEl(t,e,r,n){t.nodeType===Node.ELEMENT_NODE&&(t.classList.remove("loaded-img"),t.closest(e).classList.remove("loaded-all"),t.classList.contains("binded-trigger")||(t.classList.add("binded-trigger"),t.addEventListener("load",(()=>{this.triggerAfterAllImagesLoadedBindLoadEvent(t,e,r,n)}))))}static triggerAfterAllImagesLoadedBindLoadEvent(t,e,r,n){t.classList.add("loaded-img"),t.closest(e).querySelectorAll(".loaded-img").length===t.closest(e).querySelectorAll(r).length&&(t.closest(e).classList.add("loaded-all"),n())}static isVisible(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)}static isVisibleInViewport(t){if(!this.isVisible(t))return!1;let e=t.getBoundingClientRect();return!(e.bottom<0||e.right<0||e.left>window.innerWidth||e.top>window.innerHeight)}static textareaAutoHeight(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"textarea";this.textareaSetHeights(t),this.onResizeHorizontal((()=>{this.textareaSetHeights(t)})),[].forEach.call(document.querySelectorAll(t),(t=>{t.addEventListener("keyup",(t=>{this.textareaSetHeight(t.target)}))}))}static textareaSetHeights(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"textarea";[].forEach.call(document.querySelectorAll(t),(t=>{this.isVisible(t)&&this.textareaSetHeight(t)}))}static textareaSetHeight(t){t.style.height="5px",t.style.height=t.scrollHeight+"px"}static real100vh(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100;if(null===t){let t=()=>{let t=.01*window.innerHeight;document.documentElement.style.setProperty("--vh",`${t}px`)};t(),window.addEventListener("resize",(()=>{t()}))}else{let r=()=>{console.log(t),null!==document.querySelector(t)&&document.querySelectorAll(t).forEach((t=>{t.style.height=window.innerHeight*(e/100)+"px"}))};r(),window.addEventListener("resize",(()=>{r()}))}}static iOsRemoveHover(){"safari"===e.getBrowser()&&"desktop"!==e.getDevice()&&e.on("touchend","a",((t,e)=>{e.click()}))}static isNumeric(t){return!isNaN(parseFloat(t))&&isFinite(t)}static animate(t,r,n,i,o){return new Promise((a=>{o<=50&&(o=50);let s=[];r.split(";").forEach((t=>{s.push(t.split(":")[0].trim())}));let l=[];s.forEach((t=>{l.push(t+" "+Math.round(o/1e3*10)/10+"s "+i)})),l="transition: "+l.join(", ")+" !important;";let c=null;NodeList.prototype.isPrototypeOf(t)?c=Array.from(t):null===t?(console.log("cannot animate element from "+r+" to "+n+" because it does not exist"),a()):c=[t];let u=c.length;c.forEach(((t,i)=>{let c=e.random_string(10,"abcdefghijklmnopqrstuvwxyz");t.classList.add(c),window.requestAnimationFrame((()=>{let i=[],d=t.getAttribute("style");null!==d&&d.split(";").forEach((t=>{s.includes(t.split(":")[0].trim())||i.push(t)})),i=i.join(";")+";"+r+";",t.setAttribute("style",i),window.requestAnimationFrame((()=>{let i=document.createElement("style");i.innerHTML="."+c+" { "+l+" }",document.head.appendChild(i),window.requestAnimationFrame((()=>{if(t.setAttribute("style",t.getAttribute("style").replace(r+";","")+n+";"),this.isVisible(t)){let r=!1;e.addEventListenerOnce(t,"transitionend",(e=>{if(r=!0,e.target!==e.currentTarget)return!1;document.head.removeChild(i),t.classList.remove(c),u--,u<=0&&window.requestAnimationFrame((()=>{a()}))})),setTimeout((()=>{!1===r&&(document.head.removeChild(i),t.classList.remove(c),u--,u<=0&&a())}),1.5*o)}else document.head.removeChild(i),t.classList.remove(c),u--,u<=0&&a()}))}))}))}))}))}static addEventListenerOnce(t,e,r,n,i){t.addEventListener(e,(function o(a){!1!==r.apply(this,arguments,n)&&t.removeEventListener(e,o,i)}))}static htmlDecode(t){let e=document.createElement("textarea");return e.innerHTML=t,e.value}static htmlEncode(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/`/g,"`")}static nl2br(t){if(null==t)return"";return(t+"").replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g,"$1<br/>")}static br2nl(t){if(null==t)return"";return t.replace(/<\s*\/?br\s*[\/]?>/gi,"\n")}static closest(t,e){if(!document.documentElement.contains(t))return null;do{if(this.matches(t,e))return t;t=t.parentElement||t.parentNode}while(null!==t&&1===t.nodeType);return null}static matches(t,e){let r=t,n=(r.parentNode||r.document).querySelectorAll(e),i=-1;for(;n[++i]&&n[i]!=r;);return!!n[i]}static wrap(t,e){if(null===t)return;let r=(new DOMParser).parseFromString(e,"text/html").body.childNodes[0];t.parentNode.insertBefore(r,t.nextSibling),r.appendChild(t)}static wrapTextNodes(t,e){null!==t&&Array.from(t.childNodes).filter((t=>3===t.nodeType&&t.textContent.trim().length>1)).forEach((t=>{const r=document.createElement(e);t.after(r),r.appendChild(t)}))}static html2dom(t){let e=document.createElement("template");return t=t.trim(),e.innerHTML=t,void 0===e.content?this.html2domLegacy(t):e.content.firstChild}static html2domLegacy(t){var e,r,n,i={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]},o=document,a=o.createDocumentFragment();if(/<|&#?\w+;/.test(t)){for(e=a.appendChild(o.createElement("div")),r=i[(/<([\w:]+)/.exec(t)||["",""])[1].toLowerCase()]||i._default,e.innerHTML=r[1]+t.replace(/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,"<$1></$2>")+r[2],n=r[0];n--;)e=e.lastChild;for(a.removeChild(a.firstChild);e.firstChild;)a.appendChild(e.firstChild)}else a.appendChild(o.createTextNode(t));return a.querySelector("*")}static prev(t,e){let r=t.previousElementSibling;return null===r?null:void 0===e||this.matches(r,e)?r:null}static next(t,e){let r=t.nextElementSibling;return null===r?null:void 0===e||this.matches(r,e)?r:null}static prevAll(t,e){let r=[];for(;t=t.previousElementSibling;)(void 0===e||this.matches(t,e))&&r.push(t);return r}static nextAll(t,e){let r=[];for(;t=t.nextElementSibling;)(void 0===e||this.matches(t,e))&&r.push(t);return r}static prevUntil(t,e){let r=[];for(;(t=t.previousElementSibling)&&!this.matches(t,e);)r.push(t);return r}static nextUntil(t,e){let r=[];for(;(t=t.nextElementSibling)&&!this.matches(t,e);)r.push(t);return r}static siblings(t,e){let r=[],n=t;for(t=t.parentNode.firstChild;t=t.nextElementSibling;)(void 0===e||this.matches(t,e))&&n!==t&&r.push(t);return r}static parents(t,e){let r=[],n=void 0!==e;for(;null!==(t=t.parentElement);)t.nodeType===Node.ELEMENT_NODE&&(n&&!this.matches(t,e)||r.push(t));return r}static css(t){let e=document.styleSheets,r={};for(let n in e)try{let i=e[n].rules||e[n].cssRules;for(let e in i)this.matches(t,i[e].selectorText)&&(r=Object.assign(r,this.css2json(i[e].style),this.css2json(t.getAttribute("style"))))}catch(t){}return r}static css2json(t){let e={};if(!t)return e;if(t instanceof CSSStyleDeclaration)for(let r in t)t[r].toLowerCase&&void 0!==t[t[r]]&&(e[t[r].toLowerCase()]=t[t[r]]);else if("string"==typeof t){t=t.split(";");for(let r in t)if(t[r].indexOf(":")>-1){let n=t[r].split(":");e[n[0].toLowerCase().trim()]=n[1].trim()}}return e}static compareDates(t,e){return"string"==typeof t&&(t=t.split(" ").join("T")),"string"==typeof e&&(e=e.split(" ").join("T")),t=new Date(t),e=new Date(e),t.setHours(0),t.setMinutes(0),t.setSeconds(0),t.setMilliseconds(0),e.setHours(0),e.setMinutes(0),e.setSeconds(0),e.setMilliseconds(0),t.getFullYear()===e.getFullYear()&&t.getMonth()===e.getMonth()&&t.getDate()===e.getDate()?0:t<e?-1:1}static spaceship(t,e){return null===t||null===e||typeof t!=typeof e?null:"string"==typeof t?t.localeCompare(e):t>e?1:t<e?-1:0}static focus(t){e.unfocus();let r=null;if(r="string"==typeof t||t instanceof String?document.querySelector(t):t,null!==r){let t=document.createElement("div");t.classList.add("hlp-focus-mask"),t.style.position="fixed",t.style.top=0,t.style.bottom=0,t.style.left=0,t.style.right=0,t.style.backgroundColor="rgba(0,0,0,0.8)",t.style.zIndex=2147483646,r.before(t),r.setAttribute("data-focussed",1),r.setAttribute("data-focussed-orig-z-index",r.style.zIndex),r.setAttribute("data-focussed-orig-position",r.style.position),r.setAttribute("data-focussed-orig-background-color",r.style.backgroundColor),r.setAttribute("data-focussed-orig-box-shadow",r.style.boxShadow),r.style.zIndex=2147483647,r.style.position="relative",r.style.backgroundColor="#ffffff",r.style.boxShadow="0px 0px 0px 20px #fff"}}static unfocus(){null!==document.querySelector(".hlp-focus-mask")&&document.querySelectorAll(".hlp-focus-mask").forEach((t=>{e.remove(t)})),null!==document.querySelector("[data-focussed]")&&document.querySelectorAll("[data-focussed]").forEach((t=>{t.style.zIndex=t.getAttribute("data-focussed-orig-z-index"),t.style.position=t.getAttribute("data-focussed-orig-position"),t.style.backgroundColor=t.getAttribute("data-focussed-orig-background-color"),t.style.boxShadow=t.getAttribute("data-focussed-orig-box-shadow"),t.removeAttribute("data-focussed"),t.removeAttribute("data-focussed-orig-z-index"),t.removeAttribute("data-focussed-orig-position"),t.removeAttribute("data-focussed-orig-background-color"),t.removeAttribute("data-focussed-orig-box-shadow")}))}static remove(t){null!==t&&t.parentNode.removeChild(t)}static on(t,r,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;null===i?(i=n,n=document):n=document.querySelector(n),n.addEventListener(t,(t=>{var n=e.closest(t.target,r);n&&i(t,n)}),!1)}static url(){return window.location.protocol+"//"+window.location.host+window.location.pathname}static urlWithHash(){return window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.hash}static fullUrl(){return window.location.href}static urlWithArgs(){return window.location.href.split("#")[0]}static baseUrl(){return window.location.protocol+"//"+window.location.host}static urlProtocol(){return window.location.protocol+"//"}static urlHost(){return window.location.host}static urlHostTopLevel(){let t=window.location.host;if(t.match(/^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$/))return t;for(t=t.split(".");t.length>2;)t.shift();return t=t.join("."),t}static urlPath(){return window.location.pathname}static urlHash(){return window.location.hash}static urlArgs(){return window.location.search}static urlOfScript(){if(document.currentScript)return document.currentScript.src;{let t=document.getElementsByTagName("script");return t[t.length-1].src}}static pathOfScript(){let t=this.urlOfScript();return t.substring(0,t.lastIndexOf("/"))}static waitUntil(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return new Promise(((n,i)=>{let o=setInterval((()=>{null!==document.querySelector(t)&&(null===e||null===r&&void 0!==window.getComputedStyle(document.querySelector(t))[e]&&""!=window.getComputedStyle(document.querySelector(t))[e]||null!==r&&window.getComputedStyle(document.querySelector(t))[e]===r)&&(window.clearInterval(o),n())}),30)}))}static waitUntilEach(t,e){new MutationObserver((()=>{let r=document.querySelectorAll(t);r.length>0&&r.forEach((t=>{t.__processed||(t.__processed=!0,e(t))}))})).observe(document.body,{childList:!0,subtree:!0});let r=document.querySelectorAll(t);r.length>0&&r.forEach((t=>{t.__processed||(t.__processed=!0,e(t))}))}static waitUntilVar(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=null,i=null;return null===e?(n=t,i=window):(n=e,i=t),new Promise(((t,e)=>{let o=setInterval((()=>{void 0!==i[n]&&null!==i[n]&&(null!==r&&i[n]!==r||(window.clearInterval(o),t()))}),30)}))}static ready(){return new Promise((t=>{if("loading"!==document.readyState)return t();document.addEventListener("DOMContentLoaded",(()=>t()))}))}static load(){return new Promise((t=>{if("complete"===document.readyState)return t();window.addEventListener("load",(()=>t()))}))}static runForEl(t,r){e.ready().then((()=>{let n=e.pushId();null!==document.querySelector(t)&&document.querySelectorAll(t).forEach((t=>{void 0===t.runForEl&&(t.runForEl=[]),t.runForEl.includes(n)||(t.runForEl.push(n),r(t))})),void 0===window.runForEl_queue&&(window.runForEl_queue=[]),void 0===window.runForEl_observer&&(window.runForEl_observer=new MutationObserver((t=>{t.forEach((t=>{if(t.addedNodes)for(let e=0;e<t.addedNodes.length;e++){let r=t.addedNodes[e];r.nodeType===Node.ELEMENT_NODE&&window.runForEl_queue.forEach((t=>{r.matches(t.selector)&&(void 0===r.runForEl&&(r.runForEl=[]),r.runForEl.includes(t.id)||(r.runForEl.push(t.id),t.callback(r))),null!==r.querySelector(t.selector)&&r.querySelectorAll(t.selector).forEach((e=>{void 0===e.runForEl&&(e.runForEl=[]),e.runForEl.includes(t.id)||(e.runForEl.push(t.id),t.callback(e))}))}))}}))})).observe(document.body,{attributes:!1,childList:!0,characterData:!1,subtree:!0,attributeOldValue:!1,characterDataOldValue:!1})),window.runForEl_queue.push({id:n,selector:t,callback:r})}))}static fmath(t,e,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:8,i={"*":e*r,"-":e-r,"+":e+r,"/":e/r}[t];return Math.round(10*i*Math.pow(10,n))/(10*Math.pow(10,n))}static trim(t,e){let r=[" ","\n","\r","\t","\f","\v"," "," "," "," "," "," "," "," "," "," "," "," ","","\u2028","\u2029"," "].join(""),n=0,i=0;for(t+="",e&&(r=(e+"").replace(/([[\]().?/*{}+$^:])/g,"$1")),n=t.length,i=0;i<n;i++)if(-1===r.indexOf(t.charAt(i))){t=t.substring(i);break}for(n=t.length,i=n-1;i>=0;i--)if(-1===r.indexOf(t.charAt(i))){t=t.substring(0,i+1);break}return-1===r.indexOf(t.charAt(0))?t:""}static ltrim(t,e){e=e?(e+"").replace(/([[\]().?/*{}+$^:])/g,"$1"):" \\s ";const r=new RegExp("^["+e+"]+","g");return(t+"").replace(r,"")}static rtrim(t,e){e=e?(e+"").replace(/([[\]().?/*{}+$^:])/g,"\\$1"):" \\s ";const r=new RegExp("["+e+"]+$","g");return(t+"").replace(r,"")}static truncate_string(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:50,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"...";if(this.nx(t)||!("string"==typeof t||t instanceof String))return t;if(-1===t.indexOf(" "))t.length>r&&(t=t.substring(0,r),t=e.rtrim(t),t+=" "+n);else if(t.length>r){for(t=e.rtrim(t);t.length>r&&t.lastIndexOf(" ")>-1&&" "!=t.substring(r-1,r);)t=t.substring(0,t.lastIndexOf(" ")),t=e.rtrim(t);t=t.substring(0,r),t=e.rtrim(t),t+=" "+n}return t}static emojiRegex(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return new RegExp(e.emojiRegexPattern(),(!0===t?"g":"")+"u")}static emojiRegexPattern(){return String.raw`\p{RI}\p{RI}|\p{Extended_Pictographic}(\p{EMod}|\uFE0F\u20E3?|[\u{E0020}-\u{E007E}]+\u{E007F})?(\u200D(\p{RI}\p{RI}|\p{Extended_Pictographic}(\p{EMod}|\uFE0F\u20E3?|[\u{E0020}-\u{E007E}]+\u{E007F})?))*`}static pushId(){let r=null;void 0!==window&&(void 0===window.pushIdDataGlobal&&(window.pushIdDataGlobal={}),r=window.pushIdDataGlobal),void 0!==t&&(void 0===t.pushIdDataGlobal&&(t.pushIdDataGlobal={}),r=t.pushIdDataGlobal),e.objectsAreEqual(r,{})&&(r.lastPushTime=0,r.lastRandChars=[],r.PUSH_CHARS="-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz");let n=(new Date).getTime(),i=n===r.lastPushTime;r.lastPushTime=n;let o=new Array(8);for(var a=7;a>=0;a--)o[a]=r.PUSH_CHARS.charAt(n%64),n=Math.floor(n/64);if(0!==n)throw new Error;let s=o.join("");if(i){for(a=11;a>=0&&63===r.lastRandChars[a];a--)r.lastRandChars[a]=0;r.lastRandChars[a]++}else for(a=0;a<12;a++)r.lastRandChars[a]=Math.floor(64*Math.random());for(a=0;a<12;a++)s+=r.PUSH_CHARS.charAt(r.lastRandChars[a]);if(20!=s.length)throw new Error;return s}static getProp(t,e){let r=e.split(".");for(;r.length&&(t=t[r.shift()]););return t}static base64toblob(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=atob(t),n=[];for(let t=0;t<r.length;t+=512){let e=r.slice(t,t+512),i=new Array(e.length);for(let t=0;t<e.length;t++)i[t]=e.charCodeAt(t);let o=new Uint8Array(i);n.push(o)}return new Blob(n,{type:e})}static blobtobase64(t){return new Promise((e=>{let r=new FileReader;r.onload=()=>{var t=r.result.split(",")[1];e(t)},r.readAsDataURL(t)}))}static stringtoblob(t){return new Blob([t],{type:arguments.length>1&&void 0!==arguments[1]?arguments[1]:""})}static blobtostring(t){return new Promise((e=>{let r=new FileReader;r.onload=()=>{e(r.result)},r.readAsText(t)}))}static filetobase64(t){return new Promise(((e,r)=>{const n=new FileReader;n.readAsDataURL(t),n.onload=()=>e(n.result.split(",")[1]),n.onerror=t=>r(t)}))}static blobtofile(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"file.txt",r=null;try{r=new File([t],e)}catch{r=new Blob([t],e)}return r}static filetoblob(t){return new Blob([t])}static base64tofile(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"file.txt";return this.blobtofile(this.base64toblob(t,e),r)}static blobtourl(t){return URL.createObjectURL(t,{type:"text/plain"})}static stringtourl(t){return this.blobtourl(this.stringtoblob(t))}static base64tostring(t){return atob(t)}static stringtobase64(t){return btoa(t)}static base64tourl(t){return this.blobtourl(this.base64toblob(t))}static filetourl(t){return this.blobtourl(this.filetoblob(t))}static getImageOrientation(t){return new Promise(((e,r)=>{t=t.replace("data:image/jpeg;base64,","");let n=this.base64tofile(t),i=new FileReader;i.onload=t=>{var r=new DataView(t.target.result);if(65496==r.getUint16(0,!1)){for(var n=r.byteLength,i=2;i<n;){if(r.getUint16(i+2,!1)<=8)return void e(-1);var o=r.getUint16(i,!1);if(i+=2,65505==o){if(1165519206!=r.getUint32(i+=2,!1))return void e(-1);var a=18761==r.getUint16(i+=6,!1);i+=r.getUint32(i+4,a);var s=r.getUint16(i,a);i+=2;for(var l=0;l<s;l++)if(274==r.getUint16(i+12*l,a))return void e(r.getUint16(i+12*l+8,a))}else{if(65280&~o)break;i+=r.getUint16(i,!1)}}e(-1)}else e(-2)},i.readAsArrayBuffer(n)}))}static resetImageOrientation(t,e){return new Promise(((r,n)=>{var i=new Image;i.onload=()=>{var t=i.width,n=i.height,o=document.createElement("canvas"),a=o.getContext("2d");switch(4<e&&e<9?(o.width=n,o.height=t):(o.width=t,o.height=n),e){case 2:a.transform(-1,0,0,1,t,0);break;case 3:a.transform(-1,0,0,-1,t,n);break;case 4:a.transform(1,0,0,-1,0,n);break;case 5:a.transform(0,1,1,0,0,0);break;case 6:a.transform(0,1,-1,0,n,0);break;case 7:a.transform(0,-1,-1,0,n,t);break;case 8:a.transform(0,-1,1,0,0,t)}a.drawImage(i,0,0);let s=o.toDataURL();s="data:image/jpeg;base64,"+s.split(",")[1],r(s)},i.src=t}))}static fixImageOrientation(t){return new Promise(((e,r)=>{-1!==t.indexOf("data:")?(0===t.indexOf("data:image/jpeg;base64,")&&(t=t.replace("data:image/jpeg;base64,","")),this.getImageOrientation(t).then((r=>{t="data:image/jpeg;base64,"+t,r<=1?e(t):this.resetImageOrientation(t,r).then((t=>{e(t)}))}))):e(t)}))}static debounce(t,e,r){var n;return function(){var i=this,o=arguments,a=r&&!n;clearTimeout(n),n=setTimeout((function(){n=null,r||t.apply(i,o)}),e),a&&t.apply(i,o)}}static throttle(t,e,r){var n,i,o,a=null,s=0;r||(r={});var l=function(){s=!1===r.leading?0:Date.now(),a=null,o=t.apply(n,i),a||(n=i=null)};return function(){var c=Date.now();s||!1!==r.leading||(s=c);var u=e-(c-s);return n=this,i=arguments,u<=0||u>e?(a&&(clearTimeout(a),a=null),s=c,o=t.apply(n,i),a||(n=i=null)):a||!1===r.trailing||(a=setTimeout(l,u)),o}}static shuffle(t){let e,r,n=t.length;for(;0!==n;)r=Math.floor(Math.random()*n),n-=1,e=t[n],t[n]=t[r],t[r]=e;return t}static findRecursiveInObject(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];if(null!==t&&"object"==typeof t)for(const[o,a]of Object.entries(t))if(null!==a&&"object"==typeof a)this.findRecursiveInObject(a,e,r,(""===n?"":n+".")+o,i);else if(!(null!==e&&o!==e||null!==r&&a!==r)){i.push(n);break}return i}}r.default=e,"undefined"!=typeof window&&(window.hlp={},Object.getOwnPropertyNames(e).forEach(((t,r)=>{"length"!==t&&"name"!==t&&"prototype"!==t&&"caller"!==t&&"arguments"!==t&&(window.hlp[t]=e[t])})))}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1]);