UNPKG

@salla.sa/twilight-components

Version:
4 lines 260 kB
/*! * Crafted with ❤ by Salla */ import{c as t,a as e}from"./p-f84bae34.js";var n=Array.isArray;var r=n;var i=typeof t=="object"&&t&&t.Object===Object&&t;var o=i;var a=typeof self=="object"&&self&&self.Object===Object&&self;var s=o||a||Function("return this")();var u=s;var l=u.Symbol;var c=l;var f=Object.prototype;var d=f.hasOwnProperty;var h=f.toString;var p=c?c.toStringTag:undefined;function v(t){var e=d.call(t,p),n=t[p];try{t[p]=undefined;var r=true}catch(t){}var i=h.call(t);if(r){if(e){t[p]=n}else{delete t[p]}}return i}var g=v;var m=Object.prototype;var b=m.toString;function w(t){return b.call(t)}var y=w;var j="[object Null]",k="[object Undefined]";var _=c?c.toStringTag:undefined;function S(t){if(t==null){return t===undefined?k:j}return _&&_ in Object(t)?g(t):y(t)}var O=S;function x(t){return t!=null&&typeof t=="object"}var E=x;var I="[object Symbol]";function z(t){return typeof t=="symbol"||E(t)&&O(t)==I}var T=z;var A=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,P=/^\w*$/;function $(t,e){if(r(t)){return false}var n=typeof t;if(n=="number"||n=="symbol"||n=="boolean"||t==null||T(t)){return true}return P.test(t)||!A.test(t)||e!=null&&t in Object(e)}var F=$;function R(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var C=R;var U="[object AsyncFunction]",N="[object Function]",D="[object GeneratorFunction]",q="[object Proxy]";function L(t){if(!C(t)){return false}var e=O(t);return e==N||e==D||e==U||e==q}var J=L;var M=u["__core-js_shared__"];var B=M;var G=function(){var t=/[^.]+$/.exec(B&&B.keys&&B.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function V(t){return!!G&&G in t}var H=V;var Q=Function.prototype;var W=Q.toString;function X(t){if(t!=null){try{return W.call(t)}catch(t){}try{return t+""}catch(t){}}return""}var K=X;var Z=/[\\^$.*+?()[\]{}|]/g;var Y=/^\[object .+?Constructor\]$/;var tt=Function.prototype,et=Object.prototype;var nt=tt.toString;var rt=et.hasOwnProperty;var it=RegExp("^"+nt.call(rt).replace(Z,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function ot(t){if(!C(t)||H(t)){return false}var e=J(t)?it:Y;return e.test(K(t))}var at=ot;function st(t,e){return t==null?undefined:t[e]}var ut=st;function lt(t,e){var n=ut(t,e);return at(n)?n:undefined}var ct=lt;var ft=ct(Object,"create");var dt=ft;function ht(){this.__data__=dt?dt(null):{};this.size=0}var pt=ht;function vt(t){var e=this.has(t)&&delete this.__data__[t];this.size-=e?1:0;return e}var gt=vt;var mt="__lodash_hash_undefined__";var bt=Object.prototype;var wt=bt.hasOwnProperty;function yt(t){var e=this.__data__;if(dt){var n=e[t];return n===mt?undefined:n}return wt.call(e,t)?e[t]:undefined}var jt=yt;var kt=Object.prototype;var _t=kt.hasOwnProperty;function St(t){var e=this.__data__;return dt?e[t]!==undefined:_t.call(e,t)}var Ot=St;var xt="__lodash_hash_undefined__";function Et(t,e){var n=this.__data__;this.size+=this.has(t)?0:1;n[t]=dt&&e===undefined?xt:e;return this}var It=Et;function zt(t){var e=-1,n=t==null?0:t.length;this.clear();while(++e<n){var r=t[e];this.set(r[0],r[1])}}zt.prototype.clear=pt;zt.prototype["delete"]=gt;zt.prototype.get=jt;zt.prototype.has=Ot;zt.prototype.set=It;var Tt=zt;function At(){this.__data__=[];this.size=0}var Pt=At;function $t(t,e){return t===e||t!==t&&e!==e}var Ft=$t;function Rt(t,e){var n=t.length;while(n--){if(Ft(t[n][0],e)){return n}}return-1}var Ct=Rt;var Ut=Array.prototype;var Nt=Ut.splice;function Dt(t){var e=this.__data__,n=Ct(e,t);if(n<0){return false}var r=e.length-1;if(n==r){e.pop()}else{Nt.call(e,n,1)}--this.size;return true}var qt=Dt;function Lt(t){var e=this.__data__,n=Ct(e,t);return n<0?undefined:e[n][1]}var Jt=Lt;function Mt(t){return Ct(this.__data__,t)>-1}var Bt=Mt;function Gt(t,e){var n=this.__data__,r=Ct(n,t);if(r<0){++this.size;n.push([t,e])}else{n[r][1]=e}return this}var Vt=Gt;function Ht(t){var e=-1,n=t==null?0:t.length;this.clear();while(++e<n){var r=t[e];this.set(r[0],r[1])}}Ht.prototype.clear=Pt;Ht.prototype["delete"]=qt;Ht.prototype.get=Jt;Ht.prototype.has=Bt;Ht.prototype.set=Vt;var Qt=Ht;var Wt=ct(u,"Map");var Xt=Wt;function Kt(){this.size=0;this.__data__={hash:new Tt,map:new(Xt||Qt),string:new Tt}}var Zt=Kt;function Yt(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var te=Yt;function ee(t,e){var n=t.__data__;return te(e)?n[typeof e=="string"?"string":"hash"]:n.map}var ne=ee;function re(t){var e=ne(this,t)["delete"](t);this.size-=e?1:0;return e}var ie=re;function oe(t){return ne(this,t).get(t)}var ae=oe;function se(t){return ne(this,t).has(t)}var ue=se;function le(t,e){var n=ne(this,t),r=n.size;n.set(t,e);this.size+=n.size==r?0:1;return this}var ce=le;function fe(t){var e=-1,n=t==null?0:t.length;this.clear();while(++e<n){var r=t[e];this.set(r[0],r[1])}}fe.prototype.clear=Zt;fe.prototype["delete"]=ie;fe.prototype.get=ae;fe.prototype.has=ue;fe.prototype.set=ce;var de=fe;var he="Expected a function";function pe(t,e){if(typeof t!="function"||e!=null&&typeof e!="function"){throw new TypeError(he)}var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],o=n.cache;if(o.has(i)){return o.get(i)}var a=t.apply(this,r);n.cache=o.set(i,a)||o;return a};n.cache=new(pe.Cache||de);return n}pe.Cache=de;var ve=pe;var ge=500;function me(t){var e=ve(t,(function(t){if(n.size===ge){n.clear()}return t}));var n=e.cache;return e}var be=me;var we=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;var ye=/\\(\\)?/g;var je=be((function(t){var e=[];if(t.charCodeAt(0)===46){e.push("")}t.replace(we,(function(t,n,r,i){e.push(r?i.replace(ye,"$1"):n||t)}));return e}));var ke=je;function _e(t,e){var n=-1,r=t==null?0:t.length,i=Array(r);while(++n<r){i[n]=e(t[n],n,t)}return i}var Se=_e;var Oe=1/0;var xe=c?c.prototype:undefined,Ee=xe?xe.toString:undefined;function Ie(t){if(typeof t=="string"){return t}if(r(t)){return Se(t,Ie)+""}if(T(t)){return Ee?Ee.call(t):""}var e=t+"";return e=="0"&&1/t==-Oe?"-0":e}var ze=Ie;function Te(t){return t==null?"":ze(t)}var Ae=Te;function Pe(t,e){if(r(t)){return t}return F(t,e)?[t]:ke(Ae(t))}var $e=Pe;var Fe=1/0;function Re(t){if(typeof t=="string"||T(t)){return t}var e=t+"";return e=="0"&&1/t==-Fe?"-0":e}var Ce=Re;function Ue(t,e){e=$e(e,t);var n=0,r=e.length;while(t!=null&&n<r){t=t[Ce(e[n++])]}return n&&n==r?t:undefined}var Ne=Ue;function De(t,e,n){var r=t==null?undefined:Ne(t,e);return r===undefined?n:r}var qe=De;var Le=e((function(t,e){!function(e){var n=Object.hasOwnProperty;var r=Array.isArray?Array.isArray:function t(e){return Object.prototype.toString.call(e)==="[object Array]"};var i=10;var o=typeof process=="object"&&typeof process.nextTick=="function";var a=typeof Symbol==="function";var s=typeof Reflect==="object";var u=typeof setImmediate==="function";var l=u?setImmediate:setTimeout;var c=a?s&&typeof Reflect.ownKeys==="function"?Reflect.ownKeys:function(t){var e=Object.getOwnPropertyNames(t);e.push.apply(e,Object.getOwnPropertySymbols(t));return e}:Object.keys;function f(){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!==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);if(this.wildcard){this.listenerTree={}}}}function h(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+"."}if(typeof process!=="undefined"&&process.emitWarning){var r=new Error(n);r.name="MaxListenersExceededWarning";r.emitter=this;r.count=t;process.emitWarning(r)}else{console.error(n);if(console.trace){console.trace()}}}var p=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:var i=new Array(r);while(r--){i[r]=arguments[r]}return i}};function v(t,n){var r={};var i;var o=t.length;var a=n?n.length:0;for(var s=0;s<o;s++){i=t[s];r[i]=s<a?n[s]:e}return r}function g(t,e,n){this._emitter=t;this._target=e;this._listeners={};this._listenersCount=0;var r,i;if(n.on||n.off){r=n.on;i=n.off}if(e.addEventListener){r=e.addEventListener;i=e.removeEventListener}else if(e.addListener){r=e.addListener;i=e.removeListener}else if(e.on){r=e.on;i=e.off}if(!r&&!i){throw Error("target does not implement any known event API")}if(typeof r!=="function"){throw TypeError("on method must be a function")}if(typeof i!=="function"){throw TypeError("off method must be a function")}this._on=r;this._off=i;var o=t._observers;if(o){o.push(this)}else{t._observers=[this]}}Object.assign(g.prototype,{subscribe:function(t,e,n){var r=this;var i=this._target;var o=this._emitter;var a=this._listeners;var s=function(){var r=p.apply(null,arguments);var a={data:r,name:e,original:t};if(n){var s=n.call(i,a);if(s!==false){o.emit.apply(o,[a.name].concat(r))}return}o.emit.apply(o,[e].concat(r))};if(a[t]){throw Error("Event '"+t+"' is already listening")}this._listenersCount++;if(o._newListener&&o._removeListener&&!r._onNewListener){this._onNewListener=function(n){if(n===e&&a[t]===null){a[t]=s;r._on.call(i,t,s)}};o.on("newListener",this._onNewListener);this._onRemoveListener=function(n){if(n===e&&!o.hasListeners(n)&&a[t]){a[t]=null;r._off.call(i,t,s)}};a[t]=null;o.on("removeListener",this._onRemoveListener)}else{a[t]=s;r._on.call(i,t,s)}},unsubscribe:function(t){var e=this;var n=this._listeners;var r=this._emitter;var i;var o;var a=this._off;var s=this._target;var u;if(t&&typeof t!=="string"){throw TypeError("event must be a string")}function l(){if(e._onNewListener){r.off("newListener",e._onNewListener);r.off("removeListener",e._onRemoveListener);e._onNewListener=null;e._onRemoveListener=null}var t=_.call(r,e);r._observers.splice(t,1)}if(t){i=n[t];if(!i)return;a.call(s,t,i);delete n[t];if(! --this._listenersCount){l()}}else{o=c(n);u=o.length;while(u-- >0){t=o[u];a.call(s,t,n[t])}this._listeners={};this._listenersCount=0;l()}}});function m(t,r,i,o){var a=Object.assign({},r);if(!t)return a;if(typeof t!=="object"){throw TypeError("options must be an object")}var s=Object.keys(t);var u=s.length;var l,c;var f;function d(t){throw Error('Invalid "'+l+'" option value'+(t?". Reason: "+t:""))}for(var h=0;h<u;h++){l=s[h];if(!o&&!n.call(r,l)){throw Error('Unknown "'+l+'" option')}c=t[l];if(c!==e){f=i[l];a[l]=f?f(c,d):c}}return a}function b(t,e){if(typeof t!=="function"||!t.hasOwnProperty("prototype")){e("value must be a constructor")}return t}function w(t){var e="value must be type of "+t.join("|");var n=t.length;var r=t[0];var i=t[1];if(n===1){return function(t,n){if(typeof t===r){return t}n(e)}}if(n===2){return function(t,n){var o=typeof t;if(o===r||o===i)return t;n(e)}}return function(r,i){var o=typeof r;var a=n;while(a-- >0){if(o===t[a])return r}i(e)}}var y=w(["function"]);var j=w(["object","function"]);function k(t,e,n){var r;var i;var o=0;var a;var s=new t((function(u,l,c){n=m(n,{timeout:0,overload:false},{timeout:function(t,e){t*=1;if(typeof t!=="number"||t<0||!Number.isFinite(t)){e("timeout must be a positive number")}return t}});r=!n.overload&&typeof t.prototype.cancel==="function"&&typeof c==="function";function f(){if(i){i=null}if(o){clearTimeout(o);o=0}}var d=function(t){f();u(t)};var h=function(t){f();l(t)};if(r){e(d,h,c)}else{i=[function(t){h(t||Error("canceled"))}];e(d,h,(function(t){if(a){throw Error("Unable to subscribe on cancel event asynchronously")}if(typeof t!=="function"){throw TypeError("onCancel callback must be a function")}i.push(t)}));a=true}if(n.timeout>0){o=setTimeout((function(){var t=Error("timeout");t.code="ETIMEDOUT";o=0;s.cancel(t);l(t)}),n.timeout)}}));if(!r){s.cancel=function(t){if(!i){return}var e=i.length;for(var n=1;n<e;n++){i[n](t)}i[0](t);i=null}}return s}function _(t){var e=this._observers;if(!e){return-1}var n=e.length;for(var r=0;r<n;r++){if(e[r]._target===t)return r}return-1}function S(t,e,n,r,i){if(!n){return null}if(r===0){var o=typeof e;if(o==="string"){var a,s,u=0,l=0,f=this.delimiter,d=f.length;if((s=e.indexOf(f))!==-1){a=new Array(5);do{a[u++]=e.slice(l,s);l=s+d}while((s=e.indexOf(f,l))!==-1);a[u++]=e.slice(l);e=a;i=u}else{e=[e];i=1}}else if(o==="object"){i=e.length}else{e=[e];i=1}}var h=null,p,v,g,m,b,w=e[r],y=e[r+1],j,k;if(r===i){if(n._listeners){if(typeof n._listeners==="function"){t&&t.push(n._listeners);h=[n]}else{t&&t.push.apply(t,n._listeners);h=[n]}}}else{if(w==="*"){j=c(n);s=j.length;while(s-- >0){p=j[s];if(p!=="_listeners"){k=S(t,e,n[p],r+1,i);if(k){if(h){h.push.apply(h,k)}else{h=k}}}}return h}else if(w==="**"){b=r+1===i||r+2===i&&y==="*";if(b&&n._listeners){h=S(t,e,n,i,i)}j=c(n);s=j.length;while(s-- >0){p=j[s];if(p!=="_listeners"){if(p==="*"||p==="**"){if(n[p]._listeners&&!b){k=S(t,e,n[p],i,i);if(k){if(h){h.push.apply(h,k)}else{h=k}}}k=S(t,e,n[p],r,i)}else if(p===y){k=S(t,e,n[p],r+2,i)}else{k=S(t,e,n[p],r,i)}if(k){if(h){h.push.apply(h,k)}else{h=k}}}}return h}else if(n[w]){h=S(t,e,n[w],r+1,i)}}v=n["*"];if(v){S(t,e,v,r+1,i)}g=n["**"];if(g){if(r<i){if(g._listeners){S(t,e,g,i,i)}j=c(g);s=j.length;while(s-- >0){p=j[s];if(p!=="_listeners"){if(p===y){S(t,e,g[p],r+2,i)}else if(p===w){S(t,e,g[p],r+1,i)}else{m={};m[p]=g[p];S(t,e,{"**":m},r+1,i)}}}}else if(g._listeners){S(t,e,g,i,i)}else if(g["*"]&&g["*"]._listeners){S(t,e,g["*"],i,i)}}return h}function O(t,e,n){var r=0,i=0,o,a=this.delimiter,s=a.length,u;if(typeof t==="string"){if((o=t.indexOf(a))!==-1){u=new Array(5);do{u[r++]=t.slice(i,o);i=o+s}while((o=t.indexOf(a,i))!==-1);u[r++]=t.slice(i)}else{u=[t];r=1}}else{u=t;r=t.length}if(r>1){for(o=0;o+1<r;o++){if(u[o]==="**"&&u[o+1]==="**"){return}}}var l=this.listenerTree,c;for(o=0;o<r;o++){c=u[o];l=l[c]||(l[c]={});if(o===r-1){if(!l._listeners){l._listeners=e}else{if(typeof l._listeners==="function"){l._listeners=[l._listeners]}if(n){l._listeners.unshift(e)}else{l._listeners.push(e)}if(!l._listeners.warned&&this._maxListeners>0&&l._listeners.length>this._maxListeners){l._listeners.warned=true;h.call(this,l._listeners.length,c)}}return true}}return true}function x(t,e,n,r){var i=c(t);var o=i.length;var a,s,u;var l=t["_listeners"];var f;while(o-- >0){s=i[o];a=t[s];if(s==="_listeners"){u=n}else{u=n?n.concat(s):[s]}f=r||typeof s==="symbol";l&&e.push(f?u:u.join(this.delimiter));if(typeof a==="object"){x.call(this,a,e,u,f)}}return e}function E(t){var e=c(t);var n=e.length;var r,i,o;while(n-- >0){i=e[n];r=t[i];if(r){o=true;if(i!=="_listeners"&&!E(r)){delete t[i]}}}return o}function I(t,e,n){this.emitter=t;this.event=e;this.listener=n}I.prototype.off=function(){this.emitter.off(this.event,this.listener);return this};function z(t,n,r){if(r===true){a=true}else if(r===false){i=true}else{if(!r||typeof r!=="object"){throw TypeError("options should be an object or true")}var i=r.async;var a=r.promisify;var s=r.nextTick;var u=r.objectify}if(i||s||a){var c=n;var f=n._origin||n;if(s&&!o){throw Error("process.nextTick is not supported")}if(a===e){a=n.constructor.name==="AsyncFunction"}n=function(){var t=arguments;var e=this;var n=this.event;return a?s?Promise.resolve():new Promise((function(t){l(t)})).then((function(){e.event=n;return c.apply(e,t)})):(s?process.nextTick:l)((function(){e.event=n;c.apply(e,t)}))};n._async=true;n._origin=f}return[n,u?new I(this,t,n):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,n,i){if(typeof t!=="object"){throw TypeError("target musts be an object")}var o=this;i=m(i,{on:e,off:e,reducers:e},{on:y,off:y,reducers:j});function a(e){if(typeof e!=="object"){throw TypeError("events must be an object")}var n=i.reducers;var r=_.call(o,t);var a;if(r===-1){a=new g(o,t,i)}else{a=o._observers[r]}var s=c(e);var u=s.length;var l;var f=typeof n==="function";for(var d=0;d<u;d++){l=s[d];a.subscribe(l,e[l]||l,f?n:n&&n[l])}}r(n)?a(v(n)):typeof n==="string"?a(v(n.split(/\s+/))):a(n);return this};T.prototype.stopListeningTo=function(t,e){var n=this._observers;if(!n){return false}var r=n.length;var i;var o=false;if(t&&typeof t!=="object"){throw TypeError("target should be an object")}while(r-- >0){i=n[r];if(!t||i._target===t){i.unsubscribe(e);o=true}}return o};T.prototype.delimiter=".";T.prototype.setMaxListeners=function(t){if(t!==e){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,e,n){return this._once(t,e,false,n)};T.prototype.prependOnceListener=function(t,e,n){return this._once(t,e,true,n)};T.prototype._once=function(t,e,n,r){return this._many(t,1,e,n,r)};T.prototype.many=function(t,e,n,r){return this._many(t,e,n,false,r)};T.prototype.prependMany=function(t,e,n,r){return this._many(t,e,n,true,r)};T.prototype._many=function(t,e,n,r,i){var o=this;if(typeof n!=="function"){throw new Error("many only accepts instances of Function")}function a(){if(--e===0){o.off(t,a)}return n.apply(this,arguments)}a._origin=n;return this._on(t,a,r,i)};T.prototype.emit=function(){if(!this._events&&!this._all){return false}this._events||f.call(this);var t=arguments[0],e,n=this.wildcard;var r,i,o,s,u;if(t==="newListener"&&!this._newListener){if(!this._events.newListener){return false}}if(n){e=t;if(t!=="newListener"&&t!=="removeListener"){if(typeof t==="object"){i=t.length;if(a){for(o=0;o<i;o++){if(typeof t[o]==="symbol"){u=true;break}}}if(!u){t=t.join(this.delimiter)}}}}var l=arguments.length;var c;if(this._all&&this._all.length){c=this._all.slice();for(o=0,i=c.length;o<i;o++){this.event=t;switch(l){case 1:c[o].call(this,t);break;case 2:c[o].call(this,t,arguments[1]);break;case 3:c[o].call(this,t,arguments[1],arguments[2]);break;default:c[o].apply(this,arguments)}}}if(n){c=[];S.call(this,c,e,this.listenerTree,0,i)}else{c=this._events[t];if(typeof c==="function"){this.event=t;switch(l){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:r=new Array(l-1);for(s=1;s<l;s++)r[s-1]=arguments[s];c.apply(this,r)}return true}else if(c){c=c.slice()}}if(c&&c.length){if(l>3){r=new Array(l-1);for(s=1;s<l;s++)r[s-1]=arguments[s]}for(o=0,i=c.length;o<i;o++){this.event=t;switch(l){case 1:c[o].call(this);break;case 2:c[o].call(this,arguments[1]);break;case 3:c[o].call(this,arguments[1],arguments[2]);break;default:c[o].apply(this,r)}}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||f.call(this);var t=arguments[0],e=this.wildcard,n,r;var i,o,s,u;if(t==="newListener"&&!this._newListener){if(!this._events.newListener){return Promise.resolve([false])}}if(e){n=t;if(t!=="newListener"&&t!=="removeListener"){if(typeof t==="object"){o=t.length;if(a){for(s=0;s<o;s++){if(typeof t[s]==="symbol"){r=true;break}}}if(!r){t=t.join(this.delimiter)}}}}var l=[];var c=arguments.length;var d;if(this._all){for(s=0,o=this._all.length;s<o;s++){this.event=t;switch(c){case 1:l.push(this._all[s].call(this,t));break;case 2:l.push(this._all[s].call(this,t,arguments[1]));break;case 3:l.push(this._all[s].call(this,t,arguments[1],arguments[2]));break;default:l.push(this._all[s].apply(this,arguments))}}}if(e){d=[];S.call(this,d,n,this.listenerTree,0)}else{d=this._events[t]}if(typeof d==="function"){this.event=t;switch(c){case 1:l.push(d.call(this));break;case 2:l.push(d.call(this,arguments[1]));break;case 3:l.push(d.call(this,arguments[1],arguments[2]));break;default:i=new Array(c-1);for(u=1;u<c;u++)i[u-1]=arguments[u];l.push(d.apply(this,i))}}else if(d&&d.length){d=d.slice();if(c>3){i=new Array(c-1);for(u=1;u<c;u++)i[u-1]=arguments[u]}for(s=0,o=d.length;s<o;s++){this.event=t;switch(c){case 1:l.push(d[s].call(this));break;case 2:l.push(d[s].call(this,arguments[1]));break;case 3:l.push(d[s].call(this,arguments[1],arguments[2]));break;default:l.push(d[s].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(l)};T.prototype.on=function(t,e,n){return this._on(t,e,false,n)};T.prototype.prependListener=function(t,e,n){return this._on(t,e,true,n)};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,e){if(typeof t!=="function"){throw new Error("onAny only accepts instances of Function")}if(!this._all){this._all=[]}if(e){this._all.unshift(t)}else{this._all.push(t)}return this};T.prototype._on=function(t,n,r,i){if(typeof t==="function"){this._onAny(t,n);return this}if(typeof n!=="function"){throw new Error("on only accepts instances of Function")}this._events||f.call(this);var o=this,a;if(i!==e){a=z.call(this,t,n,i);n=a[0];o=a[1]}if(this._newListener){this.emit("newListener",t,n)}if(this.wildcard){O.call(this,t,n,r);return o}if(!this._events[t]){this._events[t]=n}else{if(typeof this._events[t]==="function"){this._events[t]=[this._events[t]]}if(r){this._events[t].unshift(n)}else{this._events[t].push(n)}if(!this._events[t].warned&&this._maxListeners>0&&this._events[t].length>this._maxListeners){this._events[t].warned=true;h.call(this,this._events[t].length,t)}}return o};T.prototype.off=function(t,e){if(typeof e!=="function"){throw new Error("removeListener only takes instances of Function")}var n,i=[];if(this.wildcard){var o=typeof t==="string"?t.split(this.delimiter):t.slice();i=S.call(this,null,o,this.listenerTree,0);if(!i)return this}else{if(!this._events[t])return this;n=this._events[t];i.push({_listeners:n})}for(var a=0;a<i.length;a++){var s=i[a];n=s._listeners;if(r(n)){var u=-1;for(var 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}if(this.wildcard){s._listeners.splice(u,1)}else{this._events[t].splice(u,1)}if(n.length===0){if(this.wildcard){delete s._listeners}else{delete this._events[t]}}if(this._removeListener)this.emit("removeListener",t,e);return this}else if(n===e||n.listener&&n.listener===e||n._origin&&n._origin===e){if(this.wildcard){delete s._listeners}else{delete this._events[t]}if(this._removeListener)this.emit("removeListener",t,e)}}this.listenerTree&&E(this.listenerTree);return this};T.prototype.offAny=function(t){var e=0,n=0,r;if(t&&this._all&&this._all.length>0){r=this._all;for(e=0,n=r.length;e<n;e++){if(t===r[e]){r.splice(e,1);if(this._removeListener)this.emit("removeListenerAny",t);return this}}}else{r=this._all;if(this._removeListener){for(e=0,n=r.length;e<n;e++)this.emit("removeListenerAny",r[e])}this._all=[]}return this};T.prototype.removeListener=T.prototype.off;T.prototype.removeAllListeners=function(t){if(t===e){!this._events||f.call(this);return this}if(this.wildcard){var n=S.call(this,null,t,this.listenerTree,0),r,i;if(!n)return this;for(i=0;i<n.length;i++){r=n[i];r._listeners=null}this.listenerTree&&E(this.listenerTree)}else if(this._events){this._events[t]=null}return this};T.prototype.listeners=function(t){var n=this._events;var r,i,o;var a;var s;if(t===e){if(this.wildcard){throw Error("event name required for wildcard emitter")}if(!n){return[]}r=c(n);a=r.length;o=[];while(a-- >0){i=n[r[a]];if(typeof i==="function"){o.push(i)}else{o.push.apply(o,i)}}return o}else{if(this.wildcard){s=this.listenerTree;if(!s)return[];var u=[];var l=typeof t==="string"?t.split(this.delimiter):t.slice();S.call(this,u,l,s,0);return u}if(!n){return[]}i=n[t];if(!i){return[]}return typeof i==="function"?[i]:i}};T.prototype.eventNames=function(t){var e=this._events;return this.wildcard?x.call(this,this.listenerTree,[],null,t):e?c(e):[]};T.prototype.listenerCount=function(t){return this.listeners(t).length};T.prototype.hasListeners=function(t){if(this.wildcard){var n=[];var r=typeof t==="string"?t.split(this.delimiter):t.slice();S.call(this,n,r,this.listenerTree,0);return n.length>0}var i=this._events;var o=this._all;return!!(o&&o.length||i&&(t===e?c(i).length:i[t]))};T.prototype.listenersAny=function(){if(this._all){return this._all}else{return[]}};T.prototype.waitFor=function(t,n){var r=this;var i=typeof n;if(i==="number"){n={timeout:n}}else if(i==="function"){n={filter:n}}n=m(n,{timeout:0,filter:e,handleError:false,Promise,overload:false},{filter:y,Promise:b});return k(n.Promise,(function(e,i,o){function a(){var o=n.filter;if(o&&!o.apply(r,arguments)){return}r.off(t,a);if(n.handleError){var s=arguments[0];s?i(s):e(p.apply(null,arguments).slice(1))}else{e(p.apply(null,arguments))}}o((function(){r.off(t,a)}));r._on(t,a,false)}),{timeout:n.timeout,overload:n.overload})};function A(t,e,n){n=m(n,{Promise,timeout:0,overload:false},{Promise:b});var r=n.Promise;return k(r,(function(n,r,i){var o;if(typeof t.addEventListener==="function"){o=function(){n(p.apply(null,arguments))};i((function(){t.removeEventListener(e,o)}));t.addEventListener(e,o,{once:true});return}var a=function(){s&&t.removeListener("error",s);n(p.apply(null,arguments))};var s;if(e!=="error"){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})}var P=T.prototype;Object.defineProperties(T,{defaultMaxListeners:{get:function(){return P._maxListeners},set:function(t){if(typeof t!=="number"||t<0||Number.isNaN(t)){throw TypeError("n must be a non-negative number")}P._maxListeners=t},enumerable:true},once:{value:A,writable:true,configurable:true}});Object.defineProperties(P,{_maxListeners:{value:i,writable:true,configurable:true},_observers:{value:null,writable:true,configurable:true}});if(typeof e==="function"&&e.amd){e((function(){return T}))}else{t.exports=T}}()}));var Je=He();var Me=Qe();var Be=We();var Ge=typeof window!=="undefined"?window:t;var Ve={assign:Je,create:Me,trim:Be,bind:Xe,slice:Ke,each:Ze,map:Ye,pluck:tn,isList:en,isFunction:nn,isObject:rn,Global:Ge};function He(){if(Object.assign){return Object.assign}else{return function t(e,n,r,i){for(var o=1;o<arguments.length;o++){Ze(Object(arguments[o]),(function(t,n){e[n]=t}))}return e}}}function Qe(){if(Object.create){return function t(e,n,r,i){var o=Ke(arguments,1);return Je.apply(this,[Object.create(e)].concat(o))}}else{function t(){}return function e(n,r,i,o){var a=Ke(arguments,1);t.prototype=n;return Je.apply(this,[new t].concat(a))}}}function We(){if(String.prototype.trim){return function t(e){return String.prototype.trim.call(e)}}else{return function t(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}}}function Xe(t,e){return function(){return e.apply(t,Array.prototype.slice.call(arguments,0))}}function Ke(t,e){return Array.prototype.slice.call(t,e||0)}function Ze(t,e){tn(t,(function(t,n){e(t,n);return false}))}function Ye(t,e){var n=en(t)?[]:{};tn(t,(function(t,r){n[r]=e(t,r);return false}));return n}function tn(t,e){if(en(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)){if(e(t[r],r)){return t[r]}}}}}function en(t){return t!=null&&typeof t!="function"&&typeof t.length=="number"}function nn(t){return t&&{}.toString.call(t)==="[object Function]"}function rn(t){return t&&{}.toString.call(t)==="[object Object]"}var on=Ve.slice;var an=Ve.pluck;var sn=Ve.each;var un=Ve.bind;var ln=Ve.create;var cn=Ve.isList;var fn=Ve.isFunction;var dn=Ve.isObject;var hn={createStore:gn};var pn={version:"2.0.12",enabled:false,get:function(t,e){var n=this.storage.read(this._namespacePrefix+t);return this._deserialize(n,e)},set:function(t,e){if(e===undefined){return this.remove(t)}this.storage.write(this._namespacePrefix+t,this._serialize(e));return 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 gn.apply(this,arguments)},addPlugin:function(t){this._addPlugin(t)},namespace:function(t){return gn(this.storage,this.plugins,t)}};function vn(){var t=typeof console=="undefined"?null:console;if(!t){return}var e=t.warn?t.warn:t.log;e.apply(t,arguments)}function gn(t,e,n){if(!n){n=""}if(t&&!cn(t)){t=[t]}if(e&&!cn(e)){e=[e]}var r=n?"__storejs_"+n+"_":"";var i=n?new RegExp("^"+r):null;var o=/^[a-zA-Z0-9_\-]*$/;if(!o.test(n)){throw new Error("store.js namespaces can only have alphanumerics + underscores and dashes")}var a={_namespacePrefix:r,_namespaceRegexp:i,_testStorage:function(t){try{var e="__storejs__test__";t.write(e,e);var n=t.read(e)===e;t.remove(e);return n}catch(t){return false}},_assignPluginFnProp:function(t,e){var n=this[e];this[e]=function e(){var r=on(arguments,0);var i=this;function o(){if(!n){return}sn(arguments,(function(t,e){r[e]=t}));return n.apply(i,r)}var a=[o].concat(r);return t.apply(i,a)}},_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 n!==undefined?n:e},_addStorage:function(t){if(this.enabled){return}if(this._testStorage(t)){this.storage=t;this.enabled=true}},_addPlugin:function(t){var e=this;if(cn(t)){sn(t,(function(t){e._addPlugin(t)}));return}var n=an(this.plugins,(function(e){return t===e}));if(n){return}this.plugins.push(t);if(!fn(t)){throw new Error("Plugins must be function values that return objects")}var r=t.call(this);if(!dn(r)){throw new Error("Plugins must return an object of function properties")}sn(r,(function(n,r){if(!fn(n)){throw new Error("Bad plugin property: "+r+" from plugin "+t.name+". Plugins should only return functions.")}e._assignPluginFnProp(n,r)}))},addStorage:function(t){vn("store.addStorage(storage) is deprecated. Use createStore([storages])");this._addStorage(t)}};var s=ln(a,pn,{plugins:[]});s.raw={};sn(s,(function(t,e){if(fn(t)){s.raw[e]=un(s,t)}}));sn(t,(function(t){s._addStorage(t)}));sn(e,(function(t){s._addPlugin(t)}));return s}var mn=Ve.Global;var bn={name:"localStorage",read:yn,write:jn,each:kn,remove:_n,clearAll:Sn};function wn(){return mn.localStorage}function yn(t){return wn().getItem(t)}function jn(t,e){return wn().setItem(t,e)}function kn(t){for(var e=wn().length-1;e>=0;e--){var n=wn().key(e);t(yn(n),n)}}function _n(t){return wn().removeItem(t)}function Sn(){return wn().clear()}const On=Object.freeze(Object.assign(Object.create(null),bn,{default:bn}));var xn=Ve.Global;var En={name:"sessionStorage",read:zn,write:Tn,each:An,remove:Pn,clearAll:$n};function In(){return xn.sessionStorage}function zn(t){return In().getItem(t)}function Tn(t,e){return In().setItem(t,e)}function An(t){for(var e=In().length-1;e>=0;e--){var n=In().key(e);t(zn(n),n)}}function Pn(t){return In().removeItem(t)}function $n(){return In().clear()}const Fn=Object.freeze(Object.assign(Object.create(null),En,{default:En}));var Rn=Ve.Global;var Cn=Ve.trim;var Un={name:"cookieStorage",read:Dn,write:Ln,each:qn,remove:Jn,clearAll:Mn};var Nn=Rn.document;function Dn(t){if(!t||!Bn(t)){return null}var e="(?:^|.*;\\s*)"+escape(t).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=\\s*((?:[^;](?!;))*[^;]?).*";return unescape(Nn.cookie.replace(new RegExp(e),"$1"))}function qn(t){var e=Nn.cookie.split(/; ?/g);for(var n=e.length-1;n>=0;n--){if(!Cn(e[n])){continue}var r=e[n].split("=");var i=unescape(r[0]);var o=unescape(r[1]);t(o,i)}}function Ln(t,e){if(!t){return}Nn.cookie=escape(t)+"="+escape(e)+"; expires=Tue, 19 Jan 2038 03:14:07 GMT; path=/"}function Jn(t){if(!t||!Bn(t)){return}Nn.cookie=escape(t)+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/"}function Mn(){qn((function(t,e){Jn(e)}))}function Bn(t){return new RegExp("(?:^|;\\s*)"+escape(t).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=").test(Nn.cookie)}const Gn=Object.freeze(Object.assign(Object.create(null),Un,{default:Un}));var Vn={name:"memoryStorage",read:Qn,write:Wn,each:Xn,remove:Kn,clearAll:Zn};var Hn={};function Qn(t){return Hn[t]}function Wn(t,e){Hn[t]=e}function Xn(t){for(var e in Hn){if(Hn.hasOwnProperty(e)){t(Hn[e],e)}}}function Kn(t){delete Hn[t]}function Zn(t){Hn={}}const Yn=Object.freeze(Object.assign(Object.create(null),Vn,{default:Vn}));function tr(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,a=e?i:r,s=0;s<o.length;s++)n=new RegExp(o[s],"g"),t=t.replace(n,a[s]);return t.replace(e?"٫":".",e?".":"٫")}function er(t){var e=("".concat(t).match(/\./g)||[]).length;return e&&1!==e?er(t.replace(/\.(.+)\./g,".$1")):t}function nr(t){return"".concat(t).startsWith("https://")||"".concat(t).startsWith("http://")}function rr(t){if(nr(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 ir(t,e,n){if(n=n||window.location.href,!e||!t)return n;var r=new RegExp("([?&])"+t+"=[^&]+[&]?","g");return(n=n.replace(r,"$1").split("#")[0].replace(/&$|\?$/,"")).includes("?")?n+="&":n+=(n.endsWith("/")?"":"/")+"?",(n+t+"="+encodeURIComponent(e)).replace(/&$|\?$/,"")}function or(t){return window.location.origin+"/"+(null==t?void 0:t.ltrim("/"))}function ar(t){return nr(t)?t:Salla.config.get("theme.assets")?Salla.config.get("theme.assets").replace(":path",null==t?void 0:t.ltrim("/")):or("themes/"+Salla.config.get("theme.name")+"/"+(null==t?void 0:t.ltrim("/")))}function sr(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]=sr(t.slice(1),e,n[i]),n):i?((r={})[i]=sr(t.slice(1),e),r):""===i?[e]:e}function ur(){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,e){for(var n,r=this,i=0;i<t.length;i++)n=new 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(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 lr={digitsOnly:function(t){return tr(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.min&&r<parseInt(e.min)?e.value=e.min:e.max&&r>parseInt(e.max)?e.value=e.max:e.maxLength>=1&&r.toString().length>e.maxLength?e.value=r.toString().substring(0,e.maxLength):e.value=n||e.dataset.hasOwnProperty("digitsWithDecimal")?er(r):r.replace(/\D/g,"")}Salla.logger.warn("Can't find Object With Id: "+e)},number:tr,money:function(t,e){void 0===e&&(e=!0);var n=Salla.config.currency(null==t?void 0:t.currency).symbol;return t=tr(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:ur,isPreview:function(){return ur()},setNested:function(t,e,n){for(var r=t,i=e.split("."),o=i.length,a=0;a<o-1;a++){var s=i[a];r[s]||(r[s]={}),r=r[s]}return r[i[o-1]]=n,t},getNested:function(t,e,n){var r=qe(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:sr(r.slice(1),e,o)}}return{name:t,value:e}},url:Object.freeze({__proto__:null,is_full_url:nr,base:function(t){return nr(t)?t:"https://"+new URL(rr("/")).hostname+"/"+(null==t?void 0:t.ltrim("/"))},get:rr,domain:function(t){return nr(t)?t:"".concat(Salla.config.get("store.url",window.location.href.split("/").slice(0,-1).join("/")).rtrim("/"),"/").concat(null==t?void 0:t.ltrim("/"))},addParamToUrl:ir,baseUrl:or,asset:ar,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("/"))},api:function(t){var e;return(null===(e=Salla.config.get("store.api",rr("")))||void 0===e?void 0:e.rtrim("/"))+"/"+(null==t?void 0:t.ltrim("/"))},is_page:function(t){return t&&Salla.config.get("page.slug")===t},is_placeholder:function(t){return ar(salla.config.get("theme.settings.placeholder"))===ar(t)}}),addParamToUrl:ir,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())&&!/snapchat/i.test(navigator.userAgent)}catch(t){return console.error(t),!1}}},cr=function(t,e){return cr=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])},cr(t,e)};var fr=function(){return fr=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},fr.apply(this,arguments)};function dr(t,e,n){if(n||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"==typeof SuppressedError&&SuppressedError;var hr,pr,vr,gr,mr=(hr=console,pr=[],vr=[],gr={log:function(t,e){if(hr&&salla.config.isDebug()){pr.push([e,t]),"trace"===salla.config.get("debug")&&(e="trace");var n=hr.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;"];vr.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,dr([hr],i.concat.apply(i,t),!1))}},__dict__:{trace:hr.trace,debug:hr.debug,info:hr.info,warn:hr.warn,error:hr.error}},{event:function(){gr.log(arguments,"event")},trace:function(){gr.log(arguments,"trace")},debug:function(){gr.log(arguments,"debug")},info:function(){gr.log(arguments,"info")},warn:function(){gr.log(arguments,"warn")},error:function(){gr.log(arguments,"error")},log:function(){gr.log(arguments,void 0)},backend:function(){gr.log(arguments,"backend")},logs:function(t){[t].flat().forEach((function(t){return t&&gr.log([t].flat(),"backend")}))},history:function(){return pr.map((function(t){return hr.log.apply(hr,dr([t[0]],t[1],!1))})),pr},addPrefix:function(t){return Array.isArray(t)?vr.unshift(t):this.warn("addPrefix receives array only!"),this}}),br=function(){function t(t,e){void 0===t&&(t={}),void 0===e&&(e={}),this.default_properties=e,this.properties_=fr(fr({},this.default_properties),t)}return t.prototype.merge=function(t){var e;return this.properties_=fr(fr({},this.properties_),t),this.properties_.store=fr(fr({},(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}(),wr=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 "+String(e)+" is not a constructor or null");function n(){this.constructor=t}cr(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,dr([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,dr([e],r,!1)),this.trackEvents.apply(this,dr([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,dr([e],n,!1));try{this.trackEvents.apply(this,dr([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=fr(fr({},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,dr([t],n,!1)),this.dispatchMobileEvent.apply(this,dr([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,dr([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],i=r[0],o=r[1];this.dispatch(i,o)}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){if(void 0===e&&(e={}),!("undefined"!=typeof window&&window.dataLayer&&window.dataLayer[0]&&window.dataLayer[0].page&&window.dataLayer[0].page.mobileApp))return"";if(window.webkit)try{window.webkit.messageHandlers.callbackHandler.postMessage(JSON.stringify({event:t,details:e}))}catch(t){Salla.log(t,"The native context does not exist yet")}else if(void 0!==window.Android)try{window.Android.customEventWithData(t,JSON.stringify({details:e}))}catch(t){Salla.log(t,"The native context does not exist yet")}},e}(Le.EventEmitter2),yr=hn.createStore([On,Fn,Gn,Yn],[]),jr=hn.createStore([Fn],[]),kr=hn.createStore([Gn],[]),_r=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=yr,this.session=jr,this.cookie=kr}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(Salla.config.get("theme.translations_hash"),"_").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}(),Sr=function(){function t(){var t=this;this.keysToRemove=["__said","__ssid","theme_edit","ws_port","s-token"],this.dynamicKeysToRemove=["affiliate"],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 e.startsWith(t+"=")})))||void 0===e?void 0:e.split("=")[1]},t.prototype.set=function(t,e,n){void 0===e&&(e=""),void 0===n&&(n=10);var r="";if(n){var i=new Date;i.setTime(i.getTime()+24*n*60*60*1e3),r="; expires="+i.toUTCString()}var o=salla.helpers.isIframe()?"None":"Lax";return document.cookie="".concat(t,"=").concat(e).concat(r,"; path=/; SameSite=").concat(o,"; secure"),this},t.prototype.remove=function(t){var e=salla.helpers.isIframe()?"None":"Lax";return document.cookie="".concat(t,"=; Max-Age=0; path=/; SameSite=").concat(e,"; secure"),this},t.prototype.clearAll=function(t){return void 0===t&&(t=!1),this.clean(t)},t.prototype.clean=function(t){var e=this;return document.cookie.split(";").map((function(t){return t.split("=")[0].trim()})).filter((function(n){return t||e.keysToRemove.includes(n)||e.dynamicKeysToRemove.some((function(t){return n.startsWith(t)}))})).forEach((function(t){return e.remove(t)})),this},t.prototype.getCookieByPrefix=function(t){return document.cookie.split("; ").map((function(t){return t.split("=")[0]})).filter((function(e){return e.startsWith(t)}))},t}();"undefined"!=typeof window&&(window.salla=window.salla||window.Salla||{},window.Salla=window.salla),"undefined"!=typeof global&&(global.salla=global.salla||global.Salla||{},global.Salla=global.salla),Salla.status="base",Salla.config=new br,Salla.logger=mr,Salla.event=new wr,Salla.helpers=lr,Salla.storage=new _r,Salla.cookie=new Sr,Salla.log=Salla.logger.log,Salla.money=Salla.helpers.money,Salla.url=Salla.helpers.url,Salla.versions={base:"[VI]{version}[/VI]"};var Or=Salla;var xr=e((function(e){(function(t,n){if(e.exports){e.exports=n()}else{t.EvEmitter=n()}})(typeof window!="undefined"?window:t,(function(){function t(){}let e=t.prototype;e.on=function(t,e){if(!t||!e)return this;let n=this._events=this._events||{};let r=n[t]=n[t]||[];if(!r.includes(e)){r.push(e)}return this};e.once=function(t,e){if(!t||!e)return this;this.on(t,e);let n=this._onceEvents=this._onceEvents||{};let r=n[t]=n[t]||{};r[e]=true;return this};e.off=function(t,e){let n=this._events&&this._events[t];if(!n||!n.length)return this;let r=n.indexOf(e);if(r!=-1){n.splice(r,1)}return this};e.emitEvent=function(t,e){let n=this._events&&this._events[t];if(!n||!n.length)return this;n=n.slice(0);e=e||[];let r=this._onceEvents&&this._onceEvents[t];for(let i of n){let n=r&&r[i];if(n){this.off(t,i);delete r[i]}i.apply(this,e)}return this};e.allOff=function(){delete this._events;delete this._onceEvents;return this};return t}))}));var Er=e((function(e){(function(t,n){if(e.exports){e.exports=n(t)}else{t.fizzyUIUtils=n(t)}})(t,(function t(e){let n={};n.extend=function(t,e){return Object.assign(t,e)};n.modulo=function(t,e){return(t%e+e)%e};n.makeArray=function(t){if(Array.isArray(t))return t;if(t===null||t===undefined)return[];let e=typeof t=="object"&&typeof t.length=="number";if(e)return[...t];return[t]};n.removeFrom=function(t,e){let n=t.indexOf(e);if(n!=-1){t.splice(n,1)}};n.getParent=function(t,e){while(t.parentNode&&t!=document.body){t=t.parentNode;if(t.matches(e))return t}};n.getQueryElement=function(t){if(typeof t=="string"){return document.querySelector(t)}return t};n.handleEvent=function(t){let e="on"+t.type;if(this[e]){this[e](t)}};n.filterFindElements=function(t,e){t=n.makeArray(t);return t.filter((t=>t instanceof HTMLElement)).reduce(((t,n)=>{if(!e){t.push(n);return t}if(n.matches(e)){t.push(n)}let r=n.querySelectorAll(e);t=t.concat(...r);return t}),[])};n.debounceMethod=function(t,e,n){n=n||100;let r=t.prototype[e];let i=e+"Timeout";t.prototype[e]=function(){clearTimeout(this[i]);let t=arguments;this[i]=setTimeout((()=>{r.app