zar 0.3.0 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/zar.iife.js CHANGED
@@ -1,3 +1,3 @@
1
- var ne=(ue,De,Z)=>new Promise((Re,_e)=>{var qe=R=>{try{re(Z.next(R))}catch(ge){_e(ge)}},ee=R=>{try{re(Z.throw(R))}catch(ge){_e(ge)}},re=R=>R.done?Re(R.value):Promise.resolve(R.value).then(qe,ee);re((Z=Z.apply(ue,De)).next())});var zar=function(ue){"use strict";function De(e,t,n,r,i){for(t=t.split?t.split("."):t,r=0;r<t.length;r++)e=e?e[t[r]]:i;return e===i?n:e}var Z="undefined",Re="object",_e="any",qe="*",ee="__",re=typeof process!="undefined"?process:{};re.env&&re.env.NODE_ENV;var R=typeof window!="undefined";re.versions!=null&&re.versions.node!=null,typeof Deno!="undefined"&&Deno.core,R&&window.name==="nodejs"||typeof navigator!="undefined"&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom"));function ge(e,t){return t.charAt(0)[e]()+t.slice(1)}var Sn=ge.bind(null,"toUpperCase"),Pn=ge.bind(null,"toLowerCase");function xn(e){return yt(e)?Sn("null"):typeof e=="object"?Nn(e):Object.prototype.toString.call(e).slice(8,-1)}function Ce(e,t){t===void 0&&(t=!0);var n=xn(e);return t?Pn(n):n}function Ne(e,t){return typeof t===e}var Q=Ne.bind(null,"function"),me=Ne.bind(null,"string"),ve=Ne.bind(null,"undefined"),On=Ne.bind(null,"boolean");Ne.bind(null,"symbol");function yt(e){return e===null}function En(e){return Ce(e)==="number"&&!isNaN(e)}function kn(e){return Ce(e)==="array"}function J(e){if(!_n(e))return!1;for(var t=e;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function _n(e){return e&&(typeof e=="object"||e!==null)}function Nn(e){return Q(e.constructor)?e.constructor.name:null}function jn(e){return e instanceof Error||me(e.message)&&e.constructor&&En(e.constructor.stackTraceLimit)}function bt(e,t){if(typeof t!="object"||yt(t))return!1;if(t instanceof e)return!0;var n=Ce(new e(""));if(jn(t))for(;t;){if(Ce(t)===n)return!0;t=Object.getPrototypeOf(t)}return!1}bt.bind(null,TypeError),bt.bind(null,SyntaxError);function Be(e,t){var n=e instanceof Element||e instanceof HTMLDocument;return n&&t?Tn(e,t):n}function Tn(e,t){return t===void 0&&(t=""),e&&e.nodeName===t.toUpperCase()}function Ve(e){var t=[].slice.call(arguments,1);return function(){return e.apply(void 0,[].slice.call(arguments).concat(t))}}Ve(Be,"form"),Ve(Be,"button"),Ve(Be,"input"),Ve(Be,"select");function wt(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(t){return null}}function An(){if(R){var e=navigator,t=e.languages;return e.userLanguage||(t&&t.length?t[0]:e.language)}}function Mn(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){}}function zn(e){return function(t){for(var n,r=Object.create(null),i=/([^&=]+)=?([^&]*)/g;n=i.exec(t);){var a=wt(n[1]),o=wt(n[2]);a.substring(a.length-2)==="[]"?(r[a=a.substring(0,a.length-2)]||(r[a]=[])).push(o):r[a]=o===""||o}for(var s in r){var p=s.split("[");p.length>1&&(Ln(r,p.map(function(g){return g.replace(/[?[\]\\ ]/g,"")}),r[s]),delete r[s])}return r}(function(t){if(t){var n=t.match(/\?(.*)/);return n&&n[1]?n[1].split("#")[0]:""}return R&&window.location.search.substring(1)}(e))}function Ln(e,t,n){for(var r=t.length-1,i=0;i<r;++i){var a=t[i];if(a==="__proto__"||a==="constructor")break;a in e||(e[a]={}),e=e[a]}e[t[r]]=n}function Je(){for(var e="",t=0,n=4294967295*Math.random()|0;t++<36;){var r="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx"[t-1],i=15&n;e+=r=="-"||r=="4"?r:(r=="x"?i:3&i|8).toString(16),n=t%8==0?4294967295*Math.random()|0:n>>4}return e}var je="global",he=ee+"global"+ee,ye=typeof self===Re&&self.self===self&&self||typeof global===Re&&global.global===global&&global||void 0;function ce(e){return ye[he][e]}function se(e,t){return ye[he][e]=t}function be(e){delete ye[he][e]}function we(e,t,n){var r;try{if(nt(e)){var i=window[e];r=i[t].bind(i)}}catch(a){}return r||n}ye[he]||(ye[he]={});var Fe={};function nt(e){if(typeof Fe[e]!==Z)return Fe[e];try{var t=window[e];t.setItem(Z,Z),t.removeItem(Z)}catch(n){return Fe[e]=!1}return Fe[e]=!0}function m(){return m=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},m.apply(this,arguments)}var ie="function",te="undefined",$n="@@redux/"+Math.random().toString(36),It=function(){return typeof Symbol===ie&&Symbol.observable||"@@observable"}(),He=" != "+ie;function St(e,t,n){var r;if(typeof t===ie&&typeof n===te&&(n=t,t=void 0),typeof n!==te){if(typeof n!==ie)throw new Error("enhancer"+He);return n(St)(e,t)}if(typeof e!==ie)throw new Error("reducer"+He);var i=e,a=t,o=[],s=o,p=!1;function g(){s===o&&(s=o.slice())}function x(){return a}function d(h){if(typeof h!==ie)throw new Error("Listener"+He);var A=!0;return g(),s.push(h),function(){if(A){A=!1,g();var I=s.indexOf(h);s.splice(I,1)}}}function N(h){if(!J(h))throw new Error("Act != obj");if(typeof h.type===te)throw new Error("ActType "+te);if(p)throw new Error("Dispatch in reducer");try{p=!0,a=i(a,h)}finally{p=!1}for(var A=o=s,I=0;I<A.length;I++)(0,A[I])();return h}return N({type:"@@redux/INIT"}),(r={dispatch:N,subscribe:d,getState:x,replaceReducer:function(h){if(typeof h!==ie)throw new Error("next reducer"+He);i=h,N({type:"@@redux/INIT"})}})[It]=function(){var h,A=d;return(h={subscribe:function(I){if(typeof I!="object")throw new TypeError("Observer != obj");function y(){I.next&&I.next(x())}return y(),{unsubscribe:A(y)}}})[It]=function(){return this},h},r}function Un(e,t){var n=t&&t.type;return"action "+(n&&n.toString()||"?")+"reducer "+e+" returns "+te}function Ie(){var e=[].slice.call(arguments);return e.length===0?function(t){return t}:e.length===1?e[0]:e.reduce(function(t,n){return function(){return t(n.apply(void 0,[].slice.call(arguments)))}})}function Dn(){var e=arguments;return function(t){return function(n,r,i){var a,o=t(n,r,i),s=o.dispatch,p={getState:o.getState,dispatch:function(g){return s(g)}};return a=[].slice.call(e).map(function(g){return g(p)}),m({},o,{dispatch:s=Ie.apply(void 0,a)(o.dispatch)})}}}var ae=ee+"anon_id",le=ee+"user_id",Se=ee+"user_traits",oe="userId",Pe="anonymousId",Ge=["bootstrap","params","campaign","initializeStart","initialize","initializeEnd","ready","resetStart","reset","resetEnd","pageStart","page","pageEnd","pageAborted","trackStart","track","trackEnd","trackAborted","identifyStart","identify","identifyEnd","identifyAborted","userIdChanged","registerPlugins","enablePlugin","disablePlugin","online","offline","setItemStart","setItem","setItemEnd","setItemAborted","removeItemStart","removeItem","removeItemEnd","removeItemAborted"],rt=["name","EVENTS","config","loaded"],v=Ge.reduce(function(e,t){return e[t]=t,e},{registerPluginType:function(e){return"registerPlugin:"+e},pluginReadyType:function(e){return"ready:"+e}}),Pt=/^utm_/,xt=/^an_prop_/,Ot=/^an_trait_/;function Rn(e){var t=e.storage.setItem;return function(n){return function(r){return function(i){if(i.type===v.bootstrap){var a=i.params,o=i.user,s=i.persistedUser,p=i.initialUser,g=s.userId===o.userId;s.anonymousId!==o.anonymousId&&t(ae,o.anonymousId),g||t(le,o.userId),p.traits&&t(Se,m({},g&&s.traits?s.traits:{},p.traits));var x=Object.keys(i.params);if(x.length){var d=a.an_uid,N=a.an_event,h=x.reduce(function(A,I){if(I.match(Pt)||I.match(/^(d|g)clid/)){var y=I.replace(Pt,"");A.campaign[y==="campaign"?"name":y]=a[I]}return I.match(xt)&&(A.props[I.replace(xt,"")]=a[I]),I.match(Ot)&&(A.traits[I.replace(Ot,"")]=a[I]),A},{campaign:{},props:{},traits:{}});n.dispatch(m({type:v.params,raw:a},h,d?{userId:d}:{})),d&&setTimeout(function(){return e.identify(d,h.traits)},0),N&&setTimeout(function(){return e.track(N,h.props)},0),Object.keys(h.campaign).length&&n.dispatch({type:v.campaign,campaign:h.campaign})}}return r(i)}}}}function qn(e){return function(t,n){if(t===void 0&&(t={}),n===void 0&&(n={}),n.type===v.setItemEnd){if(n.key===ae)return m({},t,{anonymousId:n.value});if(n.key===le)return m({},t,{userId:n.value})}switch(n.type){case v.identify:return Object.assign({},t,{userId:n.userId,traits:m({},t.traits,n.traits)});case v.reset:return[le,ae,Se].forEach(function(r){e.removeItem(r)}),Object.assign({},t,{userId:null,anonymousId:null,traits:{}});default:return t}}}function Et(e){return{userId:e.getItem(le),anonymousId:e.getItem(ae),traits:e.getItem(Se)}}var it=function(e){return ee+"TEMP"+ee+e};function Cn(e){var t=e.storage,n=t.setItem,r=t.removeItem,i=t.getItem;return function(a){return function(o){return function(s){var p=s.userId,g=s.traits,x=s.options;if(s.type===v.reset&&([le,Se,ae].forEach(function(h){r(h)}),[oe,Pe,"traits"].forEach(function(h){be(it(h))})),s.type===v.identify){i(ae)||n(ae,Je());var d=i(le),N=i(Se)||{};d&&d!==p&&a.dispatch({type:v.userIdChanged,old:{userId:d,traits:N},new:{userId:p,traits:g},options:x}),p&&n(le,p),g&&n(Se,m({},N,g))}return o(s)}}}}var Te={};function kt(e,t){Te[e]&&Q(Te[e])&&(Te[e](t),delete Te[e])}function _t(e,t,n){return new Promise(function(r,i){return t()?r(e):n<1?i(m({},e,{queue:!0})):new Promise(function(a){return setTimeout(a,10)}).then(function(a){return _t(e,t,n-10).then(r,i)})})}function Nt(e,t,n){var r=t(),i=e.getState(),a=i.plugins,o=i.queue,s=i.user;if(!i.context.offline&&o&&o.actions&&o.actions.length){var p=o.actions.reduce(function(x,d,N){return a[d.plugin].loaded?(x.process.push(d),x.processIndex.push(N)):(x.requeue.push(d),x.requeueIndex.push(N)),x},{processIndex:[],process:[],requeue:[],requeueIndex:[]});if(p.processIndex&&p.processIndex.length){p.processIndex.forEach(function(x){var d=o.actions[x],N=d.plugin,h=d.payload.type,A=r[N][h];if(A&&Q(A)){var I=function(E,j){return E===void 0&&(E={}),j===void 0&&(j={}),[oe,Pe].reduce(function(M,l){return E.hasOwnProperty(l)&&j[l]&&j[l]!==E[l]&&(M[l]=j[l]),M},E)}(d.payload,s);A({payload:I,config:a[N].config,instance:n});var y=h+":"+N;e.dispatch(m({},I,{type:y,_:{called:y,from:"queueDrain"}}))}});var g=o.actions.filter(function(x,d){return!~p.processIndex.indexOf(d)});o.actions=g}}}var at=function(e){var t=e.data,n=e.action,r=e.instance,i=e.state,a=e.allPlugins,o=e.allMatches,s=e.store,p=e.EVENTS;try{var g=i.plugins,x=i.context,d=n.type,N=d.match(xe),h=t.exact.map(function(y){return y.pluginName});N&&(h=o.during.map(function(y){return y.pluginName}));var A=function(y,E){return function(j,M,l){var b=M.config,$=M.name,z=$+"."+j.type;l&&(z=l.event);var L=j.type.match(xe)?function(B,U,F,q,H){return function(S,T){var X=q?q.name:B,V=T&&Ae(T)?T:F;if(q&&(!(V=T&&Ae(T)?T:[B]).includes(B)||V.length!==1))throw new Error("Method "+U+" can only abort "+B+" plugin. "+JSON.stringify(V)+" input valid");return m({},H,{abort:{reason:S,plugins:V,caller:U,_:X}})}}($,z,E,l,j):function(B,U){return function(){throw new Error(B.type+" action not cancellable. Remove abort in "+U)}}(j,z);return{payload:Bn(j),instance:y,config:b||{},abort:L}}}(r,h),I=t.exact.reduce(function(y,E){var j=E.pluginName,M=E.methodName,l=!1;return M.match(/^initialize/)||M.match(/^reset/)||(l=!g[j].loaded),x.offline&&M.match(/^(page|track|identify)/)&&(l=!0),y[""+j]=l,y},{});return Promise.resolve(t.exact.reduce(function(y,E,j){var M=E.pluginName;return Promise.resolve(y).then(function(l){function b(){return Promise.resolve(l)}var $=function(){if(t.namespaced&&t.namespaced[M])return Promise.resolve(t.namespaced[M].reduce(function(z,L,B){return Promise.resolve(z).then(function(U){return L.method&&Q(L.method)?(function(S,T){var X=Ut(S);if(X&&X.name===T){var V=Ut(X.method);throw new Error([T+" plugin is calling method "+S,"Plugins cant call self","Use "+X.method+" "+(V?"or "+V.method:"")+" in "+T+" plugin insteadof "+S].join(`
2
- `))}}(L.methodName,L.pluginName),Promise.resolve(L.method({payload:U,instance:r,abort:(F=U,q=M,H=L.pluginName,function(S,T){return m({},F,{abort:{reason:S,plugins:T||[q],caller:d,from:H||q}})}),config:At(L.pluginName,g,a),plugins:g})).then(function(S){var T=J(S)?S:{};return Promise.resolve(m({},U,T))})):U;var F,q,H})},Promise.resolve(n))).then(function(z){l[M]=z});l[M]=n}();return $&&$.then?$.then(b):b()})},Promise.resolve({}))).then(function(y){return Promise.resolve(t.exact.reduce(function(E,j,M){try{var l=t.exact.length===M+1,b=j.pluginName,$=a[b];return Promise.resolve(E).then(function(z){var L=y[b]?y[b]:{};if(N&&(L=z),ut(L,b))return ot({data:L,method:d,instance:r,pluginName:b,store:s}),Promise.resolve(z);if(ut(z,b))return l&&ot({data:z,method:d,instance:r,store:s}),Promise.resolve(z);if(I.hasOwnProperty(b)&&I[b]===!0)return s.dispatch({type:"queue",plugin:b,payload:L,_:{called:"queue",from:"queueMechanism"}}),Promise.resolve(z);var B=A(y[b],a[b]);return Promise.resolve($[d]({abort:B.abort,payload:L,instance:r,config:At(b,g,a),plugins:g})).then(function(U){var F=J(U)?U:{},q=m({},z,F),H=y[b];if(ut(H,b))ot({data:H,method:d,instance:r,pluginName:b,store:s});else{var S=d+":"+b;(S.match(/:/g)||[]).length<2&&!d.match(jt)&&!d.match(Tt)&&r.dispatch(m({},N?q:L,{type:S,_:{called:S,from:"submethod"}}))}return Promise.resolve(q)})})}catch(z){return Promise.reject(z)}},Promise.resolve(n))).then(function(E){if(!(d.match(xe)||d.match(/^registerPlugin/)||d.match(Tt)||d.match(jt)||d.match(/^params/)||d.match(/^userIdChanged/))){if(p.plugins.includes(d),E._&&E._.originalAction===d)return E;var j=m({},E,{_:{originalAction:E.type,called:E.type,from:"engineEnd"}});Lt(E,t.exact.length)&&!d.match(/End$/)&&(j=m({},j,{type:E.type+"Aborted"})),s.dispatch(j)}return E})})}catch(y){return Promise.reject(y)}},xe=/Start$/,jt=/^bootstrap/,Tt=/^ready/;function ot(e){var t=e.pluginName,n=e.method+"Aborted"+(t?":"+t:"");e.store.dispatch(m({},e.data,{type:n,_:{called:n,from:"abort"}}))}function At(e,t,n){var r=t[e]||n[e];return r&&r.config?r.config:{}}function Mt(e,t){return t.reduce(function(n,r){return r[e]?n.concat({methodName:e,pluginName:r.name,method:r[e]}):n},[])}function zt(e,t){var n=e.replace(xe,""),r=t?":"+t:"";return[""+e+r,""+n+r,n+"End"+r]}function ut(e,t){var n=e.abort;return!!n&&(n===!0||$t(n,t)||n&&$t(n.plugins,t))}function Lt(e,t){var n=e.abort;if(!n)return!1;if(n===!0||me(n))return!0;var r=n.plugins;return Ae(n)&&n.length===t||Ae(r)&&r.length===t}function Ae(e){return Array.isArray(e)}function $t(e,t){return!(!e||!Ae(e))&&e.includes(t)}function Ut(e){var t=e.match(/(.*):(.*)/);return!!t&&{method:t[1],name:t[2]}}function Bn(e){return Object.keys(e).reduce(function(t,n){return n==="type"||(t[n]=J(e[n])?Object.assign({},e[n]):e[n]),t},{})}function Vn(e,t,n){var r={};return function(i){return function(a){return function(o){try{var s,p=function(l){return s?l:a(d)},g=o.type,x=o.plugins,d=o;if(o.abort)return Promise.resolve(a(o));if(g===v.enablePlugin&&i.dispatch({type:v.initializeStart,plugins:x,disabled:[],fromEnable:!0,meta:o.meta}),g===v.disablePlugin&&setTimeout(function(){return kt(o.meta.rid,{payload:o})},0),g===v.initializeEnd){var N=t(),h=Object.keys(N),A=h.filter(function(l){return x.includes(l)}).map(function(l){return N[l]}),I=[],y=[],E=o.disabled,j=A.map(function(l){var b=l.name;return _t(l,l.loaded,1e4).then(function($){return r[b]||(i.dispatch({type:v.pluginReadyType(b),name:b,events:Object.keys(l).filter(function(z){return!rt.includes(z)})}),r[b]=!0),I=I.concat(b),l}).catch(function($){if($ instanceof Error)throw new Error($);return y=y.concat($.name),$})});Promise.all(j).then(function(l){var b={plugins:I,failed:y,disabled:E};setTimeout(function(){h.length===j.length+E.length&&i.dispatch(m({},{type:v.ready},b))},0)})}var M=function(){if(g!==v.bootstrap)return/^ready:([^:]*)$/.test(g)&&setTimeout(function(){return Nt(i,t,e)},0),Promise.resolve(function(l,b,$,z,L){try{var B=Q(b)?b():b,U=l.type,F=U.replace(xe,"");if(l._&&l._.called)return Promise.resolve(l);var q=$.getState(),H=(X=B,(V=q.plugins)===void 0&&(V={}),(c=l.options)===void 0&&(c={}),Object.keys(X).filter(function(u){var f=c.plugins||{};return On(f[u])?f[u]:f.all!==!1&&(!V[u]||V[u].enabled!==!1)}).map(function(u){return X[u]}));U===v.initializeStart&&l.fromEnable&&(H=Object.keys(q.plugins).filter(function(u){var f=q.plugins[u];return l.plugins.includes(u)&&!f.initialized}).map(function(u){return B[u]}));var S=H.map(function(u){return u.name}),T=function(u,f,P){var O=zt(u).map(function(w){return Mt(w,f)});return f.reduce(function(w,C){var k=C.name,D=zt(u,k).map(function(ke){return Mt(ke,f)}),_=D[0],Y=D[1],Ee=D[2];return _.length&&(w.beforeNS[k]=_),Y.length&&(w.duringNS[k]=Y),Ee.length&&(w.afterNS[k]=Ee),w},{before:O[0],beforeNS:{},during:O[1],duringNS:{},after:O[2],afterNS:{}})}(U,H);return Promise.resolve(at({action:l,data:{exact:T.before,namespaced:T.beforeNS},state:q,allPlugins:B,allMatches:T,instance:$,store:z,EVENTS:L})).then(function(u){function f(){var w=function(){if(U.match(xe))return Promise.resolve(at({action:m({},P,{type:F+"End"}),data:{exact:T.after,namespaced:T.afterNS},state:q,allPlugins:B,allMatches:T,instance:$,store:z,EVENTS:L})).then(function(C){C.meta&&C.meta.hasCallback&&kt(C.meta.rid,{payload:C})})}();return w&&w.then?w.then(function(){return u}):u}if(Lt(u,S.length))return u;var P,O=function(){if(U!==F)return Promise.resolve(at({action:m({},u,{type:F}),data:{exact:T.during,namespaced:T.duringNS},state:q,allPlugins:B,allMatches:T,instance:$,store:z,EVENTS:L})).then(function(w){P=w});P=u}();return O&&O.then?O.then(f):f()})}catch(u){return Promise.reject(u)}var X,V,c}(o,t,e,i,n)).then(function(l){var b=a(l);return s=1,b})}();return Promise.resolve(M&&M.then?M.then(p):p(M))}catch(l){return Promise.reject(l)}}}}}function Jn(e){return function(t){return function(n){return function(r){var i=r.type,a=r.key,o=r.value,s=r.options;if(i===v.setItem||i===v.removeItem){if(r.abort)return n(r);i===v.setItem?e.setItem(a,o,s):e.removeItem(a,s)}return n(r)}}}}var Fn=function(){var e=this;this.before=[],this.after=[],this.addMiddleware=function(t,n){e[n]=e[n].concat(t)},this.removeMiddleware=function(t,n){var r=e[n].findIndex(function(i){return i===t});r!==-1&&(e[n]=[].concat(e[n].slice(0,r),e[n].slice(r+1)))},this.dynamicMiddlewares=function(t){return function(n){return function(r){return function(i){var a={getState:n.getState,dispatch:function(s){return n.dispatch(s)}},o=e[t].map(function(s){return s(a)});return Ie.apply(void 0,o)(r)(i)}}}}};function Hn(e){return function(t,n){t===void 0&&(t={});var r={};if(n.type==="initialize:aborted")return t;if(/^registerPlugin:([^:]*)$/.test(n.type)){var i=Dt(n.type,"registerPlugin"),a=e()[i];if(!a||!i)return t;var o=n.enabled;return r[i]={enabled:o,initialized:!!o&&Boolean(!a.initialize),loaded:!!o&&Boolean(a.loaded()),config:a.config||{}},m({},t,r)}if(/^initialize:([^:]*)$/.test(n.type)){var s=Dt(n.type,v.initialize),p=e()[s];return p&&s?(r[s]=m({},t[s],{initialized:!0,loaded:Boolean(p.loaded())}),m({},t,r)):t}if(/^ready:([^:]*)$/.test(n.type))return r[n.name]=m({},t[n.name],{loaded:!0}),m({},t,r);switch(n.type){case v.disablePlugin:return m({},t,Rt(n.plugins,!1,t));case v.enablePlugin:return m({},t,Rt(n.plugins,!0,t));default:return t}}}function Dt(e,t){return e.substring(t.length+1,e.length)}function Rt(e,t,n){return e.reduce(function(r,i){return r[i]=m({},n[i],{enabled:t}),r},n)}function qt(e){try{return JSON.parse(JSON.stringify(e))}catch(t){}return e}var Gn={last:{},history:[]};function Wn(e,t){e===void 0&&(e=Gn);var n=t.options,r=t.meta;if(t.type===v.track){var i=qt(m({event:t.event,properties:t.properties},Object.keys(n).length&&{options:n},{meta:r}));return m({},e,{last:i,history:e.history.concat(i)})}return e}var Xn={actions:[]};function Qn(e,t){e===void 0&&(e=Xn);var n=t.payload;switch(t.type){case"queue":var r;return r=n&&n.type&&n.type===v.identify?[t].concat(e.actions):e.actions.concat(t),m({},e,{actions:r});case"dequeue":return[];default:return e}}var Ct=/#.*$/;function Kn(e){var t=/(http[s]?:\/\/)?([^\/\s]+\/)(.*)/g.exec(e);return"/"+(t&&t[3]?t[3].split("?")[0].replace(Ct,""):"")}var Bt,Vt,Jt,Ft,Yn=function(e){if(e===void 0&&(e={}),!R)return e;var t=document,n=t.title,r=t.referrer,i=window,a=i.location,o=i.innerWidth,s=i.innerHeight,p=a.hash,g=a.search,x=function(N){var h=function(){if(R){for(var A,I=document.getElementsByTagName("link"),y=0;A=I[y];y++)if(A.getAttribute("rel")==="canonical")return A.getAttribute("href")}}();return h?h.match(/\?/)?h:h+N:window.location.href.replace(Ct,"")}(g),d={title:n,url:x,path:Kn(x),hash:p,search:g,width:o,height:s};return r&&r!==""&&(d.referrer=r),m({},d,e)},Zn={last:{},history:[]};function er(e,t){e===void 0&&(e=Zn);var n=t.options;if(t.type===v.page){var r=qt(m({properties:t.properties,meta:t.meta},Object.keys(n).length&&{options:n}));return m({},e,{last:r,history:e.history.concat(r)})}return e}Bt=function(){if(!R)return!1;var e=navigator.appVersion;return~e.indexOf("Win")?"Windows":~e.indexOf("Mac")?"MacOS":~e.indexOf("X11")?"UNIX":~e.indexOf("Linux")?"Linux":"Unknown OS"}(),Vt=R?document.referrer:null,Jt=An(),Ft=Mn();var Ht={initialized:!1,sessionId:Je(),app:null,version:null,debug:!1,offline:!!R&&!navigator.onLine,os:{name:Bt},userAgent:R?navigator.userAgent:"node",library:{name:"analytics",version:"0.11.0"},timezone:Ft,locale:Jt,campaign:{},referrer:Vt};function tr(e,t){e===void 0&&(e=Ht);var n=e.initialized,r=t.campaign;switch(t.type){case v.campaign:return m({},e,{campaign:r});case v.offline:return m({},e,{offline:!0});case v.online:return m({},e,{offline:!1});default:return n?e:m({},Ht,e,{initialized:!0})}}var nr=["plugins","reducers","storage"];function rr(e,t,n){if(R){var r=window[(n?"add":"remove")+"EventListener"];e.split(" ").forEach(function(i){r(i,t)})}}function ir(e){var t=rr.bind(null,"online offline",function(n){return Promise.resolve(!navigator.onLine).then(e)});return t(!0),function(n){return t(!1)}}function Gt(){return se("analytics",[]),function(e){return function(t,n,r){var i=e(t,n,r),a=i.dispatch;return Object.assign(i,{dispatch:function(o){return ye[he].analytics.push(o.action||o),a(o)}})}}}function Wt(e){return function(){return Ie(Ie.apply(null,arguments),Gt())}}function ct(e){return e?kn(e)?e:[e]:[]}function Xt(e,t,n){e===void 0&&(e={});var r,i,a=Je();return t&&(Te[a]=(r=t,i=function(o){for(var s,p=o||Array.prototype.slice.call(arguments),g=0;g<p.length;g++)if(Q(p[g])){s=p[g];break}return s}(n),function(o){i&&i(o),r(o)})),m({},e,{rid:a,ts:new Date().getTime()},t?{hasCallback:!0}:{})}function ar(e){e===void 0&&(e={});var t=e.reducers||{},n=e.initialUser||{},r=(e.plugins||[]).reduce(function(c,u){if(Q(u))return c.middlewares=c.middlewares.concat(u),c;if(u.NAMESPACE&&(u.name=u.NAMESPACE),!u.name)throw new Error("https://lytics.dev/errors/1");var f=u.EVENTS?Object.keys(u.EVENTS).map(function(w){return u.EVENTS[w]}):[];c.pluginEnabled[u.name]=!(u.enabled===!1||u.config&&u.config.enabled===!1),delete u.enabled,u.methods&&(c.methods[u.name]=Object.keys(u.methods).reduce(function(w,C){var k;return w[C]=(k=u.methods[C],function(){for(var D=Array.prototype.slice.call(arguments),_=new Array(k.length),Y=0;Y<D.length;Y++)_[Y]=D[Y];return _[_.length]=l,k.apply({instance:l},_)}),w},{}),delete u.methods);var P=Object.keys(u).concat(f),O=new Set(c.events.concat(P));if(c.events=Array.from(O),c.pluginsArray=c.pluginsArray.concat(u),c.plugins[u.name])throw new Error(u.name+"AlreadyLoaded");return c.plugins[u.name]=u,c.plugins[u.name].loaded||(c.plugins[u.name].loaded=function(){return!0}),c},{plugins:{},pluginEnabled:{},methods:{},pluginsArray:[],middlewares:[],events:[]}),i=e.storage?e.storage:{getItem:ce,setItem:se,removeItem:be},a=function(c){return function(u,f,P){return f.getState("user")[u]||(P&&J(P)&&P[u]?P[u]:Et(c)[u]||ce(it(u))||null)}}(i),o=r.plugins,s=r.events.filter(function(c){return!rt.includes(c)}).sort(),p=new Set(s.concat(Ge).filter(function(c){return!rt.includes(c)})),g=Array.from(p).sort(),x=function(){return o},d=new Fn,N=d.addMiddleware,h=d.removeMiddleware,A=d.dynamicMiddlewares,I=function(){throw new Error("Abort disabled inListener")},y=zn(),E=Et(i),j=m({},E,n,y.an_uid?{userId:y.an_uid}:{},y.an_aid?{anonymousId:y.an_aid}:{});j.anonymousId||(j.anonymousId=Je());var M=m({enable:function(c,u){return new Promise(function(f){S.dispatch({type:v.enablePlugin,plugins:ct(c),_:{originalAction:v.enablePlugin}},f,[u])})},disable:function(c,u){return new Promise(function(f){S.dispatch({type:v.disablePlugin,plugins:ct(c),_:{originalAction:v.disablePlugin}},f,[u])})}},r.methods),l={identify:function(c,u,f,P){try{var O=me(c)?c:null,w=J(c)?c:u,C=f||{},k=l.user();se(it(oe),O);var D=O||w.userId||a(oe,l,w);return Promise.resolve(new Promise(function(_){S.dispatch(m({type:v.identifyStart,userId:D,traits:w||{},options:C,anonymousId:k.anonymousId},k.id&&k.id!==O&&{previousId:k.id}),_,[u,f,P])}))}catch(_){return Promise.reject(_)}},track:function(c,u,f,P){try{var O=J(c)?c.event:c;if(!O||!me(O))throw new Error("EventMissing");var w=J(c)?c:u||{},C=J(f)?f:{};return Promise.resolve(new Promise(function(k){S.dispatch({type:v.trackStart,event:O,properties:w,options:C,userId:a(oe,l,u),anonymousId:a(Pe,l,u)},k,[u,f,P])}))}catch(k){return Promise.reject(k)}},page:function(c,u,f){try{var P=J(c)?c:{},O=J(u)?u:{};return Promise.resolve(new Promise(function(w){S.dispatch({type:v.pageStart,properties:Yn(P),options:O,userId:a(oe,l,P),anonymousId:a(Pe,l,P)},w,[c,u,f])}))}catch(w){return Promise.reject(w)}},user:function(c){if(c===oe||c==="id")return a(oe,l);if(c===Pe||c==="anonId")return a(Pe,l);var u=l.getState("user");return c?De(u,c):u},reset:function(c){return new Promise(function(u){S.dispatch({type:v.resetStart},u,c)})},ready:function(c){return l.on(v.ready,c)},on:function(c,u){if(!c||!Q(u))return!1;if(c===v.bootstrap)throw new Error(".on disabled for "+c);var f=/Start$|Start:/;if(c==="*"){var P=function(k){return function(D){return function(_){return _.type.match(f)&&u({payload:_,instance:l,plugins:o}),D(_)}}},O=function(k){return function(D){return function(_){return _.type.match(f)||u({payload:_,instance:l,plugins:o}),D(_)}}};return N(P,We),N(O,Xe),function(){h(P,We),h(O,Xe)}}var w=c.match(f)?We:Xe,C=function(k){return function(D){return function(_){return _.type===c&&u({payload:_,instance:l,plugins:o,abort:I}),D(_)}}};return N(C,w),function(){return h(C,w)}},once:function(c,u){if(!c||!Q(u))return!1;if(c===v.bootstrap)throw new Error(".once disabled for "+c);var f=l.on(c,function(P){u({payload:P.payload,instance:l,plugins:o,abort:I}),f()});return f},getState:function(c){var u=S.getState();return c?De(u,c):Object.assign({},u)},dispatch:function(c){var u=me(c)?{type:c}:c;if(Ge.includes(u.type))throw new Error("reserved action "+u.type);var f=m({},u,{_:m({originalAction:u.type},c._||{})});S.dispatch(f)},enablePlugin:M.enable,disablePlugin:M.disable,plugins:M,storage:{getItem:i.getItem,setItem:function(c,u,f){S.dispatch({type:v.setItemStart,key:c,value:u,options:f})},removeItem:function(c,u){S.dispatch({type:v.removeItemStart,key:c,options:u})}},setAnonymousId:function(c,u){l.storage.setItem(ae,c,u)},events:{core:Ge,plugins:s}},b=r.middlewares.concat([function(c){return function(u){return function(f){return f.meta||(f.meta=Xt()),u(f)}}},A(We),Vn(l,x,{all:g,plugins:s}),Jn(i),Rn(l),Cn(l),A(Xe)]),$={context:tr,user:qn(i),page:er,track:Wn,plugins:Hn(x),queue:Qn},z=Ie,L=Ie;if(R&&e.debug){var B=window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__;B&&(z=B({trace:!0,traceLimit:25})),L=function(){return arguments.length===0?Gt():J(typeof arguments[0])?Wt():Wt().apply(null,arguments)}}var U,F=function(c){return Object.keys(c).reduce(function(u,f){return nr.includes(f)||(u[f]=c[f]),u},{})}(e),q=r.pluginsArray.reduce(function(c,u){var f=u.name,P=u.config,O=u.loaded,w=r.pluginEnabled[f];return c[f]={enabled:w,initialized:!!w&&Boolean(!u.initialize),loaded:Boolean(O()),config:P||{}},c},{}),H={context:F,user:j,plugins:q},S=St(function(c){for(var u=Object.keys(c),f={},P=0;P<u.length;P++){var O=u[P];typeof c[O]===ie&&(f[O]=c[O])}var w,C=Object.keys(f);try{(function(k){Object.keys(k).forEach(function(D){var _=k[D];if(typeof _(void 0,{type:"@@redux/INIT"})===te||typeof _(void 0,{type:$n})===te)throw new Error("reducer "+D+" "+te)})})(f)}catch(k){w=k}return function(k,D){if(k===void 0&&(k={}),w)throw w;for(var _=!1,Y={},Ee=0;Ee<C.length;Ee++){var ke=C[Ee],In=k[ke],ht=(0,f[ke])(In,D);if(typeof ht===te){var Rr=Un(ke,D);throw new Error(Rr)}Y[ke]=ht,_=_||ht!==In}return _?Y:k}}(m({},$,t)),H,L(z(Dn.apply(void 0,b))));S.dispatch=(U=S.dispatch,function(c,u,f){var P=m({},c,{meta:Xt(c.meta,u,ct(f))});return U.apply(null,[P])});var T=Object.keys(o);S.dispatch({type:v.bootstrap,plugins:T,config:F,params:y,user:j,initialUser:n,persistedUser:E});var X=T.filter(function(c){return r.pluginEnabled[c]}),V=T.filter(function(c){return!r.pluginEnabled[c]});return S.dispatch({type:v.registerPlugins,plugins:T,enabled:r.pluginEnabled}),r.pluginsArray.map(function(c,u){var f=c.bootstrap,P=c.config,O=c.name;f&&Q(f)&&f({instance:l,config:P,payload:c}),S.dispatch({type:v.registerPluginType(O),name:O,enabled:r.pluginEnabled[O],plugin:c}),r.pluginsArray.length===u+1&&S.dispatch({type:v.initializeStart,plugins:X,disabled:V})}),ir(function(c){S.dispatch({type:c?v.offline:v.online})}),function(c,u,f){setInterval(function(){return Nt(c,u,f)},3e3)}(S,x,l),l}var We="before",Xe="after",Me="cookie",fe=Yt(),Qt=Qe,or=Qe;function Kt(e){return fe?Qe(e,"",-1):be(e)}function Yt(){if(fe!==void 0)return fe;var e="cookiecookie";try{Qe(e,e),fe=document.cookie.indexOf(e)!==-1,Kt(e)}catch(t){fe=!1}return fe}function Qe(e,t,n,r,i,a){if(typeof window!="undefined"){var o=arguments.length>1;return fe===!1&&(o?se(e,t):ce(e)),o?document.cookie=e+"="+encodeURIComponent(t)+(n?"; expires="+new Date(+new Date+1e3*n).toUTCString()+(r?"; path="+r:"")+(i?"; domain="+i:"")+(a?"; secure":""):""):decodeURIComponent((("; "+document.cookie).split("; "+e+"=")[1]||"").split(";")[0])}}var ze="localStorage",ur=nt.bind(null,"localStorage");we("localStorage","getItem",ce),we("localStorage","setItem",se),we("localStorage","removeItem",be);var Le="sessionStorage",cr=nt.bind(null,"sessionStorage");we("sessionStorage","getItem",ce),we("sessionStorage","setItem",se),we("sessionStorage","removeItem",be);function Oe(e){var t=e;try{if((t=JSON.parse(e))==="true")return!0;if(t==="false")return!1;if(J(t))return t;parseFloat(t)===t&&(t=parseFloat(t))}catch(n){}if(t!==null&&t!=="")return t}var sr=ur(),lr=cr(),fr=Yt();function Zt(e,t){if(e){var n=st(t),r=!pt(n),i=lt(n)?Oe(localStorage.getItem(e)):void 0;if(r&&!ve(i))return i;var a=ft(n)?Oe(Qt(e)):void 0;if(r&&a)return a;var o=dt(n)?Oe(sessionStorage.getItem(e)):void 0;if(r&&o)return o;var s=ce(e);return r?s:{localStorage:i,sessionStorage:o,cookie:a,global:s}}}function dr(e,t,n){if(e&&!ve(t)){var r={},i=st(n),a=JSON.stringify(t),o=!pt(i);return lt(i)&&(r[ze]=Ye(ze,t,Oe(localStorage.getItem(e))),localStorage.setItem(e,a),o)?r[ze]:ft(i)&&(r[Me]=Ye(Me,t,Oe(Qt(e))),or(e,a),o)?r[Me]:dt(i)&&(r[Le]=Ye(Le,t,Oe(sessionStorage.getItem(e))),sessionStorage.setItem(e,a),o)?r[Le]:(r[je]=Ye(je,t,ce(e)),se(e,t),o?r[je]:r)}}function pr(e,t){if(e){var n=st(t),r=Zt(e,qe),i={};return!ve(r.localStorage)&&lt(n)&&(localStorage.removeItem(e),i[ze]=r.localStorage),!ve(r.cookie)&&ft(n)&&(Kt(e),i[Me]=r.cookie),!ve(r.sessionStorage)&&dt(n)&&(sessionStorage.removeItem(e),i[Le]=r.sessionStorage),!ve(r.global)&&Ke(n,je)&&(be(e),i[je]=r.global),i}}function st(e){return e?me(e)?e:e.storage:_e}function lt(e){return sr&&Ke(e,ze)}function ft(e){return fr&&Ke(e,Me)}function dt(e){return lr&&Ke(e,Le)}function pt(e){return e===qe||e==="all"}function Ke(e,t){return e===_e||e===t||pt(e)}function Ye(e,t,n){return{location:e,current:t,previous:n}}var gr={setItem:dr,getItem:Zt,removeItem:pr};function mr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function en(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function tn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?en(Object(n),!0).forEach(function(r){mr(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):en(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function nn(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t={storage:gr};return ar(tn(tn({},t),e))}function vr(e,t,n,r,i,a,o){e.fbq||(i=e.fbq=function(){i.callMethod?i.callMethod.apply(i,arguments):i.queue.push(arguments)},e._fbq||(e._fbq=i),i.push=i,i.loaded=!0,i.version="2.0",i.queue=[],a=t.createElement(n),a.async=!0,a.src=r,o=t.getElementsByTagName(n)[0],o.parentNode.insertBefore(a,o))}function hr({trackingId:e}){vr(window,document,"script","https://connect.facebook.net/en_US/fbevents.js"),window.fbq("init",e)}function yr(e={}){return{name:"facebook",config:e,initialize:function({config:t,instance:n}){if(!t.trackingId)throw new Error("No Facebook trackingId defined");hr({trackingId:t.trackingId})},page:function({payload:t,config:n,instance:r}){window.fbq("track","PageView")},track:function({payload:t,config:n,instance:r}){window.fbq("track",t.event,t.properties)},identify:function({payload:t,config:n}){},loaded:function(){return!!window.fbq}}}function $e(){window.dataLayer.push(arguments)}window.gtag=$e;function br({trackingId:e,configParams:t={},setParams:n={}}){var r="ga-gtag";if(!document.getElementById(r)){var i=document.head,a=document.createElement("script");a.id=r,a.type="text/javascript",a.async=!0,a.src="https://www.googletagmanager.com/gtag/js?id="+e,i.insertBefore(a,i.firstChild),window.dataLayer=window.dataLayer||[],$e("js",new Date),n&&$e("set",n),$e("config",e,t)}}function wr(e={}){return{name:"google-analytics-4",config:e,initialize:function({config:t,instance:n}){if(!t.trackingId)throw new Error("No GA trackingId defined");var r={},i={};if(t.customDimensions){for(var a={},o=0;o<t.customDimensions.length;o++){var s=t.customDimensions[o];r[s.name]=s.callback(n,t),a["dimension"+(o+1)]=s.name}i.custom_map=a}br({trackingId:t.trackingId,configParams:r,setParams:i})},page:function({payload:t,config:n,instance:r}){},track:function({payload:t,config:n,instance:r}){$e("event",t.event,t.properties)},identify:function({payload:t,config:n}){},loaded:function(){return!!window.gtag}}}var Ir=new URLSearchParams(window.location.search),Sr=Ir.get("zdbg"),rn={};const Ze="undefined";function K(){Sr==1&&console.debug(...arguments)}function G(e){console.warn(e),window.Rollbar&&window.Rollbar.warning(e)}function Pr(e){return e&&(Object.prototype.toString.call(e)==="[object Function]"||typeof e=="function"||e instanceof Function)}function an(){try{var e=navigator.userAgent||"",t=new RegExp([/bot/,/spider/,/crawl/,/mediapartners/,/Google-Read-Aloud/,/semrush/].map(n=>n.source).join("|"),"i");return t.test(e)}catch(n){return!1}}function xr(e){document.readyState==="complete"||document.readyState==="loaded"||document.readyState==="interactive"?e():window.addEventListener("DOMContentLoaded",e)}var de=Or();function Or(){if(typeof de!==Ze)return de;de=!0;try{sessionStorage.setItem(Ze,Ze),sessionStorage.removeItem(Ze)}catch(e){de=!1}return de}function on(e){var t,n=rn[e];return de?(t=sessionStorage.getItem(e),!t&&n&&(t=n,sessionStorage.setItem(e,t))):t=n,t?JSON.parse(t):void 0}function Er(e,t){var n=JSON.stringify(t);de&&sessionStorage.setItem(e,n),rn[e]=n}function kr(){var e=document.createElement("div");e.innerHTML="&nbsp;",e.className="pub_300x250 pub_300x250m pub_728x90 text-ad textAd text_ad text_ads text-ads text-ad-links",e.setAttribute("style","width: 1px !important; height: 1px !important; position: absolute !important; left: -10000px !important; top: -1000px !important;");try{if(document.body.appendChild(e),document.body.getAttribute("abp")!==null||e.offsetHeight===0||e.clientHeight===0)return!0;if(typeof getComputedStyle!="undefined"){var t=window.getComputedStyle(e,null);if(t&&(t.getPropertyValue("display")==="none"||t.getPropertyValue("visibility")==="hidden"))return!0}document.body.removeChild(e)}catch(n){}return!1}function un({method:e,url:t,data:n,json:r=!0}){return new Promise(function(i,a){var o=new XMLHttpRequest;o.open(e,t),o.withCredentials=!0,r&&(o.setRequestHeader("Accept","application/json"),o.setRequestHeader("Content-Type","application/json")),o.onload=function(){this.status>=200&&this.status<300?i(r?JSON.parse(o.response):o.response):a({status:this.status,message:o.statusText})},o.onerror=function(){a({status:this.status,message:"Network Error"})},n?o.send(n):o.send()})}function _r(e){return"?"+Object.keys(e).map(function(t){return t+"="+encodeURIComponent(e[t])}).join("&")}function Nr(n){return ne(this,arguments,function*({url:e,data:t}){if(window&&window.navigator&&typeof window.navigator.sendBeacon=="function"&&typeof window.Blob=="function")try{const r=new Blob([JSON.stringify(t)],{type:"text/plain; charset=UTF-8"});return!!window.navigator.sendBeacon(e,r)}catch(r){return G("postBeacon:"),!1}return!1})}function jr(r){return ne(this,arguments,function*({url:e,params:t=null,json:n=!0}){var i=e;return t&&(i=i+_r(t)),yield un({method:"GET",url:i,json:n})})}function gt(i){return ne(this,arguments,function*({url:e,data:t,json:n=!0,beacon:r=!1}){var a=t;if(n&&(a=JSON.stringify(a)),r){var o=yield Nr({url:e,data:t});if(o)return;K("Beacon failed")}return yield un({method:"POST",url:e,data:a,json:n})})}var et="__zar_vid",cn="success",Ue="error",Tr=30*1e3,sn=0,Ar=3,W={};window.zarPoolData=null;var pe=new Map;function Mr(){return Date.now().toString(36)+"."+Math.random().toString(36).substring(2)}function zr(e,t,n,r){var i,a=!1,o=null,s=n(e);!s||!s.id?(i=t(),o=document.referrer,a=!0,K("new ID for",e,"-",i)):(i=s.id,o=s.origReferrer);var p={id:i,t:Date.now(),origReferrer:o,isNew:a};return r(e,p),p}function ln(){var e=zr(et,Mr,on,Er);return{vid:e}}function fn(){return window.location.host+"/api/v1"}function dn(e){return on(e)}function pn(e){var t=dn(e);return t?t.id:null}function tt(){return{vid:dn(et)}}function Lr(){return{vid:pn(et)}}function gn({elem:e}){var t=null,n=null,r=null,i=new RegExp("\\+?\\(?\\d*\\)? ?\\(?\\d+\\)?\\d*([\\s./-]?\\d{2,})+","g");e.href&&e.href.startsWith("tel:")&&(r=e.href);var a=e.innerText,o=e.innerHTML,s=i.exec(a);return s&&(t=s[0].trim(),n=t.replace("+","").replace(/-/g,"").replace(/ /g,"").replace("(","").replace(")","").replace(/^1/,"")),{text:a,html:o,numberText:t,href:r,number:n}}function mt({elems:e,number:t,force:n=!1}){var r,i=t;t.startsWith("+1")||(i="+1"+t);for(var a=0;a<e.length;a++){if(pe.has(e[a]))if(n)r=pe.get(e[a]);else{K("element already in overlay map:",e[a]);continue}var o=gn({elem:e[a]});if(r?!n&&o.number&&r.number&&r.number!==o.number&&G("overlaying multiple numbers with a single number",r.number,o.number):r=o,K("overlaying",i,"on",e[a]),pe.has(e[a])||pe.set(e[a],o),o.href&&(e[a].href="tel:"+i),o.numberText)if(e[a].innerHTML="",o.text){var s=i;if(o.numberText.indexOf("-")>-1&&(s=i.slice(2,5)+"-"+i.slice(5,8)+"-"+i.slice(8,12)),o.html.indexOf("<img")>-1){var p=o.html.replace(o.numberText,s);e[a].innerHTML=p}else{var g=o.text.replace(o.numberText,s);e[a].appendChild(document.createTextNode(g))}}else e[a].appendChild(document.createTextNode(i));else K("no number text found:",e[a])}}function vt({elems:e}){for(var t=0;t<e.length;t++)if(pe.has(e[t])){var n=e[t].innerHTML,r=pe.get(e[t]);K("orig:",r);var i=r.html;K("reverting",n,"to",i),e[t].innerHTML=i,r.href&&(e[t].href=r.href),pe.delete(e[t])}else K("element not in map:",e[t])}function mn(e){clearInterval(W[e]),delete W[e]}function vn(){for(var e in W)mn(e)}function hn(i){return ne(this,arguments,function*({poolId:e,apiUrl:t,number:n=null,context:r=null}){var a={pool_id:e,number:n,context:r,properties:{zar:tt()}},o=yield gt({url:`${t}/number_pool`,data:a});return o})}function $r(r){return ne(this,arguments,function*({apiUrl:e,key:t=null,with_contexts:n=!1}){var i={key:t,with_contexts:n},a=yield jr({url:`${e}/number_pool_stats`,params:i});return a})}function Ur(){return ne(this,arguments,function*({overlayElements:e,apiUrl:t=fn(),contextCallback:n=null}={}){var r={};n&&(r=n()||{});const i=window.zarPoolData.pool_id,a=window.zarPoolData.number;try{var o=yield hn({poolId:i,apiUrl:t,number:a,context:r})}catch(g){var s="error getting number: "+JSON.stringify(g);return G(s),sn++,sn>=Ar&&(G("max failures, stopping pool"),vn(),e&&vt({elems:e})),{status:Ue,msg:s}}if(o.status===cn&&o.number){var p=!1;o.number!==window.zarPoolData.number&&(G("number changed from "+window.zarPoolData.number+" to "+o.number),window.zarPoolData.number=o.number,p=!0),e&&mt({elems:e,number:o.number,force:p})}else e&&vt({elems:e}),W[i]&&(clearInterval(W[i]),delete W[i]);return o})}function yn(e){return Pr(e)?e():e}function bn(){return ne(this,arguments,function*({poolData:e,poolConfig:t,apiUrl:n}={}){var r;if(!t||!t.poolId||!t.overlayQuerySelector||!n)return r="missing pool config: "+JSON.stringify(t),G(r),t.initCallback&&t.initCallback({status:Ue,msg:r}),W;var i={};t.contextCallback&&(i=t.contextCallback()||{});var a=yn(t.poolId);if(!a)return r="no pool ID",G(r),t.initCallback&&t.initCallback({status:Ue,msg:r}),W;if(!e)try{e=yield hn({poolId:a,apiUrl:n,number:null,context:i})}catch(o){return r="error getting number on init: "+JSON.stringify(o),G(r),t.initCallback&&t.initCallback({status:Ue,msg:r}),W}return window.zarPoolData=e,e&&e.status===cn&&e.number&&xr(function(){var o=document.querySelectorAll(t.overlayQuerySelector);if(!o){var s="No elems found for:"+t.overlayQuerySelector;G(s),t.initCallback&&t.initCallback({status:Ue,msg:s});return}mt({elems:o,number:e.number});var p=setInterval(function(){try{Ur({overlayElements:o,apiUrl:n,contextCallback:t.contextCallback})}catch(x){var g="error on interval: "+JSON.stringify(x);G(g)}},t.renewalInterval||Tr);W[e.pool_id]=p,t.initCallback&&t.initCallback(e)}),W})}function wn({apiUrl:e,poolConfig:t}){return ln(),{name:"zar",config:{apiUrl:e,poolConfig:t},initialize:function({config:n}){},loaded:function(){return!0},pageStart:function({payload:n,config:r,instance:i}){n.properties.zar=tt(),n.properties.referrer=document.referrer,n.properties.is_bot=an(),"hash"in n.properties&&delete n.properties.hash,"path"in n.properties&&delete n.properties.path,"search"in n.properties&&delete n.properties.search;try{var a=r.poolConfig;a&&a.poolId&&(n.properties.pool_id=yn(a.poolId),a.contextCallback&&(n.properties.pool_context=a.contextCallback()||{}))}catch(o){G("error getting pool id: "+JSON.stringify(o))}return n},page:function(o){return ne(this,arguments,function*({payload:n,options:r,instance:i,config:a}){K("page",n,r,a);for(var s=0,p=3,g;s<p;)try{g=yield gt({url:`${a.apiUrl}/page`,data:n});break}catch(x){if(s++,s>=p)throw G("error posting page: "+JSON.stringify(x)),x;yield new Promise(d=>setTimeout(d,1e3))}g&&g.pool_data&&bn({poolData:g.pool_data,poolConfig:a.poolConfig,apiUrl:a.apiUrl})})},trackStart:function({payload:n,config:r,instance:i}){return n.properties.zar=tt(),n.properties.url=window.location.href,n.properties.referrer=document.referrer,n},track:function({payload:n,options:r,instance:i,config:a}){K("track",n),gt({url:`${a.apiUrl}/track`,data:n,beacon:!0})},methods:{apiUrl(){return e},poolConfig(){return t},initIDs(){return ln()},getIDs(){return Lr()},getStorage(){return tt()},getVID(){return pn(et)},hasAdBlock(){return kr()},isBot(){return an()},initTrackingPool({poolConfig:n}){var r=this.instance.plugins.zar;return bn({poolData:null,poolConfig:Object.assign(r.poolConfig(),n||{}),apiUrl:r.apiUrl()})},getPoolIntervals(){return W},clearPoolInterval({poolId:n}){mn(n)},clearPoolIntervals(){vn()},extractPhoneNumbers({elems:n}){for(var r=[],i=0;i<n.length;i++){var a=gn({elem:n[i]});r.push(a)}return r},overlayPhoneNumber({overlayElements:n,number:r}){mt({elems:n,number:r})},revertOverlayNumbers({overlayElements:n}){vt({elems:n})},getPoolStats({key:n=null,with_contexts:r=!1}){return $r({apiUrl:this.instance.plugins.zar.apiUrl(),key:n,with_contexts:r})}}}}function Dr({app:e,ga4Config:t=null,facebookConfig:n=null,apiUrl:r=null,poolConfig:i=null}){r||(r=fn());var a=[wn({apiUrl:r,poolConfig:i})];return t&&a.push(wr(t)),n&&a.push(yr(n)),nn({app:e,plugins:a})}return ue.Analytics=nn,ue.init=Dr,ue.zar=wn,Object.defineProperties(ue,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),ue}({});
1
+ var Z=(ue,Re,ee)=>new Promise((qe,_e)=>{var Be=C=>{try{ne(ee.next(C))}catch(ge){_e(ge)}},te=C=>{try{ne(ee.throw(C))}catch(ge){_e(ge)}},ne=C=>C.done?qe(C.value):Promise.resolve(C.value).then(Be,te);ne((ee=ee.apply(ue,Re)).next())});var zar=function(ue){"use strict";function Re(e,t,r,n,i){for(t=t.split?t.split("."):t,n=0;n<t.length;n++)e=e?e[t[n]]:i;return e===i?r:e}var ee="undefined",qe="object",_e="any",Be="*",te="__",ne=typeof process!="undefined"?process:{};ne.env&&ne.env.NODE_ENV;var C=typeof window!="undefined";ne.versions!=null&&ne.versions.node!=null,typeof Deno!="undefined"&&Deno.core,C&&window.name==="nodejs"||typeof navigator!="undefined"&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom"));function ge(e,t){return t.charAt(0)[e]()+t.slice(1)}var xr=ge.bind(null,"toUpperCase"),Or=ge.bind(null,"toLowerCase");function Er(e){return Pt(e)?xr("null"):typeof e=="object"?zr(e):Object.prototype.toString.call(e).slice(8,-1)}function Ve(e,t){t===void 0&&(t=!0);var r=Er(e);return t?Or(r):r}function Ne(e,t){return typeof t===e}var Q=Ne.bind(null,"function"),ve=Ne.bind(null,"string"),me=Ne.bind(null,"undefined"),kr=Ne.bind(null,"boolean");Ne.bind(null,"symbol");function Pt(e){return e===null}function _r(e){return Ve(e)==="number"&&!isNaN(e)}function Nr(e){return Ve(e)==="array"}function F(e){if(!jr(e))return!1;for(var t=e;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function jr(e){return e&&(typeof e=="object"||e!==null)}function zr(e){return Q(e.constructor)?e.constructor.name:null}function Tr(e){return e instanceof Error||ve(e.message)&&e.constructor&&_r(e.constructor.stackTraceLimit)}function St(e,t){if(typeof t!="object"||Pt(t))return!1;if(t instanceof e)return!0;var r=Ve(new e(""));if(Tr(t))for(;t;){if(Ve(t)===r)return!0;t=Object.getPrototypeOf(t)}return!1}St.bind(null,TypeError),St.bind(null,SyntaxError);function Je(e,t){var r=e instanceof Element||e instanceof HTMLDocument;return r&&t?Ar(e,t):r}function Ar(e,t){return t===void 0&&(t=""),e&&e.nodeName===t.toUpperCase()}function Fe(e){var t=[].slice.call(arguments,1);return function(){return e.apply(void 0,[].slice.call(arguments).concat(t))}}Fe(Je,"form"),Fe(Je,"button"),Fe(Je,"input"),Fe(Je,"select");function xt(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(t){return null}}function Dr(){if(C){var e=navigator,t=e.languages;return e.userLanguage||(t&&t.length?t[0]:e.language)}}function Lr(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){}}function Mr(e){return function(t){for(var r,n=Object.create(null),i=/([^&=]+)=?([^&]*)/g;r=i.exec(t);){var a=xt(r[1]),o=xt(r[2]);a.substring(a.length-2)==="[]"?(n[a=a.substring(0,a.length-2)]||(n[a]=[])).push(o):n[a]=o===""||o}for(var s in n){var p=s.split("[");p.length>1&&($r(n,p.map(function(g){return g.replace(/[?[\]\\ ]/g,"")}),n[s]),delete n[s])}return n}(function(t){if(t){var r=t.match(/\?(.*)/);return r&&r[1]?r[1].split("#")[0]:""}return C&&window.location.search.substring(1)}(e))}function $r(e,t,r){for(var n=t.length-1,i=0;i<n;++i){var a=t[i];if(a==="__proto__"||a==="constructor")break;a in e||(e[a]={}),e=e[a]}e[t[n]]=r}function He(){for(var e="",t=0,r=4294967295*Math.random()|0;t++<36;){var n="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx"[t-1],i=15&r;e+=n=="-"||n=="4"?n:(n=="x"?i:3&i|8).toString(16),r=t%8==0?4294967295*Math.random()|0:r>>4}return e}var je="global",he=te+"global"+te,ye=typeof self===qe&&self.self===self&&self||typeof global===qe&&global.global===global&&global||void 0;function ce(e){return ye[he][e]}function se(e,t){return ye[he][e]=t}function be(e){delete ye[he][e]}function we(e,t,r){var n;try{if(it(e)){var i=window[e];n=i[t].bind(i)}}catch(a){}return n||r}ye[he]||(ye[he]={});var Ge={};function it(e){if(typeof Ge[e]!==ee)return Ge[e];try{var t=window[e];t.setItem(ee,ee),t.removeItem(ee)}catch(r){return Ge[e]=!1}return Ge[e]=!0}function v(){return v=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},v.apply(this,arguments)}var ie="function",re="undefined",Ur="@@redux/"+Math.random().toString(36),Ot=function(){return typeof Symbol===ie&&Symbol.observable||"@@observable"}(),We=" != "+ie;function Et(e,t,r){var n;if(typeof t===ie&&typeof r===re&&(r=t,t=void 0),typeof r!==re){if(typeof r!==ie)throw new Error("enhancer"+We);return r(Et)(e,t)}if(typeof e!==ie)throw new Error("reducer"+We);var i=e,a=t,o=[],s=o,p=!1;function g(){s===o&&(s=o.slice())}function x(){return a}function d(h){if(typeof h!==ie)throw new Error("Listener"+We);var T=!0;return g(),s.push(h),function(){if(T){T=!1,g();var I=s.indexOf(h);s.splice(I,1)}}}function N(h){if(!F(h))throw new Error("Act != obj");if(typeof h.type===re)throw new Error("ActType "+re);if(p)throw new Error("Dispatch in reducer");try{p=!0,a=i(a,h)}finally{p=!1}for(var T=o=s,I=0;I<T.length;I++)(0,T[I])();return h}return N({type:"@@redux/INIT"}),(n={dispatch:N,subscribe:d,getState:x,replaceReducer:function(h){if(typeof h!==ie)throw new Error("next reducer"+We);i=h,N({type:"@@redux/INIT"})}})[Ot]=function(){var h,T=d;return(h={subscribe:function(I){if(typeof I!="object")throw new TypeError("Observer != obj");function y(){I.next&&I.next(x())}return y(),{unsubscribe:T(y)}}})[Ot]=function(){return this},h},n}function Cr(e,t){var r=t&&t.type;return"action "+(r&&r.toString()||"?")+"reducer "+e+" returns "+re}function Ie(){var e=[].slice.call(arguments);return e.length===0?function(t){return t}:e.length===1?e[0]:e.reduce(function(t,r){return function(){return t(r.apply(void 0,[].slice.call(arguments)))}})}function Rr(){var e=arguments;return function(t){return function(r,n,i){var a,o=t(r,n,i),s=o.dispatch,p={getState:o.getState,dispatch:function(g){return s(g)}};return a=[].slice.call(e).map(function(g){return g(p)}),v({},o,{dispatch:s=Ie.apply(void 0,a)(o.dispatch)})}}}var ae=te+"anon_id",le=te+"user_id",Pe=te+"user_traits",oe="userId",Se="anonymousId",Xe=["bootstrap","params","campaign","initializeStart","initialize","initializeEnd","ready","resetStart","reset","resetEnd","pageStart","page","pageEnd","pageAborted","trackStart","track","trackEnd","trackAborted","identifyStart","identify","identifyEnd","identifyAborted","userIdChanged","registerPlugins","enablePlugin","disablePlugin","online","offline","setItemStart","setItem","setItemEnd","setItemAborted","removeItemStart","removeItem","removeItemEnd","removeItemAborted"],at=["name","EVENTS","config","loaded"],m=Xe.reduce(function(e,t){return e[t]=t,e},{registerPluginType:function(e){return"registerPlugin:"+e},pluginReadyType:function(e){return"ready:"+e}}),kt=/^utm_/,_t=/^an_prop_/,Nt=/^an_trait_/;function qr(e){var t=e.storage.setItem;return function(r){return function(n){return function(i){if(i.type===m.bootstrap){var a=i.params,o=i.user,s=i.persistedUser,p=i.initialUser,g=s.userId===o.userId;s.anonymousId!==o.anonymousId&&t(ae,o.anonymousId),g||t(le,o.userId),p.traits&&t(Pe,v({},g&&s.traits?s.traits:{},p.traits));var x=Object.keys(i.params);if(x.length){var d=a.an_uid,N=a.an_event,h=x.reduce(function(T,I){if(I.match(kt)||I.match(/^(d|g)clid/)){var y=I.replace(kt,"");T.campaign[y==="campaign"?"name":y]=a[I]}return I.match(_t)&&(T.props[I.replace(_t,"")]=a[I]),I.match(Nt)&&(T.traits[I.replace(Nt,"")]=a[I]),T},{campaign:{},props:{},traits:{}});r.dispatch(v({type:m.params,raw:a},h,d?{userId:d}:{})),d&&setTimeout(function(){return e.identify(d,h.traits)},0),N&&setTimeout(function(){return e.track(N,h.props)},0),Object.keys(h.campaign).length&&r.dispatch({type:m.campaign,campaign:h.campaign})}}return n(i)}}}}function Br(e){return function(t,r){if(t===void 0&&(t={}),r===void 0&&(r={}),r.type===m.setItemEnd){if(r.key===ae)return v({},t,{anonymousId:r.value});if(r.key===le)return v({},t,{userId:r.value})}switch(r.type){case m.identify:return Object.assign({},t,{userId:r.userId,traits:v({},t.traits,r.traits)});case m.reset:return[le,ae,Pe].forEach(function(n){e.removeItem(n)}),Object.assign({},t,{userId:null,anonymousId:null,traits:{}});default:return t}}}function jt(e){return{userId:e.getItem(le),anonymousId:e.getItem(ae),traits:e.getItem(Pe)}}var ot=function(e){return te+"TEMP"+te+e};function Vr(e){var t=e.storage,r=t.setItem,n=t.removeItem,i=t.getItem;return function(a){return function(o){return function(s){var p=s.userId,g=s.traits,x=s.options;if(s.type===m.reset&&([le,Pe,ae].forEach(function(h){n(h)}),[oe,Se,"traits"].forEach(function(h){be(ot(h))})),s.type===m.identify){i(ae)||r(ae,He());var d=i(le),N=i(Pe)||{};d&&d!==p&&a.dispatch({type:m.userIdChanged,old:{userId:d,traits:N},new:{userId:p,traits:g},options:x}),p&&r(le,p),g&&r(Pe,v({},N,g))}return o(s)}}}}var ze={};function zt(e,t){ze[e]&&Q(ze[e])&&(ze[e](t),delete ze[e])}function Tt(e,t,r){return new Promise(function(n,i){return t()?n(e):r<1?i(v({},e,{queue:!0})):new Promise(function(a){return setTimeout(a,10)}).then(function(a){return Tt(e,t,r-10).then(n,i)})})}function At(e,t,r){var n=t(),i=e.getState(),a=i.plugins,o=i.queue,s=i.user;if(!i.context.offline&&o&&o.actions&&o.actions.length){var p=o.actions.reduce(function(x,d,N){return a[d.plugin].loaded?(x.process.push(d),x.processIndex.push(N)):(x.requeue.push(d),x.requeueIndex.push(N)),x},{processIndex:[],process:[],requeue:[],requeueIndex:[]});if(p.processIndex&&p.processIndex.length){p.processIndex.forEach(function(x){var d=o.actions[x],N=d.plugin,h=d.payload.type,T=n[N][h];if(T&&Q(T)){var I=function(E,j){return E===void 0&&(E={}),j===void 0&&(j={}),[oe,Se].reduce(function(A,l){return E.hasOwnProperty(l)&&j[l]&&j[l]!==E[l]&&(A[l]=j[l]),A},E)}(d.payload,s);T({payload:I,config:a[N].config,instance:r});var y=h+":"+N;e.dispatch(v({},I,{type:y,_:{called:y,from:"queueDrain"}}))}});var g=o.actions.filter(function(x,d){return!~p.processIndex.indexOf(d)});o.actions=g}}}var ut=function(e){var t=e.data,r=e.action,n=e.instance,i=e.state,a=e.allPlugins,o=e.allMatches,s=e.store,p=e.EVENTS;try{var g=i.plugins,x=i.context,d=r.type,N=d.match(xe),h=t.exact.map(function(y){return y.pluginName});N&&(h=o.during.map(function(y){return y.pluginName}));var T=function(y,E){return function(j,A,l){var b=A.config,M=A.name,D=M+"."+j.type;l&&(D=l.event);var L=j.type.match(xe)?function(B,$,H,R,G){return function(P,z){var X=R?R.name:B,J=z&&Te(z)?z:H;if(R&&(!(J=z&&Te(z)?z:[B]).includes(B)||J.length!==1))throw new Error("Method "+$+" can only abort "+B+" plugin. "+JSON.stringify(J)+" input valid");return v({},G,{abort:{reason:P,plugins:J,caller:$,_:X}})}}(M,D,E,l,j):function(B,$){return function(){throw new Error(B.type+" action not cancellable. Remove abort in "+$)}}(j,D);return{payload:Jr(j),instance:y,config:b||{},abort:L}}}(n,h),I=t.exact.reduce(function(y,E){var j=E.pluginName,A=E.methodName,l=!1;return A.match(/^initialize/)||A.match(/^reset/)||(l=!g[j].loaded),x.offline&&A.match(/^(page|track|identify)/)&&(l=!0),y[""+j]=l,y},{});return Promise.resolve(t.exact.reduce(function(y,E,j){var A=E.pluginName;return Promise.resolve(y).then(function(l){function b(){return Promise.resolve(l)}var M=function(){if(t.namespaced&&t.namespaced[A])return Promise.resolve(t.namespaced[A].reduce(function(D,L,B){return Promise.resolve(D).then(function($){return L.method&&Q(L.method)?(function(P,z){var X=qt(P);if(X&&X.name===z){var J=qt(X.method);throw new Error([z+" plugin is calling method "+P,"Plugins cant call self","Use "+X.method+" "+(J?"or "+J.method:"")+" in "+z+" plugin insteadof "+P].join(`
2
+ `))}}(L.methodName,L.pluginName),Promise.resolve(L.method({payload:$,instance:n,abort:(H=$,R=A,G=L.pluginName,function(P,z){return v({},H,{abort:{reason:P,plugins:z||[R],caller:d,from:G||R}})}),config:Mt(L.pluginName,g,a),plugins:g})).then(function(P){var z=F(P)?P:{};return Promise.resolve(v({},$,z))})):$;var H,R,G})},Promise.resolve(r))).then(function(D){l[A]=D});l[A]=r}();return M&&M.then?M.then(b):b()})},Promise.resolve({}))).then(function(y){return Promise.resolve(t.exact.reduce(function(E,j,A){try{var l=t.exact.length===A+1,b=j.pluginName,M=a[b];return Promise.resolve(E).then(function(D){var L=y[b]?y[b]:{};if(N&&(L=D),st(L,b))return ct({data:L,method:d,instance:n,pluginName:b,store:s}),Promise.resolve(D);if(st(D,b))return l&&ct({data:D,method:d,instance:n,store:s}),Promise.resolve(D);if(I.hasOwnProperty(b)&&I[b]===!0)return s.dispatch({type:"queue",plugin:b,payload:L,_:{called:"queue",from:"queueMechanism"}}),Promise.resolve(D);var B=T(y[b],a[b]);return Promise.resolve(M[d]({abort:B.abort,payload:L,instance:n,config:Mt(b,g,a),plugins:g})).then(function($){var H=F($)?$:{},R=v({},D,H),G=y[b];if(st(G,b))ct({data:G,method:d,instance:n,pluginName:b,store:s});else{var P=d+":"+b;(P.match(/:/g)||[]).length<2&&!d.match(Dt)&&!d.match(Lt)&&n.dispatch(v({},N?R:L,{type:P,_:{called:P,from:"submethod"}}))}return Promise.resolve(R)})})}catch(D){return Promise.reject(D)}},Promise.resolve(r))).then(function(E){if(!(d.match(xe)||d.match(/^registerPlugin/)||d.match(Lt)||d.match(Dt)||d.match(/^params/)||d.match(/^userIdChanged/))){if(p.plugins.includes(d),E._&&E._.originalAction===d)return E;var j=v({},E,{_:{originalAction:E.type,called:E.type,from:"engineEnd"}});Ct(E,t.exact.length)&&!d.match(/End$/)&&(j=v({},j,{type:E.type+"Aborted"})),s.dispatch(j)}return E})})}catch(y){return Promise.reject(y)}},xe=/Start$/,Dt=/^bootstrap/,Lt=/^ready/;function ct(e){var t=e.pluginName,r=e.method+"Aborted"+(t?":"+t:"");e.store.dispatch(v({},e.data,{type:r,_:{called:r,from:"abort"}}))}function Mt(e,t,r){var n=t[e]||r[e];return n&&n.config?n.config:{}}function $t(e,t){return t.reduce(function(r,n){return n[e]?r.concat({methodName:e,pluginName:n.name,method:n[e]}):r},[])}function Ut(e,t){var r=e.replace(xe,""),n=t?":"+t:"";return[""+e+n,""+r+n,r+"End"+n]}function st(e,t){var r=e.abort;return!!r&&(r===!0||Rt(r,t)||r&&Rt(r.plugins,t))}function Ct(e,t){var r=e.abort;if(!r)return!1;if(r===!0||ve(r))return!0;var n=r.plugins;return Te(r)&&r.length===t||Te(n)&&n.length===t}function Te(e){return Array.isArray(e)}function Rt(e,t){return!(!e||!Te(e))&&e.includes(t)}function qt(e){var t=e.match(/(.*):(.*)/);return!!t&&{method:t[1],name:t[2]}}function Jr(e){return Object.keys(e).reduce(function(t,r){return r==="type"||(t[r]=F(e[r])?Object.assign({},e[r]):e[r]),t},{})}function Fr(e,t,r){var n={};return function(i){return function(a){return function(o){try{var s,p=function(l){return s?l:a(d)},g=o.type,x=o.plugins,d=o;if(o.abort)return Promise.resolve(a(o));if(g===m.enablePlugin&&i.dispatch({type:m.initializeStart,plugins:x,disabled:[],fromEnable:!0,meta:o.meta}),g===m.disablePlugin&&setTimeout(function(){return zt(o.meta.rid,{payload:o})},0),g===m.initializeEnd){var N=t(),h=Object.keys(N),T=h.filter(function(l){return x.includes(l)}).map(function(l){return N[l]}),I=[],y=[],E=o.disabled,j=T.map(function(l){var b=l.name;return Tt(l,l.loaded,1e4).then(function(M){return n[b]||(i.dispatch({type:m.pluginReadyType(b),name:b,events:Object.keys(l).filter(function(D){return!at.includes(D)})}),n[b]=!0),I=I.concat(b),l}).catch(function(M){if(M instanceof Error)throw new Error(M);return y=y.concat(M.name),M})});Promise.all(j).then(function(l){var b={plugins:I,failed:y,disabled:E};setTimeout(function(){h.length===j.length+E.length&&i.dispatch(v({},{type:m.ready},b))},0)})}var A=function(){if(g!==m.bootstrap)return/^ready:([^:]*)$/.test(g)&&setTimeout(function(){return At(i,t,e)},0),Promise.resolve(function(l,b,M,D,L){try{var B=Q(b)?b():b,$=l.type,H=$.replace(xe,"");if(l._&&l._.called)return Promise.resolve(l);var R=M.getState(),G=(X=B,(J=R.plugins)===void 0&&(J={}),(c=l.options)===void 0&&(c={}),Object.keys(X).filter(function(u){var f=c.plugins||{};return kr(f[u])?f[u]:f.all!==!1&&(!J[u]||J[u].enabled!==!1)}).map(function(u){return X[u]}));$===m.initializeStart&&l.fromEnable&&(G=Object.keys(R.plugins).filter(function(u){var f=R.plugins[u];return l.plugins.includes(u)&&!f.initialized}).map(function(u){return B[u]}));var P=G.map(function(u){return u.name}),z=function(u,f,S){var O=Ut(u).map(function(w){return $t(w,f)});return f.reduce(function(w,q){var k=q.name,U=Ut(u,k).map(function(ke){return $t(ke,f)}),_=U[0],Y=U[1],Ee=U[2];return _.length&&(w.beforeNS[k]=_),Y.length&&(w.duringNS[k]=Y),Ee.length&&(w.afterNS[k]=Ee),w},{before:O[0],beforeNS:{},during:O[1],duringNS:{},after:O[2],afterNS:{}})}($,G);return Promise.resolve(ut({action:l,data:{exact:z.before,namespaced:z.beforeNS},state:R,allPlugins:B,allMatches:z,instance:M,store:D,EVENTS:L})).then(function(u){function f(){var w=function(){if($.match(xe))return Promise.resolve(ut({action:v({},S,{type:H+"End"}),data:{exact:z.after,namespaced:z.afterNS},state:R,allPlugins:B,allMatches:z,instance:M,store:D,EVENTS:L})).then(function(q){q.meta&&q.meta.hasCallback&&zt(q.meta.rid,{payload:q})})}();return w&&w.then?w.then(function(){return u}):u}if(Ct(u,P.length))return u;var S,O=function(){if($!==H)return Promise.resolve(ut({action:v({},u,{type:H}),data:{exact:z.during,namespaced:z.duringNS},state:R,allPlugins:B,allMatches:z,instance:M,store:D,EVENTS:L})).then(function(w){S=w});S=u}();return O&&O.then?O.then(f):f()})}catch(u){return Promise.reject(u)}var X,J,c}(o,t,e,i,r)).then(function(l){var b=a(l);return s=1,b})}();return Promise.resolve(A&&A.then?A.then(p):p(A))}catch(l){return Promise.reject(l)}}}}}function Hr(e){return function(t){return function(r){return function(n){var i=n.type,a=n.key,o=n.value,s=n.options;if(i===m.setItem||i===m.removeItem){if(n.abort)return r(n);i===m.setItem?e.setItem(a,o,s):e.removeItem(a,s)}return r(n)}}}}var Gr=function(){var e=this;this.before=[],this.after=[],this.addMiddleware=function(t,r){e[r]=e[r].concat(t)},this.removeMiddleware=function(t,r){var n=e[r].findIndex(function(i){return i===t});n!==-1&&(e[r]=[].concat(e[r].slice(0,n),e[r].slice(n+1)))},this.dynamicMiddlewares=function(t){return function(r){return function(n){return function(i){var a={getState:r.getState,dispatch:function(s){return r.dispatch(s)}},o=e[t].map(function(s){return s(a)});return Ie.apply(void 0,o)(n)(i)}}}}};function Wr(e){return function(t,r){t===void 0&&(t={});var n={};if(r.type==="initialize:aborted")return t;if(/^registerPlugin:([^:]*)$/.test(r.type)){var i=Bt(r.type,"registerPlugin"),a=e()[i];if(!a||!i)return t;var o=r.enabled;return n[i]={enabled:o,initialized:!!o&&Boolean(!a.initialize),loaded:!!o&&Boolean(a.loaded()),config:a.config||{}},v({},t,n)}if(/^initialize:([^:]*)$/.test(r.type)){var s=Bt(r.type,m.initialize),p=e()[s];return p&&s?(n[s]=v({},t[s],{initialized:!0,loaded:Boolean(p.loaded())}),v({},t,n)):t}if(/^ready:([^:]*)$/.test(r.type))return n[r.name]=v({},t[r.name],{loaded:!0}),v({},t,n);switch(r.type){case m.disablePlugin:return v({},t,Vt(r.plugins,!1,t));case m.enablePlugin:return v({},t,Vt(r.plugins,!0,t));default:return t}}}function Bt(e,t){return e.substring(t.length+1,e.length)}function Vt(e,t,r){return e.reduce(function(n,i){return n[i]=v({},r[i],{enabled:t}),n},r)}function Jt(e){try{return JSON.parse(JSON.stringify(e))}catch(t){}return e}var Xr={last:{},history:[]};function Qr(e,t){e===void 0&&(e=Xr);var r=t.options,n=t.meta;if(t.type===m.track){var i=Jt(v({event:t.event,properties:t.properties},Object.keys(r).length&&{options:r},{meta:n}));return v({},e,{last:i,history:e.history.concat(i)})}return e}var Kr={actions:[]};function Yr(e,t){e===void 0&&(e=Kr);var r=t.payload;switch(t.type){case"queue":var n;return n=r&&r.type&&r.type===m.identify?[t].concat(e.actions):e.actions.concat(t),v({},e,{actions:n});case"dequeue":return[];default:return e}}var Ft=/#.*$/;function Zr(e){var t=/(http[s]?:\/\/)?([^\/\s]+\/)(.*)/g.exec(e);return"/"+(t&&t[3]?t[3].split("?")[0].replace(Ft,""):"")}var Ht,Gt,Wt,Xt,en=function(e){if(e===void 0&&(e={}),!C)return e;var t=document,r=t.title,n=t.referrer,i=window,a=i.location,o=i.innerWidth,s=i.innerHeight,p=a.hash,g=a.search,x=function(N){var h=function(){if(C){for(var T,I=document.getElementsByTagName("link"),y=0;T=I[y];y++)if(T.getAttribute("rel")==="canonical")return T.getAttribute("href")}}();return h?h.match(/\?/)?h:h+N:window.location.href.replace(Ft,"")}(g),d={title:r,url:x,path:Zr(x),hash:p,search:g,width:o,height:s};return n&&n!==""&&(d.referrer=n),v({},d,e)},tn={last:{},history:[]};function rn(e,t){e===void 0&&(e=tn);var r=t.options;if(t.type===m.page){var n=Jt(v({properties:t.properties,meta:t.meta},Object.keys(r).length&&{options:r}));return v({},e,{last:n,history:e.history.concat(n)})}return e}Ht=function(){if(!C)return!1;var e=navigator.appVersion;return~e.indexOf("Win")?"Windows":~e.indexOf("Mac")?"MacOS":~e.indexOf("X11")?"UNIX":~e.indexOf("Linux")?"Linux":"Unknown OS"}(),Gt=C?document.referrer:null,Wt=Dr(),Xt=Lr();var Qt={initialized:!1,sessionId:He(),app:null,version:null,debug:!1,offline:!!C&&!navigator.onLine,os:{name:Ht},userAgent:C?navigator.userAgent:"node",library:{name:"analytics",version:"0.11.0"},timezone:Xt,locale:Wt,campaign:{},referrer:Gt};function nn(e,t){e===void 0&&(e=Qt);var r=e.initialized,n=t.campaign;switch(t.type){case m.campaign:return v({},e,{campaign:n});case m.offline:return v({},e,{offline:!0});case m.online:return v({},e,{offline:!1});default:return r?e:v({},Qt,e,{initialized:!0})}}var an=["plugins","reducers","storage"];function on(e,t,r){if(C){var n=window[(r?"add":"remove")+"EventListener"];e.split(" ").forEach(function(i){n(i,t)})}}function un(e){var t=on.bind(null,"online offline",function(r){return Promise.resolve(!navigator.onLine).then(e)});return t(!0),function(r){return t(!1)}}function Kt(){return se("analytics",[]),function(e){return function(t,r,n){var i=e(t,r,n),a=i.dispatch;return Object.assign(i,{dispatch:function(o){return ye[he].analytics.push(o.action||o),a(o)}})}}}function Yt(e){return function(){return Ie(Ie.apply(null,arguments),Kt())}}function lt(e){return e?Nr(e)?e:[e]:[]}function Zt(e,t,r){e===void 0&&(e={});var n,i,a=He();return t&&(ze[a]=(n=t,i=function(o){for(var s,p=o||Array.prototype.slice.call(arguments),g=0;g<p.length;g++)if(Q(p[g])){s=p[g];break}return s}(r),function(o){i&&i(o),n(o)})),v({},e,{rid:a,ts:new Date().getTime()},t?{hasCallback:!0}:{})}function cn(e){e===void 0&&(e={});var t=e.reducers||{},r=e.initialUser||{},n=(e.plugins||[]).reduce(function(c,u){if(Q(u))return c.middlewares=c.middlewares.concat(u),c;if(u.NAMESPACE&&(u.name=u.NAMESPACE),!u.name)throw new Error("https://lytics.dev/errors/1");var f=u.EVENTS?Object.keys(u.EVENTS).map(function(w){return u.EVENTS[w]}):[];c.pluginEnabled[u.name]=!(u.enabled===!1||u.config&&u.config.enabled===!1),delete u.enabled,u.methods&&(c.methods[u.name]=Object.keys(u.methods).reduce(function(w,q){var k;return w[q]=(k=u.methods[q],function(){for(var U=Array.prototype.slice.call(arguments),_=new Array(k.length),Y=0;Y<U.length;Y++)_[Y]=U[Y];return _[_.length]=l,k.apply({instance:l},_)}),w},{}),delete u.methods);var S=Object.keys(u).concat(f),O=new Set(c.events.concat(S));if(c.events=Array.from(O),c.pluginsArray=c.pluginsArray.concat(u),c.plugins[u.name])throw new Error(u.name+"AlreadyLoaded");return c.plugins[u.name]=u,c.plugins[u.name].loaded||(c.plugins[u.name].loaded=function(){return!0}),c},{plugins:{},pluginEnabled:{},methods:{},pluginsArray:[],middlewares:[],events:[]}),i=e.storage?e.storage:{getItem:ce,setItem:se,removeItem:be},a=function(c){return function(u,f,S){return f.getState("user")[u]||(S&&F(S)&&S[u]?S[u]:jt(c)[u]||ce(ot(u))||null)}}(i),o=n.plugins,s=n.events.filter(function(c){return!at.includes(c)}).sort(),p=new Set(s.concat(Xe).filter(function(c){return!at.includes(c)})),g=Array.from(p).sort(),x=function(){return o},d=new Gr,N=d.addMiddleware,h=d.removeMiddleware,T=d.dynamicMiddlewares,I=function(){throw new Error("Abort disabled inListener")},y=Mr(),E=jt(i),j=v({},E,r,y.an_uid?{userId:y.an_uid}:{},y.an_aid?{anonymousId:y.an_aid}:{});j.anonymousId||(j.anonymousId=He());var A=v({enable:function(c,u){return new Promise(function(f){P.dispatch({type:m.enablePlugin,plugins:lt(c),_:{originalAction:m.enablePlugin}},f,[u])})},disable:function(c,u){return new Promise(function(f){P.dispatch({type:m.disablePlugin,plugins:lt(c),_:{originalAction:m.disablePlugin}},f,[u])})}},n.methods),l={identify:function(c,u,f,S){try{var O=ve(c)?c:null,w=F(c)?c:u,q=f||{},k=l.user();se(ot(oe),O);var U=O||w.userId||a(oe,l,w);return Promise.resolve(new Promise(function(_){P.dispatch(v({type:m.identifyStart,userId:U,traits:w||{},options:q,anonymousId:k.anonymousId},k.id&&k.id!==O&&{previousId:k.id}),_,[u,f,S])}))}catch(_){return Promise.reject(_)}},track:function(c,u,f,S){try{var O=F(c)?c.event:c;if(!O||!ve(O))throw new Error("EventMissing");var w=F(c)?c:u||{},q=F(f)?f:{};return Promise.resolve(new Promise(function(k){P.dispatch({type:m.trackStart,event:O,properties:w,options:q,userId:a(oe,l,u),anonymousId:a(Se,l,u)},k,[u,f,S])}))}catch(k){return Promise.reject(k)}},page:function(c,u,f){try{var S=F(c)?c:{},O=F(u)?u:{};return Promise.resolve(new Promise(function(w){P.dispatch({type:m.pageStart,properties:en(S),options:O,userId:a(oe,l,S),anonymousId:a(Se,l,S)},w,[c,u,f])}))}catch(w){return Promise.reject(w)}},user:function(c){if(c===oe||c==="id")return a(oe,l);if(c===Se||c==="anonId")return a(Se,l);var u=l.getState("user");return c?Re(u,c):u},reset:function(c){return new Promise(function(u){P.dispatch({type:m.resetStart},u,c)})},ready:function(c){return l.on(m.ready,c)},on:function(c,u){if(!c||!Q(u))return!1;if(c===m.bootstrap)throw new Error(".on disabled for "+c);var f=/Start$|Start:/;if(c==="*"){var S=function(k){return function(U){return function(_){return _.type.match(f)&&u({payload:_,instance:l,plugins:o}),U(_)}}},O=function(k){return function(U){return function(_){return _.type.match(f)||u({payload:_,instance:l,plugins:o}),U(_)}}};return N(S,Qe),N(O,Ke),function(){h(S,Qe),h(O,Ke)}}var w=c.match(f)?Qe:Ke,q=function(k){return function(U){return function(_){return _.type===c&&u({payload:_,instance:l,plugins:o,abort:I}),U(_)}}};return N(q,w),function(){return h(q,w)}},once:function(c,u){if(!c||!Q(u))return!1;if(c===m.bootstrap)throw new Error(".once disabled for "+c);var f=l.on(c,function(S){u({payload:S.payload,instance:l,plugins:o,abort:I}),f()});return f},getState:function(c){var u=P.getState();return c?Re(u,c):Object.assign({},u)},dispatch:function(c){var u=ve(c)?{type:c}:c;if(Xe.includes(u.type))throw new Error("reserved action "+u.type);var f=v({},u,{_:v({originalAction:u.type},c._||{})});P.dispatch(f)},enablePlugin:A.enable,disablePlugin:A.disable,plugins:A,storage:{getItem:i.getItem,setItem:function(c,u,f){P.dispatch({type:m.setItemStart,key:c,value:u,options:f})},removeItem:function(c,u){P.dispatch({type:m.removeItemStart,key:c,options:u})}},setAnonymousId:function(c,u){l.storage.setItem(ae,c,u)},events:{core:Xe,plugins:s}},b=n.middlewares.concat([function(c){return function(u){return function(f){return f.meta||(f.meta=Zt()),u(f)}}},T(Qe),Fr(l,x,{all:g,plugins:s}),Hr(i),qr(l),Vr(l),T(Ke)]),M={context:nn,user:Br(i),page:rn,track:Qr,plugins:Wr(x),queue:Yr},D=Ie,L=Ie;if(C&&e.debug){var B=window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__;B&&(D=B({trace:!0,traceLimit:25})),L=function(){return arguments.length===0?Kt():F(typeof arguments[0])?Yt():Yt().apply(null,arguments)}}var $,H=function(c){return Object.keys(c).reduce(function(u,f){return an.includes(f)||(u[f]=c[f]),u},{})}(e),R=n.pluginsArray.reduce(function(c,u){var f=u.name,S=u.config,O=u.loaded,w=n.pluginEnabled[f];return c[f]={enabled:w,initialized:!!w&&Boolean(!u.initialize),loaded:Boolean(O()),config:S||{}},c},{}),G={context:H,user:j,plugins:R},P=Et(function(c){for(var u=Object.keys(c),f={},S=0;S<u.length;S++){var O=u[S];typeof c[O]===ie&&(f[O]=c[O])}var w,q=Object.keys(f);try{(function(k){Object.keys(k).forEach(function(U){var _=k[U];if(typeof _(void 0,{type:"@@redux/INIT"})===re||typeof _(void 0,{type:Ur})===re)throw new Error("reducer "+U+" "+re)})})(f)}catch(k){w=k}return function(k,U){if(k===void 0&&(k={}),w)throw w;for(var _=!1,Y={},Ee=0;Ee<q.length;Ee++){var ke=q[Ee],Sr=k[ke],It=(0,f[ke])(Sr,U);if(typeof It===re){var Vn=Cr(ke,U);throw new Error(Vn)}Y[ke]=It,_=_||It!==Sr}return _?Y:k}}(v({},M,t)),G,L(D(Rr.apply(void 0,b))));P.dispatch=($=P.dispatch,function(c,u,f){var S=v({},c,{meta:Zt(c.meta,u,lt(f))});return $.apply(null,[S])});var z=Object.keys(o);P.dispatch({type:m.bootstrap,plugins:z,config:H,params:y,user:j,initialUser:r,persistedUser:E});var X=z.filter(function(c){return n.pluginEnabled[c]}),J=z.filter(function(c){return!n.pluginEnabled[c]});return P.dispatch({type:m.registerPlugins,plugins:z,enabled:n.pluginEnabled}),n.pluginsArray.map(function(c,u){var f=c.bootstrap,S=c.config,O=c.name;f&&Q(f)&&f({instance:l,config:S,payload:c}),P.dispatch({type:m.registerPluginType(O),name:O,enabled:n.pluginEnabled[O],plugin:c}),n.pluginsArray.length===u+1&&P.dispatch({type:m.initializeStart,plugins:X,disabled:J})}),un(function(c){P.dispatch({type:c?m.offline:m.online})}),function(c,u,f){setInterval(function(){return At(c,u,f)},3e3)}(P,x,l),l}var Qe="before",Ke="after",Ae="cookie",fe=rr(),er=Ye,sn=Ye;function tr(e){return fe?Ye(e,"",-1):be(e)}function rr(){if(fe!==void 0)return fe;var e="cookiecookie";try{Ye(e,e),fe=document.cookie.indexOf(e)!==-1,tr(e)}catch(t){fe=!1}return fe}function Ye(e,t,r,n,i,a){if(typeof window!="undefined"){var o=arguments.length>1;return fe===!1&&(o?se(e,t):ce(e)),o?document.cookie=e+"="+encodeURIComponent(t)+(r?"; expires="+new Date(+new Date+1e3*r).toUTCString()+(n?"; path="+n:"")+(i?"; domain="+i:"")+(a?"; secure":""):""):decodeURIComponent((("; "+document.cookie).split("; "+e+"=")[1]||"").split(";")[0])}}var De="localStorage",ln=it.bind(null,"localStorage");we("localStorage","getItem",ce),we("localStorage","setItem",se),we("localStorage","removeItem",be);var Le="sessionStorage",fn=it.bind(null,"sessionStorage");we("sessionStorage","getItem",ce),we("sessionStorage","setItem",se),we("sessionStorage","removeItem",be);function Oe(e){var t=e;try{if((t=JSON.parse(e))==="true")return!0;if(t==="false")return!1;if(F(t))return t;parseFloat(t)===t&&(t=parseFloat(t))}catch(r){}if(t!==null&&t!=="")return t}var dn=ln(),pn=fn(),gn=rr();function nr(e,t){if(e){var r=ft(t),n=!vt(r),i=dt(r)?Oe(localStorage.getItem(e)):void 0;if(n&&!me(i))return i;var a=pt(r)?Oe(er(e)):void 0;if(n&&a)return a;var o=gt(r)?Oe(sessionStorage.getItem(e)):void 0;if(n&&o)return o;var s=ce(e);return n?s:{localStorage:i,sessionStorage:o,cookie:a,global:s}}}function vn(e,t,r){if(e&&!me(t)){var n={},i=ft(r),a=JSON.stringify(t),o=!vt(i);return dt(i)&&(n[De]=et(De,t,Oe(localStorage.getItem(e))),localStorage.setItem(e,a),o)?n[De]:pt(i)&&(n[Ae]=et(Ae,t,Oe(er(e))),sn(e,a),o)?n[Ae]:gt(i)&&(n[Le]=et(Le,t,Oe(sessionStorage.getItem(e))),sessionStorage.setItem(e,a),o)?n[Le]:(n[je]=et(je,t,ce(e)),se(e,t),o?n[je]:n)}}function mn(e,t){if(e){var r=ft(t),n=nr(e,Be),i={};return!me(n.localStorage)&&dt(r)&&(localStorage.removeItem(e),i[De]=n.localStorage),!me(n.cookie)&&pt(r)&&(tr(e),i[Ae]=n.cookie),!me(n.sessionStorage)&&gt(r)&&(sessionStorage.removeItem(e),i[Le]=n.sessionStorage),!me(n.global)&&Ze(r,je)&&(be(e),i[je]=n.global),i}}function ft(e){return e?ve(e)?e:e.storage:_e}function dt(e){return dn&&Ze(e,De)}function pt(e){return gn&&Ze(e,Ae)}function gt(e){return pn&&Ze(e,Le)}function vt(e){return e===Be||e==="all"}function Ze(e,t){return e===_e||e===t||vt(e)}function et(e,t,r){return{location:e,current:t,previous:r}}var hn={setItem:vn,getItem:nr,removeItem:mn};function yn(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ir(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function ar(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ir(Object(r),!0).forEach(function(n){yn(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ir(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function or(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t={storage:hn};return cn(ar(ar({},t),e))}function bn(e,t,r,n,i,a,o){e.fbq||(i=e.fbq=function(){i.callMethod?i.callMethod.apply(i,arguments):i.queue.push(arguments)},e._fbq||(e._fbq=i),i.push=i,i.loaded=!0,i.version="2.0",i.queue=[],a=t.createElement(r),a.async=!0,a.src=n,o=t.getElementsByTagName(r)[0],o.parentNode.insertBefore(a,o))}function wn({trackingId:e}){bn(window,document,"script","https://connect.facebook.net/en_US/fbevents.js"),window.fbq("init",e)}function In(e={}){return{name:"facebook",config:e,initialize:function({config:t,instance:r}){if(!t.trackingId)throw new Error("No Facebook trackingId defined");wn({trackingId:t.trackingId})},page:function({payload:t,config:r,instance:n}){window.fbq("track","PageView")},track:function({payload:t,config:r,instance:n}){window.fbq("track",t.event,t.properties)},identify:function({payload:t,config:r}){},loaded:function(){return!!window.fbq}}}function Me(){window.dataLayer.push(arguments)}window.gtag=Me;function Pn({trackingId:e,configParams:t={},setParams:r={}}){var n="ga-gtag";if(!document.getElementById(n)){var i=document.head,a=document.createElement("script");a.id=n,a.type="text/javascript",a.async=!0,a.src="https://www.googletagmanager.com/gtag/js?id="+e,i.insertBefore(a,i.firstChild),window.dataLayer=window.dataLayer||[],Me("js",new Date),r&&Me("set",r),Me("config",e,t)}}function Sn(e={}){return{name:"google-analytics-4",config:e,initialize:function({config:t,instance:r}){if(!t.trackingId)throw new Error("No GA trackingId defined");var n={},i={};if(t.customDimensions){for(var a={},o=0;o<t.customDimensions.length;o++){var s=t.customDimensions[o];n[s.name]=s.callback(r,t),a["dimension"+(o+1)]=s.name}i.custom_map=a}Pn({trackingId:t.trackingId,configParams:n,setParams:i})},page:function({payload:t,config:r,instance:n}){},track:function({payload:t,config:r,instance:n}){Me("event",t.event,t.properties)},identify:function({payload:t,config:r}){},loaded:function(){return!!window.gtag}}}var xn=new URLSearchParams(window.location.search),On=xn.get("zdbg"),ur={};const tt="undefined";function K(){On==1&&console.debug(...arguments)}function V(e){console.warn(e),window.Rollbar&&window.Rollbar.warning(e)}function En(e){return e&&(Object.prototype.toString.call(e)==="[object Function]"||typeof e=="function"||e instanceof Function)}function cr(){try{var e=navigator.userAgent||"",t=new RegExp([/bot/,/spider/,/crawl/,/mediapartners/,/Google-Read-Aloud/,/semrush/].map(r=>r.source).join("|"),"i");return t.test(e)}catch(r){return!1}}function kn(e){document.readyState==="complete"||document.readyState==="loaded"||document.readyState==="interactive"?e():window.addEventListener("DOMContentLoaded",e)}var de=_n();function _n(){if(typeof de!==tt)return de;de=!0;try{sessionStorage.setItem(tt,tt),sessionStorage.removeItem(tt)}catch(e){de=!1}return de}function sr(e){var t,r=ur[e];return de?(t=sessionStorage.getItem(e),!t&&r&&(t=r,sessionStorage.setItem(e,t))):t=r,t?JSON.parse(t):void 0}function Nn(e,t){var r=JSON.stringify(t);de&&sessionStorage.setItem(e,r),ur[e]=r}function jn(){var e=document.createElement("div");e.innerHTML="&nbsp;",e.className="pub_300x250 pub_300x250m pub_728x90 text-ad textAd text_ad text_ads text-ads text-ad-links",e.setAttribute("style","width: 1px !important; height: 1px !important; position: absolute !important; left: -10000px !important; top: -1000px !important;");try{if(document.body.appendChild(e),document.body.getAttribute("abp")!==null||e.offsetHeight===0||e.clientHeight===0)return!0;if(typeof getComputedStyle!="undefined"){var t=window.getComputedStyle(e,null);if(t&&(t.getPropertyValue("display")==="none"||t.getPropertyValue("visibility")==="hidden"))return!0}document.body.removeChild(e)}catch(r){}return!1}function lr({method:e,url:t,data:r,json:n=!0}){return new Promise(function(i,a){var o=new XMLHttpRequest;o.open(e,t),o.withCredentials=!0,n&&(o.setRequestHeader("Accept","application/json"),o.setRequestHeader("Content-Type","application/json")),o.onload=function(){this.status>=200&&this.status<300?i(n?JSON.parse(o.response):o.response):a({status:this.status,message:o.statusText})},o.onerror=function(){a({status:this.status,message:"Network Error"})},r?o.send(r):o.send()})}function zn(e){return"?"+Object.keys(e).map(function(t){return t+"="+encodeURIComponent(e[t])}).join("&")}function Tn(r){return Z(this,arguments,function*({url:e,data:t}){if(window&&window.navigator&&typeof window.navigator.sendBeacon=="function"&&typeof window.Blob=="function")try{const n=new Blob([JSON.stringify(t)],{type:"text/plain; charset=UTF-8"});return!!window.navigator.sendBeacon(e,n)}catch(n){return V("postBeacon:"),!1}return!1})}function An(n){return Z(this,arguments,function*({url:e,params:t=null,json:r=!0}){var i=e;return t&&(i=i+zn(t)),yield lr({method:"GET",url:i,json:r})})}function rt(i){return Z(this,arguments,function*({url:e,data:t,json:r=!0,beacon:n=!1}){var a=t;if(r&&(a=JSON.stringify(a)),n){var o=yield Tn({url:e,data:t});if(o)return;K("Beacon failed")}return yield lr({method:"POST",url:e,data:a,json:r})})}var nt="__zar_vid",fr="success",$e="error",Dn=30*1e3,dr=0,Ln=3,W={};window.zarPoolData=window.zarPoolData||null,window.zarPoolDLObserverDone=window.zarPoolDLObserverDone||!1,window.zarPoolDataLayer=window.zarPoolDataLayer||[];var pe=new Map;function Mn(){return Date.now().toString(36)+"."+Math.random().toString(36).substring(2)}function $n(e,t,r,n){var i,a=!1,o=null,s=r(e);!s||!s.id?(i=t(),o=document.referrer,a=!0,K("new ID for",e,"-",i)):(i=s.id,o=s.origReferrer);var p={id:i,t:Date.now(),origReferrer:o,isNew:a};return n(e,p),p}function pr(){var e=$n(nt,Mn,sr,Nn);return{vid:e}}function gr(){return window.location.protocol+"://"+window.location.host+"/api/v2"}function vr(e){return sr(e)}function mr(e){var t=vr(e);return t?t.id:null}function Ue(){return{vid:vr(nt)}}function Un(){return{vid:mr(nt)}}function hr({elem:e}){var t=null,r=null,n=null,i=new RegExp("\\+?\\(?\\d*\\)? ?\\(?\\d+\\)?\\d*([\\s./-]?\\d{2,})+","g");e.href&&e.href.startsWith("tel:")&&(n=e.href);var a=e.innerText,o=e.innerHTML,s=i.exec(a);return s&&(t=s[0].trim(),r=t.replace("+","").replace(/-/g,"").replace(/ /g,"").replace("(","").replace(")","").replace(/^1/,"")),{text:a,html:o,numberText:t,href:n,number:r}}function mt({elems:e,number:t,force:r=!1}){var n,i=t;t.startsWith("+1")||(i="+1"+t);for(var a=0;a<e.length;a++){if(pe.has(e[a]))if(r)n=pe.get(e[a]);else{K("element already in overlay map:",e[a]);continue}var o=hr({elem:e[a]});if(n?!r&&o.number&&n.number&&n.number!==o.number&&V("overlaying multiple numbers with a single number",n.number,o.number):n=o,K("overlaying",i,"on",e[a]),pe.has(e[a])||pe.set(e[a],o),o.href&&(e[a].href="tel:"+i),o.numberText)if(e[a].innerHTML="",o.text){var s=i;if(o.numberText.indexOf("-")>-1&&(s=i.slice(2,5)+"-"+i.slice(5,8)+"-"+i.slice(8,12)),o.html.indexOf("<img")>-1){var p=o.html.replace(o.numberText,s);e[a].innerHTML=p}else{var g=o.text.replace(o.numberText,s);e[a].appendChild(document.createTextNode(g))}}else e[a].appendChild(document.createTextNode(i));else K("no number text found:",e[a])}}function ht({elems:e}){for(var t=0;t<e.length;t++)if(pe.has(e[t])){var r=e[t].innerHTML,n=pe.get(e[t]);K("orig:",n);var i=n.html;K("reverting",r,"to",i),e[t].innerHTML=i,n.href&&(e[t].href=n.href),pe.delete(e[t])}else K("element not in map:",e[t])}function yr(e){clearInterval(W[e]),delete W[e]}function br(){for(var e in W)yr(e)}function wr(i){return Z(this,arguments,function*({poolId:e,apiUrl:t,number:r=null,context:n=null}){var a={pool_id:e,number:r,context:n,properties:{zar:Ue()}},o=yield rt({url:`${t}/number_pool`,data:a});return o})}function yt(){return window.zarPoolData&&window.zarPoolData.status===fr&&window.zarPoolData.number}function Ce(){if(!window.zarPoolDataLayer||!Array.isArray(window.zarPoolDataLayer))return{};for(var e={},t=0;t<window.zarPoolDataLayer.length;t++){var r=window.zarPoolDataLayer[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return window.zarPoolDataLayer.length=0,e}function bt(i){return Z(this,arguments,function*({apiUrl:e,poolId:t,number:r,context:n}){if(!yt()){V("no valid pool data, not updating context");return}var a={pool_id:t,number:r,context:n,properties:{zar:Ue()}},o=yield rt({url:`${e}/update_number`,data:a});return o})}function Cn(n){return Z(this,arguments,function*({apiUrl:e,key:t=null,with_contexts:r=!1}){var i={key:t,with_contexts:r},a=yield An({url:`${e}/number_pool_stats`,params:i});return a})}function Rn(){return Z(this,arguments,function*({overlayElements:e,apiUrl:t=gr(),contextCallback:r=null}={}){var n=Ce()||{};r&&(n=r(n)||{});const i=window.zarPoolData.pool_id,a=window.zarPoolData.number;try{var o=yield wr({poolId:i,apiUrl:t,number:a,context:n})}catch(g){var s="error getting number: "+JSON.stringify(g);return V(s),dr++,dr>=Ln&&(V("max failures, stopping pool"),br(),e&&ht({elems:e})),{status:$e,msg:s}}if(o.status===fr&&o.number){var p=!1;o.number!==window.zarPoolData.number&&(V("number changed from "+window.zarPoolData.number+" to "+o.number),window.zarPoolData.number=o.number,p=!0),e&&mt({elems:e,number:o.number,force:p})}else e&&ht({elems:e}),W[i]&&(clearInterval(W[i]),delete W[i]);return o})}function wt(e){return En(e)?e():e}function qn(e){if(!window.zarPoolDLObserverDone&&!!yt()){var t=window.zarPoolDataLayer.push;window.zarPoolDataLayer.push=function(...n){var i=t.apply(this,n),a=Ce();return a&&bt({apiUrl:e,poolId:window.zarPoolData.pool_id,number:window.zarPoolData.number,context:a}),i};var r=Ce();r&&bt({apiUrl:e,poolId:window.zarPoolData.pool_id,number:window.zarPoolData.number,context:r}),window.zarPoolDLObserverDone=!0}}function Ir(){return Z(this,arguments,function*({poolData:e,poolConfig:t,apiUrl:r}={}){var n;if(!t||!t.poolId||!t.overlayQuerySelector||!r)return n="missing pool config: "+JSON.stringify(t),V(n),t.initCallback&&t.initCallback({status:$e,msg:n}),W;var i=Ce()||{};t.contextCallback&&(i=t.contextCallback(i)||{});var a=wt(t.poolId);if(!a)return n="no pool ID",V(n),t.initCallback&&t.initCallback({status:$e,msg:n}),W;if(!e)try{e=yield wr({poolId:a,apiUrl:r,number:null,context:i})}catch(o){return n="error getting number on init: "+JSON.stringify(o),V(n),t.initCallback&&t.initCallback({status:$e,msg:n}),W}if(window.zarPoolData=e,yt()){try{qn(r)}catch(o){V("data layer observer error: "+JSON.stringify(o))}kn(function(){var o=document.querySelectorAll(t.overlayQuerySelector);if(!o){var s="No elems found for:"+t.overlayQuerySelector;V(s),t.initCallback&&t.initCallback({status:$e,msg:s});return}mt({elems:o,number:e.number});var p=setInterval(function(){try{Rn({overlayElements:o,apiUrl:r,contextCallback:t.contextCallback})}catch(x){var g="error on interval: "+JSON.stringify(x);V(g)}},t.renewalInterval||Dn);W[e.pool_id]=p,t.initCallback&&t.initCallback(e)})}return W})}function Pr({apiUrl:e,poolConfig:t}){return pr(),{name:"zar",config:{apiUrl:e,poolConfig:t},initialize:function({config:r}){},loaded:function(){return!0},pageStart:function({payload:r,config:n,instance:i}){r.properties.zar=Ue(),r.properties.referrer=document.referrer,r.properties.is_bot=cr(),"hash"in r.properties&&delete r.properties.hash,"path"in r.properties&&delete r.properties.path,"search"in r.properties&&delete r.properties.search;try{var a=n.poolConfig;if(a&&a.poolId){r.properties.pool_id=wt(a.poolId);var o=Ce()||{};a.contextCallback&&(r.properties.pool_context=a.contextCallback(o)||{})}}catch(s){V("error getting pool id: "+JSON.stringify(s))}return r},page:function(o){return Z(this,arguments,function*({payload:r,options:n,instance:i,config:a}){K("page",r,n,a);for(var s=0,p=3,g;s<p;)try{g=yield rt({url:`${a.apiUrl}/page`,data:r});break}catch(x){if(s++,s>=p)throw V("error posting page: "+JSON.stringify(x)),x;yield new Promise(d=>setTimeout(d,1e3))}g&&g.pool_data&&Ir({poolData:g.pool_data,poolConfig:a.poolConfig,apiUrl:a.apiUrl})})},trackStart:function({payload:r,config:n,instance:i}){return r.properties.zar=Ue(),r.properties.url=window.location.href,r.properties.referrer=document.referrer,r},track:function({payload:r,options:n,instance:i,config:a}){K("track",r),rt({url:`${a.apiUrl}/track`,data:r,beacon:!0})},methods:{apiUrl(){return e},poolConfig(){return t},initIDs(){return pr()},getIDs(){return Un()},getStorage(){return Ue()},getVID(){return mr(nt)},hasAdBlock(){return jn()},isBot(){return cr()},initTrackingPool({poolConfig:r}){var n=this.instance.plugins.zar;return Ir({poolData:null,poolConfig:Object.assign(n.poolConfig(),r||{}),apiUrl:n.apiUrl()})},updateTrackingNumberContext({number:r,context:n}){var i=this.instance.plugins.zar,a=i.poolConfig();return bt({apiUrl:this.instance.plugins.zar.apiUrl(),poolId:wt(a.poolId),number:r,context:n})},getPoolIntervals(){return W},clearPoolInterval({poolId:r}){yr(r)},clearPoolIntervals(){br()},extractPhoneNumbers({elems:r}){for(var n=[],i=0;i<r.length;i++){var a=hr({elem:r[i]});n.push(a)}return n},overlayPhoneNumber({overlayElements:r,number:n}){mt({elems:r,number:n})},revertOverlayNumbers({overlayElements:r}){ht({elems:r})},getPoolStats({key:r=null,with_contexts:n=!1}){return Cn({apiUrl:this.instance.plugins.zar.apiUrl(),key:r,with_contexts:n})}}}}function Bn({app:e,ga4Config:t=null,facebookConfig:r=null,apiUrl:n=null,poolConfig:i=null}){n||(n=gr());var a=[Pr({apiUrl:n,poolConfig:i})];return t&&a.push(Sn(t)),r&&a.push(In(r)),or({app:e,plugins:a})}return ue.Analytics=or,ue.init=Bn,ue.zar=Pr,Object.defineProperties(ue,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),ue}({});
3
3
  //# sourceMappingURL=zar.iife.js.map