@amaui/cookie
Advanced tools
Comparing version 1.0.1111 to 1.0.11111
@@ -1,2 +0,2 @@ | ||
/** @license AmauiCookie v1.0.1111 | ||
/** @license AmauiCookie v1.0.11111 | ||
* | ||
@@ -3,0 +3,0 @@ * This source code is licensed under the MIT license found in the |
{ | ||
"name": "@amaui/cookie", | ||
"version": "1.0.1111", | ||
"version": "1.0.11111", | ||
"description": "Cookie", | ||
@@ -29,4 +29,4 @@ "repository": "https://github.com/amaui-org/amaui-cookie.git", | ||
"dependencies": { | ||
"@amaui/date": "^1.0.1111", | ||
"@amaui/utils": "^1.0.1874", | ||
"@amaui/date": "^1.0.11111", | ||
"@amaui/utils": "^1.0.11111", | ||
"@babel/runtime": "^7.18.3" | ||
@@ -33,0 +33,0 @@ }, |
@@ -22,3 +22,3 @@ | ||
<sub>Production ready </sub> | ||
<sub>UMD 6.6kb gzipped </sub> | ||
<sub>UMD 6.7kb gzipped </sub> | ||
<sub>100% test cov </sub> | ||
@@ -25,0 +25,0 @@ <sub>Browser</sub> |
@@ -1,2 +0,2 @@ | ||
/** @license AmauiCookie v1.0.1111 | ||
/** @license AmauiCookie v1.0.11111 | ||
* | ||
@@ -31,5 +31,5 @@ * This source code is licensed under the MIT license found in the | ||
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 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$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; } | ||
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, | ||
@@ -44,3 +44,3 @@ // so it's lighter for tree shaking usability reasons | ||
const options = _objectSpread$1(_objectSpread$1({}, optionsDefault$8), options_); | ||
const options = _objectSpread$2(_objectSpread$2({}, optionsDefault$8), options_); | ||
@@ -247,5 +247,5 @@ const { | ||
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 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(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; } | ||
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 = { | ||
@@ -261,3 +261,3 @@ copy: false, | ||
const options = _objectSpread(_objectSpread({}, optionsDefault$7), options_); | ||
const options = _objectSpread$1(_objectSpread$1({}, optionsDefault$7), options_); | ||
@@ -317,2 +317,6 @@ if (options.merge.array && is('array', target) && is('array', source)) { | ||
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 => { | ||
@@ -330,5 +334,10 @@ if (value === undefined) return 'undefined'; | ||
const serializeValue = (value_, method) => { | ||
const value = method(value_); // Ref circular value | ||
let value = method(value_); // Ref circular value | ||
if (value === undefined) return ''; | ||
if (value === undefined) return ''; // Is object-like make into an object | ||
try { | ||
if (is('object-like', value) && is('not-array-object', value) && value !== null) value = _objectSpread({}, value); | ||
} catch (error) {} | ||
if (is('object', value)) return "{".concat(Object.keys(value).sort().map(key => "\"".concat(key, "\":").concat(serializeValue(value[key], method))).filter(item => item.slice(-1) !== ':').join(','), "}"); | ||
@@ -335,0 +344,0 @@ if (is('array', value)) return "[".concat(value.map(value__ => serializeValue(value__, method)).filter(Boolean).join(','), "]"); |
@@ -1,2 +0,2 @@ | ||
/** @license AmauiCookie v1.0.1111 | ||
/** @license AmauiCookie v1.0.11111 | ||
* | ||
@@ -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}},d=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]=d(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]=d(e[r],t[r],n)):e[r]=n.copy?c(t[r]):t[r]})),e};var f=d;const p={decode:!1,decodeMethod:decodeURIComponent};var y=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:p;const r=f(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};const g=(e,t)=>{const r=t(e);return void 0===r?"":i("object",r)?"{".concat(Object.keys(r).sort().map((e=>'"'.concat(e,'":').concat(g(r[e],t)))).filter((e=>":"!==e.slice(-1))).join(","),"}"):i("array",r)?"[".concat(r.map((e=>g(e,t))).filter(Boolean).join(","),"]"):i("string",r)?'"'.concat(r,'"'):(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)(r)))};var v=e=>{const t=new WeakSet;return g(e,(e=>{if("object"==typeof e&&null!==e){if(t.has(e))return;t.add(e)}return e}))};var m=e=>i("string",e)?"".concat(e.charAt(0).toUpperCase()).concat(e.slice(1)):e;var w={exports:{}},b={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)}},d=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)}},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=a.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,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)}(b),function(e,t){var r;e.exports=(r=b.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],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,g=u[f-2],v=(g<<15|g>>>17)^(g<<13|g>>>19)^g>>>10;u[f]=y+u[f-7]+v+u[f-16]}var m=n&o^n&i^o&i,w=(n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22),b=d+((a<<26|a>>>6)^(a<<21|a>>>11)^(a<<7|a>>>25))+(a&l^~a&h)+c[f]+u[f];d=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]+d|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)}(w);var O=w.exports;const j={serialize:!0,withPrefix:!0};var A=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:j;const r=f(t,j);let n=e;return r.serialize&&(n=v(n)),n=O(n).toString(),r.withPrefix?"0x".concat(n):n};const S={filters:[",",".","-","_","s+"],replaceWith:" ",trim:!0};class _{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(_,"caches",{});var k=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:S;try{const r=f(t,S);if(_.has(e,r))return _.get(e,r);r.className&&(r.replaceWith="-",r.cammelCaseTransform=!0,r.lowercase=!0);const n=r=>_.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=m(t)),r.lowercase&&(t=t.toLocaleLowerCase()),n(t),t}return n(e),e}catch(e){}return e};const x={valueOverride:!1},D=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]:x;const o=f(n,x);if(!e&&!t)return e;if(i("string",t)){const n=t.split(".").filter(Boolean).map((e=>y(e)));return D(e,n,r,o)}if(i("array",t)){const n=t[0],s=k(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)?D(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=D;var B=()=>"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==t?t:void 0;const P={returnSame:!0};var T=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"JSON",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:P;const n=f(r,P);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 N={},U=["January","February","March","April","May","June","July","August","September","October","November","December"],C=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],I=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],H=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"];class W{static get utc(){return new W(new Date,{utc:!0})}static get daysInMonth(){return(new W).daysInMonth}static get valueOf(){return(new W).valueOf}static get unix(){return(new W).unix}static get milliseconds(){return(new W).milliseconds}static get iso(){return(new W).iso}static get amauidate(){return new W}static get local(){return(new W).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]:N;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=f(this.options,N),i("number",this.value_)&&10===String(this.value_).length&&(this.value_*=1e3),this.value=new Date(this.value_ instanceof W?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)||U}get monthsAbr(){var e;return(null===(e=this.options.overrides)||void 0===e?void 0:e.monthsAbr)||C}get daysWeek(){var e;return(null===(e=this.options.overrides)||void 0===e?void 0:e.daysWeek)||I}get daysWeekAbr(){var e;return(null===(e=this.options.overrides)||void 0===e?void 0:e.daysWeekAbr)||H}get valid(){return void 0===this.value_||this.value_ instanceof Date||this.value_ instanceof W||(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 W(new Date(this.value.toLocaleString("en-us")))}get utc(){return new W(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 W(this.value.toLocaleString("en-us",{timeZone:e}))}}const E={namespace:"AMAUI",namespace_separator:"_"};class F{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:E;e(this,"options",void 0),e(this,"removeNotAllowed",[]),this.options=f(t,E)}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 F.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=F.cookie.split("; ").filter((e=>0===e.indexOf(this.namespace)));for(const r of t){const t=r.split("=");e[this.propertyOriginal(t[0])]=T(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:v(t),a=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:W.amauidate;if(r&&r.valid)switch(t){case"millisecond":return new W(r.value.setMilliseconds(r.millisecond+e));case"second":return new W(r.value.setSeconds(r.second+e));case"minute":return new W(r.value.setMinutes(r.minute+e));case"hour":return new W(r.value.setHours(r.hour+e));case"day":return new W(r.value.setDate(r.day+e));case"week":return new W(r.value.setDate(r.day+7*e));case"month":return new W(r.value.setMonth(r.month-1+e));case"year":return new W(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 F})); | ||
!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})); |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
95270
1836
0
Updated@amaui/date@^1.0.11111
Updated@amaui/utils@^1.0.11111