!function(){"use strict";var e="main_thread",t="out_app",r="cookie_set_by_document",n="cookie_blocked_on_start",o="general_fetch",i="webapi",a="storage_use",u="sw_incompat",c="proxy_unsupport",s="frequency",l="cost_time",f="__PNS_RUNTIME__",p="__PNS_SW_CACHE__",d="__PNS_SW_CACHE_KEY__",h=Symbol.for("lazyModuleRegistry");function v(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&void 0!==arguments[0]?arguments[0]:w(),r=globalThis[t];return r||(r={pendingEvents:[],pendingConfig:{},pendingListeners:{},errors:[],pushEvent:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e,i=arguments.length>3?arguments[3]:void 0;_(r.pendingEvents,{eventName:t,eventDetail:n,source:o,options:i},O)},pushError:function(e){_(r.errors,e,20)},pageContextObservers:[]},globalThis[t]=r),r}function j(){return"undefined"==typeof globalThis}function S(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:w();return j()?null:E(e)}function k(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:w(),n=document.createElement("script"),o=new URL(e);return o.search="?globalName=".concat(r,"&").concat(p,"=1&").concat(d,"=").concat(t),n.src=o.toString(),n.crossOrigin="anonymous",n.async=!0,new Promise((function(e,o){n.onload=function(){var n=globalThis[r];if(n){var o=n[h];e((null==o?void 0:o[t])||null)}else e(null)},n.onerror=o,document.head.appendChild(n),document.head.removeChild(n)}))}var x=function(e){return e&&"function"==typeof e.then};function R(e,t,r){return function(){for(var n=arguments.length,o=new Array(n),i=0;i0){var o,i=(o=Math).max.apply(o,g(Object.keys(r).map(Number)))+1,a=Array.from(m(function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);re.length)&&(t=e.length);for(var r=0,n=new Array(t);r0){var p=!1,d=!0,h=!1,v=void 0;try{for(var y,m=n[Symbol.iterator]();!(d=(y=m.next()).done);d=!0){var g=y.value;e.startsWith(g)&&(p=!0)}}catch(e){h=!0,v=e}finally{try{d||null==m.return||m.return()}finally{if(h)throw v}}if(!p)return!0}return!1}(u,{allowlist:n,blocklist:o,enableSameOriginBlock:i})),c)e["x-pns-block"]="1",e._blocked=!0;else if(a){var s;e.request_url=u;var l,f,p,d,h=b(u);e.request_host=null!==(l=null==h?void 0:h.host)&&void 0!==l?l:"",e.request_path=null!==(f=null==h?void 0:h.pathname)&&void 0!==f?f:"",e.search=null!==(p=null==h?void 0:h.search)&&void 0!==p?p:"",null!==(d=(s=e)._replaced_fields)&&void 0!==d||(s._replaced_fields=[]),e._replaced_fields.push("url"),e["x-pns-replace"]="1"}return(c||a)&&(e.rule_name=t.ruleName?"".concat(e.rule_name?"".concat(e.rule_name,","):"").concat(t.ruleName):e.rule_name),e}function ee(e,t){var r=encodeURIComponent(t),n=("?"===e[0]?e.slice(1):e).split("&"),o=!0,i=!1,a=void 0;try{for(var u,c=n[Symbol.iterator]();!(o=(u=c.next()).done);o=!0){var s=W(u.value.split("="),2),l=s[0],f=s[1];if(l===r)return decodeURIComponent(f)}}catch(e){i=!0,a=e}finally{try{o||null==c.return||c.return()}finally{if(i)throw a}}}function te(e,t){t.type;var r=t.pattern;switch(t.type){case"body":if(!e._is_json_body)return!1;var n,o=null!==(n=e._parsed_json_body)&&void 0!==n?n:e.body,i=t.field,a=function(e){try{var t=!0,n=!1,o=void 0;try{for(var a,u=i[Symbol.iterator]();!(t=(a=u.next()).done);t=!0){e=e[a.value]}}catch(e){n=!0,o=e}finally{try{t||null==u.return||u.return()}finally{if(n)throw o}}}catch(e){return!1}return!!H(e,r)};return x(o)?o.then(a,(function(){return!1})):a(o);case"url":if(H(e.request_url,r))return!0;break;case"host":if(H(e.request_host,r))return!0;break;case"path":if(H(e.request_path,r))return!0;break;case"search":if(!e.search)return!1;var u=ee(e.search,t.field);if(H(u,r))return!0;break;case"header":var c,s;if(H(null!==(s=null===(c=e.header_map)||void 0===c?void 0:c[t.field])&&void 0!==s?s:"",r))return!0;break;case"method":if(H(e.method,r))return!0;break;case"source":if(H(e.source,r))return!0;break;case"destination":if(H(e.destination,r))return!0}return!1}function re(e,t,r,n,o){switch(t.handler){case"replace":return void 0===t.pattern?t.value:function(e,t,r){if(!H(e,t))return e;if(["$eq","$ne","$exists","$in","$nin"].some((function(e){return e in t})))return r;var n,o="string"==typeof e,i=o?e:null!==(n=JSON.stringify(e))&&void 0!==n?n:"";return void 0!==t.$regex?i=i.replace(new RegExp(t.$regex,t.$options),r):void 0!==t.$text?i=i.replace(t.$text,r):void 0!==t.$prefix&&(i=i.replace(t.$prefix,r)),R((function(){return o?i:JSON.parse(i)}),void 0,e)()}(r(),t.pattern,t.value);case"remove":return n;case"empty":return o}}function ne(e,t){var r=e;switch(t.type){case"body":if(!r._is_json_body)return r;var n=t.type,o=t.field,i=function(e){var r,i=void 0===e._parsed_json_body?"body":"_parsed_json_body",a=re(0,t,(function(){return function(e,t){try{var r=e,n=!0,o=!1,i=void 0;try{for(var a,u=t[Symbol.iterator]();!(n=(a=u.next()).done);n=!0)r=r[a.value]}catch(e){o=!0,i=e}finally{try{n||null==u.return||u.return()}finally{if(o)throw i}}return r}catch(e){}}(e,[i].concat(J(o)))}),void 0,null);return function(e,t,r){var n=e;try{var o=t.pop(),i=!0,a=!1,u=void 0;try{for(var c,s=t[Symbol.iterator]();!(i=(c=s.next()).done);i=!0)n=n[c.value]}catch(e){a=!0,u=e}finally{try{i||null==s.return||s.return()}finally{if(a)throw u}}n[o]=r}catch(e){}}(e,[i].concat(J(o)),a),e._replaced_fields=J(null!==(r=e._replaced_fields)&&void 0!==r?r:[]).concat([n]),e._modified=!0,e};return x(r.body)?r.body.then((function(e){return r.body=e,r})).then(i):i(r);case"url":var a,u=re(0,t,(function(){return r.request_url})),c=b(u);r.request_url=u,r.request_host=c.host,r.request_path=c.pathname,r.search=c.search,r._replaced_fields=J(null!==(a=r._replaced_fields)&&void 0!==a?a:[]).concat([t.type]);break;case"host":var s,l=re(0,t,(function(){return r.request_host}),"",""),f=b(r.request_url);f.host=l,r.request_url=f.href,r.request_host=l,r._replaced_fields=J(null!==(s=r._replaced_fields)&&void 0!==s?s:[]).concat(["url"]);break;case"path":var p,d=re(0,t,(function(){return r.request_path}),"",""),h=b(r.request_url);h.pathname=d,r.request_url=h.href,r.request_path=d,r._replaced_fields=J(null!==(p=r._replaced_fields)&&void 0!==p?p:[]).concat(["url"]);break;case"search":var v,y=re(0,t,(function(){return ee(r.search,t.field)}),void 0,""),m=function(e,t,r){for(var n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],o=encodeURIComponent(t),i="?"===e[0],a=(i?e.slice(1):e).split("&"),u=!1,c=0;c0&&void 0!==arguments[0]?arguments[0]:location,t=e.href,r=e.host,n=e.pathname,o=e.search,i=e.hash;return{url:t,host:r,path:n,search:o,hash:i}}function ue(){ /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ ue=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",i=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function u(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(e){u=function(e,t,r){return e[t]=r}}function c(e,t,r,n){var o=t&&t.prototype instanceof f?t:f,i=Object.create(o.prototype),a=new E(n||[]);return i._invoke=function(e,t,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return S()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var u=w(a,r);if(u){if(u===l)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=s(e,t,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===l)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}(e,r,a),i}function s(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var l={};function f(){}function p(){}function d(){}var h={};u(h,o,(function(){return this}));var v=Object.getPrototypeOf,y=v&&v(v(j([])));y&&y!==t&&r.call(y,o)&&(h=y);var m=d.prototype=f.prototype=Object.create(h);function g(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function b(e,t){function n(o,i,a,u){var c=s(e[o],e,i);if("throw"!==c.type){var l=c.arg,f=l.value;return f&&"object"==typeof f&&r.call(f,"__await")?t.resolve(f.__await).then((function(e){n("next",e,a,u)}),(function(e){n("throw",e,a,u)})):t.resolve(f).then((function(e){l.value=e,a(l)}),(function(e){return n("throw",e,a,u)}))}u(c.arg)}var o;this._invoke=function(e,r){function i(){return new t((function(t,o){n(e,r,t,o)}))}return o=o?o.then(i,i):i()}}function w(e,t){var r=e.iterator[t.method];if(void 0===r){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method))return l;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var n=s(r,e.iterator,t.arg);if("throw"===n.type)return t.method="throw",t.arg=n.arg,t.delegate=null,l;var o=n.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,l):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,l)}function _(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function E(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(_,this),this.reset(!0)}function j(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,i=function t(){for(;++n=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var u=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(u&&c){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),l}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;O(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:j(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},e}function ce(e){return ce="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ce(e)}function se(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function le(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}var Oe=function(){},Ee=function(e){return"object"===ce(e)&&null!==e},je=function(e){return"string"==typeof e},Se=function(){var e=Object.prototype.hasOwnProperty;return function(t,r){return e.call(t,r)}}(),ke=function(e,t,r){Se(e,r)&&(t[r]=e[r])},xe=function(e,t){var r,n={},o=_e(t);try{for(o.s();!(r=o.n()).done;){var i=r.value;if(Array.isArray(i)){var a,u=_e(i);try{for(u.s();!(a=u.n()).done;){var c=a.value;ke(e,n,c)}}catch(e){u.e(e)}finally{u.f()}}else ke(e,n,i)}}catch(e){o.e(e)}finally{o.f()}return n};function Re(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Oe,n=document.createElement("script");n.src=e,"module"===t?n.setAttribute("type","module"):"nomodule"===t&&n.setAttribute("nomodule",""),n.crossOrigin="anonymous",n.onerror=function(){return r(e)},document.body.appendChild(n)}function Ae(){return!(void 0!==window)}function Ce(e,t){return e.replace(/./g,(function(e){return Math.random()>t?"*":e}))}function Pe(e){return e>Math.random()}function Te(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=(new Error).stack;return null!==(e=null==r?void 0:r.split("\n").slice(t).map((function(e){return e.trim()})).join("\n"))&&void 0!==e?e:""}function Ne(e){var t=e.split("=").slice(1).join("=");try{'"'===t[0]&&(t=t.slice(1,-1)),t=t.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)}catch(e){}return t}function Le(e,t){var r=E();return R(e,(function(e){return r.pushError(e)}),t)}/iPhone|iPad/.test(navigator.userAgent);var De=["/404","/help/","/static/"];function Ie(e){var t=document.head.querySelector(e);if(!t)return null;try{var r=t.content.split(",").reduce((function(e,t){var r=me(t.split("="),2),n=r[0],o=r[1];return e[n]=o,e}),{});return r}catch(e){return null}}function qe(){var e={},t=Ie("meta[name=pumbaa-web-config]");if(t)for(var r=0,n=Object.keys(t);r=o&&s.call(this),clearTimeout(c),c=setTimeout(s.bind(this),a)},flushWithBeacon:function(){var e;clearTimeout(c),u.length&&(null===(e=navigator.sendBeacon)||void 0===e||e.call(navigator,this.getEndpoint(),this.getBatchData()),u=[])},getBatchData:function(){return u.length?(e=u,JSON.stringify({ev_type:"batch",list:e})):"";var e},clear:function(){clearTimeout(c),u=[]}}}var Xe,Qe=function(){var e=function(){for(var e=new Array(16),t=0,r=0;r<16;r++)0==(3&r)&&(t=4294967296*Math.random()),e[r]=t>>>((3&r)<<3)&255;return e}();return e[6]=15&e[6]|64,e[8]=63&e[8]|128,function(e){for(var t=[],r=0;r<256;++r)t[r]=(r+256).toString(16).substr(1);var n=0,o=t;return[o[e[n++]],o[e[n++]],o[e[n++]],o[e[n++]],"-",o[e[n++]],o[e[n++]],"-",o[e[n++]],o[e[n++]],"-",o[e[n++]],o[e[n++]],"-",o[e[n++]],o[e[n++]],o[e[n++]],o[e[n++]],o[e[n++]],o[e[n++]]].join("")}(e)},Ze=function(){try{return!!window.localStorage}catch(e){return!1}}(),et=function(e,t){var r,n,o=e.sampleRate,i=e.valueRate,a=e.stackCollectKeys.map((function(e){return new RegExp(e)})),u={sessionStorage:{setItem:new Set,getItem:new Set},localStorage:{setItem:new Set,getItem:new Set}};return r=function(e){var r,n=e.value,c=Ve(e,["value"]),s=c.key,l=c.storageType,f=c.operateType,p=null===(r=u[l])||void 0===r?void 0:r[f];if(p){if(p.has(s))return;p.add(s)}Pe(i)&&"string"==typeof n&&Object.assign(c,{value:Ce(n,.5)}),s&&a.some((function(e){return e.test(s)}))&&Object.assign(c,{stack:Te(7)}),t.reportCustomizedEvent("storage_use",{},c,{common:{sample_rate:o}})},n=o,function(){if(Math.random()=this.volume&&this.clear(),this.resetTimer()}}},{key:"clear",value:function(){var e=this;0!==this.size&&(Object.keys(this.cache).map((function(t){var r=e.cache[t],n=r.key,o=r.ts,i=r.event_type,a=r.sample_rate;return{categories:{key:n,event_type:i,start_time:"".concat(o[0]),call_time:o.slice(1).map((function(e,t,r){var n;return e-(null!==(n=r[t-1])&&void 0!==n?n:o[0])})).join(",")},common:{sample_rate:a}}})).forEach((function(t){var r=t.categories,n=t.common;e.reporter.report(s,{},r,{common:n})})),this.size=0,this.cache={})}},{key:"onTimeout",value:function(){this.clear()}},{key:"resetTimer",value:function(){clearTimeout(this.timeoutID),this.timeoutID=Number(setTimeout(this.onTimeout.bind(this),this.timeout))}}],[{key:"getInstance",value:function(){return e._instance}},{key:"withPause",value:function(t){return nt?function(){var r=e.getInstance();r&&(r.pause=!0);var n=t.apply(void 0,arguments);return r&&(r.pause=!1),n}:t}}]),e}();function ut(e){var t=new at(e);return null!=Xe||(Xe=function(e){t.push(e)}),Xe}at._instance=null;var ct="/monitor_browser/collect/batch/",st=function(e){return"HYBRID_SLARDAR_WEB"+e},lt=function(e){try{var t=at.withPause(localStorage.getItem.bind(localStorage))(e);if(t&&je(t))return JSON.parse(t)}catch(e){}return null},ft=function(e){var t=e.bid,r=e.userId,n=e.deviceId;!function(e,t){try{var r=je(t)?t:JSON.stringify(t);at.withPause(localStorage.setItem.bind(localStorage))(e,r)}catch(e){}}(st(t),{userId:r,deviceId:n})},pt=function(e,t,r){var n=t.url,o=t.data,i=new r;i.open(e,n,!0),i.setRequestHeader("Content-Type","application/json"),i.send(o)},dt=function(){if("function"==typeof XMLHttpRequest&&"function"==typeof XMLHttpRequest)return XMLHttpRequest},ht=function(){var e=dt();return e?{get:function(t){pt("GET",t,e)},post:function(t){pt("POST",t,e)}}:{get:Oe,post:Oe}},vt=function(){return void 0!==window.fetch?{post:function(e){return function(e){var t=e.url,r=e.data;window.fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:r}).catch((function(e){}))}(e)}}:{post:Oe}},yt=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:ct;return e?"".concat(e&&e.indexOf("//")>=0?"":"https://").concat(e).concat(r).concat(t?"?bid=".concat(t):""):""},mt=function(e){try{return je(e)?e:JSON.stringify(e)}catch(e){return"[FAILED_TO_STRINGIFY]:".concat(String(e))}},gt=function(e,t){var r=t.business;if(e&&Ee(e)&&e.name&&je(e.name)){var n={name:e.name,type:"event",metrics:{},categories:{}};if("metrics"in e&&Ee(e.metrics)){var o=e.metrics,i={};for(var a in o){var u=o[a];"number"==typeof u&&(i[a]=u)}n.metrics=i}if("categories"in e&&Ee(e.categories)){var c=e.categories,s={};for(var l in c){var f=c[l];s[l]=mt(f)}n.categories=s}return r&&Object.assign(n.categories,{__business__:r}),n}},bt=function(){return Ee(window)?window:null},wt=function(e){return function(e){try{var t=new URL(e),r=t.pathname||"/";return"/"!==r[0]&&(r="/".concat(r)),{url:e,protocol:t.protocol.slice(0,-1),domain:t.hostname,query:t.search.substring(1),path:r,hash:t.hash}}catch(t){return{url:e,protocol:"",domain:"",query:"",path:"",hash:""}}}(e).path};var _t,Ot="custom",Et=function(e){var t,r=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=st(e),r=lt(t);if(!r){var n={userId:Qe(),deviceId:Qe()};return ft(Object.assign({bid:e},n)),n}return r}(e.bid);return{pid:wt(location.href),viewId:(t="_","".concat(t,"_").concat(Date.now())),userId:r.userId,release:"1.0.0.860",deviceId:r.deviceId,sessionId:Qe(),env:e.env||"production",sample_rate:1}},jt=function(e){var t=Object.assign({},function(e){var t={bid:""};for(var r in e){var n=e[r];t[r.replace(/[A-Z]/g,(function(e){return"_".concat(e.toLowerCase())}))]=n}return t}(e));t=Object.assign(Object.assign(Object.assign({},t),function(){var e,t=bt()&&bt()&&window.location;return t?{url:null===(e=t.href)||void 0===e?void 0:e.split("?")[0],protocol:t.protocol.slice(0,-1),domain:t.hostname,path:t.pathname,query:t.search.substring(1)}:{}}()),{timestamp:Date.now(),sdk_version:"0.0.1",sdk_name:"SDK_SLARDAR_WEB"});var r=$e().pageContext,n=r.ftc,o=r.login;return n&&(t.context=Object.assign(Object.assign({},t.context),{ftc:n})),o&&(t.context=Object.assign(Object.assign({},t.context),{login:o})),t},St=function(e){if(!(e&&Ee(e)&&(t=e,Ee(t)&&"bid"in t)))throw new Error("invalid InitConfig, init failed");var t,r=e.wait,n=e.size,o=e.beforeSend,i=Ve(e,["wait","size","beforeSend"]),a=Et(i),u=Object.assign(Object.assign({},a),i),c=Ke({endpoint:yt(u.domain,e.bid),transport:"function"==typeof window.fetch?vt():ht(),wait:r,size:n}),s=function(){var e=$e().pageContext,t=e.ftc,r=e.env;return"1"===t&&"production"===r},l=function(e){return s()?c.clear():c.send(e)},f={config:function(e){Object.assign(u,e)},sendEvent:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=gt(e,u);this.report({ev_type:Ot,payload:r},t)},report:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e){if(e.common||(e.common=Object.assign(Object.assign({},jt(u)),t.common)),!t.bypassHook&&o&&!o(e))return;l(e)}},reportError:function(e){var t,r,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];null!==(t=(r=e.payload).extra)&&void 0!==t||(r.extra={}),e.payload.extra.__business__=u.business,this.report(e,{bypassHook:n})},flush:function(){s()?c.clear():c.flushWithBeacon()}};return f},kt=["name","message","stack","filename","lineno","colno"],xt=function(e){var t,r;if(r=_t,!((t=e)&&r&&t.message&&t.stack&&t.message===r.message&&t.stack===r.stack))return _t=e,e;_t=e},Rt=function(e){if(performance&&"function"==typeof performance.getEntriesByName)return performance.getEntriesByName(e)[0]},At=function(){var e,t,r,n,o=["ftc","login","cb_enabled","gtm"],i=function(e){return o.reduce((function(t,r){return void 0===e[r]?t:Object.assign(Object.assign({},t),pe({},r,e[r]))}),{})},a=$e().pageContext,u={ref:i(a)};return e=function(e){u.ref=i(e)},t=o,n=E(),null!==(r=n.pageContextObservers)&&void 0!==r||(n.pageContextObservers=[]),n.pageContextObservers.push({func:e,fields:t}),u},Ct=function(){function e(t){var r=this;se(this,e),this.handleOpt=function(e){var t;return Object.assign(Object.assign({},e),{common:Object.assign(Object.assign({},null==e?void 0:e.common),{context:Object.assign(Object.assign({},r.ctx.ref),null===(t=e.common)||void 0===t?void 0:t.context)})})},this.report=function(e,t,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};r.client?r.client.sendEvent({name:e,metrics:t,categories:n},r.handleOpt(o)):B.warn("[Reporter] Not ready to report.")},this.reportCustomizedEvent=function(e,t,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};r.client?r.client.sendEvent({name:e,metrics:t,categories:n},r.handleOpt(o)):B.warn("[Reporter] Not ready to report.")},this.reportAbnormality=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};r.client?r.client.sendEvent({name:"framework_abnormality",metrics:{count:1},categories:{abnormal_type:e,message:null!=t?t:""}},r.handleOpt(n)):B.warn("[Reporter] Not ready to report.")},this.reportError=function(e){if(r.client){if(e instanceof Error){if(!xt(e))return;r.client.reportError({ev_type:"js_error",payload:{error:kt.reduce((function(t,r){return t[r]=null==e?void 0:e[r],t}),{}),breadcrumbs:[]}})}else if(e instanceof Event){var t="string"!=typeof e?e.target||e.srcElement:null;if(!t)return;var n=t.tagName;if(!n||"string"!=typeof n)return;var o=t.src,i={type:"script",url:o,timing:Rt(o)};r.client.reportError({ev_type:"resource_error",payload:i})}}else B.warn("[Reporter] Not ready to report.")},this.client=St(Object.assign({bid:Ge.bid,env:"production"},t)),this.ctx=At(),document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&r.client.flush()}))}return fe(e,[{key:"config",value:function(e){this.client.config(e)}},{key:"reportPerf",value:function(e){var t;this.client?(t="string"==typeof e?Rt(e):e)&&this.client.report({ev_type:"resource",payload:t}):B.warn("[Reporter] Not ready to report.")}},{key:"reportPreloadScript",value:function(){if(performance&&"function"==typeof performance.getEntriesByType){var e=performance.getEntriesByType("resource").filter((function(e){return String.prototype.includes.call(e.name,"tiktok_privacy_protection_framework")}));e.length>0&&this.reportPerf(e[0])}}},{key:"flush",value:function(){this.client.flush()}}]),e}(),Pt={va:"https://api-pns-va.tiktok.com",sg:"https://api-pns-sg.tiktok.com","us-ttp":"https://api-pns.tiktokw.us"};function Tt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Nt,Lt={exports:{}},Dt={exports:{}},It=function(e,t){return function(){for(var r=new Array(arguments.length),n=0;n0;)a[i=n[o]]||(t[i]=e[i],a[i]=!0);e=Object.getPrototypeOf(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},kindOf:Ut,kindOfTest:Ht,endsWith:function(e,t,r){e=String(e),(void 0===r||r>e.length)&&(r=e.length),r-=t.length;var n=e.indexOf(t,r);return-1!==n&&n===r},toArray:function(e){if(!e)return null;var t=e.length;if(Ft(t))return null;for(var r=new Array(t);t-- >0;)r[t]=e[t];return r},isTypedArray:er,isFileList:Yt},rr=tr;function nr(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var or=function(e,t,r){if(!t)return e;var n;if(r)n=r(t);else if(rr.isURLSearchParams(t))n=t.toString();else{var o=[];rr.forEach(t,(function(e,t){null!=e&&(rr.isArray(e)?t+="[]":e=[e],rr.forEach(e,(function(e){rr.isDate(e)?e=e.toISOString():rr.isObject(e)&&(e=JSON.stringify(e)),o.push(nr(t)+"="+nr(e))})))})),n=o.join("&")}if(n){var i=e.indexOf("#");-1!==i&&(e=e.slice(0,i)),e+=(-1===e.indexOf("?")?"?":"&")+n}return e},ir=tr;function ar(){this.handlers=[]}ar.prototype.use=function(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1},ar.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},ar.prototype.forEach=function(e){ir.forEach(this.handlers,(function(t){null!==t&&e(t)}))};var ur,cr,sr=ar,lr=tr;function fr(){if(cr)return ur;cr=1;var e=tr;function t(e,t,r,n,o){Error.call(this),this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),o&&(this.response=o)}e.inherits(t,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var r=t.prototype,n={};return["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED"].forEach((function(e){n[e]={value:e}})),Object.defineProperties(t,n),Object.defineProperty(r,"isAxiosError",{value:!0}),t.from=function(n,o,i,a,u,c){var s=Object.create(r);return e.toFlatObject(n,s,(function(e){return e!==Error.prototype})),t.call(s,n.message,o,i,a,u),s.name=n.name,c&&Object.assign(s,c),s},ur=t}var pr,dr,hr,vr,yr,mr,gr={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};function br(){if(dr)return pr;dr=1;var e=tr;return pr=function(t,r){r=r||new FormData;var n=[];function o(t){return null===t?"":e.isDate(t)?t.toISOString():e.isArrayBuffer(t)||e.isTypedArray(t)?"function"==typeof Blob?new Blob([t]):Buffer.from(t):t}return function t(i,a){if(e.isPlainObject(i)||e.isArray(i)){if(-1!==n.indexOf(i))throw Error("Circular reference detected in "+a);n.push(i),e.forEach(i,(function(n,i){if(!e.isUndefined(n)){var u,c=a?a+"."+i:i;if(n&&!a&&"object"==typeof n)if(e.endsWith(i,"{}"))n=JSON.stringify(n);else if(e.endsWith(i,"[]")&&(u=e.toArray(n)))return void u.forEach((function(t){!e.isUndefined(t)&&r.append(c,o(t))}));t(n,c)}})),n.pop()}else r.append(a,o(i))}(t),r},pr}function wr(){if(vr)return hr;vr=1;var e=fr();return hr=function(t,r,n){var o=n.config.validateStatus;n.status&&o&&!o(n.status)?r(new e("Request failed with status code "+n.status,[e.ERR_BAD_REQUEST,e.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):t(n)}}function _r(){if(mr)return yr;mr=1;var e=tr;return yr=e.isStandardBrowserEnv()?{write:function(t,r,n,o,i,a){var u=[];u.push(t+"="+encodeURIComponent(r)),e.isNumber(n)&&u.push("expires="+new Date(n).toGMTString()),e.isString(o)&&u.push("path="+o),e.isString(i)&&u.push("domain="+i),!0===a&&u.push("secure"),document.cookie=u.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}}var Or,Er,jr,Sr,kr,xr,Rr,Ar,Cr,Pr,Tr,Nr,Lr=function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)},Dr=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e},Ir=function(e,t){return e&&!Lr(t)?Dr(e,t):t};function qr(){if(Er)return Or;Er=1;var e=tr,t=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];return Or=function(r){var n,o,i,a={};return r?(e.forEach(r.split("\n"),(function(r){if(i=r.indexOf(":"),n=e.trim(r.substr(0,i)).toLowerCase(),o=e.trim(r.substr(i+1)),n){if(a[n]&&t.indexOf(n)>=0)return;a[n]="set-cookie"===n?(a[n]?a[n]:[]).concat([o]):a[n]?a[n]+", "+o:o}})),a):a}}function Br(){if(Sr)return jr;Sr=1;var e=tr;return jr=e.isStandardBrowserEnv()?function(){var t,r=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function o(e){var t=e;return r&&(n.setAttribute("href",t),t=n.href),n.setAttribute("href",t),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return t=o(window.location.href),function(r){var n=e.isString(r)?o(r):r;return n.protocol===t.protocol&&n.host===t.host}}():function(){return!0}}function Ur(){if(xr)return kr;xr=1;var e=fr();function t(t){e.call(this,null==t?"canceled":t,e.ERR_CANCELED),this.name="CanceledError"}return tr.inherits(t,e,{__CANCEL__:!0}),kr=t}function Hr(){return Ar?Rr:(Ar=1,Rr=function(e){var t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""})}function $r(){if(Pr)return Cr;Pr=1;var e=tr,t=wr(),r=_r(),n=or,o=Ir,i=qr(),a=Br(),u=gr,c=fr(),s=Ur(),l=Hr();return Cr=function(f){return new Promise((function(p,d){var h,v=f.data,y=f.headers,m=f.responseType;function g(){f.cancelToken&&f.cancelToken.unsubscribe(h),f.signal&&f.signal.removeEventListener("abort",h)}e.isFormData(v)&&e.isStandardBrowserEnv()&&delete y["Content-Type"];var b=new XMLHttpRequest;if(f.auth){var w=f.auth.username||"",_=f.auth.password?unescape(encodeURIComponent(f.auth.password)):"";y.Authorization="Basic "+btoa(w+":"+_)}var O=o(f.baseURL,f.url);function E(){if(b){var e="getAllResponseHeaders"in b?i(b.getAllResponseHeaders()):null,r={data:m&&"text"!==m&&"json"!==m?b.response:b.responseText,status:b.status,statusText:b.statusText,headers:e,config:f,request:b};t((function(e){p(e),g()}),(function(e){d(e),g()}),r),b=null}}if(b.open(f.method.toUpperCase(),n(O,f.params,f.paramsSerializer),!0),b.timeout=f.timeout,"onloadend"in b?b.onloadend=E:b.onreadystatechange=function(){b&&4===b.readyState&&(0!==b.status||b.responseURL&&0===b.responseURL.indexOf("file:"))&&setTimeout(E)},b.onabort=function(){b&&(d(new c("Request aborted",c.ECONNABORTED,f,b)),b=null)},b.onerror=function(){d(new c("Network Error",c.ERR_NETWORK,f,b,b)),b=null},b.ontimeout=function(){var e=f.timeout?"timeout of "+f.timeout+"ms exceeded":"timeout exceeded",t=f.transitional||u;f.timeoutErrorMessage&&(e=f.timeoutErrorMessage),d(new c(e,t.clarifyTimeoutError?c.ETIMEDOUT:c.ECONNABORTED,f,b)),b=null},e.isStandardBrowserEnv()){var j=(f.withCredentials||a(O))&&f.xsrfCookieName?r.read(f.xsrfCookieName):void 0;j&&(y[f.xsrfHeaderName]=j)}"setRequestHeader"in b&&e.forEach(y,(function(e,t){void 0===v&&"content-type"===t.toLowerCase()?delete y[t]:b.setRequestHeader(t,e)})),e.isUndefined(f.withCredentials)||(b.withCredentials=!!f.withCredentials),m&&"json"!==m&&(b.responseType=f.responseType),"function"==typeof f.onDownloadProgress&&b.addEventListener("progress",f.onDownloadProgress),"function"==typeof f.onUploadProgress&&b.upload&&b.upload.addEventListener("progress",f.onUploadProgress),(f.cancelToken||f.signal)&&(h=function(e){b&&(d(!e||e&&e.type?new s:e),b.abort(),b=null)},f.cancelToken&&f.cancelToken.subscribe(h),f.signal&&(f.signal.aborted?h():f.signal.addEventListener("abort",h))),v||(v=null);var S=l(O);S&&-1===["http","https","file"].indexOf(S)?d(new c("Unsupported protocol "+S+":",c.ERR_BAD_REQUEST,f)):b.send(v)}))},Cr}var Fr=tr,Mr=function(e,t){lr.forEach(e,(function(r,n){n!==t&&n.toUpperCase()===t.toUpperCase()&&(e[t]=r,delete e[n])}))},Wr=fr(),Jr=gr,zr=br(),Gr={"Content-Type":"application/x-www-form-urlencoded"};function Vr(e,t){!Fr.isUndefined(e)&&Fr.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var Yr,Kr={transitional:Jr,adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(Yr=$r()),Yr),transformRequest:[function(e,t){if(Mr(t,"Accept"),Mr(t,"Content-Type"),Fr.isFormData(e)||Fr.isArrayBuffer(e)||Fr.isBuffer(e)||Fr.isStream(e)||Fr.isFile(e)||Fr.isBlob(e))return e;if(Fr.isArrayBufferView(e))return e.buffer;if(Fr.isURLSearchParams(e))return Vr(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString();var r,n=Fr.isObject(e),o=t&&t["Content-Type"];if((r=Fr.isFileList(e))||n&&"multipart/form-data"===o){var i=this.env&&this.env.FormData;return zr(r?{"files[]":e}:e,i&&new i)}return n||"application/json"===o?(Vr(t,"application/json"),function(e,t,r){if(Fr.isString(e))try{return(t||JSON.parse)(e),Fr.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(r||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional||Kr.transitional,r=t&&t.silentJSONParsing,n=t&&t.forcedJSONParsing,o=!r&&"json"===this.responseType;if(o||n&&Fr.isString(e)&&e.length)try{return JSON.parse(e)}catch(e){if(o){if("SyntaxError"===e.name)throw Wr.from(e,Wr.ERR_BAD_RESPONSE,this,null,this.response);throw e}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Nr?Tr:(Nr=1,Tr=null)},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};Fr.forEach(["delete","get","head"],(function(e){Kr.headers[e]={}})),Fr.forEach(["post","put","patch"],(function(e){Kr.headers[e]=Fr.merge(Gr)}));var Xr,Qr,Zr=Kr,en=tr,tn=Zr;function rn(){return Qr?Xr:(Qr=1,Xr=function(e){return!(!e||!e.__CANCEL__)})}var nn=tr,on=function(e,t,r){var n=this||tn;return en.forEach(r,(function(r){e=r.call(n,e,t)})),e},an=rn(),un=Zr,cn=Ur();function sn(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new cn}var ln,fn,pn=tr,dn=function(e,t){t=t||{};var r={};function n(e,t){return pn.isPlainObject(e)&&pn.isPlainObject(t)?pn.merge(e,t):pn.isPlainObject(t)?pn.merge({},t):pn.isArray(t)?t.slice():t}function o(r){return pn.isUndefined(t[r])?pn.isUndefined(e[r])?void 0:n(void 0,e[r]):n(e[r],t[r])}function i(e){if(!pn.isUndefined(t[e]))return n(void 0,t[e])}function a(r){return pn.isUndefined(t[r])?pn.isUndefined(e[r])?void 0:n(void 0,e[r]):n(void 0,t[r])}function u(r){return r in t?n(e[r],t[r]):r in e?n(void 0,e[r]):void 0}var c={url:i,method:i,data:i,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:u};return pn.forEach(Object.keys(e).concat(Object.keys(t)),(function(e){var t=c[e]||o,n=t(e);pn.isUndefined(n)&&t!==u||(r[e]=n)})),r};function hn(){return fn?ln:(fn=1,ln={version:"0.27.2"})}var vn=hn().version,yn=fr(),mn={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){mn[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}}));var gn={};mn.transitional=function(e,t,r){return function(n,o,i){if(!1===e)throw new yn(function(e,t){return"[Axios v"+vn+"] Transitional option '"+e+"'"+t+(r?". "+r:"")}(o," has been removed"+(t?" in "+t:"")),yn.ERR_DEPRECATED);return t&&!gn[o]&&(gn[o]=!0),!e||e(n,o,i)}};var bn,wn,_n,On,En,jn,Sn={assertOptions:function(e,t,r){if("object"!=typeof e)throw new yn("options must be an object",yn.ERR_BAD_OPTION_VALUE);for(var n=Object.keys(e),o=n.length;o-- >0;){var i=n[o],a=t[i];if(a){var u=e[i],c=void 0===u||a(u,i,e);if(!0!==c)throw new yn("option "+i+" must be "+c,yn.ERR_BAD_OPTION_VALUE)}else if(!0!==r)throw new yn("Unknown option "+i,yn.ERR_BAD_OPTION)}},validators:mn},kn=tr,xn=or,Rn=sr,An=function(e){return sn(e),e.headers=e.headers||{},e.data=on.call(e,e.data,e.headers,e.transformRequest),e.headers=nn.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),nn.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||un.adapter)(e).then((function(t){return sn(e),t.data=on.call(e,t.data,t.headers,e.transformResponse),t}),(function(t){return an(t)||(sn(e),t&&t.response&&(t.response.data=on.call(e,t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))},Cn=dn,Pn=Ir,Tn=Sn,Nn=Tn.validators;function Ln(e){this.defaults=e,this.interceptors={request:new Rn,response:new Rn}}Ln.prototype.request=function(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},(t=Cn(this.defaults,t)).method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var r=t.transitional;void 0!==r&&Tn.assertOptions(r,{silentJSONParsing:Nn.transitional(Nn.boolean),forcedJSONParsing:Nn.transitional(Nn.boolean),clarifyTimeoutError:Nn.transitional(Nn.boolean)},!1);var n=[],o=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(o=o&&e.synchronous,n.unshift(e.fulfilled,e.rejected))}));var i,a=[];if(this.interceptors.response.forEach((function(e){a.push(e.fulfilled,e.rejected)})),!o){var u=[An,void 0];for(Array.prototype.unshift.apply(u,n),u=u.concat(a),i=Promise.resolve(t);u.length;)i=i.then(u.shift(),u.shift());return i}for(var c=t;n.length;){var s=n.shift(),l=n.shift();try{c=s(c)}catch(e){l(e);break}}try{i=An(c)}catch(e){return Promise.reject(e)}for(;a.length;)i=i.then(a.shift(),a.shift());return i},Ln.prototype.getUri=function(e){e=Cn(this.defaults,e);var t=Pn(e.baseURL,e.url);return xn(t,e.params,e.paramsSerializer)},kn.forEach(["delete","get","head","options"],(function(e){Ln.prototype[e]=function(t,r){return this.request(Cn(r||{},{method:e,url:t,data:(r||{}).data}))}})),kn.forEach(["post","put","patch"],(function(e){function t(t){return function(r,n,o){return this.request(Cn(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:r,data:n}))}}Ln.prototype[e]=t(),Ln.prototype[e+"Form"]=t(!0)}));var Dn=tr,In=It,qn=Ln,Bn=dn;var Un=function e(t){var r=new qn(t),n=In(qn.prototype.request,r);return Dn.extend(n,qn.prototype,r),Dn.extend(n,r),n.create=function(r){return e(Bn(t,r))},n}(Zr);Un.Axios=qn,Un.CanceledError=Ur(),Un.CancelToken=function(){if(wn)return bn;wn=1;var e=Ur();function t(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");var r;this.promise=new Promise((function(e){r=e}));var n=this;this.promise.then((function(e){if(n._listeners){var t,r=n._listeners.length;for(t=0;t0&&(r.rule_name=e._rule_names.join(",")),o.reportCustomizedEvent("js_cookie_set",n,r,{common:{sample_rate:e._sample_rate}})})),t.registerHandler(n,(function(e){var r=e.cookie;t.getReporter().report(n,{},{cookie:r})}))},lo=function(e,t){var r;t.registerHandler(i,(r=t.getReporter(),function(e){var t=e.apiRule,n=e.args,o=e._blocked,i=t.apiObj,a=t.apiName,u=t.withStack,c=t.stackRate,s={callee_obj_path:i,callee_name:a,real_argument_list:t.withRawArguments.map((function(e,t){if(e){var r=n[t];if("function"==typeof n[t])return"__func__";var o="";try{o=JSON.stringify(r)}catch(e){}return o}return""})).join(";")};o&&(s.blocked="1"),Fe().webapi.apis.some((function(e){return void 0!==e.withStack}))&&u&&Pe(c)&&Object.assign(s,{stack:Te(9)}),r.report("webapi",{count:1},s,{common:{sample_rate:e.apiRule.sampleRate}})})),nt&&t.registerHandler(s,ut(t.getReporter()))},fo=["tiktok.com","tiktokv.com","byteoversea.com","tiktokglobalshop.com","isnssdk.com"],po=function(e,t){return Le(ie,e)(e,t)};!function(e){e[e.SW_READY=0]="SW_READY"}(no||(no={}));var ho="PerformanceObserver"in window,vo=["xmlhttprequest","fetch","beacon"];function yo(e,t){var r=e.switcher.activeInterceptRules.map((function(e){return Q(e)?e:Object.assign(Object.assign({},e),{handlers:e.handlers.filter((function(e){return"report"===e.handler}))})}));t.getEntries().forEach((function(t){if(e.isBufferedEntry||!vo.includes(t.initiatorType)){var n=function(e){var t=b(e.name);if(void 0!==t)return{request_url:t.href,request_host:t.host,request_path:t.pathname,method:"UNKNOWN",source:G,search:t.search,_request_time:Math.trunc(e.startTime+performance.timeOrigin),initiator_type:e.initiatorType,resp_status:e.responseStatus,_is_json_body:!1,_sample_rate:0}}(t);if(n){n.perf_buf=e.isBufferedEntry;var o=e.switcher.getState(no.SW_READY);void 0!==o&&(n.sw_ready="".concat(o));var i,a=Object.assign({},n),u=_e(r);try{for(u.s();!(i=u.n()).done;){var c=i.value;a=Q(c)?Z(a,c):po(a,c)}}catch(e){u.e(e)}finally{u.f()}a=Object.assign(Object.assign(Object.assign({},a),n),{_sample_rate:a._sample_rate}),setTimeout((function(){var r,n,o,i;-1===e.securityPolicyViolationURLs.indexOf(t.name)&&(e.switcher.callback.report(a),(null!==(n=null===(r=Fe().network.freq)||void 0===r?void 0:r.length)&&void 0!==n?n:0)>0&&e.switcher.callbackEnabled.freq&&(null===(i=(o=e.switcher.callback).freq)||void 0===i||i.call(o,a)))}),100)}}})),e.isBufferedEntry=!1}Le((function(e){var t={isBufferedEntry:!0,securityPolicyViolationURLs:function(){var e=[];return document.addEventListener("securitypolicyviolation",(function(t){var r=b(t.blockedURI);r&&"report"!==t.disposition&&-1===e.indexOf(r.href)&&(100===e.length&&e.shift(),e.push(r.href))})),e}(),switcher:e},r=ho?new PerformanceObserver((function(e){return yo(t,e)})):null;try{null==r||r.observe({type:"resource",buffered:!0})}catch(e){yo(t,{getEntries:function(){return performance.getEntriesByType("resource")}}),null==r||r.observe({entryTypes:["resource"]})}}));var mo=function(e,t,r){var n,i,a=e.fpBody,c=void 0===a?0:a,l=e.rawVal,f=void 0===l?[]:l,p=r.sw,d=r.region,h=t.getReporter();!function(){Ye(this,void 0,void 0,ue().mark((function e(){var t,r;return ue().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=document.currentScript?document.currentScript.src.split("/").slice(0,-1).join("/"):""){e.next=3;break}return e.abrupt("return");case 3:return r="".concat(t,"/devtools.js"),e.prev=4,e.next=7,k(r,"to-json-schema");case 7:n=e.sent,e.next=13;break;case 10:e.prev=10,e.t0=e.catch(4),h.reportError(e.t0);case 13:case"end":return e.stop()}}),e,null,[[4,10]])})))}(),navigator&&"serviceWorker"in navigator&&p&&navigator.serviceWorker.register((i=p,i.startsWith("http")?i:"".concat(location.origin).concat(i))).then((function(e){return e.active})).catch((function(e){var t;h.report("sw_register_fail",{count:1},{reason:null!==(t=null==e?void 0:e.message)&&void 0!==t?t:""})})),t.registerHandler(o,Le((function(e,t,r){var o,i,a,u,s=null==e?void 0:e.eventDetail;if(s){var l=s.body,p=s.contentType,v=void 0===p?null!==(i=null===(o=s.header_map)||void 0===o?void 0:o["content-type"])&&void 0!==i?i:"":p,y=s.request_host,m=s.request_url,g=s.header_map,b=s.search,w=Ve(s,["body","contentType","request_host","request_url","header_map","search"]);g=function(e){var t={};for(var r in e){var n=e[r];X(r,n)||(t[r]=n)}return t}(null!=g?g:{}),w.header_names=Object.keys(g).join(",");var _="",O="";if(y!==Ge.domain||-1===b.indexOf(Ge.bid)){var E,j;if(w.rule_name&&-1!==w.rule_name.indexOf(",")&&(w.rule_name=(E=w.rule_name.split(","),j=E.reduce((function(e,t){return e[t]=null,e}),{}),Object.keys(j)).join(",")),v&&l&&(!fo.some((function(e){return y.endsWith(e)}))||Pe(c))){var S=w.source===V&&"string"==typeof l;if((S||-1!==v.indexOf("application/json"))&&n){var k;try{k="string"==typeof l?JSON.parse(l):JSON.parse(JSON.stringify(l))}catch(e){if(!S)throw e}void 0!==k&&(_=JSON.stringify(n(k,function(e,t){var r,n=[],o=_e(e);try{for(o.s();!(r=o.n()).done;){var i=r.value;i.endpoint.indexOf(t)>-1&&n.push.apply(n,ge(i.keyPath.map((function(e){return e.split(".")}))))}}catch(e){o.e(e)}finally{o.f()}return n}(f,m.split("?")[0]))))}else if(v.includes("application/x-www-form-urlencoded")||v.includes("multipart/form-data")||l instanceof FormData||l instanceof URLSearchParams){var x=[];"function"==typeof l.forEach?l.forEach((function(e,t){x.push(t)})):"object"===ce(l)&&x.push.apply(x,ge(Object.keys(l))),O=x.join(",")}}for(var R={region:null!=d?d:"",sw_version:null!==(a=null==e?void 0:e.sw_version)&&void 0!==a?a:"",request_content_type:null!=v?v:"",request_json_body:_,request_form_keys:O,request_host:y,request_url:m,header_map:JSON.stringify(g)},A=0,C=Object.keys(w);A2&&void 0!==arguments[2]?arguments[2]:e,i=arguments.length>3?arguments[3]:void 0,a={eventName:t,eventDetail:r,source:o,options:i},u=this.eventHandlers[a.eventName]||[],c=_e(u);try{for(c.s();!(n=c.n()).done;){var s=n.value;Le(s)(a.eventDetail,a.source,a.options)}}catch(e){c.e(e)}finally{c.f()}}},{key:"init",value:function(){var e=S();if(!e)return B.warn("monitor exit due to no global context"),void this.reporter.reportAbnormality(Me);e.pushEvent=this.dispatchEvent.bind(this),e.pushError=this.reporter.reportError.bind(this.reporter);for(var t=e.pendingEvents,r=void 0===t?[]:t,n=e.errors,o=void 0===n?[]:n;null==r?void 0:r.length;){var i=r.shift();this.dispatchEvent(i.eventName,i.eventDetail,i.source,i.options)}for(;null==o?void 0:o.length;){var a=o.shift();this.reporter.reportError(a)}this.reporter.reportPreloadScript()}},{key:"registerDefaultHandlers",value:function(){var e=this;this.registerHandler(l,(function(t){e.reporter.reportCustomizedEvent(l,t.metrics,t.categories)}))}}]),t}();function wo(e,t){var r=new bo(t),n=Fe(),o=(n.cookie,n.storage),i=(n.webapi,n.network);so(0,r),function(e,t){Ze&&t.registerHandler(a,et(e,t.getReporter()))}(o,r),lo(0,r),mo(i,r,e),go(r),r.init()}try{!function(e,r){return function(){var n=Date.now(),o=e.apply(void 0,arguments);return E().pushEvent(l,{metrics:{time:Date.now()-n},categories:{version:"1.0.0.860",runtime_env:t,module:r}}),o}}((function(){var e=E(),t=qe(),r=t.business,n=t.env,o=t.region;if(o){Ge.setRegion(o);var i=Ge.domain,a=Fe().reporter,u=new Ct({domain:i,wait:null==a?void 0:a.interval,size:null==a?void 0:a.size});u.config({business:r,env:n}),co(e,t,u),wo(t,u)}}),"core")()}catch(e){U.error("[PumbaaWeb] core execute failed. Errors below.",e)}}();