Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@amaui/cookie

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@amaui/cookie - npm Package Compare versions

Comparing version 1.0.11111 to 1.0.11114

2

esm/index.js

@@ -1,2 +0,2 @@

/** @license AmauiCookie v1.0.11111
/** @license AmauiCookie v1.0.11114
*

@@ -3,0 +3,0 @@ * This source code is licensed under the MIT license found in the

{
"name": "@amaui/cookie",
"version": "1.0.11111",
"version": "1.0.11114",
"description": "Cookie",

@@ -29,4 +29,4 @@ "repository": "https://github.com/amaui-org/amaui-cookie.git",

"dependencies": {
"@amaui/date": "^1.0.11111",
"@amaui/utils": "^1.0.11111",
"@amaui/date": "^1.0.11114",
"@amaui/utils": "^1.0.11114",
"@babel/runtime": "^7.18.3"

@@ -33,0 +33,0 @@ },

@@ -22,3 +22,3 @@

<sub>Production ready&nbsp;&nbsp;&nbsp;&nbsp;</sub>
<sub>UMD 6.7kb gzipped&nbsp;&nbsp;&nbsp;&nbsp;</sub>
<sub>UMD 6.4kb gzipped&nbsp;&nbsp;&nbsp;&nbsp;</sub>
<sub>100% test cov&nbsp;&nbsp;&nbsp;&nbsp;</sub>

@@ -25,0 +25,0 @@ <sub>Browser</sub>

@@ -1,2 +0,2 @@

/** @license AmauiCookie v1.0.11111
/** @license AmauiCookie v1.0.11114
*

@@ -31,5 +31,2 @@ * This source code is licensed under the MIT license found in the

function ownKeys$2(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
function _objectSpread$2(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$2(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$2(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
const optionsDefault$8 = {}; // Multiple is methods instead of one,

@@ -43,5 +40,5 @@ // so it's lighter for tree shaking usability reasons

let options_ = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : optionsDefault$8;
const options = _objectSpread$2(_objectSpread$2({}, optionsDefault$8), options_);
const options = { ...optionsDefault$8,
...options_
};
const {

@@ -247,5 +244,2 @@ variant

function ownKeys$1(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$1(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$1(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
const optionsDefault$7 = {

@@ -260,5 +254,6 @@ copy: false,

let options_ = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : optionsDefault$7;
const options = { ...optionsDefault$7,
...options_
};
const options = _objectSpread$1(_objectSpread$1({}, optionsDefault$7), options_);
if (options.merge.array && is('array', target) && is('array', source)) {

@@ -317,6 +312,2 @@ const length = Math.max(target.length, source.length);

function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
const resolve = value => {

@@ -339,3 +330,4 @@ if (value === undefined) return 'undefined';

try {
if (is('object-like', value) && is('not-array-object', value) && value !== null) value = _objectSpread({}, value);
if (is('object-like', value) && is('not-array-object', value) && value !== null) value = { ...value
};
} catch (error) {}

@@ -1402,2 +1394,4 @@

class AmauiCache {
static caches = {};
static add(value) {

@@ -1432,4 +1426,2 @@ for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {

_defineProperty(AmauiCache, "caches", {});
const cleanValue = function (value_) {

@@ -1436,0 +1428,0 @@ let options_ = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : optionsDefault$4;

@@ -1,2 +0,2 @@

/** @license AmauiCookie v1.0.11111
/** @license AmauiCookie v1.0.11114
*

@@ -6,2 +6,2 @@ * This source code is licensed under the MIT license found in the

*/
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).AmauiCookie=t()}(this,(function(){"use strict";function e(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var t="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};function r(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function n(t){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?r(Object(o),!0).forEach((function(r){e(t,r,o[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):r(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}const o={},i=function(e){var t;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o;const c=n(n({},o),a),{variant:u}=c,l=r&&"object"==typeof r&&Object.getPrototypeOf(r);switch(e){case"string":return"string"==typeof r;case"number":return"number"==typeof r&&!Number.isNaN(r);case"boolean":return"boolean"==typeof r;case"array":return Array.isArray(r);case"object":return"object"==typeof r&&!!r&&r.constructor===Object;case"object-like":return"object"==typeof r&&(null===r||r.constructor!==Object);case"class":return("object"==typeof r||"function"==typeof r)&&(/class/gi.test(String(r))||/class/gi.test(String(null==r?void 0:r.constructor)));case"function":return!!(r&&r instanceof Function);case"async":return!(!i("function",r)||!(s("browser")?"AsyncFunction"===r.constructor.name:r()instanceof Promise));case"map":return!(l!==Map.prototype);case"weakmap":return!(l!==WeakMap.prototype);case"set":return!(l!==Set.prototype);case"weakset":return!(l!==WeakSet.prototype);case"promise":return!(l!==Promise.prototype);case"int8array":return!(l!==Int8Array.prototype);case"uint8array":return!(l!==Uint8Array.prototype);case"uint8clampedarray":return!(l!==Uint8ClampedArray.prototype);case"int16array":return!(l!==Int16Array.prototype);case"uint16array":return!(l!==Uint16Array.prototype);case"int32array":return!(l!==Int32Array.prototype);case"uint32array":return!(l!==Uint32Array.prototype);case"float32array":return!(l!==Float32Array.prototype);case"float64array":return!(l!==Float64Array.prototype);case"bigint64array":return!(l!==BigInt64Array.prototype);case"biguint64array":return!(l!==BigUint64Array.prototype);case"typedarray":return i("int8array",r)||i("uint8array",r)||i("uint8clampedarray",r)||i("int16array",r)||i("uint16array",r)||i("int32array",r)||i("uint32array",r)||i("float32array",r)||i("float64array",r)||i("bigint64array",r)||i("biguint64array",r);case"dataview":return!(l!==DataView.prototype);case"arraybuffer":return!(l!==ArrayBuffer.prototype);case"sharedarraybuffer":return"undefined"!=typeof SharedArrayBuffer&&!(l!==SharedArrayBuffer.prototype);case"symbol":return!("symbol"!=typeof r);case"error":return!!(r&&r instanceof Error);case"date":return!!(r&&r instanceof Date);case"regexp":return!!(r&&r instanceof RegExp);case"arguments":return!(!r||"[object Arguments]"!==r.toString());case"null":return null===r;case"undefined":return void 0===r;case"blob":return s("browser")&&r instanceof Blob;case"buffer":return!(!s("nodejs")||"function"!=typeof(null==r||null===(t=r.constructor)||void 0===t?void 0:t.isBuffer)||!r.constructor.isBuffer(r));case"element":if(r)switch(u){case void 0:case"html":case"element":return s("browser")&&("object"==typeof HTMLElement?r instanceof HTMLElement:r&&"object"==typeof r&&null!==r&&1===r.nodeType&&"string"==typeof r.nodeName);case"node":return s("browser")&&("object"==typeof Node?r instanceof Node:r&&"object"==typeof r&&null!==r&&"number"==typeof r.nodeType&&"string"==typeof r.nodeName);case"react":return r.elementType||r.hasOwnProperty("$$typeof");default:return!1}return!1;case"simple":return i("string",r,c)||i("number",r,c)||i("boolean",r,c)||i("undefined",r,c)||i("null",r,c);case"not-array-object":return!i("array",r,c)&&!i("object",r,c);default:return!1}},s=function(e){let r,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;switch(e){case"browser":return"undefined"!=typeof window&&void 0!==window.document;case"worker":return"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope;case"nodejs":return!(void 0===t||"undefined"==typeof module||!module.exports);case"localhost":return r=void 0!==n?n:s("browser")&&window.location.hostname,i("string",r)&&["localhost","127.0.0.1"].some((e=>r.indexOf(e)>-1));default:return!1}},a=e=>{if(i("array",e))return e.map((e=>a(e)));if(i("object",e)){const t={};return Object.keys(e).forEach((r=>t[r]=a(e[r]))),t}return e};var c=a;function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function l(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?u(Object(n),!0).forEach((function(r){e(t,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}const h={copy:!1,merge:{array:!1}},f=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:h;const n=l(l({},h),r);if(n.merge.array&&i("array",e)&&i("array",t)){const r=Math.max(e.length,t.length);for(let o=0;o<r;o++)void 0===e[o]&&(e[o]=t[o]),(i("object",e[o])&&i("object",t[o])||i("array",e[o])&&i("array",t[o]))&&(e[o]=f(e[o],t[o],n))}return i("object",e)&&i("object",t)&&Object.keys(t).forEach((r=>{e.hasOwnProperty(r)?i("object",e[r])&&i("object",t[r])&&(e[r]=f(e[r],t[r],n)):e[r]=n.copy?c(t[r]):t[r]})),e};var d=f;const p={decode:!1,decodeMethod:decodeURIComponent};var y=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:p;const r=d(t,p);let n=e;try{i("string",e)&&r.decode&&i("function",r.decodeMethod)&&(n=r.decodeMethod(e))}catch(e){}try{if(i("string",n)){if("undefined"===n)return;return"NaN"===n?NaN:JSON.parse(n)}return n}catch(e){}return n};function g(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}const v=(t,r)=>{let n=r(t);if(void 0===n)return"";try{i("object-like",n)&&i("not-array-object",n)&&null!==n&&(n=function(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?g(Object(n),!0).forEach((function(r){e(t,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):g(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},n))}catch(e){}return i("object",n)?"{".concat(Object.keys(n).sort().map((e=>'"'.concat(e,'":').concat(v(n[e],r)))).filter((e=>":"!==e.slice(-1))).join(","),"}"):i("array",n)?"[".concat(n.map((e=>v(e,r))).filter(Boolean).join(","),"]"):i("string",n)?'"'.concat(n,'"'):(e=>i("string",e)?e.replace(/(\s|\r|\n)+/," "):e)(JSON.stringify((e=>void 0===e?"undefined":e instanceof Function||e instanceof Object?e.toString():e)(n)))};var m=e=>{const t=new WeakSet;return v(e,(e=>{if("object"==typeof e&&null!==e){if(t.has(e))return;t.add(e)}return e}))};var w=e=>i("string",e)?"".concat(e.charAt(0).toUpperCase()).concat(e.slice(1)):e;var b={exports:{}},O={exports:{}};!function(e,r){var n;e.exports=(n=n||function(e,r){var n;if("undefined"!=typeof window&&window.crypto&&(n=window.crypto),"undefined"!=typeof self&&self.crypto&&(n=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(n=globalThis.crypto),!n&&"undefined"!=typeof window&&window.msCrypto&&(n=window.msCrypto),!n&&void 0!==t&&t.crypto&&(n=t.crypto),!n)try{n=require("crypto")}catch(e){}var o=function(){if(n){if("function"==typeof n.getRandomValues)try{return n.getRandomValues(new Uint32Array(1))[0]}catch(e){}if("function"==typeof n.randomBytes)try{return n.randomBytes(4).readInt32LE()}catch(e){}}throw new Error("Native crypto module could not be used to get secure random number.")},i=Object.create||function(){function e(){}return function(t){var r;return e.prototype=t,r=new e,e.prototype=null,r}}(),s={},a=s.lib={},c=a.Base={extend:function(e){var t=i(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},u=a.WordArray=c.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=t!=r?t:4*e.length},toString:function(e){return(e||h).stringify(this)},concat:function(e){var t=this.words,r=e.words,n=this.sigBytes,o=e.sigBytes;if(this.clamp(),n%4)for(var i=0;i<o;i++){var s=r[i>>>2]>>>24-i%4*8&255;t[n+i>>>2]|=s<<24-(n+i)%4*8}else for(var a=0;a<o;a+=4)t[n+a>>>2]=r[a>>>2];return this.sigBytes+=o,this},clamp:function(){var t=this.words,r=this.sigBytes;t[r>>>2]&=4294967295<<32-r%4*8,t.length=e.ceil(r/4)},clone:function(){var e=c.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],r=0;r<e;r+=4)t.push(o());return new u.init(t,e)}}),l=s.enc={},h=l.Hex={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],o=0;o<r;o++){var i=t[o>>>2]>>>24-o%4*8&255;n.push((i>>>4).toString(16)),n.push((15&i).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n<t;n+=2)r[n>>>3]|=parseInt(e.substr(n,2),16)<<24-n%8*4;return new u.init(r,t/2)}},f=l.Latin1={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],o=0;o<r;o++){var i=t[o>>>2]>>>24-o%4*8&255;n.push(String.fromCharCode(i))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n<t;n++)r[n>>>2]|=(255&e.charCodeAt(n))<<24-n%4*8;return new u.init(r,t)}},d=l.Utf8={stringify:function(e){try{return decodeURIComponent(escape(f.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return f.parse(unescape(encodeURIComponent(e)))}},p=a.BufferedBlockAlgorithm=c.extend({reset:function(){this._data=new u.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=d.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var r,n=this._data,o=n.words,i=n.sigBytes,s=this.blockSize,a=i/(4*s),c=(a=t?e.ceil(a):e.max((0|a)-this._minBufferSize,0))*s,l=e.min(4*c,i);if(c){for(var h=0;h<c;h+=s)this._doProcessBlock(o,h);r=o.splice(0,c),n.sigBytes-=l}return new u.init(r,l)},clone:function(){var e=c.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0});a.Hasher=p.extend({cfg:c.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){p.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,r){return new e.init(r).finalize(t)}},_createHmacHelper:function(e){return function(t,r){return new y.HMAC.init(e,r).finalize(t)}}});var y=s.algo={};return s}(Math),n)}(O),function(e,t){var r;e.exports=(r=O.exports,function(e){var t=r,n=t.lib,o=n.WordArray,i=n.Hasher,s=t.algo,a=[],c=[];!function(){function t(t){for(var r=e.sqrt(t),n=2;n<=r;n++)if(!(t%n))return!1;return!0}function r(e){return 4294967296*(e-(0|e))|0}for(var n=2,o=0;o<64;)t(n)&&(o<8&&(a[o]=r(e.pow(n,.5))),c[o]=r(e.pow(n,1/3)),o++),n++}();var u=[],l=s.SHA256=i.extend({_doReset:function(){this._hash=new o.init(a.slice(0))},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],o=r[1],i=r[2],s=r[3],a=r[4],l=r[5],h=r[6],f=r[7],d=0;d<64;d++){if(d<16)u[d]=0|e[t+d];else{var p=u[d-15],y=(p<<25|p>>>7)^(p<<14|p>>>18)^p>>>3,g=u[d-2],v=(g<<15|g>>>17)^(g<<13|g>>>19)^g>>>10;u[d]=y+u[d-7]+v+u[d-16]}var m=n&o^n&i^o&i,w=(n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22),b=f+((a<<26|a>>>6)^(a<<21|a>>>11)^(a<<7|a>>>25))+(a&l^~a&h)+c[d]+u[d];f=h,h=l,l=a,a=s+b|0,s=i,i=o,o=n,n=b+(w+m)|0}r[0]=r[0]+n|0,r[1]=r[1]+o|0,r[2]=r[2]+i|0,r[3]=r[3]+s|0,r[4]=r[4]+a|0,r[5]=r[5]+l|0,r[6]=r[6]+h|0,r[7]=r[7]+f|0},_doFinalize:function(){var t=this._data,r=t.words,n=8*this._nDataBytes,o=8*t.sigBytes;return r[o>>>5]|=128<<24-o%32,r[14+(o+64>>>9<<4)]=e.floor(n/4294967296),r[15+(o+64>>>9<<4)]=n,t.sigBytes=4*r.length,this._process(),this._hash},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA256=i._createHelper(l),t.HmacSHA256=i._createHmacHelper(l)}(Math),r.SHA256)}(b);var j=b.exports;const S={serialize:!0,withPrefix:!0};var A=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:S;const r=d(t,S);let n=e;return r.serialize&&(n=m(n)),n=j(n).toString(),r.withPrefix?"0x".concat(n):n};const _={filters:[",",".","-","_","s+"],replaceWith:" ",trim:!0};class k{static add(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];const o=A(r);this.caches[o]||(this.caches[o]=e)}static get(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];const n=A(t);return this.caches[n]}static has(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];const n=A(t);return this.caches.hasOwnProperty(n)}}e(k,"caches",{});var D=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:_;try{const r=d(t,_);if(k.has(e,r))return k.get(e,r);r.className&&(r.replaceWith="-",r.cammelCaseTransform=!0,r.lowercase=!0);const n=r=>k.add(r,e,t);if(i("string",e)){let t=e;if(r.url){const e=t.split("?").filter(Boolean);let r=e[0];const o=e[1];return"/"===r.slice(-1)&&(r=r.slice(0,-1)),t=o?[r,o].join("?"):r,n(t),t}return r.cammelCaseTransform&&(t=t.split(/(?=[A-Z])/g).join(r.replaceWith||" ")),r.filters.forEach((e=>{const n="\\".concat(e),o=new RegExp(n,"g");t=t.replace(o,r.replaceWith||" ")})),r.trim&&(t=t.trim()),r.capitalize&&(t=w(t)),r.lowercase&&(t=t.toLocaleLowerCase()),n(t),t}return n(e),e}catch(e){}return e};const P={valueOverride:!1},x=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:P;const o=d(n,P);if(!e&&!t)return e;if(i("string",t)){const n=t.split(".").filter(Boolean).map((e=>y(e)));return x(e,n,r,o)}if(i("array",t)){const n=t[0],s=D(String(n),{filters:[".",","],replaceWith:""});if(1!==t.length||void 0===r){e.hasOwnProperty(n)&&!o.valueOverride||(e[s]=i("number",t[1])?[]:{});const a=e[s];return i("object",a)||i("array",a)?x(e[n],t.slice(1),r,o):e}(i("array",e)&&i("number",n)||i("object",e)&&i("string",n))&&(e[i("string",n)?s:n]=r)}return e};var M=x;var B=()=>"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==t?t:void 0;const T={returnSame:!0};var N=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"JSON",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:T;const n=d(r,T);if("JSON"===t)try{return JSON.parse(e)}catch(e){if(n.log){var o;console.error("Parse JSON: ",e);const t=B();var i,s,a;if("test"===(null===(o=t.AMAUI)||void 0===o?void 0:o.env))null!==(i=t.AMAUI)&&void 0!==i&&null!==(s=i.test)&&void 0!==s&&null!==(a=s.parse)&&void 0!==a&&a.logs||M(t,"AMAUI.test.parse.logs",[]),t.AMAUI.test.parse.logs.push(e)}}if(n.returnSame)return e};const U={},C=["January","February","March","April","May","June","July","August","September","October","November","December"],I=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],H=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],W=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"];class E{static get utc(){return new E(new Date,{utc:!0})}static get daysInMonth(){return(new E).daysInMonth}static get valueOf(){return(new E).valueOf}static get unix(){return(new E).unix}static get milliseconds(){return(new E).milliseconds}static get iso(){return(new E).iso}static get amauidate(){return new E}static get local(){return(new E).local}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Date,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:U;this.value_=t,this.options=r,e(this,"value",void 0),e(this,"millisecond",void 0),e(this,"milliseconds",void 0),e(this,"second",void 0),e(this,"minute",void 0),e(this,"hour",void 0),e(this,"day",void 0),e(this,"dayWeek",void 0),e(this,"dayYear",void 0),e(this,"week",void 0),e(this,"month",void 0),e(this,"year",void 0),this.init()}init(){this.options=d(this.options,U),i("number",this.value_)&&10===String(this.value_).length&&(this.value_*=1e3),this.value=new Date(this.value_ instanceof E?this.value_.value:this.value_),this.valid&&(this.millisecond=this.value[this.options.utc?"getUTCMilliseconds":"getMilliseconds"](),this.milliseconds=this.value.getTime(),this.second=this.value[this.options.utc?"getUTCSeconds":"getSeconds"](),this.minute=this.value[this.options.utc?"getUTCMinutes":"getMinutes"](),this.hour=this.value[this.options.utc?"getUTCHours":"getHours"](),this.day=this.value[this.options.utc?"getUTCDate":"getDate"](),this.dayWeek=this.value[this.options.utc?"getUTCDay":"getDay"](),this.month=this.value[this.options.utc?"getUTCMonth":"getMonth"]()+1,this.year=this.value[this.options.utc?"getUTCFullYear":"getFullYear"](),this.dayYear=Math.floor((this.milliseconds-Number(new Date(this.year,0,0)))/1e3/60/60/24),this.weekValue())}weekValue(){const e=new Date(this.year,0,1);return e.setDate(e.getDate()+(1-e.getDay()%7)),this.week=Math.round((Number(this.value)-Number(e))/6048e5)+1,this.week}get months(){var e;return(null===(e=this.options.overrides)||void 0===e?void 0:e.months)||C}get monthsAbr(){var e;return(null===(e=this.options.overrides)||void 0===e?void 0:e.monthsAbr)||I}get daysWeek(){var e;return(null===(e=this.options.overrides)||void 0===e?void 0:e.daysWeek)||H}get daysWeekAbr(){var e;return(null===(e=this.options.overrides)||void 0===e?void 0:e.daysWeekAbr)||W}get valid(){return void 0===this.value_||this.value_ instanceof Date||this.value_ instanceof E||(e=new Date(this.value_).getTime(),Number.isInteger(e)&&String(e).length>=10&&(new Date(e).getTime()>0||new Date(1e3*e).getTime()>0));var e}get local(){if(this.valid)return new E(new Date(this.value.toLocaleString("en-us")))}get utc(){return new E(this.value,{utc:!0})}get iso(){if(this.valid)return this.value.toISOString()}get daysInMonth(){return new Date(this.year,this.month,0).getDate()}get weeksInYear(){const e=new Date(this.year,0,1),t=1===new Date(this.year,1,29).getMonth();return 4===e.getDay()||t&&3===e.getDay()?53:52}get valueOf(){return this.milliseconds}get unix(){if(this.valid)return Math.floor(this.value.getTime()/1e3)}timezone(e){if(this.valid&&e)return new E(this.value.toLocaleString("en-us",{timeZone:e}))}}const F={namespace:"AMAUI",namespace_separator:"_"};class J{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:F;e(this,"options",void 0),e(this,"removeNotAllowed",[]),this.options=d(t,F)}get namespace(){return"".concat(this.options.namespace).concat(this.options.namespace_separator)}static get cookie(){return s("browser")&&window.document.cookie||""}static get clear(){return J.cookie.split("; ").map((e=>e.split("=")[0])).forEach((e=>document.cookie="".concat(e,"=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/")))}get properties(){return Object.keys(this.items)}get values(){const e=this.items;return Object.keys(e).map((t=>e[t]))}get items(){if(s("browser")){const e={},t=J.cookie.split("; ").filter((e=>0===e.indexOf(this.namespace)));for(const r of t){const t=r.split("=");e[this.propertyOriginal(t[0])]=N(t.slice(1).join("="))}return e}}get clear(){return this.properties.filter((e=>-1===this.removeNotAllowed.indexOf(e)||-1===this.removeNotAllowed.indexOf(this.propertyOriginal(e)))).forEach((e=>this.remove(e)))}get(e){if(s("browser")){return this.items[e]}}has(e){if(s("browser")){return this.items.hasOwnProperty(e)}}add(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:364,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"/";if(s("browser")){const o=this.property(e),s=i("string",t)?t:m(t),a=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:E.amauidate;if(r&&r.valid)switch(t){case"millisecond":return new E(r.value.setMilliseconds(r.millisecond+e));case"second":return new E(r.value.setSeconds(r.second+e));case"minute":return new E(r.value.setMinutes(r.minute+e));case"hour":return new E(r.value.setHours(r.hour+e));case"day":return new E(r.value.setDate(r.day+e));case"week":return new E(r.value.setDate(r.day+7*e));case"month":return new E(r.value.setMonth(r.month-1+e));case"year":return new E(r.value.setFullYear(r.year+e))}}(r,"day").utc;document.cookie="".concat(o,"=").concat(s,"; expires=").concat(a,"; path=").concat(n)}}update(){return this.add(...arguments)}remove(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"/";if(s("browser")){this.items.hasOwnProperty(e)&&(document.cookie="".concat(this.property(e),"=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=").concat(t))}}property(e){return"".concat(this.namespace).concat(e)}propertyOriginal(e){return 0===e.indexOf(this.namespace)?e.slice(this.namespace.length):e}}return J}));
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).AmauiCookie=t()}(this,(function(){"use strict";function e(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var t="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};const r={},n=function(e){var t;let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:r;const s={...r,...a},{variant:c}=s,u=o&&"object"==typeof o&&Object.getPrototypeOf(o);switch(e){case"string":return"string"==typeof o;case"number":return"number"==typeof o&&!Number.isNaN(o);case"boolean":return"boolean"==typeof o;case"array":return Array.isArray(o);case"object":return"object"==typeof o&&!!o&&o.constructor===Object;case"object-like":return"object"==typeof o&&(null===o||o.constructor!==Object);case"class":return("object"==typeof o||"function"==typeof o)&&(/class/gi.test(String(o))||/class/gi.test(String(null==o?void 0:o.constructor)));case"function":return!!(o&&o instanceof Function);case"async":return!(!n("function",o)||!(i("browser")?"AsyncFunction"===o.constructor.name:o()instanceof Promise));case"map":return!(u!==Map.prototype);case"weakmap":return!(u!==WeakMap.prototype);case"set":return!(u!==Set.prototype);case"weakset":return!(u!==WeakSet.prototype);case"promise":return!(u!==Promise.prototype);case"int8array":return!(u!==Int8Array.prototype);case"uint8array":return!(u!==Uint8Array.prototype);case"uint8clampedarray":return!(u!==Uint8ClampedArray.prototype);case"int16array":return!(u!==Int16Array.prototype);case"uint16array":return!(u!==Uint16Array.prototype);case"int32array":return!(u!==Int32Array.prototype);case"uint32array":return!(u!==Uint32Array.prototype);case"float32array":return!(u!==Float32Array.prototype);case"float64array":return!(u!==Float64Array.prototype);case"bigint64array":return!(u!==BigInt64Array.prototype);case"biguint64array":return!(u!==BigUint64Array.prototype);case"typedarray":return n("int8array",o)||n("uint8array",o)||n("uint8clampedarray",o)||n("int16array",o)||n("uint16array",o)||n("int32array",o)||n("uint32array",o)||n("float32array",o)||n("float64array",o)||n("bigint64array",o)||n("biguint64array",o);case"dataview":return!(u!==DataView.prototype);case"arraybuffer":return!(u!==ArrayBuffer.prototype);case"sharedarraybuffer":return"undefined"!=typeof SharedArrayBuffer&&!(u!==SharedArrayBuffer.prototype);case"symbol":return!("symbol"!=typeof o);case"error":return!!(o&&o instanceof Error);case"date":return!!(o&&o instanceof Date);case"regexp":return!!(o&&o instanceof RegExp);case"arguments":return!(!o||"[object Arguments]"!==o.toString());case"null":return null===o;case"undefined":return void 0===o;case"blob":return i("browser")&&o instanceof Blob;case"buffer":return!(!i("nodejs")||"function"!=typeof(null==o||null===(t=o.constructor)||void 0===t?void 0:t.isBuffer)||!o.constructor.isBuffer(o));case"element":if(o)switch(c){case void 0:case"html":case"element":return i("browser")&&("object"==typeof HTMLElement?o instanceof HTMLElement:o&&"object"==typeof o&&null!==o&&1===o.nodeType&&"string"==typeof o.nodeName);case"node":return i("browser")&&("object"==typeof Node?o instanceof Node:o&&"object"==typeof o&&null!==o&&"number"==typeof o.nodeType&&"string"==typeof o.nodeName);case"react":return o.elementType||o.hasOwnProperty("$$typeof");default:return!1}return!1;case"simple":return n("string",o,s)||n("number",o,s)||n("boolean",o,s)||n("undefined",o,s)||n("null",o,s);case"not-array-object":return!n("array",o,s)&&!n("object",o,s);default:return!1}},i=function(e){let r,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;switch(e){case"browser":return"undefined"!=typeof window&&void 0!==window.document;case"worker":return"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope;case"nodejs":return!(void 0===t||"undefined"==typeof module||!module.exports);case"localhost":return r=void 0!==o?o:i("browser")&&window.location.hostname,n("string",r)&&["localhost","127.0.0.1"].some((e=>r.indexOf(e)>-1));default:return!1}},o=e=>{if(n("array",e))return e.map((e=>o(e)));if(n("object",e)){const t={};return Object.keys(e).forEach((r=>t[r]=o(e[r]))),t}return e};var a=o;const s={copy:!1,merge:{array:!1}},c=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:s;const i={...s,...r};if(i.merge.array&&n("array",e)&&n("array",t)){const r=Math.max(e.length,t.length);for(let o=0;o<r;o++)void 0===e[o]&&(e[o]=t[o]),(n("object",e[o])&&n("object",t[o])||n("array",e[o])&&n("array",t[o]))&&(e[o]=c(e[o],t[o],i))}return n("object",e)&&n("object",t)&&Object.keys(t).forEach((r=>{e.hasOwnProperty(r)?n("object",e[r])&&n("object",t[r])&&(e[r]=c(e[r],t[r],i)):e[r]=i.copy?a(t[r]):t[r]})),e};var u=c;const l={decode:!1,decodeMethod:decodeURIComponent};var h=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l;const r=u(t,l);let i=e;try{n("string",e)&&r.decode&&n("function",r.decodeMethod)&&(i=r.decodeMethod(e))}catch(e){}try{if(n("string",i)){if("undefined"===i)return;return"NaN"===i?NaN:JSON.parse(i)}return i}catch(e){}return i};const d=(e,t)=>{let r=t(e);if(void 0===r)return"";try{n("object-like",r)&&n("not-array-object",r)&&null!==r&&(r={...r})}catch(e){}return n("object",r)?"{".concat(Object.keys(r).sort().map((e=>'"'.concat(e,'":').concat(d(r[e],t)))).filter((e=>":"!==e.slice(-1))).join(","),"}"):n("array",r)?"[".concat(r.map((e=>d(e,t))).filter(Boolean).join(","),"]"):n("string",r)?'"'.concat(r,'"'):(e=>n("string",e)?e.replace(/(\s|\r|\n)+/," "):e)(JSON.stringify((e=>void 0===e?"undefined":e instanceof Function||e instanceof Object?e.toString():e)(r)))};var f=e=>{const t=new WeakSet;return d(e,(e=>{if("object"==typeof e&&null!==e){if(t.has(e))return;t.add(e)}return e}))};var p=e=>n("string",e)?"".concat(e.charAt(0).toUpperCase()).concat(e.slice(1)):e;var y={exports:{}},v={exports:{}};!function(e,r){var n;e.exports=(n=n||function(e,r){var n;if("undefined"!=typeof window&&window.crypto&&(n=window.crypto),"undefined"!=typeof self&&self.crypto&&(n=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(n=globalThis.crypto),!n&&"undefined"!=typeof window&&window.msCrypto&&(n=window.msCrypto),!n&&void 0!==t&&t.crypto&&(n=t.crypto),!n)try{n=require("crypto")}catch(e){}var i=function(){if(n){if("function"==typeof n.getRandomValues)try{return n.getRandomValues(new Uint32Array(1))[0]}catch(e){}if("function"==typeof n.randomBytes)try{return n.randomBytes(4).readInt32LE()}catch(e){}}throw new Error("Native crypto module could not be used to get secure random number.")},o=Object.create||function(){function e(){}return function(t){var r;return e.prototype=t,r=new e,e.prototype=null,r}}(),a={},s=a.lib={},c=s.Base={extend:function(e){var t=o(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},u=s.WordArray=c.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=t!=r?t:4*e.length},toString:function(e){return(e||h).stringify(this)},concat:function(e){var t=this.words,r=e.words,n=this.sigBytes,i=e.sigBytes;if(this.clamp(),n%4)for(var o=0;o<i;o++){var a=r[o>>>2]>>>24-o%4*8&255;t[n+o>>>2]|=a<<24-(n+o)%4*8}else for(var s=0;s<i;s+=4)t[n+s>>>2]=r[s>>>2];return this.sigBytes+=i,this},clamp:function(){var t=this.words,r=this.sigBytes;t[r>>>2]&=4294967295<<32-r%4*8,t.length=e.ceil(r/4)},clone:function(){var e=c.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],r=0;r<e;r+=4)t.push(i());return new u.init(t,e)}}),l=a.enc={},h=l.Hex={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i<r;i++){var o=t[i>>>2]>>>24-i%4*8&255;n.push((o>>>4).toString(16)),n.push((15&o).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n<t;n+=2)r[n>>>3]|=parseInt(e.substr(n,2),16)<<24-n%8*4;return new u.init(r,t/2)}},d=l.Latin1={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i<r;i++){var o=t[i>>>2]>>>24-i%4*8&255;n.push(String.fromCharCode(o))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n<t;n++)r[n>>>2]|=(255&e.charCodeAt(n))<<24-n%4*8;return new u.init(r,t)}},f=l.Utf8={stringify:function(e){try{return decodeURIComponent(escape(d.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return d.parse(unescape(encodeURIComponent(e)))}},p=s.BufferedBlockAlgorithm=c.extend({reset:function(){this._data=new u.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=f.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var r,n=this._data,i=n.words,o=n.sigBytes,a=this.blockSize,s=o/(4*a),c=(s=t?e.ceil(s):e.max((0|s)-this._minBufferSize,0))*a,l=e.min(4*c,o);if(c){for(var h=0;h<c;h+=a)this._doProcessBlock(i,h);r=i.splice(0,c),n.sigBytes-=l}return new u.init(r,l)},clone:function(){var e=c.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0});s.Hasher=p.extend({cfg:c.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){p.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,r){return new e.init(r).finalize(t)}},_createHmacHelper:function(e){return function(t,r){return new y.HMAC.init(e,r).finalize(t)}}});var y=a.algo={};return a}(Math),n)}(v),function(e,t){var r;e.exports=(r=v.exports,function(e){var t=r,n=t.lib,i=n.WordArray,o=n.Hasher,a=t.algo,s=[],c=[];!function(){function t(t){for(var r=e.sqrt(t),n=2;n<=r;n++)if(!(t%n))return!1;return!0}function r(e){return 4294967296*(e-(0|e))|0}for(var n=2,i=0;i<64;)t(n)&&(i<8&&(s[i]=r(e.pow(n,.5))),c[i]=r(e.pow(n,1/3)),i++),n++}();var u=[],l=a.SHA256=o.extend({_doReset:function(){this._hash=new i.init(s.slice(0))},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],i=r[1],o=r[2],a=r[3],s=r[4],l=r[5],h=r[6],d=r[7],f=0;f<64;f++){if(f<16)u[f]=0|e[t+f];else{var p=u[f-15],y=(p<<25|p>>>7)^(p<<14|p>>>18)^p>>>3,v=u[f-2],g=(v<<15|v>>>17)^(v<<13|v>>>19)^v>>>10;u[f]=y+u[f-7]+g+u[f-16]}var m=n&i^n&o^i&o,w=(n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22),b=d+((s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25))+(s&l^~s&h)+c[f]+u[f];d=h,h=l,l=s,s=a+b|0,a=o,o=i,i=n,n=b+(w+m)|0}r[0]=r[0]+n|0,r[1]=r[1]+i|0,r[2]=r[2]+o|0,r[3]=r[3]+a|0,r[4]=r[4]+s|0,r[5]=r[5]+l|0,r[6]=r[6]+h|0,r[7]=r[7]+d|0},_doFinalize:function(){var t=this._data,r=t.words,n=8*this._nDataBytes,i=8*t.sigBytes;return r[i>>>5]|=128<<24-i%32,r[14+(i+64>>>9<<4)]=e.floor(n/4294967296),r[15+(i+64>>>9<<4)]=n,t.sigBytes=4*r.length,this._process(),this._hash},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA256=o._createHelper(l),t.HmacSHA256=o._createHmacHelper(l)}(Math),r.SHA256)}(y);var g=y.exports;const m={serialize:!0,withPrefix:!0};var w=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:m;const r=u(t,m);let n=e;return r.serialize&&(n=f(n)),n=g(n).toString(),r.withPrefix?"0x".concat(n):n};const b={filters:[",",".","-","_","s+"],replaceWith:" ",trim:!0};class A{static caches={};static add(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];const i=w(r);this.caches[i]||(this.caches[i]=e)}static get(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];const n=w(t);return this.caches[n]}static has(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];const n=w(t);return this.caches.hasOwnProperty(n)}}var S=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:b;try{const r=u(t,b);if(A.has(e,r))return A.get(e,r);r.className&&(r.replaceWith="-",r.cammelCaseTransform=!0,r.lowercase=!0);const i=r=>A.add(r,e,t);if(n("string",e)){let t=e;if(r.url){const e=t.split("?").filter(Boolean);let r=e[0];const n=e[1];return"/"===r.slice(-1)&&(r=r.slice(0,-1)),t=n?[r,n].join("?"):r,i(t),t}return r.cammelCaseTransform&&(t=t.split(/(?=[A-Z])/g).join(r.replaceWith||" ")),r.filters.forEach((e=>{const n="\\".concat(e),i=new RegExp(n,"g");t=t.replace(i,r.replaceWith||" ")})),r.trim&&(t=t.trim()),r.capitalize&&(t=p(t)),r.lowercase&&(t=t.toLocaleLowerCase()),i(t),t}return i(e),e}catch(e){}return e};const j={valueOverride:!1},_=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:j;const o=u(i,j);if(!e&&!t)return e;if(n("string",t)){const n=t.split(".").filter(Boolean).map((e=>h(e)));return _(e,n,r,o)}if(n("array",t)){const i=t[0],a=S(String(i),{filters:[".",","],replaceWith:""});if(1!==t.length||void 0===r){e.hasOwnProperty(i)&&!o.valueOverride||(e[a]=n("number",t[1])?[]:{});const s=e[a];return n("object",s)||n("array",s)?_(e[i],t.slice(1),r,o):e}(n("array",e)&&n("number",i)||n("object",e)&&n("string",i))&&(e[n("string",i)?a:i]=r)}return e};var O=_;var k=()=>"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==t?t:void 0;const x={returnSame:!0};var M=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"JSON",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:x;const n=u(r,x);if("JSON"===t)try{return JSON.parse(e)}catch(e){if(n.log){var i;console.error("Parse JSON: ",e);const t=k();var o,a,s;if("test"===(null===(i=t.AMAUI)||void 0===i?void 0:i.env))null!==(o=t.AMAUI)&&void 0!==o&&null!==(a=o.test)&&void 0!==a&&null!==(s=a.parse)&&void 0!==s&&s.logs||O(t,"AMAUI.test.parse.logs",[]),t.AMAUI.test.parse.logs.push(e)}}if(n.returnSame)return e};const B={},T=["January","February","March","April","May","June","July","August","September","October","November","December"],D=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],N=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],U=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"];class C{static get utc(){return new C(new Date,{utc:!0})}static get daysInMonth(){return(new C).daysInMonth}static get valueOf(){return(new C).valueOf}static get unix(){return(new C).unix}static get milliseconds(){return(new C).milliseconds}static get iso(){return(new C).iso}static get amauidate(){return new C}static get local(){return(new C).local}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Date,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:B;this.value_=t,this.options=r,e(this,"value",void 0),e(this,"millisecond",void 0),e(this,"milliseconds",void 0),e(this,"second",void 0),e(this,"minute",void 0),e(this,"hour",void 0),e(this,"day",void 0),e(this,"dayWeek",void 0),e(this,"dayYear",void 0),e(this,"week",void 0),e(this,"month",void 0),e(this,"year",void 0),this.init()}init(){this.options=u(this.options,B),n("number",this.value_)&&10===String(this.value_).length&&(this.value_*=1e3),this.value=new Date(this.value_ instanceof C?this.value_.value:this.value_),this.valid&&(this.millisecond=this.value[this.options.utc?"getUTCMilliseconds":"getMilliseconds"](),this.milliseconds=this.value.getTime(),this.second=this.value[this.options.utc?"getUTCSeconds":"getSeconds"](),this.minute=this.value[this.options.utc?"getUTCMinutes":"getMinutes"](),this.hour=this.value[this.options.utc?"getUTCHours":"getHours"](),this.day=this.value[this.options.utc?"getUTCDate":"getDate"](),this.dayWeek=this.value[this.options.utc?"getUTCDay":"getDay"](),this.month=this.value[this.options.utc?"getUTCMonth":"getMonth"]()+1,this.year=this.value[this.options.utc?"getUTCFullYear":"getFullYear"](),this.dayYear=Math.floor((this.milliseconds-Number(new Date(this.year,0,0)))/1e3/60/60/24),this.weekValue())}weekValue(){const e=new Date(this.year,0,1);return e.setDate(e.getDate()+(1-e.getDay()%7)),this.week=Math.round((Number(this.value)-Number(e))/6048e5)+1,this.week}get months(){var e;return(null===(e=this.options.overrides)||void 0===e?void 0:e.months)||T}get monthsAbr(){var e;return(null===(e=this.options.overrides)||void 0===e?void 0:e.monthsAbr)||D}get daysWeek(){var e;return(null===(e=this.options.overrides)||void 0===e?void 0:e.daysWeek)||N}get daysWeekAbr(){var e;return(null===(e=this.options.overrides)||void 0===e?void 0:e.daysWeekAbr)||U}get valid(){return void 0===this.value_||this.value_ instanceof Date||this.value_ instanceof C||(e=new Date(this.value_).getTime(),Number.isInteger(e)&&String(e).length>=10&&(new Date(e).getTime()>0||new Date(1e3*e).getTime()>0));var e}get local(){if(this.valid)return new C(new Date(this.value.toLocaleString("en-us")))}get utc(){return new C(this.value,{utc:!0})}get iso(){if(this.valid)return this.value.toISOString()}get daysInMonth(){return new Date(this.year,this.month,0).getDate()}get weeksInYear(){const e=new Date(this.year,0,1),t=1===new Date(this.year,1,29).getMonth();return 4===e.getDay()||t&&3===e.getDay()?53:52}get valueOf(){return this.milliseconds}get unix(){if(this.valid)return Math.floor(this.value.getTime()/1e3)}timezone(e){if(this.valid&&e)return new C(this.value.toLocaleString("en-us",{timeZone:e}))}}const I={namespace:"AMAUI",namespace_separator:"_"};class H{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:I;e(this,"options",void 0),e(this,"removeNotAllowed",[]),this.options=u(t,I)}get namespace(){return"".concat(this.options.namespace).concat(this.options.namespace_separator)}static get cookie(){return i("browser")&&window.document.cookie||""}static get clear(){return H.cookie.split("; ").map((e=>e.split("=")[0])).forEach((e=>document.cookie="".concat(e,"=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/")))}get properties(){return Object.keys(this.items)}get values(){const e=this.items;return Object.keys(e).map((t=>e[t]))}get items(){if(i("browser")){const e={},t=H.cookie.split("; ").filter((e=>0===e.indexOf(this.namespace)));for(const r of t){const t=r.split("=");e[this.propertyOriginal(t[0])]=M(t.slice(1).join("="))}return e}}get clear(){return this.properties.filter((e=>-1===this.removeNotAllowed.indexOf(e)||-1===this.removeNotAllowed.indexOf(this.propertyOriginal(e)))).forEach((e=>this.remove(e)))}get(e){if(i("browser")){return this.items[e]}}has(e){if(i("browser")){return this.items.hasOwnProperty(e)}}add(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:364,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"/";if(i("browser")){const i=this.property(e),a=n("string",t)?t:f(t),s=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:C.amauidate;if(r&&r.valid)switch(t){case"millisecond":return new C(r.value.setMilliseconds(r.millisecond+e));case"second":return new C(r.value.setSeconds(r.second+e));case"minute":return new C(r.value.setMinutes(r.minute+e));case"hour":return new C(r.value.setHours(r.hour+e));case"day":return new C(r.value.setDate(r.day+e));case"week":return new C(r.value.setDate(r.day+7*e));case"month":return new C(r.value.setMonth(r.month-1+e));case"year":return new C(r.value.setFullYear(r.year+e))}}(r,"day").utc;document.cookie="".concat(i,"=").concat(a,"; expires=").concat(s,"; path=").concat(o)}}update(){return this.add(...arguments)}remove(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"/";if(i("browser")){this.items.hasOwnProperty(e)&&(document.cookie="".concat(this.property(e),"=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=").concat(t))}}property(e){return"".concat(this.namespace).concat(e)}propertyOriginal(e){return 0===e.indexOf(this.namespace)?e.slice(this.namespace.length):e}}return H}));
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc