// awoo pixel v1.10.2 | Published By Awoo Front-End Team MIT License !function(g,n,v,r){"use strict";function a(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,a,o,u=[],s=!0,c=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=a.call(n)).done)&&(u.push(r.value),u.length!==t);s=!0);}catch(e){c=!0,i=e}finally{try{if(!s&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw i}}return u}}(e,t)||o(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(t,e){var n,r=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)),r}function y(t){for(var e=1;ee.length)&&(t=e.length);for(var n=0,r=new Array(t);n>e/4).toString(16)})}},{key:"createAuid",value:function(){try{JSON.parse(E.get("nununi-user"))}catch(e){E.delete("nununi-user")}E.exists("nununi-user")||(E.set("nununi-user",JSON.stringify({data:this.guid()})),v.queue.unshift(["param",{}],["event","firstVisit"]))}},{key:"decodeUri",value:function(t){try{return decodeURIComponent(t)}catch(e){return t}}},{key:"setupUTM",value:function(){E.delUtms(),E.setUtms()}},{key:"clearAllQueues",value:function(){g.awooConfigManager.pixel.viewEventQueue.clear(),g.awooConfigManager.pixel.searchEventQueue.clear(),g.awooConfigManager.pixel.clickProductEventQueue.clear(),g.awooConfigManager.pixel.addToCartEventQueue.clear()}},{key:"clearQueue",value:function(e){g.awooConfigManager.pixel[e].clear()}},{key:"guid",value:function(){return w.version+"-xxxxxxxx-".replace(/[x]/g,function(e){var t=36*Math.random()|0;return("x"==e?t:3&t|8).toString(36)})+(+new Date).toString(36)+"-"+this.uuidv4().substring(0,8)}},{key:"optionalData",value:function(e){return t.isPresent(e)?"object"===k(e)?t.optionalData(JSON.stringify(e)):"function"==typeof e?t.optionalData(e()):String(e):""}},{key:"isValidCupidId",value:function(e){return/^\d{10}$/.test(e)}},{key:"fetchPixelOnData",value:(n=l(O().mark(function e(a){var o,u,s;return O().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(w["isFetchApi_"+a]||!this.isValidCupidId(a))return e.abrupt("return",Promise.reject());e.next=2;break;case 2:return w["isFetchApi_"+a]=!0,o="".concat("pixel_on_cached_data_v1.10.2","_").concat(a),u="pixel_on_cached_timestamp",s="".concat("https://api.awoo.org"),e.abrupt("return",new Promise(function(){var n=l(O().mark(function e(r,t){var n,i;return O().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:n=E.get(o),i=E.get(u),n&&i&&Date.now()-parseInt(i,10)<36e5?r(JSON.parse(n)):(Object.keys(localStorage).filter(function(e){return e.includes("pixel_on_cached_data")&&e.includes(a)}).forEach(function(e){localStorage.removeItem(e)}),fetch("".concat(s,"/nununi/sdk/").concat(a,"/customerCustomizedConfig?groups[]=system")).then(function(){var t=l(O().mark(function e(t){var n;return O().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.json();case 2:if((n=e.sent).result.hasOwnProperty("system")){e.next=9;break}return g["awoo_pixelOn_".concat(a)]=!1,E.set(o,JSON.stringify({errmsg:"api error",result:{system:{fields:{pixelOn:!1}}}})),E.set(u,Date.now().toString()),r(n),e.abrupt("return");case 9:E.set(o,JSON.stringify(n)),E.set(u,Date.now().toString()),r(n);case 12:case"end":return e.stop()}},e)}));return function(e){return t.apply(this,arguments)}}()).catch(function(e){g["awoo_pixelOn_".concat(a)]=!1,E.set(o,JSON.stringify({errmsg:"api error",result:{system:{fields:{pixelOn:!1}}}})),E.set(u,Date.now().toString()),t(e)}));case 3:case"end":return e.stop()}},e)}));return function(e,t){return n.apply(this,arguments)}}()));case 8:case"end":return e.stop()}},e,this)})),function(e){return n.apply(this,arguments)})}]),t}(),x=function(){function e(){p(this,e)}return d(e,null,[{key:"nameAndVersion",value:function(){var e,t=navigator.userAgent,n=t.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i)||[];return/trident/i.test(n[1])?"IE "+((e=/\brv[ :]+(\d+)/g.exec(t)||[])[1]||""):"Chrome"===n[1]&&null!=(e=t.match(/\b(OPR|Edge)\/(\d+)/))?e.slice(1).join(" ").replace("OPR","Opera"):(n=n[2]?[n[1],n[2]]:[navigator.appName,navigator.appVersion,"-?"],null!=(e=t.match(/version\/(\d+)/i))&&n.splice(1,1,e[1]),n.join(" "))}},{key:"isMobile",value:function(){return"ontouchstart"in g||0=this.maxBatchSize&&(e=t(this.events),this.events=[],this.saveEventsToStorage(),this.sendSpecificBatch(e))}},{key:"startTimer",value:function(){var e=this;null===this.timer&&(this.timer=setInterval(function(){0