posthog-js 1.28.0 → 1.29.0

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/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 1.29.0 - 2022-08-16
2
+
3
+ - fix: Use rollup and fix define module issues (#434)
4
+
1
5
  ## 1.27.0 - 2022-08-01
2
6
 
3
7
  - refactor: Dummy commit to trigger release (#431)
package/README.md CHANGED
@@ -17,7 +17,7 @@ Testing on IE11 requires a bit more setup.
17
17
 
18
18
  1. Run `posthog` locally on port 8000 (`DEBUG=1 TEST=1 ./bin/start`).
19
19
  2. Run `python manage.py setup_dev --no-data` on posthog repo, which sets up a demo account.
20
- 3. Optional: rebuild array.js on changes: `nodemon -w src/ --exec bash -c "yarn build-array"`.
20
+ 3. Optional: rebuild array.js on changes: `nodemon -w src/ --exec bash -c "yarn build-rollup"`.
21
21
  4. Export browserstack credentials: `export BROWSERSTACK_USERNAME=xxx BROWSERSTACK_ACCESS_KEY=xxx`.
22
22
  5. Run tests: `npx testcafe "browserstack:ie" testcafe/e2e.spec.js`.
23
23
 
package/dist/array.js CHANGED
@@ -1,60 +1,2 @@
1
- parcelRequire=function(e,r,t,n){var i,o="function"==typeof parcelRequire&&parcelRequire,u="function"==typeof require&&require;function f(t,n){if(!r[t]){if(!e[t]){var i="function"==typeof parcelRequire&&parcelRequire;if(!n&&i)return i(t,!0);if(o)return o(t,!0);if(u&&"string"==typeof t)return u(t);var c=new Error("Cannot find module '"+t+"'");throw c.code="MODULE_NOT_FOUND",c}p.resolve=function(r){return e[t][1][r]||r},p.cache={};var l=r[t]=new f.Module(t);e[t][0].call(l.exports,p,l,l.exports,this)}return r[t].exports;function p(e){return f(p.resolve(e))}}f.isParcelRequire=!0,f.Module=function(e){this.id=e,this.bundle=f,this.exports={}},f.modules=e,f.cache=r,f.parent=o,f.register=function(r,t){e[r]=[function(e,r){r.exports=t},{}]};for(var c=0;c<t.length;c++)try{f(t[c])}catch(e){i||(i=e)}if(t.length){var l=f(t[t.length-1]);"object"==typeof exports&&"undefined"!=typeof module?module.exports=l:"function"==typeof define&&define.amd?define(function(){return l}):n&&(this[n]=l)}if(parcelRequire=f,i)throw i;return f}({"iwXh":[function(require,module,exports) {
2
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.LZString=void 0;var o=String.fromCharCode,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",n={};function t(o,r){if(!n[o]){n[o]={};for(var e=0;e<o.length;e++)n[o][o.charAt(e)]=e}return n[o][r]}var s={compressToBase64:function(o){if(null==o)return"";var e=s._compress(o,6,function(o){return r.charAt(o)});switch(e.length%4){default:case 0:return e;case 1:return e+"===";case 2:return e+"==";case 3:return e+"="}},decompressFromBase64:function(o){return null==o?"":""==o?null:s._decompress(o.length,32,function(e){return t(r,o.charAt(e))})},compressToUTF16:function(r){return null==r?"":s._compress(r,15,function(r){return o(r+32)})+" "},decompressFromUTF16:function(o){return null==o?"":""==o?null:s._decompress(o.length,16384,function(r){return o.charCodeAt(r)-32})},compressToUint8Array:function(o){for(var r=s.compress(o),e=new Uint8Array(2*r.length),n=0,t=r.length;n<t;n++){var i=r.charCodeAt(n);e[2*n]=i>>>8,e[2*n+1]=i%256}return e},decompressFromUint8Array:function(r){if(null==r)return s.decompress(r);for(var e=new Array(r.length/2),n=0,t=e.length;n<t;n++)e[n]=256*r[2*n]+r[2*n+1];var i=[];return e.forEach(function(r){i.push(o(r))}),s.decompress(i.join(""))},compressToEncodedURIComponent:function(o){return null==o?"":s._compress(o,6,function(o){return e.charAt(o)})},decompressFromEncodedURIComponent:function(o){return null==o?"":""==o?null:(o=o.replace(/ /g,"+"),s._decompress(o.length,32,function(r){return t(e,o.charAt(r))}))},compress:function(r){return s._compress(r,16,function(r){return o(r)})},_compress:function(o,r,e){if(null==o)return"";var n,t,s,i="",p="",c="",a=2,u=3,l=2,f=0,h=0,d={},m={},v=[];for(s=0;s<o.length;s+=1)if(i=o.charAt(s),Object.prototype.hasOwnProperty.call(d,i)||(d[i]=u++,m[i]=!0),p=c+i,Object.prototype.hasOwnProperty.call(d,p))c=p;else{if(Object.prototype.hasOwnProperty.call(m,c)){if(c.charCodeAt(0)<256){for(n=0;n<l;n++)f<<=1,h==r-1?(h=0,v.push(e(f)),f=0):h++;for(t=c.charCodeAt(0),n=0;n<8;n++)f=f<<1|1&t,h==r-1?(h=0,v.push(e(f)),f=0):h++,t>>=1}else{for(t=1,n=0;n<l;n++)f=f<<1|t,h==r-1?(h=0,v.push(e(f)),f=0):h++,t=0;for(t=c.charCodeAt(0),n=0;n<16;n++)f=f<<1|1&t,h==r-1?(h=0,v.push(e(f)),f=0):h++,t>>=1}0==--a&&(a=Math.pow(2,l),l++),delete m[c]}else for(t=d[c],n=0;n<l;n++)f=f<<1|1&t,h==r-1?(h=0,v.push(e(f)),f=0):h++,t>>=1;0==--a&&(a=Math.pow(2,l),l++),d[p]=u++,c=String(i)}if(""!==c){if(Object.prototype.hasOwnProperty.call(m,c)){if(c.charCodeAt(0)<256){for(n=0;n<l;n++)f<<=1,h==r-1?(h=0,v.push(e(f)),f=0):h++;for(t=c.charCodeAt(0),n=0;n<8;n++)f=f<<1|1&t,h==r-1?(h=0,v.push(e(f)),f=0):h++,t>>=1}else{for(t=1,n=0;n<l;n++)f=f<<1|t,h==r-1?(h=0,v.push(e(f)),f=0):h++,t=0;for(t=c.charCodeAt(0),n=0;n<16;n++)f=f<<1|1&t,h==r-1?(h=0,v.push(e(f)),f=0):h++,t>>=1}0==--a&&(a=Math.pow(2,l),l++),delete m[c]}else for(t=d[c],n=0;n<l;n++)f=f<<1|1&t,h==r-1?(h=0,v.push(e(f)),f=0):h++,t>>=1;0==--a&&(a=Math.pow(2,l),l++)}for(t=2,n=0;n<l;n++)f=f<<1|1&t,h==r-1?(h=0,v.push(e(f)),f=0):h++,t>>=1;for(;;){if(f<<=1,h==r-1){v.push(e(f));break}h++}return v.join("")},decompress:function(o){return null==o?"":""==o?null:s._decompress(o.length,32768,function(r){return o.charCodeAt(r)})},_decompress:function(r,e,n){var t,s,i,p,c,a,u,l=[],f=[],h={val:n(0),position:e,index:1},d=4,m=4,v=3,w="";for(t=0;t<3;t+=1)l[t]=t;for(i=0,c=Math.pow(2,2),a=1;a!=c;)p=h.val&h.position,h.position>>=1,0==h.position&&(h.position=e,h.val=n(h.index++)),i|=(p>0?1:0)*a,a<<=1;switch(i){case 0:for(i=0,c=Math.pow(2,8),a=1;a!=c;)p=h.val&h.position,h.position>>=1,0==h.position&&(h.position=e,h.val=n(h.index++)),i|=(p>0?1:0)*a,a<<=1;u=o(i);break;case 1:for(i=0,c=Math.pow(2,16),a=1;a!=c;)p=h.val&h.position,h.position>>=1,0==h.position&&(h.position=e,h.val=n(h.index++)),i|=(p>0?1:0)*a,a<<=1;u=o(i);break;case 2:return""}for(l[3]=u,s=u,f.push(u);;){if(h.index>r)return"";for(i=0,c=Math.pow(2,v),a=1;a!=c;)p=h.val&h.position,h.position>>=1,0==h.position&&(h.position=e,h.val=n(h.index++)),i|=(p>0?1:0)*a,a<<=1;switch(u=i){case 0:for(i=0,c=Math.pow(2,8),a=1;a!=c;)p=h.val&h.position,h.position>>=1,0==h.position&&(h.position=e,h.val=n(h.index++)),i|=(p>0?1:0)*a,a<<=1;l[m++]=o(i),u=m-1,d--;break;case 1:for(i=0,c=Math.pow(2,16),a=1;a!=c;)p=h.val&h.position,h.position>>=1,0==h.position&&(h.position=e,h.val=n(h.index++)),i|=(p>0?1:0)*a,a<<=1;l[m++]=o(i),u=m-1,d--;break;case 2:return f.join("")}if(0==d&&(d=Math.pow(2,v),v++),l[u])w=l[u];else{if(u!==m)return null;w=s+s.charAt(0)}f.push(w),l[m++]=s+w.charAt(0),s=w,0==--d&&(d=Math.pow(2,v),v++)}}};exports.LZString=s;
3
- },{}],"EHrm":[function(require,module,exports) {
4
- module.exports={name:"posthog-js",version:"1.28.0",description:"Posthog-js allows you to automatically capture usage and send events to PostHog.",repository:"https://github.com/PostHog/posthog-js",author:"hey@posthog.com",license:"MIT",scripts:{start:"parcel watch src/loader-globals.ts --out-file dist/array.js",serve:"parcel serve src/loader-globals.ts --port 3001 --out-file dist/array.js",build:"yarn build-array && yarn build-rollup && yarn build-react","build-array":"parcel build src/loader-globals.ts --out-file dist/array.js --public-url=/static","build-rollup":"tsc -b && rollup -c","build-react":"cd react; yarn; yarn build;",lint:"eslint ./src/**/*.{ts,js}",prettier:"prettier --write src/**/*",prepublishOnly:"yarn lint && yarn test && yarn build && yarn test-react",test:"jest","test-react":"cd react; yarn test","test-watch":"jest --watch",cypress:"cypress open"},main:"dist/module.js",module:"dist/es.js",types:"dist/module.d.ts",files:["dist/*","react/dist/*"],dependencies:{"@sentry/types":"^7.2.0",fflate:"^0.4.1","rrweb-snapshot":"^1.1.14"},devDependencies:{"@babel/core":"7.18.9","@babel/preset-env":"7.18.9","@babel/preset-typescript":"^7.18.6","@rollup/plugin-babel":"^5.3.1","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^13.3.0","@rollup/plugin-typescript":"^8.3.3","@typescript-eslint/eslint-plugin":"^5.30.7","@typescript-eslint/parser":"^5.30.7","babel-eslint":"10.1.0","babel-jest":"^26.6.3",cypress:"10.3.1",eslint:"8.20.0","eslint-config-prettier":"^8.5.0","eslint-plugin-prettier":"^4.2.1","eslint-plugin-react":"^7.30.1","eslint-plugin-react-hooks":"^4.6.0","fast-check":"^2.17.0",given2:"^2.1.7",husky:"^4.2.5",jest:"^27.5.1",jsdom:"16.2.2","jsdom-global":"3.0.2","lint-staged":"^10.2.11",localStorage:"1.0.4","node-fetch":"^2.6.1",parcel:"1.12.3","posthog-js":"link:.",prettier:"^2.7.1",rollup:"^2.77.0","rollup-plugin-dts":"^4.2.2",rrweb:"^1.1.3",sinon:"9.0.2",testcafe:"^1.19.0","testcafe-browser-provider-browserstack":"^1.14.0",tslib:"^2.4.0",typescript:"^4.7.4"},"lint-staged":{"*.{ts,tsx,js,json}":"prettier --write","*.{ts,tsx}":["eslint --fix","tsc --noEmit --esModuleInterop --jsx react"]}};
5
- },{}],"C9JJ":[function(require,module,exports) {
6
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=require("../package.json"),r={DEBUG:!1,LIB_VERSION:e.version},t=r;exports.default=t;
7
- },{"../package.json":"EHrm"}],"UnXq":[function(require,module,exports) {
8
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports._UUID=exports._HTTPBuildQuery=exports.COPY_IN_PROGRESS_ATTRIBUTE=void 0,exports._base64Encode=N,exports._bind_instance_methods=void 0,exports._copyAndTruncateStrings=q,exports._each=x,exports._eachArray=b,exports._include=exports._getQueryParam=exports._getHashParam=exports._formatDate=exports._extend=exports._encodeDates=void 0,exports._includes=A,exports.window=exports.userAgent=exports.logger=exports.document=exports._utf8Encode=exports._trim=exports._timestamp=exports._strip_empty_properties=exports._safewrap_instance_methods=exports._safewrap_class=exports._safewrap=exports._register_event=exports._isUndefined=exports._isString=exports._isObject=exports._isNumber=exports._isFunction=exports._isEmptyObject=exports._isDate=exports._isBlockedUA=exports._isArray=exports._info=void 0;var r=e(require("./config"));function e(r){return r&&r.__esModule?r:{default:r}}var o=function(r,e){var o="function"==typeof Symbol&&r[Symbol.iterator];if(!o)return r;var t,n,i=o.call(r),a=[];try{for(;(void 0===e||e-- >0)&&!(t=i.next()).done;)a.push(t.value)}catch(s){n={error:s}}finally{try{t&&!t.done&&(o=i.return)&&o.call(i)}finally{if(n)throw n.error}}return a},t=function(r,e,o){if(o||2===arguments.length)for(var t,n=0,i=e.length;n<i;n++)!t&&n in e||(t||(t=Array.prototype.slice.call(e,0,n)),t[n]=e[n]);return r.concat(t||Array.prototype.slice.call(e))},n=Array.prototype,i=Object.prototype,a=i.toString,s=i.hasOwnProperty,c="undefined"!=typeof window?window:{};exports.window=c;var u=c.navigator||{userAgent:""},l=c.document||{};exports.document=l;var d=u.userAgent;exports.userAgent=d;var p=n.forEach,f=n.indexOf,_=Array.isArray,g={},h={log:function(){for(var e=[],o=0;o<arguments.length;o++)e[o]=arguments[o];if(r.default.DEBUG&&!E(window.console)&&window.console){var t="__rrweb_original__"in window.console.log?window.console.log.__rrweb_original__:window.console.log;try{t.apply(window.console,e)}catch(n){b(e,function(r){t(r)})}}},error:function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];if(r.default.DEBUG&&!E(window.console)&&window.console){var i=t(["PostHog error:"],o(e),!1),a="__rrweb_original__"in window.console.error?window.console.error.__rrweb_original__:window.console.error;try{a.apply(window.console,i)}catch(s){b(i,function(r){a(r)})}}},critical:function(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];if(!E(window.console)&&window.console){var n=t(["PostHog error:"],o(r),!1),i="__rrweb_original__"in window.console.error?window.console.error.__rrweb_original__:window.console.error;try{i.apply(window.console,n)}catch(a){b(n,function(r){i(r)})}}}};exports.logger=h;var w=function(r){return r.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")};exports._trim=w;var v=function(r){for(var e in r)"function"==typeof r[e]&&(r[e]=r[e].bind(r))};function x(r,e,o){if(null!=r)if(p&&Array.isArray(r)&&r.forEach===p)r.forEach(e,o);else if("length"in r&&r.length===+r.length){for(var t=0,n=r.length;t<n;t++)if(t in r&&e.call(o,r[t],t)===g)return}else for(var i in r)if(s.call(r,i)&&e.call(o,r[i],i)===g)return}function b(r,e,o){if(Array.isArray(r))if(p&&r.forEach===p)r.forEach(e,o);else if("length"in r&&r.length===+r.length)for(var t=0,n=r.length;t<n;t++)if(t in r&&e.call(o,r[t],t)===g)return}exports._bind_instance_methods=v;var m=function(r){for(var e=[],o=1;o<arguments.length;o++)e[o-1]=arguments[o];return b(e,function(e){for(var o in e)void 0!==e[o]&&(r[o]=e[o])}),r};exports._extend=m;var y=_||function(r){return"[object Array]"===a.call(r)};exports._isArray=y;var S=function(r){try{return/^\s*\bfunction\b/.test(r)}catch(e){return!1}};exports._isFunction=S;var B=function(r,e){var o=!1;return null===r?o:f&&r.indexOf===f?-1!=r.indexOf(e):(x(r,function(r){if(o||(o=r===e))return g}),o)};function A(r,e){return-1!==r.indexOf(e)}exports._include=B;var P=function(r){return r===Object(r)&&!y(r)};exports._isObject=P;var C=function(r){if(P(r)){for(var e in r)if(s.call(r,e))return!1;return!0}return!1};exports._isEmptyObject=C;var E=function(r){return void 0===r};exports._isUndefined=E;var O=function(r){return"[object String]"==a.call(r)};exports._isString=O;var k=function(r){return"[object Date]"==a.call(r)};exports._isDate=k;var U=function(r){return"[object Number]"==a.call(r)};exports._isNumber=U;var M=function r(e){return x(e,function(o,t){k(o)?e[t]=I(o):P(o)&&(e[t]=r(o))}),e};exports._encodeDates=M;var D=function(){return Date.now=Date.now||function(){return+new Date},Date.now()};exports._timestamp=D;var I=function(r){function e(r){return r<10?"0"+r:r}return r.getUTCFullYear()+"-"+e(r.getUTCMonth()+1)+"-"+e(r.getUTCDate())+"T"+e(r.getUTCHours())+":"+e(r.getUTCMinutes())+":"+e(r.getUTCSeconds())};exports._formatDate=I;var T=function(e){return function(){for(var o=[],t=0;t<arguments.length;t++)o[t]=arguments[t];try{return e.apply(this,o)}catch(n){h.critical("Implementation error. Please turn on debug and contact support@posthog.com."),r.default.DEBUG&&h.critical(n)}}};exports._safewrap=T;var $=function(r,e){for(var o=0;o<e.length;o++)r.prototype[e[o]]=T(r.prototype[e[o]])};exports._safewrap_class=$;var F=function(r){for(var e in r)"function"==typeof r[e]&&(r[e]=T(r[e]))};exports._safewrap_instance_methods=F;var R=function(r){var e={};return x(r,function(r,o){O(r)&&r.length>0&&(e[o]=r)}),e};exports._strip_empty_properties=R;var j="undefined"!=typeof Symbol?Symbol("__deepCircularCopyInProgress__"):"__deepCircularCopyInProgress__";function W(r,e,o){return r!==Object(r)?e?e(r,o):r:r[j]?void 0:(r[j]=!0,y(r)?(t=[],b(r,function(r){t.push(W(r,e))})):(t={},x(r,function(r,o){o!==j&&(t[o]=W(r,e,o))})),delete r[j],t);var t}exports.COPY_IN_PROGRESS_ATTRIBUTE=j;var H=["$performance_raw"];function q(r,e){return W(r,function(r,o){return o&&H.indexOf(o)>-1?r:"string"==typeof r&&null!==e?r.slice(0,e):r})}function N(r){var e,o,t,n,i,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",s=0,c=0,u="",l=[];if(!r)return r;r=V(r);do{e=(i=r.charCodeAt(s++)<<16|r.charCodeAt(s++)<<8|r.charCodeAt(s++))>>18&63,o=i>>12&63,t=i>>6&63,n=63&i,l[c++]=a.charAt(e)+a.charAt(o)+a.charAt(t)+a.charAt(n)}while(s<r.length);switch(u=l.join(""),r.length%3){case 1:u=u.slice(0,-2)+"==";break;case 2:u=u.slice(0,-1)+"="}return u}var V=function(r){var e,o,t,n,i="";for(e=o=0,t=(r=(r+"").replace(/\r\n/g,"\n").replace(/\r/g,"\n")).length,n=0;n<t;n++){var a=r.charCodeAt(n),s=null;a<128?o++:s=a>127&&a<2048?String.fromCharCode(a>>6|192,63&a|128):String.fromCharCode(a>>12|224,a>>6&63|128,63&a|128),null!==s&&(o>e&&(i+=r.substring(e,o)),i+=s,e=o=n+1)}return o>e&&(i+=r.substring(e,r.length)),i};exports._utf8Encode=V;var G=function(){var r=function(){for(var r=(new Date).valueOf(),e=0;r==(new Date).valueOf();)e++;return r.toString(16)+e.toString(16)};return function(){var e=(window.screen.height*window.screen.width).toString(16);return r()+"-"+Math.random().toString(16).replace(".","")+"-"+function(){var r,e,o=d,t=0,n=[];function i(r,e){var o,t=0;for(o=0;o<e.length;o++)t|=n[o]<<8*o;return r^t}for(r=0;r<o.length;r++)e=o.charCodeAt(r),n.unshift(255&e),n.length>=4&&(t=i(t,n),n=[]);return n.length>0&&(t=i(t,n)),t.toString(16)}()+"-"+e+"-"+r()}}();exports._UUID=G;var L=function(r){return!!/(google web preview|baiduspider|yandexbot|bingbot|googlebot|yahoo! slurp|ahrefsbot|facebookexternalhit|facebookcatalog)/i.test(r)};exports._isBlockedUA=L;var K=function(r,e){var o,t;void 0===e&&(e="&");var n=[];return x(r,function(r,e){o=encodeURIComponent(r.toString()),t=encodeURIComponent(e),n[n.length]=t+"="+o}),n.join(e)};exports._HTTPBuildQuery=K;var Q=function(r,e){var o=e.replace(/[[]/,"\\[").replace(/[\]]/,"\\]"),t=new RegExp("[\\?&]"+o+"=([^&#]*)").exec(r);if(null===t||t&&"string"!=typeof t[1]&&t[1].length)return"";var n=t[1];try{n=decodeURIComponent(n)}catch(i){h.error("Skipping decoding for malformed query param: "+n)}return n.replace(/\+/g," ")};exports._getQueryParam=Q;var Y=function(r,e){var o=r.match(new RegExp(e+"=([^&]*)"));return o?o[1]:null};exports._getHashParam=Y;var z=function(){function r(e){return e&&(e.preventDefault=r.preventDefault,e.stopPropagation=r.stopPropagation),e}return r.preventDefault=function(){this.returnValue=!1},r.stopPropagation=function(){this.cancelBubble=!0},function(e,o,t,n,i){if(e)if(e.addEventListener&&!n)e.addEventListener(o,t,!!i);else{var a="on"+o,s=e[a];e[a]=function(e,o,t){return function(n){if(n=n||r(window.event)){var i,a=!0;S(t)&&(i=t(n));var s=o.call(e,n);return!1!==i&&!1!==s||(a=!1),a}}}(e,t,s)}else h.error("No valid element provided to register_event")}}();exports._register_event=z;var X={campaignParams:function(){var r="utm_source utm_medium utm_campaign utm_content utm_term gclid fbclid msclkid".split(" "),e={};return x(r,function(r){var o=Q(l.URL,r);o.length&&(e[r]=o)}),e},searchEngine:function(r){return 0===r.search("https?://(.*)google.([^/?]*)")?"google":0===r.search("https?://(.*)bing.com")?"bing":0===r.search("https?://(.*)yahoo.com")?"yahoo":0===r.search("https?://(.*)duckduckgo.com")?"duckduckgo":null},searchInfo:function(r){var e=X.searchEngine(r),o="yahoo"!=e?"q":"p",t={};if(null!==e){t.$search_engine=e;var n=Q(r,o);n.length&&(t.ph_keyword=n)}return t},browser:function(r,e,o){return e=e||"",o||A(r," OPR/")?A(r,"Mini")?"Opera Mini":"Opera":/(BlackBerry|PlayBook|BB10)/i.test(r)?"BlackBerry":A(r,"IEMobile")||A(r,"WPDesktop")?"Internet Explorer Mobile":A(r,"SamsungBrowser/")?"Samsung Internet":A(r,"Edge")||A(r,"Edg/")?"Microsoft Edge":A(r,"FBIOS")?"Facebook Mobile":A(r,"Chrome")?"Chrome":A(r,"CriOS")?"Chrome iOS":A(r,"UCWEB")||A(r,"UCBrowser")?"UC Browser":A(r,"FxiOS")?"Firefox iOS":A(e,"Apple")?A(r,"Mobile")?"Mobile Safari":"Safari":A(r,"Android")?"Android Mobile":A(r,"Konqueror")?"Konqueror":A(r,"Firefox")?"Firefox":A(r,"MSIE")||A(r,"Trident/")?"Internet Explorer":A(r,"Gecko")?"Mozilla":""},browserVersion:function(r,e,o){var t={"Internet Explorer Mobile":/rv:(\d+(\.\d+)?)/,"Microsoft Edge":/Edge?\/(\d+(\.\d+)?)/,Chrome:/Chrome\/(\d+(\.\d+)?)/,"Chrome iOS":/CriOS\/(\d+(\.\d+)?)/,"UC Browser":/(UCBrowser|UCWEB)\/(\d+(\.\d+)?)/,Safari:/Version\/(\d+(\.\d+)?)/,"Mobile Safari":/Version\/(\d+(\.\d+)?)/,Opera:/(Opera|OPR)\/(\d+(\.\d+)?)/,Firefox:/Firefox\/(\d+(\.\d+)?)/,"Firefox iOS":/FxiOS\/(\d+(\.\d+)?)/,Konqueror:/Konqueror:(\d+(\.\d+)?)/,BlackBerry:/BlackBerry (\d+(\.\d+)?)/,"Android Mobile":/android\s(\d+(\.\d+)?)/,"Samsung Internet":/SamsungBrowser\/(\d+(\.\d+)?)/,"Internet Explorer":/(rv:|MSIE )(\d+(\.\d+)?)/,Mozilla:/rv:(\d+(\.\d+)?)/}[X.browser(r,e,o)];if(void 0===t)return null;var n=r.match(t);return n?parseFloat(n[n.length-2]):null},os:function(){var r=d;return/Windows/i.test(r)?/Phone/.test(r)||/WPDesktop/.test(r)?"Windows Phone":"Windows":/(iPhone|iPad|iPod)/.test(r)?"iOS":/Android/.test(r)?"Android":/(BlackBerry|PlayBook|BB10)/i.test(r)?"BlackBerry":/Mac/i.test(r)?"Mac OS X":/Linux/.test(r)?"Linux":/CrOS/.test(r)?"Chrome OS":""},device:function(r){return/Windows Phone/i.test(r)||/WPDesktop/.test(r)?"Windows Phone":/iPad/.test(r)?"iPad":/iPod/.test(r)?"iPod Touch":/iPhone/.test(r)?"iPhone":/(BlackBerry|PlayBook|BB10)/i.test(r)?"BlackBerry":/Android/.test(r)&&!/Mobile/.test(r)?"Android Tablet":/Android/.test(r)?"Android":""},deviceType:function(r){var e=this.device(r);return"iPad"===e||"Android Tablet"===e?"Tablet":e?"Mobile":"Desktop"},referringDomain:function(r){var e=r.split("/");return e.length>=3?e[2]:""},properties:function(){return m(R({$os:X.os(),$browser:X.browser(d,u.vendor,window.opera),$device:X.device(d),$device_type:X.deviceType(d)}),{$current_url:window.location.href,$host:window.location.host,$pathname:window.location.pathname,$browser_version:X.browserVersion(d,u.vendor,window.opera),$screen_height:window.screen.height,$screen_width:window.screen.width,$viewport_height:window.innerHeight,$viewport_width:window.innerWidth,$lib:"web",$lib_version:r.default.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:D()/1e3})},people_properties:function(){return m(R({$os:X.os(),$browser:X.browser(d,u.vendor,window.opera)}),{$browser_version:X.browserVersion(d,u.vendor,window.opera)})}};exports._info=X;
9
- },{"./config":"C9JJ"}],"h4lk":[function(require,module,exports) {
10
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getClassName=r,exports.getSafeText=n,exports.isAngularStyleAttr=f,exports.isDocumentFragment=u,exports.isElementNode=o,exports.isSensitiveElement=l,exports.isTag=s,exports.isTextNode=i,exports.loadScript=m,exports.shouldCaptureDomEvent=a,exports.shouldCaptureElement=p,exports.shouldCaptureValue=d,exports.usefulElements=void 0;var e=require("./utils");function t(e){return(t="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})(e)}function r(e){switch(t(e.className)){case"string":return e.className;case"object":return("baseVal"in e.className?e.className.baseVal:null)||e.getAttribute("class")||"";default:return""}}function n(t){var r="";return p(t)&&!l(t)&&t.childNodes&&t.childNodes.length&&(0,e._each)(t.childNodes,function(t){i(t)&&t.textContent&&(r+=(0,e._trim)(t.textContent).split(/(\s+)/).filter(d).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255))}),(0,e._trim)(r)}function o(e){return!!e&&1===e.nodeType}function s(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function i(e){return!!e&&3===e.nodeType}function u(e){return!!e&&11===e.nodeType}var c=["a","button","form","input","select","textarea","label"];function a(e,t){if(!e||s(e,"html")||!o(e))return!1;for(var r=!1,n=[e],i=!0,a=e;a.parentNode&&!s(a,"body");)if(u(a.parentNode))n.push(a.parentNode.host),a=a.parentNode.host;else{if(!(i=a.parentNode||!1))break;if(c.indexOf(i.tagName.toLowerCase())>-1)r=!0;else{var p=window.getComputedStyle(i);p&&"pointer"===p.getPropertyValue("cursor")&&(r=!0)}n.push(i),a=i}var l=window.getComputedStyle(e);if(l&&"pointer"===l.getPropertyValue("cursor")&&"click"===t.type)return!0;var d=e.tagName.toLowerCase();switch(d){case"html":return!1;case"form":return"submit"===t.type;case"input":return"change"===t.type||"click"===t.type;case"select":case"textarea":return"change"===t.type||"click"===t.type;default:return r?"click"===t.type:"click"===t.type&&(c.indexOf(d)>-1||"true"===e.getAttribute("contenteditable"))}}function p(t){for(var n=t;n.parentNode&&!s(n,"body");n=n.parentNode){var o=r(n).split(" ");if((0,e._includes)(o,"ph-sensitive")||(0,e._includes)(o,"ph-no-capture"))return!1}if((0,e._includes)(r(t).split(" "),"ph-include"))return!0;var i=t.type||"";if("string"==typeof i)switch(i.toLowerCase()){case"hidden":case"password":return!1}var u=t.name||t.id||"";if("string"==typeof u){if(/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(u.replace(/[^a-zA-Z0-9]/g,"")))return!1}return!0}function l(e){return!!(s(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||s(e,"select")||s(e,"textarea")||"true"===e.getAttribute("contenteditable"))}function d(t){if(null===t||(0,e._isUndefined)(t))return!1;if("string"==typeof t){t=(0,e._trim)(t);if(/^(?:(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11}))$/.test((t||"").replace(/[- ]/g,"")))return!1;if(/(^\d{3}-?\d{2}-?\d{4}$)/.test(t))return!1}return!0}function f(e){return"string"==typeof e&&("_ngcontent"===e.substring(0,10)||"_nghost"===e.substring(0,7))}function m(e,t){var r,n=document.createElement("script");n.type="text/javascript",n.src=e,n.onload=t;var o=document.getElementsByTagName("script");o.length>0?null===(r=o[0].parentNode)||void 0===r||r.insertBefore(n,o[0]):document.body.appendChild(n)}exports.usefulElements=c;
11
- },{"./utils":"UnXq"}],"SHfu":[function(require,module,exports) {
12
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=30,i=1e3,e=3,s=function(){function s(t,i){void 0===i&&(i=t.get_config("rageclick")),this.clicks=[],this.instance=t,this.enabled=i}return s.prototype.click=function(s,c,a){if(this.enabled){var l=this.clicks[this.clicks.length-1];l&&Math.abs(s-l.x)+Math.abs(c-l.y)<t&&a-l.timestamp<i?(this.clicks.push({x:s,y:c,timestamp:a}),this.clicks.length===e&&this.instance.capture("$rageclick")):this.clicks=[{x:s,y:c,timestamp:a}]}},s}(),c=s;exports.default=c;
13
- },{}],"+QN3":[function(require,module,exports) {
14
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.autocapture=void 0;var e=require("./utils"),t=require("./autocapture-utils"),n=r(require("./extensions/rageclick"));function r(e){return e&&e.__esModule?e:{default:e}}var i={_initializedTokens:[],_previousElementSibling:function(e){if(e.previousElementSibling)return e.previousElementSibling;var n=e;do{n=n.previousSibling}while(n&&!(0,t.isElementNode)(n));return n},_getPropertiesFromElement:function(n,r,i){var o=n.tagName.toLowerCase(),a={tag_name:o};t.usefulElements.indexOf(o)>-1&&!i&&(a.$el_text=(0,t.getSafeText)(n));var u=(0,t.getClassName)(n);u.length>0&&(a.classes=u.split(" ").filter(function(e){return""!==e})),(0,e._each)(n.attributes,function(e){(0,t.isSensitiveElement)(n)&&-1===["name","id","class"].indexOf(e.name)||r||!(0,t.shouldCaptureValue)(e.value)||(0,t.isAngularStyleAttr)(e.name)||(a["attr__"+e.name]=e.value)});for(var s=1,l=1,c=n;c=this._previousElementSibling(c);)s++,c.tagName===n.tagName&&l++;return a.nth_child=s,a.nth_of_type=l,a},_getDefaultProperties:function(e){return{$event_type:e,$ce_version:1}},_extractCustomPropertyValue:function(n){var r=[];return(0,e._each)(document.querySelectorAll(n.css_selector),function(e){var n;["input","select"].indexOf(e.tagName.toLowerCase())>-1?n=e.value:e.textContent&&(n=e.textContent),(0,t.shouldCaptureValue)(n)&&r.push(n)}),r.join(", ")},_getCustomProperties:function(n){var r=this,i={};return(0,e._each)(this._customProperties,function(o){(0,e._each)(o.event_selectors,function(a){var u=document.querySelectorAll(a);(0,e._each)(u,function(a){(0,e._includes)(n,a)&&(0,t.shouldCaptureElement)(a)&&(i[o.name]=r._extractCustomPropertyValue(o))})})}),i},_getEventTarget:function(e){var t;return void 0===e.target?e.srcElement||null:(null===(t=e.target)||void 0===t?void 0:t.shadowRoot)?e.composedPath()[0]||null:e.target||null},_captureEvent:function(n,r){var i,o=this,a=this._getEventTarget(n);if((0,t.isTextNode)(a)&&(a=a.parentNode||null),"click"===n.type&&n instanceof MouseEvent&&(null===(i=this.rageclicks)||void 0===i||i.click(n.clientX,n.clientY,(new Date).getTime())),a&&(0,t.shouldCaptureDomEvent)(a,n)){for(var u=[a],s=a;s.parentNode&&!(0,t.isTag)(s,"body");)(0,t.isDocumentFragment)(s.parentNode)?(u.push(s.parentNode.host),s=s.parentNode.host):(u.push(s.parentNode),s=s.parentNode);var l,c=[],_=!1;if((0,e._each)(u,function(n){var i=(0,t.shouldCaptureElement)(n);"a"===n.tagName.toLowerCase()&&(l=n.getAttribute("href"),l=i&&(0,t.shouldCaptureValue)(l)&&l);var a=(0,t.getClassName)(n).split(" ");(0,e._includes)(a,"ph-no-capture")&&(_=!0),c.push(o._getPropertiesFromElement(n,r.get_config("mask_all_element_attributes"),r.get_config("mask_all_text")))}),r.get_config("mask_all_text")||(c[0].$el_text=(0,t.getSafeText)(a)),l&&(c[0].attr__href=l),_)return!1;var d=(0,e._extend)(this._getDefaultProperties(n.type),{$elements:c},this._getCustomProperties(u));return r.capture("$autocapture",d),!0}},_navigate:function(e){window.location.href=e},_addDomEventHandlers:function(t){var n=this,r=function(e){e=e||window.event,n._captureEvent(e,t)};(0,e._register_event)(document,"submit",r,!1,!0),(0,e._register_event)(document,"change",r,!1,!0),(0,e._register_event)(document,"click",r,!1,!0)},_customProperties:[],rageclicks:null,init:function(e){this.rageclicks=new n.default(e)},afterDecideResponse:function(t,n){var r=n.get_config("token");this._initializedTokens.indexOf(r)>-1?e.logger.log('autocapture already initialized for token "'+r+'"'):(this._initializedTokens.push(r),t&&t.config&&t.config.enable_collect_everything&&n.get_config("autocapture")?(t.custom_properties&&(this._customProperties=t.custom_properties),this._addDomEventHandlers(n)):n.__autocapture_enabled=!1)},enabledForProject:function(t,n,r){if(!t)return!0;n=(0,e._isUndefined)(n)?10:n,r=(0,e._isUndefined)(r)?10:r;for(var i=0,o=0;o<t.length;o++)i+=t.charCodeAt(o);return i%n<r},isBrowserSupported:function(){return(0,e._isFunction)(document.querySelectorAll)}};exports.autocapture=i,(0,e._bind_instance_methods)(i),(0,e._safewrap_instance_methods)(i);
15
- },{"./utils":"UnXq","./autocapture-utils":"h4lk","./extensions/rageclick":"SHfu"}],"1GYW":[function(require,module,exports) {
16
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.sessionStore=exports.resetSessionStorageSupported=exports.memoryStore=exports.localStore=exports.localPlusCookieStore=exports.cookieStore=void 0;var r=require("./utils"),e=t(require("./config"));function t(r){return r&&r.__esModule?r:{default:r}}var o=function(){return(o=Object.assign||function(r){for(var e,t=1,o=arguments.length;t<o;t++)for(var n in e=arguments[t])Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r}).apply(this,arguments)},n=/[a-z0-9][a-z0-9-]+\.[a-z.]{2,6}$/i,i={is_supported:function(){return!0},error:function(e){r.logger.error("cookieStore error: "+e)},get:function(r){try{for(var e=r+"=",t=document.cookie.split(";"),o=0;o<t.length;o++){for(var n=t[o];" "==n.charAt(0);)n=n.substring(1,n.length);if(0===n.indexOf(e))return decodeURIComponent(n.substring(e.length,n.length))}}catch(i){}return null},parse:function(r){var e;try{e=JSON.parse(i.get(r))||{}}catch(t){}return e},set:function(r,e,t,o,i){try{var c="",s="",u="";if(o){var a=document.location.hostname.match(n),l=a?a[0]:"";c=l?"; domain=."+l:""}if(t){var p=new Date;p.setTime(p.getTime()+24*t*60*60*1e3),s="; expires="+p.toUTCString()}i&&(u="; secure");var f=r+"="+encodeURIComponent(JSON.stringify(e))+s+"; path=/"+c+u;return document.cookie=f,f}catch(g){return}},remove:function(r,e){try{i.set(r,"",-1,e)}catch(t){return}}};exports.cookieStore=i;var c=null,s={is_supported:function(){if(null!==c)return c;var e=!0;if(window)try{var t="__mplssupport__";s.set(t,"xyz"),'"xyz"'!==s.get(t)&&(e=!1),s.remove(t)}catch(o){e=!1}else e=!1;return e||r.logger.error("localStorage unsupported; falling back to cookie store"),c=e,e},error:function(e){r.logger.error("localStorage error: "+e)},get:function(r){try{return window.localStorage.getItem(r)}catch(e){s.error(e)}return null},parse:function(r){try{return JSON.parse(s.get(r))||{}}catch(e){}return null},set:function(r,e){try{window.localStorage.setItem(r,JSON.stringify(e))}catch(t){s.error(t)}},remove:function(r){try{window.localStorage.removeItem(r)}catch(e){s.error(e)}}};exports.localStore=s;var u=o(o({},s),{parse:function(e){try{var t={};try{(t=i.parse(e)||{}).distinct_id&&i.set(e,{distinct_id:t.distinct_id})}catch(n){}var o=(0,r._extend)(t,JSON.parse(s.get(e)||"{}"));return s.set(e,o),o}catch(n){}return null},set:function(r,e,t,o,n){try{s.set(r,e),e.distinct_id&&i.set(r,{distinct_id:e.distinct_id},t,o,n)}catch(c){s.error(c)}},remove:function(r,e){try{window.localStorage.removeItem(r),i.remove(r,e)}catch(t){s.error(t)}}});exports.localPlusCookieStore=u;var a={},l={is_supported:function(){return!0},error:function(e){r.logger.error("memoryStorage error: "+e)},get:function(r){return a[r]||null},parse:function(r){return a[r]||null},set:function(r,e){a[r]=e},remove:function(r){delete a[r]}};exports.memoryStore=l;var p=null,f=function(){p=null};exports.resetSessionStorageSupported=f;var g={is_supported:function(){if(null!==p)return p;if(p=!0,window)try{var r="__support__";g.set(r,"xyz"),'"xyz"'!==g.get(r)&&(p=!1),g.remove(r)}catch(e){p=!1}else p=!1;return p},error:function(t){e.default.DEBUG&&r.logger.error("sessionStorage error: ",t)},get:function(r){try{return window.sessionStorage.getItem(r)}catch(e){g.error(e)}return null},parse:function(r){try{return JSON.parse(g.get(r))||null}catch(e){}return null},set:function(r,e){try{window.sessionStorage.setItem(r,JSON.stringify(e))}catch(t){g.error(t)}},remove:function(r){try{window.sessionStorage.removeItem(r)}catch(e){g.error(e)}}};exports.sessionStore=g;
17
- },{"./utils":"UnXq","./config":"C9JJ"}],"LECo":[function(require,module,exports) {
18
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.addOptOutCheck=g,exports.clearOptInOut=u,exports.hasOptedIn=i,exports.hasOptedOut=c,exports.optIn=r,exports.optOut=n,exports.userOptedOut=l;var e=require("./utils"),t=require("./storage"),o="__ph_opt_in_out_";function r(e,t){_(!0,e,t)}function n(e,t){_(!1,e,t)}function i(e,t){return"1"===a(e,t)}function c(e,t){return!!f(t)||"0"===a(e,t)}function u(e,t){p(t=t||{}).remove(s(e,t),!!t.crossSubdomainCookie)}function p(e){return"localStorage"===(e=e||{}).persistenceType?t.localStore:"localStorage+cookie"===e.persistenceType?t.localPlusCookieStore:t.cookieStore}function s(e,t){return((t=t||{}).persistencePrefix||o)+e}function a(e,t){return p(t).get(s(e,t))}function f(t){if(t&&t.respectDnt){var o=t&&t.window||e.window,r=o.navigator||{},n=!1;return(0,e._each)([r.doNotTrack,r.msDoNotTrack,o.doNotTrack],function(t){(0,e._includes)([!0,1,"1","yes"],t)&&(n=!0)}),n}return!1}function _(t,o,r){(0,e._isString)(o)&&o.length?(p(r=r||{}).set(s(o,r),t?1:0,(0,e._isNumber)(r.cookieExpiration)?r.cookieExpiration:null,r.crossSubdomainCookie,r.secureCookie),r.capture&&t&&r.capture(r.captureEventName||"$opt_in",r.captureProperties||{},{send_instantly:!0})):console.error("gdpr."+(t?"optIn":"optOut")+" called with an invalid token")}function l(e,t){var o=!1;try{var r=e.get_config("token"),n=e.get_config("respect_dnt"),i=e.get_config("opt_out_capturing_persistence_type"),u=e.get_config("opt_out_capturing_cookie_prefix")||void 0,p=e.get_config("window");r&&(o=c(r,{respectDnt:n,persistenceType:i,persistencePrefix:u,window:p}))}catch(s){t||console.error("Unexpected error when checking capturing opt-out status: "+s)}return o}function g(e,t,o){return function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];if(!l(e,o))return t.apply(this,r);var i=r[r.length-1];"function"==typeof i&&i(0)}}
19
- },{"./utils":"UnXq","./storage":"1GYW"}],"GxDb":[function(require,module,exports) {
20
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.PostHogPeople=void 0;var t=require("./gdpr-utils"),e=require("./utils"),r="$set",i="$set_once",o=function(){function o(i){var o=this;this._posthog=i,this.set=(0,t.addOptOutCheck)(i,function(t,i,s){var _=o.set_action(t,i);return(0,e._isObject)(t)&&(s=i),o._get_config("save_referrer")&&o._posthog.persistence.update_referrer_info(document.referrer),_[r]=(0,e._extend)({},e._info.people_properties(),o._posthog.persistence.get_referrer_info(),_[r]),o._send_request(_,s)}),this.set_once=(0,t.addOptOutCheck)(i,function(t,r,i){var s=o.set_once_action(t,r);return(0,e._isObject)(t)&&(i=r),o._send_request(s,i)})}return o.prototype.toString=function(){return this._posthog.toString()+".people"},o.prototype._send_request=function(t,r){t.$token=this._get_config("token"),t.$distinct_id=this._posthog.get_distinct_id();var i=this._posthog.get_property("$device_id"),o=this._posthog.get_property("$user_id"),s=this._posthog.get_property("$had_persisted_distinct_id");i&&(t.$device_id=i),o&&(t.$user_id=o),s&&(t.$had_persisted_distinct_id=s);var _=(0,e._encodeDates)(t),n=(0,e._copyAndTruncateStrings)(_,this._get_config("properties_string_max_length")),p=JSON.stringify(_),c=(0,e._base64Encode)(p);return this._posthog._send_request(this._get_config("api_host")+"/engage/",{data:c},{},this._posthog._prepare_callback(r,n)),n},o.prototype._get_config=function(t){return this._posthog.get_config(t)},o.prototype._is_reserved_property=function(t){return"$distinct_id"===t||"$token"===t||"$device_id"===t||"$user_id"===t||"$had_persisted_distinct_id"===t},o.prototype.set_action=function(t,e){return this.apiActionParser(r,t,e)},o.prototype.set_once_action=function(t,e){return this.apiActionParser(i,t,e)},o.prototype.apiActionParser=function(t,r,i){var o=this,s={},_={};return(0,e._isObject)(r)?(0,e._each)(r,function(t,e){o._is_reserved_property(e)||(_[e]=t)}):_[r]=i,s[t]=_,s},o}();exports.PostHogPeople=o;
21
- },{"./gdpr-utils":"LECo","./utils":"UnXq"}],"rr+t":[function(require,module,exports) {
22
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.parseFeatureFlagDecideResponse=exports.PostHogFeatureFlags=void 0;var e=require("./utils"),t=function(e,t){var a=e.featureFlags;if(a)if(Array.isArray(a)){var r={};if(a)for(var s=0;s<a.length;s++)r[a[s]]=!0;t&&t.register({$active_feature_flags:a,$enabled_feature_flags:r})}else t&&t.register({$active_feature_flags:Object.keys(a||{}),$enabled_feature_flags:a||{}});else t&&(t.unregister("$active_feature_flags"),t.unregister("$enabled_feature_flags"))};exports.parseFeatureFlagDecideResponse=t;var a=function(){function a(e){this.instance=e,this._override_warning=!1,this.flagCallReported={},this.featureFlagEventHandlers=[],this.reloadFeatureFlagsQueued=!1,this.reloadFeatureFlagsInAction=!1}return a.prototype.getFlags=function(){return Object.keys(this.getFlagVariants())},a.prototype.getFlagVariants=function(){var t=this.instance.get_property("$enabled_feature_flags"),a=this.instance.get_property("$override_feature_flags");if(!a)return t||{};for(var r=(0,e._extend)({},t),s=Object.keys(a),i=0;i<s.length;i++)!1===a[s[i]]?delete r[s[i]]:r[s[i]]=a[s[i]];return this._override_warning||(console.warn("[PostHog] Overriding feature flags!",{enabledFlags:t,overriddenFlags:a,finalFlags:r}),this._override_warning=!0),r},a.prototype.reloadFeatureFlags=function(){this.reloadFeatureFlagsQueued||(this.reloadFeatureFlagsQueued=!0,this._startReloadTimer())},a.prototype.setAnonymousDistinctId=function(e){this.$anon_distinct_id=e},a.prototype.setReloadingPaused=function(e){this.reloadFeatureFlagsInAction=e},a.prototype.resetRequestQueue=function(){this.reloadFeatureFlagsQueued=!1},a.prototype._startReloadTimer=function(){var e=this;this.reloadFeatureFlagsQueued&&!this.reloadFeatureFlagsInAction&&setTimeout(function(){!e.reloadFeatureFlagsInAction&&e.reloadFeatureFlagsQueued&&(e.reloadFeatureFlagsQueued=!1,e._reloadFeatureFlagsRequest())},5)},a.prototype._reloadFeatureFlagsRequest=function(){var t=this;this.setReloadingPaused(!0);var a=this.instance.get_config("token"),r=JSON.stringify({token:a,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id}),s=(0,e._base64Encode)(r);this.instance._send_request(this.instance.get_config("api_host")+"/decide/?v=2",{data:s},{method:"POST"},this.instance._prepare_callback(function(e){t.$anon_distinct_id=void 0,t.receivedFeatureFlags(e),t.setReloadingPaused(!1),t._startReloadTimer()}))},a.prototype.getFeatureFlag=function(e,t){if(void 0===t&&(t={}),!this.getFlags())return console.warn('getFeatureFlag for key "'+e+"\" failed. Feature flags didn't load in time."),!1;var a=this.getFlagVariants()[e];return!t.send_event&&"send_event"in t||this.flagCallReported[e]||(this.flagCallReported[e]=!0,this.instance.capture("$feature_flag_called",{$feature_flag:e,$feature_flag_response:a})),a},a.prototype.isFeatureEnabled=function(e,t){return void 0===t&&(t={}),this.getFlags()?!!this.getFeatureFlag(e,t):(console.warn('isFeatureEnabled for key "'+e+"\" failed. Feature flags didn't load in time."),!1)},a.prototype.addFeatureFlagsHandler=function(e){this.featureFlagEventHandlers.push(e)},a.prototype.receivedFeatureFlags=function(e){t(e,this.instance.persistence);var a=this.getFlags(),r=this.getFlagVariants();this.featureFlagEventHandlers.forEach(function(e){return e(a,r)})},a.prototype.override=function(e){if(this._override_warning=!1,!1===e)this.instance.persistence.unregister("$override_feature_flags");else if(Array.isArray(e)){for(var t={},a=0;a<e.length;a++)t[e[a]]=!0;this.instance.persistence.register({$override_feature_flags:t})}else this.instance.persistence.register({$override_feature_flags:e})},a.prototype.onFeatureFlags=function(e){(this.addFeatureFlagsHandler(e),this.instance.decideEndpointWasHit)&&e(this.getFlags(),this.getFlagVariants())},a}();exports.PostHogFeatureFlags=a;
23
- },{"./utils":"UnXq"}],"8kGX":[function(require,module,exports) {
24
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.UNSET_QUEUE_KEY=exports.UNION_QUEUE_KEY=exports.SET_QUEUE_KEY=exports.SET_ONCE_QUEUE_KEY=exports.SESSION_RECORDING_ENABLED_SERVER_SIDE=exports.SESSION_ID=exports.RESERVED_PROPERTIES=exports.REMOVE_QUEUE_KEY=exports.PostHogPersistence=exports.PEOPLE_DISTINCT_ID_KEY=exports.EVENT_TIMERS_KEY=exports.ENABLED_FEATURE_FLAGS=exports.CAMPAIGN_IDS_KEY=exports.APPEND_QUEUE_KEY=exports.ALIAS_ID_KEY=exports.ADD_QUEUE_KEY=void 0;var e=require("./utils"),t=require("./storage");function r(e){return(r="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})(e)}var s="__mps";exports.SET_QUEUE_KEY=s;var o="__mpso";exports.SET_ONCE_QUEUE_KEY=o;var i="__mpus";exports.UNSET_QUEUE_KEY=i;var p="__mpa";exports.ADD_QUEUE_KEY=p;var _="__mpap";exports.APPEND_QUEUE_KEY=_;var n="__mpr";exports.REMOVE_QUEUE_KEY=n;var a="__mpu";exports.UNION_QUEUE_KEY=a;var E="$people_distinct_id";exports.PEOPLE_DISTINCT_ID_KEY=E;var c="__alias";exports.ALIAS_ID_KEY=c;var h="__cmpns";exports.CAMPAIGN_IDS_KEY=h;var u="__timers";exports.EVENT_TIMERS_KEY=u;var d="$session_recording_enabled_server_side";exports.SESSION_RECORDING_ENABLED_SERVER_SIDE=d;var f="$sesid";exports.SESSION_ID=f;var m="$enabled_feature_flags";exports.ENABLED_FEATURE_FLAGS=m;var l=[s,o,i,p,_,n,a,E,c,h,u,d,f,m];exports.RESERVED_PROPERTIES=l;var v=function(){function s(r){var s="";r.token&&(s=r.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),this.props={},this.campaign_params_saved=!1,r.persistence_name?this.name="ph_"+r.persistence_name:this.name="ph_"+s+"_posthog";var o=r.persistence.toLowerCase();"cookie"!==o&&-1===o.indexOf("localstorage")&&"memory"!==o&&(e.logger.critical("Unknown persistence type "+o+"; falling back to cookie"),o=r.persistence="cookie"),"localstorage"===o&&t.localStore.is_supported()?this.storage=t.localStore:"localstorage+cookie"===o&&t.localPlusCookieStore.is_supported()?this.storage=t.localPlusCookieStore:this.storage="memory"===o?t.memoryStore:t.cookieStore,this.load(),this.update_config(r),this.save()}return s.prototype.properties=function(){var t={};return(0,e._each)(this.props,function(s,o){if(o===m&&"object"===r(s))for(var i=Object.keys(s),p=0;p<i.length;p++)t["$feature/".concat(i[p])]=s[i[p]];else(0,e._include)(l,o)||(t[o]=s)}),t},s.prototype.load=function(){if(!this.disabled){var t=this.storage.parse(this.name);t&&(this.props=(0,e._extend)({},t))}},s.prototype.save=function(){this.disabled||this.storage.set(this.name,this.props,this.expire_days,this.cross_subdomain,this.secure)},s.prototype.remove=function(){this.storage.remove(this.name,!1),this.storage.remove(this.name,!0)},s.prototype.clear=function(){this.remove(),this.props={}},s.prototype.register_once=function(t,r,s){var o=this;return!!(0,e._isObject)(t)&&(void 0===r&&(r="None"),this.expire_days=void 0===s?this.default_expiry:s,(0,e._each)(t,function(e,t){o.props.hasOwnProperty(t)&&o.props[t]!==r||(o.props[t]=e)}),this.save(),!0)},s.prototype.register=function(t,r){return!!(0,e._isObject)(t)&&(this.expire_days=void 0===r?this.default_expiry:r,(0,e._extend)(this.props,t),this.save(),!0)},s.prototype.unregister=function(e){e in this.props&&(delete this.props[e],this.save())},s.prototype.update_campaign_params=function(){this.campaign_params_saved||(this.register(e._info.campaignParams()),this.campaign_params_saved=!0)},s.prototype.update_search_keyword=function(t){this.register(e._info.searchInfo(t))},s.prototype.update_referrer_info=function(t){this.register({$referrer:t||this.props.$referrer||"$direct",$referring_domain:e._info.referringDomain(t)||this.props.$referring_domain||"$direct"})},s.prototype.get_referrer_info=function(){return(0,e._strip_empty_properties)({$referrer:this.props.$referrer,$referring_domain:this.props.$referring_domain})},s.prototype.safe_merge=function(t){return(0,e._each)(this.props,function(e,r){r in t||(t[r]=e)}),t},s.prototype.update_config=function(e){this.default_expiry=this.expire_days=e.cookie_expiration,this.set_disabled(e.disable_persistence),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie)},s.prototype.set_disabled=function(e){this.disabled=e,this.disabled?this.remove():this.save()},s.prototype.set_cross_subdomain=function(e){e!==this.cross_subdomain&&(this.cross_subdomain=e,this.remove(),this.save())},s.prototype.get_cross_subdomain=function(){return!!this.cross_subdomain},s.prototype.set_secure=function(e){e!==this.secure&&(this.secure=e,this.remove(),this.save())},s.prototype.set_event_timer=function(e,t){var r=this.props[u]||{};r[e]=t,this.props[u]=r,this.save()},s.prototype.remove_event_timer=function(t){var r=(this.props[u]||{})[t];return(0,e._isUndefined)(r)||(delete this.props[u][t],this.save()),r},s}();exports.PostHogPersistence=v;
25
- },{"./utils":"UnXq","./storage":"1GYW"}],"+gtL":[function(require,module,exports) {
26
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.CONSOLE_LOG_PLUGIN_NAME=void 0,exports.filterDataURLsFromLargeDataObjects=r,exports.replacementImageURI=void 0,exports.truncateLargeConsoleLogs=n;var a=require("./sessionrecording");function e(a){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a})(a)}var t=function(a){var e="function"==typeof Symbol&&Symbol.iterator,t=e&&a[e],o=0;if(t)return t.call(a);if(a&&"number"==typeof a.length)return{next:function(){return a&&o>=a.length&&(a=void 0),{value:a&&a[o++],done:!a}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},o="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3Qgd2lkdGg9IjE2IiBoZWlnaHQ9IjE2IiBmaWxsPSJibGFjayIvPgo8cGF0aCBkPSJNOCAwSDE2TDAgMTZWOEw4IDBaIiBmaWxsPSIjMkQyRDJEIi8+CjxwYXRoIGQ9Ik0xNiA4VjE2SDhMMTYgOFoiIGZpbGw9IiMyRDJEMkQiLz4KPC9zdmc+Cg==";function r(a){var r,l;if(a&&"object"===e(a)){var n=JSON.stringify(a);if(n.length>5e6){var i=n.matchAll(/data:([\w\/\-\.]+);(\w+),([^)"]*)/gim);try{for(var d=t(i),y=d.next();!y.done;y=d.next()){var p=y.value;n="image/"===p[1].toLocaleLowerCase().slice(0,6)?n.replace(p[0],o):n.replace(p[0],"")}}catch(c){r={error:c}}finally{try{y&&!y.done&&(l=d.return)&&l.call(d)}finally{if(r)throw r.error}}}return JSON.parse(n)}return a}exports.replacementImageURI=o;var l="rrweb/console@1";function n(t){if(t&&"object"===e(t)&&t.type===a.PLUGIN_EVENT_TYPE&&"object"===e(t.data)&&t.data.plugin===l){t.data.payload.payload.length>10&&(t.data.payload.payload=t.data.payload.payload.slice(0,10),t.data.payload.payload.push("...[truncated]"));for(var o=[],r=0;r<t.data.payload.payload.length;r++)t.data.payload.payload[r]&&t.data.payload.payload[r].length>2e3?o.push(t.data.payload.payload[r].slice(0,2e3)+"...[truncated]"):o.push(t.data.payload.payload[r]);return t.data.payload.payload=o,t}return t}exports.CONSOLE_LOG_PLUGIN_NAME=l;
27
- },{"./sessionrecording":"3pq5"}],"3pq5":[function(require,module,exports) {
28
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.SessionRecording=exports.PLUGIN_EVENT_TYPE=exports.MUTATION_SOURCE_TYPE=exports.META_EVENT_TYPE=exports.INCREMENTAL_SNAPSHOT_EVENT_TYPE=exports.FULL_SNAPSHOT_EVENT_TYPE=void 0;var t=require("../autocapture-utils"),e=require("../posthog-persistence"),n=i(require("../config")),r=require("./sessionrecording-utils");function i(t){return t&&t.__esModule?t:{default:t}}var o=function(){return(o=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)},s=function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},a=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(a){i={error:a}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s},d="/e/",c=2;exports.FULL_SNAPSHOT_EVENT_TYPE=c;var p=4;exports.META_EVENT_TYPE=p;var u=3;exports.INCREMENTAL_SNAPSHOT_EVENT_TYPE=u;var l=6;exports.PLUGIN_EVENT_TYPE=l;var h=0;exports.MUTATION_SOURCE_TYPE=h;var _=function(){function i(t){this.instance=t,this.captureStarted=!1,this.snapshots=[],this.emit=!1,this.endpoint=d,this.stopRrweb=void 0,this.windowId=null,this.sessionId=null,this.receivedDecide=!1}return i.prototype.startRecordingIfEnabled=function(){this.isRecordingEnabled()?this.startCaptureAndTrySendingQueuedSnapshots():this.stopRecording()},i.prototype.started=function(){return this.captureStarted},i.prototype.stopRecording=function(){this.captureStarted&&this.stopRrweb&&(this.stopRrweb(),this.stopRrweb=void 0,this.captureStarted=!1)},i.prototype.isRecordingEnabled=function(){var t=!!this.instance.get_property(e.SESSION_RECORDING_ENABLED_SERVER_SIDE),n=!this.instance.get_config("disable_session_recording");return t&&n},i.prototype.afterDecideResponse=function(t){var n,r,i;this.receivedDecide=!0,this.instance.persistence&&this.instance.persistence.register(((n={})[e.SESSION_RECORDING_ENABLED_SERVER_SIDE]=!!t.sessionRecording,n)),(null===(r=t.sessionRecording)||void 0===r?void 0:r.endpoint)&&(this.endpoint=null===(i=t.sessionRecording)||void 0===i?void 0:i.endpoint),this.startRecordingIfEnabled()},i.prototype.startCaptureAndTrySendingQueuedSnapshots=function(){var t=this;this.receivedDecide&&(this.emit=!0,this.snapshots.forEach(function(e){return t._captureSnapshot(e)})),this._startCapture()},i.prototype._startCapture=function(){void 0!==Object.assign&&(this.captureStarted||this.instance.get_config("disable_session_recording")||(this.captureStarted=!0,(0,t.loadScript)(this.instance.get_config("api_host")+"/static/recorder.js?v="+n.default.LIB_VERSION,this._onScriptLoaded.bind(this))))},i.prototype._updateWindowAndSessionIds=function(t){var e,n,r=t.type===u&&(null===(e=t.data)||void 0===e?void 0:e.source)===h,i=this.instance.sessionManager.checkAndGetSessionAndWindowId(r,t.timestamp),o=i.windowId,s=i.sessionId;this.windowId===o&&this.sessionId===s||-1!==[c,p].indexOf(t.type)||null===(n=this.rrwebRecord)||void 0===n||n.takeFullSnapshot(),this.windowId=o,this.sessionId=s},i.prototype._onScriptLoaded=function(){var t,e,n,i=this,d={blockClass:"ph-no-capture",blockSelector:void 0,ignoreClass:"ph-ignore-input",maskAllInputs:!0,maskInputOptions:{},maskInputFn:void 0,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0};this.rrwebRecord=window.rrweb?window.rrweb.record:window.rrwebRecord;var c=this.instance.get_config("session_recording");try{for(var p=s(Object.entries(c||{})),u=p.next();!u.done;u=p.next()){var l=a(u.value,2),h=l[0],_=l[1];h in d&&(d[h]=_)}}catch(f){t={error:f}}finally{try{u&&!u.done&&(e=p.return)&&e.call(p)}finally{if(t)throw t.error}}this.stopRrweb=null===(n=this.rrwebRecord)||void 0===n?void 0:n.call(this,o({emit:function(t){t=(0,r.truncateLargeConsoleLogs)((0,r.filterDataURLsFromLargeDataObjects)(t)),i._updateWindowAndSessionIds(t);var e={$snapshot_data:t,$session_id:i.sessionId,$window_id:i.windowId};i.instance._captureMetrics.incr("rrweb-record"),i.instance._captureMetrics.incr("rrweb-record-".concat(t.type)),i.emit?i._captureSnapshot(e):i.snapshots.push(e)},plugins:window.rrwebConsoleRecord&&this.instance.get_config("enable_recording_console_log")?[window.rrwebConsoleRecord.getRecordConsolePlugin()]:[]},d)),this.instance._addCaptureHook(function(t){var e;"$pageview"===t&&(null===(e=i.rrwebRecord)||void 0===e||e.addCustomEvent("$pageview",{href:window.location.href}))})},i.prototype._captureSnapshot=function(t){this.instance.capture("$snapshot",t,{transport:"XHR",method:"POST",endpoint:this.endpoint,_noTruncate:!0,_batchKey:"sessionRecording",_metrics:{rrweb_full_snapshot:t.$snapshot_data.type===c}})},i}();exports.SessionRecording=_;
29
- },{"../autocapture-utils":"h4lk","../posthog-persistence":"8kGX","../config":"C9JJ","./sessionrecording-utils":"+gtL"}],"UrLq":[function(require,module,exports) {
30
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Decide=void 0;var e=require("./autocapture"),t=require("./utils"),n=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],i=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},i=function(){function i(e){this.instance=e,this.instance.decideEndpointWasHit=!1}return i.prototype.call=function(){var e=this,n=JSON.stringify({token:this.instance.get_config("token"),distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups()}),i=(0,t._base64Encode)(n);this.instance._send_request("".concat(this.instance.get_config("api_host"),"/decide/?v=2"),{data:i,verbose:!0},{method:"POST"},function(t){return e.parseDecideResponse(t)})},i.prototype.parseDecideResponse=function(t){var i,o,s,r=this;if(0!==(null==t?void 0:t.status)){if(this.instance.decideEndpointWasHit=!0,!document||!document.body)return console.log("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(function(){r.parseDecideResponse(t)},500);if(this.instance.toolbar.afterDecideResponse(t),null===(s=this.instance.sessionRecording)||void 0===s||s.afterDecideResponse(t),e.autocapture.afterDecideResponse(t,this.instance),this.instance.featureFlags.receivedFeatureFlags(t),t.supportedCompression){var c={};try{for(var a=n(t.supportedCompression),d=a.next();!d.done;d=a.next()){c[d.value]=!0}}catch(u){i={error:u}}finally{try{d&&!d.done&&(o=a.return)&&o.call(a)}finally{if(i)throw i.error}}this.instance.compression=c}else this.instance.compression={}}else console.error("Failed to fetch feature flags from PostHog.")},i}();exports.Decide=i;
31
- },{"./autocapture":"+QN3","./utils":"UnXq"}],"1RJB":[function(require,module,exports) {
32
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Toolbar=void 0;var t=require("../autocapture-utils"),o=require("../utils"),e=function(){return(e=Object.assign||function(t){for(var o,e=1,i=arguments.length;e<i;e++)for(var a in o=arguments[e])Object.prototype.hasOwnProperty.call(o,a)&&(t[a]=o[a]);return t}).apply(this,arguments)},i=function(){function i(t){this.instance=t}return i.prototype.afterDecideResponse=function(t){var o=t.editorParams||(t.toolbarVersion?{toolbarVersion:t.toolbarVersion}:{});t.isAuthenticated&&o.toolbarVersion&&0===o.toolbarVersion.indexOf("toolbar")&&this._loadEditor(e(e({},o),{apiURL:this.instance.get_config("api_host")}))},i.prototype.maybeLoadEditor=function(t,e,i){void 0===t&&(t=window.location),void 0===e&&(e=void 0),void 0===i&&(i=window.history);try{if(!e){try{window.localStorage.setItem("test","test"),window.localStorage.removeItem("test")}catch(d){return!1}e=window.localStorage}var a=(0,o._getHashParam)(t.hash,"__posthog")||(0,o._getHashParam)(t.hash,"state"),r=a?JSON.parse(decodeURIComponent(a)):null,n=r&&("mpeditor"===r.action||"ph_authorize"===r.action),s=void 0;return n?(s=r)&&Object.keys(s).length>0&&(e.setItem("_postHogEditorParams",JSON.stringify(s)),r.desiredHash?t.hash=r.desiredHash:i?i.replaceState("",document.title,t.pathname+t.search):t.hash=""):delete(s=JSON.parse(e.getItem("_postHogEditorParams")||"{}")).userIntent,s.apiURL=this.instance.get_config("api_host"),!(!s.token||this.instance.get_config("token")!==s.token)&&(this._loadEditor(s),!0)}catch(c){return!1}},i.prototype._loadEditor=function(i){var a=this;if(!window._postHogToolbarLoaded){window._postHogToolbarLoaded=!0;var r=i.jsURL||i.apiURL||this.instance.get_config("api_host"),n=r+(r.endsWith("/")?"":"/")+"static/toolbar.js?_ts="+(new Date).getTime(),s="https://app.posthog.com"!==this.instance.get_config("api_host")&&this.instance.get_config("advanced_disable_toolbar_metrics");return i=e(e({},i),s?{instrument:!1}:{}),(0,t.loadScript)(n,function(){window.ph_load_editor(i,a.instance)}),(0,o._register_event)(window,"turbolinks:load",function(){window._postHogToolbarLoaded=!1,a._loadEditor(i)}),!0}return!1},i}();exports.Toolbar=i;
33
- },{"../autocapture-utils":"h4lk","../utils":"UnXq"}],"VdzR":[function(require,module,exports) {
34
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.RequestQueueScaffold=void 0;var e=function(){function e(e){void 0===e&&(e=3e3),this.isPolling=!0,this._event_queue=[],this._empty_queue_count=0,this._poller=void 0,this._pollInterval=e}return e.prototype.setPollInterval=function(e){this._pollInterval=e,this.isPolling&&this.poll()},e.prototype.poll=function(){},e.prototype.unload=function(){},e.prototype.getTime=function(){return(new Date).getTime()},e}();exports.RequestQueueScaffold=e;
35
- },{}],"YL63":[function(require,module,exports) {
36
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.RequestQueue=void 0;var t=require("./base-request-queue"),e=require("./utils"),r=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),n=function(){return(n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},o=function(t){function o(e,r,n){void 0===n&&(n=3e3);var o=t.call(this,n)||this;return o.handlePollRequest=r,o.captureMetrics=e,o}return r(o,t),o.prototype.enqueue=function(t,e,r){this.captureMetrics.incr("batch-enqueue"),this._event_queue.push({url:t,data:e,options:r}),this.isPolling||(this.isPolling=!0,this.poll())},o.prototype.poll=function(){var t=this;clearTimeout(this._poller),this._poller=setTimeout(function(){if(t._event_queue.length>0){var r=t.formatQueue(),n=function(n){var o=r[n],u=o.url,i=o.data,s=o.options;(0,e._each)(i,function(e,r){i[r].offset=Math.abs(i[r].timestamp-t.getTime()),delete i[r].timestamp}),t.handlePollRequest(u,i,s),t.captureMetrics.incr("batch-requests"),t.captureMetrics.incr("batch-requests-".concat(u.slice(u.length-2))),t.captureMetrics.incr("batch-handle",i.length),t.captureMetrics.incr("batch-handle-".concat(u.slice(u.length-2)),i.length)};for(var o in r)n(o);t._event_queue.length=0,t._empty_queue_count=0}else t._empty_queue_count++;t._empty_queue_count>4&&(t.isPolling=!1,t._empty_queue_count=0),t.isPolling&&t.poll()},this._pollInterval)},o.prototype.updateUnloadMetrics=function(){var t=this.formatQueue();for(var e in t){var r=t[e],n=r.url,o=r.data;this.captureMetrics.incr("batch-unload-requests"),this.captureMetrics.incr("batch-unload-requests-".concat(n.slice(n.length-2))),this.captureMetrics.incr("batch-unload",o.length),this.captureMetrics.incr("batch-unload-".concat(n.slice(n.length-2)),o.length)}},o.prototype.unload=function(){clearTimeout(this._poller);var t=this._event_queue.length>0?this.formatQueue():{};for(var e in this._event_queue.length=0,t){var r=t[e],o=r.url,u=r.data,i=r.options;this.handlePollRequest(o,u,n(n({},i),{transport:"sendBeacon"}))}},o.prototype.formatQueue=function(){var t={};return(0,e._each)(this._event_queue,function(e){var r=e.url,n=e.data,o=e.options,u=(o?o._batchKey:null)||r;void 0===t[u]&&(t[u]={data:[],url:r,options:o}),o&&t[u].options&&t[u].options._metrics&&!t[u].options._metrics.rrweb_full_snapshot&&(t[u].options._metrics.rrweb_full_snapshot=o._metrics.rrweb_full_snapshot),t[u].data.push(n)}),t},o}(t.RequestQueueScaffold);exports.RequestQueue=o;
37
- },{"./base-request-queue":"VdzR","./utils":"UnXq"}],"K3eQ":[function(require,module,exports) {
38
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.CaptureMetrics=void 0;var t=function(){function t(t){this.enabled=t,this.metrics={}}return t.prototype.incr=function(t,e){void 0===e&&(e=1),this.enabled&&(t="phjs-".concat(t),this.metrics[t]=(this.metrics[t]||0)+e)},t.prototype.decr=function(t){this.enabled&&(t="phjs-".concat(t),this.metrics[t]=(this.metrics[t]||0)-1)},t}();exports.CaptureMetrics=t;
39
- },{}],"UJm1":[function(require,module,exports) {
40
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Zlib=exports.Unzlib=exports.Inflate=exports.Gzip=exports.Gunzip=exports.Deflate=exports.Decompress=exports.Compress=exports.AsyncZlib=exports.AsyncUnzlib=exports.AsyncInflate=exports.AsyncGzip=exports.AsyncGunzip=exports.AsyncDeflate=exports.AsyncDecompress=exports.AsyncCompress=void 0,exports.decompress=Wt,exports.decompressSync=Yt,exports.deflate=xt,exports.deflateSync=bt,exports.gunzip=It,exports.gunzipSync=Zt,exports.compress=exports.gzip=Dt,exports.compressSync=exports.gzipSync=Ot,exports.inflate=Mt,exports.inflateSync=kt,exports.strFromU8=Kt,exports.strToU8=Jt,exports.unzip=rn,exports.unzipSync=en,exports.unzlib=_t,exports.unzlibSync=Bt,exports.zip=tn,exports.zipSync=nn,exports.zlib=Tt,exports.zlibSync=jt;var t={},n=function(n,r,e,i,o){var a=t[r]||(t[r]=URL.createObjectURL(new Blob([n],{type:"text/javascript"}))),f=new Worker(a);return f.onerror=function(t){return o(t.error,null)},f.onmessage=function(t){return o(null,t.data)},f.postMessage(e,i),f},r=Uint8Array,e=Uint16Array,i=Uint32Array,o=new r([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),a=new r([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),f=new r([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),s=function(t,n){for(var r=new e(31),o=0;o<31;++o)r[o]=n+=1<<t[o-1];var a=new i(r[30]);for(o=1;o<30;++o)for(var f=r[o];f<r[o+1];++f)a[f]=f-r[o]<<5|o;return[r,a]},u=s(o,2),l=u[0],c=u[1];l[28]=258,c[258]=28;for(var h=s(a,0),p=h[0],v=h[1],d=new e(32768),g=0;g<32768;++g){var w=(43690&g)>>>1|(21845&g)<<1;w=(61680&(w=(52428&w)>>>2|(13107&w)<<2))>>>4|(3855&w)<<4,d[g]=((65280&w)>>>8|(255&w)<<8)>>>1}var y=function(t,n,r){for(var i=t.length,o=0,a=new e(n);o<i;++o)++a[t[o]-1];var f,s=new e(n);for(o=0;o<n;++o)s[o]=s[o-1]+a[o-1]<<1;if(r){f=new e(1<<n);var u=15-n;for(o=0;o<i;++o)if(t[o])for(var l=o<<4|t[o],c=n-t[o],h=s[t[o]-1]++<<c,p=h|(1<<c)-1;h<=p;++h)f[d[h]>>>u]=l}else for(f=new e(i),o=0;o<i;++o)f[o]=d[s[t[o]-1]++]>>>15-t[o];return f},m=new r(288);for(g=0;g<144;++g)m[g]=8;for(g=144;g<256;++g)m[g]=9;for(g=256;g<280;++g)m[g]=7;for(g=280;g<288;++g)m[g]=8;var x=new r(32);for(g=0;g<32;++g)x[g]=5;var b=y(m,9,0),z=y(m,9,1),A=y(x,5,0),M=y(x,5,1),k=function(t){for(var n=t[0],r=1;r<t.length;++r)t[r]>n&&(n=t[r]);return n},S=function(t,n,r){var e=n/8>>0;return(t[e]|t[e+1]<<8)>>>(7&n)&r},C=function(t,n){var r=n/8>>0;return(t[r]|t[r+1]<<8|t[r+2]<<16)>>>(7&n)},D=function(t){return(t/8>>0)+(7&t&&1)},O=function(t,n,o){(null==n||n<0)&&(n=0),(null==o||o>t.length)&&(o=t.length);var a=new(t instanceof e?e:t instanceof i?i:r)(o-n);return a.set(t.subarray(n,o)),a},G=function(t,n,e){var i=t.length,s=!n||e,u=!e||e.i;e||(e={}),n||(n=new r(3*i));var c=function(t){var e=n.length;if(t>e){var i=new r(Math.max(2*e,t));i.set(n),n=i}},h=e.f||0,v=e.p||0,d=e.b||0,g=e.l,w=e.d,m=e.m,x=e.n,b=8*i;do{if(!g){e.f=h=S(t,v,1);var A=S(t,v+1,3);if(v+=3,!A){var G=t[(B=D(v)+4)-4]|t[B-3]<<8,U=B+G;if(U>i){if(u)throw"unexpected EOF";break}s&&c(d+G),n.set(t.subarray(B,U),d),e.b=d+=G,e.p=v=8*U;continue}if(1==A)g=z,w=M,m=9,x=5;else{if(2!=A)throw"invalid block type";var I=S(t,v,31)+257,Z=S(t,v+10,15)+4,E=I+S(t,v+5,31)+1;v+=14;for(var F=new r(E),T=new r(19),j=0;j<Z;++j)T[f[j]]=S(t,v+3*j,7);v+=3*Z;var L=k(T),R=(1<<L)-1;if(!u&&v+E*(L+7)>b)break;var _=y(T,L,1);for(j=0;j<E;){var B,H=_[S(t,v,R)];if(v+=15&H,(B=H>>>4)<16)F[j++]=B;else{var P=0,W=0;for(16==B?(W=3+S(t,v,3),v+=2,P=F[j-1]):17==B?(W=3+S(t,v,7),v+=3):18==B&&(W=11+S(t,v,127),v+=7);W--;)F[j++]=P}}var Y=F.subarray(0,I),q=F.subarray(I);m=k(Y),x=k(q),g=y(Y,m,1),w=y(q,x,1)}if(v>b)throw"unexpected EOF"}s&&c(d+131072);for(var J=(1<<m)-1,K=(1<<x)-1,N=m+x+18;u||v+N<b;){var Q=(P=g[C(t,v)&J])>>>4;if((v+=15&P)>b)throw"unexpected EOF";if(!P)throw"invalid length/literal";if(Q<256)n[d++]=Q;else{if(256==Q){g=null;break}var V=Q-254;if(Q>264){var X=o[j=Q-257];V=S(t,v,(1<<X)-1)+l[j],v+=X}var $=w[C(t,v)&K],tt=$>>>4;if(!$)throw"invalid distance";v+=15&$;q=p[tt];if(tt>3){X=a[tt];q+=C(t,v)&(1<<X)-1,v+=X}if(v>b)throw"unexpected EOF";s&&c(d+131072);for(var nt=d+V;d<nt;d+=4)n[d]=n[d-q],n[d+1]=n[d+1-q],n[d+2]=n[d+2-q],n[d+3]=n[d+3-q];d=nt}}e.l=g,e.p=v,e.b=d,g&&(h=1,e.m=m,e.d=w,e.n=x)}while(!h);return d==n.length?n:O(n,0,d)},U=function(t,n,r){r<<=7&n;var e=n/8>>0;t[e]|=r,t[e+1]|=r>>>8},I=function(t,n,r){r<<=7&n;var e=n/8>>0;t[e]|=r,t[e+1]|=r>>>8,t[e+2]|=r>>>16},Z=function(t,n){for(var i=[],o=0;o<t.length;++o)t[o]&&i.push({s:o,f:t[o]});var a=i.length,f=i.slice();if(!a)return[new r(0),0];if(1==a){var s=new r(i[0].s+1);return s[i[0].s]=1,[s,1]}i.sort(function(t,n){return t.f-n.f}),i.push({s:-1,f:25001});var u=i[0],l=i[1],c=0,h=1,p=2;for(i[0]={s:-1,f:u.f+l.f,l:u,r:l};h!=a-1;)u=i[i[c].f<i[p].f?c++:p++],l=i[c!=h&&i[c].f<i[p].f?c++:p++],i[h++]={s:-1,f:u.f+l.f,l:u,r:l};var v=f[0].s;for(o=1;o<a;++o)f[o].s>v&&(v=f[o].s);var d=new e(v+1),g=E(i[h-1],d,0);if(g>n){o=0;var w=0,y=g-n,m=1<<y;for(f.sort(function(t,n){return d[n.s]-d[t.s]||t.f-n.f});o<a;++o){var x=f[o].s;if(!(d[x]>n))break;w+=m-(1<<g-d[x]),d[x]=n}for(w>>>=y;w>0;){var b=f[o].s;d[b]<n?w-=1<<n-d[b]++-1:++o}for(;o>=0&&w;--o){var z=f[o].s;d[z]==n&&(--d[z],++w)}g=n}return[new r(d),g]},E=function(t,n,r){return-1==t.s?Math.max(E(t.l,n,r+1),E(t.r,n,r+1)):n[t.s]=r},F=function(t){for(var n=t.length;n&&!t[--n];);for(var r=new e(++n),i=0,o=t[0],a=1,f=function(t){r[i++]=t},s=1;s<=n;++s)if(t[s]==o&&s!=n)++a;else{if(!o&&a>2){for(;a>138;a-=138)f(32754);a>2&&(f(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(f(o),--a;a>6;a-=6)f(8304);a>2&&(f(a-3<<5|8208),a=0)}for(;a--;)f(o);a=1,o=t[s]}return[r.subarray(0,i),n]},T=function(t,n){for(var r=0,e=0;e<n.length;++e)r+=t[e]*n[e];return r},j=function(t,n,r){var e=r.length,i=D(n+2);t[i]=255&e,t[i+1]=e>>>8,t[i+2]=255^t[i],t[i+3]=255^t[i+1];for(var o=0;o<e;++o)t[i+o+4]=r[o];return 8*(i+4+e)},L=function(t,n,r,i,s,u,l,c,h,p,v){U(n,v++,r),++s[256];for(var d=Z(s,15),g=d[0],w=d[1],z=Z(u,15),M=z[0],k=z[1],S=F(g),C=S[0],D=S[1],O=F(M),G=O[0],E=O[1],L=new e(19),R=0;R<C.length;++R)L[31&C[R]]++;for(R=0;R<G.length;++R)L[31&G[R]]++;for(var _=Z(L,7),B=_[0],H=_[1],P=19;P>4&&!B[f[P-1]];--P);var W,Y,q,J,K=p+5<<3,N=T(s,m)+T(u,x)+l,Q=T(s,g)+T(u,M)+l+14+3*P+T(L,B)+(2*L[16]+3*L[17]+7*L[18]);if(K<=N&&K<=Q)return j(n,v,t.subarray(h,h+p));if(U(n,v,1+(Q<N)),v+=2,Q<N){W=y(g,w,0),Y=g,q=y(M,k,0),J=M;var V=y(B,H,0);U(n,v,D-257),U(n,v+5,E-1),U(n,v+10,P-4),v+=14;for(R=0;R<P;++R)U(n,v+3*R,B[f[R]]);v+=3*P;for(var X=[C,G],$=0;$<2;++$){var tt=X[$];for(R=0;R<tt.length;++R){var nt=31&tt[R];U(n,v,V[nt]),v+=B[nt],nt>15&&(U(n,v,tt[R]>>>5&127),v+=tt[R]>>>12)}}}else W=b,Y=m,q=A,J=x;for(R=0;R<c;++R)if(i[R]>255){nt=i[R]>>>18&31;I(n,v,W[nt+257]),v+=Y[nt+257],nt>7&&(U(n,v,i[R]>>>23&31),v+=o[nt]);var rt=31&i[R];I(n,v,q[rt]),v+=J[rt],rt>3&&(I(n,v,i[R]>>>5&8191),v+=a[rt])}else I(n,v,W[i[R]]),v+=Y[i[R]];return I(n,v,W[256]),v+Y[256]},R=new i([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),_=new r(0),B=function(t,n,f,s,u,l){var h=t.length,p=new r(s+h+5*(1+Math.floor(h/7e3))+u),d=p.subarray(s,p.length-u),g=0;if(!n||h<8)for(var w=0;w<=h;w+=65535){var y=w+65535;y<h?g=j(d,g,t.subarray(w,y)):(d[w]=l,g=j(d,g,t.subarray(w,h)))}else{for(var m=R[n-1],x=m>>>13,b=8191&m,z=(1<<f)-1,A=new e(32768),M=new e(z+1),k=Math.ceil(f/3),S=2*k,C=function(n){return(t[n]^t[n+1]<<k^t[n+2]<<S)&z},G=new i(25e3),U=new e(288),I=new e(32),Z=0,E=0,F=(w=0,0),T=0,B=0;w<h;++w){var H=C(w),P=32767&w,W=M[H];if(A[P]=W,M[H]=P,T<=w){var Y=h-w;if((Z>7e3||F>24576)&&Y>423){g=L(t,d,0,G,U,I,E,F,B,w-B,g),F=Z=E=0,B=w;for(var q=0;q<286;++q)U[q]=0;for(q=0;q<30;++q)I[q]=0}var J=2,K=0,N=b,Q=P-W&32767;if(Y>2&&H==C(w-Q))for(var V=Math.min(x,Y)-1,X=Math.min(32767,w),$=Math.min(258,Y);Q<=X&&--N&&P!=W;){if(t[w+J]==t[w+J-Q]){for(var tt=0;tt<$&&t[w+tt]==t[w+tt-Q];++tt);if(tt>J){if(J=tt,K=Q,tt>V)break;var nt=Math.min(Q,tt-2),rt=0;for(q=0;q<nt;++q){var et=w-Q+q+32768&32767,it=et-A[et]+32768&32767;it>rt&&(rt=it,W=et)}}}Q+=(P=W)-(W=A[P])+32768&32767}if(K){G[F++]=268435456|c[J]<<18|v[K];var ot=31&c[J],at=31&v[K];E+=o[ot]+a[at],++U[257+ot],++I[at],T=w+J,++Z}else G[F++]=t[w],++U[t[w]]}}g=L(t,d,l,G,U,I,E,F,B,w-B,g),l||(g=j(d,g,_))}return O(p,0,s+D(g)+u)},H=function(){for(var t=new i(256),n=0;n<256;++n){for(var r=n,e=9;--e;)r=(1&r&&3988292384)^r>>>1;t[n]=r}return t}(),P=function(){var t=4294967295;return{p:function(n){for(var r=t,e=0;e<n.length;++e)r=H[255&r^n[e]]^r>>>8;t=r},d:function(){return 4294967295^t}}},W=function(){var t=1,n=0;return{p:function(r){for(var e=t,i=n,o=r.length,a=0;a!=o;){for(var f=Math.min(a+5552,o);a<f;++a)i+=e+=r[a];e%=65521,i%=65521}t=e,n=i},d:function(){return(t>>>8<<16|(255&n)<<8|n>>>8)+2*((255&t)<<23)}}},Y=function(t,n,r,e,i){return B(t,null==n.level?6:n.level,null==n.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(t.length)))):12+n.mem,r,e,!i)},q=function(t,n){var r={};for(var e in t)r[e]=t[e];for(var e in n)r[e]=n[e];return r},J=function(t,n,r){for(var e=t(),i=t.toString(),o=i.slice(i.indexOf("[")+1,i.lastIndexOf("]")).replace(/ /g,"").split(","),a=0;a<e.length;++a){var f=e[a],s=o[a];if("function"==typeof f){n+=";"+s+"=";var u=f.toString();if(f.prototype)if(-1!=u.indexOf("[native code]")){var l=u.indexOf(" ",8)+1;n+=u.slice(l,u.indexOf("(",l))}else for(var c in n+=u,f.prototype)n+=";"+s+".prototype."+c+"="+f.prototype[c].toString();else n+=u}else r[s]=f}return[n,r]},K=[],N=function(t){var n=[];for(var o in t)(t[o]instanceof r||t[o]instanceof e||t[o]instanceof i)&&n.push((t[o]=new t[o].constructor(t[o])).buffer);return n},Q=function(t,r,e,i){var o;if(!K[e]){for(var a="",f={},s=t.length-1,u=0;u<s;++u)a=(o=J(t[u],a,f))[0],f=o[1];K[e]=J(t[s],a,f)}var l=q({},K[e][1]);return n(K[e][0]+";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage="+r.toString()+"}",e,l,N(l),i)},V=function(){return[r,e,i,o,a,f,l,p,z,M,d,y,k,S,C,D,O,G,kt,et,it]},X=function(){return[r,e,i,o,a,f,c,v,b,m,A,x,d,R,_,y,U,I,Z,E,F,T,j,L,D,O,B,Y,bt,et]},$=function(){return[ct,vt,lt,P,H]},tt=function(){return[ht,pt]},nt=function(){return[dt,lt,W]},rt=function(){return[gt]},et=function(t){return postMessage(t,[t.buffer])},it=function(t){return t&&t.size&&new r(t.size)},ot=function(t,n,e,i,o,a){var f=Q(e,i,o,function(t,n){f.terminate(),a(t,n)});return n.consume||(t=new r(t)),f.postMessage([t,n],[t.buffer]),function(){f.terminate()}},at=function(t){return t.ondata=function(t,n){return postMessage([t,n],[t.buffer])},function(n){return t.push(n.data[0],n.data[1])}},ft=function(t,n,r,e,i){var o,a=Q(t,e,i,function(t,r){t?(a.terminate(),n.ondata.call(n,t)):(r[1]&&a.terminate(),n.ondata.call(n,t,r[0],r[1]))});a.postMessage(r),n.push=function(t,r){if(o)throw"stream finished";if(!n.ondata)throw"no stream handler";a.postMessage([t,o=r],[t.buffer])},n.terminate=function(){a.terminate()}},st=function(t,n){return t[n]|t[n+1]<<8},ut=function(t,n){return(t[n]|t[n+1]<<8|t[n+2]<<16)+2*(t[n+3]<<23)},lt=function(t,n,r){for(;r;++n)t[n]=r,r>>>=8},ct=function(t,n){var r=n.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=n.level<2?4:9==n.level?2:0,t[9]=3,0!=n.mtime&&lt(t,4,Math.floor(new Date(n.mtime||Date.now())/1e3)),r){t[3]=8;for(var e=0;e<=r.length;++e)t[e+10]=r.charCodeAt(e)}},ht=function(t){if(31!=t[0]||139!=t[1]||8!=t[2])throw"invalid gzip data";var n=t[3],r=10;4&n&&(r+=t[10]|2+(t[11]<<8));for(var e=(n>>3&1)+(n>>4&1);e>0;e-=!t[r++]);return r+(2&n)},pt=function(t){var n=t.length;return(t[n-4]|t[n-3]<<8|t[n-2]<<16)+2*(t[n-1]<<23)},vt=function(t){return 10+(t.filename&&t.filename.length+1||0)},dt=function(t,n){var r=n.level,e=0==r?0:r<6?1:9==r?3:2;t[0]=120,t[1]=e<<6|(e?32-2*e:1)},gt=function(t){if(8!=(15&t[0])||t[0]>>>4>7||(t[0]<<8|t[1])%31)throw"invalid zlib data";if(32&t[1])throw"invalid zlib data: preset dictionaries not supported"};function wt(t,n){return n||"function"!=typeof t||(n=t,t={}),this.ondata=n,t}var yt=function(){function t(t,n){n||"function"!=typeof t||(n=t,t={}),this.ondata=n,this.o=t||{}}return t.prototype.p=function(t,n){this.ondata(Y(t,this.o,0,0,!n),n)},t.prototype.push=function(t,n){if(this.d)throw"stream finished";if(!this.ondata)throw"no stream handler";this.d=n,this.p(t,n||!1)},t}();exports.Deflate=yt;var mt=function(){return function(t,n){ft([X,function(){return[at,yt]}],this,wt.call(this,t,n),function(t){var n=new yt(t.data);onmessage=at(n)},6)}}();function xt(t,n,r){if(r||(r=n,n={}),"function"!=typeof r)throw"no callback";return ot(t,n,[X],function(t){return et(bt(t.data[0],t.data[1]))},0,r)}function bt(t,n){return void 0===n&&(n={}),Y(t,n,0,0)}exports.AsyncDeflate=mt;var zt=function(){function t(t){this.s={},this.p=new r(0),this.ondata=t}return t.prototype.e=function(t){if(this.d)throw"stream finished";if(!this.ondata)throw"no stream handler";var n=this.p.length,e=new r(n+t.length);e.set(this.p),e.set(t,n),this.p=e},t.prototype.c=function(t){this.d=this.s.i=t||!1;var n=this.s.b,r=G(this.p,this.o,this.s);this.ondata(O(r,n,this.s.b),this.d),this.o=O(r,this.s.b-32768),this.s.b=this.o.length,this.p=O(this.p,this.s.p/8>>0),this.s.p&=7},t.prototype.push=function(t,n){this.e(t),this.c(n)},t}();exports.Inflate=zt;var At=function(){return function(t){this.ondata=t,ft([V,function(){return[at,zt]}],this,0,function(){var t=new zt;onmessage=at(t)},7)}}();function Mt(t,n,r){if(r||(r=n,n={}),"function"!=typeof r)throw"no callback";return ot(t,n,[V],function(t){return et(kt(t.data[0],it(t.data[1])))},1,r)}function kt(t,n){return G(t,n)}exports.AsyncInflate=At;var St=function(){function t(t,n){this.c=P(),this.l=0,this.v=1,yt.call(this,t,n)}return t.prototype.push=function(t,n){yt.prototype.push.call(this,t,n)},t.prototype.p=function(t,n){this.c.p(t),this.l+=t.length;var r=Y(t,this.o,this.v&&vt(this.o),n&&8,!n);this.v&&(ct(r,this.o),this.v=0),n&&(lt(r,r.length-8,this.c.d()),lt(r,r.length-4,this.l)),this.ondata(r,n)},t}();exports.Compress=exports.Gzip=St;var Ct=function(){return function(t,n){ft([X,$,function(){return[at,yt,St]}],this,wt.call(this,t,n),function(t){var n=new St(t.data);onmessage=at(n)},8)}}();function Dt(t,n,r){if(r||(r=n,n={}),"function"!=typeof r)throw"no callback";return ot(t,n,[X,$,function(){return[Ot]}],function(t){return et(Ot(t.data[0],t.data[1]))},2,r)}function Ot(t,n){void 0===n&&(n={});var r=P(),e=t.length;r.p(t);var i=Y(t,n,vt(n),8),o=i.length;return ct(i,n),lt(i,o-8,r.d()),lt(i,o-4,e),i}exports.AsyncCompress=exports.AsyncGzip=Ct;var Gt=function(){function t(t){this.v=1,zt.call(this,t)}return t.prototype.push=function(t,n){if(zt.prototype.e.call(this,t),this.v){var r=ht(this.p);if(r>=this.p.length&&!n)return;this.p=this.p.subarray(r),this.v=0}if(n){if(this.p.length<8)throw"invalid gzip stream";this.p=this.p.subarray(0,-8)}zt.prototype.c.call(this,n)},t}();exports.Gunzip=Gt;var Ut=function(){return function(t){this.ondata=t,ft([V,tt,function(){return[at,zt,Gt]}],this,0,function(){var t=new Gt;onmessage=at(t)},9)}}();function It(t,n,r){if(r||(r=n,n={}),"function"!=typeof r)throw"no callback";return ot(t,n,[V,tt,function(){return[Zt]}],function(t){return et(Zt(t.data[0]))},3,r)}function Zt(t,n){return G(t.subarray(ht(t),-8),n||new r(pt(t)))}exports.AsyncGunzip=Ut;var Et=function(){function t(t,n){this.c=W(),this.v=1,yt.call(this,t,n)}return t.prototype.push=function(t,n){yt.prototype.push.call(this,t,n)},t.prototype.p=function(t,n){this.c.p(t);var r=Y(t,this.o,this.v&&2,n&&4,!n);this.v&&(dt(r,this.o),this.v=0),n&&lt(r,r.length-4,this.c.d()),this.ondata(r,n)},t}();exports.Zlib=Et;var Ft=function(){return function(t,n){ft([X,nt,function(){return[at,yt,Et]}],this,wt.call(this,t,n),function(t){var n=new Et(t.data);onmessage=at(n)},10)}}();function Tt(t,n,r){if(r||(r=n,n={}),"function"!=typeof r)throw"no callback";return ot(t,n,[X,nt,function(){return[jt]}],function(t){return et(jt(t.data[0],t.data[1]))},4,r)}function jt(t,n){void 0===n&&(n={});var r=W();r.p(t);var e=Y(t,n,2,4);return dt(e,n),lt(e,e.length-4,r.d()),e}exports.AsyncZlib=Ft;var Lt=function(){function t(t){this.v=1,zt.call(this,t)}return t.prototype.push=function(t,n){if(zt.prototype.e.call(this,t),this.v){if(this.p.length<2&&!n)return;this.p=this.p.subarray(2),this.v=0}if(n){if(this.p.length<4)throw"invalid zlib stream";this.p=this.p.subarray(0,-4)}zt.prototype.c.call(this,n)},t}();exports.Unzlib=Lt;var Rt=function(){return function(t){this.ondata=t,ft([V,rt,function(){return[at,zt,Lt]}],this,0,function(){var t=new Lt;onmessage=at(t)},11)}}();function _t(t,n,r){if(r||(r=n,n={}),"function"!=typeof r)throw"no callback";return ot(t,n,[V,rt,function(){return[Bt]}],function(t){return et(Bt(t.data[0],it(t.data[1])))},5,r)}function Bt(t,n){return G((gt(t),t.subarray(2,-4)),n)}exports.AsyncUnzlib=Rt;var Ht=function(){function t(t){this.G=Gt,this.I=zt,this.Z=Lt,this.ondata=t}return t.prototype.push=function(t,n){if(!this.ondata)throw"no stream handler";if(this.s)this.s.push(t,n);else{if(this.p&&this.p.length){var e=new r(this.p.length+t.length);e.set(this.p),e.set(t,this.p.length)}else this.p=t;if(this.p.length>2){var i=this,o=function(){i.ondata.apply(i,arguments)};this.s=31==this.p[0]&&139==this.p[1]&&8==this.p[2]?new this.G(o):8!=(15&this.p[0])||this.p[0]>>4>7||(this.p[0]<<8|this.p[1])%31?new this.I(o):new this.Z(o),this.s.push(this.p,n),this.p=null}}},t}();exports.Decompress=Ht;var Pt=function(){function t(t){this.G=Ut,this.I=At,this.Z=Rt,this.ondata=t}return t.prototype.push=function(t,n){Ht.prototype.push.call(this,t,n)},t}();function Wt(t,n,r){if(r||(r=n,n={}),"function"!=typeof r)throw"no callback";return 31==t[0]&&139==t[1]&&8==t[2]?It(t,n,r):8!=(15&t[0])||t[0]>>4>7||(t[0]<<8|t[1])%31?Mt(t,n,r):_t(t,n,r)}function Yt(t,n){return 31==t[0]&&139==t[1]&&8==t[2]?Zt(t,n):8!=(15&t[0])||t[0]>>4>7||(t[0]<<8|t[1])%31?kt(t,n):Bt(t,n)}exports.AsyncDecompress=Pt;var qt=function(t,n,e,i){for(var o in t){var a=t[o],f=n+o;a instanceof r?e[f]=[a,i]:Array.isArray(a)?e[f]=[a[0],q(i,a[1])]:qt(a,f+"/",e,i)}};function Jt(t,n){var e=t.length;if(!n&&"undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t);for(var i=new r(t.length+(t.length>>>1)),o=0,a=function(t){i[o++]=t},f=0;f<e;++f){if(o+5>i.length){var s=new r(o+8+(e-f<<1));s.set(i),i=s}var u=t.charCodeAt(f);u<128||n?a(u):u<2048?(a(192|u>>>6),a(128|63&u)):u>55295&&u<57344?(a(240|(u=65536+(1047552&u)|1023&t.charCodeAt(++f))>>>18),a(128|u>>>12&63),a(128|u>>>6&63),a(128|63&u)):(a(224|u>>>12),a(128|u>>>6&63),a(128|63&u))}return O(i,0,o)}function Kt(t,n){var r="";if(!n&&"undefined"!=typeof TextDecoder)return(new TextDecoder).decode(t);for(var e=0;e<t.length;){var i=t[e++];i<128||n?r+=String.fromCharCode(i):i<224?r+=String.fromCharCode((31&i)<<6|63&t[e++]):i<240?r+=String.fromCharCode((15&i)<<12|(63&t[e++])<<6|63&t[e++]):(i=((15&i)<<18|(63&t[e++])<<12|(63&t[e++])<<6|63&t[e++])-65536,r+=String.fromCharCode(55296|i>>10,56320|1023&i))}return r}var Nt=function(t,n){return n+30+st(t,n+26)+st(t,n+28)},Qt=function(t,n,r){var e=st(t,n+28),i=Kt(t.subarray(n+46,n+46+e),!(2048&st(t,n+8))),o=n+46+e,a=r?Vt(t,o):[ut(t,n+20),ut(t,n+24),ut(t,n+42)],f=a[0],s=a[1],u=a[2];return[st(t,n+10),f,s,i,o+st(t,n+30)+st(t,n+32),u]},Vt=function(t,n){for(;1!=st(t,n);n+=4+st(t,n+2));return[ut(t,n+12),ut(t,n+4),ut(t,n+20)]},Xt=function(t,n,r,e,i,o,a,f,s,u){var l=o.length,c=e.length;lt(t,n,null!=s?33639248:67324752),n+=4,null!=s&&(t[n]=20,n+=2),t[n]=20,n+=2,t[n++]=8==u&&(1==f.level?6:f.level<6?4:9==f.level?2:0),t[n++]=a&&8,t[n]=u,n+=2;var h=new Date(f.mtime||Date.now()),p=h.getFullYear()-1980;if(p<0||p>119)throw"date not in range 1980-2099";lt(t,n,2*(p<<24)|h.getMonth()+1<<21|h.getDate()<<16|h.getHours()<<11|h.getMinutes()<<5|h.getSeconds()>>>1),lt(t,n+=4,r),lt(t,n+4,c),lt(t,n+8,i),lt(t,n+12,l),n+=16,null!=s&&(lt(t,n+=10,s),n+=4),t.set(o,n),n+=l,null==s&&t.set(e,n)},$t=function(t,n,r,e,i){lt(t,n,101010256),lt(t,n+8,r),lt(t,n+10,r),lt(t,n+12,e),lt(t,n+16,i)};function tn(t,n,e){if(e||(e=n,n={}),"function"!=typeof e)throw"no callback";var i={};qt(t,"",i,n);var o=Object.keys(i),a=o.length,f=0,s=0,u=a,l=new Array(a),c=[],h=function(){for(var t=0;t<c.length;++t)c[t]()},p=function(){var t=new r(s+22),n=f,i=s-f;s=0;for(var o=0;o<u;++o){var a=l[o];try{Xt(t,s,a.c,a.d,a.m,a.n,a.u,a.p,null,a.t),Xt(t,f,a.c,a.d,a.m,a.n,a.u,a.p,s,a.t),f+=46+a.n.length,s+=30+a.n.length+a.d.length}catch(c){return e(c,null)}}$t(t,f,l.length,i,n),e(null,t)};a||p();for(var v=function(t){var n=o[t],r=i[n],u=r[0],v=r[1],d=P(),g=u.length;d.p(u);var w=Jt(n),y=w.length,m=0==v.level?0:8,x=function(r,i){if(r)h(),e(r,null);else{var o=i.length;l[t]={t:m,d:i,m:g,c:d.d(),u:n.length!=o,n:w,p:v},f+=30+y+o,s+=76+2*y+o,--a||p()}};if(w.length>65535&&x("filename too long",null),m)if(g<16e4)try{x(null,bt(u,v))}catch(b){x(b,null)}else c.push(xt(u,v,x));else x(null,u)},d=0;d<u;++d)v(d);return h}function nn(t,n){void 0===n&&(n={});var e={},i=[];qt(t,"",e,n);var o=0,a=0;for(var f in e){var s=e[f],u=s[0],l=s[1],c=0==l.level?0:8,h=Jt(f),p=h.length;if(h.length>65535)throw"filename too long";var v=c?bt(u,l):u,d=v.length,g=P();g.p(u),i.push({t:c,d:v,m:u.length,c:g.d(),u:f.length!=p,n:h,o:o,p:l}),o+=30+p+d,a+=76+2*p+d}for(var w=new r(a+22),y=o,m=a-o,x=0;x<i.length;++x){var b=i[x];Xt(w,b.o,b.c,b.d,b.m,b.n,b.u,b.p,null,b.t),Xt(w,o,b.c,b.d,b.m,b.n,b.u,b.p,b.o,b.t),o+=46+b.n.length}return $t(w,o,i.length,m,y),w}function rn(t,n){if("function"!=typeof n)throw"no callback";for(var e=[],i=function(){for(var t=0;t<e.length;++t)e[t]()},o={},a=t.length-22;101010256!=ut(t,a);--a)if(!a||t.length-a>65558)return void n("invalid zip file",null);var f=st(t,a+8);f||n(null,{});var s=f,u=ut(t,a+16),l=4294967295==u;if(l){if(a=ut(t,a-12),101075792!=ut(t,a))throw"invalid zip file";s=f=ut(t,a+32),u=ut(t,a+48)}for(var c=function(s){var c=Qt(t,u,l),h=c[0],p=c[1],v=c[2],d=c[3],g=c[4],w=c[5],y=Nt(t,w);u=g;var m=function(t,r){t?(i(),n(t,null)):(o[d]=r,--f||n(null,o))};if(h)if(8==h){var x=t.subarray(y,y+p);if(p<32e4)try{m(null,kt(x,new r(v)))}catch(a){m(a,null)}else e.push(Mt(x,{size:v},m))}else m("unknown compression type "+h,null);else m(null,O(t,y,y+p))},h=0;h<s;++h)c();return i}function en(t){for(var n={},e=t.length-22;101010256!=ut(t,e);--e)if(!e||t.length-e>65558)throw"invalid zip file";var i=st(t,e+8);if(!i)return{};var o=ut(t,e+16),a=4294967295==o;if(a){if(e=ut(t,e-12),101075792!=ut(t,e))throw"invalid zip file";i=ut(t,e+32),o=ut(t,e+48)}for(var f=0;f<i;++f){var s=Qt(t,o,a),u=s[0],l=s[1],c=s[2],h=s[3],p=s[4],v=s[5],d=Nt(t,v);if(o=p,u){if(8!=u)throw"unknown compression type "+u;n[h]=kt(t.subarray(d,d+l),new r(c))}else n[h]=O(t,d,d+l)}return n}
41
- },{}],"UL96":[function(require,module,exports) {
42
- "use strict";var e;Object.defineProperty(exports,"__esModule",{value:!0}),exports.Compression=void 0,exports.Compression=e,function(e){e.GZipJS="gzip-js",e.LZ64="lz64",e.Base64="base64"}(e||(exports.Compression=e={}));
43
- },{}],"/wh9":[function(require,module,exports) {
44
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.compressData=t,exports.decideCompression=n;var e=require("./lz-string"),r=require("fflate"),s=require("./utils"),o=require("./types"),i=function(){return(i=Object.assign||function(e){for(var r,s=1,o=arguments.length;s<o;s++)for(var i in r=arguments[s])Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i]);return e}).apply(this,arguments)};function n(e){return e[o.Compression.GZipJS]?o.Compression.GZipJS:e[o.Compression.LZ64]?o.Compression.LZ64:o.Compression.Base64}function t(n,t,p){return n===o.Compression.LZ64?[{data:e.LZString.compressToBase64(t),compression:o.Compression.LZ64},p]:n===o.Compression.GZipJS?[(0,r.gzipSync)((0,r.strToU8)(t),{mtime:0}),i(i({},p),{blob:!0,urlQueryArgs:{compression:o.Compression.GZipJS}})]:[{data:(0,s._base64Encode)(t)},p]}
45
- },{"./lz-string":"iwXh","fflate":"UJm1","./utils":"UnXq","./types":"UL96"}],"9tuT":[function(require,module,exports) {
46
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.xhr=exports.encodePostData=exports.addParamsToURL=void 0;var e=require("./utils"),r=t(require("./config"));function t(e){return e&&e.__esModule?e:{default:e}}var o=function(e){var r="function"==typeof Symbol&&Symbol.iterator,t=r&&e[r],o=0;if(t)return t.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&o>=e.length&&(e=void 0),{value:e&&e[o++],done:!e}}};throw new TypeError(r?"Object is not iterable.":"Symbol.iterator is not defined.")},n=function(t,n,a){var i,s,u=n||{};u.ip=a.ip?1:0,u._=(new Date).getTime().toString(),u.ver=r.default.LIB_VERSION;var d=t.split("?");if(d.length>1){var l=d[1].split("&");try{for(var c=o(l),f=c.next();!f.done;f=c.next()){var p=f.value.split("=")[0];u[p]&&delete u[p]}}catch(y){i={error:y}}finally{try{f&&!f.done&&(s=c.return)&&s.call(c)}finally{if(i)throw i.error}}}var v=t.indexOf("?")>-1?"&":"?";return t+v+(0,e._HTTPBuildQuery)(u)};exports.addParamsToURL=n;var a=function e(r,t){if(t.blob&&r.buffer)return new Blob([r.buffer],{type:"text/plain"});if(t.sendBeacon||t.blob){var o=e(r,{method:"POST"});return new Blob([o],{type:"application/x-www-form-urlencoded"})}if("POST"!==t.method)return null;var n,a;return n=Array.isArray(r)||(a=r,"[object Uint8Array]"===Object.prototype.toString.call(a))?"data="+encodeURIComponent(r):"data="+encodeURIComponent(r.data),"compression"in r&&r.compression&&(n+="&compression="+r.compression),n};exports.encodePostData=a;var i=function(r){var t=r.url,o=r.data,n=r.headers,i=r.options,s=r.captureMetrics,u=r.callback,d=r.retriesPerformedSoFar,l=r.retryQueue,c=r.onXHRError,f=new XMLHttpRequest;f.open(i.method||"GET",t,!0);var p=a(o,i);s.incr("_send_request"),s.incr("_send_request_inflight"),(0,e._each)(n,function(e,r){f.setRequestHeader(r,e)}),"POST"!==i.method||i.blob||f.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),f.withCredentials=!0,f.onreadystatechange=function(){if(4===f.readyState)if(s.incr("xhr-response"),s.incr("xhr-response-".concat(f.status)),s.decr("_send_request_inflight"),200===f.status){if(u){var r=void 0;try{r=JSON.parse(f.responseText)}catch(a){return void e.logger.error(a)}u(r)}}else"function"==typeof c&&c(f),[401,403,404,500].indexOf(f.status)<0&&l.enqueue({url:t,data:o,options:i,headers:n,retriesPerformedSoFar:(d||0)+1,callback:u}),u&&u({status:0})},f.send(p)};exports.xhr=i;
47
- },{"./utils":"UnXq","./config":"C9JJ"}],"8mr1":[function(require,module,exports) {
48
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.RetryQueue=void 0;var e=require("./base-request-queue"),t=require("./send-request"),r=n(require("./config"));function n(e){return e&&e.__esModule?e:{default:e}}var o=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(t,r)};return function(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),i=function(){return(i=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},u=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},a=function(e){function n(t,r){var n=e.call(this)||this;return n.captureMetrics=t,n.isPolling=!1,n.queue=[],n.areWeOnline=!0,n.onXHRError=r,"onLine"in window.navigator&&(n.areWeOnline=window.navigator.onLine,window.addEventListener("online",function(){n._handleWeAreNowOnline()}),window.addEventListener("offline",function(){n.areWeOnline=!1})),n}return o(n,e),n.prototype.enqueue=function(e){var t=e.retriesPerformedSoFar||0;if(!(t>=10)){var r=3e3*Math.pow(2,t),n=new Date(Date.now()+r);console.warn("Enqueued failed request for retry in ".concat(r)),this.queue.push({retryAt:n,requestData:e}),this.isPolling||(this.isPolling=!0,this.poll())}},n.prototype.poll=function(){var e=this;this._poller&&clearTimeout(this._poller),this._poller=setTimeout(function(){e.areWeOnline&&e.queue.length>0&&e.flush(),e.poll()},this._pollInterval)},n.prototype.flush=function(){var e,t,r=new Date(Date.now()),n=this.queue.filter(function(e){return e.retryAt<r});if(n.length>0){this.queue=this.queue.filter(function(e){return e.retryAt>=r});try{for(var o=u(n),i=o.next();!i.done;i=o.next()){var a=i.value.requestData;this._executeXhrRequest(a)}}catch(l){e={error:l}}finally{try{i&&!i.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}}},n.prototype.unload=function(){var e,n;this._poller&&(clearTimeout(this._poller),this._poller=void 0);try{for(var o=u(this.queue),a=o.next();!a.done;a=o.next()){var l=a.value.requestData,s=l.url,c=l.data,f=l.options;try{window.navigator.sendBeacon(s,(0,t.encodePostData)(c,i(i({},f),{sendBeacon:!0})))}catch(p){r.default.DEBUG&&console.error(p)}}}catch(h){e={error:h}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}this.queue=[]},n.prototype._executeXhrRequest=function(e){var r=e.url,n=e.data,o=e.options,i=e.headers,u=e.callback,a=e.retriesPerformedSoFar;(0,t.xhr)({url:r,data:n||{},options:o||{},headers:i||{},retriesPerformedSoFar:a||0,callback:u,captureMetrics:this.captureMetrics,retryQueue:this,onXHRError:this.onXHRError})},n.prototype._handleWeAreNowOnline=function(){this.areWeOnline=!0,this.flush()},n}(e.RequestQueueScaffold);exports.RetryQueue=a;
49
- },{"./base-request-queue":"VdzR","./send-request":"9tuT","./config":"C9JJ"}],"Rb1F":[function(require,module,exports) {
50
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.SessionIdManager=void 0;var s=require("./posthog-persistence"),e=require("./storage"),t=require("./utils"),i=function(s,e){var t="function"==typeof Symbol&&s[Symbol.iterator];if(!t)return s;var i,n,o=t.call(s),r=[];try{for(;(void 0===e||e-- >0)&&!(i=o.next()).done;)r.push(i.value)}catch(d){n={error:d}}finally{try{i&&!i.done&&(t=o.return)&&t.call(o)}finally{if(n)throw n.error}}return r},n=18e5,o=864e5,r=function(){function r(s,e){this.persistence=e,this._windowId=void 0,this._sessionId=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,s.persistence_name?this.window_id_storage_key="ph_"+s.persistence_name+"_window_id":this.window_id_storage_key="ph_"+s.token+"_window_id"}return r.prototype._setWindowId=function(s){s!==this._windowId&&(this._windowId=s,!this.persistence.disabled&&e.sessionStore.is_supported()&&e.sessionStore.set(this.window_id_storage_key,s))},r.prototype._getWindowId=function(){return this._windowId?this._windowId:!this.persistence.disabled&&e.sessionStore.is_supported()?e.sessionStore.parse(this.window_id_storage_key):null},r.prototype._setSessionId=function(e,t,i){var n;e===this._sessionId&&t===this._sessionActivityTimestamp&&i===this._sessionStartTimestamp||(this._sessionStartTimestamp=i,this._sessionActivityTimestamp=t,this._sessionId=e,this.persistence.register(((n={})[s.SESSION_ID]=[t,e,i],n)))},r.prototype._getSessionId=function(){if(this._sessionId&&this._sessionActivityTimestamp&&this._sessionStartTimestamp)return[this._sessionActivityTimestamp,this._sessionId,this._sessionStartTimestamp];var e=this.persistence.props[s.SESSION_ID];return Array.isArray(e)&&2===e.length&&e.push(e[0]),e||[0,null,0]},r.prototype.resetSessionId=function(){this._setSessionId(null,null,null)},r.prototype.checkAndGetSessionAndWindowId=function(s,e){void 0===s&&(s=!1),void 0===e&&(e=null);var r=e||(new Date).getTime(),d=i(this._getSessionId(),3),_=d[0],a=d[1],p=d[2],h=this._getWindowId(),u=p&&p>0&&Math.abs(r-p)>o;!a||!s&&Math.abs(r-_)>n||u?(a=(0,t._UUID)(),h=(0,t._UUID)(),p=r):h||(h=(0,t._UUID)());var l=0===_||!s||u?r:_,w=0===p?(new Date).getTime():p;return this._setWindowId(h),this._setSessionId(a,l,w),{sessionId:a,windowId:h}},r}();exports.SessionIdManager=r;
51
- },{"./posthog-persistence":"8kGX","./storage":"1GYW","./utils":"UnXq"}],"Z1nr":[function(require,module,exports) {
52
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.deduplicateKeys=u,exports.getPerformanceData=f,exports.getPerformanceEntriesByType=a,exports.optimisePerformanceData=i,exports.pageLoadFrom=c;var e=require("./utils"),r=n(require("./config"));function n(e){return e&&e.__esModule?e:{default:e}}function t(e){return(t="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})(e)}function o(e){return Number(e)===e&&e%1!=0}function i(e){return e.forEach(function(r,n){for(var t in r){var i=t;o(r[i])&&r[i].toString().match(/^\d+\.\d{4,}$/)&&(e[n][i]=Number(r[i].toFixed(3))),"serverTiming"===i&&0===r[i].length&&delete e[n][i],"entryType"===i&&"resource"===r[i]&&delete e[n][i],"nextHopProtocol"===i&&delete e[n][i],0===r[i]&&delete e[n][i]}}),u(e)}function a(n){try{return i(JSON.parse(JSON.stringify(e.window.performance.getEntriesByType(n))))}catch(t){return r.default.DEBUG&&console.warn("not able to capture performance data ("+n+") - "+t),[]}}function u(e){if(0===e.length)return[];var r=Object.keys(e[0]);return[r,e.map(function(e){return r.map(function(r){return e[r]})})]}function c(e){var r=e.navigation&&e.navigation[0],n=e.navigation&&e.navigation[1]&&e.navigation[1][0],t=r&&r.indexOf("duration");if(t>-1)return n[t];var o=r&&r.indexOf("loadEventEnd"),i=r&&r.indexOf("startTime");return o>-1?(n&&n[o])-(n&&n[i]||0):void 0}function f(){var r={navigation:a("navigation"),paint:a("paint"),resource:a("resource")};void 0!==t(e.window)&&e.window.performance&&e.window.performance.clearResourceTimings&&e.window.performance.clearResourceTimings();var n={},o=c(r);return o&&(n.$performance_page_loaded=o),n.$performance_raw=JSON.stringify(r),n}
53
- },{"./utils":"UnXq","./config":"C9JJ"}],"ivfD":[function(require,module,exports) {
54
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.SentryIntegration=void 0;var e=function(){return function(e,t,n,s){this.name="posthog-js",this.setupOnce=function(o){o(function(o){if("error"!==o.level||!e.__loaded)return o;o.tags||(o.tags={}),o.tags["PostHog Person URL"]=e.config.api_host+"/person/"+e.get_distinct_id(),e.sessionRecordingStarted()&&(o.tags["PostHog Recording URL"]=e.config.api_host+"/recordings/#sessionRecordingId="+e.sessionManager.checkAndGetSessionAndWindowId(!0).sessionId);var i={$sentry_event_id:o.event_id,$sentry_exception:o.exception};return t&&n&&(i.$sentry_url=(s||"https://sentry.io/organizations/")+t+"/issues/?project="+n+"&query="+o.event_id),e.capture("$exception",i),o})}}}();exports.SentryIntegration=e;
55
- },{}],"fQdl":[function(require,module,exports) {
56
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.PostHog=void 0,exports.init_as_module=L,exports.init_from_snippet=U;var e=require("./lz-string"),t=b(require("./config")),i=require("./utils"),o=require("./autocapture"),r=require("./posthog-people"),s=require("./posthog-featureflags"),n=require("./posthog-persistence"),a=require("./extensions/sessionrecording"),c=require("./decide"),_=require("./extensions/toolbar"),p=require("./gdpr-utils"),u=require("./storage"),d=require("./request-queue"),g=require("./capture-metrics"),l=require("./compression"),h=require("./send-request"),f=require("./retry-queue"),y=require("./sessionid"),v=require("./apm"),m=require("./extensions/sentry-integration");function b(e){return e&&e.__esModule?e:{default:e}}var k,w,q,I=function(){return(I=Object.assign||function(e){for(var t,i=1,o=arguments.length;i<o;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},x=function(e,t){var i="function"==typeof Symbol&&e[Symbol.iterator];if(!i)return e;var o,r,s=i.call(e),n=[];try{for(;(void 0===t||t-- >0)&&!(o=s.next()).done;)n.push(o.value)}catch(a){r={error:a}}finally{try{o&&!o.done&&(i=s.return)&&i.call(s)}finally{if(r)throw r.error}}return n},S=function(e,t,i){if(i||2===arguments.length)for(var o,r=0,s=t.length;r<s;r++)!o&&r in t||(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))};!function(e){e[e.INIT_MODULE=0]="INIT_MODULE",e[e.INIT_SNIPPET=1]="INIT_SNIPPET"}(k||(k={}));var E=function(){},F={},P="posthog",$=i.window.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest,A=!$&&-1===i.userAgent.indexOf("MSIE")&&-1===i.userAgent.indexOf("Mozilla"),M=function(){var e,t,o;return{api_host:"https://app.posthog.com",api_method:"POST",api_transport:"XHR",token:"",autocapture:!0,rageclick:!1,cross_subdomain_cookie:-1===(null===(t=null===(e=null===i.document||void 0===i.document?void 0:i.document.location)||void 0===e?void 0:e.hostname)||void 0===t?void 0:t.indexOf("herokuapp.com")),persistence:"cookie",persistence_name:"",cookie_name:"",loaded:E,store_google:!0,save_referrer:!0,test:!1,verbose:!1,img:!1,capture_pageview:!0,debug:!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_cookie:!1,enable_recording_console_log:!1,secure_cookie:"https:"===(null===(o=null===i.window||void 0===i.window?void 0:i.window.location)||void 0===o?void 0:o.protocol),ip:!0,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_capturing_persistence_type:"localStorage",opt_out_capturing_cookie_prefix:null,property_blacklist:[],respect_dnt:!1,sanitize_properties:null,xhr_headers:{},inapp_protocol:"//",inapp_link_new_window:!1,request_batching:!0,properties_string_max_length:65535,session_recording:{blockClass:"ph-no-capture",blockSelector:null,ignoreClass:"ph-ignore-input",maskAllInputs:!0,maskInputOptions:{},maskInputFn:null,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0},mask_all_element_attributes:!1,mask_all_text:!1,advanced_disable_decide:!1,advanced_disable_toolbar_metrics:!1,on_xhr_error:function(e){var t="Bad HTTP status: "+e.status+" "+e.statusText;console.error(t)},get_device_id:function(e){return e},_onCapture:E,_capture_metrics:!1,_capture_performance:!1,name:"posthog",callback_fn:"posthog._jsc"}},O=function(e,r,s){var n,c=s!==P&&q?s?q[s]:void 0:q;if(c&&w===k.INIT_MODULE)n=c;else{if(c&&!(0,i._isArray)(c))return void console.error("You have already initialized "+s);n=new T}if(n._init(e,r,s),n.toolbar.maybeLoadEditor(),n.sessionRecording=new a.SessionRecording(n),n.sessionRecording.startRecordingIfEnabled(),n.__autocapture_enabled=n.get_config("autocapture"),n.get_config("autocapture")){o.autocapture.enabledForProject(n.get_config("token"),100,100)?o.autocapture.isBrowserSupported()?o.autocapture.init(n):(n.__autocapture_enabled=!1,i.logger.log("Disabling Automatic Event Collection because this browser is not supported")):(n.__autocapture_enabled=!1,i.logger.log("Not in active bucket: disabling Automatic Event Collection."))}return t.default.DEBUG=t.default.DEBUG||n.get_config("debug"),void 0!==c&&(0,i._isArray)(c)&&(n._execute_array.call(n.people,c.people),n._execute_array(c)),n},T=function(){function o(){this.config=M(),this.compression={},this.decideEndpointWasHit=!1,this.SentryIntegration=m.SentryIntegration,this.__captureHooks=[],this.__request_queue=[],this.__loaded=!1,this.__autocapture_enabled=void 0,this._jsc=function(){},this.people=new r.PostHogPeople(this),this.featureFlags=new s.PostHogFeatureFlags(this),this.feature_flags=this.featureFlags,this.toolbar=new _.Toolbar(this),this._captureMetrics=void 0,this._requestQueue=void 0,this._retryQueue=void 0,this.persistence=void 0,this.sessionManager=void 0}return o.prototype.init=function(e,t,o){if((0,i._isUndefined)(o))console.error("You must name your new library: init(token, config, name)");else{if(o!==P){var r=O(e,t,o);return q[o]=r,r._loaded(),r}console.error("You must initialize the main posthog object right after you include the PostHog js snippet")}},o.prototype._init=function(e,t,o){if(void 0===t&&(t={}),this.__loaded=!0,this.config={},this._triggered_notifs=[],this.set_config((0,i._extend)({},M(),t,{name:o,token:e,callback_fn:(o===P?o:P+"."+o)+"._jsc"})),this._jsc=function(){},this._captureMetrics=new g.CaptureMetrics(this.get_config("_capture_metrics")),this._requestQueue=new d.RequestQueue(this._captureMetrics,this._handle_queued_event.bind(this)),this._retryQueue=new f.RetryQueue(this._captureMetrics,this.get_config("on_xhr_error")),this.__captureHooks=[],this.__request_queue=[],this.persistence=new n.PostHogPersistence(this.config),this.sessionManager=new y.SessionIdManager(this.config,this.persistence),this._gdpr_init(),!this.get_distinct_id()){var r=this.get_config("get_device_id")((0,i._UUID)());this.register_once({distinct_id:r,$device_id:r},"")}i.window.addEventListener&&i.window.addEventListener("unload",this._handle_unload.bind(this))},o.prototype._loaded=function(){this.featureFlags.setReloadingPaused(!0);try{this.get_config("loaded")(this)}catch(e){console.error("`loaded` function failed",e)}this._start_queue_if_opted_in(),this.get_config("capture_pageview")&&this.capture("$pageview",{},{send_instantly:!0}),this.get_config("advanced_disable_decide")||new c.Decide(this).call(),this.featureFlags.resetRequestQueue(),this.featureFlags.setReloadingPaused(!1)},o.prototype._start_queue_if_opted_in=function(){this.has_opted_out_capturing()||this.get_config("request_batching")&&this._requestQueue.poll()},o.prototype._dom_loaded=function(){var e=this;this.has_opted_out_capturing()||(0,i._eachArray)(this.__request_queue,function(t){e._send_request.apply(e,S([],x(t),!1))}),this.__request_queue=[],this._start_queue_if_opted_in()},o.prototype._prepare_callback=function(e,t){if((0,i._isUndefined)(e))return null;if($)return function(i){e(i,t)};var o=this._jsc,r=""+Math.floor(1e8*Math.random()),s=this.get_config("callback_fn")+"["+r+"]";return o[r]=function(i){delete o[r],e(i,t)},s},o.prototype._handle_unload=function(){this.get_config("request_batching")?(this.get_config("capture_pageview")&&this.capture("$pageleave"),this.get_config("_capture_metrics")&&(this._requestQueue.updateUnloadMetrics(),this.capture("$capture_metrics",this._captureMetrics.metrics)),this._requestQueue.unload(),this._retryQueue.unload()):this.get_config("capture_pageview")&&this.capture("$pageleave",null,{transport:"sendBeacon"})},o.prototype._handle_queued_event=function(e,t,i){var o=JSON.stringify(t);this.__compress_and_send_json_request(e,o,i||F,E)},o.prototype.__compress_and_send_json_request=function(e,t,i,o){var r=x((0,l.compressData)((0,l.decideCompression)(this.compression),t,i),2),s=r[0],n=r[1];this._send_request(e,s,n,o)},o.prototype._send_request=function(e,t,o,r){var s;if(A)this.__request_queue.push([e,t,o,r]);else{var n={method:this.get_config("api_method"),transport:this.get_config("api_transport"),verbose:this.get_config("verbose")};o=(0,i._extend)(n,o||{}),$||(o.method="GET");var a="sendBeacon"in i.window.navigator&&"sendBeacon"===o.transport;if(e=(0,h.addParamsToURL)(e,o.urlQueryArgs||{},{ip:this.get_config("ip")}),(0,i._isObject)(t)&&this.get_config("img")){var c=i.document.createElement("img");c.src=e,i.document.body.appendChild(c)}else if(a)try{i.window.navigator.sendBeacon(e,(0,h.encodePostData)(t,I(I({},o),{sendBeacon:!0})))}catch(u){this.get_config("debug")&&console.error(u)}else if($)try{(0,h.xhr)({url:e,data:t,headers:this.get_config("xhr_headers"),options:o,captureMetrics:this._captureMetrics,callback:r,retriesPerformedSoFar:0,retryQueue:this._retryQueue,onXHRError:this.get_config("on_xhr_error")})}catch(u){console.error(u)}else{var _=i.document.createElement("script");_.type="text/javascript",_.async=!0,_.defer=!0,_.src=e;var p=i.document.getElementsByTagName("script")[0];null===(s=p.parentNode)||void 0===s||s.insertBefore(_,p)}}},o.prototype._execute_array=function(e){var t,o=this,r=[],s=[],n=[];(0,i._eachArray)(e,function(e){e&&(t=e[0],(0,i._isArray)(t)?n.push(e):"function"==typeof e?e.call(o):(0,i._isArray)(e)&&"alias"===t?r.push(e):(0,i._isArray)(e)&&-1!==t.indexOf("capture")&&"function"==typeof o[t]?n.push(e):s.push(e))});var a=function(e,t){(0,i._eachArray)(e,function(e){if((0,i._isArray)(e[0])){var o=t;(0,i._each)(e,function(e){o=o[e[0]].apply(o,e.slice(1))})}else this[e[0]].apply(this,e.slice(1))},t)};a(r,this),a(s,this),a(n,this)},o.prototype.push=function(e){this._execute_array([e])},o.prototype.capture=function(e,t,o){if(void 0===o&&(o=F),this.__loaded&&!(0,p.userOptedOut)(this,!1)){this._captureMetrics.incr("capture"),"$snapshot"===e&&this._captureMetrics.incr("snapshot");var r=(o=o||F).transport;if(r&&(o.transport=r),(0,i._isUndefined)(e)||"string"!=typeof e)console.error("No event name provided to posthog.capture");else if(!(0,i._isBlockedUA)(i.userAgent)){var s=this.persistence.remove_event_timer(e);this.persistence.update_search_keyword(i.document.referrer),this.get_config("store_google")&&this.persistence.update_campaign_params(),this.get_config("save_referrer")&&this.persistence.update_referrer_info(i.document.referrer);var n={event:e,properties:this._calculate_event_properties(e,t||{},s)};"$identify"===e&&o.$set&&(n.$set=o.$set),(n=(0,i._copyAndTruncateStrings)(n,o._noTruncate?null:this.get_config("properties_string_max_length"))).timestamp=o.timestamp||new Date,this.get_config("debug")&&i.logger.log("PostHog.js send",n);var a=JSON.stringify(n),c=this.get_config("api_host")+(o.endpoint||"/e/"),_=o!==F;return!this.get_config("request_batching")||_&&!o._batchKey||o.send_instantly?this.__compress_and_send_json_request(c,a,o):this._requestQueue.enqueue(c,n,o),this._invokeCaptureHooks(e,n),n}}},o.prototype._addCaptureHook=function(e){this.__captureHooks.push(e)},o.prototype._invokeCaptureHooks=function(e,t){this.config._onCapture(e,t),(0,i._each)(this.__captureHooks,function(t){return t(e)})},o.prototype._calculate_event_properties=function(e,t,o){var r=I({},t);if(r.token=this.get_config("token"),"$snapshot"===e){var s=this.persistence.properties();return r.distinct_id=s.distinct_id,r}if(void 0!==o){var n=(new Date).getTime()-o;r.$duration=parseFloat((n/1e3).toFixed(3))}if(this.sessionManager){var a=this.sessionManager.checkAndGetSessionAndWindowId(),c=a.sessionId,_=a.windowId;r.$session_id=c,r.$window_id=_}r=(0,i._extend)({},i._info.properties(),this.persistence.properties(),r),"$pageview"===e&&this.get_config("_capture_performance")&&(r=(0,i._extend)(r,(0,v.getPerformanceData)()));var p=this.get_config("property_blacklist");(0,i._isArray)(p)?(0,i._each)(p,function(e){delete r[e]}):console.error("Invalid value for property_blacklist config: "+p);var u=this.get_config("sanitize_properties");return u&&(r=u(r,e)),r},o.prototype.register=function(e,t){this.persistence.register(e,t)},o.prototype.register_once=function(e,t,i){this.persistence.register_once(e,t,i)},o.prototype.unregister=function(e){this.persistence.unregister(e)},o.prototype._register_single=function(e,t){var i;this.register(((i={})[e]=t,i))},o.prototype.getFeatureFlag=function(e,t){return this.featureFlags.getFeatureFlag(e,t)},o.prototype.isFeatureEnabled=function(e,t){return this.featureFlags.isFeatureEnabled(e,t)},o.prototype.reloadFeatureFlags=function(){this.featureFlags.reloadFeatureFlags()},o.prototype.onFeatureFlags=function(e){return this.featureFlags.onFeatureFlags(e)},o.prototype.identify=function(e,t,i){if(e){this._captureMetrics.incr("identify");var o=this.get_distinct_id();if(this.register({$user_id:e}),!this.get_property("$device_id")){var r=o;this.register_once({$had_persisted_distinct_id:!0,$device_id:r},"")}e!==o&&e!==this.get_property(n.ALIAS_ID_KEY)&&(this.unregister(n.ALIAS_ID_KEY),this.register({distinct_id:e})),e===o||this.get_property("$device_id")&&o!==this.get_property("$device_id")?(t&&this.people.set(t),i&&this.people.set_once(i)):(this.capture("$identify",{distinct_id:e,$anon_distinct_id:o},{$set:t||{},$set_once:i||{}}),this.featureFlags.setAnonymousDistinctId(o)),e!==o&&this.reloadFeatureFlags()}else console.error("Unique user id has not been set in posthog.identify")},o.prototype.group=function(e,t,i){var o;if(e&&t){this._captureMetrics.incr("group");var r=this.getGroups();this.register({$groups:I(I({},r),(o={},o[e]=t,o))}),i&&this.capture("$groupidentify",{$group_type:e,$group_key:t,$group_set:i}),r[e]!==t&&this.reloadFeatureFlags()}else console.error("posthog.group requires a group type and group key")},o.prototype.reset=function(e){var t=this.get_property("$device_id");this.persistence.clear(),this.sessionManager.resetSessionId();var o=this.get_config("get_device_id")((0,i._UUID)());this.register_once({distinct_id:o,$device_id:e?o:t},"")},o.prototype.get_distinct_id=function(){return this.get_property("distinct_id")},o.prototype.getGroups=function(){return this.get_property("$groups")||{}},o.prototype.alias=function(e,t){return e===this.get_property(n.PEOPLE_DISTINCT_ID_KEY)?(i.logger.critical("Attempting to create alias for existing People user - aborting."),-2):((0,i._isUndefined)(t)&&(t=this.get_distinct_id()),e!==t?(this._register_single(n.ALIAS_ID_KEY,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(console.error("alias matches current distinct_id - skipping api call."),this.identify(e),-1))},o.prototype.set_config=function(e){var o=I({},this.config);(0,i._isObject)(e)&&((0,i._extend)(this.config,e),this.get_config("persistence_name")||(this.config.persistence_name=this.config.cookie_name),this.get_config("disable_persistence")||(this.config.disable_persistence=this.config.disable_cookie),this.persistence&&this.persistence.update_config(this.config),u.localStore.is_supported()&&"true"===u.localStore.get("ph_debug")&&(this.config.debug=!0),this.get_config("debug")&&(t.default.DEBUG=!0),this.sessionRecording&&void 0!==e.disable_session_recording&&o.disable_session_recording!==e.disable_session_recording&&(e.disable_session_recording?this.sessionRecording.stopRecording():this.sessionRecording.startRecordingIfEnabled()))},o.prototype.startSessionRecording=function(){this.set_config({disable_session_recording:!1})},o.prototype.stopSessionRecording=function(){this.set_config({disable_session_recording:!0})},o.prototype.sessionRecordingStarted=function(){var e;return!!(null===(e=this.sessionRecording)||void 0===e?void 0:e.started())},o.prototype.get_config=function(e){var t;return null===(t=this.config)||void 0===t?void 0:t[e]},o.prototype.get_property=function(e){return this.persistence.props[e]},o.prototype.toString=function(){var e,t=null!==(e=this.get_config("name"))&&void 0!==e?e:P;return t!==P&&(t=P+"."+t),t},o.prototype._gdpr_init=function(){"localStorage"===this.get_config("opt_out_capturing_persistence_type")&&u.localStore.is_supported()&&(!this.has_opted_in_capturing()&&this.has_opted_in_capturing({persistence_type:"cookie"})&&this.opt_in_capturing({enable_persistence:!1}),!this.has_opted_out_capturing()&&this.has_opted_out_capturing({persistence_type:"cookie"})&&this.opt_out_capturing({clear_persistence:!1}),this.clear_opt_in_out_capturing({persistence_type:"cookie",enable_persistence:!1})),this.has_opted_out_capturing()?this._gdpr_update_persistence({clear_persistence:!0}):this.has_opted_in_capturing()||!this.get_config("opt_out_capturing_by_default")&&!u.cookieStore.get("ph_optout")||(u.cookieStore.remove("ph_optout"),this.opt_out_capturing({clear_persistence:this.get_config("opt_out_persistence_by_default")}))},o.prototype._gdpr_update_persistence=function(e){var t;if(e&&e.clear_persistence)t=!0;else{if(!e||!e.enable_persistence)return;t=!1}this.get_config("disable_persistence")||this.persistence.disabled===t||this.persistence.set_disabled(t)},o.prototype._gdpr_call_func=function(e,t){return t=(0,i._extend)({capture:this.capture.bind(this),persistence_type:this.get_config("opt_out_capturing_persistence_type"),cookie_prefix:this.get_config("opt_out_capturing_cookie_prefix"),cookie_expiration:this.get_config("cookie_expiration"),cross_subdomain_cookie:this.get_config("cross_subdomain_cookie"),secure_cookie:this.get_config("secure_cookie")},t||{}),u.localStore.is_supported()||"localStorage"!==t.persistence_type||(t.persistence_type="cookie"),e(this.get_config("token"),{capture:t.capture,captureEventName:t.capture_event_name,captureProperties:t.capture_properties,persistenceType:t.persistence_type,persistencePrefix:t.cookie_prefix,cookieExpiration:t.cookie_expiration,crossSubdomainCookie:t.cross_subdomain_cookie,secureCookie:t.secure_cookie})},o.prototype.opt_in_capturing=function(e){e=(0,i._extend)({enable_persistence:!0},e||{}),this._gdpr_call_func(p.optIn,e),this._gdpr_update_persistence(e)},o.prototype.opt_out_capturing=function(e){var t=(0,i._extend)({clear_persistence:!0},e||{});this._gdpr_call_func(p.optOut,t),this._gdpr_update_persistence(t)},o.prototype.has_opted_in_capturing=function(e){return this._gdpr_call_func(p.hasOptedIn,e)},o.prototype.has_opted_out_capturing=function(e){return this._gdpr_call_func(p.hasOptedOut,e)},o.prototype.clear_opt_in_out_capturing=function(e){var t=(0,i._extend)({enable_persistence:!0},null!=e?e:{});this._gdpr_call_func(p.clearOptInOut,t),this._gdpr_update_persistence(t)},o.prototype.debug=function(e){!1===e?(i.window.console.log("You've disabled debug mode."),localStorage&&localStorage.removeItem("ph_debug"),this.set_config({debug:!1})):(i.window.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),localStorage&&localStorage.setItem("ph_debug","true"),this.set_config({debug:!0}))},o.prototype.decodeLZ64=function(t){return e.LZString.decompressFromBase64(t||null)},o}();exports.PostHog=T,(0,i._safewrap_class)(T,["identify"]);var D={},R=function(){(0,i._each)(D,function(e,t){t!==P&&(q[t]=e)})},H=function(){q.init=function(e,t,o){if(o)return q[o]||(q[o]=D[o]=O(e||"",t||{},o),q[o]._loaded()),q[o];var r=q;return D[P]?r=D[P]:e&&((r=O(e,t||{},P))._loaded(),D[P]=r),q=r,w===k.INIT_SNIPPET&&(i.window[P]=q),R(),r}},N=function(){function e(){e.done||(e.done=!0,A=!1,(0,i._each)(D,function(e){e._dom_loaded()}))}i.document.addEventListener&&("complete"===i.document.readyState?e():i.document.addEventListener("DOMContentLoaded",e,!1)),(0,i._register_event)(i.window,"load",e,!0)};function U(){w=k.INIT_SNIPPET,(0,i._isUndefined)(i.window.posthog)&&(i.window.posthog=[]),(q=i.window.posthog).__loaded||q.config&&q.persistence?console.error("PostHog library has already been downloaded at least once."):((0,i._each)(q._i,function(e){e&&(0,i._isArray)(e)&&(D[e[2]]=O.apply(void 0,S([],x(e),!1)))}),H(),q.init(),(0,i._each)(D,function(e){e._loaded()}),N())}function L(){return w=k.INIT_MODULE,q=new T,H(),q.init(),N(),q}
57
- },{"./lz-string":"iwXh","./config":"C9JJ","./utils":"UnXq","./autocapture":"+QN3","./posthog-people":"GxDb","./posthog-featureflags":"rr+t","./posthog-persistence":"8kGX","./extensions/sessionrecording":"3pq5","./decide":"UrLq","./extensions/toolbar":"1RJB","./gdpr-utils":"LECo","./storage":"1GYW","./request-queue":"YL63","./capture-metrics":"K3eQ","./compression":"/wh9","./send-request":"9tuT","./retry-queue":"8mr1","./sessionid":"Rb1F","./apm":"Z1nr","./extensions/sentry-integration":"ivfD"}],"SSOK":[function(require,module,exports) {
58
- "use strict";var r=require("./posthog-core");(0,r.init_from_snippet)();
59
- },{"./posthog-core":"fQdl"}]},{},["SSOK"], null)
60
- //# sourceMappingURL=/static/array.js.map
1
+ !function(){"use strict";function e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function t(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?e(Object(r),!0).forEach((function(e){s(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):e(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function n(e){return n="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},n(e)}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function o(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function s(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&u(e,t)}function c(e){return c=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},c(e)}function u(e,t){return u=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},u(e,t)}function l(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function d(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=c(e);if(t){var i=c(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return l(this,n)}}function p(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)return;var r,i,o=[],s=!0,a=!1;try{for(n=n.call(e);!(s=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);s=!0);}catch(e){a=!0,i=e}finally{try{s||null==n.return||n.return()}finally{if(a)throw i}}return o}(e,t)||h(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 f(e){return function(e){if(Array.isArray(e))return _(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||h(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(e,t){if(e){if("string"==typeof e)return _(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_(e,t):void 0}}function _(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function g(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=h(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}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 o,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,o=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw o}}}}var v=String.fromCharCode,y="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",m="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",w={};function b(e,t){if(!w[e]){w[e]={};for(var n=0;n<e.length;n++)w[e][e.charAt(n)]=n}return w[e][t]}var k={compressToBase64:function(e){if(null==e)return"";var t=k._compress(e,6,(function(e){return y.charAt(e)}));switch(t.length%4){default:case 0:return t;case 1:return t+"===";case 2:return t+"==";case 3:return t+"="}},decompressFromBase64:function(e){return null==e?"":""==e?null:k._decompress(e.length,32,(function(t){return b(y,e.charAt(t))}))},compressToUTF16:function(e){return null==e?"":k._compress(e,15,(function(e){return v(e+32)}))+" "},decompressFromUTF16:function(e){return null==e?"":""==e?null:k._decompress(e.length,16384,(function(t){return e.charCodeAt(t)-32}))},compressToUint8Array:function(e){for(var t=k.compress(e),n=new Uint8Array(2*t.length),r=0,i=t.length;r<i;r++){var o=t.charCodeAt(r);n[2*r]=o>>>8,n[2*r+1]=o%256}return n},decompressFromUint8Array:function(e){if(null==e)return k.decompress(e);for(var t=new Array(e.length/2),n=0,r=t.length;n<r;n++)t[n]=256*e[2*n]+e[2*n+1];var i=[];return t.forEach((function(e){i.push(v(e))})),k.decompress(i.join(""))},compressToEncodedURIComponent:function(e){return null==e?"":k._compress(e,6,(function(e){return m.charAt(e)}))},decompressFromEncodedURIComponent:function(e){return null==e?"":""==e?null:(e=e.replace(/ /g,"+"),k._decompress(e.length,32,(function(t){return b(m,e.charAt(t))})))},compress:function(e){return k._compress(e,16,(function(e){return v(e)}))},_compress:function(e,t,n){if(null==e)return"";var r,i,o,s="",a="",c="",u=2,l=3,d=2,p=0,f=0,h={},_={},g=[];for(o=0;o<e.length;o+=1)if(s=e.charAt(o),Object.prototype.hasOwnProperty.call(h,s)||(h[s]=l++,_[s]=!0),a=c+s,Object.prototype.hasOwnProperty.call(h,a))c=a;else{if(Object.prototype.hasOwnProperty.call(_,c)){if(c.charCodeAt(0)<256){for(r=0;r<d;r++)p<<=1,f==t-1?(f=0,g.push(n(p)),p=0):f++;for(i=c.charCodeAt(0),r=0;r<8;r++)p=p<<1|1&i,f==t-1?(f=0,g.push(n(p)),p=0):f++,i>>=1}else{for(i=1,r=0;r<d;r++)p=p<<1|i,f==t-1?(f=0,g.push(n(p)),p=0):f++,i=0;for(i=c.charCodeAt(0),r=0;r<16;r++)p=p<<1|1&i,f==t-1?(f=0,g.push(n(p)),p=0):f++,i>>=1}0==--u&&(u=Math.pow(2,d),d++),delete _[c]}else for(i=h[c],r=0;r<d;r++)p=p<<1|1&i,f==t-1?(f=0,g.push(n(p)),p=0):f++,i>>=1;0==--u&&(u=Math.pow(2,d),d++),h[a]=l++,c=String(s)}if(""!==c){if(Object.prototype.hasOwnProperty.call(_,c)){if(c.charCodeAt(0)<256){for(r=0;r<d;r++)p<<=1,f==t-1?(f=0,g.push(n(p)),p=0):f++;for(i=c.charCodeAt(0),r=0;r<8;r++)p=p<<1|1&i,f==t-1?(f=0,g.push(n(p)),p=0):f++,i>>=1}else{for(i=1,r=0;r<d;r++)p=p<<1|i,f==t-1?(f=0,g.push(n(p)),p=0):f++,i=0;for(i=c.charCodeAt(0),r=0;r<16;r++)p=p<<1|1&i,f==t-1?(f=0,g.push(n(p)),p=0):f++,i>>=1}0==--u&&(u=Math.pow(2,d),d++),delete _[c]}else for(i=h[c],r=0;r<d;r++)p=p<<1|1&i,f==t-1?(f=0,g.push(n(p)),p=0):f++,i>>=1;0==--u&&(u=Math.pow(2,d),d++)}for(i=2,r=0;r<d;r++)p=p<<1|1&i,f==t-1?(f=0,g.push(n(p)),p=0):f++,i>>=1;for(;;){if(p<<=1,f==t-1){g.push(n(p));break}f++}return g.join("")},decompress:function(e){return null==e?"":""==e?null:k._decompress(e.length,32768,(function(t){return e.charCodeAt(t)}))},_decompress:function(e,t,n){var r,i,o,s,a,c,u,l=[],d=[],p={val:n(0),position:t,index:1},f=4,h=4,_=3,g="";for(r=0;r<3;r+=1)l[r]=r;for(o=0,a=Math.pow(2,2),c=1;c!=a;)s=p.val&p.position,p.position>>=1,0==p.position&&(p.position=t,p.val=n(p.index++)),o|=(s>0?1:0)*c,c<<=1;switch(o){case 0:for(o=0,a=Math.pow(2,8),c=1;c!=a;)s=p.val&p.position,p.position>>=1,0==p.position&&(p.position=t,p.val=n(p.index++)),o|=(s>0?1:0)*c,c<<=1;u=v(o);break;case 1:for(o=0,a=Math.pow(2,16),c=1;c!=a;)s=p.val&p.position,p.position>>=1,0==p.position&&(p.position=t,p.val=n(p.index++)),o|=(s>0?1:0)*c,c<<=1;u=v(o);break;case 2:return""}for(l[3]=u,i=u,d.push(u);;){if(p.index>e)return"";for(o=0,a=Math.pow(2,_),c=1;c!=a;)s=p.val&p.position,p.position>>=1,0==p.position&&(p.position=t,p.val=n(p.index++)),o|=(s>0?1:0)*c,c<<=1;switch(u=o){case 0:for(o=0,a=Math.pow(2,8),c=1;c!=a;)s=p.val&p.position,p.position>>=1,0==p.position&&(p.position=t,p.val=n(p.index++)),o|=(s>0?1:0)*c,c<<=1;l[h++]=v(o),u=h-1,f--;break;case 1:for(o=0,a=Math.pow(2,16),c=1;c!=a;)s=p.val&p.position,p.position>>=1,0==p.position&&(p.position=t,p.val=n(p.index++)),o|=(s>0?1:0)*c,c<<=1;l[h++]=v(o),u=h-1,f--;break;case 2:return d.join("")}if(0==f&&(f=Math.pow(2,_),_++),l[u])g=l[u];else{if(u!==h)return null;g=i+i.charAt(0)}d.push(g),l[h++]=i+g.charAt(0),i=g,0==--f&&(f=Math.pow(2,_),_++)}}},S={DEBUG:!1,LIB_VERSION:"1.29.0"},I=Array.prototype,O=Object.prototype,x=O.toString,A=O.hasOwnProperty,E="undefined"!=typeof window?window:{},F=E.navigator||{userAgent:""},P=E.document||{},$=F.userAgent,C=I.forEach,T=I.indexOf,M=Array.isArray,R={},q=function(){if(S.DEBUG&&!J(window.console)&&window.console){for(var e=("__rrweb_original__"in window.console.log?window.console.log.__rrweb_original__:window.console.log),t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];try{e.apply(window.console,n)}catch(t){L(n,(function(t){e(t)}))}}},j=function(){if(S.DEBUG&&!J(window.console)&&window.console){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=["PostHog error:"].concat(t),i="__rrweb_original__"in window.console.error?window.console.error.__rrweb_original__:window.console.error;try{i.apply(window.console,r)}catch(e){L(r,(function(e){i(e)}))}}},N=function(){if(!J(window.console)&&window.console){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=["PostHog error:"].concat(t),i="__rrweb_original__"in window.console.error?window.console.error.__rrweb_original__:window.console.error;try{i.apply(window.console,r)}catch(e){L(r,(function(e){i(e)}))}}},D=function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")};function B(e,t,n){if(null!=e)if(C&&Array.isArray(e)&&e.forEach===C)e.forEach(t,n);else if("length"in e&&e.length===+e.length){for(var r=0,i=e.length;r<i;r++)if(r in e&&t.call(n,e[r],r)===R)return}else for(var o in e)if(A.call(e,o)&&t.call(n,e[o],o)===R)return}function L(e,t,n){if(Array.isArray(e))if(C&&e.forEach===C)e.forEach(t,n);else if("length"in e&&e.length===+e.length)for(var r=0,i=e.length;r<i;r++)if(r in e&&t.call(n,e[r],r)===R)return}var U=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return L(n,(function(t){for(var n in t)void 0!==t[n]&&(e[n]=t[n])})),e},H=M||function(e){return"[object Array]"===x.call(e)},W=function(e){try{return/^\s*\bfunction\b/.test(e)}catch(e){return!1}};function Q(e,t){return-1!==e.indexOf(t)}var G=function(e){return e===Object(e)&&!H(e)},J=function(e){return void 0===e},z=function(e){return"[object String]"==x.call(e)},V=function e(t){return B(t,(function(n,r){!function(e){return"[object Date]"==x.call(e)}(n)?G(n)&&(t[r]=e(n)):t[r]=Z(n)})),t},Z=function(e){function t(e){return e<10?"0"+e:e}return e.getUTCFullYear()+"-"+t(e.getUTCMonth()+1)+"-"+t(e.getUTCDate())+"T"+t(e.getUTCHours())+":"+t(e.getUTCMinutes())+":"+t(e.getUTCSeconds())},X=function(e){return function(){try{for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return e.apply(this,n)}catch(e){N("Implementation error. Please turn on debug and contact support@posthog.com."),S.DEBUG&&N(e)}}},Y=function(e){var t={};return B(e,(function(e,n){z(e)&&e.length>0&&(t[n]=e)})),t},K="undefined"!=typeof Symbol?Symbol("__deepCircularCopyInProgress__"):"__deepCircularCopyInProgress__";function ee(e,t,n){return e!==Object(e)?t?t(e,n):e:e[K]?void 0:(e[K]=!0,H(e)?(r=[],L(e,(function(e){r.push(ee(e,t))}))):(r={},B(e,(function(e,n){n!==K&&(r[n]=ee(e,t,n))}))),delete e[K],r);var r}var te=["$performance_raw"];function ne(e,t){return ee(e,(function(e,n){return n&&te.indexOf(n)>-1?e:"string"==typeof e&&null!==t?e.slice(0,t):e}))}function re(e){var t,n,r,i,o,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",a=0,c=0,u="",l=[];if(!e)return e;e=oe(e);do{t=(o=e.charCodeAt(a++)<<16|e.charCodeAt(a++)<<8|e.charCodeAt(a++))>>18&63,n=o>>12&63,r=o>>6&63,i=63&o,l[c++]=s.charAt(t)+s.charAt(n)+s.charAt(r)+s.charAt(i)}while(a<e.length);switch(u=l.join(""),e.length%3){case 1:u=u.slice(0,-2)+"==";break;case 2:u=u.slice(0,-1)+"="}return u}var ie,oe=function(e){var t,n,r,i,o="";for(t=n=0,r=(e=(e+"").replace(/\r\n/g,"\n").replace(/\r/g,"\n")).length,i=0;i<r;i++){var s=e.charCodeAt(i),a=null;s<128?n++:a=s>127&&s<2048?String.fromCharCode(s>>6|192,63&s|128):String.fromCharCode(s>>12|224,s>>6&63|128,63&s|128),null!==a&&(n>t&&(o+=e.substring(t,n)),o+=a,t=n=i+1)}return n>t&&(o+=e.substring(t,e.length)),o},se=(ie=function(){for(var e=(new Date).valueOf(),t=0;e==(new Date).valueOf();)t++;return e.toString(16)+t.toString(16)},function(){var e=(window.screen.height*window.screen.width).toString(16);return ie()+"-"+Math.random().toString(16).replace(".","")+"-"+function(){var e,t,n=$,r=0,i=[];function o(e,t){var n,r=0;for(n=0;n<t.length;n++)r|=i[n]<<8*n;return e^r}for(e=0;e<n.length;e++)t=n.charCodeAt(e),i.unshift(255&t),i.length>=4&&(r=o(r,i),i=[]);return i.length>0&&(r=o(r,i)),r.toString(16)}()+"-"+e+"-"+ie()}),ae=function(e){return!!/(google web preview|baiduspider|yandexbot|bingbot|googlebot|yahoo! slurp|ahrefsbot|facebookexternalhit|facebookcatalog)/i.test(e)},ce=function(e,t){var n=t.replace(/[[]/,"\\[").replace(/[\]]/,"\\]"),r=new RegExp("[\\?&]"+n+"=([^&#]*)").exec(e);if(null===r||r&&"string"!=typeof r[1]&&r[1].length)return"";var i=r[1];try{i=decodeURIComponent(i)}catch(e){j("Skipping decoding for malformed query param: "+i)}return i.replace(/\+/g," ")},ue=function(e,t){var n=e.match(new RegExp(t+"=([^&]*)"));return n?n[1]:null},le=function(){function e(t){return t&&(t.preventDefault=e.preventDefault,t.stopPropagation=e.stopPropagation),t}return e.preventDefault=function(){this.returnValue=!1},e.stopPropagation=function(){this.cancelBubble=!0},function(t,n,r,i,o){if(t)if(t.addEventListener&&!i)t.addEventListener(n,r,!!o);else{var s="on"+n,a=t[s];t[s]=function(t,n,r){return function(i){if(i=i||e(window.event)){var o,s=!0;W(r)&&(o=r(i));var a=n.call(t,i);return!1!==o&&!1!==a||(s=!1),s}}}(t,r,a)}else j("No valid element provided to register_event")}}(),de={campaignParams:function(){var e="utm_source utm_medium utm_campaign utm_content utm_term gclid fbclid msclkid".split(" "),t={};return B(e,(function(e){var n=ce(P.URL,e);n.length&&(t[e]=n)})),t},searchEngine:function(e){return 0===e.search("https?://(.*)google.([^/?]*)")?"google":0===e.search("https?://(.*)bing.com")?"bing":0===e.search("https?://(.*)yahoo.com")?"yahoo":0===e.search("https?://(.*)duckduckgo.com")?"duckduckgo":null},searchInfo:function(e){var t=de.searchEngine(e),n="yahoo"!=t?"q":"p",r={};if(null!==t){r.$search_engine=t;var i=ce(e,n);i.length&&(r.ph_keyword=i)}return r},browser:function(e,t,n){return t=t||"",n||Q(e," OPR/")?Q(e,"Mini")?"Opera Mini":"Opera":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":Q(e,"IEMobile")||Q(e,"WPDesktop")?"Internet Explorer Mobile":Q(e,"SamsungBrowser/")?"Samsung Internet":Q(e,"Edge")||Q(e,"Edg/")?"Microsoft Edge":Q(e,"FBIOS")?"Facebook Mobile":Q(e,"Chrome")?"Chrome":Q(e,"CriOS")?"Chrome iOS":Q(e,"UCWEB")||Q(e,"UCBrowser")?"UC Browser":Q(e,"FxiOS")?"Firefox iOS":Q(t,"Apple")?Q(e,"Mobile")?"Mobile Safari":"Safari":Q(e,"Android")?"Android Mobile":Q(e,"Konqueror")?"Konqueror":Q(e,"Firefox")?"Firefox":Q(e,"MSIE")||Q(e,"Trident/")?"Internet Explorer":Q(e,"Gecko")?"Mozilla":""},browserVersion:function(e,t,n){var r={"Internet Explorer Mobile":/rv:(\d+(\.\d+)?)/,"Microsoft Edge":/Edge?\/(\d+(\.\d+)?)/,Chrome:/Chrome\/(\d+(\.\d+)?)/,"Chrome iOS":/CriOS\/(\d+(\.\d+)?)/,"UC Browser":/(UCBrowser|UCWEB)\/(\d+(\.\d+)?)/,Safari:/Version\/(\d+(\.\d+)?)/,"Mobile Safari":/Version\/(\d+(\.\d+)?)/,Opera:/(Opera|OPR)\/(\d+(\.\d+)?)/,Firefox:/Firefox\/(\d+(\.\d+)?)/,"Firefox iOS":/FxiOS\/(\d+(\.\d+)?)/,Konqueror:/Konqueror:(\d+(\.\d+)?)/,BlackBerry:/BlackBerry (\d+(\.\d+)?)/,"Android Mobile":/android\s(\d+(\.\d+)?)/,"Samsung Internet":/SamsungBrowser\/(\d+(\.\d+)?)/,"Internet Explorer":/(rv:|MSIE )(\d+(\.\d+)?)/,Mozilla:/rv:(\d+(\.\d+)?)/}[de.browser(e,t,n)];if(void 0===r)return null;var i=e.match(r);return i?parseFloat(i[i.length-2]):null},os:function(){var e=$;return/Windows/i.test(e)?/Phone/.test(e)||/WPDesktop/.test(e)?"Windows Phone":"Windows":/(iPhone|iPad|iPod)/.test(e)?"iOS":/Android/.test(e)?"Android":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":/Mac/i.test(e)?"Mac OS X":/Linux/.test(e)?"Linux":/CrOS/.test(e)?"Chrome OS":""},device:function(e){return/Windows Phone/i.test(e)||/WPDesktop/.test(e)?"Windows Phone":/iPad/.test(e)?"iPad":/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":/Android/.test(e)&&!/Mobile/.test(e)?"Android Tablet":/Android/.test(e)?"Android":""},deviceType:function(e){var t=this.device(e);return"iPad"===t||"Android Tablet"===t?"Tablet":t?"Mobile":"Desktop"},referringDomain:function(e){var t=e.split("/");return t.length>=3?t[2]:""},properties:function(){return U(Y({$os:de.os(),$browser:de.browser($,F.vendor,window.opera),$device:de.device($),$device_type:de.deviceType($)}),{$current_url:window.location.href,$host:window.location.host,$pathname:window.location.pathname,$browser_version:de.browserVersion($,F.vendor,window.opera),$screen_height:window.screen.height,$screen_width:window.screen.width,$viewport_height:window.innerHeight,$viewport_width:window.innerWidth,$lib:"web",$lib_version:S.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:(Date.now=Date.now||function(){return+new Date},Date.now()/1e3)})},people_properties:function(){return U(Y({$os:de.os(),$browser:de.browser($,F.vendor,window.opera)}),{$browser_version:de.browserVersion($,F.vendor,window.opera)})}};function pe(e){switch(n(e.className)){case"string":return e.className;case"object":return("baseVal"in e.className?e.className.baseVal:null)||e.getAttribute("class")||"";default:return""}}function fe(e){var t="";return me(e)&&!we(e)&&e.childNodes&&e.childNodes.length&&B(e.childNodes,(function(e){ge(e)&&e.textContent&&(t+=D(e.textContent).split(/(\s+)/).filter(be).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255))})),D(t)}function he(e){return!!e&&1===e.nodeType}function _e(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function ge(e){return!!e&&3===e.nodeType}function ve(e){return!!e&&11===e.nodeType}var ye=["a","button","form","input","select","textarea","label"];function me(e){for(var t=e;t.parentNode&&!_e(t,"body");t=t.parentNode){var n=pe(t).split(" ");if(Q(n,"ph-sensitive")||Q(n,"ph-no-capture"))return!1}if(Q(pe(e).split(" "),"ph-include"))return!0;var r=e.type||"";if("string"==typeof r)switch(r.toLowerCase()){case"hidden":case"password":return!1}var i=e.name||e.id||"";if("string"==typeof i){if(/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(i.replace(/[^a-zA-Z0-9]/g,"")))return!1}return!0}function we(e){return!!(_e(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||_e(e,"select")||_e(e,"textarea")||"true"===e.getAttribute("contenteditable"))}function be(e){if(null===e||J(e))return!1;if("string"==typeof e){e=D(e);if(/^(?:(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11}))$/.test((e||"").replace(/[- ]/g,"")))return!1;if(/(^\d{3}-?\d{2}-?\d{4}$)/.test(e))return!1}return!0}function ke(e,t){var n=document.createElement("script");n.type="text/javascript",n.src=e,n.onload=t;var r,i=document.getElementsByTagName("script");i.length>0?null===(r=i[0].parentNode)||void 0===r||r.insertBefore(n,i[0]):document.body.appendChild(n)}var Se=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.get_config("rageclick");r(this,e),this.clicks=[],this.instance=t,this.enabled=n}return o(e,[{key:"click",value:function(e,t,n){if(this.enabled){var r=this.clicks[this.clicks.length-1];r&&Math.abs(e-r.x)+Math.abs(t-r.y)<30&&n-r.timestamp<1e3?(this.clicks.push({x:e,y:t,timestamp:n}),3===this.clicks.length&&this.instance.capture("$rageclick")):this.clicks=[{x:e,y:t,timestamp:n}]}}}]),e}(),Ie={_initializedTokens:[],_previousElementSibling:function(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do{t=t.previousSibling}while(t&&!he(t));return t},_getPropertiesFromElement:function(e,t,n){var r=e.tagName.toLowerCase(),i={tag_name:r};ye.indexOf(r)>-1&&!n&&(i.$el_text=fe(e));var o=pe(e);o.length>0&&(i.classes=o.split(" ").filter((function(e){return""!==e}))),B(e.attributes,(function(n){var r;we(e)&&-1===["name","id","class"].indexOf(n.name)||!t&&be(n.value)&&("string"!=typeof(r=n.name)||"_ngcontent"!==r.substring(0,10)&&"_nghost"!==r.substring(0,7))&&(i["attr__"+n.name]=n.value)}));for(var s=1,a=1,c=e;c=this._previousElementSibling(c);)s++,c.tagName===e.tagName&&a++;return i.nth_child=s,i.nth_of_type=a,i},_getDefaultProperties:function(e){return{$event_type:e,$ce_version:1}},_extractCustomPropertyValue:function(e){var t=[];return B(document.querySelectorAll(e.css_selector),(function(e){var n;["input","select"].indexOf(e.tagName.toLowerCase())>-1?n=e.value:e.textContent&&(n=e.textContent),be(n)&&t.push(n)})),t.join(", ")},_getCustomProperties:function(e){var t=this,n={};return B(this._customProperties,(function(r){B(r.event_selectors,(function(i){B(document.querySelectorAll(i),(function(i){Q(e,i)&&me(i)&&(n[r.name]=t._extractCustomPropertyValue(r))}))}))})),n},_getEventTarget:function(e){return void 0===e.target?e.srcElement||null:null!==(t=e.target)&&void 0!==t&&t.shadowRoot?e.composedPath()[0]||null:e.target||null;var t},_captureEvent:function(e,t){var n,r=this,i=this._getEventTarget(e);(ge(i)&&(i=i.parentNode||null),"click"===e.type&&e instanceof MouseEvent)&&(null===(n=this.rageclicks)||void 0===n||n.click(e.clientX,e.clientY,(new Date).getTime()));if(i&&function(e,t){if(!e||_e(e,"html")||!he(e))return!1;for(var n=!1,r=[e],i=!0,o=e;o.parentNode&&!_e(o,"body");)if(ve(o.parentNode))r.push(o.parentNode.host),o=o.parentNode.host;else{if(!(i=o.parentNode||!1))break;if(ye.indexOf(i.tagName.toLowerCase())>-1)n=!0;else{var s=window.getComputedStyle(i);s&&"pointer"===s.getPropertyValue("cursor")&&(n=!0)}r.push(i),o=i}var a=window.getComputedStyle(e);if(a&&"pointer"===a.getPropertyValue("cursor")&&"click"===t.type)return!0;var c=e.tagName.toLowerCase();switch(c){case"html":return!1;case"form":return"submit"===t.type;case"input":case"select":case"textarea":return"change"===t.type||"click"===t.type;default:return n?"click"===t.type:"click"===t.type&&(ye.indexOf(c)>-1||"true"===e.getAttribute("contenteditable"))}}(i,e)){for(var o=[i],s=i;s.parentNode&&!_e(s,"body");)ve(s.parentNode)?(o.push(s.parentNode.host),s=s.parentNode.host):(o.push(s.parentNode),s=s.parentNode);var a,c=[],u=!1;if(B(o,(function(e){var n=me(e);"a"===e.tagName.toLowerCase()&&(a=e.getAttribute("href"),a=n&&be(a)&&a),Q(pe(e).split(" "),"ph-no-capture")&&(u=!0),c.push(r._getPropertiesFromElement(e,t.get_config("mask_all_element_attributes"),t.get_config("mask_all_text")))})),t.get_config("mask_all_text")||(c[0].$el_text=fe(i)),a&&(c[0].attr__href=a),u)return!1;var l=U(this._getDefaultProperties(e.type),{$elements:c},this._getCustomProperties(o));return t.capture("$autocapture",l),!0}},_navigate:function(e){window.location.href=e},_addDomEventHandlers:function(e){var t=this,n=function(n){n=n||window.event,t._captureEvent(n,e)};le(document,"submit",n,!1,!0),le(document,"change",n,!1,!0),le(document,"click",n,!1,!0)},_customProperties:[],rageclicks:null,init:function(e){this.rageclicks=new Se(e)},afterDecideResponse:function(e,t){var n=t.get_config("token");this._initializedTokens.indexOf(n)>-1?q('autocapture already initialized for token "'+n+'"'):(this._initializedTokens.push(n),e&&e.config&&e.config.enable_collect_everything&&t.get_config("autocapture")?(e.custom_properties&&(this._customProperties=e.custom_properties),this._addDomEventHandlers(t)):t.__autocapture_enabled=!1)},enabledForProject:function(e,t,n){if(!e)return!0;t=J(t)?10:t,n=J(n)?10:n;for(var r=0,i=0;i<e.length;i++)r+=e.charCodeAt(i);return r%t<n},isBrowserSupported:function(){return W(document.querySelectorAll)}};!function(e){for(var t in e)"function"==typeof e[t]&&(e[t]=e[t].bind(e))}(Ie),function(e){for(var t in e)"function"==typeof e[t]&&(e[t]=X(e[t]))}(Ie);var Oe=/[a-z0-9][a-z0-9-]+\.[a-z.]{2,6}$/i,xe={is_supported:function(){return!0},error:function(e){j("cookieStore error: "+e)},get:function(e){try{for(var t=e+"=",n=document.cookie.split(";"),r=0;r<n.length;r++){for(var i=n[r];" "==i.charAt(0);)i=i.substring(1,i.length);if(0===i.indexOf(t))return decodeURIComponent(i.substring(t.length,i.length))}}catch(e){}return null},parse:function(e){var t;try{t=JSON.parse(xe.get(e))||{}}catch(e){}return t},set:function(e,t,n,r,i){try{var o="",s="",a="";if(r){var c=document.location.hostname.match(Oe),u=c?c[0]:"";o=u?"; domain=."+u:""}if(n){var l=new Date;l.setTime(l.getTime()+24*n*60*60*1e3),s="; expires="+l.toUTCString()}i&&(a="; secure");var d=e+"="+encodeURIComponent(JSON.stringify(t))+s+"; path=/"+o+a;return document.cookie=d,d}catch(e){return}},remove:function(e,t){try{xe.set(e,"",-1,t)}catch(e){return}}},Ae=null,Ee={is_supported:function(){if(null!==Ae)return Ae;var e=!0;if(window)try{var t="__mplssupport__";Ee.set(t,"xyz"),'"xyz"'!==Ee.get(t)&&(e=!1),Ee.remove(t)}catch(t){e=!1}else e=!1;return e||j("localStorage unsupported; falling back to cookie store"),Ae=e,e},error:function(e){j("localStorage error: "+e)},get:function(e){try{return window.localStorage.getItem(e)}catch(e){Ee.error(e)}return null},parse:function(e){try{return JSON.parse(Ee.get(e))||{}}catch(e){}return null},set:function(e,t){try{window.localStorage.setItem(e,JSON.stringify(t))}catch(e){Ee.error(e)}},remove:function(e){try{window.localStorage.removeItem(e)}catch(e){Ee.error(e)}}},Fe=t(t({},Ee),{},{parse:function(e){try{var t={};try{(t=xe.parse(e)||{}).distinct_id&&xe.set(e,{distinct_id:t.distinct_id})}catch(e){}var n=U(t,JSON.parse(Ee.get(e)||"{}"));return Ee.set(e,n),n}catch(e){}return null},set:function(e,t,n,r,i){try{Ee.set(e,t),t.distinct_id&&xe.set(e,{distinct_id:t.distinct_id},n,r,i)}catch(e){Ee.error(e)}},remove:function(e,t){try{window.localStorage.removeItem(e),xe.remove(e,t)}catch(e){Ee.error(e)}}}),Pe={},$e={is_supported:function(){return!0},error:function(e){j("memoryStorage error: "+e)},get:function(e){return Pe[e]||null},parse:function(e){return Pe[e]||null},set:function(e,t){Pe[e]=t},remove:function(e){delete Pe[e]}},Ce=null,Te={is_supported:function(){if(null!==Ce)return Ce;if(Ce=!0,window)try{var e="__support__";Te.set(e,"xyz"),'"xyz"'!==Te.get(e)&&(Ce=!1),Te.remove(e)}catch(e){Ce=!1}else Ce=!1;return Ce},error:function(e){S.DEBUG&&j("sessionStorage error: ",e)},get:function(e){try{return window.sessionStorage.getItem(e)}catch(e){Te.error(e)}return null},parse:function(e){try{return JSON.parse(Te.get(e))||null}catch(e){}return null},set:function(e,t){try{window.sessionStorage.setItem(e,JSON.stringify(t))}catch(e){Te.error(e)}},remove:function(e){try{window.sessionStorage.removeItem(e)}catch(e){Te.error(e)}}};function Me(e,t){Ue(!0,e,t)}function Re(e,t){Ue(!1,e,t)}function qe(e,t){return"1"===Le(e,t)}function je(e,t){return!!function(e){if(e&&e.respectDnt){var t=e&&e.window||E,n=t.navigator||{},r=!1;return B([n.doNotTrack,n.msDoNotTrack,t.doNotTrack],(function(e){Q([!0,1,"1","yes"],e)&&(r=!0)})),r}return!1}(t)||"0"===Le(e,t)}function Ne(e,t){De(t=t||{}).remove(Be(e,t),!!t.crossSubdomainCookie)}function De(e){return"localStorage"===(e=e||{}).persistenceType?Ee:"localStorage+cookie"===e.persistenceType?Fe:xe}function Be(e,t){return((t=t||{}).persistencePrefix||"__ph_opt_in_out_")+e}function Le(e,t){return De(t).get(Be(e,t))}function Ue(e,t,n){var r;z(t)&&t.length?(De(n=n||{}).set(Be(t,n),e?1:0,(r=n.cookieExpiration,"[object Number]"==x.call(r)?n.cookieExpiration:null),n.crossSubdomainCookie,n.secureCookie),n.capture&&e&&n.capture(n.captureEventName||"$opt_in",n.captureProperties||{},{send_instantly:!0})):console.error("gdpr."+(e?"optIn":"optOut")+" called with an invalid token")}function He(e,t){var n=!1;try{var r=e.get_config("token"),i=e.get_config("respect_dnt"),o=e.get_config("opt_out_capturing_persistence_type"),s=e.get_config("opt_out_capturing_cookie_prefix")||void 0,a=e.get_config("window");r&&(n=je(r,{respectDnt:i,persistenceType:o,persistencePrefix:s,window:a}))}catch(e){t||console.error("Unexpected error when checking capturing opt-out status: "+e)}return n}function We(e,t,n){return function(){for(var r=He(e,n),i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];if(!r)return t.apply(this,o);var a=o[o.length-1];"function"==typeof a&&a(0)}}var Qe="$set",Ge=function(){function e(t){var n=this;r(this,e),this._posthog=t,this.set=We(t,(function(e,t,r){var i=n.set_action(e,t);return G(e)&&(r=t),n._get_config("save_referrer")&&n._posthog.persistence.update_referrer_info(document.referrer),i.$set=U({},de.people_properties(),n._posthog.persistence.get_referrer_info(),i.$set),n._send_request(i,r)})),this.set_once=We(t,(function(e,t,r){var i=n.set_once_action(e,t);return G(e)&&(r=t),n._send_request(i,r)}))}return o(e,[{key:"toString",value:function(){return this._posthog.toString()+".people"}},{key:"_send_request",value:function(e,t){e.$token=this._get_config("token"),e.$distinct_id=this._posthog.get_distinct_id();var n=this._posthog.get_property("$device_id"),r=this._posthog.get_property("$user_id"),i=this._posthog.get_property("$had_persisted_distinct_id");n&&(e.$device_id=n),r&&(e.$user_id=r),i&&(e.$had_persisted_distinct_id=i);var o=V(e),s=ne(o,this._get_config("properties_string_max_length")),a=re(JSON.stringify(o));return this._posthog._send_request(this._get_config("api_host")+"/engage/",{data:a},{},this._posthog._prepare_callback(t,s)),s}},{key:"_get_config",value:function(e){return this._posthog.get_config(e)}},{key:"_is_reserved_property",value:function(e){return"$distinct_id"===e||"$token"===e||"$device_id"===e||"$user_id"===e||"$had_persisted_distinct_id"===e}},{key:"set_action",value:function(e,t){return this.apiActionParser(Qe,e,t)}},{key:"set_once_action",value:function(e,t){return this.apiActionParser("$set_once",e,t)}},{key:"apiActionParser",value:function(e,t,n){var r=this,i={},o={};return G(t)?B(t,(function(e,t){r._is_reserved_property(t)||(o[t]=e)})):o[t]=n,i[e]=o,i}}]),e}(),Je=function(){function e(t){r(this,e),this.instance=t,this._override_warning=!1,this.flagCallReported={},this.featureFlagEventHandlers=[],this.reloadFeatureFlagsQueued=!1,this.reloadFeatureFlagsInAction=!1}return o(e,[{key:"getFlags",value:function(){return Object.keys(this.getFlagVariants())}},{key:"getFlagVariants",value:function(){var e=this.instance.get_property("$enabled_feature_flags"),t=this.instance.get_property("$override_feature_flags");if(!t)return e||{};for(var n=U({},e),r=Object.keys(t),i=0;i<r.length;i++)!1===t[r[i]]?delete n[r[i]]:n[r[i]]=t[r[i]];return this._override_warning||(console.warn("[PostHog] Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:n}),this._override_warning=!0),n}},{key:"reloadFeatureFlags",value:function(){this.reloadFeatureFlagsQueued||(this.reloadFeatureFlagsQueued=!0,this._startReloadTimer())}},{key:"setAnonymousDistinctId",value:function(e){this.$anon_distinct_id=e}},{key:"setReloadingPaused",value:function(e){this.reloadFeatureFlagsInAction=e}},{key:"resetRequestQueue",value:function(){this.reloadFeatureFlagsQueued=!1}},{key:"_startReloadTimer",value:function(){var e=this;this.reloadFeatureFlagsQueued&&!this.reloadFeatureFlagsInAction&&setTimeout((function(){!e.reloadFeatureFlagsInAction&&e.reloadFeatureFlagsQueued&&(e.reloadFeatureFlagsQueued=!1,e._reloadFeatureFlagsRequest())}),5)}},{key:"_reloadFeatureFlagsRequest",value:function(){var e=this;this.setReloadingPaused(!0);var t=this.instance.get_config("token"),n=re(JSON.stringify({token:t,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id}));this.instance._send_request(this.instance.get_config("api_host")+"/decide/?v=2",{data:n},{method:"POST"},this.instance._prepare_callback((function(t){e.$anon_distinct_id=void 0,e.receivedFeatureFlags(t),e.setReloadingPaused(!1),e._startReloadTimer()})))}},{key:"getFeatureFlag",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.getFlags())return console.warn('getFeatureFlag for key "'+e+"\" failed. Feature flags didn't load in time."),!1;var n=this.getFlagVariants()[e];return!t.send_event&&"send_event"in t||this.flagCallReported[e]||(this.flagCallReported[e]=!0,this.instance.capture("$feature_flag_called",{$feature_flag:e,$feature_flag_response:n})),n}},{key:"isFeatureEnabled",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.getFlags()?!!this.getFeatureFlag(e,t):(console.warn('isFeatureEnabled for key "'+e+"\" failed. Feature flags didn't load in time."),!1)}},{key:"addFeatureFlagsHandler",value:function(e){this.featureFlagEventHandlers.push(e)}},{key:"receivedFeatureFlags",value:function(e){!function(e,t){var n=e.featureFlags;if(n)if(Array.isArray(n)){var r={};if(n)for(var i=0;i<n.length;i++)r[n[i]]=!0;t&&t.register({$active_feature_flags:n,$enabled_feature_flags:r})}else t&&t.register({$active_feature_flags:Object.keys(n||{}),$enabled_feature_flags:n||{}});else t&&(t.unregister("$active_feature_flags"),t.unregister("$enabled_feature_flags"))}(e,this.instance.persistence);var t=this.getFlags(),n=this.getFlagVariants();this.featureFlagEventHandlers.forEach((function(e){return e(t,n)}))}},{key:"override",value:function(e){if(this._override_warning=!1,!1===e)this.instance.persistence.unregister("$override_feature_flags");else if(Array.isArray(e)){for(var t={},n=0;n<e.length;n++)t[e[n]]=!0;this.instance.persistence.register({$override_feature_flags:t})}else this.instance.persistence.register({$override_feature_flags:e})}},{key:"onFeatureFlags",value:function(e){(this.addFeatureFlagsHandler(e),this.instance.decideEndpointWasHit)&&e(this.getFlags(),this.getFlagVariants())}}]),e}(),ze="$people_distinct_id",Ve="__alias",Ze="__timers",Xe="$session_recording_enabled_server_side",Ye="$sesid",Ke="$enabled_feature_flags",et=["__mps","__mpso","__mpus","__mpa","__mpap","__mpr","__mpu",ze,Ve,"__cmpns",Ze,Xe,Ye,Ke],tt=function(){function e(t){r(this,e);var n="";t.token&&(n=t.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),this.props={},this.campaign_params_saved=!1,t.persistence_name?this.name="ph_"+t.persistence_name:this.name="ph_"+n+"_posthog";var i=t.persistence.toLowerCase();"cookie"!==i&&-1===i.indexOf("localstorage")&&"memory"!==i&&(N("Unknown persistence type "+i+"; falling back to cookie"),i=t.persistence="cookie"),"localstorage"===i&&Ee.is_supported()?this.storage=Ee:"localstorage+cookie"===i&&Fe.is_supported()?this.storage=Fe:this.storage="memory"===i?$e:xe,this.load(),this.update_config(t),this.save()}return o(e,[{key:"properties",value:function(){var e={};return B(this.props,(function(t,r){if(r===Ke&&"object"===n(t))for(var i=Object.keys(t),o=0;o<i.length;o++)e["$feature/".concat(i[o])]=t[i[o]];else a=r,c=!1,(null===(s=et)?c:T&&s.indexOf===T?-1!=s.indexOf(a):(B(s,(function(e){if(c||(c=e===a))return R})),c))||(e[r]=t);var s,a,c})),e}},{key:"load",value:function(){if(!this.disabled){var e=this.storage.parse(this.name);e&&(this.props=U({},e))}}},{key:"save",value:function(){this.disabled||this.storage.set(this.name,this.props,this.expire_days,this.cross_subdomain,this.secure)}},{key:"remove",value:function(){this.storage.remove(this.name,!1),this.storage.remove(this.name,!0)}},{key:"clear",value:function(){this.remove(),this.props={}}},{key:"register_once",value:function(e,t,n){var r=this;return!!G(e)&&(void 0===t&&(t="None"),this.expire_days=void 0===n?this.default_expiry:n,B(e,(function(e,n){r.props.hasOwnProperty(n)&&r.props[n]!==t||(r.props[n]=e)})),this.save(),!0)}},{key:"register",value:function(e,t){return!!G(e)&&(this.expire_days=void 0===t?this.default_expiry:t,U(this.props,e),this.save(),!0)}},{key:"unregister",value:function(e){e in this.props&&(delete this.props[e],this.save())}},{key:"update_campaign_params",value:function(){this.campaign_params_saved||(this.register(de.campaignParams()),this.campaign_params_saved=!0)}},{key:"update_search_keyword",value:function(e){this.register(de.searchInfo(e))}},{key:"update_referrer_info",value:function(e){this.register({$referrer:e||this.props.$referrer||"$direct",$referring_domain:de.referringDomain(e)||this.props.$referring_domain||"$direct"})}},{key:"get_referrer_info",value:function(){return Y({$referrer:this.props.$referrer,$referring_domain:this.props.$referring_domain})}},{key:"safe_merge",value:function(e){return B(this.props,(function(t,n){n in e||(e[n]=t)})),e}},{key:"update_config",value:function(e){this.default_expiry=this.expire_days=e.cookie_expiration,this.set_disabled(e.disable_persistence),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie)}},{key:"set_disabled",value:function(e){this.disabled=e,this.disabled?this.remove():this.save()}},{key:"set_cross_subdomain",value:function(e){e!==this.cross_subdomain&&(this.cross_subdomain=e,this.remove(),this.save())}},{key:"get_cross_subdomain",value:function(){return!!this.cross_subdomain}},{key:"set_secure",value:function(e){e!==this.secure&&(this.secure=e,this.remove(),this.save())}},{key:"set_event_timer",value:function(e,t){var n=this.props.__timers||{};n[e]=t,this.props.__timers=n,this.save()}},{key:"remove_event_timer",value:function(e){var t=(this.props.__timers||{})[e];return J(t)||(delete this.props.__timers[e],this.save()),t}}]),e}();var nt=2,rt=4,it=6,ot=function(){function e(t){r(this,e),this.instance=t,this.captureStarted=!1,this.snapshots=[],this.emit=!1,this.endpoint="/e/",this.stopRrweb=void 0,this.windowId=null,this.sessionId=null,this.receivedDecide=!1}return o(e,[{key:"startRecordingIfEnabled",value:function(){this.isRecordingEnabled()?this.startCaptureAndTrySendingQueuedSnapshots():this.stopRecording()}},{key:"started",value:function(){return this.captureStarted}},{key:"stopRecording",value:function(){this.captureStarted&&this.stopRrweb&&(this.stopRrweb(),this.stopRrweb=void 0,this.captureStarted=!1)}},{key:"isRecordingEnabled",value:function(){var e=!!this.instance.get_property(Xe),t=!this.instance.get_config("disable_session_recording");return e&&t}},{key:"afterDecideResponse",value:function(e){var t,n;(this.receivedDecide=!0,this.instance.persistence&&this.instance.persistence.register(s({},Xe,!!e.sessionRecording)),null!==(t=e.sessionRecording)&&void 0!==t&&t.endpoint)&&(this.endpoint=null===(n=e.sessionRecording)||void 0===n?void 0:n.endpoint);this.startRecordingIfEnabled()}},{key:"startCaptureAndTrySendingQueuedSnapshots",value:function(){var e=this;this.receivedDecide&&(this.emit=!0,this.snapshots.forEach((function(t){return e._captureSnapshot(t)}))),this._startCapture()}},{key:"_startCapture",value:function(){void 0!==Object.assign&&(this.captureStarted||this.instance.get_config("disable_session_recording")||(this.captureStarted=!0,ke(this.instance.get_config("api_host")+"/static/recorder.js?v="+S.LIB_VERSION,this._onScriptLoaded.bind(this))))}},{key:"_updateWindowAndSessionIds",value:function(e){var t,n,r=3===e.type&&0===(null===(t=e.data)||void 0===t?void 0:t.source),i=this.instance.sessionManager.checkAndGetSessionAndWindowId(r,e.timestamp),o=i.windowId,s=i.sessionId;this.windowId===o&&this.sessionId===s||-1!==[nt,rt].indexOf(e.type)||(null===(n=this.rrwebRecord)||void 0===n||n.takeFullSnapshot());this.windowId=o,this.sessionId=s}},{key:"_onScriptLoaded",value:function(){var e,r=this,i={blockClass:"ph-no-capture",blockSelector:void 0,ignoreClass:"ph-ignore-input",maskAllInputs:!0,maskInputOptions:{},maskInputFn:void 0,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0};this.rrwebRecord=window.rrweb?window.rrweb.record:window.rrwebRecord;for(var o=this.instance.get_config("session_recording"),s=0,a=Object.entries(o||{});s<a.length;s++){var c=p(a[s],2),u=c[0],l=c[1];u in i&&(i[u]=l)}this.stopRrweb=null===(e=this.rrwebRecord)||void 0===e?void 0:e.call(this,t({emit:function(e){e=function(e){if(e&&"object"===n(e)&&e.type===it&&"object"===n(e.data)&&"rrweb/console@1"===e.data.plugin){e.data.payload.payload.length>10&&(e.data.payload.payload=e.data.payload.payload.slice(0,10),e.data.payload.payload.push("...[truncated]"));for(var t=[],r=0;r<e.data.payload.payload.length;r++)e.data.payload.payload[r]&&e.data.payload.payload[r].length>2e3?t.push(e.data.payload.payload[r].slice(0,2e3)+"...[truncated]"):t.push(e.data.payload.payload[r]);return e.data.payload.payload=t,e}return e}(function(e){if(e&&"object"===n(e)){var t=JSON.stringify(e);if(t.length>5e6){var r,i=g(t.matchAll(/data:([\w\/\-\.]+);(\w+),([^)"]*)/gim));try{for(i.s();!(r=i.n()).done;){var o=r.value;t="image/"===o[1].toLocaleLowerCase().slice(0,6)?t.replace(o[0],"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3Qgd2lkdGg9IjE2IiBoZWlnaHQ9IjE2IiBmaWxsPSJibGFjayIvPgo8cGF0aCBkPSJNOCAwSDE2TDAgMTZWOEw4IDBaIiBmaWxsPSIjMkQyRDJEIi8+CjxwYXRoIGQ9Ik0xNiA4VjE2SDhMMTYgOFoiIGZpbGw9IiMyRDJEMkQiLz4KPC9zdmc+Cg=="):t.replace(o[0],"")}}catch(e){i.e(e)}finally{i.f()}}return JSON.parse(t)}return e}(e)),r._updateWindowAndSessionIds(e);var t={$snapshot_data:e,$session_id:r.sessionId,$window_id:r.windowId};r.instance._captureMetrics.incr("rrweb-record"),r.instance._captureMetrics.incr("rrweb-record-".concat(e.type)),r.emit?r._captureSnapshot(t):r.snapshots.push(t)},plugins:window.rrwebConsoleRecord&&this.instance.get_config("enable_recording_console_log")?[window.rrwebConsoleRecord.getRecordConsolePlugin()]:[]},i)),this.instance._addCaptureHook((function(e){var t;"$pageview"===e&&(null===(t=r.rrwebRecord)||void 0===t||t.addCustomEvent("$pageview",{href:window.location.href}))}))}},{key:"_captureSnapshot",value:function(e){this.instance.capture("$snapshot",e,{transport:"XHR",method:"POST",endpoint:this.endpoint,_noTruncate:!0,_batchKey:"sessionRecording",_metrics:{rrweb_full_snapshot:e.$snapshot_data.type===nt}})}}]),e}(),st=function(){function e(t){r(this,e),this.instance=t,this.instance.decideEndpointWasHit=!1}return o(e,[{key:"call",value:function(){var e=this,t=re(JSON.stringify({token:this.instance.get_config("token"),distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups()}));this.instance._send_request("".concat(this.instance.get_config("api_host"),"/decide/?v=2"),{data:t,verbose:!0},{method:"POST"},(function(t){return e.parseDecideResponse(t)}))}},{key:"parseDecideResponse",value:function(e){var t,n=this;if(0!==(null==e?void 0:e.status)){if(this.instance.decideEndpointWasHit=!0,!document||!document.body)return console.log("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((function(){n.parseDecideResponse(e)}),500);if(this.instance.toolbar.afterDecideResponse(e),null===(t=this.instance.sessionRecording)||void 0===t||t.afterDecideResponse(e),Ie.afterDecideResponse(e,this.instance),this.instance.featureFlags.receivedFeatureFlags(e),e.supportedCompression){var r,i={},o=g(e.supportedCompression);try{for(o.s();!(r=o.n()).done;){i[r.value]=!0}}catch(e){o.e(e)}finally{o.f()}this.instance.compression=i}else this.instance.compression={}}else console.error("Failed to fetch feature flags from PostHog.")}}]),e}(),at=function(){function e(t){r(this,e),this.instance=t}return o(e,[{key:"afterDecideResponse",value:function(e){var n=e.editorParams||(e.toolbarVersion?{toolbarVersion:e.toolbarVersion}:{});e.isAuthenticated&&n.toolbarVersion&&0===n.toolbarVersion.indexOf("toolbar")&&this._loadEditor(t(t({},n),{},{apiURL:this.instance.get_config("api_host")}))}},{key:"maybeLoadEditor",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.location,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:window.history;try{if(!t){try{window.localStorage.setItem("test","test"),window.localStorage.removeItem("test")}catch(e){return!1}t=window.localStorage}var r,i=ue(e.hash,"__posthog")||ue(e.hash,"state"),o=i?JSON.parse(decodeURIComponent(i)):null,s=o&&("mpeditor"===o.action||"ph_authorize"===o.action);return s?(r=o)&&Object.keys(r).length>0&&(t.setItem("_postHogEditorParams",JSON.stringify(r)),o.desiredHash?e.hash=o.desiredHash:n?n.replaceState("",document.title,e.pathname+e.search):e.hash=""):delete(r=JSON.parse(t.getItem("_postHogEditorParams")||"{}")).userIntent,r.apiURL=this.instance.get_config("api_host"),!(!r.token||this.instance.get_config("token")!==r.token)&&(this._loadEditor(r),!0)}catch(e){return!1}}},{key:"_loadEditor",value:function(e){var n=this;if(!window._postHogToolbarLoaded){window._postHogToolbarLoaded=!0;var r=e.jsURL||e.apiURL||this.instance.get_config("api_host"),i=r+(r.endsWith("/")?"":"/")+"static/toolbar.js?_ts="+(new Date).getTime(),o="https://app.posthog.com"!==this.instance.get_config("api_host")&&this.instance.get_config("advanced_disable_toolbar_metrics");return e=t(t({},e),o?{instrument:!1}:{}),ke(i,(function(){window.ph_load_editor(e,n.instance)})),le(window,"turbolinks:load",(function(){window._postHogToolbarLoaded=!1,n._loadEditor(e)})),!0}return!1}}]),e}(),ct=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3e3;r(this,e),this.isPolling=!0,this._event_queue=[],this._empty_queue_count=0,this._poller=void 0,this._pollInterval=t}return o(e,[{key:"setPollInterval",value:function(e){this._pollInterval=e,this.isPolling&&this.poll()}},{key:"poll",value:function(){}},{key:"unload",value:function(){}},{key:"getTime",value:function(){return(new Date).getTime()}}]),e}(),ut=function(e){a(i,e);var n=d(i);function i(e,t){var o,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:3e3;return r(this,i),(o=n.call(this,s)).handlePollRequest=t,o.captureMetrics=e,o}return o(i,[{key:"enqueue",value:function(e,t,n){this.captureMetrics.incr("batch-enqueue"),this._event_queue.push({url:e,data:t,options:n}),this.isPolling||(this.isPolling=!0,this.poll())}},{key:"poll",value:function(){var e=this;clearTimeout(this._poller),this._poller=setTimeout((function(){if(e._event_queue.length>0){var t=e.formatQueue(),n=function(n){var r=t[n],i=r.url,o=r.data,s=r.options;B(o,(function(t,n){o[n].offset=Math.abs(o[n].timestamp-e.getTime()),delete o[n].timestamp})),e.handlePollRequest(i,o,s),e.captureMetrics.incr("batch-requests"),e.captureMetrics.incr("batch-requests-".concat(i.slice(i.length-2))),e.captureMetrics.incr("batch-handle",o.length),e.captureMetrics.incr("batch-handle-".concat(i.slice(i.length-2)),o.length)};for(var r in t)n(r);e._event_queue.length=0,e._empty_queue_count=0}else e._empty_queue_count++;e._empty_queue_count>4&&(e.isPolling=!1,e._empty_queue_count=0),e.isPolling&&e.poll()}),this._pollInterval)}},{key:"updateUnloadMetrics",value:function(){var e=this.formatQueue();for(var t in e){var n=e[t],r=n.url,i=n.data;this.captureMetrics.incr("batch-unload-requests"),this.captureMetrics.incr("batch-unload-requests-".concat(r.slice(r.length-2))),this.captureMetrics.incr("batch-unload",i.length),this.captureMetrics.incr("batch-unload-".concat(r.slice(r.length-2)),i.length)}}},{key:"unload",value:function(){clearTimeout(this._poller);var e=this._event_queue.length>0?this.formatQueue():{};for(var n in this._event_queue.length=0,e){var r=e[n],i=r.url,o=r.data,s=r.options;this.handlePollRequest(i,o,t(t({},s),{},{transport:"sendBeacon"}))}}},{key:"formatQueue",value:function(){var e={};return B(this._event_queue,(function(t){var n=t.url,r=t.data,i=t.options,o=(i?i._batchKey:null)||n;void 0===e[o]&&(e[o]={data:[],url:n,options:i}),i&&e[o].options&&e[o].options._metrics&&!e[o].options._metrics.rrweb_full_snapshot&&(e[o].options._metrics.rrweb_full_snapshot=i._metrics.rrweb_full_snapshot),e[o].data.push(r)})),e}}]),i}(ct),lt=function(){function e(t){r(this,e),this.enabled=t,this.metrics={}}return o(e,[{key:"incr",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;this.enabled&&(e="phjs-".concat(e),this.metrics[e]=(this.metrics[e]||0)+t)}},{key:"decr",value:function(e){this.enabled&&(e="phjs-".concat(e),this.metrics[e]=(this.metrics[e]||0)-1)}}]),e}(),dt=Uint8Array,pt=Uint16Array,ft=Uint32Array,ht=new dt([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),_t=new dt([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),gt=new dt([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),vt=function(e,t){for(var n=new pt(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];var i=new ft(n[30]);for(r=1;r<30;++r)for(var o=n[r];o<n[r+1];++o)i[o]=o-n[r]<<5|r;return[n,i]},yt=vt(ht,2),mt=yt[0],wt=yt[1];mt[28]=258,wt[258]=28;for(var bt=vt(_t,0)[1],kt=new pt(32768),St=0;St<32768;++St){var It=(43690&St)>>>1|(21845&St)<<1;It=(61680&(It=(52428&It)>>>2|(13107&It)<<2))>>>4|(3855&It)<<4,kt[St]=((65280&It)>>>8|(255&It)<<8)>>>1}var Ot=function(e,t,n){for(var r=e.length,i=0,o=new pt(t);i<r;++i)++o[e[i]-1];var s,a=new pt(t);for(i=0;i<t;++i)a[i]=a[i-1]+o[i-1]<<1;if(n){s=new pt(1<<t);var c=15-t;for(i=0;i<r;++i)if(e[i])for(var u=i<<4|e[i],l=t-e[i],d=a[e[i]-1]++<<l,p=d|(1<<l)-1;d<=p;++d)s[kt[d]>>>c]=u}else for(s=new pt(r),i=0;i<r;++i)s[i]=kt[a[e[i]-1]++]>>>15-e[i];return s},xt=new dt(288);for(St=0;St<144;++St)xt[St]=8;for(St=144;St<256;++St)xt[St]=9;for(St=256;St<280;++St)xt[St]=7;for(St=280;St<288;++St)xt[St]=8;var At=new dt(32);for(St=0;St<32;++St)At[St]=5;var Et,Ft=Ot(xt,9,0),Pt=Ot(At,5,0),$t=function(e){return(e/8>>0)+(7&e&&1)},Ct=function(e,t,n){(null==t||t<0)&&(t=0),(null==n||n>e.length)&&(n=e.length);var r=new(e instanceof pt?pt:e instanceof ft?ft:dt)(n-t);return r.set(e.subarray(t,n)),r},Tt=function(e,t,n){n<<=7&t;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8},Mt=function(e,t,n){n<<=7&t;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8,e[r+2]|=n>>>16},Rt=function(e,t){for(var n=[],r=0;r<e.length;++r)e[r]&&n.push({s:r,f:e[r]});var i=n.length,o=n.slice();if(!i)return[new dt(0),0];if(1==i){var s=new dt(n[0].s+1);return s[n[0].s]=1,[s,1]}n.sort((function(e,t){return e.f-t.f})),n.push({s:-1,f:25001});var a=n[0],c=n[1],u=0,l=1,d=2;for(n[0]={s:-1,f:a.f+c.f,l:a,r:c};l!=i-1;)a=n[n[u].f<n[d].f?u++:d++],c=n[u!=l&&n[u].f<n[d].f?u++:d++],n[l++]={s:-1,f:a.f+c.f,l:a,r:c};var p=o[0].s;for(r=1;r<i;++r)o[r].s>p&&(p=o[r].s);var f=new pt(p+1),h=qt(n[l-1],f,0);if(h>t){r=0;var _=0,g=h-t,v=1<<g;for(o.sort((function(e,t){return f[t.s]-f[e.s]||e.f-t.f}));r<i;++r){var y=o[r].s;if(!(f[y]>t))break;_+=v-(1<<h-f[y]),f[y]=t}for(_>>>=g;_>0;){var m=o[r].s;f[m]<t?_-=1<<t-f[m]++-1:++r}for(;r>=0&&_;--r){var w=o[r].s;f[w]==t&&(--f[w],++_)}h=t}return[new dt(f),h]},qt=function e(t,n,r){return-1==t.s?Math.max(e(t.l,n,r+1),e(t.r,n,r+1)):n[t.s]=r},jt=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new pt(++t),r=0,i=e[0],o=1,s=function(e){n[r++]=e},a=1;a<=t;++a)if(e[a]==i&&a!=t)++o;else{if(!i&&o>2){for(;o>138;o-=138)s(32754);o>2&&(s(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(s(i),--o;o>6;o-=6)s(8304);o>2&&(s(o-3<<5|8208),o=0)}for(;o--;)s(i);o=1,i=e[a]}return[n.subarray(0,r),t]},Nt=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},Dt=function(e,t,n){var r=n.length,i=$t(t+2);e[i]=255&r,e[i+1]=r>>>8,e[i+2]=255^e[i],e[i+3]=255^e[i+1];for(var o=0;o<r;++o)e[i+o+4]=n[o];return 8*(i+4+r)},Bt=function(e,t,n,r,i,o,s,a,c,u,l){Tt(t,l++,n),++i[256];for(var d=Rt(i,15),p=d[0],f=d[1],h=Rt(o,15),_=h[0],g=h[1],v=jt(p),y=v[0],m=v[1],w=jt(_),b=w[0],k=w[1],S=new pt(19),I=0;I<y.length;++I)S[31&y[I]]++;for(I=0;I<b.length;++I)S[31&b[I]]++;for(var O=Rt(S,7),x=O[0],A=O[1],E=19;E>4&&!x[gt[E-1]];--E);var F,P,$,C,T=u+5<<3,M=Nt(i,xt)+Nt(o,At)+s,R=Nt(i,p)+Nt(o,_)+s+14+3*E+Nt(S,x)+(2*S[16]+3*S[17]+7*S[18]);if(T<=M&&T<=R)return Dt(t,l,e.subarray(c,c+u));if(Tt(t,l,1+(R<M)),l+=2,R<M){F=Ot(p,f,0),P=p,$=Ot(_,g,0),C=_;var q=Ot(x,A,0);Tt(t,l,m-257),Tt(t,l+5,k-1),Tt(t,l+10,E-4),l+=14;for(I=0;I<E;++I)Tt(t,l+3*I,x[gt[I]]);l+=3*E;for(var j=[y,b],N=0;N<2;++N){var D=j[N];for(I=0;I<D.length;++I){var B=31&D[I];Tt(t,l,q[B]),l+=x[B],B>15&&(Tt(t,l,D[I]>>>5&127),l+=D[I]>>>12)}}}else F=Ft,P=xt,$=Pt,C=At;for(I=0;I<a;++I)if(r[I]>255){B=r[I]>>>18&31;Mt(t,l,F[B+257]),l+=P[B+257],B>7&&(Tt(t,l,r[I]>>>23&31),l+=ht[B]);var L=31&r[I];Mt(t,l,$[L]),l+=C[L],L>3&&(Mt(t,l,r[I]>>>5&8191),l+=_t[L])}else Mt(t,l,F[r[I]]),l+=P[r[I]];return Mt(t,l,F[256]),l+P[256]},Lt=new ft([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Ut=new dt(0),Ht=function(){for(var e=new ft(256),t=0;t<256;++t){for(var n=t,r=9;--r;)n=(1&n&&3988292384)^n>>>1;e[t]=n}return e}(),Wt=function(e,t,n,r,i){return function(e,t,n,r,i,o){var s=e.length,a=new dt(r+s+5*(1+Math.floor(s/7e3))+i),c=a.subarray(r,a.length-i),u=0;if(!t||s<8)for(var l=0;l<=s;l+=65535){var d=l+65535;d<s?u=Dt(c,u,e.subarray(l,d)):(c[l]=o,u=Dt(c,u,e.subarray(l,s)))}else{for(var p=Lt[t-1],f=p>>>13,h=8191&p,_=(1<<n)-1,g=new pt(32768),v=new pt(_+1),y=Math.ceil(n/3),m=2*y,w=function(t){return(e[t]^e[t+1]<<y^e[t+2]<<m)&_},b=new ft(25e3),k=new pt(288),S=new pt(32),I=0,O=0,x=(l=0,0),A=0,E=0;l<s;++l){var F=w(l),P=32767&l,$=v[F];if(g[P]=$,v[F]=P,A<=l){var C=s-l;if((I>7e3||x>24576)&&C>423){u=Bt(e,c,0,b,k,S,O,x,E,l-E,u),x=I=O=0,E=l;for(var T=0;T<286;++T)k[T]=0;for(T=0;T<30;++T)S[T]=0}var M=2,R=0,q=h,j=P-$&32767;if(C>2&&F==w(l-j))for(var N=Math.min(f,C)-1,D=Math.min(32767,l),B=Math.min(258,C);j<=D&&--q&&P!=$;){if(e[l+M]==e[l+M-j]){for(var L=0;L<B&&e[l+L]==e[l+L-j];++L);if(L>M){if(M=L,R=j,L>N)break;var U=Math.min(j,L-2),H=0;for(T=0;T<U;++T){var W=l-j+T+32768&32767,Q=W-g[W]+32768&32767;Q>H&&(H=Q,$=W)}}}j+=(P=$)-($=g[P])+32768&32767}if(R){b[x++]=268435456|wt[M]<<18|bt[R];var G=31&wt[M],J=31&bt[R];O+=ht[G]+_t[J],++k[257+G],++S[J],A=l+M,++I}else b[x++]=e[l],++k[e[l]]}}u=Bt(e,c,o,b,k,S,O,x,E,l-E,u),o||(u=Dt(c,u,Ut))}return Ct(a,0,r+$t(u)+i)}(e,null==t.level?6:t.level,null==t.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+t.mem,n,r,!i)},Qt=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8};function Gt(e,t){void 0===t&&(t={});var n=function(){var e=4294967295;return{p:function(t){for(var n=e,r=0;r<t.length;++r)n=Ht[255&n^t[r]]^n>>>8;e=n},d:function(){return 4294967295^e}}}(),r=e.length;n.p(e);var i,o=Wt(e,t,10+((i=t).filename&&i.filename.length+1||0),8),s=o.length;return function(e,t){var n=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=t.level<2?4:9==t.level?2:0,e[9]=3,0!=t.mtime&&Qt(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),n){e[3]=8;for(var r=0;r<=n.length;++r)e[r+10]=n.charCodeAt(r)}}(o,t),Qt(o,s-8,n.d()),Qt(o,s-4,r),o}function Jt(e,t){var n=e.length;if(!t&&"undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var r=new dt(e.length+(e.length>>>1)),i=0,o=function(e){r[i++]=e},s=0;s<n;++s){if(i+5>r.length){var a=new dt(i+8+(n-s<<1));a.set(r),r=a}var c=e.charCodeAt(s);c<128||t?o(c):c<2048?(o(192|c>>>6),o(128|63&c)):c>55295&&c<57344?(o(240|(c=65536+(1047552&c)|1023&e.charCodeAt(++s))>>>18),o(128|c>>>12&63),o(128|c>>>6&63),o(128|63&c)):(o(224|c>>>12),o(128|c>>>6&63),o(128|63&c))}return Ct(r,0,i)}!function(e){e.GZipJS="gzip-js",e.LZ64="lz64",e.Base64="base64"}(Et||(Et={}));var zt=function(e,t,n){var r=t||{};r.ip=n.ip?1:0,r._=(new Date).getTime().toString(),r.ver=S.LIB_VERSION;var i=e.split("?");if(i.length>1){var o,s=g(i[1].split("&"));try{for(s.s();!(o=s.n()).done;){var a=o.value.split("=")[0];r[a]&&delete r[a]}}catch(e){s.e(e)}finally{s.f()}}var c=e.indexOf("?")>-1?"&":"?";return e+c+function(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"&",i=[];return B(e,(function(e,r){t=encodeURIComponent(e.toString()),n=encodeURIComponent(r),i[i.length]=n+"="+t})),i.join(r)}(r)},Vt=function e(t,n){if(n.blob&&t.buffer)return new Blob([t.buffer],{type:"text/plain"});if(n.sendBeacon||n.blob){var r=e(t,{method:"POST"});return new Blob([r],{type:"application/x-www-form-urlencoded"})}if("POST"!==n.method)return null;var i,o;return i=Array.isArray(t)||(o=t,"[object Uint8Array]"===Object.prototype.toString.call(o))?"data="+encodeURIComponent(t):"data="+encodeURIComponent(t.data),"compression"in t&&t.compression&&(i+="&compression="+t.compression),i},Zt=function(e){var t=e.url,n=e.data,r=e.headers,i=e.options,o=e.captureMetrics,s=e.callback,a=e.retriesPerformedSoFar,c=e.retryQueue,u=e.onXHRError,l=new XMLHttpRequest;l.open(i.method||"GET",t,!0);var d=Vt(n,i);o.incr("_send_request"),o.incr("_send_request_inflight"),B(r,(function(e,t){l.setRequestHeader(t,e)})),"POST"!==i.method||i.blob||l.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),l.withCredentials=!0,l.onreadystatechange=function(){if(4===l.readyState)if(o.incr("xhr-response"),o.incr("xhr-response-".concat(l.status)),o.decr("_send_request_inflight"),200===l.status){if(s){var e;try{e=JSON.parse(l.responseText)}catch(e){return void j(e)}s(e)}}else"function"==typeof u&&u(l),[401,403,404,500].indexOf(l.status)<0&&c.enqueue({url:t,data:n,options:i,headers:r,retriesPerformedSoFar:(a||0)+1,callback:s}),s&&s({status:0})},l.send(d)},Xt=function(e){a(i,e);var n=d(i);function i(e,t){var o;return r(this,i),(o=n.call(this)).captureMetrics=e,o.isPolling=!1,o.queue=[],o.areWeOnline=!0,o.onXHRError=t,"onLine"in window.navigator&&(o.areWeOnline=window.navigator.onLine,window.addEventListener("online",(function(){o._handleWeAreNowOnline()})),window.addEventListener("offline",(function(){o.areWeOnline=!1}))),o}return o(i,[{key:"enqueue",value:function(e){var t=e.retriesPerformedSoFar||0;if(!(t>=10)){var n=3e3*Math.pow(2,t),r=new Date(Date.now()+n);console.warn("Enqueued failed request for retry in ".concat(n)),this.queue.push({retryAt:r,requestData:e}),this.isPolling||(this.isPolling=!0,this.poll())}}},{key:"poll",value:function(){var e=this;this._poller&&clearTimeout(this._poller),this._poller=setTimeout((function(){e.areWeOnline&&e.queue.length>0&&e.flush(),e.poll()}),this._pollInterval)}},{key:"flush",value:function(){var e=new Date(Date.now()),t=this.queue.filter((function(t){return t.retryAt<e}));if(t.length>0){this.queue=this.queue.filter((function(t){return t.retryAt>=e}));var n,r=g(t);try{for(r.s();!(n=r.n()).done;){var i=n.value.requestData;this._executeXhrRequest(i)}}catch(e){r.e(e)}finally{r.f()}}}},{key:"unload",value:function(){this._poller&&(clearTimeout(this._poller),this._poller=void 0);var e,n=g(this.queue);try{for(n.s();!(e=n.n()).done;){var r=e.value.requestData,i=r.url,o=r.data,s=r.options;try{window.navigator.sendBeacon(i,Vt(o,t(t({},s),{},{sendBeacon:!0})))}catch(e){S.DEBUG&&console.error(e)}}}catch(e){n.e(e)}finally{n.f()}this.queue=[]}},{key:"_executeXhrRequest",value:function(e){var t=e.url,n=e.data,r=e.options,i=e.headers,o=e.callback,s=e.retriesPerformedSoFar;Zt({url:t,data:n||{},options:r||{},headers:i||{},retriesPerformedSoFar:s||0,callback:o,captureMetrics:this.captureMetrics,retryQueue:this,onXHRError:this.onXHRError})}},{key:"_handleWeAreNowOnline",value:function(){this.areWeOnline=!0,this.flush()}}]),i}(ct),Yt=18e5,Kt=864e5,en=function(){function e(t,n){r(this,e),this.persistence=n,this._windowId=void 0,this._sessionId=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,t.persistence_name?this.window_id_storage_key="ph_"+t.persistence_name+"_window_id":this.window_id_storage_key="ph_"+t.token+"_window_id"}return o(e,[{key:"_setWindowId",value:function(e){e!==this._windowId&&(this._windowId=e,!this.persistence.disabled&&Te.is_supported()&&Te.set(this.window_id_storage_key,e))}},{key:"_getWindowId",value:function(){return this._windowId?this._windowId:!this.persistence.disabled&&Te.is_supported()?Te.parse(this.window_id_storage_key):null}},{key:"_setSessionId",value:function(e,t,n){e===this._sessionId&&t===this._sessionActivityTimestamp&&n===this._sessionStartTimestamp||(this._sessionStartTimestamp=n,this._sessionActivityTimestamp=t,this._sessionId=e,this.persistence.register(s({},Ye,[t,e,n])))}},{key:"_getSessionId",value:function(){if(this._sessionId&&this._sessionActivityTimestamp&&this._sessionStartTimestamp)return[this._sessionActivityTimestamp,this._sessionId,this._sessionStartTimestamp];var e=this.persistence.props.$sesid;return Array.isArray(e)&&2===e.length&&e.push(e[0]),e||[0,null,0]}},{key:"resetSessionId",value:function(){this._setSessionId(null,null,null)}},{key:"checkAndGetSessionAndWindowId",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=t||(new Date).getTime(),r=this._getSessionId(),i=p(r,3),o=i[0],s=i[1],a=i[2],c=this._getWindowId(),u=a&&a>0&&Math.abs(n-a)>Kt;!s||!e&&Math.abs(n-o)>Yt||u?(s=se(),c=se(),a=n):c||(c=se());var l=0===o||!e||u?n:o,d=0===a?(new Date).getTime():a;return this._setWindowId(c),this._setSessionId(s,l,d),{sessionId:s,windowId:c}}}]),e}();function tn(e){return e.forEach((function(t,n){for(var r in t){var i=r;o=t[i],Number(o)===o&&o%1!=0&&t[i].toString().match(/^\d+\.\d{4,}$/)&&(e[n][i]=Number(t[i].toFixed(3))),"serverTiming"===i&&0===t[i].length&&delete e[n][i],"entryType"===i&&"resource"===t[i]&&delete e[n][i],"nextHopProtocol"===i&&delete e[n][i],0===t[i]&&delete e[n][i]}var o})),function(e){if(0===e.length)return[];var t=Object.keys(e[0]);return[t,e.map((function(e){return t.map((function(t){return e[t]}))}))]}(e)}function nn(e){try{return tn(JSON.parse(JSON.stringify(E.performance.getEntriesByType(e))))}catch(t){return S.DEBUG&&console.warn("not able to capture performance data ("+e+") - "+t),[]}}var rn,on,sn,an=o((function e(t,n,i,o){r(this,e),this.name="posthog-js",this.setupOnce=function(e){e((function(e){if("error"!==e.level||!t.__loaded)return e;e.tags||(e.tags={}),e.tags["PostHog Person URL"]=t.config.api_host+"/person/"+t.get_distinct_id(),t.sessionRecordingStarted()&&(e.tags["PostHog Recording URL"]=t.config.api_host+"/recordings/#sessionRecordingId="+t.sessionManager.checkAndGetSessionAndWindowId(!0).sessionId);var r={$sentry_event_id:e.event_id,$sentry_exception:e.exception};return n&&i&&(r.$sentry_url=(o||"https://sentry.io/organizations/")+n+"/issues/?project="+i+"&query="+e.event_id),t.capture("$exception",r),e}))}}));!function(e){e[e.INIT_MODULE=0]="INIT_MODULE",e[e.INIT_SNIPPET=1]="INIT_SNIPPET"}(rn||(rn={}));var cn=function(){},un={},ln="posthog",dn=E.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest,pn=!dn&&-1===$.indexOf("MSIE")&&-1===$.indexOf("Mozilla"),fn=function(){var e,t,n;return{api_host:"https://app.posthog.com",api_method:"POST",api_transport:"XHR",token:"",autocapture:!0,rageclick:!1,cross_subdomain_cookie:-1===(null==P||null===(e=P.location)||void 0===e||null===(t=e.hostname)||void 0===t?void 0:t.indexOf("herokuapp.com")),persistence:"cookie",persistence_name:"",cookie_name:"",loaded:cn,store_google:!0,save_referrer:!0,test:!1,verbose:!1,img:!1,capture_pageview:!0,debug:!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_cookie:!1,enable_recording_console_log:!1,secure_cookie:"https:"===(null==E||null===(n=E.location)||void 0===n?void 0:n.protocol),ip:!0,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_capturing_persistence_type:"localStorage",opt_out_capturing_cookie_prefix:null,property_blacklist:[],respect_dnt:!1,sanitize_properties:null,xhr_headers:{},inapp_protocol:"//",inapp_link_new_window:!1,request_batching:!0,properties_string_max_length:65535,session_recording:{blockClass:"ph-no-capture",blockSelector:null,ignoreClass:"ph-ignore-input",maskAllInputs:!0,maskInputOptions:{},maskInputFn:null,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0},mask_all_element_attributes:!1,mask_all_text:!1,advanced_disable_decide:!1,advanced_disable_toolbar_metrics:!1,on_xhr_error:function(e){var t="Bad HTTP status: "+e.status+" "+e.statusText;console.error(t)},get_device_id:function(e){return e},_onCapture:cn,_capture_metrics:!1,_capture_performance:!1,name:"posthog",callback_fn:"posthog._jsc"}},hn=function(e,t,n){var r,i=n!==ln&&sn?n?sn[n]:void 0:sn;if(i&&on===rn.INIT_MODULE)r=i;else{if(i&&!H(i))return void console.error("You have already initialized "+n);r=new _n}if(r._init(e,t,n),r.toolbar.maybeLoadEditor(),r.sessionRecording=new ot(r),r.sessionRecording.startRecordingIfEnabled(),r.__autocapture_enabled=r.get_config("autocapture"),r.get_config("autocapture")){Ie.enabledForProject(r.get_config("token"),100,100)?Ie.isBrowserSupported()?Ie.init(r):(r.__autocapture_enabled=!1,q("Disabling Automatic Event Collection because this browser is not supported")):(r.__autocapture_enabled=!1,q("Not in active bucket: disabling Automatic Event Collection."))}return S.DEBUG=S.DEBUG||r.get_config("debug"),void 0!==i&&H(i)&&(r._execute_array.call(r.people,i.people),r._execute_array(i)),r},_n=function(){function e(){r(this,e),this.config=fn(),this.compression={},this.decideEndpointWasHit=!1,this.SentryIntegration=an,this.__captureHooks=[],this.__request_queue=[],this.__loaded=!1,this.__autocapture_enabled=void 0,this._jsc=function(){},this.people=new Ge(this),this.featureFlags=new Je(this),this.feature_flags=this.featureFlags,this.toolbar=new at(this),this._captureMetrics=void 0,this._requestQueue=void 0,this._retryQueue=void 0,this.persistence=void 0,this.sessionManager=void 0}return o(e,[{key:"init",value:function(e,t,n){if(J(n))console.error("You must name your new library: init(token, config, name)");else{if(n!==ln){var r=hn(e,t,n);return sn[n]=r,r._loaded(),r}console.error("You must initialize the main posthog object right after you include the PostHog js snippet")}}},{key:"_init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;if(this.__loaded=!0,this.config={},this._triggered_notifs=[],this.set_config(U({},fn(),t,{name:n,token:e,callback_fn:(n===ln?n:"posthog."+n)+"._jsc"})),this._jsc=function(){},this._captureMetrics=new lt(this.get_config("_capture_metrics")),this._requestQueue=new ut(this._captureMetrics,this._handle_queued_event.bind(this)),this._retryQueue=new Xt(this._captureMetrics,this.get_config("on_xhr_error")),this.__captureHooks=[],this.__request_queue=[],this.persistence=new tt(this.config),this.sessionManager=new en(this.config,this.persistence),this._gdpr_init(),!this.get_distinct_id()){var r=this.get_config("get_device_id")(se());this.register_once({distinct_id:r,$device_id:r},"")}E.addEventListener&&E.addEventListener("unload",this._handle_unload.bind(this))}},{key:"_loaded",value:function(){this.featureFlags.setReloadingPaused(!0);try{this.get_config("loaded")(this)}catch(e){console.error("`loaded` function failed",e)}this._start_queue_if_opted_in(),this.get_config("capture_pageview")&&this.capture("$pageview",{},{send_instantly:!0}),this.get_config("advanced_disable_decide")||new st(this).call(),this.featureFlags.resetRequestQueue(),this.featureFlags.setReloadingPaused(!1)}},{key:"_start_queue_if_opted_in",value:function(){this.has_opted_out_capturing()||this.get_config("request_batching")&&this._requestQueue.poll()}},{key:"_dom_loaded",value:function(){var e=this;this.has_opted_out_capturing()||L(this.__request_queue,(function(t){e._send_request.apply(e,f(t))})),this.__request_queue=[],this._start_queue_if_opted_in()}},{key:"_prepare_callback",value:function(e,t){if(J(e))return null;if(dn)return function(n){e(n,t)};var n=this._jsc,r=""+Math.floor(1e8*Math.random()),i=this.get_config("callback_fn")+"["+r+"]";return n[r]=function(i){delete n[r],e(i,t)},i}},{key:"_handle_unload",value:function(){this.get_config("request_batching")?(this.get_config("capture_pageview")&&this.capture("$pageleave"),this.get_config("_capture_metrics")&&(this._requestQueue.updateUnloadMetrics(),this.capture("$capture_metrics",this._captureMetrics.metrics)),this._requestQueue.unload(),this._retryQueue.unload()):this.get_config("capture_pageview")&&this.capture("$pageleave",null,{transport:"sendBeacon"})}},{key:"_handle_queued_event",value:function(e,t,n){var r=JSON.stringify(t);this.__compress_and_send_json_request(e,r,n||un,cn)}},{key:"__compress_and_send_json_request",value:function(e,n,r,i){var o,s=function(e,n,r){return e===Et.LZ64?[{data:k.compressToBase64(n),compression:Et.LZ64},r]:e===Et.GZipJS?[Gt(Jt(n),{mtime:0}),t(t({},r),{},{blob:!0,urlQueryArgs:{compression:Et.GZipJS}})]:[{data:re(n)},r]}((o=this.compression)[Et.GZipJS]?Et.GZipJS:o[Et.LZ64]?Et.LZ64:Et.Base64,n,r),a=p(s,2),c=a[0],u=a[1];this._send_request(e,c,u,i)}},{key:"_send_request",value:function(e,n,r,i){if(pn)this.__request_queue.push([e,n,r,i]);else{var o={method:this.get_config("api_method"),transport:this.get_config("api_transport"),verbose:this.get_config("verbose")};r=U(o,r||{}),dn||(r.method="GET");var s="sendBeacon"in E.navigator&&"sendBeacon"===r.transport;if(e=zt(e,r.urlQueryArgs||{},{ip:this.get_config("ip")}),G(n)&&this.get_config("img")){var a=P.createElement("img");a.src=e,P.body.appendChild(a)}else if(s)try{E.navigator.sendBeacon(e,Vt(n,t(t({},r),{},{sendBeacon:!0})))}catch(e){this.get_config("debug")&&console.error(e)}else if(dn)try{Zt({url:e,data:n,headers:this.get_config("xhr_headers"),options:r,captureMetrics:this._captureMetrics,callback:i,retriesPerformedSoFar:0,retryQueue:this._retryQueue,onXHRError:this.get_config("on_xhr_error")})}catch(e){console.error(e)}else{var c,u=P.createElement("script");u.type="text/javascript",u.async=!0,u.defer=!0,u.src=e;var l=P.getElementsByTagName("script")[0];null===(c=l.parentNode)||void 0===c||c.insertBefore(u,l)}}}},{key:"_execute_array",value:function(e){var t,n=this,r=[],i=[],o=[];L(e,(function(e){e&&(t=e[0],H(t)?o.push(e):"function"==typeof e?e.call(n):H(e)&&"alias"===t?r.push(e):H(e)&&-1!==t.indexOf("capture")&&"function"==typeof n[t]?o.push(e):i.push(e))}));var s=function(e,t){L(e,(function(e){if(H(e[0])){var n=t;B(e,(function(e){n=n[e[0]].apply(n,e.slice(1))}))}else this[e[0]].apply(this,e.slice(1))}),t)};s(r,this),s(i,this),s(o,this)}},{key:"push",value:function(e){this._execute_array([e])}},{key:"capture",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:un;if(this.__loaded&&!He(this,!1)){this._captureMetrics.incr("capture"),"$snapshot"===e&&this._captureMetrics.incr("snapshot");var r=(n=n||un).transport;if(r&&(n.transport=r),J(e)||"string"!=typeof e)console.error("No event name provided to posthog.capture");else if(!ae($)){var i=this.persistence.remove_event_timer(e);this.persistence.update_search_keyword(P.referrer),this.get_config("store_google")&&this.persistence.update_campaign_params(),this.get_config("save_referrer")&&this.persistence.update_referrer_info(P.referrer);var o={event:e,properties:this._calculate_event_properties(e,t||{},i)};"$identify"===e&&n.$set&&(o.$set=n.$set),(o=ne(o,n._noTruncate?null:this.get_config("properties_string_max_length"))).timestamp=n.timestamp||new Date,this.get_config("debug")&&q("PostHog.js send",o);var s=JSON.stringify(o),a=this.get_config("api_host")+(n.endpoint||"/e/"),c=n!==un;return!this.get_config("request_batching")||c&&!n._batchKey||n.send_instantly?this.__compress_and_send_json_request(a,s,n):this._requestQueue.enqueue(a,o,n),this._invokeCaptureHooks(e,o),o}}}},{key:"_addCaptureHook",value:function(e){this.__captureHooks.push(e)}},{key:"_invokeCaptureHooks",value:function(e,t){this.config._onCapture(e,t),B(this.__captureHooks,(function(t){return t(e)}))}},{key:"_calculate_event_properties",value:function(e,r,i){var o=t({},r);if(o.token=this.get_config("token"),"$snapshot"===e){var s=this.persistence.properties();return o.distinct_id=s.distinct_id,o}if(void 0!==i){var a=(new Date).getTime()-i;o.$duration=parseFloat((a/1e3).toFixed(3))}if(this.sessionManager){var c=this.sessionManager.checkAndGetSessionAndWindowId(),u=c.sessionId,l=c.windowId;o.$session_id=u,o.$window_id=l}o=U({},de.properties(),this.persistence.properties(),o),"$pageview"===e&&this.get_config("_capture_performance")&&(o=U(o,function(){var e={navigation:nn("navigation"),paint:nn("paint"),resource:nn("resource")};void 0!==n(E)&&E.performance&&E.performance.clearResourceTimings&&E.performance.clearResourceTimings();var t={},r=function(e){var t=e.navigation&&e.navigation[0],n=e.navigation&&e.navigation[1]&&e.navigation[1][0],r=t&&t.indexOf("duration");if(r>-1)return n[r];var i=t&&t.indexOf("loadEventEnd"),o=t&&t.indexOf("startTime");return i>-1?(n&&n[i])-(n&&n[o]||0):void 0}(e);return r&&(t.$performance_page_loaded=r),t.$performance_raw=JSON.stringify(e),t}()));var d=this.get_config("property_blacklist");H(d)?B(d,(function(e){delete o[e]})):console.error("Invalid value for property_blacklist config: "+d);var p=this.get_config("sanitize_properties");return p&&(o=p(o,e)),o}},{key:"register",value:function(e,t){this.persistence.register(e,t)}},{key:"register_once",value:function(e,t,n){this.persistence.register_once(e,t,n)}},{key:"unregister",value:function(e){this.persistence.unregister(e)}},{key:"_register_single",value:function(e,t){this.register(s({},e,t))}},{key:"getFeatureFlag",value:function(e,t){return this.featureFlags.getFeatureFlag(e,t)}},{key:"isFeatureEnabled",value:function(e,t){return this.featureFlags.isFeatureEnabled(e,t)}},{key:"reloadFeatureFlags",value:function(){this.featureFlags.reloadFeatureFlags()}},{key:"onFeatureFlags",value:function(e){return this.featureFlags.onFeatureFlags(e)}},{key:"identify",value:function(e,t,n){if(e){this._captureMetrics.incr("identify");var r=this.get_distinct_id();if(this.register({$user_id:e}),!this.get_property("$device_id")){var i=r;this.register_once({$had_persisted_distinct_id:!0,$device_id:i},"")}e!==r&&e!==this.get_property(Ve)&&(this.unregister(Ve),this.register({distinct_id:e})),e===r||this.get_property("$device_id")&&r!==this.get_property("$device_id")?(t&&this.people.set(t),n&&this.people.set_once(n)):(this.capture("$identify",{distinct_id:e,$anon_distinct_id:r},{$set:t||{},$set_once:n||{}}),this.featureFlags.setAnonymousDistinctId(r)),e!==r&&this.reloadFeatureFlags()}else console.error("Unique user id has not been set in posthog.identify")}},{key:"group",value:function(e,n,r){if(e&&n){this._captureMetrics.incr("group");var i=this.getGroups();this.register({$groups:t(t({},i),{},s({},e,n))}),r&&this.capture("$groupidentify",{$group_type:e,$group_key:n,$group_set:r}),i[e]!==n&&this.reloadFeatureFlags()}else console.error("posthog.group requires a group type and group key")}},{key:"reset",value:function(e){var t=this.get_property("$device_id");this.persistence.clear(),this.sessionManager.resetSessionId();var n=this.get_config("get_device_id")(se());this.register_once({distinct_id:n,$device_id:e?n:t},"")}},{key:"get_distinct_id",value:function(){return this.get_property("distinct_id")}},{key:"getGroups",value:function(){return this.get_property("$groups")||{}}},{key:"alias",value:function(e,t){return e===this.get_property(ze)?(N("Attempting to create alias for existing People user - aborting."),-2):(J(t)&&(t=this.get_distinct_id()),e!==t?(this._register_single(Ve,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(console.error("alias matches current distinct_id - skipping api call."),this.identify(e),-1))}},{key:"set_config",value:function(e){var n=t({},this.config);G(e)&&(U(this.config,e),this.get_config("persistence_name")||(this.config.persistence_name=this.config.cookie_name),this.get_config("disable_persistence")||(this.config.disable_persistence=this.config.disable_cookie),this.persistence&&this.persistence.update_config(this.config),Ee.is_supported()&&"true"===Ee.get("ph_debug")&&(this.config.debug=!0),this.get_config("debug")&&(S.DEBUG=!0),this.sessionRecording&&void 0!==e.disable_session_recording&&n.disable_session_recording!==e.disable_session_recording&&(e.disable_session_recording?this.sessionRecording.stopRecording():this.sessionRecording.startRecordingIfEnabled()))}},{key:"startSessionRecording",value:function(){this.set_config({disable_session_recording:!1})}},{key:"stopSessionRecording",value:function(){this.set_config({disable_session_recording:!0})}},{key:"sessionRecordingStarted",value:function(){var e;return!(null===(e=this.sessionRecording)||void 0===e||!e.started())}},{key:"get_config",value:function(e){var t;return null===(t=this.config)||void 0===t?void 0:t[e]}},{key:"get_property",value:function(e){return this.persistence.props[e]}},{key:"toString",value:function(){var e,t=null!==(e=this.get_config("name"))&&void 0!==e?e:ln;return t!==ln&&(t="posthog."+t),t}},{key:"_gdpr_init",value:function(){"localStorage"===this.get_config("opt_out_capturing_persistence_type")&&Ee.is_supported()&&(!this.has_opted_in_capturing()&&this.has_opted_in_capturing({persistence_type:"cookie"})&&this.opt_in_capturing({enable_persistence:!1}),!this.has_opted_out_capturing()&&this.has_opted_out_capturing({persistence_type:"cookie"})&&this.opt_out_capturing({clear_persistence:!1}),this.clear_opt_in_out_capturing({persistence_type:"cookie",enable_persistence:!1})),this.has_opted_out_capturing()?this._gdpr_update_persistence({clear_persistence:!0}):this.has_opted_in_capturing()||!this.get_config("opt_out_capturing_by_default")&&!xe.get("ph_optout")||(xe.remove("ph_optout"),this.opt_out_capturing({clear_persistence:this.get_config("opt_out_persistence_by_default")}))}},{key:"_gdpr_update_persistence",value:function(e){var t;if(e&&e.clear_persistence)t=!0;else{if(!e||!e.enable_persistence)return;t=!1}this.get_config("disable_persistence")||this.persistence.disabled===t||this.persistence.set_disabled(t)}},{key:"_gdpr_call_func",value:function(e,t){return t=U({capture:this.capture.bind(this),persistence_type:this.get_config("opt_out_capturing_persistence_type"),cookie_prefix:this.get_config("opt_out_capturing_cookie_prefix"),cookie_expiration:this.get_config("cookie_expiration"),cross_subdomain_cookie:this.get_config("cross_subdomain_cookie"),secure_cookie:this.get_config("secure_cookie")},t||{}),Ee.is_supported()||"localStorage"!==t.persistence_type||(t.persistence_type="cookie"),e(this.get_config("token"),{capture:t.capture,captureEventName:t.capture_event_name,captureProperties:t.capture_properties,persistenceType:t.persistence_type,persistencePrefix:t.cookie_prefix,cookieExpiration:t.cookie_expiration,crossSubdomainCookie:t.cross_subdomain_cookie,secureCookie:t.secure_cookie})}},{key:"opt_in_capturing",value:function(e){e=U({enable_persistence:!0},e||{}),this._gdpr_call_func(Me,e),this._gdpr_update_persistence(e)}},{key:"opt_out_capturing",value:function(e){var t=U({clear_persistence:!0},e||{});this._gdpr_call_func(Re,t),this._gdpr_update_persistence(t)}},{key:"has_opted_in_capturing",value:function(e){return this._gdpr_call_func(qe,e)}},{key:"has_opted_out_capturing",value:function(e){return this._gdpr_call_func(je,e)}},{key:"clear_opt_in_out_capturing",value:function(e){var t=U({enable_persistence:!0},null!=e?e:{});this._gdpr_call_func(Ne,t),this._gdpr_update_persistence(t)}},{key:"debug",value:function(e){!1===e?(E.console.log("You've disabled debug mode."),localStorage&&localStorage.removeItem("ph_debug"),this.set_config({debug:!1})):(E.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),localStorage&&localStorage.setItem("ph_debug","true"),this.set_config({debug:!0}))}},{key:"decodeLZ64",value:function(e){return k.decompressFromBase64(e||null)}}]),e}();!function(e,t){for(var n=0;n<t.length;n++)e.prototype[t[n]]=X(e.prototype[t[n]])}(_n,["identify"]);var gn={},vn=function(){sn.init=function(e,t,n){if(n)return sn[n]||(sn[n]=gn[n]=hn(e||"",t||{},n),sn[n]._loaded()),sn[n];var r=sn;return gn.posthog?r=gn.posthog:e&&((r=hn(e,t||{},ln))._loaded(),gn.posthog=r),sn=r,on===rn.INIT_SNIPPET&&(E.posthog=sn),B(gn,(function(e,t){t!==ln&&(sn[t]=e)})),r}};on=rn.INIT_SNIPPET,J(E.posthog)&&(E.posthog=[]),(sn=E.posthog).__loaded||sn.config&&sn.persistence?console.error("PostHog library has already been downloaded at least once."):(B(sn._i,(function(e){e&&H(e)&&(gn[e[2]]=hn.apply(void 0,f(e)))})),vn(),sn.init(),B(gn,(function(e){e._loaded()})),function(){function e(){e.done||(e.done=!0,pn=!1,B(gn,(function(e){e._dom_loaded()})))}P.addEventListener&&("complete"===P.readyState?e():P.addEventListener("DOMContentLoaded",e,!1)),le(E,"load",e,!0)}())}();
2
+ //# sourceMappingURL=array.js.map