UNPKG

@salla.sa/twilight-components

Version:
4 lines 393 kB
var __extends=this&&this.__extends||function(){var t=function(n,r){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var r in n)if(Object.prototype.hasOwnProperty.call(n,r))t[r]=n[r]};return t(n,r)};return function(n,r){if(typeof r!=="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(n,r);function e(){this.constructor=n}n.prototype=r===null?Object.create(r):(e.prototype=r.prototype,new e)}}();var __assign=this&&this.__assign||function(){__assign=Object.assign||function(t){for(var n,r=1,e=arguments.length;r<e;r++){n=arguments[r];for(var i in n)if(Object.prototype.hasOwnProperty.call(n,i))t[i]=n[i]}return t};return __assign.apply(this,arguments)};var __awaiter=this&&this.__awaiter||function(t,n,r,e){function i(t){return t instanceof r?t:new r((function(n){n(t)}))}return new(r||(r=Promise))((function(r,a){function o(t){try{s(e.next(t))}catch(t){a(t)}}function u(t){try{s(e["throw"](t))}catch(t){a(t)}}function s(t){t.done?r(t.value):i(t.value).then(o,u)}s((e=e.apply(t,n||[])).next())}))};var __generator=this&&this.__generator||function(t,n){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},e,i,a,o;return o={next:u(0),throw:u(1),return:u(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function u(t){return function(n){return s([t,n])}}function s(u){if(e)throw new TypeError("Generator is already executing.");while(o&&(o=0,u[0]&&(r=0)),r)try{if(e=1,i&&(a=u[0]&2?i["return"]:u[0]?i["throw"]||((a=i["return"])&&a.call(i),0):i.next)&&!(a=a.call(i,u[1])).done)return a;if(i=0,a)u=[u[0]&2,a.value];switch(u[0]){case 0:case 1:a=u;break;case 4:r.label++;return{value:u[1],done:false};case 5:r.label++;i=u[1];u=[0];continue;case 7:u=r.ops.pop();r.trys.pop();continue;default:if(!(a=r.trys,a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){r.label=u[1];break}if(u[0]===6&&r.label<a[1]){r.label=a[1];a=u;break}if(a&&r.label<a[2]){r.label=a[2];r.ops.push(u);break}if(a[2])r.ops.pop();r.trys.pop();continue}u=n.call(t,r)}catch(t){u=[6,t];i=0}finally{e=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:true}}};var __asyncValues=this&&this.__asyncValues||function(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=t[Symbol.asyncIterator],r;return n?n.call(t):(t=typeof __values==="function"?__values(t):t[Symbol.iterator](),r={},e("next"),e("throw"),e("return"),r[Symbol.asyncIterator]=function(){return this},r);function e(n){r[n]=t[n]&&function(r){return new Promise((function(e,a){r=t[n](r),i(e,a,r.done,r.value)}))}}function i(t,n,r,e){Promise.resolve(e).then((function(n){t({value:n,done:r})}),n)}};var __await=this&&this.__await||function(t){return this instanceof __await?(this.v=t,this):new __await(t)};var __asyncDelegator=this&&this.__asyncDelegator||function(t){var n,r;return n={},e("next"),e("throw",(function(t){throw t})),e("return"),n[Symbol.iterator]=function(){return this},n;function e(e,i){n[e]=t[e]?function(n){return(r=!r)?{value:__await(t[e](n)),done:false}:i?i(n):n}:i}};var __asyncGenerator=this&&this.__asyncGenerator||function(t,n,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=r.apply(t,n||[]),i,a=[];return i={},u("next"),u("throw"),u("return",o),i[Symbol.asyncIterator]=function(){return this},i;function o(t){return function(n){return Promise.resolve(n).then(t,l)}}function u(t,n){if(e[t]){i[t]=function(n){return new Promise((function(r,e){a.push([t,n,r,e])>1||s(t,n)}))};if(n)i[t]=n(i[t])}}function s(t,n){try{f(e[t](n))}catch(t){d(a[0][3],t)}}function f(t){t.value instanceof __await?Promise.resolve(t.value.v).then(c,l):d(a[0][2],t)}function c(t){s("next",t)}function l(t){s("throw",t)}function d(t,n){if(t(n),a.shift(),a.length)s(a[0][0],a[0][1])}};var __spreadArray=this&&this.__spreadArray||function(t,n,r){if(r||arguments.length===2)for(var e=0,i=n.length,a;e<i;e++){if(a||!(e in n)){if(!a)a=Array.prototype.slice.call(n,0,e);a[e]=n[e]}}return t.concat(a||Array.prototype.slice.call(n))};var __values=this&&this.__values||function(t){var n=typeof Symbol==="function"&&Symbol.iterator,r=n&&t[n],e=0;if(r)return r.call(t);if(t&&typeof t.length==="number")return{next:function(){if(t&&e>=t.length)t=void 0;return{value:t&&t[e++],done:!t}}};throw new TypeError(n?"Object is not iterable.":"Symbol.iterator is not defined.")}; /*! * Crafted with ❤ by Salla */System.register([],(function(t,n){"use strict";return{execute:function(){var r;var e=this;function i(t,n){n.forEach((function(n){n&&typeof n!=="string"&&!Array.isArray(n)&&Object.keys(n).forEach((function(r){if(r!=="default"&&!(r in t)){var e=Object.getOwnPropertyDescriptor(n,r);Object.defineProperty(t,r,e.get?e:{enumerable:true,get:function(){return n[r]}})}}))}));return Object.freeze(t)}t({B:na,a:K,f:Q,i:Wa,n:y});var a="twilight";var o={hydratedSelectorName:"hydrated",lazyLoad:true,shadowDom:false,slotRelocation:true,updatable:true};var u=t("d",typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{});function s(){throw new Error("setTimeout has not been defined")}function f(){throw new Error("clearTimeout has not been defined")}var c=s;var l=f;if(typeof u.setTimeout==="function"){c=setTimeout}if(typeof u.clearTimeout==="function"){l=clearTimeout}function d(t){if(c===setTimeout){return setTimeout(t,0)}if((c===s||!c)&&setTimeout){c=setTimeout;return setTimeout(t,0)}try{return c(t,0)}catch(n){try{return c.call(null,t,0)}catch(n){return c.call(this,t,0)}}}function v(t){if(l===clearTimeout){return clearTimeout(t)}if((l===f||!l)&&clearTimeout){l=clearTimeout;return clearTimeout(t)}try{return l(t)}catch(n){try{return l.call(null,t)}catch(n){return l.call(this,t)}}}var h=[];var p=false;var g;var m=-1;function b(){if(!p||!g){return}p=false;if(g.length){h=g.concat(h)}else{m=-1}if(h.length){w()}}function w(){if(p){return}var t=d(b);p=true;var n=h.length;while(n){g=h;h=[];while(++m<n){if(g){g[m].run()}}m=-1;n=h.length}g=null;p=false;v(t)}function y(t){var n=new Array(arguments.length-1);if(arguments.length>1){for(var r=1;r<arguments.length;r++){n[r-1]=arguments[r]}}h.push(new _(t,n));if(h.length===1&&!p){d(w)}}function _(t,n){this.fun=t;this.array=n}_.prototype.run=function(){this.fun.apply(null,this.array)};var S="browser";var j="browser";var k=true;var x={};var O=[];var E="";var I={};var A={};var T={};function P(){}var z=P;var R=P;var F=P;var U=P;var N=P;var C=P;var D=P;function $(t){throw new Error("process.binding is not supported")}function L(){return"/"}function M(t){throw new Error("process.chdir is not supported")}function q(){return 0}var B=u.performance||{};var J=B.now||B.mozNow||B.msNow||B.oNow||B.webkitNow||function(){return(new Date).getTime()};function G(t){var n=J.call(B)*.001;var r=Math.floor(n);var e=Math.floor(n%1*1e9);if(t){r=r-t[0];e=e-t[1];if(e<0){r--;e+=1e9}}return[r,e]}var V=new Date;function H(){var t=new Date;var n=t-V;return n/1e3}var W=t("e",{nextTick:y,title:S,browser:k,env:x,argv:O,version:E,versions:I,on:z,addListener:R,once:F,off:U,removeListener:N,removeAllListeners:C,emit:D,binding:$,cwd:L,chdir:M,umask:q,hrtime:G,platform:j,release:A,config:T,uptime:H});var X=typeof globalThis!=="undefined"?globalThis:typeof window!=="undefined"?window:typeof global!=="undefined"?global:typeof self!=="undefined"?self:{};function K(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t["default"]:t}function Q(t){if(t.__esModule)return t;var n=t.default;if(typeof n=="function"){var r=function t(){if(this instanceof t){return Reflect.construct(n,arguments,this.constructor)}return n.apply(this,arguments)};r.prototype=n.prototype}else r={};Object.defineProperty(r,"__esModule",{value:true});Object.keys(t).forEach((function(n){var e=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,e.get?e:{enumerable:true,get:function(){return t[n]}})}));return r}var Z;var Y;function tt(){if(Y)return Z;Y=1;var t=Array.isArray;Z=t;return Z}var nt;var rt;function et(){if(rt)return nt;rt=1;var t=typeof X=="object"&&X&&X.Object===Object&&X;nt=t;return nt}var it;var at;function ot(){if(at)return it;at=1;var t=et();var n=typeof self=="object"&&self&&self.Object===Object&&self;var r=t||n||Function("return this")();it=r;return it}var ut;var st;function ft(){if(st)return ut;st=1;var t=ot();var n=t.Symbol;ut=n;return ut}var ct;var lt;function dt(){if(lt)return ct;lt=1;var t=ft();var n=Object.prototype;var r=n.hasOwnProperty;var e=n.toString;var i=t?t.toStringTag:undefined;function a(t){var n=r.call(t,i),a=t[i];try{t[i]=undefined;var o=true}catch(t){}var u=e.call(t);if(o){if(n){t[i]=a}else{delete t[i]}}return u}ct=a;return ct}var vt;var ht;function pt(){if(ht)return vt;ht=1;var t=Object.prototype;var n=t.toString;function r(t){return n.call(t)}vt=r;return vt}var gt;var mt;function bt(){if(mt)return gt;mt=1;var t=ft(),n=dt(),r=pt();var e="[object Null]",i="[object Undefined]";var a=t?t.toStringTag:undefined;function o(t){if(t==null){return t===undefined?i:e}return a&&a in Object(t)?n(t):r(t)}gt=o;return gt}var wt;var yt;function _t(){if(yt)return wt;yt=1;function t(t){return t!=null&&typeof t=="object"}wt=t;return wt}var St;var jt;function kt(){if(jt)return St;jt=1;var t=bt(),n=_t();var r="[object Symbol]";function e(e){return typeof e=="symbol"||n(e)&&t(e)==r}St=e;return St}var xt;var Ot;function Et(){if(Ot)return xt;Ot=1;var t=tt(),n=kt();var r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,e=/^\w*$/;function i(i,a){if(t(i)){return false}var o=typeof i;if(o=="number"||o=="symbol"||o=="boolean"||i==null||n(i)){return true}return e.test(i)||!r.test(i)||a!=null&&i in Object(a)}xt=i;return xt}var It;var At;function Tt(){if(At)return It;At=1;function t(t){var n=typeof t;return t!=null&&(n=="object"||n=="function")}It=t;return It}var Pt;var zt;function Rt(){if(zt)return Pt;zt=1;var t=bt(),n=Tt();var r="[object AsyncFunction]",e="[object Function]",i="[object GeneratorFunction]",a="[object Proxy]";function o(o){if(!n(o)){return false}var u=t(o);return u==e||u==i||u==r||u==a}Pt=o;return Pt}var Ft;var Ut;function Nt(){if(Ut)return Ft;Ut=1;var t=ot();var n=t["__core-js_shared__"];Ft=n;return Ft}var Ct;var Dt;function $t(){if(Dt)return Ct;Dt=1;var t=Nt();var n=function(){var n=/[^.]+$/.exec(t&&t.keys&&t.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""}();function r(t){return!!n&&n in t}Ct=r;return Ct}var Lt;var Mt;function qt(){if(Mt)return Lt;Mt=1;var t=Function.prototype;var n=t.toString;function r(t){if(t!=null){try{return n.call(t)}catch(t){}try{return t+""}catch(t){}}return""}Lt=r;return Lt}var Bt;var Jt;function Gt(){if(Jt)return Bt;Jt=1;var t=Rt(),n=$t(),r=Tt(),e=qt();var i=/[\\^$.*+?()[\]{}|]/g;var a=/^\[object .+?Constructor\]$/;var o=Function.prototype,u=Object.prototype;var s=o.toString;var f=u.hasOwnProperty;var c=RegExp("^"+s.call(f).replace(i,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function l(i){if(!r(i)||n(i)){return false}var o=t(i)?c:a;return o.test(e(i))}Bt=l;return Bt}var Vt;var Ht;function Wt(){if(Ht)return Vt;Ht=1;function t(t,n){return t==null?undefined:t[n]}Vt=t;return Vt}var Xt;var Kt;function Qt(){if(Kt)return Xt;Kt=1;var t=Gt(),n=Wt();function r(r,e){var i=n(r,e);return t(i)?i:undefined}Xt=r;return Xt}var Zt;var Yt;function tn(){if(Yt)return Zt;Yt=1;var t=Qt();var n=t(Object,"create");Zt=n;return Zt}var nn;var rn;function en(){if(rn)return nn;rn=1;var t=tn();function n(){this.__data__=t?t(null):{};this.size=0}nn=n;return nn}var an;var on;function un(){if(on)return an;on=1;function t(t){var n=this.has(t)&&delete this.__data__[t];this.size-=n?1:0;return n}an=t;return an}var sn;var fn;function cn(){if(fn)return sn;fn=1;var t=tn();var n="__lodash_hash_undefined__";var r=Object.prototype;var e=r.hasOwnProperty;function i(r){var i=this.__data__;if(t){var a=i[r];return a===n?undefined:a}return e.call(i,r)?i[r]:undefined}sn=i;return sn}var ln;var dn;function vn(){if(dn)return ln;dn=1;var t=tn();var n=Object.prototype;var r=n.hasOwnProperty;function e(n){var e=this.__data__;return t?e[n]!==undefined:r.call(e,n)}ln=e;return ln}var hn;var pn;function gn(){if(pn)return hn;pn=1;var t=tn();var n="__lodash_hash_undefined__";function r(r,e){var i=this.__data__;this.size+=this.has(r)?0:1;i[r]=t&&e===undefined?n:e;return this}hn=r;return hn}var mn;var bn;function wn(){if(bn)return mn;bn=1;var t=en(),n=un(),r=cn(),e=vn(),i=gn();function a(t){var n=-1,r=t==null?0:t.length;this.clear();while(++n<r){var e=t[n];this.set(e[0],e[1])}}a.prototype.clear=t;a.prototype["delete"]=n;a.prototype.get=r;a.prototype.has=e;a.prototype.set=i;mn=a;return mn}var yn;var _n;function Sn(){if(_n)return yn;_n=1;function t(){this.__data__=[];this.size=0}yn=t;return yn}var jn;var kn;function xn(){if(kn)return jn;kn=1;function t(t,n){return t===n||t!==t&&n!==n}jn=t;return jn}var On;var En;function In(){if(En)return On;En=1;var t=xn();function n(n,r){var e=n.length;while(e--){if(t(n[e][0],r)){return e}}return-1}On=n;return On}var An;var Tn;function Pn(){if(Tn)return An;Tn=1;var t=In();var n=Array.prototype;var r=n.splice;function e(n){var e=this.__data__,i=t(e,n);if(i<0){return false}var a=e.length-1;if(i==a){e.pop()}else{r.call(e,i,1)}--this.size;return true}An=e;return An}var zn;var Rn;function Fn(){if(Rn)return zn;Rn=1;var t=In();function n(n){var r=this.__data__,e=t(r,n);return e<0?undefined:r[e][1]}zn=n;return zn}var Un;var Nn;function Cn(){if(Nn)return Un;Nn=1;var t=In();function n(n){return t(this.__data__,n)>-1}Un=n;return Un}var Dn;var $n;function Ln(){if($n)return Dn;$n=1;var t=In();function n(n,r){var e=this.__data__,i=t(e,n);if(i<0){++this.size;e.push([n,r])}else{e[i][1]=r}return this}Dn=n;return Dn}var Mn;var qn;function Bn(){if(qn)return Mn;qn=1;var t=Sn(),n=Pn(),r=Fn(),e=Cn(),i=Ln();function a(t){var n=-1,r=t==null?0:t.length;this.clear();while(++n<r){var e=t[n];this.set(e[0],e[1])}}a.prototype.clear=t;a.prototype["delete"]=n;a.prototype.get=r;a.prototype.has=e;a.prototype.set=i;Mn=a;return Mn}var Jn;var Gn;function Vn(){if(Gn)return Jn;Gn=1;var t=Qt(),n=ot();var r=t(n,"Map");Jn=r;return Jn}var Hn;var Wn;function Xn(){if(Wn)return Hn;Wn=1;var t=wn(),n=Bn(),r=Vn();function e(){this.size=0;this.__data__={hash:new t,map:new(r||n),string:new t}}Hn=e;return Hn}var Kn;var Qn;function Zn(){if(Qn)return Kn;Qn=1;function t(t){var n=typeof t;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?t!=="__proto__":t===null}Kn=t;return Kn}var Yn;var tr;function nr(){if(tr)return Yn;tr=1;var t=Zn();function n(n,r){var e=n.__data__;return t(r)?e[typeof r=="string"?"string":"hash"]:e.map}Yn=n;return Yn}var rr;var er;function ir(){if(er)return rr;er=1;var t=nr();function n(n){var r=t(this,n)["delete"](n);this.size-=r?1:0;return r}rr=n;return rr}var ar;var or;function ur(){if(or)return ar;or=1;var t=nr();function n(n){return t(this,n).get(n)}ar=n;return ar}var sr;var fr;function cr(){if(fr)return sr;fr=1;var t=nr();function n(n){return t(this,n).has(n)}sr=n;return sr}var lr;var dr;function vr(){if(dr)return lr;dr=1;var t=nr();function n(n,r){var e=t(this,n),i=e.size;e.set(n,r);this.size+=e.size==i?0:1;return this}lr=n;return lr}var hr;var pr;function gr(){if(pr)return hr;pr=1;var t=Xn(),n=ir(),r=ur(),e=cr(),i=vr();function a(t){var n=-1,r=t==null?0:t.length;this.clear();while(++n<r){var e=t[n];this.set(e[0],e[1])}}a.prototype.clear=t;a.prototype["delete"]=n;a.prototype.get=r;a.prototype.has=e;a.prototype.set=i;hr=a;return hr}var mr;var br;function wr(){if(br)return mr;br=1;var t=gr();var n="Expected a function";function r(e,i){if(typeof e!="function"||i!=null&&typeof i!="function"){throw new TypeError(n)}var a=function(){var t=arguments,n=i?i.apply(this,t):t[0],r=a.cache;if(r.has(n)){return r.get(n)}var o=e.apply(this,t);a.cache=r.set(n,o)||r;return o};a.cache=new(r.Cache||t);return a}r.Cache=t;mr=r;return mr}var yr;var _r;function Sr(){if(_r)return yr;_r=1;var t=wr();var n=500;function r(r){var e=t(r,(function(t){if(i.size===n){i.clear()}return t}));var i=e.cache;return e}yr=r;return yr}var jr;var kr;function xr(){if(kr)return jr;kr=1;var t=Sr();var n=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;var r=/\\(\\)?/g;var e=t((function(t){var e=[];if(t.charCodeAt(0)===46){e.push("")}t.replace(n,(function(t,n,i,a){e.push(i?a.replace(r,"$1"):n||t)}));return e}));jr=e;return jr}var Or;var Er;function Ir(){if(Er)return Or;Er=1;function t(t,n){var r=-1,e=t==null?0:t.length,i=Array(e);while(++r<e){i[r]=n(t[r],r,t)}return i}Or=t;return Or}var Ar;var Tr;function Pr(){if(Tr)return Ar;Tr=1;var t=ft(),n=Ir(),r=tt(),e=kt();var i=t?t.prototype:undefined,a=i?i.toString:undefined;function o(t){if(typeof t=="string"){return t}if(r(t)){return n(t,o)+""}if(e(t)){return a?a.call(t):""}var i=t+"";return i=="0"&&1/t==-Infinity?"-0":i}Ar=o;return Ar}var zr;var Rr;function Fr(){if(Rr)return zr;Rr=1;var t=Pr();function n(n){return n==null?"":t(n)}zr=n;return zr}var Ur;var Nr;function Cr(){if(Nr)return Ur;Nr=1;var t=tt(),n=Et(),r=xr(),e=Fr();function i(i,a){if(t(i)){return i}return n(i,a)?[i]:r(e(i))}Ur=i;return Ur}var Dr;var $r;function Lr(){if($r)return Dr;$r=1;var t=kt();function n(n){if(typeof n=="string"||t(n)){return n}var r=n+"";return r=="0"&&1/n==-Infinity?"-0":r}Dr=n;return Dr}var Mr;var qr;function Br(){if(qr)return Mr;qr=1;var t=Cr(),n=Lr();function r(r,e){e=t(e,r);var i=0,a=e.length;while(r!=null&&i<a){r=r[n(e[i++])]}return i&&i==a?r:undefined}Mr=r;return Mr}var Jr;var Gr;function Vr(){if(Gr)return Jr;Gr=1;var t=Br();function n(n,r,e){var i=n==null?undefined:t(n,r);return i===undefined?e:i}Jr=n;return Jr}var Hr=Vr();var Wr=K(Hr);var Xr={exports:{}};var Kr;function Qr(){if(Kr)return Xr.exports;Kr=1;(function(t,n){!function(n){var r=Object.hasOwnProperty;var e=Array.isArray?Array.isArray:function t(n){return Object.prototype.toString.call(n)==="[object Array]"};var i=10;var a=typeof W=="object"&&typeof W.nextTick=="function";var o=typeof Symbol==="function";var u=typeof Reflect==="object";var s=typeof setImmediate==="function";var f=s?setImmediate:setTimeout;var c=o?u&&typeof Reflect.ownKeys==="function"?Reflect.ownKeys:function(t){var n=Object.getOwnPropertyNames(t);n.push.apply(n,Object.getOwnPropertySymbols(t));return n}:Object.keys;function l(){this._events={};if(this._conf){d.call(this,this._conf)}}function d(t){if(t){this._conf=t;t.delimiter&&(this.delimiter=t.delimiter);if(t.maxListeners!==n){this._maxListeners=t.maxListeners}t.wildcard&&(this.wildcard=t.wildcard);t.newListener&&(this._newListener=t.newListener);t.removeListener&&(this._removeListener=t.removeListener);t.verboseMemoryLeak&&(this.verboseMemoryLeak=t.verboseMemoryLeak);t.ignoreErrors&&(this.ignoreErrors=t.ignoreErrors);if(this.wildcard){this.listenerTree={}}}}function v(t,n){var r="(node) warning: possible EventEmitter memory "+"leak detected. "+t+" listeners added. "+"Use emitter.setMaxListeners() to increase limit.";if(this.verboseMemoryLeak){r+=" Event name: "+n+"."}if(typeof W!=="undefined"&&W.emitWarning){var e=new Error(r);e.name="MaxListenersExceededWarning";e.emitter=this;e.count=t;W.emitWarning(e)}else{console.error(r);if(console.trace){console.trace()}}}var h=function(t,n,r){var e=arguments.length;switch(e){case 0:return[];case 1:return[t];case 2:return[t,n];case 3:return[t,n,r];default:var i=new Array(e);while(e--){i[e]=arguments[e]}return i}};function p(t,r){var e={};var i;var a=t.length;var o=0;for(var u=0;u<a;u++){i=t[u];e[i]=u<o?r[u]:n}return e}function g(t,n,r){this._emitter=t;this._target=n;this._listeners={};this._listenersCount=0;var e,i;if(r.on||r.off){e=r.on;i=r.off}if(n.addEventListener){e=n.addEventListener;i=n.removeEventListener}else if(n.addListener){e=n.addListener;i=n.removeListener}else if(n.on){e=n.on;i=n.off}if(!e&&!i){throw Error("target does not implement any known event API")}if(typeof e!=="function"){throw TypeError("on method must be a function")}if(typeof i!=="function"){throw TypeError("off method must be a function")}this._on=e;this._off=i;var a=t._observers;if(a){a.push(this)}else{t._observers=[this]}}Object.assign(g.prototype,{subscribe:function(t,n,r){var e=this;var i=this._target;var a=this._emitter;var o=this._listeners;var u=function(){var e=h.apply(null,arguments);var o={data:e,name:n,original:t};if(r){var u=r.call(i,o);if(u!==false){a.emit.apply(a,[o.name].concat(e))}return}a.emit.apply(a,[n].concat(e))};if(o[t]){throw Error("Event '"+t+"' is already listening")}this._listenersCount++;if(a._newListener&&a._removeListener&&!e._onNewListener){this._onNewListener=function(r){if(r===n&&o[t]===null){o[t]=u;e._on.call(i,t,u)}};a.on("newListener",this._onNewListener);this._onRemoveListener=function(r){if(r===n&&!a.hasListeners(r)&&o[t]){o[t]=null;e._off.call(i,t,u)}};o[t]=null;a.on("removeListener",this._onRemoveListener)}else{o[t]=u;e._on.call(i,t,u)}},unsubscribe:function(t){var n=this;var r=this._listeners;var e=this._emitter;var i;var a;var o=this._off;var u=this._target;var s;if(t&&typeof t!=="string"){throw TypeError("event must be a string")}function f(){if(n._onNewListener){e.off("newListener",n._onNewListener);e.off("removeListener",n._onRemoveListener);n._onNewListener=null;n._onRemoveListener=null}var t=j.call(e,n);e._observers.splice(t,1)}if(t){i=r[t];if(!i)return;o.call(u,t,i);delete r[t];if(! --this._listenersCount){f()}}else{a=c(r);s=a.length;while(s-- >0){t=a[s];o.call(u,t,r[t])}this._listeners={};this._listenersCount=0;f()}}});function m(t,e,i,a){var o=Object.assign({},e);if(!t)return o;if(typeof t!=="object"){throw TypeError("options must be an object")}var u=Object.keys(t);var s=u.length;var f,c;var l;function d(t){throw Error('Invalid "'+f+'" option value'+(t?". Reason: "+t:""))}for(var v=0;v<s;v++){f=u[v];if(!r.call(e,f)){throw Error('Unknown "'+f+'" option')}c=t[f];if(c!==n){l=i[f];o[f]=l?l(c,d):c}}return o}function b(t,n){if(typeof t!=="function"||!t.hasOwnProperty("prototype")){n("value must be a constructor")}return t}function w(t){var n="value must be type of "+t.join("|");var r=t.length;var e=t[0];var i=t[1];if(r===1){return function(t,r){if(typeof t===e){return t}r(n)}}if(r===2){return function(t,r){var a=typeof t;if(a===e||a===i)return t;r(n)}}return function(e,i){var a=typeof e;var o=r;while(o-- >0){if(a===t[o])return e}i(n)}}var y=w(["function"]);var _=w(["object","function"]);function S(t,n,r){var e;var i;var a=0;var o;var u=new t((function(s,f,c){r=m(r,{timeout:0,overload:false},{timeout:function(t,n){t*=1;if(typeof t!=="number"||t<0||!Number.isFinite(t)){n("timeout must be a positive number")}return t}});e=!r.overload&&typeof t.prototype.cancel==="function"&&typeof c==="function";function l(){if(i){i=null}if(a){clearTimeout(a);a=0}}var d=function(t){l();s(t)};var v=function(t){l();f(t)};if(e){n(d,v,c)}else{i=[function(t){v(t||Error("canceled"))}];n(d,v,(function(t){if(o){throw Error("Unable to subscribe on cancel event asynchronously")}if(typeof t!=="function"){throw TypeError("onCancel callback must be a function")}i.push(t)}));o=true}if(r.timeout>0){a=setTimeout((function(){var t=Error("timeout");t.code="ETIMEDOUT";a=0;u.cancel(t);f(t)}),r.timeout)}}));if(!e){u.cancel=function(t){if(!i){return}var n=i.length;for(var r=1;r<n;r++){i[r](t)}i[0](t);i=null}}return u}function j(t){var n=this._observers;if(!n){return-1}var r=n.length;for(var e=0;e<r;e++){if(n[e]._target===t)return e}return-1}function k(t,n,r,e,i){if(!r){return null}if(e===0){var a=typeof n;if(a==="string"){var o,u,s=0,f=0,l=this.delimiter,d=l.length;if((u=n.indexOf(l))!==-1){o=new Array(5);do{o[s++]=n.slice(f,u);f=u+d}while((u=n.indexOf(l,f))!==-1);o[s++]=n.slice(f);n=o;i=s}else{n=[n];i=1}}else if(a==="object"){i=n.length}else{n=[n];i=1}}var v=null,h,p,g,m,b,w=n[e],y=n[e+1],_,S;if(e===i){if(r._listeners){if(typeof r._listeners==="function"){t&&t.push(r._listeners);v=[r]}else{t&&t.push.apply(t,r._listeners);v=[r]}}}else{if(w==="*"){_=c(r);u=_.length;while(u-- >0){h=_[u];if(h!=="_listeners"){S=k(t,n,r[h],e+1,i);if(S){if(v){v.push.apply(v,S)}else{v=S}}}}return v}else if(w==="**"){b=e+1===i||e+2===i&&y==="*";if(b&&r._listeners){v=k(t,n,r,i,i)}_=c(r);u=_.length;while(u-- >0){h=_[u];if(h!=="_listeners"){if(h==="*"||h==="**"){if(r[h]._listeners&&!b){S=k(t,n,r[h],i,i);if(S){if(v){v.push.apply(v,S)}else{v=S}}}S=k(t,n,r[h],e,i)}else if(h===y){S=k(t,n,r[h],e+2,i)}else{S=k(t,n,r[h],e,i)}if(S){if(v){v.push.apply(v,S)}else{v=S}}}}return v}else if(r[w]){v=k(t,n,r[w],e+1,i)}}p=r["*"];if(p){k(t,n,p,e+1,i)}g=r["**"];if(g){if(e<i){if(g._listeners){k(t,n,g,i,i)}_=c(g);u=_.length;while(u-- >0){h=_[u];if(h!=="_listeners"){if(h===y){k(t,n,g[h],e+2,i)}else if(h===w){k(t,n,g[h],e+1,i)}else{m={};m[h]=g[h];k(t,n,{"**":m},e+1,i)}}}}else if(g._listeners){k(t,n,g,i,i)}else if(g["*"]&&g["*"]._listeners){k(t,n,g["*"],i,i)}}return v}function x(t,n,r){var e=0,i=0,a,o=this.delimiter,u=o.length,s;if(typeof t==="string"){if((a=t.indexOf(o))!==-1){s=new Array(5);do{s[e++]=t.slice(i,a);i=a+u}while((a=t.indexOf(o,i))!==-1);s[e++]=t.slice(i)}else{s=[t];e=1}}else{s=t;e=t.length}if(e>1){for(a=0;a+1<e;a++){if(s[a]==="**"&&s[a+1]==="**"){return}}}var f=this.listenerTree,c;for(a=0;a<e;a++){c=s[a];f=f[c]||(f[c]={});if(a===e-1){if(!f._listeners){f._listeners=n}else{if(typeof f._listeners==="function"){f._listeners=[f._listeners]}if(r){f._listeners.unshift(n)}else{f._listeners.push(n)}if(!f._listeners.warned&&this._maxListeners>0&&f._listeners.length>this._maxListeners){f._listeners.warned=true;v.call(this,f._listeners.length,c)}}return true}}return true}function O(t,n,r,e){var i=c(t);var a=i.length;var o,u,s;var f=t["_listeners"];var l;while(a-- >0){u=i[a];o=t[u];if(u==="_listeners"){s=r}else{s=r?r.concat(u):[u]}l=e||typeof u==="symbol";f&&n.push(l?s:s.join(this.delimiter));if(typeof o==="object"){O.call(this,o,n,s,l)}}return n}function E(t){var n=c(t);var r=n.length;var e,i,a;while(r-- >0){i=n[r];e=t[i];if(e){a=true;if(i!=="_listeners"&&!E(e)){delete t[i]}}}return a}function I(t,n,r){this.emitter=t;this.event=n;this.listener=r}I.prototype.off=function(){this.emitter.off(this.event,this.listener);return this};function A(t,r,e){if(e===true){o=true}else if(e===false){i=true}else{if(!e||typeof e!=="object"){throw TypeError("options should be an object or true")}var i=e.async;var o=e.promisify;var u=e.nextTick;var s=e.objectify}if(i||u||o){var c=r;var l=r._origin||r;if(u&&!a){throw Error("process.nextTick is not supported")}if(o===n){o=r.constructor.name==="AsyncFunction"}r=function(){var t=arguments;var n=this;var r=this.event;return o?u?Promise.resolve():new Promise((function(t){f(t)})).then((function(){n.event=r;return c.apply(n,t)})):(u?W.nextTick:f)((function(){n.event=r;c.apply(n,t)}))};r._async=true;r._origin=l}return[r,s?new I(this,t,r):this]}function T(t){this._events={};this._newListener=false;this._removeListener=false;this.verboseMemoryLeak=false;d.call(this,t)}T.EventEmitter2=T;T.prototype.listenTo=function(t,r,i){if(typeof t!=="object"){throw TypeError("target musts be an object")}var a=this;i=m(i,{on:n,off:n,reducers:n},{on:y,off:y,reducers:_});function o(n){if(typeof n!=="object"){throw TypeError("events must be an object")}var r=i.reducers;var e=j.call(a,t);var o;if(e===-1){o=new g(a,t,i)}else{o=a._observers[e]}var u=c(n);var s=u.length;var f;var l=typeof r==="function";for(var d=0;d<s;d++){f=u[d];o.subscribe(f,n[f]||f,l?r:r&&r[f])}}e(r)?o(p(r)):typeof r==="string"?o(p(r.split(/\s+/))):o(r);return this};T.prototype.stopListeningTo=function(t,n){var r=this._observers;if(!r){return false}var e=r.length;var i;var a=false;if(t&&typeof t!=="object"){throw TypeError("target should be an object")}while(e-- >0){i=r[e];if(!t||i._target===t){i.unsubscribe(n);a=true}}return a};T.prototype.delimiter=".";T.prototype.setMaxListeners=function(t){if(t!==n){this._maxListeners=t;if(!this._conf)this._conf={};this._conf.maxListeners=t}};T.prototype.getMaxListeners=function(){return this._maxListeners};T.prototype.event="";T.prototype.once=function(t,n,r){return this._once(t,n,false,r)};T.prototype.prependOnceListener=function(t,n,r){return this._once(t,n,true,r)};T.prototype._once=function(t,n,r,e){return this._many(t,1,n,r,e)};T.prototype.many=function(t,n,r,e){return this._many(t,n,r,false,e)};T.prototype.prependMany=function(t,n,r,e){return this._many(t,n,r,true,e)};T.prototype._many=function(t,n,r,e,i){var a=this;if(typeof r!=="function"){throw new Error("many only accepts instances of Function")}function o(){if(--n===0){a.off(t,o)}return r.apply(this,arguments)}o._origin=r;return this._on(t,o,e,i)};T.prototype.emit=function(){if(!this._events&&!this._all){return false}this._events||l.call(this);var t=arguments[0],n,r=this.wildcard;var e,i,a,u,s;if(t==="newListener"&&!this._newListener){if(!this._events.newListener){return false}}if(r){n=t;if(t!=="newListener"&&t!=="removeListener"){if(typeof t==="object"){i=t.length;if(o){for(a=0;a<i;a++){if(typeof t[a]==="symbol"){s=true;break}}}if(!s){t=t.join(this.delimiter)}}}}var f=arguments.length;var c;if(this._all&&this._all.length){c=this._all.slice();for(a=0,i=c.length;a<i;a++){this.event=t;switch(f){case 1:c[a].call(this,t);break;case 2:c[a].call(this,t,arguments[1]);break;case 3:c[a].call(this,t,arguments[1],arguments[2]);break;default:c[a].apply(this,arguments)}}}if(r){c=[];k.call(this,c,n,this.listenerTree,0,i)}else{c=this._events[t];if(typeof c==="function"){this.event=t;switch(f){case 1:c.call(this);break;case 2:c.call(this,arguments[1]);break;case 3:c.call(this,arguments[1],arguments[2]);break;default:e=new Array(f-1);for(u=1;u<f;u++)e[u-1]=arguments[u];c.apply(this,e)}return true}else if(c){c=c.slice()}}if(c&&c.length){if(f>3){e=new Array(f-1);for(u=1;u<f;u++)e[u-1]=arguments[u]}for(a=0,i=c.length;a<i;a++){this.event=t;switch(f){case 1:c[a].call(this);break;case 2:c[a].call(this,arguments[1]);break;case 3:c[a].call(this,arguments[1],arguments[2]);break;default:c[a].apply(this,e)}}return true}else if(!this.ignoreErrors&&!this._all&&t==="error"){if(arguments[1]instanceof Error){throw arguments[1]}else{throw new Error("Uncaught, unspecified 'error' event.")}}return!!this._all};T.prototype.emitAsync=function(){if(!this._events&&!this._all){return false}this._events||l.call(this);var t=arguments[0],n=this.wildcard,r,e;var i,a,u,s;if(t==="newListener"&&!this._newListener){if(!this._events.newListener){return Promise.resolve([false])}}if(n){r=t;if(t!=="newListener"&&t!=="removeListener"){if(typeof t==="object"){a=t.length;if(o){for(u=0;u<a;u++){if(typeof t[u]==="symbol"){e=true;break}}}if(!e){t=t.join(this.delimiter)}}}}var f=[];var c=arguments.length;var d;if(this._all){for(u=0,a=this._all.length;u<a;u++){this.event=t;switch(c){case 1:f.push(this._all[u].call(this,t));break;case 2:f.push(this._all[u].call(this,t,arguments[1]));break;case 3:f.push(this._all[u].call(this,t,arguments[1],arguments[2]));break;default:f.push(this._all[u].apply(this,arguments))}}}if(n){d=[];k.call(this,d,r,this.listenerTree,0)}else{d=this._events[t]}if(typeof d==="function"){this.event=t;switch(c){case 1:f.push(d.call(this));break;case 2:f.push(d.call(this,arguments[1]));break;case 3:f.push(d.call(this,arguments[1],arguments[2]));break;default:i=new Array(c-1);for(s=1;s<c;s++)i[s-1]=arguments[s];f.push(d.apply(this,i))}}else if(d&&d.length){d=d.slice();if(c>3){i=new Array(c-1);for(s=1;s<c;s++)i[s-1]=arguments[s]}for(u=0,a=d.length;u<a;u++){this.event=t;switch(c){case 1:f.push(d[u].call(this));break;case 2:f.push(d[u].call(this,arguments[1]));break;case 3:f.push(d[u].call(this,arguments[1],arguments[2]));break;default:f.push(d[u].apply(this,i))}}}else if(!this.ignoreErrors&&!this._all&&t==="error"){if(arguments[1]instanceof Error){return Promise.reject(arguments[1])}else{return Promise.reject("Uncaught, unspecified 'error' event.")}}return Promise.all(f)};T.prototype.on=function(t,n,r){return this._on(t,n,false,r)};T.prototype.prependListener=function(t,n,r){return this._on(t,n,true,r)};T.prototype.onAny=function(t){return this._onAny(t,false)};T.prototype.prependAny=function(t){return this._onAny(t,true)};T.prototype.addListener=T.prototype.on;T.prototype._onAny=function(t,n){if(typeof t!=="function"){throw new Error("onAny only accepts instances of Function")}if(!this._all){this._all=[]}if(n){this._all.unshift(t)}else{this._all.push(t)}return this};T.prototype._on=function(t,r,e,i){if(typeof t==="function"){this._onAny(t,r);return this}if(typeof r!=="function"){throw new Error("on only accepts instances of Function")}this._events||l.call(this);var a=this,o;if(i!==n){o=A.call(this,t,r,i);r=o[0];a=o[1]}if(this._newListener){this.emit("newListener",t,r)}if(this.wildcard){x.call(this,t,r,e);return a}if(!this._events[t]){this._events[t]=r}else{if(typeof this._events[t]==="function"){this._events[t]=[this._events[t]]}if(e){this._events[t].unshift(r)}else{this._events[t].push(r)}if(!this._events[t].warned&&this._maxListeners>0&&this._events[t].length>this._maxListeners){this._events[t].warned=true;v.call(this,this._events[t].length,t)}}return a};T.prototype.off=function(t,n){if(typeof n!=="function"){throw new Error("removeListener only takes instances of Function")}var r,i=[];if(this.wildcard){var a=typeof t==="string"?t.split(this.delimiter):t.slice();i=k.call(this,null,a,this.listenerTree,0);if(!i)return this}else{if(!this._events[t])return this;r=this._events[t];i.push({_listeners:r})}for(var o=0;o<i.length;o++){var u=i[o];r=u._listeners;if(e(r)){var s=-1;for(var f=0,c=r.length;f<c;f++){if(r[f]===n||r[f].listener&&r[f].listener===n||r[f]._origin&&r[f]._origin===n){s=f;break}}if(s<0){continue}if(this.wildcard){u._listeners.splice(s,1)}else{this._events[t].splice(s,1)}if(r.length===0){if(this.wildcard){delete u._listeners}else{delete this._events[t]}}if(this._removeListener)this.emit("removeListener",t,n);return this}else if(r===n||r.listener&&r.listener===n||r._origin&&r._origin===n){if(this.wildcard){delete u._listeners}else{delete this._events[t]}if(this._removeListener)this.emit("removeListener",t,n)}}this.listenerTree&&E(this.listenerTree);return this};T.prototype.offAny=function(t){var n=0,r=0,e;if(t&&this._all&&this._all.length>0){e=this._all;for(n=0,r=e.length;n<r;n++){if(t===e[n]){e.splice(n,1);if(this._removeListener)this.emit("removeListenerAny",t);return this}}}else{e=this._all;if(this._removeListener){for(n=0,r=e.length;n<r;n++)this.emit("removeListenerAny",e[n])}this._all=[]}return this};T.prototype.removeListener=T.prototype.off;T.prototype.removeAllListeners=function(t){if(t===n){!this._events||l.call(this);return this}if(this.wildcard){var r=k.call(this,null,t,this.listenerTree,0),e,i;if(!r)return this;for(i=0;i<r.length;i++){e=r[i];e._listeners=null}this.listenerTree&&E(this.listenerTree)}else if(this._events){this._events[t]=null}return this};T.prototype.listeners=function(t){var r=this._events;var e,i,a;var o;var u;if(t===n){if(this.wildcard){throw Error("event name required for wildcard emitter")}if(!r){return[]}e=c(r);o=e.length;a=[];while(o-- >0){i=r[e[o]];if(typeof i==="function"){a.push(i)}else{a.push.apply(a,i)}}return a}else{if(this.wildcard){u=this.listenerTree;if(!u)return[];var s=[];var f=typeof t==="string"?t.split(this.delimiter):t.slice();k.call(this,s,f,u,0);return s}if(!r){return[]}i=r[t];if(!i){return[]}return typeof i==="function"?[i]:i}};T.prototype.eventNames=function(t){var n=this._events;return this.wildcard?O.call(this,this.listenerTree,[],null,t):n?c(n):[]};T.prototype.listenerCount=function(t){return this.listeners(t).length};T.prototype.hasListeners=function(t){if(this.wildcard){var r=[];var e=typeof t==="string"?t.split(this.delimiter):t.slice();k.call(this,r,e,this.listenerTree,0);return r.length>0}var i=this._events;var a=this._all;return!!(a&&a.length||i&&(t===n?c(i).length:i[t]))};T.prototype.listenersAny=function(){if(this._all){return this._all}else{return[]}};T.prototype.waitFor=function(t,r){var e=this;var i=typeof r;if(i==="number"){r={timeout:r}}else if(i==="function"){r={filter:r}}r=m(r,{timeout:0,filter:n,handleError:false,Promise:Promise,overload:false},{filter:y,Promise:b});return S(r.Promise,(function(n,i,a){function o(){var a=r.filter;if(a&&!a.apply(e,arguments)){return}e.off(t,o);if(r.handleError){var u=arguments[0];u?i(u):n(h.apply(null,arguments).slice(1))}else{n(h.apply(null,arguments))}}a((function(){e.off(t,o)}));e._on(t,o,false)}),{timeout:r.timeout,overload:r.overload})};function P(t,n,r){r=m(r,{Promise:Promise,timeout:0,overload:false},{Promise:b});var e=r.Promise;return S(e,(function(r,e,i){var a;if(typeof t.addEventListener==="function"){a=function(){r(h.apply(null,arguments))};i((function(){t.removeEventListener(n,a)}));t.addEventListener(n,a,{once:true});return}var o=function(){u&&t.removeListener("error",u);r(h.apply(null,arguments))};var u;if(n!=="error"){u=function(r){t.removeListener(n,o);e(r)};t.once("error",u)}i((function(){u&&t.removeListener("error",u);t.removeListener(n,o)}));t.once(n,o)}),{timeout:r.timeout,overload:r.overload})}var z=T.prototype;Object.defineProperties(T,{defaultMaxListeners:{get:function(){return z._maxListeners},set:function(t){if(typeof t!=="number"||t<0||Number.isNaN(t)){throw TypeError("n must be a non-negative number")}z._maxListeners=t},enumerable:true},once:{value:P,writable:true,configurable:true}});Object.defineProperties(z,{_maxListeners:{value:i,writable:true,configurable:true},_observers:{value:null,writable:true,configurable:true}});{t.exports=T}}()})(Xr);return Xr.exports}var Zr=Qr();var Yr;var te;function ne(){if(te)return Yr;te=1;var t=i();var n=a();var r=o();var e=typeof window!=="undefined"?window:X;Yr={assign:t,create:n,trim:r,bind:u,slice:s,each:f,map:c,pluck:l,isList:d,isFunction:v,isObject:h,Global:e};function i(){if(Object.assign){return Object.assign}else{return function t(n,r,e,i){for(var a=1;a<arguments.length;a++){f(Object(arguments[a]),(function(t,r){n[r]=t}))}return n}}}function a(){if(Object.create){return function n(r,e,i,a){var o=s(arguments,1);return t.apply(this,[Object.create(r)].concat(o))}}else{function n(){}return function r(e,i,a,o){var u=s(arguments,1);n.prototype=e;return t.apply(this,[new n].concat(u))}}}function o(){if(String.prototype.trim){return function t(n){return String.prototype.trim.call(n)}}else{return function t(n){return n.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}}}function u(t,n){return function(){return n.apply(t,Array.prototype.slice.call(arguments,0))}}function s(t,n){return Array.prototype.slice.call(t,n||0)}function f(t,n){l(t,(function(t,r){n(t,r);return false}))}function c(t,n){var r=d(t)?[]:{};l(t,(function(t,e){r[e]=n(t,e);return false}));return r}function l(t,n){if(d(t)){for(var r=0;r<t.length;r++){if(n(t[r],r)){return t[r]}}}else{for(var e in t){if(t.hasOwnProperty(e)){if(n(t[e],e)){return t[e]}}}}}function d(t){return t!=null&&typeof t!="function"&&typeof t.length=="number"}function v(t){return t&&{}.toString.call(t)==="[object Function]"}function h(t){return t&&{}.toString.call(t)==="[object Object]"}return Yr}var re;var ee;function ie(){if(ee)return re;ee=1;var t=ne();var n=t.slice;var r=t.pluck;var e=t.each;var i=t.bind;var a=t.create;var o=t.isList;var u=t.isFunction;var s=t.isObject;re={createStore:l};var f={version:"2.0.12",enabled:false,get:function(t,n){var r=this.storage.read(this._namespacePrefix+t);return this._deserialize(r,n)},set:function(t,n){if(n===undefined){return this.remove(t)}this.storage.write(this._namespacePrefix+t,this._serialize(n));return n},remove:function(t){this.storage.remove(this._namespacePrefix+t)},each:function(t){var n=this;this.storage.each((function(r,e){t.call(n,n._deserialize(r),(e||"").replace(n._namespaceRegexp,""))}))},clearAll:function(){this.storage.clearAll()},hasNamespace:function(t){return this._namespacePrefix=="__storejs_"+t+"_"},createStore:function(){return l.apply(this,arguments)},addPlugin:function(t){this._addPlugin(t)},namespace:function(t){return l(this.storage,this.plugins,t)}};function c(){var t=typeof console=="undefined"?null:console;if(!t){return}var n=t.warn?t.warn:t.log;n.apply(t,arguments)}function l(t,l,d){if(!d){d=""}if(t&&!o(t)){t=[t]}if(l&&!o(l)){l=[l]}var v=d?"__storejs_"+d+"_":"";var h=d?new RegExp("^"+v):null;var p=/^[a-zA-Z0-9_\-]*$/;if(!p.test(d)){throw new Error("store.js namespaces can only have alphanumerics + underscores and dashes")}var g={_namespacePrefix:v,_namespaceRegexp:h,_testStorage:function(t){try{var n="__storejs__test__";t.write(n,n);var r=t.read(n)===n;t.remove(n);return r}catch(t){return false}},_assignPluginFnProp:function(t,r){var i=this[r];this[r]=function r(){var a=n(arguments,0);var o=this;function u(){if(!i){return}e(arguments,(function(t,n){a[n]=t}));return i.apply(o,a)}var s=[u].concat(a);return t.apply(o,s)}},_serialize:function(t){return JSON.stringify(t)},_deserialize:function(t,n){if(!t){return n}var r="";try{r=JSON.parse(t)}catch(n){r=t}return r!==undefined?r:n},_addStorage:function(t){if(this.enabled){return}if(this._testStorage(t)){this.storage=t;this.enabled=true}},_addPlugin:function(t){var n=this;if(o(t)){e(t,(function(t){n._addPlugin(t)}));return}var i=r(this.plugins,(function(n){return t===n}));if(i){return}this.plugins.push(t);if(!u(t)){throw new Error("Plugins must be function values that return objects")}var a=t.call(this);if(!s(a)){throw new Error("Plugins must return an object of function properties")}e(a,(function(r,e){if(!u(r)){throw new Error("Bad plugin property: "+e+" from plugin "+t.name+". Plugins should only return functions.")}n._assignPluginFnProp(r,e)}))},addStorage:function(t){c("store.addStorage(storage) is deprecated. Use createStore([storages])");this._addStorage(t)}};var m=a(g,f,{plugins:[]});m.raw={};e(m,(function(t,n){if(u(t)){m.raw[n]=i(m,t)}}));e(t,(function(t){m._addStorage(t)}));e(l,(function(t){m._addPlugin(t)}));return m}return re}var ae=ie();var oe;var ue;function se(){if(ue)return oe;ue=1;var t=ne();var n=t.Global;oe={name:"localStorage",read:e,write:i,each:a,remove:o,clearAll:u};function r(){return n.localStorage}function e(t){return r().getItem(t)}function i(t,n){return r().setItem(t,n)}function a(t){for(var n=r().length-1;n>=0;n--){var i=r().key(n);t(e(i),i)}}function o(t){return r().removeItem(t)}function u(){return r().clear()}return oe}var fe=se();var ce=K(fe);var le=i({__proto__:null,default:ce},[fe]);var de;var ve;function he(){if(ve)return de;ve=1;var t=ne();var n=t.Global;de={name:"sessionStorage",read:e,write:i,each:a,remove:o,clearAll:u};function r(){return n.sessionStorage}function e(t){return r().getItem(t)}function i(t,n){return r().setItem(t,n)}function a(t){for(var n=r().length-1;n>=0;n--){var i=r().key(n);t(e(i),i)}}function o(t){return r().removeItem(t)}function u(){return r().clear()}return de}var pe=he();var ge=K(pe);var me=i({__proto__:null,default:ge},[pe]);var be;var we;function ye(){if(we)return be;we=1;var t=ne();var n=t.Global;var r=t.trim;be={name:"cookieStorage",read:i,write:o,each:a,remove:u,clearAll:s};var e=n.document;function i(t){if(!t||!f(t)){return null}var n="(?:^|.*;\\s*)"+escape(t).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=\\s*((?:[^;](?!;))*[^;]?).*";return unescape(e.cookie.replace(new RegExp(n),"$1"))}function a(t){var n=e.cookie.split(/; ?/g);for(var i=n.length-1;i>=0;i--){if(!r(n[i])){continue}var a=n[i].split("=");var o=unescape(a[0]);var u=unescape(a[1]);t(u,o)}}function o(t,n){if(!t){return}e.cookie=escape(t)+"="+escape(n)+"; expires=Tue, 19 Jan 2038 03:14:07 GMT; path=/"}function u(t){if(!t||!f(t)){return}e.cookie=escape(t)+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/"}function s(){a((function(t,n){u(n)}))}function f(t){return new RegExp("(?:^|;\\s*)"+escape(t).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=").test(e.cookie)}return be}var _e=ye();var Se=K(_e);var je=i({__proto__:null,default:Se},[_e]);var ke;var xe;function Oe(){if(xe)return ke;xe=1;ke={name:"memoryStorage",read:n,write:r,each:e,remove:i,clearAll:a};var t={};function n(n){return t[n]}function r(n,r){t[n]=r}function e(n){for(var r in t){if(t.hasOwnProperty(r)){n(t[r],r)}}}function i(n){delete t[n]}function a(n){t={}}return ke}var Ee=Oe();var Ie=K(Ee);var Ae=i({__proto__:null,default:Ie},[Ee]);function Te(t,n){void 0===n&&(n=false),t+="";for(var r,e=["٠","١","٢","٣","٤","٥","٦","٧","٨","٩"],i=["0","1","2","3","4","5","6","7","8","9"],a=(n=n||!Salla.config.get("store.settings.arabic_numbers_enabled"))?e:i,o=n?i:e,u=0;u<a.length;u++)r=new RegExp(a[u],"g"),t=t.replace(r,o[u]);return t.replace(n?"٫":".",n?".":"٫")}function Pe(t){var n=("".concat(t).match(/\./g)||[]).length;return n&&1!==n?Pe(t.replace(/\.(.+)\./g,".$1")):t}function ze(t){return"".concat(t).startsWith("https://")||"".concat(t).startsWith("http://")}function Re(t){if(ze(t))return t;var n=Salla.config.get("store.url");return n||(n=window.location.href.split("/").slice(0,-1).join("/"),Salla.config.set("store.url",n)),n.rtrim("/")+"/"+(null==t?void 0:t.ltrim("/"))}function Fe(t,n,r){if(r=r||window.location.href,!n||!t)return r;var e=new RegExp("([?&])"+t+"=[^&]+[&]?","g");return(r=r.replace(e,"$1").split("#")[0].replace(/&$|\?$/,"")).includes("?")?r+="&":r+=(r.endsWith("/")?"":"/")+"?",(r+t+"="+encodeURIComponent(n)).replace(/&$|\?$/,"")}function Ue(t){return window.location.origin+"/"+(null==t?void 0:t.ltrim("/"))}function Ne(t){return ze(t)?t:Salla.config.get("theme.assets")?Salla.config.get("theme.assets").replace(":path",null==t?void 0:t.ltrim("/")):Ue("themes/"+Salla.config.get("theme.name")+"/"+(null==t?void 0:t.ltrim("/")))}function Ce(t,n,r){var e,i=t[0];return r&&0==t.length?Array.isArray(r)?(r.push(n),r):[r,n]:Array.isArray(r)?(r.push(n),r):"string"==typeof r?[r,n]:r?(r[i]=Ce(t.slice(1),n,r[i]),r):i?((e={})[i]=Ce(t.slice(1),n),e):""===i?[n]:n}function De(){return window.self!==window.top}String.prototype.toStudlyCase=function(){return this.trim().replace(/([^a-zA-Z\d].)/g,(function(t){return t.toUpperCase().replace(/[^a-zA-Z\d]/g,"")}))},String.prototype.toDatasetName=function(){return this.startsWith("data-")?this.substr(5).toStudlyCase():this.toStudlyCase()},String.prototype.toSelector=function(){return this.trim().startsWith(".")||this.trim().startsWith("#")?this.toString():"#"+this.toString()},String.prototype.replaceArray=function(t,n){for(var r,e=this,i=0;i<t.length;i++)r=new RegExp(t[i],"g"),e=e.replace(r,n[i]);return e},String.prototype.rtrim=function(t){return void 0===t&&(t="\\s"),this.replace(new RegExp("["+t+"]*$"),"")},String.prototype.ltrim=function(t){return void 0===t&&(t="\\s"),this.replace(new RegExp("^["+t+"]*"),"")},String.prototype.digitsOnly=function(){return Salla.helpers.digitsOnly(this)};var $e={digitsOnly:function(t){return Te(t,true).replace(/[^0-9.]/g,"").replace("..",".").rtrim(".")},inputDigitsOnly:function t(n,r){if(void 0===r&&(r=false),"string"==typeof n)return document.querySelectorAll(n).forEach((function(n){return t(n,r)}));if(n){var e=Salla.helpers.digitsOnly(n.value);return n.min&&e<parseInt(n.min)?n.value=n.min:n.max&&e>parseInt(n.max)?n.value=n.max:n.maxLength>=1&&e.toString().length>n.maxLength?n.value=e.toString().substring(0,n.maxLength):n.value=r||n.dataset.hasOwnProperty("digitsWithDecimal")?Pe(e):e.replace(/\D/g,"")}Salla.logger.warn("Can't find Object With Id: "+n)},number:Te,money:function(t,n){void 0===n&&(n=true);var r=Salla.config.currency(null==t?void 0:t.currency).symbol;return t=Te(t="object"==typeof t?t.amount:t)+" "+r,n&&["SAR","ر.س"].includes(r)&&Salla.config.get("store.settings.use_sar_symbol")&&(t=t.replace(r,"<i class=sicon-sar></i>")),t},isIframe:De,isPreview:function(){return De()},setNested:function(t,n,r){for(var e=t,i=n.split("."),a=i.length,o=0;o<a-1;o++){var u=i[o];e[u]||(e[u]={}),e=e[u]}return e[i[a-1]]=r,t},getNested:function(t,n,r){var e=Wr(t,n);return void 0!==e?e:r},inputData:function(t,n,r){if(void 0===r&&(r={}),t.includes("[")){var e=t.split("]").join("").split("["),i=e[0],a=r&&"object"==typeof r?r[i]:void 0;return{name:i,value:Ce(e.slice(1),n,a)}}return{name:t,value:n}},url:Object.freeze({__proto__:null,addParamToUrl:Fe,api:function(t){var n;return(null===(n=Salla.config.get("store.api",Re("")))||void 0===n?void 0:n.rtrim("/"))+"/"+(null==t?void 0:t.ltrim("/"))},asset:Ne,base:function(t){return ze(t)?t:"https://"+new URL(Re("/")).hostname+"/"+(null==t?void 0:t.ltrim("/"))},baseUrl:Ue,cdn:function(t,n,r){var e="https://cdn.salla.network/";return(n||r)&&(n=n?",width=".concat(n):"",r=r?",height=".concat(r):"",e+="cdn-cgi/image/fit=scale-down".concat(n).concat(r,",onerror=redirect,format=auto/")),e+(null==t?void 0:t.ltrim("/"))},domain:function(t){return ze(t)?t:"".concat(Salla.config.get("store.url",window.location.href.split("/").slice(0,-1).join("/")).rtrim("/"),"/").concat(null==t?void 0:t.ltrim("/"))},get:Re,is_full_url:ze,is_page:function(t){return t&&Salla.config.get("page.slug")===t},is_placeholder:function(t){return Ne(salla.config.get("theme.settings.placeholder"))===Ne(t)}}),addParamToUrl:Fe,debounce:function(t,n){n=n||100;var r,e=[];return function(){for(var i=[],a=0;a<arguments.length;a++)i[a]=arguments[a];return clearTimeout(r),r=setTimeout((function(){var n=t.apply(void 0,i);e.forEach((function(t){return t(n)})),e=[]}),n),new Promise((function(t){return e.push(t)}))}},hasApplePay:function(){var t;try{return!!(null===(t=window.ApplePaySession)||void 0===t?void 0:t.canMakePayments())}catch(t){return console.error(t),false}}},Le=function(t,n){return Le=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])},Le(t,n)};var Me=function(){return Me=Object.assign||function(t){for(var n,r=1,e=arguments.length;r<e;r++)for(var i in n=arguments[r])Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i]);return t},Me.apply(this,arguments)};function qe(t,n,r){if(2===arguments.length)for(var e,i=0,a=n.length;i<a;i++)!e&&i in n||(e||(e=Array.prototype.slice.call(n,0,i)),e[i]=n[i]);return t.concat(e||Array.prototype.slice.call(n))}"function"==typeof SuppressedError&&SuppressedError;var Be,Je,Ge,Ve,He=(Be=console,Je=[],Ge=[],Ve={log:functi