UNPKG

@salla.sa/twilight-components

Version:
4 lines 360 kB
/*! * Crafted with ❤ by Salla */ function t(t,e){return e.forEach((function(e){e&&"string"!=typeof e&&!Array.isArray(e)&&Object.keys(e).forEach((function(n){if("default"!==n&&!(n in t)){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}}))})),Object.freeze(t)}var e,n,r,i,o,s,a,u,l,c,d,f,h,p,m,g,v,b,y,w,D,F,S,E,A,C,k,_,j,x,O,I,$,B,P,T,R,z,U,L,N,q,M,J,G,H,V,W,K,Q,X,Z,Y,tt,et,nt,rt,it,ot,st,at,ut,lt,ct,dt,ft,ht,pt,mt,gt,vt,bt,yt,wt,Dt,Ft,St,Et,At,Ct,kt,_t,jt,xt,Ot,It,$t,Bt,Pt,Tt,Rt,zt,Ut,Lt,Nt,qt,Mt,Jt,Gt,Ht,Vt,Wt,Kt,Qt,Xt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Zt(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Yt(){return n?e:(n=1,e=Array.isArray)}function te(){if(s)return o;s=1;var t=i?r:(i=1,r="object"==typeof Xt&&Xt&&Xt.Object===Object&&Xt),e="object"==typeof self&&self&&self.Object===Object&&self,n=t||e||Function("return this")();return o=n}function ee(){if(u)return a;u=1;var t=te();return a=t.Symbol}function ne(){if(p)return h;p=1;var t=ee(),e=function(){if(c)return l;c=1;var t=ee(),e=Object.prototype,n=e.hasOwnProperty,r=e.toString,i=t?t.toStringTag:void 0;return l=function(t){var e=n.call(t,i),o=t[i];try{t[i]=void 0;var s=!0}catch(t){}var a=r.call(t);return s&&(e?t[i]=o:delete t[i]),a}}(),n=function(){if(f)return d;f=1;var t=Object.prototype.toString;return d=function(e){return t.call(e)}}(),r=t?t.toStringTag:void 0;return h=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":r&&r in Object(t)?e(t):n(t)}}function re(){if(b)return v;b=1;var t=ne(),e=g?m:(g=1,m=function(t){return null!=t&&"object"==typeof t});return v=function(n){return"symbol"==typeof n||e(n)&&"[object Symbol]"==t(n)}}function ie(){return F?D:(F=1,D=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)})}function oe(){if(I)return O;I=1;var t=function(){if(E)return S;E=1;var t=ne(),e=ie();return S=function(n){if(!e(n))return!1;var r=t(n);return"[object Function]"==r||"[object GeneratorFunction]"==r||"[object AsyncFunction]"==r||"[object Proxy]"==r}}(),e=function(){if(_)return k;_=1;var t=function(){if(C)return A;C=1;var t=te();return A=t["__core-js_shared__"]}(),e=function(){var e=/[^.]+$/.exec(t&&t.keys&&t.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();return k=function(t){return!!e&&e in t}}(),n=ie(),r=function(){if(x)return j;x=1;var t=Function.prototype.toString;return j=function(e){if(null!=e){try{return t.call(e)}catch(t){}try{return e+""}catch(t){}}return""}}(),i=/^\[object .+?Constructor\]$/,o=RegExp("^"+Function.prototype.toString.call(Object.prototype.hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");return O=function(s){return!(!n(s)||e(s))&&(t(s)?o:i).test(r(s))}}function se(){if(T)return P;T=1;var t=oe(),e=B?$:(B=1,$=function(t,e){return null==t?void 0:t[e]});return P=function(n,r){var i=e(n,r);return t(i)?i:void 0}}function ae(){if(z)return R;z=1;var t=se()(Object,"create");return R=t}function ue(){if(nt)return et;nt=1;var t=tt?Y:(tt=1,Y=function(t,e){return t===e||t!=t&&e!=e});return et=function(e,n){for(var r=e.length;r--;)if(t(e[r][0],n))return r;return-1}}function le(){if(gt)return mt;gt=1;var t=function(){if(Q)return K;Q=1;var t=function(){if(L)return U;L=1;var t=ae();return U=function(){this.__data__=t?t(null):{},this.size=0}}(),e=q?N:(q=1,N=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}),n=function(){if(J)return M;J=1;var t=ae(),e=Object.prototype.hasOwnProperty;return M=function(n){var r=this.__data__;if(t){var i=r[n];return"__lodash_hash_undefined__"===i?void 0:i}return e.call(r,n)?r[n]:void 0}}(),r=function(){if(H)return G;H=1;var t=ae(),e=Object.prototype.hasOwnProperty;return G=function(n){var r=this.__data__;return t?void 0!==r[n]:e.call(r,n)}}(),i=function(){if(W)return V;W=1;var t=ae();return V=function(e,n){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=t&&void 0===n?"__lodash_hash_undefined__":n,this}}();function o(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}return o.prototype.clear=t,o.prototype.delete=e,o.prototype.get=n,o.prototype.has=r,o.prototype.set=i,K=o}(),e=function(){if(ft)return dt;ft=1;var t=Z?X:(Z=1,X=function(){this.__data__=[],this.size=0}),e=function(){if(it)return rt;it=1;var t=ue(),e=Array.prototype.splice;return rt=function(n){var r=this.__data__,i=t(r,n);return!(i<0||(i==r.length-1?r.pop():e.call(r,i,1),--this.size,0))}}(),n=function(){if(st)return ot;st=1;var t=ue();return ot=function(e){var n=this.__data__,r=t(n,e);return r<0?void 0:n[r][1]}}(),r=function(){if(ut)return at;ut=1;var t=ue();return at=function(e){return t(this.__data__,e)>-1}}(),i=function(){if(ct)return lt;ct=1;var t=ue();return lt=function(e,n){var r=this.__data__,i=t(r,e);return i<0?(++this.size,r.push([e,n])):r[i][1]=n,this}}();function o(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}return o.prototype.clear=t,o.prototype.delete=e,o.prototype.get=n,o.prototype.has=r,o.prototype.set=i,dt=o}(),n=function(){if(pt)return ht;pt=1;var t=se()(te(),"Map");return ht=t}();return mt=function(){this.size=0,this.__data__={hash:new t,map:new(n||e),string:new t}}}function ce(){if(wt)return yt;wt=1;var t=bt?vt:(bt=1,vt=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t});return yt=function(e,n){var r=e.__data__;return t(n)?r["string"==typeof n?"string":"hash"]:r.map},yt}function de(){if(Bt)return $t;Bt=1;var t=function(){if(It)return Ot;It=1;var t=function(){if(xt)return jt;xt=1;var t=le(),e=function(){if(Ft)return Dt;Ft=1;var t=ce();return Dt=function(e){var n=t(this,e).delete(e);return this.size-=n?1:0,n}}(),n=function(){if(Et)return St;Et=1;var t=ce();return St=function(e){return t(this,e).get(e)}}(),r=function(){if(Ct)return At;Ct=1;var t=ce();return At=function(e){return t(this,e).has(e)}}(),i=function(){if(_t)return kt;_t=1;var t=ce();return kt=function(e,n){var r=t(this,e),i=r.size;return r.set(e,n),this.size+=r.size==i?0:1,this}}();function o(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}return o.prototype.clear=t,o.prototype.delete=e,o.prototype.get=n,o.prototype.has=r,o.prototype.set=i,jt=o}();function e(n,r){if("function"!=typeof n||null!=r&&"function"!=typeof r)throw new TypeError("Expected a function");var i=function(){var t=arguments,e=r?r.apply(this,t):t[0],o=i.cache;if(o.has(e))return o.get(e);var s=n.apply(this,t);return i.cache=o.set(e,s)||o,s};return i.cache=new(e.Cache||t),i}return e.Cache=t,Ot=e}();return $t=function(e){var n=t(e,(function(t){return 500===r.size&&r.clear(),t})),r=n.cache;return n}}function fe(){if(Jt)return Mt;Jt=1;var t=Yt(),e=function(){if(w)return y;w=1;var t=Yt(),e=re(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;return y=function(i,o){if(t(i))return!1;var s=typeof i;return!("number"!=s&&"symbol"!=s&&"boolean"!=s&&null!=i&&!e(i))||r.test(i)||!n.test(i)||null!=o&&i in Object(o)}}(),n=function(){if(Tt)return Pt;Tt=1;var t=de(),e=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,n=/\\(\\)?/g,r=t((function(t){var r=[];return 46===t.charCodeAt(0)&&r.push(""),t.replace(e,(function(t,e,i,o){r.push(i?o.replace(n,"$1"):e||t)})),r}));return Pt=r}(),r=function(){if(qt)return Nt;qt=1;var t=function(){if(Lt)return Ut;Lt=1;var t=ee(),e=zt?Rt:(zt=1,Rt=function(t,e){for(var n=-1,r=null==t?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}),n=Yt(),r=re(),i=t?t.prototype:void 0,o=i?i.toString:void 0;return Ut=function t(i){if("string"==typeof i)return i;if(n(i))return e(i,t)+"";if(r(i))return o?o.call(i):"";var s=i+"";return"0"==s&&1/i==-1/0?"-0":s}}();return Nt=function(e){return null==e?"":t(e)}}();return Mt=function(i,o){return t(i)?i:e(i,o)?[i]:n(r(i))}}var he,pe,me,ge,ve,be=Zt(function(){if(Qt)return Kt;Qt=1;var t=function(){if(Wt)return Vt;Wt=1;var t=fe(),e=function(){if(Ht)return Gt;Ht=1;var t=re();return Gt=function(e){if("string"==typeof e||t(e))return e;var n=e+"";return"0"==n&&1/e==-1/0?"-0":n}}();return Vt=function(n,r){for(var i=0,o=(r=t(r,n)).length;null!=n&&i<o;)n=n[e(r[i++])];return i&&i==o?n:void 0}}();return Kt=function(e,n,r){var i=null==e?void 0:t(e,n);return void 0===i?r:i}}()),ye={exports:{}},we=(he||(he=1,function(t){!function(e){var n=Object.hasOwnProperty,r=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},i="object"==typeof process&&"function"==typeof process.nextTick,o="function"==typeof Symbol,s="object"==typeof Reflect,a="function"==typeof setImmediate?setImmediate:setTimeout,u=o?s&&"function"==typeof Reflect.ownKeys?Reflect.ownKeys:function(t){var e=Object.getOwnPropertyNames(t);return e.push.apply(e,Object.getOwnPropertySymbols(t)),e}:Object.keys;function l(){this._events={},this._conf&&c.call(this,this._conf)}function c(t){t&&(this._conf=t,t.delimiter&&(this.delimiter=t.delimiter),t.maxListeners!==e&&(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),this.wildcard&&(this.listenerTree={}))}function d(t,e){var n="(node) warning: possible EventEmitter memory leak detected. "+t+" listeners added. Use emitter.setMaxListeners() to increase limit.";if(this.verboseMemoryLeak&&(n+=" Event name: "+e+"."),"undefined"!=typeof process&&process.emitWarning){var r=Error(n);r.name="MaxListenersExceededWarning",r.emitter=this,r.count=t,process.emitWarning(r)}else console.error(n),console.trace&&console.trace()}var f=function(t,e,n){var r=arguments.length;switch(r){case 0:return[];case 1:return[t];case 2:return[t,e];case 3:return[t,e,n];default:for(var i=Array(r);r--;)i[r]=arguments[r];return i}};function h(t,n){for(var r={},i=t.length,o=0;o<i;o++)r[t[o]]=o<0?n[o]:e;return r}function p(t,e,n){var r,i;if(this._emitter=t,this._target=e,this._listeners={},this._listenersCount=0,(n.on||n.off)&&(r=n.on,i=n.off),e.addEventListener?(r=e.addEventListener,i=e.removeEventListener):e.addListener?(r=e.addListener,i=e.removeListener):e.on&&(r=e.on,i=e.off),!r&&!i)throw Error("target does not implement any known event API");if("function"!=typeof r)throw TypeError("on method must be a function");if("function"!=typeof i)throw TypeError("off method must be a function");this._on=r,this._off=i;var o=t._observers;o?o.push(this):t._observers=[this]}function m(t,r,i){var o=Object.assign({},r);if(!t)return o;if("object"!=typeof t)throw TypeError("options must be an object");var s,a,u,l=Object.keys(t),c=l.length;function d(t){throw Error('Invalid "'+s+'" option value'+(t?". Reason: "+t:""))}for(var f=0;f<c;f++){if(!n.call(r,s=l[f]))throw Error('Unknown "'+s+'" option');(a=t[s])!==e&&(o[s]=(u=i[s])?u(a,d):a)}return o}function g(t,e){return"function"==typeof t&&t.hasOwnProperty("prototype")||e("value must be a constructor"),t}function v(t){var e="value must be type of "+t.join("|"),n=t.length,r=t[0],i=t[1];return 1===n?function(t,n){if(typeof t===r)return t;n(e)}:2===n?function(t,n){var o=typeof t;if(o===r||o===i)return t;n(e)}:function(r,i){for(var o=typeof r,s=n;s-- >0;)if(o===t[s])return r;i(e)}}Object.assign(p.prototype,{subscribe:function(t,e,n){var r=this,i=this._target,o=this._emitter,s=this._listeners,a=function(){var r=f.apply(null,arguments),s={data:r,name:e,original:t};n?!1!==n.call(i,s)&&o.emit.apply(o,[s.name].concat(r)):o.emit.apply(o,[e].concat(r))};if(s[t])throw Error("Event '"+t+"' is already listening");this._listenersCount++,o._newListener&&o._removeListener&&!r._onNewListener?(this._onNewListener=function(n){n===e&&null===s[t]&&(s[t]=a,r._on.call(i,t,a))},o.on("newListener",this._onNewListener),this._onRemoveListener=function(n){n===e&&!o.hasListeners(n)&&s[t]&&(s[t]=null,r._off.call(i,t,a))},s[t]=null,o.on("removeListener",this._onRemoveListener)):(s[t]=a,r._on.call(i,t,a))},unsubscribe:function(t){var e,n,r,i=this,o=this._listeners,s=this._emitter,a=this._off,l=this._target;if(t&&"string"!=typeof t)throw TypeError("event must be a string");function c(){i._onNewListener&&(s.off("newListener",i._onNewListener),s.off("removeListener",i._onRemoveListener),i._onNewListener=null,i._onRemoveListener=null);var t=D.call(s,i);s._observers.splice(t,1)}if(t){if(!(e=o[t]))return;a.call(l,t,e),delete o[t],--this._listenersCount||c()}else{for(r=(n=u(o)).length;r-- >0;)a.call(l,t=n[r],o[t]);this._listeners={},this._listenersCount=0,c()}}});var b=v(["function"]),y=v(["object","function"]);function w(t,e,n){var r,i,o,s=0,a=new t((function(u,l,c){function d(){i&&(i=null),s&&(clearTimeout(s),s=0)}n=m(n,{timeout:0,overload:!1},{timeout:function(t,e){return("number"!=typeof(t*=1)||t<0||!Number.isFinite(t))&&e("timeout must be a positive number"),t}});var f=function(t){d(),u(t)},h=function(t){d(),l(t)};(r=!n.overload&&"function"==typeof t.prototype.cancel&&"function"==typeof c)?e(f,h,c):(i=[function(t){h(t||Error("canceled"))}],e(f,h,(function(t){if(o)throw Error("Unable to subscribe on cancel event asynchronously");if("function"!=typeof t)throw TypeError("onCancel callback must be a function");i.push(t)})),o=!0),n.timeout>0&&(s=setTimeout((function(){var t=Error("timeout");t.code="ETIMEDOUT",s=0,a.cancel(t),l(t)}),n.timeout))}));return r||(a.cancel=function(t){if(i){for(var e=i.length,n=1;n<e;n++)i[n](t);i[0](t),i=null}}),a}function D(t){var e=this._observers;if(!e)return-1;for(var n=e.length,r=0;r<n;r++)if(e[r]._target===t)return r;return-1}function F(t,e,n,r,i){if(!n)return null;if(0===r){var o=typeof e;if("string"===o){var s,a,l=0,c=0,d=this.delimiter,f=d.length;if(-1!==(a=e.indexOf(d))){s=[,,,,,];do{s[l++]=e.slice(c,a),c=a+f}while(-1!==(a=e.indexOf(d,c)));s[l++]=e.slice(c),e=s,i=l}else e=[e],i=1}else"object"===o?i=e.length:(e=[e],i=1)}var h,p,m,g,v,b,y,w=null,D=e[r],S=e[r+1];if(r===i)n._listeners&&("function"==typeof n._listeners?(t&&t.push(n._listeners),w=[n]):(t&&t.push.apply(t,n._listeners),w=[n]));else{if("*"===D){for(a=(b=u(n)).length;a-- >0;)"_listeners"!==(h=b[a])&&(y=F(t,e,n[h],r+1,i))&&(w?w.push.apply(w,y):w=y);return w}if("**"===D){for((v=r+1===i||r+2===i&&"*"===S)&&n._listeners&&(w=F(t,e,n,i,i)),a=(b=u(n)).length;a-- >0;)"_listeners"!==(h=b[a])&&("*"===h||"**"===h?(n[h]._listeners&&!v&&(y=F(t,e,n[h],i,i))&&(w?w.push.apply(w,y):w=y),y=F(t,e,n[h],r,i)):y=F(t,e,n[h],h===S?r+2:r,i),y&&(w?w.push.apply(w,y):w=y));return w}n[D]&&(w=F(t,e,n[D],r+1,i))}if((p=n["*"])&&F(t,e,p,r+1,i),m=n["**"])if(r<i)for(m._listeners&&F(t,e,m,i,i),a=(b=u(m)).length;a-- >0;)"_listeners"!==(h=b[a])&&(h===S?F(t,e,m[h],r+2,i):h===D?F(t,e,m[h],r+1,i):((g={})[h]=m[h],F(t,e,{"**":g},r+1,i)));else m._listeners?F(t,e,m,i,i):m["*"]&&m["*"]._listeners&&F(t,e,m["*"],i,i);return w}function S(t,e,n){var r,i,o=0,s=0,a=this.delimiter,u=a.length;if("string"==typeof t)if(-1!==(r=t.indexOf(a))){i=[,,,,,];do{i[o++]=t.slice(s,r),s=r+u}while(-1!==(r=t.indexOf(a,s)));i[o++]=t.slice(s)}else i=[t],o=1;else i=t,o=t.length;if(o>1)for(r=0;r+1<o;r++)if("**"===i[r]&&"**"===i[r+1])return;var l,c=this.listenerTree;for(r=0;r<o;r++)if(c=c[l=i[r]]||(c[l]={}),r===o-1)return c._listeners?("function"==typeof c._listeners&&(c._listeners=[c._listeners]),n?c._listeners.unshift(e):c._listeners.push(e),!c._listeners.warned&&this._maxListeners>0&&c._listeners.length>this._maxListeners&&(c._listeners.warned=!0,d.call(this,c._listeners.length,l))):c._listeners=e,!0;return!0}function E(t,e,n,r){for(var i,o,s,a,l=u(t),c=l.length,d=t._listeners;c-- >0;)i=t[o=l[c]],s="_listeners"===o?n:n?n.concat(o):[o],a=r||"symbol"==typeof o,d&&e.push(a?s:s.join(this.delimiter)),"object"==typeof i&&E.call(this,i,e,s,a);return e}function A(t){for(var e,n,r,i=u(t),o=i.length;o-- >0;)(e=t[n=i[o]])&&(r=!0,"_listeners"===n||A(e)||delete t[n]);return r}function C(t,e,n){this.emitter=t,this.event=e,this.listener=n}function k(t,n,r){if(!0===r)s=!0;else if(!1===r)o=!0;else{if(!r||"object"!=typeof r)throw TypeError("options should be an object or true");var o=r.async,s=r.promisify,u=r.nextTick,l=r.objectify}if(o||u||s){var c=n,d=n._origin||n;if(u&&!i)throw Error("process.nextTick is not supported");s===e&&(s="AsyncFunction"===n.constructor.name),n=function(){var t=arguments,e=this,n=this.event;return s?u?Promise.resolve():new Promise((function(t){a(t)})).then((function(){return e.event=n,c.apply(e,t)})):(u?process.nextTick:a)((function(){e.event=n,c.apply(e,t)}))},n._async=!0,n._origin=d}return[n,l?new C(this,t,n):this]}function _(t){this._events={},this._newListener=!1,this._removeListener=!1,this.verboseMemoryLeak=!1,c.call(this,t)}C.prototype.off=function(){return this.emitter.off(this.event,this.listener),this},_.EventEmitter2=_,_.prototype.listenTo=function(t,n,i){if("object"!=typeof t)throw TypeError("target musts be an object");var o=this;function s(e){if("object"!=typeof e)throw TypeError("events must be an object");var n,r=i.reducers,s=D.call(o,t);n=-1===s?new p(o,t,i):o._observers[s];for(var a,l=u(e),c=l.length,d="function"==typeof r,f=0;f<c;f++)n.subscribe(a=l[f],e[a]||a,d?r:r&&r[a])}return i=m(i,{on:e,off:e,reducers:e},{on:b,off:b,reducers:y}),r(n)?s(h(n)):s("string"==typeof n?h(n.split(/\s+/)):n),this},_.prototype.stopListeningTo=function(t,e){var n=this._observers;if(!n)return!1;var r,i=n.length,o=!1;if(t&&"object"!=typeof t)throw TypeError("target should be an object");for(;i-- >0;)r=n[i],t&&r._target!==t||(r.unsubscribe(e),o=!0);return o},_.prototype.delimiter=".",_.prototype.setMaxListeners=function(t){t!==e&&(this._maxListeners=t,this._conf||(this._conf={}),this._conf.maxListeners=t)},_.prototype.getMaxListeners=function(){return this._maxListeners},_.prototype.event="",_.prototype.once=function(t,e,n){return this._once(t,e,!1,n)},_.prototype.prependOnceListener=function(t,e,n){return this._once(t,e,!0,n)},_.prototype._once=function(t,e,n,r){return this._many(t,1,e,n,r)},_.prototype.many=function(t,e,n,r){return this._many(t,e,n,!1,r)},_.prototype.prependMany=function(t,e,n,r){return this._many(t,e,n,!0,r)},_.prototype._many=function(t,e,n,r,i){var o=this;if("function"!=typeof n)throw Error("many only accepts instances of Function");function s(){return 0==--e&&o.off(t,s),n.apply(this,arguments)}return s._origin=n,this._on(t,s,r,i)},_.prototype.emit=function(){if(!this._events&&!this._all)return!1;this._events||l.call(this);var t,e,n,r,i,s,a=arguments[0],u=this.wildcard;if("newListener"===a&&!this._newListener&&!this._events.newListener)return!1;if(u&&(t=a,"newListener"!==a&&"removeListener"!==a&&"object"==typeof a)){if(n=a.length,o)for(r=0;r<n;r++)if("symbol"==typeof a[r]){s=!0;break}s||(a=a.join(this.delimiter))}var c,d=arguments.length;if(this._all&&this._all.length)for(r=0,n=(c=this._all.slice()).length;r<n;r++)switch(this.event=a,d){case 1:c[r].call(this,a);break;case 2:c[r].call(this,a,arguments[1]);break;case 3:c[r].call(this,a,arguments[1],arguments[2]);break;default:c[r].apply(this,arguments)}if(u)F.call(this,c=[],t,this.listenerTree,0,n);else{if("function"==typeof(c=this._events[a])){switch(this.event=a,d){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:for(e=Array(d-1),i=1;i<d;i++)e[i-1]=arguments[i];c.apply(this,e)}return!0}c&&(c=c.slice())}if(c&&c.length){if(d>3)for(e=Array(d-1),i=1;i<d;i++)e[i-1]=arguments[i];for(r=0,n=c.length;r<n;r++)switch(this.event=a,d){case 1:c[r].call(this);break;case 2:c[r].call(this,arguments[1]);break;case 3:c[r].call(this,arguments[1],arguments[2]);break;default:c[r].apply(this,e)}return!0}if(!this.ignoreErrors&&!this._all&&"error"===a)throw arguments[1]instanceof Error?arguments[1]:Error("Uncaught, unspecified 'error' event.");return!!this._all},_.prototype.emitAsync=function(){if(!this._events&&!this._all)return!1;this._events||l.call(this);var t,e,n,r,i,s,a=arguments[0],u=this.wildcard;if("newListener"===a&&!this._newListener&&!this._events.newListener)return Promise.resolve([!1]);if(u&&(t=a,"newListener"!==a&&"removeListener"!==a&&"object"==typeof a)){if(r=a.length,o)for(i=0;i<r;i++)if("symbol"==typeof a[i]){e=!0;break}e||(a=a.join(this.delimiter))}var c,d=[],f=arguments.length;if(this._all)for(i=0,r=this._all.length;i<r;i++)switch(this.event=a,f){case 1:d.push(this._all[i].call(this,a));break;case 2:d.push(this._all[i].call(this,a,arguments[1]));break;case 3:d.push(this._all[i].call(this,a,arguments[1],arguments[2]));break;default:d.push(this._all[i].apply(this,arguments))}if(u?F.call(this,c=[],t,this.listenerTree,0):c=this._events[a],"function"==typeof c)switch(this.event=a,f){case 1:d.push(c.call(this));break;case 2:d.push(c.call(this,arguments[1]));break;case 3:d.push(c.call(this,arguments[1],arguments[2]));break;default:for(n=Array(f-1),s=1;s<f;s++)n[s-1]=arguments[s];d.push(c.apply(this,n))}else if(c&&c.length){if(c=c.slice(),f>3)for(n=Array(f-1),s=1;s<f;s++)n[s-1]=arguments[s];for(i=0,r=c.length;i<r;i++)switch(this.event=a,f){case 1:d.push(c[i].call(this));break;case 2:d.push(c[i].call(this,arguments[1]));break;case 3:d.push(c[i].call(this,arguments[1],arguments[2]));break;default:d.push(c[i].apply(this,n))}}else if(!this.ignoreErrors&&!this._all&&"error"===a)return Promise.reject(arguments[1]instanceof Error?arguments[1]:"Uncaught, unspecified 'error' event.");return Promise.all(d)},_.prototype.on=function(t,e,n){return this._on(t,e,!1,n)},_.prototype.prependListener=function(t,e,n){return this._on(t,e,!0,n)},_.prototype.onAny=function(t){return this._onAny(t,!1)},_.prototype.prependAny=function(t){return this._onAny(t,!0)},_.prototype.addListener=_.prototype.on,_.prototype._onAny=function(t,e){if("function"!=typeof t)throw Error("onAny only accepts instances of Function");return this._all||(this._all=[]),e?this._all.unshift(t):this._all.push(t),this},_.prototype._on=function(t,n,r,i){if("function"==typeof t)return this._onAny(t,n),this;if("function"!=typeof n)throw Error("on only accepts instances of Function");this._events||l.call(this);var o,s=this;return i!==e&&(n=(o=k.call(this,t,n,i))[0],s=o[1]),this._newListener&&this.emit("newListener",t,n),this.wildcard?(S.call(this,t,n,r),s):(this._events[t]?("function"==typeof this._events[t]&&(this._events[t]=[this._events[t]]),r?this._events[t].unshift(n):this._events[t].push(n),!this._events[t].warned&&this._maxListeners>0&&this._events[t].length>this._maxListeners&&(this._events[t].warned=!0,d.call(this,this._events[t].length,t))):this._events[t]=n,s)},_.prototype.off=function(t,e){if("function"!=typeof e)throw Error("removeListener only takes instances of Function");var n,i=[];if(this.wildcard){var o="string"==typeof t?t.split(this.delimiter):t.slice();if(!(i=F.call(this,null,o,this.listenerTree,0)))return this}else{if(!this._events[t])return this;i.push({_listeners:n=this._events[t]})}for(var s=0;s<i.length;s++){var a=i[s];if(r(n=a._listeners)){for(var u=-1,l=0,c=n.length;l<c;l++)if(n[l]===e||n[l].listener&&n[l].listener===e||n[l]._origin&&n[l]._origin===e){u=l;break}if(u<0)continue;return this.wildcard?a._listeners.splice(u,1):this._events[t].splice(u,1),0===n.length&&(this.wildcard?delete a._listeners:delete this._events[t]),this._removeListener&&this.emit("removeListener",t,e),this}(n===e||n.listener&&n.listener===e||n._origin&&n._origin===e)&&(this.wildcard?delete a._listeners:delete this._events[t],this._removeListener&&this.emit("removeListener",t,e))}return this.listenerTree&&A(this.listenerTree),this},_.prototype.offAny=function(t){var e,n=0,r=0;if(t&&this._all&&this._all.length>0){for(n=0,r=(e=this._all).length;n<r;n++)if(t===e[n])return e.splice(n,1),this._removeListener&&this.emit("removeListenerAny",t),this}else{if(e=this._all,this._removeListener)for(n=0,r=e.length;n<r;n++)this.emit("removeListenerAny",e[n]);this._all=[]}return this},_.prototype.removeListener=_.prototype.off,_.prototype.removeAllListeners=function(t){if(t===e)return!this._events||l.call(this),this;if(this.wildcard){var n,r=F.call(this,null,t,this.listenerTree,0);if(!r)return this;for(n=0;n<r.length;n++)r[n]._listeners=null;this.listenerTree&&A(this.listenerTree)}else this._events&&(this._events[t]=null);return this},_.prototype.listeners=function(t){var n,r,i,o,s,a=this._events;if(t===e){if(this.wildcard)throw Error("event name required for wildcard emitter");if(!a)return[];for(o=(n=u(a)).length,i=[];o-- >0;)"function"==typeof(r=a[n[o]])?i.push(r):i.push.apply(i,r);return i}if(this.wildcard){if(!(s=this.listenerTree))return[];var l=[],c="string"==typeof t?t.split(this.delimiter):t.slice();return F.call(this,l,c,s,0),l}return a&&(r=a[t])?"function"==typeof r?[r]:r:[]},_.prototype.eventNames=function(t){var e=this._events;return this.wildcard?E.call(this,this.listenerTree,[],null,t):e?u(e):[]},_.prototype.listenerCount=function(t){return this.listeners(t).length},_.prototype.hasListeners=function(t){if(this.wildcard){var n=[],r="string"==typeof t?t.split(this.delimiter):t.slice();return F.call(this,n,r,this.listenerTree,0),n.length>0}var i=this._events,o=this._all;return!!(o&&o.length||i&&(t===e?u(i).length:i[t]))},_.prototype.listenersAny=function(){return this._all?this._all:[]},_.prototype.waitFor=function(t,n){var r=this,i=typeof n;return"number"===i?n={timeout:n}:"function"===i&&(n={filter:n}),w((n=m(n,{timeout:0,filter:e,handleError:!1,Promise,overload:!1},{filter:b,Promise:g})).Promise,(function(e,i,o){function s(){var o=n.filter;if(!o||o.apply(r,arguments))if(r.off(t,s),n.handleError){var a=arguments[0];a?i(a):e(f.apply(null,arguments).slice(1))}else e(f.apply(null,arguments))}o((function(){r.off(t,s)})),r._on(t,s,!1)}),{timeout:n.timeout,overload:n.overload})};var j=_.prototype;Object.defineProperties(_,{defaultMaxListeners:{get:function(){return j._maxListeners},set:function(t){if("number"!=typeof t||t<0||Number.isNaN(t))throw TypeError("n must be a non-negative number");j._maxListeners=t},enumerable:!0},once:{value:function(t,e,n){return w((n=m(n,{Promise,timeout:0,overload:!1},{Promise:g})).Promise,(function(n,r,i){var o;if("function"==typeof t.addEventListener)return o=function(){n(f.apply(null,arguments))},i((function(){t.removeEventListener(e,o)})),void t.addEventListener(e,o,{once:!0});var s,a=function(){s&&t.removeListener("error",s),n(f.apply(null,arguments))};"error"!==e&&(s=function(n){t.removeListener(e,a),r(n)},t.once("error",s)),i((function(){s&&t.removeListener("error",s),t.removeListener(e,a)})),t.once(e,a)}),{timeout:n.timeout,overload:n.overload})},writable:!0,configurable:!0}}),Object.defineProperties(j,{_maxListeners:{value:10,writable:!0,configurable:!0},_observers:{value:null,writable:!0,configurable:!0}}),t.exports=_}()}(ye)),ye.exports);function De(){if(me)return pe;me=1;var t=Object.assign?Object.assign:function(t){for(var e=1;e<arguments.length;e++)i(Object(arguments[e]),(function(e,n){t[n]=e}));return t},e=function(){if(Object.create)return function(e,n,i,o){var s=r(arguments,1);return t.apply(this,[Object.create(e)].concat(s))};{function e(){}return function(n,i,o,s){var a=r(arguments,1);return e.prototype=n,t.apply(this,[new e].concat(a))}}}(),n="undefined"!=typeof window?window:Xt;function r(t,e){return Array.prototype.slice.call(t,e||0)}function i(t,e){o(t,(function(t,n){return e(t,n),!1}))}function o(t,e){if(s(t)){for(var n=0;n<t.length;n++)if(e(t[n],n))return t[n]}else for(var r in t)if(t.hasOwnProperty(r)&&e(t[r],r))return t[r]}function s(t){return null!=t&&"function"!=typeof t&&"number"==typeof t.length}return pe={assign:t,create:e,trim:String.prototype.trim?function(t){return String.prototype.trim.call(t)}:function(t){return t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},bind:function(t,e){return function(){return e.apply(t,Array.prototype.slice.call(arguments,0))}},slice:r,each:i,map:function(t,e){var n=s(t)?[]:{};return o(t,(function(t,r){return n[r]=e(t,r),!1})),n},pluck:o,isList:s,isFunction:function(t){return t&&"[object Function]"==={}.toString.call(t)},isObject:function(t){return t&&"[object Object]"==={}.toString.call(t)},Global:n},pe}var Fe,Se,Ee,Ae,Ce,ke,_e,je,xe=function(){if(ve)return ge;ve=1;var t=De(),e=t.slice,n=t.pluck,r=t.each,i=t.bind,o=t.create,s=t.isList,a=t.isFunction,u=t.isObject,l={version:"2.0.12",enabled:!1,get:function(t,e){var n=this.storage.read(this._namespacePrefix+t);return this._deserialize(n,e)},set:function(t,e){return void 0===e?this.remove(t):(this.storage.write(this._namespacePrefix+t,this._serialize(e)),e)},remove:function(t){this.storage.remove(this._namespacePrefix+t)},each:function(t){var e=this;this.storage.each((function(n,r){t.call(e,e._deserialize(n),(r||"").replace(e._namespaceRegexp,""))}))},clearAll:function(){this.storage.clearAll()},hasNamespace:function(t){return this._namespacePrefix=="__storejs_"+t+"_"},createStore:function(){return c.apply(this,arguments)},addPlugin:function(t){this._addPlugin(t)},namespace:function(t){return c(this.storage,this.plugins,t)}};function c(t,c,d){d||(d=""),t&&!s(t)&&(t=[t]),c&&!s(c)&&(c=[c]);var f=d?"__storejs_"+d+"_":"",h=d?RegExp("^"+f):null;if(!/^[a-zA-Z0-9_\-]*$/.test(d))throw Error("store.js namespaces can only have alphanumerics + underscores and dashes");var p={_namespacePrefix:f,_namespaceRegexp:h,_testStorage:function(t){try{var e="__storejs__test__";t.write(e,e);var n=t.read(e)===e;return t.remove(e),n}catch(t){return!1}},_assignPluginFnProp:function(t,n){var i=this[n];this[n]=function(){var n=e(arguments,0),o=this,s=[function(){if(i)return r(arguments,(function(t,e){n[e]=t})),i.apply(o,n)}].concat(n);return t.apply(o,s)}},_serialize:function(t){return JSON.stringify(t)},_deserialize:function(t,e){if(!t)return e;var n="";try{n=JSON.parse(t)}catch(e){n=t}return void 0!==n?n:e},_addStorage:function(t){this.enabled||this._testStorage(t)&&(this.storage=t,this.enabled=!0)},_addPlugin:function(t){var e=this;if(s(t))r(t,(function(t){e._addPlugin(t)}));else if(!n(this.plugins,(function(e){return t===e}))){if(this.plugins.push(t),!a(t))throw Error("Plugins must be function values that return objects");var i=t.call(this);if(!u(i))throw Error("Plugins must return an object of function properties");r(i,(function(n,r){if(!a(n))throw Error("Bad plugin property: "+r+" from plugin "+t.name+". Plugins should only return functions.");e._assignPluginFnProp(n,r)}))}},addStorage:function(t){!function(){var t=void 0===console?null:console;t&&(t.warn?t.warn:t.log).apply(t,arguments)}("store.addStorage(storage) is deprecated. Use createStore([storages])"),this._addStorage(t)}},m=o(p,l,{plugins:[]});return m.raw={},r(m,(function(t,e){a(t)&&(m.raw[e]=i(m,t))})),r(t,(function(t){m._addStorage(t)})),r(c,(function(t){m._addPlugin(t)})),m}return ge={createStore:c}}(),Oe=function(){if(Se)return Fe;Se=1;var t=De().Global;function e(){return t.localStorage}function n(t){return e().getItem(t)}return Fe={name:"localStorage",read:n,write:function(t,n){return e().setItem(t,n)},each:function(t){for(var r=e().length-1;r>=0;r--){var i=e().key(r);t(n(i),i)}},remove:function(t){return e().removeItem(t)},clearAll:function(){return e().clear()}},Fe}(),Ie=t({__proto__:null,default:Zt(Oe)},[Oe]),$e=function(){if(Ae)return Ee;Ae=1;var t=De().Global;function e(){return t.sessionStorage}function n(t){return e().getItem(t)}return Ee={name:"sessionStorage",read:n,write:function(t,n){return e().setItem(t,n)},each:function(t){for(var r=e().length-1;r>=0;r--){var i=e().key(r);t(n(i),i)}},remove:function(t){return e().removeItem(t)},clearAll:function(){return e().clear()}},Ee}(),Be=t({__proto__:null,default:Zt($e)},[$e]),Pe=function(){if(ke)return Ce;ke=1;var t=De(),e=t.trim;Ce={name:"cookieStorage",read:function(t){if(!t||!o(t))return null;var e="(?:^|.*;\\s*)"+escape(t).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=\\s*((?:[^;](?!;))*[^;]?).*";return unescape(n.cookie.replace(RegExp(e),"$1"))},write:function(t,e){t&&(n.cookie=escape(t)+"="+escape(e)+"; expires=Tue, 19 Jan 2038 03:14:07 GMT; path=/")},each:r,remove:i,clearAll:function(){r((function(t,e){i(e)}))}};var n=t.Global.document;function r(t){for(var r=n.cookie.split(/; ?/g),i=r.length-1;i>=0;i--)if(e(r[i])){var o=r[i].split("="),s=unescape(o[0]);t(unescape(o[1]),s)}}function i(t){t&&o(t)&&(n.cookie=escape(t)+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/")}function o(t){return RegExp("(?:^|;\\s*)"+escape(t).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=").test(n.cookie)}return Ce}(),Te=t({__proto__:null,default:Zt(Pe)},[Pe]),Re=function(){if(je)return _e;je=1,_e={name:"memoryStorage",read:function(e){return t[e]},write:function(e,n){t[e]=n},each:function(e){for(var n in t)t.hasOwnProperty(n)&&e(t[n],n)},remove:function(e){delete t[e]},clearAll:function(){t={}}};var t={};return _e}(),ze=t({__proto__:null,default:Zt(Re)},[Re]);function Ue(t,e){void 0===e&&(e=!1),t+="";for(var n,r=["٠","١","٢","٣","٤","٥","٦","٧","٨","٩"],i=["0","1","2","3","4","5","6","7","8","9"],o=(e=e||!Salla.config.get("store.settings.arabic_numbers_enabled"))?r:i,s=e?i:r,a=0;a<o.length;a++)n=RegExp(o[a],"g"),t=t.replace(n,s[a]);return t.replace(e?"٫":".",e?".":"٫")}function Le(t){var e=("".concat(t).match(/\./g)||[]).length;return e&&1!==e?Le(t.replace(/\.(.+)\./g,".$1")):t}function Ne(t){return"".concat(t).startsWith("https://")||"".concat(t).startsWith("http://")}function qe(t){if(Ne(t))return t;var e=Salla.config.get("store.url");return e||(e=window.location.href.split("/").slice(0,-1).join("/"),Salla.config.set("store.url",e)),e.rtrim("/")+"/"+(null==t?void 0:t.ltrim("/"))}function Me(t,e,n){if(n=n||window.location.href,!e||!t)return n;var r=RegExp("([?&])"+t+"=[^&]+[&]?","g");return(n=n.replace(r,"$1").split("#")[0].replace(/&$|\?$/,"")).includes("?")?n+="&":n+=(n.endsWith("/")?"":"/")+"?",(n+t+"="+encodeURIComponent(e)).replace(/&$|\?$/,"")}function Je(t){return window.location.origin+"/"+(null==t?void 0:t.ltrim("/"))}function Ge(t){return Ne(t)?t:Salla.config.get("theme.assets")?Salla.config.get("theme.assets").replace(":path",null==t?void 0:t.ltrim("/")):Je("themes/"+Salla.config.get("theme.name")+"/"+(null==t?void 0:t.ltrim("/")))}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:"#"+this},String.prototype.replaceArray=function(t,e){for(var n,r=this,i=0;i<t.length;i++)n=RegExp(t[i],"g"),r=r.replace(n,e[i]);return r},String.prototype.rtrim=function(t){return void 0===t&&(t="\\s"),this.replace(RegExp("["+t+"]*$"),"")},String.prototype.ltrim=function(t){return void 0===t&&(t="\\s"),this.replace(RegExp("^["+t+"]*"),"")},String.prototype.digitsOnly=function(){return Salla.helpers.digitsOnly(this)};var He=Object.freeze({__proto__:null,addParamToUrl:Me,api:function(t){var e;return(null===(e=Salla.config.get("store.api",qe("")))||void 0===e?void 0:e.rtrim("/"))+"/"+(null==t?void 0:t.ltrim("/"))},asset:Ge,base:function(t){return Ne(t)?t:"https://"+new URL(qe("/")).hostname+"/"+(null==t?void 0:t.ltrim("/"))},baseUrl:Je,cdn:function(t,e,n){var r="https://cdn.salla.network/";return(e||n)&&(e=e?",width=".concat(e):"",n=n?",height=".concat(n):"",r+="cdn-cgi/image/fit=scale-down".concat(e).concat(n,",onerror=redirect,format=auto/")),r+(null==t?void 0:t.ltrim("/"))},create:function(t,e){return"custom"===t?e:qe("offers"===t?t:"redirect/".concat(t,"/").concat(e))},domain:function(t){return Ne(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:qe,is_full_url:Ne,is_page:function(t){return t&&Salla.config.get("page.slug")===t},is_placeholder:function(t){return Ge(salla.config.get("theme.settings.placeholder"))===Ge(t)}}),Ve=function(t,e){return Ve=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},Ve(t,e)},We=function(){return We=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},We.apply(this,arguments)};function Ke(t,e,n){if(2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}function Qe(t){return t instanceof FormData}function Xe(t){return t instanceof File}function Ze(t){return t instanceof Blob}"function"==typeof SuppressedError&&SuppressedError;var Ye=function(){function t(t){this.data=t,this.proxy=this.createProxy()}return t.prototype.createProxy=function(){var t=this;return new Proxy(this,{get:function(e,n){return n in e?e[n]:"string"==typeof n?t.get(n):void 0},set:function(e,n,r){return"string"==typeof n&&(t.set(n,r),!0)},has:function(e,n){return"string"==typeof n?t.has(n):n in e},deleteProperty:function(e,n){return"string"==typeof n&&t.delete(n)}})},t.prototype.get=function(t){return Qe(this.data)?this.data.get(t):this.data[t]},t.prototype.getAll=function(t){if(Qe(this.data))return this.data.getAll(t);var e=this.data[t];return void 0===e?[]:[e]},t.prototype.set=function(t,e){var n=this;Qe(this.data)?(this.data.delete(t),null!=e&&(Array.isArray(e)?e.forEach((function(e){Xe(e)||Ze(e)?n.data.append(t,e):n.data.append(t,e+"")})):Xe(e)||Ze(e)?this.data.append(t,e):this.data.append(t,e+""))):this.data[t]=e},t.prototype.append=function(t,e){if(Qe(this.data))Xe(e)||Ze(e)?this.data.append(t,e):null!=e&&this.data.append(t,e+"");else{var n=this.data[t];void 0===n?this.data[t]=e:Array.isArray(n)?n.push(e):this.data[t]=[n,e]}},t.prototype.setFile=function(t,e){this.set(t,e)},t.prototype.getFile=function(t){var e=this.get(t);return Xe(e)?e:null},t.prototype.getFiles=function(t){return this.getAll(t).filter(Xe)},t.prototype.has=function(t){return Qe(this.data)?this.data.has(t):t in this.data},t.prototype.delete=function(t){return Qe(this.data)?(this.data.delete(t),!0):delete this.data[t]},t.prototype.keys=function(){if(!Qe(this.data))return Object.keys(this.data);for(var t=new Set,e=0,n=this.data.entries();e<n.length;e++)t.add(n[e][0]);return Array.from(t)},t.prototype.values=function(){if(!Qe(this.data))return Object.values(this.data);for(var t=[],e=0,n=this.data.entries();e<n.length;e++)t.push(n[e][1]);return t},t.prototype.entries=function(){return Qe(this.data)?Array.from(this.data.entries()):Object.entries(this.data)},t.prototype.toObject=function(){if(!Qe(this.data))return We({},this.data);for(var t={},e=0,n=this.data.entries();e<n.length;e++){var r=n[e],i=r[0],o=r[1];void 0!==t[i]?(Array.isArray(t[i])||(t[i]=[t[i]]),t[i].push(o)):t[i]=o}return t},t.prototype.getFileInfo=function(t){var e=this.getFiles(t);return 0===e.length?null:e.map((function(t){return{name:t.name,size:t.size,type:t.type}}))},t.prototype.isFile=function(t){var e=this.get(t);return Xe(e)||Ze(e)},t.prototype.getRawData=function(){return this.data},t.prototype.getProxy=function(){return this.proxy},t}();function tn(t,e,n){var r,i=t[0];return n&&0==t.length?Array.isArray(n)?(n.push(e),n):[n,e]:Array.isArray(n)?(n.push(e),n):"string"==typeof n?[n,e]:n?(n[i]=tn(t.slice(1),e,n[i]),n):i?((r={})[i]=tn(t.slice(1),e),r):""===i?[e]:e}function en(){return window.self!==window.top}var nn,rn,on,sn,an={digitsOnly:function(t){return Ue(t,!0).replace(/[^0-9.]/g,"").replace("..",".").rtrim(".")},inputDigitsOnly:function t(e,n){if(void 0===n&&(n=!1),"string"==typeof e)return document.querySelectorAll(e).forEach((function(e){return t(e,n)}));if(e){var r=Salla.helpers.digitsOnly(e.value);return e.value=e.min&&r<parseInt(e.min)?e.min:e.max&&r>parseInt(e.max)?e.max:e.maxLength>=1&&(""+r).length>e.maxLength?(""+r).substring(0,e.maxLength):n||e.dataset.hasOwnProperty("digitsWithDecimal")?Le(r):r.replace(/\D/g,"")}Salla.logger.warn("Can't find Object With Id: "+e)},number:Ue,money:function(t,e){void 0===e&&(e=!0);var n=Salla.config.currency(null==t?void 0:t.currency).symbol;return t=Ue(t="object"==typeof t?t.amount:t)+" "+n,e&&["SAR","ر.س"].includes(n)&&Salla.config.get("store.settings.use_sar_symbol")&&(t=t.replace(n,"<i class=sicon-sar></i>")),t},isIframe:en,isPreview:function(){return en()},setNested:function(t,e,n){for(var r=t,i=e.split("."),o=i.length,s=0;s<o-1;s++){var a=i[s];r[a]||(r[a]={}),r=r[a]}return r[i[o-1]]=n,t},getNested:function(t,e,n){var r=be.default?be.default(t,e):be(t,e);return void 0!==r?r:n},inputData:function(t,e,n){if(void 0===n&&(n={}),t.includes("[")){var r=t.split("]").join("").split("["),i=r[0],o=n&&"object"==typeof n?n[i]:void 0;return{name:i,value:tn(r.slice(1),e,o)}}return{name:t,value:e}},url:He,addParamToUrl:Me,debounce:function(t,e){e=e||100;var n,r=[];return function(){for(var i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];return clearTimeout(n),n=setTimeout((function(){var e=t.apply(void 0,i);r.forEach((function(t){return t(e)})),r=[]}),e),new Promise((function(t){return r.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),!1}},createFormDataWrapper:function(t){return new Ye(t).getProxy()},isAppleDevice:function(){try{var t=navigator.userAgent||"",e=navigator.platform||"";return/iPhone|iPad|iPod/i.test(t)||/Mac/i.test(e)}catch(t){return console.error(t),!1}},isIOSDevice:function(){try{var t=navigator.userAgent||"";return/iPhone|iPad|iPod/i.test(t)}catch(t){return console.error(t),!1}},isWebView:function(){try{if(void 0===window.navigator)return!1;var t=window.navigator.userAgent;return/iP(hone|od|ad)/.test(t)&&/AppleWebKit/.test(t)&&!/Safari/.test(t)||/\bwv\b/.test(t)||/Android/.test(t)&&/AppleWebKit/.test(t)&&!/Chrome/.test(t)}catch(t){return console.error(t),!1}}},un=(rn=[],on=[],sn={log:function(t,e){if(nn&&salla.config.isDebug()){rn.push([e,t]),"trace"===salla.config.get("debug")&&(e="trace");var n=nn.log,r=void 0===e?n:this.__dict__[e]||n,i=["%cTwilight","color: #5cd5c4;font-weight:bold; border:1px solid #5cd5c4; padding: 2px 6px; border-radius: 5px;"];on.forEach((function(t){i[0]+=t[0],i.push(t[1])}));var o={event:"#CFF680",backend:"#7b68ee"}[e];o&&(i[0]+="%c"+e[0].toUpperCase()+e.substring(1),i.push("margin-left: 5px;color: ".concat(o,";font-weight:bold; border:1px solid ").concat(o,"; padding: 2px 6px; border-radius: 5px;"))),r.call.apply(r,Ke([nn],i.concat.apply(i,t),!1))}},__dict__:{trace:(nn=console).trace,debug:nn.debug,info:nn.info,warn:nn.warn,error:nn.error}},{event:function(){sn.log(arguments,"event")},trace:function(){sn.log(arguments,"trace")},debug:function(){sn.log(arguments,"debug")},info:function(){sn.log(arguments,"info")},warn:function(){sn.log(arguments,"warn")},error:function(){sn.log(arguments,"error")},log:function(){sn.log(arguments,void 0)},backend:function(){sn.log(arguments,"backend")},logs:function(t){[t].flat().forEach((function(t){return t&&sn.log([t].flat(),"backend")}))},history:function(){return rn.map((function(t){return nn.log.apply(nn,Ke([t[0]],t[1],!1))})),rn},addPrefix:function(t){return Array.isArray(t)?on.unshift(t):this.warn("addPrefix receives array only!"),this}}),ln=function(){function t(t,e){void 0===t&&(t={}),void 0===e&&(e={}),this.default_properties=e,this.properties_=We(We({},this.default_properties),t)}return t.prototype.merge=function(t){var e;return this.properties_=We(We({},this.properties_),t),this.properties_.store=We(We({},(null===(e=this.default_properties)||void 0===e?void 0:e.store)||{}),this.properties_.store),this},t.prototype.set=function(t,e){return t.includes(".")?(Salla.helpers.setNested(this.properties_,t,e),this):(this.properties_[t]=e,this)},t.prototype.currency=function(t){return void 0===t&&(t=void 0),t=t||this.get("user.currency_code"),this.get("currencies."+t)||Object.values(this.get("currencies"))[0]},t.prototype.get=function(t,e){return void 0===e&&(e=null),t.includes(".")?Salla.helpers.getNested(this.properties_,t,e):this.properties_.hasOwnProperty(t)?this.properties_[t]||e:e||void 0},t.prototype.all=function(){return this.properties_},t.prototype.isDebug=function(){return this.get("debug")||Salla.storage.get("debug")},t}(),cn=function(t){function e(){var e=this;return(e=t.call(this,{wildcard:!0,delimiter:"::",newListener:!1,removeListener:!1,maxListeners:10,verboseMemoryLeak:!1,ignoreErrors:!1})||this).delimiter="::","undefined"!=typeof document&&(e.body=document.querySelector("body")),e.logableEvents=["cart::item.added.failed","cart::item.deleted.failed"],e.ingoreLogEvents=["document::click","document::keyup","document::change"],e.noneFireableActions=["document.request"],e.emittedEvents=new Set,e}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+e+" is not a constructor or null");function n(){this.constructor=t}Ve(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}(e,t),e.prototype.createAndDispatch=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];this.dispatch.apply(this,Ke([t],e,!1))},e.prototype.emit=function(e){for(var n,r=[],i=1;i<arguments.length;i++)r[i-1]=arguments[i];this.emittedEvents.add(e);var o=e.replace("::",".");if(!this.noneFireableActions.includes(o)&&Salla.call&&"function"==typeof Salla.call(o))return Salla.log("'Salla.".concat(o,"(...)' triggered using event '").concat(e,"'")),o=o.split("."),Array.isArray(r[0])&&(r=r[0]),void(n=salla[o[0]])[o[1]].apply(n,r);t.prototype.emit.apply(this,Ke([e],r,!1)),this.trackEvents.apply(this,Ke([e],r,!1))},e.prototype.onlyWhen=function(t,e){var n=this;return e=e||function(){},new Promise((function(r){return n.emittedEvents.has(t)?r(e()):n.once(t,(function(){return r(e())}))}))},e.prototype.emitAsync=function(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];this.emittedEvents.add(e);var i=t.prototype.emitAsync.apply(this,Ke([e],n,!1));try{this.trackEvents.apply(this,Ke([e],n,!1))}catch(t){Salla.logger.warn("error on tracking event (".concat(e,")"),n,t)}return i},e.prototype.trackEvents=function(t){for(var e,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];if("undefined"!=typeof window)try{window.dataLayer=window.dataLayer||[];var i={event:t};n.map((function(t){return"object"==typeof t&&(i=We(We({},i),t))})),window.dataLayer.push(i)}catch(t){salla.logger.error(t.message)}Salla.logger&&!this.ingoreLogEvents.includes(t)&&(e=Salla.logger).event.apply(e,Ke([t],n,!1)),this.dispatchMobileEvent.apply(this,Ke([t],n,!1))},e.prototype.dispatch=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return this.emit.apply(this,Ke([t],e,!1))},e.prototype.dispatchEvents=function(t){if(t)if("object"!=typeof t||Array.isArray(t))Salla.log("Events object is wrong, it should be object of {event:payload}",t);else for(var e=0,n=Object.entries(t);e<n.length;e++){var r=n[e];this.dispatch(r[0],r[1])}else Salla.log("No Events To Dispatch!",t)},e.prototype.addListener=function(t,e,n){return this.on(t,e,n)},e.prototype.addEventListener=function(t,e,n){return this.on(t,e,n)},e.prototype.listen=function(t,e){return this.on(t,e)},e.prototype.registerGlobalListener=function(t,e){return this.onAny(e)},e.prototype.dispatchMobileEvent=function(t,e){var n;if(void 0===e&&(e={}),"undefined"!=typeof window){if(window.webkit)try{return void window.webkit.messageHandlers.callbackHandler.postMessage(JSON.stringify({event:t,details:e}))}catch(t){Salla.log(t,"The native context does not exist yet")}if(null===(n=window.Android)||void 0===n?void 0:n.customEventWithData)try{window.Android.customEventWithData(t,JSON.stringify({details:e}))}catch(t){Salla.log(t,"The native context does not exist yet")}else if(window.flutter_inappwebview)try{window.flutter_inappwebview.callHandler("sallaEvent",{event:t,details:e})}catch(t){Salla.log(t,"The Flutter context does not exist yet")}}},e}(we.EventEmitter2),dn=xe.createStore([Ie,Be,Te,ze],[]),fn=xe.createStore([Be],[]),hn=xe.createStore([Te],[]),pn=function(){function t(){var t=this;this.clearableItems=["cart","user","salla::wishlist","token"],Salla.event.on("storage::item.remove",(function(e){return t.remove(e)})),Salla.event.on("storage::item.set",(function(e,n){return t.set(e,n)})),this.store=dn,this.session=fn,this.cookie=hn}return t.prototype.set=function(t,e){var n;if(t.includes(".")){var r=t.split(".")[0],i=((n={})[r]=this.store.get(r),n);return i=Salla.helpers.setNested(i,t,e),this.store.set(r,i[r])}return this.store.set(t,e)},t.prototype.remove=function(t){return this.store.remove(t)},t.prototype.clearAll=function(t){var e=this;if(void 0===t&&(t=!1),t)return this.store.clearAll();this.clearableItems.forEach((function(t){e.store.remove(t)}))},t.prototype.get=function(t,e){var n;if(t.includes(".")){var r=t.split(".")[0];return Salla.helpers.getNested(((n={})[r]=this.store.get(r),n),t)}return this.store.get(t,e)},t.prototype.prefixKey=function(t){return"".concat(t,"_").concat(Salla.config.get("store.id"))},t.prototype.setWithTTL=function(t,e,n,r){void 0===n&&(n=10),void 0===r&&(r="store");var i=this.prefixKey(t),o=(new Date).getTime()+60*n*1e3;return this[r].set(i,{value:e,expiry:o})},t.prototype.getWithTTL=function(t,e,n){void 0===e&&(e=null),void 0===n&&(n="store");var r=this.prefixKey(t),i=this[n].get(r);return i?(new Date).getTime()>i.expiry?(this[n].remove(r),e):i.value:e},t}(),mn=function(){function t(){var t=this;this.keysToRemove=["__said","__ssid","theme_edit","ws_port","s-token"],this.dynamicKeysToRemove=["affiliate","cart"],Salla.event.on("cookies::remove",(function(e){return t.remove(e)})),Salla.event.on("cookies::add",(function(e,n){return t.set(e,n)}))}return t.prototype.get=function(t){var e;return null===(e=document.cookie.split("; ").find((function(e){return